diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/Changelog mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/Changelog --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/Changelog 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/Changelog 2023-03-03 13:29:59.000000000 +0000 @@ -1,85 +1,54 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. -version 5.1.2: -- avcodec/dstdec: Check for overflow in build_filter() -- avformat/spdifdec: Use 64bit to compute bit rate -- avformat/rpl: Use 64bit for duration computation -- avformat/xwma: Use av_rescale() for duration computation -- avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration calculation -- avformat/sbgdec: Check ts_int in genrate_intervals -- avformat/sbgdec: clamp end_ts -- avformat/rmdec: check tag_size -- avformat/nutdec: Check fields -- avformat/flvdec: Use 64bit for sum_flv_tag_size -- avformat/jacosubdec: Fix overflow in get_shift() -- avformat/genh: Check nb_channels for IMA ADPCM -- avformat/dxa: avoid bpc overflows -- avformat/dhav: Use 64bit seek_back -- avformat/cafdec: Check that nb_frasmes fits within 64bit -- avformat/asfdec_o: Limit packet offset -- avformat/apm: Use 64bit for bit_rate computation -- avformat/ape: Check frames size -- avformat/icodec: Check nb_pal -- avformat/aiffdec: Use 64bit for block_duration use -- avformat/aiffdec: Check block_duration -- avformat/mxfdec: only probe max run in -- avformat/mxfdec: Check run_in is within 65536 -- avcodec/mjpegdec: Check for unsupported bayer case -- avcodec/apedec: Fix integer overflow in filter_3800() -- avcodec/tta: Check 24bit scaling for overflow -- avcodec/mobiclip: Check quantizer for overflow -- avcodec/exr: Check preview psize -- avcodec/tiff: Fix loop detection -- libavformat/hls: Free keys -- avcodec/fmvc: Move frame allocation to a later stage -- avfilter/vf_showinfo: remove backspaces -- avcodec/speedhq: Check width -- avcodec/bink: disallow odd positioned scaled blocks -- avformat/cafenc: derive Opus frame size from the relevant stream parameters -- avformat/dashdec: Fix crash on invalid input/ENOMEM, fix leak -- lavc/videotoolbox: do not pass AVCodecContext to decoder output callback -- lavc/pthread_frame: always transfer stashed hwaccel state -- avcodec/arm/sbcenc: avoid callee preserved vfp registers -- avformat/riffdec: don't unconditionally overwrite WAVEFORMATEXTENSIBLE layout -- avfilter/vf_scale: overwrite the width and height expressions with the original values -- lavc/pthread_frame: avoid leaving stale hwaccel state in worker threads -- avutil/tests/.gitignore: Add channel_layout testtool - - -version 5.1.1: -- avformat/asfdec_o: limit recursion depth in asf_read_unknown() -- avformat/mov: Check count sums in build_open_gop_key_points() -- doc/git-howto.texi: Document commit signing -- libavcodec/8bps: Check that line lengths fit within the buffer -- avcodec/midivid: Perform lzss_uncompress() before ff_reget_buffer() -- libavformat/iff: Check for overflow in body_end calculation -- avformat/avidec: Prevent entity expansion attacks -- avcodec/h263dec: Sanity check against minimal I/P frame size -- avcodec/hevcdec: Check s->ref in the md5 path similar to hwaccel -- avcodec/mpegaudiodec_template: use unsigned shift in handle_crc() -- avformat/subviewerdec: Make read_ts() more flexible -- avcodec/mjpegdec: bayer and rct are incompatible -- MAINTAINERS: Add ED25519 key for signing my commits in the future -- avcodec/pngdec: Fix APNG_DISPOSE_OP_BACKGROUND -- avcodec/libvpx: fix assembling vp9 packets with alpha channel -- fftools/ffmpeg_opt: try to propagate the requested output channel layout -- avcodec/libsvtav1: properly initialize the flush EbBufferHeaderType struct -- configure: enable the av1_frame_split bsf for the av1 decoder -- swresample/swresample: fill the correct buffer to print the output layout string -- ffprobe: restore reporting error code for failed inputs -- ipfsgateway: Remove default gateway -- avcodec/libspeexdec: Fix use of uninitialized value -- avformat/avisynth: use ch_layout.nb_channels for channel count -- fate/lavf-image: Disable file checksums for exr tests -- tests/fate-run: Allow to skip file checksums for lavf_image -- fate/imf: Rename IMF fate-target -- avcodec/alac: don't fail if channels aren't set during init() when extradata is valid -- configure: properly require libx264 if enabled +version 6.0: +- Radiance HDR image support +- ddagrab (Desktop Duplication) video capture filter +- ffmpeg -shortest_buf_duration option +- ffmpeg now requires threading to be built +- ffmpeg now runs every muxer in a separate thread +- Add new mode to cropdetect filter to detect crop-area based on motion vectors and edges +- VAAPI decoding and encoding for 10/12bit 422, 10/12bit 444 HEVC and VP9 +- WBMP (Wireless Application Protocol Bitmap) image format +- a3dscope filter +- bonk decoder and demuxer +- Micronas SC-4 audio decoder +- LAF demuxer +- APAC decoder and demuxer +- Media 100i decoders +- DTS to PTS reorder bsf +- ViewQuest VQC decoder +- backgroundkey filter +- nvenc AV1 encoding support +- MediaCodec decoder via NDKMediaCodec +- MediaCodec encoder +- oneVPL support for QSV +- QSV AV1 encoder +- QSV decoding and encoding for 10/12bit 422, 10/12bit 444 HEVC and VP9 +- showcwt multimedia filter +- corr video filter +- adrc audio filter +- afdelaysrc audio filter +- WADY DPCM decoder and demuxer +- CBD2 DPCM decoder +- ssim360 video filter +- ffmpeg CLI new options: -stats_enc_pre[_fmt], -stats_enc_post[_fmt], + -stats_mux_pre[_fmt] +- hstack_vaapi, vstack_vaapi and xstack_vaapi filters +- XMD ADPCM decoder and demuxer +- media100 to mjpegb bsf +- ffmpeg CLI new option: -fix_sub_duration_heartbeat +- WavArc decoder and demuxer +- CrystalHD decoders deprecated +- SDNS demuxer +- RKA decoder and demuxer +- filtergraph syntax in ffmpeg CLI now supports passing file contents + as option values, by prefixing option name with '/' +- hstack_qsv, vstack_qsv and xstack_qsv filters version 5.1: -- add ipfs/ipns protocol support +- add ipfs/ipns gateway support - dialogue enhance audio filter - dropped obsolete XvMC hwaccel - pcm-bluray encoder @@ -102,6 +71,7 @@ - PHM image format support - remap_opencl filter - added chromakey_cuda filter +- added bilateral_cuda filter version 5.0: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/compat/cuda/cuda_runtime.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/compat/cuda/cuda_runtime.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/compat/cuda/cuda_runtime.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/compat/cuda/cuda_runtime.h 2023-03-03 13:29:59.000000000 +0000 @@ -187,5 +187,6 @@ static inline __device__ float __sinf(float a) { return __nvvm_sin_approx_f(a); } static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a); } static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); } +static inline __device__ float __powf(float a, float b) { return __nvvm_ex2_approx_f(__nvvm_lg2_approx_f(a) * b); } #endif /* COMPAT_CUDA_CUDA_RUNTIME_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/compat/windows/mswindres mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/compat/windows/mswindres --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/compat/windows/mswindres 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/compat/windows/mswindres 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ "$1" = "--version" ]; then + rc.exe -? + exit $? +fi + +if [ $# -lt 2 ]; then + echo "Usage: mswindres [-I/include/path ...] [-DSOME_DEFINE ...] [-o output.o] input.rc [output.o]" >&2 + exit 0 +fi + +EXTRA_OPTS="-nologo" + +while [ $# -gt 2 ]; do + case $1 in + -D*) EXTRA_OPTS="$EXTRA_OPTS -d$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;; + -I*) EXTRA_OPTS="$EXTRA_OPTS -i$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;; + -o) OPT_OUT="$2"; shift ;; + esac + shift +done + +IN="$1" +if [ -z "$OPT_OUT" ]; then + OUT="$2" +else + OUT="$OPT_OUT" +fi + +eval set -- $EXTRA_OPTS +rc.exe "$@" -fo "$OUT" "$IN" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/configure mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/configure --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/configure 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/configure 2023-03-03 13:29:59.000000000 +0000 @@ -341,6 +341,7 @@ --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect] --enable-libdrm enable DRM code (Linux) [no] --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no] + --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no] --enable-libnpp enable Nvidia Performance Primitives-based code [no] --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no] --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect] @@ -461,6 +462,7 @@ --disable-mmi disable Loongson MMI optimizations --disable-lsx disable Loongson LSX optimizations --disable-lasx disable Loongson LASX optimizations + --disable-rvv disable RISC-V Vector optimizations --disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself): @@ -1315,21 +1317,6 @@ EOF } -check_complexfunc(){ - log check_complexfunc "$@" - func=$1 - narg=$2 - shift 2 - test $narg = 2 && args="f, g" || args="f * I" - disable $func - test_ld "cc" "$@" < -#include -float foo(complex float f, complex float g) { return $func($args); } -int main(void){ return (int) foo; } -EOF -} - check_mathfunc(){ log check_mathfunc "$@" func=$1 @@ -1723,29 +1710,30 @@ " EXAMPLE_LIST=" + avio_http_serve_files_example avio_list_dir_example - avio_reading_example + avio_read_callback_example decode_audio_example + decode_filter_audio_example + decode_filter_video_example decode_video_example - demuxing_decoding_example + demux_decode_example encode_audio_example encode_video_example extract_mvs_example filter_audio_example - filtering_audio_example - filtering_video_example - http_multiclient_example hw_decode_example - metadata_example - muxing_example - qsvdec_example - remuxing_example - resampling_audio_example - scaling_video_example + mux_example + qsv_decode_example + remux_example + resample_audio_example + scale_video_example + show_metadata_example transcode_aac_example - transcoding_example + transcode_example vaapi_encode_example vaapi_transcode_example + qsv_transcode_example " EXTERNAL_AUTODETECT_LIBRARY_LIST=" @@ -1921,6 +1909,7 @@ HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST libmfx + libvpl mmal omx opencl @@ -2124,6 +2113,10 @@ vsx " +ARCH_EXT_LIST_RISCV=" + rvv +" + ARCH_EXT_LIST_X86=" $ARCH_EXT_LIST_X86_SIMD cpunop @@ -2133,6 +2126,7 @@ ARCH_EXT_LIST=" $ARCH_EXT_LIST_ARM $ARCH_EXT_LIST_PPC + $ARCH_EXT_LIST_RISCV $ARCH_EXT_LIST_X86 $ARCH_EXT_LIST_MIPS $ARCH_EXT_LIST_LOONGSON @@ -2143,6 +2137,7 @@ fast_64bit fast_clz fast_cmov + fast_float16 local_aligned simd_align_16 simd_align_32 @@ -2215,11 +2210,6 @@ intrinsics_neon " -COMPLEX_FUNCS=" - cabs - cexp -" - MATH_FUNCS=" atanf atan2f @@ -2301,6 +2291,7 @@ nanosleep PeekNamedPipe posix_memalign + prctl pthread_cancel sched_getaffinity SecItemImport @@ -2352,6 +2343,8 @@ " TYPES_LIST=" + DPI_AWARENESS_CONTEXT + IDXGIOutput5 kCMVideoCodecType_HEVC kCMVideoCodecType_HEVCWithAlpha kCMVideoCodecType_VP9 @@ -2391,7 +2384,6 @@ $(add_suffix _inline $ARCH_EXT_LIST) $ARCH_FEATURES $BUILTIN_LIST - $COMPLEX_FUNCS $HAVE_LIST_CMDLINE $HAVE_LIST_PUB $HEADERS_LIST @@ -2447,7 +2439,6 @@ faandct faanidct fdctdsp - flacdsp fmtconvert frame_thread_encoder g722dsp @@ -2459,14 +2450,15 @@ h264parse h264pred h264qpel + h264_sei hevcparse + hevc_sei hpeldsp huffman huffyuvdsp huffyuvencdsp idctdsp iirfilter - mdct15 inflate_wrapper intrax8 iso_media @@ -2488,6 +2480,8 @@ mpegvideo mpegvideodec mpegvideoenc + msmpeg4dec + msmpeg4enc mss34dsp pixblockdsp qpeldsp @@ -2636,6 +2630,8 @@ vsx_deps="altivec" power8_deps="vsx" +rvv_deps="riscv" + loongson2_deps="mips" loongson3_deps="mips" mmi_deps_any="loongson2 loongson3" @@ -2728,35 +2724,39 @@ faanidct_deps="faan" faanidct_select="idctdsp" h264dsp_select="startcode" -hevcparse_select="atsc_a53 golomb" +h264_sei_select="atsc_a53 golomb" +hevcparse_select="golomb" +hevc_sei_select="atsc_a53 golomb" frame_thread_encoder_deps="encoders threads" inflate_wrapper_deps="zlib" -intrax8_select="blockdsp idctdsp" +intrax8_select="blockdsp wmv2dsp" iso_media_select="mpeg4audio" mdct_select="fft" -mdct15_select="fft" -me_cmp_select="fdctdsp idctdsp pixblockdsp" +me_cmp_select="idctdsp" mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp mpegaudioheader" mpegaudiodsp_select="dct" -mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp videodsp" -mpegvideodec_select="mpegvideo mpeg_er" -mpegvideoenc_select="aandcttables me_cmp mpegvideo pixblockdsp qpeldsp" +mpegvideo_select="blockdsp hpeldsp idctdsp videodsp" +mpegvideodec_select="h264chroma mpegvideo mpeg_er" +mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp" +msmpeg4dec_select="h263_decoder" +msmpeg4enc_select="h263_encoder" vc1dsp_select="h264chroma qpeldsp startcode" rdft_select="fft" # decoders / encoders -aac_decoder_select="adts_header mdct15 mdct mpeg4audio sinewin" -aac_fixed_decoder_select="adts_header mdct mpeg4audio" -aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin" +aac_decoder_select="adts_header mpeg4audio sinewin" +aac_fixed_decoder_select="adts_header mpeg4audio" +aac_encoder_select="audio_frame_queue iirfilter lpc sinewin" aac_latm_decoder_select="aac_decoder aac_latm_parser" -ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct" -ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct" -ac3_encoder_select="ac3dsp audiodsp mdct me_cmp" -ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp" +ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert" +ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp" +ac3_encoder_select="ac3dsp audiodsp me_cmp" +ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp" acelp_kelvin_decoder_select="audiodsp" adpcm_g722_decoder_select="g722dsp" adpcm_g722_encoder_select="g722dsp" +agm_decoder_select="idctdsp" aic_decoder_select="golomb idctdsp" alac_encoder_select="lpc" als_decoder_select="bswapdsp mpeg4audio" @@ -2767,47 +2767,37 @@ ape_decoder_select="bswapdsp llauddsp" apng_decoder_select="inflate_wrapper" apng_encoder_select="deflate_wrapper llvidencdsp" -aptx_decoder_select="audio_frame_queue" aptx_encoder_select="audio_frame_queue" -aptx_hd_decoder_select="audio_frame_queue" aptx_hd_encoder_select="audio_frame_queue" asv1_decoder_select="blockdsp bswapdsp idctdsp" asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp" asv2_decoder_select="blockdsp bswapdsp idctdsp" asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp" -atrac1_decoder_select="mdct sinewin" -atrac3_decoder_select="mdct" -atrac3al_decoder_select="mdct" -atrac3p_decoder_select="mdct sinewin" -atrac3pal_decoder_select="mdct sinewin" -atrac9_decoder_select="mdct" +atrac1_decoder_select="sinewin" av1_decoder_select="av1_frame_split_bsf cbs_av1" bink_decoder_select="blockdsp hpeldsp" -binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs" -binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs" +binkaudio_dct_decoder_select="wma_freqs" +binkaudio_rdft_decoder_select="wma_freqs" cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp" clearvideo_decoder_select="idctdsp" cllc_decoder_select="bswapdsp" comfortnoise_encoder_select="lpc" -cook_decoder_select="audiodsp mdct sinewin" +cook_decoder_select="audiodsp sinewin" cri_decoder_select="mjpeg_decoder" cscd_decoder_suggest="zlib" -dca_decoder_select="mdct" -dca_encoder_select="mdct" dds_decoder_select="texturedsp" dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc" dnxhd_decoder_select="blockdsp idctdsp" -dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp" -dolby_e_decoder_select="mdct" +dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp" dvvideo_decoder_select="dvprofile idctdsp" dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp" dxa_decoder_deps="zlib" dxv_decoder_select="lzf texturedsp" eac3_decoder_select="ac3_decoder" eac3_encoder_select="ac3_encoder" -eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo" +eamad_decoder_select="aandcttables blockdsp bswapdsp" eatgq_decoder_select="aandcttables" -eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp" +eatqi_decoder_select="aandcttables blockdsp bswapdsp" exr_decoder_deps="zlib" exr_encoder_deps="zlib" ffv1_decoder_select="rangecoder" @@ -2815,8 +2805,7 @@ ffvhuff_decoder_select="huffyuv_decoder" ffvhuff_encoder_select="huffyuv_encoder" fic_decoder_select="golomb" -flac_decoder_select="flacdsp" -flac_encoder_select="bswapdsp flacdsp lpc" +flac_encoder_select="bswapdsp lpc" flashsv2_decoder_select="inflate_wrapper" flashsv2_encoder_select="deflate_wrapper" flashsv_decoder_select="inflate_wrapper" @@ -2835,18 +2824,18 @@ h263i_decoder_select="h263_decoder" h263p_decoder_select="h263_decoder" h263p_encoder_select="h263_encoder" -h264_decoder_select="atsc_a53 cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp" +h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp" h264_decoder_suggest="error_resilience" hap_decoder_select="snappy texturedsp" hap_encoder_deps="libsnappy" hap_encoder_select="texturedspenc" -hevc_decoder_select="atsc_a53 bswapdsp cabac dovi_rpu golomb hevcparse videodsp" +hevc_decoder_select="bswapdsp cabac dovi_rpu golomb hevcparse hevc_sei videodsp" huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp" huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp" hymt_decoder_select="huffyuv_decoder" iac_decoder_select="imc_decoder" -imc_decoder_select="bswapdsp fft mdct sinewin" -imm4_decoder_select="bswapdsp" +imc_decoder_select="bswapdsp sinewin" +imm4_decoder_select="bswapdsp idctdsp" imm5_decoder_select="h264_decoder hevc_decoder" indeo3_decoder_select="hpeldsp" indeo4_decoder_select="ividsp" @@ -2856,12 +2845,13 @@ jpegls_decoder_select="mjpeg_decoder" jv_decoder_select="blockdsp" lagarith_decoder_select="llviddsp" -ljpeg_encoder_select="idctdsp jpegtables" +ljpeg_encoder_select="jpegtables" lscr_decoder_select="inflate_wrapper" magicyuv_decoder_select="llviddsp" magicyuv_encoder_select="llvidencdsp" -mdec_decoder_select="blockdsp bswapdsp idctdsp mpegvideo" -metasound_decoder_select="lsp mdct sinewin" +mdec_decoder_select="blockdsp bswapdsp idctdsp" +media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder" +metasound_decoder_select="lsp sinewin" mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp" mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables" mjpeg_encoder_select="jpegtables mpegvideoenc" @@ -2884,45 +2874,44 @@ mpc8_decoder_select="mpegaudiodsp" mpegvideo_decoder_select="mpegvideodec" mpeg1video_decoder_select="mpegvideodec" -mpeg1video_encoder_select="mpegvideoenc h263dsp" +mpeg1video_encoder_select="mpegvideoenc" mpeg2video_decoder_select="mpegvideodec" -mpeg2video_encoder_select="mpegvideoenc h263dsp" +mpeg2video_encoder_select="mpegvideoenc" mpeg4_decoder_select="h263_decoder mpeg4video_parser" -mpeg4_encoder_select="h263_encoder" +mpeg4_encoder_select="h263_encoder qpeldsp" msa1_decoder_select="mss34dsp" mscc_decoder_select="inflate_wrapper" -msmpeg4v1_decoder_select="h263_decoder" -msmpeg4v2_decoder_select="h263_decoder" -msmpeg4v2_encoder_select="h263_encoder" -msmpeg4v3_decoder_select="h263_decoder" -msmpeg4v3_encoder_select="h263_encoder" +msmpeg4v1_decoder_select="msmpeg4dec" +msmpeg4v2_decoder_select="msmpeg4dec" +msmpeg4v2_encoder_select="msmpeg4enc" +msmpeg4v3_decoder_select="msmpeg4dec" +msmpeg4v3_encoder_select="msmpeg4enc" mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder" mts2_decoder_select="jpegtables mss34dsp" mv30_decoder_select="aandcttables blockdsp" mvha_decoder_select="inflate_wrapper llviddsp" mwsc_decoder_select="inflate_wrapper" mxpeg_decoder_select="mjpeg_decoder" -nellymoser_decoder_select="mdct sinewin" -nellymoser_encoder_select="audio_frame_queue mdct sinewin" +nellymoser_decoder_select="sinewin" +nellymoser_encoder_select="audio_frame_queue sinewin" notchlc_decoder_select="lzf" nuv_decoder_select="idctdsp" -on2avc_decoder_select="mdct" opus_decoder_deps="swresample" -opus_decoder_select="mdct15" -opus_encoder_select="audio_frame_queue mdct15" +opus_encoder_select="audio_frame_queue" png_decoder_select="inflate_wrapper" png_encoder_select="deflate_wrapper llvidencdsp" prores_decoder_select="blockdsp idctdsp" prores_encoder_select="fdctdsp" +prores_aw_encoder_select="fdctdsp" +prores_ks_encoder_select="fdctdsp" qcelp_decoder_select="lsp" -qdm2_decoder_select="mdct rdft mpegaudiodsp" +qdm2_decoder_select="mpegaudiodsp" ra_144_decoder_select="audiodsp" ra_144_encoder_select="audio_frame_queue lpc audiodsp" ralf_decoder_select="golomb" rasc_decoder_select="inflate_wrapper" rawvideo_decoder_select="bswapdsp" rscc_decoder_deps="zlib" -rtjpeg_decoder_select="me_cmp" rv10_decoder_select="h263_decoder" rv10_encoder_select="h263_encoder" rv20_decoder_select="h263_decoder" @@ -2933,13 +2922,13 @@ shorten_decoder_select="bswapdsp" sipr_decoder_select="lsp" smvjpeg_decoder_select="mjpeg_decoder" -snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp" -snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder" +snow_decoder_select="dwt h264qpel hpeldsp rangecoder videodsp" +snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp" sonic_decoder_select="golomb rangecoder" sonic_encoder_select="golomb rangecoder" sonic_ls_encoder_select="golomb rangecoder" sp5x_decoder_select="mjpeg_decoder" -speedhq_decoder_select="mpegvideo" +speedhq_decoder_select="blockdsp idctdsp" speedhq_encoder_select="mpegvideoenc" srgc_decoder_select="inflate_wrapper" svq1_decoder_select="hpeldsp" @@ -2959,17 +2948,16 @@ truemotion2_decoder_select="bswapdsp" truespeech_decoder_select="bswapdsp" tscc_decoder_select="inflate_wrapper" -twinvq_decoder_select="mdct lsp sinewin" +twinvq_decoder_select="lsp sinewin" txd_decoder_select="texturedsp" utvideo_decoder_select="bswapdsp llviddsp" utvideo_encoder_select="bswapdsp huffman llvidencdsp" vble_decoder_select="llviddsp" vbn_decoder_select="texturedsp" vbn_encoder_select="texturedspenc" -vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp" +vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp" vc1image_decoder_select="vc1_decoder" -vorbis_decoder_select="mdct" -vorbis_encoder_select="audio_frame_queue mdct" +vorbis_encoder_select="audio_frame_queue" vp3_decoder_select="hpeldsp vp3dsp videodsp" vp4_decoder_select="vp3_decoder" vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp" @@ -2982,16 +2970,16 @@ wcmv_decoder_select="inflate_wrapper" webp_decoder_select="vp8_decoder exif" wmalossless_decoder_select="llauddsp" -wmapro_decoder_select="mdct sinewin wma_freqs" -wmav1_decoder_select="mdct sinewin wma_freqs" -wmav1_encoder_select="mdct sinewin wma_freqs" -wmav2_decoder_select="mdct sinewin wma_freqs" -wmav2_encoder_select="mdct sinewin wma_freqs" -wmavoice_decoder_select="lsp rdft dct mdct sinewin" -wmv1_decoder_select="h263_decoder" -wmv1_encoder_select="h263_encoder" -wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp" -wmv2_encoder_select="h263_encoder wmv2dsp" +wmapro_decoder_select="sinewin wma_freqs" +wmav1_decoder_select="sinewin wma_freqs" +wmav1_encoder_select="sinewin wma_freqs" +wmav2_decoder_select="sinewin wma_freqs" +wmav2_encoder_select="sinewin wma_freqs" +wmavoice_decoder_select="lsp rdft dct sinewin" +wmv1_decoder_select="msmpeg4dec" +wmv1_encoder_select="msmpeg4enc" +wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp" +wmv2_encoder_select="msmpeg4enc wmv2dsp" wmv3_decoder_select="vc1_decoder" wmv3image_decoder_select="wmv3_decoder" xma1_decoder_select="wmapro_decoder" @@ -3142,8 +3130,12 @@ vaapi_encode_deps="vaapi" v4l2_m2m_deps="linux_videodev2_h sem_timedwait" +bilateral_cuda_filter_deps="ffnvcodec" +bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm" chromakey_cuda_filter_deps="ffnvcodec" chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm" +colorspace_cuda_filter_deps="ffnvcodec" +colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm" hwupload_cuda_filter_deps="ffnvcodec" scale_npp_filter_deps="ffnvcodec libnpp" scale2ref_npp_filter_deps="ffnvcodec libnpp" @@ -3156,6 +3148,8 @@ overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm" sharpen_npp_filter_deps="ffnvcodec libnpp" +ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO" + amf_deps_any="libdl LoadLibrary" nvenc_deps="ffnvcodec" nvenc_deps_any="libdl LoadLibrary" @@ -3163,6 +3157,10 @@ aac_mf_encoder_deps="mediafoundation" ac3_mf_encoder_deps="mediafoundation" av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS" +av1_mediacodec_decoder_deps="mediacodec" +av1_mediacodec_decoder_extralibs="-landroid" +av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1" +av1_nvenc_encoder_select="atsc_a53" h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m" h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m" h264_amf_encoder_deps="amf" @@ -3170,7 +3168,11 @@ h264_cuvid_decoder_deps="cuvid" h264_cuvid_decoder_select="h264_mp4toannexb_bsf" h264_mediacodec_decoder_deps="mediacodec" +h264_mediacodec_decoder_extralibs="-landroid" h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser" +h264_mediacodec_encoder_deps="mediacodec" +h264_mediacodec_encoder_extralibs="-landroid" +h264_mediacodec_encoder_select="h264_metadata" h264_mf_encoder_deps="mediafoundation" h264_mmal_decoder_deps="mmal" h264_nvenc_encoder_deps="nvenc" @@ -3180,7 +3182,7 @@ h264_qsv_encoder_select="atsc_a53 qsvenc" h264_rkmpp_decoder_deps="rkmpp" h264_rkmpp_decoder_select="h264_mp4toannexb_bsf" -h264_vaapi_encoder_select="cbs_h264 vaapi_encode" +h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode" h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m" h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf" h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m" @@ -3188,7 +3190,11 @@ hevc_cuvid_decoder_deps="cuvid" hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf" hevc_mediacodec_decoder_deps="mediacodec" +hevc_mediacodec_decoder_extralibs="-landroid" hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser" +hevc_mediacodec_encoder_deps="mediacodec" +hevc_mediacodec_encoder_extralibs="-landroid" +hevc_mediacodec_encoder_select="hevc_metadata" hevc_mf_encoder_deps="mediafoundation" hevc_nvenc_encoder_deps="nvenc" hevc_nvenc_encoder_select="atsc_a53" @@ -3197,7 +3203,7 @@ hevc_rkmpp_decoder_deps="rkmpp" hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf" hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC" -hevc_vaapi_encoder_select="cbs_h265 vaapi_encode" +hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode" hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m" hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf" hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m" @@ -3250,14 +3256,16 @@ vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m" wmv3_crystalhd_decoder_select="crystalhd" av1_qsv_decoder_select="qsvdec" +av1_qsv_encoder_select="qsvenc" +av1_qsv_encoder_deps="libvpl" +av1_amf_encoder_deps="amf" # parsers aac_parser_select="adts_header mpeg4audio" av1_parser_select="cbs_av1" -h264_parser_select="atsc_a53 golomb h264dsp h264parse" -hevc_parser_select="hevcparse" +h264_parser_select="golomb h264dsp h264parse h264_sei" +hevc_parser_select="hevcparse hevc_sei" mpegaudio_parser_select="mpegaudioheader" -mpegvideo_parser_select="mpegvideo" mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp" vc1_parser_select="vc1dsp" @@ -3266,6 +3274,7 @@ av1_frame_merge_bsf_select="cbs_av1" av1_frame_split_bsf_select="cbs_av1" av1_metadata_bsf_select="cbs_av1" +dts2pts_bsf_select="cbs_h264 h264parse" eac3_core_bsf_select="ac3_parser" filter_units_bsf_select="cbs" h264_metadata_bsf_deps="const_nan" @@ -3360,7 +3369,6 @@ libopus_encoder_deps="libopus" libopus_encoder_select="audio_frame_queue" librav1e_encoder_deps="librav1e" -librav1e_encoder_select="extract_extradata_bsf" librsvg_decoder_deps="librsvg" libshine_encoder_deps="libshine" libshine_encoder_select="audio_frame_queue mpegaudioheader" @@ -3387,6 +3395,7 @@ libx264rgb_encoder_deps="libx264" libx264rgb_encoder_select="libx264_encoder" libx265_encoder_deps="libx265" +libx265_encoder_select="atsc_a53" libxavs_encoder_deps="libxavs" libxavs2_encoder_deps="libxavs2" libxvid_encoder_deps="libxvid" @@ -3427,8 +3436,8 @@ flv_muxer_select="aac_adtstoasc_bsf" gxf_muxer_select="pcm_rechunk_bsf" hds_muxer_select="flv_muxer" -hls_demuxer_select="adts_header ac3_parser" -hls_muxer_select="mpegts_muxer" +hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer" +hls_muxer_select="mov_muxer mpegts_muxer" hls_muxer_suggest="gcrypt openssl" image2_alias_pix_demuxer_select="image2_demuxer" image2_brender_pix_demuxer_select="image2_demuxer" @@ -3521,6 +3530,7 @@ gdigrab_indev_extralibs="-lgdi32" gdigrab_indev_select="bmp_decoder" iec61883_indev_deps="libiec61883" +iec61883_indev_select="dv_demuxer" jack_indev_deps="libjack" jack_indev_deps_any="sem_timedwait dispatch_dispatch_h" kmsgrab_indev_deps="libdrm" @@ -3593,8 +3603,8 @@ udplite_protocol_select="network" unix_protocol_deps="sys_un_h" unix_protocol_select="network" -ipfs_protocol_select="https_protocol" -ipns_protocol_select="https_protocol" +ipfs_gateway_protocol_select="https_protocol" +ipns_gateway_protocol_select="https_protocol" # external library protocols libamqp_protocol_deps="librabbitmq" @@ -3625,8 +3635,6 @@ azmq_filter_deps="libzmq" blackframe_filter_deps="gpl" blend_vulkan_filter_deps="vulkan spirv_compiler" -bm3d_filter_deps="avcodec" -bm3d_filter_select="dct" boxblur_filter_deps="gpl" boxblur_opencl_filter_deps="opencl gpl" bs2b_filter_deps="libbs2b" @@ -3641,6 +3649,7 @@ cover_rect_filter_deps="avcodec avformat gpl" cropdetect_filter_deps="gpl" deinterlace_qsv_filter_deps="libmfx" +deinterlace_qsv_filter_select="qsvvpp" deinterlace_vaapi_filter_deps="vaapi" delogo_filter_deps="gpl" denoise_vaapi_filter_deps="vaapi" @@ -3657,10 +3666,8 @@ eq_filter_deps="gpl" erosion_opencl_filter_deps="opencl" find_rect_filter_deps="avcodec avformat gpl" -firequalizer_filter_deps="avcodec" -firequalizer_filter_select="rdft" flip_vulkan_filter_deps="vulkan spirv_compiler" -flite_filter_deps="libflite" +flite_filter_deps="libflite threads" framerate_filter_select="scene_sad" freezedetect_filter_select="scene_sad" frei0r_deps_any="libdl LoadLibrary" @@ -3717,13 +3724,12 @@ scale2ref_filter_deps="swscale" scale_filter_deps="swscale" scale_qsv_filter_deps="libmfx" +scale_qsv_filter_select="qsvvpp" scdet_filter_select="scene_sad" select_filter_select="scene_sad" sharpness_vaapi_filter_deps="vaapi" showcqt_filter_deps="avformat swscale" showcqt_filter_suggest="libfontconfig libfreetype" -showspatial_filter_deps="avcodec" -showspatial_filter_select="fft" signature_filter_deps="gpl avcodec avformat" smartblur_filter_deps="gpl swscale" sobel_opencl_filter_deps="opencl" @@ -3763,31 +3769,41 @@ yadif_cuda_filter_deps="ffnvcodec" yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm" yadif_videotoolbox_filter_deps="metal corevideo videotoolbox" +hstack_vaapi_filter_deps="vaapi_1" +vstack_vaapi_filter_deps="vaapi_1" +xstack_vaapi_filter_deps="vaapi_1" +hstack_qsv_filter_deps="libmfx" +hstack_qsv_filter_select="qsvvpp" +vstack_qsv_filter_deps="libmfx" +vstack_qsv_filter_select="qsvvpp" +xstack_qsv_filter_deps="libmfx" +xstack_qsv_filter_select="qsvvpp" # examples +avio_http_serve_files_deps="avformat avutil fork" avio_list_dir_deps="avformat avutil" -avio_reading_deps="avformat avcodec avutil" +avio_read_callback_deps="avformat avcodec avutil" decode_audio_example_deps="avcodec avutil" +decode_filter_audio_example_deps="avfilter avcodec avformat avutil" +decode_filter_video_example_deps="avfilter avcodec avformat avutil" decode_video_example_deps="avcodec avutil" -demuxing_decoding_example_deps="avcodec avformat avutil" +demux_decode_example_deps="avcodec avformat avutil" encode_audio_example_deps="avcodec avutil" encode_video_example_deps="avcodec avutil" extract_mvs_example_deps="avcodec avformat avutil" filter_audio_example_deps="avfilter avutil" -filtering_audio_example_deps="avfilter avcodec avformat avutil" -filtering_video_example_deps="avfilter avcodec avformat avutil" -http_multiclient_example_deps="avformat avutil fork" hw_decode_example_deps="avcodec avformat avutil" -metadata_example_deps="avformat avutil" -muxing_example_deps="avcodec avformat avutil swscale" -qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder" -remuxing_example_deps="avcodec avformat avutil" -resampling_audio_example_deps="avutil swresample" -scaling_video_example_deps="avutil swscale" +mux_example_deps="avcodec avformat avutil swscale" +qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder" +remux_example_deps="avcodec avformat avutil" +resample_audio_example_deps="avutil swresample" +scale_video_example_deps="avutil swscale" +show_metadata_example_deps="avformat avutil" transcode_aac_example_deps="avcodec avformat swresample" -transcoding_example_deps="avfilter avcodec avformat avutil" +transcode_example_deps="avfilter avcodec avformat avutil" vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder" vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder" +qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder" # EXTRALIBS_LIST cpu_init_extralibs="pthreads_extralibs" @@ -3810,12 +3826,12 @@ swscale_deps="avutil" swscale_suggest="libm stdatomic" -avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs" +avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs" avfilter_extralibs="pthreads_extralibs" avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs" # programs -ffmpeg_deps="avcodec avfilter avformat" +ffmpeg_deps="avcodec avfilter avformat threads" ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter hflip_filter null_filter transpose_filter trim_filter vflip_filter" @@ -4000,9 +4016,9 @@ } FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c) -OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c outdev) +OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev) INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev) -MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c) +MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c) DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c) ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c) DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c) @@ -4316,6 +4332,11 @@ add_cflags -fsanitize=address add_ldflags -fsanitize=address ;; + *-lsan) + cc_default="${toolchain%-lsan}" + add_cflags -fsanitize=leak + add_ldflags -fsanitize=leak + ;; *-msan) cc_default="${toolchain%-msan}" add_cflags -fsanitize=memory -fsanitize-memory-track-origins @@ -4349,12 +4370,6 @@ esac ;; msvc) - # Check whether the current MSVC version needs the C99 converter. - # From MSVC 2013 (compiler major version 18) onwards, it does actually - # support enough of C99 to build ffmpeg. Default to the new - # behaviour if the regexp was unable to match anything, since this - # successfully parses the version number of existing supported - # versions that require the converter (MSVC 2010 and 2012). cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p') if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then cc_default="cl.exe" @@ -4363,6 +4378,7 @@ die "Unsupported MSVC version (2013 or newer required)" fi ld_default="$source_path/compat/windows/mslink" + windres_default="$source_path/compat/windows/mswindres" nm_default="dumpbin.exe -symbols" ar_default="lib.exe" case "${arch:-$arch_default}" in @@ -5118,6 +5134,8 @@ ;; esac + test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee + elif enabled avr32; then case $cpu in @@ -5319,6 +5337,12 @@ ;; esac +elif enabled riscv; then + + if test_cpp_condition stddef.h "__riscv_zbb"; then + enable fast_clz + fi + elif enabled sparc; then case $cpu in @@ -5563,7 +5587,7 @@ # Cannot build both shared and static libs when using dllimport. disable static fi - enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres + ! enabled small && test_cmd $windres --version && enable gnu_windres enabled x86_32 && check_ldflags -Wl,--large-address-aware shlibdir_default="$bindir_default" SLIBPREF="" @@ -5613,6 +5637,7 @@ # Cannot build both shared and static libs with MSVC or icl. disable static fi + ! enabled small && test_cmd $windres --version && enable gnu_windres enabled x86_32 && check_ldflags -LARGEADDRESSAWARE shlibdir_default="$bindir_default" SLIBPREF="" @@ -5642,7 +5667,7 @@ SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' enabled x86_64 && objformat="win64" || objformat="win32" enable dos_paths - enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres + ! enabled small && test_cmd $windres --version && enable gnu_windres add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 ;; *-dos|freedos|opendos) @@ -6088,6 +6113,10 @@ check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)" fi +elif enabled riscv; then + + enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"' + elif enabled x86; then check_builtin rdtsc intrin.h "__rdtsc()" @@ -6221,6 +6250,15 @@ check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)" check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)" +check_builtin float16 "" "_Float16 f16var" +if enabled float16; then + if enabled x86; then + test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16 + elif enabled arm || enabled aarch64; then + enable fast_float16 + fi +fi + case "$custom_allocator" in jemalloc) # jemalloc by default does not use a prefix @@ -6251,6 +6289,7 @@ check_func mprotect # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt +check_func_headers sys/prctl.h prctl check_func sched_getaffinity check_func setrlimit check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE @@ -6391,8 +6430,12 @@ check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 +check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO" +check_type "windows.h dxgi1_2.h" "IDXGIOutput1" +check_type "windows.h dxgi1_5.h" "IDXGIOutput5" check_type "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "windows.h d3d11.h" "ID3D11VideoContext" +check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat @@ -6421,10 +6464,10 @@ if ! disabled ffnvcodec; then ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" - check_pkg_config ffnvcodec "ffnvcodec >= 9.1.23.1" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.3 ffnvcodec < 9.1" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.10 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.11 ffnvcodec < 8.2" "$ffnv_hdr_list" "" + check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.0" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.2 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.2 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.14 ffnvcodec < 8.2" "$ffnv_hdr_list" "" fi if enabled_all libglslang libshaderc; then @@ -6505,16 +6548,13 @@ eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs done -for func in $COMPLEX_FUNCS; do - eval check_complexfunc $func \${${func}_args:-1} -done - # these are off by default, so fail if requested and not available enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" && { test_cpp_condition avisynth/avs/version.h "AVS_MAJOR_VER >= 3 && AVS_MINOR_VER >= 7 && AVS_BUGFIX_VER >= 1 || AVS_MAJOR_VER >= 3 && AVS_MINOR_VER > 7 || AVS_MAJOR_VER > 3" || die "ERROR: AviSynth+ header version must be >= 3.7.1"; } } enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; } -enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint +enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version || + require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; } enabled decklink && { require_headers DeckLinkAPI.h && { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } } enabled frei0r && require_headers "frei0r.h" @@ -6567,19 +6607,37 @@ enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new + +if enabled libmfx && enabled libvpl; then + die "ERROR: can not use libmfx and libvpl together" # While it may appear that require is being used as a pkg-config # fallback for libmfx, it is actually being used to detect a different # installation route altogether. If libmfx is installed via the Intel # Media SDK or Intel Media Server Studio, these don't come with # pkg-config support. Instead, users should make sure that the build # can find the libraries and headers through other means. -enabled libmfx && { check_pkg_config libmfx "libmfx >= 1.28" "mfx/mfxvideo.h" MFXInit || - { require libmfx "mfx/mfxvideo.h mfx/mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && - { test_cpp_condition mfx/mfxdefs.h "MFX_VERSION >= 1028" || die "ERROR: libmfx version must be >= 1.28"; } && - warn "using libmfx without pkg-config"; } } +elif enabled libmfx; then + { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit || +# Some old versions of libmfx have the following settings in libmfx.pc: +# includedir=/usr/include +# Cflags: -I${includedir} +# So add -I${includedir}/mfx to CFLAGS + { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } || + { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && + { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } && + warn "using libmfx without pkg-config"; } } && + warn "build FFmpeg against libmfx 1.x, obsolete features of libmfx such as OPAQUE memory,\n"\ + "multi-frame encode, user plugins and LA_EXT rate control mode are enabled" +elif enabled libvpl; then +# Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option +# because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name +# is extracted from "vpl >= 2.6" + check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \ + die "ERROR: libvpl >= 2.6 not found" +fi if enabled libmfx; then - check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9" + check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9" fi enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load @@ -6611,7 +6669,7 @@ enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection -enabled librav1e && require_pkg_config librav1e "rav1e >= 0.4.0" rav1e.h rav1e_context_new +enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket @@ -6667,12 +6725,12 @@ enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && - require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && { + require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && { [ "$toolchain" != "msvc" ] || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && - require_cpp_condition libx265 x265.h "X265_BUILD >= 70" + require_cpp_condition libx265 x265.h "X265_BUILD >= 89" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore @@ -6694,7 +6752,8 @@ check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || die "ERROR: mmal not found" && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; } -enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do +enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError || + { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } || die "ERROR: openal not found"; } && { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || @@ -6948,7 +7007,9 @@ enabled vdpau && check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 -enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd +enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd && \ + warn "CrystalHD support is deprecated and will be removed, please contact the developers if you are interested" \ + "in maintaining it." if enabled vulkan; then check_pkg_config_header_only vulkan "vulkan >= 1.2.189" "vulkan/vulkan.h" "defined VK_VERSION_1_2" || @@ -6985,13 +7046,17 @@ int main(void) { return 0; } EOF +if enabled nvenc; then + check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1" +fi + if enabled_any nvdec cuvid; then check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS" fi enabled amf && check_cpp_condition amf "AMF/core/Version.h" \ - "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400090000" + "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001c0000" # Funny iconv installations are not unusual, so check it after all flags have been set if enabled libc_iconv; then @@ -7401,12 +7466,10 @@ # conditional library dependencies, in any order enabled amovie_filter && prepend avfilter_deps "avformat avcodec" enabled aresample_filter && prepend avfilter_deps "swresample" -enabled bm3d_filter && prepend avfilter_deps "avcodec" enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec" enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample" enabled elbg_filter && prepend avfilter_deps "avcodec" enabled find_rect_filter && prepend avfilter_deps "avformat avcodec" -enabled firequalizer_filter && prepend avfilter_deps "avcodec" enabled mcdeint_filter && prepend avfilter_deps "avcodec" enabled movie_filter && prepend avfilter_deps "avformat avcodec" enabled pan_filter && prepend avfilter_deps "swresample" @@ -7543,6 +7606,9 @@ echo "LSX enabled ${lsx-no}" echo "LASX enabled ${lasx-no}" fi +if enabled riscv; then + echo "RISC-V Vector enabled ${rvv-no}" +fi echo "debug symbols ${debug-no}" echo "strip symbols ${stripping-no}" echo "optimize for size ${small-no}" @@ -7783,7 +7849,7 @@ #define FFMPEG_CONFIG_H #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)" #define FFMPEG_LICENSE "$(c_escape $license)" -#define CONFIG_THIS_YEAR 2022 +#define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "$(eval c_escape $datadir)" #define AVCONV_DATADIR "$(eval c_escape $datadir)" #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})" @@ -7900,9 +7966,9 @@ print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST -print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST +print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST -print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST +print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST # Settings for pkg-config files diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/APIchanges mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/APIchanges --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/APIchanges 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/APIchanges 2023-03-03 13:29:59.000000000 +0000 @@ -1,18 +1,139 @@ -Never assume the API of libav* to be stable unless at least 1 month has passed -since the last major version increase or the API was added. +The last version increases of all libraries were on 2023-02-09 -The last version increases were: -libavcodec: 2021-04-27 -libavdevice: 2021-04-27 -libavfilter: 2021-04-27 -libavformat: 2021-04-27 -libpostproc: 2021-04-27 -libswresample: 2021-04-27 -libswscale: 2021-04-27 -libavutil: 2021-04-27 +API changes, most recent first: +-------- 8< --------- FFmpeg 6.0 was cut here -------- 8< --------- -API changes, most recent first: +2023-02-16 - 927042b409 - lavf 60.2.100 - avformat.h + Deprecate AVFormatContext io_close callback. + The superior io_close2 callback should be used instead. + +2023-02-13 - 2296078397 - lavu 58.1.100 - frame.h + Deprecate AVFrame.coded_picture_number and display_picture_number. + Their usefulness is questionable and very few decoders set them. + +2023-02-13 - 6b6f7db819 - lavc 60.2.100 - avcodec.h + Add AVCodecContext.frame_num as a 64bit version of frame_number. + Deprecate AVCodecContext.frame_number. + +2023-02-12 - d1b9a3ddb4 - lavfi 9.1.100 - avfilter.h + Add filtergraph segment parsing API. + New structs: + - AVFilterGraphSegment + - AVFilterChain + - AVFilterParams + - AVFilterPadParams + New functions: + - avfilter_graph_segment_parse() + - avfilter_graph_segment_create_filters() + - avfilter_graph_segment_apply_opts() + - avfilter_graph_segment_init() + - avfilter_graph_segment_link() + - avfilter_graph_segment_apply() + +2023-02-09 - 719a93f4e4 - lavu 58.0.100 - csp.h + Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id(). + Add av_csp_trc_function. + +2023-02-09 - 868a31b42d - lavc 60.0.100 - avcodec.h + avcodec_decode_subtitle2() now accepts const AVPacket*. + +2023-02-04 - d02340b9e3 - lavc 59.63.100 + Allow AV_CODEC_FLAG_COPY_OPAQUE to be used with decoders. + +2023-01-29 - a1a80f2e64 - lavc 59.59.100 - avcodec.h + Add AV_CODEC_FLAG_COPY_OPAQUE and AV_CODEC_FLAG_FRAME_DURATION. + +2023-01-13 - 002d0ec740 - lavu 57.44.100 - ambient_viewing_environment.h frame.h + Adds a new structure for holding H.274 Ambient Viewing Environment metadata, + AVAmbientViewingEnvironment. + Adds a new AVFrameSideDataType entry AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT + for it. + +2022-12-10 - 7a8d78f7e3 - lavc 59.55.100 - avcodec.h + Add AV_HWACCEL_FLAG_UNSAFE_OUTPUT. + +2022-11-24 - e97368eba5 - lavu 57.43.100 - tx.h + Add AV_TX_FLOAT_DCT, AV_TX_DOUBLE_DCT and AV_TX_INT32_DCT. + +2022-11-06 - 9dad237928 - lavu 57.42.100 - dict.h + Add av_dict_iterate(). + +2022-11-03 - 6228ba141d - lavu 57.41.100 - channel_layout.h + Add AV_CH_LAYOUT_7POINT1_TOP_BACK and AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK. + +2022-10-30 - 83e918de71 - lavu 57.40.100 - channel_layout.h + Add AV_CH_LAYOUT_CUBE and AV_CHANNEL_LAYOUT_CUBE. + +2022-10-11 - 479747645f - lavu 57.39.101 - pixfmt.h + Add AV_PIX_FMT_RGBF32 and AV_PIX_FMT_RGBAF32. + +2022-10-05 - 37d5ddc317 - lavu 57.39.100 - cpu.h + Add AV_CPU_FLAG_RVB_BASIC. + +2022-10-03 - d09776d486 - lavf 59.34.100 - avio.h + Make AVIODirContext an opaque type in a future major version bump. + +2022-09-27 - 0c0a3deb18 - lavu 57.38.100 - cpu.h + Add CPU flags for RISC-V vector extensions: + AV_CPU_FLAG_RVV_I32, AV_CPU_FLAG_RVV_F32, AV_CPU_FLAG_RVV_I64, + AV_CPU_FLAG_RVV_F64 + +2022-09-26 - a02a0e8db4 - lavc 59.48.100 - avcodec.h + Deprecate avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum(). + Use av_chroma_location_enum_to_pos() or av_chroma_location_pos_to_enum() + instead. + +2022-09-26 - xxxxxxxxxx - lavu 57.37.100 - pixdesc.h pixfmt.h + Add av_chroma_location_enum_to_pos() and av_chroma_location_pos_to_enum(). + Add AV_PIX_FMT_RGBF32BE, AV_PIX_FMT_RGBF32LE, AV_PIX_FMT_RGBAF32BE, + AV_PIX_FMT_RGBAF32LE. + +2022-09-26 - cf856d8957 - lavc 59.47.100 - avcodec.h defs.h + Move the AV_EF_* and FF_COMPLIANCE_* defines from avcodec.h to defs.h. + +2022-09-03 - d75c4693fe - lavu 57.36.100 - pixfmt.h + Add AV_PIX_FMT_P012, AV_PIX_FMT_Y212, AV_PIX_FMT_XV30, AV_PIX_FMT_XV36 + +2022-09-03 - dea9744560 - lavu 57.35.100 - file.h + Deprecate av_tempfile() without replacement. + +2022-08-03 - cc5a5c9860 - lavu 57.34.100 - pixfmt.h + Add AV_PIX_FMT_VUYX. + +2022-08-22 - 14726571dd - lavf 59 - avformat.h + Deprecate av_stream_get_end_pts() without replacement. + +2022-08-19 - 352799dca8 - lavc 59.42.102 - codec_id.h + Deprecate AV_CODEC_ID_AYUV and ayuv decoder/encoder. The rawvideo codec + and vuya pixel format combination will be used instead from now on. + +2022-08-07 - e95b08a7dd - lavu 57.33.101 - pixfmt.h + Add AV_PIX_FMT_RGBAF16{BE,LE} pixel formats. + +2022-08-12 - e0bbdbe0a6 - lavu 57.33.100 - hwcontext_qsv.h + Add loader field to AVQSVDeviceContext + +2022-08-03 - 6ab8a9d375 - lavu 57.32.100 - pixfmt.h + Add AV_PIX_FMT_VUYA. + +2022-08-02 - e3838b856f - lavc 59.41.100 - avcodec.h codec.h + Add AV_CODEC_FLAG_RECON_FRAME and AV_CODEC_CAP_ENCODER_RECON_FRAME. + avcodec_receive_frame() may now be used on encoders when + AV_CODEC_FLAG_RECON_FRAME is active. + +2022-08-02 - eede1d2927 - lavu 57.31.100 - frame.h + av_frame_make_writable() may now be called on non-refcounted + frames and will make a refcounted copy out of them. + Previously an error was returned in such cases. + +2022-07-30 - e1a0f2df3d - lavc 59.40.100 - avcodec.h + Add the AV_CODEC_FLAG2_ICC_PROFILES flag to AVCodecContext, to enable + automatic reading and writing of embedded ICC profiles in image files. + The "flags2" option now supports the corresponding flag "icc_profiles". + +2022-07-19 - 4397f9a5a0 - lavu 57.30.100 - frame.h + Add AVFrame.duration, deprecate AVFrame.pkt_duration. -------- 8< --------- FFmpeg 5.1 was cut here -------- 8< --------- diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/bitstream_filters.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/bitstream_filters.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/bitstream_filters.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/bitstream_filters.texi 2023-03-03 13:29:59.000000000 +0000 @@ -382,9 +382,6 @@ redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata. -A new single global PPS is created, and all of the redundant PPSs -within the stream are removed. - @section hevc_metadata Modify metadata embedded in an HEVC stream. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/codecs.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/codecs.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/codecs.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/codecs.texi 2023-03-03 13:29:59.000000000 +0000 @@ -644,6 +644,8 @@ Do not skip samples and export skip information as frame side data. @item ass_ro_flush_noop Do not reset ASS ReadOrder field on flush. +@item icc_profiles +Generate/parse embedded ICC profiles from/to colorimetry tags. @end table @item export_side_data @var{flags} (@emph{decoding/encoding,audio,video,subtitles}) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/decoders.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/decoders.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/decoders.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/decoders.texi 2023-03-03 13:29:59.000000000 +0000 @@ -77,13 +77,17 @@ @item framethreads Set amount of frame threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the -global option @code{threads} instead. +option @code{max_frame_delay} and the global option @code{threads} instead. @item tilethreads Set amount of tile threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the global option @code{threads} instead. +@item max_frame_delay +Set max amount of frames the decoder may buffer internally. The default value is 0 +(autodetect). + @item filmgrain Apply film grain to the decoded video if present in the bitstream. Defaults to the internal default of the library. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/demuxers.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/demuxers.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/demuxers.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/demuxers.texi 2023-03-03 13:29:59.000000000 +0000 @@ -285,6 +285,24 @@ @end table +@section ea + +Electronic Arts Multimedia format demuxer. + +This format is used by various Electronic Arts games. + +@subsection Options + +@table @option + +@item merge_alpha @var{bool} + +Normally the VP6 alpha channel (if exists) is returned as a secondary video +stream, by setting this option you can make the demuxer return a single video +stream which contains the alpha channel in addition to the ordinary video. + +@end table + @section imf Interoperable Master Format demuxer. @@ -401,6 +419,10 @@ @item seg_format_options Set options for the demuxer of media segments using a list of key=value pairs separated by @code{:}. + +@item seg_max_retry +Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. +Default value is 0. @end table @section image2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/dev_community/community.md mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/dev_community/community.md --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/dev_community/community.md 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/dev_community/community.md 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,9 @@ They are part of the GA for two years, after which they need a confirmation by the GA. +A script to generate the current members of the general assembly (minus members +voted in) can be found in `tools/general_assembly.pl`. + ## Voting Voting is done using a ranked voting system, currently running on https://vote.ffmpeg.org/ . diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/developer.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/developer.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/developer.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/developer.texi 2023-03-03 13:29:59.000000000 +0000 @@ -10,41 +10,79 @@ @contents -@chapter Notes for external developers +@chapter Introduction -This document is mostly useful for internal FFmpeg developers. -External developers who need to use the API in their application should -refer to the API doxygen documentation in the public headers, and -check the examples in @file{doc/examples} and in the source code to -see how the public API is employed. - -You can use the FFmpeg libraries in your commercial program, but you -are encouraged to @emph{publish any patch you make}. In this case the -best way to proceed is to send your patches to the ffmpeg-devel -mailing list following the guidelines illustrated in the remainder of -this document. +This text is concerned with the development @emph{of} FFmpeg itself. Information +on using the FFmpeg libraries in other programs can be found elsewhere, e.g. in: +@itemize @bullet +@item +the installed header files +@item +@url{http://ffmpeg.org/doxygen/trunk/index.html, the Doxygen documentation} +generated from the headers +@item +the examples under @file{doc/examples} +@end itemize + +If you modify FFmpeg code for your own use case, you are highly encouraged to +@emph{submit your changes back to us}, using this document as a guide. There are +both pragmatic and ideological reasons to do so: +@itemize @bullet +@item +Maintaining external changes to keep up with upstream development is +time-consuming and error-prone. With your code in the main tree, it will be +maintained by FFmpeg developers. +@item +FFmpeg developers include leading experts in the field who can find bugs or +design flaws in your code. +@item +By supporting the project you find useful you ensure it continues to be +maintained and developed. +@end itemize For more detailed legal information about the use of FFmpeg in external programs read the @file{LICENSE} file in the source tree and consult @url{https://ffmpeg.org/legal.html}. -@chapter Contributing - -There are 2 ways by which code gets into FFmpeg: -@itemize @bullet -@item Submitting patches to the ffmpeg-devel mailing list. - See @ref{Submitting patches} for details. -@item Directly committing changes to the main tree. -@end itemize +@section Contributing code -Whichever way, changes should be reviewed by the maintainer of the code -before they are committed. And they should follow the @ref{Coding Rules}. +All proposed code changes should be submitted for review to +@url{mailto:ffmpeg-devel@@ffmpeg.org, the development mailing list}, as +described in more detail in the @ref{Submitting patches} chapter. The code +should comply with the @ref{Development Policy} and follow the @ref{Coding Rules}. The developer making the commit and the author are responsible for their changes and should try to fix issues their commit causes. @anchor{Coding Rules} @chapter Coding Rules +@section C language features + +FFmpeg is programmed in the ISO C99 language, extended with: +@itemize @bullet +@item +Atomic operations from C11 @file{stdatomic.h}. They are emulated on +architectures/compilers that do not support them, so all FFmpeg-internal code +may use atomics without any extra checks. However, @file{stdatomic.h} must not +be included in public headers, so they stay C99-compatible. +@end itemize + +Compiler-specific extensions may be used with good reason, but must not be +depended on, i.e. the code must still compile and work with compilers lacking +the extension. + +The following C99 features must not be used anywhere in the codebase: +@itemize @bullet +@item +variable-length arrays; + +@item +complex numbers; + +@item +mixed statements and declarations. +@end itemize + @section Code formatting conventions There are the following guidelines regarding the indentation in files: @@ -67,8 +105,39 @@ @end itemize The presentation is one inspired by 'indent -i4 -kr -nut'. -The main priority in FFmpeg is simplicity and small code size in order to -minimize the bug count. +@subsection Vim configuration +In order to configure Vim to follow FFmpeg formatting conventions, paste +the following snippet into your @file{.vimrc}: +@example +" indentation rules for FFmpeg: 4 spaces, no tabs +set expandtab +set shiftwidth=4 +set softtabstop=4 +set cindent +set cinoptions=(0 +" Allow tabs in Makefiles. +autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8 +" Trailing whitespace and tabs are forbidden, so highlight them. +highlight ForbiddenWhitespace ctermbg=red guibg=red +match ForbiddenWhitespace /\s\+$\|\t/ +" Do not highlight spaces at the end of line while typing on that line. +autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@/lib.v} files. + +@item +Other public identifiers (struct, union, enum, macro, type names) must use their +library's public prefix (@code{AV}, @code{Sws}, or @code{Swr}). @end itemize Furthermore, name space reserved for the system should not be invaded. @@ -218,39 +246,7 @@ should also be avoided if they don't make the code easier to understand. @end itemize -@section Editor configuration -In order to configure Vim to follow FFmpeg formatting conventions, paste -the following snippet into your @file{.vimrc}: -@example -" indentation rules for FFmpeg: 4 spaces, no tabs -set expandtab -set shiftwidth=4 -set softtabstop=4 -set cindent -set cinoptions=(0 -" Allow tabs in Makefiles. -autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8 -" Trailing whitespace and tabs are forbidden, so highlight them. -highlight ForbiddenWhitespace ctermbg=red guibg=red -match ForbiddenWhitespace /\s\+$\|\t/ -" Do not highlight spaces at the end of line while typing on that line. -autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@= 4 can support high tier). +This option only takes effect when the level option is specified. + +@table @samp +@item main +@item high +@end table + @item @var{gpb} 1: GPB (generalized P/B frame) @@ -3609,8 +3691,10 @@ error resilience without significant impact on encoded bitstream size caused by I frames. The SDK encoder achieves this by encoding part of each frame in refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means -vertical refresh, by column of MBs. To enable intra refresh, B frame should be -set to 0. +vertical refresh, by column of MBs. @var{horizontal} means horizontal refresh, +by rows of MBs. @var{slice} means horizontal refresh by slices without +overlapping. In case of @var{slice}, in_ref_cycle_size is ignored. To enable +intra refresh, B frame should be set to 0. @item @var{int_ref_cycle_size} Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are @@ -3641,6 +3725,52 @@ @item @var{min_qp_b} Minimum video quantizer scale for B frame. + +@item @var{scenario} +Provides a hint to encoder about the scenario for the encoding session. +@table @samp +@item unknown +@item displayremoting +@item videoconference +@item archive +@item livestreaming +@item cameracapture +@item videosurveillance +@item gamestreaming +@item remotegaming +@end table + +@item @var{avbr_accuracy} +Accuracy of the AVBR ratecontrol (unit of tenth of percent). + +@item @var{avbr_convergence} +Convergence of the AVBR ratecontrol (unit of 100 frames) + +The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy}, +after a @var{avbr_Convergence} period. This method does not follow HRD and the +instant bitrate is not capped or padded. + +@item @var{skip_frame} +Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option +defines the usage of this metadata. +@table @samp +@item no_skip +Frame skipping is disabled. +@item insert_dummy +Encoder inserts into bitstream frame where all macroblocks are encoded as +skipped. +@item insert_nothing +Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped +frames are still used in brc. For example, gop still include skipped frames, and +the frames after skipped frames will be larger in size. +@item brc_only +skip_frame metadata indicates the number of missed frames before the current +frame. +@end table + @end table @subsection MPEG2 Options @@ -3674,6 +3804,48 @@ Number of rows for tiled encoding (requires libmfx >= 1.29). @end table +@subsection AV1 Options +These options are used by av1_qsv (requires libvpl). +@table @option +@item @var{profile} +@table @samp +@item unknown +@item main +@end table + +@item @var{tile_cols} +Number of columns for tiled encoding. + +@item @var{tile_rows} +Number of rows for tiled encoding. + +@item @var{adaptive_i} +This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. + +@item @var{adaptive_b} +This flag controls changing of frame type from B to P. + +@item @var{b_strategy} +This option controls usage of B frames as reference. + +@item @var{extbrc} +Extended bitrate control. + +@item @var{look_ahead_depth} +Depth of look ahead in number frames, available when extbrc option is enabled. + +@item @var{low_delay_brc} +Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on + +@item max_frame_size +Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. +@end table + @section snow @subsection Options diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_http_serve_files.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_http_serve_files.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_http_serve_files.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_http_serve_files.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2015 Stephan Holljes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat multi-client network API usage example + * @example avio_http_serve_files.c + * + * Serve a file without decoding or demuxing it over the HTTP protocol. Multiple + * clients can connect and will receive the same file. + */ + +#include +#include +#include + +static void process_client(AVIOContext *client, const char *in_uri) +{ + AVIOContext *input = NULL; + uint8_t buf[1024]; + int ret, n, reply_code; + uint8_t *resource = NULL; + while ((ret = avio_handshake(client)) > 0) { + av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource); + // check for strlen(resource) is necessary, because av_opt_get() + // may return empty string. + if (resource && strlen(resource)) + break; + av_freep(&resource); + } + if (ret < 0) + goto end; + av_log(client, AV_LOG_TRACE, "resource=%p\n", resource); + if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) { + reply_code = 200; + } else { + reply_code = AVERROR_HTTP_NOT_FOUND; + } + if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) { + av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret)); + goto end; + } + av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code); + + while ((ret = avio_handshake(client)) > 0); + + if (ret < 0) + goto end; + + fprintf(stderr, "Handshake performed.\n"); + if (reply_code != 200) + goto end; + fprintf(stderr, "Opening input file.\n"); + if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) { + av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri, + av_err2str(ret)); + goto end; + } + for(;;) { + n = avio_read(input, buf, sizeof(buf)); + if (n < 0) { + if (n == AVERROR_EOF) + break; + av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n", + av_err2str(n)); + break; + } + avio_write(client, buf, n); + avio_flush(client); + } +end: + fprintf(stderr, "Flushing client\n"); + avio_flush(client); + fprintf(stderr, "Closing client\n"); + avio_close(client); + fprintf(stderr, "Closing input\n"); + avio_close(input); + av_freep(&resource); +} + +int main(int argc, char **argv) +{ + AVDictionary *options = NULL; + AVIOContext *client = NULL, *server = NULL; + const char *in_uri, *out_uri; + int ret, pid; + av_log_set_level(AV_LOG_TRACE); + if (argc < 3) { + printf("usage: %s input http://hostname[:port]\n" + "API example program to serve http to multiple clients.\n" + "\n", argv[0]); + return 1; + } + + in_uri = argv[1]; + out_uri = argv[2]; + + avformat_network_init(); + + if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) { + fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret)); + return ret; + } + if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) { + fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret)); + return ret; + } + fprintf(stderr, "Entering main loop.\n"); + for(;;) { + if ((ret = avio_accept(server, &client)) < 0) + goto end; + fprintf(stderr, "Accepted client, forking process.\n"); + // XXX: Since we don't reap our children and don't ignore signals + // this produces zombie processes. + pid = fork(); + if (pid < 0) { + perror("Fork failed"); + ret = AVERROR(errno); + goto end; + } + if (pid == 0) { + fprintf(stderr, "In child.\n"); + process_client(client, in_uri); + avio_close(server); + exit(0); + } + if (pid > 0) + avio_close(client); + } +end: + avio_close(server); + if (ret < 0 && ret != AVERROR_EOF) { + fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret)); + return 1; + } + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_list_dir.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_list_dir.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_list_dir.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_list_dir.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,13 @@ * THE SOFTWARE. */ +/** + * @file libavformat AVIOContext list directory API usage example + * @example avio_list_dir.c + * + * Show how to list directories through the libavformat AVIOContext API. + */ + #include #include #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_read_callback.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_read_callback.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_read_callback.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_read_callback.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2014 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat AVIOContext read callback API usage example + * @example avio_read_callback.c + * + * Make libavformat demuxer access media content through a custom + * AVIOContext read callback. + */ + +#include +#include +#include +#include + +struct buffer_data { + uint8_t *ptr; + size_t size; ///< size left in the buffer +}; + +static int read_packet(void *opaque, uint8_t *buf, int buf_size) +{ + struct buffer_data *bd = (struct buffer_data *)opaque; + buf_size = FFMIN(buf_size, bd->size); + + if (!buf_size) + return AVERROR_EOF; + printf("ptr:%p size:%zu\n", bd->ptr, bd->size); + + /* copy internal buffer data to buf */ + memcpy(buf, bd->ptr, buf_size); + bd->ptr += buf_size; + bd->size -= buf_size; + + return buf_size; +} + +int main(int argc, char *argv[]) +{ + AVFormatContext *fmt_ctx = NULL; + AVIOContext *avio_ctx = NULL; + uint8_t *buffer = NULL, *avio_ctx_buffer = NULL; + size_t buffer_size, avio_ctx_buffer_size = 4096; + char *input_filename = NULL; + int ret = 0; + struct buffer_data bd = { 0 }; + + if (argc != 2) { + fprintf(stderr, "usage: %s input_file\n" + "API example program to show how to read from a custom buffer " + "accessed through AVIOContext.\n", argv[0]); + return 1; + } + input_filename = argv[1]; + + /* slurp file content into buffer */ + ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL); + if (ret < 0) + goto end; + + /* fill opaque structure used by the AVIOContext read callback */ + bd.ptr = buffer; + bd.size = buffer_size; + + if (!(fmt_ctx = avformat_alloc_context())) { + ret = AVERROR(ENOMEM); + goto end; + } + + avio_ctx_buffer = av_malloc(avio_ctx_buffer_size); + if (!avio_ctx_buffer) { + ret = AVERROR(ENOMEM); + goto end; + } + avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size, + 0, &bd, &read_packet, NULL, NULL); + if (!avio_ctx) { + ret = AVERROR(ENOMEM); + goto end; + } + fmt_ctx->pb = avio_ctx; + + ret = avformat_open_input(&fmt_ctx, NULL, NULL, NULL); + if (ret < 0) { + fprintf(stderr, "Could not open input\n"); + goto end; + } + + ret = avformat_find_stream_info(fmt_ctx, NULL); + if (ret < 0) { + fprintf(stderr, "Could not find stream information\n"); + goto end; + } + + av_dump_format(fmt_ctx, 0, input_filename, 0); + +end: + avformat_close_input(&fmt_ctx); + + /* note: the internal buffer could have changed, and be != avio_ctx_buffer */ + if (avio_ctx) + av_freep(&avio_ctx->buffer); + avio_context_free(&avio_ctx); + + av_file_unmap(buffer, buffer_size); + + if (ret < 0) { + fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); + return 1; + } + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_reading.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_reading.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_reading.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/avio_reading.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2014 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * libavformat AVIOContext API example. - * - * Make libavformat demuxer access media content through a custom - * AVIOContext read callback. - * @example avio_reading.c - */ - -#include -#include -#include -#include - -struct buffer_data { - uint8_t *ptr; - size_t size; ///< size left in the buffer -}; - -static int read_packet(void *opaque, uint8_t *buf, int buf_size) -{ - struct buffer_data *bd = (struct buffer_data *)opaque; - buf_size = FFMIN(buf_size, bd->size); - - if (!buf_size) - return AVERROR_EOF; - printf("ptr:%p size:%zu\n", bd->ptr, bd->size); - - /* copy internal buffer data to buf */ - memcpy(buf, bd->ptr, buf_size); - bd->ptr += buf_size; - bd->size -= buf_size; - - return buf_size; -} - -int main(int argc, char *argv[]) -{ - AVFormatContext *fmt_ctx = NULL; - AVIOContext *avio_ctx = NULL; - uint8_t *buffer = NULL, *avio_ctx_buffer = NULL; - size_t buffer_size, avio_ctx_buffer_size = 4096; - char *input_filename = NULL; - int ret = 0; - struct buffer_data bd = { 0 }; - - if (argc != 2) { - fprintf(stderr, "usage: %s input_file\n" - "API example program to show how to read from a custom buffer " - "accessed through AVIOContext.\n", argv[0]); - return 1; - } - input_filename = argv[1]; - - /* slurp file content into buffer */ - ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL); - if (ret < 0) - goto end; - - /* fill opaque structure used by the AVIOContext read callback */ - bd.ptr = buffer; - bd.size = buffer_size; - - if (!(fmt_ctx = avformat_alloc_context())) { - ret = AVERROR(ENOMEM); - goto end; - } - - avio_ctx_buffer = av_malloc(avio_ctx_buffer_size); - if (!avio_ctx_buffer) { - ret = AVERROR(ENOMEM); - goto end; - } - avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size, - 0, &bd, &read_packet, NULL, NULL); - if (!avio_ctx) { - ret = AVERROR(ENOMEM); - goto end; - } - fmt_ctx->pb = avio_ctx; - - ret = avformat_open_input(&fmt_ctx, NULL, NULL, NULL); - if (ret < 0) { - fprintf(stderr, "Could not open input\n"); - goto end; - } - - ret = avformat_find_stream_info(fmt_ctx, NULL); - if (ret < 0) { - fprintf(stderr, "Could not find stream information\n"); - goto end; - } - - av_dump_format(fmt_ctx, 0, input_filename, 0); - -end: - avformat_close_input(&fmt_ctx); - - /* note: the internal buffer could have changed, and be != avio_ctx_buffer */ - if (avio_ctx) - av_freep(&avio_ctx->buffer); - avio_context_free(&avio_ctx); - - av_file_unmap(buffer, buffer_size); - - if (ret < 0) { - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); - return 1; - } - - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,10 +21,11 @@ */ /** - * @file - * audio decoding with libavcodec API example - * + * @file libavcodec audio decoding API usage example * @example decode_audio.c + * + * Decode data from an MP2 input file and generate a raw audio file to + * be played with ffplay. */ #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_audio.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2010 Nicolas George + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2012 Clément Bœsch + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file audio decoding and filtering usage example + * @example decode_filter_audio.c + * + * Demux, decode and filter audio input file, generate a raw audio + * file to be played with ffplay. + */ + +#include + +#include +#include +#include +#include +#include +#include + +static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono"; +static const char *player = "ffplay -f s16le -ar 8000 -ac 1 -"; + +static AVFormatContext *fmt_ctx; +static AVCodecContext *dec_ctx; +AVFilterContext *buffersink_ctx; +AVFilterContext *buffersrc_ctx; +AVFilterGraph *filter_graph; +static int audio_stream_index = -1; + +static int open_input_file(const char *filename) +{ + const AVCodec *dec; + int ret; + + if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); + return ret; + } + + if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); + return ret; + } + + /* select the audio stream */ + ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find an audio stream in the input file\n"); + return ret; + } + audio_stream_index = ret; + + /* create decoding context */ + dec_ctx = avcodec_alloc_context3(dec); + if (!dec_ctx) + return AVERROR(ENOMEM); + avcodec_parameters_to_context(dec_ctx, fmt_ctx->streams[audio_stream_index]->codecpar); + + /* init the audio decoder */ + if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n"); + return ret; + } + + return 0; +} + +static int init_filters(const char *filters_descr) +{ + char args[512]; + int ret = 0; + const AVFilter *abuffersrc = avfilter_get_by_name("abuffer"); + const AVFilter *abuffersink = avfilter_get_by_name("abuffersink"); + AVFilterInOut *outputs = avfilter_inout_alloc(); + AVFilterInOut *inputs = avfilter_inout_alloc(); + static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 }; + static const int out_sample_rates[] = { 8000, -1 }; + const AVFilterLink *outlink; + AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base; + + filter_graph = avfilter_graph_alloc(); + if (!outputs || !inputs || !filter_graph) { + ret = AVERROR(ENOMEM); + goto end; + } + + /* buffer audio source: the decoded frames from the decoder will be inserted here. */ + if (dec_ctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + av_channel_layout_default(&dec_ctx->ch_layout, dec_ctx->ch_layout.nb_channels); + ret = snprintf(args, sizeof(args), + "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=", + time_base.num, time_base.den, dec_ctx->sample_rate, + av_get_sample_fmt_name(dec_ctx->sample_fmt)); + av_channel_layout_describe(&dec_ctx->ch_layout, args + ret, sizeof(args) - ret); + ret = avfilter_graph_create_filter(&buffersrc_ctx, abuffersrc, "in", + args, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); + goto end; + } + + /* buffer audio sink: to terminate the filter chain. */ + ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out", + NULL, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); + goto end; + } + + ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1, + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n"); + goto end; + } + + ret = av_opt_set(buffersink_ctx, "ch_layouts", "mono", + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n"); + goto end; + } + + ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1, + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n"); + goto end; + } + + /* + * Set the endpoints for the filter graph. The filter_graph will + * be linked to the graph described by filters_descr. + */ + + /* + * The buffer source output must be connected to the input pad of + * the first filter described by filters_descr; since the first + * filter input label is not specified, it is set to "in" by + * default. + */ + outputs->name = av_strdup("in"); + outputs->filter_ctx = buffersrc_ctx; + outputs->pad_idx = 0; + outputs->next = NULL; + + /* + * The buffer sink input must be connected to the output pad of + * the last filter described by filters_descr; since the last + * filter output label is not specified, it is set to "out" by + * default. + */ + inputs->name = av_strdup("out"); + inputs->filter_ctx = buffersink_ctx; + inputs->pad_idx = 0; + inputs->next = NULL; + + if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr, + &inputs, &outputs, NULL)) < 0) + goto end; + + if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) + goto end; + + /* Print summary of the sink buffer + * Note: args buffer is reused to store channel layout string */ + outlink = buffersink_ctx->inputs[0]; + av_channel_layout_describe(&outlink->ch_layout, args, sizeof(args)); + av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n", + (int)outlink->sample_rate, + (char *)av_x_if_null(av_get_sample_fmt_name(outlink->format), "?"), + args); + +end: + avfilter_inout_free(&inputs); + avfilter_inout_free(&outputs); + + return ret; +} + +static void print_frame(const AVFrame *frame) +{ + const int n = frame->nb_samples * frame->ch_layout.nb_channels; + const uint16_t *p = (uint16_t*)frame->data[0]; + const uint16_t *p_end = p + n; + + while (p < p_end) { + fputc(*p & 0xff, stdout); + fputc(*p>>8 & 0xff, stdout); + p++; + } + fflush(stdout); +} + +int main(int argc, char **argv) +{ + int ret; + AVPacket *packet = av_packet_alloc(); + AVFrame *frame = av_frame_alloc(); + AVFrame *filt_frame = av_frame_alloc(); + + if (!packet || !frame || !filt_frame) { + fprintf(stderr, "Could not allocate frame or packet\n"); + exit(1); + } + if (argc != 2) { + fprintf(stderr, "Usage: %s file | %s\n", argv[0], player); + exit(1); + } + + if ((ret = open_input_file(argv[1])) < 0) + goto end; + if ((ret = init_filters(filter_descr)) < 0) + goto end; + + /* read all packets */ + while (1) { + if ((ret = av_read_frame(fmt_ctx, packet)) < 0) + break; + + if (packet->stream_index == audio_stream_index) { + ret = avcodec_send_packet(dec_ctx, packet); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n"); + break; + } + + while (ret >= 0) { + ret = avcodec_receive_frame(dec_ctx, frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { + break; + } else if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while receiving a frame from the decoder\n"); + goto end; + } + + if (ret >= 0) { + /* push the audio data from decoded frame into the filtergraph */ + if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n"); + break; + } + + /* pull filtered audio from the filtergraph */ + while (1) { + ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + break; + if (ret < 0) + goto end; + print_frame(filt_frame); + av_frame_unref(filt_frame); + } + av_frame_unref(frame); + } + } + } + av_packet_unref(packet); + } +end: + avfilter_graph_free(&filter_graph); + avcodec_free_context(&dec_ctx); + avformat_close_input(&fmt_ctx); + av_packet_free(&packet); + av_frame_free(&frame); + av_frame_free(&filt_frame); + + if (ret < 0 && ret != AVERROR_EOF) { + fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); + exit(1); + } + + exit(0); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_video.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_filter_video.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2010 Nicolas George + * Copyright (c) 2011 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file + * API example for decoding and filtering + * @example decode_filter_video.c + */ + +#define _XOPEN_SOURCE 600 /* for usleep */ +#include +#include +#include + +#include +#include +#include +#include +#include + +const char *filter_descr = "scale=78:24,transpose=cclock"; +/* other way: + scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively + */ + +static AVFormatContext *fmt_ctx; +static AVCodecContext *dec_ctx; +AVFilterContext *buffersink_ctx; +AVFilterContext *buffersrc_ctx; +AVFilterGraph *filter_graph; +static int video_stream_index = -1; +static int64_t last_pts = AV_NOPTS_VALUE; + +static int open_input_file(const char *filename) +{ + const AVCodec *dec; + int ret; + + if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); + return ret; + } + + if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); + return ret; + } + + /* select the video stream */ + ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n"); + return ret; + } + video_stream_index = ret; + + /* create decoding context */ + dec_ctx = avcodec_alloc_context3(dec); + if (!dec_ctx) + return AVERROR(ENOMEM); + avcodec_parameters_to_context(dec_ctx, fmt_ctx->streams[video_stream_index]->codecpar); + + /* init the video decoder */ + if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n"); + return ret; + } + + return 0; +} + +static int init_filters(const char *filters_descr) +{ + char args[512]; + int ret = 0; + const AVFilter *buffersrc = avfilter_get_by_name("buffer"); + const AVFilter *buffersink = avfilter_get_by_name("buffersink"); + AVFilterInOut *outputs = avfilter_inout_alloc(); + AVFilterInOut *inputs = avfilter_inout_alloc(); + AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base; + enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; + + filter_graph = avfilter_graph_alloc(); + if (!outputs || !inputs || !filter_graph) { + ret = AVERROR(ENOMEM); + goto end; + } + + /* buffer video source: the decoded frames from the decoder will be inserted here. */ + snprintf(args, sizeof(args), + "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", + dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, + time_base.num, time_base.den, + dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den); + + ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", + args, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n"); + goto end; + } + + /* buffer video sink: to terminate the filter chain. */ + ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", + NULL, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); + goto end; + } + + ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts, + AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n"); + goto end; + } + + /* + * Set the endpoints for the filter graph. The filter_graph will + * be linked to the graph described by filters_descr. + */ + + /* + * The buffer source output must be connected to the input pad of + * the first filter described by filters_descr; since the first + * filter input label is not specified, it is set to "in" by + * default. + */ + outputs->name = av_strdup("in"); + outputs->filter_ctx = buffersrc_ctx; + outputs->pad_idx = 0; + outputs->next = NULL; + + /* + * The buffer sink input must be connected to the output pad of + * the last filter described by filters_descr; since the last + * filter output label is not specified, it is set to "out" by + * default. + */ + inputs->name = av_strdup("out"); + inputs->filter_ctx = buffersink_ctx; + inputs->pad_idx = 0; + inputs->next = NULL; + + if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr, + &inputs, &outputs, NULL)) < 0) + goto end; + + if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) + goto end; + +end: + avfilter_inout_free(&inputs); + avfilter_inout_free(&outputs); + + return ret; +} + +static void display_frame(const AVFrame *frame, AVRational time_base) +{ + int x, y; + uint8_t *p0, *p; + int64_t delay; + + if (frame->pts != AV_NOPTS_VALUE) { + if (last_pts != AV_NOPTS_VALUE) { + /* sleep roughly the right amount of time; + * usleep is in microseconds, just like AV_TIME_BASE. */ + delay = av_rescale_q(frame->pts - last_pts, + time_base, AV_TIME_BASE_Q); + if (delay > 0 && delay < 1000000) + usleep(delay); + } + last_pts = frame->pts; + } + + /* Trivial ASCII grayscale display. */ + p0 = frame->data[0]; + puts("\033c"); + for (y = 0; y < frame->height; y++) { + p = p0; + for (x = 0; x < frame->width; x++) + putchar(" .-+#"[*(p++) / 52]); + putchar('\n'); + p0 += frame->linesize[0]; + } + fflush(stdout); +} + +int main(int argc, char **argv) +{ + int ret; + AVPacket *packet; + AVFrame *frame; + AVFrame *filt_frame; + + if (argc != 2) { + fprintf(stderr, "Usage: %s file\n", argv[0]); + exit(1); + } + + frame = av_frame_alloc(); + filt_frame = av_frame_alloc(); + packet = av_packet_alloc(); + if (!frame || !filt_frame || !packet) { + fprintf(stderr, "Could not allocate frame or packet\n"); + exit(1); + } + + if ((ret = open_input_file(argv[1])) < 0) + goto end; + if ((ret = init_filters(filter_descr)) < 0) + goto end; + + /* read all packets */ + while (1) { + if ((ret = av_read_frame(fmt_ctx, packet)) < 0) + break; + + if (packet->stream_index == video_stream_index) { + ret = avcodec_send_packet(dec_ctx, packet); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n"); + break; + } + + while (ret >= 0) { + ret = avcodec_receive_frame(dec_ctx, frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { + break; + } else if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while receiving a frame from the decoder\n"); + goto end; + } + + frame->pts = frame->best_effort_timestamp; + + /* push the decoded frame into the filtergraph */ + if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n"); + break; + } + + /* pull filtered frames from the filtergraph */ + while (1) { + ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + break; + if (ret < 0) + goto end; + display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base); + av_frame_unref(filt_frame); + } + av_frame_unref(frame); + } + } + av_packet_unref(packet); + } +end: + avfilter_graph_free(&filter_graph); + avcodec_free_context(&dec_ctx); + avformat_close_input(&fmt_ctx); + av_frame_free(&frame); + av_frame_free(&filt_frame); + av_packet_free(&packet); + + if (ret < 0 && ret != AVERROR_EOF) { + fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); + exit(1); + } + + exit(0); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/decode_video.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,10 +21,11 @@ */ /** - * @file - * video decoding with libavcodec API example + * @file libavcodec video decoding API usage example + * @example decode_video.c * * - * @example decode_video.c + * Read from an MPEG1 video file, decode frames, and generate PGM images as + * output. */ #include @@ -69,12 +70,12 @@ exit(1); } - printf("saving frame %3d\n", dec_ctx->frame_number); + printf("saving frame %3"PRId64"\n", dec_ctx->frame_num); fflush(stdout); /* the picture is allocated by the decoder. no need to free it */ - snprintf(buf, sizeof(buf), "%s-%d", filename, dec_ctx->frame_number); + snprintf(buf, sizeof(buf), "%s-%"PRId64, filename, dec_ctx->frame_num); pgm_save(frame->data[0], frame->linesize[0], frame->width, frame->height, buf); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demux_decode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demux_decode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demux_decode.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demux_decode.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,382 @@ +/* + * Copyright (c) 2012 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat and libavcodec demuxing and decoding API usage example + * @example demux_decode.c + * + * Show how to use the libavformat and libavcodec API to demux and decode audio + * and video data. Write the output as raw audio and input files to be played by + * ffplay. + */ + +#include +#include +#include +#include +#include + +static AVFormatContext *fmt_ctx = NULL; +static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx; +static int width, height; +static enum AVPixelFormat pix_fmt; +static AVStream *video_stream = NULL, *audio_stream = NULL; +static const char *src_filename = NULL; +static const char *video_dst_filename = NULL; +static const char *audio_dst_filename = NULL; +static FILE *video_dst_file = NULL; +static FILE *audio_dst_file = NULL; + +static uint8_t *video_dst_data[4] = {NULL}; +static int video_dst_linesize[4]; +static int video_dst_bufsize; + +static int video_stream_idx = -1, audio_stream_idx = -1; +static AVFrame *frame = NULL; +static AVPacket *pkt = NULL; +static int video_frame_count = 0; +static int audio_frame_count = 0; + +static int output_video_frame(AVFrame *frame) +{ + if (frame->width != width || frame->height != height || + frame->format != pix_fmt) { + /* To handle this change, one could call av_image_alloc again and + * decode the following frames into another rawvideo file. */ + fprintf(stderr, "Error: Width, height and pixel format have to be " + "constant in a rawvideo file, but the width, height or " + "pixel format of the input video changed:\n" + "old: width = %d, height = %d, format = %s\n" + "new: width = %d, height = %d, format = %s\n", + width, height, av_get_pix_fmt_name(pix_fmt), + frame->width, frame->height, + av_get_pix_fmt_name(frame->format)); + return -1; + } + + printf("video_frame n:%d\n", + video_frame_count++); + + /* copy decoded frame to destination buffer: + * this is required since rawvideo expects non aligned data */ + av_image_copy(video_dst_data, video_dst_linesize, + (const uint8_t **)(frame->data), frame->linesize, + pix_fmt, width, height); + + /* write to rawvideo file */ + fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); + return 0; +} + +static int output_audio_frame(AVFrame *frame) +{ + size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); + printf("audio_frame n:%d nb_samples:%d pts:%s\n", + audio_frame_count++, frame->nb_samples, + av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); + + /* Write the raw audio data samples of the first plane. This works + * fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However, + * most audio decoders output planar audio, which uses a separate + * plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P). + * In other words, this code will write only the first audio channel + * in these cases. + * You should use libswresample or libavfilter to convert the frame + * to packed data. */ + fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file); + + return 0; +} + +static int decode_packet(AVCodecContext *dec, const AVPacket *pkt) +{ + int ret = 0; + + // submit the packet to the decoder + ret = avcodec_send_packet(dec, pkt); + if (ret < 0) { + fprintf(stderr, "Error submitting a packet for decoding (%s)\n", av_err2str(ret)); + return ret; + } + + // get all the available frames from the decoder + while (ret >= 0) { + ret = avcodec_receive_frame(dec, frame); + if (ret < 0) { + // those two return values are special and mean there is no output + // frame available, but there were no errors during decoding + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + return 0; + + fprintf(stderr, "Error during decoding (%s)\n", av_err2str(ret)); + return ret; + } + + // write the frame data to output file + if (dec->codec->type == AVMEDIA_TYPE_VIDEO) + ret = output_video_frame(frame); + else + ret = output_audio_frame(frame); + + av_frame_unref(frame); + if (ret < 0) + return ret; + } + + return 0; +} + +static int open_codec_context(int *stream_idx, + AVCodecContext **dec_ctx, AVFormatContext *fmt_ctx, enum AVMediaType type) +{ + int ret, stream_index; + AVStream *st; + const AVCodec *dec = NULL; + + ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0); + if (ret < 0) { + fprintf(stderr, "Could not find %s stream in input file '%s'\n", + av_get_media_type_string(type), src_filename); + return ret; + } else { + stream_index = ret; + st = fmt_ctx->streams[stream_index]; + + /* find decoder for the stream */ + dec = avcodec_find_decoder(st->codecpar->codec_id); + if (!dec) { + fprintf(stderr, "Failed to find %s codec\n", + av_get_media_type_string(type)); + return AVERROR(EINVAL); + } + + /* Allocate a codec context for the decoder */ + *dec_ctx = avcodec_alloc_context3(dec); + if (!*dec_ctx) { + fprintf(stderr, "Failed to allocate the %s codec context\n", + av_get_media_type_string(type)); + return AVERROR(ENOMEM); + } + + /* Copy codec parameters from input stream to output codec context */ + if ((ret = avcodec_parameters_to_context(*dec_ctx, st->codecpar)) < 0) { + fprintf(stderr, "Failed to copy %s codec parameters to decoder context\n", + av_get_media_type_string(type)); + return ret; + } + + /* Init the decoders */ + if ((ret = avcodec_open2(*dec_ctx, dec, NULL)) < 0) { + fprintf(stderr, "Failed to open %s codec\n", + av_get_media_type_string(type)); + return ret; + } + *stream_idx = stream_index; + } + + return 0; +} + +static int get_format_from_sample_fmt(const char **fmt, + enum AVSampleFormat sample_fmt) +{ + int i; + struct sample_fmt_entry { + enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; + } sample_fmt_entries[] = { + { AV_SAMPLE_FMT_U8, "u8", "u8" }, + { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, + { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, + { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, + { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, + }; + *fmt = NULL; + + for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { + struct sample_fmt_entry *entry = &sample_fmt_entries[i]; + if (sample_fmt == entry->sample_fmt) { + *fmt = AV_NE(entry->fmt_be, entry->fmt_le); + return 0; + } + } + + fprintf(stderr, + "sample format %s is not supported as output format\n", + av_get_sample_fmt_name(sample_fmt)); + return -1; +} + +int main (int argc, char **argv) +{ + int ret = 0; + + if (argc != 4) { + fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n" + "API example program to show how to read frames from an input file.\n" + "This program reads frames from a file, decodes them, and writes decoded\n" + "video frames to a rawvideo file named video_output_file, and decoded\n" + "audio frames to a rawaudio file named audio_output_file.\n", + argv[0]); + exit(1); + } + src_filename = argv[1]; + video_dst_filename = argv[2]; + audio_dst_filename = argv[3]; + + /* open input file, and allocate format context */ + if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { + fprintf(stderr, "Could not open source file %s\n", src_filename); + exit(1); + } + + /* retrieve stream information */ + if (avformat_find_stream_info(fmt_ctx, NULL) < 0) { + fprintf(stderr, "Could not find stream information\n"); + exit(1); + } + + if (open_codec_context(&video_stream_idx, &video_dec_ctx, fmt_ctx, AVMEDIA_TYPE_VIDEO) >= 0) { + video_stream = fmt_ctx->streams[video_stream_idx]; + + video_dst_file = fopen(video_dst_filename, "wb"); + if (!video_dst_file) { + fprintf(stderr, "Could not open destination file %s\n", video_dst_filename); + ret = 1; + goto end; + } + + /* allocate image where the decoded image will be put */ + width = video_dec_ctx->width; + height = video_dec_ctx->height; + pix_fmt = video_dec_ctx->pix_fmt; + ret = av_image_alloc(video_dst_data, video_dst_linesize, + width, height, pix_fmt, 1); + if (ret < 0) { + fprintf(stderr, "Could not allocate raw video buffer\n"); + goto end; + } + video_dst_bufsize = ret; + } + + if (open_codec_context(&audio_stream_idx, &audio_dec_ctx, fmt_ctx, AVMEDIA_TYPE_AUDIO) >= 0) { + audio_stream = fmt_ctx->streams[audio_stream_idx]; + audio_dst_file = fopen(audio_dst_filename, "wb"); + if (!audio_dst_file) { + fprintf(stderr, "Could not open destination file %s\n", audio_dst_filename); + ret = 1; + goto end; + } + } + + /* dump input information to stderr */ + av_dump_format(fmt_ctx, 0, src_filename, 0); + + if (!audio_stream && !video_stream) { + fprintf(stderr, "Could not find audio or video stream in the input, aborting\n"); + ret = 1; + goto end; + } + + frame = av_frame_alloc(); + if (!frame) { + fprintf(stderr, "Could not allocate frame\n"); + ret = AVERROR(ENOMEM); + goto end; + } + + pkt = av_packet_alloc(); + if (!pkt) { + fprintf(stderr, "Could not allocate packet\n"); + ret = AVERROR(ENOMEM); + goto end; + } + + if (video_stream) + printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename); + if (audio_stream) + printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename); + + /* read frames from the file */ + while (av_read_frame(fmt_ctx, pkt) >= 0) { + // check if the packet belongs to a stream we are interested in, otherwise + // skip it + if (pkt->stream_index == video_stream_idx) + ret = decode_packet(video_dec_ctx, pkt); + else if (pkt->stream_index == audio_stream_idx) + ret = decode_packet(audio_dec_ctx, pkt); + av_packet_unref(pkt); + if (ret < 0) + break; + } + + /* flush the decoders */ + if (video_dec_ctx) + decode_packet(video_dec_ctx, NULL); + if (audio_dec_ctx) + decode_packet(audio_dec_ctx, NULL); + + printf("Demuxing succeeded.\n"); + + if (video_stream) { + printf("Play the output video file with the command:\n" + "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", + av_get_pix_fmt_name(pix_fmt), width, height, + video_dst_filename); + } + + if (audio_stream) { + enum AVSampleFormat sfmt = audio_dec_ctx->sample_fmt; + int n_channels = audio_dec_ctx->ch_layout.nb_channels; + const char *fmt; + + if (av_sample_fmt_is_planar(sfmt)) { + const char *packed = av_get_sample_fmt_name(sfmt); + printf("Warning: the sample format the decoder produced is planar " + "(%s). This example will output the first channel only.\n", + packed ? packed : "?"); + sfmt = av_get_packed_sample_fmt(sfmt); + n_channels = 1; + } + + if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0) + goto end; + + printf("Play the output audio file with the command:\n" + "ffplay -f %s -ac %d -ar %d %s\n", + fmt, n_channels, audio_dec_ctx->sample_rate, + audio_dst_filename); + } + +end: + avcodec_free_context(&video_dec_ctx); + avcodec_free_context(&audio_dec_ctx); + avformat_close_input(&fmt_ctx); + if (video_dst_file) + fclose(video_dst_file); + if (audio_dst_file) + fclose(audio_dst_file); + av_packet_free(&pkt); + av_frame_free(&frame); + av_free(video_dst_data[0]); + + return ret < 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demuxing_decoding.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demuxing_decoding.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demuxing_decoding.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/demuxing_decoding.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2012 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * Demuxing and decoding example. - * - * Show how to use the libavformat and libavcodec API to demux and - * decode audio and video data. - * @example demuxing_decoding.c - */ - -#include -#include -#include -#include -#include - -static AVFormatContext *fmt_ctx = NULL; -static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx; -static int width, height; -static enum AVPixelFormat pix_fmt; -static AVStream *video_stream = NULL, *audio_stream = NULL; -static const char *src_filename = NULL; -static const char *video_dst_filename = NULL; -static const char *audio_dst_filename = NULL; -static FILE *video_dst_file = NULL; -static FILE *audio_dst_file = NULL; - -static uint8_t *video_dst_data[4] = {NULL}; -static int video_dst_linesize[4]; -static int video_dst_bufsize; - -static int video_stream_idx = -1, audio_stream_idx = -1; -static AVFrame *frame = NULL; -static AVPacket *pkt = NULL; -static int video_frame_count = 0; -static int audio_frame_count = 0; - -static int output_video_frame(AVFrame *frame) -{ - if (frame->width != width || frame->height != height || - frame->format != pix_fmt) { - /* To handle this change, one could call av_image_alloc again and - * decode the following frames into another rawvideo file. */ - fprintf(stderr, "Error: Width, height and pixel format have to be " - "constant in a rawvideo file, but the width, height or " - "pixel format of the input video changed:\n" - "old: width = %d, height = %d, format = %s\n" - "new: width = %d, height = %d, format = %s\n", - width, height, av_get_pix_fmt_name(pix_fmt), - frame->width, frame->height, - av_get_pix_fmt_name(frame->format)); - return -1; - } - - printf("video_frame n:%d coded_n:%d\n", - video_frame_count++, frame->coded_picture_number); - - /* copy decoded frame to destination buffer: - * this is required since rawvideo expects non aligned data */ - av_image_copy(video_dst_data, video_dst_linesize, - (const uint8_t **)(frame->data), frame->linesize, - pix_fmt, width, height); - - /* write to rawvideo file */ - fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); - return 0; -} - -static int output_audio_frame(AVFrame *frame) -{ - size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); - printf("audio_frame n:%d nb_samples:%d pts:%s\n", - audio_frame_count++, frame->nb_samples, - av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); - - /* Write the raw audio data samples of the first plane. This works - * fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However, - * most audio decoders output planar audio, which uses a separate - * plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P). - * In other words, this code will write only the first audio channel - * in these cases. - * You should use libswresample or libavfilter to convert the frame - * to packed data. */ - fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file); - - return 0; -} - -static int decode_packet(AVCodecContext *dec, const AVPacket *pkt) -{ - int ret = 0; - - // submit the packet to the decoder - ret = avcodec_send_packet(dec, pkt); - if (ret < 0) { - fprintf(stderr, "Error submitting a packet for decoding (%s)\n", av_err2str(ret)); - return ret; - } - - // get all the available frames from the decoder - while (ret >= 0) { - ret = avcodec_receive_frame(dec, frame); - if (ret < 0) { - // those two return values are special and mean there is no output - // frame available, but there were no errors during decoding - if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) - return 0; - - fprintf(stderr, "Error during decoding (%s)\n", av_err2str(ret)); - return ret; - } - - // write the frame data to output file - if (dec->codec->type == AVMEDIA_TYPE_VIDEO) - ret = output_video_frame(frame); - else - ret = output_audio_frame(frame); - - av_frame_unref(frame); - if (ret < 0) - return ret; - } - - return 0; -} - -static int open_codec_context(int *stream_idx, - AVCodecContext **dec_ctx, AVFormatContext *fmt_ctx, enum AVMediaType type) -{ - int ret, stream_index; - AVStream *st; - const AVCodec *dec = NULL; - - ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0); - if (ret < 0) { - fprintf(stderr, "Could not find %s stream in input file '%s'\n", - av_get_media_type_string(type), src_filename); - return ret; - } else { - stream_index = ret; - st = fmt_ctx->streams[stream_index]; - - /* find decoder for the stream */ - dec = avcodec_find_decoder(st->codecpar->codec_id); - if (!dec) { - fprintf(stderr, "Failed to find %s codec\n", - av_get_media_type_string(type)); - return AVERROR(EINVAL); - } - - /* Allocate a codec context for the decoder */ - *dec_ctx = avcodec_alloc_context3(dec); - if (!*dec_ctx) { - fprintf(stderr, "Failed to allocate the %s codec context\n", - av_get_media_type_string(type)); - return AVERROR(ENOMEM); - } - - /* Copy codec parameters from input stream to output codec context */ - if ((ret = avcodec_parameters_to_context(*dec_ctx, st->codecpar)) < 0) { - fprintf(stderr, "Failed to copy %s codec parameters to decoder context\n", - av_get_media_type_string(type)); - return ret; - } - - /* Init the decoders */ - if ((ret = avcodec_open2(*dec_ctx, dec, NULL)) < 0) { - fprintf(stderr, "Failed to open %s codec\n", - av_get_media_type_string(type)); - return ret; - } - *stream_idx = stream_index; - } - - return 0; -} - -static int get_format_from_sample_fmt(const char **fmt, - enum AVSampleFormat sample_fmt) -{ - int i; - struct sample_fmt_entry { - enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; - } sample_fmt_entries[] = { - { AV_SAMPLE_FMT_U8, "u8", "u8" }, - { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, - { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, - { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, - { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, - }; - *fmt = NULL; - - for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { - struct sample_fmt_entry *entry = &sample_fmt_entries[i]; - if (sample_fmt == entry->sample_fmt) { - *fmt = AV_NE(entry->fmt_be, entry->fmt_le); - return 0; - } - } - - fprintf(stderr, - "sample format %s is not supported as output format\n", - av_get_sample_fmt_name(sample_fmt)); - return -1; -} - -int main (int argc, char **argv) -{ - int ret = 0; - - if (argc != 4) { - fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n" - "API example program to show how to read frames from an input file.\n" - "This program reads frames from a file, decodes them, and writes decoded\n" - "video frames to a rawvideo file named video_output_file, and decoded\n" - "audio frames to a rawaudio file named audio_output_file.\n", - argv[0]); - exit(1); - } - src_filename = argv[1]; - video_dst_filename = argv[2]; - audio_dst_filename = argv[3]; - - /* open input file, and allocate format context */ - if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { - fprintf(stderr, "Could not open source file %s\n", src_filename); - exit(1); - } - - /* retrieve stream information */ - if (avformat_find_stream_info(fmt_ctx, NULL) < 0) { - fprintf(stderr, "Could not find stream information\n"); - exit(1); - } - - if (open_codec_context(&video_stream_idx, &video_dec_ctx, fmt_ctx, AVMEDIA_TYPE_VIDEO) >= 0) { - video_stream = fmt_ctx->streams[video_stream_idx]; - - video_dst_file = fopen(video_dst_filename, "wb"); - if (!video_dst_file) { - fprintf(stderr, "Could not open destination file %s\n", video_dst_filename); - ret = 1; - goto end; - } - - /* allocate image where the decoded image will be put */ - width = video_dec_ctx->width; - height = video_dec_ctx->height; - pix_fmt = video_dec_ctx->pix_fmt; - ret = av_image_alloc(video_dst_data, video_dst_linesize, - width, height, pix_fmt, 1); - if (ret < 0) { - fprintf(stderr, "Could not allocate raw video buffer\n"); - goto end; - } - video_dst_bufsize = ret; - } - - if (open_codec_context(&audio_stream_idx, &audio_dec_ctx, fmt_ctx, AVMEDIA_TYPE_AUDIO) >= 0) { - audio_stream = fmt_ctx->streams[audio_stream_idx]; - audio_dst_file = fopen(audio_dst_filename, "wb"); - if (!audio_dst_file) { - fprintf(stderr, "Could not open destination file %s\n", audio_dst_filename); - ret = 1; - goto end; - } - } - - /* dump input information to stderr */ - av_dump_format(fmt_ctx, 0, src_filename, 0); - - if (!audio_stream && !video_stream) { - fprintf(stderr, "Could not find audio or video stream in the input, aborting\n"); - ret = 1; - goto end; - } - - frame = av_frame_alloc(); - if (!frame) { - fprintf(stderr, "Could not allocate frame\n"); - ret = AVERROR(ENOMEM); - goto end; - } - - pkt = av_packet_alloc(); - if (!pkt) { - fprintf(stderr, "Could not allocate packet\n"); - ret = AVERROR(ENOMEM); - goto end; - } - - if (video_stream) - printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename); - if (audio_stream) - printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename); - - /* read frames from the file */ - while (av_read_frame(fmt_ctx, pkt) >= 0) { - // check if the packet belongs to a stream we are interested in, otherwise - // skip it - if (pkt->stream_index == video_stream_idx) - ret = decode_packet(video_dec_ctx, pkt); - else if (pkt->stream_index == audio_stream_idx) - ret = decode_packet(audio_dec_ctx, pkt); - av_packet_unref(pkt); - if (ret < 0) - break; - } - - /* flush the decoders */ - if (video_dec_ctx) - decode_packet(video_dec_ctx, NULL); - if (audio_dec_ctx) - decode_packet(audio_dec_ctx, NULL); - - printf("Demuxing succeeded.\n"); - - if (video_stream) { - printf("Play the output video file with the command:\n" - "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", - av_get_pix_fmt_name(pix_fmt), width, height, - video_dst_filename); - } - - if (audio_stream) { - enum AVSampleFormat sfmt = audio_dec_ctx->sample_fmt; - int n_channels = audio_dec_ctx->ch_layout.nb_channels; - const char *fmt; - - if (av_sample_fmt_is_planar(sfmt)) { - const char *packed = av_get_sample_fmt_name(sfmt); - printf("Warning: the sample format the decoder produced is planar " - "(%s). This example will output the first channel only.\n", - packed ? packed : "?"); - sfmt = av_get_packed_sample_fmt(sfmt); - n_channels = 1; - } - - if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0) - goto end; - - printf("Play the output audio file with the command:\n" - "ffplay -f %s -ac %d -ar %d %s\n", - fmt, n_channels, audio_dec_ctx->sample_rate, - audio_dst_filename); - } - -end: - avcodec_free_context(&video_dec_ctx); - avcodec_free_context(&audio_dec_ctx); - avformat_close_input(&fmt_ctx); - if (video_dst_file) - fclose(video_dst_file); - if (audio_dst_file) - fclose(audio_dst_file); - av_packet_free(&pkt); - av_frame_free(&frame); - av_free(video_dst_data[0]); - - return ret < 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,10 +21,10 @@ */ /** - * @file - * audio encoding with libavcodec API example. - * + * @file libavcodec encoding audio API usage examples * @example encode_audio.c + * + * Generate a synthetic audio signal and encode it to an output MP2 file. */ #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/encode_video.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,10 +21,10 @@ */ /** - * @file - * video encoding with libavcodec API example - * + * @file libavcodec encoding video API usage example * @example encode_video.c + * + * Generate synthetic video data and encode it to an output file. */ #include @@ -202,7 +202,7 @@ It makes only sense because this tiny examples writes packets directly. This is called "elementary stream" and only works for some codecs. To create a valid file, you usually need to write packets - into a proper file format or protocol; see muxing.c. + into a proper file format or protocol; see mux.c. */ if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO) fwrite(endcode, 1, sizeof(endcode), f); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/extract_mvs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/extract_mvs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/extract_mvs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/extract_mvs.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,14 @@ * THE SOFTWARE. */ +/** + * @file libavcodec motion vectors extraction API usage example + * @example extract_mvs.c + * + * Read from input file, decode video stream and print a motion vectors + * representation to stdout. + */ + #include #include #include @@ -61,10 +69,11 @@ const AVMotionVector *mvs = (const AVMotionVector *)sd->data; for (i = 0; i < sd->size / sizeof(*mvs); i++) { const AVMotionVector *mv = &mvs[i]; - printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n", + printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64",%4d,%4d,%4d\n", video_frame_count, mv->source, mv->w, mv->h, mv->src_x, mv->src_y, - mv->dst_x, mv->dst_y, mv->flags); + mv->dst_x, mv->dst_y, mv->flags, + mv->motion_x, mv->motion_y, mv->motion_scale); } } av_frame_unref(frame); @@ -166,7 +175,7 @@ goto end; } - printf("framenum,source,blockw,blockh,srcx,srcy,dstx,dsty,flags\n"); + printf("framenum,source,blockw,blockh,srcx,srcy,dstx,dsty,flags,motion_x,motion_y,motion_scale\n"); /* read frames from the file */ while (av_read_frame(fmt_ctx, pkt) >= 0) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filter_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filter_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filter_audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filter_audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,13 +19,11 @@ */ /** - * @file - * libavfilter API usage example. - * + * @file libavfilter audio filtering API usage example * @example filter_audio.c - * This example will generate a sine wave audio, - * pass it through a simple filter chain, and then compute the MD5 checksum of - * the output data. + * + * This example will generate a sine wave audio, pass it through a simple filter + * chain, and then compute the MD5 checksum of the output data. * * The filter chain it uses is: * (input) -> abuffer -> volume -> aformat -> abuffersink -> (output) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_audio.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,294 +0,0 @@ -/* - * Copyright (c) 2010 Nicolas George - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2012 Clément Bœsch - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * API example for audio decoding and filtering - * @example filtering_audio.c - */ - -#include - -#include -#include -#include -#include -#include -#include - -static const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono"; -static const char *player = "ffplay -f s16le -ar 8000 -ac 1 -"; - -static AVFormatContext *fmt_ctx; -static AVCodecContext *dec_ctx; -AVFilterContext *buffersink_ctx; -AVFilterContext *buffersrc_ctx; -AVFilterGraph *filter_graph; -static int audio_stream_index = -1; - -static int open_input_file(const char *filename) -{ - const AVCodec *dec; - int ret; - - if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); - return ret; - } - - if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); - return ret; - } - - /* select the audio stream */ - ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find an audio stream in the input file\n"); - return ret; - } - audio_stream_index = ret; - - /* create decoding context */ - dec_ctx = avcodec_alloc_context3(dec); - if (!dec_ctx) - return AVERROR(ENOMEM); - avcodec_parameters_to_context(dec_ctx, fmt_ctx->streams[audio_stream_index]->codecpar); - - /* init the audio decoder */ - if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n"); - return ret; - } - - return 0; -} - -static int init_filters(const char *filters_descr) -{ - char args[512]; - int ret = 0; - const AVFilter *abuffersrc = avfilter_get_by_name("abuffer"); - const AVFilter *abuffersink = avfilter_get_by_name("abuffersink"); - AVFilterInOut *outputs = avfilter_inout_alloc(); - AVFilterInOut *inputs = avfilter_inout_alloc(); - static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 }; - static const int out_sample_rates[] = { 8000, -1 }; - const AVFilterLink *outlink; - AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base; - - filter_graph = avfilter_graph_alloc(); - if (!outputs || !inputs || !filter_graph) { - ret = AVERROR(ENOMEM); - goto end; - } - - /* buffer audio source: the decoded frames from the decoder will be inserted here. */ - if (dec_ctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) - av_channel_layout_default(&dec_ctx->ch_layout, dec_ctx->ch_layout.nb_channels); - ret = snprintf(args, sizeof(args), - "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=", - time_base.num, time_base.den, dec_ctx->sample_rate, - av_get_sample_fmt_name(dec_ctx->sample_fmt)); - av_channel_layout_describe(&dec_ctx->ch_layout, args + ret, sizeof(args) - ret); - ret = avfilter_graph_create_filter(&buffersrc_ctx, abuffersrc, "in", - args, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); - goto end; - } - - /* buffer audio sink: to terminate the filter chain. */ - ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out", - NULL, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); - goto end; - } - - ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1, - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n"); - goto end; - } - - ret = av_opt_set(buffersink_ctx, "ch_layouts", "mono", - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n"); - goto end; - } - - ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1, - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n"); - goto end; - } - - /* - * Set the endpoints for the filter graph. The filter_graph will - * be linked to the graph described by filters_descr. - */ - - /* - * The buffer source output must be connected to the input pad of - * the first filter described by filters_descr; since the first - * filter input label is not specified, it is set to "in" by - * default. - */ - outputs->name = av_strdup("in"); - outputs->filter_ctx = buffersrc_ctx; - outputs->pad_idx = 0; - outputs->next = NULL; - - /* - * The buffer sink input must be connected to the output pad of - * the last filter described by filters_descr; since the last - * filter output label is not specified, it is set to "out" by - * default. - */ - inputs->name = av_strdup("out"); - inputs->filter_ctx = buffersink_ctx; - inputs->pad_idx = 0; - inputs->next = NULL; - - if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr, - &inputs, &outputs, NULL)) < 0) - goto end; - - if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) - goto end; - - /* Print summary of the sink buffer - * Note: args buffer is reused to store channel layout string */ - outlink = buffersink_ctx->inputs[0]; - av_channel_layout_describe(&outlink->ch_layout, args, sizeof(args)); - av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n", - (int)outlink->sample_rate, - (char *)av_x_if_null(av_get_sample_fmt_name(outlink->format), "?"), - args); - -end: - avfilter_inout_free(&inputs); - avfilter_inout_free(&outputs); - - return ret; -} - -static void print_frame(const AVFrame *frame) -{ - const int n = frame->nb_samples * frame->ch_layout.nb_channels; - const uint16_t *p = (uint16_t*)frame->data[0]; - const uint16_t *p_end = p + n; - - while (p < p_end) { - fputc(*p & 0xff, stdout); - fputc(*p>>8 & 0xff, stdout); - p++; - } - fflush(stdout); -} - -int main(int argc, char **argv) -{ - int ret; - AVPacket *packet = av_packet_alloc(); - AVFrame *frame = av_frame_alloc(); - AVFrame *filt_frame = av_frame_alloc(); - - if (!packet || !frame || !filt_frame) { - fprintf(stderr, "Could not allocate frame or packet\n"); - exit(1); - } - if (argc != 2) { - fprintf(stderr, "Usage: %s file | %s\n", argv[0], player); - exit(1); - } - - if ((ret = open_input_file(argv[1])) < 0) - goto end; - if ((ret = init_filters(filter_descr)) < 0) - goto end; - - /* read all packets */ - while (1) { - if ((ret = av_read_frame(fmt_ctx, packet)) < 0) - break; - - if (packet->stream_index == audio_stream_index) { - ret = avcodec_send_packet(dec_ctx, packet); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n"); - break; - } - - while (ret >= 0) { - ret = avcodec_receive_frame(dec_ctx, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while receiving a frame from the decoder\n"); - goto end; - } - - if (ret >= 0) { - /* push the audio data from decoded frame into the filtergraph */ - if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n"); - break; - } - - /* pull filtered audio from the filtergraph */ - while (1) { - ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - break; - if (ret < 0) - goto end; - print_frame(filt_frame); - av_frame_unref(filt_frame); - } - av_frame_unref(frame); - } - } - } - av_packet_unref(packet); - } -end: - avfilter_graph_free(&filter_graph); - avcodec_free_context(&dec_ctx); - avformat_close_input(&fmt_ctx); - av_packet_free(&packet); - av_frame_free(&frame); - av_frame_free(&filt_frame); - - if (ret < 0 && ret != AVERROR_EOF) { - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); - exit(1); - } - - exit(0); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/filtering_video.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2010 Nicolas George - * Copyright (c) 2011 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * API example for decoding and filtering - * @example filtering_video.c - */ - -#define _XOPEN_SOURCE 600 /* for usleep */ -#include -#include -#include - -#include -#include -#include -#include -#include - -const char *filter_descr = "scale=78:24,transpose=cclock"; -/* other way: - scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively - */ - -static AVFormatContext *fmt_ctx; -static AVCodecContext *dec_ctx; -AVFilterContext *buffersink_ctx; -AVFilterContext *buffersrc_ctx; -AVFilterGraph *filter_graph; -static int video_stream_index = -1; -static int64_t last_pts = AV_NOPTS_VALUE; - -static int open_input_file(const char *filename) -{ - const AVCodec *dec; - int ret; - - if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); - return ret; - } - - if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); - return ret; - } - - /* select the video stream */ - ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n"); - return ret; - } - video_stream_index = ret; - - /* create decoding context */ - dec_ctx = avcodec_alloc_context3(dec); - if (!dec_ctx) - return AVERROR(ENOMEM); - avcodec_parameters_to_context(dec_ctx, fmt_ctx->streams[video_stream_index]->codecpar); - - /* init the video decoder */ - if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n"); - return ret; - } - - return 0; -} - -static int init_filters(const char *filters_descr) -{ - char args[512]; - int ret = 0; - const AVFilter *buffersrc = avfilter_get_by_name("buffer"); - const AVFilter *buffersink = avfilter_get_by_name("buffersink"); - AVFilterInOut *outputs = avfilter_inout_alloc(); - AVFilterInOut *inputs = avfilter_inout_alloc(); - AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base; - enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; - - filter_graph = avfilter_graph_alloc(); - if (!outputs || !inputs || !filter_graph) { - ret = AVERROR(ENOMEM); - goto end; - } - - /* buffer video source: the decoded frames from the decoder will be inserted here. */ - snprintf(args, sizeof(args), - "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", - dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, - time_base.num, time_base.den, - dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den); - - ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", - args, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n"); - goto end; - } - - /* buffer video sink: to terminate the filter chain. */ - ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", - NULL, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); - goto end; - } - - ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts, - AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n"); - goto end; - } - - /* - * Set the endpoints for the filter graph. The filter_graph will - * be linked to the graph described by filters_descr. - */ - - /* - * The buffer source output must be connected to the input pad of - * the first filter described by filters_descr; since the first - * filter input label is not specified, it is set to "in" by - * default. - */ - outputs->name = av_strdup("in"); - outputs->filter_ctx = buffersrc_ctx; - outputs->pad_idx = 0; - outputs->next = NULL; - - /* - * The buffer sink input must be connected to the output pad of - * the last filter described by filters_descr; since the last - * filter output label is not specified, it is set to "out" by - * default. - */ - inputs->name = av_strdup("out"); - inputs->filter_ctx = buffersink_ctx; - inputs->pad_idx = 0; - inputs->next = NULL; - - if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr, - &inputs, &outputs, NULL)) < 0) - goto end; - - if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) - goto end; - -end: - avfilter_inout_free(&inputs); - avfilter_inout_free(&outputs); - - return ret; -} - -static void display_frame(const AVFrame *frame, AVRational time_base) -{ - int x, y; - uint8_t *p0, *p; - int64_t delay; - - if (frame->pts != AV_NOPTS_VALUE) { - if (last_pts != AV_NOPTS_VALUE) { - /* sleep roughly the right amount of time; - * usleep is in microseconds, just like AV_TIME_BASE. */ - delay = av_rescale_q(frame->pts - last_pts, - time_base, AV_TIME_BASE_Q); - if (delay > 0 && delay < 1000000) - usleep(delay); - } - last_pts = frame->pts; - } - - /* Trivial ASCII grayscale display. */ - p0 = frame->data[0]; - puts("\033c"); - for (y = 0; y < frame->height; y++) { - p = p0; - for (x = 0; x < frame->width; x++) - putchar(" .-+#"[*(p++) / 52]); - putchar('\n'); - p0 += frame->linesize[0]; - } - fflush(stdout); -} - -int main(int argc, char **argv) -{ - int ret; - AVPacket *packet; - AVFrame *frame; - AVFrame *filt_frame; - - if (argc != 2) { - fprintf(stderr, "Usage: %s file\n", argv[0]); - exit(1); - } - - frame = av_frame_alloc(); - filt_frame = av_frame_alloc(); - packet = av_packet_alloc(); - if (!frame || !filt_frame || !packet) { - fprintf(stderr, "Could not allocate frame or packet\n"); - exit(1); - } - - if ((ret = open_input_file(argv[1])) < 0) - goto end; - if ((ret = init_filters(filter_descr)) < 0) - goto end; - - /* read all packets */ - while (1) { - if ((ret = av_read_frame(fmt_ctx, packet)) < 0) - break; - - if (packet->stream_index == video_stream_index) { - ret = avcodec_send_packet(dec_ctx, packet); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n"); - break; - } - - while (ret >= 0) { - ret = avcodec_receive_frame(dec_ctx, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while receiving a frame from the decoder\n"); - goto end; - } - - frame->pts = frame->best_effort_timestamp; - - /* push the decoded frame into the filtergraph */ - if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n"); - break; - } - - /* pull filtered frames from the filtergraph */ - while (1) { - ret = av_buffersink_get_frame(buffersink_ctx, filt_frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - break; - if (ret < 0) - goto end; - display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base); - av_frame_unref(filt_frame); - } - av_frame_unref(frame); - } - } - av_packet_unref(packet); - } -end: - avfilter_graph_free(&filter_graph); - avcodec_free_context(&dec_ctx); - avformat_close_input(&fmt_ctx); - av_frame_free(&frame); - av_frame_free(&filt_frame); - av_packet_free(&packet); - - if (ret < 0 && ret != AVERROR_EOF) { - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); - exit(1); - } - - exit(0); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/http_multiclient.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/http_multiclient.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/http_multiclient.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/http_multiclient.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2015 Stephan Holljes - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * libavformat multi-client network API usage example. - * - * @example http_multiclient.c - * This example will serve a file without decoding or demuxing it over http. - * Multiple clients can connect and will receive the same file. - */ - -#include -#include -#include - -static void process_client(AVIOContext *client, const char *in_uri) -{ - AVIOContext *input = NULL; - uint8_t buf[1024]; - int ret, n, reply_code; - uint8_t *resource = NULL; - while ((ret = avio_handshake(client)) > 0) { - av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource); - // check for strlen(resource) is necessary, because av_opt_get() - // may return empty string. - if (resource && strlen(resource)) - break; - av_freep(&resource); - } - if (ret < 0) - goto end; - av_log(client, AV_LOG_TRACE, "resource=%p\n", resource); - if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) { - reply_code = 200; - } else { - reply_code = AVERROR_HTTP_NOT_FOUND; - } - if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) { - av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret)); - goto end; - } - av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code); - - while ((ret = avio_handshake(client)) > 0); - - if (ret < 0) - goto end; - - fprintf(stderr, "Handshake performed.\n"); - if (reply_code != 200) - goto end; - fprintf(stderr, "Opening input file.\n"); - if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) { - av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri, - av_err2str(ret)); - goto end; - } - for(;;) { - n = avio_read(input, buf, sizeof(buf)); - if (n < 0) { - if (n == AVERROR_EOF) - break; - av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n", - av_err2str(n)); - break; - } - avio_write(client, buf, n); - avio_flush(client); - } -end: - fprintf(stderr, "Flushing client\n"); - avio_flush(client); - fprintf(stderr, "Closing client\n"); - avio_close(client); - fprintf(stderr, "Closing input\n"); - avio_close(input); - av_freep(&resource); -} - -int main(int argc, char **argv) -{ - AVDictionary *options = NULL; - AVIOContext *client = NULL, *server = NULL; - const char *in_uri, *out_uri; - int ret, pid; - av_log_set_level(AV_LOG_TRACE); - if (argc < 3) { - printf("usage: %s input http://hostname[:port]\n" - "API example program to serve http to multiple clients.\n" - "\n", argv[0]); - return 1; - } - - in_uri = argv[1]; - out_uri = argv[2]; - - avformat_network_init(); - - if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) { - fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret)); - return ret; - } - if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) { - fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret)); - return ret; - } - fprintf(stderr, "Entering main loop.\n"); - for(;;) { - if ((ret = avio_accept(server, &client)) < 0) - goto end; - fprintf(stderr, "Accepted client, forking process.\n"); - // XXX: Since we don't reap our children and don't ignore signals - // this produces zombie processes. - pid = fork(); - if (pid < 0) { - perror("Fork failed"); - ret = AVERROR(errno); - goto end; - } - if (pid == 0) { - fprintf(stderr, "In child.\n"); - process_client(client, in_uri); - avio_close(server); - exit(0); - } - if (pid > 0) - avio_close(client); - } -end: - avio_close(server); - if (ret < 0 && ret != AVERROR_EOF) { - fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret)); - return 1; - } - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/hw_decode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/hw_decode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/hw_decode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/hw_decode.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,12 +24,11 @@ */ /** - * @file - * HW-Accelerated decoding example. - * + * @file HW-accelerated decoding API usage.example * @example hw_decode.c - * This example shows how to do HW-accelerated decoding with output - * frames from the HW video surfaces. + * + * Perform HW-accelerated decoding with output frames from HW video + * surfaces. */ #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -1,26 +1,27 @@ +EXAMPLES-$(CONFIG_AVIO_HTTP_SERVE_FILES) += avio_http_serve_files EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir -EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading +EXAMPLES-$(CONFIG_AVIO_READ_CALLBACK_EXAMPLE) += avio_read_callback EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio +EXAMPLES-$(CONFIG_DECODE_FILTER_AUDIO_EXAMPLE) += decode_filter_audio +EXAMPLES-$(CONFIG_DECODE_FILTER_VIDEO_EXAMPLE) += decode_filter_video EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video -EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding +EXAMPLES-$(CONFIG_DEMUX_DECODE_EXAMPLE) += demux_decode EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE) += encode_video EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE) += extract_mvs EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio -EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE) += filtering_audio -EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video -EXAMPLES-$(CONFIG_HTTP_MULTICLIENT_EXAMPLE) += http_multiclient EXAMPLES-$(CONFIG_HW_DECODE_EXAMPLE) += hw_decode -EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata -EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing -EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec -EXAMPLES-$(CONFIG_REMUXING_EXAMPLE) += remuxing -EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE) += resampling_audio -EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) += scaling_video +EXAMPLES-$(CONFIG_MUX_EXAMPLE) += mux +EXAMPLES-$(CONFIG_QSV_DECODE_EXAMPLE) += qsv_decode +EXAMPLES-$(CONFIG_REMUX_EXAMPLE) += remux +EXAMPLES-$(CONFIG_RESAMPLE_AUDIO_EXAMPLE) += resample_audio +EXAMPLES-$(CONFIG_SCALE_VIDEO_EXAMPLE) += scale_video +EXAMPLES-$(CONFIG_SHOW_METADATA_EXAMPLE) += show_metadata EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac -EXAMPLES-$(CONFIG_TRANSCODING_EXAMPLE) += transcoding +EXAMPLES-$(CONFIG_TRANSCODE_EXAMPLE) += transcode EXAMPLES-$(CONFIG_VAAPI_ENCODE_EXAMPLE) += vaapi_encode EXAMPLES-$(CONFIG_VAAPI_TRANSCODE_EXAMPLE) += vaapi_transcode +EXAMPLES-$(CONFIG_QSV_TRANSCODE_EXAMPLE) += qsv_transcode EXAMPLES := $(EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF)) EXAMPLES_G := $(EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)_g$(EXESUF)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile.example mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile.example --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile.example 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/Makefile.example 2023-03-03 13:29:59.000000000 +0000 @@ -11,25 +11,32 @@ CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS) LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS) -EXAMPLES= avio_list_dir \ - avio_reading \ +# missing the following targets, since they need special options in the FFmpeg build: +# qsv_decode +# qsv_transcode +# vaapi_encode +# vaapi_transcode + +EXAMPLES=\ + avio_http_serve_files \ + avio_list_dir \ + avio_read_callback \ decode_audio \ + decode_filter_audio \ + decode_filter_video \ decode_video \ - demuxing_decoding \ + demux_decode \ encode_audio \ encode_video \ extract_mvs \ - filtering_video \ - filtering_audio \ - http_multiclient \ hw_decode \ - metadata \ - muxing \ - remuxing \ - resampling_audio \ - scaling_video \ + mux \ + remux \ + resample_audio \ + scale_video \ + show_metadata \ transcode_aac \ - transcoding \ + transcode OBJS=$(addsuffix .o,$(EXAMPLES)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/metadata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/metadata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/metadata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/metadata.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2011 Reinhard Tartler - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * Shows how the metadata API can be used in application programs. - * @example metadata.c - */ - -#include - -#include -#include - -int main (int argc, char **argv) -{ - AVFormatContext *fmt_ctx = NULL; - const AVDictionaryEntry *tag = NULL; - int ret; - - if (argc != 2) { - printf("usage: %s \n" - "example program to demonstrate the use of the libavformat metadata API.\n" - "\n", argv[0]); - return 1; - } - - if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) - return ret; - - if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); - return ret; - } - - while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) - printf("%s=%s\n", tag->key, tag->value); - - avformat_close_input(&fmt_ctx); - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/mux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/mux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/mux.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/mux.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,644 @@ +/* + * Copyright (c) 2003 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat muxing API usage example + * @example mux.c + * + * Generate a synthetic audio and video signal and mux them to a media file in + * any supported libavformat format. The default codecs are used. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREAM_DURATION 10.0 +#define STREAM_FRAME_RATE 25 /* 25 images/s */ +#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */ + +#define SCALE_FLAGS SWS_BICUBIC + +// a wrapper around a single output AVStream +typedef struct OutputStream { + AVStream *st; + AVCodecContext *enc; + + /* pts of the next frame that will be generated */ + int64_t next_pts; + int samples_count; + + AVFrame *frame; + AVFrame *tmp_frame; + + AVPacket *tmp_pkt; + + float t, tincr, tincr2; + + struct SwsContext *sws_ctx; + struct SwrContext *swr_ctx; +} OutputStream; + +static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt) +{ + AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base; + + printf("pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n", + av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base), + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base), + pkt->stream_index); +} + +static int write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c, + AVStream *st, AVFrame *frame, AVPacket *pkt) +{ + int ret; + + // send the frame to the encoder + ret = avcodec_send_frame(c, frame); + if (ret < 0) { + fprintf(stderr, "Error sending a frame to the encoder: %s\n", + av_err2str(ret)); + exit(1); + } + + while (ret >= 0) { + ret = avcodec_receive_packet(c, pkt); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + break; + else if (ret < 0) { + fprintf(stderr, "Error encoding a frame: %s\n", av_err2str(ret)); + exit(1); + } + + /* rescale output packet timestamp values from codec to stream timebase */ + av_packet_rescale_ts(pkt, c->time_base, st->time_base); + pkt->stream_index = st->index; + + /* Write the compressed frame to the media file. */ + log_packet(fmt_ctx, pkt); + ret = av_interleaved_write_frame(fmt_ctx, pkt); + /* pkt is now blank (av_interleaved_write_frame() takes ownership of + * its contents and resets pkt), so that no unreferencing is necessary. + * This would be different if one used av_write_frame(). */ + if (ret < 0) { + fprintf(stderr, "Error while writing output packet: %s\n", av_err2str(ret)); + exit(1); + } + } + + return ret == AVERROR_EOF ? 1 : 0; +} + +/* Add an output stream. */ +static void add_stream(OutputStream *ost, AVFormatContext *oc, + const AVCodec **codec, + enum AVCodecID codec_id) +{ + AVCodecContext *c; + int i; + + /* find the encoder */ + *codec = avcodec_find_encoder(codec_id); + if (!(*codec)) { + fprintf(stderr, "Could not find encoder for '%s'\n", + avcodec_get_name(codec_id)); + exit(1); + } + + ost->tmp_pkt = av_packet_alloc(); + if (!ost->tmp_pkt) { + fprintf(stderr, "Could not allocate AVPacket\n"); + exit(1); + } + + ost->st = avformat_new_stream(oc, NULL); + if (!ost->st) { + fprintf(stderr, "Could not allocate stream\n"); + exit(1); + } + ost->st->id = oc->nb_streams-1; + c = avcodec_alloc_context3(*codec); + if (!c) { + fprintf(stderr, "Could not alloc an encoding context\n"); + exit(1); + } + ost->enc = c; + + switch ((*codec)->type) { + case AVMEDIA_TYPE_AUDIO: + c->sample_fmt = (*codec)->sample_fmts ? + (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP; + c->bit_rate = 64000; + c->sample_rate = 44100; + if ((*codec)->supported_samplerates) { + c->sample_rate = (*codec)->supported_samplerates[0]; + for (i = 0; (*codec)->supported_samplerates[i]; i++) { + if ((*codec)->supported_samplerates[i] == 44100) + c->sample_rate = 44100; + } + } + av_channel_layout_copy(&c->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); + ost->st->time_base = (AVRational){ 1, c->sample_rate }; + break; + + case AVMEDIA_TYPE_VIDEO: + c->codec_id = codec_id; + + c->bit_rate = 400000; + /* Resolution must be a multiple of two. */ + c->width = 352; + c->height = 288; + /* timebase: This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/framerate and timestamp increments should be + * identical to 1. */ + ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE }; + c->time_base = ost->st->time_base; + + c->gop_size = 12; /* emit one intra frame every twelve frames at most */ + c->pix_fmt = STREAM_PIX_FMT; + if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + /* just for testing, we also add B-frames */ + c->max_b_frames = 2; + } + if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { + /* Needed to avoid using macroblocks in which some coeffs overflow. + * This does not happen with normal video, it just happens here as + * the motion of the chroma plane does not match the luma plane. */ + c->mb_decision = 2; + } + break; + + default: + break; + } + + /* Some formats want stream headers to be separate. */ + if (oc->oformat->flags & AVFMT_GLOBALHEADER) + c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; +} + +/**************************************************************/ +/* audio output */ + +static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt, + const AVChannelLayout *channel_layout, + int sample_rate, int nb_samples) +{ + AVFrame *frame = av_frame_alloc(); + if (!frame) { + fprintf(stderr, "Error allocating an audio frame\n"); + exit(1); + } + + frame->format = sample_fmt; + av_channel_layout_copy(&frame->ch_layout, channel_layout); + frame->sample_rate = sample_rate; + frame->nb_samples = nb_samples; + + if (nb_samples) { + if (av_frame_get_buffer(frame, 0) < 0) { + fprintf(stderr, "Error allocating an audio buffer\n"); + exit(1); + } + } + + return frame; +} + +static void open_audio(AVFormatContext *oc, const AVCodec *codec, + OutputStream *ost, AVDictionary *opt_arg) +{ + AVCodecContext *c; + int nb_samples; + int ret; + AVDictionary *opt = NULL; + + c = ost->enc; + + /* open it */ + av_dict_copy(&opt, opt_arg, 0); + ret = avcodec_open2(c, codec, &opt); + av_dict_free(&opt); + if (ret < 0) { + fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret)); + exit(1); + } + + /* init signal generator */ + ost->t = 0; + ost->tincr = 2 * M_PI * 110.0 / c->sample_rate; + /* increment frequency by 110 Hz per second */ + ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate; + + if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) + nb_samples = 10000; + else + nb_samples = c->frame_size; + + ost->frame = alloc_audio_frame(c->sample_fmt, &c->ch_layout, + c->sample_rate, nb_samples); + ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, &c->ch_layout, + c->sample_rate, nb_samples); + + /* copy the stream parameters to the muxer */ + ret = avcodec_parameters_from_context(ost->st->codecpar, c); + if (ret < 0) { + fprintf(stderr, "Could not copy the stream parameters\n"); + exit(1); + } + + /* create resampler context */ + ost->swr_ctx = swr_alloc(); + if (!ost->swr_ctx) { + fprintf(stderr, "Could not allocate resampler context\n"); + exit(1); + } + + /* set options */ + av_opt_set_chlayout (ost->swr_ctx, "in_chlayout", &c->ch_layout, 0); + av_opt_set_int (ost->swr_ctx, "in_sample_rate", c->sample_rate, 0); + av_opt_set_sample_fmt(ost->swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0); + av_opt_set_chlayout (ost->swr_ctx, "out_chlayout", &c->ch_layout, 0); + av_opt_set_int (ost->swr_ctx, "out_sample_rate", c->sample_rate, 0); + av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0); + + /* initialize the resampling context */ + if ((ret = swr_init(ost->swr_ctx)) < 0) { + fprintf(stderr, "Failed to initialize the resampling context\n"); + exit(1); + } +} + +/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and + * 'nb_channels' channels. */ +static AVFrame *get_audio_frame(OutputStream *ost) +{ + AVFrame *frame = ost->tmp_frame; + int j, i, v; + int16_t *q = (int16_t*)frame->data[0]; + + /* check if we want to generate more frames */ + if (av_compare_ts(ost->next_pts, ost->enc->time_base, + STREAM_DURATION, (AVRational){ 1, 1 }) > 0) + return NULL; + + for (j = 0; j nb_samples; j++) { + v = (int)(sin(ost->t) * 10000); + for (i = 0; i < ost->enc->ch_layout.nb_channels; i++) + *q++ = v; + ost->t += ost->tincr; + ost->tincr += ost->tincr2; + } + + frame->pts = ost->next_pts; + ost->next_pts += frame->nb_samples; + + return frame; +} + +/* + * encode one audio frame and send it to the muxer + * return 1 when encoding is finished, 0 otherwise + */ +static int write_audio_frame(AVFormatContext *oc, OutputStream *ost) +{ + AVCodecContext *c; + AVFrame *frame; + int ret; + int dst_nb_samples; + + c = ost->enc; + + frame = get_audio_frame(ost); + + if (frame) { + /* convert samples from native format to destination codec format, using the resampler */ + /* compute destination number of samples */ + dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples, + c->sample_rate, c->sample_rate, AV_ROUND_UP); + av_assert0(dst_nb_samples == frame->nb_samples); + + /* when we pass a frame to the encoder, it may keep a reference to it + * internally; + * make sure we do not overwrite it here + */ + ret = av_frame_make_writable(ost->frame); + if (ret < 0) + exit(1); + + /* convert to destination format */ + ret = swr_convert(ost->swr_ctx, + ost->frame->data, dst_nb_samples, + (const uint8_t **)frame->data, frame->nb_samples); + if (ret < 0) { + fprintf(stderr, "Error while converting\n"); + exit(1); + } + frame = ost->frame; + + frame->pts = av_rescale_q(ost->samples_count, (AVRational){1, c->sample_rate}, c->time_base); + ost->samples_count += dst_nb_samples; + } + + return write_frame(oc, c, ost->st, frame, ost->tmp_pkt); +} + +/**************************************************************/ +/* video output */ + +static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height) +{ + AVFrame *picture; + int ret; + + picture = av_frame_alloc(); + if (!picture) + return NULL; + + picture->format = pix_fmt; + picture->width = width; + picture->height = height; + + /* allocate the buffers for the frame data */ + ret = av_frame_get_buffer(picture, 0); + if (ret < 0) { + fprintf(stderr, "Could not allocate frame data.\n"); + exit(1); + } + + return picture; +} + +static void open_video(AVFormatContext *oc, const AVCodec *codec, + OutputStream *ost, AVDictionary *opt_arg) +{ + int ret; + AVCodecContext *c = ost->enc; + AVDictionary *opt = NULL; + + av_dict_copy(&opt, opt_arg, 0); + + /* open the codec */ + ret = avcodec_open2(c, codec, &opt); + av_dict_free(&opt); + if (ret < 0) { + fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); + exit(1); + } + + /* allocate and init a re-usable frame */ + ost->frame = alloc_picture(c->pix_fmt, c->width, c->height); + if (!ost->frame) { + fprintf(stderr, "Could not allocate video frame\n"); + exit(1); + } + + /* If the output format is not YUV420P, then a temporary YUV420P + * picture is needed too. It is then converted to the required + * output format. */ + ost->tmp_frame = NULL; + if (c->pix_fmt != AV_PIX_FMT_YUV420P) { + ost->tmp_frame = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height); + if (!ost->tmp_frame) { + fprintf(stderr, "Could not allocate temporary picture\n"); + exit(1); + } + } + + /* copy the stream parameters to the muxer */ + ret = avcodec_parameters_from_context(ost->st->codecpar, c); + if (ret < 0) { + fprintf(stderr, "Could not copy the stream parameters\n"); + exit(1); + } +} + +/* Prepare a dummy image. */ +static void fill_yuv_image(AVFrame *pict, int frame_index, + int width, int height) +{ + int x, y, i; + + i = frame_index; + + /* Y */ + for (y = 0; y < height; y++) + for (x = 0; x < width; x++) + pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3; + + /* Cb and Cr */ + for (y = 0; y < height / 2; y++) { + for (x = 0; x < width / 2; x++) { + pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2; + pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5; + } + } +} + +static AVFrame *get_video_frame(OutputStream *ost) +{ + AVCodecContext *c = ost->enc; + + /* check if we want to generate more frames */ + if (av_compare_ts(ost->next_pts, c->time_base, + STREAM_DURATION, (AVRational){ 1, 1 }) > 0) + return NULL; + + /* when we pass a frame to the encoder, it may keep a reference to it + * internally; make sure we do not overwrite it here */ + if (av_frame_make_writable(ost->frame) < 0) + exit(1); + + if (c->pix_fmt != AV_PIX_FMT_YUV420P) { + /* as we only generate a YUV420P picture, we must convert it + * to the codec pixel format if needed */ + if (!ost->sws_ctx) { + ost->sws_ctx = sws_getContext(c->width, c->height, + AV_PIX_FMT_YUV420P, + c->width, c->height, + c->pix_fmt, + SCALE_FLAGS, NULL, NULL, NULL); + if (!ost->sws_ctx) { + fprintf(stderr, + "Could not initialize the conversion context\n"); + exit(1); + } + } + fill_yuv_image(ost->tmp_frame, ost->next_pts, c->width, c->height); + sws_scale(ost->sws_ctx, (const uint8_t * const *) ost->tmp_frame->data, + ost->tmp_frame->linesize, 0, c->height, ost->frame->data, + ost->frame->linesize); + } else { + fill_yuv_image(ost->frame, ost->next_pts, c->width, c->height); + } + + ost->frame->pts = ost->next_pts++; + + return ost->frame; +} + +/* + * encode one video frame and send it to the muxer + * return 1 when encoding is finished, 0 otherwise + */ +static int write_video_frame(AVFormatContext *oc, OutputStream *ost) +{ + return write_frame(oc, ost->enc, ost->st, get_video_frame(ost), ost->tmp_pkt); +} + +static void close_stream(AVFormatContext *oc, OutputStream *ost) +{ + avcodec_free_context(&ost->enc); + av_frame_free(&ost->frame); + av_frame_free(&ost->tmp_frame); + av_packet_free(&ost->tmp_pkt); + sws_freeContext(ost->sws_ctx); + swr_free(&ost->swr_ctx); +} + +/**************************************************************/ +/* media file output */ + +int main(int argc, char **argv) +{ + OutputStream video_st = { 0 }, audio_st = { 0 }; + const AVOutputFormat *fmt; + const char *filename; + AVFormatContext *oc; + const AVCodec *audio_codec, *video_codec; + int ret; + int have_video = 0, have_audio = 0; + int encode_video = 0, encode_audio = 0; + AVDictionary *opt = NULL; + int i; + + if (argc < 2) { + printf("usage: %s output_file\n" + "API example program to output a media file with libavformat.\n" + "This program generates a synthetic audio and video stream, encodes and\n" + "muxes them into a file named output_file.\n" + "The output format is automatically guessed according to the file extension.\n" + "Raw images can also be output by using '%%d' in the filename.\n" + "\n", argv[0]); + return 1; + } + + filename = argv[1]; + for (i = 2; i+1 < argc; i+=2) { + if (!strcmp(argv[i], "-flags") || !strcmp(argv[i], "-fflags")) + av_dict_set(&opt, argv[i]+1, argv[i+1], 0); + } + + /* allocate the output media context */ + avformat_alloc_output_context2(&oc, NULL, NULL, filename); + if (!oc) { + printf("Could not deduce output format from file extension: using MPEG.\n"); + avformat_alloc_output_context2(&oc, NULL, "mpeg", filename); + } + if (!oc) + return 1; + + fmt = oc->oformat; + + /* Add the audio and video streams using the default format codecs + * and initialize the codecs. */ + if (fmt->video_codec != AV_CODEC_ID_NONE) { + add_stream(&video_st, oc, &video_codec, fmt->video_codec); + have_video = 1; + encode_video = 1; + } + if (fmt->audio_codec != AV_CODEC_ID_NONE) { + add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec); + have_audio = 1; + encode_audio = 1; + } + + /* Now that all the parameters are set, we can open the audio and + * video codecs and allocate the necessary encode buffers. */ + if (have_video) + open_video(oc, video_codec, &video_st, opt); + + if (have_audio) + open_audio(oc, audio_codec, &audio_st, opt); + + av_dump_format(oc, 0, filename, 1); + + /* open the output file, if needed */ + if (!(fmt->flags & AVFMT_NOFILE)) { + ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE); + if (ret < 0) { + fprintf(stderr, "Could not open '%s': %s\n", filename, + av_err2str(ret)); + return 1; + } + } + + /* Write the stream header, if any. */ + ret = avformat_write_header(oc, &opt); + if (ret < 0) { + fprintf(stderr, "Error occurred when opening output file: %s\n", + av_err2str(ret)); + return 1; + } + + while (encode_video || encode_audio) { + /* select the stream to encode */ + if (encode_video && + (!encode_audio || av_compare_ts(video_st.next_pts, video_st.enc->time_base, + audio_st.next_pts, audio_st.enc->time_base) <= 0)) { + encode_video = !write_video_frame(oc, &video_st); + } else { + encode_audio = !write_audio_frame(oc, &audio_st); + } + } + + av_write_trailer(oc); + + /* Close each codec. */ + if (have_video) + close_stream(oc, &video_st); + if (have_audio) + close_stream(oc, &audio_st); + + if (!(fmt->flags & AVFMT_NOFILE)) + /* Close the output file. */ + avio_closep(&oc->pb); + + /* free the stream */ + avformat_free_context(oc); + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/muxing.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/muxing.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/muxing.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/muxing.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,648 +0,0 @@ -/* - * Copyright (c) 2003 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * libavformat API example. - * - * Output a media file in any supported libavformat format. The default - * codecs are used. - * @example muxing.c - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define STREAM_DURATION 10.0 -#define STREAM_FRAME_RATE 25 /* 25 images/s */ -#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */ - -#define SCALE_FLAGS SWS_BICUBIC - -// a wrapper around a single output AVStream -typedef struct OutputStream { - AVStream *st; - AVCodecContext *enc; - - /* pts of the next frame that will be generated */ - int64_t next_pts; - int samples_count; - - AVFrame *frame; - AVFrame *tmp_frame; - - AVPacket *tmp_pkt; - - float t, tincr, tincr2; - - struct SwsContext *sws_ctx; - struct SwrContext *swr_ctx; -} OutputStream; - -static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt) -{ - AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base; - - printf("pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n", - av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base), - av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base), - pkt->stream_index); -} - -static int write_frame(AVFormatContext *fmt_ctx, AVCodecContext *c, - AVStream *st, AVFrame *frame, AVPacket *pkt) -{ - int ret; - - // send the frame to the encoder - ret = avcodec_send_frame(c, frame); - if (ret < 0) { - fprintf(stderr, "Error sending a frame to the encoder: %s\n", - av_err2str(ret)); - exit(1); - } - - while (ret >= 0) { - ret = avcodec_receive_packet(c, pkt); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - break; - else if (ret < 0) { - fprintf(stderr, "Error encoding a frame: %s\n", av_err2str(ret)); - exit(1); - } - - /* rescale output packet timestamp values from codec to stream timebase */ - av_packet_rescale_ts(pkt, c->time_base, st->time_base); - pkt->stream_index = st->index; - - /* Write the compressed frame to the media file. */ - log_packet(fmt_ctx, pkt); - ret = av_interleaved_write_frame(fmt_ctx, pkt); - /* pkt is now blank (av_interleaved_write_frame() takes ownership of - * its contents and resets pkt), so that no unreferencing is necessary. - * This would be different if one used av_write_frame(). */ - if (ret < 0) { - fprintf(stderr, "Error while writing output packet: %s\n", av_err2str(ret)); - exit(1); - } - } - - return ret == AVERROR_EOF ? 1 : 0; -} - -/* Add an output stream. */ -static void add_stream(OutputStream *ost, AVFormatContext *oc, - const AVCodec **codec, - enum AVCodecID codec_id) -{ - AVCodecContext *c; - int i; - - /* find the encoder */ - *codec = avcodec_find_encoder(codec_id); - if (!(*codec)) { - fprintf(stderr, "Could not find encoder for '%s'\n", - avcodec_get_name(codec_id)); - exit(1); - } - - ost->tmp_pkt = av_packet_alloc(); - if (!ost->tmp_pkt) { - fprintf(stderr, "Could not allocate AVPacket\n"); - exit(1); - } - - ost->st = avformat_new_stream(oc, NULL); - if (!ost->st) { - fprintf(stderr, "Could not allocate stream\n"); - exit(1); - } - ost->st->id = oc->nb_streams-1; - c = avcodec_alloc_context3(*codec); - if (!c) { - fprintf(stderr, "Could not alloc an encoding context\n"); - exit(1); - } - ost->enc = c; - - switch ((*codec)->type) { - case AVMEDIA_TYPE_AUDIO: - c->sample_fmt = (*codec)->sample_fmts ? - (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP; - c->bit_rate = 64000; - c->sample_rate = 44100; - if ((*codec)->supported_samplerates) { - c->sample_rate = (*codec)->supported_samplerates[0]; - for (i = 0; (*codec)->supported_samplerates[i]; i++) { - if ((*codec)->supported_samplerates[i] == 44100) - c->sample_rate = 44100; - } - } - av_channel_layout_copy(&c->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); - ost->st->time_base = (AVRational){ 1, c->sample_rate }; - break; - - case AVMEDIA_TYPE_VIDEO: - c->codec_id = codec_id; - - c->bit_rate = 400000; - /* Resolution must be a multiple of two. */ - c->width = 352; - c->height = 288; - /* timebase: This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identical to 1. */ - ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE }; - c->time_base = ost->st->time_base; - - c->gop_size = 12; /* emit one intra frame every twelve frames at most */ - c->pix_fmt = STREAM_PIX_FMT; - if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - /* just for testing, we also add B-frames */ - c->max_b_frames = 2; - } - if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { - /* Needed to avoid using macroblocks in which some coeffs overflow. - * This does not happen with normal video, it just happens here as - * the motion of the chroma plane does not match the luma plane. */ - c->mb_decision = 2; - } - break; - - default: - break; - } - - /* Some formats want stream headers to be separate. */ - if (oc->oformat->flags & AVFMT_GLOBALHEADER) - c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; -} - -/**************************************************************/ -/* audio output */ - -static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt, - const AVChannelLayout *channel_layout, - int sample_rate, int nb_samples) -{ - AVFrame *frame = av_frame_alloc(); - int ret; - - if (!frame) { - fprintf(stderr, "Error allocating an audio frame\n"); - exit(1); - } - - frame->format = sample_fmt; - av_channel_layout_copy(&frame->ch_layout, channel_layout); - frame->sample_rate = sample_rate; - frame->nb_samples = nb_samples; - - if (nb_samples) { - ret = av_frame_get_buffer(frame, 0); - if (ret < 0) { - fprintf(stderr, "Error allocating an audio buffer\n"); - exit(1); - } - } - - return frame; -} - -static void open_audio(AVFormatContext *oc, const AVCodec *codec, - OutputStream *ost, AVDictionary *opt_arg) -{ - AVCodecContext *c; - int nb_samples; - int ret; - AVDictionary *opt = NULL; - - c = ost->enc; - - /* open it */ - av_dict_copy(&opt, opt_arg, 0); - ret = avcodec_open2(c, codec, &opt); - av_dict_free(&opt); - if (ret < 0) { - fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret)); - exit(1); - } - - /* init signal generator */ - ost->t = 0; - ost->tincr = 2 * M_PI * 110.0 / c->sample_rate; - /* increment frequency by 110 Hz per second */ - ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate; - - if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) - nb_samples = 10000; - else - nb_samples = c->frame_size; - - ost->frame = alloc_audio_frame(c->sample_fmt, &c->ch_layout, - c->sample_rate, nb_samples); - ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, &c->ch_layout, - c->sample_rate, nb_samples); - - /* copy the stream parameters to the muxer */ - ret = avcodec_parameters_from_context(ost->st->codecpar, c); - if (ret < 0) { - fprintf(stderr, "Could not copy the stream parameters\n"); - exit(1); - } - - /* create resampler context */ - ost->swr_ctx = swr_alloc(); - if (!ost->swr_ctx) { - fprintf(stderr, "Could not allocate resampler context\n"); - exit(1); - } - - /* set options */ - av_opt_set_chlayout (ost->swr_ctx, "in_chlayout", &c->ch_layout, 0); - av_opt_set_int (ost->swr_ctx, "in_sample_rate", c->sample_rate, 0); - av_opt_set_sample_fmt(ost->swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0); - av_opt_set_chlayout (ost->swr_ctx, "out_chlayout", &c->ch_layout, 0); - av_opt_set_int (ost->swr_ctx, "out_sample_rate", c->sample_rate, 0); - av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0); - - /* initialize the resampling context */ - if ((ret = swr_init(ost->swr_ctx)) < 0) { - fprintf(stderr, "Failed to initialize the resampling context\n"); - exit(1); - } -} - -/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and - * 'nb_channels' channels. */ -static AVFrame *get_audio_frame(OutputStream *ost) -{ - AVFrame *frame = ost->tmp_frame; - int j, i, v; - int16_t *q = (int16_t*)frame->data[0]; - - /* check if we want to generate more frames */ - if (av_compare_ts(ost->next_pts, ost->enc->time_base, - STREAM_DURATION, (AVRational){ 1, 1 }) > 0) - return NULL; - - for (j = 0; j nb_samples; j++) { - v = (int)(sin(ost->t) * 10000); - for (i = 0; i < ost->enc->ch_layout.nb_channels; i++) - *q++ = v; - ost->t += ost->tincr; - ost->tincr += ost->tincr2; - } - - frame->pts = ost->next_pts; - ost->next_pts += frame->nb_samples; - - return frame; -} - -/* - * encode one audio frame and send it to the muxer - * return 1 when encoding is finished, 0 otherwise - */ -static int write_audio_frame(AVFormatContext *oc, OutputStream *ost) -{ - AVCodecContext *c; - AVFrame *frame; - int ret; - int dst_nb_samples; - - c = ost->enc; - - frame = get_audio_frame(ost); - - if (frame) { - /* convert samples from native format to destination codec format, using the resampler */ - /* compute destination number of samples */ - dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples, - c->sample_rate, c->sample_rate, AV_ROUND_UP); - av_assert0(dst_nb_samples == frame->nb_samples); - - /* when we pass a frame to the encoder, it may keep a reference to it - * internally; - * make sure we do not overwrite it here - */ - ret = av_frame_make_writable(ost->frame); - if (ret < 0) - exit(1); - - /* convert to destination format */ - ret = swr_convert(ost->swr_ctx, - ost->frame->data, dst_nb_samples, - (const uint8_t **)frame->data, frame->nb_samples); - if (ret < 0) { - fprintf(stderr, "Error while converting\n"); - exit(1); - } - frame = ost->frame; - - frame->pts = av_rescale_q(ost->samples_count, (AVRational){1, c->sample_rate}, c->time_base); - ost->samples_count += dst_nb_samples; - } - - return write_frame(oc, c, ost->st, frame, ost->tmp_pkt); -} - -/**************************************************************/ -/* video output */ - -static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height) -{ - AVFrame *picture; - int ret; - - picture = av_frame_alloc(); - if (!picture) - return NULL; - - picture->format = pix_fmt; - picture->width = width; - picture->height = height; - - /* allocate the buffers for the frame data */ - ret = av_frame_get_buffer(picture, 0); - if (ret < 0) { - fprintf(stderr, "Could not allocate frame data.\n"); - exit(1); - } - - return picture; -} - -static void open_video(AVFormatContext *oc, const AVCodec *codec, - OutputStream *ost, AVDictionary *opt_arg) -{ - int ret; - AVCodecContext *c = ost->enc; - AVDictionary *opt = NULL; - - av_dict_copy(&opt, opt_arg, 0); - - /* open the codec */ - ret = avcodec_open2(c, codec, &opt); - av_dict_free(&opt); - if (ret < 0) { - fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); - exit(1); - } - - /* allocate and init a re-usable frame */ - ost->frame = alloc_picture(c->pix_fmt, c->width, c->height); - if (!ost->frame) { - fprintf(stderr, "Could not allocate video frame\n"); - exit(1); - } - - /* If the output format is not YUV420P, then a temporary YUV420P - * picture is needed too. It is then converted to the required - * output format. */ - ost->tmp_frame = NULL; - if (c->pix_fmt != AV_PIX_FMT_YUV420P) { - ost->tmp_frame = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height); - if (!ost->tmp_frame) { - fprintf(stderr, "Could not allocate temporary picture\n"); - exit(1); - } - } - - /* copy the stream parameters to the muxer */ - ret = avcodec_parameters_from_context(ost->st->codecpar, c); - if (ret < 0) { - fprintf(stderr, "Could not copy the stream parameters\n"); - exit(1); - } -} - -/* Prepare a dummy image. */ -static void fill_yuv_image(AVFrame *pict, int frame_index, - int width, int height) -{ - int x, y, i; - - i = frame_index; - - /* Y */ - for (y = 0; y < height; y++) - for (x = 0; x < width; x++) - pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3; - - /* Cb and Cr */ - for (y = 0; y < height / 2; y++) { - for (x = 0; x < width / 2; x++) { - pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2; - pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5; - } - } -} - -static AVFrame *get_video_frame(OutputStream *ost) -{ - AVCodecContext *c = ost->enc; - - /* check if we want to generate more frames */ - if (av_compare_ts(ost->next_pts, c->time_base, - STREAM_DURATION, (AVRational){ 1, 1 }) > 0) - return NULL; - - /* when we pass a frame to the encoder, it may keep a reference to it - * internally; make sure we do not overwrite it here */ - if (av_frame_make_writable(ost->frame) < 0) - exit(1); - - if (c->pix_fmt != AV_PIX_FMT_YUV420P) { - /* as we only generate a YUV420P picture, we must convert it - * to the codec pixel format if needed */ - if (!ost->sws_ctx) { - ost->sws_ctx = sws_getContext(c->width, c->height, - AV_PIX_FMT_YUV420P, - c->width, c->height, - c->pix_fmt, - SCALE_FLAGS, NULL, NULL, NULL); - if (!ost->sws_ctx) { - fprintf(stderr, - "Could not initialize the conversion context\n"); - exit(1); - } - } - fill_yuv_image(ost->tmp_frame, ost->next_pts, c->width, c->height); - sws_scale(ost->sws_ctx, (const uint8_t * const *) ost->tmp_frame->data, - ost->tmp_frame->linesize, 0, c->height, ost->frame->data, - ost->frame->linesize); - } else { - fill_yuv_image(ost->frame, ost->next_pts, c->width, c->height); - } - - ost->frame->pts = ost->next_pts++; - - return ost->frame; -} - -/* - * encode one video frame and send it to the muxer - * return 1 when encoding is finished, 0 otherwise - */ -static int write_video_frame(AVFormatContext *oc, OutputStream *ost) -{ - return write_frame(oc, ost->enc, ost->st, get_video_frame(ost), ost->tmp_pkt); -} - -static void close_stream(AVFormatContext *oc, OutputStream *ost) -{ - avcodec_free_context(&ost->enc); - av_frame_free(&ost->frame); - av_frame_free(&ost->tmp_frame); - av_packet_free(&ost->tmp_pkt); - sws_freeContext(ost->sws_ctx); - swr_free(&ost->swr_ctx); -} - -/**************************************************************/ -/* media file output */ - -int main(int argc, char **argv) -{ - OutputStream video_st = { 0 }, audio_st = { 0 }; - const AVOutputFormat *fmt; - const char *filename; - AVFormatContext *oc; - const AVCodec *audio_codec, *video_codec; - int ret; - int have_video = 0, have_audio = 0; - int encode_video = 0, encode_audio = 0; - AVDictionary *opt = NULL; - int i; - - if (argc < 2) { - printf("usage: %s output_file\n" - "API example program to output a media file with libavformat.\n" - "This program generates a synthetic audio and video stream, encodes and\n" - "muxes them into a file named output_file.\n" - "The output format is automatically guessed according to the file extension.\n" - "Raw images can also be output by using '%%d' in the filename.\n" - "\n", argv[0]); - return 1; - } - - filename = argv[1]; - for (i = 2; i+1 < argc; i+=2) { - if (!strcmp(argv[i], "-flags") || !strcmp(argv[i], "-fflags")) - av_dict_set(&opt, argv[i]+1, argv[i+1], 0); - } - - /* allocate the output media context */ - avformat_alloc_output_context2(&oc, NULL, NULL, filename); - if (!oc) { - printf("Could not deduce output format from file extension: using MPEG.\n"); - avformat_alloc_output_context2(&oc, NULL, "mpeg", filename); - } - if (!oc) - return 1; - - fmt = oc->oformat; - - /* Add the audio and video streams using the default format codecs - * and initialize the codecs. */ - if (fmt->video_codec != AV_CODEC_ID_NONE) { - add_stream(&video_st, oc, &video_codec, fmt->video_codec); - have_video = 1; - encode_video = 1; - } - if (fmt->audio_codec != AV_CODEC_ID_NONE) { - add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec); - have_audio = 1; - encode_audio = 1; - } - - /* Now that all the parameters are set, we can open the audio and - * video codecs and allocate the necessary encode buffers. */ - if (have_video) - open_video(oc, video_codec, &video_st, opt); - - if (have_audio) - open_audio(oc, audio_codec, &audio_st, opt); - - av_dump_format(oc, 0, filename, 1); - - /* open the output file, if needed */ - if (!(fmt->flags & AVFMT_NOFILE)) { - ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE); - if (ret < 0) { - fprintf(stderr, "Could not open '%s': %s\n", filename, - av_err2str(ret)); - return 1; - } - } - - /* Write the stream header, if any. */ - ret = avformat_write_header(oc, &opt); - if (ret < 0) { - fprintf(stderr, "Error occurred when opening output file: %s\n", - av_err2str(ret)); - return 1; - } - - while (encode_video || encode_audio) { - /* select the stream to encode */ - if (encode_video && - (!encode_audio || av_compare_ts(video_st.next_pts, video_st.enc->time_base, - audio_st.next_pts, audio_st.enc->time_base) <= 0)) { - encode_video = !write_video_frame(oc, &video_st); - } else { - encode_audio = !write_audio_frame(oc, &audio_st); - } - } - - av_write_trailer(oc); - - /* Close each codec. */ - if (have_video) - close_stream(oc, &video_st); - if (have_audio) - close_stream(oc, &audio_st); - - if (!(fmt->flags & AVFMT_NOFILE)) - /* Close the output file. */ - avio_closep(&oc->pb); - - /* free the stream */ - avformat_free_context(oc); - - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsvdec.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2015 Anton Khirnov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * Intel QSV-accelerated H.264 decoding example. - * - * @example qsvdec.c - * This example shows how to do QSV-accelerated H.264 decoding with output - * frames in the GPU video surfaces. - */ - -#include "config.h" - -#include - -#include "libavformat/avformat.h" -#include "libavformat/avio.h" - -#include "libavcodec/avcodec.h" - -#include "libavutil/buffer.h" -#include "libavutil/error.h" -#include "libavutil/hwcontext.h" -#include "libavutil/hwcontext_qsv.h" -#include "libavutil/mem.h" - -static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts) -{ - while (*pix_fmts != AV_PIX_FMT_NONE) { - if (*pix_fmts == AV_PIX_FMT_QSV) { - return AV_PIX_FMT_QSV; - } - - pix_fmts++; - } - - fprintf(stderr, "The QSV pixel format not offered in get_format()\n"); - - return AV_PIX_FMT_NONE; -} - -static int decode_packet(AVCodecContext *decoder_ctx, - AVFrame *frame, AVFrame *sw_frame, - AVPacket *pkt, AVIOContext *output_ctx) -{ - int ret = 0; - - ret = avcodec_send_packet(decoder_ctx, pkt); - if (ret < 0) { - fprintf(stderr, "Error during decoding\n"); - return ret; - } - - while (ret >= 0) { - int i, j; - - ret = avcodec_receive_frame(decoder_ctx, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - break; - else if (ret < 0) { - fprintf(stderr, "Error during decoding\n"); - return ret; - } - - /* A real program would do something useful with the decoded frame here. - * We just retrieve the raw data and write it to a file, which is rather - * useless but pedagogic. */ - ret = av_hwframe_transfer_data(sw_frame, frame, 0); - if (ret < 0) { - fprintf(stderr, "Error transferring the data to system memory\n"); - goto fail; - } - - for (i = 0; i < FF_ARRAY_ELEMS(sw_frame->data) && sw_frame->data[i]; i++) - for (j = 0; j < (sw_frame->height >> (i > 0)); j++) - avio_write(output_ctx, sw_frame->data[i] + j * sw_frame->linesize[i], sw_frame->width); - -fail: - av_frame_unref(sw_frame); - av_frame_unref(frame); - - if (ret < 0) - return ret; - } - - return 0; -} - -int main(int argc, char **argv) -{ - AVFormatContext *input_ctx = NULL; - AVStream *video_st = NULL; - AVCodecContext *decoder_ctx = NULL; - const AVCodec *decoder; - - AVPacket *pkt = NULL; - AVFrame *frame = NULL, *sw_frame = NULL; - - AVIOContext *output_ctx = NULL; - - int ret, i; - - AVBufferRef *device_ref = NULL; - - if (argc < 3) { - fprintf(stderr, "Usage: %s \n", argv[0]); - return 1; - } - - /* open the input file */ - ret = avformat_open_input(&input_ctx, argv[1], NULL, NULL); - if (ret < 0) { - fprintf(stderr, "Cannot open input file '%s': ", argv[1]); - goto finish; - } - - /* find the first H.264 video stream */ - for (i = 0; i < input_ctx->nb_streams; i++) { - AVStream *st = input_ctx->streams[i]; - - if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !video_st) - video_st = st; - else - st->discard = AVDISCARD_ALL; - } - if (!video_st) { - fprintf(stderr, "No H.264 video stream in the input file\n"); - goto finish; - } - - /* open the hardware device */ - ret = av_hwdevice_ctx_create(&device_ref, AV_HWDEVICE_TYPE_QSV, - "auto", NULL, 0); - if (ret < 0) { - fprintf(stderr, "Cannot open the hardware device\n"); - goto finish; - } - - /* initialize the decoder */ - decoder = avcodec_find_decoder_by_name("h264_qsv"); - if (!decoder) { - fprintf(stderr, "The QSV decoder is not present in libavcodec\n"); - goto finish; - } - - decoder_ctx = avcodec_alloc_context3(decoder); - if (!decoder_ctx) { - ret = AVERROR(ENOMEM); - goto finish; - } - decoder_ctx->codec_id = AV_CODEC_ID_H264; - if (video_st->codecpar->extradata_size) { - decoder_ctx->extradata = av_mallocz(video_st->codecpar->extradata_size + - AV_INPUT_BUFFER_PADDING_SIZE); - if (!decoder_ctx->extradata) { - ret = AVERROR(ENOMEM); - goto finish; - } - memcpy(decoder_ctx->extradata, video_st->codecpar->extradata, - video_st->codecpar->extradata_size); - decoder_ctx->extradata_size = video_st->codecpar->extradata_size; - } - - - decoder_ctx->hw_device_ctx = av_buffer_ref(device_ref); - decoder_ctx->get_format = get_format; - - ret = avcodec_open2(decoder_ctx, NULL, NULL); - if (ret < 0) { - fprintf(stderr, "Error opening the decoder: "); - goto finish; - } - - /* open the output stream */ - ret = avio_open(&output_ctx, argv[2], AVIO_FLAG_WRITE); - if (ret < 0) { - fprintf(stderr, "Error opening the output context: "); - goto finish; - } - - frame = av_frame_alloc(); - sw_frame = av_frame_alloc(); - pkt = av_packet_alloc(); - if (!frame || !sw_frame || !pkt) { - ret = AVERROR(ENOMEM); - goto finish; - } - - /* actual decoding */ - while (ret >= 0) { - ret = av_read_frame(input_ctx, pkt); - if (ret < 0) - break; - - if (pkt->stream_index == video_st->index) - ret = decode_packet(decoder_ctx, frame, sw_frame, pkt, output_ctx); - - av_packet_unref(pkt); - } - - /* flush the decoder */ - ret = decode_packet(decoder_ctx, frame, sw_frame, NULL, output_ctx); - -finish: - if (ret < 0) { - char buf[1024]; - av_strerror(ret, buf, sizeof(buf)); - fprintf(stderr, "%s\n", buf); - } - - avformat_close_input(&input_ctx); - - av_frame_free(&frame); - av_frame_free(&sw_frame); - av_packet_free(&pkt); - - avcodec_free_context(&decoder_ctx); - - av_buffer_unref(&device_ref); - - avio_close(output_ctx); - - return ret; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_decode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_decode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_decode.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_decode.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2015 Anton Khirnov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file Intel QSV-accelerated H.264 decoding API usage example + * @example qsv_decode.c + * + * Perform QSV-accelerated H.264 decoding with output frames in the + * GPU video surfaces, write the decoded frames to an output file. + */ + +#include "config.h" + +#include + +#include "libavformat/avformat.h" +#include "libavformat/avio.h" + +#include "libavcodec/avcodec.h" + +#include "libavutil/buffer.h" +#include "libavutil/error.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_qsv.h" +#include "libavutil/mem.h" + +static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts) +{ + while (*pix_fmts != AV_PIX_FMT_NONE) { + if (*pix_fmts == AV_PIX_FMT_QSV) { + return AV_PIX_FMT_QSV; + } + + pix_fmts++; + } + + fprintf(stderr, "The QSV pixel format not offered in get_format()\n"); + + return AV_PIX_FMT_NONE; +} + +static int decode_packet(AVCodecContext *decoder_ctx, + AVFrame *frame, AVFrame *sw_frame, + AVPacket *pkt, AVIOContext *output_ctx) +{ + int ret = 0; + + ret = avcodec_send_packet(decoder_ctx, pkt); + if (ret < 0) { + fprintf(stderr, "Error during decoding\n"); + return ret; + } + + while (ret >= 0) { + int i, j; + + ret = avcodec_receive_frame(decoder_ctx, frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + break; + else if (ret < 0) { + fprintf(stderr, "Error during decoding\n"); + return ret; + } + + /* A real program would do something useful with the decoded frame here. + * We just retrieve the raw data and write it to a file, which is rather + * useless but pedagogic. */ + ret = av_hwframe_transfer_data(sw_frame, frame, 0); + if (ret < 0) { + fprintf(stderr, "Error transferring the data to system memory\n"); + goto fail; + } + + for (i = 0; i < FF_ARRAY_ELEMS(sw_frame->data) && sw_frame->data[i]; i++) + for (j = 0; j < (sw_frame->height >> (i > 0)); j++) + avio_write(output_ctx, sw_frame->data[i] + j * sw_frame->linesize[i], sw_frame->width); + +fail: + av_frame_unref(sw_frame); + av_frame_unref(frame); + + if (ret < 0) + return ret; + } + + return 0; +} + +int main(int argc, char **argv) +{ + AVFormatContext *input_ctx = NULL; + AVStream *video_st = NULL; + AVCodecContext *decoder_ctx = NULL; + const AVCodec *decoder; + + AVPacket *pkt = NULL; + AVFrame *frame = NULL, *sw_frame = NULL; + + AVIOContext *output_ctx = NULL; + + int ret, i; + + AVBufferRef *device_ref = NULL; + + if (argc < 3) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + + /* open the input file */ + ret = avformat_open_input(&input_ctx, argv[1], NULL, NULL); + if (ret < 0) { + fprintf(stderr, "Cannot open input file '%s': ", argv[1]); + goto finish; + } + + /* find the first H.264 video stream */ + for (i = 0; i < input_ctx->nb_streams; i++) { + AVStream *st = input_ctx->streams[i]; + + if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !video_st) + video_st = st; + else + st->discard = AVDISCARD_ALL; + } + if (!video_st) { + fprintf(stderr, "No H.264 video stream in the input file\n"); + goto finish; + } + + /* open the hardware device */ + ret = av_hwdevice_ctx_create(&device_ref, AV_HWDEVICE_TYPE_QSV, + "auto", NULL, 0); + if (ret < 0) { + fprintf(stderr, "Cannot open the hardware device\n"); + goto finish; + } + + /* initialize the decoder */ + decoder = avcodec_find_decoder_by_name("h264_qsv"); + if (!decoder) { + fprintf(stderr, "The QSV decoder is not present in libavcodec\n"); + goto finish; + } + + decoder_ctx = avcodec_alloc_context3(decoder); + if (!decoder_ctx) { + ret = AVERROR(ENOMEM); + goto finish; + } + decoder_ctx->codec_id = AV_CODEC_ID_H264; + if (video_st->codecpar->extradata_size) { + decoder_ctx->extradata = av_mallocz(video_st->codecpar->extradata_size + + AV_INPUT_BUFFER_PADDING_SIZE); + if (!decoder_ctx->extradata) { + ret = AVERROR(ENOMEM); + goto finish; + } + memcpy(decoder_ctx->extradata, video_st->codecpar->extradata, + video_st->codecpar->extradata_size); + decoder_ctx->extradata_size = video_st->codecpar->extradata_size; + } + + + decoder_ctx->hw_device_ctx = av_buffer_ref(device_ref); + decoder_ctx->get_format = get_format; + + ret = avcodec_open2(decoder_ctx, NULL, NULL); + if (ret < 0) { + fprintf(stderr, "Error opening the decoder: "); + goto finish; + } + + /* open the output stream */ + ret = avio_open(&output_ctx, argv[2], AVIO_FLAG_WRITE); + if (ret < 0) { + fprintf(stderr, "Error opening the output context: "); + goto finish; + } + + frame = av_frame_alloc(); + sw_frame = av_frame_alloc(); + pkt = av_packet_alloc(); + if (!frame || !sw_frame || !pkt) { + ret = AVERROR(ENOMEM); + goto finish; + } + + /* actual decoding */ + while (ret >= 0) { + ret = av_read_frame(input_ctx, pkt); + if (ret < 0) + break; + + if (pkt->stream_index == video_st->index) + ret = decode_packet(decoder_ctx, frame, sw_frame, pkt, output_ctx); + + av_packet_unref(pkt); + } + + /* flush the decoder */ + ret = decode_packet(decoder_ctx, frame, sw_frame, NULL, output_ctx); + +finish: + if (ret < 0) { + char buf[1024]; + av_strerror(ret, buf, sizeof(buf)); + fprintf(stderr, "%s\n", buf); + } + + avformat_close_input(&input_ctx); + + av_frame_free(&frame); + av_frame_free(&sw_frame); + av_packet_free(&pkt); + + avcodec_free_context(&decoder_ctx); + + av_buffer_unref(&device_ref); + + avio_close(output_ctx); + + return ret; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_transcode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_transcode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_transcode.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/qsv_transcode.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,438 @@ +/* + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file Intel QSV-accelerated video transcoding API usage example + * @example qsv_transcode.c + * + * Perform QSV-accelerated transcoding and show to dynamically change + * encoder's options. + * + * Usage: qsv_transcode input_stream codec output_stream initial option + * { frame_number new_option } + * e.g: - qsv_transcode input.mp4 h264_qsv output_h264.mp4 "g 60" + * - qsv_transcode input.mp4 hevc_qsv output_hevc.mp4 "g 60 async_depth 1" + * 100 "g 120" + * (initialize codec with gop_size 60 and change it to 120 after 100 + * frames) + */ + +#include +#include + +#include +#include +#include +#include + +static AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL; +static AVBufferRef *hw_device_ctx = NULL; +static AVCodecContext *decoder_ctx = NULL, *encoder_ctx = NULL; +static int video_stream = -1; + +typedef struct DynamicSetting { + int frame_number; + char* optstr; +} DynamicSetting; +static DynamicSetting *dynamic_setting; +static int setting_number; +static int current_setting_number; + +static int str_to_dict(char* optstr, AVDictionary **opt) +{ + char *key, *value; + if (strlen(optstr) == 0) + return 0; + key = strtok(optstr, " "); + if (key == NULL) + return AVERROR(ENAVAIL); + value = strtok(NULL, " "); + if (value == NULL) + return AVERROR(ENAVAIL); + av_dict_set(opt, key, value, 0); + do { + key = strtok(NULL, " "); + if (key == NULL) + return 0; + value = strtok(NULL, " "); + if (value == NULL) + return AVERROR(ENAVAIL); + av_dict_set(opt, key, value, 0); + } while(key != NULL); + return 0; +} + +static int dynamic_set_parameter(AVCodecContext *avctx) +{ + AVDictionary *opts = NULL; + int ret = 0; + static int frame_number = 0; + frame_number++; + if (current_setting_number < setting_number && + frame_number == dynamic_setting[current_setting_number].frame_number) { + AVDictionaryEntry *e = NULL; + ret = str_to_dict(dynamic_setting[current_setting_number].optstr, &opts); + if (ret < 0) { + fprintf(stderr, "The dynamic parameter is wrong\n"); + goto fail; + } + /* Set common option. The dictionary will be freed and replaced + * by a new one containing all options not found in common option list. + * Then this new dictionary is used to set private option. */ + if ((ret = av_opt_set_dict(avctx, &opts)) < 0) + goto fail; + /* Set codec specific option */ + if ((ret = av_opt_set_dict(avctx->priv_data, &opts)) < 0) + goto fail; + /* There is no "framerate" option in commom option list. Use "-r" to set + * framerate, which is compatible with ffmpeg commandline. The video is + * assumed to be average frame rate, so set time_base to 1/framerate. */ + e = av_dict_get(opts, "r", NULL, 0); + if (e) { + avctx->framerate = av_d2q(atof(e->value), INT_MAX); + encoder_ctx->time_base = av_inv_q(encoder_ctx->framerate); + } + } +fail: + av_dict_free(&opts); + return ret; +} + +static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts) +{ + while (*pix_fmts != AV_PIX_FMT_NONE) { + if (*pix_fmts == AV_PIX_FMT_QSV) { + return AV_PIX_FMT_QSV; + } + + pix_fmts++; + } + + fprintf(stderr, "The QSV pixel format not offered in get_format()\n"); + + return AV_PIX_FMT_NONE; +} + +static int open_input_file(char *filename) +{ + int ret; + const AVCodec *decoder = NULL; + AVStream *video = NULL; + + if ((ret = avformat_open_input(&ifmt_ctx, filename, NULL, NULL)) < 0) { + fprintf(stderr, "Cannot open input file '%s', Error code: %s\n", + filename, av_err2str(ret)); + return ret; + } + + if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) { + fprintf(stderr, "Cannot find input stream information. Error code: %s\n", + av_err2str(ret)); + return ret; + } + + ret = av_find_best_stream(ifmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0); + if (ret < 0) { + fprintf(stderr, "Cannot find a video stream in the input file. " + "Error code: %s\n", av_err2str(ret)); + return ret; + } + video_stream = ret; + video = ifmt_ctx->streams[video_stream]; + + switch(video->codecpar->codec_id) { + case AV_CODEC_ID_H264: + decoder = avcodec_find_decoder_by_name("h264_qsv"); + break; + case AV_CODEC_ID_HEVC: + decoder = avcodec_find_decoder_by_name("hevc_qsv"); + break; + case AV_CODEC_ID_VP9: + decoder = avcodec_find_decoder_by_name("vp9_qsv"); + break; + case AV_CODEC_ID_VP8: + decoder = avcodec_find_decoder_by_name("vp8_qsv"); + break; + case AV_CODEC_ID_AV1: + decoder = avcodec_find_decoder_by_name("av1_qsv"); + break; + case AV_CODEC_ID_MPEG2VIDEO: + decoder = avcodec_find_decoder_by_name("mpeg2_qsv"); + break; + case AV_CODEC_ID_MJPEG: + decoder = avcodec_find_decoder_by_name("mjpeg_qsv"); + break; + default: + fprintf(stderr, "Codec is not supportted by qsv\n"); + return AVERROR(ENAVAIL); + } + + if (!(decoder_ctx = avcodec_alloc_context3(decoder))) + return AVERROR(ENOMEM); + + if ((ret = avcodec_parameters_to_context(decoder_ctx, video->codecpar)) < 0) { + fprintf(stderr, "avcodec_parameters_to_context error. Error code: %s\n", + av_err2str(ret)); + return ret; + } + decoder_ctx->framerate = av_guess_frame_rate(ifmt_ctx, video, NULL); + + decoder_ctx->hw_device_ctx = av_buffer_ref(hw_device_ctx); + if (!decoder_ctx->hw_device_ctx) { + fprintf(stderr, "A hardware device reference create failed.\n"); + return AVERROR(ENOMEM); + } + decoder_ctx->get_format = get_format; + decoder_ctx->pkt_timebase = video->time_base; + if ((ret = avcodec_open2(decoder_ctx, decoder, NULL)) < 0) + fprintf(stderr, "Failed to open codec for decoding. Error code: %s\n", + av_err2str(ret)); + + return ret; +} + +static int encode_write(AVPacket *enc_pkt, AVFrame *frame) +{ + int ret = 0; + + av_packet_unref(enc_pkt); + + if((ret = dynamic_set_parameter(encoder_ctx)) < 0) { + fprintf(stderr, "Failed to set dynamic parameter. Error code: %s\n", + av_err2str(ret)); + goto end; + } + + if ((ret = avcodec_send_frame(encoder_ctx, frame)) < 0) { + fprintf(stderr, "Error during encoding. Error code: %s\n", av_err2str(ret)); + goto end; + } + while (1) { + if (ret = avcodec_receive_packet(encoder_ctx, enc_pkt)) + break; + enc_pkt->stream_index = 0; + av_packet_rescale_ts(enc_pkt, encoder_ctx->time_base, + ofmt_ctx->streams[0]->time_base); + if ((ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt)) < 0) { + fprintf(stderr, "Error during writing data to output file. " + "Error code: %s\n", av_err2str(ret)); + return ret; + } + } + +end: + if (ret == AVERROR_EOF) + return 0; + ret = ((ret == AVERROR(EAGAIN)) ? 0:-1); + return ret; +} + +static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr) +{ + AVFrame *frame; + int ret = 0; + + ret = avcodec_send_packet(decoder_ctx, pkt); + if (ret < 0) { + fprintf(stderr, "Error during decoding. Error code: %s\n", av_err2str(ret)); + return ret; + } + + while (ret >= 0) { + if (!(frame = av_frame_alloc())) + return AVERROR(ENOMEM); + + ret = avcodec_receive_frame(decoder_ctx, frame); + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { + av_frame_free(&frame); + return 0; + } else if (ret < 0) { + fprintf(stderr, "Error while decoding. Error code: %s\n", av_err2str(ret)); + goto fail; + } + if (!encoder_ctx->hw_frames_ctx) { + AVDictionaryEntry *e = NULL; + AVDictionary *opts = NULL; + AVStream *ost; + /* we need to ref hw_frames_ctx of decoder to initialize encoder's codec. + Only after we get a decoded frame, can we obtain its hw_frames_ctx */ + encoder_ctx->hw_frames_ctx = av_buffer_ref(decoder_ctx->hw_frames_ctx); + if (!encoder_ctx->hw_frames_ctx) { + ret = AVERROR(ENOMEM); + goto fail; + } + /* set AVCodecContext Parameters for encoder, here we keep them stay + * the same as decoder. + */ + encoder_ctx->time_base = av_inv_q(decoder_ctx->framerate); + encoder_ctx->pix_fmt = AV_PIX_FMT_QSV; + encoder_ctx->width = decoder_ctx->width; + encoder_ctx->height = decoder_ctx->height; + if ((ret = str_to_dict(optstr, &opts)) < 0) { + fprintf(stderr, "Failed to set encoding parameter.\n"); + goto fail; + } + /* There is no "framerate" option in commom option list. Use "-r" to + * set framerate, which is compatible with ffmpeg commandline. The + * video is assumed to be average frame rate, so set time_base to + * 1/framerate. */ + e = av_dict_get(opts, "r", NULL, 0); + if (e) { + encoder_ctx->framerate = av_d2q(atof(e->value), INT_MAX); + encoder_ctx->time_base = av_inv_q(encoder_ctx->framerate); + } + if ((ret = avcodec_open2(encoder_ctx, enc_codec, &opts)) < 0) { + fprintf(stderr, "Failed to open encode codec. Error code: %s\n", + av_err2str(ret)); + av_dict_free(&opts); + goto fail; + } + av_dict_free(&opts); + + if (!(ost = avformat_new_stream(ofmt_ctx, enc_codec))) { + fprintf(stderr, "Failed to allocate stream for output format.\n"); + ret = AVERROR(ENOMEM); + goto fail; + } + + ost->time_base = encoder_ctx->time_base; + ret = avcodec_parameters_from_context(ost->codecpar, encoder_ctx); + if (ret < 0) { + fprintf(stderr, "Failed to copy the stream parameters. " + "Error code: %s\n", av_err2str(ret)); + goto fail; + } + + /* write the stream header */ + if ((ret = avformat_write_header(ofmt_ctx, NULL)) < 0) { + fprintf(stderr, "Error while writing stream header. " + "Error code: %s\n", av_err2str(ret)); + goto fail; + } + } + frame->pts = av_rescale_q(frame->pts, decoder_ctx->pkt_timebase, + encoder_ctx->time_base); + if ((ret = encode_write(pkt, frame)) < 0) + fprintf(stderr, "Error during encoding and writing.\n"); + +fail: + av_frame_free(&frame); + if (ret < 0) + return ret; + } + return 0; +} + +int main(int argc, char **argv) +{ + const AVCodec *enc_codec; + int ret = 0; + AVPacket *dec_pkt; + + if (argc < 5 || (argc - 5) % 2) { + av_log(NULL, AV_LOG_ERROR, "Usage: %s " + " <\"encoding option set 0\"> [ <\"encoding options set 1\">]...\n", argv[0]); + return 1; + } + setting_number = (argc - 5) / 2; + dynamic_setting = av_malloc(setting_number * sizeof(*dynamic_setting)); + current_setting_number = 0; + for (int i = 0; i < setting_number; i++) { + dynamic_setting[i].frame_number = atoi(argv[i*2 + 5]); + dynamic_setting[i].optstr = argv[i*2 + 6]; + } + + ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_QSV, NULL, NULL, 0); + if (ret < 0) { + fprintf(stderr, "Failed to create a QSV device. Error code: %s\n", av_err2str(ret)); + goto end; + } + + dec_pkt = av_packet_alloc(); + if (!dec_pkt) { + fprintf(stderr, "Failed to allocate decode packet\n"); + goto end; + } + + if ((ret = open_input_file(argv[1])) < 0) + goto end; + + if (!(enc_codec = avcodec_find_encoder_by_name(argv[2]))) { + fprintf(stderr, "Could not find encoder '%s'\n", argv[2]); + ret = -1; + goto end; + } + + if ((ret = (avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, argv[3]))) < 0) { + fprintf(stderr, "Failed to deduce output format from file extension. Error code: " + "%s\n", av_err2str(ret)); + goto end; + } + + if (!(encoder_ctx = avcodec_alloc_context3(enc_codec))) { + ret = AVERROR(ENOMEM); + goto end; + } + + ret = avio_open(&ofmt_ctx->pb, argv[3], AVIO_FLAG_WRITE); + if (ret < 0) { + fprintf(stderr, "Cannot open output file. " + "Error code: %s\n", av_err2str(ret)); + goto end; + } + + /* read all packets and only transcoding video */ + while (ret >= 0) { + if ((ret = av_read_frame(ifmt_ctx, dec_pkt)) < 0) + break; + + if (video_stream == dec_pkt->stream_index) + ret = dec_enc(dec_pkt, enc_codec, argv[4]); + + av_packet_unref(dec_pkt); + } + + /* flush decoder */ + av_packet_unref(dec_pkt); + if ((ret = dec_enc(dec_pkt, enc_codec, argv[4])) < 0) { + fprintf(stderr, "Failed to flush decoder %s\n", av_err2str(ret)); + goto end; + } + + /* flush encoder */ + if ((ret = encode_write(dec_pkt, NULL)) < 0) { + fprintf(stderr, "Failed to flush encoder %s\n", av_err2str(ret)); + goto end; + } + + /* write the trailer for output stream */ + if ((ret = av_write_trailer(ofmt_ctx)) < 0) + fprintf(stderr, "Failed to write trailer %s\n", av_err2str(ret)); + +end: + avformat_close_input(&ifmt_ctx); + avformat_close_input(&ofmt_ctx); + avcodec_free_context(&decoder_ctx); + avcodec_free_context(&encoder_ctx); + av_buffer_unref(&hw_device_ctx); + av_packet_free(&dec_pkt); + av_freep(&dynamic_setting); + return ret; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/README mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/README --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/README 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/README 2023-03-03 13:29:59.000000000 +0000 @@ -7,8 +7,10 @@ Method 1: build the installed examples in a generic read/write user directory -Copy to a read/write user directory and just use "make", it will link -to the libraries on your system, assuming the PKG_CONFIG_PATH is +Copy to a read/write user directory and run: +make -f Makefile.example + +It will link to the libraries on your system, assuming the PKG_CONFIG_PATH is correctly configured. Method 2: build the examples in-tree @@ -20,4 +22,4 @@ If you want to try the dedicated Makefile examples (to emulate the first method), go into doc/examples and run a command such as -PKG_CONFIG_PATH=pc-uninstalled make. +PKG_CONFIG_PATH=pc-uninstalled make -f Makefile.example diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remux.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remux.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2013 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat/libavcodec demuxing and muxing API usage example + * @example remux.c + * + * Remux streams from one container format to another. Data is copied from the + * input to the output without transcoding. + */ + +#include +#include + +static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag) +{ + AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base; + + printf("%s: pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n", + tag, + av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base), + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base), + pkt->stream_index); +} + +int main(int argc, char **argv) +{ + const AVOutputFormat *ofmt = NULL; + AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL; + AVPacket *pkt = NULL; + const char *in_filename, *out_filename; + int ret, i; + int stream_index = 0; + int *stream_mapping = NULL; + int stream_mapping_size = 0; + + if (argc < 3) { + printf("usage: %s input output\n" + "API example program to remux a media file with libavformat and libavcodec.\n" + "The output format is guessed according to the file extension.\n" + "\n", argv[0]); + return 1; + } + + in_filename = argv[1]; + out_filename = argv[2]; + + pkt = av_packet_alloc(); + if (!pkt) { + fprintf(stderr, "Could not allocate AVPacket\n"); + return 1; + } + + if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) { + fprintf(stderr, "Could not open input file '%s'", in_filename); + goto end; + } + + if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) { + fprintf(stderr, "Failed to retrieve input stream information"); + goto end; + } + + av_dump_format(ifmt_ctx, 0, in_filename, 0); + + avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename); + if (!ofmt_ctx) { + fprintf(stderr, "Could not create output context\n"); + ret = AVERROR_UNKNOWN; + goto end; + } + + stream_mapping_size = ifmt_ctx->nb_streams; + stream_mapping = av_calloc(stream_mapping_size, sizeof(*stream_mapping)); + if (!stream_mapping) { + ret = AVERROR(ENOMEM); + goto end; + } + + ofmt = ofmt_ctx->oformat; + + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + AVStream *out_stream; + AVStream *in_stream = ifmt_ctx->streams[i]; + AVCodecParameters *in_codecpar = in_stream->codecpar; + + if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO && + in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO && + in_codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) { + stream_mapping[i] = -1; + continue; + } + + stream_mapping[i] = stream_index++; + + out_stream = avformat_new_stream(ofmt_ctx, NULL); + if (!out_stream) { + fprintf(stderr, "Failed allocating output stream\n"); + ret = AVERROR_UNKNOWN; + goto end; + } + + ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar); + if (ret < 0) { + fprintf(stderr, "Failed to copy codec parameters\n"); + goto end; + } + out_stream->codecpar->codec_tag = 0; + } + av_dump_format(ofmt_ctx, 0, out_filename, 1); + + if (!(ofmt->flags & AVFMT_NOFILE)) { + ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE); + if (ret < 0) { + fprintf(stderr, "Could not open output file '%s'", out_filename); + goto end; + } + } + + ret = avformat_write_header(ofmt_ctx, NULL); + if (ret < 0) { + fprintf(stderr, "Error occurred when opening output file\n"); + goto end; + } + + while (1) { + AVStream *in_stream, *out_stream; + + ret = av_read_frame(ifmt_ctx, pkt); + if (ret < 0) + break; + + in_stream = ifmt_ctx->streams[pkt->stream_index]; + if (pkt->stream_index >= stream_mapping_size || + stream_mapping[pkt->stream_index] < 0) { + av_packet_unref(pkt); + continue; + } + + pkt->stream_index = stream_mapping[pkt->stream_index]; + out_stream = ofmt_ctx->streams[pkt->stream_index]; + log_packet(ifmt_ctx, pkt, "in"); + + /* copy packet */ + av_packet_rescale_ts(pkt, in_stream->time_base, out_stream->time_base); + pkt->pos = -1; + log_packet(ofmt_ctx, pkt, "out"); + + ret = av_interleaved_write_frame(ofmt_ctx, pkt); + /* pkt is now blank (av_interleaved_write_frame() takes ownership of + * its contents and resets pkt), so that no unreferencing is necessary. + * This would be different if one used av_write_frame(). */ + if (ret < 0) { + fprintf(stderr, "Error muxing packet\n"); + break; + } + } + + av_write_trailer(ofmt_ctx); +end: + av_packet_free(&pkt); + + avformat_close_input(&ifmt_ctx); + + /* close output */ + if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE)) + avio_closep(&ofmt_ctx->pb); + avformat_free_context(ofmt_ctx); + + av_freep(&stream_mapping); + + if (ret < 0 && ret != AVERROR_EOF) { + fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); + return 1; + } + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remuxing.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remuxing.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remuxing.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/remuxing.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2013 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * libavformat/libavcodec demuxing and muxing API example. - * - * Remux streams from one container format to another. - * @example remuxing.c - */ - -#include -#include - -static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag) -{ - AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base; - - printf("%s: pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n", - tag, - av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base), - av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base), - pkt->stream_index); -} - -int main(int argc, char **argv) -{ - const AVOutputFormat *ofmt = NULL; - AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL; - AVPacket *pkt = NULL; - const char *in_filename, *out_filename; - int ret, i; - int stream_index = 0; - int *stream_mapping = NULL; - int stream_mapping_size = 0; - - if (argc < 3) { - printf("usage: %s input output\n" - "API example program to remux a media file with libavformat and libavcodec.\n" - "The output format is guessed according to the file extension.\n" - "\n", argv[0]); - return 1; - } - - in_filename = argv[1]; - out_filename = argv[2]; - - pkt = av_packet_alloc(); - if (!pkt) { - fprintf(stderr, "Could not allocate AVPacket\n"); - return 1; - } - - if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) { - fprintf(stderr, "Could not open input file '%s'", in_filename); - goto end; - } - - if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) { - fprintf(stderr, "Failed to retrieve input stream information"); - goto end; - } - - av_dump_format(ifmt_ctx, 0, in_filename, 0); - - avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename); - if (!ofmt_ctx) { - fprintf(stderr, "Could not create output context\n"); - ret = AVERROR_UNKNOWN; - goto end; - } - - stream_mapping_size = ifmt_ctx->nb_streams; - stream_mapping = av_calloc(stream_mapping_size, sizeof(*stream_mapping)); - if (!stream_mapping) { - ret = AVERROR(ENOMEM); - goto end; - } - - ofmt = ofmt_ctx->oformat; - - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - AVStream *out_stream; - AVStream *in_stream = ifmt_ctx->streams[i]; - AVCodecParameters *in_codecpar = in_stream->codecpar; - - if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO && - in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO && - in_codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) { - stream_mapping[i] = -1; - continue; - } - - stream_mapping[i] = stream_index++; - - out_stream = avformat_new_stream(ofmt_ctx, NULL); - if (!out_stream) { - fprintf(stderr, "Failed allocating output stream\n"); - ret = AVERROR_UNKNOWN; - goto end; - } - - ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar); - if (ret < 0) { - fprintf(stderr, "Failed to copy codec parameters\n"); - goto end; - } - out_stream->codecpar->codec_tag = 0; - } - av_dump_format(ofmt_ctx, 0, out_filename, 1); - - if (!(ofmt->flags & AVFMT_NOFILE)) { - ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE); - if (ret < 0) { - fprintf(stderr, "Could not open output file '%s'", out_filename); - goto end; - } - } - - ret = avformat_write_header(ofmt_ctx, NULL); - if (ret < 0) { - fprintf(stderr, "Error occurred when opening output file\n"); - goto end; - } - - while (1) { - AVStream *in_stream, *out_stream; - - ret = av_read_frame(ifmt_ctx, pkt); - if (ret < 0) - break; - - in_stream = ifmt_ctx->streams[pkt->stream_index]; - if (pkt->stream_index >= stream_mapping_size || - stream_mapping[pkt->stream_index] < 0) { - av_packet_unref(pkt); - continue; - } - - pkt->stream_index = stream_mapping[pkt->stream_index]; - out_stream = ofmt_ctx->streams[pkt->stream_index]; - log_packet(ifmt_ctx, pkt, "in"); - - /* copy packet */ - av_packet_rescale_ts(pkt, in_stream->time_base, out_stream->time_base); - pkt->pos = -1; - log_packet(ofmt_ctx, pkt, "out"); - - ret = av_interleaved_write_frame(ofmt_ctx, pkt); - /* pkt is now blank (av_interleaved_write_frame() takes ownership of - * its contents and resets pkt), so that no unreferencing is necessary. - * This would be different if one used av_write_frame(). */ - if (ret < 0) { - fprintf(stderr, "Error muxing packet\n"); - break; - } - } - - av_write_trailer(ofmt_ctx); -end: - av_packet_free(&pkt); - - avformat_close_input(&ifmt_ctx); - - /* close output */ - if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE)) - avio_closep(&ofmt_ctx->pb); - avformat_free_context(ofmt_ctx); - - av_freep(&stream_mapping); - - if (ret < 0 && ret != AVERROR_EOF) { - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); - return 1; - } - - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resample_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resample_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resample_audio.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resample_audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2012 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file audio resampling API usage example + * @example resample_audio.c + * + * Generate a synthetic audio signal, and Use libswresample API to perform audio + * resampling. The output is written to a raw audio file to be played with + * ffplay. + */ + +#include +#include +#include +#include + +static int get_format_from_sample_fmt(const char **fmt, + enum AVSampleFormat sample_fmt) +{ + int i; + struct sample_fmt_entry { + enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; + } sample_fmt_entries[] = { + { AV_SAMPLE_FMT_U8, "u8", "u8" }, + { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, + { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, + { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, + { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, + }; + *fmt = NULL; + + for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { + struct sample_fmt_entry *entry = &sample_fmt_entries[i]; + if (sample_fmt == entry->sample_fmt) { + *fmt = AV_NE(entry->fmt_be, entry->fmt_le); + return 0; + } + } + + fprintf(stderr, + "Sample format %s not supported as output format\n", + av_get_sample_fmt_name(sample_fmt)); + return AVERROR(EINVAL); +} + +/** + * Fill dst buffer with nb_samples, generated starting from t. + */ +static void fill_samples(double *dst, int nb_samples, int nb_channels, int sample_rate, double *t) +{ + int i, j; + double tincr = 1.0 / sample_rate, *dstp = dst; + const double c = 2 * M_PI * 440.0; + + /* generate sin tone with 440Hz frequency and duplicated channels */ + for (i = 0; i < nb_samples; i++) { + *dstp = sin(c * *t); + for (j = 1; j < nb_channels; j++) + dstp[j] = dstp[0]; + dstp += nb_channels; + *t += tincr; + } +} + +int main(int argc, char **argv) +{ + AVChannelLayout src_ch_layout = AV_CHANNEL_LAYOUT_STEREO, dst_ch_layout = AV_CHANNEL_LAYOUT_SURROUND; + int src_rate = 48000, dst_rate = 44100; + uint8_t **src_data = NULL, **dst_data = NULL; + int src_nb_channels = 0, dst_nb_channels = 0; + int src_linesize, dst_linesize; + int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples; + enum AVSampleFormat src_sample_fmt = AV_SAMPLE_FMT_DBL, dst_sample_fmt = AV_SAMPLE_FMT_S16; + const char *dst_filename = NULL; + FILE *dst_file; + int dst_bufsize; + const char *fmt; + struct SwrContext *swr_ctx; + char buf[64]; + double t; + int ret; + + if (argc != 2) { + fprintf(stderr, "Usage: %s output_file\n" + "API example program to show how to resample an audio stream with libswresample.\n" + "This program generates a series of audio frames, resamples them to a specified " + "output format and rate and saves them to an output file named output_file.\n", + argv[0]); + exit(1); + } + dst_filename = argv[1]; + + dst_file = fopen(dst_filename, "wb"); + if (!dst_file) { + fprintf(stderr, "Could not open destination file %s\n", dst_filename); + exit(1); + } + + /* create resampler context */ + swr_ctx = swr_alloc(); + if (!swr_ctx) { + fprintf(stderr, "Could not allocate resampler context\n"); + ret = AVERROR(ENOMEM); + goto end; + } + + /* set options */ + av_opt_set_chlayout(swr_ctx, "in_chlayout", &src_ch_layout, 0); + av_opt_set_int(swr_ctx, "in_sample_rate", src_rate, 0); + av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", src_sample_fmt, 0); + + av_opt_set_chlayout(swr_ctx, "out_chlayout", &dst_ch_layout, 0); + av_opt_set_int(swr_ctx, "out_sample_rate", dst_rate, 0); + av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", dst_sample_fmt, 0); + + /* initialize the resampling context */ + if ((ret = swr_init(swr_ctx)) < 0) { + fprintf(stderr, "Failed to initialize the resampling context\n"); + goto end; + } + + /* allocate source and destination samples buffers */ + + src_nb_channels = src_ch_layout.nb_channels; + ret = av_samples_alloc_array_and_samples(&src_data, &src_linesize, src_nb_channels, + src_nb_samples, src_sample_fmt, 0); + if (ret < 0) { + fprintf(stderr, "Could not allocate source samples\n"); + goto end; + } + + /* compute the number of converted samples: buffering is avoided + * ensuring that the output buffer will contain at least all the + * converted input samples */ + max_dst_nb_samples = dst_nb_samples = + av_rescale_rnd(src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); + + /* buffer is going to be directly written to a rawaudio file, no alignment */ + dst_nb_channels = dst_ch_layout.nb_channels; + ret = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, dst_nb_channels, + dst_nb_samples, dst_sample_fmt, 0); + if (ret < 0) { + fprintf(stderr, "Could not allocate destination samples\n"); + goto end; + } + + t = 0; + do { + /* generate synthetic audio */ + fill_samples((double *)src_data[0], src_nb_samples, src_nb_channels, src_rate, &t); + + /* compute destination number of samples */ + dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + + src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); + if (dst_nb_samples > max_dst_nb_samples) { + av_freep(&dst_data[0]); + ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels, + dst_nb_samples, dst_sample_fmt, 1); + if (ret < 0) + break; + max_dst_nb_samples = dst_nb_samples; + } + + /* convert to destination format */ + ret = swr_convert(swr_ctx, dst_data, dst_nb_samples, (const uint8_t **)src_data, src_nb_samples); + if (ret < 0) { + fprintf(stderr, "Error while converting\n"); + goto end; + } + dst_bufsize = av_samples_get_buffer_size(&dst_linesize, dst_nb_channels, + ret, dst_sample_fmt, 1); + if (dst_bufsize < 0) { + fprintf(stderr, "Could not get sample buffer size\n"); + goto end; + } + printf("t:%f in:%d out:%d\n", t, src_nb_samples, ret); + fwrite(dst_data[0], 1, dst_bufsize, dst_file); + } while (t < 10); + + if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt)) < 0) + goto end; + av_channel_layout_describe(&dst_ch_layout, buf, sizeof(buf)); + fprintf(stderr, "Resampling succeeded. Play the output file with the command:\n" + "ffplay -f %s -channel_layout %s -channels %d -ar %d %s\n", + fmt, buf, dst_nb_channels, dst_rate, dst_filename); + +end: + fclose(dst_file); + + if (src_data) + av_freep(&src_data[0]); + av_freep(&src_data); + + if (dst_data) + av_freep(&dst_data[0]); + av_freep(&dst_data); + + swr_free(&swr_ctx); + return ret < 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resampling_audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resampling_audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resampling_audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/resampling_audio.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2012 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @example resampling_audio.c - * libswresample API use example. - */ - -#include -#include -#include -#include - -static int get_format_from_sample_fmt(const char **fmt, - enum AVSampleFormat sample_fmt) -{ - int i; - struct sample_fmt_entry { - enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; - } sample_fmt_entries[] = { - { AV_SAMPLE_FMT_U8, "u8", "u8" }, - { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, - { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, - { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, - { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, - }; - *fmt = NULL; - - for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { - struct sample_fmt_entry *entry = &sample_fmt_entries[i]; - if (sample_fmt == entry->sample_fmt) { - *fmt = AV_NE(entry->fmt_be, entry->fmt_le); - return 0; - } - } - - fprintf(stderr, - "Sample format %s not supported as output format\n", - av_get_sample_fmt_name(sample_fmt)); - return AVERROR(EINVAL); -} - -/** - * Fill dst buffer with nb_samples, generated starting from t. - */ -static void fill_samples(double *dst, int nb_samples, int nb_channels, int sample_rate, double *t) -{ - int i, j; - double tincr = 1.0 / sample_rate, *dstp = dst; - const double c = 2 * M_PI * 440.0; - - /* generate sin tone with 440Hz frequency and duplicated channels */ - for (i = 0; i < nb_samples; i++) { - *dstp = sin(c * *t); - for (j = 1; j < nb_channels; j++) - dstp[j] = dstp[0]; - dstp += nb_channels; - *t += tincr; - } -} - -int main(int argc, char **argv) -{ - AVChannelLayout src_ch_layout = AV_CHANNEL_LAYOUT_STEREO, dst_ch_layout = AV_CHANNEL_LAYOUT_SURROUND; - int src_rate = 48000, dst_rate = 44100; - uint8_t **src_data = NULL, **dst_data = NULL; - int src_nb_channels = 0, dst_nb_channels = 0; - int src_linesize, dst_linesize; - int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples; - enum AVSampleFormat src_sample_fmt = AV_SAMPLE_FMT_DBL, dst_sample_fmt = AV_SAMPLE_FMT_S16; - const char *dst_filename = NULL; - FILE *dst_file; - int dst_bufsize; - const char *fmt; - struct SwrContext *swr_ctx; - char buf[64]; - double t; - int ret; - - if (argc != 2) { - fprintf(stderr, "Usage: %s output_file\n" - "API example program to show how to resample an audio stream with libswresample.\n" - "This program generates a series of audio frames, resamples them to a specified " - "output format and rate and saves them to an output file named output_file.\n", - argv[0]); - exit(1); - } - dst_filename = argv[1]; - - dst_file = fopen(dst_filename, "wb"); - if (!dst_file) { - fprintf(stderr, "Could not open destination file %s\n", dst_filename); - exit(1); - } - - /* create resampler context */ - swr_ctx = swr_alloc(); - if (!swr_ctx) { - fprintf(stderr, "Could not allocate resampler context\n"); - ret = AVERROR(ENOMEM); - goto end; - } - - /* set options */ - av_opt_set_chlayout(swr_ctx, "in_chlayout", &src_ch_layout, 0); - av_opt_set_int(swr_ctx, "in_sample_rate", src_rate, 0); - av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", src_sample_fmt, 0); - - av_opt_set_chlayout(swr_ctx, "out_chlayout", &dst_ch_layout, 0); - av_opt_set_int(swr_ctx, "out_sample_rate", dst_rate, 0); - av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", dst_sample_fmt, 0); - - /* initialize the resampling context */ - if ((ret = swr_init(swr_ctx)) < 0) { - fprintf(stderr, "Failed to initialize the resampling context\n"); - goto end; - } - - /* allocate source and destination samples buffers */ - - src_nb_channels = src_ch_layout.nb_channels; - ret = av_samples_alloc_array_and_samples(&src_data, &src_linesize, src_nb_channels, - src_nb_samples, src_sample_fmt, 0); - if (ret < 0) { - fprintf(stderr, "Could not allocate source samples\n"); - goto end; - } - - /* compute the number of converted samples: buffering is avoided - * ensuring that the output buffer will contain at least all the - * converted input samples */ - max_dst_nb_samples = dst_nb_samples = - av_rescale_rnd(src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); - - /* buffer is going to be directly written to a rawaudio file, no alignment */ - dst_nb_channels = dst_ch_layout.nb_channels; - ret = av_samples_alloc_array_and_samples(&dst_data, &dst_linesize, dst_nb_channels, - dst_nb_samples, dst_sample_fmt, 0); - if (ret < 0) { - fprintf(stderr, "Could not allocate destination samples\n"); - goto end; - } - - t = 0; - do { - /* generate synthetic audio */ - fill_samples((double *)src_data[0], src_nb_samples, src_nb_channels, src_rate, &t); - - /* compute destination number of samples */ - dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + - src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); - if (dst_nb_samples > max_dst_nb_samples) { - av_freep(&dst_data[0]); - ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels, - dst_nb_samples, dst_sample_fmt, 1); - if (ret < 0) - break; - max_dst_nb_samples = dst_nb_samples; - } - - /* convert to destination format */ - ret = swr_convert(swr_ctx, dst_data, dst_nb_samples, (const uint8_t **)src_data, src_nb_samples); - if (ret < 0) { - fprintf(stderr, "Error while converting\n"); - goto end; - } - dst_bufsize = av_samples_get_buffer_size(&dst_linesize, dst_nb_channels, - ret, dst_sample_fmt, 1); - if (dst_bufsize < 0) { - fprintf(stderr, "Could not get sample buffer size\n"); - goto end; - } - printf("t:%f in:%d out:%d\n", t, src_nb_samples, ret); - fwrite(dst_data[0], 1, dst_bufsize, dst_file); - } while (t < 10); - - if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt)) < 0) - goto end; - av_channel_layout_describe(&dst_ch_layout, buf, sizeof(buf)); - fprintf(stderr, "Resampling succeeded. Play the output file with the command:\n" - "ffplay -f %s -channel_layout %s -channels %d -ar %d %s\n", - fmt, buf, dst_nb_channels, dst_rate, dst_filename); - -end: - fclose(dst_file); - - if (src_data) - av_freep(&src_data[0]); - av_freep(&src_data); - - if (dst_data) - av_freep(&dst_data[0]); - av_freep(&dst_data); - - swr_free(&swr_ctx); - return ret < 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scale_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scale_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scale_video.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scale_video.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2012 Stefano Sabatini + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libswscale API usage example + * @example scale_video.c + * + * Generate a synthetic video signal and use libswscale to perform rescaling. + */ + +#include +#include +#include + +static void fill_yuv_image(uint8_t *data[4], int linesize[4], + int width, int height, int frame_index) +{ + int x, y; + + /* Y */ + for (y = 0; y < height; y++) + for (x = 0; x < width; x++) + data[0][y * linesize[0] + x] = x + y + frame_index * 3; + + /* Cb and Cr */ + for (y = 0; y < height / 2; y++) { + for (x = 0; x < width / 2; x++) { + data[1][y * linesize[1] + x] = 128 + y + frame_index * 2; + data[2][y * linesize[2] + x] = 64 + x + frame_index * 5; + } + } +} + +int main(int argc, char **argv) +{ + uint8_t *src_data[4], *dst_data[4]; + int src_linesize[4], dst_linesize[4]; + int src_w = 320, src_h = 240, dst_w, dst_h; + enum AVPixelFormat src_pix_fmt = AV_PIX_FMT_YUV420P, dst_pix_fmt = AV_PIX_FMT_RGB24; + const char *dst_size = NULL; + const char *dst_filename = NULL; + FILE *dst_file; + int dst_bufsize; + struct SwsContext *sws_ctx; + int i, ret; + + if (argc != 3) { + fprintf(stderr, "Usage: %s output_file output_size\n" + "API example program to show how to scale an image with libswscale.\n" + "This program generates a series of pictures, rescales them to the given " + "output_size and saves them to an output file named output_file\n." + "\n", argv[0]); + exit(1); + } + dst_filename = argv[1]; + dst_size = argv[2]; + + if (av_parse_video_size(&dst_w, &dst_h, dst_size) < 0) { + fprintf(stderr, + "Invalid size '%s', must be in the form WxH or a valid size abbreviation\n", + dst_size); + exit(1); + } + + dst_file = fopen(dst_filename, "wb"); + if (!dst_file) { + fprintf(stderr, "Could not open destination file %s\n", dst_filename); + exit(1); + } + + /* create scaling context */ + sws_ctx = sws_getContext(src_w, src_h, src_pix_fmt, + dst_w, dst_h, dst_pix_fmt, + SWS_BILINEAR, NULL, NULL, NULL); + if (!sws_ctx) { + fprintf(stderr, + "Impossible to create scale context for the conversion " + "fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n", + av_get_pix_fmt_name(src_pix_fmt), src_w, src_h, + av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h); + ret = AVERROR(EINVAL); + goto end; + } + + /* allocate source and destination image buffers */ + if ((ret = av_image_alloc(src_data, src_linesize, + src_w, src_h, src_pix_fmt, 16)) < 0) { + fprintf(stderr, "Could not allocate source image\n"); + goto end; + } + + /* buffer is going to be written to rawvideo file, no alignment */ + if ((ret = av_image_alloc(dst_data, dst_linesize, + dst_w, dst_h, dst_pix_fmt, 1)) < 0) { + fprintf(stderr, "Could not allocate destination image\n"); + goto end; + } + dst_bufsize = ret; + + for (i = 0; i < 100; i++) { + /* generate synthetic video */ + fill_yuv_image(src_data, src_linesize, src_w, src_h, i); + + /* convert to destination format */ + sws_scale(sws_ctx, (const uint8_t * const*)src_data, + src_linesize, 0, src_h, dst_data, dst_linesize); + + /* write scaled image to file */ + fwrite(dst_data[0], 1, dst_bufsize, dst_file); + } + + fprintf(stderr, "Scaling succeeded. Play the output file with the command:\n" + "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", + av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename); + +end: + fclose(dst_file); + av_freep(&src_data[0]); + av_freep(&dst_data[0]); + sws_freeContext(sws_ctx); + return ret < 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scaling_video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scaling_video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scaling_video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/scaling_video.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2012 Stefano Sabatini - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * libswscale API use example. - * @example scaling_video.c - */ - -#include -#include -#include - -static void fill_yuv_image(uint8_t *data[4], int linesize[4], - int width, int height, int frame_index) -{ - int x, y; - - /* Y */ - for (y = 0; y < height; y++) - for (x = 0; x < width; x++) - data[0][y * linesize[0] + x] = x + y + frame_index * 3; - - /* Cb and Cr */ - for (y = 0; y < height / 2; y++) { - for (x = 0; x < width / 2; x++) { - data[1][y * linesize[1] + x] = 128 + y + frame_index * 2; - data[2][y * linesize[2] + x] = 64 + x + frame_index * 5; - } - } -} - -int main(int argc, char **argv) -{ - uint8_t *src_data[4], *dst_data[4]; - int src_linesize[4], dst_linesize[4]; - int src_w = 320, src_h = 240, dst_w, dst_h; - enum AVPixelFormat src_pix_fmt = AV_PIX_FMT_YUV420P, dst_pix_fmt = AV_PIX_FMT_RGB24; - const char *dst_size = NULL; - const char *dst_filename = NULL; - FILE *dst_file; - int dst_bufsize; - struct SwsContext *sws_ctx; - int i, ret; - - if (argc != 3) { - fprintf(stderr, "Usage: %s output_file output_size\n" - "API example program to show how to scale an image with libswscale.\n" - "This program generates a series of pictures, rescales them to the given " - "output_size and saves them to an output file named output_file\n." - "\n", argv[0]); - exit(1); - } - dst_filename = argv[1]; - dst_size = argv[2]; - - if (av_parse_video_size(&dst_w, &dst_h, dst_size) < 0) { - fprintf(stderr, - "Invalid size '%s', must be in the form WxH or a valid size abbreviation\n", - dst_size); - exit(1); - } - - dst_file = fopen(dst_filename, "wb"); - if (!dst_file) { - fprintf(stderr, "Could not open destination file %s\n", dst_filename); - exit(1); - } - - /* create scaling context */ - sws_ctx = sws_getContext(src_w, src_h, src_pix_fmt, - dst_w, dst_h, dst_pix_fmt, - SWS_BILINEAR, NULL, NULL, NULL); - if (!sws_ctx) { - fprintf(stderr, - "Impossible to create scale context for the conversion " - "fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n", - av_get_pix_fmt_name(src_pix_fmt), src_w, src_h, - av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h); - ret = AVERROR(EINVAL); - goto end; - } - - /* allocate source and destination image buffers */ - if ((ret = av_image_alloc(src_data, src_linesize, - src_w, src_h, src_pix_fmt, 16)) < 0) { - fprintf(stderr, "Could not allocate source image\n"); - goto end; - } - - /* buffer is going to be written to rawvideo file, no alignment */ - if ((ret = av_image_alloc(dst_data, dst_linesize, - dst_w, dst_h, dst_pix_fmt, 1)) < 0) { - fprintf(stderr, "Could not allocate destination image\n"); - goto end; - } - dst_bufsize = ret; - - for (i = 0; i < 100; i++) { - /* generate synthetic video */ - fill_yuv_image(src_data, src_linesize, src_w, src_h, i); - - /* convert to destination format */ - sws_scale(sws_ctx, (const uint8_t * const*)src_data, - src_linesize, 0, src_h, dst_data, dst_linesize); - - /* write scaled image to file */ - fwrite(dst_data[0], 1, dst_bufsize, dst_file); - } - - fprintf(stderr, "Scaling succeeded. Play the output file with the command:\n" - "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", - av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename); - -end: - fclose(dst_file); - av_freep(&src_data[0]); - av_freep(&dst_data[0]); - sws_freeContext(sws_ctx); - return ret < 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/show_metadata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/show_metadata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/show_metadata.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/show_metadata.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2011 Reinhard Tartler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file libavformat metadata extraction API usage example + * @example show_metadata.c + * + * Show metadata from an input file. + */ + +#include + +#include +#include + +int main (int argc, char **argv) +{ + AVFormatContext *fmt_ctx = NULL; + const AVDictionaryEntry *tag = NULL; + int ret; + + if (argc != 2) { + printf("usage: %s \n" + "example program to demonstrate the use of the libavformat metadata API.\n" + "\n", argv[0]); + return 1; + } + + if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) + return ret; + + if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); + return ret; + } + + while ((tag = av_dict_iterate(fmt_ctx->metadata, tag))) + printf("%s=%s\n", tag->key, tag->value); + + avformat_close_input(&fmt_ctx); + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode_aac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode_aac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode_aac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode_aac.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,12 +19,11 @@ */ /** - * @file - * Simple audio converter - * + * @file audio transcoding to MPEG/AAC API usage example * @example transcode_aac.c - * Convert an input audio file to AAC in an MP4 container using FFmpeg. - * Formats other than MP4 are supported based on the output file extension. + * + * Convert an input audio file to AAC in an MP4 container. Formats other than + * MP4 are supported based on the output file extension. * @author Andreas Unterweger (dustsigns@gmail.com) */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcode.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,626 @@ +/* + * Copyright (c) 2010 Nicolas George + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2014 Andrey Utkin + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * @file demuxing, decoding, filtering, encoding and muxing API usage example + * @example transcode.c + * + * Convert input to output file, applying some hard-coded filter-graph on both + * audio and video streams. + */ + +#include +#include +#include +#include +#include +#include +#include + +static AVFormatContext *ifmt_ctx; +static AVFormatContext *ofmt_ctx; +typedef struct FilteringContext { + AVFilterContext *buffersink_ctx; + AVFilterContext *buffersrc_ctx; + AVFilterGraph *filter_graph; + + AVPacket *enc_pkt; + AVFrame *filtered_frame; +} FilteringContext; +static FilteringContext *filter_ctx; + +typedef struct StreamContext { + AVCodecContext *dec_ctx; + AVCodecContext *enc_ctx; + + AVFrame *dec_frame; +} StreamContext; +static StreamContext *stream_ctx; + +static int open_input_file(const char *filename) +{ + int ret; + unsigned int i; + + ifmt_ctx = NULL; + if ((ret = avformat_open_input(&ifmt_ctx, filename, NULL, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); + return ret; + } + + if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); + return ret; + } + + stream_ctx = av_calloc(ifmt_ctx->nb_streams, sizeof(*stream_ctx)); + if (!stream_ctx) + return AVERROR(ENOMEM); + + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + AVStream *stream = ifmt_ctx->streams[i]; + const AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id); + AVCodecContext *codec_ctx; + if (!dec) { + av_log(NULL, AV_LOG_ERROR, "Failed to find decoder for stream #%u\n", i); + return AVERROR_DECODER_NOT_FOUND; + } + codec_ctx = avcodec_alloc_context3(dec); + if (!codec_ctx) { + av_log(NULL, AV_LOG_ERROR, "Failed to allocate the decoder context for stream #%u\n", i); + return AVERROR(ENOMEM); + } + ret = avcodec_parameters_to_context(codec_ctx, stream->codecpar); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Failed to copy decoder parameters to input decoder context " + "for stream #%u\n", i); + return ret; + } + /* Reencode video & audio and remux subtitles etc. */ + if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO + || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { + if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) + codec_ctx->framerate = av_guess_frame_rate(ifmt_ctx, stream, NULL); + /* Open decoder */ + ret = avcodec_open2(codec_ctx, dec, NULL); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Failed to open decoder for stream #%u\n", i); + return ret; + } + } + stream_ctx[i].dec_ctx = codec_ctx; + + stream_ctx[i].dec_frame = av_frame_alloc(); + if (!stream_ctx[i].dec_frame) + return AVERROR(ENOMEM); + } + + av_dump_format(ifmt_ctx, 0, filename, 0); + return 0; +} + +static int open_output_file(const char *filename) +{ + AVStream *out_stream; + AVStream *in_stream; + AVCodecContext *dec_ctx, *enc_ctx; + const AVCodec *encoder; + int ret; + unsigned int i; + + ofmt_ctx = NULL; + avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, filename); + if (!ofmt_ctx) { + av_log(NULL, AV_LOG_ERROR, "Could not create output context\n"); + return AVERROR_UNKNOWN; + } + + + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + out_stream = avformat_new_stream(ofmt_ctx, NULL); + if (!out_stream) { + av_log(NULL, AV_LOG_ERROR, "Failed allocating output stream\n"); + return AVERROR_UNKNOWN; + } + + in_stream = ifmt_ctx->streams[i]; + dec_ctx = stream_ctx[i].dec_ctx; + + if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO + || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { + /* in this example, we choose transcoding to same codec */ + encoder = avcodec_find_encoder(dec_ctx->codec_id); + if (!encoder) { + av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n"); + return AVERROR_INVALIDDATA; + } + enc_ctx = avcodec_alloc_context3(encoder); + if (!enc_ctx) { + av_log(NULL, AV_LOG_FATAL, "Failed to allocate the encoder context\n"); + return AVERROR(ENOMEM); + } + + /* In this example, we transcode to same properties (picture size, + * sample rate etc.). These properties can be changed for output + * streams easily using filters */ + if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { + enc_ctx->height = dec_ctx->height; + enc_ctx->width = dec_ctx->width; + enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio; + /* take first format from list of supported formats */ + if (encoder->pix_fmts) + enc_ctx->pix_fmt = encoder->pix_fmts[0]; + else + enc_ctx->pix_fmt = dec_ctx->pix_fmt; + /* video time_base can be set to whatever is handy and supported by encoder */ + enc_ctx->time_base = av_inv_q(dec_ctx->framerate); + } else { + enc_ctx->sample_rate = dec_ctx->sample_rate; + ret = av_channel_layout_copy(&enc_ctx->ch_layout, &dec_ctx->ch_layout); + if (ret < 0) + return ret; + /* take first format from list of supported formats */ + enc_ctx->sample_fmt = encoder->sample_fmts[0]; + enc_ctx->time_base = (AVRational){1, enc_ctx->sample_rate}; + } + + if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) + enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + + /* Third parameter can be used to pass settings to encoder */ + ret = avcodec_open2(enc_ctx, encoder, NULL); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open video encoder for stream #%u\n", i); + return ret; + } + ret = avcodec_parameters_from_context(out_stream->codecpar, enc_ctx); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Failed to copy encoder parameters to output stream #%u\n", i); + return ret; + } + + out_stream->time_base = enc_ctx->time_base; + stream_ctx[i].enc_ctx = enc_ctx; + } else if (dec_ctx->codec_type == AVMEDIA_TYPE_UNKNOWN) { + av_log(NULL, AV_LOG_FATAL, "Elementary stream #%d is of unknown type, cannot proceed\n", i); + return AVERROR_INVALIDDATA; + } else { + /* if this stream must be remuxed */ + ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Copying parameters for stream #%u failed\n", i); + return ret; + } + out_stream->time_base = in_stream->time_base; + } + + } + av_dump_format(ofmt_ctx, 0, filename, 1); + + if (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) { + ret = avio_open(&ofmt_ctx->pb, filename, AVIO_FLAG_WRITE); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Could not open output file '%s'", filename); + return ret; + } + } + + /* init muxer, write output file header */ + ret = avformat_write_header(ofmt_ctx, NULL); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error occurred when opening output file\n"); + return ret; + } + + return 0; +} + +static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx, + AVCodecContext *enc_ctx, const char *filter_spec) +{ + char args[512]; + int ret = 0; + const AVFilter *buffersrc = NULL; + const AVFilter *buffersink = NULL; + AVFilterContext *buffersrc_ctx = NULL; + AVFilterContext *buffersink_ctx = NULL; + AVFilterInOut *outputs = avfilter_inout_alloc(); + AVFilterInOut *inputs = avfilter_inout_alloc(); + AVFilterGraph *filter_graph = avfilter_graph_alloc(); + + if (!outputs || !inputs || !filter_graph) { + ret = AVERROR(ENOMEM); + goto end; + } + + if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { + buffersrc = avfilter_get_by_name("buffer"); + buffersink = avfilter_get_by_name("buffersink"); + if (!buffersrc || !buffersink) { + av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n"); + ret = AVERROR_UNKNOWN; + goto end; + } + + snprintf(args, sizeof(args), + "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", + dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, + dec_ctx->time_base.num, dec_ctx->time_base.den, + dec_ctx->sample_aspect_ratio.num, + dec_ctx->sample_aspect_ratio.den); + + ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", + args, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n"); + goto end; + } + + ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", + NULL, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); + goto end; + } + + ret = av_opt_set_bin(buffersink_ctx, "pix_fmts", + (uint8_t*)&enc_ctx->pix_fmt, sizeof(enc_ctx->pix_fmt), + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n"); + goto end; + } + } else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { + char buf[64]; + buffersrc = avfilter_get_by_name("abuffer"); + buffersink = avfilter_get_by_name("abuffersink"); + if (!buffersrc || !buffersink) { + av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n"); + ret = AVERROR_UNKNOWN; + goto end; + } + + if (dec_ctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + av_channel_layout_default(&dec_ctx->ch_layout, dec_ctx->ch_layout.nb_channels); + av_channel_layout_describe(&dec_ctx->ch_layout, buf, sizeof(buf)); + snprintf(args, sizeof(args), + "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=%s", + dec_ctx->time_base.num, dec_ctx->time_base.den, dec_ctx->sample_rate, + av_get_sample_fmt_name(dec_ctx->sample_fmt), + buf); + ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", + args, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); + goto end; + } + + ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", + NULL, NULL, filter_graph); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); + goto end; + } + + ret = av_opt_set_bin(buffersink_ctx, "sample_fmts", + (uint8_t*)&enc_ctx->sample_fmt, sizeof(enc_ctx->sample_fmt), + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n"); + goto end; + } + + av_channel_layout_describe(&enc_ctx->ch_layout, buf, sizeof(buf)); + ret = av_opt_set(buffersink_ctx, "ch_layouts", + buf, AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n"); + goto end; + } + + ret = av_opt_set_bin(buffersink_ctx, "sample_rates", + (uint8_t*)&enc_ctx->sample_rate, sizeof(enc_ctx->sample_rate), + AV_OPT_SEARCH_CHILDREN); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n"); + goto end; + } + } else { + ret = AVERROR_UNKNOWN; + goto end; + } + + /* Endpoints for the filter graph. */ + outputs->name = av_strdup("in"); + outputs->filter_ctx = buffersrc_ctx; + outputs->pad_idx = 0; + outputs->next = NULL; + + inputs->name = av_strdup("out"); + inputs->filter_ctx = buffersink_ctx; + inputs->pad_idx = 0; + inputs->next = NULL; + + if (!outputs->name || !inputs->name) { + ret = AVERROR(ENOMEM); + goto end; + } + + if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_spec, + &inputs, &outputs, NULL)) < 0) + goto end; + + if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) + goto end; + + /* Fill FilteringContext */ + fctx->buffersrc_ctx = buffersrc_ctx; + fctx->buffersink_ctx = buffersink_ctx; + fctx->filter_graph = filter_graph; + +end: + avfilter_inout_free(&inputs); + avfilter_inout_free(&outputs); + + return ret; +} + +static int init_filters(void) +{ + const char *filter_spec; + unsigned int i; + int ret; + filter_ctx = av_malloc_array(ifmt_ctx->nb_streams, sizeof(*filter_ctx)); + if (!filter_ctx) + return AVERROR(ENOMEM); + + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + filter_ctx[i].buffersrc_ctx = NULL; + filter_ctx[i].buffersink_ctx = NULL; + filter_ctx[i].filter_graph = NULL; + if (!(ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO + || ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) + continue; + + + if (ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) + filter_spec = "null"; /* passthrough (dummy) filter for video */ + else + filter_spec = "anull"; /* passthrough (dummy) filter for audio */ + ret = init_filter(&filter_ctx[i], stream_ctx[i].dec_ctx, + stream_ctx[i].enc_ctx, filter_spec); + if (ret) + return ret; + + filter_ctx[i].enc_pkt = av_packet_alloc(); + if (!filter_ctx[i].enc_pkt) + return AVERROR(ENOMEM); + + filter_ctx[i].filtered_frame = av_frame_alloc(); + if (!filter_ctx[i].filtered_frame) + return AVERROR(ENOMEM); + } + return 0; +} + +static int encode_write_frame(unsigned int stream_index, int flush) +{ + StreamContext *stream = &stream_ctx[stream_index]; + FilteringContext *filter = &filter_ctx[stream_index]; + AVFrame *filt_frame = flush ? NULL : filter->filtered_frame; + AVPacket *enc_pkt = filter->enc_pkt; + int ret; + + av_log(NULL, AV_LOG_INFO, "Encoding frame\n"); + /* encode filtered frame */ + av_packet_unref(enc_pkt); + + ret = avcodec_send_frame(stream->enc_ctx, filt_frame); + + if (ret < 0) + return ret; + + while (ret >= 0) { + ret = avcodec_receive_packet(stream->enc_ctx, enc_pkt); + + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + return 0; + + /* prepare packet for muxing */ + enc_pkt->stream_index = stream_index; + av_packet_rescale_ts(enc_pkt, + stream->enc_ctx->time_base, + ofmt_ctx->streams[stream_index]->time_base); + + av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n"); + /* mux encoded frame */ + ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt); + } + + return ret; +} + +static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index) +{ + FilteringContext *filter = &filter_ctx[stream_index]; + int ret; + + av_log(NULL, AV_LOG_INFO, "Pushing decoded frame to filters\n"); + /* push the decoded frame into the filtergraph */ + ret = av_buffersrc_add_frame_flags(filter->buffersrc_ctx, + frame, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n"); + return ret; + } + + /* pull filtered frames from the filtergraph */ + while (1) { + av_log(NULL, AV_LOG_INFO, "Pulling filtered frame from filters\n"); + ret = av_buffersink_get_frame(filter->buffersink_ctx, + filter->filtered_frame); + if (ret < 0) { + /* if no more frames for output - returns AVERROR(EAGAIN) + * if flushed and no more frames for output - returns AVERROR_EOF + * rewrite retcode to 0 to show it as normal procedure completion + */ + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) + ret = 0; + break; + } + + filter->filtered_frame->pict_type = AV_PICTURE_TYPE_NONE; + ret = encode_write_frame(stream_index, 0); + av_frame_unref(filter->filtered_frame); + if (ret < 0) + break; + } + + return ret; +} + +static int flush_encoder(unsigned int stream_index) +{ + if (!(stream_ctx[stream_index].enc_ctx->codec->capabilities & + AV_CODEC_CAP_DELAY)) + return 0; + + av_log(NULL, AV_LOG_INFO, "Flushing stream #%u encoder\n", stream_index); + return encode_write_frame(stream_index, 1); +} + +int main(int argc, char **argv) +{ + int ret; + AVPacket *packet = NULL; + unsigned int stream_index; + unsigned int i; + + if (argc != 3) { + av_log(NULL, AV_LOG_ERROR, "Usage: %s \n", argv[0]); + return 1; + } + + if ((ret = open_input_file(argv[1])) < 0) + goto end; + if ((ret = open_output_file(argv[2])) < 0) + goto end; + if ((ret = init_filters()) < 0) + goto end; + if (!(packet = av_packet_alloc())) + goto end; + + /* read all packets */ + while (1) { + if ((ret = av_read_frame(ifmt_ctx, packet)) < 0) + break; + stream_index = packet->stream_index; + av_log(NULL, AV_LOG_DEBUG, "Demuxer gave frame of stream_index %u\n", + stream_index); + + if (filter_ctx[stream_index].filter_graph) { + StreamContext *stream = &stream_ctx[stream_index]; + + av_log(NULL, AV_LOG_DEBUG, "Going to reencode&filter the frame\n"); + + av_packet_rescale_ts(packet, + ifmt_ctx->streams[stream_index]->time_base, + stream->dec_ctx->time_base); + ret = avcodec_send_packet(stream->dec_ctx, packet); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Decoding failed\n"); + break; + } + + while (ret >= 0) { + ret = avcodec_receive_frame(stream->dec_ctx, stream->dec_frame); + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + break; + else if (ret < 0) + goto end; + + stream->dec_frame->pts = stream->dec_frame->best_effort_timestamp; + ret = filter_encode_write_frame(stream->dec_frame, stream_index); + if (ret < 0) + goto end; + } + } else { + /* remux this frame without reencoding */ + av_packet_rescale_ts(packet, + ifmt_ctx->streams[stream_index]->time_base, + ofmt_ctx->streams[stream_index]->time_base); + + ret = av_interleaved_write_frame(ofmt_ctx, packet); + if (ret < 0) + goto end; + } + av_packet_unref(packet); + } + + /* flush filters and encoders */ + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + /* flush filter */ + if (!filter_ctx[i].filter_graph) + continue; + ret = filter_encode_write_frame(NULL, i); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Flushing filter failed\n"); + goto end; + } + + /* flush encoder */ + ret = flush_encoder(i); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Flushing encoder failed\n"); + goto end; + } + } + + av_write_trailer(ofmt_ctx); +end: + av_packet_free(&packet); + for (i = 0; i < ifmt_ctx->nb_streams; i++) { + avcodec_free_context(&stream_ctx[i].dec_ctx); + if (ofmt_ctx && ofmt_ctx->nb_streams > i && ofmt_ctx->streams[i] && stream_ctx[i].enc_ctx) + avcodec_free_context(&stream_ctx[i].enc_ctx); + if (filter_ctx && filter_ctx[i].filter_graph) { + avfilter_graph_free(&filter_ctx[i].filter_graph); + av_packet_free(&filter_ctx[i].enc_pkt); + av_frame_free(&filter_ctx[i].filtered_frame); + } + + av_frame_free(&stream_ctx[i].dec_frame); + } + av_free(filter_ctx); + av_free(stream_ctx); + avformat_close_input(&ifmt_ctx); + if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) + avio_closep(&ofmt_ctx->pb); + avformat_free_context(ofmt_ctx); + + if (ret < 0) + av_log(NULL, AV_LOG_ERROR, "Error occurred: %s\n", av_err2str(ret)); + + return ret ? 1 : 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcoding.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcoding.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcoding.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/transcoding.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,624 +0,0 @@ -/* - * Copyright (c) 2010 Nicolas George - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2014 Andrey Utkin - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * @file - * API example for demuxing, decoding, filtering, encoding and muxing - * @example transcoding.c - */ - -#include -#include -#include -#include -#include -#include -#include - -static AVFormatContext *ifmt_ctx; -static AVFormatContext *ofmt_ctx; -typedef struct FilteringContext { - AVFilterContext *buffersink_ctx; - AVFilterContext *buffersrc_ctx; - AVFilterGraph *filter_graph; - - AVPacket *enc_pkt; - AVFrame *filtered_frame; -} FilteringContext; -static FilteringContext *filter_ctx; - -typedef struct StreamContext { - AVCodecContext *dec_ctx; - AVCodecContext *enc_ctx; - - AVFrame *dec_frame; -} StreamContext; -static StreamContext *stream_ctx; - -static int open_input_file(const char *filename) -{ - int ret; - unsigned int i; - - ifmt_ctx = NULL; - if ((ret = avformat_open_input(&ifmt_ctx, filename, NULL, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); - return ret; - } - - if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); - return ret; - } - - stream_ctx = av_calloc(ifmt_ctx->nb_streams, sizeof(*stream_ctx)); - if (!stream_ctx) - return AVERROR(ENOMEM); - - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - AVStream *stream = ifmt_ctx->streams[i]; - const AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id); - AVCodecContext *codec_ctx; - if (!dec) { - av_log(NULL, AV_LOG_ERROR, "Failed to find decoder for stream #%u\n", i); - return AVERROR_DECODER_NOT_FOUND; - } - codec_ctx = avcodec_alloc_context3(dec); - if (!codec_ctx) { - av_log(NULL, AV_LOG_ERROR, "Failed to allocate the decoder context for stream #%u\n", i); - return AVERROR(ENOMEM); - } - ret = avcodec_parameters_to_context(codec_ctx, stream->codecpar); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Failed to copy decoder parameters to input decoder context " - "for stream #%u\n", i); - return ret; - } - /* Reencode video & audio and remux subtitles etc. */ - if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO - || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { - if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) - codec_ctx->framerate = av_guess_frame_rate(ifmt_ctx, stream, NULL); - /* Open decoder */ - ret = avcodec_open2(codec_ctx, dec, NULL); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Failed to open decoder for stream #%u\n", i); - return ret; - } - } - stream_ctx[i].dec_ctx = codec_ctx; - - stream_ctx[i].dec_frame = av_frame_alloc(); - if (!stream_ctx[i].dec_frame) - return AVERROR(ENOMEM); - } - - av_dump_format(ifmt_ctx, 0, filename, 0); - return 0; -} - -static int open_output_file(const char *filename) -{ - AVStream *out_stream; - AVStream *in_stream; - AVCodecContext *dec_ctx, *enc_ctx; - const AVCodec *encoder; - int ret; - unsigned int i; - - ofmt_ctx = NULL; - avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, filename); - if (!ofmt_ctx) { - av_log(NULL, AV_LOG_ERROR, "Could not create output context\n"); - return AVERROR_UNKNOWN; - } - - - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - out_stream = avformat_new_stream(ofmt_ctx, NULL); - if (!out_stream) { - av_log(NULL, AV_LOG_ERROR, "Failed allocating output stream\n"); - return AVERROR_UNKNOWN; - } - - in_stream = ifmt_ctx->streams[i]; - dec_ctx = stream_ctx[i].dec_ctx; - - if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO - || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { - /* in this example, we choose transcoding to same codec */ - encoder = avcodec_find_encoder(dec_ctx->codec_id); - if (!encoder) { - av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n"); - return AVERROR_INVALIDDATA; - } - enc_ctx = avcodec_alloc_context3(encoder); - if (!enc_ctx) { - av_log(NULL, AV_LOG_FATAL, "Failed to allocate the encoder context\n"); - return AVERROR(ENOMEM); - } - - /* In this example, we transcode to same properties (picture size, - * sample rate etc.). These properties can be changed for output - * streams easily using filters */ - if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { - enc_ctx->height = dec_ctx->height; - enc_ctx->width = dec_ctx->width; - enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio; - /* take first format from list of supported formats */ - if (encoder->pix_fmts) - enc_ctx->pix_fmt = encoder->pix_fmts[0]; - else - enc_ctx->pix_fmt = dec_ctx->pix_fmt; - /* video time_base can be set to whatever is handy and supported by encoder */ - enc_ctx->time_base = av_inv_q(dec_ctx->framerate); - } else { - enc_ctx->sample_rate = dec_ctx->sample_rate; - ret = av_channel_layout_copy(&enc_ctx->ch_layout, &dec_ctx->ch_layout); - if (ret < 0) - return ret; - /* take first format from list of supported formats */ - enc_ctx->sample_fmt = encoder->sample_fmts[0]; - enc_ctx->time_base = (AVRational){1, enc_ctx->sample_rate}; - } - - if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) - enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; - - /* Third parameter can be used to pass settings to encoder */ - ret = avcodec_open2(enc_ctx, encoder, NULL); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot open video encoder for stream #%u\n", i); - return ret; - } - ret = avcodec_parameters_from_context(out_stream->codecpar, enc_ctx); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Failed to copy encoder parameters to output stream #%u\n", i); - return ret; - } - - out_stream->time_base = enc_ctx->time_base; - stream_ctx[i].enc_ctx = enc_ctx; - } else if (dec_ctx->codec_type == AVMEDIA_TYPE_UNKNOWN) { - av_log(NULL, AV_LOG_FATAL, "Elementary stream #%d is of unknown type, cannot proceed\n", i); - return AVERROR_INVALIDDATA; - } else { - /* if this stream must be remuxed */ - ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Copying parameters for stream #%u failed\n", i); - return ret; - } - out_stream->time_base = in_stream->time_base; - } - - } - av_dump_format(ofmt_ctx, 0, filename, 1); - - if (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) { - ret = avio_open(&ofmt_ctx->pb, filename, AVIO_FLAG_WRITE); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Could not open output file '%s'", filename); - return ret; - } - } - - /* init muxer, write output file header */ - ret = avformat_write_header(ofmt_ctx, NULL); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error occurred when opening output file\n"); - return ret; - } - - return 0; -} - -static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx, - AVCodecContext *enc_ctx, const char *filter_spec) -{ - char args[512]; - int ret = 0; - const AVFilter *buffersrc = NULL; - const AVFilter *buffersink = NULL; - AVFilterContext *buffersrc_ctx = NULL; - AVFilterContext *buffersink_ctx = NULL; - AVFilterInOut *outputs = avfilter_inout_alloc(); - AVFilterInOut *inputs = avfilter_inout_alloc(); - AVFilterGraph *filter_graph = avfilter_graph_alloc(); - - if (!outputs || !inputs || !filter_graph) { - ret = AVERROR(ENOMEM); - goto end; - } - - if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { - buffersrc = avfilter_get_by_name("buffer"); - buffersink = avfilter_get_by_name("buffersink"); - if (!buffersrc || !buffersink) { - av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n"); - ret = AVERROR_UNKNOWN; - goto end; - } - - snprintf(args, sizeof(args), - "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", - dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, - dec_ctx->time_base.num, dec_ctx->time_base.den, - dec_ctx->sample_aspect_ratio.num, - dec_ctx->sample_aspect_ratio.den); - - ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", - args, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n"); - goto end; - } - - ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", - NULL, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n"); - goto end; - } - - ret = av_opt_set_bin(buffersink_ctx, "pix_fmts", - (uint8_t*)&enc_ctx->pix_fmt, sizeof(enc_ctx->pix_fmt), - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n"); - goto end; - } - } else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { - char buf[64]; - buffersrc = avfilter_get_by_name("abuffer"); - buffersink = avfilter_get_by_name("abuffersink"); - if (!buffersrc || !buffersink) { - av_log(NULL, AV_LOG_ERROR, "filtering source or sink element not found\n"); - ret = AVERROR_UNKNOWN; - goto end; - } - - if (dec_ctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) - av_channel_layout_default(&dec_ctx->ch_layout, dec_ctx->ch_layout.nb_channels); - av_channel_layout_describe(&dec_ctx->ch_layout, buf, sizeof(buf)); - snprintf(args, sizeof(args), - "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=%s", - dec_ctx->time_base.num, dec_ctx->time_base.den, dec_ctx->sample_rate, - av_get_sample_fmt_name(dec_ctx->sample_fmt), - buf); - ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", - args, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); - goto end; - } - - ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", - NULL, NULL, filter_graph); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); - goto end; - } - - ret = av_opt_set_bin(buffersink_ctx, "sample_fmts", - (uint8_t*)&enc_ctx->sample_fmt, sizeof(enc_ctx->sample_fmt), - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n"); - goto end; - } - - av_channel_layout_describe(&enc_ctx->ch_layout, buf, sizeof(buf)); - ret = av_opt_set(buffersink_ctx, "ch_layouts", - buf, AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n"); - goto end; - } - - ret = av_opt_set_bin(buffersink_ctx, "sample_rates", - (uint8_t*)&enc_ctx->sample_rate, sizeof(enc_ctx->sample_rate), - AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n"); - goto end; - } - } else { - ret = AVERROR_UNKNOWN; - goto end; - } - - /* Endpoints for the filter graph. */ - outputs->name = av_strdup("in"); - outputs->filter_ctx = buffersrc_ctx; - outputs->pad_idx = 0; - outputs->next = NULL; - - inputs->name = av_strdup("out"); - inputs->filter_ctx = buffersink_ctx; - inputs->pad_idx = 0; - inputs->next = NULL; - - if (!outputs->name || !inputs->name) { - ret = AVERROR(ENOMEM); - goto end; - } - - if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_spec, - &inputs, &outputs, NULL)) < 0) - goto end; - - if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) - goto end; - - /* Fill FilteringContext */ - fctx->buffersrc_ctx = buffersrc_ctx; - fctx->buffersink_ctx = buffersink_ctx; - fctx->filter_graph = filter_graph; - -end: - avfilter_inout_free(&inputs); - avfilter_inout_free(&outputs); - - return ret; -} - -static int init_filters(void) -{ - const char *filter_spec; - unsigned int i; - int ret; - filter_ctx = av_malloc_array(ifmt_ctx->nb_streams, sizeof(*filter_ctx)); - if (!filter_ctx) - return AVERROR(ENOMEM); - - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - filter_ctx[i].buffersrc_ctx = NULL; - filter_ctx[i].buffersink_ctx = NULL; - filter_ctx[i].filter_graph = NULL; - if (!(ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO - || ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) - continue; - - - if (ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) - filter_spec = "null"; /* passthrough (dummy) filter for video */ - else - filter_spec = "anull"; /* passthrough (dummy) filter for audio */ - ret = init_filter(&filter_ctx[i], stream_ctx[i].dec_ctx, - stream_ctx[i].enc_ctx, filter_spec); - if (ret) - return ret; - - filter_ctx[i].enc_pkt = av_packet_alloc(); - if (!filter_ctx[i].enc_pkt) - return AVERROR(ENOMEM); - - filter_ctx[i].filtered_frame = av_frame_alloc(); - if (!filter_ctx[i].filtered_frame) - return AVERROR(ENOMEM); - } - return 0; -} - -static int encode_write_frame(unsigned int stream_index, int flush) -{ - StreamContext *stream = &stream_ctx[stream_index]; - FilteringContext *filter = &filter_ctx[stream_index]; - AVFrame *filt_frame = flush ? NULL : filter->filtered_frame; - AVPacket *enc_pkt = filter->enc_pkt; - int ret; - - av_log(NULL, AV_LOG_INFO, "Encoding frame\n"); - /* encode filtered frame */ - av_packet_unref(enc_pkt); - - ret = avcodec_send_frame(stream->enc_ctx, filt_frame); - - if (ret < 0) - return ret; - - while (ret >= 0) { - ret = avcodec_receive_packet(stream->enc_ctx, enc_pkt); - - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - return 0; - - /* prepare packet for muxing */ - enc_pkt->stream_index = stream_index; - av_packet_rescale_ts(enc_pkt, - stream->enc_ctx->time_base, - ofmt_ctx->streams[stream_index]->time_base); - - av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n"); - /* mux encoded frame */ - ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt); - } - - return ret; -} - -static int filter_encode_write_frame(AVFrame *frame, unsigned int stream_index) -{ - FilteringContext *filter = &filter_ctx[stream_index]; - int ret; - - av_log(NULL, AV_LOG_INFO, "Pushing decoded frame to filters\n"); - /* push the decoded frame into the filtergraph */ - ret = av_buffersrc_add_frame_flags(filter->buffersrc_ctx, - frame, 0); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n"); - return ret; - } - - /* pull filtered frames from the filtergraph */ - while (1) { - av_log(NULL, AV_LOG_INFO, "Pulling filtered frame from filters\n"); - ret = av_buffersink_get_frame(filter->buffersink_ctx, - filter->filtered_frame); - if (ret < 0) { - /* if no more frames for output - returns AVERROR(EAGAIN) - * if flushed and no more frames for output - returns AVERROR_EOF - * rewrite retcode to 0 to show it as normal procedure completion - */ - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) - ret = 0; - break; - } - - filter->filtered_frame->pict_type = AV_PICTURE_TYPE_NONE; - ret = encode_write_frame(stream_index, 0); - av_frame_unref(filter->filtered_frame); - if (ret < 0) - break; - } - - return ret; -} - -static int flush_encoder(unsigned int stream_index) -{ - if (!(stream_ctx[stream_index].enc_ctx->codec->capabilities & - AV_CODEC_CAP_DELAY)) - return 0; - - av_log(NULL, AV_LOG_INFO, "Flushing stream #%u encoder\n", stream_index); - return encode_write_frame(stream_index, 1); -} - -int main(int argc, char **argv) -{ - int ret; - AVPacket *packet = NULL; - unsigned int stream_index; - unsigned int i; - - if (argc != 3) { - av_log(NULL, AV_LOG_ERROR, "Usage: %s \n", argv[0]); - return 1; - } - - if ((ret = open_input_file(argv[1])) < 0) - goto end; - if ((ret = open_output_file(argv[2])) < 0) - goto end; - if ((ret = init_filters()) < 0) - goto end; - if (!(packet = av_packet_alloc())) - goto end; - - /* read all packets */ - while (1) { - if ((ret = av_read_frame(ifmt_ctx, packet)) < 0) - break; - stream_index = packet->stream_index; - av_log(NULL, AV_LOG_DEBUG, "Demuxer gave frame of stream_index %u\n", - stream_index); - - if (filter_ctx[stream_index].filter_graph) { - StreamContext *stream = &stream_ctx[stream_index]; - - av_log(NULL, AV_LOG_DEBUG, "Going to reencode&filter the frame\n"); - - av_packet_rescale_ts(packet, - ifmt_ctx->streams[stream_index]->time_base, - stream->dec_ctx->time_base); - ret = avcodec_send_packet(stream->dec_ctx, packet); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Decoding failed\n"); - break; - } - - while (ret >= 0) { - ret = avcodec_receive_frame(stream->dec_ctx, stream->dec_frame); - if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) - break; - else if (ret < 0) - goto end; - - stream->dec_frame->pts = stream->dec_frame->best_effort_timestamp; - ret = filter_encode_write_frame(stream->dec_frame, stream_index); - if (ret < 0) - goto end; - } - } else { - /* remux this frame without reencoding */ - av_packet_rescale_ts(packet, - ifmt_ctx->streams[stream_index]->time_base, - ofmt_ctx->streams[stream_index]->time_base); - - ret = av_interleaved_write_frame(ofmt_ctx, packet); - if (ret < 0) - goto end; - } - av_packet_unref(packet); - } - - /* flush filters and encoders */ - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - /* flush filter */ - if (!filter_ctx[i].filter_graph) - continue; - ret = filter_encode_write_frame(NULL, i); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Flushing filter failed\n"); - goto end; - } - - /* flush encoder */ - ret = flush_encoder(i); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Flushing encoder failed\n"); - goto end; - } - } - - av_write_trailer(ofmt_ctx); -end: - av_packet_free(&packet); - for (i = 0; i < ifmt_ctx->nb_streams; i++) { - avcodec_free_context(&stream_ctx[i].dec_ctx); - if (ofmt_ctx && ofmt_ctx->nb_streams > i && ofmt_ctx->streams[i] && stream_ctx[i].enc_ctx) - avcodec_free_context(&stream_ctx[i].enc_ctx); - if (filter_ctx && filter_ctx[i].filter_graph) { - avfilter_graph_free(&filter_ctx[i].filter_graph); - av_packet_free(&filter_ctx[i].enc_pkt); - av_frame_free(&filter_ctx[i].filtered_frame); - } - - av_frame_free(&stream_ctx[i].dec_frame); - } - av_free(filter_ctx); - av_free(stream_ctx); - avformat_close_input(&ifmt_ctx); - if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) - avio_closep(&ofmt_ctx->pb); - avformat_free_context(ofmt_ctx); - - if (ret < 0) - av_log(NULL, AV_LOG_ERROR, "Error occurred: %s\n", av_err2str(ret)); - - return ret ? 1 : 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_encode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_encode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_encode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_encode.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,4 @@ /* - * Video Acceleration API (video encoding) encode sample - * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -21,13 +19,12 @@ */ /** - * @file - * Intel VAAPI-accelerated encoding example. - * + * @file Intel VAAPI-accelerated encoding API usage example * @example vaapi_encode.c - * This example shows how to do VAAPI-accelerated encoding. now only support NV12 - * raw file, usage like: vaapi_encode 1920 1080 input.yuv output.h264 * + * Perform VAAPI-accelerated encoding. Read input from an NV12 raw + * file, and write the H.264 encoded data to an output raw file. + * Usage: vaapi_encode 1920 1080 input.yuv output.h264 */ #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_transcode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_transcode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_transcode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/examples/vaapi_transcode.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,4 @@ /* - * Video Acceleration API (video transcoding) transcode sample - * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -21,11 +19,10 @@ */ /** - * @file - * Intel VAAPI-accelerated transcoding example. - * + * @file Intel VAAPI-accelerated transcoding API usage example * @example vaapi_transcode.c - * This example shows how to do VAAPI-accelerated transcoding. + * + * Perform VAAPI-accelerated transcoding. * Usage: vaapi_transcode input_stream codec output_stream * e.g: - vaapi_transcode input.mp4 h264_vaapi output_h264.mp4 * - vaapi_transcode input.mp4 vp9_vaapi output_vp9.ivf diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/ffmpeg.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/ffmpeg.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/ffmpeg.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/ffmpeg.texi 2023-03-03 13:29:59.000000000 +0000 @@ -877,9 +877,20 @@ like image2 or v4l2 (it used to be the same in older versions of FFmpeg). If in doubt use @option{-framerate} instead of the input option @option{-r}. -As an output option, duplicate or drop input frames to achieve constant output +As an output option: +@table @option +@item video encoding +Duplicate or drop frames right before encoding them to achieve constant output frame rate @var{fps}. +@item video streamcopy +Indicate to the muxer that @var{fps} is the stream frame rate. No data is +dropped or duplicated in this case. This may produce invalid files if @var{fps} +does not match the actual stream frame rate as determined by packet timestamps. +See also the @code{setts} bitstream filter. + +@end table + @item -fpsmax[:@var{stream_specifier}] @var{fps} (@emph{output,per-stream}) Set maximum frame rate (Hz value, fraction or abbreviation). @@ -912,6 +923,32 @@ stored at container level, but not the aspect ratio stored in encoded frames, if it exists. +@item -display_rotation[:@var{stream_specifier}] @var{rotation} (@emph{input,per-stream}) +Set video rotation metadata. + +@var{rotation} is a decimal number specifying the amount in degree by +which the video should be rotated counter-clockwise before being +displayed. + +This option overrides the rotation/display transform metadata stored in +the file, if any. When the video is being transcoded (rather than +copied) and @code{-autorotate} is enabled, the video will be rotated at +the filtering stage. Otherwise, the metadata will be written into the +output file if the muxer supports it. + +If the @code{-display_hflip} and/or @code{-display_vflip} options are +given, they are applied after the rotation specified by this option. + +@item -display_hflip[:@var{stream_specifier}] (@emph{input,per-stream}) +Set whether on display the image should be horizontally flipped. + +See the @code{-display_rotation} option for more details. + +@item -display_vflip[:@var{stream_specifier}] (@emph{input,per-stream}) +Set whether on display the image should be vertically flipped. + +See the @code{-display_rotation} option for more details. + @item -vn (@emph{input/output}) As an input option, blocks all video streams of a file from being filtered or being automatically selected or mapped for any output. See @code{-discard} @@ -985,14 +1022,9 @@ end frame numbers, last one is quantizer to use if positive, or quality factor if negative. -@item -ilme -Force interlacing support in encoder (MPEG-2 and MPEG-4 only). -Use this option if your input file is interlaced and you want -to keep the interlaced format for minimum losses. -The alternative is to deinterlace the input stream by use of a filter -such as @code{yadif} or @code{bwdif}, but deinterlacing introduces losses. @item -psnr -Calculate PSNR of compressed frames. +Calculate PSNR of compressed frames. This option is deprecated, pass the +PSNR flag to the encoder instead, using @code{-flags +psnr}. @item -vstats Dump video coding statistics to @file{vstats_HHMMSS.log}. @item -vstats_file @var{file} @@ -1009,8 +1041,6 @@ @code{out= %2d st= %2d frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s} @item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream}) top=1/bottom=0/auto=-1 field first -@item -dc @var{precision} -Intra_dc_precision. @item -vtag @var{fourcc/tag} (@emph{output}) Force video tag/fourcc. This is an alias for @code{-tag:v}. @item -qphist (@emph{global}) @@ -1312,6 +1342,22 @@ Actual runtime availability depends on the hardware and its suitable driver being installed. +@item -fix_sub_duration_heartbeat[:@var{stream_specifier}] +Set a specific output video stream as the heartbeat stream according to which +to split and push through currently in-progress subtitle upon receipt of a +random access packet. + +This lowers the latency of subtitles for which the end packet or the following +subtitle has not yet been received. As a drawback, this will most likely lead +to duplication of subtitle events in order to cover the full duration, so +when dealing with use cases where latency of when the subtitle event is passed +on to output is not relevant this option should not be utilized. + +Requires @option{-fix_sub_duration} to be set for the relevant input subtitle +stream for this to have any effect, as well as for the input subtitle stream +having to be directly mapped to the same output in which the heartbeat stream +resides. + @end table @section Audio Options @@ -1410,18 +1456,18 @@ @section Advanced options @table @option -@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?][,@var{sync_file_id}[:@var{stream_specifier}]] | @var{[linklabel]} (@emph{output}) +@item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output}) -Designate one or more input streams as a source for the output file. Each input -stream is identified by the input file index @var{input_file_id} and -the input stream index @var{input_stream_id} within the input -file. Both indices start at 0. If specified, -@var{sync_file_id}:@var{stream_specifier} sets which input stream -is used as a presentation sync reference. - -The first @code{-map} option on the command line specifies the -source for output stream 0, the second @code{-map} option specifies -the source for output stream 1, etc. +Create one or more streams in the output file. This option has two forms for +specifying the data source(s): the first selects one or more streams from some +input file (specified with @code{-i}), the second takes an output from some +complex filtergraph (specified with @code{-filter_complex} or +@code{-filter_complex_script}). + +In the first form, an output stream is created for every stream from the input +file with the index @var{input_file_id}. If @var{stream_specifier} is given, +only those streams that match the specifier are used (see the +@ref{Stream specifiers} section for the @var{stream_specifier} syntax). A @code{-} character before the stream identifier creates a "negative" mapping. It disables matching streams from already created mappings. @@ -1435,39 +1481,56 @@ graphs (see the @option{-filter_complex} option) to the output file. @var{linklabel} must correspond to a defined output link label in the graph. -For example, to map ALL streams from the first input file to output +This option may be specified multiple times, each adding more streams to the +output file. Any given input stream may also be mapped any number of times as a +source for different output streams, e.g. in order to use different encoding +options and/or filters. The streams are created in the output in the same order +in which the @code{-map} options are given on the commandline. + +Using this option disables the default mappings for this output file. + +Examples: + +@table @emph + +@item map everything +To map ALL streams from the first input file to output @example ffmpeg -i INPUT -map 0 output @end example -For example, if you have two audio streams in the first input file, -these streams are identified by "0:0" and "0:1". You can use -@code{-map} to select which streams to place in an output file. For -example: +@item select specific stream +If you have two audio streams in the first input file, these streams are +identified by @var{0:0} and @var{0:1}. You can use @code{-map} to select which +streams to place in an output file. For example: @example ffmpeg -i INPUT -map 0:1 out.wav @end example -will map the input stream in @file{INPUT} identified by "0:1" to -the (single) output stream in @file{out.wav}. +will map the second input stream in @file{INPUT} to the (single) output stream +in @file{out.wav}. -For example, to select the stream with index 2 from input file -@file{a.mov} (specified by the identifier "0:2"), and stream with -index 6 from input @file{b.mov} (specified by the identifier "1:6"), -and copy them to the output file @file{out.mov}: +@item create multiple streams +To select the stream with index 2 from input file @file{a.mov} (specified by the +identifier @var{0:2}), and stream with index 6 from input @file{b.mov} +(specified by the identifier @var{1:6}), and copy them to the output file +@file{out.mov}: @example ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov @end example +@item create multiple streams 2 To select all video and the third audio stream from an input file: @example ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT @end example +@item negative map To map all the streams except the second audio, use negative mappings @example ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT @end example +@item optional map To map the video and audio streams from the first input, and using the trailing @code{?}, ignore the audio mapping if no audio streams exist in the first input: @@ -1475,12 +1538,13 @@ ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT @end example +@item map by language To pick the English audio stream: @example ffmpeg -i INPUT -map 0:m:language:eng OUTPUT @end example -Note that using this option disables the default mappings for this output file. +@end table @item -ignore_unknown Ignore input streams with unknown type instead of failing if copying @@ -1491,6 +1555,10 @@ such streams is attempted. @item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][?][:@var{output_file_id}.@var{stream_specifier}] +This option is deprecated and will be removed. It can be replaced by the +@var{pan} filter. In some cases it may be easier to use some combination of the +@var{channelsplit}, @var{channelmap}, or @var{amerge} filters. + Map an audio channel from a given input to an output. If @var{output_file_id}.@var{stream_specifier} is not set, the audio channel will be mapped on all the audio streams. @@ -1674,18 +1742,6 @@ of noisy timestamps or to increase frame drop precision in case of exact timestamps. -@item -async @var{samples_per_second} -Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, -the parameter is the maximum samples per second by which the audio is changed. --async 1 is a special case where only the start of the audio stream is corrected -without any later correction. - -Note that the timestamps may be further modified by the muxer, after this. -For example, in the case that the format option @option{avoid_negative_ts} -is enabled. - -This option has been deprecated. Use the @code{aresample} audio filter instead. - @item -adrift_threshold @var{time} Set the minimum difference between timestamps and audio data (in seconds) to trigger adding/dropping samples to make it match the timestamps. This option effectively is @@ -1765,6 +1821,22 @@ Enable bitexact mode for (de)muxer and (de/en)coder @item -shortest (@emph{output}) Finish encoding when the shortest output stream ends. + +Note that this option may require buffering frames, which introduces extra +latency. The maximum amount of this latency may be controlled with the +@code{-shortest_buf_duration} option. + +@item -shortest_buf_duration @var{duration} (@emph{output}) +The @code{-shortest} option may require buffering potentially large amounts +of data when at least one of the streams is "sparse" (i.e. has large gaps +between frames – this is typically the case for subtitles). + +This option controls the maximum duration of buffered frames in seconds. +Larger values may allow the @code{-shortest} option to produce more accurate +results, but increase memory use and latency. + +The default value is 10 seconds. + @item -dts_delta_threshold Timestamp discontinuity delta threshold. @item -dts_error_threshold @var{seconds} @@ -1899,13 +1971,16 @@ offset by the start time of the file. This matters only for files which do not start from timestamp 0, such as transport streams. -@item -thread_queue_size @var{size} (@emph{input}) -This option sets the maximum number of queued packets when reading from the -file or device. With low latency / high rate live streams, packets may be -discarded if they are not read in a timely manner; setting this value can +@item -thread_queue_size @var{size} (@emph{input/output}) +For input, this option sets the maximum number of queued packets when reading +from the file or device. With low latency / high rate live streams, packets may +be discarded if they are not read in a timely manner; setting this value can force ffmpeg to use a separate input thread and read packets as soon as they arrive. By default ffmpeg only does this if multiple inputs are specified. +For output, this option specified the maximum number of packets that may be +queued to each muxing thread. + @item -sdp_file @var{file} (@emph{global}) Print sdp information for an output stream to @var{file}. This allows dumping sdp information when at least one output isn't an @@ -1986,6 +2061,116 @@ values that do not match the stream properties may result in encoding failures or invalid output files. +@item -stats_enc_pre[:@var{stream_specifier}] @var{path} (@emph{output,per-stream}) +@item -stats_enc_post[:@var{stream_specifier}] @var{path} (@emph{output,per-stream}) +@item -stats_mux_pre[:@var{stream_specifier}] @var{path} (@emph{output,per-stream}) +Write per-frame encoding information about the matching streams into the file +given by @var{path}. + +@option{-stats_enc_pre} writes information about raw video or audio frames right +before they are sent for encoding, while @option{-stats_enc_post} writes +information about encoded packets as they are received from the encoder. +@option{-stats_mux_pre} writes information about packets just as they are about to +be sent to the muxer. Every frame or packet produces one line in the specified +file. The format of this line is controlled by @option{-stats_enc_pre_fmt} / +@option{-stats_enc_post_fmt} / @option{-stats_mux_pre_fmt}. + +When stats for multiple streams are written into a single file, the lines +corresponding to different streams will be interleaved. The precise order of +this interleaving is not specified and not guaranteed to remain stable between +different invocations of the program, even with the same options. + +@item -stats_enc_pre_fmt[:@var{stream_specifier}] @var{format_spec} (@emph{output,per-stream}) +@item -stats_enc_post_fmt[:@var{stream_specifier}] @var{format_spec} (@emph{output,per-stream}) +@item -stats_mux_pre_fmt[:@var{stream_specifier}] @var{format_spec} (@emph{output,per-stream}) +Specify the format for the lines written with @option{-stats_enc_pre} / +@option{-stats_enc_post} / @option{-stats_mux_pre}. + +@var{format_spec} is a string that may contain directives of the form +@var{@{fmt@}}. @var{format_spec} is backslash-escaped --- use \@{, \@}, and \\ +to write a literal @{, @}, or \, respectively, into the output. + +The directives given with @var{fmt} may be one of the following: +@table @option +@item fidx +Index of the output file. + +@item sidx +Index of the output stream in the file. + +@item n +Frame number. Pre-encoding: number of frames sent to the encoder so far. +Post-encoding: number of packets received from the encoder so far. +Muxing: number of packets submitted to the muxer for this stream so far. + +@item ni +Input frame number. Index of the input frame (i.e. output by a decoder) that +corresponds to this output frame or packet. -1 if unavailable. + +@item tb +Encoder timebase, as a rational number @var{num/den}. Note that this may be +different from the timebase used by the muxer. + +@item tbi +Timebase for @var{ptsi}, as a rational number @var{num/den}. Available when +@var{ptsi} is available, @var{0/1} otherwise. + +@item pts +Presentation timestamp of the frame or packet, as an integer. Should be +multiplied by the timebase to compute presentation time. + +@item ptsi +Presentation timestamp of the input frame (see @var{ni}), as an integer. Should +be multiplied by @var{tbi} to compute presentation time. Printed as +(2^63 - 1 = 9223372036854775807) when not available. + +@item t +Presentation time of the frame or packet, as a decimal number. Equal to +@var{pts} multiplied by @var{tb}. + +@item ti +Presentation time of the input frame (see @var{ni}), as a decimal number. Equal +to @var{ptsi} multiplied by @var{tbi}. Printed as inf when not available. + +@item dts +Decoding timestamp of the packet, as an integer. Should be multiplied by the +timebase to compute presentation time. Post-encoding only. + +@item dt +Decoding time of the frame or packet, as a decimal number. Equal to +@var{dts} multiplied by @var{tb}. + +@item sn +Number of audio samples sent to the encoder so far. Audio and pre-encoding only. + +@item samp +Number of audio samples in the frame. Audio and pre-encoding only. + +@item size +Size of the encoded packet in bytes. Post-encoding only. + +@item br +Current bitrate in bits per second. Post-encoding only. + +@item abr +Average bitrate for the whole stream so far, in bits per second, -1 if it cannot +be determined at this point. Post-encoding only. +@end table + +The default format strings are: +@table @option +@item pre-encoding +@{fidx@} @{sidx@} @{n@} @{t@} +@item post-encoding +@{fidx@} @{sidx@} @{n@} @{t@} +@end table +In the future, new items may be added to the end of the default formatting +strings. Users who depend on the format staying exactly the same, should +prescribe it manually. + +Note that stats for different streams written into the same file may have +different formats. + @end table @section Preset files diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/ffprobe.xsd mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/ffprobe.xsd --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/ffprobe.xsd 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/ffprobe.xsd 2023-03-03 13:29:59.000000000 +0000 @@ -92,6 +92,8 @@ + + @@ -244,6 +246,7 @@ + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/filters.texi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/filters.texi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/doc/filters.texi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/doc/filters.texi 2023-03-03 13:29:59.000000000 +0000 @@ -171,6 +171,17 @@ terminated when the next special character (belonging to the set @samp{[]=;,}) is encountered. +A special syntax implemented in the @command{ffmpeg} CLI tool allows loading +option values from files. This is done be prepending a slash '/' to the option +name, then the supplied value is interpreted as a path from which the actual +value is loaded. E.g. +@example +ffmpeg -i -vf drawtext=/text=/tmp/some_text +@end example +will load the text to be drawn from @file{/tmp/some_text}. API users wishing to +implement a similar feature should use the @code{avfilter_graph_segment_*()} +functions together with custom IO code. + The name and arguments of the filter are optionally preceded and followed by a list of link labels. A link label allows one to name a link and associate it to a filter output @@ -350,6 +361,19 @@ If set to 1, force the filter to extend the last frame of secondary streams until the end of the primary stream. A value of 0 disables this behavior. Default value is 1. + +@item ts_sync_mode +How strictly to sync streams based on secondary input timestamps; it accepts +one of the following values: + +@table @option +@item default +Frame from secondary input with the nearest lower or equal timestamp to the +primary input frame. +@item nearest +Frame from secondary input with the absolute nearest timestamp to the primary +input frame. +@end table @end table @c man end OPTIONS FOR FILTERS WITH SEVERAL INPUTS @@ -859,6 +883,91 @@ Applying both filters one after another produces original audio. +@section adrc + +Apply spectral dynamic range controller filter to input audio stream. + +A description of the accepted options follows. + +@table @option +@item transfer +Set the transfer expression. + +The expression can contain the following constants: + +@table @option +@item ch +current channel number + +@item sn +current sample number + +@item nb_channels +number of channels + +@item t +timestamp expressed in seconds + +@item sr +sample rate + +@item p +current frequency power value, in dB + +@item f +current frequency in Hz +@end table + +Default value is @code{p}. + +@item attack +Set the attack in milliseconds. Default is @code{50} milliseconds. +Allowed range is from 1 to 1000 milliseconds. +@item release +Set the release in milliseconds. Default is @code{100} milliseconds. +Allowed range is from 5 to 2000 milliseconds. +@item channels +Set which channels to filter, by default @code{all} channels in audio stream are filtered. +@end table + +@subsection Commands + +This filter supports the all above options as @ref{commands}. + +@subsection Examples + +@itemize +@item +Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio: +@example +adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100 +@end example + +@item +Similar to above but with 1:2 ratio and filtering only front center channel: +@example +adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC +@end example + +@item +Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time: +@example +adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5 +@end example + +@item +Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio: +@example +adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100 +@end example + +@item +Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms: +@example +adrc=transfer='min(p,-60)':attack=2:release=10 +@end example +@end itemize + @section adynamicequalizer Apply dynamic equalization to input audio stream. @@ -897,25 +1006,17 @@ detection threshold before equalization ends. Default is 200. Allowed range is between 1 and 2000. -@item knee -Curve the sharp knee around the detection threshold to calculate -equalization gain more softly. -Default is 1. Allowed range is between 0 and 8. - @item ratio Set the ratio by which the equalization gain is raised. -Default is 1. Allowed range is between 1 and 20. +Default is 1. Allowed range is between 0 and 30. @item makeup -Set the makeup offset in dB by which the equalization gain is raised. -Default is 0. Allowed range is between 0 and 30. +Set the makeup offset by which the equalization gain is raised. +Default is 0. Allowed range is between 0 and 100. @item range -Set the max allowed cut/boost amount in dB. Default is 0. -Allowed range is from 0 to 200. - -@item slew -Set the slew factor. Default is 1. Allowed range is from 1 to 200. +Set the max allowed cut/boost amount. Default is 50. +Allowed range is from 1 to 200. @item mode Set the mode of filter operation, can be one of the following: @@ -939,6 +1040,32 @@ @item highshelf @end table Default type is @samp{bell}. + +@item direction +Set processing direction relative to threshold. +@table @samp +@item downward +Boost/Cut if threshold is higher/lower than detected volume. +@item upward +Boost/Cut if threshold is lower/higher than detected volume. +@end table +Default direction is @samp{downward}. + +@item auto +Automatically gather threshold from detection filter. By default +is @samp{disabled}. +This option is useful to detect threshold in certain time frame of +input audio stream, in such case option value is changed at runtime. + +Available values are: +@table @samp +@item disabled +Disable using automatically gathered threshold value. +@item off +Stop picking threshold value. +@item on +Start picking threshold value. +@end table @end table @subsection Commands @@ -1280,6 +1407,14 @@ @item nofade no fade applied @end table + +@item silence +Set the initial gain for fade-in or final gain for fade-out. +Default value is @code{0.0}. + +@item unity +Set the initial gain for fade-out or final gain for fade-in. +Default value is @code{1.0}. @end table @subsection Commands @@ -1532,6 +1667,7 @@ @item parzen @item poisson @item bohman +@item kaiser @end table Default is @code{hann}. @@ -1560,6 +1696,12 @@ @example afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8" @end example + +@item +Apply phase shift: +@example +afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)" +@end example @end itemize @anchor{afir} @@ -1609,6 +1751,12 @@ @item gn select gain to noise approach, this is most popular one. + +@item ac +select AC gain. + +@item rms +select RMS gain. @end table @item irgain @@ -1639,12 +1787,12 @@ @item minp Set minimal partition size used for convolution. Default is @var{8192}. -Allowed range is from @var{1} to @var{32768}. +Allowed range is from @var{1} to @var{65536}. Lower values decreases latency at cost of higher CPU usage. @item maxp Set maximal partition size used for convolution. Default is @var{8192}. -Allowed range is from @var{8} to @var{32768}. +Allowed range is from @var{8} to @var{65536}. Lower values may increase CPU usage. @item nbirs @@ -1681,6 +1829,13 @@ @example ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav @end example + +@item +Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, +the impulse response files are files with names l_ir.wav and r_ir.wav: +@example +"pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FLnb_groups = nb_groups; octx->groups = av_calloc(octx->nb_groups, sizeof(*octx->groups)); if (!octx->groups) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); for (i = 0; i < octx->nb_groups; i++) octx->groups[i].group_def = &groups[i]; @@ -792,12 +798,7 @@ void print_error(const char *filename, int err) { - char errbuf[128]; - const char *errbuf_ptr = errbuf; - - if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) - errbuf_ptr = strerror(AVUNERROR(err)); - av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); + av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, av_err2str(err)); } int read_yesno(void) @@ -920,7 +921,7 @@ break; } - while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) { + while (t = av_dict_iterate(opts, t)) { const AVClass *priv_class; char *p = strchr(t->key, ':'); @@ -958,11 +959,8 @@ if (!s->nb_streams) return NULL; opts = av_calloc(s->nb_streams, sizeof(*opts)); - if (!opts) { - av_log(NULL, AV_LOG_ERROR, - "Could not alloc memory for stream options.\n"); - exit_program(1); - } + if (!opts) + report_and_exit(AVERROR(ENOMEM)); for (i = 0; i < s->nb_streams; i++) opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id, s, s->streams[i], NULL); @@ -977,10 +975,8 @@ } if (*size < new_size) { uint8_t *tmp = av_realloc_array(array, new_size, elem_size); - if (!tmp) { - av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); - exit_program(1); - } + if (!tmp) + report_and_exit(AVERROR(ENOMEM)); memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); *size = new_size; return tmp; @@ -993,10 +989,8 @@ void *new_elem; if (!(new_elem = av_mallocz(elem_size)) || - av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0) { - av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); - exit_program(1); - } + av_dynarray_add_nofree(ptr, nb_elems, new_elem) < 0) + report_and_exit(AVERROR(ENOMEM)); return new_elem; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/cmdutils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/cmdutils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/cmdutils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/cmdutils.h 2023-03-03 13:29:59.000000000 +0000 @@ -55,6 +55,17 @@ void register_exit(void (*cb)(int ret)); /** + * Reports an error corresponding to the provided + * AVERROR code and calls exit_program() with the + * corresponding POSIX error code. + * @note ret must be an AVERROR-value of a POSIX error code + * (i.e. AVERROR(EFOO) and not AVERROR_FOO). + * library functions can return both, so call this only + * with AVERROR(EFOO) of your own. + */ +void report_and_exit(int ret) av_noreturn; + +/** * Wraps exit with a program-specific cleanup routine. */ void exit_program(int ret) av_noreturn; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -104,6 +104,7 @@ #include "ffmpeg.h" #include "cmdutils.h" +#include "sync_queue.h" #include "libavutil/avassert.h" @@ -112,14 +113,12 @@ static FILE *vstats_file; -const char *const forced_keyframes_const_names[] = { - "n", - "n_forced", - "prev_forced_n", - "prev_forced_t", - "t", - NULL -}; +// optionally attached as opaque_ref to decoded AVFrames +typedef struct FrameData { + uint64_t idx; + int64_t pts; + AVRational tb; +} FrameData; typedef struct BenchmarkTimeStamps { int64_t real_usec; @@ -127,6 +126,7 @@ int64_t sys_usec; } BenchmarkTimeStamps; +static int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt); static BenchmarkTimeStamps get_benchmark_time_stamps(void); static int64_t getmaxrss(void); static int ifilter_has_all_input_formats(FilterGraph *fg); @@ -137,20 +137,12 @@ static int64_t decode_error_stat[2]; unsigned nb_output_dumped = 0; -int want_sdp = 1; - static BenchmarkTimeStamps current_time; AVIOContext *progress_avio = NULL; -static uint8_t *subtitle_out; - -InputStream **input_streams = NULL; -int nb_input_streams = 0; InputFile **input_files = NULL; int nb_input_files = 0; -OutputStream **output_streams = NULL; -int nb_output_streams = 0; OutputFile **output_files = NULL; int nb_output_files = 0; @@ -164,10 +156,6 @@ static int restore_tty; #endif -#if HAVE_THREADS -static void free_input_threads(void); -#endif - /* sub2video hack: Convert subtitles to video with alpha to insert them in filter graphs. This is a temporary solution until libavfilter gets real subtitles support. @@ -264,7 +252,7 @@ num_rects = 0; } if (sub2video_get_blank_frame(ist) < 0) { - av_log(ist->dec_ctx, AV_LOG_ERROR, + av_log(NULL, AV_LOG_ERROR, "Impossible to get a blank canvas.\n"); return; } @@ -288,7 +276,7 @@ video frames could be accumulating in the filter graph while a filter (possibly overlay) is desperately waiting for a subtitle frame. */ for (i = 0; i < infile->nb_streams; i++) { - InputStream *ist2 = input_streams[infile->ist_index + i]; + InputStream *ist2 = infile->streams[i]; if (!ist2->sub2video.frame) continue; /* subtitles seem to be usually muxed ahead of other streams; @@ -560,72 +548,12 @@ } av_freep(&filtergraphs); - av_freep(&subtitle_out); - /* close files */ for (i = 0; i < nb_output_files; i++) of_close(&output_files[i]); - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - - if (!ost) - continue; - - av_bsf_free(&ost->bsf_ctx); - - av_frame_free(&ost->filtered_frame); - av_frame_free(&ost->last_frame); - av_packet_free(&ost->pkt); - av_dict_free(&ost->encoder_opts); - - av_freep(&ost->forced_keyframes); - av_expr_free(ost->forced_keyframes_pexpr); - av_freep(&ost->avfilter); - av_freep(&ost->logfile_prefix); - - av_freep(&ost->audio_channels_map); - ost->audio_channels_mapped = 0; - - av_dict_free(&ost->sws_dict); - av_dict_free(&ost->swr_opts); - - avcodec_free_context(&ost->enc_ctx); - avcodec_parameters_free(&ost->ref_par); - - if (ost->muxing_queue) { - AVPacket *pkt; - while (av_fifo_read(ost->muxing_queue, &pkt, 1) >= 0) - av_packet_free(&pkt); - av_fifo_freep2(&ost->muxing_queue); - } - - av_freep(&output_streams[i]); - } -#if HAVE_THREADS - free_input_threads(); -#endif - for (i = 0; i < nb_input_files; i++) { - avformat_close_input(&input_files[i]->ctx); - av_packet_free(&input_files[i]->pkt); - av_freep(&input_files[i]); - } - for (i = 0; i < nb_input_streams; i++) { - InputStream *ist = input_streams[i]; - - av_frame_free(&ist->decoded_frame); - av_packet_free(&ist->pkt); - av_dict_free(&ist->decoder_opts); - avsubtitle_free(&ist->prev_sub.subtitle); - av_frame_free(&ist->sub2video.frame); - av_freep(&ist->filters); - av_freep(&ist->hwaccel_device); - av_freep(&ist->dts_buffer); - - avcodec_free_context(&ist->dec_ctx); - - av_freep(&input_streams[i]); - } + for (i = 0; i < nb_input_files; i++) + ifile_close(&input_files[i]); if (vstats_file) { if (fclose(vstats_file)) @@ -634,11 +562,11 @@ av_err2str(AVERROR(errno))); } av_freep(&vstats_filename); + of_enc_stats_close(); + av_freep(&filter_nbthreads); - av_freep(&input_streams); av_freep(&input_files); - av_freep(&output_streams); av_freep(&output_files); uninit_opts(); @@ -655,11 +583,45 @@ ffmpeg_exited = 1; } +/* iterate over all output streams in all output files; + * pass NULL to start iteration */ +static OutputStream *ost_iter(OutputStream *prev) +{ + int of_idx = prev ? prev->file_index : 0; + int ost_idx = prev ? prev->index + 1 : 0; + + for (; of_idx < nb_output_files; of_idx++) { + OutputFile *of = output_files[of_idx]; + if (ost_idx < of->nb_streams) + return of->streams[ost_idx]; + + ost_idx = 0; + } + + return NULL; +} + +InputStream *ist_iter(InputStream *prev) +{ + int if_idx = prev ? prev->file_index : 0; + int ist_idx = prev ? prev->st->index + 1 : 0; + + for (; if_idx < nb_input_files; if_idx++) { + InputFile *f = input_files[if_idx]; + if (ist_idx < f->nb_streams) + return f->streams[ist_idx]; + + ist_idx = 0; + } + + return NULL; +} + void remove_avoptions(AVDictionary **a, AVDictionary *b) { const AVDictionaryEntry *t = NULL; - while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(b, t))) { av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE); } } @@ -702,59 +664,18 @@ static void close_output_stream(OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; - AVRational time_base = ost->stream_copy ? ost->mux_timebase : ost->enc_ctx->time_base; - ost->finished |= ENCODER_FINISHED; - if (of->shortest) { - int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, time_base, AV_TIME_BASE_Q); - of->recording_time = FFMIN(of->recording_time, end); - } -} - -/* - * Send a single packet to the output, applying any bitstream filters - * associated with the output stream. This may result in any number - * of packets actually being written, depending on what bitstream - * filters are applied. The supplied packet is consumed and will be - * blank (as if newly-allocated) when this function returns. - * - * If eof is set, instead indicate EOF to all bitstream filters and - * therefore flush any delayed packets to the output. A blank packet - * must be supplied in this case. - */ -static void output_packet(OutputFile *of, AVPacket *pkt, - OutputStream *ost, int eof) -{ - int ret = 0; - /* apply the output bitstream filters */ - if (ost->bsf_ctx) { - ret = av_bsf_send_packet(ost->bsf_ctx, eof ? NULL : pkt); - if (ret < 0) - goto finish; - while ((ret = av_bsf_receive_packet(ost->bsf_ctx, pkt)) >= 0) - of_write_packet(of, pkt, ost, 0); - if (ret == AVERROR(EAGAIN)) - ret = 0; - } else if (!eof) - of_write_packet(of, pkt, ost, 0); - -finish: - if (ret < 0 && ret != AVERROR_EOF) { - av_log(NULL, AV_LOG_ERROR, "Error applying bitstream filters to an output " - "packet for stream #%d:%d.\n", ost->file_index, ost->index); - if(exit_on_error) - exit_program(1); - } + if (ost->sq_idx_encode >= 0) + sq_send(of->sq_encode, ost->sq_idx_encode, SQFRAME(NULL)); } -static int check_recording_time(OutputStream *ost) +static int check_recording_time(OutputStream *ost, int64_t ts, AVRational tb) { OutputFile *of = output_files[ost->file_index]; if (of->recording_time != INT64_MAX && - av_compare_ts(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, of->recording_time, - AV_TIME_BASE_Q) >= 0) { + av_compare_ts(ts, tb, of->recording_time, AV_TIME_BASE_Q) >= 0) { close_output_stream(ost); return 0; } @@ -765,38 +686,36 @@ AVFrame *frame) { double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision - AVCodecContext *enc = ost->enc_ctx; - if (!frame || frame->pts == AV_NOPTS_VALUE || - !enc || !ost->filter || !ost->filter->graph->graph) - goto early_exit; + const int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? + 0 : of->start_time; - { - AVFilterContext *filter = ost->filter->filter; + AVCodecContext *const enc = ost->enc_ctx; - int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; - AVRational filter_tb = av_buffersink_get_time_base(filter); - AVRational tb = enc->time_base; - int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16); - - tb.den <<= extra_bits; - float_pts = - av_rescale_q(frame->pts, filter_tb, tb) - - av_rescale_q(start_time, AV_TIME_BASE_Q, tb); - float_pts /= 1 << extra_bits; - // avoid exact midoints to reduce the chance of rounding differences, this can be removed in case the fps code is changed to work with integers - float_pts += FFSIGN(float_pts) * 1.0 / (1<<17); + AVRational tb = enc->time_base; + AVRational filter_tb = frame->time_base; + const int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16); - frame->pts = - av_rescale_q(frame->pts, filter_tb, enc->time_base) - - av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); - } + if (frame->pts == AV_NOPTS_VALUE) + goto early_exit; + + tb.den <<= extra_bits; + float_pts = av_rescale_q(frame->pts, filter_tb, tb) - + av_rescale_q(start_time, AV_TIME_BASE_Q, tb); + float_pts /= 1 << extra_bits; + // avoid exact midoints to reduce the chance of rounding differences, this + // can be removed in case the fps code is changed to work with integers + float_pts += FFSIGN(float_pts) * 1.0 / (1<<17); + + frame->pts = av_rescale_q(frame->pts, filter_tb, enc->time_base) - + av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); + frame->time_base = enc->time_base; early_exit: if (debug_ts) { av_log(NULL, AV_LOG_INFO, "filter -> pts:%s pts_time:%s exact:%f time_base:%d/%d\n", frame ? av_ts2str(frame->pts) : "NULL", - frame ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", + (enc && frame) ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", float_pts, enc ? enc->time_base.num : -1, enc ? enc->time_base.den : -1); @@ -819,8 +738,8 @@ ret = init_output_stream(ost, frame, error, sizeof(error)); if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n", - ost->file_index, ost->index, error); + av_log(ost, AV_LOG_ERROR, "Error initializing output stream: %s\n", + error); if (fatal) exit_program(1); @@ -878,17 +797,83 @@ fprintf(vstats_file,"f_size= %6d ", pkt->size); /* compute pts value */ - ti1 = pkt->dts * av_q2d(ost->mux_timebase); + ti1 = pkt->dts * av_q2d(pkt->time_base); if (ti1 < 0.01) ti1 = 0.01; bitrate = (pkt->size * 8) / av_q2d(enc->time_base) / 1000.0; - avg_bitrate = (double)(ost->data_size * 8) / ti1 / 1000.0; + avg_bitrate = (double)(ost->data_size_enc * 8) / ti1 / 1000.0; fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ", - (double)ost->data_size / 1024, ti1, bitrate, avg_bitrate); + (double)ost->data_size_enc / 1024, ti1, bitrate, avg_bitrate); fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type)); } +void enc_stats_write(OutputStream *ost, EncStats *es, + const AVFrame *frame, const AVPacket *pkt, + uint64_t frame_num) +{ + AVIOContext *io = es->io; + AVRational tb = frame ? frame->time_base : pkt->time_base; + int64_t pts = frame ? frame->pts : pkt->pts; + + AVRational tbi = (AVRational){ 0, 1}; + int64_t ptsi = INT64_MAX; + + const FrameData *fd; + + if ((frame && frame->opaque_ref) || (pkt && pkt->opaque_ref)) { + fd = (const FrameData*)(frame ? frame->opaque_ref->data : pkt->opaque_ref->data); + tbi = fd->tb; + ptsi = fd->pts; + } + + for (size_t i = 0; i < es->nb_components; i++) { + const EncStatsComponent *c = &es->components[i]; + + switch (c->type) { + case ENC_STATS_LITERAL: avio_write (io, c->str, c->str_len); continue; + case ENC_STATS_FILE_IDX: avio_printf(io, "%d", ost->file_index); continue; + case ENC_STATS_STREAM_IDX: avio_printf(io, "%d", ost->index); continue; + case ENC_STATS_TIMEBASE: avio_printf(io, "%d/%d", tb.num, tb.den); continue; + case ENC_STATS_TIMEBASE_IN: avio_printf(io, "%d/%d", tbi.num, tbi.den); continue; + case ENC_STATS_PTS: avio_printf(io, "%"PRId64, pts); continue; + case ENC_STATS_PTS_IN: avio_printf(io, "%"PRId64, ptsi); continue; + case ENC_STATS_PTS_TIME: avio_printf(io, "%g", pts * av_q2d(tb)); continue; + case ENC_STATS_PTS_TIME_IN: avio_printf(io, "%g", ptsi == INT64_MAX ? + INFINITY : ptsi * av_q2d(tbi)); continue; + case ENC_STATS_FRAME_NUM: avio_printf(io, "%"PRIu64, frame_num); continue; + case ENC_STATS_FRAME_NUM_IN: avio_printf(io, "%"PRIu64, fd ? fd->idx : -1); continue; + } + + if (frame) { + switch (c->type) { + case ENC_STATS_SAMPLE_NUM: avio_printf(io, "%"PRIu64, ost->samples_encoded); continue; + case ENC_STATS_NB_SAMPLES: avio_printf(io, "%d", frame->nb_samples); continue; + default: av_assert0(0); + } + } else { + switch (c->type) { + case ENC_STATS_DTS: avio_printf(io, "%"PRId64, pkt->dts); continue; + case ENC_STATS_DTS_TIME: avio_printf(io, "%g", pkt->dts * av_q2d(tb)); continue; + case ENC_STATS_PKT_SIZE: avio_printf(io, "%d", pkt->size); continue; + case ENC_STATS_BITRATE: { + double duration = FFMAX(pkt->duration, 1) * av_q2d(tb); + avio_printf(io, "%g", 8.0 * pkt->size / duration); + continue; + } + case ENC_STATS_AVG_BITRATE: { + double duration = pkt->dts * av_q2d(tb); + avio_printf(io, "%g", duration > 0 ? 8.0 * ost->data_size_enc / duration : -1.); + continue; + } + default: av_assert0(0); + } + } + } + avio_w8(io, '\n'); + avio_flush(io); +} + static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame) { AVCodecContext *enc = ost->enc_ctx; @@ -898,10 +883,15 @@ int ret; if (frame) { + if (ost->enc_stats_pre.io) + enc_stats_write(ost, &ost->enc_stats_pre, frame, NULL, + ost->frames_encoded); + ost->frames_encoded++; + ost->samples_encoded += frame->nb_samples; if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "encoder <- type:%s " + av_log(ost, AV_LOG_INFO, "encoder <- type:%s " "frame_pts:%s frame_pts_time:%s time_base:%d/%d\n", type_desc, av_ts2str(frame->pts), av_ts2timestr(frame->pts, &enc->time_base), @@ -913,7 +903,7 @@ ret = avcodec_send_frame(enc, frame); if (ret < 0 && !(ret == AVERROR_EOF && !frame)) { - av_log(NULL, AV_LOG_ERROR, "Error submitting %s frame to the encoder\n", + av_log(ost, AV_LOG_ERROR, "Error submitting %s frame to the encoder\n", type_desc); return ret; } @@ -923,6 +913,8 @@ update_benchmark("%s_%s %d.%d", action, type_desc, ost->file_index, ost->index); + pkt->time_base = enc->time_base; + /* if two pass, output log on success and EOF */ if ((ret >= 0 || ret == AVERROR_EOF) && ost->logfile && enc->stats_out) fprintf(ost->logfile, "%s", enc->stats_out); @@ -931,15 +923,21 @@ av_assert0(frame); // should never happen during flushing return 0; } else if (ret == AVERROR_EOF) { - output_packet(of, pkt, ost, 1); + of_output_packet(of, pkt, ost, 1); return ret; } else if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "%s encoding failed\n", type_desc); + av_log(ost, AV_LOG_ERROR, "%s encoding failed\n", type_desc); return ret; } + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) + update_video_stats(ost, pkt, !!vstats_filename); + if (ost->enc_stats_post.io) + enc_stats_write(ost, &ost->enc_stats_post, NULL, pkt, + ost->packets_encoded); + if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "encoder -> type:%s " + av_log(ost, AV_LOG_INFO, "encoder -> type:%s " "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s " "duration:%s duration_time:%s\n", type_desc, @@ -948,10 +946,11 @@ av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &enc->time_base)); } - av_packet_rescale_ts(pkt, enc->time_base, ost->mux_timebase); + av_packet_rescale_ts(pkt, pkt->time_base, ost->mux_timebase); + pkt->time_base = ost->mux_timebase; if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "encoder -> type:%s " + av_log(ost, AV_LOG_INFO, "encoder -> type:%s " "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s " "duration:%s duration_time:%s\n", type_desc, @@ -960,34 +959,92 @@ av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &enc->time_base)); } - if (enc->codec_type == AVMEDIA_TYPE_VIDEO) - update_video_stats(ost, pkt, !!vstats_filename); + if ((ret = trigger_fix_sub_duration_heartbeat(ost, pkt)) < 0) { + av_log(NULL, AV_LOG_ERROR, + "Subtitle heartbeat logic failed in %s! (%s)\n", + __func__, av_err2str(ret)); + exit_program(1); + } + + ost->data_size_enc += pkt->size; ost->packets_encoded++; - output_packet(of, pkt, ost, 0); + of_output_packet(of, pkt, ost, 0); } av_assert0(0); } +static int submit_encode_frame(OutputFile *of, OutputStream *ost, + AVFrame *frame) +{ + int ret; + + if (ost->sq_idx_encode < 0) + return encode_frame(of, ost, frame); + + if (frame) { + ret = av_frame_ref(ost->sq_frame, frame); + if (ret < 0) + return ret; + frame = ost->sq_frame; + } + + ret = sq_send(of->sq_encode, ost->sq_idx_encode, + SQFRAME(frame)); + if (ret < 0) { + if (frame) + av_frame_unref(frame); + if (ret != AVERROR_EOF) + return ret; + } + + while (1) { + AVFrame *enc_frame = ost->sq_frame; + + ret = sq_receive(of->sq_encode, ost->sq_idx_encode, + SQFRAME(enc_frame)); + if (ret == AVERROR_EOF) { + enc_frame = NULL; + } else if (ret < 0) { + return (ret == AVERROR(EAGAIN)) ? 0 : ret; + } + + ret = encode_frame(of, ost, enc_frame); + if (enc_frame) + av_frame_unref(enc_frame); + if (ret < 0) { + if (ret == AVERROR_EOF) + close_output_stream(ost); + return ret; + } + } +} + static void do_audio_out(OutputFile *of, OutputStream *ost, AVFrame *frame) { + AVCodecContext *enc = ost->enc_ctx; int ret; - adjust_frame_pts_to_encoder_tb(of, ost, frame); + if (frame->pts == AV_NOPTS_VALUE) + frame->pts = ost->next_pts; + else { + int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; + frame->pts = + av_rescale_q(frame->pts, frame->time_base, enc->time_base) - + av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); + } + frame->time_base = enc->time_base; - if (!check_recording_time(ost)) + if (!check_recording_time(ost, frame->pts, frame->time_base)) return; - if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0) - frame->pts = ost->sync_opts; - ost->sync_opts = frame->pts + frame->nb_samples; - ost->samples_encoded += frame->nb_samples; + ost->next_pts = frame->pts + frame->nb_samples; - ret = encode_frame(of, ost, frame); - if (ret < 0) + ret = submit_encode_frame(of, ost, frame); + if (ret < 0 && ret != AVERROR_EOF) exit_program(1); } @@ -996,13 +1053,13 @@ AVSubtitle *sub) { int subtitle_out_max_size = 1024 * 1024; - int subtitle_out_size, nb, i; + int subtitle_out_size, nb, i, ret; AVCodecContext *enc; AVPacket *pkt = ost->pkt; int64_t pts; if (sub->pts == AV_NOPTS_VALUE) { - av_log(NULL, AV_LOG_ERROR, "Subtitle packets must have a pts\n"); + av_log(ost, AV_LOG_ERROR, "Subtitle packets must have a pts\n"); if (exit_on_error) exit_program(1); return; @@ -1010,14 +1067,6 @@ enc = ost->enc_ctx; - if (!subtitle_out) { - subtitle_out = av_malloc(subtitle_out_max_size); - if (!subtitle_out) { - av_log(NULL, AV_LOG_FATAL, "Failed to allocate subtitle_out\n"); - exit_program(1); - } - } - /* Note: DVB subtitle need one packet to draw them and one other packet to clear them */ /* XXX: signal it in the codec context ? */ @@ -1033,10 +1082,13 @@ for (i = 0; i < nb; i++) { unsigned save_num_rects = sub->num_rects; - ost->sync_opts = av_rescale_q(pts, AV_TIME_BASE_Q, enc->time_base); - if (!check_recording_time(ost)) + if (!check_recording_time(ost, pts, AV_TIME_BASE_Q)) return; + ret = av_new_packet(pkt, subtitle_out_max_size); + if (ret < 0) + report_and_exit(AVERROR(ENOMEM)); + sub->pts = pts; // start_display_time is required to be 0 sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q); @@ -1047,33 +1099,156 @@ ost->frames_encoded++; - subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out, - subtitle_out_max_size, sub); + subtitle_out_size = avcodec_encode_subtitle(enc, pkt->data, pkt->size, sub); if (i == 1) sub->num_rects = save_num_rects; if (subtitle_out_size < 0) { - av_log(NULL, AV_LOG_FATAL, "Subtitle encoding failed\n"); + av_log(ost, AV_LOG_FATAL, "Subtitle encoding failed\n"); exit_program(1); } - av_packet_unref(pkt); - pkt->data = subtitle_out; - pkt->size = subtitle_out_size; - pkt->pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->mux_timebase); - pkt->duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase); + av_shrink_packet(pkt, subtitle_out_size); + pkt->time_base = ost->mux_timebase; + pkt->pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, pkt->time_base); + pkt->duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, pkt->time_base); if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) { /* XXX: the pts correction is handled here. Maybe handling it in the codec would be better */ if (i == 0) - pkt->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase); + pkt->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, pkt->time_base); else - pkt->pts += av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->mux_timebase); + pkt->pts += av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, pkt->time_base); } pkt->dts = pkt->pts; - output_packet(of, pkt, ost, 0); + + of_output_packet(of, pkt, ost, 0); + } +} + +/* Convert frame timestamps to the encoder timebase and decide how many times + * should this (and possibly previous) frame be repeated in order to conform to + * desired target framerate (if any). + */ +static void video_sync_process(OutputFile *of, OutputStream *ost, + AVFrame *next_picture, double duration, + int64_t *nb_frames, int64_t *nb_frames_prev) +{ + double delta0, delta; + + double sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, next_picture); + /* delta0 is the "drift" between the input frame (next_picture) and + * where it would fall in the output. */ + delta0 = sync_ipts - ost->next_pts; + delta = delta0 + duration; + + // tracks the number of times the PREVIOUS frame should be duplicated, + // mostly for variable framerate (VFR) + *nb_frames_prev = 0; + /* by default, we output a single frame */ + *nb_frames = 1; + + if (delta0 < 0 && + delta > 0 && + ost->vsync_method != VSYNC_PASSTHROUGH && + ost->vsync_method != VSYNC_DROP) { + if (delta0 < -0.6) { + av_log(ost, AV_LOG_VERBOSE, "Past duration %f too large\n", -delta0); + } else + av_log(ost, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0); + sync_ipts = ost->next_pts; + duration += delta0; + delta0 = 0; + } + + switch (ost->vsync_method) { + case VSYNC_VSCFR: + if (ost->vsync_frame_number == 0 && delta0 >= 0.5) { + av_log(ost, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0)); + delta = duration; + delta0 = 0; + ost->next_pts = llrint(sync_ipts); + } + case VSYNC_CFR: + // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c + if (frame_drop_threshold && delta < frame_drop_threshold && ost->vsync_frame_number) { + *nb_frames = 0; + } else if (delta < -1.1) + *nb_frames = 0; + else if (delta > 1.1) { + *nb_frames = llrintf(delta); + if (delta0 > 1.1) + *nb_frames_prev = llrintf(delta0 - 0.6); + } + next_picture->duration = 1; + break; + case VSYNC_VFR: + if (delta <= -0.6) + *nb_frames = 0; + else if (delta > 0.6) + ost->next_pts = llrint(sync_ipts); + next_picture->duration = duration; + break; + case VSYNC_DROP: + case VSYNC_PASSTHROUGH: + next_picture->duration = duration; + ost->next_pts = llrint(sync_ipts); + break; + default: + av_assert0(0); } } +static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf, + AVRational tb, const AVFrame *in_picture, + int dup_idx) +{ + double pts_time; + + if (kf->ref_pts == AV_NOPTS_VALUE) + kf->ref_pts = in_picture->pts; + + pts_time = (in_picture->pts - kf->ref_pts) * av_q2d(tb); + if (kf->index < kf->nb_pts && + av_compare_ts(in_picture->pts, tb, kf->pts[kf->index], AV_TIME_BASE_Q) >= 0) { + kf->index++; + goto force_keyframe; + } else if (kf->pexpr) { + double res; + kf->expr_const_values[FKF_T] = pts_time; + res = av_expr_eval(kf->pexpr, + kf->expr_const_values, NULL); + ff_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n", + kf->expr_const_values[FKF_N], + kf->expr_const_values[FKF_N_FORCED], + kf->expr_const_values[FKF_PREV_FORCED_N], + kf->expr_const_values[FKF_T], + kf->expr_const_values[FKF_PREV_FORCED_T], + res); + + kf->expr_const_values[FKF_N] += 1; + + if (res) { + kf->expr_const_values[FKF_PREV_FORCED_N] = kf->expr_const_values[FKF_N] - 1; + kf->expr_const_values[FKF_PREV_FORCED_T] = kf->expr_const_values[FKF_T]; + kf->expr_const_values[FKF_N_FORCED] += 1; + goto force_keyframe; + } + } else if (kf->type == KF_FORCE_SOURCE && + in_picture->key_frame == 1 && !dup_idx) { + goto force_keyframe; + } else if (kf->type == KF_FORCE_SOURCE_NO_DROP && !dup_idx) { + kf->dropped_keyframe = 0; + if ((in_picture->key_frame == 1) || kf->dropped_keyframe) + goto force_keyframe; + } + + return AV_PICTURE_TYPE_NONE; + +force_keyframe: + av_log(logctx, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time); + return AV_PICTURE_TYPE_I; +} + /* May modify/reset next_picture */ static void do_video_out(OutputFile *of, OutputStream *ost, @@ -1082,18 +1257,12 @@ int ret; AVCodecContext *enc = ost->enc_ctx; AVRational frame_rate; - int64_t nb_frames, nb0_frames, i; - double delta, delta0; + int64_t nb_frames, nb_frames_prev, i; double duration = 0; - double sync_ipts = AV_NOPTS_VALUE; - InputStream *ist = NULL; + InputStream *ist = ost->ist; AVFilterContext *filter = ost->filter->filter; init_output_stream_wrapper(ost, next_picture, 1); - sync_ipts = adjust_frame_pts_to_encoder_tb(of, ost, next_picture); - - if (ost->source_index >= 0) - ist = input_streams[ost->source_index]; frame_rate = av_buffersink_get_frame_rate(filter); if (frame_rate.num > 0 && frame_rate.den > 0) @@ -1107,113 +1276,52 @@ (nb_filtergraphs == 0 || !filtergraphs[0]->graph_desc) && next_picture && ist && - lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { - duration = lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); + lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) { + duration = lrintf(next_picture->duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)); } if (!next_picture) { //end, flushing - nb0_frames = nb_frames = mid_pred(ost->last_nb0_frames[0], - ost->last_nb0_frames[1], - ost->last_nb0_frames[2]); + nb_frames_prev = nb_frames = mid_pred(ost->last_nb0_frames[0], + ost->last_nb0_frames[1], + ost->last_nb0_frames[2]); } else { - delta0 = sync_ipts - ost->sync_opts; // delta0 is the "drift" between the input frame (next_picture) and where it would fall in the output. - delta = delta0 + duration; - - /* by default, we output a single frame */ - nb0_frames = 0; // tracks the number of times the PREVIOUS frame should be duplicated, mostly for variable framerate (VFR) - nb_frames = 1; - - if (delta0 < 0 && - delta > 0 && - ost->vsync_method != VSYNC_PASSTHROUGH && - ost->vsync_method != VSYNC_DROP) { - if (delta0 < -0.6) { - av_log(NULL, AV_LOG_VERBOSE, "Past duration %f too large\n", -delta0); - } else - av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0); - sync_ipts = ost->sync_opts; - duration += delta0; - delta0 = 0; - } - - switch (ost->vsync_method) { - case VSYNC_VSCFR: - if (ost->frame_number == 0 && delta0 >= 0.5) { - av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0)); - delta = duration; - delta0 = 0; - ost->sync_opts = llrint(sync_ipts); - } - case VSYNC_CFR: - // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c - if (frame_drop_threshold && delta < frame_drop_threshold && ost->frame_number) { - nb_frames = 0; - } else if (delta < -1.1) - nb_frames = 0; - else if (delta > 1.1) { - nb_frames = llrintf(delta); - if (delta0 > 1.1) - nb0_frames = llrintf(delta0 - 0.6); - } - break; - case VSYNC_VFR: - if (delta <= -0.6) - nb_frames = 0; - else if (delta > 0.6) - ost->sync_opts = llrint(sync_ipts); - break; - case VSYNC_DROP: - case VSYNC_PASSTHROUGH: - ost->sync_opts = llrint(sync_ipts); - break; - default: - av_assert0(0); - } + video_sync_process(of, ost, next_picture, duration, + &nb_frames, &nb_frames_prev); } - /* - * For video, number of frames in == number of packets out. - * But there may be reordering, so we can't throw away frames on encoder - * flush, we need to limit them here, before they go into encoder. - */ - nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number); - nb0_frames = FFMIN(nb0_frames, nb_frames); - memmove(ost->last_nb0_frames + 1, ost->last_nb0_frames, sizeof(ost->last_nb0_frames[0]) * (FF_ARRAY_ELEMS(ost->last_nb0_frames) - 1)); - ost->last_nb0_frames[0] = nb0_frames; + ost->last_nb0_frames[0] = nb_frames_prev; - if (nb0_frames == 0 && ost->last_dropped) { + if (nb_frames_prev == 0 && ost->last_dropped) { nb_frames_drop++; - av_log(NULL, AV_LOG_VERBOSE, - "*** dropping frame %"PRId64" from stream %d at ts %"PRId64"\n", - ost->frame_number, ost->st->index, ost->last_frame->pts); + av_log(ost, AV_LOG_VERBOSE, + "*** dropping frame %"PRId64" at ts %"PRId64"\n", + ost->vsync_frame_number, ost->last_frame->pts); } - if (nb_frames > (nb0_frames && ost->last_dropped) + (nb_frames > nb0_frames)) { + if (nb_frames > (nb_frames_prev && ost->last_dropped) + (nb_frames > nb_frames_prev)) { if (nb_frames > dts_error_threshold * 30) { - av_log(NULL, AV_LOG_ERROR, "%"PRId64" frame duplication too large, skipping\n", nb_frames - 1); + av_log(ost, AV_LOG_ERROR, "%"PRId64" frame duplication too large, skipping\n", nb_frames - 1); nb_frames_drop++; return; } - nb_frames_dup += nb_frames - (nb0_frames && ost->last_dropped) - (nb_frames > nb0_frames); - av_log(NULL, AV_LOG_VERBOSE, "*** %"PRId64" dup!\n", nb_frames - 1); + nb_frames_dup += nb_frames - (nb_frames_prev && ost->last_dropped) - (nb_frames > nb_frames_prev); + av_log(ost, AV_LOG_VERBOSE, "*** %"PRId64" dup!\n", nb_frames - 1); if (nb_frames_dup > dup_warning) { - av_log(NULL, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", dup_warning); + av_log(ost, AV_LOG_WARNING, "More than %"PRIu64" frames duplicated\n", dup_warning); dup_warning *= 10; } } - ost->last_dropped = nb_frames == nb0_frames && next_picture; - ost->dropped_keyframe = ost->last_dropped && next_picture && next_picture->key_frame; + ost->last_dropped = nb_frames == nb_frames_prev && next_picture; + ost->kf.dropped_keyframe = ost->last_dropped && next_picture && next_picture->key_frame; /* duplicates frame if needed */ for (i = 0; i < nb_frames; i++) { AVFrame *in_picture; - int forced_keyframe = 0; - double pts_time; - if (i < nb0_frames && ost->last_frame->buf[0]) { + if (i < nb_frames_prev && ost->last_frame->buf[0]) { in_picture = ost->last_frame; } else in_picture = next_picture; @@ -1221,69 +1329,22 @@ if (!in_picture) return; - in_picture->pts = ost->sync_opts; + in_picture->pts = ost->next_pts; - if (!check_recording_time(ost)) + if (!check_recording_time(ost, in_picture->pts, ost->enc_ctx->time_base)) return; in_picture->quality = enc->global_quality; - in_picture->pict_type = 0; + in_picture->pict_type = forced_kf_apply(ost, &ost->kf, enc->time_base, in_picture, i); - if (ost->forced_kf_ref_pts == AV_NOPTS_VALUE && - in_picture->pts != AV_NOPTS_VALUE) - ost->forced_kf_ref_pts = in_picture->pts; - - pts_time = in_picture->pts != AV_NOPTS_VALUE ? - (in_picture->pts - ost->forced_kf_ref_pts) * av_q2d(enc->time_base) : NAN; - if (ost->forced_kf_index < ost->forced_kf_count && - in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) { - ost->forced_kf_index++; - forced_keyframe = 1; - } else if (ost->forced_keyframes_pexpr) { - double res; - ost->forced_keyframes_expr_const_values[FKF_T] = pts_time; - res = av_expr_eval(ost->forced_keyframes_pexpr, - ost->forced_keyframes_expr_const_values, NULL); - ff_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f prev_forced_t:%f -> res:%f\n", - ost->forced_keyframes_expr_const_values[FKF_N], - ost->forced_keyframes_expr_const_values[FKF_N_FORCED], - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N], - ost->forced_keyframes_expr_const_values[FKF_T], - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T], - res); - if (res) { - forced_keyframe = 1; - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = - ost->forced_keyframes_expr_const_values[FKF_N]; - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = - ost->forced_keyframes_expr_const_values[FKF_T]; - ost->forced_keyframes_expr_const_values[FKF_N_FORCED] += 1; - } - - ost->forced_keyframes_expr_const_values[FKF_N] += 1; - } else if ( ost->forced_keyframes - && !strncmp(ost->forced_keyframes, "source", 6) - && in_picture->key_frame==1 - && !i) { - forced_keyframe = 1; - } else if ( ost->forced_keyframes - && !strncmp(ost->forced_keyframes, "source_no_drop", 14) - && !i) { - forced_keyframe = (in_picture->key_frame == 1) || ost->dropped_keyframe; - ost->dropped_keyframe = 0; - } - - if (forced_keyframe) { - in_picture->pict_type = AV_PICTURE_TYPE_I; - av_log(NULL, AV_LOG_DEBUG, "Forced keyframe at time %f\n", pts_time); - } - - ret = encode_frame(of, ost, in_picture); - if (ret < 0) + ret = submit_encode_frame(of, ost, in_picture); + if (ret == AVERROR_EOF) + break; + else if (ret < 0) exit_program(1); - ost->sync_opts++; - ost->frame_number++; + ost->next_pts++; + ost->vsync_frame_number++; } av_frame_unref(ost->last_frame); @@ -1291,19 +1352,6 @@ av_frame_move_ref(ost->last_frame, next_picture); } -static void finish_output_stream(OutputStream *ost) -{ - OutputFile *of = output_files[ost->file_index]; - AVRational time_base = ost->stream_copy ? ost->mux_timebase : ost->enc_ctx->time_base; - - ost->finished = ENCODER_FINISHED | MUXER_FINISHED; - - if (of->shortest) { - int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, time_base, AV_TIME_BASE_Q); - of->recording_time = FFMIN(of->recording_time, end); - } -} - /** * Get and encode new output from any of the filtergraphs, without causing * activity. @@ -1313,11 +1361,9 @@ static int reap_filters(int flush) { AVFrame *filtered_frame = NULL; - int i; /* Reap all buffers present in the buffer sinks */ - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { OutputFile *of = output_files[ost->file_index]; AVFilterContext *filter; AVCodecContext *enc = ost->enc_ctx; @@ -1359,6 +1405,19 @@ continue; } + if (filtered_frame->pts != AV_NOPTS_VALUE) { + AVRational tb = av_buffersink_get_time_base(filter); + ost->last_filter_pts = av_rescale_q(filtered_frame->pts, tb, + AV_TIME_BASE_Q); + filtered_frame->time_base = tb; + + if (debug_ts) + av_log(NULL, AV_LOG_INFO, "filter_raw -> pts:%s pts_time:%s time_base:%d/%d\n", + av_ts2str(filtered_frame->pts), + av_ts2timestr(filtered_frame->pts, &tb), + tb.num, tb.den); + } + switch (av_buffersink_get_type(filter)) { case AVMEDIA_TYPE_VIDEO: if (!ost->frame_aspect_ratio.num) @@ -1396,17 +1455,20 @@ int i, j; int pass1_used = 1; - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - switch (ost->enc_ctx->codec_type) { - case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break; - case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break; - case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break; - default: other_size += ost->data_size; break; - } - extra_size += ost->enc_ctx->extradata_size; - data_size += ost->data_size; - if ( (ost->enc_ctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + AVCodecParameters *par = ost->st->codecpar; + const uint64_t s = ost->data_size_mux; + + switch (par->codec_type) { + case AVMEDIA_TYPE_VIDEO: video_size += s; break; + case AVMEDIA_TYPE_AUDIO: audio_size += s; break; + case AVMEDIA_TYPE_SUBTITLE: subtitle_size += s; break; + default: other_size += s; break; + } + extra_size += par->extradata_size; + data_size += s; + if (ost->enc_ctx && + (ost->enc_ctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) != AV_CODEC_FLAG_PASS1) pass1_used = 0; } @@ -1435,8 +1497,8 @@ i, f->ctx->url); for (j = 0; j < f->nb_streams; j++) { - InputStream *ist = input_streams[f->ist_index + j]; - enum AVMediaType type = ist->dec_ctx->codec_type; + InputStream *ist = f->streams[j]; + enum AVMediaType type = ist->par->codec_type; total_size += ist->data_size; total_packets += ist->nb_packets; @@ -1466,18 +1528,18 @@ uint64_t total_packets = 0, total_size = 0; av_log(NULL, AV_LOG_VERBOSE, "Output file #%d (%s):\n", - i, of->ctx->url); + i, of->url); - for (j = 0; j < of->ctx->nb_streams; j++) { - OutputStream *ost = output_streams[of->ost_index + j]; - enum AVMediaType type = ost->enc_ctx->codec_type; + for (j = 0; j < of->nb_streams; j++) { + OutputStream *ost = of->streams[j]; + enum AVMediaType type = ost->st->codecpar->codec_type; - total_size += ost->data_size; - total_packets += ost->packets_written; + total_size += ost->data_size_mux; + total_packets += atomic_load(&ost->packets_written); av_log(NULL, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ", i, j, av_get_media_type_string(type)); - if (ost->encoding_needed) { + if (ost->enc_ctx) { av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", ost->frames_encoded); if (type == AVMEDIA_TYPE_AUDIO) @@ -1486,7 +1548,7 @@ } av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets muxed (%"PRIu64" bytes); ", - ost->packets_written, ost->data_size); + atomic_load(&ost->packets_written), ost->data_size_mux); av_log(NULL, AV_LOG_VERBOSE, "\n"); } @@ -1507,11 +1569,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time) { AVBPrint buf, buf_script; - OutputStream *ost; - AVFormatContext *oc; - int64_t total_size; - AVCodecContext *enc; - int vid, i; + int64_t total_size = of_filesize(output_files[0]); + int vid; double bitrate; double speed; int64_t pts = INT64_MIN + 1; @@ -1538,31 +1597,21 @@ t = (cur_time-timer_start) / 1000000.0; - - oc = output_files[0]->ctx; - - total_size = avio_size(oc->pb); - if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too - total_size = avio_tell(oc->pb); - vid = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC); - for (i = 0; i < nb_output_streams; i++) { - float q = -1; - ost = output_streams[i]; - enc = ost->enc_ctx; - if (!ost->stream_copy) - q = ost->quality / (float) FF_QP2LAMBDA; + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + const AVCodecContext * const enc = ost->enc_ctx; + const float q = enc ? ost->quality / (float) FF_QP2LAMBDA : -1; - if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { + if (vid && ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { av_bprintf(&buf, "q=%2.1f ", q); av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n", ost->file_index, ost->index, q); } - if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { + if (!vid && ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { float fps; - int64_t frame_number = ost->frame_number; + uint64_t frame_number = atomic_load(&ost->packets_written); fps = t > 1 ? frame_number / t : 0; av_bprintf(&buf, "frame=%5"PRId64" fps=%3.*f q=%3.1f ", @@ -1582,7 +1631,8 @@ av_bprintf(&buf, "%X", av_log2(qp_histogram[j] + 1)); } - if ((enc->flags & AV_CODEC_FLAG_PSNR) && (ost->pict_type != AV_PICTURE_TYPE_NONE || is_last_report)) { + if (enc && (enc->flags & AV_CODEC_FLAG_PSNR) && + (ost->pict_type != AV_PICTURE_TYPE_NONE || is_last_report)) { int j; double error, error_sum = 0; double scale, scale_sum = 0; @@ -1614,9 +1664,8 @@ vid = 1; } /* compute min output value */ - if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE) { - pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st), - ost->st->time_base, AV_TIME_BASE_Q)); + if (ost->last_mux_dts != AV_NOPTS_VALUE) { + pts = FFMAX(pts, ost->last_mux_dts); if (copy_ts) { if (copy_ts_first_pts == AV_NOPTS_VALUE && pts > 1) copy_ts_first_pts = pts; @@ -1734,14 +1783,19 @@ static void flush_encoders(void) { - int i, ret; + int ret; + + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + OutputFile *of = output_files[ost->file_index]; + if (ost->sq_idx_encode >= 0) + sq_send(of->sq_encode, ost->sq_idx_encode, SQFRAME(NULL)); + } - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { AVCodecContext *enc = ost->enc_ctx; OutputFile *of = output_files[ost->file_index]; - if (!ost->encoding_needed) + if (!enc) continue; // Try to enable encoding with no input frames. @@ -1749,17 +1803,16 @@ if (!ost->initialized) { FilterGraph *fg = ost->filter->graph; - av_log(NULL, AV_LOG_WARNING, - "Finishing stream %d:%d without any data written to it.\n", - ost->file_index, ost->st->index); + av_log(ost, AV_LOG_WARNING, + "Finishing stream without any data written to it.\n"); if (ost->filter && !fg->graph) { int x; for (x = 0; x < fg->nb_inputs; x++) { InputFilter *ifilter = fg->inputs[x]; if (ifilter->format < 0 && - ifilter_parameters_from_codecpar(ifilter, ifilter->ist->st->codecpar) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error copying paramerets from input stream\n"); + ifilter_parameters_from_codecpar(ifilter, ifilter->ist->par) < 0) { + av_log(ost, AV_LOG_ERROR, "Error copying paramerets from input stream\n"); exit_program(1); } } @@ -1769,11 +1822,11 @@ ret = configure_filtergraph(fg); if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error configuring filter graph\n"); + av_log(ost, AV_LOG_ERROR, "Error configuring filter graph\n"); exit_program(1); } - finish_output_stream(ost); + of_output_packet(of, ost->pkt, ost, 1); } init_output_stream_wrapper(ost, NULL, 1); @@ -1782,7 +1835,7 @@ if (enc->codec_type != AVMEDIA_TYPE_VIDEO && enc->codec_type != AVMEDIA_TYPE_AUDIO) continue; - ret = encode_frame(of, ost, NULL); + ret = submit_encode_frame(of, ost, NULL); if (ret != AVERROR_EOF) exit_program(1); } @@ -1794,9 +1847,8 @@ static int check_output_constraints(InputStream *ist, OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; - int ist_index = input_files[ist->file_index]->ist_index + ist->st->index; - if (ost->source_index != ist_index) + if (ost->ist != ist) return 0; if (ost->finished & MUXER_FINISHED) @@ -1819,7 +1871,7 @@ av_packet_unref(opkt); // EOF: flush output bitstream filters. if (!pkt) { - output_packet(of, opkt, ost, 1); + of_output_packet(of, opkt, ost, 1); return; } @@ -1828,12 +1880,9 @@ return; if (!ost->streamcopy_started && !ost->copy_prior_start) { - int64_t comp_start = start_time; - if (copy_ts && f->start_time != AV_NOPTS_VALUE) - comp_start = FFMAX(start_time, f->start_time + f->ts_offset); if (pkt->pts == AV_NOPTS_VALUE ? - ist->pts < comp_start : - pkt->pts < av_rescale_q(comp_start, AV_TIME_BASE_Q, ist->st->time_base)) + ist->pts < ost->ts_copy_start : + pkt->pts < av_rescale_q(ost->ts_copy_start, AV_TIME_BASE_Q, ist->st->time_base)) return; } @@ -1847,7 +1896,7 @@ start_time = 0; if (copy_ts) { start_time += f->start_time != AV_NOPTS_VALUE ? f->start_time : 0; - start_time += start_at_zero ? 0 : f->ctx->start_time; + start_time += start_at_zero ? 0 : f->start_time_effective; } if (ist->pts >= f->recording_time + start_time) { close_output_stream(ost); @@ -1858,52 +1907,43 @@ if (av_packet_ref(opkt, pkt) < 0) exit_program(1); + opkt->time_base = ost->mux_timebase; + if (pkt->pts != AV_NOPTS_VALUE) - opkt->pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->mux_timebase) - ost_tb_start_time; + opkt->pts = av_rescale_q(pkt->pts, ist->st->time_base, opkt->time_base) - ost_tb_start_time; if (pkt->dts == AV_NOPTS_VALUE) { - opkt->dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->mux_timebase); + opkt->dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, opkt->time_base); } else if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { - int duration = av_get_audio_frame_duration(ist->dec_ctx, pkt->size); + int duration = av_get_audio_frame_duration2(ist->par, pkt->size); if(!duration) - duration = ist->dec_ctx->frame_size; + duration = ist->par->frame_size; opkt->dts = av_rescale_delta(ist->st->time_base, pkt->dts, - (AVRational){1, ist->dec_ctx->sample_rate}, duration, - &ist->filter_in_rescale_delta_last, ost->mux_timebase); + (AVRational){1, ist->par->sample_rate}, duration, + &ist->filter_in_rescale_delta_last, opkt->time_base); /* dts will be set immediately afterwards to what pts is now */ opkt->pts = opkt->dts - ost_tb_start_time; } else - opkt->dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->mux_timebase); + opkt->dts = av_rescale_q(pkt->dts, ist->st->time_base, opkt->time_base); opkt->dts -= ost_tb_start_time; - opkt->duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->mux_timebase); + opkt->duration = av_rescale_q(pkt->duration, ist->st->time_base, opkt->time_base); - ost->sync_opts += opkt->duration; + { + int ret = trigger_fix_sub_duration_heartbeat(ost, pkt); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, + "Subtitle heartbeat logic failed in %s! (%s)\n", + __func__, av_err2str(ret)); + exit_program(1); + } + } - output_packet(of, opkt, ost, 0); + of_output_packet(of, opkt, ost, 0); ost->streamcopy_started = 1; } -int guess_input_channel_layout(InputStream *ist) -{ - AVCodecContext *dec = ist->dec_ctx; - - if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { - char layout_name[256]; - - if (dec->ch_layout.nb_channels > ist->guess_layout_max) - return 0; - av_channel_layout_default(&dec->ch_layout, dec->ch_layout.nb_channels); - if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) - return 0; - av_channel_layout_describe(&dec->ch_layout, layout_name, sizeof(layout_name)); - av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream " - "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name); - } - return 1; -} - static void check_decode_result(InputStream *ist, int *got_output, int ret) { if (*got_output || ret<0) @@ -1947,7 +1987,7 @@ /* determine if the parameters for this input changed */ need_reinit = ifilter->format != frame->format; - switch (ifilter->ist->st->codecpar->codec_type) { + switch (ifilter->ist->par->codec_type) { case AVMEDIA_TYPE_AUDIO: need_reinit |= ifilter->sample_rate != frame->sample_rate || av_channel_layout_compare(&ifilter->ch_layout, &frame->ch_layout); @@ -2027,7 +2067,7 @@ } else { // the filtergraph was never configured if (ifilter->format < 0) { - ret = ifilter_parameters_from_codecpar(ifilter, ifilter->ist->st->codecpar); + ret = ifilter_parameters_from_codecpar(ifilter, ifilter->ist->par); if (ret < 0) return ret; } @@ -2044,7 +2084,8 @@ // There is the following difference: if you got a frame, you must call // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0 // (pkt==NULL means get more output, pkt->size==0 is a flush/drain packet) -static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) +static int decode(InputStream *ist, AVCodecContext *avctx, + AVFrame *frame, int *got_frame, AVPacket *pkt) { int ret; @@ -2061,8 +2102,24 @@ ret = avcodec_receive_frame(avctx, frame); if (ret < 0 && ret != AVERROR(EAGAIN)) return ret; - if (ret >= 0) + if (ret >= 0) { + if (ist->want_frame_data) { + FrameData *fd; + + av_assert0(!frame->opaque_ref); + frame->opaque_ref = av_buffer_allocz(sizeof(*fd)); + if (!frame->opaque_ref) { + av_frame_unref(frame); + return AVERROR(ENOMEM); + } + fd = (FrameData*)frame->opaque_ref->data; + fd->pts = frame->pts; + fd->tb = avctx->pkt_timebase; + fd->idx = avctx->frame_num - 1; + } + *got_frame = 1; + } return 0; } @@ -2094,16 +2151,11 @@ AVRational decoded_frame_tb; update_benchmark(NULL); - ret = decode(avctx, decoded_frame, got_output, pkt); + ret = decode(ist, avctx, decoded_frame, got_output, pkt); update_benchmark("decode_audio %d.%d", ist->file_index, ist->st->index); if (ret < 0) *decode_failed = 1; - if (ret >= 0 && avctx->sample_rate <= 0) { - av_log(avctx, AV_LOG_ERROR, "Sample rate %d invalid\n", avctx->sample_rate); - ret = AVERROR_INVALIDDATA; - } - if (ret != AVERROR_EOF) check_decode_result(ist, got_output, ret); @@ -2116,9 +2168,9 @@ /* increment next_dts to use for the case where the input stream does not have timestamps or there are multiple frames in the packet */ ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / - avctx->sample_rate; + decoded_frame->sample_rate; ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / - avctx->sample_rate; + decoded_frame->sample_rate; if (decoded_frame->pts != AV_NOPTS_VALUE) { decoded_frame_tb = ist->st->time_base; @@ -2136,8 +2188,10 @@ ist->prev_pkt_pts = pkt->pts; if (decoded_frame->pts != AV_NOPTS_VALUE) decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts, - (AVRational){1, avctx->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last, - (AVRational){1, avctx->sample_rate}); + (AVRational){1, decoded_frame->sample_rate}, + decoded_frame->nb_samples, + &ist->filter_in_rescale_delta_last, + (AVRational){1, decoded_frame->sample_rate}); ist->nb_samples = decoded_frame->nb_samples; err = send_frame_to_filters(ist, decoded_frame); @@ -2176,16 +2230,16 @@ } update_benchmark(NULL); - ret = decode(ist->dec_ctx, decoded_frame, got_output, pkt); + ret = decode(ist, ist->dec_ctx, decoded_frame, got_output, pkt); update_benchmark("decode_video %d.%d", ist->file_index, ist->st->index); if (ret < 0) *decode_failed = 1; // The following line may be required in some cases where there is no parser // or the parser does not has_b_frames correctly - if (ist->st->codecpar->video_delay < ist->dec_ctx->has_b_frames) { + if (ist->par->video_delay < ist->dec_ctx->has_b_frames) { if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) { - ist->st->codecpar->video_delay = ist->dec_ctx->has_b_frames; + ist->par->video_delay = ist->dec_ctx->has_b_frames; } else av_log(ist->dec_ctx, AV_LOG_WARNING, "video_delay is larger in decoder than demuxer %d > %d.\n" @@ -2193,7 +2247,7 @@ "of this file to https://streams.videolan.org/upload/ " "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\n", ist->dec_ctx->has_b_frames, - ist->st->codecpar->video_delay); + ist->par->video_delay); } if (ret != AVERROR_EOF) @@ -2226,10 +2280,9 @@ if (err < 0) goto fail; } - ist->hwaccel_retrieved_pix_fmt = decoded_frame->format; best_effort_timestamp= decoded_frame->best_effort_timestamp; - *duration_pts = decoded_frame->pkt_duration; + *duration_pts = decoded_frame->duration; if (ist->framerate.num) best_effort_timestamp = ist->cfr_next_pts++; @@ -2270,30 +2323,18 @@ return err < 0 ? err : ret; } -static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, - int *decode_failed) +static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_output) { - AVSubtitle subtitle; + int ret = 0; int free_sub = 1; - int i, ret = avcodec_decode_subtitle2(ist->dec_ctx, - &subtitle, got_output, pkt); - - check_decode_result(NULL, got_output, ret); - - if (ret < 0 || !*got_output) { - *decode_failed = 1; - if (!pkt->size) - sub2video_flush(ist); - return ret; - } if (ist->fix_sub_duration) { int end = 1; if (ist->prev_sub.got_output) { - end = av_rescale(subtitle.pts - ist->prev_sub.subtitle.pts, + end = av_rescale(subtitle->pts - ist->prev_sub.subtitle.pts, 1000, AV_TIME_BASE); if (end < ist->prev_sub.subtitle.end_display_time) { - av_log(ist->dec_ctx, AV_LOG_DEBUG, + av_log(NULL, AV_LOG_DEBUG, "Subtitle duration reduced from %"PRId32" to %d%s\n", ist->prev_sub.subtitle.end_display_time, end, end <= 0 ? ", dropping it" : ""); @@ -2302,7 +2343,7 @@ } FFSWAP(int, *got_output, ist->prev_sub.got_output); FFSWAP(int, ret, ist->prev_sub.ret); - FFSWAP(AVSubtitle, subtitle, ist->prev_sub.subtitle); + FFSWAP(AVSubtitle, *subtitle, ist->prev_sub.subtitle); if (end <= 0) goto out; } @@ -2311,75 +2352,223 @@ return ret; if (ist->sub2video.frame) { - sub2video_update(ist, INT64_MIN, &subtitle); + sub2video_update(ist, INT64_MIN, subtitle); } else if (ist->nb_filters) { if (!ist->sub2video.sub_queue) ist->sub2video.sub_queue = av_fifo_alloc2(8, sizeof(AVSubtitle), AV_FIFO_FLAG_AUTO_GROW); if (!ist->sub2video.sub_queue) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); - ret = av_fifo_write(ist->sub2video.sub_queue, &subtitle, 1); + ret = av_fifo_write(ist->sub2video.sub_queue, subtitle, 1); if (ret < 0) exit_program(1); free_sub = 0; } - if (!subtitle.num_rects) + if (!subtitle->num_rects) goto out; - ist->frames_decoded++; - - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - - if (!check_output_constraints(ist, ost) || !ost->encoding_needed - || ost->enc->type != AVMEDIA_TYPE_SUBTITLE) + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (!check_output_constraints(ist, ost) || !ost->enc_ctx + || ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) continue; - do_subtitle_out(output_files[ost->file_index], ost, &subtitle); + do_subtitle_out(output_files[ost->file_index], ost, subtitle); } out: if (free_sub) - avsubtitle_free(&subtitle); + avsubtitle_free(subtitle); return ret; } -static int send_filter_eof(InputStream *ist) +static int copy_av_subtitle(AVSubtitle *dst, AVSubtitle *src) { - int i, ret; - /* TODO keep pts also in stream time base to avoid converting back */ - int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, ist->st->time_base, - AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + int ret = AVERROR_BUG; + AVSubtitle tmp = { + .format = src->format, + .start_display_time = src->start_display_time, + .end_display_time = src->end_display_time, + .num_rects = 0, + .rects = NULL, + .pts = src->pts + }; + + if (!src->num_rects) + goto success; + + if (!(tmp.rects = av_calloc(src->num_rects, sizeof(*tmp.rects)))) + return AVERROR(ENOMEM); + + for (int i = 0; i < src->num_rects; i++) { + AVSubtitleRect *src_rect = src->rects[i]; + AVSubtitleRect *dst_rect; + + if (!(dst_rect = tmp.rects[i] = av_mallocz(sizeof(*tmp.rects[0])))) { + ret = AVERROR(ENOMEM); + goto cleanup; + } + + tmp.num_rects++; + + dst_rect->type = src_rect->type; + dst_rect->flags = src_rect->flags; + + dst_rect->x = src_rect->x; + dst_rect->y = src_rect->y; + dst_rect->w = src_rect->w; + dst_rect->h = src_rect->h; + dst_rect->nb_colors = src_rect->nb_colors; + + if (src_rect->text) + if (!(dst_rect->text = av_strdup(src_rect->text))) { + ret = AVERROR(ENOMEM); + goto cleanup; + } + + if (src_rect->ass) + if (!(dst_rect->ass = av_strdup(src_rect->ass))) { + ret = AVERROR(ENOMEM); + goto cleanup; + } + + for (int j = 0; j < 4; j++) { + // SUBTITLE_BITMAP images are special in the sense that they + // are like PAL8 images. first pointer to data, second to + // palette. This makes the size calculation match this. + size_t buf_size = src_rect->type == SUBTITLE_BITMAP && j == 1 ? + AVPALETTE_SIZE : + src_rect->h * src_rect->linesize[j]; - for (i = 0; i < ist->nb_filters; i++) { - ret = ifilter_send_eof(ist->filters[i], pts); - if (ret < 0) - return ret; + if (!src_rect->data[j]) + continue; + + if (!(dst_rect->data[j] = av_memdup(src_rect->data[j], buf_size))) { + ret = AVERROR(ENOMEM); + goto cleanup; + } + dst_rect->linesize[j] = src_rect->linesize[j]; + } } + +success: + *dst = tmp; + return 0; + +cleanup: + avsubtitle_free(&tmp); + + return ret; } -/* pkt = NULL means EOF (needed to flush decoder buffers) */ -static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof) +static int fix_sub_duration_heartbeat(InputStream *ist, int64_t signal_pts) { - int ret = 0, i; - int repeating = 0; - int eof_reached = 0; + int ret = AVERROR_BUG; + int got_output = 1; + AVSubtitle *prev_subtitle = &ist->prev_sub.subtitle; + AVSubtitle subtitle; - AVPacket *avpkt = ist->pkt; + if (!ist->fix_sub_duration || !prev_subtitle->num_rects || + signal_pts <= prev_subtitle->pts) + return 0; - if (!ist->saw_first_ts) { - ist->first_dts = - ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0; - ist->pts = 0; - if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) { - ist->first_dts = - ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); - ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong - } - ist->saw_first_ts = 1; - } + if ((ret = copy_av_subtitle(&subtitle, prev_subtitle)) < 0) + return ret; + + subtitle.pts = signal_pts; + + return process_subtitle(ist, &subtitle, &got_output); +} + +static int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt) +{ + OutputFile *of = output_files[ost->file_index]; + int64_t signal_pts = av_rescale_q(pkt->pts, pkt->time_base, + AV_TIME_BASE_Q); + + if (!ost->fix_sub_duration_heartbeat || !(pkt->flags & AV_PKT_FLAG_KEY)) + // we are only interested in heartbeats on streams configured, and + // only on random access points. + return 0; + + for (int i = 0; i < of->nb_streams; i++) { + OutputStream *iter_ost = of->streams[i]; + InputStream *ist = iter_ost->ist; + int ret = AVERROR_BUG; + + if (iter_ost == ost || !ist || !ist->decoding_needed || + ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) + // We wish to skip the stream that causes the heartbeat, + // output streams without an input stream, streams not decoded + // (as fix_sub_duration is only done for decoded subtitles) as + // well as non-subtitle streams. + continue; + + if ((ret = fix_sub_duration_heartbeat(ist, signal_pts)) < 0) + return ret; + } + + return 0; +} + +static int transcode_subtitles(InputStream *ist, const AVPacket *pkt, + int *got_output, int *decode_failed) +{ + AVSubtitle subtitle; + int ret = avcodec_decode_subtitle2(ist->dec_ctx, + &subtitle, got_output, pkt); + + check_decode_result(NULL, got_output, ret); + + if (ret < 0 || !*got_output) { + *decode_failed = 1; + if (!pkt->size) + sub2video_flush(ist); + return ret; + } + + ist->frames_decoded++; + + return process_subtitle(ist, &subtitle, got_output); +} + +static int send_filter_eof(InputStream *ist) +{ + int i, ret; + /* TODO keep pts also in stream time base to avoid converting back */ + int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, ist->st->time_base, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + + for (i = 0; i < ist->nb_filters; i++) { + ret = ifilter_send_eof(ist->filters[i], pts); + if (ret < 0) + return ret; + } + return 0; +} + +/* pkt = NULL means EOF (needed to flush decoder buffers) */ +static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof) +{ + const AVCodecParameters *par = ist->par; + int ret = 0; + int repeating = 0; + int eof_reached = 0; + + AVPacket *avpkt = ist->pkt; + + if (!ist->saw_first_ts) { + ist->first_dts = + ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0; + ist->pts = 0; + if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) { + ist->first_dts = + ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); + ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong + } + ist->saw_first_ts = 1; + } if (ist->next_dts == AV_NOPTS_VALUE) ist->next_dts = ist->dts; @@ -2395,7 +2584,7 @@ if (pkt && pkt->dts != AV_NOPTS_VALUE) { ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); - if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed) + if (par->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed) ist->next_pts = ist->pts = ist->dts; } @@ -2409,7 +2598,7 @@ ist->pts = ist->next_pts; ist->dts = ist->next_dts; - switch (ist->dec_ctx->codec_type) { + switch (par->codec_type) { case AVMEDIA_TYPE_AUDIO: ret = decode_audio (ist, repeating ? NULL : avpkt, &got_output, &decode_failed); @@ -2422,7 +2611,9 @@ if (pkt && pkt->duration) { duration_dts = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) { - int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->dec_ctx->ticks_per_frame; + int ticks = ist->last_pkt_repeat_pict >= 0 ? + ist->last_pkt_repeat_pict + 1 : + ist->dec_ctx->ticks_per_frame; duration_dts = ((int64_t)AV_TIME_BASE * ist->dec_ctx->framerate.den * ticks) / ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame; @@ -2506,12 +2697,12 @@ /* handle stream copy */ if (!ist->decoding_needed && pkt) { ist->dts = ist->next_dts; - switch (ist->dec_ctx->codec_type) { + switch (par->codec_type) { case AVMEDIA_TYPE_AUDIO: av_assert1(pkt->duration >= 0); - if (ist->dec_ctx->sample_rate) { - ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) / - ist->dec_ctx->sample_rate; + if (par->sample_rate) { + ist->next_dts += ((int64_t)AV_TIME_BASE * par->frame_size) / + par->sample_rate; } else { ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } @@ -2525,7 +2716,9 @@ } else if (pkt->duration) { ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0) { - int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict + 1 : ist->dec_ctx->ticks_per_frame; + int ticks = ist->last_pkt_repeat_pict >= 0 ? + ist->last_pkt_repeat_pict + 1 : + ist->dec_ctx->ticks_per_frame; ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->framerate.den * ticks) / ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame; @@ -2537,10 +2730,9 @@ } else if (!ist->decoding_needed) eof_reached = 1; - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - - if (!check_output_constraints(ist, ost) || ost->encoding_needed) + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (!check_output_constraints(ist, ost) || ost->enc_ctx || + (!pkt && no_eof)) continue; do_streamcopy(ist, ost, pkt); @@ -2598,10 +2790,9 @@ return *p; } -static int init_input_stream(int ist_index, char *error, int error_len) +static int init_input_stream(InputStream *ist, char *error, int error_len) { int ret; - InputStream *ist = input_streams[ist_index]; if (ist->decoding_needed) { const AVCodec *codec = ist->dec; @@ -2613,11 +2804,6 @@ ist->dec_ctx->opaque = ist; ist->dec_ctx->get_format = get_format; -#if LIBAVCODEC_VERSION_MAJOR < 60 - AV_NOWARN_DEPRECATED({ - ist->dec_ctx->thread_safe_callbacks = 1; - }) -#endif if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE && (ist->decoding_needed & DECODING_FOR_OST)) { @@ -2663,71 +2849,37 @@ return 0; } -static InputStream *get_input_stream(OutputStream *ost) -{ - if (ost->source_index >= 0) - return input_streams[ost->source_index]; - return NULL; -} - -static int compare_int64(const void *a, const void *b) -{ - return FFDIFFSIGN(*(const int64_t *)a, *(const int64_t *)b); -} - -static int init_output_bsfs(OutputStream *ost) -{ - AVBSFContext *ctx = ost->bsf_ctx; - int ret; - - if (!ctx) - return 0; - - ret = avcodec_parameters_copy(ctx->par_in, ost->st->codecpar); - if (ret < 0) - return ret; - - ctx->time_base_in = ost->st->time_base; - - ret = av_bsf_init(ctx); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n", - ctx->filter->name); - return ret; - } - - ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out); - if (ret < 0) - return ret; - ost->st->time_base = ctx->time_base_out; - - return 0; -} - static int init_output_stream_streamcopy(OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; - InputStream *ist = get_input_stream(ost); - AVCodecParameters *par_dst = ost->st->codecpar; - AVCodecParameters *par_src = ost->ref_par; + InputStream *ist = ost->ist; + InputFile *ifile = input_files[ist->file_index]; + AVCodecParameters *par = ost->st->codecpar; + AVCodecContext *codec_ctx; AVRational sar; int i, ret; - uint32_t codec_tag = par_dst->codec_tag; + uint32_t codec_tag = par->codec_tag; av_assert0(ist && !ost->filter); - ret = avcodec_parameters_to_context(ost->enc_ctx, ist->st->codecpar); + codec_ctx = avcodec_alloc_context3(NULL); + if (!codec_ctx) + return AVERROR(ENOMEM); + + ret = avcodec_parameters_to_context(codec_ctx, ist->par); if (ret >= 0) - ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts); + ret = av_opt_set_dict(codec_ctx, &ost->encoder_opts); if (ret < 0) { - av_log(NULL, AV_LOG_FATAL, + av_log(ost, AV_LOG_FATAL, "Error setting up codec context options.\n"); + avcodec_free_context(&codec_ctx); return ret; } - ret = avcodec_parameters_from_context(par_src, ost->enc_ctx); + ret = avcodec_parameters_from_context(par, codec_ctx); + avcodec_free_context(&codec_ctx); if (ret < 0) { - av_log(NULL, AV_LOG_FATAL, + av_log(ost, AV_LOG_FATAL, "Error getting reference codec parameters.\n"); return ret; } @@ -2735,16 +2887,12 @@ if (!codec_tag) { unsigned int codec_tag_tmp; if (!of->format->codec_tag || - av_codec_get_id (of->format->codec_tag, par_src->codec_tag) == par_src->codec_id || - !av_codec_get_tag2(of->format->codec_tag, par_src->codec_id, &codec_tag_tmp)) - codec_tag = par_src->codec_tag; + av_codec_get_id (of->format->codec_tag, par->codec_tag) == par->codec_id || + !av_codec_get_tag2(of->format->codec_tag, par->codec_id, &codec_tag_tmp)) + codec_tag = par->codec_tag; } - ret = avcodec_parameters_copy(par_dst, par_src); - if (ret < 0) - return ret; - - par_dst->codec_tag = codec_tag; + par->codec_tag = codec_tag; if (!ost->frame_rate.num) ost->frame_rate = ist->framerate; @@ -2770,6 +2918,15 @@ if (ost->st->duration <= 0 && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); + if (!ost->copy_prior_start) { + ost->ts_copy_start = (of->start_time == AV_NOPTS_VALUE) ? + 0 : of->start_time; + if (copy_ts && ifile->start_time != AV_NOPTS_VALUE) { + ost->ts_copy_start = FFMAX(ost->ts_copy_start, + ifile->start_time + ifile->ts_offset); + } + } + if (ist->st->nb_side_data) { for (i = 0; i < ist->st->nb_side_data; i++) { const AVPacketSideData *sd_src = &ist->st->side_data[i]; @@ -2782,37 +2939,36 @@ } } +#if FFMPEG_ROTATION_METADATA if (ost->rotate_overridden) { uint8_t *sd = av_stream_new_side_data(ost->st, AV_PKT_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9); if (sd) av_display_rotation_set((int32_t *)sd, -ost->rotate_override_value); } +#endif - switch (par_dst->codec_type) { + switch (par->codec_type) { case AVMEDIA_TYPE_AUDIO: - if (audio_volume != 256) { - av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible (frames are not decoded)\n"); - exit_program(1); - } - if((par_dst->block_align == 1 || par_dst->block_align == 1152 || par_dst->block_align == 576) && par_dst->codec_id == AV_CODEC_ID_MP3) - par_dst->block_align= 0; - if(par_dst->codec_id == AV_CODEC_ID_AC3) - par_dst->block_align= 0; + if ((par->block_align == 1 || par->block_align == 1152 || par->block_align == 576) && + par->codec_id == AV_CODEC_ID_MP3) + par->block_align = 0; + if (par->codec_id == AV_CODEC_ID_AC3) + par->block_align = 0; break; case AVMEDIA_TYPE_VIDEO: if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option sar = av_mul_q(ost->frame_aspect_ratio, - (AVRational){ par_dst->height, par_dst->width }); - av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio " + (AVRational){ par->height, par->width }); + av_log(ost, AV_LOG_WARNING, "Overriding aspect ratio " "with stream copy may produce invalid files\n"); } else if (ist->st->sample_aspect_ratio.num) sar = ist->st->sample_aspect_ratio; else - sar = par_src->sample_aspect_ratio; - ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar; + sar = par->sample_aspect_ratio; + ost->st->sample_aspect_ratio = par->sample_aspect_ratio = sar; ost->st->avg_frame_rate = ist->st->avg_frame_rate; ost->st->r_frame_rate = ist->st->r_frame_rate; break; @@ -2825,113 +2981,31 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost) { - const AVDictionaryEntry *e; - + const char *cname = ost->enc_ctx->codec->name; uint8_t *encoder_string; int encoder_string_len; - int format_flags = 0; - int codec_flags = ost->enc_ctx->flags; if (av_dict_get(ost->st->metadata, "encoder", NULL, 0)) return; - e = av_dict_get(of->opts, "fflags", NULL, 0); - if (e) { - const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0); - if (!o) - return; - av_opt_eval_flags(of->ctx, o, e->value, &format_flags); - } - e = av_dict_get(ost->encoder_opts, "flags", NULL, 0); - if (e) { - const AVOption *o = av_opt_find(ost->enc_ctx, "flags", NULL, 0, 0); - if (!o) - return; - av_opt_eval_flags(ost->enc_ctx, o, e->value, &codec_flags); - } - - encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(ost->enc->name) + 2; + encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(cname) + 2; encoder_string = av_mallocz(encoder_string_len); if (!encoder_string) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); - if (!(format_flags & AVFMT_FLAG_BITEXACT) && !(codec_flags & AV_CODEC_FLAG_BITEXACT)) + if (!of->bitexact && !ost->bitexact) av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len); else av_strlcpy(encoder_string, "Lavc ", encoder_string_len); - av_strlcat(encoder_string, ost->enc->name, encoder_string_len); + av_strlcat(encoder_string, cname, encoder_string_len); av_dict_set(&ost->st->metadata, "encoder", encoder_string, AV_DICT_DONT_STRDUP_VAL | AV_DICT_DONT_OVERWRITE); } -static void parse_forced_key_frames(char *kf, OutputStream *ost, - AVCodecContext *avctx) -{ - char *p; - int n = 1, i, size, index = 0; - int64_t t, *pts; - - for (p = kf; *p; p++) - if (*p == ',') - n++; - size = n; - pts = av_malloc_array(size, sizeof(*pts)); - if (!pts) { - av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); - exit_program(1); - } - - p = kf; - for (i = 0; i < n; i++) { - char *next = strchr(p, ','); - - if (next) - *next++ = 0; - - if (!memcmp(p, "chapters", 8)) { - - AVFormatContext *avf = output_files[ost->file_index]->ctx; - int j; - - if (avf->nb_chapters > INT_MAX - size || - !(pts = av_realloc_f(pts, size += avf->nb_chapters - 1, - sizeof(*pts)))) { - av_log(NULL, AV_LOG_FATAL, - "Could not allocate forced key frames array.\n"); - exit_program(1); - } - t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0; - t = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); - - for (j = 0; j < avf->nb_chapters; j++) { - AVChapter *c = avf->chapters[j]; - av_assert1(index < size); - pts[index++] = av_rescale_q(c->start, c->time_base, - avctx->time_base) + t; - } - - } else { - - t = parse_time_or_die("force_key_frames", p, 1); - av_assert1(index < size); - pts[index++] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); - - } - - p = next; - } - - av_assert0(index == size); - qsort(pts, size, sizeof(*pts), compare_int64); - ost->forced_kf_count = size; - ost->forced_kf_pts = pts; -} - static void init_encoder_time_base(OutputStream *ost, AVRational default_time_base) { - InputStream *ist = get_input_stream(ost); + InputStream *ist = ost->ist; AVCodecContext *enc_ctx = ost->enc_ctx; - AVFormatContext *oc; if (ost->enc_timebase.num > 0) { enc_ctx->time_base = ost->enc_timebase; @@ -2944,8 +3018,8 @@ return; } - oc = output_files[ost->file_index]->ctx; - av_log(oc, AV_LOG_WARNING, "Input stream data not available, using default time base\n"); + av_log(ost, AV_LOG_WARNING, + "Input stream data not available, using default time base\n"); } enc_ctx->time_base = default_time_base; @@ -2953,11 +3027,10 @@ static int init_output_stream_encode(OutputStream *ost, AVFrame *frame) { - InputStream *ist = get_input_stream(ost); + InputStream *ist = ost->ist; AVCodecContext *enc_ctx = ost->enc_ctx; AVCodecContext *dec_ctx = NULL; OutputFile *of = output_files[ost->file_index]; - AVFormatContext *oc = of->ctx; int ret; set_encoder_id(output_files[ost->file_index], ost); @@ -2969,14 +3042,13 @@ if (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { if (!ost->frame_rate.num) ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter); - if (ist && !ost->frame_rate.num && !ost->max_frame_rate.num) { + if (!ost->frame_rate.num && !ost->max_frame_rate.num) { ost->frame_rate = (AVRational){25, 1}; - av_log(NULL, AV_LOG_WARNING, + av_log(ost, AV_LOG_WARNING, "No information " "about the input framerate is available. Falling " - "back to a default value of 25fps for output stream #%d:%d. Use the -r option " - "if you want a different framerate.\n", - ost->file_index, ost->index); + "back to a default value of 25fps. Use the -r option " + "if you want a different framerate.\n"); } if (ost->max_frame_rate.num && @@ -2984,9 +3056,9 @@ !ost->frame_rate.den)) ost->frame_rate = ost->max_frame_rate; - if (ost->enc->supported_framerates && !ost->force_fps) { - int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates); - ost->frame_rate = ost->enc->supported_framerates[idx]; + if (enc_ctx->codec->supported_framerates && !ost->force_fps) { + int idx = av_find_nearest_q_idx(ost->frame_rate, enc_ctx->codec->supported_framerates); + ost->frame_rate = enc_ctx->codec->supported_framerates[idx]; } // reduce frame rate for mpeg4 to be within the spec limits if (enc_ctx->codec_id == AV_CODEC_ID_MPEG4) { @@ -3020,9 +3092,9 @@ if ( av_q2d(enc_ctx->time_base) < 0.001 && ost->vsync_method != VSYNC_PASSTHROUGH && (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR || (ost->vsync_method == VSYNC_AUTO && !(of->format->flags & AVFMT_VARIABLE_FPS)))){ - av_log(oc, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n" - "Please consider specifying a lower framerate, a different muxer or " - "setting vsync/fps_mode to vfr\n"); + av_log(ost, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n" + "Please consider specifying a lower framerate, a different muxer or " + "setting vsync/fps_mode to vfr\n"); } enc_ctx->width = av_buffersink_get_w(ost->filter->filter); @@ -3074,33 +3146,41 @@ enc_ctx->field_order = AV_FIELD_TT; } - if (ost->forced_keyframes) { - if (!strncmp(ost->forced_keyframes, "expr:", 5)) { - ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5, - forced_keyframes_const_names, NULL, NULL, NULL, NULL, 0, NULL); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, - "Invalid force_key_frames expression '%s'\n", ost->forced_keyframes+5); - return ret; - } - ost->forced_keyframes_expr_const_values[FKF_N] = 0; - ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0; - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN; - ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN; - - // Don't parse the 'forced_keyframes' in case of 'keep-source-keyframes', - // parse it only for static kf timings - } else if(strncmp(ost->forced_keyframes, "source", 6)) { - parse_forced_key_frames(ost->forced_keyframes, ost, ost->enc_ctx); - } - } break; case AVMEDIA_TYPE_SUBTITLE: enc_ctx->time_base = AV_TIME_BASE_Q; if (!enc_ctx->width) { - enc_ctx->width = input_streams[ost->source_index]->st->codecpar->width; - enc_ctx->height = input_streams[ost->source_index]->st->codecpar->height; + enc_ctx->width = ost->ist->par->width; + enc_ctx->height = ost->ist->par->height; + } + if (dec_ctx && dec_ctx->subtitle_header) { + /* ASS code assumes this buffer is null terminated so add extra byte. */ + ost->enc_ctx->subtitle_header = av_mallocz(dec_ctx->subtitle_header_size + 1); + if (!ost->enc_ctx->subtitle_header) + return AVERROR(ENOMEM); + memcpy(ost->enc_ctx->subtitle_header, dec_ctx->subtitle_header, + dec_ctx->subtitle_header_size); + ost->enc_ctx->subtitle_header_size = dec_ctx->subtitle_header_size; + } + if (ist && ist->dec->type == AVMEDIA_TYPE_SUBTITLE && + enc_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { + int input_props = 0, output_props = 0; + AVCodecDescriptor const *input_descriptor = + avcodec_descriptor_get(ist->dec->id); + AVCodecDescriptor const *output_descriptor = + avcodec_descriptor_get(ost->enc_ctx->codec_id); + if (input_descriptor) + input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); + if (output_descriptor) + output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); + if (input_props && output_props && input_props != output_props) { + av_log(ost, AV_LOG_ERROR, + "Subtitle encoding currently only possible from text to text " + "or bitmap to bitmap"); + return AVERROR_INVALIDDATA; + } } + break; case AVMEDIA_TYPE_DATA: break; @@ -3109,6 +3189,12 @@ break; } + if (ost->bitexact) + enc_ctx->flags |= AV_CODEC_FLAG_BITEXACT; + + if (ost->sq_idx_encode >= 0) + sq_set_tb(of->sq_encode, ost->sq_idx_encode, enc_ctx->time_base); + ost->mux_timebase = enc_ctx->time_base; return 0; @@ -3119,28 +3205,23 @@ { int ret = 0; - if (ost->encoding_needed) { - const AVCodec *codec = ost->enc; - AVCodecContext *dec = NULL; - InputStream *ist; + if (ost->enc_ctx) { + const AVCodec *codec = ost->enc_ctx->codec; + InputStream *ist = ost->ist; ret = init_output_stream_encode(ost, frame); if (ret < 0) return ret; - if ((ist = get_input_stream(ost))) - dec = ist->dec_ctx; - if (dec && dec->subtitle_header) { - /* ASS code assumes this buffer is null terminated so add extra byte. */ - ost->enc_ctx->subtitle_header = av_mallocz(dec->subtitle_header_size + 1); - if (!ost->enc_ctx->subtitle_header) - return AVERROR(ENOMEM); - memcpy(ost->enc_ctx->subtitle_header, dec->subtitle_header, dec->subtitle_header_size); - ost->enc_ctx->subtitle_header_size = dec->subtitle_header_size; - } if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0)) av_dict_set(&ost->encoder_opts, "threads", "auto", 0); + if (codec->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE) { + ret = av_dict_set(&ost->encoder_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY); + if (ret < 0) + return ret; + } + ret = hw_device_setup_for_encode(ost); if (ret < 0) { snprintf(error, error_len, "Device setup failed for " @@ -3149,24 +3230,6 @@ return ret; } - if (ist && ist->dec->type == AVMEDIA_TYPE_SUBTITLE && ost->enc->type == AVMEDIA_TYPE_SUBTITLE) { - int input_props = 0, output_props = 0; - AVCodecDescriptor const *input_descriptor = - avcodec_descriptor_get(dec->codec_id); - AVCodecDescriptor const *output_descriptor = - avcodec_descriptor_get(ost->enc_ctx->codec_id); - if (input_descriptor) - input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (output_descriptor) - output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (input_props && output_props && input_props != output_props) { - snprintf(error, error_len, - "Subtitle encoding currently only possible from text to text " - "or bitmap to bitmap"); - return AVERROR_INVALIDDATA; - } - } - if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) { if (ret == AVERROR_EXPERIMENTAL) abort_codec_experimental(codec, 1); @@ -3176,19 +3239,19 @@ ost->file_index, ost->index); return ret; } - if (ost->enc->type == AVMEDIA_TYPE_AUDIO && - !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) + if (codec->type == AVMEDIA_TYPE_AUDIO && + !(codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) av_buffersink_set_frame_size(ost->filter->filter, ost->enc_ctx->frame_size); assert_avoptions(ost->encoder_opts); if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000 && ost->enc_ctx->codec_id != AV_CODEC_ID_CODEC2 /* don't complain about 700 bit/s modes */) - av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low." - " It takes bits/s as argument, not kbits/s\n"); + av_log(ost, AV_LOG_WARNING, "The bitrate parameter is set too low." + " It takes bits/s as argument, not kbits/s\n"); ret = avcodec_parameters_from_context(ost->st->codecpar, ost->enc_ctx); if (ret < 0) { - av_log(NULL, AV_LOG_FATAL, + av_log(ost, AV_LOG_FATAL, "Error initializing the output stream codec context.\n"); exit_program(1); } @@ -3224,7 +3287,7 @@ return AVERROR(ENOMEM); memcpy(dst, sd->data, sd->size); if (ist->autorotate && sd->type == AV_PKT_DATA_DISPLAYMATRIX) - av_display_rotation_set((uint32_t *)dst, 0); + av_display_rotation_set((int32_t *)dst, 0); } } } @@ -3236,83 +3299,36 @@ // copy estimated duration as a hint to the muxer if (ost->st->duration <= 0 && ist && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); - } else if (ost->stream_copy) { + } else if (ost->ist) { ret = init_output_stream_streamcopy(ost); if (ret < 0) return ret; } - /* initialize bitstream filters for the output stream - * needs to be done here, because the codec id for streamcopy is not - * known until now */ - ret = init_output_bsfs(ost); - if (ret < 0) - return ret; - - ost->initialized = 1; - - ret = of_check_init(output_files[ost->file_index]); + ret = of_stream_init(output_files[ost->file_index], ost); if (ret < 0) return ret; return ret; } -static void report_new_stream(int input_index, AVPacket *pkt) -{ - InputFile *file = input_files[input_index]; - AVStream *st = file->ctx->streams[pkt->stream_index]; - - if (pkt->stream_index < file->nb_streams_warn) - return; - av_log(file->ctx, AV_LOG_WARNING, - "New %s stream %d:%d at pos:%"PRId64" and DTS:%ss\n", - av_get_media_type_string(st->codecpar->codec_type), - input_index, pkt->stream_index, - pkt->pos, av_ts2timestr(pkt->dts, &st->time_base)); - file->nb_streams_warn = pkt->stream_index + 1; -} - static int transcode_init(void) { - int ret = 0, i, j, k; - AVFormatContext *oc; - OutputStream *ost; - InputStream *ist; + int ret = 0; char error[1024] = {0}; - for (i = 0; i < nb_filtergraphs; i++) { - FilterGraph *fg = filtergraphs[i]; - for (j = 0; j < fg->nb_outputs; j++) { - OutputFilter *ofilter = fg->outputs[j]; - if (!ofilter->ost || ofilter->ost->source_index >= 0) - continue; - if (fg->nb_inputs != 1) - continue; - for (k = nb_input_streams-1; k >= 0 ; k--) - if (fg->inputs[0]->ist == input_streams[k]) - break; - ofilter->ost->source_index = k; - } - } - /* init framerate emulation */ - for (i = 0; i < nb_input_files; i++) { + for (int i = 0; i < nb_input_files; i++) { InputFile *ifile = input_files[i]; if (ifile->readrate || ifile->rate_emu) - for (j = 0; j < ifile->nb_streams; j++) - input_streams[j + ifile->ist_index]->start = av_gettime_relative(); + for (int j = 0; j < ifile->nb_streams; j++) + ifile->streams[j]->start = av_gettime_relative(); } /* init input streams */ - for (i = 0; i < nb_input_streams; i++) - if ((ret = init_input_stream(i, error, sizeof(error))) < 0) { - for (i = 0; i < nb_output_streams; i++) { - ost = output_streams[i]; - avcodec_close(ost->enc_ctx); - } + for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) + if ((ret = init_input_stream(ist, error, sizeof(error))) < 0) goto dump_format; - } /* * initialize stream copy and subtitle/data streams. @@ -3323,26 +3339,26 @@ * to be configured with the correct audio frame size, which is only * known after the encoder is initialized. */ - for (i = 0; i < nb_output_streams; i++) { - if (!output_streams[i]->stream_copy && - (output_streams[i]->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO || - output_streams[i]->enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO)) + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (ost->enc_ctx && + (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || + ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)) continue; - ret = init_output_stream_wrapper(output_streams[i], NULL, 0); + ret = init_output_stream_wrapper(ost, NULL, 0); if (ret < 0) goto dump_format; } /* discard unused programs */ - for (i = 0; i < nb_input_files; i++) { + for (int i = 0; i < nb_input_files; i++) { InputFile *ifile = input_files[i]; - for (j = 0; j < ifile->ctx->nb_programs; j++) { + for (int j = 0; j < ifile->ctx->nb_programs; j++) { AVProgram *p = ifile->ctx->programs[j]; int discard = AVDISCARD_ALL; - for (k = 0; k < p->nb_stream_indexes; k++) - if (!input_streams[ifile->ist_index + p->stream_index[k]]->discard) { + for (int k = 0; k < p->nb_stream_indexes; k++) + if (!ifile->streams[p->stream_index[k]]->discard) { discard = AVDISCARD_DEFAULT; break; } @@ -3350,23 +3366,11 @@ } } - /* write headers for files with no streams */ - for (i = 0; i < nb_output_files; i++) { - oc = output_files[i]->ctx; - if (output_files[i]->format->flags & AVFMT_NOSTREAMS && oc->nb_streams == 0) { - ret = of_check_init(output_files[i]); - if (ret < 0) - goto dump_format; - } - } - dump_format: /* dump the stream mapping */ av_log(NULL, AV_LOG_INFO, "Stream mapping:\n"); - for (i = 0; i < nb_input_streams; i++) { - ist = input_streams[i]; - - for (j = 0; j < ist->nb_filters; j++) { + for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) { + for (int j = 0; j < ist->nb_filters; j++) { if (!filtergraph_is_simple(ist->filters[j]->graph)) { av_log(NULL, AV_LOG_INFO, " Stream #%d:%d (%s) -> %s", ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?", @@ -3378,9 +3382,7 @@ } } - for (i = 0; i < nb_output_streams; i++) { - ost = output_streams[i]; - + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { if (ost->attachment_filename) { /* an attached file */ av_log(NULL, AV_LOG_INFO, " File %s -> Stream #%d:%d\n", @@ -3395,24 +3397,18 @@ av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index); av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file_index, - ost->index, ost->enc ? ost->enc->name : "?"); + ost->index, ost->enc_ctx->codec->name); continue; } av_log(NULL, AV_LOG_INFO, " Stream #%d:%d -> #%d:%d", - input_streams[ost->source_index]->file_index, - input_streams[ost->source_index]->st->index, + ost->ist->file_index, + ost->ist->st->index, ost->file_index, ost->index); - if (ost->sync_ist != input_streams[ost->source_index]) - av_log(NULL, AV_LOG_INFO, " [sync #%d:%d]", - ost->sync_ist->file_index, - ost->sync_ist->st->index); - if (ost->stream_copy) - av_log(NULL, AV_LOG_INFO, " (copy)"); - else { - const AVCodec *in_codec = input_streams[ost->source_index]->dec; - const AVCodec *out_codec = ost->enc; + if (ost->enc_ctx) { + const AVCodec *in_codec = ost->ist->dec; + const AVCodec *out_codec = ost->enc_ctx->codec; const char *decoder_name = "?"; const char *in_codec_name = "?"; const char *encoder_name = "?"; @@ -3440,7 +3436,8 @@ av_log(NULL, AV_LOG_INFO, " (%s (%s) -> %s (%s))", in_codec_name, decoder_name, out_codec_name, encoder_name); - } + } else + av_log(NULL, AV_LOG_INFO, " (copy)"); av_log(NULL, AV_LOG_INFO, "\n"); } @@ -3457,22 +3454,9 @@ /* Return 1 if there remain streams where more output is wanted, 0 otherwise. */ static int need_output(void) { - int i; - - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - OutputFile *of = output_files[ost->file_index]; - AVFormatContext *os = output_files[ost->file_index]->ctx; - - if (ost->finished || - (os->pb && avio_tell(os->pb) >= of->limit_filesize)) - continue; - if (ost->frame_number >= ost->max_frames) { - int j; - for (j = 0; j < of->ctx->nb_streams; j++) - close_output_stream(output_streams[of->ost_index + j]); + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (ost->finished) continue; - } return 1; } @@ -3487,19 +3471,22 @@ */ static OutputStream *choose_output(void) { - int i; int64_t opts_min = INT64_MAX; OutputStream *ost_min = NULL; - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - int64_t opts = ost->last_mux_dts == AV_NOPTS_VALUE ? INT64_MIN : - av_rescale_q(ost->last_mux_dts, ost->st->time_base, - AV_TIME_BASE_Q); - if (ost->last_mux_dts == AV_NOPTS_VALUE) - av_log(NULL, AV_LOG_DEBUG, - "cur_dts is invalid st:%d (%d) [init:%d i_done:%d finish:%d] (this is harmless if it occurs once at the start per stream)\n", - ost->st->index, ost->st->id, ost->initialized, ost->inputs_done, ost->finished); + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + int64_t opts; + + if (ost->filter && ost->last_filter_pts != AV_NOPTS_VALUE) { + opts = ost->last_filter_pts; + } else { + opts = ost->last_mux_dts == AV_NOPTS_VALUE ? + INT64_MIN : ost->last_mux_dts; + if (ost->last_mux_dts == AV_NOPTS_VALUE) + av_log(ost, AV_LOG_DEBUG, + "cur_dts is invalid [init:%d i_done:%d finish:%d] (this is harmless if it occurs once at the start per stream)\n", + ost->initialized, ost->inputs_done, ost->finished); + } if (!ost->initialized && !ost->inputs_done) return ost->unavailable ? NULL : ost; @@ -3543,15 +3530,6 @@ if (key == '+') av_log_set_level(av_log_get_level()+10); if (key == '-') av_log_set_level(av_log_get_level()-10); if (key == 's') qp_hist ^= 1; - if (key == 'h'){ - if (do_hex_dump){ - do_hex_dump = do_pkt_dump = 0; - } else if(do_pkt_dump){ - do_hex_dump = 1; - } else - do_pkt_dump = 1; - av_log_set_level(AV_LOG_DEBUG); - } if (key == 'c' || key == 'C'){ char buf[4096], target[64], command[256], arg[256] = {0}; double time; @@ -3595,7 +3573,11 @@ if (key == 'd' || key == 'D'){ int debug=0; if(key == 'D') { - debug = input_streams[0]->dec_ctx->debug << 1; + InputStream *ist = ist_iter(NULL); + + if (ist) + debug = ist->dec_ctx->debug << 1; + if(!debug) debug = 1; while (debug & FF_DEBUG_DCT_COEFF) //unsupported, would just crash debug += debug; @@ -3613,12 +3595,11 @@ if (k <= 0 || sscanf(buf, "%d", &debug)!=1) fprintf(stderr,"error parsing debug value\n"); } - for(i=0;idec_ctx->debug = debug; - } - for(i=0;ienc_ctx->debug = debug; + for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) + ist->dec_ctx->debug = debug; + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (ost->enc_ctx) + ost->enc_ctx->debug = debug; } if(debug) av_log_set_level(AV_LOG_DEBUG); fprintf(stderr,"debug=%d\n", debug); @@ -3639,250 +3620,136 @@ return 0; } -#if HAVE_THREADS -static void *input_thread(void *arg) -{ - InputFile *f = arg; - AVPacket *pkt = f->pkt, *queue_pkt; - unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0; - int ret = 0; - - while (1) { - ret = av_read_frame(f->ctx, pkt); - - if (ret == AVERROR(EAGAIN)) { - av_usleep(10000); - continue; - } - if (ret < 0) { - av_thread_message_queue_set_err_recv(f->in_thread_queue, ret); - break; - } - queue_pkt = av_packet_alloc(); - if (!queue_pkt) { - av_packet_unref(pkt); - av_thread_message_queue_set_err_recv(f->in_thread_queue, AVERROR(ENOMEM)); - break; - } - av_packet_move_ref(queue_pkt, pkt); - ret = av_thread_message_queue_send(f->in_thread_queue, &queue_pkt, flags); - if (flags && ret == AVERROR(EAGAIN)) { - flags = 0; - ret = av_thread_message_queue_send(f->in_thread_queue, &queue_pkt, flags); - av_log(f->ctx, AV_LOG_WARNING, - "Thread message queue blocking; consider raising the " - "thread_queue_size option (current value: %d)\n", - f->thread_queue_size); - } - if (ret < 0) { - if (ret != AVERROR_EOF) - av_log(f->ctx, AV_LOG_ERROR, - "Unable to send packet to main thread: %s\n", - av_err2str(ret)); - av_packet_free(&queue_pkt); - av_thread_message_queue_set_err_recv(f->in_thread_queue, ret); - break; - } - } - - return NULL; -} - -static void free_input_thread(int i) +static int got_eagain(void) { - InputFile *f = input_files[i]; - AVPacket *pkt; - - if (!f || !f->in_thread_queue) - return; - av_thread_message_queue_set_err_send(f->in_thread_queue, AVERROR_EOF); - while (av_thread_message_queue_recv(f->in_thread_queue, &pkt, 0) >= 0) - av_packet_free(&pkt); - - pthread_join(f->thread, NULL); - f->joined = 1; - av_thread_message_queue_free(&f->in_thread_queue); + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) + if (ost->unavailable) + return 1; + return 0; } -static void free_input_threads(void) +static void reset_eagain(void) { int i; - for (i = 0; i < nb_input_files; i++) - free_input_thread(i); + input_files[i]->eagain = 0; + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) + ost->unavailable = 0; } -static int init_input_thread(int i) +static void decode_flush(InputFile *ifile) { - int ret; - InputFile *f = input_files[i]; - - if (f->thread_queue_size < 0) - f->thread_queue_size = (nb_input_files > 1 ? 8 : 0); - if (!f->thread_queue_size) - return 0; + for (int i = 0; i < ifile->nb_streams; i++) { + InputStream *ist = ifile->streams[i]; + int ret; - if (f->ctx->pb ? !f->ctx->pb->seekable : - strcmp(f->ctx->iformat->name, "lavfi")) - f->non_blocking = 1; - ret = av_thread_message_queue_alloc(&f->in_thread_queue, - f->thread_queue_size, sizeof(f->pkt)); - if (ret < 0) - return ret; - - if ((ret = pthread_create(&f->thread, NULL, input_thread, f))) { - av_log(NULL, AV_LOG_ERROR, "pthread_create failed: %s. Try to increase `ulimit -v` or decrease `ulimit -s`.\n", strerror(ret)); - av_thread_message_queue_free(&f->in_thread_queue); - return AVERROR(ret); - } + if (!ist->processing_needed) + continue; - return 0; -} + do { + ret = process_input_packet(ist, NULL, 1); + } while (ret > 0); -static int init_input_threads(void) -{ - int i, ret; + if (ist->decoding_needed) { + /* report last frame duration to the demuxer thread */ + if (ist->par->codec_type == AVMEDIA_TYPE_AUDIO) { + LastFrameDuration dur; - for (i = 0; i < nb_input_files; i++) { - ret = init_input_thread(i); - if (ret < 0) - return ret; - } - return 0; -} + dur.stream_idx = i; + dur.duration = av_rescale_q(ist->nb_samples, + (AVRational){ 1, ist->dec_ctx->sample_rate}, + ist->st->time_base); -static int get_input_packet_mt(InputFile *f, AVPacket **pkt) -{ - return av_thread_message_queue_recv(f->in_thread_queue, pkt, - f->non_blocking ? - AV_THREAD_MESSAGE_NONBLOCK : 0); -} -#endif + av_thread_message_queue_send(ifile->audio_duration_queue, &dur, 0); + } -static int get_input_packet(InputFile *f, AVPacket **pkt) -{ - if (f->readrate || f->rate_emu) { - int i; - int64_t file_start = copy_ts * ( - (f->ctx->start_time != AV_NOPTS_VALUE ? f->ctx->start_time * !start_at_zero : 0) + - (f->start_time != AV_NOPTS_VALUE ? f->start_time : 0) - ); - float scale = f->rate_emu ? 1.0 : f->readrate; - for (i = 0; i < f->nb_streams; i++) { - InputStream *ist = input_streams[f->ist_index + i]; - int64_t stream_ts_offset, pts, now; - if (!ist->nb_packets || (ist->decoding_needed && !ist->got_output)) continue; - stream_ts_offset = FFMAX(ist->first_dts != AV_NOPTS_VALUE ? ist->first_dts : 0, file_start); - pts = av_rescale(ist->dts, 1000000, AV_TIME_BASE); - now = (av_gettime_relative() - ist->start) * scale + stream_ts_offset; - if (pts > now) - return AVERROR(EAGAIN); + avcodec_flush_buffers(ist->dec_ctx); } } - -#if HAVE_THREADS - if (f->thread_queue_size) - return get_input_packet_mt(f, pkt); -#endif - *pkt = f->pkt; - return av_read_frame(f->ctx, *pkt); } -static int got_eagain(void) +static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist, + AVPacket *pkt) { - int i; - for (i = 0; i < nb_output_streams; i++) - if (output_streams[i]->unavailable) - return 1; - return 0; -} - -static void reset_eagain(void) -{ - int i; - for (i = 0; i < nb_input_files; i++) - input_files[i]->eagain = 0; - for (i = 0; i < nb_output_streams; i++) - output_streams[i]->unavailable = 0; -} - -// set duration to max(tmp, duration) in a proper time base and return duration's time_base -static AVRational duration_max(int64_t tmp, int64_t *duration, AVRational tmp_time_base, - AVRational time_base) -{ - int ret; - - if (!*duration) { - *duration = tmp; - return tmp_time_base; - } + const int fmt_is_discont = ifile->ctx->iformat->flags & AVFMT_TS_DISCONT; + int disable_discontinuity_correction = copy_ts; + int64_t pkt_dts = av_rescale_q_rnd(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); - ret = av_compare_ts(*duration, time_base, tmp, tmp_time_base); - if (ret < 0) { - *duration = tmp; - return tmp_time_base; + if (copy_ts && ist->next_dts != AV_NOPTS_VALUE && + fmt_is_discont && ist->st->pts_wrap_bits < 60) { + int64_t wrap_dts = av_rescale_q_rnd(pkt->dts + (1LL<st->pts_wrap_bits), + ist->st->time_base, AV_TIME_BASE_Q, + AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + if (FFABS(wrap_dts - ist->next_dts) < FFABS(pkt_dts - ist->next_dts)/10) + disable_discontinuity_correction = 0; } - return time_base; -} - -static int seek_to_start(InputFile *ifile, AVFormatContext *is) -{ - InputStream *ist; - AVCodecContext *avctx; - int i, ret, has_audio = 0; - int64_t duration = 0; - - ret = avformat_seek_file(is, -1, INT64_MIN, is->start_time, is->start_time, 0); - if (ret < 0) - return ret; - - for (i = 0; i < ifile->nb_streams; i++) { - ist = input_streams[ifile->ist_index + i]; - avctx = ist->dec_ctx; - - /* duration is the length of the last frame in a stream - * when audio stream is present we don't care about - * last video frame length because it's not defined exactly */ - if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && ist->nb_samples) - has_audio = 1; - } - - for (i = 0; i < ifile->nb_streams; i++) { - ist = input_streams[ifile->ist_index + i]; - avctx = ist->dec_ctx; - - if (has_audio) { - if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && ist->nb_samples) { - AVRational sample_rate = {1, avctx->sample_rate}; - - duration = av_rescale_q(ist->nb_samples, sample_rate, ist->st->time_base); - } else { - continue; + if (ist->next_dts != AV_NOPTS_VALUE && !disable_discontinuity_correction) { + int64_t delta = pkt_dts - ist->next_dts; + if (fmt_is_discont) { + if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE || + pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) { + ifile->ts_offset_discont -= delta; + av_log(NULL, AV_LOG_DEBUG, + "timestamp discontinuity for stream #%d:%d " + "(id=%d, type=%s): %"PRId64", new offset= %"PRId64"\n", + ist->file_index, ist->st->index, ist->st->id, + av_get_media_type_string(ist->par->codec_type), + delta, ifile->ts_offset_discont); + pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); } } else { - if (ist->framerate.num) { - duration = av_rescale_q(1, av_inv_q(ist->framerate), ist->st->time_base); - } else if (ist->st->avg_frame_rate.num) { - duration = av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), ist->st->time_base); - } else { - duration = 1; + if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { + av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt->dts, ist->next_dts, pkt->stream_index); + pkt->dts = AV_NOPTS_VALUE; + } + if (pkt->pts != AV_NOPTS_VALUE){ + int64_t pkt_pts = av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); + delta = pkt_pts - ist->next_dts; + if (FFABS(delta) > 1LL * dts_error_threshold * AV_TIME_BASE) { + av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt->pts, ist->next_dts, pkt->stream_index); + pkt->pts = AV_NOPTS_VALUE; + } } } - if (!ifile->duration) - ifile->time_base = ist->st->time_base; - /* the total duration of the stream, max_pts - min_pts is - * the duration of the stream without the last frame */ - if (ist->max_pts > ist->min_pts && ist->max_pts - (uint64_t)ist->min_pts < INT64_MAX - duration) - duration += ist->max_pts - ist->min_pts; - ifile->time_base = duration_max(duration, &ifile->duration, ist->st->time_base, - ifile->time_base); + } else if (ist->next_dts == AV_NOPTS_VALUE && !copy_ts && + fmt_is_discont && ifile->last_ts != AV_NOPTS_VALUE) { + int64_t delta = pkt_dts - ifile->last_ts; + if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE) { + ifile->ts_offset_discont -= delta; + av_log(NULL, AV_LOG_DEBUG, + "Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", + delta, ifile->ts_offset_discont); + pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); + } } - if (ifile->loop > 0) - ifile->loop--; + ifile->last_ts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); +} - return ret; +static void ts_discontinuity_process(InputFile *ifile, InputStream *ist, + AVPacket *pkt) +{ + int64_t offset = av_rescale_q(ifile->ts_offset_discont, AV_TIME_BASE_Q, + ist->st->time_base); + + // apply previously-detected timestamp-discontinuity offset + // (to all streams, not just audio/video) + if (pkt->dts != AV_NOPTS_VALUE) + pkt->dts += offset; + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts += offset; + + // detect timestamp discontinuities for audio/video + if ((ist->par->codec_type == AVMEDIA_TYPE_VIDEO || + ist->par->codec_type == AVMEDIA_TYPE_AUDIO) && + pkt->dts != AV_NOPTS_VALUE) + ts_discontinuity_detect(ifile, ist, pkt); } /* @@ -3898,48 +3765,19 @@ AVFormatContext *is; InputStream *ist; AVPacket *pkt; - int ret, thread_ret, i, j; - int64_t duration; - int64_t pkt_dts; - int disable_discontinuity_correction = copy_ts; + int ret, i; is = ifile->ctx; - ret = get_input_packet(ifile, &pkt); + ret = ifile_get_packet(ifile, &pkt); if (ret == AVERROR(EAGAIN)) { ifile->eagain = 1; return ret; } - if (ret < 0 && ifile->loop) { - AVCodecContext *avctx; - for (i = 0; i < ifile->nb_streams; i++) { - ist = input_streams[ifile->ist_index + i]; - avctx = ist->dec_ctx; - if (ist->processing_needed) { - ret = process_input_packet(ist, NULL, 1); - if (ret>0) - return 0; - if (ist->decoding_needed) - avcodec_flush_buffers(avctx); - } - } -#if HAVE_THREADS - free_input_thread(file_index); -#endif - ret = seek_to_start(ifile, is); -#if HAVE_THREADS - thread_ret = init_input_thread(file_index); - if (thread_ret < 0) - return thread_ret; -#endif - if (ret < 0) - av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n"); - else - ret = get_input_packet(ifile, &pkt); - if (ret == AVERROR(EAGAIN)) { - ifile->eagain = 1; - return ret; - } + if (ret == 1) { + /* the input file is looped: flush the decoders */ + decode_flush(ifile); + return AVERROR(EAGAIN); } if (ret < 0) { if (ret != AVERROR_EOF) { @@ -3949,7 +3787,7 @@ } for (i = 0; i < ifile->nb_streams; i++) { - ist = input_streams[ifile->ist_index + i]; + ist = ifile->streams[i]; if (ist->processing_needed) { ret = process_input_packet(ist, NULL, 0); if (ret>0) @@ -3957,12 +3795,12 @@ } /* mark all outputs that don't go through lavfi as finished */ - for (j = 0; j < nb_output_streams; j++) { - OutputStream *ost = output_streams[j]; - - if (ost->source_index == ifile->ist_index + i && - (ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE)) - finish_output_stream(ost); + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + if (ost->ist == ist && + (!ost->enc_ctx || ost->enc_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE)) { + OutputFile *of = output_files[ost->file_index]; + of_output_packet(of, ost->pkt, ost, 1); + } } } @@ -3972,18 +3810,7 @@ reset_eagain(); - if (do_pkt_dump) { - av_pkt_dump_log2(NULL, AV_LOG_INFO, pkt, do_hex_dump, - is->streams[pkt->stream_index]); - } - /* the following test is needed in case new streams appear - dynamically in stream : we ignore them */ - if (pkt->stream_index >= ifile->nb_streams) { - report_new_stream(file_index, pkt); - goto discard_packet; - } - - ist = input_streams[ifile->ist_index + pkt->stream_index]; + ist = ifile->streams[pkt->stream_index]; ist->data_size += pkt->size; ist->nb_packets++; @@ -3991,61 +3818,6 @@ if (ist->discard) goto discard_packet; - if (pkt->flags & AV_PKT_FLAG_CORRUPT) { - av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING, - "%s: corrupt input packet in stream %d\n", is->url, pkt->stream_index); - if (exit_on_error) - exit_program(1); - } - - if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s " - "next_dts:%s next_dts_time:%s next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", - ifile->ist_index + pkt->stream_index, av_get_media_type_string(ist->dec_ctx->codec_type), - av_ts2str(ist->next_dts), av_ts2timestr(ist->next_dts, &AV_TIME_BASE_Q), - av_ts2str(ist->next_pts), av_ts2timestr(ist->next_pts, &AV_TIME_BASE_Q), - av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), - av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base), - av_ts2str(input_files[ist->file_index]->ts_offset), - av_ts2timestr(input_files[ist->file_index]->ts_offset, &AV_TIME_BASE_Q)); - } - - if(!ist->wrap_correction_done && is->start_time != AV_NOPTS_VALUE && ist->st->pts_wrap_bits < 64){ - int64_t stime, stime2; - // Correcting starttime based on the enabled streams - // FIXME this ideally should be done before the first use of starttime but we do not know which are the enabled streams at that point. - // so we instead do it here as part of discontinuity handling - if ( ist->next_dts == AV_NOPTS_VALUE - && ifile->ts_offset == -is->start_time - && (is->iformat->flags & AVFMT_TS_DISCONT)) { - int64_t new_start_time = INT64_MAX; - for (i=0; inb_streams; i++) { - AVStream *st = is->streams[i]; - if(st->discard == AVDISCARD_ALL || st->start_time == AV_NOPTS_VALUE) - continue; - new_start_time = FFMIN(new_start_time, av_rescale_q(st->start_time, st->time_base, AV_TIME_BASE_Q)); - } - if (new_start_time > is->start_time) { - av_log(is, AV_LOG_VERBOSE, "Correcting start time by %"PRId64"\n", new_start_time - is->start_time); - ifile->ts_offset = -new_start_time; - } - } - - stime = av_rescale_q(is->start_time, AV_TIME_BASE_Q, ist->st->time_base); - stime2= stime + (1ULL<st->pts_wrap_bits); - ist->wrap_correction_done = 1; - - if(stime2 > stime && pkt->dts != AV_NOPTS_VALUE && pkt->dts > stime + (1LL<<(ist->st->pts_wrap_bits-1))) { - pkt->dts -= 1ULL<st->pts_wrap_bits; - ist->wrap_correction_done = 0; - } - if(stime2 > stime && pkt->pts != AV_NOPTS_VALUE && pkt->pts > stime + (1LL<<(ist->st->pts_wrap_bits-1))) { - pkt->pts -= 1ULL<st->pts_wrap_bits; - ist->wrap_correction_done = 0; - } - } - /* add the stream-global side data to the first packet */ if (ist->nb_packets == 1) { for (i = 0; i < ist->st->nb_side_data; i++) { @@ -4060,105 +3832,19 @@ dst_data = av_packet_new_side_data(pkt, src_sd->type, src_sd->size); if (!dst_data) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); memcpy(dst_data, src_sd->data, src_sd->size); } } - if (pkt->dts != AV_NOPTS_VALUE) - pkt->dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base); - if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base); - - if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts *= ist->ts_scale; - if (pkt->dts != AV_NOPTS_VALUE) - pkt->dts *= ist->ts_scale; - - pkt_dts = av_rescale_q_rnd(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - if ((ist->dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO || - ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) && - pkt_dts != AV_NOPTS_VALUE && ist->next_dts == AV_NOPTS_VALUE && !copy_ts - && (is->iformat->flags & AVFMT_TS_DISCONT) && ifile->last_ts != AV_NOPTS_VALUE) { - int64_t delta = pkt_dts - ifile->last_ts; - if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE || - delta > 1LL*dts_delta_threshold*AV_TIME_BASE){ - ifile->ts_offset -= delta; - av_log(NULL, AV_LOG_DEBUG, - "Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", - delta, ifile->ts_offset); - pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); - if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); - } - } - - duration = av_rescale_q(ifile->duration, ifile->time_base, ist->st->time_base); - if (pkt->pts != AV_NOPTS_VALUE) { - pkt->pts += duration; - ist->max_pts = FFMAX(pkt->pts, ist->max_pts); - ist->min_pts = FFMIN(pkt->pts, ist->min_pts); - } - - if (pkt->dts != AV_NOPTS_VALUE) - pkt->dts += duration; - - pkt_dts = av_rescale_q_rnd(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - - if (copy_ts && pkt_dts != AV_NOPTS_VALUE && ist->next_dts != AV_NOPTS_VALUE && - (is->iformat->flags & AVFMT_TS_DISCONT) && ist->st->pts_wrap_bits < 60) { - int64_t wrap_dts = av_rescale_q_rnd(pkt->dts + (1LL<st->pts_wrap_bits), - ist->st->time_base, AV_TIME_BASE_Q, - AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - if (FFABS(wrap_dts - ist->next_dts) < FFABS(pkt_dts - ist->next_dts)/10) - disable_discontinuity_correction = 0; - } - - if ((ist->dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO || - ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) && - pkt_dts != AV_NOPTS_VALUE && ist->next_dts != AV_NOPTS_VALUE && - !disable_discontinuity_correction) { - int64_t delta = pkt_dts - ist->next_dts; - if (is->iformat->flags & AVFMT_TS_DISCONT) { - if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE || - delta > 1LL*dts_delta_threshold*AV_TIME_BASE || - pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) { - ifile->ts_offset -= delta; - av_log(NULL, AV_LOG_DEBUG, - "timestamp discontinuity for stream #%d:%d " - "(id=%d, type=%s): %"PRId64", new offset= %"PRId64"\n", - ist->file_index, ist->st->index, ist->st->id, - av_get_media_type_string(ist->dec_ctx->codec_type), - delta, ifile->ts_offset); - pkt->dts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); - if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts -= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base); - } - } else { - if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE || - delta > 1LL*dts_error_threshold*AV_TIME_BASE) { - av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt->dts, ist->next_dts, pkt->stream_index); - pkt->dts = AV_NOPTS_VALUE; - } - if (pkt->pts != AV_NOPTS_VALUE){ - int64_t pkt_pts = av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); - delta = pkt_pts - ist->next_dts; - if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE || - delta > 1LL*dts_error_threshold*AV_TIME_BASE) { - av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt->pts, ist->next_dts, pkt->stream_index); - pkt->pts = AV_NOPTS_VALUE; - } - } - } - } - - if (pkt->dts != AV_NOPTS_VALUE) - ifile->last_ts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); + // detect and try to correct for timestamp discontinuities + ts_discontinuity_process(ifile, ist, pkt); if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", - ifile->ist_index + pkt->stream_index, av_get_media_type_string(ist->dec_ctx->codec_type), + av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", + ifile->index, pkt->stream_index, + av_get_media_type_string(ist->par->codec_type), av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base), @@ -4171,12 +3857,7 @@ process_input_packet(ist, pkt, 0); discard_packet: -#if HAVE_THREADS - if (ifile->thread_queue_size) - av_packet_free(&pkt); - else -#endif - av_packet_unref(pkt); + av_packet_free(&pkt); return 0; } @@ -4304,8 +3985,8 @@ return 0; } } else { - av_assert0(ost->source_index >= 0); - ist = input_streams[ost->source_index]; + ist = ost->ist; + av_assert0(ist); } ret = process_input(ist->file_index); @@ -4327,8 +4008,6 @@ static int transcode(void) { int ret, i; - AVFormatContext *os; - OutputStream *ost; InputStream *ist; int64_t timer_start; int64_t total_packets_written = 0; @@ -4343,11 +4022,6 @@ timer_start = av_gettime_relative(); -#if HAVE_THREADS - if ((ret = init_input_threads()) < 0) - goto fail; -#endif - while (!received_sigterm) { int64_t cur_time= av_gettime_relative(); @@ -4371,13 +4045,9 @@ /* dump report by using the output first video and audio streams */ print_report(0, timer_start, cur_time); } -#if HAVE_THREADS - free_input_threads(); -#endif /* at the end of stream, we must flush the decoder buffers */ - for (i = 0; i < nb_input_streams; i++) { - ist = input_streams[i]; + for (ist = ist_iter(NULL); ist; ist = ist_iter(ist)) { if (!input_files[ist->file_index]->eof_reached) { process_input_packet(ist, NULL, 0); } @@ -4396,27 +4066,13 @@ /* dump report by using the first video and audio streams */ print_report(1, timer_start, av_gettime_relative()); - /* close the output files */ - for (i = 0; i < nb_output_files; i++) { - os = output_files[i]->ctx; - if (os && os->oformat && !(os->oformat->flags & AVFMT_NOFILE)) { - if ((ret = avio_closep(&os->pb)) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error closing file %s: %s\n", os->url, av_err2str(ret)); - if (exit_on_error) - exit_program(1); - } - } - } - /* close each encoder */ - for (i = 0; i < nb_output_streams; i++) { - ost = output_streams[i]; - if (ost->encoding_needed) { - av_freep(&ost->enc_ctx->stats_in); - } - total_packets_written += ost->packets_written; - if (!ost->packets_written && (abort_on_flags & ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM)) { - av_log(NULL, AV_LOG_FATAL, "Empty output on stream %d.\n", i); + for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { + uint64_t packets_written; + packets_written = atomic_load(&ost->packets_written); + total_packets_written += packets_written; + if (!packets_written && (abort_on_flags & ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM)) { + av_log(ost, AV_LOG_FATAL, "Empty output\n"); exit_program(1); } } @@ -4426,46 +4082,12 @@ exit_program(1); } - /* close each decoder */ - for (i = 0; i < nb_input_streams; i++) { - ist = input_streams[i]; - if (ist->decoding_needed) { - avcodec_close(ist->dec_ctx); - if (ist->hwaccel_uninit) - ist->hwaccel_uninit(ist->dec_ctx); - } - } - hw_device_free_all(); /* finished ! */ ret = 0; fail: -#if HAVE_THREADS - free_input_threads(); -#endif - - if (output_streams) { - for (i = 0; i < nb_output_streams; i++) { - ost = output_streams[i]; - if (ost) { - if (ost->logfile) { - if (fclose(ost->logfile)) - av_log(NULL, AV_LOG_ERROR, - "Error closing logfile, loss of information possible: %s\n", - av_err2str(AVERROR(errno))); - ost->logfile = NULL; - } - av_freep(&ost->forced_kf_pts); - av_freep(&ost->apad); - av_freep(&ost->disposition); - av_dict_free(&ost->encoder_opts); - av_dict_free(&ost->sws_dict); - av_dict_free(&ost->swr_opts); - } - } - } return ret; } @@ -4515,7 +4137,7 @@ int main(int argc, char **argv) { - int i, ret; + int ret; BenchmarkTimeStamps ti; init_dynload(); @@ -4551,11 +4173,6 @@ exit_program(1); } - for (i = 0; i < nb_output_files; i++) { - if (strcmp(output_files[i]->format->name, "rtp")) - want_sdp = 0; - } - current_time = ti = get_benchmark_time_stamps(); if (transcode() < 0) exit_program(1); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_demux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_demux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_demux.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_demux.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1131 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 "ffmpeg.h" + +#include "libavutil/avassert.h" +#include "libavutil/avstring.h" +#include "libavutil/display.h" +#include "libavutil/error.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/opt.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" +#include "libavutil/time.h" +#include "libavutil/timestamp.h" +#include "libavutil/thread.h" +#include "libavutil/threadmessage.h" + +#include "libavcodec/packet.h" + +#include "libavformat/avformat.h" + +static const char *const opt_name_discard[] = {"discard", NULL}; +static const char *const opt_name_reinit_filters[] = {"reinit_filter", NULL}; +static const char *const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL}; +static const char *const opt_name_canvas_sizes[] = {"canvas_size", NULL}; +static const char *const opt_name_guess_layout_max[] = {"guess_layout_max", NULL}; +static const char *const opt_name_ts_scale[] = {"itsscale", NULL}; +static const char *const opt_name_hwaccels[] = {"hwaccel", NULL}; +static const char *const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL}; +static const char *const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL}; +static const char *const opt_name_autorotate[] = {"autorotate", NULL}; +static const char *const opt_name_display_rotations[] = {"display_rotation", NULL}; +static const char *const opt_name_display_hflips[] = {"display_hflip", NULL}; +static const char *const opt_name_display_vflips[] = {"display_vflip", NULL}; + +typedef struct Demuxer { + InputFile f; + + /* number of times input stream should be looped */ + int loop; + /* actual duration of the longest stream in a file at the moment when + * looping happens */ + int64_t duration; + /* time base of the duration */ + AVRational time_base; + + /* number of streams that the user was warned of */ + int nb_streams_warn; + + AVThreadMessageQueue *in_thread_queue; + int thread_queue_size; + pthread_t thread; + int non_blocking; +} Demuxer; + +typedef struct DemuxMsg { + AVPacket *pkt; + int looping; + + // repeat_pict from the demuxer-internal parser + int repeat_pict; +} DemuxMsg; + +static Demuxer *demuxer_from_ifile(InputFile *f) +{ + return (Demuxer*)f; +} + +static void report_new_stream(Demuxer *d, const AVPacket *pkt) +{ + AVStream *st = d->f.ctx->streams[pkt->stream_index]; + + if (pkt->stream_index < d->nb_streams_warn) + return; + av_log(NULL, AV_LOG_WARNING, + "New %s stream %d:%d at pos:%"PRId64" and DTS:%ss\n", + av_get_media_type_string(st->codecpar->codec_type), + d->f.index, pkt->stream_index, + pkt->pos, av_ts2timestr(pkt->dts, &st->time_base)); + d->nb_streams_warn = pkt->stream_index + 1; +} + +static void ifile_duration_update(Demuxer *d, InputStream *ist, + int64_t last_duration) +{ + /* the total duration of the stream, max_pts - min_pts is + * the duration of the stream without the last frame */ + if (ist->max_pts > ist->min_pts && + ist->max_pts - (uint64_t)ist->min_pts < INT64_MAX - last_duration) + last_duration += ist->max_pts - ist->min_pts; + + if (!d->duration || + av_compare_ts(d->duration, d->time_base, + last_duration, ist->st->time_base) < 0) { + d->duration = last_duration; + d->time_base = ist->st->time_base; + } +} + +static int seek_to_start(Demuxer *d) +{ + InputFile *ifile = &d->f; + AVFormatContext *is = ifile->ctx; + InputStream *ist; + int ret; + + ret = avformat_seek_file(is, -1, INT64_MIN, is->start_time, is->start_time, 0); + if (ret < 0) + return ret; + + if (ifile->audio_duration_queue_size) { + /* duration is the length of the last frame in a stream + * when audio stream is present we don't care about + * last video frame length because it's not defined exactly */ + int got_durations = 0; + + while (got_durations < ifile->audio_duration_queue_size) { + LastFrameDuration dur; + ret = av_thread_message_queue_recv(ifile->audio_duration_queue, &dur, 0); + if (ret < 0) + return ret; + got_durations++; + + ist = ifile->streams[dur.stream_idx]; + ifile_duration_update(d, ist, dur.duration); + } + } else { + for (int i = 0; i < ifile->nb_streams; i++) { + int64_t duration = 0; + ist = ifile->streams[i]; + + if (ist->framerate.num) { + duration = av_rescale_q(1, av_inv_q(ist->framerate), ist->st->time_base); + } else if (ist->st->avg_frame_rate.num) { + duration = av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), ist->st->time_base); + } else { + duration = 1; + } + + ifile_duration_update(d, ist, duration); + } + } + + if (d->loop > 0) + d->loop--; + + return ret; +} + +static void ts_fixup(Demuxer *d, AVPacket *pkt, int *repeat_pict) +{ + InputFile *ifile = &d->f; + InputStream *ist = ifile->streams[pkt->stream_index]; + const int64_t start_time = ifile->start_time_effective; + int64_t duration; + + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d:%d type:%s " + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s\n", + ifile->index, pkt->stream_index, + av_get_media_type_string(ist->st->codecpar->codec_type), + av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base)); + } + + if (!ist->wrap_correction_done && start_time != AV_NOPTS_VALUE && + ist->st->pts_wrap_bits < 64) { + int64_t stime, stime2; + + stime = av_rescale_q(start_time, AV_TIME_BASE_Q, ist->st->time_base); + stime2= stime + (1ULL<st->pts_wrap_bits); + ist->wrap_correction_done = 1; + + if(stime2 > stime && pkt->dts != AV_NOPTS_VALUE && pkt->dts > stime + (1LL<<(ist->st->pts_wrap_bits-1))) { + pkt->dts -= 1ULL<st->pts_wrap_bits; + ist->wrap_correction_done = 0; + } + if(stime2 > stime && pkt->pts != AV_NOPTS_VALUE && pkt->pts > stime + (1LL<<(ist->st->pts_wrap_bits-1))) { + pkt->pts -= 1ULL<st->pts_wrap_bits; + ist->wrap_correction_done = 0; + } + } + + if (pkt->dts != AV_NOPTS_VALUE) + pkt->dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base); + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base); + + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts *= ist->ts_scale; + if (pkt->dts != AV_NOPTS_VALUE) + pkt->dts *= ist->ts_scale; + + duration = av_rescale_q(d->duration, d->time_base, ist->st->time_base); + if (pkt->pts != AV_NOPTS_VALUE) { + pkt->pts += duration; + ist->max_pts = FFMAX(pkt->pts, ist->max_pts); + ist->min_pts = FFMIN(pkt->pts, ist->min_pts); + } + + if (pkt->dts != AV_NOPTS_VALUE) + pkt->dts += duration; + + *repeat_pict = -1; + if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && + av_stream_get_parser(ist->st)) + *repeat_pict = av_stream_get_parser(ist->st)->repeat_pict; +} + +static void thread_set_name(InputFile *f) +{ + char name[16]; + snprintf(name, sizeof(name), "dmx%d:%s", f->index, f->ctx->iformat->name); + ff_thread_setname(name); +} + +static void *input_thread(void *arg) +{ + Demuxer *d = arg; + InputFile *f = &d->f; + AVPacket *pkt; + unsigned flags = d->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0; + int ret = 0; + + pkt = av_packet_alloc(); + if (!pkt) { + ret = AVERROR(ENOMEM); + goto finish; + } + + thread_set_name(f); + + while (1) { + DemuxMsg msg = { NULL }; + + ret = av_read_frame(f->ctx, pkt); + + if (ret == AVERROR(EAGAIN)) { + av_usleep(10000); + continue; + } + if (ret < 0) { + if (d->loop) { + /* signal looping to the consumer thread */ + msg.looping = 1; + ret = av_thread_message_queue_send(d->in_thread_queue, &msg, 0); + if (ret >= 0) + ret = seek_to_start(d); + if (ret >= 0) + continue; + + /* fallthrough to the error path */ + } + + if (ret == AVERROR_EOF) + av_log(NULL, AV_LOG_VERBOSE, "EOF in input file %d\n", f->index); + else + av_log(NULL, AV_LOG_ERROR, "Error demuxing input file %d: %s\n", + f->index, av_err2str(ret)); + + break; + } + + if (do_pkt_dump) { + av_pkt_dump_log2(NULL, AV_LOG_INFO, pkt, do_hex_dump, + f->ctx->streams[pkt->stream_index]); + } + + /* the following test is needed in case new streams appear + dynamically in stream : we ignore them */ + if (pkt->stream_index >= f->nb_streams) { + report_new_stream(d, pkt); + av_packet_unref(pkt); + continue; + } + + if (pkt->flags & AV_PKT_FLAG_CORRUPT) { + av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING, + "%s: corrupt input packet in stream %d\n", + f->ctx->url, pkt->stream_index); + if (exit_on_error) { + av_packet_unref(pkt); + ret = AVERROR_INVALIDDATA; + break; + } + } + + ts_fixup(d, pkt, &msg.repeat_pict); + + msg.pkt = av_packet_alloc(); + if (!msg.pkt) { + av_packet_unref(pkt); + ret = AVERROR(ENOMEM); + break; + } + av_packet_move_ref(msg.pkt, pkt); + ret = av_thread_message_queue_send(d->in_thread_queue, &msg, flags); + if (flags && ret == AVERROR(EAGAIN)) { + flags = 0; + ret = av_thread_message_queue_send(d->in_thread_queue, &msg, flags); + av_log(f->ctx, AV_LOG_WARNING, + "Thread message queue blocking; consider raising the " + "thread_queue_size option (current value: %d)\n", + d->thread_queue_size); + } + if (ret < 0) { + if (ret != AVERROR_EOF) + av_log(f->ctx, AV_LOG_ERROR, + "Unable to send packet to main thread: %s\n", + av_err2str(ret)); + av_packet_free(&msg.pkt); + break; + } + } + +finish: + av_assert0(ret < 0); + av_thread_message_queue_set_err_recv(d->in_thread_queue, ret); + + av_packet_free(&pkt); + + av_log(NULL, AV_LOG_VERBOSE, "Terminating demuxer thread %d\n", f->index); + + return NULL; +} + +static void thread_stop(Demuxer *d) +{ + InputFile *f = &d->f; + DemuxMsg msg; + + if (!d->in_thread_queue) + return; + av_thread_message_queue_set_err_send(d->in_thread_queue, AVERROR_EOF); + while (av_thread_message_queue_recv(d->in_thread_queue, &msg, 0) >= 0) + av_packet_free(&msg.pkt); + + pthread_join(d->thread, NULL); + av_thread_message_queue_free(&d->in_thread_queue); + av_thread_message_queue_free(&f->audio_duration_queue); +} + +static int thread_start(Demuxer *d) +{ + int ret; + InputFile *f = &d->f; + + if (d->thread_queue_size <= 0) + d->thread_queue_size = (nb_input_files > 1 ? 8 : 1); + + if (nb_input_files > 1 && + (f->ctx->pb ? !f->ctx->pb->seekable : + strcmp(f->ctx->iformat->name, "lavfi"))) + d->non_blocking = 1; + ret = av_thread_message_queue_alloc(&d->in_thread_queue, + d->thread_queue_size, sizeof(DemuxMsg)); + if (ret < 0) + return ret; + + if (d->loop) { + int nb_audio_dec = 0; + + for (int i = 0; i < f->nb_streams; i++) { + InputStream *ist = f->streams[i]; + nb_audio_dec += !!(ist->decoding_needed && + ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO); + } + + if (nb_audio_dec) { + ret = av_thread_message_queue_alloc(&f->audio_duration_queue, + nb_audio_dec, sizeof(LastFrameDuration)); + if (ret < 0) + goto fail; + f->audio_duration_queue_size = nb_audio_dec; + } + } + + if ((ret = pthread_create(&d->thread, NULL, input_thread, d))) { + av_log(NULL, AV_LOG_ERROR, "pthread_create failed: %s. Try to increase `ulimit -v` or decrease `ulimit -s`.\n", strerror(ret)); + ret = AVERROR(ret); + goto fail; + } + + return 0; +fail: + av_thread_message_queue_free(&d->in_thread_queue); + return ret; +} + +int ifile_get_packet(InputFile *f, AVPacket **pkt) +{ + Demuxer *d = demuxer_from_ifile(f); + InputStream *ist; + DemuxMsg msg; + int ret; + + if (!d->in_thread_queue) { + ret = thread_start(d); + if (ret < 0) + return ret; + } + + if (f->readrate || f->rate_emu) { + int i; + int64_t file_start = copy_ts * ( + (f->start_time_effective != AV_NOPTS_VALUE ? f->start_time_effective * !start_at_zero : 0) + + (f->start_time != AV_NOPTS_VALUE ? f->start_time : 0) + ); + float scale = f->rate_emu ? 1.0 : f->readrate; + for (i = 0; i < f->nb_streams; i++) { + InputStream *ist = f->streams[i]; + int64_t stream_ts_offset, pts, now; + if (!ist->nb_packets || (ist->decoding_needed && !ist->got_output)) continue; + stream_ts_offset = FFMAX(ist->first_dts != AV_NOPTS_VALUE ? ist->first_dts : 0, file_start); + pts = av_rescale(ist->dts, 1000000, AV_TIME_BASE); + now = (av_gettime_relative() - ist->start) * scale + stream_ts_offset; + if (pts > now) + return AVERROR(EAGAIN); + } + } + + ret = av_thread_message_queue_recv(d->in_thread_queue, &msg, + d->non_blocking ? + AV_THREAD_MESSAGE_NONBLOCK : 0); + if (ret < 0) + return ret; + if (msg.looping) + return 1; + + ist = f->streams[msg.pkt->stream_index]; + ist->last_pkt_repeat_pict = msg.repeat_pict; + + *pkt = msg.pkt; + return 0; +} + +static void ist_free(InputStream **pist) +{ + InputStream *ist = *pist; + + if (!ist) + return; + + av_frame_free(&ist->decoded_frame); + av_packet_free(&ist->pkt); + av_dict_free(&ist->decoder_opts); + avsubtitle_free(&ist->prev_sub.subtitle); + av_frame_free(&ist->sub2video.frame); + av_freep(&ist->filters); + av_freep(&ist->hwaccel_device); + av_freep(&ist->dts_buffer); + + avcodec_free_context(&ist->dec_ctx); + avcodec_parameters_free(&ist->par); + + av_freep(pist); +} + +void ifile_close(InputFile **pf) +{ + InputFile *f = *pf; + Demuxer *d = demuxer_from_ifile(f); + + if (!f) + return; + + thread_stop(d); + + for (int i = 0; i < f->nb_streams; i++) + ist_free(&f->streams[i]); + av_freep(&f->streams); + + avformat_close_input(&f->ctx); + + av_freep(pf); +} + +static const AVCodec *choose_decoder(const OptionsContext *o, AVFormatContext *s, AVStream *st, + enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type) + +{ + char *codec_name = NULL; + + MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st); + if (codec_name) { + const AVCodec *codec = find_codec_or_die(NULL, codec_name, st->codecpar->codec_type, 0); + st->codecpar->codec_id = codec->id; + if (recast_media && st->codecpar->codec_type != codec->type) + st->codecpar->codec_type = codec->type; + return codec; + } else { + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && + hwaccel_id == HWACCEL_GENERIC && + hwaccel_device_type != AV_HWDEVICE_TYPE_NONE) { + const AVCodec *c; + void *i = NULL; + + while ((c = av_codec_iterate(&i))) { + const AVCodecHWConfig *config; + + if (c->id != st->codecpar->codec_id || + !av_codec_is_decoder(c)) + continue; + + for (int j = 0; config = avcodec_get_hw_config(c, j); j++) { + if (config->device_type == hwaccel_device_type) { + av_log(NULL, AV_LOG_VERBOSE, "Selecting decoder '%s' because of requested hwaccel method %s\n", + c->name, av_hwdevice_get_type_name(hwaccel_device_type)); + return c; + } + } + } + } + + return avcodec_find_decoder(st->codecpar->codec_id); + } +} + +static int guess_input_channel_layout(InputStream *ist) +{ + AVCodecContext *dec = ist->dec_ctx; + + if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + char layout_name[256]; + + if (dec->ch_layout.nb_channels > ist->guess_layout_max) + return 0; + av_channel_layout_default(&dec->ch_layout, dec->ch_layout.nb_channels); + if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + return 0; + av_channel_layout_describe(&dec->ch_layout, layout_name, sizeof(layout_name)); + av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream " + "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name); + } + return 1; +} + +static void add_display_matrix_to_stream(const OptionsContext *o, + AVFormatContext *ctx, AVStream *st) +{ + double rotation = DBL_MAX; + int hflip = -1, vflip = -1; + int hflip_set = 0, vflip_set = 0, rotation_set = 0; + int32_t *buf; + + MATCH_PER_STREAM_OPT(display_rotations, dbl, rotation, ctx, st); + MATCH_PER_STREAM_OPT(display_hflips, i, hflip, ctx, st); + MATCH_PER_STREAM_OPT(display_vflips, i, vflip, ctx, st); + + rotation_set = rotation != DBL_MAX; + hflip_set = hflip != -1; + vflip_set = vflip != -1; + + if (!rotation_set && !hflip_set && !vflip_set) + return; + + buf = (int32_t *)av_stream_new_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9); + if (!buf) { + av_log(NULL, AV_LOG_FATAL, "Failed to generate a display matrix!\n"); + exit_program(1); + } + + av_display_rotation_set(buf, + rotation_set ? -(rotation) : -0.0f); + + av_display_matrix_flip(buf, + hflip_set ? hflip : 0, + vflip_set ? vflip : 0); +} + +/* Add all the streams from the given input file to the demuxer */ +static void add_input_streams(const OptionsContext *o, Demuxer *d) +{ + InputFile *f = &d->f; + AVFormatContext *ic = f->ctx; + int i, ret; + + for (i = 0; i < ic->nb_streams; i++) { + AVStream *st = ic->streams[i]; + AVCodecParameters *par = st->codecpar; + InputStream *ist; + char *framerate = NULL, *hwaccel_device = NULL; + const char *hwaccel = NULL; + char *hwaccel_output_format = NULL; + char *codec_tag = NULL; + char *next; + char *discard_str = NULL; + const AVClass *cc = avcodec_get_class(); + const AVOption *discard_opt = av_opt_find(&cc, "skip_frame", NULL, + 0, AV_OPT_SEARCH_FAKE_OBJ); + + ist = ALLOC_ARRAY_ELEM(f->streams, f->nb_streams); + ist->st = st; + ist->file_index = f->index; + ist->discard = 1; + st->discard = AVDISCARD_ALL; + ist->nb_samples = 0; + ist->first_dts = AV_NOPTS_VALUE; + ist->min_pts = INT64_MAX; + ist->max_pts = INT64_MIN; + + ist->ts_scale = 1.0; + MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st); + + ist->autorotate = 1; + MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st); + + MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st); + if (codec_tag) { + uint32_t tag = strtol(codec_tag, &next, 0); + if (*next) + tag = AV_RL32(codec_tag); + st->codecpar->codec_tag = tag; + } + + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { + add_display_matrix_to_stream(o, ic, st); + + MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st); + MATCH_PER_STREAM_OPT(hwaccel_output_formats, str, + hwaccel_output_format, ic, st); + + if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "cuvid")) { + av_log(NULL, AV_LOG_WARNING, + "WARNING: defaulting hwaccel_output_format to cuda for compatibility " + "with old commandlines. This behaviour is DEPRECATED and will be removed " + "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n"); + ist->hwaccel_output_format = AV_PIX_FMT_CUDA; + } else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "qsv")) { + av_log(NULL, AV_LOG_WARNING, + "WARNING: defaulting hwaccel_output_format to qsv for compatibility " + "with old commandlines. This behaviour is DEPRECATED and will be removed " + "in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n"); + ist->hwaccel_output_format = AV_PIX_FMT_QSV; + } else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "mediacodec")) { + // There is no real AVHWFrameContext implementation. Set + // hwaccel_output_format to avoid av_hwframe_transfer_data error. + ist->hwaccel_output_format = AV_PIX_FMT_MEDIACODEC; + } else if (hwaccel_output_format) { + ist->hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format); + if (ist->hwaccel_output_format == AV_PIX_FMT_NONE) { + av_log(NULL, AV_LOG_FATAL, "Unrecognised hwaccel output " + "format: %s", hwaccel_output_format); + } + } else { + ist->hwaccel_output_format = AV_PIX_FMT_NONE; + } + + if (hwaccel) { + // The NVDEC hwaccels use a CUDA device, so remap the name here. + if (!strcmp(hwaccel, "nvdec") || !strcmp(hwaccel, "cuvid")) + hwaccel = "cuda"; + + if (!strcmp(hwaccel, "none")) + ist->hwaccel_id = HWACCEL_NONE; + else if (!strcmp(hwaccel, "auto")) + ist->hwaccel_id = HWACCEL_AUTO; + else { + enum AVHWDeviceType type = av_hwdevice_find_type_by_name(hwaccel); + if (type != AV_HWDEVICE_TYPE_NONE) { + ist->hwaccel_id = HWACCEL_GENERIC; + ist->hwaccel_device_type = type; + } + + if (!ist->hwaccel_id) { + av_log(NULL, AV_LOG_FATAL, "Unrecognized hwaccel: %s.\n", + hwaccel); + av_log(NULL, AV_LOG_FATAL, "Supported hwaccels: "); + type = AV_HWDEVICE_TYPE_NONE; + while ((type = av_hwdevice_iterate_types(type)) != + AV_HWDEVICE_TYPE_NONE) + av_log(NULL, AV_LOG_FATAL, "%s ", + av_hwdevice_get_type_name(type)); + av_log(NULL, AV_LOG_FATAL, "\n"); + exit_program(1); + } + } + } + + MATCH_PER_STREAM_OPT(hwaccel_devices, str, hwaccel_device, ic, st); + if (hwaccel_device) { + ist->hwaccel_device = av_strdup(hwaccel_device); + if (!ist->hwaccel_device) + report_and_exit(AVERROR(ENOMEM)); + } + + ist->hwaccel_pix_fmt = AV_PIX_FMT_NONE; + } + + ist->dec = choose_decoder(o, ic, st, ist->hwaccel_id, ist->hwaccel_device_type); + ist->decoder_opts = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id, ic, st, ist->dec); + + ist->reinit_filters = -1; + MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st); + + MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st); + ist->user_set_discard = AVDISCARD_NONE; + + if ((o->video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) || + (o->audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) || + (o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) || + (o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA)) + ist->user_set_discard = AVDISCARD_ALL; + + if (discard_str && av_opt_eval_int(&cc, discard_opt, discard_str, &ist->user_set_discard) < 0) { + av_log(NULL, AV_LOG_ERROR, "Error parsing discard %s.\n", + discard_str); + exit_program(1); + } + + ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE; + ist->prev_pkt_pts = AV_NOPTS_VALUE; + + ist->dec_ctx = avcodec_alloc_context3(ist->dec); + if (!ist->dec_ctx) + report_and_exit(AVERROR(ENOMEM)); + + ret = avcodec_parameters_to_context(ist->dec_ctx, par); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error initializing the decoder context.\n"); + exit_program(1); + } + + ist->decoded_frame = av_frame_alloc(); + if (!ist->decoded_frame) + report_and_exit(AVERROR(ENOMEM)); + + ist->pkt = av_packet_alloc(); + if (!ist->pkt) + report_and_exit(AVERROR(ENOMEM)); + + if (o->bitexact) + ist->dec_ctx->flags |= AV_CODEC_FLAG_BITEXACT; + + switch (par->codec_type) { + case AVMEDIA_TYPE_VIDEO: + // avformat_find_stream_info() doesn't set this for us anymore. + ist->dec_ctx->framerate = st->avg_frame_rate; + + MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st); + if (framerate && av_parse_video_rate(&ist->framerate, + framerate) < 0) { + av_log(NULL, AV_LOG_ERROR, "Error parsing framerate %s.\n", + framerate); + exit_program(1); + } + + ist->top_field_first = -1; + MATCH_PER_STREAM_OPT(top_field_first, i, ist->top_field_first, ic, st); + + ist->framerate_guessed = av_guess_frame_rate(ic, st, NULL); + + break; + case AVMEDIA_TYPE_AUDIO: + ist->guess_layout_max = INT_MAX; + MATCH_PER_STREAM_OPT(guess_layout_max, i, ist->guess_layout_max, ic, st); + guess_input_channel_layout(ist); + break; + case AVMEDIA_TYPE_DATA: + case AVMEDIA_TYPE_SUBTITLE: { + char *canvas_size = NULL; + MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st); + MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st); + if (canvas_size && + av_parse_video_size(&ist->dec_ctx->width, &ist->dec_ctx->height, canvas_size) < 0) { + av_log(NULL, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size); + exit_program(1); + } + break; + } + case AVMEDIA_TYPE_ATTACHMENT: + case AVMEDIA_TYPE_UNKNOWN: + break; + default: + abort(); + } + + ist->par = avcodec_parameters_alloc(); + if (!ist->par) + report_and_exit(AVERROR(ENOMEM)); + + ret = avcodec_parameters_from_context(ist->par, ist->dec_ctx); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error initializing the decoder context.\n"); + exit_program(1); + } + } +} + +static void dump_attachment(AVStream *st, const char *filename) +{ + int ret; + AVIOContext *out = NULL; + const AVDictionaryEntry *e; + + if (!st->codecpar->extradata_size) { + av_log(NULL, AV_LOG_WARNING, "No extradata to dump in stream #%d:%d.\n", + nb_input_files - 1, st->index); + return; + } + if (!*filename && (e = av_dict_get(st->metadata, "filename", NULL, 0))) + filename = e->value; + if (!*filename) { + av_log(NULL, AV_LOG_FATAL, "No filename specified and no 'filename' tag" + "in stream #%d:%d.\n", nb_input_files - 1, st->index); + exit_program(1); + } + + assert_file_overwrite(filename); + + if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, &int_cb, NULL)) < 0) { + av_log(NULL, AV_LOG_FATAL, "Could not open file %s for writing.\n", + filename); + exit_program(1); + } + + avio_write(out, st->codecpar->extradata, st->codecpar->extradata_size); + avio_flush(out); + avio_close(out); +} + +int ifile_open(const OptionsContext *o, const char *filename) +{ + Demuxer *d; + InputFile *f; + AVFormatContext *ic; + const AVInputFormat *file_iformat = NULL; + int err, i, ret; + int64_t timestamp; + AVDictionary *unused_opts = NULL; + const AVDictionaryEntry *e = NULL; + char * video_codec_name = NULL; + char * audio_codec_name = NULL; + char *subtitle_codec_name = NULL; + char * data_codec_name = NULL; + int scan_all_pmts_set = 0; + + int64_t start_time = o->start_time; + int64_t start_time_eof = o->start_time_eof; + int64_t stop_time = o->stop_time; + int64_t recording_time = o->recording_time; + + if (stop_time != INT64_MAX && recording_time != INT64_MAX) { + stop_time = INT64_MAX; + av_log(NULL, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n"); + } + + if (stop_time != INT64_MAX && recording_time == INT64_MAX) { + int64_t start = start_time == AV_NOPTS_VALUE ? 0 : start_time; + if (stop_time <= start) { + av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n"); + exit_program(1); + } else { + recording_time = stop_time - start; + } + } + + if (o->format) { + if (!(file_iformat = av_find_input_format(o->format))) { + av_log(NULL, AV_LOG_FATAL, "Unknown input format: '%s'\n", o->format); + exit_program(1); + } + } + + if (!strcmp(filename, "-")) + filename = "fd:"; + + stdin_interaction &= strncmp(filename, "pipe:", 5) && + strcmp(filename, "fd:") && + strcmp(filename, "/dev/stdin"); + + /* get default parameters from command line */ + ic = avformat_alloc_context(); + if (!ic) + report_and_exit(AVERROR(ENOMEM)); + if (o->nb_audio_sample_rate) { + av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0); + } + if (o->nb_audio_channels) { + const AVClass *priv_class; + if (file_iformat && (priv_class = file_iformat->priv_class) && + av_opt_find(&priv_class, "ch_layout", NULL, 0, + AV_OPT_SEARCH_FAKE_OBJ)) { + char buf[32]; + snprintf(buf, sizeof(buf), "%dC", o->audio_channels[o->nb_audio_channels - 1].u.i); + av_dict_set(&o->g->format_opts, "ch_layout", buf, 0); + } + } + if (o->nb_audio_ch_layouts) { + const AVClass *priv_class; + if (file_iformat && (priv_class = file_iformat->priv_class) && + av_opt_find(&priv_class, "ch_layout", NULL, 0, + AV_OPT_SEARCH_FAKE_OBJ)) { + av_dict_set(&o->g->format_opts, "ch_layout", o->audio_ch_layouts[o->nb_audio_ch_layouts - 1].u.str, 0); + } + } + if (o->nb_frame_rates) { + const AVClass *priv_class; + /* set the format-level framerate option; + * this is important for video grabbers, e.g. x11 */ + if (file_iformat && (priv_class = file_iformat->priv_class) && + av_opt_find(&priv_class, "framerate", NULL, 0, + AV_OPT_SEARCH_FAKE_OBJ)) { + av_dict_set(&o->g->format_opts, "framerate", + o->frame_rates[o->nb_frame_rates - 1].u.str, 0); + } + } + if (o->nb_frame_sizes) { + av_dict_set(&o->g->format_opts, "video_size", o->frame_sizes[o->nb_frame_sizes - 1].u.str, 0); + } + if (o->nb_frame_pix_fmts) + av_dict_set(&o->g->format_opts, "pixel_format", o->frame_pix_fmts[o->nb_frame_pix_fmts - 1].u.str, 0); + + MATCH_PER_TYPE_OPT(codec_names, str, video_codec_name, ic, "v"); + MATCH_PER_TYPE_OPT(codec_names, str, audio_codec_name, ic, "a"); + MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, ic, "s"); + MATCH_PER_TYPE_OPT(codec_names, str, data_codec_name, ic, "d"); + + if (video_codec_name) + ic->video_codec = find_codec_or_die(NULL, video_codec_name , AVMEDIA_TYPE_VIDEO , 0); + if (audio_codec_name) + ic->audio_codec = find_codec_or_die(NULL, audio_codec_name , AVMEDIA_TYPE_AUDIO , 0); + if (subtitle_codec_name) + ic->subtitle_codec = find_codec_or_die(NULL, subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0); + if (data_codec_name) + ic->data_codec = find_codec_or_die(NULL, data_codec_name , AVMEDIA_TYPE_DATA , 0); + + ic->video_codec_id = video_codec_name ? ic->video_codec->id : AV_CODEC_ID_NONE; + ic->audio_codec_id = audio_codec_name ? ic->audio_codec->id : AV_CODEC_ID_NONE; + ic->subtitle_codec_id = subtitle_codec_name ? ic->subtitle_codec->id : AV_CODEC_ID_NONE; + ic->data_codec_id = data_codec_name ? ic->data_codec->id : AV_CODEC_ID_NONE; + + ic->flags |= AVFMT_FLAG_NONBLOCK; + if (o->bitexact) + ic->flags |= AVFMT_FLAG_BITEXACT; + ic->interrupt_callback = int_cb; + + if (!av_dict_get(o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { + av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); + scan_all_pmts_set = 1; + } + /* open the input file with generic avformat function */ + err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts); + if (err < 0) { + print_error(filename, err); + if (err == AVERROR_PROTOCOL_NOT_FOUND) + av_log(NULL, AV_LOG_ERROR, "Did you mean file:%s?\n", filename); + exit_program(1); + } + if (scan_all_pmts_set) + av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); + remove_avoptions(&o->g->format_opts, o->g->codec_opts); + assert_avoptions(o->g->format_opts); + + /* apply forced codec ids */ + for (i = 0; i < ic->nb_streams; i++) + choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE); + + if (o->find_stream_info) { + AVDictionary **opts = setup_find_stream_info_opts(ic, o->g->codec_opts); + int orig_nb_streams = ic->nb_streams; + + /* If not enough info to get the stream parameters, we decode the + first frames to get it. (used in mpeg case for example) */ + ret = avformat_find_stream_info(ic, opts); + + for (i = 0; i < orig_nb_streams; i++) + av_dict_free(&opts[i]); + av_freep(&opts); + + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename); + if (ic->nb_streams == 0) { + avformat_close_input(&ic); + exit_program(1); + } + } + } + + if (start_time != AV_NOPTS_VALUE && start_time_eof != AV_NOPTS_VALUE) { + av_log(NULL, AV_LOG_WARNING, "Cannot use -ss and -sseof both, using -ss for %s\n", filename); + start_time_eof = AV_NOPTS_VALUE; + } + + if (start_time_eof != AV_NOPTS_VALUE) { + if (start_time_eof >= 0) { + av_log(NULL, AV_LOG_ERROR, "-sseof value must be negative; aborting\n"); + exit_program(1); + } + if (ic->duration > 0) { + start_time = start_time_eof + ic->duration; + if (start_time < 0) { + av_log(NULL, AV_LOG_WARNING, "-sseof value seeks to before start of file %s; ignored\n", filename); + start_time = AV_NOPTS_VALUE; + } + } else + av_log(NULL, AV_LOG_WARNING, "Cannot use -sseof, duration of %s not known\n", filename); + } + timestamp = (start_time == AV_NOPTS_VALUE) ? 0 : start_time; + /* add the stream start time */ + if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE) + timestamp += ic->start_time; + + /* if seeking requested, we execute it */ + if (start_time != AV_NOPTS_VALUE) { + int64_t seek_timestamp = timestamp; + + if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) { + int dts_heuristic = 0; + for (i=0; inb_streams; i++) { + const AVCodecParameters *par = ic->streams[i]->codecpar; + if (par->video_delay) { + dts_heuristic = 1; + break; + } + } + if (dts_heuristic) { + seek_timestamp -= 3*AV_TIME_BASE / 23; + } + } + ret = avformat_seek_file(ic, -1, INT64_MIN, seek_timestamp, seek_timestamp, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n", + filename, (double)timestamp / AV_TIME_BASE); + } + } + + d = allocate_array_elem(&input_files, sizeof(*d), &nb_input_files); + f = &d->f; + + f->ctx = ic; + f->index = nb_input_files - 1; + f->start_time = start_time; + f->recording_time = recording_time; + f->input_sync_ref = o->input_sync_ref; + f->input_ts_offset = o->input_ts_offset; + f->ts_offset = o->input_ts_offset - (copy_ts ? (start_at_zero && ic->start_time != AV_NOPTS_VALUE ? ic->start_time : 0) : timestamp); + f->rate_emu = o->rate_emu; + f->accurate_seek = o->accurate_seek; + d->loop = o->loop; + d->duration = 0; + d->time_base = (AVRational){ 1, 1 }; + + f->readrate = o->readrate ? o->readrate : 0.0; + if (f->readrate < 0.0f) { + av_log(NULL, AV_LOG_ERROR, "Option -readrate for Input #%d is %0.3f; it must be non-negative.\n", f->index, f->readrate); + exit_program(1); + } + if (f->readrate && f->rate_emu) { + av_log(NULL, AV_LOG_WARNING, "Both -readrate and -re set for Input #%d. Using -readrate %0.3f.\n", f->index, f->readrate); + f->rate_emu = 0; + } + + d->thread_queue_size = o->thread_queue_size; + + /* update the current parameters so that they match the one of the input stream */ + add_input_streams(o, d); + + /* dump the file content */ + av_dump_format(ic, f->index, filename, 0); + + /* check if all codec options have been used */ + unused_opts = strip_specifiers(o->g->codec_opts); + for (i = 0; i < f->nb_streams; i++) { + e = NULL; + while ((e = av_dict_iterate(f->streams[i]->decoder_opts, e))) + av_dict_set(&unused_opts, e->key, NULL, 0); + } + + e = NULL; + while ((e = av_dict_iterate(unused_opts, e))) { + const AVClass *class = avcodec_get_class(); + const AVOption *option = av_opt_find(&class, e->key, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); + const AVClass *fclass = avformat_get_class(); + const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); + if (!option || foption) + continue; + + + if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) { + av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for " + "input file #%d (%s) is not a decoding option.\n", e->key, + option->help ? option->help : "", f->index, + filename); + exit_program(1); + } + + av_log(NULL, AV_LOG_WARNING, "Codec AVOption %s (%s) specified for " + "input file #%d (%s) has not been used for any stream. The most " + "likely reason is either wrong type (e.g. a video option with " + "no video streams) or that it is a private option of some decoder " + "which was not actually used for any stream.\n", e->key, + option->help ? option->help : "", f->index, filename); + } + av_dict_free(&unused_opts); + + for (i = 0; i < o->nb_dump_attachment; i++) { + int j; + + for (j = 0; j < ic->nb_streams; j++) { + AVStream *st = ic->streams[j]; + + if (check_stream_specifier(ic, st, o->dump_attachment[i].specifier) == 1) + dump_attachment(st, o->dump_attachment[i].u.str); + } + } + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_filter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_filter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_filter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_filter.c 2023-03-03 13:29:59.000000000 +0000 @@ -52,8 +52,9 @@ } } -static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx, - const AVCodec *codec, enum AVPixelFormat target) +static enum AVPixelFormat +choose_pixel_fmt(const AVCodec *codec, enum AVPixelFormat target, + int strict_std_compliance) { if (codec && codec->pix_fmts) { const enum AVPixelFormat *p = codec->pix_fmts; @@ -62,7 +63,7 @@ int has_alpha = desc ? desc->nb_components % 2 == 0 : 0; enum AVPixelFormat best= AV_PIX_FMT_NONE; - if (enc_ctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { + if (strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { p = get_compliance_normal_pix_fmts(codec, p); } for (; *p != AV_PIX_FMT_NONE; p++) { @@ -89,6 +90,7 @@ static const char *choose_pix_fmts(OutputFilter *ofilter, AVBPrint *bprint) { OutputStream *ost = ofilter->ost; + AVCodecContext *enc = ost->enc_ctx; const AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0); if (strict_dict) // used by choose_pixel_fmt() and below @@ -102,13 +104,14 @@ return av_get_pix_fmt_name(ost->enc_ctx->pix_fmt); } if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { - return av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc_ctx, ost->enc, ost->enc_ctx->pix_fmt)); - } else if (ost->enc && ost->enc->pix_fmts) { + return av_get_pix_fmt_name(choose_pixel_fmt(enc->codec, enc->pix_fmt, + ost->enc_ctx->strict_std_compliance)); + } else if (enc->codec->pix_fmts) { const enum AVPixelFormat *p; - p = ost->enc->pix_fmts; + p = enc->codec->pix_fmts; if (ost->enc_ctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { - p = get_compliance_normal_pix_fmts(ost->enc, p); + p = get_compliance_normal_pix_fmts(enc->codec, p); } for (; *p != AV_PIX_FMT_NONE; p++) { @@ -116,7 +119,7 @@ av_bprintf(bprint, "%s%c", name, p[1] == AV_PIX_FMT_NONE ? '\0' : '|'); } if (!av_bprint_is_complete(bprint)) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); return bprint->str; } else return NULL; @@ -180,7 +183,7 @@ InputFilter *ifilter; if (!fg) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); fg->index = nb_filtergraphs; ofilter = ALLOC_ARRAY_ELEM(fg->outputs, fg->nb_outputs); @@ -197,7 +200,7 @@ ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW); if (!ifilter->frame_queue) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); GROW_ARRAY(ist->filters, ist->nb_filters); ist->filters[ist->nb_filters - 1] = ifilter; @@ -221,7 +224,7 @@ res = av_asprintf("%s:%s", ctx->filter->name, avfilter_pad_get_name(pads, inout->pad_idx)); if (!res) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); return res; } @@ -268,7 +271,7 @@ "matches no streams.\n", p, fg->graph_desc); exit_program(1); } - ist = input_streams[input_files[file_idx]->ist_index + st->index]; + ist = input_files[file_idx]->streams[st->index]; if (ist->user_set_discard == AVDISCARD_ALL) { av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s " "matches a disabled input stream.\n", p, fg->graph_desc); @@ -276,14 +279,13 @@ } } else { /* find the first unused stream of corresponding type */ - for (i = 0; i < nb_input_streams; i++) { - ist = input_streams[i]; + for (ist = ist_iter(NULL); ist; ist = ist_iter(ist)) { if (ist->user_set_discard == AVDISCARD_ALL) continue; if (ist->dec_ctx->codec_type == type && ist->discard) break; } - if (i == nb_input_streams) { + if (!ist) { av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for " "unlabeled input pad %d on filter %s\n", in->pad_idx, in->filter_ctx->name); @@ -306,12 +308,162 @@ ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW); if (!ifilter->frame_queue) - exit_program(1); + report_and_exit(AVERROR(ENOMEM)); GROW_ARRAY(ist->filters, ist->nb_filters); ist->filters[ist->nb_filters - 1] = ifilter; } +static int read_binary(const char *path, uint8_t **data, int *len) +{ + AVIOContext *io = NULL; + int64_t fsize; + int ret; + + *data = NULL; + *len = 0; + + ret = avio_open2(&io, path, AVIO_FLAG_READ, &int_cb, NULL); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Cannot open file '%s': %s\n", + path, av_err2str(ret)); + return ret; + } + + fsize = avio_size(io); + if (fsize < 0 || fsize > INT_MAX) { + av_log(NULL, AV_LOG_ERROR, "Cannot obtain size of file %s\n", path); + ret = AVERROR(EIO); + goto fail; + } + + *data = av_malloc(fsize); + if (!*data) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ret = avio_read(io, *data, fsize); + if (ret != fsize) { + av_log(NULL, AV_LOG_ERROR, "Error reading file %s\n", path); + ret = ret < 0 ? ret : AVERROR(EIO); + goto fail; + } + + *len = fsize; + + return 0; +fail: + avio_close(io); + av_freep(data); + *len = 0; + return ret; +} + +static int filter_opt_apply(AVFilterContext *f, const char *key, const char *val) +{ + const AVOption *o; + int ret; + + ret = av_opt_set(f, key, val, AV_OPT_SEARCH_CHILDREN); + if (ret >= 0) + return 0; + + if (ret == AVERROR_OPTION_NOT_FOUND && key[0] == '/') + o = av_opt_find(f, key + 1, NULL, 0, AV_OPT_SEARCH_CHILDREN); + if (!o) + goto err_apply; + + // key is a valid option name prefixed with '/' + // interpret value as a path from which to load the actual option value + key++; + + if (o->type == AV_OPT_TYPE_BINARY) { + uint8_t *data; + int len; + + ret = read_binary(val, &data, &len); + if (ret < 0) + goto err_load; + + ret = av_opt_set_bin(f, key, data, len, AV_OPT_SEARCH_CHILDREN); + av_freep(&data); + } else { + char *data = file_read(val); + if (!data) { + ret = AVERROR(EIO); + goto err_load; + } + + ret = av_opt_set(f, key, data, AV_OPT_SEARCH_CHILDREN); + av_freep(&data); + } + if (ret < 0) + goto err_apply; + + return 0; + +err_apply: + av_log(NULL, AV_LOG_ERROR, + "Error applying option '%s' to filter '%s': %s\n", + key, f->filter->name, av_err2str(ret)); + return ret; +err_load: + av_log(NULL, AV_LOG_ERROR, + "Error loading value for option '%s' from file '%s'\n", + key, val); + return ret; +} + +static int graph_opts_apply(AVFilterGraphSegment *seg) +{ + for (size_t i = 0; i < seg->nb_chains; i++) { + AVFilterChain *ch = seg->chains[i]; + + for (size_t j = 0; j < ch->nb_filters; j++) { + AVFilterParams *p = ch->filters[j]; + const AVDictionaryEntry *e = NULL; + + av_assert0(p->filter); + + while ((e = av_dict_iterate(p->opts, e))) { + int ret = filter_opt_apply(p->filter, e->key, e->value); + if (ret < 0) + return ret; + } + + av_dict_free(&p->opts); + } + } + + return 0; +} + +static int graph_parse(AVFilterGraph *graph, const char *desc, + AVFilterInOut **inputs, AVFilterInOut **outputs) +{ + AVFilterGraphSegment *seg; + int ret; + + ret = avfilter_graph_segment_parse(graph, desc, 0, &seg); + if (ret < 0) + return ret; + + ret = avfilter_graph_segment_create_filters(seg, 0); + if (ret < 0) + goto fail; + + ret = graph_opts_apply(seg); + if (ret < 0) + goto fail; + + ret = avfilter_graph_segment_apply(seg, 0, inputs, outputs); + +fail: + avfilter_graph_segment_free(&seg); + return ret; +} + int init_complex_filtergraph(FilterGraph *fg) { AVFilterInOut *inputs, *outputs, *cur; @@ -325,7 +477,7 @@ return AVERROR(ENOMEM); graph->nb_threads = 1; - ret = avfilter_graph_parse2(graph, fg->graph_desc, &inputs, &outputs); + ret = graph_parse(graph, fg->graph_desc, &inputs, &outputs); if (ret < 0) goto fail; @@ -450,8 +602,7 @@ snprintf(args, sizeof(args), "%d:%d", ofilter->width, ofilter->height); - while ((e = av_dict_get(ost->sws_dict, "", e, - AV_DICT_IGNORE_SUFFIX))) { + while ((e = av_dict_iterate(ost->sws_dict, e))) { av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value); } @@ -558,6 +709,7 @@ pad_idx = 0; \ } while (0) av_bprint_init(&args, 0, AV_BPRINT_SIZE_UNLIMITED); +#if FFMPEG_OPT_MAP_CHANNEL if (ost->audio_channels_mapped) { AVChannelLayout mapped_layout = { 0 }; int i; @@ -570,6 +722,7 @@ AUTO_INSERT_FILTER("-map_channel", "pan", args.str); av_bprint_clear(&args); } +#endif if (codec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) av_channel_layout_default(&codec->ch_layout, codec->ch_layout.nb_channels); @@ -603,11 +756,11 @@ if (ost->apad && of->shortest) { int i; - for (i=0; ictx->nb_streams; i++) - if (of->ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) + for (i = 0; i < of->nb_streams; i++) + if (of->streams[i]->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) break; - if (ictx->nb_streams) { + if (i < of->nb_streams) { AUTO_INSERT_FILTER("-apad", "apad", ost->apad); } } @@ -734,7 +887,7 @@ } if (!fr.num) - fr = av_guess_frame_rate(input_files[ist->file_index]->ctx, ist->st, NULL); + fr = ist->framerate_guessed; if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { ret = sub2video_prepare(ist, ifilter); @@ -887,40 +1040,6 @@ last_filter = filt_ctx; \ } while (0) - if (audio_sync_method > 0) { - char args[256] = {0}; - - av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method); - if (audio_drift_threshold != 0.1) - av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold); - if (!fg->reconfiguration) - av_strlcatf(args, sizeof(args), ":first_pts=0"); - AUTO_INSERT_FILTER_INPUT("-async", "aresample", args); - } - -// if (ost->audio_channels_mapped) { -// int i; -// AVBPrint pan_buf; -// av_bprint_init(&pan_buf, 256, 8192); -// av_bprintf(&pan_buf, "0x%"PRIx64, -// av_get_default_channel_layout(ost->audio_channels_mapped)); -// for (i = 0; i < ost->audio_channels_mapped; i++) -// if (ost->audio_channels_map[i] != -1) -// av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]); -// AUTO_INSERT_FILTER_INPUT("-map_channel", "pan", pan_buf.str); -// av_bprint_finalize(&pan_buf, NULL); -// } - - if (audio_volume != 256) { - char args[256]; - - av_log(NULL, AV_LOG_WARNING, "-vol has been deprecated. Use the volume " - "audio filter instead.\n"); - - snprintf(args, sizeof(args), "%f", audio_volume / 256.); - AUTO_INSERT_FILTER_INPUT("-vol", "volume", args); - } - snprintf(name, sizeof(name), "trim for input stream %d:%d", ist->file_index, ist->st->index); if (copy_ts) { @@ -1003,44 +1122,39 @@ if (simple) { OutputStream *ost = fg->outputs[0]->ost; - char args[512]; - const AVDictionaryEntry *e = NULL; if (filter_nbthreads) { ret = av_opt_set(fg->graph, "threads", filter_nbthreads, 0); if (ret < 0) goto fail; } else { + const AVDictionaryEntry *e = NULL; e = av_dict_get(ost->encoder_opts, "threads", NULL, 0); if (e) av_opt_set(fg->graph, "threads", e->value, 0); } - args[0] = 0; - e = NULL; - while ((e = av_dict_get(ost->sws_dict, "", e, - AV_DICT_IGNORE_SUFFIX))) { - av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value); - } - if (strlen(args)) { - args[strlen(args)-1] = 0; - fg->graph->scale_sws_opts = av_strdup(args); - } - - args[0] = 0; - e = NULL; - while ((e = av_dict_get(ost->swr_opts, "", e, - AV_DICT_IGNORE_SUFFIX))) { - av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value); - } - if (strlen(args)) - args[strlen(args)-1] = 0; - av_opt_set(fg->graph, "aresample_swr_opts", args, 0); + if (av_dict_count(ost->sws_dict)) { + ret = av_dict_get_string(ost->sws_dict, + &fg->graph->scale_sws_opts, + '=', ':'); + if (ret < 0) + goto fail; + } + + if (av_dict_count(ost->swr_opts)) { + char *args; + ret = av_dict_get_string(ost->swr_opts, &args, '=', ':'); + if (ret < 0) + goto fail; + av_opt_set(fg->graph, "aresample_swr_opts", args, 0); + av_free(args); + } } else { fg->graph->nb_threads = filter_complex_nbthreads; } - if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0) + if ((ret = graph_parse(fg->graph, graph_desc, &inputs, &outputs)) < 0) goto fail; ret = hw_device_setup_for_filter(fg); @@ -1114,16 +1228,8 @@ for (i = 0; i < fg->nb_outputs; i++) { OutputStream *ost = fg->outputs[i]->ost; - if (!ost->enc) { - /* identical to the same check in ffmpeg.c, needed because - complex filter graphs are initialized earlier */ - av_log(NULL, AV_LOG_ERROR, "Encoder (codec %s) not found for output stream #%d:%d\n", - avcodec_get_name(ost->st->codecpar->codec_id), ost->file_index, ost->index); - ret = AVERROR(EINVAL); - goto fail; - } - if (ost->enc->type == AVMEDIA_TYPE_AUDIO && - !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) + if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO && + !(ost->enc_ctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) av_buffersink_set_frame_size(ost->filter->filter, ost->enc_ctx->frame_size); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,11 +21,13 @@ #include "config.h" +#include #include #include #include #include "cmdutils.h" +#include "sync_queue.h" #include "libavformat/avformat.h" #include "libavformat/avio.h" @@ -47,6 +49,12 @@ #include "libswresample/swresample.h" +// deprecated features +#define FFMPEG_OPT_PSNR 1 +#define FFMPEG_OPT_MAP_CHANNEL 1 +#define FFMPEG_OPT_MAP_SYNC 1 +#define FFMPEG_ROTATION_METADATA 1 + enum VideoSyncMethod { VSYNC_AUTO = -1, VSYNC_PASSTHROUGH, @@ -75,15 +83,15 @@ int disabled; /* 1 is this mapping is disabled by a negative map */ int file_index; int stream_index; - int sync_file_index; - int sync_stream_index; char *linklabel; /* name of an output link, for mapping lavfi outputs */ } StreamMap; +#if FFMPEG_OPT_MAP_CHANNEL typedef struct { int file_idx, stream_idx, channel_idx; // input int ofile_idx, ostream_idx; // output } AudioChannelMap; +#endif typedef struct OptionsContext { OptionGroup *g; @@ -119,6 +127,7 @@ int accurate_seek; int thread_queue_size; int input_sync_ref; + int find_stream_info; SpecifierOpt *ts_scale; int nb_ts_scale; @@ -136,11 +145,10 @@ /* output options */ StreamMap *stream_maps; int nb_stream_maps; +#if FFMPEG_OPT_MAP_CHANNEL AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */ int nb_audio_channel_maps; /* number of (valid) -map_channel settings */ - int metadata_global_manual; - int metadata_streams_manual; - int metadata_chapters_manual; +#endif const char **attachments; int nb_attachments; @@ -148,9 +156,10 @@ int64_t recording_time; int64_t stop_time; - uint64_t limit_filesize; + int64_t limit_filesize; float mux_preload; float mux_max_delay; + float shortest_buf_duration; int shortest; int bitexact; @@ -183,6 +192,12 @@ int nb_force_fps; SpecifierOpt *frame_aspect_ratios; int nb_frame_aspect_ratios; + SpecifierOpt *display_rotations; + int nb_display_rotations; + SpecifierOpt *display_hflips; + int nb_display_hflips; + SpecifierOpt *display_vflips; + int nb_display_vflips; SpecifierOpt *rc_overrides; int nb_rc_overrides; SpecifierOpt *intra_matrices; @@ -209,6 +224,8 @@ int nb_reinit_filters; SpecifierOpt *fix_sub_duration; int nb_fix_sub_duration; + SpecifierOpt *fix_sub_duration_heartbeat; + int nb_fix_sub_duration_heartbeat; SpecifierOpt *canvas_sizes; int nb_canvas_sizes; SpecifierOpt *pass; @@ -237,6 +254,18 @@ int nb_autoscale; SpecifierOpt *bits_per_raw_sample; int nb_bits_per_raw_sample; + SpecifierOpt *enc_stats_pre; + int nb_enc_stats_pre; + SpecifierOpt *enc_stats_post; + int nb_enc_stats_post; + SpecifierOpt *mux_stats; + int nb_mux_stats; + SpecifierOpt *enc_stats_pre_fmt; + int nb_enc_stats_pre_fmt; + SpecifierOpt *enc_stats_post_fmt; + int nb_enc_stats_post_fmt; + SpecifierOpt *mux_stats_fmt; + int nb_mux_stats_fmt; } OptionsContext; typedef struct InputFilter { @@ -312,12 +341,22 @@ #define DECODING_FOR_OST 1 #define DECODING_FOR_FILTER 2 int processing_needed; /* non zero if the packets must be processed */ + // should attach FrameData as opaque_ref after decoding + int want_frame_data; + /** + * Codec parameters - to be used by the decoding/streamcopy code. + * st->codecpar should not be accessed, because it may be modified + * concurrently by the demuxing thread. + */ + AVCodecParameters *par; AVCodecContext *dec_ctx; const AVCodec *dec; AVFrame *decoded_frame; AVPacket *pkt; + AVRational framerate_guessed; + int64_t prev_pkt_pts; int64_t start; /* time when read started */ /* predicted dts of the next packet read for this stream or (when there are @@ -330,6 +369,12 @@ int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units) int wrap_correction_done; + // the value of AVCodecParserContext.repeat_pict from the AVStream parser + // for the last packet returned from ifile_get_packet() + // -1 if unknown + // FIXME: this is a hack, the avstream parser should not be used + int last_pkt_repeat_pict; + int64_t filter_in_rescale_delta_last; int64_t min_pts; /* pts with the smallest value in a current stream */ @@ -379,12 +424,8 @@ char *hwaccel_device; enum AVPixelFormat hwaccel_output_format; - /* hwaccel context */ - void *hwaccel_ctx; - void (*hwaccel_uninit)(AVCodecContext *s); int (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame); enum AVPixelFormat hwaccel_pix_fmt; - enum AVPixelFormat hwaccel_retrieved_pix_fmt; /* stats */ // combined size of all the packets read @@ -401,38 +442,46 @@ int got_output; } InputStream; +typedef struct LastFrameDuration { + int stream_idx; + int64_t duration; +} LastFrameDuration; + typedef struct InputFile { + int index; + AVFormatContext *ctx; int eof_reached; /* true if eof reached */ int eagain; /* true if last read attempt returned EAGAIN */ - int ist_index; /* index of first stream in input_streams */ - int loop; /* set number of times input stream should be looped */ - int64_t duration; /* actual duration of the longest stream in a file - at the moment when looping happens */ - AVRational time_base; /* time base of the duration */ int64_t input_ts_offset; int input_sync_ref; - + /** + * Effective format start time based on enabled streams. + */ + int64_t start_time_effective; int64_t ts_offset; + /** + * Extra timestamp offset added by discontinuity handling. + */ + int64_t ts_offset_discont; int64_t last_ts; int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */ int64_t recording_time; - int nb_streams; /* number of stream that ffmpeg is aware of; may be different - from ctx.nb_streams if new streams appear during av_read_frame() */ - int nb_streams_warn; /* number of streams that the user was warned of */ + + /* streams that ffmpeg is aware of; + * there may be extra streams in ctx that are not mapped to an InputStream + * if new streams appear dynamically during demuxing */ + InputStream **streams; + int nb_streams; + int rate_emu; float readrate; int accurate_seek; - AVPacket *pkt; - -#if HAVE_THREADS - AVThreadMessageQueue *in_thread_queue; - pthread_t thread; /* thread reading from this file */ - int non_blocking; /* reading packets from the thread should not block */ - int joined; /* the thread has been joined */ - int thread_queue_size; /* maximum number of queued packets */ -#endif + /* when looping the input file, this queue is used by decoders to report + * the last frame duration back to the demuxer thread */ + AVThreadMessageQueue *audio_duration_queue; + int audio_duration_queue_size; } InputFile; enum forced_keyframes_const { @@ -447,6 +496,41 @@ #define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0) #define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1) +enum EncStatsType { + ENC_STATS_LITERAL = 0, + ENC_STATS_FILE_IDX, + ENC_STATS_STREAM_IDX, + ENC_STATS_FRAME_NUM, + ENC_STATS_FRAME_NUM_IN, + ENC_STATS_TIMEBASE, + ENC_STATS_TIMEBASE_IN, + ENC_STATS_PTS, + ENC_STATS_PTS_TIME, + ENC_STATS_PTS_IN, + ENC_STATS_PTS_TIME_IN, + ENC_STATS_DTS, + ENC_STATS_DTS_TIME, + ENC_STATS_SAMPLE_NUM, + ENC_STATS_NB_SAMPLES, + ENC_STATS_PKT_SIZE, + ENC_STATS_BITRATE, + ENC_STATS_AVG_BITRATE, +}; + +typedef struct EncStatsComponent { + enum EncStatsType type; + + uint8_t *str; + size_t str_len; +} EncStatsComponent; + +typedef struct EncStats { + EncStatsComponent *components; + int nb_components; + + AVIOContext *io; +} EncStats; + extern const char *const forced_keyframes_const_names[]; typedef enum { @@ -454,68 +538,92 @@ MUXER_FINISHED = 2, } OSTFinished ; +enum { + KF_FORCE_SOURCE = 1, + KF_FORCE_SOURCE_NO_DROP = 2, +}; + +typedef struct KeyframeForceCtx { + int type; + + int64_t ref_pts; + + // timestamps of the forced keyframes, in AV_TIME_BASE_Q + int64_t *pts; + int nb_pts; + int index; + + AVExpr *pexpr; + double expr_const_values[FKF_NB]; + + int dropped_keyframe; +} KeyframeForceCtx; + typedef struct OutputStream { + const AVClass *class; + int file_index; /* file index */ int index; /* stream index in the output file */ - int source_index; /* InputStream index */ + + /* input stream that is the source for this output stream; + * may be NULL for streams with no well-defined source, e.g. + * attachments or outputs from complex filtergraphs */ + InputStream *ist; + AVStream *st; /* stream in the output file */ - int encoding_needed; /* true if encoding needed for this stream */ - int64_t frame_number; - /* input pts and corresponding output pts - for A/V sync */ - struct InputStream *sync_ist; /* input stream to sync against */ - int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number - /* pts of the first frame encoded for this stream, used for limiting - * recording time */ - int64_t first_pts; - /* dts of the last packet sent to the muxer */ + /* number of frames emitted by the video-encoding sync code */ + int64_t vsync_frame_number; + /* predicted pts of the next frame to be encoded + * audio/video encoding only */ + int64_t next_pts; + /* dts of the last packet sent to the muxing queue, in AV_TIME_BASE_Q */ int64_t last_mux_dts; + /* pts of the last frame received from the filters, in AV_TIME_BASE_Q */ + int64_t last_filter_pts; + + // timestamp from which the streamcopied streams should start, + // in AV_TIME_BASE_Q; + // everything before it should be discarded + int64_t ts_copy_start; + // the timebase of the packets sent to the muxer AVRational mux_timebase; AVRational enc_timebase; - AVBSFContext *bsf_ctx; - AVCodecContext *enc_ctx; - AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */ - const AVCodec *enc; - int64_t max_frames; AVFrame *filtered_frame; AVFrame *last_frame; + AVFrame *sq_frame; AVPacket *pkt; int64_t last_dropped; int64_t last_nb0_frames[3]; - void *hwaccel_ctx; - /* video only */ AVRational frame_rate; AVRational max_frame_rate; enum VideoSyncMethod vsync_method; int is_cfr; - const char *fps_mode; int force_fps; int top_field_first; +#if FFMPEG_ROTATION_METADATA int rotate_overridden; +#endif int autoscale; + int bitexact; int bits_per_raw_sample; +#if FFMPEG_ROTATION_METADATA double rotate_override_value; +#endif AVRational frame_aspect_ratio; - /* forced key frames */ - int64_t forced_kf_ref_pts; - int64_t *forced_kf_pts; - int forced_kf_count; - int forced_kf_index; - char *forced_keyframes; - AVExpr *forced_keyframes_pexpr; - double forced_keyframes_expr_const_values[FKF_NB]; - int dropped_keyframe; + KeyframeForceCtx kf; /* audio only */ +#if FFMPEG_OPT_MAP_CHANNEL int *audio_channels_map; /* list of the channels id to pick from the source stream */ int audio_channels_mapped; /* number of channels in audio_channels_map */ +#endif char *logfile_prefix; FILE *logfile; @@ -531,7 +639,6 @@ char *apad; OSTFinished finished; /* no more packets should be written for this stream */ int unavailable; /* true if the steram is unavailable (possibly temporarily) */ - int stream_copy; // init_output_stream() has been called for this stream // The encoder and the bitstream filters have been initialized and the stream @@ -544,15 +651,16 @@ int streamcopy_started; int copy_initial_nonkeyframes; int copy_prior_start; - char *disposition; int keep_pix_fmt; /* stats */ - // combined size of all the packets written - uint64_t data_size; + // combined size of all the packets sent to the muxer + uint64_t data_size_mux; + // combined size of all the packets received from the encoder + uint64_t data_size_enc; // number of packets send to the muxer - uint64_t packets_written; + atomic_uint_least64_t packets_written; // number of frames/samples sent to the encoder uint64_t frames_encoded; uint64_t samples_encoded; @@ -562,51 +670,48 @@ /* packet quality factor */ int quality; - int max_muxing_queue_size; - - /* the packets are buffered here until the muxer is ready to be initialized */ - AVFifo *muxing_queue; - - /* - * The size of the AVPackets' buffers in queue. - * Updated when a packet is either pushed or pulled from the queue. - */ - size_t muxing_queue_data_size; - - /* Threshold after which max_muxing_queue_size will be in effect */ - size_t muxing_queue_data_threshold; - /* packet picture type */ int pict_type; /* frame encode sum of squared error values */ int64_t error[4]; + + int sq_idx_encode; + int sq_idx_mux; + + EncStats enc_stats_pre; + EncStats enc_stats_post; + + /* + * bool on whether this stream should be utilized for splitting + * subtitles utilizing fix_sub_duration at random access points. + */ + unsigned int fix_sub_duration_heartbeat; } OutputStream; typedef struct OutputFile { + const AVClass *class; + int index; const AVOutputFormat *format; + const char *url; + + OutputStream **streams; + int nb_streams; + + SyncQueue *sq_encode; - AVFormatContext *ctx; - AVDictionary *opts; - int ost_index; /* index of the first stream in output_streams */ int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units - uint64_t limit_filesize; /* filesize limit expressed in bytes */ int shortest; - - int header_written; + int bitexact; } OutputFile; -extern InputStream **input_streams; -extern int nb_input_streams; extern InputFile **input_files; extern int nb_input_files; -extern OutputStream **output_streams; -extern int nb_output_streams; extern OutputFile **output_files; extern int nb_output_files; @@ -620,13 +725,10 @@ extern float dts_delta_threshold; extern float dts_error_threshold; -extern int audio_volume; -extern int audio_sync_method; extern enum VideoSyncMethod video_sync_method; extern float frame_drop_threshold; extern int do_benchmark; extern int do_benchmark_all; -extern int do_deinterlace; extern int do_hex_dump; extern int do_pkt_dump; extern int copy_ts; @@ -639,7 +741,6 @@ extern int64_t stats_period; extern int qp_hist; extern int stdin_interaction; -extern int frame_bits_per_raw_sample; extern AVIOContext *progress_avio; extern float max_error_rate; @@ -651,15 +752,19 @@ extern const AVIOInterruptCB int_cb; extern const OptionDef options[]; -#if CONFIG_QSV -extern char *qsv_device; -#endif extern HWDevice *filter_hw_device; -extern int want_sdp; extern unsigned nb_output_dumped; extern int main_return_code; +extern int ignore_unknown_streams; +extern int copy_unknown_streams; + +extern int recast_media; + +#if FFMPEG_OPT_PSNR +extern int do_psnr; +#endif void term_init(void); void term_exit(void); @@ -669,7 +774,12 @@ void remove_avoptions(AVDictionary **a, AVDictionary *b); void assert_avoptions(AVDictionary *m); -int guess_input_channel_layout(InputStream *ist); +void assert_file_overwrite(const char *filename); +char *file_read(const char *filename); +AVDictionary *strip_specifiers(const AVDictionary *dict); +const AVCodec *find_codec_or_die(void *logctx, const char *name, + enum AVMediaType type, int encoder); +int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global); int configure_filtergraph(FilterGraph *fg); void check_filter_outputs(void); @@ -683,8 +793,9 @@ int ffmpeg_parse_options(int argc, char **argv); -int videotoolbox_init(AVCodecContext *s); -int qsv_init(AVCodecContext *s); +void enc_stats_write(OutputStream *ost, EncStats *es, + const AVFrame *frame, const AVPacket *pkt, + uint64_t frame_num); HWDevice *hw_device_get_by_name(const char *name); int hw_device_init_from_string(const char *arg, HWDevice **dev); @@ -696,12 +807,99 @@ int hwaccel_decode_init(AVCodecContext *avctx); -/* open the muxer when all the streams are initialized */ -int of_check_init(OutputFile *of); +/* + * Initialize muxing state for the given stream, should be called + * after the codec/streamcopy setup has been done. + * + * Open the muxer once all the streams have been initialized. + */ +int of_stream_init(OutputFile *of, OutputStream *ost); int of_write_trailer(OutputFile *of); +int of_open(const OptionsContext *o, const char *filename); void of_close(OutputFile **pof); -void of_write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, - int unqueue); +void of_enc_stats_close(void); + +/* + * Send a single packet to the output, applying any bitstream filters + * associated with the output stream. This may result in any number + * of packets actually being written, depending on what bitstream + * filters are applied. The supplied packet is consumed and will be + * blank (as if newly-allocated) when this function returns. + * + * If eof is set, instead indicate EOF to all bitstream filters and + * therefore flush any delayed packets to the output. A blank packet + * must be supplied in this case. + */ +void of_output_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int eof); +int64_t of_filesize(OutputFile *of); + +int ifile_open(const OptionsContext *o, const char *filename); +void ifile_close(InputFile **f); + +/** + * Get next input packet from the demuxer. + * + * @param pkt the packet is written here when this function returns 0 + * @return + * - 0 when a packet has been read successfully + * - 1 when stream end was reached, but the stream is looped; + * caller should flush decoders and read from this demuxer again + * - a negative error code on failure + */ +int ifile_get_packet(InputFile *f, AVPacket **pkt); + +/* iterate over all input streams in all input files; + * pass NULL to start iteration */ +InputStream *ist_iter(InputStream *prev); + +#define SPECIFIER_OPT_FMT_str "%s" +#define SPECIFIER_OPT_FMT_i "%i" +#define SPECIFIER_OPT_FMT_i64 "%"PRId64 +#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64 +#define SPECIFIER_OPT_FMT_f "%f" +#define SPECIFIER_OPT_FMT_dbl "%lf" + +#define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\ +{\ + char namestr[128] = "";\ + const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\ + for (int _i = 0; opt_name_##name[_i]; _i++)\ + av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[_i], opt_name_##name[_i+1] ? (opt_name_##name[_i+2] ? ", " : " or ") : "");\ + av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\ + namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\ +} + +#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ +{\ + int _ret, _matches = 0;\ + SpecifierOpt *so;\ + for (int _i = 0; _i < o->nb_ ## name; _i++) {\ + char *spec = o->name[_i].specifier;\ + if ((_ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\ + outvar = o->name[_i].u.type;\ + so = &o->name[_i];\ + _matches++;\ + } else if (_ret < 0)\ + exit_program(1);\ + }\ + if (_matches > 1)\ + WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\ +} + +#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\ +{\ + int i;\ + for (i = 0; i < o->nb_ ## name; i++) {\ + char *spec = o->name[i].specifier;\ + if (!strcmp(spec, mediatype))\ + outvar = o->name[i].u.type;\ + }\ +} + +extern const char * const opt_name_codec_names[]; +extern const char * const opt_name_codec_tags[]; +extern const char * const opt_name_frame_rates[]; +extern const char * const opt_name_top_field_first[]; #endif /* FFTOOLS_FFMPEG_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_hw.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_hw.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_hw.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_hw.c 2023-03-03 13:29:59.000000000 +0000 @@ -339,7 +339,7 @@ if (ist->hwaccel_id == HWACCEL_AUTO) { ist->hwaccel_device_type = dev->type; } else if (ist->hwaccel_device_type != dev->type) { - av_log(ist->dec_ctx, AV_LOG_ERROR, "Invalid hwaccel device " + av_log(NULL, AV_LOG_ERROR, "Invalid hwaccel device " "specified for decoder: device %s of type %s is not " "usable with hwaccel %s.\n", dev->name, av_hwdevice_get_type_name(dev->type), @@ -390,7 +390,7 @@ type = config->device_type; dev = hw_device_get_by_type(type); if (dev) { - av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto " + av_log(NULL, AV_LOG_INFO, "Using auto " "hwaccel type %s with existing device %s.\n", av_hwdevice_get_type_name(type), dev->name); } @@ -408,12 +408,12 @@ continue; } if (ist->hwaccel_device) { - av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto " + av_log(NULL, AV_LOG_INFO, "Using auto " "hwaccel type %s with new device created " "from %s.\n", av_hwdevice_get_type_name(type), ist->hwaccel_device); } else { - av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto " + av_log(NULL, AV_LOG_INFO, "Using auto " "hwaccel type %s with new default device.\n", av_hwdevice_get_type_name(type)); } @@ -421,7 +421,7 @@ if (dev) { ist->hwaccel_device_type = type; } else { - av_log(ist->dec_ctx, AV_LOG_INFO, "Auto hwaccel " + av_log(NULL, AV_LOG_INFO, "Auto hwaccel " "disabled: no device found.\n"); ist->hwaccel_id = HWACCEL_NONE; return 0; @@ -429,7 +429,7 @@ } if (!dev) { - av_log(ist->dec_ctx, AV_LOG_ERROR, "No device available " + av_log(NULL, AV_LOG_ERROR, "No device available " "for decoder: device type %s needed for codec %s.\n", av_hwdevice_get_type_name(type), ist->dec->name); return err; @@ -461,7 +461,7 @@ } for (i = 0;; i++) { - config = avcodec_get_hw_config(ost->enc, i); + config = avcodec_get_hw_config(ost->enc_ctx->codec, i); if (!config) break; @@ -472,7 +472,7 @@ av_log(ost->enc_ctx, AV_LOG_VERBOSE, "Using input " "frames context (format %s) with %s encoder.\n", av_get_pix_fmt_name(ost->enc_ctx->pix_fmt), - ost->enc->name); + ost->enc_ctx->codec->name); ost->enc_ctx->hw_frames_ctx = av_buffer_ref(frames_ref); if (!ost->enc_ctx->hw_frames_ctx) return AVERROR(ENOMEM); @@ -487,7 +487,7 @@ if (dev) { av_log(ost->enc_ctx, AV_LOG_VERBOSE, "Using device %s " "(type %s) with %s encoder.\n", dev->name, - av_hwdevice_get_type_name(dev->type), ost->enc->name); + av_hwdevice_get_type_name(dev->type), ost->enc_ctx->codec->name); ost->enc_ctx->hw_device_ctx = av_buffer_ref(dev->device_ref); if (!ost->enc_ctx->hw_device_ctx) return AVERROR(ENOMEM); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.c 2023-03-03 13:29:59.000000000 +0000 @@ -16,100 +16,78 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include "ffmpeg.h" +#include "ffmpeg_mux.h" +#include "objpool.h" +#include "sync_queue.h" +#include "thread_queue.h" #include "libavutil/fifo.h" #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/mem.h" #include "libavutil/timestamp.h" +#include "libavutil/thread.h" #include "libavcodec/packet.h" #include "libavformat/avformat.h" #include "libavformat/avio.h" -static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others) +int want_sdp = 1; + +static Muxer *mux_from_of(OutputFile *of) { - int i; - for (i = 0; i < nb_output_streams; i++) { - OutputStream *ost2 = output_streams[i]; - ost2->finished |= ost == ost2 ? this_stream : others; + return (Muxer*)of; +} + +static int64_t filesize(AVIOContext *pb) +{ + int64_t ret = -1; + + if (pb) { + ret = avio_size(pb); + if (ret <= 0) // FIXME improve avio_size() so it works with non seekable output too + ret = avio_tell(pb); } + + return ret; } -void of_write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, - int unqueue) +static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt) { - AVFormatContext *s = of->ctx; + MuxStream *ms = ms_from_ost(ost); + AVFormatContext *s = mux->fc; AVStream *st = ost->st; + int64_t fs; + uint64_t frame_num; int ret; - /* - * Audio encoders may split the packets -- #frames in != #packets out. - * But there is no reordering, so we can limit the number of output packets - * by simply dropping them here. - * Counting encoded video frames needs to be done separately because of - * reordering, see do_video_out(). - * Do not count the packet when unqueued because it has been counted when queued. - */ - if (!(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->encoding_needed) && !unqueue) { - if (ost->frame_number >= ost->max_frames) { - av_packet_unref(pkt); - return; - } - ost->frame_number++; - } - - if (!of->header_written) { - AVPacket *tmp_pkt; - /* the muxer is not initialized yet, buffer the packet */ - if (!av_fifo_can_write(ost->muxing_queue)) { - size_t cur_size = av_fifo_can_read(ost->muxing_queue); - unsigned int are_we_over_size = - (ost->muxing_queue_data_size + pkt->size) > ost->muxing_queue_data_threshold; - size_t limit = are_we_over_size ? ost->max_muxing_queue_size : SIZE_MAX; - size_t new_size = FFMIN(2 * cur_size, limit); - - if (new_size <= cur_size) { - av_log(NULL, AV_LOG_ERROR, - "Too many packets buffered for output stream %d:%d.\n", - ost->file_index, ost->st->index); - exit_program(1); - } - ret = av_fifo_grow2(ost->muxing_queue, new_size - cur_size); - if (ret < 0) - exit_program(1); - } - ret = av_packet_make_refcounted(pkt); - if (ret < 0) - exit_program(1); - tmp_pkt = av_packet_alloc(); - if (!tmp_pkt) - exit_program(1); - av_packet_move_ref(tmp_pkt, pkt); - ost->muxing_queue_data_size += tmp_pkt->size; - av_fifo_write(ost->muxing_queue, &tmp_pkt, 1); - return; + fs = filesize(s->pb); + atomic_store(&mux->last_filesize, fs); + if (fs >= mux->limit_filesize) { + ret = AVERROR_EOF; + goto fail; } - if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP) || - (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0)) + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP) pkt->pts = pkt->dts = AV_NOPTS_VALUE; if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { if (ost->frame_rate.num && ost->is_cfr) { if (pkt->duration > 0) - av_log(NULL, AV_LOG_WARNING, "Overriding packet duration by frame rate, this should not happen\n"); + av_log(ost, AV_LOG_WARNING, "Overriding packet duration by frame rate, this should not happen\n"); pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate), - ost->mux_timebase); + pkt->time_base); } } - av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base); + av_packet_rescale_ts(pkt, pkt->time_base, ost->st->time_base); + pkt->time_base = ost->st->time_base; if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) { if (pkt->dts != AV_NOPTS_VALUE && @@ -119,25 +97,26 @@ pkt->dts, pkt->pts, ost->file_index, ost->st->index); pkt->pts = - pkt->dts = pkt->pts + pkt->dts + ost->last_mux_dts + 1 - - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1) - - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1); + pkt->dts = pkt->pts + pkt->dts + ms->last_mux_dts + 1 + - FFMIN3(pkt->pts, pkt->dts, ms->last_mux_dts + 1) + - FFMAX3(pkt->pts, pkt->dts, ms->last_mux_dts + 1); } if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) && pkt->dts != AV_NOPTS_VALUE && - ost->last_mux_dts != AV_NOPTS_VALUE) { - int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT); + ms->last_mux_dts != AV_NOPTS_VALUE) { + int64_t max = ms->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT); if (pkt->dts < max) { int loglevel = max - pkt->dts > 2 || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? AV_LOG_WARNING : AV_LOG_DEBUG; if (exit_on_error) loglevel = AV_LOG_ERROR; av_log(s, loglevel, "Non-monotonous DTS in output stream " "%d:%d; previous: %"PRId64", current: %"PRId64"; ", - ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts); + ost->file_index, ost->st->index, ms->last_mux_dts, pkt->dts); if (exit_on_error) { - av_log(NULL, AV_LOG_FATAL, "aborting.\n"); - exit_program(1); + ret = AVERROR(EINVAL); + goto fail; } + av_log(s, loglevel, "changing to %"PRId64". This may result " "in incorrect timestamps in the output file.\n", max); @@ -147,17 +126,17 @@ } } } - ost->last_mux_dts = pkt->dts; + ms->last_mux_dts = pkt->dts; - ost->data_size += pkt->size; - ost->packets_written++; + ost->data_size_mux += pkt->size; + frame_num = atomic_fetch_add(&ost->packets_written, 1); pkt->stream_index = ost->index; if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "muxer <- type:%s " + av_log(ost, AV_LOG_INFO, "muxer <- type:%s " "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s size:%d\n", - av_get_media_type_string(ost->enc_ctx->codec_type), + av_get_media_type_string(st->codecpar->codec_type), av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base), av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ost->st->time_base), @@ -165,12 +144,307 @@ ); } + if (ms->stats.io) + enc_stats_write(ost, &ms->stats, NULL, pkt, frame_num); + ret = av_interleaved_write_frame(s, pkt); if (ret < 0) { print_error("av_interleaved_write_frame()", ret); - main_return_code = 1; - close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED); + goto fail; + } + + return 0; +fail: + av_packet_unref(pkt); + return ret; +} + +static int sync_queue_process(Muxer *mux, OutputStream *ost, AVPacket *pkt, int *stream_eof) +{ + OutputFile *of = &mux->of; + + if (ost->sq_idx_mux >= 0) { + int ret = sq_send(mux->sq_mux, ost->sq_idx_mux, SQPKT(pkt)); + if (ret < 0) { + if (ret == AVERROR_EOF) + *stream_eof = 1; + + return ret; + } + + while (1) { + ret = sq_receive(mux->sq_mux, -1, SQPKT(mux->sq_pkt)); + if (ret < 0) + return (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) ? 0 : ret; + + ret = write_packet(mux, of->streams[ret], + mux->sq_pkt); + if (ret < 0) + return ret; + } + } else if (pkt) + return write_packet(mux, ost, pkt); + + return 0; +} + +static void thread_set_name(OutputFile *of) +{ + char name[16]; + snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name); + ff_thread_setname(name); +} + +static void *muxer_thread(void *arg) +{ + Muxer *mux = arg; + OutputFile *of = &mux->of; + AVPacket *pkt = NULL; + int ret = 0; + + pkt = av_packet_alloc(); + if (!pkt) { + ret = AVERROR(ENOMEM); + goto finish; + } + + thread_set_name(of); + + while (1) { + OutputStream *ost; + int stream_idx, stream_eof = 0; + + ret = tq_receive(mux->tq, &stream_idx, pkt); + if (stream_idx < 0) { + av_log(mux, AV_LOG_VERBOSE, "All streams finished\n"); + ret = 0; + break; + } + + ost = of->streams[stream_idx]; + ret = sync_queue_process(mux, ost, ret < 0 ? NULL : pkt, &stream_eof); + av_packet_unref(pkt); + if (ret == AVERROR_EOF && stream_eof) + tq_receive_finish(mux->tq, stream_idx); + else if (ret < 0) { + av_log(mux, AV_LOG_ERROR, "Error muxing a packet\n"); + break; + } + } + +finish: + av_packet_free(&pkt); + + for (unsigned int i = 0; i < mux->fc->nb_streams; i++) + tq_receive_finish(mux->tq, i); + + av_log(mux, AV_LOG_VERBOSE, "Terminating muxer thread\n"); + + return (void*)(intptr_t)ret; +} + +static int thread_submit_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt) +{ + int ret = 0; + + if (!pkt || ost->finished & MUXER_FINISHED) + goto finish; + + ret = tq_send(mux->tq, ost->index, pkt); + if (ret < 0) + goto finish; + + return 0; + +finish: + if (pkt) + av_packet_unref(pkt); + + ost->finished |= MUXER_FINISHED; + tq_send_finish(mux->tq, ost->index); + return ret == AVERROR_EOF ? 0 : ret; +} + +static int queue_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt) +{ + MuxStream *ms = ms_from_ost(ost); + AVPacket *tmp_pkt = NULL; + int ret; + + if (!av_fifo_can_write(ms->muxing_queue)) { + size_t cur_size = av_fifo_can_read(ms->muxing_queue); + size_t pkt_size = pkt ? pkt->size : 0; + unsigned int are_we_over_size = + (ms->muxing_queue_data_size + pkt_size) > ms->muxing_queue_data_threshold; + size_t limit = are_we_over_size ? ms->max_muxing_queue_size : SIZE_MAX; + size_t new_size = FFMIN(2 * cur_size, limit); + + if (new_size <= cur_size) { + av_log(ost, AV_LOG_ERROR, + "Too many packets buffered for output stream %d:%d.\n", + ost->file_index, ost->st->index); + return AVERROR(ENOSPC); + } + ret = av_fifo_grow2(ms->muxing_queue, new_size - cur_size); + if (ret < 0) + return ret; + } + + if (pkt) { + ret = av_packet_make_refcounted(pkt); + if (ret < 0) + return ret; + + tmp_pkt = av_packet_alloc(); + if (!tmp_pkt) + return AVERROR(ENOMEM); + + av_packet_move_ref(tmp_pkt, pkt); + ms->muxing_queue_data_size += tmp_pkt->size; + } + av_fifo_write(ms->muxing_queue, &tmp_pkt, 1); + + return 0; +} + +static int submit_packet(Muxer *mux, AVPacket *pkt, OutputStream *ost) +{ + int ret; + + if (mux->tq) { + return thread_submit_packet(mux, ost, pkt); + } else { + /* the muxer is not initialized yet, buffer the packet */ + ret = queue_packet(mux, ost, pkt); + if (ret < 0) { + if (pkt) + av_packet_unref(pkt); + return ret; + } + } + + return 0; +} + +void of_output_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int eof) +{ + Muxer *mux = mux_from_of(of); + MuxStream *ms = ms_from_ost(ost); + const char *err_msg; + int ret = 0; + + if (!eof && pkt->dts != AV_NOPTS_VALUE) + ost->last_mux_dts = av_rescale_q(pkt->dts, pkt->time_base, AV_TIME_BASE_Q); + + /* apply the output bitstream filters */ + if (ms->bsf_ctx) { + int bsf_eof = 0; + + ret = av_bsf_send_packet(ms->bsf_ctx, eof ? NULL : pkt); + if (ret < 0) { + err_msg = "submitting a packet for bitstream filtering"; + goto fail; + } + + while (!bsf_eof) { + ret = av_bsf_receive_packet(ms->bsf_ctx, pkt); + if (ret == AVERROR(EAGAIN)) + return; + else if (ret == AVERROR_EOF) + bsf_eof = 1; + else if (ret < 0) { + err_msg = "applying bitstream filters to a packet"; + goto fail; + } + + ret = submit_packet(mux, bsf_eof ? NULL : pkt, ost); + if (ret < 0) + goto mux_fail; + } + } else { + ret = submit_packet(mux, eof ? NULL : pkt, ost); + if (ret < 0) + goto mux_fail; + } + + return; + +mux_fail: + err_msg = "submitting a packet to the muxer"; + +fail: + av_log(ost, AV_LOG_ERROR, "Error %s\n", err_msg); + if (exit_on_error) + exit_program(1); + +} + +static int thread_stop(Muxer *mux) +{ + void *ret; + + if (!mux || !mux->tq) + return 0; + + for (unsigned int i = 0; i < mux->fc->nb_streams; i++) + tq_send_finish(mux->tq, i); + + pthread_join(mux->thread, &ret); + + tq_free(&mux->tq); + + return (int)(intptr_t)ret; +} + +static void pkt_move(void *dst, void *src) +{ + av_packet_move_ref(dst, src); +} + +static int thread_start(Muxer *mux) +{ + AVFormatContext *fc = mux->fc; + ObjPool *op; + int ret; + + op = objpool_alloc_packets(); + if (!op) + return AVERROR(ENOMEM); + + mux->tq = tq_alloc(fc->nb_streams, mux->thread_queue_size, op, pkt_move); + if (!mux->tq) { + objpool_free(&op); + return AVERROR(ENOMEM); } + + ret = pthread_create(&mux->thread, NULL, muxer_thread, (void*)mux); + if (ret) { + tq_free(&mux->tq); + return AVERROR(ret); + } + + /* flush the muxing queues */ + for (int i = 0; i < fc->nb_streams; i++) { + OutputStream *ost = mux->of.streams[i]; + MuxStream *ms = ms_from_ost(ost); + AVPacket *pkt; + + /* try to improve muxing time_base (only possible if nothing has been written yet) */ + if (!av_fifo_can_read(ms->muxing_queue)) + ost->mux_timebase = ost->st->time_base; + + while (av_fifo_read(ms->muxing_queue, &pkt, 1) >= 0) { + ret = thread_submit_packet(mux, ost, pkt); + if (pkt) { + ms->muxing_queue_data_size -= pkt->size; + av_packet_free(&pkt); + } + if (ret < 0) + return ret; + } + } + + return 0; } static int print_sdp(void) @@ -182,16 +456,16 @@ AVFormatContext **avc; for (i = 0; i < nb_output_files; i++) { - if (!output_files[i]->header_written) + if (!mux_from_of(output_files[i])->header_written) return 0; } avc = av_malloc_array(nb_output_files, sizeof(*avc)); if (!avc) - exit_program(1); + return AVERROR(ENOMEM); for (i = 0, j = 0; i < nb_output_files; i++) { - if (!strcmp(output_files[i]->ctx->oformat->name, "rtp")) { - avc[j] = output_files[i]->ctx; + if (!strcmp(output_files[i]->format->name, "rtp")) { + avc[j] = mux_from_of(output_files[i])->fc; j++; } } @@ -221,34 +495,36 @@ av_freep(&sdp_filename); } + // SDP successfully written, allow muxer threads to start + ret = 1; + fail: av_freep(&avc); return ret; } -/* open the muxer when all the streams are initialized */ -int of_check_init(OutputFile *of) +int mux_check_init(Muxer *mux) { + OutputFile *of = &mux->of; + AVFormatContext *fc = mux->fc; int ret, i; - for (i = 0; i < of->ctx->nb_streams; i++) { - OutputStream *ost = output_streams[of->ost_index + i]; + for (i = 0; i < fc->nb_streams; i++) { + OutputStream *ost = of->streams[i]; if (!ost->initialized) return 0; } - ret = avformat_write_header(of->ctx, &of->opts); + ret = avformat_write_header(fc, &mux->opts); if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, - "Could not write header for output file #%d " - "(incorrect codec parameters ?): %s\n", - of->index, av_err2str(ret)); + av_log(mux, AV_LOG_ERROR, "Could not write header (incorrect codec " + "parameters ?): %s\n", av_err2str(ret)); return ret; } //assert_avoptions(of->opts); - of->header_written = 1; + mux->header_written = 1; - av_dump_format(of->ctx, of->index, of->ctx->url, 1); + av_dump_format(fc, of->index, fc->url, 1); nb_output_dumped++; if (sdp_filename || want_sdp) { @@ -256,62 +532,220 @@ if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Error writing the SDP.\n"); return ret; + } else if (ret == 1) { + /* SDP is written only after all the muxers are ready, so now we + * start ALL the threads */ + for (i = 0; i < nb_output_files; i++) { + ret = thread_start(mux_from_of(output_files[i])); + if (ret < 0) + return ret; + } } + } else { + ret = thread_start(mux_from_of(of)); + if (ret < 0) + return ret; } - /* flush the muxing queues */ - for (i = 0; i < of->ctx->nb_streams; i++) { - OutputStream *ost = output_streams[of->ost_index + i]; - AVPacket *pkt; + return 0; +} - /* try to improve muxing time_base (only possible if nothing has been written yet) */ - if (!av_fifo_can_read(ost->muxing_queue)) - ost->mux_timebase = ost->st->time_base; +static int bsf_init(MuxStream *ms) +{ + OutputStream *ost = &ms->ost; + AVBSFContext *ctx = ms->bsf_ctx; + int ret; - while (av_fifo_read(ost->muxing_queue, &pkt, 1) >= 0) { - ost->muxing_queue_data_size -= pkt->size; - of_write_packet(of, pkt, ost, 1); - av_packet_free(&pkt); - } + if (!ctx) + return 0; + + ret = avcodec_parameters_copy(ctx->par_in, ost->st->codecpar); + if (ret < 0) + return ret; + + ctx->time_base_in = ost->st->time_base; + + ret = av_bsf_init(ctx); + if (ret < 0) { + av_log(ms, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n", + ctx->filter->name); + return ret; } + ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out); + if (ret < 0) + return ret; + ost->st->time_base = ctx->time_base_out; + return 0; } +int of_stream_init(OutputFile *of, OutputStream *ost) +{ + Muxer *mux = mux_from_of(of); + MuxStream *ms = ms_from_ost(ost); + int ret; + + if (ost->sq_idx_mux >= 0) + sq_set_tb(mux->sq_mux, ost->sq_idx_mux, ost->mux_timebase); + + /* initialize bitstream filters for the output stream + * needs to be done here, because the codec id for streamcopy is not + * known until now */ + ret = bsf_init(ms); + if (ret < 0) + return ret; + + ost->initialized = 1; + + return mux_check_init(mux); +} + int of_write_trailer(OutputFile *of) { + Muxer *mux = mux_from_of(of); + AVFormatContext *fc = mux->fc; int ret; - if (!of->header_written) { - av_log(NULL, AV_LOG_ERROR, - "Nothing was written into output file %d (%s), because " - "at least one of its streams received no packets.\n", - of->index, of->ctx->url); + if (!mux->tq) { + av_log(mux, AV_LOG_ERROR, + "Nothing was written into output file, because " + "at least one of its streams received no packets.\n"); return AVERROR(EINVAL); } - ret = av_write_trailer(of->ctx); + ret = thread_stop(mux); + if (ret < 0) + main_return_code = ret; + + ret = av_write_trailer(fc); if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error writing trailer of %s: %s\n", of->ctx->url, av_err2str(ret)); + av_log(mux, AV_LOG_ERROR, "Error writing trailer: %s\n", av_err2str(ret)); return ret; } + mux->last_filesize = filesize(fc->pb); + + if (!(of->format->flags & AVFMT_NOFILE)) { + ret = avio_closep(&fc->pb); + if (ret < 0) { + av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret)); + return ret; + } + } + return 0; } +static void ost_free(OutputStream **post) +{ + OutputStream *ost = *post; + MuxStream *ms; + + if (!ost) + return; + ms = ms_from_ost(ost); + + if (ost->logfile) { + if (fclose(ost->logfile)) + av_log(ms, AV_LOG_ERROR, + "Error closing logfile, loss of information possible: %s\n", + av_err2str(AVERROR(errno))); + ost->logfile = NULL; + } + + if (ms->muxing_queue) { + AVPacket *pkt; + while (av_fifo_read(ms->muxing_queue, &pkt, 1) >= 0) + av_packet_free(&pkt); + av_fifo_freep2(&ms->muxing_queue); + } + + av_bsf_free(&ms->bsf_ctx); + + av_frame_free(&ost->filtered_frame); + av_frame_free(&ost->sq_frame); + av_frame_free(&ost->last_frame); + av_packet_free(&ost->pkt); + av_dict_free(&ost->encoder_opts); + + av_freep(&ost->kf.pts); + av_expr_free(ost->kf.pexpr); + + av_freep(&ost->avfilter); + av_freep(&ost->logfile_prefix); + av_freep(&ost->apad); + +#if FFMPEG_OPT_MAP_CHANNEL + av_freep(&ost->audio_channels_map); + ost->audio_channels_mapped = 0; +#endif + + av_dict_free(&ost->sws_dict); + av_dict_free(&ost->swr_opts); + + if (ost->enc_ctx) + av_freep(&ost->enc_ctx->stats_in); + avcodec_free_context(&ost->enc_ctx); + + for (int i = 0; i < ost->enc_stats_pre.nb_components; i++) + av_freep(&ost->enc_stats_pre.components[i].str); + av_freep(&ost->enc_stats_pre.components); + + for (int i = 0; i < ost->enc_stats_post.nb_components; i++) + av_freep(&ost->enc_stats_post.components[i].str); + av_freep(&ost->enc_stats_post.components); + + for (int i = 0; i < ms->stats.nb_components; i++) + av_freep(&ms->stats.components[i].str); + av_freep(&ms->stats.components); + + av_freep(post); +} + +static void fc_close(AVFormatContext **pfc) +{ + AVFormatContext *fc = *pfc; + + if (!fc) + return; + + if (!(fc->oformat->flags & AVFMT_NOFILE)) + avio_closep(&fc->pb); + avformat_free_context(fc); + + *pfc = NULL; +} + void of_close(OutputFile **pof) { OutputFile *of = *pof; - AVFormatContext *s; + Muxer *mux; if (!of) return; + mux = mux_from_of(of); + + thread_stop(mux); - s = of->ctx; - if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE)) - avio_closep(&s->pb); - avformat_free_context(s); - av_dict_free(&of->opts); + sq_free(&of->sq_encode); + sq_free(&mux->sq_mux); + + for (int i = 0; i < of->nb_streams; i++) + ost_free(&of->streams[i]); + av_freep(&of->streams); + + av_dict_free(&mux->opts); + + av_packet_free(&mux->sq_pkt); + + fc_close(&mux->fc); av_freep(pof); } + +int64_t of_filesize(OutputFile *of) +{ + Muxer *mux = mux_from_of(of); + return atomic_load(&mux->last_filesize); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * Muxer internal APIs - should not be included outside of ffmpeg_mux* + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 FFTOOLS_FFMPEG_MUX_H +#define FFTOOLS_FFMPEG_MUX_H + +#include +#include + +#include "thread_queue.h" + +#include "libavformat/avformat.h" + +#include "libavcodec/packet.h" + +#include "libavutil/dict.h" +#include "libavutil/fifo.h" +#include "libavutil/thread.h" + +typedef struct MuxStream { + OutputStream ost; + + // name used for logging + char log_name[32]; + + /* the packets are buffered here until the muxer is ready to be initialized */ + AVFifo *muxing_queue; + + AVBSFContext *bsf_ctx; + + EncStats stats; + + int64_t max_frames; + + /* + * The size of the AVPackets' buffers in queue. + * Updated when a packet is either pushed or pulled from the queue. + */ + size_t muxing_queue_data_size; + + int max_muxing_queue_size; + + /* Threshold after which max_muxing_queue_size will be in effect */ + size_t muxing_queue_data_threshold; + + /* dts of the last packet sent to the muxer, in the stream timebase + * used for making up missing dts values */ + int64_t last_mux_dts; +} MuxStream; + +typedef struct Muxer { + OutputFile of; + + // name used for logging + char log_name[32]; + + AVFormatContext *fc; + + pthread_t thread; + ThreadQueue *tq; + + AVDictionary *opts; + + int thread_queue_size; + + /* filesize limit expressed in bytes */ + int64_t limit_filesize; + atomic_int_least64_t last_filesize; + int header_written; + + SyncQueue *sq_mux; + AVPacket *sq_pkt; +} Muxer; + +/* whether we want to print an SDP, set in of_open() */ +extern int want_sdp; + +int mux_check_init(Muxer *mux); + +static MuxStream *ms_from_ost(OutputStream *ost) +{ + return (MuxStream*)ost; +} + +#endif /* FFTOOLS_FFMPEG_MUX_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_mux_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,2400 @@ +/* + * Muxer/output file setup. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 "cmdutils.h" +#include "ffmpeg.h" +#include "ffmpeg_mux.h" +#include "fopen_utf8.h" + +#include "libavformat/avformat.h" +#include "libavformat/avio.h" + +#include "libavcodec/avcodec.h" + +#include "libavfilter/avfilter.h" + +#include "libavutil/avassert.h" +#include "libavutil/avstring.h" +#include "libavutil/avutil.h" +#include "libavutil/bprint.h" +#include "libavutil/dict.h" +#include "libavutil/getenv_utf8.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" +#include "libavutil/opt.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" + +#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" + +static const char *const opt_name_apad[] = {"apad", NULL}; +static const char *const opt_name_autoscale[] = {"autoscale", NULL}; +static const char *const opt_name_bits_per_raw_sample[] = {"bits_per_raw_sample", NULL}; +static const char *const opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL}; +static const char *const opt_name_copy_initial_nonkeyframes[] = {"copyinkf", NULL}; +static const char *const opt_name_copy_prior_start[] = {"copypriorss", NULL}; +static const char *const opt_name_disposition[] = {"disposition", NULL}; +static const char *const opt_name_enc_time_bases[] = {"enc_time_base", NULL}; +static const char *const opt_name_enc_stats_pre[] = {"enc_stats_pre", NULL}; +static const char *const opt_name_enc_stats_post[] = {"enc_stats_post", NULL}; +static const char *const opt_name_mux_stats[] = {"mux_stats", NULL}; +static const char *const opt_name_enc_stats_pre_fmt[] = {"enc_stats_pre_fmt", NULL}; +static const char *const opt_name_enc_stats_post_fmt[] = {"enc_stats_post_fmt", NULL}; +static const char *const opt_name_mux_stats_fmt[] = {"mux_stats_fmt", NULL}; +static const char *const opt_name_filters[] = {"filter", "af", "vf", NULL}; +static const char *const opt_name_filter_scripts[] = {"filter_script", NULL}; +static const char *const opt_name_fix_sub_duration_heartbeat[] = {"fix_sub_duration_heartbeat", NULL}; +static const char *const opt_name_fps_mode[] = {"fps_mode", NULL}; +static const char *const opt_name_force_fps[] = {"force_fps", NULL}; +static const char *const opt_name_forced_key_frames[] = {"forced_key_frames", NULL}; +static const char *const opt_name_frame_aspect_ratios[] = {"aspect", NULL}; +static const char *const opt_name_intra_matrices[] = {"intra_matrix", NULL}; +static const char *const opt_name_inter_matrices[] = {"inter_matrix", NULL}; +static const char *const opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL}; +static const char *const opt_name_max_frame_rates[] = {"fpsmax", NULL}; +static const char *const opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL}; +static const char *const opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL}; +static const char *const opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL}; +static const char *const opt_name_pass[] = {"pass", NULL}; +static const char *const opt_name_passlogfiles[] = {"passlogfile", NULL}; +static const char *const opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL}; +static const char *const opt_name_qscale[] = {"q", "qscale", NULL}; +static const char *const opt_name_rc_overrides[] = {"rc_override", NULL}; +static const char *const opt_name_time_bases[] = {"time_base", NULL}; +static const char *const opt_name_audio_channels[] = {"ac", NULL}; +static const char *const opt_name_audio_ch_layouts[] = {"channel_layout", "ch_layout", NULL}; +static const char *const opt_name_audio_sample_rate[] = {"ar", NULL}; +static const char *const opt_name_frame_sizes[] = {"s", NULL}; +static const char *const opt_name_frame_pix_fmts[] = {"pix_fmt", NULL}; +static const char *const opt_name_sample_fmts[] = {"sample_fmt", NULL}; + +static int check_opt_bitexact(void *ctx, const AVDictionary *opts, + const char *opt_name, int flag) +{ + const AVDictionaryEntry *e = av_dict_get(opts, opt_name, NULL, 0); + + if (e) { + const AVOption *o = av_opt_find(ctx, opt_name, NULL, 0, 0); + int val = 0; + if (!o) + return 0; + av_opt_eval_flags(ctx, o, e->value, &val); + return !!(val & flag); + } + return 0; +} + +static int choose_encoder(const OptionsContext *o, AVFormatContext *s, + OutputStream *ost, const AVCodec **enc) +{ + enum AVMediaType type = ost->st->codecpar->codec_type; + char *codec_name = NULL; + + *enc = NULL; + + if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO || type == AVMEDIA_TYPE_SUBTITLE) { + MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, ost->st); + if (!codec_name) { + ost->st->codecpar->codec_id = av_guess_codec(s->oformat, NULL, s->url, + NULL, ost->st->codecpar->codec_type); + *enc = avcodec_find_encoder(ost->st->codecpar->codec_id); + if (!*enc) { + av_log(ost, AV_LOG_FATAL, "Automatic encoder selection failed " + "Default encoder for format %s (codec %s) is " + "probably disabled. Please choose an encoder manually.\n", + s->oformat->name, avcodec_get_name(ost->st->codecpar->codec_id)); + return AVERROR_ENCODER_NOT_FOUND; + } + } else if (strcmp(codec_name, "copy")) { + *enc = find_codec_or_die(ost, codec_name, ost->st->codecpar->codec_type, 1); + ost->st->codecpar->codec_id = (*enc)->id; + } + } + + return 0; +} + +static char *get_line(AVIOContext *s, AVBPrint *bprint) +{ + char c; + + while ((c = avio_r8(s)) && c != '\n') + av_bprint_chars(bprint, c, 1); + + if (!av_bprint_is_complete(bprint)) + report_and_exit(AVERROR(ENOMEM)); + return bprint->str; +} + +static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s) +{ + int i, ret = -1; + char filename[1000]; + char *env_avconv_datadir = getenv_utf8("AVCONV_DATADIR"); + char *env_home = getenv_utf8("HOME"); + const char *base[3] = { env_avconv_datadir, + env_home, + AVCONV_DATADIR, + }; + + for (i = 0; i < FF_ARRAY_ELEMS(base) && ret < 0; i++) { + if (!base[i]) + continue; + if (codec_name) { + snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i], + i != 1 ? "" : "/.avconv", codec_name, preset_name); + ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL); + } + if (ret < 0) { + snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i], + i != 1 ? "" : "/.avconv", preset_name); + ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL); + } + } + freeenv_utf8(env_home); + freeenv_utf8(env_avconv_datadir); + return ret; +} + +typedef struct EncStatsFile { + char *path; + AVIOContext *io; +} EncStatsFile; + +static EncStatsFile *enc_stats_files; +static int nb_enc_stats_files; + +static int enc_stats_get_file(AVIOContext **io, const char *path) +{ + EncStatsFile *esf; + int ret; + + for (int i = 0; i < nb_enc_stats_files; i++) + if (!strcmp(path, enc_stats_files[i].path)) { + *io = enc_stats_files[i].io; + return 0; + } + + GROW_ARRAY(enc_stats_files, nb_enc_stats_files); + + esf = &enc_stats_files[nb_enc_stats_files - 1]; + + ret = avio_open2(&esf->io, path, AVIO_FLAG_WRITE, &int_cb, NULL); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error opening stats file '%s': %s\n", + path, av_err2str(ret)); + return ret; + } + + esf->path = av_strdup(path); + if (!esf->path) + return AVERROR(ENOMEM); + + *io = esf->io; + + return 0; +} + +void of_enc_stats_close(void) +{ + for (int i = 0; i < nb_enc_stats_files; i++) { + av_freep(&enc_stats_files[i].path); + avio_closep(&enc_stats_files[i].io); + } + av_freep(&enc_stats_files); + nb_enc_stats_files = 0; +} + +static int unescape(char **pdst, size_t *dst_len, + const char **pstr, char delim) +{ + const char *str = *pstr; + char *dst; + size_t len, idx; + + *pdst = NULL; + + len = strlen(str); + if (!len) + return 0; + + dst = av_malloc(len + 1); + if (!dst) + return AVERROR(ENOMEM); + + for (idx = 0; *str; idx++, str++) { + if (str[0] == '\\' && str[1]) + str++; + else if (*str == delim) + break; + + dst[idx] = *str; + } + if (!idx) { + av_freep(&dst); + return 0; + } + + dst[idx] = 0; + + *pdst = dst; + *dst_len = idx; + *pstr = str; + + return 0; +} + +static int enc_stats_init(OutputStream *ost, EncStats *es, int pre, + const char *path, const char *fmt_spec) +{ + static const struct { + enum EncStatsType type; + const char *str; + int pre_only:1; + int post_only:1; + int need_input_data:1; + } fmt_specs[] = { + { ENC_STATS_FILE_IDX, "fidx" }, + { ENC_STATS_STREAM_IDX, "sidx" }, + { ENC_STATS_FRAME_NUM, "n" }, + { ENC_STATS_FRAME_NUM_IN, "ni", 0, 0, 1 }, + { ENC_STATS_TIMEBASE, "tb" }, + { ENC_STATS_TIMEBASE_IN, "tbi", 0, 0, 1 }, + { ENC_STATS_PTS, "pts" }, + { ENC_STATS_PTS_TIME, "t" }, + { ENC_STATS_PTS_IN, "ptsi", 0, 0, 1 }, + { ENC_STATS_PTS_TIME_IN, "ti", 0, 0, 1 }, + { ENC_STATS_DTS, "dts", 0, 1 }, + { ENC_STATS_DTS_TIME, "dt", 0, 1 }, + { ENC_STATS_SAMPLE_NUM, "sn", 1 }, + { ENC_STATS_NB_SAMPLES, "samp", 1 }, + { ENC_STATS_PKT_SIZE, "size", 0, 1 }, + { ENC_STATS_BITRATE, "br", 0, 1 }, + { ENC_STATS_AVG_BITRATE, "abr", 0, 1 }, + }; + const char *next = fmt_spec; + + int ret; + + while (*next) { + EncStatsComponent *c; + char *val; + size_t val_len; + + // get the sequence up until next opening brace + ret = unescape(&val, &val_len, &next, '{'); + if (ret < 0) + return ret; + + if (val) { + GROW_ARRAY(es->components, es->nb_components); + + c = &es->components[es->nb_components - 1]; + c->type = ENC_STATS_LITERAL; + c->str = val; + c->str_len = val_len; + } + + if (!*next) + break; + next++; + + // get the part inside braces + ret = unescape(&val, &val_len, &next, '}'); + if (ret < 0) + return ret; + + if (!val) { + av_log(NULL, AV_LOG_ERROR, + "Empty formatting directive in: %s\n", fmt_spec); + return AVERROR(EINVAL); + } + + if (!*next) { + av_log(NULL, AV_LOG_ERROR, + "Missing closing brace in: %s\n", fmt_spec); + ret = AVERROR(EINVAL); + goto fail; + } + next++; + + GROW_ARRAY(es->components, es->nb_components); + c = &es->components[es->nb_components - 1]; + + for (size_t i = 0; i < FF_ARRAY_ELEMS(fmt_specs); i++) { + if (!strcmp(val, fmt_specs[i].str)) { + if ((pre && fmt_specs[i].post_only) || (!pre && fmt_specs[i].pre_only)) { + av_log(NULL, AV_LOG_ERROR, + "Format directive '%s' may only be used %s-encoding\n", + val, pre ? "post" : "pre"); + ret = AVERROR(EINVAL); + goto fail; + } + + c->type = fmt_specs[i].type; + + if (fmt_specs[i].need_input_data) { + if (ost->ist) + ost->ist->want_frame_data = 1; + else { + av_log(ost, AV_LOG_WARNING, + "Format directive '%s' is unavailable, because " + "this output stream has no associated input stream\n", + val); + } + } + + break; + } + } + + if (!c->type) { + av_log(NULL, AV_LOG_ERROR, "Invalid format directive: %s\n", val); + ret = AVERROR(EINVAL); + goto fail; + } + +fail: + av_freep(&val); + if (ret < 0) + return ret; + } + + ret = enc_stats_get_file(&es->io, path); + if (ret < 0) + return ret; + + return 0; +} + +static const char *output_stream_item_name(void *obj) +{ + const MuxStream *ms = obj; + + return ms->log_name; +} + +static const AVClass output_stream_class = { + .class_name = "OutputStream", + .version = LIBAVUTIL_VERSION_INT, + .item_name = output_stream_item_name, + .category = AV_CLASS_CATEGORY_MUXER, +}; + +static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type) +{ + const char *type_str = av_get_media_type_string(type); + MuxStream *ms = allocate_array_elem(&mux->of.streams, sizeof(*ms), + &mux->of.nb_streams); + + ms->ost.file_index = mux->of.index; + ms->ost.index = mux->of.nb_streams - 1; + + ms->ost.class = &output_stream_class; + + snprintf(ms->log_name, sizeof(ms->log_name), "%cost#%d:%d", + type_str ? *type_str : '?', mux->of.index, ms->ost.index); + + return ms; +} + +static OutputStream *new_output_stream(Muxer *mux, const OptionsContext *o, + enum AVMediaType type, InputStream *ist) +{ + AVFormatContext *oc = mux->fc; + MuxStream *ms; + OutputStream *ost; + const AVCodec *enc; + AVStream *st = avformat_new_stream(oc, NULL); + int ret = 0; + const char *bsfs = NULL, *time_base = NULL; + char *next, *codec_tag = NULL; + double qscale = -1; + int i; + + if (!st) + report_and_exit(AVERROR(ENOMEM)); + + if (oc->nb_streams - 1 < o->nb_streamid_map) + st->id = o->streamid_map[oc->nb_streams - 1]; + + ms = mux_stream_alloc(mux, type); + ost = &ms->ost; + + ms->muxing_queue = av_fifo_alloc2(8, sizeof(AVPacket*), 0); + if (!ms->muxing_queue) + report_and_exit(AVERROR(ENOMEM)); + ms->last_mux_dts = AV_NOPTS_VALUE; + + ost->st = st; + ost->ist = ist; + ost->kf.ref_pts = AV_NOPTS_VALUE; + st->codecpar->codec_type = type; + + ret = choose_encoder(o, oc, ost, &enc); + if (ret < 0) { + av_log(ost, AV_LOG_FATAL, "Error selecting an encoder\n"); + exit_program(1); + } + + if (enc) { + ost->enc_ctx = avcodec_alloc_context3(enc); + if (!ost->enc_ctx) + report_and_exit(AVERROR(ENOMEM)); + + av_strlcat(ms->log_name, "/", sizeof(ms->log_name)); + av_strlcat(ms->log_name, enc->name, sizeof(ms->log_name)); + } else { + av_strlcat(ms->log_name, "/copy", sizeof(ms->log_name)); + } + + ost->filtered_frame = av_frame_alloc(); + if (!ost->filtered_frame) + report_and_exit(AVERROR(ENOMEM)); + + ost->pkt = av_packet_alloc(); + if (!ost->pkt) + report_and_exit(AVERROR(ENOMEM)); + + if (ost->enc_ctx) { + AVCodecContext *enc = ost->enc_ctx; + AVIOContext *s = NULL; + char *buf = NULL, *arg = NULL, *preset = NULL; + const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL; + + ost->encoder_opts = filter_codec_opts(o->g->codec_opts, enc->codec_id, + oc, st, enc->codec); + + MATCH_PER_STREAM_OPT(presets, str, preset, oc, st); + ost->autoscale = 1; + MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st); + if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s)))) { + AVBPrint bprint; + av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); + do { + av_bprint_clear(&bprint); + buf = get_line(s, &bprint); + if (!buf[0] || buf[0] == '#') + continue; + if (!(arg = strchr(buf, '='))) { + av_log(ost, AV_LOG_FATAL, "Invalid line found in the preset file.\n"); + exit_program(1); + } + *arg++ = 0; + av_dict_set(&ost->encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE); + } while (!s->eof_reached); + av_bprint_finalize(&bprint, NULL); + avio_closep(&s); + } + if (ret) { + av_log(ost, AV_LOG_FATAL, + "Preset %s specified, but could not be opened.\n", preset); + exit_program(1); + } + + MATCH_PER_STREAM_OPT(enc_stats_pre, str, enc_stats_pre, oc, st); + if (enc_stats_pre && + (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { + const char *format = "{fidx} {sidx} {n} {t}"; + + MATCH_PER_STREAM_OPT(enc_stats_pre_fmt, str, format, oc, st); + + ret = enc_stats_init(ost, &ost->enc_stats_pre, 1, enc_stats_pre, format); + if (ret < 0) + exit_program(1); + } + + MATCH_PER_STREAM_OPT(enc_stats_post, str, enc_stats_post, oc, st); + if (enc_stats_post && + (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { + const char *format = "{fidx} {sidx} {n} {t}"; + + MATCH_PER_STREAM_OPT(enc_stats_post_fmt, str, format, oc, st); + + ret = enc_stats_init(ost, &ost->enc_stats_post, 0, enc_stats_post, format); + if (ret < 0) + exit_program(1); + } + + MATCH_PER_STREAM_OPT(mux_stats, str, mux_stats, oc, st); + if (mux_stats && + (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) { + const char *format = "{fidx} {sidx} {n} {t}"; + + MATCH_PER_STREAM_OPT(mux_stats_fmt, str, format, oc, st); + + ret = enc_stats_init(ost, &ms->stats, 0, mux_stats, format); + if (ret < 0) + exit_program(1); + } + } else { + ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL); + } + + + if (o->bitexact) { + ost->bitexact = 1; + } else if (ost->enc_ctx) { + ost->bitexact = check_opt_bitexact(ost->enc_ctx, ost->encoder_opts, "flags", + AV_CODEC_FLAG_BITEXACT); + } + + MATCH_PER_STREAM_OPT(time_bases, str, time_base, oc, st); + if (time_base) { + AVRational q; + if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || + q.num <= 0 || q.den <= 0) { + av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", time_base); + exit_program(1); + } + st->time_base = q; + } + + MATCH_PER_STREAM_OPT(enc_time_bases, str, time_base, oc, st); + if (time_base) { + AVRational q; + if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || + q.den <= 0) { + av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", time_base); + exit_program(1); + } + ost->enc_timebase = q; + } + + ms->max_frames = INT64_MAX; + MATCH_PER_STREAM_OPT(max_frames, i64, ms->max_frames, oc, st); + for (i = 0; inb_max_frames; i++) { + char *p = o->max_frames[i].specifier; + if (!*p && type != AVMEDIA_TYPE_VIDEO) { + av_log(ost, AV_LOG_WARNING, "Applying unspecific -frames to non video streams, maybe you meant -vframes ?\n"); + break; + } + } + + ost->copy_prior_start = -1; + MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st); + + MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st); + if (bsfs && *bsfs) { + ret = av_bsf_list_parse_str(bsfs, &ms->bsf_ctx); + if (ret < 0) { + av_log(ost, AV_LOG_ERROR, "Error parsing bitstream filter sequence '%s': %s\n", bsfs, av_err2str(ret)); + exit_program(1); + } + } + + MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st); + if (codec_tag) { + uint32_t tag = strtol(codec_tag, &next, 0); + if (*next) + tag = AV_RL32(codec_tag); + ost->st->codecpar->codec_tag = tag; + if (ost->enc_ctx) + ost->enc_ctx->codec_tag = tag; + } + + MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st); + if (ost->enc_ctx && qscale >= 0) { + ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE; + ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale; + } + + ms->max_muxing_queue_size = 128; + MATCH_PER_STREAM_OPT(max_muxing_queue_size, i, ms->max_muxing_queue_size, oc, st); + + ms->muxing_queue_data_threshold = 50*1024*1024; + MATCH_PER_STREAM_OPT(muxing_queue_data_threshold, i, ms->muxing_queue_data_threshold, oc, st); + + MATCH_PER_STREAM_OPT(bits_per_raw_sample, i, ost->bits_per_raw_sample, + oc, st); + + MATCH_PER_STREAM_OPT(fix_sub_duration_heartbeat, i, ost->fix_sub_duration_heartbeat, + oc, st); + + if (oc->oformat->flags & AVFMT_GLOBALHEADER && ost->enc_ctx) + ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + + av_dict_copy(&ost->sws_dict, o->g->sws_dict, 0); + + av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0); + if (ost->enc_ctx && av_get_exact_bits_per_sample(ost->enc_ctx->codec_id) == 24) + av_dict_set(&ost->swr_opts, "output_sample_bits", "24", 0); + + if (ost->ist) { + ost->ist->discard = 0; + ost->ist->st->discard = ost->ist->user_set_discard; + } + ost->last_mux_dts = AV_NOPTS_VALUE; + ost->last_filter_pts = AV_NOPTS_VALUE; + + MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, + ost->copy_initial_nonkeyframes, oc, st); + + return ost; +} + +static char *get_ost_filters(const OptionsContext *o, AVFormatContext *oc, + OutputStream *ost) +{ + AVStream *st = ost->st; + + if (ost->filters_script && ost->filters) { + av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n"); + exit_program(1); + } + + if (ost->filters_script) + return file_read(ost->filters_script); + else if (ost->filters) + return av_strdup(ost->filters); + + return av_strdup(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? + "null" : "anull"); +} + +static void check_streamcopy_filters(const OptionsContext *o, AVFormatContext *oc, + OutputStream *ost, enum AVMediaType type) +{ + if (ost->filters_script || ost->filters) { + av_log(ost, AV_LOG_ERROR, + "%s '%s' was defined, but codec copy was selected.\n" + "Filtering and streamcopy cannot be used together.\n", + ost->filters ? "Filtergraph" : "Filtergraph script", + ost->filters ? ost->filters : ost->filters_script); + exit_program(1); + } +} + +static void parse_matrix_coeffs(void *logctx, uint16_t *dest, const char *str) +{ + int i; + const char *p = str; + for (i = 0;; i++) { + dest[i] = atoi(p); + if (i == 63) + break; + p = strchr(p, ','); + if (!p) { + av_log(logctx, AV_LOG_FATAL, + "Syntax error in matrix \"%s\" at coeff %d\n", str, i); + exit_program(1); + } + p++; + } +} + +static OutputStream *new_video_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + AVFormatContext *oc = mux->fc; + AVStream *st; + OutputStream *ost; + char *frame_rate = NULL, *max_frame_rate = NULL, *frame_aspect_ratio = NULL; + + ost = new_output_stream(mux, o, AVMEDIA_TYPE_VIDEO, ist); + st = ost->st; + + MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st); + if (frame_rate && av_parse_video_rate(&ost->frame_rate, frame_rate) < 0) { + av_log(ost, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate); + exit_program(1); + } + + MATCH_PER_STREAM_OPT(max_frame_rates, str, max_frame_rate, oc, st); + if (max_frame_rate && av_parse_video_rate(&ost->max_frame_rate, max_frame_rate) < 0) { + av_log(ost, AV_LOG_FATAL, "Invalid maximum framerate value: %s\n", max_frame_rate); + exit_program(1); + } + + if (frame_rate && max_frame_rate) { + av_log(ost, AV_LOG_ERROR, "Only one of -fpsmax and -r can be set for a stream.\n"); + exit_program(1); + } + + MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); + if (frame_aspect_ratio) { + AVRational q; + if (av_parse_ratio(&q, frame_aspect_ratio, 255, 0, NULL) < 0 || + q.num <= 0 || q.den <= 0) { + av_log(ost, AV_LOG_FATAL, "Invalid aspect ratio: %s\n", frame_aspect_ratio); + exit_program(1); + } + ost->frame_aspect_ratio = q; + } + + MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); + MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); + + if (ost->enc_ctx) { + AVCodecContext *video_enc = ost->enc_ctx; + const char *p = NULL, *fps_mode = NULL; + char *frame_size = NULL; + char *frame_pix_fmt = NULL; + char *intra_matrix = NULL, *inter_matrix = NULL; + char *chroma_intra_matrix = NULL; + int do_pass = 0; + int i; + + MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st); + if (frame_size && av_parse_video_size(&video_enc->width, &video_enc->height, frame_size) < 0) { + av_log(ost, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size); + exit_program(1); + } + + MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st); + if (frame_pix_fmt && *frame_pix_fmt == '+') { + ost->keep_pix_fmt = 1; + if (!*++frame_pix_fmt) + frame_pix_fmt = NULL; + } + if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) { + av_log(ost, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt); + exit_program(1); + } + st->sample_aspect_ratio = video_enc->sample_aspect_ratio; + + MATCH_PER_STREAM_OPT(intra_matrices, str, intra_matrix, oc, st); + if (intra_matrix) { + if (!(video_enc->intra_matrix = av_mallocz(sizeof(*video_enc->intra_matrix) * 64))) + report_and_exit(AVERROR(ENOMEM)); + parse_matrix_coeffs(ost, video_enc->intra_matrix, intra_matrix); + } + MATCH_PER_STREAM_OPT(chroma_intra_matrices, str, chroma_intra_matrix, oc, st); + if (chroma_intra_matrix) { + uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64); + if (!p) + report_and_exit(AVERROR(ENOMEM)); + video_enc->chroma_intra_matrix = p; + parse_matrix_coeffs(ost, p, chroma_intra_matrix); + } + MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st); + if (inter_matrix) { + if (!(video_enc->inter_matrix = av_mallocz(sizeof(*video_enc->inter_matrix) * 64))) + report_and_exit(AVERROR(ENOMEM)); + parse_matrix_coeffs(ost, video_enc->inter_matrix, inter_matrix); + } + + MATCH_PER_STREAM_OPT(rc_overrides, str, p, oc, st); + for (i = 0; p; i++) { + int start, end, q; + int e = sscanf(p, "%d,%d,%d", &start, &end, &q); + if (e != 3) { + av_log(ost, AV_LOG_FATAL, "error parsing rc_override\n"); + exit_program(1); + } + video_enc->rc_override = + av_realloc_array(video_enc->rc_override, + i + 1, sizeof(RcOverride)); + if (!video_enc->rc_override) { + av_log(ost, AV_LOG_FATAL, "Could not (re)allocate memory for rc_override.\n"); + exit_program(1); + } + video_enc->rc_override[i].start_frame = start; + video_enc->rc_override[i].end_frame = end; + if (q > 0) { + video_enc->rc_override[i].qscale = q; + video_enc->rc_override[i].quality_factor = 1.0; + } + else { + video_enc->rc_override[i].qscale = 0; + video_enc->rc_override[i].quality_factor = -q/100.0; + } + p = strchr(p, '/'); + if (p) p++; + } + video_enc->rc_override_count = i; + +#if FFMPEG_OPT_PSNR + if (do_psnr) { + av_log(ost, AV_LOG_WARNING, "The -psnr option is deprecated, use -flags +psnr\n"); + video_enc->flags|= AV_CODEC_FLAG_PSNR; + } +#endif + + /* two pass mode */ + MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st); + if (do_pass) { + if (do_pass & 1) { + video_enc->flags |= AV_CODEC_FLAG_PASS1; + av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND); + } + if (do_pass & 2) { + video_enc->flags |= AV_CODEC_FLAG_PASS2; + av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND); + } + } + + MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st); + if (ost->logfile_prefix && + !(ost->logfile_prefix = av_strdup(ost->logfile_prefix))) + report_and_exit(AVERROR(ENOMEM)); + + if (do_pass) { + int ost_idx = -1; + char logfilename[1024]; + FILE *f; + + /* compute this stream's global index */ + for (int i = 0; i <= ost->file_index; i++) + ost_idx += output_files[i]->nb_streams; + + snprintf(logfilename, sizeof(logfilename), "%s-%d.log", + ost->logfile_prefix ? ost->logfile_prefix : + DEFAULT_PASS_LOGFILENAME_PREFIX, + ost_idx); + if (!strcmp(ost->enc_ctx->codec->name, "libx264")) { + av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE); + } else { + if (video_enc->flags & AV_CODEC_FLAG_PASS2) { + char *logbuffer = file_read(logfilename); + + if (!logbuffer) { + av_log(ost, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n", + logfilename); + exit_program(1); + } + video_enc->stats_in = logbuffer; + } + if (video_enc->flags & AV_CODEC_FLAG_PASS1) { + f = fopen_utf8(logfilename, "wb"); + if (!f) { + av_log(ost, AV_LOG_FATAL, + "Cannot write log file '%s' for pass-1 encoding: %s\n", + logfilename, strerror(errno)); + exit_program(1); + } + ost->logfile = f; + } + } + } + + MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st); + + ost->top_field_first = -1; + MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st); + + ost->vsync_method = video_sync_method; + MATCH_PER_STREAM_OPT(fps_mode, str, fps_mode, oc, st); + if (fps_mode) + parse_and_set_vsync(fps_mode, &ost->vsync_method, ost->file_index, ost->index, 0); + + if ((ost->frame_rate.num || ost->max_frame_rate.num) && + !(ost->vsync_method == VSYNC_AUTO || + ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR)) { + av_log(ost, AV_LOG_FATAL, "One of -r/-fpsmax was specified " + "together a non-CFR -vsync/-fps_mode. This is contradictory.\n"); + exit_program(1); + } + + if (ost->vsync_method == VSYNC_AUTO) { + if (ost->frame_rate.num || ost->max_frame_rate.num) { + ost->vsync_method = VSYNC_CFR; + } else if (!strcmp(oc->oformat->name, "avi")) { + ost->vsync_method = VSYNC_VFR; + } else { + ost->vsync_method = (oc->oformat->flags & AVFMT_VARIABLE_FPS) ? + ((oc->oformat->flags & AVFMT_NOTIMESTAMPS) ? + VSYNC_PASSTHROUGH : VSYNC_VFR) : + VSYNC_CFR; + } + + if (ost->ist && ost->vsync_method == VSYNC_CFR) { + const InputFile *ifile = input_files[ost->ist->file_index]; + + if (ifile->nb_streams == 1 && ifile->input_ts_offset == 0) + ost->vsync_method = VSYNC_VSCFR; + } + + if (ost->vsync_method == VSYNC_CFR && copy_ts) { + ost->vsync_method = VSYNC_VSCFR; + } + } + ost->is_cfr = (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR); + + ost->avfilter = get_ost_filters(o, oc, ost); + if (!ost->avfilter) + exit_program(1); + + ost->last_frame = av_frame_alloc(); + if (!ost->last_frame) + report_and_exit(AVERROR(ENOMEM)); + } else + check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_VIDEO); + + return ost; +} + +static OutputStream *new_audio_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + AVFormatContext *oc = mux->fc; + AVStream *st; + OutputStream *ost; + + ost = new_output_stream(mux, o, AVMEDIA_TYPE_AUDIO, ist); + st = ost->st; + + + MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); + MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); + + if (ost->enc_ctx) { + AVCodecContext *audio_enc = ost->enc_ctx; + int channels = 0; + char *layout = NULL; + char *sample_fmt = NULL; + + MATCH_PER_STREAM_OPT(audio_channels, i, channels, oc, st); + if (channels) { + audio_enc->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + audio_enc->ch_layout.nb_channels = channels; + } + + MATCH_PER_STREAM_OPT(audio_ch_layouts, str, layout, oc, st); + if (layout) { + if (av_channel_layout_from_string(&audio_enc->ch_layout, layout) < 0) { +#if FF_API_OLD_CHANNEL_LAYOUT + uint64_t mask; + AV_NOWARN_DEPRECATED({ + mask = av_get_channel_layout(layout); + }) + if (!mask) { +#endif + av_log(ost, AV_LOG_FATAL, "Unknown channel layout: %s\n", layout); + exit_program(1); +#if FF_API_OLD_CHANNEL_LAYOUT + } + av_log(ost, AV_LOG_WARNING, "Channel layout '%s' uses a deprecated syntax.\n", + layout); + av_channel_layout_from_mask(&audio_enc->ch_layout, mask); +#endif + } + } + + MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st); + if (sample_fmt && + (audio_enc->sample_fmt = av_get_sample_fmt(sample_fmt)) == AV_SAMPLE_FMT_NONE) { + av_log(ost, AV_LOG_FATAL, "Invalid sample format '%s'\n", sample_fmt); + exit_program(1); + } + + MATCH_PER_STREAM_OPT(audio_sample_rate, i, audio_enc->sample_rate, oc, st); + + MATCH_PER_STREAM_OPT(apad, str, ost->apad, oc, st); + ost->apad = av_strdup(ost->apad); + + ost->avfilter = get_ost_filters(o, oc, ost); + if (!ost->avfilter) + exit_program(1); + +#if FFMPEG_OPT_MAP_CHANNEL + /* check for channel mapping for this audio stream */ + for (int n = 0; n < o->nb_audio_channel_maps; n++) { + AudioChannelMap *map = &o->audio_channel_maps[n]; + if ((map->ofile_idx == -1 || ost->file_index == map->ofile_idx) && + (map->ostream_idx == -1 || ost->st->index == map->ostream_idx)) { + InputStream *ist; + + if (map->channel_idx == -1) { + ist = NULL; + } else if (!ost->ist) { + av_log(ost, AV_LOG_FATAL, "Cannot determine input stream for channel mapping %d.%d\n", + ost->file_index, ost->st->index); + continue; + } else { + ist = ost->ist; + } + + if (!ist || (ist->file_index == map->file_idx && ist->st->index == map->stream_idx)) { + if (av_reallocp_array(&ost->audio_channels_map, + ost->audio_channels_mapped + 1, + sizeof(*ost->audio_channels_map) + ) < 0 ) + report_and_exit(AVERROR(ENOMEM)); + + ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx; + } + } + } +#endif + } else + check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_AUDIO); + + return ost; +} + +static OutputStream *new_data_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + OutputStream *ost; + + ost = new_output_stream(mux, o, AVMEDIA_TYPE_DATA, ist); + if (ost->enc_ctx) { + av_log(ost, AV_LOG_FATAL, "Data stream encoding not supported yet (only streamcopy)\n"); + exit_program(1); + } + + return ost; +} + +static OutputStream *new_unknown_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + OutputStream *ost; + + ost = new_output_stream(mux, o, AVMEDIA_TYPE_UNKNOWN, ist); + if (ost->enc_ctx) { + av_log(ost, AV_LOG_FATAL, "Unknown stream encoding not supported yet (only streamcopy)\n"); + exit_program(1); + } + + return ost; +} + +static OutputStream *new_attachment_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + OutputStream *ost = new_output_stream(mux, o, AVMEDIA_TYPE_ATTACHMENT, ist); + ost->finished = 1; + return ost; +} + +static OutputStream *new_subtitle_stream(Muxer *mux, const OptionsContext *o, InputStream *ist) +{ + AVStream *st; + OutputStream *ost; + + ost = new_output_stream(mux, o, AVMEDIA_TYPE_SUBTITLE, ist); + st = ost->st; + + if (ost->enc_ctx) { + AVCodecContext *subtitle_enc = ost->enc_ctx; + char *frame_size = NULL; + + MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, mux->fc, st); + if (frame_size && av_parse_video_size(&subtitle_enc->width, &subtitle_enc->height, frame_size) < 0) { + av_log(ost, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size); + exit_program(1); + } + } + + return ost; +} + +static void init_output_filter(OutputFilter *ofilter, const OptionsContext *o, + Muxer *mux) +{ + OutputStream *ost; + + switch (ofilter->type) { + case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(mux, o, NULL); break; + case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(mux, o, NULL); break; + default: + av_log(mux, AV_LOG_FATAL, "Only video and audio filters are supported " + "currently.\n"); + exit_program(1); + } + + ost->filter = ofilter; + + ofilter->ost = ost; + ofilter->format = -1; + + if (!ost->enc_ctx) { + av_log(ost, AV_LOG_ERROR, "Streamcopy requested for output stream fed " + "from a complex filtergraph. Filtering and streamcopy " + "cannot be used together.\n"); + exit_program(1); + } + + if (ost->avfilter && (ost->filters || ost->filters_script)) { + const char *opt = ost->filters ? "-vf/-af/-filter" : "-filter_script"; + av_log(ost, AV_LOG_ERROR, + "%s '%s' was specified through the %s option " + "for output stream %d:%d, which is fed from a complex filtergraph.\n" + "%s and -filter_complex cannot be used together for the same stream.\n", + ost->filters ? "Filtergraph" : "Filtergraph script", + ost->filters ? ost->filters : ost->filters_script, + opt, ost->file_index, ost->index, opt); + exit_program(1); + } + + avfilter_inout_free(&ofilter->out_tmp); +} + +static void map_auto_video(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + InputStream *best_ist = NULL; + int best_score = 0; + int qcr; + + /* video: highest resolution */ + if (av_guess_codec(oc->oformat, NULL, oc->url, NULL, AVMEDIA_TYPE_VIDEO) == AV_CODEC_ID_NONE) + return; + + qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0); + for (int j = 0; j < nb_input_files; j++) { + InputFile *ifile = input_files[j]; + InputStream *file_best_ist = NULL; + int file_best_score = 0; + for (int i = 0; i < ifile->nb_streams; i++) { + InputStream *ist = ifile->streams[i]; + int score; + + if (ist->user_set_discard == AVDISCARD_ALL || + ist->st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) + continue; + + score = ist->st->codecpar->width * ist->st->codecpar->height + + 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) + + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); + if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) + score = 1; + + if (score > file_best_score) { + if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) + continue; + file_best_score = score; + file_best_ist = ist; + } + } + if (file_best_ist) { + if((qcr == MKTAG('A', 'P', 'I', 'C')) || + !(file_best_ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) + file_best_score -= 5000000*!!(file_best_ist->st->disposition & AV_DISPOSITION_DEFAULT); + if (file_best_score > best_score) { + best_score = file_best_score; + best_ist = file_best_ist; + } + } + } + if (best_ist) + new_video_stream(mux, o, best_ist); +} + +static void map_auto_audio(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + InputStream *best_ist = NULL; + int best_score = 0; + + /* audio: most channels */ + if (av_guess_codec(oc->oformat, NULL, oc->url, NULL, AVMEDIA_TYPE_AUDIO) == AV_CODEC_ID_NONE) + return; + + for (int j = 0; j < nb_input_files; j++) { + InputFile *ifile = input_files[j]; + InputStream *file_best_ist = NULL; + int file_best_score = 0; + for (int i = 0; i < ifile->nb_streams; i++) { + InputStream *ist = ifile->streams[i]; + int score; + + if (ist->user_set_discard == AVDISCARD_ALL || + ist->st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) + continue; + + score = ist->st->codecpar->ch_layout.nb_channels + + 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) + + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); + if (score > file_best_score) { + file_best_score = score; + file_best_ist = ist; + } + } + if (file_best_ist) { + file_best_score -= 5000000*!!(file_best_ist->st->disposition & AV_DISPOSITION_DEFAULT); + if (file_best_score > best_score) { + best_score = file_best_score; + best_ist = file_best_ist; + } + } + } + if (best_ist) + new_audio_stream(mux, o, best_ist); +} + +static void map_auto_subtitle(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + char *subtitle_codec_name = NULL; + + /* subtitles: pick first */ + MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s"); + if (!avcodec_find_encoder(oc->oformat->subtitle_codec) && !subtitle_codec_name) + return; + + for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) + if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) { + AVCodecDescriptor const *input_descriptor = + avcodec_descriptor_get(ist->st->codecpar->codec_id); + AVCodecDescriptor const *output_descriptor = NULL; + AVCodec const *output_codec = + avcodec_find_encoder(oc->oformat->subtitle_codec); + int input_props = 0, output_props = 0; + if (ist->user_set_discard == AVDISCARD_ALL) + continue; + if (output_codec) + output_descriptor = avcodec_descriptor_get(output_codec->id); + if (input_descriptor) + input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); + if (output_descriptor) + output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); + if (subtitle_codec_name || + input_props & output_props || + // Map dvb teletext which has neither property to any output subtitle encoder + input_descriptor && output_descriptor && + (!input_descriptor->props || + !output_descriptor->props)) { + new_subtitle_stream(mux, o, ist); + break; + } + } +} + +static void map_auto_data(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + /* Data only if codec id match */ + enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, oc->url, NULL, AVMEDIA_TYPE_DATA); + + if (codec_id == AV_CODEC_ID_NONE) + return; + + for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) { + if (ist->user_set_discard == AVDISCARD_ALL) + continue; + if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA && + ist->st->codecpar->codec_id == codec_id ) + new_data_stream(mux, o, ist); + } +} + +static void map_manual(Muxer *mux, const OptionsContext *o, const StreamMap *map) +{ + InputStream *ist; + + if (map->disabled) + return; + + if (map->linklabel) { + FilterGraph *fg; + OutputFilter *ofilter = NULL; + int j, k; + + for (j = 0; j < nb_filtergraphs; j++) { + fg = filtergraphs[j]; + for (k = 0; k < fg->nb_outputs; k++) { + AVFilterInOut *out = fg->outputs[k]->out_tmp; + if (out && !strcmp(out->name, map->linklabel)) { + ofilter = fg->outputs[k]; + goto loop_end; + } + } + } +loop_end: + if (!ofilter) { + av_log(mux, AV_LOG_FATAL, "Output with label '%s' does not exist " + "in any defined filter graph, or was already used elsewhere.\n", map->linklabel); + exit_program(1); + } + init_output_filter(ofilter, o, mux); + } else { + ist = input_files[map->file_index]->streams[map->stream_index]; + if (ist->user_set_discard == AVDISCARD_ALL) { + av_log(mux, AV_LOG_FATAL, "Stream #%d:%d is disabled and cannot be mapped.\n", + map->file_index, map->stream_index); + exit_program(1); + } + if(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) + return; + if(o-> audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) + return; + if(o-> video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) + return; + if(o-> data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA) + return; + + switch (ist->st->codecpar->codec_type) { + case AVMEDIA_TYPE_VIDEO: new_video_stream (mux, o, ist); break; + case AVMEDIA_TYPE_AUDIO: new_audio_stream (mux, o, ist); break; + case AVMEDIA_TYPE_SUBTITLE: new_subtitle_stream (mux, o, ist); break; + case AVMEDIA_TYPE_DATA: new_data_stream (mux, o, ist); break; + case AVMEDIA_TYPE_ATTACHMENT: new_attachment_stream(mux, o, ist); break; + case AVMEDIA_TYPE_UNKNOWN: + if (copy_unknown_streams) { + new_unknown_stream (mux, o, ist); + break; + } + default: + av_log(mux, ignore_unknown_streams ? AV_LOG_WARNING : AV_LOG_FATAL, + "Cannot map stream #%d:%d - unsupported type.\n", + map->file_index, map->stream_index); + if (!ignore_unknown_streams) { + av_log(mux, AV_LOG_FATAL, + "If you want unsupported types ignored instead " + "of failing, please use the -ignore_unknown option\n" + "If you want them copied, please use -copy_unknown\n"); + exit_program(1); + } + } + } +} + +static void of_add_attachments(Muxer *mux, const OptionsContext *o) +{ + OutputStream *ost; + int err; + + for (int i = 0; i < o->nb_attachments; i++) { + AVIOContext *pb; + uint8_t *attachment; + const char *p; + int64_t len; + + if ((err = avio_open2(&pb, o->attachments[i], AVIO_FLAG_READ, &int_cb, NULL)) < 0) { + av_log(mux, AV_LOG_FATAL, "Could not open attachment file %s.\n", + o->attachments[i]); + exit_program(1); + } + if ((len = avio_size(pb)) <= 0) { + av_log(mux, AV_LOG_FATAL, "Could not get size of the attachment %s.\n", + o->attachments[i]); + exit_program(1); + } + if (len > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE || + !(attachment = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE))) { + av_log(mux, AV_LOG_FATAL, "Attachment %s too large.\n", + o->attachments[i]); + exit_program(1); + } + avio_read(pb, attachment, len); + memset(attachment + len, 0, AV_INPUT_BUFFER_PADDING_SIZE); + + ost = new_attachment_stream(mux, o, NULL); + ost->attachment_filename = o->attachments[i]; + ost->st->codecpar->extradata = attachment; + ost->st->codecpar->extradata_size = len; + + p = strrchr(o->attachments[i], '/'); + av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE); + avio_closep(&pb); + } +} + +static void create_streams(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + int auto_disable_v = o->video_disable; + int auto_disable_a = o->audio_disable; + int auto_disable_s = o->subtitle_disable; + int auto_disable_d = o->data_disable; + + /* create streams for all unlabeled output pads */ + for (int i = 0; i < nb_filtergraphs; i++) { + FilterGraph *fg = filtergraphs[i]; + for (int j = 0; j < fg->nb_outputs; j++) { + OutputFilter *ofilter = fg->outputs[j]; + + if (!ofilter->out_tmp || ofilter->out_tmp->name) + continue; + + switch (ofilter->type) { + case AVMEDIA_TYPE_VIDEO: auto_disable_v = 1; break; + case AVMEDIA_TYPE_AUDIO: auto_disable_a = 1; break; + case AVMEDIA_TYPE_SUBTITLE: auto_disable_s = 1; break; + } + init_output_filter(ofilter, o, mux); + } + } + + if (!o->nb_stream_maps) { + /* pick the "best" stream of each type */ + if (!auto_disable_v) + map_auto_video(mux, o); + if (!auto_disable_a) + map_auto_audio(mux, o); + if (!auto_disable_s) + map_auto_subtitle(mux, o); + if (!auto_disable_d) + map_auto_data(mux, o); + } else { + for (int i = 0; i < o->nb_stream_maps; i++) + map_manual(mux, o, &o->stream_maps[i]); + } + + of_add_attachments(mux, o); + + if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) { + av_dump_format(oc, nb_output_files - 1, oc->url, 1); + av_log(mux, AV_LOG_ERROR, "Output file does not contain any stream\n"); + exit_program(1); + } +} + +static int setup_sync_queues(Muxer *mux, AVFormatContext *oc, int64_t buf_size_us) +{ + OutputFile *of = &mux->of; + int nb_av_enc = 0, nb_interleaved = 0; + int limit_frames = 0, limit_frames_av_enc = 0; + +#define IS_AV_ENC(ost, type) \ + (ost->enc_ctx && (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) +#define IS_INTERLEAVED(type) (type != AVMEDIA_TYPE_ATTACHMENT) + + for (int i = 0; i < oc->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + MuxStream *ms = ms_from_ost(ost); + enum AVMediaType type = ost->st->codecpar->codec_type; + + ost->sq_idx_encode = -1; + ost->sq_idx_mux = -1; + + nb_interleaved += IS_INTERLEAVED(type); + nb_av_enc += IS_AV_ENC(ost, type); + + limit_frames |= ms->max_frames < INT64_MAX; + limit_frames_av_enc |= (ms->max_frames < INT64_MAX) && IS_AV_ENC(ost, type); + } + + if (!((nb_interleaved > 1 && of->shortest) || + (nb_interleaved > 0 && limit_frames))) + return 0; + + /* if we have more than one encoded audio/video streams, or at least + * one encoded audio/video stream is frame-limited, then we + * synchronize them before encoding */ + if ((of->shortest && nb_av_enc > 1) || limit_frames_av_enc) { + of->sq_encode = sq_alloc(SYNC_QUEUE_FRAMES, buf_size_us); + if (!of->sq_encode) + return AVERROR(ENOMEM); + + for (int i = 0; i < oc->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + MuxStream *ms = ms_from_ost(ost); + enum AVMediaType type = ost->st->codecpar->codec_type; + + if (!IS_AV_ENC(ost, type)) + continue; + + ost->sq_idx_encode = sq_add_stream(of->sq_encode, + of->shortest || ms->max_frames < INT64_MAX); + if (ost->sq_idx_encode < 0) + return ost->sq_idx_encode; + + ost->sq_frame = av_frame_alloc(); + if (!ost->sq_frame) + return AVERROR(ENOMEM); + + if (ms->max_frames != INT64_MAX) + sq_limit_frames(of->sq_encode, ost->sq_idx_encode, ms->max_frames); + } + } + + /* if there are any additional interleaved streams, then ALL the streams + * are also synchronized before sending them to the muxer */ + if (nb_interleaved > nb_av_enc) { + mux->sq_mux = sq_alloc(SYNC_QUEUE_PACKETS, buf_size_us); + if (!mux->sq_mux) + return AVERROR(ENOMEM); + + mux->sq_pkt = av_packet_alloc(); + if (!mux->sq_pkt) + return AVERROR(ENOMEM); + + for (int i = 0; i < oc->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + MuxStream *ms = ms_from_ost(ost); + enum AVMediaType type = ost->st->codecpar->codec_type; + + if (!IS_INTERLEAVED(type)) + continue; + + ost->sq_idx_mux = sq_add_stream(mux->sq_mux, + of->shortest || ms->max_frames < INT64_MAX); + if (ost->sq_idx_mux < 0) + return ost->sq_idx_mux; + + if (ms->max_frames != INT64_MAX) + sq_limit_frames(mux->sq_mux, ost->sq_idx_mux, ms->max_frames); + } + } + +#undef IS_AV_ENC +#undef IS_INTERLEAVED + + return 0; +} + +static void of_add_programs(Muxer *mux, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + /* process manually set programs */ + for (int i = 0; i < o->nb_program; i++) { + const char *p = o->program[i].u.str; + int progid = i+1; + AVProgram *program; + + while(*p) { + const char *p2 = av_get_token(&p, ":"); + const char *to_dealloc = p2; + char *key; + if (!p2) + break; + + if(*p) p++; + + key = av_get_token(&p2, "="); + if (!key || !*p2) { + av_freep(&to_dealloc); + av_freep(&key); + break; + } + p2++; + + if (!strcmp(key, "program_num")) + progid = strtol(p2, NULL, 0); + av_freep(&to_dealloc); + av_freep(&key); + } + + program = av_new_program(oc, progid); + if (!program) + report_and_exit(AVERROR(ENOMEM)); + + p = o->program[i].u.str; + while(*p) { + const char *p2 = av_get_token(&p, ":"); + const char *to_dealloc = p2; + char *key; + if (!p2) + break; + if(*p) p++; + + key = av_get_token(&p2, "="); + if (!key) { + av_log(mux, AV_LOG_FATAL, + "No '=' character in program string %s.\n", + p2); + exit_program(1); + } + if (!*p2) + exit_program(1); + p2++; + + if (!strcmp(key, "title")) { + av_dict_set(&program->metadata, "title", p2, 0); + } else if (!strcmp(key, "program_num")) { + } else if (!strcmp(key, "st")) { + int st_num = strtol(p2, NULL, 0); + av_program_add_stream_index(oc, progid, st_num); + } else { + av_log(mux, AV_LOG_FATAL, "Unknown program key %s.\n", key); + exit_program(1); + } + av_freep(&to_dealloc); + av_freep(&key); + } + } +} + +/** + * Parse a metadata specifier passed as 'arg' parameter. + * @param arg metadata string to parse + * @param type metadata type is written here -- g(lobal)/s(tream)/c(hapter)/p(rogram) + * @param index for type c/p, chapter/program index is written here + * @param stream_spec for type s, the stream specifier is written here + */ +static void parse_meta_type(void *logctx, const char *arg, + char *type, int *index, const char **stream_spec) +{ + if (*arg) { + *type = *arg; + switch (*arg) { + case 'g': + break; + case 's': + if (*(++arg) && *arg != ':') { + av_log(logctx, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", arg); + exit_program(1); + } + *stream_spec = *arg == ':' ? arg + 1 : ""; + break; + case 'c': + case 'p': + if (*(++arg) == ':') + *index = strtol(++arg, NULL, 0); + break; + default: + av_log(logctx, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); + exit_program(1); + } + } else + *type = 'g'; +} + +static void of_add_metadata(OutputFile *of, AVFormatContext *oc, + const OptionsContext *o) +{ + for (int i = 0; i < o->nb_metadata; i++) { + AVDictionary **m; + char type, *val; + const char *stream_spec; + int index = 0, ret = 0; + + val = strchr(o->metadata[i].u.str, '='); + if (!val) { + av_log(of, AV_LOG_FATAL, "No '=' character in metadata string %s.\n", + o->metadata[i].u.str); + exit_program(1); + } + *val++ = 0; + + parse_meta_type(of, o->metadata[i].specifier, &type, &index, &stream_spec); + if (type == 's') { + for (int j = 0; j < oc->nb_streams; j++) { + OutputStream *ost = of->streams[j]; + if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) { +#if FFMPEG_ROTATION_METADATA + if (!strcmp(o->metadata[i].u.str, "rotate")) { + char *tail; + double theta = av_strtod(val, &tail); + if (!*tail) { + ost->rotate_overridden = 1; + ost->rotate_override_value = theta; + } + + av_log(ost, AV_LOG_WARNING, + "Conversion of a 'rotate' metadata key to a " + "proper display matrix rotation is deprecated. " + "See -display_rotation for setting rotation " + "instead."); + } else { +#endif + av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0); +#if FFMPEG_ROTATION_METADATA + } +#endif + } else if (ret < 0) + exit_program(1); + } + } else { + switch (type) { + case 'g': + m = &oc->metadata; + break; + case 'c': + if (index < 0 || index >= oc->nb_chapters) { + av_log(of, AV_LOG_FATAL, "Invalid chapter index %d in metadata specifier.\n", index); + exit_program(1); + } + m = &oc->chapters[index]->metadata; + break; + case 'p': + if (index < 0 || index >= oc->nb_programs) { + av_log(of, AV_LOG_FATAL, "Invalid program index %d in metadata specifier.\n", index); + exit_program(1); + } + m = &oc->programs[index]->metadata; + break; + default: + av_log(of, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier); + exit_program(1); + } + av_dict_set(m, o->metadata[i].u.str, *val ? val : NULL, 0); + } + } +} + +static void set_channel_layout(OutputFilter *f, OutputStream *ost) +{ + const AVCodec *c = ost->enc_ctx->codec; + int i, err; + + if (ost->enc_ctx->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) { + /* Pass the layout through for all orders but UNSPEC */ + err = av_channel_layout_copy(&f->ch_layout, &ost->enc_ctx->ch_layout); + if (err < 0) + report_and_exit(AVERROR(ENOMEM)); + return; + } + + /* Requested layout is of order UNSPEC */ + if (!c->ch_layouts) { + /* Use the default native layout for the requested amount of channels when the + encoder doesn't have a list of supported layouts */ + av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels); + return; + } + /* Encoder has a list of supported layouts. Pick the first layout in it with the + same amount of channels as the requested layout */ + for (i = 0; c->ch_layouts[i].nb_channels; i++) { + if (c->ch_layouts[i].nb_channels == ost->enc_ctx->ch_layout.nb_channels) + break; + } + if (c->ch_layouts[i].nb_channels) { + /* Use it if one is found */ + err = av_channel_layout_copy(&f->ch_layout, &c->ch_layouts[i]); + if (err < 0) + report_and_exit(AVERROR(ENOMEM)); + return; + } + /* If no layout for the amount of channels requested was found, use the default + native layout for it. */ + av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels); +} + +static int copy_chapters(InputFile *ifile, OutputFile *ofile, AVFormatContext *os, + int copy_metadata) +{ + AVFormatContext *is = ifile->ctx; + AVChapter **tmp; + int i; + + tmp = av_realloc_f(os->chapters, is->nb_chapters + os->nb_chapters, sizeof(*os->chapters)); + if (!tmp) + return AVERROR(ENOMEM); + os->chapters = tmp; + + for (i = 0; i < is->nb_chapters; i++) { + AVChapter *in_ch = is->chapters[i], *out_ch; + int64_t start_time = (ofile->start_time == AV_NOPTS_VALUE) ? 0 : ofile->start_time; + int64_t ts_off = av_rescale_q(start_time - ifile->ts_offset, + AV_TIME_BASE_Q, in_ch->time_base); + int64_t rt = (ofile->recording_time == INT64_MAX) ? INT64_MAX : + av_rescale_q(ofile->recording_time, AV_TIME_BASE_Q, in_ch->time_base); + + + if (in_ch->end < ts_off) + continue; + if (rt != INT64_MAX && in_ch->start > rt + ts_off) + break; + + out_ch = av_mallocz(sizeof(AVChapter)); + if (!out_ch) + return AVERROR(ENOMEM); + + out_ch->id = in_ch->id; + out_ch->time_base = in_ch->time_base; + out_ch->start = FFMAX(0, in_ch->start - ts_off); + out_ch->end = FFMIN(rt, in_ch->end - ts_off); + + if (copy_metadata) + av_dict_copy(&out_ch->metadata, in_ch->metadata, 0); + + os->chapters[os->nb_chapters++] = out_ch; + } + return 0; +} + +static int copy_metadata(Muxer *mux, AVFormatContext *ic, + const char *outspec, const char *inspec, + int *metadata_global_manual, int *metadata_streams_manual, + int *metadata_chapters_manual, const OptionsContext *o) +{ + AVFormatContext *oc = mux->fc; + AVDictionary **meta_in = NULL; + AVDictionary **meta_out = NULL; + int i, ret = 0; + char type_in, type_out; + const char *istream_spec = NULL, *ostream_spec = NULL; + int idx_in = 0, idx_out = 0; + + parse_meta_type(mux, inspec, &type_in, &idx_in, &istream_spec); + parse_meta_type(mux, outspec, &type_out, &idx_out, &ostream_spec); + + if (type_in == 'g' || type_out == 'g') + *metadata_global_manual = 1; + if (type_in == 's' || type_out == 's') + *metadata_streams_manual = 1; + if (type_in == 'c' || type_out == 'c') + *metadata_chapters_manual = 1; + + /* ic is NULL when just disabling automatic mappings */ + if (!ic) + return 0; + +#define METADATA_CHECK_INDEX(index, nb_elems, desc)\ + if ((index) < 0 || (index) >= (nb_elems)) {\ + av_log(mux, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ + (desc), (index));\ + exit_program(1);\ + } + +#define SET_DICT(type, meta, context, index)\ + switch (type) {\ + case 'g':\ + meta = &context->metadata;\ + break;\ + case 'c':\ + METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ + meta = &context->chapters[index]->metadata;\ + break;\ + case 'p':\ + METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ + meta = &context->programs[index]->metadata;\ + break;\ + case 's':\ + break; /* handled separately below */ \ + default: av_assert0(0);\ + }\ + + SET_DICT(type_in, meta_in, ic, idx_in); + SET_DICT(type_out, meta_out, oc, idx_out); + + /* for input streams choose first matching stream */ + if (type_in == 's') { + for (i = 0; i < ic->nb_streams; i++) { + if ((ret = check_stream_specifier(ic, ic->streams[i], istream_spec)) > 0) { + meta_in = &ic->streams[i]->metadata; + break; + } else if (ret < 0) + exit_program(1); + } + if (!meta_in) { + av_log(mux, AV_LOG_FATAL, "Stream specifier %s does not match any streams.\n", istream_spec); + exit_program(1); + } + } + + if (type_out == 's') { + for (i = 0; i < oc->nb_streams; i++) { + if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) { + meta_out = &oc->streams[i]->metadata; + av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); + } else if (ret < 0) + exit_program(1); + } + } else + av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); + + return 0; +} + +static void copy_meta(Muxer *mux, const OptionsContext *o) +{ + OutputFile *of = &mux->of; + AVFormatContext *oc = mux->fc; + int chapters_input_file = o->chapters_input_file; + int metadata_global_manual = 0; + int metadata_streams_manual = 0; + int metadata_chapters_manual = 0; + + /* copy metadata */ + for (int i = 0; i < o->nb_metadata_map; i++) { + char *p; + int in_file_index = strtol(o->metadata_map[i].u.str, &p, 0); + + if (in_file_index >= nb_input_files) { + av_log(mux, AV_LOG_FATAL, "Invalid input file index %d while " + "processing metadata maps\n", in_file_index); + exit_program(1); + } + copy_metadata(mux, + in_file_index >= 0 ? input_files[in_file_index]->ctx : NULL, + o->metadata_map[i].specifier, *p ? p + 1 : p, + &metadata_global_manual, &metadata_streams_manual, + &metadata_chapters_manual, o); + } + + /* copy chapters */ + if (chapters_input_file >= nb_input_files) { + if (chapters_input_file == INT_MAX) { + /* copy chapters from the first input file that has them*/ + chapters_input_file = -1; + for (int i = 0; i < nb_input_files; i++) + if (input_files[i]->ctx->nb_chapters) { + chapters_input_file = i; + break; + } + } else { + av_log(mux, AV_LOG_FATAL, "Invalid input file index %d in chapter mapping.\n", + chapters_input_file); + exit_program(1); + } + } + if (chapters_input_file >= 0) + copy_chapters(input_files[chapters_input_file], of, oc, + !metadata_chapters_manual); + + /* copy global metadata by default */ + if (!metadata_global_manual && nb_input_files){ + av_dict_copy(&oc->metadata, input_files[0]->ctx->metadata, + AV_DICT_DONT_OVERWRITE); + if (of->recording_time != INT64_MAX) + av_dict_set(&oc->metadata, "duration", NULL, 0); + av_dict_set(&oc->metadata, "creation_time", NULL, 0); + av_dict_set(&oc->metadata, "company_name", NULL, 0); + av_dict_set(&oc->metadata, "product_name", NULL, 0); + av_dict_set(&oc->metadata, "product_version", NULL, 0); + } + if (!metadata_streams_manual) + for (int i = 0; i < of->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + + if (!ost->ist) /* this is true e.g. for attached files */ + continue; + av_dict_copy(&ost->st->metadata, ost->ist->st->metadata, AV_DICT_DONT_OVERWRITE); + if (ost->enc_ctx) { + av_dict_set(&ost->st->metadata, "encoder", NULL, 0); + } + } +} + +static int set_dispositions(Muxer *mux, const OptionsContext *o) +{ + OutputFile *of = &mux->of; + AVFormatContext *ctx = mux->fc; + + int nb_streams[AVMEDIA_TYPE_NB] = { 0 }; + int have_default[AVMEDIA_TYPE_NB] = { 0 }; + int have_manual = 0; + int ret = 0; + + const char **dispositions; + + dispositions = av_calloc(ctx->nb_streams, sizeof(*dispositions)); + if (!dispositions) + return AVERROR(ENOMEM); + + // first, copy the input dispositions + for (int i = 0; i < ctx->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + + nb_streams[ost->st->codecpar->codec_type]++; + + MATCH_PER_STREAM_OPT(disposition, str, dispositions[i], ctx, ost->st); + + have_manual |= !!dispositions[i]; + + if (ost->ist) { + ost->st->disposition = ost->ist->st->disposition; + + if (ost->st->disposition & AV_DISPOSITION_DEFAULT) + have_default[ost->st->codecpar->codec_type] = 1; + } + } + + if (have_manual) { + // process manually set dispositions - they override the above copy + for (int i = 0; i < ctx->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + const char *disp = dispositions[i]; + + if (!disp) + continue; + + ret = av_opt_set(ost->st, "disposition", disp, 0); + if (ret < 0) + goto finish; + } + } else { + // For each media type with more than one stream, find a suitable stream to + // mark as default, unless one is already marked default. + // "Suitable" means the first of that type, skipping attached pictures. + for (int i = 0; i < ctx->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + enum AVMediaType type = ost->st->codecpar->codec_type; + + if (nb_streams[type] < 2 || have_default[type] || + ost->st->disposition & AV_DISPOSITION_ATTACHED_PIC) + continue; + + ost->st->disposition |= AV_DISPOSITION_DEFAULT; + have_default[type] = 1; + } + } + +finish: + av_freep(&dispositions); + + return ret; +} + +const char *const forced_keyframes_const_names[] = { + "n", + "n_forced", + "prev_forced_n", + "prev_forced_t", + "t", + NULL +}; + +static int compare_int64(const void *a, const void *b) +{ + return FFDIFFSIGN(*(const int64_t *)a, *(const int64_t *)b); +} + +static void parse_forced_key_frames(KeyframeForceCtx *kf, const Muxer *mux, + const char *spec) +{ + const char *p; + int n = 1, i, size, index = 0; + int64_t t, *pts; + + for (p = spec; *p; p++) + if (*p == ',') + n++; + size = n; + pts = av_malloc_array(size, sizeof(*pts)); + if (!pts) + report_and_exit(AVERROR(ENOMEM)); + + p = spec; + for (i = 0; i < n; i++) { + char *next = strchr(p, ','); + + if (next) + *next++ = 0; + + if (!memcmp(p, "chapters", 8)) { + AVChapter * const *ch = mux->fc->chapters; + unsigned int nb_ch = mux->fc->nb_chapters; + int j; + + if (nb_ch > INT_MAX - size || + !(pts = av_realloc_f(pts, size += nb_ch - 1, + sizeof(*pts)))) + report_and_exit(AVERROR(ENOMEM)); + t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0; + + for (j = 0; j < nb_ch; j++) { + const AVChapter *c = ch[j]; + av_assert1(index < size); + pts[index++] = av_rescale_q(c->start, c->time_base, + AV_TIME_BASE_Q) + t; + } + + } else { + av_assert1(index < size); + pts[index++] = parse_time_or_die("force_key_frames", p, 1); + } + + p = next; + } + + av_assert0(index == size); + qsort(pts, size, sizeof(*pts), compare_int64); + kf->nb_pts = size; + kf->pts = pts; +} + +static int process_forced_keyframes(Muxer *mux, const OptionsContext *o) +{ + for (int i = 0; i < mux->of.nb_streams; i++) { + OutputStream *ost = mux->of.streams[i]; + const char *forced_keyframes = NULL; + + MATCH_PER_STREAM_OPT(forced_key_frames, str, forced_keyframes, mux->fc, ost->st); + + if (!(ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && + ost->enc_ctx && forced_keyframes)) + continue; + + if (!strncmp(forced_keyframes, "expr:", 5)) { + int ret = av_expr_parse(&ost->kf.pexpr, forced_keyframes + 5, + forced_keyframes_const_names, NULL, NULL, NULL, NULL, 0, NULL); + if (ret < 0) { + av_log(ost, AV_LOG_ERROR, + "Invalid force_key_frames expression '%s'\n", forced_keyframes + 5); + return ret; + } + ost->kf.expr_const_values[FKF_N] = 0; + ost->kf.expr_const_values[FKF_N_FORCED] = 0; + ost->kf.expr_const_values[FKF_PREV_FORCED_N] = NAN; + ost->kf.expr_const_values[FKF_PREV_FORCED_T] = NAN; + + // Don't parse the 'forced_keyframes' in case of 'keep-source-keyframes', + // parse it only for static kf timings + } else if (!strcmp(forced_keyframes, "source")) { + ost->kf.type = KF_FORCE_SOURCE; + } else if (!strcmp(forced_keyframes, "source_no_drop")) { + ost->kf.type = KF_FORCE_SOURCE_NO_DROP; + } else { + parse_forced_key_frames(&ost->kf, mux, forced_keyframes); + } + } + + return 0; +} + +static void validate_enc_avopt(Muxer *mux, const AVDictionary *codec_avopt) +{ + const AVClass *class = avcodec_get_class(); + const AVClass *fclass = avformat_get_class(); + const OutputFile *of = &mux->of; + + AVDictionary *unused_opts; + const AVDictionaryEntry *e; + + unused_opts = strip_specifiers(codec_avopt); + for (int i = 0; i < of->nb_streams; i++) { + e = NULL; + while ((e = av_dict_iterate(of->streams[i]->encoder_opts, e))) + av_dict_set(&unused_opts, e->key, NULL, 0); + } + + e = NULL; + while ((e = av_dict_iterate(unused_opts, e))) { + const AVOption *option = av_opt_find(&class, e->key, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); + const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); + if (!option || foption) + continue; + + if (!(option->flags & AV_OPT_FLAG_ENCODING_PARAM)) { + av_log(mux, AV_LOG_ERROR, "Codec AVOption %s (%s) is not an " + "encoding option.\n", e->key, option->help ? option->help : ""); + exit_program(1); + } + + // gop_timecode is injected by generic code but not always used + if (!strcmp(e->key, "gop_timecode")) + continue; + + av_log(mux, AV_LOG_WARNING, "Codec AVOption %s (%s) has not been used " + "for any stream. The most likely reason is either wrong type " + "(e.g. a video option with no video streams) or that it is a " + "private option of some encoder which was not actually used for " + "any stream.\n", e->key, option->help ? option->help : ""); + } + av_dict_free(&unused_opts); +} + +static const char *output_file_item_name(void *obj) +{ + const Muxer *mux = obj; + + return mux->log_name; +} + +static const AVClass output_file_class = { + .class_name = "OutputFile", + .version = LIBAVUTIL_VERSION_INT, + .item_name = output_file_item_name, + .category = AV_CLASS_CATEGORY_MUXER, +}; + +static Muxer *mux_alloc(void) +{ + Muxer *mux = allocate_array_elem(&output_files, sizeof(*mux), &nb_output_files); + + mux->of.class = &output_file_class; + mux->of.index = nb_output_files - 1; + + snprintf(mux->log_name, sizeof(mux->log_name), "out#%d", mux->of.index); + + return mux; +} + +int of_open(const OptionsContext *o, const char *filename) +{ + Muxer *mux; + AVFormatContext *oc; + int err; + OutputFile *of; + + int64_t recording_time = o->recording_time; + int64_t stop_time = o->stop_time; + + mux = mux_alloc(); + of = &mux->of; + + if (stop_time != INT64_MAX && recording_time != INT64_MAX) { + stop_time = INT64_MAX; + av_log(mux, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n"); + } + + if (stop_time != INT64_MAX && recording_time == INT64_MAX) { + int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time; + if (stop_time <= start_time) { + av_log(mux, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n"); + exit_program(1); + } else { + recording_time = stop_time - start_time; + } + } + + of->recording_time = recording_time; + of->start_time = o->start_time; + of->shortest = o->shortest; + + mux->thread_queue_size = o->thread_queue_size > 0 ? o->thread_queue_size : 8; + mux->limit_filesize = o->limit_filesize; + av_dict_copy(&mux->opts, o->g->format_opts, 0); + + if (!strcmp(filename, "-")) + filename = "pipe:"; + + err = avformat_alloc_output_context2(&oc, NULL, o->format, filename); + if (!oc) { + print_error(filename, err); + exit_program(1); + } + mux->fc = oc; + + av_strlcat(mux->log_name, "/", sizeof(mux->log_name)); + av_strlcat(mux->log_name, oc->oformat->name, sizeof(mux->log_name)); + + if (strcmp(oc->oformat->name, "rtp")) + want_sdp = 0; + + of->format = oc->oformat; + if (recording_time != INT64_MAX) + oc->duration = recording_time; + + oc->interrupt_callback = int_cb; + + if (o->bitexact) { + oc->flags |= AVFMT_FLAG_BITEXACT; + of->bitexact = 1; + } else { + of->bitexact = check_opt_bitexact(oc, mux->opts, "fflags", + AVFMT_FLAG_BITEXACT); + } + + /* create all output streams for this file */ + create_streams(mux, o); + + /* check if all codec options have been used */ + validate_enc_avopt(mux, o->g->codec_opts); + + /* set the decoding_needed flags and create simple filtergraphs */ + for (int i = 0; i < of->nb_streams; i++) { + OutputStream *ost = of->streams[i]; + + if (ost->enc_ctx && ost->ist) { + InputStream *ist = ost->ist; + ist->decoding_needed |= DECODING_FOR_OST; + ist->processing_needed = 1; + + if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || + ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + err = init_simple_filtergraph(ist, ost); + if (err < 0) { + av_log(ost, AV_LOG_ERROR, + "Error initializing a simple filtergraph\n"); + exit_program(1); + } + } + } else if (ost->ist) { + ost->ist->processing_needed = 1; + } + + /* set the filter output constraints */ + if (ost->filter) { + const AVCodec *c = ost->enc_ctx->codec; + OutputFilter *f = ost->filter; + switch (ost->enc_ctx->codec_type) { + case AVMEDIA_TYPE_VIDEO: + f->frame_rate = ost->frame_rate; + f->width = ost->enc_ctx->width; + f->height = ost->enc_ctx->height; + if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { + f->format = ost->enc_ctx->pix_fmt; + } else { + f->formats = c->pix_fmts; + } + break; + case AVMEDIA_TYPE_AUDIO: + if (ost->enc_ctx->sample_fmt != AV_SAMPLE_FMT_NONE) { + f->format = ost->enc_ctx->sample_fmt; + } else { + f->formats = c->sample_fmts; + } + if (ost->enc_ctx->sample_rate) { + f->sample_rate = ost->enc_ctx->sample_rate; + } else { + f->sample_rates = c->supported_samplerates; + } + if (ost->enc_ctx->ch_layout.nb_channels) { + set_channel_layout(f, ost); + } else if (c->ch_layouts) { + f->ch_layouts = c->ch_layouts; + } + break; + } + } + } + + /* check filename in case of an image number is expected */ + if (oc->oformat->flags & AVFMT_NEEDNUMBER) { + if (!av_filename_number_test(oc->url)) { + print_error(oc->url, AVERROR(EINVAL)); + exit_program(1); + } + } + + if (!(oc->oformat->flags & AVFMT_NOFILE)) { + /* test if it already exists to avoid losing precious files */ + assert_file_overwrite(filename); + + /* open the file */ + if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE, + &oc->interrupt_callback, + &mux->opts)) < 0) { + print_error(filename, err); + exit_program(1); + } + } else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename)) + assert_file_overwrite(filename); + + if (o->mux_preload) { + av_dict_set_int(&mux->opts, "preload", o->mux_preload*AV_TIME_BASE, 0); + } + oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE); + + /* copy metadata and chapters from input files */ + copy_meta(mux, o); + + of_add_programs(mux, o); + of_add_metadata(of, oc, o); + + err = set_dispositions(mux, o); + if (err < 0) { + av_log(mux, AV_LOG_FATAL, "Error setting output stream dispositions\n"); + exit_program(1); + } + + // parse forced keyframe specifications; + // must be done after chapters are created + err = process_forced_keyframes(mux, o); + if (err < 0) { + av_log(mux, AV_LOG_FATAL, "Error processing forced keyframes\n"); + exit_program(1); + } + + err = setup_sync_queues(mux, oc, o->shortest_buf_duration * AV_TIME_BASE); + if (err < 0) { + av_log(mux, AV_LOG_FATAL, "Error setting up output sync queues\n"); + exit_program(1); + } + + of->url = filename; + + /* write the header for files with no streams */ + if (of->format->flags & AVFMT_NOSTREAMS && oc->nb_streams == 0) { + int ret = mux_check_init(mux); + if (ret < 0) + return ret; + } + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_opt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_opt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_opt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffmpeg_opt.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,9 +28,9 @@ #endif #include "ffmpeg.h" -#include "fopen_utf8.h" #include "cmdutils.h" #include "opt_common.h" +#include "sync_queue.h" #include "libavformat/avformat.h" @@ -44,7 +44,7 @@ #include "libavutil/avutil.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" -#include "libavutil/getenv_utf8.h" +#include "libavutil/display.h" #include "libavutil/intreadwrite.h" #include "libavutil/fifo.h" #include "libavutil/mathematics.h" @@ -53,99 +53,10 @@ #include "libavutil/pixdesc.h" #include "libavutil/pixfmt.h" -#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" - -#define SPECIFIER_OPT_FMT_str "%s" -#define SPECIFIER_OPT_FMT_i "%i" -#define SPECIFIER_OPT_FMT_i64 "%"PRId64 -#define SPECIFIER_OPT_FMT_ui64 "%"PRIu64 -#define SPECIFIER_OPT_FMT_f "%f" -#define SPECIFIER_OPT_FMT_dbl "%lf" - -static const char *const opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL}; -static const char *const opt_name_audio_channels[] = {"ac", NULL}; -static const char *const opt_name_audio_ch_layouts[] = {"channel_layout", "ch_layout", NULL}; -static const char *const opt_name_audio_sample_rate[] = {"ar", NULL}; -static const char *const opt_name_frame_rates[] = {"r", NULL}; -static const char *const opt_name_max_frame_rates[] = {"fpsmax", NULL}; -static const char *const opt_name_frame_sizes[] = {"s", NULL}; -static const char *const opt_name_frame_pix_fmts[] = {"pix_fmt", NULL}; -static const char *const opt_name_ts_scale[] = {"itsscale", NULL}; -static const char *const opt_name_hwaccels[] = {"hwaccel", NULL}; -static const char *const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL}; -static const char *const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL}; -static const char *const opt_name_autorotate[] = {"autorotate", NULL}; -static const char *const opt_name_autoscale[] = {"autoscale", NULL}; -static const char *const opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL}; -static const char *const opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL}; -static const char *const opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL}; -static const char *const opt_name_sample_fmts[] = {"sample_fmt", NULL}; -static const char *const opt_name_qscale[] = {"q", "qscale", NULL}; -static const char *const opt_name_forced_key_frames[] = {"forced_key_frames", NULL}; -static const char *const opt_name_fps_mode[] = {"fps_mode", NULL}; -static const char *const opt_name_force_fps[] = {"force_fps", NULL}; -static const char *const opt_name_frame_aspect_ratios[] = {"aspect", NULL}; -static const char *const opt_name_rc_overrides[] = {"rc_override", NULL}; -static const char *const opt_name_intra_matrices[] = {"intra_matrix", NULL}; -static const char *const opt_name_inter_matrices[] = {"inter_matrix", NULL}; -static const char *const opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL}; -static const char *const opt_name_top_field_first[] = {"top", NULL}; -static const char *const opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL}; -static const char *const opt_name_copy_initial_nonkeyframes[] = {"copyinkf", NULL}; -static const char *const opt_name_copy_prior_start[] = {"copypriorss", NULL}; -static const char *const opt_name_filters[] = {"filter", "af", "vf", NULL}; -static const char *const opt_name_filter_scripts[] = {"filter_script", NULL}; -static const char *const opt_name_reinit_filters[] = {"reinit_filter", NULL}; -static const char *const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL}; -static const char *const opt_name_canvas_sizes[] = {"canvas_size", NULL}; -static const char *const opt_name_pass[] = {"pass", NULL}; -static const char *const opt_name_passlogfiles[] = {"passlogfile", NULL}; -static const char *const opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL}; -static const char *const opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL}; -static const char *const opt_name_guess_layout_max[] = {"guess_layout_max", NULL}; -static const char *const opt_name_apad[] = {"apad", NULL}; -static const char *const opt_name_discard[] = {"discard", NULL}; -static const char *const opt_name_disposition[] = {"disposition", NULL}; -static const char *const opt_name_time_bases[] = {"time_base", NULL}; -static const char *const opt_name_enc_time_bases[] = {"enc_time_base", NULL}; -static const char *const opt_name_bits_per_raw_sample[] = {"bits_per_raw_sample", NULL}; - -#define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\ -{\ - char namestr[128] = "";\ - const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\ - for (i = 0; opt_name_##name[i]; i++)\ - av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\ - av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\ - namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\ -} - -#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ -{\ - int i, ret, matches = 0;\ - SpecifierOpt *so;\ - for (i = 0; i < o->nb_ ## name; i++) {\ - char *spec = o->name[i].specifier;\ - if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\ - outvar = o->name[i].u.type;\ - so = &o->name[i];\ - matches++;\ - } else if (ret < 0)\ - exit_program(1);\ - }\ - if (matches > 1)\ - WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\ -} - -#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\ -{\ - int i;\ - for (i = 0; i < o->nb_ ## name; i++) {\ - char *spec = o->name[i].specifier;\ - if (!strcmp(spec, mediatype))\ - outvar = o->name[i].u.type;\ - }\ -} +const char *const opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL}; +const char *const opt_name_frame_rates[] = {"r", NULL}; +const char *const opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL}; +const char *const opt_name_top_field_first[] = {"top", NULL}; HWDevice *filter_hw_device; @@ -156,8 +67,6 @@ float dts_delta_threshold = 10; float dts_error_threshold = 3600*30; -int audio_volume = 256; -int audio_sync_method = 0; enum VideoSyncMethod video_sync_method = VSYNC_AUTO; float frame_drop_threshold = 0; int do_benchmark = 0; @@ -183,12 +92,12 @@ static int file_overwrite = 0; static int no_file_overwrite = 0; -static int do_psnr = 0; -static int input_stream_potentially_available = 0; -static int ignore_unknown_streams = 0; -static int copy_unknown_streams = 0; -static int recast_media = 0; -static int find_stream_info = 1; +#if FFMPEG_OPT_PSNR +int do_psnr = 0; +#endif +int ignore_unknown_streams = 0; +int copy_unknown_streams = 0; +int recast_media = 0; static void uninit_options(OptionsContext *o) { @@ -217,7 +126,9 @@ for (i = 0; i < o->nb_stream_maps; i++) av_freep(&o->stream_maps[i].linklabel); av_freep(&o->stream_maps); +#if FFMPEG_OPT_MAP_CHANNEL av_freep(&o->audio_channel_maps); +#endif av_freep(&o->streamid_map); av_freep(&o->attachments); } @@ -231,11 +142,13 @@ o->start_time = AV_NOPTS_VALUE; o->start_time_eof = AV_NOPTS_VALUE; o->recording_time = INT64_MAX; - o->limit_filesize = UINT64_MAX; + o->limit_filesize = INT64_MAX; o->chapters_input_file = INT_MAX; o->accurate_seek = 1; o->thread_queue_size = -1; o->input_sync_ref = -1; + o->find_stream_info = 1; + o->shortest_buf_duration = 10.f; } static int show_hwaccels(void *optctx, const char *opt, const char *arg) @@ -251,12 +164,12 @@ } /* return a copy of the input with the stream specifiers removed from the keys */ -static AVDictionary *strip_specifiers(AVDictionary *dict) +AVDictionary *strip_specifiers(const AVDictionary *dict) { const AVDictionaryEntry *e = NULL; AVDictionary *ret = NULL; - while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) { + while ((e = av_dict_iterate(dict, e))) { char *p = strchr(e->key, ':'); if (p) @@ -268,7 +181,7 @@ return ret; } -static int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global) +int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global) { if (!av_strcasecmp(arg, "cfr")) *vsync_var = VSYNC_CFR; else if (!av_strcasecmp(arg, "vfr")) *vsync_var = VSYNC_VFR; @@ -288,6 +201,44 @@ return 0; } +/* Correct input file start times based on enabled streams */ +static void correct_input_start_times(void) +{ + for (int i = 0; i < nb_input_files; i++) { + InputFile *ifile = input_files[i]; + AVFormatContext *is = ifile->ctx; + int64_t new_start_time = INT64_MAX, diff, abs_start_seek; + + ifile->start_time_effective = is->start_time; + + if (is->start_time == AV_NOPTS_VALUE || + !(is->iformat->flags & AVFMT_TS_DISCONT)) + continue; + + for (int j = 0; j < is->nb_streams; j++) { + AVStream *st = is->streams[j]; + if(st->discard == AVDISCARD_ALL || st->start_time == AV_NOPTS_VALUE) + continue; + new_start_time = FFMIN(new_start_time, av_rescale_q(st->start_time, st->time_base, AV_TIME_BASE_Q)); + } + + diff = new_start_time - is->start_time; + if (diff) { + av_log(NULL, AV_LOG_VERBOSE, "Correcting start time of Input #%d by %"PRId64" us.\n", i, diff); + ifile->start_time_effective = new_start_time; + if (copy_ts && start_at_zero) + ifile->ts_offset = -new_start_time; + else if (!copy_ts) { + abs_start_seek = is->start_time + (ifile->start_time != AV_NOPTS_VALUE) ? ifile->start_time : 0; + ifile->ts_offset = abs_start_seek > new_start_time ? -abs_start_seek : -new_start_time; + } else if (copy_ts) + ifile->ts_offset = 0; + + ifile->ts_offset += ifile->input_ts_offset; + } + } +} + static int apply_sync_offsets(void) { for (int i = 0; i < nb_input_files; i++) { @@ -316,9 +267,9 @@ if (self->ctx->start_time_realtime != AV_NOPTS_VALUE && ref->ctx->start_time_realtime != AV_NOPTS_VALUE) { self_start_time = self->ctx->start_time_realtime; ref_start_time = ref->ctx->start_time_realtime; - } else if (self->ctx->start_time != AV_NOPTS_VALUE && ref->ctx->start_time != AV_NOPTS_VALUE) { - self_start_time = self->ctx->start_time; - ref_start_time = ref->ctx->start_time; + } else if (self->start_time_effective != AV_NOPTS_VALUE && ref->start_time_effective != AV_NOPTS_VALUE) { + self_start_time = self->start_time_effective; + ref_start_time = ref->start_time_effective; } else { start_times_set = 0; } @@ -410,9 +361,10 @@ OptionsContext *o = optctx; StreamMap *m = NULL; int i, negative = 0, file_idx, disabled = 0; - int sync_file_idx = -1, sync_stream_idx = 0; - char *p, *sync; - char *map; +#if FFMPEG_OPT_MAP_SYNC + char *sync; +#endif + char *map, *p; char *allow_unused; if (*arg == '-') { @@ -423,33 +375,13 @@ if (!map) return AVERROR(ENOMEM); +#if FFMPEG_OPT_MAP_SYNC /* parse sync stream first, just pick first matching stream */ if (sync = strchr(map, ',')) { *sync = 0; - sync_file_idx = strtol(sync + 1, &sync, 0); - if (sync_file_idx >= nb_input_files || sync_file_idx < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid sync file index: %d.\n", sync_file_idx); - exit_program(1); - } - if (*sync) - sync++; - for (i = 0; i < input_files[sync_file_idx]->nb_streams; i++) - if (check_stream_specifier(input_files[sync_file_idx]->ctx, - input_files[sync_file_idx]->ctx->streams[i], sync) == 1) { - sync_stream_idx = i; - break; - } - if (i == input_files[sync_file_idx]->nb_streams) { - av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s does not " - "match any streams.\n", arg); - exit_program(1); - } - if (input_streams[input_files[sync_file_idx]->ist_index + sync_stream_idx]->user_set_discard == AVDISCARD_ALL) { - av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s matches a disabled input " - "stream.\n", arg); - exit_program(1); - } + av_log(NULL, AV_LOG_WARNING, "Specifying a sync stream is deprecated and has no effect\n"); } +#endif if (map[0] == '[') { @@ -485,7 +417,7 @@ if (check_stream_specifier(input_files[file_idx]->ctx, input_files[file_idx]->ctx->streams[i], *p == ':' ? p + 1 : p) <= 0) continue; - if (input_streams[input_files[file_idx]->ist_index + i]->user_set_discard == AVDISCARD_ALL) { + if (input_files[file_idx]->streams[i]->user_set_discard == AVDISCARD_ALL) { disabled = 1; continue; } @@ -494,14 +426,6 @@ m->file_index = file_idx; m->stream_index = i; - - if (sync_file_idx >= 0) { - m->sync_file_index = sync_file_idx; - m->sync_stream_index = sync_stream_idx; - } else { - m->sync_file_index = file_idx; - m->sync_stream_index = i; - } } } @@ -531,6 +455,7 @@ return 0; } +#if FFMPEG_OPT_MAP_CHANNEL static int opt_map_channel(void *optctx, const char *opt, const char *arg) { OptionsContext *o = optctx; @@ -539,6 +464,12 @@ AudioChannelMap *m; char *allow_unused; char *mapchan; + + av_log(NULL, AV_LOG_WARNING, + "The -%s option is deprecated and will be removed. " + "It can be replaced by the 'pan' filter, or in some cases by " + "combinations of 'channelsplit', 'channelmap', 'amerge' filters.\n", opt); + mapchan = av_strdup(arg); if (!mapchan) return AVERROR(ENOMEM); @@ -592,7 +523,7 @@ if (allow_unused = strchr(mapchan, '?')) *allow_unused = 0; if (m->channel_idx < 0 || m->channel_idx >= st->codecpar->ch_layout.nb_channels || - input_streams[input_files[m->file_idx]->ist_index + m->stream_idx]->user_set_discard == AVDISCARD_ALL) { + input_files[m->file_idx]->streams[m->stream_idx]->user_set_discard == AVDISCARD_ALL) { if (allow_unused) { av_log(NULL, AV_LOG_VERBOSE, "mapchan: invalid audio channel #%d.%d.%d\n", m->file_idx, m->stream_idx, m->channel_idx); @@ -607,6 +538,7 @@ av_free(mapchan); return 0; } +#endif static int opt_sdp_file(void *optctx, const char *opt, const char *arg) { @@ -666,2383 +598,162 @@ { if (filter_hw_device) { av_log(NULL, AV_LOG_ERROR, "Only one filter device can be used.\n"); - return AVERROR(EINVAL); - } - filter_hw_device = hw_device_get_by_name(arg); - if (!filter_hw_device) { - av_log(NULL, AV_LOG_ERROR, "Invalid filter device %s.\n", arg); - return AVERROR(EINVAL); - } - return 0; -} - -/** - * Parse a metadata specifier passed as 'arg' parameter. - * @param arg metadata string to parse - * @param type metadata type is written here -- g(lobal)/s(tream)/c(hapter)/p(rogram) - * @param index for type c/p, chapter/program index is written here - * @param stream_spec for type s, the stream specifier is written here - */ -static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) -{ - if (*arg) { - *type = *arg; - switch (*arg) { - case 'g': - break; - case 's': - if (*(++arg) && *arg != ':') { - av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", arg); - exit_program(1); - } - *stream_spec = *arg == ':' ? arg + 1 : ""; - break; - case 'c': - case 'p': - if (*(++arg) == ':') - *index = strtol(++arg, NULL, 0); - break; - default: - av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); - exit_program(1); - } - } else - *type = 'g'; -} - -static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) -{ - AVDictionary **meta_in = NULL; - AVDictionary **meta_out = NULL; - int i, ret = 0; - char type_in, type_out; - const char *istream_spec = NULL, *ostream_spec = NULL; - int idx_in = 0, idx_out = 0; - - parse_meta_type(inspec, &type_in, &idx_in, &istream_spec); - parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); - - if (!ic) { - if (type_out == 'g' || !*outspec) - o->metadata_global_manual = 1; - if (type_out == 's' || !*outspec) - o->metadata_streams_manual = 1; - if (type_out == 'c' || !*outspec) - o->metadata_chapters_manual = 1; - return 0; - } - - if (type_in == 'g' || type_out == 'g') - o->metadata_global_manual = 1; - if (type_in == 's' || type_out == 's') - o->metadata_streams_manual = 1; - if (type_in == 'c' || type_out == 'c') - o->metadata_chapters_manual = 1; - - /* ic is NULL when just disabling automatic mappings */ - if (!ic) - return 0; - -#define METADATA_CHECK_INDEX(index, nb_elems, desc)\ - if ((index) < 0 || (index) >= (nb_elems)) {\ - av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ - (desc), (index));\ - exit_program(1);\ - } - -#define SET_DICT(type, meta, context, index)\ - switch (type) {\ - case 'g':\ - meta = &context->metadata;\ - break;\ - case 'c':\ - METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ - meta = &context->chapters[index]->metadata;\ - break;\ - case 'p':\ - METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ - meta = &context->programs[index]->metadata;\ - break;\ - case 's':\ - break; /* handled separately below */ \ - default: av_assert0(0);\ - }\ - - SET_DICT(type_in, meta_in, ic, idx_in); - SET_DICT(type_out, meta_out, oc, idx_out); - - /* for input streams choose first matching stream */ - if (type_in == 's') { - for (i = 0; i < ic->nb_streams; i++) { - if ((ret = check_stream_specifier(ic, ic->streams[i], istream_spec)) > 0) { - meta_in = &ic->streams[i]->metadata; - break; - } else if (ret < 0) - exit_program(1); - } - if (!meta_in) { - av_log(NULL, AV_LOG_FATAL, "Stream specifier %s does not match any streams.\n", istream_spec); - exit_program(1); - } - } - - if (type_out == 's') { - for (i = 0; i < oc->nb_streams; i++) { - if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) { - meta_out = &oc->streams[i]->metadata; - av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); - } else if (ret < 0) - exit_program(1); - } - } else - av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); - - return 0; -} - -static int opt_recording_timestamp(void *optctx, const char *opt, const char *arg) -{ - OptionsContext *o = optctx; - char buf[128]; - int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6; - struct tm time = *gmtime((time_t*)&recording_timestamp); - if (!strftime(buf, sizeof(buf), "creation_time=%Y-%m-%dT%H:%M:%S%z", &time)) - return -1; - parse_option(o, "metadata", buf, options); - - av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata " - "tag instead.\n", opt); - return 0; -} - -static const AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder) -{ - const AVCodecDescriptor *desc; - const char *codec_string = encoder ? "encoder" : "decoder"; - const AVCodec *codec; - - codec = encoder ? - avcodec_find_encoder_by_name(name) : - avcodec_find_decoder_by_name(name); - - if (!codec && (desc = avcodec_descriptor_get_by_name(name))) { - codec = encoder ? avcodec_find_encoder(desc->id) : - avcodec_find_decoder(desc->id); - if (codec) - av_log(NULL, AV_LOG_VERBOSE, "Matched %s '%s' for codec '%s'.\n", - codec_string, codec->name, desc->name); - } - - if (!codec) { - av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name); - exit_program(1); - } - if (codec->type != type && !recast_media) { - av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name); - exit_program(1); - } - return codec; -} - -static const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st) -{ - char *codec_name = NULL; - - MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, st); - if (codec_name) { - const AVCodec *codec = find_codec_or_die(codec_name, st->codecpar->codec_type, 0); - st->codecpar->codec_id = codec->id; - if (recast_media && st->codecpar->codec_type != codec->type) - st->codecpar->codec_type = codec->type; - return codec; - } else - return avcodec_find_decoder(st->codecpar->codec_id); -} - -/* Add all the streams from the given input file to the global - * list of input streams. */ -static void add_input_streams(OptionsContext *o, AVFormatContext *ic) -{ - int i, ret; - - for (i = 0; i < ic->nb_streams; i++) { - AVStream *st = ic->streams[i]; - AVCodecParameters *par = st->codecpar; - InputStream *ist; - char *framerate = NULL, *hwaccel_device = NULL; - const char *hwaccel = NULL; - char *hwaccel_output_format = NULL; - char *codec_tag = NULL; - char *next; - char *discard_str = NULL; - const AVClass *cc = avcodec_get_class(); - const AVOption *discard_opt = av_opt_find(&cc, "skip_frame", NULL, - 0, AV_OPT_SEARCH_FAKE_OBJ); - - ist = ALLOC_ARRAY_ELEM(input_streams, nb_input_streams); - ist->st = st; - ist->file_index = nb_input_files; - ist->discard = 1; - st->discard = AVDISCARD_ALL; - ist->nb_samples = 0; - ist->first_dts = AV_NOPTS_VALUE; - ist->min_pts = INT64_MAX; - ist->max_pts = INT64_MIN; - - ist->ts_scale = 1.0; - MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st); - - ist->autorotate = 1; - MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st); - - MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st); - if (codec_tag) { - uint32_t tag = strtol(codec_tag, &next, 0); - if (*next) - tag = AV_RL32(codec_tag); - st->codecpar->codec_tag = tag; - } - - ist->dec = choose_decoder(o, ic, st); - ist->decoder_opts = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id, ic, st, ist->dec); - - ist->reinit_filters = -1; - MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st); - - MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st); - ist->user_set_discard = AVDISCARD_NONE; - - if ((o->video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) || - (o->audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) || - (o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) || - (o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA)) - ist->user_set_discard = AVDISCARD_ALL; - - if (discard_str && av_opt_eval_int(&cc, discard_opt, discard_str, &ist->user_set_discard) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error parsing discard %s.\n", - discard_str); - exit_program(1); - } - - ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE; - ist->prev_pkt_pts = AV_NOPTS_VALUE; - - ist->dec_ctx = avcodec_alloc_context3(ist->dec); - if (!ist->dec_ctx) { - av_log(NULL, AV_LOG_ERROR, "Error allocating the decoder context.\n"); - exit_program(1); - } - - ret = avcodec_parameters_to_context(ist->dec_ctx, par); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error initializing the decoder context.\n"); - exit_program(1); - } - - ist->decoded_frame = av_frame_alloc(); - if (!ist->decoded_frame) - exit_program(1); - - ist->pkt = av_packet_alloc(); - if (!ist->pkt) - exit_program(1); - - if (o->bitexact) - ist->dec_ctx->flags |= AV_CODEC_FLAG_BITEXACT; - - switch (par->codec_type) { - case AVMEDIA_TYPE_VIDEO: - if(!ist->dec) - ist->dec = avcodec_find_decoder(par->codec_id); - - // avformat_find_stream_info() doesn't set this for us anymore. - ist->dec_ctx->framerate = st->avg_frame_rate; - - MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st); - if (framerate && av_parse_video_rate(&ist->framerate, - framerate) < 0) { - av_log(NULL, AV_LOG_ERROR, "Error parsing framerate %s.\n", - framerate); - exit_program(1); - } - - ist->top_field_first = -1; - MATCH_PER_STREAM_OPT(top_field_first, i, ist->top_field_first, ic, st); - - MATCH_PER_STREAM_OPT(hwaccels, str, hwaccel, ic, st); - MATCH_PER_STREAM_OPT(hwaccel_output_formats, str, - hwaccel_output_format, ic, st); - - if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "cuvid")) { - av_log(NULL, AV_LOG_WARNING, - "WARNING: defaulting hwaccel_output_format to cuda for compatibility " - "with old commandlines. This behaviour is DEPRECATED and will be removed " - "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n"); - ist->hwaccel_output_format = AV_PIX_FMT_CUDA; - } else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel, "qsv")) { - av_log(NULL, AV_LOG_WARNING, - "WARNING: defaulting hwaccel_output_format to qsv for compatibility " - "with old commandlines. This behaviour is DEPRECATED and will be removed " - "in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n"); - ist->hwaccel_output_format = AV_PIX_FMT_QSV; - } else if (hwaccel_output_format) { - ist->hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format); - if (ist->hwaccel_output_format == AV_PIX_FMT_NONE) { - av_log(NULL, AV_LOG_FATAL, "Unrecognised hwaccel output " - "format: %s", hwaccel_output_format); - } - } else { - ist->hwaccel_output_format = AV_PIX_FMT_NONE; - } - - if (hwaccel) { - // The NVDEC hwaccels use a CUDA device, so remap the name here. - if (!strcmp(hwaccel, "nvdec") || !strcmp(hwaccel, "cuvid")) - hwaccel = "cuda"; - - if (!strcmp(hwaccel, "none")) - ist->hwaccel_id = HWACCEL_NONE; - else if (!strcmp(hwaccel, "auto")) - ist->hwaccel_id = HWACCEL_AUTO; - else { - enum AVHWDeviceType type = av_hwdevice_find_type_by_name(hwaccel); - if (type != AV_HWDEVICE_TYPE_NONE) { - ist->hwaccel_id = HWACCEL_GENERIC; - ist->hwaccel_device_type = type; - } - - if (!ist->hwaccel_id) { - av_log(NULL, AV_LOG_FATAL, "Unrecognized hwaccel: %s.\n", - hwaccel); - av_log(NULL, AV_LOG_FATAL, "Supported hwaccels: "); - type = AV_HWDEVICE_TYPE_NONE; - while ((type = av_hwdevice_iterate_types(type)) != - AV_HWDEVICE_TYPE_NONE) - av_log(NULL, AV_LOG_FATAL, "%s ", - av_hwdevice_get_type_name(type)); - av_log(NULL, AV_LOG_FATAL, "\n"); - exit_program(1); - } - } - } - - MATCH_PER_STREAM_OPT(hwaccel_devices, str, hwaccel_device, ic, st); - if (hwaccel_device) { - ist->hwaccel_device = av_strdup(hwaccel_device); - if (!ist->hwaccel_device) - exit_program(1); - } - - ist->hwaccel_pix_fmt = AV_PIX_FMT_NONE; - - break; - case AVMEDIA_TYPE_AUDIO: - ist->guess_layout_max = INT_MAX; - MATCH_PER_STREAM_OPT(guess_layout_max, i, ist->guess_layout_max, ic, st); - guess_input_channel_layout(ist); - break; - case AVMEDIA_TYPE_DATA: - case AVMEDIA_TYPE_SUBTITLE: { - char *canvas_size = NULL; - if(!ist->dec) - ist->dec = avcodec_find_decoder(par->codec_id); - MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st); - MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st); - if (canvas_size && - av_parse_video_size(&ist->dec_ctx->width, &ist->dec_ctx->height, canvas_size) < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size); - exit_program(1); - } - break; - } - case AVMEDIA_TYPE_ATTACHMENT: - case AVMEDIA_TYPE_UNKNOWN: - break; - default: - abort(); - } - - ret = avcodec_parameters_from_context(par, ist->dec_ctx); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error initializing the decoder context.\n"); - exit_program(1); - } - } -} - -static void assert_file_overwrite(const char *filename) -{ - const char *proto_name = avio_find_protocol_name(filename); - - if (file_overwrite && no_file_overwrite) { - fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n"); - exit_program(1); - } - - if (!file_overwrite) { - if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) { - if (stdin_interaction && !no_file_overwrite) { - fprintf(stderr,"File '%s' already exists. Overwrite? [y/N] ", filename); - fflush(stderr); - term_exit(); - signal(SIGINT, SIG_DFL); - if (!read_yesno()) { - av_log(NULL, AV_LOG_FATAL, "Not overwriting - exiting\n"); - exit_program(1); - } - term_init(); - } - else { - av_log(NULL, AV_LOG_FATAL, "File '%s' already exists. Exiting.\n", filename); - exit_program(1); - } - } - } - - if (proto_name && !strcmp(proto_name, "file")) { - for (int i = 0; i < nb_input_files; i++) { - InputFile *file = input_files[i]; - if (file->ctx->iformat->flags & AVFMT_NOFILE) - continue; - if (!strcmp(filename, file->ctx->url)) { - av_log(NULL, AV_LOG_FATAL, "Output %s same as Input #%d - exiting\n", filename, i); - av_log(NULL, AV_LOG_WARNING, "FFmpeg cannot edit existing files in-place.\n"); - exit_program(1); - } - } - } -} - -static void dump_attachment(AVStream *st, const char *filename) -{ - int ret; - AVIOContext *out = NULL; - const AVDictionaryEntry *e; - - if (!st->codecpar->extradata_size) { - av_log(NULL, AV_LOG_WARNING, "No extradata to dump in stream #%d:%d.\n", - nb_input_files - 1, st->index); - return; - } - if (!*filename && (e = av_dict_get(st->metadata, "filename", NULL, 0))) - filename = e->value; - if (!*filename) { - av_log(NULL, AV_LOG_FATAL, "No filename specified and no 'filename' tag" - "in stream #%d:%d.\n", nb_input_files - 1, st->index); - exit_program(1); - } - - assert_file_overwrite(filename); - - if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, &int_cb, NULL)) < 0) { - av_log(NULL, AV_LOG_FATAL, "Could not open file %s for writing.\n", - filename); - exit_program(1); - } - - avio_write(out, st->codecpar->extradata, st->codecpar->extradata_size); - avio_flush(out); - avio_close(out); -} - -static int open_input_file(OptionsContext *o, const char *filename) -{ - InputFile *f; - AVFormatContext *ic; - const AVInputFormat *file_iformat = NULL; - int err, i, ret; - int64_t timestamp; - AVDictionary *unused_opts = NULL; - const AVDictionaryEntry *e = NULL; - char * video_codec_name = NULL; - char * audio_codec_name = NULL; - char *subtitle_codec_name = NULL; - char * data_codec_name = NULL; - int scan_all_pmts_set = 0; - - if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) { - o->stop_time = INT64_MAX; - av_log(NULL, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n"); - } - - if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) { - int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time; - if (o->stop_time <= start_time) { - av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n"); - exit_program(1); - } else { - o->recording_time = o->stop_time - start_time; - } - } - - if (o->format) { - if (!(file_iformat = av_find_input_format(o->format))) { - av_log(NULL, AV_LOG_FATAL, "Unknown input format: '%s'\n", o->format); - exit_program(1); - } - } - - if (!strcmp(filename, "-")) - filename = "pipe:"; - - stdin_interaction &= strncmp(filename, "pipe:", 5) && - strcmp(filename, "/dev/stdin"); - - /* get default parameters from command line */ - ic = avformat_alloc_context(); - if (!ic) { - print_error(filename, AVERROR(ENOMEM)); - exit_program(1); - } - if (o->nb_audio_sample_rate) { - av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0); - } - if (o->nb_audio_channels) { - const AVClass *priv_class; - if (file_iformat && (priv_class = file_iformat->priv_class) && - av_opt_find(&priv_class, "ch_layout", NULL, 0, - AV_OPT_SEARCH_FAKE_OBJ)) { - char buf[32]; - snprintf(buf, sizeof(buf), "%dC", o->audio_channels[o->nb_audio_channels - 1].u.i); - av_dict_set(&o->g->format_opts, "ch_layout", buf, 0); - } - } - if (o->nb_audio_ch_layouts) { - const AVClass *priv_class; - if (file_iformat && (priv_class = file_iformat->priv_class) && - av_opt_find(&priv_class, "ch_layout", NULL, 0, - AV_OPT_SEARCH_FAKE_OBJ)) { - av_dict_set(&o->g->format_opts, "ch_layout", o->audio_ch_layouts[o->nb_audio_ch_layouts - 1].u.str, 0); - } - } - if (o->nb_frame_rates) { - const AVClass *priv_class; - /* set the format-level framerate option; - * this is important for video grabbers, e.g. x11 */ - if (file_iformat && (priv_class = file_iformat->priv_class) && - av_opt_find(&priv_class, "framerate", NULL, 0, - AV_OPT_SEARCH_FAKE_OBJ)) { - av_dict_set(&o->g->format_opts, "framerate", - o->frame_rates[o->nb_frame_rates - 1].u.str, 0); - } - } - if (o->nb_frame_sizes) { - av_dict_set(&o->g->format_opts, "video_size", o->frame_sizes[o->nb_frame_sizes - 1].u.str, 0); - } - if (o->nb_frame_pix_fmts) - av_dict_set(&o->g->format_opts, "pixel_format", o->frame_pix_fmts[o->nb_frame_pix_fmts - 1].u.str, 0); - - MATCH_PER_TYPE_OPT(codec_names, str, video_codec_name, ic, "v"); - MATCH_PER_TYPE_OPT(codec_names, str, audio_codec_name, ic, "a"); - MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, ic, "s"); - MATCH_PER_TYPE_OPT(codec_names, str, data_codec_name, ic, "d"); - - if (video_codec_name) - ic->video_codec = find_codec_or_die(video_codec_name , AVMEDIA_TYPE_VIDEO , 0); - if (audio_codec_name) - ic->audio_codec = find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0); - if (subtitle_codec_name) - ic->subtitle_codec = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0); - if (data_codec_name) - ic->data_codec = find_codec_or_die(data_codec_name , AVMEDIA_TYPE_DATA , 0); - - ic->video_codec_id = video_codec_name ? ic->video_codec->id : AV_CODEC_ID_NONE; - ic->audio_codec_id = audio_codec_name ? ic->audio_codec->id : AV_CODEC_ID_NONE; - ic->subtitle_codec_id = subtitle_codec_name ? ic->subtitle_codec->id : AV_CODEC_ID_NONE; - ic->data_codec_id = data_codec_name ? ic->data_codec->id : AV_CODEC_ID_NONE; - - ic->flags |= AVFMT_FLAG_NONBLOCK; - if (o->bitexact) - ic->flags |= AVFMT_FLAG_BITEXACT; - ic->interrupt_callback = int_cb; - - if (!av_dict_get(o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { - av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); - scan_all_pmts_set = 1; - } - /* open the input file with generic avformat function */ - err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts); - if (err < 0) { - print_error(filename, err); - if (err == AVERROR_PROTOCOL_NOT_FOUND) - av_log(NULL, AV_LOG_ERROR, "Did you mean file:%s?\n", filename); - exit_program(1); - } - if (scan_all_pmts_set) - av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); - remove_avoptions(&o->g->format_opts, o->g->codec_opts); - assert_avoptions(o->g->format_opts); - - /* apply forced codec ids */ - for (i = 0; i < ic->nb_streams; i++) - choose_decoder(o, ic, ic->streams[i]); - - if (find_stream_info) { - AVDictionary **opts = setup_find_stream_info_opts(ic, o->g->codec_opts); - int orig_nb_streams = ic->nb_streams; - - /* If not enough info to get the stream parameters, we decode the - first frames to get it. (used in mpeg case for example) */ - ret = avformat_find_stream_info(ic, opts); - - for (i = 0; i < orig_nb_streams; i++) - av_dict_free(&opts[i]); - av_freep(&opts); - - if (ret < 0) { - av_log(NULL, AV_LOG_FATAL, "%s: could not find codec parameters\n", filename); - if (ic->nb_streams == 0) { - avformat_close_input(&ic); - exit_program(1); - } - } - } - - if (o->start_time != AV_NOPTS_VALUE && o->start_time_eof != AV_NOPTS_VALUE) { - av_log(NULL, AV_LOG_WARNING, "Cannot use -ss and -sseof both, using -ss for %s\n", filename); - o->start_time_eof = AV_NOPTS_VALUE; - } - - if (o->start_time_eof != AV_NOPTS_VALUE) { - if (o->start_time_eof >= 0) { - av_log(NULL, AV_LOG_ERROR, "-sseof value must be negative; aborting\n"); - exit_program(1); - } - if (ic->duration > 0) { - o->start_time = o->start_time_eof + ic->duration; - if (o->start_time < 0) { - av_log(NULL, AV_LOG_WARNING, "-sseof value seeks to before start of file %s; ignored\n", filename); - o->start_time = AV_NOPTS_VALUE; - } - } else - av_log(NULL, AV_LOG_WARNING, "Cannot use -sseof, duration of %s not known\n", filename); - } - timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time; - /* add the stream start time */ - if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE) - timestamp += ic->start_time; - - /* if seeking requested, we execute it */ - if (o->start_time != AV_NOPTS_VALUE) { - int64_t seek_timestamp = timestamp; - - if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) { - int dts_heuristic = 0; - for (i=0; inb_streams; i++) { - const AVCodecParameters *par = ic->streams[i]->codecpar; - if (par->video_delay) { - dts_heuristic = 1; - break; - } - } - if (dts_heuristic) { - seek_timestamp -= 3*AV_TIME_BASE / 23; - } - } - ret = avformat_seek_file(ic, -1, INT64_MIN, seek_timestamp, seek_timestamp, 0); - if (ret < 0) { - av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n", - filename, (double)timestamp / AV_TIME_BASE); - } - } - - /* update the current parameters so that they match the one of the input stream */ - add_input_streams(o, ic); - - /* dump the file content */ - av_dump_format(ic, nb_input_files, filename, 0); - - f = ALLOC_ARRAY_ELEM(input_files, nb_input_files); - - f->ctx = ic; - f->ist_index = nb_input_streams - ic->nb_streams; - f->start_time = o->start_time; - f->recording_time = o->recording_time; - f->input_sync_ref = o->input_sync_ref; - f->input_ts_offset = o->input_ts_offset; - f->ts_offset = o->input_ts_offset - (copy_ts ? (start_at_zero && ic->start_time != AV_NOPTS_VALUE ? ic->start_time : 0) : timestamp); - f->nb_streams = ic->nb_streams; - f->rate_emu = o->rate_emu; - f->accurate_seek = o->accurate_seek; - f->loop = o->loop; - f->duration = 0; - f->time_base = (AVRational){ 1, 1 }; - - f->readrate = o->readrate ? o->readrate : 0.0; - if (f->readrate < 0.0f) { - av_log(NULL, AV_LOG_ERROR, "Option -readrate for Input #%d is %0.3f; it must be non-negative.\n", nb_input_files, f->readrate); - exit_program(1); - } - if (f->readrate && f->rate_emu) { - av_log(NULL, AV_LOG_WARNING, "Both -readrate and -re set for Input #%d. Using -readrate %0.3f.\n", nb_input_files, f->readrate); - f->rate_emu = 0; - } - - f->pkt = av_packet_alloc(); - if (!f->pkt) - exit_program(1); -#if HAVE_THREADS - f->thread_queue_size = o->thread_queue_size; -#endif - - /* check if all codec options have been used */ - unused_opts = strip_specifiers(o->g->codec_opts); - for (i = f->ist_index; i < nb_input_streams; i++) { - e = NULL; - while ((e = av_dict_get(input_streams[i]->decoder_opts, "", e, - AV_DICT_IGNORE_SUFFIX))) - av_dict_set(&unused_opts, e->key, NULL, 0); - } - - e = NULL; - while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) { - const AVClass *class = avcodec_get_class(); - const AVOption *option = av_opt_find(&class, e->key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - const AVClass *fclass = avformat_get_class(); - const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - if (!option || foption) - continue; - - - if (!(option->flags & AV_OPT_FLAG_DECODING_PARAM)) { - av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for " - "input file #%d (%s) is not a decoding option.\n", e->key, - option->help ? option->help : "", nb_input_files - 1, - filename); - exit_program(1); - } - - av_log(NULL, AV_LOG_WARNING, "Codec AVOption %s (%s) specified for " - "input file #%d (%s) has not been used for any stream. The most " - "likely reason is either wrong type (e.g. a video option with " - "no video streams) or that it is a private option of some decoder " - "which was not actually used for any stream.\n", e->key, - option->help ? option->help : "", nb_input_files - 1, filename); - } - av_dict_free(&unused_opts); - - for (i = 0; i < o->nb_dump_attachment; i++) { - int j; - - for (j = 0; j < ic->nb_streams; j++) { - AVStream *st = ic->streams[j]; - - if (check_stream_specifier(ic, st, o->dump_attachment[i].specifier) == 1) - dump_attachment(st, o->dump_attachment[i].u.str); - } - } - - input_stream_potentially_available = 1; - - return 0; -} - -static char *get_line(AVIOContext *s, AVBPrint *bprint) -{ - char c; - - while ((c = avio_r8(s)) && c != '\n') - av_bprint_chars(bprint, c, 1); - - if (!av_bprint_is_complete(bprint)) { - av_log(NULL, AV_LOG_FATAL, "Could not alloc buffer for reading preset.\n"); - exit_program(1); - } - return bprint->str; -} - -static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s) -{ - int i, ret = -1; - char filename[1000]; - char *env_avconv_datadir = getenv_utf8("AVCONV_DATADIR"); - char *env_home = getenv_utf8("HOME"); - const char *base[3] = { env_avconv_datadir, - env_home, - AVCONV_DATADIR, - }; - - for (i = 0; i < FF_ARRAY_ELEMS(base) && ret < 0; i++) { - if (!base[i]) - continue; - if (codec_name) { - snprintf(filename, sizeof(filename), "%s%s/%s-%s.avpreset", base[i], - i != 1 ? "" : "/.avconv", codec_name, preset_name); - ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL); - } - if (ret < 0) { - snprintf(filename, sizeof(filename), "%s%s/%s.avpreset", base[i], - i != 1 ? "" : "/.avconv", preset_name); - ret = avio_open2(s, filename, AVIO_FLAG_READ, &int_cb, NULL); - } - } - freeenv_utf8(env_home); - freeenv_utf8(env_avconv_datadir); - return ret; -} - -static int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost) -{ - enum AVMediaType type = ost->st->codecpar->codec_type; - char *codec_name = NULL; - - if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO || type == AVMEDIA_TYPE_SUBTITLE) { - MATCH_PER_STREAM_OPT(codec_names, str, codec_name, s, ost->st); - if (!codec_name) { - ost->st->codecpar->codec_id = av_guess_codec(s->oformat, NULL, s->url, - NULL, ost->st->codecpar->codec_type); - ost->enc = avcodec_find_encoder(ost->st->codecpar->codec_id); - if (!ost->enc) { - av_log(NULL, AV_LOG_FATAL, "Automatic encoder selection failed for " - "output stream #%d:%d. Default encoder for format %s (codec %s) is " - "probably disabled. Please choose an encoder manually.\n", - ost->file_index, ost->index, s->oformat->name, - avcodec_get_name(ost->st->codecpar->codec_id)); - return AVERROR_ENCODER_NOT_FOUND; - } - } else if (!strcmp(codec_name, "copy")) - ost->stream_copy = 1; - else { - ost->enc = find_codec_or_die(codec_name, ost->st->codecpar->codec_type, 1); - ost->st->codecpar->codec_id = ost->enc->id; - } - ost->encoding_needed = !ost->stream_copy; - } else { - /* no encoding supported for other media types */ - ost->stream_copy = 1; - ost->encoding_needed = 0; - } - - return 0; -} - -static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index) -{ - OutputStream *ost; - AVStream *st = avformat_new_stream(oc, NULL); - int idx = oc->nb_streams - 1, ret = 0; - const char *bsfs = NULL, *time_base = NULL; - char *next, *codec_tag = NULL; - double qscale = -1; - int i; - - if (!st) { - av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); - exit_program(1); - } - - if (oc->nb_streams - 1 < o->nb_streamid_map) - st->id = o->streamid_map[oc->nb_streams - 1]; - - ost = ALLOC_ARRAY_ELEM(output_streams, nb_output_streams); - - ost->file_index = nb_output_files - 1; - ost->index = idx; - ost->st = st; - ost->forced_kf_ref_pts = AV_NOPTS_VALUE; - st->codecpar->codec_type = type; - - ret = choose_encoder(o, oc, ost); - if (ret < 0) { - av_log(NULL, AV_LOG_FATAL, "Error selecting an encoder for stream " - "%d:%d\n", ost->file_index, ost->index); - exit_program(1); - } - - ost->enc_ctx = avcodec_alloc_context3(ost->enc); - if (!ost->enc_ctx) { - av_log(NULL, AV_LOG_ERROR, "Error allocating the encoding context.\n"); - exit_program(1); - } - ost->enc_ctx->codec_type = type; - - ost->ref_par = avcodec_parameters_alloc(); - if (!ost->ref_par) { - av_log(NULL, AV_LOG_ERROR, "Error allocating the encoding parameters.\n"); - exit_program(1); - } - - ost->filtered_frame = av_frame_alloc(); - if (!ost->filtered_frame) - exit_program(1); - - ost->pkt = av_packet_alloc(); - if (!ost->pkt) - exit_program(1); - - if (ost->enc) { - AVIOContext *s = NULL; - char *buf = NULL, *arg = NULL, *preset = NULL; - - ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc); - - MATCH_PER_STREAM_OPT(presets, str, preset, oc, st); - ost->autoscale = 1; - MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st); - if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) { - AVBPrint bprint; - av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); - do { - av_bprint_clear(&bprint); - buf = get_line(s, &bprint); - if (!buf[0] || buf[0] == '#') - continue; - if (!(arg = strchr(buf, '='))) { - av_log(NULL, AV_LOG_FATAL, "Invalid line found in the preset file.\n"); - exit_program(1); - } - *arg++ = 0; - av_dict_set(&ost->encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE); - } while (!s->eof_reached); - av_bprint_finalize(&bprint, NULL); - avio_closep(&s); - } - if (ret) { - av_log(NULL, AV_LOG_FATAL, - "Preset %s specified for stream %d:%d, but could not be opened.\n", - preset, ost->file_index, ost->index); - exit_program(1); - } - } else { - ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL); - } - - - if (o->bitexact) - ost->enc_ctx->flags |= AV_CODEC_FLAG_BITEXACT; - - MATCH_PER_STREAM_OPT(time_bases, str, time_base, oc, st); - if (time_base) { - AVRational q; - if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || - q.num <= 0 || q.den <= 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid time base: %s\n", time_base); - exit_program(1); - } - st->time_base = q; - } - - MATCH_PER_STREAM_OPT(enc_time_bases, str, time_base, oc, st); - if (time_base) { - AVRational q; - if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || - q.den <= 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid time base: %s\n", time_base); - exit_program(1); - } - ost->enc_timebase = q; - } - - ost->max_frames = INT64_MAX; - MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st); - for (i = 0; inb_max_frames; i++) { - char *p = o->max_frames[i].specifier; - if (!*p && type != AVMEDIA_TYPE_VIDEO) { - av_log(NULL, AV_LOG_WARNING, "Applying unspecific -frames to non video streams, maybe you meant -vframes ?\n"); - break; - } - } - - ost->copy_prior_start = -1; - MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st); - - MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st); - if (bsfs && *bsfs) { - ret = av_bsf_list_parse_str(bsfs, &ost->bsf_ctx); - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error parsing bitstream filter sequence '%s': %s\n", bsfs, av_err2str(ret)); - exit_program(1); - } - } - - MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st); - if (codec_tag) { - uint32_t tag = strtol(codec_tag, &next, 0); - if (*next) - tag = AV_RL32(codec_tag); - ost->st->codecpar->codec_tag = - ost->enc_ctx->codec_tag = tag; - } - - MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st); - if (qscale >= 0) { - ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE; - ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale; - } - - MATCH_PER_STREAM_OPT(disposition, str, ost->disposition, oc, st); - ost->disposition = av_strdup(ost->disposition); - - ost->max_muxing_queue_size = 128; - MATCH_PER_STREAM_OPT(max_muxing_queue_size, i, ost->max_muxing_queue_size, oc, st); - - ost->muxing_queue_data_size = 0; - - ost->muxing_queue_data_threshold = 50*1024*1024; - MATCH_PER_STREAM_OPT(muxing_queue_data_threshold, i, ost->muxing_queue_data_threshold, oc, st); - - MATCH_PER_STREAM_OPT(bits_per_raw_sample, i, ost->bits_per_raw_sample, - oc, st); - - if (oc->oformat->flags & AVFMT_GLOBALHEADER) - ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; - - av_dict_copy(&ost->sws_dict, o->g->sws_dict, 0); - - av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0); - if (ost->enc && av_get_exact_bits_per_sample(ost->enc->id) == 24) - av_dict_set(&ost->swr_opts, "output_sample_bits", "24", 0); - - ost->source_index = source_index; - if (source_index >= 0) { - ost->sync_ist = input_streams[source_index]; - input_streams[source_index]->discard = 0; - input_streams[source_index]->st->discard = input_streams[source_index]->user_set_discard; - } - ost->last_mux_dts = AV_NOPTS_VALUE; - - ost->muxing_queue = av_fifo_alloc2(8, sizeof(AVPacket*), 0); - if (!ost->muxing_queue) - exit_program(1); - - MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, - ost->copy_initial_nonkeyframes, oc, st); - - return ost; -} - -static void parse_matrix_coeffs(uint16_t *dest, const char *str) -{ - int i; - const char *p = str; - for (i = 0;; i++) { - dest[i] = atoi(p); - if (i == 63) - break; - p = strchr(p, ','); - if (!p) { - av_log(NULL, AV_LOG_FATAL, "Syntax error in matrix \"%s\" at coeff %d\n", str, i); - exit_program(1); - } - p++; - } -} - -/* read file contents into a string */ -static char *read_file(const char *filename) -{ - AVIOContext *pb = NULL; - int ret = avio_open(&pb, filename, AVIO_FLAG_READ); - AVBPrint bprint; - char *str; - - if (ret < 0) { - av_log(NULL, AV_LOG_ERROR, "Error opening file %s.\n", filename); - return NULL; - } - - av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); - ret = avio_read_to_bprint(pb, &bprint, SIZE_MAX); - avio_closep(&pb); - if (ret < 0) { - av_bprint_finalize(&bprint, NULL); - return NULL; - } - ret = av_bprint_finalize(&bprint, &str); - if (ret < 0) - return NULL; - return str; -} - -static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc, - OutputStream *ost) -{ - AVStream *st = ost->st; - - if (ost->filters_script && ost->filters) { - av_log(NULL, AV_LOG_ERROR, "Both -filter and -filter_script set for " - "output stream #%d:%d.\n", nb_output_files, st->index); - exit_program(1); - } - - if (ost->filters_script) - return read_file(ost->filters_script); - else if (ost->filters) - return av_strdup(ost->filters); - - return av_strdup(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ? - "null" : "anull"); -} - -static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc, - const OutputStream *ost, enum AVMediaType type) -{ - if (ost->filters_script || ost->filters) { - av_log(NULL, AV_LOG_ERROR, - "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n" - "Filtering and streamcopy cannot be used together.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script, - av_get_media_type_string(type), ost->file_index, ost->index); - exit_program(1); - } -} - -static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - AVStream *st; - OutputStream *ost; - AVCodecContext *video_enc; - char *frame_rate = NULL, *max_frame_rate = NULL, *frame_aspect_ratio = NULL; - - ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO, source_index); - st = ost->st; - video_enc = ost->enc_ctx; - - MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st); - if (frame_rate && av_parse_video_rate(&ost->frame_rate, frame_rate) < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate); - exit_program(1); - } - - MATCH_PER_STREAM_OPT(max_frame_rates, str, max_frame_rate, oc, st); - if (max_frame_rate && av_parse_video_rate(&ost->max_frame_rate, max_frame_rate) < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid maximum framerate value: %s\n", max_frame_rate); - exit_program(1); - } - - if (frame_rate && max_frame_rate) { - av_log(NULL, AV_LOG_ERROR, "Only one of -fpsmax and -r can be set for a stream.\n"); - exit_program(1); - } - - if ((frame_rate || max_frame_rate) && - video_sync_method == VSYNC_PASSTHROUGH) - av_log(NULL, AV_LOG_ERROR, "Using -vsync passthrough and -r/-fpsmax can produce invalid output files\n"); - - MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); - if (frame_aspect_ratio) { - AVRational q; - if (av_parse_ratio(&q, frame_aspect_ratio, 255, 0, NULL) < 0 || - q.num <= 0 || q.den <= 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid aspect ratio: %s\n", frame_aspect_ratio); - exit_program(1); - } - ost->frame_aspect_ratio = q; - } - - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); - - if (!ost->stream_copy) { - const char *p = NULL; - char *frame_size = NULL; - char *frame_pix_fmt = NULL; - char *intra_matrix = NULL, *inter_matrix = NULL; - char *chroma_intra_matrix = NULL; - int do_pass = 0; - int i; - - MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st); - if (frame_size && av_parse_video_size(&video_enc->width, &video_enc->height, frame_size) < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size); - exit_program(1); - } - - MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st); - if (frame_pix_fmt && *frame_pix_fmt == '+') { - ost->keep_pix_fmt = 1; - if (!*++frame_pix_fmt) - frame_pix_fmt = NULL; - } - if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) { - av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt); - exit_program(1); - } - st->sample_aspect_ratio = video_enc->sample_aspect_ratio; - - MATCH_PER_STREAM_OPT(intra_matrices, str, intra_matrix, oc, st); - if (intra_matrix) { - if (!(video_enc->intra_matrix = av_mallocz(sizeof(*video_enc->intra_matrix) * 64))) { - av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for intra matrix.\n"); - exit_program(1); - } - parse_matrix_coeffs(video_enc->intra_matrix, intra_matrix); - } - MATCH_PER_STREAM_OPT(chroma_intra_matrices, str, chroma_intra_matrix, oc, st); - if (chroma_intra_matrix) { - uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64); - if (!p) { - av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for intra matrix.\n"); - exit_program(1); - } - video_enc->chroma_intra_matrix = p; - parse_matrix_coeffs(p, chroma_intra_matrix); - } - MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st); - if (inter_matrix) { - if (!(video_enc->inter_matrix = av_mallocz(sizeof(*video_enc->inter_matrix) * 64))) { - av_log(NULL, AV_LOG_FATAL, "Could not allocate memory for inter matrix.\n"); - exit_program(1); - } - parse_matrix_coeffs(video_enc->inter_matrix, inter_matrix); - } - - MATCH_PER_STREAM_OPT(rc_overrides, str, p, oc, st); - for (i = 0; p; i++) { - int start, end, q; - int e = sscanf(p, "%d,%d,%d", &start, &end, &q); - if (e != 3) { - av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n"); - exit_program(1); - } - video_enc->rc_override = - av_realloc_array(video_enc->rc_override, - i + 1, sizeof(RcOverride)); - if (!video_enc->rc_override) { - av_log(NULL, AV_LOG_FATAL, "Could not (re)allocate memory for rc_override.\n"); - exit_program(1); - } - video_enc->rc_override[i].start_frame = start; - video_enc->rc_override[i].end_frame = end; - if (q > 0) { - video_enc->rc_override[i].qscale = q; - video_enc->rc_override[i].quality_factor = 1.0; - } - else { - video_enc->rc_override[i].qscale = 0; - video_enc->rc_override[i].quality_factor = -q/100.0; - } - p = strchr(p, '/'); - if (p) p++; - } - video_enc->rc_override_count = i; - - if (do_psnr) - video_enc->flags|= AV_CODEC_FLAG_PSNR; - - /* two pass mode */ - MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st); - if (do_pass) { - if (do_pass & 1) { - video_enc->flags |= AV_CODEC_FLAG_PASS1; - av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND); - } - if (do_pass & 2) { - video_enc->flags |= AV_CODEC_FLAG_PASS2; - av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND); - } - } - - MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st); - if (ost->logfile_prefix && - !(ost->logfile_prefix = av_strdup(ost->logfile_prefix))) - exit_program(1); - - if (do_pass) { - char logfilename[1024]; - FILE *f; - - snprintf(logfilename, sizeof(logfilename), "%s-%d.log", - ost->logfile_prefix ? ost->logfile_prefix : - DEFAULT_PASS_LOGFILENAME_PREFIX, - nb_output_streams - 1); - if (!strcmp(ost->enc->name, "libx264")) { - av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE); - } else { - if (video_enc->flags & AV_CODEC_FLAG_PASS2) { - char *logbuffer = read_file(logfilename); - - if (!logbuffer) { - av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n", - logfilename); - exit_program(1); - } - video_enc->stats_in = logbuffer; - } - if (video_enc->flags & AV_CODEC_FLAG_PASS1) { - f = fopen_utf8(logfilename, "wb"); - if (!f) { - av_log(NULL, AV_LOG_FATAL, - "Cannot write log file '%s' for pass-1 encoding: %s\n", - logfilename, strerror(errno)); - exit_program(1); - } - ost->logfile = f; - } - } - } - - MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st); - if (ost->forced_keyframes) - ost->forced_keyframes = av_strdup(ost->forced_keyframes); - - MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st); - - ost->top_field_first = -1; - MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st); - - ost->vsync_method = video_sync_method; - MATCH_PER_STREAM_OPT(fps_mode, str, ost->fps_mode, oc, st); - if (ost->fps_mode) - parse_and_set_vsync(ost->fps_mode, &ost->vsync_method, ost->file_index, ost->index, 0); - - if (ost->vsync_method == VSYNC_AUTO) { - if (!strcmp(oc->oformat->name, "avi")) { - ost->vsync_method = VSYNC_VFR; - } else { - ost->vsync_method = (oc->oformat->flags & AVFMT_VARIABLE_FPS) ? - ((oc->oformat->flags & AVFMT_NOTIMESTAMPS) ? - VSYNC_PASSTHROUGH : VSYNC_VFR) : - VSYNC_CFR; - } - - if (ost->source_index >= 0 && ost->vsync_method == VSYNC_CFR) { - const InputStream *ist = input_streams[ost->source_index]; - const InputFile *ifile = input_files[ist->file_index]; - - if (ifile->nb_streams == 1 && ifile->input_ts_offset == 0) - ost->vsync_method = VSYNC_VSCFR; - } - - if (ost->vsync_method == VSYNC_CFR && copy_ts) { - ost->vsync_method = VSYNC_VSCFR; - } - } - ost->is_cfr = (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR); - - ost->avfilter = get_ost_filters(o, oc, ost); - if (!ost->avfilter) - exit_program(1); - - ost->last_frame = av_frame_alloc(); - if (!ost->last_frame) - exit_program(1); - } - - if (ost->stream_copy) - check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_VIDEO); - - return ost; -} - -static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - int n; - AVStream *st; - OutputStream *ost; - AVCodecContext *audio_enc; - - ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO, source_index); - st = ost->st; - - audio_enc = ost->enc_ctx; - audio_enc->codec_type = AVMEDIA_TYPE_AUDIO; - - MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st); - MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st); - - if (!ost->stream_copy) { - int channels = 0; - char *layout = NULL; - char *sample_fmt = NULL; - - MATCH_PER_STREAM_OPT(audio_channels, i, channels, oc, st); - if (channels) { - audio_enc->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - audio_enc->ch_layout.nb_channels = channels; - } - - MATCH_PER_STREAM_OPT(audio_ch_layouts, str, layout, oc, st); - if (layout) { - if (av_channel_layout_from_string(&audio_enc->ch_layout, layout) < 0) { -#if FF_API_OLD_CHANNEL_LAYOUT - uint64_t mask; - AV_NOWARN_DEPRECATED({ - mask = av_get_channel_layout(layout); - }) - if (!mask) { -#endif - av_log(NULL, AV_LOG_FATAL, "Unknown channel layout: %s\n", layout); - exit_program(1); -#if FF_API_OLD_CHANNEL_LAYOUT - } - av_log(NULL, AV_LOG_WARNING, "Channel layout '%s' uses a deprecated syntax.\n", - layout); - av_channel_layout_from_mask(&audio_enc->ch_layout, mask); -#endif - } - } - - MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st); - if (sample_fmt && - (audio_enc->sample_fmt = av_get_sample_fmt(sample_fmt)) == AV_SAMPLE_FMT_NONE) { - av_log(NULL, AV_LOG_FATAL, "Invalid sample format '%s'\n", sample_fmt); - exit_program(1); - } - - MATCH_PER_STREAM_OPT(audio_sample_rate, i, audio_enc->sample_rate, oc, st); - - MATCH_PER_STREAM_OPT(apad, str, ost->apad, oc, st); - ost->apad = av_strdup(ost->apad); - - ost->avfilter = get_ost_filters(o, oc, ost); - if (!ost->avfilter) - exit_program(1); - - /* check for channel mapping for this audio stream */ - for (n = 0; n < o->nb_audio_channel_maps; n++) { - AudioChannelMap *map = &o->audio_channel_maps[n]; - if ((map->ofile_idx == -1 || ost->file_index == map->ofile_idx) && - (map->ostream_idx == -1 || ost->st->index == map->ostream_idx)) { - InputStream *ist; - - if (map->channel_idx == -1) { - ist = NULL; - } else if (ost->source_index < 0) { - av_log(NULL, AV_LOG_FATAL, "Cannot determine input stream for channel mapping %d.%d\n", - ost->file_index, ost->st->index); - continue; - } else { - ist = input_streams[ost->source_index]; - } - - if (!ist || (ist->file_index == map->file_idx && ist->st->index == map->stream_idx)) { - if (av_reallocp_array(&ost->audio_channels_map, - ost->audio_channels_mapped + 1, - sizeof(*ost->audio_channels_map) - ) < 0 ) - exit_program(1); - - ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx; - } - } - } - } - - if (ost->stream_copy) - check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_AUDIO); - - return ost; -} - -static OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - OutputStream *ost; - - ost = new_output_stream(o, oc, AVMEDIA_TYPE_DATA, source_index); - if (!ost->stream_copy) { - av_log(NULL, AV_LOG_FATAL, "Data stream encoding not supported yet (only streamcopy)\n"); - exit_program(1); - } - - return ost; -} - -static OutputStream *new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - OutputStream *ost; - - ost = new_output_stream(o, oc, AVMEDIA_TYPE_UNKNOWN, source_index); - if (!ost->stream_copy) { - av_log(NULL, AV_LOG_FATAL, "Unknown stream encoding not supported yet (only streamcopy)\n"); - exit_program(1); - } - - return ost; -} - -static OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - OutputStream *ost = new_output_stream(o, oc, AVMEDIA_TYPE_ATTACHMENT, source_index); - ost->stream_copy = 1; - ost->finished = 1; - return ost; -} - -static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index) -{ - AVStream *st; - OutputStream *ost; - AVCodecContext *subtitle_enc; - - ost = new_output_stream(o, oc, AVMEDIA_TYPE_SUBTITLE, source_index); - st = ost->st; - subtitle_enc = ost->enc_ctx; - - subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; - - if (!ost->stream_copy) { - char *frame_size = NULL; - - MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st); - if (frame_size && av_parse_video_size(&subtitle_enc->width, &subtitle_enc->height, frame_size) < 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size); - exit_program(1); - } - } - - return ost; -} - -/* arg format is "output-stream-index:streamid-value". */ -static int opt_streamid(void *optctx, const char *opt, const char *arg) -{ - OptionsContext *o = optctx; - int idx; - char *p; - char idx_str[16]; - - av_strlcpy(idx_str, arg, sizeof(idx_str)); - p = strchr(idx_str, ':'); - if (!p) { - av_log(NULL, AV_LOG_FATAL, - "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", - arg, opt); - exit_program(1); - } - *p++ = '\0'; - idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); - o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1); - o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); - return 0; -} - -static int copy_chapters(InputFile *ifile, OutputFile *ofile, AVFormatContext *os, - int copy_metadata) -{ - AVFormatContext *is = ifile->ctx; - AVChapter **tmp; - int i; - - tmp = av_realloc_f(os->chapters, is->nb_chapters + os->nb_chapters, sizeof(*os->chapters)); - if (!tmp) - return AVERROR(ENOMEM); - os->chapters = tmp; - - for (i = 0; i < is->nb_chapters; i++) { - AVChapter *in_ch = is->chapters[i], *out_ch; - int64_t start_time = (ofile->start_time == AV_NOPTS_VALUE) ? 0 : ofile->start_time; - int64_t ts_off = av_rescale_q(start_time - ifile->ts_offset, - AV_TIME_BASE_Q, in_ch->time_base); - int64_t rt = (ofile->recording_time == INT64_MAX) ? INT64_MAX : - av_rescale_q(ofile->recording_time, AV_TIME_BASE_Q, in_ch->time_base); - - - if (in_ch->end < ts_off) - continue; - if (rt != INT64_MAX && in_ch->start > rt + ts_off) - break; - - out_ch = av_mallocz(sizeof(AVChapter)); - if (!out_ch) - return AVERROR(ENOMEM); - - out_ch->id = in_ch->id; - out_ch->time_base = in_ch->time_base; - out_ch->start = FFMAX(0, in_ch->start - ts_off); - out_ch->end = FFMIN(rt, in_ch->end - ts_off); - - if (copy_metadata) - av_dict_copy(&out_ch->metadata, in_ch->metadata, 0); - - os->chapters[os->nb_chapters++] = out_ch; - } - return 0; -} - -static int set_dispositions(OutputFile *of, AVFormatContext *ctx) -{ - int nb_streams[AVMEDIA_TYPE_NB] = { 0 }; - int have_default[AVMEDIA_TYPE_NB] = { 0 }; - int have_manual = 0; - - // first, copy the input dispositions - for (int i = 0; i < ctx->nb_streams; i++) { - OutputStream *ost = output_streams[of->ost_index + i]; - - nb_streams[ost->st->codecpar->codec_type]++; - - have_manual |= !!ost->disposition; - - if (ost->source_index >= 0) { - ost->st->disposition = input_streams[ost->source_index]->st->disposition; - - if (ost->st->disposition & AV_DISPOSITION_DEFAULT) - have_default[ost->st->codecpar->codec_type] = 1; - } - } - - if (have_manual) { - // process manually set dispositions - they override the above copy - for (int i = 0; i < ctx->nb_streams; i++) { - OutputStream *ost = output_streams[of->ost_index + i]; - int ret; - - if (!ost->disposition) - continue; - -#if LIBAVFORMAT_VERSION_MAJOR >= 60 - ret = av_opt_set(ost->st, "disposition", ost->disposition, 0); -#else - { - const AVClass *class = av_stream_get_class(); - const AVOption *o = av_opt_find(&class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ); - - av_assert0(o); - ret = av_opt_eval_flags(&class, o, ost->disposition, &ost->st->disposition); - } -#endif - - if (ret < 0) - return ret; - } - } else { - // For each media type with more than one stream, find a suitable stream to - // mark as default, unless one is already marked default. - // "Suitable" means the first of that type, skipping attached pictures. - for (int i = 0; i < ctx->nb_streams; i++) { - OutputStream *ost = output_streams[of->ost_index + i]; - enum AVMediaType type = ost->st->codecpar->codec_type; - - if (nb_streams[type] < 2 || have_default[type] || - ost->st->disposition & AV_DISPOSITION_ATTACHED_PIC) - continue; - - ost->st->disposition |= AV_DISPOSITION_DEFAULT; - have_default[type] = 1; - } - } - - return 0; -} - -static void init_output_filter(OutputFilter *ofilter, OptionsContext *o, - AVFormatContext *oc) -{ - OutputStream *ost; - - switch (ofilter->type) { - case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break; - case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break; - default: - av_log(NULL, AV_LOG_FATAL, "Only video and audio filters are supported " - "currently.\n"); - exit_program(1); - } - - ost->filter = ofilter; - - ofilter->ost = ost; - ofilter->format = -1; - - if (ost->stream_copy) { - av_log(NULL, AV_LOG_ERROR, "Streamcopy requested for output stream %d:%d, " - "which is fed from a complex filtergraph. Filtering and streamcopy " - "cannot be used together.\n", ost->file_index, ost->index); - exit_program(1); - } - - if (ost->avfilter && (ost->filters || ost->filters_script)) { - const char *opt = ost->filters ? "-vf/-af/-filter" : "-filter_script"; - av_log(NULL, AV_LOG_ERROR, - "%s '%s' was specified through the %s option " - "for output stream %d:%d, which is fed from a complex filtergraph.\n" - "%s and -filter_complex cannot be used together for the same stream.\n", - ost->filters ? "Filtergraph" : "Filtergraph script", - ost->filters ? ost->filters : ost->filters_script, - opt, ost->file_index, ost->index, opt); - exit_program(1); - } - - avfilter_inout_free(&ofilter->out_tmp); -} - -static int init_complex_filters(void) -{ - int i, ret = 0; - - for (i = 0; i < nb_filtergraphs; i++) { - ret = init_complex_filtergraph(filtergraphs[i]); - if (ret < 0) - return ret; + return AVERROR(EINVAL); + } + filter_hw_device = hw_device_get_by_name(arg); + if (!filter_hw_device) { + av_log(NULL, AV_LOG_ERROR, "Invalid filter device %s.\n", arg); + return AVERROR(EINVAL); } return 0; } -static void set_channel_layout(OutputFilter *f, OutputStream *ost) +static int opt_recording_timestamp(void *optctx, const char *opt, const char *arg) { - int i, err; - - if (ost->enc_ctx->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) { - /* Pass the layout through for all orders but UNSPEC */ - err = av_channel_layout_copy(&f->ch_layout, &ost->enc_ctx->ch_layout); - if (err < 0) - exit_program(1); - return; - } + OptionsContext *o = optctx; + char buf[128]; + int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6; + struct tm time = *gmtime((time_t*)&recording_timestamp); + if (!strftime(buf, sizeof(buf), "creation_time=%Y-%m-%dT%H:%M:%S%z", &time)) + return -1; + parse_option(o, "metadata", buf, options); - /* Requested layout is of order UNSPEC */ - if (!ost->enc->ch_layouts) { - /* Use the default native layout for the requested amount of channels when the - encoder doesn't have a list of supported layouts */ - av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels); - return; - } - /* Encoder has a list of supported layouts. Pick the first layout in it with the - same amount of channels as the requested layout */ - for (i = 0; ost->enc->ch_layouts[i].nb_channels; i++) { - if (ost->enc->ch_layouts[i].nb_channels == ost->enc_ctx->ch_layout.nb_channels) - break; - } - if (ost->enc->ch_layouts[i].nb_channels) { - /* Use it if one is found */ - err = av_channel_layout_copy(&f->ch_layout, &ost->enc->ch_layouts[i]); - if (err < 0) - exit_program(1); - return; - } - /* If no layout for the amount of channels requested was found, use the default - native layout for it. */ - av_channel_layout_default(&f->ch_layout, ost->enc_ctx->ch_layout.nb_channels); + av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata " + "tag instead.\n", opt); + return 0; } -static int open_output_file(OptionsContext *o, const char *filename) +const AVCodec *find_codec_or_die(void *logctx, const char *name, + enum AVMediaType type, int encoder) { - AVFormatContext *oc; - int i, j, err; - OutputFile *of; - OutputStream *ost; - InputStream *ist; - AVDictionary *unused_opts = NULL; - const AVDictionaryEntry *e = NULL; + const AVCodecDescriptor *desc; + const char *codec_string = encoder ? "encoder" : "decoder"; + const AVCodec *codec; - if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) { - o->stop_time = INT64_MAX; - av_log(NULL, AV_LOG_WARNING, "-t and -to cannot be used together; using -t.\n"); - } + codec = encoder ? + avcodec_find_encoder_by_name(name) : + avcodec_find_decoder_by_name(name); - if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) { - int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time; - if (o->stop_time <= start_time) { - av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n"); - exit_program(1); - } else { - o->recording_time = o->stop_time - start_time; - } + if (!codec && (desc = avcodec_descriptor_get_by_name(name))) { + codec = encoder ? avcodec_find_encoder(desc->id) : + avcodec_find_decoder(desc->id); + if (codec) + av_log(logctx, AV_LOG_VERBOSE, "Matched %s '%s' for codec '%s'.\n", + codec_string, codec->name, desc->name); } - of = ALLOC_ARRAY_ELEM(output_files, nb_output_files); - - of->index = nb_output_files - 1; - of->ost_index = nb_output_streams; - of->recording_time = o->recording_time; - of->start_time = o->start_time; - of->limit_filesize = o->limit_filesize; - of->shortest = o->shortest; - av_dict_copy(&of->opts, o->g->format_opts, 0); - - if (!strcmp(filename, "-")) - filename = "pipe:"; - - err = avformat_alloc_output_context2(&oc, NULL, o->format, filename); - if (!oc) { - print_error(filename, err); + if (!codec) { + av_log(logctx, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name); exit_program(1); } - - of->ctx = oc; - of->format = oc->oformat; - if (o->recording_time != INT64_MAX) - oc->duration = o->recording_time; - - oc->interrupt_callback = int_cb; - - if (o->bitexact) { - oc->flags |= AVFMT_FLAG_BITEXACT; - } - - /* create streams for all unlabeled output pads */ - for (i = 0; i < nb_filtergraphs; i++) { - FilterGraph *fg = filtergraphs[i]; - for (j = 0; j < fg->nb_outputs; j++) { - OutputFilter *ofilter = fg->outputs[j]; - - if (!ofilter->out_tmp || ofilter->out_tmp->name) - continue; - - switch (ofilter->type) { - case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break; - case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break; - case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break; - } - init_output_filter(ofilter, o, oc); - } - } - - if (!o->nb_stream_maps) { - char *subtitle_codec_name = NULL; - /* pick the "best" stream of each type */ - - /* video: highest resolution */ - if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) { - int best_score = 0, idx = -1; - int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0); - for (j = 0; j < nb_input_files; j++) { - InputFile *ifile = input_files[j]; - int file_best_score = 0, file_best_idx = -1; - for (i = 0; i < ifile->nb_streams; i++) { - int score; - ist = input_streams[ifile->ist_index + i]; - score = ist->st->codecpar->width * ist->st->codecpar->height - + 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) - + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); - if (ist->user_set_discard == AVDISCARD_ALL) - continue; - if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) - score = 1; - if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && - score > file_best_score) { - if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) - continue; - file_best_score = score; - file_best_idx = ifile->ist_index + i; - } - } - if (file_best_idx >= 0) { - if((qcr == MKTAG('A', 'P', 'I', 'C')) || !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) - file_best_score -= 5000000*!!(input_streams[file_best_idx]->st->disposition & AV_DISPOSITION_DEFAULT); - if (file_best_score > best_score) { - best_score = file_best_score; - idx = file_best_idx; - } - } - } - if (idx >= 0) - new_video_stream(o, oc, idx); - } - - /* audio: most channels */ - if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) { - int best_score = 0, idx = -1; - for (j = 0; j < nb_input_files; j++) { - InputFile *ifile = input_files[j]; - int file_best_score = 0, file_best_idx = -1; - for (i = 0; i < ifile->nb_streams; i++) { - int score; - ist = input_streams[ifile->ist_index + i]; - score = ist->st->codecpar->ch_layout.nb_channels - + 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS) - + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); - if (ist->user_set_discard == AVDISCARD_ALL) - continue; - if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && - score > file_best_score) { - file_best_score = score; - file_best_idx = ifile->ist_index + i; - } - } - if (file_best_idx >= 0) { - file_best_score -= 5000000*!!(input_streams[file_best_idx]->st->disposition & AV_DISPOSITION_DEFAULT); - if (file_best_score > best_score) { - best_score = file_best_score; - idx = file_best_idx; - } - } - } - if (idx >= 0) - new_audio_stream(o, oc, idx); - } - - /* subtitles: pick first */ - MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s"); - if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) { - for (i = 0; i < nb_input_streams; i++) - if (input_streams[i]->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) { - AVCodecDescriptor const *input_descriptor = - avcodec_descriptor_get(input_streams[i]->st->codecpar->codec_id); - AVCodecDescriptor const *output_descriptor = NULL; - AVCodec const *output_codec = - avcodec_find_encoder(oc->oformat->subtitle_codec); - int input_props = 0, output_props = 0; - if (input_streams[i]->user_set_discard == AVDISCARD_ALL) - continue; - if (output_codec) - output_descriptor = avcodec_descriptor_get(output_codec->id); - if (input_descriptor) - input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (output_descriptor) - output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); - if (subtitle_codec_name || - input_props & output_props || - // Map dvb teletext which has neither property to any output subtitle encoder - input_descriptor && output_descriptor && - (!input_descriptor->props || - !output_descriptor->props)) { - new_subtitle_stream(o, oc, i); - break; - } - } - } - /* Data only if codec id match */ - if (!o->data_disable ) { - enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_DATA); - for (i = 0; codec_id != AV_CODEC_ID_NONE && i < nb_input_streams; i++) { - if (input_streams[i]->user_set_discard == AVDISCARD_ALL) - continue; - if (input_streams[i]->st->codecpar->codec_type == AVMEDIA_TYPE_DATA - && input_streams[i]->st->codecpar->codec_id == codec_id ) - new_data_stream(o, oc, i); - } - } - } else { - for (i = 0; i < o->nb_stream_maps; i++) { - StreamMap *map = &o->stream_maps[i]; - - if (map->disabled) - continue; - - if (map->linklabel) { - FilterGraph *fg; - OutputFilter *ofilter = NULL; - int j, k; - - for (j = 0; j < nb_filtergraphs; j++) { - fg = filtergraphs[j]; - for (k = 0; k < fg->nb_outputs; k++) { - AVFilterInOut *out = fg->outputs[k]->out_tmp; - if (out && !strcmp(out->name, map->linklabel)) { - ofilter = fg->outputs[k]; - goto loop_end; - } - } - } -loop_end: - if (!ofilter) { - av_log(NULL, AV_LOG_FATAL, "Output with label '%s' does not exist " - "in any defined filter graph, or was already used elsewhere.\n", map->linklabel); - exit_program(1); - } - init_output_filter(ofilter, o, oc); - } else { - int src_idx = input_files[map->file_index]->ist_index + map->stream_index; - - ist = input_streams[input_files[map->file_index]->ist_index + map->stream_index]; - if (ist->user_set_discard == AVDISCARD_ALL) { - av_log(NULL, AV_LOG_FATAL, "Stream #%d:%d is disabled and cannot be mapped.\n", - map->file_index, map->stream_index); - exit_program(1); - } - if(o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) - continue; - if(o-> audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) - continue; - if(o-> video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) - continue; - if(o-> data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA) - continue; - - ost = NULL; - switch (ist->st->codecpar->codec_type) { - case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_DATA: ost = new_data_stream (o, oc, src_idx); break; - case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break; - case AVMEDIA_TYPE_UNKNOWN: - if (copy_unknown_streams) { - ost = new_unknown_stream (o, oc, src_idx); - break; - } - default: - av_log(NULL, ignore_unknown_streams ? AV_LOG_WARNING : AV_LOG_FATAL, - "Cannot map stream #%d:%d - unsupported type.\n", - map->file_index, map->stream_index); - if (!ignore_unknown_streams) { - av_log(NULL, AV_LOG_FATAL, - "If you want unsupported types ignored instead " - "of failing, please use the -ignore_unknown option\n" - "If you want them copied, please use -copy_unknown\n"); - exit_program(1); - } - } - if (ost) - ost->sync_ist = input_streams[ input_files[map->sync_file_index]->ist_index - + map->sync_stream_index]; - } - } + if (codec->type != type && !recast_media) { + av_log(logctx, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name); + exit_program(1); } + return codec; +} - /* handle attached files */ - for (i = 0; i < o->nb_attachments; i++) { - AVIOContext *pb; - uint8_t *attachment; - const char *p; - int64_t len; - - if ((err = avio_open2(&pb, o->attachments[i], AVIO_FLAG_READ, &int_cb, NULL)) < 0) { - av_log(NULL, AV_LOG_FATAL, "Could not open attachment file %s.\n", - o->attachments[i]); - exit_program(1); - } - if ((len = avio_size(pb)) <= 0) { - av_log(NULL, AV_LOG_FATAL, "Could not get size of the attachment %s.\n", - o->attachments[i]); - exit_program(1); - } - if (len > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE || - !(attachment = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE))) { - av_log(NULL, AV_LOG_FATAL, "Attachment %s too large.\n", - o->attachments[i]); - exit_program(1); - } - avio_read(pb, attachment, len); - memset(attachment + len, 0, AV_INPUT_BUFFER_PADDING_SIZE); +void assert_file_overwrite(const char *filename) +{ + const char *proto_name = avio_find_protocol_name(filename); - ost = new_attachment_stream(o, oc, -1); - ost->stream_copy = 0; - ost->attachment_filename = o->attachments[i]; - ost->st->codecpar->extradata = attachment; - ost->st->codecpar->extradata_size = len; - - p = strrchr(o->attachments[i], '/'); - av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE); - avio_closep(&pb); - } - - if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) { - av_dump_format(oc, nb_output_files - 1, oc->url, 1); - av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1); + if (file_overwrite && no_file_overwrite) { + fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n"); exit_program(1); } - /* check if all codec options have been used */ - unused_opts = strip_specifiers(o->g->codec_opts); - for (i = of->ost_index; i < nb_output_streams; i++) { - e = NULL; - while ((e = av_dict_get(output_streams[i]->encoder_opts, "", e, - AV_DICT_IGNORE_SUFFIX))) - av_dict_set(&unused_opts, e->key, NULL, 0); - } - - e = NULL; - while ((e = av_dict_get(unused_opts, "", e, AV_DICT_IGNORE_SUFFIX))) { - const AVClass *class = avcodec_get_class(); - const AVOption *option = av_opt_find(&class, e->key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - const AVClass *fclass = avformat_get_class(); - const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - if (!option || foption) - continue; - - - if (!(option->flags & AV_OPT_FLAG_ENCODING_PARAM)) { - av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for " - "output file #%d (%s) is not an encoding option.\n", e->key, - option->help ? option->help : "", nb_output_files - 1, - filename); - exit_program(1); - } - - // gop_timecode is injected by generic code but not always used - if (!strcmp(e->key, "gop_timecode")) - continue; - - av_log(NULL, AV_LOG_WARNING, "Codec AVOption %s (%s) specified for " - "output file #%d (%s) has not been used for any stream. The most " - "likely reason is either wrong type (e.g. a video option with " - "no video streams) or that it is a private option of some encoder " - "which was not actually used for any stream.\n", e->key, - option->help ? option->help : "", nb_output_files - 1, filename); - } - av_dict_free(&unused_opts); - - /* set the decoding_needed flags and create simple filtergraphs */ - for (i = of->ost_index; i < nb_output_streams; i++) { - OutputStream *ost = output_streams[i]; - - if (ost->encoding_needed && ost->source_index >= 0) { - InputStream *ist = input_streams[ost->source_index]; - ist->decoding_needed |= DECODING_FOR_OST; - ist->processing_needed = 1; - - if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || - ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { - err = init_simple_filtergraph(ist, ost); - if (err < 0) { - av_log(NULL, AV_LOG_ERROR, - "Error initializing a simple filtergraph between streams " - "%d:%d->%d:%d\n", ist->file_index, ost->source_index, - nb_output_files - 1, ost->st->index); + if (!file_overwrite) { + if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) { + if (stdin_interaction && !no_file_overwrite) { + fprintf(stderr,"File '%s' already exists. Overwrite? [y/N] ", filename); + fflush(stderr); + term_exit(); + signal(SIGINT, SIG_DFL); + if (!read_yesno()) { + av_log(NULL, AV_LOG_FATAL, "Not overwriting - exiting\n"); exit_program(1); } + term_init(); } - } else if (ost->stream_copy && ost->source_index >= 0) { - InputStream *ist = input_streams[ost->source_index]; - ist->processing_needed = 1; - } - - /* set the filter output constraints */ - if (ost->filter) { - OutputFilter *f = ost->filter; - switch (ost->enc_ctx->codec_type) { - case AVMEDIA_TYPE_VIDEO: - f->frame_rate = ost->frame_rate; - f->width = ost->enc_ctx->width; - f->height = ost->enc_ctx->height; - if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { - f->format = ost->enc_ctx->pix_fmt; - } else { - f->formats = ost->enc->pix_fmts; - } - break; - case AVMEDIA_TYPE_AUDIO: - if (ost->enc_ctx->sample_fmt != AV_SAMPLE_FMT_NONE) { - f->format = ost->enc_ctx->sample_fmt; - } else { - f->formats = ost->enc->sample_fmts; - } - if (ost->enc_ctx->sample_rate) { - f->sample_rate = ost->enc_ctx->sample_rate; - } else { - f->sample_rates = ost->enc->supported_samplerates; - } - if (ost->enc_ctx->ch_layout.nb_channels) { - set_channel_layout(f, ost); - } else if (ost->enc->ch_layouts) { - f->ch_layouts = ost->enc->ch_layouts; - } - break; + else { + av_log(NULL, AV_LOG_FATAL, "File '%s' already exists. Exiting.\n", filename); + exit_program(1); } } } - /* check filename in case of an image number is expected */ - if (oc->oformat->flags & AVFMT_NEEDNUMBER) { - if (!av_filename_number_test(oc->url)) { - print_error(oc->url, AVERROR(EINVAL)); - exit_program(1); - } - } - - if (!(oc->oformat->flags & AVFMT_NOSTREAMS) && !input_stream_potentially_available) { - av_log(NULL, AV_LOG_ERROR, - "No input streams but output needs an input stream\n"); - exit_program(1); - } - - if (!(oc->oformat->flags & AVFMT_NOFILE)) { - /* test if it already exists to avoid losing precious files */ - assert_file_overwrite(filename); - - /* open the file */ - if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE, - &oc->interrupt_callback, - &of->opts)) < 0) { - print_error(filename, err); - exit_program(1); + if (proto_name && !strcmp(proto_name, "file")) { + for (int i = 0; i < nb_input_files; i++) { + InputFile *file = input_files[i]; + if (file->ctx->iformat->flags & AVFMT_NOFILE) + continue; + if (!strcmp(filename, file->ctx->url)) { + av_log(NULL, AV_LOG_FATAL, "Output %s same as Input #%d - exiting\n", filename, i); + av_log(NULL, AV_LOG_WARNING, "FFmpeg cannot edit existing files in-place.\n"); + exit_program(1); + } } - } else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename)) - assert_file_overwrite(filename); - - if (o->mux_preload) { - av_dict_set_int(&of->opts, "preload", o->mux_preload*AV_TIME_BASE, 0); } - oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE); +} - /* copy metadata */ - for (i = 0; i < o->nb_metadata_map; i++) { - char *p; - int in_file_index = strtol(o->metadata_map[i].u.str, &p, 0); +/* read file contents into a string */ +char *file_read(const char *filename) +{ + AVIOContext *pb = NULL; + int ret = avio_open(&pb, filename, AVIO_FLAG_READ); + AVBPrint bprint; + char *str; - if (in_file_index >= nb_input_files) { - av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d while processing metadata maps\n", in_file_index); - exit_program(1); - } - copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc, - in_file_index >= 0 ? - input_files[in_file_index]->ctx : NULL, o); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error opening file %s.\n", filename); + return NULL; } - /* copy chapters */ - if (o->chapters_input_file >= nb_input_files) { - if (o->chapters_input_file == INT_MAX) { - /* copy chapters from the first input file that has them*/ - o->chapters_input_file = -1; - for (i = 0; i < nb_input_files; i++) - if (input_files[i]->ctx->nb_chapters) { - o->chapters_input_file = i; - break; - } - } else { - av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d in chapter mapping.\n", - o->chapters_input_file); - exit_program(1); - } + av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); + ret = avio_read_to_bprint(pb, &bprint, SIZE_MAX); + avio_closep(&pb); + if (ret < 0) { + av_bprint_finalize(&bprint, NULL); + return NULL; } - if (o->chapters_input_file >= 0) - copy_chapters(input_files[o->chapters_input_file], of, oc, - !o->metadata_chapters_manual); - - /* copy global metadata by default */ - if (!o->metadata_global_manual && nb_input_files){ - av_dict_copy(&oc->metadata, input_files[0]->ctx->metadata, - AV_DICT_DONT_OVERWRITE); - if(o->recording_time != INT64_MAX) - av_dict_set(&oc->metadata, "duration", NULL, 0); - av_dict_set(&oc->metadata, "creation_time", NULL, 0); - av_dict_set(&oc->metadata, "company_name", NULL, 0); - av_dict_set(&oc->metadata, "product_name", NULL, 0); - av_dict_set(&oc->metadata, "product_version", NULL, 0); - } - if (!o->metadata_streams_manual) - for (i = of->ost_index; i < nb_output_streams; i++) { - InputStream *ist; - if (output_streams[i]->source_index < 0) /* this is true e.g. for attached files */ - continue; - ist = input_streams[output_streams[i]->source_index]; - av_dict_copy(&output_streams[i]->st->metadata, ist->st->metadata, AV_DICT_DONT_OVERWRITE); - if (!output_streams[i]->stream_copy) { - av_dict_set(&output_streams[i]->st->metadata, "encoder", NULL, 0); - } - } - - /* process manually set programs */ - for (i = 0; i < o->nb_program; i++) { - const char *p = o->program[i].u.str; - int progid = i+1; - AVProgram *program; - - while(*p) { - const char *p2 = av_get_token(&p, ":"); - const char *to_dealloc = p2; - char *key; - if (!p2) - break; - - if(*p) p++; - - key = av_get_token(&p2, "="); - if (!key || !*p2) { - av_freep(&to_dealloc); - av_freep(&key); - break; - } - p2++; - - if (!strcmp(key, "program_num")) - progid = strtol(p2, NULL, 0); - av_freep(&to_dealloc); - av_freep(&key); - } - - program = av_new_program(oc, progid); + ret = av_bprint_finalize(&bprint, &str); + if (ret < 0) + return NULL; + return str; +} - p = o->program[i].u.str; - while(*p) { - const char *p2 = av_get_token(&p, ":"); - const char *to_dealloc = p2; - char *key; - if (!p2) - break; - if(*p) p++; - - key = av_get_token(&p2, "="); - if (!key) { - av_log(NULL, AV_LOG_FATAL, - "No '=' character in program string %s.\n", - p2); - exit_program(1); - } - if (!*p2) - exit_program(1); - p2++; +/* arg format is "output-stream-index:streamid-value". */ +static int opt_streamid(void *optctx, const char *opt, const char *arg) +{ + OptionsContext *o = optctx; + int idx; + char *p; + char idx_str[16]; - if (!strcmp(key, "title")) { - av_dict_set(&program->metadata, "title", p2, 0); - } else if (!strcmp(key, "program_num")) { - } else if (!strcmp(key, "st")) { - int st_num = strtol(p2, NULL, 0); - av_program_add_stream_index(oc, progid, st_num); - } else { - av_log(NULL, AV_LOG_FATAL, "Unknown program key %s.\n", key); - exit_program(1); - } - av_freep(&to_dealloc); - av_freep(&key); - } + av_strlcpy(idx_str, arg, sizeof(idx_str)); + p = strchr(idx_str, ':'); + if (!p) { + av_log(NULL, AV_LOG_FATAL, + "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", + arg, opt); + exit_program(1); } + *p++ = '\0'; + idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); + o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1); + o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); + return 0; +} - /* process manually set metadata */ - for (i = 0; i < o->nb_metadata; i++) { - AVDictionary **m; - char type, *val; - const char *stream_spec; - int index = 0, j, ret = 0; - - val = strchr(o->metadata[i].u.str, '='); - if (!val) { - av_log(NULL, AV_LOG_FATAL, "No '=' character in metadata string %s.\n", - o->metadata[i].u.str); - exit_program(1); - } - *val++ = 0; - - parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec); - if (type == 's') { - for (j = 0; j < oc->nb_streams; j++) { - ost = output_streams[nb_output_streams - oc->nb_streams + j]; - if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) { - if (!strcmp(o->metadata[i].u.str, "rotate")) { - char *tail; - double theta = av_strtod(val, &tail); - if (!*tail) { - ost->rotate_overridden = 1; - ost->rotate_override_value = theta; - } - } else { - av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0); - } - } else if (ret < 0) - exit_program(1); - } - } - else { - switch (type) { - case 'g': - m = &oc->metadata; - break; - case 'c': - if (index < 0 || index >= oc->nb_chapters) { - av_log(NULL, AV_LOG_FATAL, "Invalid chapter index %d in metadata specifier.\n", index); - exit_program(1); - } - m = &oc->chapters[index]->metadata; - break; - case 'p': - if (index < 0 || index >= oc->nb_programs) { - av_log(NULL, AV_LOG_FATAL, "Invalid program index %d in metadata specifier.\n", index); - exit_program(1); - } - m = &oc->programs[index]->metadata; - break; - default: - av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier); - exit_program(1); - } - av_dict_set(m, o->metadata[i].u.str, *val ? val : NULL, 0); - } - } +static int init_complex_filters(void) +{ + int i, ret = 0; - err = set_dispositions(of, oc); - if (err < 0) { - av_log(NULL, AV_LOG_FATAL, "Error setting output stream dispositions\n"); - exit_program(1); + for (i = 0; i < nb_filtergraphs; i++) { + ret = init_complex_filtergraph(filtergraphs[i]); + if (ret < 0) + return ret; } - return 0; } @@ -3403,15 +1114,13 @@ if (!fg->graph_desc) return AVERROR(ENOMEM); - input_stream_potentially_available = 1; - return 0; } static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg) { FilterGraph *fg; - char *graph_desc = read_file(arg); + char *graph_desc = file_read(arg); if (!graph_desc) return AVERROR(EINVAL); @@ -3419,8 +1128,6 @@ fg->index = nb_filtergraphs - 1; fg->graph_desc = graph_desc; - input_stream_potentially_available = 1; - return 0; } @@ -3514,7 +1221,7 @@ }; static int open_files(OptionGroupList *l, const char *inout, - int (*open_file)(OptionsContext*, const char*)) + int (*open_file)(const OptionsContext*, const char*)) { int i, ret; @@ -3550,7 +1257,6 @@ int ffmpeg_parse_options(int argc, char **argv) { OptionParseContext octx; - uint8_t error[128]; int ret; memset(&octx, 0, sizeof(octx)); @@ -3574,14 +1280,12 @@ term_init(); /* open input files */ - ret = open_files(&octx.groups[GROUP_INFILE], "input", open_input_file); + ret = open_files(&octx.groups[GROUP_INFILE], "input", ifile_open); if (ret < 0) { av_log(NULL, AV_LOG_FATAL, "Error opening input files: "); goto fail; } - apply_sync_offsets(); - /* create the complex filtergraphs */ ret = init_complex_filters(); if (ret < 0) { @@ -3590,19 +1294,22 @@ } /* open output files */ - ret = open_files(&octx.groups[GROUP_OUTFILE], "output", open_output_file); + ret = open_files(&octx.groups[GROUP_OUTFILE], "output", of_open); if (ret < 0) { av_log(NULL, AV_LOG_FATAL, "Error opening output files: "); goto fail; } + correct_input_start_times(); + + apply_sync_offsets(); + check_filter_outputs(); fail: uninit_parse_context(&octx); if (ret < 0) { - av_strerror(ret, error, sizeof(error)); - av_log(NULL, AV_LOG_FATAL, "%s\n", error); + av_log(NULL, AV_LOG_FATAL, "%s\n", av_err2str(ret)); } return ret; } @@ -3667,8 +1374,10 @@ OPT_OUTPUT, { .func_arg = opt_map }, "set input stream mapping", "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" }, +#if FFMPEG_OPT_MAP_CHANNEL { "map_channel", HAS_ARG | OPT_EXPERT | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_map_channel }, - "map an audio channel from one stream to another", "file.stream.channel[:syncfile.syncstream]" }, + "map an audio channel from one stream to another (deprecated)", "file.stream.channel[:syncfile.syncstream]" }, +#endif { "map_metadata", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata_map) }, "set metadata information of outfile from infile", @@ -3741,8 +1450,6 @@ "set video sync method globally; deprecated, use -fps_mode", "" }, { "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold }, "frame drop threshold", "" }, - { "async", HAS_ARG | OPT_INT | OPT_EXPERT, { &audio_sync_method }, - "audio sync method", "" }, { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &audio_drift_threshold }, "audio drift threshold", "threshold" }, { "copyts", OPT_BOOL | OPT_EXPERT, { ©_ts }, @@ -3754,6 +1461,8 @@ { "shortest", OPT_BOOL | OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(shortest) }, "finish encoding within shortest input" }, + { "shortest_buf_duration", HAS_ARG | OPT_FLOAT | OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT, { .off = OFFSET(shortest_buf_duration) }, + "maximum buffering duration (in seconds) for the -shortest option" }, { "bitexact", OPT_BOOL | OPT_EXPERT | OPT_OFFSET | OPT_OUTPUT | OPT_INPUT, { .off = OFFSET(bitexact) }, "bitexact mode" }, @@ -3826,15 +1535,28 @@ { "disposition", OPT_STRING | HAS_ARG | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(disposition) }, "disposition", "" }, - { "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT, + { "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(thread_queue_size) }, "set the maximum number of queued packets from the demuxer" }, - { "find_stream_info", OPT_BOOL | OPT_PERFILE | OPT_INPUT | OPT_EXPERT, { &find_stream_info }, + { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT | OPT_OFFSET, { .off = OFFSET(find_stream_info) }, "read and decode the streams to fill missing information with heuristics" }, { "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(bits_per_raw_sample) }, "set the number of bits per raw sample", "number" }, + { "stats_enc_pre", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(enc_stats_pre) }, + "write encoding stats before encoding" }, + { "stats_enc_post", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(enc_stats_post) }, + "write encoding stats after encoding" }, + { "stats_mux_pre", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(mux_stats) }, + "write packets stats before muxing" }, + { "stats_enc_pre_fmt", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(enc_stats_pre_fmt) }, + "format of the stats written with -stats_enc_pre" }, + { "stats_enc_post_fmt", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(enc_stats_post_fmt) }, + "format of the stats written with -stats_enc_post" }, + { "stats_mux_pre_fmt", HAS_ARG | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_STRING, { .off = OFFSET(mux_stats_fmt) }, + "format of the stats written with -stats_mux_pre" }, + /* video options */ { "vframes", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_frames }, "set the number of video frames to output", "number" }, @@ -3853,6 +1575,16 @@ { "pix_fmt", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(frame_pix_fmts) }, "set pixel format", "format" }, + { "display_rotation", OPT_VIDEO | HAS_ARG | OPT_DOUBLE | OPT_SPEC | + OPT_INPUT, { .off = OFFSET(display_rotations) }, + "set pure counter-clockwise rotation in degrees for stream(s)", + "angle" }, + { "display_hflip", OPT_VIDEO | OPT_BOOL | OPT_SPEC | OPT_INPUT, { .off = OFFSET(display_hflips) }, + "set display horizontal flip for stream(s) " + "(overrides any display rotation if it is not set)"}, + { "display_vflip", OPT_VIDEO | OPT_BOOL | OPT_SPEC | OPT_INPUT, { .off = OFFSET(display_vflips) }, + "set display vertical flip for stream(s) " + "(overrides any display rotation if it is not set)"}, { "vn", OPT_VIDEO | OPT_BOOL | OPT_OFFSET | OPT_INPUT | OPT_OUTPUT,{ .off = OFFSET(video_disable) }, "disable video" }, { "rc_override", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_STRING | OPT_SPEC | @@ -3868,8 +1600,10 @@ { "passlogfile", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(passlogfiles) }, "select two pass log file name prefix", "prefix" }, +#if FFMPEG_OPT_PSNR { "psnr", OPT_VIDEO | OPT_BOOL | OPT_EXPERT, { &do_psnr }, - "calculate PSNR of compressed frames" }, + "calculate PSNR of compressed frames (deprecated, use -flags +psnr)" }, +#endif { "vstats", OPT_VIDEO | OPT_EXPERT , { .func_arg = opt_vstats }, "dump video coding statistics to file" }, { "vstats_file", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { .func_arg = opt_vstats_file }, @@ -3907,8 +1641,6 @@ { "force_key_frames", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(forced_key_frames) }, "force key frames at specified timestamps", "timestamps" }, - { "ab", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_bitrate }, - "audio bitrate (please use -b:a)", "bitrate" }, { "b", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_bitrate }, "video bitrate (please use -b:v)", "bitrate" }, { "hwaccel", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT | @@ -3928,6 +1660,11 @@ { "autoscale", HAS_ARG | OPT_BOOL | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(autoscale) }, "automatically insert a scale filter at the end of the filter graph" }, + { "fix_sub_duration_heartbeat", OPT_VIDEO | OPT_BOOL | OPT_EXPERT | + OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(fix_sub_duration_heartbeat) }, + "set this video output stream to be a heartbeat stream for " + "fix_sub_duration, according to which subtitles should be split at " + "random access points" }, /* audio options */ { "aframes", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_audio_frames }, @@ -3945,11 +1682,11 @@ { "acodec", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_audio_codec }, "force audio codec ('copy' to copy stream)", "codec" }, + { "ab", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_bitrate }, + "audio bitrate (please use -b:a)", "bitrate" }, { "atag", OPT_AUDIO | HAS_ARG | OPT_EXPERT | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_old2new }, "force audio tag/fourcc", "fourcc/tag" }, - { "vol", OPT_AUDIO | HAS_ARG | OPT_INT, { &audio_volume }, - "change audio volume (256=normal)" , "volume" }, { "sample_fmt", OPT_AUDIO | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_STRING | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(sample_fmts) }, "set sample format", "format" }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffplay.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffplay.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffplay.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffplay.c 2023-03-03 13:29:59.000000000 +0000 @@ -1860,7 +1860,7 @@ } pix_fmts[nb_pix_fmts] = AV_PIX_FMT_NONE; - while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) { + while ((e = av_dict_iterate(sws_dict, e))) { if (!strcmp(e->key, "sws_flags")) { av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value); } else @@ -1915,8 +1915,14 @@ } while (0) if (autorotate) { - int32_t *displaymatrix = (int32_t *)av_stream_get_side_data(is->video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); - double theta = get_rotation(displaymatrix); + double theta = 0.0; + int32_t *displaymatrix = NULL; + AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX); + if (sd) + displaymatrix = (int32_t *)sd->data; + if (!displaymatrix) + displaymatrix = (int32_t *)av_stream_get_side_data(is->video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); + theta = get_rotation(displaymatrix); if (fabs(theta - 90) < 1.0) { INSERT_FILT("transpose", "clock"); @@ -1960,7 +1966,7 @@ av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); - while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX))) + while ((e = av_dict_iterate(swr_opts, e))) av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value); if (strlen(aresample_swr_opts)) aresample_swr_opts[strlen(aresample_swr_opts)-1] = '\0'; @@ -3531,7 +3537,7 @@ exit(1); } if (!strcmp(filename, "-")) - filename = "pipe:"; + filename = "fd:"; input_filename = filename; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffprobe.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffprobe.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffprobe.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/ffprobe.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,11 +27,13 @@ #include "libavutil/ffversion.h" #include +#include #include "libavformat/avformat.h" #include "libavformat/version.h" #include "libavcodec/avcodec.h" #include "libavcodec/version.h" +#include "libavutil/ambient_viewing_environment.h" #include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" @@ -655,7 +657,7 @@ goto fail; } - while ((opt = av_dict_get(opts, "", opt, AV_DICT_IGNORE_SUFFIX))) { + while ((opt = av_dict_iterate(opts, opt))) { if ((ret = av_opt_set(*wctx, opt->key, opt->value, AV_OPT_SEARCH_CHILDREN)) < 0) { av_log(*wctx, AV_LOG_ERROR, "Failed to set option '%s' with value '%s' provided to writer context\n", opt->key, opt->value); @@ -1896,12 +1898,14 @@ writer_print_string(w, k, pbuf.str, 0); \ } while (0) -#define print_list_fmt(k, f, n, ...) do { \ +#define print_list_fmt(k, f, n, m, ...) do { \ av_bprint_clear(&pbuf); \ for (int idx = 0; idx < n; idx++) { \ - if (idx > 0) \ - av_bprint_chars(&pbuf, ' ', 1); \ - av_bprintf(&pbuf, f, __VA_ARGS__); \ + for (int idx2 = 0; idx2 < m; idx2++) { \ + if (idx > 0 || idx2 > 0) \ + av_bprint_chars(&pbuf, ' ', 1); \ + av_bprintf(&pbuf, f, __VA_ARGS__); \ + } \ } \ writer_print_string(w, k, pbuf.str, 0); \ } while (0) @@ -1942,7 +1946,7 @@ return 0; writer_print_section_header(w, section_id); - while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(tags, tag))) { if ((ret = print_str_validate(tag->key, tag->value)) < 0) break; } @@ -2012,7 +2016,7 @@ const AVDOVIReshapingCurve *curve = &mapping->curves[c]; writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_COMPONENT); - print_list_fmt("pivots", "%"PRIu16, curve->num_pivots, curve->pivots[idx]); + print_list_fmt("pivots", "%"PRIu16, curve->num_pivots, 1, curve->pivots[idx]); writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST); for (int i = 0; i < curve->num_pivots - 1; i++) { @@ -2024,7 +2028,7 @@ print_str("mapping_idc_name", "polynomial"); print_int("poly_order", curve->poly_order[i]); print_list_fmt("poly_coef", "%"PRIi64, - curve->poly_order[i] + 1, + curve->poly_order[i] + 1, 1, curve->poly_coef[i][idx]); break; case AV_DOVI_MAPPING_MMR: @@ -2032,8 +2036,8 @@ print_int("mmr_order", curve->mmr_order[i]); print_int("mmr_constant", curve->mmr_constant[i]); print_list_fmt("mmr_coef", "%"PRIi64, - curve->mmr_order[i] * 7, - curve->mmr_coef[i][0][idx]); + curve->mmr_order[i], 7, + curve->mmr_coef[i][idx][idx2]); break; default: print_str("mapping_idc_name", "unknown"); @@ -2071,15 +2075,15 @@ print_int("dm_metadata_id", color->dm_metadata_id); print_int("scene_refresh_flag", color->scene_refresh_flag); print_list_fmt("ycc_to_rgb_matrix", "%d/%d", - FF_ARRAY_ELEMS(color->ycc_to_rgb_matrix), + FF_ARRAY_ELEMS(color->ycc_to_rgb_matrix), 1, color->ycc_to_rgb_matrix[idx].num, color->ycc_to_rgb_matrix[idx].den); print_list_fmt("ycc_to_rgb_offset", "%d/%d", - FF_ARRAY_ELEMS(color->ycc_to_rgb_offset), + FF_ARRAY_ELEMS(color->ycc_to_rgb_offset), 1, color->ycc_to_rgb_offset[idx].num, color->ycc_to_rgb_offset[idx].den); print_list_fmt("rgb_to_lms_matrix", "%d/%d", - FF_ARRAY_ELEMS(color->rgb_to_lms_matrix), + FF_ARRAY_ELEMS(color->rgb_to_lms_matrix), 1, color->rgb_to_lms_matrix[idx].num, color->rgb_to_lms_matrix[idx].den); print_int("signal_eotf", color->signal_eotf); @@ -2265,6 +2269,17 @@ } } +static void print_ambient_viewing_environment(WriterContext *w, + const AVAmbientViewingEnvironment *env) +{ + if (!env) + return; + + print_q("ambient_illuminance", env->ambient_illuminance, '/'); + print_q("ambient_light_x", env->ambient_light_x, '/'); + print_q("ambient_light_y", env->ambient_light_y, '/'); +} + static void print_pkt_side_data(WriterContext *w, AVCodecParameters *par, const AVPacketSideData *side_data, @@ -2282,8 +2297,11 @@ writer_print_section_header(w, id_data); print_str("side_data_type", name ? name : "unknown"); if (sd->type == AV_PKT_DATA_DISPLAYMATRIX && sd->size >= 9*4) { + double rotation = av_display_rotation_get((int32_t *)sd->data); + if (isnan(rotation)) + rotation = 0; writer_print_integers(w, "displaymatrix", sd->data, 9, " %11d", 3, 4, 1); - print_int("rotation", av_display_rotation_get((int32_t *)sd->data)); + print_int("rotation", rotation); } else if (sd->type == AV_PKT_DATA_STEREO3D) { const AVStereo3D *stereo = (AVStereo3D *)sd->data; print_str("type", av_stereo3d_type_name(stereo->type)); @@ -2495,8 +2513,12 @@ print_val("size", pkt->size, unit_byte_str); if (pkt->pos != -1) print_fmt ("pos", "%"PRId64, pkt->pos); else print_str_opt("pos", "N/A"); - print_fmt("flags", "%c%c", pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_', - pkt->flags & AV_PKT_FLAG_DISCARD ? 'D' : '_'); + print_fmt("flags", "%c%c%c", pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_', + pkt->flags & AV_PKT_FLAG_DISCARD ? 'D' : '_', + pkt->flags & AV_PKT_FLAG_CORRUPT ? 'C' : '_'); + if (do_show_data) + writer_print_data(w, "data", pkt->data, pkt->size); + writer_print_data_hash(w, "data_hash", pkt->data, pkt->size); if (pkt->side_data_elems) { size_t size; @@ -2515,9 +2537,6 @@ SECTION_ID_PACKET_SIDE_DATA); } - if (do_show_data) - writer_print_data(w, "data", pkt->data, pkt->size); - writer_print_data_hash(w, "data_hash", pkt->data, pkt->size); writer_print_section_footer(w); av_bprint_finalize(&pbuf, NULL); @@ -2570,8 +2589,14 @@ print_time("pkt_dts_time", frame->pkt_dts, &stream->time_base); print_ts ("best_effort_timestamp", frame->best_effort_timestamp); print_time("best_effort_timestamp_time", frame->best_effort_timestamp, &stream->time_base); +#if LIBAVUTIL_VERSION_MAJOR < 59 + AV_NOWARN_DEPRECATED( print_duration_ts ("pkt_duration", frame->pkt_duration); print_duration_time("pkt_duration_time", frame->pkt_duration, &stream->time_base); + ) +#endif + print_duration_ts ("duration", frame->duration); + print_duration_time("duration_time", frame->duration, &stream->time_base); if (frame->pkt_pos != -1) print_fmt ("pkt_pos", "%"PRId64, frame->pkt_pos); else print_str_opt("pkt_pos", "N/A"); if (frame->pkt_size != -1) print_val ("pkt_size", frame->pkt_size, unit_byte_str); @@ -2593,8 +2618,12 @@ print_str_opt("sample_aspect_ratio", "N/A"); } print_fmt("pict_type", "%c", av_get_picture_type_char(frame->pict_type)); +#if LIBAVUTIL_VERSION_MAJOR < 59 + AV_NOWARN_DEPRECATED( print_int("coded_picture_number", frame->coded_picture_number); print_int("display_picture_number", frame->display_picture_number); + ) +#endif print_int("interlaced_frame", frame->interlaced_frame); print_int("top_field_first", frame->top_field_first); print_int("repeat_pict", frame->repeat_pict); @@ -2633,8 +2662,11 @@ name = av_frame_side_data_name(sd->type); print_str("side_data_type", name ? name : "unknown"); if (sd->type == AV_FRAME_DATA_DISPLAYMATRIX && sd->size >= 9*4) { + double rotation = av_display_rotation_get((int32_t *)sd->data); + if (isnan(rotation)) + rotation = 0; writer_print_integers(w, "displaymatrix", sd->data, 9, " %11d", 3, 4, 1); - print_int("rotation", av_display_rotation_get((int32_t *)sd->data)); + print_int("rotation", rotation); } else if (sd->type == AV_FRAME_DATA_AFD && sd->size > 0) { print_int("active_format", *sd->data); } else if (sd->type == AV_FRAME_DATA_GOP_TIMECODE && sd->size >= 8) { @@ -2689,6 +2721,9 @@ } else if (sd->type == AV_FRAME_DATA_DYNAMIC_HDR_VIVID) { AVDynamicHDRVivid *metadata = (AVDynamicHDRVivid *)sd->data; print_dynamic_hdr_vivid(w, metadata); + } else if (sd->type == AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT) { + print_ambient_viewing_environment( + w, (const AVAmbientViewingEnvironment *)sd->data); } writer_print_section_footer(w); } @@ -2703,7 +2738,7 @@ static av_always_inline int process_frame(WriterContext *w, InputFile *ifile, - AVFrame *frame, AVPacket *pkt, + AVFrame *frame, const AVPacket *pkt, int *packet_new) { AVFormatContext *fmt_ctx = ifile->fmt_ctx; @@ -2844,9 +2879,10 @@ } if (selected_streams[pkt->stream_index]) { AVRational tb = ifile->streams[pkt->stream_index].st->time_base; + int64_t pts = pkt->pts != AV_NOPTS_VALUE ? pkt->pts : pkt->dts; - if (pkt->pts != AV_NOPTS_VALUE) - *cur_ts = av_rescale_q(pkt->pts, tb, AV_TIME_BASE_Q); + if (pts != AV_NOPTS_VALUE) + *cur_ts = av_rescale_q(pts, tb, AV_TIME_BASE_Q); if (!has_start && *cur_ts != AV_NOPTS_VALUE) { start = *cur_ts; @@ -2880,7 +2916,7 @@ } av_packet_unref(pkt); //Flush remaining frames that are cached in the decoder - for (i = 0; i < fmt_ctx->nb_streams; i++) { + for (i = 0; i < ifile->nb_streams; i++) { pkt->stream_index = i; if (do_read_frames) { while (process_frame(w, ifile, frame, pkt, &(int){1}) > 0); @@ -3038,6 +3074,8 @@ } print_int("bits_per_sample", av_get_bits_per_sample(par->codec_id)); + + print_int("initial_padding", par->initial_padding); break; case AVMEDIA_TYPE_SUBTITLE: @@ -3264,15 +3302,9 @@ static void show_error(WriterContext *w, int err) { - char errbuf[128]; - const char *errbuf_ptr = errbuf; - - if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) - errbuf_ptr = strerror(AVUNERROR(err)); - writer_print_section_header(w, SECTION_ID_ERROR); print_int("code", err); - print_str("string", errbuf_ptr); + print_str("string", av_err2str(err)); writer_print_section_footer(w); } @@ -3285,10 +3317,8 @@ int scan_all_pmts_set = 0; fmt_ctx = avformat_alloc_context(); - if (!fmt_ctx) { - print_error(filename, AVERROR(ENOMEM)); - exit_program(1); - } + if (!fmt_ctx) + report_and_exit(AVERROR(ENOMEM)); if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); @@ -3306,7 +3336,7 @@ ifile->fmt_ctx = fmt_ctx; if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); - while ((t = av_dict_get(format_opts, "", t, AV_DICT_IGNORE_SUFFIX))) + while ((t = av_dict_iterate(format_opts, t))) av_log(NULL, AV_LOG_WARNING, "Option %s skipped - not known to demuxer.\n", t->key); if (find_stream_info) { @@ -3705,7 +3735,7 @@ exit_program(1); } if (!strcmp(arg, "-")) - arg = "pipe:"; + arg = "fd:"; input_filename = arg; } @@ -3724,7 +3754,7 @@ exit_program(1); } if (!strcmp(arg, "-")) - arg = "pipe:"; + arg = "fd:"; output_filename = arg; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftools.manifest mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftools.manifest --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftools.manifest 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftools.manifest 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + true + PerMonitorV2 + + + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftoolsres.rc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftoolsres.rc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftoolsres.rc 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/fftoolsres.rc 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,2 @@ +#include +1 RT_MANIFEST fftools.manifest diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -10,13 +10,21 @@ ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF)) OBJS-ffmpeg += \ + fftools/ffmpeg_demux.o \ fftools/ffmpeg_filter.o \ fftools/ffmpeg_hw.o \ fftools/ffmpeg_mux.o \ + fftools/ffmpeg_mux_init.o \ fftools/ffmpeg_opt.o \ + fftools/objpool.o \ + fftools/sync_queue.o \ + fftools/thread_queue.o \ define DOFFTOOL OBJS-$(1) += fftools/cmdutils.o fftools/opt_common.o fftools/$(1).o $(OBJS-$(1)-yes) +ifdef HAVE_GNU_WINDRES +OBJS-$(1) += fftools/fftoolsres.o +endif $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1)) $$(OBJS-$(1)): | fftools $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 "libavcodec/packet.h" + +#include "libavutil/common.h" +#include "libavutil/error.h" +#include "libavutil/frame.h" +#include "libavutil/mem.h" + +#include "objpool.h" + +struct ObjPool { + void *pool[32]; + unsigned int pool_count; + + ObjPoolCBAlloc alloc; + ObjPoolCBReset reset; + ObjPoolCBFree free; +}; + +ObjPool *objpool_alloc(ObjPoolCBAlloc cb_alloc, ObjPoolCBReset cb_reset, + ObjPoolCBFree cb_free) +{ + ObjPool *op = av_mallocz(sizeof(*op)); + + if (!op) + return NULL; + + op->alloc = cb_alloc; + op->reset = cb_reset; + op->free = cb_free; + + return op; +} + +void objpool_free(ObjPool **pop) +{ + ObjPool *op = *pop; + + if (!op) + return; + + for (unsigned int i = 0; i < op->pool_count; i++) + op->free(&op->pool[i]); + + av_freep(pop); +} + +int objpool_get(ObjPool *op, void **obj) +{ + if (op->pool_count) { + *obj = op->pool[--op->pool_count]; + op->pool[op->pool_count] = NULL; + } else + *obj = op->alloc(); + + return *obj ? 0 : AVERROR(ENOMEM); +} + +void objpool_release(ObjPool *op, void **obj) +{ + if (!*obj) + return; + + op->reset(*obj); + + if (op->pool_count < FF_ARRAY_ELEMS(op->pool)) + op->pool[op->pool_count++] = *obj; + else + op->free(obj); + + *obj = NULL; +} + +static void *alloc_packet(void) +{ + return av_packet_alloc(); +} +static void *alloc_frame(void) +{ + return av_frame_alloc(); +} + +static void reset_packet(void *obj) +{ + av_packet_unref(obj); +} +static void reset_frame(void *obj) +{ + av_frame_unref(obj); +} + +static void free_packet(void **obj) +{ + AVPacket *pkt = *obj; + av_packet_free(&pkt); + *obj = NULL; +} +static void free_frame(void **obj) +{ + AVFrame *frame = *obj; + av_frame_free(&frame); + *obj = NULL; +} + +ObjPool *objpool_alloc_packets(void) +{ + return objpool_alloc(alloc_packet, reset_packet, free_packet); +} +ObjPool *objpool_alloc_frames(void) +{ + return objpool_alloc(alloc_frame, reset_frame, free_frame); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/objpool.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FFTOOLS_OBJPOOL_H +#define FFTOOLS_OBJPOOL_H + +typedef struct ObjPool ObjPool; + +typedef void* (*ObjPoolCBAlloc)(void); +typedef void (*ObjPoolCBReset)(void *); +typedef void (*ObjPoolCBFree)(void **); + +void objpool_free(ObjPool **op); +ObjPool *objpool_alloc(ObjPoolCBAlloc cb_alloc, ObjPoolCBReset cb_reset, + ObjPoolCBFree cb_free); +ObjPool *objpool_alloc_packets(void); +ObjPool *objpool_alloc_frames(void); + +int objpool_get(ObjPool *op, void **obj); +void objpool_release(ObjPool *op, void **obj); + +#endif // FFTOOLS_OBJPOOL_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/opt_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/opt_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/opt_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/opt_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -335,9 +335,12 @@ printf(" Supported hardware devices: "); for (int i = 0;; i++) { const AVCodecHWConfig *config = avcodec_get_hw_config(c, i); + const char *name; if (!config) break; - printf("%s ", av_hwdevice_get_type_name(config->device_type)); + name = av_hwdevice_get_type_name(config->device_type); + if (name) + printf("%s ", name); } printf("\n"); } @@ -639,10 +642,8 @@ while ((desc = avcodec_descriptor_next(desc))) nb_codecs++; - if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) { - av_log(NULL, AV_LOG_ERROR, "Out of memory\n"); - exit_program(1); - } + if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) + report_and_exit(AVERROR(ENOMEM)); desc = NULL; while ((desc = avcodec_descriptor_next(desc))) codecs[i++] = desc; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,448 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/avassert.h" +#include "libavutil/error.h" +#include "libavutil/fifo.h" +#include "libavutil/mathematics.h" +#include "libavutil/mem.h" + +#include "objpool.h" +#include "sync_queue.h" + +typedef struct SyncQueueStream { + AVFifo *fifo; + AVRational tb; + + /* stream head: largest timestamp seen */ + int64_t head_ts; + int limiting; + /* no more frames will be sent for this stream */ + int finished; + + uint64_t frames_sent; + uint64_t frames_max; +} SyncQueueStream; + +struct SyncQueue { + enum SyncQueueType type; + + /* no more frames will be sent for any stream */ + int finished; + /* sync head: the stream with the _smallest_ head timestamp + * this stream determines which frames can be output */ + int head_stream; + /* the finished stream with the smallest finish timestamp or -1 */ + int head_finished_stream; + + // maximum buffering duration in microseconds + int64_t buf_size_us; + + SyncQueueStream *streams; + unsigned int nb_streams; + + // pool of preallocated frames to avoid constant allocations + ObjPool *pool; +}; + +static void frame_move(const SyncQueue *sq, SyncQueueFrame dst, + SyncQueueFrame src) +{ + if (sq->type == SYNC_QUEUE_PACKETS) + av_packet_move_ref(dst.p, src.p); + else + av_frame_move_ref(dst.f, src.f); +} + +static int64_t frame_ts(const SyncQueue *sq, SyncQueueFrame frame) +{ + return (sq->type == SYNC_QUEUE_PACKETS) ? + frame.p->pts + frame.p->duration : + frame.f->pts + frame.f->duration; +} + +static int frame_null(const SyncQueue *sq, SyncQueueFrame frame) +{ + return (sq->type == SYNC_QUEUE_PACKETS) ? (frame.p == NULL) : (frame.f == NULL); +} + +static void finish_stream(SyncQueue *sq, unsigned int stream_idx) +{ + SyncQueueStream *st = &sq->streams[stream_idx]; + + st->finished = 1; + + if (st->limiting && st->head_ts != AV_NOPTS_VALUE) { + /* check if this stream is the new finished head */ + if (sq->head_finished_stream < 0 || + av_compare_ts(st->head_ts, st->tb, + sq->streams[sq->head_finished_stream].head_ts, + sq->streams[sq->head_finished_stream].tb) < 0) { + sq->head_finished_stream = stream_idx; + } + + /* mark as finished all streams that should no longer receive new frames, + * due to them being ahead of some finished stream */ + st = &sq->streams[sq->head_finished_stream]; + for (unsigned int i = 0; i < sq->nb_streams; i++) { + SyncQueueStream *st1 = &sq->streams[i]; + if (st != st1 && st1->head_ts != AV_NOPTS_VALUE && + av_compare_ts(st->head_ts, st->tb, st1->head_ts, st1->tb) <= 0) + st1->finished = 1; + } + } + + /* mark the whole queue as finished if all streams are finished */ + for (unsigned int i = 0; i < sq->nb_streams; i++) { + if (!sq->streams[i].finished) + return; + } + sq->finished = 1; +} + +static void queue_head_update(SyncQueue *sq) +{ + if (sq->head_stream < 0) { + /* wait for one timestamp in each stream before determining + * the queue head */ + for (unsigned int i = 0; i < sq->nb_streams; i++) { + SyncQueueStream *st = &sq->streams[i]; + if (st->limiting && st->head_ts == AV_NOPTS_VALUE) + return; + } + + // placeholder value, correct one will be found below + sq->head_stream = 0; + } + + for (unsigned int i = 0; i < sq->nb_streams; i++) { + SyncQueueStream *st_head = &sq->streams[sq->head_stream]; + SyncQueueStream *st_other = &sq->streams[i]; + if (st_other->limiting && st_other->head_ts != AV_NOPTS_VALUE && + av_compare_ts(st_other->head_ts, st_other->tb, + st_head->head_ts, st_head->tb) < 0) + sq->head_stream = i; + } +} + +/* update this stream's head timestamp */ +static void stream_update_ts(SyncQueue *sq, unsigned int stream_idx, int64_t ts) +{ + SyncQueueStream *st = &sq->streams[stream_idx]; + + if (ts == AV_NOPTS_VALUE || + (st->head_ts != AV_NOPTS_VALUE && st->head_ts >= ts)) + return; + + st->head_ts = ts; + + /* if this stream is now ahead of some finished stream, then + * this stream is also finished */ + if (sq->head_finished_stream >= 0 && + av_compare_ts(sq->streams[sq->head_finished_stream].head_ts, + sq->streams[sq->head_finished_stream].tb, + ts, st->tb) <= 0) + finish_stream(sq, stream_idx); + + /* update the overall head timestamp if it could have changed */ + if (st->limiting && + (sq->head_stream < 0 || sq->head_stream == stream_idx)) + queue_head_update(sq); +} + +/* If the queue for the given stream (or all streams when stream_idx=-1) + * is overflowing, trigger a fake heartbeat on lagging streams. + * + * @return 1 if heartbeat triggered, 0 otherwise + */ +static int overflow_heartbeat(SyncQueue *sq, int stream_idx) +{ + SyncQueueStream *st; + SyncQueueFrame frame; + int64_t tail_ts = AV_NOPTS_VALUE; + + /* if no stream specified, pick the one that is most ahead */ + if (stream_idx < 0) { + int64_t ts = AV_NOPTS_VALUE; + + for (int i = 0; i < sq->nb_streams; i++) { + st = &sq->streams[i]; + if (st->head_ts != AV_NOPTS_VALUE && + (ts == AV_NOPTS_VALUE || + av_compare_ts(ts, sq->streams[stream_idx].tb, + st->head_ts, st->tb) < 0)) { + ts = st->head_ts; + stream_idx = i; + } + } + /* no stream has a timestamp yet -> nothing to do */ + if (stream_idx < 0) + return 0; + } + + st = &sq->streams[stream_idx]; + + /* get the chosen stream's tail timestamp */ + for (size_t i = 0; tail_ts == AV_NOPTS_VALUE && + av_fifo_peek(st->fifo, &frame, 1, i) >= 0; i++) + tail_ts = frame_ts(sq, frame); + + /* overflow triggers when the tail is over specified duration behind the head */ + if (tail_ts == AV_NOPTS_VALUE || tail_ts >= st->head_ts || + av_rescale_q(st->head_ts - tail_ts, st->tb, AV_TIME_BASE_Q) < sq->buf_size_us) + return 0; + + /* signal a fake timestamp for all streams that prevent tail_ts from being output */ + tail_ts++; + for (unsigned int i = 0; i < sq->nb_streams; i++) { + SyncQueueStream *st1 = &sq->streams[i]; + int64_t ts; + + if (st == st1 || st1->finished || + (st1->head_ts != AV_NOPTS_VALUE && + av_compare_ts(tail_ts, st->tb, st1->head_ts, st1->tb) <= 0)) + continue; + + ts = av_rescale_q(tail_ts, st->tb, st1->tb); + if (st1->head_ts != AV_NOPTS_VALUE) + ts = FFMAX(st1->head_ts + 1, ts); + + stream_update_ts(sq, i, ts); + } + + return 1; +} + +int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame) +{ + SyncQueueStream *st; + SyncQueueFrame dst; + int64_t ts; + int ret; + + av_assert0(stream_idx < sq->nb_streams); + st = &sq->streams[stream_idx]; + + av_assert0(st->tb.num > 0 && st->tb.den > 0); + + if (frame_null(sq, frame)) { + finish_stream(sq, stream_idx); + return 0; + } + if (st->finished) + return AVERROR_EOF; + + ret = objpool_get(sq->pool, (void**)&dst); + if (ret < 0) + return ret; + + frame_move(sq, dst, frame); + + ts = frame_ts(sq, dst); + + ret = av_fifo_write(st->fifo, &dst, 1); + if (ret < 0) { + frame_move(sq, frame, dst); + objpool_release(sq->pool, (void**)&dst); + return ret; + } + + stream_update_ts(sq, stream_idx, ts); + + st->frames_sent++; + if (st->frames_sent >= st->frames_max) + finish_stream(sq, stream_idx); + + return 0; +} + +static int receive_for_stream(SyncQueue *sq, unsigned int stream_idx, + SyncQueueFrame frame) +{ + SyncQueueStream *st_head = sq->head_stream >= 0 ? + &sq->streams[sq->head_stream] : NULL; + SyncQueueStream *st; + + av_assert0(stream_idx < sq->nb_streams); + st = &sq->streams[stream_idx]; + + if (av_fifo_can_read(st->fifo)) { + SyncQueueFrame peek; + int64_t ts; + int cmp = 1; + + av_fifo_peek(st->fifo, &peek, 1, 0); + ts = frame_ts(sq, peek); + + /* check if this stream's tail timestamp does not overtake + * the overall queue head */ + if (ts != AV_NOPTS_VALUE && st_head) + cmp = av_compare_ts(ts, st->tb, st_head->head_ts, st_head->tb); + + /* We can release frames that do not end after the queue head. + * Frames with no timestamps are just passed through with no conditions. + */ + if (cmp <= 0 || ts == AV_NOPTS_VALUE) { + frame_move(sq, frame, peek); + objpool_release(sq->pool, (void**)&peek); + av_fifo_drain2(st->fifo, 1); + return 0; + } + } + + return (sq->finished || (st->finished && !av_fifo_can_read(st->fifo))) ? + AVERROR_EOF : AVERROR(EAGAIN); +} + +static int receive_internal(SyncQueue *sq, int stream_idx, SyncQueueFrame frame) +{ + int nb_eof = 0; + int ret; + + /* read a frame for a specific stream */ + if (stream_idx >= 0) { + ret = receive_for_stream(sq, stream_idx, frame); + return (ret < 0) ? ret : stream_idx; + } + + /* read a frame for any stream with available output */ + for (unsigned int i = 0; i < sq->nb_streams; i++) { + ret = receive_for_stream(sq, i, frame); + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) { + nb_eof += (ret == AVERROR_EOF); + continue; + } + return (ret < 0) ? ret : i; + } + + return (nb_eof == sq->nb_streams) ? AVERROR_EOF : AVERROR(EAGAIN); +} + +int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame) +{ + int ret = receive_internal(sq, stream_idx, frame); + + /* try again if the queue overflowed and triggered a fake heartbeat + * for lagging streams */ + if (ret == AVERROR(EAGAIN) && overflow_heartbeat(sq, stream_idx)) + ret = receive_internal(sq, stream_idx, frame); + + return ret; +} + +int sq_add_stream(SyncQueue *sq, int limiting) +{ + SyncQueueStream *tmp, *st; + + tmp = av_realloc_array(sq->streams, sq->nb_streams + 1, sizeof(*sq->streams)); + if (!tmp) + return AVERROR(ENOMEM); + sq->streams = tmp; + + st = &sq->streams[sq->nb_streams]; + memset(st, 0, sizeof(*st)); + + st->fifo = av_fifo_alloc2(1, sizeof(SyncQueueFrame), AV_FIFO_FLAG_AUTO_GROW); + if (!st->fifo) + return AVERROR(ENOMEM); + + /* we set a valid default, so that a pathological stream that never + * receives even a real timebase (and no frames) won't stall all other + * streams forever; cf. overflow_heartbeat() */ + st->tb = (AVRational){ 1, 1 }; + st->head_ts = AV_NOPTS_VALUE; + st->frames_max = UINT64_MAX; + st->limiting = limiting; + + return sq->nb_streams++; +} + +void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb) +{ + SyncQueueStream *st; + + av_assert0(stream_idx < sq->nb_streams); + st = &sq->streams[stream_idx]; + + av_assert0(!av_fifo_can_read(st->fifo)); + + if (st->head_ts != AV_NOPTS_VALUE) + st->head_ts = av_rescale_q(st->head_ts, st->tb, tb); + + st->tb = tb; +} + +void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx, uint64_t frames) +{ + SyncQueueStream *st; + + av_assert0(stream_idx < sq->nb_streams); + st = &sq->streams[stream_idx]; + + st->frames_max = frames; + if (st->frames_sent >= st->frames_max) + finish_stream(sq, stream_idx); +} + +SyncQueue *sq_alloc(enum SyncQueueType type, int64_t buf_size_us) +{ + SyncQueue *sq = av_mallocz(sizeof(*sq)); + + if (!sq) + return NULL; + + sq->type = type; + sq->buf_size_us = buf_size_us; + + sq->head_stream = -1; + sq->head_finished_stream = -1; + + sq->pool = (type == SYNC_QUEUE_PACKETS) ? objpool_alloc_packets() : + objpool_alloc_frames(); + if (!sq->pool) { + av_freep(&sq); + return NULL; + } + + return sq; +} + +void sq_free(SyncQueue **psq) +{ + SyncQueue *sq = *psq; + + if (!sq) + return; + + for (unsigned int i = 0; i < sq->nb_streams; i++) { + SyncQueueFrame frame; + while (av_fifo_read(sq->streams[i].fifo, &frame, 1) >= 0) + objpool_release(sq->pool, (void**)&frame); + + av_fifo_freep2(&sq->streams[i].fifo); + } + + av_freep(&sq->streams); + + objpool_free(&sq->pool); + + av_freep(psq); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/sync_queue.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,109 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 FFTOOLS_SYNC_QUEUE_H +#define FFTOOLS_SYNC_QUEUE_H + +#include + +#include "libavcodec/packet.h" + +#include "libavutil/frame.h" + +enum SyncQueueType { + SYNC_QUEUE_PACKETS, + SYNC_QUEUE_FRAMES, +}; + +typedef union SyncQueueFrame { + AVFrame *f; + AVPacket *p; +} SyncQueueFrame; + +#define SQFRAME(frame) ((SyncQueueFrame){ .f = (frame) }) +#define SQPKT(pkt) ((SyncQueueFrame){ .p = (pkt) }) + +typedef struct SyncQueue SyncQueue; + +/** + * Allocate a sync queue of the given type. + * + * @param buf_size_us maximum duration that will be buffered in microseconds + */ +SyncQueue *sq_alloc(enum SyncQueueType type, int64_t buf_size_us); +void sq_free(SyncQueue **sq); + +/** + * Add a new stream to the sync queue. + * + * @param limiting whether the stream is limiting, i.e. no other stream can be + * longer than this one + * @return + * - a non-negative stream index on success + * - a negative error code on error + */ +int sq_add_stream(SyncQueue *sq, int limiting); + +/** + * Set the timebase for the stream with index stream_idx. Should be called + * before sending any frames for this stream. + */ +void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb); + +/** + * Limit the number of output frames for stream with index stream_idx + * to max_frames. + */ +void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx, + uint64_t max_frames); + +/** + * Submit a frame for the stream with index stream_idx. + * + * On success, the sync queue takes ownership of the frame and will reset the + * contents of the supplied frame. On failure, the frame remains owned by the + * caller. + * + * Sending a frame with NULL contents marks the stream as finished. + * + * @return + * - 0 on success + * - AVERROR_EOF when no more frames should be submitted for this stream + * - another a negative error code on failure + */ +int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame); + +/** + * Read a frame from the queue. + * + * @param stream_idx index of the stream to read a frame for. May be -1, then + * try to read a frame from any stream that is ready for + * output. + * @param frame output frame will be written here on success. The frame is owned + * by the caller. + * + * @return + * - a non-negative index of the stream to which the returned frame belongs + * - AVERROR(EAGAIN) when more frames need to be submitted to the queue + * - AVERROR_EOF when no more frames will be available for this stream (for any + * stream if stream_idx is -1) + * - another negative error code on failure + */ +int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame); + +#endif // FFTOOLS_SYNC_QUEUE_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,245 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/avassert.h" +#include "libavutil/error.h" +#include "libavutil/fifo.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/mem.h" +#include "libavutil/thread.h" + +#include "objpool.h" +#include "thread_queue.h" + +enum { + FINISHED_SEND = (1 << 0), + FINISHED_RECV = (1 << 1), +}; + +typedef struct FifoElem { + void *obj; + unsigned int stream_idx; +} FifoElem; + +struct ThreadQueue { + int *finished; + unsigned int nb_streams; + + AVFifo *fifo; + + ObjPool *obj_pool; + void (*obj_move)(void *dst, void *src); + + pthread_mutex_t lock; + pthread_cond_t cond; +}; + +void tq_free(ThreadQueue **ptq) +{ + ThreadQueue *tq = *ptq; + + if (!tq) + return; + + if (tq->fifo) { + FifoElem elem; + while (av_fifo_read(tq->fifo, &elem, 1) >= 0) + objpool_release(tq->obj_pool, &elem.obj); + } + av_fifo_freep2(&tq->fifo); + + objpool_free(&tq->obj_pool); + + av_freep(&tq->finished); + + pthread_cond_destroy(&tq->cond); + pthread_mutex_destroy(&tq->lock); + + av_freep(ptq); +} + +ThreadQueue *tq_alloc(unsigned int nb_streams, size_t queue_size, + ObjPool *obj_pool, void (*obj_move)(void *dst, void *src)) +{ + ThreadQueue *tq; + int ret; + + tq = av_mallocz(sizeof(*tq)); + if (!tq) + return NULL; + + ret = pthread_cond_init(&tq->cond, NULL); + if (ret) { + av_freep(&tq); + return NULL; + } + + ret = pthread_mutex_init(&tq->lock, NULL); + if (ret) { + pthread_cond_destroy(&tq->cond); + av_freep(&tq); + return NULL; + } + + tq->finished = av_calloc(nb_streams, sizeof(*tq->finished)); + if (!tq->finished) + goto fail; + tq->nb_streams = nb_streams; + + tq->fifo = av_fifo_alloc2(queue_size, sizeof(FifoElem), 0); + if (!tq->fifo) + goto fail; + + tq->obj_pool = obj_pool; + tq->obj_move = obj_move; + + return tq; +fail: + tq_free(&tq); + return NULL; +} + +int tq_send(ThreadQueue *tq, unsigned int stream_idx, void *data) +{ + int *finished; + int ret; + + av_assert0(stream_idx < tq->nb_streams); + finished = &tq->finished[stream_idx]; + + pthread_mutex_lock(&tq->lock); + + if (*finished & FINISHED_SEND) { + ret = AVERROR(EINVAL); + goto finish; + } + + while (!(*finished & FINISHED_RECV) && !av_fifo_can_write(tq->fifo)) + pthread_cond_wait(&tq->cond, &tq->lock); + + if (*finished & FINISHED_RECV) { + ret = AVERROR_EOF; + *finished |= FINISHED_SEND; + } else { + FifoElem elem = { .stream_idx = stream_idx }; + + ret = objpool_get(tq->obj_pool, &elem.obj); + if (ret < 0) + goto finish; + + tq->obj_move(elem.obj, data); + + ret = av_fifo_write(tq->fifo, &elem, 1); + av_assert0(ret >= 0); + pthread_cond_broadcast(&tq->cond); + } + +finish: + pthread_mutex_unlock(&tq->lock); + + return ret; +} + +static int receive_locked(ThreadQueue *tq, int *stream_idx, + void *data) +{ + FifoElem elem; + unsigned int nb_finished = 0; + + if (av_fifo_read(tq->fifo, &elem, 1) >= 0) { + tq->obj_move(data, elem.obj); + objpool_release(tq->obj_pool, &elem.obj); + *stream_idx = elem.stream_idx; + return 0; + } + + for (unsigned int i = 0; i < tq->nb_streams; i++) { + if (!(tq->finished[i] & FINISHED_SEND)) + continue; + + /* return EOF to the consumer at most once for each stream */ + if (!(tq->finished[i] & FINISHED_RECV)) { + tq->finished[i] |= FINISHED_RECV; + *stream_idx = i; + return AVERROR_EOF; + } + + nb_finished++; + } + + return nb_finished == tq->nb_streams ? AVERROR_EOF : AVERROR(EAGAIN); +} + +int tq_receive(ThreadQueue *tq, int *stream_idx, void *data) +{ + int ret; + + *stream_idx = -1; + + pthread_mutex_lock(&tq->lock); + + while (1) { + ret = receive_locked(tq, stream_idx, data); + if (ret == AVERROR(EAGAIN)) { + pthread_cond_wait(&tq->cond, &tq->lock); + continue; + } + + break; + } + + if (ret == 0) + pthread_cond_broadcast(&tq->cond); + + pthread_mutex_unlock(&tq->lock); + + return ret; +} + +void tq_send_finish(ThreadQueue *tq, unsigned int stream_idx) +{ + av_assert0(stream_idx < tq->nb_streams); + + pthread_mutex_lock(&tq->lock); + + /* mark the stream as send-finished; + * next time the consumer thread tries to read this stream it will get + * an EOF and recv-finished flag will be set */ + tq->finished[stream_idx] |= FINISHED_SEND; + pthread_cond_broadcast(&tq->cond); + + pthread_mutex_unlock(&tq->lock); +} + +void tq_receive_finish(ThreadQueue *tq, unsigned int stream_idx) +{ + av_assert0(stream_idx < tq->nb_streams); + + pthread_mutex_lock(&tq->lock); + + /* mark the stream as recv-finished; + * next time the producer thread tries to send for this stream, it will + * get an EOF and send-finished flag will be set */ + tq->finished[stream_idx] |= FINISHED_RECV; + pthread_cond_broadcast(&tq->cond); + + pthread_mutex_unlock(&tq->lock); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/fftools/thread_queue.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FFTOOLS_THREAD_QUEUE_H +#define FFTOOLS_THREAD_QUEUE_H + +#include + +#include "objpool.h" + +typedef struct ThreadQueue ThreadQueue; + +/** + * Allocate a queue for sending data between threads. + * + * @param nb_streams number of streams for which a distinct EOF state is + * maintained + * @param queue_size number of items that can be stored in the queue without + * blocking + * @param obj_pool object pool that will be used to allocate items stored in the + * queue; the pool becomes owned by the queue + * @param callback that moves the contents between two data pointers + */ +ThreadQueue *tq_alloc(unsigned int nb_streams, size_t queue_size, + ObjPool *obj_pool, void (*obj_move)(void *dst, void *src)); +void tq_free(ThreadQueue **tq); + +/** + * Send an item for the given stream to the queue. + * + * @param data the item to send, its contents will be moved using the callback + * provided to tq_alloc(); on failure the item will be left + * untouched + * @return + * - 0 the item was successfully sent + * - AVERROR(ENOMEM) could not allocate an item for writing to the FIFO + * - AVERROR(EINVAL) the sending side has previously been marked as finished + * - AVERROR_EOF the receiving side has marked the given stream as finished + */ +int tq_send(ThreadQueue *tq, unsigned int stream_idx, void *data); +/** + * Mark the given stream finished from the sending side. + */ +void tq_send_finish(ThreadQueue *tq, unsigned int stream_idx); + +/** + * Read the next item from the queue. + * + * @param stream_idx the index of the stream that was processed or -1 will be + * written here + * @param data the data item will be written here on success using the + * callback provided to tq_alloc() + * @return + * - 0 a data item was successfully read; *stream_idx contains a non-negative + * stream index + * - AVERROR_EOF When *stream_idx is non-negative, this signals that the sending + * side has marked the given stream as finished. This will happen at most once + * for each stream. When *stream_idx is -1, all streams are done. + */ +int tq_receive(ThreadQueue *tq, int *stream_idx, void *data); +/** + * Mark the given stream finished from the receiving side. + */ +void tq_receive_finish(ThreadQueue *tq, unsigned int stream_idx); + +#endif // FFTOOLS_THREAD_QUEUE_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/012v.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/012v.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/012v.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/012v.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/intreadwrite.h" static av_cold int zero12v_decode_init(AVCodecContext *avctx) @@ -131,8 +131,8 @@ u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]); v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]); memcpy(y, y_temp, sizeof(*y) * (width - x)); - memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2); - memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2); + memcpy(u, u_temp, sizeof(*u) * ((width - x + 1) / 2)); + memcpy(v, v_temp, sizeof(*v) * ((width - x + 1) / 2)); } line_end += stride; @@ -146,11 +146,10 @@ const FFCodec ff_zero12v_decoder = { .p.name = "012v", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:2:2 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_012V, .init = zero12v_decode_init, FF_CODEC_DECODE_CB(zero12v_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/4xm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/4xm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/4xm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/4xm.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,8 +37,8 @@ #include "bswapdsp.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define BLOCK_TYPE_VLC_BITS 5 @@ -875,7 +875,7 @@ } for (i = 0; i < CFRAME_BUFFER_COUNT; i++) - if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number) + if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_num) av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id); @@ -910,9 +910,9 @@ buf = cfrm->data; frame_size = cfrm->size; - if (id != avctx->frame_number) - av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", - id, avctx->frame_number); + if (id != avctx->frame_num) + av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %"PRId64"\n", + id, avctx->frame_num); if (f->version <= 1) return AVERROR_INVALIDDATA; @@ -950,9 +950,11 @@ } else if (frame_4cc == AV_RL32("snd_")) { av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size); + return AVERROR_INVALIDDATA; } else { av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size); + return AVERROR_INVALIDDATA; } picture->key_frame = picture->pict_type == AV_PICTURE_TYPE_I; @@ -964,8 +966,6 @@ *got_frame = 1; - emms_c(); - return buf_size; } @@ -1012,7 +1012,7 @@ return AVERROR(ENOMEM); f->version = AV_RL32(avctx->extradata) >> 16; - ff_blockdsp_init(&f->bdsp, avctx); + ff_blockdsp_init(&f->bdsp); ff_bswapdsp_init(&f->bbdsp); f->avctx = avctx; @@ -1028,7 +1028,7 @@ const FFCodec ff_fourxm_decoder = { .p.name = "4xm", - .p.long_name = NULL_IF_CONFIG_SMALL("4X Movie"), + CODEC_LONG_NAME("4X Movie"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_4XM, .priv_data_size = sizeof(FourXContext), @@ -1036,5 +1036,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8bps.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8bps.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8bps.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8bps.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,16 +30,13 @@ * : RGB32 (RGB 32bpp, 4th plane is alpha) */ -#include -#include #include +#include "libavutil/bswap.h" #include "libavutil/internal.h" -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" static const enum AVPixelFormat pixfmt_rgb24[] = { @@ -71,7 +68,7 @@ unsigned char *planemap = c->planemap; int ret; - if (buf_size < planes * height *2) + if (buf_size < planes * height * 2) return AVERROR_INVALIDDATA; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) @@ -178,12 +175,11 @@ const FFCodec ff_eightbps_decoder = { .p.name = "8bps", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"), + CODEC_LONG_NAME("QuickTime 8BPS video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_8BPS, .priv_data_size = sizeof(EightBpsContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8svx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8svx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8svx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/8svx.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/common.h" /** decoder context */ @@ -151,7 +151,7 @@ *got_frame_ptr = 1; - return ((avctx->frame_number == 0) * hdr_size + buf_size) * channels; + return ((avctx->frame_num == 0) * hdr_size + buf_size) * channels; } static av_cold int eightsvx_decode_init(AVCodecContext *avctx) @@ -189,7 +189,7 @@ #if CONFIG_EIGHTSVX_FIB_DECODER const FFCodec ff_eightsvx_fib_decoder = { .p.name = "8svx_fib", - .p.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"), + CODEC_LONG_NAME("8SVX fibonacci"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_8SVX_FIB, .priv_data_size = sizeof (EightSvxContext), @@ -199,13 +199,12 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_EIGHTSVX_EXP_DECODER const FFCodec ff_eightsvx_exp_decoder = { .p.name = "8svx_exp", - .p.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"), + CODEC_LONG_NAME("8SVX exponential"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_8SVX_EXP, .priv_data_size = sizeof (EightSvxContext), @@ -215,6 +214,5 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/a64multienc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/a64multienc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/a64multienc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/a64multienc.c 2023-03-03 13:29:59.000000000 +0000 @@ -76,7 +76,7 @@ int luma = 0; int height = FFMIN(avctx->height, C64YRES); int width = FFMIN(avctx->width , C64XRES); - uint8_t *src = p->data[0]; + const uint8_t *src = p->data[0]; for (blocky = 0; blocky < C64YRES; blocky += 8) { for (blockx = 0; blockx < C64XRES; blockx += 8) { @@ -395,7 +395,7 @@ #if CONFIG_A64MULTI_ENCODER const FFCodec ff_a64multi_encoder = { .p.name = "a64multi", - .p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"), + CODEC_LONG_NAME("Multicolor charset for Commodore 64"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_A64_MULTI, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, @@ -404,13 +404,13 @@ FF_CODEC_ENCODE_CB(a64multi_encode_frame), .close = a64multi_close_encoder, .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_A64MULTI5_ENCODER const FFCodec ff_a64multi5_encoder = { .p.name = "a64multi5", - .p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"), + CODEC_LONG_NAME("Multicolor charset for Commodore 64, extended with 5th color (colram)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_A64_MULTI5, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, @@ -419,6 +419,6 @@ FF_CODEC_ENCODE_CB(a64multi_encode_frame), .close = a64multi_close_encoder, .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,8 @@ #include "libavutil/common.h" #include "parser.h" #include "aac_ac3_parser.h" +#include "ac3_parser_internal.h" +#include "adts_header.h" int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, @@ -38,83 +40,127 @@ int new_frame_start; int got_frame = 0; + if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) { + i = buf_size; + got_frame = 1; + } else { get_next: - i=END_NOT_FOUND; - if(s->remaining_size <= buf_size){ - if(s->remaining_size && !s->need_next_header){ - i= s->remaining_size; - s->remaining_size = 0; - }else{ //we need a header first - len=0; - for(i=s->remaining_size; istate = (s->state<<8) + buf[i]; - if((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start))) - break; - } - if(len<=0){ - i=END_NOT_FOUND; - }else{ - got_frame = 1; - s->state=0; - i-= s->header_size -1; - s->remaining_size = len; - if(!new_frame_start || pc->index+i<=0){ - s->remaining_size += i; - goto get_next; + i=END_NOT_FOUND; + if(s->remaining_size <= buf_size){ + if(s->remaining_size && !s->need_next_header){ + i= s->remaining_size; + s->remaining_size = 0; + }else{ //we need a header first + len=0; + for(i=s->remaining_size; istate = (s->state<<8) + buf[i]; + if((len=s->sync(s->state, &s->need_next_header, &new_frame_start))) + break; } - else if (i < 0) { - s->remaining_size += i; + if(len<=0){ + i=END_NOT_FOUND; + }else{ + got_frame = 1; + s->state=0; + i-= s->header_size -1; + s->remaining_size = len; + if(!new_frame_start || pc->index+i<=0){ + s->remaining_size += i; + goto get_next; + } + else if (i < 0) { + s->remaining_size += i; + } } } } - } - if(ff_combine_frame(pc, i, &buf, &buf_size)<0){ - s->remaining_size -= FFMIN(s->remaining_size, buf_size); - *poutbuf = NULL; - *poutbuf_size = 0; - return buf_size; + if(ff_combine_frame(pc, i, &buf, &buf_size)<0){ + s->remaining_size -= FFMIN(s->remaining_size, buf_size); + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } } *poutbuf = buf; *poutbuf_size = buf_size; - /* update codec info */ - if(s->codec_id) - avctx->codec_id = s->codec_id; - if (got_frame) { + int bit_rate; + /* Due to backwards compatible HE-AAC the sample rate, channel count, and total number of samples found in an AAC ADTS header are not reliable. Bit rate is still accurate because the total frame duration in seconds is still correct (as is the number of bits in the frame). */ if (avctx->codec_id != AV_CODEC_ID_AAC) { - avctx->sample_rate = s->sample_rate; + AC3HeaderInfo hdr, *phrd = &hdr; + int offset = ff_ac3_find_syncword(buf, buf_size); + + if (offset < 0) + return i; + + buf += offset; + buf_size -= offset; + while (buf_size > 0) { + int ret = avpriv_ac3_parse_header(&phrd, buf, buf_size); + + if (ret < 0 || hdr.frame_size > buf_size) + return i; + + if (buf_size > hdr.frame_size) { + buf += hdr.frame_size; + buf_size -= hdr.frame_size; + continue; + } + /* Check for false positives since the syncword is not enough. + See section 6.1.2 of A/52. */ + if (av_crc(s->crc_ctx, 0, buf + 2, hdr.frame_size - 2)) + return i; + break; + } + + avctx->sample_rate = hdr.sample_rate; + + if (hdr.bitstream_id > 10) + avctx->codec_id = AV_CODEC_ID_EAC3; + if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) { av_channel_layout_uninit(&avctx->ch_layout); - if (s->channel_layout) { - av_channel_layout_from_mask(&avctx->ch_layout, s->channel_layout); + if (hdr.channel_layout) { + av_channel_layout_from_mask(&avctx->ch_layout, hdr.channel_layout); } else { avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avctx->ch_layout.nb_channels = s->channels; + avctx->ch_layout.nb_channels = hdr.channels; } #if FF_API_OLD_CHANNEL_LAYOUT FF_DISABLE_DEPRECATION_WARNINGS avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = s->channel_layout; + avctx->channel_layout = hdr.channel_layout; FF_ENABLE_DEPRECATION_WARNINGS #endif } - s1->duration = s->samples; - avctx->audio_service_type = s->service_type; + s1->duration = hdr.num_blocks * 256; + avctx->audio_service_type = hdr.bitstream_mode; + if (hdr.bitstream_mode == 0x7 && hdr.channels > 1) + avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE; + bit_rate = hdr.bit_rate; + } else { + AACADTSHeaderInfo hdr, *phrd = &hdr; + int ret = avpriv_adts_header_parse(&phrd, buf, buf_size); + + if (ret < 0) + return i; + + bit_rate = hdr.bit_rate; } /* Calculate the average bit rate */ s->frame_number++; if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) { avctx->bit_rate += - (s->bit_rate - avctx->bit_rate) / s->frame_number; + (bit_rate - avctx->bit_rate) / s->frame_number; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_ac3_parser.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #define AVCODEC_AAC_AC3_PARSER_H #include +#include "libavutil/crc.h" #include "avcodec.h" #include "parser.h" @@ -39,24 +40,15 @@ typedef struct AACAC3ParseContext { ParseContext pc; - int frame_size; int header_size; - int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info, - int *need_next_header, int *new_frame_start); - - int channels; - int sample_rate; - int bit_rate; - int samples; - uint64_t channel_layout; - int service_type; + int (*sync)(uint64_t state, int *need_next_header, int *new_frame_start); + const AVCRC *crc_ctx; int remaining_size; uint64_t state; int need_next_header; int frame_number; - enum AVCodecID codec_id; } AACAC3ParseContext; int ff_aac_ac3_parse(AVCodecParserContext *s1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_adtstoasc_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_adtstoasc_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_adtstoasc_bsf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_adtstoasc_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "put_bits.h" #include "get_bits.h" #include "mpeg4audio.h" +#include "mpeg4audio_copy_pce.h" typedef struct AACBSFContext { int first_frame_done; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder.c 2023-03-03 13:29:59.000000000 +0000 @@ -62,6 +62,229 @@ #include "libavcodec/aaccoder_trellis.h" +typedef float (*quantize_and_encode_band_func)(struct AACEncContext *s, PutBitContext *pb, + const float *in, float *quant, const float *scaled, + int size, int scale_idx, int cb, + const float lambda, const float uplim, + int *bits, float *energy); + +/** + * Calculate rate distortion cost for quantizing with given codebook + * + * @return quantization distortion + */ +static av_always_inline float quantize_and_encode_band_cost_template( + struct AACEncContext *s, + PutBitContext *pb, const float *in, float *out, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, float *energy, int BT_ZERO, int BT_UNSIGNED, + int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO, + const float ROUNDING) +{ + const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512; + const float Q = ff_aac_pow2sf_tab [q_idx]; + const float Q34 = ff_aac_pow34sf_tab[q_idx]; + const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; + const float CLIPPED_ESCAPE = 165140.0f*IQ; + float cost = 0; + float qenergy = 0; + const int dim = BT_PAIR ? 2 : 4; + int resbits = 0; + int off; + + if (BT_ZERO || BT_NOISE || BT_STEREO) { + for (int i = 0; i < size; i++) + cost += in[i]*in[i]; + if (bits) + *bits = 0; + if (energy) + *energy = qenergy; + if (out) { + for (int i = 0; i < size; i += dim) + for (int j = 0; j < dim; j++) + out[i+j] = 0.0f; + } + return cost * lambda; + } + if (!scaled) { + s->abs_pow34(s->scoefs, in, size); + scaled = s->scoefs; + } + s->quant_bands(s->qcoefs, in, scaled, size, !BT_UNSIGNED, aac_cb_maxval[cb], Q34, ROUNDING); + if (BT_UNSIGNED) { + off = 0; + } else { + off = aac_cb_maxval[cb]; + } + for (int i = 0; i < size; i += dim) { + const float *vec; + int *quants = s->qcoefs + i; + int curidx = 0; + int curbits; + float quantized, rd = 0.0f; + for (int j = 0; j < dim; j++) { + curidx *= aac_cb_range[cb]; + curidx += quants[j] + off; + } + curbits = ff_aac_spectral_bits[cb-1][curidx]; + vec = &ff_aac_codebook_vectors[cb-1][curidx*dim]; + if (BT_UNSIGNED) { + for (int j = 0; j < dim; j++) { + float t = fabsf(in[i+j]); + float di; + if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow + if (t >= CLIPPED_ESCAPE) { + quantized = CLIPPED_ESCAPE; + curbits += 21; + } else { + int c = av_clip_uintp2(quant(t, Q, ROUNDING), 13); + quantized = c*cbrtf(c)*IQ; + curbits += av_log2(c)*2 - 4 + 1; + } + } else { + quantized = vec[j]*IQ; + } + di = t - quantized; + if (out) + out[i+j] = in[i+j] >= 0 ? quantized : -quantized; + if (vec[j] != 0.0f) + curbits++; + qenergy += quantized*quantized; + rd += di*di; + } + } else { + for (int j = 0; j < dim; j++) { + quantized = vec[j]*IQ; + qenergy += quantized*quantized; + if (out) + out[i+j] = quantized; + rd += (in[i+j] - quantized)*(in[i+j] - quantized); + } + } + cost += rd * lambda + curbits; + resbits += curbits; + if (cost >= uplim) + return uplim; + if (pb) { + put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]); + if (BT_UNSIGNED) + for (int j = 0; j < dim; j++) + if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f) + put_bits(pb, 1, in[i+j] < 0.0f); + if (BT_ESC) { + for (int j = 0; j < 2; j++) { + if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) { + int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13); + int len = av_log2(coef); + + put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2); + put_sbits(pb, len, coef); + } + } + } + } + } + + if (bits) + *bits = resbits; + if (energy) + *energy = qenergy; + return cost; +} + +static inline float quantize_and_encode_band_cost_NONE(struct AACEncContext *s, PutBitContext *pb, + const float *in, float *quant, const float *scaled, + int size, int scale_idx, int cb, + const float lambda, const float uplim, + int *bits, float *energy) { + av_assert0(0); + return 0.0f; +} + +#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, ROUNDING) \ +static float quantize_and_encode_band_cost_ ## NAME( \ + struct AACEncContext *s, \ + PutBitContext *pb, const float *in, float *quant, \ + const float *scaled, int size, int scale_idx, \ + int cb, const float lambda, const float uplim, \ + int *bits, float *energy) { \ + return quantize_and_encode_band_cost_template( \ + s, pb, in, quant, scaled, size, scale_idx, \ + BT_ESC ? ESC_BT : cb, lambda, uplim, bits, energy, \ + BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, \ + ROUNDING); \ +} + +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO, 1, 0, 0, 0, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC, 0, 1, 1, 1, 0, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC_RTZ, 0, 1, 1, 1, 0, 0, ROUND_TO_ZERO) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NOISE, 0, 0, 0, 0, 1, 0, ROUND_STANDARD) +QUANTIZE_AND_ENCODE_BAND_COST_FUNC(STEREO,0, 0, 0, 0, 0, 1, ROUND_STANDARD) + +static const quantize_and_encode_band_func quantize_and_encode_band_cost_arr[] = +{ + quantize_and_encode_band_cost_ZERO, + quantize_and_encode_band_cost_SQUAD, + quantize_and_encode_band_cost_SQUAD, + quantize_and_encode_band_cost_UQUAD, + quantize_and_encode_band_cost_UQUAD, + quantize_and_encode_band_cost_SPAIR, + quantize_and_encode_band_cost_SPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_ESC, + quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */ + quantize_and_encode_band_cost_NOISE, + quantize_and_encode_band_cost_STEREO, + quantize_and_encode_band_cost_STEREO, +}; + +static const quantize_and_encode_band_func quantize_and_encode_band_cost_rtz_arr[] = +{ + quantize_and_encode_band_cost_ZERO, + quantize_and_encode_band_cost_SQUAD, + quantize_and_encode_band_cost_SQUAD, + quantize_and_encode_band_cost_UQUAD, + quantize_and_encode_band_cost_UQUAD, + quantize_and_encode_band_cost_SPAIR, + quantize_and_encode_band_cost_SPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_UPAIR, + quantize_and_encode_band_cost_ESC_RTZ, + quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */ + quantize_and_encode_band_cost_NOISE, + quantize_and_encode_band_cost_STEREO, + quantize_and_encode_band_cost_STEREO, +}; + +float ff_quantize_and_encode_band_cost(struct AACEncContext *s, PutBitContext *pb, + const float *in, float *quant, const float *scaled, + int size, int scale_idx, int cb, + const float lambda, const float uplim, + int *bits, float *energy) +{ + return quantize_and_encode_band_cost_arr[cb](s, pb, in, quant, scaled, size, + scale_idx, cb, lambda, uplim, + bits, energy); +} + +static inline void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb, + const float *in, float *out, int size, int scale_idx, + int cb, const float lambda, int rtz) +{ + (rtz ? quantize_and_encode_band_cost_rtz_arr : quantize_and_encode_band_cost_arr)[cb](s, pb, in, out, NULL, size, scale_idx, cb, + lambda, INFINITY, NULL, NULL); +} + /** * structure used in optimal codebook search */ @@ -123,7 +346,7 @@ rd += quantize_band_cost(s, &sce->coeffs[start + w*128], &s->scoefs[start + w*128], size, sce->sf_idx[(win+w)*16+swb], aac_cb_out_map[cb], - lambda / band->threshold, INFINITY, NULL, NULL, 0); + lambda / band->threshold, INFINITY, NULL, NULL); } cost_stay_here = path[swb][cb].cost + rd; cost_get_here = minrd + rd + run_bits + 4; @@ -346,7 +569,7 @@ for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g], - q + q0, cb, lambda / band->threshold, INFINITY, NULL, NULL, 0); + q + q0, cb, lambda / band->threshold, INFINITY, NULL, NULL); } minrd = FFMIN(minrd, dist); @@ -658,7 +881,7 @@ sce->ics.swb_sizes[g], sce->sf_idx[(w+w2)*16+g], sce->band_alt[(w+w2)*16+g], - lambda/band->threshold, INFINITY, NULL, NULL, 0); + lambda/band->threshold, INFINITY, NULL, NULL); /* Estimate rd on average as 5 bits for SF, 4 for the CB, plus spread energy * lambda/thr */ dist2 += band->energy/(band->spread*band->spread)*lambda*dist_thresh/band->threshold; } @@ -842,25 +1065,25 @@ sce0->ics.swb_sizes[g], sce0->sf_idx[w*16+g], sce0->band_type[w*16+g], - lambda / (band0->threshold + FLT_MIN), INFINITY, &b1, NULL, 0); + lambda / (band0->threshold + FLT_MIN), INFINITY, &b1, NULL); dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128], R34, sce1->ics.swb_sizes[g], sce1->sf_idx[w*16+g], sce1->band_type[w*16+g], - lambda / (band1->threshold + FLT_MIN), INFINITY, &b2, NULL, 0); + lambda / (band1->threshold + FLT_MIN), INFINITY, &b2, NULL); dist2 += quantize_band_cost(s, M, M34, sce0->ics.swb_sizes[g], mididx, midcb, - lambda / (minthr + FLT_MIN), INFINITY, &b3, NULL, 0); + lambda / (minthr + FLT_MIN), INFINITY, &b3, NULL); dist2 += quantize_band_cost(s, S, S34, sce1->ics.swb_sizes[g], sididx, sidcb, - mslambda / (minthr * bmax + FLT_MIN), INFINITY, &b4, NULL, 0); + mslambda / (minthr * bmax + FLT_MIN), INFINITY, &b4, NULL); B0 += b1+b2; B1 += b3+b4; dist1 -= b1+b2; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder_trellis.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder_trellis.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder_trellis.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aaccoder_trellis.h 2023-03-03 13:29:59.000000000 +0000 @@ -127,7 +127,7 @@ &s->scoefs[start + w*128], size, sce->sf_idx[win*16+swb], aac_cb_out_map[cb], - 0, INFINITY, NULL, NULL, 0); + 0, INFINITY, NULL, NULL); } cost_stay_here = path[swb][cb].cost + bits; cost_get_here = minbits + bits + run_bits + 4; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,16 +32,14 @@ * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ -#define FFT_FLOAT 1 #define USE_FIXED 0 +#define TX_TYPE AV_TX_FLOAT_MDCT #include "libavutil/float_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" -#include "fft.h" -#include "mdct15.h" #include "lpc.h" #include "kbdwin.h" #include "sinewin.h" @@ -554,7 +552,7 @@ const FFCodec ff_aac_decoder = { .p.name = "aac", - .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), @@ -565,10 +563,8 @@ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, .flush = flush, .p.priv_class = &aac_decoder_class, @@ -582,7 +578,7 @@ */ const FFCodec ff_aac_latm_decoder = { .p.name = "aac_latm", - .p.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"), + CODEC_LONG_NAME("AAC LATM (Advanced Audio Coding LATM syntax)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC_LATM, .priv_data_size = sizeof(struct LATMContext), @@ -593,10 +589,8 @@ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, .flush = flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,15 +58,14 @@ * @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com ) */ -#define FFT_FLOAT 0 #define USE_FIXED 1 +#define TX_TYPE AV_TX_INT32_MDCT #include "libavutil/fixed_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" -#include "fft.h" #include "lpc.h" #include "kbdwin.h" #include "sinewin_fixed_tablegen.h" @@ -87,6 +86,8 @@ DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_1024))[1024]; DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_128))[128]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_long_960))[960]; +DECLARE_ALIGNED(32, static int, AAC_RENAME2(aac_kbd_short_120))[120]; static av_always_inline void reset_predict_state(PredictorState *ps) { @@ -452,7 +453,7 @@ const FFCodec ff_aac_fixed_decoder = { .p.name = "aac_fixed", - .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), @@ -463,11 +464,10 @@ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layout, + .p.priv_class = &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), .flush = flush, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdectab.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdectab.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdectab.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdectab.h 2023-03-03 13:29:59.000000000 +0000 @@ -49,12 +49,12 @@ { { 0, } }, { { 0, } }, { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_SIDE }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR, - { TYPE_CPE, 2, AAC_CHANNEL_SIDE }, // CPE3 = SiL and SiR, + { TYPE_CPE, 2, AAC_CHANNEL_BACK }, // CPE3 = SiL and SiR, { TYPE_CPE, 3, AAC_CHANNEL_BACK }, // CPE4 = BL and BR, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, // SCE2 = BC, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, // LFE1 = LFE1, @@ -62,18 +62,39 @@ { TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC, { TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR, { TYPE_CPE, 5, AAC_CHANNEL_SIDE }, // CPE6 = TpSiL and TpSiR, - { TYPE_SCE, 3, AAC_CHANNEL_FRONT }, // SCE4 = TpC, + { TYPE_SCE, 3, AAC_CHANNEL_SIDE }, // SCE4 = TpC, { TYPE_CPE, 6, AAC_CHANNEL_BACK }, // CPE7 = TpBL and TpBR, { TYPE_SCE, 4, AAC_CHANNEL_BACK }, // SCE5 = TpBC, { TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC, { TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, { TYPE_CPE, 2, AAC_CHANNEL_FRONT }, }, { { 0, } }, - /* TODO: Add 7+1 TOP configuration */ +}; + +static const int16_t aac_channel_map[3][4][6] = { + { + { AV_CHAN_FRONT_CENTER, AV_CHAN_FRONT_LEFT_OF_CENTER, AV_CHAN_FRONT_RIGHT_OF_CENTER, AV_CHAN_FRONT_LEFT, AV_CHAN_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_SIDE_LEFT, AV_CHAN_SIDE_RIGHT, AV_CHAN_BACK_LEFT, AV_CHAN_BACK_RIGHT, AV_CHAN_BACK_CENTER }, + { AV_CHAN_LOW_FREQUENCY, AV_CHAN_LOW_FREQUENCY_2, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + }, + { + { AV_CHAN_TOP_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_FRONT_LEFT, AV_CHAN_TOP_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_RIGHT, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_CENTER}, + { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_BACK_LEFT, AV_CHAN_TOP_BACK_RIGHT, AV_CHAN_TOP_BACK_CENTER}, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE}, + }, + { + { AV_CHAN_BOTTOM_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + }, }; #if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t aac_channel_layout[16] = { +static const uint64_t aac_channel_layout[] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -81,18 +102,15 @@ AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_7POINT1_WIDE_BACK, - 0, - 0, - 0, AV_CH_LAYOUT_6POINT1_BACK, AV_CH_LAYOUT_7POINT1, AV_CH_LAYOUT_22POINT2, + AV_CH_LAYOUT_7POINT1_TOP_BACK, 0, - /* AV_CH_LAYOUT_7POINT1_TOP, */ }; #endif -static const AVChannelLayout aac_ch_layout[16] = { +static const AVChannelLayout aac_ch_layout[] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_SURROUND, @@ -100,14 +118,11 @@ AV_CHANNEL_LAYOUT_5POINT0_BACK, AV_CHANNEL_LAYOUT_5POINT1_BACK, AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, - { 0 }, - { 0 }, - { 0 }, AV_CHANNEL_LAYOUT_6POINT1_BACK, AV_CHANNEL_LAYOUT_7POINT1, AV_CHANNEL_LAYOUT_22POINT2, + AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK, { 0 }, - /* AV_CHANNEL_LAYOUT_7POINT1_TOP, */ }; #endif /* AVCODEC_AACDECTAB_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacdec_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -91,6 +91,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/thread.h" +#include "decode.h" #include "internal.h" static VLC vlc_scalefactors; @@ -134,9 +135,12 @@ return AVERROR_INVALIDDATA; if (che_pos) { if (!ac->che[type][id]) { + int ret; if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) return AVERROR(ENOMEM); - AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr, type); + ret = AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr, type); + if (ret < 0) + return ret; } if (type != TYPE_CCE) { if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) { @@ -237,13 +241,13 @@ } static int count_paired_channels(uint8_t (*layout_map)[3], int tags, int pos, - int *current) + int current) { int num_pos_channels = 0; int first_cpe = 0; int sce_parity = 0; int i; - for (i = *current; i < tags; i++) { + for (i = current; i < tags; i++) { if (layout_map[i][2] != pos) break; if (layout_map[i][0] == TYPE_CPE) { @@ -258,207 +262,117 @@ first_cpe = 1; } else { num_pos_channels++; - sce_parity ^= 1; + sce_parity ^= (pos != AAC_CHANNEL_LFE); } } if (sce_parity && - ((pos == AAC_CHANNEL_FRONT && first_cpe) || pos == AAC_CHANNEL_SIDE)) + (pos == AAC_CHANNEL_FRONT && first_cpe)) return -1; - *current = i; + return num_pos_channels; } -#define PREFIX_FOR_22POINT2 (AV_CH_LAYOUT_7POINT1_WIDE_BACK|AV_CH_BACK_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_LOW_FREQUENCY_2) -static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags) +static int assign_channels(struct elem_to_channel e2c_vec[MAX_ELEM_ID], uint8_t (*layout_map)[3], + uint64_t *layout, int tags, int layer, int pos, int *current) { - int i, n, total_non_cc_elements; - struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } }; - int num_front_channels, num_side_channels, num_back_channels; - uint64_t layout = 0; + int i = *current, j = 0; + int nb_channels = count_paired_channels(layout_map, tags, pos, i); - if (FF_ARRAY_ELEMS(e2c_vec) < tags) + if (nb_channels < 0 || nb_channels > 5) return 0; - i = 0; - num_front_channels = - count_paired_channels(layout_map, tags, AAC_CHANNEL_FRONT, &i); - if (num_front_channels < 0) - return 0; - num_side_channels = - count_paired_channels(layout_map, tags, AAC_CHANNEL_SIDE, &i); - if (num_side_channels < 0) - return 0; - num_back_channels = - count_paired_channels(layout_map, tags, AAC_CHANNEL_BACK, &i); - if (num_back_channels < 0) - return 0; + if (pos == AAC_CHANNEL_LFE) { + while (nb_channels) { + if (aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE) + return -1; + e2c_vec[i] = (struct elem_to_channel) { + .av_position = 1ULL << aac_channel_map[layer][pos - 1][j], + .syn_ele = layout_map[i][0], + .elem_id = layout_map[i][1], + .aac_position = pos + }; + *layout |= e2c_vec[i].av_position; + i++; + j++; + nb_channels--; + } + *current = i; - if (num_side_channels == 0 && num_back_channels >= 4) { - num_side_channels = 2; - num_back_channels -= 2; + return 0; } - i = 0; - if (num_front_channels & 1) { + while (nb_channels & 1) { + if (aac_channel_map[layer][pos - 1][0] == AV_CHAN_NONE) + return -1; + if (aac_channel_map[layer][pos - 1][0] == AV_CHAN_UNUSED) + break; e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_FRONT_CENTER, - .syn_ele = TYPE_SCE, + .av_position = 1ULL << aac_channel_map[layer][pos - 1][0], + .syn_ele = layout_map[i][0], .elem_id = layout_map[i][1], - .aac_position = AAC_CHANNEL_FRONT + .aac_position = pos }; - layout |= e2c_vec[i].av_position; + *layout |= e2c_vec[i].av_position; i++; - num_front_channels--; - } - if (num_front_channels >= 4) { - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_FRONT_LEFT_OF_CENTER, - AV_CH_FRONT_RIGHT_OF_CENTER, - AAC_CHANNEL_FRONT, &layout); - num_front_channels -= 2; - } - if (num_front_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_FRONT_LEFT, - AV_CH_FRONT_RIGHT, - AAC_CHANNEL_FRONT, &layout); - num_front_channels -= 2; - } - while (num_front_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, - AAC_CHANNEL_FRONT, &layout); - num_front_channels -= 2; + nb_channels--; } - if (num_side_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_SIDE_LEFT, - AV_CH_SIDE_RIGHT, - AAC_CHANNEL_FRONT, &layout); - num_side_channels -= 2; - } - while (num_side_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, - AAC_CHANNEL_SIDE, &layout); - num_side_channels -= 2; - } - - while (num_back_channels >= 4) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, - AAC_CHANNEL_BACK, &layout); - num_back_channels -= 2; - } - if (num_back_channels >= 2) { + j = (pos != AAC_CHANNEL_SIDE) && nb_channels <= 3 ? 3 : 1; + while (nb_channels >= 2) { + if (aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE || + aac_channel_map[layer][pos - 1][j+1] == AV_CHAN_NONE) + return -1; i += assign_pair(e2c_vec, layout_map, i, - AV_CH_BACK_LEFT, - AV_CH_BACK_RIGHT, - AAC_CHANNEL_BACK, &layout); - num_back_channels -= 2; + 1ULL << aac_channel_map[layer][pos - 1][j], + 1ULL << aac_channel_map[layer][pos - 1][j+1], + pos, layout); + j += 2; + nb_channels -= 2; } - if (num_back_channels) { + while (nb_channels & 1) { + if (aac_channel_map[layer][pos - 1][5] == AV_CHAN_NONE) + return -1; e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_BACK_CENTER, - .syn_ele = TYPE_SCE, + .av_position = 1ULL << aac_channel_map[layer][pos - 1][5], + .syn_ele = layout_map[i][0], .elem_id = layout_map[i][1], - .aac_position = AAC_CHANNEL_BACK + .aac_position = pos }; - layout |= e2c_vec[i].av_position; + *layout |= e2c_vec[i].av_position; i++; - num_back_channels--; + nb_channels--; } + if (nb_channels) + return -1; - if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) { - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_LOW_FREQUENCY, - .syn_ele = TYPE_LFE, - .elem_id = layout_map[i][1], - .aac_position = AAC_CHANNEL_LFE - }; - layout |= e2c_vec[i].av_position; - i++; - } - if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) { - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_LOW_FREQUENCY_2, - .syn_ele = TYPE_LFE, - .elem_id = layout_map[i][1], - .aac_position = AAC_CHANNEL_LFE - }; - layout |= e2c_vec[i].av_position; - i++; - } - while (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) { - e2c_vec[i] = (struct elem_to_channel) { - .av_position = UINT64_MAX, - .syn_ele = TYPE_LFE, - .elem_id = layout_map[i][1], - .aac_position = AAC_CHANNEL_LFE - }; - i++; - } + *current = i; - // The previous checks would end up at 8 at this point for 22.2 - if (layout == PREFIX_FOR_22POINT2 && tags == 16 && i == 8) { - const uint8_t (*reference_layout_map)[3] = aac_channel_layout_map[12]; - for (int j = 0; j < tags; j++) { - if (layout_map[j][0] != reference_layout_map[j][0] || - layout_map[j][2] != reference_layout_map[j][2]) - goto end_of_layout_definition; - } + return 0; +} - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_TOP_FRONT_CENTER, - .syn_ele = layout_map[i][0], - .elem_id = layout_map[i][1], - .aac_position = layout_map[i][2] - }; layout |= e2c_vec[i].av_position; i++; - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_TOP_FRONT_LEFT, - AV_CH_TOP_FRONT_RIGHT, - AAC_CHANNEL_FRONT, - &layout); - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_TOP_SIDE_LEFT, - AV_CH_TOP_SIDE_RIGHT, - AAC_CHANNEL_SIDE, - &layout); - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_TOP_CENTER, - .syn_ele = layout_map[i][0], - .elem_id = layout_map[i][1], - .aac_position = layout_map[i][2] - }; layout |= e2c_vec[i].av_position; i++; - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_TOP_BACK_LEFT, - AV_CH_TOP_BACK_RIGHT, - AAC_CHANNEL_BACK, - &layout); - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_TOP_BACK_CENTER, - .syn_ele = layout_map[i][0], - .elem_id = layout_map[i][1], - .aac_position = layout_map[i][2] - }; layout |= e2c_vec[i].av_position; i++; - e2c_vec[i] = (struct elem_to_channel) { - .av_position = AV_CH_BOTTOM_FRONT_CENTER, - .syn_ele = layout_map[i][0], - .elem_id = layout_map[i][1], - .aac_position = layout_map[i][2] - }; layout |= e2c_vec[i].av_position; i++; - i += assign_pair(e2c_vec, layout_map, i, - AV_CH_BOTTOM_FRONT_LEFT, - AV_CH_BOTTOM_FRONT_RIGHT, - AAC_CHANNEL_FRONT, - &layout); - } +static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags) +{ + int i, n, total_non_cc_elements; + struct elem_to_channel e2c_vec[4 * MAX_ELEM_ID] = { { 0 } }; + uint64_t layout = 0; -end_of_layout_definition: + if (FF_ARRAY_ELEMS(e2c_vec) < tags) + return 0; + + for (n = 0, i = 0; n < 3 && i < tags; n++) { + int ret = assign_channels(e2c_vec, layout_map, &layout, tags, n, AAC_CHANNEL_FRONT, &i); + if (ret < 0) + return 0; + ret = assign_channels(e2c_vec, layout_map, &layout, tags, n, AAC_CHANNEL_SIDE, &i); + if (ret < 0) + return 0; + ret = assign_channels(e2c_vec, layout_map, &layout, tags, n, AAC_CHANNEL_BACK, &i); + if (ret < 0) + return 0; + ret = assign_channels(e2c_vec, layout_map, &layout, tags, n, AAC_CHANNEL_LFE, &i); + if (ret < 0) + return 0; + } total_non_cc_elements = n = i; @@ -632,7 +546,7 @@ int channel_config) { if (channel_config < 1 || (channel_config > 7 && channel_config < 11) || - channel_config > 13) { + channel_config > 14) { av_log(avctx, AV_LOG_ERROR, "invalid default channel configuration (%d)\n", channel_config); @@ -654,7 +568,7 @@ * 7.1 layout was intended. */ if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) { - layout_map[2][2] = AAC_CHANNEL_SIDE; + layout_map[2][2] = AAC_CHANNEL_BACK; if (!ac || !ac->warned_71_wide++) { av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout" @@ -716,6 +630,12 @@ /* For indexed channel configurations map the channels solely based * on position. */ switch (ac->oc[1].m4ac.chan_config) { + case 14: + if (ac->tags_mapped > 2 && ((type == TYPE_CPE && elem_id < 3) || + (type == TYPE_LFE && elem_id < 1))) { + ac->tags_mapped++; + return ac->tag_che_map[type][elem_id] = ac->che[type][elem_id]; + } case 13: if (ac->tags_mapped > 3 && ((type == TYPE_CPE && elem_id < 8) || (type == TYPE_SCE && elem_id < 6) || @@ -928,13 +848,6 @@ uint8_t layout_map[MAX_ELEM_ID*4][3]; int tags = 0; -#if USE_FIXED - if (get_bits1(gb)) { // frameLengthFlag - avpriv_report_missing_feature(avctx, "Fixed point 960/120 MDCT window"); - return AVERROR_PATCHWELCOME; - } - m4ac->frame_length_short = 0; -#else m4ac->frame_length_short = get_bits1(gb); if (m4ac->frame_length_short && m4ac->sbr == 1) { avpriv_report_missing_feature(avctx, "SBR with 960 frame length"); @@ -942,7 +855,6 @@ m4ac->sbr = 0; m4ac->ps = 0; } -#endif if (get_bits1(gb)) // dependsOnCoreCoder skip_bits(gb, 14); // coreCoderDelay @@ -1019,14 +931,8 @@ m4ac->ps = 0; m4ac->sbr = 0; -#if USE_FIXED - if (get_bits1(gb)) { // frameLengthFlag - avpriv_request_sample(avctx, "960/120 MDCT window"); - return AVERROR_PATCHWELCOME; - } -#else m4ac->frame_length_short = get_bits1(gb); -#endif + res_flags = get_bits(gb, 3); if (res_flags) { avpriv_report_missing_feature(avctx, @@ -1253,9 +1159,10 @@ 352); // window initialization -#if !USE_FIXED 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); + +#if !USE_FIXED AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_120), 120); AAC_RENAME(ff_init_ff_sine_windows)(9); @@ -1273,6 +1180,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) { + float scale; AACContext *ac = avctx->priv_data; int ret; @@ -1345,21 +1253,25 @@ ac->random_state = 0x1f2e3d4c; - AAC_RENAME_32(ff_mdct_init)(&ac->mdct, 11, 1, 1.0 / RANGE15(1024.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ld, 10, 1, 1.0 / RANGE15(512.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_small, 8, 1, 1.0 / RANGE15(128.0)); - AAC_RENAME_32(ff_mdct_init)(&ac->mdct_ltp, 11, 0, RANGE15(-2.0)); -#if !USE_FIXED - ret = ff_mdct15_init(&ac->mdct120, 1, 3, 1.0f/(16*1024*120*2)); - if (ret < 0) - return ret; - ret = ff_mdct15_init(&ac->mdct480, 1, 5, 1.0f/(16*1024*960)); - if (ret < 0) +#define MDCT_INIT(s, fn, len, sval) \ + scale = sval; \ + ret = av_tx_init(&s, &fn, TX_TYPE, 1, len, &scale, 0); \ + if (ret < 0) \ return ret; - ret = ff_mdct15_init(&ac->mdct960, 1, 6, 1.0f/(16*1024*960*2)); + + MDCT_INIT(ac->mdct120, ac->mdct120_fn, 120, TX_SCALE(1.0/120)) + MDCT_INIT(ac->mdct128, ac->mdct128_fn, 128, TX_SCALE(1.0/128)) + MDCT_INIT(ac->mdct480, ac->mdct480_fn, 480, TX_SCALE(1.0/480)) + MDCT_INIT(ac->mdct512, ac->mdct512_fn, 512, TX_SCALE(1.0/512)) + MDCT_INIT(ac->mdct960, ac->mdct960_fn, 960, TX_SCALE(1.0/960)) + MDCT_INIT(ac->mdct1024, ac->mdct1024_fn, 1024, TX_SCALE(1.0/1024)) +#undef MDCT_INIT + + /* LTP forward MDCT */ + scale = USE_FIXED ? -1.0 : -32786.0*2 + 36; + ret = av_tx_init(&ac->mdct_ltp, &ac->mdct_ltp_fn, TX_TYPE, 0, 1024, &scale, 0); if (ret < 0) return ret; -#endif return 0; } @@ -2582,6 +2494,10 @@ ac->avctx->profile = FF_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) { + av_log(ac->avctx, AV_LOG_VERBOSE, "Treating HE-AAC mono as stereo.\n"); + ac->warned_he_aac_mono = 1; + } break; case EXT_DYNAMIC_RANGE: res = decode_dynamic_range(&ac->che_drc, gb); @@ -2684,7 +2600,7 @@ ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128); memset(in + 1024 + 576, 0, 448 * sizeof(*in)); } - ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in); + ac->mdct_ltp_fn(ac->mdct_ltp, out, in, sizeof(INTFLOAT)); } /** @@ -2776,13 +2692,9 @@ // imdct if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 1024; i += 128) - ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i); + ac->mdct128_fn(ac->mdct128, buf + i, in + i, sizeof(INTFLOAT)); } else { - ac->mdct.imdct_half(&ac->mdct, buf, in); -#if USE_FIXED - for (i=0; i<1024; i++) - buf[i] = (buf[i] + 4LL) >> 3; -#endif /* USE_FIXED */ + ac->mdct1024_fn(ac->mdct1024, buf, in, sizeof(INTFLOAT)); } /* window overlapping @@ -2830,7 +2742,6 @@ */ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) { -#if !USE_FIXED IndividualChannelStream *ics = &sce->ics; INTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; @@ -2845,9 +2756,9 @@ // imdct if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 8; i++) - ac->mdct120->imdct_half(ac->mdct120, buf + i * 120, in + i * 128, 1); + ac->mdct120_fn(ac->mdct120, buf + i * 120, in + i * 128, sizeof(INTFLOAT)); } else { - ac->mdct960->imdct_half(ac->mdct960, buf, in, 1); + ac->mdct960_fn(ac->mdct960, buf, in, sizeof(INTFLOAT)); } /* window overlapping @@ -2889,7 +2800,6 @@ } else { // LONG_STOP or ONLY_LONG memcpy( saved, buf + 480, 480 * sizeof(*saved)); } -#endif } static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) { @@ -2898,17 +2808,9 @@ INTFLOAT *out = sce->ret; INTFLOAT *saved = sce->saved; INTFLOAT *buf = ac->buf_mdct; -#if USE_FIXED - int i; -#endif /* USE_FIXED */ // imdct - ac->mdct.imdct_half(&ac->mdct_ld, buf, in); - -#if USE_FIXED - for (i = 0; i < 1024; i++) - buf[i] = (buf[i] + 2) >> 2; -#endif /* USE_FIXED */ + ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); // window overlapping if (ics->use_kb_window[1]) { @@ -2947,20 +2849,15 @@ temp = in[i ]; in[i ] = -in[n - 1 - i]; in[n - 1 - i] = temp; temp = -in[i + 1]; in[i + 1] = in[n - 2 - i]; in[n - 2 - i] = temp; } -#if !USE_FIXED + if (n == 480) - ac->mdct480->imdct_half(ac->mdct480, buf, in, 1); + ac->mdct480_fn(ac->mdct480, buf, in, sizeof(INTFLOAT)); else -#endif - ac->mdct.imdct_half(&ac->mdct_ld, buf, in); - -#if USE_FIXED - for (i = 0; i < 1024; i++) - buf[i] = (buf[i] + 1) >> 1; -#endif /* USE_FIXED */ + ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); for (i = 0; i < n; i+=2) { - buf[i] = -buf[i]; + buf[i + 0] = -(USE_FIXED + 1)*buf[i + 0]; + buf[i + 1] = (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 @@ -3089,7 +2986,7 @@ /* preparation for resampler */ for(j = 0; jch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000; - if(type == TYPE_CPE) + if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000; } } @@ -3416,9 +3313,6 @@ ac->oc[1].status = OC_LOCKED; } - if (multiplier) - avctx->internal->skip_samples_multiplier = 2; - if (!ac->frame->data[0] && samples) { av_log(avctx, AV_LOG_ERROR, "no frame data found\n"); err = AVERROR_INVALIDDATA; @@ -3525,15 +3419,14 @@ } } - ff_mdct_end(&ac->mdct); - ff_mdct_end(&ac->mdct_small); - ff_mdct_end(&ac->mdct_ld); - ff_mdct_end(&ac->mdct_ltp); -#if !USE_FIXED - ff_mdct15_uninit(&ac->mdct120); - ff_mdct15_uninit(&ac->mdct480); - ff_mdct15_uninit(&ac->mdct960); -#endif + av_tx_uninit(&ac->mdct120); + av_tx_uninit(&ac->mdct128); + av_tx_uninit(&ac->mdct480); + av_tx_uninit(&ac->mdct512); + av_tx_uninit(&ac->mdct960); + av_tx_uninit(&ac->mdct1024); + av_tx_uninit(&ac->mdct_ltp); + av_freep(&ac->fdsp); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_defines.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_defines.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_defines.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_defines.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,8 +29,6 @@ #include "libavutil/softfloat.h" -#define FFT_FLOAT 0 - #define AAC_RENAME(x) x ## _fixed #define AAC_RENAME_32(x) x ## _fixed_32 #define AAC_RENAME2(x) x ## _fixed @@ -45,7 +43,7 @@ #define Q23(a) (int)((a) * 8388608.0 + 0.5) #define Q30(x) (int)((x)*1073741824.0 + 0.5) #define Q31(x) (int)((x)*2147483648.0 + 0.5) -#define RANGE15(x) x +#define TX_SCALE(x) ((x) * 128.0f) #define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024 #define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16) #define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26) @@ -78,8 +76,6 @@ #else -#define FFT_FLOAT 1 - #define AAC_RENAME(x) x #define AAC_RENAME_32(x) x #define AAC_RENAME2(x) ff_ ## x @@ -94,7 +90,7 @@ #define Q23(x) ((float)(x)) #define Q30(x) ((float)(x)) #define Q31(x) ((float)(x)) -#define RANGE15(x) (32768.0 * (x)) +#define TX_SCALE(x) ((x) / 32768.0f) #define GET_GAIN(x, y) powf((x), -(y)) #define AAC_MUL16(x, y) ((x) * (y)) #define AAC_MUL26(x, y) ((x) * (y)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -51,6 +51,279 @@ #include "psymodel.h" +/** + * List of PCE (Program Configuration Element) for the channel layouts listed + * in channel_layout.h + * + * For those wishing in the future to add other layouts: + * + * - num_ele: number of elements in each group of front, side, back, lfe channels + * (an element is of type SCE (single channel), CPE (channel pair) for + * the first 3 groups; and is LFE for LFE group). + * + * - pairing: 0 for an SCE element or 1 for a CPE; does not apply to LFE group + * + * - index: there are three independent indices for SCE, CPE and LFE; + * they are incremented irrespective of the group to which the element belongs; + * they are not reset when going from one group to another + * + * Example: for 7.0 channel layout, + * .pairing = { { 1, 0 }, { 1 }, { 1 }, }, (3 CPE and 1 SCE in front group) + * .index = { { 0, 0 }, { 1 }, { 2 }, }, + * (index is 0 for the single SCE but goes from 0 to 2 for the CPEs) + * + * The index order impacts the channel ordering. But is otherwise arbitrary + * (the sequence could have been 2, 0, 1 instead of 0, 1, 2). + * + * Spec allows for discontinuous indices, e.g. if one has a total of two SCE, + * SCE.0 SCE.15 is OK per spec; BUT it won't be decoded by our AAC decoder + * which at this time requires that indices fully cover some range starting + * from 0 (SCE.1 SCE.0 is OK but not SCE.0 SCE.15). + * + * - config_map: total number of elements and their types. Beware, the way the + * types are ordered impacts the final channel ordering. + * + * - reorder_map: reorders the channels. + * + */ +static const AACPCEInfo aac_pce_configs[] = { + { + .layout = AV_CHANNEL_LAYOUT_MONO, + .num_ele = { 1, 0, 0, 0 }, + .pairing = { { 0 }, }, + .index = { { 0 }, }, + .config_map = { 1, TYPE_SCE, }, + .reorder_map = { 0 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_STEREO, + .num_ele = { 1, 0, 0, 0 }, + .pairing = { { 1 }, }, + .index = { { 0 }, }, + .config_map = { 1, TYPE_CPE, }, + .reorder_map = { 0, 1 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_2POINT1, + .num_ele = { 1, 0, 0, 1 }, + .pairing = { { 1 }, }, + .index = { { 0 },{ 0 },{ 0 },{ 0 } }, + .config_map = { 2, TYPE_CPE, TYPE_LFE }, + .reorder_map = { 0, 1, 2 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_2_1, + .num_ele = { 1, 0, 1, 0 }, + .pairing = { { 1 },{ 0 },{ 0 } }, + .index = { { 0 },{ 0 },{ 0 }, }, + .config_map = { 2, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_SURROUND, + .num_ele = { 2, 0, 0, 0 }, + .pairing = { { 1, 0 }, }, + .index = { { 0, 0 }, }, + .config_map = { 2, TYPE_CPE, TYPE_SCE, }, + .reorder_map = { 0, 1, 2 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_3POINT1, + .num_ele = { 2, 0, 0, 1 }, + .pairing = { { 1, 0 }, }, + .index = { { 0, 0 }, { 0 }, { 0 }, { 0 }, }, + .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_LFE }, + .reorder_map = { 0, 1, 2, 3 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_4POINT0, + .num_ele = { 2, 0, 1, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 0 }, }, + .index = { { 0, 0 }, { 0 }, { 1 } }, + .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_4POINT1, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 0 }, }, + .index = { { 0, 0 }, { 1 }, { 2 }, { 0 } }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_2_2, + .num_ele = { 1, 1, 0, 0 }, + .pairing = { { 1 }, { 1 }, }, + .index = { { 0 }, { 1 }, }, + .config_map = { 2, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_QUAD, + .num_ele = { 1, 0, 1, 0 }, + .pairing = { { 1 }, { 0 }, { 1 }, }, + .index = { { 0 }, { 0 }, { 1 } }, + .config_map = { 2, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_5POINT0, + .num_ele = { 2, 1, 0, 0 }, + .pairing = { { 1, 0 }, { 1 }, }, + .index = { { 0, 0 }, { 1 } }, + .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_5POINT1, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1 }, }, + .index = { { 0, 0 }, { 1 }, { 1 } }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_5POINT0_BACK, + .num_ele = { 2, 0, 1, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1 } }, + .index = { { 0, 0 }, { 0 }, { 1 } }, + .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_5POINT1_BACK, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1 }, }, + .index = { { 0, 0 }, { 1 }, { 1 } }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_6POINT0, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 1 }, { 0 }, }, + .index = { { 0, 0 }, { 1 }, { 1 } }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_6POINT0_FRONT, + .num_ele = { 2, 1, 0, 0 }, + .pairing = { { 1, 1 }, { 1 } }, + .index = { { 1, 0 }, { 2 }, }, + .config_map = { 3, TYPE_CPE, TYPE_CPE, TYPE_CPE, }, + .reorder_map = { 0, 1, 2, 3, 4, 5 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_HEXAGONAL, + .num_ele = { 2, 0, 2, 0 }, + .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, }, + .index = { { 0, 0 },{ 0 },{ 1, 1 } }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, }, + .reorder_map = { 0, 1, 2, 3, 4, 5 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_6POINT1, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, }, + .index = { { 0, 0 },{ 1 },{ 1, 2 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_6POINT1_BACK, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, }, + .index = { { 0, 0 }, { 1 }, { 1, 2 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_6POINT1_FRONT, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, }, + .index = { { 0, 0 }, { 1 }, { 1, 2 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_7POINT0, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 1 }, { 1 }, }, + .index = { { 0, 0 }, { 1 }, { 2 }, }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_7POINT0_FRONT, + .num_ele = { 2, 1, 1, 0 }, + .pairing = { { 1, 0 }, { 1 }, { 1 }, }, + .index = { { 0, 0 }, { 1 }, { 2 }, }, + .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_7POINT1, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, }, + .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_7POINT1_WIDE, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 0 },{ 1, 1 }, }, + .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, }, + .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_OCTAGONAL, + .num_ele = { 2, 1, 2, 0 }, + .pairing = { { 1, 0 }, { 1 }, { 1, 0 }, }, + .index = { { 0, 0 }, { 1 }, { 2, 1 } }, + .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, + }, + { /* Meant for order 2/mixed ambisonics */ + .layout = { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 9, + .u.mask = AV_CH_LAYOUT_OCTAGONAL | AV_CH_TOP_CENTER }, + .num_ele = { 2, 2, 2, 0 }, + .pairing = { { 1, 0 }, { 1, 0 }, { 1, 0 }, }, + .index = { { 0, 0 }, { 1, 1 }, { 2, 2 } }, + .config_map = { 6, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, + }, + { /* Meant for order 2/mixed ambisonics */ + .layout = { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 10, + .u.mask = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_BACK_CENTER | + AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_TOP_CENTER }, + .num_ele = { 2, 2, 2, 0 }, + .pairing = { { 1, 1 }, { 1, 0 }, { 1, 0 }, }, + .index = { { 0, 1 }, { 2, 0 }, { 3, 1 } }, + .config_map = { 6, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, + }, + { + .layout = AV_CHANNEL_LAYOUT_HEXADECAGONAL, + .num_ele = { 4, 2, 4, 0 }, + .pairing = { { 1, 0, 1, 0 }, { 1, 1 }, { 1, 0, 1, 0 }, }, + .index = { { 0, 0, 1, 1 }, { 2, 3 }, { 4, 2, 5, 3 } }, + .config_map = { 10, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, + .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + }, +}; + static void put_pce(PutBitContext *pb, AVCodecContext *avctx) { int i, j; @@ -202,15 +475,15 @@ float *audio) { int i; - const float *output = sce->ret_buf; + float *output = sce->ret_buf; apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, audio); if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) - s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output); + s->mdct1024_fn(s->mdct1024, sce->coeffs, output, sizeof(float)); else for (i = 0; i < 1024; i += 128) - s->mdct128.mdct_calc(&s->mdct128, &sce->coeffs[i], output + i*2); + s->mdct128_fn(s->mdct128, &sce->coeffs[i], output + i*2, sizeof(float)); memcpy(audio, audio + 1024, sizeof(audio[0]) * 1024); memcpy(sce->pcoeffs, sce->coeffs, sizeof(sce->pcoeffs)); } @@ -581,7 +854,7 @@ if (s->psypp) ff_psy_preprocess(s->psypp, s->planar_samples, s->channels); - if (!avctx->frame_number) + if (!avctx->frame_num) return 0; start_ch = 0; @@ -666,7 +939,7 @@ if (s->options.ltp && s->coder->update_ltp) { s->coder->update_ltp(s, sce); apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, &sce->ltp_state[0]); - s->mdct1024.mdct_calc(&s->mdct1024, sce->lcoeffs, sce->ret_buf); + s->mdct1024_fn(s->mdct1024, sce->lcoeffs, sce->ret_buf, sizeof(float)); } for (k = 0; k < 1024; k++) { @@ -685,7 +958,7 @@ do { init_put_bits(&s->pb, avpkt->data, avpkt->size); - if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) + if ((avctx->frame_num & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) put_bitstream_info(s, LIBAVCODEC_IDENT); start_ch = 0; target_bits = 0; @@ -903,8 +1176,8 @@ av_log(avctx, AV_LOG_INFO, "Qavg: %.3f\n", s->lambda_count ? s->lambda_sum / s->lambda_count : NAN); - ff_mdct_end(&s->mdct1024); - ff_mdct_end(&s->mdct128); + av_tx_uninit(&s->mdct1024); + av_tx_uninit(&s->mdct128); ff_psy_end(&s->psy); ff_lpc_end(&s->lpc); if (s->psypp) @@ -919,6 +1192,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s) { int ret = 0; + float scale = 32768.0f; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!s->fdsp) @@ -927,9 +1201,11 @@ // window init ff_aac_float_common_init(); - if ((ret = ff_mdct_init(&s->mdct1024, 11, 0, 32768.0)) < 0) + if ((ret = av_tx_init(&s->mdct1024, &s->mdct1024_fn, AV_TX_FLOAT_MDCT, 0, + 1024, &scale, 0)) < 0) return ret; - if ((ret = ff_mdct_init(&s->mdct128, 8, 0, 32768.0)) < 0) + if ((ret = av_tx_init(&s->mdct128, &s->mdct128_fn, AV_TX_FLOAT_MDCT, 0, + 128, &scale, 0)) < 0) return ret; return 0; @@ -1141,17 +1417,18 @@ const FFCodec ff_aac_encoder = { .p.name = "aac", - .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(AACEncContext), .init = aac_encode_init, FF_CODEC_ENCODE_CB(aac_encode_frame), .close = aac_encode_end, .defaults = aac_encode_defaults, .p.supported_samplerates = ff_mpeg4audio_sample_rates, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.priv_class = &aacenc_class, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -103,287 +103,16 @@ } AACPCEInfo; /** - * List of PCE (Program Configuration Element) for the channel layouts listed - * in channel_layout.h - * - * For those wishing in the future to add other layouts: - * - * - num_ele: number of elements in each group of front, side, back, lfe channels - * (an element is of type SCE (single channel), CPE (channel pair) for - * the first 3 groups; and is LFE for LFE group). - * - * - pairing: 0 for an SCE element or 1 for a CPE; does not apply to LFE group - * - * - index: there are three independent indices for SCE, CPE and LFE; - * they are incremented irrespective of the group to which the element belongs; - * they are not reset when going from one group to another - * - * Example: for 7.0 channel layout, - * .pairing = { { 1, 0 }, { 1 }, { 1 }, }, (3 CPE and 1 SCE in front group) - * .index = { { 0, 0 }, { 1 }, { 2 }, }, - * (index is 0 for the single SCE but goes from 0 to 2 for the CPEs) - * - * The index order impacts the channel ordering. But is otherwise arbitrary - * (the sequence could have been 2, 0, 1 instead of 0, 1, 2). - * - * Spec allows for discontinuous indices, e.g. if one has a total of two SCE, - * SCE.0 SCE.15 is OK per spec; BUT it won't be decoded by our AAC decoder - * which at this time requires that indices fully cover some range starting - * from 0 (SCE.1 SCE.0 is OK but not SCE.0 SCE.15). - * - * - config_map: total number of elements and their types. Beware, the way the - * types are ordered impacts the final channel ordering. - * - * - reorder_map: reorders the channels. - * - */ -static const AACPCEInfo aac_pce_configs[] = { - { - .layout = AV_CHANNEL_LAYOUT_MONO, - .num_ele = { 1, 0, 0, 0 }, - .pairing = { { 0 }, }, - .index = { { 0 }, }, - .config_map = { 1, TYPE_SCE, }, - .reorder_map = { 0 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_STEREO, - .num_ele = { 1, 0, 0, 0 }, - .pairing = { { 1 }, }, - .index = { { 0 }, }, - .config_map = { 1, TYPE_CPE, }, - .reorder_map = { 0, 1 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_2POINT1, - .num_ele = { 1, 0, 0, 1 }, - .pairing = { { 1 }, }, - .index = { { 0 },{ 0 },{ 0 },{ 0 } }, - .config_map = { 2, TYPE_CPE, TYPE_LFE }, - .reorder_map = { 0, 1, 2 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_2_1, - .num_ele = { 1, 0, 1, 0 }, - .pairing = { { 1 },{ 0 },{ 0 } }, - .index = { { 0 },{ 0 },{ 0 }, }, - .config_map = { 2, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_SURROUND, - .num_ele = { 2, 0, 0, 0 }, - .pairing = { { 1, 0 }, }, - .index = { { 0, 0 }, }, - .config_map = { 2, TYPE_CPE, TYPE_SCE, }, - .reorder_map = { 0, 1, 2 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_3POINT1, - .num_ele = { 2, 0, 0, 1 }, - .pairing = { { 1, 0 }, }, - .index = { { 0, 0 }, { 0 }, { 0 }, { 0 }, }, - .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_LFE }, - .reorder_map = { 0, 1, 2, 3 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_4POINT0, - .num_ele = { 2, 0, 1, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 0 }, }, - .index = { { 0, 0 }, { 0 }, { 1 } }, - .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_4POINT1, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 0 }, }, - .index = { { 0, 0 }, { 1 }, { 2 }, { 0 } }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_2_2, - .num_ele = { 1, 1, 0, 0 }, - .pairing = { { 1 }, { 1 }, }, - .index = { { 0 }, { 1 }, }, - .config_map = { 2, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_QUAD, - .num_ele = { 1, 0, 1, 0 }, - .pairing = { { 1 }, { 0 }, { 1 }, }, - .index = { { 0 }, { 0 }, { 1 } }, - .config_map = { 2, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_5POINT0, - .num_ele = { 2, 1, 0, 0 }, - .pairing = { { 1, 0 }, { 1 }, }, - .index = { { 0, 0 }, { 1 } }, - .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_5POINT1, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1 }, }, - .index = { { 0, 0 }, { 1 }, { 1 } }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_5POINT0_BACK, - .num_ele = { 2, 0, 1, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1 } }, - .index = { { 0, 0 }, { 0 }, { 1 } }, - .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_5POINT1_BACK, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1 }, }, - .index = { { 0, 0 }, { 1 }, { 1 } }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_6POINT0, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 1 }, { 0 }, }, - .index = { { 0, 0 }, { 1 }, { 1 } }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_6POINT0_FRONT, - .num_ele = { 2, 1, 0, 0 }, - .pairing = { { 1, 1 }, { 1 } }, - .index = { { 1, 0 }, { 2 }, }, - .config_map = { 3, TYPE_CPE, TYPE_CPE, TYPE_CPE, }, - .reorder_map = { 0, 1, 2, 3, 4, 5 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_HEXAGONAL, - .num_ele = { 2, 0, 2, 0 }, - .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, }, - .index = { { 0, 0 },{ 0 },{ 1, 1 } }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, }, - .reorder_map = { 0, 1, 2, 3, 4, 5 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_6POINT1, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, }, - .index = { { 0, 0 },{ 1 },{ 1, 2 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_6POINT1_BACK, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, }, - .index = { { 0, 0 }, { 1 }, { 1, 2 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_6POINT1_FRONT, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, }, - .index = { { 0, 0 }, { 1 }, { 1, 2 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_7POINT0, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 1 }, { 1 }, }, - .index = { { 0, 0 }, { 1 }, { 2 }, }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_7POINT0_FRONT, - .num_ele = { 2, 1, 1, 0 }, - .pairing = { { 1, 0 }, { 1 }, { 1 }, }, - .index = { { 0, 0 }, { 1 }, { 2 }, }, - .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_7POINT1, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, }, - .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_7POINT1_WIDE, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 0 },{ 1, 1 }, }, - .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, }, - .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_OCTAGONAL, - .num_ele = { 2, 1, 2, 0 }, - .pairing = { { 1, 0 }, { 1 }, { 1, 0 }, }, - .index = { { 0, 0 }, { 1 }, { 2, 1 } }, - .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 }, - }, - { /* Meant for order 2/mixed ambisonics */ - .layout = { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 9, - .u.mask = AV_CH_LAYOUT_OCTAGONAL | AV_CH_TOP_CENTER }, - .num_ele = { 2, 2, 2, 0 }, - .pairing = { { 1, 0 }, { 1, 0 }, { 1, 0 }, }, - .index = { { 0, 0 }, { 1, 1 }, { 2, 2 } }, - .config_map = { 6, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, - }, - { /* Meant for order 2/mixed ambisonics */ - .layout = { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = 10, - .u.mask = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_BACK_CENTER | - AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_TOP_CENTER }, - .num_ele = { 2, 2, 2, 0 }, - .pairing = { { 1, 1 }, { 1, 0 }, { 1, 0 }, }, - .index = { { 0, 1 }, { 2, 0 }, { 3, 1 } }, - .config_map = { 6, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, - }, - { - .layout = AV_CHANNEL_LAYOUT_HEXADECAGONAL, - .num_ele = { 4, 2, 4, 0 }, - .pairing = { { 1, 0, 1, 0 }, { 1, 1 }, { 1, 0, 1, 0 }, }, - .index = { { 0, 0, 1, 1 }, { 2, 3 }, { 4, 2, 5, 3 } }, - .config_map = { 10, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE }, - .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, - }, -}; - -/** * AAC encoder context */ typedef struct AACEncContext { AVClass *av_class; AACEncOptions options; ///< encoding options PutBitContext pb; - FFTContext mdct1024; ///< long (1024 samples) frame transform context - FFTContext mdct128; ///< short (128 samples) frame transform context + AVTXContext *mdct1024; ///< long (1024 samples) frame transform context + av_tx_fn mdct1024_fn; + AVTXContext *mdct128; ///< short (128 samples) frame transform context + av_tx_fn mdct128_fn; AVFloatDSPContext *fdsp; AACPCEInfo pce; ///< PCE data, if needed float *planar_samples[16]; ///< saved preprocessed input diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_is.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_is.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_is.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_is.c 2023-03-03 13:29:59.000000000 +0000 @@ -68,15 +68,15 @@ sce0->ics.swb_sizes[g], sce0->sf_idx[w*16+g], sce0->band_type[w*16+g], - s->lambda / band0->threshold, INFINITY, NULL, NULL, 0); + s->lambda / band0->threshold, INFINITY, NULL, NULL); dist1 += quantize_band_cost(s, &R[start + (w+w2)*128], R34, sce1->ics.swb_sizes[g], sce1->sf_idx[w*16+g], sce1->band_type[w*16+g], - s->lambda / band1->threshold, INFINITY, NULL, NULL, 0); + s->lambda / band1->threshold, INFINITY, NULL, NULL); dist2 += quantize_band_cost(s, IS, I34, sce0->ics.swb_sizes[g], is_sf_idx, is_band_type, - s->lambda / minthr, INFINITY, NULL, NULL, 0); + s->lambda / minthr, INFINITY, NULL, NULL); for (i = 0; i < sce0->ics.swb_sizes[g]; i++) { dist_spec_err += (L34[i] - I34[i])*(L34[i] - I34[i]); dist_spec_err += (R34[i] - I34[i]*e01_34)*(R34[i] - I34[i]*e01_34); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_ltp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_ltp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_ltp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_ltp.c 2023-03-03 13:29:59.000000000 +0000 @@ -194,11 +194,11 @@ s->abs_pow34(PCD34, PCD, sce->ics.swb_sizes[g]); dist1 += quantize_band_cost(s, &sce->coeffs[start+(w+w2)*128], C34, sce->ics.swb_sizes[g], sce->sf_idx[(w+w2)*16+g], sce->band_type[(w+w2)*16+g], - s->lambda/band->threshold, INFINITY, &bits_tmp1, NULL, 0); + s->lambda/band->threshold, INFINITY, &bits_tmp1, NULL); dist2 += quantize_band_cost(s, PCD, PCD34, sce->ics.swb_sizes[g], sce->sf_idx[(w+w2)*16+g], sce->band_type[(w+w2)*16+g], - s->lambda/band->threshold, INFINITY, &bits_tmp2, NULL, 0); + s->lambda/band->threshold, INFINITY, &bits_tmp2, NULL); bits1 += bits_tmp1; bits2 += bits_tmp2; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_pred.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_pred.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_pred.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_pred.c 2023-03-03 13:29:59.000000000 +0000 @@ -271,9 +271,9 @@ /* Normal coefficients */ s->abs_pow34(O34, &sce->coeffs[start_coef], num_coeffs); - dist1 = quantize_and_encode_band_cost(s, NULL, &sce->coeffs[start_coef], NULL, - O34, num_coeffs, sce->sf_idx[sfb], - cb_n, s->lambda / band->threshold, INFINITY, &cost1, NULL, 0); + dist1 = ff_quantize_and_encode_band_cost(s, NULL, &sce->coeffs[start_coef], NULL, + O34, num_coeffs, sce->sf_idx[sfb], + cb_n, s->lambda / band->threshold, INFINITY, &cost1, NULL); cost_coeffs += cost1; /* Encoded coefficients - needed for #bits, band type and quant. error */ @@ -284,9 +284,9 @@ cb_p = av_clip(find_min_book(find_max_val(1, num_coeffs, S34), sce->sf_idx[sfb]), cb_min, cb_max); else cb_p = cb_n; - quantize_and_encode_band_cost(s, NULL, SENT, QERR, S34, num_coeffs, - sce->sf_idx[sfb], cb_p, s->lambda / band->threshold, INFINITY, - &cost2, NULL, 0); + ff_quantize_and_encode_band_cost(s, NULL, SENT, QERR, S34, num_coeffs, + sce->sf_idx[sfb], cb_p, s->lambda / band->threshold, INFINITY, + &cost2, NULL); /* Reconstructed coefficients - needed for distortion measurements */ for (i = 0; i < num_coeffs; i++) @@ -296,9 +296,9 @@ cb_p = av_clip(find_min_book(find_max_val(1, num_coeffs, P34), sce->sf_idx[sfb]), cb_min, cb_max); else cb_p = cb_n; - dist2 = quantize_and_encode_band_cost(s, NULL, &sce->prcoeffs[start_coef], NULL, - P34, num_coeffs, sce->sf_idx[sfb], - cb_p, s->lambda / band->threshold, INFINITY, NULL, NULL, 0); + dist2 = ff_quantize_and_encode_band_cost(s, NULL, &sce->prcoeffs[start_coef], NULL, + P34, num_coeffs, sce->sf_idx[sfb], + cb_p, s->lambda / band->threshold, INFINITY, NULL, NULL); for (i = 0; i < num_coeffs; i++) dist_spec_err += (O34[i] - P34[i])*(O34[i] - P34[i]); dist_spec_err *= s->lambda / band->threshold; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,256 +28,41 @@ #ifndef AVCODEC_AACENC_QUANTIZATION_H #define AVCODEC_AACENC_QUANTIZATION_H -#include "aactab.h" -#include "aacenc.h" -#include "aacenctab.h" -#include "aacenc_utils.h" - -/** - * Calculate rate distortion cost for quantizing with given codebook - * - * @return quantization distortion - */ -static av_always_inline float quantize_and_encode_band_cost_template( - struct AACEncContext *s, - PutBitContext *pb, const float *in, float *out, - const float *scaled, int size, int scale_idx, - int cb, const float lambda, const float uplim, - int *bits, float *energy, int BT_ZERO, int BT_UNSIGNED, - int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO, - const float ROUNDING) -{ - const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512; - const float Q = ff_aac_pow2sf_tab [q_idx]; - const float Q34 = ff_aac_pow34sf_tab[q_idx]; - const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; - const float CLIPPED_ESCAPE = 165140.0f*IQ; - int i, j; - float cost = 0; - float qenergy = 0; - const int dim = BT_PAIR ? 2 : 4; - int resbits = 0; - int off; - - if (BT_ZERO || BT_NOISE || BT_STEREO) { - for (i = 0; i < size; i++) - cost += in[i]*in[i]; - if (bits) - *bits = 0; - if (energy) - *energy = qenergy; - if (out) { - for (i = 0; i < size; i += dim) - for (j = 0; j < dim; j++) - out[i+j] = 0.0f; - } - return cost * lambda; - } - if (!scaled) { - s->abs_pow34(s->scoefs, in, size); - scaled = s->scoefs; - } - s->quant_bands(s->qcoefs, in, scaled, size, !BT_UNSIGNED, aac_cb_maxval[cb], Q34, ROUNDING); - if (BT_UNSIGNED) { - off = 0; - } else { - off = aac_cb_maxval[cb]; - } - for (i = 0; i < size; i += dim) { - const float *vec; - int *quants = s->qcoefs + i; - int curidx = 0; - int curbits; - float quantized, rd = 0.0f; - for (j = 0; j < dim; j++) { - curidx *= aac_cb_range[cb]; - curidx += quants[j] + off; - } - curbits = ff_aac_spectral_bits[cb-1][curidx]; - vec = &ff_aac_codebook_vectors[cb-1][curidx*dim]; - if (BT_UNSIGNED) { - for (j = 0; j < dim; j++) { - float t = fabsf(in[i+j]); - float di; - if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow - if (t >= CLIPPED_ESCAPE) { - quantized = CLIPPED_ESCAPE; - curbits += 21; - } else { - int c = av_clip_uintp2(quant(t, Q, ROUNDING), 13); - quantized = c*cbrtf(c)*IQ; - curbits += av_log2(c)*2 - 4 + 1; - } - } else { - quantized = vec[j]*IQ; - } - di = t - quantized; - if (out) - out[i+j] = in[i+j] >= 0 ? quantized : -quantized; - if (vec[j] != 0.0f) - curbits++; - qenergy += quantized*quantized; - rd += di*di; - } - } else { - for (j = 0; j < dim; j++) { - quantized = vec[j]*IQ; - qenergy += quantized*quantized; - if (out) - out[i+j] = quantized; - rd += (in[i+j] - quantized)*(in[i+j] - quantized); - } - } - cost += rd * lambda + curbits; - resbits += curbits; - if (cost >= uplim) - return uplim; - if (pb) { - put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]); - if (BT_UNSIGNED) - for (j = 0; j < dim; j++) - if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f) - put_bits(pb, 1, in[i+j] < 0.0f); - if (BT_ESC) { - for (j = 0; j < 2; j++) { - if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) { - int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13); - int len = av_log2(coef); - - put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2); - put_sbits(pb, len, coef); - } - } - } - } - } - - if (bits) - *bits = resbits; - if (energy) - *energy = qenergy; - return cost; -} +#include -static inline float quantize_and_encode_band_cost_NONE(struct AACEncContext *s, PutBitContext *pb, - const float *in, float *quant, const float *scaled, - int size, int scale_idx, int cb, - const float lambda, const float uplim, - int *bits, float *energy) { - av_assert0(0); - return 0.0f; -} +#include "aacenc.h" +#include "put_bits.h" -#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, ROUNDING) \ -static float quantize_and_encode_band_cost_ ## NAME( \ - struct AACEncContext *s, \ - PutBitContext *pb, const float *in, float *quant, \ - const float *scaled, int size, int scale_idx, \ - int cb, const float lambda, const float uplim, \ - int *bits, float *energy) { \ - return quantize_and_encode_band_cost_template( \ - s, pb, in, quant, scaled, size, scale_idx, \ - BT_ESC ? ESC_BT : cb, lambda, uplim, bits, energy, \ - BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, \ - ROUNDING); \ -} -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO, 1, 0, 0, 0, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC, 0, 1, 1, 1, 0, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC_RTZ, 0, 1, 1, 1, 0, 0, ROUND_TO_ZERO) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NOISE, 0, 0, 0, 0, 1, 0, ROUND_STANDARD) -QUANTIZE_AND_ENCODE_BAND_COST_FUNC(STEREO,0, 0, 0, 0, 0, 1, ROUND_STANDARD) - -static float (*const quantize_and_encode_band_cost_arr[])( - struct AACEncContext *s, - PutBitContext *pb, const float *in, float *quant, - const float *scaled, int size, int scale_idx, - int cb, const float lambda, const float uplim, - int *bits, float *energy) = { - quantize_and_encode_band_cost_ZERO, - quantize_and_encode_band_cost_SQUAD, - quantize_and_encode_band_cost_SQUAD, - quantize_and_encode_band_cost_UQUAD, - quantize_and_encode_band_cost_UQUAD, - quantize_and_encode_band_cost_SPAIR, - quantize_and_encode_band_cost_SPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_ESC, - quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */ - quantize_and_encode_band_cost_NOISE, - quantize_and_encode_band_cost_STEREO, - quantize_and_encode_band_cost_STEREO, -}; - -static float (*const quantize_and_encode_band_cost_rtz_arr[])( - struct AACEncContext *s, - PutBitContext *pb, const float *in, float *quant, - const float *scaled, int size, int scale_idx, - int cb, const float lambda, const float uplim, - int *bits, float *energy) = { - quantize_and_encode_band_cost_ZERO, - quantize_and_encode_band_cost_SQUAD, - quantize_and_encode_band_cost_SQUAD, - quantize_and_encode_band_cost_UQUAD, - quantize_and_encode_band_cost_UQUAD, - quantize_and_encode_band_cost_SPAIR, - quantize_and_encode_band_cost_SPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_UPAIR, - quantize_and_encode_band_cost_ESC_RTZ, - quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */ - quantize_and_encode_band_cost_NOISE, - quantize_and_encode_band_cost_STEREO, - quantize_and_encode_band_cost_STEREO, -}; - -#define quantize_and_encode_band_cost( \ - s, pb, in, quant, scaled, size, scale_idx, cb, \ - lambda, uplim, bits, energy, rtz) \ - ((rtz) ? quantize_and_encode_band_cost_rtz_arr : quantize_and_encode_band_cost_arr)[cb]( \ - s, pb, in, quant, scaled, size, scale_idx, cb, \ - lambda, uplim, bits, energy) +float ff_quantize_and_encode_band_cost(AACEncContext *s, PutBitContext *pb, + const float *in, float *quant, const float *scaled, + int size, int scale_idx, int cb, + const float lambda, const float uplim, + int *bits, float *energy); static inline float quantize_band_cost(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, - int *bits, float *energy, int rtz) + int *bits, float *energy) { - return quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, - cb, lambda, uplim, bits, energy, rtz); + return ff_quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, + cb, lambda, uplim, bits, energy); } static inline int quantize_band_cost_bits(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, - int *bits, float *energy, int rtz) + int *bits, float *energy) { int auxbits; - quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, - cb, 0.0f, uplim, &auxbits, energy, rtz); + ff_quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, + cb, 0.0f, uplim, &auxbits, energy); if (bits) { *bits = auxbits; } return auxbits; } -static inline void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb, - const float *in, float *out, int size, int scale_idx, - int cb, const float lambda, int rtz) -{ - quantize_and_encode_band_cost(s, pb, in, out, NULL, size, scale_idx, cb, lambda, - INFINITY, NULL, NULL, rtz); -} - #include "aacenc_quantization_misc.h" #endif /* AVCODEC_AACENC_QUANTIZATION_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization_misc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization_misc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization_misc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_quantization_misc.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ entry = &s->quantize_band_cost_cache[scale_idx][w*16+g]; if (entry->generation != s->quantize_band_cost_cache_generation || entry->cb != cb || entry->rtz != rtz) { entry->rd = quantize_band_cost(s, in, scaled, size, scale_idx, - cb, lambda, uplim, &entry->bits, &entry->energy, rtz); + cb, lambda, uplim, &entry->bits, &entry->energy); entry->cb = cb; entry->rtz = rtz; entry->generation = s->quantize_band_cost_cache_generation; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_tns.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_tns.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_tns.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacenc_tns.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,6 @@ #include "aacenc_tns.h" #include "aactab.h" #include "aacenc_utils.h" -#include "aacenc_quantization.h" /* Could be set to 3 to save an additional bit at the cost of little quality */ #define TNS_Q_BITS 4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac.h 2023-03-03 13:29:59.000000000 +0000 @@ -36,11 +36,8 @@ #include "libavutil/float_dsp.h" #include "libavutil/fixed_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" -#if !USE_FIXED -#include "mdct15.h" -#endif -#include "fft.h" #include "mpeg4audio.h" #include "sbr.h" @@ -326,16 +323,24 @@ * @name Computed / set up during initialization * @{ */ - FFTContext mdct; - FFTContext mdct_small; - FFTContext mdct_ld; - FFTContext mdct_ltp; + AVTXContext *mdct120; + AVTXContext *mdct128; + AVTXContext *mdct480; + AVTXContext *mdct512; + AVTXContext *mdct960; + AVTXContext *mdct1024; + AVTXContext *mdct_ltp; + + av_tx_fn mdct120_fn; + av_tx_fn mdct128_fn; + av_tx_fn mdct480_fn; + av_tx_fn mdct512_fn; + av_tx_fn mdct960_fn; + av_tx_fn mdct1024_fn; + av_tx_fn mdct_ltp_fn; #if USE_FIXED AVFixedDSPContext *fdsp; #else - MDCT15Context *mdct120; - MDCT15Context *mdct480; - MDCT15Context *mdct960; AVFloatDSPContext *fdsp; #endif /* USE_FIXED */ int random_state; @@ -366,6 +371,7 @@ int warned_960_sbr; unsigned warned_71_wide; int warned_gain_control; + int warned_he_aac_mono; /* aacdec functions pointers */ void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aac_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,7 @@ #include "get_bits.h" #include "mpeg4audio.h" -static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, - int *need_next_header, int *new_frame_start) +static int aac_sync(uint64_t state, int *need_next_header, int *new_frame_start) { GetBitContext bits; AACADTSHeaderInfo hdr; @@ -46,10 +45,6 @@ return 0; *need_next_header = 0; *new_frame_start = 1; - hdr_info->sample_rate = hdr.sample_rate; - hdr_info->channels = ff_mpeg4audio_channels[hdr.chan_config]; - hdr_info->samples = hdr.samples; - hdr_info->bit_rate = hdr.bit_rate; return size; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -55,6 +55,7 @@ void ff_psdsp_init_arm(PSDSPContext *s); void ff_psdsp_init_aarch64(PSDSPContext *s); void ff_psdsp_init_mips(PSDSPContext *s); +void ff_psdsp_init_riscv(PSDSPContext *s); void ff_psdsp_init_x86(PSDSPContext *s); #endif /* AVCODEC_AACPSDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacpsdsp_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,21 +47,24 @@ const INTFLOAT (*filter)[8][2], ptrdiff_t stride, int n) { - int i, j; + INT64FLOAT inre0[6], inre1[6], inim0[6], inim1[6]; - for (i = 0; i < n; i++) { + for (int j = 0; j < 6; j++) { + inre0[j] = in[j][0] + in[12 - j][0]; + inre1[j] = in[j][1] - in[12 - j][1]; + inim0[j] = in[j][1] + in[12 - j][1]; + inim1[j] = in[j][0] - in[12 - j][0]; + } + + for (int i = 0; i < n; i++) { INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0]; INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1]; - for (j = 0; j < 6; j++) { - INT64FLOAT in0_re = in[j][0]; - INT64FLOAT in0_im = in[j][1]; - INT64FLOAT in1_re = in[12-j][0]; - INT64FLOAT in1_im = in[12-j][1]; - sum_re += (INT64FLOAT)filter[i][j][0] * (in0_re + in1_re) - - (INT64FLOAT)filter[i][j][1] * (in0_im - in1_im); - sum_im += (INT64FLOAT)filter[i][j][0] * (in0_im + in1_im) + - (INT64FLOAT)filter[i][j][1] * (in0_re - in1_re); + for (int j = 0; j < 6; j++) { + sum_re += (INT64FLOAT)filter[i][j][0] * inre0[j] - + (INT64FLOAT)filter[i][j][1] * inre1[j]; + sum_im += (INT64FLOAT)filter[i][j][0] * inim0[j] + + (INT64FLOAT)filter[i][j][1] * inim1[j]; } #if USE_FIXED out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31); @@ -227,6 +230,8 @@ ff_psdsp_init_aarch64(s); #elif ARCH_MIPS ff_psdsp_init_mips(s); +#elif ARCH_RISCV + ff_psdsp_init_riscv(s); #elif ARCH_X86 ff_psdsp_init_x86(s); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacps_tablegen.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacps_tablegen.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacps_tablegen.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacps_tablegen.h 2023-03-03 13:29:59.000000000 +0000 @@ -34,7 +34,7 @@ #include "libavutil/common.h" #include "libavutil/libm.h" #include "libavutil/mathematics.h" -#include "libavutil/mem.h" +#include "libavutil/mem_internal.h" #define NR_ALLPASS_BANDS20 30 #define NR_ALLPASS_BANDS34 50 #define PS_AP_LINKS 3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,6 @@ #include "sbr.h" #include "aacsbr.h" #include "aacsbrdata.h" -#include "fft.h" #include "internal.h" #include "aacps.h" #include "sbrdsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbrdata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbrdata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbrdata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbrdata.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #define AVCODEC_AACSBRDATA_H #include +#include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" #include "aac_defines.h" @@ -268,7 +269,7 @@ }; /* First eight entries repeated at end to simplify SIMD implementations. */ -const DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sbr_noise_table))[][2] = { +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)}, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -60,7 +60,6 @@ #include "sbr.h" #include "aacsbr.h" #include "aacsbrdata.h" -#include "fft.h" #include "aacps.h" #include "sbrdsp.h" #include "libavutil/internal.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr.h 2023-03-03 13:29:59.000000000 +0000 @@ -81,7 +81,7 @@ /** Initialize SBR. */ void AAC_RENAME(ff_aac_sbr_init)(void); /** Initialize one SBR context. */ -void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac); +int AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac); /** Close one SBR context. */ void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr); /** Decode one SBR element. */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aacsbr_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -89,10 +89,14 @@ memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters)); } -av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac) +av_cold int AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac) { - if(sbr->mdct.mdct_bits) - return; + int ret; + float scale; + + if (sbr->mdct) + return 0; + sbr->kx[0] = sbr->kx[1]; sbr->id_aac = id_aac; sbr_turnoff(sbr); @@ -101,17 +105,32 @@ /* SBR requires samples to be scaled to +/-32768.0 to work correctly. * mdct scale factors are adjusted to scale up from +/-1.0 at analysis * and scale back down at synthesis. */ - AAC_RENAME_32(ff_mdct_init)(&sbr->mdct, 7, 1, 1.0 / (64 * 32768.0)); - AAC_RENAME_32(ff_mdct_init)(&sbr->mdct_ana, 7, 1, -2.0 * 32768.0); + + scale = USE_FIXED ? 1 : 1.0 / (64 * 32768); + ret = av_tx_init(&sbr->mdct, &sbr->mdct_fn, + USE_FIXED ? AV_TX_INT32_MDCT : AV_TX_FLOAT_MDCT, + 1, 64, &scale, 0); + if (ret < 0) + return ret; + + scale = USE_FIXED ? -1.0 : -2.0 * 32768; + ret = av_tx_init(&sbr->mdct_ana, &sbr->mdct_ana_fn, + USE_FIXED ? AV_TX_INT32_MDCT : AV_TX_FLOAT_MDCT, + 1, 64, &scale, 0); + if (ret < 0) + return ret; + AAC_RENAME(ff_ps_ctx_init)(&sbr->ps); AAC_RENAME(ff_sbrdsp_init)(&sbr->dsp); aacsbr_func_ptr_init(&sbr->c); + + return 0; } av_cold void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr) { - AAC_RENAME_32(ff_mdct_end)(&sbr->mdct); - AAC_RENAME_32(ff_mdct_end)(&sbr->mdct_ana); + av_tx_uninit(&sbr->mdct); + av_tx_uninit(&sbr->mdct_ana); } static int qsort_comparison_function_int16(const void *a, const void *b) @@ -955,6 +974,8 @@ } 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; + // ensure the warning is not printed if PS extension is present + ac->warned_he_aac_mono = 1; } break; default: @@ -1162,9 +1183,11 @@ */ #ifndef sbr_qmf_analysis #if USE_FIXED -static void sbr_qmf_analysis(AVFixedDSPContext *dsp, FFTContext *mdct, +static void sbr_qmf_analysis(AVFixedDSPContext *dsp, AVTXContext *mdct, + av_tx_fn mdct_fn, #else -static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct, +static void sbr_qmf_analysis(AVFloatDSPContext *dsp, AVTXContext *mdct, + av_tx_fn mdct_fn, #endif /* USE_FIXED */ SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x, INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx) @@ -1195,7 +1218,7 @@ } } #endif - mdct->imdct_half(mdct, z, z+64); + mdct_fn(mdct, z, z + 64, sizeof(INTFLOAT)); sbrdsp->qmf_post_shuffle(W[buf_idx][i], z); x += 32; } @@ -1207,7 +1230,7 @@ * (14496-3 sp04 p206) */ #ifndef sbr_qmf_synthesis -static void sbr_qmf_synthesis(FFTContext *mdct, +static void sbr_qmf_synthesis(AVTXContext *mdct, av_tx_fn mdct_fn, #if USE_FIXED SBRDSPContext *sbrdsp, AVFixedDSPContext *dsp, #else @@ -1235,12 +1258,12 @@ X[0][i][ n] = -X[0][i][n]; X[0][i][32+n] = X[1][i][31-n]; } - mdct->imdct_half(mdct, mdct_buf[0], X[0][i]); + mdct_fn(mdct, mdct_buf[0], X[0][i], sizeof(INTFLOAT)); sbrdsp->qmf_deint_neg(v, mdct_buf[0]); } else { sbrdsp->neg_odd_64(X[1][i]); - mdct->imdct_half(mdct, mdct_buf[0], X[0][i]); - mdct->imdct_half(mdct, mdct_buf[1], X[1][i]); + mdct_fn(mdct, mdct_buf[0], X[0][i], sizeof(INTFLOAT)); + mdct_fn(mdct, mdct_buf[1], X[1][i], sizeof(INTFLOAT)); sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]); } dsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div); @@ -1505,7 +1528,8 @@ } for (ch = 0; ch < nch; ch++) { /* decode channel */ - sbr_qmf_analysis(ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples, + sbr_qmf_analysis(ac->fdsp, sbr->mdct_ana, sbr->mdct_ana_fn, &sbr->dsp, + ch ? R : L, sbr->data[ch].analysis_filterbank_samples, (INTFLOAT*)sbr->qmf_filter_scratch, sbr->data[ch].W, sbr->data[ch].Ypos); sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low, @@ -1552,13 +1576,13 @@ nch = 2; } - sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp, + sbr_qmf_synthesis(sbr->mdct, sbr->mdct_fn, &sbr->dsp, ac->fdsp, L, sbr->X[0], sbr->qmf_filter_scratch, sbr->data[0].synthesis_filterbank_samples, &sbr->data[0].synthesis_filterbank_samples_offset, downsampled); if (nch == 2) - sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp, + sbr_qmf_synthesis(sbr->mdct, sbr->mdct_fn, &sbr->dsp, ac->fdsp, R, sbr->X[1], sbr->qmf_filter_scratch, sbr->data[1].synthesis_filterbank_samples, &sbr->data[1].synthesis_filterbank_samples_offset, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,8 +38,10 @@ int cpu_flags = av_get_cpu_flags(); if (have_neon(cpu_flags)) { - s->fft_permute = ff_fft_permute_neon; - s->fft_calc = ff_fft_calc_neon; + if (s->nbits < 17) { + s->fft_permute = ff_fft_permute_neon; + s->fft_calc = ff_fft_calc_neon; + } #if CONFIG_MDCT s->imdct_calc = ff_imdct_calc_neon; s->imdct_half = ff_imdct_half_neon; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fft_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -342,8 +342,7 @@ function fft\n\()_neon, align=6 AARCH64_VALID_JUMP_TARGET AARCH64_SIGN_LINK_REGISTER - sub sp, sp, #16 - stp x28, x30, [sp] + stp x28, x30, [sp, #-16]! add x28, x0, #\n4*2*8 bl fft\n2\()_neon mov x0, x28 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fmtconvert_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fmtconvert_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fmtconvert_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/fmtconvert_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,6 @@ #include "libavutil/attributes.h" #include "libavutil/aarch64/cpu.h" -#include "libavcodec/avcodec.h" #include "libavcodec/fmtconvert.h" void ff_int32_to_float_fmul_array8_neon(FmtConvertContext *c, float *dst, @@ -31,8 +30,7 @@ void ff_int32_to_float_fmul_scalar_neon(float *dst, const int32_t *src, float mul, int len); -av_cold void ff_fmt_convert_init_aarch64(FmtConvertContext *c, - AVCodecContext *avctx) +av_cold void ff_fmt_convert_init_aarch64(FmtConvertContext *c) { int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264chroma_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,18 +28,18 @@ #include "config.h" -void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc2_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264cmc_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264cmc_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264cmc_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264cmc_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "libavutil/aarch64/asm.S" -/* chroma_mc8(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ +/* chroma_mc8(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ .macro h264_chroma_mc8 type, codec=h264 function ff_\type\()_\codec\()_chroma_mc8_neon, export=1 .ifc \type,avg @@ -193,7 +193,7 @@ endfunc .endm -/* chroma_mc4(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ +/* chroma_mc4(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ .macro h264_chroma_mc4 type, codec=h264 function ff_\type\()_\codec\()_chroma_mc4_neon, export=1 .ifc \type,avg diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264idct_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264idct_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264idct_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/h264idct_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -157,8 +157,7 @@ endfunc function ff_h264_idct_add8_neon, export=1 - sub sp, sp, #0x40 - stp x19, x20, [sp] + stp x19, x20, [sp, #-0x40]! mov x12, x30 ldp x6, x15, [x0] // dest[0], dest[1] add x5, x1, #16*4 // block_offset @@ -187,8 +186,7 @@ csel x6, x15, x6, eq cmp x10, #20 b.lt 1b - ldp x19, x20, [sp] - add sp, sp, #0x40 + ldp x19, x20, [sp], #0x40 ret x12 endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -5,7 +5,7 @@ * * Ported from arm/hevcdsp_idct_neon.S by * Copyright (c) 2020 Reimar Döffinger - * Copyright (c) 2020 Josh Dekker + * Copyright (c) 2020 J. Dekker * * This file is part of FFmpeg. * @@ -27,21 +27,21 @@ #include "libavutil/aarch64/asm.S" const trans, align=4 - .short 64, 83, 64, 36 - .short 89, 75, 50, 18 - .short 90, 87, 80, 70 - .short 57, 43, 25, 9 - .short 90, 90, 88, 85 - .short 82, 78, 73, 67 - .short 61, 54, 46, 38 - .short 31, 22, 13, 4 + .short 64, 83, 64, 36 + .short 89, 75, 50, 18 + .short 90, 87, 80, 70 + .short 57, 43, 25, 9 + .short 90, 90, 88, 85 + .short 82, 78, 73, 67 + .short 61, 54, 46, 38 + .short 31, 22, 13, 4 endconst -.macro clip10 in1, in2, c1, c2 - smax \in1, \in1, \c1 - smax \in2, \in2, \c1 - smin \in1, \in1, \c2 - smin \in2, \in2, \c2 +.macro clip2 in1, in2, min, max + smax \in1, \in1, \min + smax \in2, \in2, \min + smin \in1, \in1, \max + smin \in2, \in2, \max .endm function ff_hevc_add_residual_4x4_8_neon, export=1 @@ -50,13 +50,13 @@ ld1 {v2.s}[1], [x0], x2 ld1 {v2.s}[2], [x0], x2 ld1 {v2.s}[3], [x0], x2 - sub x0, x0, x2, lsl #2 - uxtl v6.8h, v2.8b - uxtl2 v7.8h, v2.16b - sqadd v0.8h, v0.8h, v6.8h - sqadd v1.8h, v1.8h, v7.8h - sqxtun v0.8b, v0.8h - sqxtun2 v0.16b, v1.8h + sub x0, x0, x2, lsl #2 + uxtl v6.8h, v2.8b + uxtl2 v7.8h, v2.16b + sqadd v0.8h, v0.8h, v6.8h + sqadd v1.8h, v1.8h, v7.8h + sqxtun v0.8b, v0.8h + sqxtun2 v0.16b, v1.8h st1 {v0.s}[0], [x0], x2 st1 {v0.s}[1], [x0], x2 st1 {v0.s}[2], [x0], x2 @@ -64,69 +64,31 @@ ret endfunc -function ff_hevc_add_residual_4x4_10_neon, export=1 - mov x12, x0 - ld1 {v0.8h-v1.8h}, [x1] - ld1 {v2.d}[0], [x12], x2 - ld1 {v2.d}[1], [x12], x2 - ld1 {v3.d}[0], [x12], x2 - sqadd v0.8h, v0.8h, v2.8h - ld1 {v3.d}[1], [x12], x2 - movi v4.8h, #0 - sqadd v1.8h, v1.8h, v3.8h - mvni v5.8h, #0xFC, lsl #8 // movi #0x3FF - clip10 v0.8h, v1.8h, v4.8h, v5.8h - st1 {v0.d}[0], [x0], x2 - st1 {v0.d}[1], [x0], x2 - st1 {v1.d}[0], [x0], x2 - st1 {v1.d}[1], [x0], x2 - ret -endfunc - function ff_hevc_add_residual_8x8_8_neon, export=1 - add x12, x0, x2 - add x2, x2, x2 - mov x3, #8 -1: subs x3, x3, #2 - ld1 {v2.d}[0], [x0] - ld1 {v2.d}[1], [x12] - uxtl v3.8h, v2.8b - ld1 {v0.8h-v1.8h}, [x1], #32 - uxtl2 v2.8h, v2.16b - sqadd v0.8h, v0.8h, v3.8h - sqadd v1.8h, v1.8h, v2.8h - sqxtun v0.8b, v0.8h - sqxtun2 v0.16b, v1.8h - st1 {v0.d}[0], [x0], x2 - st1 {v0.d}[1], [x12], x2 - bne 1b - ret -endfunc - -function ff_hevc_add_residual_8x8_10_neon, export=1 - add x12, x0, x2 - add x2, x2, x2 - mov x3, #8 - movi v4.8h, #0 - mvni v5.8h, #0xFC, lsl #8 // movi #0x3FF -1: subs x3, x3, #2 + add x12, x0, x2 + add x2, x2, x2 + mov x3, #8 +1: subs x3, x3, #2 + ld1 {v2.d}[0], [x0] + ld1 {v2.d}[1], [x12] + uxtl v3.8h, v2.8b ld1 {v0.8h-v1.8h}, [x1], #32 - ld1 {v2.8h}, [x0] - sqadd v0.8h, v0.8h, v2.8h - ld1 {v3.8h}, [x12] - sqadd v1.8h, v1.8h, v3.8h - clip10 v0.8h, v1.8h, v4.8h, v5.8h - st1 {v0.8h}, [x0], x2 - st1 {v1.8h}, [x12], x2 - bne 1b + uxtl2 v2.8h, v2.16b + sqadd v0.8h, v0.8h, v3.8h + sqadd v1.8h, v1.8h, v2.8h + sqxtun v0.8b, v0.8h + sqxtun2 v0.16b, v1.8h + st1 {v0.d}[0], [x0], x2 + st1 {v0.d}[1], [x12], x2 + bne 1b ret endfunc function ff_hevc_add_residual_16x16_8_neon, export=1 - mov x3, #16 + mov x3, #16 add x12, x0, x2 - add x2, x2, x2 -1: subs x3, x3, #2 + add x2, x2, x2 +1: subs x3, x3, #2 ld1 {v16.16b}, [x0] ld1 {v0.8h-v3.8h}, [x1], #64 ld1 {v19.16b}, [x12] @@ -134,47 +96,25 @@ uxtl2 v18.8h, v16.16b uxtl v20.8h, v19.8b uxtl2 v21.8h, v19.16b - sqadd v0.8h, v0.8h, v17.8h - sqadd v1.8h, v1.8h, v18.8h - sqadd v2.8h, v2.8h, v20.8h - sqadd v3.8h, v3.8h, v21.8h - sqxtun v0.8b, v0.8h + sqadd v0.8h, v0.8h, v17.8h + sqadd v1.8h, v1.8h, v18.8h + sqadd v2.8h, v2.8h, v20.8h + sqadd v3.8h, v3.8h, v21.8h + sqxtun v0.8b, v0.8h sqxtun2 v0.16b, v1.8h - sqxtun v1.8b, v2.8h + sqxtun v1.8b, v2.8h sqxtun2 v1.16b, v3.8h st1 {v0.16b}, [x0], x2 st1 {v1.16b}, [x12], x2 - bne 1b - ret -endfunc - -function ff_hevc_add_residual_16x16_10_neon, export=1 - mov x3, #16 - movi v20.8h, #0 - mvni v21.8h, #0xFC, lsl #8 // movi #0x3FF - add x12, x0, x2 - add x2, x2, x2 -1: subs x3, x3, #2 - ld1 {v16.8h-v17.8h}, [x0] - ld1 {v0.8h-v3.8h}, [x1], #64 - sqadd v0.8h, v0.8h, v16.8h - ld1 {v18.8h-v19.8h}, [x12] - sqadd v1.8h, v1.8h, v17.8h - sqadd v2.8h, v2.8h, v18.8h - sqadd v3.8h, v3.8h, v19.8h - clip10 v0.8h, v1.8h, v20.8h, v21.8h - clip10 v2.8h, v3.8h, v20.8h, v21.8h - st1 {v0.8h-v1.8h}, [x0], x2 - st1 {v2.8h-v3.8h}, [x12], x2 - bne 1b + bne 1b ret endfunc function ff_hevc_add_residual_32x32_8_neon, export=1 add x12, x0, x2 - add x2, x2, x2 - mov x3, #32 -1: subs x3, x3, #2 + add x2, x2, x2 + mov x3, #32 +1: subs x3, x3, #2 ld1 {v20.16b, v21.16b}, [x0] uxtl v16.8h, v20.8b uxtl2 v17.8h, v20.16b @@ -187,43 +127,121 @@ uxtl2 v21.8h, v22.16b uxtl v22.8h, v23.8b uxtl2 v23.8h, v23.16b - sqadd v0.8h, v0.8h, v16.8h - sqadd v1.8h, v1.8h, v17.8h - sqadd v2.8h, v2.8h, v18.8h - sqadd v3.8h, v3.8h, v19.8h - sqadd v4.8h, v4.8h, v20.8h - sqadd v5.8h, v5.8h, v21.8h - sqadd v6.8h, v6.8h, v22.8h - sqadd v7.8h, v7.8h, v23.8h - sqxtun v0.8b, v0.8h + sqadd v0.8h, v0.8h, v16.8h + sqadd v1.8h, v1.8h, v17.8h + sqadd v2.8h, v2.8h, v18.8h + sqadd v3.8h, v3.8h, v19.8h + sqadd v4.8h, v4.8h, v20.8h + sqadd v5.8h, v5.8h, v21.8h + sqadd v6.8h, v6.8h, v22.8h + sqadd v7.8h, v7.8h, v23.8h + sqxtun v0.8b, v0.8h sqxtun2 v0.16b, v1.8h - sqxtun v1.8b, v2.8h + sqxtun v1.8b, v2.8h sqxtun2 v1.16b, v3.8h - sqxtun v2.8b, v4.8h + sqxtun v2.8b, v4.8h sqxtun2 v2.16b, v5.8h - st1 {v0.16b, v1.16b}, [x0], x2 - sqxtun v3.8b, v6.8h + st1 {v0.16b, v1.16b}, [x0], x2 + sqxtun v3.8b, v6.8h sqxtun2 v3.16b, v7.8h st1 {v2.16b, v3.16b}, [x12], x2 - bne 1b + bne 1b ret endfunc -function ff_hevc_add_residual_32x32_10_neon, export=1 - mov x3, #32 +.macro add_res bitdepth +function ff_hevc_add_residual_4x4_\bitdepth\()_neon, export=1 + mvni v21.8h, #((0xFF << (\bitdepth - 8)) & 0xFF), lsl #8 + b hevc_add_residual_4x4_16_neon +endfunc +function ff_hevc_add_residual_8x8_\bitdepth\()_neon, export=1 + mvni v21.8h, #((0xFF << (\bitdepth - 8)) & 0xFF), lsl #8 + b hevc_add_residual_8x8_16_neon +endfunc +function ff_hevc_add_residual_16x16_\bitdepth\()_neon, export=1 + mvni v21.8h, #((0xFF << (\bitdepth - 8)) & 0xFF), lsl #8 + b hevc_add_residual_16x16_16_neon +endfunc +function ff_hevc_add_residual_32x32_\bitdepth\()_neon, export=1 + mvni v21.8h, #((0xFF << (\bitdepth - 8)) & 0xFF), lsl #8 + b hevc_add_residual_32x32_16_neon +endfunc +.endm + +add_res 10 +add_res 12 + +function hevc_add_residual_4x4_16_neon, export=0 + mov x12, x0 + ld1 {v0.8h-v1.8h}, [x1] + ld1 {v2.d}[0], [x12], x2 + ld1 {v2.d}[1], [x12], x2 + ld1 {v3.d}[0], [x12], x2 + sqadd v0.8h, v0.8h, v2.8h + ld1 {v3.d}[1], [x12], x2 + movi v4.8h, #0 + sqadd v1.8h, v1.8h, v3.8h + clip2 v0.8h, v1.8h, v4.8h, v21.8h + st1 {v0.d}[0], [x0], x2 + st1 {v0.d}[1], [x0], x2 + st1 {v1.d}[0], [x0], x2 + st1 {v1.d}[1], [x0], x2 + ret +endfunc + +function hevc_add_residual_8x8_16_neon, export=0 + add x12, x0, x2 + add x2, x2, x2 + mov x3, #8 + movi v4.8h, #0 +1: subs x3, x3, #2 + ld1 {v0.8h-v1.8h}, [x1], #32 + ld1 {v2.8h}, [x0] + sqadd v0.8h, v0.8h, v2.8h + ld1 {v3.8h}, [x12] + sqadd v1.8h, v1.8h, v3.8h + clip2 v0.8h, v1.8h, v4.8h, v21.8h + st1 {v0.8h}, [x0], x2 + st1 {v1.8h}, [x12], x2 + bne 1b + ret +endfunc + +function hevc_add_residual_16x16_16_neon, export=0 + mov x3, #16 movi v20.8h, #0 - mvni v21.8h, #0xFC, lsl #8 // movi #0x3FF -1: subs x3, x3, #1 + add x12, x0, x2 + add x2, x2, x2 +1: subs x3, x3, #2 + ld1 {v16.8h-v17.8h}, [x0] ld1 {v0.8h-v3.8h}, [x1], #64 + sqadd v0.8h, v0.8h, v16.8h + ld1 {v18.8h-v19.8h}, [x12] + sqadd v1.8h, v1.8h, v17.8h + sqadd v2.8h, v2.8h, v18.8h + sqadd v3.8h, v3.8h, v19.8h + clip2 v0.8h, v1.8h, v20.8h, v21.8h + clip2 v2.8h, v3.8h, v20.8h, v21.8h + st1 {v0.8h-v1.8h}, [x0], x2 + st1 {v2.8h-v3.8h}, [x12], x2 + bne 1b + ret +endfunc + +function hevc_add_residual_32x32_16_neon, export=0 + mov x3, #32 + movi v20.8h, #0 +1: subs x3, x3, #1 + ld1 {v0.8h -v3.8h}, [x1], #64 ld1 {v16.8h-v19.8h}, [x0] - sqadd v0.8h, v0.8h, v16.8h - sqadd v1.8h, v1.8h, v17.8h - sqadd v2.8h, v2.8h, v18.8h - sqadd v3.8h, v3.8h, v19.8h - clip10 v0.8h, v1.8h, v20.8h, v21.8h - clip10 v2.8h, v3.8h, v20.8h, v21.8h - st1 {v0.8h-v3.8h}, [x0], x2 - bne 1b + sqadd v0.8h, v0.8h, v16.8h + sqadd v1.8h, v1.8h, v17.8h + sqadd v2.8h, v2.8h, v18.8h + sqadd v3.8h, v3.8h, v19.8h + clip2 v0.8h, v1.8h, v20.8h, v21.8h + clip2 v2.8h, v3.8h, v20.8h, v21.8h + st1 {v0.8h-v3.8h}, [x0], x2 + bne 1b ret endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,21 +25,29 @@ #include "libavutil/aarch64/cpu.h" #include "libavcodec/hevcdsp.h" -void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_4x4_12_neon(uint8_t *_dst, const int16_t *coeffs, + ptrdiff_t stride); +void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, const int16_t *coeffs, + ptrdiff_t stride); +void ff_hevc_add_residual_8x8_12_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, const int16_t *coeffs, + ptrdiff_t stride); +void ff_hevc_add_residual_16x16_12_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, const int16_t *coeffs, + ptrdiff_t stride); +void ff_hevc_add_residual_32x32_12_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit); void ff_hevc_idct_8x8_10_neon(int16_t *coeffs, int col_limit); @@ -53,14 +61,54 @@ void ff_hevc_idct_8x8_dc_10_neon(int16_t *coeffs); void ff_hevc_idct_16x16_dc_10_neon(int16_t *coeffs); void ff_hevc_idct_32x32_dc_10_neon(int16_t *coeffs); -void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, uint8_t *_src, +void ff_hevc_sao_band_filter_8x8_8_neon(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height); -void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, int eo, int width, int height); -void ff_hevc_sao_edge_filter_8x8_8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, int eo, int width, int height); +void ff_hevc_sao_edge_filter_16x16_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, + const int16_t *sao_offset_val, int eo, int width, int height); +void ff_hevc_sao_edge_filter_8x8_8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, + const int16_t *sao_offset_val, int eo, int width, int height); +void ff_hevc_put_hevc_qpel_h4_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, + intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h6_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, + intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h8_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, + intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h12_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, + intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h16_8_neon(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, + intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_uni_h4_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, + int width); +void ff_hevc_put_hevc_qpel_uni_h6_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, + int width); +void ff_hevc_put_hevc_qpel_uni_h8_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, + int width); +void ff_hevc_put_hevc_qpel_uni_h12_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t + my, int width); +void ff_hevc_put_hevc_qpel_uni_h16_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t + my, int width); +void ff_hevc_put_hevc_qpel_bi_h4_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t + mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_bi_h6_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t + mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_bi_h8_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t + mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_bi_h12_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t + mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_bi_h16_8_neon(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, + ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t + mx, intptr_t my, int width); av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) { @@ -87,6 +135,33 @@ c->sao_edge_filter[2] = c->sao_edge_filter[3] = c->sao_edge_filter[4] = ff_hevc_sao_edge_filter_16x16_8_neon; + c->put_hevc_qpel[1][0][1] = ff_hevc_put_hevc_qpel_h4_8_neon; + c->put_hevc_qpel[2][0][1] = ff_hevc_put_hevc_qpel_h6_8_neon; + c->put_hevc_qpel[3][0][1] = ff_hevc_put_hevc_qpel_h8_8_neon; + c->put_hevc_qpel[4][0][1] = + c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h12_8_neon; + c->put_hevc_qpel[5][0][1] = + c->put_hevc_qpel[7][0][1] = + c->put_hevc_qpel[8][0][1] = + c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h16_8_neon; + c->put_hevc_qpel_uni[1][0][1] = ff_hevc_put_hevc_qpel_uni_h4_8_neon; + c->put_hevc_qpel_uni[2][0][1] = ff_hevc_put_hevc_qpel_uni_h6_8_neon; + c->put_hevc_qpel_uni[3][0][1] = ff_hevc_put_hevc_qpel_uni_h8_8_neon; + c->put_hevc_qpel_uni[4][0][1] = + c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_qpel_uni_h12_8_neon; + c->put_hevc_qpel_uni[5][0][1] = + c->put_hevc_qpel_uni[7][0][1] = + c->put_hevc_qpel_uni[8][0][1] = + c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_qpel_uni_h16_8_neon; + c->put_hevc_qpel_bi[1][0][1] = ff_hevc_put_hevc_qpel_bi_h4_8_neon; + c->put_hevc_qpel_bi[2][0][1] = ff_hevc_put_hevc_qpel_bi_h6_8_neon; + c->put_hevc_qpel_bi[3][0][1] = ff_hevc_put_hevc_qpel_bi_h8_8_neon; + c->put_hevc_qpel_bi[4][0][1] = + c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_qpel_bi_h12_8_neon; + c->put_hevc_qpel_bi[5][0][1] = + c->put_hevc_qpel_bi[7][0][1] = + c->put_hevc_qpel_bi[8][0][1] = + c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_qpel_bi_h16_8_neon; } if (bit_depth == 10) { c->add_residual[0] = ff_hevc_add_residual_4x4_10_neon; @@ -100,4 +175,10 @@ c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_neon; c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_neon; } + if (bit_depth == 12) { + c->add_residual[0] = ff_hevc_add_residual_4x4_12_neon; + c->add_residual[1] = ff_hevc_add_residual_8x8_12_neon; + c->add_residual[2] = ff_hevc_add_residual_16x16_12_neon; + c->add_residual[3] = ff_hevc_add_residual_32x32_12_neon; + } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,484 @@ +/* -*-arm64-*- + * vim: syntax=arm64asm + * + * Copyright (c) 2022 J. Dekker + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/aarch64/asm.S" +#define MAX_PB_SIZE 64 + +const qpel_filters, align=4 + .byte 0, 0, 0, 0, 0, 0, 0, 0 + .byte -1, 4,-10, 58, 17, -5, 1, 0 + .byte -1, 4,-11, 40, 40,-11, 4, -1 + .byte 0, 1, -5, 17, 58,-10, 4, -1 +endconst + +.macro load_filter m + movrel x15, qpel_filters + add x15, x15, \m, lsl #3 + ld1 {v0.8b}, [x15] + sxtl v0.8h, v0.8b +.endm + +.macro put_hevc type +.ifc \type, qpel + // void put_hevc_qpel_h(int16_t *dst, + // uint8_t *_src, ptrdiff_t _srcstride, + // int height, intptr_t mx, intptr_t my, int width) + dst .req x0 + dststride .req x7 + src .req x1 + srcstride .req x2 + height .req x3 + heightw .req w3 + mx .req x4 + width .req w6 +.endif +.ifc \type, qpel_uni + // void put_hevc_qpel_uni_h(uint8_t *_dst, ptrdiff_t _dststride, + // uint8_t *_src, ptrdiff_t _srcstride, + // int height, intptr_t mx, intptr_t my, int width) + dst .req x0 + dststride .req x1 + src .req x2 + srcstride .req x3 + height .req x4 + heightw .req w4 + mx .req x5 + width .req w7 +.endif +.ifc \type, qpel_bi + // void put_hevc_qpel_bi_h(uint8_t *_dst, ptrdiff_t _dststride, + // uint8_t *_src, ptrdiff_t _srcstride, + // int16_t *src2, int height, intptr_t mx, + // intptr_t my, int width) + dst .req x0 + dststride .req x1 + src .req x2 + srcstride .req x3 + height .req x5 + heightw .req w5 + mx .req x6 + width .req w8 +.endif + +.ifc \type, qpel +function ff_hevc_put_hevc_h4_8_neon, export=0 + uxtl v16.8h, v16.8b + uxtl v17.8h, v17.8b + uxtl v18.8h, v18.8b + uxtl v19.8h, v19.8b + + mul v23.4h, v16.4h, v0.h[0] + mul v24.4h, v18.4h, v0.h[0] + +.irpc i, 1234567 + ext v20.16b, v16.16b, v17.16b, #(2*\i) + ext v21.16b, v18.16b, v19.16b, #(2*\i) + mla v23.4h, v20.4h, v0.h[\i] + mla v24.4h, v21.4h, v0.h[\i] +.endr + ret +endfunc +.endif + +function ff_hevc_put_hevc_\type\()_h4_8_neon, export=1 + load_filter mx +.ifc \type, qpel_bi + mov x16, #(MAX_PB_SIZE << 2) // src2bstridel + add x15, x4, #(MAX_PB_SIZE << 1) // src2b +.endif + sub src, src, #3 + mov mx, x30 +.ifc \type, qpel + mov dststride, #(MAX_PB_SIZE << 1) + lsl x13, srcstride, #1 // srcstridel + mov x14, #(MAX_PB_SIZE << 2) +.else + lsl x14, dststride, #1 // dststridel + lsl x13, srcstride, #1 // srcstridel +.endif + add x10, dst, dststride // dstb + add x12, src, srcstride // srcb +0: ld1 {v16.8b, v17.8b}, [src], x13 + ld1 {v18.8b, v19.8b}, [x12], x13 +.ifc \type, qpel_bi + ld1 {v25.8h}, [ x4], x16 + ld1 {v26.8h}, [x15], x16 +.endif + + bl ff_hevc_put_hevc_h4_8_neon + subs heightw, heightw, #2 + +.ifc \type, qpel + st1 {v23.4h}, [dst], x14 + st1 {v24.4h}, [x10], x14 +.else +.ifc \type, qpel_bi + sqadd v23.4h, v23.4h, v25.4h + sqadd v24.4h, v24.4h, v26.4h + sqrshrun v23.8b, v23.8h, #7 + sqrshrun v24.8b, v24.8h, #7 +.else + sqrshrun v23.8b, v23.8h, #6 + sqrshrun v24.8b, v24.8h, #6 +.endif + st1 {v23.s}[0], [dst], x14 + st1 {v24.s}[0], [x10], x14 +.endif + b.gt 0b // double line + ret mx +endfunc + +.ifc \type, qpel +function ff_hevc_put_hevc_h8_8_neon, export=0 + uxtl v16.8h, v16.8b + uxtl v17.8h, v17.8b + uxtl v18.8h, v18.8b + uxtl v19.8h, v19.8b + + mul v23.8h, v16.8h, v0.h[0] + mul v24.8h, v18.8h, v0.h[0] + +.irpc i, 1234567 + ext v20.16b, v16.16b, v17.16b, #(2*\i) + ext v21.16b, v18.16b, v19.16b, #(2*\i) + mla v23.8h, v20.8h, v0.h[\i] + mla v24.8h, v21.8h, v0.h[\i] +.endr + ret +endfunc +.endif + +function ff_hevc_put_hevc_\type\()_h6_8_neon, export=1 + load_filter mx +.ifc \type, qpel_bi + mov x16, #(MAX_PB_SIZE << 2) // src2bstridel + add x15, x4, #(MAX_PB_SIZE << 1) // src2b +.endif + sub src, src, #3 + mov mx, x30 +.ifc \type, qpel + mov dststride, #(MAX_PB_SIZE << 1) + lsl x13, srcstride, #1 // srcstridel + mov x14, #((MAX_PB_SIZE << 2) - 8) +.else + lsl x14, dststride, #1 // dststridel + lsl x13, srcstride, #1 // srcstridel + sub x14, x14, #4 +.endif + add x10, dst, dststride // dstb + add x12, src, srcstride // srcb +0: ld1 {v16.8b, v17.8b}, [src], x13 + ld1 {v18.8b, v19.8b}, [x12], x13 +.ifc \type, qpel_bi + ld1 {v25.8h}, [ x4], x16 + ld1 {v26.8h}, [x15], x16 +.endif + + bl ff_hevc_put_hevc_h8_8_neon + subs heightw, heightw, #2 + +.ifc \type, qpel + st1 {v23.4h}, [dst], #8 + st1 {v24.4h}, [x10], #8 + st1 {v23.s}[2], [dst], x14 + st1 {v24.s}[2], [x10], x14 +.else +.ifc \type, qpel_bi + sqadd v23.8h, v23.8h, v25.8h + sqadd v24.8h, v24.8h, v26.8h + sqrshrun v23.8b, v23.8h, #7 + sqrshrun v24.8b, v24.8h, #7 +.else + sqrshrun v23.8b, v23.8h, #6 + sqrshrun v24.8b, v24.8h, #6 +.endif + st1 {v23.s}[0], [dst], #4 + st1 {v24.s}[0], [x10], #4 + st1 {v23.h}[2], [dst], x14 + st1 {v24.h}[2], [x10], x14 +.endif + b.gt 0b // double line + ret mx +endfunc + +function ff_hevc_put_hevc_\type\()_h8_8_neon, export=1 + load_filter mx +.ifc \type, qpel_bi + mov x16, #(MAX_PB_SIZE << 2) // src2bstridel + add x15, x4, #(MAX_PB_SIZE << 1) // src2b +.endif + sub src, src, #3 + mov mx, x30 +.ifc \type, qpel + mov dststride, #(MAX_PB_SIZE << 1) + lsl x13, srcstride, #1 // srcstridel + mov x14, #(MAX_PB_SIZE << 2) +.else + lsl x14, dststride, #1 // dststridel + lsl x13, srcstride, #1 // srcstridel +.endif + add x10, dst, dststride // dstb + add x12, src, srcstride // srcb +0: ld1 {v16.8b, v17.8b}, [src], x13 + ld1 {v18.8b, v19.8b}, [x12], x13 +.ifc \type, qpel_bi + ld1 {v25.8h}, [ x4], x16 + ld1 {v26.8h}, [x15], x16 +.endif + + bl ff_hevc_put_hevc_h8_8_neon + subs heightw, heightw, #2 + +.ifc \type, qpel + st1 {v23.8h}, [dst], x14 + st1 {v24.8h}, [x10], x14 +.else +.ifc \type, qpel_bi + sqadd v23.8h, v23.8h, v25.8h + sqadd v24.8h, v24.8h, v26.8h + sqrshrun v23.8b, v23.8h, #7 + sqrshrun v24.8b, v24.8h, #7 +.else + sqrshrun v23.8b, v23.8h, #6 + sqrshrun v24.8b, v24.8h, #6 +.endif + st1 {v23.8b}, [dst], x14 + st1 {v24.8b}, [x10], x14 +.endif + b.gt 0b // double line + ret mx +endfunc + +.ifc \type, qpel +function ff_hevc_put_hevc_h16_8_neon, export=0 + uxtl v16.8h, v16.8b + uxtl v17.8h, v17.8b + uxtl v18.8h, v18.8b + + uxtl v19.8h, v19.8b + uxtl v20.8h, v20.8b + uxtl v21.8h, v21.8b + + mul v26.8h, v16.8h, v0.h[0] + mul v27.8h, v17.8h, v0.h[0] + mul v28.8h, v19.8h, v0.h[0] + mul v29.8h, v20.8h, v0.h[0] +.irpc i, 1234567 + ext v22.16b, v16.16b, v17.16b, #(2*\i) + ext v23.16b, v17.16b, v18.16b, #(2*\i) + + ext v24.16b, v19.16b, v20.16b, #(2*\i) + ext v25.16b, v20.16b, v21.16b, #(2*\i) + + mla v26.8h, v22.8h, v0.h[\i] + mla v27.8h, v23.8h, v0.h[\i] + + mla v28.8h, v24.8h, v0.h[\i] + mla v29.8h, v25.8h, v0.h[\i] +.endr + subs x9, x9, #2 + ret +endfunc +.endif + +function ff_hevc_put_hevc_\type\()_h12_8_neon, export=1 + load_filter mx + sxtw height, heightw +.ifc \type, qpel_bi + ldrh w8, [sp] // width + mov x16, #(MAX_PB_SIZE << 2) // src2bstridel + lsl x17, height, #7 // src2b reset (height * (MAX_PB_SIZE << 1)) + add x15, x4, #(MAX_PB_SIZE << 1) // src2b +.endif + sub src, src, #3 + mov mx, x30 +.ifc \type, qpel + mov dststride, #(MAX_PB_SIZE << 1) + lsl x13, srcstride, #1 // srcstridel + mov x14, #((MAX_PB_SIZE << 2) - 16) +.else + lsl x14, dststride, #1 // dststridel + lsl x13, srcstride, #1 // srcstridel + sub x14, x14, #8 +.endif + add x10, dst, dststride // dstb + add x12, src, srcstride // srcb +0: mov x9, height +1: ld1 {v16.8b-v18.8b}, [src], x13 + ld1 {v19.8b-v21.8b}, [x12], x13 + + bl ff_hevc_put_hevc_h16_8_neon + +.ifc \type, qpel + st1 {v26.8h}, [dst], #16 + st1 {v28.8h}, [x10], #16 + st1 {v27.4h}, [dst], x14 + st1 {v29.4h}, [x10], x14 +.else +.ifc \type, qpel_bi + ld1 {v16.8h, v17.8h}, [ x4], x16 + ld1 {v18.8h, v19.8h}, [x15], x16 + sqadd v26.8h, v26.8h, v16.8h + sqadd v27.8h, v27.8h, v17.8h + sqadd v28.8h, v28.8h, v18.8h + sqadd v29.8h, v29.8h, v19.8h + sqrshrun v26.8b, v26.8h, #7 + sqrshrun v27.8b, v27.8h, #7 + sqrshrun v28.8b, v28.8h, #7 + sqrshrun v29.8b, v29.8h, #7 +.else + sqrshrun v26.8b, v26.8h, #6 + sqrshrun v27.8b, v27.8h, #6 + sqrshrun v28.8b, v28.8h, #6 + sqrshrun v29.8b, v29.8h, #6 +.endif + st1 {v26.8b}, [dst], #8 + st1 {v28.8b}, [x10], #8 + st1 {v27.s}[0], [dst], x14 + st1 {v29.s}[0], [x10], x14 +.endif + b.gt 1b // double line + subs width, width, #12 + // reset src + msub src, srcstride, height, src + msub x12, srcstride, height, x12 + // reset dst + msub dst, dststride, height, dst + msub x10, dststride, height, x10 +.ifc \type, qpel_bi + // reset xsrc + sub x4, x4, x17 + sub x15, x15, x17 + add x4, x4, #24 + add x15, x15, #24 +.endif + add src, src, #12 + add x12, x12, #12 +.ifc \type, qpel + add dst, dst, #24 + add x10, x10, #24 +.else + add dst, dst, #12 + add x10, x10, #12 +.endif + b.gt 0b + ret mx +endfunc + +function ff_hevc_put_hevc_\type\()_h16_8_neon, export=1 + load_filter mx + sxtw height, heightw + mov mx, x30 +.ifc \type, qpel_bi + ldrh w8, [sp] // width + mov x16, #(MAX_PB_SIZE << 2) // src2bstridel + lsl x17, x5, #7 // src2b reset + add x15, x4, #(MAX_PB_SIZE << 1) // src2b +.endif + sub src, src, #3 + mov mx, x30 +.ifc \type, qpel + mov dststride, #(MAX_PB_SIZE << 1) + lsl x13, srcstride, #1 // srcstridel + mov x14, #((MAX_PB_SIZE << 2) - 16) +.else + lsl x14, dststride, #1 // dststridel + lsl x13, srcstride, #1 // srcstridel + sub x14, x14, #8 +.endif + add x10, dst, dststride // dstb + add x12, src, srcstride // srcb +0: mov x9, height +1: ld1 {v16.8b-v18.8b}, [src], x13 + ld1 {v19.8b-v21.8b}, [x12], x13 + + bl ff_hevc_put_hevc_h16_8_neon + +.ifc \type, qpel + st1 {v26.8h}, [dst], #16 + st1 {v28.8h}, [x10], #16 + st1 {v27.8h}, [dst], x14 + st1 {v29.8h}, [x10], x14 +.else +.ifc \type, qpel_bi + ld1 {v16.8h, v17.8h}, [ x4], x16 + ld1 {v18.8h, v19.8h}, [x15], x16 + sqadd v26.8h, v26.8h, v16.8h + sqadd v27.8h, v27.8h, v17.8h + sqadd v28.8h, v28.8h, v18.8h + sqadd v29.8h, v29.8h, v19.8h + sqrshrun v26.8b, v26.8h, #7 + sqrshrun v27.8b, v27.8h, #7 + sqrshrun v28.8b, v28.8h, #7 + sqrshrun v29.8b, v29.8h, #7 +.else + sqrshrun v26.8b, v26.8h, #6 + sqrshrun v27.8b, v27.8h, #6 + sqrshrun v28.8b, v28.8h, #6 + sqrshrun v29.8b, v29.8h, #6 +.endif + st1 {v26.8b}, [dst], #8 + st1 {v28.8b}, [x10], #8 + st1 {v27.8b}, [dst], x14 + st1 {v29.8b}, [x10], x14 +.endif + b.gt 1b // double line + subs width, width, #16 + // reset src + msub src, srcstride, height, src + msub x12, srcstride, height, x12 + // reset dst + msub dst, dststride, height, dst + msub x10, dststride, height, x10 +.ifc \type, qpel_bi + // reset xsrc + sub x4, x4, x17 + sub x15, x15, x17 + add x4, x4, #32 + add x15, x15, #32 +.endif + add src, src, #16 + add x12, x12, #16 +.ifc \type, qpel + add dst, dst, #32 + add x10, x10, #32 +.else + add dst, dst, #16 + add x10, x10, #16 +.endif + b.gt 0b + ret mx +endfunc + +.unreq height +.unreq heightw +.unreq width +.unreq src +.unreq dst +.unreq srcstride +.unreq dststride +.unreq mx +.endm + +put_hevc qpel +put_hevc qpel_uni +put_hevc qpel_bi diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_sao_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_sao_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_sao_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/hevcdsp_sao_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -33,8 +33,7 @@ // int16_t *sao_offset_val, int sao_left_class, // int width, int height) function ff_hevc_sao_band_filter_8x8_8_neon, export=1 - sub sp, sp, #64 - stp xzr, xzr, [sp] + stp xzr, xzr, [sp, #-64]! stp xzr, xzr, [sp, #16] stp xzr, xzr, [sp, #32] stp xzr, xzr, [sp, #48] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -67,4 +67,5 @@ aarch64/vp9mc_neon.o NEON-OBJS-$(CONFIG_HEVC_DECODER) += aarch64/hevcdsp_idct_neon.o \ aarch64/hevcdsp_init_aarch64.o \ + aarch64/hevcdsp_qpel_neon.o \ aarch64/hevcdsp_sao_neon.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/mdct_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/mdct_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/mdct_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/mdct_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -23,8 +23,7 @@ #include "libavutil/aarch64/asm.S" function ff_imdct_half_neon, export=1 - sub sp, sp, #32 - stp x19, x20, [sp] + stp x19, x20, [sp, #-32]! AARCH64_SIGN_LINK_REGISTER str x30, [sp, #16] mov x12, #1 @@ -120,17 +119,15 @@ st2 {v4.2s,v5.2s}, [x0] st2 {v6.2s,v7.2s}, [x8] - ldp x19, x20, [sp] ldr x30, [sp, #16] AARCH64_VALIDATE_LINK_REGISTER - add sp, sp, #32 + ldp x19, x20, [sp], #32 ret endfunc function ff_imdct_calc_neon, export=1 - sub sp, sp, #32 - stp x19, x20, [sp] + stp x19, x20, [sp, #-32]! AARCH64_SIGN_LINK_REGISTER str x30, [sp, #16] ldr w3, [x0, #28] // mdct_bits @@ -163,18 +160,16 @@ subs x19, x19, #16 b.gt 1b - ldp x19, x20, [sp] ldr x30, [sp, #16] AARCH64_VALIDATE_LINK_REGISTER - add sp, sp, #32 + ldp x19, x20, [sp], #32 ret endfunc function ff_mdct_calc_neon, export=1 - sub sp, sp, #32 - stp x19, x20, [sp] + stp x19, x20, [sp, #-32]! AARCH64_SIGN_LINK_REGISTER str x30, [sp, #16] @@ -323,10 +318,9 @@ st2 {v4.2s,v5.2s}, [x0] st2 {v6.2s,v7.2s}, [x8] - ldp x19, x20, [sp] ldr x30, [sp, #16] AARCH64_VALIDATE_LINK_REGISTER - add sp, sp, #32 + ldp x19, x20, [sp], #32 ret endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,10 +23,59 @@ #include "libavutil/aarch64/cpu.h" #include "libavcodec/mpegvideo.h" -int ff_pix_abs16_neon(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_neon(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); -int ff_pix_abs16_xy2_neon(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_xy2_neon(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, + ptrdiff_t stride, int h); +int ff_pix_abs16_x2_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int ff_pix_abs16_y2_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int ff_pix_abs8_neon(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, + ptrdiff_t stride, int h); + +int sse16_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int sse8_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int sse4_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); + +int vsad16_neon(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h); +int vsad_intra16_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, + ptrdiff_t stride, int h) ; +int vsad_intra8_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, + ptrdiff_t stride, int h) ; +int vsse16_neon(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h); +int vsse_intra16_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, ptrdiff_t stride, int h); +int nsse16_neon(int multiplier, const uint8_t *s, const uint8_t *s2, + ptrdiff_t stride, int h); +int nsse16_neon_wrapper(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h); +int pix_median_abs16_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int pix_median_abs8_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int ff_pix_abs8_x2_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int ff_pix_abs8_y2_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); +int ff_pix_abs8_xy2_neon(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t stride, int h); + +int nsse8_neon(int multiplier, const uint8_t *s, const uint8_t *s2, + ptrdiff_t stride, int h); +int nsse8_neon_wrapper(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h); + +int vsse8_neon(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h); + +int vsse_intra8_neon(MpegEncContext *c, const uint8_t *s, const uint8_t *dummy, + ptrdiff_t stride, int h); av_cold void ff_me_cmp_init_aarch64(MECmpContext *c, AVCodecContext *avctx) { @@ -34,8 +83,52 @@ if (have_neon(cpu_flags)) { c->pix_abs[0][0] = ff_pix_abs16_neon; + c->pix_abs[0][1] = ff_pix_abs16_x2_neon; + c->pix_abs[0][2] = ff_pix_abs16_y2_neon; c->pix_abs[0][3] = ff_pix_abs16_xy2_neon; + c->pix_abs[1][0] = ff_pix_abs8_neon; + c->pix_abs[1][1] = ff_pix_abs8_x2_neon; + c->pix_abs[1][2] = ff_pix_abs8_y2_neon; + c->pix_abs[1][3] = ff_pix_abs8_xy2_neon; c->sad[0] = ff_pix_abs16_neon; + c->sad[1] = ff_pix_abs8_neon; + c->sse[0] = sse16_neon; + c->sse[1] = sse8_neon; + c->sse[2] = sse4_neon; + + c->vsad[0] = vsad16_neon; + c->vsad[4] = vsad_intra16_neon; + c->vsad[5] = vsad_intra8_neon; + + c->vsse[0] = vsse16_neon; + c->vsse[1] = vsse8_neon; + + c->vsse[4] = vsse_intra16_neon; + c->vsse[5] = vsse_intra8_neon; + + c->nsse[0] = nsse16_neon_wrapper; + c->nsse[1] = nsse8_neon_wrapper; + + c->median_sad[0] = pix_median_abs16_neon; + c->median_sad[1] = pix_median_abs8_neon; } } + +int nsse16_neon_wrapper(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h) +{ + if (c) + return nsse16_neon(c->avctx->nsse_weight, s1, s2, stride, h); + else + return nsse16_neon(8, s1, s2, stride, h); +} + +int nsse8_neon_wrapper(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride, int h) +{ + if (c) + return nsse8_neon(c->avctx->nsse_weight, s1, s2, stride, h); + else + return nsse8_neon(8, s1, s2, stride, h); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/me_cmp_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -27,15 +27,16 @@ // x3 ptrdiff_t stride // w4 int h cmp w4, #4 // if h < 4, jump to completion section - movi v18.4S, #0 // clear result accumulator + movi v16.8h, #0 // clear result accumulator + movi v17.8h, #0 // clear result accumulator b.lt 2f 1: ld1 {v0.16b}, [x1], x3 // load pix1 ld1 {v4.16b}, [x2], x3 // load pix2 ld1 {v1.16b}, [x1], x3 // load pix1 ld1 {v5.16b}, [x2], x3 // load pix2 - uabdl v16.8h, v0.8b, v4.8b // absolute difference accumulate - uabdl2 v17.8h, v0.16b, v4.16b + uabal v16.8h, v0.8b, v4.8b // absolute difference accumulate + uabal2 v17.8h, v0.16b, v4.16b ld1 {v2.16b}, [x1], x3 // load pix1 ld1 {v6.16b}, [x2], x3 // load pix2 uabal v16.8h, v1.8b, v5.8b // absolute difference accumulate @@ -48,30 +49,268 @@ uabal v16.8h, v3.8b, v7.8b uabal2 v17.8h, v3.16b, v7.16b cmp w4, #4 // if h >= 4, loop - add v16.8h, v16.8h, v17.8h - uaddlv s16, v16.8h // add up everything in v16 accumulator - add d18, d16, d18 // add to the end result register b.ge 1b cbnz w4, 2f // if iterations remain, jump to completion section - fmov w0, s18 // copy result to general purpose register + add v16.8h, v16.8h, v17.8h + uaddlv s16, v16.8h // add up everything in v16 accumulator + fmov w0, s16 // copy result to general purpose register ret 2: ld1 {v0.16b}, [x1], x3 // load pix1 ld1 {v4.16b}, [x2], x3 // load pix2 - uabdl v16.8h, v0.8b, v4.8b // absolute difference accumulate - uabal2 v16.8h, v0.16b, v4.16b subs w4, w4, #1 // h -= 1 - addv h16, v16.8h // add up v16 - add d18, d16, d18 // add to result + uabal v16.8h, v0.8b, v4.8b // absolute difference accumulate + uabal2 v17.8h, v0.16b, v4.16b + b.ne 2b + + add v16.8h, v16.8h, v17.8h + uaddlv s16, v16.8h // add up everything in v16 accumulator + fmov w0, s16 // copy result to general purpose register + ret +endfunc + +function ff_pix_abs8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + movi v30.8h, #0 + cmp w4, #4 + b.lt 2f + +// make 4 iterations at once +1: + ld1 {v0.8b}, [x1], x3 // Load pix1 for first iteration + ld1 {v1.8b}, [x2], x3 // Load pix2 for first iteration + ld1 {v2.8b}, [x1], x3 // Load pix1 for second iteration + uabal v30.8h, v0.8b, v1.8b // Absolute difference, first iteration + ld1 {v3.8b}, [x2], x3 // Load pix2 for second iteration + ld1 {v4.8b}, [x1], x3 // Load pix1 for third iteration + uabal v30.8h, v2.8b, v3.8b // Absolute difference, second iteration + ld1 {v5.8b}, [x2], x3 // Load pix2 for third iteration + sub w4, w4, #4 // h -= 4 + ld1 {v6.8b}, [x1], x3 // Load pix1 for foruth iteration + ld1 {v7.8b}, [x2], x3 // Load pix2 for fourth iteration + uabal v30.8h, v4.8b, v5.8b // Absolute difference, third iteration + cmp w4, #4 + uabal v30.8h, v6.8b, v7.8b // Absolute difference, foruth iteration + b.ge 1b + + cbz w4, 3f + +// iterate by one +2: + ld1 {v0.8b}, [x1], x3 // Load pix1 + ld1 {v1.8b}, [x2], x3 // Load pix2 + + subs w4, w4, #1 + uabal v30.8h, v0.8b, v1.8b + b.ne 2b + +3: + uaddlv s20, v30.8h // Add up vector + fmov w0, s20 + + ret +endfunc + +function ff_pix_abs8_x2_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + cmp w4, #4 + movi v26.8h, #0 + add x5, x2, #1 // pix2 + 1 + b.lt 2f + +// make 4 iterations at once +1: + ld1 {v1.8b}, [x2], x3 + ld1 {v2.8b}, [x5], x3 + ld1 {v0.8b}, [x1], x3 + ld1 {v4.8b}, [x2], x3 + urhadd v30.8b, v1.8b, v2.8b + ld1 {v5.8b}, [x5], x3 + uabal v26.8h, v0.8b, v30.8b + ld1 {v6.8b}, [x1], x3 + urhadd v29.8b, v4.8b, v5.8b + ld1 {v7.8b}, [x2], x3 + ld1 {v20.8b}, [x5], x3 + uabal v26.8h, v6.8b, v29.8b + ld1 {v21.8b}, [x1], x3 + urhadd v28.8b, v7.8b, v20.8b + ld1 {v22.8b}, [x2], x3 + ld1 {v23.8b}, [x5], x3 + uabal v26.8h, v21.8b, v28.8b + sub w4, w4, #4 + ld1 {v24.8b}, [x1], x3 + urhadd v27.8b, v22.8b, v23.8b + cmp w4, #4 + uabal v26.8h, v24.8b, v27.8b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v1.8b}, [x2], x3 + ld1 {v2.8b}, [x5], x3 + ld1 {v0.8b}, [x1], x3 + urhadd v30.8b, v1.8b, v2.8b + subs w4, w4, #1 + uabal v26.8h, v0.8b, v30.8b + + b.ne 2b +3: + uaddlv s20, v26.8h + fmov w0, s20 + + ret + +endfunc + +function ff_pix_abs8_y2_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + cmp w4, #4 + movi v26.8h, #0 + ld1 {v1.8b}, [x2], x3 + b.lt 2f + +// make 4 iterations at once +1: + ld1 {v2.8b}, [x2], x3 + ld1 {v0.8b}, [x1], x3 + urhadd v30.8b, v1.8b, v2.8b + ld1 {v5.8b}, [x2], x3 + ld1 {v6.8b}, [x1], x3 + uabal v26.8h, v0.8b, v30.8b + urhadd v29.8b, v2.8b, v5.8b + ld1 {v20.8b}, [x2], x3 + ld1 {v21.8b}, [x1], x3 + uabal v26.8h, v6.8b, v29.8b + urhadd v28.8b, v5.8b, v20.8b + ld1 {v1.8b}, [x2], x3 + ld1 {v24.8b}, [x1], x3 + urhadd v27.8b, v20.8b, v1.8b + sub w4, w4, #4 + uabal v26.8h, v21.8b, v28.8b + cmp w4, #4 + uabal v26.8h, v24.8b, v27.8b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v0.8b}, [x1], x3 + ld1 {v2.8b}, [x2], x3 + urhadd v30.8b, v1.8b, v2.8b + subs w4, w4, #1 + uabal v26.8h, v0.8b, v30.8b + mov v1.8b, v2.8b + b.ne 2b +3: + uaddlv s20, v26.8h + fmov w0, s20 - fmov w0, s18 // copy result to general purpose register ret + endfunc +function ff_pix_abs8_xy2_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + movi v31.8h, #0 + add x0, x2, 1 // pix2 + 1 + + add x5, x2, x3 // pix2 + stride = pix3 + cmp w4, #4 + add x6, x5, 1 // pix3 + stride + 1 + + ld1 {v0.8b}, [x2], x3 + ld1 {v1.8b}, [x0], x3 + uaddl v2.8h, v0.8b, v1.8b + + b.lt 2f + +// make 4 iterations at once +1: + ld1 {v4.8b}, [x5], x3 + ld1 {v5.8b}, [x6], x3 + ld1 {v7.8b}, [x5], x3 + uaddl v0.8h, v4.8b, v5.8b + ld1 {v16.8b}, [x6], x3 + add v4.8h, v0.8h, v2.8h + ld1 {v5.8b}, [x1], x3 + rshrn v4.8b, v4.8h, #2 + uaddl v7.8h, v7.8b, v16.8b + uabal v31.8h, v5.8b, v4.8b + add v2.8h, v0.8h, v7.8h + ld1 {v17.8b}, [x1], x3 + rshrn v2.8b, v2.8h, #2 + ld1 {v20.8b}, [x5], x3 + uabal v31.8h, v17.8b, v2.8b + ld1 {v21.8b}, [x6], x3 + ld1 {v25.8b}, [x5], x3 + uaddl v20.8h, v20.8b, v21.8b + ld1 {v26.8b}, [x6], x3 + add v7.8h, v7.8h, v20.8h + uaddl v25.8h, v25.8b, v26.8b + rshrn v7.8b, v7.8h, #2 + ld1 {v22.8b}, [x1], x3 + mov v2.16b, v25.16b + uabal v31.8h, v22.8b, v7.8b + add v20.8h, v20.8h, v25.8h + ld1 {v27.8b}, [x1], x3 + sub w4, w4, #4 + rshrn v20.8b, v20.8h, #2 + cmp w4, #4 + uabal v31.8h, v27.8b, v20.8b + + b.ge 1b + + cbz w4, 3f + +// iterate by one +2: + ld1 {v0.8b}, [x5], x3 + ld1 {v1.8b}, [x6], x3 + ld1 {v4.8b}, [x1], x3 + uaddl v21.8h, v0.8b, v1.8b + subs w4, w4, #1 + add v3.8h, v2.8h, v21.8h + mov v2.16b, v21.16b + rshrn v3.8b, v3.8h, #2 + uabal v31.8h, v4.8b, v3.8b + b.ne 2b + +3: + uaddlv s18, v31.8h + fmov w0, s18 + + ret + +endfunc + + function ff_pix_abs16_xy2_neon, export=1 // x0 unused // x1 uint8_t *pix1 @@ -80,7 +319,8 @@ // w4 int h add x5, x2, x3 // use x5 to hold uint8_t *pix3 - movi v0.2d, #0 // initialize the result register + movi v21.8h, #0 // initialize the result register + movi v22.8h, #0 // initialize the result register // Load initial pix2 values for either the unrolled version or completion version. ldur q4, [x2, #1] // load pix2+1 @@ -101,26 +341,35 @@ ld1 {v6.16b}, [x5], x3 // load pix3 ld1 {v16.16b}, [x1], x3 // load pix1 - ldur q19, [x5, #1] // load pix3+1 - ld1 {v18.16b}, [x5], x3 // load pix3 - ld1 {v17.16b}, [x1], x3 // load pix1 - - ldur q22, [x5, #1] // load pix3+1 - ld1 {v21.16b}, [x5], x3 // load pix3 - ld1 {v20.16b}, [x1], x3 // load pix1 - // These blocks compute the average: avg(pix2[n], pix2[n+1], pix3[n], pix3[n+1]) uaddl v30.8h, v4.8b, v5.8b // pix3 + pix3+1 0..7 uaddl2 v31.8h, v4.16b, v5.16b // pix3 + pix3+1 8..15 + + ldur q19, [x5, #1] // load pix3+1 + add v23.8h, v2.8h, v30.8h // add up 0..7, using pix2 + pix2+1 values from previous iteration add v24.8h, v3.8h, v31.8h // add up 8..15, using pix2 + pix2+1 values from previous iteration + + ld1 {v18.16b}, [x5], x3 // load pix3 + ld1 {v17.16b}, [x1], x3 // load pix1 + rshrn v23.8b, v23.8h, #2 // shift right 2 0..7 (rounding shift right) rshrn2 v23.16b, v24.8h, #2 // shift right 2 8..15 uaddl v2.8h, v6.8b, v7.8b // pix3 + pix3+1 0..7 uaddl2 v3.8h, v6.16b, v7.16b // pix3 + pix3+1 8..15 + + ldur q7, [x5, #1] // load pix3+1 + add v26.8h, v30.8h, v2.8h // add up 0..7, using pix2 + pix2+1 values from pix3 above add v27.8h, v31.8h, v3.8h // add up 8..15, using pix2 + pix2+1 values from pix3 above + + uabal v21.8h, v1.8b, v23.8b // absolute difference 0..7, i=0 + uabal2 v22.8h, v1.16b, v23.16b // absolute difference 8..15, i=0 + + ld1 {v6.16b}, [x5], x3 // load pix3 + ld1 {v20.16b}, [x1], x3 // load pix1 + rshrn v26.8b, v26.8h, #2 // shift right 2 0..7 (rounding shift right) rshrn2 v26.16b, v27.8h, #2 // shift right 2 8..15 @@ -131,46 +380,33 @@ rshrn v28.8b, v28.8h, #2 // shift right 2 0..7 (rounding shift right) rshrn2 v28.16b, v29.8h, #2 // shift right 2 8..15 - uaddl v2.8h, v21.8b, v22.8b // pix3 + pix3+1 0..7 - uaddl2 v3.8h, v21.16b, v22.16b // pix3 + pix3+1 8..15 + uabal v21.8h, v16.8b, v26.8b // absolute difference 0..7, i=1 + uabal2 v22.8h, v16.16b, v26.16b // absolute difference 8..15, i=1 + + uaddl v2.8h, v6.8b, v7.8b // pix3 + pix3+1 0..7 + uaddl2 v3.8h, v6.16b, v7.16b // pix3 + pix3+1 8..15 add v30.8h, v4.8h, v2.8h // add up 0..7, using pix2 + pix2+1 values from pix3 above add v31.8h, v5.8h, v3.8h // add up 8..15, using pix2 + pix2+1 values from pix3 above rshrn v30.8b, v30.8h, #2 // shift right 2 0..7 (rounding shift right) rshrn2 v30.16b, v31.8h, #2 // shift right 2 8..15 - // Averages are now stored in these registers: - // v23, v16, v28, v30 - // pix1 values in these registers: - // v1, v16, v17, v20 - // available: - // v4, v5, v7, v18, v19, v24, v25, v27, v29, v31 - sub w4, w4, #4 // h -= 4 - // Using absolute-difference instructions instead of absolute-difference-accumulate allows - // us to keep the results in 16b vectors instead of widening values with twice the instructions. - // This approach also has fewer data dependencies, allowing better instruction level parallelism. - uabd v4.16b, v1.16b, v23.16b // absolute difference 0..15, i=0 - uabd v5.16b, v16.16b, v26.16b // absolute difference 0..15, i=1 - uabd v6.16b, v17.16b, v28.16b // absolute difference 0..15, i=2 - uabd v7.16b, v20.16b, v30.16b // absolute difference 0..15, i=3 + uabal v21.8h, v17.8b, v28.8b // absolute difference 0..7, i=2 + uabal2 v22.8h, v17.16b, v28.16b // absolute difference 8..15, i=2 cmp w4, #4 // loop if h >= 4 - // Now add up all the values in each vector, v4-v7 with widening adds - uaddl v19.8h, v4.8b, v5.8b - uaddl2 v18.8h, v4.16b, v5.16b - uaddl v4.8h, v6.8b, v7.8b - uaddl2 v5.8h, v6.16b, v7.16b - add v4.8h, v4.8h, v5.8h - add v4.8h, v4.8h, v18.8h - add v4.8h, v4.8h, v19.8h - uaddlv s4, v4.8h // finish adding up accumulated values - add d0, d0, d4 // add the value to the top level accumulator + + uabal v21.8h, v20.8b, v30.8b // absolute difference 0..7, i=3 + uabal2 v22.8h, v20.16b, v30.16b // absolute difference 8..15, i=3 b.ge 1b cbnz w4, 2f // if iterations remain jump to completion section + add v4.8h, v21.8h, v22.8h + uaddlv s0, v4.8h // finish adding up accumulated values + fmov w0, s0 // copy result to general purpose register ret 2: @@ -186,20 +422,1140 @@ add v16.8h, v2.8h, v18.8h // add up 0..7, using pix2 + pix2+1 values from previous iteration add v17.8h, v3.8h, v19.8h // add up 8..15, using pix2 + pix2+1 values from previous iteration // divide by 4 to compute the average of values summed above - urshr v16.8h, v16.8h, #2 // shift right by 2 0..7 (rounding shift right) - urshr v17.8h, v17.8h, #2 // shift right by 2 8..15 - - uxtl2 v8.8h, v1.16b // 8->16 bits pix1 8..15 - uxtl v1.8h, v1.8b // 8->16 bits pix1 0..7 + rshrn v16.8b, v16.8h, #2 // shift right by 2 0..7 (rounding shift right) + rshrn2 v16.16b, v17.8h, #2 // shift right by 2 8..15 - uabd v6.8h, v1.8h, v16.8h // absolute difference 0..7 - uaba v6.8h, v8.8h, v17.8h // absolute difference accumulate 8..15 + uabal v21.8h, v1.8b, v16.8b // absolute difference 0..7 + uabal2 v22.8h, v1.16b, v16.16b // absolute difference accumulate 8..15 mov v2.16b, v18.16b // pix3 -> pix2 mov v3.16b, v19.16b // pix3+1 -> pix2+1 - uaddlv s6, v6.8h // add up accumulator in v6 - add d0, d0, d6 // add to the final result b.ne 2b // loop if h > 0 + + add v4.8h, v21.8h, v22.8h + uaddlv s0, v4.8h // finish adding up accumulated values fmov w0, s0 // copy result to general purpose register ret endfunc + +function ff_pix_abs16_x2_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + cmp w4, #4 + // initialize buffers + movi v16.8h, #0 + movi v17.8h, #0 + add x5, x2, #1 // pix2 + 1 + b.lt 2f + +// make 4 iterations at once +1: + + // abs(pix1[0] - avg2(pix2[0], pix2[1])) + // avg2(a,b) = (((a) + (b) + 1) >> 1) + // abs(x) = (x < 0 ? -x : x) + + ld1 {v1.16b}, [x2], x3 + ld1 {v2.16b}, [x5], x3 + urhadd v30.16b, v1.16b, v2.16b + ld1 {v0.16b}, [x1], x3 + uabal v16.8h, v0.8b, v30.8b + ld1 {v4.16b}, [x2], x3 + uabal2 v17.8h, v0.16b, v30.16b + ld1 {v5.16b}, [x5], x3 + urhadd v29.16b, v4.16b, v5.16b + ld1 {v3.16b}, [x1], x3 + uabal v16.8h, v3.8b, v29.8b + ld1 {v7.16b}, [x2], x3 + uabal2 v17.8h, v3.16b, v29.16b + ld1 {v22.16b}, [x5], x3 + urhadd v28.16b, v7.16b, v22.16b + ld1 {v6.16b}, [x1], x3 + uabal v16.8h, v6.8b, v28.8b + ld1 {v24.16b}, [x2], x3 + sub w4, w4, #4 + uabal2 v17.8h, v6.16b, v28.16b + ld1 {v25.16b}, [x5], x3 + urhadd v27.16b, v24.16b, v25.16b + ld1 {v23.16b}, [x1], x3 + cmp w4, #4 + uabal v16.8h, v23.8b, v27.8b + uabal2 v17.8h, v23.16b, v27.16b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v1.16b}, [x2], x3 + ld1 {v2.16b}, [x5], x3 + subs w4, w4, #1 + urhadd v29.16b, v1.16b, v2.16b + ld1 {v0.16b}, [x1], x3 + uabal v16.8h, v0.8b, v29.8b + uabal2 v17.8h, v0.16b, v29.16b + + + b.ne 2b + +3: + add v16.8h, v16.8h, v17.8h + uaddlv s16, v16.8h + fmov w0, s16 + + ret +endfunc + +function ff_pix_abs16_y2_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + // initialize buffers + ld1 {v1.16b}, [x2], x3 // Load pix2 + movi v29.8h, #0 // clear the accumulator + movi v28.8h, #0 // clear the accumulator + cmp w4, #4 + b.lt 2f + +// make 4 iterations at once +1: + + // abs(pix1[0], avg2(pix2[0], pix2[0 + stride])) + // avg2(a, b) = (((a) + (b) + 1) >> 1) + // abs(x) = (x < 0 ? (-x) : (x)) + + ld1 {v2.16b}, [x2], x3 // Load pix3 for first iteration + ld1 {v0.16b}, [x1], x3 // Load pix1 for first iteration + urhadd v30.16b, v1.16b, v2.16b // Rounding halving add, first iteration + ld1 {v5.16b}, [x2], x3 // Load pix3 for second iteartion + uabal v29.8h, v0.8b, v30.8b // Absolute difference of lower half, first iteration + uabal2 v28.8h, v0.16b, v30.16b // Absolute difference of upper half, first iteration + ld1 {v3.16b}, [x1], x3 // Load pix1 for second iteration + urhadd v27.16b, v2.16b, v5.16b // Rounding halving add, second iteration + ld1 {v20.16b}, [x2], x3 // Load pix3 for third iteration + uabal v29.8h, v3.8b, v27.8b // Absolute difference of lower half for second iteration + uabal2 v28.8h, v3.16b, v27.16b // Absolute difference of upper half for second iteration + ld1 {v6.16b}, [x1], x3 // Load pix1 for third iteration + urhadd v26.16b, v5.16b, v20.16b // Rounding halving add, third iteration + ld1 {v1.16b}, [x2], x3 // Load pix3 for fourth iteration + uabal v29.8h, v6.8b, v26.8b // Absolute difference of lower half for third iteration + uabal2 v28.8h, v6.16b, v26.16b // Absolute difference of upper half for third iteration + ld1 {v21.16b}, [x1], x3 // Load pix1 for fourth iteration + sub w4, w4, #4 // h-= 4 + urhadd v25.16b, v20.16b, v1.16b // Rounding halving add + cmp w4, #4 + uabal v29.8h, v21.8b, v25.8b // Absolute difference of lower half for fourth iteration + uabal2 v28.8h, v21.16b, v25.16b // Absolute difference of upper half for fourth iteration + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + + ld1 {v2.16b}, [x2], x3 // Load pix3 + subs w4, w4, #1 + ld1 {v0.16b}, [x1], x3 // Load pix1 + urhadd v30.16b, v1.16b, v2.16b // Rounding halving add + mov v1.16b, v2.16b // Shift pix3->pix2 + uabal v29.8h, v30.8b, v0.8b + uabal2 v28.8h, v30.16b, v0.16b + + b.ne 2b + +3: + add v29.8h, v29.8h, v28.8h // Add vectors together + uaddlv s16, v29.8h // Add up vector values + + fmov w0, s16 + + ret +endfunc + +function sse16_neon, export=1 + // x0 - unused + // x1 - pix1 + // x2 - pix2 + // x3 - stride + // w4 - h + + cmp w4, #4 + movi v17.4s, #0 + b.lt 2f + +// Make 4 iterations at once +1: + + // res = abs(pix1[0] - pix2[0]) + // res * res + + ld1 {v0.16b}, [x1], x3 // Load pix1 vector for first iteration + ld1 {v1.16b}, [x2], x3 // Load pix2 vector for first iteration + ld1 {v2.16b}, [x1], x3 // Load pix1 vector for second iteration + uabd v30.16b, v0.16b, v1.16b // Absolute difference, first iteration + ld1 {v3.16b}, [x2], x3 // Load pix2 vector for second iteration + umull v29.8h, v30.8b, v30.8b // Multiply lower half of vectors, first iteration + umull2 v28.8h, v30.16b, v30.16b // Multiply upper half of vectors, first iteration + uabd v27.16b, v2.16b, v3.16b // Absolute difference, second iteration + uadalp v17.4s, v29.8h // Pairwise add, first iteration + ld1 {v4.16b}, [x1], x3 // Load pix1 for third iteration + umull v26.8h, v27.8b, v27.8b // Mulitply lower half, second iteration + umull2 v25.8h, v27.16b, v27.16b // Multiply upper half, second iteration + ld1 {v5.16b}, [x2], x3 // Load pix2 for third iteration + uadalp v17.4s, v26.8h // Pairwise add and accumulate, second iteration + uabd v24.16b, v4.16b, v5.16b // Absolute difference, third iteration + ld1 {v6.16b}, [x1], x3 // Load pix1 for fourth iteration + uadalp v17.4s, v25.8h // Pairwise add and accumulate, second iteration + umull v23.8h, v24.8b, v24.8b // Multiply lower half, third iteration + umull2 v22.8h, v24.16b, v24.16b // Multiply upper half, third iteration + uadalp v17.4s, v23.8h // Pairwise add and accumulate, third iteration + ld1 {v7.16b}, [x2], x3 // Load pix2 for fouth iteration + uadalp v17.4s, v22.8h // Pairwise add and accumulate, third iteration + uabd v21.16b, v6.16b, v7.16b // Absolute difference, fourth iteration + uadalp v17.4s, v28.8h // Pairwise add and accumulate, first iteration + umull v20.8h, v21.8b, v21.8b // Multiply lower half, fourth iteration + sub w4, w4, #4 // h -= 4 + umull2 v19.8h, v21.16b, v21.16b // Multiply upper half, fourth iteration + uadalp v17.4s, v20.8h // Pairwise add and accumulate, fourth iteration + cmp w4, #4 + uadalp v17.4s, v19.8h // Pairwise add and accumulate, fourth iteration + b.ge 1b + + cbz w4, 3f + +// iterate by one +2: + + ld1 {v0.16b}, [x1], x3 // Load pix1 + ld1 {v1.16b}, [x2], x3 // Load pix2 + + uabd v30.16b, v0.16b, v1.16b + umull v29.8h, v30.8b, v30.8b + umull2 v28.8h, v30.16b, v30.16b + uadalp v17.4s, v29.8h + subs w4, w4, #1 + uadalp v17.4s, v28.8h + + b.ne 2b + +3: + uaddlv d16, v17.4s // add up accumulator vector + + fmov w0, s16 + + ret +endfunc + +function sse8_neon, export=1 + // x0 - unused + // x1 - pix1 + // x2 - pix2 + // x3 - stride + // w4 - h + + movi v21.4s, #0 + movi v20.4s, #0 + cmp w4, #4 + b.lt 2f + +// make 4 iterations at once +1: + + // res = abs(pix1[0] - pix2[0]) + // res * res + + ld1 {v0.8b}, [x1], x3 // Load pix1 for first iteration + ld1 {v1.8b}, [x2], x3 // Load pix2 for second iteration + ld1 {v2.8b}, [x1], x3 // Load pix1 for second iteration + ld1 {v3.8b}, [x2], x3 // Load pix2 for second iteration + uabdl v30.8h, v0.8b, v1.8b // Absolute difference, first iteration + ld1 {v4.8b}, [x1], x3 // Load pix1 for third iteration + ld1 {v5.8b}, [x2], x3 // Load pix2 for third iteration + uabdl v29.8h, v2.8b, v3.8b // Absolute difference, second iteration + umlal v21.4s, v30.4h, v30.4h // Multiply lower half, first iteration + ld1 {v6.8b}, [x1], x3 // Load pix1 for fourth iteration + ld1 {v7.8b}, [x2], x3 // Load pix2 for fourth iteration + uabdl v28.8h, v4.8b, v5.8b // Absolute difference, third iteration + umlal v21.4s, v29.4h, v29.4h // Multiply lower half, second iteration + umlal2 v20.4s, v30.8h, v30.8h // Multiply upper half, first iteration + uabdl v27.8h, v6.8b, v7.8b // Absolute difference, fourth iteration + umlal v21.4s, v28.4h, v28.4h // Multiply lower half, third iteration + umlal2 v20.4s, v29.8h, v29.8h // Multiply upper half, second iteration + sub w4, w4, #4 // h -= 4 + umlal2 v20.4s, v28.8h, v28.8h // Multiply upper half, third iteration + umlal v21.4s, v27.4h, v27.4h // Multiply lower half, fourth iteration + cmp w4, #4 + umlal2 v20.4s, v27.8h, v27.8h // Multiply upper half, fourth iteration + b.ge 1b + + cbz w4, 3f + +// iterate by one +2: + ld1 {v0.8b}, [x1], x3 // Load pix1 + ld1 {v1.8b}, [x2], x3 // Load pix2 + subs w4, w4, #1 + uabdl v30.8h, v0.8b, v1.8b + umlal v21.4s, v30.4h, v30.4h + umlal2 v20.4s, v30.8h, v30.8h + + b.ne 2b + +3: + add v21.4s, v21.4s, v20.4s // Add accumulator vectors together + uaddlv d17, v21.4s // Add up vector + + fmov w0, s17 + ret + +endfunc + +function sse4_neon, export=1 + // x0 - unused + // x1 - pix1 + // x2 - pix2 + // x3 - stride + // w4 - h + + movi v16.4s, #0 // clear the result accumulator + cmp w4, #4 + b.lt 2f + +// make 4 iterations at once +1: + + // res = abs(pix1[0] - pix2[0]) + // res * res + + ld1 {v0.s}[0], [x1], x3 // Load pix1, first iteration + ld1 {v1.s}[0], [x2], x3 // Load pix2, first iteration + ld1 {v2.s}[0], [x1], x3 // Load pix1, second iteration + ld1 {v3.s}[0], [x2], x3 // Load pix2, second iteration + uabdl v30.8h, v0.8b, v1.8b // Absolute difference, first iteration + ld1 {v4.s}[0], [x1], x3 // Load pix1, third iteration + ld1 {v5.s}[0], [x2], x3 // Load pix2, third iteration + uabdl v29.8h, v2.8b, v3.8b // Absolute difference, second iteration + umlal v16.4s, v30.4h, v30.4h // Multiply vectors, first iteration + ld1 {v6.s}[0], [x1], x3 // Load pix1, fourth iteration + ld1 {v7.s}[0], [x2], x3 // Load pix2, fourth iteration + uabdl v28.8h, v4.8b, v5.8b // Absolute difference, third iteration + umlal v16.4s, v29.4h, v29.4h // Multiply and accumulate, second iteration + sub w4, w4, #4 + uabdl v27.8h, v6.8b, v7.8b // Absolue difference, fourth iteration + umlal v16.4s, v28.4h, v28.4h // Multiply and accumulate, third iteration + cmp w4, #4 + umlal v16.4s, v27.4h, v27.4h // Multiply and accumulate, fourth iteration + b.ge 1b + + cbz w4, 3f + +// iterate by one +2: + ld1 {v0.s}[0], [x1], x3 // Load pix1 + ld1 {v1.s}[0], [x2], x3 // Load pix2 + uabdl v30.8h, v0.8b, v1.8b + subs w4, w4, #1 + umlal v16.4s, v30.4h, v30.4h + + b.ne 2b + +3: + uaddlv d17, v16.4s // Add vector + fmov w0, s17 + + ret +endfunc + +function vsad16_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.16b}, [x1], x3 // Load pix1[0], first iteration + ld1 {v1.16b}, [x2], x3 // Load pix2[0], first iteration + + sub w4, w4, #1 // we need to make h-1 iterations + movi v16.8h, #0 + + cmp w4, #3 // check if we can make 3 iterations at once + usubl v31.8h, v0.8b, v1.8b // Signed difference pix1[0] - pix2[0], first iteration + usubl2 v30.8h, v0.16b, v1.16b // Signed difference pix1[0] - pix2[0], first iteration + + b.lt 2f + +1: + // abs(pix1[0] - pix2[0] - pix1[0 + stride] + pix2[0 + stride]) + ld1 {v0.16b}, [x1], x3 // Load pix1[0 + stride], first iteration + ld1 {v1.16b}, [x2], x3 // Load pix2[0 + stride], first iteration + ld1 {v2.16b}, [x1], x3 // Load pix1[0 + stride], second iteration + ld1 {v3.16b}, [x2], x3 // Load pix2[0 + stride], second iteration + usubl v29.8h, v0.8b, v1.8b // Signed difference pix1[0 + stride] - pix2[0 + stride], first iteration + usubl2 v28.8h, v0.16b, v1.16b // Signed difference pix1[0 + stride] - pix2[0 + stride], first iteration + ld1 {v4.16b}, [x1], x3 // Load pix1[0 + stride], third iteration + ld1 {v5.16b}, [x2], x3 // Load pix2[0 + stride], third iteration + usubl v27.8h, v2.8b, v3.8b // Signed difference pix1[0 + stride] - pix2[0 + stride], second iteration + saba v16.8h, v31.8h, v29.8h // Signed absolute difference and accumulate the result. first iteration + usubl2 v26.8h, v2.16b, v3.16b // Signed difference pix1[0 + stride] - pix2[0 + stride], second iteration + saba v16.8h, v30.8h, v28.8h // Signed absolute difference and accumulate the result. first iteration + usubl v25.8h, v4.8b, v5.8b // Signed difference pix1[0 + stride] - pix2[0 + stride], third iteration + usubl2 v24.8h, v4.16b, v5.16b // Signed difference pix1[0 + stride] - pix2[0 + stride], third iteration + saba v16.8h, v29.8h, v27.8h // Signed absolute difference and accumulate the result. second iteration + mov v31.16b, v25.16b + saba v16.8h, v28.8h, v26.8h // Signed absolute difference and accumulate the result. second iteration + sub w4, w4, #3 // h -= 3 + mov v30.16b, v24.16b + saba v16.8h, v27.8h, v25.8h // Signed absolute difference and accumulate the result. third iteration + cmp w4, #3 + saba v16.8h, v26.8h, v24.8h // Signed absolute difference and accumulate the result. third iteration + + b.ge 1b + cbz w4, 3f +2: + ld1 {v0.16b}, [x1], x3 + ld1 {v1.16b}, [x2], x3 + subs w4, w4, #1 + usubl v29.8h, v0.8b, v1.8b + usubl2 v28.8h, v0.16b, v1.16b + saba v16.8h, v31.8h, v29.8h + mov v31.16b, v29.16b + saba v16.8h, v30.8h, v28.8h + mov v30.16b, v28.16b + + b.ne 2b +3: + uaddlv s17, v16.8h + fmov w0, s17 + + ret +endfunc + +function vsse8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.8b}, [x1], x3 // Load pix1[0], first iteration + ld1 {v1.8b}, [x2], x3 // Load pix2[0], first iteration + + sub w4, w4, #1 // we need to make h-1 iterations + movi v16.4s, #0 + movi v17.4s, #0 + + cmp w4, #3 // check if we can make 3 iterations at once + usubl v31.8h, v0.8b, v1.8b // Signed difference of pix1[0] - pix2[0], first iteration + b.lt 2f + + +1: + // x = abs(pix1[0] - pix2[0] - pix1[0 + stride] + pix2[0 + stride]) + // res = (x) * (x) + ld1 {v0.8b}, [x1], x3 // Load pix1[0 + stride], first iteration + ld1 {v1.8b}, [x2], x3 // Load pix2[0 + stride], first iteration + ld1 {v2.8b}, [x1], x3 // Load pix1[0 + stride], second iteration + ld1 {v3.8b}, [x2], x3 // Load pix2[0 + stride], second iteration + usubl v29.8h, v0.8b, v1.8b + usubl2 v28.8h, v0.16b, v1.16b + ld1 {v4.8b}, [x1], x3 // Load pix1[0 + stride], third iteration + ld1 {v5.8b}, [x2], x3 // Load pix1[0 + stride], third iteration + sabd v31.8h, v31.8h, v29.8h + usubl v27.8h, v2.8b, v3.8b + usubl v25.8h, v4.8b, v5.8b + sabd v29.8h, v29.8h, v27.8h + sabd v27.8h, v27.8h, v25.8h + umlal v16.4s, v31.4h, v31.4h + umlal2 v17.4s, v31.8h, v31.8h + mov v31.16b, v25.16b + umlal v16.4s, v29.4h, v29.4h + umlal2 v17.4s, v29.8h, v29.8h + sub w4, w4, #3 + umlal v16.4s, v27.4h, v27.4h + umlal2 v17.4s, v27.8h, v27.8h + cmp w4, #3 + + b.ge 1b + + cbz w4, 3f + +// iterate by once +2: + ld1 {v0.8b}, [x1], x3 + ld1 {v1.8b}, [x2], x3 + subs w4, w4, #1 + usubl v29.8h, v0.8b, v1.8b + sabd v31.8h, v31.8h, v29.8h + umlal v16.4s, v31.4h, v31.4h + umlal2 v17.4s, v31.8h, v31.8h + mov v31.16b, v29.16b + b.ne 2b + +3: + add v16.4s, v16.4s, v17.4s + uaddlv d17, v16.4s + fmov w0, s17 + + ret +endfunc + + +function vsse16_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.16b}, [x1], x3 // Load pix1[0], first iteration + ld1 {v1.16b}, [x2], x3 // Load pix2[0], first iteration + + sub w4, w4, #1 // we need to make h-1 iterations + movi v16.4s, #0 + movi v17.4s, #0 + + cmp w4, #3 // check if we can make 3 iterations at once + usubl v31.8h, v0.8b, v1.8b // Signed difference of pix1[0] - pix2[0], first iteration + usubl2 v30.8h, v0.16b, v1.16b // Signed difference of pix1[0] - pix2[0], first iteration + b.lt 2f + + +1: + // x = abs(pix1[0] - pix2[0] - pix1[0 + stride] + pix2[0 + stride]) + // res = (x) * (x) + ld1 {v0.16b}, [x1], x3 // Load pix1[0 + stride], first iteration + ld1 {v1.16b}, [x2], x3 // Load pix2[0 + stride], first iteration + ld1 {v2.16b}, [x1], x3 // Load pix1[0 + stride], second iteration + ld1 {v3.16b}, [x2], x3 // Load pix2[0 + stride], second iteration + usubl v29.8h, v0.8b, v1.8b + usubl2 v28.8h, v0.16b, v1.16b + ld1 {v4.16b}, [x1], x3 // Load pix1[0 + stride], third iteration + ld1 {v5.16b}, [x2], x3 // Load pix1[0 + stride], third iteration + sabd v31.8h, v31.8h, v29.8h + sabd v30.8h, v30.8h, v28.8h + usubl v27.8h, v2.8b, v3.8b + usubl2 v26.8h, v2.16b, v3.16b + usubl v25.8h, v4.8b, v5.8b + usubl2 v24.8h, v4.16b, v5.16b + sabd v29.8h, v29.8h, v27.8h + sabd v27.8h, v27.8h, v25.8h + umlal v16.4s, v31.4h, v31.4h + umlal2 v17.4s, v31.8h, v31.8h + sabd v28.8h, v28.8h, v26.8h + sabd v26.8h, v26.8h, v24.8h + umlal v16.4s, v30.4h, v30.4h + umlal2 v17.4s, v30.8h, v30.8h + mov v31.16b, v25.16b + umlal v16.4s, v29.4h, v29.4h + umlal2 v17.4s, v29.8h, v29.8h + mov v30.16b, v24.16b + umlal v16.4s, v28.4h, v28.4h + umlal2 v17.4s, v28.8h, v28.8h + sub w4, w4, #3 + umlal v16.4s, v27.4h, v27.4h + umlal2 v17.4s, v27.8h, v27.8h + cmp w4, #3 + umlal v16.4s, v26.4h, v26.4h + umlal2 v17.4s, v26.8h, v26.8h + + b.ge 1b + + cbz w4, 3f + +// iterate by once +2: + ld1 {v0.16b}, [x1], x3 + ld1 {v1.16b}, [x2], x3 + subs w4, w4, #1 + usubl v29.8h, v0.8b, v1.8b + usubl2 v28.8h, v0.16b, v1.16b + sabd v31.8h, v31.8h, v29.8h + sabd v30.8h, v30.8h, v28.8h + umlal v16.4s, v31.4h, v31.4h + umlal2 v17.4s, v31.8h, v31.8h + mov v31.16b, v29.16b + umlal v16.4s, v30.4h, v30.4h + umlal2 v17.4s, v30.8h, v30.8h + mov v30.16b, v28.16b + b.ne 2b + +3: + add v16.4s, v16.4s, v17.4s + uaddlv d17, v16.4s + fmov w0, s17 + + ret +endfunc + +function vsad_intra16_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *dummy + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.16b}, [x1], x3 + sub w4, w4, #1 // we need to make h-1 iterations + cmp w4, #3 + movi v16.8h, #0 + b.lt 2f + +// make 4 iterations at once +1: + // v = abs( pix1[0] - pix1[0 + stride] ) + // score = sum(v) + ld1 {v1.16b}, [x1], x3 + ld1 {v2.16b}, [x1], x3 + uabal v16.8h, v0.8b, v1.8b + ld1 {v3.16b}, [x1], x3 + uabal2 v16.8h, v0.16b, v1.16b + sub w4, w4, #3 + uabal v16.8h, v1.8b, v2.8b + cmp w4, #3 + uabal2 v16.8h, v1.16b, v2.16b + mov v0.16b, v3.16b + uabal v16.8h, v2.8b, v3.8b + uabal2 v16.8h, v2.16b, v3.16b + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v1.16b}, [x1], x3 + subs w4, w4, #1 + uabal v16.8h, v0.8b, v1.8b + uabal2 v16.8h, v0.16b, v1.16b + mov v0.16b, v1.16b + cbnz w4, 2b + +3: + uaddlv s17, v16.8h + fmov w0, s17 + + ret +endfunc + +function vsse_intra16_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *dummy + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.16b}, [x1], x3 + movi v16.4s, #0 + movi v17.4s, #0 + + sub w4, w4, #1 // we need to make h-1 iterations + cmp w4, #3 + b.lt 2f + +1: + // v = abs( pix1[0] - pix1[0 + stride] ) + // score = sum( v * v ) + ld1 {v1.16b}, [x1], x3 + ld1 {v2.16b}, [x1], x3 + uabd v30.16b, v0.16b, v1.16b + ld1 {v3.16b}, [x1], x3 + umull v29.8h, v30.8b, v30.8b + umull2 v28.8h, v30.16b, v30.16b + uabd v27.16b, v1.16b, v2.16b + uadalp v16.4s, v29.8h + umull v26.8h, v27.8b, v27.8b + umull2 v27.8h, v27.16b, v27.16b + uadalp v17.4s, v28.8h + uabd v25.16b, v2.16b, v3.16b + uadalp v16.4s, v26.8h + umull v24.8h, v25.8b, v25.8b + umull2 v25.8h, v25.16b, v25.16b + uadalp v17.4s, v27.8h + sub w4, w4, #3 + uadalp v16.4s, v24.8h + cmp w4, #3 + uadalp v17.4s, v25.8h + mov v0.16b, v3.16b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v1.16b}, [x1], x3 + subs w4, w4, #1 + uabd v30.16b, v0.16b, v1.16b + mov v0.16b, v1.16b + umull v29.8h, v30.8b, v30.8b + umull2 v30.8h, v30.16b, v30.16b + uadalp v16.4s, v29.8h + uadalp v17.4s, v30.8h + cbnz w4, 2b + +3: + add v16.4s, v16.4s, v17.4S + uaddlv d17, v16.4s + fmov w0, s17 + + ret +endfunc + +function vsse_intra8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *dummy + // x3 ptrdiff_t stride + // w4 int h + + sub w4, w4, #1 // we need to make h-1 iterations + ld1 {v0.8b}, [x1], x3 + cmp w4, #3 + movi v16.4s, #0 + + b.lt 2f + +1: + // v = abs( pix1[0] - pix1[0 + stride] ) + // score = sum( v * v ) + ld1 {v1.8b}, [x1], x3 + ld1 {v2.8b}, [x1], x3 + uabd v30.8b, v0.8b, v1.8b + ld1 {v3.8b}, [x1], x3 + uabd v27.8b, v1.8b, v2.8b + umull v29.8h, v30.8b, v30.8b + uabd v25.8b, v2.8b, v3.8b + umull v26.8h, v27.8b, v27.8b + uadalp v16.4s, v29.8h + umull v24.8h, v25.8b, v25.8b + uadalp v16.4s, v26.8h + sub w4, w4, #3 + uadalp v16.4s, v24.8h + cmp w4, #3 + mov v0.8b, v3.8b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v1.8b}, [x1], x3 + subs w4, w4, #1 + uabd v30.8b, v0.8b, v1.8b + mov v0.8b, v1.8b + umull v29.8h, v30.8b, v30.8b + uadalp v16.4s, v29.8h + cbnz w4, 2b + +3: + uaddlv d17, v16.4s + fmov w0, s17 + + ret +endfunc + +function nsse16_neon, export=1 + // x0 multiplier + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + str x0, [sp, #-0x40]! + stp x1, x2, [sp, #0x10] + stp x3, x4, [sp, #0x20] + str x30, [sp, #0x30] + bl X(sse16_neon) + ldr x30, [sp, #0x30] + mov w9, w0 // here we store score1 + ldp x1, x2, [sp, #0x10] + ldp x3, x4, [sp, #0x20] + ldr x5, [sp], #0x40 + + movi v16.8h, #0 + movi v17.8h, #0 + movi v18.8h, #0 + movi v19.8h, #0 + + ld1 {v0.16b}, [x1], x3 + subs w4, w4, #1 // we need to make h-1 iterations + ld1 {v2.16b}, [x2], x3 + ext v1.16b, v0.16b, v0.16b, #1 // x1 + 1 + cmp w4, #2 + ext v3.16b, v2.16b, v2.16b, #1 // x2 + 1 + + b.lt 2f + +// make 2 iterations at once +1: + ld1 {v4.16b}, [x1], x3 + ld1 {v6.16b}, [x2], x3 + ld1 {v20.16b}, [x1], x3 + ext v5.16b, v4.16b, v4.16b, #1 // x1 + stride + 1 + usubl v31.8h, v0.8b, v4.8b + usubl2 v30.8h, v0.16b, v4.16b + ld1 {v22.16b}, [x2], x3 + usubl v29.8h, v1.8b, v5.8b + usubl2 v28.8h, v1.16b, v5.16b + ext v7.16b, v6.16b, v6.16b, #1 // x2 + stride + 1 + saba v16.8h, v31.8h, v29.8h + ext v21.16b, v20.16b, v20.16b, #1 + saba v17.8h, v30.8h, v28.8h + usubl v27.8h, v2.8b, v6.8b + usubl2 v26.8h, v2.16b, v6.16b + ext v23.16b, v22.16b, v22.16b, #1 + usubl v25.8h, v3.8b, v7.8b + usubl2 v24.8h, v3.16b, v7.16b + saba v18.8h, v27.8h, v25.8h + saba v19.8h, v26.8h, v24.8h + + usubl v31.8h, v4.8b, v20.8b + usubl2 v30.8h, v4.16b, v20.16b + usubl v29.8h, v5.8b, v21.8b + usubl2 v28.8h, v5.16b, v21.16b + saba v16.8h, v31.8h, v29.8h + saba v17.8h, v30.8h, v28.8h + usubl v27.8h, v6.8b, v22.8b + usubl2 v26.8h, v6.16b, v22.16b + usubl v25.8h, v7.8b, v23.8b + usubl2 v24.8h, v7.16b, v23.16b + saba v18.8h, v27.8h, v25.8h + saba v19.8h, v26.8h, v24.8h + sub w4, w4, #2 + + mov v0.16b, v20.16b + mov v1.16b, v21.16b + cmp w4, #2 + mov v2.16b, v22.16b + mov v3.16b, v23.16b + + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v4.16b}, [x1], x3 + subs w4, w4, #1 + ld1 {v6.16b}, [x2], x3 + ext v5.16b, v4.16b, v4.16b, #1 // x1 + stride + 1 + usubl v31.8h, v0.8b, v4.8b + ext v7.16b, v6.16b, v6.16b, #1 // x2 + stride + 1 + + usubl2 v30.8h, v0.16b, v4.16b + usubl v29.8h, v1.8b, v5.8b + usubl2 v28.8h, v1.16b, v5.16b + saba v16.8h, v31.8h, v29.8h + saba v17.8h, v30.8h, v28.8h + usubl v27.8h, v2.8b, v6.8b + usubl2 v26.8h, v2.16b, v6.16b + usubl v25.8h, v3.8b, v7.8b + usubl2 v24.8h, v3.16b, v7.16b + saba v18.8h, v27.8h, v25.8h + saba v19.8h, v26.8h, v24.8h + + mov v0.16b, v4.16b + mov v1.16b, v5.16b + mov v2.16b, v6.16b + mov v3.16b, v7.16b + + cbnz w4, 2b + +3: + sqsub v17.8h, v17.8h, v19.8h + sqsub v16.8h, v16.8h, v18.8h + ins v17.h[7], wzr + sqadd v16.8h, v16.8h, v17.8h + saddlv s16, v16.8h + sqabs s16, s16 + fmov w0, s16 + + mul w0, w0, w5 + add w0, w0, w9 + + ret +endfunc + +function nsse8_neon, export=1 + // x0 multiplier + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + str x0, [sp, #-0x40]! + stp x1, x2, [sp, #0x10] + stp x3, x4, [sp, #0x20] + str x30, [sp, #0x30] + bl X(sse8_neon) + ldr x30, [sp, #0x30] + mov w9, w0 // here we store score1 + ldp x1, x2, [sp, #0x10] + ldp x3, x4, [sp, #0x20] + ldr x5, [sp], #0x40 + + movi v16.8h, #0 + movi v17.8h, #0 + movi v18.8h, #0 + movi v19.8h, #0 + + ld1 {v0.8b}, [x1], x3 + subs w4, w4, #1 // we need to make h-1 iterations + ext v1.8b, v0.8b, v0.8b, #1 // x1 + 1 + ld1 {v2.8b}, [x2], x3 + cmp w4, #2 + ext v3.8b, v2.8b, v2.8b, #1 // x2 + 1 + + b.lt 2f + +// make 2 iterations at once +1: + ld1 {v4.8b}, [x1], x3 + ld1 {v20.8b}, [x1], x3 + ld1 {v6.8b}, [x2], x3 + ext v5.8b, v4.8b, v4.8b, #1 // x1 + stride + 1 + ext v21.8b, v20.8b, v20.8b, #1 + ld1 {v22.8b}, [x2], x3 + ext v7.8b, v6.8b, v6.8b, #1 // x2 + stride + 1 + usubl v31.8h, v0.8b, v4.8b + ext v23.8b, v22.8b, v22.8b, #1 + usubl v29.8h, v1.8b, v5.8b + usubl v27.8h, v2.8b, v6.8b + usubl v25.8h, v3.8b, v7.8b + saba v16.8h, v31.8h, v29.8h + usubl v31.8h, v4.8b, v20.8b + saba v18.8h, v27.8h, v25.8h + sub w4, w4, #2 + usubl v29.8h, v5.8b, v21.8b + mov v0.16b, v20.16b + mov v1.16b, v21.16b + saba v16.8h, v31.8h, v29.8h + usubl v27.8h, v6.8b, v22.8b + usubl v25.8h, v7.8b, v23.8b + mov v2.16b, v22.16b + mov v3.16b, v23.16b + cmp w4, #2 + saba v18.8h, v27.8h, v25.8h + b.ge 1b + cbz w4, 3f + +// iterate by one +2: + ld1 {v4.8b}, [x1], x3 + subs w4, w4, #1 + ext v5.8b, v4.8b, v4.8b, #1 // x1 + stride + 1 + ld1 {v6.8b}, [x2], x3 + usubl v31.8h, v0.8b, v4.8b + ext v7.8b, v6.8b, v6.8b, #1 // x2 + stride + 1 + + usubl v29.8h, v1.8b, v5.8b + saba v16.8h, v31.8h, v29.8h + usubl v27.8h, v2.8b, v6.8b + usubl v25.8h, v3.8b, v7.8b + saba v18.8h, v27.8h, v25.8h + + mov v0.16b, v4.16b + mov v1.16b, v5.16b + mov v2.16b, v6.16b + mov v3.16b, v7.16b + + cbnz w4, 2b + +3: + sqsub v16.8h, v16.8h, v18.8h + ins v16.h[7], wzr + saddlv s16, v16.8h + sqabs s16, s16 + fmov w0, s16 + + mul w0, w0, w5 + add w0, w0, w9 + + ret +endfunc + +function pix_median_abs16_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v2.16b}, [x1], x3 + ld1 {v3.16b}, [x2], x3 + movi v31.8h, #0 + movi v16.8h, #0 + ext v0.16b, v2.16b, v2.16b, #1 + ext v1.16b, v3.16b, v3.16b, #1 + usubl v28.8h, v2.8b, v3.8b + usubl2 v27.8h, v2.16b, v3.16b + usubl v26.8h, v0.8b, v1.8b + usubl2 v25.8h, v0.16b, v1.16b + sub w4, w4, #1 // we need to make h-1 iterations + saba v31.8h, v26.8h, v28.8h + saba v16.8h, v25.8h, v27.8h + mov h18, v28.h[0] + cmp w4, #1 + sqabs h18, h18 + movi v0.8h, #0 + + b.lt 2f +1: + + ld1 {v6.16b}, [x1], x3 // pix1 vector for V(j-1) + ld1 {v7.16b}, [x2], x3 // pix2 vector for V(j-1) + subs w4, w4, #1 + ext v4.16b, v6.16b, v6.16b, #1 // pix1 vector for V(j) + ext v5.16b, v7.16b, v7.16b, #1 // pix2 vector for V(j) + + // protected registers: v30, v29, v28, v27, v26, v25, v24, v23 + // scratch registers: v22, v21, v20, v19, v17 + + // To find median of three values, calculate sum of them + // and subtract max and min value from it. + usubl v30.8h, v6.8b, v7.8b // V(j-1) + usubl2 v29.8h, v6.16b, v7.16b // V(j-1) + usubl v24.8h, v4.8b, v5.8b // V(j) + usubl2 v23.8h, v4.16b, v5.16b // V(j) + saba v0.8h, v30.8h, v28.8h + add v22.8h, v26.8h, v30.8h + smin v20.8h, v26.8h, v30.8h + add v21.8h, v25.8h, v29.8h + smax v19.8h, v26.8h, v30.8h + sub v22.8h, v22.8h, v28.8h + sub v21.8h, v21.8h, v27.8h + smin v17.8h, v19.8h, v22.8h + smin v22.8h, v25.8h, v29.8h + mov v28.16b, v30.16b + smax v20.8h, v20.8h, v17.8h // median values lower half + smax v19.8h, v25.8h, v29.8h + saba v31.8h, v24.8h, v20.8h + mov v27.16b, v29.16b + smin v19.8h, v19.8h, v21.8h + mov v26.16b, v24.16b + smax v17.8h, v22.8h, v19.8h // median values upper half + mov v25.16b, v23.16b + saba v16.8h, v23.8h, v17.8h + + b.ne 1b + +2: + mov h17, v0.h[0] + ins v16.h[7], wzr + add d18, d18, d17 + add v31.8h, v31.8h, v16.8h + uaddlv s17, v31.8h + add d18, d18, d17 + fmov w0, s18 + + ret + +endfunc + +function vsad_intra8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *dummy + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v0.8b}, [x1], x3 + sub w4, w4, #1 // we need to make h-1 iterations + cmp w4, #3 + movi v16.8h, #0 + b.lt 2f + +1: + // v = abs( pix1[0] - pix1[0 + stride] ) + // score = sum(v) + ld1 {v1.8b}, [x1], x3 + sub w4, w4, #3 + ld1 {v2.8b}, [x1], x3 + uabal v16.8h, v0.8b, v1.8b + ld1 {v3.8b}, [x1], x3 + uabal v16.8h, v1.8b, v2.8b + cmp w4, #3 + mov v0.8b, v3.8b + uabal v16.8h, v2.8b, v3.8b + b.ge 1b + cbz w4, 3f + +2: + ld1 {v1.8b}, [x1], x3 + subs w4, w4, #1 + uabal v16.8h, v0.8b, v1.8b + mov v0.8b, v1.8b + cbnz w4, 2b + +3: + uaddlv s17, v16.8h + fmov w0, s17 + + ret +endfunc + +function pix_median_abs8_neon, export=1 + // x0 unused + // x1 uint8_t *pix1 + // x2 uint8_t *pix2 + // x3 ptrdiff_t stride + // w4 int h + + ld1 {v2.8b}, [x1], x3 + ld1 {v3.8b}, [x2], x3 + movi v31.8h, #0 + ext v0.8b, v2.8b, v2.8b, #1 + ext v1.8b, v3.8b, v3.8b, #1 + usubl v28.8h, v2.8b, v3.8b + usubl v26.8h, v0.8b, v1.8b + sub w4, w4, #1 // we need to make h-1 iterations + saba v31.8h, v26.8h, v28.8h + mov h18, v28.h[0] + cmp w4, #1 + sqabs h18, h18 + movi v0.8h, #0 + + b.lt 2f +1: + ld1 {v6.8b}, [x1], x3 // pix1 vector for V(j-1) + ld1 {v7.8b}, [x2], x3 // pix2 vector for V(j-1) + subs w4, w4, #1 + ext v4.8b, v6.8b, v6.8b, #1 // pix1 vector for V(j) + ext v5.8b, v7.8b, v7.8b, #1 // pix2 vector for V(j) + + // protected registers: v30, v29, v28, v27, v26, v25, v24, v23 + // scratch registers: v22, v21, v20, v19, v17 + + // To find median of three values, calculate sum of them + // and subtract max and min value from it. + usubl v30.8h, v6.8b, v7.8b // V(j-1) + usubl v24.8h, v4.8b, v5.8b // V(j) + saba v0.8h, v30.8h, v28.8h + add v22.8h, v26.8h, v30.8h + smin v20.8h, v26.8h, v30.8h + smax v19.8h, v26.8h, v30.8h + sub v22.8h, v22.8h, v28.8h + smin v17.8h, v19.8h, v22.8h + mov v28.16b, v30.16b + smax v20.8h, v20.8h, v17.8h // median values lower half + smax v19.8h, v25.8h, v29.8h + saba v31.8h, v24.8h, v20.8h + mov v26.16b, v24.16b + smax v17.8h, v22.8h, v19.8h // median values upper half + + b.ne 1b +2: + mov h17, v0.h[0] + ins v31.h[7], wzr + add d18, d18, d17 + uaddlv s17, v31.8h + add d18, d18, d17 + fmov w0, s18 + + ret + +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/rv40dsp_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,14 +25,14 @@ #include "config.h" -void ff_put_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_rv40_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_rv40_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_rv40_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_rv40_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_rv40_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_rv40dsp_init_aarch64(RV34DSPContext *c) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,11 +32,11 @@ AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF); #endif -void ff_synth_filter_float_neon(FFTContext *imdct, +void ff_synth_filter_float_neon(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], - float out[32], const float in[32], - float scale); + float out[32], float in[32], + float scale, av_tx_fn imdct_fn); av_cold void ff_synth_filter_init_aarch64(SynthFilterContext *s) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/synth_filter_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -43,8 +43,8 @@ .endm function ff_synth_filter_float_neon, export=1 + mov x9, x7 // imdct_fn parameter ldr w7, [x2] // *synth_buf_offset - ldr x9, [x0, #IMDCT_HALF] // imdct_half function pointer sxtw x7, w7 stp x3, x4, [sp, #-64]! add x1, x1, x7, lsl #2 // synth_buf @@ -58,14 +58,15 @@ str s0, [sp, #48] mov x2, x6 // in + mov x3, #4 // sizeof(float) blr x9 - ldp x2, x4, [sp] // synct_buf_2, window ldp x13, x9, [sp, #16] // out, synth_buf ldp x0, x30, [sp, #32] // *synth_buf_offset AARCH64_VALIDATE_LINK_REGISTER ldr s0, [sp, #48] + ldp x2, x4, [sp], #64 // synct_buf_2, window add x3, x2, #16*4 // synct_buf_2 + 16 add x14, x13, #16*4 // out + 16 @@ -116,6 +117,5 @@ b 1b 10: - add sp, sp, #64 ret endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vc1dsp_init_aarch64.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,13 +43,13 @@ void ff_vc1_v_loop_filter16_neon(uint8_t *src, ptrdiff_t stride, int pq); void ff_vc1_h_loop_filter16_neon(uint8_t *src, ptrdiff_t stride, int pq); -void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); int ff_vc1_unescape_buffer_helper_neon(const uint8_t *src, int size, uint8_t *dst); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/videodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/videodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/videodsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/videodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "libavutil/aarch64/cpu.h" #include "libavcodec/videodsp.h" -void ff_prefetch_aarch64(uint8_t *mem, ptrdiff_t stride, int h); +void ff_prefetch_aarch64(const uint8_t *mem, ptrdiff_t stride, int h); av_cold void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vorbisdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "libavcodec/vorbisdsp.h" void ff_vorbis_inverse_coupling_neon(float *mag, float *ang, - intptr_t blocksize); + ptrdiff_t blocksize); av_cold void ff_vorbisdsp_init_aarch64(VorbisDSPContext *c) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp8dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp8dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp8dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp8dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -53,7 +53,7 @@ #define VP8_MC(n, opt) \ void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t srcstride, \ + const uint8_t *src, ptrdiff_t srcstride,\ int h, int x, int y) #define VP8_EPEL(w, opt) \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9itxfm_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9itxfm_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9itxfm_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9itxfm_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -850,10 +850,10 @@ mov x15, x30 // iadst16 requires clobbering v8-v15, but idct16 doesn't need to. .ifnc \txfm1\()_\txfm2,idct_idct - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] .endif sub sp, sp, #512 @@ -920,10 +920,10 @@ add sp, sp, #512 .ifnc \txfm1\()_\txfm2,idct_idct - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 .endif ret x15 endfunc @@ -1486,8 +1486,8 @@ mov x15, x30 - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x20]! + stp d10, d11, [sp, #0x10] sub sp, sp, #2048 @@ -1544,8 +1544,8 @@ add sp, sp, #2048 - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d8, d9, [sp], #0x20 ret x15 endfunc @@ -1569,8 +1569,8 @@ add sp, sp, #2048 - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d8, d9, [sp], #0x20 ret x15 endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_16bpp_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_16bpp_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_16bpp_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_16bpp_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -417,10 +417,10 @@ function ff_\func\()_\bpp\()_neon, export=1 .if \push mov x16, x30 - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] .endif lsl w2, w2, #\bpp - 8 lsl w3, w3, #\bpp - 8 @@ -430,10 +430,10 @@ mov x7, #((1 << \bpp) - 1) .if \push bl \func\()_16_neon - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x16 .else b \func\()_16_neon @@ -450,10 +450,10 @@ function ff_\func\()_\suffix\()_\bpp\()_neon, export=1 mov x16, x30 .if \push - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] .endif lsl w2, w2, #\bpp - 8 lsl w3, w3, #\bpp - 8 @@ -469,10 +469,10 @@ .endif bl \func\()_\int_suffix\()_16_neon .if \push - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], 0x40 .endif ret x16 endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aarch64/vp9lpf_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -564,10 +564,10 @@ loop_filter 16, .8b, 0, v8, v9, v10, v11, v12, v13, v14, v15 ret 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 endfunc @@ -575,10 +575,10 @@ loop_filter 16, .16b, 0, v8, v9, v10, v11, v12, v13, v14, v15 ret 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 endfunc @@ -973,10 +973,10 @@ function ff_vp9_loop_filter_v_16_8_neon, export=1 mov x10, x30 - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] sub x9, x0, x1, lsl #3 ld1 {v16.8b}, [x9], x1 // p7 ld1 {v24.8b}, [x0], x1 // q0 @@ -1018,10 +1018,10 @@ st1 {v9.8b}, [x9], x1 st1 {v17.8b}, [x0], x1 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 8: add x9, x9, x1, lsl #2 @@ -1045,10 +1045,10 @@ function ff_vp9_loop_filter_v_16_16_neon, export=1 mov x10, x30 - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] sub x9, x0, x1, lsl #3 ld1 {v16.16b}, [x9], x1 // p7 ld1 {v24.16b}, [x0], x1 // q0 @@ -1087,10 +1087,10 @@ st1 {v9.16b}, [x9], x1 st1 {v17.16b}, [x0], x1 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 8: add x9, x9, x1, lsl #2 @@ -1112,10 +1112,10 @@ function ff_vp9_loop_filter_h_16_8_neon, export=1 mov x10, x30 - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] sub x9, x0, #8 ld1 {v16.8b}, [x9], x1 ld1 {v24.8b}, [x0], x1 @@ -1164,10 +1164,10 @@ st1 {v9.8b}, [x9], x1 st1 {v31.8b}, [x0], x1 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 8: // The same writeback as in loop_filter_h_8_8 @@ -1202,10 +1202,10 @@ function ff_vp9_loop_filter_h_16_16_neon, export=1 mov x10, x30 - stp d14, d15, [sp, #-0x10]! - stp d12, d13, [sp, #-0x10]! - stp d10, d11, [sp, #-0x10]! - stp d8, d9, [sp, #-0x10]! + stp d8, d9, [sp, #-0x40]! + stp d14, d15, [sp, #0x30] + stp d12, d13, [sp, #0x20] + stp d10, d11, [sp, #0x10] sub x9, x0, #8 ld1 {v16.8b}, [x9], x1 ld1 {v24.8b}, [x0], x1 @@ -1283,10 +1283,10 @@ st1 {v9.d}[1], [x9], x1 st1 {v31.d}[1], [x0], x1 9: - ldp d8, d9, [sp], 0x10 - ldp d10, d11, [sp], 0x10 - ldp d12, d13, [sp], 0x10 - ldp d14, d15, [sp], 0x10 + ldp d10, d11, [sp, #0x10] + ldp d12, d13, [sp, #0x20] + ldp d14, d15, [sp, #0x30] + ldp d8, d9, [sp], #0x40 ret x10 8: sub x9, x0, #4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aasc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aasc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aasc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aasc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,11 @@ * Autodesk RLE Video Decoder by Konstantin Shishkov */ -#include -#include #include #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "msrledec.h" typedef struct AascContext { @@ -151,7 +149,7 @@ const FFCodec ff_aasc_decoder = { .p.name = "aasc", - .p.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"), + CODEC_LONG_NAME("Autodesk RLE"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AASC, .priv_data_size = sizeof(AascContext), @@ -159,5 +157,4 @@ .close = aasc_decode_end, FF_CODEC_DECODE_CB(aasc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,12 +38,12 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "bswapdsp.h" -#include "internal.h" #include "aac_ac3_parser.h" #include "ac3_parser_internal.h" #include "ac3dec.h" #include "ac3dec_data.h" #include "ac3defs.h" +#include "decode.h" #include "kbdwin.h" /** @@ -183,6 +183,33 @@ #endif } +static void ac3_downmix(AVCodecContext *avctx) +{ + AC3DecodeContext *s = avctx->priv_data; + const AVChannelLayout mono = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; + const AVChannelLayout stereo = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + + /* allow downmixing to stereo or mono */ +#if FF_API_OLD_CHANNEL_LAYOUT +FF_DISABLE_DEPRECATION_WARNINGS + if (avctx->request_channel_layout) { + av_channel_layout_uninit(&s->downmix_layout); + av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); + } +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (avctx->ch_layout.nb_channels > 1 && + !av_channel_layout_compare(&s->downmix_layout, &mono)) { + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; + } else if (avctx->ch_layout.nb_channels > 2 && + !av_channel_layout_compare(&s->downmix_layout, &stereo)) { + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + } + s->downmixed = 1; +} + /** * AVCodec initialization */ @@ -190,28 +217,30 @@ { static AVOnce init_static_once = AV_ONCE_INIT; AC3DecodeContext *s = avctx->priv_data; - const AVChannelLayout mono = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; - const AVChannelLayout stereo = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + const float scale = 1.0f; int i, ret; s->avctx = avctx; - if ((ret = ff_mdct_init(&s->imdct_256, 8, 1, 1.0)) < 0 || - (ret = ff_mdct_init(&s->imdct_512, 9, 1, 1.0)) < 0) + if ((ret = av_tx_init(&s->tx_128, &s->tx_fn_128, IMDCT_TYPE, 1, 128, &scale, 0))) + return ret; + + 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); ff_bswapdsp_init(&s->bdsp); #if (USE_FIXED) s->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT); #else - ff_fmt_convert_init(&s->fmt_conv, avctx); + ff_fmt_convert_init(&s->fmt_conv); s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); #endif if (!s->fdsp) return AVERROR(ENOMEM); - ff_ac3dsp_init(&s->ac3dsp, avctx->flags & AV_CODEC_FLAG_BITEXACT); + ff_ac3dsp_init(&s->ac3dsp); av_lfg_init(&s->dith_state, 0); if (USE_FIXED) @@ -219,25 +248,7 @@ else avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - /* allow downmixing to stereo or mono */ -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout) { - av_channel_layout_uninit(&s->downmix_layout); - av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (avctx->ch_layout.nb_channels > 1 && - !av_channel_layout_compare(&s->downmix_layout, &mono)) { - av_channel_layout_uninit(&avctx->ch_layout); - avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; - } else if (avctx->ch_layout.nb_channels > 2 && - !av_channel_layout_compare(&s->downmix_layout, &stereo)) { - av_channel_layout_uninit(&avctx->ch_layout); - avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; - } - s->downmixed = 1; + ac3_downmix(avctx); for (i = 0; i < AC3_MAX_CHANNELS; i++) { s->xcfptr[i] = s->transform_coeffs[i]; @@ -714,10 +725,10 @@ for (ch = 1; ch <= channels; ch++) { if (s->block_switch[ch]) { int i; - FFTSample *x = s->tmp_output + 128; + INTFLOAT *x = s->tmp_output + 128; for (i = 0; i < 128; i++) x[i] = s->transform_coeffs[ch][2 * i]; - s->imdct_256.imdct_half(&s->imdct_256, s->tmp_output, x); + s->tx_fn_128(s->tx_128, s->tmp_output, x, sizeof(INTFLOAT)); #if USE_FIXED s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset], s->tmp_output, s->window, 128, 8); @@ -727,9 +738,9 @@ #endif for (i = 0; i < 128; i++) x[i] = s->transform_coeffs[ch][2 * i + 1]; - s->imdct_256.imdct_half(&s->imdct_256, s->delay[ch - 1 + offset], x); + s->tx_fn_128(s->tx_128, s->delay[ch - 1 + offset], x, sizeof(INTFLOAT)); } else { - s->imdct_512.imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]); + s->tx_fn_256(s->tx_256, s->tmp_output, s->transform_coeffs[ch], sizeof(INTFLOAT)); #if USE_FIXED s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1 + offset], s->tmp_output, s->window, 128, 8); @@ -737,7 +748,7 @@ s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1 + offset], s->tmp_output, s->window, 128); #endif - memcpy(s->delay[ch - 1 + offset], s->tmp_output + 128, 128 * sizeof(FFTSample)); + memcpy(s->delay[ch - 1 + offset], s->tmp_output + 128, 128 * sizeof(INTFLOAT)); } } } @@ -1501,19 +1512,8 @@ s->superframe_size = 0; buf_size = full_buf_size; - for (i = 1; i < buf_size; i += 2) { - if (buf[i] == 0x77 || buf[i] == 0x0B) { - if ((buf[i] ^ buf[i-1]) == (0x77 ^ 0x0B)) { - i--; - break; - } else if ((buf[i] ^ buf[i+1]) == (0x77 ^ 0x0B)) { - break; - } - } - } - if (i >= buf_size) - return AVERROR_INVALIDDATA; - if (i > 10) + i = ff_ac3_find_syncword(buf, buf_size); + if (i < 0 || i > 10) return i; buf += i; buf_size -= i; @@ -1716,6 +1716,11 @@ avctx->bit_rate = s->bit_rate + s->prev_bit_rate; } + if (!avctx->sample_rate) { + av_log(avctx, AV_LOG_ERROR, "Could not determine the sample rate\n"); + return AVERROR_INVALIDDATA; + } + for (ch = 0; ch < EAC3_MAX_CHANNELS; ch++) extended_channel_map[ch] = ch; @@ -1751,7 +1756,7 @@ if (index < 0) return AVERROR_INVALIDDATA; if (extend >= channel_map_size) - return AVERROR_INVALIDDATA; + break; extended_channel_map[index] = offset + channel_map[extend++]; } else { @@ -1763,7 +1768,7 @@ if (index < 0) return AVERROR_INVALIDDATA; if (extend >= channel_map_size) - return AVERROR_INVALIDDATA; + break; extended_channel_map[index] = offset + channel_map[extend++]; } @@ -1771,6 +1776,8 @@ } } } + + ac3_downmix(avctx); } /* get output buffer */ @@ -1856,8 +1863,8 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx) { AC3DecodeContext *s = avctx->priv_data; - ff_mdct_end(&s->imdct_512); - ff_mdct_end(&s->imdct_256); + av_tx_uninit(&s->tx_256); + av_tx_uninit(&s->tx_128); av_freep(&s->fdsp); av_freep(&s->downmix_coeffs[0]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,11 +47,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define FFT_FLOAT 0 #define USE_FIXED 1 #include "ac3dec.h" #include "codec_internal.h" +#define IMDCT_TYPE AV_TX_INT32_MDCT +#include "ac3dec.h" static const int end_freq_inv_tab[8] = { @@ -171,7 +172,7 @@ const FFCodec ff_ac3_fixed_decoder = { .p.name = "ac3_fixed", - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + CODEC_LONG_NAME("ATSC A/52A (AC-3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AC3, .p.priv_class = &ac3_decoder_class, @@ -183,5 +184,5 @@ AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_float.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec_float.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ */ #include "config_components.h" +#define IMDCT_TYPE AV_TX_FLOAT_MDCT #include "ac3dec.h" #include "codec_internal.h" @@ -69,11 +70,11 @@ FF_CODEC_DECODE_CB(ac3_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + CODEC_LONG_NAME("ATSC A/52A (AC-3)"), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.priv_class = &ac3_eac3_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #if CONFIG_EAC3_DECODER @@ -87,10 +88,10 @@ FF_CODEC_DECODE_CB(ac3_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), + CODEC_LONG_NAME("ATSC A/52B (AC-3, E-AC-3)"), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.priv_class = &ac3_eac3_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dec.h 2023-03-03 13:29:59.000000000 +0000 @@ -50,6 +50,7 @@ #ifndef AVCODEC_AC3DEC_H #define AVCODEC_AC3DEC_H +#include "libavutil/tx.h" #include "libavutil/float_dsp.h" #include "libavutil/fixed_dsp.h" #include "libavutil/lfg.h" @@ -57,9 +58,9 @@ #include "ac3.h" #include "ac3dsp.h" +#include "avcodec.h" #include "bswapdsp.h" #include "get_bits.h" -#include "fft.h" #include "fmtconvert.h" #define AC3_OUTPUT_LFEON 8 @@ -222,8 +223,8 @@ ///@name IMDCT int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags (blksw) - FFTContext imdct_512; ///< for 512 sample IMDCT - FFTContext imdct_256; ///< for 256 sample IMDCT + AVTXContext *tx_128, *tx_256; + av_tx_fn tx_fn_128, tx_fn_256; ///@} ///@name Optimization diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -374,7 +374,7 @@ ac3_downmix_c(samples, matrix, out_ch, in_ch, len); } -av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) +av_cold void ff_ac3dsp_init(AC3DSPContext *c) { c->ac3_exponent_min = ac3_exponent_min_c; c->float_to_fixed24 = float_to_fixed24_c; @@ -390,10 +390,10 @@ c->downmix_fixed = NULL; #if ARCH_ARM - ff_ac3dsp_init_arm(c, bit_exact); + ff_ac3dsp_init_arm(c); #elif ARCH_X86 - ff_ac3dsp_init_x86(c, bit_exact); + ff_ac3dsp_init_x86(c); #elif ARCH_MIPS - ff_ac3dsp_init_mips(c, bit_exact); + ff_ac3dsp_init_mips(c); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -105,10 +105,10 @@ void (*downmix_fixed)(int32_t **samples, int16_t **matrix, int len); } AC3DSPContext; -void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact); -void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact); -void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact); -void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact); +void ff_ac3dsp_init (AC3DSPContext *c); +void ff_ac3dsp_init_arm(AC3DSPContext *c); +void ff_ac3dsp_init_x86(AC3DSPContext *c); +void ff_ac3dsp_init_mips(AC3DSPContext *c); void ff_ac3dsp_downmix(AC3DSPContext *c, float **samples, float **matrix, int out_ch, int in_ch, int len); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -41,7 +41,6 @@ #include "codec_internal.h" #include "config_components.h" #include "encode.h" -#include "internal.h" #include "me_cmp.h" #include "put_bits.h" #include "audiodsp.h" @@ -49,7 +48,6 @@ #include "ac3.h" #include "ac3defs.h" #include "ac3tab.h" -#include "fft.h" #include "ac3enc.h" #include "eac3enc.h" @@ -2204,7 +2202,7 @@ av_freep(&block->cpl_coord_mant); } - s->mdct_end(s); + av_tx_uninit(&s->tx); return 0; } @@ -2614,7 +2612,7 @@ ff_audiodsp_init(&s->adsp); ff_me_cmp_init(&s->mecc, avctx); - ff_ac3dsp_init(&s->ac3dsp, avctx->flags & AV_CODEC_FLAG_BITEXACT); + ff_ac3dsp_init(&s->ac3dsp); dprint_options(s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,6 @@ */ #define AC3ENC_FLOAT 0 -#define FFT_FLOAT 0 #include "audiodsp.h" #include "ac3enc.h" #include "codec_internal.h" @@ -66,20 +65,8 @@ } } - #include "ac3enc_template.c" - -/** - * Finalize MDCT and free allocated memory. - * - * @param s AC-3 encoder private context - */ -static av_cold void ac3_fixed_mdct_end(AC3EncodeContext *s) -{ - ff_mdct_end(&s->mdct); -} - /** * Initialize MDCT tables. * @@ -89,6 +76,7 @@ static av_cold int ac3_fixed_mdct_init(AC3EncodeContext *s) { float fwin[AC3_BLOCK_SIZE]; + const float scale = -1.0f; int32_t *iwin = av_malloc_array(AC3_BLOCK_SIZE, sizeof(*iwin)); if (!iwin) @@ -104,7 +92,8 @@ if (!s->fdsp) return AVERROR(ENOMEM); - return ff_mdct_init(&s->mdct, 9, 0, -1.0); + return av_tx_init(&s->tx, &s->tx_fn, AV_TX_INT32_MDCT, 0, + AC3_BLOCK_SIZE, &scale, 0); } @@ -112,20 +101,18 @@ { AC3EncodeContext *s = avctx->priv_data; s->fixed_point = 1; - s->mdct_end = ac3_fixed_mdct_end; s->mdct_init = ac3_fixed_mdct_init; s->allocate_sample_buffers = allocate_sample_buffers; return ff_ac3_encode_init(avctx); } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_ac3_fixed_encoder = { .p.name = "ac3_fixed", - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + CODEC_LONG_NAME("ATSC A/52A (AC-3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AC3, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(AC3EncodeContext), .init = ac3_fixed_encode_init, FF_CODEC_ENCODE_CB(ff_ac3_fixed_encode_frame), @@ -133,12 +120,9 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, .p.priv_class = &ff_ac3enc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, }; -FF_ENABLE_DEPRECATION_WARNINGS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_float.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_float.c 2023-03-03 13:29:59.000000000 +0000 @@ -75,21 +75,8 @@ s->ac3dsp.sum_square_butterfly_float(sum, coef0, coef1, len); } - #include "ac3enc_template.c" - -/** - * Finalize MDCT and free allocated memory. - * - * @param s AC-3 encoder private context - */ -static av_cold void ac3_float_mdct_end(AC3EncodeContext *s) -{ - ff_mdct_end(&s->mdct); -} - - /** * Initialize MDCT tables. * @@ -98,6 +85,7 @@ */ static av_cold int ac3_float_mdct_init(AC3EncodeContext *s) { + const float scale = -2.0 / AC3_WINDOW_SIZE; float *window = av_malloc_array(AC3_BLOCK_SIZE, sizeof(*window)); if (!window) { av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n"); @@ -107,14 +95,14 @@ ff_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); s->mdct_window = window; - return ff_mdct_init(&s->mdct, 9, 0, -2.0 / AC3_WINDOW_SIZE); + return av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_MDCT, 0, + AC3_BLOCK_SIZE, &scale, 0); } av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx) { AC3EncodeContext *s = avctx->priv_data; - s->mdct_end = ac3_float_mdct_end; s->mdct_init = ac3_float_mdct_init; s->allocate_sample_buffers = allocate_sample_buffers; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); @@ -123,13 +111,12 @@ return ff_ac3_encode_init(avctx); } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_ac3_encoder = { .p.name = "ac3", - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + CODEC_LONG_NAME("ATSC A/52A (AC-3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AC3, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, FF_CODEC_ENCODE_CB(ff_ac3_float_encode_frame), @@ -138,11 +125,8 @@ AV_SAMPLE_FMT_NONE }, .p.priv_class = &ff_ac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; -FF_ENABLE_DEPRECATION_WARNINGS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,12 +31,13 @@ #include #include "libavutil/opt.h" +#include "libavutil/tx.h" + #include "ac3.h" #include "ac3defs.h" #include "ac3dsp.h" #include "avcodec.h" #include "codec_internal.h" -#include "fft.h" #include "mathops.h" #include "me_cmp.h" #include "put_bits.h" @@ -167,7 +168,8 @@ #endif MECmpContext mecc; AC3DSPContext ac3dsp; ///< AC-3 optimized functions - FFTContext mdct; ///< FFT context for MDCT calculation + AVTXContext *tx; ///< FFT context for MDCT calculation + av_tx_fn tx_fn; const SampleType *mdct_window; ///< MDCT window function array AC3Block blocks[AC3_MAX_BLOCKS]; ///< per-block info @@ -257,7 +259,6 @@ int warned_alternate_bitstream; /* fixed vs. float function pointers */ - void (*mdct_end)(struct AC3EncodeContext *s); int (*mdct_init)(struct AC3EncodeContext *s); /* fixed vs. float templated function pointers */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3enc_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -98,8 +98,8 @@ &input_samples[AC3_BLOCK_SIZE], s->mdct_window, AC3_BLOCK_SIZE); - s->mdct.mdct_calc(&s->mdct, block->mdct_coef[ch+1], - s->windowed_samples); + s->tx_fn(s->tx, block->mdct_coef[ch+1], + s->windowed_samples, sizeof(float)); } } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,8 +38,6 @@ #if USE_FIXED -#define FFT_FLOAT 0 - #define FIXR(a) ((int)((a) * 0 + 0.5)) #define FIXR12(a) ((int)((a) * 4096 + 0.5)) #define FIXR15(a) ((int)((a) * 32768 + 0.5)) @@ -55,6 +53,7 @@ #define AC3_DYNAMIC_RANGE1 0 typedef int INTFLOAT; +typedef unsigned int UINTFLOAT; typedef int16_t SHORTFLOAT; #else /* USE_FIXED */ @@ -75,6 +74,7 @@ #define AC3_DYNAMIC_RANGE1 1.0f typedef float INTFLOAT; +typedef float UINTFLOAT; typedef float SHORTFLOAT; #endif /* USE_FIXED */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -53,6 +53,25 @@ */ static const uint8_t surround_levels[4] = { 4, 6, 7, 6 }; +int ff_ac3_find_syncword(const uint8_t *buf, int buf_size) +{ + int i; + + for (i = 1; i < buf_size; i += 2) { + if (buf[i] == 0x77 || buf[i] == 0x0B) { + if ((buf[i] ^ buf[i-1]) == (0x77 ^ 0x0B)) { + i--; + break; + } else if ((buf[i] ^ buf[i+1]) == (0x77 ^ 0x0B)) { + break; + } + } + } + if (i >= buf_size) + return AVERROR_INVALIDDATA; + + return i; +} int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) { @@ -196,8 +215,7 @@ return 0; } -static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info, - int *need_next_header, int *new_frame_start) +static int ac3_sync(uint64_t state, int *need_next_header, int *new_frame_start) { int err; union { @@ -219,19 +237,6 @@ if(err < 0) return 0; - hdr_info->sample_rate = hdr.sample_rate; - hdr_info->bit_rate = hdr.bit_rate; - hdr_info->channels = hdr.channels; - hdr_info->channel_layout = hdr.channel_layout; - hdr_info->samples = hdr.num_blocks * 256; - hdr_info->service_type = hdr.bitstream_mode; - if (hdr.bitstream_mode == 0x7 && hdr.channels > 1) - hdr_info->service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE; - if(hdr.bitstream_id>10) - hdr_info->codec_id = AV_CODEC_ID_EAC3; - else if (hdr_info->codec_id == AV_CODEC_ID_NONE) - hdr_info->codec_id = AV_CODEC_ID_AC3; - *new_frame_start = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT); *need_next_header = *new_frame_start || (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT); return hdr.frame_size; @@ -241,6 +246,7 @@ { AACAC3ParseContext *s = s1->priv_data; s->header_size = AC3_HEADER_SIZE; + s->crc_ctx = av_crc_get_table(AV_CRC_16_ANSI); s->sync = ac3_sync; return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ac3_parser_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -79,4 +79,6 @@ int avpriv_ac3_parse_header(AC3HeaderInfo **hdr, const uint8_t *buf, size_t size); +int ff_ac3_find_syncword(const uint8_t *buf, int buf_size); + #endif /* AVCODEC_AC3_PARSER_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_filters.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_filters.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_filters.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_filters.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include +#include #include "config.h" #include "libavutil/avassert.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_pitch_delay.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_pitch_delay.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_pitch_delay.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_pitch_delay.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,8 +23,6 @@ #include "libavutil/common.h" #include "libavutil/ffmath.h" #include "libavutil/float_dsp.h" -#include "libavutil/mathematics.h" -#include "avcodec.h" #include "acelp_pitch_delay.h" #include "celp_math.h" #include "audiodsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_vectors.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_vectors.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_vectors.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/acelp_vectors.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,12 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include +#include "config.h" #include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/float_dsp.h" -#include "avcodec.h" #include "acelp_vectors.h" const uint8_t ff_fc_2pulses_9bits_track1_gray[16] = diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcm.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,7 +43,7 @@ #include "adpcm.h" #include "adpcm_data.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" /** * @file @@ -324,6 +324,7 @@ case AV_CODEC_ID_ADPCM_IMA_WAV: case AV_CODEC_ID_ADPCM_4XM: case AV_CODEC_ID_ADPCM_XA: + case AV_CODEC_ID_ADPCM_XMD: case AV_CODEC_ID_ADPCM_EA_R1: case AV_CODEC_ID_ADPCM_EA_R2: case AV_CODEC_ID_ADPCM_EA_R3: @@ -1043,6 +1044,9 @@ case AV_CODEC_ID_ADPCM_XA: nb_samples = (buf_size / 128) * 224 / ch; break; + case AV_CODEC_ID_ADPCM_XMD: + nb_samples = buf_size / (21 * ch) * 32; + break; case AV_CODEC_ID_ADPCM_DTK: case AV_CODEC_ID_ADPCM_PSX: nb_samples = buf_size / (16 * ch) * 28; @@ -1553,6 +1557,45 @@ } bytestream2_seek(&gb, 0, SEEK_END); ) /* End of CASE */ + CASE(ADPCM_XMD, + int bytes_remaining, block = 0; + while (bytestream2_get_bytes_left(&gb) >= 21 * channels) { + for (int channel = 0; channel < channels; channel++) { + int16_t *out = samples_p[channel] + block * 32; + int16_t history[2]; + uint16_t scale; + + history[1] = sign_extend(bytestream2_get_le16(&gb), 16); + history[0] = sign_extend(bytestream2_get_le16(&gb), 16); + scale = bytestream2_get_le16(&gb); + + out[0] = history[1]; + out[1] = history[0]; + + for (int n = 0; n < 15; n++) { + unsigned byte = bytestream2_get_byte(&gb); + int32_t nibble[2]; + + nibble[0] = sign_extend(byte & 15, 4); + nibble[1] = sign_extend(byte >> 4, 4); + + out[2+n*2] = (nibble[0]*(scale<<14) + (history[0]*29336) - (history[1]*13136)) >> 14; + history[1] = history[0]; + history[0] = out[2+n*2]; + + out[2+n*2+1] = (nibble[1]*(scale<<14) + (history[0]*29336) - (history[1]*13136)) >> 14; + history[1] = history[0]; + history[0] = out[2+n*2+1]; + } + } + + block++; + } + bytes_remaining = bytestream2_get_bytes_left(&gb); + if (bytes_remaining > 0) { + bytestream2_skip(&gb, bytes_remaining); + } + ) /* End of CASE */ CASE(ADPCM_XA, int16_t *out0 = samples_p[0]; int16_t *out1 = samples_p[1]; @@ -2287,7 +2330,7 @@ #define ADPCM_DECODER_1(id_, sample_fmts_, name_, long_name_) \ const FFCodec ff_ ## name_ ## _decoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = id_, \ .p.capabilities = AV_CODEC_CAP_DR1, \ @@ -2296,7 +2339,6 @@ .init = adpcm_decode_init, \ FF_CODEC_DECODE_CB(adpcm_decode_frame), \ .flush = adpcm_flush, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; #define ADPCM_DECODER_2(enabled, codec_id, name, sample_fmts, long_name) \ ADPCM_DECODER_ ## enabled(codec_id, name, sample_fmts, long_name) @@ -2351,5 +2393,6 @@ ADPCM_DECODER(ADPCM_THP_LE, sample_fmts_s16p, adpcm_thp_le, "ADPCM Nintendo THP (little-endian)") ADPCM_DECODER(ADPCM_THP, sample_fmts_s16p, adpcm_thp, "ADPCM Nintendo THP") ADPCM_DECODER(ADPCM_XA, sample_fmts_s16p, adpcm_xa, "ADPCM CDROM XA") +ADPCM_DECODER(ADPCM_XMD, sample_fmts_s16p, adpcm_xmd, "ADPCM Konami XMD") ADPCM_DECODER(ADPCM_YAMAHA, sample_fmts_s16, adpcm_yamaha, "ADPCM Yamaha") ADPCM_DECODER(ADPCM_ZORK, sample_fmts_s16, adpcm_zork, "ADPCM Zork") diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adpcmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -601,20 +601,20 @@ { int st, pkt_size, ret; const int16_t *samples; - int16_t **samples_p; + const int16_t *const *samples_p; uint8_t *dst; ADPCMEncodeContext *c = avctx->priv_data; int channels = avctx->ch_layout.nb_channels; samples = (const int16_t *)frame->data[0]; - samples_p = (int16_t **)frame->extended_data; + samples_p = (const int16_t *const *)frame->extended_data; st = channels == 2; if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_SSI || avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_ALP || avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_APM || avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_WS) - pkt_size = (frame->nb_samples * channels) / 2; + pkt_size = (frame->nb_samples * channels + 1) / 2; else pkt_size = avctx->block_align; if ((ret = ff_get_encode_buffer(avctx, avpkt, pkt_size, 0)) < 0) @@ -998,18 +998,19 @@ #define ADPCM_ENCODER_1(id_, name_, sample_fmts_, capabilities_, long_name_) \ const FFCodec ff_ ## name_ ## _encoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = id_, \ .p.sample_fmts = sample_fmts_, \ .p.ch_layouts = ch_layouts, \ - .p.capabilities = capabilities_ | AV_CODEC_CAP_DR1, \ + .p.capabilities = capabilities_ | AV_CODEC_CAP_DR1 | \ + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, \ .p.priv_class = &adpcm_encoder_class, \ .priv_data_size = sizeof(ADPCMEncodeContext), \ .init = adpcm_encode_init, \ FF_CODEC_ENCODE_CB(adpcm_encode_frame), \ .close = adpcm_encode_close, \ - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \ + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ }; #define ADPCM_ENCODER_2(enabled, codec_id, name, sample_fmts, capabilities, long_name) \ ADPCM_ENCODER_ ## enabled(codec_id, name, sample_fmts, capabilities, long_name) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_header.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_header.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_header.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_header.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,8 @@ int size, rdb, ch, sr; int aot, crc_abs; + memset(hdr, 0, sizeof(*hdr)); + if (get_bits(gbc, 12) != 0xfff) return AAC_AC3_PARSE_ERROR_SYNC; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adts_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,24 +47,30 @@ { #if CONFIG_ADTS_HEADER int ret = 0; + int allocated = 0; GetBitContext gb; if (!phdr || !buf || size < AV_AAC_ADTS_HEADER_SIZE) return AVERROR_INVALIDDATA; - *phdr = av_mallocz(sizeof(AACADTSHeaderInfo)); + if (!*phdr) { + allocated = 1; + *phdr = av_mallocz(sizeof(AACADTSHeaderInfo)); + } if (!*phdr) return AVERROR(ENOMEM); ret = init_get_bits8(&gb, buf, AV_AAC_ADTS_HEADER_SIZE); if (ret < 0) { - av_freep(phdr); + if (allocated) + av_freep(phdr); return ret; } ret = ff_adts_header_parse(&gb, *phdr); if (ret < 0) { - av_freep(phdr); + if (allocated) + av_freep(phdr); return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,7 +19,6 @@ */ #include "libavutil/common.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "adx.h" @@ -34,55 +33,3 @@ coeff[0] = lrintf(c * 2.0 * (1 << bits)); coeff[1] = lrintf(-(c * c) * (1 << bits)); } - -int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, - int bufsize, int *header_size, int *coeff) -{ - int offset, cutoff, channels; - - if (bufsize < 24) - return AVERROR_INVALIDDATA; - - if (AV_RB16(buf) != 0x8000) - return AVERROR_INVALIDDATA; - offset = AV_RB16(buf + 2) + 4; - - /* if copyright string is within the provided data, validate it */ - if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6)) - return AVERROR_INVALIDDATA; - - /* check for encoding=3 block_size=18, sample_size=4 */ - if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) { - avpriv_request_sample(avctx, "Support for this ADX format"); - return AVERROR_PATCHWELCOME; - } - - /* channels */ - channels = buf[7]; - if (channels <= 0 || channels > 2) - return AVERROR_INVALIDDATA; - - if (avctx->ch_layout.nb_channels != channels) { - av_channel_layout_uninit(&avctx->ch_layout); - avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avctx->ch_layout.nb_channels = channels; - } - - /* sample rate */ - avctx->sample_rate = AV_RB32(buf + 8); - if (avctx->sample_rate < 1 || - avctx->sample_rate > INT_MAX / (channels * BLOCK_SIZE * 8)) - return AVERROR_INVALIDDATA; - - /* bit rate */ - avctx->bit_rate = avctx->sample_rate * channels * BLOCK_SIZE * 8 / BLOCK_SAMPLES; - - /* LPC coefficients */ - if (coeff) { - cutoff = AV_RB16(buf + 16); - ff_adx_calculate_coeffs(cutoff, avctx->sample_rate, COEFF_BITS, coeff); - } - - *header_size = offset; - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,8 +23,8 @@ #include "avcodec.h" #include "adx.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" /** * @file @@ -35,15 +35,78 @@ * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/ */ +/** + * Decode ADX stream header. + * Sets avctx->channels and avctx->sample_rate. + * + * @param avctx codec context + * @param buf header data + * @param bufsize data size, should be at least 24 bytes + * @param[out] header_size size of ADX header + * @param[out] coeff 2 LPC coefficients, can be NULL + * @return data offset or negative error code if header is invalid + */ +static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, + int bufsize, int *header_size, int *coeff) +{ + int offset, cutoff, channels; + + if (bufsize < 24) + return AVERROR_INVALIDDATA; + + if (AV_RB16(buf) != 0x8000) + return AVERROR_INVALIDDATA; + offset = AV_RB16(buf + 2) + 4; + + /* if copyright string is within the provided data, validate it */ + if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6)) + return AVERROR_INVALIDDATA; + + /* check for encoding=3 block_size=18, sample_size=4 */ + if (buf[4] != 3 || buf[5] != 18 || buf[6] != 4) { + avpriv_request_sample(avctx, "Support for this ADX format"); + return AVERROR_PATCHWELCOME; + } + + /* channels */ + channels = buf[7]; + if (channels <= 0 || channels > 2) + return AVERROR_INVALIDDATA; + + if (avctx->ch_layout.nb_channels != channels) { + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + avctx->ch_layout.nb_channels = channels; + } + + /* sample rate */ + avctx->sample_rate = AV_RB32(buf + 8); + if (avctx->sample_rate < 1 || + avctx->sample_rate > INT_MAX / (channels * BLOCK_SIZE * 8)) + return AVERROR_INVALIDDATA; + + /* bit rate */ + avctx->bit_rate = avctx->sample_rate * channels * BLOCK_SIZE * 8 / BLOCK_SAMPLES; + + /* LPC coefficients */ + if (coeff) { + cutoff = AV_RB16(buf + 16); + ff_adx_calculate_coeffs(cutoff, avctx->sample_rate, COEFF_BITS, coeff); + } + + *header_size = offset; + return 0; +} + static av_cold int adx_decode_init(AVCodecContext *avctx) { ADXContext *c = avctx->priv_data; int ret, header_size; if (avctx->extradata_size >= 24) { - if ((ret = ff_adx_decode_header(avctx, avctx->extradata, - avctx->extradata_size, &header_size, - c->coeff)) < 0) { + if ((ret = adx_decode_header(avctx, avctx->extradata, + avctx->extradata_size, &header_size, + c->coeff)) < 0) { av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n"); return AVERROR_INVALIDDATA; } @@ -110,9 +173,9 @@ &new_extradata_size); if (new_extradata && new_extradata_size > 0) { int header_size; - if ((ret = ff_adx_decode_header(avctx, new_extradata, - new_extradata_size, &header_size, - c->coeff)) < 0) { + if ((ret = adx_decode_header(avctx, new_extradata, + new_extradata_size, &header_size, + c->coeff)) < 0) { av_log(avctx, AV_LOG_ERROR, "error parsing new ADX extradata\n"); return AVERROR_INVALIDDATA; } @@ -127,8 +190,8 @@ if (!c->header_parsed && buf_size >= 2 && AV_RB16(buf) == 0x8000) { int header_size; - if ((ret = ff_adx_decode_header(avctx, buf, buf_size, &header_size, - c->coeff)) < 0) { + if ((ret = adx_decode_header(avctx, buf, buf_size, &header_size, + c->coeff)) < 0) { av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n"); return AVERROR_INVALIDDATA; } @@ -192,7 +255,7 @@ const FFCodec ff_adpcm_adx_decoder = { .p.name = "adpcm_adx", - .p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), + CODEC_LONG_NAME("SEGA CRI ADX ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_ADX, .priv_data_size = sizeof(ADXContext), @@ -203,5 +266,4 @@ AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -183,22 +183,21 @@ dst += BLOCK_SIZE; } - avpkt->pts = frame->pts; - avpkt->duration = frame->nb_samples; *got_packet_ptr = 1; return 0; } const FFCodec ff_adpcm_adx_encoder = { .p.name = "adpcm_adx", - .p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), + CODEC_LONG_NAME("SEGA CRI ADX ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_ADX, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(ADXContext), .init = adx_encode_init, FF_CODEC_ENCODE_CB(adx_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_EOF_FLUSH, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/adx.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,10 +31,6 @@ #ifndef AVCODEC_ADX_H #define AVCODEC_ADX_H -#include - -#include "avcodec.h" - typedef struct ADXChannelState { int s1,s2; } ADXChannelState; @@ -63,18 +59,4 @@ */ void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff); -/** - * Decode ADX stream header. - * Sets avctx->channels and avctx->sample_rate. - * - * @param avctx codec context - * @param buf header data - * @param bufsize data size, should be at least 24 bytes - * @param[out] header_size size of ADX header - * @param[out] coeff 2 LPC coefficients, can be NULL - * @return data offset or negative error code if header is invalid - */ -int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, - int bufsize, int *header_size, int *coeff); - #endif /* AVCODEC_ADX_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/agm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/agm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/agm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/agm.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include #define BITSTREAM_READER_LE @@ -32,27 +30,10 @@ #include "bytestream.h" #include "codec_internal.h" #include "copy_block.h" +#include "decode.h" #include "get_bits.h" #include "idctdsp.h" -#include "internal.h" - -static const uint8_t unscaled_luma[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, - 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, - 68,109,103, 77, 24, 35, 55, 64, 81,104,113, 92, - 49, 64, 78, 87,103,121,120,101, 72, 92, 95, 98, - 112,100,103,99 -}; - -static const uint8_t unscaled_chroma[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, - 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99 -}; +#include "jpegquanttables.h" typedef struct MotionVector { int16_t x, y; @@ -90,7 +71,7 @@ int luma_quant_matrix[64]; int chroma_quant_matrix[64]; - ScanTable scantable; + uint8_t permutated_scantable[64]; DECLARE_ALIGNED(32, int16_t, block)[64]; int16_t *wblocks; @@ -197,7 +178,7 @@ static int decode_intra_blocks(AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *dc_level) { - const uint8_t *scantable = s->scantable.permutated; + const uint8_t *scantable = s->permutated_scantable; int level, ret, map = 0; memset(s->wblocks, 0, s->wblocks_size); @@ -239,7 +220,7 @@ const int *quant_matrix, int *skip, int *map) { - const uint8_t *scantable = s->scantable.permutated; + const uint8_t *scantable = s->permutated_scantable; int level, ret; memset(s->wblocks, 0, s->wblocks_size); @@ -274,7 +255,7 @@ static int decode_intra_block(AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *dc_level) { - const uint8_t *scantable = s->scantable.permutated; + const uint8_t *scantable = s->permutated_scantable; const int offset = s->plus ? 0 : 1024; int16_t *block = s->block; int level, ret, map = 0; @@ -364,7 +345,7 @@ const int *quant_matrix, int *skip, int *map) { - const uint8_t *scantable = s->scantable.permutated; + const uint8_t *scantable = s->permutated_scantable; int16_t *block = s->block; int level, ret; @@ -552,13 +533,13 @@ } else { if (qscale >= 0.0) { for (int i = 0; i < 64; i++) { - luma[i] = FFMAX(1, unscaled_luma [(i & 7) * 8 + (i >> 3)] * f); - chroma[i] = FFMAX(1, unscaled_chroma[(i & 7) * 8 + (i >> 3)] * f); + luma[i] = FFMAX(1, ff_mjpeg_std_luminance_quant_tbl [(i & 7) * 8 + (i >> 3)] * f); + chroma[i] = FFMAX(1, ff_mjpeg_std_chrominance_quant_tbl[(i & 7) * 8 + (i >> 3)] * f); } } else { for (int i = 0; i < 64; i++) { - luma[i] = FFMAX(1, 255.0 - (255 - unscaled_luma [(i & 7) * 8 + (i >> 3)]) * f); - chroma[i] = FFMAX(1, 255.0 - (255 - unscaled_chroma[(i & 7) * 8 + (i >> 3)]) * f); + luma[i] = FFMAX(1, 255.0 - (255 - ff_mjpeg_std_luminance_quant_tbl [(i & 7) * 8 + (i >> 3)]) * f); + chroma[i] = FFMAX(1, 255.0 - (255 - ff_mjpeg_std_chrominance_quant_tbl[(i & 7) * 8 + (i >> 3)]) * f); } } } @@ -1251,7 +1232,8 @@ avctx->idct_algo = FF_IDCT_SIMPLE; ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable(s->idsp.idct_permutation, &s->scantable, ff_zigzag_direct); + ff_permute_scantable(s->permutated_scantable, ff_zigzag_direct, + s->idsp.idct_permutation); s->prev_frame = av_frame_alloc(); if (!s->prev_frame) @@ -1287,7 +1269,7 @@ const FFCodec ff_agm_decoder = { .p.name = "agm", - .p.long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"), + CODEC_LONG_NAME("Amuse Graphics Movie"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AGM, .p.capabilities = AV_CODEC_CAP_DR1, @@ -1296,7 +1278,6 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EXPORTS_CROPPING, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aic.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aic.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aic.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aic.c 2023-03-03 13:29:59.000000000 +0000 @@ -143,7 +143,6 @@ AVCodecContext *avctx; AVFrame *frame; IDCTDSPContext idsp; - ScanTable scantable; int num_x_slices; int slice_width; @@ -348,10 +347,10 @@ for (mb = 0; mb < slice_width; mb++) { for (blk = 0; blk < 4; blk++) { if (!ctx->interlaced) - recombine_block(ctx->block, ctx->scantable.permutated, + recombine_block(ctx->block, ctx->idsp.idct_permutation, &base_y, &ext_y); else - recombine_block_il(ctx->block, ctx->scantable.permutated, + recombine_block_il(ctx->block, ctx->idsp.idct_permutation, &base_y, &ext_y, blk); unquant_block(ctx->block, ctx->quant, ctx->quant_matrix); ctx->idsp.idct(ctx->block); @@ -368,7 +367,7 @@ Y += 16; for (blk = 0; blk < 2; blk++) { - recombine_block(ctx->block, ctx->scantable.permutated, + recombine_block(ctx->block, ctx->idsp.idct_permutation, &base_c, &ext_c); unquant_block(ctx->block, ctx->quant, ctx->quant_matrix); ctx->idsp.idct(ctx->block); @@ -444,7 +443,6 @@ { AICContext *ctx = avctx->priv_data; int i; - uint8_t scan[64]; ctx->avctx = avctx; @@ -453,9 +451,6 @@ ff_idctdsp_init(&ctx->idsp, avctx); for (i = 0; i < 64; i++) - scan[i] = i; - ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable, scan); - for (i = 0; i < 64; i++) ctx->quant_matrix[ctx->idsp.idct_permutation[i]] = aic_quant_matrix[i]; ctx->mb_width = FFALIGN(avctx->width, 16) >> 4; @@ -497,7 +492,7 @@ const FFCodec ff_aic_decoder = { .p.name = "aic", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"), + CODEC_LONG_NAME("Apple Intermediate Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AIC, .priv_data_size = sizeof(AICContext), @@ -505,5 +500,4 @@ .close = aic_decode_close, FF_CODEC_DECODE_CB(aic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alac.c 2023-03-03 13:29:59.000000000 +0000 @@ -614,7 +614,7 @@ const FFCodec ff_alac_decoder = { .p.name = "alac", - .p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), + CODEC_LONG_NAME("ALAC (Apple Lossless Audio Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ALAC, .priv_data_size = sizeof(ALACContext), @@ -622,6 +622,6 @@ .close = alac_decode_close, FF_CODEC_DECODE_CB(alac_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &alac_class }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,7 +58,9 @@ c->append_extra_bits[0] = c->append_extra_bits[1] = append_extra_bits; -#if ARCH_X86 +#if ARCH_RISCV + ff_alacdsp_init_riscv(c); +#elif ARCH_X86 ff_alacdsp_init_x86(c); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ } ALACDSPContext; void ff_alacdsp_init(ALACDSPContext *c); +void ff_alacdsp_init_riscv(ALACDSPContext *c); void ff_alacdsp_init_x86(ALACDSPContext *c); #endif /* AVCODEC_ALACDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alacenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -648,25 +648,21 @@ .version = LIBAVUTIL_VERSION_INT, }; -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_alac_encoder = { .p.name = "alac", - .p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), + CODEC_LONG_NAME("ALAC (Apple Lossless Audio Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ALAC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(AlacEncodeContext), .p.priv_class = &alacenc_class, .init = alac_encode_init, FF_CODEC_ENCODE_CB(alac_encode_frame), .close = alac_encode_close, - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = alac_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(alac_channel_layouts) .p.ch_layouts = ff_alac_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -FF_ENABLE_DEPRECATION_WARNINGS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define ALIAS_HEADER_SIZE 10 @@ -123,7 +123,7 @@ const FFCodec ff_alias_pix_decoder = { .p.name = "alias_pix", - .p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), + CODEC_LONG_NAME("Alias/Wavefront PIX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ALIAS_PIX, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aliaspixenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -103,9 +103,10 @@ const FFCodec ff_alias_pix_encoder = { .p.name = "alias_pix", - .p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), + CODEC_LONG_NAME("Alias/Wavefront PIX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ALIAS_PIX, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/allcodecs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/allcodecs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/allcodecs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/allcodecs.c 2023-03-03 13:29:59.000000000 +0000 @@ -61,8 +61,10 @@ extern const FFCodec ff_avs_decoder; extern const FFCodec ff_avui_encoder; extern const FFCodec ff_avui_decoder; +#if FF_API_AYUV_CODECID extern const FFCodec ff_ayuv_encoder; extern const FFCodec ff_ayuv_decoder; +#endif extern const FFCodec ff_bethsoftvid_decoder; extern const FFCodec ff_bfi_decoder; extern const FFCodec ff_bink_decoder; @@ -152,6 +154,7 @@ extern const FFCodec ff_h264_crystalhd_decoder; extern const FFCodec ff_h264_v4l2m2m_decoder; extern const FFCodec ff_h264_mediacodec_decoder; +extern const FFCodec ff_h264_mediacodec_encoder; extern const FFCodec ff_h264_mmal_decoder; extern const FFCodec ff_h264_qsv_decoder; extern const FFCodec ff_h264_rkmpp_decoder; @@ -192,6 +195,7 @@ extern const FFCodec ff_magicyuv_encoder; extern const FFCodec ff_magicyuv_decoder; extern const FFCodec ff_mdec_decoder; +extern const FFCodec ff_media100_decoder; extern const FFCodec ff_mimic_decoder; extern const FFCodec ff_mjpeg_encoder; extern const FFCodec ff_mjpeg_decoder; @@ -283,6 +287,7 @@ extern const FFCodec ff_rasc_decoder; extern const FFCodec ff_rawvideo_encoder; extern const FFCodec ff_rawvideo_decoder; +extern const FFCodec ff_rka_decoder; extern const FFCodec ff_rl2_decoder; extern const FFCodec ff_roq_encoder; extern const FFCodec ff_roq_decoder; @@ -378,6 +383,9 @@ extern const FFCodec ff_vp9_rkmpp_decoder; extern const FFCodec ff_vp9_v4l2m2m_decoder; extern const FFCodec ff_vqa_decoder; +extern const FFCodec ff_vqc_decoder; +extern const FFCodec ff_wbmp_decoder; +extern const FFCodec ff_wbmp_encoder; extern const FFCodec ff_webp_decoder; extern const FFCodec ff_wcmv_decoder; extern const FFCodec ff_wrapped_avframe_encoder; @@ -428,6 +436,7 @@ extern const FFCodec ff_als_decoder; extern const FFCodec ff_amrnb_decoder; extern const FFCodec ff_amrwb_decoder; +extern const FFCodec ff_apac_decoder; extern const FFCodec ff_ape_decoder; extern const FFCodec ff_aptx_encoder; extern const FFCodec ff_aptx_decoder; @@ -442,6 +451,7 @@ extern const FFCodec ff_binkaudio_dct_decoder; extern const FFCodec ff_binkaudio_rdft_decoder; extern const FFCodec ff_bmv_audio_decoder; +extern const FFCodec ff_bonk_decoder; extern const FFCodec ff_cook_decoder; extern const FFCodec ff_dca_encoder; extern const FFCodec ff_dca_decoder; @@ -462,6 +472,7 @@ extern const FFCodec ff_ffwavesynth_decoder; extern const FFCodec ff_flac_encoder; extern const FFCodec ff_flac_decoder; +extern const FFCodec ff_ftr_decoder; extern const FFCodec ff_g723_1_encoder; extern const FFCodec ff_g723_1_decoder; extern const FFCodec ff_g729_decoder; @@ -469,6 +480,8 @@ extern const FFCodec ff_gsm_ms_decoder; extern const FFCodec ff_hca_decoder; extern const FFCodec ff_hcom_decoder; +extern const FFCodec ff_hdr_encoder; +extern const FFCodec ff_hdr_decoder; extern const FFCodec ff_iac_decoder; extern const FFCodec ff_ilbc_decoder; extern const FFCodec ff_imc_decoder; @@ -476,6 +489,7 @@ extern const FFCodec ff_mace3_decoder; extern const FFCodec ff_mace6_decoder; extern const FFCodec ff_metasound_decoder; +extern const FFCodec ff_misc4_decoder; extern const FFCodec ff_mlp_encoder; extern const FFCodec ff_mlp_decoder; extern const FFCodec ff_mp1_decoder; @@ -525,6 +539,7 @@ extern const FFCodec ff_vmdaudio_decoder; extern const FFCodec ff_vorbis_encoder; extern const FFCodec ff_vorbis_decoder; +extern const FFCodec ff_wavarc_decoder; extern const FFCodec ff_wavpack_encoder; extern const FFCodec ff_wavpack_decoder; extern const FFCodec ff_wmalossless_decoder; @@ -607,6 +622,7 @@ extern const FFCodec ff_pcm_vidc_decoder; /* DPCM codecs */ +extern const FFCodec ff_cbd2_dpcm_decoder; extern const FFCodec ff_derf_dpcm_decoder; extern const FFCodec ff_gremlin_dpcm_decoder; extern const FFCodec ff_interplay_dpcm_decoder; @@ -615,6 +631,7 @@ extern const FFCodec ff_sdx2_dpcm_decoder; extern const FFCodec ff_sol_dpcm_decoder; extern const FFCodec ff_xan_dpcm_decoder; +extern const FFCodec ff_wady_dpcm_decoder; /* ADPCM codecs */ extern const FFCodec ff_adpcm_4xm_decoder; @@ -680,6 +697,7 @@ extern const FFCodec ff_adpcm_thp_le_decoder; extern const FFCodec ff_adpcm_vima_decoder; extern const FFCodec ff_adpcm_xa_decoder; +extern const FFCodec ff_adpcm_xmd_decoder; extern const FFCodec ff_adpcm_yamaha_encoder; extern const FFCodec ff_adpcm_yamaha_decoder; extern const FFCodec ff_adpcm_zork_decoder; @@ -815,7 +833,11 @@ /* hwaccel hooks only, so prefer external decoders */ extern const FFCodec ff_av1_decoder; extern const FFCodec ff_av1_cuvid_decoder; +extern const FFCodec ff_av1_mediacodec_decoder; +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_libopenh264_encoder; extern const FFCodec ff_libopenh264_decoder; extern const FFCodec ff_h264_amf_encoder; @@ -830,6 +852,7 @@ extern const FFCodec ff_hevc_amf_encoder; extern const FFCodec ff_hevc_cuvid_decoder; extern const FFCodec ff_hevc_mediacodec_decoder; +extern const FFCodec ff_hevc_mediacodec_encoder; extern const FFCodec ff_hevc_mf_encoder; extern const FFCodec ff_hevc_nvenc_encoder; extern const FFCodec ff_hevc_qsv_encoder; @@ -863,6 +886,12 @@ extern const FFCodec ff_vp9_vaapi_encoder; extern const FFCodec ff_vp9_qsv_encoder; +// null codecs +extern const FFCodec ff_vnull_decoder; +extern const FFCodec ff_vnull_encoder; +extern const FFCodec ff_anull_decoder; +extern const FFCodec ff_anull_encoder; + // The iterate API is not usable with ossfuzz due to the excessive size of binaries created #if CONFIG_OSSFUZZ const FFCodec * codec_list[] = { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_alpha.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_alpha.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_alpha.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_alpha.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,8 @@ #include "libavcodec/me_cmp.h" #include "asm.h" -int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int pix_abs16x16_mvi_asm(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h); static inline uint64_t avg2(uint64_t a, uint64_t b) { @@ -44,7 +45,8 @@ return r1 + r2; } -static int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int pix_abs8x8_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; @@ -76,50 +78,8 @@ return result; } -#if 0 /* now done in assembly */ -int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size) -{ - int result = 0; - int h = 16; - - if ((size_t) pix2 & 0x7) { - /* works only when pix2 is actually unaligned */ - do { /* do 16 pixel a time */ - uint64_t p1_l, p1_r, p2_l, p2_r; - uint64_t t; - - p1_l = ldq(pix1); - p1_r = ldq(pix1 + 8); - t = ldq_u(pix2 + 8); - p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2); - p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2); - pix1 += line_size; - pix2 += line_size; - - result += perr(p1_l, p2_l) - + perr(p1_r, p2_r); - } while (--h); - } else { - do { - uint64_t p1_l, p1_r, p2_l, p2_r; - - p1_l = ldq(pix1); - p1_r = ldq(pix1 + 8); - p2_l = ldq(pix2); - p2_r = ldq(pix2 + 8); - pix1 += line_size; - pix2 += line_size; - - result += perr(p1_l, p2_l) - + perr(p1_r, p2_r); - } while (--h); - } - - return result; -} -#endif - -static int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_x2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; uint64_t disalign = (size_t) pix2 & 0x7; @@ -192,7 +152,8 @@ return result; } -static int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_y2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; @@ -245,7 +206,8 @@ return result; } -static int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_xy2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_mvi_asm.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_mvi_asm.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_mvi_asm.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alpha/me_cmp_mvi_asm.S 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ .text /***************************************************************************** - * int pix_abs16x16_mvi_asm(uint8_t *pix1, uint8_t *pix2, int line_size) + * int pix_abs16x16_mvi_asm(const uint8_t *pix1, const uint8_t *pix2, int line_size) * * This code is written with a pca56 in mind. For ev6, one should * really take the increased latency of 3 cycles for MVI instructions diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alsdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alsdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alsdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/alsdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,6 +34,7 @@ #include "bgmc.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "internal.h" #include "mlz.h" #include "libavutil/samplefmt.h" @@ -1027,7 +1028,7 @@ *bd->shift_lsbs = 0; - if (get_bits_left(gb) < 1) + if (get_bits_left(gb) < 7) return AVERROR_INVALIDDATA; // read block type flag and read the samples accordingly @@ -1659,7 +1660,8 @@ if (!sconf->mc_coding || ctx->js_switch) { int independent_bs = !sconf->joint_stereo; - + if (get_bits_left(gb) < 7*channels*ctx->num_blocks) + return AVERROR_INVALIDDATA; for (c = 0; c < channels; c++) { js_blocks[0] = 0; js_blocks[1] = 0; @@ -2180,7 +2182,7 @@ const FFCodec ff_als_decoder = { .p.name = "als", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"), + CODEC_LONG_NAME("MPEG-4 Audio Lossless Coding (ALS)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP4ALS, .priv_data_size = sizeof(ALSDecContext), @@ -2189,5 +2191,5 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_av1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_av1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_av1.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_av1.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,361 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/opt.h" +#include "amfenc.h" +#include "codec_internal.h" +#include "internal.h" + +#define OFFSET(x) offsetof(AmfContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "usage", "Set the encoding usage", OFFSET(usage), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING }, AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING, AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY, VE, "usage" }, + { "transcoding", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING }, 0, 0, VE, "usage" }, + { "lowlatency", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY }, 0, 0, VE, "usage" }, + + { "profile", "Set the profile (default main)", OFFSET(profile), AV_OPT_TYPE_INT,{.i64 = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN }, AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN, AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN, VE, "profile" }, + { "main", "", 0, AV_OPT_TYPE_CONST,{.i64 = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN }, 0, 0, VE, "profile" }, + + { "level", "Set the encoding level (default auto)", OFFSET(level), AV_OPT_TYPE_INT,{.i64 = 0 }, 0, AMF_VIDEO_ENCODER_AV1_LEVEL_7_3, VE, "level" }, + { "auto", "", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, VE, "level" }, + { "2.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_0 }, 0, 0, VE, "level" }, + { "2.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_1 }, 0, 0, VE, "level" }, + { "2.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_2 }, 0, 0, VE, "level" }, + { "2.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_3 }, 0, 0, VE, "level" }, + { "3.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_0 }, 0, 0, VE, "level" }, + { "3.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_1 }, 0, 0, VE, "level" }, + { "3.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_2 }, 0, 0, VE, "level" }, + { "3.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_3 }, 0, 0, VE, "level" }, + { "4.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_0 }, 0, 0, VE, "level" }, + { "4.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_1 }, 0, 0, VE, "level" }, + { "4.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_2 }, 0, 0, VE, "level" }, + { "4.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_3 }, 0, 0, VE, "level" }, + { "5.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_0 }, 0, 0, VE, "level" }, + { "5.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_1 }, 0, 0, VE, "level" }, + { "5.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_2 }, 0, 0, VE, "level" }, + { "5.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_3 }, 0, 0, VE, "level" }, + { "6.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_0 }, 0, 0, VE, "level" }, + { "6.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_1 }, 0, 0, VE, "level" }, + { "6.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_2 }, 0, 0, VE, "level" }, + { "6.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_3 }, 0, 0, VE, "level" }, + { "7.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_0 }, 0, 0, VE, "level" }, + { "7.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_1 }, 0, 0, VE, "level" }, + { "7.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_2 }, 0, 0, VE, "level" }, + { "7.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 }, 0, 0, VE, "level" }, + + { "quality", "Set the encoding quality", OFFSET(quality), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED }, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED, VE, "quality" }, + { "balanced", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_BALANCED }, 0, 0, VE, "quality" }, + { "speed", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED }, 0, 0, VE, "quality" }, + { "quality", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_QUALITY }, 0, 0, VE, "quality" }, + { "high_quality", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY }, 0, 0, VE, "quality" }, + + { "rc", "Set the rate control mode", OFFSET(rate_control_mode), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN }, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR, VE, "rc" }, + { "cqp", "Constant Quantization Parameter", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP }, 0, 0, VE, "rc" }, + { "vbr_latency", "Latency Constrained Variable Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR }, 0, 0, VE, "rc" }, + { "vbr_peak", "Peak Contrained Variable Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR }, 0, 0, VE, "rc" }, + { "cbr", "Constant Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR }, 0, 0, VE, "rc" }, + + { "header_insertion_mode", "Set header insertion mode", OFFSET(header_insertion_mode), AV_OPT_TYPE_INT,{.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED, VE, "hdrmode" }, + { "none", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, 0, 0, VE, "hdrmode" }, + { "gop", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_GOP_ALIGNED }, 0, 0, VE, "hdrmode" }, + { "frame", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED }, 0, 0, VE, "hdrmode" }, + + { "preanalysis", "Enable preanalysis", OFFSET(preanalysis), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE}, + { "enforce_hrd", "Enforce HRD", OFFSET(enforce_hrd), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE}, + { "filler_data", "Filler Data Enable", OFFSET(filler_data), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE}, + + // min_qp_i -> min_qp_intra, min_qp_p -> min_qp_inter + { "min_qp_i", "min quantization parameter for I-frame", OFFSET(min_qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "max_qp_i", "max quantization parameter for I-frame", OFFSET(max_qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "min_qp_p", "min quantization parameter for P-frame", OFFSET(min_qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "max_qp_p", "max quantization parameter for P-frame", OFFSET(max_qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "qp_p", "quantization parameter for P-frame", OFFSET(qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "qp_i", "quantization parameter for I-frame", OFFSET(qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE }, + { "skip_frame", "Rate Control Based Frame Skip", OFFSET(skip_frame), AV_OPT_TYPE_BOOL,{.i64 = 0 }, 0, 1, VE }, + + { "align", "alignment mode", OFFSET(align), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS }, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS, VE, "align" }, + { "64x16", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY }, 0, 0, VE, "align" }, + { "1080p", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082 }, 0, 0, VE, "align" }, + { "none", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS }, 0, 0, VE, "align" }, + + { NULL } + +}; + +static av_cold int amf_encode_init_av1(AVCodecContext* avctx) +{ + int ret = 0; + AMF_RESULT res = AMF_OK; + AmfContext* ctx = avctx->priv_data; + AMFVariantStruct var = { 0 }; + amf_int64 profile = 0; + amf_int64 profile_level = 0; + AMFBuffer* buffer; + AMFGuid guid; + AMFRate framerate; + AMFSize framesize = AMFConstructSize(avctx->width, avctx->height); + + + + if (avctx->framerate.num > 0 && avctx->framerate.den > 0) { + framerate = AMFConstructRate(avctx->framerate.num, avctx->framerate.den); + } + else { + framerate = AMFConstructRate(avctx->time_base.den, avctx->time_base.num * avctx->ticks_per_frame); + } + + if ((ret = ff_amf_encode_init(avctx)) < 0) + return ret; + + // init static parameters + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_USAGE, ctx->usage); + + AMF_ASSIGN_PROPERTY_SIZE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMESIZE, framesize); + + AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate); + + switch (avctx->profile) { + case FF_PROFILE_AV1_MAIN: + profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN; + break; + default: + break; + } + if (profile == 0) { + profile = ctx->profile; + } + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile); + + profile_level = avctx->level; + if (profile_level == FF_LEVEL_UNKNOWN) { + profile_level = ctx->level; + } + if (profile_level != 0) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_LEVEL, profile_level); + } + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET, ctx->quality); + + // Maximum Reference Frames + if (avctx->refs != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_NUM_REFRAMES, avctx->refs); + } + + // Picture control properties + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size); + + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE, ctx->header_insertion_mode); + + // Rate control + // autodetect rate control method + if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN) { + if (ctx->min_qp_i != -1 || ctx->max_qp_i != -1 || + ctx->min_qp_p != -1 || ctx->max_qp_p != -1 || + ctx->qp_i != -1 || ctx->qp_p != -1) { + ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP; + av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CQP\n"); + } + else if (avctx->rc_max_rate > 0) { + ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR; + av_log(ctx, AV_LOG_DEBUG, "Rate control turned to Peak VBR\n"); + } + else { + ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR; + av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CBR\n"); + } + } + + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD, ctx->rate_control_mode); + if (avctx->rc_buffer_size) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_VBV_BUFFER_SIZE, avctx->rc_buffer_size); + + if (avctx->rc_initial_buffer_occupancy != 0) { + int amf_buffer_fullness = avctx->rc_initial_buffer_occupancy * 64 / avctx->rc_buffer_size; + if (amf_buffer_fullness > 64) + amf_buffer_fullness = 64; + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_INITIAL_VBV_BUFFER_FULLNESS, amf_buffer_fullness); + } + } + + // Pre-Pass, Pre-Analysis, Two-Pass + AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PRE_ANALYSIS_ENABLE, ctx->preanalysis); + + // init dynamic rate control params + if (ctx->max_au_size) + ctx->enforce_hrd = 1; + AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_ENFORCE_HRD, ctx->enforce_hrd); + AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FILLER_DATA, ctx->filler_data); + + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_TARGET_BITRATE, avctx->bit_rate); + + if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE, avctx->bit_rate); + } + if (avctx->rc_max_rate) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE, avctx->rc_max_rate); + } + else if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR) { + av_log(ctx, AV_LOG_WARNING, "rate control mode is PEAK_CONSTRAINED_VBR but rc_max_rate is not set\n"); + } + if (avctx->bit_rate > 0) { + ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR; + av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CBR\n"); + } + + switch (ctx->align) + { + case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY: + if (avctx->width / 64 * 64 != avctx->width || avctx->height / 16 * 16 != avctx->height) + { + res = AMF_NOT_SUPPORTED; + av_log(ctx, AV_LOG_ERROR, "Resolution incorrect for alignment mode\n"); + return AVERROR_EXIT; + } + break; + case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082: + if ((avctx->width / 64 * 64 == avctx->width && avctx->height / 16 * 16 == avctx->height) || (avctx->width == 1920 && avctx->height == 1080)) + { + res = AMF_OK; + } + else + { + res = AMF_NOT_SUPPORTED; + av_log(ctx, AV_LOG_ERROR, "Resolution incorrect for alignment mode\n"); + return AVERROR_EXIT; + } + break; + case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS: + res = AMF_OK; + break; + default: + res = AMF_NOT_SUPPORTED; + av_log(ctx, AV_LOG_ERROR, "Invalid alignment mode\n"); + return AVERROR_EXIT; + } + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE, ctx->align); + + + // init encoder + res = ctx->encoder->pVtbl->Init(ctx->encoder, ctx->format, avctx->width, avctx->height); + AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "encoder->Init() failed with error %d\n", res); + + // init dynamic picture control params + if (ctx->min_qp_i != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA, ctx->min_qp_i); + } + else if (avctx->qmin != -1) { + int qval = avctx->qmin > 255 ? 255 : avctx->qmin; + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA, qval); + } + if (ctx->max_qp_i != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA, ctx->max_qp_i); + } + else if (avctx->qmax != -1) { + int qval = avctx->qmax > 255 ? 255 : avctx->qmax; + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA, qval); + } + if (ctx->min_qp_p != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER, ctx->min_qp_p); + } + else if (avctx->qmin != -1) { + int qval = avctx->qmin > 255 ? 255 : avctx->qmin; + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER, qval); + } + if (ctx->max_qp_p != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER, ctx->max_qp_p); + } + else if (avctx->qmax != -1) { + int qval = avctx->qmax > 255 ? 255 : avctx->qmax; + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER, qval); + } + + if (ctx->qp_p != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTER, ctx->qp_p); + } + if (ctx->qp_i != -1) { + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTRA, ctx->qp_i); + } + AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_SKIP_FRAME, ctx->skip_frame); + + + // fill extradata + res = AMFVariantInit(&var); + AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "AMFVariantInit() failed with error %d\n", res); + + res = ctx->encoder->pVtbl->GetProperty(ctx->encoder, AMF_VIDEO_ENCODER_AV1_EXTRA_DATA, &var); + AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "GetProperty(AMF_VIDEO_ENCODER_EXTRADATA) failed with error %d\n", res); + AMF_RETURN_IF_FALSE(ctx, var.pInterface != NULL, AVERROR_BUG, "GetProperty(AMF_VIDEO_ENCODER_EXTRADATA) returned NULL\n"); + + guid = IID_AMFBuffer(); + + res = var.pInterface->pVtbl->QueryInterface(var.pInterface, &guid, (void**)&buffer); // query for buffer interface + if (res != AMF_OK) { + var.pInterface->pVtbl->Release(var.pInterface); + } + AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "QueryInterface(IID_AMFBuffer) failed with error %d\n", res); + + avctx->extradata_size = (int)buffer->pVtbl->GetSize(buffer); + avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); + if (!avctx->extradata) { + buffer->pVtbl->Release(buffer); + var.pInterface->pVtbl->Release(var.pInterface); + return AVERROR(ENOMEM); + } + memcpy(avctx->extradata, buffer->pVtbl->GetNative(buffer), avctx->extradata_size); + + buffer->pVtbl->Release(buffer); + var.pInterface->pVtbl->Release(var.pInterface); + + return 0; +} + +static const FFCodecDefault defaults[] = { + { "refs", "-1" }, + { "aspect", "0" }, + { "b", "2M" }, + { "g", "250" }, + { "qmin", "-1" }, + { "qmax", "-1" }, + { NULL }, +}; + +static const AVClass av1_amf_class = { + .class_name = "av1_amf", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFCodec ff_av1_amf_encoder = { + .p.name = "av1_amf", + CODEC_LONG_NAME("AMD AMF AV1 encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .init = amf_encode_init_av1, + FF_CODEC_RECEIVE_PACKET_CB(ff_amf_receive_packet), + .close = ff_amf_encode_close, + .priv_data_size = sizeof(AmfContext), + .p.priv_class = &av1_amf_class, + .defaults = defaults, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.pix_fmts = ff_amf_pix_fmts, + .p.wrapper_name = "amf", + .hw_configs = ff_amfenc_hw_configs, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -349,6 +349,9 @@ case AV_CODEC_ID_HEVC: codec_id = AMFVideoEncoder_HEVC; break; + case AV_CODEC_ID_AV1 : + codec_id = AMFVideoEncoder_AV1; + break; default: break; } @@ -460,6 +463,11 @@ pkt->flags = AV_PKT_FLAG_KEY; } break; + case AV_CODEC_ID_AV1: + buffer->pVtbl->GetProperty(buffer, AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE, &var); + if (var.int64Value == AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_KEY) { + pkt->flags = AV_PKT_FLAG_KEY; + } default: break; } @@ -681,6 +689,7 @@ case AV_CODEC_ID_HEVC: AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_AUD, !!ctx->aud); break; + //case AV_CODEC_ID_AV1 not supported default: break; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include #include +#include #include "libavutil/fifo.h" @@ -116,6 +117,11 @@ int min_qp_p; int max_qp_p; int tier; + + // AV1 - specific options + + enum AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM align; + } AmfContext; extern const AVCodecHWConfigInternal *const ff_amfenc_hw_configs[]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_h264.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_h264.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_h264.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_h264.c 2023-03-03 13:29:59.000000000 +0000 @@ -380,7 +380,7 @@ const FFCodec ff_h264_amf_encoder = { .p.name = "h264_amf", - .p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF H.264 Encoder"), + CODEC_LONG_NAME("AMD AMF H.264 Encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .init = amf_encode_init_h264, @@ -391,7 +391,8 @@ .defaults = defaults, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = ff_amf_pix_fmts, .p.wrapper_name = "amf", .hw_configs = ff_amfenc_hw_configs, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amfenc_hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -312,7 +312,7 @@ const FFCodec ff_hevc_amf_encoder = { .p.name = "hevc_amf", - .p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF HEVC encoder"), + CODEC_LONG_NAME("AMD AMF HEVC encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .init = amf_encode_init_hevc, @@ -323,7 +323,8 @@ .defaults = defaults, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = ff_amf_pix_fmts, .p.wrapper_name = "amf", .hw_configs = ff_amfenc_hw_configs, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrnbdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrnbdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrnbdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrnbdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,6 @@ #include #include "libavutil/channel_layout.h" -#include "libavutil/float_dsp.h" #include "avcodec.h" #include "libavutil/common.h" #include "libavutil/avassert.h" @@ -56,7 +55,7 @@ #include "lsp.h" #include "amr.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "amrnbdata.h" @@ -1092,13 +1091,13 @@ *got_frame_ptr = 1; - return avpkt->size; + return buf - avpkt->data; } const FFCodec ff_amrnb_decoder = { .p.name = "amrnb", - .p.long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"), + CODEC_LONG_NAME("AMR-NB (Adaptive Multi-Rate NarrowBand)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRChannelsContext), @@ -1107,5 +1106,4 @@ .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_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrwbdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrwbdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrwbdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/amrwbdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,9 +24,10 @@ * AMR wideband decoder */ +#include "config.h" + #include "libavutil/channel_layout.h" #include "libavutil/common.h" -#include "libavutil/float_dsp.h" #include "libavutil/lfg.h" #include "avcodec.h" @@ -37,13 +38,15 @@ #include "acelp_vectors.h" #include "acelp_pitch_delay.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define AMR_USE_16BIT_TABLES #include "amr.h" #include "amrwbdata.h" +#if ARCH_MIPS #include "mips/amrwbdec_mips.h" +#endif /* ARCH_MIPS */ typedef struct AMRWBContext { AMRWBFrame frame; ///< AMRWB parameters decoded from bitstream @@ -1289,19 +1292,18 @@ *got_frame_ptr = 1; - return avpkt->size; + return buf - avpkt->data; } const FFCodec ff_amrwb_decoder = { .p.name = "amrwb", - .p.long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"), + CODEC_LONG_NAME("AMR-WB (Adaptive Multi-Rate WideBand)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_WB, .priv_data_size = sizeof(AMRWBChannelsContext), .init = amrwb_decode_init, FF_CODEC_DECODE_CB(amrwb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/anm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/anm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/anm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/anm.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct AnmContext { AVFrame *frame; @@ -191,7 +191,7 @@ const FFCodec ff_anm_decoder = { .p.name = "anm", - .p.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"), + CODEC_LONG_NAME("Deluxe Paint Animation"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ANM, .priv_data_size = sizeof(AnmContext), @@ -199,5 +199,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ansi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ansi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ansi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ansi.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,12 +26,11 @@ #include "libavutil/common.h" #include "libavutil/frame.h" -#include "libavutil/lfg.h" #include "libavutil/xga_font_data.h" #include "avcodec.h" #include "cga_data.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define ATTR_BOLD 0x01 /**< Bold/Bright-foreground (mode 1) */ #define ATTR_FAINT 0x02 /**< Faint (mode 2) */ @@ -365,7 +364,7 @@ if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; - if (!avctx->frame_number) { + if (!avctx->frame_num) { for (i=0; iheight; i++) memset(s->frame->data[0]+ i*s->frame->linesize[0], 0, avctx->width); memset(s->frame->data[1], 0, AVPALETTE_SIZE); @@ -482,7 +481,7 @@ const FFCodec ff_ansi_decoder = { .p.name = "ansi", - .p.long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"), + CODEC_LONG_NAME("ASCII/ANSI art"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ANSI, .priv_data_size = sizeof(AnsiContext), @@ -490,6 +489,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .defaults = ansi_defaults, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apac.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apac.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,278 @@ +/* + * APAC audio decoder + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/audio_fifo.h" +#include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "get_bits.h" + +typedef struct ChContext { + int have_code; + int last_sample; + int last_delta; + int bit_length; + int block_length; + uint8_t block[32 * 2]; + AVAudioFifo *samples; +} ChContext; + +typedef struct APACContext { + GetBitContext gb; + int skip; + + int cur_ch; + ChContext ch[2]; + + uint8_t *bitstream; + int64_t max_framesize; + int bitstream_size; + int bitstream_index; +} APACContext; + +static av_cold int apac_close(AVCodecContext *avctx) +{ + APACContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + s->bitstream_size = 0; + + for (int ch = 0; ch < 2; ch++) { + ChContext *c = &s->ch[ch]; + + av_audio_fifo_free(c->samples); + } + + return 0; +} + +static av_cold int apac_init(AVCodecContext *avctx) +{ + APACContext *s = avctx->priv_data; + + if (avctx->bits_per_coded_sample > 8) + avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + else + avctx->sample_fmt = AV_SAMPLE_FMT_U8P; + + if (avctx->ch_layout.nb_channels < 1 || + avctx->ch_layout.nb_channels > 2 || + avctx->bits_per_coded_sample < 8 || + avctx->bits_per_coded_sample > 16 + ) + return AVERROR_INVALIDDATA; + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + ChContext *c = &s->ch[ch]; + + c->bit_length = avctx->bits_per_coded_sample; + c->block_length = 8; + c->have_code = 0; + c->samples = av_audio_fifo_alloc(avctx->sample_fmt, 1, 1024); + if (!c->samples) + return AVERROR(ENOMEM); + } + + s->max_framesize = 1024; + s->bitstream = av_realloc_f(s->bitstream, s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + return 0; +} + +static int get_code(ChContext *c, GetBitContext *gb) +{ + if (get_bits1(gb)) { + int code = get_bits(gb, 2); + + switch (code) { + case 0: + c->bit_length--; + break; + case 1: + c->bit_length++; + break; + case 2: + c->bit_length = get_bits(gb, 5); + break; + case 3: + c->block_length = get_bits(gb, 4); + return 1; + } + } + + return 0; +} + +static int apac_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *pkt) +{ + APACContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + int ret, n, buf_size, input_buf_size; + const uint8_t *buf; + int nb_samples; + + if (!pkt->size && s->bitstream_size <= 0) { + *got_frame_ptr = 0; + return 0; + } + + buf_size = pkt->size; + input_buf_size = buf_size; + + if (s->bitstream_index > 0 && s->bitstream_size > 0) { + memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size); + s->bitstream_index = 0; + } + + if (s->bitstream_index + s->bitstream_size + buf_size > s->max_framesize) { + s->bitstream = av_realloc_f(s->bitstream, s->bitstream_index + + s->bitstream_size + + buf_size + AV_INPUT_BUFFER_PADDING_SIZE, + sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + s->max_framesize = s->bitstream_index + s->bitstream_size + buf_size; + } + if (pkt->data) + memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], pkt->data, buf_size); + buf = &s->bitstream[s->bitstream_index]; + buf_size += s->bitstream_size; + s->bitstream_size = buf_size; + + frame->nb_samples = s->bitstream_size * 16 * 8; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + if ((ret = init_get_bits8(gb, buf, buf_size)) < 0) + return ret; + + skip_bits(gb, s->skip); + s->skip = 0; + + while (get_bits_left(gb) > 0) { + for (int ch = s->cur_ch; ch < avctx->ch_layout.nb_channels; ch++) { + ChContext *c = &s->ch[ch]; + int16_t *dst16 = (int16_t *)c->block; + uint8_t *dst8 = (uint8_t *)c->block; + void *samples[4]; + + samples[0] = &c->block[0]; + if (get_bits_left(gb) < 16 && pkt->size) { + s->cur_ch = ch; + goto end; + } + + if (!c->have_code && get_code(c, gb)) + get_code(c, gb); + c->have_code = 0; + + if (c->block_length <= 0) + continue; + + if (c->bit_length < 0 || + c->bit_length > 17) { + c->bit_length = avctx->bits_per_coded_sample; + s->bitstream_index = 0; + s->bitstream_size = 0; + return AVERROR_INVALIDDATA; + } + + if (get_bits_left(gb) < c->block_length * c->bit_length) { + if (pkt->size) { + c->have_code = 1; + s->cur_ch = ch; + goto end; + } else { + break; + } + } + + for (int i = 0; i < c->block_length; i++) { + int val = get_bits_long(gb, c->bit_length); + unsigned delta = (val & 1) ? ~(val >> 1) : (val >> 1); + int sample; + + delta += c->last_delta; + sample = c->last_sample + delta; + c->last_delta = delta; + c->last_sample = sample; + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_S16P: + dst16[i] = sample; + break; + case AV_SAMPLE_FMT_U8P: + dst8[i] = sample; + break; + } + } + + av_audio_fifo_write(c->samples, samples, c->block_length); + } + + s->cur_ch = 0; + } +end: + nb_samples = frame->nb_samples; + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) + nb_samples = FFMIN(av_audio_fifo_size(s->ch[ch].samples), nb_samples); + + frame->nb_samples = nb_samples; + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + void *samples[1] = { frame->extended_data[ch] }; + av_audio_fifo_read(s->ch[ch].samples, samples, nb_samples); + } + + s->skip = get_bits_count(gb) - 8 * (get_bits_count(gb) / 8); + n = get_bits_count(gb) / 8; + + if (nb_samples > 0 || pkt->size) + *got_frame_ptr = 1; + + if (s->bitstream_size > 0) { + s->bitstream_index += n; + s->bitstream_size -= n; + return input_buf_size; + } + return n; +} + +const FFCodec ff_apac_decoder = { + .p.name = "apac", + CODEC_LONG_NAME("Marian's A-pac audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APAC, + .priv_data_size = sizeof(APACContext), + .init = apac_init, + FF_CODEC_DECODE_CB(apac_decode), + .close = apac_close, + .p.capabilities = AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_SUBFRAMES, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_NONE }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apedec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apedec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apedec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/apedec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "bswapdsp.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "unary.h" @@ -1577,7 +1577,6 @@ ape_unpack_mono(s, blockstodecode); else ape_unpack_stereo(s, blockstodecode); - emms_c(); if (s->error) { s->samples=0; @@ -1660,7 +1659,7 @@ const FFCodec ff_ape_decoder = { .p.name = "ape", - .p.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"), + CODEC_LONG_NAME("Monkey's Audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_APE, .priv_data_size = sizeof(APEContext), @@ -1669,7 +1668,7 @@ FF_CODEC_DECODE_CB(ape_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = ape_flush, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.c 2023-03-03 13:29:59.000000000 +0000 @@ -516,15 +516,6 @@ s->hd = avctx->codec->id == AV_CODEC_ID_APTX_HD; s->block_size = s->hd ? 6 : 4; - if (avctx->frame_size == 0) - avctx->frame_size = 256 * s->block_size; - - if (avctx->frame_size % s->block_size) { - av_log(avctx, AV_LOG_ERROR, - "Frame size must be a multiple of %d samples\n", s->block_size); - return AVERROR(EINVAL); - } - for (chan = 0; chan < NB_CHANNELS; chan++) { Channel *channel = &s->channels[chan]; for (subband = 0; subband < NB_SUBBANDS; subband++) { @@ -534,6 +525,5 @@ } } - ff_af_queue_init(avctx, &s->afq); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "libavutil/channel_layout.h" #include "aptx.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" /* * Half-band QMF synthesis filter realized with a polyphase FIR filter. @@ -151,7 +151,7 @@ /* get output buffer */ frame->ch_layout.nb_channels = NB_CHANNELS; frame->format = AV_SAMPLE_FMT_S32P; - frame->nb_samples = 4 * avpkt->size / s->block_size; + frame->nb_samples = 4 * (avpkt->size / s->block_size); if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; @@ -176,17 +176,14 @@ #if CONFIG_APTX_DECODER const FFCodec ff_aptx_decoder = { .p.name = "aptx", - .p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), + CODEC_LONG_NAME("aptX (Audio Processing Technology for Bluetooth)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_APTX, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -196,17 +193,14 @@ #if CONFIG_APTX_HD_DECODER const FFCodec ff_aptx_hd_decoder = { .p.name = "aptx_hd", - .p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), + CODEC_LONG_NAME("aptX HD (Audio Processing Technology for Bluetooth)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_APTX_HD, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,8 +24,15 @@ #include "libavutil/channel_layout.h" #include "aptx.h" +#include "audio_frame_queue.h" #include "codec_internal.h" #include "encode.h" +#include "internal.h" + +typedef struct AptXEncContext { + AptXContext common; + AudioFrameQueue afq; +} AptXEncContext; /* * Half-band QMF analysis filter realized with a polyphase FIR filter. @@ -212,10 +219,11 @@ static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { - AptXContext *s = avctx->priv_data; + AptXEncContext *const s0 = avctx->priv_data; + AptXContext *const s = &s0->common; int pos, ipos, channel, sample, output_size, ret; - if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) + if ((ret = ff_af_queue_add(&s0->afq, frame)) < 0) return ret; output_size = s->block_size * frame->nb_samples/4; @@ -232,33 +240,43 @@ aptx_encode_samples(s, samples, avpkt->data + pos); } - ff_af_queue_remove(&s->afq, frame->nb_samples, &avpkt->pts, &avpkt->duration); + ff_af_queue_remove(&s0->afq, frame->nb_samples, &avpkt->pts, &avpkt->duration); *got_packet_ptr = 1; return 0; } static av_cold int aptx_close(AVCodecContext *avctx) { - AptXContext *s = avctx->priv_data; + AptXEncContext *const s = avctx->priv_data; ff_af_queue_close(&s->afq); return 0; } +static av_cold int aptx_encode_init(AVCodecContext *avctx) +{ + AptXEncContext *const s = avctx->priv_data; + + ff_af_queue_init(avctx, &s->afq); + + if (!avctx->frame_size || avctx->frame_size % 4) + avctx->frame_size = 1024; + avctx->internal->pad_samples = 4; + + return ff_aptx_init(avctx); +} + #if CONFIG_APTX_ENCODER const FFCodec ff_aptx_encoder = { .p.name = "aptx", - .p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), + CODEC_LONG_NAME("aptX (Audio Processing Technology for Bluetooth)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_APTX, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, - .priv_data_size = sizeof(AptXContext), - .init = ff_aptx_init, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(AptXEncContext), + .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -269,18 +287,15 @@ #if CONFIG_APTX_HD_ENCODER const FFCodec ff_aptx_hd_encoder = { .p.name = "aptx_hd", - .p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), + CODEC_LONG_NAME("aptX HD (Audio Processing Technology for Bluetooth)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_APTX_HD, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, - .priv_data_size = sizeof(AptXContext), - .init = ff_aptx_init, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(AptXEncContext), + .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aptx.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,6 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "mathops.h" -#include "audio_frame_queue.h" enum channels { @@ -95,7 +94,6 @@ int block_size; int32_t sync_idx; Channel channels[NB_CHANNELS]; - AudioFrameQueue afq; } AptXContext; typedef const struct { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arbc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arbc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arbc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arbc.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,18 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct ARBCContext { GetByteContext gb; @@ -213,7 +208,7 @@ const FFCodec ff_arbc_decoder = { .p.name = "arbc", - .p.long_name = NULL_IF_CONFIG_SMALL("Gryphon's Anim Compressor"), + CODEC_LONG_NAME("Gryphon's Anim Compressor"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ARBC, .priv_data_size = sizeof(ARBCContext), @@ -222,5 +217,5 @@ .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/argo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/argo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/argo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/argo.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,18 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct ArgoContext { GetByteContext gb; @@ -735,7 +732,7 @@ const FFCodec ff_argo_decoder = { .p.name = "argo", - .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Video"), + CODEC_LONG_NAME("Argonaut Games Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ARGO, .priv_data_size = sizeof(ArgoContext), @@ -744,5 +741,5 @@ .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/ac3dsp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/ac3dsp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/ac3dsp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/ac3dsp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,7 @@ void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len); -av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact) +av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c) { int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fft_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fft_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fft_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fft_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,8 +48,10 @@ if (have_neon(cpu_flags)) { #if CONFIG_FFT - s->fft_permute = ff_fft_permute_neon; - s->fft_calc = ff_fft_calc_neon; + if (s->nbits < 17) { + s->fft_permute = ff_fft_permute_neon; + s->fft_calc = ff_fft_calc_neon; + } #endif #if CONFIG_MDCT s->imdct_calc = ff_imdct_calc_neon; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/flacdsp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/flacdsp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/flacdsp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/flacdsp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,15 +20,11 @@ #include "libavutil/attributes.h" #include "libavcodec/flacdsp.h" -#include "config.h" -#include "config_components.h" void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order, int qlevel, int len); -av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, - int bps) +av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels) { - if (CONFIG_FLAC_DECODER) - c->lpc16 = ff_flac_lpc_16_arm; + c->lpc16 = ff_flac_lpc_16_arm; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/fmtconvert_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,6 @@ #include "libavutil/attributes.h" #include "libavutil/arm/cpu.h" -#include "libavcodec/avcodec.h" #include "libavcodec/fmtconvert.h" void ff_int32_to_float_fmul_array8_neon(FmtConvertContext *c, float *dst, @@ -37,7 +36,7 @@ const int32_t *src, const float *mul, int len); -av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx) +av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c) { int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264chroma_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264chroma_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264chroma_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264chroma_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,18 +26,18 @@ #include "libavutil/arm/cpu.h" #include "libavcodec/h264chroma.h" -void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc2_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264cmc_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264cmc_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264cmc_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/h264cmc_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "libavutil/arm/asm.S" -/* chroma_mc8(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ +/* chroma_mc8(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ .macro h264_chroma_mc8 type, codec=h264 function ff_\type\()_\codec\()_chroma_mc8_neon, export=1 push {r4-r7, lr} @@ -197,7 +197,7 @@ endfunc .endm -/* chroma_mc4(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ +/* chroma_mc4(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) */ .macro h264_chroma_mc4 type, codec=h264 function ff_\type\()_\codec\()_chroma_mc4_neon, export=1 push {r4-r7, lr} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/hevcdsp_init_neon.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/hevcdsp_init_neon.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/hevcdsp_init_neon.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/hevcdsp_init_neon.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,32 +24,32 @@ #include "libavcodec/avcodec.h" #include "hevcdsp_arm.h" -void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, +void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height); -void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, +void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height); -void ff_hevc_v_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q); -void ff_hevc_h_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q); -void ff_hevc_v_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q); -void ff_hevc_h_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q); -void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_v_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, const int *_tc, const uint8_t *_no_p, const uint8_t *_no_q); +void ff_hevc_h_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, const int *_tc, const uint8_t *_no_p, const uint8_t *_no_q); +void ff_hevc_v_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, const int *_tc, const uint8_t *_no_p, const uint8_t *_no_q); +void ff_hevc_h_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, const int *_tc, const uint8_t *_no_p, const uint8_t *_no_q); +void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); -void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, int16_t *coeffs, +void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, const int16_t *coeffs, ptrdiff_t stride); void ff_hevc_idct_4x4_dc_8_neon(int16_t *coeffs); void ff_hevc_idct_8x8_dc_8_neon(int16_t *coeffs); @@ -70,7 +70,7 @@ void ff_hevc_transform_luma_4x4_neon_8(int16_t *coeffs); #define PUT_PIXELS(name) \ - void name(int16_t *dst, uint8_t *src, \ + void name(int16_t *dst, const uint8_t *src, \ ptrdiff_t srcstride, int height, \ intptr_t mx, intptr_t my, int width) PUT_PIXELS(ff_hevc_put_pixels_w2_neon_8); @@ -85,19 +85,19 @@ PUT_PIXELS(ff_hevc_put_pixels_w64_neon_8); #undef PUT_PIXELS -static void (*put_hevc_qpel_neon[4][4])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, +static void (*put_hevc_qpel_neon[4][4])(int16_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int height, int width); -static void (*put_hevc_qpel_uw_neon[4][4])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, - int width, int height, int16_t* src2, ptrdiff_t src2stride); -void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, +static void (*put_hevc_qpel_uw_neon[4][4])(uint8_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, + int width, int height, const int16_t *src2, ptrdiff_t src2stride); +void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, +void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, - int16_t *src2, +void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); #define QPEL_FUNC(name) \ - void name(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, \ + void name(int16_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, \ int height, int width) QPEL_FUNC(ff_hevc_put_qpel_v1_neon_8); @@ -118,7 +118,7 @@ #undef QPEL_FUNC #define QPEL_FUNC_UW_PIX(name) \ - void name(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, \ + void name(uint8_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, \ int height, intptr_t mx, intptr_t my, int width); QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w4_neon_8); QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w8_neon_8); @@ -130,8 +130,8 @@ #undef QPEL_FUNC_UW_PIX #define QPEL_FUNC_UW(name) \ - void name(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, \ - int width, int height, int16_t* src2, ptrdiff_t src2stride); + void name(uint8_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, \ + int width, int height, const int16_t* src2, ptrdiff_t src2stride); QPEL_FUNC_UW(ff_hevc_put_qpel_uw_pixels_neon_8); QPEL_FUNC_UW(ff_hevc_put_qpel_uw_v1_neon_8); QPEL_FUNC_UW(ff_hevc_put_qpel_uw_v2_neon_8); @@ -150,14 +150,14 @@ QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h3v3_neon_8); #undef QPEL_FUNC_UW -void ff_hevc_sao_band_filter_neon_8(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height, int16_t *offset_table); +void ff_hevc_sao_band_filter_neon_8(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height, int16_t *offset_table); -void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, +void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height) { uint8_t *dst = _dst; - uint8_t *src = _src; + const uint8_t *src = _src; int16_t offset_table[32] = {0}; int k; @@ -168,10 +168,10 @@ ff_hevc_sao_band_filter_neon_8(dst, src, stride_dst, stride_src, width, height, offset_table); } -void ff_hevc_sao_edge_filter_neon_8(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height, - int a_stride, int b_stride, int16_t *sao_offset_val, uint8_t *edge_idx); +void ff_hevc_sao_edge_filter_neon_8(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height, + int a_stride, int b_stride, const int16_t *sao_offset_val, const uint8_t *edge_idx); -void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, +void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height) { static uint8_t edge_idx[] = { 1, 2, 0, 3, 4 }; static const int8_t pos[4][2][2] = { @@ -181,7 +181,7 @@ { { 1, -1 }, { -1, 1 } }, // 135 degree }; uint8_t *dst = _dst; - uint8_t *src = _src; + const uint8_t *src = _src; int a_stride, b_stride; ptrdiff_t stride_src = (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); @@ -191,20 +191,20 @@ ff_hevc_sao_edge_filter_neon_8(dst, src, stride_dst, stride_src, width, height, a_stride, b_stride, sao_offset_val, edge_idx); } -void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, +void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width) { put_hevc_qpel_neon[my][mx](dst, MAX_PB_SIZE, src, srcstride, height, width); } -void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, +void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width) { put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, NULL, 0); } -void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, - int16_t *src2, +void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, + const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -6,8 +6,6 @@ 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_FLACDSP) += arm/flacdsp_init_arm.o \ - arm/flacdsp_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 @@ -38,6 +36,8 @@ OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \ arm/sbrdsp_init_arm.o OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_init_arm.o +OBJS-$(CONFIG_FLAC_DECODER) += arm/flacdsp_init_arm.o \ + arm/flacdsp_arm.o OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o OBJS-$(CONFIG_RV40_DECODER) += arm/rv40dsp_init_arm.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/me_cmp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/me_cmp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/me_cmp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/me_cmp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,17 +25,17 @@ #include "libavcodec/me_cmp.h" #include "libavcodec/mpegvideo.h" -int ff_pix_abs16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_armv6(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); -int ff_pix_abs16_x2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_x2_armv6(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); -int ff_pix_abs16_y2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_y2_armv6(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); -int ff_pix_abs8_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs8_armv6(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); -int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, +int ff_sse16_armv6(MpegEncContext *s, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h); av_cold void ff_me_cmp_init_arm(MECmpContext *c, AVCodecContext *avctx) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/mpegvideoencdsp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/mpegvideoencdsp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/mpegvideoencdsp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/mpegvideoencdsp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,8 +24,8 @@ #include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" -int ff_pix_norm1_armv6(uint8_t *pix, int line_size); -int ff_pix_sum_armv6(uint8_t *pix, int line_size); +int ff_pix_norm1_armv6(const uint8_t *pix, int line_size); +int ff_pix_sum_armv6(const uint8_t *pix, int line_size); av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, AVCodecContext *avctx) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/rv40dsp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/rv40dsp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/rv40dsp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/rv40dsp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -49,11 +49,11 @@ DECL_QPEL_Y(2); DECL_QPEL_Y(3); -void ff_put_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int); -void ff_put_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int); +void ff_put_rv40_chroma_mc8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int, int, int); +void ff_put_rv40_chroma_mc4_neon(uint8_t *, const uint8_t *, ptrdiff_t, int, int, int); -void ff_avg_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int); -void ff_avg_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int); +void ff_avg_rv40_chroma_mc8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int, int, int); +void ff_avg_rv40_chroma_mc4_neon(uint8_t *, const uint8_t *, ptrdiff_t, int, int, int); void ff_rv40_weight_func_16_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t); void ff_rv40_weight_func_8_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,17 +26,17 @@ #include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" -void ff_synth_filter_float_vfp(FFTContext *imdct, +void ff_synth_filter_float_vfp(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], - float out[32], const float in[32], - float scale); + float out[32], float in[32], + float scale, av_tx_fn imdct_fn); -void ff_synth_filter_float_neon(FFTContext *imdct, +void ff_synth_filter_float_neon(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], - float out[32], const float in[32], - float scale); + float out[32], float in[32], + float scale, av_tx_fn imdct_fn); av_cold void ff_synth_filter_init_arm(SynthFilterContext *s) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -31,10 +31,13 @@ str r12, [r2] ldr r2, [sp, #12*4] @ in +VFP ldr r12, [sp, #13*4] @ imdct_fn +NOVFP ldr r12, [sp, #14*4] @ imdct_fn + mov r3, #4 @ sizeof(float) mov r9, r1 @ synth_buf VFP vpush {d0} - bl X(ff_imdct_half_neon) + blx r12 VFP vpop {d0} pop {r3} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_vfp.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_vfp.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_vfp.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/synth_filter_vfp.S 2023-03-03 13:29:59.000000000 +0000 @@ -131,8 +131,11 @@ and lr, lr, #512-32 str lr, [P_SB_OFF] @ rotate offset, modulo buffer size, ready for next call ldr a3, [sp, #(16+6+2)*4] @ fetch in from stack, to pass to imdct_half + mov a4, #4 @ sizeof(float) +VFP ldr r12, [sp, #(16+6+3)*4] @ fetch imdct_fn from stack +NOVFP ldr r12, [sp, #(16+6+4)*4] @ fetch imdct_fn from stack VFP vmov s16, SCALE @ imdct_half is free to corrupt s0, but it contains one of our arguments in hardfp case - bl X(ff_imdct_half_vfp) + blx r12 VFP vmov SCALE, s16 fmrx OLDFPSCR, FPSCR diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_init_neon.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,12 +33,12 @@ void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); -void ff_vc1_v_loop_filter4_neon(uint8_t *src, int stride, int pq); -void ff_vc1_h_loop_filter4_neon(uint8_t *src, int stride, int pq); -void ff_vc1_v_loop_filter8_neon(uint8_t *src, int stride, int pq); -void ff_vc1_h_loop_filter8_neon(uint8_t *src, int stride, int pq); -void ff_vc1_v_loop_filter16_neon(uint8_t *src, int stride, int pq); -void ff_vc1_h_loop_filter16_neon(uint8_t *src, int stride, int pq); +void ff_vc1_v_loop_filter4_neon(uint8_t *src, ptrdiff_t stride, int pq); +void ff_vc1_h_loop_filter4_neon(uint8_t *src, ptrdiff_t stride, int pq); +void ff_vc1_v_loop_filter8_neon(uint8_t *src, ptrdiff_t stride, int pq); +void ff_vc1_h_loop_filter8_neon(uint8_t *src, ptrdiff_t stride, int pq); +void ff_vc1_v_loop_filter16_neon(uint8_t *src, ptrdiff_t stride, int pq); +void ff_vc1_h_loop_filter16_neon(uint8_t *src, ptrdiff_t stride, int pq); void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int rnd); @@ -76,13 +76,13 @@ DECL_PUT(3, 2) DECL_PUT(3, 3) -void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); int ff_vc1_unescape_buffer_helper_neon(const uint8_t *src, int size, uint8_t *dst); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_neon.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vc1dsp_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -1310,17 +1310,17 @@ function ff_vc1_v_loop_filter8_neon, export=1 sub r3, r0, r1, lsl #2 vldr d0, .Lcoeffs - vld1.32 {d1}, [r0 :64], r1 @ P5 - vld1.32 {d2}, [r3 :64], r1 @ P1 - vld1.32 {d3}, [r3 :64], r1 @ P2 - vld1.32 {d4}, [r0 :64], r1 @ P6 - vld1.32 {d5}, [r3 :64], r1 @ P3 - vld1.32 {d6}, [r0 :64], r1 @ P7 + vld1.32 {d1}, [r0, :64], r1 @ P5 + vld1.32 {d2}, [r3, :64], r1 @ P1 + vld1.32 {d3}, [r3, :64], r1 @ P2 + vld1.32 {d4}, [r0, :64], r1 @ P6 + vld1.32 {d5}, [r3, :64], r1 @ P3 + vld1.32 {d6}, [r0, :64], r1 @ P7 vshll.u8 q8, d1, #1 @ 2*P5 vshll.u8 q9, d2, #1 @ 2*P1 - vld1.32 {d7}, [r3 :64] @ P4 + vld1.32 {d7}, [r3, :64] @ P4 vmovl.u8 q1, d3 @ P2 - vld1.32 {d20}, [r0 :64] @ P8 + vld1.32 {d20}, [r0, :64] @ P8 vmovl.u8 q11, d4 @ P6 vdup.16 q12, r2 @ pq vmovl.u8 q13, d5 @ P3 @@ -1375,8 +1375,8 @@ vmla.i16 q1, q0, q2 @ invert d depending on clip_sign & a0_sign, or zero it if they match, and accumulate into P5 vqmovun.s16 d0, q3 vqmovun.s16 d1, q1 - vst1.32 {d0}, [r3 :64], r1 - vst1.32 {d1}, [r3 :64] + vst1.32 {d0}, [r3, :64], r1 + vst1.32 {d1}, [r3, :64] 1: bx lr endfunc @@ -1491,17 +1491,17 @@ vpush {d8-d15} sub r3, r0, r1, lsl #2 vldr d0, .Lcoeffs - vld1.64 {q1}, [r0 :128], r1 @ P5 - vld1.64 {q2}, [r3 :128], r1 @ P1 - vld1.64 {q3}, [r3 :128], r1 @ P2 - vld1.64 {q4}, [r0 :128], r1 @ P6 - vld1.64 {q5}, [r3 :128], r1 @ P3 - vld1.64 {q6}, [r0 :128], r1 @ P7 + vld1.64 {q1}, [r0, :128], r1 @ P5 + vld1.64 {q2}, [r3, :128], r1 @ P1 + vld1.64 {q3}, [r3, :128], r1 @ P2 + vld1.64 {q4}, [r0, :128], r1 @ P6 + vld1.64 {q5}, [r3, :128], r1 @ P3 + vld1.64 {q6}, [r0, :128], r1 @ P7 vshll.u8 q7, d2, #1 @ 2*P5[0..7] vshll.u8 q8, d4, #1 @ 2*P1[0..7] - vld1.64 {q9}, [r3 :128] @ P4 + vld1.64 {q9}, [r3, :128] @ P4 vmovl.u8 q10, d6 @ P2[0..7] - vld1.64 {q11}, [r0 :128] @ P8 + vld1.64 {q11}, [r0, :128] @ P8 vmovl.u8 q12, d8 @ P6[0..7] vdup.16 q13, r2 @ pq vshll.u8 q2, d5, #1 @ 2*P1[8..15] @@ -1611,8 +1611,8 @@ vqmovun.s16 d0, q6 vqmovun.s16 d5, q9 vqmovun.s16 d1, q1 - vst1.64 {q2}, [r3 :128], r1 - vst1.64 {q0}, [r3 :128] + vst1.64 {q2}, [r3, :128], r1 + vst1.64 {q0}, [r3, :128] 1: vpop {d8-d15} bx lr endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/videodsp_init_armv5te.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/videodsp_init_armv5te.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/videodsp_init_armv5te.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/videodsp_init_armv5te.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "libavcodec/videodsp.h" #include "videodsp_arm.h" -void ff_prefetch_arm(uint8_t *mem, ptrdiff_t stride, int h); +void ff_prefetch_arm(const uint8_t *mem, ptrdiff_t stride, int h); av_cold void ff_videodsp_init_armv5te(VideoDSPContext *ctx, int bpc) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vorbisdsp_init_arm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vorbisdsp_init_arm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vorbisdsp_init_arm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vorbisdsp_init_arm.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "libavcodec/vorbisdsp.h" void ff_vorbis_inverse_coupling_neon(float *mag, float *ang, - intptr_t blocksize); + ptrdiff_t blocksize); av_cold void ff_vorbisdsp_init_arm(VorbisDSPContext *c) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp56_arith.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp56_arith.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp56_arith.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp56_arith.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2010 Mans Rullgard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_ARM_VP56_ARITH_H -#define AVCODEC_ARM_VP56_ARITH_H - -#if CONFIG_THUMB -# define A(x) -# define T(x) x -#else -# define A(x) x -# define T(x) -#endif - -#if CONFIG_THUMB || defined __clang__ -# define L(x) -# define U(x) x -#else -# define L(x) x -# define U(x) -#endif - -#if HAVE_ARMV6_INLINE - -#define vp56_rac_get_prob vp56_rac_get_prob_armv6 -static inline int vp56_rac_get_prob_armv6(VP56RangeCoder *c, int pr) -{ - unsigned shift = ff_vp56_norm_shift[c->high]; - unsigned code_word = c->code_word << shift; - unsigned high = c->high << shift; - unsigned bit; - - __asm__ ("adds %3, %3, %0 \n" - "itt cs \n" - "cmpcs %7, %4 \n" - L("ldrcsh %2, [%4], #2 \n") - U("ldrhcs %2, [%4], #2 \n") - "rsb %0, %6, #256 \n" - "smlabb %0, %5, %6, %0 \n" - T("itttt cs \n") - "rev16cs %2, %2 \n" - T("lslcs %2, %2, %3 \n") - T("orrcs %1, %1, %2 \n") - A("orrcs %1, %1, %2, lsl %3 \n") - "subcs %3, %3, #16 \n" - "lsr %0, %0, #8 \n" - "cmp %1, %0, lsl #16 \n" - "ittte ge \n" - "subge %1, %1, %0, lsl #16 \n" - "subge %0, %5, %0 \n" - "movge %2, #1 \n" - "movlt %2, #0 \n" - : "=&r"(c->high), "=&r"(c->code_word), "=&r"(bit), - "+&r"(c->bits), "+&r"(c->buffer) - : "r"(high), "r"(pr), "r"(c->end - 1), - "0"(shift), "1"(code_word) - : "cc"); - - return bit; -} - -#define vp56_rac_get_prob_branchy vp56_rac_get_prob_branchy_armv6 -static inline int vp56_rac_get_prob_branchy_armv6(VP56RangeCoder *c, int pr) -{ - unsigned shift = ff_vp56_norm_shift[c->high]; - unsigned code_word = c->code_word << shift; - unsigned high = c->high << shift; - unsigned low; - unsigned tmp; - - __asm__ ("adds %3, %3, %0 \n" - "itt cs \n" - "cmpcs %7, %4 \n" - L("ldrcsh %2, [%4], #2 \n") - U("ldrhcs %2, [%4], #2 \n") - "rsb %0, %6, #256 \n" - "smlabb %0, %5, %6, %0 \n" - T("itttt cs \n") - "rev16cs %2, %2 \n" - T("lslcs %2, %2, %3 \n") - T("orrcs %1, %1, %2 \n") - A("orrcs %1, %1, %2, lsl %3 \n") - "subcs %3, %3, #16 \n" - "lsr %0, %0, #8 \n" - "lsl %2, %0, #16 \n" - : "=&r"(low), "+&r"(code_word), "=&r"(tmp), - "+&r"(c->bits), "+&r"(c->buffer) - : "r"(high), "r"(pr), "r"(c->end - 1), "0"(shift) - : "cc"); - - if (code_word >= tmp) { - c->high = high - low; - c->code_word = code_word - tmp; - return 1; - } - - c->high = low; - c->code_word = code_word; - return 0; -} - -#endif - -#endif /* AVCODEC_ARM_VP56_ARITH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8_armv6.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8_armv6.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8_armv6.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8_armv6.S 2023-03-03 13:29:59.000000000 +0000 @@ -65,7 +65,7 @@ function ff_decode_block_coeffs_armv6, export=1 push {r0,r1,r4-r11,lr} - movrelx lr, X(ff_vp56_norm_shift) + movrelx lr, X(ff_vpx_norm_shift) ldrd r4, r5, [sp, #44] @ token_prob, qmul cmp r3, #0 ldr r11, [r5] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp_armv6.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp_armv6.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp_armv6.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp_armv6.S 2023-03-03 13:29:59.000000000 +0000 @@ -1113,7 +1113,7 @@ @ MC -@ void put_vp8_pixels16(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +@ void put_vp8_pixels16(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, @ ptrdiff_t srcstride, int h, int mx, int my) function ff_put_vp8_pixels16_armv6, export=1 push {r4-r11} @@ -1137,7 +1137,7 @@ bx lr endfunc -@ void put_vp8_pixels8(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +@ void put_vp8_pixels8(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, @ ptrdiff_t srcstride, int h, int mx, int my) function ff_put_vp8_pixels8_armv6, export=1 push {r4-r11} @@ -1161,7 +1161,7 @@ bx lr endfunc -@ void put_vp8_pixels4(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +@ void put_vp8_pixels4(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, @ ptrdiff_t srcstride, int h, int mx, int my) function ff_put_vp8_pixels4_armv6, export=1 ldr r12, [sp, #0] @ h diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -58,7 +58,7 @@ #define VP8_MC(n, opt) \ void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t srcstride, \ + const uint8_t *src, ptrdiff_t srcstride,\ int h, int x, int y) #define VP8_EPEL(w, opt) \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vp8.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,12 @@ #include #include "config.h" -#include "libavcodec/vp56.h" +#include "libavcodec/vpx_rac.h" #include "libavcodec/vp8.h" #if HAVE_ARMV6_EXTERNAL #define vp8_decode_block_coeffs_internal ff_decode_block_coeffs_armv6 -int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16], +int ff_decode_block_coeffs_armv6(VPXRangeCoder *rc, int16_t block[16], uint8_t probs[8][3][NUM_DCT_TOKENS-1], int i, uint8_t *token_prob, int16_t qmul[2]); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vpx_arith.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vpx_arith.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vpx_arith.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/arm/vpx_arith.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2010 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_ARM_VPX_ARITH_H +#define AVCODEC_ARM_VPX_ARITH_H + +#if CONFIG_THUMB +# define A(x) +# define T(x) x +#else +# define A(x) x +# define T(x) +#endif + +#if CONFIG_THUMB || defined __clang__ +# define L(x) +# define U(x) x +#else +# define L(x) x +# define U(x) +#endif + +#if HAVE_ARMV6_INLINE + +#define vpx_rac_get_prob vp56_rac_get_prob_armv6 +static inline int vp56_rac_get_prob_armv6(VPXRangeCoder *c, int pr) +{ + unsigned shift = ff_vpx_norm_shift[c->high]; + unsigned code_word = c->code_word << shift; + unsigned high = c->high << shift; + unsigned bit; + + __asm__ ("adds %3, %3, %0 \n" + "itt cs \n" + "cmpcs %7, %4 \n" + L("ldrcsh %2, [%4], #2 \n") + U("ldrhcs %2, [%4], #2 \n") + "rsb %0, %6, #256 \n" + "smlabb %0, %5, %6, %0 \n" + T("itttt cs \n") + "rev16cs %2, %2 \n" + T("lslcs %2, %2, %3 \n") + T("orrcs %1, %1, %2 \n") + A("orrcs %1, %1, %2, lsl %3 \n") + "subcs %3, %3, #16 \n" + "lsr %0, %0, #8 \n" + "cmp %1, %0, lsl #16 \n" + "ittte ge \n" + "subge %1, %1, %0, lsl #16 \n" + "subge %0, %5, %0 \n" + "movge %2, #1 \n" + "movlt %2, #0 \n" + : "=&r"(c->high), "=&r"(c->code_word), "=&r"(bit), + "+&r"(c->bits), "+&r"(c->buffer) + : "r"(high), "r"(pr), "r"(c->end - 1), + "0"(shift), "1"(code_word) + : "cc"); + + return bit; +} + +#define vpx_rac_get_prob_branchy vp56_rac_get_prob_branchy_armv6 +static inline int vp56_rac_get_prob_branchy_armv6(VPXRangeCoder *c, int pr) +{ + unsigned shift = ff_vpx_norm_shift[c->high]; + unsigned code_word = c->code_word << shift; + unsigned high = c->high << shift; + unsigned low; + unsigned tmp; + + __asm__ ("adds %3, %3, %0 \n" + "itt cs \n" + "cmpcs %7, %4 \n" + L("ldrcsh %2, [%4], #2 \n") + U("ldrhcs %2, [%4], #2 \n") + "rsb %0, %6, #256 \n" + "smlabb %0, %5, %6, %0 \n" + T("itttt cs \n") + "rev16cs %2, %2 \n" + T("lslcs %2, %2, %3 \n") + T("orrcs %1, %1, %2 \n") + A("orrcs %1, %1, %2, lsl %3 \n") + "subcs %3, %3, #16 \n" + "lsr %0, %0, #8 \n" + "lsl %2, %0, #16 \n" + : "=&r"(low), "+&r"(code_word), "=&r"(tmp), + "+&r"(c->bits), "+&r"(c->buffer) + : "r"(high), "r"(pr), "r"(c->end - 1), "0"(shift) + : "cc"); + + if (code_word >= tmp) { + c->high = high - low; + c->code_word = code_word - tmp; + return 1; + } + + c->high = low; + c->code_word = code_word; + return 0; +} + +#endif + +#endif /* AVCODEC_ARM_VPX_ARITH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ass.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ass.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ass.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ass.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/common.h" +#include "version.h" int ff_ass_subtitle_header_full(AVCodecContext *avctx, int play_res_x, int play_res_y, @@ -40,10 +41,11 @@ "PlayResX: %d\r\n" "PlayResY: %d\r\n" "ScaledBorderAndShadow: yes\r\n" + "YCbCr Matrix: None\r\n" "\r\n" "[V4+ Styles]\r\n" - /* ASSv4 header */ + /* ASS (v4+) header */ "Format: Name, " "Fontname, Fontsize, " "PrimaryColour, SecondaryColour, OutlineColour, BackColour, " @@ -63,7 +65,7 @@ "0,0," /* Spacing, Angle */ "%d,1,0," /* BorderStyle, Outline, Shadow */ "%d,10,10,10," /* Alignment, Margin[LRV] */ - "0\r\n" /* Encoding */ + "1\r\n" /* Encoding */ "\r\n" "[Events]\r\n" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -64,23 +64,21 @@ #if CONFIG_SSA_DECODER const FFCodec ff_ssa_decoder = { .p.name = "ssa", - .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + CODEC_LONG_NAME("ASS (Advanced SubStation Alpha) subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, FF_CODEC_DECODE_SUB_CB(ass_decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASS_DECODER const FFCodec ff_ass_decoder = { .p.name = "ass", - .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + CODEC_LONG_NAME("ASS (Advanced SubStation Alpha) subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, FF_CODEC_DECODE_SUB_CB(ass_decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/assenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -71,23 +71,21 @@ #if CONFIG_SSA_ENCODER const FFCodec ff_ssa_encoder = { .p.name = "ssa", - .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + CODEC_LONG_NAME("ASS (Advanced SubStation Alpha) subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, FF_CODEC_ENCODE_SUB_CB(ass_encode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASS_ENCODER const FFCodec ff_ass_encoder = { .p.name = "ass", - .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + CODEC_LONG_NAME("ASS (Advanced SubStation Alpha) subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, FF_CODEC_ENCODE_SUB_CB(ass_encode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,8 @@ #include +#include "libavutil/attributes.h" + #include "asv.h" #include "avcodec.h" #include "bswapdsp.h" @@ -88,7 +90,7 @@ av_cold void ff_asv_common_init(AVCodecContext *avctx) { - ASV1Context *const a = avctx->priv_data; + ASVCommonContext *const a = avctx->priv_data; ff_bswapdsp_init(&a->bbdsp); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/attributes.h" #include "libavutil/mem.h" +#include "libavutil/mem_internal.h" #include "libavutil/thread.h" #include "asv.h" @@ -32,9 +33,11 @@ #include "blockdsp.h" #include "codec_internal.h" #include "config_components.h" +#include "decode.h" +#include "get_bits.h" #include "idctdsp.h" -#include "internal.h" #include "mpeg12data.h" +#include "vlc.h" #define CCP_VLC_BITS 5 #define DC_CCP_VLC_BITS 4 @@ -48,6 +51,20 @@ static VLC ac_ccp_vlc; static VLC asv2_level_vlc; +typedef struct ASVDecContext { + ASVCommonContext c; + + GetBitContext gb; + + BlockDSPContext bdsp; + IDCTDSPContext idsp; + uint8_t permutated_scantable[64]; + DECLARE_ALIGNED(32, int16_t, block)[6][64]; + uint16_t intra_matrix[64]; + uint8_t *bitstream_buffer; + unsigned int bitstream_buffer_size; +} ASVDecContext; + static av_cold void init_vlcs(void) { INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, @@ -106,7 +123,7 @@ return code - 31; } -static inline int asv1_decode_block(ASV1Context *a, int16_t block[64]) +static inline int asv1_decode_block(ASVDecContext *a, int16_t block[64]) { int i; @@ -119,25 +136,25 @@ if (ccp == 16) break; if (ccp < 0 || i >= 10) { - av_log(a->avctx, AV_LOG_ERROR, "coded coeff pattern damaged\n"); + av_log(a->c.avctx, AV_LOG_ERROR, "coded coeff pattern damaged\n"); return AVERROR_INVALIDDATA; } if (ccp & 8) - block[a->scantable.permutated[4 * i + 0]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 0]) >> 4; + block[a->permutated_scantable[4 * i + 0]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 0]) >> 4; if (ccp & 4) - block[a->scantable.permutated[4 * i + 1]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 1]) >> 4; + block[a->permutated_scantable[4 * i + 1]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 1]) >> 4; if (ccp & 2) - block[a->scantable.permutated[4 * i + 2]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 2]) >> 4; + block[a->permutated_scantable[4 * i + 2]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 2]) >> 4; if (ccp & 1) - block[a->scantable.permutated[4 * i + 3]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 3]) >> 4; + block[a->permutated_scantable[4 * i + 3]] = (asv1_get_level(&a->gb) * a->intra_matrix[4 * i + 3]) >> 4; } } return 0; } -static inline int asv2_decode_block(ASV1Context *a, int16_t block[64]) +static inline int asv2_decode_block(ASVDecContext *a, int16_t block[64]) { int i, count, ccp; @@ -148,11 +165,11 @@ ccp = asv2_get_vlc2(&a->gb, dc_ccp_vlc.table, DC_CCP_VLC_BITS); if (ccp) { if (ccp & 4) - block[a->scantable.permutated[1]] = (asv2_get_level(&a->gb) * a->intra_matrix[1]) >> 4; + block[a->permutated_scantable[1]] = (asv2_get_level(&a->gb) * a->intra_matrix[1]) >> 4; if (ccp & 2) - block[a->scantable.permutated[2]] = (asv2_get_level(&a->gb) * a->intra_matrix[2]) >> 4; + block[a->permutated_scantable[2]] = (asv2_get_level(&a->gb) * a->intra_matrix[2]) >> 4; if (ccp & 1) - block[a->scantable.permutated[3]] = (asv2_get_level(&a->gb) * a->intra_matrix[3]) >> 4; + block[a->permutated_scantable[3]] = (asv2_get_level(&a->gb) * a->intra_matrix[3]) >> 4; } for (i = 1; i < count + 1; i++) { @@ -160,26 +177,26 @@ if (ccp) { if (ccp & 8) - block[a->scantable.permutated[4 * i + 0]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 0]) >> 4; + block[a->permutated_scantable[4 * i + 0]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 0]) >> 4; if (ccp & 4) - block[a->scantable.permutated[4 * i + 1]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 1]) >> 4; + block[a->permutated_scantable[4 * i + 1]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 1]) >> 4; if (ccp & 2) - block[a->scantable.permutated[4 * i + 2]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 2]) >> 4; + block[a->permutated_scantable[4 * i + 2]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 2]) >> 4; if (ccp & 1) - block[a->scantable.permutated[4 * i + 3]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 3]) >> 4; + block[a->permutated_scantable[4 * i + 3]] = (asv2_get_level(&a->gb) * a->intra_matrix[4 * i + 3]) >> 4; } } return 0; } -static inline int decode_mb(ASV1Context *a, int16_t block[6][64]) +static inline int decode_mb(ASVDecContext *a, int16_t block[6][64]) { int i, ret; a->bdsp.clear_blocks(block[0]); - if (a->avctx->codec_id == AV_CODEC_ID_ASV1) { + if (a->c.avctx->codec_id == AV_CODEC_ID_ASV1) { for (i = 0; i < 6; i++) { if ((ret = asv1_decode_block(a, block[i])) < 0) return ret; @@ -193,7 +210,7 @@ return 0; } -static inline void idct_put(ASV1Context *a, AVFrame *frame, int mb_x, int mb_y) +static inline void idct_put(ASVDecContext *a, AVFrame *frame, int mb_x, int mb_y) { int16_t(*block)[64] = a->block; int linesize = frame->linesize[0]; @@ -207,7 +224,7 @@ a->idsp.idct_put(dest_y + 8 * linesize, linesize, block[2]); a->idsp.idct_put(dest_y + 8 * linesize + 8, linesize, block[3]); - if (!(a->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (!(a->c.avctx->flags & AV_CODEC_FLAG_GRAY)) { a->idsp.idct_put(dest_cb, frame->linesize[1], block[4]); a->idsp.idct_put(dest_cr, frame->linesize[2], block[5]); } @@ -216,12 +233,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - ASV1Context *const a = avctx->priv_data; + ASVDecContext *const a = avctx->priv_data; + const ASVCommonContext *const c = &a->c; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - int mb_x, mb_y, ret; + int ret; - if (buf_size * 8LL < a->mb_height * a->mb_width * 13LL) + if (buf_size * 8LL < c->mb_height * c->mb_width * 13LL) return AVERROR_INVALIDDATA; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) @@ -235,7 +253,7 @@ if (!a->bitstream_buffer) return AVERROR(ENOMEM); - a->bbdsp.bswap_buf((uint32_t *) a->bitstream_buffer, + c->bbdsp.bswap_buf((uint32_t *) a->bitstream_buffer, (const uint32_t *) buf, buf_size / 4); ret = init_get_bits8(&a->gb, a->bitstream_buffer, buf_size); } else { @@ -244,8 +262,8 @@ if (ret < 0) return ret; - for (mb_y = 0; mb_y < a->mb_height2; mb_y++) { - for (mb_x = 0; mb_x < a->mb_width2; mb_x++) { + for (int mb_y = 0; mb_y < c->mb_height2; mb_y++) { + for (int mb_x = 0; mb_x < c->mb_width2; mb_x++) { if ((ret = decode_mb(a, a->block)) < 0) return ret; @@ -253,9 +271,9 @@ } } - if (a->mb_width2 != a->mb_width) { - mb_x = a->mb_width2; - for (mb_y = 0; mb_y < a->mb_height2; mb_y++) { + if (c->mb_width2 != c->mb_width) { + int mb_x = c->mb_width2; + for (int mb_y = 0; mb_y < c->mb_height2; mb_y++) { if ((ret = decode_mb(a, a->block)) < 0) return ret; @@ -263,9 +281,9 @@ } } - if (a->mb_height2 != a->mb_height) { - mb_y = a->mb_height2; - for (mb_x = 0; mb_x < a->mb_width; mb_x++) { + if (c->mb_height2 != c->mb_height) { + int mb_y = c->mb_height2; + for (int mb_x = 0; mb_x < c->mb_width; mb_x++) { if ((ret = decode_mb(a, a->block)) < 0) return ret; @@ -275,16 +293,15 @@ *got_frame = 1; - emms_c(); - return (get_bits_count(&a->gb) + 31) / 32 * 4; } static av_cold int decode_init(AVCodecContext *avctx) { static AVOnce init_static_once = AV_ONCE_INIT; - ASV1Context *const a = avctx->priv_data; + ASVDecContext *const a = avctx->priv_data; const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2; + int inv_qscale; int i; if (avctx->extradata_size < 1) { @@ -292,24 +309,25 @@ } ff_asv_common_init(avctx); - ff_blockdsp_init(&a->bdsp, avctx); + ff_blockdsp_init(&a->bdsp); ff_idctdsp_init(&a->idsp, avctx); - ff_init_scantable(a->idsp.idct_permutation, &a->scantable, ff_asv_scantab); + ff_permute_scantable(a->permutated_scantable, ff_asv_scantab, + a->idsp.idct_permutation); avctx->pix_fmt = AV_PIX_FMT_YUV420P; - if (avctx->extradata_size < 1 || (a->inv_qscale = avctx->extradata[0]) == 0) { + if (avctx->extradata_size < 1 || (inv_qscale = avctx->extradata[0]) == 0) { av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n"); if (avctx->codec_id == AV_CODEC_ID_ASV1) - a->inv_qscale = 6; + inv_qscale = 6; else - a->inv_qscale = 10; + inv_qscale = 10; } for (i = 0; i < 64; i++) { int index = ff_asv_scantab[i]; a->intra_matrix[i] = 64 * scale * ff_mpeg1_default_intra_matrix[index] / - a->inv_qscale; + inv_qscale; } ff_thread_once(&init_static_once, init_vlcs); @@ -319,7 +337,7 @@ static av_cold int decode_end(AVCodecContext *avctx) { - ASV1Context *const a = avctx->priv_data; + ASVDecContext *const a = avctx->priv_data; av_freep(&a->bitstream_buffer); a->bitstream_buffer_size = 0; @@ -330,28 +348,26 @@ #if CONFIG_ASV1_DECODER const FFCodec ff_asv1_decoder = { .p.name = "asv1", - .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), + CODEC_LONG_NAME("ASUS V1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ASV1, - .priv_data_size = sizeof(ASV1Context), + .priv_data_size = sizeof(ASVDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASV2_DECODER const FFCodec ff_asv2_decoder = { .p.name = "asv2", - .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), + CODEC_LONG_NAME("ASUS V2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ASV2, - .priv_data_size = sizeof(ASV1Context), + .priv_data_size = sizeof(ASVDecContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "libavutil/attributes.h" #include "libavutil/mem.h" +#include "libavutil/mem_internal.h" #include "aandcttab.h" #include "asv.h" @@ -36,6 +37,19 @@ #include "encode.h" #include "fdctdsp.h" #include "mpeg12data.h" +#include "pixblockdsp.h" +#include "put_bits.h" + +typedef struct ASVEncContext { + ASVCommonContext c; + + PutBitContext pb; + + PixblockDSPContext pdsp; + FDCTDSPContext fdsp; + DECLARE_ALIGNED(32, int16_t, block)[6][64]; + int q_intra_matrix[64]; +} ASVEncContext; static inline void asv1_put_level(PutBitContext *pb, int level) { @@ -49,7 +63,7 @@ } } -static inline void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level) +static inline void asv2_put_level(ASVEncContext *a, PutBitContext *pb, int level) { unsigned int index = level + 31; @@ -58,14 +72,14 @@ } else { put_bits_le(pb, 5, 0); /* Escape code */ if (level < -128 || level > 127) { - av_log(a->avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level); + av_log(a->c.avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level); level = av_clip_int8(level); } put_bits_le(pb, 8, level & 0xFF); } } -static inline void asv1_encode_block(ASV1Context *a, int16_t block[64]) +static inline void asv1_encode_block(ASVEncContext *a, int16_t block[64]) { int i; int nc_count = 0; @@ -111,7 +125,7 @@ put_bits(&a->pb, 5, 0xF); /* End of block */ } -static inline void asv2_encode_block(ASV1Context *a, int16_t block[64]) +static inline void asv2_encode_block(ASVEncContext *a, int16_t block[64]) { int i; int count = 0; @@ -166,13 +180,13 @@ #define MAX_MB_SIZE (30 * 16 * 16 * 3 / 2 / 8) -static inline int encode_mb(ASV1Context *a, int16_t block[6][64]) +static inline int encode_mb(ASVEncContext *a, int16_t block[6][64]) { int i; av_assert0(put_bytes_left(&a->pb, 0) >= MAX_MB_SIZE); - if (a->avctx->codec_id == AV_CODEC_ID_ASV1) { + if (a->c.avctx->codec_id == AV_CODEC_ID_ASV1) { for (i = 0; i < 6; i++) asv1_encode_block(a, block[i]); } else { @@ -183,16 +197,16 @@ return 0; } -static inline void dct_get(ASV1Context *a, const AVFrame *frame, +static inline void dct_get(ASVEncContext *a, const AVFrame *frame, int mb_x, int mb_y) { int16_t (*block)[64] = a->block; int linesize = frame->linesize[0]; int i; - uint8_t *ptr_y = frame->data[0] + (mb_y * 16 * linesize) + mb_x * 16; - uint8_t *ptr_cb = frame->data[1] + (mb_y * 8 * frame->linesize[1]) + mb_x * 8; - uint8_t *ptr_cr = frame->data[2] + (mb_y * 8 * frame->linesize[2]) + mb_x * 8; + const uint8_t *ptr_y = frame->data[0] + (mb_y * 16 * linesize) + mb_x * 16; + const uint8_t *ptr_cb = frame->data[1] + (mb_y * 8 * frame->linesize[1]) + mb_x * 8; + const uint8_t *ptr_cr = frame->data[2] + (mb_y * 8 * frame->linesize[2]) + mb_x * 8; a->pdsp.get_pixels(block[0], ptr_y, linesize); a->pdsp.get_pixels(block[1], ptr_y + 8, linesize); @@ -201,7 +215,7 @@ for (i = 0; i < 4; i++) a->fdsp.fdct(block[i]); - if (!(a->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (!(a->c.avctx->flags & AV_CODEC_FLAG_GRAY)) { a->pdsp.get_pixels(block[4], ptr_cb, frame->linesize[1]); a->pdsp.get_pixels(block[5], ptr_cr, frame->linesize[2]); for (i = 4; i < 6; i++) @@ -212,9 +226,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - ASV1Context *const a = avctx->priv_data; + ASVEncContext *const a = avctx->priv_data; + const ASVCommonContext *const c = &a->c; int size, ret; - int mb_x, mb_y; if (pict->width % 16 || pict->height % 16) { AVFrame *clone = av_frame_alloc(); @@ -258,35 +272,34 @@ return ret; } - if ((ret = ff_alloc_packet(avctx, pkt, a->mb_height * a->mb_width * MAX_MB_SIZE + + if ((ret = ff_alloc_packet(avctx, pkt, c->mb_height * c->mb_width * MAX_MB_SIZE + AV_INPUT_BUFFER_MIN_SIZE)) < 0) return ret; init_put_bits(&a->pb, pkt->data, pkt->size); - for (mb_y = 0; mb_y < a->mb_height2; mb_y++) { - for (mb_x = 0; mb_x < a->mb_width2; mb_x++) { + for (int mb_y = 0; mb_y < c->mb_height2; mb_y++) { + for (int mb_x = 0; mb_x < c->mb_width2; mb_x++) { dct_get(a, pict, mb_x, mb_y); encode_mb(a, a->block); } } - if (a->mb_width2 != a->mb_width) { - mb_x = a->mb_width2; - for (mb_y = 0; mb_y < a->mb_height2; mb_y++) { + if (c->mb_width2 != c->mb_width) { + int mb_x = c->mb_width2; + for (int mb_y = 0; mb_y < c->mb_height2; mb_y++) { dct_get(a, pict, mb_x, mb_y); encode_mb(a, a->block); } } - if (a->mb_height2 != a->mb_height) { - mb_y = a->mb_height2; - for (mb_x = 0; mb_x < a->mb_width; mb_x++) { + if (c->mb_height2 != c->mb_height) { + int mb_y = c->mb_height2; + for (int mb_x = 0; mb_x < c->mb_width; mb_x++) { dct_get(a, pict, mb_x, mb_y); encode_mb(a, a->block); } } - emms_c(); if (avctx->codec_id == AV_CODEC_ID_ASV1) flush_put_bits(&a->pb); @@ -296,7 +309,7 @@ size = (put_bytes_output(&a->pb) + 3) / 4; if (avctx->codec_id == AV_CODEC_ID_ASV1) { - a->bbdsp.bswap_buf((uint32_t *) pkt->data, + c->bbdsp.bswap_buf((uint32_t *) pkt->data, (uint32_t *) pkt->data, size); } @@ -308,9 +321,10 @@ static av_cold int encode_init(AVCodecContext *avctx) { - ASV1Context *const a = avctx->priv_data; + ASVEncContext *const a = avctx->priv_data; int i; const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2; + int inv_qscale; ff_asv_common_init(avctx); ff_fdctdsp_init(&a->fdsp, avctx); @@ -319,23 +333,23 @@ if (avctx->global_quality <= 0) avctx->global_quality = 4 * FF_QUALITY_SCALE; - a->inv_qscale = (32 * scale * FF_QUALITY_SCALE + + inv_qscale = (32 * scale * FF_QUALITY_SCALE + avctx->global_quality / 2) / avctx->global_quality; avctx->extradata = av_mallocz(8); if (!avctx->extradata) return AVERROR(ENOMEM); avctx->extradata_size = 8; - ((uint32_t *) avctx->extradata)[0] = av_le2ne32(a->inv_qscale); + AV_WLA(32, avctx->extradata, inv_qscale); ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS")); for (i = 0; i < 64; i++) { if (a->fdsp.fdct == ff_fdct_ifast) { int q = 32LL * scale * ff_mpeg1_default_intra_matrix[i] * ff_aanscales[i]; - a->q_intra_matrix[i] = (((int64_t)a->inv_qscale << 30) + q / 2) / q; + a->q_intra_matrix[i] = (((int64_t)inv_qscale << 30) + q / 2) / q; } else { int q = 32 * scale * ff_mpeg1_default_intra_matrix[i]; - a->q_intra_matrix[i] = ((a->inv_qscale << 16) + q / 2) / q; + a->q_intra_matrix[i] = ((inv_qscale << 16) + q / 2) / q; } } @@ -345,29 +359,29 @@ #if CONFIG_ASV1_ENCODER const FFCodec ff_asv1_encoder = { .p.name = "asv1", - .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), + CODEC_LONG_NAME("ASUS V1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ASV1, - .priv_data_size = sizeof(ASV1Context), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(ASVEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASV2_ENCODER const FFCodec ff_asv2_encoder = { .p.name = "asv2", - .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), + CODEC_LONG_NAME("ASUS V2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ASV2, - .priv_data_size = sizeof(ASV1Context), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(ASVEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/asv.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,38 +28,17 @@ #include -#include "libavutil/mem_internal.h" - #include "avcodec.h" -#include "blockdsp.h" #include "bswapdsp.h" -#include "fdctdsp.h" -#include "idctdsp.h" -#include "get_bits.h" -#include "pixblockdsp.h" -#include "put_bits.h" -typedef struct ASV1Context { +typedef struct ASVCommonContext { AVCodecContext *avctx; - BlockDSPContext bdsp; BswapDSPContext bbdsp; - FDCTDSPContext fdsp; - IDCTDSPContext idsp; - PixblockDSPContext pdsp; - PutBitContext pb; - GetBitContext gb; - ScanTable scantable; - int inv_qscale; int mb_width; int mb_height; int mb_width2; int mb_height2; - DECLARE_ALIGNED(32, int16_t, block)[6][64]; - uint16_t intra_matrix[64]; - int q_intra_matrix[64]; - uint8_t *bitstream_buffer; - unsigned int bitstream_buffer_size; -} ASV1Context; +} ASVCommonContext; extern const uint8_t ff_asv_scantab[64]; extern const uint8_t ff_asv_ccp_tab[17][2]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac1.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,17 +29,15 @@ /* Many thanks to Tim Craig for all the help! */ #include -#include -#include #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "fft.h" -#include "internal.h" #include "sinewin.h" #include "atrac.h" @@ -82,7 +80,8 @@ DECLARE_ALIGNED(32, float, mid)[256]; DECLARE_ALIGNED(32, float, high)[512]; float* bands[3]; - FFTContext mdct_ctx[3]; + AVTXContext *mdct_ctx[3]; + av_tx_fn mdct_fn[3]; void (*vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len); } AT1Ctx; @@ -95,7 +94,8 @@ static void at1_imdct(AT1Ctx *q, float *spec, float *out, int nbits, int rev_spec) { - FFTContext* mdct_context = &q->mdct_ctx[nbits - 5 - (nbits > 6)]; + AVTXContext *mdct_context = q->mdct_ctx[nbits - 5 - (nbits > 6)]; + av_tx_fn mdct_fn = q->mdct_fn[nbits - 5 - (nbits > 6)]; int transf_size = 1 << nbits; if (rev_spec) { @@ -103,7 +103,7 @@ for (i = 0; i < transf_size / 2; i++) FFSWAP(float, spec[i], spec[transf_size - 1 - i]); } - mdct_context->imdct_half(mdct_context, out, spec); + mdct_fn(mdct_context, out, spec, sizeof(float)); } @@ -324,9 +324,9 @@ { AT1Ctx *q = avctx->priv_data; - ff_mdct_end(&q->mdct_ctx[0]); - ff_mdct_end(&q->mdct_ctx[1]); - ff_mdct_end(&q->mdct_ctx[2]); + av_tx_uninit(&q->mdct_ctx[0]); + av_tx_uninit(&q->mdct_ctx[1]); + av_tx_uninit(&q->mdct_ctx[2]); return 0; } @@ -337,6 +337,7 @@ AT1Ctx *q = avctx->priv_data; AVFloatDSPContext *fdsp; int channels = avctx->ch_layout.nb_channels; + float scale = -1.0 / (1 << 15); int ret; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; @@ -353,12 +354,15 @@ } /* Init the mdct transforms */ - if ((ret = ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15))) || - (ret = ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15))) || - (ret = ff_mdct_init(&q->mdct_ctx[2], 9, 1, -1.0/ (1 << 15)))) { - av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n"); + if ((ret = av_tx_init(&q->mdct_ctx[0], &q->mdct_fn[0], AV_TX_FLOAT_MDCT, + 1, 32, &scale, 0) < 0)) + return ret; + if ((ret = av_tx_init(&q->mdct_ctx[1], &q->mdct_fn[1], AV_TX_FLOAT_MDCT, + 1, 128, &scale, 0) < 0)) + return ret; + if ((ret = av_tx_init(&q->mdct_ctx[2], &q->mdct_fn[2], AV_TX_FLOAT_MDCT, + 1, 256, &scale, 0) < 0)) return ret; - } ff_init_ff_sine_windows(5); @@ -386,7 +390,7 @@ const FFCodec ff_atrac1_decoder = { .p.name = "atrac1", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"), + CODEC_LONG_NAME("ATRAC1 (Adaptive TRansform Acoustic Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC1, .priv_data_size = sizeof(AT1Ctx), @@ -396,5 +400,5 @@ .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_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,20 +34,19 @@ #include #include -#include #include "libavutil/attributes.h" #include "libavutil/float_dsp.h" #include "libavutil/libm.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "fft.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "atrac.h" #include "atrac3data.h" @@ -116,7 +115,8 @@ //@} AtracGCContext gainc_ctx; - FFTContext mdct_ctx; + AVTXContext *mdct_ctx; + av_tx_fn mdct_fn; void (*vector_fmul)(float *dst, const float *src0, const float *src1, int len); } ATRAC3Context; @@ -148,7 +148,7 @@ FFSWAP(float, input[i], input[255 - i]); } - q->mdct_ctx.imdct_calc(&q->mdct_ctx, output, input); + q->mdct_fn(q->mdct_ctx, output, input, sizeof(float)); /* Perform windowing on the output. */ q->vector_fmul(output, output, mdct_window, MDCT_SIZE); @@ -202,7 +202,7 @@ av_freep(&q->units); av_freep(&q->decoded_bytes_buffer); - ff_mdct_end(&q->mdct_ctx); + av_tx_uninit(&q->mdct_ctx); return 0; } @@ -880,6 +880,7 @@ const uint8_t *edata_ptr = avctx->extradata; ATRAC3Context *q = avctx->priv_data; AVFloatDSPContext *fdsp; + float scale = 1.0 / 32768; int channels = avctx->ch_layout.nb_channels; if (channels < MIN_CHANNELS || channels > MAX_CHANNELS) { @@ -978,7 +979,8 @@ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; /* initialize the MDCT transform */ - if ((ret = ff_mdct_init(&q->mdct_ctx, 9, 1, 1.0 / 32768)) < 0) { + if ((ret = av_tx_init(&q->mdct_ctx, &q->mdct_fn, AV_TX_FLOAT_MDCT, 1, 256, + &scale, AV_TX_FULL_IMDCT)) < 0) { av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n"); return ret; } @@ -1017,7 +1019,7 @@ const FFCodec ff_atrac3_decoder = { .p.name = "atrac3", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"), + CODEC_LONG_NAME("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC3, .priv_data_size = sizeof(ATRAC3Context), @@ -1027,12 +1029,12 @@ .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_atrac3al_decoder = { .p.name = "atrac3al", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"), + CODEC_LONG_NAME("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC3AL, .priv_data_size = sizeof(ATRAC3Context), @@ -1042,5 +1044,5 @@ .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.c 2023-03-03 13:29:59.000000000 +0000 @@ -1391,9 +1391,9 @@ if (band_has_tones[sb]) { if (ctx->waves_info->tones_index + dst[sb].num_wavs > 48) { av_log(avctx, AV_LOG_ERROR, - "Too many tones: %d (max. 48), frame: %d!\n", + "Too many tones: %d (max. 48), frame: %"PRId64"!\n", ctx->waves_info->tones_index + dst[sb].num_wavs, - avctx->frame_number); + avctx->frame_num); return AVERROR_INVALIDDATA; } dst[sb].start_index = ctx->waves_info->tones_index; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,8 +43,8 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "atrac.h" #include "atrac3plus.h" @@ -69,8 +69,10 @@ DECLARE_ALIGNED(32, float, outp_buf)[2][ATRAC3P_FRAME_SAMPLES]; AtracGCContext gainc_ctx; ///< gain compensation context - FFTContext mdct_ctx; - FFTContext ipqf_dct_ctx; ///< IDCT context used by IPQF + AVTXContext *mdct_ctx; + av_tx_fn mdct_fn; + AVTXContext *ipqf_dct_ctx; ///< IDCT context used by IPQF + av_tx_fn ipqf_dct_fn; Atrac3pChanUnitCtx *ch_units; ///< global channel units @@ -86,8 +88,8 @@ av_freep(&ctx->ch_units); av_freep(&ctx->fdsp); - ff_mdct_end(&ctx->mdct_ctx); - ff_mdct_end(&ctx->ipqf_dct_ctx); + av_tx_uninit(&ctx->mdct_ctx); + av_tx_uninit(&ctx->ipqf_dct_ctx); return 0; } @@ -170,6 +172,7 @@ { static AVOnce init_static_once = AV_ONCE_INIT; ATRAC3PContext *ctx = avctx->priv_data; + float scale; int i, ch, ret; if (!avctx->block_align) { @@ -178,9 +181,17 @@ } /* initialize IPQF */ - ff_mdct_init(&ctx->ipqf_dct_ctx, 5, 1, 32.0 / 32768.0); + scale = 32.0 / 32768.0; + ret = av_tx_init(&ctx->ipqf_dct_ctx, &ctx->ipqf_dct_fn, AV_TX_FLOAT_MDCT, + 1, 16, &scale, 0); + if (ret < 0) + return ret; - ff_atrac3p_init_imdct(avctx, &ctx->mdct_ctx); + scale = -1.0f; + ret = av_tx_init(&ctx->mdct_ctx, &ctx->mdct_fn, AV_TX_FLOAT_MDCT, + 1, 128, &scale, AV_TX_FULL_IMDCT); + if (ret < 0) + return ret; ff_atrac_init_gain_compensation(&ctx->gainc_ctx, 6, 2); @@ -288,7 +299,7 @@ for (ch = 0; ch < num_channels; ch++) { for (sb = 0; sb < ch_unit->num_subbands; sb++) { /* inverse transform and windowing */ - ff_atrac3p_imdct(ctx->fdsp, &ctx->mdct_ctx, + ff_atrac3p_imdct(ctx->fdsp, ctx->mdct_ctx, ctx->mdct_fn, &ctx->samples[ch][sb * ATRAC3P_SUBBAND_SAMPLES], &ctx->mdct_buf[ch][sb * ATRAC3P_SUBBAND_SAMPLES], (ch_unit->channels[ch].wnd_shape_prev[sb] << 1) + @@ -328,8 +339,9 @@ } /* subband synthesis and acoustic signal output */ - ff_atrac3p_ipqf(&ctx->ipqf_dct_ctx, &ch_unit->ipqf_ctx[ch], - &ctx->time_buf[ch][0], &ctx->outp_buf[ch][0]); + ff_atrac3p_ipqf(ctx->ipqf_dct_ctx, ctx->ipqf_dct_fn, + &ch_unit->ipqf_ctx[ch], &ctx->time_buf[ch][0], + &ctx->outp_buf[ch][0]); } /* swap window shape and gain control buffers. */ @@ -406,11 +418,11 @@ const FFCodec ff_atrac3p_decoder = { .p.name = "atrac3plus", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"), + CODEC_LONG_NAME("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC3P, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, .close = atrac3p_decode_close, @@ -419,11 +431,11 @@ const FFCodec ff_atrac3pal_decoder = { .p.name = "atrac3plusal", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"), + CODEC_LONG_NAME("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC3PAL, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, .close = atrac3p_decode_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plusdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,9 +31,7 @@ #include "libavutil/libm.h" #include "libavutil/mem_internal.h" -#include "avcodec.h" #include "sinewin.h" -#include "fft.h" #include "atrac3plus.h" /** @@ -79,12 +77,6 @@ #define ATRAC3P_MDCT_SIZE (ATRAC3P_SUBBAND_SAMPLES * 2) -av_cold void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx) -{ - /* Initialize the MDCT transform. */ - ff_mdct_init(mdct_ctx, 8, 1, -1.0); -} - #define TWOPI (2 * M_PI) #define DEQUANT_PHASE(ph) (((ph) & 0x1F) << 6) @@ -463,8 +455,9 @@ } } -void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn, - float *pOut, int wind_id, int sb) +void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, AVTXContext *mdct_ctx, + av_tx_fn mdct_fn, float *pIn, float *pOut, + int wind_id, int sb) { int i; @@ -472,7 +465,7 @@ for (i = 0; i < ATRAC3P_SUBBAND_SAMPLES / 2; i++) FFSWAP(float, pIn[i], pIn[ATRAC3P_SUBBAND_SAMPLES - 1 - i]); - mdct_ctx->imdct_calc(mdct_ctx, pOut, pIn); + mdct_fn(mdct_ctx, pOut, pIn, sizeof(float)); /* Perform windowing on the output. * ATRAC3+ uses two different MDCT windows: @@ -604,8 +597,8 @@ -4.4400572e-8, -4.2005411e-7, -8.0604229e-7, -5.8336207e-7 } }; -void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist, - const float *in, float *out) +void ff_atrac3p_ipqf(AVTXContext *dct_ctx, av_tx_fn dct_fn, + Atrac3pIPQFChannelCtx *hist, const float *in, float *out) { int i, s, sb, t, pos_now, pos_next; LOCAL_ALIGNED(32, float, idct_in, [ATRAC3P_SUBBANDS]); @@ -619,7 +612,7 @@ idct_in[sb] = in[sb * ATRAC3P_SUBBAND_SAMPLES + s]; /* Calculate the sine and cosine part of the PQF using IDCT-IV */ - dct_ctx->imdct_half(dct_ctx, idct_out, idct_in); + dct_fn(dct_ctx, idct_out, idct_in, sizeof(float)); /* append the result to the history */ for (i = 0; i < 8; i++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac3plus.h 2023-03-03 13:29:59.000000000 +0000 @@ -32,10 +32,10 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "atrac.h" #include "avcodec.h" -#include "fft.h" #include "get_bits.h" /** Global unit sizes */ @@ -173,14 +173,6 @@ int num_channels, AVCodecContext *avctx); /** - * Initialize IMDCT transform. - * - * @param[in] avctx ptr to the AVCodecContext - * @param[in] mdct_ctx pointer to MDCT transform context - */ -void ff_atrac3p_init_imdct(AVCodecContext *avctx, FFTContext *mdct_ctx); - -/** * Initialize sine waves synthesizer and ff_sine_* tables. */ void ff_atrac3p_init_dsp_static(void); @@ -221,8 +213,9 @@ * @param[in] wind_id which MDCT window to apply * @param[in] sb subband number */ -void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, FFTContext *mdct_ctx, float *pIn, - float *pOut, int wind_id, int sb); +void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, AVTXContext *mdct_ctx, + av_tx_fn mdct_fn, float *pIn, float *pOut, + int wind_id, int sb); /** * Subband synthesis filter based on the polyphase quadrature (pseudo-QMF) @@ -233,8 +226,8 @@ * @param[in] in input data to process * @param[out] out receives processed data */ -void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist, - const float *in, float *out); +void ff_atrac3p_ipqf(AVTXContext *dct_ctx, av_tx_fn dct_fn, + Atrac3pIPQFChannelCtx *hist, const float *in, float *out); extern const uint16_t ff_atrac3p_qu_to_spec_pos[33]; extern const float ff_atrac3p_sf_tab[64]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac9dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac9dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac9dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/atrac9dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,10 +23,10 @@ #include "libavutil/thread.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" -#include "fft.h" #include "atrac9tab.h" +#include "libavutil/tx.h" #include "libavutil/lfg.h" #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" @@ -86,7 +86,8 @@ typedef struct ATRAC9Context { AVCodecContext *avctx; AVFloatDSPContext *fdsp; - FFTContext imdct; + AVTXContext *tx; + av_tx_fn tx_fn; ATRAC9BlockData block[5]; AVLFG lfg; @@ -101,7 +102,7 @@ uint8_t alloc_curve[48][48]; DECLARE_ALIGNED(32, float, imdct_win)[256]; - DECLARE_ALIGNED(32, float, temp)[256]; + DECLARE_ALIGNED(32, float, temp)[2048]; } ATRAC9Context; static VLC sf_vlc[2][8]; /* Signed/unsigned, length */ @@ -778,7 +779,7 @@ const ptrdiff_t offset = wsize*frame_idx*sizeof(float); float *dst = (float *)(frame->extended_data[dst_idx] + offset); - s->imdct.imdct_half(&s->imdct, s->temp, c->coeffs); + s->tx_fn(s->tx, s->temp, c->coeffs, sizeof(float)); s->fdsp->vector_fmul_window(dst, c->prev_win, s->temp, s->imdct_win, wsize >> 1); memcpy(c->prev_win, s->temp + (wsize >> 1), sizeof(float)*wsize >> 1); @@ -834,7 +835,7 @@ { ATRAC9Context *s = avctx->priv_data; - ff_mdct_end(&s->imdct); + av_tx_uninit(&s->tx); av_freep(&s->fdsp); return 0; @@ -896,10 +897,11 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) { + float scale; static AVOnce static_table_init = AV_ONCE_INIT; GetBitContext gb; ATRAC9Context *s = avctx->priv_data; - int version, block_config_idx, superframe_idx, alloc_c_len; + int err, version, block_config_idx, superframe_idx, alloc_c_len; s->avctx = avctx; @@ -959,8 +961,11 @@ s->frame_count = 1 << superframe_idx; s->frame_log2 = at9_tab_sri_frame_log2[s->samplerate_idx]; - if (ff_mdct_init(&s->imdct, s->frame_log2 + 1, 1, 1.0f / 32768.0f)) - return AVERROR(ENOMEM); + scale = 1.0f / 32768.0; + err = av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_MDCT, 1, + 1 << s->frame_log2, &scale, 0); + if (err < 0) + return err; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!s->fdsp) @@ -989,7 +994,7 @@ const FFCodec ff_atrac9_decoder = { .p.name = "atrac9", - .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), + CODEC_LONG_NAME("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ATRAC9, .priv_data_size = sizeof(ATRAC9Context), @@ -997,6 +1002,6 @@ .close = atrac9_decode_close, FF_CODEC_DECODE_CB(atrac9_decode_frame), .flush = atrac9_decode_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -113,6 +113,8 @@ ff_audiodsp_init_arm(c); #elif ARCH_PPC ff_audiodsp_init_ppc(c); +#elif ARCH_RISCV + ff_audiodsp_init_riscv(c); #elif ARCH_X86 ff_audiodsp_init_x86(c); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiodsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -55,6 +55,7 @@ void ff_audiodsp_init(AudioDSPContext *c); void ff_audiodsp_init_arm(AudioDSPContext *c); void ff_audiodsp_init_ppc(AudioDSPContext *c); +void ff_audiodsp_init_riscv(AudioDSPContext *c); void ff_audiodsp_init_x86(AudioDSPContext *c); #endif /* AVCODEC_AUDIODSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audio_frame_queue.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audio_frame_queue.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audio_frame_queue.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audio_frame_queue.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" #include "audio_frame_queue.h" -#include "internal.h" +#include "encode.h" #include "libavutil/avassert.h" av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "ac3_parser_internal.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mpegaudiodecheader.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" @@ -591,7 +591,7 @@ FFAT_DEC_CLASS(NAME) \ const FFCodec ff_##NAME##_at_decoder = { \ .p.name = #NAME "_at", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ + CODEC_LONG_NAME(#NAME " (AudioToolbox)"), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = ID, \ .priv_data_size = sizeof(ATDecodeContext), \ @@ -602,7 +602,7 @@ .p.priv_class = &ffat_##NAME##_dec_class, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, \ + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ .p.wrapper_name = "at", \ }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/audiotoolboxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -616,7 +616,7 @@ FFAT_ENC_CLASS(NAME) \ const FFCodec ff_##NAME##_at_encoder = { \ .p.name = #NAME "_at", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ + CODEC_LONG_NAME(#NAME " (AudioToolbox)"), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = ID, \ .priv_data_size = sizeof(ATDecodeContext), \ @@ -627,13 +627,12 @@ .p.priv_class = &ffat_##NAME##_enc_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | \ AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ - .p.channel_layouts = CHANNEL_LAYOUTS, \ + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \ .p.ch_layouts = CH_LAYOUTS, \ .p.sample_fmts = (const enum AVSampleFormat[]) { \ AV_SAMPLE_FMT_S16, \ AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \ }, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ .p.profiles = PROFILES, \ .p.wrapper_name = "at", \ }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aura.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aura.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aura.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/aura.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/internal.h" static av_cold int aura_decode_init(AVCodecContext *avctx) @@ -98,11 +98,10 @@ const FFCodec ff_aura2_decoder = { .p.name = "aura2", - .p.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"), + CODEC_LONG_NAME("Auravision Aura 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AURA2, .init = aura_decode_init, FF_CODEC_DECODE_CB(aura_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,8 @@ #include "av1dec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" -#include "internal.h" #include "profiles.h" #include "thread.h" @@ -194,7 +194,7 @@ } /** -* update gm type/params, since cbs already implemented part of this funcation, +* update gm type/params, since cbs already implemented part of this function, * so we don't need to full implement spec. */ static void global_motion_params(AV1DecContext *s) @@ -567,7 +567,7 @@ * implemented in the future, need remove this check. */ if (!avctx->hwaccel) { - av_log(avctx, AV_LOG_ERROR, "Your platform doesn't suppport" + av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support" " hardware accelerated AV1 decoding.\n"); return AVERROR(ENOSYS); } @@ -1247,7 +1247,7 @@ const FFCodec ff_av1_decoder = { .p.name = "av1", - .p.long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"), + CODEC_LONG_NAME("Alliance for Open Media AV1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(AV1DecContext), @@ -1255,8 +1255,7 @@ .close = av1_decode_free, FF_CODEC_DECODE_CB(av1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, .flush = av1_decode_flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/av1_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -162,8 +162,11 @@ avctx->color_trc = (enum AVColorTransferCharacteristic) color->transfer_characteristics; avctx->color_range = color->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; - if (avctx->framerate.num) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); + if (seq->timing_info_present_flag) { + const AV1RawTimingInfo *timing = &seq->timing_info; + av_reduce(&avctx->framerate.den, &avctx->framerate.num, + timing->num_units_in_display_tick, timing->time_scale, INT_MAX); + } end: ff_cbs_fragment_reset(td); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,13 +72,13 @@ static void lock_avcodec(const FFCodec *codec) { - if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) + if (codec->caps_internal & FF_CODEC_CAP_NOT_INIT_THREADSAFE && codec->init) ff_mutex_lock(&codec_mutex); } static void unlock_avcodec(const FFCodec *codec) { - if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) + if (codec->caps_internal & FF_CODEC_CAP_NOT_INIT_THREADSAFE && codec->init) ff_mutex_unlock(&codec_mutex); } @@ -161,8 +161,6 @@ goto free_and_end; } - avci->skip_samples_multiplier = 1; - if (codec2->priv_data_size > 0) { if (!avctx->priv_data) { avctx->priv_data = av_mallocz(codec2->priv_data_size); @@ -234,26 +232,46 @@ if (avctx->channel_layout && !avctx->channels) avctx->channels = av_popcount64(avctx->channel_layout); - if ((avctx->channels > 0 && avctx->ch_layout.nb_channels != avctx->channels) || + if ((avctx->channels && avctx->ch_layout.nb_channels != avctx->channels) || (avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || avctx->ch_layout.u.mask != avctx->channel_layout))) { + av_channel_layout_uninit(&avctx->ch_layout); if (avctx->channel_layout) { av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); } else { avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avctx->ch_layout.nb_channels = avctx->channels; } + avctx->ch_layout.nb_channels = avctx->channels; } FF_ENABLE_DEPRECATION_WARNINGS #endif + /* AV_CODEC_CAP_CHANNEL_CONF is a decoder-only flag; so the code below + * in particular checks that nb_channels is set for all audio encoders. */ + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && !avctx->ch_layout.nb_channels + && !(codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)) { + av_log(avctx, AV_LOG_ERROR, "%s requires channel layout to be set\n", + av_codec_is_decoder(codec) ? "Decoder" : "Encoder"); + ret = AVERROR(EINVAL); + goto free_and_end; + } + if (avctx->ch_layout.nb_channels && !av_channel_layout_check(&avctx->ch_layout)) { + av_log(avctx, AV_LOG_ERROR, "Invalid channel layout\n"); + ret = AVERROR(EINVAL); + goto free_and_end; + } if (avctx->ch_layout.nb_channels > FF_SANE_NB_CHANNELS) { av_log(avctx, AV_LOG_ERROR, "Too many channels: %d\n", avctx->ch_layout.nb_channels); ret = AVERROR(EINVAL); goto free_and_end; } - avctx->frame_number = 0; + avctx->frame_num = 0; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_number = avctx->frame_num; +FF_ENABLE_DEPRECATION_WARNINGS +#endif avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id); if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && @@ -285,14 +303,7 @@ if (ret < 0) goto free_and_end; - if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) { - ret = ff_frame_thread_encoder_init(avctx); - if (ret < 0) - goto free_and_end; - } - - if (HAVE_THREADS - && !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { + if (HAVE_THREADS && !avci->frame_thread_encoder) { /* Frame-threaded decoders call FFCodec.init for their child contexts. */ lock_avcodec(codec2); ret = ff_thread_init(avctx); @@ -330,24 +341,12 @@ 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 /* validate channel layout from the decoder */ - if (avctx->channel_layout) { - int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); - if (!avctx->channels) - avctx->channels = channels; - else if (channels != avctx->channels) { - char buf[512]; - av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); - av_log(avctx, AV_LOG_WARNING, - "Channel layout '%s' with %d channels does not match specified number of channels %d: " - "ignoring specified channel layout\n", - buf, channels, avctx->channels); - avctx->channel_layout = 0; - } - } - if (avctx->channels && avctx->channels < 0 || - avctx->channels > FF_SANE_NB_CHANNELS) { + if ((avctx->ch_layout.nb_channels && !av_channel_layout_check(&avctx->ch_layout)) || + avctx->ch_layout.nb_channels > FF_SANE_NB_CHANNELS) { ret = AVERROR(EINVAL); goto free_and_end; } @@ -355,13 +354,6 @@ ret = AVERROR(EINVAL); goto free_and_end; } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - -#if FF_API_AVCTX_TIMEBASE - if (avctx->framerate.num > 0 && avctx->framerate.den > 0) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); -#endif } if (codec->priv_class) av_assert0(*(const AVClass **)avctx->priv_data == codec->priv_class); @@ -390,11 +382,10 @@ } if (avci->in_frame) av_frame_unref(avci->in_frame); + if (avci->recon_frame) + av_frame_unref(avci->recon_frame); } else { av_packet_unref(avci->last_pkt_props); - while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0) - av_packet_unref(avci->last_pkt_props); - av_packet_unref(avci->in_pkt); avctx->pts_correction_last_pts = @@ -459,17 +450,11 @@ av_freep(&avci->byte_buffer); av_frame_free(&avci->buffer_frame); av_packet_free(&avci->buffer_pkt); - if (avci->pkt_props) { - while (av_fifo_can_read(avci->pkt_props)) { - av_packet_unref(avci->last_pkt_props); - av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1); - } - av_fifo_freep2(&avci->pkt_props); - } av_packet_free(&avci->last_pkt_props); av_packet_free(&avci->in_pkt); av_frame_free(&avci->in_frame); + av_frame_free(&avci->recon_frame); av_buffer_unref(&avci->pool); @@ -481,6 +466,10 @@ av_channel_layout_uninit(&avci->initial_ch_layout); +#if CONFIG_LCMS2 + ff_icc_context_uninit(&avci->icc); +#endif + av_freep(&avctx->internal); } @@ -716,3 +705,12 @@ { return !!s->internal; } + +int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + av_frame_unref(frame); + + if (av_codec_is_decoder(avctx->codec)) + return ff_decode_receive_frame(avctx, frame); + return ff_encode_receive_frame(avctx, frame); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avcodec.h 2023-03-03 13:29:59.000000000 +0000 @@ -232,6 +232,58 @@ */ #define AV_CODEC_FLAG_DROPCHANGED (1 << 5) /** + * Request the encoder to output reconstructed frames, i.e.\ frames that would + * be produced by decoding the encoded bistream. These frames may be retrieved + * by calling avcodec_receive_frame() immediately after a successful call to + * avcodec_receive_packet(). + * + * Should only be used with encoders flagged with the + * @ref AV_CODEC_CAP_ENCODER_RECON_FRAME capability. + */ +#define AV_CODEC_FLAG_RECON_FRAME (1 << 6) +/** + * @par decoding + * Request the decoder to propagate each packets AVPacket.opaque and + * AVPacket.opaque_ref to its corresponding output AVFrame. + * + * @par encoding: + * Request the encoder to propagate each frame's AVFrame.opaque and + * AVFrame.opaque_ref values to its corresponding output AVPacket. + * + * @par + * May only be set on encoders that have the + * @ref AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability flag. + * + * @note + * While in typical cases one input frame produces exactly one output packet + * (perhaps after a delay), in general the mapping of frames to packets is + * M-to-N, so + * - Any number of input frames may be associated with any given output packet. + * This includes zero - e.g. some encoders may output packets that carry only + * metadata about the whole stream. + * - A given input frame may be associated with any number of output packets. + * Again this includes zero - e.g. some encoders may drop frames under certain + * conditions. + * . + * This implies that when using this flag, the caller must NOT assume that + * - a given input frame's opaques will necessarily appear on some output packet; + * - every output packet will have some non-NULL opaque value. + * . + * When an output packet contains multiple frames, the opaque values will be + * taken from the first of those. + * + * @note + * The converse holds for decoders, with frames and packets switched. + */ +#define AV_CODEC_FLAG_COPY_OPAQUE (1 << 7) +/** + * Signal to the encoder that the values of AVFrame.duration are valid and + * should be used (typically for transferring them to output packets). + * + * If this flag is not set, frame durations are ignored. + */ +#define AV_CODEC_FLAG_FRAME_DURATION (1 << 8) +/** * Use internal 2pass ratecontrol in first pass mode. */ #define AV_CODEC_FLAG_PASS1 (1 << 9) @@ -251,15 +303,6 @@ * error[?] variables will be set during encoding. */ #define AV_CODEC_FLAG_PSNR (1 << 15) -#if FF_API_FLAG_TRUNCATED -/** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - * - * @deprecated use codec parsers for packetizing input - */ -#define AV_CODEC_FLAG_TRUNCATED (1 << 16) -#endif /** * Use interlaced DCT. */ @@ -301,11 +344,6 @@ #define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) /** - * timecode is in drop frame format. DEPRECATED!!!! - */ -#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) - -/** * Input bitstream might be truncated at a packet boundaries * instead of only at frame boundaries. */ @@ -331,13 +369,12 @@ * Do not reset ASS ReadOrder field on flush (subtitles decoding) */ #define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) - -/* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding */ -/* /Fx */ -/* codec capabilities */ +/** + * Generate/parse ICC profiles on encode/decode, as appropriate for the type of + * file. No effect on codecs which cannot contain embedded ICC profiles, or + * when compiled without support for lcms2. + */ +#define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31) /* Exported side data. These flags can be passed in AVCodecContext.export_side_data before initialization. @@ -506,8 +543,7 @@ * (fixed_vop_rate == 0 implies that it is different from the framerate) * * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. + * - decoding: unused. */ AVRational time_base; @@ -1025,6 +1061,7 @@ */ int frame_size; +#if FF_API_AVCTX_FRAME_NUMBER /** * Frame counter, set by libavcodec. * @@ -1033,8 +1070,11 @@ * * @note the counter is not incremented if encoding/decoding resulted in * an error. + * @deprecated use frame_num instead */ + attribute_deprecated int frame_number; +#endif /** * number of bytes per packet if constant and known or 0 @@ -1296,13 +1336,9 @@ * unofficial and experimental (that is, they always try to decode things * when they can) unless they are explicitly asked to behave stupidly * (=strictly conform to the specs) + * This may only be set to one of the FF_COMPLIANCE_* values in defs.h. */ int strict_std_compliance; -#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. -#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. -#define FF_COMPLIANCE_NORMAL 0 -#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions -#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. /** * error concealment flags @@ -1338,28 +1374,14 @@ /** * Error recognition; may misdetect some more or less valid parts as errors. + * This is a bitfield of the AV_EF_* values defined in defs.h. + * * - encoding: Set by user. * - decoding: Set by user. */ int err_recognition; -/** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - */ -#define AV_EF_CRCCHECK (1<<0) -#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations -#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length -#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection - -#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue -#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors -#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors -#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error - - +#if FF_API_REORDERED_OPAQUE /** * opaque 64-bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque @@ -1368,8 +1390,12 @@ * supported by encoders with the * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. * - decoding: Set by user. + * + * @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead */ + attribute_deprecated int64_t reordered_opaque; +#endif /** * Hardware accelerator in use @@ -1379,13 +1405,26 @@ const struct AVHWAccel *hwaccel; /** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this. - * - encoding: unused - * - decoding: Set by user + * Legacy hardware accelerator context. + * + * For some hardware acceleration methods, the caller may use this field to + * signal hwaccel-specific data to the codec. The struct pointed to by this + * pointer is hwaccel-dependent and defined in the respective header. Please + * refer to the FFmpeg HW accelerator documentation to know how to fill + * this. + * + * In most cases this field is optional - the necessary information may also + * be provided to libavcodec through @ref hw_frames_ctx or @ref + * hw_device_ctx (see avcodec_get_hw_config()). However, in some cases it + * may be the only method of signalling some (optional) information. + * + * The struct and its contents are owned by the caller. + * + * - encoding: May be set by the caller before avcodec_open2(). Must remain + * valid until avcodec_free_context(). + * - decoding: May be set by the caller in the get_format() callback. + * Must remain valid until the next get_format() call, + * or avcodec_free_context() (whichever comes first). */ void *hwaccel_context; @@ -1481,27 +1520,6 @@ */ int active_thread_type; -#if FF_API_THREAD_SAFE_CALLBACKS - /** - * Set by the client if its custom get_buffer() callback can be called - * synchronously from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - * - * @deprecated the custom get_buffer2() callback should always be - * thread-safe. Thread-unsafe get_buffer2() implementations will be - * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words, - * libavcodec will behave as if this field was always set to 1. - * Callers that want to be forward compatible with future libavcodec - * versions should wrap access to this field in - * #if LIBAVCODEC_VERSION_MAJOR < 60 - */ - attribute_deprecated - int thread_safe_callbacks; -#endif - /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. @@ -1802,17 +1820,6 @@ */ int seek_preroll; -#if FF_API_DEBUG_MV - /** - * @deprecated unused - */ - attribute_deprecated - int debug_mv; -#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames -#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames -#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames -#endif - /** * custom intra quantization matrix * - encoding: Set by user, can be NULL. @@ -1879,15 +1886,6 @@ */ AVBufferRef *hw_frames_ctx; -#if FF_API_SUB_TEXT_FORMAT - /** - * @deprecated unused - */ - attribute_deprecated - int sub_text_format; -#define FF_SUB_TEXT_FMT_ASS 0 -#endif - /** * Audio only. The amount of padding (in samples) appended by the encoder to * the end of the audio. I.e. this number of decoded samples must be @@ -2054,6 +2052,17 @@ * The decoder can then override during decoding as needed. */ AVChannelLayout ch_layout; + + /** + * Frame counter, set by libavcodec. + * + * - decoding: total number of frames returned from the decoder so far. + * - encoding: total number of frames passed to the encoder so far. + * + * @note the counter is not incremented if encoding/decoding resulted in + * an error. + */ + int64_t frame_num; } AVCodecContext; /** @@ -2251,6 +2260,22 @@ #define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2) /** + * Some hardware decoders (namely nvdec) can either output direct decoder + * surfaces, or make an on-device copy and return said copy. + * There is a hard limit on how many decoder surfaces there can be, and it + * cannot be accurately guessed ahead of time. + * For some processing chains, this can be okay, but others will run into the + * limit and in turn produce very confusing errors that require fine tuning of + * more or less obscure options by the user, or in extreme cases cannot be + * resolved at all without inserting an avfilter that forces a copy. + * + * Thus, the hwaccel will by default make a copy for safety and resilience. + * If a users really wants to minimize the amount of copies, they can set this + * flag and ensure their processing chain does not exhaust the surface pool. + */ +#define AV_HWACCEL_FLAG_UNSAFE_OUTPUT (1 << 3) + +/** * @} */ @@ -2355,14 +2380,6 @@ */ const AVClass *avcodec_get_class(void); -#if FF_API_GET_FRAME_CLASS -/** - * @deprecated This function should not be used. - */ -attribute_deprecated -const AVClass *avcodec_get_frame_class(void); -#endif - /** * Get the AVClass for AVSubtitleRect. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. @@ -2493,6 +2510,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]); +#ifdef FF_API_AVCODEC_CHROMA_POS /** * Converts AVChromaLocation to swscale x/y chroma position. * @@ -2501,7 +2519,9 @@ * * @param xpos horizontal chroma sample position * @param ypos vertical chroma sample position + * @deprecated Use av_chroma_location_enum_to_pos() instead. */ + attribute_deprecated int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos); /** @@ -2512,8 +2532,11 @@ * * @param xpos horizontal chroma sample position * @param ypos vertical chroma sample position + * @deprecated Use av_chroma_location_pos_to_enum() instead. */ + attribute_deprecated enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); +#endif /** * Decode a subtitle message. @@ -2543,8 +2566,7 @@ * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt); + int *got_sub_ptr, const AVPacket *avpkt); /** * Supply raw packet data as input to a decoder. @@ -2580,40 +2602,41 @@ * still has frames buffered, it will return them after sending * a flush packet. * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_frame() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) input is not accepted in the current state - user + * must read output with avcodec_receive_frame() (once + * all output is read, the packet should be resent, + * and the call will not fail with EAGAIN). + * @retval AVERROR_EOF the decoder has been flushed, and no new packets can be + * sent to it (also returned if more than 1 flush + * packet is sent) + * @retval AVERROR(EINVAL) codec not opened, it is an encoder, or requires flush + * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar + * @retval "another negative error code" legitimate decoding errors */ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); /** - * Return decoded output data from a decoder. + * Return decoded output data from a decoder or encoder (when the + * AV_CODEC_FLAG_RECON_FRAME flag is used). * * @param avctx codec context * @param frame This will be set to a reference-counted video or audio * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call + * codec. Note that the function will always call * av_frame_unref(frame) before doing anything else. * - * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available in this state - user must try - * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder - * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters - * with respect to first decoded frame. Applicable - * when flag AV_CODEC_FLAG_DROPCHANGED is set. - * other negative values: legitimate decoding errors + * @retval 0 success, a frame was returned + * @retval AVERROR(EAGAIN) output is not available in this state - user must + * try to send new input + * @retval AVERROR_EOF the codec has been fully flushed, and there will be + * no more output frames + * @retval AVERROR(EINVAL) codec not opened, or it is an encoder without the + * AV_CODEC_FLAG_RECON_FRAME flag enabled + * @retval AVERROR_INPUT_CHANGED current decoded frame has changed parameters with + * respect to first decoded frame. Applicable when flag + * AV_CODEC_FLAG_DROPCHANGED is set. + * @retval "other negative error code" legitimate decoding errors */ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); @@ -2640,16 +2663,16 @@ * If it is not set, frame->nb_samples must be equal to * avctx->frame_size for all frames except the last. * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_packet() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate encoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) input is not accepted in the current state - user must + * read output with avcodec_receive_packet() (once all + * output is read, the packet should be resent, and the + * call will not fail with EAGAIN). + * @retval AVERROR_EOF the encoder has been flushed, and no new frames can + * be sent to it + * @retval AVERROR(EINVAL) codec not opened, it is a decoder, or requires flush + * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar + * @retval "another negative error code" legitimate encoding errors */ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); @@ -2660,13 +2683,13 @@ * @param avpkt This will be set to a reference-counted packet allocated by the * encoder. Note that the function will always call * av_packet_unref(avpkt) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available in the current state - user - * must try to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is a decoder - * other errors: legitimate encoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) output is not available in the current state - user must + * try to send input + * @retval AVERROR_EOF the encoder has been fully flushed, and there will be no + * more output packets + * @retval AVERROR(EINVAL) codec not opened, or it is a decoder + * @retval "another negative error code" legitimate encoding errors */ int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); @@ -2780,10 +2803,10 @@ */ enum AVPictureStructure { - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME, //< coded as frame + AV_PICTURE_STRUCTURE_UNKNOWN, ///< unknown + AV_PICTURE_STRUCTURE_TOP_FIELD, ///< coded as top field + AV_PICTURE_STRUCTURE_BOTTOM_FIELD, ///< coded as bottom field + AV_PICTURE_STRUCTURE_FRAME, ///< coded as frame }; typedef struct AVCodecParserContext { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avpacket.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avpacket.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avpacket.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avpacket.c 2023-03-03 13:29:59.000000000 +0000 @@ -316,7 +316,7 @@ const AVDictionaryEntry *t = NULL; size_t total_length = 0; - while ((t = av_dict_get(dict, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(dict, t))) { for (int i = 0; i < 2; i++) { const char *str = i ? t->value : t->key; const size_t len = strlen(str) + 1; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avrndec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avrndec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avrndec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avrndec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/imgutils.h" typedef struct { @@ -91,12 +91,12 @@ const FFCodec ff_avrn_decoder = { .p.name = "avrn", - .p.long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"), + CODEC_LONG_NAME("Avid AVI Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVRN, .priv_data_size = sizeof(AVRnContext), .init = init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs2_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs2_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs2_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs2_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -112,9 +112,9 @@ s->height = height; s->coded_width = FFALIGN(width, 8); s->coded_height = FFALIGN(height, 8); - avctx->framerate.num = avctx->time_base.den = + avctx->framerate.num = ff_avs2_frame_rate_tab[frame_rate_code].num; - avctx->framerate.den = avctx->time_base.num = + avctx->framerate.den = ff_avs2_frame_rate_tab[frame_rate_code].den; avctx->has_b_frames = FFMAX(avctx->has_b_frames, !low_delay); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs3_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs3_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs3_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs3_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -117,8 +117,8 @@ low_delay = get_bits(&gb, 1); avctx->has_b_frames = FFMAX(avctx->has_b_frames, !low_delay); - avctx->framerate.num = avctx->time_base.den = ff_avs3_frame_rate_tab[ratecode].num; - avctx->framerate.den = avctx->time_base.num = ff_avs3_frame_rate_tab[ratecode].den; + avctx->framerate.num = ff_avs3_frame_rate_tab[ratecode].num; + avctx->framerate.den = ff_avs3_frame_rate_tab[ratecode].den; s->width = s->coded_width = avctx->width; s->height = s->coded_height = avctx->height; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avs.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,8 +21,8 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct AvsContext { AVFrame *frame; @@ -177,7 +177,7 @@ const FFCodec ff_avs_decoder = { .p.name = "avs", - .p.long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), + CODEC_LONG_NAME("AVS (Audio Video Standard) video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVS, .priv_data_size = sizeof(AvsContext), @@ -185,5 +185,4 @@ FF_CODEC_DECODE_CB(avs_decode_frame), .close = avs_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuidec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuidec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuidec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuidec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/intreadwrite.h" static av_cold int avui_decode_init(AVCodecContext *avctx) @@ -121,11 +121,10 @@ const FFCodec ff_avui_decoder = { .p.name = "avui", - .p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), + CODEC_LONG_NAME("Avid Meridien Uncompressed"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVUI, .p.capabilities = AV_CODEC_CAP_DR1, .init = avui_decode_init, FF_CODEC_DECODE_CB(avui_decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuienc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuienc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuienc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/avuienc.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,7 +72,7 @@ } for (i = 0; i <= interlaced; i++) { - uint8_t *src; + const uint8_t *src; if (interlaced && avctx->height == 486) { src = pic->data[0] + (1 - i) * pic->linesize[0]; } else { @@ -93,12 +93,12 @@ const FFCodec ff_avui_encoder = { .p.name = "avui", - .p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), + CODEC_LONG_NAME("Avid Meridien Uncompressed"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVUI, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, .init = avui_encode_init, FF_CODEC_ENCODE_CB(avui_encode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bethsoftvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bethsoftvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bethsoftvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bethsoftvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "bethsoftvideo.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct BethsoftvidContext { AVFrame *frame; @@ -51,16 +51,16 @@ return 0; } -static int set_palette(BethsoftvidContext *ctx) +static int set_palette(BethsoftvidContext *ctx, GetByteContext *g) { uint32_t *palette = (uint32_t *)ctx->frame->data[1]; int a; - if (bytestream2_get_bytes_left(&ctx->g) < 256*3) + if (bytestream2_get_bytes_left(g) < 256*3) return AVERROR_INVALIDDATA; for(a = 0; a < 256; a++){ - palette[a] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->g) * 4; + palette[a] = 0xFFU << 24 | bytestream2_get_be24u(g) * 4; palette[a] |= palette[a] >> 6 & 0x30303; } ctx->frame->palette_has_changed = 1; @@ -79,26 +79,31 @@ int code, ret; int yoffset; + bytestream2_init(&vid->g, avpkt->data, avpkt->size); + block_type = bytestream2_get_byte(&vid->g); + if (block_type < 1 || block_type > 4) + return AVERROR_INVALIDDATA; + if ((ret = ff_reget_buffer(avctx, vid->frame, 0)) < 0) return ret; wrap_to_next_line = vid->frame->linesize[0] - avctx->width; if (avpkt->side_data_elems > 0 && avpkt->side_data[0].type == AV_PKT_DATA_PALETTE) { - bytestream2_init(&vid->g, avpkt->side_data[0].data, + GetByteContext g; + bytestream2_init(&g, avpkt->side_data[0].data, avpkt->side_data[0].size); - if ((ret = set_palette(vid)) < 0) + if ((ret = set_palette(vid, &g)) < 0) return ret; } - bytestream2_init(&vid->g, avpkt->data, avpkt->size); dst = vid->frame->data[0]; frame_end = vid->frame->data[0] + vid->frame->linesize[0] * avctx->height; - switch(block_type = bytestream2_get_byte(&vid->g)){ + switch(block_type){ case PALETTE_BLOCK: { *got_frame = 0; - if ((ret = set_palette(vid)) < 0) { + if ((ret = set_palette(vid, &vid->g)) < 0) { av_log(avctx, AV_LOG_ERROR, "error reading palette\n"); return ret; } @@ -160,7 +165,7 @@ const FFCodec ff_bethsoftvid_decoder = { .p.name = "bethsoftvid", - .p.long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"), + CODEC_LONG_NAME("Bethesda VID video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BETHSOFTVID, .priv_data_size = sizeof(BethsoftvidContext), @@ -168,5 +173,4 @@ .close = bethsoftvid_decode_end, FF_CODEC_DECODE_CB(bethsoftvid_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bfi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bfi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bfi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bfi.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct BFIContext { AVCodecContext *avctx; @@ -66,7 +66,7 @@ bytestream2_init(&g, avpkt->data, buf_size); /* Set frame parameters and palette, if necessary */ - if (!avctx->frame_number) { + if (!avctx->frame_num) { frame->pict_type = AV_PICTURE_TYPE_I; frame->key_frame = 1; /* Setting the palette */ @@ -177,7 +177,7 @@ const FFCodec ff_bfi_decoder = { .p.name = "bfi", - .p.long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"), + CODEC_LONG_NAME("Brute Force & Ignorance"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BFI, .priv_data_size = sizeof(BFIContext), @@ -185,5 +185,4 @@ .close = bfi_decode_close, FF_CODEC_DECODE_CB(bfi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/binkaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/binkaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/binkaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/binkaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,15 +33,14 @@ #include "libavutil/channel_layout.h" #include "libavutil/intfloat.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #define BITSTREAM_READER_LE #include "avcodec.h" -#include "dct.h" #include "decode.h" #include "get_bits.h" #include "codec_internal.h" #include "internal.h" -#include "rdft.h" #include "wma_freqs.h" #define MAX_DCT_CHANNELS 6 @@ -63,10 +62,8 @@ float previous[MAX_DCT_CHANNELS][BINK_BLOCK_MAX_SIZE / 16]; ///< coeffs from previous audio block float quant_table[96]; AVPacket *pkt; - union { - RDFTContext rdft; - DCTContext dct; - } trans; + AVTXContext *tx; + av_tx_fn tx_fn; } BinkAudioContext; @@ -138,12 +135,15 @@ s->first = 1; - if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) - ret = ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R); - else if (CONFIG_BINKAUDIO_DCT_DECODER) - ret = ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III); - else + if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) { + float scale = 0.5; + ret = av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_RDFT, 1, 1 << frame_len_bits, &scale, 0); + } else if (CONFIG_BINKAUDIO_DCT_DECODER) { + float scale = 1.0 / (1 << frame_len_bits); + ret = av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_DCT, 1, 1 << (frame_len_bits - 1), &scale, 0); + } else { av_assert0(0); + } if (ret < 0) return ret; @@ -177,13 +177,12 @@ float q, quant[25]; int width, coeff; GetBitContext *gb = &s->gb; + LOCAL_ALIGNED_32(float, coeffs, [4098]); if (use_dct) skip_bits(gb, 2); for (ch = 0; ch < channels; ch++) { - FFTSample *coeffs = out[ch + ch_offset]; - if (s->version_b) { if (get_bits_left(gb) < 64) return AVERROR_INVALIDDATA; @@ -251,10 +250,15 @@ if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) { coeffs[0] /= 0.5; - s->trans.dct.dct_calc(&s->trans.dct, coeffs); + s->tx_fn(s->tx, out[ch + ch_offset], coeffs, sizeof(float)); + } else if (CONFIG_BINKAUDIO_RDFT_DECODER) { + for (int i = 2; i < s->frame_len; i += 2) + coeffs[i + 1] *= -1; + + coeffs[s->frame_len + 0] = coeffs[1]; + coeffs[s->frame_len + 1] = coeffs[1] = 0; + s->tx_fn(s->tx, out[ch + ch_offset], coeffs, sizeof(AVComplexFloat)); } - else if (CONFIG_BINKAUDIO_RDFT_DECODER) - s->trans.rdft.rdft_calc(&s->trans.rdft, coeffs); } for (ch = 0; ch < channels; ch++) { @@ -278,11 +282,7 @@ static av_cold int decode_end(AVCodecContext *avctx) { BinkAudioContext * s = avctx->priv_data; - if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) - ff_rdft_end(&s->trans.rdft); - else if (CONFIG_BINKAUDIO_DCT_DECODER) - ff_dct_end(&s->trans.dct); - + av_tx_uninit(&s->tx); return 0; } @@ -296,9 +296,10 @@ { BinkAudioContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; - int ret; + int new_pkt, ret; again: + new_pkt = !s->pkt->data; if (!s->pkt->data) { ret = ff_decode_get_packet(avctx, s->pkt); if (ret < 0) { @@ -325,6 +326,8 @@ frame->nb_samples = s->frame_len; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; + if (!new_pkt) + frame->pts = AV_NOPTS_VALUE; } if (decode_block(s, (float **)frame->extended_data, @@ -367,7 +370,7 @@ const FFCodec ff_binkaudio_rdft_decoder = { .p.name = "binkaudio_rdft", - .p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"), + CODEC_LONG_NAME("Bink Audio (RDFT)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_BINKAUDIO_RDFT, .priv_data_size = sizeof(BinkAudioContext), @@ -376,12 +379,12 @@ .close = decode_end, FF_CODEC_RECEIVE_FRAME_CB(binkaudio_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_binkaudio_dct_decoder = { .p.name = "binkaudio_dct", - .p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"), + CODEC_LONG_NAME("Bink Audio (DCT)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_BINKAUDIO_DCT, .priv_data_size = sizeof(BinkAudioContext), @@ -390,5 +393,5 @@ .close = decode_end, FF_CODEC_RECEIVE_FRAME_CB(binkaudio_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bink.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bink.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bink.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bink.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,10 +32,9 @@ #include "binkdsp.h" #include "blockdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "hpeldsp.h" -#include "internal.h" -#include "mathops.h" #define BINK_FLAG_ALPHA 0x00100000 #define BINK_FLAG_GRAY 0x00020000 @@ -871,7 +870,7 @@ binkb_init_bundles(c); ref_start = frame->data[plane_idx]; - ref_end = frame->data[plane_idx] + (bh * frame->linesize[plane_idx] + bw) * 8; + ref_end = frame->data[plane_idx] + ((bh - 1) * frame->linesize[plane_idx] + bw - 1) * 8; for (i = 0; i < 64; i++) coordmap[i] = (i & 7) + (i >> 3) * stride; @@ -927,7 +926,7 @@ xoff = binkb_get_value(c, BINKB_SRC_X_OFF); yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias; ref = dst + xoff + yoff * stride; - if (ref < ref_start || ref + 8*stride > ref_end) { + if (ref < ref_start || ref > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { c->put_pixels_tab(dst, ref, stride, 8); @@ -943,7 +942,7 @@ xoff = binkb_get_value(c, BINKB_SRC_X_OFF); yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias; ref = dst + xoff + yoff * stride; - if (ref < ref_start || ref + 8 * stride > ref_end) { + if (ref < ref_start || ref > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { c->put_pixels_tab(dst, ref, stride, 8); @@ -975,7 +974,7 @@ xoff = binkb_get_value(c, BINKB_SRC_X_OFF); yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias; ref = dst + xoff + yoff * stride; - if (ref < ref_start || ref + 8 * stride > ref_end) { + if (ref < ref_start || ref > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { c->put_pixels_tab(dst, ref, stride, 8); @@ -1385,7 +1384,7 @@ avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; avctx->color_range = c->version == 'k' ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; - ff_blockdsp_init(&c->bdsp, avctx); + ff_blockdsp_init(&c->bdsp); ff_hpeldsp_init(&hdsp, avctx->flags); c->put_pixels_tab = hdsp.put_pixels_tab[1][0]; ff_binkdsp_init(&c->binkdsp); @@ -1421,7 +1420,7 @@ const FFCodec ff_bink_decoder = { .p.name = "binkvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Bink video"), + CODEC_LONG_NAME("Bink video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BINKVIDEO, .priv_data_size = sizeof(BinkContext), @@ -1430,5 +1429,5 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bintext.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bintext.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bintext.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bintext.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,7 +36,7 @@ #include "cga_data.h" #include "bintext.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define FONT_WIDTH 8 @@ -219,39 +219,36 @@ #if CONFIG_BINTEXT_DECODER const FFCodec ff_bintext_decoder = { .p.name = "bintext", - .p.long_name = NULL_IF_CONFIG_SMALL("Binary text"), + CODEC_LONG_NAME("Binary text"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BINTEXT, .priv_data_size = sizeof(XbinContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_XBIN_DECODER const FFCodec ff_xbin_decoder = { .p.name = "xbin", - .p.long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"), + CODEC_LONG_NAME("eXtended BINary text"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XBIN, .priv_data_size = sizeof(XbinContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_IDF_DECODER const FFCodec ff_idf_decoder = { .p.name = "idf", - .p.long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"), + CODEC_LONG_NAME("iCEDraw text"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IDF, .priv_data_size = sizeof(XbinContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -143,7 +143,7 @@ const FFCodec ff_bitpacked_decoder = { .p.name = "bitpacked", - .p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), + CODEC_LONG_NAME("Bitpacked"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BITPACKED, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, @@ -154,5 +154,4 @@ MKTAG('U', 'Y', 'V', 'Y'), FF_CODEC_TAGS_END, }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitpacked_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -106,14 +106,14 @@ const FFCodec ff_bitpacked_encoder = { .p.name = "bitpacked", - .p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), + CODEC_LONG_NAME("Bitpacked"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BITPACKED, .priv_data_size = sizeof(struct BitpackedContext), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_filters.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_filters.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_filters.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_filters.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,7 @@ extern const FFBitStreamFilter ff_chomp_bsf; extern const FFBitStreamFilter ff_dump_extradata_bsf; extern const FFBitStreamFilter ff_dca_core_bsf; +extern const FFBitStreamFilter ff_dts2pts_bsf; extern const FFBitStreamFilter ff_dv_error_marker_bsf; extern const FFBitStreamFilter ff_eac3_core_bsf; extern const FFBitStreamFilter ff_extract_extradata_bsf; @@ -42,6 +43,7 @@ extern const FFBitStreamFilter ff_hevc_metadata_bsf; extern const FFBitStreamFilter ff_hevc_mp4toannexb_bsf; extern const FFBitStreamFilter ff_imx_dump_header_bsf; +extern const FFBitStreamFilter ff_media100_to_mjpegb_bsf; extern const FFBitStreamFilter ff_mjpeg2jpeg_bsf; extern const FFBitStreamFilter ff_mjpega_dump_header_bsf; extern const FFBitStreamFilter ff_mp3_header_decompress_bsf; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2016 Alexandra Hájková + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * bitstream reader API header. + */ + +/* + * Bit order (endianness) is controlled by #defining BITSTREAM_BE and/or + * BITSTREAM_LE before #including this header. The corresponding bitreading + * functions are provided as bits_*_be()/bits_*_le() respectively. + * + * If neither or only BITSTREAM_BE is defined, then the default (unsuffixed) + * bits_*() will resolve to the big-endian implementation. If only BITSTREAM_LE + * is defined, little-endian will be the default. + * + * If both are defined, then the default can be controlled by defining at most + * one of BITSTREAM_DEFAULT_LE/BE. When BITSTREAM_DEFAULT_* is not defined, no + * default is provided and you must always explicitly use the _be() or _le() + * variants. + */ + +#ifndef AVCODEC_BITSTREAM_H +#define AVCODEC_BITSTREAM_H + +#include + +#include "config.h" + +#include "libavutil/avassert.h" +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" + +#include "mathops.h" +#include "vlc.h" + +#ifndef UNCHECKED_BITSTREAM_READER +#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER +#endif + +// select the default endianness, if any +#if defined(BITSTREAM_LE) && defined(BITSTREAM_BE) + +# if defined(BITSTREAM_DEFAULT_BE) && defined(BITSTREAM_DEFAULT_LE) +# error "At most one of BITSTREAM_DEFAULT_BE/LE must be defined" +# elif defined(BITSTREAM_DEFAULT_BE) +# define BITS_DEFAULT_BE +# elif defined(BITSTREAM_DEFAULT_LE) +# define BITS_DEFAULT_LE +# endif + +#elif defined(BITSTREAM_LE) +# define BITS_DEFAULT_LE +#else // select BE if nothing is requested explicitly +# define BITS_DEFAULT_BE +# define BITSTREAM_WANT_BE +#endif + +#if defined(BITS_DEFAULT_LE) + +# define BitstreamContext BitstreamContextLE +# define bits_init bits_init_le +# define bits_init8 bits_init8_le +# define bits_tell bits_tell_le +# define bits_size bits_size_le +# define bits_left bits_left_le +# define bits_read_bit bits_read_bit_le +# define bits_read_nz bits_read_nz_le +# define bits_read bits_read_le +# define bits_read_63 bits_read_63_le +# define bits_read_64 bits_read_64_le +# define bits_read_signed bits_read_signed_le +# define bits_read_signed_nz bits_read_signed_nz_le +# define bits_peek_nz bits_peek_nz_le +# define bits_peek bits_peek_le +# define bits_peek_signed bits_peek_signed_le +# define bits_peek_signed_nz bits_peek_signed_nz_le +# define bits_skip bits_skip_le +# define bits_seek bits_seek_le +# define bits_align bits_align_le +# define bits_read_xbits bits_read_xbits_le +# define bits_decode012 bits_decode012_le +# define bits_decode210 bits_decode210_le +# define bits_apply_sign bits_apply_sign_le +# define bits_read_vlc bits_read_vlc_le + +#elif defined(BITS_DEFAULT_BE) + +# define BitstreamContext BitstreamContextBE +# define bits_init bits_init_be +# define bits_init8 bits_init8_be +# define bits_tell bits_tell_be +# define bits_size bits_size_be +# define bits_left bits_left_be +# define bits_read_bit bits_read_bit_be +# define bits_read_nz bits_read_nz_be +# define bits_read bits_read_be +# define bits_read_63 bits_read_63_be +# define bits_read_64 bits_read_64_be +# define bits_read_signed bits_read_signed_be +# define bits_read_signed_nz bits_read_signed_nz_be +# define bits_peek_nz bits_peek_nz_be +# define bits_peek bits_peek_be +# define bits_peek_signed bits_peek_signed_be +# define bits_peek_signed_nz bits_peek_signed_nz_be +# define bits_skip bits_skip_be +# define bits_seek bits_seek_be +# define bits_align bits_align_be +# define bits_read_xbits bits_read_xbits_be +# define bits_decode012 bits_decode012_be +# define bits_decode210 bits_decode210_be +# define bits_apply_sign bits_apply_sign_be +# define bits_read_vlc bits_read_vlc_be + +#endif + +#undef BITS_DEFAULT_LE +#undef BITS_DEFAULT_BE + +#define BITS_RL_VLC(level, run, bc, table, bits, max_depth) \ + do { \ + int n, nb_bits; \ + unsigned int index = bits_peek(bc, bits); \ + level = table[index].level; \ + n = table[index].len; \ + \ + if (max_depth > 1 && n < 0) { \ + bits_skip(bc, bits); \ + \ + nb_bits = -n; \ + \ + index = bits_peek(bc, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + if (max_depth > 2 && n < 0) { \ + bits_skip(bc, nb_bits); \ + nb_bits = -n; \ + \ + index = bits_peek(bc, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + } \ + } \ + run = table[index].run; \ + bits_skip(bc, n); \ + } while (0) + +#endif /* AVCODEC_BITSTREAM_H */ + +// the following is deliberately outside of the standard #include guards + +#if defined(BITSTREAM_LE) && !defined(BITSTREAM_WANT_LE) +# define BITSTREAM_WANT_LE +#endif + +#if defined(BITSTREAM_BE) && !defined(BITSTREAM_WANT_BE) +# define BITSTREAM_WANT_BE +#endif + +#if defined(BITSTREAM_WANT_LE) && !defined(AVCODEC_BITSTREAM_LE) +#define AVCODEC_BITSTREAM_LE + +#define BITSTREAM_TEMPLATE_LE +#include "bitstream_template.h" +#undef BITSTREAM_TEMPLATE_LE + +#endif + +#if defined(BITSTREAM_WANT_BE) && !defined(AVCODEC_BITSTREAM_BE) +#define AVCODEC_BITSTREAM_BE + +#include "bitstream_template.h" + +#endif + +#undef BITSTREAM_WANT_LE +#undef BITSTREAM_WANT_BE diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_template.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_template.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_template.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bitstream_template.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2016 Alexandra Hájková + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef BITSTREAM_TEMPLATE_LE +# define BS_SUFFIX_LOWER _le +# define BS_SUFFIX_UPPER LE +#else +# define BS_SUFFIX_LOWER _be +# define BS_SUFFIX_UPPER BE +#endif + +#define BS_JOIN(x, y, z) x ## y ## z +#define BS_JOIN3(x, y, z) BS_JOIN(x, y, z) +#define BS_FUNC(x) BS_JOIN3(bits_, x, BS_SUFFIX_LOWER) + +#define BSCTX BS_JOIN3(Bitstream, Context, BS_SUFFIX_UPPER) + +typedef struct BSCTX { + uint64_t bits; // stores bits read from the buffer + const uint8_t *buffer, *buffer_end; + const uint8_t *ptr; // pointer to the position inside a buffer + unsigned bits_valid; // number of bits left in bits field + unsigned size_in_bits; +} BSCTX; + +/** + * @return + * - 0 on successful refill + * - a negative number when bitstream end is hit + * + * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. + */ +static inline int BS_FUNC(priv_refill_64)(BSCTX *bc) +{ +#if !UNCHECKED_BITSTREAM_READER + if (bc->ptr >= bc->buffer_end) + return -1; +#endif + +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits = AV_RL64(bc->ptr); +#else + bc->bits = AV_RB64(bc->ptr); +#endif + bc->ptr += 8; + bc->bits_valid = 64; + + return 0; +} + +/** + * @return + * - 0 on successful refill + * - a negative number when bitstream end is hit + * + * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. + */ +static inline int BS_FUNC(priv_refill_32)(BSCTX *bc) +{ +#if !UNCHECKED_BITSTREAM_READER + if (bc->ptr >= bc->buffer_end) + return -1; +#endif + +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; +#else + bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); +#endif + bc->ptr += 4; + bc->bits_valid += 32; + + return 0; +} + +/** + * Initialize BitstreamContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end + * @param bit_size the size of the buffer in bits + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. + */ +static inline int BS_FUNC(init)(BSCTX *bc, const uint8_t *buffer, + unsigned int bit_size) +{ + unsigned int buffer_size; + + if (bit_size > INT_MAX - 7 || !buffer) { + bc->buffer = NULL; + bc->ptr = NULL; + bc->bits_valid = 0; + return AVERROR_INVALIDDATA; + } + + buffer_size = (bit_size + 7) >> 3; + + bc->buffer = buffer; + bc->buffer_end = buffer + buffer_size; + bc->ptr = bc->buffer; + bc->size_in_bits = bit_size; + bc->bits_valid = 0; + bc->bits = 0; + + BS_FUNC(priv_refill_64)(bc); + + return 0; +} + +/** + * Initialize BitstreamContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end + * @param byte_size the size of the buffer in bytes + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow + */ +static inline int BS_FUNC(init8)(BSCTX *bc, const uint8_t *buffer, + unsigned int byte_size) +{ + if (byte_size > INT_MAX / 8) + return AVERROR_INVALIDDATA; + return BS_FUNC(init)(bc, buffer, byte_size * 8); +} + +/** + * Return number of bits already read. + */ +static inline int BS_FUNC(tell)(const BSCTX *bc) +{ + return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; +} + +/** + * Return buffer size in bits. + */ +static inline int BS_FUNC(size)(const BSCTX *bc) +{ + return bc->size_in_bits; +} + +/** + * Return the number of the bits left in a buffer. + */ +static inline int BS_FUNC(left)(const BSCTX *bc) +{ + return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; +} + +static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 64); + +#ifdef BITSTREAM_TEMPLATE_LE + return bc->bits & (UINT64_MAX >> (64 - n)); +#else + return bc->bits >> (64 - n); +#endif +} + +static inline void BS_FUNC(priv_skip_remaining)(BSCTX *bc, unsigned int n) +{ +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits >>= n; +#else + bc->bits <<= n; +#endif + bc->bits_valid -= n; +} + +static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, unsigned int n) +{ + uint64_t ret; + + av_assert2(n > 0 && n < 64); + + ret = BS_FUNC(priv_val_show)(bc, n); + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + +/** + * Return one bit from the buffer. + */ +static inline unsigned int BS_FUNC(read_bit)(BSCTX *bc) +{ + if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) + return 0; + + return BS_FUNC(priv_val_get)(bc, 1); +} + +/** + * Return n bits from the buffer, n has to be in the 1-32 range. + * May be faster than bits_read() when n is not a compile-time constant and is + * known to be non-zero; + */ +static inline uint32_t BS_FUNC(read_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + + if (n > bc->bits_valid) { + if (BS_FUNC(priv_refill_32)(bc) < 0) + bc->bits_valid = n; + } + + return BS_FUNC(priv_val_get)(bc, n); +} + +/** + * Return n bits from the buffer, n has to be in the 0-32 range. + */ +static inline uint32_t BS_FUNC(read)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(read_nz)(bc, n); +} + +/** + * Return n bits from the buffer, n has to be in the 0-63 range. + */ +static inline uint64_t BS_FUNC(read_63)(BSCTX *bc, unsigned int n) +{ + uint64_t ret = 0; + unsigned left = 0; + + av_assert2(n <= 63); + + if (!n) + return 0; + + if (n > bc->bits_valid) { + left = bc->bits_valid; + n -= left; + + if (left) + ret = BS_FUNC(priv_val_get)(bc, left); + + if (BS_FUNC(priv_refill_64)(bc) < 0) + bc->bits_valid = n; + + } + +#ifdef BITSTREAM_TEMPLATE_LE + ret = BS_FUNC(priv_val_get)(bc, n) << left | ret; +#else + ret = BS_FUNC(priv_val_get)(bc, n) | ret << n; +#endif + + return ret; +} + +/** + * Return n bits from the buffer, n has to be in the 0-64 range. + */ +static inline uint64_t BS_FUNC(read_64)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 64); + + if (n == 64) { + uint64_t ret = BS_FUNC(read_63)(bc, 63); +#ifdef BITSTREAM_TEMPLATE_LE + return ret | ((uint64_t)BS_FUNC(read_bit)(bc) << 63); +#else + return (ret << 1) | (uint64_t)BS_FUNC(read_bit)(bc); +#endif + } + return BS_FUNC(read_63)(bc, n); +} + +/** + * Return n bits from the buffer as a signed integer, n has to be in the 1-32 + * range. May be faster than bits_read_signed() when n is not a compile-time + * constant and is known to be non-zero; + */ +static inline int32_t BS_FUNC(read_signed_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + return sign_extend(BS_FUNC(read_nz)(bc, n), n); +} + +/** + * Return n bits from the buffer as a signed integer. + * n has to be in the 0-32 range. + */ +static inline int32_t BS_FUNC(read_signed)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(read_signed_nz)(bc, n); +} + +/** + * Return n bits from the buffer but do not change the buffer state. + * n has to be in the 1-32 range. May + */ +static inline uint32_t BS_FUNC(peek_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + + if (n > bc->bits_valid) + BS_FUNC(priv_refill_32)(bc); + + return BS_FUNC(priv_val_show)(bc, n); +} + +/** + * Return n bits from the buffer but do not change the buffer state. + * n has to be in the 0-32 range. + */ +static inline uint32_t BS_FUNC(peek)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(peek_nz)(bc, n); +} + +/** + * Return n bits from the buffer as a signed integer, do not change the buffer + * state. n has to be in the 1-32 range. May be faster than bits_peek_signed() + * when n is not a compile-time constant and is known to be non-zero; + */ +static inline int BS_FUNC(peek_signed_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + return sign_extend(BS_FUNC(peek_nz)(bc, n), n); +} + +/** + * Return n bits from the buffer as a signed integer, + * do not change the buffer state. + * n has to be in the 0-32 range. + */ +static inline int BS_FUNC(peek_signed)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(peek_signed_nz)(bc, n); +} + +/** + * Skip n bits in the buffer. + */ +static inline void BS_FUNC(skip)(BSCTX *bc, unsigned int n) +{ + if (n < bc->bits_valid) + BS_FUNC(priv_skip_remaining)(bc, n); + else { + n -= bc->bits_valid; + bc->bits = 0; + bc->bits_valid = 0; + + if (n >= 64) { + unsigned int skip = n / 8; + + n -= skip * 8; + bc->ptr += skip; + } + BS_FUNC(priv_refill_64)(bc); + if (n) + BS_FUNC(priv_skip_remaining)(bc, n); + } +} + +/** + * Seek to the given bit position. + */ +static inline void BS_FUNC(seek)(BSCTX *bc, unsigned pos) +{ + bc->ptr = bc->buffer; + bc->bits = 0; + bc->bits_valid = 0; + + BS_FUNC(skip)(bc, pos); +} + +/** + * Skip bits to a byte boundary. + */ +static inline const uint8_t *BS_FUNC(align)(BSCTX *bc) +{ + unsigned int n = -BS_FUNC(tell)(bc) & 7; + if (n) + BS_FUNC(skip)(bc, n); + return bc->buffer + (BS_FUNC(tell)(bc) >> 3); +} + +/** + * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB). + * If MSB not set it is negative. + * @param n length in bits + */ +static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned int n) +{ + int32_t cache = BS_FUNC(peek)(bc, 32); + int sign = ~cache >> 31; + BS_FUNC(priv_skip_remaining)(bc, n); + + return ((((uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign; +} + +/** + * Return decoded truncated unary code for the values 0, 1, 2. + */ +static inline int BS_FUNC(decode012)(BSCTX *bc) +{ + if (!BS_FUNC(read_bit)(bc)) + return 0; + else + return BS_FUNC(read_bit)(bc) + 1; +} + +/** + * Return decoded truncated unary code for the values 2, 1, 0. + */ +static inline int BS_FUNC(decode210)(BSCTX *bc) +{ + if (BS_FUNC(read_bit)(bc)) + return 0; + else + return 2 - BS_FUNC(read_bit)(bc); +} + +/* Read sign bit and flip the sign of the provided value accordingly. */ +static inline int BS_FUNC(apply_sign)(BSCTX *bc, int val) +{ + int sign = BS_FUNC(read_signed)(bc, 1); + return (val ^ sign) - sign; +} + +static inline int BS_FUNC(skip_1stop_8data)(BSCTX *s) +{ + if (BS_FUNC(left)(s) <= 0) + return AVERROR_INVALIDDATA; + + while (BS_FUNC(read_bit)(s)) { + BS_FUNC(skip)(s, 8); + if (BS_FUNC(left)(s) <= 0) + return AVERROR_INVALIDDATA; + } + + return 0; +} + +/** + * Return the LUT element for the given bitstream configuration. + */ +static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, + int *nb_bits, const VLCElem *table) +{ + unsigned idx; + + *nb_bits = -*n; + idx = BS_FUNC(peek)(bc, *nb_bits) + code; + *n = table[idx].len; + + return table[idx].sym; +} + +/** + * 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() + * @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 + * If the vlc code is invalid and max_depth=1, then no bits will be removed. + * If the vlc code is invalid and max_depth>1, then the number of bits removed + * is undefined. + */ +static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, + int bits, int max_depth) +{ + int nb_bits; + unsigned idx = BS_FUNC(peek)(bc, bits); + int code = table[idx].sym; + int 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); + } + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return code; +} + +#undef BSCTX +#undef BS_FUNC +#undef BS_JOIN3 +#undef BS_JOIN +#undef BS_SUFFIX_UPPER +#undef BS_SUFFIX_LOWER diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,6 @@ #include "config.h" #include "libavutil/attributes.h" -#include "avcodec.h" #include "blockdsp.h" static void clear_block_c(int16_t *block) @@ -56,7 +55,7 @@ } } -av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx) +av_cold void ff_blockdsp_init(BlockDSPContext *c) { c->clear_block = clear_block_c; c->clear_blocks = clear_blocks_c; @@ -71,7 +70,7 @@ #elif ARCH_PPC ff_blockdsp_init_ppc(c); #elif ARCH_X86 - ff_blockdsp_init_x86(c, avctx); + ff_blockdsp_init_x86(c); #elif ARCH_MIPS ff_blockdsp_init_mips(c); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/blockdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,6 @@ #include #include -#include "avcodec.h" - /* add and put pixel (decoding) * Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16. * h for op_pixels_func is limited to { width / 2, width }, @@ -38,12 +36,12 @@ op_fill_func fill_block_tab[2]; } BlockDSPContext; -void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx); +void ff_blockdsp_init(BlockDSPContext *c); void ff_blockdsp_init_alpha(BlockDSPContext *c); void ff_blockdsp_init_arm(BlockDSPContext *c); void ff_blockdsp_init_ppc(BlockDSPContext *c); -void ff_blockdsp_init_x86(BlockDSPContext *c, AVCodecContext *avctx); +void ff_blockdsp_init_x86(BlockDSPContext *c); void ff_blockdsp_init_mips(BlockDSPContext *c); #endif /* AVCODEC_BLOCKDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmp.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "bytestream.h" #include "bmp.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "msrledec.h" static int bmp_decode_frame(AVCodecContext *avctx, AVFrame *p, @@ -366,7 +366,7 @@ const FFCodec ff_bmp_decoder = { .p.name = "bmp", - .p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), + CODEC_LONG_NAME("BMP (Windows and OS/2 bitmap)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BMP, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmpenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,7 +72,8 @@ uint32_t palette256[256]; int pad_bytes_per_row, pal_entries = 0, compression = BMP_RGB; int bit_count = avctx->bits_per_coded_sample; - uint8_t *ptr, *buf; + const uint8_t *ptr; + uint8_t *buf; switch (avctx->pix_fmt) { case AV_PIX_FMT_RGB444: @@ -157,10 +158,10 @@ const FFCodec ff_bmp_encoder = { .p.name = "bmp", - .p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), + CODEC_LONG_NAME("BMP (Windows and OS/2 bitmap)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BMP, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = bmp_encode_init, FF_CODEC_ENCODE_CB(bmp_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ @@ -170,5 +171,4 @@ AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static const int bmv_aud_mults[16] = { 16512, 8256, 4128, 2064, 1032, 516, 258, 192, 129, 88, 64, 56, 48, 40, 36, 32 @@ -80,11 +80,10 @@ const FFCodec ff_bmv_audio_decoder = { .p.name = "bmv_audio", - .p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"), + CODEC_LONG_NAME("Discworld II BMV audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_BMV_AUDIO, .init = bmv_aud_decode_init, FF_CODEC_DECODE_CB(bmv_aud_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bmvvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" enum BMVFlags{ BMV_NOP = 0, @@ -287,12 +287,11 @@ const FFCodec ff_bmv_video_decoder = { .p.name = "bmv_video", - .p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"), + CODEC_LONG_NAME("Discworld II BMV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BMV_VIDEO, .priv_data_size = sizeof(BMVDecContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bonk.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bonk.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bonk.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bonk.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,431 @@ +/* + * Bonk audio decoder + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "bytestream.h" + +typedef struct BitCount { + uint8_t bit; + unsigned count; +} BitCount; + +typedef struct BonkContext { + GetBitContext gb; + int skip; + + uint8_t *bitstream; + int64_t max_framesize; + int bitstream_size; + int bitstream_index; + + uint64_t nb_samples; + int lossless; + int mid_side; + int n_taps; + int down_sampling; + int samples_per_packet; + + int state[2][2048], k[2048]; + int *samples[2]; + int *input_samples; + uint8_t quant[2048]; + BitCount *bits; +} BonkContext; + +static av_cold int bonk_close(AVCodecContext *avctx) +{ + BonkContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + av_freep(&s->input_samples); + av_freep(&s->samples[0]); + av_freep(&s->samples[1]); + av_freep(&s->bits); + s->bitstream_size = 0; + + return 0; +} + +static av_cold int bonk_init(AVCodecContext *avctx) +{ + BonkContext *s = avctx->priv_data; + + avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + if (avctx->extradata_size < 17) + return AVERROR(EINVAL); + + if (avctx->extradata[0]) { + av_log(avctx, AV_LOG_ERROR, "Unsupported version.\n"); + return AVERROR_INVALIDDATA; + } + + if (avctx->ch_layout.nb_channels < 1 || avctx->ch_layout.nb_channels > 2) + return AVERROR_INVALIDDATA; + + s->nb_samples = AV_RL32(avctx->extradata + 1) / avctx->ch_layout.nb_channels; + if (!s->nb_samples) + s->nb_samples = UINT64_MAX; + s->lossless = avctx->extradata[10] != 0; + s->mid_side = avctx->extradata[11] != 0; + s->n_taps = AV_RL16(avctx->extradata + 12); + if (!s->n_taps || s->n_taps > 2048) + return AVERROR(EINVAL); + + s->down_sampling = avctx->extradata[14]; + if (!s->down_sampling) + return AVERROR(EINVAL); + + s->samples_per_packet = AV_RL16(avctx->extradata + 15); + if (!s->samples_per_packet) + return AVERROR(EINVAL); + + if (s->down_sampling * s->samples_per_packet < s->n_taps) + return AVERROR_INVALIDDATA; + + s->max_framesize = s->samples_per_packet * avctx->ch_layout.nb_channels * s->down_sampling * 16LL; + if (s->max_framesize > (INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) / 8) + return AVERROR_INVALIDDATA; + + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + s->input_samples = av_calloc(s->samples_per_packet, sizeof(*s->input_samples)); + if (!s->input_samples) + return AVERROR(ENOMEM); + + s->samples[0] = av_calloc(s->samples_per_packet * s->down_sampling, sizeof(*s->samples[0])); + s->samples[1] = av_calloc(s->samples_per_packet * s->down_sampling, sizeof(*s->samples[0])); + if (!s->samples[0] || !s->samples[1]) + return AVERROR(ENOMEM); + + s->bits = av_calloc(s->max_framesize * 8, sizeof(*s->bits)); + if (!s->bits) + return AVERROR(ENOMEM); + + for (int i = 0; i < 512; i++) { + s->quant[i] = sqrt(i + 1); + } + + return 0; +} + +static unsigned read_uint_max(BonkContext *s, uint32_t max) +{ + unsigned value = 0; + + if (max == 0) + return 0; + + av_assert0(max >> 31 == 0); + + for (unsigned i = 1; i <= max - value; i+=i) + if (get_bits1(&s->gb)) + value += i; + + return value; +} + +static int intlist_read(BonkContext *s, int *buf, int entries, int base_2_part) +{ + int i, low_bits = 0, x = 0, max_x; + int n_zeros = 0, step = 256, dominant = 0; + int pos = 0, level = 0; + BitCount *bits = s->bits; + + memset(buf, 0, entries * sizeof(*buf)); + if (base_2_part) { + low_bits = get_bits(&s->gb, 4); + + if (low_bits) + for (i = 0; i < entries; i++) + buf[i] = get_bits(&s->gb, low_bits); + } + + while (n_zeros < entries) { + int steplet = step >> 8; + + if (get_bits_left(&s->gb) <= 0) + return AVERROR_INVALIDDATA; + + if (!get_bits1(&s->gb)) { + av_assert0(steplet >= 0); + + if (steplet > 0) { + bits[x ].bit = dominant; + bits[x++].count = steplet; + } + + if (!dominant) + n_zeros += steplet; + + if (step > INT32_MAX*8LL/9 + 1) + return AVERROR_INVALIDDATA; + step += step / 8; + } else if (steplet > 0) { + int actual_run = read_uint_max(s, steplet - 1); + + av_assert0(actual_run >= 0); + + if (actual_run > 0) { + bits[x ].bit = dominant; + bits[x++].count = actual_run; + } + + bits[x ].bit = !dominant; + bits[x++].count = 1; + + if (!dominant) + n_zeros += actual_run; + else + n_zeros++; + + step -= step / 8; + } + + if (step < 256) { + step = 65536 / step; + dominant = !dominant; + } + } + + max_x = x; + x = 0; + n_zeros = 0; + for (i = 0; n_zeros < entries; i++) { + if (pos >= entries) { + pos = 0; + level += 1 << low_bits; + } + + if (level > 1 << 16) + return AVERROR_INVALIDDATA; + + if (x >= max_x) + return AVERROR_INVALIDDATA; + + if (buf[pos] >= level) { + if (bits[x].bit) + buf[pos] += 1 << low_bits; + else + n_zeros++; + + bits[x].count--; + x += bits[x].count == 0; + } + + pos++; + } + + for (i = 0; i < entries; i++) { + if (buf[i] && get_bits1(&s->gb)) { + buf[i] = -buf[i]; + } + } + + return 0; +} + +static inline int shift_down(int a, int b) +{ + return (a >> b) + (a < 0); +} + +static inline int shift(int a, int b) +{ + return a + (1 << b - 1) >> b; +} + +#define LATTICE_SHIFT 10 +#define SAMPLE_SHIFT 4 +#define SAMPLE_FACTOR (1 << SAMPLE_SHIFT) + +static int predictor_calc_error(int *k, int *state, int order, int error) +{ + int i, x = error - shift_down(k[order-1] * state[order-1], LATTICE_SHIFT); + int *k_ptr = &(k[order-2]), + *state_ptr = &(state[order-2]); + + 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 * state_value, LATTICE_SHIFT); + state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); + } + + // don't drift too far, to avoid overflows + x = av_clip(x, -(SAMPLE_FACTOR << 16), SAMPLE_FACTOR << 16); + + state[0] = x; + + return x; +} + +static void predictor_init_state(int *k, unsigned *state, int order) +{ + for (int i = order - 2; i >= 0; i--) { + unsigned x = state[i]; + + for (int j = 0, p = i + 1; p < order; j++, p++) { + int tmp = x + shift_down(k[j] * state[p], LATTICE_SHIFT); + + state[p] += shift_down(k[j] * x, LATTICE_SHIFT); + x = tmp; + } + } +} + +static int bonk_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *pkt) +{ + BonkContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + const uint8_t *buf; + int quant, n, buf_size, input_buf_size; + int ret = AVERROR_INVALIDDATA; + + if ((!pkt->size && !s->bitstream_size) || s->nb_samples == 0) { + *got_frame_ptr = 0; + return pkt->size; + } + + buf_size = FFMIN(pkt->size, s->max_framesize - s->bitstream_size); + input_buf_size = buf_size; + if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE > s->max_framesize) { + memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size); + s->bitstream_index = 0; + } + if (pkt->data) + memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], pkt->data, buf_size); + buf = &s->bitstream[s->bitstream_index]; + buf_size += s->bitstream_size; + s->bitstream_size = buf_size; + if (buf_size < s->max_framesize && pkt->data) { + *got_frame_ptr = 0; + return input_buf_size; + } + + frame->nb_samples = FFMIN(s->samples_per_packet * s->down_sampling, s->nb_samples); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto fail; + + if ((ret = init_get_bits8(gb, buf, buf_size)) < 0) + goto fail; + + skip_bits(gb, s->skip); + if ((ret = intlist_read(s, s->k, s->n_taps, 0)) < 0) + goto fail; + + for (int i = 0; i < s->n_taps; i++) + s->k[i] *= s->quant[i]; + quant = s->lossless ? 1 : get_bits(&s->gb, 16) * SAMPLE_FACTOR; + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + const int samples_per_packet = s->samples_per_packet; + const int down_sampling = s->down_sampling; + const int offset = samples_per_packet * down_sampling - 1; + int *state = s->state[ch]; + int *sample = s->samples[ch]; + + predictor_init_state(s->k, state, s->n_taps); + if ((ret = intlist_read(s, s->input_samples, samples_per_packet, 1)) < 0) + goto fail; + + for (int i = 0; i < samples_per_packet; i++) { + for (int j = 0; j < s->down_sampling - 1; j++) { + sample[0] = predictor_calc_error(s->k, state, s->n_taps, 0); + sample++; + } + + sample[0] = predictor_calc_error(s->k, state, s->n_taps, s->input_samples[i] * (unsigned)quant); + sample++; + } + + sample = s->samples[ch]; + for (int i = 0; i < s->n_taps; i++) + state[i] = sample[offset - i]; + } + + if (s->mid_side && avctx->ch_layout.nb_channels == 2) { + for (int i = 0; i < frame->nb_samples; i++) { + s->samples[1][i] += shift(s->samples[0][i], 1); + s->samples[0][i] -= s->samples[1][i]; + } + } + + if (!s->lossless) { + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + int *samples = s->samples[ch]; + for (int i = 0; i < frame->nb_samples; i++) + samples[i] = shift(samples[i], 4); + } + } + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + int16_t *osamples = (int16_t *)frame->extended_data[ch]; + int *samples = s->samples[ch]; + for (int i = 0; i < frame->nb_samples; i++) + osamples[i] = av_clip_int16(samples[i]); + } + + s->nb_samples -= frame->nb_samples; + + s->skip = get_bits_count(gb) - 8 * (get_bits_count(gb) / 8); + n = get_bits_count(gb) / 8; + + if (n > buf_size) { +fail: + s->bitstream_size = 0; + s->bitstream_index = 0; + return AVERROR_INVALIDDATA; + } + + *got_frame_ptr = 1; + + if (s->bitstream_size) { + s->bitstream_index += n; + s->bitstream_size -= n; + return input_buf_size; + } + return n; +} + +const FFCodec ff_bonk_decoder = { + .p.name = "bonk", + CODEC_LONG_NAME("Bonk audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_BONK, + .priv_data_size = sizeof(BonkContext), + .init = bonk_init, + FF_CODEC_DECODE_CB(bonk_decode), + .close = bonk_close, + .p.capabilities = AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_SUBFRAMES, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_NONE }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/brenderpix.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/brenderpix.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/brenderpix.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/brenderpix.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define HEADER1_CHUNK 0x03 #define HEADER2_CHUNK 0x3D @@ -286,7 +286,7 @@ const FFCodec ff_brender_pix_decoder = { .p.name = "brender_pix", - .p.long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"), + CODEC_LONG_NAME("BRender PIX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BRENDER_PIX, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bsf.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bsf.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bsf.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bsf.h 2023-03-03 13:29:59.000000000 +0000 @@ -164,6 +164,8 @@ /** * Prepare the filter for use, after all the parameters and options have been * set. + * + * @param ctx a AVBSFContext previously allocated with av_bsf_alloc() */ int av_bsf_init(AVBSFContext *ctx); @@ -174,6 +176,7 @@ * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or * AVERROR_EOF. * + * @param ctx an initialized AVBSFContext * @param pkt the packet to filter. The bitstream filter will take ownership of * the packet and reset the contents of pkt. pkt is not touched if an error occurs. * If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), @@ -192,6 +195,7 @@ /** * Retrieve a filtered packet. * + * @param ctx an initialized AVBSFContext * @param[out] pkt this struct will be filled with the contents of the filtered * packet. It is owned by the caller and must be freed using * av_packet_unref() when it is no longer needed. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -51,7 +51,9 @@ c->bswap_buf = bswap_buf; c->bswap16_buf = bswap16_buf; -#if ARCH_X86 +#if ARCH_RISCV + ff_bswapdsp_init_riscv(c); +#elif ARCH_X86 ff_bswapdsp_init_x86(c); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/bswapdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ } BswapDSPContext; void ff_bswapdsp_init(BswapDSPContext *c); +void ff_bswapdsp_init_riscv(BswapDSPContext *c); void ff_bswapdsp_init_x86(BswapDSPContext *c); #endif /* AVCODEC_BSWAPDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/c93.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/c93.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/c93.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/c93.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct C93DecoderContext { AVFrame *pictures[2]; @@ -130,7 +130,8 @@ AVFrame * const oldpic = c93->pictures[c93->currentpic^1]; GetByteContext gb; uint8_t *out; - int stride, ret, i, x, y, b, bt = 0; + int ret, i, x, y, b, bt = 0; + ptrdiff_t stride; if ((ret = ff_set_dimensions(avctx, WIDTH, HEIGHT)) < 0) return ret; @@ -156,7 +157,6 @@ out = newpic->data[0] + y * stride; for (x = 0; x < WIDTH; x += 8) { uint8_t *copy_from = oldpic->data[0]; - unsigned int offset, j; uint8_t cols[4], grps[4]; C93BlockType block_type; @@ -165,16 +165,17 @@ block_type= bt & 0x0F; switch (block_type) { - case C93_8X8_FROM_PREV: - offset = bytestream2_get_le16(&gb); + case C93_8X8_FROM_PREV: { + int offset = bytestream2_get_le16(&gb); if ((ret = copy_block(avctx, out, copy_from, offset, 8, stride)) < 0) return ret; break; + } case C93_4X4_FROM_CURR: copy_from = newpic->data[0]; case C93_4X4_FROM_PREV: - for (j = 0; j < 8; j += 4) { + for (int j = 0; j < 8; j += 4) { for (i = 0; i < 8; i += 4) { int offset = bytestream2_get_le16(&gb); int from_x = offset % WIDTH; @@ -203,7 +204,7 @@ case C93_4X4_2COLOR: case C93_4X4_4COLOR: case C93_4X4_4COLOR_GRP: - for (j = 0; j < 8; j += 4) { + for (int j = 0; j < 8; j += 4) { for (i = 0; i < 8; i += 4) { if (block_type == C93_4X4_2COLOR) { bytestream2_get_buffer(&gb, cols, 2); @@ -226,7 +227,7 @@ break; case C93_8X8_INTRA: - for (j = 0; j < 8; j++) + for (int j = 0; j < 8; j++) bytestream2_get_buffer(&gb, out + j*stride, 8); break; @@ -260,7 +261,7 @@ const FFCodec ff_c93_decoder = { .p.name = "c93", - .p.long_name = NULL_IF_CONFIG_SMALL("Interplay C93"), + CODEC_LONG_NAME("Interplay C93"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_C93, .priv_data_size = sizeof(C93DecoderContext), @@ -268,5 +269,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.c 2023-03-03 13:29:59.000000000 +0000 @@ -792,15 +792,14 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { AVSContext *h = avctx->priv_data; + uint8_t permutation[64]; - ff_blockdsp_init(&h->bdsp, avctx); + ff_blockdsp_init(&h->bdsp); ff_h264chroma_init(&h->h264chroma, 8); - ff_idctdsp_init(&h->idsp, avctx); ff_videodsp_init(&h->vdsp, 8); - ff_cavsdsp_init(&h->cdsp, avctx); - ff_init_scantable_permutation(h->idsp.idct_permutation, - h->cdsp.idct_perm); - ff_init_scantable(h->idsp.idct_permutation, &h->scantable, ff_zigzag_direct); + ff_cavsdsp_init(&h->cdsp); + ff_init_scantable_permutation(permutation, h->cdsp.idct_perm); + ff_permute_scantable(h->permutated_scantable, ff_zigzag_direct, permutation); h->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_YUV420P; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "golomb.h" #include "cavs.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" #include "mpeg12data.h" #include "startcode.h" @@ -521,7 +521,7 @@ { int round = 1 << (shift - 1); int pos = -1; - const uint8_t *scantab = h->scantable.permutated; + const uint8_t *scantab = h->permutated_scantable; /* inverse scan and dequantization */ while (--coeff_num >= 0) { @@ -1317,7 +1317,7 @@ const FFCodec ff_cavs_decoder = { .p.name = "cavs", - .p.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), + CODEC_LONG_NAME("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CAVS, .priv_data_size = sizeof(AVSContext), @@ -1326,5 +1326,5 @@ FF_CODEC_DECODE_CB(cavs_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .flush = cavs_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "idctdsp.h" #include "mathops.h" #include "cavsdsp.h" @@ -427,13 +425,14 @@ \ static void OPNAME ## cavs_filt16_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, ptrdiff_t dstStride, ptrdiff_t srcStride)\ { \ - OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, src2 , dstStride, srcStride); \ - OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \ + OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, FULL ? src2 : NULL, dstStride, srcStride); \ + OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, FULL ? src2 + 8 : NULL, dstStride, srcStride); \ src1 += 8*srcStride;\ - src2 += 8*srcStride;\ + if (FULL) \ + src2 += 8*srcStride;\ dst += 8*dstStride;\ - OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, src2 , dstStride, srcStride); \ - OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \ + OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, FULL ? src2 : NULL, dstStride, srcStride); \ + OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, FULL ? src2 + 8 : NULL, dstStride, srcStride); \ }\ #define CAVS_MC(OPNAME, SIZE) \ @@ -494,22 +493,22 @@ \ static void OPNAME ## cavs_qpel ## SIZE ## _mc21_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ - OPNAME ## cavs_filt ## SIZE ## _hv_ff(dst, src, src+stride+1,stride, stride); \ + OPNAME ## cavs_filt ## SIZE ## _hv_ff(dst, src, NULL, stride, stride); \ }\ \ static void OPNAME ## cavs_qpel ## SIZE ## _mc12_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ - OPNAME ## cavs_filt ## SIZE ## _hv_ii(dst, src, src+stride+1,stride, stride); \ + OPNAME ## cavs_filt ## SIZE ## _hv_ii(dst, src, NULL, stride, stride); \ }\ \ static void OPNAME ## cavs_qpel ## SIZE ## _mc32_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ - OPNAME ## cavs_filt ## SIZE ## _hv_kk(dst, src, src+stride+1,stride, stride); \ + OPNAME ## cavs_filt ## SIZE ## _hv_kk(dst, src, NULL, stride, stride); \ }\ \ static void OPNAME ## cavs_qpel ## SIZE ## _mc23_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ - OPNAME ## cavs_filt ## SIZE ## _hv_qq(dst, src, src+stride+1,stride, stride); \ + OPNAME ## cavs_filt ## SIZE ## _hv_qq(dst, src, NULL, stride, stride); \ }\ #define op_put1(a, b) a = cm[((b)+4)>>3] @@ -548,7 +547,8 @@ #define put_cavs_qpel16_mc00_c ff_put_pixels16x16_c #define avg_cavs_qpel16_mc00_c ff_avg_pixels16x16_c -av_cold void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx) { +av_cold void ff_cavsdsp_init(CAVSDSPContext* c) +{ #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \ c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \ @@ -578,6 +578,6 @@ c->idct_perm = FF_IDCT_PERM_NONE; #if ARCH_X86 - ff_cavsdsp_init_x86(c, avctx); + ff_cavsdsp_init_x86(c); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavsdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,9 +22,9 @@ #ifndef AVCODEC_CAVSDSP_H #define AVCODEC_CAVSDSP_H +#include #include -#include "avcodec.h" #include "qpeldsp.h" typedef struct CAVSDSPContext { @@ -38,7 +38,7 @@ int idct_perm; } CAVSDSPContext; -void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx); -void ff_cavsdsp_init_x86(CAVSDSPContext* c, AVCodecContext *avctx); +void ff_cavsdsp_init(CAVSDSPContext* c); +void ff_cavsdsp_init_x86(CAVSDSPContext* c); #endif /* AVCODEC_CAVSDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cavs.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,16 @@ #ifndef AVCODEC_CAVS_H #define AVCODEC_CAVS_H +#include +#include + +#include "libavutil/frame.h" #include "libavutil/mem_internal.h" +#include "avcodec.h" #include "cavsdsp.h" #include "blockdsp.h" #include "h264chroma.h" -#include "idctdsp.h" #include "get_bits.h" #include "videodsp.h" @@ -166,7 +170,6 @@ AVCodecContext *avctx; BlockDSPContext bdsp; H264ChromaContext h264chroma; - IDCTDSPContext idsp; VideoDSPContext vdsp; CAVSDSPContext cdsp; GetBitContext gb; @@ -220,7 +223,7 @@ int qp_fixed; int pic_qp_fixed; int cbp; - ScanTable scantable; + uint8_t permutated_scantable[64]; /** intra prediction is done with un-deblocked samples they are saved here before deblocking the MB */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1.c 2023-03-03 13:29:59.000000000 +0000 @@ -878,7 +878,7 @@ GetBitContext gbc; int err, start_pos, end_pos; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; obu = unit->content; @@ -1058,15 +1058,31 @@ AV1RawTileData *td; size_t header_size; int err, start_pos, end_pos, data_pos; + CodedBitstreamAV1Context av1ctx; // OBUs in the normal bitstream format must contain a size field // in every OBU (in annex B it is optional, but we don't support // writing that). obu->header.obu_has_size_field = 1; + av1ctx = *priv; + + if (priv->sequence_header_ref) { + av1ctx.sequence_header_ref = av_buffer_ref(priv->sequence_header_ref); + if (!av1ctx.sequence_header_ref) + return AVERROR(ENOMEM); + } + + if (priv->frame_header_ref) { + av1ctx.frame_header_ref = av_buffer_ref(priv->frame_header_ref); + if (!av1ctx.frame_header_ref) { + err = AVERROR(ENOMEM); + goto error; + } + } err = cbs_av1_write_obu_header(ctx, pbc, &obu->header); if (err < 0) - return err; + goto error; if (obu->header.obu_has_size_field) { pbc_tmp = *pbc; @@ -1084,18 +1100,21 @@ err = cbs_av1_write_sequence_header_obu(ctx, pbc, &obu->obu.sequence_header); if (err < 0) - return err; + goto error; av_buffer_unref(&priv->sequence_header_ref); priv->sequence_header = NULL; err = ff_cbs_make_unit_refcounted(ctx, unit); if (err < 0) - return err; + goto error; priv->sequence_header_ref = av_buffer_ref(unit->content_ref); - if (!priv->sequence_header_ref) - return AVERROR(ENOMEM); + if (!priv->sequence_header_ref) { + err = AVERROR(ENOMEM); + goto error; + } + priv->sequence_header = &obu->obu.sequence_header; } break; @@ -1103,7 +1122,7 @@ { err = cbs_av1_write_temporal_delimiter_obu(ctx, pbc); if (err < 0) - return err; + goto error; } break; case AV1_OBU_FRAME_HEADER: @@ -1115,7 +1134,7 @@ AV1_OBU_REDUNDANT_FRAME_HEADER, NULL); if (err < 0) - return err; + goto error; } break; case AV1_OBU_TILE_GROUP: @@ -1123,7 +1142,7 @@ err = cbs_av1_write_tile_group_obu(ctx, pbc, &obu->obu.tile_group); if (err < 0) - return err; + goto error; td = &obu->obu.tile_group.tile_data; } @@ -1132,7 +1151,7 @@ { err = cbs_av1_write_frame_obu(ctx, pbc, &obu->obu.frame, NULL); if (err < 0) - return err; + goto error; td = &obu->obu.frame.tile_group.tile_data; } @@ -1141,7 +1160,7 @@ { err = cbs_av1_write_tile_list_obu(ctx, pbc, &obu->obu.tile_list); if (err < 0) - return err; + goto error; td = &obu->obu.tile_list.tile_data; } @@ -1150,18 +1169,19 @@ { err = cbs_av1_write_metadata_obu(ctx, pbc, &obu->obu.metadata); if (err < 0) - return err; + goto error; } break; case AV1_OBU_PADDING: { err = cbs_av1_write_padding_obu(ctx, pbc, &obu->obu.padding); if (err < 0) - return err; + goto error; } break; default: - return AVERROR(ENOSYS); + err = AVERROR(ENOSYS); + goto error; } end_pos = put_bits_count(pbc); @@ -1172,7 +1192,7 @@ // Add trailing bits and recalculate. err = cbs_av1_write_trailing_bits(ctx, pbc, 8 - end_pos % 8); if (err < 0) - return err; + goto error; end_pos = put_bits_count(pbc); obu->obu_size = header_size = (end_pos - start_pos + 7) / 8; } else { @@ -1190,14 +1210,19 @@ *pbc = pbc_tmp; err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size); if (err < 0) - return err; + goto error; data_pos = put_bits_count(pbc) / 8; flush_put_bits(pbc); av_assert0(data_pos <= start_pos); - if (8 * obu->obu_size > put_bits_left(pbc)) + if (8 * obu->obu_size > put_bits_left(pbc)) { + av_buffer_unref(&priv->sequence_header_ref); + av_buffer_unref(&priv->frame_header_ref); + *priv = av1ctx; + return AVERROR(ENOSPC); + } if (obu->obu_size > 0) { memmove(pbc->buf + data_pos, @@ -1213,8 +1238,13 @@ // OBU data must be byte-aligned. av_assert0(put_bits_count(pbc) % 8 == 0); + err = 0; - return 0; +error: + av_buffer_unref(&av1ctx.sequence_header_ref); + av_buffer_unref(&av1ctx.frame_header_ref); + + return err; } static int cbs_av1_assemble_fragment(CodedBitstreamContext *ctx, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1_syntax_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1_syntax_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1_syntax_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_av1_syntax_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -1862,11 +1862,8 @@ fb(16, white_point_chromaticity_x); fb(16, white_point_chromaticity_y); - fc(32, luminance_max, 1, MAX_UINT_BITS(32)); - // luminance_min must be lower than luminance_max. Convert luminance_max from - // 24.8 fixed point to 18.14 fixed point in order to compare them. - fc(32, luminance_min, 0, FFMIN(((uint64_t)current->luminance_max << 6) - 1, - MAX_UINT_BITS(32))); + fb(32, luminance_max); + fb(32, luminance_min); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.c 2023-03-03 13:29:59.000000000 +0000 @@ -438,6 +438,10 @@ return err; av_freep(&par->extradata); + par->extradata_size = 0; + + if (!frag->data_size) + return 0; par->extradata = av_malloc(frag->data_size + AV_INPUT_BUFFER_PADDING_SIZE); @@ -695,26 +699,6 @@ } -int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit, - size_t size, - void (*free)(void *opaque, uint8_t *data)) -{ - av_assert0(!unit->content && !unit->content_ref); - - unit->content = av_mallocz(size); - if (!unit->content) - return AVERROR(ENOMEM); - - unit->content_ref = av_buffer_create(unit->content, size, - free, NULL, 0); - if (!unit->content_ref) { - av_freep(&unit->content); - return AVERROR(ENOMEM); - } - - return 0; -} - static int cbs_insert_unit(CodedBitstreamFragment *frag, int position) { @@ -855,12 +839,10 @@ static void cbs_default_free_unit_content(void *opaque, uint8_t *data) { const CodedBitstreamUnitTypeDescriptor *desc = opaque; - if (desc->content_type == CBS_CONTENT_TYPE_INTERNAL_REFS) { - int i; - for (i = 0; i < desc->nb_ref_offsets; i++) { - void **ptr = (void**)(data + desc->ref_offsets[i]); - av_buffer_unref((AVBufferRef**)(ptr + 1)); - } + + for (int i = 0; i < desc->type.ref.nb_offsets; i++) { + void **ptr = (void**)(data + desc->type.ref.offsets[i]); + av_buffer_unref((AVBufferRef**)(ptr + 1)); } av_free(data); } @@ -880,12 +862,12 @@ if (desc->nb_unit_types == 0) break; if (desc->nb_unit_types == CBS_UNIT_TYPE_RANGE) { - if (unit->type >= desc->unit_type_range_start && - unit->type <= desc->unit_type_range_end) + if (unit->type >= desc->unit_type.range.start && + unit->type <= desc->unit_type.range.end) return desc; } else { for (j = 0; j < desc->nb_unit_types; j++) { - if (desc->unit_types[j] == unit->type) + if (desc->unit_type.list[j] == unit->type) return desc; } } @@ -893,8 +875,8 @@ return NULL; } -int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, - CodedBitstreamUnit *unit) +int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit) { const CodedBitstreamUnitTypeDescriptor *desc; @@ -910,7 +892,8 @@ unit->content_ref = av_buffer_create(unit->content, desc->content_size, - desc->content_free ? desc->content_free + desc->content_type == CBS_CONTENT_TYPE_COMPLEX + ? desc->type.complex.content_free : cbs_default_free_unit_content, (void*)desc, 0); if (!unit->content_ref) { @@ -921,13 +904,12 @@ return 0; } -static int cbs_clone_unit_content(AVBufferRef **clone_ref, - CodedBitstreamUnit *unit, - const CodedBitstreamUnitTypeDescriptor *desc) -{ - uint8_t *src, *copy; - uint8_t **src_ptr, **copy_ptr; - AVBufferRef **src_buf, **copy_buf; +static int cbs_clone_internal_refs_unit_content(AVBufferRef **clone_ref, + const CodedBitstreamUnit *unit, + const CodedBitstreamUnitTypeDescriptor *desc) +{ + const uint8_t *src; + uint8_t *copy; int err, i; av_assert0(unit->content); @@ -937,17 +919,17 @@ if (!copy) return AVERROR(ENOMEM); - for (i = 0; i < desc->nb_ref_offsets; i++) { - src_ptr = (uint8_t**)(src + desc->ref_offsets[i]); - src_buf = (AVBufferRef**)(src_ptr + 1); - copy_ptr = (uint8_t**)(copy + desc->ref_offsets[i]); - copy_buf = (AVBufferRef**)(copy_ptr + 1); + for (i = 0; i < desc->type.ref.nb_offsets; i++) { + const uint8_t *const *src_ptr = (const uint8_t* const*)(src + desc->type.ref.offsets[i]); + const AVBufferRef *src_buf = *(AVBufferRef**)(src_ptr + 1); + uint8_t **copy_ptr = (uint8_t**)(copy + desc->type.ref.offsets[i]); + AVBufferRef **copy_buf = (AVBufferRef**)(copy_ptr + 1); if (!*src_ptr) { - av_assert0(!*src_buf); + av_assert0(!src_buf); continue; } - if (!*src_buf) { + if (!src_buf) { // We can't handle a non-refcounted pointer here - we don't // have enough information to handle whatever structure lies // at the other end of it. @@ -955,21 +937,14 @@ goto fail; } - // src_ptr is required to point somewhere inside src_buf. If it - // doesn't, there is a bug somewhere. - av_assert0(*src_ptr >= (*src_buf)->data && - *src_ptr < (*src_buf)->data + (*src_buf)->size); - - *copy_buf = av_buffer_ref(*src_buf); + *copy_buf = av_buffer_ref(src_buf); if (!*copy_buf) { err = AVERROR(ENOMEM); goto fail; } - *copy_ptr = (*copy_buf)->data + (*src_ptr - (*src_buf)->data); } *clone_ref = av_buffer_create(copy, desc->content_size, - desc->content_free ? desc->content_free : cbs_default_free_unit_content, (void*)desc, 0); if (!*clone_ref) { @@ -981,46 +956,37 @@ fail: for (--i; i >= 0; i--) - av_buffer_unref((AVBufferRef**)(copy + desc->ref_offsets[i])); + av_buffer_unref((AVBufferRef**)(copy + desc->type.ref.offsets[i])); av_freep(©); *clone_ref = NULL; return err; } -int ff_cbs_make_unit_refcounted(CodedBitstreamContext *ctx, - CodedBitstreamUnit *unit) +/* + * On success, unit->content and unit->content_ref are updated with + * the new content; unit is untouched on failure. + * Any old content_ref is simply overwritten and not freed. + */ +static int cbs_clone_unit_content(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit) { const CodedBitstreamUnitTypeDescriptor *desc; AVBufferRef *ref; int err; - av_assert0(unit->content); - if (unit->content_ref) { - // Already refcounted, nothing to do. - return 0; - } - desc = cbs_find_unit_type_desc(ctx, unit); if (!desc) return AVERROR(ENOSYS); switch (desc->content_type) { - case CBS_CONTENT_TYPE_POD: - ref = av_buffer_alloc(desc->content_size); - if (!ref) - return AVERROR(ENOMEM); - memcpy(ref->data, unit->content, desc->content_size); - err = 0; - break; - case CBS_CONTENT_TYPE_INTERNAL_REFS: - err = cbs_clone_unit_content(&ref, unit, desc); + err = cbs_clone_internal_refs_unit_content(&ref, unit, desc); break; case CBS_CONTENT_TYPE_COMPLEX: - if (!desc->content_clone) + if (!desc->type.complex.content_clone) return AVERROR_PATCHWELCOME; - err = desc->content_clone(&ref, unit); + err = desc->type.complex.content_clone(&ref, unit); break; default: @@ -1035,51 +1001,28 @@ return 0; } +int ff_cbs_make_unit_refcounted(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit) +{ + av_assert0(unit->content); + if (unit->content_ref) + return 0; + return cbs_clone_unit_content(ctx, unit); +} + int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit) { - const CodedBitstreamUnitTypeDescriptor *desc; - AVBufferRef *ref; + AVBufferRef *ref = unit->content_ref; int err; - // This can only be applied to refcounted units. - err = ff_cbs_make_unit_refcounted(ctx, unit); - if (err < 0) - return err; - av_assert0(unit->content && unit->content_ref); - - if (av_buffer_is_writable(unit->content_ref)) + av_assert0(unit->content); + if (ref && av_buffer_is_writable(ref)) return 0; - desc = cbs_find_unit_type_desc(ctx, unit); - if (!desc) - return AVERROR(ENOSYS); - - switch (desc->content_type) { - case CBS_CONTENT_TYPE_POD: - err = av_buffer_make_writable(&unit->content_ref); - break; - - case CBS_CONTENT_TYPE_INTERNAL_REFS: - err = cbs_clone_unit_content(&ref, unit, desc); - break; - - case CBS_CONTENT_TYPE_COMPLEX: - if (!desc->content_clone) - return AVERROR_PATCHWELCOME; - err = desc->content_clone(&ref, unit); - break; - - default: - av_assert0(0 && "Invalid content type."); - } + err = cbs_clone_unit_content(ctx, unit); if (err < 0) return err; - - if (desc->content_type != CBS_CONTENT_TYPE_POD) { - av_buffer_unref(&unit->content_ref); - unit->content_ref = ref; - } - unit->content = unit->content_ref->data; + av_buffer_unref(&ref); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs.h 2023-03-03 13:29:59.000000000 +0000 @@ -364,21 +364,12 @@ void ff_cbs_fragment_free(CodedBitstreamFragment *frag); /** - * Allocate a new internal content buffer of the given size in the unit. - * - * The content will be zeroed. - */ -int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit, - size_t size, - void (*free)(void *opaque, uint8_t *content)); - -/** * Allocate a new internal content buffer matching the type of the unit. * * The content will be zeroed. */ -int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, - CodedBitstreamUnit *unit); +int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); /** * Insert a new unit into a fragment with the given content. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_h2645.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_h2645.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_h2645.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_h2645.c 2023-03-03 13:29:59.000000000 +0000 @@ -666,13 +666,7 @@ CodedBitstreamH26 ## h26n ## Context *priv = ctx->priv_data; \ H26 ## h26n ## Raw ## ps_name *ps_var = unit->content; \ unsigned int id = ps_var->id_element; \ - int err; \ - if (id >= FF_ARRAY_ELEMS(priv->ps_var)) { \ - av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid " #ps_name \ - " id : %d.\n", id); \ - return AVERROR_INVALIDDATA; \ - } \ - err = ff_cbs_make_unit_refcounted(ctx, unit); \ + int err = ff_cbs_make_unit_refcounted(ctx, unit); \ if (err < 0) \ return err; \ if (priv->ps_var[id] == priv->active_ ## ps_var) \ @@ -702,7 +696,7 @@ if (err < 0) return err; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; @@ -821,7 +815,7 @@ if (err < 0) return err; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; @@ -1396,18 +1390,9 @@ CBS_UNIT_TYPE_INTERNAL_REF(H264_NAL_PPS, H264RawPPS, slice_group_id), - { - .nb_unit_types = 3, - .unit_types = { - H264_NAL_IDR_SLICE, - H264_NAL_SLICE, - H264_NAL_AUXILIARY_SLICE, - }, - .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, - .content_size = sizeof(H264RawSlice), - .nb_ref_offsets = 1, - .ref_offsets = { offsetof(H264RawSlice, data) }, - }, + CBS_UNIT_TYPES_INTERNAL_REF((H264_NAL_IDR_SLICE, + H264_NAL_SLICE, + H264_NAL_AUXILIARY_SLICE), H264RawSlice, data), CBS_UNIT_TYPE_POD(H264_NAL_AUD, H264RawAUD), CBS_UNIT_TYPE_POD(H264_NAL_FILLER_DATA, H264RawFiller), @@ -1433,40 +1418,15 @@ CBS_UNIT_TYPE_POD(HEVC_NAL_AUD, H265RawAUD), - { - // Slices of non-IRAP pictures. - .nb_unit_types = CBS_UNIT_TYPE_RANGE, - .unit_type_range_start = HEVC_NAL_TRAIL_N, - .unit_type_range_end = HEVC_NAL_RASL_R, - - .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, - .content_size = sizeof(H265RawSlice), - .nb_ref_offsets = 1, - .ref_offsets = { offsetof(H265RawSlice, data) }, - }, - - { - // Slices of IRAP pictures. - .nb_unit_types = CBS_UNIT_TYPE_RANGE, - .unit_type_range_start = HEVC_NAL_BLA_W_LP, - .unit_type_range_end = HEVC_NAL_CRA_NUT, - - .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, - .content_size = sizeof(H265RawSlice), - .nb_ref_offsets = 1, - .ref_offsets = { offsetof(H265RawSlice, data) }, - }, + // Slices of non-IRAP pictures. + CBS_UNIT_RANGE_INTERNAL_REF(HEVC_NAL_TRAIL_N, HEVC_NAL_RASL_R, + H265RawSlice, data), + // Slices of IRAP pictures. + CBS_UNIT_RANGE_INTERNAL_REF(HEVC_NAL_BLA_W_LP, HEVC_NAL_CRA_NUT, + H265RawSlice, data), - { - .nb_unit_types = 2, - .unit_types = { - HEVC_NAL_SEI_PREFIX, - HEVC_NAL_SEI_SUFFIX - }, - .content_type = CBS_CONTENT_TYPE_COMPLEX, - .content_size = sizeof(H265RawSEI), - .content_free = &cbs_h265_free_sei, - }, + CBS_UNIT_TYPES_COMPLEX((HEVC_NAL_SEI_PREFIX, HEVC_NAL_SEI_SUFFIX), + H265RawSEI, cbs_h265_free_sei), CBS_UNIT_TYPE_END_OF_LIST }; @@ -1540,6 +1500,12 @@ sizeof(SEIRawAlternativeTransferCharacteristics), SEI_MESSAGE_RW(sei, alternative_transfer_characteristics), }, + { + SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT, + 1, 0, + sizeof(SEIRawAmbientViewingEnvironment), + SEI_MESSAGE_RW(sei, ambient_viewing_environment), + }, SEI_MESSAGE_TYPE_END, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,9 +31,7 @@ enum CBSContentType { - // Unit content is a simple structure. - CBS_CONTENT_TYPE_POD, - // Unit content contains some references to other structures, but all + // Unit content may contain some references to other structures, but all // managed via buffer reference counting. The descriptor defines the // structure offsets of every buffer reference. CBS_CONTENT_TYPE_INTERNAL_REFS, @@ -43,9 +41,9 @@ }; enum { - // Maximum number of unit types described by the same unit type - // descriptor. - CBS_MAX_UNIT_TYPES = 3, + // Maximum number of unit types described by the same non-range + // unit type descriptor. + CBS_MAX_LIST_UNIT_TYPES = 3, // Maximum number of reference buffer offsets in any one unit. CBS_MAX_REF_OFFSETS = 2, // Special value used in a unit type descriptor to indicate that it @@ -60,13 +58,16 @@ // used instead. int nb_unit_types; - // Array of unit types that this entry describes. - const CodedBitstreamUnitType unit_types[CBS_MAX_UNIT_TYPES]; - - // Start and end of unit type range, used if nb_unit_types is - // CBS_UNIT_TYPE_RANGE. - const CodedBitstreamUnitType unit_type_range_start; - const CodedBitstreamUnitType unit_type_range_end; + union { + // Array of unit types that this entry describes. + CodedBitstreamUnitType list[CBS_MAX_LIST_UNIT_TYPES]; + // Start and end of unit type range, used if nb_unit_types is + // CBS_UNIT_TYPE_RANGE. + struct { + CodedBitstreamUnitType start; + CodedBitstreamUnitType end; + } range; + } unit_type; // The type of content described. enum CBSContentType content_type; @@ -74,18 +75,27 @@ // the decomposed content of this type of unit. size_t content_size; - // Number of entries in the ref_offsets array. Only used if the - // content_type is CBS_CONTENT_TYPE_INTERNAL_REFS. - int nb_ref_offsets; - // The structure must contain two adjacent elements: - // type *field; - // AVBufferRef *field_ref; - // where field points to something in the buffer referred to by - // field_ref. This offset is then set to offsetof(struct, field). - size_t ref_offsets[CBS_MAX_REF_OFFSETS]; - - void (*content_free)(void *opaque, uint8_t *data); - int (*content_clone)(AVBufferRef **ref, CodedBitstreamUnit *unit); + union { + // This union's state is determined by content_type: + // ref for CBS_CONTENT_TYPE_INTERNAL_REFS, + // complex for CBS_CONTENT_TYPE_COMPLEX. + struct { + // Number of entries in the ref_offsets array. + // May be zero, then the structure is POD-like. + int nb_offsets; + // The structure must contain two adjacent elements: + // type *field; + // AVBufferRef *field_ref; + // where field points to something in the buffer referred to by + // field_ref. This offset is then set to offsetof(struct, field). + size_t offsets[CBS_MAX_REF_OFFSETS]; + } ref; + + struct { + void (*content_free)(void *opaque, uint8_t *data); + int (*content_clone)(AVBufferRef **ref, CodedBitstreamUnit *unit); + } complex; + } type; } CodedBitstreamUnitTypeDescriptor; typedef struct CodedBitstreamType { @@ -181,28 +191,54 @@ // range_min in the above functions. #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) - -#define CBS_UNIT_TYPE_POD(type, structure) { \ +#define TYPE_LIST(...) { __VA_ARGS__ } +#define CBS_UNIT_TYPE_POD(type_, structure) { \ .nb_unit_types = 1, \ - .unit_types = { type }, \ - .content_type = CBS_CONTENT_TYPE_POD, \ + .unit_type.list = { type_ }, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 0 }, \ } -#define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field) { \ - .nb_unit_types = 1, \ - .unit_types = { type }, \ +#define CBS_UNIT_RANGE_POD(range_start, range_end, structure) { \ + .nb_unit_types = CBS_UNIT_TYPE_RANGE, \ + .unit_type.range.start = range_start, \ + .unit_type.range.end = range_end, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 0 }, \ + } + +#define CBS_UNIT_TYPES_INTERNAL_REF(types, structure, ref_field) { \ + .nb_unit_types = FF_ARRAY_ELEMS((CodedBitstreamUnitType[])TYPE_LIST types), \ + .unit_type.list = TYPE_LIST types, \ .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ .content_size = sizeof(structure), \ - .nb_ref_offsets = 1, \ - .ref_offsets = { offsetof(structure, ref_field) }, \ + .type.ref = { .nb_offsets = 1, \ + .offsets = { offsetof(structure, ref_field) } }, \ } -#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) { \ - .nb_unit_types = 1, \ - .unit_types = { type }, \ +#define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field) \ + CBS_UNIT_TYPES_INTERNAL_REF((type), structure, ref_field) + +#define CBS_UNIT_RANGE_INTERNAL_REF(range_start, range_end, structure, ref_field) { \ + .nb_unit_types = CBS_UNIT_TYPE_RANGE, \ + .unit_type.range.start = range_start, \ + .unit_type.range.end = range_end, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 1, \ + .offsets = { offsetof(structure, ref_field) } }, \ + } + +#define CBS_UNIT_TYPES_COMPLEX(types, structure, free_func) { \ + .nb_unit_types = FF_ARRAY_ELEMS((CodedBitstreamUnitType[])TYPE_LIST types), \ + .unit_type.list = TYPE_LIST types, \ .content_type = CBS_CONTENT_TYPE_COMPLEX, \ .content_size = sizeof(structure), \ - .content_free = free_func, \ + .type.complex = { .content_free = free_func }, \ } +#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) \ + CBS_UNIT_TYPES_COMPLEX((type), structure, free_func) + #define CBS_UNIT_TYPE_END_OF_LIST { .nb_unit_types = 0 } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_jpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_jpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_jpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_jpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -82,27 +82,6 @@ #undef xu -static void cbs_jpeg_free_application_data(void *opaque, uint8_t *content) -{ - JPEGRawApplicationData *ad = (JPEGRawApplicationData*)content; - av_buffer_unref(&ad->Ap_ref); - av_freep(&content); -} - -static void cbs_jpeg_free_comment(void *opaque, uint8_t *content) -{ - JPEGRawComment *comment = (JPEGRawComment*)content; - av_buffer_unref(&comment->Cm_ref); - av_freep(&content); -} - -static void cbs_jpeg_free_scan(void *opaque, uint8_t *content) -{ - JPEGRawScan *scan = (JPEGRawScan*)content; - av_buffer_unref(&scan->data_ref); - av_freep(&content); -} - static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header) @@ -248,41 +227,26 @@ if (err < 0) return err; + err = ff_cbs_alloc_unit_content(ctx, unit); + if (err < 0) + return err; + if (unit->type >= JPEG_MARKER_SOF0 && unit->type <= JPEG_MARKER_SOF3) { - err = ff_cbs_alloc_unit_content(unit, - sizeof(JPEGRawFrameHeader), - NULL); - if (err < 0) - return err; - err = cbs_jpeg_read_frame_header(ctx, &gbc, unit->content); if (err < 0) return err; } else if (unit->type >= JPEG_MARKER_APPN && unit->type <= JPEG_MARKER_APPN + 15) { - err = ff_cbs_alloc_unit_content(unit, - sizeof(JPEGRawApplicationData), - &cbs_jpeg_free_application_data); - if (err < 0) - return err; - err = cbs_jpeg_read_application_data(ctx, &gbc, unit->content); if (err < 0) return err; } else if (unit->type == JPEG_MARKER_SOS) { - JPEGRawScan *scan; + JPEGRawScan *scan = unit->content; int pos; - err = ff_cbs_alloc_unit_content(unit, - sizeof(JPEGRawScan), - &cbs_jpeg_free_scan); - if (err < 0) - return err; - scan = unit->content; - err = cbs_jpeg_read_scan_header(ctx, &gbc, &scan->header); if (err < 0) return err; @@ -299,21 +263,17 @@ } else { switch (unit->type) { -#define SEGMENT(marker, type, func, free) \ +#define SEGMENT(marker, func) \ case JPEG_MARKER_ ## marker: \ { \ - err = ff_cbs_alloc_unit_content(unit, \ - sizeof(type), free); \ - if (err < 0) \ - return err; \ err = cbs_jpeg_read_ ## func(ctx, &gbc, unit->content); \ if (err < 0) \ return err; \ } \ break - SEGMENT(DQT, JPEGRawQuantisationTableSpecification, dqt, NULL); - SEGMENT(DHT, JPEGRawHuffmanTableSpecification, dht, NULL); - SEGMENT(COM, JPEGRawComment, comment, &cbs_jpeg_free_comment); + SEGMENT(DQT, dqt); + SEGMENT(DHT, dht); + SEGMENT(COM, comment); #undef SEGMENT default: return AVERROR(ENOSYS); @@ -456,9 +416,27 @@ return 0; } +static const CodedBitstreamUnitTypeDescriptor cbs_jpeg_unit_types[] = { + CBS_UNIT_RANGE_POD(JPEG_MARKER_SOF0, JPEG_MARKER_SOF3, JPEGRawFrameHeader), + + CBS_UNIT_RANGE_INTERNAL_REF(JPEG_MARKER_APPN, JPEG_MARKER_APPN + 15, + JPEGRawApplicationData, Ap), + + CBS_UNIT_TYPE_INTERNAL_REF(JPEG_MARKER_SOS, JPEGRawScan, data), + + CBS_UNIT_TYPE_POD(JPEG_MARKER_DQT, JPEGRawQuantisationTableSpecification), + CBS_UNIT_TYPE_POD(JPEG_MARKER_DHT, JPEGRawHuffmanTableSpecification), + + CBS_UNIT_TYPE_INTERNAL_REF(JPEG_MARKER_COM, JPEGRawComment, Cm), + + CBS_UNIT_TYPE_END_OF_LIST +}; + const CodedBitstreamType ff_cbs_type_jpeg = { .codec_id = AV_CODEC_ID_MJPEG, + .unit_types = cbs_jpeg_unit_types, + .split_fragment = &cbs_jpeg_split_fragment, .read_unit = &cbs_jpeg_read_unit, .write_unit = &cbs_jpeg_write_unit, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_mpeg2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_mpeg2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_mpeg2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_mpeg2.c 2023-03-03 13:29:59.000000000 +0000 @@ -204,7 +204,7 @@ if (err < 0) return err; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; @@ -392,14 +392,14 @@ { .nb_unit_types = CBS_UNIT_TYPE_RANGE, - .unit_type_range_start = 0x01, - .unit_type_range_end = 0xaf, + .unit_type.range.start = 0x01, + .unit_type.range.end = 0xaf, .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, .content_size = sizeof(MPEG2RawSlice), - .nb_ref_offsets = 2, - .ref_offsets = { offsetof(MPEG2RawSlice, header.extra_information_slice.extra_information), - offsetof(MPEG2RawSlice, data) }, + .type.ref = { .nb_offsets = 2, + .offsets = { offsetof(MPEG2RawSlice, header.extra_information_slice.extra_information), + offsetof(MPEG2RawSlice, data) } }, }, CBS_UNIT_TYPE_INTERNAL_REF(MPEG2_START_USER_DATA, MPEG2RawUserData, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.c 2023-03-03 13:29:59.000000000 +0000 @@ -179,7 +179,7 @@ unit = &au->units[position]; unit->type = sei_type; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei.h 2023-03-03 13:29:59.000000000 +0000 @@ -65,6 +65,12 @@ uint8_t preferred_transfer_characteristics; } SEIRawAlternativeTransferCharacteristics; +typedef struct SEIRawAmbientViewingEnvironment { + uint32_t ambient_illuminance; + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} SEIRawAmbientViewingEnvironment; + typedef struct SEIRawMessage { uint32_t payload_type; uint32_t payload_size; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei_syntax_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei_syntax_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei_syntax_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_sei_syntax_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -144,6 +144,23 @@ return 0; } +static int FUNC(ambient_viewing_environment) + (CodedBitstreamContext *ctx, RWContext *rw, + SEIRawAmbientViewingEnvironment *current, + SEIMessageState *state) +{ + static const uint16_t max_ambient_light_value = 50000; + int err; + + HEADER("Ambient Viewing Environment"); + + u(32, ambient_illuminance, 1, MAX_UINT_BITS(32)); + u(16, ambient_light_x, 0, max_ambient_light_value); + u(16, ambient_light_y, 0, max_ambient_light_value); + + return 0; +} + static int FUNC(message)(CodedBitstreamContext *ctx, RWContext *rw, SEIRawMessage *current) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_vp9.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_vp9.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_vp9.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cbs_vp9.c 2023-03-03 13:29:59.000000000 +0000 @@ -489,7 +489,7 @@ if (err < 0) return err; - err = ff_cbs_alloc_unit_content2(ctx, unit); + err = ff_cbs_alloc_unit_content(ctx, unit); if (err < 0) return err; frame = unit->content; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ccaption_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ccaption_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ccaption_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ccaption_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -946,7 +946,7 @@ const FFCodec ff_ccaption_decoder = { .p.name = "cc_dec", - .p.long_name = NULL_IF_CONFIG_SMALL("Closed Caption (EIA-608 / CEA-708)"), + CODEC_LONG_NAME("Closed Caption (EIA-608 / CEA-708)"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_EIA_608, .p.priv_class = &ccaption_dec_class, @@ -956,5 +956,4 @@ .close = close_decoder, .flush = flush_decoder, FF_CODEC_DECODE_SUB_CB(decode), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdgraphics.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdgraphics.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdgraphics.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdgraphics.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" /** * @file @@ -374,7 +374,7 @@ return; memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); - if (!avctx->frame_number) + if (!avctx->frame_num) memset(cc->frame->data[1], 0, AVPALETTE_SIZE); } @@ -389,7 +389,7 @@ const FFCodec ff_cdgraphics_decoder = { .p.name = "cdgraphics", - .p.long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"), + CODEC_LONG_NAME("CD Graphics video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CDGRAPHICS, .priv_data_size = sizeof(CDGraphicsContext), @@ -398,5 +398,4 @@ FF_CODEC_DECODE_CB(cdg_decode_frame), .flush = cdg_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdtoons.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdtoons.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdtoons.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdtoons.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define CDTOONS_HEADER_SIZE 44 #define CDTOONS_MAX_SPRITES 1200 @@ -445,7 +445,7 @@ const FFCodec ff_cdtoons_decoder = { .p.name = "cdtoons", - .p.long_name = NULL_IF_CONFIG_SMALL("CDToons video"), + CODEC_LONG_NAME("CDToons video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CDTOONS, .priv_data_size = sizeof(CDToonsContext), @@ -454,5 +454,4 @@ FF_CODEC_DECODE_CB(cdtoons_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .flush = cdtoons_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdxl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdxl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdxl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cdxl.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,12 +28,11 @@ #define UNCHECKED_BITSTREAM_READER 1 #include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define BIT_PLANAR 0x00 #define CHUNKY 0x20 @@ -338,7 +337,7 @@ const FFCodec ff_cdxl_decoder = { .p.name = "cdxl", - .p.long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"), + CODEC_LONG_NAME("Commodore CDXL video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CDXL, .priv_data_size = sizeof(CDXLVideoContext), @@ -346,5 +345,4 @@ .close = cdxl_decode_end, FF_CODEC_DECODE_CB(cdxl_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,13 +26,13 @@ #include "libavutil/attributes.h" #include "libavutil/buffer.h" #include "libavutil/common.h" -#include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" -#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "internal.h" #include "thread.h" @@ -819,7 +819,7 @@ VLC_BITS, 3, 1); /* escape */ - if (level == 64) + if (!run) break; count += run; @@ -850,7 +850,7 @@ VLC_BITS, 3, 1); /* escape */ - if (level == 255 && run == 2) + if (!run) break; count += run; @@ -1404,9 +1404,6 @@ free_buffers(s); - ff_free_vlc(&s->vlc_9); - ff_free_vlc(&s->vlc_18); - return 0; } @@ -1457,14 +1454,14 @@ const FFCodec ff_cfhd_decoder = { .p.name = "cfhd", - .p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), + CODEC_LONG_NAME("GoPro CineForm HD"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CFHD, .priv_data_size = sizeof(CFHDContext), .init = cfhd_init, .close = cfhd_close, FF_CODEC_DECODE_CB(cfhd_decode), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), + UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhddata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhddata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhddata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhddata.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,349 +23,177 @@ #include "libavutil/attributes.h" #include "cfhd.h" - -/* some special codewords, not sure what they all mean */ -#define TABLE_9_BAND_END1 0x1C7859Eh -#define TABLE_9_BAND_END_LEN1 25 -#define TABLE_9_BAND_END2 0x38F0B3Fh -#define TABLE_9_BAND_END_LEN2 26 -#define TABLE_9_BAND_END3 0x38F0B3Eh -#define TABLE_9_BAND_END_LEN3 26 +#include "vlc.h" #define NB_VLC_TABLE_9 (71 + 3) #define NB_VLC_TABLE_18 (263 + 1) -static const uint32_t table_9_vlc_bits[NB_VLC_TABLE_9] = { - 0, 0x2, 0xc, 0x1a, - 0x1d, 0x1e, 0x39, 0x3e, - 0x37, 0x7e, 0x6c, 0xe2, - 0xfe, 0xdb, 0xe0, 0x1c3, - 0x1c6, 0x1ff, 0x1fe, 0x1b5, - 0x369, 0x385, 0x71d, 0x6d0, - 0x708, 0x71f, 0xe3d, 0xe39, - 0xe13, 0xe12, 0x1c71, 0x1b45, - 0x1b47, 0x3689, 0x38f2, 0x38e1, - 0x38e0, 0x38f1, 0x3688, 0x6d1b, - 0x71e0, 0x6d19, 0x71e7, 0xe3cd, - 0xda35, 0xda30, 0xe3c3, 0x1b469, - 0x1b462, 0x1c798, 0x1b463, 0x1c799, - 0x38f08, 0x38f09, 0x38f0a, 0x6d1a0, - 0x6d1a3, 0x6d1a1, 0xda345, 0xda344, - 0xe3c2d, 0xe3c2f, 0xe3c2e, 0x38f0b2, - 0x71e160, 0x71e162, 0x71e166, 0x71e161, - 0xe3c2ce, 0xe3c2c6, 0xe3c2c7, 0x1C7859E, - 0x38F0B3F, 0x38F0B3E, -}; - -static const uint8_t table_9_vlc_len[NB_VLC_TABLE_9] = { - 1, 2, 4, 5, 5, 5, 6, 6, - 6, 7, 7, 8, 8, 8, 8, 9, - 9, 9, 9, 9, 10, 10, 11, 11, - 11, 11, 12, 12, 12, 12, 13, 13, - 13, 14, 14, 14, 14, 14, 14, 15, - 15, 15, 15, 16, 16, 16, 16, 17, - 17, 17, 17, 17, 18, 18, 18, 19, - 19, 19, 20, 20, 20, 20, 20, 22, - 23, 23, 23, 23, 24, 24, 24, 25, - 26, 26, -}; - -static const uint16_t table_9_vlc_run[NB_VLC_TABLE_9] = { - 1, 1, 1, 1, 12, 1, 32, 160, - 1, 1, 1, 320, 1, 1, 80, 120, - 1, 1, 100, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 -}; - -static const uint8_t table_9_vlc_level[NB_VLC_TABLE_9] = { - 0, 1, 2, 3, 0, 4, 0, 0, - 5, 7, 6, 0, 9, 8, 0, 0, - 11, 12, 0, 10, 13, 14, 17, 15, - 16, 18, 22, 21, 20, 19, 25, 23, - 24, 27, 31, 29, 28, 30, 26, 33, - 34, 32, 35, 39, 37, 36, 38, 42, - 40, 43, 41, 44, 45, 46, 47, 48, - 50, 49, 52, 51, 53, 55, 54, 56, - 57, 59, 60, 58, 61, 62, 63, 64, - 64, 64, -}; - -static const uint32_t table_18_vlc_bits[NB_VLC_TABLE_18] = { - 0, 0x2, 0x7, 0x19, - 0x30, 0x36, 0x6f, 0x63, - 0x69, 0x6b, 0xd1, 0xd4, - 0xdc, 0x189, 0x18a, 0x1a0, - 0x1ab, 0x377, 0x310, 0x316, - 0x343, 0x354, 0x375, 0x623, - 0x684, 0x685, 0x6ab, 0x6ec, - 0xddb, 0xc5c, 0xc5e, 0xc44, - 0xd55, 0xdd1, 0xdd3, 0x1bb5, - 0x188b, 0x18bb, 0x18bf, 0x1aa8, - 0x1ba0, 0x1ba5, 0x1ba4, 0x3115, - 0x3175, 0x317d, 0x3553, 0x3768, - 0x6e87, 0x6ed3, 0x62e8, 0x62f8, - 0x6228, 0x6aa4, 0x6e85, 0xc453, - 0xc5d3, 0xc5f3, 0xdda4, 0xdd08, - 0xdd0c, 0x1bb4b, 0x1bb4a, 0x18ba5, - 0x18be5, 0x1aa95, 0x1aa97, 0x188a4, - 0x1ba13, 0x31748, 0x317c8, 0x35528, - 0x3552c, 0x37424, 0x37434, 0x37436, - 0x62294, 0x62e92, 0x62f92, 0x6aa52, - 0x6aa5a, 0x6e86a, 0x6e86e, 0x6e84a, - 0xc452a, 0xc5d27, 0xc5f26, 0xd54a6, - 0xd54b6, 0xdd096, 0xdd0d6, 0xdd0de, - 0x188a56, 0x18ba4d, 0x18be4e, 0x18be4f, - 0x1aa96e, 0x1ba12e, 0x1ba12f, 0x1ba1af, - 0x1ba1bf, 0x37435d, 0x37437d, 0x317498, - 0x35529c, 0x35529d, 0x3552de, 0x3552df, - 0x62e933, 0x62295d, 0x6aa53d, 0x6aa53f, - 0x6aa53e, 0x6e86b9, 0x6e86f8, 0xd54a79, - 0xc5d265, 0xc452b8, 0xdd0d71, 0xd54a78, - 0xdd0d70, 0xdd0df2, 0xdd0df3, 0x188a5f6, - 0x188a5f5, 0x188a5f4, 0x188a5f3, 0x188a5f2, - 0x188a5f1, 0x188a5f0, 0x188a5ef, 0x188a5ee, - 0x188a5ed, 0x188a5aa, 0x188a5e3, 0x188a5df, - 0x188a589, 0x188a5dd, 0x188a578, 0x188a5e0, - 0x188a588, 0x188a5d6, 0x188a5db, 0x188a5e1, - 0x188a587, 0x188a59a, 0x188a5c4, 0x188a5ec, - 0x188a586, 0x188a573, 0x188a59c, 0x188a5c8, - 0x188a5fb, 0x188a5a1, 0x188a5eb, 0x188a5a8, - 0x188a584, 0x188a5d2, 0x188a599, 0x188a598, - 0x188a583, 0x18ba4c9, 0x188a5d0, 0x188a594, - 0x188a582, 0x188a5cb, 0x188a5d8, 0x188a5e7, - 0x188a581, 0x188a5ea, 0x188a5a9, 0x188a5a6, - 0x188a580, 0x188a5a0, 0x188a59d, 0x188a5c3, - 0x188a57f, 0x188a5c0, 0x188a5de, 0x188a5d4, - 0x188a57e, 0x188a5c2, 0x188a592, 0x188a5cd, - 0x188a57d, 0x188a5a3, 0x188a5e8, 0x188a5a2, - 0x188a57c, 0x188a58e, 0x188a5b3, 0x188a5b2, - 0x188a5b1, 0x188a5b0, 0x188a5af, 0x188a5ae, - 0x188a5ad, 0x188a5ac, 0x188a5ab, 0x188a5da, - 0x188a5e4, 0x188a5e5, 0x188a5d9, 0x188a5b5, - 0x188a5bc, 0x188a5bd, 0x188a5e9, 0x188a5cc, - 0x188a585, 0x188a5d3, 0x188a5e2, 0x188a595, - 0x188a596, 0x188a5b8, 0x188a590, 0x188a5c9, - 0x188a5a4, 0x188a5e6, 0x188a5a5, 0x188a5ce, - 0x188a5bf, 0x188a572, 0x188a59b, 0x188a5be, - 0x188a5c7, 0x188a5ca, 0x188a5d5, 0x188a57b, - 0x188a58d, 0x188a58c, 0x188a58b, 0x188a58a, - 0x18ba4c8, 0x188a5c5, 0x188a5fa, 0x188a5bb, - 0x188a5c1, 0x188a5cf, 0x188a5b9, 0x188a5b6, - 0x188a597, 0x188a5fe, 0x188a5d7, 0x188a5ba, - 0x188a591, 0x188a5c6, 0x188a5dc, 0x188a57a, - 0x188a59f, 0x188a5f9, 0x188a5b4, 0x188a5a7, - 0x188a58f, 0x188a5fd, 0x188a5b7, 0x188a593, - 0x188a59e, 0x188a5f8, 0x188a5ff, 0x188a5fc, - 0x188a579, 0x188a5f7, 0x3114ba2, 0x3114ba3, -}; - -static const uint8_t table_18_vlc_len[NB_VLC_TABLE_18] = { - 1, 2, 3, 5, 6, 6, 7, 7, - 7, 7, 8, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 10, 10, 10, 11, - 11, 11, 11, 11, 12, 12, 12, 12, - 12, 12, 12, 13, 13, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 16, - 16, 16, 16, 16, 16, 17, 17, 17, - 17, 17, 17, 17, 17, 18, 18, 18, - 18, 18, 18, 18, 19, 19, 19, 19, - 19, 19, 19, 19, 20, 20, 20, 20, - 20, 20, 20, 20, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 22, 22, 22, - 22, 22, 22, 22, 23, 23, 23, 23, - 23, 23, 23, 24, 24, 24, 24, 24, - 24, 24, 24, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 26, 26, -}; - -static const uint16_t table_18_vlc_run[NB_VLC_TABLE_18] = { - 1, 1, 1, 1, 1, 1, 1, 1, - 12, 1, 20, 1, 1, 1, 32, 1, - 1, 1, 1, 1, 60, 1, 1, 1, - 1, 100, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 180, 1, - 1, 320, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, -}; - -static const uint8_t table_18_vlc_level[NB_VLC_TABLE_18] = { - 0, 1, 2, 3, 4, 5, 8, 6, - 0, 7, 0, 9, 10, 11, 0, 12, - 13, 18, 14, 15, 0, 16, 17, 19, - 20, 0, 21, 22, 29, 24, 25, 23, - 26, 27, 28, 35, 30, 31, 0, 32, - 33, 0, 34, 36, 37, 38, 39, 40, - 46, 47, 42, 43, 41, 44, 45, 48, - 49, 50, 53, 51, 52, 61, 60, 55, - 56, 57, 58, 54, 59, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, - 73, 75, 76, 74, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 99, 100, 94, - 95, 96, 97, 98, 102, 101, 103, 105, - 104, 106, 107, 111, 109, 108, 113, 110, - 112, 114, 115, 225, 189, 188, 203, 202, - 197, 207, 169, 223, 159, 235, 152, 192, - 179, 201, 172, 149, 178, 120, 219, 150, - 127, 211, 125, 158, 247, 238, 163, 228, - 183, 217, 168, 122, 128, 249, 187, 186, - 136, 181, 255, 230, 135, 233, 222, 145, - 134, 167, 248, 209, 243, 216, 164, 140, - 157, 239, 191, 251, 156, 139, 242, 133, - 162, 213, 165, 212, 227, 198, 236, 234, - 117, 215, 124, 123, 254, 253, 148, 218, - 146, 147, 224, 143, 184, 185, 166, 132, - 129, 250, 151, 119, 193, 176, 245, 229, - 206, 144, 208, 137, 241, 237, 190, 240, - 131, 232, 252, 171, 205, 204, 118, 214, - 180, 126, 182, 175, 141, 138, 177, 153, - 194, 160, 121, 174, 246, 130, 200, 170, - 221, 196, 142, 210, 199, 155, 154, 244, - 220, 195, 161, 231, 173, 226, 116, 255, -}; - -av_cold int ff_cfhd_init_vlcs(CFHDContext *s) +typedef struct CFHD_RL_ELEM { + uint16_t run; + uint8_t level; + uint8_t len; +} CFHD_RL_ELEM; + +static const CFHD_RL_ELEM table_9_vlc[NB_VLC_TABLE_9] = { + { 1, 0, 1 }, { 1, 1, 2 }, { 1, 2, 4 }, { 1, 3, 5 }, + { 1, 6, 7 }, { 1, 15, 11 }, { 1, 26, 14 }, { 1, 27, 14 }, + { 1, 23, 13 }, { 1, 36, 16 }, { 1, 40, 17 }, { 1, 41, 17 }, + { 1, 32, 15 }, { 1, 48, 19 }, { 1, 49, 19 }, { 1, 51, 20 }, + { 1, 52, 20 }, { 1, 50, 19 }, { 1, 42, 17 }, { 1, 37, 16 }, + { 1, 33, 15 }, { 1, 24, 13 }, { 1, 13, 10 }, { 1, 10, 9 }, + { 1, 8, 8 }, { 1, 5, 6 }, { 80, 0, 8 }, { 1, 16, 11 }, + { 1, 19, 12 }, { 1, 20, 12 }, { 1, 14, 10 }, { 120, 0, 9 }, + { 320, 0, 8 }, { 1, 11, 9 }, { 1, 28, 14 }, { 1, 29, 14 }, + { 1, 25, 13 }, { 1, 21, 12 }, { 1, 17, 11 }, { 1, 34, 15 }, + { 1, 45, 18 }, { 1, 46, 18 }, { 1, 47, 18 }, { 1, 57, 23 }, + { 1, 58, 23 }, { 1, 59, 23 }, { 1, 62, 24 }, { 1, 63, 24 }, + { 1, 56, 22 }, { 1, 60, 23 }, { 1, 61, 24 }, { 1, 64, 25 }, + { 0, 64, 26 }, { 1, 64, 26 }, { 1, 53, 20 }, { 1, 54, 20 }, + { 1, 55, 20 }, { 1, 38, 16 }, { 1, 30, 14 }, { 1, 31, 14 }, + { 1, 43, 17 }, { 1, 44, 17 }, { 1, 39, 16 }, { 1, 35, 15 }, + { 1, 22, 12 }, { 1, 18, 11 }, { 32, 0, 6 }, { 12, 0, 5 }, + { 1, 4, 5 }, { 160, 0, 6 }, { 1, 7, 7 }, { 1, 9, 8 }, + { 100, 0, 9 }, { 1, 12, 9 }, +}; + +static const CFHD_RL_ELEM table_18_vlc[NB_VLC_TABLE_18] = { + { 1, 0, 1 }, { 1, 1, 2 }, { 1, 4, 6 }, { 1, 14, 10 }, + { 1, 23, 12 }, { 1, 41, 15 }, { 1, 54, 17 }, { 1, 69, 19 }, + { 1, 77, 20 }, { 1, 85, 21 }, { 1, 108, 24 }, { 1, 237, 25 }, + { 1, 238, 25 }, { 1, 101, 23 }, { 1, 172, 25 }, { 1, 173, 25 }, + { 1, 170, 25 }, { 1, 171, 25 }, { 1, 227, 25 }, { 1, 162, 25 }, + { 1, 156, 25 }, { 1, 157, 25 }, { 1, 243, 25 }, { 1, 134, 25 }, + { 1, 135, 25 }, { 1, 136, 25 }, { 1, 128, 25 }, { 1, 129, 25 }, + { 1, 247, 25 }, { 1, 127, 25 }, { 1, 178, 25 }, { 1, 179, 25 }, + { 1, 214, 25 }, { 1, 118, 25 }, { 1, 204, 25 }, { 1, 205, 25 }, + { 1, 198, 25 }, { 1, 199, 25 }, { 1, 245, 25 }, { 1, 246, 25 }, + { 1, 242, 25 }, { 1, 244, 25 }, { 1, 230, 25 }, { 1, 119, 25 }, + { 1, 193, 25 }, { 1, 194, 25 }, { 1, 186, 25 }, { 1, 187, 25 }, + { 1, 211, 25 }, { 1, 190, 25 }, { 1, 163, 25 }, { 1, 164, 25 }, + { 1, 220, 25 }, { 1, 221, 25 }, { 1, 216, 25 }, { 1, 217, 25 }, + { 1, 212, 25 }, { 1, 213, 25 }, { 1, 206, 25 }, { 1, 208, 25 }, + { 1, 209, 25 }, { 1, 210, 25 }, { 1, 122, 25 }, { 1, 248, 25 }, + { 1, 235, 25 }, { 1, 148, 25 }, { 1, 253, 25 }, { 1, 254, 25 }, + { 1, 123, 25 }, { 1, 124, 25 }, { 1, 215, 25 }, { 1, 117, 25 }, + { 1, 234, 25 }, { 1, 236, 25 }, { 1, 142, 25 }, { 1, 143, 25 }, + { 1, 153, 25 }, { 1, 154, 25 }, { 1, 176, 25 }, { 1, 177, 25 }, + { 1, 174, 25 }, { 1, 175, 25 }, { 1, 184, 25 }, { 1, 185, 25 }, + { 1, 240, 25 }, { 1, 241, 25 }, { 1, 239, 25 }, { 1, 141, 25 }, + { 1, 139, 25 }, { 1, 140, 25 }, { 1, 125, 25 }, { 1, 126, 25 }, + { 1, 130, 25 }, { 1, 131, 25 }, { 1, 228, 25 }, { 1, 229, 25 }, + { 1, 232, 25 }, { 1, 233, 25 }, { 1, 132, 25 }, { 1, 133, 25 }, + { 1, 137, 25 }, { 1, 138, 25 }, { 1, 255, 25 }, { 1, 116, 26 }, + { 0, 255, 26 }, { 1, 249, 25 }, { 1, 250, 25 }, { 1, 251, 25 }, + { 1, 252, 25 }, { 1, 120, 25 }, { 1, 121, 25 }, { 1, 222, 25 }, + { 1, 224, 25 }, { 1, 218, 25 }, { 1, 219, 25 }, { 1, 200, 25 }, + { 1, 201, 25 }, { 1, 191, 25 }, { 1, 192, 25 }, { 1, 149, 25 }, + { 1, 150, 25 }, { 1, 151, 25 }, { 1, 152, 25 }, { 1, 146, 25 }, + { 1, 147, 25 }, { 1, 144, 25 }, { 1, 145, 25 }, { 1, 165, 25 }, + { 1, 166, 25 }, { 1, 167, 25 }, { 1, 168, 25 }, { 1, 158, 25 }, + { 1, 159, 25 }, { 1, 223, 25 }, { 1, 169, 25 }, { 1, 207, 25 }, + { 1, 197, 25 }, { 1, 202, 25 }, { 1, 203, 25 }, { 1, 188, 25 }, + { 1, 189, 25 }, { 1, 225, 25 }, { 1, 226, 25 }, { 1, 195, 25 }, + { 1, 196, 25 }, { 1, 182, 25 }, { 1, 183, 25 }, { 1, 231, 25 }, + { 1, 155, 25 }, { 1, 160, 25 }, { 1, 161, 25 }, { 1, 48, 16 }, + { 1, 36, 14 }, { 1, 30, 13 }, { 1, 19, 11 }, { 1, 11, 9 }, + { 32, 0, 9 }, { 1, 15, 10 }, { 1, 24, 12 }, { 1, 42, 15 }, + { 1, 62, 18 }, { 1, 70, 19 }, { 1, 94, 22 }, { 1, 180, 25 }, + { 1, 181, 25 }, { 1, 109, 24 }, { 1, 102, 23 }, { 1, 86, 21 }, + { 1, 78, 20 }, { 1, 55, 17 }, { 1, 49, 16 }, { 1, 37, 14 }, + { 1, 31, 13 }, { 1, 25, 12 }, { 1, 43, 15 }, { 1, 63, 18 }, + { 1, 71, 19 }, { 1, 79, 20 }, { 1, 87, 21 }, { 1, 88, 21 }, + { 1, 56, 17 }, { 1, 50, 16 }, { 1, 38, 14 }, { 180, 0, 13 }, + { 1, 6, 7 }, { 1, 3, 5 }, { 1, 12, 9 }, { 1, 20, 11 }, + { 100, 0, 11 }, { 60, 0, 10 }, { 20, 0, 8 }, { 12, 0, 7 }, + { 1, 9, 8 }, { 1, 16, 10 }, { 1, 32, 13 }, { 1, 44, 15 }, + { 1, 64, 18 }, { 1, 72, 19 }, { 1, 80, 20 }, { 1, 95, 22 }, + { 1, 96, 22 }, { 1, 110, 24 }, { 1, 111, 24 }, { 1, 103, 23 }, + { 1, 104, 23 }, { 1, 105, 23 }, { 1, 57, 17 }, { 1, 65, 18 }, + { 1, 73, 19 }, { 1, 81, 20 }, { 1, 89, 21 }, { 1, 97, 22 }, + { 1, 98, 22 }, { 1, 58, 17 }, { 1, 39, 14 }, { 1, 26, 12 }, + { 1, 21, 11 }, { 1, 13, 9 }, { 1, 7, 7 }, { 1, 5, 6 }, + { 1, 10, 8 }, { 1, 33, 13 }, { 1, 51, 16 }, { 1, 66, 18 }, + { 1, 74, 19 }, { 1, 82, 20 }, { 1, 90, 21 }, { 1, 91, 21 }, + { 1, 59, 17 }, { 1, 45, 15 }, { 1, 52, 16 }, { 1, 67, 18 }, + { 1, 75, 19 }, { 1, 83, 20 }, { 1, 112, 24 }, { 1, 113, 24 }, + { 1, 106, 23 }, { 1, 99, 22 }, { 1, 92, 21 }, { 1, 68, 18 }, + { 1, 76, 19 }, { 1, 84, 20 }, { 1, 107, 23 }, { 1, 114, 24 }, + { 1, 115, 24 }, { 1, 100, 22 }, { 1, 93, 21 }, { 1, 46, 15 }, + { 1, 27, 12 }, { 1, 34, 13 }, { 320, 0, 13 }, { 1, 28, 12 }, + { 1, 17, 10 }, { 1, 22, 11 }, { 1, 40, 14 }, { 1, 53, 16 }, + { 1, 60, 17 }, { 1, 61, 17 }, { 1, 47, 15 }, { 1, 35, 13 }, + { 1, 29, 12 }, { 1, 18, 10 }, { 1, 8, 7 }, { 1, 2, 3 }, +}; + +static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, + const CFHD_RL_ELEM table_vlc[], unsigned table_size, + CFHD_RL_VLC_ELEM tmp[], void *logctx) { - int i, j, ret = 0; - uint32_t new_cfhd_vlc_bits[NB_VLC_TABLE_18 * 2]; - uint8_t new_cfhd_vlc_len[NB_VLC_TABLE_18 * 2]; - uint16_t new_cfhd_vlc_run[NB_VLC_TABLE_18 * 2]; - int16_t new_cfhd_vlc_level[NB_VLC_TABLE_18 * 2]; + VLC vlc; + unsigned j; + int ret; /** Similar to dv.c, generate signed VLC tables **/ - /* Table 9 */ - for (i = 0, j = 0; i < NB_VLC_TABLE_9; i++, j++) { - new_cfhd_vlc_bits[j] = table_9_vlc_bits[i]; - new_cfhd_vlc_len[j] = table_9_vlc_len[i]; - new_cfhd_vlc_run[j] = table_9_vlc_run[i]; - new_cfhd_vlc_level[j] = table_9_vlc_level[i]; + for (unsigned i = j = 0; i < table_size; i++, j++) { + tmp[j].len = table_vlc[i].len; + tmp[j].run = table_vlc[i].run; + tmp[j].level = table_vlc[i].level; /* Don't include the zero level nor escape bits */ - if (table_9_vlc_level[i] && - new_cfhd_vlc_bits[j] != table_9_vlc_bits[NB_VLC_TABLE_9-1]) { - new_cfhd_vlc_bits[j] <<= 1; - new_cfhd_vlc_len[j]++; + if (table_vlc[i].level && table_vlc[i].run) { + tmp[j].len++; j++; - new_cfhd_vlc_bits[j] = (table_9_vlc_bits[i] << 1) | 1; - new_cfhd_vlc_len[j] = table_9_vlc_len[i] + 1; - new_cfhd_vlc_run[j] = table_9_vlc_run[i]; - new_cfhd_vlc_level[j] = -table_9_vlc_level[i]; + tmp[j].len = table_vlc[i].len + 1; + tmp[j].run = table_vlc[i].run; + tmp[j].level = -table_vlc[i].level; } } - ret = init_vlc(&s->vlc_9, VLC_BITS, j, new_cfhd_vlc_len, - 1, 1, new_cfhd_vlc_bits, 4, 4, 0); + ret = ff_init_vlc_from_lengths(&vlc, VLC_BITS, j, + &tmp[0].len, sizeof(tmp[0]), + NULL, 0, 0, 0, 0, logctx); if (ret < 0) return ret; - for (i = 0; i < s->vlc_9.table_size; i++) { - int code = s->vlc_9.table[i].sym; - int len = s->vlc_9.table[i].len; + av_assert0(vlc.table_size == out_size); + + for (unsigned i = out_size; i-- > 0;) { + int code = vlc.table[i].sym; + int len = vlc.table[i].len; int level, run; if (len < 0) { // more bits needed run = 0; level = code; } else { - run = new_cfhd_vlc_run[code]; - level = new_cfhd_vlc_level[code]; + run = tmp[code].run; + level = tmp[code].level; } - s->table_9_rl_vlc[i].len = len; - s->table_9_rl_vlc[i].level = level; - s->table_9_rl_vlc[i].run = run; + out[i].len = len; + out[i].level = level; + out[i].run = run; } + ff_free_vlc(&vlc); - /* Table 18 */ - for (i = 0, j = 0; i < NB_VLC_TABLE_18; i++, j++) { - new_cfhd_vlc_bits[j] = table_18_vlc_bits[i]; - new_cfhd_vlc_len[j] = table_18_vlc_len[i]; - new_cfhd_vlc_run[j] = table_18_vlc_run[i]; - new_cfhd_vlc_level[j] = table_18_vlc_level[i]; + return 0; +} - /* Don't include the zero level nor escape bits */ - if (table_18_vlc_level[i] && - new_cfhd_vlc_bits[j] != table_18_vlc_bits[NB_VLC_TABLE_18-1]) { - new_cfhd_vlc_bits[j] <<= 1; - new_cfhd_vlc_len[j]++; - j++; - new_cfhd_vlc_bits[j] = (table_18_vlc_bits[i] << 1) | 1; - new_cfhd_vlc_len[j] = table_18_vlc_len[i] + 1; - new_cfhd_vlc_run[j] = table_18_vlc_run[i]; - new_cfhd_vlc_level[j] = -table_18_vlc_level[i]; - } - } +av_cold int ff_cfhd_init_vlcs(CFHDContext *s) +{ + int ret; - ret = init_vlc(&s->vlc_18, VLC_BITS, j, new_cfhd_vlc_len, - 1, 1, new_cfhd_vlc_bits, 4, 4, 0); + /* Table 18 - we reuse the unused table_9_rl_vlc as scratch buffer here */ + ret = cfhd_init_vlc(s->table_18_rl_vlc, FF_ARRAY_ELEMS(s->table_18_rl_vlc), + table_18_vlc, FF_ARRAY_ELEMS(table_18_vlc), + s->table_9_rl_vlc, s->avctx); if (ret < 0) return ret; - av_assert0(s->vlc_18.table_size == 4572); - - for (i = 0; i < s->vlc_18.table_size; i++) { - int code = s->vlc_18.table[i].sym; - int len = s->vlc_18.table[i].len; - int level, run; - - if (len < 0) { // more bits needed - run = 0; - level = code; - } else { - run = new_cfhd_vlc_run[code]; - level = new_cfhd_vlc_level[code]; - } - s->table_18_rl_vlc[i].len = len; - s->table_18_rl_vlc[i].level = level; - s->table_18_rl_vlc[i].run = run; - } - - return ret; + /* Table 9 - table_9_rl_vlc itself is used as scratch buffer; it works + * because we are counting down in the final loop */ + ret = cfhd_init_vlc(s->table_9_rl_vlc, FF_ARRAY_ELEMS(s->table_9_rl_vlc), + table_9_vlc, FF_ARRAY_ELEMS(table_9_vlc), + s->table_9_rl_vlc, s->avctx); + if (ret < 0) + return ret; + return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -258,6 +258,11 @@ if (ret < 0) return ret; + if (avctx->height < 4) { + av_log(avctx, AV_LOG_ERROR, "Height must be >= 4.\n"); + return AVERROR_INVALIDDATA; + } + if (avctx->width & 15) { av_log(avctx, AV_LOG_ERROR, "Width must be multiple of 16.\n"); return AVERROR_INVALIDDATA; @@ -267,22 +272,21 @@ for (int i = 0; i < s->planes; i++) { int w8, h8, w4, h4, w2, h2; - int width = i ? avctx->width >> s->chroma_h_shift : avctx->width; - int height = i ? FFALIGN(avctx->height >> s->chroma_v_shift, 8) : - FFALIGN(avctx->height >> s->chroma_v_shift, 8); - ptrdiff_t stride = (FFALIGN(width / 8, 8) + 64) * 8; + const int a_height = FFALIGN(avctx->height, 8); + int width = i ? AV_CEIL_RSHIFT(avctx->width, s->chroma_h_shift) : avctx->width; + int height = i ? a_height >> s->chroma_v_shift: a_height; - w8 = FFALIGN(width / 8, 8) + 64; - h8 = FFALIGN(height, 8) / 8; + w8 = width / 8 + 64; + h8 = height / 8; w4 = w8 * 2; h4 = h8 * 2; w2 = w4 * 2; h2 = h4 * 2; s->plane[i].dwt_buf = - av_calloc(height * stride, sizeof(*s->plane[i].dwt_buf)); + av_calloc(h8 * 8 * w8 * 8, sizeof(*s->plane[i].dwt_buf)); s->plane[i].dwt_tmp = - av_malloc_array(height * stride, sizeof(*s->plane[i].dwt_tmp)); + av_malloc_array(h8 * 8 * w8 * 8, sizeof(*s->plane[i].dwt_tmp)); if (!s->plane[i].dwt_buf || !s->plane[i].dwt_tmp) return AVERROR(ENOMEM); @@ -300,7 +304,7 @@ for (int j = 0; j < DWT_LEVELS; j++) { for (int k = 0; k < FF_ARRAY_ELEMS(s->plane[i].band[j]); k++) { s->plane[i].band[j][k].width = (width / 8) << j; - s->plane[i].band[j][k].height = (height / 8) << j; + s->plane[i].band[j][k].height = height >> (DWT_LEVELS - j); s->plane[i].band[j][k].a_width = w8 << j; s->plane[i].band[j][k].a_height = h8 << j; } @@ -433,11 +437,13 @@ int ret; for (int plane = 0; plane < s->planes; plane++) { + const int h_shift = plane ? s->chroma_h_shift : 0; int width = s->plane[plane].band[2][0].width; int a_width = s->plane[plane].band[2][0].a_width; int height = s->plane[plane].band[2][0].height; int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane; - int16_t *input = (int16_t *)frame->data[act_plane]; + const int16_t *input = (int16_t *)frame->data[act_plane]; + int16_t *buf; int16_t *low = s->plane[plane].l_h[6]; int16_t *high = s->plane[plane].l_h[7]; ptrdiff_t in_stride = frame->linesize[act_plane] / 2; @@ -452,7 +458,7 @@ dsp->horiz_filter(input, low, high, in_stride, a_width, a_width, - width * 2, height * 2); + avctx->width >> h_shift, avctx->height); input = s->plane[plane].l_h[7]; low = s->plane[plane].subband[7]; @@ -481,13 +487,13 @@ high = s->plane[plane].l_h[4]; high_stride = s->plane[plane].band[1][0].a_width; + buf = s->plane[plane].l_h[7]; for (int i = 0; i < height * 2; i++) { for (int j = 0; j < width * 2; j++) - input[j] /= 4; - input += a_width * 2; + buf[j] /= 4; + buf += a_width * 2; } - input = s->plane[plane].l_h[7]; dsp->horiz_filter(input, low, high, a_width * 2, low_stride, high_stride, width * 2, height * 2); @@ -518,14 +524,14 @@ high_stride = s->plane[plane].band[0][0].a_width; if (avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { + int16_t *buf = s->plane[plane].l_h[4]; for (int i = 0; i < height * 2; i++) { for (int j = 0; j < width * 2; j++) - input[j] /= 4; - input += a_width * 2; + buf[j] /= 4; + buf += a_width * 2; } } - input = s->plane[plane].l_h[4]; dsp->horiz_filter(input, low, high, a_width * 2, low_stride, high_stride, width * 2, height * 2); @@ -547,7 +553,7 @@ width, height * 2); } - ret = ff_alloc_packet(avctx, pkt, 64LL + s->planes * (2LL * avctx->width * avctx->height + 1000LL)); + ret = ff_alloc_packet(avctx, pkt, 256LL + s->planes * (2LL * avctx->width * (avctx->height + 15) + 2048LL)); if (ret < 0) return ret; @@ -590,6 +596,9 @@ bytestream2_put_be16(pby, avctx->width); bytestream2_put_be16(pby, ImageHeight); + bytestream2_put_be16(pby, FFALIGN(avctx->height, 8)); + + bytestream2_put_be16(pby, -DisplayHeight); bytestream2_put_be16(pby, avctx->height); bytestream2_put_be16(pby, -FrameNumber); @@ -847,20 +856,21 @@ const FFCodec ff_cfhd_encoder = { .p.name = "cfhd", - .p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), + CODEC_LONG_NAME("GoPro CineForm HD"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CFHD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(CFHDEncContext), .p.priv_class = &cfhd_class, .init = cfhd_encode_init, .close = cfhd_encode_close, FF_CODEC_ENCODE_CB(cfhd_encode_frame), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "cfhdencdsp.h" -static av_always_inline void filter(int16_t *input, ptrdiff_t in_stride, +static av_always_inline void filter(const int16_t *input, ptrdiff_t in_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len) @@ -46,7 +46,7 @@ 1 * input[((len-2)-3)*in_stride] + 1 * input[((len-2)-4)*in_stride] + 4) >> 3); } -static void horiz_filter(int16_t *input, int16_t *low, int16_t *high, +static void horiz_filter(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height) @@ -59,7 +59,7 @@ } } -static void vert_filter(int16_t *input, int16_t *low, int16_t *high, +static void vert_filter(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhdencdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,12 +23,12 @@ #include typedef struct CFHDEncDSPContext { - void (*horiz_filter)(int16_t *input, int16_t *low, int16_t *high, + void (*horiz_filter)(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height); - void (*vert_filter)(int16_t *input, int16_t *low, int16_t *high, + void (*vert_filter)(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cfhd.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,6 @@ #include "avcodec.h" #include "bytestream.h" #include "get_bits.h" -#include "vlc.h" #include "cfhddsp.h" enum CFHDParam { @@ -141,10 +140,7 @@ AVCodecContext *avctx; CFHD_RL_VLC_ELEM table_9_rl_vlc[2088]; - VLC vlc_9; - CFHD_RL_VLC_ELEM table_18_rl_vlc[4572]; - VLC vlc_18; int lut[2][256]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepak.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepak.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepak.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepak.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,7 +34,6 @@ */ #include -#include #include #include "libavutil/common.h" @@ -42,7 +41,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" typedef uint8_t cvid_codebook[12]; @@ -508,7 +506,7 @@ const FFCodec ff_cinepak_decoder = { .p.name = "cinepak", - .p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"), + CODEC_LONG_NAME("Cinepak"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CINEPAK, .priv_data_size = sizeof(CinepakContext), @@ -516,5 +514,4 @@ .close = cinepak_decode_end, FF_CODEC_DECODE_CB(cinepak_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepakenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepakenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepakenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cinepakenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -429,7 +429,7 @@ // sets out to the sub picture starting at (x,y) in in static void get_sub_picture(CinepakEncContext *s, int x, int y, - uint8_t * in_data[4], int in_linesize[4], + uint8_t *const in_data[4], const int in_linesize[4], uint8_t *out_data[4], int out_linesize[4]) { out_data[0] = in_data[0] + x + y * in_linesize[0]; @@ -1019,7 +1019,7 @@ // build a copy of the given frame in the correct colorspace for (y = 0; y < s->h; y += 2) for (x = 0; x < s->w; x += 2) { - uint8_t *ir[2]; + const uint8_t *ir[2]; int32_t r, g, b, rr, gg, bb; ir[0] = frame->data[0] + x * 3 + y * frame->linesize[0]; ir[1] = ir[0] + frame->linesize[0]; @@ -1097,7 +1097,7 @@ data, linesize); else get_sub_picture(s, 0, y, - (uint8_t **)frame->data, (int *)frame->linesize, + frame->data, frame->linesize, data, linesize); get_sub_picture(s, 0, y, s->last_frame->data, s->last_frame->linesize, @@ -1216,14 +1216,15 @@ const FFCodec ff_cinepak_encoder = { .p.name = "cinepak", - .p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"), + CODEC_LONG_NAME("Cinepak"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CINEPAK, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(CinepakEncContext), .init = cinepak_encode_init, FF_CODEC_ENCODE_CB(cinepak_encode_frame), .close = cinepak_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .p.priv_class = &cinepak_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/clearvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/clearvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/clearvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/clearvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,9 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "idctdsp.h" -#include "internal.h" #include "mathops.h" #include "clearvideodata.h" @@ -59,13 +59,6 @@ MV *mv; } MVInfo; -typedef struct TileInfo { - uint16_t flags; - int16_t bias; - MV mv; - struct TileInfo *child[4]; -} TileInfo; - typedef struct CLVContext { AVCodecContext *avctx; IDCTDSPContext idsp; @@ -222,14 +215,15 @@ return 0; } -static int copy_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, +static int copy_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, int plane, int x, int y, int dx, int dy, int size) { int shift = plane > 0; int sx = x + dx; int sy = y + dy; int sstride, dstride, soff, doff; - uint8_t *sbuf, *dbuf; + uint8_t *dbuf; + const uint8_t *sbuf; int i; if (x < 0 || sx < 0 || y < 0 || sy < 0 || @@ -248,7 +242,7 @@ for (i = 0; i < size; i++) { uint8_t *dptr = &dbuf[doff]; - uint8_t *sptr = &sbuf[soff]; + const uint8_t *sptr = &sbuf[soff]; memcpy(dptr, sptr, size); doff += dstride; @@ -258,7 +252,7 @@ return 0; } -static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, +static int copyadd_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, int plane, int x, int y, int dx, int dy, int size, int bias) { int shift = plane > 0; @@ -267,7 +261,7 @@ int sstride = src->linesize[plane]; int dstride = dst->linesize[plane]; int soff = sx + sy * sstride; - uint8_t *sbuf = src->data[plane]; + const uint8_t *sbuf = src->data[plane]; int doff = x + y * dstride; uint8_t *dbuf = dst->data[plane]; int i, j; @@ -281,7 +275,7 @@ for (j = 0; j < size; j++) { uint8_t *dptr = &dbuf[doff]; - uint8_t *sptr = &sbuf[soff]; + const uint8_t *sptr = &sbuf[soff]; for (i = 0; i < size; i++) { int val = sptr[i] + bias; @@ -296,7 +290,7 @@ return 0; } -static MV mvi_predict(MVInfo *mvi, int mb_x, int mb_y, MV diff) +static MV *mvi_predict(MVInfo *mvi, int mb_x, int mb_y) { MV res, pred_mv; int left_mv, right_mv, top_mv, bot_mv; @@ -336,10 +330,16 @@ res.y = bot_mv; } - mvi->mv[mvi->mb_stride + mb_x].x = res.x + diff.x; - mvi->mv[mvi->mb_stride + mb_x].y = res.y + diff.y; + mvi->mv[mvi->mb_stride + mb_x].x = res.x; + mvi->mv[mvi->mb_stride + mb_x].y = res.y; + + return &mvi->mv[mvi->mb_stride + mb_x]; +} - return res; +static void mvi_update_prediction(MV *mv, MV diff) +{ + mv->x += diff.x; + mv->y += diff.y; } static void mvi_reset(MVInfo *mvi, int mb_w, int mb_h, int mb_size) @@ -362,19 +362,36 @@ } } -static TileInfo *decode_tile_info(GetBitContext *gb, const LevelCodes *lc, int level) +static int tile_do_block(AVCodecContext *avctx, AVFrame *dst, const AVFrame *src, + int plane, int x, int y, int dx, int dy, int size, int bias) +{ + int ret; + + if (!bias) { + ret = copy_block(avctx, dst, src, plane, x, y, dx, dy, size); + } else { + ret = copyadd_block(avctx, dst, src, plane, x, y, dx, dy, size, bias); + } + + return ret; +} + +static int decode_tile(AVCodecContext *avctx, GetBitContext *gb, + const LevelCodes *lc, + AVFrame *dst, const AVFrame *src, + int plane, int x, int y, int size, + MV root_mv, MV *pred) { - TileInfo *ti; int i, flags = 0; int16_t bias = 0; MV mv = { 0 }; + int err; - if (lc[level].flags_cb.table) { - flags = get_vlc2(gb, lc[level].flags_cb.table, CLV_VLC_BITS, 2); - } + if (lc->flags_cb.table) + flags = get_vlc2(gb, lc->flags_cb.table, CLV_VLC_BITS, 2); - if (lc[level].mv_cb.table) { - uint16_t mv_code = get_vlc2(gb, lc[level].mv_cb.table, CLV_VLC_BITS, 2); + if (lc->mv_cb.table) { + uint16_t mv_code = get_vlc2(gb, lc->mv_cb.table, CLV_VLC_BITS, 2); if (mv_code != MV_ESC) { mv.x = (int8_t)(mv_code & 0xff); @@ -383,10 +400,14 @@ mv.x = get_sbits(gb, 8); mv.y = get_sbits(gb, 8); } + if (pred) + mvi_update_prediction(pred, mv); } + mv.x += root_mv.x; + mv.y += root_mv.y; - if (lc[level].bias_cb.table) { - uint16_t bias_val = get_vlc2(gb, lc[level].bias_cb.table, CLV_VLC_BITS, 2); + if (lc->bias_cb.table) { + uint16_t bias_val = get_vlc2(gb, lc->bias_cb.table, CLV_VLC_BITS, 2); if (bias_val != BIAS_ESC) { bias = (int16_t)(bias_val); @@ -395,69 +416,29 @@ } } - ti = av_calloc(1, sizeof(*ti)); - if (!ti) - return NULL; - - ti->flags = flags; - ti->mv = mv; - ti->bias = bias; - - if (ti->flags) { - for (i = 0; i < 4; i++) { - if (ti->flags & (1 << i)) { - TileInfo *subti = decode_tile_info(gb, lc, level + 1); - ti->child[i] = subti; - } - } - } - - return ti; -} - -static int tile_do_block(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, - int plane, int x, int y, int dx, int dy, int size, int bias) -{ - int ret; - - if (!bias) { - ret = copy_block(avctx, dst, src, plane, x, y, dx, dy, size); - } else { - ret = copyadd_block(avctx, dst, src, plane, x, y, dx, dy, size, bias); - } - - return ret; -} - -static int restore_tree(AVCodecContext *avctx, AVFrame *dst, AVFrame *src, - int plane, int x, int y, int size, - TileInfo *tile, MV root_mv) -{ - int ret; - MV mv; - - mv.x = root_mv.x + tile->mv.x; - mv.y = root_mv.y + tile->mv.y; - - if (!tile->flags) { - ret = tile_do_block(avctx, dst, src, plane, x, y, mv.x, mv.y, size, tile->bias); - } else { - int i, hsize = size >> 1; - + if (flags) { + int hsize = size >> 1; for (i = 0; i < 4; i++) { int xoff = (i & 2) == 0 ? 0 : hsize; int yoff = (i & 1) == 0 ? 0 : hsize; - if (tile->child[i]) { - ret = restore_tree(avctx, dst, src, plane, x + xoff, y + yoff, hsize, tile->child[i], root_mv); - av_freep(&tile->child[i]); + if (flags & (1 << i)) { + err = decode_tile(avctx, gb, lc + 1, dst, src, plane, + x + xoff, y + yoff, hsize, root_mv, NULL); } else { - ret = tile_do_block(avctx, dst, src, plane, x + xoff, y + yoff, mv.x, mv.y, hsize, tile->bias); + err = tile_do_block(avctx, dst, src, plane, x + xoff, y + yoff, + mv.x, mv.y, hsize, bias); } + if (err < 0) + return err; } + } else { + err = tile_do_block(avctx, dst, src, plane, x, y, mv.x, mv.y, size, bias); + if (err < 0) + return err; } - return ret; + return 0; } static void extend_edges(AVFrame *buf, int tile_size) @@ -576,11 +557,13 @@ for (j = 0; j < c->pmb_height; j++) { for (i = 0; i < c->pmb_width; i++) { + MV *mvp, mv; if (get_bits_left(&c->gb) <= 0) return AVERROR_INVALIDDATA; - if (get_bits1(&c->gb)) { - MV mv = mvi_predict(&c->mvi, i, j, zero_mv); + mvp = mvi_predict(&c->mvi, i, j); + mv = *mvp; + if (get_bits1(&c->gb)) { for (plane = 0; plane < 3; plane++) { int16_t x = plane == 0 ? i << c->tile_shift : i << (c->tile_shift - 1); int16_t y = plane == 0 ? j << c->tile_shift : j << (c->tile_shift - 1); @@ -596,38 +579,26 @@ int x = i << c->tile_shift; int y = j << c->tile_shift; int size = 1 << c->tile_shift; - TileInfo *tile; - MV mv, cmv; + MV cmv; - tile = decode_tile_info(&c->gb, &lev[0], 0); // Y - if (!tile) - return AVERROR(ENOMEM); - mv = mvi_predict(&c->mvi, i, j, tile->mv); - ret = restore_tree(avctx, c->pic, c->prev, 0, x, y, size, tile, mv); + ret = decode_tile(avctx, &c->gb, &lev[0], c->pic, c->prev, // Y + 0, x, y, size, mv, mvp); if (ret < 0) mb_ret = ret; x = i << (c->tile_shift - 1); y = j << (c->tile_shift - 1); size = 1 << (c->tile_shift - 1); - cmv.x = mv.x + tile->mv.x; - cmv.y = mv.y + tile->mv.y; + cmv = *mvp; cmv.x /= 2; cmv.y /= 2; - av_freep(&tile); - tile = decode_tile_info(&c->gb, &lev[4], 0); // U - if (!tile) - return AVERROR(ENOMEM); - ret = restore_tree(avctx, c->pic, c->prev, 1, x, y, size, tile, cmv); + ret = decode_tile(avctx, &c->gb, &lev[4], c->pic, c->prev, // U + 1, x, y, size, cmv, NULL); if (ret < 0) mb_ret = ret; - av_freep(&tile); - tile = decode_tile_info(&c->gb, &lev[7], 0); // V - if (!tile) - return AVERROR(ENOMEM); - ret = restore_tree(avctx, c->pic, c->prev, 2, x, y, size, tile, cmv); + ret = decode_tile(avctx, &c->gb, &lev[7], c->pic, c->prev, // U + 2, x, y, size, cmv, NULL); if (ret < 0) mb_ret = ret; - av_freep(&tile); } } mvi_update_row(&c->mvi); @@ -769,7 +740,7 @@ const FFCodec ff_clearvideo_decoder = { .p.name = "clearvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"), + CODEC_LONG_NAME("Iterated Systems ClearVideo"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CLEARVIDEO, .priv_data_size = sizeof(CLVContext), @@ -777,5 +748,5 @@ .close = clv_decode_end, FF_CODEC_DECODE_CB(clv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,8 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) @@ -83,12 +83,11 @@ const FFCodec ff_cljr_decoder = { .p.name = "cljr", - .p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), + CODEC_LONG_NAME("Cirrus Logic AccuPak"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CLJR, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cljrenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ CLJRContext *a = avctx->priv_data; PutBitContext pb; int x, y, ret; - uint32_t dither= avctx->frame_number; + uint32_t dither= avctx->frame_num; static const uint32_t ordered_dither[2][2] = { { 0x10400000, 0x104F0000 }, @@ -63,9 +63,9 @@ init_put_bits(&pb, pkt->data, pkt->size); for (y = 0; y < avctx->height; y++) { - uint8_t *luma = &p->data[0][y * p->linesize[0]]; - uint8_t *cb = &p->data[1][y * p->linesize[1]]; - uint8_t *cr = &p->data[2][y * p->linesize[2]]; + const uint8_t *luma = &p->data[0][y * p->linesize[0]]; + const uint8_t *cb = &p->data[1][y * p->linesize[1]]; + const uint8_t *cr = &p->data[2][y * p->linesize[2]]; uint8_t luma_tmp[4]; for (x = 0; x < avctx->width; x += 4) { switch (a->dither_type) { @@ -110,10 +110,10 @@ const FFCodec ff_cljr_encoder = { .p.name = "cljr", - .p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), + CODEC_LONG_NAME("Cirrus Logic AccuPak"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CLJR, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(CLJRContext), FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cllc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cllc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cllc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cllc.c 2023-03-03 13:29:59.000000000 +0000 @@ -493,7 +493,7 @@ const FFCodec ff_cllc_decoder = { .p.name = "cllc", - .p.long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"), + CODEC_LONG_NAME("Canopus Lossless Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CLLC, .priv_data_size = sizeof(CLLCContext), @@ -501,5 +501,4 @@ FF_CODEC_DECODE_CB(cllc_decode_frame), .close = cllc_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "avcodec.h" #include "celp_filters.h" #include "codec_internal.h" +#include "decode.h" #include "internal.h" #include "libavutil/lfg.h" @@ -164,7 +165,7 @@ const FFCodec ff_comfortnoise_decoder = { .p.name = "comfortnoise", - .p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), + CODEC_LONG_NAME("RFC 3389 comfort noise generator"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_COMFORT_NOISE, .priv_data_size = sizeof(CNGContext), @@ -175,6 +176,5 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cngenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -67,7 +67,7 @@ int ret, i; double energy = 0; int qdbov; - int16_t *samples = (int16_t*) frame->data[0]; + const int16_t *samples = (const int16_t*) frame->data[0]; if ((ret = ff_get_encode_buffer(avctx, avpkt, 1 + p->order, 0))) { av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n"); @@ -98,10 +98,10 @@ const FFCodec ff_comfortnoise_encoder = { .p.name = "comfortnoise", - .p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), + CODEC_LONG_NAME("RFC 3389 comfort noise generator"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_COMFORT_NOISE, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(CNGContext), .init = cng_encode_init, FF_CODEC_ENCODE_CB(cng_encode_frame), @@ -109,5 +109,5 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_desc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_desc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_desc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_desc.c 2023-03-03 13:29:59.000000000 +0000 @@ -1462,6 +1462,7 @@ .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, +#if FF_API_AYUV_CODECID { .id = AV_CODEC_ID_AYUV, .type = AVMEDIA_TYPE_VIDEO, @@ -1469,6 +1470,7 @@ .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, +#endif { .id = AV_CODEC_ID_TARGA_Y216, .type = AVMEDIA_TYPE_VIDEO, @@ -1893,6 +1895,34 @@ .long_name = NULL_IF_CONFIG_SMALL("PHM (Portable HalfFloatMap) image"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, + { + .id = AV_CODEC_ID_RADIANCE_HDR, + .type = AVMEDIA_TYPE_VIDEO, + .name = "hdr", + .long_name = NULL_IF_CONFIG_SMALL("HDR (Radiance RGBE format) image"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, + { + .id = AV_CODEC_ID_WBMP, + .type = AVMEDIA_TYPE_VIDEO, + .name = "wbmp", + .long_name = NULL_IF_CONFIG_SMALL("WBMP (Wireless Application Protocol Bitmap) image"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, + { + .id = AV_CODEC_ID_MEDIA100, + .type = AVMEDIA_TYPE_VIDEO, + .name = "media100", + .long_name = NULL_IF_CONFIG_SMALL("Media 100i"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, + { + .id = AV_CODEC_ID_VQC, + .type = AVMEDIA_TYPE_VIDEO, + .name = "vqc", + .long_name = NULL_IF_CONFIG_SMALL("ViewQuest VQC"), + .props = AV_CODEC_PROP_LOSSY, + }, /* various PCM "codecs" */ { @@ -2506,6 +2536,13 @@ .long_name = NULL_IF_CONFIG_SMALL("ADPCM IMA Acorn Replay"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_ADPCM_XMD, + .type = AVMEDIA_TYPE_AUDIO, + .name = "adpcm_xmd", + .long_name = NULL_IF_CONFIG_SMALL("ADPCM Konami XMD"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, /* AMR */ { @@ -2589,6 +2626,20 @@ .long_name = NULL_IF_CONFIG_SMALL("DPCM Xilam DERF"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_WADY_DPCM, + .type = AVMEDIA_TYPE_AUDIO, + .name = "wady_dpcm", + .long_name = NULL_IF_CONFIG_SMALL("DPCM Marble WADY"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, + { + .id = AV_CODEC_ID_CBD2_DPCM, + .type = AVMEDIA_TYPE_AUDIO, + .name = "cbd2_dpcm", + .long_name = NULL_IF_CONFIG_SMALL("DPCM Cuberoot-Delta-Exact"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, /* audio codecs */ { @@ -3274,6 +3325,48 @@ .long_name = NULL_IF_CONFIG_SMALL("DFPWM (Dynamic Filter Pulse Width Modulation)"), .props = AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_BONK, + .type = AVMEDIA_TYPE_AUDIO, + .name = "bonk", + .long_name = NULL_IF_CONFIG_SMALL("Bonk audio"), + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, + { + .id = AV_CODEC_ID_MISC4, + .type = AVMEDIA_TYPE_AUDIO, + .name = "misc4", + .long_name = NULL_IF_CONFIG_SMALL("Micronas SC-4 Audio"), + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_INTRA_ONLY, + }, + { + .id = AV_CODEC_ID_APAC, + .type = AVMEDIA_TYPE_AUDIO, + .name = "apac", + .long_name = NULL_IF_CONFIG_SMALL("Marian's A-pac audio"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, + { + .id = AV_CODEC_ID_FTR, + .type = AVMEDIA_TYPE_AUDIO, + .name = "ftr", + .long_name = NULL_IF_CONFIG_SMALL("FTR Voice"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, + { + .id = AV_CODEC_ID_WAVARC, + .type = AVMEDIA_TYPE_AUDIO, + .name = "wavarc", + .long_name = NULL_IF_CONFIG_SMALL("Waveform Archiver"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, + { + .id = AV_CODEC_ID_RKA, + .type = AVMEDIA_TYPE_AUDIO, + .name = "rka", + .long_name = NULL_IF_CONFIG_SMALL("RKA (RK Audio)"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS, + }, /* subtitle codecs */ { @@ -3546,6 +3639,18 @@ .long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), .props = AV_CODEC_PROP_LOSSLESS, }, + { + .id = AV_CODEC_ID_VNULL, + .type = AVMEDIA_TYPE_VIDEO, + .name = "vnull", + .long_name = NULL_IF_CONFIG_SMALL("Null video codec"), + }, + { + .id = AV_CODEC_ID_ANULL, + .type = AVMEDIA_TYPE_AUDIO, + .name = "anull", + .long_name = NULL_IF_CONFIG_SMALL("Null audio codec"), + }, }; static int descriptor_compare(const void *key, const void *member) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec.h 2023-03-03 13:29:59.000000000 +0000 @@ -50,12 +50,6 @@ * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. */ #define AV_CODEC_CAP_DR1 (1 << 1) -#if FF_API_FLAG_TRUNCATED -/** - * @deprecated Use parsers to always send proper frames. - */ -#define AV_CODEC_CAP_TRUNCATED (1 << 3) -#endif /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. @@ -125,9 +119,6 @@ * multithreading-capable external libraries. */ #define AV_CODEC_CAP_OTHER_THREADS (1 << 15) -#if FF_API_AUTO_THREADS -#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS -#endif /** * Audio encoder supports receiving a different number of samples in each call. */ @@ -143,17 +134,6 @@ */ #define AV_CODEC_CAP_AVOID_PROBING (1 << 17) -#if FF_API_UNUSED_CODEC_CAPS -/** - * Deprecated and unused. Use AVCodecDescriptor.props instead - */ -#define AV_CODEC_CAP_INTRA_ONLY 0x40000000 -/** - * Deprecated and unused. Use AVCodecDescriptor.props instead - */ -#define AV_CODEC_CAP_LOSSLESS 0x80000000 -#endif - /** * Codec is backed by a hardware implementation. Typically used to * identify a non-hwaccel hardware decoder. For information about hwaccels, use @@ -169,9 +149,9 @@ #define AV_CODEC_CAP_HYBRID (1 << 19) /** - * This codec takes the reordered_opaque field from input AVFrames - * and returns it in the corresponding field in AVCodecContext after - * encoding. + * This encoder can reorder user opaque values from input AVFrames and return + * them with corresponding output packets. + * @see AV_CODEC_FLAG_COPY_OPAQUE */ #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) @@ -183,6 +163,14 @@ #define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) /** + * The encoder is able to output reconstructed frame data, i.e. raw frames that + * would be produced by decoding the encoded bitstream. + * + * Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag. + */ +#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22) + +/** * AVProfile. */ typedef struct AVProfile { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_id.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_id.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_id.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_id.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,8 @@ #include "libavutil/avutil.h" #include "libavutil/samplefmt.h" +#include "version_major.h" + /** * @addtogroup lavc_core * @{ @@ -251,7 +253,9 @@ AV_CODEC_ID_AVRP, AV_CODEC_ID_012V, AV_CODEC_ID_AVUI, +#if FF_API_AYUV_CODECID AV_CODEC_ID_AYUV, +#endif AV_CODEC_ID_TARGA_Y216, AV_CODEC_ID_V308, AV_CODEC_ID_V408, @@ -312,6 +316,10 @@ AV_CODEC_ID_JPEGXL, AV_CODEC_ID_QOI, AV_CODEC_ID_PHM, + AV_CODEC_ID_RADIANCE_HDR, + AV_CODEC_ID_WBMP, + AV_CODEC_ID_MEDIA100, + AV_CODEC_ID_VQC, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -405,6 +413,7 @@ AV_CODEC_ID_ADPCM_IMA_CUNNING, AV_CODEC_ID_ADPCM_IMA_MOFLEX, AV_CODEC_ID_ADPCM_IMA_ACORN, + AV_CODEC_ID_ADPCM_XMD, /* AMR */ AV_CODEC_ID_AMR_NB = 0x12000, @@ -422,6 +431,8 @@ AV_CODEC_ID_SDX2_DPCM, AV_CODEC_ID_GREMLIN_DPCM, AV_CODEC_ID_DERF_DPCM, + AV_CODEC_ID_WADY_DPCM, + AV_CODEC_ID_CBD2_DPCM, /* audio codecs */ AV_CODEC_ID_MP2 = 0x15000, @@ -521,6 +532,12 @@ AV_CODEC_ID_FASTAUDIO, AV_CODEC_ID_MSNSIREN, AV_CODEC_ID_DFPWM, + AV_CODEC_ID_BONK, + AV_CODEC_ID_MISC4, + AV_CODEC_ID_APAC, + AV_CODEC_ID_FTR, + AV_CODEC_ID_WAVARC, + AV_CODEC_ID_RKA, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -575,6 +592,16 @@ * stream (only used by libavformat) */ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket + /** + * Dummy null video codec, useful mainly for development and debugging. + * Null encoder/decoder discard all input and never return any output. + */ + AV_CODEC_ID_VNULL, + /** + * Dummy null audio codec, useful mainly for development and debugging. + * Null encoder/decoder discard all input and never return any output. + */ + AV_CODEC_ID_ANULL, }; /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,12 +23,15 @@ #include "libavutil/attributes.h" #include "codec.h" +#include "config.h" /** - * The codec does not modify any global variables in the init function, - * allowing to call the init function without locking any global mutexes. + * The codec is not known to be init-threadsafe (i.e. it might be unsafe + * to initialize this codec and another codec concurrently, typically because + * the codec calls external APIs that are not known to be thread-safe). + * Therefore calling the codec's init function needs to be guarded with a lock. */ -#define FF_CODEC_CAP_INIT_THREADSAFE (1 << 0) +#define FF_CODEC_CAP_NOT_INIT_THREADSAFE (1 << 0) /** * The codec allows calling the close function for deallocation even if * the init function returned a failure. Without this capability flag, a @@ -73,6 +76,18 @@ * internal logic derive them from AVCodecInternal.last_pkt_props. */ #define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8) +/** + * Codec supports embedded ICC profiles (AV_FRAME_DATA_ICC_PROFILE). + */ +#define FF_CODEC_CAP_ICC_PROFILES (1 << 9) +/** + * The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it + * only wants to be flushed at the end to update some context variables (e.g. + * 2pass stats) or produce a trailing packet. Besides that it immediately + * produces exactly one output packet per each input frame, just as no-delay + * encoders do. + */ +#define FF_CODEC_CAP_EOF_FLUSH (1 << 10) /** * FFCodec.codec_tags termination value @@ -251,6 +266,43 @@ const uint32_t *codec_tags; } FFCodec; +#if CONFIG_SMALL +#define CODEC_LONG_NAME(str) .p.long_name = NULL +#else +#define CODEC_LONG_NAME(str) .p.long_name = str +#endif + +#if HAVE_THREADS +#define UPDATE_THREAD_CONTEXT(func) \ + .update_thread_context = (func) +#define UPDATE_THREAD_CONTEXT_FOR_USER(func) \ + .update_thread_context_for_user = (func) +#else +#define UPDATE_THREAD_CONTEXT(func) \ + .update_thread_context = NULL +#define UPDATE_THREAD_CONTEXT_FOR_USER(func) \ + .update_thread_context_for_user = NULL +#endif + +#if FF_API_OLD_CHANNEL_LAYOUT +#define CODEC_OLD_CHANNEL_LAYOUTS(...) CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(((const uint64_t[]) { __VA_ARGS__, 0 })) +#if defined(__clang__) +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) \ + FF_DISABLE_DEPRECATION_WARNINGS \ + .p.channel_layouts = (array), \ + FF_ENABLE_DEPRECATION_WARNINGS +#else +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) .p.channel_layouts = (array), +#endif +#else +/* This is only provided to allow to test disabling FF_API_OLD_CHANNEL_LAYOUT + * without removing all the FF_API_OLD_CHANNEL_LAYOUT codeblocks. + * It is of course still expected to be removed when FF_API_OLD_CHANNEL_LAYOUT + * will be finally removed (along with all usages of these macros). */ +#define CODEC_OLD_CHANNEL_LAYOUTS(...) +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) +#endif + #define FF_CODEC_DECODE_CB(func) \ .cb_type = FF_CODEC_CB_TYPE_DECODE, \ .cb.decode = (func) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_par.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_par.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_par.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/codec_par.h 2023-03-03 13:29:59.000000000 +0000 @@ -32,15 +32,16 @@ /** * @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 + 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 }; /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cook.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cook.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cook.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cook.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,14 +46,14 @@ #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "audiodsp.h" #include "avcodec.h" #include "get_bits.h" #include "bytestream.h" #include "codec_internal.h" -#include "fft.h" -#include "internal.h" +#include "decode.h" #include "sinewin.h" #include "unary.h" @@ -140,7 +140,8 @@ int discarded_packets; /* transform data */ - FFTContext mdct_ctx; + AVTXContext *mdct_ctx; + av_tx_fn mdct_fn; float* mlt_window; /* VLC data */ @@ -248,6 +249,7 @@ { int j, ret; int mlt_size = q->samples_per_channel; + const float scale = 1.0 / 32768.0; if (!(q->mlt_window = av_malloc_array(mlt_size, sizeof(*q->mlt_window)))) return AVERROR(ENOMEM); @@ -258,11 +260,10 @@ q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel); /* Initialize the MDCT. */ - ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0); + ret = av_tx_init(&q->mdct_ctx, &q->mdct_fn, AV_TX_FLOAT_MDCT, + 1, mlt_size, &scale, AV_TX_FULL_IMDCT); if (ret < 0) return ret; - av_log(q->avctx, AV_LOG_DEBUG, "MDCT initialized, order = %d.\n", - av_log2(mlt_size) + 1); return 0; } @@ -336,7 +337,7 @@ av_freep(&q->decoded_bytes_buffer); /* Free the transform. */ - ff_mdct_end(&q->mdct_ctx); + av_tx_uninit(&q->mdct_ctx); /* Free the VLC tables. */ for (i = 0; i < 13; i++) @@ -743,7 +744,7 @@ int i; /* Inverse modified discrete cosine transform */ - q->mdct_ctx.imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer); + q->mdct_fn(q->mdct_ctx, q->mono_mdct_output, inbuffer, sizeof(float)); q->imlt_window(q, buffer1, gains_ptr, previous_buffer); @@ -1298,7 +1299,7 @@ const FFCodec ff_cook_decoder = { .p.name = "cook", - .p.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"), + CODEC_LONG_NAME("Cook / Cooker / Gecko (RealAudio G2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_COOK, .priv_data_size = sizeof(COOKContext), @@ -1308,5 +1309,5 @@ .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_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cpia.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cpia.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cpia.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cpia.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,10 +22,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "get_bits.h" -#include "internal.h" +#include "decode.h" #define FRAME_HEADER_SIZE 64 @@ -198,14 +198,6 @@ // output pixel format avctx->pix_fmt = AV_PIX_FMT_YUV420P; - /* The default timebase set by the v4l2 demuxer leads to probing which is buggy. - * Set some reasonable time_base to skip this. - */ - if (avctx->time_base.num == 1 && avctx->time_base.den == 1000000) { - avctx->time_base.num = 1; - avctx->time_base.den = 60; - } - s->frame = av_frame_alloc(); if (!s->frame) return AVERROR(ENOMEM); @@ -224,7 +216,7 @@ const FFCodec ff_cpia_decoder = { .p.name = "cpia", - .p.long_name = NULL_IF_CONFIG_SMALL("CPiA video format"), + CODEC_LONG_NAME("CPiA video format"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CPIA, .priv_data_size = sizeof(CpiaContext), @@ -232,5 +224,4 @@ .close = cpia_decode_end, FF_CODEC_DECODE_CB(cpia_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cri.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cri.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cri.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cri.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,8 +32,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "thread.h" typedef struct CRIContext { @@ -317,6 +317,9 @@ if (!s->data || !s->data_size) return AVERROR_INVALIDDATA; + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0) return ret; @@ -432,6 +435,7 @@ FF_CODEC_DECODE_CB(cri_decode_frame), .close = cri_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .p.long_name = NULL_IF_CONFIG_SMALL("Cintel RAW"), + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + CODEC_LONG_NAME("Cintel RAW"), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/crystalhd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/crystalhd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/crystalhd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/crystalhd.c 2023-03-03 13:29:59.000000000 +0000 @@ -329,6 +329,10 @@ av_log(avctx, AV_LOG_VERBOSE, "CrystalHD Init for %s\n", avctx->codec->name); + av_log(avctx, AV_LOG_WARNING, "CrystalHD support is deprecated and will " + "be removed. Please contact the developers if you are interested in " + "maintaining it.\n"); + avctx->pix_fmt = AV_PIX_FMT_YUYV422; /* Initialize the library */ @@ -546,7 +550,7 @@ frame->pts = pkt_pts; frame->pkt_pos = -1; - frame->pkt_duration = 0; + frame->duration = 0; frame->pkt_size = -1; if (!priv->need_second_field) { @@ -776,7 +780,7 @@ }; \ const FFCodec ff_##x##_crystalhd_decoder = { \ .p.name = #x "_crystalhd", \ - .p.long_name = NULL_IF_CONFIG_SMALL("CrystalHD " #X " decoder"), \ + CODEC_LONG_NAME("CrystalHD " #X " decoder"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = AV_CODEC_ID_##X, \ .priv_data_size = sizeof(CHDContext), \ @@ -787,7 +791,8 @@ .flush = flush, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ - .caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_SETS_FRAME_PROPS, \ .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \ .p.wrapper_name = "crystalhd", \ }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cscd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cscd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cscd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cscd.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,12 +18,10 @@ * 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 "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/common.h" #if CONFIG_ZLIB @@ -169,7 +167,7 @@ const FFCodec ff_cscd_decoder = { .p.name = "camstudio", - .p.long_name = NULL_IF_CONFIG_SMALL("CamStudio"), + CODEC_LONG_NAME("CamStudio"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CSCD, .priv_data_size = sizeof(CamStudioContext), @@ -177,5 +175,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cuviddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cuviddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cuviddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cuviddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -624,7 +624,7 @@ * So set pkt_pts and clear all the other pkt_ fields. */ frame->pkt_pos = -1; - frame->pkt_duration = 0; + frame->duration = 0; frame->pkt_size = -1; frame->interlaced_frame = !parsed_frame.is_deinterlacing && !parsed_frame.dispinfo.progressive_frame; @@ -1118,7 +1118,7 @@ }; \ const FFCodec ff_##x##_cuvid_decoder = { \ .p.name = #x "_cuvid", \ - .p.long_name = NULL_IF_CONFIG_SMALL("Nvidia CUVID " #X " decoder"), \ + CODEC_LONG_NAME("Nvidia CUVID " #X " decoder"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = AV_CODEC_ID_##X, \ .priv_data_size = sizeof(CuvidContext), \ @@ -1129,7 +1129,8 @@ .flush = cuvid_flush, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ - .caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_SETS_FRAME_PROPS, \ .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cyuv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cyuv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cyuv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/cyuv.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,31 +30,18 @@ #include "config_components.h" -#include -#include #include #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/internal.h" - -typedef struct CyuvDecodeContext { - AVCodecContext *avctx; - int width, height; -} CyuvDecodeContext; - static av_cold int cyuv_decode_init(AVCodecContext *avctx) { - CyuvDecodeContext *s = avctx->priv_data; - - s->avctx = avctx; - s->width = avctx->width; /* width needs to be divisible by 4 for this codec to work */ - if (s->width & 0x3) + if (avctx->width & 0x3) return AVERROR_INVALIDDATA; - s->height = avctx->height; return 0; } @@ -64,7 +51,6 @@ { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - CyuvDecodeContext *s=avctx->priv_data; unsigned char *y_plane; unsigned char *u_plane; @@ -82,7 +68,7 @@ int stream_ptr; unsigned char cur_byte; int pixel_groups; - int rawsize = s->height * FFALIGN(s->width,2) * 2; + int rawsize = avctx->height * FFALIGN(avctx->width,2) * 2; int ret; if (avctx->codec_id == AV_CODEC_ID_AURA) { @@ -93,13 +79,13 @@ * followed by (height) lines each with 3 bytes to represent groups * of 4 pixels. Thus, the total size of the buffer ought to be: * (3 * 16) + height * (width * 3 / 4) */ - if (buf_size == 48 + s->height * (s->width * 3 / 4)) { + if (buf_size == 48 + avctx->height * (avctx->width * 3 / 4)) { avctx->pix_fmt = AV_PIX_FMT_YUV411P; } else if(buf_size == rawsize ) { avctx->pix_fmt = AV_PIX_FMT_UYVY422; } else { av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n", - buf_size, 48 + s->height * (s->width * 3 / 4)); + buf_size, 48 + avctx->height * (avctx->width * 3 / 4)); return AVERROR_INVALIDDATA; } @@ -114,8 +100,8 @@ v_plane = frame->data[2]; if (buf_size == rawsize) { - int linesize = FFALIGN(s->width,2) * 2; - y_plane += frame->linesize[0] * s->height; + int linesize = FFALIGN(avctx->width, 2) * 2; + y_plane += frame->linesize[0] * avctx->height; for (stream_ptr = 0; stream_ptr < rawsize; stream_ptr += linesize) { y_plane -= frame->linesize[0]; memcpy(y_plane, buf+stream_ptr, linesize); @@ -124,10 +110,10 @@ /* iterate through each line in the height */ for (y_ptr = 0, u_ptr = 0, v_ptr = 0; - y_ptr < (s->height * frame->linesize[0]); - y_ptr += frame->linesize[0] - s->width, - u_ptr += frame->linesize[1] - s->width / 4, - v_ptr += frame->linesize[2] - s->width / 4) { + y_ptr < (avctx->height * frame->linesize[0]); + y_ptr += frame->linesize[0] - avctx->width, + u_ptr += frame->linesize[1] - avctx->width / 4, + v_ptr += frame->linesize[2] - avctx->width / 4) { /* reset predictors */ cur_byte = buf[stream_ptr++]; @@ -146,7 +132,7 @@ y_plane[y_ptr++] = y_pred; /* iterate through the remaining pixel groups (4 pixels/group) */ - pixel_groups = s->width / 4 - 1; + pixel_groups = avctx->width / 4 - 1; while (pixel_groups--) { cur_byte = buf[stream_ptr++]; @@ -179,27 +165,23 @@ #if CONFIG_AURA_DECODER const FFCodec ff_aura_decoder = { .p.name = "aura", - .p.long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"), + CODEC_LONG_NAME("Auravision AURA"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AURA, - .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, FF_CODEC_DECODE_CB(cyuv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_CYUV_DECODER const FFCodec ff_cyuv_decoder = { .p.name = "cyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"), + CODEC_LONG_NAME("Creative YUV (CYUV)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CYUV, - .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, FF_CODEC_DECODE_CB(cyuv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "dcahuff.h" #include "dcamath.h" #include "dca_syncwords.h" -#include "internal.h" +#include "decode.h" #if ARCH_ARM #include "arm/dca.h" @@ -67,9 +67,9 @@ 7, 10, 12, 13, 15, 17, 19 }; -static int dca_get_vlc(GetBitContext *s, DCAVLC *v, int i) +static int dca_get_vlc(GetBitContext *s, const VLC *vlc) { - return get_vlc2(s, v->vlc[i].table, v->vlc[i].bits, v->max_depth) + v->offset; + return get_vlc2(s, vlc->table, vlc->bits, 2); } static void get_array(GetBitContext *s, int32_t *array, int size, int n) @@ -362,7 +362,8 @@ // If Huffman code was used, the difference of scales was encoded if (sel < 5) - *scale_index += dca_get_vlc(&s->gb, &ff_dca_vlc_scale_factor, sel); + *scale_index += get_vlc2(&s->gb, ff_dca_vlc_scale_factor[sel].table, + DCA_SCALES_VLC_BITS, 2); else *scale_index = get_bits(&s->gb, sel + 1); @@ -381,7 +382,8 @@ // Absolute value was encoded even when Huffman code was used if (sel < 5) - scale_index = dca_get_vlc(&s->gb, &ff_dca_vlc_scale_factor, sel); + scale_index = get_vlc2(&s->gb, ff_dca_vlc_scale_factor[sel].table, + DCA_SCALES_VLC_BITS, 2); else scale_index = get_bits(&s->gb, sel + 1); @@ -433,7 +435,7 @@ int abits; if (sel < 5) - abits = dca_get_vlc(&s->gb, &ff_dca_vlc_bit_allocation, sel); + abits = dca_get_vlc(&s->gb, &ff_dca_vlc_bit_allocation[sel]); else abits = get_bits(&s->gb, sel - 1); @@ -456,7 +458,8 @@ int sel = s->transition_mode_sel[ch]; for (band = 0; band < s->subband_vq_start[ch]; band++) if (s->bit_allocation[ch][band]) - s->transition_mode[sf][ch][band] = dca_get_vlc(&s->gb, &ff_dca_vlc_transition_mode, sel); + s->transition_mode[sf][ch][band] = get_vlc2(&s->gb, ff_dca_vlc_transition_mode[sel].table, + DCA_TMODE_VLC_BITS, 1); } } @@ -567,7 +570,7 @@ // Extract Huffman codes from the bit stream for (i = 0; i < DCA_SUBBAND_SAMPLES; i++) - audio[i] = dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[abits - 1], sel); + audio[i] = dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[abits - 1][sel]); return 1; } @@ -767,7 +770,9 @@ for (band = 0; band < DCA_SUBBANDS; band++) AV_ZERO128(s->subband_samples[ch][band] - DCA_ADPCM_COEFFS); +#ifdef FF_COPY_SWAP_ZERO_USES_MMX emms_c(); +#endif } static int alloc_sample_buffer(DCACoreDecoder *s) @@ -831,7 +836,9 @@ } } +#ifdef FF_COPY_SWAP_ZERO_USES_MMX emms_c(); +#endif return 0; } @@ -1276,7 +1283,9 @@ for (band = 0; band < DCA_SUBBANDS_X96; band++) AV_ZERO128(s->x96_subband_samples[ch][band] - DCA_ADPCM_COEFFS); +#ifdef FF_COPY_SWAP_ZERO_USES_MMX emms_c(); +#endif } static int alloc_x96_sample_buffer(DCACoreDecoder *s) @@ -1331,7 +1340,7 @@ for (band = s->x96_subband_start; band < s->nsubbands[ch]; band++) { // If Huffman code was used, the difference of abits was encoded if (sel < 7) - abits += dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[5 + 2 * s->x96_high_res], sel); + abits += dca_get_vlc(&s->gb, &ff_dca_vlc_quant_index[5 + 2 * s->x96_high_res][sel]); else abits = get_bits(&s->gb, 3 + s->x96_high_res); @@ -1506,7 +1515,9 @@ } } +#ifdef FF_COPY_SWAP_ZERO_USES_MMX emms_c(); +#endif return 0; } @@ -2224,7 +2235,8 @@ // Filter bank reconstruction s->dcadsp->sub_qmf_float[x96_synth]( &s->synth, - &s->imdct[x96_synth], + s->imdct[x96_synth], + s->imdct_fn[x96_synth], output_samples[spkr], s->subband_samples[ch], ch < x96_nchannels ? s->x96_subband_samples[ch] : NULL, @@ -2413,16 +2425,24 @@ av_cold int ff_dca_core_init(DCACoreDecoder *s) { + int ret; + float scale = 1.0f; + if (!(s->float_dsp = avpriv_float_dsp_alloc(0))) return -1; if (!(s->fixed_dsp = avpriv_alloc_fixed_dsp(0))) return -1; ff_dcadct_init(&s->dcadct); - if (ff_mdct_init(&s->imdct[0], 6, 1, 1.0) < 0) - return -1; - if (ff_mdct_init(&s->imdct[1], 7, 1, 1.0) < 0) - return -1; + + if ((ret = av_tx_init(&s->imdct[0], &s->imdct_fn[0], AV_TX_FLOAT_MDCT, + 1, 32, &scale, 0)) < 0) + return ret; + + if ((ret = av_tx_init(&s->imdct[1], &s->imdct_fn[1], AV_TX_FLOAT_MDCT, + 1, 64, &scale, 0)) < 0) + return ret; + ff_synth_filter_init(&s->synth); s->x96_rand = 1; @@ -2434,8 +2454,8 @@ av_freep(&s->float_dsp); av_freep(&s->fixed_dsp); - ff_mdct_end(&s->imdct[0]); - ff_mdct_end(&s->imdct[1]); + av_tx_uninit(&s->imdct[0]); + av_tx_uninit(&s->imdct[1]); av_freep(&s->subband_buffer); s->subband_size = 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_core.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/float_dsp.h" #include "libavutil/fixed_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "get_bits.h" @@ -33,7 +34,6 @@ #include "dcadct.h" #include "dcamath.h" #include "dcahuff.h" -#include "fft.h" #include "synth_filter.h" #define DCA_CHANNELS 7 @@ -190,7 +190,8 @@ DCADSPData dcadsp_data[DCA_CHANNELS]; ///< FIR history buffers DCADSPContext *dcadsp; DCADCTContext dcadct; - FFTContext imdct[2]; + AVTXContext *imdct[2]; + av_tx_fn imdct_fn[2]; SynthFilterContext synth; AVFloatDSPContext *float_dsp; AVFixedDSPContext *fixed_dsp; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadec.c 2023-03-03 13:29:59.000000000 +0000 @@ -412,7 +412,7 @@ const FFCodec ff_dca_decoder = { .p.name = "dca", - .p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), + CODEC_LONG_NAME("DCA (DTS Coherent Acoustics)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), @@ -425,5 +425,5 @@ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .p.priv_class = &dcadec_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -114,7 +114,8 @@ } static void sub_qmf32_float_c(SynthFilterContext *synth, - FFTContext *imdct, + AVTXContext *imdct, + av_tx_fn imdct_fn, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, @@ -137,13 +138,14 @@ // One subband sample generates 32 interpolated ones synth->synth_filter_float(imdct, hist1, offset, hist2, filter_coeff, - pcm_samples, input, scale); + pcm_samples, input, scale, imdct_fn); pcm_samples += 32; } } static void sub_qmf64_float_c(SynthFilterContext *synth, - FFTContext *imdct, + AVTXContext *imdct, + av_tx_fn imdct_fn, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, @@ -186,7 +188,7 @@ // One subband sample generates 64 interpolated ones synth->synth_filter_float_64(imdct, hist1, offset, hist2, filter_coeff, - pcm_samples, input, scale); + pcm_samples, input, scale, imdct_fn); pcm_samples += 64; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcadsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,8 @@ #define AVCODEC_DCADSP_H #include "libavutil/common.h" +#include "libavutil/tx.h" -#include "fft.h" #include "dcadct.h" #include "synth_filter.h" @@ -47,7 +47,8 @@ float *hist, ptrdiff_t len); void (*sub_qmf_float[2])(SynthFilterContext *synth, - FFTContext *imdct, + AVTXContext *imdct, + av_tx_fn imdct_fn, float *pcm_samples, int32_t **subband_samples_lo, int32_t **subband_samples_hi, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,14 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define FFT_FLOAT 0 - #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "libavutil/ffmath.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" +#include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" #include "dca.h" @@ -38,9 +38,6 @@ #include "dcadata.h" #include "dcaenc.h" #include "encode.h" -#include "fft.h" -#include "internal.h" -#include "mathops.h" #include "put_bits.h" #define MAX_CHANNELS 6 @@ -64,7 +61,8 @@ AVClass *class; PutBitContext pb; DCAADPCMEncContext adpcm_ctx; - FFTContext mdct; + AVTXContext *mdct; + av_tx_fn mdct_fn; CompressionOptions options; int frame_size; int frame_bits; @@ -161,11 +159,53 @@ } } +static uint16_t bitalloc_12_table[DCA_BITALLOC_12_COUNT][12 + 1][2]; + +static uint16_t bitalloc_table[DCA_NUM_BITALLOC_CODES][2]; +static const uint16_t (*bitalloc_tables[DCA_CODE_BOOKS][8])[2]; + +static av_cold void create_enc_table(uint16_t dst[][2], unsigned count, + const uint8_t (**src_tablep)[2]) +{ + const uint8_t (*src_table)[2] = *src_tablep; + uint16_t code = 0; + + for (unsigned i = 0; i < count; i++) { + unsigned dst_idx = src_table[i][0]; + + dst[dst_idx][0] = code >> (16 - src_table[i][1]); + dst[dst_idx][1] = src_table[i][1]; + + code += 1 << (16 - src_table[i][1]); + } + *src_tablep += count; +} + +static av_cold void dcaenc_init_static_tables(void) +{ + uint16_t (*bitalloc_dst)[2] = bitalloc_table; + const uint8_t (*src_table)[2] = ff_dca_vlc_src_tables; + + for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { + for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) { + create_enc_table(bitalloc_dst, ff_dca_bitalloc_sizes[i], + &src_table); + bitalloc_tables[i][j] = bitalloc_dst - ff_dca_bitalloc_offsets[i]; + bitalloc_dst += ff_dca_bitalloc_sizes[i]; + } + } + + for (unsigned i = 0; i < DCA_BITALLOC_12_COUNT; i++) + create_enc_table(&bitalloc_12_table[i][1], 12, &src_table); +} + static int encode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; DCAEncContext *c = avctx->priv_data; AVChannelLayout layout = avctx->ch_layout; int i, j, k, min_frame_bits; + float scale = 1.0f; int ret; if ((ret = subband_bufer_alloc(c)) < 0) @@ -182,26 +222,24 @@ if (ff_dcaadpcm_init(&c->adpcm_ctx)) return AVERROR(ENOMEM); - if (layout.order == AV_CHANNEL_ORDER_UNSPEC) { - av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The " - "encoder will guess the layout, but it " - "might be incorrect.\n"); - av_channel_layout_default(&layout, layout.nb_channels); - } - - if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO)) + switch (layout.nb_channels) { + case 1: /* mono */ c->channel_config = 0; - else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) + break; + case 2: /* stereo */ c->channel_config = 2; - else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_2_2)) + break; + case 4: /* 2.2 */ c->channel_config = 8; - else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0)) + break; + case 5: /* 5.0 */ c->channel_config = 9; - else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1)) + break; + case 6: /* 5.1 */ c->channel_config = 9; - else { - av_log(avctx, AV_LOG_ERROR, "Unsupported channel layout!\n"); - return AVERROR_PATCHWELCOME; + break; + default: + av_assert1(!"impossible channel layout"); } if (c->lfe_channel) { @@ -249,7 +287,7 @@ avctx->frame_size = 32 * SUBBAND_SAMPLES; - if ((ret = ff_mdct_init(&c->mdct, 9, 0, 1.0)) < 0) + if ((ret = av_tx_init(&c->mdct, &c->mdct_fn, AV_TX_INT32_MDCT, 0, 256, &scale, 0)) < 0) return ret; /* Init all tables */ @@ -309,13 +347,14 @@ c->band_spectrum_tab[1][j] = (int32_t)(200 * log10(accum)); } + ff_thread_once(&init_static_once, dcaenc_init_static_tables); return 0; } static av_cold int encode_close(AVCodecContext *avctx) { DCAEncContext *c = avctx->priv_data; - ff_mdct_end(&c->mdct); + av_tx_uninit(&c->mdct); subband_bufer_free(c); ff_dcaadpcm_free(&c->adpcm_ctx); @@ -402,6 +441,39 @@ } } +static uint32_t dca_vlc_calc_alloc_bits(const int values[], uint8_t n, uint8_t sel) +{ + uint32_t sum = 0; + for (unsigned i = 0; i < n; i++) + sum += bitalloc_12_table[sel][values[i]][1]; + return sum; +} + +static void dca_vlc_enc_alloc(PutBitContext *pb, const int values[], + uint8_t n, uint8_t sel) +{ + for (unsigned i = 0; i < n; i++) + put_bits(pb, bitalloc_12_table[sel][values[i]][1], + bitalloc_12_table[sel][values[i]][0]); +} + +static uint32_t dca_vlc_calc_quant_bits(const int values[], uint8_t n, + uint8_t sel, uint8_t table) +{ + uint32_t sum = 0; + for (unsigned i = 0; i < n; i++) + sum += bitalloc_tables[table][sel][values[i]][1]; + return sum; +} + +static void dca_vlc_enc_quant(PutBitContext *pb, const int values[], + uint8_t n, uint8_t sel, uint8_t table) +{ + for (unsigned i = 0; i < n; i++) + put_bits(pb, bitalloc_tables[table][sel][values[i]][1], + bitalloc_tables[table][sel][values[i]][0]); +} + static int32_t get_cb(DCAEncContext *c, int32_t in) { int i, res = 0; @@ -434,7 +506,7 @@ for (i = 0; i < 512; i++) data[i] = norm__(mul32(in[i], 0x3fffffff - (COS_T(4 * i + 2) >> 1)), 4); - c->mdct.mdct_calc(&c->mdct, coeff, data); + c->mdct_fn(c->mdct, coeff, data, sizeof(int32_t)); for (i = 0; i < 256; i++) { const int32_t cb = get_cb(c, coeff[i]); power[i] = add_cb(c, cb, cb); @@ -697,8 +769,8 @@ { uint8_t sel, id = abits - 1; for (sel = 0; sel < ff_dca_quant_index_group_size[id]; sel++) - result[sel] += ff_dca_vlc_calc_quant_bits(quantized, SUBBAND_SAMPLES, - sel, id); + result[sel] += dca_vlc_calc_quant_bits(quantized, SUBBAND_SAMPLES, + sel, id); } static uint32_t set_best_code(uint32_t vlc_bits[DCA_CODE_BOOKS][7], @@ -759,7 +831,7 @@ } for (i = 0; i < DCA_BITALLOC_12_COUNT; i++) { - t = ff_dca_vlc_calc_alloc_bits(abits, bands, i); + t = dca_vlc_calc_alloc_bits(abits, bands, i); if (t < best_bits) { best_bits = t; best_sel = i; @@ -1083,8 +1155,8 @@ sel = c->quant_index_sel[ch][c->abits[ch][band] - 1]; // Huffman codes if (sel < ff_dca_quant_index_group_size[c->abits[ch][band] - 1]) { - ff_dca_vlc_enc_quant(&c->pb, &c->quantized[ch][band][ss * 8], 8, - sel, c->abits[ch][band] - 1); + dca_vlc_enc_quant(&c->pb, &c->quantized[ch][band][ss * 8], 8, + sel, c->abits[ch][band] - 1); return; } @@ -1137,8 +1209,8 @@ put_bits(&c->pb, 5, c->abits[ch][band]); } } else { - ff_dca_vlc_enc_alloc(&c->pb, c->abits[ch], DCAENC_SUBBANDS, - c->bit_allocation_sel[ch]); + dca_vlc_enc_alloc(&c->pb, c->abits[ch], DCAENC_SUBBANDS, + c->bit_allocation_sel[ch]); } } @@ -1215,8 +1287,6 @@ flush_put_bits(&c->pb); memset(put_bits_ptr(&c->pb), 0, put_bytes_left(&c->pb, 0)); - avpkt->pts = frame->pts; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; return 0; } @@ -1242,26 +1312,22 @@ const FFCodec ff_dca_encoder = { .p.name = "dca", - .p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), + CODEC_LONG_NAME("DCA (DTS Coherent Acoustics)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DTS, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(DCAEncContext), .init = encode_init, .close = encode_close, FF_CODEC_ENCODE_CB(encode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_2_2, - AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0, + AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,971 +22,23 @@ #include -#include "libavutil/avassert.h" #include "libavutil/macros.h" +#include "dcadata.h" #include "dcahuff.h" -#include "put_bits.h" -#define TMODE_COUNT 4 -static const uint8_t tmode_vlc_bits[TMODE_COUNT] = { 3, 3, 3, 2 }; -static const uint16_t tmode_codes[TMODE_COUNT][4] = { - { 0x0000, 0x0002, 0x0006, 0x0007 }, - { 0x0002, 0x0006, 0x0007, 0x0000 }, - { 0x0006, 0x0007, 0x0000, 0x0002 }, - { 0x0000, 0x0001, 0x0002, 0x0003 } -}; - -static const uint8_t tmode_bits[TMODE_COUNT][4] = { - { 1, 2, 3, 3 }, - { 2, 3, 3, 1 }, - { 3, 3, 1, 2 }, - { 2, 2, 2, 2 } -}; - -#define BITALLOC_12_VLC_BITS 9 static const uint8_t bitalloc_12_vlc_bits[DCA_BITALLOC_12_COUNT] = { 9, 7, 7, 9, 9 }; -static const uint16_t bitalloc_12_codes[DCA_BITALLOC_12_COUNT][12] = { - { 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, 0x00FF, 0x00FE, - 0x01FB, 0x01FA, 0x01F9, 0x01F8, }, - { 0x0001, 0x0000, 0x0002, 0x000F, 0x000C, 0x001D, 0x0039, 0x0038, - 0x0037, 0x0036, 0x0035, 0x0034, }, - { 0x0000, 0x0007, 0x0005, 0x0004, 0x0002, 0x000D, 0x000C, 0x0006, - 0x000F, 0x001D, 0x0039, 0x0038, }, - { 0x0003, 0x0002, 0x0000, 0x0002, 0x0006, 0x000E, 0x001E, 0x003E, - 0x007E, 0x00FE, 0x01FF, 0x01FE, }, - { 0x0001, 0x0000, 0x0002, 0x0006, 0x000E, 0x003F, 0x003D, 0x007C, - 0x0079, 0x0078, 0x00FB, 0x00FA, } -}; - -static const uint8_t bitalloc_12_bits[DCA_BITALLOC_12_COUNT][12] = { - { 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 9, 9 }, - { 1, 2, 3, 5, 5, 6, 7, 7, 7, 7, 7, 7 }, - { 2, 3, 3, 3, 3, 4, 4, 4, 5, 6, 7, 7 }, - { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10 }, - { 1, 2, 3, 4, 5, 7, 7, 8, 8, 8, 9, 9 } -}; - -#define SCALES_COUNT 5 #define SCALES_VLC_BITS 9 -static const uint16_t scales_codes[SCALES_COUNT][129] = { - { 0x3AB0, 0x3AB2, 0x3AB4, 0x3AB6, 0x3AB8, 0x3ABA, 0x3ABC, 0x3ABE, - 0x3AC0, 0x3AC2, 0x3AC4, 0x3AC6, 0x3AC8, 0x3ACA, 0x3ACC, 0x3ACE, - 0x3AD0, 0x3AD2, 0x3AD4, 0x3AD6, 0x3AD8, 0x3ADA, 0x3ADC, 0x3ADE, - 0x3AE0, 0x3AE2, 0x3AE4, 0x3AE6, 0x3AE8, 0x3AEA, 0x3AEC, 0x3AEE, - 0x3AF0, 0x3AF2, 0x3AF4, 0x3AF6, 0x3AF8, 0x3AFA, 0x3AFC, 0x3AFE, - 0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054A, 0x054C, 0x054E, - 0x0558, 0x055E, 0x02AD, 0x0154, 0x0754, 0x03A8, 0x0056, 0x0028, - 0x00E8, 0x004A, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005, - 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x004B, - 0x00E9, 0x0029, 0x0057, 0x03A9, 0x0755, 0x0155, 0x02AE, 0x055F, - 0x0559, 0x054F, 0x054D, 0x054B, 0x0549, 0x0547, 0x0545, 0x0543, - 0x0541, 0x3AFF, 0x3AFD, 0x3AFB, 0x3AF9, 0x3AF7, 0x3AF5, 0x3AF3, - 0x3AF1, 0x3AEF, 0x3AED, 0x3AEB, 0x3AE9, 0x3AE7, 0x3AE5, 0x3AE3, - 0x3AE1, 0x3ADF, 0x3ADD, 0x3ADB, 0x3AD9, 0x3AD7, 0x3AD5, 0x3AD3, - 0x3AD1, 0x3ACF, 0x3ACD, 0x3ACB, 0x3AC9, 0x3AC7, 0x3AC5, 0x3AC3, - 0x3AC1, 0x3ABF, 0x3ABD, 0x3ABB, 0x3AB9, 0x3AB7, 0x3AB5, 0x3AB3, - 0x3AB1, }, - { 0x0F60, 0x0F62, 0x0F64, 0x0F66, 0x0F68, 0x0F6A, 0x0F6C, 0x0F6E, - 0x0F70, 0x0F72, 0x0F74, 0x0F76, 0x0F78, 0x0F7A, 0x0F7C, 0x0F7E, - 0x0F80, 0x0F82, 0x0F84, 0x0F86, 0x0F88, 0x0F8A, 0x0F8C, 0x0F8E, - 0x0F90, 0x0F92, 0x0F94, 0x0F96, 0x0F98, 0x0F9A, 0x0F9C, 0x0F9E, - 0x0FA0, 0x0FA2, 0x0FA4, 0x0FA6, 0x0FA8, 0x0FAA, 0x0FAC, 0x0FAE, - 0x0FB0, 0x0FB2, 0x0FB4, 0x0FB6, 0x0FB8, 0x0FBA, 0x0FBC, 0x0FBE, - 0x07A0, 0x07A2, 0x03D2, 0x01EA, 0x00FC, 0x007F, 0x001C, 0x000C, - 0x0004, 0x0034, 0x0010, 0x001B, 0x0009, 0x000B, 0x000E, 0x0001, - 0x0003, 0x0002, 0x000F, 0x000C, 0x000A, 0x0000, 0x0011, 0x0035, - 0x0005, 0x000D, 0x001D, 0x003C, 0x00FD, 0x01EB, 0x03D3, 0x07A3, - 0x07A1, 0x0FBF, 0x0FBD, 0x0FBB, 0x0FB9, 0x0FB7, 0x0FB5, 0x0FB3, - 0x0FB1, 0x0FAF, 0x0FAD, 0x0FAB, 0x0FA9, 0x0FA7, 0x0FA5, 0x0FA3, - 0x0FA1, 0x0F9F, 0x0F9D, 0x0F9B, 0x0F99, 0x0F97, 0x0F95, 0x0F93, - 0x0F91, 0x0F8F, 0x0F8D, 0x0F8B, 0x0F89, 0x0F87, 0x0F85, 0x0F83, - 0x0F81, 0x0F7F, 0x0F7D, 0x0F7B, 0x0F79, 0x0F77, 0x0F75, 0x0F73, - 0x0F71, 0x0F6F, 0x0F6D, 0x0F6B, 0x0F69, 0x0F67, 0x0F65, 0x0F63, - 0x0F61, }, - { 0x51D0, 0x51D2, 0x51D4, 0x51D6, 0x51D8, 0x51DA, 0x51DC, 0x51DE, - 0x51E0, 0x51E2, 0x51E4, 0x51E6, 0x51E8, 0x51EA, 0x51EC, 0x51EE, - 0x51F0, 0x51F2, 0x51F4, 0x51F6, 0x51F8, 0x51FA, 0x51FC, 0x51FE, - 0x70C0, 0x70C2, 0x70C4, 0x70C6, 0x70C8, 0x70CA, 0x70CC, 0x70CE, - 0x70EC, 0x10EA, 0x3868, 0x3877, 0x0876, 0x1C35, 0x0434, 0x0A34, - 0x0E1B, 0x021B, 0x051B, 0x070F, 0x010F, 0x0380, 0x0080, 0x0140, - 0x01C1, 0x0041, 0x00A1, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012, - 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000, - 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B, - 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A2, 0x0042, - 0x01C2, 0x0141, 0x0081, 0x0381, 0x028C, 0x010C, 0x051C, 0x021C, - 0x0E1C, 0x0A35, 0x0435, 0x1C3A, 0x0877, 0x0874, 0x3869, 0x10EB, - 0x70ED, 0x70CF, 0x70CD, 0x70CB, 0x70C9, 0x70C7, 0x70C5, 0x70C3, - 0x70C1, 0x51FF, 0x51FD, 0x51FB, 0x51F9, 0x51F7, 0x51F5, 0x51F3, - 0x51F1, 0x51EF, 0x51ED, 0x51EB, 0x51E9, 0x51E7, 0x51E5, 0x51E3, - 0x51E1, 0x51DF, 0x51DD, 0x51DB, 0x51D9, 0x51D7, 0x51D5, 0x51D3, - 0x51D1, }, - { 0x6F64, 0x6F66, 0x6F68, 0x6F6A, 0x6F6C, 0x6F6E, 0x6F70, 0x6F72, - 0x6F74, 0x6F76, 0x6F78, 0x6F7A, 0x6F7C, 0x6F7E, 0x6F80, 0x6F82, - 0x6F84, 0x6F86, 0x6F88, 0x6F8A, 0x6F8C, 0x6F8E, 0x6F90, 0x6F92, - 0x6F94, 0x6F96, 0x6F98, 0x6F9A, 0x6F9C, 0x6F9E, 0x6FA0, 0x6FA2, - 0x6FA4, 0x6FA6, 0x6FA8, 0x6FAA, 0x6FAC, 0x6FAE, 0x6FB0, 0x6FB2, - 0x6FB4, 0x6FB6, 0x17B4, 0x37DC, 0x0BDB, 0x1BEF, 0x05EE, 0x0DF8, - 0x02F8, 0x06FD, 0x017D, 0x037F, 0x00BF, 0x0040, 0x00C0, 0x0021, - 0x0061, 0x0011, 0x0031, 0x0009, 0x0019, 0x0006, 0x000E, 0x0004, - 0x0000, 0x0005, 0x000F, 0x0007, 0x001A, 0x000A, 0x0036, 0x0016, - 0x006E, 0x002E, 0x00C1, 0x0041, 0x01BC, 0x00BC, 0x037A, 0x017A, - 0x02F9, 0x0DF9, 0x05EF, 0x05EC, 0x1BD8, 0x37DD, 0x17B5, 0x6FB7, - 0x6FB5, 0x6FB3, 0x6FB1, 0x6FAF, 0x6FAD, 0x6FAB, 0x6FA9, 0x6FA7, - 0x6FA5, 0x6FA3, 0x6FA1, 0x6F9F, 0x6F9D, 0x6F9B, 0x6F99, 0x6F97, - 0x6F95, 0x6F93, 0x6F91, 0x6F8F, 0x6F8D, 0x6F8B, 0x6F89, 0x6F87, - 0x6F85, 0x6F83, 0x6F81, 0x6F7F, 0x6F7D, 0x6F7B, 0x6F79, 0x6F77, - 0x6F75, 0x6F73, 0x6F71, 0x6F6F, 0x6F6D, 0x6F6B, 0x6F69, 0x6F67, - 0x6F65, }, - { 0xDF54, 0xDF56, 0xDFC8, 0xDFCA, 0xDFCC, 0xDFCE, 0xDFD0, 0xDFD2, - 0xDFD4, 0xDFD6, 0xDFD8, 0xDFDA, 0xDFDC, 0xDFDE, 0xDFE0, 0xDFE2, - 0x0FE8, 0x2FEA, 0x6FA8, 0x6FF6, 0x07F5, 0x07F7, 0x37D2, 0x37F9, - 0x03F8, 0x0BF8, 0x0BFB, 0x1BEB, 0x01FA, 0x05FA, 0x09FA, 0x0DFA, - 0x0DFF, 0x00FF, 0x02FF, 0x06FB, 0x007C, 0x017C, 0x027C, 0x027F, - 0x003C, 0x00BC, 0x013C, 0x01BC, 0x001C, 0x005C, 0x009C, 0x00DC, - 0x000C, 0x002C, 0x004C, 0x006C, 0x0004, 0x0014, 0x0024, 0x0034, - 0x0000, 0x0008, 0x0010, 0x0018, 0x001E, 0x0002, 0x0006, 0x000A, - 0x000E, 0x000B, 0x0007, 0x0003, 0x001F, 0x0019, 0x0011, 0x0009, - 0x0001, 0x0035, 0x0025, 0x0015, 0x0005, 0x006D, 0x004D, 0x002D, - 0x000D, 0x00DD, 0x009D, 0x005D, 0x001D, 0x01BD, 0x013D, 0x00BD, - 0x003D, 0x037C, 0x027D, 0x017D, 0x007D, 0x06FC, 0x04FC, 0x02FC, - 0x00FC, 0x0DFB, 0x09FB, 0x05FB, 0x01FB, 0x1BF8, 0x1BE8, 0x0BF9, - 0x03F9, 0x37FA, 0x37D3, 0x17F4, 0x07F6, 0x6FF7, 0x6FA9, 0x2FEB, - 0x0FE9, 0xDFE3, 0xDFE1, 0xDFDF, 0xDFDD, 0xDFDB, 0xDFD9, 0xDFD7, - 0xDFD5, 0xDFD3, 0xDFD1, 0xDFCF, 0xDFCD, 0xDFCB, 0xDFC9, 0xDF57, - 0xDF55, } -}; - -static const uint8_t scales_bits[SCALES_COUNT][129] = { - { 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 12, 11, 11, 10, 9, 8, - 8, 7, 6, 6, 5, 4, 4, 3, - 2, 3, 3, 4, 5, 5, 6, 7, - 8, 8, 9, 10, 11, 11, 12, 13, - 13, 13, 13, 13, 13, 13, 13, 13, - 13, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, - 14, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 14, 14, 13, 12, 11, 10, 8, 7, - 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 4, 5, 6, - 6, 7, 8, 9, 11, 12, 13, 14, - 14, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 14, 14, 14, 13, 13, 12, 12, - 12, 11, 11, 11, 10, 10, 9, 9, - 9, 8, 8, 8, 7, 7, 7, 6, - 6, 6, 5, 5, 5, 4, 4, 3, - 3, 3, 4, 4, 5, 5, 5, 6, - 6, 6, 7, 7, 7, 8, 8, 8, - 9, 9, 9, 10, 10, 10, 11, 11, - 12, 12, 12, 13, 13, 13, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, }, - { 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 14, 14, 13, 13, 12, 12, - 11, 11, 10, 10, 9, 8, 8, 7, - 7, 6, 6, 5, 5, 4, 4, 3, - 2, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, - 11, 12, 12, 12, 13, 14, 14, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, - 15, }, - { 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 15, 15, 15, 15, 14, 14, 14, 14, - 13, 13, 13, 13, 12, 12, 12, 12, - 12, 11, 11, 11, 10, 10, 10, 10, - 9, 9, 9, 9, 8, 8, 8, 8, - 7, 7, 7, 7, 6, 6, 6, 6, - 5, 5, 5, 5, 5, 4, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, - 5, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, - 9, 10, 10, 10, 10, 11, 11, 11, - 11, 12, 12, 12, 12, 13, 13, 13, - 13, 14, 14, 14, 14, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, - } -}; - -static const uint16_t bitalloc_3_codes[3] = { - 0x0003, 0x0000, 0x0002, -}; - -static const uint8_t bitalloc_3_bits[3] = { - 2, 1, 2, -}; - -static const uint16_t bitalloc_5_codes_a[5] = { - 0x000F, 0x0006, 0x0000, 0x0002, 0x000E, -}; - -static const uint16_t bitalloc_5_codes_b[5] = { - 0x0007, 0x0001, 0x0002, 0x0000, 0x0006, -}; - -static const uint16_t bitalloc_5_codes_c[5] = { - 0x0007, 0x0005, 0x0000, 0x0004, 0x0006, -}; - -static const uint8_t bitalloc_5_bits_a[5] = { - 4, 3, 1, 2, 4, -}; - -static const uint8_t bitalloc_5_bits_b[5] = { - 3, 2, 2, 2, 3, -}; - -static const uint8_t bitalloc_5_bits_c[5] = { - 3, 3, 1, 3, 3, -}; - -static const uint16_t bitalloc_7_codes_a[7] = { - 0x001E, 0x000E, 0x0005, 0x0000, 0x0006, 0x0004, 0x001F, -}; - -static const uint16_t bitalloc_7_codes_b[7] = { - 0x0014, 0x000B, 0x0000, 0x0003, 0x0001, 0x0004, 0x0015, -}; - -static const uint16_t bitalloc_7_codes_c[7] = { - 0x0000, 0x0002, 0x0001, 0x0003, 0x0002, 0x0003, 0x0001, -}; - -static const uint8_t bitalloc_7_bits_a[7] = { - 5, 4, 3, 1, 3, 3, 5, -}; - -static const uint8_t bitalloc_7_bits_b[7] = { - 5, 4, 2, 2, 2, 3, 5, -}; - -static const uint8_t bitalloc_7_bits_c[7] = { - 4, 4, 2, 2, 2, 4, 4, -}; - -static const uint16_t bitalloc_9_codes_a[9] = { - 0x0030, 0x0019, 0x0009, 0x0005, 0x0000, 0x0007, 0x000D, 0x0008, - 0x0031, -}; - -static const uint16_t bitalloc_9_codes_b[9] = { - 0x0018, 0x001A, 0x0002, 0x0007, 0x0002, 0x0000, 0x0003, 0x001B, - 0x0019, -}; - -static const uint16_t bitalloc_9_codes_c[9] = { - 0x001C, 0x000F, 0x0002, 0x0007, 0x0002, 0x0000, 0x0006, 0x0006, - 0x001D, -}; - -static const uint8_t bitalloc_9_bits_a[9] = { - 6, 5, 4, 3, 1, 3, 4, 4, 6, -}; - -static const uint8_t bitalloc_9_bits_b[9] = { - 5, 5, 3, 3, 2, 2, 3, 5, 5, -}; - -static const uint8_t bitalloc_9_bits_c[9] = { - 6, 5, 3, 3, 2, 2, 3, 4, 6, -}; - -static const uint16_t bitalloc_13_codes_a[13] = { - 0x0070, 0x002E, 0x0039, 0x001D, 0x000C, 0x000F, 0x0000, 0x0004, - 0x000D, 0x000A, 0x0016, 0x002F, 0x0071, -}; - -static const uint16_t bitalloc_13_codes_b[13] = { - 0x0038, 0x0010, 0x001D, 0x0007, 0x000F, 0x0005, 0x0000, 0x0006, - 0x0002, 0x0009, 0x0006, 0x0011, 0x0039, -}; - -static const uint16_t bitalloc_13_codes_c[13] = { - 0x0004, 0x001A, 0x0003, 0x000E, 0x0000, 0x0003, 0x0005, 0x0004, - 0x0002, 0x000F, 0x000C, 0x001B, 0x0005, -}; - -static const uint8_t bitalloc_13_bits_a[13] = { - 7, 6, 6, 5, 4, 4, 1, 3, 4, 4, 5, 6, 7, -}; - -static const uint8_t bitalloc_13_bits_b[13] = { - 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 4, 5, 6, -}; - -static const uint8_t bitalloc_13_bits_c[13] = { - 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5, -}; - -static const uint16_t bitalloc_17_codes_a[17] = { - 0x0154, 0x00AB, 0x002B, 0x000B, 0x0003, 0x000A, 0x0001, 0x0006, - 0x0001, 0x0007, 0x0004, 0x000B, 0x0000, 0x0004, 0x0014, 0x0054, - 0x0155, -}; - -static const uint16_t bitalloc_17_codes_b[17] = { - 0x007C, 0x003F, 0x0019, 0x000D, 0x001C, 0x0008, 0x000F, 0x0005, - 0x0000, 0x0006, 0x0002, 0x0009, 0x001D, 0x000E, 0x001E, 0x0018, - 0x007D, -}; - -static const uint16_t bitalloc_17_codes_c[17] = { - 0x002C, 0x0017, 0x0005, 0x001C, 0x0003, 0x000A, 0x000F, 0x0003, - 0x0006, 0x0004, 0x0000, 0x000B, 0x0004, 0x001D, 0x000A, 0x0004, - 0x002D, -}; - -static const uint16_t bitalloc_17_codes_d[17] = { - 0x0100, 0x0102, 0x0082, 0x0042, 0x0022, 0x0012, 0x000A, 0x0006, - 0x0000, 0x0007, 0x000B, 0x0013, 0x0023, 0x0043, 0x0083, 0x0103, - 0x0101, -}; - -static const uint16_t bitalloc_17_codes_e[17] = { - 0x00E8, 0x00F6, 0x0075, 0x0034, 0x003B, 0x001B, 0x001F, 0x0004, - 0x0000, 0x0005, 0x000C, 0x001C, 0x003C, 0x0035, 0x007A, 0x00F7, - 0x00E9, -}; - -static const uint16_t bitalloc_17_codes_f[17] = { - 0x0004, 0x0003, 0x001E, 0x0001, 0x0001, 0x000E, 0x0001, 0x0004, - 0x0006, 0x0005, 0x0002, 0x000F, 0x0006, 0x000E, 0x001F, 0x0000, - 0x0005, -}; - -static const uint16_t bitalloc_17_codes_g[17] = { - 0x0060, 0x007E, 0x0031, 0x0019, 0x000D, 0x0004, 0x0000, 0x0006, - 0x0002, 0x0007, 0x0001, 0x0005, 0x000E, 0x001E, 0x003E, 0x007F, - 0x0061, -}; - -static const uint8_t bitalloc_17_bits_a[17] = { - 12, 11, 9, 7, 5, 4, 3, 3, 2, 3, 3, 4, 4, 6, 8, 10, - 12, -}; - -static const uint8_t bitalloc_17_bits_b[17] = { - 8, 7, 6, 5, 5, 4, 4, 3, 2, 3, 3, 4, 5, 5, 6, 6, - 8, -}; - -static const uint8_t bitalloc_17_bits_c[17] = { - 7, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 5, 5, - 7, -}; - -static const uint8_t bitalloc_17_bits_d[17] = { - 9, 9, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7, 8, 9, - 9, -}; - -static const uint8_t bitalloc_17_bits_e[17] = { - 8, 8, 7, 6, 6, 5, 5, 3, 1, 3, 4, 5, 6, 6, 7, 8, - 8, -}; - -static const uint8_t bitalloc_17_bits_f[17] = { - 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6, - 8, -}; - -static const uint8_t bitalloc_17_bits_g[17] = { - 8, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, 5, 6, 7, 8, - 8, -}; - -static const uint16_t bitalloc_25_codes_a[25] = { - 0x2854, 0x142B, 0x050B, 0x0143, 0x00A2, 0x0052, 0x002E, 0x0015, - 0x0004, 0x000E, 0x0000, 0x0003, 0x0006, 0x0004, 0x0001, 0x000F, - 0x0005, 0x0016, 0x002F, 0x0053, 0x00A3, 0x00A0, 0x0284, 0x0A14, - 0x2855, -}; - -static const uint16_t bitalloc_25_codes_b[25] = { - 0x001C, 0x000F, 0x0005, 0x0000, 0x0030, 0x0036, 0x000E, 0x0019, - 0x0001, 0x0008, 0x000E, 0x0001, 0x0005, 0x0002, 0x000F, 0x0009, - 0x0006, 0x001A, 0x000F, 0x0037, 0x0031, 0x0001, 0x0006, 0x0004, - 0x001D, -}; - -static const uint16_t bitalloc_25_codes_c[25] = { - 0x004C, 0x0027, 0x006D, 0x0028, 0x0037, 0x000E, 0x0015, 0x0000, - 0x0005, 0x0008, 0x000B, 0x000E, 0x0001, 0x000F, 0x000C, 0x0009, - 0x0006, 0x0001, 0x001A, 0x000F, 0x0008, 0x0029, 0x0012, 0x006C, - 0x004D, -}; - -static const uint16_t bitalloc_25_codes_d[25] = { - 0x0780, 0x0782, 0x03C2, 0x01E2, 0x00FE, 0x0079, 0x003D, 0x001C, - 0x000C, 0x0004, 0x0000, 0x0006, 0x0002, 0x0007, 0x0001, 0x0005, - 0x000D, 0x001D, 0x003E, 0x007E, 0x00FF, 0x01E3, 0x03C3, 0x0783, - 0x0781, -}; - -static const uint16_t bitalloc_25_codes_e[25] = { - 0x003C, 0x0092, 0x0018, 0x001F, 0x004E, 0x000D, 0x0025, 0x0004, - 0x0010, 0x0000, 0x000A, 0x0002, 0x0003, 0x0003, 0x000B, 0x0001, - 0x0011, 0x0005, 0x0026, 0x000E, 0x004F, 0x0048, 0x0019, 0x0093, - 0x003D, -}; - -static const uint16_t bitalloc_25_codes_f[25] = { - 0x0324, 0x0193, 0x00CE, 0x0065, 0x0024, 0x000C, 0x0013, 0x0004, - 0x0007, 0x000A, 0x000D, 0x000F, 0x0001, 0x0000, 0x000E, 0x000B, - 0x0008, 0x0005, 0x0018, 0x000D, 0x0025, 0x0066, 0x00CF, 0x00C8, - 0x0325, -}; - -static const uint16_t bitalloc_25_codes_g[25] = { - 0x03A8, 0x03AE, 0x01D5, 0x0094, 0x0014, 0x004B, 0x000B, 0x003B, - 0x0013, 0x0003, 0x000F, 0x0005, 0x0001, 0x0006, 0x0000, 0x0008, - 0x001C, 0x0004, 0x0024, 0x0074, 0x0015, 0x0095, 0x01D6, 0x03AF, - 0x03A9, -}; - -static const uint8_t bitalloc_25_bits_a[25] = { - 14, 13, 11, 9, 8, 7, 6, 5, 4, 4, 3, 3, 3, 3, 3, 4, - 4, 5, 6, 7, 8, 8, 10, 12, 14, -}; - -static const uint8_t bitalloc_25_bits_b[25] = { - 9, 8, 7, 6, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 4, 4, - 4, 5, 5, 6, 6, 6, 7, 7, 9, -}; - -static const uint8_t bitalloc_25_bits_c[25] = { - 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 4, 4, 3, 4, 4, 4, - 4, 4, 5, 5, 5, 6, 6, 7, 8, -}; - -static const uint8_t bitalloc_25_bits_d[25] = { - 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 3, 2, 3, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 12, -}; - -static const uint8_t bitalloc_25_bits_e[25] = { - 8, 8, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 2, 3, 4, 4, - 5, 5, 6, 6, 7, 7, 7, 8, 8, -}; - -static const uint8_t bitalloc_25_bits_f[25] = { - 10, 9, 8, 7, 6, 5, 5, 4, 4, 4, 4, 4, 3, 3, 4, 4, - 4, 4, 5, 5, 6, 7, 8, 8, 10, -}; - -static const uint8_t bitalloc_25_bits_g[25] = { - 10, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 3, 3, 4, - 5, 5, 6, 7, 7, 8, 9, 10, 10, -}; - -static const uint16_t bitalloc_33_codes_a[33] = { - 0x1580, 0x1582, 0x0AC2, 0x0562, 0x02B2, 0x015E, 0x00AD, 0x0054, - 0x001C, 0x003C, 0x000F, 0x001F, 0x0008, 0x000B, 0x000D, 0x0000, - 0x0002, 0x0001, 0x000E, 0x000C, 0x0009, 0x0006, 0x0014, 0x003D, - 0x001D, 0x0055, 0x00AE, 0x015F, 0x02B3, 0x0563, 0x0AC3, 0x1583, - 0x1581, -}; - -static const uint16_t bitalloc_33_codes_b[33] = { - 0x030C, 0x0187, 0x006D, 0x0028, 0x0037, 0x0066, 0x0015, 0x0031, - 0x0000, 0x000B, 0x0012, 0x001A, 0x0001, 0x0007, 0x000A, 0x000E, - 0x0001, 0x000F, 0x000B, 0x0008, 0x0004, 0x001B, 0x0013, 0x000C, - 0x0001, 0x0032, 0x001A, 0x0067, 0x0060, 0x0029, 0x00C2, 0x006C, - 0x030D, -}; - -static const uint16_t bitalloc_33_codes_c[33] = { - 0x00CC, 0x0067, 0x0005, 0x0070, 0x0003, 0x001A, 0x0039, 0x003F, - 0x000A, 0x0012, 0x0018, 0x001D, 0x0001, 0x0003, 0x0007, 0x000A, - 0x000D, 0x000B, 0x0008, 0x0004, 0x0002, 0x001E, 0x0019, 0x0013, - 0x000B, 0x0000, 0x003E, 0x001B, 0x0018, 0x0071, 0x0032, 0x0004, - 0x00CD, -}; - -static const uint16_t bitalloc_33_codes_d[33] = { - 0x3AF8, 0x3AFA, 0x1D7E, 0x0EBC, 0x075C, 0x03AC, 0x01D4, 0x0094, - 0x0014, 0x004B, 0x000B, 0x003B, 0x0013, 0x0003, 0x000F, 0x0005, - 0x0001, 0x0006, 0x0000, 0x0008, 0x001C, 0x0004, 0x0024, 0x0074, - 0x0015, 0x0095, 0x01D5, 0x03AD, 0x075D, 0x0EBD, 0x1D7F, 0x3AFB, - 0x3AF9, -}; - -static const uint16_t bitalloc_33_codes_e[33] = { - 0x01C8, 0x01E6, 0x0064, 0x00E2, 0x00E5, 0x0030, 0x0033, 0x0073, - 0x007A, 0x001A, 0x003A, 0x0002, 0x001A, 0x001F, 0x0007, 0x0001, - 0x0002, 0x0002, 0x000C, 0x0000, 0x001B, 0x0003, 0x003B, 0x001B, - 0x007B, 0x0078, 0x0070, 0x0031, 0x00F2, 0x00E3, 0x0065, 0x01E7, - 0x01C9, -}; - -static const uint16_t bitalloc_33_codes_f[33] = { - 0x0724, 0x0393, 0x01CE, 0x00E5, 0x002C, 0x0008, 0x0017, 0x003E, - 0x0005, 0x0014, 0x001D, 0x0000, 0x0003, 0x0006, 0x0008, 0x000B, - 0x000D, 0x000C, 0x0009, 0x0007, 0x0004, 0x0001, 0x001E, 0x0015, - 0x000A, 0x003F, 0x0038, 0x0009, 0x002D, 0x00E6, 0x01CF, 0x01C8, - 0x0725, -}; - -static const uint16_t bitalloc_33_codes_g[33] = { - 0x0284, 0x0042, 0x0140, 0x0143, 0x003E, 0x00BE, 0x0011, 0x0051, - 0x0009, 0x0029, 0x0005, 0x0015, 0x0000, 0x0008, 0x000E, 0x0002, - 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0016, 0x0006, 0x002E, - 0x000E, 0x005E, 0x001E, 0x00BF, 0x003F, 0x0020, 0x0141, 0x0043, - 0x0285, -}; - -static const uint8_t bitalloc_33_bits_a[33] = { - 13, 13, 12, 11, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, - 13, -}; - -static const uint8_t bitalloc_33_bits_b[33] = { - 10, 9, 8, 7, 7, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, - 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, - 10, -}; - -static const uint8_t bitalloc_33_bits_c[33] = { - 9, 8, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, - 9, -}; - -static const uint8_t bitalloc_33_bits_d[33] = { - 14, 14, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 5, 4, 4, 3, - 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, - 14, -}; - -static const uint8_t bitalloc_33_bits_e[33] = { - 9, 9, 8, 8, 8, 7, 7, 7, 7, 6, 6, 5, 5, 5, 4, 3, - 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, - 9, -}; - -static const uint8_t bitalloc_33_bits_f[33] = { - 11, 10, 9, 8, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 9, - 11, -}; +static const uint8_t tnl_grp_sizes[] = { 37, 34, 31, 28, 23 }; -static const uint8_t bitalloc_33_bits_g[33] = { - 10, 9, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, - 10, -}; - -static const uint16_t bitalloc_65_codes_a[65] = { - 0x9E5C, 0x9E5E, 0x4F2C, 0x2794, 0x13C4, 0x1E44, 0x09E3, 0x0F23, - 0x04F3, 0x0792, 0x027E, 0x03CE, 0x013D, 0x01E5, 0x009C, 0x00CC, - 0x0040, 0x0058, 0x0067, 0x001E, 0x0021, 0x002D, 0x003D, 0x0007, - 0x0011, 0x0014, 0x0017, 0x001A, 0x001C, 0x001F, 0x0001, 0x0004, - 0x0006, 0x0005, 0x0002, 0x0000, 0x001D, 0x001B, 0x0018, 0x0015, - 0x0012, 0x000E, 0x0006, 0x0032, 0x0026, 0x001F, 0x0078, 0x0059, - 0x0041, 0x00CD, 0x009D, 0x01E6, 0x013E, 0x03CF, 0x027F, 0x0793, - 0x0790, 0x04F0, 0x09E4, 0x1E45, 0x13C5, 0x2795, 0x4F2D, 0x9E5F, - 0x9E5D, -}; - -static const uint16_t bitalloc_65_codes_b[65] = { - 0x0A8C, 0x0547, 0x01B5, 0x0008, 0x00DB, 0x0152, 0x0005, 0x000B, - 0x008E, 0x00AE, 0x00E4, 0x0003, 0x0037, 0x0039, 0x0055, 0x006C, - 0x0073, 0x0003, 0x0015, 0x001D, 0x0028, 0x0030, 0x0037, 0x003E, - 0x0006, 0x000B, 0x000F, 0x0012, 0x0016, 0x0019, 0x001D, 0x0001, - 0x0004, 0x0002, 0x001E, 0x001A, 0x0017, 0x0013, 0x0010, 0x000C, - 0x0007, 0x003F, 0x0038, 0x0031, 0x0029, 0x0022, 0x001A, 0x0014, - 0x0000, 0x006D, 0x0056, 0x0046, 0x0038, 0x0004, 0x00E5, 0x00AF, - 0x008F, 0x006C, 0x000A, 0x0153, 0x0150, 0x0009, 0x02A2, 0x01B4, - 0x0A8D, -}; - -static const uint16_t bitalloc_65_codes_c[65] = { - 0x045C, 0x022F, 0x03F5, 0x01BC, 0x01FB, 0x0059, 0x00D0, 0x00DF, - 0x000A, 0x002D, 0x002F, 0x0052, 0x0069, 0x0078, 0x007F, 0x000A, - 0x0010, 0x001C, 0x0023, 0x002A, 0x0035, 0x003A, 0x003D, 0x0000, - 0x0003, 0x0006, 0x0009, 0x000C, 0x000F, 0x0012, 0x0016, 0x0018, - 0x001C, 0x0019, 0x0017, 0x0013, 0x0010, 0x000D, 0x000A, 0x0007, - 0x0004, 0x0001, 0x003E, 0x003B, 0x0036, 0x002B, 0x0028, 0x001D, - 0x0011, 0x000B, 0x0004, 0x0079, 0x006E, 0x0053, 0x0044, 0x002E, - 0x000B, 0x00FC, 0x00D1, 0x008A, 0x0058, 0x01BD, 0x0116, 0x03F4, - 0x045D, -}; - -static const uint16_t bitalloc_65_codes_d[65] = { - 0x70B0, 0x70B2, 0x70B4, 0x2852, 0x385B, 0x142E, 0x1C2E, 0x0A15, - 0x0E14, 0x0214, 0x0704, 0x0104, 0x010B, 0x0383, 0x0083, 0x0143, - 0x01C3, 0x0043, 0x00A2, 0x00E2, 0x0022, 0x0052, 0x0072, 0x0012, - 0x002A, 0x003A, 0x000A, 0x0016, 0x001E, 0x0006, 0x000C, 0x0000, - 0x0004, 0x0001, 0x000D, 0x0007, 0x001F, 0x0017, 0x000B, 0x003B, - 0x002B, 0x0013, 0x0073, 0x0053, 0x0023, 0x00E3, 0x00A3, 0x00A0, - 0x0040, 0x01C0, 0x0084, 0x0384, 0x0284, 0x0105, 0x0705, 0x0215, - 0x0E15, 0x0A16, 0x1C2F, 0x142F, 0x1428, 0x2853, 0x70B5, 0x70B3, - 0x70B1, -}; - -static const uint16_t bitalloc_65_codes_e[65] = { - 0x032C, 0x0332, 0x0378, 0x037E, 0x008C, 0x014A, 0x0188, 0x0197, - 0x019E, 0x01BD, 0x0044, 0x0047, 0x00AA, 0x00C5, 0x00CD, 0x00DC, - 0x001C, 0x002C, 0x0053, 0x0063, 0x0068, 0x0008, 0x000F, 0x0017, - 0x002B, 0x0035, 0x0005, 0x0009, 0x0016, 0x001C, 0x0006, 0x000F, - 0x0004, 0x0000, 0x0007, 0x001D, 0x0017, 0x000A, 0x0006, 0x0036, - 0x0030, 0x0028, 0x0010, 0x0009, 0x0069, 0x0064, 0x0054, 0x002D, - 0x001D, 0x00DD, 0x00CE, 0x00CA, 0x00AB, 0x00A4, 0x0045, 0x01BE, - 0x019F, 0x0198, 0x0189, 0x014B, 0x008D, 0x037F, 0x0379, 0x0333, - 0x032D, -}; - -static const uint16_t bitalloc_65_codes_f[65] = { - 0x0FE0, 0x0FE2, 0x0FE8, 0x0FEA, 0x0FEC, 0x0FEE, 0x0FF0, 0x0FF2, - 0x0FF4, 0x2FF2, 0x07F2, 0x07FB, 0x03F6, 0x0BFA, 0x0BFD, 0x01FF, - 0x05FF, 0x02FC, 0x007C, 0x017C, 0x003C, 0x00BC, 0x001C, 0x005C, - 0x000C, 0x002C, 0x0004, 0x0014, 0x0000, 0x0008, 0x000E, 0x0002, - 0x0006, 0x0003, 0x000F, 0x0009, 0x0001, 0x0015, 0x0005, 0x002D, - 0x000D, 0x005D, 0x001D, 0x00BD, 0x003D, 0x017D, 0x007D, 0x02FD, - 0x00FC, 0x05FC, 0x01FA, 0x0BFB, 0x03F7, 0x17F8, 0x07F3, 0x2FF3, - 0x0FF5, 0x0FF3, 0x0FF1, 0x0FEF, 0x0FED, 0x0FEB, 0x0FE9, 0x0FE3, - 0x0FE1, -}; - -static const uint16_t bitalloc_65_codes_g[65] = { - 0x010C, 0x038A, 0x0608, 0x0786, 0x0084, 0x0087, 0x0302, 0x0305, - 0x0040, 0x00E0, 0x00E3, 0x0183, 0x001E, 0x005E, 0x009E, 0x00DE, - 0x00F1, 0x0011, 0x0039, 0x0061, 0x0079, 0x0009, 0x001D, 0x0031, - 0x003D, 0x0005, 0x000F, 0x0019, 0x001F, 0x0003, 0x0006, 0x000A, - 0x000E, 0x000B, 0x0008, 0x0004, 0x0000, 0x001A, 0x0012, 0x000A, - 0x0002, 0x0036, 0x0026, 0x0016, 0x0006, 0x006E, 0x004E, 0x002E, - 0x000E, 0x00DF, 0x009F, 0x005F, 0x001F, 0x01E0, 0x0180, 0x00E1, - 0x0041, 0x03C2, 0x0303, 0x01C4, 0x0085, 0x0787, 0x0609, 0x038B, - 0x010D, -}; - -static const uint8_t bitalloc_65_bits_a[65] = { - 16, 16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, - 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, - 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 15, 16, - 16, -}; - -static const uint8_t bitalloc_65_bits_b[65] = { - 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, - 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 12, -}; - -static const uint8_t bitalloc_65_bits_c[65] = { - 11, 10, 10, 9, 9, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, - 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, - 11, -}; - -static const uint8_t bitalloc_65_bits_d[65] = { - 15, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 10, 9, 9, - 9, 8, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 3, - 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, - 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15, - 15, -}; - -static const uint8_t bitalloc_65_bits_e[65] = { - 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, - 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, - 3, 3, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, - 10, -}; - -static const uint8_t bitalloc_65_bits_f[65] = { - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 12, 12, 12, 11, - 11, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, - 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, - 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, -}; - -static const uint8_t bitalloc_65_bits_g[65] = { - 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, - 11, -}; - -static const uint16_t bitalloc_129_codes_a[129] = { - 0x0660, 0x0666, 0x06EC, 0x0722, 0x0760, 0x076E, 0x004C, 0x004E, - 0x00F4, 0x010A, 0x0148, 0x0156, 0x01D4, 0x01F2, 0x0331, 0x0370, - 0x0377, 0x0396, 0x03B1, 0x0024, 0x0064, 0x007B, 0x008A, 0x00A5, - 0x00D4, 0x00EB, 0x00FA, 0x019A, 0x01B9, 0x01C9, 0x01D9, 0x0010, - 0x0030, 0x0033, 0x0043, 0x0053, 0x006B, 0x007A, 0x00CA, 0x00D2, - 0x00DE, 0x00E6, 0x00F6, 0x000E, 0x001F, 0x0023, 0x002B, 0x003B, - 0x003F, 0x0067, 0x0070, 0x0077, 0x0005, 0x000D, 0x0012, 0x001B, - 0x002C, 0x0035, 0x003A, 0x0004, 0x000B, 0x0017, 0x001F, 0x0009, - 0x0008, 0x000A, 0x0000, 0x0018, 0x000C, 0x0005, 0x003C, 0x0036, - 0x002D, 0x001C, 0x0013, 0x000E, 0x0006, 0x007A, 0x0071, 0x0068, - 0x0064, 0x003C, 0x0034, 0x0028, 0x0020, 0x000F, 0x00F7, 0x00E7, - 0x00DF, 0x00D3, 0x00CB, 0x007B, 0x0074, 0x0054, 0x0044, 0x003C, - 0x0031, 0x0011, 0x01DA, 0x01CA, 0x01BA, 0x019B, 0x00FB, 0x00F8, - 0x00D5, 0x00AA, 0x008B, 0x0084, 0x0065, 0x0025, 0x03B6, 0x0397, - 0x0390, 0x0371, 0x0332, 0x01F3, 0x01D5, 0x0157, 0x0149, 0x010B, - 0x00F5, 0x004F, 0x004D, 0x076F, 0x0761, 0x0723, 0x06ED, 0x0667, - 0x0661, -}; - -static const uint16_t bitalloc_129_codes_b[129] = { - 0x29DC, 0x14EF, 0x0455, 0x0E9C, 0x022B, 0x0489, 0x0740, 0x074F, - 0x0172, 0x0245, 0x0247, 0x030A, 0x03A1, 0x001C, 0x008B, 0x00D6, - 0x010C, 0x0148, 0x014F, 0x0186, 0x01D1, 0x0008, 0x000F, 0x0046, - 0x005D, 0x0078, 0x0087, 0x0096, 0x00A5, 0x00BC, 0x00D8, 0x00DE, - 0x00F6, 0x0005, 0x0014, 0x0024, 0x002F, 0x003A, 0x003D, 0x0049, - 0x0050, 0x0058, 0x005F, 0x0066, 0x006D, 0x0075, 0x007C, 0x0004, - 0x000B, 0x0013, 0x0018, 0x001B, 0x001F, 0x0022, 0x0026, 0x002A, - 0x002D, 0x0031, 0x0034, 0x0038, 0x003B, 0x003F, 0x0003, 0x0006, - 0x000A, 0x0007, 0x0004, 0x0000, 0x003C, 0x0039, 0x0035, 0x0032, - 0x002E, 0x002B, 0x0027, 0x0023, 0x0020, 0x001C, 0x0019, 0x0016, - 0x0010, 0x0005, 0x007D, 0x007A, 0x006E, 0x0067, 0x0060, 0x0059, - 0x0051, 0x004A, 0x0042, 0x003B, 0x0034, 0x0025, 0x0015, 0x0006, - 0x00F7, 0x00DF, 0x00D9, 0x00BD, 0x00A6, 0x0097, 0x0090, 0x0079, - 0x006A, 0x0047, 0x0044, 0x0009, 0x01D2, 0x0187, 0x0184, 0x0149, - 0x010D, 0x00D7, 0x00B8, 0x001D, 0x03A6, 0x030B, 0x029C, 0x0246, - 0x0173, 0x0114, 0x0741, 0x053A, 0x0488, 0x0E9D, 0x0A76, 0x0454, - 0x29DD, -}; - -static const uint16_t bitalloc_129_codes_c[129] = { - 0x0E5C, 0x072F, 0x001D, 0x0724, 0x000F, 0x010D, 0x0324, 0x0393, - 0x03E9, 0x0080, 0x0087, 0x00FA, 0x0164, 0x0193, 0x01DE, 0x01F5, - 0x0010, 0x002A, 0x0041, 0x0064, 0x0073, 0x008E, 0x00A4, 0x00B3, - 0x00D6, 0x00E5, 0x00F4, 0x00FB, 0x0002, 0x0009, 0x0013, 0x001E, - 0x0026, 0x002C, 0x0033, 0x003F, 0x0041, 0x004C, 0x0053, 0x005E, - 0x0065, 0x0070, 0x0073, 0x0078, 0x007B, 0x007E, 0x0002, 0x0005, - 0x0007, 0x000B, 0x000D, 0x0011, 0x0014, 0x0017, 0x001A, 0x001D, - 0x0021, 0x0024, 0x0027, 0x002A, 0x002D, 0x0030, 0x0033, 0x0036, - 0x003A, 0x0037, 0x0034, 0x0031, 0x002E, 0x002B, 0x0028, 0x0025, - 0x0022, 0x001E, 0x001B, 0x0018, 0x0015, 0x0012, 0x000E, 0x000C, - 0x0008, 0x0006, 0x0003, 0x007F, 0x007C, 0x0079, 0x0076, 0x0071, - 0x006A, 0x005F, 0x0058, 0x004D, 0x0046, 0x0040, 0x0038, 0x002D, - 0x0027, 0x001F, 0x0014, 0x0012, 0x0003, 0x0000, 0x00F5, 0x00EE, - 0x00D7, 0x00C8, 0x00A5, 0x008F, 0x007C, 0x0065, 0x0042, 0x002B, - 0x0011, 0x0002, 0x01DF, 0x01C8, 0x0165, 0x00FB, 0x00E4, 0x0081, - 0x0006, 0x03E8, 0x0325, 0x01CA, 0x010C, 0x0725, 0x0396, 0x001C, - 0x0E5D, -}; - -static const uint16_t bitalloc_129_codes_d[129] = { - 0xA598, 0xA59A, 0xA59C, 0xA59E, 0xC598, 0xE586, 0x3ACC, 0x52CA, - 0x62CD, 0x0D48, 0x1D67, 0x2978, 0x3167, 0x3966, 0x06A5, 0x0EBC, - 0x14BD, 0x1CB1, 0x0350, 0x0353, 0x075F, 0x0A5F, 0x0C5E, 0x0E5E, - 0x01AE, 0x03AD, 0x052D, 0x062D, 0x072D, 0x00D5, 0x01D4, 0x0294, - 0x0314, 0x0394, 0x0014, 0x0094, 0x0114, 0x0174, 0x01B4, 0x01F4, - 0x000B, 0x004B, 0x008B, 0x00BB, 0x00DB, 0x00FB, 0x001B, 0x003B, - 0x0053, 0x0063, 0x0073, 0x0003, 0x0013, 0x0023, 0x002F, 0x0037, - 0x003F, 0x0007, 0x000F, 0x0015, 0x0019, 0x001D, 0x0001, 0x0005, - 0x0009, 0x0006, 0x0002, 0x001E, 0x001A, 0x0016, 0x0010, 0x0008, - 0x0000, 0x0038, 0x0030, 0x0028, 0x001C, 0x000C, 0x007C, 0x006C, - 0x005C, 0x0044, 0x0024, 0x0004, 0x00E4, 0x00C4, 0x00A4, 0x0074, - 0x0034, 0x01F5, 0x01B5, 0x0175, 0x0115, 0x0095, 0x0015, 0x0395, - 0x0315, 0x0295, 0x01D5, 0x00D6, 0x072E, 0x062E, 0x052E, 0x03AE, - 0x01AF, 0x0E5F, 0x0C5F, 0x0C58, 0x0A58, 0x0758, 0x0351, 0x1CB2, - 0x18B2, 0x0EBD, 0x0EB2, 0x3967, 0x3960, 0x2979, 0x2964, 0x0D49, - 0x72C2, 0x52CB, 0x3ACD, 0xE587, 0xC599, 0xA59F, 0xA59D, 0xA59B, - 0xA599, -}; - -static const uint16_t bitalloc_129_codes_e[129] = { - 0xA13C, 0xC720, 0xA13F, 0xA13E, 0xA13D, 0xE722, 0x5090, 0x6393, - 0x7392, 0x2849, 0x31CE, 0x39CE, 0x1425, 0x18E5, 0x1CE5, 0x0844, - 0x0A1C, 0x0C7C, 0x036C, 0x0423, 0x050F, 0x063F, 0x01B7, 0x0216, - 0x0285, 0x031D, 0x039D, 0x0109, 0x0140, 0x0180, 0x01C8, 0x01CF, - 0x007A, 0x008A, 0x00A2, 0x00C1, 0x00E5, 0x0014, 0x0037, 0x0043, - 0x004E, 0x0056, 0x0061, 0x006C, 0x007C, 0x000B, 0x001C, 0x001F, - 0x0023, 0x0025, 0x0029, 0x002C, 0x002E, 0x0032, 0x0034, 0x0037, - 0x003A, 0x003C, 0x003F, 0x0001, 0x0003, 0x0006, 0x0008, 0x000A, - 0x000C, 0x000B, 0x0009, 0x0007, 0x0004, 0x0002, 0x0000, 0x003D, - 0x003B, 0x0038, 0x0035, 0x0033, 0x002F, 0x002D, 0x002A, 0x0026, - 0x0024, 0x0020, 0x001D, 0x001A, 0x007D, 0x006D, 0x0062, 0x0057, - 0x004F, 0x0044, 0x003C, 0x0015, 0x00E6, 0x00C6, 0x00A3, 0x008B, - 0x007B, 0x006C, 0x01C9, 0x0181, 0x0141, 0x010A, 0x00DA, 0x031E, - 0x0286, 0x0217, 0x0210, 0x0738, 0x0638, 0x0508, 0x036D, 0x0C7D, - 0x0A1D, 0x0845, 0x1CE6, 0x18E6, 0x1426, 0x39CF, 0x31CF, 0x284E, - 0x7393, 0x7390, 0x5091, 0xE723, 0xC724, 0xC725, 0xC722, 0xC723, - 0xC721, -}; - -static const uint16_t bitalloc_129_codes_f[129] = { - 0x762C, 0x3B17, 0x1555, 0x0608, 0x0AAB, 0x0FF2, 0x0305, 0x0307, - 0x0763, 0x0046, 0x010C, 0x01BC, 0x02AB, 0x03B6, 0x03FD, 0x0080, - 0x0087, 0x00DF, 0x0156, 0x01D9, 0x01F8, 0x01FF, 0x002A, 0x0041, - 0x0061, 0x0094, 0x00D4, 0x00EA, 0x00F2, 0x00FD, 0x0009, 0x000B, - 0x001A, 0x0026, 0x0031, 0x0040, 0x004B, 0x006B, 0x0073, 0x0077, - 0x007A, 0x007C, 0x0000, 0x0002, 0x0006, 0x0008, 0x000B, 0x000E, - 0x0011, 0x0014, 0x0016, 0x0019, 0x001C, 0x001E, 0x0021, 0x0023, - 0x0026, 0x0028, 0x002B, 0x002D, 0x002F, 0x0031, 0x0033, 0x0036, - 0x0038, 0x0037, 0x0034, 0x0032, 0x0030, 0x002E, 0x002C, 0x0029, - 0x0027, 0x0024, 0x0022, 0x001F, 0x001D, 0x001A, 0x0017, 0x0015, - 0x0012, 0x000F, 0x000C, 0x0009, 0x0007, 0x0003, 0x0001, 0x007D, - 0x007B, 0x0078, 0x0074, 0x0072, 0x0054, 0x0041, 0x0036, 0x0027, - 0x001B, 0x0014, 0x000A, 0x00FE, 0x00F3, 0x00EB, 0x00D5, 0x0095, - 0x006E, 0x0042, 0x002B, 0x0010, 0x01F9, 0x01DA, 0x0157, 0x0154, - 0x00C0, 0x0081, 0x0022, 0x03B7, 0x03B0, 0x01BD, 0x010D, 0x0047, - 0x07F8, 0x0554, 0x0306, 0x0FF3, 0x0EC4, 0x0609, 0x1D8A, 0x1554, - 0x762D, -}; - -static const uint16_t bitalloc_129_codes_g[129] = { - 0x1E20, 0x1E5E, 0x031C, 0x051A, 0x0718, 0x0916, 0x0B14, 0x0D12, - 0x0F11, 0x0090, 0x018F, 0x028E, 0x038D, 0x048C, 0x058B, 0x068A, - 0x0789, 0x0049, 0x00C8, 0x0148, 0x01C7, 0x0247, 0x02C6, 0x0346, - 0x03C5, 0x0025, 0x0065, 0x00A5, 0x00E4, 0x0124, 0x0164, 0x01A4, - 0x01E3, 0x0013, 0x0033, 0x0053, 0x0073, 0x0093, 0x00B3, 0x00D3, - 0x00F3, 0x000A, 0x001A, 0x002A, 0x003A, 0x004A, 0x005A, 0x006A, - 0x007A, 0x0006, 0x000E, 0x0016, 0x001E, 0x0026, 0x002E, 0x0036, - 0x003E, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x001C, - 0x0000, 0x001D, 0x0019, 0x0015, 0x0011, 0x000D, 0x0009, 0x0005, - 0x003F, 0x0037, 0x002F, 0x0027, 0x001F, 0x0017, 0x000F, 0x0007, - 0x007B, 0x006B, 0x005B, 0x004B, 0x003B, 0x002B, 0x001B, 0x000B, - 0x0008, 0x00F0, 0x00D0, 0x00B0, 0x0090, 0x0070, 0x0050, 0x0030, - 0x01E4, 0x01A5, 0x0165, 0x0125, 0x00E5, 0x00E2, 0x00A2, 0x0062, - 0x03CA, 0x0347, 0x02C7, 0x02C4, 0x0244, 0x0149, 0x00C9, 0x00C6, - 0x0796, 0x068B, 0x0688, 0x048D, 0x048A, 0x028F, 0x028C, 0x0091, - 0x0F2E, 0x0D13, 0x0B15, 0x0917, 0x0719, 0x051B, 0x031D, 0x1E5F, - 0x1E21, -}; - -static const uint8_t bitalloc_129_bits_a[129] = { - 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, - 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, - 11, -}; - -static const uint8_t bitalloc_129_bits_b[129] = { - 14, 13, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, - 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, - 14, -}; - -static const uint8_t bitalloc_129_bits_c[129] = { - 13, 12, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, - 13, -}; - -static const uint8_t bitalloc_129_bits_d[129] = { - 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, - 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 10, 10, 10, - 10, 10, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, - 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, - 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, - 16, -}; - -static const uint8_t bitalloc_129_bits_e[129] = { - 16, 16, 16, 16, 16, 16, 15, 15, 15, 14, 14, 14, 13, 13, 13, 12, - 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, - 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, - 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, - 16, -}; - -static const uint8_t bitalloc_129_bits_f[129] = { - 15, 14, 13, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10, 9, - 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, - 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 15, -}; - -static const uint8_t bitalloc_129_bits_g[129] = { - 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, - 11, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, - 9, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, - 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, - 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, - 13, -}; - -static const uint8_t bitalloc_sizes[DCA_CODE_BOOKS] = { +const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS] = { 3, 5, 7, 9, 13, 17, 25, 33, 65, 129 }; -static const int8_t bitalloc_offsets[DCA_CODE_BOOKS] = { +const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS] = { -1, -2, -3, -4, -6, -8, -12, -16, -32, -64 }; @@ -1003,251 +55,723 @@ { 9, 9, 9, 9, 9, 9, 9 } }; -static const uint16_t *const bitalloc_codes[DCA_CODE_BOOKS][8] = { - { bitalloc_3_codes, NULL }, - { bitalloc_5_codes_a, bitalloc_5_codes_b, bitalloc_5_codes_c, NULL }, - { bitalloc_7_codes_a, bitalloc_7_codes_b, bitalloc_7_codes_c, NULL }, - { bitalloc_9_codes_a, bitalloc_9_codes_b, bitalloc_9_codes_c, NULL }, - { bitalloc_13_codes_a, bitalloc_13_codes_b, bitalloc_13_codes_c, NULL }, - { bitalloc_17_codes_a, bitalloc_17_codes_b, bitalloc_17_codes_c, bitalloc_17_codes_d, - bitalloc_17_codes_e, bitalloc_17_codes_f, bitalloc_17_codes_g, NULL }, - { bitalloc_25_codes_a, bitalloc_25_codes_b, bitalloc_25_codes_c, bitalloc_25_codes_d, - bitalloc_25_codes_e, bitalloc_25_codes_f, bitalloc_25_codes_g, NULL }, - { bitalloc_33_codes_a, bitalloc_33_codes_b, bitalloc_33_codes_c, bitalloc_33_codes_d, - bitalloc_33_codes_e, bitalloc_33_codes_f, bitalloc_33_codes_g, NULL }, - { bitalloc_65_codes_a, bitalloc_65_codes_b, bitalloc_65_codes_c, bitalloc_65_codes_d, - bitalloc_65_codes_e, bitalloc_65_codes_f, bitalloc_65_codes_g, NULL }, - { bitalloc_129_codes_a, bitalloc_129_codes_b, bitalloc_129_codes_c, bitalloc_129_codes_d, - bitalloc_129_codes_e, bitalloc_129_codes_f, bitalloc_129_codes_g, NULL } -}; - -static const uint8_t *const bitalloc_bits[DCA_CODE_BOOKS][8] = { - { bitalloc_3_bits, NULL }, - { bitalloc_5_bits_a, bitalloc_5_bits_b, bitalloc_5_bits_c, NULL }, - { bitalloc_7_bits_a, bitalloc_7_bits_b, bitalloc_7_bits_c, NULL }, - { bitalloc_9_bits_a, bitalloc_9_bits_b, bitalloc_9_bits_c, NULL }, - { bitalloc_13_bits_a, bitalloc_13_bits_b, bitalloc_13_bits_c, NULL }, - { bitalloc_17_bits_a, bitalloc_17_bits_b, bitalloc_17_bits_c, bitalloc_17_bits_d, - bitalloc_17_bits_e, bitalloc_17_bits_f, bitalloc_17_bits_g, NULL }, - { bitalloc_25_bits_a, bitalloc_25_bits_b, bitalloc_25_bits_c, bitalloc_25_bits_d, - bitalloc_25_bits_e, bitalloc_25_bits_f, bitalloc_25_bits_g, NULL }, - { bitalloc_33_bits_a, bitalloc_33_bits_b, bitalloc_33_bits_c, bitalloc_33_bits_d, - bitalloc_33_bits_e, bitalloc_33_bits_f, bitalloc_33_bits_g, NULL }, - { bitalloc_65_bits_a, bitalloc_65_bits_b, bitalloc_65_bits_c, bitalloc_65_bits_d, - bitalloc_65_bits_e, bitalloc_65_bits_f, bitalloc_65_bits_g, NULL }, - { bitalloc_129_bits_a, bitalloc_129_bits_b, bitalloc_129_bits_c, bitalloc_129_bits_d, - bitalloc_129_bits_e, bitalloc_129_bits_f, bitalloc_129_bits_g, NULL } -}; - -static const uint16_t tnl_grp_0_codes[37] = { - 0x0000, 0x0003, 0x0004, 0x0007, 0x0001, 0x0009, 0x000a, 0x000d, - 0x000e, 0x0006, 0x0012, 0x0005, 0x0015, 0x0016, 0x0022, 0x0025, - 0x0035, 0x0076, 0x0002, 0x0042, 0x00b6, 0x0036, 0x00c2, 0x0136, - 0x0182, 0x01c2, 0x03c2, 0x0482, 0x0682, 0x0082, 0x0882, 0x0a82, - 0x0282, 0x2282, 0x3282, 0x1282, 0x5282, -}; - -static const uint16_t tnl_grp_1_codes[34] = { - 0x0001, 0x0003, 0x0006, 0x0000, 0x0002, 0x0004, 0x0005, 0x0007, - 0x0008, 0x000f, 0x001a, 0x001c, 0x001d, 0x000a, 0x002c, 0x002d, - 0x000d, 0x002a, 0x004c, 0x004d, 0x006a, 0x008c, 0x00cd, 0x00ea, - 0x000c, 0x010c, 0x01ea, 0x020c, 0x030c, 0x07ea, 0x0bea, 0x03ea, - 0x13ea, 0x33ea, -}; - -static const uint16_t tnl_grp_2_codes[31] = { - 0x0001, 0x0003, 0x0006, 0x0007, 0x0004, 0x0008, 0x000c, 0x0010, - 0x0012, 0x001a, 0x0022, 0x0000, 0x000a, 0x0020, 0x0040, 0x004a, - 0x006a, 0x0002, 0x002a, 0x0042, 0x0082, 0x00aa, 0x00e0, 0x0060, - 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0f60, 0x0760, 0x1760, -}; - -static const uint16_t tnl_grp_3_codes[28] = { - 0x0001, 0x0006, 0x0008, 0x0014, 0x001c, 0x0000, 0x0002, 0x0004, - 0x000a, 0x000c, 0x0010, 0x0012, 0x001a, 0x0020, 0x002a, 0x002c, - 0x0032, 0x003a, 0x0022, 0x0030, 0x0062, 0x0064, 0x0070, 0x0024, - 0x00a4, 0x01a4, 0x03a4, 0x07a4, -}; - -static const uint16_t tnl_grp_4_codes[23] = { - 0x0001, 0x0000, 0x000a, 0x0006, 0x0012, 0x001e, 0x0022, 0x002e, - 0x0036, 0x003e, 0x0002, 0x0016, 0x0032, 0x004e, 0x0056, 0x000e, - 0x0042, 0x0072, 0x00c2, 0x00f2, 0x008e, 0x018e, 0x038e, -}; - -static const uint16_t tnl_scf_codes[20] = { - 0x0000, 0x0001, 0x0002, 0x0005, 0x0006, 0x0007, 0x000b, 0x000c, - 0x0013, 0x0014, 0x0003, 0x0004, 0x0023, 0x0064, 0x00a4, 0x0024, - 0x0124, 0x0324, 0x0724, 0x0f24, -}; - -static const uint16_t damp_codes[7] = { - 0x0001, 0x0000, 0x0002, 0x0006, 0x000e, 0x001e, 0x003e, -}; - -static const uint16_t dph_codes[9] = { - 0x0000, 0x0002, 0x0003, 0x0001, 0x0009, 0x000d, 0x0005, 0x0015, - 0x0035, -}; - -static const uint16_t fst_rsd_amp_codes[24] = { - 0x0003, 0x0005, 0x0006, 0x0007, 0x0000, 0x0001, 0x0002, 0x0008, - 0x0009, 0x000a, 0x0014, 0x0004, 0x001a, 0x001c, 0x0024, 0x002c, - 0x003a, 0x000c, 0x003c, 0x004c, 0x00fc, 0x007c, 0x017c, 0x037c, -}; - -static const uint16_t rsd_apprx_codes[6] = { - 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, -}; - -static const uint16_t rsd_amp_codes[33] = { - 0x0001, 0x0000, 0x0002, 0x0003, 0x0004, 0x000e, 0x000f, 0x0016, - 0x0007, 0x0027, 0x0037, 0x0026, 0x0066, 0x0006, 0x0017, 0x0046, - 0x0097, 0x00d7, 0x0086, 0x00c6, 0x01c6, 0x0157, 0x0186, 0x0257, - 0x0357, 0x0057, 0x0786, 0x0386, 0x0b86, 0x0457, 0x0c57, 0x1457, - 0x1c57, -}; - -static const uint16_t avg_g3_codes[18] = { - 0x0001, 0x0002, 0x0003, 0x0000, 0x000c, 0x0014, 0x0018, 0x0004, - 0x0008, 0x0028, 0x0068, 0x0024, 0x00a4, 0x00e4, 0x0164, 0x0064, - 0x0264, 0x0664, -}; - -static const uint16_t st_grid_codes[22] = { - 0x0001, 0x0002, 0x0000, 0x0004, 0x0008, 0x001c, 0x004c, 0x006c, - 0x000c, 0x002c, 0x008c, 0x00ac, 0x012c, 0x018c, 0x01ac, 0x038c, - 0x03ac, 0x032c, 0x072c, 0x0f2c, 0x172c, 0x1f2c, -}; - -static const uint16_t grid_2_codes[20] = { - 0x0000, 0x0002, 0x0003, 0x0001, 0x0005, 0x000d, 0x003d, 0x005d, - 0x009d, 0x011d, 0x001d, 0x061d, 0x041d, 0x0c1d, 0x0a1d, 0x121d, - 0x021d, 0x1a1d, 0x221d, 0x3a1d, -}; - -static const uint16_t grid_3_codes[13] = { - 0x0001, 0x0002, 0x0000, 0x0004, 0x000c, 0x001c, 0x007c, 0x003c, - 0x01bc, 0x00bc, 0x06bc, 0x02bc, 0x0abc, -}; - -static const uint16_t rsd_codes[9] = { - 0x0001, 0x0003, 0x0000, 0x0002, 0x0006, 0x0004, 0x000c, 0x001c, - 0x003c, -}; - -static const uint8_t tnl_grp_0_bitvals[74] = { - 3, 5, 3, 9, 3, 4, 3, 6, 4, 10, 4, 13, 4, 7, 4, 11, - 4, 8, 5, 12, 5, 14, 6, 15, 6, 18, 6, 1, 6, 17, 6, 16, - 6, 21, 7, 20, 8, 19, 8, 22, 8, 25, 9, 26, 9, 23, 9, 3, - 9, 24, 10, 29, 10, 27, 11, 28, 11, 30, 12, 33, 12, 31, 12, 32, - 14, 34, 14, 37, 14, 36, 15, 35, 15, 0, -}; - -static const uint8_t tnl_grp_1_bitvals[68] = { - 3, 9, 3, 6, 3, 5, 4, 4, 4, 8, 4, 10, 4, 1, 4, 11, - 4, 7, 4, 13, 5, 12, 5, 14, 5, 17, 6, 16, 6, 15, 6, 18, - 7, 20, 7, 19, 7, 21, 8, 25, 8, 23, 8, 22, 8, 24, 9, 26, - 10, 3, 10, 29, 10, 30, 10, 27, 10, 28, 11, 31, 12, 32, 13, 33, - 14, 34, 14, 0, -}; - -static const uint8_t tnl_grp_2_bitvals[62] = { - 2, 1, 3, 6, 3, 5, 3, 7, 4, 9, 4, 8, 4, 4, 5, 10, - 5, 11, 5, 13, 6, 12, 7, 14, 7, 16, 7, 15, 7, 17, 7, 18, - 7, 19, 8, 22, 8, 20, 8, 21, 8, 3, 8, 24, 8, 25, 9, 23, - 9, 26, 9, 27, 10, 28, 11, 29, 12, 31, 13, 30, 13, 0, -}; - -static const uint8_t tnl_grp_3_bitvals[56] = { - 1, 1, 3, 6, 4, 5, 5, 9, 5, 4, 6, 8, 6, 14, 6, 10, - 6, 21, 6, 13, 6, 7, 6, 3, 6, 16, 6, 2, 6, 18, 6, 17, - 6, 11, 6, 15, 7, 19, 7, 23, 7, 24, 7, 22, 7, 12, 8, 20, - 9, 25, 10, 26, 11, 27, 11, 0, -}; - -static const uint8_t tnl_grp_4_bitvals[46] = { - 1, 1, 2, 2, 4, 4, 5, 5, 6, 6, 6, 8, 6, 3, 6, 19, - 6, 20, 6, 9, 7, 7, 7, 11, 7, 13, 7, 17, 7, 10, 8, 12, - 8, 15, 8, 14, 8, 21, 8, 18, 9, 16, 10, 22, 10, 0, -}; - -static const uint8_t tnl_scf_bitvals[40] = { - 3, 3, 3, 1, 3, 2, 3, 5, 3, 4, 3, 6, 4, 8, 4, 7, - 5, 10, 5, 9, 6, 12, 6, 11, 6, 13, 7, 14, 8, 15, 9, 16, - 10, 17, 11, 18, 12, 19, 12, 0, -}; - -static const uint8_t damp_bitvals[14] = { - 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 0, -}; - -static const uint8_t dph_bitvals[18] = { - 2, 2, 2, 1, 2, 8, 4, 3, 4, 7, 4, 4, 5, 6, 6, 5, - 6, 0, -}; - -static const uint8_t fst_rsd_amp_bitvals[48] = { - 3, 13, 3, 15, 3, 16, 3, 14, 4, 12, 4, 10, 4, 11, 4, 17, - 4, 18, 5, 19, 5, 9, 6, 1, 6, 7, 6, 6, 6, 8, 6, 5, - 6, 4, 7, 20, 7, 2, 7, 3, 8, 21, 9, 22, 10, 23, 10, 0, -}; - -static const uint8_t rsd_apprx_bitvals[12] = { - 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 0, -}; - -static const uint8_t rsd_amp_bitvals[66] = { - 2, 3, 3, 2, 3, 5, 3, 4, 3, 1, 4, 7, 4, 6, 5, 9, - 6, 8, 6, 11, 6, 10, 7, 12, 7, 13, 8, 14, 8, 18, 8, 16, - 8, 15, 8, 22, 9, 20, 9, 24, 9, 17, 10, 28, 10, 26, 10, 21, - 10, 23, 11, 30, 11, 19, 12, 25, 12, 32, 13, 36, 13, 29, 13, 34, - 13, 0, -}; - -static const uint8_t avg_g3_bitvals[36] = { - 2, 15, 2, 16, 2, 17, 4, 14, 4, 18, 5, 12, 5, 13, 6, 10, - 6, 11, 7, 19, 7, 9, 8, 20, 8, 8, 8, 7, 9, 21, 10, 6, - 11, 23, 11, 0, -}; - -static const uint8_t st_grid_bitvals[44] = { - 1, 6, 2, 1, 4, 4, 4, 8, 4, 3, 5, 10, 7, 12, 7, 5, - 8, 14, 9, 16, 9, 7, 9, 18, 10, 11, 10, 9, 10, 20, 10, 22, - 10, 2, 11, 13, 13, 17, 13, 24, 13, 15, 13, 0, -}; - -static const uint8_t grid_2_bitvals[40] = { - 2, 3, 2, 2, 2, 1, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 8, 9, 9, 10, 11, 11, 11, 12, 12, 13, 12, 17, 13, 15, 13, 18, - 14, 19, 14, 16, 14, 14, 14, 0, -}; - -static const uint8_t grid_3_bitvals[26] = { - 1, 17, 2, 16, 3, 18, 4, 15, 5, 19, 6, 14, 7, 20, 8, 13, - 9, 21, 10, 12, 11, 22, 12, 11, 12, 0, -}; - -static const uint8_t rsd_bitvals[18] = { - 2, 2, 2, 3, 3, 1, 3, 4, 3, 0, 4, 5, 5, 6, 6, 7, - 6, 4, -}; - -static const uint16_t vlc_offs[80] = { - 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364, - 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508, - 5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564, - 7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240, - 12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264, - 18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622, 24200, 24748, 25276, - 25792, 26306, 26826, 26890, 26954, 27468, 27500, 28038, 28554, 29086, 29630, - 30150, 30214 -}; - -DCAVLC ff_dca_vlc_bit_allocation; -DCAVLC ff_dca_vlc_transition_mode; -DCAVLC ff_dca_vlc_scale_factor; -DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; +const uint8_t ff_dca_vlc_src_tables[][2] = { + /* bitalloc_3 - 3 entries */ + { 1, 1 }, { 2, 2 }, { 0, 2 }, + /* bitalloc_5_a - 5 entries */ + { 2, 1 }, { 3, 2 }, { 1, 3 }, { 4, 4 }, { 0, 4 }, + /* bitalloc_5_b - 5 entries */ + { 3, 2 }, { 1, 2 }, { 2, 2 }, { 4, 3 }, { 0, 3 }, + /* bitalloc_5_c - 5 entries */ + { 2, 1 }, { 3, 3 }, { 1, 3 }, { 4, 3 }, { 0, 3 }, + /* bitalloc_7_a - 7 entries */ + { 3, 1 }, { 5, 3 }, { 2, 3 }, { 4, 3 }, { 1, 4 }, + { 0, 5 }, { 6, 5 }, + /* bitalloc_7_b - 7 entries */ + { 2, 2 }, { 4, 2 }, { 5, 3 }, { 0, 5 }, { 6, 5 }, + { 1, 4 }, { 3, 2 }, + /* bitalloc_7_c - 7 entries */ + { 0, 4 }, { 6, 4 }, { 1, 4 }, { 5, 4 }, { 2, 2 }, + { 4, 2 }, { 3, 2 }, + /* bitalloc_9_a - 9 entries */ + { 4, 1 }, { 7, 4 }, { 2, 4 }, { 3, 3 }, { 0, 6 }, + { 8, 6 }, { 1, 5 }, { 6, 4 }, { 5, 3 }, + /* bitalloc_9_b - 9 entries */ + { 5, 2 }, { 2, 3 }, { 6, 3 }, { 4, 2 }, { 0, 5 }, + { 8, 5 }, { 1, 5 }, { 7, 5 }, { 3, 3 }, + /* bitalloc_9_c - 9 entries */ + { 5, 2 }, { 2, 3 }, { 7, 4 }, { 0, 6 }, { 8, 6 }, + { 1, 5 }, { 4, 2 }, { 6, 3 }, { 3, 3 }, + /* bitalloc_13_a - 13 entries */ + { 6, 1 }, { 7, 3 }, { 9, 4 }, { 10, 5 }, { 1, 6 }, + { 11, 6 }, { 4, 4 }, { 8, 4 }, { 0, 7 }, { 12, 7 }, + { 2, 6 }, { 3, 5 }, { 5, 4 }, + /* bitalloc_13_b - 13 entries */ + { 6, 2 }, { 8, 3 }, { 10, 4 }, { 3, 4 }, { 1, 5 }, + { 11, 5 }, { 9, 4 }, { 5, 3 }, { 7, 3 }, { 0, 6 }, + { 12, 6 }, { 2, 5 }, { 4, 4 }, + /* bitalloc_13_c - 13 entries */ + { 4, 3 }, { 0, 5 }, { 12, 5 }, { 2, 4 }, { 8, 3 }, + { 5, 3 }, { 7, 3 }, { 6, 3 }, { 10, 4 }, { 1, 5 }, + { 11, 5 }, { 3, 4 }, { 9, 4 }, + /* bitalloc_17_a - 17 entries */ + { 12, 4 }, { 13, 6 }, { 14, 8 }, { 15, 10 }, { 0, 12 }, + { 16, 12 }, { 1, 11 }, { 2, 9 }, { 3, 7 }, { 4, 5 }, + { 6, 3 }, { 8, 2 }, { 10, 3 }, { 5, 4 }, { 11, 4 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_17_b - 17 entries */ + { 8, 2 }, { 10, 3 }, { 15, 6 }, { 2, 6 }, { 3, 5 }, + { 13, 5 }, { 14, 6 }, { 0, 8 }, { 16, 8 }, { 1, 7 }, + { 5, 4 }, { 11, 4 }, { 7, 3 }, { 9, 3 }, { 4, 5 }, + { 12, 5 }, { 6, 4 }, + /* bitalloc_17_c - 17 entries */ + { 10, 3 }, { 15, 5 }, { 2, 5 }, { 4, 4 }, { 12, 4 }, + { 14, 5 }, { 0, 7 }, { 16, 7 }, { 1, 6 }, { 7, 3 }, + { 9, 3 }, { 5, 4 }, { 11, 4 }, { 8, 3 }, { 3, 5 }, + { 13, 5 }, { 6, 4 }, + /* bitalloc_17_d - 17 entries */ + { 8, 1 }, { 0, 9 }, { 16, 9 }, { 1, 9 }, { 15, 9 }, + { 2, 8 }, { 14, 8 }, { 3, 7 }, { 13, 7 }, { 4, 6 }, + { 12, 6 }, { 5, 5 }, { 11, 5 }, { 6, 4 }, { 10, 4 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_17_e - 17 entries */ + { 8, 1 }, { 7, 3 }, { 9, 3 }, { 10, 4 }, { 3, 6 }, + { 13, 6 }, { 5, 5 }, { 11, 5 }, { 0, 8 }, { 16, 8 }, + { 2, 7 }, { 4, 6 }, { 12, 6 }, { 14, 7 }, { 1, 8 }, + { 15, 8 }, { 6, 5 }, + /* bitalloc_17_f - 17 entries */ + { 15, 6 }, { 0, 8 }, { 16, 8 }, { 1, 7 }, { 3, 5 }, + { 4, 4 }, { 6, 3 }, { 10, 3 }, { 12, 4 }, { 13, 5 }, + { 2, 6 }, { 14, 6 }, { 7, 3 }, { 9, 3 }, { 8, 3 }, + { 5, 4 }, { 11, 4 }, + /* bitalloc_17_g - 17 entries */ + { 6, 3 }, { 10, 3 }, { 5, 4 }, { 11, 4 }, { 0, 8 }, + { 16, 8 }, { 2, 7 }, { 3, 6 }, { 4, 5 }, { 12, 5 }, + { 13, 6 }, { 14, 7 }, { 1, 8 }, { 15, 8 }, { 8, 2 }, + { 7, 3 }, { 9, 3 }, + /* bitalloc_25_a - 25 entries */ + { 10, 3 }, { 14, 3 }, { 8, 4 }, { 16, 4 }, { 11, 3 }, + { 13, 3 }, { 21, 8 }, { 22, 10 }, { 23, 12 }, { 0, 14 }, + { 24, 14 }, { 1, 13 }, { 2, 11 }, { 3, 9 }, { 4, 8 }, + { 20, 8 }, { 5, 7 }, { 19, 7 }, { 7, 5 }, { 17, 5 }, + { 6, 6 }, { 18, 6 }, { 12, 3 }, { 9, 4 }, { 15, 4 }, + /* bitalloc_25_b - 25 entries */ + { 3, 6 }, { 21, 6 }, { 23, 7 }, { 2, 7 }, { 22, 7 }, + { 0, 9 }, { 24, 9 }, { 1, 8 }, { 8, 4 }, { 11, 3 }, + { 13, 3 }, { 16, 4 }, { 6, 5 }, { 18, 5 }, { 9, 4 }, + { 15, 4 }, { 12, 3 }, { 4, 6 }, { 20, 6 }, { 7, 5 }, + { 17, 5 }, { 5, 6 }, { 19, 6 }, { 10, 4 }, { 14, 4 }, + /* bitalloc_25_c - 25 entries */ + { 7, 4 }, { 17, 4 }, { 12, 3 }, { 20, 5 }, { 22, 6 }, + { 0, 8 }, { 24, 8 }, { 1, 7 }, { 8, 4 }, { 16, 4 }, + { 5, 5 }, { 19, 5 }, { 9, 4 }, { 15, 4 }, { 3, 6 }, + { 21, 6 }, { 6, 5 }, { 10, 4 }, { 14, 4 }, { 18, 5 }, + { 23, 7 }, { 2, 7 }, { 4, 6 }, { 11, 4 }, { 13, 4 }, + /* bitalloc_25_d - 25 entries */ + { 10, 3 }, { 14, 3 }, { 9, 4 }, { 15, 4 }, { 8, 5 }, + { 16, 5 }, { 7, 6 }, { 17, 6 }, { 0, 12 }, { 24, 12 }, + { 1, 12 }, { 23, 12 }, { 2, 11 }, { 22, 11 }, { 3, 10 }, + { 21, 10 }, { 5, 8 }, { 6, 7 }, { 18, 7 }, { 19, 8 }, + { 4, 9 }, { 20, 9 }, { 12, 2 }, { 11, 3 }, { 13, 3 }, + /* bitalloc_25_e - 25 entries */ + { 9, 4 }, { 15, 4 }, { 7, 5 }, { 17, 5 }, { 2, 7 }, + { 22, 7 }, { 5, 6 }, { 19, 6 }, { 0, 8 }, { 24, 8 }, + { 3, 7 }, { 11, 3 }, { 13, 3 }, { 8, 5 }, { 16, 5 }, + { 21, 7 }, { 1, 8 }, { 23, 8 }, { 6, 6 }, { 18, 6 }, + { 4, 7 }, { 20, 7 }, { 10, 4 }, { 14, 4 }, { 12, 2 }, + /* bitalloc_25_f - 25 entries */ + { 13, 3 }, { 12, 3 }, { 7, 4 }, { 17, 4 }, { 5, 5 }, + { 19, 5 }, { 8, 4 }, { 16, 4 }, { 4, 6 }, { 20, 6 }, + { 6, 5 }, { 9, 4 }, { 15, 4 }, { 18, 5 }, { 23, 8 }, + { 0, 10 }, { 24, 10 }, { 1, 9 }, { 3, 7 }, { 21, 7 }, + { 2, 8 }, { 22, 8 }, { 10, 4 }, { 14, 4 }, { 11, 4 }, + /* bitalloc_25_g - 25 entries */ + { 14, 3 }, { 17, 5 }, { 4, 7 }, { 20, 7 }, { 6, 6 }, + { 9, 4 }, { 12, 2 }, { 15, 4 }, { 18, 6 }, { 3, 8 }, + { 21, 8 }, { 5, 7 }, { 8, 5 }, { 11, 3 }, { 13, 3 }, + { 16, 5 }, { 19, 7 }, { 0, 10 }, { 24, 10 }, { 2, 9 }, + { 22, 9 }, { 1, 10 }, { 23, 10 }, { 7, 6 }, { 10, 4 }, + /* bitalloc_33_a - 33 entries */ + { 15, 3 }, { 17, 3 }, { 16, 3 }, { 21, 4 }, { 8, 6 }, + { 24, 6 }, { 10, 5 }, { 12, 4 }, { 20, 4 }, { 22, 5 }, + { 7, 7 }, { 25, 7 }, { 0, 13 }, { 32, 13 }, { 1, 13 }, + { 31, 13 }, { 2, 12 }, { 30, 12 }, { 3, 11 }, { 29, 11 }, + { 4, 10 }, { 28, 10 }, { 6, 8 }, { 26, 8 }, { 5, 9 }, + { 27, 9 }, { 13, 4 }, { 19, 4 }, { 14, 4 }, { 18, 4 }, + { 9, 6 }, { 23, 6 }, { 11, 5 }, + /* bitalloc_33_b - 33 entries */ + { 8, 5 }, { 24, 5 }, { 12, 4 }, { 16, 3 }, { 20, 4 }, + { 3, 7 }, { 29, 7 }, { 6, 6 }, { 9, 5 }, { 23, 5 }, + { 26, 6 }, { 31, 8 }, { 2, 8 }, { 4, 7 }, { 13, 4 }, + { 19, 4 }, { 10, 5 }, { 22, 5 }, { 14, 4 }, { 18, 4 }, + { 28, 7 }, { 30, 8 }, { 0, 10 }, { 32, 10 }, { 1, 9 }, + { 7, 6 }, { 25, 6 }, { 5, 7 }, { 27, 7 }, { 11, 5 }, + { 21, 5 }, { 15, 4 }, { 17, 4 }, + /* bitalloc_33_c - 33 entries */ + { 25, 5 }, { 31, 7 }, { 2, 7 }, { 4, 6 }, { 12, 4 }, + { 20, 4 }, { 13, 4 }, { 19, 4 }, { 8, 5 }, { 24, 5 }, + { 28, 6 }, { 30, 7 }, { 0, 9 }, { 32, 9 }, { 1, 8 }, + { 5, 6 }, { 27, 6 }, { 14, 4 }, { 18, 4 }, { 9, 5 }, + { 23, 5 }, { 15, 4 }, { 17, 4 }, { 10, 5 }, { 22, 5 }, + { 16, 4 }, { 3, 7 }, { 29, 7 }, { 6, 6 }, { 11, 5 }, + { 21, 5 }, { 26, 6 }, { 7, 6 }, + /* bitalloc_33_d - 33 entries */ + { 18, 3 }, { 21, 5 }, { 8, 7 }, { 24, 7 }, { 10, 6 }, + { 13, 4 }, { 16, 2 }, { 19, 4 }, { 22, 6 }, { 7, 8 }, + { 25, 8 }, { 9, 7 }, { 12, 5 }, { 15, 3 }, { 17, 3 }, + { 20, 5 }, { 23, 7 }, { 6, 9 }, { 26, 9 }, { 5, 10 }, + { 27, 10 }, { 4, 11 }, { 28, 11 }, { 3, 12 }, { 29, 12 }, + { 0, 14 }, { 32, 14 }, { 1, 14 }, { 31, 14 }, { 2, 13 }, + { 30, 13 }, { 11, 6 }, { 14, 4 }, + /* bitalloc_33_e - 33 entries */ + { 19, 4 }, { 11, 5 }, { 21, 5 }, { 15, 3 }, { 17, 3 }, + { 5, 7 }, { 27, 7 }, { 2, 8 }, { 30, 8 }, { 6, 7 }, + { 9, 6 }, { 23, 6 }, { 14, 4 }, { 16, 2 }, { 18, 4 }, + { 12, 5 }, { 20, 5 }, { 26, 7 }, { 3, 8 }, { 29, 8 }, + { 0, 9 }, { 32, 9 }, { 4, 8 }, { 7, 7 }, { 10, 6 }, + { 22, 6 }, { 25, 7 }, { 28, 8 }, { 1, 9 }, { 31, 9 }, + { 8, 7 }, { 24, 7 }, { 13, 5 }, + /* bitalloc_33_f - 33 entries */ + { 11, 4 }, { 21, 4 }, { 5, 6 }, { 27, 6 }, { 8, 5 }, + { 12, 4 }, { 20, 4 }, { 24, 5 }, { 4, 7 }, { 28, 7 }, + { 6, 6 }, { 13, 4 }, { 19, 4 }, { 14, 4 }, { 18, 4 }, + { 9, 5 }, { 23, 5 }, { 15, 4 }, { 17, 4 }, { 16, 4 }, + { 26, 6 }, { 31, 9 }, { 0, 11 }, { 32, 11 }, { 1, 10 }, + { 3, 8 }, { 29, 8 }, { 2, 9 }, { 30, 9 }, { 10, 5 }, + { 22, 5 }, { 7, 6 }, { 25, 6 }, + /* bitalloc_33_g - 33 entries */ + { 12, 4 }, { 20, 4 }, { 29, 8 }, { 1, 9 }, { 31, 9 }, + { 6, 7 }, { 8, 6 }, { 10, 5 }, { 22, 5 }, { 24, 6 }, + { 26, 7 }, { 4, 8 }, { 28, 8 }, { 15, 3 }, { 17, 3 }, + { 13, 4 }, { 19, 4 }, { 2, 9 }, { 30, 9 }, { 0, 10 }, + { 32, 10 }, { 3, 9 }, { 7, 7 }, { 9, 6 }, { 11, 5 }, + { 21, 5 }, { 23, 6 }, { 25, 7 }, { 5, 8 }, { 27, 8 }, + { 16, 3 }, { 14, 4 }, { 18, 4 }, + /* bitalloc_65_a - 65 entries */ + { 35, 4 }, { 30, 4 }, { 34, 4 }, { 42, 5 }, { 23, 5 }, + { 31, 4 }, { 33, 4 }, { 32, 4 }, { 41, 5 }, { 19, 6 }, + { 45, 6 }, { 16, 7 }, { 48, 7 }, { 20, 6 }, { 24, 5 }, + { 40, 5 }, { 44, 6 }, { 14, 8 }, { 50, 8 }, { 57, 11 }, + { 4, 13 }, { 60, 13 }, { 6, 12 }, { 58, 12 }, { 3, 14 }, + { 61, 14 }, { 2, 15 }, { 62, 15 }, { 0, 16 }, { 64, 16 }, + { 1, 16 }, { 63, 16 }, { 8, 11 }, { 12, 9 }, { 52, 9 }, + { 10, 10 }, { 54, 10 }, { 25, 5 }, { 39, 5 }, { 17, 7 }, + { 47, 7 }, { 21, 6 }, { 26, 5 }, { 38, 5 }, { 43, 6 }, + { 15, 8 }, { 49, 8 }, { 18, 7 }, { 27, 5 }, { 37, 5 }, + { 28, 5 }, { 36, 5 }, { 46, 7 }, { 56, 11 }, { 5, 13 }, + { 59, 13 }, { 7, 12 }, { 9, 11 }, { 55, 11 }, { 13, 9 }, + { 51, 9 }, { 11, 10 }, { 53, 10 }, { 22, 6 }, { 29, 5 }, + /* bitalloc_65_b - 65 entries */ + { 48, 6 }, { 3, 9 }, { 61, 9 }, { 6, 8 }, { 11, 7 }, + { 53, 7 }, { 58, 8 }, { 7, 8 }, { 17, 6 }, { 31, 4 }, + { 33, 4 }, { 24, 5 }, { 40, 5 }, { 32, 4 }, { 47, 6 }, + { 18, 6 }, { 25, 5 }, { 39, 5 }, { 46, 6 }, { 57, 8 }, + { 63, 10 }, { 2, 10 }, { 4, 9 }, { 12, 7 }, { 52, 7 }, + { 13, 7 }, { 19, 6 }, { 26, 5 }, { 38, 5 }, { 45, 6 }, + { 51, 7 }, { 8, 8 }, { 56, 8 }, { 27, 5 }, { 37, 5 }, + { 20, 6 }, { 44, 6 }, { 60, 9 }, { 62, 10 }, { 0, 12 }, + { 64, 12 }, { 1, 11 }, { 5, 9 }, { 59, 9 }, { 14, 7 }, + { 50, 7 }, { 9, 8 }, { 55, 8 }, { 28, 5 }, { 36, 5 }, + { 21, 6 }, { 43, 6 }, { 29, 5 }, { 35, 5 }, { 15, 7 }, + { 49, 7 }, { 22, 6 }, { 42, 6 }, { 10, 8 }, { 54, 8 }, + { 16, 7 }, { 30, 5 }, { 34, 5 }, { 23, 6 }, { 41, 6 }, + /* bitalloc_65_c - 65 entries */ + { 23, 5 }, { 41, 5 }, { 50, 6 }, { 8, 7 }, { 56, 7 }, + { 24, 5 }, { 40, 5 }, { 15, 6 }, { 49, 6 }, { 25, 5 }, + { 39, 5 }, { 16, 6 }, { 48, 6 }, { 26, 5 }, { 38, 5 }, + { 60, 8 }, { 5, 8 }, { 9, 7 }, { 55, 7 }, { 10, 7 }, + { 27, 5 }, { 37, 5 }, { 17, 6 }, { 47, 6 }, { 28, 5 }, + { 36, 5 }, { 54, 7 }, { 59, 8 }, { 62, 9 }, { 0, 11 }, + { 64, 11 }, { 1, 10 }, { 18, 6 }, { 29, 5 }, { 35, 5 }, + { 46, 6 }, { 11, 7 }, { 53, 7 }, { 19, 6 }, { 45, 6 }, + { 30, 5 }, { 34, 5 }, { 31, 5 }, { 33, 5 }, { 6, 8 }, + { 58, 8 }, { 12, 7 }, { 20, 6 }, { 44, 6 }, { 52, 7 }, + { 3, 9 }, { 61, 9 }, { 7, 8 }, { 32, 5 }, { 21, 6 }, + { 43, 6 }, { 13, 7 }, { 51, 7 }, { 22, 6 }, { 42, 6 }, + { 57, 8 }, { 63, 10 }, { 2, 10 }, { 4, 9 }, { 14, 7 }, + /* bitalloc_65_d - 65 entries */ + { 31, 3 }, { 33, 3 }, { 48, 8 }, { 11, 10 }, { 53, 10 }, + { 14, 9 }, { 50, 9 }, { 9, 11 }, { 55, 11 }, { 12, 10 }, + { 17, 8 }, { 20, 7 }, { 44, 7 }, { 23, 6 }, { 41, 6 }, + { 26, 5 }, { 38, 5 }, { 29, 4 }, { 35, 4 }, { 32, 3 }, + { 47, 8 }, { 52, 10 }, { 60, 13 }, { 3, 14 }, { 61, 14 }, + { 7, 12 }, { 57, 12 }, { 5, 13 }, { 59, 13 }, { 15, 9 }, + { 18, 8 }, { 46, 8 }, { 21, 7 }, { 43, 7 }, { 24, 6 }, + { 40, 6 }, { 27, 5 }, { 37, 5 }, { 30, 4 }, { 34, 4 }, + { 49, 9 }, { 10, 11 }, { 54, 11 }, { 13, 10 }, { 51, 10 }, + { 8, 12 }, { 56, 12 }, { 0, 15 }, { 64, 15 }, { 1, 15 }, + { 63, 15 }, { 2, 15 }, { 62, 15 }, { 4, 14 }, { 6, 13 }, + { 58, 13 }, { 16, 9 }, { 19, 8 }, { 45, 8 }, { 22, 7 }, + { 42, 7 }, { 25, 6 }, { 39, 6 }, { 28, 5 }, { 36, 5 }, + /* bitalloc_65_e - 65 entries */ + { 33, 3 }, { 21, 6 }, { 43, 6 }, { 26, 5 }, { 38, 5 }, + { 16, 7 }, { 48, 7 }, { 22, 6 }, { 42, 6 }, { 10, 8 }, + { 54, 8 }, { 4, 9 }, { 60, 9 }, { 11, 8 }, { 27, 5 }, + { 37, 5 }, { 17, 7 }, { 47, 7 }, { 23, 6 }, { 30, 4 }, + { 34, 4 }, { 32, 3 }, { 41, 6 }, { 53, 8 }, { 5, 9 }, + { 59, 9 }, { 18, 7 }, { 46, 7 }, { 12, 8 }, { 52, 8 }, + { 24, 6 }, { 28, 5 }, { 36, 5 }, { 40, 6 }, { 6, 9 }, + { 58, 9 }, { 13, 8 }, { 19, 7 }, { 45, 7 }, { 51, 8 }, + { 0, 10 }, { 64, 10 }, { 7, 9 }, { 57, 9 }, { 1, 10 }, + { 63, 10 }, { 14, 8 }, { 50, 8 }, { 8, 9 }, { 56, 9 }, + { 20, 7 }, { 44, 7 }, { 25, 6 }, { 39, 6 }, { 15, 8 }, + { 49, 8 }, { 2, 10 }, { 62, 10 }, { 9, 9 }, { 55, 9 }, + { 3, 10 }, { 61, 10 }, { 29, 5 }, { 35, 5 }, { 31, 4 }, + /* bitalloc_65_f - 65 entries */ + { 28, 4 }, { 36, 4 }, { 26, 5 }, { 38, 5 }, { 24, 6 }, + { 40, 6 }, { 22, 7 }, { 42, 7 }, { 20, 8 }, { 44, 8 }, + { 18, 9 }, { 46, 9 }, { 48, 10 }, { 50, 11 }, { 12, 12 }, + { 52, 12 }, { 0, 14 }, { 64, 14 }, { 1, 14 }, { 63, 14 }, + { 10, 13 }, { 54, 13 }, { 2, 14 }, { 62, 14 }, { 3, 14 }, + { 61, 14 }, { 4, 14 }, { 60, 14 }, { 5, 14 }, { 59, 14 }, + { 6, 14 }, { 58, 14 }, { 7, 14 }, { 57, 14 }, { 8, 14 }, + { 56, 14 }, { 11, 13 }, { 15, 11 }, { 31, 3 }, { 33, 3 }, + { 29, 4 }, { 35, 4 }, { 27, 5 }, { 37, 5 }, { 25, 6 }, + { 39, 6 }, { 23, 7 }, { 41, 7 }, { 21, 8 }, { 43, 8 }, + { 19, 9 }, { 45, 9 }, { 17, 10 }, { 47, 10 }, { 49, 11 }, + { 13, 12 }, { 51, 12 }, { 53, 13 }, { 9, 14 }, { 55, 14 }, + { 14, 12 }, { 16, 11 }, { 32, 3 }, { 30, 4 }, { 34, 4 }, + /* bitalloc_65_g - 65 entries */ + { 36, 4 }, { 40, 5 }, { 44, 6 }, { 48, 7 }, { 12, 8 }, + { 52, 8 }, { 8, 9 }, { 56, 9 }, { 4, 10 }, { 60, 10 }, + { 0, 11 }, { 64, 11 }, { 5, 10 }, { 17, 7 }, { 21, 6 }, + { 25, 5 }, { 29, 4 }, { 35, 4 }, { 39, 5 }, { 43, 6 }, + { 47, 7 }, { 13, 8 }, { 51, 8 }, { 30, 4 }, { 9, 9 }, + { 55, 9 }, { 59, 10 }, { 1, 11 }, { 63, 11 }, { 10, 9 }, + { 18, 7 }, { 22, 6 }, { 26, 5 }, { 34, 4 }, { 38, 5 }, + { 42, 6 }, { 46, 7 }, { 14, 8 }, { 50, 8 }, { 31, 4 }, + { 33, 4 }, { 54, 9 }, { 6, 10 }, { 58, 10 }, { 2, 11 }, + { 62, 11 }, { 7, 10 }, { 11, 9 }, { 19, 7 }, { 23, 6 }, + { 27, 5 }, { 37, 5 }, { 41, 6 }, { 45, 7 }, { 15, 8 }, + { 49, 8 }, { 32, 4 }, { 53, 9 }, { 57, 10 }, { 3, 11 }, + { 61, 11 }, { 16, 8 }, { 20, 7 }, { 24, 6 }, { 28, 5 }, + /* bitalloc_129_a - 129 entries */ + { 66, 4 }, { 31, 8 }, { 97, 8 }, { 19, 9 }, { 109, 9 }, + { 6, 10 }, { 122, 10 }, { 7, 10 }, { 121, 10 }, { 52, 6 }, + { 76, 6 }, { 43, 7 }, { 85, 7 }, { 59, 5 }, { 69, 5 }, + { 32, 8 }, { 96, 8 }, { 20, 9 }, { 108, 9 }, { 33, 8 }, + { 53, 6 }, { 75, 6 }, { 95, 8 }, { 8, 10 }, { 120, 10 }, + { 21, 9 }, { 44, 7 }, { 84, 7 }, { 107, 9 }, { 9, 10 }, + { 119, 10 }, { 34, 8 }, { 94, 8 }, { 22, 9 }, { 106, 9 }, + { 45, 7 }, { 54, 6 }, { 74, 6 }, { 83, 7 }, { 10, 10 }, + { 118, 10 }, { 23, 9 }, { 35, 8 }, { 93, 8 }, { 105, 9 }, + { 11, 10 }, { 117, 10 }, { 46, 7 }, { 60, 5 }, { 68, 5 }, + { 82, 7 }, { 24, 9 }, { 104, 9 }, { 36, 8 }, { 55, 6 }, + { 73, 6 }, { 92, 8 }, { 12, 10 }, { 116, 10 }, { 25, 9 }, + { 47, 7 }, { 81, 7 }, { 37, 8 }, { 91, 8 }, { 103, 9 }, + { 13, 10 }, { 115, 10 }, { 26, 9 }, { 102, 9 }, { 48, 7 }, + { 64, 4 }, { 63, 4 }, { 65, 4 }, { 56, 6 }, { 72, 6 }, + { 61, 5 }, { 67, 5 }, { 80, 7 }, { 38, 8 }, { 90, 8 }, + { 0, 11 }, { 128, 11 }, { 14, 10 }, { 114, 10 }, { 1, 11 }, + { 127, 11 }, { 27, 9 }, { 101, 9 }, { 49, 7 }, { 79, 7 }, + { 39, 8 }, { 89, 8 }, { 57, 6 }, { 71, 6 }, { 15, 10 }, + { 113, 10 }, { 28, 9 }, { 100, 9 }, { 2, 11 }, { 126, 11 }, + { 16, 10 }, { 40, 8 }, { 88, 8 }, { 50, 7 }, { 78, 7 }, + { 112, 10 }, { 3, 11 }, { 125, 11 }, { 29, 9 }, { 99, 9 }, + { 17, 10 }, { 111, 10 }, { 41, 8 }, { 87, 8 }, { 58, 6 }, + { 4, 11 }, { 124, 11 }, { 18, 10 }, { 30, 9 }, { 98, 9 }, + { 110, 10 }, { 5, 11 }, { 123, 11 }, { 51, 7 }, { 70, 6 }, + { 77, 7 }, { 42, 8 }, { 86, 8 }, { 62, 5 }, + /* bitalloc_129_b - 129 entries */ + { 67, 5 }, { 21, 8 }, { 107, 8 }, { 33, 7 }, { 95, 7 }, + { 13, 9 }, { 115, 9 }, { 22, 8 }, { 47, 6 }, { 81, 6 }, + { 62, 5 }, { 66, 5 }, { 34, 7 }, { 94, 7 }, { 48, 6 }, + { 63, 5 }, { 65, 5 }, { 80, 6 }, { 106, 8 }, { 121, 10 }, + { 127, 12 }, { 2, 12 }, { 4, 11 }, { 14, 9 }, { 23, 8 }, + { 105, 8 }, { 35, 7 }, { 93, 7 }, { 49, 6 }, { 64, 5 }, + { 79, 6 }, { 114, 9 }, { 8, 10 }, { 120, 10 }, { 24, 8 }, + { 36, 7 }, { 50, 6 }, { 78, 6 }, { 92, 7 }, { 104, 8 }, + { 15, 9 }, { 113, 9 }, { 51, 6 }, { 77, 6 }, { 37, 7 }, + { 91, 7 }, { 25, 8 }, { 103, 8 }, { 38, 7 }, { 52, 6 }, + { 76, 6 }, { 90, 7 }, { 16, 9 }, { 112, 9 }, { 26, 8 }, + { 53, 6 }, { 75, 6 }, { 102, 8 }, { 124, 11 }, { 5, 11 }, + { 9, 10 }, { 119, 10 }, { 10, 10 }, { 39, 7 }, { 89, 7 }, + { 27, 8 }, { 101, 8 }, { 54, 6 }, { 74, 6 }, { 40, 7 }, + { 88, 7 }, { 17, 9 }, { 111, 9 }, { 28, 8 }, { 100, 8 }, + { 118, 10 }, { 123, 11 }, { 126, 12 }, { 0, 14 }, { 128, 14 }, + { 1, 13 }, { 18, 9 }, { 55, 6 }, { 73, 6 }, { 41, 7 }, + { 87, 7 }, { 56, 6 }, { 72, 6 }, { 29, 8 }, { 99, 8 }, + { 42, 7 }, { 86, 7 }, { 110, 9 }, { 11, 10 }, { 117, 10 }, + { 19, 9 }, { 109, 9 }, { 57, 6 }, { 71, 6 }, { 43, 7 }, + { 85, 7 }, { 58, 6 }, { 70, 6 }, { 30, 8 }, { 98, 8 }, + { 44, 7 }, { 84, 7 }, { 31, 8 }, { 97, 8 }, { 59, 6 }, + { 69, 6 }, { 6, 11 }, { 122, 11 }, { 12, 10 }, { 20, 9 }, + { 108, 9 }, { 116, 10 }, { 3, 12 }, { 125, 12 }, { 7, 11 }, + { 45, 7 }, { 60, 6 }, { 68, 6 }, { 83, 7 }, { 32, 8 }, + { 96, 8 }, { 46, 7 }, { 82, 7 }, { 61, 6 }, + /* bitalloc_129_c - 129 entries */ + { 101, 7 }, { 113, 8 }, { 120, 9 }, { 127, 11 }, { 2, 11 }, + { 4, 10 }, { 28, 7 }, { 100, 7 }, { 46, 6 }, { 82, 6 }, + { 16, 8 }, { 112, 8 }, { 29, 7 }, { 47, 6 }, { 81, 6 }, + { 48, 6 }, { 80, 6 }, { 99, 7 }, { 30, 7 }, { 98, 7 }, + { 17, 8 }, { 111, 8 }, { 49, 6 }, { 79, 6 }, { 50, 6 }, + { 78, 6 }, { 31, 7 }, { 97, 7 }, { 9, 9 }, { 119, 9 }, + { 18, 8 }, { 110, 8 }, { 124, 10 }, { 5, 10 }, { 10, 9 }, + { 51, 6 }, { 77, 6 }, { 32, 7 }, { 96, 7 }, { 52, 6 }, + { 76, 6 }, { 33, 7 }, { 95, 7 }, { 53, 6 }, { 75, 6 }, + { 19, 8 }, { 109, 8 }, { 34, 7 }, { 54, 6 }, { 74, 6 }, + { 94, 7 }, { 118, 9 }, { 123, 10 }, { 126, 11 }, { 0, 13 }, + { 128, 13 }, { 1, 12 }, { 20, 8 }, { 55, 6 }, { 73, 6 }, + { 108, 8 }, { 11, 9 }, { 117, 9 }, { 35, 7 }, { 93, 7 }, + { 36, 7 }, { 56, 6 }, { 72, 6 }, { 92, 7 }, { 21, 8 }, + { 107, 8 }, { 57, 6 }, { 71, 6 }, { 37, 7 }, { 91, 7 }, + { 58, 6 }, { 70, 6 }, { 22, 8 }, { 106, 8 }, { 38, 7 }, + { 59, 6 }, { 69, 6 }, { 90, 7 }, { 12, 9 }, { 116, 9 }, + { 23, 8 }, { 60, 6 }, { 68, 6 }, { 39, 7 }, { 89, 7 }, + { 61, 6 }, { 67, 6 }, { 105, 8 }, { 6, 10 }, { 122, 10 }, + { 13, 9 }, { 40, 7 }, { 62, 6 }, { 66, 6 }, { 88, 7 }, + { 24, 8 }, { 104, 8 }, { 63, 6 }, { 65, 6 }, { 41, 7 }, + { 87, 7 }, { 115, 9 }, { 3, 11 }, { 125, 11 }, { 7, 10 }, + { 25, 8 }, { 42, 7 }, { 64, 6 }, { 86, 7 }, { 103, 8 }, + { 14, 9 }, { 114, 9 }, { 43, 7 }, { 85, 7 }, { 26, 8 }, + { 102, 8 }, { 44, 7 }, { 84, 7 }, { 121, 10 }, { 8, 10 }, + { 15, 9 }, { 27, 8 }, { 45, 7 }, { 83, 7 }, + /* bitalloc_129_d - 129 entries */ + { 72, 5 }, { 83, 7 }, { 34, 9 }, { 94, 9 }, { 40, 8 }, + { 51, 6 }, { 62, 4 }, { 66, 4 }, { 77, 6 }, { 88, 8 }, + { 18, 12 }, { 110, 12 }, { 9, 14 }, { 119, 14 }, { 14, 13 }, + { 19, 12 }, { 29, 10 }, { 99, 10 }, { 24, 11 }, { 104, 11 }, + { 46, 7 }, { 57, 5 }, { 71, 5 }, { 82, 7 }, { 35, 9 }, + { 93, 9 }, { 41, 8 }, { 52, 6 }, { 63, 4 }, { 65, 4 }, + { 76, 6 }, { 87, 8 }, { 30, 10 }, { 98, 10 }, { 109, 12 }, + { 114, 13 }, { 6, 15 }, { 122, 15 }, { 10, 14 }, { 25, 11 }, + { 103, 11 }, { 15, 13 }, { 113, 13 }, { 20, 12 }, { 47, 7 }, + { 58, 5 }, { 70, 5 }, { 81, 7 }, { 36, 9 }, { 92, 9 }, + { 42, 8 }, { 53, 6 }, { 64, 4 }, { 75, 6 }, { 86, 8 }, + { 31, 10 }, { 97, 10 }, { 108, 12 }, { 118, 14 }, { 7, 15 }, + { 121, 15 }, { 0, 16 }, { 128, 16 }, { 1, 16 }, { 127, 16 }, + { 2, 16 }, { 126, 16 }, { 3, 16 }, { 125, 16 }, { 26, 11 }, + { 102, 11 }, { 11, 14 }, { 117, 14 }, { 16, 13 }, { 21, 12 }, + { 48, 7 }, { 59, 5 }, { 69, 5 }, { 80, 7 }, { 37, 9 }, + { 91, 9 }, { 43, 8 }, { 54, 6 }, { 74, 6 }, { 85, 8 }, + { 32, 10 }, { 96, 10 }, { 107, 12 }, { 112, 13 }, { 4, 16 }, + { 124, 16 }, { 8, 15 }, { 12, 14 }, { 27, 11 }, { 101, 11 }, + { 22, 12 }, { 106, 12 }, { 49, 7 }, { 60, 5 }, { 68, 5 }, + { 79, 7 }, { 38, 9 }, { 90, 9 }, { 44, 8 }, { 55, 6 }, + { 73, 6 }, { 84, 8 }, { 33, 10 }, { 95, 10 }, { 116, 14 }, + { 120, 15 }, { 5, 16 }, { 123, 16 }, { 17, 13 }, { 111, 13 }, + { 13, 14 }, { 115, 14 }, { 28, 11 }, { 100, 11 }, { 23, 12 }, + { 105, 12 }, { 50, 7 }, { 61, 5 }, { 67, 5 }, { 78, 7 }, + { 39, 9 }, { 89, 9 }, { 45, 8 }, { 56, 6 }, + /* bitalloc_129_e - 129 entries */ + { 70, 5 }, { 59, 5 }, { 69, 5 }, { 60, 5 }, { 68, 5 }, + { 37, 7 }, { 91, 7 }, { 45, 6 }, { 61, 5 }, { 67, 5 }, + { 62, 5 }, { 66, 5 }, { 63, 5 }, { 65, 5 }, { 64, 5 }, + { 83, 6 }, { 97, 8 }, { 102, 9 }, { 18, 11 }, { 110, 11 }, + { 22, 10 }, { 38, 7 }, { 46, 6 }, { 82, 6 }, { 90, 7 }, + { 32, 8 }, { 96, 8 }, { 47, 6 }, { 81, 6 }, { 106, 10 }, + { 15, 12 }, { 113, 12 }, { 19, 11 }, { 27, 9 }, { 101, 9 }, + { 23, 10 }, { 105, 10 }, { 39, 7 }, { 89, 7 }, { 33, 8 }, + { 95, 8 }, { 48, 6 }, { 80, 6 }, { 49, 6 }, { 79, 6 }, + { 40, 7 }, { 88, 7 }, { 28, 9 }, { 100, 9 }, { 109, 11 }, + { 6, 15 }, { 122, 15 }, { 9, 14 }, { 12, 13 }, { 116, 13 }, + { 119, 14 }, { 0, 16 }, { 4, 16 }, { 3, 16 }, { 2, 16 }, + { 24, 10 }, { 104, 10 }, { 16, 12 }, { 112, 12 }, { 20, 11 }, + { 34, 8 }, { 94, 8 }, { 50, 6 }, { 78, 6 }, { 41, 7 }, + { 87, 7 }, { 51, 6 }, { 77, 6 }, { 52, 6 }, { 76, 6 }, + { 29, 9 }, { 99, 9 }, { 35, 8 }, { 42, 7 }, { 86, 7 }, + { 93, 8 }, { 108, 11 }, { 1, 16 }, { 128, 16 }, { 126, 16 }, + { 127, 16 }, { 124, 16 }, { 125, 16 }, { 7, 15 }, { 13, 13 }, + { 115, 13 }, { 10, 14 }, { 118, 14 }, { 25, 10 }, { 103, 10 }, + { 17, 12 }, { 111, 12 }, { 21, 11 }, { 53, 6 }, { 75, 6 }, + { 54, 6 }, { 74, 6 }, { 43, 7 }, { 85, 7 }, { 55, 6 }, + { 73, 6 }, { 30, 9 }, { 98, 9 }, { 36, 8 }, { 92, 8 }, + { 107, 11 }, { 121, 15 }, { 5, 16 }, { 123, 16 }, { 8, 15 }, + { 120, 15 }, { 14, 13 }, { 114, 13 }, { 11, 14 }, { 117, 14 }, + { 26, 10 }, { 31, 9 }, { 56, 6 }, { 72, 6 }, { 57, 6 }, + { 71, 6 }, { 44, 7 }, { 84, 7 }, { 58, 6 }, + /* bitalloc_129_f - 129 entries */ + { 42, 6 }, { 86, 6 }, { 43, 6 }, { 85, 6 }, { 107, 8 }, + { 114, 9 }, { 9, 10 }, { 119, 10 }, { 30, 7 }, { 98, 7 }, + { 31, 7 }, { 44, 6 }, { 84, 6 }, { 45, 6 }, { 83, 6 }, + { 97, 7 }, { 22, 8 }, { 106, 8 }, { 46, 6 }, { 82, 6 }, + { 32, 7 }, { 96, 7 }, { 47, 6 }, { 81, 6 }, { 15, 9 }, + { 113, 9 }, { 23, 8 }, { 105, 8 }, { 10, 10 }, { 118, 10 }, + { 16, 9 }, { 48, 6 }, { 80, 6 }, { 33, 7 }, { 95, 7 }, + { 49, 6 }, { 79, 6 }, { 50, 6 }, { 78, 6 }, { 112, 9 }, + { 3, 12 }, { 125, 12 }, { 6, 11 }, { 122, 11 }, { 7, 11 }, + { 24, 8 }, { 34, 7 }, { 51, 6 }, { 77, 6 }, { 94, 7 }, + { 104, 8 }, { 11, 10 }, { 117, 10 }, { 17, 9 }, { 52, 6 }, + { 76, 6 }, { 53, 6 }, { 75, 6 }, { 35, 7 }, { 93, 7 }, + { 54, 6 }, { 74, 6 }, { 55, 6 }, { 73, 6 }, { 25, 8 }, + { 103, 8 }, { 36, 7 }, { 56, 6 }, { 72, 6 }, { 57, 6 }, + { 71, 6 }, { 92, 7 }, { 111, 9 }, { 121, 11 }, { 127, 13 }, + { 2, 13 }, { 4, 12 }, { 12, 10 }, { 18, 9 }, { 110, 9 }, + { 58, 6 }, { 70, 6 }, { 59, 6 }, { 69, 6 }, { 60, 6 }, + { 68, 6 }, { 61, 6 }, { 67, 6 }, { 62, 6 }, { 66, 6 }, + { 26, 8 }, { 102, 8 }, { 37, 7 }, { 63, 6 }, { 65, 6 }, + { 64, 6 }, { 91, 7 }, { 38, 7 }, { 90, 7 }, { 27, 8 }, + { 101, 8 }, { 116, 10 }, { 124, 12 }, { 126, 13 }, { 0, 15 }, + { 128, 15 }, { 1, 14 }, { 8, 11 }, { 19, 9 }, { 109, 9 }, + { 13, 10 }, { 115, 10 }, { 39, 7 }, { 89, 7 }, { 28, 8 }, + { 100, 8 }, { 40, 7 }, { 88, 7 }, { 41, 7 }, { 87, 7 }, + { 20, 9 }, { 108, 9 }, { 29, 8 }, { 99, 8 }, { 120, 11 }, + { 5, 12 }, { 123, 12 }, { 14, 10 }, { 21, 9 }, + /* bitalloc_129_g - 129 entries */ + { 64, 4 }, { 88, 7 }, { 9, 11 }, { 119, 11 }, { 17, 10 }, + { 25, 9 }, { 33, 8 }, { 41, 7 }, { 87, 7 }, { 49, 6 }, + { 79, 6 }, { 57, 5 }, { 71, 5 }, { 95, 8 }, { 103, 9 }, + { 111, 10 }, { 2, 12 }, { 126, 12 }, { 10, 11 }, { 18, 10 }, + { 110, 10 }, { 26, 9 }, { 34, 8 }, { 42, 7 }, { 86, 7 }, + { 50, 6 }, { 78, 6 }, { 58, 5 }, { 70, 5 }, { 94, 8 }, + { 102, 9 }, { 118, 11 }, { 3, 12 }, { 125, 12 }, { 11, 11 }, + { 117, 11 }, { 19, 10 }, { 109, 10 }, { 27, 9 }, { 35, 8 }, + { 43, 7 }, { 85, 7 }, { 51, 6 }, { 77, 6 }, { 59, 5 }, + { 69, 5 }, { 93, 8 }, { 101, 9 }, { 4, 12 }, { 124, 12 }, + { 12, 11 }, { 20, 10 }, { 28, 9 }, { 100, 9 }, { 36, 8 }, + { 44, 7 }, { 84, 7 }, { 52, 6 }, { 76, 6 }, { 60, 5 }, + { 68, 5 }, { 92, 8 }, { 108, 10 }, { 116, 11 }, { 5, 12 }, + { 123, 12 }, { 13, 11 }, { 115, 11 }, { 21, 10 }, { 29, 9 }, + { 99, 9 }, { 37, 8 }, { 45, 7 }, { 83, 7 }, { 53, 6 }, + { 75, 6 }, { 61, 5 }, { 67, 5 }, { 91, 8 }, { 107, 10 }, + { 6, 12 }, { 122, 12 }, { 14, 11 }, { 22, 10 }, { 106, 10 }, + { 30, 9 }, { 98, 9 }, { 38, 8 }, { 46, 7 }, { 82, 7 }, + { 54, 6 }, { 74, 6 }, { 62, 5 }, { 66, 5 }, { 90, 8 }, + { 114, 11 }, { 7, 12 }, { 121, 12 }, { 15, 11 }, { 113, 11 }, + { 23, 10 }, { 105, 10 }, { 31, 9 }, { 97, 9 }, { 39, 8 }, + { 47, 7 }, { 81, 7 }, { 55, 6 }, { 73, 6 }, { 63, 5 }, + { 65, 5 }, { 89, 8 }, { 0, 13 }, { 128, 13 }, { 8, 12 }, + { 16, 11 }, { 24, 10 }, { 32, 9 }, { 96, 9 }, { 104, 10 }, + { 112, 11 }, { 120, 12 }, { 1, 13 }, { 127, 13 }, { 40, 8 }, + { 48, 7 }, { 80, 7 }, { 56, 6 }, { 72, 6 }, + /* bit_alloc_12[0] - 12 entries */ + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, + { 5, 6 }, { 11, 9 }, { 10, 9 }, { 9, 9 }, { 8, 9 }, + { 7, 8 }, { 6, 8 }, + /* bit_alloc_12[1] - 12 entries */ + { 1, 2 }, { 2, 3 }, { 4, 5 }, { 11, 7 }, { 10, 7 }, + { 9, 7 }, { 8, 7 }, { 7, 7 }, { 6, 7 }, { 5, 6 }, + { 3, 5 }, { 0, 1 }, + /* bit_alloc_12[2] - 12 entries */ + { 0, 2 }, { 4, 3 }, { 7, 4 }, { 11, 7 }, { 10, 7 }, + { 9, 6 }, { 8, 5 }, { 3, 3 }, { 2, 3 }, { 6, 4 }, + { 5, 4 }, { 1, 3 }, + /* bit_alloc_12[3] - 12 entries */ + { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, + { 7, 7 }, { 8, 8 }, { 9, 9 }, { 11, 10 }, { 10, 10 }, + { 1, 2 }, { 0, 2 }, + /* bit_alloc_12[4] - 12 entries */ + { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 5 }, { 9, 8 }, + { 8, 8 }, { 6, 7 }, { 7, 8 }, { 11, 9 }, { 10, 9 }, + { 5, 7 }, { 0, 1 }, + /* scale_factor[0] - 129 entries */ + { 66, 3 }, { 69, 5 }, { 55, 8 }, { 73, 8 }, { 40, 13 }, + { 88, 13 }, { 41, 13 }, { 87, 13 }, { 42, 13 }, { 86, 13 }, + { 43, 13 }, { 85, 13 }, { 44, 13 }, { 84, 13 }, { 45, 13 }, + { 83, 13 }, { 46, 13 }, { 82, 13 }, { 47, 13 }, { 81, 13 }, + { 51, 11 }, { 77, 11 }, { 48, 13 }, { 80, 13 }, { 50, 12 }, + { 78, 12 }, { 49, 13 }, { 79, 13 }, { 54, 9 }, { 74, 9 }, + { 58, 6 }, { 61, 4 }, { 64, 2 }, { 67, 4 }, { 70, 6 }, + { 57, 7 }, { 71, 7 }, { 60, 5 }, { 63, 3 }, { 65, 3 }, + { 68, 5 }, { 56, 8 }, { 72, 8 }, { 53, 10 }, { 75, 10 }, + { 52, 11 }, { 76, 11 }, { 0, 14 }, { 128, 14 }, { 1, 14 }, + { 127, 14 }, { 2, 14 }, { 126, 14 }, { 3, 14 }, { 125, 14 }, + { 4, 14 }, { 124, 14 }, { 5, 14 }, { 123, 14 }, { 6, 14 }, + { 122, 14 }, { 7, 14 }, { 121, 14 }, { 8, 14 }, { 120, 14 }, + { 9, 14 }, { 119, 14 }, { 10, 14 }, { 118, 14 }, { 11, 14 }, + { 117, 14 }, { 12, 14 }, { 116, 14 }, { 13, 14 }, { 115, 14 }, + { 14, 14 }, { 114, 14 }, { 15, 14 }, { 113, 14 }, { 16, 14 }, + { 112, 14 }, { 17, 14 }, { 111, 14 }, { 18, 14 }, { 110, 14 }, + { 19, 14 }, { 109, 14 }, { 20, 14 }, { 108, 14 }, { 21, 14 }, + { 107, 14 }, { 22, 14 }, { 106, 14 }, { 23, 14 }, { 105, 14 }, + { 24, 14 }, { 104, 14 }, { 25, 14 }, { 103, 14 }, { 26, 14 }, + { 102, 14 }, { 27, 14 }, { 101, 14 }, { 28, 14 }, { 100, 14 }, + { 29, 14 }, { 99, 14 }, { 30, 14 }, { 98, 14 }, { 31, 14 }, + { 97, 14 }, { 32, 14 }, { 96, 14 }, { 33, 14 }, { 95, 14 }, + { 34, 14 }, { 94, 14 }, { 35, 14 }, { 93, 14 }, { 36, 14 }, + { 92, 14 }, { 37, 14 }, { 91, 14 }, { 38, 14 }, { 90, 14 }, + { 39, 14 }, { 89, 14 }, { 59, 6 }, { 62, 4 }, + /* scale_factor[1] - 129 entries */ + { 69, 4 }, { 56, 6 }, { 72, 6 }, { 55, 7 }, { 73, 7 }, + { 54, 8 }, { 74, 8 }, { 75, 9 }, { 48, 14 }, { 80, 14 }, + { 49, 14 }, { 79, 14 }, { 50, 13 }, { 78, 13 }, { 51, 12 }, + { 77, 12 }, { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, + { 2, 15 }, { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, + { 124, 15 }, { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, + { 7, 15 }, { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, + { 119, 15 }, { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, + { 12, 15 }, { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, + { 114, 15 }, { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, + { 17, 15 }, { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, + { 109, 15 }, { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, + { 22, 15 }, { 106, 15 }, { 23, 15 }, { 105, 15 }, { 24, 15 }, + { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, { 102, 15 }, + { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, { 29, 15 }, + { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, { 97, 15 }, + { 32, 15 }, { 96, 15 }, { 33, 15 }, { 95, 15 }, { 34, 15 }, + { 94, 15 }, { 35, 15 }, { 93, 15 }, { 36, 15 }, { 92, 15 }, + { 37, 15 }, { 91, 15 }, { 38, 15 }, { 90, 15 }, { 39, 15 }, + { 89, 15 }, { 40, 15 }, { 88, 15 }, { 41, 15 }, { 87, 15 }, + { 42, 15 }, { 86, 15 }, { 43, 15 }, { 85, 15 }, { 44, 15 }, + { 84, 15 }, { 45, 15 }, { 83, 15 }, { 46, 15 }, { 82, 15 }, + { 47, 15 }, { 81, 15 }, { 52, 11 }, { 76, 11 }, { 53, 10 }, + { 63, 3 }, { 65, 3 }, { 64, 3 }, { 58, 5 }, { 70, 5 }, + { 60, 4 }, { 68, 4 }, { 61, 4 }, { 67, 4 }, { 57, 6 }, + { 71, 6 }, { 59, 5 }, { 62, 4 }, { 66, 4 }, + /* scale_factor[2] - 129 entries */ + { 63, 3 }, { 65, 3 }, { 46, 9 }, { 82, 9 }, { 49, 8 }, + { 79, 8 }, { 85, 10 }, { 38, 12 }, { 90, 12 }, { 41, 11 }, + { 87, 11 }, { 93, 13 }, { 33, 14 }, { 95, 14 }, { 36, 13 }, + { 92, 13 }, { 44, 10 }, { 52, 7 }, { 76, 7 }, { 55, 6 }, + { 73, 6 }, { 58, 5 }, { 70, 5 }, { 61, 4 }, { 67, 4 }, + { 64, 3 }, { 47, 9 }, { 81, 9 }, { 50, 8 }, { 78, 8 }, + { 84, 10 }, { 39, 12 }, { 89, 12 }, { 42, 11 }, { 86, 11 }, + { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, { 2, 15 }, + { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, { 124, 15 }, + { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, { 7, 15 }, + { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, { 119, 15 }, + { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, { 12, 15 }, + { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, { 114, 15 }, + { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, { 17, 15 }, + { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, { 109, 15 }, + { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, { 22, 15 }, + { 106, 15 }, { 23, 15 }, { 105, 15 }, { 53, 7 }, { 75, 7 }, + { 56, 6 }, { 72, 6 }, { 59, 5 }, { 69, 5 }, { 62, 4 }, + { 66, 4 }, { 45, 10 }, { 83, 10 }, { 48, 9 }, { 80, 9 }, + { 24, 15 }, { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, + { 102, 15 }, { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, + { 29, 15 }, { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, + { 97, 15 }, { 34, 14 }, { 94, 14 }, { 37, 13 }, { 40, 12 }, + { 88, 12 }, { 91, 13 }, { 32, 15 }, { 96, 15 }, { 35, 14 }, + { 43, 11 }, { 51, 8 }, { 77, 8 }, { 54, 7 }, { 74, 7 }, + { 57, 6 }, { 71, 6 }, { 60, 5 }, { 68, 5 }, + /* scale_factor[3] - 129 entries */ + { 64, 2 }, { 53, 8 }, { 75, 8 }, { 55, 7 }, { 57, 6 }, + { 59, 5 }, { 69, 5 }, { 71, 6 }, { 73, 7 }, { 77, 9 }, + { 79, 10 }, { 83, 12 }, { 42, 14 }, { 86, 14 }, { 44, 13 }, + { 46, 12 }, { 82, 12 }, { 48, 11 }, { 80, 11 }, { 50, 10 }, + { 52, 9 }, { 61, 4 }, { 67, 4 }, { 63, 3 }, { 65, 3 }, + { 54, 8 }, { 74, 8 }, { 56, 7 }, { 58, 6 }, { 60, 5 }, + { 68, 5 }, { 70, 6 }, { 72, 7 }, { 76, 9 }, { 78, 10 }, + { 84, 13 }, { 0, 15 }, { 128, 15 }, { 1, 15 }, { 127, 15 }, + { 2, 15 }, { 126, 15 }, { 3, 15 }, { 125, 15 }, { 4, 15 }, + { 124, 15 }, { 5, 15 }, { 123, 15 }, { 6, 15 }, { 122, 15 }, + { 7, 15 }, { 121, 15 }, { 8, 15 }, { 120, 15 }, { 9, 15 }, + { 119, 15 }, { 10, 15 }, { 118, 15 }, { 11, 15 }, { 117, 15 }, + { 12, 15 }, { 116, 15 }, { 13, 15 }, { 115, 15 }, { 14, 15 }, + { 114, 15 }, { 15, 15 }, { 113, 15 }, { 16, 15 }, { 112, 15 }, + { 17, 15 }, { 111, 15 }, { 18, 15 }, { 110, 15 }, { 19, 15 }, + { 109, 15 }, { 20, 15 }, { 108, 15 }, { 21, 15 }, { 107, 15 }, + { 22, 15 }, { 106, 15 }, { 23, 15 }, { 105, 15 }, { 24, 15 }, + { 104, 15 }, { 25, 15 }, { 103, 15 }, { 26, 15 }, { 102, 15 }, + { 27, 15 }, { 101, 15 }, { 28, 15 }, { 100, 15 }, { 29, 15 }, + { 99, 15 }, { 30, 15 }, { 98, 15 }, { 31, 15 }, { 97, 15 }, + { 32, 15 }, { 96, 15 }, { 33, 15 }, { 95, 15 }, { 34, 15 }, + { 94, 15 }, { 35, 15 }, { 93, 15 }, { 36, 15 }, { 92, 15 }, + { 37, 15 }, { 91, 15 }, { 38, 15 }, { 90, 15 }, { 39, 15 }, + { 89, 15 }, { 40, 15 }, { 88, 15 }, { 41, 15 }, { 87, 15 }, + { 43, 14 }, { 85, 14 }, { 45, 13 }, { 47, 12 }, { 81, 12 }, + { 49, 11 }, { 51, 10 }, { 62, 4 }, { 66, 4 }, + /* scale_factor[4] - 129 entries */ + { 56, 5 }, { 72, 5 }, { 52, 6 }, { 76, 6 }, { 48, 7 }, + { 80, 7 }, { 44, 8 }, { 84, 8 }, { 40, 9 }, { 88, 9 }, + { 36, 10 }, { 92, 10 }, { 96, 11 }, { 28, 12 }, { 100, 12 }, + { 24, 13 }, { 104, 13 }, { 16, 15 }, { 112, 15 }, { 20, 14 }, + { 108, 14 }, { 21, 14 }, { 33, 11 }, { 61, 4 }, { 67, 4 }, + { 57, 5 }, { 71, 5 }, { 53, 6 }, { 75, 6 }, { 49, 7 }, + { 79, 7 }, { 45, 8 }, { 83, 8 }, { 41, 9 }, { 87, 9 }, + { 37, 10 }, { 91, 10 }, { 95, 11 }, { 29, 12 }, { 99, 12 }, + { 25, 13 }, { 103, 13 }, { 107, 14 }, { 17, 15 }, { 111, 15 }, + { 26, 13 }, { 34, 11 }, { 62, 4 }, { 66, 4 }, { 58, 5 }, + { 70, 5 }, { 54, 6 }, { 74, 6 }, { 50, 7 }, { 78, 7 }, + { 46, 8 }, { 82, 8 }, { 42, 9 }, { 86, 9 }, { 38, 10 }, + { 90, 10 }, { 94, 11 }, { 30, 12 }, { 98, 12 }, { 39, 10 }, + { 63, 4 }, { 65, 4 }, { 59, 5 }, { 69, 5 }, { 55, 6 }, + { 73, 6 }, { 51, 7 }, { 77, 7 }, { 47, 8 }, { 81, 8 }, + { 43, 9 }, { 85, 9 }, { 89, 10 }, { 102, 13 }, { 22, 14 }, + { 106, 14 }, { 18, 15 }, { 110, 15 }, { 0, 16 }, { 128, 16 }, + { 1, 16 }, { 127, 16 }, { 27, 13 }, { 35, 11 }, { 93, 11 }, + { 31, 12 }, { 97, 12 }, { 101, 13 }, { 2, 16 }, { 126, 16 }, + { 3, 16 }, { 125, 16 }, { 4, 16 }, { 124, 16 }, { 5, 16 }, + { 123, 16 }, { 6, 16 }, { 122, 16 }, { 7, 16 }, { 121, 16 }, + { 8, 16 }, { 120, 16 }, { 9, 16 }, { 119, 16 }, { 10, 16 }, + { 118, 16 }, { 11, 16 }, { 117, 16 }, { 12, 16 }, { 116, 16 }, + { 13, 16 }, { 115, 16 }, { 14, 16 }, { 114, 16 }, { 15, 16 }, + { 113, 16 }, { 23, 14 }, { 105, 14 }, { 19, 15 }, { 109, 15 }, + { 32, 12 }, { 64, 4 }, { 60, 5 }, { 68, 5 }, + /* transition_mode[0] - 4 entries */ + { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 3 }, + /* transition_mode[1] - 4 entries */ + { 3, 1 }, { 0, 2 }, { 1, 3 }, { 2, 3 }, + /* transition_mode[2] - 4 entries */ + { 2, 1 }, { 3, 2 }, { 0, 3 }, { 1, 3 }, + /* transition_mode[3] - 4 entries */ + { 0, 2 }, { 1, 2 }, { 2, 2 }, { 3, 2 }, + /* tnl_group[0] - 37 entries */ + { 5, 3 }, { 4, 3 }, { 19, 8 }, { 33, 12 }, { 31, 12 }, + { 28, 11 }, { 34, 14 }, { 37, 14 }, { 35, 15 }, { 0, 15 }, + { 36, 14 }, { 32, 12 }, { 30, 11 }, { 24, 9 }, { 22, 8 }, + { 23, 9 }, { 29, 10 }, { 27, 10 }, { 17, 6 }, { 14, 5 }, + { 7, 4 }, { 12, 5 }, { 1, 6 }, { 26, 9 }, { 3, 9 }, + { 25, 8 }, { 20, 7 }, { 8, 4 }, { 10, 4 }, { 13, 4 }, + { 15, 6 }, { 16, 6 }, { 18, 6 }, { 21, 6 }, { 11, 4 }, + { 9, 3 }, { 6, 3 }, + /* tnl_group[1] - 34 entries */ + { 4, 4 }, { 7, 4 }, { 10, 4 }, { 3, 10 }, { 27, 10 }, + { 29, 10 }, { 28, 10 }, { 22, 8 }, { 21, 7 }, { 15, 6 }, + { 14, 5 }, { 8, 4 }, { 16, 6 }, { 19, 7 }, { 23, 8 }, + { 26, 9 }, { 30, 10 }, { 33, 13 }, { 34, 14 }, { 0, 14 }, + { 32, 12 }, { 31, 11 }, { 12, 5 }, { 5, 3 }, { 9, 3 }, + { 1, 4 }, { 20, 7 }, { 25, 8 }, { 24, 8 }, { 18, 6 }, + { 17, 5 }, { 6, 3 }, { 11, 4 }, { 13, 4 }, + /* tnl_group[2] - 31 entries */ + { 14, 7 }, { 17, 7 }, { 15, 7 }, { 23, 9 }, { 28, 10 }, + { 29, 11 }, { 30, 13 }, { 0, 13 }, { 31, 12 }, { 25, 8 }, + { 10, 5 }, { 8, 4 }, { 9, 4 }, { 4, 4 }, { 22, 8 }, + { 3, 8 }, { 21, 8 }, { 26, 9 }, { 27, 9 }, { 12, 6 }, + { 11, 5 }, { 16, 7 }, { 18, 7 }, { 20, 8 }, { 24, 8 }, + { 19, 7 }, { 13, 5 }, { 5, 3 }, { 1, 2 }, { 6, 3 }, + { 7, 3 }, + /* tnl_group[3] - 28 entries */ + { 8, 6 }, { 2, 6 }, { 7, 6 }, { 23, 7 }, { 12, 7 }, + { 5, 4 }, { 10, 6 }, { 20, 8 }, { 25, 9 }, { 26, 10 }, + { 27, 11 }, { 0, 11 }, { 22, 7 }, { 9, 5 }, { 13, 6 }, + { 17, 6 }, { 4, 5 }, { 14, 6 }, { 19, 7 }, { 24, 7 }, + { 3, 6 }, { 11, 6 }, { 21, 6 }, { 18, 6 }, { 16, 6 }, + { 15, 6 }, { 6, 3 }, { 1, 1 }, + /* tnl_group[4] - 23 entries */ + { 2, 2 }, { 7, 7 }, { 15, 8 }, { 21, 8 }, { 3, 6 }, + { 6, 6 }, { 13, 7 }, { 14, 8 }, { 18, 8 }, { 4, 4 }, + { 5, 5 }, { 11, 7 }, { 10, 7 }, { 20, 6 }, { 12, 8 }, + { 16, 9 }, { 22, 10 }, { 0, 10 }, { 17, 7 }, { 19, 6 }, + { 8, 6 }, { 9, 6 }, { 1, 1 }, + /* tnl_scf - 20 entries */ + { 3, 3 }, { 11, 6 }, { 16, 9 }, { 17, 10 }, { 18, 11 }, + { 19, 12 }, { 0, 12 }, { 15, 8 }, { 14, 7 }, { 9, 5 }, + { 7, 4 }, { 2, 3 }, { 4, 3 }, { 1, 3 }, { 5, 3 }, + { 12, 6 }, { 13, 6 }, { 10, 5 }, { 8, 4 }, { 6, 3 }, + /* damp - 7 entries */ + { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, + { 0, 6 }, { 1, 1 }, + /* dph - 9 entries */ + { 2, 2 }, { 1, 2 }, { 3, 4 }, { 7, 4 }, { 6, 5 }, + { 5, 6 }, { 0, 6 }, { 4, 4 }, { 8, 2 }, + /* fst_rsd_amp - 24 entries */ + { 12, 4 }, { 17, 4 }, { 1, 6 }, { 8, 6 }, { 9, 5 }, + { 20, 7 }, { 3, 7 }, { 5, 6 }, { 6, 6 }, { 2, 7 }, + { 22, 9 }, { 23, 10 }, { 0, 10 }, { 21, 8 }, { 11, 4 }, + { 19, 5 }, { 7, 6 }, { 4, 6 }, { 16, 3 }, { 10, 4 }, + { 18, 4 }, { 15, 3 }, { 13, 3 }, { 14, 3 }, + /* rsd_apprx - 6 entries */ + { 1, 1 }, { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, + { 0, 5 }, + /* rsd_amp - 33 entries */ + { 2, 3 }, { 1, 3 }, { 5, 3 }, { 14, 8 }, { 20, 9 }, + { 26, 10 }, { 25, 12 }, { 32, 12 }, { 19, 11 }, { 16, 8 }, + { 24, 9 }, { 17, 9 }, { 12, 7 }, { 13, 7 }, { 9, 5 }, + { 7, 4 }, { 3, 2 }, { 4, 3 }, { 8, 6 }, { 11, 6 }, + { 18, 8 }, { 15, 8 }, { 30, 11 }, { 36, 13 }, { 34, 13 }, + { 29, 13 }, { 0, 13 }, { 21, 10 }, { 28, 10 }, { 23, 10 }, + { 22, 8 }, { 10, 6 }, { 6, 4 }, + /* avg_g3 - 18 entries */ + { 14, 4 }, { 11, 6 }, { 19, 7 }, { 9, 7 }, { 13, 5 }, + { 10, 6 }, { 20, 8 }, { 8, 8 }, { 6, 10 }, { 23, 11 }, + { 0, 11 }, { 21, 9 }, { 7, 8 }, { 12, 5 }, { 18, 4 }, + { 16, 2 }, { 15, 2 }, { 17, 2 }, + /* st_grid - 22 entries */ + { 4, 4 }, { 3, 4 }, { 8, 4 }, { 14, 8 }, { 7, 9 }, + { 9, 10 }, { 22, 10 }, { 12, 7 }, { 16, 9 }, { 11, 10 }, + { 13, 11 }, { 17, 13 }, { 15, 13 }, { 24, 13 }, { 0, 13 }, + { 18, 9 }, { 20, 10 }, { 2, 10 }, { 5, 7 }, { 10, 5 }, + { 1, 2 }, { 6, 1 }, + /* grid_2 - 20 entries */ + { 3, 2 }, { 2, 2 }, { 4, 3 }, { 5, 4 }, { 6, 5 }, + { 11, 11 }, { 13, 12 }, { 17, 12 }, { 19, 14 }, { 14, 14 }, + { 18, 13 }, { 15, 13 }, { 16, 14 }, { 0, 14 }, { 12, 11 }, + { 10, 9 }, { 9, 8 }, { 8, 7 }, { 7, 6 }, { 1, 2 }, + /* grid_3 - 13 entries */ + { 18, 3 }, { 15, 4 }, { 19, 5 }, { 14, 6 }, { 13, 8 }, + { 12, 10 }, { 11, 12 }, { 0, 12 }, { 22, 11 }, { 21, 9 }, + { 20, 7 }, { 16, 2 }, { 17, 1 }, + /* rsd - 9 entries */ + { 1, 3 }, { 5, 4 }, { 6, 5 }, { 7, 6 }, { 4, 6 }, + { 4, 3 }, { 0, 3 }, { 2, 2 }, { 3, 2 }, +}; + +VLC ff_dca_vlc_bit_allocation[5]; +VLC ff_dca_vlc_transition_mode[4]; +VLC ff_dca_vlc_scale_factor[5]; +VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; VLC ff_dca_vlc_tnl_grp[5]; VLC ff_dca_vlc_tnl_scf; @@ -1264,111 +788,59 @@ av_cold void ff_dca_init_vlcs(void) { - static VLCElem dca_table[30214]; - int i, j, k = 0; + static VLCElem dca_table[30218]; + const uint8_t (*src_table)[2] = ff_dca_vlc_src_tables; + unsigned offset = 0; -#define DCA_INIT_VLC(vlc, a, b, c, d) \ +#define DCA_INIT_VLC(vlc, nb_bits, nb_codes, entry_offset) \ do { \ - vlc.table = &dca_table[vlc_offs[k]]; \ - vlc.table_allocated = vlc_offs[k + 1] - vlc_offs[k]; \ - init_vlc(&vlc, a, b, c, 1, 1, d, 2, 2, INIT_VLC_USE_NEW_STATIC); \ - k++; \ + 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, \ + &src_table[0][0], 2, 1, entry_offset, \ + INIT_VLC_STATIC_OVERLONG, NULL); \ + offset += vlc.table_size; \ + src_table += nb_codes; \ } while (0) - ff_dca_vlc_bit_allocation.offset = 1; - ff_dca_vlc_bit_allocation.max_depth = 2; - for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, - bitalloc_12_bits[i], bitalloc_12_codes[i]); + for (unsigned i = 0; i < DCA_CODE_BOOKS; i++) { + for (unsigned j = 0; j < ff_dca_quant_index_group_size[i]; j++) + DCA_INIT_VLC(ff_dca_vlc_quant_index[i][j], bitalloc_maxbits[i][j], + ff_dca_bitalloc_sizes[i], ff_dca_bitalloc_offsets[i]); + } - ff_dca_vlc_scale_factor.offset = -64; - ff_dca_vlc_scale_factor.max_depth = 2; - for (i = 0; i < 5; i++) - DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, - scales_bits[i], scales_codes[i]); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_bit_allocation); i++) + DCA_INIT_VLC(ff_dca_vlc_bit_allocation[i], bitalloc_12_vlc_bits[i], 12, 1); - ff_dca_vlc_transition_mode.offset = 0; - ff_dca_vlc_transition_mode.max_depth = 1; - for (i = 0; i < 4; i++) - DCA_INIT_VLC(ff_dca_vlc_transition_mode.vlc[i], tmode_vlc_bits[i], 4, - tmode_bits[i], tmode_codes[i]); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_scale_factor); i++) + DCA_INIT_VLC(ff_dca_vlc_scale_factor[i], DCA_SCALES_VLC_BITS, 129, -64); - for (i = 0; i < DCA_CODE_BOOKS; i++) { - ff_dca_vlc_quant_index[i].offset = bitalloc_offsets[i]; - ff_dca_vlc_quant_index[i].max_depth = 1 + (i > 4); - for (j = 0; bitalloc_codes[i][j]; j++) - DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], - bitalloc_sizes[i], bitalloc_bits[i][j], bitalloc_codes[i][j]); - } + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_transition_mode); i++) + DCA_INIT_VLC(ff_dca_vlc_transition_mode[i], DCA_TMODE_VLC_BITS, 4, 0); -#define LBR_INIT_VLC(vlc, tab, nb_bits) \ +#define LBR_INIT_VLC(vlc, nb_bits, nb_codes, entry_offset) \ do { \ - vlc.table = &dca_table[vlc_offs[k]]; \ - vlc.table_allocated = vlc_offs[k + 1] - vlc_offs[k]; \ - ff_init_vlc_sparse(&vlc, nb_bits, FF_ARRAY_ELEMS(tab##_codes), \ - &tab##_bitvals[0], 2, 1, \ - tab##_codes, 2, 2, \ - &tab##_bitvals[1], 2, 1, \ - INIT_VLC_LE | INIT_VLC_USE_NEW_STATIC); \ - k++; \ + 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, \ + &src_table[0][0], 2, 1, entry_offset, \ + INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ + NULL); \ + offset += vlc.table_size; \ + src_table += nb_codes; \ } while (0) - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[0], tnl_grp_0, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[1], tnl_grp_1, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[2], tnl_grp_2, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[3], tnl_grp_3, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_grp[4], tnl_grp_4, 9); - LBR_INIT_VLC(ff_dca_vlc_tnl_scf, tnl_scf, 9); - LBR_INIT_VLC(ff_dca_vlc_damp, damp, 6); - LBR_INIT_VLC(ff_dca_vlc_dph, dph, 6); - LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, fst_rsd_amp, 9); - LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, rsd_apprx, 5); - LBR_INIT_VLC(ff_dca_vlc_rsd_amp, rsd_amp, 9); - LBR_INIT_VLC(ff_dca_vlc_avg_g3, avg_g3, 9); - LBR_INIT_VLC(ff_dca_vlc_st_grid, st_grid, 9); - LBR_INIT_VLC(ff_dca_vlc_grid_2, grid_2, 9); - LBR_INIT_VLC(ff_dca_vlc_grid_3, grid_3, 9); - LBR_INIT_VLC(ff_dca_vlc_rsd, rsd, 6); -} - -uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t table) -{ - uint8_t i, id; - uint32_t sum = 0; - for (i = 0; i < n; i++) { - id = values[i] - bitalloc_offsets[table]; - av_assert0(id < bitalloc_sizes[table]); - sum += bitalloc_bits[table][sel][id]; - } - return sum; -} - -void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t table) -{ - uint8_t i, id; - for (i = 0; i < n; i++) { - id = values[i] - bitalloc_offsets[table]; - av_assert0(id < bitalloc_sizes[table]); - put_bits(pb, bitalloc_bits[table][sel][id], bitalloc_codes[table][sel][id]); - } -} - -uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel) -{ - uint8_t i, id; - uint32_t sum = 0; - for (i = 0; i < n; i++) { - id = values[i] - 1; - sum += bitalloc_12_bits[sel][id]; - } - return sum; -} - -void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel) -{ - uint8_t i, id; - for (i = 0; i < n; i++) { - id = values[i] - 1; - put_bits(pb, bitalloc_12_bits[sel][id], bitalloc_12_codes[sel][id]); - } + for (unsigned i = 0; i < FF_ARRAY_ELEMS(ff_dca_vlc_tnl_grp); i++) + LBR_INIT_VLC(ff_dca_vlc_tnl_grp[i], DCA_TNL_GRP_VLC_BITS, tnl_grp_sizes[i], -1); + LBR_INIT_VLC(ff_dca_vlc_tnl_scf, DCA_TNL_SCF_VLC_BITS, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_damp, DCA_DAMP_VLC_BITS, 7, -1); + LBR_INIT_VLC(ff_dca_vlc_dph, DCA_DPH_VLC_BITS, 9, -1); + LBR_INIT_VLC(ff_dca_vlc_fst_rsd_amp, DCA_FST_RSD_VLC_BITS, 24, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_apprx, DCA_RSD_APPRX_VLC_BITS, 6, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd_amp, DCA_RSD_AMP_VLC_BITS, 33, -1); + LBR_INIT_VLC(ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 18, -1); + LBR_INIT_VLC(ff_dca_vlc_st_grid, DCA_ST_GRID_VLC_BITS, 22, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_2, DCA_GRID_VLC_BITS, 20, -1); + LBR_INIT_VLC(ff_dca_vlc_grid_3, DCA_GRID_VLC_BITS, 13, -1); + LBR_INIT_VLC(ff_dca_vlc_rsd, DCA_RSD_VLC_BITS, 9, 0); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dcahuff.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,40 +27,49 @@ #include "libavutil/attributes.h" -#include "put_bits.h" #include "vlc.h" #define DCA_CODE_BOOKS 10 #define DCA_BITALLOC_12_COUNT 5 +#define DCA_NUM_BITALLOC_CODES (1 * 3 + \ + 3 * (5 + 7 + 9 + 13) \ + + 7 * (17 + 25 + 33 + 65 + 129)) + +extern VLC ff_dca_vlc_bit_allocation[5]; +#define DCA_TMODE_VLC_BITS 3 +extern VLC ff_dca_vlc_transition_mode[4]; +#define DCA_SCALES_VLC_BITS 9 +extern VLC ff_dca_vlc_scale_factor[5]; +extern VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; -typedef struct DCAVLC { - int offset; ///< Code values offset - int max_depth; ///< Parameter for get_vlc2() - VLC vlc[7]; ///< Actual codes -} DCAVLC; - -extern DCAVLC ff_dca_vlc_bit_allocation; -extern DCAVLC ff_dca_vlc_transition_mode; -extern DCAVLC ff_dca_vlc_scale_factor; -extern DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]; - +#define DCA_TNL_GRP_VLC_BITS 9 extern VLC ff_dca_vlc_tnl_grp[5]; +#define DCA_TNL_SCF_VLC_BITS 9 extern VLC ff_dca_vlc_tnl_scf; +#define DCA_DAMP_VLC_BITS 6 extern VLC ff_dca_vlc_damp; +#define DCA_DPH_VLC_BITS 6 extern VLC ff_dca_vlc_dph; +#define DCA_FST_RSD_VLC_BITS 9 extern VLC ff_dca_vlc_fst_rsd_amp; +#define DCA_RSD_APPRX_VLC_BITS 5 extern VLC ff_dca_vlc_rsd_apprx; +#define DCA_RSD_AMP_VLC_BITS 9 extern VLC ff_dca_vlc_rsd_amp; +#define DCA_AVG_G3_VLC_BITS 9 extern VLC ff_dca_vlc_avg_g3; +#define DCA_ST_GRID_VLC_BITS 9 extern VLC ff_dca_vlc_st_grid; +#define DCA_GRID_VLC_BITS 9 extern VLC ff_dca_vlc_grid_2; extern VLC ff_dca_vlc_grid_3; +#define DCA_RSD_VLC_BITS 6 extern VLC ff_dca_vlc_rsd; +extern const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_vlc_src_tables[][2]; + av_cold void ff_dca_init_vlcs(void); -uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t abits); -void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t abits); -uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel); -void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel); #endif /* AVCODEC_DCAHUFF_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "dcahuff.h" #include "dca_syncwords.h" #include "bytestream.h" -#include "internal.h" +#include "decode.h" #define AMP_MAX 56 @@ -119,7 +119,17 @@ }; static float cos_tab[256]; -static float lpc_tab[16]; +static const float lpc_tab[16] = { + /* lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))) */ + -0.995734176295034521871191178905, -0.961825643172819070408796290732, + -0.895163291355062322067016499754, -0.798017227280239503332805112796, + -0.673695643646557211712691912426, -0.526432162877355800244607799141, + -0.361241666187152948744714596184, -0.183749517816570331574408839621, + 0.0, 0.207911690817759337101742284405, + 0.406736643075800207753985990341, 0.587785252292473129168705954639, + 0.743144825477394235014697048974, 0.866025403784438646763723170753, + 0.951056516295153572116439333379, 0.994521895368273336922691944981 +}; av_cold void ff_dca_lbr_init_tables(void) { @@ -127,9 +137,6 @@ for (i = 0; i < 256; i++) cos_tab[i] = cos(M_PI * i / 128); - - for (i = 0; i < 16; i++) - lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))); } static int parse_lfe_24(DCALbrDecoder *s) @@ -260,11 +267,12 @@ return AVERROR_INVALIDDATA; } -static inline int parse_vlc(GetBitContext *s, VLC *vlc, int max_depth) +static inline int parse_vlc(GetBitContext *s, const VLC *vlc, + int nb_bits, int max_depth) { - int v = get_vlc2(s, vlc->table, vlc->bits, max_depth); - if (v > 0) - return v - 1; + int v = get_vlc2(s, vlc->table, nb_bits, max_depth); + if (v >= 0) + return v; // Rare value return get_bits(s, get_bits(s, 3) + 1); } @@ -289,7 +297,7 @@ return AVERROR_INVALIDDATA; } - diff = parse_vlc(&s->gb, &ff_dca_vlc_tnl_grp[group], 2); + diff = parse_vlc(&s->gb, &ff_dca_vlc_tnl_grp[group], DCA_TNL_GRP_VLC_BITS, 2); if (diff >= FF_ARRAY_ELEMS(ff_dca_fst_amp)) { av_log(s->avctx, AV_LOG_ERROR, "Invalid tonal frequency diff\n"); return AVERROR_INVALIDDATA; @@ -307,7 +315,7 @@ // Main channel main_ch = get_bitsz(&s->gb, ch_nbits); - main_amp = parse_vlc(&s->gb, &ff_dca_vlc_tnl_scf, 2) + main_amp = parse_vlc(&s->gb, &ff_dca_vlc_tnl_scf, DCA_TNL_SCF_VLC_BITS, 2) + s->tonal_scf[ff_dca_freq_to_sb[freq >> (7 - group)]] + s->limited_range - 2; amp[main_ch] = main_amp < AMP_MAX ? main_amp : 0; @@ -318,8 +326,8 @@ if (ch == main_ch) continue; if (get_bits1(&s->gb)) { - amp[ch] = amp[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_damp, 1); - phs[ch] = phs[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_dph, 1); + amp[ch] = amp[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_damp, DCA_DAMP_VLC_BITS, 1); + phs[ch] = phs[main_ch] - parse_vlc(&s->gb, &ff_dca_vlc_dph, DCA_DPH_VLC_BITS, 1); } else { amp[ch] = 0; phs[ch] = 0; @@ -423,7 +431,7 @@ return 0; // Initial scale factor - prev = parse_vlc(&s->gb, &ff_dca_vlc_fst_rsd_amp, 2); + prev = parse_vlc(&s->gb, &ff_dca_vlc_fst_rsd_amp, DCA_FST_RSD_VLC_BITS, 2); for (sf = 0; sf < 7; sf += dist) { scf[sf] = prev; // Store previous value @@ -432,7 +440,7 @@ return 0; // Interpolation distance - dist = parse_vlc(&s->gb, &ff_dca_vlc_rsd_apprx, 1) + 1; + dist = parse_vlc(&s->gb, &ff_dca_vlc_rsd_apprx, DCA_RSD_APPRX_VLC_BITS, 1) + 1; if (dist > 7 - sf) { av_log(s->avctx, AV_LOG_ERROR, "Invalid scale factor distance\n"); return AVERROR_INVALIDDATA; @@ -442,7 +450,7 @@ return 0; // Final interpolation point - next = parse_vlc(&s->gb, &ff_dca_vlc_rsd_amp, 2); + next = parse_vlc(&s->gb, &ff_dca_vlc_rsd_amp, DCA_RSD_AMP_VLC_BITS, 2); if (next & 1) next = prev + ((next + 1) >> 1); @@ -486,7 +494,7 @@ static int parse_st_code(GetBitContext *s, int min_v) { - unsigned int v = parse_vlc(s, &ff_dca_vlc_st_grid, 2) + min_v; + unsigned int v = parse_vlc(s, &ff_dca_vlc_st_grid, DCA_ST_GRID_VLC_BITS, 2) + min_v; if (v & 1) v = 16 + (v >> 1); @@ -527,10 +535,10 @@ // Average values for third grid for (sb = 0; sb < s->nsubbands - 4; sb++) { - s->grid_3_avg[ch1][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch1][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; if (ch1 != ch2) { if (sb + 4 < s->min_mono_subband) - s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; else s->grid_3_avg[ch2][sb] = s->grid_3_avg[ch1][sb]; } @@ -585,7 +593,7 @@ if (sb + 4 >= s->min_mono_subband) { if (ensure_bits(&s->gb, 20)) return 0; - s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, 2) - 16; + s->grid_3_avg[ch2][sb] = parse_vlc(&s->gb, &ff_dca_vlc_avg_g3, DCA_AVG_G3_VLC_BITS, 2) - 16; } } @@ -606,7 +614,7 @@ for (i = 0; i < 8; i++) { if (ensure_bits(&s->gb, 20)) return; - s->grid_3_scf[ch][sb][i] = parse_vlc(&s->gb, &ff_dca_vlc_grid_3, 2) - 16; + s->grid_3_scf[ch][sb][i] = parse_vlc(&s->gb, &ff_dca_vlc_grid_3, DCA_GRID_VLC_BITS, 2) - 16; } // Flag scale factors for this subband parsed @@ -889,7 +897,7 @@ for (j = 0; j < 8; j++) { if (ensure_bits(&s->gb, 20)) break; - g2_scf[j] = parse_vlc(&s->gb, &ff_dca_vlc_grid_2, 2); + g2_scf[j] = parse_vlc(&s->gb, &ff_dca_vlc_grid_2, DCA_GRID_VLC_BITS, 2); } } else { memset(g2_scf, 0, 8); @@ -945,12 +953,14 @@ static int init_sample_rate(DCALbrDecoder *s) { double scale = (-1.0 / (1 << 17)) * sqrt(1 << (2 - s->limited_range)); + float scale_t = scale; int i, br_per_ch = s->bit_rate_scaled / s->nchannels_total; int ret; - ff_mdct_end(&s->imdct); + av_tx_uninit(&s->imdct); - ret = ff_mdct_init(&s->imdct, s->freq_range + 6, 1, scale); + ret = av_tx_init(&s->imdct, &s->imdct_fn, AV_TX_FLOAT_MDCT, 1, + 1 << (s->freq_range + 5), &scale_t, AV_TX_FULL_IMDCT); if (ret < 0) return ret; @@ -1706,7 +1716,7 @@ base_func_synth(s, ch, values[0], sf); - s->imdct.imdct_calc(&s->imdct, result[0], values[0]); + s->imdct_fn(s->imdct, result[0], values[0], sizeof(float)); // Long window and overlap-add s->fdsp->vector_fmul_add(output, result[0], s->window, @@ -1826,5 +1836,5 @@ s->ts_size = 0; av_freep(&s->fdsp); - ff_mdct_end(&s->imdct); + av_tx_uninit(&s->imdct); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_lbr.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,13 +23,13 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "get_bits.h" #include "dca.h" #include "dca_exss.h" #include "dcadsp.h" -#include "fft.h" #define DCA_LBR_CHANNELS 6 #define DCA_LBR_CHANNELS_TOTAL 32 @@ -119,7 +119,8 @@ DCALbrTone tones[DCA_LBR_TONES]; ///< Circular buffer of tones int ntones; ///< Circular buffer head position - FFTContext imdct; + AVTXContext *imdct; + av_tx_fn imdct_fn; AVFloatDSPContext *fdsp; DCADSPContext *dcadsp; } DCALbrDecoder; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_xll.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_xll.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_xll.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dca_xll.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "dcadata.h" #include "dcamath.h" #include "dca_syncwords.h" -#include "internal.h" +#include "decode.h" #include "unary.h" static int get_linear(GetBitContext *gb, int n) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dds.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dds.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dds.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dds.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,9 +34,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "texturedsp.h" -#include "thread.h" #define DDPF_FOURCC (1 << 2) #define DDPF_PALETTE (1 << 5) @@ -711,11 +710,10 @@ const FFCodec ff_dds_decoder = { .p.name = "dds", - .p.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"), + CODEC_LONG_NAME("DirectDraw Surface image decoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DDS, FF_CODEC_DECODE_CB(dds_decode), .priv_data_size = sizeof(DDSContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.c 2023-03-03 13:29:59.000000000 +0000 @@ -132,38 +132,16 @@ return 0; } -#define IS_EMPTY(pkt) (!(pkt)->data) - -static int copy_packet_props(AVPacket *dst, const AVPacket *src) -{ - int ret = av_packet_copy_props(dst, src); - if (ret < 0) - return ret; - - dst->size = src->size; // HACK: Needed for ff_decode_frame_props(). - dst->data = (void*)1; // HACK: Needed for IS_EMPTY(). - - return 0; -} - static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt) { - AVPacket tmp = { 0 }; int ret = 0; - if (IS_EMPTY(avci->last_pkt_props)) { - if (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) < 0) - return copy_packet_props(avci->last_pkt_props, pkt); + av_packet_unref(avci->last_pkt_props); + if (pkt) { + ret = av_packet_copy_props(avci->last_pkt_props, pkt); + if (!ret) + avci->last_pkt_props->opaque = (void *)(intptr_t)pkt->size; // Needed for ff_decode_frame_props(). } - - ret = copy_packet_props(&tmp, pkt); - if (ret < 0) - return ret; - - ret = av_fifo_write(avci->pkt_props, &tmp, 1); - if (ret < 0) - av_packet_unref(&tmp); - return ret; } @@ -359,7 +337,7 @@ side= av_packet_get_side_data(avci->last_pkt_props, AV_PKT_DATA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { - avci->skip_samples = AV_RL32(side) * avci->skip_samples_multiplier; + avci->skip_samples = AV_RL32(side); avci->skip_samples = FFMAX(0, avci->skip_samples); discard_padding = AV_RL32(side + 4); av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n", @@ -394,8 +372,8 @@ frame->pts += diff_ts; if(frame->pkt_dts!=AV_NOPTS_VALUE) frame->pkt_dts += diff_ts; - if (frame->pkt_duration >= diff_ts) - frame->pkt_duration -= diff_ts; + if (frame->duration >= diff_ts) + frame->duration -= diff_ts; } else { av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for skipped samples.\n"); } @@ -417,7 +395,7 @@ int64_t diff_ts = av_rescale_q(frame->nb_samples - discard_padding, (AVRational){1, avctx->sample_rate}, avctx->pkt_timebase); - frame->pkt_duration = diff_ts; + frame->duration = diff_ts; } else { av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for discarded samples.\n"); } @@ -449,18 +427,9 @@ if (!got_frame) av_frame_unref(frame); -#if FF_API_FLAG_TRUNCATED - if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED)) -#else if (ret >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO) -#endif ret = pkt->size; -#if FF_API_AVCTX_TIMEBASE - if (avctx->framerate.num > 0 && avctx->framerate.den > 0) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); -#endif - /* do not stop draining when actual_got_frame != 0 or ret < 0 */ /* got_frame == 0 but actual_got_frame != 0 when frame is discarded */ if (avci->draining && !actual_got_frame) { @@ -483,7 +452,6 @@ if (ret >= pkt->size || ret < 0) { av_packet_unref(pkt); - av_packet_unref(avci->last_pkt_props); } else { int consumed = ret; @@ -492,7 +460,8 @@ pkt->pts = AV_NOPTS_VALUE; pkt->dts = AV_NOPTS_VALUE; if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { - avci->last_pkt_props->size -= consumed; // See extract_packet_props() comment. + // See extract_packet_props() comment. + avci->last_pkt_props->opaque = (void *)((intptr_t)avci->last_pkt_props->opaque - consumed); avci->last_pkt_props->pts = AV_NOPTS_VALUE; avci->last_pkt_props->dts = AV_NOPTS_VALUE; } @@ -504,6 +473,54 @@ return ret < 0 ? ret : 0; } +#if CONFIG_LCMS2 +static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame) +{ + AVCodecInternal *avci = avctx->internal; + enum AVColorTransferCharacteristic trc; + AVColorPrimariesDesc coeffs; + enum AVColorPrimaries prim; + cmsHPROFILE profile; + AVFrameSideData *sd; + int ret; + if (!(avctx->flags2 & AV_CODEC_FLAG2_ICC_PROFILES)) + return 0; + + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_ICC_PROFILE); + if (!sd || !sd->size) + return 0; + + if (!avci->icc.avctx) { + ret = ff_icc_context_init(&avci->icc, avctx); + if (ret < 0) + return ret; + } + + profile = cmsOpenProfileFromMemTHR(avci->icc.ctx, sd->data, sd->size); + if (!profile) + return AVERROR_INVALIDDATA; + + ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); + if (!ret) + ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc); + cmsCloseProfile(profile); + if (ret < 0) + return ret; + + prim = av_csp_primaries_id_from_desc(&coeffs); + if (prim != AVCOL_PRI_UNSPECIFIED) + frame->color_primaries = prim; + if (trc != AVCOL_TRC_UNSPECIFIED) + frame->color_trc = trc; + return 0; +} +#else /* !CONFIG_LCMS2 */ +static int detect_colorspace(av_unused AVCodecContext *c, av_unused AVFrame *f) +{ + return 0; +} +#endif + static int decode_simple_receive_frame(AVCodecContext *avctx, AVFrame *frame) { int ret; @@ -524,24 +541,23 @@ { AVCodecInternal *avci = avctx->internal; const FFCodec *const codec = ffcodec(avctx->codec); - int ret; + int ret, ok; av_assert0(!frame->buf[0]); if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { ret = codec->cb.receive_frame(avctx, frame); - if (ret != AVERROR(EAGAIN)) - av_packet_unref(avci->last_pkt_props); } else ret = decode_simple_receive_frame(avctx, frame); if (ret == AVERROR_EOF) avci->draining_done = 1; - if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS) && - IS_EMPTY(avci->last_pkt_props)) { - // May fail if the FIFO is empty. - av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1); + /* preserve ret */ + ok = detect_colorspace(avctx, frame); + if (ok < 0) { + av_frame_unref(frame); + return ok; } if (!ret) { @@ -549,6 +565,12 @@ frame->pts, frame->pkt_dts); +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + frame->pkt_duration = frame->duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + /* the only case where decode data is not set should be decoders * that do not call ff_get_buffer() */ av_assert0((frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) || @@ -636,13 +658,38 @@ AV_FRAME_CROP_UNALIGNED : 0); } -int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) +// make sure frames returned to the caller are valid +static int frame_validate(AVCodecContext *avctx, AVFrame *frame) +{ + if (!frame->buf[0] || frame->format < 0) + goto fail; + + switch (avctx->codec_type) { + case AVMEDIA_TYPE_VIDEO: + if (frame->width <= 0 || frame->height <= 0) + goto fail; + break; + case AVMEDIA_TYPE_AUDIO: + if (!av_channel_layout_check(&frame->ch_layout) || + frame->sample_rate <= 0) + goto fail; + + break; + default: av_assert0(0); + } + + return 0; +fail: + av_log(avctx, AV_LOG_ERROR, "An invalid frame was output by a decoder. " + "This is a bug, please report it.\n"); + return AVERROR_BUG; +} + +int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame) { AVCodecInternal *avci = avctx->internal; int ret, changed; - av_frame_unref(frame); - if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec)) return AVERROR(EINVAL); @@ -654,19 +701,26 @@ return ret; } + ret = frame_validate(avctx, frame); + if (ret < 0) + goto fail; + if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { ret = apply_cropping(avctx, frame); - if (ret < 0) { - av_frame_unref(frame); - return ret; - } + if (ret < 0) + goto fail; } - avctx->frame_number++; + avctx->frame_num++; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_number = avctx->frame_num; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if (avctx->flags & AV_CODEC_FLAG_DROPCHANGED) { - if (avctx->frame_number == 1) { + if (avctx->frame_num == 1) { avci->initial_format = frame->format; switch(avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: @@ -676,22 +730,14 @@ case AVMEDIA_TYPE_AUDIO: avci->initial_sample_rate = frame->sample_rate ? frame->sample_rate : avctx->sample_rate; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - avci->initial_channels = frame->ch_layout.nb_channels; - avci->initial_channel_layout = frame->channel_layout; -FF_ENABLE_DEPRECATION_WARNINGS -#endif ret = av_channel_layout_copy(&avci->initial_ch_layout, &frame->ch_layout); - if (ret < 0) { - av_frame_unref(frame); - return ret; - } + if (ret < 0) + goto fail; break; } } - if (avctx->frame_number > 1) { + if (avctx->frame_num > 1) { changed = avci->initial_format != frame->format; switch(avctx->codec_type) { @@ -700,30 +746,27 @@ avci->initial_height != frame->height; break; case AVMEDIA_TYPE_AUDIO: -FF_DISABLE_DEPRECATION_WARNINGS changed |= avci->initial_sample_rate != frame->sample_rate || avci->initial_sample_rate != avctx->sample_rate || -#if FF_API_OLD_CHANNEL_LAYOUT - avci->initial_channels != frame->channels || - avci->initial_channel_layout != frame->channel_layout || -#endif av_channel_layout_compare(&avci->initial_ch_layout, &frame->ch_layout); -FF_ENABLE_DEPRECATION_WARNINGS break; } if (changed) { avci->changed_frames_dropped++; - av_log(avctx, AV_LOG_INFO, "dropped changed frame #%d pts %"PRId64 + av_log(avctx, AV_LOG_INFO, "dropped changed frame #%"PRId64" pts %"PRId64 " drop count: %d \n", - avctx->frame_number, frame->pts, + avctx->frame_num, frame->pts, avci->changed_frames_dropped); - av_frame_unref(frame); - return AVERROR_INPUT_CHANGED; + ret = AVERROR_INPUT_CHANGED; + goto fail; } } } return 0; +fail: + av_frame_unref(frame); + return ret; } static void get_subtitle_defaults(AVSubtitle *sub) @@ -733,8 +776,8 @@ } #define UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */ -static int recode_subtitle(AVCodecContext *avctx, AVPacket **outpkt, - AVPacket *inpkt, AVPacket *buf_pkt) +static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt, + const AVPacket *inpkt, AVPacket *buf_pkt) { #if CONFIG_ICONV iconv_t cd = (iconv_t)-1; @@ -814,8 +857,7 @@ } int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; @@ -835,7 +877,7 @@ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) { AVCodecInternal *avci = avctx->internal; - AVPacket *pkt; + const AVPacket *pkt; ret = recode_subtitle(avctx, &pkt, avpkt, avci->buffer_pkt); if (ret < 0) @@ -879,7 +921,12 @@ } if (*got_sub_ptr) - avctx->frame_number++; + avctx->frame_num++; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_number = avctx->frame_num; +FF_ENABLE_DEPRECATION_WARNINGS +#endif } return ret; @@ -1244,9 +1291,9 @@ return av_packet_unpack_dictionary(side_metadata, size, frame_md); } -int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) +int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx, + AVFrame *frame, const AVPacket *pkt) { - AVPacket *pkt = avctx->internal->last_pkt_props; static const struct { enum AVPacketSideDataType packet; enum AVFrameSideDataType frame; @@ -1264,34 +1311,57 @@ { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS }, }; - if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { - frame->pts = pkt->pts; - frame->pkt_pos = pkt->pos; - frame->pkt_duration = pkt->duration; - frame->pkt_size = pkt->size; - - for (int i = 0; i < FF_ARRAY_ELEMS(sd); i++) { - size_t size; - uint8_t *packet_sd = av_packet_get_side_data(pkt, sd[i].packet, &size); - if (packet_sd) { - AVFrameSideData *frame_sd = av_frame_new_side_data(frame, - sd[i].frame, - size); - if (!frame_sd) - return AVERROR(ENOMEM); + frame->pts = pkt->pts; + frame->pkt_pos = pkt->pos; + frame->duration = pkt->duration; + frame->pkt_size = pkt->size; + + for (int i = 0; i < FF_ARRAY_ELEMS(sd); i++) { + size_t size; + uint8_t *packet_sd = av_packet_get_side_data(pkt, sd[i].packet, &size); + if (packet_sd) { + AVFrameSideData *frame_sd = av_frame_new_side_data(frame, + sd[i].frame, + size); + if (!frame_sd) + return AVERROR(ENOMEM); - memcpy(frame_sd->data, packet_sd, size); - } + memcpy(frame_sd->data, packet_sd, size); } - add_metadata_from_side_data(pkt, frame); + } + add_metadata_from_side_data(pkt, frame); - if (pkt->flags & AV_PKT_FLAG_DISCARD) { - frame->flags |= AV_FRAME_FLAG_DISCARD; - } else { - frame->flags = (frame->flags & ~AV_FRAME_FLAG_DISCARD); - } + if (pkt->flags & AV_PKT_FLAG_DISCARD) { + frame->flags |= AV_FRAME_FLAG_DISCARD; + } else { + frame->flags = (frame->flags & ~AV_FRAME_FLAG_DISCARD); + } + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + int ret = av_buffer_replace(&frame->opaque_ref, pkt->opaque_ref); + if (ret < 0) + return ret; + frame->opaque = pkt->opaque; } + + return 0; +} + +int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) +{ + const AVPacket *pkt = avctx->internal->last_pkt_props; + + if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + int ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); + if (ret < 0) + return ret; + frame->pkt_size = (int)(intptr_t)pkt->opaque; + } +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS frame->reordered_opaque = avctx->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if (frame->color_primaries == AVCOL_PRI_UNSPECIFIED) frame->color_primaries = avctx->color_primaries; @@ -1535,24 +1605,6 @@ * free the already allocated subtitle_header before overwriting it */ av_freep(&avctx->subtitle_header); -#if FF_API_THREAD_SAFE_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS - if ((avctx->thread_type & FF_THREAD_FRAME) && - avctx->get_buffer2 != avcodec_default_get_buffer2 && - !avctx->thread_safe_callbacks) { - av_log(avctx, AV_LOG_WARNING, "Requested frame threading with a " - "custom get_buffer2() implementation which is not marked as " - "thread safe. This is not supported anymore, make your " - "callback thread-safe.\n"); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - - if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && avctx->ch_layout.nb_channels == 0 && - !(avctx->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)) { - av_log(avctx, AV_LOG_ERROR, "Decoder requires channel count but channels not set\n"); - return AVERROR(EINVAL); - } if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) { av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", avctx->codec->max_lowres); @@ -1609,9 +1661,7 @@ avci->in_pkt = av_packet_alloc(); avci->last_pkt_props = av_packet_alloc(); - avci->pkt_props = av_fifo_alloc2(1, sizeof(*avci->last_pkt_props), - AV_FIFO_FLAG_AUTO_GROW); - if (!avci->in_pkt || !avci->last_pkt_props || !avci->pkt_props) + if (!avci->in_pkt || !avci->last_pkt_props) return AVERROR(ENOMEM); ret = decode_bsfs_init(avctx); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/decode.h 2023-03-03 13:29:59.000000000 +0000 @@ -54,6 +54,11 @@ } FrameDecodeData; /** + * avcodec_receive_frame() implementation for decoders. + */ +int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame); + +/** * Called by decoders to get the next packet for decoding. * * @param pkt An empty packet to be filled with data. @@ -65,6 +70,12 @@ int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt); /** + * Set various frame properties from the provided packet. + */ +int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx, + AVFrame *frame, const AVPacket *pkt); + +/** * Set various frame properties from the codec context / packet data. */ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame); @@ -94,4 +105,49 @@ */ int ff_decode_preinit(AVCodecContext *avctx); +/** + * Check that the provided frame dimensions are valid and set them on the codec + * context. + */ +int ff_set_dimensions(AVCodecContext *s, int width, int height); + +/** + * Check that the provided sample aspect ratio is valid and set it on the codec + * context. + */ +int ff_set_sar(AVCodecContext *avctx, AVRational sar); + +/** + * Select the (possibly hardware accelerated) pixel format. + * This is a wrapper around AVCodecContext.get_format() and should be used + * instead of calling get_format() directly. + * + * The list of pixel formats must contain at least one valid entry, and is + * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, + * the last entry in the list must be the most accurate software format. + * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt + * must be set before calling this function. + */ +int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); + +/** + * Get a buffer for a frame. This is a wrapper around + * AVCodecContext.get_buffer() and should be used instead calling get_buffer() + * directly. + */ +int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); + +#define FF_REGET_BUFFER_FLAG_READONLY 1 ///< the returned buffer does not need to be writable +/** + * Identical in function to ff_get_buffer(), except it reuses the existing buffer + * if available. + */ +int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); + +/** + * Add or update AV_FRAME_DATA_MATRIXENCODING side data. + */ +int ff_side_data_update_matrix_encoding(AVFrame *frame, + enum AVMatrixEncoding matrix_encoding); + #endif /* AVCODEC_DECODE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/defs.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/defs.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/defs.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/defs.h 2023-03-03 13:29:59.000000000 +0000 @@ -40,6 +40,28 @@ #define AV_INPUT_BUFFER_PADDING_SIZE 64 /** + * Verify checksums embedded in the bitstream (could be of either encoded or + * decoded data, depending on the format) and print an error message on mismatch. + * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the + * decoder/demuxer returning an error. + */ +#define AV_EF_CRCCHECK (1<<0) +#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations +#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length +#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection + +#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue +#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors +#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors +#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error + +#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. +#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. +#define FF_COMPLIANCE_NORMAL 0 +#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions +#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + +/** * @ingroup lavc_decoding */ enum AVDiscard{ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfa.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/avassert.h" #include "libavutil/imgutils.h" @@ -423,7 +423,7 @@ const FFCodec ff_dfa_decoder = { .p.name = "dfa", - .p.long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"), + CODEC_LONG_NAME("Chronomaster DFA"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DFA, .priv_data_size = sizeof(DfaContext), @@ -431,5 +431,4 @@ .close = dfa_decode_end, FF_CODEC_DECODE_CB(dfa_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "avcodec.h" #include "codec_id.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct { int fq, q, s, lt; @@ -85,11 +85,6 @@ { DFPWMState *state = ctx->priv_data; - if (ctx->ch_layout.nb_channels <= 0) { - av_log(ctx, AV_LOG_ERROR, "Invalid number of channels\n"); - return AVERROR(EINVAL); - } - state->fq = 0; state->q = 0; state->s = 0; @@ -127,12 +122,11 @@ const FFCodec ff_dfpwm_decoder = { .p.name = "dfpwm", - .p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), + CODEC_LONG_NAME("DFPWM1a audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_dec_init, FF_CODEC_DECODE_CB(dfpwm_dec_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dfpwmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,7 +39,7 @@ // Licensed in the public domain // note, len denotes how many compressed bytes there are (uncompressed bytes / 8). -static void au_compress(DFPWMState *state, int len, uint8_t *outbuf, uint8_t *inbuf) +static void au_compress(DFPWMState *state, int len, uint8_t *outbuf, const uint8_t *inbuf) { unsigned d = 0; for (int i = 0; i < len; i++) { @@ -109,13 +109,13 @@ const FFCodec ff_dfpwm_encoder = { .p.name = "dfpwm", - .p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), + CODEC_LONG_NAME("DFPWM1a audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_enc_init, FF_CODEC_ENCODE_CB(dfpwm_enc_frame), .p.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE}, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,13 +31,11 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" -#include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "golomb.h" #include "dirac_arith.h" #include "dirac_vlc.h" -#include "mpeg12data.h" #include "mpegpicture.h" #include "mpegvideoencdsp.h" #include "dirac_dwt.h" @@ -79,6 +77,7 @@ uint8_t *hpel[3][4]; uint8_t *hpel_base[3][4]; int reference; + unsigned picture_number; } DiracFrame; typedef struct { @@ -254,13 +253,13 @@ return (int)((x+1U)*21845 + 10922) >> 16; } -static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum) +static DiracFrame *remove_frame(DiracFrame *framelist[], unsigned picnum) { DiracFrame *remove_pic = NULL; int i, remove_idx = -1; for (i = 0; framelist[i]; i++) - if (framelist[i]->avframe->display_picture_number == picnum) { + if (framelist[i]->picture_number == picnum) { remove_pic = framelist[i]; remove_idx = i; } @@ -486,7 +485,7 @@ * Decode the coeffs in the rectangle defined by left, right, top, bottom * [DIRAC_STD] 13.4.3.2 Codeblock unpacking loop. codeblock() */ -static inline int codeblock(DiracContext *s, SubBand *b, +static inline int codeblock(const DiracContext *s, SubBand *b, GetBitContext *gb, DiracArith *c, int left, int right, int top, int bottom, int blockcnt_one, int is_arith) @@ -596,7 +595,8 @@ * Dirac Specification -> * 13.4.2 Non-skipped subbands. subband_coeffs() */ -static av_always_inline int decode_subband_internal(DiracContext *s, SubBand *b, int is_arith) +static av_always_inline int decode_subband_internal(const DiracContext *s, + SubBand *b, int is_arith) { int cb_x, cb_y, left, right, top, bottom; DiracArith c; @@ -640,13 +640,13 @@ static int decode_subband_arith(AVCodecContext *avctx, void *b) { - DiracContext *s = avctx->priv_data; + const DiracContext *s = avctx->priv_data; return decode_subband_internal(s, b, 1); } static int decode_subband_golomb(AVCodecContext *avctx, void *arg) { - DiracContext *s = avctx->priv_data; + const DiracContext *s = avctx->priv_data; SubBand **b = arg; return decode_subband_internal(s, *b, 0); } @@ -721,9 +721,9 @@ return; \ } \ -static void decode_subband(DiracContext *s, GetBitContext *gb, int quant, +static void decode_subband(const DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, - SubBand *b1, SubBand *b2) + const SubBand *b1, const SubBand *b2) { int left = b1->width * slice_x / s->num_x; int right = b1->width *(slice_x+1) / s->num_x; @@ -775,7 +775,7 @@ */ static int decode_lowdelay_slice(AVCodecContext *avctx, void *arg) { - DiracContext *s = avctx->priv_data; + const DiracContext *s = avctx->priv_data; DiracSlice *slice = arg; GetBitContext *gb = &slice->gb; enum dirac_subband orientation; @@ -819,13 +819,13 @@ int tot; } SliceCoeffs; -static int subband_coeffs(DiracContext *s, int x, int y, int p, +static int subband_coeffs(const DiracContext *s, int x, int y, int p, SliceCoeffs c[MAX_DWT_LEVELS]) { int level, coef = 0; for (level = 0; level < s->wavelet_depth; level++) { SliceCoeffs *o = &c[level]; - SubBand *b = &s->plane[p].band[level][3]; /* orientation doens't matter */ + const SubBand *b = &s->plane[p].band[level][3]; /* orientation doens't matter */ o->top = b->height * y / s->num_y; o->left = b->width * x / s->num_x; o->tot_h = ((b->width * (x + 1)) / s->num_x) - o->left; @@ -840,7 +840,7 @@ * VC-2 Specification -> * 13.5.3 hq_slice(sx,sy) */ -static int decode_hq_slice(DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf) +static int decode_hq_slice(const DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf) { int i, level, orientation, quant_idx; int qfactor[MAX_DWT_LEVELS][4], qoffset[MAX_DWT_LEVELS][4]; @@ -917,7 +917,7 @@ static int decode_hq_slice_row(AVCodecContext *avctx, void *arg, int jobnr, int threadnr) { int i; - DiracContext *s = avctx->priv_data; + const DiracContext *s = avctx->priv_data; DiracSlice *slices = ((DiracSlice *)arg) + s->num_x*jobnr; uint8_t *thread_buf = &s->thread_buf[s->thread_buf_size*threadnr]; for (i = 0; i < s->num_x; i++) @@ -2003,7 +2003,7 @@ GetBitContext *gb = &s->gb; /* [DIRAC_STD] 11.1.1 Picture Header. picture_header() PICTURE_NUM */ - picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, 32); + picnum = s->current_picture->picture_number = get_bits_long(gb, 32); av_log(s->avctx,AV_LOG_DEBUG,"PICTURE_NUM: %d\n",picnum); @@ -2022,9 +2022,9 @@ /* Jordi: this is needed if the referenced picture hasn't yet arrived */ for (j = 0; j < MAX_REFERENCE_FRAMES && refdist; j++) if (s->ref_frames[j] - && FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum) < refdist) { + && FFABS(s->ref_frames[j]->picture_number - refnum) < refdist) { s->ref_pics[i] = s->ref_frames[j]; - refdist = FFABS(s->ref_frames[j]->avframe->display_picture_number - refnum); + refdist = FFABS(s->ref_frames[j]->picture_number - refnum); } if (!s->ref_pics[i] || refdist) @@ -2063,7 +2063,7 @@ /* if reference array is full, remove the oldest as per the spec */ while (add_frame(s->ref_frames, MAX_REFERENCE_FRAMES, s->current_picture)) { av_log(s->avctx, AV_LOG_ERROR, "Reference frame overflow\n"); - remove_frame(s->ref_frames, s->ref_frames[0]->avframe->display_picture_number)->reference &= DELAYED_PIC_REF; + remove_frame(s->ref_frames, s->ref_frames[0]->picture_number)->reference &= DELAYED_PIC_REF; } } @@ -2091,7 +2091,7 @@ /* find frame with lowest picture number */ for (i = 1; s->delay_frames[i]; i++) - if (s->delay_frames[i]->avframe->display_picture_number < out->avframe->display_picture_number) { + if (s->delay_frames[i]->picture_number < out->picture_number) { out = s->delay_frames[i]; out_idx = i; } @@ -2103,6 +2103,11 @@ out->reference ^= DELAYED_PIC_REF; if((ret = av_frame_ref(picture, out->avframe)) < 0) return ret; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + picture->display_picture_number = out->picture_number; +FF_ENABLE_DEPRECATION_WARNINGS +#endif *got_frame = 1; } @@ -2319,19 +2324,19 @@ if (!s->current_picture) return buf_size; - if (s->current_picture->avframe->display_picture_number > s->frame_number) { + if (s->current_picture->picture_number > s->frame_number) { DiracFrame *delayed_frame = remove_frame(s->delay_frames, s->frame_number); s->current_picture->reference |= DELAYED_PIC_REF; if (add_frame(s->delay_frames, MAX_DELAY, s->current_picture)) { - int min_num = s->delay_frames[0]->avframe->display_picture_number; + unsigned min_num = s->delay_frames[0]->picture_number; /* Too many delayed frames, so we display the frame with the lowest pts */ av_log(avctx, AV_LOG_ERROR, "Delay frame overflow\n"); for (i = 1; s->delay_frames[i]; i++) - if (s->delay_frames[i]->avframe->display_picture_number < min_num) - min_num = s->delay_frames[i]->avframe->display_picture_number; + if (s->delay_frames[i]->picture_number < min_num) + min_num = s->delay_frames[i]->picture_number; delayed_frame = remove_frame(s->delay_frames, min_num); add_frame(s->delay_frames, MAX_DELAY, s->current_picture); @@ -2341,24 +2346,33 @@ delayed_frame->reference ^= DELAYED_PIC_REF; if((ret = av_frame_ref(picture, delayed_frame->avframe)) < 0) return ret; + s->frame_number = delayed_frame->picture_number + 1LL; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + picture->display_picture_number = delayed_frame->picture_number; +FF_ENABLE_DEPRECATION_WARNINGS +#endif *got_frame = 1; } - } else if (s->current_picture->avframe->display_picture_number == s->frame_number) { + } else if (s->current_picture->picture_number == s->frame_number) { /* The right frame at the right time :-) */ if((ret = av_frame_ref(picture, s->current_picture->avframe)) < 0) return ret; + s->frame_number = s->current_picture->picture_number + 1LL; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + picture->display_picture_number = s->current_picture->picture_number; +FF_ENABLE_DEPRECATION_WARNINGS +#endif *got_frame = 1; } - if (*got_frame) - s->frame_number = picture->display_picture_number + 1LL; - return buf_idx; } const FFCodec ff_dirac_decoder = { .p.name = "dirac", - .p.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"), + CODEC_LONG_NAME("BBC Dirac VC-2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DIRAC, .priv_data_size = sizeof(DiracContext), @@ -2366,6 +2380,5 @@ .close = dirac_decode_end, FF_CODEC_DECODE_CB(dirac_decode_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = dirac_decode_flush, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/diracdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -139,7 +139,7 @@ static void put_signed_rect_clamped_8bit_c(uint8_t *dst, int dst_stride, const uint8_t *_src, int src_stride, int width, int height) { int x, y; - int16_t *src = (int16_t *)_src; + const int16_t *src = (const int16_t *)_src; for (y = 0; y < height; y++) { for (x = 0; x < width; x+=4) { dst[x ] = av_clip_uint8(src[x ] + 128); @@ -158,7 +158,7 @@ { \ int x, y; \ uint16_t *dst = (uint16_t *)_dst; \ - int32_t *src = (int32_t *)_src; \ + const int32_t *src = (const int32_t *)_src; \ for (y = 0; y < height; y++) { \ for (x = 0; x < width; x+=4) { \ dst[x ] = av_clip_uintp2(src[x ] + (1U << (PX - 1)), PX); \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.c 2023-03-03 13:29:59.000000000 +0000 @@ -45,11 +45,11 @@ d->decomposition_count = decomposition_count; if (bit_depth == 8) - ret = ff_spatial_idwt_init_8bit(d, type); + ret = spatial_idwt_init_8bit(d, type); else if (bit_depth == 10) - ret = ff_spatial_idwt_init_10bit(d, type); + ret = spatial_idwt_init_10bit(d, type); else if (bit_depth == 12) - ret = ff_spatial_idwt_init_12bit(d, type); + ret = spatial_idwt_init_12bit(d, type); else av_log(NULL, AV_LOG_WARNING, "Unsupported bit depth = %i\n", bit_depth); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt.h 2023-03-03 13:29:59.000000000 +0000 @@ -61,11 +61,14 @@ int support; void (*spatial_compose)(struct DWTContext *cs, int level, int width, int height, int stride); - void (*vertical_compose_l0)(void); - void (*vertical_compose_h0)(void); - void (*vertical_compose_l1)(void); - void (*vertical_compose_h1)(void); - void (*vertical_compose)(void); ///< one set of lowpass and highpass combined + union { + vertical_compose_3tap tap3; + vertical_compose_5tap tap5; + vertical_compose_9tap tap9; + } vertical_compose_l0, vertical_compose_h0; + vertical_compose_3tap vertical_compose_l1; + vertical_compose_3tap vertical_compose_h1; + vertical_compose_2tap vertical_compose; ///< one set of lowpass and highpass combined void (*horizontal_compose)(uint8_t *b, uint8_t *tmp, int width); DWTCompose cs[MAX_DECOMPOSITIONS]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dirac_dwt_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -338,8 +338,8 @@ static void RENAME(spatial_compose_dd97i_dy)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0; - vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0; + vertical_compose_3tap vertical_compose_l0 = d->vertical_compose_l0.tap3; + vertical_compose_5tap vertical_compose_h0 = d->vertical_compose_h0.tap5; DWTCompose *cs = d->cs + level; int i, y = cs->y; @@ -362,8 +362,8 @@ static void RENAME(spatial_compose_dirac53i_dy)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0; - vertical_compose_3tap vertical_compose_h0 = (void*)d->vertical_compose_h0; + vertical_compose_3tap vertical_compose_l0 = d->vertical_compose_l0.tap3; + vertical_compose_3tap vertical_compose_h0 = d->vertical_compose_h0.tap3; DWTCompose *cs = d->cs + level; int y= cs->y; @@ -384,8 +384,8 @@ static void RENAME(spatial_compose_dd137i_dy)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_5tap vertical_compose_l0 = (void*)d->vertical_compose_l0; - vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0; + vertical_compose_5tap vertical_compose_l0 = d->vertical_compose_l0.tap5; + vertical_compose_5tap vertical_compose_h0 = d->vertical_compose_h0.tap5; DWTCompose *cs = d->cs + level; int i, y = cs->y; @@ -409,7 +409,7 @@ // haar makes the assumption that height is even (always true for dirac) static void RENAME(spatial_compose_haari_dy)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_2tap vertical_compose = (void*)d->vertical_compose; + vertical_compose_2tap vertical_compose = d->vertical_compose; int y = d->cs[level].y; uint8_t *b0 = d->buffer + (y-1)*stride; uint8_t *b1 = d->buffer + (y )*stride; @@ -425,8 +425,8 @@ // Fortunately, this filter isn't used in practice. static void RENAME(spatial_compose_fidelity)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_9tap vertical_compose_l0 = (void*)d->vertical_compose_l0; - vertical_compose_9tap vertical_compose_h0 = (void*)d->vertical_compose_h0; + vertical_compose_9tap vertical_compose_l0 = d->vertical_compose_l0.tap9; + vertical_compose_9tap vertical_compose_h0 = d->vertical_compose_h0.tap9; int i, y; uint8_t *b[8]; @@ -450,10 +450,10 @@ static void RENAME(spatial_compose_daub97i_dy)(DWTContext *d, int level, int width, int height, int stride) { - vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0; - vertical_compose_3tap vertical_compose_h0 = (void*)d->vertical_compose_h0; - vertical_compose_3tap vertical_compose_l1 = (void*)d->vertical_compose_l1; - vertical_compose_3tap vertical_compose_h1 = (void*)d->vertical_compose_h1; + vertical_compose_3tap vertical_compose_l0 = d->vertical_compose_l0.tap3; + vertical_compose_3tap vertical_compose_h0 = d->vertical_compose_h0.tap3; + vertical_compose_3tap vertical_compose_l1 = d->vertical_compose_l1; + vertical_compose_3tap vertical_compose_h1 = d->vertical_compose_h1; DWTCompose *cs = d->cs + level; int i, y = cs->y; @@ -516,7 +516,7 @@ cs->y = -5; } -static int RENAME(ff_spatial_idwt_init)(DWTContext *d, enum dwt_type type) +static int RENAME(spatial_idwt_init)(DWTContext *d, enum dwt_type type) { int level; @@ -552,29 +552,29 @@ switch (type) { case DWT_DIRAC_DD9_7: d->spatial_compose = RENAME(spatial_compose_dd97i_dy); - d->vertical_compose_l0 = (void*)RENAME(vertical_compose53iL0); - d->vertical_compose_h0 = (void*)RENAME(vertical_compose_dd97iH0); + d->vertical_compose_l0.tap3 = RENAME(vertical_compose53iL0); + d->vertical_compose_h0.tap5 = RENAME(vertical_compose_dd97iH0); d->horizontal_compose = RENAME(horizontal_compose_dd97i); d->support = 7; break; case DWT_DIRAC_LEGALL5_3: d->spatial_compose = RENAME(spatial_compose_dirac53i_dy); - d->vertical_compose_l0 = (void*)RENAME(vertical_compose53iL0); - d->vertical_compose_h0 = (void*)RENAME(vertical_compose_dirac53iH0); + d->vertical_compose_l0.tap3 = RENAME(vertical_compose53iL0); + d->vertical_compose_h0.tap3 = RENAME(vertical_compose_dirac53iH0); d->horizontal_compose = RENAME(horizontal_compose_dirac53i); d->support = 3; break; case DWT_DIRAC_DD13_7: d->spatial_compose = RENAME(spatial_compose_dd137i_dy); - d->vertical_compose_l0 = (void*)RENAME(vertical_compose_dd137iL0); - d->vertical_compose_h0 = (void*)RENAME(vertical_compose_dd97iH0); + d->vertical_compose_l0.tap5 = RENAME(vertical_compose_dd137iL0); + d->vertical_compose_h0.tap5 = RENAME(vertical_compose_dd97iH0); d->horizontal_compose = RENAME(horizontal_compose_dd137i); d->support = 7; break; case DWT_DIRAC_HAAR0: case DWT_DIRAC_HAAR1: d->spatial_compose = RENAME(spatial_compose_haari_dy); - d->vertical_compose = (void*)RENAME(vertical_compose_haar); + d->vertical_compose = RENAME(vertical_compose_haar); if (type == DWT_DIRAC_HAAR0) d->horizontal_compose = RENAME(horizontal_compose_haar0i); else @@ -583,17 +583,17 @@ break; case DWT_DIRAC_FIDELITY: d->spatial_compose = RENAME(spatial_compose_fidelity); - d->vertical_compose_l0 = (void*)RENAME(vertical_compose_fidelityiL0); - d->vertical_compose_h0 = (void*)RENAME(vertical_compose_fidelityiH0); + d->vertical_compose_l0.tap9 = RENAME(vertical_compose_fidelityiL0); + d->vertical_compose_h0.tap9 = RENAME(vertical_compose_fidelityiH0); d->horizontal_compose = RENAME(horizontal_compose_fidelityi); d->support = 0; // not really used break; case DWT_DIRAC_DAUB9_7: d->spatial_compose = RENAME(spatial_compose_daub97i_dy); - d->vertical_compose_l0 = (void*)RENAME(vertical_compose_daub97iL0); - d->vertical_compose_h0 = (void*)RENAME(vertical_compose_daub97iH0); - d->vertical_compose_l1 = (void*)RENAME(vertical_compose_daub97iL1); - d->vertical_compose_h1 = (void*)RENAME(vertical_compose_daub97iH1); + d->vertical_compose_l0.tap3 = RENAME(vertical_compose_daub97iL0); + d->vertical_compose_h0.tap3 = RENAME(vertical_compose_daub97iH0); + d->vertical_compose_l1 = RENAME(vertical_compose_daub97iL1); + d->vertical_compose_h1 = RENAME(vertical_compose_daub97iH1); d->horizontal_compose = RENAME(horizontal_compose_daub97i); d->support = 5; break; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,17 +24,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" +#include "libavutil/pixdesc.h" #include "avcodec.h" #include "blockdsp.h" #include "codec_internal.h" +#include "decode.h" #define UNCHECKED_BITSTREAM_READER 1 #include "get_bits.h" #include "dnxhddata.h" #include "idctdsp.h" -#include "internal.h" #include "profiles.h" #include "thread.h" @@ -65,7 +65,7 @@ int cur_field; ///< current interlaced field VLC ac_vlc, dc_vlc, run_vlc; IDCTDSPContext idsp; - ScanTable scantable; + uint8_t permutated_scantable[64]; const CIDEntry *cid_table; int bit_depth; // 8, 10, 12 or 0 if not initialized at all. int is_444; @@ -273,10 +273,10 @@ ctx->avctx->bits_per_raw_sample = ctx->bit_depth = bitdepth; if (ctx->bit_depth != old_bit_depth) { - ff_blockdsp_init(&ctx->bdsp, ctx->avctx); + ff_blockdsp_init(&ctx->bdsp); ff_idctdsp_init(&ctx->idsp, ctx->avctx); - ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable, - ff_zigzag_direct); + ff_permute_scantable(ctx->permutated_scantable, ff_zigzag_direct, + ctx->idsp.idct_permutation); } // make sure profile size constraints are respected @@ -436,7 +436,7 @@ break; } - j = ctx->scantable.permutated[i]; + j = ctx->permutated_scantable[i]; level *= scale[i]; level += scale[i] >> 1; if (level_bias < 32 || weight_matrix[i] != level_bias) @@ -726,7 +726,7 @@ const FFCodec ff_dnxhd_decoder = { .p.name = "dnxhd", - .p.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), + CODEC_LONG_NAME("VC3/DNxHD"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DNXHD, .priv_data_size = sizeof(DNXHDContext), @@ -736,5 +736,4 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -419,7 +419,7 @@ avctx->bits_per_raw_sample = ctx->bit_depth; - ff_blockdsp_init(&ctx->bdsp, avctx); + ff_blockdsp_init(&ctx->bdsp); ff_fdctdsp_init(&ctx->m.fdsp, avctx); ff_mpv_idct_init(&ctx->m); ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx); @@ -944,7 +944,7 @@ ctx = ctx->thread[threadnr]; if (ctx->bit_depth == 8) { - uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize); + const uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize); for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x, pix += 16) { unsigned mb = mb_y * ctx->m.mb_width + mb_x; int sum; @@ -973,8 +973,8 @@ } else { // 10-bit const int linesize = ctx->m.linesize >> 1; for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x) { - uint16_t *pix = (uint16_t *)ctx->thread[0]->src[0] + - ((mb_y << 4) * linesize) + (mb_x << 4); + const uint16_t *pix = (const uint16_t *)ctx->thread[0]->src[0] + + ((mb_y << 4) * linesize) + (mb_x << 4); unsigned mb = mb_y * ctx->m.mb_width + mb_x; int sum = 0; int sqsum = 0; @@ -1355,11 +1355,11 @@ const FFCodec ff_dnxhd_encoder = { .p.name = "dnxhd", - .p.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), + CODEC_LONG_NAME("VC3/DNxHD"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DNXHD, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | - AV_CODEC_CAP_SLICE_THREADS, + AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(DNXHDEncContext), .init = dnxhd_encode_init, FF_CODEC_ENCODE_CB(dnxhd_encode_picture), @@ -1374,5 +1374,5 @@ .p.priv_class = &dnxhd_class, .defaults = dnxhd_defaults, .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dnxhdenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -86,7 +86,7 @@ uint16_t (*qmatrix_c16)[2][64]; unsigned frame_bits; - uint8_t *src[3]; + const uint8_t *src[3]; uint32_t *orig_vlc_codes; uint8_t *orig_vlc_bits; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,13 @@ #include "libavutil/mem.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" +#include "libavutil/tx.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "dolby_e.h" #include "kbdwin.h" -#include "fft.h" #define MAX_SEGMENTS 2 @@ -85,7 +85,8 @@ DECLARE_ALIGNED(32, float, history)[MAX_CHANNELS][256]; - FFTContext imdct[3]; + AVTXContext *imdct[2][3]; + av_tx_fn imdct_fn[2][3]; AVFloatDSPContext *fdsp; } DBEDecodeContext; @@ -989,23 +990,23 @@ static void imdct_calc(DBEDecodeContext *s1, DBEGroup *g, float *result, float *values) { - FFTContext *imdct = &s1->imdct[g->imdct_idx]; + AVTXContext *imdct = s1->imdct[g->imdct_phs == 1][g->imdct_idx]; + av_tx_fn imdct_fn = s1->imdct_fn[g->imdct_phs == 1][g->imdct_idx]; int n = 1 << imdct_bits_tab[g->imdct_idx]; int n2 = n >> 1; - int i; switch (g->imdct_phs) { case 0: - imdct->imdct_half(imdct, result, values); - for (i = 0; i < n2; i++) + imdct_fn(imdct, result, values, sizeof(float)); + for (int i = 0; i < n2; i++) result[n2 + i] = result[n2 - i - 1]; break; case 1: - imdct->imdct_calc(imdct, result, values); + imdct_fn(imdct, result, values, sizeof(float)); break; case 2: - imdct->imdct_half(imdct, result + n2, values); - for (i = 0; i < n2; i++) + imdct_fn(imdct, result + n2, values, sizeof(float)); + for (int i = 0; i < n2; i++) result[i] = -result[n - i - 1]; break; default: @@ -1152,10 +1153,11 @@ static av_cold int dolby_e_close(AVCodecContext *avctx) { DBEDecodeContext *s = avctx->priv_data; - int i; - for (i = 0; i < 3; i++) - ff_mdct_end(&s->imdct[i]); + for (int i = 0; i < 3; i++) { + av_tx_uninit(&s->imdct[0][i]); + av_tx_uninit(&s->imdct[1][i]); + } av_freep(&s->fdsp); return 0; @@ -1252,14 +1254,20 @@ { static AVOnce init_once = AV_ONCE_INIT; DBEDecodeContext *s = avctx->priv_data; - int i; + float scale = 2.0f; + int ret; if (ff_thread_once(&init_once, init_tables)) return AVERROR_UNKNOWN; - for (i = 0; i < 3; i++) - if (ff_mdct_init(&s->imdct[i], imdct_bits_tab[i], 1, 2.0) < 0) - return AVERROR(ENOMEM); + for (int i = 0; i < 3; i++) { + if ((ret = av_tx_init(&s->imdct[0][i], &s->imdct_fn[0][i], AV_TX_FLOAT_MDCT, + 1, 1 << imdct_bits_tab[i] - 1, &scale, 0)) < 0) + return ret; + if ((ret = av_tx_init(&s->imdct[1][i], &s->imdct_fn[1][i], AV_TX_FLOAT_MDCT, + 1, 1 << imdct_bits_tab[i] - 1, &scale, AV_TX_FULL_IMDCT)) < 0) + return ret; + } if (!(s->fdsp = avpriv_float_dsp_alloc(0))) return AVERROR(ENOMEM); @@ -1299,7 +1307,7 @@ const FFCodec ff_dolby_e_decoder = { .p.name = "dolby_e", - .p.long_name = NULL_IF_CONFIG_SMALL("Dolby E"), + CODEC_LONG_NAME("Dolby E"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DOLBY_E, .priv_data_size = sizeof(DBEDecodeContext), @@ -1310,5 +1318,5 @@ .flush = dolby_e_flush, .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_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dolby_e_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,8 +21,6 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "dolby_e.h" -#include "get_bits.h" -#include "put_bits.h" typedef struct DBEParseContext { DBEContext dectx; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpcm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpcm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpcm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpcm.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,16 +37,16 @@ * the fourcc 'Axan' in the 'auds' chunk of the AVI header. */ -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" typedef struct DPCMContext { int16_t array[256]; - int sample[2]; ///< previous sample (for SOL_DPCM) + int sample[2]; ///< previous sample (for SOL_DPCM and WADY_DPCM) + int scale; ///< scale for WADY_DPCM const int8_t *sol_table; ///< delta table for SOL_DPCM } DPCMContext; @@ -127,6 +127,24 @@ 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000 }; +static const int16_t wady_table[128] = { + 0, 2, 4, 6, 8, 10, 12, 15, + 18, 21, 24, 28, 32, 36, 40, 44, + 49, 54, 59, 64, 70, 76, 82, 88, + 95, 102, 109, 116, 124, 132, 140, 148, + 160, 170, 180, 190, 200, 210, 220, 230, + 240, 255, 270, 285, 300, 320, 340, 360, + 380, 400, 425, 450, 475, 500, 525, 550, + 580, 610, 650, 700, 750, 800, 900, 1000, + -0, -2, -4, -6, -8, -10, -12, -15, + -18, -21, -24, -28, -32, -36, -40, -44, + -49, -54, -59, -64, -70, -76, -82, -88, + -95, -102,-109,-116,-124,-132,-140,-148, + -160,-170,-180,-190,-200,-210,-220,-230, + -240,-255,-270,-285,-300,-320,-340,-360, + -380,-400,-425,-450,-475,-500,-525,-550, + -580,-610,-650,-700,-750,-800,-900,-1000, +}; static av_cold int dpcm_decode_init(AVCodecContext *avctx) { @@ -140,7 +158,7 @@ s->sample[0] = s->sample[1] = 0; - switch(avctx->codec->id) { + switch (avctx->codec->id) { case AV_CODEC_ID_ROQ_DPCM: /* initialize square table */ @@ -176,6 +194,13 @@ } break; + case AV_CODEC_ID_CBD2_DPCM: + for (i = -128; i < 128; i++) { + int16_t cube = (i * i * i) / 64; + s->array[i+128] = cube; + } + break; + case AV_CODEC_ID_GREMLIN_DPCM: { int delta = 0; int code = 64; @@ -194,6 +219,10 @@ } break; + case AV_CODEC_ID_WADY_DPCM: + s->scale = (avctx->extradata && avctx->extradata_size > 0) ? avctx->extradata[0] : 1; + break; + default: break; } @@ -240,8 +269,10 @@ else out = buf_size; break; + case AV_CODEC_ID_WADY_DPCM: case AV_CODEC_ID_DERF_DPCM: case AV_CODEC_ID_GREMLIN_DPCM: + case AV_CODEC_ID_CBD2_DPCM: case AV_CODEC_ID_SDX2_DPCM: out = buf_size; break; @@ -363,6 +394,7 @@ } break; + case AV_CODEC_ID_CBD2_DPCM: case AV_CODEC_ID_SDX2_DPCM: while (output_samples < samples_end) { int8_t n = bytestream2_get_byteu(&gb); @@ -402,6 +434,22 @@ } } break; + + case AV_CODEC_ID_WADY_DPCM: { + int idx = 0; + + while (output_samples < samples_end) { + const uint8_t n = bytestream2_get_byteu(&gb); + + if (n & 0x80) + s->sample[idx] = sign_extend((n & 0x7f) << 9, 16); + else + s->sample[idx] += s->scale * wady_table[n & 0x7f]; + *output_samples++ = av_clip_int16(s->sample[idx]); + idx ^= stereo; + } + } + break; } *got_frame_ptr = 1; @@ -409,19 +457,27 @@ return avpkt->size; } +static void dpcm_flush(AVCodecContext *avctx) +{ + DPCMContext *s = avctx->priv_data; + + s->sample[0] = s->sample[1] = 0; +} + #define DPCM_DECODER(id_, name_, long_name_) \ const FFCodec ff_ ## name_ ## _decoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = id_, \ .p.capabilities = AV_CODEC_CAP_DR1, \ .priv_data_size = sizeof(DPCMContext), \ .init = dpcm_decode_init, \ + .flush = dpcm_flush, \ FF_CODEC_DECODE_CB(dpcm_decode_frame), \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } +DPCM_DECODER(AV_CODEC_ID_CBD2_DPCM, cbd2_dpcm, "DPCM Cuberoot-Delta-Exact"); DPCM_DECODER(AV_CODEC_ID_DERF_DPCM, derf_dpcm, "DPCM Xilam DERF"); DPCM_DECODER(AV_CODEC_ID_GREMLIN_DPCM, gremlin_dpcm, "DPCM Gremlin"); DPCM_DECODER(AV_CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "DPCM Interplay"); @@ -429,3 +485,4 @@ DPCM_DECODER(AV_CODEC_ID_SDX2_DPCM, sdx2_dpcm, "DPCM Squareroot-Delta-Exact"); DPCM_DECODER(AV_CODEC_ID_SOL_DPCM, sol_dpcm, "DPCM Sol"); DPCM_DECODER(AV_CODEC_ID_XAN_DPCM, xan_dpcm, "DPCM Xan"); +DPCM_DECODER(AV_CODEC_ID_WADY_DPCM, wady_dpcm, "DPCM Marble WADY"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpx.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,10 +24,9 @@ #include "libavutil/intfloat.h" #include "libavutil/imgutils.h" #include "libavutil/timecode.h" -#include "bytestream.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" enum DPX_TRC { DPX_TRC_USER_DEFINED = 0, @@ -762,7 +761,7 @@ const FFCodec ff_dpx_decoder = { .p.name = "dpx", - .p.long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), + CODEC_LONG_NAME("DPX (Digital Picture Exchange) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DPX, FF_CODEC_DECODE_CB(decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dpxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -276,7 +276,7 @@ const FFCodec ff_dpx_encoder = { .p.name = "dpx", - .p.long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), + CODEC_LONG_NAME("DPX (Digital Picture Exchange) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DPX, .p.capabilities = AV_CODEC_CAP_DR1, @@ -292,5 +292,4 @@ AV_PIX_FMT_GBRP10LE, AV_PIX_FMT_GBRP10BE, AV_PIX_FMT_GBRP12LE, AV_PIX_FMT_GBRP12BE, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "libavcodec/internal.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "dsd.h" #define DSD_SILENCE 0x69 @@ -117,7 +118,7 @@ #define DSD_DECODER(id_, name_, long_name_) \ const FFCodec ff_ ## name_ ## _decoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = AV_CODEC_ID_##id_, \ .init = decode_init, \ @@ -125,7 +126,6 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ AV_SAMPLE_FMT_NONE }, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; DSD_DECODER(DSD_LSBF, dsd_lsbf, "DSD (Direct Stream Digital), least significant bit first") diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,11 +25,11 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/intreadwrite.h" #include "avcodec.h" -#include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" typedef struct CinAudioContext { @@ -123,12 +123,11 @@ const FFCodec ff_dsicinaudio_decoder = { .p.name = "dsicinaudio", - .p.long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN audio"), + CODEC_LONG_NAME("Delphine Software International CIN audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DSICINAUDIO, .priv_data_size = sizeof(CinAudioContext), .init = cinaudio_decode_init, FF_CODEC_DECODE_CB(cinaudio_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dsicinvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef enum CinVideoBitmapIndex { CIN_CUR_BMP = 0, /* current */ @@ -323,13 +323,13 @@ const FFCodec ff_dsicinvideo_decoder = { .p.name = "dsicinvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN video"), + CODEC_LONG_NAME("Delphine Software International CIN video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DSICINVIDEO, .priv_data_size = sizeof(CinVideoContext), .init = cinvideo_decode_init, .close = cinvideo_decode_end, FF_CODEC_DECODE_CB(cinvideo_decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.capabilities = AV_CODEC_CAP_DR1, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dss_sp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dss_sp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dss_sp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dss_sp.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,11 @@ #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "libavutil/mem_internal.h" -#include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define SUBFRAMES 4 #define PULSE_MAX 8 @@ -774,12 +773,11 @@ const FFCodec ff_dss_sp_decoder = { .p.name = "dss_sp", - .p.long_name = NULL_IF_CONFIG_SMALL("Digital Speech Standard - Standard Play mode (DSS SP)"), + CODEC_LONG_NAME("Digital Speech Standard - Standard Play mode (DSS SP)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DSS_SP, .priv_data_size = sizeof(DssSpContext), .init = dss_sp_decode_init, FF_CODEC_DECODE_CB(dss_sp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dstdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dstdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dstdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dstdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,11 +29,10 @@ #include "libavutil/mem_internal.h" #include "libavutil/reverse.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "avcodec.h" #include "golomb.h" -#include "mathops.h" #include "dsd.h" #define DST_MAX_CHANNELS 6 @@ -386,7 +385,7 @@ const FFCodec ff_dst_decoder = { .p.name = "dst", - .p.long_name = NULL_IF_CONFIG_SMALL("DST (Digital Stream Transfer)"), + CODEC_LONG_NAME("DST (Digital Stream Transfer)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DST, .priv_data_size = sizeof(DSTContext), @@ -395,5 +394,4 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dts2pts_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dts2pts_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dts2pts_bsf.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dts2pts_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,540 @@ +/* + * Copyright (c) 2022 James Almer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Derive PTS by reordering DTS from supported streams + */ + +#include "libavutil/avassert.h" +#include "libavutil/fifo.h" +#include "libavutil/tree.h" + +#include "bsf.h" +#include "bsf_internal.h" +#include "cbs.h" +#include "cbs_h264.h" +#include "h264_parse.h" +#include "h264_ps.h" + +typedef struct DTS2PTSNode { + int64_t dts; + int64_t duration; + int poc; + int gop; +} DTS2PTSNode; + +typedef struct DTS2PTSFrame { + AVPacket *pkt; + int poc; + int poc_diff; + int gop; +} DTS2PTSFrame; + +typedef struct DTS2PTSH264Context { + H264POCContext poc; + SPS sps; + int poc_diff; + int last_poc; + int highest_poc; + int picture_structure; +} DTS2PTSH264Context; + +typedef struct DTS2PTSContext { + struct AVTreeNode *root; + AVFifo *fifo; + + // Codec specific function pointers and constants + int (*init)(AVBSFContext *ctx); + int (*filter)(AVBSFContext *ctx); + void (*flush)(AVBSFContext *ctx); + size_t fifo_size; + + CodedBitstreamContext *cbc; + CodedBitstreamFragment au; + + union { + DTS2PTSH264Context h264; + } u; + + int nb_frame; + int gop; + int eof; +} DTS2PTSContext; + +// AVTreeNode callbacks +static int cmp_insert(const void *key, const void *node) +{ + int ret = ((const DTS2PTSNode *)key)->poc - ((const DTS2PTSNode *)node)->poc; + if (!ret) + ret = ((const DTS2PTSNode *)key)->gop - ((const DTS2PTSNode *)node)->gop; + return ret; +} + +static int cmp_find(const void *key, const void *node) +{ + const DTS2PTSFrame * key1 = key; + const DTS2PTSNode *node1 = node; + int ret = FFDIFFSIGN(key1->poc, node1->poc); + if (!ret) + ret = key1->gop - node1->gop; + return ret; +} + +static int dec_poc(void *opaque, void *elem) +{ + DTS2PTSNode *node = elem; + int dec = *(int *)opaque; + node->poc -= dec; + return 0; +} + +static int free_node(void *opaque, void *elem) +{ + DTS2PTSNode *node = elem; + av_free(node); + return 0; +} + +// Shared functions +static int alloc_and_insert_node(AVBSFContext *ctx, int64_t ts, int64_t duration, + int poc, int poc_diff, int gop) +{ + DTS2PTSContext *s = ctx->priv_data; + for (int i = 0; i < poc_diff; i++) { + struct AVTreeNode *node = av_tree_node_alloc(); + DTS2PTSNode *poc_node, *ret; + if (!node) + return AVERROR(ENOMEM); + poc_node = av_malloc(sizeof(*poc_node)); + if (!poc_node) { + av_free(node); + return AVERROR(ENOMEM); + } + if (i && ts != AV_NOPTS_VALUE) + ts += duration / poc_diff; + *poc_node = (DTS2PTSNode) { ts, duration, poc++, gop }; + ret = av_tree_insert(&s->root, poc_node, cmp_insert, &node); + if (ret && ret != poc_node) { + *ret = *poc_node; + av_free(poc_node); + av_free(node); + } + } + return 0; +} + +// H.264 +static const CodedBitstreamUnitType h264_decompose_unit_types[] = { + H264_NAL_SPS, + H264_NAL_PPS, + H264_NAL_IDR_SLICE, + H264_NAL_SLICE, +}; + +static int h264_init(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSH264Context *h264 = &s->u.h264; + + s->cbc->decompose_unit_types = h264_decompose_unit_types; + s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(h264_decompose_unit_types); + + s->nb_frame = -(ctx->par_in->video_delay << 1); + h264->last_poc = h264->highest_poc = INT_MIN; + + return 0; +} + +static int get_mmco_reset(const H264RawSliceHeader *header) +{ + if (header->nal_unit_header.nal_ref_idc == 0 || + !header->adaptive_ref_pic_marking_mode_flag) + return 0; + + for (int i = 0; i < H264_MAX_MMCO_COUNT; i++) { + if (header->mmco[i].memory_management_control_operation == 0) + return 0; + else if (header->mmco[i].memory_management_control_operation == 5) + return 1; + } + + return 0; +} + +static int h264_queue_frame(AVBSFContext *ctx, AVPacket *pkt, int poc, int *queued) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSH264Context *h264 = &s->u.h264; + DTS2PTSFrame frame; + int poc_diff, ret; + + poc_diff = (h264->picture_structure == 3) + 1; + if (h264->sps.frame_mbs_only_flag && h264->poc_diff) + poc_diff = FFMIN(poc_diff, h264->poc_diff); + if (poc < 0) { + av_tree_enumerate(s->root, &poc_diff, NULL, dec_poc); + s->nb_frame -= poc_diff; + } + // Check if there was a POC reset (Like an IDR slice) + if (s->nb_frame > h264->highest_poc) { + s->nb_frame = 0; + s->gop = (s->gop + 1) % s->fifo_size; + h264->highest_poc = h264->last_poc; + } + + ret = alloc_and_insert_node(ctx, pkt->dts, pkt->duration, s->nb_frame, poc_diff, s->gop); + if (ret < 0) + return ret; + av_log(ctx, AV_LOG_DEBUG, "Queueing frame with POC %d, GOP %d, dts %"PRId64"\n", + poc, s->gop, pkt->dts); + s->nb_frame += poc_diff; + + // Add frame to output FIFO only once + if (*queued) + return 0; + + frame = (DTS2PTSFrame) { pkt, poc, poc_diff, s->gop }; + ret = av_fifo_write(s->fifo, &frame, 1); + av_assert2(ret >= 0); + *queued = 1; + + return 0; +} + +static int h264_filter(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSH264Context *h264 = &s->u.h264; + CodedBitstreamFragment *au = &s->au; + AVPacket *in; + int output_picture_number = INT_MIN; + int field_poc[2]; + int queued = 0, ret; + + ret = ff_bsf_get_packet(ctx, &in); + if (ret < 0) + return ret; + + ret = ff_cbs_read_packet(s->cbc, au, in); + if (ret < 0) { + av_log(ctx, AV_LOG_WARNING, "Failed to parse access unit.\n"); + goto fail; + } + + for (int i = 0; i < au->nb_units; i++) { + CodedBitstreamUnit *unit = &au->units[i]; + + switch (unit->type) { + case H264_NAL_IDR_SLICE: + h264->poc.prev_frame_num = 0; + h264->poc.prev_frame_num_offset = 0; + h264->poc.prev_poc_msb = + h264->poc.prev_poc_lsb = 0; + // fall-through + case H264_NAL_SLICE: { + const H264RawSlice *slice = unit->content; + const H264RawSliceHeader *header = &slice->header; + const CodedBitstreamH264Context *cbs_h264 = s->cbc->priv_data; + const H264RawSPS *sps = cbs_h264->active_sps; + int got_reset; + + if (!sps) { + av_log(ctx, AV_LOG_ERROR, "No active SPS for a slice\n"); + goto fail; + } + // Initialize the SPS struct with the fields ff_h264_init_poc() cares about + h264->sps.frame_mbs_only_flag = sps->frame_mbs_only_flag; + h264->sps.log2_max_frame_num = sps->log2_max_frame_num_minus4 + 4; + h264->sps.poc_type = sps->pic_order_cnt_type; + h264->sps.log2_max_poc_lsb = sps->log2_max_pic_order_cnt_lsb_minus4 + 4; + h264->sps.offset_for_non_ref_pic = sps->offset_for_non_ref_pic; + h264->sps.offset_for_top_to_bottom_field = sps->offset_for_top_to_bottom_field; + h264->sps.poc_cycle_length = sps->num_ref_frames_in_pic_order_cnt_cycle; + for (int i = 0; i < h264->sps.poc_cycle_length; i++) + h264->sps.offset_for_ref_frame[i] = sps->offset_for_ref_frame[i]; + + h264->picture_structure = sps->frame_mbs_only_flag ? 3 : + (header->field_pic_flag ? + header->field_pic_flag + header->bottom_field_flag : 3); + + h264->poc.frame_num = header->frame_num; + h264->poc.poc_lsb = header->pic_order_cnt_lsb; + h264->poc.delta_poc_bottom = header->delta_pic_order_cnt_bottom; + h264->poc.delta_poc[0] = header->delta_pic_order_cnt[0]; + h264->poc.delta_poc[1] = header->delta_pic_order_cnt[1]; + + field_poc[0] = field_poc[1] = INT_MAX; + ret = ff_h264_init_poc(field_poc, &output_picture_number, &h264->sps, + &h264->poc, h264->picture_structure, + header->nal_unit_header.nal_ref_idc); + if (ret < 0) { + av_log(ctx, AV_LOG_ERROR, "ff_h264_init_poc() failure\n"); + goto fail; + } + + got_reset = get_mmco_reset(header); + h264->poc.prev_frame_num = got_reset ? 0 : h264->poc.frame_num; + h264->poc.prev_frame_num_offset = got_reset ? 0 : h264->poc.frame_num_offset; + if (header->nal_unit_header.nal_ref_idc != 0) { + h264->poc.prev_poc_msb = got_reset ? 0 : h264->poc.poc_msb; + if (got_reset) + h264->poc.prev_poc_lsb = h264->picture_structure == 2 ? 0 : field_poc[0]; + else + h264->poc.prev_poc_lsb = h264->poc.poc_lsb; + } + + if (output_picture_number != h264->last_poc) { + if (h264->last_poc != INT_MIN) { + int64_t diff = FFABS(h264->last_poc - (int64_t)output_picture_number); + + if ((output_picture_number < 0) && !h264->last_poc) + h264->poc_diff = 0; + else if (FFABS((int64_t)output_picture_number) < h264->poc_diff) { + diff = FFABS(output_picture_number); + h264->poc_diff = 0; + } + if ((!h264->poc_diff || (h264->poc_diff > diff)) && diff <= INT_MAX) { + h264->poc_diff = diff; + if (h264->poc_diff == 1 && h264->sps.frame_mbs_only_flag) { + av_tree_enumerate(s->root, &h264->poc_diff, NULL, dec_poc); + s->nb_frame -= 2; + } + } + } + h264->last_poc = output_picture_number; + h264->highest_poc = FFMAX(h264->highest_poc, output_picture_number); + + ret = h264_queue_frame(ctx, in, output_picture_number, &queued); + if (ret < 0) + goto fail; + } + break; + } + default: + break; + } + } + + if (output_picture_number == INT_MIN) { + av_log(ctx, AV_LOG_ERROR, "No slices in access unit\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + ret = 0; +fail: + ff_cbs_fragment_reset(au); + if (!queued) + av_packet_free(&in); + + return ret; +} + +static void h264_flush(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSH264Context *h264 = &s->u.h264; + + memset(&h264->sps, 0, sizeof(h264->sps)); + memset(&h264->poc, 0, sizeof(h264->poc)); + s->nb_frame = -(ctx->par_in->video_delay << 1); + h264->last_poc = h264->highest_poc = INT_MIN; +} + +// Core functions +static const struct { + enum AVCodecID id; + int (*init)(AVBSFContext *ctx); + int (*filter)(AVBSFContext *ctx); + void (*flush)(AVBSFContext *ctx); + size_t fifo_size; +} func_tab[] = { + { AV_CODEC_ID_H264, h264_init, h264_filter, h264_flush, H264_MAX_DPB_FRAMES * 2 * 2 }, +}; + +static int dts2pts_init(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + CodedBitstreamFragment *au = &s->au; + int i, ret; + + for (i = 0; i < FF_ARRAY_ELEMS(func_tab); i++) { + if (func_tab[i].id == ctx->par_in->codec_id) { + s->init = func_tab[i].init; + s->filter = func_tab[i].filter; + s->flush = func_tab[i].flush; + s->fifo_size = func_tab[i].fifo_size; + break; + } + } + if (i == FF_ARRAY_ELEMS(func_tab)) + return AVERROR_BUG; + av_assert0(s->filter && s->fifo_size); + + s->fifo = av_fifo_alloc2(s->fifo_size, sizeof(DTS2PTSFrame), 0); + if (!s->fifo) + return AVERROR(ENOMEM); + + ret = ff_cbs_init(&s->cbc, ctx->par_in->codec_id, ctx); + if (ret < 0) + return ret; + + if (s->init) { + ret = s->init(ctx); + if (ret < 0) + return ret; + } + + if (!ctx->par_in->extradata_size) + return 0; + + ret = ff_cbs_read_extradata(s->cbc, au, ctx->par_in); + if (ret < 0) + av_log(ctx, AV_LOG_WARNING, "Failed to parse extradata.\n"); + + ff_cbs_fragment_reset(au); + + return 0; +} + +static int dts2pts_filter(AVBSFContext *ctx, AVPacket *out) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSNode *poc_node = NULL, *next[2] = { NULL, NULL }; + DTS2PTSFrame frame; + int ret; + + // Fill up the FIFO and POC tree + while (!s->eof && av_fifo_can_write(s->fifo)) { + ret = s->filter(ctx); + if (ret < 0) { + if (ret != AVERROR_EOF) + return ret; + s->eof = 1; + } + } + + if (!av_fifo_can_read(s->fifo)) + return AVERROR_EOF; + + // Fetch a packet from the FIFO + ret = av_fifo_read(s->fifo, &frame, 1); + av_assert2(ret >= 0); + av_packet_move_ref(out, frame.pkt); + av_packet_free(&frame.pkt); + + // Search the timestamp for the requested POC and set PTS + poc_node = av_tree_find(s->root, &frame, cmp_find, (void **)next); + if (!poc_node) { + poc_node = next[1]; + if (!poc_node || poc_node->poc != frame.poc) + poc_node = next[0]; + } + if (poc_node && poc_node->poc == frame.poc) { + out->pts = poc_node->dts; + if (!s->eof) { + // Remove the found entry from the tree + DTS2PTSFrame dup = (DTS2PTSFrame) { NULL, frame.poc + 1, frame.poc_diff, frame.gop }; + for (; dup.poc_diff > 0; dup.poc++, dup.poc_diff--) { + struct AVTreeNode *node = NULL; + if (!poc_node || poc_node->dts != out->pts) + continue; + av_tree_insert(&s->root, poc_node, cmp_insert, &node); + av_free(poc_node); + av_free(node); + poc_node = av_tree_find(s->root, &dup, cmp_find, NULL); + } + } + } else if (s->eof && frame.poc > INT_MIN) { + DTS2PTSFrame dup = (DTS2PTSFrame) { NULL, frame.poc - 1, frame.poc_diff, frame.gop }; + poc_node = av_tree_find(s->root, &dup, cmp_find, NULL); + if (poc_node && poc_node->poc == dup.poc) { + out->pts = poc_node->dts; + if (out->pts != AV_NOPTS_VALUE) + out->pts += poc_node->duration; + ret = alloc_and_insert_node(ctx, out->pts, out->duration, + frame.poc, frame.poc_diff, frame.gop); + if (ret < 0) { + av_packet_unref(out); + return ret; + } + if (!ret) + av_log(ctx, AV_LOG_DEBUG, "Queueing frame for POC %d, GOP %d, dts %"PRId64", " + "generated from POC %d, GOP %d, dts %"PRId64", duration %"PRId64"\n", + frame.poc, frame.gop, out->pts, + poc_node->poc, poc_node->gop, poc_node->dts, poc_node->duration); + } else + av_log(ctx, AV_LOG_WARNING, "No timestamp for POC %d in tree\n", frame.poc); + } else + av_log(ctx, AV_LOG_WARNING, "No timestamp for POC %d in tree\n", frame.poc); + av_log(ctx, AV_LOG_DEBUG, "Returning frame for POC %d, GOP %d, dts %"PRId64", pts %"PRId64"\n", + frame.poc, frame.gop, out->dts, out->pts); + + return 0; +} + +static void dts2pts_flush(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + DTS2PTSFrame frame; + + if (s->flush) + s->flush(ctx); + s->eof = 0; + s->gop = 0; + + while (s->fifo && av_fifo_read(s->fifo, &frame, 1) >= 0) + av_packet_free(&frame.pkt); + + av_tree_enumerate(s->root, NULL, NULL, free_node); + av_tree_destroy(s->root); + s->root = NULL; + + ff_cbs_fragment_reset(&s->au); + if (s->cbc) + ff_cbs_flush(s->cbc); +} + +static void dts2pts_close(AVBSFContext *ctx) +{ + DTS2PTSContext *s = ctx->priv_data; + + dts2pts_flush(ctx); + + av_fifo_freep2(&s->fifo); + ff_cbs_fragment_free(&s->au); + ff_cbs_close(&s->cbc); +} + +static const enum AVCodecID dts2pts_codec_ids[] = { + AV_CODEC_ID_H264, + AV_CODEC_ID_NONE, +}; + +const FFBitStreamFilter ff_dts2pts_bsf = { + .p.name = "dts2pts", + .p.codec_ids = dts2pts_codec_ids, + .priv_data_size = sizeof(DTS2PTSContext), + .init = dts2pts_init, + .flush = dts2pts_flush, + .close = dts2pts_close, + .filter = dts2pts_filter, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvaudiodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvaudiodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvaudiodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvaudiodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "dvaudio.h" typedef struct DVAudioContext { @@ -120,12 +120,11 @@ const FFCodec ff_dvaudio_decoder = { .p.name = "dvaudio", - .p.long_name = NULL_IF_CONFIG_SMALL("Ulead DV Audio"), + CODEC_LONG_NAME("Ulead DV Audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DVAUDIO, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(DVAudioContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "get_bits.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/colorspace.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" @@ -1571,7 +1571,7 @@ const FFCodec ff_dvbsub_decoder = { .p.name = "dvbsub", - .p.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), + CODEC_LONG_NAME("DVB subtitles"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVB_SUBTITLE, .priv_data_size = sizeof(DVBSubContext), @@ -1579,5 +1579,4 @@ .close = dvbsub_close_decoder, FF_CODEC_DECODE_SUB_CB(dvbsub_decode), .p.priv_class = &dvbsubdec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvbsubenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -508,7 +508,7 @@ const FFCodec ff_dvbsub_encoder = { .p.name = "dvbsub", - .p.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), + CODEC_LONG_NAME("DVB subtitles"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVB_SUBTITLE, .priv_data_size = sizeof(DVBSubtitleContext), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,8 +38,12 @@ * DV codec. */ -#include "avcodec.h" -#include "dv.h" +#include + +#include "libavutil/pixfmt.h" + +#include "dv_internal.h" +#include "dv_profile.h" static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, int seq, int slot, uint16_t *tbl) @@ -162,7 +166,7 @@ } } -int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d) +int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d) { int j, i, c, s, p; @@ -174,8 +178,8 @@ p += !(j % 3); if (!(DV_PROFILE_IS_1080i50(d) && c != 0 && s == 11) && !(DV_PROFILE_IS_720p50(d) && s > 9)) { - dv_calc_mb_coordinates(d, c, s, j, &ctx->work_chunks[i].mb_coordinates[0]); - ctx->work_chunks[i++].buf_offset = p; + dv_calc_mb_coordinates(d, c, s, j, &work_chunks[i].mb_coordinates[0]); + work_chunks[i++].buf_offset = p; } p += 5; } @@ -184,13 +188,3 @@ return 0; } - -av_cold int ff_dvvideo_init(AVCodecContext *avctx) -{ - DVVideoContext *s = avctx->priv_data; - - s->avctx = avctx; - avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; - - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.c 2023-03-03 13:29:59.000000000 +0000 @@ -74,63 +74,8 @@ * between (run, level) and vlc is not 1-1. So you have to watch out for that * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82. */ -const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = { - 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016, - 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a, - 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2, - 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, - 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2, - 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea, - 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2, - 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1, - 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf, - 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7, - 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf, - 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87, - 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f, - 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97, - 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f, - 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7, - 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf, - 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7, - 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x1fbe, 0x1fbf, - 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07, - 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f, - 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17, - 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f, - 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27, - 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f, - 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37, - 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f, - 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47, - 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f, - 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57, - 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f, - 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67, - 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f, - 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77, - 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f, - 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87, - 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f, - 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97, - 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f, - 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7, - 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf, - 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7, - 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf, - 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7, - 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf, - 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7, - 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf, - 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7, - 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef, - 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, - 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff, - 0x0006, -}; - const uint8_t ff_dv_vlc_len[NB_DV_VLC] = { - 2, 3, 4, 4, 4, 5, 5, 5, + 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -181,11 +126,10 @@ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 4, }; const uint8_t ff_dv_vlc_run[NB_DV_VLC] = { - 0, 0, 1, 0, 0, 2, 1, 0, + 0, 0, 127, 1, 0, 0, 2, 1, 0, 0, 3, 4, 0, 0, 5, 6, 2, 1, 1, 0, 0, 0, 7, 8, 9, 10, 3, 4, 2, 1, 1, 1, 0, @@ -236,11 +180,10 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 127, }; const uint8_t ff_dv_vlc_level[NB_DV_VLC] = { - 1, 2, 1, 3, 4, 1, 2, 5, + 1, 2, 0, 1, 3, 4, 1, 2, 5, 6, 1, 1, 7, 8, 1, 1, 2, 3, 4, 9, 10, 11, 1, 1, 1, 1, 2, 2, 3, 5, 6, 7, 12, @@ -291,5 +234,4 @@ 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 0, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdata.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,9 @@ extern const uint8_t ff_dv_quant_offset[4]; #define NB_DV_VLC 409 +/* The number of entries with value zero in ff_dv_vlc_level. */ +#define NB_DV_ZERO_LEVEL_ENTRIES 72 -extern const uint16_t ff_dv_vlc_bits[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_len[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_run[NB_DV_VLC]; extern const uint8_t ff_dv_vlc_level[NB_DV_VLC]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,19 +36,19 @@ */ #include "libavutil/avassert.h" -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" -#include "libavutil/pixdesc.h" #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "dv.h" +#include "dv_internal.h" #include "dv_profile_internal.h" #include "dvdata.h" #include "get_bits.h" -#include "internal.h" +#include "idctdsp.h" #include "put_bits.h" #include "simple_idct.h" #include "thread.h" @@ -63,6 +63,19 @@ int shift_offset; } BlockInfo; +typedef struct DVDecContext { + const AVDVProfile *sys; + const AVFrame *frame; + const uint8_t *buf; + + uint8_t dv_zigzag[2][64]; + DVwork_chunk work_chunks[4 * 12 * 27]; + uint32_t idct_factor[2 * 4 * 16 * 64]; + void (*idct_put[2])(uint8_t *dest, ptrdiff_t stride, int16_t *block); + + IDCTDSPContext idsp; +} DVDecContext; + static const int dv_iweight_bits = 14; static const uint16_t dv_iweight_88[64] = { @@ -135,39 +148,35 @@ /* XXX: also include quantization */ static RL_VLC_ELEM dv_rl_vlc[1664]; -static void dv_init_static(void) +static av_cold void dv_init_static(void) { VLCElem vlc_buf[FF_ARRAY_ELEMS(dv_rl_vlc)] = { 0 }; VLC dv_vlc = { .table = vlc_buf, .table_allocated = FF_ARRAY_ELEMS(vlc_buf) }; - uint16_t new_dv_vlc_bits[NB_DV_VLC * 2]; - uint8_t new_dv_vlc_len[NB_DV_VLC * 2]; - uint8_t new_dv_vlc_run[NB_DV_VLC * 2]; - int16_t new_dv_vlc_level[NB_DV_VLC * 2]; + const unsigned offset = FF_ARRAY_ELEMS(dv_rl_vlc) - (2 * NB_DV_VLC - NB_DV_ZERO_LEVEL_ENTRIES); + RL_VLC_ELEM *tmp = dv_rl_vlc + offset; int i, j; /* it's faster to include sign bit in a generic VLC parsing scheme */ for (i = 0, j = 0; i < NB_DV_VLC; i++, j++) { - new_dv_vlc_bits[j] = ff_dv_vlc_bits[i]; - new_dv_vlc_len[j] = ff_dv_vlc_len[i]; - new_dv_vlc_run[j] = ff_dv_vlc_run[i]; - new_dv_vlc_level[j] = ff_dv_vlc_level[i]; + tmp[j].len = ff_dv_vlc_len[i]; + tmp[j].run = ff_dv_vlc_run[i]; + tmp[j].level = ff_dv_vlc_level[i]; if (ff_dv_vlc_level[i]) { - new_dv_vlc_bits[j] <<= 1; - new_dv_vlc_len[j]++; + tmp[j].len++; j++; - new_dv_vlc_bits[j] = (ff_dv_vlc_bits[i] << 1) | 1; - new_dv_vlc_len[j] = ff_dv_vlc_len[i] + 1; - new_dv_vlc_run[j] = ff_dv_vlc_run[i]; - new_dv_vlc_level[j] = -ff_dv_vlc_level[i]; + tmp[j].len = ff_dv_vlc_len[i] + 1; + tmp[j].run = ff_dv_vlc_run[i]; + tmp[j].level = -ff_dv_vlc_level[i]; } } /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ - init_vlc(&dv_vlc, TEX_VLC_BITS, j, new_dv_vlc_len, - 1, 1, new_dv_vlc_bits, 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, + &tmp[0].len, sizeof(tmp[0]), + NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); for (int i = 0; i < dv_vlc.table_size; i++) { @@ -179,8 +188,9 @@ run = 0; level = code; } else { - run = new_dv_vlc_run[code] + 1; - level = new_dv_vlc_level[code]; + av_assert1(i <= code + offset); + run = tmp[code].run + 1; + level = tmp[code].level; } dv_rl_vlc[i].len = len; dv_rl_vlc[i].level = level; @@ -188,7 +198,7 @@ } } -static void dv_init_weight_tables(DVVideoContext *ctx, const AVDVProfile *d) +static void dv_init_weight_tables(DVDecContext *ctx, const AVDVProfile *d) { int j, i, c, s; uint32_t *factor1 = &ctx->idct_factor[0], @@ -237,9 +247,11 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx) { static AVOnce init_static_once = AV_ONCE_INIT; - DVVideoContext *s = avctx->priv_data; + DVDecContext *s = avctx->priv_data; int i; + avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; + ff_idctdsp_init(&s->idsp, avctx); for (i = 0; i < 64; i++) @@ -258,7 +270,7 @@ ff_thread_once(&init_static_once, dv_init_static); - return ff_dvvideo_init(avctx); + return 0; } /* decode AC coefficients */ @@ -345,7 +357,7 @@ } } -static void dv100_idct_put_last_row_field_chroma(DVVideoContext *s, uint8_t *data, +static void dv100_idct_put_last_row_field_chroma(const DVDecContext *s, uint8_t *data, int stride, int16_t *blocks) { s->idsp.idct(blocks + 0*64); @@ -357,7 +369,7 @@ put_block_8x4(blocks+1*64 + 4*8, data + 8 + stride, stride<<1); } -static void dv100_idct_put_last_row_field_luma(DVVideoContext *s, uint8_t *data, +static void dv100_idct_put_last_row_field_luma(const DVDecContext *s, uint8_t *data, int stride, int16_t *blocks) { s->idsp.idct(blocks + 0*64); @@ -378,7 +390,7 @@ /* mb_x and mb_y are in units of 8 pixels */ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) { - DVVideoContext *s = avctx->priv_data; + const DVDecContext *s = avctx->priv_data; DVwork_chunk *work_chunk = arg; int quant, dc, dct_mode, class1, j; int mb_index, mb_x, mb_y, last_index; @@ -393,7 +405,7 @@ LOCAL_ALIGNED_16(int16_t, sblock, [5 * DV_MAX_BPM], [64]); LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 + AV_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ - const int log2_blocksize = 3-s->avctx->lowres; + const int log2_blocksize = 3 - avctx->lowres; int is_field_mode[5]; int vs_bit_buffer_damaged = 0; int mb_bit_buffer_damaged[5] = {0}; @@ -533,7 +545,7 @@ block = &sblock[0][0]; mb = mb_data; for (mb_index = 0; mb_index < 5; mb_index++) { - dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); + dv_calculate_mb_xy(s->sys, s->buf, work_chunk, mb_index, &mb_x, &mb_y); /* idct_put'ting luminance */ if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) || @@ -612,7 +624,7 @@ { uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - DVVideoContext *s = avctx->priv_data; + DVDecContext *s = avctx->priv_data; const uint8_t *vsc_pack; int apt, is16_9, ret; const AVDVProfile *sys; @@ -624,7 +636,7 @@ } if (sys != s->sys) { - ret = ff_dv_init_dynamic_tables(s, sys); + ret = ff_dv_init_dynamic_tables(s->work_chunks, sys); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error initializing the work tables.\n"); return ret; @@ -645,7 +657,7 @@ /* Determine the codec's sample_aspect ratio from the packet */ vsc_pack = buf + 80 * 5 + 48 + 5; - if (*vsc_pack == dv_video_control) { + if (*vsc_pack == DV_VIDEO_CONTROL) { apt = buf[4] & 0x07; is16_9 = (vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07); @@ -656,7 +668,7 @@ return ret; /* Determine the codec's field order from the packet */ - if ( *vsc_pack == dv_video_control ) { + if ( *vsc_pack == DV_VIDEO_CONTROL ) { if (avctx->height == 720) { frame->interlaced_frame = 0; frame->top_field_first = 0; @@ -683,13 +695,12 @@ const FFCodec ff_dvvideo_decoder = { .p.name = "dvvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + CODEC_LONG_NAME("DV (Digital Video)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DVVIDEO, - .priv_data_size = sizeof(DVVideoContext), + .priv_data_size = sizeof(DVDecContext), .init = dvvideo_decode_init, FF_CODEC_DECODE_CB(dvvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .p.max_lowres = 3, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,10 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "internal.h" #include "libavutil/avstring.h" #include +#include "dvdsub.h" + void ff_dvdsub_parse_palette(uint32_t *palette, const char *p) { for (int i = 0; i < 16; i++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,14 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" +#include "dvdsub.h" #include "get_bits.h" -#include "internal.h" #include "libavutil/attributes.h" #include "libavutil/colorspace.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" -#include "libavutil/imgutils.h" #include "libavutil/bswap.h" typedef struct DVDSubContext @@ -707,7 +708,7 @@ const FFCodec ff_dvdsub_decoder = { .p.name = "dvdsub", - .p.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), + CODEC_LONG_NAME("DVD subtitles"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVD_SUBTITLE, .priv_data_size = sizeof(DVDSubContext), @@ -715,5 +716,4 @@ FF_CODEC_DECODE_SUB_CB(dvdsub_decode), .flush = dvdsub_flush, .p.priv_class = &dvdsub_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsubenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "dvdsub.h" #include "libavutil/avassert.h" #include "libavutil/bprint.h" #include "libavutil/imgutils.h" @@ -379,7 +379,7 @@ if (x2 > avctx->width || y2 > avctx->height) { av_log(avctx, AV_LOG_ERROR, "canvas_size(%d:%d) is too small(%d:%d) for render\n", avctx->width, avctx->height, x2, y2); - ret = AVERROR(EINVAL);; + ret = AVERROR(EINVAL); goto fail; } *q++ = 0x05; @@ -502,12 +502,11 @@ const FFCodec ff_dvdsub_encoder = { .p.name = "dvdsub", - .p.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), + CODEC_LONG_NAME("DVD subtitles"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVD_SUBTITLE, .init = dvdsub_init, FF_CODEC_ENCODE_SUB_CB(dvdsub_encode), .p.priv_class = &dvdsubenc_class, .priv_data_size = sizeof(DVDSubtitleContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_DVDSUB_H +#define AVCODEC_DVDSUB_H + +#include + +void ff_dvdsub_parse_palette(uint32_t *palette, const char *p); + +#endif /* AVCODEC_DVDSUB_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvdsub_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,7 +43,7 @@ *poutbuf_size = buf_size; if (pc->packet_index == 0) { - if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) { + if (buf_size < 2 || (AV_RB16(buf) == 0 && buf_size < 6)) { if (buf_size) av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size); return buf_size; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,6 +38,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "dv.h" +#include "dv_internal.h" #include "dv_profile_internal.h" #include "dv_tablegen.h" #include "encode.h" @@ -47,14 +48,41 @@ #include "pixblockdsp.h" #include "put_bits.h" +typedef struct DVEncContext { + const AVClass *class; + const AVDVProfile *sys; + const AVFrame *frame; + AVCodecContext *avctx; + uint8_t *buf; + + void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t linesize); + void (*fdct[2])(int16_t *block); + + me_cmp_func ildct_cmp; + DVwork_chunk work_chunks[4 * 12 * 27]; + + int quant_deadzone; +} DVEncContext; + + static av_cold int dvvideo_encode_init(AVCodecContext *avctx) { - DVVideoContext *s = avctx->priv_data; + DVEncContext *s = avctx->priv_data; FDCTDSPContext fdsp; MECmpContext mecc; PixblockDSPContext pdsp; int ret; + s->avctx = avctx; + + if (avctx->chroma_sample_location != AVCHROMA_LOC_TOPLEFT) { + const char *name = av_chroma_location_name(avctx->chroma_sample_location); + av_log(avctx, AV_LOG_WARNING, "Only top-left chroma location is supported " + "in DV, input value is: %s\n", name ? name : "unknown"); + if (avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL) + return AVERROR(EINVAL); + } + s->sys = av_dv_codec_profile2(avctx->width, avctx->height, avctx->pix_fmt, avctx->time_base); if (!s->sys) { av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. " @@ -64,7 +92,7 @@ return AVERROR(EINVAL); } - ret = ff_dv_init_dynamic_tables(s, s->sys); + ret = ff_dv_init_dynamic_tables(s->work_chunks, s->sys); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error initializing work tables.\n"); return ret; @@ -91,7 +119,7 @@ } #endif - return ff_dvvideo_init(avctx); + return 0; } /* bit budget for AC only in 5 MBs */ @@ -217,7 +245,7 @@ return pb; } -static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data, +static av_always_inline int dv_guess_dct_mode(DVEncContext *s, const uint8_t *data, ptrdiff_t linesize) { if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) { @@ -365,7 +393,7 @@ 2661, 2583, 2509, 2394, 2509, 2260, 2260, 2131, } }; -static av_always_inline int dv_set_class_number_sd(DVVideoContext *s, +static av_always_inline int dv_set_class_number_sd(DVEncContext *s, int16_t *blk, EncBlockInfo *bi, const uint8_t *zigzag_scan, const int *weight, int bias) @@ -449,7 +477,7 @@ /* this function just copies the DCT coefficients and performs the initial (non-)quantization. */ -static inline void dv_set_class_number_hd(DVVideoContext *s, +static inline void dv_set_class_number_hd(DVEncContext *s, int16_t *blk, EncBlockInfo *bi, const uint8_t *zigzag_scan, const int *weight, int bias) @@ -506,8 +534,8 @@ bi->cno = 0; } -static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, int linesize, - DVVideoContext *s, int chroma) +static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, const uint8_t *data, int linesize, + DVEncContext *s, int chroma) { LOCAL_ALIGNED_16(int16_t, blk, [64]); @@ -844,12 +872,12 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) { - DVVideoContext *s = avctx->priv_data; + DVEncContext *s = avctx->priv_data; DVwork_chunk *work_chunk = arg; int mb_index, i, j; int mb_x, mb_y, c_offset; ptrdiff_t linesize, y_stride; - uint8_t *y_ptr; + const uint8_t *y_ptr; uint8_t *dif, *p; LOCAL_ALIGNED_8(uint8_t, scratch, [128]); EncBlockInfo enc_blks[5 * DV_MAX_BPM]; @@ -863,7 +891,7 @@ p = dif = &s->buf[work_chunk->buf_offset * 80]; enc_blk = &enc_blks[0]; for (mb_index = 0; mb_index < 5; mb_index++) { - dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); + dv_calculate_mb_xy(s->sys, s->buf, work_chunk, mb_index, &mb_x, &mb_y); qnos[mb_index] = DV_PROFILE_IS_HD(s->sys) ? 1 : 15; @@ -908,14 +936,13 @@ c_offset = ((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->frame->linesize[1] + (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) * 8; for (j = 2; j; j--) { - uint8_t *c_ptr = s->frame->data[j] + c_offset; + const uint8_t *c_ptr = s->frame->data[j] + c_offset; linesize = s->frame->linesize[j]; y_stride = (mb_y == 134) ? 8 : (s->frame->linesize[j] * (1 << (3*!enc_blk->dct_mode))); if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) { - uint8_t *d; uint8_t *b = scratch; for (i = 0; i < 8; i++) { - d = c_ptr + linesize * 8; + const uint8_t *d = c_ptr + linesize * 8; b[0] = c_ptr[0]; b[1] = c_ptr[1]; b[2] = c_ptr[2]; @@ -993,7 +1020,7 @@ return 0; } -static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, +static inline int dv_write_pack(enum DVPackType pack_id, DVEncContext *c, uint8_t *buf) { /* @@ -1031,8 +1058,8 @@ buf[0] = (uint8_t) pack_id; switch (pack_id) { - case dv_header525: /* I can't imagine why these two weren't defined as real */ - case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */ + case DV_HEADER525: /* I can't imagine why these two weren't defined as real */ + case DV_HEADER625: /* packs in SMPTE314M -- they definitely look like ones */ buf[1] = 0xf8 | /* reserved -- always 1 */ (apt & 0x07); /* APT: Track application ID */ buf[2] = (0 << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */ @@ -1045,7 +1072,7 @@ (0x0f << 3) | /* reserved -- always 1 */ (apt & 0x07); /* AP3: Subcode application ID */ break; - case dv_video_source: + case DV_VIDEO_SOURCE: buf[1] = 0xff; /* reserved -- always 1 */ buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */ (1 << 6) | /* following CLF is valid - 0, invalid - 1 */ @@ -1056,7 +1083,7 @@ c->sys->video_stype; /* signal type video compression */ buf[4] = 0xff; /* VISC: 0xff -- no information */ break; - case dv_video_control: + case DV_VIDEO_CONTROL: buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */ 0x3f; /* reserved -- always 1 */ buf[2] = 0xc8 | /* reserved -- always b11001xxx */ @@ -1077,7 +1104,7 @@ return 5; } -static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num, +static inline int dv_write_dif_id(enum DVSectionType t, uint8_t chan_num, uint8_t seq_num, uint8_t dif_num, uint8_t *buf) { @@ -1113,25 +1140,25 @@ return 3; } -static void dv_format_frame(DVVideoContext *c, uint8_t *buf) +static void dv_format_frame(DVEncContext *c, uint8_t *buf) { int chan, i, j, k; /* We work with 720p frames split in half. The odd half-frame is chan 2,3 */ - int chan_offset = 2*(c->sys->height == 720 && c->avctx->frame_number & 1); + int chan_offset = 2*(c->sys->height == 720 && c->avctx->frame_num & 1); for (chan = 0; chan < c->sys->n_difchan; chan++) { for (i = 0; i < c->sys->difseg_size; i++) { memset(buf, 0xff, 80 * 6); /* first 6 DIF blocks are for control data */ /* DV header: 1DIF */ - buf += dv_write_dif_id(dv_sect_header, chan+chan_offset, i, 0, buf); - buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), + buf += dv_write_dif_id(DV_SECT_HEADER, chan+chan_offset, i, 0, buf); + buf += dv_write_pack((c->sys->dsf ? DV_HEADER625 : DV_HEADER525), c, buf); buf += 72; /* unused bytes */ /* DV subcode: 2DIFs */ for (j = 0; j < 2; j++) { - buf += dv_write_dif_id(dv_sect_subcode, chan+chan_offset, i, j, buf); + buf += dv_write_dif_id(DV_SECT_SUBCODE, chan+chan_offset, i, j, buf); for (k = 0; k < 6; k++) buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size / 2), buf) + 5; buf += 29; /* unused bytes */ @@ -1139,12 +1166,12 @@ /* DV VAUX: 3DIFS */ for (j = 0; j < 3; j++) { - buf += dv_write_dif_id(dv_sect_vaux, chan+chan_offset, i, j, buf); - buf += dv_write_pack(dv_video_source, c, buf); - buf += dv_write_pack(dv_video_control, c, buf); + buf += dv_write_dif_id(DV_SECT_VAUX, chan+chan_offset, i, j, buf); + buf += dv_write_pack(DV_VIDEO_SOURCE, c, buf); + buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf); buf += 7 * 5; - buf += dv_write_pack(dv_video_source, c, buf); - buf += dv_write_pack(dv_video_control, c, buf); + buf += dv_write_pack(DV_VIDEO_SOURCE, c, buf); + buf += dv_write_pack(DV_VIDEO_CONTROL, c, buf); buf += 4 * 5 + 2; /* unused bytes */ } @@ -1152,10 +1179,10 @@ for (j = 0; j < 135; j++) { if (j % 15 == 0) { memset(buf, 0xff, 80); - buf += dv_write_dif_id(dv_sect_audio, chan+chan_offset, i, j/15, buf); + buf += dv_write_dif_id(DV_SECT_AUDIO, chan+chan_offset, i, j/15, buf); buf += 77; /* audio control & shuffled PCM audio */ } - buf += dv_write_dif_id(dv_sect_video, chan+chan_offset, i, j, buf); + buf += dv_write_dif_id(DV_SECT_VIDEO, chan+chan_offset, i, j, buf); buf += 77; /* 1 video macroblock: 1 bytes control * 4 * 14 bytes Y 8x8 data * 10 bytes Cr 8x8 data @@ -1168,7 +1195,7 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt, const AVFrame *frame, int *got_packet) { - DVVideoContext *s = c->priv_data; + DVEncContext *s = c->priv_data; int ret; if ((ret = ff_get_encode_buffer(c, pkt, s->sys->frame_size, 0)) < 0) @@ -1193,7 +1220,7 @@ } #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM -#define OFFSET(x) offsetof(DVVideoContext, x) +#define OFFSET(x) offsetof(DVEncContext, x) static const AVOption dv_options[] = { { "quant_deadzone", "Quantizer dead zone", OFFSET(quant_deadzone), AV_OPT_TYPE_INT, { .i64 = 7 }, 0, 1024, VE }, { NULL }, @@ -1208,12 +1235,13 @@ const FFCodec ff_dvvideo_encoder = { .p.name = "dvvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + CODEC_LONG_NAME("DV (Digital Video)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DVVIDEO, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | - AV_CODEC_CAP_SLICE_THREADS, - .priv_data_size = sizeof(DVVideoContext), + AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(DVEncContext), .init = dvvideo_encode_init, FF_CODEC_ENCODE_CB(dvvideo_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { @@ -1221,5 +1249,4 @@ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &dvvideo_encode_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,57 +27,27 @@ #ifndef AVCODEC_DV_H #define AVCODEC_DV_H -#include "avcodec.h" -#include "dv_profile.h" -#include "me_cmp.h" -#include "idctdsp.h" - -typedef struct DVwork_chunk { - uint16_t buf_offset; - uint16_t mb_coordinates[5]; -} DVwork_chunk; - -typedef struct DVVideoContext { - AVClass *avclass; - const AVDVProfile *sys; - const AVFrame *frame; - AVCodecContext *avctx; - uint8_t *buf; - - uint8_t dv_zigzag[2][64]; - - void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t linesize); - void (*fdct[2])(int16_t *block); - void (*idct_put[2])(uint8_t *dest, ptrdiff_t stride, int16_t *block); - me_cmp_func ildct_cmp; - DVwork_chunk work_chunks[4 * 12 * 27]; - uint32_t idct_factor[2 * 4 * 16 * 64]; - IDCTDSPContext idsp; - - int quant_deadzone; -} DVVideoContext; - -enum dv_section_type { - dv_sect_header = 0x1f, - dv_sect_subcode = 0x3f, - dv_sect_vaux = 0x56, - dv_sect_audio = 0x76, - dv_sect_video = 0x96, +enum DVSectionType { + DV_SECT_HEADER = 0x1f, + DV_SECT_SUBCODE = 0x3f, + DV_SECT_VAUX = 0x56, + DV_SECT_AUDIO = 0x76, + DV_SECT_VIDEO = 0x96, }; -enum dv_pack_type { - dv_header525 = 0x3f, /* see dv_write_pack for important details on */ - dv_header625 = 0xbf, /* these two packs */ - dv_timecode = 0x13, - dv_audio_source = 0x50, - dv_audio_control = 0x51, - dv_audio_recdate = 0x52, - dv_audio_rectime = 0x53, - dv_video_source = 0x60, - dv_video_control = 0x61, - dv_video_recdate = 0x62, - dv_video_rectime = 0x63, - dv_unknown_pack = 0xff, +enum DVPackType { + DV_HEADER525 = 0x3f, /* see dv_write_pack for important details on */ + DV_HEADER625 = 0xbf, /* these two packs */ + DV_TIMECODE = 0x13, + DV_AUDIO_SOURCE = 0x50, + DV_AUDIO_CONTROL = 0x51, + DV_AUDIO_RECDATE = 0x52, + DV_AUDIO_RECTIME = 0x53, + DV_VIDEO_SOURCE = 0x60, + DV_VIDEO_CONTROL = 0x61, + DV_VIDEO_RECDATE = 0x62, + DV_VIDEO_RECTIME = 0x63, + DV_UNKNOWN_PACK = 0xff, }; #define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10) @@ -95,32 +65,4 @@ */ #define DV_MAX_BPM 8 -int ff_dv_init_dynamic_tables(DVVideoContext *s, const AVDVProfile *d); - -int ff_dvvideo_init(AVCodecContext *avctx); - -static inline int dv_work_pool_size(const AVDVProfile *d) -{ - int size = d->n_difchan * d->difseg_size * 27; - if (DV_PROFILE_IS_1080i50(d)) - size -= 3 * 27; - if (DV_PROFILE_IS_720p50(d)) - size -= 4 * 27; - return size; -} - -static inline void dv_calculate_mb_xy(DVVideoContext *s, - DVwork_chunk *work_chunk, - int m, int *mb_x, int *mb_y) -{ - *mb_x = work_chunk->mb_coordinates[m] & 0xff; - *mb_y = work_chunk->mb_coordinates[m] >> 8; - - /* We work with 720p frames split in half. - * The odd half-frame (chan == 2,3) is displaced :-( */ - if (s->sys->height == 720 && !(s->buf[1] & 0x0C)) - /* shifting the Y coordinate down by 72/2 macro blocks */ - *mb_y -= (*mb_y > 17) ? 18 : -72; -} - #endif /* AVCODEC_DV_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_internal.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * DV encoder/decoder shared code + * Copyright (c) 2002 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DV_INTERNAL_H +#define AVCODEC_DV_INTERNAL_H + +#include + +#include "dv.h" +#include "dv_profile.h" + +typedef struct DVwork_chunk { + uint16_t buf_offset; + uint16_t mb_coordinates[5]; +} DVwork_chunk; + +int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d); + +static inline int dv_work_pool_size(const AVDVProfile *d) +{ + int size = d->n_difchan * d->difseg_size * 27; + if (DV_PROFILE_IS_1080i50(d)) + size -= 3 * 27; + if (DV_PROFILE_IS_720p50(d)) + size -= 4 * 27; + return size; +} + +static inline void dv_calculate_mb_xy(const AVDVProfile *sys, + const uint8_t *buf, + const DVwork_chunk *work_chunk, + int m, int *mb_x, int *mb_y) +{ + *mb_x = work_chunk->mb_coordinates[m] & 0xff; + *mb_y = work_chunk->mb_coordinates[m] >> 8; + + /* We work with 720p frames split in half. + * The odd half-frame (chan == 2,3) is displaced :-( */ + if (sys->height == 720 && !(buf[1] & 0x0C)) + /* shifting the Y coordinate down by 72/2 macro blocks */ + *mb_y -= (*mb_y > 17) ? 18 : -72; +} + +#endif // AVCODEC_DV_INTERNAL_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_tablegen.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_tablegen.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_tablegen.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dv_tablegen.h 2023-03-03 13:29:59.000000000 +0000 @@ -50,8 +50,11 @@ static av_cold void dv_vlc_map_tableinit(void) { + uint32_t code = 0; int i, j; - for (i = 0; i < NB_DV_VLC - 1; i++) { + for (int i = 0; i < NB_DV_VLC; i++) { + uint32_t cur_code = code >> (32 - ff_dv_vlc_len[i]); + code += 1U << (32 - ff_dv_vlc_len[i]); if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE) continue; #if CONFIG_SMALL @@ -63,7 +66,7 @@ continue; dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].vlc = - ff_dv_vlc_bits[i] << (!!ff_dv_vlc_level[i]); + cur_code << (!!ff_dv_vlc_level[i]); dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size = ff_dv_vlc_len[i] + (!!ff_dv_vlc_level[i]); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxa.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,15 +24,12 @@ * DXA Video decoder */ -#include -#include - #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "bytestream.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include @@ -363,7 +360,7 @@ const FFCodec ff_dxa_decoder = { .p.name = "dxa", - .p.long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"), + CODEC_LONG_NAME("Feeble Files/ScummVM DXA"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DXA, .priv_data_size = sizeof(DxaDecContext), @@ -371,5 +368,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxtory.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxtory.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxtory.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxtory.c 2023-03-03 13:29:59.000000000 +0000 @@ -872,7 +872,7 @@ const FFCodec ff_dxtory_decoder = { .p.name = "dxtory", - .p.long_name = NULL_IF_CONFIG_SMALL("Dxtory"), + CODEC_LONG_NAME("Dxtory"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DXTORY, FF_CODEC_DECODE_CB(decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxva2_vc1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxva2_vc1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxva2_vc1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxva2_vc1.c 2023-03-03 13:29:59.000000000 +0000 @@ -372,8 +372,6 @@ &ctx_pic->pp, sizeof(ctx_pic->pp), NULL, 0, commit_bitstream_and_slice_buffer); - if (!ret) - ff_mpeg_draw_horiz_band(&v->s, 0, avctx->height); return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/dxv.c 2023-03-03 13:29:59.000000000 +0000 @@ -193,7 +193,7 @@ static int decompress_texture_thread(AVCodecContext *avctx, void *arg, int slice, int thread_nb) { - DXVContext *ctx = avctx->priv_data; + const DXVContext *ctx = avctx->priv_data; AVFrame *frame = arg; const uint8_t *d = ctx->tex_data; int w_block = avctx->coded_width / ctx->texture_block_w; @@ -432,7 +432,7 @@ int64_t size_in_bits; unsigned endoffset, newoffset, offset; unsigned next; - uint8_t *src = (uint8_t *)gb->buffer; + const uint8_t *src = gb->buffer; ret = fill_optable(table, optable, nb_elements); if (ret < 0) @@ -1262,7 +1262,7 @@ const FFCodec ff_dxv_decoder = { .p.name = "dxv", - .p.long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"), + CODEC_LONG_NAME("Resolume DXV"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DXV, .init = dxv_init, @@ -1272,6 +1272,5 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -138,9 +138,11 @@ // spx_noise_blend and spx_signal_blend are both FP.23 nscale *= 1.0 / (1<<23); sscale *= 1.0 / (1<<23); + if (nscale < -1.0) + nscale = -1.0; #endif for (i = 0; i < s->spx_band_sizes[bnd]; i++) { - float noise = nscale * (int32_t)av_lfg_get(&s->dith_state); + UINTFLOAT noise = (INTFLOAT)(nscale * (int32_t)av_lfg_get(&s->dith_state)); s->transform_coeffs[ch][bin] *= sscale; s->transform_coeffs[ch][bin++] += noise; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eac3enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -189,7 +189,7 @@ put_bits(&s->pb, 1, 0); } if (s->num_blocks != 6) - put_bits(&s->pb, 1, !(s->avctx->frame_number % 6)); /* converter sync flag */ + put_bits(&s->pb, 1, !(s->avctx->frame_num % 6)); /* converter sync flag */ put_bits(&s->pb, 1, 0); /* no additional bit stream info */ /* frame header */ @@ -249,13 +249,12 @@ } -FF_DISABLE_DEPRECATION_WARNINGS const FFCodec ff_eac3_encoder = { .p.name = "eac3", - .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"), + CODEC_LONG_NAME("ATSC A/52 E-AC-3"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_EAC3, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, FF_CODEC_ENCODE_CB(ff_ac3_float_encode_frame), @@ -264,11 +263,8 @@ AV_SAMPLE_FMT_NONE }, .p.priv_class = &eac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_ac3_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; -FF_ENABLE_DEPRECATION_WARNINGS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eacmv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eacmv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eacmv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eacmv.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct CmvContext { AVCodecContext *avctx; @@ -231,7 +231,7 @@ const FFCodec ff_eacmv_decoder = { .p.name = "eacmv", - .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), + CODEC_LONG_NAME("Electronic Arts CMV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CMV, .priv_data_size = sizeof(CmvContext), @@ -239,5 +239,5 @@ .close = cmv_decode_end, FF_CODEC_DECODE_CB(cmv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eamad.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eamad.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eamad.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eamad.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,11 +35,10 @@ #include "bytestream.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "aandcttab.h" #include "eaidct.h" -#include "idctdsp.h" -#include "internal.h" #include "mpeg12data.h" #include "mpeg12vlc.h" @@ -52,13 +51,11 @@ AVCodecContext *avctx; BlockDSPContext bdsp; BswapDSPContext bbdsp; - IDCTDSPContext idsp; AVFrame *last_frame; GetBitContext gb; void *bitstream_buf; unsigned int bitstream_buf_size; DECLARE_ALIGNED(32, int16_t, block)[64]; - ScanTable scantable; uint16_t quant_matrix[64]; int mb_x; int mb_y; @@ -69,11 +66,8 @@ MadContext *s = avctx->priv_data; s->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_YUV420P; - ff_blockdsp_init(&s->bdsp, avctx); + ff_blockdsp_init(&s->bdsp); ff_bswapdsp_init(&s->bbdsp); - ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable_permutation(s->idsp.idct_permutation, FF_IDCT_PERM_NONE); - ff_init_scantable(s->idsp.idct_permutation, &s->scantable, ff_zigzag_direct); ff_mpeg12_init_vlcs(); s->last_frame = av_frame_alloc(); @@ -134,8 +128,7 @@ static inline int decode_block_intra(MadContext *s, int16_t * block) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; - const uint8_t *scantable = s->scantable.permutated; + const uint8_t *scantable = ff_zigzag_direct; int16_t *quant_matrix = s->quant_matrix; block[0] = (128 + get_sbits(&s->gb, 8)) * quant_matrix[0]; @@ -148,7 +141,7 @@ /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; @@ -342,7 +335,7 @@ const FFCodec ff_eamad_decoder = { .p.name = "eamad", - .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"), + CODEC_LONG_NAME("Electronic Arts Madcow Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MAD, .priv_data_size = sizeof(MadContext), @@ -350,5 +343,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgq.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgq.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgq.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgq.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,60 +36,58 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "eaidct.h" #include "get_bits.h" -#include "idctdsp.h" -#include "internal.h" typedef struct TgqContext { AVCodecContext *avctx; int width, height; - ScanTable scantable; int qtable[64]; DECLARE_ALIGNED(16, int16_t, block)[6][64]; - GetByteContext gb; } TgqContext; static av_cold int tgq_decode_init(AVCodecContext *avctx) { TgqContext *s = avctx->priv_data; - uint8_t idct_permutation[64]; s->avctx = avctx; - ff_init_scantable_permutation(idct_permutation, FF_IDCT_PERM_NONE); - ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct); avctx->framerate = (AVRational){ 15, 1 }; avctx->pix_fmt = AV_PIX_FMT_YUV420P; return 0; } -static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb) +static int tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb) { - uint8_t *perm = s->scantable.permutated; + const uint8_t *scantable = ff_zigzag_direct; int i, j, value; block[0] = get_sbits(gb, 8) * s->qtable[0]; for (i = 1; i < 64;) { switch (show_bits(gb, 3)) { case 4: - block[perm[i++]] = 0; + if (i >= 63) + return AVERROR_INVALIDDATA; + block[scantable[i++]] = 0; case 0: - block[perm[i++]] = 0; + block[scantable[i++]] = 0; skip_bits(gb, 3); break; case 5: case 1: skip_bits(gb, 2); value = get_bits(gb, 6); + if (value > 64 - i) + return AVERROR_INVALIDDATA; for (j = 0; j < value; j++) - block[perm[i++]] = 0; + block[scantable[i++]] = 0; break; case 6: skip_bits(gb, 3); - block[perm[i]] = -s->qtable[perm[i]]; + block[scantable[i]] = -s->qtable[scantable[i]]; i++; break; case 2: skip_bits(gb, 3); - block[perm[i]] = s->qtable[perm[i]]; + block[scantable[i]] = s->qtable[scantable[i]]; i++; break; case 7: // 111b @@ -97,15 +95,16 @@ skip_bits(gb, 2); if (show_bits(gb, 6) == 0x3F) { skip_bits(gb, 6); - block[perm[i]] = get_sbits(gb, 8) * s->qtable[perm[i]]; + block[scantable[i]] = get_sbits(gb, 8) * s->qtable[scantable[i]]; } else { - block[perm[i]] = get_sbits(gb, 6) * s->qtable[perm[i]]; + block[scantable[i]] = get_sbits(gb, 6) * s->qtable[scantable[i]]; } i++; break; } } block[0] += 128 << 4; + return 0; } static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame *frame, @@ -152,34 +151,38 @@ } } -static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x) +static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, + AVFrame *frame, int mb_y, int mb_x) { int mode; int i; int8_t dc[6]; - mode = bytestream2_get_byte(&s->gb); + mode = bytestream2_get_byte(gbyte); if (mode > 12) { GetBitContext gb; - int ret = init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode)); + int ret = init_get_bits8(&gb, gbyte->buffer, FFMIN(bytestream2_get_bytes_left(gbyte), mode)); if (ret < 0) return ret; - for (i = 0; i < 6; i++) - tgq_decode_block(s, s->block[i], &gb); + for (i = 0; i < 6; i++) { + int ret = tgq_decode_block(s, s->block[i], &gb); + if (ret < 0) + return ret; + } tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y); - bytestream2_skip(&s->gb, mode); + bytestream2_skip(gbyte, mode); } else { if (mode == 3) { - memset(dc, bytestream2_get_byte(&s->gb), 4); - dc[4] = bytestream2_get_byte(&s->gb); - dc[5] = bytestream2_get_byte(&s->gb); + memset(dc, bytestream2_get_byte(gbyte), 4); + dc[4] = bytestream2_get_byte(gbyte); + dc[5] = bytestream2_get_byte(gbyte); } else if (mode == 6) { - bytestream2_get_buffer(&s->gb, dc, 6); + bytestream2_get_buffer(gbyte, dc, 6); } else if (mode == 12) { for (i = 0; i < 6; i++) { - dc[i] = bytestream2_get_byte(&s->gb); - bytestream2_skip(&s->gb, 1); + dc[i] = bytestream2_get_byte(gbyte); + bytestream2_skip(gbyte, 1); } } else { av_log(s->avctx, AV_LOG_ERROR, "unsupported mb mode %i\n", mode); @@ -207,6 +210,7 @@ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TgqContext *s = avctx->priv_data; + GetByteContext gbyte; int x, y, ret; int big_endian; @@ -215,21 +219,21 @@ return AVERROR_INVALIDDATA; } big_endian = AV_RL32(&buf[4]) > 0x000FFFFF; - bytestream2_init(&s->gb, buf + 8, buf_size - 8); + bytestream2_init(&gbyte, buf + 8, buf_size - 8); if (big_endian) { - s->width = bytestream2_get_be16u(&s->gb); - s->height = bytestream2_get_be16u(&s->gb); + s->width = bytestream2_get_be16u(&gbyte); + s->height = bytestream2_get_be16u(&gbyte); } else { - s->width = bytestream2_get_le16u(&s->gb); - s->height = bytestream2_get_le16u(&s->gb); + s->width = bytestream2_get_le16u(&gbyte); + s->height = bytestream2_get_le16u(&gbyte); } ret = ff_set_dimensions(s->avctx, s->width, s->height); if (ret < 0) return ret; - tgq_calculate_qtable(s, bytestream2_get_byteu(&s->gb)); - bytestream2_skip(&s->gb, 3); + tgq_calculate_qtable(s, bytestream2_get_byteu(&gbyte)); + bytestream2_skipu(&gbyte, 3); if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; @@ -238,7 +242,7 @@ for (y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++) for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++) - if (tgq_decode_mb(s, frame, y, x) < 0) + if (tgq_decode_mb(s, &gbyte, frame, y, x) < 0) return AVERROR_INVALIDDATA; *got_frame = 1; @@ -248,12 +252,11 @@ const FFCodec ff_eatgq_decoder = { .p.name = "eatgq", - .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"), + CODEC_LONG_NAME("Electronic Arts TGQ video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TGQ, .priv_data_size = sizeof(TgqContext), .init = tgq_decode_init, FF_CODEC_DECODE_CB(tgq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatgv.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,14 +28,13 @@ * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGV */ -#include "libavutil/imgutils.h" #include "libavutil/mem.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define EA_PREAMBLE_SIZE 8 #define kVGT_TAG MKTAG('k', 'V', 'G', 'T') @@ -360,7 +359,7 @@ const FFCodec ff_eatgv_decoder = { .p.name = "eatgv", - .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGV video"), + CODEC_LONG_NAME("Electronic Arts TGV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TGV, .priv_data_size = sizeof(TgvContext), @@ -368,5 +367,4 @@ .close = tgv_decode_end, FF_CODEC_DECODE_CB(tgv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatqi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatqi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatqi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/eatqi.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,11 +32,10 @@ #include "blockdsp.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "aandcttab.h" #include "eaidct.h" -#include "idctdsp.h" -#include "internal.h" #include "mpeg12data.h" #include "mpeg12dec.h" @@ -45,8 +44,6 @@ GetBitContext gb; BlockDSPContext bdsp; BswapDSPContext bsdsp; - IDCTDSPContext idsp; - ScanTable intra_scantable; void *bitstream_buf; unsigned int bitstream_buf_size; @@ -62,11 +59,8 @@ { TqiContext *t = avctx->priv_data; - ff_blockdsp_init(&t->bdsp, avctx); + ff_blockdsp_init(&t->bdsp); ff_bswapdsp_init(&t->bsdsp); - ff_idctdsp_init(&t->idsp, avctx); - ff_init_scantable_permutation(t->idsp.idct_permutation, FF_IDCT_PERM_NONE); - ff_init_scantable(t->idsp.idct_permutation, &t->intra_scantable, ff_zigzag_direct); avctx->framerate = (AVRational){ 15, 1 }; avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -82,7 +76,7 @@ for (n = 0; n < 6; n++) { int ret = ff_mpeg1_decode_block_intra(&t->gb, t->intra_matrix, - t->intra_scantable.permutated, + ff_zigzag_direct, t->last_dc, block[n], n, 1); if (ret < 0) { av_log(t->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", @@ -183,7 +177,7 @@ const FFCodec ff_eatqi_decoder = { .p.name = "eatqi", - .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TQI Video"), + CODEC_LONG_NAME("Electronic Arts TQI Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TQI, .priv_data_size = sizeof(TqiContext), @@ -191,5 +185,4 @@ .close = tqi_decode_end, FF_CODEC_DECODE_CB(tqi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.c 2023-03-03 13:29:59.000000000 +0000 @@ -107,15 +107,32 @@ return ret; } +static int encode_make_refcounted(AVCodecContext *avctx, AVPacket *avpkt) +{ + uint8_t *data = avpkt->data; + int ret; + + if (avpkt->buf) + return 0; + + avpkt->data = NULL; + ret = ff_get_encode_buffer(avctx, avpkt, avpkt->size, 0); + if (ret < 0) + return ret; + memcpy(avpkt->data, data, avpkt->size); + + return 0; +} + /** * Pad last frame with silence. */ -static int pad_last_frame(AVCodecContext *s, AVFrame *frame, const AVFrame *src) +static int pad_last_frame(AVCodecContext *s, AVFrame *frame, const AVFrame *src, int out_samples) { int ret; frame->format = src->format; - frame->nb_samples = s->frame_size; + frame->nb_samples = out_samples; ret = av_channel_layout_copy(&frame->ch_layout, &s->ch_layout); if (ret < 0) goto fail; @@ -140,6 +157,7 @@ fail: av_frame_unref(frame); + s->internal->last_audio_frame = 0; return ret; } @@ -153,7 +171,12 @@ } ret = ffcodec(avctx->codec)->cb.encode_sub(avctx, buf, buf_size, sub); - avctx->frame_number++; + avctx->frame_num++; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_number = avctx->frame_num; +FF_ENABLE_DEPRECATION_WARNINGS +#endif return ret; } @@ -172,6 +195,82 @@ return 0; } +int ff_encode_reordered_opaque(AVCodecContext *avctx, + AVPacket *pkt, const AVFrame *frame) +{ +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + avctx->reordered_opaque = frame->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + int ret = av_buffer_replace(&pkt->opaque_ref, frame->opaque_ref); + if (ret < 0) + return ret; + pkt->opaque = frame->opaque; + } + + return 0; +} + +int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, + AVFrame *frame, int *got_packet) +{ + const FFCodec *const codec = ffcodec(avctx->codec); + int ret; + + ret = codec->cb.encode(avctx, avpkt, frame, got_packet); + emms_c(); + av_assert0(ret <= 0); + + if (!ret && *got_packet) { + if (avpkt->data) { + ret = encode_make_refcounted(avctx, avpkt); + if (ret < 0) + goto unref; + // Date returned by encoders must always be ref-counted + av_assert0(avpkt->buf); + } + + // set the timestamps for the simple no-delay case + // encoders with delay have to set the timestamps themselves + if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || + (frame && (codec->caps_internal & FF_CODEC_CAP_EOF_FLUSH))) { + if (avpkt->pts == AV_NOPTS_VALUE) + avpkt->pts = frame->pts; + + if (!avpkt->duration) { + if (frame->duration) + avpkt->duration = frame->duration; + else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { + avpkt->duration = ff_samples_to_time_base(avctx, + frame->nb_samples); + } + } + + ret = ff_encode_reordered_opaque(avctx, avpkt, frame); + if (ret < 0) + goto unref; + } + + // dts equals pts unless there is reordering + // there can be no reordering if there is no encoder delay + if (!(avctx->codec_descriptor->props & AV_CODEC_PROP_REORDER) || + !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || + (codec->caps_internal & FF_CODEC_CAP_EOF_FLUSH)) + avpkt->dts = avpkt->pts; + } else { +unref: + av_packet_unref(avpkt); + } + + if (frame) + av_frame_unref(frame); + + return ret; +} + static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) { AVCodecInternal *avci = avctx->internal; @@ -192,7 +291,7 @@ if (!frame->buf[0]) { if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY || - (avci->frame_thread_encoder && avctx->active_thread_type & FF_THREAD_FRAME))) + avci->frame_thread_encoder)) return AVERROR_EOF; // Flushing is signaled with a NULL frame @@ -203,61 +302,16 @@ av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE); - if (CONFIG_FRAME_THREAD_ENCODER && - avci->frame_thread_encoder && (avctx->active_thread_type & FF_THREAD_FRAME)) - /* This might modify frame, but it doesn't matter, because - * the frame properties used below are not used for video - * (due to the delay inherent in frame threaded encoding, it makes - * no sense to use the properties of the current frame anyway). */ + if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder) + /* This will unref frame. */ ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet); else { - ret = codec->cb.encode(avctx, avpkt, frame, &got_packet); - if (avctx->codec->type == AVMEDIA_TYPE_VIDEO && !ret && got_packet && - !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) - avpkt->pts = avpkt->dts = frame->pts; - } - - av_assert0(ret <= 0); - - emms_c(); - - if (!ret && got_packet) { - if (avpkt->data) { - ret = av_packet_make_refcounted(avpkt); - if (ret < 0) - goto end; - } - - if (frame && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) { - if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { - if (avpkt->pts == AV_NOPTS_VALUE) - avpkt->pts = frame->pts; - if (!avpkt->duration) - avpkt->duration = ff_samples_to_time_base(avctx, - frame->nb_samples); - } - } - if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { - avpkt->dts = avpkt->pts; - } - avpkt->flags |= avci->intra_only_flag; + ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet); } if (avci->draining && !got_packet) avci->draining_done = 1; -end: - if (ret < 0 || !got_packet) - av_packet_unref(avpkt); - - if (frame) - av_frame_unref(frame); - - if (got_packet) - // Encoders must always return ref-counted buffers. - // Side-data only packets have no data and can be not ref-counted. - av_assert0(!avpkt->data || avpkt->buf); - return ret; } @@ -301,6 +355,8 @@ av_assert0(!avpkt->data || avpkt->buf); } else ret = encode_simple_receive_packet(avctx, avpkt); + if (ret >= 0) + avpkt->flags |= avci->intra_only_flag; if (ret == AVERROR_EOF) avci->draining_done = 1; @@ -308,6 +364,53 @@ return ret; } +#if CONFIG_LCMS2 +static int encode_generate_icc_profile(AVCodecContext *avctx, AVFrame *frame) +{ + enum AVColorTransferCharacteristic trc = frame->color_trc; + enum AVColorPrimaries prim = frame->color_primaries; + const FFCodec *const codec = ffcodec(avctx->codec); + AVCodecInternal *avci = avctx->internal; + cmsHPROFILE profile; + int ret; + + /* don't generate ICC profiles if disabled or unsupported */ + if (!(avctx->flags2 & AV_CODEC_FLAG2_ICC_PROFILES)) + return 0; + if (!(codec->caps_internal & FF_CODEC_CAP_ICC_PROFILES)) + return 0; + + if (trc == AVCOL_TRC_UNSPECIFIED) + trc = avctx->color_trc; + if (prim == AVCOL_PRI_UNSPECIFIED) + prim = avctx->color_primaries; + if (trc == AVCOL_TRC_UNSPECIFIED || prim == AVCOL_PRI_UNSPECIFIED) + return 0; /* can't generate ICC profile with missing csp tags */ + + if (av_frame_get_side_data(frame, AV_FRAME_DATA_ICC_PROFILE)) + return 0; /* don't overwrite existing ICC profile */ + + if (!avci->icc.avctx) { + ret = ff_icc_context_init(&avci->icc, avctx); + if (ret < 0) + return ret; + } + + ret = ff_icc_profile_generate(&avci->icc, prim, trc, &profile); + if (ret < 0) + return ret; + + ret = ff_icc_profile_attach(&avci->icc, profile, frame); + cmsCloseProfile(profile); + return ret; +} +#else /* !CONFIG_LCMS2 */ +static int encode_generate_icc_profile(av_unused AVCodecContext *c, av_unused AVFrame *f) +{ + return 0; +} +#endif + static int encode_send_frame_internal(AVCodecContext *avctx, const AVFrame *src) { AVCodecInternal *avci = avctx->internal; @@ -321,28 +424,29 @@ avctx->audio_service_type = *(enum AVAudioServiceType*)sd->data; /* check for valid frame size */ - if (avctx->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME) { - if (src->nb_samples > avctx->frame_size) { - av_log(avctx, AV_LOG_ERROR, "more samples than frame size\n"); - return AVERROR(EINVAL); - } - } else if (!(avctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) { + if (!(avctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) { /* if we already got an undersized frame, that must have been the last */ if (avctx->internal->last_audio_frame) { av_log(avctx, AV_LOG_ERROR, "frame_size (%d) was not respected for a non-last frame\n", avctx->frame_size); return AVERROR(EINVAL); } - + if (src->nb_samples > avctx->frame_size) { + av_log(avctx, AV_LOG_ERROR, "nb_samples (%d) > frame_size (%d)\n", src->nb_samples, avctx->frame_size); + return AVERROR(EINVAL); + } if (src->nb_samples < avctx->frame_size) { - ret = pad_last_frame(avctx, dst, src); - if (ret < 0) - return ret; - avctx->internal->last_audio_frame = 1; - return 0; - } else if (src->nb_samples > avctx->frame_size) { - av_log(avctx, AV_LOG_ERROR, "nb_samples (%d) != frame_size (%d)\n", src->nb_samples, avctx->frame_size); - return AVERROR(EINVAL); + if (!(avctx->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)) { + int pad_samples = avci->pad_samples ? avci->pad_samples : avctx->frame_size; + int out_samples = (src->nb_samples + pad_samples - 1) / pad_samples * pad_samples; + + if (out_samples != src->nb_samples) { + ret = pad_last_frame(avctx, dst, src, out_samples); + if (ret < 0) + return ret; + goto finish; + } + } } } } @@ -351,6 +455,28 @@ if (ret < 0) return ret; +finish: + +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (dst->pkt_duration && dst->pkt_duration != dst->duration) + dst->duration = dst->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) { + ret = encode_generate_icc_profile(avctx, dst); + if (ret < 0) + return ret; + } + + // unset frame duration unless AV_CODEC_FLAG_FRAME_DURATION is set, + // since otherwise we cannot be sure that whatever value it has is in the + // right timebase, so we would produce an incorrect value, which is worse + // than none at all + if (!(avctx->flags & AV_CODEC_FLAG_FRAME_DURATION)) + dst->duration = 0; + return 0; } @@ -382,7 +508,12 @@ return ret; } - avctx->frame_number++; + avctx->frame_num++; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_number = avctx->frame_num; +FF_ENABLE_DEPRECATION_WARNINGS +#endif return 0; } @@ -514,11 +645,6 @@ return AVERROR(EINVAL); } if (avctx->codec->ch_layouts) { - if (!av_channel_layout_check(&avctx->ch_layout)) { - av_log(avctx, AV_LOG_WARNING, "Channel layout not specified correctly\n"); - return AVERROR(EINVAL); - } - for (i = 0; avctx->codec->ch_layouts[i].nb_channels; i++) { if (!av_channel_layout_compare(&avctx->ch_layout, &avctx->codec->ch_layouts[i])) break; @@ -531,28 +657,6 @@ return AVERROR(EINVAL); } } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->channel_layout && avctx->channels) { - int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); - if (channels != avctx->channels) { - char buf[512]; - av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); - av_log(avctx, AV_LOG_ERROR, - "Channel layout '%s' with %d channels does not match number of specified channels %d\n", - buf, channels, avctx->channels); - return AVERROR(EINVAL); - } - } else if (avctx->channel_layout) { - avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout); - } - if (avctx->channels < 0) { - av_log(avctx, AV_LOG_ERROR, "Specified number of channels %d is not supported\n", - avctx->channels); - return AVERROR(EINVAL); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (!avctx->bits_per_raw_sample) avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt); @@ -570,6 +674,13 @@ return AVERROR(EINVAL); } + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE && + !(avctx->codec->capabilities & AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE)) { + av_log(avctx, AV_LOG_ERROR, "The copy_opaque flag is set, but the " + "encoder does not support it.\n"); + return AVERROR(EINVAL); + } + switch (avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: ret = encode_preinit_video(avctx); break; case AVMEDIA_TYPE_AUDIO: ret = encode_preinit_audio(avctx); break; @@ -594,6 +705,24 @@ return AVERROR(ENOMEM); } + if ((avctx->flags & AV_CODEC_FLAG_RECON_FRAME)) { + if (!(avctx->codec->capabilities & AV_CODEC_CAP_ENCODER_RECON_FRAME)) { + av_log(avctx, AV_LOG_ERROR, "Reconstructed frame output requested " + "from an encoder not supporting it\n"); + return AVERROR(ENOSYS); + } + + avci->recon_frame = av_frame_alloc(); + if (!avci->recon_frame) + return AVERROR(ENOMEM); + } + + if (CONFIG_FRAME_THREAD_ENCODER) { + ret = ff_frame_thread_encoder_init(avctx); + if (ret < 0) + return ret; + } + return 0; } @@ -630,3 +759,16 @@ return 0; } + +int ff_encode_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + AVCodecInternal *avci = avctx->internal; + + if (!avci->recon_frame) + return AVERROR(EINVAL); + if (!avci->recon_frame->buf[0]) + return avci->draining_done ? AVERROR_EOF : AVERROR(EAGAIN); + + av_frame_move_ref(frame, avci->recon_frame); + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/encode.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,11 @@ #include "packet.h" /** + * avcodec_receive_frame() implementation for encoders. + */ +int ff_encode_receive_frame(AVCodecContext *avctx, AVFrame *frame); + +/** * Called by encoders to get the next frame for encoding. * * @param frame An empty frame to be filled with data. @@ -52,7 +57,7 @@ /** * Check AVPacket size and allocate data. * - * Encoders supporting FFCodec.encode2() can use this as a convenience to + * Encoders of type FF_CODEC_CB_TYPE_ENCODE can use this as a convenience to * obtain a big enough buffer for the encoded bitstream. * * @param avctx the AVCodecContext of the encoder @@ -64,10 +69,31 @@ */ int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size); +/** + * Propagate user opaque values from the frame to avctx/pkt as needed. + */ +int ff_encode_reordered_opaque(AVCodecContext *avctx, + AVPacket *pkt, const AVFrame *frame); + /* * Perform encoder initialization and validation. * Called when opening the encoder, before the FFCodec.init() call. */ int ff_encode_preinit(AVCodecContext *avctx); +int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, + AVFrame *frame, int *got_packet); + +/** + * Rescale from sample rate to AVCodecContext.time_base. + */ +static av_always_inline int64_t ff_samples_to_time_base(const AVCodecContext *avctx, + int64_t samples) +{ + if (samples == AV_NOPTS_VALUE) + return AV_NOPTS_VALUE; + return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate }, + avctx->time_base); +} + #endif /* AVCODEC_ENCODE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.c 2023-03-03 13:29:59.000000000 +0000 @@ -946,17 +946,17 @@ av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n"); for (i = 0; i < 2; i++) { - s->ref_index_buf[i] = av_buffer_allocz(s->mb_stride * s->mb_height * 4 * sizeof(uint8_t)); - s->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t)); - if (!s->ref_index_buf[i] || !s->motion_val_buf[i]) + s->ref_index[i] = av_calloc(s->mb_stride * s->mb_height, 4 * sizeof(uint8_t)); + s->motion_val_base[i] = av_calloc(size + 4, 2 * sizeof(uint16_t)); + if (!s->ref_index[i] || !s->motion_val_base[i]) break; - s->cur_pic.ref_index[i] = s->ref_index_buf[i]->data; - s->cur_pic.motion_val[i] = (int16_t (*)[2])s->motion_val_buf[i]->data + 4; + s->cur_pic.ref_index[i] = s->ref_index[i]; + s->cur_pic.motion_val[i] = s->motion_val_base[i] + 4; } if (i < 2) { for (i = 0; i < 2; i++) { - av_buffer_unref(&s->ref_index_buf[i]); - av_buffer_unref(&s->motion_val_buf[i]); + av_freep(&s->ref_index[i]); + av_freep(&s->motion_val_base[i]); s->cur_pic.ref_index[i] = NULL; s->cur_pic.motion_val[i] = NULL; } @@ -1343,8 +1343,8 @@ } for (i = 0; i < 2; i++) { - av_buffer_unref(&s->ref_index_buf[i]); - av_buffer_unref(&s->motion_val_buf[i]); + av_freep(&s->ref_index[i]); + av_freep(&s->motion_val_base[i]); s->cur_pic.ref_index[i] = NULL; s->cur_pic.motion_val[i] = NULL; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/error_resilience.h 2023-03-03 13:29:59.000000000 +0000 @@ -75,8 +75,8 @@ ERPicture last_pic; ERPicture next_pic; - AVBufferRef *ref_index_buf[2]; - AVBufferRef *motion_val_buf[2]; + int8_t *ref_index[2]; + int16_t (*motion_val_base[2])[2]; uint16_t pp_time; uint16_t pb_time; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape124.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape124.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape124.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape124.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef union MacroBlock { uint16_t pixels[4]; @@ -178,8 +178,8 @@ dst[4] = mb.pixels32[1]; } -static void copy_superblock(uint16_t* dest, unsigned dest_stride, - uint16_t* src, unsigned src_stride) +static void copy_superblock(uint16_t* dest, ptrdiff_t dest_stride, + uint16_t* src, ptrdiff_t src_stride) { unsigned y; if (src) @@ -211,7 +211,7 @@ superblocks_per_row = avctx->width / 8, skip = -1; uint16_t* old_frame_data, *new_frame_data; - unsigned old_stride, new_stride; + ptrdiff_t old_stride, new_stride; int ret; @@ -377,7 +377,7 @@ const FFCodec ff_escape124_decoder = { .p.name = "escape124", - .p.long_name = NULL_IF_CONFIG_SMALL("Escape 124"), + CODEC_LONG_NAME("Escape 124"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ESCAPE124, .priv_data_size = sizeof(Escape124Context), @@ -385,5 +385,4 @@ .close = escape124_decode_close, FF_CODEC_DECODE_CB(escape124_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape130.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape130.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape130.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/escape130.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,8 +25,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct Escape130Context { uint8_t *old_y_avg; @@ -347,7 +347,7 @@ const FFCodec ff_escape130_decoder = { .p.name = "escape130", - .p.long_name = NULL_IF_CONFIG_SMALL("Escape 130"), + CODEC_LONG_NAME("Escape 130"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ESCAPE130, .priv_data_size = sizeof(Escape130Context), @@ -355,5 +355,5 @@ .close = escape130_decode_close, FF_CODEC_DECODE_CB(escape130_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/evrcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/evrcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/evrcdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/evrcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "evrcdata.h" #include "acelp_vectors.h" @@ -221,8 +221,8 @@ static void warn_insufficient_frame_quality(AVCodecContext *avctx, const char *message) { - av_log(avctx, AV_LOG_WARNING, "Frame #%d, %s\n", - avctx->frame_number, message); + av_log(avctx, AV_LOG_WARNING, "Frame #%"PRId64", %s\n", + avctx->frame_num, message); } /** @@ -931,7 +931,7 @@ const FFCodec ff_evrc_decoder = { .p.name = "evrc", - .p.long_name = NULL_IF_CONFIG_SMALL("EVRC (Enhanced Variable Rate Codec)"), + CODEC_LONG_NAME("EVRC (Enhanced Variable Rate Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_EVRC, .init = evrc_decode_init, @@ -939,5 +939,4 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(EVRCContext), .p.priv_class = &evrcdec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exr.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,11 +36,12 @@ #include "libavutil/avassert.h" #include "libavutil/common.h" +#include "libavutil/csp.h" #include "libavutil/imgutils.h" #include "libavutil/intfloat.h" #include "libavutil/avstring.h" #include "libavutil/opt.h" -#include "libavutil/color_utils.h" +#include "libavutil/half2float.h" #include "avcodec.h" #include "bytestream.h" @@ -50,10 +51,9 @@ #endif #include "codec_internal.h" +#include "decode.h" #include "exrdsp.h" #include "get_bits.h" -#include "internal.h" -#include "half2float.h" #include "mathops.h" #include "thread.h" @@ -191,12 +191,12 @@ float gamma; union av_intfloat32 gamma_table[65536]; - uint32_t mantissatable[2048]; - uint32_t exponenttable[64]; - uint16_t offsettable[64]; + uint8_t *offset_table; + + Half2FloatTables h2f_tables; } EXRContext; -static int zip_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, +static int zip_uncompress(const EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { unsigned long dest_len = uncompressed_size; @@ -255,7 +255,7 @@ return 0; } -static int rle_uncompress(EXRContext *ctx, const uint8_t *src, int compressed_size, +static int rle_uncompress(const EXRContext *ctx, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { rle(td->tmp, src, compressed_size, uncompressed_size); @@ -365,7 +365,7 @@ return 0; } -static int huf_build_dec_table(EXRContext *s, +static int huf_build_dec_table(const EXRContext *s, EXRThreadData *td, int im, int iM) { int j = 0; @@ -440,7 +440,7 @@ return 0; } -static int huf_uncompress(EXRContext *s, +static int huf_uncompress(const EXRContext *s, EXRThreadData *td, GetByteContext *gb, uint16_t *dst, int dst_size) @@ -588,7 +588,7 @@ } } -static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, +static int piz_uncompress(const EXRContext *s, const uint8_t *src, int ssize, int dsize, EXRThreadData *td) { GetByteContext gb; @@ -674,7 +674,7 @@ return 0; } -static int pxr24_uncompress(EXRContext *s, const uint8_t *src, +static int pxr24_uncompress(const EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { @@ -809,7 +809,7 @@ } -static int b44_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, +static int b44_uncompress(const EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { const int8_t *sr = src; int stay_to_uncompress = compressed_size; @@ -832,20 +832,16 @@ if (s->channels[c].pixel_type == EXR_HALF) {/* B44 only compress half float data */ for (iY = 0; iY < nb_b44_block_h; iY++) { for (iX = 0; iX < nb_b44_block_w; iX++) {/* For each B44 block */ - if (stay_to_uncompress < 3) { - av_log(s, AV_LOG_ERROR, "Not enough data for B44A block: %d", stay_to_uncompress); + if (stay_to_uncompress < 3) return AVERROR_INVALIDDATA; - } if (src[compressed_size - stay_to_uncompress + 2] == 0xfc) { /* B44A block */ unpack_3(sr, tmp_buffer); sr += 3; stay_to_uncompress -= 3; } else {/* B44 Block */ - if (stay_to_uncompress < 14) { - av_log(s, AV_LOG_ERROR, "Not enough data for B44 block: %d", stay_to_uncompress); + if (stay_to_uncompress < 14) return AVERROR_INVALIDDATA; - } unpack_14(sr, tmp_buffer); sr += 14; stay_to_uncompress -= 14; @@ -867,10 +863,8 @@ } target_channel_offset += 2; } else {/* Float or UINT 32 channel */ - if (stay_to_uncompress < td->ysize * td->xsize * 4) { - av_log(s, AV_LOG_ERROR, "Not enough data for uncompress channel: %d", stay_to_uncompress); + if (stay_to_uncompress < td->ysize * td->xsize * 4) return AVERROR_INVALIDDATA; - } for (y = 0; y < td->ysize; y++) { index_out = target_channel_offset * td->xsize + y * td->channel_line_size; @@ -886,7 +880,7 @@ return 0; } -static int ac_uncompress(EXRContext *s, GetByteContext *gb, float *block) +static int ac_uncompress(const EXRContext *s, GetByteContext *gb, float *block) { int ret = 0, n = 1; @@ -899,10 +893,7 @@ n += val & 0xff; } else { ret = n; - block[ff_zigzag_direct[n]] = av_int2float(half2float(val, - s->mantissatable, - s->exponenttable, - s->offsettable)); + block[ff_zigzag_direct[n]] = av_int2float(half2float(val, &s->h2f_tables)); n++; } } @@ -986,7 +977,7 @@ } } -static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, +static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { int64_t version, lo_usize, lo_size; @@ -1120,8 +1111,7 @@ uint16_t *dc = (uint16_t *)td->dc_data; union av_intfloat32 dc_val; - dc_val.i = half2float(dc[idx], s->mantissatable, - s->exponenttable, s->offsettable); + dc_val.i = half2float(dc[idx], &s->h2f_tables); block[0] = dc_val.f; ac_uncompress(s, &agb, block); @@ -1171,7 +1161,7 @@ for (int x = 0; x < td->xsize; x++) { uint16_t ha = ai0[x] | (ai1[x] << 8); - ao[x] = half2float(ha, s->mantissatable, s->exponenttable, s->offsettable); + ao[x] = half2float(ha, &s->h2f_tables); } } @@ -1181,7 +1171,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) { - EXRContext *s = avctx->priv_data; + const EXRContext *s = avctx->priv_data; AVFrame *const p = s->picture; EXRThreadData *td = &s->thread_data[threadnr]; const uint8_t *channel_buffer[4] = { 0 }; @@ -1199,7 +1189,7 @@ int i, x, buf_size = s->buf_size; int c, rgb_channel_count; float one_gamma = 1.0f / s->gamma; - avpriv_trc_function trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type); + av_csp_trc_function trc_func = av_csp_trc_func_from_id(s->apply_trc_type); int ret; line_offset = AV_RL64(s->gb.buffer + jobnr * 8); @@ -1427,10 +1417,7 @@ } } else { for (x = 0; x < xsize; x++) { - ptr_x[0].i = half2float(bytestream_get_le16(&src), - s->mantissatable, - s->exponenttable, - s->offsettable); + ptr_x[0].i = half2float(bytestream_get_le16(&src), &s->h2f_tables); ptr_x++; } } @@ -1975,7 +1962,7 @@ { uint8_t name[256] = { 0 }; uint8_t type[256] = { 0 }; - uint8_t value[256] = { 0 }; + uint8_t value[8192] = { 0 }; int i = 0, size; while (bytestream2_get_bytes_left(gb) > 0 && @@ -1993,6 +1980,8 @@ size = bytestream2_get_le32(gb); bytestream2_get_buffer(gb, value, FFMIN(sizeof(value) - 1, size)); + if (size > sizeof(value) - 1) + bytestream2_skip(gb, size - (sizeof(value) - 1)); if (!strcmp(type, "string")) av_dict_set(&metadata, name, value, 0); } @@ -2041,7 +2030,6 @@ int nb_blocks; /* nb scanline or nb tile */ uint64_t start_offset_table; uint64_t start_next_scanline; - PutByteContext offset_table_writer; bytestream2_init(gb, avpkt->data, avpkt->size); @@ -2133,6 +2121,9 @@ ff_set_sar(s->avctx, av_d2q(av_int2float(s->sar), 255)); + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + s->desc = av_pix_fmt_desc_get(avctx->pix_fmt); if (!s->desc) return AVERROR_INVALIDDATA; @@ -2161,11 +2152,17 @@ // check offset table and recreate it if need if (!s->is_tile && bytestream2_peek_le64(gb) == 0) { + PutByteContext offset_table_writer; + av_log(s->avctx, AV_LOG_DEBUG, "recreating invalid scanline offset table\n"); + s->offset_table = av_realloc_f(s->offset_table, nb_blocks, 8); + if (!s->offset_table) + return AVERROR(ENOMEM); + start_offset_table = bytestream2_tell(gb); start_next_scanline = start_offset_table + nb_blocks * 8; - bytestream2_init_writer(&offset_table_writer, &avpkt->data[start_offset_table], nb_blocks * 8); + bytestream2_init_writer(&offset_table_writer, s->offset_table, nb_blocks * 8); for (y = 0; y < nb_blocks; y++) { /* write offset of prev scanline in offset table */ @@ -2175,7 +2172,7 @@ bytestream2_seek(gb, start_next_scanline + 4, SEEK_SET);/* skip line number */ start_next_scanline += (bytestream2_get_le32(gb) + 8); } - bytestream2_seek(gb, start_offset_table, SEEK_SET); + bytestream2_init(gb, s->offset_table, nb_blocks * 8); } // save pointer we are going to use in decode_block @@ -2218,9 +2215,9 @@ uint32_t i; union av_intfloat32 t; float one_gamma = 1.0f / s->gamma; - avpriv_trc_function trc_func = NULL; + av_csp_trc_function trc_func = NULL; - half2float_table(s->mantissatable, s->exponenttable, s->offsettable); + ff_init_half2float_tables(&s->h2f_tables); s->avctx = avctx; @@ -2230,21 +2227,21 @@ ff_bswapdsp_init(&s->bbdsp); #endif - trc_func = avpriv_get_trc_function_from_trc(s->apply_trc_type); + trc_func = av_csp_trc_func_from_id(s->apply_trc_type); if (trc_func) { for (i = 0; i < 65536; ++i) { - t.i = half2float(i, s->mantissatable, s->exponenttable, s->offsettable); + t.i = half2float(i, &s->h2f_tables); t.f = trc_func(t.f); s->gamma_table[i] = t; } } else { if (one_gamma > 0.9999f && one_gamma < 1.0001f) { for (i = 0; i < 65536; ++i) { - s->gamma_table[i].i = half2float(i, s->mantissatable, s->exponenttable, s->offsettable); + s->gamma_table[i].i = half2float(i, &s->h2f_tables); } } else { for (i = 0; i < 65536; ++i) { - t.i = half2float(i, s->mantissatable, s->exponenttable, s->offsettable); + t.i = half2float(i, &s->h2f_tables); /* If negative value we reuse half value */ if (t.f <= 0.0f) { s->gamma_table[i] = t; @@ -2285,6 +2282,7 @@ av_freep(&s->thread_data); av_freep(&s->channels); + av_freep(&s->offset_table); return 0; } @@ -2347,7 +2345,7 @@ const FFCodec ff_exr_decoder = { .p.name = "exr", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), + CODEC_LONG_NAME("OpenEXR image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_EXR, .priv_data_size = sizeof(EXRContext), @@ -2356,6 +2354,6 @@ FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.priv_class = &exr_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exrenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exrenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exrenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/exrenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,11 +31,11 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" enum ExrCompr { EXR_RAW, @@ -87,15 +87,14 @@ EXRScanlineData *scanline; - uint16_t basetable[512]; - uint8_t shifttable[512]; + Float2HalfTables f2h_tables; } EXRContext; static av_cold int encode_init(AVCodecContext *avctx) { EXRContext *s = avctx->priv_data; - float2half_tables(s->basetable, s->shifttable); + ff_init_float2half_tables(&s->f2h_tables); switch (avctx->pix_fmt) { case AV_PIX_FMT_GBRPF32: @@ -253,10 +252,10 @@ for (int p = 0; p < s->planes; p++) { int ch = s->ch_order[p]; uint16_t *dst = (uint16_t *)(scanline->uncompressed_data + frame->width * 2 * p); - uint32_t *src = (uint32_t *)(frame->data[ch] + y * frame->linesize[ch]); + const uint32_t *src = (const uint32_t *)(frame->data[ch] + y * frame->linesize[ch]); for (int x = 0; x < frame->width; x++) - dst[x] = float2half(src[x], s->basetable, s->shifttable); + dst[x] = float2half(src[x], &s->f2h_tables); } break; } @@ -321,10 +320,10 @@ for (int p = 0; p < s->planes; p++) { int ch = s->ch_order[p]; uint16_t *dst = (uint16_t *)(scanline->uncompressed_data + scanline_size * l + p * frame->width * 2); - uint32_t *src = (uint32_t *)(frame->data[ch] + (y * s->scanline_height + l) * frame->linesize[ch]); + const uint32_t *src = (const uint32_t *)(frame->data[ch] + (y * s->scanline_height + l) * frame->linesize[ch]); for (int x = 0; x < frame->width; x++) - dst[x] = float2half(src[x], s->basetable, s->shifttable); + dst[x] = float2half(src[x], &s->f2h_tables); } } break; @@ -479,10 +478,10 @@ bytestream2_put_le32(pb, s->planes * avctx->width * 2); for (int p = 0; p < s->planes; p++) { int ch = s->ch_order[p]; - uint32_t *src = (uint32_t *)(frame->data[ch] + y * frame->linesize[ch]); + const uint32_t *src = (const uint32_t *)(frame->data[ch] + y * frame->linesize[ch]); for (int x = 0; x < frame->width; x++) - bytestream2_put_le16(pb, float2half(src[x], s->basetable, s->shifttable)); + bytestream2_put_le16(pb, float2half(src[x], &s->f2h_tables)); } } } @@ -543,12 +542,13 @@ const FFCodec ff_exr_encoder = { .p.name = "exr", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), + CODEC_LONG_NAME("OpenEXR image"), .priv_data_size = sizeof(EXRContext), .p.priv_class = &exr_class, .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_EXR, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_close, @@ -557,5 +557,4 @@ AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fastaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fastaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fastaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fastaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/intreadwrite.h" - #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" -#include "mathops.h" +#include "decode.h" typedef struct ChannelItems { float f[8]; @@ -189,7 +186,7 @@ const FFCodec ff_fastaudio_decoder = { .p.name = "fastaudio", - .p.long_name = NULL_IF_CONFIG_SMALL("MobiClip FastAudio"), + CODEC_LONG_NAME("MobiClip FastAudio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_FASTAUDIO, .priv_data_size = sizeof(FastAudioContext), @@ -199,5 +196,4 @@ .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_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2022 Niklas Haas + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/csp.h" + +#include "fflcms2.h" + +static void log_cb(cmsContext ctx, cmsUInt32Number error, const char *str) +{ + FFIccContext *s = cmsGetContextUserData(ctx); + av_log(s->avctx, AV_LOG_ERROR, "lcms2: [%"PRIu32"] %s\n", error, str); +} + +int ff_icc_context_init(FFIccContext *s, void *avctx) +{ + memset(s, 0, sizeof(*s)); + s->avctx = avctx; + s->ctx = cmsCreateContext(NULL, s); + if (!s->ctx) + return AVERROR(ENOMEM); + + cmsSetLogErrorHandlerTHR(s->ctx, log_cb); + return 0; +} + +void ff_icc_context_uninit(FFIccContext *s) +{ + for (int i = 0; i < FF_ARRAY_ELEMS(s->curves); i++) + cmsFreeToneCurve(s->curves[i]); + cmsDeleteContext(s->ctx); + memset(s, 0, sizeof(*s)); +} + +static int get_curve(FFIccContext *s, enum AVColorTransferCharacteristic trc, + cmsToneCurve **out_curve) +{ + if (trc >= AVCOL_TRC_NB) + return AVERROR_INVALIDDATA; + + if (s->curves[trc]) + goto done; + + switch (trc) { + case AVCOL_TRC_LINEAR: + s->curves[trc] = cmsBuildGamma(s->ctx, 1.0); + break; + case AVCOL_TRC_GAMMA22: + s->curves[trc] = cmsBuildGamma(s->ctx, 2.2); + break; + case AVCOL_TRC_GAMMA28: + s->curves[trc] = cmsBuildGamma(s->ctx, 2.8); + break; + case AVCOL_TRC_BT709: + case AVCOL_TRC_SMPTE170M: + case AVCOL_TRC_BT2020_10: + case AVCOL_TRC_BT2020_12: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { + /* γ = */ 1/0.45, + /* a = */ 1/1.099296826809442, + /* b = */ 1 - 1/1.099296826809442, + /* c = */ 1/4.5, + /* d = */ 4.5 * 0.018053968510807, + }); + break; + case AVCOL_TRC_SMPTE240M: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { + /* γ = */ 1/0.45, + /* a = */ 1/1.1115, + /* b = */ 1 - 1/1.1115, + /* c = */ 1/4.0, + /* d = */ 4.0 * 0.0228, + }); + break; + case AVCOL_TRC_LOG: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 8, (double[5]) { + /* a = */ 1.0, + /* b = */ 10.0, + /* c = */ 2.0, + /* d = */ -1.0, + /* e = */ 0.0 + }); + break; + case AVCOL_TRC_LOG_SQRT: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 8, (double[5]) { + /* a = */ 1.0, + /* b = */ 10.0, + /* c = */ 2.5, + /* d = */ -1.0, + /* e = */ 0.0 + }); + break; + case AVCOL_TRC_IEC61966_2_1: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { + /* γ = */ 2.4, + /* a = */ 1/1.055, + /* b = */ 1 - 1/1.055, + /* c = */ 1/12.92, + /* d = */ 12.92 * 0.0031308, + }); + break; + case AVCOL_TRC_SMPTE428: + s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 2, (double[3]) { + /* γ = */ 2.6, + /* a = */ pow(52.37/48.0, 1/2.6), + /* b = */ 0.0 + }); + break; + + /* Can't be represented using the existing parametric tone curves. + * FIXME: use cmsBuildTabulatedToneCurveFloat instead */ + case AVCOL_TRC_IEC61966_2_4: + case AVCOL_TRC_BT1361_ECG: + case AVCOL_TRC_SMPTE2084: + case AVCOL_TRC_ARIB_STD_B67: + return AVERROR_PATCHWELCOME; + + default: + return AVERROR_INVALIDDATA; + } + + if (!s->curves[trc]) + return AVERROR(ENOMEM); + +done: + *out_curve = s->curves[trc]; + return 0; +} + +int ff_icc_profile_generate(FFIccContext *s, + enum AVColorPrimaries color_prim, + enum AVColorTransferCharacteristic color_trc, + cmsHPROFILE *out_profile) +{ + cmsToneCurve *tonecurve; + const AVColorPrimariesDesc *prim; + int ret; + + if (!(prim = av_csp_primaries_desc_from_id(color_prim))) + return AVERROR_INVALIDDATA; + if ((ret = get_curve(s, color_trc, &tonecurve)) < 0) + return ret; + + *out_profile = cmsCreateRGBProfileTHR(s->ctx, + &(cmsCIExyY) { av_q2d(prim->wp.x), av_q2d(prim->wp.y), 1.0 }, + &(cmsCIExyYTRIPLE) { + .Red = { av_q2d(prim->prim.r.x), av_q2d(prim->prim.r.y), 1.0 }, + .Green = { av_q2d(prim->prim.g.x), av_q2d(prim->prim.g.y), 1.0 }, + .Blue = { av_q2d(prim->prim.b.x), av_q2d(prim->prim.b.y), 1.0 }, + }, + (cmsToneCurve *[3]) { tonecurve, tonecurve, tonecurve } + ); + + return *out_profile == NULL ? AVERROR(ENOMEM) : 0; +} + +int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame) +{ + cmsUInt32Number size; + AVBufferRef *buf; + + if (!cmsSaveProfileToMem(profile, NULL, &size)) + return AVERROR_EXTERNAL; + + buf = av_buffer_alloc(size); + if (!buf) + return AVERROR(ENOMEM); + + if (!cmsSaveProfileToMem(profile, buf->data, &size) || size != buf->size) { + av_buffer_unref(&buf); + return AVERROR_EXTERNAL; + } + + if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, buf)) { + av_buffer_unref(&buf); + return AVERROR(ENOMEM); + } + + return 0; +} + +static av_always_inline void XYZ_xy(cmsCIEXYZ XYZ, AVCIExy *xy) +{ + double k = 1.0 / (XYZ.X + XYZ.Y + XYZ.Z); + xy->x = av_d2q(k * XYZ.X, 100000); + xy->y = av_d2q(k * XYZ.Y, 100000); +} + +int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, + AVColorPrimariesDesc *out_primaries) +{ + static const uint8_t testprimaries[4][3] = { + { 0xFF, 0, 0 }, /* red */ + { 0, 0xFF, 0 }, /* green */ + { 0, 0, 0xFF }, /* blue */ + { 0xFF, 0xFF, 0xFF }, /* white */ + }; + + AVWhitepointCoefficients *wp = &out_primaries->wp; + AVPrimaryCoefficients *prim = &out_primaries->prim; + cmsFloat64Number prev_adapt; + cmsHPROFILE xyz; + cmsHTRANSFORM tf; + cmsCIEXYZ dst[4]; + + xyz = cmsCreateXYZProfileTHR(s->ctx); + if (!xyz) + return AVERROR(ENOMEM); + + /* We need to use an unadapted observer to get the raw values */ + prev_adapt = cmsSetAdaptationStateTHR(s->ctx, 0.0); + tf = cmsCreateTransformTHR(s->ctx, profile, TYPE_RGB_8, xyz, TYPE_XYZ_DBL, + INTENT_ABSOLUTE_COLORIMETRIC, + /* Note: These flags mostly don't do anything + * anyway, but specify them regardless */ + cmsFLAGS_NOCACHE | + cmsFLAGS_NOOPTIMIZE | + cmsFLAGS_LOWRESPRECALC | + cmsFLAGS_GRIDPOINTS(2)); + cmsSetAdaptationStateTHR(s->ctx, prev_adapt); + cmsCloseProfile(xyz); + if (!tf) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid ICC profile (e.g. CMYK)\n"); + return AVERROR_INVALIDDATA; + } + + cmsDoTransform(tf, testprimaries, dst, 4); + cmsDeleteTransform(tf); + XYZ_xy(dst[0], &prim->r); + XYZ_xy(dst[1], &prim->g); + XYZ_xy(dst[2], &prim->b); + XYZ_xy(dst[3], wp); + return 0; +} + +int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, + enum AVColorTransferCharacteristic *out_trc) +{ + /* 8-bit linear grayscale ramp */ + static const uint8_t testramp[16][3] = { + { 1, 1, 1}, /* avoid exact zero due to log100 etc. */ + { 17, 17, 17}, + { 34, 34, 34}, + { 51, 51, 51}, + { 68, 68, 68}, + { 85, 85, 85}, + { 02, 02, 02}, + {119, 119, 119}, + {136, 136, 136}, + {153, 153, 153}, + {170, 170, 170}, + {187, 187, 187}, + {204, 204, 204}, + {221, 221, 221}, + {238, 238, 238}, + {255, 255, 255}, + }; + + double dst[FF_ARRAY_ELEMS(testramp)]; + + for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_NB; trc++) { + cmsToneCurve *tonecurve; + cmsHPROFILE ref; + cmsHTRANSFORM tf; + double delta = 0.0; + if (get_curve(s, trc, &tonecurve) < 0) + continue; + + ref = cmsCreateGrayProfileTHR(s->ctx, cmsD50_xyY(), tonecurve); + if (!ref) + return AVERROR(ENOMEM); + + tf = cmsCreateTransformTHR(s->ctx, profile, TYPE_RGB_8, ref, TYPE_GRAY_DBL, + INTENT_RELATIVE_COLORIMETRIC, + cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE); + cmsCloseProfile(ref); + if (!tf) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid ICC profile (e.g. CMYK)\n"); + return AVERROR_INVALIDDATA; + } + + cmsDoTransform(tf, testramp, dst, FF_ARRAY_ELEMS(dst)); + cmsDeleteTransform(tf); + + for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) + delta += fabs(testramp[i][0] / 255.0 - dst[i]); + if (delta < 0.01) { + *out_trc = trc; + return 0; + } + } + + *out_trc = AVCOL_TRC_UNSPECIFIED; + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fflcms2.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2022 Niklas Haas + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Various functions for dealing with ICC profiles + */ + +#ifndef AVCODEC_FFLCMS2_H +#define AVCODEC_FFLCMS2_H + +#include "libavutil/csp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + +#include + +typedef struct FFIccContext { + void *avctx; + cmsContext ctx; + cmsToneCurve *curves[AVCOL_TRC_NB]; /* tone curve cache */ +} FFIccContext; + +/** + * Initializes an FFIccContext. This must be done prior to using it. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_context_init(FFIccContext *s, void *avctx); +void ff_icc_context_uninit(FFIccContext *s); + +/** + * Generate an ICC profile for a given combination of color primaries and + * transfer function. Both values must be set to valid entries (not + * "undefined") for this function to work. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_generate(FFIccContext *s, + enum AVColorPrimaries color_prim, + enum AVColorTransferCharacteristic color_trc, + cmsHPROFILE *out_profile); + +/** + * Attach an ICC profile to a frame. Helper wrapper around cmsSaveProfileToMem + * and av_frame_new_side_data_from_buf. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); + +/** + * Read the color primaries and white point coefficients encoded by an ICC + * profile, and return the raw values in `out_primaries`. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, + AVColorPrimariesDesc *out_primaries); + +/** + * Attempt detecting the transfer characteristic that best approximates the + * transfer function encoded by an ICC profile. Sets `out_trc` to + * AVCOL_TRC_UNSPECIFIED if no clear match can be identified. + * + * Returns 0 on success (including no match), or a negative error code. + */ +int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, + enum AVColorTransferCharacteristic *out_trc); + +#endif /* AVCODEC_FFLCMS2_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fft.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fft.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fft.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fft.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include #include "config.h" +#include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" #if FFT_FLOAT @@ -114,7 +115,7 @@ #endif #define COSTABLE(size) \ - COSTABLE_CONST DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2] + COSTABLE_CONST attribute_visibility_hidden DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2] extern COSTABLE(16); extern COSTABLE(32); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,11 +43,6 @@ s->avctx = avctx; s->flags = avctx->flags; - s->picture.f = av_frame_alloc(); - s->last_picture.f = av_frame_alloc(); - if (!s->picture.f || !s->last_picture.f) - return AVERROR(ENOMEM); - s->width = avctx->width; s->height = avctx->height; @@ -198,14 +193,6 @@ FFV1Context *s = avctx->priv_data; int i, j; - if (s->picture.f) - ff_thread_release_ext_buffer(avctx, &s->picture); - av_frame_free(&s->picture.f); - - if (s->last_picture.f) - ff_thread_release_ext_buffer(avctx, &s->last_picture); - av_frame_free(&s->last_picture.f); - for (j = 0; j < s->max_slice_count; j++) { FFV1Context *fs = s->slice_context[j]; for (i = 0; i < s->plane_count; i++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -168,24 +168,31 @@ RangeCoder *c = &fs->c; uint8_t state[CONTEXT_SIZE]; unsigned ps, i, context_count; + int sx, sy, sw, sh; + memset(state, 128, sizeof(state)); + sx = get_symbol(c, state, 0); + sy = get_symbol(c, state, 0); + sw = get_symbol(c, state, 0) + 1U; + sh = get_symbol(c, state, 0) + 1U; av_assert0(f->version > 2); - fs->slice_x = get_symbol(c, state, 0) * f->width ; - fs->slice_y = get_symbol(c, state, 0) * f->height; - fs->slice_width = (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x; - fs->slice_height = (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y; - - fs->slice_x /= f->num_h_slices; - fs->slice_y /= f->num_v_slices; - fs->slice_width = fs->slice_width /f->num_h_slices - fs->slice_x; - fs->slice_height = fs->slice_height/f->num_v_slices - fs->slice_y; - if ((unsigned)fs->slice_width > f->width || (unsigned)fs->slice_height > f->height) - return -1; - if ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width > f->width - || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height) - return -1; + + if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0) + return AVERROR_INVALIDDATA; + if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh) + return AVERROR_INVALIDDATA; + + fs->slice_x = sx * (int64_t)f->width / f->num_h_slices; + fs->slice_y = sy * (int64_t)f->height / f->num_v_slices; + fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x; + fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y; + + av_assert0((unsigned)fs->slice_width <= f->width && + (unsigned)fs->slice_height <= f->height); + av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width + && (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height); if (fs->ac == AC_GOLOMB_RICE && fs->slice_width >= (1<<23)) return AVERROR_INVALIDDATA; @@ -303,8 +310,11 @@ } if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0) return ret; - if (f->cur->key_frame || fs->slice_reset_contexts) + if (f->cur->key_frame || fs->slice_reset_contexts) { ff_ffv1_clear_slice_state(f, fs); + } else if (fs->slice_damaged) { + return AVERROR_INVALIDDATA; + } width = fs->slice_width; height = fs->slice_height; @@ -360,8 +370,6 @@ } } - emms_c(); - ff_thread_report_progress(&f->picture, si, 0); return 0; @@ -467,6 +475,11 @@ return AVERROR_INVALIDDATA; } + if (f->num_h_slices > MAX_SLICES / f->num_v_slices) { + av_log(f->avctx, AV_LOG_ERROR, "slice count unsupported\n"); + return AVERROR_PATCHWELCOME; + } + f->quant_table_count = get_symbol(c, state, 0); if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) { av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count); @@ -769,21 +782,25 @@ fs->slice_damaged = 0; if (f->version == 2) { - fs->slice_x = get_symbol(c, state, 0) * f->width ; - fs->slice_y = get_symbol(c, state, 0) * f->height; - fs->slice_width = (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x; - fs->slice_height = (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y; - - fs->slice_x /= f->num_h_slices; - fs->slice_y /= f->num_v_slices; - fs->slice_width = fs->slice_width / f->num_h_slices - fs->slice_x; - fs->slice_height = fs->slice_height / f->num_v_slices - fs->slice_y; - if ((unsigned)fs->slice_width > f->width || - (unsigned)fs->slice_height > f->height) + int sx = get_symbol(c, state, 0); + int sy = get_symbol(c, state, 0); + int sw = get_symbol(c, state, 0) + 1U; + int sh = get_symbol(c, state, 0) + 1U; + + if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0) return AVERROR_INVALIDDATA; - if ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width > f->width - || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height) + if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh) return AVERROR_INVALIDDATA; + + fs->slice_x = sx * (int64_t)f->width / f->num_h_slices; + fs->slice_y = sy * (int64_t)f->height / f->num_v_slices; + fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x; + fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y; + + av_assert0((unsigned)fs->slice_width <= f->width && + (unsigned)fs->slice_height <= f->height); + av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width + && (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height); } for (i = 0; i < f->plane_count; i++) { @@ -825,6 +842,11 @@ if ((ret = ff_ffv1_common_init(avctx)) < 0) return ret; + f->picture.f = av_frame_alloc(); + f->last_picture.f = av_frame_alloc(); + if (!f->picture.f || !f->last_picture.f) + return AVERROR(ENOMEM); + if (avctx->extradata_size > 0 && (ret = read_extra_header(f)) < 0) return ret; @@ -1070,18 +1092,34 @@ } #endif +static av_cold int ffv1_decode_close(AVCodecContext *avctx) +{ + FFV1Context *const s = avctx->priv_data; + + if (s->picture.f) { + ff_thread_release_ext_buffer(avctx, &s->picture); + av_frame_free(&s->picture.f); + } + + if (s->last_picture.f) { + ff_thread_release_ext_buffer(avctx, &s->last_picture); + av_frame_free(&s->last_picture.f); + } + return ff_ffv1_close(avctx); +} + const FFCodec ff_ffv1_decoder = { .p.name = "ffv1", - .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), + CODEC_LONG_NAME("FFmpeg video codec #1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFV1, .priv_data_size = sizeof(FFV1Context), .init = decode_init, - .close = ff_ffv1_close, + .close = ffv1_decode_close, FF_CODEC_DECODE_CB(decode_frame), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ | + UPDATE_THREAD_CONTEXT(update_thread_context), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1dec_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "ffv1_template.c" + static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w, TYPE *sample[2], int plane_index, int bits) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -270,7 +270,7 @@ #define RENAME(name) name ## 32 #include "ffv1enc_template.c" -static int encode_plane(FFV1Context *s, uint8_t *src, int w, int h, +static int encode_plane(FFV1Context *s, const uint8_t *src, int w, int h, int stride, int plane_index, int pixel_stride) { int x, y, i, ret; @@ -916,12 +916,12 @@ put_symbol(c, state, f->plane[j].quant_table_index, 0); av_assert0(f->plane[j].quant_table_index == f->context_model); } - if (!f->picture.f->interlaced_frame) + if (!f->cur_enc_frame->interlaced_frame) put_symbol(c, state, 3, 0); else - put_symbol(c, state, 1 + !f->picture.f->top_field_first, 0); - put_symbol(c, state, f->picture.f->sample_aspect_ratio.num, 0); - put_symbol(c, state, f->picture.f->sample_aspect_ratio.den, 0); + put_symbol(c, state, 1 + !f->cur_enc_frame->top_field_first, 0); + put_symbol(c, state, f->cur_enc_frame->sample_aspect_ratio.num, 0); + put_symbol(c, state, f->cur_enc_frame->sample_aspect_ratio.den, 0); if (f->version > 3) { put_rac(c, state, fs->slice_coding_mode == 1); if (fs->slice_coding_mode == 1) @@ -1024,7 +1024,7 @@ int height = fs->slice_height; int x = fs->slice_x; int y = fs->slice_y; - const AVFrame *const p = f->picture.f; + const AVFrame *const p = f->cur_enc_frame; const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step; int ret; RangeCoder c_bak = fs->c; @@ -1076,7 +1076,6 @@ } else { ret = encode_rgb_frame(fs, planes, width, height, p->linesize); } - emms_c(); if (ret < 0) { av_assert0(fs->slice_coding_mode == 0); @@ -1098,7 +1097,6 @@ { FFV1Context *f = avctx->priv_data; RangeCoder *const c = &f->slice_context[0]->c; - AVFrame *const p = f->picture.f; uint8_t keystate = 128; uint8_t *buf_p; int i, ret; @@ -1165,9 +1163,7 @@ ff_init_range_encoder(c, pkt->data, pkt->size); ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8); - av_frame_unref(p); - if ((ret = av_frame_ref(p, pict)) < 0) - return ret; + f->cur_enc_frame = pict; if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) { put_rac(c, &keystate, 1); @@ -1235,20 +1231,12 @@ f->picture_number++; pkt->size = buf_p - pkt->data; - pkt->pts = - pkt->dts = pict->pts; pkt->flags |= AV_PKT_FLAG_KEY * f->key_frame; *got_packet = 1; return 0; } -static av_cold int encode_close(AVCodecContext *avctx) -{ - ff_ffv1_close(avctx); - return 0; -} - #define OFFSET(x) offsetof(FFV1Context, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { @@ -1278,14 +1266,16 @@ const FFCodec ff_ffv1_encoder = { .p.name = "ffv1", - .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), + CODEC_LONG_NAME("FFmpeg video codec #1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFV1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(FFV1Context), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), - .close = encode_close, - .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY, + .close = ff_ffv1_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, @@ -1310,5 +1300,5 @@ }, .p.priv_class = &ffv1_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1enc_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "ffv1_template.c" + static av_always_inline int RENAME(encode_line)(FFV1Context *s, int w, TYPE *sample[3], int plane_index, int bits) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffv1.h 2023-03-03 13:29:59.000000000 +0000 @@ -85,12 +85,13 @@ int chroma_h_shift, chroma_v_shift; int transparency; int flags; - int picture_number; + int64_t picture_number; int key_frame; ThreadFrame picture, last_picture; struct FFV1Context *fsrc; AVFrame *cur; + const AVFrame *cur_enc_frame; int plane_count; int ac; ///< 1=range coder <-> 0=golomb rice int ac_byte_count; ///< number of bytes used for AC coding @@ -181,16 +182,4 @@ state->count = count; } -#define TYPE int16_t -#define RENAME(name) name -#include "ffv1_template.c" -#undef TYPE -#undef RENAME - -#define TYPE int32_t -#define RENAME(name) name ## 32 -#include "ffv1_template.c" -#undef TYPE -#undef RENAME - #endif /* AVCODEC_FFV1_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffwavesynth.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffwavesynth.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffwavesynth.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ffwavesynth.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "libavutil/log.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define SIN_BITS 14 @@ -461,7 +461,7 @@ const FFCodec ff_ffwavesynth_decoder = { .p.name = "wavesynth", - .p.long_name = NULL_IF_CONFIG_SMALL("Wave synthesis pseudo-codec"), + CODEC_LONG_NAME("Wave synthesis pseudo-codec"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_FFWAVESYNTH, .priv_data_size = sizeof(struct wavesynth_context), @@ -469,5 +469,5 @@ .close = wavesynth_close, FF_CODEC_DECODE_CB(wavesynth_decode), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fic.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fic.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fic.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fic.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "golomb.h" @@ -486,7 +486,7 @@ const FFCodec ff_fic_decoder = { .p.name = "fic", - .p.long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"), + CODEC_LONG_NAME("Mirillis FIC"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FIC, .priv_data_size = sizeof(FICContext), @@ -495,5 +495,4 @@ .close = fic_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .p.priv_class = &fic_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" @@ -326,7 +326,7 @@ .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FITS, .p.capabilities = AV_CODEC_CAP_DR1, - .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), + CODEC_LONG_NAME("Flexible Image Transport System"), .p.priv_class = &fits_decoder_class, .priv_data_size = sizeof(FITSContext), FF_CODEC_DECODE_CB(fits_decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fitsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,10 +36,9 @@ #include "encode.h" static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt, - const AVFrame *pict, int *got_packet) + const AVFrame *p, int *got_packet) { - AVFrame * const p = (AVFrame *)pict; - uint8_t *bytestream, *ptr; + uint8_t *bytestream; const uint16_t flip = (1 << 15); uint64_t data_size = 0, padded_data_size = 0; int ret, bitpix, naxis3 = 1, i, j, k, bytes_left; @@ -88,7 +87,7 @@ for (k = 0; k < naxis3; k++) { for (i = 0; i < avctx->height; i++) { - ptr = p->data[map[k]] + (avctx->height - i - 1) * p->linesize[map[k]]; + const uint8_t *ptr = p->data[map[k]] + (avctx->height - i - 1) * p->linesize[map[k]]; if (bitpix == 16) { for (j = 0; j < avctx->width; j++) { // subtracting bzero is equivalent to first bit flip @@ -112,10 +111,10 @@ const FFCodec ff_fits_encoder = { .p.name = "fits", - .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), + CODEC_LONG_NAME("Flexible Image Transport System"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FITS, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(fits_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRAP16BE, AV_PIX_FMT_GBRP16BE, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,9 @@ #include "get_bits.h" #include "flac.h" #include "flacdata.h" +#include "flac_parse.h" -static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 }; +static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 32 }; static const AVChannelLayout flac_channel_layouts[8] = { AV_CHANNEL_LAYOUT_MONO, @@ -81,7 +82,7 @@ /* bits per sample */ bps_code = get_bits(gb, 3); - if (bps_code == 3 || bps_code == 7) { + if (bps_code == 3) { av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sample size code (%d)\n", bps_code); @@ -145,29 +146,7 @@ return 0; } -int ff_flac_get_max_frame_size(int blocksize, int ch, int bps) -{ - /* Technically, there is no limit to FLAC frame size, but an encoder - should not write a frame that is larger than if verbatim encoding mode - were to be used. */ - - int count; - - count = 16; /* frame header */ - count += ch * ((7+bps+7)/8); /* subframe headers */ - if (ch == 2) { - /* for stereo, need to account for using decorrelation */ - count += (( 2*bps+1) * blocksize + 7) / 8; - } else { - count += ( ch*bps * blocksize + 7) / 8; - } - count += 2; /* frame footer */ - - return count; -} - int ff_flac_is_extradata_valid(AVCodecContext *avctx, - enum FLACExtradataFormat *format, uint8_t **streaminfo_start) { if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) { @@ -180,14 +159,12 @@ av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n", FLAC_STREAMINFO_SIZE-avctx->extradata_size); } - *format = FLAC_EXTRADATA_FORMAT_STREAMINFO; *streaminfo_start = avctx->extradata; } else { if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) { av_log(avctx, AV_LOG_ERROR, "extradata too small.\n"); return 0; } - *format = FLAC_EXTRADATA_FORMAT_FULL_HEADER; *streaminfo_start = &avctx->extradata[8]; } return 1; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,13 +44,14 @@ #include "flac.h" #include "flacdata.h" #include "flacdsp.h" +#include "flac_parse.h" #include "thread.h" #include "unary.h" typedef struct FLACContext { AVClass *class; - struct FLACStreaminfo flac_stream_info; + FLACStreaminfo stream_info; AVCodecContext *avctx; ///< parent AVCodecContext GetBitContext gb; ///< GetBitContext initialized to start at the current frame @@ -63,6 +64,9 @@ int32_t *decoded[FLAC_MAX_CHANNELS]; ///< decoded samples uint8_t *decoded_buffer; unsigned int decoded_buffer_size; + int64_t *decoded_33bps; ///< decoded samples for a 33 bps subframe + uint8_t *decoded_buffer_33bps; + unsigned int decoded_buffer_size_33bps; int buggy_lpc; ///< use workaround for old lavc encoded files FLACDSPContext dsp; @@ -73,7 +77,7 @@ static void flac_set_bps(FLACContext *s) { enum AVSampleFormat req = s->avctx->request_sample_fmt; - int need32 = s->flac_stream_info.bps > 16; + int need32 = s->stream_info.bps > 16; int want32 = av_get_bytes_per_sample(req) > 2; int planar = av_sample_fmt_is_planar(req); @@ -82,19 +86,18 @@ s->avctx->sample_fmt = AV_SAMPLE_FMT_S32P; else s->avctx->sample_fmt = AV_SAMPLE_FMT_S32; - s->sample_shift = 32 - s->flac_stream_info.bps; + s->sample_shift = 32 - s->stream_info.bps; } else { if (planar) s->avctx->sample_fmt = AV_SAMPLE_FMT_S16P; else s->avctx->sample_fmt = AV_SAMPLE_FMT_S16; - s->sample_shift = 16 - s->flac_stream_info.bps; + s->sample_shift = 16 - s->stream_info.bps; } } static av_cold int flac_decode_init(AVCodecContext *avctx) { - enum FLACExtradataFormat format; uint8_t *streaminfo; int ret; FLACContext *s = avctx->priv_data; @@ -105,11 +108,11 @@ if (!avctx->extradata) return 0; - if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo)) + if (!ff_flac_is_extradata_valid(avctx, &streaminfo)) return AVERROR_INVALIDDATA; /* initialize based on the demuxer-supplied streamdata header */ - ret = ff_flac_parse_streaminfo(avctx, &s->flac_stream_info, streaminfo); + ret = ff_flac_parse_streaminfo(avctx, &s->stream_info, streaminfo); if (ret < 0) return ret; ret = allocate_buffers(s); @@ -117,7 +120,7 @@ return ret; flac_set_bps(s); ff_flacdsp_init(&s->dsp, avctx->sample_fmt, - s->flac_stream_info.channels, s->flac_stream_info.bps); + s->stream_info.channels); s->got_streaminfo = 1; return 0; @@ -137,10 +140,10 @@ int buf_size; int ret; - av_assert0(s->flac_stream_info.max_blocksize); + av_assert0(s->stream_info.max_blocksize); - buf_size = av_samples_get_buffer_size(NULL, s->flac_stream_info.channels, - s->flac_stream_info.max_blocksize, + buf_size = av_samples_get_buffer_size(NULL, s->stream_info.channels, + s->stream_info.max_blocksize, AV_SAMPLE_FMT_S32P, 0); if (buf_size < 0) return buf_size; @@ -151,9 +154,27 @@ ret = av_samples_fill_arrays((uint8_t **)s->decoded, NULL, s->decoded_buffer, - s->flac_stream_info.channels, - s->flac_stream_info.max_blocksize, + s->stream_info.channels, + s->stream_info.max_blocksize, AV_SAMPLE_FMT_S32P, 0); + if (ret >= 0 && s->stream_info.bps == 32 && s->stream_info.channels == 2) { + buf_size = av_samples_get_buffer_size(NULL, 1, + s->stream_info.max_blocksize, + AV_SAMPLE_FMT_S64P, 0); + if (buf_size < 0) + return buf_size; + + av_fast_malloc(&s->decoded_buffer_33bps, &s->decoded_buffer_size_33bps, buf_size); + if (!s->decoded_buffer_33bps) + return AVERROR(ENOMEM); + + ret = av_samples_fill_arrays((uint8_t **)&s->decoded_33bps, NULL, + s->decoded_buffer_33bps, + 1, + s->stream_info.max_blocksize, + AV_SAMPLE_FMT_S64P, 0); + + } return ret < 0 ? ret : 0; } @@ -177,7 +198,7 @@ metadata_size != FLAC_STREAMINFO_SIZE) { return AVERROR_INVALIDDATA; } - ret = ff_flac_parse_streaminfo(s->avctx, &s->flac_stream_info, &buf[8]); + ret = ff_flac_parse_streaminfo(s->avctx, &s->stream_info, &buf[8]); if (ret < 0) return ret; ret = allocate_buffers(s); @@ -185,7 +206,7 @@ return ret; flac_set_bps(s); ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, - s->flac_stream_info.channels, s->flac_stream_info.bps); + s->stream_info.channels); s->got_streaminfo = 1; return 0; @@ -331,6 +352,62 @@ return 0; } +#define DECODER_SUBFRAME_FIXED_WIDE(residual) { \ + const int blocksize = s->blocksize; \ + int ret; \ + \ + if ((ret = decode_residuals(s, residual, pred_order)) < 0) \ + return ret; \ + \ + switch (pred_order) { \ + case 0: \ + for (int i = pred_order; i < blocksize; i++) \ + decoded[i] = residual[i]; \ + break; \ + case 1: \ + for (int i = pred_order; i < blocksize; i++) \ + decoded[i] = (int64_t)residual[i] + (int64_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]; \ + 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]; \ + 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]; \ + break; \ + default: \ + av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order); \ + return AVERROR_INVALIDDATA; \ + } \ + return 0; \ +} + +static int decode_subframe_fixed_wide(FLACContext *s, int32_t *decoded, + int pred_order, int bps) +{ + /* warm up samples */ + for (int i = 0; i < pred_order; i++) { + decoded[i] = get_sbits_long(&s->gb, bps); + } + DECODER_SUBFRAME_FIXED_WIDE(decoded); +} + + +static int decode_subframe_fixed_33bps(FLACContext *s, int64_t *decoded, + int32_t *residual, int pred_order) +{ + /* warm up samples */ \ + for (int i = 0; i < pred_order; i++) { \ + decoded[i] = get_sbits64(&s->gb, 33); \ + } \ + DECODER_SUBFRAME_FIXED_WIDE(residual); +} + static void lpc_analyze_remodulate(SUINT32 *decoded, const int coeffs[32], int order, int qlevel, int len, int bps) { @@ -389,25 +466,66 @@ if ((ret = decode_residuals(s, decoded, pred_order)) < 0) return ret; - if ( ( s->buggy_lpc && s->flac_stream_info.bps <= 16) + if ( ( s->buggy_lpc && s->stream_info.bps <= 16) || ( !s->buggy_lpc && bps <= 16 && bps + coeff_prec + av_log2(pred_order) <= 32)) { s->dsp.lpc16(decoded, coeffs, pred_order, qlevel, s->blocksize); } else { s->dsp.lpc32(decoded, coeffs, pred_order, qlevel, s->blocksize); - if (s->flac_stream_info.bps <= 16) + if (s->stream_info.bps <= 16) lpc_analyze_remodulate(decoded, coeffs, pred_order, qlevel, s->blocksize, bps); } return 0; } +static int decode_subframe_lpc_33bps(FLACContext *s, int64_t *decoded, + int32_t *residual, int pred_order) +{ + int i, j, ret; + int coeff_prec, qlevel; + int coeffs[32]; + + /* warm up samples */ + for (i = 0; i < pred_order; i++) { + decoded[i] = get_sbits64(&s->gb, 33); + } + + coeff_prec = get_bits(&s->gb, 4) + 1; + if (coeff_prec == 16) { + av_log(s->avctx, AV_LOG_ERROR, "invalid coeff precision\n"); + return AVERROR_INVALIDDATA; + } + qlevel = get_sbits(&s->gb, 5); + if (qlevel < 0) { + av_log(s->avctx, AV_LOG_ERROR, "qlevel %d not supported, maybe buggy stream\n", + qlevel); + return AVERROR_INVALIDDATA; + } + + for (i = 0; i < pred_order; i++) { + coeffs[pred_order - i - 1] = get_sbits(&s->gb, coeff_prec); + } + + if ((ret = decode_residuals(s, residual, pred_order)) < 0) + return ret; + + for (i = pred_order; i < s->blocksize; i++, decoded++) { + int64_t sum = 0; + for (j = 0; j < pred_order; j++) + sum += (int64_t)coeffs[j] * decoded[j]; + decoded[j] = residual[i] + (sum >> qlevel); + } + + return 0; +} + static inline int decode_subframe(FLACContext *s, int channel) { int32_t *decoded = s->decoded[channel]; int type, wasted = 0; - int bps = s->flac_stream_info.bps; - int i, tmp, ret; + int bps = s->stream_info.bps; + int i, ret; if (channel == 0) { if (s->ch_mode == FLAC_CHMODE_RIGHT_SIDE) @@ -427,7 +545,7 @@ int left = get_bits_left(&s->gb); if ( left <= 0 || (left < bps && !show_bits_long(&s->gb, left)) || - !show_bits_long(&s->gb, bps)) { + !show_bits_long(&s->gb, bps-1)) { av_log(s->avctx, AV_LOG_ERROR, "Invalid number of wasted bits > available bits (%d) - left=%d\n", bps, left); @@ -436,34 +554,63 @@ wasted = 1 + get_unary(&s->gb, 1, get_bits_left(&s->gb)); bps -= wasted; } - if (bps > 32) { - avpriv_report_missing_feature(s->avctx, "Decorrelated bit depth > 32"); - return AVERROR_PATCHWELCOME; - } //FIXME use av_log2 for types if (type == 0) { - tmp = get_sbits_long(&s->gb, bps); - for (i = 0; i < s->blocksize; i++) - decoded[i] = tmp; + if (bps < 33) { + int32_t tmp = get_sbits_long(&s->gb, bps); + for (i = 0; i < s->blocksize; i++) + decoded[i] = tmp; + } else { + int64_t tmp = get_sbits64(&s->gb, 33); + for (i = 0; i < s->blocksize; i++) + s->decoded_33bps[i] = tmp; + } } else if (type == 1) { - for (i = 0; i < s->blocksize; i++) - decoded[i] = get_sbits_long(&s->gb, bps); + if (bps < 33) { + for (i = 0; i < s->blocksize; i++) + decoded[i] = get_sbits_long(&s->gb, bps); + } else { + for (i = 0; i < s->blocksize; i++) + s->decoded_33bps[i] = get_sbits64(&s->gb, 33); + } } else if ((type >= 8) && (type <= 12)) { - if ((ret = decode_subframe_fixed(s, decoded, type & ~0x8, bps)) < 0) - return ret; + int order = type & ~0x8; + if (bps < 33) { + if (bps + order <= 32) { + if ((ret = decode_subframe_fixed(s, decoded, order, bps)) < 0) + return ret; + } else { + if ((ret = decode_subframe_fixed_wide(s, decoded, order, bps)) < 0) + return ret; + } + } else { + if ((ret = decode_subframe_fixed_33bps(s, s->decoded_33bps, decoded, order)) < 0) + return ret; + } } else if (type >= 32) { - if ((ret = decode_subframe_lpc(s, decoded, (type & ~0x20)+1, bps)) < 0) - return ret; + if (bps < 33) { + if ((ret = decode_subframe_lpc(s, decoded, (type & ~0x20)+1, bps)) < 0) + return ret; + } else { + if ((ret = decode_subframe_lpc_33bps(s, s->decoded_33bps, decoded, (type & ~0x20)+1)) < 0) + return ret; + } } else { av_log(s->avctx, AV_LOG_ERROR, "invalid coding type\n"); return AVERROR_INVALIDDATA; } - if (wasted && wasted < 32) { - int i; - for (i = 0; i < s->blocksize; i++) - decoded[i] = (unsigned)decoded[i] << wasted; + if (wasted) { + if (wasted+bps == 33) { + int i; + for (i = 0; i < s->blocksize; i++) + s->decoded_33bps[i] = (uint64_t)decoded[i] << wasted; + } else if (wasted < 32) { + int i; + for (i = 0; i < s->blocksize; i++) + decoded[i] = (unsigned)decoded[i] << wasted; + } } return 0; @@ -480,68 +627,68 @@ return ret; } - if ( s->flac_stream_info.channels - && fi.channels != s->flac_stream_info.channels + if ( s->stream_info.channels + && fi.channels != s->stream_info.channels && s->got_streaminfo) { - s->flac_stream_info.channels = fi.channels; + s->stream_info.channels = fi.channels; ff_flac_set_channel_layout(s->avctx, fi.channels); ret = allocate_buffers(s); if (ret < 0) return ret; } - s->flac_stream_info.channels = fi.channels; + s->stream_info.channels = fi.channels; ff_flac_set_channel_layout(s->avctx, fi.channels); s->ch_mode = fi.ch_mode; - if (!s->flac_stream_info.bps && !fi.bps) { + if (!s->stream_info.bps && !fi.bps) { av_log(s->avctx, AV_LOG_ERROR, "bps not found in STREAMINFO or frame header\n"); return AVERROR_INVALIDDATA; } if (!fi.bps) { - fi.bps = s->flac_stream_info.bps; - } else if (s->flac_stream_info.bps && fi.bps != s->flac_stream_info.bps) { + fi.bps = s->stream_info.bps; + } else if (s->stream_info.bps && fi.bps != s->stream_info.bps) { av_log(s->avctx, AV_LOG_ERROR, "switching bps mid-stream is not " "supported\n"); return AVERROR_INVALIDDATA; } - if (!s->flac_stream_info.bps) { - s->flac_stream_info.bps = s->avctx->bits_per_raw_sample = fi.bps; + if (!s->stream_info.bps) { + s->stream_info.bps = s->avctx->bits_per_raw_sample = fi.bps; flac_set_bps(s); } - if (!s->flac_stream_info.max_blocksize) - s->flac_stream_info.max_blocksize = FLAC_MAX_BLOCKSIZE; - if (fi.blocksize > s->flac_stream_info.max_blocksize) { + if (!s->stream_info.max_blocksize) + s->stream_info.max_blocksize = FLAC_MAX_BLOCKSIZE; + if (fi.blocksize > s->stream_info.max_blocksize) { av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", fi.blocksize, - s->flac_stream_info.max_blocksize); + s->stream_info.max_blocksize); return AVERROR_INVALIDDATA; } s->blocksize = fi.blocksize; - if (!s->flac_stream_info.samplerate && !fi.samplerate) { + if (!s->stream_info.samplerate && !fi.samplerate) { av_log(s->avctx, AV_LOG_ERROR, "sample rate not found in STREAMINFO" " or frame header\n"); return AVERROR_INVALIDDATA; } if (fi.samplerate == 0) - fi.samplerate = s->flac_stream_info.samplerate; - s->flac_stream_info.samplerate = s->avctx->sample_rate = fi.samplerate; + fi.samplerate = s->stream_info.samplerate; + s->stream_info.samplerate = s->avctx->sample_rate = fi.samplerate; if (!s->got_streaminfo) { ret = allocate_buffers(s); if (ret < 0) return ret; s->got_streaminfo = 1; - dump_headers(s->avctx, &s->flac_stream_info); + dump_headers(s->avctx, &s->stream_info); } ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, - s->flac_stream_info.channels, s->flac_stream_info.bps); + s->stream_info.channels); -// dump_headers(s->avctx, &s->flac_stream_info); +// dump_headers(s->avctx, &s->stream_info); /* subframes */ - for (i = 0; i < s->flac_stream_info.channels; i++) { + for (i = 0; i < s->stream_info.channels; i++) { if ((ret = decode_subframe(s, i)) < 0) return ret; } @@ -554,6 +701,26 @@ return 0; } +static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_33bps, int len) +{ + int i; + if (ch_mode == FLAC_CHMODE_LEFT_SIDE ) { + for (i = 0; i < len; i++) + decoded[1][i] = decoded[0][i] - 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]; + } else if (ch_mode == FLAC_CHMODE_MID_SIDE ) { + for (i = 0; i < len; i++) { + uint64_t a = decoded[0][i]; + int64_t b = decoded_33bps[i]; + a -= b >> 1; + decoded[0][i] = (a + b); + decoded[1][i] = a; + } + } +} + static int flac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { @@ -565,12 +732,6 @@ *got_frame_ptr = 0; - if (s->flac_stream_info.max_framesize == 0) { - s->flac_stream_info.max_framesize = - ff_flac_get_max_frame_size(s->flac_stream_info.max_blocksize ? s->flac_stream_info.max_blocksize : FLAC_MAX_BLOCKSIZE, - FLAC_MAX_CHANNELS, 32); - } - if (buf_size > 5 && !memcmp(buf, "\177FLAC", 5)) { av_log(s->avctx, AV_LOG_DEBUG, "skipping flac header packet 1\n"); return buf_size; @@ -583,7 +744,7 @@ /* check that there is at least the smallest decodable amount of data. this amount corresponds to the smallest valid FLAC frame possible. - FF F8 69 02 00 00 9A 00 00 34 46 */ + FF F8 69 02 00 00 9A 00 00 34 */ if (buf_size < FLAC_MIN_FRAME_SIZE) return buf_size; @@ -618,9 +779,15 @@ if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0) return ret; - s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, - s->flac_stream_info.channels, - s->blocksize, s->sample_shift); + if (s->stream_info.bps == 32 && s->ch_mode > 0) { + decorrelate_33bps(s->ch_mode, s->decoded, s->decoded_33bps, s->blocksize); + s->dsp.decorrelate[0](frame->data, s->decoded, s->stream_info.channels, + s->blocksize, s->sample_shift); + } else { + s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, + s->stream_info.channels, + s->blocksize, s->sample_shift); + } if (bytes_read > buf_size) { av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", bytes_read - buf_size); @@ -641,6 +808,7 @@ FLACContext *s = avctx->priv_data; av_freep(&s->decoded_buffer); + av_freep(&s->decoded_buffer_33bps); return 0; } @@ -659,7 +827,7 @@ const FFCodec ff_flac_decoder = { .p.name = "flac", - .p.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), + CODEC_LONG_NAME("FLAC (Free Lossless Audio Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_FLAC, .priv_data_size = sizeof(FLACContext), @@ -675,5 +843,4 @@ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, .p.priv_class = &flac_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,6 @@ #define SAMPLE_SIZE 16 #define PLANAR 0 #include "flacdsp_template.c" -#include "flacdsp_lpc_template.c" #undef PLANAR #define PLANAR 1 @@ -38,7 +37,6 @@ #define SAMPLE_SIZE 32 #define PLANAR 0 #include "flacdsp_template.c" -#include "flacdsp_lpc_template.c" #undef PLANAR #define PLANAR 1 @@ -86,13 +84,10 @@ } -av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, - int bps) +av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels) { c->lpc16 = flac_lpc_16_c; c->lpc32 = flac_lpc_32_c; - c->lpc16_encode = flac_lpc_encode_c_16; - c->lpc32_encode = flac_lpc_encode_c_32; switch (fmt) { case AV_SAMPLE_FMT_S32: @@ -125,8 +120,8 @@ } #if ARCH_ARM - ff_flacdsp_init_arm(c, fmt, channels, bps); + ff_flacdsp_init_arm(c, fmt, channels); #elif ARCH_X86 - ff_flacdsp_init_x86(c, fmt, channels, bps); + ff_flacdsp_init_x86(c, fmt, channels); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -36,8 +36,8 @@ const int32_t coefs[32], int shift); } FLACDSPContext; -void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, int bps); -void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, int bps); -void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, int bps); +void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); +void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); +void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); #endif /* AVCODEC_FLACDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,12 +31,10 @@ #include "codec_internal.h" #include "encode.h" #include "put_bits.h" -#include "put_golomb.h" -#include "internal.h" #include "lpc.h" #include "flac.h" #include "flacdata.h" -#include "flacdsp.h" +#include "flacencdsp.h" #define FLAC_SUBFRAME_CONSTANT 0 #define FLAC_SUBFRAME_VERBATIM 1 @@ -96,6 +94,7 @@ typedef struct FlacFrame { FlacSubframe subframes[FLAC_MAX_CHANNELS]; + int64_t samples_33bps[FLAC_MAX_BLOCKSIZE]; int blocksize; int bs_code[2]; uint8_t crc8; @@ -125,7 +124,7 @@ uint8_t *md5_buffer; unsigned int md5_buffer_size; BswapDSPContext bdsp; - FLACDSPContext flac_dsp; + FLACEncDSPContext flac_dsp; int flushed; int64_t next_pts; @@ -159,6 +158,34 @@ /** + * Calculate an estimate for the maximum frame size based on verbatim mode. + * @param blocksize block size, in samples + * @param ch number of channels + * @param bps bits-per-sample + */ +static int flac_get_max_frame_size(int blocksize, int ch, int bps) +{ + /* Technically, there is no limit to FLAC frame size, but an encoder + should not write a frame that is larger than if verbatim encoding mode + were to be used. */ + + int count; + + count = 16; /* frame header */ + count += ch * ((7+bps+7)/8); /* subframe headers */ + if (ch == 2) { + /* for stereo, need to account for using decorrelation */ + count += (( 2*bps+1) * blocksize + 7) / 8; + } else { + count += ( ch*bps * blocksize + 7) / 8; + } + count += 2; /* frame footer */ + + return count; +} + + +/** * Set blocksize based on samplerate. * Choose the closest predefined blocksize >= BLOCK_TIME_MS milliseconds. */ @@ -255,10 +282,22 @@ s->bps_code = 4; break; case AV_SAMPLE_FMT_S32: - if (avctx->bits_per_raw_sample != 24) - av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n"); - avctx->bits_per_raw_sample = 24; - s->bps_code = 6; + if (avctx->bits_per_raw_sample <= 24) { + if (avctx->bits_per_raw_sample < 24) + av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n"); + avctx->bits_per_raw_sample = 24; + s->bps_code = 6; + } else if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { + av_log(avctx, AV_LOG_WARNING, + "encoding as 24 bits-per-sample, more is considered " + "experimental. Add -strict experimental if you want " + "to encode more than 24 bits-per-sample\n"); + avctx->bits_per_raw_sample = 24; + s->bps_code = 6; + } else { + avctx->bits_per_raw_sample = 32; + s->bps_code = 7; + } break; } @@ -272,7 +311,7 @@ /* find samplerate in table */ if (freq < 1) return AVERROR(EINVAL); - for (i = 4; i < 12; i++) { + for (i = 1; i < 12; i++) { if (freq == ff_flac_sample_rate_table[i]) { s->samplerate = ff_flac_sample_rate_table[i]; s->sr_code[0] = i; @@ -291,6 +330,9 @@ } else if (freq < 65535) { s->sr_code[0] = 13; s->sr_code[1] = freq; + } else if (freq < 1048576) { + s->sr_code[0] = 0; + s->sr_code[1] = 0; } else { av_log(avctx, AV_LOG_ERROR, "%d Hz not supported\n", freq); return AVERROR(EINVAL); @@ -379,9 +421,9 @@ s->max_blocksize = s->avctx->frame_size; /* set maximum encoded frame size in verbatim mode */ - s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size, - s->channels, - s->avctx->bits_per_raw_sample); + s->max_framesize = flac_get_max_frame_size(s->avctx->frame_size, + s->channels, + s->avctx->bits_per_raw_sample); /* initialize MD5 context */ s->md5ctx = av_md5_alloc(); @@ -425,8 +467,7 @@ s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON); ff_bswapdsp_init(&s->bdsp); - ff_flacdsp_init(&s->flac_dsp, avctx->sample_fmt, channels, - avctx->bits_per_raw_sample); + ff_flacencdsp_init(&s->flac_dsp); dprint_compression_options(s); @@ -507,8 +548,7 @@ uint64_t count = 0; for (i = 0; i < n; i++) { - int32_t v = -2 * res[i] - 1; - v ^= v >> 31; + unsigned v = ((unsigned)(res[i]) << 1) ^ (res[i] >> 31); count += (v >> k) + 1 + k; } return count; @@ -687,8 +727,8 @@ tmp_rc.coding_mode = rc->coding_mode; - for (i = 0; i < n; i++) - udata[i] = (2 * data[i]) ^ (data[i] >> 31); + for (i = pred_order; i < n; i++) + udata[i] = ((unsigned)(data[i]) << 1) ^ (data[i] >> 31); calc_sum_top(pmax, exact ? kmax : 0, udata, n, pred_order, sums); @@ -786,6 +826,130 @@ } +/* These four functions check for every residual whether it can be + * contained in INT32_MAX) \ + return 1; \ + res[i] = res64; \ + } \ + } else if (order == 2) { \ + for (int i = order; i < n; i++) { \ + int64_t res64 = (int64_t)smp[i] - 2*(int64_t)smp[i-1] + smp[i-2]; \ + if (res64 <= INT32_MIN || res64 > INT32_MAX) \ + return 1; \ + res[i] = res64; \ + } \ + } else if (order == 3) { \ + for (int i = order; i < n; i++) { \ + int64_t res64 = (int64_t)smp[i] - 3*(int64_t)smp[i-1] + 3*(int64_t)smp[i-2] - smp[i-3]; \ + if (res64 <= INT32_MIN || res64 > INT32_MAX) \ + return 1; \ + res[i] = res64; \ + } \ + } else { \ + for (int i = order; i < n; i++) { \ + int64_t res64 = (int64_t)smp[i] - 4*(int64_t)smp[i-1] + 6*(int64_t)smp[i-2] - 4*(int64_t)smp[i-3] + smp[i-4]; \ + if (res64 <= INT32_MIN || res64 > INT32_MAX) \ + return 1; \ + res[i] = res64; \ + } \ + } \ + return 0; \ +} + +static int encode_residual_fixed_with_residual_limit(int32_t *res, const int32_t *smp, + int n, int order) +{ + ENCODE_RESIDUAL_FIXED_WITH_RESIDUAL_LIMIT(); +} + + +static int encode_residual_fixed_with_residual_limit_33bps(int32_t *res, const int64_t *smp, + int n, int order) +{ + ENCODE_RESIDUAL_FIXED_WITH_RESIDUAL_LIMIT(); +} + +#define LPC_ENCODE_WITH_RESIDUAL_LIMIT() \ +{ \ + for (int i = 0; i < order; i++) \ + res[i] = smp[i]; \ + for (int i = order; i < len; i++) { \ + int64_t p = 0, tmp; \ + for (int j = 0; j < order; j++) \ + p += (int64_t)coefs[j]*smp[(i-1)-j]; \ + p >>= shift; \ + tmp = smp[i] - p; \ + if (tmp <= INT32_MIN || tmp > INT32_MAX) \ + return 1; \ + res[i] = tmp; \ + } \ + return 0; \ +} + +static int lpc_encode_with_residual_limit(int32_t *res, const int32_t *smp, int len, + int order, int32_t *coefs, int shift) +{ + LPC_ENCODE_WITH_RESIDUAL_LIMIT(); +} + +static int lpc_encode_with_residual_limit_33bps(int32_t *res, const int64_t *smp, int len, + int order, int32_t *coefs, int shift) +{ + LPC_ENCODE_WITH_RESIDUAL_LIMIT(); +} + +static int lpc_encode_choose_datapath(FlacEncodeContext *s, int32_t bps, + int32_t *res, const int32_t *smp, + const int64_t *smp_33bps, int len, + int order, int32_t *coefs, int shift) +{ + uint64_t max_residual_value = 0; + int64_t max_sample_value = ((int64_t)(1) << (bps-1)); + /* This calculates the max size of any residual with the current + * predictor, so we know whether we need to check the residual */ + for (int i = 0; i < order; i++) + max_residual_value += FFABS(max_sample_value * coefs[i]); + max_residual_value >>= shift; + max_residual_value += max_sample_value; + if (bps > 32) { + if (lpc_encode_with_residual_limit_33bps(res, smp_33bps, len, order, coefs, shift)) + return 1; + } else if (max_residual_value > INT32_MAX) { + if (lpc_encode_with_residual_limit(res, smp, len, order, coefs, shift)) + return 1; + } else if (bps + s->options.lpc_coeff_precision + av_log2(order) <= 32) { + s->flac_dsp.lpc16_encode(res, smp, len, order, coefs, shift); + } else { + s->flac_dsp.lpc32_encode(res, smp, len, order, coefs, shift); + } + return 0; +} + +#define DEFAULT_TO_VERBATIM() \ +{ \ + sub->type = sub->type_code = FLAC_SUBFRAME_VERBATIM; \ + if (sub->obits <= 32) \ + memcpy(res, smp, n * sizeof(int32_t)); \ + return subframe_count_exact(s, sub, 0); \ +} + static int encode_residual_ch(FlacEncodeContext *s, int ch) { int i, n; @@ -795,28 +959,38 @@ int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int shift[MAX_LPC_ORDER]; int32_t *res, *smp; + int64_t *smp_33bps; - frame = &s->frame; - sub = &frame->subframes[ch]; - res = sub->residual; - smp = sub->samples; - n = frame->blocksize; + frame = &s->frame; + sub = &frame->subframes[ch]; + res = sub->residual; + smp = sub->samples; + smp_33bps = frame->samples_33bps; + n = frame->blocksize; /* CONSTANT */ - for (i = 1; i < n; i++) - if(smp[i] != smp[0]) - break; - if (i == n) { - sub->type = sub->type_code = FLAC_SUBFRAME_CONSTANT; - res[0] = smp[0]; - return subframe_count_exact(s, sub, 0); + if (sub->obits > 32) { + for (i = 1; i < n; i++) + if(smp_33bps[i] != smp_33bps[0]) + break; + if (i == n) { + sub->type = sub->type_code = FLAC_SUBFRAME_CONSTANT; + return subframe_count_exact(s, sub, 0); + } + } else { + for (i = 1; i < n; i++) + if(smp[i] != smp[0]) + break; + if (i == n) { + sub->type = sub->type_code = FLAC_SUBFRAME_CONSTANT; + res[0] = smp[0]; + return subframe_count_exact(s, sub, 0); + } } /* VERBATIM */ if (frame->verbatim_only || n < 5) { - sub->type = sub->type_code = FLAC_SUBFRAME_VERBATIM; - memcpy(res, smp, n * sizeof(int32_t)); - return subframe_count_exact(s, sub, 0); + DEFAULT_TO_VERBATIM(); } min_order = s->options.min_prediction_order; @@ -833,15 +1007,32 @@ opt_order = 0; bits[0] = UINT32_MAX; for (i = min_order; i <= max_order; i++) { - encode_residual_fixed(res, smp, n, i); + if (sub->obits == 33) { + if (encode_residual_fixed_with_residual_limit_33bps(res, smp_33bps, n, i)) + continue; + } else if (sub->obits + i >= 32) { + if (encode_residual_fixed_with_residual_limit(res, smp, n, i)) + continue; + } else + encode_residual_fixed(res, smp, n, i); bits[i] = find_subframe_rice_params(s, sub, i); if (bits[i] < bits[opt_order]) opt_order = i; } + if (opt_order == 0 && bits[0] == UINT32_MAX) { + /* No predictor found with residuals within order = opt_order; sub->type_code = sub->type | sub->order; if (sub->order != max_order) { - encode_residual_fixed(res, smp, n, sub->order); + if (sub->obits == 33) + encode_residual_fixed_with_residual_limit_33bps(res, smp_33bps, n, sub->order); + else if (sub->obits + i >= 32) + encode_residual_fixed_with_residual_limit(res, smp, n, sub->order); + else + encode_residual_fixed(res, smp, n, sub->order); find_subframe_rice_params(s, sub, sub->order); } return subframe_count_exact(s, sub, sub->order); @@ -849,6 +1040,14 @@ /* LPC */ sub->type = FLAC_SUBFRAME_LPC; + if (sub->obits == 33) + /* As ff_lpc_calc_coefs is shared with other codecs and the LSB + * probably isn't predictable anyway, throw away LSB for analysis + * so it fits 32 bit int and existing function can be used + * unmodified */ + for (i = 0; i < n; i++) + smp[i] = smp_33bps[i] >> 1; + opt_order = ff_lpc_calc_coefs(&s->lpc_ctx, smp, n, min_order, max_order, s->options.lpc_coeff_precision, coefs, shift, s->options.lpc_type, s->options.lpc_passes, omethod, @@ -869,13 +1068,8 @@ order = av_clip(order, min_order - 1, max_order - 1); if (order == last_order) continue; - if (s->bps_code * 4 + s->options.lpc_coeff_precision + av_log2(order) <= 32) { - s->flac_dsp.lpc16_encode(res, smp, n, order+1, coefs[order], - shift[order]); - } else { - s->flac_dsp.lpc32_encode(res, smp, n, order+1, coefs[order], - shift[order]); - } + if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, order+1, coefs[order], shift[order])) + continue; bits[i] = find_subframe_rice_params(s, sub, order+1); if (bits[i] < bits[opt_index]) { opt_index = i; @@ -889,11 +1083,8 @@ opt_order = 0; bits[0] = UINT32_MAX; for (i = min_order-1; i < max_order; i++) { - if (s->bps_code * 4 + s->options.lpc_coeff_precision + av_log2(i) <= 32) { - s->flac_dsp.lpc16_encode(res, smp, n, i+1, coefs[i], shift[i]); - } else { - s->flac_dsp.lpc32_encode(res, smp, n, i+1, coefs[i], shift[i]); - } + if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, i+1, coefs[i], shift[i])) + continue; bits[i] = find_subframe_rice_params(s, sub, i+1); if (bits[i] < bits[opt_order]) opt_order = i; @@ -911,11 +1102,8 @@ for (i = last-step; i <= last+step; i += step) { if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX) continue; - if (s->bps_code * 4 + s->options.lpc_coeff_precision + av_log2(i) <= 32) { - s->flac_dsp.lpc32_encode(res, smp, n, i+1, coefs[i], shift[i]); - } else { - s->flac_dsp.lpc16_encode(res, smp, n, i+1, coefs[i], shift[i]); - } + if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, i+1, coefs[i], shift[i])) + continue; bits[i] = find_subframe_rice_params(s, sub, i+1); if (bits[i] < bits[opt_order]) opt_order = i; @@ -952,11 +1140,8 @@ if (diffsum >8) continue; - if (s->bps_code * 4 + s->options.lpc_coeff_precision + av_log2(opt_order - 1) <= 32) { - s->flac_dsp.lpc16_encode(res, smp, n, opt_order, lpc_try, shift[opt_order-1]); - } else { - s->flac_dsp.lpc32_encode(res, smp, n, opt_order, lpc_try, shift[opt_order-1]); - } + if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, opt_order, lpc_try, shift[opt_order-1])) + continue; score = find_subframe_rice_params(s, sub, opt_order); if (score < best_score) { best_score = score; @@ -973,10 +1158,10 @@ for (i = 0; i < sub->order; i++) sub->coefs[i] = coefs[sub->order-1][i]; - if (s->bps_code * 4 + s->options.lpc_coeff_precision + av_log2(opt_order) <= 32) { - s->flac_dsp.lpc16_encode(res, smp, n, sub->order, sub->coefs, sub->shift); - } else { - s->flac_dsp.lpc32_encode(res, smp, n, sub->order, sub->coefs, sub->shift); + if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, sub->order, sub->coefs, sub->shift)) { + /* No predictor found with residuals within order); @@ -1043,57 +1228,91 @@ static void remove_wasted_bits(FlacEncodeContext *s) { - int ch, i; + int ch, i, wasted_bits; for (ch = 0; ch < s->channels; ch++) { FlacSubframe *sub = &s->frame.subframes[ch]; - int32_t v = 0; - for (i = 0; i < s->frame.blocksize; i++) { - v |= sub->samples[i]; - if (v & 1) - break; - } + if (sub->obits > 32) { + int64_t v = 0; + for (i = 0; i < s->frame.blocksize; i++) { + v |= s->frame.samples_33bps[i]; + if (v & 1) + break; + } + + if (!v || (v & 1)) + return; + + v = ff_ctzll(v); + + /* If any wasted bits are found, samples are moved + * from frame.samples_33bps to frame.subframes[ch] */ + for (i = 0; i < s->frame.blocksize; i++) + sub->samples[i] = s->frame.samples_33bps[i] >> v; + wasted_bits = v; + } else { + int32_t v = 0; + for (i = 0; i < s->frame.blocksize; i++) { + v |= sub->samples[i]; + if (v & 1) + break; + } + + if (!v || (v & 1)) + return; - if (v && !(v & 1)) { v = ff_ctz(v); for (i = 0; i < s->frame.blocksize; i++) sub->samples[i] >>= v; + wasted_bits = v; + } - sub->wasted = v; - sub->obits -= v; + sub->wasted = wasted_bits; + sub->obits -= wasted_bits; - /* for 24-bit, check if removing wasted bits makes the range better - suited for using RICE instead of RICE2 for entropy coding */ - if (sub->obits <= 17) - sub->rc.coding_mode = CODING_MODE_RICE; - } + /* for 24-bit, check if removing wasted bits makes the range better + * suited for using RICE instead of RICE2 for entropy coding */ + if (sub->obits <= 17) + sub->rc.coding_mode = CODING_MODE_RICE; } } static int estimate_stereo_mode(const int32_t *left_ch, const int32_t *right_ch, int n, - int max_rice_param) + int max_rice_param, int bps) { - int i, best; - int32_t lt, rt; + int best; uint64_t sum[4]; uint64_t score[4]; int k; /* calculate sum of 2nd order residual for each channel */ sum[0] = sum[1] = sum[2] = sum[3] = 0; - for (i = 2; i < n; i++) { - lt = left_ch[i] - 2*left_ch[i-1] + left_ch[i-2]; - rt = right_ch[i] - 2*right_ch[i-1] + right_ch[i-2]; - sum[2] += FFABS((lt + rt) >> 1); - sum[3] += FFABS(lt - rt); - sum[0] += FFABS(lt); - sum[1] += FFABS(rt); + if(bps < 30) { + int32_t lt, rt; + for (int i = 2; i < n; i++) { + lt = left_ch[i] - 2*left_ch[i-1] + left_ch[i-2]; + rt = right_ch[i] - 2*right_ch[i-1] + right_ch[i-2]; + sum[2] += FFABS((lt + rt) >> 1); + sum[3] += FFABS(lt - rt); + sum[0] += FFABS(lt); + sum[1] += FFABS(rt); + } + } else { + int64_t lt, rt; + for (int i = 2; i < n; i++) { + lt = (int64_t)left_ch[i] - 2*(int64_t)left_ch[i-1] + left_ch[i-2]; + rt = (int64_t)right_ch[i] - 2*(int64_t)right_ch[i-1] + right_ch[i-2]; + sum[2] += FFABS((lt + rt) >> 1); + sum[3] += FFABS(lt - rt); + sum[0] += FFABS(lt); + sum[1] += FFABS(rt); + } } /* estimate bit counts */ - for (i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) { k = find_optimal_param(2 * sum[i], n, max_rice_param); sum[i] = rice_encode_count( 2 * sum[i], n, k); } @@ -1106,7 +1325,7 @@ /* return mode with lowest score */ best = 0; - for (i = 1; i < 4; i++) + for (int i = 1; i < 4; i++) if (score[i] < score[best]) best = i; @@ -1121,12 +1340,14 @@ { FlacFrame *frame; int32_t *left, *right; - int i, n; + int64_t *side_33bps; + int n; - frame = &s->frame; - n = frame->blocksize; - left = frame->subframes[0].samples; - right = frame->subframes[1].samples; + frame = &s->frame; + n = frame->blocksize; + left = frame->subframes[0].samples; + right = frame->subframes[1].samples; + side_33bps = frame->samples_33bps; if (s->channels != 2) { frame->ch_mode = FLAC_CHMODE_INDEPENDENT; @@ -1135,29 +1356,49 @@ if (s->options.ch_mode < 0) { int max_rice_param = (1 << frame->subframes[0].rc.coding_mode) - 2; - frame->ch_mode = estimate_stereo_mode(left, right, n, max_rice_param); + frame->ch_mode = estimate_stereo_mode(left, right, n, max_rice_param, s->avctx->bits_per_raw_sample); } else frame->ch_mode = s->options.ch_mode; /* perform decorrelation and adjust bits-per-sample */ if (frame->ch_mode == FLAC_CHMODE_INDEPENDENT) return; - if (frame->ch_mode == FLAC_CHMODE_MID_SIDE) { - int32_t tmp; - for (i = 0; i < n; i++) { - tmp = left[i]; - left[i] = (tmp + right[i]) >> 1; - right[i] = tmp - right[i]; + if(s->avctx->bits_per_raw_sample == 32) { + if (frame->ch_mode == FLAC_CHMODE_MID_SIDE) { + int64_t tmp; + for (int i = 0; i < n; i++) { + tmp = left[i]; + left[i] = (tmp + right[i]) >> 1; + side_33bps[i] = tmp - right[i]; + } + frame->subframes[1].obits++; + } else if (frame->ch_mode == FLAC_CHMODE_LEFT_SIDE) { + for (int i = 0; i < n; i++) + side_33bps[i] = (int64_t)left[i] - right[i]; + frame->subframes[1].obits++; + } else { + for (int i = 0; i < n; i++) + side_33bps[i] = (int64_t)left[i] - right[i]; + frame->subframes[0].obits++; } - frame->subframes[1].obits++; - } else if (frame->ch_mode == FLAC_CHMODE_LEFT_SIDE) { - for (i = 0; i < n; i++) - right[i] = left[i] - right[i]; - frame->subframes[1].obits++; } else { - for (i = 0; i < n; i++) - left[i] -= right[i]; - frame->subframes[0].obits++; + if (frame->ch_mode == FLAC_CHMODE_MID_SIDE) { + int32_t tmp; + for (int i = 0; i < n; i++) { + tmp = left[i]; + left[i] = (tmp + right[i]) >> 1; + right[i] = tmp - right[i]; + } + frame->subframes[1].obits++; + } else if (frame->ch_mode == FLAC_CHMODE_LEFT_SIDE) { + for (int i = 0; i < n; i++) + right[i] = left[i] - right[i]; + frame->subframes[1].obits++; + } else { + for (int i = 0; i < n; i++) + left[i] -= right[i]; + frame->subframes[0].obits++; + } } } @@ -1206,13 +1447,32 @@ } +static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k) +{ + unsigned v, e; + + v = ((unsigned)(i) << 1) ^ (i >> 31); + + e = (v >> k) + 1; + while (e > 31) { + put_bits(pb, 31, 0); + e -= 31; + } + put_bits(pb, e, 1); + if (k) { + unsigned mask = UINT32_MAX >> (32-k); + put_bits(pb, k, v & mask); + } +} + + static void write_subframes(FlacEncodeContext *s) { int ch; for (ch = 0; ch < s->channels; ch++) { FlacSubframe *sub = &s->frame.subframes[ch]; - int i, p, porder, psize; + int p, porder, psize; int32_t *part_end; int32_t *res = sub->residual; int32_t *frame_end = &sub->residual[s->frame.blocksize]; @@ -1226,21 +1486,45 @@ /* subframe */ if (sub->type == FLAC_SUBFRAME_CONSTANT) { - put_sbits(&s->pb, sub->obits, res[0]); + if(sub->obits == 33) + put_sbits63(&s->pb, 33, s->frame.samples_33bps[0]); + else if(sub->obits == 32) + put_bits32(&s->pb, res[0]); + else + put_sbits(&s->pb, sub->obits, res[0]); } else if (sub->type == FLAC_SUBFRAME_VERBATIM) { - while (res < frame_end) - put_sbits(&s->pb, sub->obits, *res++); + if (sub->obits == 33) { + int64_t *res64 = s->frame.samples_33bps; + int64_t *frame_end64 = &s->frame.samples_33bps[s->frame.blocksize]; + while (res64 < frame_end64) + put_sbits63(&s->pb, 33, (*res64++)); + } else if (sub->obits == 32) { + while (res < frame_end) + put_bits32(&s->pb, *res++); + } else { + while (res < frame_end) + put_sbits(&s->pb, sub->obits, *res++); + } } else { /* warm-up samples */ - for (i = 0; i < sub->order; i++) - put_sbits(&s->pb, sub->obits, *res++); + if (sub->obits == 33) { + for (int i = 0; i < sub->order; i++) + put_sbits63(&s->pb, 33, s->frame.samples_33bps[i]); + res += sub->order; + } else if (sub->obits == 32) { + for (int i = 0; i < sub->order; i++) + put_bits32(&s->pb, *res++); + } else { + for (int i = 0; i < sub->order; i++) + put_sbits(&s->pb, sub->obits, *res++); + } /* LPC coefficients */ if (sub->type == FLAC_SUBFRAME_LPC) { int cbits = s->options.lpc_coeff_precision; put_bits( &s->pb, 4, cbits-1); put_sbits(&s->pb, 5, sub->shift); - for (i = 0; i < sub->order; i++) + for (int i = 0; i < sub->order; i++) put_sbits(&s->pb, cbits, sub->coefs[i]); } @@ -1258,7 +1542,7 @@ int k = sub->rc.params[p]; put_bits(&s->pb, sub->rc.coding_mode, k); while (res < part_end) - set_sr_golomb_flac(&s->pb, *res++, k, INT32_MAX, 0); + set_sr_golomb_flac(&s->pb, *res++, k); part_end = FFMIN(frame_end, part_end + psize); } } @@ -1306,7 +1590,7 @@ (const uint16_t *) samples, buf_size / 2); buf = s->md5_buffer; #endif - } else { + } else if (s->avctx->bits_per_raw_sample <= 24) { int i; const int32_t *samples0 = samples; uint8_t *tmp = s->md5_buffer; @@ -1316,6 +1600,15 @@ AV_WL24(tmp + 3*i, v); } buf = s->md5_buffer; + } else { + /* s->avctx->bits_per_raw_sample <= 32 */ + int i; + const int32_t *samples0 = samples; + uint8_t *tmp = s->md5_buffer; + + for (i = 0; i < s->frame.blocksize * s->channels; i++) + AV_WL32(tmp + 4*i, samples0[i]); + buf = s->md5_buffer; } av_md5_update(s->md5ctx, buf, buf_size); @@ -1355,9 +1648,9 @@ /* change max_framesize for small final frame */ if (frame->nb_samples < s->frame.blocksize) { - s->max_framesize = ff_flac_get_max_frame_size(frame->nb_samples, - s->channels, - avctx->bits_per_raw_sample); + s->max_framesize = flac_get_max_frame_size(frame->nb_samples, + s->channels, + avctx->bits_per_raw_sample); } init_frame(s, frame->nb_samples); @@ -1397,10 +1690,7 @@ if (out_bytes < s->min_framesize) s->min_framesize = out_bytes; - avpkt->pts = frame->pts; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); - - s->next_pts = avpkt->pts + avpkt->duration; + s->next_pts = frame->pts + ff_samples_to_time_base(avctx, frame->nb_samples); av_shrink_packet(avpkt, out_bytes); @@ -1460,11 +1750,12 @@ const FFCodec ff_flac_encoder = { .p.name = "flac", - .p.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), + CODEC_LONG_NAME("FLAC (Free Lossless Audio Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_FLAC, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | - AV_CODEC_CAP_SMALL_LAST_FRAME, + AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(FlacEncodeContext), .init = flac_encode_init, FF_CODEC_ENCODE_CB(flac_encode_frame), @@ -1473,5 +1764,5 @@ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .p.priv_class = &flac_encoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 "flacencdsp.h" + +#define SAMPLE_SIZE 16 +#include "flacdsp_lpc_template.c" + +#undef SAMPLE_SIZE +#define SAMPLE_SIZE 32 +#include "flacdsp_lpc_template.c" + + +av_cold void ff_flacencdsp_init(FLACEncDSPContext *c) +{ + c->lpc16_encode = flac_lpc_encode_c_16; + c->lpc32_encode = flac_lpc_encode_c_32; + +#if ARCH_X86 + ff_flacencdsp_init_x86(c); +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flacencdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_FLACENCDSP_H +#define AVCODEC_FLACENCDSP_H + +#include + +typedef struct FLACEncDSPContext { + void (*lpc16_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); + void (*lpc32_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); +} FLACEncDSPContext; + +void ff_flacencdsp_init(FLACEncDSPContext *c); +void ff_flacencdsp_init_x86(FLACEncDSPContext *c); + +#endif /* AVCODEC_FLACDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions + * FLAC (Free Lossless Audio Codec) common stuff * Copyright (c) 2008 Justin Ruggles * * This file is part of FFmpeg. @@ -21,21 +21,19 @@ /** * @file - * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions + * FLAC (Free Lossless Audio Codec) common stuff */ #ifndef AVCODEC_FLAC_H #define AVCODEC_FLAC_H -#include "avcodec.h" -#include "bytestream.h" -#include "get_bits.h" +#include "libavutil/intreadwrite.h" #define FLAC_STREAMINFO_SIZE 34 #define FLAC_MAX_CHANNELS 8 #define FLAC_MIN_BLOCKSIZE 16 #define FLAC_MAX_BLOCKSIZE 65535 -#define FLAC_MIN_FRAME_SIZE 11 +#define FLAC_MIN_FRAME_SIZE 10 enum { FLAC_CHMODE_INDEPENDENT = 0, @@ -55,84 +53,6 @@ FLAC_METADATA_TYPE_INVALID = 127 }; -enum FLACExtradataFormat { - FLAC_EXTRADATA_FORMAT_STREAMINFO = 0, - FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1 -}; - -#define FLACCOMMONINFO \ - int samplerate; /**< sample rate */\ - int channels; /**< number of channels */\ - int bps; /**< bits-per-sample */\ - -/** - * Data needed from the Streaminfo header for use by the raw FLAC demuxer - * and/or the FLAC decoder. - */ -#define FLACSTREAMINFO \ - FLACCOMMONINFO \ - int max_blocksize; /**< maximum block size, in samples */\ - int max_framesize; /**< maximum frame size, in bytes */\ - int64_t samples; /**< total number of samples */\ - -typedef struct FLACStreaminfo { - FLACSTREAMINFO -} FLACStreaminfo; - -typedef struct FLACFrameInfo { - FLACCOMMONINFO - int blocksize; /**< block size of the frame */ - int ch_mode; /**< channel decorrelation mode */ - int64_t frame_or_sample_num; /**< frame number or sample number */ - int is_var_size; /**< specifies if the stream uses variable - block sizes or a fixed block size; - also determines the meaning of - frame_or_sample_num */ -} FLACFrameInfo; - -/** - * Parse the Streaminfo metadata block - * @param[out] avctx codec context to set basic stream parameters - * @param[out] s where parsed information is stored - * @param[in] buffer pointer to start of 34-byte streaminfo data - * - * @return negative error code on faiure or >= 0 on success - */ -int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, - const uint8_t *buffer); - -/** - * Validate the FLAC extradata. - * @param[in] avctx codec context containing the extradata. - * @param[out] format extradata format. - * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data. - * @return 1 if valid, 0 if not valid. - */ -int ff_flac_is_extradata_valid(AVCodecContext *avctx, - enum FLACExtradataFormat *format, - uint8_t **streaminfo_start); - -/** - * Calculate an estimate for the maximum frame size based on verbatim mode. - * @param blocksize block size, in samples - * @param ch number of channels - * @param bps bits-per-sample - */ -int ff_flac_get_max_frame_size(int blocksize, int ch, int bps); - -/** - * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context - * @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, - FLACFrameInfo *fi, int log_level_offset); - -void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); - /** * Parse the metadata block parameters from the header. * @param[in] block_header header data, at least 4 bytes @@ -143,13 +63,13 @@ static av_always_inline void flac_parse_block_header(const uint8_t *block_header, int *last, int *type, int *size) { - int tmp = bytestream_get_byte(&block_header); + int tmp = *block_header; if (last) *last = tmp & 0x80; if (type) *type = tmp & 0x7F; if (size) - *size = bytestream_get_be24(&block_header); + *size = AV_RB24(block_header + 1); } #endif /* AVCODEC_FLAC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parse.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parse.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parse.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parse.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * FLAC (Free Lossless Audio Codec) decoder/parser common functions + * Copyright (c) 2008 Justin Ruggles + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * FLAC (Free Lossless Audio Codec) decoder/parser common functions + */ + +#ifndef AVCODEC_FLAC_PARSE_H +#define AVCODEC_FLAC_PARSE_H + +#include "avcodec.h" +#include "get_bits.h" + +typedef struct FLACStreaminfo { + int samplerate; /**< sample rate */ + int channels; /**< number of channels */ + int bps; /**< bits-per-sample */ + int max_blocksize; /**< maximum block size, in samples */ + int max_framesize; /**< maximum frame size, in bytes */ + int64_t samples; /**< total number of samples */ +} FLACStreaminfo; + +typedef struct FLACFrameInfo { + int samplerate; /**< sample rate */ + int channels; /**< number of channels */ + int bps; /**< bits-per-sample */ + int blocksize; /**< block size of the frame */ + int ch_mode; /**< channel decorrelation mode */ + int64_t frame_or_sample_num; /**< frame number or sample number */ + int is_var_size; /**< specifies if the stream uses variable + block sizes or a fixed block size; + also determines the meaning of + frame_or_sample_num */ +} FLACFrameInfo; + +/** + * Parse the Streaminfo metadata block + * @param[out] avctx codec context to set basic stream parameters + * @param[out] s where parsed information is stored + * @param[in] buffer pointer to start of 34-byte streaminfo data + * + * @return negative error code on faiure or >= 0 on success + */ +int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, + const uint8_t *buffer); + +/** + * Validate the FLAC extradata. + * @param[in] avctx codec context containing the extradata. + * @param[out] format extradata format. + * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data. + * @return 1 if valid, 0 if not valid. + */ +int ff_flac_is_extradata_valid(AVCodecContext *avctx, + uint8_t **streaminfo_start); + +/** + * Validate and decode a frame header. + * @param avctx AVCodecContext to use as av_log() context + * @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, + FLACFrameInfo *fi, int log_level_offset); + +void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); + +#endif /* AVCODEC_FLAC_PARSE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flac_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,7 +36,7 @@ #include "libavutil/crc.h" #include "bytestream.h" #include "parser.h" -#include "flac.h" +#include "flac_parse.h" /** maximum number of adjacent headers that compare CRCs against each other */ #define FLAC_MAX_SEQUENTIAL_HEADERS 4 @@ -455,7 +455,7 @@ int log_level_offset) { FLACFrameInfo *header_fi = &header->fi, *child_fi = &child->fi; - int deduction, deduction_expected = 0, i; + int check_crc, deduction, deduction_expected = 0, i; deduction = check_header_fi_mismatch(fpc, header_fi, child_fi, log_level_offset); /* Check sample and frame numbers. */ @@ -491,8 +491,22 @@ "sample/frame number mismatch in adjacent frames\n"); } + if (fpc->last_fi.is_var_size == header_fi->is_var_size) { + if (fpc->last_fi.is_var_size && + fpc->last_fi.frame_or_sample_num + fpc->last_fi.blocksize == header_fi->frame_or_sample_num) { + check_crc = 0; + } else if (!fpc->last_fi.is_var_size && + fpc->last_fi.frame_or_sample_num + 1 == header_fi->frame_or_sample_num) { + check_crc = 0; + } else { + check_crc = !deduction && !deduction_expected; + } + } else { + check_crc = !deduction && !deduction_expected; + } + /* If we have suspicious headers, check the CRC between them */ - if (deduction && !deduction_expected) { + if (check_crc || (deduction && !deduction_expected)) { FLACHeaderMarker *curr; int read_len; uint8_t *buf; @@ -600,7 +614,7 @@ static void score_sequences(FLACParseContext *fpc) { FLACHeaderMarker *curr; - int best_score = 0;//FLAC_HEADER_NOT_SCORED_YET; + int best_score = FLAC_HEADER_NOT_SCORED_YET; /* First pass to clear all old scores. */ for (curr = fpc->headers; curr; curr = curr->next) curr->max_score = FLAC_HEADER_NOT_SCORED_YET; @@ -649,8 +663,11 @@ /* Return the negative overread index so the client can compute pos. This should be the amount overread to the beginning of the child */ - if (child) - return child->offset - flac_fifo_size(&fpc->fifo_buf); + if (child) { + int64_t offset = child->offset - flac_fifo_size(&fpc->fifo_buf); + if (offset > -(1 << 28)) + return offset; + } return 0; } @@ -682,7 +699,7 @@ } fpc->avctx = avctx; - if (fpc->best_header_valid) + if (fpc->best_header_valid && fpc->nb_headers_buffered >= FLAC_MIN_HEADERS) return get_best_header(fpc, poutbuf, poutbuf_size); /* If a best_header was found last call remove it with the buffer data. */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -105,7 +105,7 @@ int rows, cols; - int last_key_frame; + int64_t last_key_frame; int image_width, image_height; int block_width, block_height; @@ -787,7 +787,7 @@ { #ifndef FLASHSV2_DUMB double ideal = ((double)(s->avctx->bit_rate * s->avctx->time_base.den * s->avctx->ticks_per_frame)) / - ((double) s->avctx->time_base.num) * s->avctx->frame_number; + ((double) s->avctx->time_base.num) * s->avctx->frame_num; if (ideal + use15_7_threshold < s->total_bits) { return 1; } else { @@ -861,20 +861,20 @@ return res; /* First frame needs to be a keyframe */ - if (avctx->frame_number == 0) + if (avctx->frame_num == 0) keyframe = 1; /* Check the placement of keyframes */ if (avctx->gop_size > 0) { - if (avctx->frame_number >= s->last_key_frame + avctx->gop_size) + if (avctx->frame_num >= s->last_key_frame + avctx->gop_size) keyframe = 1; } if (!keyframe - && avctx->frame_number > s->last_key_frame + avctx->keyint_min) { + && avctx->frame_num > s->last_key_frame + avctx->keyint_min) { recommend_keyframe(s, &keyframe); if (keyframe) - av_log(avctx, AV_LOG_DEBUG, "Recommending key frame at frame %d\n", avctx->frame_number); + av_log(avctx, AV_LOG_DEBUG, "Recommending key frame at frame %"PRId64"\n", avctx->frame_num); } if (keyframe) { @@ -890,9 +890,9 @@ if (keyframe) { new_key_frame(s); - s->last_key_frame = avctx->frame_number; + s->last_key_frame = avctx->frame_num; pkt->flags |= AV_PKT_FLAG_KEY; - av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number); + av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %"PRId64"\n", avctx->frame_num); } pkt->size = res; @@ -912,13 +912,14 @@ const FFCodec ff_flashsv2_encoder = { .p.name = "flashsv2", - .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), + CODEC_LONG_NAME("Flash Screen Video Version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLASHSV2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(FlashSV2Context), .init = flashsv2_encode_init, FF_CODEC_ENCODE_CB(flashsv2_encode_frame), .close = flashsv2_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,16 +35,15 @@ #include "config_components.h" -#include -#include +#include #include #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "zlib_wrapper.h" typedef struct BlockInfo { @@ -503,7 +502,7 @@ #if CONFIG_FLASHSV_DECODER const FFCodec ff_flashsv_decoder = { .p.name = "flashsv", - .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"), + CODEC_LONG_NAME("Flash Screen Video v1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLASHSV, .priv_data_size = sizeof(FlashSVContext), @@ -511,7 +510,7 @@ .close = flashsv_decode_end, FF_CODEC_DECODE_CB(flashsv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, }; #endif /* CONFIG_FLASHSV_DECODER */ @@ -571,7 +570,7 @@ const FFCodec ff_flashsv2_decoder = { .p.name = "flashsv2", - .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"), + CODEC_LONG_NAME("Flash Screen Video v2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLASHSV2, .priv_data_size = sizeof(FlashSVContext), @@ -579,7 +578,7 @@ .close = flashsv2_decode_end, FF_CODEC_DECODE_CB(flashsv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, }; #endif /* CONFIG_FLASHSV2_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flashsvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,39 +44,40 @@ * Speed up. Make the difference check faster. */ -#include -#include +#include #include +#include "libavutil/buffer.h" + #include "avcodec.h" #include "codec_internal.h" #include "encode.h" #include "put_bits.h" #include "bytestream.h" +/* These values are hardcoded for now. */ +#define BLOCK_WIDTH (4 * 16U) +#define BLOCK_HEIGHT (4 * 16U) typedef struct FlashSVContext { AVCodecContext *avctx; - uint8_t *previous_frame; + const uint8_t *previous_frame; + AVBufferRef *prev_frame_buf; int image_width, image_height; - int block_width, block_height; - uint8_t *encbuffer; - int block_size; - int last_key_frame; + unsigned packet_size; + int64_t last_key_frame; uint8_t tmpblock[3 * 256 * 256]; } FlashSVContext; -static int copy_region_enc(uint8_t *sptr, uint8_t *dptr, int dx, int dy, - int h, int w, int stride, uint8_t *pfptr) +static int copy_region_enc(const uint8_t *sptr, uint8_t *dptr, int dx, int dy, + int h, int w, int stride, const uint8_t *pfptr) { int i, j; - uint8_t *nsptr; - uint8_t *npfptr; int diff = 0; for (i = dx + h; i > dx; i--) { - nsptr = sptr + i * stride + dy * 3; - npfptr = pfptr + i * stride + dy * 3; + const uint8_t *nsptr = sptr + i * stride + dy * 3; + const uint8_t *npfptr = pfptr + i * stride + dy * 3; for (j = 0; j < w * 3; j++) { diff |= npfptr[j] ^ nsptr[j]; dptr[j] = nsptr[j]; @@ -92,8 +93,7 @@ { FlashSVContext *s = avctx->priv_data; - av_freep(&s->encbuffer); - av_freep(&s->previous_frame); + av_buffer_unref(&s->prev_frame_buf); return 0; } @@ -101,6 +101,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx) { FlashSVContext *s = avctx->priv_data; + int h_blocks, v_blocks, nb_blocks; s->avctx = avctx; @@ -115,12 +116,10 @@ s->image_width = avctx->width; s->image_height = avctx->height; - s->encbuffer = av_mallocz(s->image_width * s->image_height * 3); - - if (!s->encbuffer) { - av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); - return AVERROR(ENOMEM); - } + h_blocks = (s->image_width + BLOCK_WIDTH - 1) / BLOCK_WIDTH; + v_blocks = (s->image_height + BLOCK_WIDTH - 1) / BLOCK_WIDTH; + nb_blocks = h_blocks * v_blocks; + s->packet_size = 4 + nb_blocks * (2 + 3 * BLOCK_WIDTH * BLOCK_HEIGHT); return 0; } @@ -128,7 +127,7 @@ static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf, int buf_size, int block_width, int block_height, - uint8_t *previous_frame, int *I_frame) + const uint8_t *previous_frame, int *I_frame) { PutBitContext pb; @@ -203,69 +202,59 @@ const AVFrame *pict, int *got_packet) { FlashSVContext * const s = avctx->priv_data; - const AVFrame * const p = pict; - uint8_t *pfptr; + const uint8_t *prev_frame = s->previous_frame; int res; int I_frame = 0; int opt_w = 4, opt_h = 4; /* First frame needs to be a keyframe */ - if (avctx->frame_number == 0) { - s->previous_frame = av_mallocz(FFABS(p->linesize[0]) * s->image_height); - if (!s->previous_frame) { - av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); - return AVERROR(ENOMEM); - } + if (!s->previous_frame) { + prev_frame = pict->data[0]; I_frame = 1; } - if (p->linesize[0] < 0) - pfptr = s->previous_frame - (s->image_height - 1) * p->linesize[0]; - else - pfptr = s->previous_frame; - /* Check the placement of keyframes */ if (avctx->gop_size > 0 && - avctx->frame_number >= s->last_key_frame + avctx->gop_size) { + avctx->frame_num >= s->last_key_frame + avctx->gop_size) { I_frame = 1; } - if ((res = ff_alloc_packet(avctx, pkt, s->image_width * s->image_height * 3)) < 0) + res = ff_alloc_packet(avctx, pkt, s->packet_size); + if (res < 0) return res; - pkt->size = encode_bitstream(s, p, pkt->data, pkt->size, opt_w * 16, opt_h * 16, - pfptr, &I_frame); - - //save the current frame - if (p->linesize[0] > 0) - memcpy(s->previous_frame, p->data[0], s->image_height * p->linesize[0]); - else - memcpy(s->previous_frame, - p->data[0] + p->linesize[0] * (s->image_height - 1), - s->image_height * FFABS(p->linesize[0])); + pkt->size = encode_bitstream(s, pict, pkt->data, pkt->size, + opt_w * 16, opt_h * 16, + prev_frame, &I_frame); //mark the frame type so the muxer can mux it correctly if (I_frame) { - s->last_key_frame = avctx->frame_number; - ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number); + s->last_key_frame = avctx->frame_num; + ff_dlog(avctx, "Inserting keyframe at frame %"PRId64"\n", avctx->frame_num); } if (I_frame) pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; + //save the current frame + res = av_buffer_replace(&s->prev_frame_buf, pict->buf[0]); + if (res < 0) + return res; + s->previous_frame = pict->data[0]; + return 0; } const FFCodec ff_flashsv_encoder = { .p.name = "flashsv", - .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"), + CODEC_LONG_NAME("Flash Screen Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLASHSV, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(FlashSVContext), .init = flashsv_encode_init, FF_CODEC_ENCODE_CB(flashsv_encode_frame), .close = flashsv_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flicvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flicvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flicvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flicvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,15 +34,13 @@ * in which the header is only 12 bytes. */ -#include -#include #include #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" #define FLI_256_COLOR 4 @@ -1106,7 +1104,7 @@ const FFCodec ff_flic_decoder = { .p.name = "flic", - .p.long_name = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"), + CODEC_LONG_NAME("Autodesk Animator Flic video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLIC, .priv_data_size = sizeof(FlicDecodeContext), @@ -1114,5 +1112,4 @@ .close = flic_decode_end, FF_CODEC_DECODE_CB(flic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/float2half.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/float2half.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_FLOAT2HALF_H -#define AVCODEC_FLOAT2HALF_H - -#include - -static void float2half_tables(uint16_t *basetable, uint8_t *shifttable) -{ - for (int i = 0; i < 256; i++) { - int e = i - 127; - - if (e < -24) { // Very small numbers map to zero - basetable[i|0x000] = 0x0000; - basetable[i|0x100] = 0x8000; - shifttable[i|0x000] = 24; - shifttable[i|0x100] = 24; - } else if (e < -14) { // Small numbers map to denorms - basetable[i|0x000] = (0x0400>>(-e-14)); - basetable[i|0x100] = (0x0400>>(-e-14)) | 0x8000; - shifttable[i|0x000] = -e-1; - shifttable[i|0x100] = -e-1; - } else if (e <= 15) { // Normal numbers just lose precision - basetable[i|0x000] = ((e + 15) << 10); - basetable[i|0x100] = ((e + 15) << 10) | 0x8000; - shifttable[i|0x000] = 13; - shifttable[i|0x100] = 13; - } else if (e < 128) { // Large numbers map to Infinity - basetable[i|0x000] = 0x7C00; - basetable[i|0x100] = 0xFC00; - shifttable[i|0x000] = 24; - shifttable[i|0x100] = 24; - } else { // Infinity and NaN's stay Infinity and NaN's - basetable[i|0x000] = 0x7C00; - basetable[i|0x100] = 0xFC00; - shifttable[i|0x000] = 13; - shifttable[i|0x100] = 13; - } - } -} - -static uint16_t float2half(uint32_t f, uint16_t *basetable, uint8_t *shifttable) -{ - uint16_t h; - - h = basetable[(f >> 23) & 0x1ff] + ((f & 0x007fffff) >> shifttable[(f >> 23) & 0x1ff]); - - return h; -} - -#endif /* AVCODEC_FLOAT2HALF_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -108,14 +108,12 @@ s->h263_flv - 1, s->qscale, s->picture_number); } - s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table; - return 0; } const FFCodec ff_flv_decoder = { .p.name = "flv", - .p.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), + CODEC_LONG_NAME("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLV1, .priv_data_size = sizeof(MpegEncContext), @@ -123,8 +121,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "mpegvideodata.h" #include "mpegvideoenc.h" -void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number) +void ff_flv_encode_picture_header(MpegEncContext *s) { int format; @@ -94,7 +94,7 @@ const FFCodec ff_flv_encoder = { .p.name = "flv", - .p.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), + CODEC_LONG_NAME("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FLV1, .p.priv_class = &ff_mpv_enc_class, @@ -102,7 +102,8 @@ .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/flvenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "mpegvideo.h" #include "put_bits.h" -void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_flv_encode_picture_header(MpegEncContext *s); void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,6 @@ #include "config.h" #include "libavutil/attributes.h" -#include "avcodec.h" #include "fmtconvert.h" static void int32_to_float_fmul_scalar_c(float *dst, const int32_t *src, @@ -33,14 +32,6 @@ dst[i] = src[i] * mul; } -static void int32_to_float_c(float *dst, const int32_t *src, intptr_t len) -{ - int i; - - for (i = 0; i < len; i++) - dst[i] = (float)src[i]; -} - static void int32_to_float_fmul_array8_c(FmtConvertContext *c, float *dst, const int32_t *src, const float *mul, int len) @@ -50,20 +41,21 @@ c->int32_to_float_fmul_scalar(&dst[i], &src[i], *mul++, 8); } -av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) +av_cold void ff_fmt_convert_init(FmtConvertContext *c) { - c->int32_to_float = int32_to_float_c; c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c; c->int32_to_float_fmul_array8 = int32_to_float_fmul_array8_c; #if ARCH_AARCH64 - ff_fmt_convert_init_aarch64(c, avctx); + ff_fmt_convert_init_aarch64(c); #elif ARCH_ARM - ff_fmt_convert_init_arm(c, avctx); + ff_fmt_convert_init_arm(c); #elif ARCH_PPC - ff_fmt_convert_init_ppc(c, avctx); + ff_fmt_convert_init_ppc(c); +#elif ARCH_RISCV + ff_fmt_convert_init_riscv(c); #elif ARCH_X86 - ff_fmt_convert_init_x86(c, avctx); + ff_fmt_convert_init_x86(c); #endif #if HAVE_MIPSFPU ff_fmt_convert_init_mips(c); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmtconvert.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #ifndef AVCODEC_FMTCONVERT_H #define AVCODEC_FMTCONVERT_H -#include "avcodec.h" +#include typedef struct FmtConvertContext { /** @@ -37,16 +37,6 @@ */ void (*int32_to_float_fmul_scalar)(float *dst, const int32_t *src, float mul, int len); - /** - * Convert an array of int32_t to float. - * @param dst destination array of float. - * constraints: 32-byte aligned - * @param src source array of int32_t. - * constraints: 32-byte aligned - * @param len number of elements to convert. - * constraints: multiple of 8 - */ - void (*int32_to_float)(float *dst, const int32_t *src, intptr_t len); /** * Convert an array of int32_t to float and multiply by a float value from another array, @@ -66,12 +56,13 @@ } FmtConvertContext; -void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx); +void ff_fmt_convert_init(FmtConvertContext *c); -void ff_fmt_convert_init_aarch64(FmtConvertContext *c, AVCodecContext *avctx); -void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx); -void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx); -void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx); +void ff_fmt_convert_init_aarch64(FmtConvertContext *c); +void ff_fmt_convert_init_arm(FmtConvertContext *c); +void ff_fmt_convert_init_ppc(FmtConvertContext *c); +void ff_fmt_convert_init_riscv(FmtConvertContext *c); +void ff_fmt_convert_init_x86(FmtConvertContext *c); void ff_fmt_convert_init_mips(FmtConvertContext *c); #endif /* AVCODEC_FMTCONVERT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmvc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmvc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmvc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fmvc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,12 @@ */ #include -#include #include #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define BLOCK_HEIGHT 112u #define BLOCK_WIDTH 84u @@ -637,7 +636,7 @@ const FFCodec ff_fmvc_decoder = { .p.name = "fmvc", - .p.long_name = NULL_IF_CONFIG_SMALL("FM Screen Capture Codec"), + CODEC_LONG_NAME("FM Screen Capture Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FMVC, .priv_data_size = sizeof(FMVCContext), @@ -645,6 +644,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frame_thread_encoder.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frame_thread_encoder.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frame_thread_encoder.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frame_thread_encoder.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,14 +24,12 @@ #include "libavutil/avassert.h" #include "libavutil/cpu.h" -#include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "codec_internal.h" +#include "encode.h" #include "internal.h" #include "pthread_internal.h" -#include "thread.h" #define MAX_THREADS 64 /* There can be as many as MAX_THREADS + 1 outstanding tasks. @@ -45,11 +43,11 @@ AVPacket *outdata; int return_code; int finished; + int got_packet; } Task; typedef struct{ AVCodecContext *parent_avctx; - pthread_mutex_t buffer_mutex; pthread_mutex_t task_fifo_mutex; /* Used to guard (next_)task_index */ pthread_cond_t task_fifo_cond; @@ -70,8 +68,8 @@ #define OFF(member) offsetof(ThreadContext, member) DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt, - (OFF(buffer_mutex), OFF(task_fifo_mutex), OFF(finished_task_mutex)), - (OFF(task_fifo_cond), OFF(finished_task_cond))); + (OFF(task_fifo_mutex), OFF(finished_task_mutex)), + (OFF(task_fifo_cond), OFF(finished_task_cond))); #undef OFF static void * attribute_align_arg worker(void *v){ @@ -79,7 +77,7 @@ ThreadContext *c = avctx->internal->frame_thread_encoder; while (!atomic_load(&c->exit)) { - int got_packet = 0, ret; + int ret; AVPacket *pkt; AVFrame *frame; Task *task; @@ -104,19 +102,7 @@ frame = task->indata; pkt = task->outdata; - ret = ffcodec(avctx->codec)->cb.encode(avctx, pkt, frame, &got_packet); - if(got_packet) { - int ret2 = av_packet_make_refcounted(pkt); - if (ret >= 0 && ret2 < 0) - ret = ret2; - pkt->pts = pkt->dts = frame->pts; - } else { - pkt->data = NULL; - pkt->size = 0; - } - pthread_mutex_lock(&c->buffer_mutex); - av_frame_unref(frame); - pthread_mutex_unlock(&c->buffer_mutex); + ret = ff_encode_encode_cb(avctx, pkt, frame, &task->got_packet); pthread_mutex_lock(&c->finished_task_mutex); task->return_code = ret; task->finished = 1; @@ -124,9 +110,7 @@ pthread_mutex_unlock(&c->finished_task_mutex); } end: - pthread_mutex_lock(&c->buffer_mutex); avcodec_close(avctx); - pthread_mutex_unlock(&c->buffer_mutex); av_freep(&avctx); return NULL; } @@ -315,8 +299,7 @@ * because there is no outstanding task with this index. */ outtask->finished = 0; av_packet_move_ref(pkt, outtask->outdata); - if(pkt->data) - *got_packet_ptr = 1; + *got_packet_ptr = outtask->got_packet; c->finished_task_index = (c->finished_task_index + 1) % c->max_tasks; return outtask->return_code; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fraps.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fraps.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fraps.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/fraps.c 2023-03-03 13:29:59.000000000 +0000 @@ -141,7 +141,6 @@ int buf_size = avpkt->size; uint32_t header; unsigned int version,header_size; - unsigned int x, y; const uint32_t *buf32; uint32_t *luma1,*luma2,*cb,*cr; uint32_t offs[4]; @@ -238,12 +237,12 @@ } buf32 = (const uint32_t*)buf; - for (y = 0; y < avctx->height / 2; y++) { + for (ptrdiff_t y = 0; y < avctx->height / 2; y++) { luma1 = (uint32_t*)&f->data[0][ y * 2 * f->linesize[0] ]; luma2 = (uint32_t*)&f->data[0][ (y * 2 + 1) * f->linesize[0] ]; cr = (uint32_t*)&f->data[1][ y * f->linesize[1] ]; cb = (uint32_t*)&f->data[2][ y * f->linesize[2] ]; - for (x = 0; x < avctx->width; x += 8) { + for (ptrdiff_t x = 0; x < avctx->width; x += 8) { *luma1++ = *buf32++; *luma1++ = *buf32++; *luma2++ = *buf32++; @@ -258,18 +257,18 @@ if (is_pal) { uint32_t *pal = (uint32_t *)f->data[1]; - for (y = 0; y < 256; y++) { + for (unsigned y = 0; y < 256; y++) { pal[y] = AV_RL32(buf) | 0xFF000000; buf += 4; } - for (y = 0; y height; y++) + for (ptrdiff_t y = 0; y < avctx->height; y++) memcpy(&f->data[0][y * f->linesize[0]], &buf[y * avctx->width], avctx->width); } else { /* Fraps v1 is an upside-down BGR24 */ - for (y = 0; yheight; y++) + for (ptrdiff_t y = 0; y < avctx->height; y++) memcpy(&f->data[0][(avctx->height - y - 1) * f->linesize[0]], &buf[y * avctx->width * 3], 3 * avctx->width); @@ -341,7 +340,7 @@ const FFCodec ff_fraps_decoder = { .p.name = "fraps", - .p.long_name = NULL_IF_CONFIG_SMALL("Fraps"), + CODEC_LONG_NAME("Fraps"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FRAPS, .priv_data_size = sizeof(FrapsContext), @@ -349,5 +348,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frwu.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frwu.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frwu.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/frwu.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/opt.h" typedef struct { @@ -117,7 +117,7 @@ const FFCodec ff_frwu_decoder = { .p.name = "frwu", - .p.long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"), + CODEC_LONG_NAME("Forward Uncompressed"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FRWU, .priv_data_size = sizeof(FRWUContext), @@ -125,5 +125,4 @@ FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.priv_class = &frwu_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,208 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "adts_header.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "get_bits.h" +#include "decode.h" + +typedef struct FTRContext { + AVCodecContext *aac_avctx[64]; // wrapper context for AAC + int nb_context; + AVPacket *packet; + AVFrame *frame; +} FTRContext; + +static av_cold int ftr_init(AVCodecContext *avctx) +{ + FTRContext *s = avctx->priv_data; + const AVCodec *codec; + int ret; + + if (avctx->ch_layout.nb_channels > 64 || + avctx->ch_layout.nb_channels <= 0) + return AVERROR(EINVAL); + + s->packet = av_packet_alloc(); + if (!s->packet) + return AVERROR(ENOMEM); + + s->frame = av_frame_alloc(); + if (!s->frame) + return AVERROR(ENOMEM); + + s->nb_context = avctx->ch_layout.nb_channels; + + codec = avcodec_find_decoder(AV_CODEC_ID_AAC); + if (!codec) + return AVERROR_BUG; + + for (int i = 0; i < s->nb_context; i++) { + s->aac_avctx[i] = avcodec_alloc_context3(codec); + if (!s->aac_avctx[i]) + return AVERROR(ENOMEM); + ret = avcodec_open2(s->aac_avctx[i], codec, NULL); + if (ret < 0) + return ret; + } + + avctx->sample_fmt = s->aac_avctx[0]->sample_fmt; + if (!av_sample_fmt_is_planar(avctx->sample_fmt)) + return AVERROR(EINVAL); + + return 0; +} + +static int ftr_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) +{ + FTRContext *s = avctx->priv_data; + GetBitContext gb; + int ret, ch_offset = 0; + + ret = init_get_bits8(&gb, avpkt->data, avpkt->size); + if (ret < 0) + return ret; + + frame->nb_samples = 0; + + for (int i = 0; i < s->nb_context; i++) { + AVCodecContext *codec_avctx = s->aac_avctx[i]; + GetBitContext gb2 = gb; + AACADTSHeaderInfo hdr_info; + int size; + + if (get_bits_left(&gb) < 64) + return AVERROR_INVALIDDATA; + + memset(&hdr_info, 0, sizeof(hdr_info)); + + size = ff_adts_header_parse(&gb2, &hdr_info); + if (size <= 0 || size * 8 > get_bits_left(&gb)) + return AVERROR_INVALIDDATA; + + if (size > s->packet->size) { + ret = av_grow_packet(s->packet, size - s->packet->size); + if (ret < 0) + return ret; + } + + ret = av_packet_make_writable(s->packet); + if (ret < 0) + return ret; + + memcpy(s->packet->data, avpkt->data + (get_bits_count(&gb) >> 3), size); + s->packet->size = size; + + if (size > 12) { + uint8_t *buf = s->packet->data; + + if (buf[3] & 0x20) { + int tmp = buf[8]; + buf[ 9] = ~buf[9]; + buf[11] = ~buf[11]; + buf[12] = ~buf[12]; + buf[ 8] = ~buf[10]; + buf[10] = ~tmp; + } + } + + ret = avcodec_send_packet(codec_avctx, s->packet); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Error submitting a packet for decoding\n"); + return ret; + } + + ret = avcodec_receive_frame(codec_avctx, s->frame); + if (ret < 0) + return ret; + + if (!avctx->sample_rate) { + avctx->sample_rate = codec_avctx->sample_rate; + } else { + if (avctx->sample_rate != codec_avctx->sample_rate) + return AVERROR_INVALIDDATA; + } + + if (!frame->nb_samples) { + frame->nb_samples = s->frame->nb_samples; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + } else { + if (frame->nb_samples != s->frame->nb_samples) + return AVERROR_INVALIDDATA; + } + + skip_bits_long(&gb, size * 8); + + if (ch_offset + s->frame->ch_layout.nb_channels > avctx->ch_layout.nb_channels) + return AVERROR_INVALIDDATA; + + if (avctx->sample_fmt != codec_avctx->sample_fmt) + return AVERROR_INVALIDDATA; + + for (int ch = 0; ch < s->frame->ch_layout.nb_channels; ch++) + memcpy(frame->extended_data[ch_offset + ch], + s->frame->extended_data[ch], + av_get_bytes_per_sample(codec_avctx->sample_fmt) * s->frame->nb_samples); + + ch_offset += s->frame->ch_layout.nb_channels; + + if (ch_offset >= avctx->ch_layout.nb_channels) + break; + } + + *got_frame = 1; + + return get_bits_count(&gb) >> 3; +} + +static void ftr_flush(AVCodecContext *avctx) +{ + FTRContext *s = avctx->priv_data; + + for (int i = 0; i < s->nb_context; i++) + avcodec_flush_buffers(s->aac_avctx[i]); +} + +static av_cold int ftr_close(AVCodecContext *avctx) +{ + FTRContext *s = avctx->priv_data; + + for (int i = 0; i < s->nb_context; i++) + avcodec_free_context(&s->aac_avctx[i]); + av_packet_free(&s->packet); + av_frame_free(&s->frame); + + return 0; +} + +const FFCodec ff_ftr_decoder = { + .p.name = "ftr", + .p.long_name = NULL_IF_CONFIG_SMALL("FTR Voice"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_FTR, + .init = ftr_init, + FF_CODEC_DECODE_CB(ftr_decode_frame), + .close = ftr_close, + .flush = ftr_flush, + .priv_data_size = sizeof(FTRContext), + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr_parser.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ftr_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * FTR parser + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * FTR parser + */ + +#include "parser.h" +#include "get_bits.h" +#include "adts_header.h" +#include "adts_parser.h" +#include "mpeg4audio.h" + +typedef struct FTRParseContext { + ParseContext pc; + int skip; + int split; + int frame_index; +} FTRParseContext; + +static int ftr_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + uint8_t tmp[8 + AV_INPUT_BUFFER_PADDING_SIZE]; + FTRParseContext *ftr = s->priv_data; + uint64_t state = ftr->pc.state64; + int next = END_NOT_FOUND; + GetBitContext bits; + AACADTSHeaderInfo hdr; + int size; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { + next = buf_size; + } else { + for (int i = 0; i < buf_size; i++) { + if (ftr->skip > 0) { + ftr->skip--; + if (ftr->skip == 0 && ftr->split) { + ftr->split = 0; + next = i; + s->duration = 1024; + s->key_frame = 1; + break; + } else if (ftr->skip > 0) { + continue; + } + } + + state = (state << 8) | buf[i]; + AV_WB64(tmp, state); + init_get_bits(&bits, tmp + 8 - AV_AAC_ADTS_HEADER_SIZE, + AV_AAC_ADTS_HEADER_SIZE * 8); + + if ((size = ff_adts_header_parse(&bits, &hdr)) > 0) { + ftr->skip = size - 6; + ftr->frame_index += ff_mpeg4audio_channels[hdr.chan_config]; + if (ftr->frame_index >= avctx->ch_layout.nb_channels) { + ftr->frame_index = 0; + ftr->split = 1; + } + } + } + + ftr->pc.state64 = state; + + if (ff_combine_frame(&ftr->pc, next, &buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + } + + *poutbuf = buf; + *poutbuf_size = buf_size; + + return next; +} + +const AVCodecParser ff_ftr_parser = { + .codec_ids = { AV_CODEC_ID_FTR }, + .priv_data_size = sizeof(FTRParseContext), + .parser_parse = ftr_parse, + .parser_close = ff_parse_close, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g2meet.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g2meet.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g2meet.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g2meet.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,19 +29,17 @@ #include #include "libavutil/imgutils.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "avcodec.h" #include "blockdsp.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "elsdec.h" #include "get_bits.h" #include "idctdsp.h" -#include "internal.h" #include "jpegtables.h" -#include "mjpeg.h" #include "mjpegdec.h" #define EPIC_PIX_STACK_SIZE 1024 @@ -61,22 +59,23 @@ COMPR_KEMPF_J_B, }; +/* These tables are already permuted according to ff_zigzag_direct */ static const uint8_t luma_quant[64] = { - 8, 6, 5, 8, 12, 20, 26, 31, - 6, 6, 7, 10, 13, 29, 30, 28, - 7, 7, 8, 12, 20, 29, 35, 28, - 7, 9, 11, 15, 26, 44, 40, 31, - 9, 11, 19, 28, 34, 55, 52, 39, - 12, 18, 28, 32, 41, 52, 57, 46, - 25, 32, 39, 44, 52, 61, 60, 51, - 36, 46, 48, 49, 56, 50, 52, 50 + 8, 6, 6, 7, 6, 5, 8, 7, + 7, 7, 9, 9, 8, 10, 12, 20, + 13, 12, 11, 11, 12, 25, 18, 19, + 15, 20, 29, 26, 31, 30, 29, 26, + 28, 28, 32, 36, 46, 39, 32, 34, + 44, 35, 28, 28, 40, 55, 41, 44, + 48, 49, 52, 52, 52, 31, 39, 57, + 61, 56, 50, 60, 46, 51, 52, 50, }; static const uint8_t chroma_quant[64] = { - 9, 9, 12, 24, 50, 50, 50, 50, - 9, 11, 13, 33, 50, 50, 50, 50, - 12, 13, 28, 50, 50, 50, 50, 50, - 24, 33, 50, 50, 50, 50, 50, 50, + 9, 9, 9, 12, 11, 12, 24, 13, + 13, 24, 50, 33, 28, 33, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, @@ -122,7 +121,7 @@ typedef struct JPGContext { BlockDSPContext bdsp; IDCTDSPContext idsp; - ScanTable scantable; + uint8_t permutated_scantable[64]; VLC dc_vlc[2], ac_vlc[2]; int prev_dc[3]; @@ -182,10 +181,10 @@ if (ret) return ret; - ff_blockdsp_init(&c->bdsp, avctx); + ff_blockdsp_init(&c->bdsp); ff_idctdsp_init(&c->idsp, avctx); - ff_init_scantable(c->idsp.idct_permutation, &c->scantable, - ff_zigzag_direct); + ff_permute_scantable(c->permutated_scantable, ff_zigzag_direct, + c->idsp.idct_permutation); return 0; } @@ -252,8 +251,8 @@ int nbits = val; val = get_xbits(gb, nbits); - val *= qmat[ff_zigzag_direct[pos]]; - block[c->scantable.permutated[pos]] = val; + val *= qmat[pos]; + block[c->permutated_scantable[pos]] = val; } } return 0; @@ -932,8 +931,8 @@ if (ret) { av_log(avctx, AV_LOG_ERROR, - "ePIC: tile decoding failed, frame=%d, tile_x=%d, tile_y=%d\n", - avctx->frame_number, tile_x, tile_y); + "ePIC: tile decoding failed, frame=%"PRId64", tile_x=%d, tile_y=%d\n", + avctx->frame_num, tile_x, tile_y); return AVERROR_INVALIDDATA; } @@ -1624,7 +1623,7 @@ const FFCodec ff_g2m_decoder = { .p.name = "g2m", - .p.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"), + CODEC_LONG_NAME("Go2Meeting"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_G2M, .priv_data_size = sizeof(G2MContext), @@ -1632,5 +1631,5 @@ .close = g2m_decode_end, FF_CODEC_DECODE_CB(g2m_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,9 +38,9 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "g722.h" -#include "internal.h" #define OFFSET(x) offsetof(G722Context, x) #define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM @@ -141,7 +141,7 @@ const FFCodec ff_adpcm_g722_decoder = { .p.name = "g722", - .p.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + CODEC_LONG_NAME("G.722 ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_G722, .priv_data_size = sizeof(G722Context), @@ -149,5 +149,4 @@ FF_CODEC_DECODE_CB(g722_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.priv_class = &g722_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g722enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "g722.h" #include "libavutil/common.h" @@ -373,20 +372,19 @@ const FFCodec ff_adpcm_g722_encoder = { .p.name = "g722", - .p.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + CODEC_LONG_NAME("G.722 ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_G722, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(G722Context), .init = g722_encode_init, .close = g722_encode_close, FF_CODEC_ENCODE_CB(g722_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,10 +33,9 @@ #include "acelp_vectors.h" #include "avcodec.h" #include "celp_filters.h" -#include "celp_math.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "g723_1.h" #define CNG_RANDOM_SEED 12345 @@ -1113,7 +1112,7 @@ const FFCodec ff_g723_1_decoder = { .p.name = "g723_1", - .p.long_name = NULL_IF_CONFIG_SMALL("G.723.1"), + CODEC_LONG_NAME("G.723.1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_G723_1, .priv_data_size = sizeof(G723_1_Context), @@ -1121,5 +1120,4 @@ FF_CODEC_DECODE_CB(g723_1_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.priv_class = &g723_1dec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g723_1enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -126,7 +126,7 @@ { int i; for (i = 0; i < FRAME_LEN; i++) { - *iir = (buf[i] << 15) + ((-*fir) << 15) + MULL2(*iir, 0x7f00); + *iir = (buf[i] - *fir) * (1 << 15) + MULL2(*iir, 0x7f00); *fir = buf[i]; buf[i] = av_clipl_int32((int64_t)*iir + (1 << 15)) >> 16; } @@ -166,7 +166,7 @@ } else { for (i = 1; i <= LPC_ORDER; i++) { temp = ff_dot_product(vector, vector + i, LPC_FRAME - i); - temp = MULL2((temp << scale), binomial_window[i - 1]); + temp = MULL2(temp * (1 << scale), binomial_window[i - 1]); autocorr[i] = av_clipl_int32((int64_t) temp + (1 << 15)) >> 16; } } @@ -193,15 +193,14 @@ temp = 0; for (j = 0; j < i; j++) temp -= lpc[j] * autocorr[i - j - 1]; - temp = ((autocorr[i] << 13) + temp) << 3; + temp = (autocorr[i] * (1 << 13) + temp) * (1 << 3); if (FFABS(temp) >= (error << 16)) break; partial_corr = temp / (error << 1); - lpc[i] = av_clipl_int32((int64_t) (partial_corr << 14) + - (1 << 15)) >> 16; + lpc[i] = (partial_corr + (1 << 1)) >> 2; /* Update the prediction error */ temp = MULL2(temp, partial_corr); @@ -210,8 +209,8 @@ memcpy(vector, lpc, i * sizeof(int16_t)); for (j = 0; j < i; j++) { - temp = partial_corr * vector[i - j - 1] << 1; - lpc[j] = av_clipl_int32((int64_t) (lpc[j] << 16) - temp + + temp = partial_corr * vector[i - j - 1] * 2; + lpc[j] = av_clipl_int32((int64_t) (lpc[j] * (1 << 16)) - temp + (1 << 15)) >> 16; } } @@ -260,9 +259,9 @@ /* Compute the remaining coefficients */ for (i = 0; i < LPC_ORDER / 2; i++) { /* f1 */ - f[2 * i + 2] = -f[2 * i] - ((lsp[i] + lsp[LPC_ORDER - 1 - i]) << 12); + f[2 * i + 2] = -f[2 * i] - (lsp[i] + lsp[LPC_ORDER - 1 - i]) * (1 << 12); /* f2 */ - f[2 * i + 3] = f[2 * i + 1] - ((lsp[i] - lsp[LPC_ORDER - 1 - i]) << 12); + f[2 * i + 3] = f[2 * i + 1] - (lsp[i] - lsp[LPC_ORDER - 1 - i]) * (1 << 12); } /* Divide f1[5] and f2[5] by 2 for use in polynomial evaluation */ @@ -277,7 +276,7 @@ shift = ff_g723_1_normalize_bits(max, 31); for (i = 0; i < LPC_ORDER + 2; i++) - f[i] = av_clipl_int32((int64_t) (f[i] << shift) + (1 << 15)) >> 16; + f[i] = av_clipl_int32((int64_t) (f[i] * (1 << shift)) + (1 << 15)) >> 16; /** * Evaluate F1 and F2 at uniform intervals of pi/256 along the @@ -294,7 +293,7 @@ temp = 0; for (j = 0; j <= LPC_ORDER / 2; j++) temp += f[LPC_ORDER - 2 * j + p] * ff_g723_1_cos_tab[i * j % COS_TBL_SIZE]; - cur_val = av_clipl_int32(temp << 1); + cur_val = av_clipl_int32(temp * 2); /* Check for sign change, indicating a zero crossing */ if ((cur_val ^ prev_val) < 0) { @@ -318,7 +317,7 @@ for (j = 0; j <= LPC_ORDER / 2; j++) temp += f[LPC_ORDER - 2 * j + p] * ff_g723_1_cos_tab[i * j % COS_TBL_SIZE]; - cur_val = av_clipl_int32(temp << 1); + cur_val = av_clipl_int32(temp * 2); } prev_val = cur_val; } @@ -345,7 +344,7 @@ temp[j] = (weight[j + (offset)] * ff_g723_1_lsp_band##num[i][j] + \ (1 << 14)) >> 15; \ } \ - error = ff_g723_1_dot_product(lsp + (offset), temp, size) << 1; \ + error = ff_g723_1_dot_product(lsp + (offset), temp, size) * 2; \ error -= ff_g723_1_dot_product(ff_g723_1_lsp_band##num[i], temp, size); \ if (error > max) { \ max = error; \ @@ -420,7 +419,7 @@ iir_coef[n - 1] * dest[m - n]; } - dest[m] = av_clipl_int32((src[m] << 16) + (filter << 3) + + dest[m] = av_clipl_int32(src[m] * (1 << 16) + filter * (1 << 3) + (1 << 15)) >> 16; } } @@ -560,7 +559,7 @@ exp = ff_g723_1_normalize_bits(max, 31); for (i = 0; i < 15; i++) { - energy[i] = av_clipl_int32((int64_t)(energy[i] << exp) + + energy[i] = av_clipl_int32((int64_t)(energy[i] * (1 << exp)) + (1 << 15)) >> 16; } @@ -614,8 +613,8 @@ int i; for (i = 0; i < SUBFRAME_LEN; i++) { - int64_t temp = hf->gain * src[i - hf->index] << 1; - dest[i] = av_clipl_int32((src[i] << 16) - temp + (1 << 15)) >> 16; + int64_t temp = hf->gain * src[i - hf->index] * 2; + dest[i] = av_clipl_int32(src[i] * (1 << 16) - temp + (1 << 15)) >> 16; } } @@ -623,8 +622,8 @@ { int i; for (i = 0; i < SUBFRAME_LEN; i++) { - int64_t temp = hf->gain * src[i - hf->index] << 1; - dest[i] = av_clipl_int32(((dest[i] - src[i]) << 16) + temp + + int64_t temp = hf->gain * src[i - hf->index] * 2; + dest[i] = av_clipl_int32((dest[i] - src[i]) * (1 << 16) + temp + (1 << 15)) >> 16; } } @@ -656,7 +655,7 @@ for (j = 1; j <= LPC_ORDER; j++) temp -= qnt_lpc[j - 1] * bptr_16[i - j]; - buf[i] = (src[i] << 15) + (temp << 3); + buf[i] = src[i] * (1 << 15) + temp * (1 << 3); bptr_16[i] = av_clipl_int32(buf[i] + (1 << 15)) >> 16; } @@ -666,7 +665,7 @@ fir -= perf_lpc[j - 1] * bptr_16[i - j]; iir += perf_lpc[j + LPC_ORDER - 1] * dest[i - j]; } - dest[i] = av_clipl_int32(((buf[i] + (fir << 3)) << scale) + (iir << 3) + + dest[i] = av_clipl_int32((buf[i] + fir * (1 << 3)) * (1 << scale) + iir * (1 << 3) + (1 << 15)) >> 16; } memcpy(perf_fir, buf_16 + SUBFRAME_LEN, sizeof(int16_t) * LPC_ORDER); @@ -715,23 +714,22 @@ temp = 0; for (k = 0; k <= j; k++) temp += residual[PITCH_ORDER - 1 + k] * impulse_resp[j - k]; - flt_buf[PITCH_ORDER - 1][j] = av_clipl_int32((temp << 1) + - (1 << 15)) >> 16; + flt_buf[PITCH_ORDER - 1][j] = av_clipl_int32(temp * 2 + (1 << 15)) >> 16; } for (j = PITCH_ORDER - 2; j >= 0; j--) { - flt_buf[j][0] = ((residual[j] << 13) + (1 << 14)) >> 15; + flt_buf[j][0] = (residual[j] + (1 << 1)) >> 2; for (k = 1; k < SUBFRAME_LEN; k++) { - temp = (flt_buf[j + 1][k - 1] << 15) + + temp = flt_buf[j + 1][k - 1] * (1 << 15) + residual[j] * impulse_resp[k]; - flt_buf[j][k] = av_clipl_int32((temp << 1) + (1 << 15)) >> 16; + flt_buf[j][k] = av_clipl_int32(temp * 2 + (1 << 15)) >> 16; } } /* Compute crosscorrelation with the signal */ for (j = 0; j < PITCH_ORDER; j++) { temp = ff_dot_product(buf, flt_buf[j], SUBFRAME_LEN); - ccr_buf[count++] = av_clipl_int32(temp << 1); + ccr_buf[count++] = av_clipl_int32(temp * 2); } /* Compute energies */ @@ -743,7 +741,7 @@ for (j = 1; j < PITCH_ORDER; j++) { for (k = 0; k < j; k++) { temp = ff_dot_product(flt_buf[j], flt_buf[k], SUBFRAME_LEN); - ccr_buf[count++] = av_clipl_int32(temp << 2); + ccr_buf[count++] = av_clipl_int32(temp * (1 << 2)); } } } @@ -756,7 +754,7 @@ temp = ff_g723_1_normalize_bits(max, 31); for (i = 0; i < 20 * iter; i++) - ccr_buf[i] = av_clipl_int32((int64_t) (ccr_buf[i] << temp) + + ccr_buf[i] = av_clipl_int32((int64_t) (ccr_buf[i] * (1 << temp)) + (1 << 15)) >> 16; max = 0; @@ -804,11 +802,11 @@ int i, j; /* Subtract adaptive CB contribution to obtain the residual */ for (i = 0; i < SUBFRAME_LEN; i++) { - int64_t temp = buf[i] << 14; + int64_t temp = buf[i] * (1 << 14); for (j = 0; j <= i; j++) temp -= residual[j] * impulse_resp[i - j]; - buf[i] = av_clipl_int32((temp << 2) + (1 << 15)) >> 16; + buf[i] = av_clipl_int32(temp * (1 << 2) + (1 << 15)) >> 16; } } @@ -852,7 +850,7 @@ for (i = 1; i < SUBFRAME_LEN; i++) { temp = ff_g723_1_dot_product(temp_corr + i, temp_corr, SUBFRAME_LEN - i); - impulse_corr[i] = av_clipl_int32((temp << scale) + (1 << 15)) >> 16; + impulse_corr[i] = av_clipl_int32(temp * (1 << scale) + (1 << 15)) >> 16; } /* Compute crosscorrelation of impulse response with residual signal */ @@ -862,7 +860,7 @@ if (scale < 0) ccr1[i] = temp >> -scale; else - ccr1[i] = av_clipl_int32(temp << scale); + ccr1[i] = av_clipl_int32(temp * (1 << scale)); } /* Search loop */ @@ -911,7 +909,7 @@ continue; temp = impulse_corr[FFABS(l - param.pulse_pos[k - 1])]; temp = av_clipl_int32((int64_t) temp * - param.pulse_sign[k - 1] << 1); + param.pulse_sign[k - 1] * 2); ccr2[l] -= temp; temp = FFABS(ccr2[l]); if (temp > max) { @@ -935,17 +933,17 @@ temp = 0; for (l = 0; l <= k; l++) { int prod = av_clipl_int32((int64_t) temp_corr[l] * - impulse_r[k - l] << 1); + impulse_r[k - l] * 2); temp = av_clipl_int32(temp + prod); } - temp_corr[k] = temp << 2 >> 16; + temp_corr[k] = temp >> 14; } /* Compute square of error */ err = 0; for (k = 0; k < SUBFRAME_LEN; k++) { int64_t prod; - prod = av_clipl_int32((int64_t) buf[k] * temp_corr[k] << 1); + prod = av_clipl_int32((int64_t) buf[k] * temp_corr[k] * 2); err = av_clipl_int32(err - prod); prod = av_clipl_int32((int64_t) temp_corr[k] * temp_corr[k]); err = av_clipl_int32(err + prod); @@ -1205,7 +1203,7 @@ memmove(p->prev_excitation, p->prev_excitation + SUBFRAME_LEN, sizeof(int16_t) * (PITCH_MAX - SUBFRAME_LEN)); for (j = 0; j < SUBFRAME_LEN; j++) - in[j] = av_clip_int16((in[j] << 1) + impulse_resp[j]); + in[j] = av_clip_int16(in[j] * 2 + impulse_resp[j]); memcpy(p->prev_excitation + PITCH_MAX - SUBFRAME_LEN, in, sizeof(int16_t) * SUBFRAME_LEN); @@ -1240,10 +1238,10 @@ const FFCodec ff_g723_1_encoder = { .p.name = "g723_1", - .p.long_name = NULL_IF_CONFIG_SMALL("G.723.1"), + CODEC_LONG_NAME("G.723.1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_G723_1, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(G723_1_Context), .init = g723_1_encode_init, FF_CODEC_ENCODE_CB(g723_1_encode_frame), @@ -1254,5 +1252,4 @@ .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g726.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g726.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g726.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g726.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,8 +30,8 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" -#include "internal.h" #include "get_bits.h" #include "put_bits.h" @@ -402,10 +402,11 @@ #if CONFIG_ADPCM_G726_ENCODER const FFCodec ff_adpcm_g726_encoder = { .p.name = "g726", - .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), + CODEC_LONG_NAME("G.726 ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_G726, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, FF_CODEC_ENCODE_CB(g726_encode_frame), @@ -413,17 +414,17 @@ AV_SAMPLE_FMT_NONE }, .p.priv_class = &g726_class, .defaults = defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ADPCM_G726LE_ENCODER const FFCodec ff_adpcm_g726le_encoder = { .p.name = "g726le", - .p.long_name = NULL_IF_CONFIG_SMALL("G.726 little endian ADPCM (\"right-justified\")"), + CODEC_LONG_NAME("G.726 little endian ADPCM (\"right-justified\")"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_G726LE, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, FF_CODEC_ENCODE_CB(g726_encode_frame), @@ -431,7 +432,6 @@ AV_SAMPLE_FMT_NONE }, .p.priv_class = &g726_class, .defaults = defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -504,7 +504,7 @@ #if CONFIG_ADPCM_G726_DECODER const FFCodec ff_adpcm_g726_decoder = { .p.name = "g726", - .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), + CODEC_LONG_NAME("G.726 ADPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_G726, .priv_data_size = sizeof(G726Context), @@ -512,7 +512,6 @@ FF_CODEC_DECODE_CB(g726_decode_frame), .flush = g726_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -526,7 +525,6 @@ FF_CODEC_DECODE_CB(g726_decode_frame), .flush = g726_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + CODEC_LONG_NAME("G.726 ADPCM little-endian"), }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g729dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g729dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g729dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/g729dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,12 +27,11 @@ #include "get_bits.h" #include "audiodsp.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "g729.h" #include "lsp.h" -#include "celp_math.h" #include "celp_filters.h" #include "acelp_filters.h" #include "acelp_pitch_delay.h" @@ -754,7 +753,7 @@ const FFCodec ff_g729_decoder = { .p.name = "g729", - .p.long_name = NULL_IF_CONFIG_SMALL("G.729"), + CODEC_LONG_NAME("G.729"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_G729, .priv_data_size = sizeof(G729Context), @@ -762,12 +761,11 @@ FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; const FFCodec ff_acelp_kelvin_decoder = { .p.name = "acelp.kelvin", - .p.long_name = NULL_IF_CONFIG_SMALL("Sipro ACELP.KELVIN"), + CODEC_LONG_NAME("Sipro ACELP.KELVIN"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ACELP_KELVIN, .priv_data_size = sizeof(G729Context), @@ -775,5 +773,4 @@ FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gdv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gdv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gdv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gdv.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" typedef struct GDVContext { AVCodecContext *avctx; @@ -562,7 +561,7 @@ const FFCodec ff_gdv_decoder = { .p.name = "gdv", - .p.long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"), + CODEC_LONG_NAME("Gremlin Digital Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_GDV, .priv_data_size = sizeof(GDVContext), @@ -570,5 +569,4 @@ .close = gdv_decode_close, FF_CODEC_DECODE_CB(gdv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gemdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gemdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gemdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gemdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static const uint32_t gem_color_palette[16]={ 0xFFFFFFFF, 0xFFFF0000, 0xFF00FF00, 0xFFFFFF00, @@ -352,7 +352,7 @@ const FFCodec ff_gem_decoder = { .p.name = "gem", - .p.long_name = NULL_IF_CONFIG_SMALL("GEM Raster image"), + CODEC_LONG_NAME("GEM Raster image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_GEM, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_bits.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_bits.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_bits.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_bits.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,5 @@ /* * Copyright (c) 2004 Michael Niedermayer - * Copyright (c) 2016 Alexandra Hájková * * This file is part of FFmpeg. * @@ -58,12 +57,55 @@ #define CACHED_BITSTREAM_READER 0 #endif +#if CACHED_BITSTREAM_READER + +// we always want the LE implementation, to provide get_bits_le() +#define BITSTREAM_LE + +#ifndef BITSTREAM_READER_LE +# define BITSTREAM_BE +# define BITSTREAM_DEFAULT_BE +#endif + +#include "bitstream.h" + +#undef BITSTREAM_LE +#undef BITSTREAM_BE +#undef BITSTREAM_DEFAULT_BE + +typedef BitstreamContext GetBitContext; + +#define get_bits_count bits_tell +#define get_bits_left bits_left +#define skip_bits_long bits_skip +#define skip_bits bits_skip +#define get_bits bits_read_nz +#define get_bitsz bits_read +#define get_bits_long bits_read +#define get_bits1 bits_read_bit +#define get_bits64 bits_read_64 +#define get_xbits bits_read_xbits +#define get_sbits bits_read_signed_nz +#define get_sbits_long bits_read_signed +#define show_bits bits_peek +#define show_bits_long bits_peek +#define init_get_bits bits_init +#define init_get_bits8 bits_init8 +#define align_get_bits bits_align +#define get_vlc2 bits_read_vlc + +#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) + +#define show_bits1(s) bits_peek(s, 1) +#define skip_bits1(s) bits_skip(s, 1) + +#define skip_1stop_8data_bits bits_skip_1stop_8data + +#else // CACHED_BITSTREAM_READER + typedef struct GetBitContext { const uint8_t *buffer, *buffer_end; -#if CACHED_BITSTREAM_READER - uint64_t cache; - unsigned bits_left; -#endif int index; int size_in_bits; int size_in_bits_plus8; @@ -120,16 +162,12 @@ * For examples see get_bits, show_bits, skip_bits, get_vlc. */ -#if CACHED_BITSTREAM_READER -# define MIN_CACHE_BITS 64 -#elif defined LONG_BITSTREAM_READER +#if defined LONG_BITSTREAM_READER # define MIN_CACHE_BITS 32 #else # define MIN_CACHE_BITS 25 #endif -#if !CACHED_BITSTREAM_READER - #define OPEN_READER_NOSIZE(name, gb) \ unsigned int name ## _index = (gb)->index; \ unsigned int av_unused name ## _cache @@ -214,72 +252,11 @@ #define GET_CACHE(name, gb) ((uint32_t) name ## _cache) -#endif static inline int get_bits_count(const GetBitContext *s) { -#if CACHED_BITSTREAM_READER - return s->index - s->bits_left; -#else return s->index; -#endif -} - -#if CACHED_BITSTREAM_READER -static inline void refill_32(GetBitContext *s, int is_le) -{ -#if !UNCHECKED_BITSTREAM_READER - if (s->index >> 3 >= s->buffer_end - s->buffer) - return; -#endif - - if (is_le) - s->cache = (uint64_t)AV_RL32(s->buffer + (s->index >> 3)) << s->bits_left | s->cache; - else - s->cache = s->cache | (uint64_t)AV_RB32(s->buffer + (s->index >> 3)) << (32 - s->bits_left); - s->index += 32; - s->bits_left += 32; -} - -static inline void refill_64(GetBitContext *s, int is_le) -{ -#if !UNCHECKED_BITSTREAM_READER - if (s->index >> 3 >= s->buffer_end - s->buffer) - return; -#endif - - if (is_le) - s->cache = AV_RL64(s->buffer + (s->index >> 3)); - else - s->cache = AV_RB64(s->buffer + (s->index >> 3)); - s->index += 64; - s->bits_left = 64; -} - -static inline uint64_t get_val(GetBitContext *s, unsigned n, int is_le) -{ - uint64_t ret; - av_assert2(n>0 && n<=63); - if (is_le) { - ret = s->cache & ((UINT64_C(1) << n) - 1); - s->cache >>= n; - } else { - ret = s->cache >> (64 - n); - s->cache <<= n; - } - s->bits_left -= n; - return ret; -} - -static inline unsigned show_val(const GetBitContext *s, unsigned n) -{ -#ifdef BITSTREAM_READER_LE - return s->cache & ((UINT64_C(1) << n) - 1); -#else - return s->cache >> (64 - n); -#endif } -#endif /** * Skips the specified number of bits. @@ -290,28 +267,12 @@ */ static inline void skip_bits_long(GetBitContext *s, int n) { -#if CACHED_BITSTREAM_READER - skip_bits(s, n); -#else #if UNCHECKED_BITSTREAM_READER s->index += n; #else s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index); #endif -#endif -} - -#if CACHED_BITSTREAM_READER -static inline void skip_remaining(GetBitContext *s, unsigned n) -{ -#ifdef BITSTREAM_READER_LE - s->cache >>= n; -#else - s->cache <<= n; -#endif - s->bits_left -= n; } -#endif /** * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB). @@ -320,13 +281,6 @@ */ static inline int get_xbits(GetBitContext *s, int n) { -#if CACHED_BITSTREAM_READER - int32_t cache = show_bits(s, 32); - int sign = ~cache >> 31; - skip_remaining(s, n); - - return ((((uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign; -#else register int sign; register int32_t cache; OPEN_READER(re, s); @@ -337,10 +291,8 @@ LAST_SKIP_BITS(re, s, n); CLOSE_READER(re, s); return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; -#endif } -#if !CACHED_BITSTREAM_READER static inline int get_xbits_le(GetBitContext *s, int n) { register int sign; @@ -354,22 +306,16 @@ CLOSE_READER(re, s); return (zero_extend(sign ^ cache, n) ^ sign) - sign; } -#endif static inline int get_sbits(GetBitContext *s, int n) { register int tmp; -#if CACHED_BITSTREAM_READER - av_assert2(n>0 && n<=25); - tmp = sign_extend(get_bits(s, n), n); -#else OPEN_READER(re, s); av_assert2(n>0 && n<=25); UPDATE_CACHE(re, s); tmp = SHOW_SBITS(re, s, n); LAST_SKIP_BITS(re, s, n); CLOSE_READER(re, s); -#endif return tmp; } @@ -379,32 +325,12 @@ static inline unsigned int get_bits(GetBitContext *s, int n) { register unsigned int tmp; -#if CACHED_BITSTREAM_READER - - av_assert2(n>0 && n<=32); - if (n > s->bits_left) { -#ifdef BITSTREAM_READER_LE - refill_32(s, 1); -#else - refill_32(s, 0); -#endif - if (s->bits_left < 32) - s->bits_left = n; - } - -#ifdef BITSTREAM_READER_LE - tmp = get_val(s, n, 1); -#else - tmp = get_val(s, n, 0); -#endif -#else OPEN_READER(re, s); av_assert2(n>0 && n<=25); UPDATE_CACHE(re, s); tmp = SHOW_UBITS(re, s, n); LAST_SKIP_BITS(re, s, n); CLOSE_READER(re, s); -#endif av_assert2(tmp < UINT64_C(1) << n); return tmp; } @@ -419,16 +345,6 @@ static inline unsigned int get_bits_le(GetBitContext *s, int n) { -#if CACHED_BITSTREAM_READER - av_assert2(n>0 && n<=32); - if (n > s->bits_left) { - refill_32(s, 1); - if (s->bits_left < 32) - s->bits_left = n; - } - - return get_val(s, n, 1); -#else register int tmp; OPEN_READER(re, s); av_assert2(n>0 && n<=25); @@ -437,7 +353,6 @@ LAST_SKIP_BITS(re, s, n); CLOSE_READER(re, s); return tmp; -#endif } /** @@ -446,71 +361,22 @@ static inline unsigned int show_bits(GetBitContext *s, int n) { register unsigned int tmp; -#if CACHED_BITSTREAM_READER - if (n > s->bits_left) -#ifdef BITSTREAM_READER_LE - refill_32(s, 1); -#else - refill_32(s, 0); -#endif - - tmp = show_val(s, n); -#else OPEN_READER_NOSIZE(re, s); av_assert2(n>0 && n<=25); UPDATE_CACHE(re, s); tmp = SHOW_UBITS(re, s, n); -#endif return tmp; } static inline void skip_bits(GetBitContext *s, int n) { -#if CACHED_BITSTREAM_READER - if (n < s->bits_left) - skip_remaining(s, n); - else { - n -= s->bits_left; - s->cache = 0; - s->bits_left = 0; - - if (n >= 64) { - unsigned skip = (n / 8) * 8; - - n -= skip; - s->index += skip; - } -#ifdef BITSTREAM_READER_LE - refill_64(s, 1); -#else - refill_64(s, 0); -#endif - if (n) - skip_remaining(s, n); - } -#else OPEN_READER(re, s); LAST_SKIP_BITS(re, s, n); CLOSE_READER(re, s); -#endif } static inline unsigned int get_bits1(GetBitContext *s) { -#if CACHED_BITSTREAM_READER - if (!s->bits_left) -#ifdef BITSTREAM_READER_LE - refill_64(s, 1); -#else - refill_64(s, 0); -#endif - -#ifdef BITSTREAM_READER_LE - return get_val(s, 1, 1); -#else - return get_val(s, 1, 0); -#endif -#else unsigned int index = s->index; uint8_t result = s->buffer[index >> 3]; #ifdef BITSTREAM_READER_LE @@ -527,7 +393,6 @@ s->index = index; return result; -#endif } static inline unsigned int show_bits1(GetBitContext *s) @@ -548,10 +413,6 @@ av_assert2(n>=0 && n<=32); if (!n) { return 0; -#if CACHED_BITSTREAM_READER - } - return get_bits(s, n); -#else } else if (n <= MIN_CACHE_BITS) { return get_bits(s, n); } else { @@ -563,7 +424,6 @@ return ret | get_bits(s, n - 16); #endif } -#endif } /** @@ -597,6 +457,18 @@ } /** + * Read 0-64 bits as a signed integer. + */ +static inline int64_t get_sbits64(GetBitContext *s, int n) +{ + // sign_extend(x, 0) is undefined + if (!n) + return 0; + + return sign_extend64(get_bits64(s, n), n); +} + +/** * Show 0-32 bits. */ static inline unsigned int show_bits_long(GetBitContext *s, int n) @@ -609,8 +481,17 @@ } } -static inline int init_get_bits_xe(GetBitContext *s, const uint8_t *buffer, - int bit_size, int is_le) + +/** + * Initialize GetBitContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bit at once and could read over the end + * @param bit_size the size of the buffer in bits + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. + */ +static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, + int bit_size) { int buffer_size; int ret = 0; @@ -629,12 +510,6 @@ s->buffer_end = buffer + buffer_size; s->index = 0; -#if CACHED_BITSTREAM_READER - s->cache = 0; - s->bits_left = 0; - refill_64(s, is_le); -#endif - return ret; } @@ -643,24 +518,6 @@ * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes * larger than the actual read bits because some optimized bitstream * readers read 32 or 64 bit at once and could read over the end - * @param bit_size the size of the buffer in bits - * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. - */ -static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, - int bit_size) -{ -#ifdef BITSTREAM_READER_LE - return init_get_bits_xe(s, buffer, bit_size, 1); -#else - return init_get_bits_xe(s, buffer, bit_size, 0); -#endif -} - -/** - * Initialize GetBitContext. - * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes - * larger than the actual read bits because some optimized bitstream - * readers read 32 or 64 bit at once and could read over the end * @param byte_size the size of the buffer in bytes * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. */ @@ -677,7 +534,7 @@ { if (byte_size > INT_MAX / 8 || byte_size < 0) byte_size = -1; - return init_get_bits_xe(s, buffer, byte_size * 8, 1); + return init_get_bits(s, buffer, byte_size * 8); } static inline const uint8_t *align_get_bits(GetBitContext *s) @@ -762,19 +619,6 @@ SKIP_BITS(name, gb, n); \ } while (0) -/* Return the LUT element for the given bitstream configuration. */ -static inline int set_idx(GetBitContext *s, int code, int *n, int *nb_bits, - const VLCElem *table) -{ - unsigned idx; - - *nb_bits = -*n; - idx = show_bits(s, *nb_bits) + code; - *n = table[idx].len; - - return table[idx].sym; -} - /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be @@ -787,24 +631,6 @@ static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth) { -#if CACHED_BITSTREAM_READER - int nb_bits; - unsigned idx = show_bits(s, bits); - int code = table[idx].sym; - int n = table[idx].len; - - if (max_depth > 1 && n < 0) { - skip_remaining(s, bits); - code = set_idx(s, code, &n, &nb_bits, table); - if (max_depth > 2 && n < 0) { - skip_remaining(s, nb_bits); - code = set_idx(s, code, &n, &nb_bits, table); - } - } - skip_remaining(s, n); - - return code; -#else int code; OPEN_READER(re, s); @@ -815,7 +641,6 @@ CLOSE_READER(re, s); return code; -#endif } static inline int decode012(GetBitContext *gb) @@ -855,4 +680,6 @@ return 0; } +#endif // CACHED_BITSTREAM_READER + #endif /* AVCODEC_GET_BITS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_buffer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_buffer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_buffer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/get_buffer.c 2023-03-03 13:29:59.000000000 +0000 @@ -246,7 +246,6 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic) { FramePool *pool = (FramePool*)s->internal->pool->data; - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format); int i; if (pic->data[0] || pic->data[1] || pic->data[2] || pic->data[3]) { @@ -254,13 +253,6 @@ return -1; } - if (!desc) { - av_log(s, AV_LOG_ERROR, - "Unable to get pixel format descriptor for format %s\n", - av_get_pix_fmt_name(pic->format)); - return AVERROR(EINVAL); - } - memset(pic->data, 0, sizeof(pic->data)); pic->extended_data = pic->data; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gif.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gif.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gif.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gif.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,7 @@ * @see http://www.w3.org/Graphics/GIF/spec-gif89a.txt */ -#define BITSTREAM_WRITER_LE #include "libavutil/opt.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" @@ -40,8 +38,6 @@ #include "lzw.h" #include "gif.h" -#include "put_bits.h" - #define DEFAULT_TRANSPARENCY_INDEX 0x1f typedef struct GIFContext { @@ -322,7 +318,7 @@ disposal = GCE_DISPOSAL_INPLACE; } - if (s->image || !avctx->frame_number) { /* GIF header */ + if (s->image || !avctx->frame_num) { /* GIF header */ const uint32_t *global_palette = palette ? palette : s->palette; const AVRational sar = avctx->sample_aspect_ratio; int64_t aspect = 0; @@ -508,13 +504,13 @@ if (!s->image) { av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, (AVFrame*)pict); + ret = av_frame_ref(s->last_frame, pict); if (ret < 0) return ret; } pkt->size = outbuf_ptr - pkt->data; - if (s->image || !avctx->frame_number) + if (s->image || !avctx->frame_num) pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; @@ -554,9 +550,10 @@ const FFCodec ff_gif_encoder = { .p.name = "gif", - .p.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), + CODEC_LONG_NAME("GIF (Graphics Interchange Format)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_GIF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(GIFContext), .init = gif_encode_init, FF_CODEC_ENCODE_CB(gif_encode_frame), @@ -566,5 +563,5 @@ AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, .p.priv_class = &gif_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gifdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gifdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gifdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gifdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,12 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "lzw.h" #include "gif.h" @@ -475,7 +474,7 @@ s->frame->pts = avpkt->pts; s->frame->pkt_dts = avpkt->dts; - s->frame->pkt_duration = avpkt->duration; + s->frame->duration = avpkt->duration; if (avpkt->size >= 6) { s->keyframe = memcmp(avpkt->data, gif87a_sig, 6) == 0 || @@ -558,7 +557,7 @@ const FFCodec ff_gif_decoder = { .p.name = "gif", - .p.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), + CODEC_LONG_NAME("GIF (Graphics Interchange Format)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_GIF, .priv_data_size = sizeof(GifState), @@ -566,7 +565,6 @@ .close = gif_decode_close, FF_CODEC_DECODE_CB(gif_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &decoder_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gsmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gsmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gsmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/gsmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,8 +29,8 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "msgsmdec.h" #include "gsmdec_template.c" @@ -115,7 +115,7 @@ #if CONFIG_GSM_DECODER const FFCodec ff_gsm_decoder = { .p.name = "gsm", - .p.long_name = NULL_IF_CONFIG_SMALL("GSM"), + CODEC_LONG_NAME("GSM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM, .priv_data_size = sizeof(GSMContext), @@ -123,13 +123,12 @@ FF_CODEC_DECODE_CB(gsm_decode_frame), .flush = gsm_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_GSM_MS_DECODER const FFCodec ff_gsm_ms_decoder = { .p.name = "gsm_ms", - .p.long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"), + CODEC_LONG_NAME("GSM Microsoft variant"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM_MS, .priv_data_size = sizeof(GSMContext), @@ -137,6 +136,5 @@ FF_CODEC_DECODE_CB(gsm_decode_frame), .flush = gsm_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,9 @@ #define IS_FIL(a) ((a) & MB_TYPE_H261_FIL) -static void h261_loop_filter(uint8_t *src, int stride) +static void h261_loop_filter(uint8_t *src, ptrdiff_t stride) { - int x, y, xy, yz; + int x, y; int temp[64]; for (x = 0; x < 8; x++) { @@ -41,8 +41,8 @@ } for (y = 1; y < 7; y++) { for (x = 0; x < 8; x++) { - xy = y * stride + x; - yz = y * 8 + x; + ptrdiff_t xy = y * stride + x; + ptrdiff_t yz = y * 8 + x; temp[yz] = src[xy - stride] + 2 * src[xy] + src[xy + stride]; } } @@ -51,8 +51,8 @@ src[y * stride] = (temp[y * 8] + 2) >> 2; src[y * stride + 7] = (temp[y * 8 + 7] + 2) >> 2; for (x = 1; x < 7; x++) { - xy = y * stride + x; - yz = y * 8 + x; + ptrdiff_t xy = y * stride + x; + ptrdiff_t yz = y * 8 + x; src[xy] = (temp[yz - 1] + 2 * temp[yz] + temp[yz + 1] + 8) >> 4; } } @@ -61,8 +61,8 @@ void ff_h261_loop_filter(MpegEncContext *s) { H261Context *const h = s->private_ctx; - const int linesize = s->linesize; - const int uvlinesize = s->uvlinesize; + const ptrdiff_t linesize = s->linesize; + const ptrdiff_t uvlinesize = s->uvlinesize; uint8_t *dest_y = s->dest[0]; uint8_t *dest_cb = s->dest[1]; uint8_t *dest_cr = s->dest[2]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,12 +29,12 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "h261.h" -#include "internal.h" #define H261_MBA_VLC_BITS 8 #define H261_MTYPE_VLC_BITS 6 @@ -101,6 +101,15 @@ return 0; } +static inline void h261_init_dest(MpegEncContext *s) +{ + const unsigned block_size = 8 >> s->avctx->lowres; + ff_init_block_index(s); + s->dest[0] += 2 * block_size; + s->dest[1] += block_size; + s->dest[2] += block_size; +} + /** * Decode the group of blocks header or slice header. * @return <0 if an error occurred @@ -213,8 +222,7 @@ s->mb_x = ((h->gob_number - 1) % 2) * 11 + i % 11; s->mb_y = ((h->gob_number - 1) / 2) * 3 + i / 11; xy = s->mb_x + s->mb_y * s->mb_stride; - ff_init_block_index(s); - ff_update_block_index(s); + h261_init_dest(s); for (j = 0; j < 6; j++) s->block_last_index[j] = -1; @@ -399,8 +407,7 @@ s->mb_x = ((h->gob_number - 1) % 2) * 11 + ((h->current_mba - 1) % 11); s->mb_y = ((h->gob_number - 1) / 2) * 3 + ((h->current_mba - 1) / 11); xy = s->mb_x + s->mb_y * s->mb_stride; - ff_init_block_index(s); - ff_update_block_index(s); + h261_init_dest(s); // Read mtype com->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2); @@ -603,7 +610,7 @@ MpegEncContext *s = &h->s; int ret; - ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size); + ff_dlog(avctx, "*****frame %"PRId64" size=%d\n", avctx->frame_num, buf_size); ff_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]); h->gob_start_code_skipped = 0; @@ -682,7 +689,7 @@ const FFCodec ff_h261_decoder = { .p.name = "h261", - .p.long_name = NULL_IF_CONFIG_SMALL("H.261"), + CODEC_LONG_NAME("H.261"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H261, .priv_data_size = sizeof(H261DecContext), @@ -690,6 +697,5 @@ .close = h261_decode_end, FF_CODEC_DECODE_CB(h261_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.max_lowres = 3, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,25 +46,16 @@ H261Context common; int gob_number; + enum { + H261_QCIF = 0, + H261_CIF = 1, + } format; } H261EncContext; -int ff_h261_get_picture_format(int width, int height) -{ - // QCIF - if (width == 176 && height == 144) - return 0; - // CIF - else if (width == 352 && height == 288) - return 1; - // ERROR - else - return AVERROR(EINVAL); -} - -void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number) +void ff_h261_encode_picture_header(MpegEncContext *s) { H261EncContext *const h = (H261EncContext *)s; - int format, temp_ref; + int temp_ref; align_put_bits(&s->pb); @@ -81,18 +72,13 @@ put_bits(&s->pb, 1, 0); /* camera off */ put_bits(&s->pb, 1, s->pict_type == AV_PICTURE_TYPE_I); /* freeze picture release on/off */ - format = ff_h261_get_picture_format(s->width, s->height); - - put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */ + put_bits(&s->pb, 1, h->format); /* 0 == QCIF, 1 == CIF */ put_bits(&s->pb, 1, 1); /* still image mode */ put_bits(&s->pb, 1, 1); /* reserved */ put_bits(&s->pb, 1, 0); /* no PEI */ - if (format == 0) - h->gob_number = -1; - else - h->gob_number = 0; + h->gob_number = h->format - 1; s->mb_skip_run = 0; } @@ -102,7 +88,7 @@ static void h261_encode_gob_header(MpegEncContext *s, int mb_line) { H261EncContext *const h = (H261EncContext *)s; - if (ff_h261_get_picture_format(s->width, s->height) == 0) { + if (h->format == H261_QCIF) { h->gob_number += 2; // QCIF } else { h->gob_number++; // CIF @@ -118,6 +104,7 @@ void ff_h261_reorder_mb_index(MpegEncContext *s) { + const H261EncContext *const h = (H261EncContext*)s; int index = s->mb_x + s->mb_y * s->mb_width; if (index % 11 == 0) { @@ -129,7 +116,7 @@ /* for CIF the GOB's are fragmented in the middle of a scanline * that's why we need to adjust the x and y index of the macroblocks */ - if (ff_h261_get_picture_format(s->width, s->height) == 1) { // CIF + if (h->format == H261_CIF) { s->mb_x = index % 11; index /= 11; s->mb_y = index % 3; @@ -139,7 +126,7 @@ s->mb_y += 3 * index; ff_init_block_index(s); - ff_update_block_index(s); + ff_update_block_index(s, 8, 0, 1); } } @@ -382,11 +369,22 @@ init_uni_h261_rl_tab(&ff_h261_rl_tcoeff, uni_h261_rl_len); } -av_cold void ff_h261_encode_init(MpegEncContext *s) +av_cold int ff_h261_encode_init(MpegEncContext *s) { H261EncContext *const h = (H261EncContext*)s; static AVOnce init_static_once = AV_ONCE_INIT; + if (s->width == 176 && s->height == 144) { + h->format = H261_QCIF; + } else if (s->width == 352 && s->height == 288) { + h->format = H261_CIF; + } else { + av_log(s->avctx, AV_LOG_ERROR, + "The specified picture size of %dx%d is not valid for the " + "H.261 codec.\nValid sizes are 176x144, 352x288\n", + s->width, s->height); + return AVERROR(EINVAL); + } s->private_ctx = &h->common; s->min_qcoeff = -127; @@ -398,11 +396,13 @@ s->intra_ac_vlc_length = s->inter_ac_vlc_length = uni_h261_rl_len; s->intra_ac_vlc_last_length = s->inter_ac_vlc_last_length = uni_h261_rl_len + 128*64; ff_thread_once(&init_static_once, h261_encode_init_static); + + return 0; } const FFCodec ff_h261_encoder = { .p.name = "h261", - .p.long_name = NULL_IF_CONFIG_SMALL("H.261"), + CODEC_LONG_NAME("H.261"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H261, .p.priv_class = &ff_mpv_enc_class, @@ -410,7 +410,8 @@ .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h261enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,11 +30,10 @@ #include "mpegvideo.h" -int ff_h261_get_picture_format(int width, int height); void ff_h261_reorder_mb_index(MpegEncContext *s); void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y); -void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number); -void ff_h261_encode_init(MpegEncContext *s); +void ff_h261_encode_picture_header(MpegEncContext *s); +int ff_h261_encode_init(MpegEncContext *s); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,26 +31,20 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "error_resilience.h" #include "flvdec.h" #include "h263.h" #include "h263dec.h" -#if FF_API_FLAG_TRUNCATED -#include "h263_parser.h" -#endif #include "hwconfig.h" -#include "internal.h" #include "mpeg_er.h" #include "mpeg4video.h" #include "mpeg4videodec.h" -#if FF_API_FLAG_TRUNCATED -#include "mpeg4video_parser.h" -#endif +#include "mpeg4videodefs.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "msmpeg4dec.h" -#include "qpeldsp.h" #include "thread.h" #include "wmv2dec.h" @@ -62,9 +56,6 @@ return avctx->pix_fmt; } - if (avctx->codec->id == AV_CODEC_ID_MSS2) - return AV_PIX_FMT_YUV420P; - if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) { if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED) avctx->color_range = AVCOL_RANGE_MPEG; @@ -116,15 +107,6 @@ s->h263_pred = 1; s->msmpeg4_version = 5; break; - case AV_CODEC_ID_VC1: - case AV_CODEC_ID_WMV3: - case AV_CODEC_ID_VC1IMAGE: - case AV_CODEC_ID_WMV3IMAGE: - case AV_CODEC_ID_MSS2: - s->h263_pred = 1; - s->msmpeg4_version = 6; - avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; - break; case AV_CODEC_ID_H263I: break; case AV_CODEC_ID_FLV1: @@ -151,7 +133,6 @@ } ff_h263dsp_init(&s->h263dsp); - ff_qpeldsp_init(&s->qdsp); ff_h263_decode_init_vlc(); return 0; @@ -176,14 +157,6 @@ /* We would have to scan through the whole buf to handle the weird * reordering ... */ return buf_size; -#if FF_API_FLAG_TRUNCATED - } else if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - pos -= s->parse_context.last_index; - // padding is not really read so this might be -1 - if (pos < 0) - pos = 0; - return pos; -#endif } else { // avoid infinite loops (maybe not needed...) if (pos == 0) @@ -258,7 +231,8 @@ for (; s->mb_x < s->mb_width; s->mb_x++) { int ret; - ff_update_block_index(s); + ff_update_block_index(s, s->avctx->bits_per_raw_sample, + s->avctx->lowres, s->chroma_x_shift); if (s->resync_mb_x == s->mb_x && s->resync_mb_y + 1 == s->mb_y) s->first_slice_line = 0; @@ -443,32 +417,22 @@ s->next_picture_ptr = NULL; *got_frame = 1; - } - - return 0; - } + } else if (s->skipped_last_frame && s->current_picture_ptr) { + /* Output the last picture we decoded again if the stream ended with + * an NVOP */ + if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) + return ret; + /* Copy props from the last input packet. Otherwise, props from the last + * returned picture would be reused */ + if ((ret = ff_decode_frame_props(avctx, pict)) < 0) + return ret; + s->current_picture_ptr = NULL; -#if FF_API_FLAG_TRUNCATED - if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - int next; - - if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) { - next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size); - } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) { - next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); - } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) { - next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); - } else { - av_log(s->avctx, AV_LOG_ERROR, - "this codec does not support truncated bitstreams\n"); - return AVERROR(ENOSYS); + *got_frame = 1; } - if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, - &buf_size) < 0) - return buf_size; + return 0; } -#endif retry: if (s->divx_packed && s->bitstream_buffer_size) { @@ -501,16 +465,18 @@ /* let's go :-) */ if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { ret = ff_wmv2_decode_picture_header(s); - } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) { + } else if (CONFIG_MSMPEG4DEC && s->msmpeg4_version) { ret = ff_msmpeg4_decode_picture_header(s); } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { - if (s->avctx->extradata_size && s->picture_number == 0) { + if (s->avctx->extradata_size && !s->extradata_parsed) { GetBitContext gb; if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 ) ff_mpeg4_decode_picture_header(avctx->priv_data, &gb, 1, 0); + s->extradata_parsed = 1; } ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb, 0, 0); + s->skipped_last_frame = (ret == FRAME_SKIPPED); } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) { ret = ff_intel_h263_decode_picture_header(s); } else if (CONFIG_FLV_DECODER && s->h263_flv) { @@ -542,13 +508,6 @@ return ret; } - if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) { - int i = ff_find_unused_picture(s->avctx, s->picture, 0); - if (i < 0) - return i; - s->current_picture_ptr = &s->picture[i]; - } - avctx->has_b_frames = !s->low_delay; if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { @@ -591,10 +550,6 @@ s->codec_id == AV_CODEC_ID_H263I) s->gob_index = H263_GOB_HEIGHT(s->height); - // for skipping the frame - s->current_picture.f->pict_type = s->pict_type; - s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; - /* skip B-frames if we don't have reference frames */ if (!s->last_picture_ptr && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) @@ -606,14 +561,6 @@ avctx->skip_frame >= AVDISCARD_ALL) return get_consumed_bytes(s, buf_size); - if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { - s->me.qpel_put = s->qdsp.put_qpel_pixels_tab; - s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; - } else { - s->me.qpel_put = s->qdsp.put_no_rnd_qpel_pixels_tab; - s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; - } - if ((ret = ff_mpv_frame_start(s, avctx)) < 0) return ret; @@ -667,7 +614,7 @@ if (s->msmpeg4_version && s->msmpeg4_version < 4 && s->pict_type == AV_PICTURE_TYPE_I) - if (!CONFIG_MSMPEG4_DECODER || + if (!CONFIG_MSMPEG4DEC || ff_msmpeg4_decode_ext_header(s, buf_size) < 0) s->er.error_status_table[s->mb_num - 1] = ER_MB_ERROR; @@ -758,7 +705,7 @@ const FFCodec ff_h263_decoder = { .p.name = "h263", - .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), + CODEC_LONG_NAME("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H263, .priv_data_size = sizeof(MpegEncContext), @@ -766,12 +713,8 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, @@ -780,7 +723,7 @@ const FFCodec ff_h263p_decoder = { .p.name = "h263p", - .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), + CODEC_LONG_NAME("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H263P, .priv_data_size = sizeof(MpegEncContext), @@ -788,12 +731,8 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "mpegvideoenc.h" void ff_h263_encode_init(MpegEncContext *s); -void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_h263_encode_picture_header(MpegEncContext *s); void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); void ff_h263_encode_mb(MpegEncContext *s, int16_t block[6][64], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,16 +25,9 @@ */ #include "parser.h" -#if FF_API_FLAG_TRUNCATED -/* Nuke this header when removing FF_API_FLAG_TRUNCATED */ -#include "h263_parser.h" - -int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){ -#else static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) { -#endif int vop_found, i; uint32_t state; @@ -80,11 +73,7 @@ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { next = buf_size; } else { -#if FF_API_FLAG_TRUNCATED - next= ff_h263_find_frame_end(pc, buf, buf_size); -#else next = h263_find_frame_end(pc, buf, buf_size); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h263_parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * H.263 parser - * Copyright (c) 2002-2004 Michael Niedermayer - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_H263_PARSER_H -#define AVCODEC_H263_PARSER_H - -#include "parser.h" - -int ff_h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); - -#endif /* AVCODEC_H263_PARSER_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "h2645data.h" + +const AVRational ff_h2645_pixel_aspect[] = { + { 0, 1 }, + { 1, 1 }, + { 12, 11 }, + { 10, 11 }, + { 16, 11 }, + { 40, 33 }, + { 24, 11 }, + { 20, 11 }, + { 32, 11 }, + { 80, 33 }, + { 18, 11 }, + { 15, 11 }, + { 64, 33 }, + { 160, 99 }, + { 4, 3 }, + { 3, 2 }, + { 2, 1 }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645data.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_H2645DATA_H +#define AVCODEC_H2645DATA_H + +#include "libavutil/rational.h" + +extern const AVRational ff_h2645_pixel_aspect[17]; + +#endif /* AVCODEC_H2645DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,670 @@ +/* + * Common H.264 and HEVC Supplementary Enhancement Information messages + * + * Copyright (c) 2003 Michael Niedermayer + * Copyright (C) 2012 - 2013 Guillaume Martres + * Copyright (C) 2012 - 2013 Gildas Cocherel + * Copyright (C) 2013 Vittorio Giovara + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config_components.h" + +#include "libavutil/ambient_viewing_environment.h" +#include "libavutil/display.h" +#include "libavutil/film_grain_params.h" +#include "libavutil/pixdesc.h" +#include "libavutil/stereo3d.h" + +#include "atsc_a53.h" +#include "avcodec.h" +#include "dynamic_hdr10_plus.h" +#include "dynamic_hdr_vivid.h" +#include "get_bits.h" +#include "golomb.h" +#include "h2645_sei.h" + +#define IS_H264(codec_id) (CONFIG_H264_SEI && CONFIG_HEVC_SEI ? codec_id == AV_CODEC_ID_H264 : CONFIG_H264_SEI) +#define IS_HEVC(codec_id) (CONFIG_H264_SEI && CONFIG_HEVC_SEI ? codec_id == AV_CODEC_ID_HEVC : CONFIG_HEVC_SEI) + +#if CONFIG_HEVC_SEI +static int decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s, + GetByteContext *gb) +{ + size_t meta_size; + int err; + AVDynamicHDRPlus *metadata = av_dynamic_hdr_plus_alloc(&meta_size); + if (!metadata) + return AVERROR(ENOMEM); + + err = ff_parse_itu_t_t35_to_dynamic_hdr10_plus(metadata, gb->buffer, + bytestream2_get_bytes_left(gb)); + if (err < 0) { + av_free(metadata); + return err; + } + + av_buffer_unref(&s->info); + s->info = av_buffer_create((uint8_t *)metadata, meta_size, NULL, NULL, 0); + if (!s->info) { + av_free(metadata); + return AVERROR(ENOMEM); + } + + return 0; +} + +static int decode_registered_user_data_dynamic_hdr_vivid(HEVCSEIDynamicHDRVivid *s, + GetByteContext *gb) +{ + size_t meta_size; + int err; + AVDynamicHDRVivid *metadata = av_dynamic_hdr_vivid_alloc(&meta_size); + if (!metadata) + return AVERROR(ENOMEM); + + err = ff_parse_itu_t_t35_to_dynamic_hdr_vivid(metadata, + gb->buffer, bytestream2_get_bytes_left(gb)); + if (err < 0) { + av_free(metadata); + return err; + } + + av_buffer_unref(&s->info); + s->info = av_buffer_create((uint8_t *)metadata, meta_size, NULL, NULL, 0); + if (!s->info) { + av_free(metadata); + return AVERROR(ENOMEM); + } + + return 0; +} +#endif + +static int decode_registered_user_data_afd(H2645SEIAFD *h, GetByteContext *gb) +{ + int flag; + + if (bytestream2_get_bytes_left(gb) <= 0) + return AVERROR_INVALIDDATA; + + flag = !!(bytestream2_get_byteu(gb) & 0x40); // active_format_flag + + if (flag) { + if (bytestream2_get_bytes_left(gb) <= 0) + return AVERROR_INVALIDDATA; + h->active_format_description = bytestream2_get_byteu(gb) & 0xF; + h->present = 1; + } + + return 0; +} + +static int decode_registered_user_data_closed_caption(H2645SEIA53Caption *h, + GetByteContext *gb) +{ + return ff_parse_a53_cc(&h->buf_ref, gb->buffer, + bytestream2_get_bytes_left(gb)); +} + +static int decode_registered_user_data(H2645SEI *h, GetByteContext *gb, + enum AVCodecID codec_id, void *logctx) +{ + int country_code, provider_code; + + if (bytestream2_get_bytes_left(gb) < 3) + return AVERROR_INVALIDDATA; + + country_code = bytestream2_get_byteu(gb); // itu_t_t35_country_code + if (country_code == 0xFF) { + if (bytestream2_get_bytes_left(gb) < 3) + return AVERROR_INVALIDDATA; + + bytestream2_skipu(gb, 1); // itu_t_t35_country_code_extension_byte + } + + if (country_code != 0xB5 && country_code != 0x26) { // usa_country_code and cn_country_code + av_log(logctx, AV_LOG_VERBOSE, + "Unsupported User Data Registered ITU-T T35 SEI message (country_code = %d)\n", + country_code); + return 0; + } + + /* itu_t_t35_payload_byte follows */ + provider_code = bytestream2_get_be16u(gb); + + switch (provider_code) { + case 0x31: { // atsc_provider_code + uint32_t user_identifier; + + if (bytestream2_get_bytes_left(gb) < 4) + return AVERROR_INVALIDDATA; + + user_identifier = bytestream2_get_be32u(gb); + switch (user_identifier) { + case MKBETAG('D', 'T', 'G', '1'): // afd_data + return decode_registered_user_data_afd(&h->afd, gb); + case MKBETAG('G', 'A', '9', '4'): // closed captions + return decode_registered_user_data_closed_caption(&h->a53_caption, gb); + default: + av_log(logctx, AV_LOG_VERBOSE, + "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n", + user_identifier); + break; + } + break; + } +#if CONFIG_HEVC_SEI + case 0x04: { // cuva_provider_code + const uint16_t cuva_provider_oriented_code = 0x0005; + uint16_t provider_oriented_code; + + if (!IS_HEVC(codec_id)) + goto unsupported_provider_code; + + if (bytestream2_get_bytes_left(gb) < 2) + return AVERROR_INVALIDDATA; + + provider_oriented_code = bytestream2_get_be16u(gb); + if (provider_oriented_code == cuva_provider_oriented_code) { + return decode_registered_user_data_dynamic_hdr_vivid(&h->dynamic_hdr_vivid, gb); + } + break; + } + case 0x3C: { // smpte_provider_code + // A/341 Amendment - 2094-40 + const uint16_t smpte2094_40_provider_oriented_code = 0x0001; + const uint8_t smpte2094_40_application_identifier = 0x04; + uint16_t provider_oriented_code; + uint8_t application_identifier; + + if (!IS_HEVC(codec_id)) + goto unsupported_provider_code; + + if (bytestream2_get_bytes_left(gb) < 3) + return AVERROR_INVALIDDATA; + + provider_oriented_code = bytestream2_get_be16u(gb); + application_identifier = bytestream2_get_byteu(gb); + if (provider_oriented_code == smpte2094_40_provider_oriented_code && + application_identifier == smpte2094_40_application_identifier) { + return decode_registered_user_data_dynamic_hdr_plus(&h->dynamic_hdr_plus, gb); + } + break; + } + unsupported_provider_code: +#endif + default: + av_log(logctx, AV_LOG_VERBOSE, + "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n", + provider_code); + break; + } + + return 0; +} + +static int decode_unregistered_user_data(H2645SEIUnregistered *h, + GetByteContext *gb, + enum AVCodecID codec_id) +{ + uint8_t *user_data; + int size = bytestream2_get_bytes_left(gb); + AVBufferRef *buf_ref, **tmp; + + if (size < 16 || size >= INT_MAX - 1) + return AVERROR_INVALIDDATA; + + tmp = av_realloc_array(h->buf_ref, h->nb_buf_ref + 1, sizeof(*h->buf_ref)); + if (!tmp) + return AVERROR(ENOMEM); + h->buf_ref = tmp; + + buf_ref = av_buffer_alloc(size + 1); + if (!buf_ref) + return AVERROR(ENOMEM); + user_data = buf_ref->data; + + bytestream2_get_bufferu(gb, user_data, size); + user_data[size] = 0; + buf_ref->size = size; + h->buf_ref[h->nb_buf_ref++] = buf_ref; + + if (IS_H264(codec_id)) { + int e, build; + e = sscanf(user_data + 16, "x264 - core %d", &build); + if (e == 1 && build > 0) + h->x264_build = build; + if (e == 1 && build == 1 && !strncmp(user_data+16, "x264 - core 0000", 16)) + h->x264_build = 67; + } + + return 0; +} + +static int decode_display_orientation(H2645SEIDisplayOrientation *h, + GetBitContext *gb) +{ + h->present = !get_bits1(gb); // display_orientation_cancel_flag + + if (h->present) { + h->hflip = get_bits1(gb); // hor_flip + h->vflip = get_bits1(gb); // ver_flip + + h->anticlockwise_rotation = get_bits(gb, 16); + // This is followed by display_orientation_repetition_period + // and display_orientation_extension_flag for H.264 + // and by display_orientation_persistence_flag for HEVC. + } + + return 0; +} + +static int decode_frame_packing_arrangement(H2645SEIFramePacking *h, + GetBitContext *gb, + enum AVCodecID codec_id) +{ + h->arrangement_id = get_ue_golomb_long(gb); + h->arrangement_cancel_flag = get_bits1(gb); + h->present = !h->arrangement_cancel_flag; + + if (h->present) { + h->arrangement_type = get_bits(gb, 7); + h->quincunx_sampling_flag = get_bits1(gb); + h->content_interpretation_type = get_bits(gb, 6); + + // spatial_flipping_flag, frame0_flipped_flag, field_views_flag + skip_bits(gb, 3); + h->current_frame_is_frame0_flag = get_bits1(gb); + // frame0_self_contained_flag, frame1_self_contained_flag + skip_bits(gb, 2); + + if (!h->quincunx_sampling_flag && h->arrangement_type != 5) + skip_bits(gb, 16); // frame[01]_grid_position_[xy] + skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte + if (IS_H264(codec_id)) + h->arrangement_repetition_period = get_ue_golomb_long(gb); + else + skip_bits1(gb); // frame_packing_arrangement_persistence_flag + } + // H.264: frame_packing_arrangement_extension_flag, + // HEVC: upsampled_aspect_ratio_flag + skip_bits1(gb); + + return 0; +} + +static int decode_alternative_transfer(H2645SEIAlternativeTransfer *s, + GetByteContext *gb) +{ + if (bytestream2_get_bytes_left(gb) < 1) + return AVERROR_INVALIDDATA; + + s->present = 1; + s->preferred_transfer_characteristics = bytestream2_get_byteu(gb); + + return 0; +} + +static int decode_ambient_viewing_environment(H2645SEIAmbientViewingEnvironment *s, + GetByteContext *gb) +{ + static const uint16_t max_ambient_light_value = 50000; + + if (bytestream2_get_bytes_left(gb) < 8) + return AVERROR_INVALIDDATA; + + s->ambient_illuminance = bytestream2_get_be32u(gb); + if (!s->ambient_illuminance) + return AVERROR_INVALIDDATA; + + s->ambient_light_x = bytestream2_get_be16u(gb); + if (s->ambient_light_x > max_ambient_light_value) + return AVERROR_INVALIDDATA; + + s->ambient_light_y = bytestream2_get_be16u(gb); + if (s->ambient_light_y > max_ambient_light_value) + return AVERROR_INVALIDDATA; + + s->present = 1; + + return 0; +} + +static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h, + enum AVCodecID codec_id, GetBitContext *gb) +{ + h->present = !get_bits1(gb); // film_grain_characteristics_cancel_flag + + if (h->present) { + memset(h, 0, sizeof(*h)); + h->model_id = get_bits(gb, 2); + h->separate_colour_description_present_flag = get_bits1(gb); + if (h->separate_colour_description_present_flag) { + h->bit_depth_luma = get_bits(gb, 3) + 8; + h->bit_depth_chroma = get_bits(gb, 3) + 8; + h->full_range = get_bits1(gb); + h->color_primaries = get_bits(gb, 8); + h->transfer_characteristics = get_bits(gb, 8); + h->matrix_coeffs = get_bits(gb, 8); + } + h->blending_mode_id = get_bits(gb, 2); + h->log2_scale_factor = get_bits(gb, 4); + for (int c = 0; c < 3; c++) + h->comp_model_present_flag[c] = get_bits1(gb); + for (int c = 0; c < 3; c++) { + if (h->comp_model_present_flag[c]) { + h->num_intensity_intervals[c] = get_bits(gb, 8) + 1; + h->num_model_values[c] = get_bits(gb, 3) + 1; + if (h->num_model_values[c] > 6) + return AVERROR_INVALIDDATA; + for (int i = 0; i < h->num_intensity_intervals[c]; i++) { + h->intensity_interval_lower_bound[c][i] = get_bits(gb, 8); + h->intensity_interval_upper_bound[c][i] = get_bits(gb, 8); + for (int j = 0; j < h->num_model_values[c]; j++) + h->comp_model_value[c][i][j] = get_se_golomb_long(gb); + } + } + } + if (IS_HEVC(codec_id)) + h->persistence_flag = get_bits1(gb); + else + h->repetition_period = get_ue_golomb_long(gb); + + h->present = 1; + } + + return 0; +} + +int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, + enum AVCodecID codec_id, GetBitContext *gb, + GetByteContext *gbyte, void *logctx) +{ + switch (type) { + case SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35: + return decode_registered_user_data(h, gbyte, codec_id, logctx); + case SEI_TYPE_USER_DATA_UNREGISTERED: + return decode_unregistered_user_data(&h->unregistered, gbyte, codec_id); + case SEI_TYPE_DISPLAY_ORIENTATION: + return decode_display_orientation(&h->display_orientation, gb); + case SEI_TYPE_FILM_GRAIN_CHARACTERISTICS: + return decode_film_grain_characteristics(&h->film_grain_characteristics, codec_id, gb); + case SEI_TYPE_FRAME_PACKING_ARRANGEMENT: + return decode_frame_packing_arrangement(&h->frame_packing, gb, codec_id); + case SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS: + return decode_alternative_transfer(&h->alternative_transfer, gbyte); + case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT: + return decode_ambient_viewing_environment(&h->ambient_viewing_environment, + gbyte); + default: + return FF_H2645_SEI_MESSAGE_UNHANDLED; + } +} + +int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src) +{ + int ret = av_buffer_replace(&dst->a53_caption.buf_ref, + src->a53_caption.buf_ref); + if (ret < 0) + return ret; + + for (unsigned i = 0; i < dst->unregistered.nb_buf_ref; i++) + av_buffer_unref(&dst->unregistered.buf_ref[i]); + dst->unregistered.nb_buf_ref = 0; + + if (src->unregistered.nb_buf_ref) { + ret = av_reallocp_array(&dst->unregistered.buf_ref, + src->unregistered.nb_buf_ref, + sizeof(*dst->unregistered.buf_ref)); + if (ret < 0) + return ret; + + for (unsigned i = 0; i < src->unregistered.nb_buf_ref; i++) { + dst->unregistered.buf_ref[i] = av_buffer_ref(src->unregistered.buf_ref[i]); + if (!dst->unregistered.buf_ref[i]) + return AVERROR(ENOMEM); + dst->unregistered.nb_buf_ref++; + } + } + + return 0; +} + +static int is_frame_packing_type_valid(SEIFpaType type, enum AVCodecID codec_id) +{ + if (IS_H264(codec_id)) + return type <= SEI_FPA_H264_TYPE_2D && + type >= SEI_FPA_H264_TYPE_CHECKERBOARD; + else + return type <= SEI_FPA_TYPE_INTERLEAVE_TEMPORAL && + type >= SEI_FPA_TYPE_SIDE_BY_SIDE; +} + +int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, + enum AVCodecID codec_id, + AVCodecContext *avctx, const H2645VUI *vui, + unsigned bit_depth_luma, unsigned bit_depth_chroma, + int seed) +{ + H2645SEIFramePacking *fp = &sei->frame_packing; + + if (fp->present && + is_frame_packing_type_valid(fp->arrangement_type, codec_id) && + fp->content_interpretation_type > 0 && + fp->content_interpretation_type < 3) { + AVStereo3D *stereo = av_stereo3d_create_side_data(frame); + + if (!stereo) + return AVERROR(ENOMEM); + + switch (fp->arrangement_type) { +#if CONFIG_H264_SEI + case SEI_FPA_H264_TYPE_CHECKERBOARD: + stereo->type = AV_STEREO3D_CHECKERBOARD; + break; + case SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN: + stereo->type = AV_STEREO3D_COLUMNS; + break; + case SEI_FPA_H264_TYPE_INTERLEAVE_ROW: + stereo->type = AV_STEREO3D_LINES; + break; +#endif + case SEI_FPA_TYPE_SIDE_BY_SIDE: + if (fp->quincunx_sampling_flag) + stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX; + else + stereo->type = AV_STEREO3D_SIDEBYSIDE; + break; + case SEI_FPA_TYPE_TOP_BOTTOM: + stereo->type = AV_STEREO3D_TOPBOTTOM; + break; + case SEI_FPA_TYPE_INTERLEAVE_TEMPORAL: + stereo->type = AV_STEREO3D_FRAMESEQUENCE; + break; +#if CONFIG_H264_SEI + case SEI_FPA_H264_TYPE_2D: + stereo->type = AV_STEREO3D_2D; + break; +#endif + } + + if (fp->content_interpretation_type == 2) + stereo->flags = AV_STEREO3D_FLAG_INVERT; + + if (fp->arrangement_type == SEI_FPA_TYPE_INTERLEAVE_TEMPORAL) { + if (fp->current_frame_is_frame0_flag) + stereo->view = AV_STEREO3D_VIEW_LEFT; + else + stereo->view = AV_STEREO3D_VIEW_RIGHT; + } + } + + if (sei->display_orientation.present && + (sei->display_orientation.anticlockwise_rotation || + sei->display_orientation.hflip || + sei->display_orientation.vflip)) { + H2645SEIDisplayOrientation *o = &sei->display_orientation; + double angle = o->anticlockwise_rotation * 360 / (double) (1 << 16); + AVFrameSideData *rotation = av_frame_new_side_data(frame, + AV_FRAME_DATA_DISPLAYMATRIX, + sizeof(int32_t) * 9); + if (!rotation) + return AVERROR(ENOMEM); + + /* av_display_rotation_set() expects the angle in the clockwise + * direction, hence the first minus. + * The below code applies the flips after the rotation, yet + * the H.2645 specs require flipping to be applied first. + * Because of R O(phi) = O(-phi) R (where R is flipping around + * an arbitatry axis and O(phi) is the proper rotation by phi) + * we can create display matrices as desired by negating + * the degree once for every flip applied. */ + angle = -angle * (1 - 2 * !!o->hflip) * (1 - 2 * !!o->vflip); + av_display_rotation_set((int32_t *)rotation->data, angle); + av_display_matrix_flip((int32_t *)rotation->data, + o->hflip, o->vflip); + } + + if (sei->a53_caption.buf_ref) { + H2645SEIA53Caption *a53 = &sei->a53_caption; + AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_A53_CC, a53->buf_ref); + if (!sd) + av_buffer_unref(&a53->buf_ref); + a53->buf_ref = NULL; + if (avctx) + avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; + } + + for (unsigned i = 0; i < sei->unregistered.nb_buf_ref; i++) { + H2645SEIUnregistered *unreg = &sei->unregistered; + + if (unreg->buf_ref[i]) { + AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, + AV_FRAME_DATA_SEI_UNREGISTERED, + unreg->buf_ref[i]); + if (!sd) + av_buffer_unref(&unreg->buf_ref[i]); + unreg->buf_ref[i] = NULL; + } + } + sei->unregistered.nb_buf_ref = 0; + + if (sei->afd.present) { + AVFrameSideData *sd = av_frame_new_side_data(frame, AV_FRAME_DATA_AFD, + sizeof(uint8_t)); + + if (sd) { + *sd->data = sei->afd.active_format_description; + sei->afd.present = 0; + } + } + + if (sei->film_grain_characteristics.present) { + H2645SEIFilmGrainCharacteristics *fgc = &sei->film_grain_characteristics; + AVFilmGrainParams *fgp = av_film_grain_params_create_side_data(frame); + AVFilmGrainH274Params *h274; + + if (!fgp) + return AVERROR(ENOMEM); + + fgp->type = AV_FILM_GRAIN_PARAMS_H274; + h274 = &fgp->codec.h274; + + fgp->seed = seed; + + h274->model_id = fgc->model_id; + if (fgc->separate_colour_description_present_flag) { + h274->bit_depth_luma = fgc->bit_depth_luma; + h274->bit_depth_chroma = fgc->bit_depth_chroma; + h274->color_range = fgc->full_range + 1; + h274->color_primaries = fgc->color_primaries; + h274->color_trc = fgc->transfer_characteristics; + h274->color_space = fgc->matrix_coeffs; + } else { + h274->bit_depth_luma = bit_depth_luma; + h274->bit_depth_chroma = bit_depth_chroma; + if (vui->video_signal_type_present_flag) + h274->color_range = vui->video_full_range_flag + 1; + else + h274->color_range = AVCOL_RANGE_UNSPECIFIED; + if (vui->colour_description_present_flag) { + h274->color_primaries = vui->colour_primaries; + h274->color_trc = vui->transfer_characteristics; + h274->color_space = vui->matrix_coeffs; + } else { + h274->color_primaries = AVCOL_PRI_UNSPECIFIED; + h274->color_trc = AVCOL_TRC_UNSPECIFIED; + h274->color_space = AVCOL_SPC_UNSPECIFIED; + } + } + h274->blending_mode_id = fgc->blending_mode_id; + h274->log2_scale_factor = fgc->log2_scale_factor; + + memcpy(&h274->component_model_present, &fgc->comp_model_present_flag, + sizeof(h274->component_model_present)); + memcpy(&h274->num_intensity_intervals, &fgc->num_intensity_intervals, + sizeof(h274->num_intensity_intervals)); + memcpy(&h274->num_model_values, &fgc->num_model_values, + sizeof(h274->num_model_values)); + memcpy(&h274->intensity_interval_lower_bound, &fgc->intensity_interval_lower_bound, + sizeof(h274->intensity_interval_lower_bound)); + memcpy(&h274->intensity_interval_upper_bound, &fgc->intensity_interval_upper_bound, + sizeof(h274->intensity_interval_upper_bound)); + memcpy(&h274->comp_model_value, &fgc->comp_model_value, + sizeof(h274->comp_model_value)); + + if (IS_H264(codec_id)) + fgc->present = !!fgc->repetition_period; + else + fgc->present = fgc->persistence_flag; + + if (avctx) + avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; + } + + if (sei->ambient_viewing_environment.present) { + H2645SEIAmbientViewingEnvironment *env = + &sei->ambient_viewing_environment; + + AVAmbientViewingEnvironment *dst_env = + av_ambient_viewing_environment_create_side_data(frame); + if (!dst_env) + return AVERROR(ENOMEM); + + dst_env->ambient_illuminance = av_make_q(env->ambient_illuminance, 10000); + dst_env->ambient_light_x = av_make_q(env->ambient_light_x, 50000); + dst_env->ambient_light_y = av_make_q(env->ambient_light_y, 50000); + } + + return 0; +} + +void ff_h2645_sei_reset(H2645SEI *s) +{ + av_buffer_unref(&s->a53_caption.buf_ref); + + for (unsigned i = 0; i < s->unregistered.nb_buf_ref; i++) + av_buffer_unref(&s->unregistered.buf_ref[i]); + s->unregistered.nb_buf_ref = 0; + av_freep(&s->unregistered.buf_ref); + av_buffer_unref(&s->dynamic_hdr_plus.info); + av_buffer_unref(&s->dynamic_hdr_vivid.info); + + s->ambient_viewing_environment.present = 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_sei.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_H2645_SEI_H +#define AVCODEC_H2645_SEI_H + +#include + +#include "libavutil/buffer.h" +#include "libavutil/frame.h" + +#include "avcodec.h" +#include "bytestream.h" +#include "codec_id.h" +#include "get_bits.h" +#include "h2645_vui.h" +#include "sei.h" + +typedef struct H2645SEIA53Caption { + AVBufferRef *buf_ref; +} H2645SEIA53Caption; + +typedef struct H2645SEIAFD { + int present; + uint8_t active_format_description; +} H2645SEIAFD; + +typedef struct HEVCSEIDynamicHDRPlus { + AVBufferRef *info; +} HEVCSEIDynamicHDRPlus; + +typedef struct HEVCSEIDynamicHDRVivid { + AVBufferRef *info; +} HEVCSEIDynamicHDRVivid; + +typedef struct H2645SEIUnregistered { + AVBufferRef **buf_ref; + unsigned nb_buf_ref; + int x264_build; //< H.264 only +} H2645SEIUnregistered; + +typedef struct H2645SEIFramePacking { + int present; + int arrangement_id; + int arrangement_cancel_flag; ///< is previous arrangement canceled, -1 if never received (currently H.264 only) + SEIFpaType arrangement_type; + int arrangement_repetition_period; + int content_interpretation_type; + int quincunx_sampling_flag; + int current_frame_is_frame0_flag; +} H2645SEIFramePacking; + +typedef struct H2645SEIDisplayOrientation { + int present; + int anticlockwise_rotation; + int hflip, vflip; +} H2645SEIDisplayOrientation; + +typedef struct H2645SEIAlternativeTransfer { + int present; + int preferred_transfer_characteristics; +} H2645SEIAlternativeTransfer; + +typedef struct H2645SEIAmbientViewingEnvironment { + int present; + uint32_t ambient_illuminance; + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} H2645SEIAmbientViewingEnvironment; + +typedef struct H2645SEIFilmGrainCharacteristics { + int present; + int model_id; + int separate_colour_description_present_flag; + int bit_depth_luma; + int bit_depth_chroma; + int full_range; + int color_primaries; + int transfer_characteristics; + int matrix_coeffs; + int blending_mode_id; + int log2_scale_factor; + int comp_model_present_flag[3]; + uint16_t num_intensity_intervals[3]; + uint8_t num_model_values[3]; + uint8_t intensity_interval_lower_bound[3][256]; + uint8_t intensity_interval_upper_bound[3][256]; + int16_t comp_model_value[3][256][6]; + int repetition_period; //< H.264 only + int persistence_flag; //< HEVC only +} H2645SEIFilmGrainCharacteristics; + +typedef struct H2645SEI { + H2645SEIA53Caption a53_caption; + H2645SEIAFD afd; + HEVCSEIDynamicHDRPlus dynamic_hdr_plus; //< HEVC only + HEVCSEIDynamicHDRVivid dynamic_hdr_vivid; //< HEVC only + H2645SEIUnregistered unregistered; + H2645SEIFramePacking frame_packing; + H2645SEIDisplayOrientation display_orientation; + H2645SEIAlternativeTransfer alternative_transfer; + H2645SEIFilmGrainCharacteristics film_grain_characteristics; + H2645SEIAmbientViewingEnvironment ambient_viewing_environment; +} H2645SEI; + +enum { + FF_H2645_SEI_MESSAGE_HANDLED = 0, + FF_H2645_SEI_MESSAGE_UNHANDLED, +}; + +/** + * Decode a single SEI message. + * + * This function may either use gb or gbyte to decode the SEI message. + * + * @param[in, out] gb GetBitContext that needs to be at the start + * of the payload (i.e. after the payload_size bytes); + * it needs to be initially byte-aligned + * @param[in, out] gbyte a GetByteContext for the same data as gb + * @return < 0 on error, FF_H2645_SEI_MESSAGE_HANDLED if the SEI message + * has been handled or FF_H2645_SEI_MESSAGE_UNHANDLED if not. + */ +int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, + enum AVCodecID codec_id, GetBitContext *gb, + GetByteContext *gbyte, void *logctx); + +int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src); + +void ff_h2645_sei_reset(H2645SEI *s); + +int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, + enum AVCodecID codec_id, + AVCodecContext *avctx, const H2645VUI *vui, + unsigned bit_depth_luma, unsigned bit_depth_chroma, + int seed); + +#endif /* AVCODEC_H2645_SEI_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * Common H.264/HEVC VUI Parameter decoding + * + * Copyright (c) 2003 Michael Niedermayer + * Copyright (C) 2012 - 2013 Guillaume Martres + * Copyright (C) 2012 - 2013 Mickael Raulet + * Copyright (C) 2012 - 2013 Gildas Cocherel + * Copyright (C) 2013 Vittorio Giovara + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/log.h" +#include "libavutil/pixdesc.h" + +#include "get_bits.h" +#include "golomb.h" +#include "h2645data.h" +#include "h2645_vui.h" + +#define EXTENDED_SAR 255 + +void ff_h2645_decode_common_vui_params(GetBitContext *gb, H2645VUI *vui, void *logctx) +{ + int aspect_ratio_info_present_flag; + + av_log(logctx, AV_LOG_DEBUG, "Decoding VUI\n"); + + aspect_ratio_info_present_flag = get_bits1(gb); + if (aspect_ratio_info_present_flag) { + uint8_t aspect_ratio_idc = get_bits(gb, 8); + if (aspect_ratio_idc < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) + vui->sar = ff_h2645_pixel_aspect[aspect_ratio_idc]; + else if (aspect_ratio_idc == EXTENDED_SAR) { + vui->sar.num = get_bits(gb, 16); + vui->sar.den = get_bits(gb, 16); + } else + av_log(logctx, AV_LOG_WARNING, + "Unknown SAR index: %u.\n", aspect_ratio_idc); + } else + vui->sar = (AVRational){ 0, 1 }; + + vui->overscan_info_present_flag = get_bits1(gb); + if (vui->overscan_info_present_flag) + vui->overscan_appropriate_flag = get_bits1(gb); + + vui->video_signal_type_present_flag = get_bits1(gb); + if (vui->video_signal_type_present_flag) { + vui->video_format = get_bits(gb, 3); + vui->video_full_range_flag = get_bits1(gb); + vui->colour_description_present_flag = get_bits1(gb); + if (vui->colour_description_present_flag) { + vui->colour_primaries = get_bits(gb, 8); + vui->transfer_characteristics = get_bits(gb, 8); + vui->matrix_coeffs = get_bits(gb, 8); + + // Set invalid values to "unspecified" + if (!av_color_primaries_name(vui->colour_primaries)) + vui->colour_primaries = AVCOL_PRI_UNSPECIFIED; + if (!av_color_transfer_name(vui->transfer_characteristics)) + vui->transfer_characteristics = AVCOL_TRC_UNSPECIFIED; + if (!av_color_space_name(vui->matrix_coeffs)) + vui->matrix_coeffs = AVCOL_SPC_UNSPECIFIED; + } + } + + vui->chroma_loc_info_present_flag = get_bits1(gb); + if (vui->chroma_loc_info_present_flag) { + vui->chroma_sample_loc_type_top_field = get_ue_golomb_31(gb); + vui->chroma_sample_loc_type_bottom_field = get_ue_golomb_31(gb); + if (vui->chroma_sample_loc_type_top_field <= 5U) + vui->chroma_location = vui->chroma_sample_loc_type_top_field + 1; + else + vui->chroma_location = AVCHROMA_LOC_UNSPECIFIED; + } else + vui->chroma_location = AVCHROMA_LOC_LEFT; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h2645_vui.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_H2645_VUI_H +#define AVCODEC_H2645_VUI_H + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +#include "get_bits.h" + +typedef struct H2645VUI { + AVRational sar; + + int overscan_info_present_flag; + int overscan_appropriate_flag; + + int video_signal_type_present_flag; + int video_format; + int video_full_range_flag; + int colour_description_present_flag; + enum AVColorPrimaries colour_primaries; + enum AVColorTransferCharacteristic transfer_characteristics; + enum AVColorSpace matrix_coeffs; + + int chroma_loc_info_present_flag; + int chroma_sample_loc_type_top_field; + int chroma_sample_loc_type_bottom_field; + enum AVChromaLocation chroma_location; +} H2645VUI; + +void ff_h2645_decode_common_vui_params(GetBitContext *gb, H2645VUI *vui, void *logctx); + +#endif /* AVCODEC_H2645_VUI_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include #include -typedef void (*h264_chroma_mc_func)(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, ptrdiff_t srcStride, int h, int x, int y); +typedef void (*h264_chroma_mc_func)(uint8_t *dst /*align 8*/, const uint8_t *src /*align 1*/, ptrdiff_t srcStride, int h, int x, int y); typedef struct H264ChromaContext { h264_chroma_mc_func put_h264_chroma_pixels_tab[4]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264chroma_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,9 +26,9 @@ #include "bit_depth_template.c" #define H264_CHROMA_MC(OPNAME, OP)\ -static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y){\ +static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y){\ pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ + const pixel *src = (const pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ @@ -60,10 +60,10 @@ }\ }\ }\ -static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ {\ pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ + const pixel *src = (const pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ @@ -99,10 +99,10 @@ }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ {\ pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ + const pixel *src = (const pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ @@ -144,10 +144,10 @@ }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ {\ pixel *dst = (pixel*)_dst;\ - pixel *src = (pixel*)_src;\ + const pixel *src = (const pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264data.h 2023-03-03 13:29:59.000000000 +0000 @@ -49,26 +49,6 @@ extern const PMbInfo ff_h264_b_mb_type_info[23]; extern const PMbInfo ff_h264_b_sub_mb_type_info[13]; -static const AVRational ff_h264_pixel_aspect[17] = { - { 0, 1 }, - { 1, 1 }, - { 12, 11 }, - { 10, 11 }, - { 16, 11 }, - { 40, 33 }, - { 24, 11 }, - { 20, 11 }, - { 32, 11 }, - { 80, 33 }, - { 18, 11 }, - { 15, 11 }, - { 64, 33 }, - { 160, 99 }, - { 4, 3 }, - { 3, 2 }, - { 2, 1 }, -}; - extern const uint8_t ff_h264_dequant4_coeff_init[6][3]; extern const uint8_t ff_h264_dequant8_coeff_init_scan[16]; extern const uint8_t ff_h264_dequant8_coeff_init[6][6]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -296,8 +296,8 @@ h->recovery_frame = -1; h->frame_recovered = 0; h->poc.prev_frame_num = -1; - h->sei.frame_packing.arrangement_cancel_flag = -1; - h->sei.unregistered.x264_build = -1; + h->sei.common.frame_packing.arrangement_cancel_flag = -1; + h->sei.common.unregistered.x264_build = -1; h->next_outputed_poc = INT_MIN; for (i = 0; i < FF_ARRAY_ELEMS(h->last_pocs); i++) @@ -382,12 +382,6 @@ return AVERROR_UNKNOWN; } - if (avctx->ticks_per_frame == 1) { - if(h->avctx->time_base.den < INT_MAX/2) { - h->avctx->time_base.den *= 2; - } else - h->avctx->time_base.num /= 2; - } avctx->ticks_per_frame = 2; if (!avctx->internal->is_copy) { @@ -852,7 +846,7 @@ if (srcp->needs_fg && (ret = av_frame_copy_props(dst, srcp->f)) < 0) return ret; - av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.frame_packing), 0); + 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) dst->key_frame = 1; @@ -1068,14 +1062,14 @@ const FFCodec ff_h264_decoder = { .p.name = "h264", - .p.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + CODEC_LONG_NAME("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(H264Context), .init = h264_decode_init, .close = h264_decode_end, FF_CODEC_DECODE_CB(h264_decode_frame), - .p.capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .hw_configs = (const AVCodecHWConfigInternal *const []) { @@ -1102,11 +1096,11 @@ #endif NULL }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | + .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, .flush = h264_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context), - .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context_for_user), + UPDATE_THREAD_CONTEXT(ff_h264_update_thread_context), + UPDATE_THREAD_CONTEXT_FOR_USER(ff_h264_update_thread_context_for_user), .p.profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles), .p.priv_class = &h264_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_loopfilter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_loopfilter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_loopfilter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_loopfilter.c 2023-03-03 13:29:59.000000000 +0000 @@ -143,7 +143,7 @@ static av_always_inline void filter_mb_mbaff_edgev(const H264Context *h, uint8_t *pix, int stride, - const int16_t bS[7], int bsi, + const int16_t bS[ /* 1 + 2 * bsi */ ], int bsi, int qp, int a, int b, int intra) { @@ -166,7 +166,7 @@ static av_always_inline void filter_mb_mbaff_edgecv(const H264Context *h, uint8_t *pix, int stride, - const int16_t bS[7], + const int16_t bS[ /* 1 + 2 * bsi */ ], int bsi, int qp, int a, int b, int intra) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_metadata_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_metadata_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_metadata_bsf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_metadata_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "h264.h" #include "h264_levels.h" #include "h264_sei.h" +#include "h2645data.h" enum { FLIP_HORIZONTAL = 1, @@ -144,25 +145,17 @@ int crop_unit_x, crop_unit_y; if (ctx->sample_aspect_ratio.num && ctx->sample_aspect_ratio.den) { - // Table E-1. - static const AVRational sar_idc[] = { - { 0, 0 }, // Unspecified (never written here). - { 1, 1 }, { 12, 11 }, { 10, 11 }, { 16, 11 }, - { 40, 33 }, { 24, 11 }, { 20, 11 }, { 32, 11 }, - { 80, 33 }, { 18, 11 }, { 15, 11 }, { 64, 33 }, - { 160, 99 }, { 4, 3 }, { 3, 2 }, { 2, 1 }, - }; int num, den, i; av_reduce(&num, &den, ctx->sample_aspect_ratio.num, ctx->sample_aspect_ratio.den, 65535); - for (i = 1; i < FF_ARRAY_ELEMS(sar_idc); i++) { - if (num == sar_idc[i].num && - den == sar_idc[i].den) + for (i = 1; i < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect); i++) { + if (num == ff_h2645_pixel_aspect[i].num && + den == ff_h2645_pixel_aspect[i].den) break; } - if (i == FF_ARRAY_ELEMS(sar_idc)) { + if (i == FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) { sps->vui.aspect_ratio_idc = 255; sps->vui.sar_width = num; sps->vui.sar_height = den; @@ -476,12 +469,13 @@ H264MetadataContext *ctx = bsf->priv_data; int err, i, has_sps, seek_point; - // If an AUD is present, it must be the first NAL unit. - if (au->nb_units && au->units[0].type == H264_NAL_AUD) { - if (ctx->aud == BSF_ELEMENT_REMOVE) - ff_cbs_delete_unit(au, 0); - } else { - if (pkt && ctx->aud == BSF_ELEMENT_INSERT) { + if (ctx->aud == BSF_ELEMENT_REMOVE) { + for (i = au->nb_units - 1; i >= 0; i--) { + if (au->units[i].type == H264_NAL_AUD) + ff_cbs_delete_unit(au, i); + } + } else if (ctx->aud == BSF_ELEMENT_INSERT) { + if (pkt) { err = h264_metadata_insert_aud(bsf, au); if (err < 0) return err; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -274,8 +274,8 @@ s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; ff_h264_sei_uninit(&p->sei); - p->sei.frame_packing.arrangement_cancel_flag = -1; - p->sei.unregistered.x264_build = -1; + p->sei.common.frame_packing.arrangement_cancel_flag = -1; + p->sei.common.unregistered.x264_build = -1; if (!buf_size) return 0; @@ -565,7 +565,7 @@ } if (sps->timing_info_present_flag) { int64_t den = sps->time_scale; - if (p->sei.unregistered.x264_build < 44U) + if (p->sei.common.unregistered.x264_build < 44U) den *= 2; av_reduce(&avctx->framerate.den, &avctx->framerate.num, sps->num_units_in_tick * avctx->ticks_per_frame, den, 1 << 30); @@ -593,6 +593,7 @@ { H264ParseContext *p = s->priv_data; ParseContext *pc = &p->pc; + AVRational time_base = { 0, 1 }; int next; if (!p->got_first) { @@ -624,7 +625,7 @@ parse_nal_units(s, avctx, buf, buf_size); if (avctx->framerate.num) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); + time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); if (p->sei.picture_timing.cpb_removal_delay >= 0) { s->dts_sync_point = p->sei.buffering_period.present; s->dts_ref_dts_delta = p->sei.picture_timing.cpb_removal_delay; @@ -640,9 +641,9 @@ } if (s->dts_sync_point >= 0) { - int64_t den = avctx->time_base.den * (int64_t)avctx->pkt_timebase.num; + int64_t den = time_base.den * (int64_t)avctx->pkt_timebase.num; if (den > 0) { - int64_t num = avctx->time_base.num * (int64_t)avctx->pkt_timebase.den; + int64_t num = time_base.num * (int64_t)avctx->pkt_timebase.den; if (s->dts != AV_NOPTS_VALUE) { // got DTS from the stream, update reference timestamp p->reference_dts = s->dts - av_rescale(s->dts_ref_dts_delta, num, den); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,13 +31,12 @@ #include "mathops.h" #include "avcodec.h" #include "h264data.h" +#include "h2645_vui.h" #include "h264_ps.h" #include "golomb.h" #define MIN_LOG2_MAX_FRAME_NUM 4 -#define EXTENDED_SAR 255 - static const uint8_t default_scaling4[2][16] = { { 6, 13, 20, 28, 13, 20, 28, 32, 20, 28, 32, 37, 28, 32, 37, 42 }, @@ -132,58 +131,7 @@ static inline int decode_vui_parameters(GetBitContext *gb, void *logctx, SPS *sps) { - int aspect_ratio_info_present_flag; - unsigned int aspect_ratio_idc; - - aspect_ratio_info_present_flag = get_bits1(gb); - - if (aspect_ratio_info_present_flag) { - aspect_ratio_idc = get_bits(gb, 8); - if (aspect_ratio_idc == EXTENDED_SAR) { - sps->sar.num = get_bits(gb, 16); - sps->sar.den = get_bits(gb, 16); - } else if (aspect_ratio_idc < FF_ARRAY_ELEMS(ff_h264_pixel_aspect)) { - sps->sar = ff_h264_pixel_aspect[aspect_ratio_idc]; - } else { - av_log(logctx, AV_LOG_ERROR, "illegal aspect ratio\n"); - return AVERROR_INVALIDDATA; - } - } else { - sps->sar.num = - sps->sar.den = 0; - } - - if (get_bits1(gb)) /* overscan_info_present_flag */ - get_bits1(gb); /* overscan_appropriate_flag */ - - sps->video_signal_type_present_flag = get_bits1(gb); - if (sps->video_signal_type_present_flag) { - get_bits(gb, 3); /* video_format */ - sps->full_range = get_bits1(gb); /* video_full_range_flag */ - - sps->colour_description_present_flag = get_bits1(gb); - if (sps->colour_description_present_flag) { - sps->color_primaries = get_bits(gb, 8); /* colour_primaries */ - sps->color_trc = get_bits(gb, 8); /* transfer_characteristics */ - sps->colorspace = get_bits(gb, 8); /* matrix_coefficients */ - - // Set invalid values to "unspecified" - if (!av_color_primaries_name(sps->color_primaries)) - sps->color_primaries = AVCOL_PRI_UNSPECIFIED; - if (!av_color_transfer_name(sps->color_trc)) - sps->color_trc = AVCOL_TRC_UNSPECIFIED; - if (!av_color_space_name(sps->colorspace)) - sps->colorspace = AVCOL_SPC_UNSPECIFIED; - } - } - - /* chroma_location_info_present_flag */ - if (get_bits1(gb)) { - /* chroma_sample_location_type_top_field */ - sps->chroma_location = get_ue_golomb_31(gb) + 1; - get_ue_golomb_31(gb); /* chroma_sample_location_type_bottom_field */ - } else - sps->chroma_location = AVCHROMA_LOC_LEFT; + ff_h2645_decode_common_vui_params(gb, &sps->vui, logctx); if (show_bits1(gb) && get_bits_left(gb) < 10) { av_log(logctx, AV_LOG_WARNING, "Truncated VUI (%d)\n", get_bits_left(gb)); @@ -376,12 +324,12 @@ sps->profile_idc = profile_idc; sps->constraint_set_flags = constraint_set_flags; sps->level_idc = level_idc; - sps->full_range = -1; + sps->vui.video_full_range_flag = -1; memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4)); memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8)); sps->scaling_matrix_present = 0; - sps->colorspace = 2; //AVCOL_SPC_UNSPECIFIED + sps->vui.matrix_coeffs = AVCOL_SPC_UNSPECIFIED; if (sps->profile_idc == 100 || // High profile sps->profile_idc == 110 || // High10 profile @@ -598,8 +546,8 @@ } } - if (!sps->sar.den) - sps->sar.den = 1; + if (!sps->vui.sar.den) + sps->vui.sar.den = 1; if (avctx->debug & FF_DEBUG_PICT_INFO) { static const char csp[4][5] = { "Gray", "420", "422", "444" }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_ps.h 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "avcodec.h" #include "get_bits.h" #include "h264.h" +#include "h2645_vui.h" #define MAX_SPS_COUNT 32 #define MAX_PPS_COUNT 256 @@ -70,14 +71,7 @@ unsigned int crop_top; ///< frame_cropping_rect_top_offset unsigned int crop_bottom; ///< frame_cropping_rect_bottom_offset int vui_parameters_present_flag; - AVRational sar; - int video_signal_type_present_flag; - int full_range; - int colour_description_present_flag; - enum AVColorPrimaries color_primaries; - enum AVColorTransferCharacteristic color_trc; - enum AVColorSpace colorspace; - enum AVChromaLocation chroma_location; + H2645VUI vui; int timing_info_present_flag; uint32_t num_units_in_tick; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_redundant_pps_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_redundant_pps_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_redundant_pps_bsf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_redundant_pps_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -80,26 +80,15 @@ CodedBitstreamFragment *au) { H264RedundantPPSContext *ctx = bsf->priv_data; - int au_has_sps; int err, i; - au_has_sps = 0; for (i = 0; i < au->nb_units; i++) { CodedBitstreamUnit *nal = &au->units[i]; - if (nal->type == H264_NAL_SPS) - au_has_sps = 1; if (nal->type == H264_NAL_PPS) { err = h264_redundant_pps_fixup_pps(ctx, nal); if (err < 0) return err; - if (!au_has_sps) { - av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS " - "at %"PRId64".\n", pkt->pts); - ff_cbs_delete_unit(au, i); - i--; - continue; - } } if (nal->type == H264_NAL_SLICE || nal->type == H264_NAL_IDR_SLICE) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "libavutil/log.h" #include "libavutil/macros.h" #include "libavutil/mem.h" -#include "atsc_a53.h" +#include "bytestream.h" #include "get_bits.h" #include "golomb.h" #include "h264_ps.h" @@ -54,24 +54,22 @@ h->picture_timing.present = 0; h->buffering_period.present = 0; - h->frame_packing.present = 0; - h->film_grain_characteristics.present = 0; - h->display_orientation.present = 0; - h->afd.present = 0; - - av_buffer_unref(&h->a53_caption.buf_ref); - for (int i = 0; i < h->unregistered.nb_buf_ref; i++) - av_buffer_unref(&h->unregistered.buf_ref[i]); - h->unregistered.nb_buf_ref = 0; - av_freep(&h->unregistered.buf_ref); + h->common.frame_packing.present = 0; + h->common.film_grain_characteristics.present = 0; + h->common.display_orientation.present = 0; + h->common.afd.present = 0; + + ff_h2645_sei_reset(&h->common); } int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS *sps, void *logctx) { GetBitContext gb; + av_unused int ret; - init_get_bits(&gb, h->payload, h->payload_size_bits); + ret = init_get_bits8(&gb, h->payload, h->payload_size_bytes); + av_assert1(ret >= 0); if (sps->nal_hrd_parameters_present_flag || sps->vcl_hrd_parameters_present_flag) { @@ -133,157 +131,23 @@ return 0; } -static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb, +static int decode_picture_timing(H264SEIPictureTiming *h, GetByteContext *gb, void *logctx) { - int index = get_bits_count(gb); - int size_bits = get_bits_left(gb); - int size = (size_bits + 7) / 8; + int size = bytestream2_get_bytes_left(gb); - if (index & 7) { - av_log(logctx, AV_LOG_ERROR, "Unaligned SEI payload\n"); - return AVERROR_INVALIDDATA; - } if (size > sizeof(h->payload)) { av_log(logctx, AV_LOG_ERROR, "Picture timing SEI payload too large\n"); return AVERROR_INVALIDDATA; } - memcpy(h->payload, gb->buffer + index / 8, size); + bytestream2_get_bufferu(gb, h->payload, size); - h->payload_size_bits = size_bits; + h->payload_size_bytes = size; h->present = 1; return 0; } -static int decode_registered_user_data_afd(H264SEIAFD *h, GetBitContext *gb, int size) -{ - int flag; - - if (size-- < 1) - return AVERROR_INVALIDDATA; - skip_bits(gb, 1); // 0 - flag = get_bits(gb, 1); // active_format_flag - skip_bits(gb, 6); // reserved - - if (flag) { - if (size-- < 1) - return AVERROR_INVALIDDATA; - skip_bits(gb, 4); // reserved - h->active_format_description = get_bits(gb, 4); - h->present = 1; - } - - return 0; -} - -static int decode_registered_user_data_closed_caption(H264SEIA53Caption *h, - GetBitContext *gb, void *logctx, - int size) -{ - if (size < 3) - return AVERROR(EINVAL); - - return ff_parse_a53_cc(&h->buf_ref, gb->buffer + get_bits_count(gb) / 8, size); -} - -static int decode_registered_user_data(H264SEIContext *h, GetBitContext *gb, - void *logctx, int size) -{ - int country_code, provider_code; - - if (size < 3) - return AVERROR_INVALIDDATA; - size -= 3; - - country_code = get_bits(gb, 8); // itu_t_t35_country_code - if (country_code == 0xFF) { - if (size < 1) - return AVERROR_INVALIDDATA; - - skip_bits(gb, 8); // itu_t_t35_country_code_extension_byte - size--; - } - - if (country_code != 0xB5) { // usa_country_code - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (country_code = %d)\n", - country_code); - return 0; - } - - /* itu_t_t35_payload_byte follows */ - provider_code = get_bits(gb, 16); - - switch (provider_code) { - case 0x31: { // atsc_provider_code - uint32_t user_identifier; - - if (size < 4) - return AVERROR_INVALIDDATA; - size -= 4; - - user_identifier = get_bits_long(gb, 32); - switch (user_identifier) { - case MKBETAG('D', 'T', 'G', '1'): // afd_data - return decode_registered_user_data_afd(&h->afd, gb, size); - case MKBETAG('G', 'A', '9', '4'): // closed captions - return decode_registered_user_data_closed_caption(&h->a53_caption, gb, - logctx, size); - default: - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n", - user_identifier); - break; - } - break; - } - default: - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n", - provider_code); - break; - } - - return 0; -} - -static int decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *gb, - void *logctx, int size) -{ - uint8_t *user_data; - int e, build, i; - AVBufferRef *buf_ref, **tmp; - - if (size < 16 || size >= INT_MAX - 1) - return AVERROR_INVALIDDATA; - - tmp = av_realloc_array(h->buf_ref, h->nb_buf_ref + 1, sizeof(*h->buf_ref)); - if (!tmp) - return AVERROR(ENOMEM); - h->buf_ref = tmp; - - buf_ref = av_buffer_alloc(size + 1); - if (!buf_ref) - return AVERROR(ENOMEM); - user_data = buf_ref->data; - - for (i = 0; i < size; i++) - user_data[i] = get_bits(gb, 8); - - user_data[i] = 0; - buf_ref->size = size; - h->buf_ref[h->nb_buf_ref++] = buf_ref; - - e = sscanf(user_data + 16, "x264 - core %d", &build); - if (e == 1 && build > 0) - h->x264_build = build; - if (e == 1 && build == 1 && !strncmp(user_data+16, "x264 - core 0000", 16)) - h->x264_build = 67; - - return 0; -} - static int decode_recovery_point(H264SEIRecoveryPoint *h, GetBitContext *gb, void *logctx) { unsigned recovery_frame_cnt = get_ue_golomb_long(gb); @@ -339,122 +203,26 @@ return 0; } -static int decode_frame_packing_arrangement(H264SEIFramePacking *h, - GetBitContext *gb) -{ - h->arrangement_id = get_ue_golomb_long(gb); - h->arrangement_cancel_flag = get_bits1(gb); - h->present = !h->arrangement_cancel_flag; - - if (h->present) { - h->arrangement_type = get_bits(gb, 7); - h->quincunx_sampling_flag = get_bits1(gb); - h->content_interpretation_type = get_bits(gb, 6); - - // spatial_flipping_flag, frame0_flipped_flag, field_views_flag - skip_bits(gb, 3); - h->current_frame_is_frame0_flag = get_bits1(gb); - // frame0_self_contained_flag, frame1_self_contained_flag - skip_bits(gb, 2); - - if (!h->quincunx_sampling_flag && h->arrangement_type != 5) - skip_bits(gb, 16); // frame[01]_grid_position_[xy] - skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte - h->arrangement_repetition_period = get_ue_golomb_long(gb); - } - skip_bits1(gb); // frame_packing_arrangement_extension_flag - - return 0; -} - -static int decode_display_orientation(H264SEIDisplayOrientation *h, - GetBitContext *gb) +static int decode_green_metadata(H264SEIGreenMetaData *h, GetByteContext *gb) { - h->present = !get_bits1(gb); - - if (h->present) { - h->hflip = get_bits1(gb); // hor_flip - h->vflip = get_bits1(gb); // ver_flip - - h->anticlockwise_rotation = get_bits(gb, 16); - get_ue_golomb_long(gb); // display_orientation_repetition_period - skip_bits1(gb); // display_orientation_extension_flag - } - - return 0; -} - -static int decode_green_metadata(H264SEIGreenMetaData *h, GetBitContext *gb) -{ - h->green_metadata_type = get_bits(gb, 8); + h->green_metadata_type = bytestream2_get_byte(gb); if (h->green_metadata_type == 0) { - h->period_type = get_bits(gb, 8); + h->period_type = bytestream2_get_byte(gb); if (h->period_type == 2) - h->num_seconds = get_bits(gb, 16); + h->num_seconds = bytestream2_get_be16(gb); else if (h->period_type == 3) - h->num_pictures = get_bits(gb, 16); + h->num_pictures = bytestream2_get_be16(gb); - h->percent_non_zero_macroblocks = get_bits(gb, 8); - h->percent_intra_coded_macroblocks = get_bits(gb, 8); - h->percent_six_tap_filtering = get_bits(gb, 8); - h->percent_alpha_point_deblocking_instance = get_bits(gb, 8); + h->percent_non_zero_macroblocks = bytestream2_get_byte(gb); + h->percent_intra_coded_macroblocks = bytestream2_get_byte(gb); + h->percent_six_tap_filtering = bytestream2_get_byte(gb); + h->percent_alpha_point_deblocking_instance = bytestream2_get_byte(gb); } else if (h->green_metadata_type == 1) { - h->xsd_metric_type = get_bits(gb, 8); - h->xsd_metric_value = get_bits(gb, 16); - } - - return 0; -} - -static int decode_alternative_transfer(H264SEIAlternativeTransfer *h, - GetBitContext *gb) -{ - h->present = 1; - h->preferred_transfer_characteristics = get_bits(gb, 8); - return 0; -} - -static int decode_film_grain_characteristics(H264SEIFilmGrainCharacteristics *h, - GetBitContext *gb) -{ - h->present = !get_bits1(gb); // film_grain_characteristics_cancel_flag - - if (h->present) { - memset(h, 0, sizeof(*h)); - h->model_id = get_bits(gb, 2); - h->separate_colour_description_present_flag = get_bits1(gb); - if (h->separate_colour_description_present_flag) { - h->bit_depth_luma = get_bits(gb, 3) + 8; - h->bit_depth_chroma = get_bits(gb, 3) + 8; - h->full_range = get_bits1(gb); - h->color_primaries = get_bits(gb, 8); - h->transfer_characteristics = get_bits(gb, 8); - h->matrix_coeffs = get_bits(gb, 8); - } - h->blending_mode_id = get_bits(gb, 2); - h->log2_scale_factor = get_bits(gb, 4); - for (int c = 0; c < 3; c++) - h->comp_model_present_flag[c] = get_bits1(gb); - for (int c = 0; c < 3; c++) { - if (h->comp_model_present_flag[c]) { - h->num_intensity_intervals[c] = get_bits(gb, 8) + 1; - h->num_model_values[c] = get_bits(gb, 3) + 1; - if (h->num_model_values[c] > 6) - return AVERROR_INVALIDDATA; - for (int i = 0; i < h->num_intensity_intervals[c]; i++) { - h->intensity_interval_lower_bound[c][i] = get_bits(gb, 8); - h->intensity_interval_upper_bound[c][i] = get_bits(gb, 8); - for (int j = 0; j < h->num_model_values[c]; j++) - h->comp_model_value[c][i][j] = get_se_golomb_long(gb); - } - } - } - h->repetition_period = get_ue_golomb_long(gb); - - h->present = 1; + h->xsd_metric_type = bytestream2_get_byte(gb); + h->xsd_metric_value = bytestream2_get_be16(gb); } return 0; @@ -463,45 +231,46 @@ int ff_h264_sei_decode(H264SEIContext *h, GetBitContext *gb, const H264ParamSets *ps, void *logctx) { + GetByteContext gbyte; int master_ret = 0; - while (get_bits_left(gb) > 16 && show_bits(gb, 16)) { + av_assert1((get_bits_count(gb) % 8) == 0); + bytestream2_init(&gbyte, gb->buffer + get_bits_count(gb) / 8, + get_bits_left(gb) / 8); + + while (bytestream2_get_bytes_left(&gbyte) > 2 && bytestream2_peek_ne16(&gbyte)) { + GetByteContext gbyte_payload; GetBitContext gb_payload; int type = 0; unsigned size = 0; int ret = 0; do { - if (get_bits_left(gb) < 8) + if (bytestream2_get_bytes_left(&gbyte) <= 0) return AVERROR_INVALIDDATA; - type += show_bits(gb, 8); - } while (get_bits(gb, 8) == 255); + type += bytestream2_peek_byteu(&gbyte); + } while (bytestream2_get_byteu(&gbyte) == 255); do { - if (get_bits_left(gb) < 8) + if (bytestream2_get_bytes_left(&gbyte) <= 0) return AVERROR_INVALIDDATA; - size += show_bits(gb, 8); - } while (get_bits(gb, 8) == 255); + size += bytestream2_peek_byteu(&gbyte); + } while (bytestream2_get_byteu(&gbyte) == 255); - if (size > get_bits_left(gb) / 8) { + if (size > bytestream2_get_bytes_left(&gbyte)) { av_log(logctx, AV_LOG_ERROR, "SEI type %d size %d truncated at %d\n", - type, 8*size, get_bits_left(gb)); + type, size, bytestream2_get_bytes_left(&gbyte)); return AVERROR_INVALIDDATA; } - ret = init_get_bits8(&gb_payload, gb->buffer + get_bits_count(gb) / 8, size); + bytestream2_init (&gbyte_payload, gbyte.buffer, size); + ret = init_get_bits8(&gb_payload, gbyte.buffer, size); if (ret < 0) return ret; switch (type) { case SEI_TYPE_PIC_TIMING: // Picture timing SEI - ret = decode_picture_timing(&h->picture_timing, &gb_payload, logctx); - break; - case SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35: - ret = decode_registered_user_data(h, &gb_payload, logctx, size); - break; - case SEI_TYPE_USER_DATA_UNREGISTERED: - ret = decode_unregistered_user_data(&h->unregistered, &gb_payload, logctx, size); + ret = decode_picture_timing(&h->picture_timing, &gbyte_payload, logctx); break; case SEI_TYPE_RECOVERY_POINT: ret = decode_recovery_point(&h->recovery_point, &gb_payload, logctx); @@ -509,23 +278,14 @@ case SEI_TYPE_BUFFERING_PERIOD: ret = decode_buffering_period(&h->buffering_period, &gb_payload, ps, logctx); break; - case SEI_TYPE_FRAME_PACKING_ARRANGEMENT: - ret = decode_frame_packing_arrangement(&h->frame_packing, &gb_payload); - break; - case SEI_TYPE_DISPLAY_ORIENTATION: - ret = decode_display_orientation(&h->display_orientation, &gb_payload); - break; case SEI_TYPE_GREEN_METADATA: - ret = decode_green_metadata(&h->green_metadata, &gb_payload); - break; - case SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS: - ret = decode_alternative_transfer(&h->alternative_transfer, &gb_payload); - break; - case SEI_TYPE_FILM_GRAIN_CHARACTERISTICS: - ret = decode_film_grain_characteristics(&h->film_grain_characteristics, &gb_payload); + ret = decode_green_metadata(&h->green_metadata, &gbyte_payload); break; default: - av_log(logctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type); + ret = ff_h2645_sei_message_decode(&h->common, type, AV_CODEC_ID_H264, + &gb_payload, &gbyte_payload, logctx); + if (ret == FF_H2645_SEI_MESSAGE_UNHANDLED) + av_log(logctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type); } if (ret < 0 && ret != AVERROR_PS_NOT_FOUND) return ret; @@ -537,47 +297,47 @@ type, -get_bits_left(&gb_payload)); } - skip_bits_long(gb, 8 * size); + bytestream2_skipu(&gbyte, size); } return master_ret; } -const char *ff_h264_sei_stereo_mode(const H264SEIFramePacking *h) +const char *ff_h264_sei_stereo_mode(const H2645SEIFramePacking *h) { if (h->arrangement_cancel_flag == 0) { switch (h->arrangement_type) { - case H264_SEI_FPA_TYPE_CHECKERBOARD: + case SEI_FPA_H264_TYPE_CHECKERBOARD: if (h->content_interpretation_type == 2) return "checkerboard_rl"; else return "checkerboard_lr"; - case H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN: + case SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN: if (h->content_interpretation_type == 2) return "col_interleaved_rl"; else return "col_interleaved_lr"; - case H264_SEI_FPA_TYPE_INTERLEAVE_ROW: + case SEI_FPA_H264_TYPE_INTERLEAVE_ROW: if (h->content_interpretation_type == 2) return "row_interleaved_rl"; else return "row_interleaved_lr"; - case H264_SEI_FPA_TYPE_SIDE_BY_SIDE: + case SEI_FPA_TYPE_SIDE_BY_SIDE: if (h->content_interpretation_type == 2) return "right_left"; else return "left_right"; - case H264_SEI_FPA_TYPE_TOP_BOTTOM: + case SEI_FPA_TYPE_TOP_BOTTOM: if (h->content_interpretation_type == 2) return "bottom_top"; else return "top_bottom"; - case H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL: + case SEI_FPA_TYPE_INTERLEAVE_TEMPORAL: if (h->content_interpretation_type == 2) return "block_rl"; else return "block_lr"; - case H264_SEI_FPA_TYPE_2D: + case SEI_FPA_H264_TYPE_2D: default: return "mono"; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_sei.h 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ #define AVCODEC_H264_SEI_H #include "get_bits.h" +#include "h2645_sei.h" #include "h264_ps.h" #include "sei.h" @@ -39,19 +40,6 @@ H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8 ///< 8: %frame tripling } H264_SEI_PicStructType; -/** - * frame_packing_arrangement types - */ -typedef enum { - H264_SEI_FPA_TYPE_CHECKERBOARD = 0, - H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN = 1, - H264_SEI_FPA_TYPE_INTERLEAVE_ROW = 2, - H264_SEI_FPA_TYPE_SIDE_BY_SIDE = 3, - H264_SEI_FPA_TYPE_TOP_BOTTOM = 4, - H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL = 5, - H264_SEI_FPA_TYPE_2D = 6, -} H264_SEI_FpaType; - typedef struct H264SEITimeCode { /* When not continuously receiving full timecodes, we have to reference the previous timecode received */ @@ -66,7 +54,7 @@ typedef struct H264SEIPictureTiming { // maximum size of pic_timing according to the spec should be 274 bits uint8_t payload[40]; - int payload_size_bits; + int payload_size_bytes; int present; H264_SEI_PicStructType pic_struct; @@ -99,21 +87,6 @@ int timecode_cnt; } H264SEIPictureTiming; -typedef struct H264SEIAFD { - int present; - uint8_t active_format_description; -} H264SEIAFD; - -typedef struct H264SEIA53Caption { - AVBufferRef *buf_ref; -} H264SEIA53Caption; - -typedef struct H264SEIUnregistered { - int x264_build; - AVBufferRef **buf_ref; - int nb_buf_ref; -} H264SEIUnregistered; - typedef struct H264SEIRecoveryPoint { /** * recovery_frame_cnt @@ -130,23 +103,6 @@ int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs } H264SEIBufferingPeriod; -typedef struct H264SEIFramePacking { - int present; - int arrangement_id; - int arrangement_cancel_flag; ///< is previous arrangement canceled, -1 if never received - H264_SEI_FpaType arrangement_type; - int arrangement_repetition_period; - int content_interpretation_type; - int quincunx_sampling_flag; - int current_frame_is_frame0_flag; -} H264SEIFramePacking; - -typedef struct H264SEIDisplayOrientation { - int present; - int anticlockwise_rotation; - int hflip, vflip; -} H264SEIDisplayOrientation; - typedef struct H264SEIGreenMetaData { uint8_t green_metadata_type; uint8_t period_type; @@ -160,44 +116,12 @@ uint16_t xsd_metric_value; } H264SEIGreenMetaData; -typedef struct H264SEIAlternativeTransfer { - int present; - int preferred_transfer_characteristics; -} H264SEIAlternativeTransfer; - -typedef struct H264SEIFilmGrainCharacteristics { - int present; - int model_id; - int separate_colour_description_present_flag; - int bit_depth_luma; - int bit_depth_chroma; - int full_range; - int color_primaries; - int transfer_characteristics; - int matrix_coeffs; - int blending_mode_id; - int log2_scale_factor; - int comp_model_present_flag[3]; - uint16_t num_intensity_intervals[3]; - uint8_t num_model_values[3]; - uint8_t intensity_interval_lower_bound[3][256]; - uint8_t intensity_interval_upper_bound[3][256]; - int16_t comp_model_value[3][256][6]; - int repetition_period; -} H264SEIFilmGrainCharacteristics; - typedef struct H264SEIContext { + H2645SEI common; H264SEIPictureTiming picture_timing; - H264SEIAFD afd; - H264SEIA53Caption a53_caption; - H264SEIUnregistered unregistered; H264SEIRecoveryPoint recovery_point; H264SEIBufferingPeriod buffering_period; - H264SEIFramePacking frame_packing; - H264SEIDisplayOrientation display_orientation; H264SEIGreenMetaData green_metadata; - H264SEIAlternativeTransfer alternative_transfer; - H264SEIFilmGrainCharacteristics film_grain_characteristics; } H264SEIContext; struct H264ParamSets; @@ -205,6 +129,12 @@ int ff_h264_sei_decode(H264SEIContext *h, GetBitContext *gb, const struct H264ParamSets *ps, void *logctx); +static inline int ff_h264_sei_ctx_replace(H264SEIContext *dst, + const H264SEIContext *src) +{ + return ff_h2645_sei_ctx_replace(&dst->common, &src->common); +} + /** * Reset SEI values at the beginning of the frame. */ @@ -213,7 +143,7 @@ /** * Get stereo_mode string from the h264 frame_packing_arrangement */ -const char *ff_h264_sei_stereo_mode(const H264SEIFramePacking *h); +const char *ff_h264_sei_stereo_mode(const H2645SEIFramePacking *h); /** * Parse the contents of a picture timing message given an active SPS. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_slice.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_slice.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_slice.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h264_slice.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,11 +31,11 @@ #include "libavutil/display.h" #include "libavutil/film_grain_params.h" #include "libavutil/pixdesc.h" -#include "libavutil/stereo3d.h" #include "libavutil/timecode.h" #include "internal.h" #include "cabac.h" #include "cabac_functions.h" +#include "decode.h" #include "error_resilience.h" #include "avcodec.h" #include "h264.h" @@ -327,7 +327,7 @@ !h->ps.sps || h->ps.sps->bit_depth_luma != h1->ps.sps->bit_depth_luma || h->ps.sps->chroma_format_idc != h1->ps.sps->chroma_format_idc || - h->ps.sps->colorspace != h1->ps.sps->colorspace)) { + h->ps.sps->vui.matrix_coeffs != h1->ps.sps->vui.matrix_coeffs)) { need_reinit = 1; } @@ -433,29 +433,11 @@ h->frame_recovered = h1->frame_recovered; - ret = av_buffer_replace(&h->sei.a53_caption.buf_ref, h1->sei.a53_caption.buf_ref); + ret = ff_h264_sei_ctx_replace(&h->sei, &h1->sei); if (ret < 0) return ret; - for (i = 0; i < h->sei.unregistered.nb_buf_ref; i++) - av_buffer_unref(&h->sei.unregistered.buf_ref[i]); - h->sei.unregistered.nb_buf_ref = 0; - - if (h1->sei.unregistered.nb_buf_ref) { - ret = av_reallocp_array(&h->sei.unregistered.buf_ref, - h1->sei.unregistered.nb_buf_ref, - sizeof(*h->sei.unregistered.buf_ref)); - if (ret < 0) - return ret; - - for (i = 0; i < h1->sei.unregistered.nb_buf_ref; i++) { - h->sei.unregistered.buf_ref[i] = av_buffer_ref(h1->sei.unregistered.buf_ref[i]); - if (!h->sei.unregistered.buf_ref[i]) - return AVERROR(ENOMEM); - h->sei.unregistered.nb_buf_ref++; - } - } - h->sei.unregistered.x264_build = h1->sei.unregistered.x264_build; + h->sei.common.unregistered.x264_build = h1->sei.common.unregistered.x264_build; if (!h->cur_pic_ptr) return 0; @@ -507,7 +489,11 @@ pic = &h->DPB[i]; pic->reference = h->droppable ? 0 : h->picture_structure; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS pic->f->coded_picture_number = h->coded_picture_number++; +FF_ENABLE_DEPRECATION_WARNINGS +#endif pic->field_picture = h->picture_structure != PICT_FRAME; pic->frame_num = h->poc.frame_num; /* @@ -528,7 +514,7 @@ pic->f->crop_top = h->crop_top; pic->f->crop_bottom = h->crop_bottom; - pic->needs_fg = h->sei.film_grain_characteristics.present && !h->avctx->hwaccel && + pic->needs_fg = h->sei.common.film_grain_characteristics.present && !h->avctx->hwaccel && !(h->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN); if ((ret = alloc_picture(h, pic)) < 0) @@ -579,8 +565,8 @@ h->mb_aff_frame = h->ps.sps->mb_aff && (h->picture_structure == PICT_FRAME); - if (h->sei.unregistered.x264_build >= 0) - h->x264_build = h->sei.unregistered.x264_build; + if (h->sei.common.unregistered.x264_build >= 0) + h->x264_build = h->sei.common.unregistered.x264_build; assert(h->cur_pic_ptr->long_ref == 0); @@ -955,7 +941,7 @@ goto fail; } - ff_set_sar(h->avctx, sps->sar); + ff_set_sar(h->avctx, sps->vui.sar); av_pix_fmt_get_chroma_sub_sample(h->avctx->pix_fmt, &h->chroma_x_shift, &h->chroma_y_shift); @@ -1080,7 +1066,7 @@ || (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0)))) must_reinit = 1; - if (first_slice && av_cmp_q(sps->sar, h->avctx->sample_aspect_ratio)) + if (first_slice && av_cmp_q(sps->vui.sar, h->avctx->sample_aspect_ratio)) must_reinit = 1; if (!h->setup_finished) { @@ -1102,25 +1088,25 @@ init_dimensions(h); - if (sps->video_signal_type_present_flag) { - h->avctx->color_range = sps->full_range > 0 ? AVCOL_RANGE_JPEG - : AVCOL_RANGE_MPEG; - if (sps->colour_description_present_flag) { - if (h->avctx->colorspace != sps->colorspace) + if (sps->vui.video_signal_type_present_flag) { + h->avctx->color_range = sps->vui.video_full_range_flag > 0 ? AVCOL_RANGE_JPEG + : AVCOL_RANGE_MPEG; + if (sps->vui.colour_description_present_flag) { + if (h->avctx->colorspace != sps->vui.matrix_coeffs) needs_reinit = 1; - h->avctx->color_primaries = sps->color_primaries; - h->avctx->color_trc = sps->color_trc; - h->avctx->colorspace = sps->colorspace; + h->avctx->color_primaries = sps->vui.colour_primaries; + h->avctx->color_trc = sps->vui.transfer_characteristics; + h->avctx->colorspace = sps->vui.matrix_coeffs; } } - if (h->sei.alternative_transfer.present && - av_color_transfer_name(h->sei.alternative_transfer.preferred_transfer_characteristics) && - h->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { - h->avctx->color_trc = h->sei.alternative_transfer.preferred_transfer_characteristics; + if (h->sei.common.alternative_transfer.present && + av_color_transfer_name(h->sei.common.alternative_transfer.preferred_transfer_characteristics) && + h->sei.common.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { + h->avctx->color_trc = h->sei.common.alternative_transfer.preferred_transfer_characteristics; } } - h->avctx->chroma_sample_location = sps->chroma_location; + h->avctx->chroma_sample_location = sps->vui.chroma_location; if (!h->context_initialized || must_reinit || needs_reinit) { int flush_changes = h->context_initialized; @@ -1162,6 +1148,7 @@ const SPS *sps = h->ps.sps; H264Picture *cur = h->cur_pic_ptr; AVFrame *out = cur->f; + int ret; out->interlaced_frame = 0; out->repeat_pict = 0; @@ -1243,166 +1230,11 @@ } } - if (h->sei.frame_packing.present && - h->sei.frame_packing.arrangement_type <= 6 && - h->sei.frame_packing.content_interpretation_type > 0 && - h->sei.frame_packing.content_interpretation_type < 3) { - H264SEIFramePacking *fp = &h->sei.frame_packing; - AVStereo3D *stereo = av_stereo3d_create_side_data(out); - if (stereo) { - switch (fp->arrangement_type) { - case H264_SEI_FPA_TYPE_CHECKERBOARD: - stereo->type = AV_STEREO3D_CHECKERBOARD; - break; - case H264_SEI_FPA_TYPE_INTERLEAVE_COLUMN: - stereo->type = AV_STEREO3D_COLUMNS; - break; - case H264_SEI_FPA_TYPE_INTERLEAVE_ROW: - stereo->type = AV_STEREO3D_LINES; - break; - case H264_SEI_FPA_TYPE_SIDE_BY_SIDE: - if (fp->quincunx_sampling_flag) - stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX; - else - stereo->type = AV_STEREO3D_SIDEBYSIDE; - break; - case H264_SEI_FPA_TYPE_TOP_BOTTOM: - stereo->type = AV_STEREO3D_TOPBOTTOM; - break; - case H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL: - stereo->type = AV_STEREO3D_FRAMESEQUENCE; - break; - case H264_SEI_FPA_TYPE_2D: - stereo->type = AV_STEREO3D_2D; - break; - } - - if (fp->content_interpretation_type == 2) - stereo->flags = AV_STEREO3D_FLAG_INVERT; - - if (fp->arrangement_type == H264_SEI_FPA_TYPE_INTERLEAVE_TEMPORAL) { - if (fp->current_frame_is_frame0_flag) - stereo->view = AV_STEREO3D_VIEW_LEFT; - else - stereo->view = AV_STEREO3D_VIEW_RIGHT; - } - } - } - - if (h->sei.display_orientation.present && - (h->sei.display_orientation.anticlockwise_rotation || - h->sei.display_orientation.hflip || - h->sei.display_orientation.vflip)) { - H264SEIDisplayOrientation *o = &h->sei.display_orientation; - double angle = o->anticlockwise_rotation * 360 / (double) (1 << 16); - AVFrameSideData *rotation = av_frame_new_side_data(out, - AV_FRAME_DATA_DISPLAYMATRIX, - sizeof(int32_t) * 9); - if (rotation) { - /* av_display_rotation_set() expects the angle in the clockwise - * direction, hence the first minus. - * The below code applies the flips after the rotation, yet - * the H.2645 specs require flipping to be applied first. - * Because of R O(phi) = O(-phi) R (where R is flipping around - * an arbitatry axis and O(phi) is the proper rotation by phi) - * we can create display matrices as desired by negating - * the degree once for every flip applied. */ - angle = -angle * (1 - 2 * !!o->hflip) * (1 - 2 * !!o->vflip); - av_display_rotation_set((int32_t *)rotation->data, angle); - av_display_matrix_flip((int32_t *)rotation->data, - o->hflip, o->vflip); - } - } - - if (h->sei.afd.present) { - AVFrameSideData *sd = av_frame_new_side_data(out, AV_FRAME_DATA_AFD, - sizeof(uint8_t)); - - if (sd) { - *sd->data = h->sei.afd.active_format_description; - h->sei.afd.present = 0; - } - } - - if (h->sei.a53_caption.buf_ref) { - H264SEIA53Caption *a53 = &h->sei.a53_caption; - - AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_A53_CC, a53->buf_ref); - if (!sd) - av_buffer_unref(&a53->buf_ref); - a53->buf_ref = NULL; - - h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; - } - - for (int i = 0; i < h->sei.unregistered.nb_buf_ref; i++) { - H264SEIUnregistered *unreg = &h->sei.unregistered; - - if (unreg->buf_ref[i]) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, - AV_FRAME_DATA_SEI_UNREGISTERED, - unreg->buf_ref[i]); - if (!sd) - av_buffer_unref(&unreg->buf_ref[i]); - unreg->buf_ref[i] = NULL; - } - } - h->sei.unregistered.nb_buf_ref = 0; - - if (h->sei.film_grain_characteristics.present) { - H264SEIFilmGrainCharacteristics *fgc = &h->sei.film_grain_characteristics; - AVFilmGrainParams *fgp = av_film_grain_params_create_side_data(out); - if (!fgp) - return AVERROR(ENOMEM); - - fgp->type = AV_FILM_GRAIN_PARAMS_H274; - fgp->seed = cur->poc + (h->poc_offset << 5); - - fgp->codec.h274.model_id = fgc->model_id; - if (fgc->separate_colour_description_present_flag) { - fgp->codec.h274.bit_depth_luma = fgc->bit_depth_luma; - fgp->codec.h274.bit_depth_chroma = fgc->bit_depth_chroma; - fgp->codec.h274.color_range = fgc->full_range + 1; - fgp->codec.h274.color_primaries = fgc->color_primaries; - fgp->codec.h274.color_trc = fgc->transfer_characteristics; - fgp->codec.h274.color_space = fgc->matrix_coeffs; - } else { - fgp->codec.h274.bit_depth_luma = sps->bit_depth_luma; - fgp->codec.h274.bit_depth_chroma = sps->bit_depth_chroma; - if (sps->video_signal_type_present_flag) - fgp->codec.h274.color_range = sps->full_range + 1; - else - fgp->codec.h274.color_range = AVCOL_RANGE_UNSPECIFIED; - if (sps->colour_description_present_flag) { - fgp->codec.h274.color_primaries = sps->color_primaries; - fgp->codec.h274.color_trc = sps->color_trc; - fgp->codec.h274.color_space = sps->colorspace; - } else { - fgp->codec.h274.color_primaries = AVCOL_PRI_UNSPECIFIED; - fgp->codec.h274.color_trc = AVCOL_TRC_UNSPECIFIED; - fgp->codec.h274.color_space = AVCOL_SPC_UNSPECIFIED; - } - } - fgp->codec.h274.blending_mode_id = fgc->blending_mode_id; - fgp->codec.h274.log2_scale_factor = fgc->log2_scale_factor; - - memcpy(&fgp->codec.h274.component_model_present, &fgc->comp_model_present_flag, - sizeof(fgp->codec.h274.component_model_present)); - memcpy(&fgp->codec.h274.num_intensity_intervals, &fgc->num_intensity_intervals, - sizeof(fgp->codec.h274.num_intensity_intervals)); - memcpy(&fgp->codec.h274.num_model_values, &fgc->num_model_values, - sizeof(fgp->codec.h274.num_model_values)); - memcpy(&fgp->codec.h274.intensity_interval_lower_bound, &fgc->intensity_interval_lower_bound, - sizeof(fgp->codec.h274.intensity_interval_lower_bound)); - memcpy(&fgp->codec.h274.intensity_interval_upper_bound, &fgc->intensity_interval_upper_bound, - sizeof(fgp->codec.h274.intensity_interval_upper_bound)); - memcpy(&fgp->codec.h274.comp_model_value, &fgc->comp_model_value, - sizeof(fgp->codec.h274.comp_model_value)); - - fgc->present = !!fgc->repetition_period; - - h->avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; - } + ret = ff_h2645_sei_to_frame(out, &h->sei.common, AV_CODEC_ID_H264, h->avctx, + &sps->vui, sps->bit_depth_luma, sps->bit_depth_chroma, + cur->poc + (unsigned)(h->poc_offset << 5)); + if (ret < 0) + return ret; if (h->sei.picture_timing.timecode_cnt > 0) { uint32_t *tc_sd; @@ -1469,7 +1301,7 @@ h->last_pocs[0] = cur->poc; cur->mmco_reset = 1; } else if(h->avctx->has_b_frames < out_of_order && !sps->bitstream_restriction_flag){ - int loglevel = h->avctx->frame_number > 1 ? AV_LOG_WARNING : AV_LOG_VERBOSE; + int loglevel = h->avctx->frame_num > 1 ? AV_LOG_WARNING : AV_LOG_VERBOSE; av_log(h->avctx, loglevel, "Increasing reorder buffer to %d\n", out_of_order); h->avctx->has_b_frames = out_of_order; } @@ -1649,7 +1481,7 @@ while (h->poc.frame_num != h->poc.prev_frame_num && !h->first_field && h->poc.frame_num != (h->poc.prev_frame_num + 1) % (1 << sps->log2_max_frame_num)) { - H264Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL; + const H264Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL; av_log(h->avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->poc.frame_num, h->poc.prev_frame_num); if (!sps->gaps_in_frame_num_allowed_flag) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h265_metadata_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h265_metadata_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h265_metadata_bsf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h265_metadata_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "cbs.h" #include "cbs_bsf.h" #include "cbs_h265.h" +#include "h2645data.h" #include "hevc.h" #include "h265_profile_level.h" @@ -194,25 +195,17 @@ int crop_unit_x, crop_unit_y; if (ctx->sample_aspect_ratio.num && ctx->sample_aspect_ratio.den) { - // Table E-1. - static const AVRational sar_idc[] = { - { 0, 0 }, // Unspecified (never written here). - { 1, 1 }, { 12, 11 }, { 10, 11 }, { 16, 11 }, - { 40, 33 }, { 24, 11 }, { 20, 11 }, { 32, 11 }, - { 80, 33 }, { 18, 11 }, { 15, 11 }, { 64, 33 }, - { 160, 99 }, { 4, 3 }, { 3, 2 }, { 2, 1 }, - }; int num, den, i; av_reduce(&num, &den, ctx->sample_aspect_ratio.num, ctx->sample_aspect_ratio.den, 65535); - for (i = 1; i < FF_ARRAY_ELEMS(sar_idc); i++) { - if (num == sar_idc[i].num && - den == sar_idc[i].den) + for (i = 1; i < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect); i++) { + if (num == ff_h2645_pixel_aspect[i].num && + den == ff_h2645_pixel_aspect[i].den) break; } - if (i == FF_ARRAY_ELEMS(sar_idc)) { + if (i == FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) { sps->vui.aspect_ratio_idc = 255; sps->vui.sar_width = num; sps->vui.sar_height = den; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h274.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h274.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h274.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/h274.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #ifndef AVCODEC_H274_H #define AVCODEC_H274_H -#include +#include "libavutil/film_grain_params.h" // Must be initialized to {0} prior to first usage typedef struct H274FilmGrainDatabase { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/half2float.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/half2float.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_HALF2FLOAT_H -#define AVCODEC_HALF2FLOAT_H - -#include - -static uint32_t convertmantissa(uint32_t i) -{ - int32_t m = i << 13; // Zero pad mantissa bits - int32_t e = 0; // Zero exponent - - while (!(m & 0x00800000)) { // While not normalized - e -= 0x00800000; // Decrement exponent (1<<23) - m <<= 1; // Shift mantissa - } - - m &= ~0x00800000; // Clear leading 1 bit - e += 0x38800000; // Adjust bias ((127-14)<<23) - - return m | e; // Return combined number -} - -static void half2float_table(uint32_t *mantissatable, uint32_t *exponenttable, - uint16_t *offsettable) -{ - mantissatable[0] = 0; - for (int i = 1; i < 1024; i++) - mantissatable[i] = convertmantissa(i); - for (int i = 1024; i < 2048; i++) - mantissatable[i] = 0x38000000UL + ((i - 1024) << 13UL); - - exponenttable[0] = 0; - for (int i = 1; i < 31; i++) - exponenttable[i] = i << 23; - for (int i = 33; i < 63; i++) - exponenttable[i] = 0x80000000UL + ((i - 32) << 23UL); - exponenttable[31]= 0x47800000UL; - exponenttable[32]= 0x80000000UL; - exponenttable[63]= 0xC7800000UL; - - offsettable[0] = 0; - for (int i = 1; i < 64; i++) - offsettable[i] = 1024; - offsettable[32] = 0; -} - -static uint32_t half2float(uint16_t h, uint32_t *mantissatable, uint32_t *exponenttable, - uint16_t *offsettable) -{ - uint32_t f; - - f = mantissatable[offsettable[h >> 10] + (h & 0x3ff)] + exponenttable[h >> 10]; - - return f; -} - -#endif /* AVCODEC_HALF2FLOAT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -414,7 +414,7 @@ const FFCodec ff_hap_decoder = { .p.name = "hap", - .p.long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), + CODEC_LONG_NAME("Vidvox Hap"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HAP, .init = hap_init, @@ -423,8 +423,7 @@ .priv_data_size = sizeof(HapContext), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .codec_tags = (const uint32_t []){ MKTAG('H','a','p','1'), MKTAG('H','a','p','5'), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hapenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -348,18 +348,18 @@ const FFCodec ff_hap_encoder = { .p.name = "hap", - .p.long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), + CODEC_LONG_NAME("Vidvox Hap"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HAP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(HapContext), .p.priv_class = &hapenc_class, - .p.capabilities = AV_CODEC_CAP_SLICE_THREADS, .init = hap_init, FF_CODEC_ENCODE_CB(hap_encode), .close = hap_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE, }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcadec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcadec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcadec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcadec.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,15 +18,14 @@ #include "libavutil/crc.h" #include "libavutil/float_dsp.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "libavutil/tx.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "hca_data.h" typedef struct ChannelContext { @@ -442,7 +441,7 @@ const FFCodec ff_hca_decoder = { .p.name = "hca", - .p.long_name = NULL_IF_CONFIG_SMALL("CRI HCA"), + CODEC_LONG_NAME("CRI HCA"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_HCA, .priv_data_size = sizeof(HCAContext), @@ -450,7 +449,7 @@ FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcom.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcom.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcom.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hcom.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,8 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct HEntry { int16_t l, r; @@ -136,7 +136,7 @@ const FFCodec ff_hcom_decoder = { .p.name = "hcom", - .p.long_name = NULL_IF_CONFIG_SMALL("HCOM Audio"), + CODEC_LONG_NAME("HCOM Audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_HCOM, .priv_data_size = sizeof(HCOMContext), @@ -144,5 +144,5 @@ .close = hcom_close, FF_CODEC_DECODE_CB(hcom_decode), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrdec.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,231 @@ +/* + * Radiance HDR image format + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "codec_internal.h" +#include "decode.h" +#include "thread.h" + +#define MINELEN 8 +#define MAXELEN 0x7fff + +static int hdr_get_line(GetByteContext *gb, uint8_t *buffer, int size) +{ + int n = 0, c; + + memset(buffer, 0, size); + + do { + c = bytestream2_get_byte(gb); + if (n < size - 1) + buffer[n++] = c; + } while (bytestream2_get_bytes_left(gb) > 0 && c != '\n'); + + return 0; +} + +static float convert(int expo, int val) +{ + if (expo == -128) { + return 0.f; + } else { + const float v = val / 256.f; + + return ldexpf(v, expo); + } +} + +static int decompress(uint8_t *scanline, int w, GetByteContext *gb, const uint8_t *start) +{ + int rshift = 0; + + while (w > 0) { + if (bytestream2_get_bytes_left(gb) < 4) + return AVERROR_INVALIDDATA; + scanline[0] = bytestream2_get_byte(gb); + scanline[1] = bytestream2_get_byte(gb); + scanline[2] = bytestream2_get_byte(gb); + scanline[3] = bytestream2_get_byte(gb); + + if (scanline[0] == 1 && + scanline[1] == 1 && + scanline[2] == 1) { + int run = scanline[3]; + for (int i = run << rshift; i > 0 && w > 0 && scanline >= start + 4; i--) { + memcpy(scanline, scanline - 4, 4); + scanline += 4; + w -= 4; + } + rshift += 8; + if (rshift > 16) + break; + } else { + scanline += 4; + w--; + rshift = 0; + } + } + + return 1; +} + +static int hdr_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) +{ + int width = 0, height = 0; + GetByteContext gb; + uint8_t line[512]; + float sar; + int ret; + + bytestream2_init(&gb, avpkt->data, avpkt->size); + hdr_get_line(&gb, line, sizeof(line)); + if (memcmp("#?RADIANCE\n", line, 11)) + return AVERROR_INVALIDDATA; + + do { + hdr_get_line(&gb, line, sizeof(line)); + if (sscanf(line, "PIXASPECT=%f\n", &sar) == 1) + avctx->sample_aspect_ratio = p->sample_aspect_ratio = av_inv_q(av_d2q(sar, 4096)); + } while (line[0] != '\n' && line[0]); + + hdr_get_line(&gb, line, sizeof(line)); + if (sscanf(line, "-Y %d +X %d\n", &height, &width) == 2) { + ; + } else if (sscanf(line, "+Y %d +X %d\n", &height, &width) == 2) { + ; + } else if (sscanf(line, "-Y %d -X %d\n", &height, &width) == 2) { + ; + } else if (sscanf(line, "+Y %d -X %d\n", &height, &width) == 2) { + ; + } else if (sscanf(line, "-X %d +Y %d\n", &width, &height) == 2) { + ; + } else if (sscanf(line, "+X %d +Y %d\n", &width, &height) == 2) { + ; + } else if (sscanf(line, "-X %d -Y %d\n", &width, &height) == 2) { + ; + } else if (sscanf(line, "+X %d -Y %d\n", &width, &height) == 2) { + ; + } + + if ((ret = ff_set_dimensions(avctx, width, height)) < 0) + return ret; + + avctx->pix_fmt = AV_PIX_FMT_GBRPF32; + + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + + if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0) + return ret; + + for (int y = 0; y < height; y++) { + float *dst_r = (float *)(p->data[2] + y * p->linesize[2]); + float *dst_g = (float *)(p->data[0] + y * p->linesize[0]); + float *dst_b = (float *)(p->data[1] + y * p->linesize[1]); + uint8_t *scanline = p->data[0] + y * p->linesize[0]; + int i; + + if (width < MINELEN || width > MAXELEN) { + ret = decompress(scanline, width, &gb, scanline); + if (ret < 0) + return ret; + goto convert; + } + + i = bytestream2_peek_byte(&gb); + if (i != 2) { + ret = decompress(scanline, width, &gb, scanline); + if (ret < 0) + return ret; + goto convert; + } + bytestream2_skip(&gb, 1); + + scanline[1] = bytestream2_get_byte(&gb); + scanline[2] = bytestream2_get_byte(&gb); + i = bytestream2_get_byte(&gb); + + if (scanline[1] != 2 || scanline[2] & 128) { + scanline[0] = 2; + scanline[3] = i; + ret = decompress(scanline + 4, width - 1, &gb, scanline); + if (ret < 0) + return ret; + goto convert; + } + + for (int i = 0; i < 4; i++) { + uint8_t *scanline = p->data[0] + y * p->linesize[0] + i; + + for (int j = 0; j < width * 4 && bytestream2_get_bytes_left(&gb) > 0;) { + int run = bytestream2_get_byte(&gb); + if (run > 128) { + uint8_t val = bytestream2_get_byte(&gb); + run &= 127; + while (run--) { + if (j >= width * 4) + break; + scanline[j] = val; + j += 4; + } + } else if (run > 0) { + while (run--) { + if (j >= width * 4) + break; + scanline[j] = bytestream2_get_byte(&gb); + j += 4; + } + } + } + } + +convert: + for (int x = 0; x < width; x++) { + uint8_t rgbe[4]; + int expo; + + memcpy(rgbe, p->data[0] + y * p->linesize[0] + x * 4, 4); + expo = rgbe[3] - 128; + + dst_r[x] = convert(expo, rgbe[0]); + dst_b[x] = convert(expo, rgbe[2]); + dst_g[x] = convert(expo, rgbe[1]); + } + } + + p->key_frame = 1; + p->pict_type = AV_PICTURE_TYPE_I; + + *got_frame = 1; + + return avpkt->size; +} + +const FFCodec ff_hdr_decoder = { + .p.name = "hdr", + CODEC_LONG_NAME("HDR (Radiance RGBE format) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RADIANCE_HDR, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + FF_CODEC_DECODE_CB(hdr_decode_frame), +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrenc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdrenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,190 @@ +/* + * Radiance HDR image format + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/imgutils.h" +#include "avcodec.h" +#include "bytestream.h" +#include "codec_internal.h" +#include "encode.h" + +typedef struct HDREncContext { + uint8_t *scanline; +} HDREncContext; + +static av_cold int hdr_encode_init(AVCodecContext *avctx) +{ + HDREncContext *s = avctx->priv_data; + + s->scanline = av_calloc(avctx->width * 4, sizeof(*s->scanline)); + if (!s->scanline) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold int hdr_encode_close(AVCodecContext *avctx) +{ + HDREncContext *s = avctx->priv_data; + + av_freep(&s->scanline); + + return 0; +} + +static void bytestream_put_str(uint8_t **buf, const char *const line) +{ + bytestream_put_buffer(buf, line, strlen(line)); +} + +static void float2rgbe(uint8_t *rgbe, float red, float green, float blue) +{ + float v; + int e; + + v = FFMAX3(red, green, blue); + + if (v < 1e-32f) { + rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; + } else { + v = frexpf(v, &e) * 256.f / v; + + rgbe[0] = av_clip_uint8(red * v); + rgbe[1] = av_clip_uint8(green * v); + rgbe[2] = av_clip_uint8(blue * v); + rgbe[3] = av_clip_uint8(e + 128); + } +} + +static void rle(uint8_t **buffer, const uint8_t *data, int width) +{ +#define MIN_RLE 4 + int cur = 0; + + while (cur < width) { + int run_count = 0, old_run_count = 0; + int beg_run = cur; + uint8_t buf[2]; + + while (run_count < MIN_RLE && beg_run < width) { + beg_run += run_count; + old_run_count = run_count; + run_count = 1; + while ((beg_run + run_count < width) && (run_count < 127) && + (data[beg_run * 4] == data[(beg_run + run_count) * 4])) + run_count++; + } + + if ((old_run_count > 1) && (old_run_count == beg_run - cur)) { + buf[0] = 128 + old_run_count; + buf[1] = data[cur * 4]; + bytestream_put_buffer(buffer, buf, sizeof(buf)); + cur = beg_run; + } + + while (cur < beg_run) { + int nonrun_count = FFMIN(128, beg_run - cur); + buf[0] = nonrun_count; + bytestream_put_byte(buffer, buf[0]); + for (int n = 0; n < nonrun_count; n++) + bytestream_put_byte(buffer, data[(cur + n) * 4]); + cur += nonrun_count; + } + + if (run_count >= MIN_RLE) { + buf[0] = 128 + run_count; + buf[1] = data[beg_run * 4]; + bytestream_put_buffer(buffer, buf, sizeof(buf)); + cur += run_count; + } + } +} + +static int hdr_encode_frame(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet) +{ + HDREncContext *s = avctx->priv_data; + int64_t packet_size; + uint8_t *buf; + int ret; + + packet_size = avctx->width * avctx->height * 4LL + 1024LL; + if ((ret = ff_get_encode_buffer(avctx, pkt, packet_size, 0)) < 0) + return ret; + + buf = pkt->data; + bytestream_put_str(&buf, "#?RADIANCE\n"); + bytestream_put_str(&buf, "SOFTWARE=lavc\n"); + ret = snprintf(buf, 32, "PIXASPECT=%f\n", av_q2d(av_inv_q(avctx->sample_aspect_ratio))); + if (ret > 0) + buf += ret; + bytestream_put_str(&buf, "FORMAT=32-bit_rle_rgbe\n\n"); + ret = snprintf(buf, 32, "-Y %d +X %d\n", avctx->height, avctx->width); + if (ret > 0) + buf += ret; + + for (int y = 0; y < avctx->height; y++) { + const float *red = (const float *)(frame->data[2] + y * frame->linesize[2]); + const float *green = (const float *)(frame->data[0] + y * frame->linesize[0]); + const float *blue = (const float *)(frame->data[1] + y * frame->linesize[1]); + + if (avctx->width < 8 || avctx->width > 0x7fff) { + for (int x = 0; x < avctx->width; x++) { + float2rgbe(buf, red[x], green[x], blue[x]); + buf += 4; + } + } else { + bytestream_put_byte(&buf, 2); + bytestream_put_byte(&buf, 2); + bytestream_put_byte(&buf, avctx->width >> 8); + bytestream_put_byte(&buf, avctx->width & 0xFF); + + for (int x = 0; x < avctx->width; x++) + float2rgbe(s->scanline + 4 * x, red[x], green[x], blue[x]); + for (int p = 0; p < 4; p++) + rle(&buf, s->scanline + p, avctx->width); + } + } + + pkt->flags |= AV_PKT_FLAG_KEY; + + av_shrink_packet(pkt, buf - pkt->data); + + *got_packet = 1; + + return 0; +} + +const FFCodec ff_hdr_encoder = { + .p.name = "hdr", + CODEC_LONG_NAME("HDR (Radiance RGBE format) image"), + .priv_data_size = sizeof(HDREncContext), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RADIANCE_HDR, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .init = hdr_encode_init, + FF_CODEC_ENCODE_CB(hdr_encode_frame), + .close = hdr_encode_close, + .p.pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_GBRPF32, + AV_PIX_FMT_NONE + }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdr_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdr_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdr_parser.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hdr_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * Radiance HDR parser + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Radiance HDR parser + */ + +#include "libavutil/intreadwrite.h" +#include "parser.h" + +typedef struct HDRParseContext { + ParseContext pc; +} HDRParseContext; + +static int hdr_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + HDRParseContext *ipc = s->priv_data; + uint64_t state = ipc->pc.state64; + int next = END_NOT_FOUND, i = 0; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { + next = buf_size; + } else { + for (; i < buf_size; i++) { + state = (state << 8) | buf[i]; + if (state == AV_RB64("ADIANCE\n") && (i > 10 || ipc->pc.index > 10)) { + next = i - 10; + break; + } + } + + ipc->pc.state64 = state; + if (ff_combine_frame(&ipc->pc, next, &buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + } + + *poutbuf = buf; + *poutbuf_size = buf_size; + + s->pict_type = AV_PICTURE_TYPE_I; + s->key_frame = 1; + s->duration = 1; + + return next; +} + +const AVCodecParser ff_hdr_parser = { + .codec_ids = { AV_CODEC_ID_RADIANCE_HDR }, + .priv_data_size = sizeof(HDRParseContext), + .parser_parse = hdr_parse, + .parser_close = ff_parse_close, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_cabac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_cabac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_cabac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_cabac.c 2023-03-03 13:29:59.000000000 +0000 @@ -447,25 +447,26 @@ { 28, 36, 43, 49, 54, 58, 61, 63, }, }; -void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts) +void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts) { + const HEVCContext *const s = lc->parent; + if (s->ps.pps->entropy_coding_sync_enabled_flag && (ctb_addr_ts % s->ps.sps->ctb_width == 2 || (s->ps.sps->ctb_width == 2 && ctb_addr_ts % s->ps.sps->ctb_width == 0))) { - memcpy(s->cabac_state, s->HEVClc->cabac_state, HEVC_CONTEXTS); + memcpy(lc->common_cabac_state->state, lc->cabac_state, HEVC_CONTEXTS); if (s->ps.sps->persistent_rice_adaptation_enabled_flag) { - memcpy(s->stat_coeff, s->HEVClc->stat_coeff, HEVC_STAT_COEFFS); + memcpy(lc->common_cabac_state->stat_coeff, lc->stat_coeff, HEVC_STAT_COEFFS); } } } -static void load_states(HEVCContext *s, int thread) +static void load_states(HEVCLocalContext *lc, const HEVCContext *s) { - memcpy(s->HEVClc->cabac_state, s->cabac_state, HEVC_CONTEXTS); + memcpy(lc->cabac_state, lc->common_cabac_state->state, HEVC_CONTEXTS); if (s->ps.sps->persistent_rice_adaptation_enabled_flag) { - const HEVCContext *prev = s->sList[(thread + s->threads_number - 1) % s->threads_number]; - memcpy(s->HEVClc->stat_coeff, prev->stat_coeff, HEVC_STAT_COEFFS); + memcpy(lc->stat_coeff, lc->common_cabac_state->stat_coeff, HEVC_STAT_COEFFS); } } @@ -474,17 +475,17 @@ return skip_bytes(&lc->cc, 0) == NULL ? AVERROR_INVALIDDATA : 0; } -static int cabac_init_decoder(HEVCContext *s) +static int cabac_init_decoder(HEVCLocalContext *lc) { - GetBitContext *gb = &s->HEVClc->gb; + GetBitContext *gb = &lc->gb; skip_bits(gb, 1); align_get_bits(gb); - return ff_init_cabac_decoder(&s->HEVClc->cc, + return ff_init_cabac_decoder(&lc->cc, gb->buffer + get_bits_count(gb) / 8, (get_bits_left(gb) + 7) / 8); } -static void cabac_init_state(HEVCContext *s) +static void cabac_init_state(HEVCLocalContext *lc, const HEVCContext *s) { int init_type = 2 - s->sh.slice_type; int i; @@ -501,31 +502,33 @@ pre ^= pre >> 31; if (pre > 124) pre = 124 + (pre & 1); - s->HEVClc->cabac_state[i] = pre; + lc->cabac_state[i] = pre; } for (i = 0; i < 4; i++) - s->HEVClc->stat_coeff[i] = 0; + lc->stat_coeff[i] = 0; } -int ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts, int thread) +int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts) { + const HEVCContext *const s = lc->parent; + if (ctb_addr_ts == s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) { - int ret = cabac_init_decoder(s); + int ret = cabac_init_decoder(lc); if (ret < 0) return ret; if (s->sh.dependent_slice_segment_flag == 0 || (s->ps.pps->tiles_enabled_flag && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1])) - cabac_init_state(s); + cabac_init_state(lc, s); if (!s->sh.first_slice_in_pic_flag && s->ps.pps->entropy_coding_sync_enabled_flag) { if (ctb_addr_ts % s->ps.sps->ctb_width == 0) { if (s->ps.sps->ctb_width == 1) - cabac_init_state(s); + cabac_init_state(lc, s); else if (s->sh.dependent_slice_segment_flag == 1) - load_states(s, thread); + load_states(lc, s); } } } else { @@ -533,111 +536,112 @@ s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[ctb_addr_ts - 1]) { int ret; if (s->threads_number == 1) - ret = cabac_reinit(s->HEVClc); + ret = cabac_reinit(lc); else { - ret = cabac_init_decoder(s); + ret = cabac_init_decoder(lc); } if (ret < 0) return ret; - cabac_init_state(s); + cabac_init_state(lc, s); } if (s->ps.pps->entropy_coding_sync_enabled_flag) { if (ctb_addr_ts % s->ps.sps->ctb_width == 0) { int ret; - get_cabac_terminate(&s->HEVClc->cc); + get_cabac_terminate(&lc->cc); if (s->threads_number == 1) - ret = cabac_reinit(s->HEVClc); + ret = cabac_reinit(lc); else { - ret = cabac_init_decoder(s); + ret = cabac_init_decoder(lc); } if (ret < 0) return ret; if (s->ps.sps->ctb_width == 1) - cabac_init_state(s); + cabac_init_state(lc, s); else - load_states(s, thread); + load_states(lc, s); } } } return 0; } -#define GET_CABAC(ctx) get_cabac(&s->HEVClc->cc, &s->HEVClc->cabac_state[ctx]) +#define GET_CABAC(ctx) get_cabac(&lc->cc, &lc->cabac_state[ctx]) -int ff_hevc_sao_merge_flag_decode(HEVCContext *s) +int ff_hevc_sao_merge_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[SAO_MERGE_FLAG]); } -int ff_hevc_sao_type_idx_decode(HEVCContext *s) +int ff_hevc_sao_type_idx_decode(HEVCLocalContext *lc) { if (!GET_CABAC(elem_offset[SAO_TYPE_IDX])) return 0; - if (!get_cabac_bypass(&s->HEVClc->cc)) + if (!get_cabac_bypass(&lc->cc)) return SAO_BAND; return SAO_EDGE; } -int ff_hevc_sao_band_position_decode(HEVCContext *s) +int ff_hevc_sao_band_position_decode(HEVCLocalContext *lc) { int i; - int value = get_cabac_bypass(&s->HEVClc->cc); + int value = get_cabac_bypass(&lc->cc); for (i = 0; i < 4; i++) - value = (value << 1) | get_cabac_bypass(&s->HEVClc->cc); + value = (value << 1) | get_cabac_bypass(&lc->cc); return value; } -int ff_hevc_sao_offset_abs_decode(HEVCContext *s) +int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc) { int i = 0; - int length = (1 << (FFMIN(s->ps.sps->bit_depth, 10) - 5)) - 1; + int length = (1 << (FFMIN(lc->parent->ps.sps->bit_depth, 10) - 5)) - 1; - while (i < length && get_cabac_bypass(&s->HEVClc->cc)) + while (i < length && get_cabac_bypass(&lc->cc)) i++; return i; } -int ff_hevc_sao_offset_sign_decode(HEVCContext *s) +int ff_hevc_sao_offset_sign_decode(HEVCLocalContext *lc) { - return get_cabac_bypass(&s->HEVClc->cc); + return get_cabac_bypass(&lc->cc); } -int ff_hevc_sao_eo_class_decode(HEVCContext *s) +int ff_hevc_sao_eo_class_decode(HEVCLocalContext *lc) { - int ret = get_cabac_bypass(&s->HEVClc->cc) << 1; - ret |= get_cabac_bypass(&s->HEVClc->cc); + int ret = get_cabac_bypass(&lc->cc) << 1; + ret |= get_cabac_bypass(&lc->cc); return ret; } -int ff_hevc_end_of_slice_flag_decode(HEVCContext *s) +int ff_hevc_end_of_slice_flag_decode(HEVCLocalContext *lc) { - return get_cabac_terminate(&s->HEVClc->cc); + return get_cabac_terminate(&lc->cc); } -int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s) +int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[CU_TRANSQUANT_BYPASS_FLAG]); } -int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, int x_cb, int y_cb) +int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, int x_cb, int y_cb) { + const HEVCContext *const s = lc->parent; int min_cb_width = s->ps.sps->min_cb_width; int inc = 0; int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); - if (s->HEVClc->ctb_left_flag || x0b) + if (lc->ctb_left_flag || x0b) inc = !!SAMPLE_CTB(s->skip_flag, x_cb - 1, y_cb); - if (s->HEVClc->ctb_up_flag || y0b) + if (lc->ctb_up_flag || y0b) inc += !!SAMPLE_CTB(s->skip_flag, x_cb, y_cb - 1); return GET_CABAC(elem_offset[SKIP_FLAG] + inc); } -int ff_hevc_cu_qp_delta_abs(HEVCContext *s) +int ff_hevc_cu_qp_delta_abs(HEVCLocalContext *lc) { int prefix_val = 0; int suffix_val = 0; @@ -649,34 +653,34 @@ } if (prefix_val >= 5) { int k = 0; - while (k < 7 && get_cabac_bypass(&s->HEVClc->cc)) { + while (k < 7 && get_cabac_bypass(&lc->cc)) { suffix_val += 1 << k; k++; } if (k == 7) { - av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k); + av_log(lc->logctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k); return AVERROR_INVALIDDATA; } while (k--) - suffix_val += get_cabac_bypass(&s->HEVClc->cc) << k; + suffix_val += get_cabac_bypass(&lc->cc) << k; } return prefix_val + suffix_val; } -int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s) +int ff_hevc_cu_qp_delta_sign_flag(HEVCLocalContext *lc) { - return get_cabac_bypass(&s->HEVClc->cc); + return get_cabac_bypass(&lc->cc); } -int ff_hevc_cu_chroma_qp_offset_flag(HEVCContext *s) +int ff_hevc_cu_chroma_qp_offset_flag(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[CU_CHROMA_QP_OFFSET_FLAG]); } -int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s) +int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc) { - int c_max= FFMAX(5, s->ps.pps->chroma_qp_offset_list_len_minus1); + int c_max= FFMAX(5, lc->parent->ps.pps->chroma_qp_offset_list_len_minus1); int i = 0; while (i < c_max && GET_CABAC(elem_offset[CU_CHROMA_QP_OFFSET_IDX])) @@ -685,23 +689,25 @@ return i; } -int ff_hevc_pred_mode_decode(HEVCContext *s) +int ff_hevc_pred_mode_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[PRED_MODE_FLAG]); } -int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, int x0, int y0) +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, int x0, int y0) { + const HEVCContext *const s = lc->parent; + const HEVCSPS *const sps = s->ps.sps; int inc = 0, depth_left = 0, depth_top = 0; - int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); - int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); - int x_cb = x0 >> s->ps.sps->log2_min_cb_size; - int y_cb = y0 >> s->ps.sps->log2_min_cb_size; - - if (s->HEVClc->ctb_left_flag || x0b) - depth_left = s->tab_ct_depth[(y_cb) * s->ps.sps->min_cb_width + x_cb - 1]; - if (s->HEVClc->ctb_up_flag || y0b) - depth_top = s->tab_ct_depth[(y_cb - 1) * s->ps.sps->min_cb_width + x_cb]; + int x0b = av_mod_uintp2(x0, sps->log2_ctb_size); + int y0b = av_mod_uintp2(y0, sps->log2_ctb_size); + int x_cb = x0 >> sps->log2_min_cb_size; + int y_cb = y0 >> sps->log2_min_cb_size; + + if (lc->ctb_left_flag || x0b) + depth_left = s->tab_ct_depth[(y_cb) * sps->min_cb_width + x_cb - 1]; + if (lc->ctb_up_flag || y0b) + depth_top = s->tab_ct_depth[(y_cb - 1) * sps->min_cb_width + x_cb]; inc += (depth_left > ct_depth); inc += (depth_top > ct_depth); @@ -709,12 +715,12 @@ return GET_CABAC(elem_offset[SPLIT_CODING_UNIT_FLAG] + inc); } -int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size) +int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size) { if (GET_CABAC(elem_offset[PART_MODE])) // 1 return PART_2Nx2N; - if (log2_cb_size == s->ps.sps->log2_min_cb_size) { - if (s->HEVClc->cu.pred_mode == MODE_INTRA) // 0 + if (log2_cb_size == lc->parent->ps.sps->log2_min_cb_size) { + if (lc->cu.pred_mode == MODE_INTRA) // 0 return PART_NxN; if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01 return PART_2NxN; @@ -725,7 +731,7 @@ return PART_NxN; // 000 } - if (!s->ps.sps->amp_enabled_flag) { + if (!lc->parent->ps.sps->amp_enabled_flag) { if (GET_CABAC(elem_offset[PART_MODE] + 1)) // 01 return PART_2NxN; return PART_Nx2N; @@ -734,84 +740,84 @@ if (GET_CABAC(elem_offset[PART_MODE] + 1)) { // 01X, 01XX if (GET_CABAC(elem_offset[PART_MODE] + 3)) // 011 return PART_2NxN; - if (get_cabac_bypass(&s->HEVClc->cc)) // 0101 + if (get_cabac_bypass(&lc->cc)) // 0101 return PART_2NxnD; return PART_2NxnU; // 0100 } if (GET_CABAC(elem_offset[PART_MODE] + 3)) // 001 return PART_Nx2N; - if (get_cabac_bypass(&s->HEVClc->cc)) // 0001 + if (get_cabac_bypass(&lc->cc)) // 0001 return PART_nRx2N; return PART_nLx2N; // 0000 } -int ff_hevc_pcm_flag_decode(HEVCContext *s) +int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc) { - return get_cabac_terminate(&s->HEVClc->cc); + return get_cabac_terminate(&lc->cc); } -int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s) +int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[PREV_INTRA_LUMA_PRED_FLAG]); } -int ff_hevc_mpm_idx_decode(HEVCContext *s) +int ff_hevc_mpm_idx_decode(HEVCLocalContext *lc) { int i = 0; - while (i < 2 && get_cabac_bypass(&s->HEVClc->cc)) + while (i < 2 && get_cabac_bypass(&lc->cc)) i++; return i; } -int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s) +int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCLocalContext *lc) { int i; - int value = get_cabac_bypass(&s->HEVClc->cc); + int value = get_cabac_bypass(&lc->cc); for (i = 0; i < 4; i++) - value = (value << 1) | get_cabac_bypass(&s->HEVClc->cc); + value = (value << 1) | get_cabac_bypass(&lc->cc); return value; } -int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s) +int ff_hevc_intra_chroma_pred_mode_decode(HEVCLocalContext *lc) { int ret; if (!GET_CABAC(elem_offset[INTRA_CHROMA_PRED_MODE])) return 4; - ret = get_cabac_bypass(&s->HEVClc->cc) << 1; - ret |= get_cabac_bypass(&s->HEVClc->cc); + ret = get_cabac_bypass(&lc->cc) << 1; + ret |= get_cabac_bypass(&lc->cc); return ret; } -int ff_hevc_merge_idx_decode(HEVCContext *s) +int ff_hevc_merge_idx_decode(HEVCLocalContext *lc) { int i = GET_CABAC(elem_offset[MERGE_IDX]); if (i != 0) { - while (i < s->sh.max_num_merge_cand-1 && get_cabac_bypass(&s->HEVClc->cc)) + while (i < lc->parent->sh.max_num_merge_cand-1 && get_cabac_bypass(&lc->cc)) i++; } return i; } -int ff_hevc_merge_flag_decode(HEVCContext *s) +int ff_hevc_merge_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[MERGE_FLAG]); } -int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH) +int ff_hevc_inter_pred_idc_decode(HEVCLocalContext *lc, int nPbW, int nPbH) { if (nPbW + nPbH == 12) return GET_CABAC(elem_offset[INTER_PRED_IDC] + 4); - if (GET_CABAC(elem_offset[INTER_PRED_IDC] + s->HEVClc->ct_depth)) + if (GET_CABAC(elem_offset[INTER_PRED_IDC] + lc->ct_depth)) return PRED_BI; return GET_CABAC(elem_offset[INTER_PRED_IDC] + 4); } -int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx) +int ff_hevc_ref_idx_lx_decode(HEVCLocalContext *lc, int num_ref_idx_lx) { int i = 0; int max = num_ref_idx_lx - 1; @@ -820,87 +826,88 @@ while (i < max_ctx && GET_CABAC(elem_offset[REF_IDX_L0] + i)) i++; if (i == 2) { - while (i < max && get_cabac_bypass(&s->HEVClc->cc)) + while (i < max && get_cabac_bypass(&lc->cc)) i++; } return i; } -int ff_hevc_mvp_lx_flag_decode(HEVCContext *s) +int ff_hevc_mvp_lx_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[MVP_LX_FLAG]); } -int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s) +int ff_hevc_no_residual_syntax_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[NO_RESIDUAL_DATA_FLAG]); } -static av_always_inline int abs_mvd_greater0_flag_decode(HEVCContext *s) +static av_always_inline int abs_mvd_greater0_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[ABS_MVD_GREATER0_FLAG]); } -static av_always_inline int abs_mvd_greater1_flag_decode(HEVCContext *s) +static av_always_inline int abs_mvd_greater1_flag_decode(HEVCLocalContext *lc) { return GET_CABAC(elem_offset[ABS_MVD_GREATER1_FLAG] + 1); } -static av_always_inline int mvd_decode(HEVCContext *s) +static av_always_inline int mvd_decode(HEVCLocalContext *lc) { int ret = 2; int k = 1; - while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) { + while (k < CABAC_MAX_BIN && get_cabac_bypass(&lc->cc)) { ret += 1U << k; k++; } if (k == CABAC_MAX_BIN) { - av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k); + av_log(lc->logctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k); return 0; } while (k--) - ret += get_cabac_bypass(&s->HEVClc->cc) << k; - return get_cabac_bypass_sign(&s->HEVClc->cc, -ret); + ret += get_cabac_bypass(&lc->cc) << k; + return get_cabac_bypass_sign(&lc->cc, -ret); } -static av_always_inline int mvd_sign_flag_decode(HEVCContext *s) +static av_always_inline int mvd_sign_flag_decode(HEVCLocalContext *lc) { - return get_cabac_bypass_sign(&s->HEVClc->cc, -1); + return get_cabac_bypass_sign(&lc->cc, -1); } -int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size) +int ff_hevc_split_transform_flag_decode(HEVCLocalContext *lc, int log2_trafo_size) { return GET_CABAC(elem_offset[SPLIT_TRANSFORM_FLAG] + 5 - log2_trafo_size); } -int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth) +int ff_hevc_cbf_cb_cr_decode(HEVCLocalContext *lc, int trafo_depth) { return GET_CABAC(elem_offset[CBF_CB_CR] + trafo_depth); } -int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth) +int ff_hevc_cbf_luma_decode(HEVCLocalContext *lc, int trafo_depth) { return GET_CABAC(elem_offset[CBF_LUMA] + !trafo_depth); } -static int hevc_transform_skip_flag_decode(HEVCContext *s, int c_idx) +static int hevc_transform_skip_flag_decode(HEVCLocalContext *lc, int c_idx) { return GET_CABAC(elem_offset[TRANSFORM_SKIP_FLAG] + !!c_idx); } -static int explicit_rdpcm_flag_decode(HEVCContext *s, int c_idx) +static int explicit_rdpcm_flag_decode(HEVCLocalContext *lc, int c_idx) { return GET_CABAC(elem_offset[EXPLICIT_RDPCM_FLAG] + !!c_idx); } -static int explicit_rdpcm_dir_flag_decode(HEVCContext *s, int c_idx) +static int explicit_rdpcm_dir_flag_decode(HEVCLocalContext *lc, int c_idx) { return GET_CABAC(elem_offset[EXPLICIT_RDPCM_DIR_FLAG] + !!c_idx); } -int ff_hevc_log2_res_scale_abs(HEVCContext *s, int idx) { +int ff_hevc_log2_res_scale_abs(HEVCLocalContext *lc, int idx) +{ int i =0; while (i < 4 && GET_CABAC(elem_offset[LOG2_RES_SCALE_ABS] + 4 * idx + i)) @@ -909,11 +916,12 @@ return i; } -int ff_hevc_res_scale_sign_flag(HEVCContext *s, int idx) { +int ff_hevc_res_scale_sign_flag(HEVCLocalContext *lc, int idx) +{ return GET_CABAC(elem_offset[RES_SCALE_SIGN_FLAG] + idx); } -static av_always_inline void last_significant_coeff_xy_prefix_decode(HEVCContext *s, int c_idx, +static av_always_inline void last_significant_coeff_xy_prefix_decode(HEVCLocalContext *lc, int c_idx, int log2_size, int *last_scx_prefix, int *last_scy_prefix) { int i = 0; @@ -939,19 +947,19 @@ *last_scy_prefix = i; } -static av_always_inline int last_significant_coeff_suffix_decode(HEVCContext *s, +static av_always_inline int last_significant_coeff_suffix_decode(HEVCLocalContext *lc, int last_significant_coeff_prefix) { int i; int length = (last_significant_coeff_prefix >> 1) - 1; - int value = get_cabac_bypass(&s->HEVClc->cc); + int value = get_cabac_bypass(&lc->cc); for (i = 1; i < length; i++) - value = (value << 1) | get_cabac_bypass(&s->HEVClc->cc); + value = (value << 1) | get_cabac_bypass(&lc->cc); return value; } -static av_always_inline int significant_coeff_group_flag_decode(HEVCContext *s, int c_idx, int ctx_cg) +static av_always_inline int significant_coeff_group_flag_decode(HEVCLocalContext *lc, int c_idx, int ctx_cg) { int inc; @@ -959,19 +967,19 @@ return GET_CABAC(elem_offset[SIGNIFICANT_COEFF_GROUP_FLAG] + inc); } -static av_always_inline int significant_coeff_flag_decode(HEVCContext *s, int x_c, int y_c, +static av_always_inline int significant_coeff_flag_decode(HEVCLocalContext *lc, int x_c, int y_c, int offset, const uint8_t *ctx_idx_map) { int inc = ctx_idx_map[(y_c << 2) + x_c] + offset; return GET_CABAC(elem_offset[SIGNIFICANT_COEFF_FLAG] + inc); } -static av_always_inline int significant_coeff_flag_decode_0(HEVCContext *s, int c_idx, int offset) +static av_always_inline int significant_coeff_flag_decode_0(HEVCLocalContext *lc, int c_idx, int offset) { return GET_CABAC(elem_offset[SIGNIFICANT_COEFF_FLAG] + offset); } -static av_always_inline int coeff_abs_level_greater1_flag_decode(HEVCContext *s, int c_idx, int inc) +static av_always_inline int coeff_abs_level_greater1_flag_decode(HEVCLocalContext *lc, int c_idx, int inc) { if (c_idx > 0) @@ -980,7 +988,7 @@ return GET_CABAC(elem_offset[COEFF_ABS_LEVEL_GREATER1_FLAG] + inc); } -static av_always_inline int coeff_abs_level_greater2_flag_decode(HEVCContext *s, int c_idx, int inc) +static av_always_inline int coeff_abs_level_greater2_flag_decode(HEVCLocalContext *lc, int c_idx, int inc) { if (c_idx > 0) inc += 4; @@ -988,47 +996,47 @@ return GET_CABAC(elem_offset[COEFF_ABS_LEVEL_GREATER2_FLAG] + inc); } -static av_always_inline int coeff_abs_level_remaining_decode(HEVCContext *s, int rc_rice_param) +static av_always_inline int coeff_abs_level_remaining_decode(HEVCLocalContext *lc, int rc_rice_param) { int prefix = 0; int suffix = 0; int last_coeff_abs_level_remaining; int i; - while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) + while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&lc->cc)) prefix++; if (prefix < 3) { for (i = 0; i < rc_rice_param; i++) - suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc->cc); + suffix = (suffix << 1) | get_cabac_bypass(&lc->cc); last_coeff_abs_level_remaining = (prefix << rc_rice_param) + suffix; } else { int prefix_minus3 = prefix - 3; if (prefix == CABAC_MAX_BIN || prefix_minus3 + rc_rice_param > 16 + 6) { - av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix); + av_log(lc->logctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix); return 0; } for (i = 0; i < prefix_minus3 + rc_rice_param; i++) - suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc->cc); + suffix = (suffix << 1) | get_cabac_bypass(&lc->cc); last_coeff_abs_level_remaining = (((1 << prefix_minus3) + 3 - 1) << rc_rice_param) + suffix; } return last_coeff_abs_level_remaining; } -static av_always_inline int coeff_sign_flag_decode(HEVCContext *s, uint8_t nb) +static av_always_inline int coeff_sign_flag_decode(HEVCLocalContext *lc, uint8_t nb) { int i; int ret = 0; for (i = 0; i < nb; i++) - ret = (ret << 1) | get_cabac_bypass(&s->HEVClc->cc); + ret = (ret << 1) | get_cabac_bypass(&lc->cc); return ret; } -void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, +void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx) { @@ -1037,7 +1045,7 @@ x_c = (x_cg << 2) + scan_x_off[n]; \ y_c = (y_cg << 2) + scan_y_off[n]; \ } while (0) - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int transform_skip_flag = 0; int last_significant_coeff_x, last_significant_coeff_y; @@ -1092,7 +1100,7 @@ if (s->ps.pps->transform_skip_enabled_flag && log2_trafo_size <= s->ps.pps->log2_max_transform_skip_block_size) { - transform_skip_flag = hevc_transform_skip_flag_decode(s, c_idx); + transform_skip_flag = hevc_transform_skip_flag_decode(lc, c_idx); } if (c_idx == 0) { @@ -1151,24 +1159,24 @@ if (lc->cu.pred_mode == MODE_INTER && s->ps.sps->explicit_rdpcm_enabled_flag && (transform_skip_flag || lc->cu.cu_transquant_bypass_flag)) { - explicit_rdpcm_flag = explicit_rdpcm_flag_decode(s, c_idx); + explicit_rdpcm_flag = explicit_rdpcm_flag_decode(lc, c_idx); if (explicit_rdpcm_flag) { - explicit_rdpcm_dir_flag = explicit_rdpcm_dir_flag_decode(s, c_idx); + explicit_rdpcm_dir_flag = explicit_rdpcm_dir_flag_decode(lc, c_idx); } } - last_significant_coeff_xy_prefix_decode(s, c_idx, log2_trafo_size, + last_significant_coeff_xy_prefix_decode(lc, c_idx, log2_trafo_size, &last_significant_coeff_x, &last_significant_coeff_y); if (last_significant_coeff_x > 3) { - int suffix = last_significant_coeff_suffix_decode(s, last_significant_coeff_x); + int suffix = last_significant_coeff_suffix_decode(lc, last_significant_coeff_x); last_significant_coeff_x = (1 << ((last_significant_coeff_x >> 1) - 1)) * (2 + (last_significant_coeff_x & 1)) + suffix; } if (last_significant_coeff_y > 3) { - int suffix = last_significant_coeff_suffix_decode(s, last_significant_coeff_y); + int suffix = last_significant_coeff_suffix_decode(lc, last_significant_coeff_y); last_significant_coeff_y = (1 << ((last_significant_coeff_y >> 1) - 1)) * (2 + (last_significant_coeff_y & 1)) + suffix; @@ -1247,7 +1255,7 @@ ctx_cg += significant_coeff_group_flag[x_cg][y_cg + 1]; significant_coeff_group_flag[x_cg][y_cg] = - significant_coeff_group_flag_decode(s, c_idx, ctx_cg); + significant_coeff_group_flag_decode(lc, c_idx, ctx_cg); implicit_non_zero_coeff = 1; } else { significant_coeff_group_flag[x_cg][y_cg] = @@ -1314,7 +1322,7 @@ for (n = n_end; n > 0; n--) { x_c = scan_x_off[n]; y_c = scan_y_off[n]; - if (significant_coeff_flag_decode(s, x_c, y_c, scf_offset, ctx_idx_map_p)) { + if (significant_coeff_flag_decode(lc, x_c, y_c, scf_offset, ctx_idx_map_p)) { significant_coeff_flag_idx[nb_significant_coeff_flag] = n; nb_significant_coeff_flag++; implicit_non_zero_coeff = 0; @@ -1338,7 +1346,7 @@ scf_offset = 2 + scf_offset; } } - if (significant_coeff_flag_decode_0(s, c_idx, scf_offset) == 1) { + if (significant_coeff_flag_decode_0(lc, c_idx, scf_offset) == 1) { significant_coeff_flag_idx[nb_significant_coeff_flag] = 0; nb_significant_coeff_flag++; } @@ -1382,7 +1390,7 @@ for (m = 0; m < (n_end > 8 ? 8 : n_end); m++) { int inc = (ctx_set << 2) + greater1_ctx; coeff_abs_level_greater1_flag[m] = - coeff_abs_level_greater1_flag_decode(s, c_idx, inc); + coeff_abs_level_greater1_flag_decode(lc, c_idx, inc); if (coeff_abs_level_greater1_flag[m]) { greater1_ctx = 0; if (first_greater1_coeff_idx == -1) @@ -1403,12 +1411,12 @@ sign_hidden = (last_nz_pos_in_cg - first_nz_pos_in_cg >= 4); if (first_greater1_coeff_idx != -1) { - coeff_abs_level_greater1_flag[first_greater1_coeff_idx] += coeff_abs_level_greater2_flag_decode(s, c_idx, ctx_set); + coeff_abs_level_greater1_flag[first_greater1_coeff_idx] += coeff_abs_level_greater2_flag_decode(lc, c_idx, ctx_set); } if (!s->ps.pps->sign_data_hiding_flag || !sign_hidden ) { - coeff_sign_flag = coeff_sign_flag_decode(s, nb_significant_coeff_flag) << (16 - nb_significant_coeff_flag); + coeff_sign_flag = coeff_sign_flag_decode(lc, nb_significant_coeff_flag) << (16 - nb_significant_coeff_flag); } else { - coeff_sign_flag = coeff_sign_flag_decode(s, nb_significant_coeff_flag - 1) << (16 - (nb_significant_coeff_flag - 1)); + coeff_sign_flag = coeff_sign_flag_decode(lc, nb_significant_coeff_flag - 1) << (16 - (nb_significant_coeff_flag - 1)); } for (m = 0; m < n_end; m++) { @@ -1417,7 +1425,7 @@ if (m < 8) { trans_coeff_level = 1 + coeff_abs_level_greater1_flag[m]; if (trans_coeff_level == ((m == first_greater1_coeff_idx) ? 3 : 2)) { - int last_coeff_abs_level_remaining = coeff_abs_level_remaining_decode(s, c_rice_param); + int last_coeff_abs_level_remaining = coeff_abs_level_remaining_decode(lc, c_rice_param); trans_coeff_level += last_coeff_abs_level_remaining; if (trans_coeff_level > (3 << c_rice_param)) @@ -1433,7 +1441,7 @@ } } } else { - int last_coeff_abs_level_remaining = coeff_abs_level_remaining_decode(s, c_rice_param); + int last_coeff_abs_level_remaining = coeff_abs_level_remaining_decode(lc, c_rice_param); trans_coeff_level = 1 + last_coeff_abs_level_remaining; if (trans_coeff_level > (3 << c_rice_param)) @@ -1538,26 +1546,25 @@ s->hevcdsp.add_residual[log2_trafo_size-2](dst, coeffs, stride); } -void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size) +void ff_hevc_hls_mvd_coding(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size) { - HEVCLocalContext *lc = s->HEVClc; - int x = abs_mvd_greater0_flag_decode(s); - int y = abs_mvd_greater0_flag_decode(s); + int x = abs_mvd_greater0_flag_decode(lc); + int y = abs_mvd_greater0_flag_decode(lc); if (x) - x += abs_mvd_greater1_flag_decode(s); + x += abs_mvd_greater1_flag_decode(lc); if (y) - y += abs_mvd_greater1_flag_decode(s); + y += abs_mvd_greater1_flag_decode(lc); switch (x) { - case 2: lc->pu.mvd.x = mvd_decode(s); break; - case 1: lc->pu.mvd.x = mvd_sign_flag_decode(s); break; + case 2: lc->pu.mvd.x = mvd_decode(lc); break; + case 1: lc->pu.mvd.x = mvd_sign_flag_decode(lc); break; case 0: lc->pu.mvd.x = 0; break; } switch (y) { - case 2: lc->pu.mvd.y = mvd_decode(s); break; - case 1: lc->pu.mvd.y = mvd_sign_flag_decode(s); break; + case 2: lc->pu.mvd.y = mvd_decode(lc); break; + case 1: lc->pu.mvd.y = mvd_sign_flag_decode(lc); break; case 0: lc->pu.mvd.y = 0; break; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "config_components.h" #include "libavutil/attributes.h" +#include "libavutil/avstring.h" #include "libavutil/common.h" #include "libavutil/display.h" #include "libavutil/film_grain_params.h" @@ -34,13 +35,13 @@ #include "libavutil/md5.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" -#include "libavutil/stereo3d.h" #include "libavutil/timecode.h" #include "bswapdsp.h" #include "bytestream.h" #include "cabac_functions.h" #include "codec_internal.h" +#include "decode.h" #include "golomb.h" #include "hevc.h" #include "hevc_data.h" @@ -338,18 +339,18 @@ avctx->profile = sps->ptl.general_ptl.profile_idc; avctx->level = sps->ptl.general_ptl.level_idc; - ff_set_sar(avctx, sps->vui.sar); + ff_set_sar(avctx, sps->vui.common.sar); - if (sps->vui.video_signal_type_present_flag) - avctx->color_range = sps->vui.video_full_range_flag ? AVCOL_RANGE_JPEG - : AVCOL_RANGE_MPEG; + if (sps->vui.common.video_signal_type_present_flag) + avctx->color_range = sps->vui.common.video_full_range_flag ? AVCOL_RANGE_JPEG + : AVCOL_RANGE_MPEG; else avctx->color_range = AVCOL_RANGE_MPEG; - if (sps->vui.colour_description_present_flag) { - avctx->color_primaries = sps->vui.colour_primaries; - avctx->color_trc = sps->vui.transfer_characteristic; - avctx->colorspace = sps->vui.matrix_coeffs; + if (sps->vui.common.colour_description_present_flag) { + avctx->color_primaries = sps->vui.common.colour_primaries; + avctx->color_trc = sps->vui.common.transfer_characteristics; + avctx->colorspace = sps->vui.common.matrix_coeffs; } else { avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; avctx->color_trc = AVCOL_TRC_UNSPECIFIED; @@ -358,9 +359,9 @@ avctx->chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED; if (sps->chroma_format_idc == 1) { - if (sps->vui.chroma_loc_info_present_flag) { - if (sps->vui.chroma_sample_loc_type_top_field <= 5) - avctx->chroma_sample_location = sps->vui.chroma_sample_loc_type_top_field + 1; + if (sps->vui.common.chroma_loc_info_present_flag) { + if (sps->vui.common.chroma_sample_loc_type_top_field <= 5) + avctx->chroma_sample_location = sps->vui.common.chroma_sample_loc_type_top_field + 1; } else avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; } @@ -382,16 +383,16 @@ { AVCodecContext *avctx = s->avctx; - if (s->sei.a53_caption.buf_ref) + if (s->sei.common.a53_caption.buf_ref) s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; - if (s->sei.alternative_transfer.present && - av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && - s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { - avctx->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; + if (s->sei.common.alternative_transfer.present && + av_color_transfer_name(s->sei.common.alternative_transfer.preferred_transfer_characteristics) && + s->sei.common.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { + avctx->color_trc = s->sei.common.alternative_transfer.preferred_transfer_characteristics; } - if (s->sei.film_grain_characteristics.present) + if (s->sei.common.film_grain_characteristics.present) avctx->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; return 0; @@ -452,6 +453,9 @@ #endif break; case AV_PIX_FMT_YUV444P: +#if CONFIG_HEVC_VAAPI_HWACCEL + *fmt++ = AV_PIX_FMT_VAAPI; +#endif #if CONFIG_HEVC_VDPAU_HWACCEL *fmt++ = AV_PIX_FMT_VDPAU; #endif @@ -477,6 +481,9 @@ #endif case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV444P12: +#if CONFIG_HEVC_VAAPI_HWACCEL + *fmt++ = AV_PIX_FMT_VAAPI; +#endif #if CONFIG_HEVC_VDPAU_HWACCEL *fmt++ = AV_PIX_FMT_VDPAU; #endif @@ -484,6 +491,11 @@ *fmt++ = AV_PIX_FMT_CUDA; #endif break; + case AV_PIX_FMT_YUV422P12: +#if CONFIG_HEVC_VAAPI_HWACCEL + *fmt++ = AV_PIX_FMT_VAAPI; +#endif + break; } *fmt++ = sps->pix_fmt; @@ -569,7 +581,7 @@ } if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; if (IS_IDR(s)) ff_hevc_clear_refs(s); @@ -594,15 +606,8 @@ if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) { const HEVCSPS *sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data; - const HEVCSPS *last_sps = s->ps.sps; enum AVPixelFormat pix_fmt; - if (last_sps && IS_IRAP(s) && s->nal_unit_type != HEVC_NAL_CRA_NUT) { - if (sps->width != last_sps->width || sps->height != last_sps->height || - sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering != - last_sps->temporal_layer[last_sps->max_sub_layers - 1].max_dec_pic_buffering) - sh->no_output_of_prior_pics_flag = 0; - } ff_hevc_clear_refs(s); ret = set_sps(s, sps, sps->pix_fmt); @@ -614,7 +619,7 @@ return pix_fmt; s->avctx->pix_fmt = pix_fmt; - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; } @@ -1005,9 +1010,9 @@ sao->elem = 0; \ } while (0) -static void hls_sao_param(HEVCContext *s, int rx, int ry) +static void hls_sao_param(HEVCLocalContext *lc, int rx, int ry) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int sao_merge_left_flag = 0; int sao_merge_up_flag = 0; SAOParams *sao = &CTB(s->sao, rx, ry); @@ -1017,11 +1022,11 @@ s->sh.slice_sample_adaptive_offset_flag[1]) { if (rx > 0) { if (lc->ctb_left_flag) - sao_merge_left_flag = ff_hevc_sao_merge_flag_decode(s); + sao_merge_left_flag = ff_hevc_sao_merge_flag_decode(lc); } if (ry > 0 && !sao_merge_left_flag) { if (lc->ctb_up_flag) - sao_merge_up_flag = ff_hevc_sao_merge_flag_decode(s); + sao_merge_up_flag = ff_hevc_sao_merge_flag_decode(lc); } } @@ -1038,27 +1043,27 @@ sao->type_idx[2] = sao->type_idx[1]; sao->eo_class[2] = sao->eo_class[1]; } else { - SET_SAO(type_idx[c_idx], ff_hevc_sao_type_idx_decode(s)); + SET_SAO(type_idx[c_idx], ff_hevc_sao_type_idx_decode(lc)); } if (sao->type_idx[c_idx] == SAO_NOT_APPLIED) continue; for (i = 0; i < 4; i++) - SET_SAO(offset_abs[c_idx][i], ff_hevc_sao_offset_abs_decode(s)); + SET_SAO(offset_abs[c_idx][i], ff_hevc_sao_offset_abs_decode(lc)); if (sao->type_idx[c_idx] == SAO_BAND) { for (i = 0; i < 4; i++) { if (sao->offset_abs[c_idx][i]) { SET_SAO(offset_sign[c_idx][i], - ff_hevc_sao_offset_sign_decode(s)); + ff_hevc_sao_offset_sign_decode(lc)); } else { sao->offset_sign[c_idx][i] = 0; } } - SET_SAO(band_position[c_idx], ff_hevc_sao_band_position_decode(s)); + SET_SAO(band_position[c_idx], ff_hevc_sao_band_position_decode(lc)); } else if (c_idx != 2) { - SET_SAO(eo_class[c_idx], ff_hevc_sao_eo_class_decode(s)); + SET_SAO(eo_class[c_idx], ff_hevc_sao_eo_class_decode(lc)); } // Inferred parameters @@ -1079,12 +1084,12 @@ #undef SET_SAO #undef CTB -static int hls_cross_component_pred(HEVCContext *s, int idx) { - HEVCLocalContext *lc = s->HEVClc; - int log2_res_scale_abs_plus1 = ff_hevc_log2_res_scale_abs(s, idx); +static int hls_cross_component_pred(HEVCLocalContext *lc, int idx) +{ + int log2_res_scale_abs_plus1 = ff_hevc_log2_res_scale_abs(lc, idx); if (log2_res_scale_abs_plus1 != 0) { - int res_scale_sign_flag = ff_hevc_res_scale_sign_flag(s, idx); + int res_scale_sign_flag = ff_hevc_res_scale_sign_flag(lc, idx); lc->tu.res_scale_val = (1 << (log2_res_scale_abs_plus1 - 1)) * (1 - 2 * res_scale_sign_flag); } else { @@ -1095,20 +1100,20 @@ return 0; } -static int hls_transform_unit(HEVCContext *s, int x0, int y0, +static int hls_transform_unit(HEVCLocalContext *lc, int x0, int y0, int xBase, int yBase, int cb_xBase, int cb_yBase, int log2_cb_size, int log2_trafo_size, int blk_idx, int cbf_luma, int *cbf_cb, int *cbf_cr) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; const int log2_trafo_size_c = log2_trafo_size - s->ps.sps->hshift[1]; int i; if (lc->cu.pred_mode == MODE_INTRA) { int trafo_size = 1 << log2_trafo_size; - ff_hevc_set_neighbour_available(s, x0, y0, trafo_size, trafo_size); + ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size, trafo_size); - s->hpc.intra_pred[log2_trafo_size - 2](s, x0, y0, 0); + s->hpc.intra_pred[log2_trafo_size - 2](lc, x0, y0, 0); } if (cbf_luma || cbf_cb[0] || cbf_cr[0] || @@ -1120,9 +1125,9 @@ (cbf_cb[1] || cbf_cr[1])); if (s->ps.pps->cu_qp_delta_enabled_flag && !lc->tu.is_cu_qp_delta_coded) { - lc->tu.cu_qp_delta = ff_hevc_cu_qp_delta_abs(s); + lc->tu.cu_qp_delta = ff_hevc_cu_qp_delta_abs(lc); if (lc->tu.cu_qp_delta != 0) - if (ff_hevc_cu_qp_delta_sign_flag(s) == 1) + if (ff_hevc_cu_qp_delta_sign_flag(lc) == 1) lc->tu.cu_qp_delta = -lc->tu.cu_qp_delta; lc->tu.is_cu_qp_delta_coded = 1; @@ -1137,16 +1142,16 @@ return AVERROR_INVALIDDATA; } - ff_hevc_set_qPy(s, cb_xBase, cb_yBase, log2_cb_size); + ff_hevc_set_qPy(lc, cb_xBase, cb_yBase, log2_cb_size); } if (s->sh.cu_chroma_qp_offset_enabled_flag && cbf_chroma && !lc->cu.cu_transquant_bypass_flag && !lc->tu.is_cu_chroma_qp_offset_coded) { - int cu_chroma_qp_offset_flag = ff_hevc_cu_chroma_qp_offset_flag(s); + int cu_chroma_qp_offset_flag = ff_hevc_cu_chroma_qp_offset_flag(lc); if (cu_chroma_qp_offset_flag) { int cu_chroma_qp_offset_idx = 0; if (s->ps.pps->chroma_qp_offset_list_len_minus1 > 0) { - cu_chroma_qp_offset_idx = ff_hevc_cu_chroma_qp_offset_idx(s); + cu_chroma_qp_offset_idx = ff_hevc_cu_chroma_qp_offset_idx(lc); av_log(s->avctx, AV_LOG_ERROR, "cu_chroma_qp_offset_idx not yet tested.\n"); } @@ -1180,7 +1185,7 @@ lc->tu.cross_pf = 0; if (cbf_luma) - ff_hevc_hls_residual_coding(s, x0, y0, log2_trafo_size, scan_idx, 0); + ff_hevc_hls_residual_coding(lc, x0, y0, log2_trafo_size, scan_idx, 0); if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) { int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]); int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]); @@ -1189,22 +1194,22 @@ (lc->tu.chroma_mode_c == 4))); if (lc->tu.cross_pf) { - hls_cross_component_pred(s, 0); + hls_cross_component_pred(lc, 0); } for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { - ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 1); + ff_hevc_set_neighbour_available(lc, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (i << log2_trafo_size_c), 1); } if (cbf_cb[i]) - ff_hevc_hls_residual_coding(s, x0, y0 + (i << log2_trafo_size_c), + ff_hevc_hls_residual_coding(lc, x0, y0 + (i << log2_trafo_size_c), log2_trafo_size_c, scan_idx_c, 1); else if (lc->tu.cross_pf) { ptrdiff_t stride = s->frame->linesize[1]; int hshift = s->ps.sps->hshift[1]; int vshift = s->ps.sps->vshift[1]; - int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; + const int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2; int size = 1 << log2_trafo_size_c; @@ -1218,22 +1223,23 @@ } if (lc->tu.cross_pf) { - hls_cross_component_pred(s, 1); + hls_cross_component_pred(lc, 1); } for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { - ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 2); + ff_hevc_set_neighbour_available(lc, x0, y0 + (i << log2_trafo_size_c), + trafo_size_h, trafo_size_v); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (i << log2_trafo_size_c), 2); } if (cbf_cr[i]) - ff_hevc_hls_residual_coding(s, x0, y0 + (i << log2_trafo_size_c), + ff_hevc_hls_residual_coding(lc, x0, y0 + (i << log2_trafo_size_c), log2_trafo_size_c, scan_idx_c, 2); else if (lc->tu.cross_pf) { ptrdiff_t stride = s->frame->linesize[2]; int hshift = s->ps.sps->hshift[2]; int vshift = s->ps.sps->vshift[2]; - int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; + const int16_t *coeffs_y = (int16_t*)lc->edge_emu_buffer; int16_t *coeffs = (int16_t*)lc->edge_emu_buffer2; int size = 1 << log2_trafo_size_c; @@ -1250,22 +1256,22 @@ int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]); for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { - ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size), + ff_hevc_set_neighbour_available(lc, xBase, yBase + (i << log2_trafo_size), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (i << log2_trafo_size), 1); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (i << log2_trafo_size), 1); } if (cbf_cb[i]) - ff_hevc_hls_residual_coding(s, xBase, yBase + (i << log2_trafo_size), + ff_hevc_hls_residual_coding(lc, xBase, yBase + (i << log2_trafo_size), log2_trafo_size, scan_idx_c, 1); } for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { if (lc->cu.pred_mode == MODE_INTRA) { - ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size), + ff_hevc_set_neighbour_available(lc, xBase, yBase + (i << log2_trafo_size), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (i << log2_trafo_size), 2); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (i << log2_trafo_size), 2); } if (cbf_cr[i]) - ff_hevc_hls_residual_coding(s, xBase, yBase + (i << log2_trafo_size), + ff_hevc_hls_residual_coding(lc, xBase, yBase + (i << log2_trafo_size), log2_trafo_size, scan_idx_c, 2); } } @@ -1273,27 +1279,27 @@ if (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3) { int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]); int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]); - ff_hevc_set_neighbour_available(s, x0, y0, trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 1); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 2); + ff_hevc_set_neighbour_available(lc, x0, y0, trafo_size_h, trafo_size_v); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0, 1); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0, 2); if (s->ps.sps->chroma_format_idc == 2) { - ff_hevc_set_neighbour_available(s, x0, y0 + (1 << log2_trafo_size_c), + ff_hevc_set_neighbour_available(lc, x0, y0 + (1 << log2_trafo_size_c), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (1 << log2_trafo_size_c), 1); - s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (1 << log2_trafo_size_c), 2); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (1 << log2_trafo_size_c), 1); + s->hpc.intra_pred[log2_trafo_size_c - 2](lc, x0, y0 + (1 << log2_trafo_size_c), 2); } } else if (blk_idx == 3) { int trafo_size_h = 1 << (log2_trafo_size + 1); int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]); - ff_hevc_set_neighbour_available(s, xBase, yBase, + ff_hevc_set_neighbour_available(lc, xBase, yBase, trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 1); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 2); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase, 1); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase, 2); if (s->ps.sps->chroma_format_idc == 2) { - ff_hevc_set_neighbour_available(s, xBase, yBase + (1 << (log2_trafo_size)), + ff_hevc_set_neighbour_available(lc, xBase, yBase + (1 << log2_trafo_size), trafo_size_h, trafo_size_v); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (1 << (log2_trafo_size)), 1); - s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (1 << (log2_trafo_size)), 2); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (1 << log2_trafo_size), 1); + s->hpc.intra_pred[log2_trafo_size - 2](lc, xBase, yBase + (1 << log2_trafo_size), 2); } } } @@ -1301,7 +1307,7 @@ return 0; } -static void set_deblocking_bypass(HEVCContext *s, int x0, int y0, int log2_cb_size) +static void set_deblocking_bypass(const HEVCContext *s, int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; int log2_min_pu_size = s->ps.sps->log2_min_pu_size; @@ -1316,13 +1322,13 @@ s->is_pcm[i + j * min_pu_width] = 2; } -static int hls_transform_tree(HEVCContext *s, int x0, int y0, +static int hls_transform_tree(HEVCLocalContext *lc, int x0, int y0, int xBase, int yBase, int cb_xBase, int cb_yBase, int log2_cb_size, int log2_trafo_size, int trafo_depth, int blk_idx, const int *base_cbf_cb, const int *base_cbf_cr) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; uint8_t split_transform_flag; int cbf_cb[2]; int cbf_cr[2]; @@ -1354,7 +1360,7 @@ log2_trafo_size > s->ps.sps->log2_min_tb_size && trafo_depth < lc->cu.max_trafo_depth && !(lc->cu.intra_split_flag && trafo_depth == 0)) { - split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size); + split_transform_flag = ff_hevc_split_transform_flag_decode(lc, log2_trafo_size); } else { int inter_split = s->ps.sps->max_transform_hierarchy_depth_inter == 0 && lc->cu.pred_mode == MODE_INTER && @@ -1368,16 +1374,16 @@ if (s->ps.sps->chroma_format_idc && (log2_trafo_size > 2 || s->ps.sps->chroma_format_idc == 3)) { if (trafo_depth == 0 || cbf_cb[0]) { - cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth); + cbf_cb[0] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { - cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth); + cbf_cb[1] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); } } if (trafo_depth == 0 || cbf_cr[0]) { - cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth); + cbf_cr[0] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); if (s->ps.sps->chroma_format_idc == 2 && (!split_transform_flag || log2_trafo_size == 3)) { - cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(s, trafo_depth); + cbf_cr[1] = ff_hevc_cbf_cb_cr_decode(lc, trafo_depth); } } } @@ -1389,7 +1395,7 @@ #define SUBDIVIDE(x, y, idx) \ do { \ - ret = hls_transform_tree(s, x, y, x0, y0, cb_xBase, cb_yBase, log2_cb_size, \ + ret = hls_transform_tree(lc, x, y, x0, y0, cb_xBase, cb_yBase, log2_cb_size,\ log2_trafo_size - 1, trafo_depth + 1, idx, \ cbf_cb, cbf_cr); \ if (ret < 0) \ @@ -1411,10 +1417,10 @@ if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 || cbf_cb[0] || cbf_cr[0] || (s->ps.sps->chroma_format_idc == 2 && (cbf_cb[1] || cbf_cr[1]))) { - cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth); + cbf_luma = ff_hevc_cbf_luma_decode(lc, trafo_depth); } - ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase, + ret = hls_transform_unit(lc, x0, y0, xBase, yBase, cb_xBase, cb_yBase, log2_cb_size, log2_trafo_size, blk_idx, cbf_luma, cbf_cb, cbf_cr); if (ret < 0) @@ -1430,7 +1436,7 @@ } } if (!s->sh.disable_deblocking_filter_flag) { - ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size); + ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_trafo_size); if (s->ps.pps->transquant_bypass_enable_flag && lc->cu.cu_transquant_bypass_flag) set_deblocking_bypass(s, x0, y0, log2_trafo_size); @@ -1439,9 +1445,9 @@ return 0; } -static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size) +static int hls_pcm_sample(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; GetBitContext gb; int cb_size = 1 << log2_cb_size; ptrdiff_t stride0 = s->frame->linesize[0]; @@ -1459,7 +1465,7 @@ int ret; if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); ret = init_get_bits(&gb, pcm, length); if (ret < 0) @@ -1496,12 +1502,12 @@ * @param luma_offset additive offset applied to the luma prediction value */ -static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, - AVFrame *ref, const Mv *mv, int x_off, int y_off, +static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, + const AVFrame *ref, const Mv *mv, int x_off, int y_off, int block_w, int block_h, int luma_weight, int luma_offset) { - HEVCLocalContext *lc = s->HEVClc; - uint8_t *src = ref->data[0]; + const HEVCContext *const s = lc->parent; + const uint8_t *src = ref->data[0]; ptrdiff_t srcstride = ref->linesize[0]; int pic_width = s->ps.sps->width; int pic_height = s->ps.sps->height; @@ -1557,11 +1563,12 @@ * @param mv1 motion vector1 (relative to block position) to get pixel data from * @param current_mv current motion vector structure */ - static void luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, - AVFrame *ref0, const Mv *mv0, int x_off, int y_off, - int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) + static void luma_mc_bi(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, + const AVFrame *ref0, const Mv *mv0, int x_off, int y_off, + int block_w, int block_h, const AVFrame *ref1, + const Mv *mv1, struct MvField *current_mv) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; ptrdiff_t src0stride = ref0->linesize[0]; ptrdiff_t src1stride = ref1->linesize[0]; int pic_width = s->ps.sps->width; @@ -1578,8 +1585,8 @@ int y_off1 = y_off + (mv1->y >> 2); int idx = hevc_pel_weight[block_w]; - uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift); - uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift); + const uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift); + const uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift); if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER || x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER || @@ -1648,11 +1655,12 @@ * @param chroma_offset additive offset applied to the chroma prediction value */ -static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, - ptrdiff_t dststride, uint8_t *src0, ptrdiff_t srcstride, int reflist, - int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset) +static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, + ptrdiff_t dststride, const uint8_t *src0, ptrdiff_t srcstride, int reflist, + int x_off, int y_off, int block_w, int block_h, + const struct MvField *current_mv, int chroma_weight, int chroma_offset) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; const Mv *mv = ¤t_mv->mv[reflist]; @@ -1713,20 +1721,21 @@ * @param current_mv current motion vector structure * @param cidx chroma component(cb, cr) */ -static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, - int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx) -{ - HEVCLocalContext *lc = s->HEVClc; - uint8_t *src1 = ref0->data[cidx+1]; - uint8_t *src2 = ref1->data[cidx+1]; +static void chroma_mc_bi(HEVCLocalContext *lc, uint8_t *dst0, ptrdiff_t dststride, + const AVFrame *ref0, const AVFrame *ref1, + int x_off, int y_off, int block_w, int block_h, const MvField *current_mv, int cidx) +{ + const HEVCContext *const s = lc->parent; + const uint8_t *src1 = ref0->data[cidx+1]; + const uint8_t *src2 = ref1->data[cidx+1]; ptrdiff_t src1stride = ref0->linesize[cidx+1]; ptrdiff_t src2stride = ref1->linesize[cidx+1]; int weight_flag = (s->sh.slice_type == HEVC_SLICE_P && s->ps.pps->weighted_pred_flag) || (s->sh.slice_type == HEVC_SLICE_B && s->ps.pps->weighted_bipred_flag); int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; - Mv *mv0 = ¤t_mv->mv[0]; - Mv *mv1 = ¤t_mv->mv[1]; + const Mv *const mv0 = ¤t_mv->mv[0]; + const Mv *const mv1 = ¤t_mv->mv[1]; int hshift = s->ps.sps->hshift[1]; int vshift = s->ps.sps->vshift[1]; @@ -1803,7 +1812,7 @@ _mx1, _my1, block_w); } -static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref, +static void hevc_await_progress(const HEVCContext *s, const HEVCFrame *ref, const Mv *mv, int y0, int height) { if (s->threads_type == FF_THREAD_FRAME ) { @@ -1813,27 +1822,27 @@ } } -static void hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW, +static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; enum InterPredIdc inter_pred_idc = PRED_L0; int mvp_flag; - ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH); + ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH); mv->pred_flag = 0; if (s->sh.slice_type == HEVC_SLICE_B) - inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH); + inter_pred_idc = ff_hevc_inter_pred_idc_decode(lc, nPbW, nPbH); if (inter_pred_idc != PRED_L1) { if (s->sh.nb_refs[L0]) - mv->ref_idx[0]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]); + mv->ref_idx[0]= ff_hevc_ref_idx_lx_decode(lc, s->sh.nb_refs[L0]); mv->pred_flag = PF_L0; - ff_hevc_hls_mvd_coding(s, x0, y0, 0); - mvp_flag = ff_hevc_mvp_lx_flag_decode(s); - ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_hls_mvd_coding(lc, x0, y0, 0); + mvp_flag = ff_hevc_mvp_lx_flag_decode(lc); + ff_hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, part_idx, merge_idx, mv, mvp_flag, 0); mv->mv[0].x += lc->pu.mvd.x; mv->mv[0].y += lc->pu.mvd.y; @@ -1841,39 +1850,39 @@ if (inter_pred_idc != PRED_L0) { if (s->sh.nb_refs[L1]) - mv->ref_idx[1]= ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L1]); + mv->ref_idx[1]= ff_hevc_ref_idx_lx_decode(lc, s->sh.nb_refs[L1]); if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) { AV_ZERO32(&lc->pu.mvd); } else { - ff_hevc_hls_mvd_coding(s, x0, y0, 1); + ff_hevc_hls_mvd_coding(lc, x0, y0, 1); } mv->pred_flag += PF_L1; - mvp_flag = ff_hevc_mvp_lx_flag_decode(s); - ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + mvp_flag = ff_hevc_mvp_lx_flag_decode(lc); + ff_hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, part_idx, merge_idx, mv, mvp_flag, 1); mv->mv[1].x += lc->pu.mvd.x; mv->mv[1].y += lc->pu.mvd.y; } } -static void hls_prediction_unit(HEVCContext *s, int x0, int y0, +static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int partIdx, int idx) { #define POS(c_idx, x, y) \ &s->frame->data[c_idx][((y) >> s->ps.sps->vshift[c_idx]) * s->frame->linesize[c_idx] + \ (((x) >> s->ps.sps->hshift[c_idx]) << s->ps.sps->pixel_shift)] - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int merge_idx = 0; struct MvField current_mv = {{{ 0 }}}; int min_pu_width = s->ps.sps->min_pu_width; MvField *tab_mvf = s->ref->tab_mvf; - RefPicList *refPicList = s->ref->refPicList; - HEVCFrame *ref0 = NULL, *ref1 = NULL; + const RefPicList *refPicList = s->ref->refPicList; + const HEVCFrame *ref0 = NULL, *ref1 = NULL; uint8_t *dst0 = POS(0, x0, y0); uint8_t *dst1 = POS(1, x0, y0); uint8_t *dst2 = POS(2, x0, y0); @@ -1887,18 +1896,18 @@ int skip_flag = SAMPLE_CTB(s->skip_flag, x_cb, y_cb); if (!skip_flag) - lc->pu.merge_flag = ff_hevc_merge_flag_decode(s); + lc->pu.merge_flag = ff_hevc_merge_flag_decode(lc); if (skip_flag || lc->pu.merge_flag) { if (s->sh.max_num_merge_cand > 1) - merge_idx = ff_hevc_merge_idx_decode(s); + merge_idx = ff_hevc_merge_idx_decode(lc); else merge_idx = 0; - ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_luma_mv_merge_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, partIdx, merge_idx, ¤t_mv); } else { - hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size, + hevc_luma_mv_mvp_mode(lc, x0, y0, nPbW, nPbH, log2_cb_size, partIdx, merge_idx, ¤t_mv); } @@ -1928,16 +1937,16 @@ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; int nPbH_c = nPbH >> s->ps.sps->vshift[1]; - luma_mc_uni(s, dst0, s->frame->linesize[0], ref0->frame, + luma_mc_uni(lc, dst0, s->frame->linesize[0], ref0->frame, ¤t_mv.mv[0], x0, y0, nPbW, nPbH, s->sh.luma_weight_l0[current_mv.ref_idx[0]], s->sh.luma_offset_l0[current_mv.ref_idx[0]]); if (s->ps.sps->chroma_format_idc) { - chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1], + chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1], 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]); - chroma_mc_uni(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2], + chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2], 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]); } @@ -1947,17 +1956,17 @@ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; int nPbH_c = nPbH >> s->ps.sps->vshift[1]; - luma_mc_uni(s, dst0, s->frame->linesize[0], ref1->frame, + luma_mc_uni(lc, dst0, s->frame->linesize[0], ref1->frame, ¤t_mv.mv[1], x0, y0, nPbW, nPbH, s->sh.luma_weight_l1[current_mv.ref_idx[1]], s->sh.luma_offset_l1[current_mv.ref_idx[1]]); if (s->ps.sps->chroma_format_idc) { - chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1], + chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1], 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]); - chroma_mc_uni(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2], + chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2], 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]); } @@ -1967,15 +1976,15 @@ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; int nPbH_c = nPbH >> s->ps.sps->vshift[1]; - luma_mc_bi(s, dst0, s->frame->linesize[0], ref0->frame, + luma_mc_bi(lc, dst0, s->frame->linesize[0], ref0->frame, ¤t_mv.mv[0], x0, y0, nPbW, nPbH, ref1->frame, ¤t_mv.mv[1], ¤t_mv); if (s->ps.sps->chroma_format_idc) { - chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame, + chroma_mc_bi(lc, dst1, s->frame->linesize[1], ref0->frame, ref1->frame, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0); - chroma_mc_bi(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame, + chroma_mc_bi(lc, dst2, s->frame->linesize[2], ref0->frame, ref1->frame, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1); } } @@ -1984,10 +1993,10 @@ /** * 8.4.1 */ -static int luma_intra_pred_mode(HEVCContext *s, int x0, int y0, int pu_size, +static int luma_intra_pred_mode(HEVCLocalContext *lc, int x0, int y0, int pu_size, int prev_intra_luma_pred_flag) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int x_pu = x0 >> s->ps.sps->log2_min_pu_size; int y_pu = y0 >> s->ps.sps->log2_min_pu_size; int min_pu_width = s->ps.sps->min_pu_width; @@ -2064,7 +2073,7 @@ return intra_pred_mode; } -static av_always_inline void set_ct_depth(HEVCContext *s, int x0, int y0, +static av_always_inline void set_ct_depth(const HEVCContext *s, int x0, int y0, int log2_cb_size, int ct_depth) { int length = (1 << log2_cb_size) >> s->ps.sps->log2_min_cb_size; @@ -2081,10 +2090,10 @@ 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31}; -static void intra_prediction_unit(HEVCContext *s, int x0, int y0, +static void intra_prediction_unit(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; static const uint8_t intra_chroma_table[4] = { 0, 26, 10, 1 }; uint8_t prev_intra_luma_pred_flag[4]; int split = lc->cu.part_mode == PART_NxN; @@ -2095,17 +2104,17 @@ for (i = 0; i < side; i++) for (j = 0; j < side; j++) - prev_intra_luma_pred_flag[2 * i + j] = ff_hevc_prev_intra_luma_pred_flag_decode(s); + prev_intra_luma_pred_flag[2 * i + j] = ff_hevc_prev_intra_luma_pred_flag_decode(lc); for (i = 0; i < side; i++) { for (j = 0; j < side; j++) { if (prev_intra_luma_pred_flag[2 * i + j]) - lc->pu.mpm_idx = ff_hevc_mpm_idx_decode(s); + lc->pu.mpm_idx = ff_hevc_mpm_idx_decode(lc); else - lc->pu.rem_intra_luma_pred_mode = ff_hevc_rem_intra_luma_pred_mode_decode(s); + lc->pu.rem_intra_luma_pred_mode = ff_hevc_rem_intra_luma_pred_mode_decode(lc); lc->pu.intra_pred_mode[2 * i + j] = - luma_intra_pred_mode(s, x0 + pb_size * j, y0 + pb_size * i, pb_size, + luma_intra_pred_mode(lc, x0 + pb_size * j, y0 + pb_size * i, pb_size, prev_intra_luma_pred_flag[2 * i + j]); } } @@ -2113,7 +2122,7 @@ if (s->ps.sps->chroma_format_idc == 3) { for (i = 0; i < side; i++) { for (j = 0; j < side; j++) { - lc->pu.chroma_mode_c[2 * i + j] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s); + lc->pu.chroma_mode_c[2 * i + j] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); if (chroma_mode != 4) { if (lc->pu.intra_pred_mode[2 * i + j] == intra_chroma_table[chroma_mode]) lc->pu.intra_pred_mode_c[2 * i + j] = 34; @@ -2126,7 +2135,7 @@ } } else if (s->ps.sps->chroma_format_idc == 2) { int mode_idx; - lc->pu.chroma_mode_c[0] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s); + lc->pu.chroma_mode_c[0] = chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); if (chroma_mode != 4) { if (lc->pu.intra_pred_mode[0] == intra_chroma_table[chroma_mode]) mode_idx = 34; @@ -2137,7 +2146,7 @@ } lc->pu.intra_pred_mode_c[0] = tab_mode_idx[mode_idx]; } else if (s->ps.sps->chroma_format_idc != 0) { - chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(s); + chroma_mode = ff_hevc_intra_chroma_pred_mode_decode(lc); if (chroma_mode != 4) { if (lc->pu.intra_pred_mode[0] == intra_chroma_table[chroma_mode]) lc->pu.intra_pred_mode_c[0] = 34; @@ -2149,11 +2158,11 @@ } } -static void intra_prediction_unit_default_value(HEVCContext *s, +static void intra_prediction_unit_default_value(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int pb_size = 1 << log2_cb_size; int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size; int min_pu_width = s->ps.sps->min_pu_width; @@ -2172,10 +2181,9 @@ tab_mvf[(y_pu + j) * min_pu_width + x_pu + k].pred_flag = PF_INTRA; } -static int hls_coding_unit(HEVCContext *s, int x0, int y0, int log2_cb_size) +static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, int x0, int y0, int log2_cb_size) { int cb_size = 1 << log2_cb_size; - HEVCLocalContext *lc = s->HEVClc; int log2_min_cb_size = s->ps.sps->log2_min_cb_size; int length = cb_size >> log2_min_cb_size; int min_cb_width = s->ps.sps->min_cb_width; @@ -2195,14 +2203,14 @@ for (x = 0; x < 4; x++) lc->pu.intra_pred_mode[x] = 1; if (s->ps.pps->transquant_bypass_enable_flag) { - lc->cu.cu_transquant_bypass_flag = ff_hevc_cu_transquant_bypass_flag_decode(s); + lc->cu.cu_transquant_bypass_flag = ff_hevc_cu_transquant_bypass_flag_decode(lc); if (lc->cu.cu_transquant_bypass_flag) set_deblocking_bypass(s, x0, y0, log2_cb_size); } else lc->cu.cu_transquant_bypass_flag = 0; if (s->sh.slice_type != HEVC_SLICE_I) { - uint8_t skip_flag = ff_hevc_skip_flag_decode(s, x0, y0, x_cb, y_cb); + uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, x0, y0, x_cb, y_cb); x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { @@ -2219,19 +2227,19 @@ } if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) { - hls_prediction_unit(s, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); - intra_prediction_unit_default_value(s, x0, y0, log2_cb_size); + hls_prediction_unit(lc, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); + intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); } else { int pcm_flag = 0; if (s->sh.slice_type != HEVC_SLICE_I) - lc->cu.pred_mode = ff_hevc_pred_mode_decode(s); + lc->cu.pred_mode = ff_hevc_pred_mode_decode(lc); if (lc->cu.pred_mode != MODE_INTRA || log2_cb_size == s->ps.sps->log2_min_cb_size) { - lc->cu.part_mode = ff_hevc_part_mode_decode(s, log2_cb_size); + lc->cu.part_mode = ff_hevc_part_mode_decode(lc, log2_cb_size); lc->cu.intra_split_flag = lc->cu.part_mode == PART_NxN && lc->cu.pred_mode == MODE_INTRA; } @@ -2240,54 +2248,54 @@ if (lc->cu.part_mode == PART_2Nx2N && s->ps.sps->pcm_enabled_flag && log2_cb_size >= s->ps.sps->pcm.log2_min_pcm_cb_size && log2_cb_size <= s->ps.sps->pcm.log2_max_pcm_cb_size) { - pcm_flag = ff_hevc_pcm_flag_decode(s); + pcm_flag = ff_hevc_pcm_flag_decode(lc); } if (pcm_flag) { - intra_prediction_unit_default_value(s, x0, y0, log2_cb_size); - ret = hls_pcm_sample(s, x0, y0, log2_cb_size); + intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); + ret = hls_pcm_sample(lc, x0, y0, log2_cb_size); if (s->ps.sps->pcm.loop_filter_disable_flag) set_deblocking_bypass(s, x0, y0, log2_cb_size); if (ret < 0) return ret; } else { - intra_prediction_unit(s, x0, y0, log2_cb_size); + intra_prediction_unit(lc, x0, y0, log2_cb_size); } } else { - intra_prediction_unit_default_value(s, x0, y0, log2_cb_size); + intra_prediction_unit_default_value(lc, x0, y0, log2_cb_size); switch (lc->cu.part_mode) { case PART_2Nx2N: - hls_prediction_unit(s, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); + hls_prediction_unit(lc, x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); break; case PART_2NxN: - hls_prediction_unit(s, x0, y0, cb_size, cb_size / 2, log2_cb_size, 0, idx); - hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1, idx); + hls_prediction_unit(lc, x0, y0, cb_size, cb_size / 2, log2_cb_size, 0, idx); + hls_prediction_unit(lc, x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1, idx); break; case PART_Nx2N: - hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size, log2_cb_size, 0, idx - 1); - hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1, idx - 1); + hls_prediction_unit(lc, x0, y0, cb_size / 2, cb_size, log2_cb_size, 0, idx - 1); + hls_prediction_unit(lc, x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1, idx - 1); break; case PART_2NxnU: - hls_prediction_unit(s, x0, y0, cb_size, cb_size / 4, log2_cb_size, 0, idx); - hls_prediction_unit(s, x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1, idx); + hls_prediction_unit(lc, x0, y0, cb_size, cb_size / 4, log2_cb_size, 0, idx); + hls_prediction_unit(lc, x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1, idx); break; case PART_2NxnD: - hls_prediction_unit(s, x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0, idx); - hls_prediction_unit(s, x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1, idx); + hls_prediction_unit(lc, x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0, idx); + hls_prediction_unit(lc, x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1, idx); break; case PART_nLx2N: - hls_prediction_unit(s, x0, y0, cb_size / 4, cb_size, log2_cb_size, 0, idx - 2); - hls_prediction_unit(s, x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1, idx - 2); + hls_prediction_unit(lc, x0, y0, cb_size / 4, cb_size, log2_cb_size, 0, idx - 2); + hls_prediction_unit(lc, x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1, idx - 2); break; case PART_nRx2N: - hls_prediction_unit(s, x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0, idx - 2); - hls_prediction_unit(s, x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1, idx - 2); + hls_prediction_unit(lc, x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0, idx - 2); + hls_prediction_unit(lc, x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1, idx - 2); break; case PART_NxN: - hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0, idx - 1); - hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1, idx - 1); - hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2, idx - 1); - hls_prediction_unit(s, x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3, idx - 1); + hls_prediction_unit(lc, x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0, idx - 1); + hls_prediction_unit(lc, x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1, idx - 1); + hls_prediction_unit(lc, x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2, idx - 1); + hls_prediction_unit(lc, x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3, idx - 1); break; } } @@ -2297,27 +2305,27 @@ if (lc->cu.pred_mode != MODE_INTRA && !(lc->cu.part_mode == PART_2Nx2N && lc->pu.merge_flag)) { - rqt_root_cbf = ff_hevc_no_residual_syntax_flag_decode(s); + rqt_root_cbf = ff_hevc_no_residual_syntax_flag_decode(lc); } if (rqt_root_cbf) { const static int cbf[2] = { 0 }; lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ? s->ps.sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag : s->ps.sps->max_transform_hierarchy_depth_inter; - ret = hls_transform_tree(s, x0, y0, x0, y0, x0, y0, + ret = hls_transform_tree(lc, x0, y0, x0, y0, x0, y0, log2_cb_size, log2_cb_size, 0, 0, cbf, cbf); if (ret < 0) return ret; } else { if (!s->sh.disable_deblocking_filter_flag) - ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size); + ff_hevc_deblocking_boundary_strengths(lc, x0, y0, log2_cb_size); } } } if (s->ps.pps->cu_qp_delta_enabled_flag && lc->tu.is_cu_qp_delta_coded == 0) - ff_hevc_set_qPy(s, x0, y0, log2_cb_size); + ff_hevc_set_qPy(lc, x0, y0, log2_cb_size); x = y_cb * min_cb_width + x_cb; for (y = 0; y < length; y++) { @@ -2335,10 +2343,10 @@ return 0; } -static int hls_coding_quadtree(HEVCContext *s, int x0, int y0, +static int hls_coding_quadtree(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size, int cb_depth) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; const int cb_size = 1 << log2_cb_size; int ret; int split_cu; @@ -2347,7 +2355,7 @@ if (x0 + cb_size <= s->ps.sps->width && y0 + cb_size <= s->ps.sps->height && log2_cb_size > s->ps.sps->log2_min_cb_size) { - split_cu = ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0); + split_cu = ff_hevc_split_coding_unit_flag_decode(lc, cb_depth, x0, y0); } else { split_cu = (log2_cb_size > s->ps.sps->log2_min_cb_size); } @@ -2370,23 +2378,23 @@ int more_data = 0; - more_data = hls_coding_quadtree(s, x0, y0, log2_cb_size - 1, cb_depth + 1); + more_data = hls_coding_quadtree(lc, x0, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; if (more_data && x1 < s->ps.sps->width) { - more_data = hls_coding_quadtree(s, x1, y0, log2_cb_size - 1, cb_depth + 1); + more_data = hls_coding_quadtree(lc, x1, y0, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && y1 < s->ps.sps->height) { - more_data = hls_coding_quadtree(s, x0, y1, log2_cb_size - 1, cb_depth + 1); + more_data = hls_coding_quadtree(lc, x0, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } if (more_data && x1 < s->ps.sps->width && y1 < s->ps.sps->height) { - more_data = hls_coding_quadtree(s, x1, y1, log2_cb_size - 1, cb_depth + 1); + more_data = hls_coding_quadtree(lc, x1, y1, log2_cb_size - 1, cb_depth + 1); if (more_data < 0) return more_data; } @@ -2401,7 +2409,7 @@ else return 0; } else { - ret = hls_coding_unit(s, x0, y0, log2_cb_size); + ret = hls_coding_unit(lc, s, x0, y0, log2_cb_size); if (ret < 0) return ret; if ((!((x0 + cb_size) % @@ -2410,7 +2418,7 @@ (!((y0 + cb_size) % (1 << (s->ps.sps->log2_ctb_size))) || (y0 + cb_size >= s->ps.sps->height))) { - int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(s); + int end_of_slice_flag = ff_hevc_end_of_slice_flag_decode(lc); return !end_of_slice_flag; } else { return 1; @@ -2420,10 +2428,10 @@ return 0; } -static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, +static void hls_decode_neighbour(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_addr_ts) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int ctb_size = 1 << s->ps.sps->log2_ctb_size; int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; int ctb_addr_in_slice = ctb_addr_rs - s->sh.slice_addr; @@ -2472,6 +2480,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) { HEVCContext *s = avctxt->priv_data; + HEVCLocalContext *const lc = s->HEVClc; int ctb_size = 1 << s->ps.sps->log2_ctb_size; int more_data = 1; int x_ctb = 0; @@ -2497,21 +2506,21 @@ x_ctb = (ctb_addr_rs % ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; y_ctb = (ctb_addr_rs / ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; - hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts); + hls_decode_neighbour(lc, x_ctb, y_ctb, ctb_addr_ts); - ret = ff_hevc_cabac_init(s, ctb_addr_ts, 0); + ret = ff_hevc_cabac_init(lc, ctb_addr_ts); if (ret < 0) { s->tab_slice_address[ctb_addr_rs] = -1; return ret; } - hls_sao_param(s, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); + hls_sao_param(lc, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); s->deblock[ctb_addr_rs].beta_offset = s->sh.beta_offset; s->deblock[ctb_addr_rs].tc_offset = s->sh.tc_offset; s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; - more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); + more_data = hls_coding_quadtree(lc, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); if (more_data < 0) { s->tab_slice_address[ctb_addr_rs] = -1; return more_data; @@ -2519,13 +2528,13 @@ ctb_addr_ts++; - ff_hevc_save_states(s, ctb_addr_ts); - ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size); + ff_hevc_save_states(lc, ctb_addr_ts); + ff_hevc_hls_filters(lc, x_ctb, y_ctb, ctb_size); } if (x_ctb + ctb_size >= s->ps.sps->width && y_ctb + ctb_size >= s->ps.sps->height) - ff_hevc_hls_filter(s, x_ctb, y_ctb, ctb_size); + ff_hevc_hls_filter(lc, x_ctb, y_ctb, ctb_size); return ctb_addr_ts; } @@ -2541,22 +2550,19 @@ s->avctx->execute(s->avctx, hls_decode_entry, arg, ret , 1, sizeof(int)); return ret[0]; } -static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int job, int self_id) +static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *hevc_lclist, + int job, int self_id) { - HEVCContext *s1 = avctxt->priv_data, *s; - HEVCLocalContext *lc; - int ctb_size = 1<< s1->ps.sps->log2_ctb_size; + HEVCLocalContext *lc = ((HEVCLocalContext**)hevc_lclist)[self_id]; + const HEVCContext *const s = lc->parent; + int ctb_size = 1 << s->ps.sps->log2_ctb_size; int more_data = 1; - int *ctb_row_p = input_ctb_row; - int ctb_row = ctb_row_p[job]; - int ctb_addr_rs = s1->sh.slice_ctb_addr_rs + ctb_row * ((s1->ps.sps->width + ctb_size - 1) >> s1->ps.sps->log2_ctb_size); - int ctb_addr_ts = s1->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs]; - int thread = ctb_row % s1->threads_number; + int ctb_row = job; + int ctb_addr_rs = s->sh.slice_ctb_addr_rs + ctb_row * ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size); + int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs]; + int thread = ctb_row % s->threads_number; int ret; - s = s1->sList[self_id]; - lc = s->HEVClc; - if(ctb_row) { ret = init_get_bits8(&lc->gb, s->data + s->sh.offset[ctb_row - 1], s->sh.size[ctb_row - 1]); if (ret < 0) @@ -2568,20 +2574,23 @@ int x_ctb = (ctb_addr_rs % s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size; int y_ctb = (ctb_addr_rs / s->ps.sps->ctb_width) << s->ps.sps->log2_ctb_size; - hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts); + hls_decode_neighbour(lc, x_ctb, y_ctb, ctb_addr_ts); ff_thread_await_progress2(s->avctx, ctb_row, thread, SHIFT_CTB_WPP); - if (atomic_load(&s1->wpp_err)) { + /* atomic_load's prototype requires a pointer to non-const atomic variable + * (due to implementations via mutexes, where reads involve writes). + * Of course, casting const away here is nevertheless safe. */ + if (atomic_load((atomic_int*)&s->wpp_err)) { ff_thread_report_progress2(s->avctx, ctb_row , thread, SHIFT_CTB_WPP); return 0; } - ret = ff_hevc_cabac_init(s, ctb_addr_ts, thread); + ret = ff_hevc_cabac_init(lc, ctb_addr_ts); if (ret < 0) goto error; - hls_sao_param(s, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); - more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); + hls_sao_param(lc, x_ctb >> s->ps.sps->log2_ctb_size, y_ctb >> s->ps.sps->log2_ctb_size); + more_data = hls_coding_quadtree(lc, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); if (more_data < 0) { ret = more_data; @@ -2590,18 +2599,19 @@ ctb_addr_ts++; - ff_hevc_save_states(s, ctb_addr_ts); + ff_hevc_save_states(lc, ctb_addr_ts); ff_thread_report_progress2(s->avctx, ctb_row, thread, 1); - ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size); + ff_hevc_hls_filters(lc, x_ctb, y_ctb, ctb_size); if (!more_data && (x_ctb+ctb_size) < s->ps.sps->width && ctb_row != s->sh.num_entry_point_offsets) { - atomic_store(&s1->wpp_err, 1); + /* Casting const away here is safe, because it is an atomic operation. */ + atomic_store((atomic_int*)&s->wpp_err, 1); ff_thread_report_progress2(s->avctx, ctb_row ,thread, SHIFT_CTB_WPP); return 0; } if ((x_ctb+ctb_size) >= s->ps.sps->width && (y_ctb+ctb_size) >= s->ps.sps->height ) { - ff_hevc_hls_filter(s, x_ctb, y_ctb, ctb_size); + ff_hevc_hls_filter(lc, x_ctb, y_ctb, ctb_size); ff_thread_report_progress2(s->avctx, ctb_row , thread, SHIFT_CTB_WPP); return ctb_addr_ts; } @@ -2617,7 +2627,8 @@ return 0; error: s->tab_slice_address[ctb_addr_rs] = -1; - atomic_store(&s1->wpp_err, 1); + /* Casting const away here is safe, because it is an atomic operation. */ + atomic_store((atomic_int*)&s->wpp_err, 1); ff_thread_report_progress2(s->avctx, ctb_row ,thread, SHIFT_CTB_WPP); return ret; } @@ -2627,42 +2638,28 @@ const uint8_t *data = nal->data; int length = nal->size; HEVCLocalContext *lc = s->HEVClc; - int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int)); - int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int)); + int *ret; int64_t offset; int64_t startheader, cmpt = 0; int i, j, res = 0; - if (!ret || !arg) { - av_free(ret); - av_free(arg); - return AVERROR(ENOMEM); - } - if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * s->ps.sps->ctb_width >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) { av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n", s->sh.slice_ctb_addr_rs, s->sh.num_entry_point_offsets, s->ps.sps->ctb_width, s->ps.sps->ctb_height ); - res = AVERROR_INVALIDDATA; - goto error; + return AVERROR_INVALIDDATA; } - ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1); - for (i = 1; i < s->threads_number; i++) { - if (s->sList[i] && s->HEVClcList[i]) + if (s->HEVClcList[i]) continue; - av_freep(&s->sList[i]); - av_freep(&s->HEVClcList[i]); - s->sList[i] = av_malloc(sizeof(HEVCContext)); s->HEVClcList[i] = av_mallocz(sizeof(HEVCLocalContext)); - if (!s->sList[i] || !s->HEVClcList[i]) { - res = AVERROR(ENOMEM); - goto error; - } - memcpy(s->sList[i], s, sizeof(HEVCContext)); - s->sList[i]->HEVClc = s->HEVClcList[i]; + if (!s->HEVClcList[i]) + return AVERROR(ENOMEM); + s->HEVClcList[i]->logctx = s->avctx; + s->HEVClcList[i]->parent = s; + s->HEVClcList[i]->common_cabac_state = &s->cabac; } offset = (lc->gb.index >> 3); @@ -2691,8 +2688,7 @@ offset += s->sh.entry_point_offset[s->sh.num_entry_point_offsets - 1] - cmpt; if (length < offset) { av_log(s->avctx, AV_LOG_ERROR, "entry_point_offset table is corrupted\n"); - res = AVERROR_INVALIDDATA; - goto error; + return AVERROR_INVALIDDATA; } s->sh.size[s->sh.num_entry_point_offsets - 1] = length - offset; s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset; @@ -2701,28 +2697,26 @@ s->data = data; for (i = 1; i < s->threads_number; i++) { - s->sList[i]->HEVClc->first_qp_group = 1; - s->sList[i]->HEVClc->qp_y = s->sList[0]->HEVClc->qp_y; - memcpy(s->sList[i], s, sizeof(HEVCContext)); - s->sList[i]->HEVClc = s->HEVClcList[i]; + s->HEVClcList[i]->first_qp_group = 1; + s->HEVClcList[i]->qp_y = s->HEVClc->qp_y; } atomic_store(&s->wpp_err, 0); - ff_reset_entries(s->avctx); + res = ff_slice_thread_allocz_entries(s->avctx, s->sh.num_entry_point_offsets + 1); + if (res < 0) + return res; - for (i = 0; i <= s->sh.num_entry_point_offsets; i++) { - arg[i] = i; - ret[i] = 0; - } + ret = av_calloc(s->sh.num_entry_point_offsets + 1, sizeof(*ret)); + if (!ret) + return AVERROR(ENOMEM); if (s->ps.pps->entropy_coding_sync_enabled_flag) - s->avctx->execute2(s->avctx, hls_decode_entry_wpp, arg, ret, s->sh.num_entry_point_offsets + 1); + s->avctx->execute2(s->avctx, hls_decode_entry_wpp, s->HEVClcList, ret, s->sh.num_entry_point_offsets + 1); for (i = 0; i <= s->sh.num_entry_point_offsets; i++) res += ret[i]; -error: + av_free(ret); - av_free(arg); return res; } @@ -2731,67 +2725,6 @@ AVFrame *out = s->ref->frame; int ret; - if (s->sei.frame_packing.present && - s->sei.frame_packing.arrangement_type >= 3 && - s->sei.frame_packing.arrangement_type <= 5 && - s->sei.frame_packing.content_interpretation_type > 0 && - s->sei.frame_packing.content_interpretation_type < 3) { - AVStereo3D *stereo = av_stereo3d_create_side_data(out); - if (!stereo) - return AVERROR(ENOMEM); - - switch (s->sei.frame_packing.arrangement_type) { - case 3: - if (s->sei.frame_packing.quincunx_subsampling) - stereo->type = AV_STEREO3D_SIDEBYSIDE_QUINCUNX; - else - stereo->type = AV_STEREO3D_SIDEBYSIDE; - break; - case 4: - stereo->type = AV_STEREO3D_TOPBOTTOM; - break; - case 5: - stereo->type = AV_STEREO3D_FRAMESEQUENCE; - break; - } - - if (s->sei.frame_packing.content_interpretation_type == 2) - stereo->flags = AV_STEREO3D_FLAG_INVERT; - - if (s->sei.frame_packing.arrangement_type == 5) { - if (s->sei.frame_packing.current_frame_is_frame0_flag) - stereo->view = AV_STEREO3D_VIEW_LEFT; - else - stereo->view = AV_STEREO3D_VIEW_RIGHT; - } - } - - if (s->sei.display_orientation.present && - (s->sei.display_orientation.anticlockwise_rotation || - s->sei.display_orientation.hflip || s->sei.display_orientation.vflip)) { - double angle = s->sei.display_orientation.anticlockwise_rotation * 360 / (double) (1 << 16); - AVFrameSideData *rotation = av_frame_new_side_data(out, - AV_FRAME_DATA_DISPLAYMATRIX, - sizeof(int32_t) * 9); - if (!rotation) - return AVERROR(ENOMEM); - - /* av_display_rotation_set() expects the angle in the clockwise - * direction, hence the first minus. - * The below code applies the flips after the rotation, yet - * the H.2645 specs require flipping to be applied first. - * Because of R O(phi) = O(-phi) R (where R is flipping around - * an arbitatry axis and O(phi) is the proper rotation by phi) - * we can create display matrices as desired by negating - * the degree once for every flip applied. */ - angle = -angle * (1 - 2 * !!s->sei.display_orientation.hflip) - * (1 - 2 * !!s->sei.display_orientation.vflip); - av_display_rotation_set((int32_t *)rotation->data, angle); - av_display_matrix_flip((int32_t *)rotation->data, - s->sei.display_orientation.hflip, - s->sei.display_orientation.vflip); - } - // 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 && @@ -2861,28 +2794,12 @@ metadata->MaxCLL, metadata->MaxFALL); } - if (s->sei.a53_caption.buf_ref) { - HEVCSEIA53Caption *a53 = &s->sei.a53_caption; - - AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_A53_CC, a53->buf_ref); - if (!sd) - av_buffer_unref(&a53->buf_ref); - a53->buf_ref = NULL; - } - - for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { - HEVCSEIUnregistered *unreg = &s->sei.unregistered; - - if (unreg->buf_ref[i]) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, - AV_FRAME_DATA_SEI_UNREGISTERED, - unreg->buf_ref[i]); - if (!sd) - av_buffer_unref(&unreg->buf_ref[i]); - unreg->buf_ref[i] = NULL; - } - } - s->sei.unregistered.nb_buf_ref = 0; + ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, NULL, + &s->ps.sps->vui.common, + s->ps.sps->bit_depth, s->ps.sps->bit_depth_chroma, + s->ref->poc /* no poc_offset in HEVC */); + if (ret < 0) + return ret; if (s->sei.timecode.present) { uint32_t *tc_sd; @@ -2910,63 +2827,8 @@ s->sei.timecode.num_clock_ts = 0; } - if (s->sei.film_grain_characteristics.present) { - HEVCSEIFilmGrainCharacteristics *fgc = &s->sei.film_grain_characteristics; - AVFilmGrainParams *fgp = av_film_grain_params_create_side_data(out); - if (!fgp) - return AVERROR(ENOMEM); - - fgp->type = AV_FILM_GRAIN_PARAMS_H274; - fgp->seed = s->ref->poc; /* no poc_offset in HEVC */ - - fgp->codec.h274.model_id = fgc->model_id; - if (fgc->separate_colour_description_present_flag) { - fgp->codec.h274.bit_depth_luma = fgc->bit_depth_luma; - fgp->codec.h274.bit_depth_chroma = fgc->bit_depth_chroma; - fgp->codec.h274.color_range = fgc->full_range + 1; - fgp->codec.h274.color_primaries = fgc->color_primaries; - fgp->codec.h274.color_trc = fgc->transfer_characteristics; - fgp->codec.h274.color_space = fgc->matrix_coeffs; - } else { - const HEVCSPS *sps = s->ps.sps; - const VUI *vui = &sps->vui; - fgp->codec.h274.bit_depth_luma = sps->bit_depth; - fgp->codec.h274.bit_depth_chroma = sps->bit_depth_chroma; - if (vui->video_signal_type_present_flag) - fgp->codec.h274.color_range = vui->video_full_range_flag + 1; - else - fgp->codec.h274.color_range = AVCOL_RANGE_UNSPECIFIED; - if (vui->colour_description_present_flag) { - fgp->codec.h274.color_primaries = vui->colour_primaries; - fgp->codec.h274.color_trc = vui->transfer_characteristic; - fgp->codec.h274.color_space = vui->matrix_coeffs; - } else { - fgp->codec.h274.color_primaries = AVCOL_PRI_UNSPECIFIED; - fgp->codec.h274.color_trc = AVCOL_TRC_UNSPECIFIED; - fgp->codec.h274.color_space = AVCOL_SPC_UNSPECIFIED; - } - } - fgp->codec.h274.blending_mode_id = fgc->blending_mode_id; - fgp->codec.h274.log2_scale_factor = fgc->log2_scale_factor; - - memcpy(&fgp->codec.h274.component_model_present, &fgc->comp_model_present_flag, - sizeof(fgp->codec.h274.component_model_present)); - memcpy(&fgp->codec.h274.num_intensity_intervals, &fgc->num_intensity_intervals, - sizeof(fgp->codec.h274.num_intensity_intervals)); - memcpy(&fgp->codec.h274.num_model_values, &fgc->num_model_values, - sizeof(fgp->codec.h274.num_model_values)); - memcpy(&fgp->codec.h274.intensity_interval_lower_bound, &fgc->intensity_interval_lower_bound, - sizeof(fgp->codec.h274.intensity_interval_lower_bound)); - memcpy(&fgp->codec.h274.intensity_interval_upper_bound, &fgc->intensity_interval_upper_bound, - sizeof(fgp->codec.h274.intensity_interval_upper_bound)); - memcpy(&fgp->codec.h274.comp_model_value, &fgc->comp_model_value, - sizeof(fgp->codec.h274.comp_model_value)); - - fgc->present = fgc->persistence_flag; - } - - if (s->sei.dynamic_hdr_plus.info) { - AVBufferRef *info_ref = av_buffer_ref(s->sei.dynamic_hdr_plus.info); + if (s->sei.common.dynamic_hdr_plus.info) { + AVBufferRef *info_ref = av_buffer_ref(s->sei.common.dynamic_hdr_plus.info); if (!info_ref) return AVERROR(ENOMEM); @@ -2987,8 +2849,8 @@ if ((ret = ff_dovi_attach_side_data(&s->dovi_ctx, out)) < 0) return ret; - if (s->sei.dynamic_hdr_vivid.info) { - AVBufferRef *info_ref = av_buffer_ref(s->sei.dynamic_hdr_vivid.info); + if (s->sei.common.dynamic_hdr_vivid.info) { + AVBufferRef *info_ref = av_buffer_ref(s->sei.common.dynamic_hdr_vivid.info); if (!info_ref) return AVERROR(ENOMEM); @@ -3034,7 +2896,7 @@ s->ref->frame->key_frame = IS_IRAP(s); - s->ref->needs_fg = s->sei.film_grain_characteristics.present && + s->ref->needs_fg = s->sei.common.film_grain_characteristics.present && !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; @@ -3266,7 +3128,7 @@ break; case HEVC_NAL_EOS_NUT: case HEVC_NAL_EOB_NUT: - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; break; case HEVC_NAL_AUD: @@ -3374,17 +3236,12 @@ return ret; } -static void print_md5(void *log_ctx, int level, uint8_t md5[16]) -{ - int i; - for (i = 0; i < 16; i++) - av_log(log_ctx, level, "%02"PRIx8, md5[i]); -} - static int verify_md5(HEVCContext *s, AVFrame *frame) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); + char msg_buf[4 * (50 + 2 * 2 * 16 /* MD5-size */)]; int pixel_shift; + int err = 0; int i, j; if (!desc) @@ -3392,9 +3249,6 @@ pixel_shift = desc->comp[0].depth > 8; - av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ", - s->poc); - /* the checksums are LE, so we have to byteswap for >8bpp formats * on BE arches */ #if HAVE_BIGENDIAN @@ -3407,6 +3261,7 @@ } #endif + msg_buf[0] = '\0'; for (i = 0; frame->data[i]; i++) { int width = s->avctx->coded_width; int height = s->avctx->coded_height; @@ -3428,23 +3283,26 @@ } av_md5_final(s->md5_ctx, md5); +#define MD5_PRI "%016" PRIx64 "%016" PRIx64 +#define MD5_PRI_ARG(buf) AV_RB64(buf), AV_RB64((const uint8_t*)(buf) + 8) + if (!memcmp(md5, s->sei.picture_hash.md5[i], 16)) { - av_log (s->avctx, AV_LOG_DEBUG, "plane %d - correct ", i); - print_md5(s->avctx, AV_LOG_DEBUG, md5); - av_log (s->avctx, AV_LOG_DEBUG, "; "); + av_strlcatf(msg_buf, sizeof(msg_buf), + "plane %d - correct " MD5_PRI "; ", + i, MD5_PRI_ARG(md5)); } else { - av_log (s->avctx, AV_LOG_ERROR, "mismatching checksum of plane %d - ", i); - print_md5(s->avctx, AV_LOG_ERROR, md5); - av_log (s->avctx, AV_LOG_ERROR, " != "); - print_md5(s->avctx, AV_LOG_ERROR, s->sei.picture_hash.md5[i]); - av_log (s->avctx, AV_LOG_ERROR, "\n"); - return AVERROR_INVALIDDATA; + av_strlcatf(msg_buf, sizeof(msg_buf), + "mismatching checksum of plane %d - " MD5_PRI " != " MD5_PRI "; ", + i, MD5_PRI_ARG(md5), MD5_PRI_ARG(s->sei.picture_hash.md5[i])); + err = AVERROR_INVALIDDATA; } } - av_log(s->avctx, AV_LOG_DEBUG, "\n"); + av_log(s->avctx, err < 0 ? AV_LOG_ERROR : AV_LOG_DEBUG, + "Verifying checksum for frame with POC %d: %s\n", + s->poc, msg_buf); - return 0; + return err; } static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length, int first) @@ -3599,8 +3457,6 @@ av_freep(&s->md5_ctx); - av_freep(&s->cabac_state); - for (i = 0; i < 3; i++) { av_freep(&s->sao_pixel_buffer_h[i]); av_freep(&s->sao_pixel_buffer_v[i]); @@ -3619,15 +3475,13 @@ av_freep(&s->sh.offset); av_freep(&s->sh.size); - if (s->HEVClcList && s->sList) { + if (s->HEVClcList) { for (i = 1; i < s->threads_number; i++) { av_freep(&s->HEVClcList[i]); - av_freep(&s->sList[i]); } } av_freep(&s->HEVClc); av_freep(&s->HEVClcList); - av_freep(&s->sList); ff_h2645_packet_uninit(&s->pkt); @@ -3645,15 +3499,12 @@ s->HEVClc = av_mallocz(sizeof(HEVCLocalContext)); s->HEVClcList = av_mallocz(sizeof(HEVCLocalContext*) * s->threads_number); - s->sList = av_mallocz(sizeof(HEVCContext*) * s->threads_number); - if (!s->HEVClc || !s->HEVClcList || !s->sList) + if (!s->HEVClc || !s->HEVClcList) return AVERROR(ENOMEM); + s->HEVClc->parent = s; + s->HEVClc->logctx = avctx; + s->HEVClc->common_cabac_state = &s->cabac; s->HEVClcList[0] = s->HEVClc; - s->sList[0] = s; - - s->cabac_state = av_malloc(HEVC_CONTEXTS); - if (!s->cabac_state) - return AVERROR(ENOMEM); s->output_frame = av_frame_alloc(); if (!s->output_frame) @@ -3741,34 +3592,16 @@ s->threads_type = s0->threads_type; if (s0->eos) { - s->seq_decode = (s->seq_decode + 1) & 0xff; + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; } - ret = av_buffer_replace(&s->sei.a53_caption.buf_ref, s0->sei.a53_caption.buf_ref); + ret = ff_h2645_sei_ctx_replace(&s->sei.common, &s0->sei.common); if (ret < 0) return ret; - for (i = 0; i < s->sei.unregistered.nb_buf_ref; i++) - av_buffer_unref(&s->sei.unregistered.buf_ref[i]); - s->sei.unregistered.nb_buf_ref = 0; - - if (s0->sei.unregistered.nb_buf_ref) { - ret = av_reallocp_array(&s->sei.unregistered.buf_ref, - s0->sei.unregistered.nb_buf_ref, - sizeof(*s->sei.unregistered.buf_ref)); - if (ret < 0) - return ret; - - for (i = 0; i < s0->sei.unregistered.nb_buf_ref; i++) { - s->sei.unregistered.buf_ref[i] = av_buffer_ref(s0->sei.unregistered.buf_ref[i]); - if (!s->sei.unregistered.buf_ref[i]) - return AVERROR(ENOMEM); - s->sei.unregistered.nb_buf_ref++; - } - } - - ret = av_buffer_replace(&s->sei.dynamic_hdr_plus.info, s0->sei.dynamic_hdr_plus.info); + ret = av_buffer_replace(&s->sei.common.dynamic_hdr_plus.info, + s0->sei.common.dynamic_hdr_plus.info); if (ret < 0) return ret; @@ -3780,15 +3613,16 @@ if (ret < 0) return ret; - ret = av_buffer_replace(&s->sei.dynamic_hdr_vivid.info, s0->sei.dynamic_hdr_vivid.info); + ret = av_buffer_replace(&s->sei.common.dynamic_hdr_vivid.info, + s0->sei.common.dynamic_hdr_vivid.info); if (ret < 0) return ret; - s->sei.frame_packing = s0->sei.frame_packing; - s->sei.display_orientation = s0->sei.display_orientation; + 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.alternative_transfer = s0->sei.alternative_transfer; ret = export_stream_params_from_sei(s); if (ret < 0) @@ -3869,7 +3703,7 @@ const FFCodec ff_hevc_decoder = { .p.name = "hevc", - .p.long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"), + CODEC_LONG_NAME("HEVC (High Efficiency Video Coding)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .priv_data_size = sizeof(HEVCContext), @@ -3878,10 +3712,10 @@ .close = hevc_decode_free, FF_CODEC_DECODE_CB(hevc_decode_frame), .flush = hevc_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context), + UPDATE_THREAD_CONTEXT(hevc_update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | + .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, .p.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), .hw_configs = (const AVCodecHWConfigInternal *const []) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdec.h 2023-03-03 13:29:59.000000000 +0000 @@ -226,6 +226,11 @@ SCAN_VERT, }; +typedef struct HEVCCABACState { + uint8_t state[HEVC_CONTEXTS]; + uint8_t stat_coeff[HEVC_STAT_COEFFS]; +} HEVCCABACState; + typedef struct LongTermRPS { int poc[32]; uint8_t poc_msb_present[32]; @@ -390,6 +395,9 @@ #define HEVC_FRAME_FLAG_LONG_REF (1 << 2) #define HEVC_FRAME_FLAG_BUMPING (1 << 3) +#define HEVC_SEQUENCE_COUNTER_MASK 0xff +#define HEVC_SEQUENCE_COUNTER_INVALID (HEVC_SEQUENCE_COUNTER_MASK + 1) + typedef struct HEVCFrame { AVFrame *frame; AVFrame *frame_grain; @@ -428,9 +436,24 @@ uint8_t first_qp_group; + void *logctx; + const struct HEVCContext *parent; + GetBitContext gb; CABACContext cc; + /** + * This is a pointer to the common CABAC state. + * In case entropy_coding_sync_enabled_flag is set, + * the CABAC state after decoding the second CTU in a row is + * stored here and used to initialize the CABAC state before + * decoding the first CTU in the next row. + * This is the basis for WPP and in case slice-threading is used, + * the next row is decoded by another thread making this state + * shared between threads. + */ + HEVCCABACState *common_cabac_state; + int8_t qp_y; int8_t curr_qp_y; @@ -468,8 +491,6 @@ const AVClass *c; // needed by private avoptions AVCodecContext *avctx; - struct HEVCContext **sList; - HEVCLocalContext **HEVClcList; HEVCLocalContext *HEVClc; @@ -479,9 +500,6 @@ int width; int height; - uint8_t *cabac_state; - uint8_t stat_coeff[HEVC_STAT_COEFFS]; - /** 1 if the independent slice segment header was successfully parsed */ uint8_t slice_initialized; @@ -554,6 +572,9 @@ uint16_t seq_decode; uint16_t seq_output; + /** The target for the common_cabac_state of the local contexts. */ + HEVCCABACState cabac; + int enable_parallel_tiles; atomic_int wpp_err; @@ -597,38 +618,38 @@ */ int ff_hevc_slice_rpl(HEVCContext *s); -void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts); -int ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts, int thread); -int ff_hevc_sao_merge_flag_decode(HEVCContext *s); -int ff_hevc_sao_type_idx_decode(HEVCContext *s); -int ff_hevc_sao_band_position_decode(HEVCContext *s); -int ff_hevc_sao_offset_abs_decode(HEVCContext *s); -int ff_hevc_sao_offset_sign_decode(HEVCContext *s); -int ff_hevc_sao_eo_class_decode(HEVCContext *s); -int ff_hevc_end_of_slice_flag_decode(HEVCContext *s); -int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s); -int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, +void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts); +int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts); +int ff_hevc_sao_merge_flag_decode(HEVCLocalContext *lc); +int ff_hevc_sao_type_idx_decode(HEVCLocalContext *lc); +int ff_hevc_sao_band_position_decode(HEVCLocalContext *lc); +int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc); +int ff_hevc_sao_offset_sign_decode(HEVCLocalContext *lc); +int ff_hevc_sao_eo_class_decode(HEVCLocalContext *lc); +int ff_hevc_end_of_slice_flag_decode(HEVCLocalContext *lc); +int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc); +int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, int x_cb, int y_cb); -int ff_hevc_pred_mode_decode(HEVCContext *s); -int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, +int ff_hevc_pred_mode_decode(HEVCLocalContext *lc); +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, int x0, int y0); -int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size); -int ff_hevc_pcm_flag_decode(HEVCContext *s); -int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s); -int ff_hevc_mpm_idx_decode(HEVCContext *s); -int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s); -int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s); -int ff_hevc_merge_idx_decode(HEVCContext *s); -int ff_hevc_merge_flag_decode(HEVCContext *s); -int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH); -int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx); -int ff_hevc_mvp_lx_flag_decode(HEVCContext *s); -int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s); -int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size); -int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth); -int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth); -int ff_hevc_log2_res_scale_abs(HEVCContext *s, int idx); -int ff_hevc_res_scale_sign_flag(HEVCContext *s, int idx); +int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size); +int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc); +int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCLocalContext *lc); +int ff_hevc_mpm_idx_decode(HEVCLocalContext *lc); +int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCLocalContext *lc); +int ff_hevc_intra_chroma_pred_mode_decode(HEVCLocalContext *lc); +int ff_hevc_merge_idx_decode(HEVCLocalContext *lc); +int ff_hevc_merge_flag_decode(HEVCLocalContext *lc); +int ff_hevc_inter_pred_idc_decode(HEVCLocalContext *lc, int nPbW, int nPbH); +int ff_hevc_ref_idx_lx_decode(HEVCLocalContext *lc, int num_ref_idx_lx); +int ff_hevc_mvp_lx_flag_decode(HEVCLocalContext *lc); +int ff_hevc_no_residual_syntax_flag_decode(HEVCLocalContext *lc); +int ff_hevc_split_transform_flag_decode(HEVCLocalContext *lc, int log2_trafo_size); +int ff_hevc_cbf_cb_cr_decode(HEVCLocalContext *lc, int trafo_depth); +int ff_hevc_cbf_luma_decode(HEVCLocalContext *lc, int trafo_depth); +int ff_hevc_log2_res_scale_abs(HEVCLocalContext *lc, int idx); +int ff_hevc_res_scale_sign_flag(HEVCLocalContext *lc, int idx); /** * Get the number of candidate references for the current frame. @@ -664,30 +685,30 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags); -void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, +void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH); -void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, +void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv); -void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, +void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX); -void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, +void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size); +void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size); +void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, int log2_cb_size); -void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, +void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size); -int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s); -int ff_hevc_cu_qp_delta_abs(HEVCContext *s); -int ff_hevc_cu_chroma_qp_offset_flag(HEVCContext *s); -int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s); -void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size); -void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size); -void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, +int ff_hevc_cu_qp_delta_sign_flag(HEVCLocalContext *lc); +int ff_hevc_cu_qp_delta_abs(HEVCLocalContext *lc); +int ff_hevc_cu_chroma_qp_offset_flag(HEVCLocalContext *lc); +int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc); +void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx); -void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size); +void ff_hevc_hls_mvd_coding(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size); extern const uint8_t ff_hevc_qpel_extra_before[4]; extern const uint8_t ff_hevc_qpel_extra_after[4]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -48,7 +48,7 @@ void (*put_pcm)(uint8_t *_dst, ptrdiff_t _stride, int width, int height, struct GetBitContext *gb, int pcm_bit_depth); - void (*add_residual[4])(uint8_t *dst, int16_t *res, ptrdiff_t stride); + void (*add_residual[4])(uint8_t *dst, const int16_t *res, ptrdiff_t stride); void (*dequant)(int16_t *coeffs, int16_t log2_size); @@ -60,68 +60,68 @@ void (*idct_dc[4])(int16_t *coeffs); - void (*sao_band_filter[5])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, - int16_t *sao_offset_val, int sao_left_class, int width, int height); + void (*sao_band_filter[5])(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, + const int16_t *sao_offset_val, int sao_left_class, int width, int height); /* implicit stride_src parameter has value of 2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE */ - void (*sao_edge_filter[5])(uint8_t *_dst /* align 16 */, uint8_t *_src /* align 32 */, ptrdiff_t stride_dst, - int16_t *sao_offset_val, int sao_eo_class, int width, int height); + void (*sao_edge_filter[5])(uint8_t *_dst /* align 16 */, const uint8_t *_src /* align 32 */, ptrdiff_t stride_dst, + const int16_t *sao_offset_val, int sao_eo_class, int width, int height); - void (*sao_edge_restore[2])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, - struct SAOParams *sao, int *borders, int _width, int _height, int c_idx, - uint8_t *vert_edge, uint8_t *horiz_edge, uint8_t *diag_edge); + void (*sao_edge_restore[2])(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, + const struct SAOParams *sao, const int *borders, int _width, int _height, int c_idx, + const uint8_t *vert_edge, const uint8_t *horiz_edge, const uint8_t *diag_edge); - void (*put_hevc_qpel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, + void (*put_hevc_qpel[10][2][2])(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, + void (*put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_qpel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, + void (*put_hevc_qpel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); - void (*put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, + void (*put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_qpel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, + void (*put_hevc_qpel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width); - void (*put_hevc_epel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, + void (*put_hevc_epel[10][2][2])(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, + void (*put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_epel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, + void (*put_hevc_epel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); - void (*put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, + void (*put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, + const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); - void (*put_hevc_epel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, + void (*put_hevc_epel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int ox0, int wx1, int ox1, intptr_t mx, intptr_t my, int width); void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void (*hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void (*hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q); void (*hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, const uint8_t *no_q); void (*hevc_h_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void (*hevc_v_loop_filter_luma_c)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void (*hevc_h_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q); void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q); } HEVCDSPContext; void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcdsp_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -41,7 +41,7 @@ } } -static av_always_inline void FUNC(add_residual)(uint8_t *_dst, int16_t *res, +static av_always_inline void FUNC(add_residual)(uint8_t *_dst, const int16_t *res, ptrdiff_t stride, int size) { int x, y; @@ -58,25 +58,25 @@ } } -static void FUNC(add_residual4x4)(uint8_t *_dst, int16_t *res, +static void FUNC(add_residual4x4)(uint8_t *_dst, const int16_t *res, ptrdiff_t stride) { FUNC(add_residual)(_dst, res, stride, 4); } -static void FUNC(add_residual8x8)(uint8_t *_dst, int16_t *res, +static void FUNC(add_residual8x8)(uint8_t *_dst, const int16_t *res, ptrdiff_t stride) { FUNC(add_residual)(_dst, res, stride, 8); } -static void FUNC(add_residual16x16)(uint8_t *_dst, int16_t *res, +static void FUNC(add_residual16x16)(uint8_t *_dst, const int16_t *res, ptrdiff_t stride) { FUNC(add_residual)(_dst, res, stride, 16); } -static void FUNC(add_residual32x32)(uint8_t *_dst, int16_t *res, +static void FUNC(add_residual32x32)(uint8_t *_dst, const int16_t *res, ptrdiff_t stride) { FUNC(add_residual)(_dst, res, stride, 32); @@ -295,13 +295,13 @@ #undef SET #undef SCALE -static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src, +static void FUNC(sao_band_filter)(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height) { pixel *dst = (pixel *)_dst; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; int offset_table[32] = { 0 }; int k, y, x; int shift = BIT_DEPTH - 5; @@ -321,7 +321,7 @@ #define CMP(a, b) (((a) > (b)) - ((a) < (b))) -static void FUNC(sao_edge_filter)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, +static void FUNC(sao_edge_filter)(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height) { static const uint8_t edge_idx[] = { 1, 2, 0, 3, 4 }; @@ -332,7 +332,7 @@ { { 1, -1 }, { -1, 1 } }, // 135 degree }; pixel *dst = (pixel *)_dst; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; int a_stride, b_stride; int x, y; ptrdiff_t stride_src = (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(pixel); @@ -352,16 +352,16 @@ } } -static void FUNC(sao_edge_restore_0)(uint8_t *_dst, uint8_t *_src, - ptrdiff_t stride_dst, ptrdiff_t stride_src, SAOParams *sao, - int *borders, int _width, int _height, - int c_idx, uint8_t *vert_edge, - uint8_t *horiz_edge, uint8_t *diag_edge) +static void FUNC(sao_edge_restore_0)(uint8_t *_dst, const uint8_t *_src, + ptrdiff_t stride_dst, ptrdiff_t stride_src, const SAOParams *sao, + const int *borders, int _width, int _height, + int c_idx, const uint8_t *vert_edge, + const uint8_t *horiz_edge, const uint8_t *diag_edge) { int x, y; pixel *dst = (pixel *)_dst; - pixel *src = (pixel *)_src; - int16_t *sao_offset_val = sao->offset_val[c_idx]; + const pixel *src = (const pixel *)_src; + const int16_t *sao_offset_val = sao->offset_val[c_idx]; int sao_eo_class = sao->eo_class[c_idx]; int init_x = 0, width = _width, height = _height; @@ -402,16 +402,16 @@ } } -static void FUNC(sao_edge_restore_1)(uint8_t *_dst, uint8_t *_src, - ptrdiff_t stride_dst, ptrdiff_t stride_src, SAOParams *sao, - int *borders, int _width, int _height, - int c_idx, uint8_t *vert_edge, - uint8_t *horiz_edge, uint8_t *diag_edge) +static void FUNC(sao_edge_restore_1)(uint8_t *_dst, const uint8_t *_src, + ptrdiff_t stride_dst, ptrdiff_t stride_src, const SAOParams *sao, + const int *borders, int _width, int _height, + int c_idx, const uint8_t *vert_edge, + const uint8_t *horiz_edge, const uint8_t *diag_edge) { int x, y; pixel *dst = (pixel *)_dst; - pixel *src = (pixel *)_src; - int16_t *sao_offset_val = sao->offset_val[c_idx]; + const pixel *src = (const pixel *)_src; + const int16_t *sao_offset_val = sao->offset_val[c_idx]; int sao_eo_class = sao->eo_class[c_idx]; int init_x = 0, init_y = 0, width = _width, height = _height; @@ -494,11 +494,11 @@ // //////////////////////////////////////////////////////////////////////////////// static void FUNC(put_hevc_pel_pixels)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); for (y = 0; y < height; y++) { @@ -509,11 +509,11 @@ } } -static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -525,12 +525,12 @@ } } -static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, + const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -551,11 +551,11 @@ } } -static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -575,13 +575,13 @@ } } -static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, + const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -615,11 +615,11 @@ filter[7] * src[x + 4 * stride]) static void FUNC(put_hevc_qpel_h)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_qpel_filters[mx - 1]; for (y = 0; y < height; y++) { @@ -631,11 +631,11 @@ } static void FUNC(put_hevc_qpel_v)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_qpel_filters[my - 1]; for (y = 0; y < height; y++) { @@ -647,14 +647,14 @@ } static void FUNC(put_hevc_qpel_hv)(int16_t *dst, - uint8_t *_src, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; const int8_t *filter; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; int16_t *tmp = tmp_array; @@ -679,11 +679,11 @@ } static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -704,12 +704,12 @@ } } -static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, + const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -733,11 +733,11 @@ } static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -759,12 +759,12 @@ } -static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -788,12 +788,12 @@ } static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; const int8_t *filter; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -827,13 +827,13 @@ } } -static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; const int8_t *filter; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -868,12 +868,12 @@ } static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -894,13 +894,13 @@ } } -static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -923,12 +923,12 @@ } static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -949,13 +949,13 @@ } } -static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -978,13 +978,13 @@ } static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; const int8_t *filter; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1018,14 +1018,14 @@ } } -static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; const int8_t *filter; - pixel *src = (pixel*)_src; + const pixel *src = (const pixel*)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1068,11 +1068,11 @@ filter[3] * src[x + 2 * stride]) static void FUNC(put_hevc_epel_h)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_epel_filters[mx - 1]; for (y = 0; y < height; y++) { @@ -1084,11 +1084,11 @@ } static void FUNC(put_hevc_epel_v)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_epel_filters[my - 1]; @@ -1101,11 +1101,11 @@ } static void FUNC(put_hevc_epel_hv)(int16_t *dst, - uint8_t *_src, ptrdiff_t _srcstride, + const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_epel_filters[mx - 1]; int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE]; @@ -1131,11 +1131,11 @@ } } -static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1155,12 +1155,12 @@ } } -static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1182,11 +1182,11 @@ } } -static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_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) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1206,12 +1206,12 @@ } } -static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_epel_filters[my - 1]; pixel *dst = (pixel *)_dst; @@ -1232,11 +1232,11 @@ } } -static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_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) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1270,12 +1270,12 @@ } } -static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1310,11 +1310,11 @@ } } -static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1336,13 +1336,13 @@ } } -static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1362,11 +1362,11 @@ } } -static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_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, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1388,13 +1388,13 @@ } } -static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); const int8_t *filter = ff_hevc_epel_filters[my - 1]; pixel *dst = (pixel *)_dst; @@ -1414,11 +1414,11 @@ } } -static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, +static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1453,13 +1453,13 @@ } } -static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, - int16_t *src2, +static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, + const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) { int x, y; - pixel *src = (pixel *)_src; + const pixel *src = (const pixel *)_src; ptrdiff_t srcstride = _srcstride / sizeof(pixel); pixel *dst = (pixel *)_dst; ptrdiff_t dststride = _dststride / sizeof(pixel); @@ -1515,8 +1515,8 @@ static void FUNC(hevc_loop_filter_luma)(uint8_t *_pix, ptrdiff_t _xstride, ptrdiff_t _ystride, - int beta, int *_tc, - uint8_t *_no_p, uint8_t *_no_q) + int beta, const int *_tc, + const uint8_t *_no_p, const uint8_t *_no_q) { int d, j; pixel *pix = (pixel *)_pix; @@ -1610,8 +1610,8 @@ } static void FUNC(hevc_loop_filter_chroma)(uint8_t *_pix, ptrdiff_t _xstride, - ptrdiff_t _ystride, int *_tc, - uint8_t *_no_p, uint8_t *_no_q) + ptrdiff_t _ystride, const int *_tc, + const uint8_t *_no_p, const uint8_t *_no_q) { int d, j, no_p, no_q; pixel *pix = (pixel *)_pix; @@ -1644,30 +1644,30 @@ } static void FUNC(hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { FUNC(hevc_loop_filter_chroma)(pix, stride, sizeof(pixel), tc, no_p, no_q); } static void FUNC(hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { FUNC(hevc_loop_filter_chroma)(pix, sizeof(pixel), stride, tc, no_p, no_q); } static void FUNC(hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + int beta, const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { FUNC(hevc_loop_filter_luma)(pix, stride, sizeof(pixel), beta, tc, no_p, no_q); } static void FUNC(hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, - int beta, int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + int beta, const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { FUNC(hevc_loop_filter_luma)(pix, sizeof(pixel), stride, beta, tc, no_p, no_q); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_filter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_filter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_filter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_filter.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,7 @@ 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64 // QP 38...51 }; -static int chroma_tc(HEVCContext *s, int qp_y, int c_idx, int tc_offset) +static int chroma_tc(const HEVCContext *s, int qp_y, int c_idx, int tc_offset) { static const int qp_c[] = { 29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37 @@ -73,9 +73,9 @@ return tctable[idxt]; } -static int get_qPy_pred(HEVCContext *s, int xBase, int yBase, int log2_cb_size) +static int get_qPy_pred(HEVCLocalContext *lc, const HEVCContext *s, + int xBase, int yBase, int log2_cb_size) { - HEVCLocalContext *lc = s->HEVClc; int ctb_size_mask = (1 << s->ps.sps->log2_ctb_size) - 1; int MinCuQpDeltaSizeMask = (1 << (s->ps.sps->log2_ctb_size - s->ps.pps->diff_cu_qp_delta_depth)) - 1; @@ -116,19 +116,20 @@ return (qPy_a + qPy_b + 1) >> 1; } -void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size) +void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, int log2_cb_size) { - int qp_y = get_qPy_pred(s, xBase, yBase, log2_cb_size); + const HEVCContext *const s = lc->parent; + int qp_y = get_qPy_pred(lc, s, xBase, yBase, log2_cb_size); - if (s->HEVClc->tu.cu_qp_delta != 0) { + if (lc->tu.cu_qp_delta != 0) { int off = s->ps.sps->qp_bd_offset; - s->HEVClc->qp_y = FFUMOD(qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off, + lc->qp_y = FFUMOD(qp_y + lc->tu.cu_qp_delta + 52 + 2 * off, 52 + off) - off; } else - s->HEVClc->qp_y = qp_y; + lc->qp_y = qp_y; } -static int get_qPy(HEVCContext *s, int xC, int yC) +static int get_qPy(const HEVCContext *s, int xC, int yC) { int log2_min_cb_size = s->ps.sps->log2_min_cb_size; int x = xC >> log2_min_cb_size; @@ -197,7 +198,7 @@ } } -static void copy_CTB_to_hv(HEVCContext *s, const uint8_t *src, +static void copy_CTB_to_hv(const HEVCContext *s, const uint8_t *src, ptrdiff_t stride_src, int x, int y, int width, int height, int c_idx, int x_ctb, int y_ctb) { @@ -217,7 +218,7 @@ copy_vert(s->sao_pixel_buffer_v[c_idx] + (((2 * x_ctb + 1) * h + y) << sh), src + ((width - 1) << sh), sh, height, 1 << sh, stride_src); } -static void restore_tqb_pixels(HEVCContext *s, +static void restore_tqb_pixels(const HEVCContext *s, uint8_t *src1, const uint8_t *dst1, ptrdiff_t stride_src, ptrdiff_t stride_dst, int x0, int y0, int width, int height, int c_idx) @@ -252,10 +253,9 @@ #define CTB(tab, x, y) ((tab)[(y) * s->ps.sps->ctb_width + (x)]) -static void sao_filter_CTB(HEVCContext *s, int x, int y) +static void sao_filter_CTB(HEVCLocalContext *lc, const HEVCContext *s, int x, int y) { static const uint8_t sao_tab[8] = { 0, 1, 2, 2, 3, 3, 4, 4 }; - HEVCLocalContext *lc = s->HEVClc; int c_idx; int edges[4]; // 0 left 1 top 2 right 3 bottom int x_ctb = x >> s->ps.sps->log2_ctb_size; @@ -461,7 +461,7 @@ } } -static int get_pcm(HEVCContext *s, int x, int y) +static int get_pcm(const HEVCContext *s, int x, int y) { int log2_min_pu_size = s->ps.sps->log2_min_pu_size; int x_pu, y_pu; @@ -482,7 +482,7 @@ (tc_offset & -2), \ 0, MAX_QP + DEFAULT_INTRA_TC_OFFSET)] -static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) +static void deblocking_filter_CTB(const HEVCContext *s, int x0, int y0) { uint8_t *src; int x, y; @@ -720,11 +720,11 @@ return 1; } -void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, +void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size) { - HEVCLocalContext *lc = s->HEVClc; - MvField *tab_mvf = s->ref->tab_mvf; + const HEVCContext *s = lc->parent; + const MvField *tab_mvf = s->ref->tab_mvf; int log2_min_pu_size = s->ps.sps->log2_min_pu_size; int log2_min_tu_size = s->ps.sps->log2_min_tb_size; int min_pu_width = s->ps.sps->min_pu_width; @@ -756,8 +756,8 @@ for (i = 0; i < (1 << log2_trafo_size); i += 4) { int x_pu = (x0 + i) >> log2_min_pu_size; int x_tu = (x0 + i) >> log2_min_tu_size; - MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; - MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; + const MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; + const MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; uint8_t top_cbf_luma = s->cbf_luma[yp_tu * min_tu_width + x_tu]; uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu]; @@ -794,8 +794,8 @@ for (i = 0; i < (1 << log2_trafo_size); i += 4) { int y_pu = (y0 + i) >> log2_min_pu_size; int y_tu = (y0 + i) >> log2_min_tu_size; - MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; - MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; + const MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; + const MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu]; uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu]; @@ -810,7 +810,7 @@ } if (log2_trafo_size > log2_min_pu_size && !is_intra) { - RefPicList *rpl = s->ref->refPicList; + const RefPicList *rpl = s->ref->refPicList; // bs for TU internal horizontal PU boundaries for (j = 8; j < (1 << log2_trafo_size); j += 8) { @@ -819,8 +819,8 @@ for (i = 0; i < (1 << log2_trafo_size); i += 4) { int x_pu = (x0 + i) >> log2_min_pu_size; - MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; - MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; + const MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; + const MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; bs = boundary_strength(s, curr, top, rpl); s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; @@ -834,8 +834,8 @@ for (i = 8; i < (1 << log2_trafo_size); i += 8) { int xp_pu = (x0 + i - 1) >> log2_min_pu_size; int xq_pu = (x0 + i) >> log2_min_pu_size; - MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; - MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; + const MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; + const MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; bs = boundary_strength(s, curr, left, rpl); s->vertical_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; @@ -848,8 +848,9 @@ #undef CB #undef CR -void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) +void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size) { + const HEVCContext *const s = lc->parent; int x_end = x >= s->ps.sps->width - ctb_size; int skip = 0; if (s->avctx->skip_loop_filter >= AVDISCARD_ALL || @@ -867,16 +868,16 @@ if (s->ps.sps->sao_enabled && !skip) { int y_end = y >= s->ps.sps->height - ctb_size; if (y && x) - sao_filter_CTB(s, x - ctb_size, y - ctb_size); + sao_filter_CTB(lc, s, x - ctb_size, y - ctb_size); if (x && y_end) - sao_filter_CTB(s, x - ctb_size, y); + sao_filter_CTB(lc, s, x - ctb_size, y); if (y && x_end) { - sao_filter_CTB(s, x, y - ctb_size); + sao_filter_CTB(lc, s, x, y - ctb_size); if (s->threads_type & FF_THREAD_FRAME ) ff_thread_report_progress(&s->ref->tf, y, 0); } if (x_end && y_end) { - sao_filter_CTB(s, x , y); + sao_filter_CTB(lc, s, x , y); if (s->threads_type & FF_THREAD_FRAME ) ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); } @@ -884,14 +885,14 @@ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); } -void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size) +void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size) { - int x_end = x_ctb >= s->ps.sps->width - ctb_size; - int y_end = y_ctb >= s->ps.sps->height - ctb_size; + int x_end = x_ctb >= lc->parent->ps.sps->width - ctb_size; + int y_end = y_ctb >= lc->parent->ps.sps->height - ctb_size; if (y_ctb && x_ctb) - ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size); + ff_hevc_hls_filter(lc, x_ctb - ctb_size, y_ctb - ctb_size, ctb_size); if (y_ctb && x_end) - ff_hevc_hls_filter(s, x_ctb, y_ctb - ctb_size, ctb_size); + ff_hevc_hls_filter(lc, x_ctb, y_ctb - ctb_size, ctb_size); if (x_ctb && y_end) - ff_hevc_hls_filter(s, x_ctb - ctb_size, y_ctb, ctb_size); + ff_hevc_hls_filter(lc, x_ctb - ctb_size, y_ctb, ctb_size); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_mvs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_mvs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_mvs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_mvs.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,10 +40,10 @@ { 3, 2, }, }; -void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, +void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH) { - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int x0b = av_mod_uintp2(x0, s->ps.sps->log2_ctb_size); int y0b = av_mod_uintp2(y0, s->ps.sps->log2_ctb_size); @@ -62,7 +62,7 @@ /* * 6.4.1 Derivation process for z-scan order block availability */ -static av_always_inline int z_scan_block_avail(HEVCContext *s, int xCurr, int yCurr, +static av_always_inline int z_scan_block_avail(const HEVCContext *s, int xCurr, int yCurr, int xN, int yN) { #define MIN_TB_ADDR_ZS(x, y) \ @@ -84,7 +84,7 @@ } //check if the two luma locations belong to the same motion estimation region -static av_always_inline int is_diff_mer(HEVCContext *s, int xN, int yN, int xP, int yP) +static av_always_inline int is_diff_mer(const HEVCContext *s, int xN, int yN, int xP, int yP) { uint8_t plevel = s->ps.pps->log2_parallel_merge_level; @@ -161,11 +161,11 @@ refPicList_col, L ## l, temp_col.ref_idx[l]) // derive the motion vectors section 8.5.3.1.8 -static int derive_temporal_colocated_mvs(HEVCContext *s, MvField temp_col, +static int derive_temporal_colocated_mvs(const HEVCContext *s, MvField temp_col, int refIdxLx, Mv *mvLXCol, int X, int colPic, const RefPicList *refPicList_col) { - RefPicList *refPicList = s->ref->refPicList; + const RefPicList *refPicList = s->ref->refPicList; if (temp_col.pred_flag == PF_INTRA) return 0; @@ -216,18 +216,18 @@ /* * 8.5.3.1.7 temporal luma motion vector prediction */ -static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0, +static int temporal_luma_motion_vector(const HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int refIdxLx, Mv *mvLXCol, int X) { - MvField *tab_mvf; + const MvField *tab_mvf; MvField temp_col; int x, y, x_pu, y_pu; int min_pu_width = s->ps.sps->min_pu_width; int availableFlagLXCol = 0; int colPic; - HEVCFrame *ref = s->ref->collocated_ref; + const HEVCFrame *ref = s->ref->collocated_ref; if (!ref) { memset(mvLXCol, 0, sizeof(*mvLXCol)); @@ -283,16 +283,16 @@ /* * 8.5.3.1.2 Derivation process for spatial merging candidates */ -static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0, +static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCContext *s, + int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int singleMCLFlag, int part_idx, int merge_idx, struct MvField mergecandlist[]) { - HEVCLocalContext *lc = s->HEVClc; - RefPicList *refPicList = s->ref->refPicList; - MvField *tab_mvf = s->ref->tab_mvf; + const RefPicList *refPicList = s->ref->refPicList; + const MvField *tab_mvf = s->ref->tab_mvf; const int min_pu_width = s->ps.sps->min_pu_width; @@ -477,16 +477,16 @@ /* * 8.5.3.1.1 Derivation process of luma Mvs for merge mode */ -void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW, +void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv) { + const HEVCContext *const s = lc->parent; int singleMCLFlag = 0; int nCS = 1 << log2_cb_size; MvField mergecand_list[MRG_MAX_NUM_CANDS]; int nPbW2 = nPbW; int nPbH2 = nPbH; - HEVCLocalContext *lc = s->HEVClc; if (s->ps.pps->log2_parallel_merge_level > 2 && nCS == 8) { singleMCLFlag = 1; @@ -497,8 +497,8 @@ part_idx = 0; } - ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH); - derive_spatial_merge_candidates(s, x0, y0, nPbW, nPbH, log2_cb_size, + ff_hevc_set_neighbour_available(lc, x0, y0, nPbW, nPbH); + derive_spatial_merge_candidates(lc, s, x0, y0, nPbW, nPbH, log2_cb_size, singleMCLFlag, part_idx, merge_idx, mergecand_list); @@ -510,12 +510,12 @@ *mv = mergecand_list[merge_idx]; } -static av_always_inline void dist_scale(HEVCContext *s, Mv *mv, +static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, int min_pu_width, int x, int y, int elist, int ref_idx_curr, int ref_idx) { - RefPicList *refPicList = s->ref->refPicList; - MvField *tab_mvf = s->ref->tab_mvf; + const RefPicList *refPicList = s->ref->refPicList; + const MvField *tab_mvf = s->ref->tab_mvf; int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]]; int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx]; @@ -527,13 +527,13 @@ } } -static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index, +static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx) { - MvField *tab_mvf = s->ref->tab_mvf; + const MvField *tab_mvf = s->ref->tab_mvf; int min_pu_width = s->ps.sps->min_pu_width; - RefPicList *refPicList = s->ref->refPicList; + const RefPicList *refPicList = s->ref->refPicList; if (((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) && refPicList[pred_flag_index].list[TAB_MVF(x, y).ref_idx[pred_flag_index]] == refPicList[ref_idx_curr].list[ref_idx]) { @@ -543,13 +543,13 @@ return 0; } -static int mv_mp_mode_mx_lt(HEVCContext *s, int x, int y, int pred_flag_index, +static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_index, Mv *mv, int ref_idx_curr, int ref_idx) { - MvField *tab_mvf = s->ref->tab_mvf; + const MvField *tab_mvf = s->ref->tab_mvf; int min_pu_width = s->ps.sps->min_pu_width; - RefPicList *refPicList = s->ref->refPicList; + const RefPicList *refPicList = s->ref->refPicList; if ((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) { int currIsLongTerm = refPicList[ref_idx_curr].isLongTerm[ref_idx]; @@ -580,13 +580,13 @@ (y ## v) >> s->ps.sps->log2_min_pu_size, \ pred, &mx, ref_idx_curr, ref_idx) -void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW, +void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX) { - HEVCLocalContext *lc = s->HEVClc; - MvField *tab_mvf = s->ref->tab_mvf; + const HEVCContext *const s = lc->parent; + const MvField *const tab_mvf = s->ref->tab_mvf; int isScaledFlag_L0 = 0; int availableFlagLXA0 = 1; int availableFlagLXB0 = 1; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,10 +26,10 @@ #include #include -struct HEVCContext; +struct HEVCLocalContext; typedef struct HEVCPredContext { - void (*intra_pred[4])(struct HEVCContext *s, int x0, int y0, int c_idx); + void (*intra_pred[4])(struct HEVCLocalContext *lc, int x0, int y0, int c_idx); void (*pred_planar[4])(uint8_t *src, const uint8_t *top, const uint8_t *left, ptrdiff_t stride); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevcpred_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #define POS(x, y) src[(x) + stride * (y)] -static av_always_inline void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, +static av_always_inline void FUNC(intra_pred)(HEVCLocalContext *lc, int x0, int y0, int log2_size, int c_idx) { #define PU(x) \ @@ -70,7 +70,7 @@ else \ a = PIXEL_SPLAT_X4(ptr[i + 3]) - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int i; int hshift = s->ps.sps->hshift[c_idx]; int vshift = s->ps.sps->vshift[c_idx]; @@ -346,9 +346,9 @@ } #define INTRA_PRED(size) \ -static void FUNC(intra_pred_ ## size)(HEVCContext *s, int x0, int y0, int c_idx) \ +static void FUNC(intra_pred_ ## size)(HEVCLocalContext *lc, int x0, int y0, int c_idx) \ { \ - FUNC(intra_pred)(s, x0, y0, size, c_idx); \ + FUNC(intra_pred)(lc, x0, y0, size, c_idx); \ } INTRA_PRED(2) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "golomb.h" +#include "h2645_vui.h" #include "hevc_data.h" #include "hevc_ps.h" @@ -50,26 +51,6 @@ 24, 25, 28, 33, 41, 54, 71, 91 }; -static const AVRational vui_sar[] = { - { 0, 1 }, - { 1, 1 }, - { 12, 11 }, - { 10, 11 }, - { 16, 11 }, - { 40, 33 }, - { 24, 11 }, - { 20, 11 }, - { 32, 11 }, - { 80, 33 }, - { 18, 11 }, - { 15, 11 }, - { 64, 33 }, - { 160, 99 }, - { 4, 3 }, - { 3, 2 }, - { 2, 1 }, -}; - static const uint8_t hevc_sub_width_c[] = { 1, 2, 2, 1 }; @@ -587,47 +568,15 @@ { VUI backup_vui, *vui = &sps->vui; GetBitContext backup; - int sar_present, alt = 0; + int alt = 0; - av_log(avctx, AV_LOG_DEBUG, "Decoding VUI\n"); - - sar_present = get_bits1(gb); - if (sar_present) { - uint8_t sar_idx = get_bits(gb, 8); - if (sar_idx < FF_ARRAY_ELEMS(vui_sar)) - vui->sar = vui_sar[sar_idx]; - else if (sar_idx == 255) { - vui->sar.num = get_bits(gb, 16); - vui->sar.den = get_bits(gb, 16); - } else - av_log(avctx, AV_LOG_WARNING, - "Unknown SAR index: %u.\n", sar_idx); - } + ff_h2645_decode_common_vui_params(gb, &sps->vui.common, avctx); - vui->overscan_info_present_flag = get_bits1(gb); - if (vui->overscan_info_present_flag) - vui->overscan_appropriate_flag = get_bits1(gb); - - vui->video_signal_type_present_flag = get_bits1(gb); - if (vui->video_signal_type_present_flag) { - vui->video_format = get_bits(gb, 3); - vui->video_full_range_flag = get_bits1(gb); - vui->colour_description_present_flag = get_bits1(gb); - if (vui->video_full_range_flag && sps->pix_fmt == AV_PIX_FMT_YUV420P) + if (vui->common.video_signal_type_present_flag) { + if (vui->common.video_full_range_flag && sps->pix_fmt == AV_PIX_FMT_YUV420P) sps->pix_fmt = AV_PIX_FMT_YUVJ420P; - if (vui->colour_description_present_flag) { - vui->colour_primaries = get_bits(gb, 8); - vui->transfer_characteristic = get_bits(gb, 8); - vui->matrix_coeffs = get_bits(gb, 8); - - // Set invalid values to "unspecified" - if (!av_color_primaries_name(vui->colour_primaries)) - vui->colour_primaries = AVCOL_PRI_UNSPECIFIED; - if (!av_color_transfer_name(vui->transfer_characteristic)) - vui->transfer_characteristic = AVCOL_TRC_UNSPECIFIED; - if (!av_color_space_name(vui->matrix_coeffs)) - vui->matrix_coeffs = AVCOL_SPC_UNSPECIFIED; - if (vui->matrix_coeffs == AVCOL_SPC_RGB) { + if (vui->common.colour_description_present_flag) { + if (vui->common.matrix_coeffs == AVCOL_SPC_RGB) { switch (sps->pix_fmt) { case AV_PIX_FMT_YUV444P: sps->pix_fmt = AV_PIX_FMT_GBRP; @@ -643,12 +592,6 @@ } } - vui->chroma_loc_info_present_flag = get_bits1(gb); - if (vui->chroma_loc_info_present_flag) { - vui->chroma_sample_loc_type_top_field = get_ue_golomb_long(gb); - vui->chroma_sample_loc_type_bottom_field = get_ue_golomb_long(gb); - } - vui->neutra_chroma_indication_flag = get_bits1(gb); vui->field_seq_flag = get_bits1(gb); vui->frame_field_info_present_flag = get_bits1(gb); @@ -1123,7 +1066,7 @@ sps->sps_temporal_mvp_enabled_flag = get_bits1(gb); sps->sps_strong_intra_smoothing_enable_flag = get_bits1(gb); - sps->vui.sar = (AVRational){0, 1}; + sps->vui.common.sar = (AVRational){0, 1}; vui_present = get_bits1(gb); if (vui_present) decode_vui(gb, avctx, apply_defdispwin, sps); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_ps.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "h2645_vui.h" #include "hevc.h" typedef struct ShortTermRPS { @@ -47,22 +48,8 @@ } HEVCWindow; typedef struct VUI { - AVRational sar; + H2645VUI common; - int overscan_info_present_flag; - int overscan_appropriate_flag; - - int video_signal_type_present_flag; - int video_format; - int video_full_range_flag; - int colour_description_present_flag; - uint8_t colour_primaries; - uint8_t transfer_characteristic; - uint8_t matrix_coeffs; - - int chroma_loc_info_present_flag; - int chroma_sample_loc_type_top_field; - int chroma_sample_loc_type_bottom_field; int neutra_chroma_indication_flag; int field_seq_flag; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_refs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_refs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_refs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_refs.c 2023-03-03 13:29:59.000000000 +0000 @@ -173,23 +173,36 @@ return 0; } +static void unref_missing_refs(HEVCContext *s) +{ + for (int i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { + HEVCFrame *frame = &s->DPB[i]; + if (frame->sequence == HEVC_SEQUENCE_COUNTER_INVALID) { + ff_hevc_unref_frame(s, frame, ~0); + } + } +} + int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush) { + if (IS_IRAP(s) && s->no_rasl_output_flag == 1) { + const static int mask = HEVC_FRAME_FLAG_BUMPING | HEVC_FRAME_FLAG_OUTPUT; + for (int i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { + HEVCFrame *frame = &s->DPB[i]; + if ((frame->flags & mask) == HEVC_FRAME_FLAG_OUTPUT && + frame->sequence != s->seq_decode) { + if (s->sh.no_output_of_prior_pics_flag == 1) + ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT); + else + frame->flags |= HEVC_FRAME_FLAG_BUMPING; + } + } + } do { int nb_output = 0; int min_poc = INT_MAX; int i, min_idx, ret; - if (s->sh.no_output_of_prior_pics_flag == 1 && s->no_rasl_output_flag == 1) { - for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { - HEVCFrame *frame = &s->DPB[i]; - if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc && - frame->sequence == s->seq_output) { - ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT); - } - } - } - for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *frame = &s->DPB[i]; if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) && @@ -230,7 +243,7 @@ } if (s->seq_output != s->seq_decode) - s->seq_output = (s->seq_output + 1) & 0xff; + s->seq_output = (s->seq_output + 1) & HEVC_SEQUENCE_COUNTER_MASK; else break; } while (1); @@ -374,7 +387,7 @@ for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *ref = &s->DPB[i]; if (ref->frame->buf[0] && ref->sequence == s->seq_decode) { - if ((ref->poc & mask) == poc) + if ((ref->poc & mask) == poc && (use_msb || ref->poc != s->poc)) return ref; } } @@ -416,7 +429,7 @@ } frame->poc = poc; - frame->sequence = s->seq_decode; + frame->sequence = HEVC_SEQUENCE_COUNTER_INVALID; frame->flags = 0; if (s->threads_type == FF_THREAD_FRAME) @@ -460,6 +473,8 @@ return 0; } + unref_missing_refs(s); + /* clear the reference flags on all frames except the current one */ for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { HEVCFrame *frame = &s->DPB[i]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,10 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "atsc_a53.h" #include "bytestream.h" -#include "dynamic_hdr10_plus.h" -#include "dynamic_hdr_vivid.h" #include "golomb.h" #include "hevc_ps.h" #include "hevc_sei.h" @@ -98,38 +95,6 @@ return 0; } -static int decode_nal_sei_frame_packing_arrangement(HEVCSEIFramePacking *s, GetBitContext *gb) -{ - get_ue_golomb_long(gb); // frame_packing_arrangement_id - s->present = !get_bits1(gb); - - if (s->present) { - s->arrangement_type = get_bits(gb, 7); - s->quincunx_subsampling = get_bits1(gb); - s->content_interpretation_type = get_bits(gb, 6); - - // spatial_flipping_flag, frame0_flipped_flag, field_views_flag - skip_bits(gb, 3); - s->current_frame_is_frame0_flag = get_bits1(gb); - } - return 0; -} - -static int decode_nal_sei_display_orientation(HEVCSEIDisplayOrientation *s, GetBitContext *gb) -{ - s->present = !get_bits1(gb); - - if (s->present) { - s->hflip = get_bits1(gb); // hor_flip - s->vflip = get_bits1(gb); // ver_flip - - s->anticlockwise_rotation = get_bits(gb, 16); - // skip_bits1(gb); // display_orientation_persistence_flag - } - - return 0; -} - static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx) { @@ -161,182 +126,6 @@ return 0; } -static int decode_registered_user_data_closed_caption(HEVCSEIA53Caption *s, - GetByteContext *gb) -{ - int ret; - - ret = ff_parse_a53_cc(&s->buf_ref, gb->buffer, - bytestream2_get_bytes_left(gb)); - if (ret < 0) - return ret; - - return 0; -} - -static int decode_nal_sei_user_data_unregistered(HEVCSEIUnregistered *s, - GetByteContext *gb) -{ - AVBufferRef *buf_ref, **tmp; - int size = bytestream2_get_bytes_left(gb); - - if (size < 16 || size >= INT_MAX - 1) - return AVERROR_INVALIDDATA; - - tmp = av_realloc_array(s->buf_ref, s->nb_buf_ref + 1, sizeof(*s->buf_ref)); - if (!tmp) - return AVERROR(ENOMEM); - s->buf_ref = tmp; - - buf_ref = av_buffer_alloc(size + 1); - if (!buf_ref) - return AVERROR(ENOMEM); - - bytestream2_get_bufferu(gb, buf_ref->data, size); - buf_ref->data[size] = 0; - buf_ref->size = size; - s->buf_ref[s->nb_buf_ref++] = buf_ref; - - return 0; -} - -static int decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s, - GetByteContext *gb) -{ - size_t meta_size; - int err; - AVDynamicHDRPlus *metadata = av_dynamic_hdr_plus_alloc(&meta_size); - if (!metadata) - return AVERROR(ENOMEM); - - err = ff_parse_itu_t_t35_to_dynamic_hdr10_plus(metadata, gb->buffer, - bytestream2_get_bytes_left(gb)); - if (err < 0) { - av_free(metadata); - return err; - } - - av_buffer_unref(&s->info); - s->info = av_buffer_create((uint8_t *)metadata, meta_size, NULL, NULL, 0); - if (!s->info) { - av_free(metadata); - return AVERROR(ENOMEM); - } - - return 0; -} - -static int decode_registered_user_data_dynamic_hdr_vivid(HEVCSEIDynamicHDRVivid *s, - GetByteContext *gb) -{ - size_t meta_size; - int err; - AVDynamicHDRVivid *metadata = av_dynamic_hdr_vivid_alloc(&meta_size); - if (!metadata) - return AVERROR(ENOMEM); - - err = ff_parse_itu_t_t35_to_dynamic_hdr_vivid(metadata, - gb->buffer, bytestream2_get_bytes_left(gb)); - if (err < 0) { - av_free(metadata); - return err; - } - - av_buffer_unref(&s->info); - s->info = av_buffer_create((uint8_t *)metadata, meta_size, NULL, NULL, 0); - if (!s->info) { - av_free(metadata); - return AVERROR(ENOMEM); - } - - return 0; -} - -static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetByteContext *gb, - void *logctx) -{ - int country_code, provider_code; - - if (bytestream2_get_bytes_left(gb) < 3) - return AVERROR_INVALIDDATA; - - country_code = bytestream2_get_byteu(gb); - if (country_code == 0xFF) { - if (bytestream2_get_bytes_left(gb) < 3) - return AVERROR_INVALIDDATA; - - bytestream2_skipu(gb, 1); - } - - if (country_code != 0xB5 && country_code != 0x26) { // usa_country_code and cn_country_code - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (country_code = 0x%x)\n", - country_code); - return 0; - } - - provider_code = bytestream2_get_be16u(gb); - - switch (provider_code) { - case 0x04: { // cuva_provider_code - const uint16_t cuva_provider_oriented_code = 0x0005; - uint16_t provider_oriented_code; - - if (bytestream2_get_bytes_left(gb) < 2) - return AVERROR_INVALIDDATA; - - provider_oriented_code = bytestream2_get_be16u(gb); - if (provider_oriented_code == cuva_provider_oriented_code) { - return decode_registered_user_data_dynamic_hdr_vivid(&s->dynamic_hdr_vivid, gb); - } - break; - } - case 0x3C: { // smpte_provider_code - // A/341 Amendment - 2094-40 - const uint16_t smpte2094_40_provider_oriented_code = 0x0001; - const uint8_t smpte2094_40_application_identifier = 0x04; - uint16_t provider_oriented_code; - uint8_t application_identifier; - - if (bytestream2_get_bytes_left(gb) < 3) - return AVERROR_INVALIDDATA; - - provider_oriented_code = bytestream2_get_be16u(gb); - application_identifier = bytestream2_get_byteu(gb); - if (provider_oriented_code == smpte2094_40_provider_oriented_code && - application_identifier == smpte2094_40_application_identifier) { - return decode_registered_user_data_dynamic_hdr_plus(&s->dynamic_hdr_plus, gb); - } - break; - } - case 0x31: { // atsc_provider_code - uint32_t user_identifier; - - if (bytestream2_get_bytes_left(gb) < 4) - return AVERROR_INVALIDDATA; - - user_identifier = bytestream2_get_be32u(gb); - switch (user_identifier) { - case MKBETAG('G', 'A', '9', '4'): - return decode_registered_user_data_closed_caption(&s->a53_caption, gb); - default: - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (atsc user_identifier = 0x%04x)\n", - user_identifier); - break; - } - break; - } - default: - av_log(logctx, AV_LOG_VERBOSE, - "Unsupported User Data Registered ITU-T T35 SEI message (provider_code = %d)\n", - provider_code); - break; - } - - return 0; -} - static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx) { int num_sps_ids_minus1; @@ -362,18 +151,6 @@ return 0; } -static int decode_nal_sei_alternative_transfer(HEVCSEIAlternativeTransfer *s, - GetByteContext *gb) -{ - if (bytestream2_get_bytes_left(gb) < 1) - return AVERROR_INVALIDDATA; - - s->present = 1; - s->preferred_transfer_characteristics = bytestream2_get_byteu(gb); - - return 0; -} - static int decode_nal_sei_timecode(HEVCSEITimeCode *s, GetBitContext *gb) { s->num_clock_ts = get_bits(gb, 2); @@ -420,49 +197,6 @@ return 0; } -static int decode_film_grain_characteristics(HEVCSEIFilmGrainCharacteristics *h, - GetBitContext *gb) -{ - h->present = !get_bits1(gb); // film_grain_characteristics_cancel_flag - - if (h->present) { - memset(h, 0, sizeof(*h)); - h->model_id = get_bits(gb, 2); - h->separate_colour_description_present_flag = get_bits1(gb); - if (h->separate_colour_description_present_flag) { - h->bit_depth_luma = get_bits(gb, 3) + 8; - h->bit_depth_chroma = get_bits(gb, 3) + 8; - h->full_range = get_bits1(gb); - h->color_primaries = get_bits(gb, 8); - h->transfer_characteristics = get_bits(gb, 8); - h->matrix_coeffs = get_bits(gb, 8); - } - h->blending_mode_id = get_bits(gb, 2); - h->log2_scale_factor = get_bits(gb, 4); - for (int c = 0; c < 3; c++) - h->comp_model_present_flag[c] = get_bits1(gb); - for (int c = 0; c < 3; c++) { - if (h->comp_model_present_flag[c]) { - h->num_intensity_intervals[c] = get_bits(gb, 8) + 1; - h->num_model_values[c] = get_bits(gb, 3) + 1; - if (h->num_model_values[c] > 6) - return AVERROR_INVALIDDATA; - for (int i = 0; i < h->num_intensity_intervals[c]; i++) { - h->intensity_interval_lower_bound[c][i] = get_bits(gb, 8); - h->intensity_interval_upper_bound[c][i] = get_bits(gb, 8); - for (int j = 0; j < h->num_model_values[c]; j++) - h->comp_model_value[c][i][j] = get_se_golomb_long(gb); - } - } - } - h->persistence_flag = get_bits1(gb); - - h->present = 1; - } - - return 0; -} - static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, void *logctx, HEVCSEI *s, const HEVCParamSets *ps, int type) @@ -470,10 +204,6 @@ switch (type) { case 256: // Mismatched value from HM 8.1 return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); - case SEI_TYPE_FRAME_PACKING_ARRANGEMENT: - return decode_nal_sei_frame_packing_arrangement(&s->frame_packing, gb); - case SEI_TYPE_DISPLAY_ORIENTATION: - return decode_nal_sei_display_orientation(&s->display_orientation, gb); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: @@ -482,19 +212,15 @@ 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_USER_DATA_REGISTERED_ITU_T_T35: - return decode_nal_sei_user_data_registered_itu_t_t35(s, gbyte, logctx); - case SEI_TYPE_USER_DATA_UNREGISTERED: - return decode_nal_sei_user_data_unregistered(&s->unregistered, gbyte); - case SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS: - return decode_nal_sei_alternative_transfer(&s->alternative_transfer, gbyte); case SEI_TYPE_TIME_CODE: return decode_nal_sei_timecode(&s->timecode, gb); - case SEI_TYPE_FILM_GRAIN_CHARACTERISTICS: - return decode_film_grain_characteristics(&s->film_grain_characteristics, gb); - default: - av_log(logctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type); - return 0; + default: { + int ret = ff_h2645_sei_message_decode(&s->common, type, AV_CODEC_ID_HEVC, + gb, gbyte, logctx); + if (ret == FF_H2645_SEI_MESSAGE_UNHANDLED) + av_log(logctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", type); + return ret; + } } } @@ -566,15 +292,3 @@ } while (bytestream2_get_bytes_left(&gbyte) > 0); return 1; } - -void ff_hevc_reset_sei(HEVCSEI *s) -{ - av_buffer_unref(&s->a53_caption.buf_ref); - - for (int i = 0; i < s->unregistered.nb_buf_ref; i++) - av_buffer_unref(&s->unregistered.buf_ref[i]); - s->unregistered.nb_buf_ref = 0; - av_freep(&s->unregistered.buf_ref); - av_buffer_unref(&s->dynamic_hdr_plus.info); - av_buffer_unref(&s->dynamic_hdr_vivid.info); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hevc_sei.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "get_bits.h" #include "hevc.h" +#include "h2645_sei.h" #include "sei.h" @@ -48,25 +49,10 @@ int current_frame_is_frame0_flag; } HEVCSEIFramePacking; -typedef struct HEVCSEIDisplayOrientation { - int present; - int anticlockwise_rotation; - int hflip, vflip; -} HEVCSEIDisplayOrientation; - typedef struct HEVCSEIPictureTiming { int picture_struct; } HEVCSEIPictureTiming; -typedef struct HEVCSEIA53Caption { - AVBufferRef *buf_ref; -} HEVCSEIA53Caption; - -typedef struct HEVCSEIUnregistered { - AVBufferRef **buf_ref; - int nb_buf_ref; -} HEVCSEIUnregistered; - typedef struct HEVCSEIMasteringDisplay { int present; uint16_t display_primaries[3][2]; @@ -75,14 +61,6 @@ uint32_t min_luminance; } HEVCSEIMasteringDisplay; -typedef struct HEVCSEIDynamicHDRPlus { - AVBufferRef *info; -} HEVCSEIDynamicHDRPlus; - -typedef struct HEVCSEIDynamicHDRVivid { - AVBufferRef *info; -} HEVCSEIDynamicHDRVivid; - typedef struct HEVCSEIContentLight { int present; uint16_t max_content_light_level; @@ -114,42 +92,14 @@ int32_t time_offset_value[3]; } HEVCSEITimeCode; -typedef struct HEVCSEIFilmGrainCharacteristics { - int present; - int model_id; - int separate_colour_description_present_flag; - int bit_depth_luma; - int bit_depth_chroma; - int full_range; - int color_primaries; - int transfer_characteristics; - int matrix_coeffs; - int blending_mode_id; - int log2_scale_factor; - int comp_model_present_flag[3]; - uint16_t num_intensity_intervals[3]; - uint8_t num_model_values[3]; - uint8_t intensity_interval_lower_bound[3][256]; - uint8_t intensity_interval_upper_bound[3][256]; - int16_t comp_model_value[3][256][6]; - int persistence_flag; -} HEVCSEIFilmGrainCharacteristics; - typedef struct HEVCSEI { + H2645SEI common; HEVCSEIPictureHash picture_hash; - HEVCSEIFramePacking frame_packing; - HEVCSEIDisplayOrientation display_orientation; HEVCSEIPictureTiming picture_timing; - HEVCSEIA53Caption a53_caption; - HEVCSEIUnregistered unregistered; HEVCSEIMasteringDisplay mastering_display; - HEVCSEIDynamicHDRPlus dynamic_hdr_plus; - HEVCSEIDynamicHDRVivid dynamic_hdr_vivid; HEVCSEIContentLight content_light; int active_seq_parameter_set_id; - HEVCSEIAlternativeTransfer alternative_transfer; HEVCSEITimeCode timecode; - HEVCSEIFilmGrainCharacteristics film_grain_characteristics; } HEVCSEI; struct HEVCParamSets; @@ -157,13 +107,21 @@ int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const struct HEVCParamSets *ps, enum HEVCNALUnitType type); +static inline int ff_hevc_sei_ctx_replace(HEVCSEI *dst, const HEVCSEI *src) +{ + return ff_h2645_sei_ctx_replace(&dst->common, &src->common); +} + /** * Reset SEI values that are stored on the Context. * e.g. Caption data that was extracted during NAL * parsing. * - * @param s HEVCContext. + * @param sei HEVCSEI. */ -void ff_hevc_reset_sei(HEVCSEI *s); +static inline void ff_hevc_reset_sei(HEVCSEI *sei) +{ + ff_h2645_sei_reset(&sei->common); +} #endif /* AVCODEC_HEVC_SEI_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hnm4video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hnm4video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hnm4video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hnm4video.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define HNM4_CHUNK_ID_PL 19536 #define HNM4_CHUNK_ID_IZ 23113 @@ -499,7 +499,7 @@ const FFCodec ff_hnm4_video_decoder = { .p.name = "hnm4video", - .p.long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"), + CODEC_LONG_NAME("HNM 4 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HNM4_VIDEO, .priv_data_size = sizeof(Hnm4VideoContext), @@ -507,5 +507,5 @@ .close = hnm_decode_end, FF_CODEC_DECODE_CB(hnm_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,13 @@ #include #include "libavutil/attributes.h" -#include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "bytestream.h" #include "canopus.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "hq_hqa.h" #include "hq_hqadsp.h" @@ -114,12 +114,12 @@ return 0; } -static int hq_decode_frame(HQContext *ctx, AVFrame *pic, +static int hq_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, int prof_num, size_t data_size) { const HQProfile *profile; GetBitContext gb; - const uint8_t *perm, *src = ctx->gbc.buffer; + const uint8_t *perm, *src = gbc->buffer; uint32_t slice_off[21]; int slice, start_off, next_off, i, ret; @@ -144,7 +144,7 @@ /* Offsets are stored from CUV position, so adjust them accordingly. */ for (i = 0; i < profile->num_slices + 1; i++) - slice_off[i] = bytestream2_get_be24(&ctx->gbc) - 4; + slice_off[i] = bytestream2_get_be24(gbc) - 4; next_off = 0; for (slice = 0; slice < profile->num_slices; slice++) { @@ -240,20 +240,20 @@ return 0; } -static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, size_t data_size) +static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, size_t data_size) { GetBitContext gb; const int num_slices = 8; uint32_t slice_off[9]; int i, slice, ret; int width, height, quant; - const uint8_t *src = ctx->gbc.buffer; + const uint8_t *src = gbc->buffer; - if (bytestream2_get_bytes_left(&ctx->gbc) < 8 + 4*(num_slices + 1)) + if (bytestream2_get_bytes_left(gbc) < 8 + 4*(num_slices + 1)) return AVERROR_INVALIDDATA; - width = bytestream2_get_be16(&ctx->gbc); - height = bytestream2_get_be16(&ctx->gbc); + width = bytestream2_get_be16(gbc); + height = bytestream2_get_be16(gbc); ret = ff_set_dimensions(ctx->avctx, width, height); if (ret < 0) @@ -266,8 +266,8 @@ av_log(ctx->avctx, AV_LOG_VERBOSE, "HQA Profile\n"); - quant = bytestream2_get_byte(&ctx->gbc); - bytestream2_skip(&ctx->gbc, 3); + quant = bytestream2_get_byte(gbc); + bytestream2_skip(gbc, 3); if (quant >= NUM_HQ_QUANTS) { av_log(ctx->avctx, AV_LOG_ERROR, "Invalid quantization matrix %d.\n", quant); @@ -280,7 +280,7 @@ /* Offsets are stored from HQA1 position, so adjust them accordingly. */ for (i = 0; i < num_slices + 1; i++) - slice_off[i] = bytestream2_get_be32(&ctx->gbc) - 4; + slice_off[i] = bytestream2_get_be32(gbc) - 4; for (slice = 0; slice < num_slices; slice++) { if (slice_off[slice] < (num_slices + 1) * 3 || @@ -305,32 +305,33 @@ int *got_frame, AVPacket *avpkt) { HQContext *ctx = avctx->priv_data; + GetByteContext gbc0, *const gbc = &gbc0; uint32_t info_tag; unsigned int data_size; int ret; unsigned tag; - bytestream2_init(&ctx->gbc, avpkt->data, avpkt->size); - if (bytestream2_get_bytes_left(&ctx->gbc) < 4 + 4) { + bytestream2_init(gbc, avpkt->data, avpkt->size); + if (bytestream2_get_bytes_left(gbc) < 4 + 4) { av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).\n", avpkt->size); return AVERROR_INVALIDDATA; } - info_tag = bytestream2_peek_le32(&ctx->gbc); + info_tag = bytestream2_peek_le32(gbc); if (info_tag == MKTAG('I', 'N', 'F', 'O')) { int info_size; - bytestream2_skip(&ctx->gbc, 4); - info_size = bytestream2_get_le32(&ctx->gbc); - if (info_size < 0 || bytestream2_get_bytes_left(&ctx->gbc) < info_size) { + bytestream2_skip(gbc, 4); + info_size = bytestream2_get_le32(gbc); + if (info_size < 0 || bytestream2_get_bytes_left(gbc) < info_size) { av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size); return AVERROR_INVALIDDATA; } - ff_canopus_parse_info_tag(avctx, ctx->gbc.buffer, info_size); + ff_canopus_parse_info_tag(avctx, gbc->buffer, info_size); - bytestream2_skip(&ctx->gbc, info_size); + bytestream2_skip(gbc, info_size); } - data_size = bytestream2_get_bytes_left(&ctx->gbc); + data_size = bytestream2_get_bytes_left(gbc); if (data_size < 4) { av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).\n", data_size); return AVERROR_INVALIDDATA; @@ -339,11 +340,11 @@ /* HQ defines dimensions and number of slices, and thus slice traversal * order. HQA has no size constraint and a fixed number of slices, so it * needs a separate scheme for it. */ - tag = bytestream2_get_le32(&ctx->gbc); + tag = bytestream2_get_le32(gbc); if ((tag & 0x00FFFFFF) == (MKTAG('U', 'V', 'C', ' ') & 0x00FFFFFF)) { - ret = hq_decode_frame(ctx, pic, tag >> 24, data_size); + ret = hq_decode_frame(ctx, pic, gbc, tag >> 24, data_size); } else if (tag == MKTAG('H', 'Q', 'A', '1')) { - ret = hqa_decode_frame(ctx, pic, data_size); + ret = hqa_decode_frame(ctx, pic, gbc, data_size); } else { av_log(avctx, AV_LOG_ERROR, "Not a HQ/HQA frame.\n"); return AVERROR_INVALIDDATA; @@ -383,7 +384,7 @@ const FFCodec ff_hq_hqa_decoder = { .p.name = "hq_hqa", - .p.long_name = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"), + CODEC_LONG_NAME("Canopus HQ/HQA"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HQ_HQA, .priv_data_size = sizeof(HQContext), @@ -391,6 +392,5 @@ FF_CODEC_DECODE_CB(hq_hqa_decode_frame), .close = hq_hqa_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hq_hqa.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,6 @@ #include "libavutil/mem_internal.h" #include "avcodec.h" -#include "bytestream.h" #include "hq_hqadsp.h" #include "vlc.h" @@ -37,7 +36,6 @@ typedef struct HQContext { AVCodecContext *avctx; HQDSPContext hqhqadsp; - GetByteContext gbc; VLC hq_ac_vlc; VLC hqa_cbp_vlc; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hqx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hqx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hqx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/hqx.c 2023-03-03 13:29:59.000000000 +0000 @@ -536,7 +536,7 @@ const FFCodec ff_hqx_decoder = { .p.name = "hqx", - .p.long_name = NULL_IF_CONFIG_SMALL("Canopus HQX"), + CODEC_LONG_NAME("Canopus HQX"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HQX, .priv_data_size = sizeof(HQXContext), @@ -545,6 +545,5 @@ .close = hqx_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.c 2023-03-03 13:29:59.000000000 +0000 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. @@ -30,65 +30,55 @@ #include +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/log.h" #include "libavutil/mem.h" -#include "avcodec.h" -#include "bswapdsp.h" #include "huffyuv.h" int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n) { - int len, index; - uint32_t bits = 0; + int lens[33] = { 0 }; + uint32_t codes[33]; - for (len = 32; len > 0; len--) { - for (index = 0; index < n; index++) { - if (len_table[index] == len) - dst[index] = bits++; - } - if (bits & 1) { + for (int i = 0; i < n; i++) + lens[len_table[i]]++; + + codes[32] = 0; + for (int i = FF_ARRAY_ELEMS(lens) - 1; i > 0; i--) { + if ((lens[i] + codes[i]) & 1) { av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\n"); return -1; } - bits >>= 1; + codes[i - 1] = (lens[i] + codes[i]) >> 1; + } + for (int i = 0; i < n; i++) { + if (len_table[i]) + dst[i] = codes[len_table[i]]++; } return 0; } -av_cold int ff_huffyuv_alloc_temp(HYuvContext *s) +av_cold int ff_huffyuv_alloc_temp(uint8_t *temp[3], uint16_t *temp16[3], int width) { int i; for (i=0; i<3; i++) { - s->temp[i]= av_malloc(4*s->width + 16); - if (!s->temp[i]) + temp[i] = av_malloc(4 * width + 16); + if (!temp[i]) return AVERROR(ENOMEM); - s->temp16[i] = (uint16_t*)s->temp[i]; + temp16[i] = (uint16_t*)temp[i]; } return 0; } -av_cold void ff_huffyuv_common_init(AVCodecContext *avctx) -{ - HYuvContext *s = avctx->priv_data; - - s->avctx = avctx; - s->flags = avctx->flags; - - ff_bswapdsp_init(&s->bdsp); - - s->width = avctx->width; - s->height = avctx->height; - - av_assert1(s->width > 0 && s->height > 0); -} - -av_cold void ff_huffyuv_common_end(HYuvContext *s) +av_cold void ff_huffyuv_common_end(uint8_t *temp[3], uint16_t *temp16[3]) { int i; for(i = 0; i < 3; i++) { - av_freep(&s->temp[i]); - s->temp16[i] = NULL; + av_freep(&temp[i]); + temp16[i] = NULL; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. @@ -35,6 +35,7 @@ #include "config_components.h" #include "avcodec.h" +#include "bswapdsp.h" #include "codec_internal.h" #include "get_bits.h" #include "huffyuv.h" @@ -44,6 +45,43 @@ #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#define VLC_BITS 12 + +typedef struct HYuvDecContext { + GetBitContext gb; + Predictor predictor; + int interlaced; + int decorrelate; + int bitstream_bpp; + int version; + int yuy2; //use yuy2 instead of 422P + int bgr32; //use bgr32 instead of bgr24 + int bps; + int n; // 1<priv_data; + HYuvDecContext *s = avctx->priv_data; int i; - ff_huffyuv_common_end(s); + ff_huffyuv_common_end(s->temp, s->temp16); av_freep(&s->bitstream_buffer); for (i = 0; i < 8; i++) @@ -293,13 +331,16 @@ static av_cold int decode_init(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvDecContext *s = avctx->priv_data; int ret; ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); if (ret < 0) return ret; + s->flags = avctx->flags; + + ff_bswapdsp_init(&s->bdsp); ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt); ff_llviddsp_init(&s->llviddsp); memset(s->vlc, 0, 4 * sizeof(VLC)); @@ -545,8 +586,6 @@ } } - ff_huffyuv_common_init(avctx); - if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV420P) && avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); return AVERROR_INVALIDDATA; @@ -558,7 +597,7 @@ return AVERROR_INVALIDDATA; } - if ((ret = ff_huffyuv_alloc_temp(s)) < 0) + if ((ret = ff_huffyuv_alloc_temp(s->temp, s->temp16, avctx->width)) < 0) return ret; return 0; @@ -617,7 +656,7 @@ GET_VLC_DUAL(dst0, dst1, re, &s->gb, s->vlc[4+plane1].table, \ s->vlc[0].table, s->vlc[plane1].table, VLC_BITS, 3, OP8bits) -static void decode_422_bitstream(HYuvContext *s, int count) +static void decode_422_bitstream(HYuvDecContext *s, int count) { int i, icount; OPEN_READER(re, &s->gb); @@ -661,7 +700,7 @@ dst1 = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2;\ dst1 += get_bits(&s->gb, 2);\ } -static void decode_plane_bitstream(HYuvContext *s, int width, int plane) +static void decode_plane_bitstream(HYuvDecContext *s, int width, int plane) { int i, count = width/2; @@ -722,7 +761,7 @@ } } -static void decode_gray_bitstream(HYuvContext *s, int count) +static void decode_gray_bitstream(HYuvDecContext *s, int count) { int i; OPEN_READER(re, &s->gb); @@ -740,7 +779,7 @@ CLOSE_READER(re, &s->gb); } -static av_always_inline void decode_bgr_1(HYuvContext *s, int count, +static av_always_inline void decode_bgr_1(HYuvDecContext *s, int count, int decorrelate, int alpha) { int i; @@ -798,7 +837,7 @@ CLOSE_READER(re, &s->gb); } -static void decode_bgr_bitstream(HYuvContext *s, int count) +static void decode_bgr_bitstream(HYuvDecContext *s, int count) { if (s->decorrelate) { if (s->bitstream_bpp == 24) @@ -813,12 +852,12 @@ } } -static void draw_slice(HYuvContext *s, AVFrame *frame, int y) +static void draw_slice(HYuvDecContext *s, AVCodecContext *avctx, AVFrame *frame, int y) { int h, cy, i; int offset[AV_NUM_DATA_POINTERS]; - if (!s->avctx->draw_horiz_band) + if (!avctx->draw_horiz_band) return; h = y - s->last_slice_end; @@ -836,12 +875,12 @@ offset[i] = 0; emms_c(); - s->avctx->draw_horiz_band(s->avctx, frame, offset, y, 3, h); + avctx->draw_horiz_band(avctx, frame, offset, y, 3, h); s->last_slice_end = y + h; } -static int left_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int acc) +static int left_prediction(HYuvDecContext *s, uint8_t *dst, const uint8_t *src, int w, int acc) { if (s->bps <= 8) { return s->llviddsp.add_left_pred(dst, src, w, acc); @@ -850,7 +889,7 @@ } } -static void add_bytes(HYuvContext *s, uint8_t *dst, uint8_t *src, int w) +static void add_bytes(HYuvDecContext *s, uint8_t *dst, uint8_t *src, int w) { if (s->bps <= 8) { s->llviddsp.add_bytes(dst, src, w); @@ -859,7 +898,7 @@ } } -static void add_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src, const uint8_t *diff, int w, int *left, int *left_top) +static void add_median_prediction(HYuvDecContext *s, uint8_t *dst, const uint8_t *src, const uint8_t *diff, int w, int *left, int *left_top) { if (s->bps <= 8) { s->llviddsp.add_median_pred(dst, src, diff, w, left, left_top); @@ -871,10 +910,10 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, int buf_size, int y_offset, int table_size) { - HYuvContext *s = avctx->priv_data; + HYuvDecContext *s = avctx->priv_data; int fake_ystride, fake_ustride, fake_vstride; - const int width = s->width; - const int width2 = s->width >> 1; + const int width = avctx->width; + const int width2 = avctx->width >> 1; int ret; if ((ret = init_get_bits8(&s->gb, s->bitstream_buffer + table_size, buf_size - table_size)) < 0) @@ -952,7 +991,7 @@ break; } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); } else if (s->bitstream_bpp < 24) { int y, cy; int lefty, leftu, leftv; @@ -1006,7 +1045,7 @@ break; } - draw_slice(s, p, y); + draw_slice(s, avctx, p, y); ydst = p->data[0] + p->linesize[0] * (y + y_offset); udst = p->data[1] + p->linesize[1] * (cy + y_offset); @@ -1029,7 +1068,7 @@ } } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; case MEDIAN: @@ -1100,7 +1139,7 @@ if (y >= height) break; } - draw_slice(s, p, y); + draw_slice(s, avctx, p, y); decode_422_bitstream(s, width); @@ -1117,7 +1156,7 @@ } } - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; } } @@ -1163,7 +1202,7 @@ } } // just 1 large slice as this is not possible in reverse order - draw_slice(s, p, height); + draw_slice(s, avctx, p, height); break; default: av_log(avctx, AV_LOG_ERROR, @@ -1184,9 +1223,9 @@ { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - HYuvContext *s = avctx->priv_data; - const int width = s->width; - const int height = s->height; + HYuvDecContext *s = avctx->priv_data; + const int width = avctx->width; + const int height = avctx->height; int slice, table_size = 0, ret, nb_slices; unsigned slices_info_offset; int slice_height; @@ -1264,46 +1303,46 @@ const FFCodec ff_huffyuv_decoder = { .p.name = "huffyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), + CODEC_LONG_NAME("Huffyuv / HuffYUV"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HUFFYUV, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #if CONFIG_FFVHUFF_DECODER const FFCodec ff_ffvhuff_decoder = { .p.name = "ffvhuff", - .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), + CODEC_LONG_NAME("Huffyuv FFmpeg variant"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFVHUFF, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_FFVHUFF_DECODER */ #if CONFIG_HYMT_DECODER const FFCodec ff_hymt_decoder = { .p.name = "hymt", - .p.long_name = NULL_IF_CONFIG_SMALL("HuffYUV MT"), + CODEC_LONG_NAME("HuffYUV MT"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HYMT, - .priv_data_size = sizeof(HYuvContext), + .priv_data_size = sizeof(HYuvDecContext), .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_HYMT_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "config.h" #include "libavutil/attributes.h" #include "mathops.h" +#include "huffyuv.h" #include "huffyuvdsp.h" // 0x00010001 or 0x0001000100010001 or whatever, depending on the cpu's native arithmetic size diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,19 +21,6 @@ #include #include "libavutil/pixfmt.h" -#include "config.h" - -#if HAVE_BIGENDIAN -#define B 3 -#define G 2 -#define R 1 -#define A 0 -#else -#define B 0 -#define G 1 -#define R 2 -#define A 3 -#endif typedef struct HuffYUVDSPContext { void (*add_int16)(uint16_t *dst/*align 16*/, const uint16_t *src/*align 16*/, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. @@ -31,6 +31,7 @@ #include "config_components.h" #include "avcodec.h" +#include "bswapdsp.h" #include "codec_internal.h" #include "encode.h" #include "huffyuv.h" @@ -41,7 +42,39 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" -static inline void diff_bytes(HYuvContext *s, uint8_t *dst, +typedef struct HYuvEncContext { + AVClass *class; + AVCodecContext *avctx; + PutBitContext pb; + Predictor predictor; + int interlaced; + int decorrelate; + int bitstream_bpp; + int version; + int bps; + int n; // 1<bps <= 8) { @@ -51,7 +84,7 @@ } } -static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, +static inline int sub_left_prediction(HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int left) { int i; @@ -82,7 +115,7 @@ } } -static inline void sub_left_prediction_bgr32(HYuvContext *s, uint8_t *dst, +static inline void sub_left_prediction_bgr32(HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha) @@ -118,8 +151,8 @@ *alpha = src[(w - 1) * 4 + A]; } -static inline void sub_left_prediction_rgb24(HYuvContext *s, uint8_t *dst, - uint8_t *src, int w, +static inline void sub_left_prediction_rgb24(HYuvEncContext *s, uint8_t *dst, + const uint8_t *src, int w, int *red, int *green, int *blue) { int i; @@ -146,7 +179,9 @@ *blue = src[(w - 1) * 3 + 2]; } -static void sub_median_prediction(HYuvContext *s, uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top) +static void sub_median_prediction(HYuvEncContext *s, uint8_t *dst, + const uint8_t *src1, const uint8_t *src2, + int w, int *left, int *left_top) { if (s->bps <= 8) { s->llvidencdsp.sub_median_pred(dst, src1, src2, w , left, left_top); @@ -155,7 +190,7 @@ } } -static int store_table(HYuvContext *s, const uint8_t *len, uint8_t *buf) +static int store_table(HYuvEncContext *s, const uint8_t *len, uint8_t *buf) { int i; int index = 0; @@ -180,7 +215,7 @@ return index; } -static int store_huffman_tables(HYuvContext *s, uint8_t *buf) +static int store_huffman_tables(HYuvEncContext *s, uint8_t *buf) { int i, ret; int size = 0; @@ -204,16 +239,21 @@ static av_cold int encode_init(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvEncContext *s = avctx->priv_data; int i, j; int ret; - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); + const AVPixFmtDescriptor *desc; - ff_huffyuv_common_init(avctx); - ff_huffyuvencdsp_init(&s->hencdsp, avctx); + s->avctx = avctx; + s->flags = avctx->flags; + + ff_bswapdsp_init(&s->bdsp); + ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt); ff_llvidencdsp_init(&s->llvidencdsp); avctx->extradata = av_mallocz(3*MAX_N + 4); + if (!avctx->extradata) + return AVERROR(ENOMEM); if (s->flags&AV_CODEC_FLAG_PASS1) { #define STATS_OUT_SIZE 21*MAX_N*3 + 4 avctx->stats_out = av_mallocz(STATS_OUT_SIZE); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132 @@ -222,21 +262,18 @@ } s->version = 2; - if (!avctx->extradata) - return AVERROR(ENOMEM); - + desc = av_pix_fmt_desc_get(avctx->pix_fmt); s->bps = desc->comp[0].depth; s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2; s->chroma = desc->nb_components > 2; s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); - av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, - &s->chroma_h_shift, - &s->chroma_v_shift); + s->chroma_h_shift = desc->log2_chroma_w; + s->chroma_v_shift = desc->log2_chroma_h; switch (avctx->pix_fmt) { case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV422P: - if (s->width & 1) { + if (avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "Width must be even for this colorspace.\n"); return AVERROR(EINVAL); } @@ -310,13 +347,7 @@ } if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) { - if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { - av_log(avctx, AV_LOG_ERROR, - "Error: YV12 is not supported by huffyuv; use " - "vcodec=ffvhuff or format=422p\n"); - return AVERROR(EINVAL); - } - if (s->interlaced != ( s->height > 288 )) + if (s->interlaced != ( avctx->height > 288 )) av_log(avctx, AV_LOG_INFO, "using huffyuv 2.2.0 or newer interlacing flag\n"); } @@ -333,22 +364,22 @@ return AVERROR(EINVAL); } - ((uint8_t*)avctx->extradata)[0] = s->predictor | (s->decorrelate << 6); - ((uint8_t*)avctx->extradata)[2] = s->interlaced ? 0x10 : 0x20; + avctx->extradata[0] = s->predictor | (s->decorrelate << 6); + avctx->extradata[2] = s->interlaced ? 0x10 : 0x20; if (s->context) - ((uint8_t*)avctx->extradata)[2] |= 0x40; + avctx->extradata[2] |= 0x40; if (s->version < 3) { - ((uint8_t*)avctx->extradata)[1] = s->bitstream_bpp; - ((uint8_t*)avctx->extradata)[3] = 0; + avctx->extradata[1] = s->bitstream_bpp; + avctx->extradata[3] = 0; } else { - ((uint8_t*)avctx->extradata)[1] = ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2); + avctx->extradata[1] = ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2); if (s->chroma) - ((uint8_t*)avctx->extradata)[2] |= s->yuv ? 1 : 2; + avctx->extradata[2] |= s->yuv ? 1 : 2; if (s->alpha) - ((uint8_t*)avctx->extradata)[2] |= 4; - ((uint8_t*)avctx->extradata)[3] = 1; + avctx->extradata[2] |= 4; + avctx->extradata[3] = 1; } - s->avctx->extradata_size = 4; + avctx->extradata_size = 4; if (avctx->stats_in) { char *p = avctx->stats_in; @@ -378,14 +409,14 @@ } } - ret = store_huffman_tables(s, s->avctx->extradata + s->avctx->extradata_size); + ret = store_huffman_tables(s, avctx->extradata + avctx->extradata_size); if (ret < 0) return ret; - s->avctx->extradata_size += ret; + avctx->extradata_size += ret; if (s->context) { for (i = 0; i < 4; i++) { - int pels = s->width * s->height / (i ? 40 : 10); + int pels = avctx->width * avctx->height / (i ? 40 : 10); for (j = 0; j < s->vlc_n; j++) { int d = FFMIN(j, s->vlc_n - j); s->stats[i][j] = pels/(d*d + 1); @@ -397,16 +428,15 @@ s->stats[i][j]= 0; } - if (ff_huffyuv_alloc_temp(s)) { - ff_huffyuv_common_end(s); - return AVERROR(ENOMEM); - } + ret = ff_huffyuv_alloc_temp(s->temp, s->temp16, avctx->width); + if (ret < 0) + return ret; s->picture_number=0; return 0; } -static int encode_422_bitstream(HYuvContext *s, int offset, int count) +static int encode_422_bitstream(HYuvEncContext *s, int offset, int count) { int i; const uint8_t *y = s->temp[0] + offset; @@ -461,7 +491,7 @@ return 0; } -static int encode_plane_bitstream(HYuvContext *s, int width, int plane) +static int encode_plane_bitstream(HYuvEncContext *s, int width, int plane) { int i, count = width/2; @@ -623,7 +653,7 @@ return 0; } -static int encode_gray_bitstream(HYuvContext *s, int count) +static int encode_gray_bitstream(HYuvEncContext *s, int count) { int i; @@ -668,7 +698,7 @@ return 0; } -static inline int encode_bgra_bitstream(HYuvContext *s, int count, int planes) +static inline int encode_bgra_bitstream(HYuvEncContext *s, int count, int planes) { int i; @@ -721,10 +751,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - HYuvContext *s = avctx->priv_data; - const int width = s->width; - const int width2 = s->width>>1; - const int height = s->height; + HYuvEncContext *s = avctx->priv_data; + const int width = avctx->width; + const int width2 = avctx->width >> 1; + const int height = avctx->height; const int fake_ystride = s->interlaced ? pict->linesize[0]*2 : pict->linesize[0]; const int fake_ustride = s->interlaced ? pict->linesize[1]*2 : pict->linesize[1]; const int fake_vstride = s->interlaced ? pict->linesize[2]*2 : pict->linesize[2]; @@ -789,7 +819,7 @@ y++; cy++; for (; y < height; y++,cy++) { - uint8_t *ydst, *udst, *vdst; + const uint8_t *ydst, *udst, *vdst; if (s->bitstream_bpp == 12) { while (2 * cy > y) { @@ -812,7 +842,7 @@ } } else { for (cy = y = 1; y < height; y++, cy++) { - uint8_t *ydst, *udst, *vdst; + const uint8_t *ydst, *udst, *vdst; /* encode a luma only line & y++ */ if (s->bitstream_bpp == 12) { @@ -852,10 +882,9 @@ } } } else if(avctx->pix_fmt == AV_PIX_FMT_RGB32) { - uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; + const uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; - int y; int leftr, leftg, leftb, lefta; put_bits(&s->pb, 8, lefta = data[A]); @@ -867,8 +896,8 @@ &leftr, &leftg, &leftb, &lefta); encode_bgra_bitstream(s, width - 1, 4); - for (y = 1; y < s->height; y++) { - uint8_t *dst = data + y*stride; + for (int y = 1; y < height; y++) { + const uint8_t *dst = data + y*stride; if (s->predictor == PLANE && s->interlaced < y) { s->llvidencdsp.diff_bytes(s->temp[1], dst, dst - fake_stride, width * 4); sub_left_prediction_bgr32(s, s->temp[0], s->temp[1], width, @@ -880,10 +909,9 @@ encode_bgra_bitstream(s, width, 4); } } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) { - uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; + const uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; - int y; int leftr, leftg, leftb; put_bits(&s->pb, 8, leftr = data[0]); @@ -895,8 +923,8 @@ &leftr, &leftg, &leftb); encode_bgra_bitstream(s, width-1, 3); - for (y = 1; y < s->height; y++) { - uint8_t *dst = data + y * stride; + for (int y = 1; y < height; y++) { + const uint8_t *dst = data + y * stride; if (s->predictor == PLANE && s->interlaced < y) { s->llvidencdsp.diff_bytes(s->temp[1], dst, dst - fake_stride, width * 3); @@ -939,7 +967,7 @@ lefttop = p->data[plane][0]; for (; y < h; y++) { - uint8_t *dst = p->data[plane] + p->linesize[plane] * y; + const uint8_t *dst = p->data[plane] + p->linesize[plane] * y; sub_median_prediction(s, s->temp[0], dst - fake_stride, dst, w , &left, &lefttop); @@ -947,7 +975,7 @@ } } else { for (y = 1; y < h; y++) { - uint8_t *dst = p->data[plane] + p->linesize[plane] * y; + const uint8_t *dst = p->data[plane] + p->linesize[plane] * y; if (s->predictor == PLANE && s->interlaced < y) { diff_bytes(s, s->temp[1], dst, dst - fake_stride, w); @@ -1003,16 +1031,16 @@ static av_cold int encode_end(AVCodecContext *avctx) { - HYuvContext *s = avctx->priv_data; + HYuvEncContext *s = avctx->priv_data; - ff_huffyuv_common_end(s); + ff_huffyuv_common_end(s->temp, s->temp16); av_freep(&avctx->stats_out); return 0; } -#define OFFSET(x) offsetof(HYuvContext, x) +#define OFFSET(x) offsetof(HYuvEncContext, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define COMMON_OPTIONS \ @@ -1051,34 +1079,35 @@ const FFCodec ff_huffyuv_encoder = { .p.name = "huffyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), + CODEC_LONG_NAME("Huffyuv / HuffYUV"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HUFFYUV, - .priv_data_size = sizeof(HYuvContext), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(HYuvEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &normal_class, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #if CONFIG_FFVHUFF_ENCODER const FFCodec ff_ffvhuff_encoder = { .p.name = "ffvhuff", - .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), + CODEC_LONG_NAME("Huffyuv FFmpeg variant"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FFVHUFF, - .priv_data_size = sizeof(HYuvContext), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .priv_data_size = sizeof(HYuvEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &ff_class, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P, @@ -1097,7 +1126,6 @@ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -68,12 +68,12 @@ *left_top = lt; } -av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx) +av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { c->diff_int16 = diff_int16_c; c->sub_hfyu_median_pred_int16 = sub_hfyu_median_pred_int16_c; #if ARCH_X86 - ff_huffyuvencdsp_init_x86(c, avctx); + ff_huffyuvencdsp_init_x86(c, pix_fmt); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuvencdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include -#include "avcodec.h" +#include "libavutil/pixfmt.h" typedef struct HuffYUVEncDSPContext { void (*diff_int16)(uint16_t *dst /* align 16 */, @@ -34,7 +34,7 @@ int w, int *left, int *left_top); } HuffYUVEncDSPContext; -void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx); -void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx); +void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); +void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); #endif /* AVCODEC_HUFFYUVENCDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/huffyuv.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,7 +1,7 @@ /* * Copyright (c) 2002-2014 Michael Niedermayer * - * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of + * see https://multimedia.cx/huffyuv.txt for a description of * the algorithm used * * This file is part of FFmpeg. @@ -31,16 +31,19 @@ #include -#include "avcodec.h" -#include "bswapdsp.h" -#include "get_bits.h" -#include "huffyuvdsp.h" -#include "huffyuvencdsp.h" -#include "put_bits.h" -#include "lossless_videodsp.h" -#include "lossless_videoencdsp.h" +#include "config.h" -#define VLC_BITS 12 +#if HAVE_BIGENDIAN +#define B 3 +#define G 2 +#define R 1 +#define A 0 +#else +#define B 0 +#define G 1 +#define R 2 +#define A 3 +#endif #define MAX_BITS 16 #define MAX_N (1< -#include +#include #include #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #include "libavutil/internal.h" #define HUFFMAN_TABLE_SIZE 64 * 1024 @@ -243,7 +241,7 @@ const FFCodec ff_idcin_decoder = { .p.name = "idcinvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"), + CODEC_LONG_NAME("id Quake II CIN video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IDCIN, .priv_data_size = sizeof(IdcinContext), @@ -251,5 +249,4 @@ FF_CODEC_DECODE_CB(idcin_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .defaults = idcin_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,24 +27,12 @@ #include "simple_idct.h" #include "xvididct.h" -av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st, - const uint8_t *src_scantable) +av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], + const uint8_t permutation[64]) { - int i, end; - - st->scantable = src_scantable; - - for (i = 0; i < 64; i++) { - int j = src_scantable[i]; - st->permutated[i] = permutation[j]; - } - - end = -1; - for (i = 0; i < 64; i++) { - int j = st->permutated[i]; - if (j > end) - end = j; - st->raster_end[i] = end; + for (int i = 0; i < 64; i++) { + int j = src[i]; + dst[i] = permutation[j]; } } @@ -312,6 +300,8 @@ ff_idctdsp_init_arm(c, avctx, high_bit_depth); #elif ARCH_PPC ff_idctdsp_init_ppc(c, avctx, high_bit_depth); +#elif ARCH_RISCV + ff_idctdsp_init_riscv(c, avctx, high_bit_depth); #elif ARCH_X86 ff_idctdsp_init_x86(c, avctx, high_bit_depth); #elif ARCH_MIPS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/idctdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,15 +25,6 @@ #include "avcodec.h" -/** - * Scantable. - */ -typedef struct ScanTable { - const uint8_t *scantable; - uint8_t permutated[64]; - uint8_t raster_end[64]; -} ScanTable; - enum idct_permutation_type { FF_IDCT_PERM_NONE, FF_IDCT_PERM_LIBMPEG2, @@ -43,8 +34,8 @@ FF_IDCT_PERM_SSE2, }; -void ff_init_scantable(const uint8_t *permutation, ScanTable *st, - const uint8_t *src_scantable); +void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], + const uint8_t permutation[64]); void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type); int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, @@ -114,6 +105,8 @@ unsigned high_bit_depth); void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); +void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/iff.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/iff.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/iff.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/iff.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,8 +33,7 @@ #include "bytestream.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" -#include "mathops.h" +#include "decode.h" // TODO: masking bits typedef enum { @@ -45,7 +44,6 @@ } mask_type; typedef struct IffContext { - AVFrame *frame; int planesize; uint8_t * planebuf; uint8_t * ham_buf; ///< temporary buffer for planar to chunky conversation @@ -63,7 +61,6 @@ unsigned masking; ///< TODO: masking method used int init; // 1 if buffer and palette data already initialized, 0 otherwise int16_t tvdc[16]; ///< TVDC lookup table - GetByteContext gb; uint8_t *video[2]; unsigned video_size; uint32_t *pal; @@ -154,9 +151,10 @@ static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) { IffContext *s = avctx->priv_data; - int count, i; + unsigned count, i; const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata); - int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); + /* extract_header() already checked that the RHS is >= 0. */ + unsigned palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); if (avctx->bits_per_coded_sample > 8) { av_log(avctx, AV_LOG_ERROR, "bits_per_coded_sample > 8 not supported\n"); @@ -199,183 +197,123 @@ * decoder structures. * * @param avctx the AVCodecContext where to extract extra context to - * @param avpkt the AVPacket to extract extra context from or NULL to use avctx * @return >= 0 in case of success, a negative error code otherwise */ static int extract_header(AVCodecContext *const avctx, - const AVPacket *const avpkt) + const uint8_t *const extradata, int extradata_size) { IffContext *s = avctx->priv_data; - const uint8_t *buf; + const uint8_t *buf = extradata; unsigned buf_size = 0; - int i, palette_size; + int palette_size; - if (avctx->extradata_size < 2) { + if (extradata_size < 2) { av_log(avctx, AV_LOG_ERROR, "not enough extradata\n"); return AVERROR_INVALIDDATA; } - palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); + palette_size = extradata_size - AV_RB16(extradata); - if (avpkt && avctx->codec_tag == MKTAG('A', 'N', 'I', 'M')) { - uint32_t chunk_id; - uint64_t data_size; - GetByteContext *gb = &s->gb; - - bytestream2_skip(gb, 4); - while (bytestream2_get_bytes_left(gb) >= 1) { - chunk_id = bytestream2_get_le32(gb); - data_size = bytestream2_get_be32(gb); - - if (chunk_id == MKTAG('B', 'M', 'H', 'D')) { - bytestream2_skip(gb, data_size + (data_size & 1)); - } else if (chunk_id == MKTAG('A', 'N', 'H', 'D')) { - unsigned extra; - if (data_size < 40) - return AVERROR_INVALIDDATA; - - s->compression = (bytestream2_get_byte(gb) << 8) | (s->compression & 0xFF); - bytestream2_skip(gb, 19); - extra = bytestream2_get_be32(gb); - s->is_short = !(extra & 1); - s->is_brush = extra == 2; - s->is_interlaced = !!(extra & 0x40); - data_size -= 24; - bytestream2_skip(gb, data_size + (data_size & 1)); - } else if (chunk_id == MKTAG('D', 'L', 'T', 'A') || - chunk_id == MKTAG('B', 'O', 'D', 'Y')) { - if (chunk_id == MKTAG('B','O','D','Y')) - s->compression &= 0xFF; - break; - } else if (chunk_id == MKTAG('C', 'M', 'A', 'P')) { - int count = data_size / 3; - uint32_t *pal = s->pal; - - if (count > 256) - return AVERROR_INVALIDDATA; - if (s->ham) { - for (i = 0; i < count; i++) - pal[i] = 0xFF000000 | bytestream2_get_le24(gb); - } else { - for (i = 0; i < count; i++) - pal[i] = 0xFF000000 | bytestream2_get_be24(gb); - } - bytestream2_skip(gb, data_size & 1); - } else { - bytestream2_skip(gb, data_size + (data_size&1)); - } - } - } else if (!avpkt) { - buf = avctx->extradata; - buf_size = bytestream_get_be16(&buf); - if (buf_size <= 1 || palette_size < 0) { - av_log(avctx, AV_LOG_ERROR, - "Invalid palette size received: %u -> palette data offset: %d\n", - buf_size, palette_size); - return AVERROR_INVALIDDATA; - } + buf_size = bytestream_get_be16(&buf); + if (buf_size <= 1 || palette_size < 0) { + av_log(avctx, AV_LOG_ERROR, + "Invalid palette size received: %u -> palette data offset: %d\n", + buf_size, palette_size); + return AVERROR_INVALIDDATA; } - if (buf_size >= 41) { - s->compression = bytestream_get_byte(&buf); - s->bpp = bytestream_get_byte(&buf); - s->ham = bytestream_get_byte(&buf); - s->flags = bytestream_get_byte(&buf); - s->transparency = bytestream_get_be16(&buf); - s->masking = bytestream_get_byte(&buf); - for (i = 0; i < 16; i++) - s->tvdc[i] = bytestream_get_be16(&buf); - - if (s->ham) { - if (s->bpp > 8) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham); - return AVERROR_INVALIDDATA; - } else if (s->ham != (s->bpp > 6 ? 6 : 4)) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u, BPP: %u\n", s->ham, s->bpp); - return AVERROR_INVALIDDATA; - } - } + if (buf_size < 41) + return 0; - if (s->masking == MASK_HAS_MASK) { - if (s->bpp >= 8 && !s->ham) { - avctx->pix_fmt = AV_PIX_FMT_RGB32; - av_freep(&s->mask_buf); - av_freep(&s->mask_palbuf); - if (s->bpp > 16) { - av_log(avctx, AV_LOG_ERROR, "bpp %d too large for palette\n", s->bpp); - return AVERROR(ENOMEM); - } - s->mask_buf = av_malloc((s->planesize * 32) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->mask_buf) - return AVERROR(ENOMEM); - s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->mask_palbuf) { - av_freep(&s->mask_buf); - return AVERROR(ENOMEM); - } - } - s->bpp++; - } else if (s->masking != MASK_NONE && s->masking != MASK_HAS_TRANSPARENT_COLOR) { - av_log(avctx, AV_LOG_ERROR, "Masking not supported\n"); - return AVERROR_PATCHWELCOME; - } - if (!s->bpp || s->bpp > 32) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of bitplanes: %u\n", s->bpp); + s->compression = bytestream_get_byte(&buf); + s->bpp = bytestream_get_byte(&buf); + s->ham = bytestream_get_byte(&buf); + s->flags = bytestream_get_byte(&buf); + s->transparency = bytestream_get_be16(&buf); + s->masking = bytestream_get_byte(&buf); + for (int i = 0; i < 16; i++) + s->tvdc[i] = bytestream_get_be16(&buf); + + if (s->ham) { + if (s->bpp > 8) { + av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham); return AVERROR_INVALIDDATA; - } - if (s->video_size && s->planesize * s->bpp * avctx->height > s->video_size) + } else if (s->ham != (s->bpp > 6 ? 6 : 4)) { + av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u, BPP: %u\n", s->ham, s->bpp); return AVERROR_INVALIDDATA; + } + } - av_freep(&s->ham_buf); - av_freep(&s->ham_palbuf); + if (s->masking == MASK_HAS_MASK) { + if (s->bpp >= 8 && !s->ham) { + avctx->pix_fmt = AV_PIX_FMT_RGB32; + if (s->bpp > 16) { + av_log(avctx, AV_LOG_ERROR, "bpp %d too large for palette\n", s->bpp); + return AVERROR(ENOMEM); + } + s->mask_buf = av_malloc((s->planesize * 32) + AV_INPUT_BUFFER_PADDING_SIZE); + if (!s->mask_buf) + return AVERROR(ENOMEM); + s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); + if (!s->mask_palbuf) + return AVERROR(ENOMEM); + } + s->bpp++; + } else if (s->masking != MASK_NONE && s->masking != MASK_HAS_TRANSPARENT_COLOR) { + av_log(avctx, AV_LOG_ERROR, "Masking not supported\n"); + return AVERROR_PATCHWELCOME; + } + if (!s->bpp || s->bpp > 32) { + av_log(avctx, AV_LOG_ERROR, "Invalid number of bitplanes: %u\n", s->bpp); + return AVERROR_INVALIDDATA; + } + if (s->video_size && s->planesize * s->bpp * avctx->height > s->video_size) + return AVERROR_INVALIDDATA; - if (s->ham) { - int i, count = FFMIN(palette_size / 3, 1 << s->ham); - int ham_count; - const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata); - int extra_space = 1; + if (s->ham) { + int count = FFMIN(palette_size / 3, 1 << s->ham); + int ham_count; + const uint8_t *const palette = extradata + AV_RB16(extradata); + int extra_space = 1; - if (avctx->codec_tag == MKTAG('P', 'B', 'M', ' ') && s->ham == 4) - extra_space = 4; + if (avctx->codec_tag == MKTAG('P', 'B', 'M', ' ') && s->ham == 4) + extra_space = 4; - s->ham_buf = av_malloc((s->planesize * 8) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->ham_buf) - return AVERROR(ENOMEM); + s->ham_buf = av_malloc((s->planesize * 8) + AV_INPUT_BUFFER_PADDING_SIZE); + if (!s->ham_buf) + return AVERROR(ENOMEM); - ham_count = 8 * (1 << s->ham); - s->ham_palbuf = av_malloc(extra_space * (ham_count << !!(s->masking == MASK_HAS_MASK)) * sizeof (uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->ham_palbuf) { - av_freep(&s->ham_buf); - return AVERROR(ENOMEM); - } + ham_count = 8 * (1 << s->ham); + s->ham_palbuf = av_malloc(extra_space * (ham_count << !!(s->masking == MASK_HAS_MASK)) * sizeof (uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); + if (!s->ham_palbuf) + return AVERROR(ENOMEM); - if (count) { // HAM with color palette attached - // prefill with black and palette and set HAM take direct value mask to zero - memset(s->ham_palbuf, 0, (1 << s->ham) * 2 * sizeof (uint32_t)); - for (i=0; i < count; i++) { - s->ham_palbuf[i*2+1] = 0xFF000000 | AV_RL24(palette + i*3); - } - count = 1 << s->ham; - } else { // HAM with grayscale color palette - count = 1 << s->ham; - for (i=0; i < count; i++) { - s->ham_palbuf[i*2] = 0xFF000000; // take direct color value from palette - s->ham_palbuf[i*2+1] = 0xFF000000 | av_le2ne32(gray2rgb((i * 255) >> s->ham)); - } - } - for (i=0; i < count; i++) { - uint32_t tmp = i << (8 - s->ham); - tmp |= tmp >> s->ham; - s->ham_palbuf[(i+count)*2] = 0xFF00FFFF; // just modify blue color component - s->ham_palbuf[(i+count*2)*2] = 0xFFFFFF00; // just modify red color component - s->ham_palbuf[(i+count*3)*2] = 0xFFFF00FF; // just modify green color component - s->ham_palbuf[(i+count)*2+1] = 0xFF000000 | tmp << 16; - s->ham_palbuf[(i+count*2)*2+1] = 0xFF000000 | tmp; - s->ham_palbuf[(i+count*3)*2+1] = 0xFF000000 | tmp << 8; - } - if (s->masking == MASK_HAS_MASK) { - for (i = 0; i < ham_count; i++) - s->ham_palbuf[(1 << s->bpp) + i] = s->ham_palbuf[i] | 0xFF000000; - } + if (count) { // HAM with color palette attached + // prefill with black and palette and set HAM take direct value mask to zero + memset(s->ham_palbuf, 0, (1 << s->ham) * 2 * sizeof (uint32_t)); + for (int i = 0; i < count; i++) { + s->ham_palbuf[i*2+1] = 0xFF000000 | AV_RL24(palette + i*3); + } + count = 1 << s->ham; + } else { // HAM with grayscale color palette + count = 1 << s->ham; + for (int i = 0; i < count; i++) { + s->ham_palbuf[i*2] = 0xFF000000; // take direct color value from palette + s->ham_palbuf[i*2+1] = 0xFF000000 | av_le2ne32(gray2rgb((i * 255) >> s->ham)); + } + } + for (int i = 0; i < count; i++) { + uint32_t tmp = i << (8 - s->ham); + tmp |= tmp >> s->ham; + s->ham_palbuf[(i+count)*2] = 0xFF00FFFF; // just modify blue color component + s->ham_palbuf[(i+count*2)*2] = 0xFFFFFF00; // just modify red color component + s->ham_palbuf[(i+count*3)*2] = 0xFFFF00FF; // just modify green color component + s->ham_palbuf[(i+count)*2+1] = 0xFF000000 | tmp << 16; + s->ham_palbuf[(i+count*2)*2+1] = 0xFF000000 | tmp; + s->ham_palbuf[(i+count*3)*2+1] = 0xFF000000 | tmp << 8; + } + if (s->masking == MASK_HAS_MASK) { + for (int i = 0; i < ham_count; i++) + s->ham_palbuf[(1 << s->bpp) + i] = s->ham_palbuf[i] | 0xFF000000; } } @@ -449,7 +387,8 @@ return AVERROR(ENOMEM); } - if ((err = extract_header(avctx, NULL)) < 0) + err = extract_header(avctx, avctx->extradata, avctx->extradata_size); + if (err < 0) return err; return 0; @@ -1525,6 +1464,61 @@ return AVERROR_INVALIDDATA; } +static int parse_packet_header(AVCodecContext *const avctx, + GetByteContext *gb) +{ + IffContext *s = avctx->priv_data; + + if (avctx->codec_tag != MKTAG('A', 'N', 'I', 'M')) + return 0; + + bytestream2_skip(gb, 4); + while (bytestream2_get_bytes_left(gb) >= 1) { + uint32_t chunk_id = bytestream2_get_le32(gb); + uint64_t data_size = bytestream2_get_be32(gb); + + if (chunk_id == MKTAG('B', 'M', 'H', 'D')) { + bytestream2_skip(gb, data_size + (data_size & 1)); + } else if (chunk_id == MKTAG('A', 'N', 'H', 'D')) { + unsigned extra; + if (data_size < 40) + return AVERROR_INVALIDDATA; + + s->compression = (bytestream2_get_byte(gb) << 8) | (s->compression & 0xFF); + bytestream2_skip(gb, 19); + extra = bytestream2_get_be32(gb); + s->is_short = !(extra & 1); + s->is_brush = extra == 2; + s->is_interlaced = !!(extra & 0x40); + data_size -= 24; + bytestream2_skip(gb, data_size + (data_size & 1)); + } else if (chunk_id == MKTAG('D', 'L', 'T', 'A') || + chunk_id == MKTAG('B', 'O', 'D', 'Y')) { + if (chunk_id == MKTAG('B','O','D','Y')) + s->compression &= 0xFF; + break; + } else if (chunk_id == MKTAG('C', 'M', 'A', 'P')) { + int count = data_size / 3; + uint32_t *pal = s->pal; + + if (count > 256) + return AVERROR_INVALIDDATA; + if (s->ham) { + for (int i = 0; i < count; i++) + pal[i] = 0xFF000000 | bytestream2_get_le24(gb); + } else { + for (int i = 0; i < count; i++) + pal[i] = 0xFF000000 | bytestream2_get_be24(gb); + } + bytestream2_skip(gb, data_size & 1); + } else { + bytestream2_skip(gb, data_size + (data_size&1)); + } + } + + return 0; +} + static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { @@ -1533,17 +1527,16 @@ int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; int y, plane, res; - GetByteContext *gb = &s->gb; + GetByteContext gb0, *const gb = &gb0; const AVPixFmtDescriptor *desc; bytestream2_init(gb, avpkt->data, avpkt->size); - if ((res = extract_header(avctx, avpkt)) < 0) + if ((res = parse_packet_header(avctx, gb)) < 0) return res; if ((res = ff_get_buffer(avctx, frame, 0)) < 0) return res; - s->frame = frame; buf += bytestream2_tell(gb); buf_size -= bytestream2_tell(gb); @@ -1562,7 +1555,7 @@ if (s->compression <= 0xff && (avctx->codec_tag == MKTAG('A', 'N', 'I', 'M'))) { if (avctx->pix_fmt == AV_PIX_FMT_PAL8) - memcpy(s->pal, s->frame->data[1], 256 * 4); + memcpy(s->pal, frame->data[1], 256 * 4); } switch (s->compression) { @@ -1908,7 +1901,7 @@ const FFCodec ff_iff_ilbm_decoder = { .p.name = "iff", - .p.long_name = NULL_IF_CONFIG_SMALL("IFF ACBM/ANIM/DEEP/ILBM/PBM/RGB8/RGBN"), + CODEC_LONG_NAME("IFF ACBM/ANIM/DEEP/ILBM/PBM/RGB8/RGBN"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IFF_ILBM, .priv_data_size = sizeof(IffContext), @@ -1916,5 +1909,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ilbcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ilbcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ilbcdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ilbcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "ilbcdata.h" @@ -91,7 +91,6 @@ int enhancer; int mode; - GetBitContext gb; ILBCFrame frame; int prev_enh_pl; @@ -127,11 +126,14 @@ int16_t hpimemy[4]; } ILBCContext; -static int unpack_frame(ILBCContext *s) +static int unpack_frame(ILBCContext *s, const uint8_t *buf, int size) { ILBCFrame *frame = &s->frame; - GetBitContext *gb = &s->gb; - int j; + GetBitContext gb0, *const gb = &gb0; + int j, ret; + + if ((ret = init_get_bits8(gb, buf, size)) < 0) + return ret; frame->lsf[0] = get_bits(gb, 6); frame->lsf[1] = get_bits(gb, 7); @@ -331,8 +333,8 @@ } } -static void lsf_interpolate(int16_t *out, int16_t *in1, - int16_t *in2, int16_t coef, +static void lsf_interpolate(int16_t *out, const int16_t *in1, + const int16_t *in2, int16_t coef, int size) { int invcoef = 16384 - coef, i; @@ -341,7 +343,7 @@ out[i] = (coef * in1[i] + invcoef * in2[i] + 8192) >> 14; } -static void lsf2lsp(int16_t *lsf, int16_t *lsp, int order) +static void lsf2lsp(const int16_t *lsf, int16_t *lsp, int order) { int16_t diff, freq; int32_t tmp; @@ -364,7 +366,7 @@ } } -static void get_lsp_poly(int16_t *lsp, int32_t *f) +static void get_lsp_poly(const int16_t *lsp, int32_t *f) { int16_t high, low; int i, j, k, l; @@ -391,7 +393,7 @@ } } -static void lsf2poly(int16_t *a, int16_t *lsf) +static void lsf2poly(int16_t *a, const int16_t *lsf) { int32_t f[2][6]; int16_t lsp[10]; @@ -418,8 +420,8 @@ } } -static void lsp_interpolate2polydec(int16_t *a, int16_t *lsf1, - int16_t *lsf2, int coef, int length) +static void lsp_interpolate2polydec(int16_t *a, const int16_t *lsf1, + const int16_t *lsf2, int coef, int length) { int16_t lsftmp[LPC_FILTERORDER]; @@ -437,13 +439,13 @@ } static void lsp_interpolate(int16_t *syntdenum, int16_t *weightdenum, - int16_t *lsfdeq, int16_t length, + const int16_t *lsfdeq, int16_t length, ILBCContext *s) { - int16_t lp[LPC_FILTERORDER + 1], *lsfdeq2; + int16_t lp[LPC_FILTERORDER + 1]; + const int16_t *const lsfdeq2 = lsfdeq + length; int i, pos, lp_length; - lsfdeq2 = lsfdeq + length; lp_length = length + 1; if (s->mode == 30) { @@ -478,8 +480,8 @@ } } -static void filter_mafq12(int16_t *in_ptr, int16_t *out_ptr, - int16_t *B, int16_t B_length, +static void filter_mafq12(const int16_t *in_ptr, int16_t *out_ptr, + const int16_t *B, int16_t B_length, int16_t length) { int o, i, j; @@ -520,13 +522,14 @@ } } -static void state_construct(int16_t ifm, int16_t *idx, - int16_t *synt_denum, int16_t *Out_fix, +static void state_construct(int16_t ifm, const int16_t *idx, + const int16_t *synt_denum, int16_t *Out_fix, int16_t len) { int k; int16_t maxVal; - int16_t *tmp1, *tmp2, *tmp3; + int16_t *tmp1, *tmp3; + const int16_t *tmp2; /* Stack based */ int16_t numerator[1 + LPC_FILTERORDER]; int16_t sampleValVec[2 * STATE_SHORT_LEN_30MS + LPC_FILTERORDER]; @@ -630,7 +633,7 @@ out[i] = (in1[i] + in2[i]) >> shift; } -static void create_augmented_vector(int index, int16_t *buffer, int16_t *cbVec) +static void create_augmented_vector(int index, const int16_t *buffer, int16_t *cbVec) { int16_t cbVecTmp[4]; int interpolation_length = FFMIN(4, index); @@ -696,7 +699,7 @@ /* do filtering to get the codebook vector */ - filter_mafq12(&mem[memIndTest + 4], cbvec, (int16_t *) kCbFiltersRev, CB_FILTERLEN, cbveclen); + filter_mafq12(&mem[memIndTest + 4], cbvec, kCbFiltersRev, CB_FILTERLEN, cbveclen); } else { /* interpolated vectors */ /* Stuff zeros outside memory buffer */ @@ -704,7 +707,7 @@ memset(mem + lMem, 0, CB_HALFFILTERLEN * 2); /* do filtering */ - filter_mafq12(&mem[memIndTest + 7], tempbuff2, (int16_t *) kCbFiltersRev, CB_FILTERLEN, (int16_t) (cbveclen + 5)); + filter_mafq12(&mem[memIndTest + 7], tempbuff2, kCbFiltersRev, CB_FILTERLEN, (int16_t) (cbveclen + 5)); /* Calculate lag index */ lag = (cbveclen << 1) - 20 + index - base_size - lMem - 1; @@ -716,8 +719,8 @@ static void construct_vector ( int16_t *decvector, /* (o) Decoded vector */ - int16_t *index, /* (i) Codebook indices */ - int16_t *gain_index, /* (i) Gain quantization indices */ + const int16_t *index, /* (i) Codebook indices */ + const int16_t *gain_index, /* (i) Gain quantization indices */ int16_t *mem, /* (i) Buffer for codevector construction */ int16_t lMem, /* (i) Length of buffer */ int16_t veclen) @@ -753,10 +756,10 @@ } } -static void reverse_memcpy(int16_t *dest, int16_t *source, int length) +static void reverse_memcpy(int16_t *dest, const int16_t *source, int length) { int16_t* destPtr = dest; - int16_t* sourcePtr = source; + const int16_t *sourcePtr = source; int j; for (j = 0; j < length; j++) @@ -766,7 +769,7 @@ static void decode_residual(ILBCContext *s, ILBCFrame *encbits, int16_t *decresidual, - int16_t *syntdenum) + const int16_t *syntdenum) { int16_t meml_gotten, Nfor, Nback, diff, start_pos; int16_t subcount, subframe; @@ -911,12 +914,10 @@ return av_clipl_int32(sum); } -static void correlation(int32_t *corr, int32_t *ener, int16_t *buffer, +static void correlation(int32_t *corr, int32_t *ener, const int16_t *buffer, int16_t lag, int16_t blen, int16_t srange, int16_t scale) { - int16_t *w16ptr; - - w16ptr = &buffer[blen - srange - lag]; + const int16_t *w16ptr = &buffer[blen - srange - lag]; *corr = scale_dot_product(&buffer[blen - srange], w16ptr, srange, scale); *ener = scale_dot_product(w16ptr, w16ptr, srange, scale); @@ -952,8 +953,8 @@ int16_t *plc_lpc, /* (o) concealed LP parameters */ int16_t PLI, /* (i) packet loss indicator 0 - no PL, 1 = PL */ - int16_t *decresidual, /* (i) decoded residual */ - int16_t *lpc, /* (i) decoded LPC (only used for no PL) */ + const int16_t *decresidual, /* (i) decoded residual */ + const int16_t *lpc, /* (i) decoded LPC (only used for no PL) */ int16_t inlag, /* (i) pitch lag */ ILBCContext *s) /* (i/o) decoder instance */ { @@ -1202,7 +1203,7 @@ return; } -static int xcorr_coeff(int16_t *target, int16_t *regressor, +static int xcorr_coeff(const int16_t *target, const int16_t *regressor, int16_t subl, int16_t searchLen, int16_t offset, int16_t step) { @@ -1213,8 +1214,8 @@ int16_t cross_corr_sg_mod, cross_corr_sg_mod_max; int32_t cross_corr, energy; int16_t cross_corr_mod, energy_mod, enery_mod_max; - int16_t *tp, *rp; - int16_t *rp_beg, *rp_end; + const int16_t *rp; + const int16_t *rp_beg, *rp_end; int16_t totscale, totscale_max; int16_t scalediff; int32_t new_crit, max_crit; @@ -1253,10 +1254,9 @@ energy = scale_dot_product(regressor, regressor, subl, shifts); for (k = 0; k < searchLen; k++) { - tp = target; rp = ®ressor[pos]; - cross_corr = scale_dot_product(tp, rp, subl, shifts); + cross_corr = scale_dot_product(target, rp, subl, shifts); if ((energy > 0) && (cross_corr > 0)) { /* Put cross correlation and energy on 16 bit word */ @@ -1359,21 +1359,21 @@ static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; ILBCContext *s = avctx->priv_data; int mode = s->mode, ret; int16_t *plc_data = &s->plc_residual[LPC_FILTERORDER]; - if ((ret = init_get_bits8(&s->gb, buf, avpkt->size)) < 0) - return ret; memset(&s->frame, 0, sizeof(ILBCFrame)); + ret = unpack_frame(s, avpkt->data, avpkt->size); + if (ret < 0) + return ret; + if (ret) + mode = 0; frame->nb_samples = s->block_samples; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - if (unpack_frame(s)) - mode = 0; if (s->frame.start < 1 || s->frame.start > 5) mode = 0; @@ -1480,12 +1480,11 @@ const FFCodec ff_ilbc_decoder = { .p.name = "ilbc", - .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + CODEC_LONG_NAME("iLBC (Internet Low Bitrate Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ILBC, .init = ilbc_decode_init, FF_CODEC_DECODE_CB(ilbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(ILBCContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,6 @@ #include #include -#include #include "libavutil/channel_layout.h" #include "libavutil/ffmath.h" @@ -41,13 +40,13 @@ #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "fft.h" -#include "internal.h" #include "sinewin.h" #include "imcdata.h" @@ -65,7 +64,7 @@ float flcoeffs4[BANDS]; float flcoeffs5[BANDS]; float flcoeffs6[BANDS]; - float CWdecoded[COEFFS]; + DECLARE_ALIGNED(32, float, CWdecoded)[COEFFS]; int bandWidthT[BANDS]; ///< codewords per band int bitsBandT[BANDS]; ///< how many bits per codeword in band @@ -79,31 +78,25 @@ int skipFlags[COEFFS]; ///< skip coefficient decoding or not int codewords[COEFFS]; ///< raw codewords read from bitstream - float last_fft_im[COEFFS]; - int decoder_reset; + DECLARE_ALIGNED(32, float, prev_win)[128]; } IMCChannel; typedef struct IMCContext { IMCChannel chctx[2]; /** MDCT tables */ - //@{ - float mdct_sine_window[COEFFS]; - float post_cos[COEFFS]; - float post_sin[COEFFS]; - float pre_coef1[COEFFS]; - float pre_coef2[COEFFS]; - //@} + DECLARE_ALIGNED(32, float, mdct_sine_window)[COEFFS]; float sqrt_tab[30]; GetBitContext gb; + AVFloatDSPContext *fdsp; BswapDSPContext bdsp; - void (*butterflies_float)(float *av_restrict v1, float *av_restrict v2, int len); - FFTContext fft; - DECLARE_ALIGNED(32, FFTComplex, samples)[COEFFS / 2]; + AVTXContext *mdct; + av_tx_fn mdct_fn; float *out_samples; + DECLARE_ALIGNED(32, float, temp)[256]; int coef0_pos; @@ -197,8 +190,7 @@ int i, j, ret; IMCContext *q = avctx->priv_data; static AVOnce init_static_once = AV_ONCE_INIT; - AVFloatDSPContext *fdsp; - double r1, r2; + float scale = 1.0f / (16384); if (avctx->codec_id == AV_CODEC_ID_IAC && avctx->sample_rate > 96000) { av_log(avctx, AV_LOG_ERROR, @@ -223,33 +215,14 @@ for (i = 0; i < BANDS; i++) q->chctx[j].old_floor[i] = 1.0; - - for (i = 0; i < COEFFS / 2; i++) - q->chctx[j].last_fft_im[i] = 0; } /* Build mdct window, a simple sine window normalized with sqrt(2) */ ff_sine_window_init(q->mdct_sine_window, COEFFS); for (i = 0; i < COEFFS; i++) q->mdct_sine_window[i] *= sqrt(2.0); - for (i = 0; i < COEFFS / 2; i++) { - q->post_cos[i] = (1.0f / 32768) * cos(i / 256.0 * M_PI); - q->post_sin[i] = (1.0f / 32768) * sin(i / 256.0 * M_PI); - - r1 = sin((i * 4.0 + 1.0) / 1024.0 * M_PI); - r2 = cos((i * 4.0 + 1.0) / 1024.0 * M_PI); - - if (i & 0x1) { - q->pre_coef1[i] = (r1 + r2) * sqrt(2.0); - q->pre_coef2[i] = -(r1 - r2) * sqrt(2.0); - } else { - q->pre_coef1[i] = -(r1 + r2) * sqrt(2.0); - q->pre_coef2[i] = (r1 - r2) * sqrt(2.0); - } - } /* Generate a square root table */ - for (i = 0; i < 30; i++) q->sqrt_tab[i] = sqrt(i); @@ -262,15 +235,14 @@ memcpy(q->weights2, imc_weights2, sizeof(imc_weights2)); } - fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); - if (!fdsp) + q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); + if (!q->fdsp) return AVERROR(ENOMEM); - q->butterflies_float = fdsp->butterflies_float; - av_free(fdsp); - if ((ret = ff_fft_init(&q->fft, 7, 1))) { - av_log(avctx, AV_LOG_INFO, "FFT init failed\n"); + + ret = av_tx_init(&q->mdct, &q->mdct_fn, AV_TX_FLOAT_MDCT, 1, COEFFS, &scale, 0); + if (ret < 0) return ret; - } + ff_bswapdsp_init(&q->bdsp); avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; @@ -727,39 +699,6 @@ } } -static void imc_imdct256(IMCContext *q, IMCChannel *chctx, int channels) -{ - int i; - float re, im; - float *dst1 = q->out_samples; - float *dst2 = q->out_samples + (COEFFS - 1); - - /* prerotation */ - for (i = 0; i < COEFFS / 2; i++) { - q->samples[i].re = -(q->pre_coef1[i] * chctx->CWdecoded[COEFFS - 1 - i * 2]) - - (q->pre_coef2[i] * chctx->CWdecoded[i * 2]); - q->samples[i].im = (q->pre_coef2[i] * chctx->CWdecoded[COEFFS - 1 - i * 2]) - - (q->pre_coef1[i] * chctx->CWdecoded[i * 2]); - } - - /* FFT */ - q->fft.fft_permute(&q->fft, q->samples); - q->fft.fft_calc(&q->fft, q->samples); - - /* postrotation, window and reorder */ - for (i = 0; i < COEFFS / 2; i++) { - re = ( q->samples[i].re * q->post_cos[i]) + (-q->samples[i].im * q->post_sin[i]); - im = (-q->samples[i].im * q->post_cos[i]) - ( q->samples[i].re * q->post_sin[i]); - *dst1 = (q->mdct_sine_window[COEFFS - 1 - i * 2] * chctx->last_fft_im[i]) - + (q->mdct_sine_window[i * 2] * re); - *dst2 = (q->mdct_sine_window[i * 2] * chctx->last_fft_im[i]) - - (q->mdct_sine_window[COEFFS - 1 - i * 2] * re); - dst1 += 2; - dst2 -= 2; - chctx->last_fft_im[i] = im; - } -} - static int inverse_quant_coeff(IMCContext *q, IMCChannel *chctx, int stream_format_code) { @@ -1013,7 +952,10 @@ memset(chctx->skipFlags, 0, sizeof(chctx->skipFlags)); - imc_imdct256(q, chctx, avctx->ch_layout.nb_channels); + q->mdct_fn(q->mdct, q->temp, chctx->CWdecoded, sizeof(float)); + q->fdsp->vector_fmul_window(q->out_samples, chctx->prev_win, q->temp, + q->mdct_sine_window, 128); + memcpy(chctx->prev_win, q->temp + 128, sizeof(float)*128); return 0; } @@ -1055,8 +997,8 @@ } if (avctx->ch_layout.nb_channels == 2) { - q->butterflies_float((float *)frame->extended_data[0], - (float *)frame->extended_data[1], COEFFS); + q->fdsp->butterflies_float((float *)frame->extended_data[0], + (float *)frame->extended_data[1], COEFFS); } *got_frame_ptr = 1; @@ -1068,7 +1010,8 @@ { IMCContext *q = avctx->priv_data; - ff_fft_end(&q->fft); + av_free(q->fdsp); + av_tx_uninit(&q->mdct); return 0; } @@ -1084,7 +1027,7 @@ #if CONFIG_IMC_DECODER const FFCodec ff_imc_decoder = { .p.name = "imc", - .p.long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"), + CODEC_LONG_NAME("IMC (Intel Music Coder)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_IMC, .priv_data_size = sizeof(IMCContext), @@ -1095,13 +1038,12 @@ .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_THREADSAFE, }; #endif #if CONFIG_IAC_DECODER const FFCodec ff_iac_decoder = { .p.name = "iac", - .p.long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"), + CODEC_LONG_NAME("IAC (Indeo Audio Coder)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_IAC, .priv_data_size = sizeof(IMCContext), @@ -1112,6 +1054,5 @@ .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_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm4.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include +#include #include #include "libavutil/mem_internal.h" @@ -30,10 +29,10 @@ #include "avcodec.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "copy_block.h" #include "get_bits.h" #include "idctdsp.h" -#include "internal.h" #define CBPLO_VLC_BITS 6 #define CBPHI_VLC_BITS 6 @@ -52,9 +51,8 @@ unsigned lo; unsigned hi; - ScanTable intra_scantable; - DECLARE_ALIGNED(32, int16_t, block)[6][64]; IDCTDSPContext idsp; + DECLARE_ALIGNED(32, int16_t, block)[6][64]; } IMM4Context; static const uint8_t intra_cb[] = { @@ -130,7 +128,7 @@ int block, int factor, int flag, int offset, int flag2) { IMM4Context *s = avctx->priv_data; - const uint8_t *scantable = s->intra_scantable.permutated; + const uint8_t *idct_permutation = s->idsp.idct_permutation; int i, last, len, factor2; for (i = !flag; i < 64; i++) { @@ -153,17 +151,17 @@ i += len; if (i >= 64) break; - s->block[block][scantable[i]] = offset * (factor2 < 0 ? -1 : 1) + factor * factor2; + s->block[block][idct_permutation[i]] = offset * (factor2 < 0 ? -1 : 1) + factor * factor2; if (last) break; } if (s->hi == 2 && flag2 && block < 4) { if (flag) - s->block[block][scantable[0]] *= 2; - s->block[block][scantable[1]] *= 2; - s->block[block][scantable[8]] *= 2; - s->block[block][scantable[16]] *= 2; + s->block[block][idct_permutation[0]] *= 2; + s->block[block][idct_permutation[1]] *= 2; + s->block[block][idct_permutation[8]] *= 2; + s->block[block][idct_permutation[16]] *= 2; } return 0; @@ -173,7 +171,7 @@ unsigned cbp, int flag, int offset, unsigned flag2) { IMM4Context *s = avctx->priv_data; - const uint8_t *scantable = s->intra_scantable.permutated; + const uint8_t *idct_permutation = s->idsp.idct_permutation; int ret, i; memset(s->block, 0, sizeof(s->block)); @@ -186,7 +184,7 @@ x = 128; x *= 8; - s->block[i][scantable[0]] = x; + s->block[i][idct_permutation[0]] = x; } if (cbp & (1 << (5 - i))) { @@ -496,14 +494,9 @@ { static AVOnce init_static_once = AV_ONCE_INIT; IMM4Context *s = avctx->priv_data; - uint8_t table[64]; - - for (int i = 0; i < 64; i++) - table[i] = i; ff_bswapdsp_init(&s->bdsp); ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, table); s->prev_frame = av_frame_alloc(); if (!s->prev_frame) @@ -534,7 +527,7 @@ const FFCodec ff_imm4_decoder = { .p.name = "imm4", - .p.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM4"), + CODEC_LONG_NAME("Infinity IMM4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IMM4, .priv_data_size = sizeof(IMM4Context), @@ -543,6 +536,5 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm5.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm5.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm5.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imm5.c 2023-03-03 13:29:59.000000000 +0000 @@ -179,7 +179,7 @@ const FFCodec ff_imm5_decoder = { .p.name = "imm5", - .p.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"), + CODEC_LONG_NAME("Infinity IMM5"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IMM5, .init = imm5_init, @@ -187,6 +187,5 @@ .close = imm5_close, .flush = imm5_flush, .priv_data_size = sizeof(IMM5Context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/imx.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" typedef struct SimbiosisIMXContext { AVFrame *frame; @@ -182,7 +181,7 @@ const FFCodec ff_simbiosis_imx_decoder = { .p.name = "simbiosis_imx", - .p.long_name = NULL_IF_CONFIG_SMALL("Simbiosis Interactive IMX Video"), + CODEC_LONG_NAME("Simbiosis Interactive IMX Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SIMBIOSIS_IMX, .priv_data_size = sizeof(SimbiosisIMXContext), @@ -191,6 +190,5 @@ .close = imx_decode_close, .flush = imx_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo2.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,10 +30,9 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "indeo2data.h" -#include "internal.h" -#include "mathops.h" typedef struct Ir2Context{ AVCodecContext *avctx; @@ -261,7 +260,7 @@ const FFCodec ff_indeo2_decoder = { .p.name = "indeo2", - .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"), + CODEC_LONG_NAME("Intel Indeo 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_INDEO2, .priv_data_size = sizeof(Ir2Context), @@ -269,5 +268,4 @@ .close = ir2_decode_end, FF_CODEC_DECODE_CB(ir2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo3.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,11 +34,11 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "copy_block.h" #include "bytestream.h" #include "get_bits.h" #include "hpeldsp.h" -#include "internal.h" #include "indeo3data.h" @@ -1135,7 +1135,7 @@ const FFCodec ff_indeo3_decoder = { .p.name = "indeo3", - .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"), + CODEC_LONG_NAME("Intel Indeo 3"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_INDEO3, .priv_data_size = sizeof(Indeo3DecodeContext), @@ -1143,5 +1143,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo4.c 2023-03-03 13:29:59.000000000 +0000 @@ -705,7 +705,7 @@ const FFCodec ff_indeo4_decoder = { .p.name = "indeo4", - .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"), + CODEC_LONG_NAME("Intel Indeo Video Interactive 4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_INDEO4, .priv_data_size = sizeof(IVI45DecContext), @@ -713,5 +713,4 @@ .close = ff_ivi_decode_close, FF_CODEC_DECODE_CB(ff_ivi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo5.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo5.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo5.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/indeo5.c 2023-03-03 13:29:59.000000000 +0000 @@ -685,7 +685,7 @@ const FFCodec ff_indeo5_decoder = { .p.name = "indeo5", - .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"), + CODEC_LONG_NAME("Intel Indeo Video Interactive 5"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_INDEO5, .priv_data_size = sizeof(IVI45DecContext), @@ -693,5 +693,5 @@ .close = ff_ivi_decode_close, FF_CODEC_DECODE_CB(ff_ivi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intelh263dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intelh263dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intelh263dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intelh263dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -122,9 +122,6 @@ return AVERROR_INVALIDDATA; s->f_code = 1; - s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg1_dc_scale_table; - ff_h263_show_pict_info(s); return 0; @@ -132,7 +129,7 @@ const FFCodec ff_h263i_decoder = { .p.name = "h263i", - .p.long_name = NULL_IF_CONFIG_SMALL("Intel H.263"), + CODEC_LONG_NAME("Intel H.263"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H263I, .priv_data_size = sizeof(MpegEncContext), @@ -140,8 +137,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,10 @@ #include "avcodec.h" #include "config.h" +#if CONFIG_LCMS2 +# include "fflcms2.h" +#endif + #define FF_SANE_NB_CHANNELS 512U #if HAVE_SIMD_ALIGN_64 @@ -53,11 +57,17 @@ int is_copy; /** - * An audio frame with less than required samples has been submitted and - * padded with silence. Reject all subsequent frames. + * An audio frame with less than required samples has been submitted (and + * potentially padded with silence). Reject all subsequent frames. */ int last_audio_frame; + /** + * Audio encoders can set this flag during init to indicate that they + * want the small last frame to be padded to a multiple of pad_samples. + */ + int pad_samples; + AVBufferRef *pool; void *thread_ctx; @@ -78,7 +88,6 @@ * for decoding. */ AVPacket *last_pkt_props; - struct AVFifo *pkt_props; /** * temporary buffer used for encoders to store their bitstream @@ -104,6 +113,14 @@ AVFrame *in_frame; /** + * When the AV_CODEC_FLAG_RECON_FRAME flag is used. the encoder should store + * here the reconstructed frame corresponding to the last returned packet. + * + * Not allocated in other cases. + */ + AVFrame *recon_frame; + + /** * If this is set, then FFCodec->close (if existing) needs to be called * for the parent AVCodecContext. */ @@ -125,7 +142,7 @@ int draining; /** - * buffers for using new encode/decode API through legacy API + * Temporary buffers for newly received or not yet output packets/frames. */ AVPacket *buffer_pkt; AVFrame *buffer_frame; @@ -133,8 +150,6 @@ int showed_multi_packet_warning; - int skip_samples_multiplier; - /* to prevent infinite loop on errors when draining */ int nb_draining_errors; @@ -143,11 +158,11 @@ int initial_format; int initial_width, initial_height; int initial_sample_rate; -#if FF_API_OLD_CHANNEL_LAYOUT - int initial_channels; - uint64_t initial_channel_layout; -#endif AVChannelLayout initial_ch_layout; + +#if CONFIG_LCMS2 + FFIccContext icc; /* used to read and write embedded ICC profiles */ +#endif } AVCodecInternal; /** @@ -168,18 +183,6 @@ #define FF_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE) /** - * Rescale from sample rate to AVCodecContext.time_base. - */ -static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx, - int64_t samples) -{ - if(samples == AV_NOPTS_VALUE) - return AV_NOPTS_VALUE; - return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate }, - avctx->time_base); -} - -/** * 2^(x) for integer x * @return correctly rounded float */ @@ -198,58 +201,11 @@ return 0; } -/** - * Get a buffer for a frame. This is a wrapper around - * AVCodecContext.get_buffer() and should be used instead calling get_buffer() - * directly. - */ -int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); - -#define FF_REGET_BUFFER_FLAG_READONLY 1 ///< the returned buffer does not need to be writable -/** - * Identical in function to ff_get_buffer(), except it reuses the existing buffer - * if available. - */ -int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); - -int ff_thread_can_start_frame(AVCodecContext *avctx); - int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec); /** - * Check that the provided frame dimensions are valid and set them on the codec - * context. - */ -int ff_set_dimensions(AVCodecContext *s, int width, int height); - -/** - * Check that the provided sample aspect ratio is valid and set it on the codec - * context. - */ -int ff_set_sar(AVCodecContext *avctx, AVRational sar); - -/** - * Add or update AV_FRAME_DATA_MATRIXENCODING side data. - */ -int ff_side_data_update_matrix_encoding(AVFrame *frame, - enum AVMatrixEncoding matrix_encoding); - -/** - * Select the (possibly hardware accelerated) pixel format. - * This is a wrapper around AVCodecContext.get_format() and should be used - * instead of calling get_format() directly. - * - * The list of pixel formats must contain at least one valid entry, and is - * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, - * the last entry in the list must be the most accurate software format. - * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt - * must be set before calling this function. - */ -int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); - -/** * Add a CPB properties side data to an encoding context. */ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); @@ -288,6 +244,4 @@ int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, const int * array_valid_values, int default_value); -void ff_dvdsub_parse_palette(uint32_t *palette, const char *p); - #endif /* AVCODEC_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayacm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayacm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayacm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayacm.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,8 +24,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" static const int8_t map_1bit[] = { -1, +1 }; static const int8_t map_2bit_near[] = { -2, -1, +1, +2 }; @@ -634,13 +634,13 @@ const FFCodec ff_interplay_acm_decoder = { .p.name = "interplayacm", - .p.long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"), + CODEC_LONG_NAME("Interplay ACM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_INTERPLAY_ACM, .init = decode_init, .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(InterplayACMContext), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/interplayvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,6 @@ */ #include -#include #include #include "libavutil/intreadwrite.h" @@ -47,7 +46,6 @@ #include "decode.h" #include "get_bits.h" #include "hpeldsp.h" -#include "internal.h" #define PALETTE_COUNT 256 @@ -928,7 +926,7 @@ } } else { /* Don't try to copy second_last_frame data on the first frames */ - if (s->avctx->frame_number > 2) + if (s->avctx->frame_num > 2) copy_from(s, s->second_last_frame, frame, 0, 0); } } @@ -1087,7 +1085,7 @@ copy_from(s, s->cur_decode_frame, frame, 0, 0); } else { /* Don't try to copy last_frame data on the first frame */ - if (s->avctx->frame_number) + if (s->avctx->frame_num) copy_from(s, s->last_frame, frame, 0, 0); } skip *= 2; @@ -1146,8 +1144,8 @@ ret = ipvideo_decode_block16[opcode](s, frame); } if (ret != 0) { - av_log(s->avctx, AV_LOG_ERROR, "decode problem on frame %d, @ block (%d, %d)\n", - s->avctx->frame_number, x, y); + av_log(s->avctx, AV_LOG_ERROR, "decode problem on frame %"PRId64", @ block (%d, %d)\n", + s->avctx->frame_num, x, y); return; } } @@ -1358,7 +1356,7 @@ const FFCodec ff_interplay_video_decoder = { .p.name = "interplayvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"), + CODEC_LONG_NAME("Interplay MVE video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_INTERPLAY_VIDEO, .priv_data_size = sizeof(IpvideoContext), @@ -1366,5 +1364,5 @@ .close = ipvideo_decode_end, FF_CODEC_DECODE_CB(ipvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "get_bits.h" #include "idctdsp.h" -#include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "intrax8huf.h" #include "intrax8.h" #include "intrax8dsp.h" @@ -92,9 +92,9 @@ static void x8_reset_vlc_tables(IntraX8Context *w) { - memset(w->j_dc_vlc, 0, sizeof(w->j_dc_vlc)); - memset(w->j_ac_vlc, 0, sizeof(w->j_ac_vlc)); - w->j_orient_vlc = NULL; + memset(w->j_dc_vlc_table, 0, sizeof(w->j_dc_vlc_table)); + memset(w->j_ac_vlc_table, 0, sizeof(w->j_ac_vlc_table)); + w->j_orient_vlc_table = NULL; } static inline void x8_select_ac_table(IntraX8Context *const w, int mode) @@ -103,23 +103,23 @@ av_assert2(mode < 4); - if (w->j_ac_vlc[mode]) + if (w->j_ac_vlc_table[mode]) return; table_index = get_bits(w->gb, 3); // 2 modes use same tables - w->j_ac_vlc[mode] = &j_ac_vlc[w->quant < 13][mode >> 1][table_index]; + w->j_ac_vlc_table[mode] = j_ac_vlc[w->quant < 13][mode >> 1][table_index].table; av_assert2(w->j_ac_vlc[mode]); } static inline int x8_get_orient_vlc(IntraX8Context *w) { - if (!w->j_orient_vlc) { + if (!w->j_orient_vlc_table) { int table_index = get_bits(w->gb, 1 + (w->quant < 13)); - w->j_orient_vlc = &j_orient_vlc[w->quant < 13][table_index]; + w->j_orient_vlc_table = j_orient_vlc[w->quant < 13][table_index].table; } - return get_vlc2(w->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD); + return get_vlc2(w->gb, w->j_orient_vlc_table, OR_VLC_BITS, OR_VLC_MTD); } #define extra_bits(eb) (eb) // 3 bits @@ -175,7 +175,7 @@ int i, e; // x8_select_ac_table(w, mode); - i = get_vlc2(w->gb, w->j_ac_vlc[mode]->table, AC_VLC_BITS, AC_VLC_MTD); + i = get_vlc2(w->gb, w->j_ac_vlc_table[mode], AC_VLC_BITS, AC_VLC_MTD); if (i < 46) { // [0-45] int t, l; @@ -255,13 +255,13 @@ int i, e, c; av_assert2(mode < 3); - if (!w->j_dc_vlc[mode]) { + if (!w->j_dc_vlc_table[mode]) { int table_index = get_bits(w->gb, 3); // 4 modes, same table - w->j_dc_vlc[mode] = &j_dc_vlc[w->quant < 13][table_index]; + w->j_dc_vlc_table[mode] = j_dc_vlc[w->quant < 13][table_index].table; } - i = get_vlc2(w->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD); + i = get_vlc2(w->gb, w->j_dc_vlc_table[mode], DC_VLC_BITS, DC_VLC_MTD); /* (i >= 17) { i -= 17; final =1; } */ c = i > 16; @@ -577,7 +577,7 @@ x8_select_ac_table(w, ac_mode); /* scantable_selector[12] = { 0, 2, 0, 1, 1, 1, 0, 2, 2, 0, 1, 2 }; <- * -> 10'01' 00'10' 10'00' 01'01' 01'00' 10'00 => 0x928548 */ - scantable = w->scantable[(0x928548 >> (2 * w->orient)) & 3].permutated; + scantable = w->permutated_scantable[(0x928548 >> (2 * w->orient)) & 3]; pos = 0; do { n++; @@ -692,7 +692,7 @@ } av_cold int ff_intrax8_common_init(AVCodecContext *avctx, - IntraX8Context *w, IDCTDSPContext *idsp, + IntraX8Context *w, int16_t (*block)[64], int block_last_index[12], int mb_width, int mb_height) @@ -700,7 +700,6 @@ static AVOnce init_static_once = AV_ONCE_INIT; w->avctx = avctx; - w->idsp = *idsp; w->mb_width = mb_width; w->mb_height = mb_height; w->block = block; @@ -716,15 +715,15 @@ ff_init_scantable_permutation(w->idct_permutation, w->wdsp.idct_perm); - ff_init_scantable(w->idct_permutation, &w->scantable[0], - ff_wmv1_scantable[0]); - ff_init_scantable(w->idct_permutation, &w->scantable[1], - ff_wmv1_scantable[2]); - ff_init_scantable(w->idct_permutation, &w->scantable[2], - ff_wmv1_scantable[3]); + ff_permute_scantable(w->permutated_scantable[0], ff_wmv1_scantable[0], + w->idct_permutation); + ff_permute_scantable(w->permutated_scantable[1], ff_wmv1_scantable[2], + w->idct_permutation); + ff_permute_scantable(w->permutated_scantable[2], ff_wmv1_scantable[3], + w->idct_permutation); ff_intrax8dsp_init(&w->dsp); - ff_blockdsp_init(&w->bdsp, avctx); + ff_blockdsp_init(&w->bdsp); ff_thread_once(&init_static_once, x8_vlc_init); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/intrax8.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,21 +21,20 @@ #include "blockdsp.h" #include "get_bits.h" -#include "idctdsp.h" #include "intrax8dsp.h" #include "wmv2dsp.h" #include "mpegpicture.h" typedef struct IntraX8Context { - VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc - VLC *j_orient_vlc; - VLC *j_dc_vlc[3]; + const VLCElem *j_ac_vlc_table[4]; // they point to the static j_mb_vlc.table + const VLCElem *j_orient_vlc_table; + const VLCElem *j_dc_vlc_table[3]; int use_quant_matrix; // set by ff_intrax8_common_init uint8_t *prediction_table; // 2 * (mb_w * 2) - ScanTable scantable[3]; + uint8_t permutated_scantable[3][64]; WMV2DSPContext wdsp; uint8_t idct_permutation[64]; AVCodecContext *avctx; @@ -44,7 +43,6 @@ // set by the caller codec IntraX8DSPContext dsp; - IDCTDSPContext idsp; BlockDSPContext bdsp; int quant; int dquant; @@ -78,7 +76,6 @@ * Initialize IntraX8 frame decoder. * @param avctx pointer to AVCodecContext * @param w pointer to IntraX8Context - * @param idsp pointer to IDCTDSPContext * @param block pointer to block array * @param block_last_index pointer to index array * @param mb_width macroblock width @@ -86,7 +83,7 @@ * @return 0 on success, a negative AVERROR value on error */ int ff_intrax8_common_init(AVCodecContext *avctx, - IntraX8Context *w, IDCTDSPContext *idsp, + IntraX8Context *w, int16_t (*block)[64], int block_last_index[12], int mb_width, int mb_height); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -50,6 +50,7 @@ #include "mpegvideodata.h" #include "mpegvideodec.h" #include "mpeg4videodec.h" +#include "mpeg4videodefs.h" // The defines below define the number of bits that are read at once for // reading vlc values. Changing these may improve speed and data cache needs @@ -543,9 +544,9 @@ i = 0; if (s->ac_pred) { if (s->h263_aic_dir) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_intra_h_scantable; /* top */ } } else if (s->mb_intra) { /* DC coef */ @@ -1092,7 +1093,7 @@ align_get_bits(&s->gb); - if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_number == 0) { + if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_num == 0) { av_log(s->avctx, AV_LOG_WARNING, "Header looks like RTP instead of H.263\n"); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ituh263enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -105,7 +105,7 @@ return FF_ASPECT_EXTENDED; } -void ff_h263_encode_picture_header(MpegEncContext * s, int picture_number) +void ff_h263_encode_picture_header(MpegEncContext * s) { int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref; int best_clock_code=1; @@ -898,12 +898,13 @@ const FFCodec ff_h263_encoder = { .p.name = "h263", - .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), + CODEC_LONG_NAME("H.263 / H.263-1996"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H263, .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, .p.priv_class = &h263_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), @@ -928,13 +929,13 @@ const FFCodec ff_h263p_encoder = { .p.name = "h263p", - .p.long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"), + CODEC_LONG_NAME("H.263+ / H.263-1998 / H.263 version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H263P, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &h263p_class, - .p.capabilities = AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ivi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ivi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ivi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ivi.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,8 +34,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "ivi.h" #include "ivi_dsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/j2kenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/j2kenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/j2kenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/j2kenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -507,7 +507,7 @@ static void copy_frame_ ##D(Jpeg2000EncoderContext *s) \ { \ int tileno, compno, i, y, x; \ - PIXEL *line; \ + const PIXEL *line; \ for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){ \ Jpeg2000Tile *tile = s->tile + tileno; \ if (s->planar){ \ @@ -515,23 +515,23 @@ Jpeg2000Component *comp = tile->comp + compno; \ int *dst = comp->i_data; \ int cbps = s->cbps[compno]; \ - line = (PIXEL*)s->picture->data[compno] \ + line = (const PIXEL*)s->picture->data[compno] \ + comp->coord[1][0] * (s->picture->linesize[compno] / sizeof(PIXEL)) \ + comp->coord[0][0]; \ for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){ \ - PIXEL *ptr = line; \ + const PIXEL *ptr = line; \ for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++) \ *dst++ = *ptr++ - (1 << (cbps - 1)); \ line += s->picture->linesize[compno] / sizeof(PIXEL); \ } \ } \ } else{ \ - line = (PIXEL*)s->picture->data[0] + tile->comp[0].coord[1][0] * (s->picture->linesize[0] / sizeof(PIXEL)) \ + line = (const PIXEL*)(s->picture->data[0] + tile->comp[0].coord[1][0] * s->picture->linesize[0]) \ + tile->comp[0].coord[0][0] * s->ncomponents; \ \ i = 0; \ for (y = tile->comp[0].coord[1][0]; y < tile->comp[0].coord[1][1]; y++){ \ - PIXEL *ptr = line; \ + const PIXEL *ptr = line; \ for (x = tile->comp[0].coord[0][0]; x < tile->comp[0].coord[0][1]; x++, i++){ \ for (compno = 0; compno < s->ncomponents; compno++){ \ int cbps = s->cbps[compno]; \ @@ -1597,7 +1597,7 @@ update_size(chunkstart, s->buf); if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { int i; - uint8_t *palette = pict->data[1]; + const uint8_t *palette = pict->data[1]; chunkstart = s->buf; bytestream_put_be32(&s->buf, 0); bytestream_put_buffer(&s->buf, "pclr", 4); @@ -1832,9 +1832,10 @@ const FFCodec ff_jpeg2000_encoder = { .p.name = "jpeg2000", - .p.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), + CODEC_LONG_NAME("JPEG 2000"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEG2000, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(Jpeg2000EncoderContext), .init = j2kenc_init, FF_CODEC_ENCODE_CB(encode_frame), @@ -1848,5 +1849,5 @@ AV_PIX_FMT_NONE }, .p.priv_class = &j2k_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jacosubdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jacosubdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jacosubdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jacosubdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -195,12 +195,11 @@ const FFCodec ff_jacosub_decoder = { .p.name = "jacosub", - .p.long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle"), + CODEC_LONG_NAME("JACOsub subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_JACOSUB, .init = ff_ass_subtitle_header_default, FF_CODEC_DECODE_SUB_CB(jacosub_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,7 +37,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "thread.h" #include "jpeg2000.h" #include "jpeg2000dsp.h" @@ -521,6 +521,10 @@ c->cblk_style = bytestream2_get_byteu(&s->g); if (c->cblk_style != 0) { // cblk style + if (c->cblk_style & JPEG2000_CTSY_HTJ2K_M || c->cblk_style & JPEG2000_CTSY_HTJ2K_F) { + av_log(s->avctx, AV_LOG_ERROR, "Support for High throughput JPEG 2000 is not yet available\n"); + return AVERROR_PATCHWELCOME; + } av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style); if (c->cblk_style & JPEG2000_CBLK_BYPASS) av_log(s->avctx, AV_LOG_WARNING, "Selective arithmetic coding bypass\n"); @@ -1679,7 +1683,7 @@ } } -static void decode_clnpass(Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1, +static void decode_clnpass(const Jpeg2000DecoderContext *s, Jpeg2000T1Context *t1, int width, int height, int bpno, int bandno, int seg_symbols, int vert_causal_ctx_csty_symbol) { @@ -1745,7 +1749,7 @@ } } -static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, +static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk, int width, int height, int bandpos, uint8_t roi_shift) { @@ -1896,7 +1900,7 @@ } } -static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) +static inline void mct_decode(const Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) { int i, csize = 1; void *src[3]; @@ -1937,7 +1941,7 @@ } } -static inline void tile_codeblocks(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) +static inline void tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) { Jpeg2000T1Context t1; @@ -2009,7 +2013,7 @@ } #define WRITE_FRAME(D, PIXEL) \ - static inline void write_frame_ ## D(Jpeg2000DecoderContext * s, Jpeg2000Tile * tile, \ + static inline void write_frame_ ## D(const Jpeg2000DecoderContext * s, Jpeg2000Tile * tile, \ AVFrame * picture, int precision) \ { \ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(s->avctx->pix_fmt); \ @@ -2078,7 +2082,7 @@ static int jpeg2000_decode_tile(AVCodecContext *avctx, void *td, int jobnr, int threadnr) { - Jpeg2000DecoderContext *s = avctx->priv_data; + const Jpeg2000DecoderContext *s = avctx->priv_data; AVFrame *picture = td; Jpeg2000Tile *tile = s->tile + jobnr; @@ -2515,6 +2519,15 @@ if (ret = jpeg2000_read_main_headers(s)) goto end; + if (s->sar.num && s->sar.den) + avctx->sample_aspect_ratio = s->sar; + s->sar.num = s->sar.den = 0; + + if (avctx->skip_frame >= AVDISCARD_ALL) { + jpeg2000_dec_cleanup(s); + return avpkt->size; + } + /* get picture buffer */ if ((ret = ff_thread_get_buffer(avctx, picture, 0)) < 0) goto end; @@ -2543,9 +2556,6 @@ if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) memcpy(picture->data[1], s->palette, 256 * sizeof(uint32_t)); - if (s->sar.num && s->sar.den) - avctx->sample_aspect_ratio = s->sar; - s->sar.num = s->sar.den = 0; return bytestream2_tell(&s->g); @@ -2572,7 +2582,7 @@ const FFCodec ff_jpeg2000_decoder = { .p.name = "jpeg2000", - .p.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), + CODEC_LONG_NAME("JPEG 2000"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEG2000, .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_DR1, @@ -2582,5 +2592,5 @@ .p.priv_class = &jpeg2000_class, .p.max_lowres = 5, .p.profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -76,14 +76,13 @@ static void rct_int(void *_src0, void *_src1, void *_src2, int csize) { - int32_t *src0 = _src0, *src1 = _src1, *src2 = _src2; - int32_t i0, i1, i2; + uint32_t *src0 = _src0, *src1 = _src1, *src2 = _src2; int i; for (i = 0; i < csize; i++) { - i1 = *src0 - (*src2 + *src1 >> 2); - i0 = i1 + *src2; - i2 = i1 + *src1; + uint32_t i1 = *src0 - ((int32_t)(*src2 + *src1) >> 2); + int32_t i0 = i1 + *src2; + int32_t i2 = i1 + *src1; *src0++ = i0; *src1++ = i1; *src2++ = i2; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dwt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dwt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dwt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000dwt.c 2023-03-03 13:29:59.000000000 +0000 @@ -81,7 +81,7 @@ if (i1 <= i0 + 1) { if (i0 == 1) - p[1] <<= 1; + p[1] *= 2; return; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeg2000.h 2023-03-03 13:29:59.000000000 +0000 @@ -110,6 +110,8 @@ #define JPEG2000_CSTY_PREC 0x01 // Precincts defined in coding style #define JPEG2000_CSTY_SOP 0x02 // SOP marker present #define JPEG2000_CSTY_EPH 0x04 // EPH marker present +#define JPEG2000_CTSY_HTJ2K_F 0x40 // Only HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) are present +#define JPEG2000_CTSY_HTJ2K_M 0xC0 // HT code blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) can be present // Progression orders #define JPEG2000_PGOD_LRCP 0x00 // Layer-resolution level-component-position progression diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -552,14 +552,13 @@ const FFCodec ff_jpegls_decoder = { .p.name = "jpegls", - .p.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), + CODEC_LONG_NAME("JPEG-LS"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEGLS, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_SETS_PKT_DTS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpeglsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -413,8 +413,6 @@ /* End of image */ put_marker_byteu(&pb, EOI); - emms_c(); - av_shrink_packet(pkt, bytestream2_tell_p(&pb)); *got_packet = 1; return 0; @@ -475,10 +473,11 @@ const FFCodec ff_jpegls_encoder = { .p.name = "jpegls", - .p.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), + CODEC_LONG_NAME("JPEG-LS"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEGLS, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(JPEGLSContext), .p.priv_class = &jpegls_class, .init = encode_jpegls_init, @@ -489,6 +488,5 @@ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MJPEG encoder and decoder + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * MJPEG quantization tables + */ + +#include "jpegquanttables.h" + +/* These are the sample quantization tables given in JPEG spec section K.1. + * The spec says that the values given produce "good" quality, and + * when divided by 2, "very good" quality. + */ +const uint8_t ff_mjpeg_std_luminance_quant_tbl[64] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 +}; +const uint8_t ff_mjpeg_std_chrominance_quant_tbl[64] = { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegquanttables.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * MJPEG quantization tables + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_JPEGQUANTTABLES_H +#define AVCODEC_JPEGQUANTTABLES_H + +#include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_mjpeg_std_luminance_quant_tbl[64]; +extern const uint8_t ff_mjpeg_std_chrominance_quant_tbl[64]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_JPEGQUANTTABLES_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,30 +31,3 @@ */ #include "jpegtabs.h" - -#if 0 -/* These are the sample quantization tables given in JPEG spec section K.1. - * The spec says that the values given produce "good" quality, and - * when divided by 2, "very good" quality. - */ -static const unsigned char std_luminance_quant_tbl[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 -}; -static const unsigned char std_chrominance_quant_tbl[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; -#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jpegtables.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,9 @@ #include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN extern const uint8_t ff_mjpeg_bits_dc_luminance[]; extern const uint8_t ff_mjpeg_val_dc[]; @@ -33,5 +36,6 @@ extern const uint8_t ff_mjpeg_bits_ac_chrominance[]; extern const uint8_t ff_mjpeg_val_ac_chrominance[]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_JPEGTABLES_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jrevdct.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jrevdct.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jrevdct.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jrevdct.c 2023-03-03 13:29:59.000000000 +0000 @@ -255,7 +255,7 @@ if (d0) { /* Compute a 32 bit value to assign. */ int16_t dcval = (int16_t) (d0 * (1 << PASS1_BITS)); - register int v = (dcval & 0xffff) | ((dcval * (1 << 16)) & 0xffff0000); + register unsigned v = (dcval & 0xffff) | ((uint32_t)dcval << 16); AV_WN32A(&idataptr[ 0], v); AV_WN32A(&idataptr[ 4], v); @@ -988,8 +988,8 @@ /* AC terms all zero */ if (d0) { /* Compute a 32 bit value to assign. */ - int16_t dcval = (int16_t) (d0 << PASS1_BITS); - register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); + int16_t dcval = (int16_t) (d0 * (1 << PASS1_BITS)); + register unsigned v = (dcval & 0xffff) | ((uint32_t)dcval << 16); AV_WN32A(&idataptr[0], v); AV_WN32A(&idataptr[4], v); @@ -1008,8 +1008,8 @@ tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1020,8 +1020,8 @@ tmp2 = MULTIPLY(-d6, FIX_1_306562965); tmp3 = MULTIPLY(d6, FIX_0_541196100); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1034,8 +1034,8 @@ tmp2 = MULTIPLY(d2, FIX_0_541196100); tmp3 = MULTIPLY(d2, FIX_1_306562965); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1043,8 +1043,8 @@ tmp12 = tmp1 - tmp2; } else { /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ - tmp10 = tmp13 = (d0 + d4) << CONST_BITS; - tmp11 = tmp12 = (d0 - d4) << CONST_BITS; + tmp10 = tmp13 = (d0 + d4) * (1 << CONST_BITS); + tmp11 = tmp12 = (d0 - d4) * (1 << CONST_BITS); } } @@ -1086,8 +1086,8 @@ tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1098,8 +1098,8 @@ tmp2 = MULTIPLY(-d6, FIX_1_306562965); tmp3 = MULTIPLY(d6, FIX_0_541196100); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1112,8 +1112,8 @@ tmp2 = MULTIPLY(d2, FIX_0_541196100); tmp3 = MULTIPLY(d2, FIX_1_306562965); - tmp0 = (d0 + d4) << CONST_BITS; - tmp1 = (d0 - d4) << CONST_BITS; + tmp0 = (d0 + d4) * (1 << CONST_BITS); + tmp1 = (d0 - d4) * (1 << CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -1121,8 +1121,8 @@ tmp12 = tmp1 - tmp2; } else { /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ - tmp10 = tmp13 = (d0 + d4) << CONST_BITS; - tmp11 = tmp12 = (d0 - d4) << CONST_BITS; + tmp10 = tmp13 = (d0 + d4) * (1 << CONST_BITS); + tmp11 = tmp12 = (d0 - d4) * (1 << CONST_BITS); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/jvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,8 +30,8 @@ #include "avcodec.h" #include "blockdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct JvContext { BlockDSPContext bdsp; @@ -56,7 +56,7 @@ return AVERROR(ENOMEM); avctx->pix_fmt = AV_PIX_FMT_PAL8; - ff_blockdsp_init(&s->bdsp, avctx); + ff_blockdsp_init(&s->bdsp); return 0; } @@ -236,7 +236,7 @@ const FFCodec ff_jv_decoder = { .p.name = "jv", - .p.long_name = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV video"), + CODEC_LONG_NAME("Bitmap Brothers JV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JV, .priv_data_size = sizeof(JvContext), @@ -244,5 +244,4 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kgv1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kgv1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kgv1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kgv1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct KgvContext { uint16_t *frame_buffer; @@ -178,7 +178,7 @@ const FFCodec ff_kgv1_decoder = { .p.name = "kgv1", - .p.long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"), + CODEC_LONG_NAME("Kega Game Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_KGV1, .priv_data_size = sizeof(KgvContext), @@ -187,5 +187,4 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kmvc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kmvc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kmvc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/kmvc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,13 +25,11 @@ */ #include -#include #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #include "libavutil/common.h" #define KMVC_KEYFRAME 0x80 @@ -406,12 +404,11 @@ const FFCodec ff_kmvc_decoder = { .p.name = "kmvc", - .p.long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"), + CODEC_LONG_NAME("Karl Morton's video codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_KMVC, .priv_data_size = sizeof(KmvcContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lagarith.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lagarith.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lagarith.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lagarith.c 2023-03-03 13:29:59.000000000 +0000 @@ -730,12 +730,11 @@ const FFCodec ff_lagarith_decoder = { .p.name = "lagarith", - .p.long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), + CODEC_LONG_NAME("Lagarith lossless"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_LAGARITH, .priv_data_size = sizeof(LagarithContext), .init = lag_decode_init, FF_CODEC_DECODE_CB(lag_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lcldec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lcldec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lcldec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lcldec.c 2023-03-03 13:29:59.000000000 +0000 @@ -632,7 +632,7 @@ #if CONFIG_MSZH_DECODER const FFCodec ff_mszh_decoder = { .p.name = "mszh", - .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"), + CODEC_LONG_NAME("LCL (LossLess Codec Library) MSZH"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSZH, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, @@ -640,14 +640,14 @@ .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_ZLIB_DECODER const FFCodec ff_zlib_decoder = { .p.name = "zlib", - .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), + CODEC_LONG_NAME("LCL (LossLess Codec Library) ZLIB"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ZLIB, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, @@ -655,6 +655,6 @@ .init = decode_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lclenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lclenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lclenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lclenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -153,15 +153,15 @@ const FFCodec ff_zlib_encoder = { .p.name = "zlib", - .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), + CODEC_LONG_NAME("LCL (LossLess Codec Library) ZLIB"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ZLIB, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(LclEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * AOM common functions + */ + +#include "libavutil/pixdesc.h" +#include "libaom.h" + +void ff_aom_image_copy_16_to_8(AVFrame *pic, struct aom_image *img) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format); + int i; + + for (i = 0; i < desc->nb_components; i++) { + int w = img->d_w; + int h = img->d_h; + int x, y; + + if (i) { + w = (w + img->x_chroma_shift) >> img->x_chroma_shift; + h = (h + img->y_chroma_shift) >> img->y_chroma_shift; + } + + for (y = 0; y < h; y++) { + uint16_t *src = (uint16_t *)(img->planes[i] + y * img->stride[i]); + uint8_t *dst = pic->data[i] + y * pic->linesize[i]; + for (x = 0; x < w; x++) + *dst++ = *src++; + } + } +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,8 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" +#include "libaom.h" #include "profiles.h" typedef struct AV1DecodeContext { @@ -60,30 +61,6 @@ return 0; } -static void image_copy_16_to_8(AVFrame *pic, struct aom_image *img) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format); - int i; - - for (i = 0; i < desc->nb_components; i++) { - int w = img->d_w; - int h = img->d_h; - int x, y; - - if (i) { - w = (w + img->x_chroma_shift) >> img->x_chroma_shift; - h = (h + img->y_chroma_shift) >> img->y_chroma_shift; - } - - for (y = 0; y < h; y++) { - uint16_t *src = (uint16_t *)(img->planes[i] + y * img->stride[i]); - uint8_t *dst = pic->data[i] + y * pic->linesize[i]; - for (x = 0; x < w; x++) - *dst++ = *src++; - } - } -} - // returns 0 on success, AVERROR_INVALIDDATA otherwise static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) { @@ -136,15 +113,19 @@ case AOM_IMG_FMT_I444: case AOM_IMG_FMT_I44416: if (img->bit_depth == 8) { - avctx->pix_fmt = AV_PIX_FMT_YUV444P; + avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? + AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; avctx->profile = FF_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; return 0; } else if (img->bit_depth == 12) { - avctx->pix_fmt = AV_PIX_FMT_YUV444P12; + avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? + AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12; avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; return 0; } else { @@ -223,7 +204,7 @@ ff_set_sar(avctx, picture->sample_aspect_ratio); if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8) - image_copy_16_to_8(picture, img); + ff_aom_image_copy_16_to_8(picture, img); else { const uint8_t *planes[4] = { img->planes[0], img->planes[1], img->planes[2] }; const int stride[4] = { img->stride[0], img->stride[1], img->stride[2] }; @@ -250,7 +231,7 @@ const FFCodec ff_libaom_av1_decoder = { .p.name = "libaom-av1", - .p.long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), + CODEC_LONG_NAME("libaom AV1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(AV1DecodeContext), @@ -258,7 +239,8 @@ .close = aom_free, FF_CODEC_DECODE_CB(aom_decode), .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .p.wrapper_name = "libaom", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaomenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,8 @@ * AV1 encoder support via libaom */ +#include + #define AOM_DISABLE_CTRL_TYPECHECKS 1 #include #include @@ -31,6 +33,7 @@ #include "libavutil/base64.h" #include "libavutil/common.h" #include "libavutil/cpu.h" +#include "libavutil/imgutils.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -41,6 +44,7 @@ #include "codec_internal.h" #include "encode.h" #include "internal.h" +#include "libaom.h" #include "packet_internal.h" #include "profiles.h" @@ -68,6 +72,7 @@ struct aom_codec_ctx encoder; struct aom_image rawimg; struct aom_fixed_buf twopass_stats; + unsigned twopass_stats_size; struct FrameListData *coded_frame_list; int cpu_used; int auto_alt_ref; @@ -208,6 +213,7 @@ #ifdef AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX [AV1E_GET_TARGET_SEQ_LEVEL_IDX] = "AV1E_GET_TARGET_SEQ_LEVEL_IDX", #endif + [AV1_GET_NEW_FRAME_IMAGE] = "AV1_GET_NEW_FRAME_IMAGE", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -364,6 +370,31 @@ } #endif +static av_cold int codecctl_imgp(AVCodecContext *avctx, +#ifdef UENUM1BYTE + aome_enc_control_id id, +#else + enum aome_enc_control_id id, +#endif + struct aom_image *img) +{ + AOMContext *ctx = avctx->priv_data; + char buf[80]; + int res; + + snprintf(buf, sizeof(buf), "%s:", ctlidstr[id]); + + res = aom_codec_control(&ctx->encoder, id, img); + if (res != AOM_CODEC_OK) { + snprintf(buf, sizeof(buf), "Failed to get %s codec control", + ctlidstr[id]); + log_encoder_error(avctx, buf); + return AVERROR(EINVAL); + } + + return 0; +} + static av_cold int aom_free(AVCodecContext *avctx) { AOMContext *ctx = avctx->priv_data; @@ -371,7 +402,7 @@ #if defined(AOM_CTRL_AV1E_GET_NUM_OPERATING_POINTS) && \ defined(AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX) && \ defined(AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX) - if (!(avctx->flags & AV_CODEC_FLAG_PASS1)) { + if (ctx->encoder.iface && !(avctx->flags & AV_CODEC_FLAG_PASS1)) { int num_operating_points; int levels[32]; int target_levels[32]; @@ -1065,6 +1096,7 @@ } memcpy(pkt->data, cx_frame->buf, pkt->size); pkt->pts = pkt->dts = cx_frame->pts; + pkt->duration = cx_frame->duration; if (!!(cx_frame->flags & AOM_FRAME_IS_KEY)) { pkt->flags |= AV_PKT_FLAG_KEY; @@ -1172,14 +1204,17 @@ case AOM_CODEC_STATS_PKT: { struct aom_fixed_buf *stats = &ctx->twopass_stats; - int err; - if ((err = av_reallocp(&stats->buf, - stats->sz + - pkt->data.twopass_stats.sz)) < 0) { + uint8_t *tmp = av_fast_realloc(stats->buf, + &ctx->twopass_stats_size, + stats->sz + + pkt->data.twopass_stats.sz); + if (!tmp) { + av_freep(&stats->buf); stats->sz = 0; av_log(avctx, AV_LOG_ERROR, "Stat buffer realloc failed\n"); - return err; + return AVERROR(ENOMEM); } + stats->buf = tmp; memcpy((uint8_t *)stats->buf + stats->sz, pkt->data.twopass_stats.buf, pkt->data.twopass_stats.sz); stats->sz += pkt->data.twopass_stats.sz; @@ -1206,12 +1241,44 @@ return size; } +static enum AVPixelFormat aomfmt_to_pixfmt(struct aom_image *img) +{ + switch (img->fmt) { + case AOM_IMG_FMT_I420: + case AOM_IMG_FMT_I42016: + if (img->bit_depth == 8) + return img->monochrome ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P; + else if (img->bit_depth == 10) + return img->monochrome ? AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10; + else + return img->monochrome ? AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12; + case AOM_IMG_FMT_I422: + case AOM_IMG_FMT_I42216: + if (img->bit_depth == 8) + return AV_PIX_FMT_YUV422P; + else if (img->bit_depth == 10) + return AV_PIX_FMT_YUV422P10; + else + return AV_PIX_FMT_YUV422P12; + case AOM_IMG_FMT_I444: + case AOM_IMG_FMT_I44416: + if (img->bit_depth == 8) + return AV_PIX_FMT_YUV444P; + else if (img->bit_depth == 10) + return AV_PIX_FMT_YUV444P10; + else + return AV_PIX_FMT_YUV444P12; + }; + return AV_PIX_FMT_NONE; +} + static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { AOMContext *ctx = avctx->priv_data; struct aom_image *rawimg = NULL; int64_t timestamp = 0; + unsigned long duration = 0; int res, coded_size; aom_enc_frame_flags_t flags = 0; @@ -1224,6 +1291,13 @@ rawimg->stride[AOM_PLANE_U] = frame->linesize[1]; rawimg->stride[AOM_PLANE_V] = frame->linesize[2]; timestamp = frame->pts; + + if (frame->duration > ULONG_MAX) { + av_log(avctx, AV_LOG_WARNING, + "Frame duration too large: %"PRId64"\n", frame->duration); + } else + duration = frame->duration ? frame->duration : avctx->ticks_per_frame; + switch (frame->color_range) { case AVCOL_RANGE_MPEG: rawimg->range = AOM_CR_STUDIO_RANGE; @@ -1237,13 +1311,14 @@ flags |= AOM_EFLAG_FORCE_KF; } - res = aom_codec_encode(&ctx->encoder, rawimg, timestamp, - avctx->ticks_per_frame, flags); + res = aom_codec_encode(&ctx->encoder, rawimg, timestamp, duration, flags); if (res != AOM_CODEC_OK) { log_encoder_error(avctx, "Error encoding frame"); return AVERROR_INVALIDDATA; } coded_size = queue_frames(avctx, pkt); + if (coded_size < 0) + return coded_size; if (!frame && avctx->flags & AV_CODEC_FLAG_PASS1) { size_t b64_size = AV_BASE64_SIZE(ctx->twopass_stats.sz); @@ -1259,6 +1334,43 @@ } *got_packet = !!coded_size; + + if (*got_packet && avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { + AVCodecInternal *avci = avctx->internal; + struct aom_image img; + + av_frame_unref(avci->recon_frame); + + res = codecctl_imgp(avctx, AV1_GET_NEW_FRAME_IMAGE, &img); + if (res < 0) + return res; + + avci->recon_frame->format = aomfmt_to_pixfmt(&img); + if (avci->recon_frame->format == AV_PIX_FMT_NONE) { + av_log(ctx, AV_LOG_ERROR, + "Unhandled reconstructed frame colorspace: %d\n", + img.fmt); + return AVERROR(ENOSYS); + } + + avci->recon_frame->width = img.d_w; + avci->recon_frame->height = img.d_h; + + res = av_frame_get_buffer(avci->recon_frame, 0); + if (res < 0) + return res; + + if ((img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img.bit_depth == 8) + ff_aom_image_copy_16_to_8(avci->recon_frame, &img); + else { + const uint8_t *planes[4] = { img.planes[0], img.planes[1], img.planes[2] }; + const int stride[4] = { img.stride[0], img.stride[1], img.stride[2] }; + + av_image_copy(avci->recon_frame->data, avci->recon_frame->linesize, planes, + stride, avci->recon_frame->format, img.d_w, img.d_h); + } + } + return 0; } @@ -1430,10 +1542,11 @@ FFCodec ff_libaom_av1_encoder = { .p.name = "libaom-av1", - .p.long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), + CODEC_LONG_NAME("libaom AV1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_ENCODER_RECON_FRAME | AV_CODEC_CAP_OTHER_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .p.priv_class = &class_aom, @@ -1442,7 +1555,9 @@ .init = av1_init, FF_CODEC_ENCODE_CB(aom_encode), .close = aom_free, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_AUTO_THREADS, .defaults = defaults, .init_static_data = av1_init_static, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaom.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * AOM common functions + */ + +#ifndef AVCODEC_LIBAOM_H +#define AVCODEC_LIBAOM_H + +#include + +#include "libavutil/frame.h" + +void ff_aom_image_copy_16_to_8(AVFrame *pic, struct aom_image *img); + +#endif /* AVCODEC_LIBAOM_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaribb24.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaribb24.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaribb24.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libaribb24.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,10 +40,18 @@ char *aribb24_base_path; unsigned int aribb24_skip_ruby; + + int default_profile; } Libaribb24Context; -static unsigned int get_profile_font_size(int profile) +static unsigned int get_profile_font_size(AVCodecContext *avctx) { + Libaribb24Context *b24 = avctx->priv_data; + int profile = avctx->profile; + + if (profile == FF_PROFILE_UNKNOWN) + profile = b24->default_profile; + switch (profile) { case FF_PROFILE_ARIB_PROFILE_A: return 36; @@ -61,26 +69,31 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) { + Libaribb24Context *b24 = avctx->priv_data; unsigned int plane_width = 0; unsigned int plane_height = 0; unsigned int font_size = 0; + int profile = avctx->profile; - switch (avctx->profile) { + if (profile == FF_PROFILE_UNKNOWN) + profile = b24->default_profile; + + switch (profile) { case FF_PROFILE_ARIB_PROFILE_A: plane_width = 960; plane_height = 540; - font_size = get_profile_font_size(avctx->profile); break; case FF_PROFILE_ARIB_PROFILE_C: plane_width = 320; plane_height = 180; - font_size = get_profile_font_size(avctx->profile); break; default: av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n"); return AVERROR(EINVAL); } + font_size = get_profile_font_size(avctx); + avctx->subtitle_header = av_asprintf( "[Script Info]\r\n" "; Script generated by FFmpeg/Lavc%s\r\n" @@ -135,6 +148,7 @@ Libaribb24Context *b24 = avctx->priv_data; void(* arib_dec_init)(arib_decoder_t* decoder) = NULL; int ret_code = AVERROR_EXTERNAL; + int profile = avctx->profile; if (!(b24->lib_instance = arib_instance_new(avctx))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24!\n"); @@ -158,7 +172,10 @@ goto init_fail; } - switch (avctx->profile) { + if (profile == FF_PROFILE_UNKNOWN) + profile = b24->default_profile; + + switch (profile) { case FF_PROFILE_ARIB_PROFILE_A: arib_dec_init = arib_initialize_decoder_a_profile; break; @@ -209,7 +226,7 @@ { 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->profile); + unsigned int profile_font_size = get_profile_font_size(avctx); AVBPrint buf = { 0 }; int ret = 0; @@ -371,6 +388,10 @@ OFFSET(aribb24_base_path), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, { "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"}, { NULL } }; @@ -383,11 +404,12 @@ const FFCodec ff_libaribb24_decoder = { .p.name = "libaribb24", - .p.long_name = NULL_IF_CONFIG_SMALL("libaribb24 ARIB STD-B24 caption decoder"), + CODEC_LONG_NAME("libaribb24 ARIB STD-B24 caption decoder"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ARIB_CAPTION, .p.priv_class = &aribb24_class, .p.wrapper_name = "libaribb24", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcelt_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcelt_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcelt_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcelt_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/intreadwrite.h" struct libcelt_context { @@ -129,11 +129,12 @@ const FFCodec ff_libcelt_decoder = { .p.name = "libcelt", - .p.long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"), + CODEC_LONG_NAME("Xiph CELT decoder using libcelt"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_CELT, .p.capabilities = AV_CODEC_CAP_DR1, .p.wrapper_name = "libcelt", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(struct libcelt_context), .init = libcelt_dec_init, .close = libcelt_dec_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcodec2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcodec2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcodec2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libcodec2.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,8 +24,8 @@ #include "avcodec.h" #include "libavutil/opt.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" -#include "internal.h" #include "codec2utils.h" typedef struct { @@ -105,7 +105,6 @@ //will need to be smarter once we get wideband support if (avctx->sample_rate != 8000 || - avctx->ch_layout.nb_channels != 1 || avctx->sample_fmt != AV_SAMPLE_FMT_S16) { av_log(avctx, AV_LOG_ERROR, "only 8 kHz 16-bit mono allowed\n"); return AVERROR(EINVAL); @@ -178,37 +177,36 @@ const FFCodec ff_libcodec2_decoder = { .p.name = "libcodec2", - .p.long_name = NULL_IF_CONFIG_SMALL("codec2 decoder using libcodec2"), + CODEC_LONG_NAME("codec2 decoder using libcodec2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_CODEC2, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF, .p.supported_samplerates = (const int[]){ 8000, 0 }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_decoder, .close = libcodec2_close, FF_CODEC_DECODE_CB(libcodec2_decode), -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; const FFCodec ff_libcodec2_encoder = { .p.name = "libcodec2", - .p.long_name = NULL_IF_CONFIG_SMALL("codec2 encoder using libcodec2"), + CODEC_LONG_NAME("codec2 encoder using libcodec2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_CODEC2, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.supported_samplerates = (const int[]){ 8000, 0 }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.priv_class = &libcodec2_enc_class, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_encoder, .close = libcodec2_close, FF_CODEC_ENCODE_CB(libcodec2_encode), -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdav1d.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdav1d.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdav1d.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdav1d.c 2023-03-03 13:29:59.000000000 +0000 @@ -41,15 +41,13 @@ typedef struct Libdav1dContext { AVClass *class; Dav1dContext *c; - /* This packet coincides with AVCodecInternal.in_pkt - * and is not owned by us. */ - AVPacket *pkt; AVBufferPool *pool; int pool_size; Dav1dData data; int tile_threads; int frame_threads; + int max_frame_delay; int apply_grain; int operating_point; int all_layers; @@ -218,8 +216,6 @@ #endif int res; - dav1d->pkt = c->internal->in_pkt; - av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version()); dav1d_default_settings(&s); @@ -246,7 +242,9 @@ s.n_threads = FFMAX(dav1d->frame_threads, dav1d->tile_threads); else s.n_threads = FFMIN(threads, DAV1D_MAX_THREADS); - s.max_frame_delay = (c->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 : 0; + if (dav1d->max_frame_delay > 0 && (c->flags & AV_CODEC_FLAG_LOW_DELAY)) + av_log(c, AV_LOG_WARNING, "Low delay mode requested, forcing max_frame_delay 1\n"); + s.max_frame_delay = (c->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 : dav1d->max_frame_delay; av_log(c, AV_LOG_DEBUG, "Using %d threads, %d max_frame_delay\n", s.n_threads, s.max_frame_delay); #else @@ -256,10 +254,21 @@ s.n_frame_threads = dav1d->frame_threads ? dav1d->frame_threads : FFMIN(ceil(threads / s.n_tile_threads), DAV1D_MAX_FRAME_THREADS); + if (dav1d->max_frame_delay > 0) + s.n_frame_threads = FFMIN(s.n_frame_threads, dav1d->max_frame_delay); av_log(c, AV_LOG_DEBUG, "Using %d frame threads, %d tile threads\n", s.n_frame_threads, s.n_tile_threads); #endif +#if FF_DAV1D_VERSION_AT_LEAST(6,8) + if (c->skip_frame >= AVDISCARD_NONKEY) + s.decode_frame_type = DAV1D_DECODEFRAMETYPE_KEY; + else if (c->skip_frame >= AVDISCARD_NONINTRA) + s.decode_frame_type = DAV1D_DECODEFRAMETYPE_INTRA; + else if (c->skip_frame >= AVDISCARD_NONREF) + s.decode_frame_type = DAV1D_DECODEFRAMETYPE_REFERENCE; +#endif + res = libdav1d_parse_extradata(c); if (res < 0) return res; @@ -279,6 +288,13 @@ dav1d_flush(dav1d->c); } +typedef struct OpaqueData { + void *pkt_orig_opaque; +#if FF_API_REORDERED_OPAQUE + int64_t reordered_opaque; +#endif +} OpaqueData; + static void libdav1d_data_free(const uint8_t *data, void *opaque) { AVBufferRef *buf = opaque; @@ -286,8 +302,10 @@ } static void libdav1d_user_data_free(const uint8_t *data, void *opaque) { + AVPacket *pkt = opaque; av_assert0(data == opaque); - av_free(opaque); + av_free(pkt->opaque); + av_packet_free(&pkt); } static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) @@ -295,52 +313,68 @@ Libdav1dContext *dav1d = c->priv_data; Dav1dData *data = &dav1d->data; Dav1dPicture pic = { 0 }, *p = &pic; + AVPacket *pkt; + OpaqueData *od = NULL; #if FF_DAV1D_VERSION_AT_LEAST(5,1) enum Dav1dEventFlags event_flags = 0; #endif int res; if (!data->sz) { - AVPacket *const pkt = dav1d->pkt; + pkt = av_packet_alloc(); + + if (!pkt) + return AVERROR(ENOMEM); res = ff_decode_get_packet(c, pkt); - if (res < 0 && res != AVERROR_EOF) + if (res < 0 && res != AVERROR_EOF) { + av_packet_free(&pkt); return res; + } if (pkt->size) { res = dav1d_data_wrap(data, pkt->data, pkt->size, libdav1d_data_free, pkt->buf); if (res < 0) { - av_packet_unref(pkt); + av_packet_free(&pkt); return res; } - data->m.timestamp = pkt->pts; - data->m.offset = pkt->pos; - data->m.duration = pkt->duration; - pkt->buf = NULL; - av_packet_unref(pkt); - if (c->reordered_opaque != AV_NOPTS_VALUE) { - uint8_t *reordered_opaque = av_memdup(&c->reordered_opaque, - sizeof(c->reordered_opaque)); - if (!reordered_opaque) { +FF_DISABLE_DEPRECATION_WARNINGS + if ( +#if FF_API_REORDERED_OPAQUE + c->reordered_opaque != AV_NOPTS_VALUE || +#endif + (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE))) { + od = av_mallocz(sizeof(*od)); + if (!od) { + av_packet_free(&pkt); dav1d_data_unref(data); return AVERROR(ENOMEM); } + od->pkt_orig_opaque = pkt->opaque; +#if FF_API_REORDERED_OPAQUE + od->reordered_opaque = c->reordered_opaque; +#endif +FF_ENABLE_DEPRECATION_WARNINGS + } + pkt->opaque = od; - res = dav1d_data_wrap_user_data(data, reordered_opaque, - libdav1d_user_data_free, reordered_opaque); - if (res < 0) { - av_free(reordered_opaque); - dav1d_data_unref(data); - return res; - } + res = dav1d_data_wrap_user_data(data, (const uint8_t *)pkt, + libdav1d_user_data_free, pkt); + if (res < 0) { + av_free(pkt->opaque); + av_packet_free(&pkt); + dav1d_data_unref(data); + return res; } - } else if (res >= 0) { - av_packet_unref(pkt); - return AVERROR(EAGAIN); + pkt = NULL; + } else { + av_packet_free(&pkt); + if (res >= 0) + return AVERROR(EAGAIN); } } @@ -405,17 +439,29 @@ INT_MAX); ff_set_sar(c, frame->sample_aspect_ratio); - if (p->m.user_data.data) - memcpy(&frame->reordered_opaque, p->m.user_data.data, sizeof(frame->reordered_opaque)); + pkt = (AVPacket *)p->m.user_data.data; + od = pkt->opaque; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + if (od && od->reordered_opaque != AV_NOPTS_VALUE) + frame->reordered_opaque = od->reordered_opaque; else frame->reordered_opaque = AV_NOPTS_VALUE; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + // restore the original user opaque value for + // ff_decode_frame_props_from_pkt() + pkt->opaque = od ? od->pkt_orig_opaque : NULL; + av_freep(&od); // match timestamps and packet size - frame->pts = p->m.timestamp; - frame->pkt_dts = p->m.timestamp; - frame->pkt_pos = p->m.offset; - frame->pkt_size = p->m.size; - frame->pkt_duration = p->m.duration; + res = ff_decode_frame_props_from_pkt(c, frame, pkt); + pkt->opaque = NULL; + if (res < 0) + goto fail; + + frame->pkt_dts = pkt->pts; frame->key_frame = p->frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY; switch (p->frame_hdr->frame_type) { @@ -555,12 +601,16 @@ #ifndef DAV1D_MAX_TILE_THREADS #define DAV1D_MAX_TILE_THREADS DAV1D_MAX_THREADS #endif +#ifndef DAV1D_MAX_FRAME_DELAY +#define DAV1D_MAX_FRAME_DELAY DAV1D_MAX_FRAME_THREADS +#endif #define OFFSET(x) offsetof(Libdav1dContext, x) #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM static const AVOption libdav1d_options[] = { { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD | AV_OPT_FLAG_DEPRECATED }, { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD | AV_OPT_FLAG_DEPRECATED }, + { "max_frame_delay", "Max frame delay", OFFSET(max_frame_delay), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_DELAY, VD }, { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD | AV_OPT_FLAG_DEPRECATED }, { "oppoint", "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 31, VD }, { "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD }, @@ -576,7 +626,7 @@ const FFCodec ff_libdav1d_decoder = { .p.name = "libdav1d", - .p.long_name = NULL_IF_CONFIG_SMALL("dav1d AV1 decoder by VideoLAN"), + CODEC_LONG_NAME("dav1d AV1 decoder by VideoLAN"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(Libdav1dContext), @@ -585,7 +635,7 @@ .flush = libdav1d_flush, FF_CODEC_RECEIVE_FRAME_CB(libdav1d_receive_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS | + .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_SETS_FRAME_PROPS | FF_CODEC_CAP_AUTO_THREADS, .p.priv_class = &libdav1d_class, .p.wrapper_name = "libdav1d", diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdavs2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdavs2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdavs2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libdavs2.c 2023-03-03 13:29:59.000000000 +0000 @@ -223,7 +223,7 @@ const FFCodec ff_libdavs2_decoder = { .p.name = "libdavs2", - .p.long_name = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"), + CODEC_LONG_NAME("libdavs2 AVS2-P2/IEEE1857.4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVS2, .priv_data_size = sizeof(DAVS2Context), @@ -232,7 +232,8 @@ FF_CODEC_DECODE_CB(davs2_decode_frame), .flush = davs2_flush, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.wrapper_name = "libdavs2", diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #ifdef AACDECODER_LIB_VL0 #define FDKDEC_VER_AT_LEAST(vl0, vl1) \ @@ -478,7 +478,7 @@ const FFCodec ff_libfdk_aac_decoder = { .p.name = "libfdk_aac", - .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), + CODEC_LONG_NAME("Fraunhofer FDK AAC"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(FDKAACDecContext), @@ -492,7 +492,6 @@ #endif , .p.priv_class = &fdk_aac_dec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "libfdk", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libfdk-aacenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -187,6 +187,9 @@ case 4: mode = MODE_1_2_1; sce = 2; cpe = 1; break; case 5: mode = MODE_1_2_2; sce = 1; cpe = 2; break; case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break; +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + case 7: mode = MODE_6_1; sce = 3; cpe = 2; break; +#endif /* The version macro is introduced the same time as the 7.1 support, so this should suffice. */ #if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12 @@ -195,6 +198,10 @@ cpe = 3; if (!av_channel_layout_compare(&avctx->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1)) { mode = MODE_7_1_REAR_SURROUND; +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + } else if (!av_channel_layout_compare(&avctx->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK)) { + mode = MODE_7_1_TOP_FRONT; +#endif } else { // MODE_1_2_2_2_1 and MODE_7_1_FRONT_CENTER use the same channel layout mode = MODE_7_1_FRONT_CENTER; @@ -448,10 +455,16 @@ AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + AV_CH_LAYOUT_6POINT1_BACK, +#endif #if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12 AV_CH_LAYOUT_7POINT1_WIDE_BACK, AV_CH_LAYOUT_7POINT1, #endif +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + AV_CH_LAYOUT_7POINT1_TOP_BACK, +#endif 0, }; #endif /* FF_API_OLD_CHANNEL_LAYOUT */ @@ -463,10 +476,16 @@ AV_CHANNEL_LAYOUT_4POINT0, AV_CHANNEL_LAYOUT_5POINT0_BACK, AV_CHANNEL_LAYOUT_5POINT1_BACK, -#ifdef AACENCODER_LIB_VL0 +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + AV_CHANNEL_LAYOUT_6POINT1_BACK, +#endif +#if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12 AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, AV_CHANNEL_LAYOUT_7POINT1, #endif +#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 + AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK, +#endif { 0 }, }; @@ -477,14 +496,16 @@ const FFCodec ff_libfdk_aac_encoder = { .p.name = "libfdk_aac", - .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), + CODEC_LONG_NAME("Fraunhofer FDK AAC"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(AACContext), .init = aac_encode_init, FF_CODEC_ENCODE_CB(aac_encode_frame), .close = aac_encode_close, - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.priv_class = &aac_enc_class, @@ -492,8 +513,6 @@ .p.profiles = profiles, .p.supported_samplerates = aac_sample_rates, .p.wrapper_name = "libfdk", -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = aac_channel_layout, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layouts, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,7 +40,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "gsm.h" typedef struct LibGSMDecodeContext { @@ -127,11 +127,12 @@ #if CONFIG_LIBGSM_DECODER const FFCodec ff_libgsm_decoder = { .p.name = "libgsm", - .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), + CODEC_LONG_NAME("libgsm GSM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.wrapper_name = "libgsm", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, @@ -142,11 +143,12 @@ #if CONFIG_LIBGSM_MS_DECODER const FFCodec ff_libgsm_ms_decoder = { .p.name = "libgsm_ms", - .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), + CODEC_LONG_NAME("libgsm GSM Microsoft variant"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM_MS, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.wrapper_name = "libgsm", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libgsmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -119,40 +119,38 @@ #if CONFIG_LIBGSM_ENCODER const FFCodec ff_libgsm_encoder = { .p.name = "libgsm", - .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), + CODEC_LONG_NAME("libgsm GSM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = libgsm_encode_init, FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.wrapper_name = "libgsm", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, }; #endif #if CONFIG_LIBGSM_MS_ENCODER const FFCodec ff_libgsm_ms_encoder = { .p.name = "libgsm_ms", - .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), + CODEC_LONG_NAME("libgsm GSM Microsoft variant"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_GSM_MS, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = libgsm_encode_init, FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.wrapper_name = "libgsm", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libilbc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libilbc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libilbc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libilbc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,8 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" -#include "internal.h" #ifndef LIBILBC_VERSION_MAJOR #define LIBILBC_VERSION_MAJOR 2 @@ -119,9 +119,10 @@ const FFCodec ff_libilbc_decoder = { .p.name = "libilbc", - .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + CODEC_LONG_NAME("iLBC (Internet Low Bitrate Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ILBC, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(ILBCDecContext), .init = ilbc_decode_init, FF_CODEC_DECODE_CB(ilbc_decode_frame), @@ -201,9 +202,11 @@ const FFCodec ff_libilbc_encoder = { .p.name = "libilbc", - .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + CODEC_LONG_NAME("iLBC (Internet Low Bitrate Codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ILBC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(ILBCEncContext), .init = ilbc_encode_init, FF_CODEC_ENCODE_CB(ilbc_encode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxldec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxldec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxldec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxldec.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,7 +36,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include #include @@ -47,6 +47,9 @@ JxlDecoder *decoder; JxlBasicInfo basic_info; JxlPixelFormat jxl_pixfmt; +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + JxlBitDepth jxl_bit_depth; +#endif JxlDecoderStatus events; AVBufferRef *iccp; } LibJxlDecodeContext; @@ -93,10 +96,17 @@ return libjxl_init_jxl_decoder(avctx); } -static enum AVPixelFormat libjxl_get_pix_fmt(void *avctx, const JxlBasicInfo *basic_info, JxlPixelFormat *format) +static enum AVPixelFormat libjxl_get_pix_fmt(AVCodecContext *avctx, LibJxlDecodeContext *ctx) { + const JxlBasicInfo *basic_info = &ctx->basic_info; + JxlPixelFormat *format = &ctx->jxl_pixfmt; format->endianness = JXL_NATIVE_ENDIAN; format->num_channels = basic_info->num_color_channels + (basic_info->alpha_bits > 0); +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + ctx->jxl_bit_depth.bits_per_sample = avctx->bits_per_raw_sample = basic_info->bits_per_sample; + ctx->jxl_bit_depth.type = JXL_BIT_DEPTH_FROM_PIXEL_FORMAT; + ctx->jxl_bit_depth.exponent_bits_per_sample = basic_info->exponent_bits_per_sample; +#endif /* Gray */ if (basic_info->num_color_channels == 1) { if (basic_info->bits_per_sample <= 8) { @@ -119,10 +129,10 @@ format->data_type = JXL_TYPE_UINT8; return basic_info->alpha_bits ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24; } - if (basic_info->bits_per_sample > 16) - av_log(avctx, AV_LOG_WARNING, "Downsampling larger integer to 16-bit via libjxl\n"); if (basic_info->exponent_bits_per_sample) av_log(avctx, AV_LOG_WARNING, "Downsampling float to 16-bit integer via libjxl\n"); + else if (basic_info->bits_per_sample > 16) + av_log(avctx, AV_LOG_WARNING, "Downsampling larger integer to 16-bit via libjxl\n"); format->data_type = JXL_TYPE_UINT16; return basic_info->alpha_bits ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48; } @@ -367,7 +377,7 @@ av_log(avctx, AV_LOG_ERROR, "Bad libjxl basic info event\n"); return AVERROR_EXTERNAL; } - avctx->pix_fmt = libjxl_get_pix_fmt(avctx, &ctx->basic_info, &ctx->jxl_pixfmt); + avctx->pix_fmt = libjxl_get_pix_fmt(avctx, ctx); if (avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log(avctx, AV_LOG_ERROR, "Bad libjxl pixel format\n"); return AVERROR_EXTERNAL; @@ -390,6 +400,12 @@ av_log(avctx, AV_LOG_ERROR, "Bad libjxl dec need image out buffer event\n"); return AVERROR_EXTERNAL; } +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + if (JxlDecoderSetImageOutBitDepth(ctx->decoder, &ctx->jxl_bit_depth) != JXL_DEC_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Error setting output bit depth\n"); + return AVERROR_EXTERNAL; + } +#endif continue; case JXL_DEC_FULL_IMAGE: /* full image is one frame, even if animated */ @@ -447,7 +463,7 @@ const FFCodec ff_libjxl_decoder = { .p.name = "libjxl", - .p.long_name = NULL_IF_CONFIG_SMALL("libjxl JPEG XL"), + CODEC_LONG_NAME("libjxl JPEG XL"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEGXL, .priv_data_size = sizeof(LibJxlDecodeContext), @@ -455,6 +471,8 @@ FF_CODEC_DECODE_CB(libjxl_decode_frame), .close = libjxl_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_ICC_PROFILES, .p.wrapper_name = "libjxl", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxlenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxlenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxlenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxlenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -250,6 +250,10 @@ JxlBasicInfo info; JxlColorEncoding jxl_color; JxlPixelFormat jxl_fmt; + int bits_per_sample; +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + JxlBitDepth jxl_bit_depth; +#endif JxlEncoderStatus jret; int ret; size_t available = ctx->buffer_size; @@ -269,7 +273,9 @@ info.ysize = frame->height; info.num_extra_channels = (jxl_fmt.num_channels + 1) % 2; info.num_color_channels = jxl_fmt.num_channels - info.num_extra_channels; - info.bits_per_sample = av_get_bits_per_pixel(pix_desc) / jxl_fmt.num_channels; + bits_per_sample = av_get_bits_per_pixel(pix_desc) / jxl_fmt.num_channels; + info.bits_per_sample = avctx->bits_per_raw_sample > 0 && !(pix_desc->flags & AV_PIX_FMT_FLAG_FLOAT) + ? avctx->bits_per_raw_sample : bits_per_sample; info.alpha_bits = (info.num_extra_channels > 0) * info.bits_per_sample; if (pix_desc->flags & AV_PIX_FMT_FLAG_FLOAT) { info.exponent_bits_per_sample = info.bits_per_sample > 16 ? 8 : 5; @@ -281,6 +287,13 @@ jxl_fmt.data_type = info.bits_per_sample <= 8 ? JXL_TYPE_UINT8 : JXL_TYPE_UINT16; } +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + jxl_bit_depth.bits_per_sample = bits_per_sample; + jxl_bit_depth.type = JXL_BIT_DEPTH_FROM_PIXEL_FORMAT; + jxl_bit_depth.exponent_bits_per_sample = pix_desc->flags & AV_PIX_FMT_FLAG_FLOAT ? + info.exponent_bits_per_sample : 0; +#endif + /* JPEG XL format itself does not support limited range */ if (avctx->color_range == AVCOL_RANGE_MPEG || avctx->color_range == AVCOL_RANGE_UNSPECIFIED && frame->color_range == AVCOL_RANGE_MPEG) @@ -357,6 +370,11 @@ if (JxlEncoderSetColorEncoding(ctx->encoder, &jxl_color) != JXL_ENC_SUCCESS) av_log(avctx, AV_LOG_WARNING, "Failed to set JxlColorEncoding\n"); +#if JPEGXL_NUMERIC_VERSION >= JPEGXL_COMPUTE_NUMERIC_VERSION(0, 8, 0) + if (JxlEncoderSetFrameBitDepth(ctx->options, &jxl_bit_depth) != JXL_ENC_SUCCESS) + av_log(avctx, AV_LOG_WARNING, "Failed to set JxlBitDepth\n"); +#endif + /* depending on basic info, level 10 might * be required instead of level 5 */ if (JxlEncoderGetRequiredCodestreamLevel(ctx->encoder) > 5) { @@ -460,15 +478,18 @@ const FFCodec ff_libjxl_encoder = { .p.name = "libjxl", - .p.long_name = NULL_IF_CONFIG_SMALL("libjxl JPEG XL"), + CODEC_LONG_NAME("libjxl JPEG XL"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEGXL, .priv_data_size = sizeof(LibJxlEncodeContext), .init = libjxl_encode_init, FF_CODEC_ENCODE_CB(libjxl_encode_frame), .close = libjxl_encode_close, - .p.capabilities = AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_ICC_PROFILES, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxl.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxl.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxl.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libjxl.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,20 @@ #ifndef AVCODEC_LIBJXL_H #define AVCODEC_LIBJXL_H +#include #include +/* + * libjxl version 0.7.0 and earlier doesn't contain these macros at all + * so to detect version 0.7.0 versus 0.8.0 we need to define them ourselves + */ +#ifndef JPEGXL_COMPUTE_NUMERIC_VERSION + #define JPEGXL_COMPUTE_NUMERIC_VERSION(major,minor,patch) ((major<<24) | (minor<<16) | (patch<<8) | 0) +#endif +#ifndef JPEGXL_NUMERIC_VERSION + #define JPEGXL_NUMERIC_VERSION JPEGXL_COMPUTE_NUMERIC_VERSION(0, 7, 0) +#endif + /** * Transform threadcount in ffmpeg to one used by libjxl. * diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libkvazaar.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libkvazaar.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libkvazaar.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libkvazaar.c 2023-03-03 13:29:59.000000000 +0000 @@ -320,7 +320,7 @@ const FFCodec ff_libkvazaar_encoder = { .p.name = "libkvazaar", - .p.long_name = NULL_IF_CONFIG_SMALL("libkvazaar H.265 / HEVC"), + CODEC_LONG_NAME("libkvazaar H.265 / HEVC"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -335,7 +335,7 @@ FF_CODEC_ENCODE_CB(libkvazaar_encode), .close = libkvazaar_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, .p.wrapper_name = "libkvazaar", diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libmp3lame.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libmp3lame.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libmp3lame.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libmp3lame.c 2023-03-03 13:29:59.000000000 +0000 @@ -330,11 +330,12 @@ const FFCodec ff_libmp3lame_encoder = { .p.name = "libmp3lame", - .p.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("libmp3lame MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LAMEContext), .init = mp3lame_encode_init, FF_CODEC_ENCODE_CB(mp3lame_encode_frame), @@ -344,11 +345,7 @@ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libmp3lame_sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopencore-amr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopencore-amr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopencore-amr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopencore-amr.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,8 +30,8 @@ #include "avcodec.h" #include "audio_frame_queue.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" -#include "internal.h" #if CONFIG_LIBOPENCORE_AMRNB_DECODER || CONFIG_LIBOPENCORE_AMRWB_DECODER static int amr_decode_fix_avctx(AVCodecContext *avctx) @@ -135,9 +135,10 @@ const FFCodec ff_libopencore_amrnb_decoder = { .p.name = "libopencore_amrnb", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), + CODEC_LONG_NAME("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_NB, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(AMRContext), .init = amr_nb_decode_init, .close = amr_nb_decode_close, @@ -290,14 +291,16 @@ const FFCodec ff_libopencore_amrnb_encoder = { .p.name = "libopencore_amrnb", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), + CODEC_LONG_NAME("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_NB, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(AMRContext), .init = amr_nb_encode_init, FF_CODEC_ENCODE_CB(amr_nb_encode_frame), .close = amr_nb_encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.priv_class = &amrnb_class, @@ -374,11 +377,12 @@ const FFCodec ff_libopencore_amrwb_decoder = { .p.name = "libopencore_amrwb", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"), + CODEC_LONG_NAME("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_WB, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.wrapper_name = "libopencore_amrwb", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_decode_init, .close = amr_wb_decode_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libopenh264.h" typedef struct SVCContext { @@ -158,7 +158,7 @@ const FFCodec ff_libopenh264_decoder = { .p.name = "libopenh264", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + CODEC_LONG_NAME("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(SVCContext), @@ -166,7 +166,7 @@ FF_CODEC_DECODE_CB(svc_decode_frame), .close = svc_decode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_THREADSAFE | + .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, .bsfs = "h264_mp4toannexb", .p.wrapper_name = "libopenh264", diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenh264enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -50,9 +50,6 @@ int max_nal_size; int skip_frames; int skipped; -#if FF_API_OPENH264_CABAC - int cabac; // deprecated -#endif int coder; // rate control mode @@ -63,22 +60,6 @@ #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define DEPRECATED AV_OPT_FLAG_DEPRECATED static const AVOption options[] = { -#if FF_API_OPENH264_SLICE_MODE -#if OPENH264_VER_AT_LEAST(1, 6) - { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_FIXEDSLCNUM_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" }, -#else - { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" }, -#endif - { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" }, -#if OPENH264_VER_AT_LEAST(1, 6) - { "dyn", "Size limited (compatibility name)", 0, AV_OPT_TYPE_CONST, { .i64 = SM_SIZELIMITED_SLICE }, 0, 0, VE, "slice_mode" }, - { "sizelimited", "Size limited", 0, AV_OPT_TYPE_CONST, { .i64 = SM_SIZELIMITED_SLICE }, 0, 0, VE, "slice_mode" }, -#else - { "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" }, - { "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" }, - { "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" }, -#endif -#endif { "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" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile" @@ -88,9 +69,6 @@ #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 }, -#if FF_API_OPENH264_CABAC - { "cabac", "Enable cabac(deprecated, use coder)", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE|DEPRECATED }, -#endif { "coder", "Coder type", OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE, "coder" }, { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, VE, "coder" }, { "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "coder" }, @@ -453,15 +431,16 @@ const FFCodec ff_libopenh264_encoder = { .p.name = "libopenh264", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + CODEC_LONG_NAME("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SVCContext), .init = svc_encode_init, FF_CODEC_ENCODE_CB(svc_encode_frame), .close = svc_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "thread.h" #include @@ -502,13 +502,14 @@ const FFCodec ff_libopenjpeg_decoder = { .p.name = "libopenjpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), + CODEC_LONG_NAME("OpenJPEG JPEG 2000"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEG2000, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .p.max_lowres = 31, .p.priv_class = &openjpeg_class, .p.wrapper_name = "libopenjpeg", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_decode_init, FF_CODEC_DECODE_CB(libopenjpeg_decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopenjpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -756,13 +756,15 @@ const FFCodec ff_libopenjpeg_encoder = { .p.name = "libopenjpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), + CODEC_LONG_NAME("OpenJPEG JPEG 2000"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_JPEG2000, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_encode_init, FF_CODEC_ENCODE_CB(libopenjpeg_encode_frame), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBR24P, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,10 +29,11 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "internal.h" -#include "vorbis.h" #include "mathops.h" #include "libopus.h" +#include "vorbis_data.h" struct libopus_context { AVClass *class; @@ -232,7 +233,7 @@ const FFCodec ff_libopus_decoder = { .p.name = "libopus", - .p.long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), + CODEC_LONG_NAME("libopus Opus"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(struct libopus_context), @@ -241,7 +242,8 @@ FF_CODEC_DECODE_CB(libopus_decode), .flush = libopus_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libopusenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,8 +29,8 @@ #include "codec_internal.h" #include "encode.h" #include "libopus.h" -#include "vorbis.h" #include "audio_frame_queue.h" +#include "vorbis_data.h" typedef struct LibopusEncOpts { int vbr; @@ -459,7 +459,7 @@ const int bytes_per_sample = av_get_bytes_per_sample(avctx->sample_fmt); const int channels = avctx->ch_layout.nb_channels; const int sample_size = channels * bytes_per_sample; - uint8_t *audio; + const uint8_t *audio; int ret; int discard_padding; @@ -470,18 +470,18 @@ if (opus->encoder_channel_map != NULL) { audio = opus->samples; libopus_copy_samples_with_channel_map( - audio, frame->data[0], opus->encoder_channel_map, + opus->samples, frame->data[0], opus->encoder_channel_map, channels, frame->nb_samples, bytes_per_sample); } else if (frame->nb_samples < opus->opts.packet_size) { audio = opus->samples; - memcpy(audio, frame->data[0], frame->nb_samples * sample_size); + memcpy(opus->samples, frame->data[0], frame->nb_samples * sample_size); } else audio = frame->data[0]; } else { if (!opus->afq.remaining_samples || (!opus->afq.frame_alloc && !opus->afq.frame_count)) return 0; audio = opus->samples; - memset(audio, 0, opus->opts.packet_size * sample_size); + memset(opus->samples, 0, opus->opts.packet_size * sample_size); } /* Maximum packet size taken from opusenc in opus-tools. 120ms packets @@ -491,11 +491,11 @@ return ret; if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT) - ret = opus_multistream_encode_float(opus->enc, (float *)audio, + ret = opus_multistream_encode_float(opus->enc, (const float *)audio, opus->opts.packet_size, avpkt->data, avpkt->size); else - ret = opus_multistream_encode(opus->enc, (opus_int16 *)audio, + ret = opus_multistream_encode(opus->enc, (const opus_int16 *)audio, opus->opts.packet_size, avpkt->data, avpkt->size); @@ -585,14 +585,16 @@ const FFCodec ff_libopus_encoder = { .p.name = "libopus", - .p.long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), + CODEC_LONG_NAME("libopus Opus"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_OPUS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibopusEncContext), .init = libopus_encode_init, FF_CODEC_ENCODE_CB(libopus_encode), .close = libopus_encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librav1e.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librav1e.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librav1e.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librav1e.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include +#include "libavutil/buffer.h" #include "libavutil/internal.h" #include "libavutil/avassert.h" #include "libavutil/base64.h" @@ -30,7 +31,6 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avcodec.h" -#include "bsf.h" #include "codec_internal.h" #include "encode.h" #include "internal.h" @@ -41,7 +41,6 @@ RaContext *ctx; AVFrame *frame; RaFrame *rframe; - AVBSFContext *bsf; uint8_t *pass_data; size_t pass_pos; @@ -55,6 +54,17 @@ int tile_cols; } librav1eContext; +typedef struct FrameData { + int64_t pts; + int64_t duration; +#if FF_API_REORDERED_OPAQUE + int64_t reordered_opaque; +#endif + + void *frame_opaque; + AVBufferRef *frame_opaque_ref; +} FrameData; + static inline RaPixelRange range_map(enum AVPixelFormat pix_fmt, enum AVColorRange range) { switch (pix_fmt) { @@ -176,7 +186,6 @@ } av_frame_free(&ctx->frame); - av_bsf_free(&ctx->bsf); av_freep(&ctx->pass_data); return 0; @@ -245,41 +254,10 @@ } } - if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { - const AVBitStreamFilter *filter = av_bsf_get_by_name("extract_extradata"); - int bret; - - if (!filter) { - av_log(avctx, AV_LOG_ERROR, "extract_extradata bitstream filter " - "not found. This is a bug, please report it.\n"); - ret = AVERROR_BUG; - goto end; - } - - bret = av_bsf_alloc(filter, &ctx->bsf); - if (bret < 0) { - ret = bret; - goto end; - } - - bret = avcodec_parameters_from_context(ctx->bsf->par_in, avctx); - if (bret < 0) { - ret = bret; - goto end; - } - - bret = av_bsf_init(ctx->bsf); - if (bret < 0) { - ret = bret; - goto end; - } - } - { - AVDictionaryEntry *en = NULL; - while ((en = av_dict_get(ctx->rav1e_opts, "", en, AV_DICT_IGNORE_SUFFIX))) { - int parse_ret = rav1e_config_parse(cfg, en->key, en->value); - if (parse_ret < 0) + const AVDictionaryEntry *en = NULL; + while ((en = av_dict_iterate(ctx->rav1e_opts, en))) { + if (rav1e_config_parse(cfg, en->key, en->value) < 0) av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s.\n", en->key, en->value); } } @@ -298,6 +276,12 @@ goto end; } + if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) + rav1e_config_set_sample_aspect_ratio(cfg, (RaRational) { + avctx->sample_aspect_ratio.num, + avctx->sample_aspect_ratio.den + }); + rret = rav1e_config_parse_int(cfg, "threads", avctx->thread_count); if (rret < 0) av_log(avctx, AV_LOG_WARNING, "Invalid number of threads, defaulting to auto.\n"); @@ -421,6 +405,23 @@ goto end; } + if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { + RaData *seq_hdr = rav1e_container_sequence_header(ctx->ctx); + + if (seq_hdr) + avctx->extradata = av_mallocz(seq_hdr->len + AV_INPUT_BUFFER_PADDING_SIZE); + if (!seq_hdr || !avctx->extradata) { + rav1e_data_unref(seq_hdr); + av_log(avctx, AV_LOG_ERROR, "Failed to get extradata.\n"); + ret = seq_hdr ? AVERROR(ENOMEM) : AVERROR_EXTERNAL; + goto end; + } + + memcpy(avctx->extradata, seq_hdr->data, seq_hdr->len); + avctx->extradata_size = seq_hdr->len; + rav1e_data_unref(seq_hdr); + } + ret = 0; end: @@ -430,11 +431,23 @@ return ret; } +static void frame_data_free(void *data) +{ + FrameData *fd = data; + + if (!fd) + return; + + av_buffer_unref(&fd->frame_opaque_ref); + av_free(data); +} + static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt) { librav1eContext *ctx = avctx->priv_data; RaFrame *rframe = ctx->rframe; RaPacket *rpkt = NULL; + FrameData *fd; int ret; if (!rframe) { @@ -447,18 +460,34 @@ if (frame->buf[0]) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); - int64_t *pts = av_malloc(sizeof(int64_t)); - if (!pts) { + fd = av_mallocz(sizeof(*fd)); + if (!fd) { av_log(avctx, AV_LOG_ERROR, "Could not allocate PTS buffer.\n"); return AVERROR(ENOMEM); } - *pts = frame->pts; + fd->pts = frame->pts; + fd->duration = frame->duration; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + fd->reordered_opaque = frame->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + fd->frame_opaque = frame->opaque; + ret = av_buffer_replace(&fd->frame_opaque_ref, frame->opaque_ref); + if (ret < 0) { + frame_data_free(fd); + av_frame_unref(frame); + return ret; + } + } rframe = rav1e_frame_new(ctx->ctx); if (!rframe) { av_log(avctx, AV_LOG_ERROR, "Could not allocate new rav1e frame.\n"); av_frame_unref(frame); - av_freep(&pts); + frame_data_free(fd); return AVERROR(ENOMEM); } @@ -470,7 +499,7 @@ frame->linesize[i], bytes); } av_frame_unref(frame); - rav1e_frame_set_opaque(rframe, pts, av_free); + rav1e_frame_set_opaque(rframe, fd, frame_data_free); } } @@ -546,26 +575,50 @@ if (rpkt->frame_type == RA_FRAME_TYPE_KEY) pkt->flags |= AV_PKT_FLAG_KEY; - pkt->pts = pkt->dts = *((int64_t *) rpkt->opaque); - av_free(rpkt->opaque); - rav1e_packet_unref(rpkt); + fd = rpkt->opaque; + pkt->pts = pkt->dts = fd->pts; + pkt->duration = fd->duration; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + avctx->reordered_opaque = fd->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + pkt->opaque = fd->frame_opaque; + pkt->opaque_ref = fd->frame_opaque_ref; + fd->frame_opaque_ref = NULL; + } + + frame_data_free(fd); + + if (avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { + AVCodecInternal *avci = avctx->internal; + AVFrame *frame = avci->recon_frame; + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); + + av_frame_unref(frame); + + frame->format = avctx->pix_fmt; + frame->width = avctx->width; + frame->height = avctx->height; - if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { - int ret = av_bsf_send_packet(ctx->bsf, pkt); + ret = ff_encode_alloc_frame(avctx, frame); if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "extradata extraction send failed.\n"); - av_packet_unref(pkt); + rav1e_packet_unref(rpkt); return ret; } - ret = av_bsf_receive_packet(ctx->bsf, pkt); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "extradata extraction receive failed.\n"); - av_packet_unref(pkt); - return ret; + for (int i = 0; i < desc->nb_components; i++) { + int shift = i ? desc->log2_chroma_h : 0; + rav1e_frame_extract_plane(rpkt->rec, i, frame->data[i], + (frame->height >> shift) * frame->linesize[i], + frame->linesize[i], desc->comp[i].step); } } + rav1e_packet_unref(rpkt); + return 0; } @@ -616,7 +669,7 @@ const FFCodec ff_librav1e_encoder = { .p.name = "librav1e", - .p.long_name = NULL_IF_CONFIG_SMALL("librav1e AV1"), + CODEC_LONG_NAME("librav1e AV1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .init = librav1e_encode_init, @@ -627,7 +680,9 @@ .defaults = librav1e_defaults, .p.pix_fmts = librav1e_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, + AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_RECON_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, .p.wrapper_name = "librav1e", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librsvgdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librsvgdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librsvgdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/librsvgdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/opt.h" #include "librsvg-2.0/librsvg/rsvg.h" @@ -120,7 +120,7 @@ const FFCodec ff_librsvg_decoder = { .p.name = "librsvg", - .p.long_name = NULL_IF_CONFIG_SMALL("Librsvg rasterizer"), + CODEC_LONG_NAME("Librsvg rasterizer"), .p.priv_class = &librsvg_decoder_class, .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SVG, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libshine.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libshine.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libshine.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libshine.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,11 +44,6 @@ { SHINEContext *s = avctx->priv_data; - if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > 2){ - av_log(avctx, AV_LOG_ERROR, "only mono or stereo is supported\n"); - return AVERROR(EINVAL); - } - shine_set_config_mpeg_defaults(&s->config.mpeg); if (avctx->bit_rate) s->config.mpeg.bitr = avctx->bit_rate / 1000; @@ -133,10 +128,11 @@ const FFCodec ff_libshine_encoder = { .p.name = "libshine", - .p.long_name = NULL_IF_CONFIG_SMALL("libshine MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("libshine MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(SHINEContext), .init = libshine_encode_init, FF_CODEC_ENCODE_CB(libshine_encode_frame), @@ -144,11 +140,7 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libshine_sample_rates, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "libavutil/common.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct LibSpeexContext { SpeexBits bits; @@ -192,11 +192,12 @@ const FFCodec ff_libspeex_decoder = { .p.name = "libspeex", - .p.long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), + CODEC_LONG_NAME("libspeex Speex"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SPEEX, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.wrapper_name = "libspeex", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibSpeexContext), .init = libspeex_decode_init, .close = libspeex_decode_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libspeexenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -152,13 +152,6 @@ int header_size; int32_t complexity; - /* channels */ - if (channels < 1 || channels > 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid channels (%d). Only stereo and " - "mono are supported\n", channels); - return AVERROR(EINVAL); - } - /* sample rate and encoding mode */ switch (avctx->sample_rate) { case 8000: mode = speex_lib_get_mode(SPEEX_MODEID_NB); break; @@ -350,21 +343,18 @@ const FFCodec ff_libspeex_encoder = { .p.name = "libspeex", - .p.long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), + CODEC_LONG_NAME("libspeex Speex"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SPEEX, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibSpeexEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libsvtav1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libsvtav1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libsvtav1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libsvtav1.c 2023-03-03 13:29:59.000000000 +0000 @@ -124,16 +124,12 @@ static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc) { - const int pack_mode_10bit = - (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0; - const size_t luma_size_8bit = - config->source_width * config->source_height * (1 << pack_mode_10bit); - const size_t luma_size_10bit = - (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0; + const size_t luma_size = config->source_width * config->source_height * + (config->encoder_bit_depth > 8 ? 2 : 1); EbSvtIOFormat *in_data; - svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2; + svt_enc->raw_size = luma_size * 3 / 2; // allocate buffer for in and out svt_enc->in_buf = av_mallocz(sizeof(*svt_enc->in_buf)); @@ -159,14 +155,19 @@ // Update param from options #if FF_API_SVTAV1_OPTS - param->hierarchical_levels = svt_enc->hierarchical_level; - param->tier = svt_enc->tier; - param->scene_change_detection = svt_enc->scd; - param->tile_columns = svt_enc->tile_columns; - param->tile_rows = svt_enc->tile_rows; + if (svt_enc->hierarchical_level >= 0) + param->hierarchical_levels = svt_enc->hierarchical_level; + if (svt_enc->tier >= 0) + param->tier = svt_enc->tier; + if (svt_enc->scd >= 0) + param->scene_change_detection = svt_enc->scd; + if (svt_enc->tile_columns >= 0) + param->tile_columns = svt_enc->tile_columns; + if (svt_enc->tile_rows >= 0) + param->tile_rows = svt_enc->tile_rows; if (svt_enc->la_depth >= 0) - param->look_ahead_distance = svt_enc->la_depth; + param->look_ahead_distance = svt_enc->la_depth; #endif if (svt_enc->enc_mode >= 0) @@ -183,7 +184,8 @@ param->min_qp_allowed = avctx->qmin; } param->max_bit_rate = avctx->rc_max_rate; - param->vbv_bufsize = avctx->rc_buffer_size; + if (avctx->bit_rate && avctx->rc_buffer_size) + param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; if (svt_enc->crf > 0) { param->qp = svt_enc->crf; @@ -300,7 +302,7 @@ avctx->bit_rate = param->rate_control_mode > 0 ? param->target_bit_rate : 0; avctx->rc_max_rate = param->max_bit_rate; - avctx->rc_buffer_size = param->vbv_bufsize; + avctx->rc_buffer_size = param->maximum_buffer_size_ms * avctx->bit_rate / 1000LL; if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx); @@ -575,7 +577,7 @@ static const AVOption options[] = { #if FF_API_SVTAV1_OPTS { "hielevel", "Hierarchical prediction levels setting (Deprecated, use svtav1-params)", OFFSET(hierarchical_level), - AV_OPT_TYPE_INT, { .i64 = 4 }, 3, 4, VE | AV_OPT_FLAG_DEPRECATED , "hielevel"}, + AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 4, VE | AV_OPT_FLAG_DEPRECATED , "hielevel"}, { "3level", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, INT_MIN, INT_MAX, VE, "hielevel" }, { "4level", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, INT_MIN, INT_MAX, VE, "hielevel" }, @@ -583,7 +585,7 @@ AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 120, VE | AV_OPT_FLAG_DEPRECATED }, { "tier", "Set operating point tier (Deprecated, use svtav1-params)", OFFSET(tier), - AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE | AV_OPT_FLAG_DEPRECATED, "tier" }, + AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE | AV_OPT_FLAG_DEPRECATED, "tier" }, { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "tier" }, { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "tier" }, #endif @@ -626,10 +628,10 @@ AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 63, VE }, #if FF_API_SVTAV1_OPTS { "sc_detection", "Scene change detection (Deprecated, use svtav1-params)", OFFSET(scd), - AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE | AV_OPT_FLAG_DEPRECATED }, + AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE | AV_OPT_FLAG_DEPRECATED }, - { "tile_columns", "Log2 of number of tile columns to use (Deprecated, use svtav1-params)", OFFSET(tile_columns), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 4, VE | AV_OPT_FLAG_DEPRECATED }, - { "tile_rows", "Log2 of number of tile rows to use (Deprecated, use svtav1-params)", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 6, VE | AV_OPT_FLAG_DEPRECATED }, + { "tile_columns", "Log2 of number of tile columns to use (Deprecated, use svtav1-params)", OFFSET(tile_columns), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 4, VE | AV_OPT_FLAG_DEPRECATED }, + { "tile_rows", "Log2 of number of tile rows to use (Deprecated, use svtav1-params)", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 6, VE | AV_OPT_FLAG_DEPRECATED }, #endif { "svtav1-params", "Set the SVT-AV1 configuration using a :-separated list of key=value parameters", OFFSET(svtav1_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, @@ -655,7 +657,7 @@ const FFCodec ff_libsvtav1_encoder = { .p.name = "libsvtav1", - .p.long_name = NULL_IF_CONFIG_SMALL("SVT-AV1(Scalable Video Technology for AV1) encoder"), + CODEC_LONG_NAME("SVT-AV1(Scalable Video Technology for AV1) encoder"), .priv_data_size = sizeof(SvtContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, @@ -663,7 +665,8 @@ FF_CODEC_RECEIVE_PACKET_CB(eb_receive_packet), .close = eb_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtheoraenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtheoraenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtheoraenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtheoraenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -119,7 +119,7 @@ return 0; #else av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n"); - return AVERROR(ENOSUP); + return AVERROR(ENOTSUP); #endif } @@ -158,7 +158,7 @@ return 0; #else av_log(avctx, AV_LOG_ERROR, "libtheora too old to support 2pass\n"); - return AVERROR(ENOSUP); + return AVERROR(ENOTSUP); #endif } @@ -346,7 +346,13 @@ // HACK: assumes no encoder delay, this is true until libtheora becomes // multithreaded (which will be disabled unless explicitly requested) - pkt->pts = pkt->dts = frame->pts; + pkt->pts = frame->pts; + pkt->duration = frame->duration; + + ret = ff_encode_reordered_opaque(avc_context, pkt, frame); + if (ret < 0) + return ret; + if (!(o_packet.granulepos & h->keyframe_mask)) pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; @@ -369,11 +375,14 @@ /** AVCodec struct exposed to libavcodec */ const FFCodec ff_libtheora_encoder = { .p.name = "libtheora", - .p.long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"), + CODEC_LONG_NAME("libtheora Theora"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_THEORA, .p.capabilities = AV_CODEC_CAP_DR1 | - AV_CODEC_CAP_DELAY /* for statsfile summary */, + /* for statsfile summary */ + AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(TheoraContext), .init = encode_init, .close = encode_close, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtwolame.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtwolame.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtwolame.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libtwolame.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "mpegaudio.h" typedef struct TWOLAMEContext { @@ -211,14 +210,15 @@ const FFCodec ff_libtwolame_encoder = { .p.name = "libtwolame", - .p.long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"), + CODEC_LONG_NAME("libtwolame MP2 (MPEG audio layer 2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(TWOLAMEContext), .init = twolame_encode_init, FF_CODEC_ENCODE_CB(twolame_encode_frame), .close = twolame_encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY, .defaults = twolame_defaults, .p.priv_class = &twolame_class, .p.sample_fmts = (const enum AVSampleFormat[]) { @@ -228,12 +228,7 @@ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libuavs3d.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libuavs3d.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libuavs3d.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libuavs3d.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "avcodec.h" #include "avs3.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "uavs3d.h" typedef struct uavs3d_context { @@ -81,8 +81,12 @@ frm->pkt_dts = dec_frame->dts; frm->pkt_pos = dec_frame->pkt_pos; frm->pkt_size = dec_frame->pkt_size; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS frm->coded_picture_number = dec_frame->dtr; frm->display_picture_number = dec_frame->ptr; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if (dec_frame->type < 0 || dec_frame->type >= FF_ARRAY_ELEMS(ff_avs3_image_type)) { av_log(NULL, AV_LOG_WARNING, "Error frame type in uavs3d: %d.\n", dec_frame->type); @@ -248,7 +252,7 @@ const FFCodec ff_libuavs3d_decoder = { .p.name = "libuavs3d", - .p.long_name = NULL_IF_CONFIG_SMALL("libuavs3d AVS3-P2/IEEE1857.10"), + CODEC_LONG_NAME("libuavs3d AVS3-P2/IEEE1857.10"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVS3, .priv_data_size = sizeof(uavs3d_context), @@ -256,7 +260,8 @@ .close = libuavs3d_end, FF_CODEC_DECODE_CB(libuavs3d_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .flush = libuavs3d_flush, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10LE, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvo-amrwbenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvo-amrwbenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvo-amrwbenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvo-amrwbenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #define MAX_PACKET_SIZE (1 + (477 + 7) / 8) @@ -142,12 +141,14 @@ const FFCodec ff_libvo_amrwbenc_encoder = { .p.name = "libvo_amrwbenc", - .p.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB " - "(Adaptive Multi-Rate Wide-Band)"), + CODEC_LONG_NAME("Android VisualOn AMR-WB (Adaptive Multi-Rate Wide-Band)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AMR_WB, + .p.capabilities = AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.priv_class = &amrwb_class, .p.wrapper_name = "libvo_amrwbenc", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_encode_init, FF_CODEC_ENCODE_CB(amr_wb_encode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct OggVorbisDecContext { vorbis_info vi; /**< vorbis_info used during init */ @@ -212,10 +212,11 @@ const FFCodec ff_libvorbis_decoder = { .p.name = "libvorbis", - .p.long_name = NULL_IF_CONFIG_SMALL("libvorbis"), + CODEC_LONG_NAME("libvorbis"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_VORBIS, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(OggVorbisDecContext), .init = oggvorbis_decode_init, FF_CODEC_DECODE_CB(oggvorbis_decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvorbisenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,9 +28,7 @@ #include "audio_frame_queue.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "version.h" -#include "vorbis.h" #include "vorbis_parser.h" @@ -377,11 +375,12 @@ const FFCodec ff_libvorbis_encoder = { .p.name = "libvorbis", - .p.long_name = NULL_IF_CONFIG_SMALL("libvorbis"), + CODEC_LONG_NAME("libvorbis"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_VORBIS, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibvorbisEncContext), .init = libvorbis_encode_init, FF_CODEC_ENCODE_CB(libvorbis_encode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,7 +37,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #include "libvpx.h" #include "profiles.h" @@ -89,7 +88,7 @@ const struct vpx_codec_iface *iface) { struct vpx_codec_dec_cfg deccfg = { - .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) + .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), MAX_VPX_THREADS) }; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); @@ -357,7 +356,7 @@ const FFCodec ff_libvpx_vp8_decoder = { .p.name = "libvpx", - .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), + CODEC_LONG_NAME("libvpx VP8"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP8, .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, @@ -366,7 +365,8 @@ .init = vp8_init, .close = vpx_free, FF_CODEC_DECODE_CB(vpx_decode), - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, }; #endif /* CONFIG_LIBVPX_VP8_DECODER */ @@ -379,7 +379,7 @@ FFCodec ff_libvpx_vp9_decoder = { .p.name = "libvpx-vp9", - .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), + CODEC_LONG_NAME("libvpx VP9"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, .p.capabilities = AV_CODEC_CAP_OTHER_THREADS, @@ -389,7 +389,8 @@ .init = vp9_init, .close = vpx_free, FF_CODEC_DECODE_CB(vpx_decode), - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .init_static_data = ff_vp9_init_static, }; #endif /* CONFIG_LIBVPX_VP9_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -80,6 +80,7 @@ struct vpx_image rawimg_alpha; uint8_t is_alpha; struct vpx_fixed_buf twopass_stats; + unsigned twopass_stats_size; int deadline; //i.e., RT/GOOD/BEST uint64_t sse[4]; int have_sse; /**< true if we have pending sse[] */ @@ -130,6 +131,7 @@ int tune_content; int corpus_complexity; int tpl_model; + int min_gf_interval; AVFifo *hdr10_plus_fifo; /** * If the driver does not support ROI then warn the first time we @@ -185,6 +187,9 @@ #ifdef VPX_CTRL_VP9E_SET_TPL [VP9E_SET_TPL] = "VP9E_SET_TPL", #endif +#ifdef VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL + [VP9E_SET_MIN_GF_INTERVAL] = "VP9E_SET_MIN_GF_INTERVAL", +#endif #endif }; @@ -895,7 +900,7 @@ vpx_codec_caps_t codec_caps = vpx_codec_get_caps(iface); vpx_svc_extra_cfg_t svc_params; #endif - AVDictionaryEntry* en = NULL; + const AVDictionaryEntry* en = NULL; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config()); @@ -937,7 +942,7 @@ enccfg.g_timebase.num = avctx->time_base.num; enccfg.g_timebase.den = avctx->time_base.den; enccfg.g_threads = - FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16); + FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), MAX_VPX_THREADS); enccfg.g_lag_in_frames= ctx->lag_in_frames; if (avctx->flags & AV_CODEC_FLAG_PASS1) @@ -1067,7 +1072,7 @@ enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT; - while ((en = av_dict_get(ctx->vpx_ts_parameters, "", en, AV_DICT_IGNORE_SUFFIX))) { + while ((en = av_dict_iterate(ctx->vpx_ts_parameters, en))) { if (vpx_ts_param_parse(ctx, &enccfg, en->key, en->value, avctx->codec_id) < 0) av_log(avctx, AV_LOG_WARNING, "Error parsing option '%s = %s'.\n", @@ -1173,6 +1178,10 @@ if (ctx->tpl_model >= 0) codecctl_int(avctx, VP9E_SET_TPL, ctx->tpl_model); #endif +#ifdef VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL + if (ctx->min_gf_interval >= 0) + codecctl_int(avctx, VP9E_SET_MIN_GF_INTERVAL, ctx->min_gf_interval); +#endif } #endif @@ -1356,16 +1365,20 @@ break; case VPX_CODEC_STATS_PKT: { struct vpx_fixed_buf *stats = &ctx->twopass_stats; - int err; + uint8_t *tmp; if (!pkt_out) break; - if ((err = av_reallocp(&stats->buf, - stats->sz + - pkt->data.twopass_stats.sz)) < 0) { + tmp = av_fast_realloc(stats->buf, + &ctx->twopass_stats_size, + stats->sz + + pkt->data.twopass_stats.sz); + if (!tmp) { + av_freep(&stats->buf); stats->sz = 0; av_log(avctx, AV_LOG_ERROR, "Stat buffer realloc failed\n"); - return err; + return AVERROR(ENOMEM); } + stats->buf = tmp; memcpy((uint8_t*)stats->buf + stats->sz, pkt->data.twopass_stats.buf, pkt->data.twopass_stats.sz); stats->sz += pkt->data.twopass_stats.sz; @@ -1907,6 +1920,9 @@ #ifdef VPX_CTRL_VP9E_SET_TPL { "enable-tpl", "Enable temporal dependency model", OFFSET(tpl_model), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE }, #endif +#ifdef VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL + { "min-gf-interval", "Minimum golden/alternate reference frame interval", OFFSET(min_gf_interval), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VE }, +#endif LEGACY_OPTIONS { NULL } }; @@ -1939,7 +1955,7 @@ const FFCodec ff_libvpx_vp8_encoder = { .p.name = "libvpx", - .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), + CODEC_LONG_NAME("libvpx VP8"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP8, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -1948,7 +1964,8 @@ .init = vp8_init, FF_CODEC_ENCODE_CB(vpx_encode), .close = vpx_free, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }, .p.priv_class = &class_vp8, .defaults = defaults, @@ -1971,7 +1988,7 @@ FFCodec ff_libvpx_vp9_encoder = { .p.name = "libvpx-vp9", - .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), + CODEC_LONG_NAME("libvpx VP9"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -1983,7 +2000,8 @@ .init = vp9_init, FF_CODEC_ENCODE_CB(vpx_encode), .close = vpx_free, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .defaults = defaults, .init_static_data = ff_vp9_init_static, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libvpx.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,8 @@ #include "codec_internal.h" +#define MAX_VPX_THREADS 64 + void ff_vp9_init_static(FFCodec *codec); #if 0 enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc_animencoder.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc_animencoder.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc_animencoder.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc_animencoder.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,8 @@ * WebP encoder using libwebp (WebPAnimEncoder API) */ +#include "libavutil/buffer.h" + #include "config.h" #include "codec_internal.h" #include "encode.h" @@ -35,6 +37,14 @@ LibWebPContextCommon cc; WebPAnimEncoder *enc; // the main AnimEncoder object int64_t first_frame_pts; // pts of the first encoded frame. + int64_t end_pts; // pts + duration of the last frame + +#if FF_API_REORDERED_OPAQUE + int64_t reordered_opaque; +#endif + void *first_frame_opaque; + AVBufferRef *first_frame_opaque_ref; + int done; // If true, we have assembled the bitstream already } LibWebPAnimContext; @@ -77,7 +87,22 @@ memcpy(pkt->data, assembled_data.bytes, assembled_data.size); WebPDataClear(&assembled_data); s->done = 1; - pkt->pts = pkt->dts = s->first_frame_pts; + pkt->pts = s->first_frame_pts; + + if (pkt->pts != AV_NOPTS_VALUE && s->end_pts > pkt->pts) + pkt->duration = s->end_pts - pkt->pts; + +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + avctx->reordered_opaque = s->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + pkt->opaque = s->first_frame_opaque; + pkt->opaque_ref = s->first_frame_opaque_ref; + s->first_frame_opaque_ref = NULL; + } + *got_packet = 1; return 0; } else { @@ -107,8 +132,25 @@ goto end; } - if (!avctx->frame_number) + if (!avctx->frame_num) { s->first_frame_pts = frame->pts; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + s->reordered_opaque = frame->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + s->first_frame_opaque = frame->opaque; + ret = av_buffer_replace(&s->first_frame_opaque_ref, frame->opaque_ref); + if (ret < 0) + goto end; + } + } + + if (frame->pts != AV_NOPTS_VALUE) + s->end_pts = frame->pts + frame->duration; + ret = 0; *got_packet = 0; @@ -126,18 +168,22 @@ av_frame_free(&s->cc.ref); WebPAnimEncoderDelete(s->enc); + av_buffer_unref(&s->first_frame_opaque_ref); + return 0; } const FFCodec ff_libwebp_anim_encoder = { .p.name = "libwebp_anim", - .p.long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), + CODEC_LONG_NAME("libwebp WebP image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WEBP, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = ff_libwebpenc_pix_fmts, .p.priv_class = &ff_libwebpenc_class, .p.wrapper_name = "libwebp", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibWebPAnimContext), .defaults = ff_libwebp_defaults, .init = libwebp_anim_encode_init, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libwebpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -89,13 +89,14 @@ const FFCodec ff_libwebp_encoder = { .p.name = "libwebp", - .p.long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), + CODEC_LONG_NAME("libwebp WebP image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WEBP, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = ff_libwebpenc_pix_fmts, .p.priv_class = &ff_libwebpenc_class, .p.wrapper_name = "libwebp", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(LibWebPContext), .defaults = ff_libwebp_defaults, .init = libwebp_encode_init, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx264.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx264.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx264.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx264.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "config_components.h" +#include "libavutil/buffer.h" #include "libavutil/eval.h" #include "libavutil/internal.h" #include "libavutil/opt.h" @@ -49,8 +50,14 @@ #define MB_SIZE 16 typedef struct X264Opaque { +#if FF_API_REORDERED_OPAQUE int64_t reordered_opaque; +#endif int64_t wallclock; + int64_t duration; + + void *frame_opaque; + AVBufferRef *frame_opaque_ref; } X264Opaque; typedef struct X264Context { @@ -133,6 +140,11 @@ av_vlog(p, level_map[level], fmt, args); } +static void opaque_uninit(X264Opaque *o) +{ + av_buffer_unref(&o->frame_opaque_ref); + memset(o, 0, sizeof(*o)); +} static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, const x264_nal_t *nals, int nnal) @@ -311,191 +323,287 @@ pic->extra_sei.num_payloads = 0; } -static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, - int *got_packet) +static enum AVPixelFormat csp_to_pixfmt(int csp) +{ + switch (csp) { +#ifdef X264_CSP_I400 + case X264_CSP_I400: return AV_PIX_FMT_GRAY8; + case X264_CSP_I400 | X264_CSP_HIGH_DEPTH: return AV_PIX_FMT_GRAY10; +#endif + case X264_CSP_I420: return AV_PIX_FMT_YUV420P; + case X264_CSP_I420 | X264_CSP_HIGH_DEPTH: return AV_PIX_FMT_YUV420P10; + case X264_CSP_I422: return AV_PIX_FMT_YUV422P; + case X264_CSP_I422 | X264_CSP_HIGH_DEPTH: return AV_PIX_FMT_YUV422P10; + case X264_CSP_I444: return AV_PIX_FMT_YUV444P; + case X264_CSP_I444 | X264_CSP_HIGH_DEPTH: return AV_PIX_FMT_YUV444P10; + case X264_CSP_NV12: return AV_PIX_FMT_NV12; +#ifdef X264_CSP_NV21 + case X264_CSP_NV21: return AV_PIX_FMT_NV21; +#endif + case X264_CSP_NV16: return AV_PIX_FMT_NV16; + }; + return AV_PIX_FMT_NONE; +} + +static int setup_roi(AVCodecContext *ctx, x264_picture_t *pic, int bit_depth, + const AVFrame *frame, const uint8_t *data, size_t size) { X264Context *x4 = ctx->priv_data; - x264_nal_t *nal; - int nnal, i, ret; - x264_picture_t pic_out = {0}; - int pict_type; - int bit_depth; + + int mbx = (frame->width + MB_SIZE - 1) / MB_SIZE; + int mby = (frame->height + MB_SIZE - 1) / MB_SIZE; + int qp_range = 51 + 6 * (bit_depth - 8); + int nb_rois; + const AVRegionOfInterest *roi; + uint32_t roi_size; + float *qoffsets; + + if (x4->params.rc.i_aq_mode == X264_AQ_NONE) { + if (!x4->roi_warned) { + x4->roi_warned = 1; + av_log(ctx, AV_LOG_WARNING, "Adaptive quantization must be enabled to use ROI encoding, skipping ROI.\n"); + } + return 0; + } else if (frame->interlaced_frame) { + if (!x4->roi_warned) { + x4->roi_warned = 1; + av_log(ctx, AV_LOG_WARNING, "interlaced_frame not supported for ROI encoding yet, skipping ROI.\n"); + } + return 0; + } + + roi = (const AVRegionOfInterest*)data; + roi_size = roi->self_size; + if (!roi_size || size % roi_size != 0) { + av_log(ctx, AV_LOG_ERROR, "Invalid AVRegionOfInterest.self_size.\n"); + return AVERROR(EINVAL); + } + nb_rois = size / roi_size; + + qoffsets = av_calloc(mbx * mby, sizeof(*qoffsets)); + if (!qoffsets) + return AVERROR(ENOMEM); + + // This list must be iterated in reverse because the first + // region in the list applies when regions overlap. + for (int i = nb_rois - 1; i >= 0; i--) { + int startx, endx, starty, endy; + float qoffset; + + roi = (const AVRegionOfInterest*)(data + roi_size * i); + + starty = FFMIN(mby, roi->top / MB_SIZE); + endy = FFMIN(mby, (roi->bottom + MB_SIZE - 1)/ MB_SIZE); + startx = FFMIN(mbx, roi->left / MB_SIZE); + endx = FFMIN(mbx, (roi->right + MB_SIZE - 1)/ MB_SIZE); + + if (roi->qoffset.den == 0) { + av_free(qoffsets); + av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.qoffset.den must not be zero.\n"); + return AVERROR(EINVAL); + } + qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den; + qoffset = av_clipf(qoffset * qp_range, -qp_range, +qp_range); + + for (int y = starty; y < endy; y++) { + for (int x = startx; x < endx; x++) { + qoffsets[x + y*mbx] = qoffset; + } + } + } + + pic->prop.quant_offsets = qoffsets; + pic->prop.quant_offsets_free = av_free; + + return 0; +} + +static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, + x264_picture_t **ppic) +{ + X264Context *x4 = ctx->priv_data; + X264Opaque *opaque = &x4->reordered_opaque[x4->next_reordered_opaque]; + x264_picture_t *pic = &x4->pic; + x264_sei_t *sei = &pic->extra_sei; + unsigned int sei_data_size = 0; int64_t wallclock = 0; - X264Opaque *out_opaque; + int bit_depth, ret; AVFrameSideData *sd; - x264_picture_init( &x4->pic ); - x4->pic.img.i_csp = x4->params.i_csp; + *ppic = NULL; + if (!frame) + return 0; + + x264_picture_init(pic); + pic->img.i_csp = x4->params.i_csp; #if X264_BUILD >= 153 bit_depth = x4->params.i_bitdepth; #else bit_depth = x264_bit_depth; #endif if (bit_depth > 8) - x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH; - x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt); + pic->img.i_csp |= X264_CSP_HIGH_DEPTH; + pic->img.i_plane = avfmt2_num_planes(ctx->pix_fmt); - if (frame) { - x264_sei_t *sei = &x4->pic.extra_sei; - unsigned int sei_data_size = 0; - - for (i = 0; i < x4->pic.img.i_plane; i++) { - x4->pic.img.plane[i] = frame->data[i]; - x4->pic.img.i_stride[i] = frame->linesize[i]; - } - - x4->pic.i_pts = frame->pts; - - x4->reordered_opaque[x4->next_reordered_opaque].reordered_opaque = frame->reordered_opaque; - x4->reordered_opaque[x4->next_reordered_opaque].wallclock = wallclock; - if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT) - x4->reordered_opaque[x4->next_reordered_opaque].wallclock = av_gettime(); - x4->pic.opaque = &x4->reordered_opaque[x4->next_reordered_opaque]; - x4->next_reordered_opaque++; - x4->next_reordered_opaque %= x4->nb_reordered_opaque; - - switch (frame->pict_type) { - case AV_PICTURE_TYPE_I: - x4->pic.i_type = x4->forced_idr > 0 ? X264_TYPE_IDR - : X264_TYPE_KEYFRAME; - break; - case AV_PICTURE_TYPE_P: - x4->pic.i_type = X264_TYPE_P; - break; - case AV_PICTURE_TYPE_B: - x4->pic.i_type = X264_TYPE_B; - break; - default: - x4->pic.i_type = X264_TYPE_AUTO; - break; - } - reconfig_encoder(ctx, frame); + for (int i = 0; i < pic->img.i_plane; i++) { + pic->img.plane[i] = frame->data[i]; + pic->img.i_stride[i] = frame->linesize[i]; + } - if (x4->a53_cc) { - void *sei_data; - size_t sei_size; + pic->i_pts = frame->pts; - ret = ff_alloc_a53_sei(frame, 0, &sei_data, &sei_size); - if (ret < 0) { - av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n"); - } else if (sei_data) { - x4->pic.extra_sei.payloads = av_mallocz(sizeof(x4->pic.extra_sei.payloads[0])); - if (x4->pic.extra_sei.payloads == NULL) { - av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n"); - av_free(sei_data); - } else { - x4->pic.extra_sei.sei_free = av_free; - - x4->pic.extra_sei.payloads[0].payload_size = sei_size; - x4->pic.extra_sei.payloads[0].payload = sei_data; - x4->pic.extra_sei.num_payloads = 1; - x4->pic.extra_sei.payloads[0].payload_type = 4; - } - } - } + opaque_uninit(opaque); - sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST); - if (sd) { - if (x4->params.rc.i_aq_mode == X264_AQ_NONE) { - if (!x4->roi_warned) { - x4->roi_warned = 1; - av_log(ctx, AV_LOG_WARNING, "Adaptive quantization must be enabled to use ROI encoding, skipping ROI.\n"); - } - } else { - if (frame->interlaced_frame == 0) { - int mbx = (frame->width + MB_SIZE - 1) / MB_SIZE; - int mby = (frame->height + MB_SIZE - 1) / MB_SIZE; - int qp_range = 51 + 6 * (bit_depth - 8); - int nb_rois; - const AVRegionOfInterest *roi; - uint32_t roi_size; - float *qoffsets; - - roi = (const AVRegionOfInterest*)sd->data; - roi_size = roi->self_size; - if (!roi_size || sd->size % roi_size != 0) { - free_picture(ctx); - av_log(ctx, AV_LOG_ERROR, "Invalid AVRegionOfInterest.self_size.\n"); - return AVERROR(EINVAL); - } - nb_rois = sd->size / roi_size; - - qoffsets = av_calloc(mbx * mby, sizeof(*qoffsets)); - if (!qoffsets) { - free_picture(ctx); - return AVERROR(ENOMEM); - } - // This list must be iterated in reverse because the first - // region in the list applies when regions overlap. - for (int i = nb_rois - 1; i >= 0; i--) { - int startx, endx, starty, endy; - float qoffset; - - roi = (const AVRegionOfInterest*)(sd->data + roi_size * i); - - starty = FFMIN(mby, roi->top / MB_SIZE); - endy = FFMIN(mby, (roi->bottom + MB_SIZE - 1)/ MB_SIZE); - startx = FFMIN(mbx, roi->left / MB_SIZE); - endx = FFMIN(mbx, (roi->right + MB_SIZE - 1)/ MB_SIZE); - - if (roi->qoffset.den == 0) { - av_free(qoffsets); - free_picture(ctx); - av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.qoffset.den must not be zero.\n"); - return AVERROR(EINVAL); - } - qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den; - qoffset = av_clipf(qoffset * qp_range, -qp_range, +qp_range); - - for (int y = starty; y < endy; y++) { - for (int x = startx; x < endx; x++) { - qoffsets[x + y*mbx] = qoffset; - } - } - } - - x4->pic.prop.quant_offsets = qoffsets; - x4->pic.prop.quant_offsets_free = av_free; - } else { - if (!x4->roi_warned) { - x4->roi_warned = 1; - av_log(ctx, AV_LOG_WARNING, "interlaced_frame not supported for ROI encoding yet, skipping ROI.\n"); - } - } + if (ctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + opaque->frame_opaque = frame->opaque; + ret = av_buffer_replace(&opaque->frame_opaque_ref, frame->opaque_ref); + if (ret < 0) + goto fail; + } + +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + opaque->reordered_opaque = frame->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + opaque->duration = frame->duration; + opaque->wallclock = wallclock; + if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT) + opaque->wallclock = av_gettime(); + + pic->opaque = opaque; + + x4->next_reordered_opaque++; + x4->next_reordered_opaque %= x4->nb_reordered_opaque; + + switch (frame->pict_type) { + case AV_PICTURE_TYPE_I: + pic->i_type = x4->forced_idr > 0 ? X264_TYPE_IDR : X264_TYPE_KEYFRAME; + break; + case AV_PICTURE_TYPE_P: + pic->i_type = X264_TYPE_P; + break; + case AV_PICTURE_TYPE_B: + pic->i_type = X264_TYPE_B; + break; + default: + pic->i_type = X264_TYPE_AUTO; + break; + } + reconfig_encoder(ctx, frame); + + if (x4->a53_cc) { + void *sei_data; + size_t sei_size; + + ret = ff_alloc_a53_sei(frame, 0, &sei_data, &sei_size); + if (ret < 0) + goto fail; + + if (sei_data) { + pic->extra_sei.payloads = av_mallocz(sizeof(pic->extra_sei.payloads[0])); + if (pic->extra_sei.payloads == NULL) { + ret = AVERROR(ENOMEM); + goto fail; } + + pic->extra_sei.sei_free = av_free; + + pic->extra_sei.payloads[0].payload_size = sei_size; + pic->extra_sei.payloads[0].payload = sei_data; + pic->extra_sei.num_payloads = 1; + pic->extra_sei.payloads[0].payload_type = 4; } + } - if (x4->udu_sei) { - for (int j = 0; j < frame->nb_side_data; j++) { - AVFrameSideData *side_data = frame->side_data[j]; - void *tmp; - x264_sei_payload_t *sei_payload; - if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED) - continue; - tmp = av_fast_realloc(sei->payloads, &sei_data_size, (sei->num_payloads + 1) * sizeof(*sei_payload)); - if (!tmp) { - free_picture(ctx); - return AVERROR(ENOMEM); - } - sei->payloads = tmp; - sei->sei_free = av_free; - sei_payload = &sei->payloads[sei->num_payloads]; - sei_payload->payload = av_memdup(side_data->data, side_data->size); - if (!sei_payload->payload) { - free_picture(ctx); - return AVERROR(ENOMEM); - } - sei_payload->payload_size = side_data->size; - sei_payload->payload_type = SEI_TYPE_USER_DATA_UNREGISTERED; - sei->num_payloads++; + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST); + if (sd) { + ret = setup_roi(ctx, pic, bit_depth, frame, sd->data, sd->size); + if (ret < 0) + goto fail; + } + + if (x4->udu_sei) { + for (int j = 0; j < frame->nb_side_data; j++) { + AVFrameSideData *side_data = frame->side_data[j]; + void *tmp; + x264_sei_payload_t *sei_payload; + if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED) + continue; + tmp = av_fast_realloc(sei->payloads, &sei_data_size, (sei->num_payloads + 1) * sizeof(*sei_payload)); + if (!tmp) { + ret = AVERROR(ENOMEM); + goto fail; } + sei->payloads = tmp; + sei->sei_free = av_free; + sei_payload = &sei->payloads[sei->num_payloads]; + sei_payload->payload = av_memdup(side_data->data, side_data->size); + if (!sei_payload->payload) { + ret = AVERROR(ENOMEM); + goto fail; + } + sei_payload->payload_size = side_data->size; + sei_payload->payload_type = SEI_TYPE_USER_DATA_UNREGISTERED; + sei->num_payloads++; } } + *ppic = pic; + return 0; + +fail: + free_picture(ctx); + *ppic = NULL; + return ret; +} + +static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, + int *got_packet) +{ + X264Context *x4 = ctx->priv_data; + x264_nal_t *nal; + int nnal, ret; + x264_picture_t pic_out = {0}, *pic_in; + int pict_type; + int64_t wallclock = 0; + X264Opaque *out_opaque; + + ret = setup_frame(ctx, frame, &pic_in); + if (ret < 0) + return ret; + do { - if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) + if (x264_encoder_encode(x4->enc, &nal, &nnal, pic_in, &pic_out) < 0) return AVERROR_EXTERNAL; + if (nnal && (ctx->flags & AV_CODEC_FLAG_RECON_FRAME)) { + AVCodecInternal *avci = ctx->internal; + + av_frame_unref(avci->recon_frame); + + avci->recon_frame->format = csp_to_pixfmt(pic_out.img.i_csp); + if (avci->recon_frame->format == AV_PIX_FMT_NONE) { + av_log(ctx, AV_LOG_ERROR, + "Unhandled reconstructed frame colorspace: %d\n", + pic_out.img.i_csp); + return AVERROR(ENOSYS); + } + + avci->recon_frame->width = ctx->width; + avci->recon_frame->height = ctx->height; + for (int i = 0; i < pic_out.img.i_plane; i++) { + avci->recon_frame->data[i] = pic_out.img.plane[i]; + avci->recon_frame->linesize[i] = pic_out.img.i_stride[i]; + } + + ret = av_frame_make_writable(avci->recon_frame); + if (ret < 0) { + av_frame_unref(avci->recon_frame); + return ret; + } + } + ret = encode_nals(ctx, pkt, nal, nnal); if (ret < 0) return ret; @@ -510,11 +618,30 @@ out_opaque = pic_out.opaque; if (out_opaque >= x4->reordered_opaque && out_opaque < &x4->reordered_opaque[x4->nb_reordered_opaque]) { +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS ctx->reordered_opaque = out_opaque->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif wallclock = out_opaque->wallclock; + pkt->duration = out_opaque->duration; + + if (ctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + pkt->opaque = out_opaque->frame_opaque; + pkt->opaque_ref = out_opaque->frame_opaque_ref; + out_opaque->frame_opaque_ref = NULL; + } + + opaque_uninit(out_opaque); } else { // Unexpected opaque pointer on picture output + av_log(ctx, AV_LOG_ERROR, "Unexpected opaque pointer; " + "this is a bug, please report it.\n"); +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS ctx->reordered_opaque = 0; +FF_ENABLE_DEPRECATION_WARNINGS +#endif } switch (pic_out.i_type) { @@ -550,6 +677,9 @@ X264Context *x4 = avctx->priv_data; av_freep(&x4->sei); + + for (int i = 0; i < x4->nb_reordered_opaque; i++) + opaque_uninit(&x4->reordered_opaque[i]); av_freep(&x4->reordered_opaque); #if X264_BUILD >= 161 @@ -928,6 +1058,9 @@ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) x4->params.b_repeat_headers = 0; + if (avctx->flags & AV_CODEC_FLAG_RECON_FRAME) + x4->params.b_full_recon = 1; + if(x4->x264opts){ const char *p= x4->x264opts; while(p){ @@ -1018,10 +1151,12 @@ // Overestimate the reordered opaque buffer size, in case a runtime // reconfigure would increase the delay (which it shouldn't). x4->nb_reordered_opaque = x264_encoder_maximum_delayed_frames(x4->enc) + 17; - x4->reordered_opaque = av_malloc_array(x4->nb_reordered_opaque, - sizeof(*x4->reordered_opaque)); - if (!x4->reordered_opaque) + x4->reordered_opaque = av_calloc(x4->nb_reordered_opaque, + sizeof(*x4->reordered_opaque)); + if (!x4->reordered_opaque) { + x4->nb_reordered_opaque = 0; return AVERROR(ENOMEM); + } return 0; } @@ -1218,12 +1353,13 @@ #endif FFCodec ff_libx264_encoder = { .p.name = "libx264", - .p.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + CODEC_LONG_NAME("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | - AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | + AV_CODEC_CAP_ENCODER_RECON_FRAME, .p.priv_class = &x264_class, .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), @@ -1237,8 +1373,8 @@ .p.pix_fmts = pix_fmts_all, #endif .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS -#if X264_BUILD >= 158 - | FF_CODEC_CAP_INIT_THREADSAFE +#if X264_BUILD < 158 + | FF_CODEC_CAP_NOT_INIT_THREADSAFE #endif , }; @@ -1254,7 +1390,7 @@ const FFCodec ff_libx264rgb_encoder = { .p.name = "libx264rgb", - .p.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB"), + CODEC_LONG_NAME("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -1269,8 +1405,8 @@ .close = X264_close, .defaults = x264_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS -#if X264_BUILD >= 158 - | FF_CODEC_CAP_INIT_THREADSAFE +#if X264_BUILD < 158 + | FF_CODEC_CAP_NOT_INIT_THREADSAFE #endif , }; @@ -1286,7 +1422,7 @@ const FFCodec ff_libx262_encoder = { .p.name = "libx262", - .p.long_name = NULL_IF_CONFIG_SMALL("libx262 MPEG2VIDEO"), + CODEC_LONG_NAME("libx262 MPEG2VIDEO"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -1300,6 +1436,7 @@ FF_CODEC_ENCODE_CB(X264_frame), .close = X264_close, .defaults = x264_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx265.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx265.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx265.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libx265.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,8 @@ #include #include +#include "libavutil/avassert.h" +#include "libavutil/buffer.h" #include "libavutil/internal.h" #include "libavutil/common.h" #include "libavutil/opt.h" @@ -36,8 +38,21 @@ #include "encode.h" #include "internal.h" #include "packet_internal.h" +#include "atsc_a53.h" #include "sei.h" +typedef struct ReorderedData { +#if FF_API_REORDERED_OPAQUE + int64_t reordered_opaque; +#endif + int64_t duration; + + void *frame_opaque; + AVBufferRef *frame_opaque_ref; + + int in_use; +} ReorderedData; + typedef struct libx265Context { const AVClass *class; @@ -56,6 +71,10 @@ void *sei_data; int sei_data_size; int udu_sei; + int a53_cc; + + ReorderedData *rd; + int nb_rd; /** * If the encoder does not support ROI then warn the first time we @@ -79,6 +98,40 @@ } } +static int rd_get(libx265Context *ctx) +{ + const int add = 16; + + ReorderedData *tmp; + int idx; + + for (int i = 0; i < ctx->nb_rd; i++) + if (!ctx->rd[i].in_use) { + ctx->rd[i].in_use = 1; + return i; + } + + tmp = av_realloc_array(ctx->rd, ctx->nb_rd + add, sizeof(*ctx->rd)); + if (!tmp) + return AVERROR(ENOMEM); + memset(tmp + ctx->nb_rd, 0, sizeof(*tmp) * add); + + ctx->rd = tmp; + ctx->nb_rd += add; + + idx = ctx->nb_rd - add; + ctx->rd[idx].in_use = 1; + + return idx; +} + +static void rd_release(libx265Context *ctx, int idx) +{ + av_assert0(idx >= 0 && idx < ctx->nb_rd); + av_buffer_unref(&ctx->rd[idx].frame_opaque_ref); + memset(&ctx->rd[idx], 0, sizeof(ctx->rd[idx])); +} + static av_cold int libx265_encode_close(AVCodecContext *avctx) { libx265Context *ctx = avctx->priv_data; @@ -86,6 +139,10 @@ ctx->api->param_free(ctx->params); av_freep(&ctx->sei_data); + for (int i = 0; i < ctx->nb_rd; i++) + rd_release(ctx, i); + av_freep(&ctx->rd); + if (ctx->encoder) ctx->api->encoder_close(ctx->encoder); @@ -293,7 +350,6 @@ return ret; } -#if X265_BUILD >= 89 if (avctx->qmin >= 0) { ret = libx265_param_parse_int(avctx, "qpmin", avctx->qmin); if (ret < 0) @@ -304,7 +360,6 @@ if (ret < 0) return ret; } -#endif if (avctx->max_qdiff >= 0) { ret = libx265_param_parse_int(avctx, "qpstep", avctx->max_qdiff); if (ret < 0) @@ -499,6 +554,22 @@ return 0; } +static void free_picture(libx265Context *ctx, x265_picture *pic) +{ + x265_sei *sei = &pic->userSEI; + for (int i = 0; i < sei->numPayloads; i++) + av_free(sei->payloads[i].payload); + + if (pic->userData) { + int idx = (int)(intptr_t)pic->userData - 1; + rd_release(ctx, idx); + pic->userData = NULL; + } + + av_freep(&pic->quantOffsets); + sei->numPayloads = 0; +} + static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet) { @@ -506,6 +577,7 @@ x265_picture x265pic; x265_picture x265pic_out = { 0 }; x265_nal *nal; + x265_sei *sei; uint8_t *dst; int pict_type; int payload = 0; @@ -515,9 +587,13 @@ ctx->api->picture_init(ctx->params, &x265pic); + sei = &x265pic.userSEI; + sei->numPayloads = 0; + if (pic) { - x265_sei *sei = &x265pic.userSEI; - sei->numPayloads = 0; + ReorderedData *rd; + int rd_idx; + for (i = 0; i < 3; i++) { x265pic.planes[i] = pic->data[i]; x265pic.stride[i] = pic->linesize[i]; @@ -536,14 +612,58 @@ if (ret < 0) return ret; - if (pic->reordered_opaque) { - x265pic.userData = av_malloc(sizeof(pic->reordered_opaque)); - if (!x265pic.userData) { - av_freep(&x265pic.quantOffsets); - return AVERROR(ENOMEM); + rd_idx = rd_get(ctx); + if (rd_idx < 0) { + free_picture(ctx, &x265pic); + return rd_idx; + } + rd = &ctx->rd[rd_idx]; + + rd->duration = pic->duration; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + rd->reordered_opaque = pic->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + rd->frame_opaque = pic->opaque; + ret = av_buffer_replace(&rd->frame_opaque_ref, pic->opaque_ref); + if (ret < 0) { + rd_release(ctx, rd_idx); + free_picture(ctx, &x265pic); + return ret; } + } + + x265pic.userData = (void*)(intptr_t)(rd_idx + 1); + + if (ctx->a53_cc) { + void *sei_data; + size_t sei_size; + + ret = ff_alloc_a53_sei(pic, 0, &sei_data, &sei_size); + if (ret < 0) { + av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n"); + } else if (sei_data) { + void *tmp; + x265_sei_payload *sei_payload; - memcpy(x265pic.userData, &pic->reordered_opaque, sizeof(pic->reordered_opaque)); + tmp = av_fast_realloc(ctx->sei_data, + &ctx->sei_data_size, + (sei->numPayloads + 1) * sizeof(*sei_payload)); + if (!tmp) { + av_free(sei_data); + free_picture(ctx, &x265pic); + return AVERROR(ENOMEM); + } + ctx->sei_data = tmp; + sei->payloads = ctx->sei_data; + sei_payload = &sei->payloads[sei->numPayloads]; + sei_payload->payload = sei_data; + sei_payload->payloadSize = sei_size; + sei_payload->payloadType = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; + sei->numPayloads++; + } } if (ctx->udu_sei) { @@ -559,14 +679,17 @@ &ctx->sei_data_size, (sei->numPayloads + 1) * sizeof(*sei_payload)); if (!tmp) { - av_freep(&x265pic.userData); - av_freep(&x265pic.quantOffsets); + free_picture(ctx, &x265pic); return AVERROR(ENOMEM); } ctx->sei_data = tmp; sei->payloads = ctx->sei_data; sei_payload = &sei->payloads[sei->numPayloads]; - sei_payload->payload = side_data->data; + sei_payload->payload = av_memdup(side_data->data, side_data->size); + if (!sei_payload->payload) { + free_picture(ctx, &x265pic); + return AVERROR(ENOMEM); + } sei_payload->payloadSize = side_data->size; /* Equal to libx265 USER_DATA_UNREGISTERED */ sei_payload->payloadType = SEI_TYPE_USER_DATA_UNREGISTERED; @@ -578,6 +701,8 @@ ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal, pic ? &x265pic : NULL, &x265pic_out); + for (i = 0; i < sei->numPayloads; i++) + av_free(sei->payloads[i].payload); av_freep(&x265pic.quantOffsets); if (ret < 0) @@ -634,10 +759,31 @@ ff_side_data_set_encoder_stats(pkt, x265pic_out.frameData.qp * FF_QP2LAMBDA, NULL, 0, pict_type); if (x265pic_out.userData) { - memcpy(&avctx->reordered_opaque, x265pic_out.userData, sizeof(avctx->reordered_opaque)); - av_freep(&x265pic_out.userData); - } else + int idx = (int)(intptr_t)x265pic_out.userData - 1; + ReorderedData *rd = &ctx->rd[idx]; + +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + avctx->reordered_opaque = rd->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = rd->duration; + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + pkt->opaque = rd->frame_opaque; + pkt->opaque_ref = rd->frame_opaque_ref; + rd->frame_opaque_ref = NULL; + } + + rd_release(ctx, idx); + } +#if FF_API_REORDERED_OPAQUE + else { +FF_DISABLE_DEPRECATION_WARNINGS avctx->reordered_opaque = 0; +FF_ENABLE_DEPRECATION_WARNINGS + } +#endif *got_packet = 1; return 0; @@ -713,7 +859,8 @@ { "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "profile", "set the x265 profile", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, - { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, { "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } }; @@ -743,7 +890,7 @@ FFCodec ff_libx265_encoder = { .p.name = "libx265", - .p.long_name = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"), + CODEC_LONG_NAME("libx265 H.265 / HEVC"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -757,5 +904,6 @@ .close = libx265_encode_close, .priv_data_size = sizeof(libx265Context), .defaults = x265_defaults, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs2.c 2023-03-03 13:29:59.000000000 +0000 @@ -96,8 +96,8 @@ xavs2_opt_set2("OpenGOP", "%d", !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)); { - AVDictionaryEntry *en = NULL; - while ((en = av_dict_get(cae->xavs2_opts, "", en, AV_DICT_IGNORE_SUFFIX))) + const AVDictionaryEntry *en = NULL; + while ((en = av_dict_iterate(cae->xavs2_opts, en))) xavs2_opt_set2(en->key, "%s", en->value); } @@ -288,7 +288,7 @@ const FFCodec ff_libxavs2_encoder = { .p.name = "libxavs2", - .p.long_name = NULL_IF_CONFIG_SMALL("libxavs2 AVS2-P2/IEEE1857.4"), + CODEC_LONG_NAME("libxavs2 AVS2-P2/IEEE1857.4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVS2, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -297,7 +297,8 @@ .init = xavs2_init, FF_CODEC_ENCODE_CB(xavs2_encode_frame), .close = xavs2_close, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &libxavs2, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxavs.c 2023-03-03 13:29:59.000000000 +0000 @@ -423,7 +423,7 @@ const FFCodec ff_libxavs_encoder = { .p.name = "libxavs", - .p.long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"), + CODEC_LONG_NAME("libxavs Chinese AVS (Audio Video Standard)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CAVS, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -432,7 +432,8 @@ .init = XAVS_init, FF_CODEC_ENCODE_CB(XAVS_frame), .close = XAVS_close, - .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &xavs_class, .defaults = xavs_defaults, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxvid.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxvid.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxvid.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libxvid.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include #include "libavutil/avassert.h" -#include "libavutil/file.h" +#include "libavutil/file_open.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" @@ -899,16 +899,16 @@ const FFCodec ff_libxvid_encoder = { .p.name = "libxvid", - .p.long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), + CODEC_LONG_NAME("libxvidcore MPEG-4 part 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG4, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(struct xvid_context), .init = xvid_encode_init, FF_CODEC_ENCODE_CB(xvid_encode_frame), .close = xvid_encode_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &xvid_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "libxvid", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libzvbi-teletextdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libzvbi-teletextdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libzvbi-teletextdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/libzvbi-teletextdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -813,12 +813,13 @@ const FFCodec ff_libzvbi_teletext_decoder = { .p.name = "libzvbi_teletextdec", - .p.long_name = NULL_IF_CONFIG_SMALL("Libzvbi DVB teletext decoder"), + CODEC_LONG_NAME("Libzvbi DVB teletext decoder"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVB_TELETEXT, .p.capabilities = AV_CODEC_CAP_DELAY, .p.priv_class = &teletext_class, .p.wrapper_name = "libzvbi", + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(TeletextContext), .init = teletext_init_decoder, .close = teletext_close_decoder, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ljpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ljpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ljpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ljpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,22 +33,16 @@ #include "libavutil/frame.h" #include "libavutil/mem.h" #include "libavutil/opt.h" -#include "libavutil/pixdesc.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "idctdsp.h" #include "jpegtables.h" -#include "mathops.h" #include "mjpegenc_common.h" #include "mjpeg.h" typedef struct LJpegEncContext { AVClass *class; - IDCTDSPContext idsp; - ScanTable scantable; - uint16_t matrix[64]; int vsample[4]; int hsample[4]; @@ -78,7 +72,7 @@ for (y = 0; y < height; y++) { const int modified_predictor = y ? s->pred : 1; - uint8_t *ptr = frame->data[0] + (linesize * y); + const uint8_t *ptr = frame->data[0] + (linesize * y); if (put_bytes_left(pb, 0) < width * 4 * 4) { av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); @@ -132,7 +126,7 @@ if (mb_x == 0 || mb_y == 0) { for (i = 0; i < 3; i++) { - uint8_t *ptr; + const uint8_t *ptr; int x, y, h, v, linesize; h = s->hsample[i]; v = s->vsample[i]; @@ -166,7 +160,7 @@ } } else { for (i = 0; i < 3; i++) { - uint8_t *ptr; + const uint8_t *ptr; int x, y, h, v, linesize; h = s->hsample[i]; v = s->vsample[i]; @@ -240,8 +234,8 @@ init_put_bits(&pb, pkt->data, pkt->size); - ff_mjpeg_encode_picture_header(avctx, &pb, pict, NULL, &s->scantable, - s->pred, s->matrix, s->matrix, 0); + ff_mjpeg_encode_picture_header(avctx, &pb, pict, NULL, NULL, + s->pred, NULL, NULL, 0); header_bits = put_bits_count(&pb); @@ -254,8 +248,6 @@ if (ret < 0) return ret; - emms_c(); - ff_mjpeg_escape_FF(&pb, header_bits >> 3); ff_mjpeg_encode_picture_trailer(&pb, header_bits); @@ -287,10 +279,6 @@ if (!s->scratch) return AVERROR(ENOMEM); - ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable(s->idsp.idct_permutation, &s->scantable, - ff_zigzag_direct); - ff_mjpeg_init_hvsample(avctx, s->hsample, s->vsample); ff_mjpeg_build_huffman_codes(s->huff_size_dc_luminance, @@ -325,19 +313,19 @@ const FFCodec ff_ljpeg_encoder = { .p.name = "ljpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"), + CODEC_LONG_NAME("Lossless JPEG"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_LJPEG, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(LJpegEncContext), .p.priv_class = &ljpeg_class, .init = ljpeg_encode_init, FF_CODEC_ENCODE_CB(ljpeg_encode_frame), .close = ljpeg_encode_close, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUV444P , AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loco.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loco.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loco.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loco.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,9 +26,9 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "golomb.h" -#include "internal.h" #include "mathops.h" enum LOCO_MODE { @@ -338,12 +338,11 @@ const FFCodec ff_loco_decoder = { .p.name = "loco", - .p.long_name = NULL_IF_CONFIG_SMALL("LOCO"), + CODEC_LONG_NAME("LOCO"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_LOCO, .priv_data_size = sizeof(LOCOContext), .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/cabac.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/cabac.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/cabac.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/cabac.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #ifndef AVCODEC_LOONGARCH_CABAC_H #define AVCODEC_LOONGARCH_CABAC_H +#include "libavutil/attributes.h" #include "libavcodec/cabac.h" #include "config.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20 }; -static av_always_inline void avc_chroma_hv_8x4_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_hv_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) @@ -71,7 +71,7 @@ __lasx_xvstelm_d(out, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hv_8x8_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_hv_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) @@ -127,7 +127,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hz_8x4_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_hz_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2x = stride << 1; @@ -154,7 +154,7 @@ } -static av_always_inline void avc_chroma_hz_8x8_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_hz_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2x = stride << 1; @@ -193,7 +193,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hz_nonmult_lasx(uint8_t *src, +static av_always_inline void avc_chroma_hz_nonmult_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -239,7 +239,7 @@ } } -static av_always_inline void avc_chroma_vt_8x4_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_vt_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2x = stride << 1; @@ -266,7 +266,7 @@ __lasx_xvstelm_d(out, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_vt_8x8_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avc_chroma_vt_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2x = stride << 1; @@ -307,7 +307,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void copy_width8x8_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void copy_width8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride) { uint64_t tmp[8]; @@ -347,7 +347,7 @@ ); } -static av_always_inline void copy_width8x4_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void copy_width8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride) { uint64_t tmp[4]; @@ -372,7 +372,7 @@ ); } -static void avc_chroma_hv_8w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hv_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1, int32_t height) @@ -386,7 +386,7 @@ } } -static void avc_chroma_hv_4x2_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hv_4x2_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -414,7 +414,7 @@ __lasx_xvstelm_w(res_vt, dst + stride, 0, 1); } -static void avc_chroma_hv_4x4_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hv_4x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -446,7 +446,7 @@ __lasx_xvstelm_w(res_hz0, dst + stride_3, 0, 5); } -static void avc_chroma_hv_4x8_lasx(uint8_t *src, uint8_t * dst, ptrdiff_t stride, +static void avc_chroma_hv_4x8_lasx(const uint8_t *src, uint8_t * dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -492,7 +492,7 @@ __lasx_xvstelm_w(res_hz0, dst + stride_3, 0, 7); } -static void avc_chroma_hv_4w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hv_4w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1, int32_t height) @@ -509,7 +509,7 @@ } } -static void avc_chroma_hz_4x2_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hz_4x2_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { __m256i src0, src1; @@ -528,7 +528,7 @@ __lasx_xvstelm_w(res, dst + stride, 0, 1); } -static void avc_chroma_hz_4x4_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hz_4x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2 = stride << 1; @@ -553,7 +553,7 @@ __lasx_xvstelm_w(res, dst + stride_3, 0, 5); } -static void avc_chroma_hz_4x8_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hz_4x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2 = stride << 1; @@ -588,7 +588,7 @@ __lasx_xvstelm_w(res0, dst + stride_3, 0, 7); } -static void avc_chroma_hz_4w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hz_4w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -601,7 +601,7 @@ } } -static void avc_chroma_hz_8w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_hz_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -614,7 +614,7 @@ } } -static void avc_chroma_vt_4x2_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_vt_4x2_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { __m256i src0, src1, src2; @@ -635,7 +635,7 @@ __lasx_xvstelm_w(res, dst + stride, 0, 1); } -static void avc_chroma_vt_4x4_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_vt_4x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2 = stride << 1; @@ -664,7 +664,7 @@ __lasx_xvstelm_w(res, dst + stride_3, 0, 5); } -static void avc_chroma_vt_4x8_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_vt_4x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { ptrdiff_t stride_2 = stride << 1; @@ -705,7 +705,7 @@ __lasx_xvstelm_w(res0, dst + stride_3, 0, 7); } -static void avc_chroma_vt_4w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_vt_4w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -718,7 +718,7 @@ } } -static void avc_chroma_vt_8w_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avc_chroma_vt_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -729,7 +729,7 @@ } } -static void copy_width4_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void copy_width4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, int32_t height) { uint32_t tp0, tp1, tp2, tp3, tp4, tp5, tp6, tp7; @@ -799,7 +799,7 @@ } } -static void copy_width8_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void copy_width8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, int32_t height) { if (8 == height) { @@ -809,7 +809,7 @@ } } -void ff_put_h264_chroma_mc4_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -825,7 +825,7 @@ } } -void ff_put_h264_chroma_mc8_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -841,7 +841,7 @@ } } -static av_always_inline void avc_chroma_hv_and_aver_dst_8x4_lasx(uint8_t *src, +static av_always_inline void avc_chroma_hv_and_aver_dst_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) @@ -885,7 +885,7 @@ __lasx_xvstelm_d(out, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hv_and_aver_dst_8x8_lasx(uint8_t *src, +static av_always_inline void avc_chroma_hv_and_aver_dst_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) @@ -957,7 +957,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hz_and_aver_dst_8x4_lasx(uint8_t *src, +static av_always_inline void avc_chroma_hz_and_aver_dst_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -990,7 +990,7 @@ __lasx_xvstelm_d(out, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_hz_and_aver_dst_8x8_lasx(uint8_t *src, +static av_always_inline void avc_chroma_hz_and_aver_dst_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1043,7 +1043,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_vt_and_aver_dst_8x4_lasx(uint8_t *src, +static av_always_inline void avc_chroma_vt_and_aver_dst_8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1077,7 +1077,7 @@ __lasx_xvstelm_d(out, dst + stride_3x, 0, 3); } -static av_always_inline void avc_chroma_vt_and_aver_dst_8x8_lasx(uint8_t *src, +static av_always_inline void avc_chroma_vt_and_aver_dst_8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1132,7 +1132,7 @@ __lasx_xvstelm_d(out1, dst + stride_3x, 0, 3); } -static av_always_inline void avg_width8x8_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avg_width8x8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride) { __m256i src0, src1, src2, src3; @@ -1184,7 +1184,7 @@ __lasx_xvstelm_d(dst0, dst + stride_3x, 0, 3); } -static av_always_inline void avg_width8x4_lasx(uint8_t *src, uint8_t *dst, +static av_always_inline void avg_width8x4_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride) { __m256i src0, src1, src2, src3; @@ -1213,7 +1213,7 @@ __lasx_xvstelm_d(dst0, dst + stride_3x, 0, 3); } -static void avc_chroma_hv_and_aver_dst_8w_lasx(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1230,7 +1230,7 @@ } } -static void avc_chroma_hz_and_aver_dst_8w_lasx(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1241,7 +1241,7 @@ } } -static void avc_chroma_vt_and_aver_dst_8w_lasx(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_8w_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1252,7 +1252,7 @@ } } -static void avg_width8_lasx(uint8_t *src, uint8_t *dst, ptrdiff_t stride, +static void avg_width8_lasx(const uint8_t *src, uint8_t *dst, ptrdiff_t stride, int32_t height) { if (8 == height) { @@ -1262,7 +1262,7 @@ } } -void ff_avg_h264_chroma_mc8_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/h264chroma_lasx.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,11 +26,11 @@ #include #include "libavcodec/h264.h" -void ff_put_h264_chroma_mc4_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc8_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_lasx(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); #endif /* AVCODEC_LOONGARCH_H264CHROMA_LASX_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ }; /* hevc_copy: dst = src << 6 */ -static void hevc_copy_4w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_4w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -83,7 +83,7 @@ } } -static void hevc_copy_6w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_6w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -146,7 +146,7 @@ } } -static void hevc_copy_8w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_8w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -197,7 +197,7 @@ } } -static void hevc_copy_12w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_12w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -269,7 +269,7 @@ } } -static void hevc_copy_16w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -354,7 +354,7 @@ } } -static void hevc_copy_24w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -365,7 +365,7 @@ int32_t dst_stride_2x = (dst_stride << 2); int32_t src_stride_3x = src_stride_2x + src_stride; int32_t dst_stride_3x = dst_stride_2x + dst_stride_x; - uint8_t *_src = src + 16; + const uint8_t *_src = src + 16; int16_t *dst1 = dst; __m128i zero = __lsx_vldi(0); __m128i src0, src1, src2, src3, src4, src5, src6, src7; @@ -408,7 +408,7 @@ } } -static void hevc_copy_32w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -416,7 +416,7 @@ int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_4x = (src_stride << 2); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src = src + 16; + const uint8_t *_src = src + 16; __m128i zero = {0}; __m128i src0, src1, src2, src3, src4, src5, src6, src7; __m128i in0_r, in1_r, in2_r, in3_r, in0_l, in1_l, in2_l, in3_l; @@ -468,7 +468,7 @@ } } -static void hevc_copy_48w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_48w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -543,7 +543,7 @@ } } -static void hevc_copy_64w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_copy_64w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -595,7 +595,7 @@ } } -static void hevc_hz_8t_4w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_4w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -682,7 +682,7 @@ } } -static void hevc_hz_8t_8w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_8w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -746,7 +746,7 @@ } } -static void hevc_hz_8t_12w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_12w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -754,7 +754,7 @@ int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_4x = (src_stride << 2); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src; + const uint8_t *_src; __m128i src0, src1, src2, src3, src4, src5, src6, src7; __m128i mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; __m128i vec0, vec1, vec2, vec3, vec4, vec5; @@ -838,7 +838,7 @@ } } -static void hevc_hz_8t_16w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -898,7 +898,7 @@ } } -static void hevc_hz_8t_24w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -968,7 +968,7 @@ } } -static void hevc_hz_8t_32w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1028,7 +1028,7 @@ } } -static void hevc_hz_8t_48w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_48w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1097,7 +1097,7 @@ } } -static void hevc_hz_8t_64w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_64w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1191,7 +1191,7 @@ } } -static void hevc_vt_8t_4w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_4w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1311,7 +1311,7 @@ } } -static void hevc_vt_8t_8w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_8w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1385,7 +1385,7 @@ } } -static void hevc_vt_8t_12w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_12w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1487,7 +1487,7 @@ } } -static void hevc_vt_8t_16multx4mult_lsx(uint8_t *src, +static void hevc_vt_8t_16multx4mult_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1495,7 +1495,7 @@ int32_t height, int32_t width) { - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t loop_cnt, cnt; int32_t src_stride_2x = (src_stride << 1); @@ -1611,7 +1611,7 @@ } } -static void hevc_vt_8t_16w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1619,7 +1619,7 @@ filter, height, 16); } -static void hevc_vt_8t_24w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1629,7 +1629,7 @@ filter, height); } -static void hevc_vt_8t_32w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1637,7 +1637,7 @@ filter, height, 32); } -static void hevc_vt_8t_48w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_48w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1645,7 +1645,7 @@ filter, height, 48); } -static void hevc_vt_8t_64w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_64w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1653,7 +1653,7 @@ filter, height, 64); } -static void hevc_hv_8t_4w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_4w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1785,7 +1785,7 @@ } } -static void hevc_hv_8t_8multx1mult_lsx(uint8_t *src, +static void hevc_hv_8t_8multx1mult_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1795,7 +1795,7 @@ int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_4x = (src_stride << 2); @@ -1928,7 +1928,7 @@ } } -static void hevc_hv_8t_8w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_8w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1937,13 +1937,13 @@ filter_x, filter_y, height, 8); } -static void hevc_hv_8t_12w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_12w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_4x = (src_stride << 2); @@ -2174,7 +2174,7 @@ } } -static void hevc_hv_8t_16w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2183,7 +2183,7 @@ filter_x, filter_y, height, 16); } -static void hevc_hv_8t_24w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2192,7 +2192,7 @@ filter_x, filter_y, height, 24); } -static void hevc_hv_8t_32w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2201,7 +2201,7 @@ filter_x, filter_y, height, 32); } -static void hevc_hv_8t_48w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_48w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2210,7 +2210,7 @@ filter_x, filter_y, height, 48); } -static void hevc_hv_8t_64w_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_64w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2219,7 +2219,7 @@ filter_x, filter_y, height, 64); } -static void hevc_hz_4t_32w_lsx(uint8_t *src, +static void hevc_hz_4t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2265,7 +2265,7 @@ } } -static void hevc_vt_4t_16w_lsx(uint8_t *src, +static void hevc_vt_4t_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2327,7 +2327,7 @@ } } -static void hevc_vt_4t_24w_lsx(uint8_t *src, +static void hevc_vt_4t_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2337,7 +2337,7 @@ int32_t loop_cnt; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src; + const uint8_t *_src; __m128i src0, src1, src2, src3, src4, src5; __m128i src6, src7, src8, src9, src10, src11; @@ -2421,7 +2421,7 @@ } } -static void hevc_vt_4t_32w_lsx(uint8_t *src, +static void hevc_vt_4t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2431,7 +2431,7 @@ int32_t loop_cnt; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src; + const uint8_t *_src; __m128i src0, src1, src2, src3, src4, src5; __m128i src6, src7, src8, src9, src10, src11; @@ -2527,7 +2527,7 @@ } } -static void hevc_hv_4t_8x2_lsx(uint8_t *src, +static void hevc_hv_4t_8x2_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2594,7 +2594,7 @@ __lsx_vst(dst1_r, dst + dst_stride, 0); } -static void hevc_hv_4t_8multx4_lsx(uint8_t *src, int32_t src_stride, +static void hevc_hv_4t_8multx4_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t width8mult) @@ -2694,7 +2694,7 @@ } } -static void hevc_hv_4t_8x6_lsx(uint8_t *src, +static void hevc_hv_4t_8x6_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2803,7 +2803,7 @@ __lsx_vstx(dst5_r, dst, dst_stride_2x); } -static void hevc_hv_4t_8multx4mult_lsx(uint8_t *src, +static void hevc_hv_4t_8multx4mult_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2813,7 +2813,7 @@ int32_t width8mult) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t src_stride_2x = (src_stride << 1); int32_t dst_stride_x = (dst_stride << 1); @@ -2930,7 +2930,7 @@ } } -static void hevc_hv_4t_8w_lsx(uint8_t *src, +static void hevc_hv_4t_8w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2954,7 +2954,7 @@ } } -static void hevc_hv_4t_12w_lsx(uint8_t *src, +static void hevc_hv_4t_12w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2963,7 +2963,7 @@ int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t src_stride_2x = (src_stride << 1); int32_t dst_stride_x = (dst_stride << 1); @@ -3159,7 +3159,7 @@ } } -static void hevc_hv_4t_16w_lsx(uint8_t *src, +static void hevc_hv_4t_16w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3176,7 +3176,7 @@ } } -static void hevc_hv_4t_24w_lsx(uint8_t *src, +static void hevc_hv_4t_24w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3188,7 +3188,7 @@ filter_x, filter_y, height, 3); } -static void hevc_hv_4t_32w_lsx(uint8_t *src, +static void hevc_hv_4t_32w_lsx(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3202,7 +3202,7 @@ #define MC_COPY(WIDTH) \ void ff_hevc_put_hevc_pel_pixels##WIDTH##_8_lsx(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -3226,7 +3226,7 @@ #define MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_lsx(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -3267,7 +3267,7 @@ #define MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_##PEL##_hv##WIDTH##_8_lsx(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevcdsp_lsx.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #define MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_lsx(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -88,9 +88,9 @@ #define BI_MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -145,7 +145,7 @@ #define UNI_MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -181,7 +181,7 @@ void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t \ dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t \ src_stride, \ int height, \ @@ -202,24 +202,24 @@ #undef UNI_W_MC void ff_hevc_loop_filter_luma_h_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm); + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm); void ff_hevc_loop_filter_luma_v_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm); + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm); void ff_hevc_loop_filter_chroma_h_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm); + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm); void ff_hevc_loop_filter_chroma_v_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm); + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm); -void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int eo, int width, int height); void ff_hevc_idct_4x4_lsx(int16_t *coeffs, int col_limit); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_lpf_sao_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_lpf_sao_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_lpf_sao_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_lpf_sao_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,8 +24,8 @@ #include "hevcdsp_lsx.h" void ff_hevc_loop_filter_luma_h_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm) + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm) { ptrdiff_t stride_2x = (stride << 1); ptrdiff_t stride_4x = (stride << 2); @@ -436,8 +436,8 @@ } void ff_hevc_loop_filter_luma_v_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm) + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm) { ptrdiff_t stride_2x = (stride << 1); ptrdiff_t stride_4x = (stride << 2); @@ -861,8 +861,8 @@ } void ff_hevc_loop_filter_chroma_h_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm) + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm) { uint8_t *p1_ptr = src - (stride << 1); uint8_t *p0_ptr = src - stride; @@ -915,8 +915,8 @@ } void ff_hevc_loop_filter_chroma_v_8_lsx(uint8_t *src, ptrdiff_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm) + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm) { ptrdiff_t stride_2x = (stride << 1); ptrdiff_t stride_4x = (stride << 2); @@ -987,9 +987,9 @@ static void hevc_sao_edge_filter_0degree_4width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { const int32_t src_stride_2x = (src_stride << 1); @@ -1072,9 +1072,9 @@ static void hevc_sao_edge_filter_0degree_8width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { const int32_t src_stride_2x = (src_stride << 1); @@ -1165,13 +1165,14 @@ static void hevc_sao_edge_filter_0degree_16multiple_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t width, int32_t height) { - uint8_t *dst_ptr, *src_minus1; + uint8_t *dst_ptr; + const uint8_t *src_minus1; int32_t v_cnt; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -1303,9 +1304,9 @@ static void hevc_sao_edge_filter_90degree_4width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { const int32_t src_stride_2x = (src_stride << 1); @@ -1398,9 +1399,9 @@ static void hevc_sao_edge_filter_90degree_8width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { const int32_t src_stride_2x = (src_stride << 1); @@ -1491,14 +1492,14 @@ static void hevc_sao_edge_filter_90degree_16multiple_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t * + const int16_t * sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig = src; + const uint8_t *src_orig = src; uint8_t *dst_orig = dst; int32_t h_cnt, v_cnt; const int32_t src_stride_2x = (src_stride << 1); @@ -1610,12 +1611,12 @@ static void hevc_sao_edge_filter_45degree_4width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); __m128i shuf1 = {0x807060504030201, 0x100F0E0D0C0B0A09}; @@ -1723,12 +1724,12 @@ static void hevc_sao_edge_filter_45degree_8width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); __m128i shuf1 = {0x807060504030201, 0x100F0E0D0C0B0A09}; @@ -1842,14 +1843,14 @@ static void hevc_sao_edge_filter_45degree_16multiple_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t * + const int16_t * sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig = src; + const uint8_t *src_orig = src; uint8_t *dst_orig = dst; int32_t v_cnt; const int32_t src_stride_2x = (src_stride << 1); @@ -1990,12 +1991,12 @@ static void hevc_sao_edge_filter_135degree_4width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -2105,12 +2106,12 @@ static void hevc_sao_edge_filter_135degree_8width_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -2219,13 +2220,14 @@ static void hevc_sao_edge_filter_135degree_16multiple_lsx(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig, *dst_orig; + const uint8_t *src_orig; + uint8_t *dst_orig; int32_t v_cnt; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -2362,9 +2364,9 @@ } } -void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int eo, int width, int height) { ptrdiff_t stride_src = (2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_bi_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_bi_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_bi_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_bi_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,8 +42,8 @@ /* hevc_bi_copy: dst = av_clip_uint8((src0 << 6 + src1) >> 7) */ static -void hevc_bi_copy_4w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_4w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { int32_t loop_cnt = height >> 3; @@ -127,8 +127,8 @@ } static -void hevc_bi_copy_6w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_6w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { int32_t loop_cnt; @@ -223,8 +223,8 @@ } static -void hevc_bi_copy_8w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_8w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { int32_t loop_cnt = height >> 3; @@ -308,8 +308,8 @@ } static -void hevc_bi_copy_12w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_12w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { uint32_t loop_cnt; @@ -322,7 +322,7 @@ int32_t src_stride_3x = src_stride_2x + src_stride; int32_t dst_stride_3x = dst_stride_2x + dst_stride; int32_t src2_stride_3x = src2_stride_2x + src2_stride_x; - int16_t* _src1 = src1_ptr + 8; + const int16_t *_src1 = src1_ptr + 8; __m128i out0, out1, out2; __m128i src0, src1, src2, src3; __m128i in0, in1, in2, in3, in4, in5, in6, in7; @@ -366,8 +366,8 @@ } static -void hevc_bi_copy_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { uint32_t loop_cnt; @@ -380,7 +380,7 @@ int32_t src_stride_3x = src_stride_2x + src_stride; int32_t dst_stride_3x = dst_stride_2x + dst_stride; int32_t src2_stride_3x = src2_stride_2x + src2_stride_x; - int16_t *_src1 = src1_ptr + 8; + const int16_t *_src1 = src1_ptr + 8; __m128i out0, out1, out2, out3; __m128i src0, src1, src2, src3; __m128i in0, in1, in2, in3, in4, in5, in6, in7; @@ -423,8 +423,8 @@ } static -void hevc_bi_copy_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { hevc_bi_copy_16w_lsx(src0_ptr, src_stride, src1_ptr, src2_stride, @@ -434,8 +434,8 @@ } static -void hevc_bi_copy_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { hevc_bi_copy_16w_lsx(src0_ptr, src_stride, src1_ptr, src2_stride, @@ -445,8 +445,8 @@ } static -void hevc_bi_copy_48w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_48w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { hevc_bi_copy_16w_lsx(src0_ptr, src_stride, src1_ptr, src2_stride, @@ -456,8 +456,8 @@ } static -void hevc_bi_copy_64w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_bi_copy_64w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { hevc_bi_copy_32w_lsx(src0_ptr, src_stride, src1_ptr, src2_stride, @@ -466,8 +466,8 @@ dst + 32, dst_stride, height); } -static void hevc_hz_8t_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_8t_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -531,8 +531,8 @@ } } -static void hevc_hz_8t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_8t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -585,8 +585,8 @@ } } -static void hevc_hz_8t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_8t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -596,8 +596,8 @@ dst + 16, dst_stride, filter, height); } -static void hevc_hz_8t_48w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_8t_48w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -607,8 +607,8 @@ dst + 16, dst_stride, filter, height); } -static void hevc_hz_8t_64w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_8t_64w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -619,7 +619,7 @@ } static av_always_inline -void hevc_vt_8t_8w_lsx(uint8_t *src0_ptr, int32_t src_stride, int16_t *src1_ptr, +void hevc_vt_8t_8w_lsx(const uint8_t *src0_ptr, int32_t src_stride, const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride,\ const int8_t *filter, int32_t height) { @@ -705,14 +705,14 @@ } static av_always_inline -void hevc_vt_8t_16multx2mult_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_vt_8t_16multx2mult_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height, int32_t width) { - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; uint32_t loop_cnt; uint32_t cnt; @@ -808,8 +808,8 @@ } } -static void hevc_vt_8t_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_8t_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -817,8 +817,8 @@ dst, dst_stride, filter, height, 16); } -static void hevc_vt_8t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_8t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -828,8 +828,8 @@ dst + 16, dst_stride, filter, height); } -static void hevc_vt_8t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_8t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -837,8 +837,8 @@ dst, dst_stride, filter, height, 32); } -static void hevc_vt_8t_48w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_8t_48w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -846,8 +846,8 @@ dst, dst_stride, filter, height, 48); } -static void hevc_vt_8t_64w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_8t_64w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -856,16 +856,16 @@ } static av_always_inline -void hevc_hv_8t_8multx1mult_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_hv_8t_8multx1mult_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t width) { uint32_t loop_cnt; uint32_t cnt; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_4x = (src_stride << 2); @@ -994,8 +994,8 @@ } } -static void hevc_hv_8t_8w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_8w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1004,8 +1004,8 @@ dst, dst_stride, filter_x, filter_y, height, 8); } -static void hevc_hv_8t_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1014,8 +1014,8 @@ dst, dst_stride, filter_x, filter_y, height, 16); } -static void hevc_hv_8t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1024,8 +1024,8 @@ dst, dst_stride, filter_x, filter_y, height, 24); } -static void hevc_hv_8t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1034,8 +1034,8 @@ dst, dst_stride, filter_x, filter_y, height, 32); } -static void hevc_hv_8t_48w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_48w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1044,8 +1044,8 @@ dst, dst_stride, filter_x, filter_y, height, 48); } -static void hevc_hv_8t_64w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_8t_64w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1054,12 +1054,12 @@ dst, dst_stride, filter_x, filter_y, height, 64); } -static void hevc_hz_4t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_4t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { - int16_t *src1_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; uint32_t loop_cnt; int32_t dst_stride_2x = (dst_stride << 1); @@ -1157,8 +1157,8 @@ } } -static void hevc_hz_4t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hz_4t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1201,8 +1201,8 @@ } } -static void hevc_vt_4t_12w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_4t_12w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1216,7 +1216,7 @@ int32_t src_stride_3x = src_stride_2x + src_stride; int32_t dst_stride_3x = dst_stride_2x + dst_stride; int32_t src2_stride_3x = src2_stride_2x + src2_stride_x; - int16_t *_src1 = src1_ptr + 8; + const int16_t *_src1 = src1_ptr + 8; __m128i src0, src1, src2, src3, src4, src5, src6; __m128i in0, in1, in2, in3, in4, in5, in6, in7; __m128i src10_r, src32_r, src21_r, src43_r, src54_r, src65_r; @@ -1290,8 +1290,8 @@ } } -static void hevc_vt_4t_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_4t_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1362,8 +1362,8 @@ } } -static void hevc_vt_4t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_4t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1469,8 +1469,8 @@ } } -static void hevc_vt_4t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_vt_4t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1480,8 +1480,8 @@ dst + 16, dst_stride, filter, height); } -static void hevc_hv_4t_6w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_4t_6w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1668,7 +1668,7 @@ } static av_always_inline -void hevc_hv_4t_8x2_lsx(uint8_t *src0_ptr, int32_t src_stride, int16_t *src1_ptr, +void hevc_hv_4t_8x2_lsx(const uint8_t *src0_ptr, int32_t src_stride, const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y) { @@ -1739,8 +1739,8 @@ } static av_always_inline -void hevc_hv_4t_8multx4_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_hv_4t_8multx4_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t width8mult) @@ -1858,7 +1858,7 @@ } static av_always_inline -void hevc_hv_4t_8x6_lsx(uint8_t *src0_ptr, int32_t src_stride, int16_t *src1_ptr, +void hevc_hv_4t_8x6_lsx(const uint8_t *src0_ptr, int32_t src_stride, const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y) { @@ -1990,15 +1990,15 @@ } static av_always_inline -void hevc_hv_4t_8multx4mult_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +void hevc_hv_4t_8multx4mult_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -2130,8 +2130,8 @@ } } -static void hevc_hv_4t_8w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_4t_8w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2151,8 +2151,8 @@ } } -static void hevc_hv_4t_16w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_4t_16w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2166,8 +2166,8 @@ } } -static void hevc_hv_4t_24w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_4t_24w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2176,8 +2176,8 @@ dst, dst_stride, filter_x, filter_y, height, 24); } -static void hevc_hv_4t_32w_lsx(uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, int32_t src2_stride, +static void hevc_hv_4t_32w_lsx(const uint8_t *src0_ptr, int32_t src_stride, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -2189,9 +2189,9 @@ #define BI_MC_COPY(WIDTH) \ void ff_hevc_put_hevc_bi_pel_pixels##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -2216,9 +2216,9 @@ #define BI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -2257,9 +2257,9 @@ #define BI_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_bi_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uni_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uni_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uni_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uni_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ }; static av_always_inline -void common_hz_8t_64w_lsx(uint8_t *src, int32_t src_stride, +void common_hz_8t_64w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -125,7 +125,7 @@ } static av_always_inline -void common_vt_8t_8w_lsx(uint8_t *src, int32_t src_stride, +void common_vt_8t_8w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -197,11 +197,11 @@ } static av_always_inline -void common_vt_8t_16w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void common_vt_8t_16w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height, int32_t width) { - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; uint32_t loop_cnt, cnt; const int32_t src_stride_2x = (src_stride << 1); @@ -304,7 +304,7 @@ } } -static void common_vt_8t_24w_lsx(uint8_t *src, int32_t src_stride, +static void common_vt_8t_24w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -313,21 +313,21 @@ height); } -static void common_vt_8t_32w_lsx(uint8_t *src, int32_t src_stride, +static void common_vt_8t_32w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { common_vt_8t_16w_lsx(src, src_stride, dst, dst_stride, filter, height, 32); } -static void common_vt_8t_48w_lsx(uint8_t *src, int32_t src_stride, +static void common_vt_8t_48w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { common_vt_8t_16w_lsx(src, src_stride, dst, dst_stride, filter, height, 48); } -static void common_vt_8t_64w_lsx(uint8_t *src, int32_t src_stride, +static void common_vt_8t_64w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -335,12 +335,12 @@ } static av_always_inline -void hevc_hv_8t_8x2_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_8x2_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -496,7 +496,7 @@ } } -static void hevc_hv_8t_8w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_8w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -504,7 +504,7 @@ filter_x, filter_y, height, 8); } -static void hevc_hv_8t_16w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_16w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -512,7 +512,7 @@ filter_x, filter_y, height, 16); } -static void hevc_hv_8t_24w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_24w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -520,7 +520,7 @@ filter_x, filter_y, height, 24); } -static void hevc_hv_8t_32w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_32w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -528,7 +528,7 @@ filter_x, filter_y, height, 32); } -static void hevc_hv_8t_48w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_48w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -536,7 +536,7 @@ filter_x, filter_y, height, 48); } -static void hevc_hv_8t_64w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_8t_64w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -545,14 +545,14 @@ } static av_always_inline -void common_vt_4t_24w_lsx(uint8_t *src, int32_t src_stride, +void common_vt_4t_24w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { uint32_t loop_cnt; int32_t src_stride_2x = (src_stride << 1); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src; + const uint8_t *_src; __m128i src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; __m128i src11, filt0, filt1; @@ -651,7 +651,7 @@ } static av_always_inline -void common_vt_4t_32w_lsx(uint8_t *src, int32_t src_stride, +void common_vt_4t_32w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -659,7 +659,7 @@ int32_t src_stride_2x = (src_stride << 1); int32_t dst_stride_2x = (dst_stride << 1); int32_t src_stride_3x = src_stride_2x + src_stride; - uint8_t *_src; + const uint8_t *_src; __m128i src0, src1, src2, src3, src4, src6, src7, src8, src9, src10; __m128i src10_r, src32_r, src76_r, src98_r; @@ -745,7 +745,7 @@ } static av_always_inline -void hevc_hv_4t_8x2_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_8x2_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y) { @@ -806,7 +806,7 @@ } static av_always_inline -void hevc_hv_4t_8multx4_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_8multx4_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t width8mult) { @@ -902,7 +902,7 @@ } static av_always_inline -void hevc_hv_4t_8x6_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_8x6_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y) { @@ -1009,13 +1009,13 @@ } static av_always_inline -void hevc_hv_4t_8multx4mult_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_8multx4mult_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t width8mult) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -1128,7 +1128,7 @@ } static -void hevc_hv_4t_8w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_8w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -1146,12 +1146,13 @@ } static av_always_inline -void hevc_hv_4t_12w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_4t_12w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); const int32_t src_stride_4x = (src_stride << 2); @@ -1333,7 +1334,7 @@ } } -static void hevc_hv_4t_16w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_4t_16w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -1346,7 +1347,7 @@ } } -static void hevc_hv_4t_24w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_4t_24w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -1354,7 +1355,7 @@ filter_x, filter_y, height, 3); } -static void hevc_hv_4t_32w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +static void hevc_hv_4t_32w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { @@ -1365,7 +1366,7 @@ #define UNI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -1393,7 +1394,7 @@ #define UNI_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_uni_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uniw_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uniw_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uniw_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/hevc_mc_uniw_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,13 +31,13 @@ }; static av_always_inline -void hevc_hv_8t_8x2_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_8x2_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val, int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; const int32_t src_stride_2x = (src_stride << 1); const int32_t dst_stride_2x = (dst_stride << 1); @@ -207,7 +207,7 @@ } static -void hevc_hv_8t_8w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_8w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -217,7 +217,7 @@ } static -void hevc_hv_8t_16w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_16w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -227,7 +227,7 @@ } static -void hevc_hv_8t_24w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_24w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -237,7 +237,7 @@ } static -void hevc_hv_8t_32w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_32w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -247,7 +247,7 @@ } static -void hevc_hv_8t_48w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_48w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -257,7 +257,7 @@ } static -void hevc_hv_8t_64w_lsx(uint8_t *src, int32_t src_stride, uint8_t *dst, +void hevc_hv_8t_64w_lsx(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height, int32_t weight, int32_t offset, int32_t rnd_val) @@ -270,7 +270,7 @@ #define UNI_W_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_uni_w_##PEL##_hv##WIDTH##_8_lsx(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ int denom, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_lasx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -698,7 +698,7 @@ PUT_VC1_MSPEL_MC_LASX(3, 3); void ff_put_no_rnd_vc1_chroma_mc8_lasx(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { const int intA = (8 - x) * (8 - y); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_loongarch.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_loongarch.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_loongarch.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vc1dsp_loongarch.h 2023-03-03 13:29:59.000000000 +0000 @@ -73,7 +73,7 @@ FF_PUT_VC1_MSPEL_MC_H_LASX(3); void ff_put_no_rnd_vc1_chroma_mc8_lasx(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y); #endif /* AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/videodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/videodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/videodsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/videodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "libavcodec/videodsp.h" #include "libavutil/attributes.h" -static void prefetch_loongarch(uint8_t *mem, ptrdiff_t stride, int h) +static void prefetch_loongarch(const uint8_t *mem, ptrdiff_t stride, int h) { register const uint8_t *p = mem; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8dsp_loongarch.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8dsp_loongarch.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8dsp_loongarch.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8dsp_loongarch.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,49 +25,49 @@ #include "libavcodec/vp8dsp.h" void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int x, int y); void ff_put_vp8_pixels16_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int x, int y); void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my); /* loop filter */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8_mc_lsx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8_mc_lsx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8_mc_lsx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp8_mc_lsx.c 2023-03-03 13:29:59.000000000 +0000 @@ -122,7 +122,7 @@ } ) void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -187,7 +187,7 @@ } void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -241,7 +241,7 @@ } void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -308,7 +308,7 @@ } void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -389,7 +389,7 @@ } void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -491,7 +491,7 @@ } void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -504,7 +504,7 @@ } void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -561,7 +561,7 @@ } void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -631,7 +631,7 @@ } void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -714,7 +714,7 @@ } void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -728,7 +728,7 @@ } void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -818,7 +818,7 @@ } void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -832,7 +832,7 @@ } void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t cnt; @@ -889,12 +889,13 @@ } void ff_put_vp8_pixels16_lsx(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t width = 16; int32_t cnt, loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; __m128i src0, src1, src2, src3, src4, src5, src6, src7; ptrdiff_t src_stride2 = src_stride << 1; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp9dsp_loongarch.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp9dsp_loongarch.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp9dsp_loongarch.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/loongarch/vp9dsp_loongarch.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,9 @@ #ifndef AVCODEC_LOONGARCH_VP9DSP_LOONGARCH_H #define AVCODEC_LOONGARCH_VP9DSP_LOONGARCH_H +#include +#include + #define VP9_8TAP_LOONGARCH_LSX_FUNC(SIZE, type, type_idx) \ void ff_put_8tap_##type##_##SIZE##h_lsx(uint8_t *dst, ptrdiff_t dststride, \ const uint8_t *src, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -74,7 +74,7 @@ *left_top = lt; } -static void sub_left_predict_c(uint8_t *dst, uint8_t *src, +static void sub_left_predict_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height) { int i, j; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lossless_videoencdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,7 @@ const uint8_t *src2, intptr_t w, int *left, int *left_top); - void (*sub_left_predict)(uint8_t *dst, uint8_t *src, + void (*sub_left_predict)(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height); } LLVidEncDSPContext; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,13 +31,18 @@ /** * Apply Welch window function to audio block */ -static void lpc_apply_welch_window_c(const int32_t *data, int len, +static void lpc_apply_welch_window_c(const int32_t *data, ptrdiff_t len, double *w_data) { int i, n2; double w; double c; + if (len == 1) { + w_data[0] = 0.0; + return; + } + n2 = (len >> 1); c = 2.0 / (len - 1.0); @@ -48,6 +53,7 @@ w_data[i] = data[i] * w; w_data[len-1-i] = data[len-1-i] * w; } + w_data[n2] = 0.0; return; } @@ -65,7 +71,7 @@ * Calculate autocorrelation data from audio samples * A Welch window function is applied before calculation. */ -static void lpc_compute_autocorr_c(const double *data, int len, int lag, +static void lpc_compute_autocorr_c(const double *data, ptrdiff_t len, int lag, double *autoc) { int i, j; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lpc.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #define AVCODEC_LPC_H #include +#include #include "libavutil/avassert.h" #include "libavutil/lls.h" #include "aac_defines.h" @@ -64,7 +65,7 @@ * @param len number of input samples * @param w_data output samples */ - void (*lpc_apply_welch_window)(const int32_t *data, int len, + void (*lpc_apply_welch_window)(const int32_t *data, ptrdiff_t len, double *w_data); /** * Perform autocorrelation on input samples with delay of 0 to lag. @@ -79,7 +80,7 @@ * @param autoc output autocorrelation coefficients. * constraints: array size must be at least lag+1. */ - void (*lpc_compute_autocorr)(const double *data, int len, int lag, + void (*lpc_compute_autocorr)(const double *data, ptrdiff_t len, int lag, double *autoc); // TODO: these should be allocated to reduce ABI compatibility issues diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lscrdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lscrdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lscrdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lscrdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "bytestream.h" #include "codec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "packet.h" #include "png.h" #include "pngdsp.h" @@ -246,7 +246,7 @@ const FFCodec ff_lscr_decoder = { .p.name = "lscr", - .p.long_name = NULL_IF_CONFIG_SMALL("LEAD Screen Capture"), + CODEC_LONG_NAME("LEAD Screen Capture"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_LSCR, .p.capabilities = AV_CODEC_CAP_DR1, @@ -255,5 +255,5 @@ .close = lscr_decode_close, FF_CODEC_DECODE_CB(decode_frame_lscr), .flush = lscr_decode_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,11 +23,15 @@ #include +#include "config.h" + #define FRAC_BITS 14 #include "libavutil/macros.h" #include "mathops.h" #include "lsp.h" +#if ARCH_MIPS #include "libavcodec/mips/lsp_mips.h" +#endif /* ARCH_MIPS */ #include "libavutil/avassert.h" void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order) @@ -120,6 +124,32 @@ } } +#ifndef lsp2polyf +/** + * Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients + * needed for LSP to LPC conversion. + * We only need to calculate the 6 first elements of the polynomial. + * + * @param lsp line spectral pairs in cosine domain + * @param[out] f polynomial input/output as a vector + * + * TIA/EIA/IS-733 2.4.3.3.5-1/2 + */ +static void lsp2polyf(const double *lsp, double *f, int lp_half_order) +{ + f[0] = 1.0; + f[1] = -2 * lsp[0]; + lsp -= 2; + for (int i = 2; i <= lp_half_order; i++) { + double val = -2 * lsp[2*i]; + f[i] = val * f[i-1] + 2*f[i-2]; + for (int j = i-1; j > 1; j--) + f[j] += f[j-1] * val + f[j-2]; + f[1] += val; + } +} +#endif /* lsp2polyf */ + void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order) { int i; @@ -152,8 +182,8 @@ qa[-1] = 0.0; - ff_lsp2polyf(lsp , pa, lp_half_order ); - ff_lsp2polyf(lsp + 1, qa, lp_half_order - 1); + lsp2polyf(lsp , pa, lp_half_order ); + lsp2polyf(lsp + 1, qa, lp_half_order - 1); for (i = 1, j = lp_order - 1; i < lp_half_order; i++, j--) { double paf = pa[i] * (1 + lsp[lp_order - 1]); @@ -187,25 +217,6 @@ ff_acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1); } -#ifndef ff_lsp2polyf -void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order) -{ - int i, j; - - f[0] = 1.0; - f[1] = -2 * lsp[0]; - lsp -= 2; - for(i=2; i<=lp_half_order; i++) - { - double val = -2 * lsp[2*i]; - f[i] = val * f[i-1] + 2*f[i-2]; - for(j=i-1; j>1; j--) - f[j] += f[j-1] * val + f[j-2]; - f[1] += val; - } -} -#endif /* ff_lsp2polyf */ - void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order) { double pa[MAX_LP_HALF_ORDER+1], qa[MAX_LP_HALF_ORDER+1]; @@ -213,8 +224,8 @@ av_assert2(lp_half_order <= MAX_LP_HALF_ORDER); - ff_lsp2polyf(lsp, pa, lp_half_order); - ff_lsp2polyf(lsp + 1, qa, lp_half_order); + lsp2polyf(lsp, pa, lp_half_order); + lsp2polyf(lsp + 1, qa, lp_half_order); while (lp_half_order--) { double paf = pa[lp_half_order+1] + pa[lp_half_order]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/lsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -115,16 +115,4 @@ */ void ff_sort_nearly_sorted_floats(float *vals, int len); -/** - * Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients - * needed for LSP to LPC conversion. - * We only need to calculate the 6 first elements of the polynomial. - * - * @param lsp line spectral pairs in cosine domain - * @param[out] f polynomial input/output as a vector - * - * TIA/EIA/IS-733 2.4.3.3.5-1/2 - */ -void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order); - #endif /* AVCODEC_LSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/m101.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/m101.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/m101.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/m101.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int m101_decode_init(AVCodecContext *avctx) @@ -53,11 +53,6 @@ int min_stride = 2 * avctx->width; int bits = avctx->extradata[2*4]; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) - return ret; - frame->pict_type = AV_PICTURE_TYPE_I; - frame->key_frame = 1; - stride = AV_RL32(avctx->extradata + 5*4); if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) @@ -69,6 +64,10 @@ return AVERROR_INVALIDDATA; } + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + frame->pict_type = AV_PICTURE_TYPE_I; + frame->key_frame = 1; frame->interlaced_frame = ((avctx->extradata[3*4] & 3) != 3); if (frame->interlaced_frame) frame->top_field_first = avctx->extradata[3*4] & 1; @@ -107,11 +106,10 @@ const FFCodec ff_m101_decoder = { .p.name = "m101", - .p.long_name = NULL_IF_CONFIG_SMALL("Matrox Uncompressed SD"), + CODEC_LONG_NAME("Matrox Uncompressed SD"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_M101, .init = m101_decode_init, FF_CODEC_DECODE_CB(m101_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mace.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mace.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mace.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mace.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/common.h" /* @@ -286,7 +286,7 @@ const FFCodec ff_mace3_decoder = { .p.name = "mace3", - .p.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"), + CODEC_LONG_NAME("MACE (Macintosh Audio Compression/Expansion) 3:1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MACE3, .priv_data_size = sizeof(MACEContext), @@ -295,12 +295,11 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; const FFCodec ff_mace6_decoder = { .p.name = "mace6", - .p.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"), + CODEC_LONG_NAME("MACE (Macintosh Audio Compression/Expansion) 6:1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MACE6, .priv_data_size = sizeof(MACEContext), @@ -309,5 +308,4 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuv.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,9 +29,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "huffyuvdsp.h" -#include "internal.h" #include "lossless_videodsp.h" #include "thread.h" @@ -115,7 +114,7 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int j, int threadnr) { - MagicYUVContext *s = avctx->priv_data; + const MagicYUVContext *s = avctx->priv_data; int interlaced = s->interlaced; const int bps = s->bps; const int max = s->max - 1; @@ -247,7 +246,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, int j, int threadnr) { - MagicYUVContext *s = avctx->priv_data; + const MagicYUVContext *s = avctx->priv_data; int interlaced = s->interlaced; AVFrame *p = s->p; int i, k, x, min_width; @@ -695,7 +694,7 @@ const FFCodec ff_magicyuv_decoder = { .p.name = "magicyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), + CODEC_LONG_NAME("MagicYUV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MAGICYUV, .priv_data_size = sizeof(MagicYUVContext), @@ -705,5 +704,4 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/magicyuvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -458,11 +458,12 @@ } if (s->correlate) { - uint8_t *r, *g, *b, *decorrelated[2] = { s->decorrelate_buf[0], + uint8_t *decorrelated[2] = { s->decorrelate_buf[0], s->decorrelate_buf[1] }; const int decorrelate_linesize = FFALIGN(width, 16); const uint8_t *const data[4] = { decorrelated[0], frame->data[0], decorrelated[1], frame->data[3] }; + const uint8_t *r, *g, *b; const int linesize[4] = { decorrelate_linesize, frame->linesize[0], decorrelate_linesize, frame->linesize[3] }; @@ -565,19 +566,20 @@ const FFCodec ff_magicyuv_encoder = { .p.name = "magicyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), + CODEC_LONG_NAME("MagicYUV video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MAGICYUV, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MagicYUVContext), .p.priv_class = &magicyuv_class, .init = magy_encode_init, .close = magy_encode_close, FF_CODEC_ENCODE_CB(magy_encode_frame), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -91,16 +91,19 @@ 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_FLACDSP) += flacdsp.o OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o OBJS-$(CONFIG_GOLOMB) += golomb.o OBJS-$(CONFIG_H263DSP) += h263dsp.o OBJS-$(CONFIG_H264CHROMA) += h264chroma.o OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o -OBJS-$(CONFIG_H264PARSE) += h264_parse.o h2645_parse.o h264_ps.o +OBJS-$(CONFIG_H264PARSE) += h264_parse.o h264_ps.o h2645data.o \ + h2645_parse.o h2645_vui.o OBJS-$(CONFIG_H264PRED) += h264pred.o OBJS-$(CONFIG_H264QPEL) += h264qpel.o -OBJS-$(CONFIG_HEVCPARSE) += hevc_parse.o h2645_parse.o hevc_ps.o hevc_sei.o hevc_data.o \ +OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o +OBJS-$(CONFIG_HEVCPARSE) += hevc_parse.o hevc_ps.o hevc_data.o \ + h2645data.o h2645_parse.o h2645_vui.o +OBJS-$(CONFIG_HEVC_SEI) += hevc_sei.o h2645_sei.o \ dynamic_hdr10_plus.o dynamic_hdr_vivid.o OBJS-$(CONFIG_HPELDSP) += hpeldsp.o OBJS-$(CONFIG_HUFFMAN) += huffman.o @@ -108,12 +111,12 @@ OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o OBJS-$(CONFIG_IIRFILTER) += iirfilter.o -OBJS-$(CONFIG_MDCT15) += mdct15.o OBJS-$(CONFIG_INFLATE_WRAPPER) += zlib_wrapper.o OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o msmpeg4data.o OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o OBJS-$(CONFIG_JNI) += ffjni.o jni.o OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o +OBJS-$(CONFIG_LCMS2) += fflcms2.o OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o @@ -132,7 +135,7 @@ mpegaudiodsp_float.o OBJS-$(CONFIG_MPEGAUDIOHEADER) += mpegaudiodecheader.o mpegaudiotabs.o OBJS-$(CONFIG_MPEG4AUDIO) += mpeg4audio.o mpeg4audio_sample_rates.o -OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o mpegvideodsp.o rl.o \ +OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o rl.o \ mpegvideo_motion.o \ mpegvideodata.o mpegpicture.o \ to_upper4.o @@ -140,7 +143,11 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \ motion_est.o ratecontrol.o \ mpegvideoencdsp.o -OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o +OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \ + msmpeg4_vc1_data.o +OBJS-$(CONFIG_MSMPEG4ENC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o \ + msmpeg4_vc1_data.o +OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o jpegquanttables.o OBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o OBJS-$(CONFIG_QPELDSP) += qpeldsp.o OBJS-$(CONFIG_QSV) += qsv.o @@ -156,6 +163,7 @@ OBJS-$(CONFIG_TEXTUREDSPENC) += texturedspenc.o OBJS-$(CONFIG_TPELDSP) += tpeldsp.o OBJS-$(CONFIG_VAAPI_ENCODE) += vaapi_encode.o +OBJS-$(CONFIG_AV1_AMF_ENCODER) += amfenc_av1.o OBJS-$(CONFIG_VC1DSP) += vc1dsp.o OBJS-$(CONFIG_VIDEODSP) += videodsp.o OBJS-$(CONFIG_VP3DSP) += vp3dsp.o @@ -194,7 +202,7 @@ OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o kbdwin.o OBJS-$(CONFIG_AC3_MF_ENCODER) += mfenc.o mf_utils.o OBJS-$(CONFIG_ACELP_KELVIN_DECODER) += g729dec.o lsp.o celp_math.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o -OBJS-$(CONFIG_AGM_DECODER) += agm.o +OBJS-$(CONFIG_AGM_DECODER) += agm.o jpegquanttables.o OBJS-$(CONFIG_AIC_DECODER) += aic.o OBJS-$(CONFIG_ALAC_DECODER) += alac.o alac_data.o alacdsp.o OBJS-$(CONFIG_ALAC_ENCODER) += alacenc.o alac_data.o @@ -211,7 +219,10 @@ acelp_pitch_delay.o OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpegenc_common.o OBJS-$(CONFIG_ANM_DECODER) += anm.o +OBJS-$(CONFIG_ANULL_DECODER) += null.o +OBJS-$(CONFIG_ANULL_ENCODER) += null.o OBJS-$(CONFIG_ANSI_DECODER) += ansi.o cga_data.o +OBJS-$(CONFIG_APAC_DECODER) += apac.o OBJS-$(CONFIG_APE_DECODER) += apedec.o OBJS-$(CONFIG_APTX_DECODER) += aptxdec.o aptx.o OBJS-$(CONFIG_APTX_ENCODER) += aptxenc.o aptx.o @@ -241,6 +252,9 @@ OBJS-$(CONFIG_AURA2_DECODER) += aura.o OBJS-$(CONFIG_AV1_DECODER) += av1dec.o OBJS-$(CONFIG_AV1_CUVID_DECODER) += cuviddec.o +OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o +OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o +OBJS-$(CONFIG_AV1_QSV_ENCODER) += qsvenc_av1.o OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o @@ -261,10 +275,12 @@ OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o OBJS-$(CONFIG_BMV_AUDIO_DECODER) += bmvaudio.o OBJS-$(CONFIG_BMV_VIDEO_DECODER) += bmvvideo.o +OBJS-$(CONFIG_BONK_DECODER) += bonk.o OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o OBJS-$(CONFIG_C93_DECODER) += c93.o OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \ cavsdata.o +OBJS-$(CONFIG_CBD2_DECODER) += dpcm.o OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o ass.o OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o OBJS-$(CONFIG_CDTOONS_DECODER) += cdtoons.o @@ -328,15 +344,15 @@ OBJS-$(CONFIG_EATGQ_DECODER) += eatgq.o eaidct.o OBJS-$(CONFIG_EATGV_DECODER) += eatgv.o OBJS-$(CONFIG_EATQI_DECODER) += eatqi.o eaidct.o mpeg12.o \ - mpeg12data.o mpegvideodata.o + mpeg12data.o OBJS-$(CONFIG_EIGHTBPS_DECODER) += 8bps.o OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER) += 8svx.o OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER) += 8svx.o OBJS-$(CONFIG_ESCAPE124_DECODER) += escape124.o OBJS-$(CONFIG_ESCAPE130_DECODER) += escape130.o OBJS-$(CONFIG_EVRC_DECODER) += evrcdec.o acelp_vectors.o lsp.o -OBJS-$(CONFIG_EXR_DECODER) += exr.o exrdsp.o -OBJS-$(CONFIG_EXR_ENCODER) += exrenc.o +OBJS-$(CONFIG_EXR_DECODER) += exr.o exrdsp.o half2float.o +OBJS-$(CONFIG_EXR_ENCODER) += exrenc.o float2half.o OBJS-$(CONFIG_FASTAUDIO_DECODER) += fastaudio.o OBJS-$(CONFIG_FFV1_DECODER) += ffv1dec.o ffv1.o OBJS-$(CONFIG_FFV1_ENCODER) += ffv1enc.o ffv1.o @@ -344,8 +360,8 @@ OBJS-$(CONFIG_FIC_DECODER) += fic.o OBJS-$(CONFIG_FITS_DECODER) += fitsdec.o fits.o OBJS-$(CONFIG_FITS_ENCODER) += fitsenc.o -OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flac.o -OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o +OBJS-$(CONFIG_FLAC_DECODER) += flacdec.o flacdata.o flacdsp.o flac.o +OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flacencdsp.o OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o @@ -357,6 +373,7 @@ OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o OBJS-$(CONFIG_FRWU_DECODER) += frwu.o +OBJS-$(CONFIG_FTR_DECODER) += ftr.o OBJS-$(CONFIG_G2M_DECODER) += g2meet.o elsdec.o mjpegdec_common.o OBJS-$(CONFIG_G723_1_DECODER) += g723_1dec.o g723_1.o \ acelp_vectors.o celp_filters.o celp_math.o @@ -383,11 +400,12 @@ OBJS-$(CONFIG_H264_DECODER) += h264dec.o h264_cabac.o h264_cavlc.o \ h264_direct.o h264_loopfilter.o \ h264_mb.o h264_picture.o \ - h264_refs.o h264_sei.o \ + h264_refs.o \ h264_slice.o h264data.o h274.o OBJS-$(CONFIG_H264_AMF_ENCODER) += amfenc_h264.o OBJS-$(CONFIG_H264_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec.o +OBJS-$(CONFIG_H264_MEDIACODEC_ENCODER) += mediacodecenc.o OBJS-$(CONFIG_H264_MF_ENCODER) += mfenc.o mf_utils.o OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o OBJS-$(CONFIG_H264_NVENC_ENCODER) += nvenc_h264.o nvenc.o @@ -395,7 +413,8 @@ OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec.o OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o OBJS-$(CONFIG_H264_RKMPP_DECODER) += rkmppdec.o -OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o h264_levels.o +OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o h264_levels.o \ + h2645data.o OBJS-$(CONFIG_H264_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o OBJS-$(CONFIG_H264_V4L2M2M_DECODER) += v4l2_m2m_dec.o OBJS-$(CONFIG_H264_V4L2M2M_ENCODER) += v4l2_m2m_enc.o @@ -403,6 +422,8 @@ OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o OBJS-$(CONFIG_HCA_DECODER) += hcadec.o OBJS-$(CONFIG_HCOM_DECODER) += hcom.o +OBJS-$(CONFIG_HDR_DECODER) += hdrdec.o +OBJS-$(CONFIG_HDR_ENCODER) += hdrenc.o OBJS-$(CONFIG_HEVC_DECODER) += hevcdec.o hevc_mvs.o \ hevc_cabac.o hevc_refs.o hevcpred.o \ hevcdsp.o hevc_filter.o hevc_data.o \ @@ -410,13 +431,15 @@ OBJS-$(CONFIG_HEVC_AMF_ENCODER) += amfenc_hevc.o OBJS-$(CONFIG_HEVC_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_HEVC_MEDIACODEC_DECODER) += mediacodecdec.o +OBJS-$(CONFIG_HEVC_MEDIACODEC_ENCODER) += mediacodecenc.o OBJS-$(CONFIG_HEVC_MF_ENCODER) += mfenc.o mf_utils.o OBJS-$(CONFIG_HEVC_NVENC_ENCODER) += nvenc_hevc.o nvenc.o OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec.o OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o \ hevc_data.o OBJS-$(CONFIG_HEVC_RKMPP_DECODER) += rkmppdec.o -OBJS-$(CONFIG_HEVC_VAAPI_ENCODER) += vaapi_encode_h265.o h265_profile_level.o +OBJS-$(CONFIG_HEVC_VAAPI_ENCODER) += vaapi_encode_h265.o h265_profile_level.o \ + h2645data.o OBJS-$(CONFIG_HEVC_V4L2M2M_DECODER) += v4l2_m2m_dec.o OBJS-$(CONFIG_HEVC_V4L2M2M_ENCODER) += v4l2_m2m_enc.o OBJS-$(CONFIG_HEVC_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o @@ -462,10 +485,11 @@ OBJS-$(CONFIG_MAGICYUV_DECODER) += magicyuv.o OBJS-$(CONFIG_MAGICYUV_ENCODER) += magicyuvenc.o OBJS-$(CONFIG_MDEC_DECODER) += mdec.o mpeg12.o mpeg12data.o -OBJS-$(CONFIG_METASOUND_DECODER) += metasound.o metasound_data.o \ - twinvq.o +OBJS-$(CONFIG_MEDIA100_DECODER) += mjpegbdec.o +OBJS-$(CONFIG_METASOUND_DECODER) += metasound.o twinvq.o OBJS-$(CONFIG_MICRODVD_DECODER) += microdvddec.o ass.o OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o +OBJS-$(CONFIG_MISC4_DECODER) += misc4.o OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o mjpegdec_common.o OBJS-$(CONFIG_MJPEG_QSV_DECODER) += qsvdec.o OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpegenc_common.o \ @@ -514,7 +538,7 @@ OBJS-$(CONFIG_MPEG2_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_MPEG2_VAAPI_ENCODER) += vaapi_encode_mpeg2.o OBJS-$(CONFIG_MPEG2_V4L2M2M_DECODER) += v4l2_m2m_dec.o -OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o +OBJS-$(CONFIG_MPEG4_DECODER) += mpeg4videodsp.o xvididct.o OBJS-$(CONFIG_MPEG4_ENCODER) += mpeg4videoenc.o OBJS-$(CONFIG_MPEG4_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o @@ -524,11 +548,6 @@ OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o OBJS-$(CONFIG_MSA1_DECODER) += mss3.o OBJS-$(CONFIG_MSCC_DECODER) += mscc.o -OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o OBJS-$(CONFIG_MSNSIREN_DECODER) += siren.o OBJS-$(CONFIG_MSP2_DECODER) += msp2dec.o OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o @@ -548,13 +567,13 @@ OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o OBJS-$(CONFIG_NOTCHLC_DECODER) += notchlc.o -OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o +OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o jpegquanttables.o OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o -OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opus.o opus_celt.o opus_rc.o \ +OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \ opus_pvq.o opus_silk.o opustab.o vorbis_data.o \ - opusdsp.o -OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opus.o opus_rc.o opustab.o opus_pvq.o \ - opusenc_psy.o vorbis_data.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_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o @@ -571,8 +590,8 @@ OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o OBJS-$(CONFIG_PGSSUB_DECODER) += pgssubdec.o OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o -OBJS-$(CONFIG_PHM_DECODER) += pnmdec.o pnm.o -OBJS-$(CONFIG_PHM_ENCODER) += pnmenc.o +OBJS-$(CONFIG_PHM_DECODER) += pnmdec.o pnm.o half2float.o +OBJS-$(CONFIG_PHM_ENCODER) += pnmenc.o float2half.o OBJS-$(CONFIG_PHOTOCD_DECODER) += photocd.o OBJS-$(CONFIG_PICTOR_DECODER) += pictordec.o cga_data.o OBJS-$(CONFIG_PIXLET_DECODER) += pixlet.o @@ -612,6 +631,7 @@ OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o OBJS-$(CONFIG_RAWVIDEO_ENCODER) += rawenc.o OBJS-$(CONFIG_REALTEXT_DECODER) += realtextdec.o ass.o +OBJS-$(CONFIG_RKA_DECODER) += rka.o OBJS-$(CONFIG_RL2_DECODER) += rl2.o OBJS-$(CONFIG_ROQ_DECODER) += roqvideodec.o roqvideo.o OBJS-$(CONFIG_ROQ_ENCODER) += roqvideoenc.o roqvideo.o elbg.o @@ -656,7 +676,8 @@ OBJS-$(CONFIG_SONIC_DECODER) += sonic.o OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o -OBJS-$(CONFIG_SPEEDHQ_DECODER) += speedhq.o mpeg12.o mpeg12data.o simple_idct.o +OBJS-$(CONFIG_SPEEDHQ_DECODER) += speedhqdec.o speedhq.o mpeg12.o \ + mpeg12data.o OBJS-$(CONFIG_SPEEDHQ_ENCODER) += speedhq.o mpeg12data.o mpeg12enc.o speedhqenc.o OBJS-$(CONFIG_SPEEX_DECODER) += speexdec.o OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o @@ -699,7 +720,7 @@ OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttaencdsp.o ttadata.o OBJS-$(CONFIG_TTML_ENCODER) += ttmlenc.o ass_split.o -OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o metasound_data.o +OBJS-$(CONFIG_TWINVQ_DECODER) += twinvqdec.o twinvq.o OBJS-$(CONFIG_TXD_DECODER) += txd.o OBJS-$(CONFIG_ULTI_DECODER) += ulti.o OBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodec.o utvideodsp.o @@ -719,8 +740,7 @@ OBJS-$(CONFIG_VBLE_DECODER) += vble.o OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o \ vc1_mc.o vc1_pred.o vc1.o vc1data.o \ - msmpeg4dec.o msmpeg4.o msmpeg4data.o \ - wmv2dsp.o wmv2data.o + msmpeg4_vc1_data.o wmv2data.o OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec.o @@ -730,16 +750,18 @@ OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o +OBJS-$(CONFIG_VNULL_DECODER) += null.o +OBJS-$(CONFIG_VNULL_ENCODER) += null.o OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \ vorbis_data.o OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \ vorbis_data.o -OBJS-$(CONFIG_VP3_DECODER) += vp3.o -OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vp56rac.o +OBJS-$(CONFIG_VP3_DECODER) += vp3.o jpegquanttables.o +OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vpx_rac.o OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \ - vp6dsp.o vp56rac.o -OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o -OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o + vp6dsp.o vpx_rac.o +OBJS-$(CONFIG_VP7_DECODER) += vp8.o vpx_rac.o +OBJS-$(CONFIG_VP8_DECODER) += vp8.o vpx_rac.o OBJS-$(CONFIG_VP8_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec.o @@ -748,7 +770,7 @@ OBJS-$(CONFIG_VP8_V4L2M2M_DECODER) += v4l2_m2m_dec.o OBJS-$(CONFIG_VP8_V4L2M2M_ENCODER) += v4l2_m2m_enc.o OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9data.o vp9dsp.o vp9lpf.o vp9recon.o \ - vp9block.o vp9prob.o vp9mvs.o vp56rac.o \ + vp9block.o vp9prob.o vp9mvs.o vpx_rac.o \ vp9dsp_8bpp.o vp9dsp_10bpp.o vp9dsp_12bpp.o OBJS-$(CONFIG_VP9_CUVID_DECODER) += cuviddec.o OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER) += mediacodecdec.o @@ -758,8 +780,13 @@ OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o OBJS-$(CONFIG_VP9_V4L2M2M_DECODER) += v4l2_m2m_dec.o OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o +OBJS-$(CONFIG_VQC_DECODER) += vqcdec.o +OBJS-$(CONFIG_WADY_DPCM_DECODER) += dpcm.o +OBJS-$(CONFIG_WAVARC_DECODER) += wavarc.o OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o wavpackdata.o dsd.o OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackdata.o wavpackenc.o +OBJS-$(CONFIG_WBMP_DECODER) += wbmpdec.o +OBJS-$(CONFIG_WBMP_ENCODER) += wbmpenc.o OBJS-$(CONFIG_WCMV_DECODER) += wcmv.o OBJS-$(CONFIG_WEBP_DECODER) += webp.o OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o ass.o @@ -773,12 +800,8 @@ OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \ celp_filters.o \ acelp_vectors.o acelp_filters.o -OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o \ - msmpeg4dec.o msmpeg4.o msmpeg4data.o -OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o \ - msmpeg4.o msmpeg4enc.o msmpeg4data.o +OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o +OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o OBJS-$(CONFIG_WRAPPED_AVFRAME_DECODER) += wrapped_avframe.o OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER) += wrapped_avframe.o @@ -942,6 +965,7 @@ OBJS-$(CONFIG_ADPCM_THP_LE_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_XMD_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o OBJS-$(CONFIG_ADPCM_ZORK_DECODER) += adpcm.o adpcm_data.o @@ -1052,8 +1076,8 @@ OBJS-$(CONFIG_ILBC_AT_ENCODER) += audiotoolboxenc.o OBJS-$(CONFIG_PCM_ALAW_AT_ENCODER) += audiotoolboxenc.o OBJS-$(CONFIG_PCM_MULAW_AT_ENCODER) += audiotoolboxenc.o -OBJS-$(CONFIG_LIBAOM_AV1_DECODER) += libaomdec.o -OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc.o +OBJS-$(CONFIG_LIBAOM_AV1_DECODER) += libaomdec.o libaom.o +OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc.o libaom.o OBJS-$(CONFIG_LIBARIBB24_DECODER) += libaribb24.o ass.o OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o @@ -1114,7 +1138,7 @@ OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o OBJS-$(CONFIG_AC3_PARSER) += aac_ac3_parser.o ac3tab.o \ ac3_channel_layout_tab.o -OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o +OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o OBJS-$(CONFIG_AMR_PARSER) += amr_parser.o OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o OBJS-$(CONFIG_AVS2_PARSER) += avs2.o avs2_parser.o @@ -1134,16 +1158,19 @@ OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o +OBJS-$(CONFIG_FTR_PARSER) += ftr_parser.o OBJS-$(CONFIG_G723_1_PARSER) += g723_1_parser.o OBJS-$(CONFIG_G729_PARSER) += g729_parser.o OBJS-$(CONFIG_GIF_PARSER) += gif_parser.o OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o OBJS-$(CONFIG_H261_PARSER) += h261_parser.o OBJS-$(CONFIG_H263_PARSER) += h263_parser.o -OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264_sei.o h264data.o +OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264data.o 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_MISC4_PARSER) += misc4_parser.o OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \ @@ -1152,8 +1179,8 @@ OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \ mpeg12.o mpeg12data.o -OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus.o opustab.o \ - opus_rc.o vorbis_data.o +OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ + vorbis_data.o OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o @@ -1163,13 +1190,14 @@ OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \ - simple_idct.o wmv2data.o + wmv2data.o OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o OBJS-$(CONFIG_VP9_PARSER) += vp9_parser.o OBJS-$(CONFIG_WEBP_PARSER) += webp_parser.o OBJS-$(CONFIG_XBM_PARSER) += xbm_parser.o OBJS-$(CONFIG_XMA_PARSER) += xma_parser.o +OBJS-$(CONFIG_XWD_PARSER) += xwd_parser.o # bitstream filters OBJS-$(CONFIG_AAC_ADTSTOASC_BSF) += aac_adtstoasc_bsf.o @@ -1179,18 +1207,22 @@ OBJS-$(CONFIG_CHOMP_BSF) += chomp_bsf.o OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += dump_extradata_bsf.o OBJS-$(CONFIG_DCA_CORE_BSF) += dca_core_bsf.o +OBJS-$(CONFIG_DTS2PTS_BSF) += dts2pts_bsf.o OBJS-$(CONFIG_DV_ERROR_MARKER_BSF) += dv_error_marker_bsf.o OBJS-$(CONFIG_EAC3_CORE_BSF) += eac3_core_bsf.o OBJS-$(CONFIG_EXTRACT_EXTRADATA_BSF) += extract_extradata_bsf.o \ av1_parse.o h2645_parse.o OBJS-$(CONFIG_FILTER_UNITS_BSF) += filter_units_bsf.o -OBJS-$(CONFIG_H264_METADATA_BSF) += h264_metadata_bsf.o h264_levels.o +OBJS-$(CONFIG_H264_METADATA_BSF) += h264_metadata_bsf.o h264_levels.o \ + h2645data.o OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o OBJS-$(CONFIG_H264_REDUNDANT_PPS_BSF) += h264_redundant_pps_bsf.o OBJS-$(CONFIG_HAPQA_EXTRACT_BSF) += hapqa_extract_bsf.o hap.o -OBJS-$(CONFIG_HEVC_METADATA_BSF) += h265_metadata_bsf.o h265_profile_level.o +OBJS-$(CONFIG_HEVC_METADATA_BSF) += h265_metadata_bsf.o h265_profile_level.o \ + h2645data.o OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o +OBJS-$(CONFIG_MEDIA100_TO_MJPEGB_BSF) += media100_to_mjpegb_bsf.o OBJS-$(CONFIG_MJPEG2JPEG_BSF) += mjpeg2jpeg_bsf.o OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpega_dump_header_bsf.o OBJS-$(CONFIG_MPEG4_UNPACK_BFRAMES_BSF) += mpeg4_unpack_bframes_bsf.o @@ -1221,7 +1253,7 @@ OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o SKIPHEADERS += %_tablegen.h \ %_tables.h \ @@ -1231,12 +1263,15 @@ aaccoder_trellis.h \ aacenc_quantization.h \ aacenc_quantization_misc.h \ - $(ARCH)/vp56_arith.h \ + bitstream_template.h \ + $(ARCH)/vpx_arith.h \ SKIPHEADERS-$(CONFIG_AMF) += amfenc.h SKIPHEADERS-$(CONFIG_D3D11VA) += d3d11va.h dxva2_internal.h SKIPHEADERS-$(CONFIG_DXVA2) += dxva2.h dxva2_internal.h SKIPHEADERS-$(CONFIG_JNI) += ffjni.h +SKIPHEADERS-$(CONFIG_LCMS2) += fflcms2.h +SKIPHEADERS-$(CONFIG_LIBAOM) += libaom.h SKIPHEADERS-$(CONFIG_LIBJXL) += libjxl.h SKIPHEADERS-$(CONFIG_LIBVPX) += libvpx.h SKIPHEADERS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc_common.h @@ -1251,9 +1286,12 @@ SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h +SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h TESTPROGS = avcodec \ avpacket \ + bitstream_be \ + bitstream_le \ celp_math \ codec_desc \ htmlsubtitles \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mathops.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mathops.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mathops.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mathops.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include +#include "libavutil/attributes_internal.h" #include "libavutil/common.h" #include "config.h" @@ -32,7 +33,7 @@ extern const uint32_t ff_inverse[257]; extern const uint8_t ff_log2_run[41]; extern const uint8_t ff_sqrt_tab[256]; -extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; +extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag_scan[16+1]; @@ -136,6 +137,15 @@ return v.s >> shift; } #endif + +#ifndef sign_extend64 +static inline av_const int64_t sign_extend64(int64_t val, unsigned bits) +{ + unsigned shift = 8 * sizeof(int64_t) - bits; + union { uint64_t u; int64_t s; } v = { (uint64_t) val << shift }; + return v.s >> shift; +} +#endif #ifndef zero_extend static inline av_const unsigned zero_extend(unsigned val, unsigned bits) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2013-2014 Mozilla Corporation - * Copyright (c) 2017 Rostislav Pehlivanov - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * Celt non-power of 2 iMDCT - */ - -#include -#include -#include -#include - -#include "config.h" - -#include "libavutil/attributes.h" -#include "libavutil/error.h" - -#include "mdct15.h" - -#define FFT_FLOAT 1 -#include "fft-internal.h" - -#define CMUL3(c, a, b) CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im) - -av_cold void ff_mdct15_uninit(MDCT15Context **ps) -{ - MDCT15Context *s = *ps; - - if (!s) - return; - - ff_fft_end(&s->ptwo_fft); - - av_freep(&s->pfa_prereindex); - av_freep(&s->pfa_postreindex); - av_freep(&s->twiddle_exptab); - av_freep(&s->tmp); - - av_freep(ps); -} - -static inline int init_pfa_reindex_tabs(MDCT15Context *s) -{ - int i, j; - const int b_ptwo = s->ptwo_fft.nbits; /* Bits for the power of two FFTs */ - const int l_ptwo = 1 << b_ptwo; /* Total length for the power of two FFTs */ - const int inv_1 = l_ptwo << ((4 - b_ptwo) & 3); /* (2^b_ptwo)^-1 mod 15 */ - const int inv_2 = 0xeeeeeeef & ((1U << b_ptwo) - 1); /* 15^-1 mod 2^b_ptwo */ - - s->pfa_prereindex = av_malloc_array(15 * l_ptwo, sizeof(*s->pfa_prereindex)); - if (!s->pfa_prereindex) - return 1; - - s->pfa_postreindex = av_malloc_array(15 * l_ptwo, sizeof(*s->pfa_postreindex)); - if (!s->pfa_postreindex) - return 1; - - /* Pre/Post-reindex */ - for (i = 0; i < l_ptwo; i++) { - for (j = 0; j < 15; j++) { - const int q_pre = ((l_ptwo * j)/15 + i) >> b_ptwo; - const int q_post = (((j*inv_1)/15) + (i*inv_2)) >> b_ptwo; - const int k_pre = 15*i + (j - q_pre*15)*(1 << b_ptwo); - const int k_post = i*inv_2*15 + j*inv_1 - 15*q_post*l_ptwo; - s->pfa_prereindex[i*15 + j] = k_pre << 1; - s->pfa_postreindex[k_post] = l_ptwo*j + i; - } - } - - return 0; -} - -/* Stride is hardcoded to 3 */ -static inline void fft5(FFTComplex *out, FFTComplex *in, FFTComplex exptab[2]) -{ - FFTComplex z0[4], t[6]; - - t[0].re = in[3].re + in[12].re; - t[0].im = in[3].im + in[12].im; - t[1].im = in[3].re - in[12].re; - t[1].re = in[3].im - in[12].im; - t[2].re = in[6].re + in[ 9].re; - t[2].im = in[6].im + in[ 9].im; - t[3].im = in[6].re - in[ 9].re; - t[3].re = in[6].im - in[ 9].im; - - out[0].re = in[0].re + in[3].re + in[6].re + in[9].re + in[12].re; - out[0].im = in[0].im + in[3].im + in[6].im + in[9].im + in[12].im; - - t[4].re = exptab[0].re * t[2].re - exptab[1].re * t[0].re; - t[4].im = exptab[0].re * t[2].im - exptab[1].re * t[0].im; - t[0].re = exptab[0].re * t[0].re - exptab[1].re * t[2].re; - t[0].im = exptab[0].re * t[0].im - exptab[1].re * t[2].im; - t[5].re = exptab[0].im * t[3].re - exptab[1].im * t[1].re; - t[5].im = exptab[0].im * t[3].im - exptab[1].im * t[1].im; - t[1].re = exptab[0].im * t[1].re + exptab[1].im * t[3].re; - t[1].im = exptab[0].im * t[1].im + exptab[1].im * t[3].im; - - z0[0].re = t[0].re - t[1].re; - z0[0].im = t[0].im - t[1].im; - z0[1].re = t[4].re + t[5].re; - z0[1].im = t[4].im + t[5].im; - - z0[2].re = t[4].re - t[5].re; - z0[2].im = t[4].im - t[5].im; - z0[3].re = t[0].re + t[1].re; - z0[3].im = t[0].im + t[1].im; - - out[1].re = in[0].re + z0[3].re; - out[1].im = in[0].im + z0[0].im; - out[2].re = in[0].re + z0[2].re; - out[2].im = in[0].im + z0[1].im; - out[3].re = in[0].re + z0[1].re; - out[3].im = in[0].im + z0[2].im; - out[4].re = in[0].re + z0[0].re; - out[4].im = in[0].im + z0[3].im; -} - -static void fft15_c(FFTComplex *out, FFTComplex *in, FFTComplex *exptab, ptrdiff_t stride) -{ - int k; - FFTComplex tmp1[5], tmp2[5], tmp3[5]; - - fft5(tmp1, in + 0, exptab + 19); - fft5(tmp2, in + 1, exptab + 19); - fft5(tmp3, in + 2, exptab + 19); - - for (k = 0; k < 5; k++) { - FFTComplex t[2]; - - CMUL3(t[0], tmp2[k], exptab[k]); - CMUL3(t[1], tmp3[k], exptab[2 * k]); - out[stride*k].re = tmp1[k].re + t[0].re + t[1].re; - out[stride*k].im = tmp1[k].im + t[0].im + t[1].im; - - CMUL3(t[0], tmp2[k], exptab[k + 5]); - CMUL3(t[1], tmp3[k], exptab[2 * (k + 5)]); - out[stride*(k + 5)].re = tmp1[k].re + t[0].re + t[1].re; - out[stride*(k + 5)].im = tmp1[k].im + t[0].im + t[1].im; - - CMUL3(t[0], tmp2[k], exptab[k + 10]); - CMUL3(t[1], tmp3[k], exptab[2 * k + 5]); - out[stride*(k + 10)].re = tmp1[k].re + t[0].re + t[1].re; - out[stride*(k + 10)].im = tmp1[k].im + t[0].im + t[1].im; - } -} - -static void mdct15(MDCT15Context *s, float *dst, const float *src, ptrdiff_t stride) -{ - int i, j; - const int len4 = s->len4, len3 = len4 * 3, len8 = len4 >> 1; - const int l_ptwo = 1 << s->ptwo_fft.nbits; - FFTComplex fft15in[15]; - - /* Folding and pre-reindexing */ - for (i = 0; i < l_ptwo; i++) { - for (j = 0; j < 15; j++) { - const int k = s->pfa_prereindex[i*15 + j]; - FFTComplex tmp, exp = s->twiddle_exptab[k >> 1]; - if (k < len4) { - tmp.re = -src[ len4 + k] + src[1*len4 - 1 - k]; - tmp.im = -src[ len3 + k] - src[1*len3 - 1 - k]; - } else { - tmp.re = -src[ len4 + k] - src[5*len4 - 1 - k]; - tmp.im = src[-len4 + k] - src[1*len3 - 1 - k]; - } - CMUL(fft15in[j].im, fft15in[j].re, tmp.re, tmp.im, exp.re, exp.im); - } - s->fft15(s->tmp + s->ptwo_fft.revtab[i], fft15in, s->exptab, l_ptwo); - } - - /* Then a 15xN FFT (where N is a power of two) */ - for (i = 0; i < 15; i++) - s->ptwo_fft.fft_calc(&s->ptwo_fft, s->tmp + l_ptwo*i); - - /* Reindex again, apply twiddles and output */ - for (i = 0; i < len8; i++) { - const int i0 = len8 + i, i1 = len8 - i - 1; - const int s0 = s->pfa_postreindex[i0], s1 = s->pfa_postreindex[i1]; - - CMUL(dst[2*i1*stride + stride], dst[2*i0*stride], s->tmp[s0].re, s->tmp[s0].im, - s->twiddle_exptab[i0].im, s->twiddle_exptab[i0].re); - CMUL(dst[2*i0*stride + stride], dst[2*i1*stride], s->tmp[s1].re, s->tmp[s1].im, - s->twiddle_exptab[i1].im, s->twiddle_exptab[i1].re); - } -} - -static void imdct15_half(MDCT15Context *s, float *dst, const float *src, - ptrdiff_t stride) -{ - FFTComplex fft15in[15]; - FFTComplex *z = (FFTComplex *)dst; - int i, j, len8 = s->len4 >> 1, l_ptwo = 1 << s->ptwo_fft.nbits; - const float *in1 = src, *in2 = src + (s->len2 - 1) * stride; - - /* Reindex input, putting it into a buffer and doing an Nx15 FFT */ - for (i = 0; i < l_ptwo; i++) { - for (j = 0; j < 15; j++) { - const int k = s->pfa_prereindex[i*15 + j]; - FFTComplex tmp = { in2[-k*stride], in1[k*stride] }; - CMUL3(fft15in[j], tmp, s->twiddle_exptab[k >> 1]); - } - s->fft15(s->tmp + s->ptwo_fft.revtab[i], fft15in, s->exptab, l_ptwo); - } - - /* Then a 15xN FFT (where N is a power of two) */ - for (i = 0; i < 15; i++) - s->ptwo_fft.fft_calc(&s->ptwo_fft, s->tmp + l_ptwo*i); - - /* Reindex again, apply twiddles and output */ - s->postreindex(z, s->tmp, s->twiddle_exptab, s->pfa_postreindex, len8); -} - -static void postrotate_c(FFTComplex *out, FFTComplex *in, FFTComplex *exp, - int *lut, ptrdiff_t len8) -{ - int i; - - /* Reindex again, apply twiddles and output */ - for (i = 0; i < len8; i++) { - const int i0 = len8 + i, i1 = len8 - i - 1; - const int s0 = lut[i0], s1 = lut[i1]; - - CMUL(out[i1].re, out[i0].im, in[s1].im, in[s1].re, exp[i1].im, exp[i1].re); - CMUL(out[i0].re, out[i1].im, in[s0].im, in[s0].re, exp[i0].im, exp[i0].re); - } -} - -av_cold int ff_mdct15_init(MDCT15Context **ps, int inverse, int N, double scale) -{ - MDCT15Context *s; - double alpha, theta; - int len2 = 15 * (1 << N); - int len = 2 * len2; - int i; - - /* Tested and verified to work on everything in between */ - if ((N < 2) || (N > 13)) - return AVERROR(EINVAL); - - s = av_mallocz(sizeof(*s)); - if (!s) - return AVERROR(ENOMEM); - - s->fft_n = N - 1; - s->len4 = len2 / 2; - s->len2 = len2; - s->inverse = inverse; - s->fft15 = fft15_c; - s->mdct = mdct15; - s->imdct_half = imdct15_half; - s->postreindex = postrotate_c; - - if (ff_fft_init(&s->ptwo_fft, N - 1, s->inverse) < 0) - goto fail; - - if (init_pfa_reindex_tabs(s)) - goto fail; - - s->tmp = av_malloc_array(len, 2 * sizeof(*s->tmp)); - if (!s->tmp) - goto fail; - - s->twiddle_exptab = av_malloc_array(s->len4, sizeof(*s->twiddle_exptab)); - if (!s->twiddle_exptab) - goto fail; - - theta = 0.125f + (scale < 0 ? s->len4 : 0); - scale = sqrt(fabs(scale)); - for (i = 0; i < s->len4; i++) { - alpha = 2 * M_PI * (i + theta) / len; - s->twiddle_exptab[i].re = cosf(alpha) * scale; - s->twiddle_exptab[i].im = sinf(alpha) * scale; - } - - /* 15-point FFT exptab */ - for (i = 0; i < 19; i++) { - if (i < 15) { - double theta = (2.0f * M_PI * i) / 15.0f; - if (!s->inverse) - theta *= -1; - s->exptab[i].re = cosf(theta); - s->exptab[i].im = sinf(theta); - } else { /* Wrap around to simplify fft15 */ - s->exptab[i] = s->exptab[i - 15]; - } - } - - /* 5-point FFT exptab */ - s->exptab[19].re = cosf(2.0f * M_PI / 5.0f); - s->exptab[19].im = sinf(2.0f * M_PI / 5.0f); - s->exptab[20].re = cosf(1.0f * M_PI / 5.0f); - s->exptab[20].im = sinf(1.0f * M_PI / 5.0f); - - /* Invert the phase for an inverse transform, do nothing for a forward transform */ - if (s->inverse) { - s->exptab[19].im *= -1; - s->exptab[20].im *= -1; - } - -#if ARCH_X86 - ff_mdct15_init_x86(s); -#endif - - *ps = s; - - return 0; - -fail: - ff_mdct15_uninit(&s); - return AVERROR(ENOMEM); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdct15.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2017 Rostislav Pehlivanov - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_MDCT15_H -#define AVCODEC_MDCT15_H - -#include - -#include "libavutil/mem_internal.h" - -#include "fft.h" - -typedef struct MDCT15Context { - int fft_n; - int len2; - int len4; - int inverse; - int *pfa_prereindex; - int *pfa_postreindex; - - FFTContext ptwo_fft; - FFTComplex *tmp; - FFTComplex *twiddle_exptab; - - DECLARE_ALIGNED(32, FFTComplex, exptab)[64]; - - /* 15-point FFT */ - void (*fft15)(FFTComplex *out, FFTComplex *in, FFTComplex *exptab, ptrdiff_t stride); - - /* PFA postrotate and exptab */ - void (*postreindex)(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8); - - /* Calculate a full 2N -> N MDCT */ - void (*mdct)(struct MDCT15Context *s, float *dst, const float *src, ptrdiff_t stride); - - /* Calculate the middle half of the iMDCT */ - void (*imdct_half)(struct MDCT15Context *s, float *dst, const float *src, - ptrdiff_t stride); -} MDCT15Context; - -/* Init an (i)MDCT of the length 2 * 15 * (2^N) */ -int ff_mdct15_init(MDCT15Context **ps, int inverse, int N, double scale); -void ff_mdct15_uninit(MDCT15Context **ps); - -void ff_mdct15_init_x86(MDCT15Context *s); - -#endif /* AVCODEC_MDCT15_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,7 @@ BswapDSPContext bbdsp; IDCTDSPContext idsp; GetBitContext gb; - ScanTable scantable; + uint8_t permutated_scantable[64]; int version; int qscale; int last_dc[3]; @@ -63,8 +63,7 @@ { int level, diff, i, j, run; int component; - RLTable *rl = &ff_rl_mpeg1; - uint8_t * const scantable = a->scantable.permutated; + const uint8_t *const scantable = a->permutated_scantable; const uint16_t *quant_matrix = a->quant_matrix; const int qscale = a->qscale; @@ -84,7 +83,7 @@ /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &a->gb); - GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &a->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; @@ -219,12 +218,12 @@ a->avctx = avctx; - ff_blockdsp_init(&a->bdsp, avctx); + ff_blockdsp_init(&a->bdsp); ff_bswapdsp_init(&a->bbdsp); ff_idctdsp_init(&a->idsp, avctx); ff_mpeg12_init_vlcs(); - ff_init_scantable(a->idsp.idct_permutation, &a->scantable, - ff_zigzag_direct); + ff_permute_scantable(a->permutated_scantable, ff_zigzag_direct, + a->idsp.idct_permutation); avctx->pix_fmt = AV_PIX_FMT_YUVJ420P; avctx->color_range = AVCOL_RANGE_JPEG; @@ -251,7 +250,7 @@ const FFCodec ff_mdec_decoder = { .p.name = "mdec", - .p.long_name = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"), + CODEC_LONG_NAME("Sony PlayStation MDEC (Motion DECoder)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MDEC, .priv_data_size = sizeof(MDECContext), @@ -259,5 +258,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.c 2023-03-03 13:29:59.000000000 +0000 @@ -67,7 +67,7 @@ 57600, 58081, 58564, 59049, 59536, 60025, 60516, 61009, 61504, 62001, 62500, 63001, 63504, 64009, 64516, 65025, }; -static int sse4_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sse4_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -84,7 +84,7 @@ return s; } -static int sse8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sse8_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -105,7 +105,7 @@ return s; } -static int sse16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sse16_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -135,7 +135,7 @@ return s; } -static int sum_abs_dctelem_c(int16_t *block) +static int sum_abs_dctelem_c(const int16_t *block) { int sum = 0, i; @@ -147,7 +147,7 @@ #define avg2(a, b) (((a) + (b) + 1) >> 1) #define avg4(a, b, c, d) (((a) + (b) + (c) + (d) + 2) >> 2) -static inline int pix_abs16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_abs16_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -175,7 +175,7 @@ return s; } -static inline int pix_median_abs16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_median_abs16_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i, j; @@ -214,7 +214,7 @@ return s; } -static int pix_abs16_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_x2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -242,11 +242,11 @@ return s; } -static int pix_abs16_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_y2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; for (i = 0; i < h; i++) { s += abs(pix1[0] - avg2(pix2[0], pix3[0])); @@ -272,11 +272,11 @@ return s; } -static int pix_abs16_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_xy2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; for (i = 0; i < h; i++) { s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1])); @@ -302,7 +302,7 @@ return s; } -static inline int pix_abs8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_abs8_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -322,7 +322,7 @@ return s; } -static inline int pix_median_abs8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_median_abs8_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i, j; @@ -353,7 +353,7 @@ return s; } -static int pix_abs8_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_x2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; @@ -373,11 +373,11 @@ return s; } -static int pix_abs8_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_y2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; for (i = 0; i < h; i++) { s += abs(pix1[0] - avg2(pix2[0], pix3[0])); @@ -395,11 +395,11 @@ return s; } -static int pix_abs8_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_xy2_c(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int s = 0, i; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; for (i = 0; i < h; i++) { s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1])); @@ -417,7 +417,7 @@ return s; } -static int nsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, +static int nsse16_c(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride, int h) { int score1 = 0, score2 = 0, x, y; @@ -442,7 +442,7 @@ return score1 + FFABS(score2) * 8; } -static int nsse8_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, +static int nsse8_c(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride, int h) { int score1 = 0, score2 = 0, x, y; @@ -467,7 +467,7 @@ return score1 + FFABS(score2) * 8; } -static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b, +static int zero_cmp(MpegEncContext *s, const uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h) { return 0; @@ -553,13 +553,11 @@ #define BUTTERFLYA(x, y) (FFABS((x) + (y)) + FFABS((x) - (y))) -static int hadamard8_diff8x8_c(MpegEncContext *s, uint8_t *dst, - uint8_t *src, ptrdiff_t stride, int h) +static int hadamard8_diff8x8_c(MpegEncContext *s, const uint8_t *dst, + const uint8_t *src, ptrdiff_t stride, int h) { int i, temp[64], sum = 0; - av_assert2(h == 8); - for (i = 0; i < 8; i++) { // FIXME: try pointer walks BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1], @@ -605,13 +603,11 @@ return sum; } -static int hadamard8_intra8x8_c(MpegEncContext *s, uint8_t *src, - uint8_t *dummy, ptrdiff_t stride, int h) +static int hadamard8_intra8x8_c(MpegEncContext *s, const uint8_t *src, + const uint8_t *dummy, ptrdiff_t stride, int h) { int i, temp[64], sum = 0; - av_assert2(h == 8); - for (i = 0; i < 8; i++) { // FIXME: try pointer walks BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1], @@ -657,13 +653,11 @@ return sum; } -static int dct_sad8x8_c(MpegEncContext *s, uint8_t *src1, - uint8_t *src2, ptrdiff_t stride, int h) +static int dct_sad8x8_c(MpegEncContext *s, const uint8_t *src1, + const uint8_t *src2, ptrdiff_t stride, int h) { LOCAL_ALIGNED_16(int16_t, temp, [64]); - av_assert2(h == 8); - s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride); s->fdsp.fdct(temp); return s->mecc.sum_abs_dctelem(temp); @@ -698,8 +692,8 @@ DST(7, (a4 >> 2) - a7); \ } -static int dct264_sad8x8_c(MpegEncContext *s, uint8_t *src1, - uint8_t *src2, ptrdiff_t stride, int h) +static int dct264_sad8x8_c(MpegEncContext *s, const uint8_t *src1, + const uint8_t *src2, ptrdiff_t stride, int h) { int16_t dct[8][8]; int i, sum = 0; @@ -723,14 +717,12 @@ } #endif -static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1, - uint8_t *src2, ptrdiff_t stride, int h) +static int dct_max8x8_c(MpegEncContext *s, const uint8_t *src1, + const uint8_t *src2, ptrdiff_t stride, int h) { LOCAL_ALIGNED_16(int16_t, temp, [64]); int sum = 0, i; - av_assert2(h == 8); - s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride); s->fdsp.fdct(temp); @@ -740,14 +732,13 @@ return sum; } -static int quant_psnr8x8_c(MpegEncContext *s, uint8_t *src1, - uint8_t *src2, ptrdiff_t stride, int h) +static int quant_psnr8x8_c(MpegEncContext *s, const uint8_t *src1, + const uint8_t *src2, ptrdiff_t stride, int h) { LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]); int16_t *const bak = temp + 64; int sum = 0, i; - av_assert2(h == 8); s->mb_intra = 0; s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride); @@ -765,7 +756,7 @@ return sum; } -static int rd8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, +static int rd8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, ptrdiff_t stride, int h) { const uint8_t *scantable = s->intra_scantable.permutated; @@ -776,8 +767,6 @@ const int esc_length = s->ac_esc_length; uint8_t *length, *last_length; - av_assert2(h == 8); - copy_block8(lsrc1, src1, 8, stride, 8); copy_block8(lsrc2, src2, 8, stride, 8); @@ -842,7 +831,7 @@ return distortion + ((bits * s->qscale * s->qscale * 109 + 64) >> 7); } -static int bit8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, +static int bit8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, ptrdiff_t stride, int h) { const uint8_t *scantable = s->intra_scantable.permutated; @@ -851,8 +840,6 @@ const int esc_length = s->ac_esc_length; uint8_t *length, *last_length; - av_assert2(h == 8); - s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride); s->block_last_index[0 /* FIXME */] = @@ -905,7 +892,7 @@ #define VSAD_INTRA(size) \ static int vsad_intra ## size ## _c(MpegEncContext *c, \ - uint8_t *s, uint8_t *dummy, \ + const uint8_t *s, const uint8_t *dummy, \ ptrdiff_t stride, int h) \ { \ int score = 0, x, y; \ @@ -927,7 +914,7 @@ #define VSAD(size) \ static int vsad ## size ## _c(MpegEncContext *c, \ - uint8_t *s1, uint8_t *s2, \ + const uint8_t *s1, const uint8_t *s2, \ ptrdiff_t stride, int h) \ { \ int score = 0, x, y; \ @@ -947,7 +934,7 @@ #define SQ(a) ((a) * (a)) #define VSSE_INTRA(size) \ static int vsse_intra ## size ## _c(MpegEncContext *c, \ - uint8_t *s, uint8_t *dummy, \ + const uint8_t *s, const uint8_t *dummy, \ ptrdiff_t stride, int h) \ { \ int score = 0, x, y; \ @@ -968,7 +955,7 @@ VSSE_INTRA(16) #define VSSE(size) \ -static int vsse ## size ## _c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, \ +static int vsse ## size ## _c(MpegEncContext *c, const uint8_t *s1, const uint8_t *s2, \ ptrdiff_t stride, int h) \ { \ int score = 0, x, y; \ @@ -986,7 +973,7 @@ VSSE(16) #define WRAPPER8_16_SQ(name8, name16) \ -static int name16(MpegEncContext *s, uint8_t *dst, uint8_t *src, \ +static int name16(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, \ ptrdiff_t stride, int h) \ { \ int score = 0; \ @@ -1061,6 +1048,9 @@ ff_dsputil_init_dwt(c); #endif + c->median_sad[0] = pix_median_abs16_c; + c->median_sad[1] = pix_median_abs8_c; + #if ARCH_AARCH64 ff_me_cmp_init_aarch64(c, avctx); #elif ARCH_ALPHA @@ -1075,6 +1065,4 @@ ff_me_cmp_init_mips(c, avctx); #endif - c->median_sad[0] = pix_median_abs16_c; - c->median_sad[1] = pix_median_abs8_c; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/me_cmp.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,9 +21,11 @@ #include +#include "libavutil/attributes_internal.h" + #include "avcodec.h" -extern const uint32_t ff_square_tab[512]; +extern const uint32_t attribute_visibility_hidden ff_square_tab[512]; /* minimum alignment rules ;) @@ -46,12 +48,12 @@ * Although currently h < 4 is not used as functions with * width < 8 are neither used nor implemented. */ typedef int (*me_cmp_func)(struct MpegEncContext *c, - uint8_t *blk1 /* align width (8 or 16) */, - uint8_t *blk2 /* align 1 */, ptrdiff_t stride, + const uint8_t *blk1 /* align width (8 or 16) */, + const uint8_t *blk2 /* align 1 */, ptrdiff_t stride, int h); typedef struct MECmpContext { - int (*sum_abs_dctelem)(int16_t *block /* align 16 */); + int (*sum_abs_dctelem)(const int16_t *block /* align 16 */); me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */ me_cmp_func sse[6]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/media100_to_mjpegb_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/media100_to_mjpegb_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/media100_to_mjpegb_bsf.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/media100_to_mjpegb_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * Media 100 to MJPEGB bitstream filter + * 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 + */ + +/** + * @file + * Media 100 to MJPEGB bitstream filter. + */ + +#include "libavutil/intreadwrite.h" +#include "bsf.h" +#include "bsf_internal.h" +#include "bytestream.h" + +static av_cold int init(AVBSFContext *ctx) +{ + ctx->par_out->codec_id = AV_CODEC_ID_MJPEGB; + return 0; +} + +static int filter(AVBSFContext *ctx, AVPacket *out) +{ + unsigned second_field_offset = 0; + unsigned next_field = 0; + unsigned dht_offset[2]; + unsigned dqt_offset[2]; + unsigned sod_offset[2]; + unsigned sof_offset[2]; + unsigned sos_offset[2]; + unsigned field = 0; + GetByteContext gb; + PutByteContext pb; + AVPacket *in; + int ret; + + ret = ff_bsf_get_packet(ctx, &in); + if (ret < 0) + return ret; + + ret = av_new_packet(out, in->size + 1024); + if (ret < 0) + goto fail; + + bytestream2_init(&gb, in->data, in->size); + bytestream2_init_writer(&pb, out->data, out->size); + +second_field: + bytestream2_put_be32(&pb, 0); + bytestream2_put_be32(&pb, AV_RB32("mjpg")); + bytestream2_put_be32(&pb, 0); + bytestream2_put_be32(&pb, 0); + for (int i = 0; i < 6; i++) + bytestream2_put_be32(&pb, 0); + + sof_offset[field] = bytestream2_tell_p(&pb); + bytestream2_put_be16(&pb, 17); + bytestream2_put_byte(&pb, 8); + bytestream2_put_be16(&pb, ctx->par_in->height / 2); + bytestream2_put_be16(&pb, ctx->par_in->width); + bytestream2_put_byte(&pb, 3); + bytestream2_put_byte(&pb, 1); + bytestream2_put_byte(&pb, 0x21); + bytestream2_put_byte(&pb, 0); + bytestream2_put_byte(&pb, 2); + bytestream2_put_byte(&pb, 0x11); + bytestream2_put_byte(&pb, 1); + bytestream2_put_byte(&pb, 3); + bytestream2_put_byte(&pb, 0x11); + bytestream2_put_byte(&pb, 1); + + sos_offset[field] = bytestream2_tell_p(&pb); + bytestream2_put_be16(&pb, 12); + bytestream2_put_byte(&pb, 3); + bytestream2_put_byte(&pb, 1); + bytestream2_put_byte(&pb, 0); + bytestream2_put_byte(&pb, 2); + bytestream2_put_byte(&pb, 0x11); + bytestream2_put_byte(&pb, 3); + bytestream2_put_byte(&pb, 0x11); + bytestream2_put_byte(&pb, 0); + bytestream2_put_byte(&pb, 0); + bytestream2_put_byte(&pb, 0); + + dqt_offset[field] = bytestream2_tell_p(&pb); + bytestream2_put_be16(&pb, 132); + bytestream2_put_byte(&pb, 0); + bytestream2_skip(&gb, 4); + for (int i = 0; i < 64; i++) + bytestream2_put_byte(&pb, bytestream2_get_be32(&gb)); + bytestream2_put_byte(&pb, 1); + for (int i = 0; i < 64; i++) + bytestream2_put_byte(&pb, bytestream2_get_be32(&gb)); + + dht_offset[field] = 0; + sod_offset[field] = bytestream2_tell_p(&pb); + + for (int i = bytestream2_tell(&gb) + 8; next_field == 0 && i < in->size - 4; i++) { + if (AV_RB32(in->data + i) == 0x00000001) { + next_field = i; + break; + } + } + + bytestream2_skip(&gb, 8); + bytestream2_copy_buffer(&pb, &gb, next_field - bytestream2_tell(&gb)); + bytestream2_put_be64(&pb, 0); + + if (field == 0) { + field = 1; + second_field_offset = bytestream2_tell_p(&pb); + next_field = in->size; + goto second_field; + } + + AV_WB32(out->data + 8, second_field_offset); + AV_WB32(out->data + 12, second_field_offset); + AV_WB32(out->data + 16, second_field_offset); + AV_WB32(out->data + 20, dqt_offset[0]); + AV_WB32(out->data + 24, dht_offset[0]); + AV_WB32(out->data + 28, sof_offset[0]); + AV_WB32(out->data + 32, sos_offset[0]); + AV_WB32(out->data + 36, sod_offset[0]); + + AV_WB32(out->data + second_field_offset + 8, bytestream2_tell_p(&pb) - second_field_offset); + AV_WB32(out->data + second_field_offset + 12, bytestream2_tell_p(&pb) - second_field_offset); + AV_WB32(out->data + second_field_offset + 16, 0); + AV_WB32(out->data + second_field_offset + 20, dqt_offset[1] - second_field_offset); + AV_WB32(out->data + second_field_offset + 24, dht_offset[1]); + AV_WB32(out->data + second_field_offset + 28, sof_offset[1] - second_field_offset); + AV_WB32(out->data + second_field_offset + 32, sos_offset[1] - second_field_offset); + AV_WB32(out->data + second_field_offset + 36, sod_offset[1] - second_field_offset); + + out->size = bytestream2_tell_p(&pb); + + ret = av_packet_copy_props(out, in); + if (ret < 0) + goto fail; + +fail: + if (ret < 0) + av_packet_unref(out); + av_packet_free(&in); + return ret; +} + +const FFBitStreamFilter ff_media100_to_mjpegb_bsf = { + .p.name = "media100_to_mjpegb", + .p.codec_ids = (const enum AVCodecID []){ AV_CODEC_ID_MEDIA100, AV_CODEC_ID_NONE }, + .init = init, + .filter = filter, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,6 +40,7 @@ #include "hevc_parse.h" #include "hwconfig.h" #include "internal.h" +#include "jni.h" #include "mediacodec_wrapper.h" #include "mediacodecdec_common.h" @@ -54,6 +55,7 @@ int delay_flush; int amlogic_mpeg2_api23_workaround; + int use_ndk_codec; } MediaCodecH264DecContext; static av_cold int mediacodec_decode_close(AVCodecContext *avctx) @@ -287,7 +289,8 @@ #if CONFIG_MPEG2_MEDIACODEC_DECODER || \ CONFIG_MPEG4_MEDIACODEC_DECODER || \ CONFIG_VP8_MEDIACODEC_DECODER || \ - CONFIG_VP9_MEDIACODEC_DECODER + CONFIG_VP9_MEDIACODEC_DECODER || \ + CONFIG_AV1_MEDIACODEC_DECODER static int common_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) { int ret = 0; @@ -310,7 +313,10 @@ FFAMediaFormat *format = NULL; MediaCodecH264DecContext *s = avctx->priv_data; - format = ff_AMediaFormat_new(); + if (s->use_ndk_codec < 0) + s->use_ndk_codec = !av_jni_get_java_vm(avctx); + + format = ff_AMediaFormat_new(s->use_ndk_codec); if (!format) { av_log(avctx, AV_LOG_ERROR, "Failed to create media format\n"); ret = AVERROR_EXTERNAL; @@ -318,6 +324,15 @@ } switch (avctx->codec_id) { +#if CONFIG_AV1_MEDIACODEC_DECODER + case AV_CODEC_ID_AV1: + codec_mime = "video/av01"; + + ret = common_set_extradata(avctx, format); + if (ret < 0) + goto done; + break; +#endif #if CONFIG_H264_MEDIACODEC_DECODER case AV_CODEC_ID_H264: codec_mime = "video/avc"; @@ -388,6 +403,7 @@ } s->ctx->delay_flush = s->delay_flush; + s->ctx->use_ndk_codec = s->use_ndk_codec; if ((ret = ff_mediacodec_dec_init(avctx, s->ctx, codec_mime, format)) < 0) { s->ctx = NULL; @@ -399,7 +415,13 @@ s->ctx->codec_name, ret); sdk_int = ff_Build_SDK_INT(avctx); - if (sdk_int <= 23 && + /* ff_Build_SDK_INT can fail when target API < 24 and JVM isn't available. + * If we don't check sdk_int > 0, the workaround might be enabled by + * mistake. + * JVM is required to make the workaround works reliably. On the other hand, + * missing a workaround should not be a serious issue, we do as best we can. + */ + if (sdk_int > 0 && sdk_int <= 23 && strcmp(s->ctx->codec_name, "OMX.amlogic.mpeg2.decoder.awesome") == 0) { av_log(avctx, AV_LOG_INFO, "Enabling workaround for %s on API=%d\n", s->ctx->codec_name, sdk_int); @@ -444,7 +466,16 @@ index = ff_AMediaCodec_dequeueInputBuffer(s->ctx->codec, 0); if (index < 0) { /* no space, block for an output frame to appear */ - return ff_mediacodec_dec_receive(avctx, s->ctx, frame, true); + ret = ff_mediacodec_dec_receive(avctx, s->ctx, frame, true); + /* Try again if both input port and output port return EAGAIN. + * If no data is consumed and no frame in output, it can make + * both avcodec_send_packet() and avcodec_receive_frame() + * return EAGAIN, which violate the design. + */ + if (ff_AMediaCodec_infoTryAgainLater(s->ctx->codec, index) && + ret == AVERROR(EAGAIN)) + continue; + return ret; } s->ctx->current_input_buffer = index; } @@ -519,6 +550,8 @@ static const AVOption ff_mediacodec_vdec_options[] = { { "delay_flush", "Delay flush until hw output buffers are returned to the decoder", OFFSET(delay_flush), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, VD }, + { "ndk_codec", "Use MediaCodec from NDK", + OFFSET(use_ndk_codec), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VD }, { NULL } }; @@ -534,7 +567,7 @@ DECLARE_MEDIACODEC_VCLASS(short_name) \ const FFCodec ff_ ## short_name ## _mediacodec_decoder = { \ .p.name = #short_name "_mediacodec", \ - .p.long_name = NULL_IF_CONFIG_SMALL(full_name " Android MediaCodec decoder"), \ + CODEC_LONG_NAME(full_name " Android MediaCodec decoder"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = codec_id, \ .p.priv_class = &ff_##short_name##_mediacodec_dec_class, \ @@ -544,7 +577,8 @@ .flush = mediacodec_decode_flush, \ .close = mediacodec_decode_close, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ - .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_SETS_PKT_DTS, \ .bsfs = bsf, \ .hw_configs = mediacodec_hw_configs, \ .p.wrapper_name = "mediacodec", \ @@ -573,3 +607,7 @@ #if CONFIG_VP9_MEDIACODEC_DECODER DECLARE_MEDIACODEC_VDEC(vp9, "VP9", AV_CODEC_ID_VP9, NULL) #endif + +#if CONFIG_AV1_MEDIACODEC_DECODER +DECLARE_MEDIACODEC_VDEC(av1, "AV1", AV_CODEC_ID_AV1, NULL) +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "libavutil/timestamp.h" #include "avcodec.h" -#include "internal.h" +#include "decode.h" #include "mediacodec.h" #include "mediacodec_surface.h" @@ -265,8 +265,7 @@ ff_AMediaCodec_releaseOutputBuffer(ctx->codec, buffer->index, 0); } - if (ctx->delay_flush) - ff_mediacodec_dec_unref(ctx); + ff_mediacodec_dec_unref(ctx); av_freep(&buffer); } @@ -321,8 +320,7 @@ buffer->ctx = s; buffer->serial = atomic_load(&s->serial); - if (s->delay_flush) - ff_mediacodec_dec_ref(s); + ff_mediacodec_dec_ref(s); buffer->index = index; buffer->pts = info->presentationTimeUs; @@ -336,8 +334,7 @@ return 0; fail: - av_freep(buffer); - av_buffer_unref(&frame->buf[0]); + av_freep(&buffer); status = ff_AMediaCodec_releaseOutputBuffer(s->codec, index, 0); if (status < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to release output buffer\n"); @@ -489,8 +486,24 @@ AMEDIAFORMAT_GET_INT32(s->crop_left, "crop-left", 0); AMEDIAFORMAT_GET_INT32(s->crop_right, "crop-right", 0); - width = s->crop_right + 1 - s->crop_left; - height = s->crop_bottom + 1 - s->crop_top; + // Try "crop" for NDK + if (!(s->crop_right && s->crop_bottom) && s->use_ndk_codec) + ff_AMediaFormat_getRect(s->format, "crop", &s->crop_left, &s->crop_top, &s->crop_right, &s->crop_bottom); + + if (s->crop_right && s->crop_bottom) { + width = s->crop_right + 1 - s->crop_left; + height = s->crop_bottom + 1 - s->crop_top; + } else { + /* TODO: NDK MediaFormat should try getRect() first. + * Try crop-width/crop-height, it works on NVIDIA Shield. + */ + AMEDIAFORMAT_GET_INT32(width, "crop-width", 0); + AMEDIAFORMAT_GET_INT32(height, "crop-height", 0); + } + if (!width || !height) { + width = s->width; + height = s->height; + } AMEDIAFORMAT_GET_INT32(s->display_width, "display-width", 0); AMEDIAFORMAT_GET_INT32(s->display_height, "display-height", 0); @@ -580,14 +593,14 @@ if (device_ctx->type == AV_HWDEVICE_TYPE_MEDIACODEC) { if (device_ctx->hwctx) { AVMediaCodecDeviceContext *mediacodec_ctx = (AVMediaCodecDeviceContext *)device_ctx->hwctx; - s->surface = ff_mediacodec_surface_ref(mediacodec_ctx->surface, avctx); + s->surface = ff_mediacodec_surface_ref(mediacodec_ctx->surface, mediacodec_ctx->native_window, avctx); av_log(avctx, AV_LOG_INFO, "Using surface %p\n", s->surface); } } } if (!s->surface && user_ctx && user_ctx->surface) { - s->surface = ff_mediacodec_surface_ref(user_ctx->surface, avctx); + s->surface = ff_mediacodec_surface_ref(user_ctx->surface, NULL, avctx); av_log(avctx, AV_LOG_INFO, "Using surface %p\n", s->surface); } } @@ -599,12 +612,27 @@ s->codec_name = ff_AMediaCodecList_getCodecNameByType(mime, profile, 0, avctx); if (!s->codec_name) { - ret = AVERROR_EXTERNAL; - goto fail; + // getCodecNameByType() can fail due to missing JVM, while NDK + // mediacodec can be used without JVM. + if (!s->use_ndk_codec) { + ret = AVERROR_EXTERNAL; + goto fail; + } + av_log(avctx, AV_LOG_INFO, "Failed to getCodecNameByType\n"); + } else { + av_log(avctx, AV_LOG_DEBUG, "Found decoder %s\n", s->codec_name); } - av_log(avctx, AV_LOG_DEBUG, "Found decoder %s\n", s->codec_name); - s->codec = ff_AMediaCodec_createCodecByName(s->codec_name); + if (s->codec_name) + s->codec = ff_AMediaCodec_createCodecByName(s->codec_name, s->use_ndk_codec); + else { + s->codec = ff_AMediaCodec_createDecoderByType(mime, s->use_ndk_codec); + if (s->codec) { + s->codec_name = ff_AMediaCodec_getName(s->codec); + if (!s->codec_name) + s->codec_name = av_strdup(mime); + } + } if (!s->codec) { av_log(avctx, AV_LOG_ERROR, "Failed to create media decoder for type %s and name %s\n", mime, s->codec_name); ret = AVERROR_EXTERNAL; @@ -872,7 +900,7 @@ */ int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s) { - if (!s->surface || atomic_load(&s->refcount) == 1) { + if (!s->surface || !s->delay_flush || atomic_load(&s->refcount) == 1) { int ret; /* No frames (holding a reference to the codec) are retained by the diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecdec_common.h 2023-03-03 13:29:59.000000000 +0000 @@ -70,6 +70,7 @@ bool delay_flush; atomic_int serial; + bool use_ndk_codec; } MediaCodecDecContext; int ff_mediacodec_dec_init(AVCodecContext *avctx, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecenc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodecenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,756 @@ +/* + * Android MediaCodec encoders + * + * Copyright (c) 2022 Zhao Zhili + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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_components.h" + +#include "libavutil/avassert.h" +#include "libavutil/hwcontext_mediacodec.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" + +#include "avcodec.h" +#include "bsf.h" +#include "codec_internal.h" +#include "encode.h" +#include "hwconfig.h" +#include "jni.h" +#include "mediacodec.h" +#include "mediacodec_wrapper.h" +#include "mediacodecdec_common.h" + +#define INPUT_DEQUEUE_TIMEOUT_US 8000 +#define OUTPUT_DEQUEUE_TIMEOUT_US 8000 + +enum BitrateMode { + /* Constant quality mode */ + BITRATE_MODE_CQ = 0, + /* Variable bitrate mode */ + BITRATE_MODE_VBR = 1, + /* Constant bitrate mode */ + BITRATE_MODE_CBR = 2, + /* Constant bitrate mode with frame drops */ + BITRATE_MODE_CBR_FD = 3, +}; + +typedef struct MediaCodecEncContext { + AVClass *avclass; + FFAMediaCodec *codec; + int use_ndk_codec; + const char *name; + FFANativeWindow *window; + + int fps; + int width; + int height; + + uint8_t *extradata; + int extradata_size; + int eof_sent; + + AVFrame *frame; + AVBSFContext *bsf; + + int bitrate_mode; + int level; + int pts_as_dts; +} MediaCodecEncContext; + +enum { + COLOR_FormatYUV420Planar = 0x13, + COLOR_FormatYUV420SemiPlanar = 0x15, + COLOR_FormatSurface = 0x7F000789, +}; + +static const struct { + int color_format; + enum AVPixelFormat pix_fmt; +} color_formats[] = { + { COLOR_FormatYUV420Planar, AV_PIX_FMT_YUV420P }, + { COLOR_FormatYUV420SemiPlanar, AV_PIX_FMT_NV12 }, + { COLOR_FormatSurface, AV_PIX_FMT_MEDIACODEC }, +}; + +static const enum AVPixelFormat avc_pix_fmts[] = { + AV_PIX_FMT_MEDIACODEC, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NV12, + AV_PIX_FMT_NONE +}; + +static void mediacodec_output_format(AVCodecContext *avctx) +{ + MediaCodecEncContext *s = avctx->priv_data; + char *name = ff_AMediaCodec_getName(s->codec); + FFAMediaFormat *out_format = ff_AMediaCodec_getOutputFormat(s->codec); + char *str = ff_AMediaFormat_toString(out_format); + + av_log(avctx, AV_LOG_DEBUG, "MediaCodec encoder %s output format %s\n", + name ? name : "unknown", str); + av_free(name); + av_free(str); + ff_AMediaFormat_delete(out_format); +} + +static int mediacodec_init_bsf(AVCodecContext *avctx) +{ + MediaCodecEncContext *s = avctx->priv_data; + char str[128]; + int ret; + int crop_right = s->width - avctx->width; + int crop_bottom = s->height - avctx->height; + + if (!crop_right && !crop_bottom) + return 0; + + if (avctx->codec_id == AV_CODEC_ID_H264) + ret = snprintf(str, sizeof(str), "h264_metadata=crop_right=%d:crop_bottom=%d", + crop_right, crop_bottom); + else if (avctx->codec_id == AV_CODEC_ID_HEVC) + ret = snprintf(str, sizeof(str), "hevc_metadata=crop_right=%d:crop_bottom=%d", + crop_right, crop_bottom); + else + return 0; + + if (ret >= sizeof(str)) + return AVERROR_BUFFER_TOO_SMALL; + + ret = av_bsf_list_parse_str(str, &s->bsf); + if (ret < 0) + return ret; + + ret = avcodec_parameters_from_context(s->bsf->par_in, avctx); + if (ret < 0) + return ret; + s->bsf->time_base_in = avctx->time_base; + ret = av_bsf_init(s->bsf); + + return ret; +} + +static av_cold int mediacodec_init(AVCodecContext *avctx) +{ + const char *codec_mime = NULL; + MediaCodecEncContext *s = avctx->priv_data; + FFAMediaFormat *format = NULL; + int ret; + int gop; + + if (s->use_ndk_codec < 0) + s->use_ndk_codec = !av_jni_get_java_vm(avctx); + + switch (avctx->codec_id) { + case AV_CODEC_ID_H264: + codec_mime = "video/avc"; + break; + case AV_CODEC_ID_HEVC: + codec_mime = "video/hevc"; + break; + default: + av_assert0(0); + } + + if (s->name) + s->codec = ff_AMediaCodec_createCodecByName(s->name, s->use_ndk_codec); + else + s->codec = ff_AMediaCodec_createEncoderByType(codec_mime, s->use_ndk_codec); + if (!s->codec) { + av_log(avctx, AV_LOG_ERROR, "Failed to create encoder for type %s\n", + codec_mime); + return AVERROR_EXTERNAL; + } + + format = ff_AMediaFormat_new(s->use_ndk_codec); + if (!format) { + av_log(avctx, AV_LOG_ERROR, "Failed to create media format\n"); + return AVERROR_EXTERNAL; + } + + ff_AMediaFormat_setString(format, "mime", codec_mime); + // Workaround the alignment requirement of mediacodec. We can't do it + // silently for AV_PIX_FMT_MEDIACODEC. + if (avctx->pix_fmt != AV_PIX_FMT_MEDIACODEC) { + s->width = FFALIGN(avctx->width, 16); + s->height = FFALIGN(avctx->height, 16); + } else { + s->width = avctx->width; + s->height = avctx->height; + if (s->width % 16 || s->height % 16) + av_log(avctx, AV_LOG_WARNING, + "Video size %dx%d isn't align to 16, it may have device compatibility issue\n", + s->width, s->height); + } + ff_AMediaFormat_setInt32(format, "width", s->width); + ff_AMediaFormat_setInt32(format, "height", s->height); + + if (avctx->pix_fmt == AV_PIX_FMT_MEDIACODEC) { + AVMediaCodecContext *user_ctx = avctx->hwaccel_context; + if (avctx->hw_device_ctx) { + AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)(avctx->hw_device_ctx->data); + AVMediaCodecDeviceContext *dev_ctx; + + if (device_ctx->type != AV_HWDEVICE_TYPE_MEDIACODEC || !device_ctx->hwctx) { + ret = AVERROR(EINVAL); + goto bailout; + } + dev_ctx = device_ctx->hwctx; + s->window = ff_mediacodec_surface_ref(dev_ctx->surface, dev_ctx->native_window, avctx); + } + + if (!s->window && user_ctx && user_ctx->surface) + s->window = ff_mediacodec_surface_ref(user_ctx->surface, NULL, avctx); + + if (!s->window) { + ret = AVERROR(EINVAL); + av_log(avctx, AV_LOG_ERROR, "Missing hw_device_ctx or hwaccel_context for AV_PIX_FMT_MEDIACODEC\n"); + goto bailout; + } + /* Although there is a method ANativeWindow_toSurface() introduced in + * API level 26, it's easier and safe to always require a Surface for + * Java MediaCodec. + */ + if (!s->use_ndk_codec && !s->window->surface) { + ret = AVERROR(EINVAL); + av_log(avctx, AV_LOG_ERROR, "Missing jobject Surface for AV_PIX_FMT_MEDIACODEC. " + "Please note that Java MediaCodec doesn't work with ANativeWindow.\n"); + goto bailout; + } + } + + for (int i = 0; i < FF_ARRAY_ELEMS(color_formats); i++) { + if (avctx->pix_fmt == color_formats[i].pix_fmt) { + ff_AMediaFormat_setInt32(format, "color-format", + color_formats[i].color_format); + break; + } + } + + if (avctx->bit_rate) + ff_AMediaFormat_setInt32(format, "bitrate", avctx->bit_rate); + if (s->bitrate_mode >= 0) + ff_AMediaFormat_setInt32(format, "bitrate-mode", s->bitrate_mode); + // frame-rate and i-frame-interval are required to configure codec + if (avctx->framerate.num >= avctx->framerate.den && avctx->framerate.den > 0) { + s->fps = avctx->framerate.num / avctx->framerate.den; + } else { + s->fps = 30; + av_log(avctx, AV_LOG_INFO, "Use %d as the default MediaFormat frame-rate\n", s->fps); + } + gop = round(avctx->gop_size / s->fps); + if (gop == 0) { + gop = 1; + av_log(avctx, AV_LOG_INFO, + "Use %d as the default MediaFormat i-frame-interval, " + "please set gop_size properly (>= fps)\n", gop); + } else { + av_log(avctx, AV_LOG_DEBUG, "Set i-frame-interval to %d\n", gop); + } + + ff_AMediaFormat_setInt32(format, "frame-rate", s->fps); + ff_AMediaFormat_setInt32(format, "i-frame-interval", gop); + + ret = ff_AMediaCodecProfile_getProfileFromAVCodecContext(avctx); + if (ret > 0) { + av_log(avctx, AV_LOG_DEBUG, "set profile to 0x%x\n", ret); + ff_AMediaFormat_setInt32(format, "profile", ret); + } + if (s->level > 0) { + av_log(avctx, AV_LOG_DEBUG, "set level to 0x%x\n", s->level); + ff_AMediaFormat_setInt32(format, "level", s->level); + } + if (avctx->max_b_frames > 0) { + if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { + av_log(avctx, AV_LOG_ERROR, + "Enabling B frames will produce packets with no DTS. " + "Use -strict experimental to use it anyway.\n"); + ret = AVERROR(EINVAL); + goto bailout; + } + ff_AMediaFormat_setInt32(format, "max-bframes", avctx->max_b_frames); + } + if (s->pts_as_dts == -1) + s->pts_as_dts = avctx->max_b_frames <= 0; + + ret = ff_AMediaCodec_getConfigureFlagEncode(s->codec); + ret = ff_AMediaCodec_configure(s->codec, format, s->window, NULL, ret); + if (ret) { + av_log(avctx, AV_LOG_ERROR, "MediaCodec configure failed, %s\n", av_err2str(ret)); + goto bailout; + } + + ret = ff_AMediaCodec_start(s->codec); + if (ret) { + av_log(avctx, AV_LOG_ERROR, "MediaCodec failed to start, %s\n", av_err2str(ret)); + goto bailout; + } + + ret = mediacodec_init_bsf(avctx); + if (ret) + goto bailout; + + mediacodec_output_format(avctx); + + s->frame = av_frame_alloc(); + if (!s->frame) + ret = AVERROR(ENOMEM); + +bailout: + if (format) + ff_AMediaFormat_delete(format); + return ret; +} + +static int mediacodec_receive(AVCodecContext *avctx, + AVPacket *pkt, + int *got_packet) +{ + MediaCodecEncContext *s = avctx->priv_data; + FFAMediaCodec *codec = s->codec; + FFAMediaCodecBufferInfo out_info = {0}; + uint8_t *out_buf; + size_t out_size = 0; + int ret; + int extradata_size = 0; + int64_t timeout_us = s->eof_sent ? OUTPUT_DEQUEUE_TIMEOUT_US : 0; + ssize_t index = ff_AMediaCodec_dequeueOutputBuffer(codec, &out_info, timeout_us); + + if (ff_AMediaCodec_infoTryAgainLater(codec, index)) + return AVERROR(EAGAIN); + + if (ff_AMediaCodec_infoOutputFormatChanged(codec, index)) { + mediacodec_output_format(avctx); + return AVERROR(EAGAIN); + } + + if (ff_AMediaCodec_infoOutputBuffersChanged(codec, index)) { + ff_AMediaCodec_cleanOutputBuffers(codec); + return AVERROR(EAGAIN); + } + + if (index < 0) + return AVERROR_EXTERNAL; + + if (out_info.flags & ff_AMediaCodec_getBufferFlagEndOfStream(codec)) + return AVERROR_EOF; + + out_buf = ff_AMediaCodec_getOutputBuffer(codec, index, &out_size); + if (!out_buf) { + ret = AVERROR_EXTERNAL; + goto bailout; + } + + if (out_info.flags & ff_AMediaCodec_getBufferFlagCodecConfig(codec)) { + ret = av_reallocp(&s->extradata, out_info.size); + if (ret) + goto bailout; + + s->extradata_size = out_info.size; + memcpy(s->extradata, out_buf + out_info.offset, out_info.size); + ff_AMediaCodec_releaseOutputBuffer(codec, index, false); + // try immediately + return mediacodec_receive(avctx, pkt, got_packet); + } + + ret = ff_get_encode_buffer(avctx, pkt, out_info.size + s->extradata_size, 0); + if (ret < 0) + goto bailout; + + if (s->extradata_size) { + extradata_size = s->extradata_size; + s->extradata_size = 0; + memcpy(pkt->data, s->extradata, extradata_size); + } + memcpy(pkt->data + extradata_size, out_buf + out_info.offset, out_info.size); + pkt->pts = av_rescale_q(out_info.presentationTimeUs, AV_TIME_BASE_Q, avctx->time_base); + if (s->pts_as_dts) + pkt->dts = pkt->pts; + if (out_info.flags & ff_AMediaCodec_getBufferFlagKeyFrame(codec)) + pkt->flags |= AV_PKT_FLAG_KEY; + ret = 0; + *got_packet = 1; + + av_log(avctx, AV_LOG_TRACE, "receive packet pts %" PRId64 " dts %" PRId64 + " flags %d extradata %d\n", + pkt->pts, pkt->dts, pkt->flags, extradata_size); + +bailout: + ff_AMediaCodec_releaseOutputBuffer(codec, index, false); + return ret; +} + +static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, uint8_t *dst, size_t size) +{ + 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; + dst_data[1] = dst + s->width * s->height; + dst_data[2] = dst_data[1] + s->width * s->height / 4; + + dst_linesize[0] = s->width; + dst_linesize[1] = dst_linesize[2] = s->width / 2; + } else if (avctx->pix_fmt == AV_PIX_FMT_NV12) { + dst_data[0] = dst; + dst_data[1] = dst + s->width * s->height; + + dst_linesize[0] = s->width; + dst_linesize[1] = s->width; + } else { + av_assert0(0); + } + + av_image_copy(dst_data, dst_linesize, src_data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); +} + +static int mediacodec_send(AVCodecContext *avctx, + const AVFrame *frame) { + MediaCodecEncContext *s = avctx->priv_data; + FFAMediaCodec *codec = s->codec; + ssize_t index; + uint8_t *input_buf = NULL; + size_t input_size = 0; + int64_t pts = 0; + uint32_t flags = 0; + int64_t timeout_us; + + if (s->eof_sent) + return 0; + + if (s->window) { + if (!frame) { + s->eof_sent = 1; + return ff_AMediaCodec_signalEndOfInputStream(codec); + } + + if (frame->data[3]) + av_mediacodec_release_buffer((AVMediaCodecBuffer *)frame->data[3], 1); + return 0; + } + + timeout_us = INPUT_DEQUEUE_TIMEOUT_US; + index = ff_AMediaCodec_dequeueInputBuffer(codec, timeout_us); + if (ff_AMediaCodec_infoTryAgainLater(codec, index)) + return AVERROR(EAGAIN); + + if (index < 0) { + av_log(avctx, AV_LOG_ERROR, "dequeue input buffer failed, %zd", index); + return AVERROR_EXTERNAL; + } + + if (frame) { + input_buf = ff_AMediaCodec_getInputBuffer(codec, index, &input_size); + copy_frame_to_buffer(avctx, frame, input_buf, input_size); + + pts = av_rescale_q(frame->pts, avctx->time_base, AV_TIME_BASE_Q); + } else { + flags |= ff_AMediaCodec_getBufferFlagEndOfStream(codec); + s->eof_sent = 1; + } + + ff_AMediaCodec_queueInputBuffer(codec, index, 0, input_size, pts, flags); + return 0; +} + +static int mediacodec_encode(AVCodecContext *avctx, AVPacket *pkt) +{ + MediaCodecEncContext *s = avctx->priv_data; + int ret; + int got_packet = 0; + + // Return on three case: + // 1. Serious error + // 2. Got a packet success + // 3. No AVFrame is available yet (don't return if get_frame return EOF) + while (1) { + if (s->bsf) { + ret = av_bsf_receive_packet(s->bsf, pkt); + if (!ret) + return 0; + if (ret != AVERROR(EAGAIN)) + return ret; + } + + ret = mediacodec_receive(avctx, pkt, &got_packet); + if (s->bsf) { + if (!ret || ret == AVERROR_EOF) + ret = av_bsf_send_packet(s->bsf, pkt); + } else { + if (!ret) + return 0; + } + + if (ret != AVERROR(EAGAIN)) + return ret; + + if (!s->frame->buf[0]) { + ret = ff_encode_get_frame(avctx, s->frame); + if (ret && ret != AVERROR_EOF) + return ret; + } + + ret = mediacodec_send(avctx, s->frame->buf[0] ? s->frame : NULL); + if (!ret) + av_frame_unref(s->frame); + else if (ret != AVERROR(EAGAIN)) + return ret; + } + + return 0; +} + +static av_cold int mediacodec_close(AVCodecContext *avctx) +{ + MediaCodecEncContext *s = avctx->priv_data; + if (s->codec) { + ff_AMediaCodec_stop(s->codec); + ff_AMediaCodec_delete(s->codec); + s->codec = NULL; + } + + if (s->window) { + ff_mediacodec_surface_unref(s->window, avctx); + s->window = NULL; + } + + av_bsf_free(&s->bsf); + av_frame_free(&s->frame); + + return 0; +} + +static const AVCodecHWConfigInternal *const mediacodec_hw_configs[] = { + &(const AVCodecHWConfigInternal) { + .public = { + .pix_fmt = AV_PIX_FMT_MEDIACODEC, + .methods = AV_CODEC_HW_CONFIG_METHOD_AD_HOC | + AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX, + .device_type = AV_HWDEVICE_TYPE_MEDIACODEC, + }, + .hwaccel = NULL, + }, + NULL +}; + +#define OFFSET(x) offsetof(MediaCodecEncContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +#define COMMON_OPTION \ + { "ndk_codec", "Use MediaCodec from NDK", \ + OFFSET(use_ndk_codec), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE }, \ + { "codec_name", "Select codec by name", \ + OFFSET(name), AV_OPT_TYPE_STRING, {0}, 0, 0, VE }, \ + { "bitrate_mode", "Bitrate control method", \ + OFFSET(bitrate_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VE, "bitrate_mode" }, \ + { "cq", "Constant quality mode", \ + 0, AV_OPT_TYPE_CONST, {.i64 = BITRATE_MODE_CQ}, 0, 0, VE, "bitrate_mode" }, \ + { "vbr", "Variable bitrate mode", \ + 0, AV_OPT_TYPE_CONST, {.i64 = BITRATE_MODE_VBR}, 0, 0, VE, "bitrate_mode" }, \ + { "cbr", "Constant bitrate mode", \ + 0, AV_OPT_TYPE_CONST, {.i64 = BITRATE_MODE_CBR}, 0, 0, VE, "bitrate_mode" }, \ + { "cbr_fd", "Constant bitrate mode with frame drops", \ + 0, AV_OPT_TYPE_CONST, {.i64 = BITRATE_MODE_CBR_FD}, 0, 0, VE, "bitrate_mode" }, \ + { "pts_as_dts", "Use PTS as DTS. It is enabled automatically if avctx max_b_frames <= 0, " \ + "since most of Android devices don't output B frames by default.", \ + OFFSET(pts_as_dts), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE }, \ + + +#define MEDIACODEC_ENCODER_CLASS(name) \ +static const AVClass name ## _mediacodec_class = { \ + .class_name = #name "_mediacodec", \ + .item_name = av_default_item_name, \ + .option = name ## _options, \ + .version = LIBAVUTIL_VERSION_INT, \ +}; \ + +#define DECLARE_MEDIACODEC_ENCODER(short_name, long_name, codec_id) \ +MEDIACODEC_ENCODER_CLASS(short_name) \ +const FFCodec ff_ ## short_name ## _mediacodec_encoder = { \ + .p.name = #short_name "_mediacodec", \ + CODEC_LONG_NAME(long_name " Android MediaCodec encoder"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = codec_id, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY \ + | AV_CODEC_CAP_HARDWARE, \ + .priv_data_size = sizeof(MediaCodecEncContext), \ + .p.pix_fmts = avc_pix_fmts, \ + .init = mediacodec_init, \ + FF_CODEC_RECEIVE_PACKET_CB(mediacodec_encode), \ + .close = mediacodec_close, \ + .p.priv_class = &short_name ## _mediacodec_class, \ + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ + .p.wrapper_name = "mediacodec", \ + .hw_configs = mediacodec_hw_configs, \ +}; \ + +#if CONFIG_H264_MEDIACODEC_ENCODER + +enum MediaCodecAvcLevel { + AVCLevel1 = 0x01, + AVCLevel1b = 0x02, + AVCLevel11 = 0x04, + AVCLevel12 = 0x08, + AVCLevel13 = 0x10, + AVCLevel2 = 0x20, + AVCLevel21 = 0x40, + AVCLevel22 = 0x80, + AVCLevel3 = 0x100, + AVCLevel31 = 0x200, + AVCLevel32 = 0x400, + AVCLevel4 = 0x800, + AVCLevel41 = 0x1000, + AVCLevel42 = 0x2000, + AVCLevel5 = 0x4000, + AVCLevel51 = 0x8000, + AVCLevel52 = 0x10000, + AVCLevel6 = 0x20000, + AVCLevel61 = 0x40000, + AVCLevel62 = 0x80000, +}; + +static const AVOption h264_options[] = { + COMMON_OPTION + { "level", "Specify level", + OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, + { "1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel1 }, 0, 0, VE, "level" }, + { "1b", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel1b }, 0, 0, VE, "level" }, + { "1.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel11 }, 0, 0, VE, "level" }, + { "1.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel12 }, 0, 0, VE, "level" }, + { "1.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel13 }, 0, 0, VE, "level" }, + { "2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel2 }, 0, 0, VE, "level" }, + { "2.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel21 }, 0, 0, VE, "level" }, + { "2.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel22 }, 0, 0, VE, "level" }, + { "3", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel3 }, 0, 0, VE, "level" }, + { "3.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel31 }, 0, 0, VE, "level" }, + { "3.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel32 }, 0, 0, VE, "level" }, + { "4", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel4 }, 0, 0, VE, "level" }, + { "4.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel41 }, 0, 0, VE, "level" }, + { "4.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel42 }, 0, 0, VE, "level" }, + { "5", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel5 }, 0, 0, VE, "level" }, + { "5.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel51 }, 0, 0, VE, "level" }, + { "5.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel52 }, 0, 0, VE, "level" }, + { "6.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel6 }, 0, 0, VE, "level" }, + { "6.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel61 }, 0, 0, VE, "level" }, + { "6.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = AVCLevel62 }, 0, 0, VE, "level" }, + { NULL, } +}; + +DECLARE_MEDIACODEC_ENCODER(h264, "H.264", AV_CODEC_ID_H264) + +#endif // CONFIG_H264_MEDIACODEC_ENCODER + +#if CONFIG_HEVC_MEDIACODEC_ENCODER + +enum MediaCodecHevcLevel { + HEVCMainTierLevel1 = 0x1, + HEVCHighTierLevel1 = 0x2, + HEVCMainTierLevel2 = 0x4, + HEVCHighTierLevel2 = 0x8, + HEVCMainTierLevel21 = 0x10, + HEVCHighTierLevel21 = 0x20, + HEVCMainTierLevel3 = 0x40, + HEVCHighTierLevel3 = 0x80, + HEVCMainTierLevel31 = 0x100, + HEVCHighTierLevel31 = 0x200, + HEVCMainTierLevel4 = 0x400, + HEVCHighTierLevel4 = 0x800, + HEVCMainTierLevel41 = 0x1000, + HEVCHighTierLevel41 = 0x2000, + HEVCMainTierLevel5 = 0x4000, + HEVCHighTierLevel5 = 0x8000, + HEVCMainTierLevel51 = 0x10000, + HEVCHighTierLevel51 = 0x20000, + HEVCMainTierLevel52 = 0x40000, + HEVCHighTierLevel52 = 0x80000, + HEVCMainTierLevel6 = 0x100000, + HEVCHighTierLevel6 = 0x200000, + HEVCMainTierLevel61 = 0x400000, + HEVCHighTierLevel61 = 0x800000, + HEVCMainTierLevel62 = 0x1000000, + HEVCHighTierLevel62 = 0x2000000, +}; + +static const AVOption hevc_options[] = { + COMMON_OPTION + { "level", "Specify tier and level", + OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, + { "m1", "Main tier level 1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel1 }, 0, 0, VE, "level" }, + { "h1", "High tier level 1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel1 }, 0, 0, VE, "level" }, + { "m2", "Main tier level 2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel2 }, 0, 0, VE, "level" }, + { "h2", "High tier level 2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel2 }, 0, 0, VE, "level" }, + { "m2.1", "Main tier level 2.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel21 }, 0, 0, VE, "level" }, + { "h2.1", "High tier level 2.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel21 }, 0, 0, VE, "level" }, + { "m3", "Main tier level 3", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel3 }, 0, 0, VE, "level" }, + { "h3", "High tier level 3", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel3 }, 0, 0, VE, "level" }, + { "m3.1", "Main tier level 3.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel31 }, 0, 0, VE, "level" }, + { "h3.1", "High tier level 3.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel31 }, 0, 0, VE, "level" }, + { "m4", "Main tier level 4", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel4 }, 0, 0, VE, "level" }, + { "h4", "High tier level 4", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel4 }, 0, 0, VE, "level" }, + { "m4.1", "Main tier level 4.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel41 }, 0, 0, VE, "level" }, + { "h4.1", "High tier level 4.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel41 }, 0, 0, VE, "level" }, + { "m5", "Main tier level 5", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel5 }, 0, 0, VE, "level" }, + { "h5", "High tier level 5", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel5 }, 0, 0, VE, "level" }, + { "m5.1", "Main tier level 5.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel51 }, 0, 0, VE, "level" }, + { "h5.1", "High tier level 5.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel51 }, 0, 0, VE, "level" }, + { "m5.2", "Main tier level 5.2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel52 }, 0, 0, VE, "level" }, + { "h5.2", "High tier level 5.2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel52 }, 0, 0, VE, "level" }, + { "m6", "Main tier level 6", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel6 }, 0, 0, VE, "level" }, + { "h6", "High tier level 6", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel6 }, 0, 0, VE, "level" }, + { "m6.1", "Main tier level 6.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel61 }, 0, 0, VE, "level" }, + { "h6.1", "High tier level 6.1", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel61 }, 0, 0, VE, "level" }, + { "m6.2", "Main tier level 6.2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCMainTierLevel62 }, 0, 0, VE, "level" }, + { "h6.2", "High tier level 6.2", + 0, AV_OPT_TYPE_CONST, { .i64 = HEVCHighTierLevel62 }, 0, 0, VE, "level" }, + { NULL, } +}; + +DECLARE_MEDIACODEC_ENCODER(hevc, "H.265", AV_CODEC_ID_HEVC) + +#endif // CONFIG_HEVC_MEDIACODEC_ENCODER diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec.h 2023-03-03 13:29:59.000000000 +0000 @@ -88,13 +88,15 @@ /** * Release a MediaCodec buffer and render it at the given time to the surface * that is associated with the decoder. The timestamp must be within one second - * of the current java/lang/System#nanoTime() (which is implemented using - * CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation - * of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details. + * of the current `java/lang/System#nanoTime()` (which is implemented using + * `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation + * of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details. * * @param buffer the buffer to render * @param time timestamp in nanoseconds of when to render the buffer * @return 0 on success, < 0 otherwise + * + * [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long) */ int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,33 +20,59 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include +#include "libavutil/mem.h" #include "ffjni.h" #include "mediacodec_surface.h" -FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *log_ctx) +FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *native_window, void *log_ctx) { - JNIEnv *env = NULL; + FFANativeWindow *ret; - env = ff_jni_get_env(log_ctx); - if (!env) { + ret = av_mallocz(sizeof(*ret)); + if (!ret) return NULL; + + if (surface) { + JNIEnv *env = NULL; + + env = ff_jni_get_env(log_ctx); + if (env) + ret->surface = (*env)->NewGlobalRef(env, surface); + } + + if (native_window) { + ANativeWindow_acquire(native_window); + ret->native_window = native_window; } - return (*env)->NewGlobalRef(env, surface); + if (!ret->surface && !ret->native_window) { + av_log(log_ctx, AV_LOG_ERROR, "Both surface and native_window are NULL\n"); + av_freep(&ret); + } + + return ret; } int ff_mediacodec_surface_unref(FFANativeWindow *window, void *log_ctx) { - JNIEnv *env = NULL; + if (!window) + return 0; - env = ff_jni_get_env(log_ctx); - if (!env) { - return AVERROR_EXTERNAL; + if (window->surface) { + JNIEnv *env = NULL; + + env = ff_jni_get_env(log_ctx); + if (env) + (*env)->DeleteGlobalRef(env, window->surface); } - (*env)->DeleteGlobalRef(env, window); + if (window->native_window) + ANativeWindow_release(window->native_window); + + av_free(window); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_surface.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,10 +25,12 @@ #include "libavcodec/avcodec.h" -struct FFANativeWindow; -typedef struct FFANativeWindow FFANativeWindow; +typedef struct FFANativeWindow { + void *surface; + void *native_window; +} FFANativeWindow; -FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *log_ctx); +FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *native_window, void *log_ctx); int ff_mediacodec_surface_unref(FFANativeWindow *window, void *log_ctx); #endif /* AVCODEC_MEDIACODEC_SURFACE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include +#include +#include +#include +#include #include "libavutil/avassert.h" #include "libavutil/mem.h" @@ -53,19 +58,6 @@ jclass codec_profile_level_class; jfieldID profile_id; jfieldID level_id; - - jfieldID avc_profile_baseline_id; - jfieldID avc_profile_main_id; - jfieldID avc_profile_extended_id; - jfieldID avc_profile_high_id; - jfieldID avc_profile_high10_id; - jfieldID avc_profile_high422_id; - jfieldID avc_profile_high444_id; - - jfieldID hevc_profile_main_id; - jfieldID hevc_profile_main10_id; - jfieldID hevc_profile_main10_hdr10_id; - }; static const struct FFJniField jni_amediacodeclist_mapping[] = { @@ -91,18 +83,6 @@ { "android/media/MediaCodecInfo$CodecProfileLevel", "profile", "I", FF_JNI_FIELD, offsetof(struct JNIAMediaCodecListFields, profile_id), 1 }, { "android/media/MediaCodecInfo$CodecProfileLevel", "level", "I", FF_JNI_FIELD, offsetof(struct JNIAMediaCodecListFields, level_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileBaseline", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_baseline_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileMain", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_main_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileExtended", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_extended_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileHigh", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_high_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileHigh10", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_high10_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileHigh422", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_high422_id), 1 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "AVCProfileHigh444", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, avc_profile_high444_id), 1 }, - - { "android/media/MediaCodecInfo$CodecProfileLevel", "HEVCProfileMain", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, hevc_profile_main_id), 0 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "HEVCProfileMain10", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, hevc_profile_main10_id), 0 }, - { "android/media/MediaCodecInfo$CodecProfileLevel", "HEVCProfileMain10HDR10", "I", FF_JNI_STATIC_FIELD, offsetof(struct JNIAMediaCodecListFields, hevc_profile_main10_hdr10_id), 0 }, - { NULL } }; @@ -160,12 +140,14 @@ .version = LIBAVUTIL_VERSION_INT, }; -struct FFAMediaFormat { +typedef struct FFAMediaFormatJni { + FFAMediaFormat api; - const AVClass *class; struct JNIAMediaFormatFields jfields; jobject object; -}; +} FFAMediaFormatJni; + +static const FFAMediaFormat media_format_jni; struct JNIAMediaCodecFields { @@ -206,6 +188,9 @@ jmethodID release_output_buffer_id; jmethodID release_output_buffer_at_time_id; + jmethodID set_input_surface_id; + jmethodID signal_end_of_input_stream_id; + jclass mediainfo_class; jmethodID init_id; @@ -255,6 +240,9 @@ { "android/media/MediaCodec", "releaseOutputBuffer", "(IZ)V", FF_JNI_METHOD, offsetof(struct JNIAMediaCodecFields, release_output_buffer_id), 1 }, { "android/media/MediaCodec", "releaseOutputBuffer", "(IJ)V", FF_JNI_METHOD, offsetof(struct JNIAMediaCodecFields, release_output_buffer_at_time_id), 0 }, + { "android/media/MediaCodec", "setInputSurface", "(Landroid/view/Surface;)V", FF_JNI_METHOD, offsetof(struct JNIAMediaCodecFields, set_input_surface_id), 0 }, + { "android/media/MediaCodec", "signalEndOfInputStream", "()V", FF_JNI_METHOD, offsetof(struct JNIAMediaCodecFields, signal_end_of_input_stream_id), 0 }, + { "android/media/MediaCodec$BufferInfo", NULL, NULL, FF_JNI_CLASS, offsetof(struct JNIAMediaCodecFields, mediainfo_class), 1 }, { "android/media/MediaCodec.BufferInfo", "", "()V", FF_JNI_METHOD, offsetof(struct JNIAMediaCodecFields, init_id), 1 }, @@ -272,9 +260,8 @@ .version = LIBAVUTIL_VERSION_INT, }; -struct FFAMediaCodec { - - const AVClass *class; +typedef struct FFAMediaCodecJni { + FFAMediaCodec api; struct JNIAMediaCodecFields jfields; @@ -295,7 +282,9 @@ int CONFIGURE_FLAG_ENCODE; int has_get_i_o_buffer; -}; +} FFAMediaCodecJni; + +static const FFAMediaCodec media_codec_jni; #define JNI_GET_ENV_OR_RETURN(env, log_ctx, ret) do { \ (env) = ff_jni_get_env(log_ctx); \ @@ -313,71 +302,64 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) { - int ret = -1; - - JNIEnv *env = NULL; - struct JNIAMediaCodecListFields jfields = { 0 }; - jfieldID field_id = 0; - - JNI_GET_ENV_OR_RETURN(env, avctx, -1); - - if (ff_jni_init_jfields(env, &jfields, jni_amediacodeclist_mapping, 0, avctx) < 0) { - goto done; - } + // Copy and modified from MediaCodecInfo.java + static const int AVCProfileBaseline = 0x01; + static const int AVCProfileMain = 0x02; + static const int AVCProfileExtended = 0x04; + static const int AVCProfileHigh = 0x08; + static const int AVCProfileHigh10 = 0x10; + static const int AVCProfileHigh422 = 0x20; + static const int AVCProfileHigh444 = 0x40; + static const int AVCProfileConstrainedBaseline = 0x10000; + static const int AVCProfileConstrainedHigh = 0x80000; + + static const int HEVCProfileMain = 0x01; + static const int HEVCProfileMain10 = 0x02; + static const int HEVCProfileMainStill = 0x04; + static const int HEVCProfileMain10HDR10 = 0x1000; + static const int HEVCProfileMain10HDR10Plus = 0x2000; + + // Unused yet. + (void)AVCProfileConstrainedHigh; + (void)HEVCProfileMain10HDR10; + (void)HEVCProfileMain10HDR10Plus; if (avctx->codec_id == AV_CODEC_ID_H264) { switch(avctx->profile) { case FF_PROFILE_H264_BASELINE: + return AVCProfileBaseline; case FF_PROFILE_H264_CONSTRAINED_BASELINE: - field_id = jfields.avc_profile_baseline_id; - break; + return AVCProfileConstrainedBaseline; case FF_PROFILE_H264_MAIN: - field_id = jfields.avc_profile_main_id; + return AVCProfileMain; break; case FF_PROFILE_H264_EXTENDED: - field_id = jfields.avc_profile_extended_id; - break; + return AVCProfileExtended; case FF_PROFILE_H264_HIGH: - field_id = jfields.avc_profile_high_id; - break; + return AVCProfileHigh; case FF_PROFILE_H264_HIGH_10: case FF_PROFILE_H264_HIGH_10_INTRA: - field_id = jfields.avc_profile_high10_id; - break; + return AVCProfileHigh10; case FF_PROFILE_H264_HIGH_422: case FF_PROFILE_H264_HIGH_422_INTRA: - field_id = jfields.avc_profile_high422_id; - break; + return AVCProfileHigh422; case FF_PROFILE_H264_HIGH_444: case FF_PROFILE_H264_HIGH_444_INTRA: case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - field_id = jfields.avc_profile_high444_id; - break; + return AVCProfileHigh444; } } else if (avctx->codec_id == AV_CODEC_ID_HEVC) { switch (avctx->profile) { case FF_PROFILE_HEVC_MAIN: + return HEVCProfileMain; case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: - field_id = jfields.hevc_profile_main_id; - break; + return HEVCProfileMainStill; case FF_PROFILE_HEVC_MAIN_10: - field_id = jfields.hevc_profile_main10_id; - break; + return HEVCProfileMain10; } } - if (field_id) { - ret = (*env)->GetStaticIntField(env, jfields.codec_profile_level_class, field_id); - if (ff_jni_exception_check(env, 1, avctx) < 0) { - ret = -1; - goto done; - } - } - -done: - ff_jni_reset_jfields(env, &jfields, jni_amediacodeclist_mapping, 0, avctx); - - return ret; + return -1; } char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int encoder, void *log_ctx) @@ -622,17 +604,17 @@ return name; } -FFAMediaFormat *ff_AMediaFormat_new(void) +static FFAMediaFormat *mediaformat_jni_new(void) { JNIEnv *env = NULL; - FFAMediaFormat *format = NULL; + FFAMediaFormatJni *format = NULL; jobject object = NULL; - format = av_mallocz(sizeof(FFAMediaFormat)); + format = av_mallocz(sizeof(*format)); if (!format) { return NULL; } - format->class = &amediaformat_class; + format->api = media_format_jni; env = ff_jni_get_env(format); if (!env) { @@ -664,19 +646,19 @@ av_freep(&format); } - return format; + return (FFAMediaFormat *)format; } -static FFAMediaFormat *ff_AMediaFormat_newFromObject(void *object) +static FFAMediaFormat *mediaformat_jni_newFromObject(void *object) { JNIEnv *env = NULL; - FFAMediaFormat *format = NULL; + FFAMediaFormatJni *format = NULL; - format = av_mallocz(sizeof(FFAMediaFormat)); + format = av_mallocz(sizeof(*format)); if (!format) { return NULL; } - format->class = &amediaformat_class; + format->api = media_format_jni; env = ff_jni_get_env(format); if (!env) { @@ -693,7 +675,7 @@ goto fail; } - return format; + return (FFAMediaFormat *)format; fail: ff_jni_reset_jfields(env, &format->jfields, jni_amediaformat_mapping, 1, format); @@ -702,10 +684,10 @@ return NULL; } -int ff_AMediaFormat_delete(FFAMediaFormat* format) +static int mediaformat_jni_delete(FFAMediaFormat* ctx) { int ret = 0; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; if (!format) { @@ -724,10 +706,10 @@ return ret; } -char* ff_AMediaFormat_toString(FFAMediaFormat* format) +static char* mediaformat_jni_toString(FFAMediaFormat* ctx) { char *ret = NULL; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring description = NULL; @@ -749,10 +731,10 @@ return ret; } -int ff_AMediaFormat_getInt32(FFAMediaFormat* format, const char *name, int32_t *out) +static int mediaformat_jni_getInt32(FFAMediaFormat* ctx, const char *name, int32_t *out) { int ret = 1; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring key = NULL; jboolean contains_key; @@ -788,10 +770,10 @@ return ret; } -int ff_AMediaFormat_getInt64(FFAMediaFormat* format, const char *name, int64_t *out) +static int mediaformat_jni_getInt64(FFAMediaFormat* ctx, const char *name, int64_t *out) { int ret = 1; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring key = NULL; jboolean contains_key; @@ -827,10 +809,10 @@ return ret; } -int ff_AMediaFormat_getFloat(FFAMediaFormat* format, const char *name, float *out) +static int mediaformat_jni_getFloat(FFAMediaFormat* ctx, const char *name, float *out) { int ret = 1; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring key = NULL; jboolean contains_key; @@ -866,10 +848,10 @@ return ret; } -int ff_AMediaFormat_getBuffer(FFAMediaFormat* format, const char *name, void** data, size_t *size) +static int mediaformat_jni_getBuffer(FFAMediaFormat* ctx, const char *name, void** data, size_t *size) { int ret = 1; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring key = NULL; jboolean contains_key; @@ -924,10 +906,10 @@ return ret; } -int ff_AMediaFormat_getString(FFAMediaFormat* format, const char *name, const char **out) +static int mediaformat_jni_getString(FFAMediaFormat* ctx, const char *name, const char **out) { int ret = 1; - + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; JNIEnv *env = NULL; jstring key = NULL; jboolean contains_key; @@ -974,10 +956,11 @@ return ret; } -void ff_AMediaFormat_setInt32(FFAMediaFormat* format, const char* name, int32_t value) +static void mediaformat_jni_setInt32(FFAMediaFormat* ctx, const char* name, int32_t value) { JNIEnv *env = NULL; jstring key = NULL; + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; av_assert0(format != NULL); @@ -999,10 +982,11 @@ } } -void ff_AMediaFormat_setInt64(FFAMediaFormat* format, const char* name, int64_t value) +static void mediaformat_jni_setInt64(FFAMediaFormat* ctx, const char* name, int64_t value) { JNIEnv *env = NULL; jstring key = NULL; + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; av_assert0(format != NULL); @@ -1024,10 +1008,11 @@ } } -void ff_AMediaFormat_setFloat(FFAMediaFormat* format, const char* name, float value) +static void mediaformat_jni_setFloat(FFAMediaFormat* ctx, const char* name, float value) { JNIEnv *env = NULL; jstring key = NULL; + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; av_assert0(format != NULL); @@ -1049,11 +1034,12 @@ } } -void ff_AMediaFormat_setString(FFAMediaFormat* format, const char* name, const char* value) +static void mediaformat_jni_setString(FFAMediaFormat* ctx, const char* name, const char* value) { JNIEnv *env = NULL; jstring key = NULL; jstring string = NULL; + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; av_assert0(format != NULL); @@ -1084,12 +1070,13 @@ } } -void ff_AMediaFormat_setBuffer(FFAMediaFormat* format, const char* name, void* data, size_t size) +static void mediaformat_jni_setBuffer(FFAMediaFormat* ctx, const char* name, void* data, size_t size) { JNIEnv *env = NULL; jstring key = NULL; jobject buffer = NULL; void *buffer_data = NULL; + FFAMediaFormatJni *format = (FFAMediaFormatJni *)ctx; av_assert0(format != NULL); @@ -1131,7 +1118,7 @@ } } -static int codec_init_static_fields(FFAMediaCodec *codec) +static int codec_init_static_fields(FFAMediaCodecJni *codec) { int ret = 0; JNIEnv *env = NULL; @@ -1193,17 +1180,17 @@ { int ret = -1; JNIEnv *env = NULL; - FFAMediaCodec *codec = NULL; + FFAMediaCodecJni *codec = NULL; jstring jarg = NULL; jobject object = NULL; jobject buffer_info = NULL; jmethodID create_id = NULL; - codec = av_mallocz(sizeof(FFAMediaCodec)); + codec = av_mallocz(sizeof(*codec)); if (!codec) { return NULL; } - codec->class = &amediacodec_class; + codec->api = media_codec_jni; env = ff_jni_get_env(codec); if (!env) { @@ -1286,11 +1273,11 @@ av_freep(&codec); } - return codec; + return (FFAMediaCodec *)codec; } #define DECLARE_FF_AMEDIACODEC_CREATE_FUNC(name, method) \ -FFAMediaCodec *ff_AMediaCodec_##name(const char *arg) \ +static FFAMediaCodec *mediacodec_jni_##name(const char *arg) \ { \ return codec_create(method, arg); \ } \ @@ -1299,10 +1286,10 @@ DECLARE_FF_AMEDIACODEC_CREATE_FUNC(createDecoderByType, CREATE_DECODER_BY_TYPE) DECLARE_FF_AMEDIACODEC_CREATE_FUNC(createEncoderByType, CREATE_ENCODER_BY_TYPE) -int ff_AMediaCodec_delete(FFAMediaCodec* codec) +static int mediacodec_jni_delete(FFAMediaCodec* ctx) { int ret = 0; - + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNIEnv *env = NULL; if (!codec) { @@ -1335,11 +1322,12 @@ return ret; } -char *ff_AMediaCodec_getName(FFAMediaCodec *codec) +static char *mediacodec_jni_getName(FFAMediaCodec *ctx) { char *ret = NULL; JNIEnv *env = NULL; jobject *name = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, NULL); @@ -1358,14 +1346,40 @@ return ret; } -int ff_AMediaCodec_configure(FFAMediaCodec* codec, const FFAMediaFormat* format, void* surface, void *crypto, uint32_t flags) +static int mediacodec_jni_configure(FFAMediaCodec *ctx, + const FFAMediaFormat* format_ctx, + FFANativeWindow* window, + void *crypto, + uint32_t flags) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; + const FFAMediaFormatJni *format = (FFAMediaFormatJni *)format_ctx; + jobject *surface = window ? window->surface : NULL; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); - (*env)->CallVoidMethod(env, codec->object, codec->jfields.configure_id, format->object, surface, NULL, flags); + if (flags & codec->CONFIGURE_FLAG_ENCODE) { + if (surface && !codec->jfields.set_input_surface_id) { + av_log(ctx, AV_LOG_ERROR, "System doesn't support setInputSurface\n"); + return AVERROR_EXTERNAL; + } + + (*env)->CallVoidMethod(env, codec->object, codec->jfields.configure_id, format->object, NULL, NULL, flags); + if (ff_jni_exception_check(env, 1, codec) < 0) + return AVERROR_EXTERNAL; + + if (!surface) + return 0; + + (*env)->CallVoidMethod(env, codec->object, codec->jfields.set_input_surface_id, surface); + if (ff_jni_exception_check(env, 1, codec) < 0) + return AVERROR_EXTERNAL; + return 0; + } else { + (*env)->CallVoidMethod(env, codec->object, codec->jfields.configure_id, format->object, surface, NULL, flags); + } if (ff_jni_exception_check(env, 1, codec) < 0) { ret = AVERROR_EXTERNAL; goto fail; @@ -1375,10 +1389,11 @@ return ret; } -int ff_AMediaCodec_start(FFAMediaCodec* codec) +static int mediacodec_jni_start(FFAMediaCodec* ctx) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1392,10 +1407,11 @@ return ret; } -int ff_AMediaCodec_stop(FFAMediaCodec* codec) +static int mediacodec_jni_stop(FFAMediaCodec* ctx) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1409,10 +1425,11 @@ return ret; } -int ff_AMediaCodec_flush(FFAMediaCodec* codec) +static int mediacodec_jni_flush(FFAMediaCodec* ctx) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1426,10 +1443,11 @@ return ret; } -int ff_AMediaCodec_releaseOutputBuffer(FFAMediaCodec* codec, size_t idx, int render) +static int mediacodec_jni_releaseOutputBuffer(FFAMediaCodec* ctx, size_t idx, int render) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1443,10 +1461,11 @@ return ret; } -int ff_AMediaCodec_releaseOutputBufferAtTime(FFAMediaCodec *codec, size_t idx, int64_t timestampNs) +static int mediacodec_jni_releaseOutputBufferAtTime(FFAMediaCodec *ctx, size_t idx, int64_t timestampNs) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1460,10 +1479,11 @@ return ret; } -ssize_t ff_AMediaCodec_dequeueInputBuffer(FFAMediaCodec* codec, int64_t timeoutUs) +static ssize_t mediacodec_jni_dequeueInputBuffer(FFAMediaCodec* ctx, int64_t timeoutUs) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1477,10 +1497,11 @@ return ret; } -int ff_AMediaCodec_queueInputBuffer(FFAMediaCodec* codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags) +static int mediacodec_jni_queueInputBuffer(FFAMediaCodec* ctx, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1494,10 +1515,11 @@ return ret; } -ssize_t ff_AMediaCodec_dequeueOutputBuffer(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs) +static ssize_t mediacodec_jni_dequeueOutputBuffer(FFAMediaCodec* ctx, FFAMediaCodecBufferInfo *info, int64_t timeoutUs) { int ret = 0; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); @@ -1529,11 +1551,11 @@ return ret; } -uint8_t* ff_AMediaCodec_getInputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +static uint8_t* mediacodec_jni_getInputBuffer(FFAMediaCodec* ctx, size_t idx, size_t *out_size) { uint8_t *ret = NULL; JNIEnv *env = NULL; - + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; jobject buffer = NULL; jobject input_buffers = NULL; @@ -1577,11 +1599,11 @@ return ret; } -uint8_t* ff_AMediaCodec_getOutputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +static uint8_t* mediacodec_jni_getOutputBuffer(FFAMediaCodec* ctx, size_t idx, size_t *out_size) { uint8_t *ret = NULL; JNIEnv *env = NULL; - + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; jobject buffer = NULL; jobject output_buffers = NULL; @@ -1625,10 +1647,11 @@ return ret; } -FFAMediaFormat* ff_AMediaCodec_getOutputFormat(FFAMediaCodec* codec) +static FFAMediaFormat* mediacodec_jni_getOutputFormat(FFAMediaCodec* ctx) { FFAMediaFormat *ret = NULL; JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; jobject mediaformat = NULL; @@ -1639,7 +1662,7 @@ goto fail; } - ret = ff_AMediaFormat_newFromObject(mediaformat); + ret = mediaformat_jni_newFromObject(mediaformat); fail: if (mediaformat) { (*env)->DeleteLocalRef(env, mediaformat); @@ -1648,44 +1671,52 @@ return ret; } -int ff_AMediaCodec_infoTryAgainLater(FFAMediaCodec *codec, ssize_t idx) +static int mediacodec_jni_infoTryAgainLater(FFAMediaCodec *ctx, ssize_t idx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return idx == codec->INFO_TRY_AGAIN_LATER; } -int ff_AMediaCodec_infoOutputBuffersChanged(FFAMediaCodec *codec, ssize_t idx) +static int mediacodec_jni_infoOutputBuffersChanged(FFAMediaCodec *ctx, ssize_t idx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return idx == codec->INFO_OUTPUT_BUFFERS_CHANGED; } -int ff_AMediaCodec_infoOutputFormatChanged(FFAMediaCodec *codec, ssize_t idx) +static int mediacodec_jni_infoOutputFormatChanged(FFAMediaCodec *ctx, ssize_t idx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return idx == codec->INFO_OUTPUT_FORMAT_CHANGED; } -int ff_AMediaCodec_getBufferFlagCodecConfig(FFAMediaCodec *codec) +static int mediacodec_jni_getBufferFlagCodecConfig(FFAMediaCodec *ctx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return codec->BUFFER_FLAG_CODEC_CONFIG; } -int ff_AMediaCodec_getBufferFlagEndOfStream(FFAMediaCodec *codec) +static int mediacodec_jni_getBufferFlagEndOfStream(FFAMediaCodec *ctx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return codec->BUFFER_FLAG_END_OF_STREAM; } -int ff_AMediaCodec_getBufferFlagKeyFrame(FFAMediaCodec *codec) +static int mediacodec_jni_getBufferFlagKeyFrame(FFAMediaCodec *ctx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return codec->BUFFER_FLAG_KEY_FRAME; } -int ff_AMediaCodec_getConfigureFlagEncode(FFAMediaCodec *codec) +static int mediacodec_jni_getConfigureFlagEncode(FFAMediaCodec *ctx) { + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; return codec->CONFIGURE_FLAG_ENCODE; } -int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec) +static int mediacodec_jni_cleanOutputBuffers(FFAMediaCodec *ctx) { int ret = 0; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; if (!codec->has_get_i_o_buffer) { if (codec->output_buffers) { @@ -1706,9 +1737,797 @@ return ret; } +static int mediacodec_jni_signalEndOfInputStream(FFAMediaCodec *ctx) +{ + JNIEnv *env = NULL; + FFAMediaCodecJni *codec = (FFAMediaCodecJni *)ctx; + + JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL); + + (*env)->CallVoidMethod(env, codec->object, codec->jfields.signal_end_of_input_stream_id); + if (ff_jni_exception_check(env, 1, codec) < 0) { + return AVERROR_EXTERNAL; + } + + return 0; +} + +static const FFAMediaFormat media_format_jni = { + .class = &amediaformat_class, + + .create = mediaformat_jni_new, + .delete = mediaformat_jni_delete, + + .toString = mediaformat_jni_toString, + + .getInt32 = mediaformat_jni_getInt32, + .getInt64 = mediaformat_jni_getInt64, + .getFloat = mediaformat_jni_getFloat, + .getBuffer = mediaformat_jni_getBuffer, + .getString = mediaformat_jni_getString, + + .setInt32 = mediaformat_jni_setInt32, + .setInt64 = mediaformat_jni_setInt64, + .setFloat = mediaformat_jni_setFloat, + .setString = mediaformat_jni_setString, + .setBuffer = mediaformat_jni_setBuffer, +}; + +static const FFAMediaCodec media_codec_jni = { + .class = &amediacodec_class, + + .getName = mediacodec_jni_getName, + + .createCodecByName = mediacodec_jni_createCodecByName, + .createDecoderByType = mediacodec_jni_createDecoderByType, + .createEncoderByType = mediacodec_jni_createEncoderByType, + .delete = mediacodec_jni_delete, + + .configure = mediacodec_jni_configure, + .start = mediacodec_jni_start, + .stop = mediacodec_jni_stop, + .flush = mediacodec_jni_flush, + + .getInputBuffer = mediacodec_jni_getInputBuffer, + .getOutputBuffer = mediacodec_jni_getOutputBuffer, + + .dequeueInputBuffer = mediacodec_jni_dequeueInputBuffer, + .queueInputBuffer = mediacodec_jni_queueInputBuffer, + + .dequeueOutputBuffer = mediacodec_jni_dequeueOutputBuffer, + .getOutputFormat = mediacodec_jni_getOutputFormat, + + .releaseOutputBuffer = mediacodec_jni_releaseOutputBuffer, + .releaseOutputBufferAtTime = mediacodec_jni_releaseOutputBufferAtTime, + + .infoTryAgainLater = mediacodec_jni_infoTryAgainLater, + .infoOutputBuffersChanged = mediacodec_jni_infoOutputBuffersChanged, + .infoOutputFormatChanged = mediacodec_jni_infoOutputFormatChanged, + + .getBufferFlagCodecConfig = mediacodec_jni_getBufferFlagCodecConfig, + .getBufferFlagEndOfStream = mediacodec_jni_getBufferFlagEndOfStream, + .getBufferFlagKeyFrame = mediacodec_jni_getBufferFlagKeyFrame, + + .getConfigureFlagEncode = mediacodec_jni_getConfigureFlagEncode, + .cleanOutputBuffers = mediacodec_jni_cleanOutputBuffers, + .signalEndOfInputStream = mediacodec_jni_signalEndOfInputStream, +}; + +typedef struct FFAMediaFormatNdk { + FFAMediaFormat api; + + void *libmedia; + AMediaFormat *impl; + + AMediaFormat *(*new)(void); + media_status_t (*delete)(AMediaFormat*); + + const char* (*toString)(AMediaFormat*); + + bool (*getInt32)(AMediaFormat*, const char *name, int32_t *out); + bool (*getInt64)(AMediaFormat*, const char *name, int64_t *out); + bool (*getFloat)(AMediaFormat*, const char *name, float *out); + bool (*getSize)(AMediaFormat*, const char *name, size_t *out); + bool (*getBuffer)(AMediaFormat*, const char *name, void** data, size_t *size); + bool (*getString)(AMediaFormat*, const char *name, const char **out); + bool (*getRect)(AMediaFormat *, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom); + + void (*setInt32)(AMediaFormat*, const char* name, int32_t value); + void (*setInt64)(AMediaFormat*, const char* name, int64_t value); + void (*setFloat)(AMediaFormat*, const char* name, float value); + void (*setString)(AMediaFormat*, const char* name, const char* value); + void (*setBuffer)(AMediaFormat*, const char* name, const void* data, size_t size); + void (*setRect)(AMediaFormat *, const char *name, + int32_t left, int32_t top, int32_t right, int32_t bottom); +} FFAMediaFormatNdk; + +typedef struct FFAMediaCodecNdk { + FFAMediaCodec api; + + void *libmedia; + AMediaCodec *impl; + ANativeWindow *window; + + AMediaCodec* (*createCodecByName)(const char *name); + AMediaCodec* (*createDecoderByType)(const char *mime_type); + AMediaCodec* (*createEncoderByType)(const char *mime_type); + media_status_t (*delete)(AMediaCodec*); + + media_status_t (*configure)(AMediaCodec *, + const AMediaFormat *format, + ANativeWindow *surface, + AMediaCrypto *crypto, + uint32_t flags); + media_status_t (*start)(AMediaCodec*); + media_status_t (*stop)(AMediaCodec*); + media_status_t (*flush)(AMediaCodec*); + + uint8_t* (*getInputBuffer)(AMediaCodec*, size_t idx, size_t *out_size); + uint8_t* (*getOutputBuffer)(AMediaCodec*, size_t idx, size_t *out_size); + + ssize_t (*dequeueInputBuffer)(AMediaCodec*, int64_t timeoutUs); + media_status_t (*queueInputBuffer)(AMediaCodec*, size_t idx, + long offset, size_t size, + uint64_t time, uint32_t flags); + + ssize_t (*dequeueOutputBuffer)(AMediaCodec*, AMediaCodecBufferInfo *info, int64_t timeoutUs); + AMediaFormat* (*getOutputFormat)(AMediaCodec*); + + media_status_t (*releaseOutputBuffer)(AMediaCodec*, size_t idx, bool render); + media_status_t (*releaseOutputBufferAtTime)(AMediaCodec *mData, size_t idx, int64_t timestampNs); + + // Available since API level 28. + media_status_t (*getName)(AMediaCodec*, char** out_name); + void (*releaseName)(AMediaCodec*, char* name); + + // Available since API level 26. + media_status_t (*setInputSurface)(AMediaCodec*, ANativeWindow *); + media_status_t (*signalEndOfInputStream)(AMediaCodec *); +} FFAMediaCodecNdk; + +static const FFAMediaFormat media_format_ndk; +static const FFAMediaCodec media_codec_ndk; + +static const AVClass amediaformat_ndk_class = { + .class_name = "amediaformat_ndk", + .item_name = av_default_item_name, + .version = LIBAVUTIL_VERSION_INT, +}; + +static const AVClass amediacodec_ndk_class = { + .class_name = "amediacodec_ndk", + .item_name = av_default_item_name, + .version = LIBAVUTIL_VERSION_INT, +}; + +static FFAMediaFormat *mediaformat_ndk_create(AMediaFormat *impl) +{ + FFAMediaFormatNdk *format = av_mallocz(sizeof(*format)); + if (!format) + return NULL; + + format->api = media_format_ndk; + + format->libmedia = dlopen("libmediandk.so", RTLD_NOW); + if (!format->libmedia) + goto error; + +#define GET_OPTIONAL_SYMBOL(sym) \ + format->sym = dlsym(format->libmedia, "AMediaFormat_" #sym); + +#define GET_SYMBOL(sym) \ + GET_OPTIONAL_SYMBOL(sym) \ + if (!format->sym) \ + goto error; + + GET_SYMBOL(new) + GET_SYMBOL(delete) + + GET_SYMBOL(toString) + + GET_SYMBOL(getInt32) + GET_SYMBOL(getInt64) + GET_SYMBOL(getFloat) + GET_SYMBOL(getSize) + GET_SYMBOL(getBuffer) + GET_SYMBOL(getString) + GET_OPTIONAL_SYMBOL(getRect) + + GET_SYMBOL(setInt32) + GET_SYMBOL(setInt64) + GET_SYMBOL(setFloat) + GET_SYMBOL(setString) + GET_SYMBOL(setBuffer) + GET_OPTIONAL_SYMBOL(setRect) + +#undef GET_SYMBOL +#undef GET_OPTIONAL_SYMBOL + + if (impl) { + format->impl = impl; + } else { + format->impl = format->new(); + if (!format->impl) + goto error; + } + + return (FFAMediaFormat *)format; + +error: + if (format->libmedia) + dlclose(format->libmedia); + av_freep(&format); + return NULL; +} + +static FFAMediaFormat *mediaformat_ndk_new(void) +{ + return mediaformat_ndk_create(NULL); +} + +static int mediaformat_ndk_delete(FFAMediaFormat* ctx) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + int ret = 0; + if (!format) + return 0; + + av_assert0(format->api.class == &amediaformat_ndk_class); + + if (format->impl && (format->delete(format->impl) != AMEDIA_OK)) + ret = AVERROR_EXTERNAL; + if (format->libmedia) + dlclose(format->libmedia); + av_free(format); + + return ret; +} + +static char* mediaformat_ndk_toString(FFAMediaFormat* ctx) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + const char *str = format->toString(format->impl); + return av_strdup(str); +} + +static int mediaformat_ndk_getInt32(FFAMediaFormat* ctx, const char *name, int32_t *out) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + return format->getInt32(format->impl, name, out); +} + +static int mediaformat_ndk_getInt64(FFAMediaFormat* ctx, const char *name, int64_t *out) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + return format->getInt64(format->impl, name, out); +} + +static int mediaformat_ndk_getFloat(FFAMediaFormat* ctx, const char *name, float *out) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + return format->getFloat(format->impl, name, out); +} + +static int mediaformat_ndk_getBuffer(FFAMediaFormat* ctx, const char *name, void** data, size_t *size) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + return format->getBuffer(format->impl, name, data, size); +} + +static int mediaformat_ndk_getString(FFAMediaFormat* ctx, const char *name, const char **out) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + const char *tmp = NULL; + int ret = format->getString(format->impl, name, &tmp); + + if (tmp) + *out = av_strdup(tmp); + return ret; +} + +static int mediaformat_ndk_getRect(FFAMediaFormat *ctx, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + if (!format->getRect) + return AVERROR_EXTERNAL; + return format->getRect(format->impl, name, left, top, right, bottom); +} + +static void mediaformat_ndk_setInt32(FFAMediaFormat* ctx, const char* name, int32_t value) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + format->setInt32(format->impl, name, value); +} + +static void mediaformat_ndk_setInt64(FFAMediaFormat* ctx, const char* name, int64_t value) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + format->setInt64(format->impl, name, value); +} + +static void mediaformat_ndk_setFloat(FFAMediaFormat* ctx, const char* name, float value) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + format->setFloat(format->impl, name, value); +} + +static void mediaformat_ndk_setString(FFAMediaFormat* ctx, const char* name, const char* value) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + format->setString(format->impl, name, value); +} + +static void mediaformat_ndk_setBuffer(FFAMediaFormat* ctx, const char* name, void* data, size_t size) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + format->setBuffer(format->impl, name, data, size); +} + +static void mediaformat_ndk_setRect(FFAMediaFormat *ctx, const char *name, + int32_t left, int32_t top, int32_t right, int32_t bottom) +{ + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)ctx; + if (!format->setRect) { + av_log(ctx, AV_LOG_WARNING, "Doesn't support setRect\n"); + return; + } + format->setRect(format->impl, name, left, top, right, bottom); +} + +static char *mediacodec_ndk_getName(FFAMediaCodec *ctx) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + char *ret = NULL; + char *name = NULL; + + if (!codec->getName || !codec->releaseName) { + av_log(ctx, AV_LOG_DEBUG, "getName() unavailable\n"); + return ret; + } + + codec->getName(codec->impl, &name); + if (name) { + ret = av_strdup(name); + codec->releaseName(codec->impl, name); + } + + return ret; +} + +static inline FFAMediaCodec *ndk_codec_create(int method, const char *arg) { + FFAMediaCodecNdk *codec = av_mallocz(sizeof(*codec)); + const char *lib_name = "libmediandk.so"; + + if (!codec) + return NULL; + + codec->api = media_codec_ndk; + codec->libmedia = dlopen(lib_name, RTLD_NOW); + if (!codec->libmedia) + goto error; + +#define GET_SYMBOL(sym, required) \ + codec->sym = dlsym(codec->libmedia, "AMediaCodec_" #sym); \ + if (!codec->sym) { \ + av_log(codec, required ? AV_LOG_ERROR : AV_LOG_INFO, \ + #sym "() unavailable from %s\n", lib_name); \ + if (required) \ + goto error; \ + } + + GET_SYMBOL(createCodecByName, 1) + GET_SYMBOL(createDecoderByType, 1) + GET_SYMBOL(createEncoderByType, 1) + GET_SYMBOL(delete, 1) + + GET_SYMBOL(configure, 1) + GET_SYMBOL(start, 1) + GET_SYMBOL(stop, 1) + GET_SYMBOL(flush, 1) + + GET_SYMBOL(getInputBuffer, 1) + GET_SYMBOL(getOutputBuffer, 1) + + GET_SYMBOL(dequeueInputBuffer, 1) + GET_SYMBOL(queueInputBuffer, 1) + + GET_SYMBOL(dequeueOutputBuffer, 1) + GET_SYMBOL(getOutputFormat, 1) + + GET_SYMBOL(releaseOutputBuffer, 1) + GET_SYMBOL(releaseOutputBufferAtTime, 1) + + GET_SYMBOL(getName, 0) + GET_SYMBOL(releaseName, 0) + + GET_SYMBOL(setInputSurface, 0) + GET_SYMBOL(signalEndOfInputStream, 0) + +#undef GET_SYMBOL + + switch (method) { + case CREATE_CODEC_BY_NAME: + codec->impl = codec->createCodecByName(arg); + break; + case CREATE_DECODER_BY_TYPE: + codec->impl = codec->createDecoderByType(arg); + break; + case CREATE_ENCODER_BY_TYPE: + codec->impl = codec->createEncoderByType(arg); + break; + default: + av_assert0(0); + } + if (!codec->impl) + goto error; + + return (FFAMediaCodec *)codec; + +error: + if (codec->libmedia) + dlclose(codec->libmedia); + av_freep(&codec); + return NULL; +} + +#define DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(name, method) \ +static FFAMediaCodec *mediacodec_ndk_##name(const char *arg) \ +{ \ + return ndk_codec_create(method, arg); \ +} \ + +DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(createCodecByName, CREATE_CODEC_BY_NAME) +DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(createDecoderByType, CREATE_DECODER_BY_TYPE) +DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(createEncoderByType, CREATE_ENCODER_BY_TYPE) + +static int mediacodec_ndk_delete(FFAMediaCodec* ctx) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + int ret = 0; + + if (!codec) + return 0; + + av_assert0(codec->api.class == &amediacodec_ndk_class); + + if (codec->impl && (codec->delete(codec->impl) != AMEDIA_OK)) + ret = AVERROR_EXTERNAL; + if (codec->window) + ANativeWindow_release(codec->window); + if (codec->libmedia) + dlclose(codec->libmedia); + av_free(codec); + + return ret; +} + +static int mediacodec_ndk_configure(FFAMediaCodec* ctx, + const FFAMediaFormat* format_ctx, + FFANativeWindow* window, + void *crypto, + uint32_t flags) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + FFAMediaFormatNdk *format = (FFAMediaFormatNdk *)format_ctx; + media_status_t status; + ANativeWindow *native_window = NULL; + + if (window) { + if (window->surface) { + JNIEnv *env = NULL; + JNI_GET_ENV_OR_RETURN(env, ctx, -1); + native_window = ANativeWindow_fromSurface(env, window->surface); + // Save for release + codec->window = native_window; + } else if (window->native_window) { + native_window = window->native_window; + } + } + + if (format_ctx->class != &amediaformat_ndk_class) { + av_log(ctx, AV_LOG_ERROR, "invalid media format\n"); + return AVERROR(EINVAL); + } + + if (flags & AMEDIACODEC_CONFIGURE_FLAG_ENCODE) { + if (native_window && !codec->setInputSurface) { + av_log(ctx, AV_LOG_ERROR, "System doesn't support setInputSurface\n"); + return AVERROR_EXTERNAL; + } + + status = codec->configure(codec->impl, format->impl, NULL, NULL, flags); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "Encoder configure failed, %d\n", status); + return AVERROR_EXTERNAL; + } + + if (!native_window) + return 0; + + status = codec->setInputSurface(codec->impl, native_window); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "Encoder set input surface failed, %d\n", status); + return AVERROR_EXTERNAL; + } + } else { + status = codec->configure(codec->impl, format->impl, native_window, NULL, flags); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "Decoder configure failed, %d\n", status); + return AVERROR_EXTERNAL; + } + } + + return 0; +} + +#define MEDIACODEC_NDK_WRAPPER(method) \ +static int mediacodec_ndk_ ## method(FFAMediaCodec* ctx) \ +{ \ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; \ + media_status_t status = codec->method(codec->impl); \ + \ + if (status != AMEDIA_OK) { \ + av_log(codec, AV_LOG_ERROR, #method " failed, %d\n", status); \ + return AVERROR_EXTERNAL; \ + } \ + \ + return 0; \ +} \ + +MEDIACODEC_NDK_WRAPPER(start) +MEDIACODEC_NDK_WRAPPER(stop) +MEDIACODEC_NDK_WRAPPER(flush) + +static uint8_t* mediacodec_ndk_getInputBuffer(FFAMediaCodec* ctx, size_t idx, size_t *out_size) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + return codec->getInputBuffer(codec->impl, idx, out_size); +} + +static uint8_t* mediacodec_ndk_getOutputBuffer(FFAMediaCodec* ctx, size_t idx, size_t *out_size) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + return codec->getOutputBuffer(codec->impl, idx, out_size); +} + +static ssize_t mediacodec_ndk_dequeueInputBuffer(FFAMediaCodec* ctx, int64_t timeoutUs) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + return codec->dequeueInputBuffer(codec->impl, timeoutUs); +} + +static int mediacodec_ndk_queueInputBuffer(FFAMediaCodec *ctx, size_t idx, + off_t offset, size_t size, + uint64_t time, uint32_t flags) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + return codec->queueInputBuffer(codec->impl, idx, offset, size, time, flags); +} + +static ssize_t mediacodec_ndk_dequeueOutputBuffer(FFAMediaCodec* ctx, FFAMediaCodecBufferInfo *info, int64_t timeoutUs) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + AMediaCodecBufferInfo buf_info = {0}; + ssize_t ret; + + ret = codec->dequeueOutputBuffer(codec->impl, &buf_info, timeoutUs); + info->offset = buf_info.offset; + info->size = buf_info.size; + info->presentationTimeUs = buf_info.presentationTimeUs; + info->flags = buf_info.flags; + + return ret; +} + +static FFAMediaFormat* mediacodec_ndk_getOutputFormat(FFAMediaCodec* ctx) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + AMediaFormat *format = codec->getOutputFormat(codec->impl); + + if (!format) + return NULL; + return mediaformat_ndk_create(format); +} + +static int mediacodec_ndk_releaseOutputBuffer(FFAMediaCodec* ctx, size_t idx, int render) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + media_status_t status; + + status = codec->releaseOutputBuffer(codec->impl, idx, render); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "release output buffer failed, %d\n", status); + return AVERROR_EXTERNAL; + } + + return 0; +} + +static int mediacodec_ndk_releaseOutputBufferAtTime(FFAMediaCodec *ctx, size_t idx, int64_t timestampNs) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + media_status_t status; + + status = codec->releaseOutputBufferAtTime(codec->impl, idx, timestampNs); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "releaseOutputBufferAtTime failed, %d\n", status); + return AVERROR_EXTERNAL; + } + + return 0; +} + +static int mediacodec_ndk_infoTryAgainLater(FFAMediaCodec *ctx, ssize_t idx) +{ + return idx == AMEDIACODEC_INFO_TRY_AGAIN_LATER; +} + +static int mediacodec_ndk_infoOutputBuffersChanged(FFAMediaCodec *ctx, ssize_t idx) +{ + return idx == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED; +} + +static int mediacodec_ndk_infoOutputFormatChanged(FFAMediaCodec *ctx, ssize_t idx) +{ + return idx == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED; +} + +static int mediacodec_ndk_getBufferFlagCodecConfig(FFAMediaCodec *ctx) +{ + return AMEDIACODEC_BUFFER_FLAG_CODEC_CONFIG; +} + +static int mediacodec_ndk_getBufferFlagEndOfStream(FFAMediaCodec *ctx) +{ + return AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM; +} + +static int mediacodec_ndk_getBufferFlagKeyFrame(FFAMediaCodec *ctx) +{ + return 1; +} + +static int mediacodec_ndk_getConfigureFlagEncode(FFAMediaCodec *ctx) +{ + return AMEDIACODEC_CONFIGURE_FLAG_ENCODE; +} + +static int mediacodec_ndk_cleanOutputBuffers(FFAMediaCodec *ctx) +{ + return 0; +} + +static int mediacodec_ndk_signalEndOfInputStream(FFAMediaCodec *ctx) +{ + FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; + media_status_t status; + + if (!codec->signalEndOfInputStream) { + av_log(codec, AV_LOG_ERROR, "signalEndOfInputStream unavailable\n"); + return AVERROR_EXTERNAL; + } + + status = codec->signalEndOfInputStream(codec->impl); + if (status != AMEDIA_OK) { + av_log(codec, AV_LOG_ERROR, "signalEndOfInputStream failed, %d\n", status); + return AVERROR_EXTERNAL; + } + av_log(codec, AV_LOG_DEBUG, "signalEndOfInputStream success\n"); + + return 0; +} + +static const FFAMediaFormat media_format_ndk = { + .class = &amediaformat_ndk_class, + + .create = mediaformat_ndk_new, + .delete = mediaformat_ndk_delete, + + .toString = mediaformat_ndk_toString, + + .getInt32 = mediaformat_ndk_getInt32, + .getInt64 = mediaformat_ndk_getInt64, + .getFloat = mediaformat_ndk_getFloat, + .getBuffer = mediaformat_ndk_getBuffer, + .getString = mediaformat_ndk_getString, + .getRect = mediaformat_ndk_getRect, + + .setInt32 = mediaformat_ndk_setInt32, + .setInt64 = mediaformat_ndk_setInt64, + .setFloat = mediaformat_ndk_setFloat, + .setString = mediaformat_ndk_setString, + .setBuffer = mediaformat_ndk_setBuffer, + .setRect = mediaformat_ndk_setRect, +}; + +static const FFAMediaCodec media_codec_ndk = { + .class = &amediacodec_ndk_class, + + .getName = mediacodec_ndk_getName, + + .createCodecByName = mediacodec_ndk_createCodecByName, + .createDecoderByType = mediacodec_ndk_createDecoderByType, + .createEncoderByType = mediacodec_ndk_createEncoderByType, + .delete = mediacodec_ndk_delete, + + .configure = mediacodec_ndk_configure, + .start = mediacodec_ndk_start, + .stop = mediacodec_ndk_stop, + .flush = mediacodec_ndk_flush, + + .getInputBuffer = mediacodec_ndk_getInputBuffer, + .getOutputBuffer = mediacodec_ndk_getOutputBuffer, + + .dequeueInputBuffer = mediacodec_ndk_dequeueInputBuffer, + .queueInputBuffer = mediacodec_ndk_queueInputBuffer, + + .dequeueOutputBuffer = mediacodec_ndk_dequeueOutputBuffer, + .getOutputFormat = mediacodec_ndk_getOutputFormat, + + .releaseOutputBuffer = mediacodec_ndk_releaseOutputBuffer, + .releaseOutputBufferAtTime = mediacodec_ndk_releaseOutputBufferAtTime, + + .infoTryAgainLater = mediacodec_ndk_infoTryAgainLater, + .infoOutputBuffersChanged = mediacodec_ndk_infoOutputBuffersChanged, + .infoOutputFormatChanged = mediacodec_ndk_infoOutputFormatChanged, + + .getBufferFlagCodecConfig = mediacodec_ndk_getBufferFlagCodecConfig, + .getBufferFlagEndOfStream = mediacodec_ndk_getBufferFlagEndOfStream, + .getBufferFlagKeyFrame = mediacodec_ndk_getBufferFlagKeyFrame, + + .getConfigureFlagEncode = mediacodec_ndk_getConfigureFlagEncode, + .cleanOutputBuffers = mediacodec_ndk_cleanOutputBuffers, + .signalEndOfInputStream = mediacodec_ndk_signalEndOfInputStream, +}; + +FFAMediaFormat *ff_AMediaFormat_new(int ndk) +{ + if (ndk) + return media_format_ndk.create(); + return media_format_jni.create(); +} + +FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name, int ndk) +{ + if (ndk) + return media_codec_ndk.createCodecByName(name); + return media_codec_jni.createCodecByName(name); +} + +FFAMediaCodec* ff_AMediaCodec_createDecoderByType(const char *mime_type, int ndk) +{ + if (ndk) + return media_codec_ndk.createDecoderByType(mime_type); + return media_codec_jni.createDecoderByType(mime_type); +} + +FFAMediaCodec* ff_AMediaCodec_createEncoderByType(const char *mime_type, int ndk) +{ + if (ndk) + return media_codec_ndk.createEncoderByType(mime_type); + return media_codec_jni.createEncoderByType(mime_type); +} + int ff_Build_SDK_INT(AVCodecContext *avctx) { int ret = -1; + +#if __ANDROID_API__ >= 24 + // android_get_device_api_level() is a static inline before API level 29. + // dlsym() might doesn't work. + // + // We can implement android_get_device_api_level() by + // __system_property_get(), but __system_property_get() has created a lot of + // troubles and is deprecated. So avoid using __system_property_get() for + // now. + // + // Hopy we can remove the conditional compilation finally by bumping the + // required API level. + // + ret = android_get_device_api_level(); +#else JNIEnv *env = NULL; jclass versionClass; jfieldID sdkIntFieldID; @@ -1718,5 +2537,8 @@ sdkIntFieldID = (*env)->GetStaticFieldID(env, versionClass, "SDK_INT", "I"); ret = (*env)->GetStaticIntField(env, versionClass, sdkIntFieldID); (*env)->DeleteLocalRef(env, versionClass); +#endif + av_log(avctx, AV_LOG_DEBUG, "device api level %d\n", ret); + return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mediacodec_wrapper.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include #include "avcodec.h" +#include "mediacodec_surface.h" /** * The following API around MediaCodec and MediaFormat is based on the @@ -58,28 +59,114 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int encoder, void *log_ctx); -struct FFAMediaFormat; typedef struct FFAMediaFormat FFAMediaFormat; +struct FFAMediaFormat { + const AVClass *class; -FFAMediaFormat *ff_AMediaFormat_new(void); -int ff_AMediaFormat_delete(FFAMediaFormat* format); + FFAMediaFormat *(*create)(void); + int (*delete)(FFAMediaFormat *); -char* ff_AMediaFormat_toString(FFAMediaFormat* format); + char* (*toString)(FFAMediaFormat* format); -int ff_AMediaFormat_getInt32(FFAMediaFormat* format, const char *name, int32_t *out); -int ff_AMediaFormat_getInt64(FFAMediaFormat* format, const char *name, int64_t *out); -int ff_AMediaFormat_getFloat(FFAMediaFormat* format, const char *name, float *out); -int ff_AMediaFormat_getBuffer(FFAMediaFormat* format, const char *name, void** data, size_t *size); -int ff_AMediaFormat_getString(FFAMediaFormat* format, const char *name, const char **out); - -void ff_AMediaFormat_setInt32(FFAMediaFormat* format, const char* name, int32_t value); -void ff_AMediaFormat_setInt64(FFAMediaFormat* format, const char* name, int64_t value); -void ff_AMediaFormat_setFloat(FFAMediaFormat* format, const char* name, float value); -void ff_AMediaFormat_setString(FFAMediaFormat* format, const char* name, const char* value); -void ff_AMediaFormat_setBuffer(FFAMediaFormat* format, const char* name, void* data, size_t size); + int (*getInt32)(FFAMediaFormat* format, const char *name, int32_t *out); + int (*getInt64)(FFAMediaFormat* format, const char *name, int64_t *out); + int (*getFloat)(FFAMediaFormat* format, const char *name, float *out); + int (*getBuffer)(FFAMediaFormat* format, const char *name, void** data, size_t *size); + int (*getString)(FFAMediaFormat* format, const char *name, const char **out); + // NDK only, introduced in API level 28 + int (*getRect)(FFAMediaFormat *, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom); + + void (*setInt32)(FFAMediaFormat* format, const char* name, int32_t value); + void (*setInt64)(FFAMediaFormat* format, const char* name, int64_t value); + void (*setFloat)(FFAMediaFormat* format, const char* name, float value); + void (*setString)(FFAMediaFormat* format, const char* name, const char* value); + void (*setBuffer)(FFAMediaFormat* format, const char* name, void* data, size_t size); + // NDK only, introduced in API level 28 + void (*setRect)(FFAMediaFormat*, const char* name, + int32_t left, int32_t top, int32_t right, int32_t bottom); +}; + +FFAMediaFormat *ff_AMediaFormat_new(int ndk); + +static inline int ff_AMediaFormat_delete(FFAMediaFormat* format) +{ + return format->delete(format); +} + +static inline char* ff_AMediaFormat_toString(FFAMediaFormat* format) +{ + return format->toString(format); +} + +static inline int ff_AMediaFormat_getInt32(FFAMediaFormat* format, const char *name, int32_t *out) +{ + return format->getInt32(format, name, out); +} + +static inline int ff_AMediaFormat_getInt64(FFAMediaFormat* format, const char *name, int64_t *out) +{ + return format->getInt64(format, name, out); +} + +static inline int ff_AMediaFormat_getFloat(FFAMediaFormat* format, const char *name, float *out) +{ + return format->getFloat(format, name, out); +} + +static inline int ff_AMediaFormat_getBuffer(FFAMediaFormat* format, const char *name, void** data, size_t *size) +{ + return format->getBuffer(format, name, data, size); +} + +static inline int ff_AMediaFormat_getString(FFAMediaFormat* format, const char *name, const char **out) +{ + return format->getString(format, name, out); +} + +static inline int ff_AMediaFormat_getRect(FFAMediaFormat *format, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) +{ + if (!format->getRect) + return AVERROR_EXTERNAL; + return format->getRect(format, name, left, top, right, bottom); +} + +static inline void ff_AMediaFormat_setInt32(FFAMediaFormat* format, const char* name, int32_t value) +{ + format->setInt32(format, name, value); +} + +static inline void ff_AMediaFormat_setInt64(FFAMediaFormat* format, const char* name, int64_t value) +{ + format->setInt64(format, name, value); +} + +static inline void ff_AMediaFormat_setFloat(FFAMediaFormat* format, const char* name, float value) +{ + format->setFloat(format, name, value); +} + +static inline void ff_AMediaFormat_setString(FFAMediaFormat* format, const char* name, const char* value) +{ + format->setString(format, name, value); +} + +static inline void ff_AMediaFormat_setBuffer(FFAMediaFormat* format, const char* name, void* data, size_t size) +{ + format->setBuffer(format, name, data, size); +} + +static inline void ff_AMediaFormat_setRect(FFAMediaFormat* format, const char* name, + int32_t left, int32_t top, int32_t right, int32_t bottom) +{ + if (!format->setRect) { + av_log(format, AV_LOG_WARNING, "Doesn't support setRect\n"); + return; + } + format->setRect(format, name, left, top, right, bottom); +} -struct FFAMediaCodec; -typedef struct FFAMediaCodec FFAMediaCodec; typedef struct FFAMediaCodecCryptoInfo FFAMediaCodecCryptoInfo; struct FFAMediaCodecBufferInfo { @@ -90,41 +177,171 @@ }; typedef struct FFAMediaCodecBufferInfo FFAMediaCodecBufferInfo; -char *ff_AMediaCodec_getName(FFAMediaCodec *codec); +typedef struct FFAMediaCodec FFAMediaCodec; +struct FFAMediaCodec { + const AVClass *class; -FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name); -FFAMediaCodec* ff_AMediaCodec_createDecoderByType(const char *mime_type); -FFAMediaCodec* ff_AMediaCodec_createEncoderByType(const char *mime_type); + char *(*getName)(FFAMediaCodec *codec); -int ff_AMediaCodec_configure(FFAMediaCodec* codec, const FFAMediaFormat* format, void* surface, void *crypto, uint32_t flags); -int ff_AMediaCodec_start(FFAMediaCodec* codec); -int ff_AMediaCodec_stop(FFAMediaCodec* codec); -int ff_AMediaCodec_flush(FFAMediaCodec* codec); -int ff_AMediaCodec_delete(FFAMediaCodec* codec); + FFAMediaCodec* (*createCodecByName)(const char *name); + FFAMediaCodec* (*createDecoderByType)(const char *mime_type); + FFAMediaCodec* (*createEncoderByType)(const char *mime_type); + int (*delete)(FFAMediaCodec* codec); -uint8_t* ff_AMediaCodec_getInputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size); -uint8_t* ff_AMediaCodec_getOutputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size); + int (*configure)(FFAMediaCodec* codec, const FFAMediaFormat* format, FFANativeWindow* surface, void *crypto, uint32_t flags); + int (*start)(FFAMediaCodec* codec); + int (*stop)(FFAMediaCodec* codec); + int (*flush)(FFAMediaCodec* codec); -ssize_t ff_AMediaCodec_dequeueInputBuffer(FFAMediaCodec* codec, int64_t timeoutUs); -int ff_AMediaCodec_queueInputBuffer(FFAMediaCodec* codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags); + uint8_t* (*getInputBuffer)(FFAMediaCodec* codec, size_t idx, size_t *out_size); + uint8_t* (*getOutputBuffer)(FFAMediaCodec* codec, size_t idx, size_t *out_size); -ssize_t ff_AMediaCodec_dequeueOutputBuffer(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs); -FFAMediaFormat* ff_AMediaCodec_getOutputFormat(FFAMediaCodec* codec); + ssize_t (*dequeueInputBuffer)(FFAMediaCodec* codec, int64_t timeoutUs); + int (*queueInputBuffer)(FFAMediaCodec* codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags); -int ff_AMediaCodec_releaseOutputBuffer(FFAMediaCodec* codec, size_t idx, int render); -int ff_AMediaCodec_releaseOutputBufferAtTime(FFAMediaCodec *codec, size_t idx, int64_t timestampNs); + ssize_t (*dequeueOutputBuffer)(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs); + FFAMediaFormat* (*getOutputFormat)(FFAMediaCodec* codec); -int ff_AMediaCodec_infoTryAgainLater(FFAMediaCodec *codec, ssize_t idx); -int ff_AMediaCodec_infoOutputBuffersChanged(FFAMediaCodec *codec, ssize_t idx); -int ff_AMediaCodec_infoOutputFormatChanged(FFAMediaCodec *codec, ssize_t indx); + int (*releaseOutputBuffer)(FFAMediaCodec* codec, size_t idx, int render); + int (*releaseOutputBufferAtTime)(FFAMediaCodec *codec, size_t idx, int64_t timestampNs); -int ff_AMediaCodec_getBufferFlagCodecConfig (FFAMediaCodec *codec); -int ff_AMediaCodec_getBufferFlagEndOfStream(FFAMediaCodec *codec); -int ff_AMediaCodec_getBufferFlagKeyFrame(FFAMediaCodec *codec); + int (*infoTryAgainLater)(FFAMediaCodec *codec, ssize_t idx); + int (*infoOutputBuffersChanged)(FFAMediaCodec *codec, ssize_t idx); + int (*infoOutputFormatChanged)(FFAMediaCodec *codec, ssize_t indx); -int ff_AMediaCodec_getConfigureFlagEncode(FFAMediaCodec *codec); + int (*getBufferFlagCodecConfig)(FFAMediaCodec *codec); + int (*getBufferFlagEndOfStream)(FFAMediaCodec *codec); + int (*getBufferFlagKeyFrame)(FFAMediaCodec *codec); + + int (*getConfigureFlagEncode)(FFAMediaCodec *codec); + + int (*cleanOutputBuffers)(FFAMediaCodec *codec); + + // For encoder with FFANativeWindow as input. + int (*signalEndOfInputStream)(FFAMediaCodec *); +}; -int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec); +static inline char *ff_AMediaCodec_getName(FFAMediaCodec *codec) +{ + return codec->getName(codec); +} + +FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name, int ndk); +FFAMediaCodec* ff_AMediaCodec_createDecoderByType(const char *mime_type, int ndk); +FFAMediaCodec* ff_AMediaCodec_createEncoderByType(const char *mime_type, int ndk); + +static inline int ff_AMediaCodec_configure(FFAMediaCodec *codec, + const FFAMediaFormat *format, + FFANativeWindow *surface, + void *crypto, uint32_t flags) +{ + return codec->configure(codec, format, surface, crypto, flags); +} + +static inline int ff_AMediaCodec_start(FFAMediaCodec* codec) +{ + return codec->start(codec); +} + +static inline int ff_AMediaCodec_stop(FFAMediaCodec* codec) +{ + return codec->stop(codec); +} + +static inline int ff_AMediaCodec_flush(FFAMediaCodec* codec) +{ + return codec->flush(codec); +} + +static inline int ff_AMediaCodec_delete(FFAMediaCodec* codec) +{ + return codec->delete(codec); +} + +static inline uint8_t* ff_AMediaCodec_getInputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +{ + return codec->getInputBuffer(codec, idx, out_size); +} + +static inline uint8_t* ff_AMediaCodec_getOutputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +{ + return codec->getOutputBuffer(codec, idx, out_size); +} + +static inline ssize_t ff_AMediaCodec_dequeueInputBuffer(FFAMediaCodec* codec, int64_t timeoutUs) +{ + return codec->dequeueInputBuffer(codec, timeoutUs); +} + +static inline int ff_AMediaCodec_queueInputBuffer(FFAMediaCodec *codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags) +{ + return codec->queueInputBuffer(codec, idx, offset, size, time, flags); +} + +static inline ssize_t ff_AMediaCodec_dequeueOutputBuffer(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs) +{ + return codec->dequeueOutputBuffer(codec, info, timeoutUs); +} + +static inline FFAMediaFormat* ff_AMediaCodec_getOutputFormat(FFAMediaCodec* codec) +{ + return codec->getOutputFormat(codec); +} + +static inline int ff_AMediaCodec_releaseOutputBuffer(FFAMediaCodec* codec, size_t idx, int render) +{ + return codec->releaseOutputBuffer(codec, idx, render); +} + +static inline int ff_AMediaCodec_releaseOutputBufferAtTime(FFAMediaCodec *codec, size_t idx, int64_t timestampNs) +{ + return codec->releaseOutputBufferAtTime(codec, idx, timestampNs); +} + +static inline int ff_AMediaCodec_infoTryAgainLater(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoTryAgainLater(codec, idx); +} + +static inline int ff_AMediaCodec_infoOutputBuffersChanged(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoOutputBuffersChanged(codec, idx); +} + +static inline int ff_AMediaCodec_infoOutputFormatChanged(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoOutputFormatChanged(codec, idx); +} + +static inline int ff_AMediaCodec_getBufferFlagCodecConfig(FFAMediaCodec *codec) +{ + return codec->getBufferFlagCodecConfig(codec); +} + +static inline int ff_AMediaCodec_getBufferFlagEndOfStream(FFAMediaCodec *codec) +{ + return codec->getBufferFlagEndOfStream(codec); +} + +static inline int ff_AMediaCodec_getBufferFlagKeyFrame(FFAMediaCodec *codec) +{ + return codec->getBufferFlagKeyFrame(codec); +} + +static inline int ff_AMediaCodec_getConfigureFlagEncode(FFAMediaCodec *codec) +{ + return codec->getConfigureFlagEncode(codec); +} + +static inline int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec) +{ + return codec->cleanOutputBuffers(codec); +} + +static inline int ff_AMediaCodec_signalEndOfInputStream(FFAMediaCodec *codec) +{ + return codec->signalEndOfInputStream(codec); +} int ff_Build_SDK_INT(AVCodecContext *avctx); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,15 +26,11 @@ #include #include "libavutil/channel_layout.h" -#include "libavutil/float_dsp.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" -#include "fft.h" #include "get_bits.h" -#include "lsp.h" -#include "sinewin.h" #include "twinvq.h" #include "metasound_data.h" @@ -302,11 +298,6 @@ props++; } - if (channels <= 0 || channels > TWINVQ_CHANNELS_MAX) { - av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n", - channels); - return AVERROR_INVALIDDATA; - } av_channel_layout_uninit(&avctx->ch_layout); av_channel_layout_default(&avctx->ch_layout, channels); @@ -314,46 +305,46 @@ switch ((channels << 16) + (isampf << 8) + ibps) { case (1 << 16) + ( 8 << 8) + 6: - tctx->mtab = &ff_metasound_mode0806; + tctx->mtab = &metasound_mode0806; break; case (2 << 16) + ( 8 << 8) + 6: - tctx->mtab = &ff_metasound_mode0806s; + tctx->mtab = &metasound_mode0806s; break; case (1 << 16) + ( 8 << 8) + 8: - tctx->mtab = &ff_metasound_mode0808; + tctx->mtab = &metasound_mode0808; break; case (2 << 16) + ( 8 << 8) + 8: - tctx->mtab = &ff_metasound_mode0808s; + tctx->mtab = &metasound_mode0808s; break; case (1 << 16) + (11 << 8) + 10: - tctx->mtab = &ff_metasound_mode1110; + tctx->mtab = &metasound_mode1110; break; case (2 << 16) + (11 << 8) + 10: - tctx->mtab = &ff_metasound_mode1110s; + tctx->mtab = &metasound_mode1110s; break; case (1 << 16) + (16 << 8) + 16: - tctx->mtab = &ff_metasound_mode1616; + tctx->mtab = &metasound_mode1616; break; case (2 << 16) + (16 << 8) + 16: - tctx->mtab = &ff_metasound_mode1616s; + tctx->mtab = &metasound_mode1616s; break; case (1 << 16) + (22 << 8) + 24: - tctx->mtab = &ff_metasound_mode2224; + tctx->mtab = &metasound_mode2224; break; case (2 << 16) + (22 << 8) + 24: - tctx->mtab = &ff_metasound_mode2224s; + tctx->mtab = &metasound_mode2224s; break; case (1 << 16) + (44 << 8) + 32: case (2 << 16) + (44 << 8) + 32: - tctx->mtab = &ff_metasound_mode4432; + tctx->mtab = &metasound_mode4432; break; case (1 << 16) + (44 << 8) + 40: case (2 << 16) + (44 << 8) + 40: - tctx->mtab = &ff_metasound_mode4440; + tctx->mtab = &metasound_mode4440; break; case (1 << 16) + (44 << 8) + 48: case (2 << 16) + (44 << 8) + 48: - tctx->mtab = &ff_metasound_mode4448; + tctx->mtab = &metasound_mode4448; break; default: av_log(avctx, AV_LOG_ERROR, @@ -375,7 +366,7 @@ const FFCodec ff_metasound_decoder = { .p.name = "metasound", - .p.long_name = NULL_IF_CONFIG_SMALL("Voxware MetaSound"), + CODEC_LONG_NAME("Voxware MetaSound"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_METASOUND, .priv_data_size = sizeof(TwinVQContext), @@ -385,5 +376,5 @@ .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_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,14730 +0,0 @@ -/* - * MetaSound decoder - * Copyright (c) 2013 Konstantin Shishkov - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "config_components.h" -#include "metasound_data.h" - -#if CONFIG_METASOUND_DECODER -static const int16_t cb0806sl0[] = { - -417, -225, -84, 16, -106, -34, -246, -164, - 112, 48, -47, 36, -65, -68, -172, -1655, - -36, 140, -3, -2, -2, 2, 0, 0, - 178, 7, -181, -177, 120, -64, -129, 80, - -6826, -38, -25, 147, 148, -13, -25, 110, - 21, 21, -1, 0, 0, 0, 0, 0, - 3319, 632, -734, -187, 40, -249, -155, -1, - -173, 95, 28, -2, 20, -44, 35, 120, - -47, -221, -5, 2, -7, 1, 0, 0, - 63, 268, -260, -419, 187, -75, -228, 296, - -470, 177, -515, 318, 124, 308, 92, 371, - 3046, 362, -1, -1, -10, 1, 0, 0, - -356, -16, -199, 117, -75, 46, -108, -14, - -124, -173, 4914, -75, -474, 105, 87, 190, - -183, -208, 0, 0, 1, 1, 0, -1, - 162, 89, 49, -314, -2788, 265, -263, -3, - -3156, 316, 112, 128, -333, -138, -114, -141, - -287, -234, -1, 0, 0, 0, 0, 1, - 733, 126, -424, -389, 642, 432, 134, -251, - 407, -51, -151, -491, -308, 91, 50, 3836, - 87, 100, -5, -6, 0, 1, 0, 0, - 304, 1727, 83, -8, 216, -81, -189, 152, - -67, 15, 310, -93, 6, -37, 54, -110, - -15, 78, 0, 0, 1, 12, 0, -1, - 129, -198, 1, -48, -66, -147, 30, 264, - -84, 102, 42, 126, 1, -6451, 225, -51, - 8, 123, 0, -1, 0, -1, 0, 0, - -374, 66, -256, -80, -1139, 303, 2002, -199, - -98, -98, -39, -76, 180, 15, -456, 148, - -183, 118, -2, 1, 0, 0, 0, 0, - 151, 13, -114, 65, 6156, 76, -82, -30, - -26, 163, 81, 167, -83, -101, 55, -40, - 161, -793, -8, 0, 0, -1, -1, 0, - -102, -33, 55, -131, 434, 108, 70, 68, - 62, 1913, -109, 235, 110, 124, -25, -58, - -76, 18, -1, -1, 0, 0, 0, 0, - -105, -7322, -9, 82, 53, -43, -5, 18, - 90, 91, 20, -34, 26, -93, -50, -46, - -77, 105, 0, 6, -12, -6, 1, 0, - -1334, 980, -163, -351, -514, 537, 62, -300, - 80, -318, 14, -3570, -52, -116, -280, 540, - 250, -775, -7, 0, 0, 0, 0, 0, - 507, 317, -417, -236, -2438, -72, -346, 2507, - 302, -185, 30, 1539, 205, 87, -112, -482, - -296, 132, -1, 0, -1, 1, 0, 0, - -64, -208, -159, 1, 336, -62, -14, 13, - 81, 101, 382, 32, 116, -5, -41, 25, - -175, -7829, 1, 0, 1, 0, 0, 0, - 7551, -7, 86, -165, -57, -17, 183, -207, - 69, 54, -99, -25, 167, -58, 107, -81, - 165, 172, 2, -2, 0, 1, 0, -9, - 26, 28, 86, -183, -320, -32, 116, -53, - -49, -15, 133, -283, -152, 576, 6630, 185, - 44, 25, 20, 1, -12, 1, -1, 0, - -145, -51, -114, -29, -228, 78, -409, 235, - 147, 45, -192, 177, -91, 68, -2572, -52, - 81, 181, -5, 13, -1, -1, -17, 0, - -65, -23, -28, 9, 242, 14, -35, 88, - 77, -20, 37, -7097, -58, 51, 137, 126, - -90, 136, 0, 4, -1, 0, 0, 0, - -266, -82, -205, 816, -309, 3267, 1053, 369, - -216, -302, 18, 168, 395, 273, 343, 243, - -98, -53, 1, 0, 0, 1, 0, 0, - -65, -76, 1850, -991, -454, -535, 2927, -145, - 101, 23, 20, 234, -74, 77, 114, 4, - -106, 527, -11, 4, 0, 1, -1, 0, - 573, -46, 207, 2640, -956, 47, 26, -10, - 317, -217, -5, -867, -3, 213, 52, 53, - -428, -175, 0, 0, -1, -1, 0, -1, - -223, -55, 135, 184, 313, 0, 2868, 245, - -3187, -721, -291, 9, -265, -120, -105, -36, - 454, 55, -1, 49, 0, 1, -1, 0, - -291, 41, 84, 557, -201, -2300, 429, 283, - 21, -2, 132, 286, -124, 149, -14, 146, - 320, -298, 0, -1, 1, -2, 0, 0, - -86, -3493, 131, -3581, 185, 26, -197, -65, - -96, 147, -53, -150, -35, -35, 179, 68, - -157, 0, 0, 2, 0, 1, 2, -1, - -22, -218, 13, -1447, -400, 288, -1295, 0, - -119, 69, -56, -139, 157, -26, -122, -61, - -38, -108, -1, 1, 0, 0, 0, 0, - -229, 3335, 103, -108, 10, 3008, -712, 50, - 27, 152, -307, -106, 148, -77, -178, -46, - 7, -114, 0, -9, 0, 0, 1, 0, - 932, -443, 311, -75, 62, -80, -179, 459, - -232, -160, 2, 169, 134, -260, 41, -149, - 23, 92, -2, 0, 11, 1, 0, 0, - 16, -90, -574, -171, 163, 261, -299, 2994, - 74, -3818, -396, -171, 13, -29, -45, -168, - -287, -390, 1, 0, 0, -4, 0, -1, - 89, -702, 2223, 101, -249, 2983, 36, -333, - -382, 410, -262, 185, -146, 98, -8, -317, - -279, -879, 0, 0, 0, 0, 4, 0, - -98, -325, 75, -229, -13, 112, -5743, -34, - -89, 263, -155, 80, 140, -50, 33, 143, - -60, -77, 1, -2, 0, -1, 1, 0, - 52, -576, -543, -1142, -947, -184, 449, -71, - -75, -156, -3412, -50, -487, 307, 663, -1000, - -415, -2348, -7, -1, -1, 0, 0, 0, - 64, 3, -35, 11, 14, -198, -2, -8042, - 140, -11, -93, 29, -65, 330, 34, 110, - -19, -137, 2, 0, 0, 0, 0, 0, - 1236, 303, 2681, 234, -217, -406, -395, -380, - 247, 349, -101, -33, 370, -39, 139, 59, - 18, 24, 0, 0, 0, 0, 0, 0, - 166, -21, -5392, -117, -296, 114, 230, -255, - 131, -53, 13, -45, 200, 7, -56, 87, - 46, 223, -59, 0, -1, 0, 0, -1, - 214, -511, 175, 204, -123, -47, -440, 6, - 23, 92, -355, 80, -4885, -238, -37, 78, - -218, 175, 0, 2, 0, 0, 0, 0, - -146, 74, -13, -4, 27, -45, 51, 81, - -80, 53, -18, 173, -146, -64, -8, 8192, - 79, 15, 0, -3, 0, 1, 0, 0, - -3, -16, -28, 288, -61, 4, -187, 6, - -5, -14, 77, -12, -53, 16, -41, -7, - -10, -2, 7, -1, -9, 1, 0, 0, - -285, -35, -8, 221, -68, 114, 135, -8, - -203, -181, -91, 2043, -58, 127, 201, 111, - 46, -344, -11, -49, 0, 1, 0, -1, - -160, -186, 58, 4761, 289, 51, -145, 51, - -32, 71, 62, 175, -13, 181, 203, 141, - -200, 106, -1, 4, -2, 0, 0, 0, - 803, -76, -96, -940, 300, 3429, -84, 3037, - 262, -9, -39, 120, -629, -309, 233, -374, - 398, 894, -12, 1, 1, 1, 0, 0, - -282, 2525, -31, -176, -2473, 53, 102, -610, - 180, -145, 42, -51, 223, 27, -69, 727, - -14, -51, 0, 0, 0, -3, 0, -40, - 214, 72, 41, 1, 190, 78, -228, -235, - 105, -4619, -140, -46, -7, 49, 9, -19, - 137, -2, 9, 1, 0, 0, 0, 0, - -142, -262, 29, -142, 39, -39, -92, 95, - 50, -282, 2, -106, 114, 8, 35, 78, - -121, 2589, 1, -4, -10, 1, 1, 0, - -192, 59, 287, 400, -67, -6989, -301, 446, - 115, 7, 33, -60, 111, 102, 8, 206, - 46, -31, -1, -1, -2, 0, 0, 0, - -104, 332, -223, 1066, -188, 1270, -222, 309, - -296, 259, 780, -460, -1914, 218, -556, 210, - 2962, 130, 1, -2, 2, 0, 1, 0, - -320, -365, -266, 822, -119, 824, -312, 58, - -1857, 235, 48, -3985, 118, -307, -703, -931, - -560, 105, -2, -3, 0, 0, 0, 1, - 156, -48, 187, 214, -212, 180, 342, 373, - 1973, 128, -5, 146, -40, -11, 71, -60, - 76, 17, 0, 0, -1, 2, 0, 7, - 214, 63, 274, 2876, -65, 314, 400, 344, - 140, 39, 193, -226, 124, -3177, 68, 46, - -60, -317, 2, 0, -1, 0, 7, 0, - -160, 118, 233, 239, -465, 96, 253, 3178, - -88, 299, 368, -220, 197, 397, -353, -463, - -202, -103, -4, 0, 0, 0, 0, 0, - 687, -448, -749, 87, -35, 112, 309, -33, - -16, 88, 141, 63, -51, 274, -113, -76, - 46, -273, -1, 1, 0, 1, 0, 1, - -298, -206, 670, 303, -451, -277, -493, 404, - -173, 284, 148, 626, -322, -296, -68, 3044, - -442, 1138, -7, 2, 0, 1, 0, 0, - -1338, 18, 2862, 223, 250, 260, 144, 259, - -38, -647, 602, -160, 75, -5, -8, 34, - 237, 50, 2, 0, 1, -1, -1, 0, - -412, 2153, 933, 478, 768, 186, -424, -657, - -3458, -443, 294, 224, -468, -58, -120, -1565, - 211, -420, 0, 0, 1, -1, 0, 0, - 198, 227, -112, 350, 297, -303, 108, -192, - 153, 32, -2717, -111, -1093, -200, 476, 326, - -271, 627, 0, -4, 0, 0, 0, -1, - 462, -616, 126, 316, -2413, 204, -350, -3549, - -263, -386, -112, 483, -1339, 636, 70, -531, - 96, 38, 8, -1, 0, -3, 0, 0, - -310, -1128, 616, -339, -168, -124, -905, -151, - -383, 76, 137, -44, 3689, -388, 184, 1799, - -102, -930, 6, -1, -1, -1, 0, 0, - -284, 280, 39, -728, 143, 15, 181, 798, - 382, 10, 2267, -12, -3582, -27, 357, 514, - -565, -121, 0, -1, 0, -9, -1, 0, - 429, -16, 2993, -2903, 47, -136, 30, 792, - -327, -347, -69, -50, -93, -223, -438, 158, - 203, -475, 0, -4, -1, 2, 0, 0, - -3465, 415, -963, 252, 397, -945, -448, -231, - -130, 673, 504, 55, -355, 221, 29, 167, - -19, 134, -1, -1, -4, 0, -14, -2, - 44, 433, -535, -216, 2485, 33, 19, -100, - -185, -171, 91, 336, -208, 140, -3, 46, - -67, -116, 32, 0, 5, 3, 0, 0, - 220, 91, -65, -15, -169, 217, -183, -169, - -47, 181, -272, 138, -166, 110, -9, 41, - -6957, 33, -5, -2, 1, 1, 0, -1, - 164, -4062, -109, 230, -220, 1748, -1338, -246, - -242, -98, 300, 217, -202, -130, 157, -3, - -19, -453, 0, 2, 0, 0, 0, 0, -}; - -static const int16_t cb0806sl1[] = { - 75, 87, -31, 607, -132, 5963, -262, 494, - 134, -4, 141, 19, 225, 229, 239, 93, - -20, -189, 2, 0, -3, -1, -1, 0, - 214, -206, 877, 83, -588, 83, 132, 78, - 5, -85, 66, -24, 47, -11, 25, 26, - -3, 46, 2, -5, 0, 1, -1, 0, - -113, 295, -81, 74, 223, -50, -93, -5671, - -28, 115, 256, -228, -31, -539, 300, -278, - -59, 426, -110, -1, 1, 1, 0, 0, - -95, -116, 266, 176, 761, -3, 90, -91, - 98, -209, -414, -27, -56, 26, -76, 6, - -32, 4634, 1, 0, -4, 0, 0, 0, - 177, 147, -236, -93, -7925, 11, -111, -74, - 36, 176, 352, 88, 112, 16, 144, -110, - 91, 329, -1, 2, 0, 1, 0, 1, - 119, 304, -94, -422, 113, 129, -70, 155, - 247, -116, -139, 327, -355, 77, 143, -5362, - 27, -377, -1, 7, 2, 1, 0, 0, - 179, 127, 1500, -324, -15, 673, 184, -1382, - 167, 1833, -3058, 200, -1203, 459, -1905, 1020, - -259, -120, 10, -4, 0, 1, 0, 0, - 995, -112, 37, -160, -21, -4011, 172, 228, - -210, 80, -131, 1, 20, -128, -252, -288, - -132, 337, -1, 0, -1, 0, 1, -1, - -60, 61, 197, -185, -40, -2951, -592, -57, - 210, -3248, -226, -44, 391, -167, -7, 219, - -15, 172, 0, -1, 1, 0, 0, 0, - 106, -70, -291, 192, 45, 162, 37, 143, - 91, 21, -7032, 12, -173, -30, 1, 259, - -286, 387, -36, 0, 0, 0, 0, 0, - -1593, -210, 83, 47, 194, 61, 85, -182, - -23, 40, -74, 22, 12, 216, 59, -165, - -163, -159, -8, 0, 0, 2, 0, 0, - -3, 182, -80, 2068, 702, 115, -164, -85, - 21, -124, -191, -113, 263, 138, 4235, 37, - 204, -436, 0, 24, 1, -1, 0, 0, - 147, 83, -177, -168, -609, -9, -16, -46, - 127, 120, -25, 3435, 51, 31, 49, 366, - 31, -129, 1, -32, 0, -1, 0, -2, - 295, 158, 116, 11, -280, 471, 169, 29, - -2589, 338, 32, 299, 172, -187, -32, 437, - -38, 359, -1, -1, 1, 0, 0, 0, - 243, 413, -29, -4774, 187, 12, -117, 168, - -114, -208, -55, 5, 0, -31, 436, 545, - -45, 272, 0, -4, 0, 0, 1, 0, - 127, 38, 6620, -33, -103, 34, 84, -35, - 30, -131, -8, -79, -126, -98, 17, -75, - -31, -176, 14, -1, 0, 0, -1, -1, - 273, -219, 176, -83, 187, -36, 1, 2639, - 158, 3812, 127, -233, 175, 310, 148, 387, - -14, 308, 0, -3, 0, 0, 0, 0, - 3321, -447, 153, -128, 254, -275, 79, -181, - 17, 146, 61, 46, -48, 253, 51, -17, - 1, 1, 0, 1, -1, -2, 0, -13, - 791, -130, 40, 78, -64, -179, 42, -455, - 422, 112, -19, -4499, -113, -341, 52, 69, - 67, 254, -6, -1, 4, 0, 0, 1, - -98, -976, 68, 1563, 228, 1018, 458, -1020, - 411, 249, -627, 2321, 738, -460, -1469, 362, - 884, -261, 0, -1, 1, 1, 0, 0, - -601, 378, -71, 61, -160, 800, -386, -773, - 303, -53, 248, -22, 59, -3809, -61, 102, - -45, 395, 0, 0, 28, 0, -12, 0, - 717, -424, 499, 296, -15, 11, 2732, -103, - -119, -116, 107, -50, 462, 73, -82, 75, - 41, 131, 0, 3, 1, -1, 0, 0, - -134, 109, 48, -1847, -205, -6, 20, -203, - 136, 197, 113, -77, -124, -50, 184, 225, - -175, -295, -1, -1, -6, -1, -1, 0, - -59, -2017, -193, -237, 226, 630, 1950, -2, - 179, -3666, -34, 140, 88, 157, 51, 81, - -263, -169, 1, 0, 0, 0, 0, 0, - 229, -14, -1590, -123, 162, 63, -224, -332, - 119, 2931, 21, -48, 406, 15, 320, -51, - 64, -228, -9, -1, 0, -1, 0, 0, - -453, 84, -320, -654, -4, -91, -61, 558, - -61, -233, 31, -224, -105, 63, 86, 3771, - 162, -1535, 3, -3, 1, 1, 0, 1, - -1992, -279, -59, -3048, -1696, 102, -168, 194, - 172, -142, 55, 134, 116, -146, -29, -287, - 102, 265, -3, 1, 0, 1, 0, 0, - -96, 46, -16, 2474, -58, -712, -25, -294, - 187, 22, -39, -102, 62, 2666, -237, -1, - 32, -41, 0, 0, 0, 0, 0, 0, - -282, -25, -198, -862, -127, -379, -210, -20, - 45, -79, -2805, -364, 575, 106, 215, -410, - -76, 511, 15, -44, -1, 1, 0, 0, - 329, 224, 130, 43, -1, -255, -51, -297, - 4529, 52, 186, 757, -68, -89, 46, 250, - 46, -79, 5, 1, 0, 1, 0, -19, - 79, 74, 65, 256, 260, 492, -106, -217, - -357, 20, 166, 233, 132, 165, 18, -1, - 4445, -22, 5, 3, -7, 0, 0, -6, - -922, 2156, 269, 1385, 235, -206, -94, 130, - 112, 145, -126, 166, 1, 45, 83, 36, - -153, -255, 0, -1, 0, 0, 1, 0, - 241, -237, -117, -510, 85, 7, -4418, 30, - 94, -92, 99, -71, 140, -265, 149, 69, - 286, 104, 0, -2, 1, 0, 0, 0, - -165, 22, -245, 29, 50, 145, -53, 1641, - -40, -128, -112, -190, 47, 53, -247, -50, - 88, 39, 1, -1, 0, 0, 0, 0, - -288, 130, 88, -132, 4055, -7, 55, -105, - 277, 81, 69, -66, -53, 52, -56, 90, - 160, 386, 1, -4, 0, -2, 0, 0, - 107, 124, -39, 40, 25, -6, -248, -81, - 70, -13, 46, 5, 20, 24, -5, -2, - -41, -34, 1, 1, -8, 0, -4, 0, - -61, 1, 457, 454, 768, 89, 640, 61, - 66, -360, -2727, -155, -370, -44, -292, 570, - 34, -3209, -5, -1, 1, 0, -1, 0, - 22, -82, -20, -125, -91, 98, 7843, 25, - -2, -31, 2, -52, -73, -25, 31, -35, - -6, -114, 1, -1, 2, 0, 0, 0, - 217, -5202, 86, -76, -76, 109, 389, -95, - -253, 124, 130, 58, 190, -44, -67, -142, - 54, 6, -1, 1, 1, 1, 0, 0, - -183, 547, -200, 348, 372, 437, 425, 547, - -457, 388, 87, 38, -522, -210, -556, 41, - -2979, -17, 7, -4, 6, 0, 0, 0, - 189, 196, 240, -75, 46, -50, 101, -160, - -16, -223, 92, 71, -7633, 78, 90, 69, - 190, -75, 2, 1, -2, -1, 0, 1, - 205, -433, -267, -175, 3068, -210, -514, 330, - -3099, -273, 155, 132, -306, 361, 316, -53, - -421, -125, -3, 0, -11, 0, 0, 0, - 179, -38, 151, -36, 215, -102, -145, 139, - 50, 200, 383, 37, 3102, -27, 9, -157, - -68, 367, 1, 1, 0, 0, 1, 0, - -50, 177, -24, 24, 119, 4, 76, 99, - -111, -7367, 26, 51, -11, -146, -125, -48, - 54, 50, 1, 0, 0, 0, -1, 0, - -71, -16, -184, -61, -36, -151, 79, -128, - -102, 135, -228, 190, -79, -10, -176, -113, - 1008, -856, -13, -4, 8, 28, 0, 1, - -4909, -93, -167, -141, 51, -203, 71, -199, - -49, 106, -142, -94, 126, -225, 158, 36, - 269, 159, 0, 1, 1, 0, 0, -5, - -61, -79, -20, 306, 67, -621, 1774, 346, - -442, 125, 305, -170, 55, -2537, -103, 118, - 87, 505, 16, -7, -2, 0, 20, 0, - 35, -154, -158, 224, -36, -344, 79, 4232, - 234, -219, -71, 204, -484, -131, 1153, 23, - 111, 499, 5, 0, -17, 0, 0, 1, - 1135, -3469, -489, 2572, -450, -432, -358, -34, - -78, -10, -775, 17, -131, -154, 218, 82, - -312, 279, 1, 0, 1, 0, 0, 0, - 96, 230, 18, 47, -5, -102, 646, -122, - 35, -81, 183, 171, -1479, 201, 84, -24, - 143, 302, 1, 5, 0, 0, 0, 0, - -34, -48, 89, 7789, -85, -27, -56, 46, - 39, 30, 98, -40, 138, -147, 104, -35, - -41, -151, 1, 9, 1, 0, 0, 0, - -140, -1970, -170, 273, 226, 33, -324, -38, - 11, 188, 603, 188, -183, 98, -58, -67, - -63, 7, 0, 0, 0, 0, 1, 0, - 384, 899, 493, 765, -1062, 646, 275, -2699, - 93, 796, 120, -25, 177, -85, 721, -189, - -295, -436, 0, -1, 0, 0, -1, 0, - -358, 117, -2435, 325, -3137, -158, 23, 97, - 6, 204, 288, -426, 156, 22, -101, 171, - -56, 235, 0, -1, 0, -1, 0, 0, - 656, 3878, -286, -383, 75, -50, 114, -377, - -105, 106, 154, -30, -204, -105, 171, -56, - 230, -587, 0, 1, 0, 8, 1, -1, - -58, 177, -7, 45, -159, 405, 45, 84, - -206, 77, 277, -259, 121, 3719, 140, 79, - -202, 843, -8, 0, -1, 1, -2, 0, - -248, 560, 2651, -49, -625, -147, -2416, 119, - -70, 87, 137, 18, -401, -147, -598, -150, - 239, -1004, 7, 3, 13, 1, 1, 1, - 276, 342, 97, 600, 230, 95, 213, 159, - -259, -25, -176, 3360, -283, -325, -37, -2626, - -151, 178, -1, -18, 0, 0, 0, 0, - -233, 237, -78, 290, -284, 141, -20, 146, - 58, -21, 73, -35, -101, -23, -4068, -116, - 49, -196, -5, -2, 0, 1, -1, 0, - -292, -195, 51, -714, 172, 44, -119, 134, - 168, 107, -74, -2379, 308, 173, -252, -3470, - -135, 641, -10, 0, 0, 1, 0, 0, - 146, 2060, -84, -164, -247, 26, -1724, 216, - 226, -2499, 312, -66, 850, 41, -1, 20, - -1339, 411, 0, 0, -1, -12, 0, 0, - 921, 17, -3510, -119, 325, 34, -97, -205, - 3, -188, 252, 91, 0, -135, -76, 208, - 199, -202, -1, 1, 1, 2, 0, -1, - -88, -461, 319, -963, 266, 1540, 643, -3424, - 76, -1058, 501, 342, 297, 268, -158, -103, - 26, -30, 0, -1, -1, 0, 0, 0, - 211, 245, 183, 1579, 106, 26, -3450, -22, - -1053, -266, -736, 113, 475, -241, 117, -85, - -492, 372, 0, 1, 1, 0, 0, 0, -}; - -static const int16_t cb0806ss0[] = { - -381, -1638, -8192, 5, 983, -1481, -20, -719, - -238, 767, 571, -200, 754, 460, 1678, 1376, - -155, -1998, 294, -455, 80, 2, 26, 3, - 10, 25, -931, -1098, -1166, -3221, -1995, 702, - 104, -2429, -2270, 1372, 2326, -37, -1492, 1692, - 644, -1283, 363, 624, -483, -15, 346, -6, - 2, 0, 1, 3, 2, -2429, -8192, -956, - 1190, 706, -955, 367, 959, -194, -723, -1104, - 375, 554, -962, -229, 66, 368, 18, -150, - 56, 968, -15, 0, -1, -5, 0, 9, - -250, -720, 1910, 827, 198, -645, 2021, 32, - -1972, -705, 441, 373, 800, -2293, 1747, 1504, - -537, -1731, -1192, 1597, -4031, 24, 0, -2, - 1, 1, 1, -131, 1594, -153, 1127, 2732, - 469, -558, -11, 1190, 115, -933, 1988, 1841, - -4530, 1385, 571, 2399, 1709, -63, -3663, -2681, - 57, -4, 11, -4, 0, -3, 426, -4257, - 2755, -76, -1667, 2450, -373, 3375, -91, -232, - 511, 648, 886, 1182, 1667, 65, -3029, -579, - 865, 2186, 2911, 537, 0, 2, -3, 0, - 7, 585, 8192, -2855, 8192, 5527, -5491, -1926, - -4231, -1204, 1953, -1193, 191, 3278, -1726, 259, - -2794, 4205, 4315, -6121, -606, -1922, 3666, -324, - -238, -313, -720, -1447, -539, -794, 3151, -1726, - 3444, 876, 584, -671, -497, 407, 909, -2183, - 2575, 246, -673, 270, 824, 1784, -201, 7329, - 589, -70, -1, 4, -5, -3, -8, -417, - 382, 2786, -972, 520, 1154, 886, 521, 6032, - -687, 3791, -522, -1226, 608, 428, 891, -1524, - -1015, 1147, 1278, 559, -6, 3, 0, 6, - 2, -3, 115, 3586, -2847, 95, 460, 2832, - 2326, -1665, 1720, 453, 965, 1154, 452, -1721, - -1375, -269, 2138, -2032, 55, -674, -870, -124, - 0, 5, 0, -5, -3, -283, 1077, 2604, - 1270, -1082, -1753, 6840, -2502, 988, -1790, 1378, - 1231, 438, -1188, 286, 540, -138, 1054, -111, - -2321, 74, 56, -3, -2, 0, -32, 5, - 1539, -1399, 7413, -903, -1698, 1781, -255, -466, - -1436, 3419, 1916, 852, 590, -1126, -1617, -1309, - -5560, -241, 3363, -1225, 2682, 620, -6, 58, - 2, -186, -17, -2959, 619, 2228, -2627, -3119, - 730, 3716, -538, -101, -1863, -516, 142, -2384, - -1514, -5506, -825, 514, 714, 746, -2790, 569, - -425, 4, -68, 70, 24, 12, 817, -276, - -3363, -2942, 103, -581, -925, 651, 561, 43, - 434, 712, -541, -2042, -1291, -453, -443, -4312, - -1344, 1277, 605, -4, 0, -1, -1, 1, - 2, -930, 276, 3219, -404, -944, -497, 840, - 278, -98, -1432, -1136, -1975, -1863, -1102, -1446, - 938, 693, -5186, -1, 1085, -2275, 1, 1, - -1, -1, -2, 3, -1194, -312, -1257, 1973, - 1570, -1703, -1637, 639, -855, 1925, 970, 604, - 1313, 780, -5170, -603, 220, -731, 2952, -872, - 166, 30, 0, -2, -1, 3, -1, -743, - 504, 1363, 1436, 1632, -634, -709, -2346, 87, - 1149, 3468, 2132, 3028, -1039, -92, 2087, -990, - -301, 966, -773, -1057, 42, 0, -2, 0, - 2, 2, 252, 217, 3625, -2323, 212, -381, - -1121, 1664, -307, 1680, 2193, -1854, -187, -3100, - 254, -673, 595, 1995, 669, -687, -509, 13, - 0, 8, -3, 11, -3, -552, -87, 6, - 2933, -267, -1392, 40, 644, 32, 2966, -1386, - -2480, -956, 1160, 1399, 1049, 3902, -2092, -525, - 1724, 69, -33, 0, -2, 0, 2, 2, - -452, -4739, -3237, -510, -598, -1397, 855, 1573, - 2143, -79, -1546, -17, -973, -2400, 1689, 133, - -1213, 784, 726, 916, -388, -390, 1, -1, - -3, -1, 0, 170, -205, -2905, 8192, -465, - 3119, 4407, -709, -403, 859, -373, -1301, -1397, - -750, -88, 277, -2097, -222, -134, -88, -1189, - 974, -56, -57, -83, -21, 102, 626, -114, - -2304, 979, -1836, -868, 1261, 2226, -261, 579, - 983, 655, -2578, 1803, 117, -1128, 365, 3971, - 3539, -21, -790, -62, 2, 3, 23, -3, - 31, 1273, 3212, -1617, 4116, -281, 725, -284, - 1079, 293, -3759, 2581, -1617, -259, -19, -1999, - 3040, -3077, -1522, 1056, -92, 897, 243, -1, - 36, -19, -10, -46, 231, 1129, 363, -1978, - -882, -1788, 319, 4807, -1707, -1379, -1465, 2327, - -827, -681, 410, -1816, -2507, 1036, 740, 730, - -687, 100, -1, -1, -1, 1, -4, -276, - 303, -2331, -2912, -1864, -3694, 412, -1218, 1642, - 4448, 658, -213, 872, 2867, 227, 868, -590, - 2293, 1759, -1666, -1585, -140, 1, -3, -1, - 26, -10, -287, 898, -2442, 3997, -1655, -1341, - -56, 689, -1869, 572, -2044, 616, -2603, -278, - 2987, 2397, -2055, 247, 128, 598, 1732, -146, - 0, 3, -1, -3, 5, 842, 597, 779, - -1529, -802, 2142, -1668, 2339, -3550, -2651, 1733, - -1531, -46, 600, 618, -867, -665, 1524, 392, - -1386, -3279, 45, 0, 9, -7, -3, -8, - -224, -2632, -147, -505, 2223, 1773, 1799, -1696, - 194, -1186, -543, 775, -1171, 5491, -2319, -3193, - -313, -355, -133, -1097, 125, -22, -2, 2, - 1, -3, -10, -354, -1447, -662, -313, -4302, - 3888, -121, -323, 1112, -801, -1513, -814, -1646, - -616, -1207, 347, 483, 670, 900, -35, -885, - 14, 1, 0, 1, -2, 7, -432, -486, - -1539, 785, 4853, 904, 925, 895, -1223, -2464, - 3395, -506, -808, 207, 197, 874, -928, 1347, - -107, 1512, 1063, -182, 1, -4, -1, -6, - 3, -1236, -1047, 774, 26, -630, 863, 1055, - -2632, -1187, -534, -619, -1079, -2574, -2037, 658, - 1229, -262, 2702, -3393, -2187, 1764, 66, 0, - 7, 0, 7, -3, 677, -444, -2111, -5256, - -4485, -1667, 2077, 1613, 1483, -1520, 1600, 1767, - 1148, 2054, 1676, 1866, 783, -2199, 765, 568, - 2779, -683, 4, 17, 0, -32, 15, 45, - 228, -2445, 752, 2510, -1657, -1039, 113, 1107, - -1054, -1765, -1245, -2527, 589, 455, 328, 640, - -579, 2370, 1313, -540, 31, 1, -1, -4, - 2, -3, -235, -560, 455, 3809, 102, 403, - -21, 1844, 402, 148, -32, 5573, -3765, -265, - -718, -399, -349, 366, -1105, 91, 1881, 34, - 1, 1, 5, 0, 9, 289, -1146, 795, - -2504, 412, 1156, -302, -946, 2063, -2569, -273, - -1434, 141, 642, -631, 4856, -1008, 169, -40, - 191, -2293, -86, 6, 1, -2, 0, 1, - 139, 1955, -1111, -944, 140, -1074, 1071, -1312, - -541, 664, 1801, -892, 1605, -1750, -654, -680, - -8102, 120, -24, 1014, -351, -120, 0, -2, - 1, -1, -1, 1038, 5199, 779, -1195, 128, - 462, 184, 3705, -1292, -2247, -2481, 2610, 4396, - 4161, 4039, 1111, 838, 188, -571, 2811, -1915, - -1909, 13, 99, -20, -2, 11, 395, 155, - 2667, -202, -2639, 1303, -912, -1734, 1097, -583, - 3532, -218, -1514, -3881, 378, -46, -1189, -957, - -3010, -743, -648, 15, 1, 3, 3, 4, - -4, 330, 198, -275, -677, -8192, -629, 1953, - -783, 592, 926, 1487, -39, -1002, 1134, 1560, - -27, -118, -1363, -360, 2163, 442, 92, 1, - 1, -2, 5, 1, -670, 326, 2773, 1346, - -26, 327, 184, -1091, -121, 576, -1324, 212, - -645, 860, -2111, -493, -2119, 316, -688, 475, - -652, -33, 0, 1, 2, 0, -3, 92, - 170, 6224, 2162, 761, -1994, 2176, 1692, -1773, - 561, -966, 3406, -20, -593, 574, -681, 1121, - -335, -412, -2651, -4712, -79, 1, 2, -1, - 4, -6, 932, -2579, 344, -2614, 1119, 6623, - -314, -1068, 338, 1977, -1375, -1338, -1996, 1310, - 118, -500, -393, 622, -1798, -1232, 3, -75, - 0, 17, 0, -2, -9, 715, 8135, 400, - 3748, 2156, 1882, 772, 2728, -403, -775, 2110, - 1603, -766, -2592, 767, -618, 4727, 668, 2280, - -1157, 1246, -794, -14, -2, 2, 5, 16, - -107, 642, -1806, -158, -2447, 309, -764, 2313, - -101, -766, 209, -691, 2001, 268, -273, 615, - 803, 6062, -434, 1287, -543, -3, 0, 0, - 1, 1, 0, 503, -598, -2043, -1160, 1074, - 1255, 3269, 1405, 1182, 197, 3098, -138, 2326, - -244, -772, 901, -225, 337, -65, -536, -331, - 15, 2, 13, 8, -3, 20, -32, -52, - -1012, 232, 1502, -17, -1574, -741, -57, 164, - -22, 74, -181, 1616, 296, -1483, 1387, -357, - -5380, -322, -1346, 6, -3, 2, -3, 1, - 0, -392, -811, -650, -485, 3038, 2750, -776, - -503, -1664, -323, 253, -280, -3459, -1313, 541, - 2182, 1287, -782, 1785, -695, -49, 72, -4, - 0, -15, 3, -21, -211, 1382, -149, 684, - 2210, 2654, -1440, -1209, 152, 1080, -3078, -694, - 4738, 985, -1337, 819, -518, 1799, -671, 3201, - 2636, 7, 1, -6, 14, -31, 0, -34, - 4296, -23, 194, 1976, -993, 1353, 709, -342, - -1142, -140, -271, 2291, -709, 1734, 818, -3571, - 1125, 912, -590, 784, -275, -2, -1, -5, - -1, 0, -381, 2754, 1545, -2270, 3608, 2308, - -1899, 178, 391, 1826, -127, -1417, -822, -712, - 1682, 2225, 2247, 446, 994, 56, 734, 196, - 7, 3, 8, 0, 7, 639, 833, -3313, - 675, -263, -648, 3016, -701, 235, -1304, -582, - -2930, -210, -1243, 374, -3095, -2013, 354, 599, - -1469, 140, -17, -1, -3, 2, 0, -2, - -183, 399, -603, 796, -1424, 2685, -3929, 416, - -2291, 1737, 1906, 1667, 810, -222, 3242, -3636, - 5196, -1542, 940, -124, 2047, -67, -4, 6, - -1, 13, 2, -161, 417, 4132, 492, -1068, - -817, 2732, -250, -1457, 1723, 2104, 1121, -1276, - 1147, 990, -523, -1533, 297, 1219, 3901, -2549, - -22, 0, 0, 0, 0, 2, -1632, 172, - 829, -747, -1229, -1990, -1070, 1134, 1623, 228, - 3689, 625, -757, 8192, -82, 738, 213, 1900, - -1200, 91, 892, -45, 15, -1, 5, -4, - 5, 392, -3067, -1903, 139, 661, 43, 2174, - -1919, -270, -1490, -569, 2, 85, -1091, 6740, - 886, 85, -1052, -647, -563, -2971, -145, -1, - 39, -5, -6, -7, -1023, -1104, -1774, -3154, - -1058, 3488, -2551, 3547, -253, -204, -235, -1544, - -73, -584, -302, -3118, -2314, -308, 1790, 916, - 152, -155, -11, 6, -26, -1, -31, 21, - 919, -1856, -456, -1050, 663, 1454, -1515, -2606, - -4287, 1553, 3564, 1334, 1797, 1540, -392, -701, - -971, -3442, 281, -271, 133, 1, 5, 4, - 32, 3, -521, -1530, -1368, 1787, -515, -913, - -2391, 93, 2690, -578, -576, -1656, 554, 649, - -1509, -258, -605, 1233, -2258, 640, 837, -43, - 1, -3, 0, 5, 3, 148, -4761, 1783, - 3244, -277, -1139, 1539, -2016, 1898, -1276, -776, - -1725, -1900, -51, 559, 311, 1737, -928, 3687, - -1087, 1329, 134, 2, -2, -7, 9, 5, - -77, -1116, 4986, -940, -905, -3229, -773, 3335, - -23, 578, -2376, 386, 122, 1253, 363, -2748, - -512, -4612, 1690, 848, -1116, 195, 5, 2, - 11, 1, 18, 659, -1282, 562, 1170, 4701, - 903, 490, -3508, 3468, -39, 654, -1196, -909, - -268, 980, 283, 3221, 348, 1121, -897, -1011, - -103, -11, -2, -9, 16, -8, -274, -4100, - -2312, -2379, 617, 1629, 2154, 3026, -1737, -603, - -803, -366, 977, 1035, -1835, -255, -275, -1245, - 1274, -161, -4476, -181, -4, 0, -2, 1, - 2, 156, 551, -832, -630, 3740, -2115, 344, - 229, 1295, 65, 290, -1462, -1794, 3297, -1049, - 2451, 322, -2642, -2810, -1246, 613, 90, -1, - -1, 0, 0, 0, -277, 854, 1259, 1542, - -433, 3601, -453, 1091, -113, 1438, 994, -2746, - -786, 867, 1422, 1093, -1723, -1167, -1389, -1062, - -436, -81, 2, 1, 11, 1, 26, -197, -}; - -static const int16_t cb0806ss1[] = { - 1760, -4335, 6384, -2036, 2874, -2504, -1529, 102, - 6995, -1267, -3141, 1050, -59, 1556, -1002, 1536, - 1024, 1867, 40, -1156, -2627, -213, -1034, -660, - 291, -963, -323, 462, -804, 2219, -859, 1709, - 550, -3390, 319, 24, 644, 3154, 4503, -1961, - 744, 194, -151, -1255, -1318, 3033, -899, -18, - 1, 0, 2, 0, 28, -1213, -3725, -2525, - -177, -1164, 361, -357, -649, -459, 1324, 2463, - -3108, -3323, -575, -2744, -108, -121, -508, -564, - -849, -773, -288, 0, 8, 0, -2, 5, - 691, -602, 2269, 2373, -2027, 786, 3011, 3234, - -1387, -310, 659, -358, 1058, -1554, 1031, 795, - 2254, -549, 334, 325, 599, -36, -1, -1, - -2, 3, 4, -450, -533, -1657, -1928, -1034, - -636, -1446, -320, 2695, 1184, 697, 1126, 1159, - 2970, 449, -30, -2058, -1171, -684, -66, 905, - -43, 1, 0, 3, 0, 3, 228, 272, - -79, -718, 1978, 667, -2760, 1507, -1893, -796, - 1164, 35, -4440, -4492, -1667, 4189, 6485, -495, - 1721, -1639, -526, 458, 0, 385, -183, 511, - -153, -2025, -376, 2948, -2606, -910, -741, -427, - -1080, 2128, 565, -483, 1791, -2222, -45, -1204, - 799, 512, -4790, 1462, 511, -1906, 15, 0, - 0, 1, 3, 8, -867, -685, -140, 5299, - 376, -891, 1657, 1843, -1465, -1297, 518, -4640, - 303, -277, -650, -97, 2308, -679, 720, -171, - -475, -269, 0, -5, 4, -1, 9, -1155, - -4954, 1684, -2045, 939, 819, -751, -165, -93, - -2327, 306, 965, 4999, 557, -55, -999, 30, - -36, 989, -1680, -1594, 318, -3, -8, -4, - 1, -9, -402, 8192, 475, 2080, -418, -1739, - -273, -55, -441, 794, -79, 272, -2039, 789, - 2266, 874, 2495, 627, 2203, 1212, -1052, 389, - 14, -24, -59, 10, 133, -535, -1160, -1139, - -146, 180, 1064, 3718, -1412, 1153, 1873, -549, - -1698, -1479, 209, 725, -940, 2152, 1848, 678, - 2493, 4608, -11, 0, -1, -3, -3, 2, - 334, 681, 673, -8192, 3958, -3111, 1641, 1500, - 1184, -268, -3147, 571, 958, -663, -1031, -870, - -674, -1098, -529, 78, 1212, 120, -8, -13, - -5, -42, -37, -498, 1304, -2541, 1730, -355, - 1462, 2315, 2017, -403, -2010, 555, 1391, 887, - 2039, 366, 135, 85, 371, 1291, -225, 335, - -45, 0, 1, 2, -1, 2, -1095, -261, - 3249, 3212, -1877, 934, -1671, -1289, 1398, -2287, - -205, 1659, 642, 1105, 751, 2864, 1171, -1001, - 318, -290, 60, -54, 5, 3, 5, 2, - 1, -105, 590, 36, -194, 1832, -639, 777, - 3243, 578, 2820, 428, 2020, 623, -2104, -52, - -331, -1015, 3064, -347, -303, -1100, 61, -1, - -1, 0, 2, -1, 592, 127, 887, -1094, - -2819, 2573, -2670, -1693, -2775, 48, -266, -961, - 1220, -472, 167, 3201, 1118, -173, 1304, -26, - -899, 76, 0, 3, 0, 1, -1, -718, - -746, 947, -524, 142, 958, -1609, -777, -1362, - 385, -578, -6947, 157, -290, 1357, -1703, 484, - 117, -2224, -3736, -838, -96, -1, 11, 5, - 4, 2, 475, -426, 500, -767, -2304, 1248, - 2200, -1829, -992, -225, -573, -1107, -832, 2555, - -2866, 3453, 4335, -88, -1160, -1666, -94, -33, - 0, 0, 1, -2, -7, -147, -8192, 1204, - -1181, -702, -604, -770, 1032, -173, 770, 861, - 611, -509, 802, -467, 839, 491, -785, 523, - -669, 73, -34, 0, 0, -2, -3, -3, - 286, -2183, -1238, 1743, 387, -2228, -1404, -3439, - -1701, -2371, -451, 2294, 2061, 3062, -1122, -1489, - -1274, 51, 5649, -170, 2197, 365, -1, -13, - 4, 3, -5, -15, -4099, 789, 4132, 4982, - -1996, 784, 748, 2123, 3535, -1493, -1454, -344, - -867, 40, 831, -1198, 66, 542, 1633, -2402, - 117, -119, -18, 49, 18, 40, -500, 808, - -726, 1192, 3623, 1526, -484, 1080, -2502, -579, - 1315, -1887, 84, 1771, -2902, 1387, -1098, 1559, - -1126, 652, -896, 32, -1, 3, 1, 3, - -2, 233, 782, 8192, 566, -701, -352, 1047, - 581, -1070, 3159, -1157, -1585, 1599, -978, -663, - -931, -2581, 5074, 781, -551, -590, -247, -63, - -54, -50, 253, -138, -313, 387, -3004, -1136, - 654, -1283, 1318, 434, 80, -1486, 694, -512, - 393, -238, -700, -232, 706, 1478, -8192, 377, - 601, 18, -1, -3, 0, -6, -3, 2221, - 3531, -862, 1792, -242, -3686, 420, 1891, 918, - 1324, 234, -819, -601, 2363, -1097, 2355, 754, - -125, 245, -615, 3285, 204, 0, 6, -4, - -3, -1, -637, 673, 1233, 2886, 265, -195, - -226, 2521, 281, -210, 1809, -2733, -3865, -2287, - 641, -2604, -4235, 107, 789, 1163, -2600, -463, - -5, 10, 2, -10, 39, 1380, 754, -5077, - 4061, -1633, -1738, -1604, 1937, 1815, 1039, 3696, - -593, 2218, -1061, 1081, -1217, 2062, -637, -1580, - 149, -626, -253, -3, -17, 2, 33, 1, - 118, 525, 158, 1213, 910, -105, -1437, -1311, - 2255, -419, -2394, 1542, -3830, -1167, -998, -1099, - 1635, 1678, -1112, -275, 122, -50, 0, 3, - 0, -1, -1, 998, -4020, -1913, -1083, -159, - 1853, -436, -683, 298, 211, 711, 4128, -1977, - -958, 1048, 642, -420, 329, -1150, 459, 2161, - 29, -4, 0, -1, -6, 1, 1365, 1053, - 1032, 952, 854, 2405, 5106, 1863, 3049, 981, - -863, -397, 508, -1283, -631, 17, 532, -1453, - -1056, 66, 501, -27, -1, 3, -1, -13, - -2, -273, -2924, 839, -433, -395, -252, 1945, - 195, -307, -1297, -1474, -985, 4412, -1017, 1074, - 2711, 996, 919, 183, -10, -605, 38, 1, - -1, -1, 2, 1, 2115, -422, 3655, -1972, - 1473, -2033, 2461, -1112, -1267, 179, -394, -906, - -1273, -432, 1082, 367, -720, 1746, -657, 595, - 701, 16, -1, 0, 0, 2, -3, -255, - 443, -1840, -2379, 296, 258, -675, -221, 406, - -216, -6295, -1041, 1062, 199, 1705, -1032, -1627, - -2399, 198, -1097, -271, -99, 0, 1, -2, - 2, -13, 343, -219, -1447, 1779, 630, -1944, - -1093, -1578, -62, -1334, 2811, -815, 1311, -3102, - -300, 67, 24, 98, 764, -1246, 203, 6, - 0, -4, 0, 1, 0, -18, -1704, -1427, - -352, -2665, -588, 287, 715, -454, 688, -424, - 1736, -1124, 1028, -7581, -752, -482, -363, -75, - -720, -619, 449, 0, 3, 0, 16, -3, - -1211, 2484, 3490, -547, -705, 1776, -286, -1580, - 2896, -2257, -214, -1784, -1266, -562, -1170, -542, - 785, 1606, 535, 51, -1405, -7, -1, -1, - 0, -1, 2, -428, -579, -1091, -2627, 2287, - -757, 1445, -411, -160, 567, 108, -1305, -4356, - -390, -917, 345, -2169, -896, 3772, 1224, 691, - -25, 1, 1, 1, -2, 1, 281, 1365, - -1628, -585, 3485, 169, 746, -395, 1072, 1569, - -1073, 744, 1274, -3472, 1035, -906, -3394, -1537, - -869, 2841, 401, 4, -1, -3, -3, -1, - -3, -37, -1628, -888, 785, 3328, 1105, 3551, - 6946, -1688, 2690, -2051, -2212, -3750, -1903, -497, - 1251, 1187, -6198, 3930, 85, -1077, 16, -23, - -80, -130, 43, 66, -974, 579, -2047, -3607, - -666, -2248, 4619, 6846, 88, -649, 1129, -255, - 3567, -124, 41, 58, 634, -1252, 696, 2536, - -1590, 209, 12, -102, -275, 27, 216, 1110, - 259, -2091, 1775, -3768, 598, 441, -1809, -431, - 22, -991, -621, 84, -1803, 1585, 559, -1101, - 42, 456, -392, -874, -4, 0, 0, 1, - -1, 0, -371, -211, -339, -1232, 438, -2683, - -1007, 1250, 5343, 861, -1305, -577, 2107, -2649, - -3227, 1020, -127, 562, 5495, -3136, -414, -529, - 12, -53, -34, 151, 106, -2946, -575, -1796, - 3095, -257, -591, 126, 967, -547, -271, 560, - 974, -3335, -2110, -1403, 5915, -1108, 388, -1266, - -522, 336, 167, 1, -3, -2, 2, -3, - -312, 19, 3356, 1123, -676, -247, 697, 548, - 1768, 1174, -525, -253, -423, 546, -2373, -2940, - -1055, -2304, 203, 1309, -574, -8, 0, -3, - 4, 0, 4, -215, 8192, -670, -1289, -1547, - -304, 1498, -967, -529, -582, -2205, 1752, 321, - 573, -1096, 64, 1152, -87, 574, -250, 539, - 62, 7, 2, -1, -3, 3, -465, 243, - -1179, 828, -2501, -223, 198, -883, -740, 1113, - -1821, -2068, -3234, 1715, 1989, 1817, 727, 1640, - 3386, -1538, -864, 45, 0, -4, 0, 0, - 2, 608, -1495, 1259, -132, 1311, 350, 537, - 2735, 1428, 151, 1324, 547, -3983, -1892, 104, - 2023, 1908, -1042, 1130, 1252, -701, 9, 0, - -2, -1, 1, 1, 602, -8192, -2776, -661, - 1640, 443, 3452, -738, 829, 637, 292, 232, - 1352, 4879, 1429, 912, 649, 1593, 308, -330, - 68, 63, -3, 4, -57, 26, 25, 1250, - 400, -4839, 211, -2748, -664, 996, 341, -1053, - 321, 2458, 764, 743, -729, 12, -283, -346, - 118, -249, -153, -2329, -37, 0, -1, 0, - 1, 1, 352, -878, 2336, -634, -2690, -3415, - -2949, -531, 1259, 394, 163, -994, 845, 1259, - 890, 1400, 279, 1908, 161, -2174, 1876, 76, - 1, -1, -1, 10, 0, 47, -1123, 1611, - 489, 618, -816, -7, 2001, -1190, 1857, -2749, - -311, -331, 733, 1412, 1390, -1525, 1262, -1393, - -263, 3124, -98, 0, 1, 0, 1, -2, - 514, -3533, -2394, 3623, 249, -1056, 515, 1279, - 2821, 477, 183, 689, 1182, 1378, 1287, -711, - 1264, -713, -278, 217, -664, -225, -1, 0, - 6, 2, 9, -1171, 3119, 1340, -1229, -1929, - 1984, -1333, 1018, 10, 1205, 63, 358, -1108, - -455, -413, 854, -1550, -423, -180, 2529, -8192, - -18, 0, -2, -1, 0, 0, -678, 3819, - -1316, 1159, 590, -231, 2203, -1533, 986, 4289, - 1114, 1135, -1162, -921, -58, 691, 11, -1718, - -270, -531, 530, 65, 0, -1, 1, 4, - 0, -1184, -1359, 7230, -533, -2077, -1188, 113, - -1472, 490, 1518, 1476, -1885, 934, 244, 1840, - -696, -480, -2476, 3324, -2433, 1102, 120, 1, - -11, -2, 18, -3, -1016, 189, -3835, -1659, - -46, -180, -2659, 1998, -1437, 1107, -2248, 165, - -657, -5079, -224, 1246, 469, 421, 1145, 1148, - 84, -18, 3, 0, 0, -6, 0, -66, - -206, 2279, -220, 1606, -421, -1482, -413, -1237, - 374, 3691, 491, -774, 410, 791, 380, 3385, - 615, -950, -620, -197, 65, -1, 3, -3, - 2, -1, -484, 1396, 273, -3591, 1317, -1013, - 1563, -134, 602, -1069, 733, -1167, 233, 319, - -262, 350, 780, -407, -496, -1285, 1326, -13, - 0, 2, -1, 0, -1, -328, -626, -848, - 745, -1047, 4048, -380, -456, -1894, 869, -1085, - -373, 2829, 622, 473, 394, 237, -2175, 1167, - -4942, 246, 100, -1, 1, -6, 1, -6, - -70, 35, 1613, 2597, 1307, 1756, -1184, 1082, - 971, -2004, -1459, -494, -40, 745, 2788, -830, - 76, 536, -2002, 401, -57, -20, 0, 0, - 0, 0, 0, -8, 244, 1927, 1162, -2416, - -1414, 463, -89, 1217, -798, 394, -1527, -719, - -666, 998, 1518, -2455, -3049, -1174, -2696, -3119, - 2, 0, -2, 2, 2, 3, 1093, -623, - 1660, -1635, 1457, 2560, 763, -2750, 931, 1798, - 2550, 1402, 914, -919, 1931, -383, -435, -583, - 439, 9, -1106, -12, -1, 0, 0, 0, - -2, -335, -730, -2102, -1414, 2576, -3869, 1025, - -1657, -2, 857, -336, -3011, 205, 1108, 364, - -789, -179, 171, 331, 2204, 527, -13, 1, - -3, 2, 1, -4, -565, -211, -139, 1799, - 195, -877, -632, 358, -244, -1459, 1398, 2271, - 550, 1987, 2206, -337, 199, -7036, 589, 195, - -466, 72, -1, 2, 1, 0, 0, -27, -}; - -static const int16_t cb0806sm0[] = { - -8192, 389, 245, -67, -42, 79, 503, -488, - -310, 107, -13, -431, -203, 96, 510, 151, - 270, 0, 0, 0, 0, 0, -463, -23, - -72, -322, 74, 1589, -152, -198, 81, 1120, - -125, -434, -3275, -2210, -348, -344, 91, 0, - 0, 0, 0, 0, -254, -224, 46, -154, - -131, -465, -57, 8192, 345, 112, -725, -49, - 183, -191, 246, 263, 370, 0, 0, 0, - 0, 0, 39, -739, -6603, -2454, -95, 312, - -53, -392, 63, -165, 31, -505, 111, 484, - -535, 179, 143, 0, 0, 0, 0, 0, - 1279, -139, -1769, 244, 59, -135, -429, 707, - 809, -4355, -354, 428, -300, 108, -799, -1421, - 599, 0, 0, 0, 0, 0, 4, -5, - 7, 75, 49, 8192, 276, 200, 191, -167, - -14, 82, 222, -277, -483, -216, -441, 0, - 0, 0, 0, 0, 171, -423, 174, 401, - -517, -377, -234, -644, -829, -350, -976, -146, - -928, 296, 3003, 3545, -30, 0, 0, 0, - 0, 0, 161, -6753, 1138, -855, -132, -242, - 559, -225, -346, -168, 10, -481, -6, -1208, - 252, -323, -191, 0, 0, 0, 0, 0, - -262, 574, 433, -145, 622, 329, -2634, -439, - -1178, 351, -433, -842, 4125, 296, 305, 359, - -22, 0, 0, 0, 0, 0, -34, -56, - -1019, -247, -163, 305, 574, -51, -179, 24, - -1097, 248, -166, -18, 303, 252, -555, 0, - 0, 0, 0, 0, -400, -254, -256, 2783, - -296, -1904, 552, 1284, -336, -2371, 3396, -1092, - 102, 176, 140, 640, -359, 0, 0, 0, - 0, 0, 373, 473, -2167, -774, -388, 405, - -1402, -1391, -1319, -155, 1104, -533, 382, 1561, - -2958, 406, 787, 0, 0, 0, 0, 0, - -3800, -58, 2098, -181, -570, 385, -4125, 759, - -1584, 9, -278, 201, -528, -527, -435, 436, - 681, 0, 0, 0, 0, 0, 30, -80, - -60, -4031, -70, -3367, 316, -861, 67, -169, - -144, 1598, 966, 32, -1263, -434, -738, 0, - 0, 0, 0, 0, 181, 12, 115, 91, - 253, 518, 517, 216, 830, 336, -568, -3125, - -796, -847, 1627, 58, -158, 0, 0, 0, - 0, 0, 48, -851, -286, 393, 390, 707, - 595, 427, -235, -116, 814, -198, 6145, -1590, - 647, 15, -259, 0, 0, 0, 0, 0, - -621, 152, 590, -16, 215, -633, -784, -140, - 1087, 723, -4191, 2701, 951, -972, 273, -554, - 387, 0, 0, 0, 0, 0, -124, -2939, - -38, 383, 234, 687, -2873, -466, 61, -472, - 854, -396, 305, -233, 82, -2677, -206, 0, - 0, 0, 0, 0, -120, -246, -614, -394, - 8192, 75, -450, 177, -251, 45, -142, 65, - -1248, -14, 389, 375, 114, 0, 0, 0, - 0, 0, 2870, 158, -473, -166, 928, -618, - -1909, 224, -931, 1898, -16, 427, 447, -1044, - 85, -333, 197, 0, 0, 0, 0, 0, - 78, 114, -167, 73, -1070, -80, 3512, -3004, - -1553, 769, 213, 851, -377, 978, 1097, 71, - 66, 0, 0, 0, 0, 0, -129, 248, - 455, -376, 344, 128, -60, 546, -321, -7898, - -719, -55, -941, 1242, 207, 215, 323, 0, - 0, 0, 0, 0, -24, -225, 136, 142, - -739, -117, 2, 242, -152, -20, -1775, -484, - -36, -408, -2767, -471, 251, 0, 0, 0, - 0, 0, 22, 111, -180, -7417, 365, 293, - -313, 1031, -191, 154, -210, -239, 121, -333, - -1504, 209, 146, 0, 0, 0, 0, 0, - 898, -643, 3080, 528, -91, -718, -512, 275, - -3564, 396, 160, -850, 346, -595, 1558, 684, - -310, 0, 0, 0, 0, 0, 234, -419, - -724, -433, 292, -1003, 682, -117, -1318, -914, - -5137, 128, 53, 291, 408, 1269, -284, 0, - 0, 0, 0, 0, -252, 190, -2911, 130, - 255, -172, -4331, 26, -267, 280, -133, -613, - -1063, -1135, 759, -1290, 216, 0, 0, 0, - 0, 0, 133, -177, 4069, -311, -197, 3260, - 341, 201, -117, -515, 105, -658, 975, 81, - -333, -333, 262, 0, 0, 0, 0, 0, - 273, -87, 321, 190, 1385, 274, 182, -2553, - -150, 164, -830, 89, -459, -5279, -624, -336, - 399, 0, 0, 0, 0, 0, -172, -232, - 11, 45, 121, -254, -457, 196, -3487, -838, - 512, -310, -2831, -85, 98, -145, -331, 0, - 0, 0, 0, 0, -55, -149, 2068, -61, - 3087, -143, 1574, -1381, 2853, 1899, -453, -580, - -137, 1211, -1413, 171, 125, 0, 0, 0, - 0, 0, -228, 30, -956, 5569, 209, -89, - 25, 573, -1669, 507, 182, -132, 697, -132, - -2964, -637, 139, 0, 0, 0, 0, 0, - -3078, -3278, -771, 928, -38, -463, 820, 1141, - -1234, 620, 652, -1710, -382, -1618, -409, 179, - 483, 0, 0, 0, 0, 0, -102, 4256, - -20, -162, 2021, 730, 1439, 2776, 459, 498, - -152, 482, 35, -271, 810, -1345, -249, 0, - 0, 0, 0, 0, 131, 5, -281, 431, - -2498, -1046, 482, 842, 297, -311, -1260, 148, - -906, -4217, -1411, -102, -361, 0, 0, 0, - 0, 0, 116, -3083, 235, -1195, -19, -646, - 42, 487, 309, 1654, 1051, -1643, 689, -823, - 2279, 1488, 571, 0, 0, 0, 0, 0, - 42, -95, -3, 36, -170, -114, 8104, 217, - 140, -217, 599, -774, -64, -675, -211, 166, - 204, 0, 0, 0, 0, 0, 99, 594, - -48, 224, 52, -1499, 271, 2224, -219, 3184, - -165, 828, -1345, -785, 181, 133, 124, 0, - 0, 0, 0, 0, -235, -286, 254, -171, - -4980, -453, -1432, 12, 734, -391, -640, 339, - 537, 313, -700, 1016, 148, 0, 0, 0, - 0, 0, -49, -19, 803, 935, 520, -90, - 641, 1053, -454, 2338, -6071, -478, 616, -559, - -339, 445, -1464, 0, 0, 0, 0, 0, - -175, 111, -132, 65, -264, 732, 221, 231, - -1972, -305, 325, -859, 583, 1272, -441, 2651, - 229, 0, 0, 0, 0, 0, -286, -4646, - -262, 593, 613, 936, 310, -615, 83, 223, - -816, 1910, 2041, 281, -190, -434, 114, 0, - 0, 0, 0, 0, -123, 684, -208, 524, - -606, -1223, 264, -983, -109, -1057, 696, 195, - -521, 945, -7503, 193, -120, 0, 0, 0, - 0, 0, 98, -358, -2165, 244, 277, 393, - 771, 3360, -258, -1218, -122, -1253, -2297, 806, - -198, 540, 7, 0, 0, 0, 0, 0, - 78, -281, -368, 2809, 159, 2611, 833, -120, - -3987, 933, 360, -49, -515, -106, -360, 650, - -125, 0, 0, 0, 0, 0, 203, 1369, - 749, -502, -2295, -326, 448, -309, 630, -84, - 345, -520, -4, -623, 1066, -3915, 373, 0, - 0, 0, 0, 0, -4603, -794, -625, -355, - 1071, -601, -553, 593, -296, 626, -328, 621, - 85, 1348, 92, -288, 204, 0, 0, 0, - 0, 0, -9, 602, -162, -749, -104, 464, - -372, -1375, -1905, 2200, 61, -3308, -897, 634, - 1036, -2112, -182, 0, 0, 0, 0, 0, - -76, 2341, -675, -72, -29, 704, -536, 1656, - -541, -736, -1420, -1539, 2458, -228, 674, -1258, - -3, 0, 0, 0, 0, 0, -133, 1111, - 63, 327, 470, 1226, 541, -276, -3042, -1594, - -3192, 357, -617, 658, -315, -978, 631, 0, - 0, 0, 0, 0, 111, -188, 619, 236, - 104, 54, 545, 424, 5912, -332, 711, -1249, - -533, 291, -1544, -216, 113, 0, 0, 0, - 0, 0, -199, 267, 152, -301, -172, 1294, - 2311, -482, -2451, -82, 1833, 214, 130, -1183, - -2212, 403, -625, 0, 0, 0, 0, 0, - -106, 662, -48, -131, 324, 2337, 445, 462, - -349, -189, 669, 4945, -1797, 16, 268, -602, - 2, 0, 0, 0, 0, 0, 55, 154, - 892, -35, -145, 357, 562, 42, -9, -284, - 177, 84, 422, -181, -358, 7618, 29, 0, - 0, 0, 0, 0, -353, 68, -41, -4096, - 177, -20, -267, 782, 954, -430, 1573, -696, - 1785, -3611, 89, -243, 683, 0, 0, 0, - 0, 0, -220, 1983, -891, 614, 226, -202, - 67, 761, 1904, 179, 226, 416, -657, -3409, - 1026, 2834, -438, 0, 0, 0, 0, 0, - -551, -229, -304, -462, -2277, -419, 451, -122, - -108, 258, 784, 1105, 382, 137, 5695, -241, - -491, 0, 0, 0, 0, 0, 34, -272, - -1687, 1769, -332, 365, 33, -2594, 3729, 325, - 85, -295, -290, -152, 2238, -611, -41, 0, - 0, 0, 0, 0, 102, 166, 241, 1098, - -107, 775, -414, 4256, -277, 935, -200, 495, - 255, 1144, 468, -184, -59, 0, 0, 0, - 0, 0, 94, -282, -57, 12, -390, 245, - 1872, -620, 1089, 3754, 432, 947, -509, -284, - -3836, 26, 482, 0, 0, 0, 0, 0, - 9, 971, -373, 1111, -480, 2342, -182, 528, - 802, 1196, -1017, -879, 499, 2800, -830, -230, - -4, 0, 0, 0, 0, 0, -382, -815, - -1669, -2437, -593, 193, -688, 632, 479, 2883, - 565, 540, 5, 1598, 1618, -640, -246, 0, - 0, 0, 0, 0, -421, -103, 1482, -3026, - -65, -101, 4, 3921, 688, -941, -234, 49, - 202, 1905, 935, -1155, -4, 0, 0, 0, - 0, 0, 210, -625, -118, -3215, 344, 978, - -10, 773, -126, -804, -1534, 182, -1146, -646, - -146, 2011, 463, 0, 0, 0, 0, 0, -}; - -static const int16_t cb0806sm1[] = { - 35, -237, 547, 705, -9, 1612, 382, 195, - -191, -250, -101, -357, 709, 153, 850, -5091, - -100, 0, 0, 0, 0, 0, -6406, -158, - -527, 137, -330, 580, -484, 63, 541, -1245, - -205, 138, 247, -489, -147, -132, -863, 0, - 0, 0, 0, 0, 53, -38, 283, -22, - -1506, -467, -418, 117, 133, -2152, -48, -991, - 808, -1047, 2402, 261, 423, 0, 0, 0, - 0, 0, -14, 500, 4697, -174, -544, 87, - -379, -243, 577, 682, 258, -1190, -1984, 599, - 607, -123, -290, 0, 0, 0, 0, 0, - 60, 4254, 194, 888, -81, -395, 422, -1786, - 916, 288, 1191, -658, 502, 2177, -977, -301, - 587, 0, 0, 0, 0, 0, 232, 204, - -452, -853, -4266, -219, 1164, 92, 91, 1561, - 950, -705, -1217, -734, 1617, 120, -324, 0, - 0, 0, 0, 0, -3442, -456, -667, 987, - -89, 1383, -704, -187, -280, -583, 341, -732, - 649, -2129, -3505, -175, -215, 0, 0, 0, - 0, 0, 200, -635, -471, -1221, 215, 2844, - 1633, 522, -720, 1722, -272, 473, 198, -604, - 480, -88, 169, 0, 0, 0, 0, 0, - -160, -268, 130, 284, -612, 95, 43, 42, - 641, -258, -6884, -167, -689, 123, 276, -592, - 717, 0, 0, 0, 0, 0, 313, -90, - -4310, 2706, -1708, 648, -796, 791, 998, -468, - 632, 1893, 43, 1937, -1279, -22, -64, 0, - 0, 0, 0, 0, -106, 135, -287, 335, - -7999, 51, -250, -388, 16, 285, -101, 685, - -944, 604, -624, -792, 209, 0, 0, 0, - 0, 0, 496, -205, 422, 49, 274, -229, - 220, 73, -734, 381, -394, -8192, -405, 755, - -9, 46, 116, 0, 0, 0, 0, 0, - -28, 332, 1152, -129, 244, 84, -2193, 632, - -1854, -384, 110, -302, -270, 435, -1689, -797, - 686, 0, 0, 0, 0, 0, -1660, 624, - -664, 2611, 30, -1155, -419, -3539, -568, 1719, - -1374, -676, -55, -1934, 863, 1391, 433, 0, - 0, 0, 0, 0, -1012, 290, 2302, -330, - -95, -2355, -55, -763, -1995, -298, -680, 715, - -85, 1615, 1011, -1989, -1028, 0, 0, 0, - 0, 0, 21, -5001, 507, -58, 229, -37, - -113, 632, 1809, -62, 334, -1201, -893, -344, - 98, 438, -65, 0, 0, 0, 0, 0, - 0, 143, 131, -18, -135, -306, 392, 232, - 265, 543, 376, -562, 362, 2458, 785, 3653, - -456, 0, 0, 0, 0, 0, 855, -4009, - -1207, 118, -86, -223, 266, 154, -1886, -1145, - 241, -397, 246, 244, -776, 808, -132, 0, - 0, 0, 0, 0, 2, -633, 113, -94, - -154, -173, -162, -168, 439, -6548, 778, -392, - -60, 99, -1901, 171, -130, 0, 0, 0, - 0, 0, -11, -324, 711, -903, 560, -1654, - 1473, -300, 1048, 137, -1140, -1115, -1302, -1008, - -792, -3264, -540, 0, 0, 0, 0, 0, - -347, 78, -103, -7, -3, 437, 6053, 299, - -435, 323, 664, 477, 1097, 158, 656, 273, - 200, 0, 0, 0, 0, 0, -101, 80, - -153, 144, -235, 492, -399, -3, 4958, 699, - -586, -162, 153, -860, 161, 665, 4, 0, - 0, 0, 0, 0, -87, -189, 1744, -350, - -1840, 325, -2354, 1193, 1386, -1589, 80, 1055, - -188, 273, 807, 2038, -419, 0, 0, 0, - 0, 0, 50, -185, 68, -59, -9, 78, - -585, -121, -7888, 771, -908, -284, 349, 158, - -1122, -139, -189, 0, 0, 0, 0, 0, - 310, -286, 235, -687, -919, -364, -697, -253, - 492, 300, -238, 272, 518, -525, -5863, -190, - -59, 0, 0, 0, 0, 0, 151, 616, - -4420, 227, 240, -252, 516, -250, 68, 411, - -192, -87, -607, 671, 1281, -317, -305, 0, - 0, 0, 0, 0, -9, 817, -451, -1079, - 86, 5060, -1157, -1159, -421, 302, 1636, -316, - -66, -518, 1010, 1068, 96, 0, 0, 0, - 0, 0, -576, -362, 107, 3516, 303, -364, - -402, 805, 574, 993, -554, 298, -925, 410, - 1898, 13, 138, 0, 0, 0, 0, 0, - -340, -150, 528, 142, -464, 1034, -397, 3944, - -697, 962, 902, 1393, 2212, -1021, -1034, -961, - -319, 0, 0, 0, 0, 0, 58, 38, - 382, 221, -212, 826, -1373, -4559, 1329, -123, - 216, -23, -736, 95, -300, -418, -4, 0, - 0, 0, 0, 0, -58, 7814, 218, 141, - -90, -124, 455, -27, 49, -311, -364, 80, - -136, -1257, 96, 332, -287, 0, 0, 0, - 0, 0, -8, 624, 127, 1857, -480, -869, - -575, -1461, -493, -261, 97, 32, -328, -467, - 173, -2588, 132, 0, 0, 0, 0, 0, - 5257, -1037, 191, -844, 247, 130, -571, -548, - -496, 216, -161, 336, 62, 990, 130, 517, - -65, 0, 0, 0, 0, 0, -89, 9, - -138, 405, -701, -479, 3605, 699, -629, -102, - 27, -1374, -1059, -18, -2707, -172, -557, 0, - 0, 0, 0, 0, -67, 209, 571, -93, - -405, -172, -260, -19, 86, 22, 659, -630, - 222, -8192, 106, -34, 60, 0, 0, 0, - 0, 0, -10, -3386, 336, 651, -1377, 681, - -16, -45, -382, 1102, -280, 169, -822, 522, - 434, -1111, -299, 0, 0, 0, 0, 0, - 194, -445, -231, -532, -438, -180, -591, -1680, - 179, 5921, -184, -685, -467, 875, -573, 282, - 235, 0, 0, 0, 0, 0, 339, 139, - -745, -68, -201, 467, -743, 477, -23, -1177, - 1384, -357, -1254, -3760, 454, 1175, 252, 0, - 0, 0, 0, 0, 109, -252, 8027, -765, - 136, 111, -86, -593, -84, -750, -121, 782, - 739, -296, 284, 213, -1196, 0, 0, 0, - 0, 0, -40, 69, 1992, 452, -75, -84, - 683, 1678, -1350, -1846, 3068, -749, -1410, -271, - 536, 1120, 117, 0, 0, 0, 0, 0, - 4053, 340, 108, -88, 411, 990, 217, 3675, - 755, 752, -206, 205, -297, -573, 188, 127, - -313, 0, 0, 0, 0, 0, 47, -2870, - -3417, 216, 1730, -83, 189, -1615, 1016, -44, - -502, 2151, 6, -1057, 550, 194, -498, 0, - 0, 0, 0, 0, -133, 1, -387, -497, - 586, 173, 923, -4078, -1232, 329, -2086, -185, - 592, 681, 3320, -914, -327, 0, 0, 0, - 0, 0, -132, 493, -179, 220, 142, -4345, - 422, -173, 357, 1317, 240, -525, 1613, -178, - -1584, -734, 549, 0, 0, 0, 0, 0, - -337, 111, -1238, 116, 302, 325, 189, 610, - -3180, -284, -817, 1383, 1559, -802, 422, 438, - 460, 0, 0, 0, 0, 0, -96, 372, - 335, -843, 3967, 221, 380, 227, 309, 447, - -199, -257, 372, -397, -534, 736, -152, 0, - 0, 0, 0, 0, -144, 463, -54, -288, - -83, 115, -574, -229, 485, -2643, 58, 4312, - -1155, 642, -647, 1122, 118, 0, 0, 0, - 0, 0, 157, 6, -1017, -1155, 687, -288, - 918, -212, -332, -2486, -197, -1025, -546, 4099, - 155, -731, -333, 0, 0, 0, 0, 0, - -43, -496, -546, -541, 283, -521, -47, -18, - 208, -552, 1899, 2107, 588, 818, -911, -1104, - -84, 0, 0, 0, 0, 0, -71, 40, - -326, 92, 216, -106, -255, 28, 120, -58, - -2720, -133, -288, -28, -1157, 1563, 400, 0, - 0, 0, 0, 0, 40, -4, 559, 1350, - 30, 3905, -675, -1092, -587, -1524, -1987, -1031, - 1892, -679, -623, 1051, -33, 0, 0, 0, - 0, 0, -98, 106, 105, -5887, -463, 424, - -42, -506, -589, 376, 840, 140, -640, 771, - 23, -441, -6, 0, 0, 0, 0, 0, - 22, 203, -3452, -635, -605, 1668, 422, 2973, - 394, -1605, -968, -739, 344, -1438, 820, -1318, - -26, 0, 0, 0, 0, 0, 258, -32, - 1061, 643, -152, 92, -454, -1305, 1621, 554, - 344, 82, -404, 5222, -344, 286, 177, 0, - 0, 0, 0, 0, 63, -360, -127, 814, - 3639, -3322, 390, 12, -515, -493, 1515, 1706, - -727, 394, 1164, 357, -208, 0, 0, 0, - 0, 0, -27, 648, -342, -125, -327, 194, - -3639, 598, 29, 244, 898, -493, 372, -635, - 567, 31, -237, 0, 0, 0, 0, 0, - -160, 2798, -1768, -2186, 493, 517, -82, -468, - -290, 2890, -460, 450, 414, -265, -1121, 219, - -1115, 0, 0, 0, 0, 0, 14, 76, - -2806, 338, -1429, -402, 253, -130, -235, -799, - 309, -525, 3823, 175, 36, 113, 247, 0, - 0, 0, 0, 0, 352, 521, 213, -107, - -71, -762, 790, -856, -252, -246, -729, -631, - 1258, -3276, 1534, -436, -635, 0, 0, 0, - 0, 0, -54, 118, -453, -124, -32, 539, - 356, -169, -202, -590, 721, -444, -6260, -275, - -239, -105, -52, 0, 0, 0, 0, 0, - -464, 507, -796, 1273, 2297, 790, 652, 392, - 3364, -1949, 2154, -701, -229, 99, 88, 471, - -524, 0, 0, 0, 0, 0, 71, -914, - 1835, -156, -242, -196, 513, 431, -481, -84, - -734, 4501, -510, 115, 461, -428, 83, 0, - 0, 0, 0, 0, -3987, 1063, -717, -2640, - -963, -667, -147, 536, -68, 422, 341, -1916, - -616, 996, 522, 568, 1174, 0, 0, 0, - 0, 0, 8, 112, 693, 392, 445, 5309, - 259, 121, 1670, 343, 176, 472, 197, 419, - -240, -1178, -107, 0, 0, 0, 0, 0, -}; - -static const int16_t cb0808l0[] = { - 164, -3637, -3563, -243, -123, -47, -87, -32, - 62, 129, -2, 131, -36, -202, -197, 37, - -35, -442, -139, -69, -59, 29, -62, -67, - -17, -42, 74, 10, 107, 74, -109, 40, - -10210, -33, -3210, -410, -106, 512, 40, -17, - 109, 67, 99, 170, 53, 34, -68, -16, - 3895, -71, -116, 1, 608, 66, -215, 34, - 77, 50, -45, -73, 3, 11, -33, 18, - -34, 58, 25, 4420, 96, 77, -67, 23, - -83, -6724, 226, -32, -150, -154, 30, -12, - -8, -7, 89, 42, 173, -51, 38, -1852, - 40, -48, -40, 81, 34, 81, 66, 16, - 20, 3, 99, 41, 123, 52, 154, 20, - -38, 6, 10889, -44, 22, -39, 55, -34, - 25, -45, -22, 139, 19, -20, -64, -2242, - -473, -113, 316, 127, -31, 128, -363, -124, - 196, 259, -60, -3792, -41, -103, 104, -80, - -389, 179, 110, 83, 3174, 60, -197, 101, - 66, -47, -107, 96, -27, 45, -21, 6, - 116, -51, -8, -594, 377, -279, 158, -159, - 4595, -163, -210, 19, 3, -292, -67, 14, - 115, -41, -125, -154, -263, -101, 4, -11, - -89, 130, 58, 32, 92, 16, 126, -93, - -99, -4239, -69, 88, 5, -113, -18, 35, - 31, -48, -16, 35, 62, -2839, 14, 121, - 19, 41, 125, -102, 26, -13144, 6, -30, - -7, 60, 4, 36, -40, -26, 54, -57, - -9, -30, 13, -1, 73, -131, 29, 256, - 39, -51, -12, 1788, 4, 10, -58, 17, - -36, -2, 13, 59, -20, -21, 173, 129, - -435, -107, -214, 33, 3078, 13, 31, 148, - -2975, -311, 38, 25, -247, -542, 34, 106, - -392, 85, -203, 182, -232, 423, 629, -183, - 800, -466, 3145, -2498, -305, 39, 22, 41, - 0, -14, 671, -181, 3197, 109, 2900, 72, - -64, 8, 414, 133, 244, -263, 53, -69, - 70, -13756, -13, 21, 50, 12, -14, -12, - -7, 97, -32, 24, 51, -24, -29, 53, - 34, -19, -2341, 976, 25, -58, 18, -48, - -2490, -55, -31, -165, -36, 28, -26, 92, - 60, 137, 69, -5341, -125, 1966, -154, -66, - -13, -84, -13, 81, -46, -96, 50, -50, - -114, 15, 30, -211, -147, -555, 3998, 88, - 358, -159, -105, -51, -109, -16, 70, 91, - 268, 125, -95, -62, 38, -3227, 3591, -15, - 92, -72, 115, 144, -40, 142, 172, 72, - -17, 23, 1, 28, -38, -135, 220, -80, - -179, 9, -32, -6, 37, -33, -3, -89, - 7314, 5, 194, -13, 23, 31, 42, 84, - 197, -163, -251, -273, 193, 206, -613, 394, - 3469, 2587, -701, 62, 301, -104, 200, 164, - -201, -473, 52, -473, 128, -381, 404, -69, - -230, -537, 157, 389, -7, 2783, 3058, 95, - -59, 1618, 1, 4, 53, -6, 28, 10, - 2, 82, 28, -8, -14, 25, 59, 10, - -4, 36, -777, -4984, 29, 8, 85, -43, - -137, -34, 53, -58, 1, -27, 91, 15, - 80, -19, -186, 467, 94, -382, 129, 327, - 3053, -221, 399, -2821, 1090, 278, -2, -163, - -398, 126, -266, 180, -235, 70, -18, -34, - -45, 159, -32, 66, 11, 3177, -188, 27, - 35, -52, 114, -28, -136, 186, 2146, 100, - 92, 6, 58, -70, 159, -14, -32, 9, - 6, -27, -73, 28, 23, -24, 101, 148, - 80, -52, -27, -53, -36, 4, -74, 47, - -30, -108, 34, 7213, 12, 31, -17, -185, - 3318, 199, 192, 3450, -87, 3, 47, 46, - -141, 49, 83, -82, -132, -82, 68, 138, - -1031, -236, 390, -37, 23, -94, -7, 9, - -2958, -1846, -43, 23, 25, -79, -193, -77, - -3332, -3355, -139, 56, 163, -3302, -82, -25, - 35, 96, 73, 166, -154, 174, -121, 14, - -89, 101, -3751, -344, -240, -35, 401, -14, - 47, -49, 24, -78, 24, 6, 68, 51, - -145, 20, 83, 57, 147, -100, 60, 33, - -53, 11, 37, -5793, -93, -67, -9, 117, - 112, -51, 60, 48, 49, 328, 293, 127, - -314, -3022, 374, 3283, -86, 588, -346, 436, - -7, -26, -88, 104, 205, 150, 147, 34, - 126, 85, 46, -125, -119, 75, 13, 144, - 3721, 275, -71, 43, 163, -73, -292, -381, - -79, 33, 79, -79, 34, -94, 18, 229, - 63, 28, -44, 97, -3606, 77, -95, -162, - 163, 62, 6180, 81, -51, -19, -5, 109, - 71, 7, -37, -100, -31, -94, 188, 169, - -14, 2606, -417, 18, -4371, -25, 180, 108, - 17, 33, 48, -46, -93, -77, 32, -37, - -71, -271, -48, -273, -14, 115, -59, -312, - -3334, -3046, 71, -166, 379, 209, -142, 22, - 89, -41, -40, -7, -50, 8, -15, 12, - -70, -27, -27, 25, -31, 38, -5, 2831, - -89, -8, -50, -110, 1368, -59, -2307, 6, - 179, 75, 189, 170, -55, 330, -70, 172, - 67, -492, -57, -3408, 9, -93, -11400, 14, - -1, -21, 65, -15, 45, -22, 40, -10, - -41, 23, -29, -96, -55, -66, -57, -61, - -29, -15, -101, -9831, 33, 42, -35, 42, - -44, -58, 11, -40, 27, 21, 715, -315, - -255, -115, 1736, 4, 41, -70, -51, -108, - 160, -9, 87, -6, 36, -20, -68, 10, - 82, -33, -42, 15, -57, -40, -31, 21, - 10023, 62, -41, -10, 85, -65, -12, -61, - -72, -610, 128, -76, 198, 367, -4564, 60, - 158, -13, -134, -45, -33, -11, -51, -72, - 111, -188, 232, -494, -27, 42, 46, -23, - 137, 3174, -3598, 211, 152, 155, -299, 56, - -23, -123, 132, 50, 28, -64, 28, 9, - -17, 31, 112, -19, 4, 45, -7175, 54, - -61, -7, 87, 164, 195, -29, -48, 28, - -60, 70, -69, 112, -295, 5, -89, 38, - 36, -11501, 17, -26, -64, -222, 91, -23, - -89, 0, -94, 2191, -74, -84, -61, -41, - 57, 24, -35, -28, -37, 486, 131, 3699, - -277, 64, -125, -243, 270, 313, -112, 145, - 47, -2862, -254, -110, -27, -69, -342, -120, - 216, 35, 24, 62, -39, -29, 2402, -7, - -3, 14, -47, -27, 4, 27, 20, 81, - 138, 75, 178, 421, -2943, -3080, -84, -40, - -58, -195, -182, 101, -187, 6, -83, 269, - -32, -99, 51, -38, 44, 82, -14, -35, - 0, 8, -23, 10754, -73, -57, 68, 107, - 85, 77, 101, 1, -28, 103, -10, 48, - 55, 33, -93, -18, 8, 28, -14, -575, - 28, -11712, 90, -186, 58, 38, -42, 2156, - -82, 28, -23, 43, 43, 8, 25, 65, - 0, -53, 28, -88, 388, -36, 363, 64, - 3068, 56, 320, -202, -3433, 73, -339, -157, - 373, -216, -43, 171, 140, -437, -143, -2820, - -101, 53, -111, 65, -39, 65, -30, 69, - -55, 49, 45, 126, 174, 220, 73, -101, - -60, -151, -13, -41, -48, -9, 25, -122, - -80, -2450, 19, 94, 14, -18, -19, 60, - -3252, -10, 3390, -15, -365, -15, -73, -222, - 307, 70, -95, 237, -142, -163, -44, -138, - -7, 6, -36, -67, 9, -22, 10235, -56, - -8, 44, -155, -117, -22, -32, -74, -14, -}; - -static const int16_t cb0808l1[] = { - -58, 222, -154, -74, -53, 4939, 421, 67, - 26, 132, 60, -97, -1, -43, 328, 2, - 460, -66, -11, -45, -56, -86, -10569, -129, - 58, -25, 39, 28, 26, 45, -61, -139, - -22, -135, -282, -517, -368, 55, -47, 30, - -110, 47, 75, -13, 65, -41, 104, 4745, - -149, -99, 28, 421, 517, -56, 81, -309, - 67, -42, -6, 17, -60, -151, 50, -84, - -9, 29, -72, -3019, 82, -195, 41, -14, - -206, -34, -58, -18, 30, 2154, -20, 2, - -1, 41, -10, 7, 86, 494, 123, 328, - 73, 213, -29, 17, 43, -92, -61, -9, - -130, -113, 33, -28, -6677, -198, -185, -236, - 183, -108, 739, 60, 98, -314, 66, 10, - -3161, -159, -2850, 118, 37, -41, -119, 3087, - 43, -36, 42, 106, -174, -3379, -92, -142, - -237, 94, -59, -123, -117, 144, -75, 146, - -268, 561, -1160, 336, 1477, 207, 89, 130, - 127, 3763, -372, 48, 99, 204, 84, 209, - 103, 118, 125, 326, -29, -206, 139, -61, - 94, 77, 6624, -163, 23, 27, -104, 150, - -76, -205, -186, -30, -227, -58, 17, 25, - -6536, -19, -66, -45, -72, 41, 49, -79, - 105, -4, -117, -37, -183, 216, -27, -23, - -31, -2720, 53, -23, -46, -9, -10, 50, - -12, -50, -56, 35, 5498, -110, -2, 44, - -1, 13, 52, -18, -61, -80, -29, 25, - 61, -37, 93, -19, 67, 75, -41, 254, - 161, 118, -3379, 398, -9, -208, -143, 207, - -135, -32, 171, 187, -194, 466, -55, 158, - 34, 105, 4986, 27, -41, 20, 87, -110, - 39, 80, -37, 8, -25, -44, -108, -171, - -366, 208, -225, 1, -124, 21, 81, -10349, - -51, 33, -51, 141, -36, 106, -100, 320, - 122, 3, 266, 72, -8, -112, 55, -107, - -4154, -69, 0, 71, -153, -80, -50, 20, - -112, 225, -1982, 273, -19, -127, 109, -25, - 47, 57, -98, -10, 42, -25, 10, 24, - 41, -73, 45, -3523, -370, 3213, 54, -87, - 67, -185, 100, -33, -41, 3, -38, 70, - -108, -120, -67, -144, -181, -33, -104, 429, - 89, 849, 3022, -2765, -341, 184, -248, 610, - 408, -222, 184, 84, -64, 479, -146, 47, - -100, 13, 17, -7, 58, -13, -36, -23, - -1, -25, 10, 2666, -113, -41, -140, 3064, - 105, 31, 3042, -75, -132, -113, 80, -100, - -39, 216, -4, 7, -43, 242, 19, -1031, - 731, -3659, -24, -20, 109, 126, 2980, 19, - -11, -48, 57, -138, -11, -211, -151, 540, - -113, -110, 0, -415, 150, -80, -80, 209, - -82, -5212, -125, 376, 8, 131, -138, 30, - -922, -320, 181, -75, 138, -112, 146, -72, - 64, -75, -262, 4872, -11, -61, 37, -205, - 48, -2257, 82, 106, 93, -66, 48, 71, - 29, 72, 32, 29, 17, 5, 34, 29, - -29, -72, 50, -7702, -114, -117, 47, 11, - 19, 100, 48, -28, -8, 53, 21, 80, - -43, 37, 164, 22, -15, -5258, -23, -32, - 108, 52, 7, -161, 11, 84, 141, -8, - -12, -25, 111, 146, -96, 66, 7388, 54, - 17, -54, 62, 44, -66, -13, 26, 13, - 85, -79, -21, 98, 156, 181, -103, -188, - -35, -179, 83, 117, -92, 49, -185, 3800, - -90, 14, 42, 94, -83, -178, -156, -8, - 33, 42, 204, 42, 1, -85, 47, 10, - 10804, 36, 8, 26, -47, -51, -189, 83, - -47, -23, 104, -7142, -67, 55, 21, 68, - 8, -84, -60, -43, 142, -41, 27, -72, - -70, -170, -141, 202, -198, -105, 41, -3553, - -34, -148, 34, -62, -161, -20, -73, 128, - 162, -8343, 4, -71, -46, 12, 27, 48, - -41, 50, -19, -88, 7, 79, 29, -19, - -31, -49, -147, -1886, -103, -213, 28, -183, - 4119, 87, 6, -6, 51, -190, -167, -116, - 23, -26, 7, -38, 5442, -1869, -81, 197, - 105, -122, 65, 220, 32, -57, -39, -15, - 4, 112, -55, -139, -825, 985, -109, 2558, - 218, 94, 65, -184, 3269, 101, -65, 42, - 372, -38, 58, 8, -143, -544, -268, 121, - 38, 61, -63, -10, -30, -52, -76, -74, - -6690, -5, -160, 76, -77, 74, 374, -917, - 239, -203, 550, -84, -305, 292, -51, 36, - 135, -79, 27, -69, -309, 4561, -67, 11, - -60, 43, 18, -2, 8, -15, 20, 22, - -2, -41, -2396, 37, -79, 67, 27, -84, - 353, -213, -2336, 58, 39, 126, -78, -98, - -90, -3, -9, -43, -2, -29, -5, -149, - 42, 98, -109, 137, 58, -83, -38, 51, - 6525, 50, 97, -31, 8, 132, -71, -55, - 11, 120, 2, -43, 136, -37, -85, 150, - 133, 67, -41, -452, -104, 4, 126, 100, - -2660, -108, -109, -64, 615, -75, 45, 10, - -57, -57, -108, 167, -218, -10, -331, -26, - -21, 6561, 73, -599, 126, -23, 250, -103, - -4, -28, -20, -35, -19, 51, 9, -25, - -40, -11220, -2, 28, -12, 23, 3481, 169, - 159, -217, -48, 114, -93, -34, -191, -63, - 31, 182, 79, 90, 55, 67, -145, 409, - 190, -7791, -26, 18, 71, -113, -80, 69, - -21, -27, -121, 51, -148, 103, 196, 2726, - -67, 3022, -28, 26, -99, 51, 24, 61, - 104, 89, -57, -23, -112, 43, 6, 13, - -184, -168, 117, -29, 1865, -3, 20, 8, - 30, 32, -81, 80, -20, -59, 37, 19, - -107, -3920, -259, 44, 23, -129, 24, -66, - -27, -3071, 116, 9, -76, 56, -83, 25, - 54, -20, 2, 230, 56, -41, 131, -15, - -62, 61, 56, 74, -34, 110, 4606, -4, - 18, -47, 331, -106, -78, 70, 53, 70, - -22, 77, -71, -60, -101, 70, 7, 104, - -7, 39, -27, 7210, 253, -15, 0, -96, - 32, 50, -10, 33, 2058, 11, -15, 42, - -14, 51, 4, -3, -11, -86, 10, 33, - 21, -18, -31, -7, 53, -7, 95, 7, - 75, -11314, 7, 17, -16, -83, -475, -887, - -1141, 1, -101, 5, -46, 110, -90, -47, - -15, 19, 66, -4078, 104, 43, 105, -126, - 181, 43, -1655, -81, -11, 33, -33, 33, - 28, -44, 35, -6, -38, 68, -40, 67, - 73, -29, 171, 11982, 42, -8, -66, -66, - 40, -19, 14, 33, -63, 24, 94, -94, - -106, 584, 330, -108, -3841, 782, -300, -11, - -303, -174, -217, -3, 24, 168, 187, -166, - 54, 238, -269, -27, 182, -4, -72, -47, - 32, 39, 7622, -46, -67, -53, 56, 123, - -50, 69, -36, -275, 628, -55, 195, -56, - -265, -132, -39, -4, 169, 113, -180, -19, - 88, -6427, 42, -257, 1180, 359, 335, 3821, - 116, 79, 3, -93, 67, -44, 58, -16, - 265, 172, -39, -44, 18, 92, 4, 218, - 122, -2993, 150, 138, 618, 66, -618, 402, - 2227, 10, 38, 308, 338, -70, 265, 1047, - -104, -182, 305, -162, -99, 510, -20, -114, - 529, -42, -3569, 52, -80, -314, 716, -31, - 259, 59, -73, -117, 38, -44, -16, -74, - -5060, 35, 10, -30, 54, 217, 36, -205, -}; - -static const int16_t cb0808s0[] = { - -2191, -865, -1906, -251, 274, 594, -1214, 677, - 482, -1176, 43, -1098, -203, -537, 1834, 1332, - 308, 432, -191, 3091, 1892, 926, -446, -1206, - -613, 198, 575, -38, 264, 375, 278, -691, - -107, 17, -239, 261, 848, -620, 183, 624, - 122, -358, -50, 1017, -1075, -705, -346, 337, - -121, 100, -218, -1051, -463, -4728, -513, -1151, - 737, 4356, 684, -1374, 1630, 521, -520, -52, - 90, 119, -43, -131, 24, -2, -184, -65, - 614, 371, -448, -414, 1415, -687, -224, 584, - -768, -1210, 2941, -3057, 132, 406, -952, 291, - 295, -798, 608, -1476, -516, 21, -302, 2085, - -1700, -2655, -355, 175, -409, 662, 46, -247, - -201, -580, 179, -54, 458, 836, 1543, 1829, - -282, -278, 412, 2422, 2077, 197, -897, 451, - 595, 1547, 538, 825, 563, 443, -576, -854, - -572, 241, -471, 201, -311, -529, 112, -5128, - -173, -233, -435, 340, 158, -41, 273, -224, - 919, -1570, 1075, 265, -282, 1256, 1007, 231, - 720, 417, -401, -4589, -747, -453, -1112, 54, - 156, -561, 2746, -422, -83, -91, -381, -270, - -1226, 987, -965, 625, -474, 565, 2890, -85, - 1291, -280, 626, -26, 840, 1122, -1915, 780, - -702, 792, -578, -122, -9, 1175, -194, -571, - 2940, 540, 31, 1817, -352, 264, 953, -2035, - 238, 3250, -1561, 653, -331, -393, 827, -382, - 323, 281, -1339, -819, 545, 207, 14, 338, - 432, 860, 1691, 142, 711, 381, -1151, 4164, - -867, -241, 111, -513, -863, 78, 1453, -363, - -128, -232, -1853, 2373, -1156, 210, 698, 1134, - -869, -177, -352, 1514, -1370, -789, -1193, 819, - 348, 80, 492, 179, -909, 591, -600, -377, - -1709, 59, -539, 557, -45, -362, 778, -4919, - -647, 203, 865, -313, -257, 173, -2415, 1005, - -1771, 843, -474, 1619, 1193, -186, 305, 636, - -662, 1976, 546, -82, -108, -751, 850, 521, - -1625, -3135, -388, 64, 249, -1189, -1552, 2629, - 2, -221, -105, 754, 251, 219, -270, -202, - 545, 147, 1019, 108, -1358, -1317, 1362, -1323, - -3322, -405, -371, -554, -334, 296, 493, 248, - -4, 1340, 123, -584, -804, -766, -164, -470, - 295, 218, -3, 62, -194, -657, 5016, 280, - -4, -69, -281, -994, 209, 307, 8648, -37, - -138, 45, -329, -101, -65, 98, 58, 714, - 56, -170, 60, -203, -248, 103, 107, -408, - 596, 170, 61, 584, 727, -434, -181, -5116, - -502, 494, 52, 83, -105, 325, 68, -561, - -274, 371, -1833, -78, -2990, 320, 141, -748, - 1764, 1157, -538, -276, -1594, -152, 838, -45, - 1137, 13, -803, -162, -838, -1199, 2003, 580, - 3687, -844, -552, -271, -462, -1034, -29, 273, - 862, 269, 95, 186, -222, -124, 79, -34, - -684, 808, -1061, -916, 610, 539, 1289, 782, - 1216, 3213, -38, -546, -1209, -398, 98, -39, - 58, -1271, -611, 573, 499, -2170, -157, -943, - -595, 436, 1203, 487, -1419, -570, 1468, 711, - -589, -101, 3299, -45, -1432, -453, 1820, 677, - 1052, -1793, 1071, -400, 268, -464, 443, 508, - -273, -736, -233, 270, -1187, -1931, -1208, -519, - -879, 325, 1032, 280, 565, 294, 2588, -303, - 640, -1398, 1070, 674, 57, -165, -46, 512, - 757, -3471, -812, -854, 45, 101, 3195, -786, - -61, 122, -1234, -74, 119, -389, 254, -84, - 829, 1465, -930, 171, -248, 201, 939, 1, - 52, -3517, -1854, 147, -843, 310, 502, 729, - 191, 525, 333, -669, -3358, 215, 552, 156, - -1771, 982, -746, 523, -187, -684, 456, 123, - -1544, -145, 58, -1083, -1646, -1309, 775, 1436, - 1409, -1114, -171, 26, -1775, 1103, -392, -2053, - -1221, 100, -1120, 25, -295, 306, -105, -514, - -4362, 156, -2172, -191, -90, 7, -62, 244, - -107, 521, 309, 22, -663, 239, -213, -226, - 100, 2228, -330, -197, -1247, -876, 1561, -1, - -354, 439, -163, -318, -61, -1184, -3022, 1434, - 65, 87, 806, -2093, 3016, 1022, -779, -391, - -18, -1371, -548, 910, -910, -438, 673, 48, - 1028, 548, 153, -337, 554, 353, 1686, 468, - -190, -113, -560, 542, 94, -140, -194, -58, - 165, -154, -311, 4744, -148, 49, -253, 180, - -65, -125, -139, -49, -115, -270, 439, 139, - 210, 202, -207, -65, -477, 168, -4720, -96, - -1091, -2071, -567, -1330, 237, 411, -123, 1197, - 2625, 1348, -230, 362, -147, -139, -699, 1210, - -299, 92, 2835, -36, -296, 287, 2426, -1171, - -218, 884, -320, 1130, -1085, 1177, -953, -776, - 609, 827, -90, 131, -2757, 567, 885, -2359, - 955, -200, -1883, 131, 282, -80, 141, -8, - -33, 333, 809, 357, -13, 499, 597, 923, - -1725, -1533, 465, -93, 2187, -841, 751, 74, - -2158, 99, -1078, -459, 648, -258, 349, -917, - 1200, 374, -1741, -1013, 724, -61, 182, 4032, - -581, 1123, -400, -459, -443, -316, 3, -271, - -248, -17, 595, 206, -1188, 2869, 1338, -253, - 316, -474, 1680, -856, -1487, 547, 679, 425, - -258, 92, -4, -24, 117, -157, 385, -257, - -332, -5597, -68, -329, -65, -108, -277, 202, - -400, 124, -51, 5, 71, 90, -927, 966, - 780, 305, 703, 802, -1661, -1415, -66, 437, - -610, 317, 795, 599, -189, 322, -519, -4010, - 729, -620, -2127, 351, 506, -68, 162, -983, - -288, 3167, -140, 991, -599, 128, 1868, 64, - -63, -1, 2047, 155, -871, -130, 226, 508, - 499, 882, 3762, -383, -23, 0, -345, -488, - 167, 648, 395, 114, 1121, 343, 232, -538, - 15, 342, -820, 38, 435, -468, -282, -415, - -5021, -293, 147, 533, -128, -70, 503, 844, - -86, 1836, -2103, -1143, -70, -510, 576, -689, - 410, -2101, 433, 339, -417, 820, 157, 173, - 454, -586, 1219, -73, -5123, 344, 397, 53, - 105, 501, -59, 515, 194, 356, 78, 706, - 303, 332, 4532, 739, 961, -521, -392, 20, - -697, 823, 607, -243, 332, 365, -330, 307, - 429, -865, -8, 545, -3, 6041, -310, 272, - 464, 22, -156, 142, -63, -87, 297, -24, - 562, -9, 147, 341, -21, 119, 1386, 947, - -1738, -500, -655, 95, 32, 32, 187, 518, - 1330, 95, -324, 3620, 737, -54, 55, 670, - -1252, 995, 484, 1347, -745, 244, 262, -83, - -122, 1194, -653, -1111, -327, -325, 3579, -214, - -37, -412, -267, -377, -62, 131, 360, 203, - -5713, -42, 94, 279, 406, -355, 34, -144, - 156, -256, -48, -98, -1392, 1273, 202, -1249, - -3457, -710, 1007, 37, -1788, 86, -570, 535, - 17, -369, 1640, 816, -117, 128, -969, -1381, - 224, 1519, -996, -833, 931, 185, 804, 465, - 82, 69, -247, 3312, -430, -23, 173, -223, - 3080, 1848, -1187, -1494, -485, -1131, 496, -517, - -596, 320, -853, -1303, 240, -298, 159, 527, - -257, 412, 839, -1020, 706, -3499, -175, -1089, - -717, -325, 261, 310, -1740, -1035, -403, -229, - -861, -970, -62, -192, 535, -2154, -364, -1133, - 979, -3299, 353, 982, -517, 1144, -563, 675, - 285, 63, 17, -1957, 82, 28, -513, 501, - -1183, 1476, -813, -254, -1584, -1181, -426, -56, - -916, 203, -2693, 209, -1066, -1174, 279, 439, - 201, 1179, 797, 407, 851, 927, 316, -640, - 1398, -128, 2741, 563, -1789, 989, 932, 247, - 6, -617, 268, -691, 1112, -569, 883, 298, - 37, -362, -661, -17, -154, -574, 721, 4578, - 205, 507, 77, -90, -433, -1613, 270, -500, - -1061, 1634, -388, -432, -648, -1985, 629, 2887, - -201, -32, 223, 621, 143, 446, 1384, 1109, - 299, 329, -1002, -356, 1504, -77, 49, 952, - 4166, -544, -85, -412, -249, 474, 27, -107, -}; - -static const int16_t cb0808s1[] = { - 2632, 1511, 944, -180, -2377, 54, -470, -187, - -710, -998, -516, -916, -440, -842, 285, 22, - -282, -459, -299, -2769, -2285, -380, -2194, 801, - -595, -252, 504, -69, -752, 972, 639, 277, - 502, 117, -1072, -145, 1462, -528, 2165, 880, - -182, -2953, 750, -1090, 596, 105, 187, 555, - -153, -113, 830, 161, 308, -44, -250, -58, - -507, -406, -626, 1453, 1357, 116, -456, 3242, - -607, 94, 390, 393, 114, 1069, -2, 2, - 2497, 1405, -755, 1353, 192, 1288, -187, 262, - 1722, 91, 885, -622, -321, 246, -1835, 17, - 213, -80, -658, -1940, 275, 845, -365, 276, - 2142, -216, -3402, -646, 549, -78, -176, -52, - 785, -1335, 44, 163, -409, 1273, 679, -377, - 788, -1355, -1721, 332, 223, 1409, -104, 165, - 354, 322, 2414, -1611, 216, -6, -232, -1770, - -1931, 2496, -530, 228, -924, -173, -329, -575, - -1709, -900, 199, 223, 690, -636, 73, -367, - 460, -823, -5105, 435, 957, 224, 246, 406, - -673, 752, 412, -158, -267, 4, 694, 10, - -45, 219, 1040, 778, -1910, 1886, -691, 674, - 1085, -537, 376, 1048, 858, -161, 613, 376, - 535, -1349, -1913, -518, -850, 665, 772, -2985, - -66, -42, 2142, -848, -1151, 237, -211, -161, - -2753, 603, 507, 39, -575, -61, -1053, -273, - 290, -258, -162, 139, 95, -12, -201, -236, - 709, -328, -314, -130, -5337, 100, -18, -97, - -206, 1827, 1722, 302, 924, -203, 761, -715, - -24, 372, -600, 2115, 1197, -1406, 676, -2068, - -167, -221, -936, 1419, 353, -317, 245, -2890, - 623, 265, -622, 204, 2549, 596, 239, -25, - -672, 583, 117, -13, -2251, -1325, 1984, 1431, - -1335, -1268, 735, 245, 105, 593, -193, -614, - 909, -339, -1033, 383, 102, 363, 732, 1439, - 1028, 1275, 442, 987, -3901, -257, -36, 224, - -116, -402, 200, -596, -125, 372, -572, 398, - -543, 1024, 1746, -736, -1056, -1736, 953, 1026, - -965, 442, -1565, -448, -96, 1498, 30, -231, - -483, 73, -3185, 1765, 1313, -100, 477, -198, - 782, 316, 364, -107, -431, -1795, -244, 122, - -423, -385, 457, -872, -535, -1098, 80, -110, - 1420, 646, 33, -3226, 648, 861, 328, -1269, - -558, 495, 881, 112, 479, 170, -309, 1904, - -1412, -768, -1220, -34, 995, -649, 162, 1, - 153, 985, 762, -263, -188, 77, 760, -2346, - 3430, -450, 1677, 1090, 1771, 2109, -14, -119, - -995, 268, 141, 33, 35, 31, 537, 65, - -345, 69, 192, 763, -18, 1078, 3829, 274, - 442, -173, -412, 434, -695, 924, 2, 1551, - 566, -85, 217, 976, 2196, -503, -1401, 759, - 922, -3024, -963, -3, 600, -452, -193, -787, - 7, 186, 828, 515, 148, -225, -1250, -985, - 443, -511, 2037, 1560, 3230, 647, 1418, -165, - -261, -369, 224, 450, -100, -271, -122, -511, - -691, -1444, 906, -144, 248, 452, 957, -70, - -517, 116, -3559, -877, -399, 418, -1300, -415, - -177, 770, -2566, -371, -1673, -1042, -500, -290, - -708, -631, 193, 2494, 319, 545, 767, 102, - 231, -43, -139, -97, -700, -1592, 282, 1325, - -1419, -647, 449, 1995, -737, 661, 1617, 725, - -1464, 615, 906, 202, -154, -228, -2194, -231, - 299, 110, 1318, 1053, -312, 843, -937, -1697, - -592, -1224, -633, -50, 792, 1600, -1187, -171, - 211, -744, -306, 186, 1914, -3119, -904, -159, - 178, -596, -654, 817, 94, -242, -2376, -218, - -421, -365, -699, 177, -427, -32, 265, -33, - 245, -34, 5309, -307, -262, -299, 86, 278, - 33, -200, -180, -56, 337, 1034, -229, 4952, - 306, -609, 189, -22, 280, -160, -507, 135, - -1265, -252, 434, -427, 158, -546, -130, -2500, - 597, 908, 918, 706, 1227, 3390, 995, 298, - -558, 1307, 765, -144, -37, -286, 122, 215, - -1251, 1090, 85, -914, 522, 316, 1829, -701, - -365, -3311, 312, 22, 680, -1351, 220, 243, - 166, -36, 780, 2395, -64, 836, 1037, 735, - 966, 173, 1114, 192, 510, -1054, 1341, -616, - 1559, 897, 338, -3, -194, -214, -573, -265, - 328, -365, 433, -505, -86, 33, -156, -129, - -137, 119, 143, 5773, -76, 68, 820, 1215, - 1315, 713, 12, 1590, 131, -193, -881, -227, - 736, 581, 736, -37, -434, -449, -348, 4189, - 2180, -1360, -1663, -74, 1215, 278, 2092, -66, - 313, 388, -1373, 25, 599, 888, -87, 293, - 30, 367, 1010, -883, 818, -910, -1918, 864, - 482, -968, -1249, 222, 1100, 23, -87, 2493, - -248, -622, 240, 151, 873, -2735, 1325, -700, - -411, 282, -2361, -1843, -631, -208, 103, -411, - 831, -446, -292, 450, 184, -158, 484, -1964, - 4663, 123, 18, 174, 621, 158, -788, 233, - 302, 441, -339, 200, -62, -197, -9, -236, - 984, 584, -521, -373, -205, 910, 392, 850, - -2968, 68, -727, 1330, 578, 36, -385, 754, - -538, -36, 271, 418, -548, 1775, -1045, -879, - -1407, 524, -1085, -1479, 371, 19, 873, 171, - 2932, -216, 42, 71, -1187, -570, -524, 344, - -770, -4086, -735, -515, 1055, -551, 945, -1408, - 913, -1005, -222, -443, 60, -194, -734, 1908, - -534, -1351, 72, -938, -66, -2756, 1313, -169, - -1550, 450, -610, 893, 1100, -583, 87, -145, - -210, 281, 1402, 674, 0, -38, 874, -363, - 2436, 2156, -1659, -481, -130, -63, -669, -316, - -761, -413, 108, 2362, 354, 76, -1725, -924, - -1443, 1251, 871, -2058, 518, 955, -283, 680, - -85, -560, -464, 127, -216, -1382, 1908, 238, - -182, 459, -1227, 1144, 2266, -96, 595, -750, - 912, -198, 1786, -1423, -618, -450, 185, -1212, - 706, -689, -154, -365, -681, -1378, 914, -1200, - -253, -532, 3244, 444, 1, -96, -404, -64, - -412, -1400, -2830, -785, 940, -217, 358, 618, - 208, -2974, -365, -32, -63, -233, -868, -413, - 358, -451, 1310, -751, -1329, -2480, 63, 458, - -273, 1270, 316, 93, -453, -463, -1258, -57, - -1073, -2037, 46, -160, 4609, -1193, 192, -355, - -963, -92, 752, 593, 102, -80, -121, 166, - -606, -274, 28, 258, 45, -45, 928, -949, - -134, -268, -77, 242, 1623, -1290, 739, 109, - 285, 175, -92, -4053, -482, 366, 217, -126, - -843, 950, -1068, 777, 1818, 550, -891, -34, - -995, 1976, 2677, -764, 45, -40, -1800, 569, - -323, -102, -1064, 4000, -109, -423, -289, 738, - -872, 808, -977, 504, -901, 41, -45, -287, - -140, -444, 477, -271, -876, 301, -2421, 1633, - -918, -660, -149, -2542, -503, -265, -107, -623, - -447, -782, -858, -535, -220, 442, 661, -209, - 878, -1601, 3610, 149, -331, 190, 102, 270, - 1451, 237, 13, -1026, 178, 1290, -281, -217, - 11, -1728, 1043, -2992, -718, -776, 357, -615, - -231, 813, -473, 1634, 539, -513, 240, 1158, - 144, 57, 1249, 1479, -481, -733, 1663, -757, - 641, 680, -468, -2697, -29, -62, 1253, 1142, - 292, 245, -96, 295, -664, -264, -308, -670, - -705, 155, -4024, 330, 191, -77, -1502, 326, - 9, 295, -567, 34, -104, -123, -320, -255, - 1124, 320, 98, 1299, -436, 1491, -341, 908, - 11, 8, 988, -1921, 5, -1391, 859, -1291, - -581, 546, -95, 272, -441, 185, -256, 313, - 466, -393, -50, 4430, -940, 87, -224, 390, - -539, -290, -1046, 531, -2329, 1275, -586, -1046, - -1682, 1159, 908, 2023, 951, -273, -68, 713, - -556, 770, 783, 223, 60, -881, -97, 760, - 556, -237, -263, -246, -240, 165, 526, 832, - -4761, 432, -339, 186, 492, 81, -136, -827, - -390, -1026, -371, -292, 937, -243, -136, 6, - 49, -223, -600, -355, 5306, 140, 34, -84, -}; - -static const int16_t cb0808m0[] = { - -3555, -106, -131, -53, -156, 196, -206, -104, - 18, -2948, 122, 146, -520, 2, 294, -419, - -1, -25, -257, 9334, 87, -55, -42, 30, - 92, 35, 195, 31, 59, 88, 47, 47, - -220, 564, -1686, 426, 106, 396, 97, 1315, - 2331, 167, -1261, 1003, 732, -300, -342, 418, - 87, 236, -245, 2235, 11, 725, -24, -169, - -480, 2845, 96, -34, 67, 857, 28, 50, - 92, 2100, -84, -600, -1990, -2208, -163, 299, - 431, -825, -283, 299, -98, 391, -65, -92, - -200, -689, 2236, -82, -81, -52, 127, 86, - -137, -319, -2561, -90, 547, -198, 10, 195, - -366, -2688, -77, -234, -112, -245, 270, 199, - 2674, -57, -673, -9, 1029, -31, 311, -50, - -160, -175, 2371, 2711, 409, -19, 22, -244, - 312, -158, 270, -125, -247, 118, -91, -602, - 86, 174, -216, 18, 3048, -1953, 171, -1985, - -297, 295, -38, -198, -229, 363, -13, 127, - 13, -202, -117, 65, 74, 63, 125, -62, - -2, -543, -680, -4269, -130, 325, -49, -245, - -50, -509, -151, -19, 3, 152, -980, -129, - -234, 399, 349, 171, -196, 4952, -2, 36, - 288, 771, 2313, 231, -39, 572, -3012, 77, - -501, -215, -228, -444, 830, 200, -188, -157, - 3248, 279, -3319, 0, 76, 10, 160, -80, - 135, 102, -349, 174, -30, -88, -145, -205, - 10, -185, 177, -34, 25, 31, 218, -4, - 191, 172, 228, -136, -178, 268, 638, 3559, - 55, 198, 145, 342, -25, -1940, 2866, -334, - -921, 1941, -464, 273, -181, -506, -21, -410, - 116, -179, -49, -273, -22, -36, -1298, 274, - -1831, 321, -382, 238, -3464, -68, -194, 32, - -95, -506, 72, 64, -329, 19, -39, 347, - -302, 204, 145, -72, 855, -112, -3596, 989, - -2801, 386, -2623, -471, 101, -155, 257, 291, - 30, -153, 185, 172, 511, 20, 166, 274, - 29, -3023, 129, 33, -219, -205, 6, 47, - -407, 137, 563, -106, -2065, 76, 201, -99, - -170, -77, 170, -4536, -440, -96, -940, -1066, - 81, 205, 358, 435, -78, -148, -201, -85, - -307, -306, 14, -47, -101, -187, -136, 380, - -4, -32, -34, -54, 528, -58, 6389, 302, - -79, 52, -28, -65, -77, -12, 9024, -100, - 262, 20, -67, -31, 50, -33, -30, -140, - 326, -1170, -304, -136, -233, 170, 60, 314, - -166, -208, -105, -245, -169, -72, 137, -7173, - -2, 375, 152, 226, -206, -341, 303, 47, - 1010, -188, 577, -292, -3581, -12, -195, 20, - 2165, -206, -88, -83, -132, -40, -443, 236, - -333, 179, -211, -56, 318, -409, 3106, 95, - 11636, 340, 204, -323, 167, 76, 61, 65, - -157, 71, -21, 38, 66, 391, -52, 20, - -17, 11, 259, 45, -194, 440, 3432, 122, - 468, -595, -1856, 94, -427, -133, 149, -273, - 61, -6622, 48, 97, -162, 93, 402, -104, - -207, 64, -278, 92, 387, 3, 96, -2, - -27, -30, 84, 64, 35, -65, 98, 85, - -16, -248, 7930, 74, 4, -104, 83, -48, - 40, -2104, -86, -89, 99, -142, 65, -2713, - 63, -431, 523, 687, 212, -1515, 3, 59, - 55, -6, 22, -8, -148, 180, 78, 7833, - -63, -83, 13, -187, -116, 156, -29, -186, - -160, 148, -82, -303, -166, 112, -103, -39, - -165, 2827, -54, -26, 24, -3055, 78, 21, - 128, -81, -25, -122, 51, -54, -19, 188, - -18, -1, -140, -18, -8085, 124, -46, 45, - -574, 12, -150, 147, 65, -209, -396, -444, - -3882, -291, -231, 296, 244, 76, 180, 36, - -2575, 659, -63, 3277, -85, 48, -518, -353, - 130, 50, 13, 338, -343, -276, -16, 353, - -6036, -77, 18, 139, 43, 335, 294, 99, - 219, 442, -25, -53, 40, 271, 175, -282, - -91, 430, -4428, -15, -2857, -62, -27, -170, - 33, -681, -110, -76, 153, 42, -134, -145, - 222, -177, -39, 314, 2270, 526, 500, 2417, - 339, 1808, -17, 464, -525, -97, 124, -32, - 370, 48, -1675, -62, -169, 2642, 2511, -43, - -1037, -184, 54, -569, -504, -247, -40, 327, - 7, 82, -197, 2774, -34, -2931, -204, -112, - 194, -362, 187, 65, -166, 115, -125, 14, - 210, 144, -75, 57, -255, -151, -3566, -153, - 182, 89, -2530, 98, -265, -173, -133, 260, - -25, -1292, 35, 131, -98, -85, -237, 82, - 1353, 47, 3842, 148, 171, 183, 234, 89, - -93, 47, 102, -4, 90, 2980, 289, -231, - 353, 497, -109, 190, -2869, 697, 136, 90, - -244, 298, -119, -519, -50, 207, -43, -1376, - 356, 1934, 701, -2323, 671, 71, -56, -167, - -3793, -3749, -103, 134, -228, -13, 27, -45, - -105, 172, -77, -23, 53, 110, -118, -80, - -164, -192, -563, 393, -58, -428, -360, 3696, - 162, -173, 1683, -430, 452, -92, 107, -41, - 28, -85, 421, -66, 354, -88, 723, 2751, - -2955, -481, -134, -231, -145, 3, 65, -88, - 189, 187, 151, 174, -36, 240, -253, -235, - -194, -5410, -47, -98, 338, -487, -81, -35, - -82, -440, 31, 109, 217, 276, -1805, 278, - 273, -369, 629, -293, -525, -3832, 73, -56, - -363, 1709, 177, -2813, 796, -162, -341, 1176, - -75, 533, 854, 719, 242, -194, 90, -147, - 203, -136, -138, -764, 6, -2787, -13, 1104, - 1497, 1097, 90, -867, -718, -317, 119, 180, - 160, 257, 2532, -557, -62, 14, 665, 1520, - 456, 826, 394, -605, 908, 222, -140, 121, - 121, 232, 124, 96, -87, 48, -51, 41, - -7821, -37, 130, -11, -33, -137, 16, 42, - 1509, -8, 119, -83, -18, 64, 41, -178, - -28, 182, 532, 678, -75, 277, -230, -70, - -71, -8, -150, 321, -6298, -20, -131, -65, - 139, -215, -155, -27, -110, -257, 32, 201, - 215, 184, 8932, -106, -50, 66, 15, -44, - 203, -38, 19, -78, 65, 135, -123, 166, - 117, 76, 4, 34, -90, 5984, 59, -72, - 356, -64, 6, -62, 43, -86, -175, -106, - 10, 25, 3812, -135, -3313, 142, 348, -101, - -35, 378, -250, -106, -299, 237, 40, -32, - 236, -521, 63, -143, 538, -256, 43, -45, - 1642, 726, -3225, 109, -997, 3, -256, -27, - -182, -78, -4092, -9, 231, 34, 9, -6, - 155, 2842, 53, -130, -390, -146, 168, -74, - -2023, -955, 576, -629, -76, 70, 140, -287, - -401, 966, 359, 1185, -226, 713, 753, -739, - -4238, 3364, 75, -213, 27, -172, -34, 171, - -118, -46, -164, -13, -54, -203, -154, -12, - 65, -3777, -3452, 297, -104, -93, -81, 69, - -179, -321, 51, 47, 242, -15, -144, -43, - 2827, 67, -305, 54, -3044, 57, -15, -427, - 311, -205, 226, -490, 37, 363, -88, -408, -}; - -static const int16_t cb0808m1[] = { - 3329, 59, 195, -91, -70, 3262, -132, 360, - 157, -410, 184, -99, -138, 337, 289, 317, - 156, -589, -127, -204, 37, -175, -5661, -52, - 942, 156, -1, -197, 353, 90, 57, -287, - -218, 438, -4, -262, 9, 322, -167, 2904, - -12, -2647, -248, -203, -267, -116, -135, 333, - -220, -200, 40, 228, 2677, -462, -183, -129, - 2898, -728, 793, 422, 541, -350, 28, 222, - 2790, -231, -195, -191, 3002, 182, -610, 145, - -226, -102, 285, 344, -357, 217, -146, -98, - 18, -255, 96, -151, 266, 208, -459, -132, - -345, 4059, -371, 79, 44, -63, -233, 334, - 44, 3884, 49, -3303, 88, -23, -287, -461, - 57, 94, -53, -129, 104, 167, -25, -79, - -125, -630, -2352, 150, -419, 40, -63, 603, - 67, 209, 321, -1765, -200, 68, 473, 622, - 5, -2883, 112, 188, -189, -2765, 169, 397, - -330, -642, -798, 129, -110, -164, -20, 176, - -213, -5415, 39, 31, 13, 270, -477, 166, - 167, 4, 216, -12, -528, -75, -291, 396, - -499, -2011, -172, -265, 96, 83, -279, 114, - -166, 833, 30, 2493, 94, 130, -183, -659, - 1, -227, 75, 349, -2757, 82, -116, 9, - 952, -112, -2444, -333, -206, -406, 201, 15, - -768, 88, 1390, -33, -558, 97, -201, 29, - 3470, 50, -40, -271, -171, -26, 47, 485, - -250, 3318, 112, 639, -2911, 123, -264, 3, - 8, 379, 73, 54, 88, 227, 73, 58, - -572, 782, -183, 305, 49, -23, -2968, -41, - 291, -25, 157, 295, -2118, 125, 5, -193, - -159, -543, -75, 1181, -191, -547, -93, 117, - -1831, 265, -607, -30, 194, -3929, -70, 159, - 79, -1519, 38, 201, 14, -24, -76, -366, - 14, -2748, 0, -372, 405, 39, -170, 320, - -257, 2153, -12, 158, 322, -4013, 22, -101, - 217, 637, 273, -430, 228, -428, 102, -356, - -266, 82, -31, 14, -223, -2595, -360, 2094, - -379, 624, -192, 245, 294, 1484, -117, 156, - -53, 3668, -3573, -118, -213, 257, -211, 66, - -62, -173, -166, -123, 163, -81, -39, -74, - -21, 126, 722, -136, 2050, -206, 86, 275, - 76, -249, 55, -2508, 95, -60, -34, -360, - -9, 187, 34, -87, -30, 137, 48, 4761, - 109, 511, -496, 104, 399, -361, 162, 78, - -29, 159, -112, 182, 246, 52, 255, 338, - -35, -1, -68, 5, 182, 7675, -119, -14, - -1901, -111, -106, 22, -16, 81, 159, -2423, - -71, -24, -153, -520, 126, 370, -186, 230, - -51, -401, 206, -32, 52, -71, -79, 503, - -239, -231, 55, -133, 5226, -45, -165, 57, - 2314, -209, 302, 78, 154, -3092, -605, -498, - 410, 159, 336, -147, -120, 143, 36, 587, - -182, -182, 1457, 1008, 2524, -446, 2333, -497, - -761, -162, 125, 420, 225, -117, -324, 437, - -50, 190, 129, 259, 33, -2, -9, 32, - -24, 91, 97, 201, 19, 169, 3535, 485, - -144, 330, -193, -2715, 603, 303, 1124, 107, - -1386, -1437, -203, 180, -81, 303, 209, -21, - -65, 26, 91, 98, -1349, 196, 2103, 917, - -732, 834, 1456, -92, -455, -130, -732, -288, - 39, -85, -557, -39, 3213, 297, 392, -378, - -520, 795, -2407, 6, 7, 406, 203, -73, - -247, 317, -3336, 3166, 206, -36, 159, -279, - 442, 54, -324, -18, 544, -250, 142, -440, - 100, -145, -3772, -199, 139, -156, -11, 34, - -178, -233, -370, 601, -58, 1679, -170, 76, - 684, -35, -73, -52, -33, -3, -89, -5, - -82, 73, -11, 51, -48, -12, -376, 4348, - -203, -432, 189, -35, 144, 31, 181, -106, - -5112, 552, 480, 0, 63, 31, 33, 504, - 1055, -3007, -214, 154, -100, 246, 269, -423, - 579, 63, 1668, -296, 390, 109, 21, -6, - 71, 3321, 246, 197, 355, -198, 472, 135, - 437, -1734, 1299, 227, -618, -48, -199, 217, - -230, 70, 99, 2632, -203, 3105, -87, 149, - 303, 124, 362, -322, -44, 38, 104, -28, - 48, -175, -468, -410, -4451, -152, 2157, 26, - -281, -581, 36, -205, 101, 230, 192, -129, - 319, 20, 65, 4879, 123, -236, -178, -128, - -387, -124, 528, 142, -775, -301, -88, -380, - 120, -42, -17, 64, -1074, -3350, 1335, -1078, - -14, -462, -113, 253, 450, 36, -8, -346, - -54, -7, 52, -100, 74, 8266, -193, -36, - -51, 12, 59, -68, 190, -36, 89, 38, - -59, 13, 269, 109, -15, -141, -64, -60, - 238, 6, -4338, 381, 1252, 354, -41, 41, - 191, -236, 122, -2712, 352, -117, -121, -284, - 1516, 473, -332, -277, -1792, -335, 84, 64, - 9595, -246, -278, 446, -95, -32, 60, -146, - 104, -84, -3, 107, -116, -377, 101, -149, - -45, 364, 104, -193, -254, 2929, -164, -93, - 324, 749, -928, 435, 2357, 350, -40, -153, - -48, -626, 390, -48, -4248, -458, -930, -218, - -486, 1769, 335, 152, 165, 111, 118, -407, - -87, -373, -333, -134, 86, -32, -144, -18, - -16, -7549, -146, 49, -184, 116, -28, -51, - 190, 115, 80, 68, 129, 206, 294, 331, - 179, -270, 174, 2444, 55, -3271, 70, -124, - 228, 330, -21, -419, 62, -140, -2388, 7, - -2683, -129, -1050, -548, 811, 189, 359, -385, - -82, 9031, 95, 77, -69, 164, 261, 61, - -73, 230, -163, 141, -38, -43, -150, 164, - 28, 164, 59, -58, -312, -134, 102, -67, - 166, -163, 63, -6795, -103, -147, 81, 273, - 133, 122, -162, -207, 127, -60, 4628, -1, - 1315, 518, -163, -246, 54, 239, 154, -154, - 265, 2000, 25, 227, 42, 179, 88, -3446, - -214, 182, 438, 90, 196, -69, 134, -56, - -451, 716, -1120, -287, 118, 230, -37, 145, - 284, -250, 139, -947, 203, -3176, -57, 151, - 3201, 818, -87, 347, -486, -201, 1176, -325, - -966, -263, -184, 238, -156, -396, 152, 959, - -59, -33, -159, -3, 9394, -119, -81, -50, - 67, 9, 27, -62, -121, -210, 48, -211, - 5, 396, 633, 34, -16, 67, -247, -77, - 128, 441, 3896, 251, 970, 119, -387, -35, - 124, -64, -664, -6550, 101, -52, 19, 44, - -132, 79, 731, -155, -262, -140, -31, -191, - -110, 276, -162, -49, 81, -117, 15, -570, - 420, -1232, -125, 3737, -95, 544, -149, 463, - -129, -345, 350, 183, 173, 197, 464, 180, - -249, -365, -785, -9, -3411, -235, -124, 225, - -4516, 196, -150, -89, -89, 54, -110, 137, - -431, 272, -12, -7, 114, -201, 166, 1570, - -74, -88, 6019, 350, -75, 68, -29, -81, - -50, 57, -62, 103, 61, 276, 22, -131, - -134, -3347, -60, -3397, -311, -105, 90, -159, - -222, 151, 224, -210, 264, 192, 29, -84, -}; - -static const int16_t cb0808sl0[] = { - 24, -3148, -3111, 106, 45, -114, -85, -211, - 154, 172, 246, 368, -130, 58, -135, 70, - 102, -150, -76, -7, 13, -1, -29, 20, - -7, 112, -234, -115, -138, -40, 106, 178, - -7276, -537, 25, 856, 460, 3107, 146, -520, - -631, -118, 393, 179, 144, -86, 47, 82, - 3031, 28, 164, -308, -411, 72, 138, 378, - 242, 253, 12, 158, -28, -60, -29, -46, - -5, -11, 84, 2753, -113, -65, 3, 5, - 13, -5110, -74, -126, -129, -82, -58, 116, - 15, 68, 243, -32, 126, -48, 11, -7, - 75, 10, 166, -153, 8, -43, -38, 81, - -41, 13, 100, 27, 46, -441, -56, 35, - 4, 51, 7528, 52, -141, -153, 39, -36, - -86, 80, -35, 50, -46, 23, 178, -3986, - -3350, 59, -278, 37, -2, 14, -157, -208, - -317, 218, 15, -296, -32, -51, 36, -27, - -2062, 28, -37, 322, 2286, 214, -196, -171, - -64, -163, 265, -50, 3, -177, -22, 68, - 124, 37, -15, -2202, 60, 133, 4, 371, - 2753, -111, 480, -446, 484, 43, 150, -331, - 1410, -791, 123, -136, -192, 267, 0, -89, - -105, 421, 68, -126, 79, 279, 202, -132, - -208, -3345, -105, 59, 118, -647, -48, -12, - 145, -403, 200, 7, -4, -3192, -223, 64, - 0, 415, 366, 136, 49, -7611, 79, -105, - 127, -69, -43, 103, -95, -93, -10, -30, - 94, 108, -109, 0, -87, -70, 300, -93, - 113, 25, -17, 2263, 41, 192, 18, 73, - 179, 129, 149, -81, -1, 0, 201, 184, - 651, 8, 18, 114, 2820, 383, -71, 376, - -2281, -1190, -143, 121, -45, -2157, -410, 81, - -14, 1537, -833, 29, 1150, -494, -8, -14, - 210, 188, 3073, -1775, -123, 80, -103, 227, - 296, 111, 1637, -197, 1349, 174, 3276, 49, - -98, 74, 660, 3, -252, -356, -9, 527, - -63, -7995, -16, 85, 249, 74, 26, 2, - 3, 26, -124, -61, -26, -144, 4, -52, - 6, -517, -95, 2566, -26, -190, -196, -509, - -2982, 4, -178, -9, -67, -25, 1, 193, - -68, -46, -82, -3734, -14, -339, -44, -151, - 55, 230, -3, 100, -47, -69, 35, 107, - 127, -175, -11, -10, -158, -140, 2934, -132, - 2571, -158, -217, 106, 137, -222, 74, -42, - 64, 559, 122, 73, -112, -2964, 2502, 13, - 301, -41, 203, -382, -151, -221, -147, -24, - 83, 37, -45, 56, 89, 71, 109, -14, - -43, -130, -108, -18, 74, -23, -34, 79, - 7662, -88, 70, 21, -110, 147, 26, 250, - 74, 165, 49, 43, 45, -22, -14, 293, - 5275, 57, -72, 93, 40, 115, -139, -332, - 95, 92, -26, 26, 169, -94, 332, 71, - -482, 137, 190, 114, 14, 151, 3125, 6, - 109, 6, 7, 1543, 282, -24, 24, 142, - 33, 123, 41, -72, -253, -33, 309, -107, - -64, -131, 56, -3528, 82, -17, 417, -47, - -588, 274, 155, 158, -245, 186, 147, -7, - -50, -218, 12, 118, -62, 652, 145, 64, - 2473, -146, 220, -2973, 97, 284, 29, 268, - 29, -208, -40, -251, -175, -16, -58, -65, - 28, 26, 55, 74, -12, 1911, 43, -82, - -150, -13, -119, 8, 119, 156, 1550, -88, - -102, 46, 226, -132, 95, 100, 87, 7, - -46, 8, -32, -16, -12, 317, -33, -27, - 291, -88, 169, 1, -101, -61, 161, 162, - -33, -1, 11, 5097, -34, 142, 31, 94, - 3619, -94, 67, 3379, -65, 28, 254, 189, - 110, 138, -41, 52, 32, -104, 154, 172, - -2365, -464, 281, 207, -66, -190, 399, -158, - 13, -155, -223, 92, -108, -25, 468, 189, - -4359, 42, -135, 138, 36, -1403, -264, -336, - -164, -49, 54, -125, -61, 62, 16, 172, - 182, 3134, -1373, 63, -227, -106, -133, -165, - -69, -57, -184, -46, 9, -57, 50, -3, - -62, -15, -123, 108, 111, 91, -161, 23, - -81, 7, 208, -5385, -244, 24, 95, 12, - -264, 62, -44, 21, -240, -299, -12, 117, - -61, -2551, 389, 2816, -179, 203, -421, 899, - -7, 174, -200, 98, 1036, -166, 11, -137, - 78, -7, -121, 245, -77, 124, 102, 51, - 3136, 74, -310, 40, 212, -239, -373, -154, - 398, 2967, 654, 488, 103, -230, -330, 831, - -63, -473, 152, -556, -2186, -371, 4, 86, - -12, -141, 5503, -87, -123, -17, -15, 154, - 192, -86, 97, 165, 352, 56, 154, 43, - -331, 1004, -52, -131, -3311, 3, 110, -153, - -70, 137, -168, -20, 115, 140, -25, -54, - -13, -300, 57, -131, 214, 261, -92, 618, - -2752, -3146, 61, -51, 210, -230, 87, -184, - 330, 22, -19, -107, -477, -39, 1, 127, - 178, -73, 425, 56, -25, -41, 135, 2423, - 59, -46, -10, 49, -116, -51, -2239, -228, - -75, 48, 3, 181, 161, -133, -355, 81, - 5, 84, -222, -83, 92, 33, -7558, -38, - -3, 159, 33, -58, -37, -107, 16, -61, - -94, 93, 97, 49, -275, 29, -198, -4, - -68, 87, 116, -7039, 46, 81, -25, 0, - -7, -46, 152, 64, -40, -143, -56, 147, - 403, 257, 2380, -538, -400, -132, -89, -29, - -2878, 457, -552, -12, -189, -370, -357, -3679, - 422, 63, 200, 116, -9, -229, -72, -100, - 3346, 88, -18, 28, -47, 159, 108, -160, - 253, 58, 2938, 55, 366, -33, -3209, 31, - -148, -10, -40, -443, 127, 120, 106, 9, - 4, -240, 200, 129, 328, -102, 187, 182, - 112, 2757, -3260, 314, -163, -3, -185, 354, - -97, -69, -199, 41, -143, 19, 108, -22, - -32, -18, -149, 35, 31, -5, -5083, 52, - 9, 5, -44, -52, 76, 7, -100, 7, - -79, 0, -33, 110, -208, 20, -159, -76, - 2, -8192, 156, 118, -306, -88, 136, -293, - -176, 163, 8, 1871, -112, 229, 311, -95, - -75, 17, 217, 152, 62, 17, -246, 3579, - 5, -87, -21, 92, 114, -185, 118, 8, - 196, -124, -220, 175, 104, 54, 104, -40, - -45, -152, 392, 216, -24, -28, 2024, -6, - 42, -91, -201, -9, -192, 35, -43, 1661, - -356, 1207, -1322, 340, -2937, -16, 163, -801, - -423, 197, -512, -70, 229, -412, 291, 511, - -36, -179, -98, -54, 93, 87, 263, -44, - 167, 77, -4, 7278, -101, -193, 91, -251, - -131, 269, 15, -168, -22, -26, 44, 24, - 154, 115, -11, -124, 28, 37, -14, -46, - -67, -8192, -51, -169, 41, -302, -81, 1991, - -11, 136, -175, 71, -104, 89, 60, 137, - 17, 106, 96, -238, -83, -52, -113, 53, - 2903, -47, 9, -227, -2784, -245, 146, -196, - -216, 41, -6, -128, -53, 1, -128, -145, - 149, 32, 25, -57, -14, 72, -135, 10, - -1946, -67, 74, -127, 141, -299, 55, 8, - 947, -2239, -271, 74, -227, -81, 31, 291, - -86, -2914, 22, -7, 293, 2, -25, 9, - -2997, 89, 3158, 192, -46, -246, -140, 46, - 287, 133, -110, 308, -114, -33, -106, 9, - -89, 105, 364, -172, 185, -61, 4464, -92, - -264, -66, -161, 102, -178, -264, -21, 114, -}; - -static const int16_t cb0808sl1[] = { - 246, -6, -180, 90, 127, 3322, 598, 182, - 81, 82, 67, -39, 87, -60, -8, -89, - 185, 99, -25, 27, 9, -59, -7421, 49, - -17, 116, -85, 6, -305, 88, -164, 99, - 61, -415, -114, -288, 1, -165, -12, 5, - -143, -142, -521, -245, -53, 38, -99, 3709, - -52, 0, -41, -135, 147, -217, 62, -2144, - 255, 132, 264, 65, -37, 204, -338, -280, - 192, -184, -158, -3685, -26, 203, 430, -29, - -16, 77, 230, -311, 597, 2553, -1126, -63, - 154, -431, -161, 315, 286, -147, 177, -3, - 93, 449, 253, -37, 101, -244, -77, 42, - -384, 22, 36, 235, -4973, 243, -120, -105, - -226, -114, -455, -404, 164, -505, 476, -124, - -2837, -82, -2920, -3, 0, 134, -94, 264, - -53, -53, 108, -3, -845, -2813, 228, -179, - -60, -2, 65, 33, -153, -16, -149, -2135, - 209, -929, -288, 227, 2656, -125, -42, 17, - 30, 3375, -367, 53, -262, -351, 108, -270, - 11, -57, -182, -51, -149, -287, -115, -24, - 99, -76, 6954, -75, -4, 38, -168, 138, - 109, -239, -45, 49, 28, -1376, 49, 66, - -83, -129, -61, -99, 135, 14, -93, 111, - 37, -16, 2, -76, 360, -77, 82, 161, - 149, -1660, 18, 98, -34, -12, -36, -65, - 126, -57, 28, 519, 2044, 297, 73, -218, - 51, 17, 21, -70, -32, -73, -39, -38, - -11, 60, 38, -129, -105, -173, 200, 7, - 124, -74, -2780, 2608, -57, -213, 54, -200, - 134, 208, -34, 236, 143, 101, 327, 558, - 75, 317, 3090, -188, 544, -186, 15, 116, - 237, 76, -105, 29, -300, -27, -211, 71, - -144, 183, -77, 38, -16, 39, 56, -7308, - -113, -116, -32, 222, 60, 76, -21, 59, - 52, 104, 383, 73, 149, 88, 127, 34, - -1819, -46, 50, 11, -159, -223, -163, -149, - 95, -163, -2168, -19, -937, -183, 66, -465, - -257, 341, -70, 111, 228, 52, 83, 63, - -52, -187, 16, -2539, -51, 3240, -81, 87, - -116, -183, -182, 96, -22, -191, -107, 217, - -10, -215, 9, -7, -97, -331, -55, 513, - -398, 1378, 2627, -2129, 563, 1462, -369, 498, - 1176, -469, 220, -953, -122, -236, -306, -276, - 31, 35, -167, 558, -134, 45, -54, 16, - 36, 18, 300, 2438, 62, -177, 77, 2638, - -108, -115, 3392, 274, -123, -66, 201, -400, - 170, 142, 151, 332, 53, -507, 81, -653, - -93, -3204, -5, 10, -43, 79, 3879, 77, - 191, 24, 23, -208, 6, -109, -97, 126, - -306, 629, 26, -516, 79, 21, 131, 43, - -253, -3463, 840, 653, -95, -48, 300, -1026, - -324, -909, -383, 195, 342, -136, -192, 422, - 262, -13, 534, 3125, 8, 1672, 176, -293, - 211, -1213, 537, 637, -10, -116, -149, 44, - 53, 105, 7, -97, 3, 17, 8, -21, - -7, -41, -38, -4959, -81, 1, 165, 196, - 98, 35, -35, 8, -28, 113, -20, 108, - -130, -65, 172, 2858, 41, -3295, 138, 10, - -95, -30, -173, 85, 42, 30, -119, 161, - 195, 125, -32, 136, 319, -33, 5142, 50, - 100, 128, -90, -53, -67, -203, 28, 19, - 37, -137, -124, -105, -25, -3405, -250, 294, - 409, -99, -1072, -383, -12, 212, -276, 3389, - -101, 171, -41, -554, -295, -437, 86, 158, - -242, 167, 135, 7, -149, 48, -4, -84, - 4911, 283, 5, -14, 105, -107, -384, 102, - 183, 47, 67, -5105, -5, 16, -155, 181, - 110, 24, -77, -32, 120, 1, 22, 167, - -90, -150, -5, 163, -44, -28, 54, -3058, - -174, 58, 152, -31, -179, -122, -57, 232, - -395, -4961, 61, -115, 31, 14, 82, -109, - -39, 59, -49, -133, 52, 17, 57, 52, - -63, 275, 146, 104, 53, 47, -55, 311, - 4871, -26, 48, -94, -11, -58, 63, 140, - -74, -94, -269, -77, 3372, -3116, 16, -47, - -74, -161, 115, 58, -247, -119, 399, 42, - -181, 154, -218, -24, -237, 58, -275, 2979, - 187, -124, 312, 301, 2767, -8, 40, -23, - -6, -38, -52, -363, -265, -78, -230, 286, - -135, -337, -81, 170, -13, -58, -117, 519, - -4784, 157, -193, 9, 62, -21, 180, 128, - 326, 213, 2440, 62, -601, -55, 2, -18, - -342, 142, 358, -632, -377, 3590, -248, -278, - -235, -28, 242, -133, 144, 26, -261, 113, - 45, -23, -1984, -77, 128, 249, -8, -266, - -38, -6, -1672, -45, -84, -377, 154, 17, - -83, -44, 156, -137, 43, 91, 253, 17, - -71, -92, 178, 12, 18, -8, -105, 101, - 7068, 71, -81, 84, -33, 79, 53, -7, - -85, -265, 117, 317, 114, 72, -482, -418, - -185, -97, 268, -1543, -79, -146, -48, -45, - -3259, -212, 1149, -165, 177, -158, -77, 100, - 86, -69, 107, 219, -512, -253, -418, -45, - 16, 5501, -184, 207, 67, 46, 109, -28, - -9, 33, 63, -16, 39, 92, 27, 23, - -10, -8192, 0, 50, -57, 68, -444, 1082, - 247, -138, 120, 472, -692, 212, -1576, 66, - 3061, 402, -160, 337, -685, -519, 227, -279, - 92, -4135, -393, -44, 6, -129, 59, 239, - 151, 153, -39, 116, 134, -40, 171, 118, - 207, 2615, 38, -167, -1671, 85, -135, -182, - -88, 246, 53, 29, -2, 16, 232, 544, - -46, -138, 122, -52, 1312, 9, 92, 13, - 4, 66, -35, -134, -56, 85, -43, -31, - 28, -3187, 100, -103, 70, -3, 186, -43, - 122, -3040, -27, -46, -121, 1, 37, 0, - -60, 2, -100, -152, -218, 175, -406, 175, - -193, 68, -208, -23, -230, 221, 3397, 45, - 48, 37, 337, 11, 15, -69, -4, -82, - 53, 33, -56, 75, -98, -69, -11, -19, - -12, 81, -52, 5428, 121, 82, 465, 10, - -229, 126, 32, 119, 439, 126, 1996, -85, - -81, -57, 88, 232, 108, -22, -24, 27, - -136, 91, -32, 18, 226, -33, 15, 117, - 145, -7737, 9, 58, -102, -113, 26, -2174, - 28, -421, -11, -70, -23, -70, -119, -96, - -133, 208, 20, -3750, -14, 23, 41, -180, - 2097, -103, -599, 146, 251, -77, -557, -76, - -96, 69, 266, 316, 74, -17, -227, 223, - 33, -261, 135, 8126, 250, -5, -57, 35, - 382, -44, 136, 81, 42, -80, 179, -73, - -75, -57, 274, -15, -3140, 3236, 196, 150, - -51, 222, -190, 13, 83, -313, -149, 89, - -281, -12, -42, 293, 567, 19, -43, 146, - 102, -39, 3666, 95, 76, -1, 12, 27, - 7, -5, 261, 132, -215, -295, -51, 496, - 77, 100, 16, -285, 649, -95, 280, 77, - 121, -2676, 25, -1148, 2912, -341, -91, 2380, - -80, -6, 269, -34, -686, -208, 19, 228, - 24, -5, -150, 11, 214, -316, 1187, 599, - -62, -2274, -240, 48, -86, 87, 86, 477, - 3832, 67, 135, 68, 747, 339, 385, -255, - -224, 184, 70, 171, -134, 2604, -231, 72, - 170, 51, -2785, -580, -86, -393, -63, -79, - -151, 334, 78, 329, -278, 102, -26, -55, - -3531, -378, -247, 176, -202, 147, 169, 87, -}; - -static const int16_t cb0808ss0[] = { - -1872, -332, -1311, -512, -934, -11, 112, 389, - -189, -1513, 1508, -1081, 185, -87, 3092, 529, - -166, -171, -1648, 2544, 2144, -259, -688, -1113, - -71, 387, 1194, -733, 175, 856, -976, 268, - 589, -1773, -426, -109, 1210, -486, 297, 195, - -991, -1543, -432, 1190, -1089, -531, -421, 80, - -225, 354, -231, -670, -299, -3694, -510, -882, - 31, 2804, 476, -478, 1897, 686, -1066, -1222, - -882, -374, -427, -1464, 957, 549, -1211, -204, - -218, -1412, -545, -968, 943, -342, 80, -281, - -249, -968, 3424, -2342, -212, 949, -167, -271, - 607, -838, -418, -891, -398, -877, 138, 1653, - -1034, -2515, -1363, -1535, -364, 432, -324, -1120, - 1531, 407, -698, 396, 325, 1432, 646, 2777, - 174, -836, -605, 2257, 1086, -888, 348, 36, - 513, 2229, 1543, 1293, 94, 2444, -574, -1030, - 933, -9, -668, 555, 346, 511, 715, -4033, - 409, -299, -166, 700, -560, 950, -1265, -245, - 1418, -1362, -20, 870, 152, 942, -331, -66, - 227, -186, 251, -3632, -1057, -989, -1798, 923, - 542, -630, 2889, -128, 1475, -97, -964, -860, - 534, -217, -746, 181, 321, -1007, 2595, -411, - 1298, 635, 310, 1955, -17, 846, -824, -11, - -952, 208, 328, -547, -1086, 1481, -264, -1574, - 3579, 500, 242, 1038, -1030, 353, -75, -2100, - -347, 2662, -2378, 261, 210, -1151, 525, 291, - 368, -200, -702, 105, -140, -81, 663, -716, - 334, 1220, 239, 21, 114, 301, -1898, 3647, - -302, 550, -489, -484, -853, -274, 1509, -419, - -330, -1121, -2666, 2507, -621, -818, 1188, -69, - -885, 231, 316, 1837, -740, -187, -102, 1148, - 1219, -123, 852, 1154, 27, 139, -344, -404, - -1133, 425, 353, 145, -123, 179, 49, -5836, - -571, 39, 274, -38, -457, 172, -80, 593, - -1977, -331, -421, 1965, 1768, -113, 64, 2272, - 475, 2165, 210, 873, -819, 757, -119, -530, - -1431, -2167, -1517, -864, 1060, -752, -1366, 2349, - -671, 1180, -179, 10, -450, 781, -799, -1303, - -393, -61, -113, 2053, -550, -843, 1028, -2044, - -2631, -1388, 1078, 171, 517, 496, -928, -1695, - 298, 708, -557, 122, -917, -197, -423, 1142, - 116, -528, -585, -470, 480, 400, 4605, 384, - -142, 57, -2340, -1507, -67, 907, 8192, 356, - -18, -704, 528, -32, -379, -611, 418, 703, - -396, 531, 155, 642, 678, -427, 85, 814, - 212, 845, -579, -590, -456, 103, -624, -4541, - -306, 638, -760, 36, -149, 1929, 1229, -717, - -543, 530, -694, 169, -2996, 423, -346, -897, - 1077, 255, -1054, -63, -1773, -479, 479, -701, - 1547, -1683, -342, -926, 112, -663, 1638, -9, - 2587, 311, -561, -932, -539, -335, 589, 779, - 2345, -432, 788, -967, 319, -4, 192, -588, - -103, 357, -3508, -257, 707, -473, 1521, -9, - 130, 3290, 274, -296, -802, -139, -814, -19, - 971, 849, 253, 486, 40, -1216, 1179, -1772, - -996, 1400, 838, 1955, -1432, -1925, 2324, 767, - 896, 1314, 3407, -1003, -552, -967, -166, -26, - 1099, -1965, 9, 239, -10, -243, 864, 1251, - 91, -2279, -691, -542, -473, -1908, -1208, -1447, - -891, -311, -1136, 1638, 1150, 586, 1656, 260, - 538, -1746, 1460, -478, -860, 297, -605, -139, - 822, -3718, -194, 307, 609, 30, 3418, 226, - -338, 161, -387, -344, -472, 354, -170, -421, - 433, 601, -1446, 821, -48, -31, 493, 916, - -347, -3740, -899, 1389, -355, 71, 382, -644, - 485, 218, 975, -542, -3191, 742, -102, -783, - -1607, 473, 196, 1692, -71, 258, 2446, 1507, - -968, -1025, -1087, 637, -921, -1405, 1192, -88, - 2044, -1813, 922, 156, -1096, 1007, -695, -485, - -1015, -468, -316, 1825, 190, 2132, -205, -218, - -3556, -286, -1350, -212, -634, 120, 417, -311, - -90, 219, 870, -334, -1304, 523, 999, -144, - 98, 2157, 205, 45, -247, 1401, 2423, 278, - -766, -66, 309, -121, 316, -543, -3418, 932, - -803, 637, 436, -2341, 2016, 928, -836, -1212, - 702, -1179, -544, 6, -1429, 1014, 464, 1166, - 581, -291, 136, 0, 983, -799, 693, -230, - -727, -186, -310, -76, 698, -6, -660, 762, - 814, 451, -328, 4469, -454, 14, -423, -116, - -134, -568, 1535, -562, -629, -269, 826, 380, - 68, 282, -409, 640, -384, 218, -5702, -280, - -638, -2586, -557, -877, 49, 648, 434, 1178, - 3442, 883, -78, 2024, -253, -210, -1090, 198, - -67, -52, 3226, -671, -1606, 49, 1775, -422, - -173, 309, -720, -667, -505, 2073, -678, -1152, - -231, -519, -719, 422, -2614, -394, 543, -993, - 1449, 437, -463, -1286, 1191, -1274, -710, -463, - 659, 1493, 45, -832, -414, 306, 94, 1284, - -669, -1312, 1082, -917, 2489, -494, 547, 738, - -1696, -174, 282, -1442, -1455, 1633, 912, -428, - 964, 12, -2404, -485, 631, -311, 1810, 2912, - -16, 576, 50, -927, -175, 37, 673, -201, - 995, 684, -244, -251, -1444, 3195, 1863, -88, - -1183, -966, 1769, 36, -825, 766, 489, -86, - -365, -106, -1477, -330, 125, -253, -250, -523, - -731, -5130, 653, 395, 99, -845, -721, 127, - -287, 850, 479, 25, -30, 36, -782, 611, - 448, 99, 933, -20, -853, -949, -286, -379, - -654, -385, 1298, 547, 235, 1242, -583, -4147, - 81, -547, -1142, 1280, -223, -1712, -1501, 458, - -142, 2065, 208, 855, -1115, -187, 861, 1090, - -760, -2551, 2326, -378, -1205, 488, -241, 893, - 113, 176, 4060, -225, -41, -717, -26, -442, - -445, -312, 813, 494, 314, -210, -98, -788, - 255, 632, -506, 166, -704, -334, -214, -860, - -5281, 60, -34, -238, -147, 643, 520, 2038, - 28, 2433, -1694, -1316, -615, 572, -150, -107, - 349, -1763, -307, 78, -1124, -631, 1162, -326, - -277, -591, 558, 1016, -4668, -324, -815, -251, - -1284, 52, 294, -1283, 598, 630, -345, 641, - -34, 1085, 4247, 637, 1695, -858, 212, -243, - -64, 327, 557, 426, -321, 363, -652, 372, - 777, -567, -749, -1704, 414, 5299, 389, 242, - 39, 31, -315, 179, -102, 11, 62, 248, - 557, 706, 359, -85, 303, -403, 1531, 409, - -2092, 144, -1354, 54, -48, 51, -1787, 1278, - 942, 1264, -1495, 1671, 92, -899, -1149, 1908, - -903, -596, 342, 1749, -825, -13, 509, -1163, - 1065, 2405, -253, -741, 1099, -528, 2971, -412, - -235, -869, -136, -352, -489, -384, 745, -398, - -4197, 84, 1152, -497, 955, -161, 461, -16, - -871, 801, -93, -15, -352, 1826, -490, -536, - -2853, -633, 128, -1537, -1670, 538, 788, 1276, - 554, -340, 565, 1216, -1758, 384, -1313, -628, - 24, 835, -862, -927, 1792, -1042, 209, -784, - 807, -383, -1399, 3531, 52, -537, 205, -271, - 3071, 1678, -694, -2313, -1279, -1656, -428, -1063, - -1576, -323, -342, -257, -227, -716, -458, 1161, - -180, -71, -40, -1276, 1778, -3123, -378, -1363, - -827, 880, 275, -274, -581, -186, -8, 661, - -1114, -199, -171, 379, 429, -1551, 1645, -857, - -163, -2623, 1217, 1458, -596, -68, 383, 973, - -485, -354, -597, -2875, -516, 234, -83, 340, - -396, 1365, -574, -816, -2086, -1059, -1589, -593, - -779, 334, -546, 49, -1065, -1959, 1736, 1134, - 187, 1833, 17, -82, 68, 803, -456, -89, - 1760, 836, 1570, 122, -985, 2549, 1616, 82, - 1102, 227, 222, -1236, -155, -1012, 633, 467, - 163, 445, 166, 766, -253, -347, 1041, 5121, - -21, 792, 81, -478, 128, -158, 316, -1180, - -372, 1692, -828, -31, 1122, -2583, 1346, 2483, - 195, 72, 549, 424, 947, -470, 1940, -75, - 505, 1377, 550, 58, 1785, 343, -817, 874, - 3483, -307, -576, 240, 35, 837, -717, -247, -}; - -static const int16_t cb0808ss1[] = { - 2328, 183, 1652, -907, -3005, 1329, -61, -465, - 0, -453, -1621, 223, 232, -59, 254, -312, - -117, -59, -477, -2648, -1176, -227, -1937, 962, - 141, -1489, 849, 93, -1284, 1000, 295, 192, - -139, -468, -736, -436, 2155, 371, 2475, -348, - 856, -1985, 38, 94, 496, 758, 954, -243, - 134, -1759, 491, -1406, 1114, -2554, -447, -692, - -2128, 44, -923, 1610, 787, 150, -500, 3442, - -698, 276, -517, -1555, 379, -72, 810, -1373, - 2897, 936, -586, -438, 925, 1881, -419, 211, - 1724, 721, 885, 614, 253, 613, -1440, 509, - 842, -2407, -216, -1765, 451, 1419, 599, 689, - 1473, -175, -2974, -1015, 1983, -68, 640, 21, - 140, -1295, -556, -89, -836, 718, -343, -1903, - 443, 502, -1064, 1328, 86, 2049, 1235, 130, - 892, 1105, 692, -2968, -755, 473, 423, -1371, - -2032, 1885, -29, -516, -1118, 285, 482, 164, - -1932, -685, -819, 695, 715, -1520, 1300, -1188, - -121, -197, -4233, -141, 1279, 299, 208, 1071, - 20, 772, 692, 531, 257, 428, 78, 202, - -399, -27, 793, 1150, -736, 388, -1922, 155, - -410, 85, 1135, 835, 133, -88, 65, 62, - -534, -136, -4590, -162, -968, 1378, -445, -2825, - -93, -519, 402, 12, -1110, -637, -765, 210, - -2305, 654, 447, 26, -265, -91, 71, -886, - 126, -109, 7, 346, 19, -713, -257, 774, - 1080, -579, 185, 200, -5691, 541, 228, 424, - 37, 512, -78, -201, 848, -369, 1099, -1001, - 214, -336, 266, 2502, 1583, -2131, -654, -2476, - -97, -787, -738, 1056, 1385, 124, 944, -3421, - 1172, -547, -226, 1249, 1552, 1194, -308, 489, - -1152, 751, -92, -168, -3112, -1451, 2038, 35, - 371, -1585, 535, 308, 5, -53, 523, -169, - 591, -175, -1028, 91, 743, -144, 230, 1831, - -177, 509, 1291, 1808, -3322, -815, -227, -475, - -1064, -647, 79, 1223, 174, -10, -412, 393, - -305, 1224, 1310, 12, -521, -1267, 1911, 2245, - 407, 724, -1232, -2017, 566, 506, -467, 813, - 660, -196, -3643, 2495, 870, -561, 289, 662, - 654, -508, -734, -325, 622, 220, -309, -307, - -181, -445, 131, -1655, -835, -631, 883, 211, - 737, 552, -881, -3103, -766, 595, 112, 151, - -1177, 601, 479, -14, 37, -926, -505, 1062, - -1755, -799, -178, -555, 2509, -694, -792, 662, - 737, 847, 1611, 397, -67, -134, 474, -2251, - 2698, -245, 2054, 1603, 1291, 1188, 40, 763, - -216, 1554, -297, -1769, 410, 1270, 1089, 440, - -967, 294, -37, 270, 471, 1287, 3773, -108, - -610, -275, -298, 270, -384, 2072, -675, 1002, - 174, 18, 171, 704, 3311, -105, -1774, 108, - 511, -3001, -69, 543, -227, -1196, 1431, -63, - 6, 1279, -1, 671, 239, -2127, -1924, -934, - 168, -300, 1075, 1071, 3088, -590, 1439, 329, - 1073, 127, 762, -131, 274, 837, -134, -610, - -399, -1415, 1047, -156, 415, 765, 698, 428, - -748, 241, -4226, 152, -829, 1040, -937, 145, - -852, -85, -2957, -130, -406, 726, 168, -37, - -1321, -1069, -1255, 1159, 1575, 552, 649, -1953, - -17, 1027, 1078, -385, -2761, -553, -201, 58, - -1900, -24, 283, 1248, -90, 419, 1122, 902, - -1548, -32, 34, -360, 707, 45, -3458, -246, - 287, 308, 397, 393, 822, 1323, -565, 505, - -1553, -1902, -677, 625, 1079, -135, -2132, -187, - -163, -1001, -1479, -932, 1131, -2588, -316, 53, - 1270, -747, -966, 980, 242, -266, -1575, -1146, - -605, -523, -221, 585, -787, 1365, -286, -183, - 411, 546, 4779, -286, -578, -101, 309, 896, - 34, 451, -1022, -699, 170, 935, 458, 4143, - 229, -572, -912, -397, -40, -132, -198, 98, - -1858, 612, 101, -98, -18, -349, 322, -1626, - 1304, 273, -235, 418, -509, 3961, -493, 1040, - -416, 1808, 161, 1443, 1052, -460, 55, -67, - 41, 514, 1305, -836, -1636, 1353, 379, 147, - 398, -3814, -679, 235, 327, -2293, -716, 1234, - -728, -323, 698, 1992, 4, -275, 944, 895, - 212, 334, 285, -710, -891, -1325, 3107, 3, - 367, -1779, 300, -868, -59, -644, -326, 111, - 267, -43, 421, 976, 57, 1461, -172, 245, - -188, 296, -215, 5269, -46, 177, 199, -539, - 92, -542, 251, 951, -231, 117, -580, -898, - 402, 847, 4, 384, -215, 161, -1991, 4422, - 2461, -1219, -751, 1843, 1483, 1072, 2621, -16, - -1157, 243, -557, 651, 953, 476, -417, -533, - 505, -590, 713, 153, 1268, -312, -217, -124, - 870, -484, -751, -161, 897, 755, -823, 4117, - -1311, -729, 447, -642, 929, -2408, -338, -967, - -104, -1048, -2216, -1722, -124, -204, -196, -1156, - 1460, 391, -543, 120, 70, 204, 1185, -2490, - 2950, -507, -615, 1243, -150, -363, -475, -531, - 783, 671, -205, -591, 217, -523, 263, -14, - 71, 958, -1185, -1029, -330, 327, -705, 1229, - -2925, 131, -495, 1756, 2101, 441, -11, 133, - 1274, 1253, -154, 772, 522, 1725, -277, -1012, - -726, 1339, -1200, -241, 1676, 974, 2256, 347, - 2743, 1482, -738, -241, -868, -1294, -664, 855, - -1329, -4174, -1647, -104, 101, 307, -647, -823, - 347, 4, -120, -1112, 334, 27, 265, 990, - 319, -1414, 313, -603, 52, -3138, 1552, -612, - -854, 626, 212, 773, 2334, 662, 614, 560, - 589, -533, 1337, 229, 557, -26, 1458, -626, - 1890, 2392, -1525, 1023, 667, -431, 72, 1691, - 1015, -97, -515, 1380, 796, 1192, -39, 162, - -2821, 2960, 1558, -1058, 1327, 793, 1231, -743, - -1190, -245, 29, 486, -494, -1371, 1633, -66, - -1806, 231, -664, -147, 2402, -584, 473, -527, - 1272, 464, 1991, -1007, -235, 357, 201, -1176, - -341, 223, -47, -2089, 815, 49, 192, -719, - -1041, -248, 3046, -40, -501, -346, -1347, -401, - 57, -1588, -1039, 443, 590, -1089, -182, -1365, - -1013, -3917, -382, -98, 1025, -51, 698, -197, - 848, -75, 1596, -408, -1796, -3191, 1155, 234, - -100, 698, 571, -1233, -315, -1502, -647, -571, - -322, 842, -1048, -1115, 8192, -784, -472, 17, - -718, 37, 1190, -393, 146, -547, 90, -433, - -321, -1143, -501, 468, 235, -486, -64, -2214, - -330, -837, 1214, -127, 709, -3, 623, -384, - 221, 297, -783, -3802, -408, -11, -707, 92, - -275, -268, -117, 1580, 1466, 710, -1300, 142, - -746, 1647, 2399, -1231, 114, 1220, -1112, 882, - 467, -973, -976, 3855, -647, -150, -1244, 973, - -364, -154, 473, -675, -817, -346, -266, -769, - -613, -476, 1181, -8, -1054, 405, -768, 1385, - -1598, -892, 672, -2185, 83, -27, 582, -434, - -944, 99, -888, -1658, -1516, 2392, 726, -222, - 284, 324, 4848, -67, -782, -45, 424, -203, - -194, -1229, -114, -189, -216, 275, -935, -93, - 117, -1725, 360, -2561, -1555, -1199, -769, -285, - 74, 1267, -387, 1368, 179, -113, 952, 1025, - 725, -542, -186, 1258, -1396, -747, 572, 603, - 1965, -668, -12, -2512, 1337, -255, 254, 2285, - 1136, 1397, 557, -671, -1149, -614, -462, -913, - -452, 1206, -2922, 485, -882, 270, -1309, -605, - -21, -580, -1284, -194, 169, -2314, -216, -229, - 1124, 103, -1205, 1500, 1118, 1456, -1149, 780, - -467, -385, 585, -1062, 289, -3356, 198, -309, - -310, 91, 44, -377, -632, -737, -516, 30, - -779, 73, -482, 4661, -275, 38, -632, 479, - -345, -406, 76, -208, -230, 80, -220, -313, - 203, -3, 1740, -131, 773, -30, 372, 767, - 1673, -770, 3326, 1586, 234, 408, -257, 474, - -584, -990, 1378, 696, 47, -612, -313, 189, - -3964, 795, -289, 202, -437, -1648, 373, -780, - -24, -952, 123, 438, 797, 539, -481, 191, - 291, 37, -790, -321, 4520, -49, -281, 211, -}; - -static const int16_t cb0808sm0[] = { - -4664, -115, 59, -280, -199, -25, 213, -937, - 344, -2137, -841, -370, 256, 512, 1098, -130, - 58, -121, -414, 8192, 489, -296, -33, 98, - 49, -217, 721, -42, -418, -227, -8, 205, - -276, 407, -1218, -146, -292, -143, 113, 978, - 2693, -9, -1032, 1781, 1777, -215, -978, -824, - 68, -162, 55, 2991, -844, 682, 497, 406, - -922, 2471, 599, 774, -129, 1292, -1004, 777, - 42, 314, -102, -963, -2794, -2620, 510, 355, - 372, -248, -391, -163, -298, 561, 117, 1183, - 38, 182, 1811, -4, 328, -13, -456, 305, - 368, -1691, -2818, -1074, 1029, 261, -1446, 343, - 12, -2757, 1021, -375, -3, -155, 116, 195, - 3420, 64, 139, 780, 187, -464, 261, -313, - -128, 185, 3703, 3160, 960, 706, 41, 405, - 10, 1191, 353, -549, 131, 164, 105, 1, - 23, 386, 73, -509, 2651, -1441, -834, -1657, - -645, 1005, -777, 695, 212, 1420, 65, 701, - 25, 335, 136, 359, -112, -150, 191, 392, - -258, -1140, 651, -4551, 411, 251, -169, 804, - -83, -208, -363, 81, 152, 75, -1194, -203, - -9, 157, 413, -62, -210, 5393, -22, -407, - 132, -288, 2360, 131, -1535, 553, -2524, -140, - 250, 1259, -30, -1, 1766, 99, -529, 91, - 3948, -262, -3752, -382, -339, -701, -140, -787, - 67, -11, 331, -828, -443, 596, 47, 1634, - 31, -318, 39, 147, -670, -776, 707, -921, - 172, 971, 1163, 48, -81, -1357, -181, 2872, - -152, 898, 1075, 529, 91, -2279, 2925, -848, - 589, 1910, 549, 1088, 743, -631, 42, -1528, - 23, 380, -5, 389, -1147, -209, -2041, 224, - -1998, 520, -776, 193, -2648, -78, -34, -131, - 22, -200, -28, 18, 328, 215, 67, 61, - 50, -72, 301, -207, 413, 720, -6194, 967, - -3275, 149, -2444, -521, -772, -278, 137, -159, - 932, -111, 1219, 525, 17, -684, -1229, -1776, - 66, -2307, -195, -527, 272, -470, -356, -7, - -338, 146, 1021, -893, -2980, 591, 129, -257, - 209, -58, 538, -3973, 576, -905, -642, -2092, - 153, 737, -596, 573, 236, -887, -1692, -370, - -189, -216, -58, 714, 10, -582, 517, -86, - 450, -147, -310, 162, 1747, -656, 3577, 700, - 190, -685, -170, 241, 91, -126, 5567, 441, - -50, -688, -73, 938, 320, -130, -839, 1154, - 149, -446, -10, -11, 12, -659, -138, 637, - -470, 933, -431, 235, -86, -2, -407, -5851, - -250, 1414, 525, 110, 421, 255, -149, 86, - 378, -321, 1380, 118, -2849, -1138, 180, 1175, - 1932, 32, -488, -121, -412, -441, 397, 249, - -172, -95, 420, 375, -132, -215, -167, -206, - 8192, -116, -61, -311, 269, 615, -353, -115, - -383, 366, -651, -196, -98, 85, 861, 543, - -231, 237, 493, 380, -766, -168, 3227, 659, - 701, 181, -3004, -7, 154, 298, 298, -257, - -32, -5713, 48, 102, -776, -148, -110, 316, - -645, 212, 213, 575, -69, 31, 553, -673, - -5, -48, -148, -133, 11, 143, 10, 159, - 319, 43, 7462, 162, 228, -90, 75, 151, - 103, -2542, -13, -338, 11, -442, 123, -3039, - -452, 7, 106, 502, 227, -2034, 90, 500, - -28, -646, -262, -62, -78, 40, 419, 6761, - -11, 40, 209, 61, -151, -68, -245, -401, - 26, -123, 189, -57, 611, 6, -1285, -99, - -890, 3609, -302, -808, 639, -3245, -226, 107, - 54, -108, -316, -61, -56, 228, -16, 195, - 275, 214, -60, 77, -7157, 130, 8, 244, - -2160, -760, 450, -186, -378, 32, -797, 214, - -3569, -450, 307, -17, -141, 16, 1024, 404, - -2063, -288, -160, 4056, 877, -346, -970, -87, - 336, 961, 666, 585, -465, -1329, 350, -338, - -5421, -173, -295, 72, -201, 533, 462, -133, - -937, 1891, 264, 71, -935, 640, 687, 852, - -386, -85, -5644, 306, 240, 640, 67, 94, - -902, -351, -417, -3, 284, 38, -156, 359, - 53, 139, 185, 274, 2613, 213, 1282, 2867, - 30, 1234, -911, 343, -93, -1671, 57, -814, - -19, 326, -256, -113, 72, 3177, 3393, -125, - 460, -261, -503, -1019, -681, -253, -957, -157, - -117, -231, -212, 1446, 225, -3009, 313, -435, - 387, -928, 696, -857, -452, 66, -2063, 782, - 14, -94, 51, 242, -422, 236, -3825, -666, - 348, 196, -2770, 429, -416, -266, -1215, -586, - 84, 328, -302, 219, -457, -532, -764, 85, - 2008, -806, 2906, -1405, 367, 835, 715, -986, - -217, 88, -328, 569, -586, 3096, 249, -615, - 453, 176, -540, 792, -2472, 2189, 876, -353, - 111, 212, -7, 597, -154, 818, -401, -1408, - 748, 2502, 1426, -2897, 1069, 326, -605, 120, - -4149, -3087, 729, 82, 224, 320, 353, -77, - -163, -322, 220, -1073, 10, 545, -518, -453, - 50, -386, -2002, 614, -705, -806, -928, 2941, - -520, -35, 1208, 413, 900, 138, -414, -289, - -15, -75, 185, -373, 649, -251, 666, 2708, - -2817, -749, -159, -112, 454, -385, 1037, -46, - -25, -14, 66, 552, 160, -40, -552, -156, - 151, -5287, 541, -242, -82, -1164, 849, -773, - -136, -162, -76, 23, -371, -222, -2245, 468, - 425, -356, 418, -3, -322, -3573, 148, 260, - -155, 3301, -165, -3186, -709, -458, 870, 386, - 59, -161, 533, -150, 598, 384, 900, -1233, - -74, -464, -519, -661, -55, -2562, 290, 1489, - 1739, 2277, 874, -1483, -447, 93, 309, 311, - -203, -19, 2271, -1280, -125, -443, -538, 2650, - -42, 290, 245, -149, 24, 38, -133, 1638, - 210, -239, -180, 516, -12, -719, -19, -517, - -6190, -181, -89, 318, 485, 631, 11, -205, - -57, 257, 573, -72, 273, -579, 107, -5, - 112, 425, 2449, 2741, 758, 656, -663, -282, - -48, -45, -294, -448, -5562, 61, -1, -464, - -263, -688, -115, -15, -108, -569, -448, -48, - -180, -105, 14, -180, 490, 274, 625, -588, - -120, -196, -305, -126, 435, -2490, -2693, -3414, - 31, 97, -167, -114, 247, 7695, -189, -580, - 219, 241, 188, 327, 179, -193, 135, -176, - 127, 479, 529, 234, 112, 234, -358, -286, - 1109, 2940, -610, -13, -2650, 495, 1355, -574, - -43, -1497, -292, -503, 564, -363, 24, -313, - 1387, 221, -3612, 783, 637, 43, 1351, 217, - -21, 149, -3104, 190, -259, -201, -342, -201, - 166, 2411, -1082, 283, -382, -725, 157, 155, - -1609, -592, 527, -2959, 9, 216, 526, 79, - 54, -132, 202, 785, 929, 1755, -663, 366, - -3735, 3282, 305, 572, -36, -111, -231, 119, - 603, 1357, -153, 553, 363, -760, -1188, 890, - 147, -3844, -3788, 150, 257, -588, -234, 497, - 361, -543, 255, -175, -377, 49, -616, -200, - 4115, -541, 130, 678, -3458, -506, -218, -1317, - 889, 29, -104, -2, 532, -393, 513, -792, -}; - -static const int16_t cb0808sm1[] = { - 4123, -74, 639, 326, -110, 1896, 826, -855, - -299, -452, 536, -323, 262, 79, 486, 144, - 270, -64, 277, 154, 399, 50, -7270, -61, - 14, -8, 19, -104, 333, 119, 374, 389, - -196, 77, -322, 261, 75, 386, 162, 2360, - 644, -2785, 355, 277, -121, -148, 156, 2136, - 112, -453, 429, 171, 2405, -1245, -775, -181, - 2110, -583, 127, 889, -290, -550, -165, 1027, - 2155, -351, -936, 432, 2689, 217, -20, 646, - -785, 908, 654, 970, -294, -41, 466, -245, - 138, 50, -108, -366, 177, 481, -2118, 968, - -594, 3892, 528, 188, -613, 18, 283, 733, - -35, 1598, 387, 1, 156, -206, -437, 203, - -244, -347, 325, 296, 100, 1171, 49, 920, - -418, -54, -2756, 24, 123, 1018, 303, -501, - 901, -447, 322, -2361, 1039, -1067, 877, 1329, - -143, -2773, 269, 1560, 398, -3193, 102, 990, - 279, 379, -204, -144, -174, 139, 411, -234, - 21, -5064, -188, 365, 278, 353, -189, 94, - 593, -402, -353, -257, -788, 383, -1036, 569, - -72, -1764, 571, 1003, 629, 670, -1400, 0, - -435, 64, 189, 2874, 239, 1128, 992, 1213, - 69, -128, 207, 713, -2436, -931, -387, -111, - 1064, -170, -2853, -1072, -367, -1048, -238, -60, - -49, 340, 2382, 370, -245, 351, 248, -64, - 2331, 458, -484, -34, 281, 689, 483, 636, - 199, 3153, 607, -124, -3296, 953, -407, 49, - 455, 1083, 690, -169, -725, 311, -493, -1761, - -3054, 376, -544, 479, 91, 159, -2837, -1257, - -830, -948, -254, 289, -1039, 856, 86, 1123, - 203, -768, 1089, 73, -866, 308, 437, 674, - -2067, -240, -1079, 33, -1069, -3502, 756, -676, - 45, -2544, 378, -365, -275, -293, -394, -649, - -507, -2850, 672, 370, 186, -417, 682, 185, - -15, 2863, 21, -165, 356, -3776, -103, 535, - -416, -345, -31, 24, -90, -205, 96, -966, - 94, 424, -5, -188, 149, -2193, -183, 2342, - 425, -647, -1697, -627, -444, 1248, -967, -702, - -48, 3616, -3484, 774, -299, 94, 421, 472, - 71, -144, -523, 114, -172, 349, -285, -106, - 101, 59, 429, 512, 3362, -38, -62, 50, - -225, -1408, 780, -2747, -404, 489, -975, 840, - 357, 982, 488, -275, -109, 393, 375, 4794, - 183, -110, 922, -760, 61, -1067, -8, 322, - 74, -101, 554, -350, -486, 66, 384, 748, - 14, 223, -45, -386, 69, 6231, 247, 325, - -320, -47, -50, -165, 153, -380, 589, -3243, - -173, -140, 341, -747, -1559, 639, -1658, 356, - 110, -150, -273, 76, -632, -425, -227, 640, - 211, 192, -747, -165, 4608, 290, -160, 1268, - 2754, -3, 578, 189, -485, -2747, -123, -1309, - 662, 601, 43, -136, 84, 1625, -1113, 1400, - 75, -126, 3581, -243, 2339, -514, 2203, -400, - -483, 521, 30, -246, -76, 359, 101, 663, - -40, 57, 52, 360, -447, -290, 254, 104, - 102, 113, 215, -163, -388, 299, 4570, 31, - 108, -41, 41, -2633, 2891, 1188, -505, 1061, - -349, -604, -449, -374, -320, 969, -304, -192, - 246, -152, 441, -46, -1416, 137, 1987, 495, - -63, 1087, 875, 699, 201, 211, -3157, -273, - -60, 195, -2813, -239, 2486, -55, 294, 315, - -133, 448, -1849, 363, 1063, 76, -928, -574, - -72, -57, 168, 5673, -156, -116, 400, -124, - 82, 218, -487, 37, 112, 53, -544, 178, - 99, 480, -7179, -196, 271, -160, 308, -62, - 393, 394, -220, -740, -14, 92, 408, -364, - 299, -305, 76, -239, 26, -312, -234, 34, - -189, 871, -297, 364, 282, -321, -927, 4511, - 2, 6, 308, -82, 87, -128, 518, 82, - -4509, 1145, 960, -109, -186, 83, -144, 752, - 84, -2876, -162, 877, -249, 317, 510, 338, - 298, 744, 2892, -791, 363, 1088, 630, -2506, - -1, 3150, 219, 130, 119, 313, -822, -668, - 1201, -2948, -237, -106, -711, 405, 276, -255, - 0, 440, 161, 2587, -734, 3376, 276, 154, - 287, -200, 594, -29, 198, -237, -608, -445, - -286, 202, -783, 112, -3879, 78, 2809, -337, - -606, -684, -434, 559, 273, 201, 331, 903, - -53, 346, 700, 2599, 302, -590, -2551, -498, - -26, -667, 576, -546, 457, -289, -1408, -1021, - -63, 78, 153, -83, -696, -3105, 2498, -1502, - -1249, -238, 254, -287, 215, 313, 279, -517, - 67, -58, -148, -1111, 58, 5151, 346, 283, - -367, -900, 542, 209, -438, -128, -135, 54, - 7, 869, 291, -1073, 775, -61, -145, 457, - 562, 1332, -4589, 99, 1366, 184, 980, -920, - 80, -266, -152, -1877, -266, 364, -1432, 272, - 2275, 567, 60, 50, -2504, -386, -700, 373, - 6775, -15, -434, 347, 215, -369, -20, -281, - -243, -325, 227, -283, -665, -74, 336, -674, - -112, -369, -53, -396, 328, 3588, -541, -557, - -164, 1305, -817, -462, 1986, 1249, -574, 130, - 152, -2375, -425, 442, -3827, 322, -728, 563, - -179, 534, 620, -937, 590, -1, -59, 584, - 175, -193, -168, -5, -150, 156, -175, -178, - -245, -7481, -273, 212, -35, 318, -178, 446, - -55, -26, 42, -46, -265, 767, 330, 295, - 910, -54, 490, 2952, 598, -2578, -644, 403, - 149, -88, 549, -510, 596, -225, -2341, -286, - -2724, 5, -1960, -262, 922, 537, 646, -62, - -18, 8192, 484, 112, -222, -211, -224, 317, - 112, 82, -853, 1, 176, -475, -162, 200, - -193, 166, -228, -214, 72, 417, -27, -16, - 4, 395, -515, -6832, 28, -47, 626, -173, - 63, 90, 141, 217, 1037, 335, 4520, -896, - 111, 91, -656, -103, -729, -29, 653, -599, - -11, 2734, -378, -291, 60, 228, 47, -3670, - -192, 653, 733, -597, 898, -420, 1572, -133, - -154, 329, -259, -225, 218, -82, 117, 300, - -479, 277, 787, -1719, 136, -3603, 702, 1357, - 3340, 362, -438, 131, -1463, 367, -467, 1722, - -2186, 343, -379, 1221, -562, -260, 1157, 2692, - 37, -89, -322, -322, 8192, -284, 235, -528, - 113, -359, 44, 74, 119, -917, 403, 410, - -150, 157, 514, 168, 407, -246, -31, 510, - 105, 449, 4612, 635, -90, -1260, 774, -284, - -80, 456, 7, -3000, -324, -212, -104, -374, - -440, 1268, 2736, 53, -1178, -403, -438, -534, - 121, 261, -497, -73, 10, -262, 17, -1870, - 178, -1339, 224, 3115, -436, -448, 385, 894, - -1, 105, -18, 268, 342, 270, 891, 367, - 121, -325, -1610, -75, -3233, -189, -1050, 961, - -2833, -304, -51, 400, -284, -810, 824, -71, - -135, 194, 297, -297, 1129, 660, 518, 2426, - -225, 251, 4677, -176, -464, 296, -1208, -423, - -875, -581, -707, -1150, 499, -778, 28, 29, - 101, -4213, -127, -3681, 425, 481, -529, -679, - 11, 266, 127, -445, 527, -577, 310, 1465, -}; - -static const int16_t cb1110l0[] = { - -3748, -3820, -105, 16, -22, -7, 112, -14, - 52, 28, -42, -113, 132, -81, -8, -112, - 19, 33, -251, 117, -33, -9, -13, -28, - 60, -30, 29, 27, -58, -7, 4, 43, - -10108, -38, -3, 48, 3, -23, 202, -175, - -202, 71, -2143, 3, -82, -38, -113, 141, - 38, -66, -118, -38, -14, 148, -264, 143, - -13, -56, -9, -21, -28, 8930, -23, 53, - -40, 30, 72, -46, 26, 66, 22, 32, - 44, 22, -50, -66, -115, -141, 24, -3013, - -3460, 492, 207, -62, -567, 134, -26, -64, - 287, 343, -213, 42, -274, -144, -144, -77, - -26, -39, 4, -4, 42, 43, 30, -16, - 34, 113, 9291, -171, -17, 24, -53, -27, - 45, 42, 533, 146, -65, 32, 156, -144, - 2821, 889, -7, 614, 11, 1, -473, 434, - 659, -323, -2448, 23, -138, -582, 436, -152, - -30, 29, -290, -302, 3127, 496, 14, -346, - -70, 457, -1976, -229, 53, -2077, -313, 58, - 33, -91, -175, 141, 2728, 3232, -2150, 245, - -142, 13, -318, 70, -152, -64, 132, -322, - 44, 30, -70, -184, 433, -25, -97, -2035, - 145, 47, 640, 179, -441, 48, -108, 1742, - -280, 33, -3259, 79, -147, 324, -80, 65, - 48, 90, -7, -21, 22, 3, 56, -30, - 14, -2, -111, 22, -8, -8252, -103, -36, - 57, -203, 287, -2761, -220, 143, 11, -3597, - 21, -81, 62, -99, 41, -172, 108, 29, - 351, -370, 15, -122, -207, 275, -93, -2760, - 400, -212, 225, 230, -239, -3530, -73, 211, - 288, 85, -6, -634, 57, -78, 361, -149, - -1843, -23, 17, -37, -71, -174, -237, 42, - -22, -243, 63, -101, 131, 35, 136, -4025, - 41, -262, -57, 197, -290, 307, 35, -16, - 3, -5, 45, -7, 1, -47, 41, -19, - 79, 78, 42, -85, 74, -414, 1696, 703, - 297, -3296, 108, -546, 1129, 44, 447, -433, - 315, -1012, 133, 141, 1051, 601, -18, -532, - -30, 712, -127, -210, 10, 2442, -95, -46, - -14, 77, 32, -11, 10, -103, -15, 637, - -60, 352, 694, -202, 284, -5524, 92, -82, - 5, 140, -54, -115, 45, 287, -14, -307, - -342, 10, -181, 50, -30, -6, 10144, 77, - 42, 13, 26, -20, 34, 10, 37, -37, - -47, 90, -5, -44, -85, -64, -51, -1, - 16, -152, -91, 212, 4, -25, -237, -6124, - 22, -120, -1, 171, -17, -43, 141, -13, - -57, -185, 80, 273, -493, 178, 45, 11, - -57, 16, -23, -30, -37, 82, 4, -13, - -130, 98, 272, -450, -161, 133, 5104, 14, - 4576, -193, 11, 55, -30, 1, 123, -265, - -84, -340, -18, 152, -24, -266, 33, -90, - -108, -639, 1662, 299, -14, -389, 4679, -226, - 21, 311, -294, 159, -209, 172, 184, 292, - -373, 169, 84, 55, -269, 1453, -50, 41, - 68, -9, -62, 35, 23, -132, 96, 58, - -122, -3956, -318, 210, -117, 678, -104, 378, - -842, 61, 2549, 37, 149, -512, 70, -2971, - 225, -411, 230, -214, 697, -58, -871, -281, - -128, -204, -37, -128, 51, -174, -405, 497, - -4455, -219, 124, -120, 63, 135, 201, -122, - -435, -677, 221, 138, 486, 535, 3153, 165, - 11, -275, 94, -100, 69, 52, -67, -742, - 212, 16, -93, -428, 863, -17, -2465, 767, - -35, -130, 97, 1387, 34, 72, -23, -17, - 2845, -90, -71, 213, 291, 87, 826, -63, - 189, 641, -256, 832, 2087, -199, -170, -193, - -62, -7, 37, -60, -4277, -43, 24, -69, - 574, -163, -113, 263, -86, 45, 171, 1075, - -154, -39, 121, 74, -132, 182, 34, 13, - -278, -41, 96, 716, -221, -626, 1205, 244, - -351, 3914, -78, -32, 2833, -150, -37, 95, - -227, -84, -3432, 57, 238, -143, -365, 39, - 27, -238, -307, -170, 124, 66, -133, 40, - 62, -19, 42, -66, 2, -80, -2, 60, - 7, 10, 263, -4987, -69, -389, 62, -53, - -66, 24, -87, 13, 34, -15, -25, -20, - 197, 9, 101, -83, -79, -156, -100, 2, - -108, 5687, -157, 878, -1728, 32, 72, -66, - 70, -2, -46, -163, 206, 17, 247, 2974, - -66, 1354, 335, 238, -249, -410, -553, 354, - -41, 132, -96, 68, 2174, -329, -58, -76, - 6, 3089, 284, -274, -398, 471, 283, 427, - -220, 81, 2676, 40, -23, -46, 251, 109, - -3059, 50, -25, -551, 124, -389, 228, 95, - 56, -1320, -79, 1027, -4938, -105, -82, 13, - -159, 52, -101, 23, -220, -77, -153, 113, - -282, 42, 185, -144, -402, 46, -144, -99, - -2862, -3432, -2, 16, -32, 23, -25, -145, - 181, 49, 6, -236, -226, -28, 234, -26, - -89, -14, -355, 146, 117, -50, 76, -10, - 441, -95, -2, 346, -242, -3745, 884, -305, - -184, 350, 18, -293, -328, 257, 109, 49, - 157, -44, -70, 35, 6, 89, -4085, -167, - -263, -59, 35, -13, 430, -212, 17, -618, - -5, -8968, 114, 41, 73, -85, 122, 5, - 38, 19, -60, 14, -36, -42, -89, 20, - 85, -17, 20, 282, -3396, -25, 3722, 151, - -183, 100, -150, 19, -221, 126, 34, -21, - 72, 28, 138, -90, 30, 162, 46, 40, - 27, 15, -55, -21, 38, 55, 32, 83, - 9675, 31, 26, -2, 4, 96, -51, 120, - -132, 213, 2106, 39, -251, 98, -2572, -429, - -331, 1436, 2078, 335, -381, 371, 299, 339, - 300, -141, -99, -303, 2952, 49, 93, 40, - -3949, -45, 50, -215, 73, -39, -165, -283, - 46, -123, -347, 23, -158, 41, 20, 41, - -46, 19, 34, 86, -8770, 40, 20, -32, - -30, -16, 77, 72, -4, 92, -34, 103, - -77, 128, -532, -314, 24, 728, 49, -36, - -178, 76, 22, -14, -164, -194, 69, 3133, - 1007, -130, -280, 2502, 482, -2, 45, -62, - -7, -94, 17, 23, -4, 9516, -27, 11, - 22, 54, -13, 2, -2, 6, -22, -63, - 67, -686, 130, -2180, -124, 57, -61, -158, - 3364, 518, 4, 315, -367, -103, -295, 259, - -597, 56, -6, 72, -86, -45, -13, -47, - -13, -27, -3, 48, -12, -52, -6, -14, - -26, -16, -34, 9554, 80, 91, -270, 1, - -121, 117, 33, 8, 40, -99, -79, 43, - -3451, -92, -70, -57, 43, 68, 64, 284, - -639, 458, 118, -54, -2755, 370, -66, 54, - 27, -198, 331, 115, -40, -209, -312, 82, - -16, 8, 230, 212, 1853, -94, 1957, -118, - 153, -13, -73, 71, 116, -72, -3285, 106, - 19, -121, 177, -300, 455, -29, 94, 190, - -21, -8, 201, 16, 2, 83, -6280, 32, - -18, 59, -18, -41, -132, 22, 1, -39, - -212, -198, 186, 3154, -102, 3463, -280, -118, - -132, -132, 63, -19, 353, -24, -77, 224, - 82, 143, -65, 165, -16, -3774, 3543, -28, - -44, 93, -45, -13, -24, -5, -40, 58, - 3, 89, 71, 113, 46, 62, 44, 160, - -77, -8, -59, -6505, 134, -42, -73, 0, - 85, 2, 16, 34, 157, -34, -60, 78, - 24, 64, 96, 478, 231, -125, -217, 13, - 21, 44, 83, 198, -69, 21, -167, -52, - 4085, -234, -393, 17, -446, -354, -28, 42, - 53, -37, 28, 15, -16, -10, -85, 9471, - -16, -89, -87, -56, 52, -97, 86, -7, - -103, -12, 71, -39, 17, -40, 23, 63, - 65, -19, -14, -106, 29, 9707, -1, -12, - 1, -86, 100, 7, 1097, 266, 252, 197, - -64, -214, -197, -28, 3843, -1577, 310, -117, - 594, 13, 90, -309, -384, 134, -90, -194, - -316, 2884, 156, -185, 196, -103, 75, 1009, - 69, 768, -75, -605, -1488, 389, 242, 368, - 278, -122, -2500, 121, 7, -303, 91, -10, - 3642, 23, -109, -13, 138, -405, 18, -43, - 3, 42, 194, -112, 237, -2241, 23, 296, - -83, -14, -58, -163, -8, -174, -239, 85, - -108, -82, -79, 344, 236, -427, 127, 52, -}; - -static const int16_t cb1110l1[] = { - -64, 11, -74, -96, 39, 6072, 16, 46, - -215, 137, 77, 128, -195, -192, -87, 96, - 379, -73, 367, 437, -366, 84, -155, -29, - -69, -61, -34, -129, 260, -177, 3738, 739, - -221, -14, -40, 2, -483, -269, 2664, 166, - 29, -256, 30, 92, 51, 111, -45, 3893, - 90, -30, -99, 12, 74, 201, -52, -96, - -196, -85, -36, 123, -44, -68, 2, 8666, - 33, -41, 24, -12, -52, 69, 59, -27, - 38, -148, -55, -20, -60, 50, 3363, 30, - 3749, -92, 228, 173, -239, -167, -75, -79, - -86, -217, 32, 34, -137, -13, 17, -128, - -1462, -170, -224, -393, -3383, -1243, -47, 24, - -223, 26, 311, -343, -47, 784, 459, -548, - 558, 983, 103, 269, 32, 13, 19, -84, - -37, -29, -47, -6286, 7, 48, -100, 13, - 11, -271, -86, 115, -17, 183, 3247, -3336, - 57, -67, -117, -87, 19, 74, -271, 237, - -24, 242, 49, -179, 298, 85, -69, 328, - -238, -34, 103, -50, 79, 2, -27, -16, - -103, -61, 5868, -105, -262, 74, -74, -158, - 263, -110, 154, 212, -3, -84, -126, 25, - -67, -2501, -12, -35, 139, 259, -95, -141, - 137, 90, 12, -244, -142, 314, 15, -124, - 1, -25, -27, -2, -6, 28, -48, -17, - -2, 43, 67, 42, 9023, -25, 19, -13, - -23, -43, 73, -30, 143, -1, 2884, -142, - -4, 3549, -49, -366, 110, 314, 19, -55, - 363, 204, 469, 189, 217, -181, 119, 41, - -133, 29, -55, -94, 71, -49, 41, 85, - -14, 6140, 71, -142, 10, 18, 169, 136, - 282, -49, 36, 446, -99, 263, 92, 2201, - -127, 43, -143, -350, 36, 389, -208, 15, - -3610, -275, 383, 1599, -179, -177, -1100, -4, - 67, -38, 2, 278, 39, 107, -120, 465, - 204, -397, 305, 416, 7, -262, 68, 2341, - 189, -75, -23, 25, -20, -74, 56, -43, - -125, 170, 509, 63, 26, 263, -741, -31, - 8, -296, 101, 20, -149, 2846, -218, 379, - -310, 151, 901, 84, -85, -83, -387, 161, - -3102, -158, -438, 38, 191, -58, -202, 127, - 126, -88, -430, -3077, -1829, -332, 61, -152, - -14, -32, -156, -5, -375, -1083, -5130, 110, - 77, -201, -15, 4, 13, 86, 119, 67, - 149, 80, 264, -253, -121, 63, 193, -103, - -129, 63, 120, -226, -100, 3196, 72, -11, - 8, -56, 279, -73, -192, 47, -87, 125, - -43, -108, 277, 188, -107, 289, 5966, -20, - -303, -78, -21, 40, -139, 44, 28, 6, - -254, -244, 47, -1, -151, 29, -344, -2318, - 30, -3767, 114, 84, -155, 85, -90, 155, - 111, -506, 6, 453, -241, 215, 131, -802, - 15, -343, 176, -430, 251, -74, 6, -41, - -44, -131, -105, -248, 346, 39, -4524, 93, - -120, -79, -777, -416, -570, -221, 21, 28, - -52, 56, 71, -187, 2949, -2531, 666, 799, - -137, 970, 243, -695, -148, -281, 326, 450, - -734, -99, -2078, 112, -83, -90, -78, 262, - -138, -31, -5, -74, -171, -99, 344, 143, - 4035, 56, -121, -921, -8, 46, 4576, 97, - -219, -34, 123, -44, -1, 85, -36, 399, - -260, -231, 132, -318, 55, -181, 156, -3093, - 142, -9, -3418, -31, 43, 126, 136, 309, - -50, -20, 170, -90, 188, -173, 175, 50, - 144, -244, 22, 64, -476, -22, -66, 272, - 3839, 715, -188, -82, -250, -587, 10, 368, - -507, 242, -40, -531, 451, 35, 560, -107, - 138, 15, 113, 56, 242, 33, -23, -27, - 81, -157, 301, -327, 359, 3648, 62, -1489, - -167, 136, -39, 183, 53, -151, -16, -60, - -65, -5182, -17, -257, -10, 56, -104, 713, - -2, 328, 72, 353, 43, -51, -5949, 40, - 32, -82, -36, -22, 57, 56, 55, 112, - -104, 76, 5, 80, -29, 173, -360, -113, - 42, -119, 180, -26, 120, 250, -3024, 198, - 115, -140, 22, 136, 275, 698, -149, 699, - 426, -220, 279, 63, 55, -63, -108, -51, - -70, -70, 419, -156, 5870, 33, -57, -114, - -388, -213, -164, 1543, 117, 165, 1944, 223, - -83, 46, 201, 12, -103, 228, 139, -207, - 136, -1218, -544, -723, 90, -652, 793, -1, - -100, -32, -236, 49, 164, 138, 16, 82, - -3221, -62, -168, 62, -313, 98, -652, -484, - 684, -91, 33, -2926, -3453, 566, 34, 35, - 104, 13, 189, 235, -49, -324, 126, 226, - -102, 123, -253, -403, 38, 160, -5, 100, - -30, 16, -19, -44, 2, -70, -30, 82, - 118, 6, 132, -15, -36, 59, -8835, -448, - 3707, 324, 87, 67, -110, 114, -76, 294, - 354, 7, 140, 11, 340, -117, -559, 67, - 129, 201, -314, 328, -209, 102, -121, 378, - -5010, 140, 53, 15, -253, -14, 414, -183, - -70, -25, -51, 34, -347, -171, 146, -98, - -101, -3, -99, 96, 66, 50, -5, -115, - -23, -45, -351, -4202, 143, 480, -46, 140, - 17, -6312, -110, -23, 150, 60, -39, -9, - -48, -60, -8, -20, 37, 57, -162, 60, - -137, 55, -101, 65, 100, -8952, 3, -49, - -3, -9, 28, 15, -89, -136, 59, 125, - -73, -35, -111, -69, -28, 111, -16, 48, - 27, 9272, 55, 34, -92, 66, 3, 3, - -38, 12, 59, 95, -100, 3, 51, 121, - 146, -200, 142, -254, 65, 3, -169, -8, - -65, 44, 10, 15, -99, 56, -6, -108, - -20, -5461, -89, 395, 2085, 486, -48, 324, - 422, -3703, 468, 198, 239, 0, -277, -115, - -227, 227, -29, 159, -128, -447, -291, -1953, - -110, 25, 2274, 141, 177, 204, 38, -258, - 90, -8, -131, -2636, 55, 561, -99, -220, - -33, 142, -334, -160, -117, -12, -33, 6, - 72, -3, -11, 50, 1, -45, 8, 23, - -15, -33, -15, 30, -32, 107, 145, 14, - 60, 114, 45, 24, 8811, -9, 61, 192, - 16, 124, 46, -54, -31, 89, -147, -112, - 3341, -395, 91, -323, 45, -156, 25, -18, - 34, -534, 118, 83, -187, -92, 180, 34, - 659, 135, 103, -2342, 54, 6, 179, 40, - 143, 232, -3858, -201, 179, 32, -56, 406, - -236, 541, -70, -88, -121, 447, 3028, -223, - 138, -557, 230, 3457, 96, -4, -22, -13, - -136, -45, -123, -8, 107, 270, 132, -64, - -32, 464, -33, -44, -2544, -251, -246, -71, - -4063, 40, 107, 384, -22, -197, 64, 166, - -137, -44, 98, -35, 193, 4, -2103, 57, - -109, 245, 3487, -55, -60, 21, 187, -267, - 279, 3, 166, -78, 108, -135, 126, -122, - 171, -133, -21, -134, 183, 25, -56, -6210, - 107, 109, 22, -93, 39, 95, 43, -11, - -44, -5, -82, 6, -54, -27, -116, -16, - 84, 44, 22, -68, -1, -57, 78, 35, - 83, 4664, 46, 1, -164, 3301, -358, -3757, - 236, 104, -81, -121, -278, -112, -20, 89, - -123, 35, 113, 17, -331, 273, -172, 125, - -73, 77, 2515, -3944, -170, -87, 174, 84, - 142, 138, 13, 227, 127, 146, 141, 196, - 38, -40, -112, 136, 2311, 328, 87, -22, - -77, -34, -195, 58, -333, 337, -159, 626, - -3008, 408, 523, -316, 539, -587, -81, -2824, - 98, 200, 613, -107, -170, -1190, 1121, 521, - 229, -217, 143, 144, -1248, -384, 1535, 470, - -655, 492, -429, -26, -132, -180, 52, 97, - 10, -35, -60, 7, -5422, -26, 154, -132, - -221, 124, 136, -17, -68, 25, 29, 4, - 5, -15, 9, 69, -16, -47, -76, 5, - 41, 6, -22, 63, -8, 9709, -33, 650, - -545, -159, 81, -75, 54, -92, -49, -80, - 14, -78, -145, -399, -3935, 186, -1144, 207, - 60, 286, 2642, 44, 117, 3758, -154, 426, - 331, -615, -216, 271, -121, -109, 495, 42, - 813, -19, 545, -149, 633, -2424, -2089, 265, - -136, -58, 4, -28, 147, 2, -123, -93, - 14, -50, 317, 131, -130, -152, 322, 1023, -}; - -static const int16_t cb1110s0[] = { - -6433, 495, -277, -630, 411, 1241, -326, -425, - 523, 114, -225, -53, -538, -702, -260, -417, - -401, -222, -263, -416, 163, -1256, 590, -1176, - 1865, 1483, -927, -65, -674, 1303, -147, -750, - -132, 407, -283, 852, 1788, -2257, 210, -450, - 303, -272, -2536, 94, 2010, 428, -921, -3, - -71, -875, 156, -681, 521, 49, 51, -523, - 1532, 1619, -690, 402, -923, 318, 865, 193, - -2187, -662, 553, -1104, -70, -1313, 462, -1045, - 320, 937, -1453, -514, 404, -231, -1748, -1592, - -2039, -217, -364, -1313, -428, 2419, 1257, -1292, - 19, 2867, -278, -1832, -239, -691, -383, 62, - 185, -455, -1589, 116, 419, -319, -418, 537, - -280, -1834, 2681, -857, -210, -156, -1143, -104, - -1774, 1702, 184, 1017, -135, -610, 525, 335, - -355, -494, -231, -154, 986, 434, 1134, 1213, - 914, 1457, -258, -1086, 477, -2247, 498, -1741, - -975, -262, 812, 108, 834, -412, 120, -1032, - -533, -456, 139, -301, -387, -690, 798, 3, - -1556, 1261, 745, -4486, 8, 213, 977, -151, - -269, -344, 13, 544, -270, -166, -706, 672, - 184, -943, -1714, 1510, -739, 1891, -477, 528, - 1847, -1572, 420, 103, -85, 508, 231, 2024, - -1343, 20, 238, -655, 668, -1561, -743, -651, - 709, -1136, -208, 979, 258, -693, -535, -1126, - -283, -944, -209, 603, -1797, -2998, 253, -296, - 842, 63, -203, -468, 675, 337, 1458, 114, - 259, 3202, 145, 419, 631, 352, 2309, 1337, - 815, -99, -824, -779, -1839, -1455, 166, -2092, - 1299, 162, -1026, -914, 128, 1321, 896, -209, - 255, -1144, 807, -2870, -632, -588, 866, 81, - 453, 154, -1258, -499, -452, -98, 2599, 3070, - 540, -834, -228, -1268, -313, 1269, -65, -56, - 1035, -499, -507, -657, 447, 26, 96, -175, - 133, -291, -538, -259, 7, -206, 411, 145, - 25, 215, 267, -4354, -442, 250, -814, -143, - -459, -182, -640, -1258, 169, 379, -1196, 429, - -128, -1971, 2681, -45, 1641, 152, -556, 909, - 365, -618, -417, -363, -434, 270, -1388, -473, - 62, 58, 509, -3909, 1327, 1571, 482, 1081, - -896, 459, 480, -557, -267, 390, -15, 484, - 248, 52, 49, 702, -10, 162, 245, -416, - 1397, 23, 183, 325, 591, -816, 4429, 674, - -332, -1243, 68, 285, 235, 759, -315, 799, - 313, -331, -182, -629, 394, -1079, 3879, -81, - 651, -774, -21, -297, 231, -1826, 47, 104, - 284, -171, -198, -110, -193, 881, -715, 294, - -490, 395, -1261, 2859, -3175, -1477, 668, -215, - 310, 10, 762, -837, 101, 142, 201, -940, - 453, -82, 493, -983, 23, -211, 990, 1327, - 4664, -27, 821, 809, 500, 243, 41, 568, - 44, -320, 105, 461, 306, -408, -793, -35, - -18, 229, -12, -416, 577, -301, 4870, -520, - 499, 57, -544, -21, 611, 226, -20, -412, - 440, -680, 448, 430, 226, -610, -310, -218, - 1161, 523, -400, -148, 783, 395, -126, 370, - 686, -497, -301, 161, -5, 238, 375, 357, - -126, 954, 5952, -53, 121, -405, 1571, 435, - 461, -1166, -1163, 1347, 1394, 170, 2035, -1580, - -958, 276, -680, -968, 275, -323, 524, 48, - -1896, 46, -495, 548, -929, -859, 224, 1079, - 863, 3080, -1594, -379, 302, -403, 710, 655, - -293, -719, -683, -944, 228, -341, 563, -495, - 920, 738, -614, 552, -249, -402, -164, -262, - -425, -4025, 164, -984, -518, 157, -1156, -729, - 1024, -768, 1003, 481, -116, 319, -918, 1563, - -662, 4852, 617, -250, 549, -265, -93, 680, - 470, 925, -293, 629, 142, 231, 44, 133, - 12, 40, -867, 269, -77, 445, -1132, -985, - -1304, 728, 424, 530, -258, -625, 377, -1400, - -2538, -470, -1711, 413, -1603, -81, -393, -1013, - 1130, 906, 287, 640, 3785, -463, -159, 43, - -165, -441, -513, -287, -554, 1547, 848, -275, - 936, 653, 769, -58, -1007, -698, -792, 2175, - 398, 1382, -122, 459, -7, 281, 2785, -637, - 632, -279, 293, -1078, -996, 96, -293, -1335, - -74, -587, -286, -565, -977, -228, 5080, 3, - 171, 111, -34, -177, -619, 577, 448, -280, - 189, 1033, -579, 134, -713, -947, -249, -1897, - 364, 1748, -2098, 21, 859, -73, -1881, 116, - 36, 1591, 1386, -1128, -346, -1015, -25, -90, - -691, -984, -120, 29, -635, -236, 26, -691, - -742, -203, 294, -472, -901, 2582, -171, -357, - 406, 162, 1561, -913, 308, -3319, 461, 779, - -305, -927, 290, -941, 615, -688, -508, 222, - -432, 387, 170, -115, -5338, 508, -212, 150, - 26, -38, 306, -15, 50, 2008, -1112, -187, - 44, 591, -280, 1187, 934, -228, 554, 65, - -1387, -1999, -805, 2555, -1225, -283, -435, -430, - -50, -655, -103, 248, -234, 32, -826, -708, - -704, -1006, 176, 784, 274, 626, -2353, 707, - 1852, -132, -196, -169, -463, -2117, 56, 413, - -141, -818, -365, 921, -816, -126, -135, 438, - -948, -145, -349, 700, 205, 1001, -3626, 314, - -493, -1182, 131, 733, 2404, -1244, 564, -960, - 328, -1137, -108, -755, -168, -995, 966, -1706, - -565, 806, -693, 1369, -269, -428, 675, 768, - 341, -794, 2265, -208, -1883, -801, -1889, 961, - 182, -504, -595, 871, -1280, 952, 1351, 665, - 474, 1032, 58, 451, -198, 345, 176, -853, - -2891, 2250, 624, -616, 183, 144, 736, 0, - -198, -138, -1218, -501, -658, -24, 1232, -286, - -233, -937, 2150, -1035, 449, -623, -2748, -2176, - 918, -170, 421, 1376, 93, 153, 627, 493, - 28, 549, -292, -175, 1066, 1037, -475, 413, - -2006, -2022, -334, 365, 901, 945, -663, 515, - -351, -597, 155, 1318, -153, 417, -425, 44, - 338, -1958, -355, -596, -2134, 360, 341, 2501, - 824, -2106, -282, -1723, -735, -550, -743, 113, - 1027, -479, -2114, -16, -631, -282, -1054, 1320, - -158, -234, 3479, 28, 1818, 627, 1464, -795, - -22, 897, -6, 392, -234, -170, 714, -382, - 1262, 67, -618, 145, 25, -710, -247, -545, - -1386, -1797, -995, 865, 465, -364, 830, -53, - -1108, -383, -538, 85, 731, -188, -813, 2, - -1667, 3379, 289, 425, 1319, -259, -592, -212, - 271, -268, -126, 1282, 306, 3859, -1423, 607, - 20, 755, 174, -782, 72, -234, 675, -1177, - 1101, -635, -1641, 2574, -978, -1390, -1743, 2183, - 53, 75, 650, -97, -456, -126, -719, -675, - 557, -375, 643, 853, -81, -192, -1174, -1288, - -954, -883, -806, -2182, -2111, -1426, 180, -266, - -301, 626, -443, 61, -149, -443, -935, -48, - 642, 250, 17, 596, 1342, -2127, 323, -1456, - 1995, 837, -1456, -1683, 945, -722, -1445, 452, - 178, -441, -250, -137, -128, -50, -311, -600, - 2237, 922, 139, -107, -637, 1770, -2503, 413, - -803, 496, 209, -391, 401, 412, -552, 605, - -37, -667, -1609, -19, -1073, 1522, -705, 670, - -992, 882, -1213, -854, 2150, -371, 73, -1167, - -592, -153, -509, -584, -495, -83, 2075, -1489, - 719, 1245, -1138, 72, 950, -950, 542, -590, - 988, 1646, -64, 562, -223, 73, 583, -151, - 215, 914, 1391, -2997, 161, 436, 49, 2225, - 271, -283, 3844, -578, 335, -90, -698, -162, - 1236, -117, 470, 383, -718, 520, 295, 29, - 292, -179, 774, 204, 372, -251, -824, -487, - -1822, -312, -731, 568, -1008, -255, 189, -1195, - 657, -227, 3422, 651, -220, -1204, -590, 713, - 365, -977, 204, 3118, 321, 922, -347, 1505, - 375, -77, -1520, -1411, -680, -507, 543, -492, - -1844, 135, 689, 384, -408, 140, 633, -1192, - 475, 220, -1711, -1318, 606, -103, -712, -1734, - -218, -855, -835, -3071, -109, 1391, 62, 21, - -75, -77, 369, 216, -1484, 2057, 661, 314, - 275, 1048, 175, 1842, 743, 808, -594, 338, - -1217, 1606, -531, -1360, -1073, 452, -531, -798, - -771, -1292, -918, 606, -1776, -509, 178, 1422, - 3424, 634, 722, -257, 525, 437, -197, -130, - 291, -411, -259, -890, -84, 368, 1117, -1321, - -324, -2122, 515, 1158, 1749, -963, 681, 39, - 268, 549, 324, -601, 151, -200, 829, 3881, - 797, 660, -572, -693, 633, 1023, -147, -581, - 102, -207, -163, -511, -30, -102, 379, 776, - 494, -510, 55, -1811, 1073, 4384, -318, 3277, - 1958, -209, -539, 1823, 1200, -182, -186, 213, - 123, 506, -471, -431, -698, -331, -1168, 88, - 276, -184, 733, -295, -1053, -717, 862, -1453, - -4235, 1063, 1049, -621, -429, 372, 1043, 599, - 271, -693, -689, 122, 466, -323, 332, -533, - 645, 516, -371, -207, -2046, 72, -1125, -229, - -2769, -330, 1387, -89, 342, 2786, -730, 152, - 629, 809, -459, -248, -266, 111, 380, 724, - -411, 640, -72, 323, 34, -277, 443, 289, - 151, -4816, 402, -171, -731, 635, -84, -133, - -310, 397, 904, 1193, -1512, -25, -1306, 587, - 322, -3762, 537, -306, -981, 917, 190, 787, - -613, 149, 301, -376, 366, 350, 18, 893, -}; - -static const int16_t cb1110s1[] = { - -332, 1306, 1626, 1555, -3510, -225, 418, 1520, - -969, -74, -286, 233, -313, -97, 375, 181, - -309, 1348, 969, -504, -141, 789, -1224, -137, - -704, 98, 1003, 466, 2259, 1485, -225, 61, - 272, -223, -347, -23, -368, 96, 2345, 112, - 363, -552, -6, -806, -1637, -1703, 1597, -2114, - -196, 293, -1173, -630, -863, -1224, 784, -722, - 744, 885, 798, -384, 92, 298, -873, 1808, - 1389, 488, -1569, -1541, -3064, -734, 3, 467, - -987, 346, 1915, -683, 205, -487, 341, -330, - 274, -25, 49, -83, 1246, -405, -777, 266, - 121, -250, 466, -1232, -3197, -871, -638, -332, - 1563, 1900, -470, 556, -465, -412, 901, -86, - -683, -577, -1033, 808, -863, 1212, -724, 2222, - 429, 2733, 413, 891, 1669, 515, -439, 187, - -359, 414, 176, -706, 679, -63, 1247, -1721, - 779, -2770, -484, -633, -993, -243, 1442, -312, - -324, -370, 392, -407, 229, 97, 1267, -18, - 46, -303, -684, 515, -166, 4212, -775, -23, - -53, 23, 1966, -465, 231, 1195, 252, -1036, - 16, -824, -116, -582, -286, 470, -159, 217, - -456, 549, 648, 60, -1119, 221, -747, 354, - -628, -486, 894, 1280, -2631, 247, 430, -1703, - 69, -236, 147, 1445, 540, -936, 181, -163, - 931, -1044, 669, 2457, 519, 597, -2031, 11, - -1319, -4, -1190, 85, 254, -1494, 230, 1583, - -547, 277, -2006, -103, 1195, -2522, 1301, -633, - -104, -511, 573, 1628, -451, -1022, 564, -692, - 255, 1029, -408, 757, 172, -395, -472, -1703, - -1856, -379, 289, 509, -628, -1349, -207, 404, - -399, 1671, 392, -935, -190, 952, -1267, 1150, - 1562, -609, 491, -346, -270, -483, 310, 1420, - -1017, 1714, -645, 897, -1327, 3154, -1046, -857, - -499, -496, -1348, 399, 63, -653, -315, 820, - 1645, 614, 2202, 779, 3001, 1382, 387, -843, - -1840, 422, -1017, 246, -219, -550, 105, -608, - 426, -346, -224, 375, 22, -448, -270, -1150, - -897, 4298, -882, 49, 633, -937, -694, 675, - -322, -793, -516, -360, -248, 1190, 575, -843, - -13, 50, -801, 1181, 452, -335, -495, -102, - -1057, 506, -206, 66, -647, 991, 259, 259, - -468, 197, 373, -4216, -750, 224, -182, 520, - -530, 1888, -2018, -1492, 656, -1447, 993, -790, - -785, 792, 1658, 373, 131, -460, -703, 1080, - -875, -212, -694, 747, -639, -2267, 1263, -415, - -749, -1278, 591, -745, -225, -1677, 69, 625, - -146, 212, 345, 728, -553, 1117, 471, 550, - -498, -729, -2070, 1006, -330, 939, 3636, 34, - 349, 761, -131, 372, 610, -399, 10, 86, - 110, 931, -1159, -175, 633, 568, 140, 712, - 2800, -1558, 2343, 3, -974, -673, 233, 1436, - -783, 599, -442, 852, 639, 447, -976, -564, - 1511, 36, 529, 433, 677, 1971, 2777, -820, - -655, -1463, -1392, -1142, -352, 432, 730, 439, - -273, 844, 108, 115, 408, -361, 504, 337, - 58, 1074, -1645, -1623, -493, -70, -1585, 2878, - -741, 636, -224, -974, 722, -147, 149, 135, - -107, -154, -1027, -18, -989, 282, 3173, 1123, - -778, 1389, -591, 337, 1660, -288, 1162, -65, - 660, 326, 141, 358, 679, -222, 460, 105, - 512, 36, -854, -477, -942, -2362, 265, 2252, - -164, -2059, 106, 666, -420, 521, -178, 396, - -1836, 475, 82, 356, 207, 433, -1005, 97, - 385, -304, -853, 1282, -239, -2134, 83, 84, - 201, -1894, -1603, 683, -1957, -113, 839, 1187, - -313, 774, -754, 941, -739, 748, 116, 716, - 1134, -530, -2178, 71, -611, 1544, 3527, -3, - 283, 527, 457, 399, 762, 17, -279, 196, - -518, -160, -1204, -289, -1354, 132, -315, -290, - -2179, 676, -1474, -1010, -1397, 363, -45, 783, - 1326, -33, -109, -617, -271, -967, -103, 1867, - 769, 740, -818, 1011, 1411, -693, -2458, 808, - 806, -213, 468, 31, -70, 166, 230, -405, - 163, 70, 652, 1077, -190, -622, 2343, -1328, - 601, 928, -1661, 174, 429, -2479, 501, 503, - -41, 1365, 671, 1006, -1968, 7, 103, -399, - -382, 573, -27, 554, -2263, -3174, 277, 177, - 807, -328, -816, 453, -1548, 828, -327, 187, - -393, -745, -76, -808, 575, -8, -326, -2062, - 601, 566, 755, 775, 595, 419, -3925, -226, - 272, 368, 395, 59, 1117, 548, -649, -429, - 321, 549, -744, 319, 82, 135, 73, 14, - 374, 93, -270, -453, 177, 4991, 569, 169, - 111, -246, -362, -88, -49, 583, -35, 60, - -759, 1327, 1768, 766, -350, -880, -106, -449, - -113, -683, -418, -999, 992, 559, -290, -147, - -324, 93, -947, -3932, -37, 307, 1087, -314, - -293, 432, 830, -130, -208, 59, 719, -348, - 4511, 224, 488, -174, 588, 795, -301, -246, - -447, 682, 917, -1207, -503, -450, 575, -116, - -126, 594, -22, -101, 5, -1188, -431, 1146, - -3869, -72, 402, -417, -390, 350, 1141, -138, - 697, 77, -3255, -268, -786, -106, -1386, 400, - -856, -691, -438, -1550, -228, 2162, 236, 64, - -382, 1, 1032, 153, -659, 1563, -410, 1280, - 1573, -3675, -1041, 240, 401, 215, -353, -1140, - 265, -103, -824, -93, -319, -849, 253, -477, - -463, 153, -1017, 538, 1233, -1041, 11, 998, - -437, -569, -970, 2118, -1577, 1, 321, 1784, - -298, 2315, 72, -20, 83, 905, -1289, -246, - 731, 4076, -1477, 602, -911, 978, 698, -239, - 391, -729, -276, 225, 143, -417, -500, -27, - -1220, 89, -403, -1453, -2546, 1015, 70, 78, - 2364, -159, -775, 29, 37, -231, 73, 433, - 426, -529, 420, -613, -100, -605, 1463, 1001, - 1159, -4082, -553, 348, -806, 624, -162, -1121, - -25, 919, -62, 90, -275, 233, 203, 32, - 745, -221, 458, 529, 901, 1088, 38, 1209, - 450, 451, 2250, -411, -205, 761, 249, -1226, - -266, -3195, -801, -31, 1015, -324, -596, -42, - 150, 207, 2597, 1041, -1045, -2254, -1428, 250, - 217, 69, -933, 1424, 280, 446, 524, 540, - 639, -1027, 23, 412, 36, -67, 475, -1126, - -739, 1160, 514, -157, -2832, -1432, 559, 77, - 740, -888, 134, 1304, -267, -267, 329, 8, - 1721, 1488, -29, -1760, -1904, -2634, -1342, -528, - 2233, -219, -194, -2919, 128, 1203, -623, -127, - 488, -386, -133, -329, 62, 85, 1271, -185, - -479, -588, -2964, 546, 1651, 1526, -830, 1046, - 347, 63, -1048, 239, 1402, -22, 307, -1606, - 768, 999, 304, -512, -175, -246, -373, 529, - 93, -521, 1310, -508, -4366, 27, -768, -358, - -575, -2, -593, -21, -838, 635, 197, 634, - 321, -263, -377, -549, 20, 739, 395, -9, - -392, 70, 5679, -133, -130, -240, -678, 421, - -101, 412, 143, 209, 194, 216, 200, -22, - -748, -399, 2863, 284, 231, 691, 571, -3460, - -200, 312, 480, -1338, -603, 435, -308, -615, - 520, 178, 68, -716, 45, -593, -32, -1393, - -554, -1000, -867, 613, 288, 507, 202, -113, - 17, 93, -141, -47, 665, 559, -808, -4091, - -575, -193, -873, -790, 673, -608, -941, 745, - 1562, -1060, 988, 1192, 29, -1207, 207, 653, - -622, -132, 370, 1435, 1977, -1878, -119, 101, - -100, -154, -869, -2375, 1254, 122, 188, 877, - 188, -838, -355, 667, 3813, 1076, 369, -771, - -712, -669, -14, 107, 1027, 112, 2306, 1418, - 133, 1055, 377, 249, 1023, -927, 12, -1983, - 1174, 223, 385, 827, 1425, -1694, -1178, -94, - -593, -286, 1263, -671, -425, 2002, 701, 1546, - 547, 182, 1013, 128, 351, -243, 407, 2349, - -376, 445, -93, 968, -337, -601, 1342, 987, - -1499, -644, 521, 327, -557, 1800, 12, 285, - 127, -269, -1989, -449, 87, -1042, 184, -499, - 1231, -1664, -352, 4, 1253, 403, -1064, 837, - -1702, 133, 1687, -1300, 2248, 179, -847, -617, - 460, 450, -260, 94, -780, -675, 1209, 38, - 453, 857, -631, 317, 535, 1086, -196, 638, - -288, -389, 688, -93, 1271, -4290, -96, 445, - 64, -211, 148, -74, 486, -1873, 1214, 1836, - -708, 1800, 1644, 576, -1088, -1212, 1147, -456, - 173, -911, 489, -443, 644, 534, 846, -1522, - -786, 497, -401, -1087, 1410, 1391, 837, -253, - 124, -598, -254, -3945, -1169, 103, -193, 50, - 846, -1014, 353, 455, 784, 1343, 3055, 178, - -628, -148, -266, -324, -96, -190, -930, 115, - 475, -651, -314, -82, -236, -88, -3753, -1048, - -283, -178, 351, -671, 325, 1054, 28, 540, - 113, -73, 763, 844, 543, -6, 799, 245, - 176, 124, 262, -112, 1010, 361, -843, 3290, - -3741, 914, -1835, -259, 2467, 297, -1205, 168, - -1917, 156, 87, 637, -677, -955, 312, 1246, - -219, 92, 1090, -292, -773, 343, -523, 299, - -513, 1321, -536, 586, -1324, 2345, 2384, -719, - -936, 1389, -27, 880, 338, -127, -666, -441, - 1603, 143, -218, 2167, -1335, 469, -1224, 2489, - 1365, 568, 19, -1322, -736, 208, -494, -454, - 990, -250, 305, -575, 206, -168, -1177, 282, -}; - -static const int16_t cb1110m0[] = { - 429, -104, -210, 216, 361, -2586, 253, -1350, - 145, 2795, -5, 663, -262, 37, -122, 205, - 270, 321, 2623, 256, 4, -42, -37, 112, - -346, 20, -51, 9, -90, -3342, 78, 52, - -239, -454, -207, 355, -136, -19, 394, -212, - -166, -73, -68, 1049, -2945, 385, -545, -211, - 116, -15, 687, -232, 1824, -66, 133, -403, - -63, 3, 46, -104, -101, 136, -61, 420, - 149, -24, -9, 4277, -149, -166, 96, -35, - 1786, -1044, 115, -1326, 3381, -520, 70, -134, - -433, -198, 146, -615, -143, 201, 342, 412, - -162, 22, 111, 16, -85, 14, -120, 79, - -30, -84, 56, -34, -52, -147, 19, 155, - 17, -120, 5853, 96, 767, 262, -194, 124, - -180, 13, 3081, 39, 402, 90, 292, 84, - 1999, -16, 866, 292, 416, -314, 177, -1, - 68, 3, -28, -56, -54, 10, -5, -63, - 89, -69, -251, 70, 7523, -83, 67, 62, - 178, -1723, -76, 101, 369, -139, 58, 135, - -32, 138, 3393, -575, 586, 292, -296, -505, - -634, 52, 280, 78, 14, 117, -39, 77, - 231, 136, 14, 51, 173, -96, 5, 378, - -52, -4340, -263, 61, 22, -2896, -20, 180, - 21, 3636, -138, 104, -279, 56, -407, -8, - -123, 134, -95, -500, 266, -64, -43, 1, - -170, 31, 110, 53, 56, -5938, 151, 49, - -76, -166, 34, -8, 193, 198, -118, -4, - -44, 249, -28, -102, -3614, 49, 464, -388, - -744, -500, 603, -88, -19, 1606, 325, -227, - -277, -142, 232, -1835, 150, -89, 29, 9, - 76, 425, -320, 179, 231, 1720, 424, -2730, - -298, 666, 72, -428, -1243, -299, 93, -12, - -20, -96, -123, 18, 188, -1, -235, -2, - 3328, 107, -1489, 199, 893, -63, 46, 3799, - 22, -118, -127, 283, 254, -2091, 293, 331, - 857, -92, 46, 13, -457, 169, 851, -19, - -231, -8735, -62, 69, -190, -103, -31, 108, - 66, 95, 53, -6, 12, 19, -73, 105, - -40, -29, 60, -263, -107, 2233, -246, 485, - 342, 1732, 76, 2489, 40, 44, -300, 280, - -109, -107, -990, -45, 1014, -5073, 1, -169, - 25, -55, -340, -427, 603, 206, 151, 360, - 312, -44, -106, 514, 683, 98, 3331, 19, - -106, 106, -3383, 85, -161, -88, 8, 12, - -163, 183, -393, 117, -243, -498, -60, 292, - -322, -2105, 920, 301, 41, -19, -142, -2485, - 631, -289, -849, 132, 800, -255, -390, 137, - -850, -411, 41, -93, -8653, 9, -25, 134, - -66, 222, 152, 59, 29, -193, -129, -105, - 39, -21, 188, 111, 25, -3, 0, -79, - 8907, -24, -18, 37, -33, -42, 87, -44, - 56, -79, -67, -52, 18, -132, 1925, 309, - 145, -443, 1279, 200, 1215, 281, 3343, 311, - 390, -154, -119, -523, 19, -529, 190, 272, - 541, -393, 278, 161, 13, 161, 891, -65, - -199, -1376, -350, -1409, 340, 2115, -209, 2459, - 30, -509, 141, 11, -557, -1560, -1912, -234, - 76, 787, 2781, 45, -158, 330, -623, 655, - -845, -463, -119, -252, -299, -1940, 145, 17, - -183, -71, 98, 67, 145, -134, -88, -5, - -3636, 3, 34, 231, 981, 33, -953, -403, - 129, 215, -11, 109, -188, 51, 5176, -89, - -113, 60, -138, -94, 142, 216, 322, -33, - 350, -285, 182, 92, -16, 12, 15, 126, - -27, 5, -5220, -154, 13, 109, 18, -326, - -257, 118, 313, 342, 2289, -35, -22, 115, - -256, -2908, 68, 1211, 203, -735, -380, -134, - 249, 522, 109, -48, -5114, 32, -42, 85, - -99, 265, -187, -93, 373, 341, -254, 16, - -121, -92, -260, -80, -2, -322, 234, -96, - -2834, 230, 146, -264, -3287, -153, 41, -349, - -149, -98, 140, -115, 628, -11, 292, 4, - -166, 82, -4548, 116, -23, -311, 612, -334, - 451, 259, 559, 320, -267, 517, -139, -166, - 126, 27, -89, -156, 14, 63, -3, 31, - 109, -43, 10, -7682, 36, -23, 73, 129, - 0, -116, 66, 5, 137, -17, 2523, 203, - 431, -2729, 175, 540, 454, -175, -297, -60, - 348, 53, 688, -49, 133, -72, 200, -348, - 136, -142, -2259, -3047, -60, -737, 48, -331, - 85, -134, 218, -962, -278, -148, -1077, -131, - 53, -127, -2265, 82, -31, -262, 226, -385, - 83, 756, -2715, -492, -115, 663, -312, 240, - -318, -819, 3040, -181, 148, 165, 376, 92, - -233, 188, -100, 902, -401, 1005, -52, 162, - 219, 1831, -68, -66, -10023, -90, -23, 39, - -91, -231, 23, 174, 42, 79, -57, -58, - 18, 175, 32, 122, -185, 266, 162, 300, - -3158, -3381, -3, -312, 178, -24, -234, 248, - 68, 293, 360, -146, -30, -2, 177, 113, - -1215, -538, -274, 79, -2, -17, 2791, 71, - -1300, 93, -818, -558, -331, 115, 215, -603, - -202, 113, -87, 39, -277, 3564, 75, -444, - 201, 111, -369, -1072, 212, -276, -322, -484, - -700, 37, -302, 177, 86, 10, -87, 56, - 76, -8941, -27, -73, -133, -51, -106, -28, - -52, 49, 68, 26, 16, -81, -423, 2834, - 7, -54, -107, 144, -3812, 17, -355, 3, - -32, -24, 14, 76, 169, -260, 349, -159, - 3691, -184, 4345, -46, 146, -14, 143, -384, - -75, 12, 144, 105, 47, 141, -32, -31, - 48, 187, 74, 139, 132, 86, -15, -317, - -267, 3112, 1821, -363, -125, -1152, -294, -449, - 277, 1151, -341, 12, -41, 210, -51, 6, - 18, 53, 11, 37, -36, -70, 65, 44, - -7302, 15, -133, 56, 150, 63, 515, 271, - -32, 47, 41, -130, 168, -158, -239, -60, - 226, 247, -593, -237, -3559, 65, 623, 16, - -212, 26, -181, 81, 83, 26, -25, -92, - -5, 36, -31, 277, -263, 135, 78, -173, - 220, -5260, 2239, -96, -19, -95, 75, -25, - -64, 244, -154, -2646, -446, 980, 512, 392, - -402, -1050, 276, -456, -1334, 1863, 636, -1512, - 234, 199, 237, 363, 66, 284, 198, -277, - -267, -540, -329, 856, -482, -645, 178, -240, - -178, 6633, -5, 127, -80, -167, 307, 7, - 248, 13, 53, 124, 215, -310, 255, -194, - -3066, -22, 3524, 51, 193, 165, 82, -80, - 54, -191, -278, -19, 379, 285, -58, -157, - -168, -183, 388, -198, 191, 107, 10, -2, - -6148, 45, -58, 48, -150, -72, 112, -124, - -41, -129, 36, -66, -3311, -4092, 15, -11, - 93, -54, 72, -105, 131, 66, 29, -54, - 201, -210, 221, 47, 55, -99, 31, -3626, - -3623, -175, 91, -53, 40, -98, -76, 224, - 15, 172, 85, 103, -147, -135, -214, -313, - 1304, 143, 190, 19, -2526, -91, -168, 875, - -27, 789, 791, -462, 912, -580, 70, 1523, - 787, -150, 567, 2717, -5, 2943, -107, 155, - 32, 65, 158, 133, -191, -44, 141, -149, - 199, 177, 270, -14, -57, -3669, 3891, -158, - 239, -17, 52, 244, -343, -118, 186, -54, - -134, 106, -133, -116, 186, -149, -894, -22, - -399, 1, 288, -3988, -260, 113, 66, -276, - 179, -226, 119, 420, 51, -483, 551, 129, - 245, 2013, 639, -87, 5058, 41, -53, -116, - -130, -223, -104, -760, 276, 117, 338, -137, - -233, -65, 119, 100, -3245, 2, 3877, 126, - 172, -2, -72, -153, 200, -109, -62, 135, - 194, -82, -150, 98, 550, -251, -274, 71, - 160, 121, -13, -365, 356, -212, -271, 5067, - -203, -251, 222, 75, -131, 17, 103, -911, - -348, -26, 6, 110, 120, -645, 355, -649, - -132, -3416, 65, -1478, 461, -109, 258, -15, -}; - -static const int16_t cb1110m1[] = { - -110, 2743, -31, 86, -11, 3705, 192, -89, - 57, -252, -11, -212, 163, 0, -137, 405, - -99, -124, -137, -407, 125, 106, -922, 1567, - 85, 165, 241, 110, 2918, 598, -443, 812, - 159, 518, 555, -1886, -65, -52, -3, -27, - 56, -30, -126, 126, 23, 74, 157, 6990, - -34, 56, -257, -172, 115, -23, -616, -243, - -441, 34, 159, 6, 78, -119, 49, 34, - -133, 988, -1007, 474, 77, -274, 354, 4907, - 222, -16, 69, -4, 924, -18, 3535, -299, - -38, -83, -111, 977, -138, -1075, -444, 540, - 199, 202, -502, -194, -198, 249, 101, 276, - -89, 96, -301, 6, -4023, -70, 174, 93, - 192, -120, 755, -560, -22, 78, 56, 29, - 28, -44, 65, -4, 0, 49, -250, 87, - 46, 44, -41, -7035, 14, 288, 632, -259, - -64, 20, -178, -343, -274, 106, 2842, 336, - -283, 245, -612, -5, 500, 77, 2492, -250, - 64, 171, -988, 4, -51, -34, -555, -171, - -2629, 272, 2852, -162, -98, -237, -278, -489, - 641, -96, 7815, -139, -116, -137, -121, -314, - -161, 211, 76, 136, -35, -124, -27, 76, - -98, 133, 85, 332, -4352, 507, -14, -275, - -212, 308, 258, 129, -165, -197, -104, -150, - -104, 60, 125, 568, -3, 1694, 62, -70, - 109, 122, -57, -18, 8642, 100, 50, 92, - 17, -86, -93, -68, -121, -61, -32, 27, - -188, 502, 123, -81, 37, 48, 187, 75, - -30, -22, -224, -292, 99, -49, 4273, 10, - 834, -25, 225, 2773, 78, -3281, -181, 234, - -130, -74, 101, 214, -26, -113, -268, -168, - -90, -435, -26, 38, -569, -4009, -1, 11, - 69, 3, 249, 98, 178, 131, 300, -826, - 48, 337, -828, -371, 96, 312, 712, -667, - -70, -2070, -242, 519, -676, 143, -613, 893, - -2193, 471, 1071, 213, -1231, -196, -580, 155, - 401, 78, -64, 27, -238, 22, -73, -19, - 194, 60, -87, -210, -155, 244, -123, -169, - -4442, 169, 3132, -181, 65, 3950, -396, 209, - 39, -52, -26, 166, 1, -164, 143, -66, - 169, 46, -16, -295, 39, 42, 40, 67, - 25, 17, -1, -8920, -82, -42, 49, 81, - -61, 1, 39, -40, 18, 74, 206, -131, - -71, 106, 7, 88, -13, 69, -113, -89, - 212, -4, 4373, -34, 283, 105, 252, 59, - -2578, -298, 1846, -110, -105, -310, -143, -127, - 274, 225, 861, 262, -815, -311, -26, -685, - 243, -620, -374, 2992, -112, -35, 2903, -94, - -56, -213, 65, 383, 41, 508, -258, -103, - -440, -237, 428, 132, 2793, -77, -113, -58, - -19, -3857, -25, 40, -167, -243, -233, -41, - -279, 213, -22, 8, 120, 126, 159, -212, - -244, 183, 1605, 62, -12, -244, 519, 780, - 116, -3197, -992, 341, 222, 681, -357, -669, - 55, 1213, 100, 441, 1, -57, 232, 10, - -114, 318, -147, 89, 188, 448, -327, 3735, - -292, 875, -216, 211, 111, 160, 172, 286, - -3513, -849, -185, -9, 31, 442, 747, -1045, - 187, 704, -219, 509, 48, 69, -25, -10, - 75, 23, 10, 23, -32, 89, 8628, -77, - -19, 27, 0, -232, 22, -50, -1904, -137, - -169, 128, 138, 78, -443, 243, 157, -3809, - 231, 277, -341, 73, -70, 596, 259, 157, - 2197, 575, 2445, 11, -53, 118, -115, 562, - 108, 30, -241, 30, -394, -155, -186, -344, - -237, -319, -2258, 343, -311, 14, 169, 59, - -15, 233, 732, 365, -692, -108, 1416, -463, - -279, -248, -1731, -406, -278, 298, 209, 5333, - -198, -167, 50, 439, 142, 91, -523, 226, - 262, -130, -15, 573, -4, 271, -2, -47, - 7, -9106, -69, -44, -144, -98, 199, -181, - 6, 45, 47, 37, -51, -68, -50, -116, - -105, 49, 376, -420, 187, 2894, 29, -471, - -221, 455, -1, -858, 55, -197, 359, -1972, - -188, 921, -134, 186, -843, -2542, 322, -1, - -158, -352, -307, -578, -60, 143, -1302, 333, - 681, 1373, -1021, 18, 284, -28, 8, -57, - -16, 15, 58, 31, 8389, -35, 18, 77, - -78, 15, 36, 17, -134, -17, 316, -680, - 491, 38, -217, -278, 276, -299, -75, -4030, - -293, -507, -62, -344, 64, -438, -344, -256, - 341, 199, -66, 28, -17, -17, 2, 142, - 6, -48, -169, -27, -117, 6739, 42, -61, - 140, 246, 3357, -3243, 48, -55, 49, 27, - 4, 172, -169, 6, 69, -265, 70, 25, - 223, 28, 129, 231, 57, -1608, 2640, -28, - -197, 29, -11, 138, 621, 427, 20, 514, - 663, 562, 447, -158, -909, 343, -321, -257, - 6641, -1, -20, -70, 62, 241, 51, -83, - -48, -156, -266, -335, -43, 421, 350, 306, - 165, -541, 47, 5, -40, 364, 21, 190, - -4584, -125, -441, 489, -571, -47, -10, 205, - 60, -73, -584, 417, 233, -34, -109, 85, - 41, 134, 485, -171, -183, -1522, 202, 390, - -3112, 144, 1675, 651, 402, 1953, 120, 93, - -276, -1930, -197, -61, 100, 81, -250, -155, - -19, 336, -178, -2340, 88, -543, 226, -2507, - -60, -62, 218, -9, 158, -3617, -66, 32, - 314, -192, -121, 372, 334, 516, 412, 247, - -609, -1237, 312, -120, -39, 47, 61, -63, - -90, 4500, -191, -353, 10, 54, -163, -345, - 121, -318, -235, 190, -99, 181, -3369, 4, - -188, -87, 128, 167, -507, -1132, -666, -354, - 121, 43, -546, 601, -409, 181, -47, -315, - 127, -2845, 487, 186, -2724, 343, 177, -837, - 387, -84, 259, 122, -159, 88, 117, 137, - 79, 126, 1584, -521, -2448, 2648, -246, -75, - 567, 114, 244, 653, -551, -196, -623, 205, - 816, 48, -326, 66, -94, -33, 133, 412, - -241, 491, -32, -712, -249, -3756, -185, -229, - 248, 268, 557, 73, 164, 24, -70, -27, - 54, -156, -51, -47, -26, 43, 187, 179, - -38, -137, 218, 1916, 4614, 435, -15, 21, - 145, 1868, 241, 240, 299, -204, 73, -24, - -118, -372, -89, 23, -298, 479, 2837, 959, - -76, -85, -2, 28, 94, -3245, 28, -130, - 159, 295, 264, -419, -98, -16, -159, 349, - 202, -158, -2680, -210, -390, -18, -8, 364, - 1367, -110, 932, -232, 1348, -80, 865, -291, - -408, 406, -118, 6462, -55, 10, -152, -161, - -132, 231, 258, 135, -13, -104, 247, 207, - -238, 212, -19, -31, -3303, -160, -24, 3402, - 50, 116, -191, 97, -139, -100, 71, -49, - -293, 133, -120, -10, 197, 196, -516, -686, - 79, -52, 6002, -47, 88, -201, 146, 136, - 54, 162, -180, 287, 67, 70, -55, 210, - -1938, 635, -162, 82, -120, -456, -75, -3753, - -83, 176, 137, 18, -6, -281, 232, 137, - -167, 373, 78, -2622, -38, -293, 89, 69, - -3476, 8, 152, 136, 32, -15, -140, 11, - 6, 13, 481, -175, -228, -254, 158, -3423, - 206, 22, 900, 2025, 266, -402, 132, -356, - 558, -592, -262, -419, 1002, 73, -246, -24, - -3145, 3220, -33, 283, 398, -31, -25, -7, - 103, -93, -143, 1, 32, -497, 206, -35, - 1424, 114, 140, 2393, 3245, -218, -163, 113, - 191, -164, -215, 504, -256, 140, -364, -226, - -340, 91, -464, 32, 188, 4, 15, -6068, - 69, 109, 219, 75, 196, -24, -84, -218, - 27, 57, -97, 8, -338, -4, 358, 23, - -52, -68, 552, 4023, -255, 684, 144, 188, - 100, -293, 462, 553, 9, 665, 12, -640, - -5099, -158, -245, -74, -168, 263, -355, -370, - -653, -163, -473, -394, -233, 750, 17, -31, -}; - -static const int16_t cb1110sl0[] = { - -3736, -3737, -18, -285, 383, -144, -155, -204, - 296, -399, -663, 356, -364, 329, -330, -5, - -52, -88, -41, 228, -21, -45, -136, -280, - -109, -86, 57, 91, -212, 158, -106, -90, - -8192, 70, -255, 78, -8, -89, -110, -58, - 104, -51, -2598, 411, -94, -567, 209, -464, - 139, -234, -336, 754, 863, 399, 345, 117, - -3435, -219, 369, 59, -325, 2439, -148, 6, - -48, 84, -14, 71, 94, 10, 6, 73, - 106, -490, -200, 186, 345, -8, 99, -3687, - -1571, 1836, -1593, 1111, -3700, 470, -6, 401, - -182, -119, 438, -263, 228, 785, -361, -56, - -492, 465, 333, 61, 53, 234, -23, -87, - 39, 105, 7282, 59, -47, -57, -77, -45, - -172, 12, 179, -134, 37, -157, -19, -206, - 9, 1186, -264, 600, 350, 374, 115, -55, - 727, -164, -3903, -735, 586, -24, 145, -786, - -118, 943, 514, 396, 3435, -35, 83, 294, - 107, 16, -3636, -93, 360, -307, -105, -172, - 204, 320, -148, 410, 175, 335, 0, -178, - 12, 94, -47, -91, -49, -159, -155, -65, - -17, -159, -316, 64, 155, -260, 81, -4766, - -150, -116, -332, 128, 675, -105, -479, 563, - -101, 101, -379, 33, 37, 1, 106, 151, - 69, 140, -6, -74, 157, -125, -120, -33, - -178, -286, 60, -158, 43, -7291, -295, -68, - -34, -68, -58, 8, 176, -42, -212, 176, - -533, -62, -27, 167, 291, 59, 311, -3050, - 552, -493, -207, 2576, -991, -375, -102, -980, - 1130, -565, -199, 559, -1390, -428, -618, 70, - -437, -245, -1132, -1302, -453, 83, 222, -1555, - -178, -1396, -1176, -228, 730, -3121, -1085, 84, - -326, 71, -185, -315, 889, 803, -2910, -3609, - -639, -199, 187, 137, -622, 473, 121, 181, - 85, 395, 523, 589, 71, 703, 123, 361, - 47, -675, 299, -446, 307, 591, 3341, 64, - 526, -1541, -50, -1369, 701, -144, 1720, -713, - 562, 297, 146, -34, 1315, 956, 761, -415, - -1311, 637, -1263, -1096, -385, 3228, -395, 317, - -354, -503, 255, -526, 245, 598, 853, -269, - -110, 1354, 333, 110, 855, -3346, 635, 636, - -917, -577, 260, 147, 1041, 1273, 385, -862, - 1751, -1099, 80, -148, 120, -118, 5565, -484, - -74, 326, 291, 234, -41, 212, 192, 207, - -108, 198, 118, -389, 178, -151, -252, -69, - -243, -800, 2640, -531, 84, -301, 157, -3428, - 3, -418, -173, -166, -722, 207, 448, -387, - -504, 202, 453, 210, -203, 304, 190, -264, - 101, -23, 36, 74, -146, 26, 29, -33, - 59, -127, 22, 213, -167, 103, 8192, 183, - 2709, -125, 324, -964, -259, -400, -41, -430, - 367, 127, 266, 369, 1081, -190, -220, -1083, - 641, -2733, 750, 525, -623, -18, 3159, 686, - -278, -2083, 1680, 587, 123, -6, -266, 376, - 522, -433, -499, 169, 106, 2041, 174, 571, - -108, 129, -116, -87, -252, 89, -14, 14, - 120, -7874, -204, 15, 19, -110, -82, -54, - 66, 31, 210, 55, 339, 61, -219, -3205, - 1292, 80, 344, -733, 3172, -21, -55, 712, - -192, 38, 408, 489, 388, -343, -763, 438, - -1812, -6, -129, -1392, -382, -28, 105, -284, - -168, -462, -284, 22, 113, 1203, 3253, -589, - -619, 348, 113, 847, 3, -557, 460, -636, - -601, -742, 46, -111, 51, -66, -2867, 551, - 455, 898, 17, 2205, 1004, -46, -1475, -367, - 2849, 766, -32, -119, 624, -722, 3371, 172, - -330, 93, -221, 457, -453, 84, -281, -360, - 108, 487, -301, 166, -2611, 577, 192, 34, - 1105, 705, 34, 29, -3041, -898, 172, 578, - 307, 483, -439, -327, 360, -935, -76, 387, - -2485, 800, 333, 601, -712, -973, -65, -442, - 220, 3577, -428, -210, 565, 757, -382, 289, - 726, -19, -182, 384, -32, 38, -810, -181, - -2978, 259, -213, -473, -187, -823, -279, 1518, - 26, -385, 1143, -409, 1310, 676, -2472, 64, - -391, -102, 455, -5751, 278, 30, 64, -177, - -113, -170, 94, -234, -167, 101, -2, -149, - -131, 351, -254, -138, 149, -42, 631, -21, - 237, 2893, -291, 2917, -1240, 211, -215, 22, - -827, -160, 140, -213, 156, -250, -1233, 691, - 498, -30, 350, -28, -12, 217, 34, -348, - -70, -140, 103, -60, 353, -200, -314, -74, - 112, 4435, -80, -287, 413, -99, 1407, 1519, - -2230, 114, 3179, -523, 39, 340, -379, 373, - -1552, -138, -446, -106, -762, -1017, -297, -183, - 498, -481, 374, 271, -5609, 297, 98, -378, - 187, -78, -125, 333, 114, -81, 62, -145, - 14, 362, 518, 134, 195, 130, -34, -72, - -3088, -2965, -114, 585, -78, 6, 552, -633, - -98, -224, 980, 338, -83, -1064, 42, 106, - -119, 644, -293, 496, 67, 128, -129, 620, - 20, 526, -177, 68, 351, -3703, 1465, 905, - -245, 86, 511, 39, -512, -150, 239, 86, - 60, 39, -79, -9, -65, 77, -7993, 57, - -19, 56, -38, 161, -221, -129, 8, 93, - 52, -5622, -114, 133, 26, 64, -194, -316, - -143, 225, -66, -81, -74, 240, 130, 137, - -549, 11, 352, -53, -4029, 513, 3164, -205, - 127, 80, -193, -197, -36, -885, 223, -858, - 5, -458, 290, 459, 247, -284, -176, -748, - 173, 191, 114, 406, 126, 3, 91, 84, - 8027, 379, -56, 47, 35, 246, -143, 65, - -36, 8, 59, 67, -69, -421, -3492, 312, - -252, 261, 3367, 319, -67, 77, -346, 386, - 34, 237, 18, 111, 348, -547, 186, -93, - -3558, -178, -3801, -133, -27, -561, -308, 112, - -224, 272, -195, -270, -179, -165, 199, -524, - 681, -117, -429, 37, -5891, 94, -55, -433, - -354, 122, -60, 67, -200, -80, 267, -136, - -42, 130, -324, -25, 156, 167, -47, 178, - 8, 289, 157, 88, -28, -39, -262, -11, - 9, -113, 76, 8192, 89, 115, -298, 137, - 34, 0, 261, -30, 49, 274, 130, 824, - -944, -56, 1074, -314, -76, 527, 75, -3321, - 733, -798, -352, -1038, 1049, 72, -233, 312, - 3363, 69, 104, -149, 22, 283, -20, -101, - -3350, 164, -328, -362, -993, 430, 78, 125, - 269, -29, 362, -73, -30, -1189, 1396, 59, - -1285, -216, -121, 3893, 84, -464, -38, -113, - -369, -181, -930, -1012, 394, 120, 274, -552, - -800, 105, -141, -12, 241, -667, 543, -416, - 28, -182, 51, 905, -3964, -1213, 12, -271, - 378, -234, 838, -113, 56, 567, 35, 48, - 490, -180, 1097, 170, 2596, -28, 3098, -220, - 424, 885, -42, 783, -30, 907, 63, 46, - -131, 28, -55, 54, -46, -25, 30, 58, - -15, -200, -6, 11, -70, 66, -8089, 86, - -136, 96, -56, -101, 300, -661, -41, -201, - 760, -252, 955, 189, 1459, 3562, -457, 35, - -54, -164, -329, -1245, -830, -365, -399, -23, - 616, -238, -1301, -198, 335, -3400, 149, 175, - -97, -279, -594, -92, -915, -830, 468, 628, - 728, 1024, -549, 1073, 222, -142, 296, -75, - -168, -5, -67, -7311, -50, -256, -321, 121, - 358, -272, 30, 258, 105, -161, -291, 462, - -7, -211, -227, -104, -151, -152, -72, -98, - -59, -23, -98, -203, 103, 89, 239, -484, - 7749, 110, 35, 345, 282, -578, 140, -51, - -62, -238, 102, 454, 64, -107, -223, -174, - 285, 110, -190, -16, 1624, 142, 3813, -849, - 43, 234, 84, 0, -132, 131, -135, -70, - -1, 125, -83, 171, 109, 8044, 97, -38, - 143, 64, 13, 4, -225, 181, 712, 626, - 20, 167, -467, 186, 3801, -2179, -647, -119, - -112, -183, -223, 295, -438, -407, -29, 36, - -34, 2536, -47, -402, -33, -62, -136, 2444, - -152, -717, -868, 86, -2323, 931, 659, -1281, - -98, 638, -162, 195, -5, -40, -88, 3019, - 3466, -323, 316, -784, -715, 5, 188, 42, - 155, -608, 500, 185, 475, 100, -51, 879, - -891, -158, 18, -453, 380, -207, -143, 401, - -153, 926, -184, 2775, 3176, -797, -198, -888, - 405, 460, 309, 304, -114, 2386, 2319, 658, - -2200, 216, 435, -1210, -655, 154, 81, 538, - 908, 220, -118, 482, -864, -526, -241, 857, - -473, 774, -288, -886, 46, 250, -96, 301, - 120, -488, -128, -233, 422, 38, -3416, -974, - -243, -226, 381, 2394, 652, 3124, -205, -1303, - 1484, -159, -152, -1037, -105, -121, -466, -76, - 605, 181, -55, -326, -527, -126, 1691, 1316, -}; - -static const int16_t cb1110sl1[] = { - -743, -300, -347, -441, 85, 5282, -250, 32, - 28, -306, -434, 78, -178, -112, -28, -162, - -188, -43, 17, 94, -242, -258, -2691, -471, - -556, -815, 120, -57, -36, -325, 3282, -765, - 355, 2, -162, -454, -72, 192, 86, 219, - -123, 237, 135, -42, 492, -471, -114, 5146, - -164, 28, 77, 70, 276, -148, 333, 64, - -89, -46, -135, 474, -218, -119, 351, 7619, - 93, -80, -84, -51, -110, -223, -13, -116, - -160, -102, -64, -140, -376, 156, -143, -421, - 105, 102, 519, 1256, 786, -284, -3029, -3021, - -365, -515, -1358, -273, 394, 489, -242, 31, - 239, -1328, 169, -488, -3069, -398, 303, -274, - 498, -2758, -748, -208, -324, -285, 78, -386, - -1063, 298, 5, 693, 160, -629, 1656, 186, - 457, 742, 422, -3723, 1997, 1025, -24, 291, - -588, 16, -327, 459, -521, 421, 1279, -408, - -2, -1320, 101, -372, -66, 100, -605, 3214, - -374, -660, -371, 207, 175, -553, -574, 2962, - 119, -551, -140, -62, 50, -608, -237, -100, - 108, 101, 3258, -31, -45, 375, -161, 132, - 2842, 1458, 235, 800, -113, 719, -291, -29, - -512, -267, 53, 780, -59, 3387, -175, 88, - -78, -475, -536, 584, -3025, -19, -105, 91, - 875, -55, -771, 143, 384, 810, -372, -253, - 160, -128, 232, 98, 7755, 181, -19, -177, - 46, -39, -30, -212, -289, 75, 127, -114, - 80, 79, 325, -128, -436, 2547, -73, -29, - 1046, 344, 3340, -335, 458, 637, -175, -695, - -366, 294, -322, 564, 542, 209, 524, -62, - 444, 2827, -53, 66, -959, 84, 484, -147, - 158, 259, -479, 3216, 232, -68, 583, -810, - 107, 93, 629, -168, 143, -552, 96, -71, - -3903, -438, 335, -133, -186, -278, 73, -575, - -253, -733, -91, -8, -1149, 350, 140, 12, - 3935, -236, 103, 469, 610, -536, -305, 3112, - 13, -182, -686, 637, 525, 327, 102, -49, - -450, -16, -480, 233, -82, -132, -3979, 426, - 757, 54, 152, -701, 513, 2330, 148, 242, - 1709, 162, -168, 146, 0, 891, -644, 109, - -549, 104, -50, 275, -193, -55, -144, -117, - 31, -234, 68, -5369, 72, 54, 54, 119, - -140, 192, 286, -42, -278, -3524, -3609, 692, - -366, -15, 343, -885, -267, 294, -387, -215, - -83, -469, 790, 85, 428, -613, 114, 634, - 279, -570, 616, -813, -117, 3073, 3121, -717, - -200, 285, -1061, -44, 945, 386, -166, 494, - 776, 36, -25, -444, -260, 407, 3885, 1049, - 1348, 185, 454, -136, -2275, 1064, -271, -316, - 645, -1050, 483, 430, 32, 569, -676, -335, - -328, -2982, -370, 50, 189, 155, 1058, -119, - -407, -310, 461, 3293, -604, 195, 48, 68, - 196, 194, 547, -210, 785, -383, -410, -268, - -149, 192, -88, -13, 20, -80, -5146, -86, - -111, 40, -36, -138, 12, 239, -36, -84, - -512, 149, -237, -672, 3477, -3446, 1198, 220, - 146, -747, 242, 48, -146, -196, -335, -777, - -405, 620, -340, -367, -389, -108, -27, -184, - -2024, 518, 241, -104, 417, -1356, -1961, 134, - 3221, -423, 286, -60, -110, -568, 14, 76, - -144, 159, 704, -410, 542, -43, 223, 105, - -154, -141, -84, -132, -271, -235, -285, -248, - 480, 430, -4711, -487, -86, 482, 80, 46, - -239, -93, -115, -54, -1, 7, 97, -12, - 151, -180, 159, -63, 65, -215, 54, 5712, - 2886, -115, -236, 113, -25, -301, -450, -276, - -78, 197, -55, -278, -511, 163, 3442, -910, - -74, -225, -103, 63, -204, -43, -126, -334, - 223, 192, -131, 202, -83, 5000, -66, 441, - 33, 0, -116, 237, -238, -37, 445, -48, - 7, -1855, -1154, -251, -117, -185, 125, 1877, - 375, 388, -904, 202, 649, 376, -3231, 897, - 101, -637, 376, 16, 1, 845, -550, -610, - -380, -1363, -955, 71, 1303, 296, -264, -584, - 247, 3247, 98, 1035, -670, 416, -2008, -448, - -56, -169, -1787, 3314, 408, 2541, -833, -2, - -169, -184, 193, -575, -81, 410, -293, -478, - 21, 194, 223, -111, 4648, 60, 354, -593, - -2429, -671, 150, -350, 151, -448, -5, 386, - -441, 131, -339, 87, 815, 279, 51, 131, - 56, -3194, -170, -3899, -297, 270, 21, -215, - 7, 205, -305, 141, 577, 83, -289, -502, - -66, -96, 433, -106, -685, -194, -82, 33, - 98, 315, 258, -2453, -2957, 608, 672, 152, - -681, 1804, -74, -459, -423, 114, -1183, -100, - -798, 357, -79, -3418, -676, 580, -1637, -506, - 306, 437, 1001, 731, -885, -1276, -583, -359, - 650, 15, -189, 190, 86, 39, -7987, -133, - 324, 174, 22, 86, -144, -125, -43, -81, - -49, 68, 39, -204, -159, -291, -217, -68, - 264, 193, 406, 247, 27, -272, -168, 536, - -5740, -141, 38, 18, -7, 258, -111, 125, - 476, -364, 5, 72, -2668, -197, -605, -671, - -82, 201, -752, 227, 240, 345, -11, -138, - 551, -351, -228, -2774, -132, 1115, -1038, -18, - 791, -3136, 81, 219, 357, 755, 579, 26, - -3129, -398, -719, 193, 495, 290, -1123, 854, - -381, -535, 33, 232, 2340, -4577, -94, 1023, - -117, 39, -54, 15, -161, -860, 64, -209, - -597, 415, -135, -407, 1068, 894, -784, 108, - 267, 7506, 140, 67, 198, 74, 52, -388, - -184, -24, -54, -24, 172, 172, -50, -184, - -113, 164, 128, -39, 252, 90, 356, -313, - -90, -313, -355, -73, 19, 139, 141, -122, - -231, -4548, -157, -227, 47, 231, -421, 60, - -80, -3619, 4252, -354, 69, 148, 336, 446, - -183, 86, 248, 35, 73, 120, 157, 156, - -291, -523, 35, -264, 3434, 189, 495, -59, - 533, -343, -554, -3014, -415, 17, 436, 552, - -240, -394, -761, 43, -766, 46, -1119, -254, - 1540, 195, -298, -833, 45, -93, 61, 40, - -171, 167, 82, 107, 16, 40, -166, -46, - 120, -185, 13, 151, 8151, -235, 92, -23, - 214, 206, 260, 93, 163, 78, 184, -60, - -12, -171, -499, -151, -219, 11, -221, 221, - 3253, -376, -1079, -481, 763, -257, -120, -10, - 34, -640, 341, -2953, 528, 567, -672, -335, - -175, -61, 581, -260, 1159, -802, 1070, 12, - 168, 2305, 291, 203, -15, -569, 3247, -179, - 620, 339, 224, 710, -416, 512, -86, 571, - 439, -167, 571, -72, -144, 236, -382, 11, - 268, -176, -136, -337, 220, 64, 341, 361, - -4474, 25, 385, 453, -153, 89, -572, 245, - -197, 33, 75, 588, 51, -199, -74, -149, - 224, 210, 4689, 282, 20, -47, 129, 221, - -72, 27, 76, 93, 331, 215, -5, -20, - 74, -80, 169, 126, -40, -137, -24, -8101, - -23, 165, 271, 403, -34, -19, 290, -199, - -14, 205, 657, 301, -885, 2457, -1965, -2266, - -1004, -224, -554, 182, -220, -467, -611, 1012, - -122, 3303, -73, -205, 93, 3549, 217, -223, - 55, -459, 541, 286, -46, 128, 354, 137, - 824, -313, 32, 301, 139, -492, 170, 136, - -35, -752, 4613, -830, -34, 41, 344, 279, - 643, -394, -461, 163, -330, 199, -215, 83, - 1096, 613, -473, 816, 3534, 210, -772, 935, - -275, -600, -341, 602, 104, -598, -217, -789, - -2428, 870, -351, 474, 50, 321, -148, -2929, - 25, -135, -46, 11, -566, -3057, -664, 700, - -300, 256, -960, 350, -480, 414, 431, 24, - -51, -228, 407, 142, -321, 316, -290, 149, - 56, -84, -359, -118, -4948, 138, 373, -49, - 142, 71, -163, -13, -279, 38, -121, 35, - -47, -70, -43, 116, 3, -159, -11, 97, - -116, -62, 156, 307, -173, 7294, -143, 288, - -34, 671, 613, 16, -240, -229, -414, -494, - -43, -169, -854, 336, -991, 719, -353, -163, - -750, 2685, 2837, -558, 129, 2076, -47, 641, - -37, -93, 226, -69, 598, -284, 127, 106, - -426, -555, -947, 485, 54, -3175, 622, -341, - -544, 278, -205, -689, 391, 238, 9, 152, - -233, -392, 28, 36, -394, -1059, 132, 3761, - -480, 87, -656, 1304, 478, -272, 65, -147, - 91, 520, -896, 166, 62, -30, -28, 194, - 542, 3, 625, 1795, 3613, 1097, 1030, 906, - 400, 133, -127, 219, 958, 93, -546, -702, - 2937, -524, -270, -767, -192, 725, -897, -643, - 2502, 141, -1147, 257, 279, 470, -3001, -104, - 79, 508, 450, 265, -21, -74, -437, 647, - -2755, -407, -816, 620, 24, 537, -668, 604, -}; - -static const int16_t cb1110ss0[] = { - -8187, 90, -694, -168, -452, -4, -259, -332, - 352, -554, 43, 389, 236, 508, -175, 461, - -277, 118, 651, -245, 696, -1423, 368, -1417, - 1782, 1650, -540, 27, -461, 516, -599, -185, - 422, -11, -181, 19, 1809, -3226, -839, -191, - 468, 180, -550, 198, 2487, -923, -1335, -1008, - 1029, 1716, 588, 371, 902, -1214, 179, 1026, - 1560, 1815, -1714, 1230, -712, 1675, 1867, -154, - -2860, -484, 2289, -1018, 33, -1494, 614, -2340, - -724, -1088, -1930, -775, -876, 642, -1358, -144, - -2518, 62, 543, -1049, -1081, 672, 1305, -1506, - -86, 2920, 518, -1836, -546, -132, -45, -642, - 381, -404, -2206, -1211, 698, -703, -667, -606, - -677, -2246, 526, -1157, 177, 510, -1420, -617, - -1819, 1710, 1631, 1049, -1697, -495, 961, -1250, - 39, 482, 445, -956, -71, 977, 426, 1826, - 286, 36, 295, 1786, 794, -3456, 1645, -766, - -1580, -2435, 1108, -286, 731, -659, 960, -1759, - -978, 316, -350, 91, -35, -222, -1417, -53, - -529, -679, 681, -4700, -524, -39, -350, 196, - 199, 191, 653, 1344, -942, -428, 156, 173, - 636, -1538, 1795, 1709, -190, 1265, 164, 650, - 2302, -1757, 1762, 413, -851, 44, -1371, 343, - -3845, -122, 1864, -489, 601, -748, -402, 590, - -124, -1988, -1536, -999, 399, -753, 295, -384, - -1316, 55, -669, 262, -1157, -3766, 992, -111, - -2928, -1424, -98, -62, -334, -1848, 377, 1560, - 947, 1568, 1554, 206, 664, 2014, 2098, -164, - -640, -2897, -647, -1675, -2307, -254, -555, -2426, - 1497, 465, -1525, -1148, 55, 632, 554, 2068, - 451, -1532, -715, -2065, -1177, -623, 478, -88, - -1140, -72, -450, -248, -1111, -250, 1356, 2717, - -1841, 420, -1299, -1715, 746, -101, 600, 1130, - -903, -473, 1225, -876, 193, 694, -193, -482, - -1838, 94, 157, 1131, 267, -242, 2021, -39, - 795, -285, 438, -4322, 1097, -621, -518, -338, - -289, -114, -671, 1700, -477, 449, -1664, -693, - 1403, -3629, 1480, -991, -234, -213, 354, -269, - -1140, -40, 1455, -758, 1273, 497, -686, -945, - 59, -66, -769, -2930, 2343, 2452, -1576, 995, - -734, 1009, 98, -350, -1116, 545, 189, 99, - 566, -916, 20, 117, -807, 986, -428, 177, - 1247, 485, -680, 1139, -1263, -256, 4828, 89, - 27, -1339, -1091, 149, -641, -703, -570, -112, - 346, -93, -641, -97, -991, -2247, 2284, 847, - 2110, -1393, -315, -1468, 514, -1493, -46, 1135, - -1231, 39, -913, -278, -762, 1775, -684, 735, - -1676, 386, -2030, 2534, -2371, -1661, 1204, -111, - -8, -607, 1233, -1532, -1263, 1530, -537, -1728, - -335, 269, -614, 12, -1187, -770, 471, 373, - 4743, 12, 197, 610, -101, 417, -350, 551, - 544, -898, 387, -682, -1216, 126, 96, 94, - -268, 535, 126, -778, 1595, -1379, 3366, 49, - 460, 1772, 198, -896, 75, 253, -1376, 68, - 838, -1121, -578, -630, -718, -975, -565, 1303, - 354, -769, -38, -246, -193, -408, 41, 165, - 374, -87, -155, -8, -746, -430, -869, -1842, - -385, 281, 5119, 432, 1119, -807, 1756, 816, - 131, -548, -528, 1347, 478, 1482, 2942, -290, - 650, 1012, 163, 840, -804, 94, 2507, 1514, - -953, -289, 23, 1128, -895, -1009, 1871, -370, - 699, 659, -3069, -695, -1559, 1435, 672, 94, - 1496, -637, -2208, 1083, 688, 485, 251, -828, - 1313, -21, -1948, 230, -603, 783, -829, 524, - -1142, -3845, -1383, 323, 1295, 732, 759, 591, - 68, -1869, -756, 1727, 339, -1565, -510, 2623, - 358, 3071, 281, -790, 1129, 243, -588, -431, - 492, 372, 96, 890, -935, -727, -236, -416, - 171, 226, -1090, 1257, -1063, -303, -817, -1506, - -947, 2282, -659, -406, 79, 772, -816, -2610, - -1802, -1019, -816, -1886, -1306, 1365, 624, -2314, - -57, 1012, 215, -130, 3404, -864, 959, 202, - -26, -1015, -1212, -34, -408, 3494, -284, 845, - 275, -1005, 458, 840, -2258, -13, -129, 2536, - 1269, 1216, 2071, -243, 624, 584, 2192, 720, - 604, -1397, 766, 984, -1050, 157, -246, 438, - 240, -587, 1251, -649, -22, 33, 5818, 608, - -996, 474, -523, -454, 1252, -791, 631, -465, - 663, 452, 1793, 853, 39, 3732, 758, -1329, - 11, 2217, -136, -540, 1335, 65, -2047, 943, - 701, 1886, 2085, -890, -16, -184, 325, -1077, - -271, -1246, 391, -1686, -651, -77, 319, 292, - -160, 1204, 1093, 776, -310, 1512, -1196, 149, - 46, 593, 1738, -566, 97, -3667, -485, -683, - -121, -216, -149, -344, 406, -989, -311, 383, - 979, -828, 394, -22, -5143, -1368, -18, -433, - 359, 607, 996, -1144, -229, 1365, -1243, 413, - -591, -621, 803, 1356, -625, 1149, -234, 182, - -1285, -2487, 359, 2640, -1426, -66, -688, 237, - 1307, -361, 108, 207, 1026, -500, -1156, -1043, - -2192, -2232, 1790, 1135, 1742, 1494, -1156, -698, - 2520, -2596, -620, 431, 748, 88, 912, 832, - 1122, -483, 1837, 1821, -826, 1112, -424, -306, - -750, 1085, 260, 152, -114, -1065, -4518, -300, - -976, 143, 1452, 1395, 1677, 59, -51, -1072, - 868, -171, -26, -914, -109, -2420, -48, 69, - -230, 630, -522, 2274, 1265, -1612, 2570, 836, - -2042, -1922, 2970, 775, -320, -2486, -2935, 553, - 178, 994, -1054, -1321, 699, 749, 1002, 513, - 586, 1550, 35, 654, -995, 1743, -1049, -405, - -3431, 1943, 700, 555, 111, -67, 1007, 111, - -57, 661, 404, -628, 425, 2185, 860, -516, - -523, 452, 238, -1778, -378, -721, -2197, 218, - 864, -1031, -832, 135, -2543, -447, 789, 1117, - -1491, 120, 1294, -702, 627, -412, -902, 404, - -1843, -786, -597, 900, 1963, 22, -843, 1168, - -1045, -797, 764, -423, 329, 2308, -1950, 331, - -1090, -2466, -483, 2023, -3363, 2126, 495, 2812, - 1922, -1488, -1041, -798, 135, 408, 33, 563, - 1333, -36, -2181, -787, 709, 287, -971, 93, - -459, -975, 2412, 280, 2555, 32, 2217, -1825, - 650, 313, 585, -947, 1170, 45, 1108, -435, - 1092, 220, -155, 512, 460, 211, -231, -627, - -836, -2205, -181, -113, 130, 226, -321, -765, - -1327, -1190, -676, -357, 691, 232, -365, -1818, - -3007, 2210, 997, 601, 2156, -782, 1626, -1081, - -49, -616, 685, -12, 40, 3480, 563, 515, - 245, 51, 290, 1227, 171, -1078, 520, -483, - 280, -1517, -1331, 2132, -1176, -1381, -1546, 1436, - -852, -505, 672, -807, 623, -244, -125, -1958, - 516, 798, 1185, 922, 441, 651, -610, -1430, - -1887, 114, -869, -2024, -1627, -2276, 2008, -1224, - 125, -609, 371, -1104, -506, -942, -624, -478, - 197, 141, -242, -1051, 1532, -1269, 666, -1055, - 1689, 444, 1720, 16, 301, -2311, 1196, 1108, - 1298, -564, -1197, -1858, 439, -198, 324, -1884, - 3193, 2281, 201, 587, -2028, 1969, -1087, -352, - -87, -632, 144, 165, 68, 1150, 173, 478, - -837, -470, -464, -195, -205, 2111, 15, 643, - -453, -339, -1128, -1368, 1182, 822, 654, -2331, - -1668, -215, -678, -2460, 1169, -664, 777, -348, - 2570, -767, -563, 254, 562, -557, 4, -97, - 1990, 373, -780, -677, 1996, -1527, -365, -416, - -325, 587, 910, -3780, -553, 104, 1705, 240, - -719, -1717, 2765, -582, -76, 399, -1152, 2379, - 3169, -1153, -725, -35, -1214, 362, 1600, -724, - 424, -722, 472, 872, 694, -126, -1649, -1314, - -1814, -95, -312, -34, 780, -884, 824, -864, - 526, -100, 3820, -56, -452, 43, 564, 487, - 177, 890, -1423, 894, -552, 1438, 204, 1015, - -4, 327, -3327, -433, -335, -869, 1312, -488, - -1287, -169, 2018, 435, 73, 508, 1160, -1060, - -134, -1304, -341, 623, 125, -15, -1120, 108, - -71, -1487, -189, -3640, 1424, 1740, 1116, 579, - 1603, -3294, 1241, -225, 1481, 2775, 1326, -242, - -632, -1560, 563, 559, 138, 115, -557, 2004, - -1771, 717, -1052, -1115, -1634, 889, -441, 1954, - -164, -1507, -1312, -407, 662, -867, -896, 225, - 2576, -224, -107, 237, -694, 859, 192, -1033, - 2255, -1225, -891, -1994, -90, 339, -382, -774, - 1460, -1553, 648, -521, 2370, 160, 714, 54, - -906, 1435, -1752, -274, -523, -36, 1208, 1553, - -339, 1000, -178, 209, -1001, 916, 495, 310, - 726, 127, -391, 107, -513, -1052, -376, 297, - -307, 933, -233, -253, 1196, 4619, -1278, 762, - -13, -387, -973, 2153, 68, 362, -887, -1922, - -106, 298, -1127, -2601, -2184, -111, 111, -1588, - 1002, -365, -2226, -290, -599, 610, 551, -1368, - -4344, 618, -172, 349, -914, -530, -192, 718, - 348, -675, -884, 913, -94, 215, -834, 353, - 753, -811, -84, -905, -128, -483, -1782, -1255, - -2333, -1110, 477, -566, 346, 2018, -1644, -325, - 1365, -1223, 158, -1786, 566, 203, 742, 281, - -555, 573, -978, -459, -1671, 378, -689, 349, - 606, -5961, 562, -13, -223, -419, -442, -447, - 125, -1052, 53, 2594, -1377, 209, -1549, 533, - -118, -2538, 1808, -364, -37, 1221, 607, 593, - 309, -240, 1574, 254, 434, -141, -220, -2018, -}; - -static const int16_t cb1110ss1[] = { - 631, 3041, 1215, 2376, -1843, -103, 750, 144, - -87, -249, 715, -201, 758, 202, -197, -135, - -523, 1243, 457, -717, -700, 1662, 918, -48, - -1008, 180, 411, 948, 2192, 2607, -826, -962, - -1130, -59, -1047, -305, -325, -1032, 2096, -287, - 395, -1543, -268, -1218, -2045, -1674, 951, -1846, - -636, 263, -138, -287, -327, -2208, -664, 496, - 2179, 1645, 340, -601, 473, 670, 950, 2774, - 364, 613, -1896, -1876, -3177, -105, 506, -164, - 281, 718, 2419, -1077, -50, 365, -1631, -134, - -384, 231, 767, -285, 1268, 321, -1408, 217, - -409, -725, 1225, -2551, -2622, -274, 473, 2752, - -11, 342, -495, 1627, 79, 240, 2, -1021, - 640, -508, -269, 648, -116, -1283, -217, 13, - -1674, 2402, -879, 1791, 2753, 2386, 1195, -700, - -282, -428, -671, -92, 1187, -672, 1037, -1913, - 246, -816, -69, -2284, -712, -996, 2498, 902, - 809, -149, 66, 775, -44, -566, 955, -1073, - -1438, -894, -978, 274, -390, 5528, 1153, 17, - -750, 63, 545, -725, -301, -323, 661, -813, - -347, 739, 335, 136, 203, 342, 802, -199, - -818, -679, -282, 2195, -1714, -757, -154, 182, - 132, -1737, 405, 2394, -3727, 1349, 213, -193, - -2495, -1354, -629, -1171, 1429, -16, 834, -1260, - 160, -1892, 874, 1754, -567, 344, -3499, 1612, - -987, -424, -997, -1640, 594, 1058, -783, 511, - -604, -1480, -1754, -424, 2262, -1991, 1297, -638, - 350, -588, -55, 1483, -456, -567, 146, -946, - 731, 1541, -759, 592, 1231, -270, 171, -1975, - -2707, -456, -227, 392, -891, 1008, -1066, -487, - 231, 1372, -51, -599, -227, 696, -820, 354, - 1928, -48, -1302, -570, 316, -283, -848, 2563, - -266, 2821, 540, 553, -1272, 1120, -1164, -451, - 384, -1058, -1018, 1735, 992, -1220, -83, 1490, - 2304, 122, 1630, 1108, 1997, 2346, -647, 301, - -1746, -218, 313, 462, 1486, -536, -508, -463, - 104, 930, 605, 2116, 793, 2881, -724, -1379, - -53, 4458, 793, 275, -180, -516, -489, -774, - -265, 704, 112, 175, 112, -121, 652, 310, - 564, -440, 773, 1885, 927, -672, -773, 1726, - -614, 818, 1589, -372, -207, 499, -894, 987, - 796, 652, -1228, -4010, -2208, 458, 645, 498, - -279, -852, -1897, -1820, -35, 674, 201, 474, - 77, 94, 2327, 723, -1081, 261, 209, 1179, - -1175, 623, -1293, 2154, -117, -3707, 940, 813, - -1059, -335, 1306, 525, -191, -2066, -425, 19, - -366, 529, -145, 822, -913, 254, 424, -354, - -167, -2437, -1433, 603, -318, -1517, 4250, 541, - -1360, 450, -531, 200, 534, 1200, -222, -535, - -162, -1211, -116, -144, -462, -139, -482, 511, - 2068, -2100, 971, -1487, -1050, -3150, -701, 119, - 16, 1535, 272, -1184, 2242, 488, -492, -915, - 1660, 212, -826, -444, 1003, 2705, 3591, -174, - -333, -431, -59, -903, 61, 751, 1087, -45, - -1031, 617, 686, -15, 848, -348, 947, 396, - 931, 1785, -552, -920, -669, -63, -1869, 2357, - -1549, 807, 889, -1581, -1071, 1587, -1108, 1300, - -658, -625, 300, -285, -977, 1656, 4183, 1487, - -191, 658, -300, 497, 1378, -300, 1031, 322, - 114, -449, 666, 1250, 264, 125, -109, 748, - -503, -40, 199, -1212, -1643, -2522, 151, 121, - -1128, -3200, 876, -446, 878, -989, 1510, 2261, - -1507, 1793, -402, 30, 228, -50, 985, -1568, - 755, 1559, -688, 1342, -423, -1507, 96, -501, - 474, -2926, -2493, -131, -656, 450, 1035, 812, - -14, -933, 941, 1396, -957, -621, -516, 379, - -225, -2063, -2048, 669, 287, 1688, 1727, 299, - -658, 852, 745, -260, 993, 158, -1236, -1422, - 33, 611, -112, -323, -194, 839, -1407, -1505, - -2010, 1267, -355, -675, -3779, 768, -228, -643, - 661, 1313, -529, 962, -948, -212, 1043, 1560, - -174, 1744, -938, 289, 1942, -2228, -1932, 1056, - -590, -940, 922, 601, -853, -791, -637, -2, - -52, -83, -209, 1422, 856, -1141, 2500, -1195, - 773, 1087, -1389, 409, 439, -3674, 453, 1637, - -15, 1013, 2635, 1530, -1104, 440, 895, -210, - 1118, -6, 45, 65, -1110, -3307, -331, 478, - -155, -410, -721, -1234, 129, -971, -1117, -27, - -1132, -1289, 1888, -1112, 203, -1091, 442, -2207, - 501, -343, 468, -52, 385, 269, -3102, -366, - -469, 391, 505, 176, 356, -69, -929, 1155, - -280, -1264, -897, 1006, -494, 155, 36, -627, - 924, -816, 154, -750, -837, 5263, -1099, 91, - -481, 71, -681, -574, 1229, 675, 1217, 1073, - -695, 274, -381, -140, 1372, -524, 1164, 341, - -149, -856, 793, -1294, 981, -961, 371, 1178, - 1463, 373, 1375, -4384, 239, 136, 67, -1196, - -126, -1001, -228, 150, 437, -1830, 477, 498, - 4246, 793, -661, 260, -1810, 1405, 76, 902, - -844, 908, 1830, 27, -124, 257, 765, -98, - 592, 487, -132, 202, 675, -669, -679, 1309, - -4002, -206, -66, -390, -253, -190, -921, -83, - 1411, -417, -2560, -646, 1853, -148, 548, -370, - -723, 959, -906, -3058, -276, 467, -1280, 970, - 687, 484, 506, 1143, -1509, 828, -2169, 2931, - 1322, -579, 1033, 209, -979, 217, -434, -1438, - 314, 2384, -906, -29, -1478, -31, 574, -373, - 1478, -124, -680, 330, 794, -753, -977, 1151, - -1190, -1479, -642, 1658, -2201, -1469, 1589, 587, - 52, 1298, 2092, -1483, 678, 1988, 918, -648, - 328, 2096, -1090, 2153, -1416, 295, 537, 261, - 398, -1389, -399, 1105, 10, -395, 1169, -431, - -423, -1617, 766, -1900, -3205, 131, -746, -852, - 2215, -317, -232, 1079, 293, -727, 50, -446, - -713, -897, 768, -896, -667, -281, 377, 115, - 1695, -4870, 713, -393, 251, 1268, 477, -497, - 294, 18, -359, 556, 308, -752, -863, -216, - 151, -163, 695, 587, 810, 2107, -107, 921, - 1203, -472, 1280, 372, 110, -581, -225, -714, - -58, -2587, -1980, -186, -372, -1410, -1504, -1020, - -745, -88, 2373, -568, -2841, -2041, -1841, 2065, - 389, -430, 1163, -208, 569, 375, 650, 317, - 1114, -1036, -959, -896, 1060, 1014, -599, -1743, - 1121, 808, 1556, 326, -2876, -1556, -1283, 384, - -1102, 378, 1433, 702, 1454, -1243, -725, 224, - -610, -455, 1413, -1747, -2516, -572, -1455, -313, - 231, 780, 1531, -2475, -34, 921, -1650, 269, - 818, 5, 835, -209, -911, -432, -1104, 165, - -1638, -46, -2031, -445, 1308, 1519, -1992, 1606, - 956, 757, 1139, 116, 829, -1376, 209, -893, - 963, -569, -466, -185, -1345, 1524, 1714, 269, - 219, -161, 482, -1178, -3621, -831, -668, 1871, - -529, -983, 558, -818, 81, 555, 33, -473, - -187, 113, 899, -577, -1093, 1408, 902, -258, - -111, -648, 4340, -780, -651, 789, -92, 2310, - -401, 669, -213, 369, -104, -820, -290, 48, - -917, 71, 1070, -239, -744, 891, 23, -5130, - -761, 312, 319, 842, 280, 78, -149, 352, - -594, -361, 354, -906, 42, -1610, 835, 157, - -631, 1100, -297, 1081, -96, 484, -825, -2132, - 549, 1305, 128, -314, -1733, -265, 1285, -4061, - -348, -136, -940, -507, -232, -1511, -876, 78, - 2120, 175, 2216, 1179, 497, 335, 350, -18, - -1307, -387, -2207, 587, 3209, -370, 1155, 1501, - -1687, -796, -1417, -733, -269, 801, 83, 1173, - 718, -2702, 19, -315, 4501, 1025, -365, 348, - -417, -510, -172, -1201, 1478, 671, 1933, 1759, - 676, 416, 30, 400, 531, 351, -1176, -2807, - 1969, -1398, 1159, -568, 754, -149, -1880, -274, - -1203, -43, 1391, 383, 702, 2116, 1299, 1952, - 646, -719, 1735, -986, 100, -956, 1040, 2287, - -1606, 612, 1760, 733, -2453, 531, -14, -1, - -3214, -1993, 371, 227, 45, 2011, -531, 1089, - -1029, 282, -2426, -525, 989, -469, 285, 1787, - 927, -335, 1127, -305, 1143, -412, -1626, 1759, - -2567, -82, 1170, -3051, 1266, 1522, -124, -1935, - 552, 1122, -51, 347, -674, -360, 1183, 223, - 3015, 955, -826, 1108, 2325, 868, 1152, 1079, - 223, 217, -428, 382, 642, -2849, -767, -70, - 407, 147, -392, -407, -55, -508, 1785, -683, - -885, 851, 3879, 471, -674, -231, 1493, 1621, - -1698, 528, 623, 300, 1367, -588, 816, -24, - 600, -182, -841, 854, 370, 715, 116, 714, - -1308, 1435, 1802, -2627, -814, 363, -318, -73, - 850, -1744, 2509, -303, 1077, 660, 2145, 2130, - -730, -88, -115, -517, -154, 160, -337, 27, - 1502, 509, -70, 502, 820, -309, -3740, -1294, - -610, 241, -662, -524, 1319, 456, 926, 958, - -111, -1004, 1795, -604, 1086, 462, -127, -125, - 264, -1093, 1427, 334, 838, 1979, -576, 3052, - -3590, 1607, 356, 728, 1619, -400, 279, 570, - -434, 777, -1448, -888, 156, -277, -1529, 1122, - 2235, -794, 3417, -830, -82, -664, -1837, 946, - -370, 1434, -50, 742, -2368, 1438, 1264, 1172, - -1338, -108, -226, -958, -2130, -2, 917, 896, - 1563, 2181, 2684, 2343, 237, -407, -2685, 1447, - 1028, -728, 109, -620, 478, 46, -542, -789, - -879, -438, 1244, 1075, -1730, 119, -694, 137, -}; - -static const int16_t cb1110sm0[] = { - 916, -269, -44, 343, 623, -2512, -171, -1904, - 1001, 2776, 226, 1487, 705, 763, -616, 288, - -212, -535, 3080, -352, -367, 512, -673, 620, - -874, 769, -956, 460, -601, -2793, -102, -765, - -431, -1369, 149, 481, -49, 109, -412, 670, - -615, 287, 150, 321, -3293, -237, -1627, 188, - 1867, 1481, 353, -134, 2706, 147, 74, -77, - -148, -224, 196, -60, 179, 125, -13, 1011, - -189, -172, 658, 4441, -540, 531, 239, -329, - 2782, 392, 97, -660, 3488, -78, 1308, -574, - -903, -170, -279, 173, -70, 601, -385, 123, - -423, -512, -193, -233, 106, 175, 210, 185, - 489, -236, 153, -670, 25, 61, -196, 213, - 67, 339, 5443, 116, -647, 149, -130, 197, - -11, 305, 2669, 1212, 298, 84, 219, -26, - 2661, 650, 1348, -65, 574, -1482, -268, -30, - 626, 328, 279, -245, 87, 94, -202, 2, - 366, -505, -592, 2, 5666, 384, 22, 227, - 208, -1221, 78, 155, 260, -1111, 165, 396, - -678, -739, 2503, -2395, 2025, 1424, -343, -759, - -837, 101, 55, 274, -481, 22, -568, 1044, - -271, -124, -609, -833, -206, 53, -591, 1150, - -1950, -2875, 1949, 59, -334, -3230, 176, 1133, - -372, 2937, -803, -663, 631, -659, -32, -82, - 851, 113, -60, -625, 556, 177, 112, -753, - -33, 313, -33, -208, -177, -5496, 55, -533, - -815, 123, -755, -215, 638, 223, -156, -917, - -166, -33, 504, 704, -3001, 124, -153, -1809, - -977, -717, 1718, 476, 212, 1661, 953, -1422, - -1014, -94, -524, -2562, -267, 371, 104, -63, - -546, 262, 193, -1714, 261, 1867, 738, -1878, - 400, 1754, -445, -405, -841, -439, 709, 44, - 675, 248, 640, -138, 1217, 393, -1402, 653, - 3110, -938, -2491, -688, 1214, -649, -1356, 2506, - 203, 172, 679, 1003, 772, -3010, 82, -998, - 1011, -980, -28, -138, -430, 614, 427, -341, - 201, -8082, -118, 224, -1167, 195, -920, -352, - -657, 5, 46, -39, -72, 698, -136, -40, - 391, 287, 157, -1197, -60, 2808, -123, 489, - 152, 2318, -805, 958, 98, -1496, -835, -846, - 589, 455, -868, 245, -10, -5047, 12, -50, - 1277, -95, 456, -49, 570, 608, -658, -352, - -277, -268, 214, 388, 1865, 2, 3033, -269, - 259, -75, -3437, 800, -190, 668, -263, -111, - 229, -43, -139, 659, -290, 782, -18, -854, - 271, -2223, 30, -162, 71, 47, 756, -1269, - 336, 863, -1998, -16, 1172, 236, 929, -477, - -2446, -92, -425, -193, -8192, 321, -102, 85, - -85, 108, 318, 149, -27, -182, 69, -237, - 35, 451, -263, -890, -348, -295, 64, 410, - 6427, 569, 604, 543, 38, 31, -15, 148, - 249, -83, -67, 457, -76, -560, 694, -797, - 190, -113, 2006, 136, 1705, -428, 3549, -550, - 70, -3, -147, -288, 1142, -919, 493, -1305, - -460, -151, 831, 623, -768, -211, 31, -296, - 167, -2721, -16, -654, 243, 2555, -311, 1845, - -531, -576, 143, -574, 490, -1089, -2302, 1080, - 701, 472, 2782, 320, -1455, -632, -218, 281, - -1492, -661, -1379, -538, -236, -1928, -502, -565, - -480, 525, -81, 38, 263, 3, 366, 163, - -3140, 882, 189, 1123, 382, -1748, -1210, 371, - -602, 696, -413, -207, 358, -616, 4725, -473, - -784, 249, 621, 764, -265, -1004, -570, 339, - -643, -123, 302, 284, 1, -159, -321, 250, - -297, -43, -3512, -1064, -493, 556, -1184, -263, - 1314, 2028, 1074, 9, 2941, -998, -271, 966, - -754, -2589, 88, 741, -307, 134, 152, -86, - 311, 904, -917, 1199, -5090, 118, 181, -311, - -412, 475, -647, -717, -637, -221, -291, -469, - 77, 946, -1196, -119, -175, 530, -465, 383, - -1253, 589, 826, 835, -3578, -319, -80, 488, - -238, -497, 360, 839, 1870, 762, -1669, -769, - 429, 778, -3121, -325, -55, -128, 2606, -874, - 1043, -902, 1746, -725, 115, 167, 142, 604, - -101, -725, -11, -458, -27, 450, 293, 2, - -383, 23, 172, -6725, 400, -205, 165, 45, - -38, 86, 372, 354, -68, 390, 2444, 521, - 4, -3586, 357, 129, 665, -328, 524, 113, - -446, -514, 1132, 289, -560, 239, 167, -349, - -724, 101, -3165, -3139, -163, -147, 865, -617, - 0, -789, 797, -1026, 432, 359, -460, -105, - 1119, 486, -233, -360, -175, -349, 837, 469, - -250, -521, -4470, -108, 1009, -575, 283, 22, - -555, -682, -234, -249, -33, -106, 521, 515, - -283, -78, 101, -135, -648, 506, 181, 392, - -517, 5405, 442, -106, -8168, 51, -310, -813, - 49, -314, 586, -479, 376, 113, 337, -151, - 245, 270, -1, 619, -312, -37, -215, -482, - -3055, -3261, -346, -493, -357, 306, -160, -21, - 258, 872, -577, -141, 18, -84, 693, 151, - 218, -533, -37, 540, 61, 40, 3150, 157, - -2549, -324, 267, -456, -1236, 798, 517, -224, - -196, 587, -495, 18, 258, 3147, -15, -568, - 957, -444, 637, -354, 828, 1182, -769, -137, - -2130, 408, -1667, 252, 282, 201, 239, 154, - 125, -7882, -332, 198, -47, 265, -289, 358, - -4, 103, -795, 207, 82, 229, 429, 361, - 263, -409, -451, -1036, -3419, 899, -568, -1480, - 898, 284, -53, 179, 975, -1283, 759, -150, - 3244, 408, 2579, -418, -117, 226, 583, 210, - -62, -1513, -148, -820, 1073, 1290, -263, -454, - 653, 555, 286, 218, -105, -135, 231, -892, - -284, 2513, 2715, -1530, -165, -1419, -223, -66, - 525, 1556, -18, -664, -19, 856, 179, 535, - -339, -245, 498, 193, 235, 328, -491, 231, - -5629, 65, -85, 313, -395, 6, 344, 267, - 672, -991, 178, -1335, -64, 9, -1508, -69, - 57, -310, -1793, -850, -3669, 427, -79, -720, - 219, 366, 131, 523, 141, -1055, -66, 13, - -843, -55, -794, 661, 112, -407, -496, 550, - 931, -3938, 1780, -509, -543, -157, -270, -1015, - 564, -231, -854, -3372, -327, 869, -196, -981, - -205, -215, 605, 746, -2188, 2250, 74, -2979, - -242, 832, -190, 365, -1327, 453, 95, 76, - 158, -683, 628, 297, -867, -542, -143, -568, - -414, 6018, -40, -35, -456, -632, -779, -226, - -442, -295, 310, -766, 578, -197, 84, -961, - -3346, -106, 3266, -3, -477, -8, 652, 122, - -606, 49, 34, 686, 385, -258, 214, -572, - -72, -193, 124, 440, 48, 45, 75, 9, - -7724, 200, -364, 578, 318, -461, 84, -233, - 46, -404, 185, 470, -3387, -3397, 374, -519, - -320, -378, 27, 921, -280, 188, -245, -69, - -322, 504, -72, 460, -80, -35, -220, -3098, - -3678, 477, 248, -801, 580, 187, 468, -636, - -364, -432, 183, -82, -79, 266, -787, -740, - 552, 228, 238, 482, -2229, 275, 149, -360, - -350, 2774, 871, -118, 55, -961, -165, 2429, - 982, 313, -502, 3094, -431, 3485, 473, -347, - 171, 544, 253, -324, -50, 464, 116, 650, - 1102, 495, 420, -404, -1, -2991, 4055, 207, - 374, -187, -121, 130, -451, -953, 822, 526, - 287, 120, -979, 376, 594, -79, -130, -362, - -979, 166, 693, -4108, 84, -135, -195, -703, - -1506, -1098, -611, 870, 935, -156, 974, 286, - -86, 83, 2975, -681, 3218, -286, -452, -70, - -113, -395, 137, -1295, -503, 853, 297, -352, - -1004, -117, 476, -431, -2848, -7, 3601, 402, - -534, 312, 86, 1524, -358, -164, -43, 913, - 1003, 239, -364, -88, -468, -672, 220, -211, - -326, -431, 438, -297, 380, 125, -146, 4550, - -271, -831, 768, -1360, -45, 266, -278, -246, - 625, -132, 153, 514, 115, -1311, 707, -361, - -601, -3224, 376, -2107, -259, -1155, 426, -646, -}; - -static const int16_t cb1110sm1[] = { - 360, 3106, -518, 185, -906, 3245, 508, -91, - 938, -1270, -492, 36, 168, -997, -208, 991, - 99, 1553, -294, 204, -22, -108, -2405, 2893, - 49, 72, -490, -529, -218, 1343, -786, 903, - 411, 207, 131, -636, -129, -134, 621, -253, - 319, 135, -234, -75, -293, 46, 207, 5985, - 280, -86, -78, 690, 984, -770, -565, -226, - -242, 374, 26, -696, 81, -277, -9, 639, - -730, 250, -232, -488, -284, 460, -398, 4336, - -303, -266, 546, -292, 2936, 70, 2077, 373, - -141, 292, 2102, 340, -312, -523, -341, 1017, - 457, 224, 315, 271, 1080, 152, 192, 568, - 1014, 155, 85, 329, -5235, 137, -503, 141, - 275, -7, 752, 282, -267, 321, -735, 746, - 489, 450, 478, 432, -152, 451, -1192, 1267, - -341, 1136, 100, -3538, -1551, 1547, -551, 294, - -473, -821, -51, 718, -655, -11, 2817, -26, - 73, -459, -1569, 181, 516, -151, 2846, -112, - 186, 714, -228, -210, -451, 920, -99, -132, - -2662, 589, 3040, 376, 662, -834, 782, 542, - 1485, 538, 3531, 107, 47, 62, 398, -11, - -15, -733, 471, -231, 668, -212, 38, -536, - -1905, 2769, -149, 1623, -3418, 237, 55, -328, - -770, 335, 2755, 340, 62, -466, 267, -946, - 427, 266, 80, 1134, 34, 949, 366, -339, - -112, 3, -105, 442, 5117, 545, -93, 611, - -186, 566, -39, -172, -59, -1120, 388, 703, - 619, -359, -117, -68, 569, 148, -214, -245, - 281, 617, -2337, -88, -255, 124, 3292, 443, - 434, -17, -1157, 3090, -205, -245, -983, 250, - -1086, 643, 1392, 831, 733, -59, -1199, 1747, - -415, 1073, 279, 428, -512, -3392, 0, -6, - 526, 275, -79, 477, 411, 85, 1485, 795, - -209, 495, -2628, 367, -1734, 900, 301, 239, - -53, -2068, 403, 1333, -1304, -566, -1420, -771, - -2300, -15, 842, 342, -2373, 61, -1379, 303, - 733, -108, -316, 94, -477, -254, -211, 807, - 273, -792, 159, -66, -857, 1092, -1001, -69, - -3770, 999, 2418, 854, 173, 2281, -681, 485, - 578, 145, -1245, 845, -375, 219, -259, 374, - 751, 226, -1347, -825, 66, 319, -173, 191, - 445, 284, 62, -8150, -71, 53, 637, -96, - 227, 75, 73, -88, 654, -24, -466, 477, - 671, -125, -942, 104, 248, -151, -383, 11, - 322, 332, 4160, 108, -301, 463, -402, 352, - -1799, 580, 1443, 396, 287, -158, -421, 340, - -349, 109, 61, 47, -2816, -298, -947, -817, - 673, 189, 36, 4069, -584, -335, 2608, 10, - -378, -630, -801, 228, 946, -405, -1186, 473, - 625, -2, -741, 523, 3747, 318, 733, 171, - 268, -2554, 402, -252, -205, 292, -351, 64, - 289, 801, 989, 435, -100, -163, -1215, -467, - 661, -714, 165, -228, -637, 1357, -498, -52, - 488, -3882, 130, -1053, 796, 1040, 381, -729, - 147, 803, 169, 46, -157, 167, -209, 126, - -1016, 88, -1018, -458, -527, 1259, 621, 3847, - -525, 1247, 18, 253, 642, 340, -705, 838, - -2769, -672, 153, 115, 453, 773, 9, -2285, - -291, 6, -219, 628, 284, -330, 568, -240, - -206, -127, 273, 373, 367, -494, 8192, -595, - -255, -158, -326, -60, 513, 334, -667, -549, - -110, 2, 573, 1086, -610, -368, 259, -3611, - -455, 1577, -524, 11, 904, 390, 313, 707, - 2670, -223, 2710, 593, -25, 228, 540, 663, - 740, -1108, 298, 1223, -531, -1978, 248, -661, - -341, -910, -2434, 111, 217, 748, 231, -305, - -419, 1873, 1094, -936, -1741, 1133, 1881, -671, - 41, 268, -1826, 466, 135, 37, -200, 4623, - -1212, -969, 541, 1278, 652, 1061, -759, -747, - -427, -107, -1329, -583, -255, -67, -311, -10, - -421, -8192, 322, -181, -442, 76, 176, -742, - -175, 147, 385, -275, -87, -704, -545, -315, - -414, 569, 81, -387, 628, 2954, -604, -1459, - -29, 1693, 840, -1024, -66, -317, 266, -2465, - -917, -14, 151, -369, 366, -2388, 1, -773, - 1333, -99, 223, -694, -1169, 917, -2496, -1290, - -286, -1007, -508, 734, 451, -256, 266, -105, - -143, 439, -120, -146, 7690, -183, 188, 68, - -385, 7, -278, -24, -66, 292, 137, 143, - 21, -495, -527, -284, 89, -1584, -64, -3664, - 286, -2258, 80, -932, -771, -338, -830, -1029, - -99, -32, -800, 351, -87, 600, -93, 133, - 389, -690, 269, 201, -328, 5489, 558, -702, - -487, 210, 3107, -3628, -96, -388, -169, -221, - 339, 403, -816, -24, 469, -112, 560, 844, - -441, 698, 169, -378, -283, -924, 2842, -479, - -694, -117, -94, 523, 974, 1356, -638, 590, - 820, 2164, 247, -532, 648, -243, -599, -67, - 5686, 174, 78, -608, 230, -172, 369, 342, - -113, 111, -345, -311, 594, 350, -260, -1423, - -425, -407, -1017, -298, -180, -738, -891, 66, - -3312, -1157, 1, 811, -1431, 612, 797, -1344, - -890, -959, 318, 392, -190, 735, 196, -347, - 61, -116, 344, 243, -411, -446, 62, -128, - -3386, 476, 2695, -193, -39, 1960, -7, 909, - -118, -2275, -28, -997, -210, 374, -586, -82, - 914, 323, -73, -2743, 858, -65, 43, -2444, - -246, 145, 78, -638, 844, -2079, 352, -332, - 615, -779, 270, 1799, 680, 500, 686, 1168, - -397, -2233, -31, -163, -18, 602, -232, -915, - -941, 3708, -337, -559, 315, -401, 42, 26, - 316, -100, -191, 36, 206, 214, -3336, -407, - 494, 749, -491, -162, -55, -2902, -1515, -198, - -311, -359, 439, 359, -935, 203, -214, -2401, - -607, -2843, 818, -579, -2066, 388, -514, -912, - 787, 564, 149, -103, -757, 389, 173, -303, - 154, 814, 1631, -393, -2264, 1664, -802, 904, - 541, 784, 1063, 1152, -2510, 297, 84, -154, - 160, -497, -78, 1503, -598, -543, 86, 1683, - -330, 46, -24, -892, 747, -3336, -393, -2268, - 107, 710, 1682, -277, -278, -276, 1253, 327, - -986, 802, 191, -732, 286, -761, 1008, 461, - 1615, -1041, 2127, 2456, 3927, -160, 187, 31, - -101, 3258, 202, -75, 330, 375, -301, -275, - -782, 949, 12, -621, -617, 572, 1007, 414, - -91, -428, -392, -985, -692, -3422, 199, 845, - 91, 418, 290, -983, 721, -1265, 208, 1200, - 91, -758, -2649, -451, -814, -623, -458, 272, - 2777, 809, 1282, 763, 1122, 21, 520, 50, - -1018, 428, 385, 6149, -255, 8, -12, 21, - 20, 293, -315, -446, -423, 549, 428, -56, - -497, 101, 653, -177, -3975, 56, -127, 3214, - 291, -384, -721, 478, -314, -231, -469, -362, - -682, 765, -308, 420, 456, 322, -54, -2, - 10, -239, 6916, -461, -482, -211, -286, -110, - -877, -711, -470, 159, 260, 59, 252, -97, - -2978, -646, -35, 156, -123, 360, 556, -3254, - -475, -313, -268, -1771, -538, 203, 967, 283, - -653, -565, 387, -3097, -255, 25, 295, 264, - -3716, 505, 1024, -315, -215, -222, -780, 660, - 431, -341, -521, 46, 127, -244, -772, -3741, - 190, -335, -17, 2135, 744, -35, 627, -1115, - 681, -343, 123, -1534, -86, -542, -297, -82, - -2772, 3914, -75, 526, 124, -523, -112, 500, - 863, 371, 190, 1036, 141, -1011, 373, 796, - 421, -682, 403, 2924, 3730, 6, 211, -691, - -167, -391, -655, 162, 348, 216, -227, -535, - -147, 367, -189, 331, -191, 159, 49, -4905, - -252, -290, 609, -452, 1042, 1027, -645, -159, - -633, -542, -925, -262, -91, 192, 1266, -2, - -164, 587, 188, 3434, -1014, 2, 1373, 1832, - -1224, -965, 831, -987, 1180, 1389, -925, 48, - -3239, 263, -329, -660, -733, 262, -988, 598, - -2421, 630, 720, -925, -455, 208, 1092, -294, -}; - -static const int16_t cb1616l0[] = { - -15, -7707, 115, 30, -36, -27, -22, -43, - 2, 5, 31, -1, 87, 2, 41, 21, - 270, 16, 3747, -773, 3027, 224, 92, -168, - -7, -62, -79, -44, -9, -4, -58, -78, - 1063, 203, -2, 76, 289, -36, 92, -29, - -78, -148, -5176, 137, 219, 299, 89, -233, - 62, -129, 33, 123, -30, 197, 4018, -37, - -38, 139, 41, 153, 71, -26, 27, 53, - 72, 3358, -68, -122, 293, -19, -355, 104, - 34, 3121, 16, 29, -344, 37, 174, -28, - -43, -102, -59, -1661, 14, 5, -62, -1, - 14, 15, -42, 4, -31, -2, 13, 23, - 957, -419, 20, 31, -14, 51, 24, -46, - 8, -16, 27, -75, -27, -33, -28, 18, - -67, -152, -48, 47, 90, 48, -74, -103, - -18, 4863, 3, 132, 414, -86, -60, 285, - 16, 32, -44, 0, 22, -163, 23, -3, - 23, -61, 13224, 52, -139, -13, 171, 215, - -51, -21, -48, 33, -10, -17, -21, -7662, - -57, -44, -51, 35, 35, 34, 105, 178, - -77, 77, 147, 67, -816, 2913, -3087, 516, - -112, -296, 21, 133, 211, 162, 87, -25, - -535, -830, -12, 46, -59, -10, -4, 42, - 0, -91, -9, 47, -90, -29, 74, 322, - -106, 83, 44, 4693, -788, -73, -85, -105, - -76, -1031, 34, 6, 78, -34, 160, -48, - -707, -12, -9, 39, 14, 23, 88, -2286, - 21, -25, 42, 130, 39, 251, 16, -50, - 397, -226, -2570, 88, -129, -347, 159, 92, - 0, -44, -49, 235, -196, -24, -36, 113, - 13387, 45, 22, 54, -20, 29, 27, -27, - 54, 38, -63, -12, -74, 45, -8, -115, - 591, 46, 5, -234, 57, 124, 86, -3794, - -51, 292, -160, -152, 96, -334, 348, 96, - -186, -3870, -3715, 54, 0, -29, -65, -68, - 6, 132, 47, -155, 62, 26, 66, -10, - -46, -3093, 66, 3633, 183, -171, -132, -24, - 154, 157, 129, -185, 12, -26, 96, -12, - 88, -34, 42, -15, 37, -6625, -27, 13, - 41, -30, 62, 142, -93, -168, 84, -22, - 139, -19, 18, 10590, -111, 36, 13, -44, - 4, -45, -3, -3, 28, -25, -4, 115, - 119, -49, 41, 33, 87, -85, 12444, 73, - 71, -111, 61, -15, 117, 23, -24, -5, - 131, -31, -1, -22, -57, -12, 50, 35, - -1555, -20, 38, 82, -52, 27, -128, -14106, - 808, 190, 89, 595, 63, -291, 282, -48, - 32, -706, -433, -673, 3285, 1311, 830, 3745, - -204, -1185, -584, -51, 952, 1005, -566, 1764, - 186, 1211, -495, -112, 1213, 192, 2320, -43, - -30, 24, -1152, 2, 2, 32, -55, -25, - -2, -17, -14, -6, 22, -54, 32, 45, - 10, -85, -26, -16, -66, -60, -210, -104, - 208, -248, 62, -28, -14552, -11, -44, 1601, - 47, -138, 46, -35, 2647, -81, -3, -38, - -66, -59, -33, -19, 43, -17, -79, 53, - 1821, -1572, 2582, 85, 48, -140, 78, -155, - -173, 96, -32, 121, -58, 201, -174, -54, - 74, -2442, -282, -771, 37, -2930, 15, 1762, - 154, 263, -15, -19, 139, 246, -243, -31, - 84, 145, 8, 152, 43, 128, 679, 1828, - 3476, 17, 92, 102, 258, -29, -275, -39, - -187, 88, 70, 28, 2, 2143, 274, 202, - -67, -13, -22, 68, -35, 135, 114, 108, - 27, 1, -11248, -100, 14, 26, 59, 10, - -24, 30, 1, -38, -9, 21, 18, -1, - 2029, -83, -342, 3443, -25, 7, 0, 54, - 78, 198, 45, 233, -6, 0, -109, -172, - -2250, 41, -79, 2820, 44, 216, 39, 59, - -41, 52, 79, -52, 12, 23, -72, -125, - 83, 17, -28, -32, 13, 2, 28, 0, - -26, 75, -81, 66, 25, -81, 6516, 9, - -93, 49, -4036, -2484, -42, -71, 178, 99, - -133, 79, -41, -112, 57, 66, -28, 13, - 39, 64, -123, 3174, 3061, 259, 55, 123, - -123, 246, -138, 139, 75, 31, -215, -154, - -218, 26, 16, 21, 126, 26, -33, -10, - -15, 16, -20, -53, 21, 15526, -35, -59, - -50, -11, -58, 67, -11, 107, -24, -37, - 8155, 31, -111, -62, 138, -60, -10, 84, - -128, 37, 24, -45, -10, 129, -68, -37, - 42, -80, -205, -79, 5994, -93, -270, -400, - 20, -89, -39, -200, 230, 197, 325, -305, - -294, 94, 3207, 128, 3119, 226, 28, -49, - 264, 186, 8, -29, -13, 27, 22, -63, - 43, 84, -19, 57, -2605, 316, 259, -43, - 50, -2241, 105, -12, -23, -36, 89, 41, - -15, 145, 10, -81, 7, -50, 70, 60, - -23, 55, -62, 0, 52, -77, 180, 74, - 79, -14297, 6, 24, 299, -107, 4, -29, - -3252, -51, 40, -143, 3550, -28, 102, 24, - 215, 147, -169, -60, -43, -486, 5, -1, - 62, -116, -2917, 430, 50, 2927, 139, 127, - 63, -53, 141, -255, -85, 95, -101, -176, - 195, 104, -3066, -56, 3239, -161, -214, 57, - 24, -375, -181, 0, -259, 130, -120, -2, - -6, 175, -147, -185, 68, 219, 425, 2685, - -3120, 266, 246, -270, -70, 273, 168, 121, - -143, 2641, -553, -547, 638, 113, 2965, -161, - 29, -374, 105, -869, 108, 70, 15, 230, - -54, -106, -21, -4, 86, 85, 155, -120, - -17, -21, -2534, 57, 149, -129, 21, -169, - -2289, -127, -19, -26, 3, 60, 35, 1, - -28, -7, 36, -180, -13, 87, -68, 56, - 80, 64, -8, -73, 6691, -32, 47, 48, - -6, 61, 36, -8, -41, -1, 13, 68, - 140, -51, 25, 12, 3, 57, -54, -33, - -19, 12, 28, -60, -56, -2399, -14, 127, - 1935, 84, 127, -193, -3, 3307, -56, 15, - 31, -116, -187, 236, -289, 261, 69, 144, - 1723, 79, -68, 102, 727, 69, 654, -60, - 21, 124, 3497, 248, -684, 1469, 368, -254, - -211, -2600, 771, -138, 368, 3089, 52, -206, - 147, 200, -15, -136, 194, -164, -352, -152, - -4870, 5, 191, -3, -97, 28, -41, 107, - 2, 11, 60, -76, -35, -42, 129, -77, - -2610, -295, -218, -369, 10, 253, 15, -125, - 74, -87, -70, 3366, 115, 240, -106, -93, - 121, 10, 36, 9, -18, -66, -77, 7, - 37, -76, -22, 2913, 242, 22, 172, 102, - 186, -231, 90, -11, -57, 45, -10, -44, - -84, 44, -117, -43, 49, 5585, 18, -166, - -43, 64, 28, -9, 26, -160, 31, -28, - 29, 56, 29, -57, 109, -25, 3140, -131, - 57, -20, 27, -27, -5, -42, -52, 18, - 23, -56, -38, -14, 213, -33, -86, -4741, - -151, -46, 1, -17, 46, 7, -13, 0, - 50, 28, -57, -7291, -20, 12, 66, 214, -}; - -static const int16_t cb1616l1[] = { - -81, 5, -16, 34, 19, 10938, 141, -21, - 27, -105, -110, 32, -67, -75, 19, -138, - 3, -14, -408, -302, 36, -4612, 23, -579, - -35, 19, -312, 35, 120, 97, 82, -109, - 41, -1745, -158, 299, -3069, 84, 18, -447, - -33, 65, -32, 45, -7, 144, 86, 100, - -1738, 250, -226, -137, 159, -45, 134, 438, - 102, 37, -15, -161, -23, 4221, 174, 47, - -264, -182, -182, 686, -248, 89, -41, 80, - -2687, -194, 2552, 407, -1106, -970, -181, -228, - 4395, 118, 1027, -255, 136, 100, -43, 246, - 80, 15, 34, 82, -54, -367, 698, 232, - -177, 45, -67, 49, 138, -158, 168, 202, - 43, -70, -101, 20, -97, -3465, -342, -255, - 127, 25, -52, -5, 7, 76, -3, 19, - -19, 42, 10, -63, 16, 121, 732, -3127, - -43, 116, 36, -2519, 23, 18, 181, 41, - -32, -11, 22, 51, 35, 16, -34, -62, - 1744, 94, 173, -1243, -262, 11, 3218, 239, - 149, -219, 29, 118, -382, -289, -42, 161, - 17, -1, 2551, -83, 90, -128, 138, 3238, - 43, -29, -112, 110, -268, 293, 23, -117, - -64, -137, 79, -70, -10747, -66, 73, 90, - 35, 90, -29, -78, -111, 75, 48, 8, - -169, 2944, 16, 89, 186, -34, 82, 241, - -46, 257, -243, 93, 2966, 178, -256, -18, - -33, 103, -320, -271, 3088, 2893, -250, 102, - 696, 124, -211, 18, -143, 97, 216, -99, - 195, 40, -35, 144, 26, 135, -152, -215, - 120, 25, -254, -1875, 657, 197, -3527, -332, - 310, -11, 1958, 102, -12, -45, 2, -127, - 4, 1, -19, 47, -20, -52, 97, -30, - -7738, 51, 26, 5, -21, 18, 15, 15, - 66, 30, -8, -7, -31, -1, -33, 38, - 164, 90, 6798, -33, -90, -17, -5, 14, - -42, 21, -20, -41, 48, -6, -36, 6, - -207, -4363, 5075, 31, 6, 100, 65, 86, - 19, -158, 28, -134, -91, -68, 9, -26, - -37, 2588, 307, 3467, -451, 101, -441, 323, - 62, 188, -132, -294, 98, -22, 152, -46, - 65, -39, -37, -82, -9, 18, 43, 17, - 8, 56, 97, -11564, 21, 15, 75, 85, - 155, 15, 32, 0, 20, -45, 7412, 48, - 3, 38, 72, 30, 23, 42, -20, -110, - -454, -233, 653, -325, -276, 504, -481, 583, - 270, -649, 481, -3166, 1619, 164, -90, 150, - 32, -96, -47, 49, -13, 115, -183, 75, - 62, -9026, 12, -93, -715, 6, 137, -338, - 810, -39, -277, -108, -20, 315, 572, -3, - -4570, 1053, -132, 13, 388, -223, -355, 31, - -47, 61, -113, 5, -38, 43, -47, -80, - 2550, 27, 247, 277, -86, 336, 139, 146, - -111, -73, 187, -312, 68, -276, 72, 638, - 73, 792, -170, 1383, 421, -703, -3813, 112, - 391, -195, -162, -28, -25, 317, 228, -83, - 4611, 654, 353, -380, -283, -627, -301, 161, - -156, -81, 5, -15, -13, -17, 53, -50, - 36, -66, -7921, -2, -54, -41, -26, 47, - -3, 22, -6, 11, 63, 2, 42, 71, - -50, -87, -39, 2, -56, -2, 11165, 44, - -119, -74, 131, 134, 5, 115, -39, 144, - -23, 0, 186, 4648, 351, 36, -70, -71, - 1706, 2131, -228, 42, 6, 8, 4, -43, - -12, -40, -44, -7, -14, 11, 83, -93, - -144, 186, -46, -9, 13, -87, -120, 70, - -209, 115, -3513, 139, -46, 133, 96, 25, - 215, -35, -437, 126, 403, -115, 145, 203, - -69, -334, 37, 934, -481, 3163, -2528, -49, - 57, 100, 76, 82, 251, 288, -114, 46, - -201, -161, -161, -716, -4080, 378, -830, -254, - 12, -2110, -300, 78, 288, 48, -90, -99, - -31, -110, 201, 66, 327, 119, -180, 148, - 633, 71, -4100, 33, 57, -9, -48, 151, - -20, 72, 71, -11, 39, -67, 176, 27, - 143, 198, 383, 155, 3182, -128, -152, -3209, - -172, -262, -13, 129, -167, -128, 55, 46, - -37, 70, 107, 7, -23, -2082, 241, 236, - -47, -85, 105, -47, -202, 208, 201, 30, - -106, -14, -38, 14, -45, 24, -24, 12083, - 22, 151, -58, -9, 59, 170, 113, -82, - 369, -155, 53, 97, -185, -57, 203, 311, - 236, 4789, -24, -591, -1463, 118, 94, -274, - 3188, -145, -406, 183, 0, -54, 17, -22, - 37, -55, -34, 63, -340, 175, -300, 106, - -190, -38, 67, -2, 19, -46, -42, 11, - -33, -33, -28, -10, -27, -9235, 29, 62, - -927, 1285, 49, 72, 65, 89, 57, -44, - -9, -15, 85, -1, 74, 81, -123, 160, - 69, -2803, -22, 47, -467, -74, 748, 168, - -9, 235, -3155, -154, 48, 483, -341, 74, - 2403, 97, 93, -106, 219, 136, -191, -50, - 7, 71, -103, 261, 3283, -124, -624, -2570, - 73, -31, 10, -73, 30, -15, -2256, -2, - -73, 55, 73, 14, -74, -81, 38, 352, - 108, -18, 25, 61, 54, 1, -5, 109, - 25, -2676, -25, -52, -316, 2, 36, -36, - -355, 40, -19, 120, 27, -4, -51, -8, - 42, -10, -28, -90, -143, 29, -10, -8442, - -22, -566, 59, -39, -1, 27, 29, -20, - 6, 19, 0, -36, 38, 68, -43, 35, - 22, -47, -146, 3567, 13, 12, 3230, -18, - -32, 75, -112, -8, -157, -23, 101, 165, - 198, 93, 383, 1236, 1077, -3592, -1401, 1135, - 844, -266, -74, -70, -280, -98, 67, -109, - 38, -5109, -66, -57, 89, -21, 6, 19, - -21, 70, 60, 76, 35, 18, 44, 51, - 45, 40, 54, -6685, -67, 9, 113, -29, - -10, -96, 80, 98, 103, -40, -8, -20, - -131, 15, 262, 47, -253, -116, -12, -4807, - 2, -81, 76, -46, 37, 353, -130, -191, - -127, -10, -35, 91, -122, 173, -165, -8, - -15179, 86, -186, 123, -295, -25, 21, 63, - -93, 730, 20, -120, -4624, 340, -253, -473, - 44, -18, -99, -37, -54, -317, 65, -52, - 2167, 68, -245, 224, 117, -180, -4695, -276, - 118, 142, -101, 202, -301, -33, -129, -303, - -90, -75, 50, 98, -56, -68, -153, -38, - 168, -278, -22, -64, 9757, -91, -23, 1284, - 53, 56, -11, -46, -1645, 11, 15, 12, - 8, -40, -2, 84, -56, 17, -7, -30, - -4010, -3557, -252, 56, -79, -87, -7, 8, - 79, 16, 21, 51, -63, -22, 118, 228, - -1525, -78, -22, -2, 16, -49, 17, -37, - -3, -14, 10, 31, 17, -111, 32, -144, - -3612, 3473, 79, 23, -89, 74, 33, -29, - 11, -42, -42, -129, -41, 155, 52, 31, - -162, 12609, 147, 17, 68, 2, 15, -12, - -39, 50, -108, -66, 121, 69, -27, 94, -}; - -static const int16_t cb1616s0[] = { - 1213, -1302, -1130, 90, -69, 22, -360, 360, - -55, 453, -705, 4416, 227, 173, -8, 149, - 210, -118, 51, -3759, 949, 2418, -238, 201, - -597, 94, -253, 24, 225, -497, -59, 273, - 576, 651, 608, -483, 335, -125, 256, -2873, - 318, -146, -650, -306, -2021, 1044, 41, -455, - -1120, 832, 978, 212, -463, -209, 12, -275, - -20, 118, 31, 639, 5933, -180, -121, -285, - 65, 212, 439, -135, 538, 116, -302, -245, - 2534, -623, 1549, -34, 727, -1750, 1477, 79, - 1669, -828, 618, -856, 773, -286, 343, -94, - 107, -320, -3144, -380, 694, -80, 843, 103, - -700, -269, 452, -6847, -12, -527, 97, -21, - -76, -246, 2, -104, -68, 98, 312, 117, - -342, 1025, 207, 838, -71, 2463, 60, -1294, - 1549, -1310, -202, -1585, 682, 327, 608, 649, - 664, -801, 588, 137, -468, 286, 234, -6726, - -107, 177, -147, 278, 118, -81, -242, 97, - -235, 1599, -877, 1985, 448, -319, -745, -504, - -433, -1859, -35, 286, -665, -1449, -124, -97, - 930, 2622, 682, 698, 1898, 1120, -323, -142, - -679, 294, -162, -539, -1649, 152, 23, -414, - 1493, 602, 913, 1428, -3212, -103, -330, 557, - 463, 92, 251, 339, 16, 936, -116, 229, - -827, -504, 2015, 1553, -503, -350, 214, 386, - 295, 2697, 429, 72, -705, -120, 427, -139, - -334, -318, -6613, -468, 10, -122, 59, -322, - -165, -144, 45, -427, -12, -79, -202, -266, - 981, -273, 240, -454, -30, -119, 340, 92, - -251, 247, 189, 71, 243, -5648, -601, -434, - -674, 867, -713, -428, -101, -231, 1144, -89, - -10, 57, 302, 154, 362, -425, 2014, 2577, - -8659, 389, -90, 76, 15, 147, 30, -202, - -99, -255, -242, -165, 257, 97, 41, -72, - 263, 613, 272, 400, 5020, -199, -196, -177, - -276, -25, 28, 97, -155, 119, 763, 33, - -3540, -1447, 16, -169, 148, -143, 707, -2483, - 178, 83, -83, 154, -75, -15, 153, 283, - -323, -139, -1390, 69, 725, -1744, 331, -3665, - 415, -514, -366, 124, 660, -295, 180, 77, - -228, 192, 684, -193, 4, 4409, 298, 427, - 591, 290, -159, -166, -372, -514, -1840, -562, - 795, -1765, -349, 1178, -1619, -391, 615, -784, - 1353, 746, -871, -994, 182, -464, -498, -96, - -306, -729, 743, 270, 223, -731, 73, 2692, - 1110, -2354, -328, -21, -172, -339, -528, 93, - -338, 548, 1498, 309, -134, 160, -247, -619, - 1127, 783, -1557, 400, 1035, -445, -155, -2443, - 590, -790, 137, 388, 1188, 844, -395, 1005, - 55, 1141, -122, -3174, 138, 155, -506, 306, - -3255, 2432, -116, -1289, -744, -350, 3, 192, - -156, 95, -552, -57, 329, -405, 737, 138, - -835, 4096, -1037, 797, -417, -418, -507, -694, - -256, 78, -94, -63, -93, 754, -555, -90, - -1518, -878, 167, -392, -100, -78, -80, -45, - 4774, 114, -284, -560, -21, 275, 15, -195, - -1692, -711, -1057, 167, -1555, -690, -263, -267, - 310, -229, -14, -880, 426, -2826, 320, -49, - -1223, -725, 3538, -270, -606, -1812, 481, -703, - 176, -284, -173, 271, 847, 711, 239, 314, - 1233, -61, 477, 429, -691, -156, 6712, 850, - 365, 229, -197, -355, 298, 250, 207, -437, - -1647, -261, 165, 114, 165, 1165, -58, -597, - -3290, -517, -478, -842, -187, -448, -302, -204, - 410, 544, 669, -2012, 476, 434, 214, 698, - 302, 100, 61, 63, -386, 918, 4434, -230, - 157, -1019, -1487, 2239, -774, -234, -378, 772, - -190, 270, -61, -19, 322, 488, 937, -3582, - -415, 2091, 1862, 81, -134, 1285, -2732, 221, - -235, 388, -216, -63, 664, -105, -37, 165, - 899, -373, 284, -375, 286, -263, -295, 276, - -246, 188, 5285, -303, 290, -60, -1, 95, - -703, -288, 74, -717, -127, -53, -422, -452, - 166, -54, -15, 268, 238, -31, -279, -5872, - 863, -907, -101, 885, 552, 442, -2336, -2142, - -804, -147, -791, 1000, 96, 250, -306, 134, - 743, -1648, -867, 673, 1594, 3725, 527, -676, - -661, 238, 262, 560, 277, -58, 444, 166, - -1039, -702, 558, -970, -1763, -1198, 580, 378, - -421, -972, 630, -279, -2456, -1222, -232, -749, - -3325, 174, 789, 729, -487, 583, -157, 1503, - -801, -38, -11, 556, 81, 1508, -140, 74, - 1373, 912, 1471, 4, -1080, -105, -58, -104, - -54, -544, -2392, 1550, 318, -506, -11, -180, - -1891, -230, -259, -1182, -154, 524, -568, 1972, - 546, 469, -720, 1089, -1530, -680, 1349, 429, - 82, -1524, 1894, -90, 188, -145, 15, -1113, - 15, 53, 282, 2212, -736, -941, -1148, -344, - 1473, 344, 392, -333, -556, -480, -3833, 35, - -160, -525, 151, -534, -782, 38, 520, -416, - -384, 7582, -158, -29, 74, -57, -23, 73, - -393, -245, -12, -260, -154, -319, 357, 247, - -306, 351, 273, 755, 227, 89, 283, -152, - 17, 5129, 191, -213, -531, 255, -468, -209, - 1128, 72, -807, 225, -319, 1638, 42, 20, - 935, -52, -326, 541, -1174, 130, 284, -112, - 444, 3959, 262, -631, -262, 275, 1025, 190, - 1125, -265, -95, 265, 35, 270, -92, -30, - -141, 325, -435, 45, -659, 149, 3648, 339, - -1701, -1338, -144, -989, -604, 84, -394, 168, - -302, -1294, -433, -921, 1271, 77, 374, -604, - -230, 97, 206, -138, 2909, 478, 707, 0, - 1242, -340, -1659, 349, 2751, -1175, -146, 1038, - 65, -775, -423, 14, 22, 41, -905, 287, - 280, -933, 195, -1817, 540, -2374, -661, -1102, - 879, 1232, 29, -1683, 286, -136, 658, -395, - -1782, -2823, -624, -223, -299, 2859, -103, -45, - 544, 82, -21, -263, -666, -362, -732, 249, - 1087, -242, 30, 663, -386, -350, 1240, -492, - -868, 69, -41, 35, 30, -1791, 3870, -455, - 1355, 1098, 2933, 347, 361, 79, 2855, -26, - -66, -598, -43, 21, -386, -802, -81, -436, - 846, -673, 377, -326, -1217, 1465, -480, -205, - -2168, -1689, 690, 355, 1192, 734, -113, 39, - -486, -644, 438, 1096, -723, -524, -1634, -621, - -394, 226, 167, -625, -709, 854, 3005, -910, - 13, -793, -1517, -1254, 18, -440, -836, 651, - -31, 229, -1081, -126, -191, -3612, 487, 451, - -292, 943, -2018, -618, -259, -649, -723, -447, - -238, 1096, -2228, 675, 563, -316, -1248, 32, - -28, 293, -1817, 226, 267, 1291, 624, -2279, - 143, 650, 5, -563, -504, -2124, -94, -1613, - -3050, 708, -3458, 442, 30, 65, -80, 89, - 204, -245, 94, 28, -2, -231, 623, -189, - -405, -2147, 1147, 3124, 806, 1048, 1145, 653, - 47, 86, -4, 46, 437, 229, -190, 310, - 1995, -48, -1015, -1806, -266, -941, 361, 179, - 172, 397, 182, 323, -516, 3435, 7, -5, -}; - -static const int16_t cb1616s1[] = { - -2521, -518, 1830, 985, -500, 109, -807, -197, - 543, -1036, 104, 1989, 428, 740, 1110, -366, - 1482, 899, -1828, 159, -3015, -311, -792, -42, - 3, -412, -157, -13, 863, -248, 261, -187, - -409, 156, 772, 271, 318, -262, 78, -571, - 28, 370, 119, 302, -4794, 106, -123, -153, - 1857, -702, 1090, -319, 415, -327, 2124, -170, - -411, 174, 62, -7, 921, -128, 735, -127, - 972, 1678, 166, -1471, -208, -224, 871, -900, - -223, -817, 288, -472, 10, 31, -401, -3201, - -1290, -3, -301, 183, 730, 473, 438, -81, - 882, -64, 2898, -242, 408, -211, -333, -254, - -820, 612, -1128, -60, -73, -2516, 45, 637, - -130, 459, -312, -223, -629, 1490, 1792, -199, - -21, -545, 1772, -1084, -173, 381, 380, 1289, - -117, 483, 138, -1200, -519, 598, -3453, 349, - -3102, 1260, -170, 238, -684, 48, -483, -883, - -879, 139, 298, -110, -203, -955, 195, 57, - -550, 1945, -711, -688, -1470, 1527, 58, 317, - 656, 310, 57, 162, 2006, 1387, 845, -127, - -398, 318, 2520, 2002, -906, -323, -194, 907, - 588, -228, -357, -316, 557, -596, -1559, -3, - 1614, 1317, -1701, 936, -89, -2270, 1327, 1046, - 400, -233, 18, -730, -23, -181, -593, 74, - -570, -969, 432, -261, -833, -90, -4675, 786, - -566, -183, -859, -554, 346, -493, -201, -220, - 241, -919, -1896, 265, -802, 1380, -718, -1103, - -574, 307, 138, -1260, 175, 2540, -82, 58, - 1046, -1381, 2486, 582, 455, 485, -824, -150, - 57, -45, -155, -490, -1108, -2191, 833, 423, - -2011, 267, 779, 140, -28, 57, 94, 6, - -301, 5, -833, -1226, -193, 1110, -63, 79, - -492, -1465, -2733, 444, 56, -1116, -601, 20, - -618, -1315, -695, 1146, -66, 336, -166, 158, - 530, -53, -371, -594, -685, 114, -146, 373, - 174, -1, 47, 119, -124, -121, -6697, -94, - -3544, 1506, 1221, -101, 2160, 558, -254, -728, - 511, 378, -383, 12, 626, 172, 183, 354, - 49, 1669, 1188, 3810, 409, 152, 694, -2520, - 342, 61, -85, -38, -170, 5, 305, 154, - -348, 699, 332, 2542, 673, -1130, -2601, 554, - 1483, 466, 271, 490, -644, 822, -96, 477, - 131, -2051, -111, 43, -31, -62, -767, -3257, - 663, 488, 1823, 522, -525, -249, 481, -7, - -1298, -941, -335, -566, 305, 534, -735, 207, - 709, -3170, 19, -20, -1888, 271, -1697, 117, - 1837, 2690, 305, -483, -463, 407, -706, 467, - 518, 1806, 244, -80, -453, -505, 882, 843, - 1328, -280, 175, 319, -842, 192, -680, -469, - 5440, -205, -187, 53, 332, 204, -184, 96, - 1026, -525, 20, 975, 125, -1562, -1873, -757, - -137, 133, -10, -340, -783, -1484, -2206, 1238, - -5212, -466, 129, -224, 17, 497, -41, 846, - 88, -41, 285, 284, -155, 21, -225, 150, - 223, -807, -444, -1141, -908, 292, -326, 559, - -446, -283, -41, -277, -3479, -667, 532, 83, - 257, 383, -2986, 1685, 697, 777, 1551, -142, - 1786, 579, -531, 787, 712, -984, 603, -174, - -459, 1303, -943, 741, 1103, -73, 600, -403, - -42, -169, -90, 220, 208, 105, -4083, -1069, - 981, -926, 124, 273, -145, -133, 307, 4720, - 209, 324, -79, 12, -41, -220, 211, -184, - 435, 307, -1544, 83, 1565, -445, -217, -648, - -379, -1270, -1590, -2337, -860, 348, 648, -157, - -785, 3318, -123, -138, -412, -876, 358, -173, - -280, -81, -149, -167, -160, -2113, 20, -40, - 1022, 432, -721, 55, -651, 17, -1135, -380, - -542, -1128, 2919, -475, -143, -53, 176, -152, - 7, -29, -172, 174, 195, -8005, 277, 105, - 35, 115, -314, 137, -253, 75, -278, 90, - -1508, 79, -153, -560, 1027, -349, -292, -466, - -1101, -324, -84, 4251, 822, -420, 55, 43, - 1886, 281, 964, 2408, 425, 1187, -27, -84, - -1277, 63, -978, -143, 506, 727, -155, -384, - 3434, 592, -262, -438, -30, 2849, -69, -58, - -181, -87, 20, 299, 412, -263, 702, 131, - -271, -10, 736, 121, -6299, -132, -116, 26, - -253, -586, 32, -145, -251, -12, 471, 135, - 585, 604, 29, 873, 363, -2, -1595, 41, - -1147, -142, 665, -2752, 1302, -358, -134, 29, - -691, -12, -702, -459, 100, 278, 9, 54, - 66, -458, 53, 213, 193, 14, -400, 4870, - -950, -209, 50, 470, 449, 3, -118, 2287, - -469, -58, 126, 1011, -826, 386, -1019, -2390, - -586, -1401, 137, 760, 141, -89, 117, -252, - 3106, -936, -198, 390, 463, -245, -509, -123, - 3057, 1200, 3451, 282, -332, -585, -662, -955, - 165, -276, 73, 373, 202, 506, 356, 125, - 141, -613, -670, 446, 2031, 1521, -446, 1339, - 198, -112, 214, 70, 265, -1310, 2492, -133, - -1880, -347, -961, 312, -3714, -475, 102, 391, - 64, 1091, -686, -101, 144, 447, 173, 66, - -374, 342, 69, -3379, -1331, 1160, -889, -858, - 982, -1613, -223, 57, 186, 428, 226, -477, - 449, -1052, -661, -382, 459, 277, -277, -250, - 12, 4077, -260, -161, -163, 38, 159, 243, - 131, 457, -2253, -301, -1626, 37, 806, 104, - 191, 1899, 346, 398, -1108, -623, -391, 1092, - 1252, 1126, 81, -116, 1192, 674, -1321, -32, - 1739, -708, -230, -844, -507, 415, 261, 211, - -619, -191, 5460, 8, 139, 197, 392, -556, - -215, 66, 64, -808, 0, -136, 151, 156, - 260, 94, 418, -1446, 1815, -540, -793, 451, - -477, 1788, -124, 330, 1638, 342, -503, -384, - -1201, -762, 929, -2886, 888, -63, 318, 598, - 42, -1226, -400, -462, -136, 321, 1872, 376, - 1260, 142, -79, 4377, 9, 294, -71, -190, - -21, -2612, -240, 26, -18, -227, 864, 79, - 2588, -882, 87, -2976, 9, 480, -1573, -170, - -429, 201, -124, 171, 632, -60, -447, 64, - -37, -1182, -86, -105, 2901, -3557, -134, 486, - 141, -259, 239, 465, 467, 1009, -409, 34, - 254, 2469, 1002, 834, 557, -845, 149, -747, - -504, 494, 1382, 1067, 353, 191, -1105, 1705, - -586, 1472, -444, -1303, 198, 602, 471, 468, - 4855, 127, -141, 487, -454, -138, -392, -118, - -491, -948, 58, -290, -7, -662, 229, -268, - -2, -537, -620, -4770, 1152, -173, 166, -69, - 32, -2555, 433, -583, -2219, 1107, 1082, -942, - -173, 399, -601, 250, 423, 125, -448, 352, - -571, -406, 0, 4735, -264, -174, -1020, 1105, - -1149, -171, -252, -130, -202, -74, 601, 601, - 570, -2742, -1403, 3129, -349, 194, 309, 130, - 261, 93, 154, -117, -418, -657, 270, -160, - 1660, -818, 613, -1458, -653, -3763, -232, 90, - -265, -99, -28, -13, -281, -553, 11, -142, - -1764, -4548, 936, -21, -683, -88, -806, -187, - 28, 78, -70, -99, -2, -493, -16, 48, -}; - -static const int16_t cb1616m0[] = { - -3821, -3397, 203, -25, -22, 68, 189, -13, - -286, 94, 18, 288, 29, -5, 3, -414, - 1483, -172, -1275, -180, -3792, 360, 145, -143, - 444, -139, -198, 70, -17, -353, -121, -6, - 76, -50, 2987, 173, -3070, -229, -16, 192, - 134, -55, -86, -200, 128, -2052, -59, -11, - -4, 309, 179, 494, -138, -363, -336, 119, - -127, 2497, -169, -316, -87, -538, 42, -534, - 315, 2364, 61, 269, -87, -94, 82, -2069, - 18, 1238, -7, 79, -9, 41, 70, 50, - 209, -158, -136, 28, -275, 62, 296, 77, - 6269, -184, 73, -19, -25, -57, 134, -52, - 8569, -176, -8, 17, 15, 79, 36, -137, - 12, 44, -270, 2335, 111, 517, -83, 207, - -276, 2577, -198, 83, 376, -75, -273, 62, - 109, 4, -48, 122, -41, 99, -87, 14, - -7696, -118, -66, 171, 96, -31, 123, -217, - -676, -439, 407, 97, -281, 1873, 626, -148, - -548, 1634, 704, 97, -2076, -336, 632, -371, - 113, 544, -88, 184, -2200, -420, -592, -168, - 759, 291, 2215, 704, -140, -145, -4088, 295, - 186, -270, 283, 294, -42, 76, 69, 41, - -140, 1635, -200, -682, 302, -192, 902, -540, - -843, -494, -529, 102, -759, -165, 3160, -180, - -1450, -424, -16, 6, -548, 296, -3056, 219, - -1883, -109, -566, -431, 95, -422, -532, -26, - 120, -46, 23, 174, 175, -369, 110, -2, - 25, 132, -1, -3338, -67, 2140, -25, 566, - -129, 35, 1187, 337, 1999, 2712, -71, 45, - -177, 94, -321, -197, -573, 98, 225, 46, - 53, 78, -40, 82, 23, 2718, 2534, 89, - -65, 77, 206, 343, 527, 102, -191, 94, - 463, 111, -4529, 97, 876, -205, -944, 181, - -132, 467, 366, 85, -302, -100, -33, -76, - -3087, -2546, 215, 277, -52, 352, 137, -45, - 162, 590, 406, 382, 85, -2824, 141, 219, - -3790, 40, 126, 32, 30, 100, 121, -210, - 196, -268, 178, 102, 1229, -80, -750, -11, - -57, 84, 238, 3571, 274, -254, 55, -1616, - -176, -755, 46, -1306, -201, -228, 101, 197, - -93, -156, 319, 82, -385, -17, -4660, 180, - 1278, -113, -215, 103, 832, -233, 412, 249, - -900, -132, -3427, 52, 416, 267, 317, -384, - 130, 78, 91, -360, 75, 386, 2219, -360, - -2975, 17, 286, -294, -213, 231, 131, 821, - -358, 222, -230, -44, -93, -1151, 294, -316, - -8, 129, 231, -993, -58, 3319, 48, -2546, - -213, -14, 3208, 162, -240, -176, 307, -165, - -20, 348, -113, -78, -91, -8, -261, 8033, - -179, 64, -7, -113, -59, -32, -170, 52, - 55, -80, 140, 64, -39, 915, 28, 416, - 38, -2328, 206, 115, 366, -92, 652, 110, - -2838, -59, 613, 23, 109, -151, -198, 185, - 3033, -122, 2863, -273, 86, 41, 114, -99, - 315, 372, 14, 2191, -171, 531, -18, -34, - -352, 130, -360, 117, -2896, 2, -564, 51, - 223, 57, -257, 3161, 3130, -384, 126, -40, - -160, -232, -138, 81, -34, -96, 82, 9, - 62, -161, 344, 100, 790, -243, -344, -393, - -531, 401, 90, 171, 144, -329, 7, -4639, - -135, -6, 351, -21, -195, 224, -25, 6027, - 224, -14, 344, 170, -169, -97, 252, -488, - -379, -73, 629, -9, 266, 152, -64, 330, - -8, 2080, -91, -3315, 229, 25, 45, -528, - -123, 2951, 40, -85, -4, -2695, -38, -112, - 84, -30, 79, 762, 151, -4089, -95, -151, - 9, 138, -206, -3, -2114, 99, -100, 116, - -403, -56, -8, -36, 115, -18, -195, -38, - -240, 8, -32, 122, 125, -7406, 45, -210, - 111, -152, -152, -35, -72, 28, -154, 303, - -3147, 459, -2881, -14, -13, -56, -126, -69, - -213, -97, 202, -88, -277, -557, 451, -376, - -91, 319, 141, 2728, 23, 2506, -101, 632, - 62, -314, 159, 44, 1231, -65, -37, 192, - 3118, -186, -396, -108, 71, 2111, 586, 95, - 15, -28, 176, 20, -67, 3, -265, 101, - -182, -21, -455, -15, -6225, -45, -353, -384, - -22, 113, -40, -47, 57, -73, -503, 134, - 736, -70, -125, -5, -250, 62, 165, 182, - 185, -132, 426, -276, 100, -497, -23, 81, - -112, -3528, -1997, -234, -154, -91, -125, -26, - 179, -611, 655, 767, -1064, 130, -264, 107, - 2811, -1391, 298, -20, 37, -74, -12, -157, - -270, -106, 2559, -89, -3107, 55, 187, -265, - 195, 140, 1, -484, 713, 171, -1123, -226, - 3666, -367, -516, -249, 38, 195, 236, -378, - -383, -205, -72, -7, 15, -9329, -6, -26, - 56, 141, 48, 6, -141, -95, -69, -40, - -99, -80, 73, -253, 456, -174, 51, -250, - -48, -2115, -63, -2555, -25, -2058, -58, 66, - 176, 14, -10053, -23, -39, -37, -15, 38, - 82, 11, 97, 169, 5, -67, 57, 61, - -2248, 108, -19, 256, -169, -122, -336, -431, - -77, -250, -156, -745, 184, 684, 10559, -199, - -34, -37, 96, -82, -17, 60, 65, 21, - -67, -337, 62, 35, 74, -214, 38, 47, - -129, 6139, -139, -57, -154, 261, 7, -127, - 109, 40, 179, -99, 198, -51, 48, -36, - -2377, -194, -334, -2826, 103, -220, -57, 41, - 979, -895, 68, -217, -1712, -430, -98, 91, - -107, -1755, 2615, 84, -500, 231, 480, -31, - 146, -157, -120, 152, 2342, -36, -1969, 57, - -109, 476, -243, 261, -58, 1998, 4, 1388, - -98, 45, -140, 400, -76, -321, -22, -9, - 210, 517, 5, -4708, 66, -330, -405, -19, - 2158, -65, -2163, 244, -16, -192, 494, -381, - -194, 413, 89, 220, 455, -54, 4, 206, - 221, -4998, 63, -365, 354, 364, 677, 207, - -66, -27, -477, -182, 841, 85, -40, 166, - -185, 321, -293, -181, -429, -231, 1401, -122, - 938, 67, -185, 51, 3188, -802, 421, -3230, - 1432, -432, -658, -587, -843, 421, 177, 446, - 510, -140, -90, -127, -78, 2, 1089, -185, - 301, -393, 4100, -152, 265, 224, 25, 95, - 534, 280, -254, -45, -5, -207, 49, -126, - 8922, 43, 9, 21, 28, 21, -42, -84, - 38, 90, -2014, 61, -149, 188, -3350, -120, - -43, 10, 14, 155, -225, -351, -114, 28, - -23, -4400, 367, -51, 76, -89, -113, 122, - 2007, 25, -348, -227, -370, -61, 135, -79, -}; - -static const int16_t cb1616m1[] = { - -321, -7, -6725, -36, 77, -20, -101, -529, - -166, 97, -76, -232, -70, 16, 13, 93, - -50, 222, -258, -4424, -125, 125, 83, 313, - -246, -325, 108, -331, 484, -188, 192, -964, - 2603, -38, -2236, 58, 337, -254, -17, -90, - -88, 40, -141, -1293, -56, -811, 247, -78, - -34, 144, 112, 43, 142, -137, -147, 56, - -406, 12, 210, 132, 3707, 109, -896, -268, - -2295, -509, 32, -219, 113, -104, 141, 273, - 18, -358, 16, -3354, 3474, -167, 220, 10, - 104, -175, -8, -71, -77, -48, 277, 82, - 86, 35, -712, -32, 36, -65, 213, 121, - -76, -742, 291, -4587, -169, -122, -77, -285, - 54, -120, 89, 71, 12, -133, 54, -215, - -1906, -115, 3220, -194, -391, 87, 415, -212, - -210, -138, 182, 590, 713, 944, 320, 142, - -1970, 197, -79, -548, 458, 2836, 33, -62, - -183, -149, -640, 147, -427, -113, -178, -1631, - -108, 2666, -58, 2210, -251, 288, 16, 382, - 2123, 636, -4, 1118, 232, 335, -33, -114, - 24, -68, 1309, -38, 2080, 534, 288, -162, - -630, -360, -643, 10, 62, -2229, 263, 19, - 310, -44, 419, 2846, -2579, -159, -246, 685, - -67, 394, 314, -356, -158, 19, 90, 116, - -2261, 163, 664, 163, -191, -49, -18, -308, - -15, 2508, -370, 693, -62, 818, -307, -658, - 133, 1858, -4900, 53, -2485, -48, -9, 126, - 159, 6, -71, 291, 102, -367, -62, 27, - 88, -6, 204, -65, -725, 31, -159, -1, - -5, 45, -133, -146, 261, -4481, -19, 694, - -261, -478, -177, 88, 214, -836, -14, -762, - -111, 501, 0, 254, 1971, -1024, 2678, -141, - -6064, 76, 430, 160, -195, -582, 280, 580, - 183, -315, -13, 665, -53, 315, -199, 438, - 220, 3267, 194, 2, 2808, -88, 42, 150, - -179, 237, -155, 143, 46, 99, 27, 30, - -6137, -51, -89, 201, 145, -179, 13, -358, - 55, 71, -3, 28, -9, -16, 125, 160, - 159, -21, -5407, -485, -4, -88, -89, 44, - 3, 166, 22, -413, 993, 80, 485, -107, - 446, -943, 1025, 261, -3, 2991, 547, -268, - -109, 536, -10, 187, 17, 388, -120, -71, - -343, -416, 162, 69, -9, 46, -477, 83, - 6134, 146, -236, -125, -94, -55, -274, -231, - 1120, 171, -139, -2714, 80, -111, 20, 2475, - -135, -1710, 317, -762, 155, 1222, 68, 1192, - -15, 1825, -36, -45, -120, -484, -131, -162, - -128, 163, -407, 72, -222, -46, -222, -5319, - 278, -373, -436, 284, 138, -243, -104, 28, - -77, 3022, 93, -15, -581, -498, 292, -165, - -1740, 121, 195, -1368, -134, -68, -20, -75, - -10, 113, 128, -381, -507, -237, -709, 13, - -22, 155, -5065, -95, 246, -226, 193, 687, - 1839, 246, -232, -359, 475, 106, 297, 205, - -2702, -378, -219, -20, 140, -3198, 192, -3077, - -135, -38, -23, 213, -72, 255, -90, -130, - -150, 62, -484, -94, -2625, -89, 344, -129, - 2655, 369, -35, 17, -697, 251, -343, 68, - 53, 176, 3104, 237, -75, -3020, 178, 45, - -86, 45, -115, 183, 49, 26, 140, 77, - 40, -2315, 249, 1791, 48, -755, -12, 201, - -455, -250, -62, 1729, -113, -959, 238, -114, - 289, -135, -2208, 2748, 65, 306, -83, 3, - -513, -481, -49, -163, -568, -88, 668, -51, - -2586, 106, -22, 584, -453, -350, 333, -177, - -236, -657, 536, -349, 394, -56, 14, 133, - -55, -84, 210, -19, -8647, 154, 80, 27, - -7, -76, -117, 100, -201, 1, 296, -101, - -6, 5642, 137, -59, -93, 95, -110, -280, - -61, -300, 25, 887, 43, -30, 2493, 76, - -22, -343, 489, 266, 308, 163, 132, -349, - 2021, 18, 15536, 61, 11, -41, -42, 41, - -4, -183, -40, -24, 26, 241, -102, -115, - -164, 2044, -35, -217, -226, 734, -228, -2546, - 218, 0, 122, -150, -528, -188, -1273, 155, - 107, -33, -37, -293, 6, 112, -155, -228, - 192, -2378, 153, -1045, 213, 2975, 39, -159, - -10, -41, 34, -125, 4, -30, 3907, -41, - 848, -346, 191, -195, -292, -126, 3421, -24, - -244, 92, 693, 64, -193, 192, 121, -33, - -141, 523, -162, 2754, 71, 59, 40, -63, - -142, -100, -338, 379, -136, -64, -196, 11, - 3198, 162, 2097, -132, -2359, -193, -398, -318, - 842, -635, -168, 425, 2001, -136, 290, 206, - 562, -96, -8, -214, -45, -11, 4, 52, - 177, -148, 229, 33, -48, -46, 6538, -106, - -27, -22, 6527, 20, -405, 157, 87, 208, - -117, -4, 30, 87, 28, -356, -76, -108, - -33, -568, -270, 177, 49, -457, -3210, 119, - 103, 256, -180, 211, -1209, -369, -256, 37, - -47, 4976, 84, 207, 225, 224, -425, 396, - 921, 58, -150, 104, 1509, 15, -58, 1724, - 47, -24, 21, 376, 353, 482, -236, 634, - 306, 3179, 73, -33, -54, -169, -214, 146, - 4322, -216, -644, 305, 305, -453, 53, 143, - -9, -1472, -141, 1314, 57, 40, -55, -80, - 67, 9264, 57, 86, 22, -147, 1, -6, - 0, 39, 7, 114, -51, -137, 155, -15, - -122, 5, 137, 125, 213, -6, 7158, 36, - -52, -54, 149, 901, 859, 703, 366, 673, - -13, 1186, 588, -202, -451, 18, -585, -250, - -2632, -134, 61, -3038, 1022, 78, -672, -276, - 96, 838, 533, -254, -525, -106, -378, 1627, - 12, 31, 317, -118, 81, 313, -186, 197, - 452, -2971, 83, 1326, 419, -2366, -328, -87, - -103, -243, -280, 25, -240, 590, -232, 105, - -2966, -2391, -326, 338, 80, -392, -243, 271, - -7, 1127, 1, 1901, -2279, -207, 32, -99, - 560, -193, 371, 494, 506, 255, 332, 10737, - 48, 8, -33, -33, 32, -33, 45, -104, - -259, -99, -37, -134, 72, -50, 138, 428, - -2258, 77, 744, 5, 96, 3020, -269, 49, - 112, -223, 186, 48, 224, 2571, 340, -129, - -39, -1900, -45, 1978, -261, 223, 294, 22, - -108, -58, 109, -31, -3252, -138, -2969, -19, - -133, 190, -36, 132, -136, 63, -175, 351, - -76, 232, -2708, -17, -24, -130, -474, 74, - -2978, 45, -139, -23, 227, -42, -141, 278, - 81, 8, -2491, -446, 315, -64, -167, -643, - -275, 100, 0, 2484, -482, -128, -144, -206, -}; - -static const int16_t cb1616sl0[] = { - -46, -5073, 119, -68, 8, -160, 201, -15, - 55, 44, 44, -197, -110, -83, -90, -66, - -29, -128, 2449, -182, 2226, 298, -69, 189, - -167, 199, -78, 60, -154, -169, -242, 189, - 214, 132, -41, 169, 222, -130, 209, 20, - -154, -327, -3458, 186, 1356, 672, 133, 100, - 375, -491, -52, -87, 153, 537, 2513, -349, - 47, -27, 118, -301, 250, 45, 191, -150, - 279, 2367, -70, 191, -301, -206, -5, -40, - -201, 3680, -67, 36, -341, -133, -197, -383, - -101, 21, -68, -1240, 69, -8, -7, -16, - 28, -47, -145, -169, 32, 170, 246, 149, - 3039, -2617, -42, -95, 184, -74, 71, -56, - -22, -85, -203, 129, 97, -105, -91, -304, - 4, 93, 89, 2724, 2809, -178, 52, -155, - -152, 149, 47, 182, 124, -75, 24, 256, - -38, 53, -135, 63, 70, 59, -59, 7, - 6, 46, 8192, -157, 142, 81, 121, 136, - -87, -147, -71, 59, 57, 119, 21, -1938, - 46, 186, 100, -158, -52, 34, 95, 22, - 20, 179, 112, 116, 234, 2551, -3012, -167, - -93, -379, -90, 24, 208, 257, 253, 23, - -1361, 209, 75, 191, -23, -115, 2024, 264, - 77, -159, 77, -219, -237, -154, 13, 273, - -3338, 122, -205, 3796, -96, 103, -136, -60, - 115, -81, 19, 69, 396, 225, -280, 86, - 329, 284, 505, 403, -37, 203, 310, -2587, - -2374, -241, -17, 492, -42, -32, 261, 112, - 123, -33, -1271, -112, -41, 12, 82, 67, - -71, 56, -10, -83, -28, 15, -12, 42, - 2292, 297, -235, -3, 528, -57, 159, -185, - -54, -84, -152, 775, 15, 54, 451, -294, - 53, -2, 141, 39, -65, 75, 149, -5460, - 17, -58, -126, -281, 264, 151, 362, -98, - 62, -2361, -2560, 173, 42, -290, -161, -96, - -52, 82, 130, -86, -150, 48, 20, -57, - 52, -2263, -96, 2662, -66, 21, 74, -37, - 22, 323, 64, 270, -141, -599, -300, -121, - -12, -128, -96, -3, -129, -4339, -293, -55, - 31, -82, 8, 82, -20, 58, 15, -238, - 140, -125, -98, 7632, -14, 96, -129, -12, - -39, 85, 0, -104, -225, 24, 3, 95, - -87, 115, 168, 19, 22, 95, 8056, 36, - -12, 106, -99, -15, -87, 112, -122, 55, - 14, 282, -31, 80, 42, -4, 81, -73, - 74, -10, 82, 35, 173, -20, -40, -8192, - -35, -386, 270, 263, -231, -142, 42, -445, - 204, 177, -330, -859, 715, 2731, 59, 2578, - 220, -478, 3, 410, -47, 61, -214, 2765, - -206, 174, 56, 427, 442, 118, 2708, -66, - -40, 41, 119, -65, -71, -21, 124, 106, - -18, -2586, -35, 106, -364, 286, -16, -178, - -146, -82, 157, 92, -4, -437, -131, -85, - -27, -90, 23, -58, -5332, 115, -69, -25, - -14, 13, 52, 14, -286, -13, -60, 16, - 19, 53, 35, 7, -21, 7, 231, 48, - 2495, -82, 2836, 44, -134, -76, 33, -394, - 47, -124, -175, 95, 103, 161, 57, -37, - 174, -499, 131, -394, 2007, -2596, -481, 294, - 152, 601, 144, -438, 109, -204, 317, 37, - 362, -153, 216, 269, -39, 1250, 505, 505, - 2571, -115, -595, -806, -998, 1226, -71, 26, - -67, 262, 51, -161, 183, 1622, -32, 233, - 3, -217, 19, -16, 209, 51, 40, -40, - -43, -27, -7227, 13, -128, -18, 82, 154, - 133, -121, 33, -66, 8, -102, 71, 8, - 2780, -43, 79, 3212, -282, -165, 125, 78, - -101, -59, 59, -136, 308, -61, -295, -241, - -29, 27, -326, 2932, -563, 308, -269, -34, - -158, -26, -64, -411, -75, 420, -294, -239, - -11, 429, 44, 36, 69, -200, -56, 279, - 80, -218, -294, -294, 252, 64, 7793, 7, - -155, -56, -3118, -2749, -178, 62, 441, 105, - -45, 23, 23, -101, -109, -26, -149, 566, - -29, -394, -850, 1699, 1986, 243, -665, 565, - 155, -1746, 96, -344, -651, 387, -363, 283, - 241, 101, 71, -18, -9, 43, 114, -22, - 9, -109, -119, -92, 117, 8192, -67, 87, - 174, -42, -195, 527, -155, -195, -167, -1619, - 2638, -824, 121, 44, 138, -808, 407, 584, - -217, -90, -278, 549, -118, -1278, 837, 220, - 142, -956, -294, 89, 2627, 269, -129, 253, - 10, 15, 167, 163, 87, -262, 89, 48, - 14, 24, 2967, -175, 2550, 51, 11, -152, - -111, 230, -267, -79, 321, -641, 507, -32, - -20, -238, 23, -322, -2506, 173, 2205, -91, - -21, -1594, 420, -157, 97, 64, 126, -38, - -84, 10, -85, 93, -21, 272, -427, 30, - -60, 61, -81, -40, 27, 18, -29, -208, - -70, -8192, 16, 15, 53, 34, 49, -26, - -2512, -152, 23, -77, 3015, 87, -164, 247, - 119, 91, 444, -43, -166, -26, 253, -93, - 50, 408, -3274, 913, 104, 119, 17, -54, - 42, 19, -294, -298, -416, -82, 38, -263, - 137, 132, -2609, -44, 2783, -34, -9, 266, - 8, 18, -183, 520, 515, -93, -159, -21, - 186, 27, -89, 137, 77, -60, -33, 34, - -5115, -44, -172, -122, -9, -104, 69, 16, - 94, 2813, -200, -142, -50, 375, 3276, -272, - -44, 47, -41, -188, 263, -237, -24, 312, - 120, -326, 823, 193, 410, -95, 356, 565, - 296, 1202, -2737, -968, 87, -204, -1329, -826, - -827, 584, 194, -31, -12, -109, -39, -7, - 73, 29, 24, -12, 256, -98, -46, 63, - 207, -8, 73, -342, 4578, -37, 60, -66, - 8, -39, -176, -125, -34, 57, -141, -52, - -39, -128, -50, -143, -85, -107, 19, -38, - 74, -40, -161, -54, -63, -3452, 176, 116, - 5274, 19, -42, 198, 3, 33, 80, -99, - -111, 11, -90, 97, -6, -3, -52, 301, - 2335, 148, -171, -88, 44, -404, 124, 4, - -80, 189, 2838, 62, -247, 394, -230, -91, - 92, -2587, 84, -139, -31, 3014, 25, 201, - -137, -64, 383, 2, -70, -115, -210, 43, - -1111, -403, -379, -9, 243, 77, -220, -60, - -38, -15, 7, 109, 41, 143, 56, -211, - -2492, -48, -218, -115, -321, -358, 388, -10, - -172, -52, 177, 2996, -96, 480, -23, -15, - 177, -225, 217, 10, 367, 129, -45, -114, - 23, 257, -48, 2497, 236, 12, 197, 245, - 19, -173, -321, 310, 406, -280, -72, -279, - 73, 3307, 245, 78, -186, 2928, 264, 263, - -227, 50, 172, 91, 293, 24, -148, -245, - -61, 219, -88, 169, 220, -99, 3222, 3, - 0, 103, 19, 116, 69, -180, -7, -49, - 26, -59, -93, -68, 123, 357, 241, -3308, - -297, 198, 40, -80, 285, 161, 90, -46, - -165, -32, 87, -5676, 254, -37, 7, -20, -}; - -static const int16_t cb1616sl1[] = { - 73, 78, -64, 76, 17, 6250, -4, -167, - 52, 4, -3, 11, -189, -19, -136, -220, - 15, 6, -420, -2205, 38, -2944, 16, 118, - -116, 61, 119, -390, 217, 548, 24, 161, - -24, -2342, -148, -159, -2783, 225, 401, -226, - 210, 643, -366, 240, 264, 167, 115, 827, - -39, -161, 30, -173, 42, 29, 98, 377, - -58, -163, -41, 27, 25, 4368, 87, -2836, - -175, -71, -62, -84, -476, 4, 2466, 113, - -2830, -916, 593, 276, -356, -427, -686, -215, - 2752, 395, -9, -345, 117, -122, -327, 92, - 107, -106, 32, 270, 271, 171, 3138, 198, - -46, -70, 46, 502, 91, 77, -19, 216, - 94, 122, -64, -392, -31, -2696, -364, -131, - -315, 129, -461, 229, 192, 236, 185, -263, - -173, 44, 24, -267, -40, -177, -149, -2471, - 26, 113, -183, -1693, -188, 48, 22, -73, - 50, -133, 58, -70, -173, -308, -442, -188, - 92, 389, -35, 167, 235, 66, 2593, 2435, - 244, 630, -22, 235, 112, -32, 533, -158, - 81, 71, 44, -59, -158, -23, 28, 8192, - -58, -181, 39, 220, -54, -124, -59, -277, - 71, 41, -82, -157, -6860, -4, 44, -84, - -48, 134, -193, 159, -45, 218, -47, -133, - 147, 1749, 765, -84, 184, -317, -286, -17, - -340, -262, -244, -21, 3122, 290, -127, -119, - 179, -128, -125, -439, 2766, 1917, 85, 57, - -32, 373, -16, 170, -74, 31, 425, 626, - 1, -511, 64, 387, 142, -621, 183, -224, - 220, 1195, 386, -3360, 332, 484, -1112, -96, - 187, 43, 1838, 39, -36, 13, -132, -8, - -1, -43, 29, -132, -19, 10, 10, -218, - -3659, 119, -103, -27, -29, -108, 13, 181, - 39, -117, 92, 37, -17, -198, 330, 538, - 17, 113, 4758, 1, 28, -10, 87, 22, - 96, -14, -99, -56, -130, 0, -55, 45, - -63, -2845, 2751, 464, -31, -62, 76, -154, - 88, 81, 125, 373, -348, 587, -314, -278, - -53, 2039, -516, 2437, 191, -212, 87, -2, - 181, -242, 117, 23, -63, 334, 145, 454, - 343, -235, 91, 69, -8, 2, -106, -108, - -5, 137, -168, -7818, -231, 25, 37, 75, - -138, 56, 142, -596, 130, -114, 3293, -366, - 290, 160, -2, -219, 83, 843, -18, 1289, - -177, 226, 667, 252, -683, 816, 26, 157, - 168, -487, -49, -3282, 432, 184, 1207, 23, - 164, 544, 965, -1, 61, -118, 92, 1359, - 89, -3234, 15, 496, 244, 177, -613, -160, - -23, -195, -111, -372, -115, 278, 96, 77, - -2567, 49, -423, -468, 13, -484, 1345, -298, - 194, -123, -248, -139, 738, 102, 1154, -335, - 2694, 1326, 213, 758, 17, 154, 609, -518, - -367, 201, -144, 61, 66, 2288, 50, 2688, - -87, 45, -13, -101, 127, -190, -40, -286, - 6, 121, 32, 31, 119, -85, 28, 93, - 8192, 273, 169, 44, 37, 255, -224, 219, - -34, -127, -134, 165, 169, 126, -188, -52, - 98, 15, -5820, -193, -331, -395, -1, 49, - -187, 55, -121, -196, 114, 10, 258, -145, - -14, -385, 105, -187, 59, 383, 5322, 147, - -110, -69, 378, 138, -352, -69, 15, -267, - 75, 162, -6, 3148, 515, 231, -74, -436, - 1288, 1234, -105, 68, -96, -166, -49, -64, - 144, -67, 135, 258, -71, -162, 156, -366, - -7, -67, -133, -20, -119, 71, -84, 31, - 26, 116, -2237, 212, 43, 380, -74, 13, - -7, 774, -1276, -103, -124, -48, -178, -319, - 26, 435, -111, 858, 295, 1601, -2727, -242, - 8, 36, -61, -20, -19, -19, 31, 258, - 21, -14, 381, -153, -8192, -99, 327, 72, - 175, -1181, -271, 104, -30, -135, -169, 21, - 29, -182, -25, 125, 165, -82, 73, -26, - 2311, -85, -2983, -125, 85, -206, -100, -100, - 36, -3, -77, -180, 35, 0, -170, 123, - 168, -302, 366, -334, 2936, -70, 404, -2870, - 13, 79, 226, -163, -242, -124, -40, -171, - -109, 189, 20, -52, 144, -1869, -88, 230, - -8, -27, 45, 131, -11, -188, 93, -227, - -452, -229, 158, 377, -9, -1736, 16, 3268, - -164, 41, 305, -414, -642, -111, -100, 118, - -155, -236, 936, -114, 51, 31, 60, 1299, - 5, 3048, 274, 273, -197, -289, -245, -288, - 1927, -7, 27, 307, 174, -243, -95, -134, - 14, 24, -119, -132, -2811, -254, 35, 95, - 22, 135, 21, -155, -80, -143, -60, -6, - 182, 77, 11, -197, -8, -6080, 28, 155, - 11, -27, 22, -48, -8, -50, -122, 11, - -34, 342, -1, 40, -208, 117, -35, -69, - 150, -3944, -425, 46, 456, 182, -451, -219, - 38, 15, -203, 766, -232, 243, -70, 179, - 2107, -222, 346, -166, 143, 239, 245, 59, - -137, 17, 475, -68, 2679, -423, 20, -313, - 74, 152, 171, -269, 68, 39, -4743, 94, - -3, 110, 134, -168, 73, 180, -116, 276, - -74, -203, 2, -83, 17, 170, 96, 169, - 75, -5541, 46, 20, -168, -22, 35, -74, - 104, -153, 264, 4, -57, 94, -192, 161, - 15, 7, 45, -186, 15, -125, 121, -4981, - -254, 179, 282, 72, 543, -97, 363, -5, - -67, -389, -66, 178, 427, -276, -2675, 447, - -2, -125, -223, 2869, -502, 117, 2017, -71, - 41, 9, 124, 19, 357, -562, 25, -385, - 80, -53, -175, 2532, -73, -2990, -164, 57, - -128, -254, 53, -150, -180, 16, -45, 322, - 266, -2418, -264, 317, 371, 5, 197, 7, - -2476, -93, 152, 90, -165, 11, -259, -24, - -55, -16, 98, -4904, -116, 53, 205, -45, - -57, 116, 75, 161, -55, 97, -292, 27, - -1396, 105, -127, 133, -265, -33, 5, -3622, - 25, -3, -104, 8, -283, -229, 236, -208, - 145, 627, -240, 118, 296, 108, -309, 48, - -3345, 582, 498, 259, 20, 785, -138, 421, - 97, 370, 161, 141, -2793, 106, -246, -140, - -172, 42, -194, -202, -319, -107, -24, 423, - 7293, -109, -13, -242, 55, 171, 13, -93, - 131, -141, 88, 132, 76, 176, 78, 153, - -63, -55, -410, -39, 6, 27, -223, -174, - 61, 645, 167, -35, 3079, -173, 950, 1, - -109, -118, -106, 15, -1345, -14, 50, -70, - -69, 24, 109, 182, 84, 31, -179, -93, - -3152, -3013, -60, 56, -60, 58, 166, -161, - 24, 129, 1, 181, 128, -12, 273, -43, - -1256, 134, 159, -36, 175, 43, -49, 41, - 48, -38, -45, 59, -36, -82, 48, -74, - -104, 2944, -124, -24, 98, 248, -146, -231, - -241, 72, -114, 776, -498, 242, -357, 250, - -102, 7121, 109, 11, 94, -53, 37, -37, - -133, 24, -157, 47, -46, -69, 62, -79, -}; - -static const int16_t cb1616ss0[] = { - 1401, 373, -516, 330, -711, -752, -475, -224, - 139, 492, -556, 4629, 1039, 333, 872, -542, - 474, -360, -378, -3459, 254, 1199, 113, -525, - -1705, 231, 46, 188, -50, -1038, 32, -198, - -109, 619, 1071, -1601, 1002, -411, -189, -3276, - 615, -468, -467, -275, -1286, 736, 541, -1107, - 423, 191, 439, -205, 17, -87, 500, 176, - 262, -341, -142, 268, 8164, -2, 112, -190, - 227, -50, -143, -326, 647, 601, 482, 443, - 2761, -497, 979, -298, 454, -2927, 746, -735, - 3921, 480, -167, -317, 1303, 111, 216, -961, - 110, -595, 244, 246, -222, -205, 46, 61, - -798, 258, 360, -7038, -654, -95, 75, 498, - -24, -250, 71, 138, 527, 240, -215, 250, - -408, 552, -325, 333, -989, 2648, -483, -1121, - 2344, -1647, -116, -901, 615, 327, 1, 497, - 411, -138, 332, 281, -145, 337, 163, -7379, - 70, 265, 365, 238, 604, 99, -149, 233, - 109, 827, -704, 1367, 1208, -717, -17, -223, - 15, -3259, 53, -485, -631, 285, 511, -8, - 242, 547, 129, 145, 2046, 520, 44, -177, - 382, 283, -169, -346, -2737, 294, -1311, 145, - 1873, 815, 1078, 677, -3419, -434, 484, 144, - -27, 669, 153, -242, -242, 814, 350, 361, - -462, -63, 2317, 1259, -373, -489, -534, 300, - 867, 2621, -117, -168, -414, -239, 812, 840, - 112, -463, -6286, -693, -830, 140, -168, 448, - 549, -149, 418, -105, 137, 31, -40, -43, - 422, -99, 297, 3, -220, -15, 81, 45, - -647, -535, -448, -731, 250, -6742, -320, -350, - -192, 1540, -1112, -1043, 1317, -1203, 1035, -506, - 673, 721, 854, -1487, 780, -294, 1173, 2142, - -8192, -170, -138, -54, -54, -233, -127, 145, - -233, -185, 87, 20, 530, -305, 141, -394, - 310, 40, 645, 809, 4801, -186, -432, -451, - 312, -144, -65, 65, 135, -64, -15, -357, - -3546, -1299, 216, 249, 261, -207, 117, -3138, - 527, 14, -142, 286, 100, 340, 581, 157, - 234, 739, -2521, -3, 639, -1440, 131, -3796, - 159, 39, 41, -659, 284, 165, 1100, -346, - -481, 295, 806, -227, -288, 4520, 253, 487, - -252, 88, -43, -1612, -5, -57, -66, 18, - 19, 557, -337, 1526, -2897, 144, 844, -404, - 1976, 787, 246, 264, -406, 778, -918, 51, - -113, -235, 518, 602, -307, -2046, -692, 2775, - 400, -2165, -184, 139, 403, -1855, -1317, 289, - 710, 1124, 1888, -517, 276, 190, 637, -441, - 717, 972, -370, 478, 626, -354, 241, -3651, - 145, 7, -738, 397, 991, -343, -826, 142, - 672, 2425, -616, -3278, 751, -193, -944, -35, - -1061, 1258, 631, -721, 145, -112, -69, 828, - -39, -196, -237, -73, 771, -195, 239, -533, - -1673, 3477, -559, 104, -647, -798, 167, -497, - -559, 591, 259, 300, -25, 422, 93, 39, - -63, 233, 144, -1170, 142, -456, 73, 411, - 6920, -338, -307, 436, 143, 420, 152, -9, - -1788, -1096, -2998, -727, -524, 128, 460, 782, - -102, -576, -138, -976, 1035, -3196, -436, -27, - -1047, -1389, 3244, -143, -883, -1012, 4, 327, - 16, 411, -497, 1444, 516, 1183, 252, 510, - -698, -676, 569, -70, -397, -227, 7829, 312, - -410, 20, 41, -65, -219, 175, 297, 40, - -1534, -498, 194, 871, 409, 280, 1098, -1471, - -2825, 931, -105, -545, -801, -795, -372, 73, - 331, 100, 488, -2101, 560, 44, 885, 1065, - 380, -195, 276, 124, -87, 193, 3979, 30, - 95, -509, -931, 2737, -457, 805, 10, 53, - -73, -203, -587, -177, 242, 238, 656, -3403, - -380, 2364, 2902, -226, 204, 1559, -2219, -40, - -442, 111, -703, -424, -252, -241, 461, 749, - 658, -481, 125, -366, 601, -246, -286, 132, - 297, -232, 5231, -141, 196, -121, -235, 406, - -199, -174, 87, -107, 363, 272, -563, -620, - 235, 223, -627, -339, -467, 349, -1596, -5496, - 644, -96, -81, 1938, 749, -160, -1976, -1436, - -1056, -1045, -1098, 2327, 976, -57, -124, 1139, - 275, -209, -636, 298, 2484, 2764, 962, -39, - 108, -718, -442, 9, 797, 1123, 1092, 1179, - -1170, -701, -381, -237, -1266, -1045, -337, -351, - -274, -981, -272, -111, -3409, -387, 421, -406, - -2123, 623, -18, 2473, 617, 176, 26, 1402, - -1351, 212, 23, -172, 296, 1572, -63, -402, - 837, -521, 2209, -613, -329, -309, -180, -1152, - -535, -1380, -2617, 475, 385, -672, 182, 92, - -2211, 320, 109, -633, -582, 1208, -1536, 1009, - 896, 1991, -374, 1750, -1259, -341, 1774, 1063, - 678, -2084, 987, -337, 48, -205, -82, -288, - 388, 217, 1263, 2427, -1472, -1073, -964, -836, - 2086, -161, 438, -449, -37, -926, -3706, 164, - -372, -616, 160, -572, -725, 727, 11, 53, - -84, 7494, -74, 523, -172, 464, 452, -426, - 803, 106, -262, 32, 298, -491, -181, -760, - -908, 303, 747, 1316, 272, 906, 767, 105, - 247, 6120, 948, -557, -928, -595, -342, -450, - 686, -815, -1243, -157, 572, 1414, 166, -229, - 3317, 1940, -283, 623, -781, 717, -212, -707, - 30, 3635, 1147, -696, -928, -637, 925, 797, - 843, -1359, 214, 1096, 1031, 852, -84, -228, - -34, 1067, -1109, 392, 292, -755, 3495, -40, - -1806, -637, -236, -602, -264, -147, -68, -233, - -55, -2005, -271, -647, 963, 309, -5, 56, - -275, -398, 34, -496, 2556, 1249, -87, -112, - 1663, -554, -1926, 627, 2515, -1128, -566, 1539, - 740, 38, -614, 272, -232, -152, -782, -420, - -304, -2313, -33, -944, -77, -3468, -69, -1730, - -21, 665, -314, -1640, 660, 661, 106, -21, - -1505, -2888, -427, -866, -666, 3128, 786, -55, - 739, 112, 8, 567, -602, -350, 165, 108, - 767, 64, -715, 980, 673, -186, 768, -545, - -298, -233, -524, -70, 511, -2051, 3816, -1104, - 529, 1012, 2577, 777, 342, -387, 2730, 247, - -20, -227, -432, -263, -885, -1192, -644, -259, - 2314, 38, 108, 614, -386, 470, -78, 681, - -3334, -1049, -300, 177, -174, -422, 110, -641, - -406, -472, 468, 885, -730, -877, -1972, -1372, - -410, 545, 543, -800, -1156, 279, 3290, -1305, - -213, -262, -832, -994, -1110, 718, -364, 1416, - -7, 963, 452, 680, 165, -3815, 903, 806, - 149, 11, -1332, -622, -451, 152, -618, -309, - 246, 435, -2098, 487, 469, -451, -1574, -204, - -187, 552, -333, 515, -331, 1452, 278, -2691, - -146, 1009, 353, -839, 6, -3206, -1080, -572, - -2698, 752, -1726, -318, 397, -152, -128, -77, - -36, -506, 456, 1094, 281, -158, -19, -149, - 48, -2831, 2042, 2545, -161, 619, 1129, 274, - 24, 1, 313, -164, 655, 157, 770, 182, - 1942, 241, -898, -1748, -589, 256, 322, 683, - -65, -73, 621, 74, -317, 2585, 185, -465, -}; - -static const int16_t cb1616ss1[] = { - -3218, -607, 1665, 1100, -563, 421, 377, 445, - -270, -3, -1503, 224, -593, -316, 31, 362, - 1186, 389, -1817, 589, -2842, 289, -1925, -356, - -228, -148, 618, 135, 358, 238, 1, -767, - -266, 1, 101, 245, 231, -167, 408, 1, - 162, -35, 241, 215, -4702, 486, 546, -339, - 349, -292, 1342, -881, 184, -675, 2639, -284, - -995, 346, -499, 1499, 1616, 578, 445, -78, - 844, 1800, -686, -414, -1425, 795, 754, -1418, - -178, -2226, 515, -143, 43, 569, 967, -2333, - -1991, 282, 528, 1410, -377, 736, 394, -230, - -365, -242, 2773, 136, -738, -36, -1171, -76, - -132, -300, -223, -680, -416, -2738, 93, 414, - 490, -346, 75, -1089, -1132, 2237, 1844, 395, - 325, -1514, 1913, -1850, 1162, -442, 689, -66, - -71, -83, 342, -197, -940, 206, -3381, -1275, - -423, -87, -455, 498, 865, 355, 1225, -115, - -3333, -404, -588, 1021, -2180, -1470, 1225, 728, - 59, 2592, -335, 194, -649, 3586, -951, -142, - -947, 898, -99, -269, 977, 1520, 488, -364, - -253, 127, 2524, 849, -1166, -191, 627, 372, - 772, 145, -21, 279, 402, -863, -2695, 1217, - 1543, 1005, -1419, 1712, 110, -2191, 969, 1563, - 183, 811, -218, -1078, -220, -1092, -322, 803, - -533, -359, 405, -70, -771, -267, -4730, 235, - -607, -387, -285, -68, 48, -60, -222, 229, - -1087, -1261, -2249, 1265, -1624, 864, -65, 223, - -322, 337, -262, -3170, -12, 4571, 19, 198, - 458, -1029, 2560, -3, -115, 619, -645, -836, - -399, 246, -81, -12, -1057, -2119, 2780, 25, - -1559, 291, 592, -513, 62, 157, 553, 570, - -657, 72, -118, -284, -454, 3853, 145, 259, - -1709, -2161, -3167, 189, -233, -1099, 141, 114, - -506, -1012, -775, 474, 331, 798, 469, 1915, - 96, -266, -385, -329, -658, 192, 16, 97, - -47, 284, -163, 200, 189, 18, -7453, 160, - -2988, 2725, 520, -132, 2593, 627, -694, -26, - -558, 44, -209, 40, 377, 491, -68, 384, - 271, 2117, 642, 3166, -569, 702, 513, -1858, - 108, 944, 248, 166, 681, 408, -908, 525, - -145, 1035, 189, 2812, 135, -356, -2551, 401, - 150, -508, -265, 244, 461, 958, -233, -204, - 744, -1603, 397, -229, -174, 539, -139, -4473, - 837, -310, 253, -635, 397, -80, 601, -371, - -2015, -261, -364, 50, 331, 89, -938, 709, - 1444, -2910, -228, -162, 419, 62, -319, -266, - 584, 3728, 57, 220, -543, 768, -630, 361, - 361, 642, -313, 182, -488, -48, 3001, -397, - 640, 179, 8, 1081, -1161, -58, -70, -64, - 4456, 323, 883, -191, -16, 61, 419, 429, - 627, -898, -883, 750, 499, -1335, -467, -1410, - -5, 283, -301, 276, -1636, 310, 114, -428, - -8192, 12, -114, 74, 215, 511, 317, -314, - -86, 198, 138, 315, -271, 246, -363, 426, - 608, -714, 367, -1356, -2217, 1178, -385, 1442, - 28, -642, -371, -87, -2895, -710, 303, -150, - -398, -868, -1727, 1548, 982, 1177, 332, -377, - 1580, 962, -1028, 1922, 1494, -824, 93, -1362, - -552, 1641, -1729, 228, 1054, 421, -185, -536, - 51, 87, -204, 88, -847, -754, -3761, -2706, - -138, -1242, 35, 64, 418, -460, 713, 3960, - 733, 468, -150, -823, -211, -674, 366, -269, - 180, -294, -384, 604, 1829, -121, 271, 241, - 192, -211, -2672, -1483, -1102, 960, 90, 49, - -1144, 2552, -887, -32, -301, 62, -183, 193, - 78, -781, 193, -606, -285, -3082, 240, 392, - 704, 20, -1103, -195, 166, 577, -105, -45, - -310, -106, 3035, 28, -369, 725, 53, 87, - -232, -191, 7, -282, -572, -8192, 325, 99, - 162, -113, -237, -209, 412, -573, 295, -389, - -1603, -66, -485, -867, 466, -882, 862, -216, - 221, 50, -51, 3927, 557, 441, 223, 234, - 4048, -173, 420, 1670, 436, 341, 175, -441, - -201, 75, -549, 315, 172, 418, -159, 7, - 2973, -3, -220, -1360, 26, 2781, 132, 295, - -15, 217, -166, 187, -282, 357, -121, 480, - -216, 294, 263, 95, -7367, 589, -63, -412, - -103, -201, 335, -96, -203, 240, 223, -435, - 366, -467, 118, 528, -472, -559, -417, -189, - -641, 339, 1546, -2741, 1413, -265, 637, -1556, - -49, 422, -195, 392, -21, 3, -2, 282, - -130, -272, -483, -860, -675, 762, -1455, 5212, - 178, 197, -468, 270, -310, 1038, 406, 2699, - -537, -33, 272, 225, -1986, 1295, -857, -2906, - -904, -1861, -206, 866, -145, -207, 252, -825, - 3051, -1361, -441, 85, -186, -127, 139, 285, - 3067, -332, 1163, 248, -483, -177, 268, 691, - 733, -104, -54, 2541, -1042, -226, 165, 250, - 7, -259, -383, 327, 2164, 2272, -750, 2482, - -930, -139, 1203, 766, 150, 320, 970, 28, - -1351, 467, 544, 521, -2908, -75, -902, 611, - 575, 1216, -209, -7, 541, 330, 528, 347, - -185, -306, -432, -3384, -1844, -380, 155, -1230, - 629, -1085, -413, 119, 114, 1093, 198, 806, - 491, -137, -518, 536, -64, 387, -1712, 608, - -24, 4961, 149, 299, -342, 505, 503, -387, - -944, -297, -2423, -98, -1027, -432, -259, 736, - 127, 3561, -473, -623, -751, 114, -438, 657, - 2448, 863, -413, -81, 2066, 988, -539, -528, - -111, 314, 390, -1228, -863, 19, 763, 2227, - -844, -24, 4164, 139, 130, -111, -630, -428, - 538, -606, 940, -877, 122, 526, 194, -104, - 127, 117, 907, -789, 2865, 526, -548, -253, - 289, 2329, 176, -70, 775, 681, 21, 38, - -1481, 766, 2093, -2974, -289, -571, -445, 1833, - 333, -84, -243, -413, 188, -492, -22, -867, - 605, -333, 904, 3192, -29, 491, -411, 370, - -556, -2671, -294, 132, -243, -233, 180, 181, - 383, -79, 26, -3539, 642, 1127, -2125, -170, - -386, -135, -703, -290, -157, -444, -885, -341, - -920, 460, -407, -176, 3153, -3084, -505, 543, - 7, 79, 1191, 1148, -401, -17, 289, -735, - 300, 1971, 626, -146, 110, -1281, -613, -649, - -206, 1850, 701, 1138, -803, 742, -1392, 147, - 554, 1861, -658, -1481, 108, 856, 1021, 574, - 3314, 518, -1156, -307, 42, -92, -132, 278, - -352, -37, 35, 146, -93, -662, 216, 125, - 823, -876, -170, -5027, 444, -182, 844, 189, - -490, -1441, -335, -907, -173, 1138, -472, -1505, - -1641, 648, 66, 627, 64, -1096, -620, 1588, - -506, 309, -100, 5702, -555, -157, -179, -85, - -299, -114, -20, 178, 415, 118, -581, -132, - 1025, -2631, -1154, 2623, -286, 201, 340, 949, - 235, 171, 649, 328, 397, -142, 1369, -7, - 2305, -373, 658, -1681, -744, -3574, 34, -183, - -504, 165, 81, 21, 635, -307, 428, -520, - 164, -4701, 744, 249, -844, -7, -334, 38, - 539, 267, -213, 73, 134, -251, -248, -923, -}; - -static const int16_t cb1616sm0[] = { - -4119, -2861, -76, -49, -192, -542, 0, 94, - -550, 6, 601, 236, -446, -202, 167, 238, - 2609, -688, -406, 265, -3078, 321, 59, -601, - 157, 200, -265, 78, -699, -679, 18, -54, - 203, -687, 2683, -111, -3037, -627, -493, 413, - -480, 54, 75, 276, 206, -1861, 17, -420, - -169, 312, 361, -277, -12, -363, -592, 758, - -123, 3267, 78, -862, 81, -356, 596, -536, - 729, 2239, -49, 553, 112, 444, 652, -2990, - -70, 1084, -436, 34, 53, -10, -23, 41, - -3, -126, 207, -130, -208, 63, 480, 191, - 6229, -45, -33, -82, 35, 56, 259, 1, - 8034, -97, 52, -159, -334, -41, 50, -57, - 56, -194, -567, 2050, 146, 987, -383, 416, - -258, 2846, 51, 8, 690, -126, -704, 316, - 16, -4, -90, 159, 34, 126, 65, 218, - -7037, -261, -87, -21, -185, 14, 112, 42, - -164, 274, -269, 1138, -208, 574, 589, -143, - -479, 2745, 782, -13, -2492, -132, 498, -406, - 260, 828, -580, 558, -2861, -600, -447, -313, - 1316, 800, 1772, 1131, 323, -48, -3972, 697, - 5, -403, 46, 95, 130, 84, -39, 219, - 117, 1629, -189, -1371, 25, -116, 2311, -681, - -411, -685, -1340, -409, 223, -462, 2530, -816, - -1118, 314, -893, -109, -262, 376, -2795, -48, - -2878, -6, 180, 53, -500, -181, 125, -291, - -265, -154, -23, -184, 185, -563, -1159, 675, - 24, -213, 273, -2905, -242, 2373, -6, -166, - 92, 276, 1375, -28, 1879, 2572, 205, -121, - 51, 356, -873, -308, -1060, 952, 719, 456, - 106, 116, -107, -211, -21, 3319, 2109, -172, - -172, 143, -718, -138, 1135, 232, -1361, 157, - -99, 522, -4367, 84, 605, 319, -937, -397, - 117, -434, 82, 633, 274, -1555, -221, -59, - -2419, -2486, -112, 136, -182, -480, 27, -548, - -237, 817, 530, 656, 252, -2685, -26, 703, - -3268, 381, -383, -323, 105, -500, 66, -299, - -1056, -363, -69, 21, 292, 398, -379, -106, - -356, 38, 169, 2866, 206, -523, -277, -2875, - -582, -69, 649, -3, 198, -30, 98, 145, - -125, -186, -19, -107, -102, -173, -7299, -62, - -503, -231, 24, 145, 1367, -355, -175, 373, - -953, -704, -3454, 170, 899, 386, 592, -754, - 620, 81, 86, -65, 84, 683, 3054, -280, - -2825, -757, 53, -10, 441, -145, 138, 1364, - -2, -92, -300, 225, -199, -2087, 1095, -363, - -75, 288, 765, -869, -7, 3261, 9, -2860, - -330, -382, 3309, 28, 629, 244, -143, -298, - -512, -409, -241, 104, -6, -271, -2, 8192, - -137, 139, -304, -14, 81, 262, -36, 51, - 380, 11, 101, 100, -153, 2167, -271, 267, - 306, -3008, 579, -277, 316, 327, 1168, 71, - -1401, 389, -25, -265, 101, -53, -170, -226, - 2861, 145, 3040, -159, 77, -16, 233, -570, - 490, 661, 452, 1986, -522, 212, -107, 196, - -247, 308, -353, 186, -2689, 486, -46, 813, - -24, 233, -166, 3305, 2832, -343, -82, 475, - 267, -385, 26, -35, -226, 27, 416, 231, - 12, 88, -209, -139, 404, -239, -109, -182, - -851, 260, 242, 109, 11, -1096, 85, -4226, - -124, 12, -139, -100, -604, -87, 89, 5820, - 59, -43, -84, 264, -543, 0, 428, -16, - -146, -556, -195, -159, 875, 27, 261, 207, - -182, 2367, -622, -3193, 481, -289, 52, 12, - 34, 3014, 10, -345, -94, -2883, -62, 400, - 249, 51, -178, 1190, -128, -3940, 41, -296, - -48, 13, -26, 223, -2392, 516, -384, 33, - -46, -161, -43, -224, -89, -4, -349, 135, - 540, -120, -276, -198, 129, -5113, 175, -45, - -34, -109, 419, -45, -104, -185, -393, 416, - -3514, 149, -3088, -115, -78, 431, -172, 21, - -290, -162, 216, 41, -56, -487, 705, -194, - -1003, 100, 172, 2793, -83, 2584, -189, 1198, - 551, -119, -73, -91, 2103, -619, 124, 128, - 2628, 192, 160, -110, 270, 1739, 1062, -568, - -73, -56, 328, 100, 384, -173, 83, 39, - -236, -25, -457, 53, -6413, 345, -459, -110, - 28, -127, -109, -593, 32, 141, -879, 254, - 2132, -410, -623, 1103, -2302, 528, 156, 28, - 81, 613, 602, 171, 500, -2356, 620, 17, - -523, -2961, -921, -107, -405, -230, -129, 18, - 363, -881, 1282, 1427, -363, 658, 205, -51, - 2835, -2003, 188, -26, 73, -231, 352, 74, - -490, -222, 2423, -341, -2762, -14, -56, -260, - -41, 33, 169, -190, 1248, -77, -2322, -607, - 3610, -104, -200, -90, -81, 719, -52, -359, - 394, -301, 66, -39, -56, -8192, 87, 56, - -291, 50, 231, 284, -211, -16, -86, -84, - -28, 52, 3, -51, 304, -224, 228, -374, - 458, -1958, -210, -2613, 401, -2128, -119, -12, - -60, -14, -8192, 53, 27, 113, 289, -7, - 22, 60, -192, 333, 72, -344, 238, 147, - -2235, 324, 124, 176, -415, 450, -476, -558, - -429, -246, -551, -287, 672, 2145, 8192, 161, - -165, -34, 193, -108, -137, -96, -68, 156, - 308, -182, 5, 438, -71, -27, -164, 187, - -110, 5786, -82, -130, -126, 197, -262, -182, - -118, -110, 121, -93, 235, -56, -99, -212, - -3013, -193, -10, -2944, 58, -135, -624, -170, - 84, 339, 115, -85, -1886, 250, 123, -104, - -374, -2241, 2454, -438, -168, 632, -136, -725, - -329, -394, -60, 19, 2795, 438, -796, 141, - -143, 132, 251, 37, 286, 1858, 39, 2381, - -9, -85, -110, 149, -415, 355, -172, -9, - -149, 554, -324, -4931, -537, -261, -585, -291, - 764, -92, -139, -8, -80, 65, -6, -26, - -81, 37, -14, 45, 115, 171, -321, 313, - 308, -4637, -128, -120, -174, 148, 768, 490, - 81, -175, -261, -136, 1501, 345, 25, -56, - -212, -324, -836, 207, -652, -752, 2406, -332, - 489, -275, -932, 284, 3103, -315, 614, -2711, - 1706, -1072, -163, -75, -1104, 163, -421, 1532, - -92, -163, -811, -118, -38, -754, 466, -314, - 232, -595, 3613, -30, 570, -62, 785, 1626, - 1080, 553, -407, 32, -105, 82, -156, -75, - 8063, -67, 114, -65, -65, -242, 98, -124, - 38, 441, -2645, -92, 69, 17, -3284, -278, - -278, 116, 567, -742, 182, -304, 432, 261, - 86, -4109, 389, 795, -138, 151, 111, -223, - 2392, 399, -135, -545, 182, -226, 61, 234, -}; - -static const int16_t cb1616sm1[] = { - -29, -13, -6217, -136, -196, 24, -228, -301, - -155, -37, -54, -91, -4, -130, -424, -89, - -181, 657, 110, -4526, -391, 762, 1033, -310, - -808, -282, -721, -690, 258, -259, 16, -555, - 2675, -379, -2580, 356, 198, -455, 95, -194, - -754, 383, -263, -873, 271, -107, -191, -28, - 11, -66, 91, 25, -215, 9, 152, 11, - -124, 66, 422, 521, 5401, 103, -179, -291, - -821, -1265, -396, 150, -69, -15, 154, 1504, - -445, 116, -136, -3528, 2819, -5, 174, 166, - 289, -60, 158, -701, 83, -636, -407, 194, - -240, -138, 124, -94, 132, -105, -106, 72, - 139, 101, 97, -7928, 6, 112, 164, -83, - -329, 41, 124, 389, -22, -194, 157, -378, - -2255, -431, 3176, -199, -310, 49, 483, -208, - -235, 11, 45, 637, 1220, 2309, 93, 514, - -1939, 136, 276, -165, 137, 2496, 56, 31, - 238, -538, -433, 690, -318, -44, 834, -1684, - -132, 2619, -157, 1959, -566, 119, 183, 227, - 2066, 401, -48, 1257, 604, 1306, 149, 273, - 586, -199, 2166, 257, 2047, -46, -377, -761, - -25, -454, -1592, -42, 432, -2312, 222, -528, - -87, -287, 532, 2906, -2011, 720, 554, 423, - -576, 425, 280, -894, -232, -179, 485, 628, - -2918, 405, 229, -2, -146, 127, -329, -243, - 194, 2443, -531, 592, -14, 1679, 292, -914, - -332, 2382, -3040, 297, -2856, -88, 236, -485, - 438, 241, -283, 448, 579, -660, 277, 233, - 201, 126, 15, -411, -560, -582, -389, -392, - -7, 238, 1, 344, -216, -4601, -457, 1027, - -114, 13, -301, 288, 172, -488, -124, -2721, - 100, -105, 434, -13, 2791, -827, 1600, -219, - -4992, -100, 411, 326, -608, -779, 94, 974, - 453, -1326, -236, 429, -189, 830, 32, 187, - 459, 2489, 476, 165, 3261, -445, 169, 179, - -113, 168, -393, 52, -383, -33, 73, 137, - -6021, -259, -121, -29, -46, -156, 68, -225, - 217, 152, -280, 7, 62, 3, 17, 295, - 221, -158, -5406, -335, 232, -454, -320, 467, - -45, 96, -170, -267, 1273, 287, 258, 536, - -695, -953, 1134, 428, 251, 3331, 717, -804, - 627, 1099, 120, 4, 42, 191, -9, 259, - -335, -337, -25, -56, 116, -228, -351, -463, - 5942, 193, -114, -64, -268, 300, 146, -15, - 657, 367, -2, -2911, 838, -251, -1, 2897, - -78, -609, -545, -588, 488, 1383, 486, 1820, - 126, 2971, -151, 11, 10, -349, -279, -260, - -265, 142, -683, -191, 172, 30, -293, -5103, - -61, -247, -38, 722, 275, -326, -34, 132, - 297, 3305, -46, 227, -1052, -1114, 562, 62, - -1618, 699, 362, -1624, -455, 150, -110, 61, - -266, -168, -168, -391, 136, -569, -772, -203, - 467, 20, -4747, -170, 142, -138, 129, 1719, - 1896, 210, -1008, 206, 585, -325, 295, 175, - -2542, -489, 121, -94, -38, -2766, -115, -3206, - -305, 320, -179, 503, 83, -72, -122, -52, - -181, 98, 39, -506, -2751, -93, -1, -59, - 2645, 248, -309, -203, 138, 324, -567, 696, - -493, 170, 2440, 919, -420, -3029, -335, -593, - -72, 536, -82, 202, 78, 510, 184, -2, - 227, -2830, 19, 1590, -281, 387, -46, 408, - -463, -536, 262, 2214, -115, -1614, -385, 203, - 32, -885, -2606, 2338, 97, 292, -449, 449, - -1038, -582, 0, -68, 211, -160, 62, -286, - -2466, -421, -48, 1903, -1037, -173, 1339, -591, - 152, -1231, 792, 524, 214, -92, 29, 181, - -225, -150, -1, 139, -8135, 238, -119, 189, - 34, -140, -188, 141, -112, 56, -176, 154, - 91, 5653, 298, -316, -23, 232, -74, -317, - -4, -630, -506, 105, -1655, -126, 2417, 113, - -95, -472, 134, 290, -755, 152, -1222, -58, - 981, -236, 8192, -154, 75, 218, -185, 107, - -10, 39, 265, -225, -87, 9, 123, -906, - -382, 2544, 44, -1985, -102, 407, -91, -1835, - -108, 122, 142, 169, 134, -721, -1530, -4, - -133, 45, 374, -1049, -76, 16, -357, 277, - 158, -2596, -4, -1484, -13, 2660, -198, 9, - -218, 408, -63, 177, -71, -195, 4293, -8, - 228, 34, -421, 695, -1409, 85, 2740, 350, - 44, 473, 141, -93, 144, -59, -220, -154, - -148, -168, -205, 3049, 229, 194, -107, 90, - -353, 508, -343, 473, -446, 457, -452, -116, - 3493, 504, 2152, -228, -1832, -463, -657, 555, - 657, 540, 546, 604, 2214, -68, 254, 563, - 267, 227, 92, -107, 143, 260, 23, 42, - 64, -67, 138, -167, 72, 457, 4958, 61, - -933, 1, 5341, -32, 89, 161, 504, 823, - 311, 11, -184, -574, -79, -1654, -74, -366, - 164, -363, 117, 53, 706, -701, -2966, 233, - 11, 165, 394, 462, -2632, 703, -291, -65, - -49, 4080, -862, -65, -19, -110, -872, 323, - 833, -154, 369, 475, 2211, 20, -212, 1711, - -24, -28, -58, 32, 1746, 41, -779, 614, - 508, 3050, 687, 423, -182, -484, -60, 242, - 3895, -565, -453, 110, 547, -961, 320, -34, - -347, -1963, -116, 730, -435, -34, 41, 26, - -51, 8192, -115, 312, 184, -148, -199, 157, - 153, 82, 99, 138, -32, -19, -64, -139, - 107, 43, 133, -87, 42, -148, 7080, -158, - -335, -249, -64, 81, 157, 813, -279, 2226, - -16, 1191, -705, 607, 205, -11, -1341, -548, - -2251, -326, -149, -2536, 139, -750, 73, -394, - -218, -35, 181, 925, -557, 226, -63, 2582, - -737, 164, 181, -167, -230, 413, 328, 406, - -287, -2992, 539, 1133, -85, -2162, -154, -357, - -245, -8, 162, -118, 111, 1275, 47, -314, - -2043, -2732, -1052, -28, 625, -810, -487, 40, - -131, 273, 105, 2605, -2974, 268, -19, -257, - 842, -662, 855, 505, 590, -243, 68, 6978, - 118, -101, 349, -232, -258, -318, 212, 55, - -686, -177, -173, -102, 480, 35, 149, 263, - -2838, -198, 942, 392, 135, 2980, 34, 92, - -237, -672, 224, -298, 298, 2128, 359, 254, - 150, -839, 1001, 3234, -169, 261, -302, 74, - -277, 498, 321, 194, -3275, -152, -2786, 33, - 70, 236, -222, 88, -393, 47, -636, 869, - -754, 842, -2326, -460, 133, 0, 264, 172, - -2955, -286, -243, 399, 882, -722, -382, 872, - -119, -65, -2403, -119, -246, -890, -185, 102, - -32, -573, 225, 3044, -484, -40, -809, 403, -}; - -static const int16_t cb2224l0[] = { - -3546, -433, -76, 46, 24, -641, 214, 114, - -779, -930, -57, -462, -569, -848, -413, 53, - 45, -3172, 2915, -734, 152, 487, -113, 246, - -196, -187, -136, 469, 475, 382, 213, -886, - -275, 313, 3148, -62, -773, 785, -24, -1499, - -65, -175, -1942, -325, 78, -15, -38, 2, - 6, -29, -16, 9690, -15, -49, -13, 12, - -21, 11, -45, -63, -528, 192, -137, 201, - 138, -154, 57, -88, -1695, 155, 105, 121, - 4249, -59, 467, -439, 4483, -130, -39, 262, - -21, -377, 441, -353, -768, 366, 23, 841, - 529, 195, 2722, 2892, -255, -67, 628, -498, - 33, 241, 212, -1020, -97, -723, 594, 35, - -31, 1459, 19, -75, -27, -1, 48, 28, - 267, -275, 3780, -515, -467, 36, -405, -272, - -1968, 60, 44, 449, -2877, -124, -1524, 1195, - 1042, 117, 115, -305, 225, 215, -357, 144, - 35, -23, 89, 2133, 2, 65, -27, -48, - -243, -216, -807, 700, 1258, 6, -140, 4, - -31, -21, 42, 67, 97, -2, 104, -10, - -7734, 134, -50, -95, -88, -269, 105, -18, - -229, 453, 1038, -2609, -2944, -57, 27, 372, - 59, -556, -87, -242, 114, 1083, -119, -139, - 175, 146, -55, 1689, 342, 501, 2722, -1273, - 1626, 868, -290, -145, 62, 194, -23, -179, - 1540, -85, 360, 254, 339, -681, 2081, 2730, - 838, -128, 31, -2133, -173, 483, -138, 2706, - 2007, 91, 293, -642, 35, 280, -132, 454, - -66, -6263, -24, 82, -31, -39, 5, 41, - 66, 239, 18, -57, 61, -117, 103, 16, - -1231, 1384, -164, 104, 370, -1891, 2237, -440, - -1399, -1394, 3, 274, 223, -30, -70, 579, - 361, 423, 355, -176, -164, -443, -306, -2382, - 713, -2987, -340, -691, 1407, -5, 439, -264, - -86, 1964, -17, 88, 175, 56, -119, 31, - 466, 1980, 176, 513, 1809, 17, 3000, 1861, - -71, 314, -255, 2041, 576, 203, 443, -392, - -539, -380, -685, -204, -161, 287, 378, -502, - 1898, 1540, 1073, 2282, 573, 867, 122, 1064, - -628, -564, 97, 280, -36, 1601, -90, -174, - -10, 45, -57, 159, -496, 641, -959, -91, - -90, 3057, 1680, -83, 80, 19, 63, -119, - 1, -72, 466, -335, 453, -177, 3930, -21, - 327, -199, -651, -38, -6, -13, 7, -77, - 1, 8, 40, -125, 36, -136, 272, 6266, - -3299, 3331, 24, 18, -71, 9, -79, -374, - -277, 128, -233, -175, -350, -216, 81, -693, - -49, 33, -44, -37, -4260, -70, 96, 177, - -319, 133, 178, -377, -45, 182, 156, -155, - -34, 10, 22, 53, -211, 4, 5740, 48, - -42, 114, 149, -30, 122, -106, -309, -148, - -82, 20, 130, 2734, -40, -596, 1309, 1163, - -1470, 396, -264, 884, 142, -1818, 67, -1, - 38, -52, -73, 1, 279, 143, 278, -45, - 1541, -886, -677, -2609, -88, -3766, -201, 237, - -40, 195, -50, -366, 88, 166, 403, 236, - -130, 205, -45, -8636, -13, -27, -50, 8, - 40, 21, 41, -36, -25, -40, -14, -14, - 42, 296, 2495, 372, -361, -501, 1951, -2141, - 220, -847, 98, 228, -250, 563, -1121, -29, - 2888, -196, 151, -19, -287, -2298, 65, -482, - -124, -186, 1215, 468, -781, -227, 621, 298, - -42, -44, -115, 0, 50, 179, 23, 9, - -65, -8, 10, -101, -4998, 77, 1181, -304, - 139, 250, -2257, -97, 847, 433, 385, -2411, - 800, -852, -528, 435, -953, -23, 4, 928, - -108, -634, -273, -879, 2566, -2609, 621, 807, - 295, -77, 627, -1114, -297, -109, 2103, -53, - -9, 44, 32, 339, 679, 77, -3186, -416, - 1234, -801, 472, 408, 153, 465, 1703, 879, - -2411, -553, 440, 2099, -899, -288, 310, 665, - -47, -148, 1457, 3932, -213, 243, -1763, -2, - 288, -425, -972, 478, -302, 552, -377, -352, - 179, -480, 1466, 2019, 2817, 5, 824, 13, - -384, -582, -297, -1165, 689, -120, 703, -118, - 663, 206, -49, -2853, -76, 32, 170, 11, - 42, -503, -1139, 1548, -287, -1112, 765, -455, - -35, 2452, 22, -134, 144, 1867, -149, 2771, - 19, 264, 700, -48, 286, -593, -2637, 408, - 2304, -14, 187, -135, -210, 745, 282, 724, - 861, 21, -414, 606, 836, -564, 212, 203, - 64, 4706, -30, -43, -85, -61, -90, 644, - -281, 287, -122, -340, -137, 36, -4, -22, - 8, 9486, -3, 4, 10, 4, 86, 58, - -8, 6, -105, -15, 15, -63, -58, -30, - 15, 0, -19, 78, -8267, -134, -8, -45, - 163, -19, 149, -298, -167, 34, 190, -39, - -2229, 2821, 126, 185, -791, -1229, 1003, -331, - 980, 659, -60, -60, -48, 20, 12, -167, - -60, -39, 66, 180, -22, -20, 84, -108, - 131, -10, -8493, -1, -18, -4, -53, 25, - -63, -14, 20, 25, -41, 40, -5, -2330, - -74, 59, -7, -154, -293, -64, -2702, 819, - 75, 977, -602, 1138, 160, 262, 26, -81, - 18, 5558, 118, -167, 98, 110, -5, -44, - -27, 72, 51, -189, 0, 1868, 743, -275, - 2530, 6, 180, -1019, -1307, 710, 303, -152, - -115, -1498, -501, -495, -103, -76, 78, -7, - -9337, -6, 31, -21, 16, -14, 57, 36, - -81, -67, -30, -535, 216, 313, 310, -157, - 2830, -914, 122, 1353, -1842, 298, -1165, -13, - -253, -100, -560, -61, 40, 24, 3, 56, - -18, 5709, 41, 13, -23, -55, -98, 214, - 109, -205, -45, 27, -26, 177, -290, 89, - 8, 1315, 3102, 1657, 210, -1032, 774, -211, - -581, -51, 896, 852, 331, 349, -474, -119, - -865, -145, 2270, 703, -1967, -2088, 610, -700, - 113, -231, 2062, -152, -599, -474, -38, -601, - 432, -983, -731, 744, -2880, 156, -240, -1903, - 2497, -89, -963, -2179, -1208, 189, 318, 150, - 204, 29, -167, -138, -93, 73, 292, -3225, - -310, -510, 173, -90, 154, 1831, 380, -1191, - -976, -1460, -514, 235, 13, -2950, 22, -95, - 228, 85, 10, 264, -3165, 46, -184, -782, - 143, -9, 37, 12, 108, -65, -64, 115, - 86, 5039, -55, -203, -163, -462, 77, -92, - 423, 139, 239, -5, 1887, 426, 729, 118, - -159, -2821, -124, 2147, -167, -1023, 92, -23, - 162, -159, -47, -3, 14, -34, 37, -29, - -97, 41, -92, -75, -6983, -224, 250, -80, -}; - -static const int16_t cb2224l1[] = { - -2888, -183, 3606, 0, 33, 99, -76, -264, - -351, -508, -546, -103, 252, -49, 46, -32, - 48, -245, 67, -2408, 340, 3153, -154, -280, - -440, 374, -224, -39, -720, -289, -136, -3095, - -98, -37, -86, 145, 51, 132, 773, -1158, - -330, -449, -141, -1831, 666, -2680, -110, -906, - -307, -3299, 287, 55, -521, -173, -431, -383, - 67, -28, 34, 247, 2814, 1479, 32, -2196, - -1625, 135, 72, 3, 634, 76, 502, -306, - -366, -120, -219, 1934, 372, -130, -113, 255, - -14, 30, -687, -576, 797, 306, -2360, -242, - 2062, 69, 2273, 26, -20, -21, -68, -69, - -4618, 60, -171, -235, -271, 175, -110, 147, - 100, 1628, -197, -2, -4002, 520, -1236, -21, - 62, -396, 513, -369, -168, 285, 561, 131, - 1347, 83, -101, 89, 206, 5, 4556, -23, - 1191, 39, 352, -158, 99, -195, -33, 481, - -446, -125, 181, 2678, 2860, -524, -239, 55, - -360, -358, -560, 93, 307, 285, 77, -295, - -90, 114, -45, 54, -328, 94, -222, -30, - -5004, -164, 100, 379, 208, 424, -11, 26, - 10, -26, -32, 114, 30, 18, -44, -221, - -184, -32, 0, -99, -9001, -7, -33, 1, - 41, -3, 13, 9, -46, -86, 47, 56, - 72, -7, 5, -1162, 101, 456, -217, 3440, - -220, 400, 100, 1503, 365, 655, -230, 42, - 1129, 767, 192, -16, -3440, -79, -236, 3, - -80, 51, -11, -984, -142, 29, 554, 339, - 1851, 105, -279, -2915, 116, 3090, -431, 233, - 337, 61, 927, 32, -174, 237, 255, -250, - 604, 115, 2036, 78, -79, -50, -349, 338, - 285, 169, 394, -49, 1194, -2966, 447, 57, - -2591, 415, -586, -2616, -197, -61, 596, -1159, - 130, -441, 356, 47, 1192, 496, -1801, -15, - -142, -23, 132, 21, 84, 234, -137, 23, - -147, -3254, 407, 107, 1132, 130, 74, 153, - 3148, 2184, -464, 1294, 222, 589, 457, -397, - -87, -605, -631, 311, -703, 110, 20, -23, - -75, 18, -43, -182, 8, -94, 151, 4989, - -619, 662, 82, 8, 69, -4, 126, -35, - -99, -277, -227, -2212, 3188, 1115, -467, -618, - -989, 681, 218, -25, -37, -9, 32, -46, - 97, 15, -23, -95, -6, 55, 19, 7904, - -14, -508, 3, 14, -12, -58, 28, 154, - 11, 271, -593, 344, -336, 3489, -41, -2998, - 622, -2739, 2796, 1536, 310, 176, -318, 399, - -70, -298, -509, 256, -381, -158, 322, -197, - 3, -53, 37, 98, -6136, -25, -54, 57, - 138, -74, 239, -46, -18, 29, -265, -2278, - 22, 110, -21, -147, 266, 85, -286, 137, - 3434, -485, 68, 475, -3, 159, -181, -237, - 1595, 759, 786, 1490, 926, -2841, -160, 1092, - -7, 130, 895, -345, -95, -31, -35, 139, - -98, 2106, 305, 672, -66, 349, 229, -1561, - -1694, -1786, -743, -76, -67, 1666, 76, 10, - -22, 60, -45, 5, 409, -458, 583, -405, - 2586, -264, 175, 633, 842, 3208, -1488, -802, - 40, -119, -197, -84, 1645, 328, 823, -175, - 342, 12, -217, 67, 124, -180, -106, -2877, - -336, 171, 185, 132, -2263, -75, -622, -631, - -2404, 176, -132, 35, 179, -1498, 182, 68, - 699, 597, -2728, 325, 52, 421, -863, 609, - 53, -159, 258, -307, 2919, 44, -826, -467, - 91, 542, 1883, 815, -682, 548, -419, 593, - 82, -2108, -158, -75, -524, 2440, -528, -469, - 723, -14, -1817, -487, 448, 4, -155, -70, - -1715, 34, -55, 134, 0, 19, 107, 419, - 334, 74, 446, 1241, -4288, 61, -65, 21, - 71, 133, 2, -88, -238, 322, -283, -6, - 404, 98, 78, -1951, 412, -1942, 418, 257, - -42, -2444, -97, 1491, 464, 346, 229, -154, - 96, 261, 29, 302, 39, -201, -40, -98, - -157, 335, -3624, -349, -573, 633, -116, -312, - -82, 263, -2, -101, -57, 1817, -424, 3, - -245, 386, 74, 609, 2171, -77, -2604, -1036, - -117, 1585, -2, 9, -23, 31, -12, 48, - 215, 84, 13, 219, 419, -275, 4373, -91, - -6, 18, 2228, -46, 157, -408, 2288, 654, - -725, -245, -10, -1182, 1726, 324, 367, 3013, - 3429, -140, 360, -122, -574, -165, 109, -330, - -82, 340, -133, 210, 355, -8, 47, -52, - 8064, 5, 60, -42, -95, -3, 91, -69, - -47, -42, 101, 118, -44, -16, -14, -9, - 27, 8, -33, -3, -9302, 27, 49, -6, - 61, 74, 204, 430, 252, -259, 73, 125, - 366, -458, -2846, 89, -2694, -106, -344, -702, - 809, 451, 69, 585, -1897, 608, -1138, 52, - 618, 106, 771, 2992, 266, 1007, 184, -486, - 36, 3317, -311, 38, 105, -89, 16, 97, - -88, 28, 183, -2834, -44, 387, -49, 467, - -2524, 77, -56, -3727, 81, -308, 63, -137, - 203, -77, 139, 254, -65, -264, -58, 631, - -2559, 739, -1343, 595, -117, -193, -2572, 322, - 267, 185, 669, -110, 641, 212, 45, -16, - 12, 14, -3, -12, 78, -48, -196, -128, - 179, 146, -7348, 177, -138, -48, 142, -33, - 34, -6037, 15, -105, 103, 136, -48, 217, - -169, 88, -31, 9, 24, 41, 1733, -2757, - -335, 1783, 988, -161, 1014, 633, -66, -1114, - 525, -266, 461, 1137, -26, -173, 89, 82, - -3365, 67, -198, -107, 44, 352, -793, 867, - -807, -166, 107, 4, 71, 61, 124, 27, - -2477, 178, -32, -172, 2895, 1301, 798, 707, - 267, -720, -403, 167, -157, 2572, -210, 527, - -312, -1664, -214, -1556, -332, 595, -1634, -58, - 203, -1777, -469, 24, 188, -59, -860, 879, - 15, 855, -1534, 2910, 534, -71, 276, 471, - 41, -25, 105, -37, -150, 110, 226, -277, - -4687, 574, 139, -152, -586, 67, -1082, 261, - -68, 25, -216, 110, 46, -3703, 281, 355, - -506, 80, -218, 164, -398, 75, -97, 5782, - 39, -68, 26, 76, 74, 38, -103, 105, - 44, 116, 187, 288, 90, 5847, -41, 28, - -19, 20, 129, -99, 258, 22, -28, -120, - -101, -121, 79, -180, -23, 22, -5, -60, - 63, 35, -8987, -11, 2, -15, -3, -28, - 47, 29, 241, 132, -166, -259, -48, 102, - 70, 2830, 3163, 285, -813, 0, 105, 176, - -455, 141, 1382, -481, -2282, 2971, -200, -473, - 37, -930, -1162, 930, 890, 412, 190, -160, -}; - -static const int16_t cb2224s0[] = { - -5789, 1229, -138, 1010, 823, -602, -987, -237, - 47, -29, 428, 210, 87, -11, -20, -261, - -3148, 1219, -2074, -132, -258, 707, -634, 878, - -486, 989, -276, -137, -263, 592, 1248, 474, - -293, -981, 2125, -653, -1451, -833, -1522, 387, - -269, 349, 698, 295, 870, 661, 1532, 202, - 654, 362, -1265, 3972, -651, 224, 213, -728, - -83, 575, -503, -766, 559, -657, 86, 941, - 1498, -72, 2297, 1413, -376, 697, -738, 384, - -807, -354, 1141, 374, 1186, -597, 222, 630, - -717, -1653, 106, -1377, -929, 982, -3469, -321, - -201, -1185, -147, -13, 268, 103, 2967, -2083, - -416, 702, 377, -1126, 92, 963, -494, -94, - -436, 1893, 1401, -40, -1464, -1608, 1980, 44, - 254, 676, 529, -891, -95, 9, -172, -129, - 158, -403, -1147, 1026, -410, 86, 2593, -1060, - -621, 480, 254, -780, 691, -1020, 79, -192, - -2264, -1219, -748, 602, 243, 338, 550, -444, - -130, 79, 24, 3396, 124, -572, 749, 976, - 33, -883, -368, -609, 694, -569, -560, 192, - 868, 644, 173, 86, -4302, 633, 7899, -360, - 478, 493, -306, 14, 244, 96, 71, -169, - 336, 346, 74, -52, 1779, 828, -252, 739, - -1005, -755, 31, -46, 200, 581, -11, 802, - 1104, 3252, -1053, 723, -491, -2492, -2330, -245, - 308, -1021, -312, 563, -85, 991, -16, 224, - -85, -957, 2262, -4585, -1475, 102, 310, 298, - -875, -6, -268, 8, -284, 324, -471, -224, - 133, 1502, -1714, -1095, -104, 809, 2584, -273, - -1014, -296, 130, 732, -259, -335, -745, -619, - -716, 247, 503, 862, -277, -137, -224, -4897, - 124, 277, 298, -40, 169, 678, 557, 4379, - 677, -2016, -506, -108, -47, 49, -115, -260, - -300, 206, 1196, -17, 202, 365, -808, -473, - -160, -609, 526, -1124, 1629, -2924, 713, -487, - -109, 540, -511, 221, -394, -1420, 1023, -460, - 424, -86, -875, -1557, -88, -244, -1597, -3015, - 355, 166, 330, -334, -325, 505, 3632, -1760, - 1626, -427, 573, 1197, -317, -566, -663, 460, - 338, -442, -597, 1565, -854, -534, -219, -128, - -2175, 739, 1064, 2050, -61, -349, 361, -375, - 1111, -122, -121, -164, -2573, 938, 1758, -15, - 884, 865, -630, -573, 994, 1112, -26, 9, - -30, 3893, -38, 1386, 605, 568, -680, 117, - 37, 572, 245, -53, -1030, -241, 397, 363, - -1632, -567, -26, -698, -2109, -1033, -1389, 1381, - -418, 402, -534, 9, 1143, 991, 693, 2557, - -1268, 1273, -192, 1225, 876, 472, 835, 509, - -452, -1519, 482, 1103, -626, -299, 1580, -1532, - 599, 2245, 503, -110, -1879, 978, -1158, -130, - -665, 448, -1247, 604, -528, -677, -711, 78, - -563, -349, -53, 261, 952, -338, -534, 43, - -2, -2555, 1976, 2393, 1715, 996, 5628, 1036, - 171, -28, -199, -83, -126, -35, -248, -393, - 36, 209, 77, -1793, 244, -108, -130, -41, - -578, -2347, -687, 1650, 131, -138, 407, -228, - -1348, -209, -841, 1332, -542, 220, -193, 843, - -103, 853, 261, -653, 217, -107, -113, -54, - -4151, -1303, -287, 4065, -376, -71, 43, -1481, - -359, -481, 78, 529, 689, -194, 178, 60, - -997, -1555, 1687, 345, 169, 266, 2894, 83, - -500, -425, -396, -245, 6, 517, 112, 129, - 725, -121, -404, 234, 47, -61, -122, 710, - -4283, 985, 56, -105, -45, 1043, 720, 73, - 321, 4452, -1614, 91, -620, -299, 506, 766, - -882, 650, -138, 123, -608, 210, -1582, -538, - -62, 246, 464, -332, -1560, 2271, 1559, -199, - -832, -1133, -797, 341, 1860, 1628, -1133, -607, - 637, -404, 437, -1148, 542, -474, -882, -610, - -1340, -159, 1524, 1424, 169, -6, 52, 447, - -5513, -592, 244, -294, 44, 164, -51, 147, - 202, -48, 139, 113, -399, -17, -173, -199, - 1, 17, -166, 15, -258, -7, 238, -5748, - -394, -852, -248, -46, 192, -32, -1033, -349, - 151, 483, 130, -1628, -3391, 1527, 694, -305, - 740, -357, -491, -186, -1649, -1394, -873, 213, - 652, -1975, 319, -1131, -103, -48, 673, 155, - -627, 1115, 469, -1122, 1901, -184, -237, -296, - -2887, -120, 211, 835, 57, -826, 1272, -255, - -937, 242, -525, 836, -334, 393, -624, 111, - -347, -178, -3441, 219, -352, 1831, -296, 587, - -357, -1099, 5, 313, -3806, -394, 814, -118, - -233, -23, -125, -21, -1414, 813, -403, 2482, - 442, -184, 934, 340, 472, 374, 1073, -283, - -2348, 477, -387, -713, 1071, -899, 252, -1299, - -502, -375, -410, -1785, 686, -605, -141, -871, - -1777, 2780, 53, -237, -237, 2701, 944, 44, - 595, 3, 1263, -1558, -2267, -998, 221, 355, - -319, -739, -1160, -594, 2977, 191, -41, -284, - 83, 484, 481, -73, -13, 138, -2761, -909, - -578, -139, -1056, 189, -645, -147, -61, -168, - 368, 130, 390, 4187, 101, 79, -45, 451, - -1374, -1941, -534, -301, -979, -668, -533, -2978, - 386, 574, -454, -4, 554, -120, 366, 83, - 1079, -351, 156, 389, 7724, 83, 102, -191, - -1059, -255, -86, 451, -211, 175, 774, 306, - -253, 2386, 1166, -2025, 223, 438, 1279, 1721, - -23, -91, 606, -1285, -775, -3228, -536, 543, - 877, 1140, -1616, -603, 550, -678, -462, 248, - 209, -515, -310, -2538, -2002, 231, -495, 319, - 538, 509, -113, -17, 143, -3062, -29, -52, - 299, 681, 595, 390, 530, -398, -969, 472, - -1145, 860, 4113, 329, -1183, -691, -605, 859, - 305, 986, -81, 2029, 408, 2, -2442, 59, - -85, -911, -285, -532, 28, 434, -2295, -76, - -2977, 51, 824, -1786, 2301, 622, -593, -9, - 643, 246, 427, 193, 51, 118, 4, 234, - 459, 31, -408, 710, -264, 144, -404, -476, - 278, -4836, -113, 382, -29, 177, 345, -33, - -17, -85, 6027, 72, -165, 544, -198, 75, - -278, -262, 155, 501, -305, -279, -439, 1506, - 827, -875, -2592, -1196, -1201, 149, 16, 547, - 1020, -616, 374, -193, -155, -3627, 231, 264, - -2143, 90, 419, 574, -795, 177, 328, 752, - -295, 210, -360, -1250, 2639, -3172, -13, -34, - 489, 484, -390, -159, -285, 27, 444, -252, - 265, 530, -2714, -340, -1543, 2330, -1152, -114, - 452, 304, -224, -451, -317, -579, 301, -567, - 1214, -594, -621, -2718, 59, 257, 410, -3, - 145, 70, 877, -3103, 244, -1134, 236, -1148, -}; - -static const int16_t cb2224s1[] = { - 8488, 277, 63, 173, 224, -30, -158, 64, - 133, -133, 234, 205, -65, 408, 249, -546, - -30, -1, -430, 80, 102, -450, -160, -5634, - 145, -406, -351, 37, 282, 232, -898, 430, - 3301, -1175, -559, 495, 2685, -21, -215, -87, - 728, -55, 235, 430, -250, -505, 506, -128, - -72, 3288, 1588, 291, 7, -39, -944, 478, - 1719, 168, -1085, 225, 330, 1480, -183, -597, - -6131, 668, -387, 672, -173, -55, 113, 40, - -113, -44, 341, -340, -594, -1001, 1757, 127, - -59, 537, -1834, 1401, 856, -1153, -234, 1232, - -562, 476, 110, 2188, 146, 119, 2119, -872, - 450, 597, -371, -1350, -996, -120, -495, 829, - 111, -897, -5445, -670, 390, -118, 4, 109, - 772, 495, 196, 410, -125, 812, 426, 900, - 436, 1155, -553, -1223, 275, 266, -891, 63, - -1267, 523, -548, -2445, 239, 1163, 72, -68, - -1576, 2212, -340, 1499, 494, -671, -73, -281, - 598, 1901, -1652, -845, 266, 795, -545, -574, - 19, -461, 371, 288, -3959, 421, 299, -121, - -2561, -65, 118, 181, -227, 719, -92, -2334, - -3178, -2497, -198, 58, 1279, -309, 152, -715, - 466, -316, 10, 98, 1568, -1015, -18, -435, - -42, 2606, 1971, -119, 705, 254, 443, 36, - 788, 1135, 1234, 2281, 942, 115, 581, -113, - -194, -694, 434, -30, 2835, -423, 436, 522, - 406, 1329, 1191, -2628, 421, -2601, 646, -202, - 637, 610, -584, 357, -1586, -499, -1230, 134, - -83, -1264, 2434, -58, -2924, 641, -285, 172, - -478, -402, 584, -1180, -137, -238, -151, -679, - -619, -495, 1044, 1281, -1180, -444, 376, 1969, - -693, -283, 618, 128, -2622, -90, -115, 672, - 1738, -459, 519, -924, 2582, 937, -555, 672, - 131, 31, 775, 307, -282, -527, -1299, -516, - 10, 239, -4069, 118, 10, -665, -15, -484, - 472, 262, 279, 677, -755, 1288, -1278, 403, - 666, -394, -1230, -2819, -221, 109, 603, 754, - 951, 488, -147, -107, -426, 1875, 2056, -129, - 239, -561, 81, -324, 243, 349, 197, -811, - -146, -929, 1193, 1433, -776, 3209, 434, -6, - 2465, -231, -57, 312, 899, -396, -170, -549, - 346, 135, 17, -596, 401, 269, 499, -64, - -321, -342, -132, -312, 5845, 276, -104, -9, - -50, -678, -478, -1125, -1477, 2058, 156, 538, - 451, 2572, 495, 101, 74, -753, 98, 685, - 2424, -1999, 1050, -280, -1030, 29, -178, -244, - -134, 130, -137, -103, -245, 2161, -446, -1016, - 464, 573, -473, 446, -3822, 942, -1261, -334, - 568, -528, -301, 415, -740, 661, -813, 849, - 1491, 774, -774, 1637, -977, -246, 647, -572, - -140, -2946, -654, -650, -311, 339, -165, 757, - 803, -958, 704, 171, 380, 763, 159, 2721, - -1599, 1006, -118, -597, 2985, 2699, 69, 395, - 523, 657, 438, 190, 72, 164, -268, -145, - 506, -550, 222, -3641, 5, -173, 60, -194, - 677, 686, 724, -107, 882, -339, 14, -54, - 555, 483, 1523, 119, -142, -394, -1683, -984, - 18, -108, -190, 141, 540, 281, -1238, -2195, - -341, -327, -1014, -990, 4694, 46, -1018, 360, - -671, -83, 218, 857, 144, -188, 463, -379, - -571, -865, -1345, -447, -18, -64, 5201, 132, - 90, -158, -132, 381, -85, -107, -103, 970, - -555, -1204, 1802, 1230, 253, 540, -372, -2347, - -386, 835, -705, -437, 941, 795, -182, -368, - 1088, 168, 256, 210, -667, 290, 1783, -636, - 165, -363, 638, -3527, 1872, 1997, 1503, -189, - -2587, -359, 384, 493, -384, -658, -1758, 993, - -306, 148, 198, 163, 430, -313, -149, -337, - 352, -354, 484, 358, -264, -4525, -560, -55, - 154, 374, -317, -426, 1446, -161, -285, -110, - 209, 299, 2329, 99, 1406, 1374, 993, 1178, - -413, -642, -103, 3678, -1829, -754, -1358, -349, - 648, -492, 755, 188, 114, -444, -930, -224, - 319, 212, 1223, -648, 593, 1293, -1289, 24, - -712, 2591, -494, 1503, -9, 534, 923, 1490, - 985, 491, 272, 988, 348, -503, -454, 893, - 409, -422, -1187, 3097, 602, -402, 462, 1598, - -219, 982, 319, 125, 558, -100, -261, 108, - -59, -3435, 76, -1065, -150, -1758, -1997, 1921, - 1239, 426, 507, 173, -856, -829, -538, 247, - -1203, 488, -1094, 453, -1104, 1021, 2185, -2855, - 427, 177, -778, -182, 641, -670, 91, 569, - 50, -90, 571, 108, -374, 174, 1997, 964, - 644, -428, -1868, 668, 171, 320, 676, 121, - -218, 1901, -857, -721, -194, -2433, -34, -1671, - 352, -644, 295, 571, 253, -288, -1786, 32, - 74, -73, -902, -1954, -1126, -3427, 168, -318, - 23, -755, -441, 201, -84, 499, 367, -153, - -426, 716, 650, -457, 80, -709, 859, -2098, - -723, -197, -1030, -253, 283, -1187, -899, 1403, - -117, -25, 7617, -63, -355, -283, -560, -85, - -358, -45, 63, 179, -193, 130, -294, -676, - -525, -907, -430, -627, -5267, -539, 257, 594, - -173, 890, 203, -33, -136, -803, 479, -56, - -634, 464, -919, -146, 306, 5, 198, -90, - -138, -337, 4826, -310, 259, 1651, -687, -1676, - 424, 2729, -966, -61, 386, 60, 769, -72, - -1652, 49, 106, 503, -1462, -1056, 892, 359, - 209, -129, 260, -130, -2081, 798, 488, 846, - -836, -366, 1786, -2237, -484, 72, -2680, -828, - -857, 920, 560, 930, -197, 56, -872, -34, - -355, 929, 35, -449, 514, 70, -1277, 208, - 353, 3654, -256, 134, -895, -184, 375, 402, - 1576, 1515, -100, -438, -679, 384, 1143, -24, - 100, -2818, 554, -219, 105, 652, -2778, -108, - 44, 306, 445, -470, -1151, -1170, 1305, -741, - 1223, -443, -838, 374, -3000, 72, -590, -587, - 3686, 76, -493, 246, 1348, -1215, 473, -244, - -304, 1937, -68, -626, 278, 392, 1167, -1899, - -309, 474, 226, -421, -95, -483, 105, -148, - 749, -430, -3057, -789, -1793, -1857, -158, -489, - -676, -204, 806, -930, -3192, -204, -106, -812, - 1159, 648, 119, -93, -205, -139, 280, -7786, - -388, -132, -12, -332, 32, -174, 100, 153, - -7, 289, -29, -984, -329, -592, 2568, 704, - 544, 66, 521, -661, -1632, -868, -310, 313, - -466, -347, -146, 197, 266, 765, -240, -201, - -265, -1129, -35, -563, -356, 172, 862, 3831, - 1547, -1618, -1445, -3726, 388, 548, -457, 143, - -38, 402, 255, 840, -703, -154, 776, -1038, -}; - -static const int16_t cb2224m0[] = { - -7078, 2846, 79, -111, -20, 330, 227, -36, - 305, 45, 81, 148, -13, 68, 364, -317, - -72, 2021, 28, 93, 328, -256, -181, 2547, - 235, -1102, 130, -577, -164, 1290, 1885, -171, - -147, -3247, 324, -72, -313, -62, 32, 284, - -138, -9, -146, 1709, -390, 1833, 289, 125, - 2369, 60, 223, -137, 642, -113, 204, 288, - -1516, -138, 228, 368, 219, -622, 273, 3211, - -215, -423, 139, 65, 85, -203, -953, 11, - 193, 294, 279, 3267, 246, -2377, -59, -324, - 136, -492, 23, -56, 79, 307, 115, -146, - 2229, 325, -1680, -597, -423, 2200, -44, 48, - 386, 396, -122, -36, 35, 9763, 33, -67, - 19, -34, 15, 41, -25, -30, -61, 20, - -121, 117, -155, -28, -65, -27, 40, 137, - 188, -211, -240, 71, -33, -4873, 1992, 56, - -2701, -1, 151, -96, 286, -398, -418, -221, - 295, -394, -119, -182, -124, 77, 7, -44, - 168, -34, -154, 257, 4, -114, 634, 131, - 4930, -118, -2364, 46, -204, -129, -3168, -138, - -489, 454, -96, 120, -447, 9, -230, 174, - 11359, 456, -261, -74, -249, -28, 149, -79, - -36, 211, -10, 213, -110, 337, -3800, 4, - -223, -18, 136, -290, -155, -235, 57, 447, - -495, -231, -15, -1036, -85, -154, -4421, -19, - -237, -1191, 12, -19, 2, -88, -84, 269, - -7, 431, -26, -2676, -100, 287, -31, -2916, - -160, -83, -198, 9, 183, -279, -68, -23, - -55, 2955, -121, -71, 183, -702, -323, 1689, - -132, 309, 136, -1217, 440, -125, -1671, 1569, - -161, -108, 232, 269, -516, 37, 21, -260, - -230, 564, -375, 224, 129, 4332, -120, 3306, - 153, -25, -260, -84, 123, 21, 5, -17, - -145, -44, 7, -1, 290, -2394, -182, 51, - 933, 1037, 26, 211, 187, -1783, 68, -749, - -52, 1428, -1571, -261, 34, -199, 722, -127, - -118, -114, -2385, 146, -1042, -71, -1475, -150, - -2195, 151, -29, 6, 96, -1213, 282, 219, - 466, 144, -300, 109, -74, 125, 2863, 2, - -2963, -218, 235, 3, 359, 319, 372, -500, - -271, 494, 2695, -65, -29, 47, 74, -34, - -95, -48, -76, -71, -2985, -30, -11, 26, - -176, 107, 96, 22, -60, 114, -70, -147, - -43, 6981, 110, -86, 33, 66, 8, -61, - 52, -169, 82, 233, 56, -115, -295, 241, - -1053, -3914, -79, 361, -869, -144, -144, -805, - 158, -278, 515, 4, -317, 917, -669, 3314, - 253, 1316, 259, 12, 8170, 15, 129, -200, - 120, -11, 34, -77, -13, 257, 79, 9, - 23, 54, 73, 0, -9972, 5, 7, 43, - 29, 4, -104, 43, -36, 76, -228, 1, - -77, -156, -69, -209, 84, -2826, 242, -1461, - -718, -14, 1784, 527, 226, 9852, 83, -15, - -389, 34, 51, -16, -46, -1, 232, 115, - 26, -42, -124, -78, 58, 3092, -2757, -111, - 223, -286, 23, -170, -166, -264, 331, -172, - -49, -26, 166, 2616, 128, 3118, 59, 844, - -121, -504, -193, -53, -95, 282, -21, -8, - -11, 58, -48, 9830, 25, -26, 53, 113, - 96, 125, 12, -64, 185, -31, 19, -251, - -307, -136, 1383, -37, -128, 56, 4303, -232, - -272, 44, -192, 531, -143, -697, -2291, 70, - 229, -432, -592, 1262, 906, -207, 1522, 261, - -7848, -39, -976, 150, 115, -139, 61, -26, - -211, 807, -25, 311, -98, -297, 133, 461, - -109, -6, -1031, 236, -2851, 86, 2184, -254, - -83, -119, 878, -107, -25, 1636, 1696, 1517, - 249, -41, -283, -66, 741, 704, -898, 302, - 470, 360, -7, -6002, 26, 268, -109, 150, - 202, 196, -262, -57, 160, 155, 7, 9, - -5770, 28, 127, 112, -76, -790, 45, -118, - 201, -831, 67, -81, 199, 296, 1692, -30, - -126, -121, 29, 387, 215, 269, -518, -232, - 155, 2735, -235, -82, -33, 3089, -3696, -39, - -51, 124, -220, 37, 51, -129, 194, -80, - 81, 0, -239, -1924, -244, 107, 372, 111, - 206, 418, 39, -118, -2059, -446, 1378, 661, - -2135, 122, -105, 60, 272, -91, -227, 48, - -3226, -88, -109, 199, 566, 158, 2412, -4380, - -177, 153, 252, 24, -323, 264, -116, -12, - -333, 99, -181, -124, 256, -131, -39, -45, - -88, 69, -26, -173, -4820, 286, -171, -82, - 431, 18, -827, -107, 142, 60, 300, 422, - 263, 61, 350, 85, 1088, -133, -1284, 70, - -4577, 5, 114, -23, 23, 2907, 174, 43, - 18, 33, -31, 320, -9, 290, 2, -7, - 39, -11, 52, 32, -4, 8454, 18, 10, - 67, 20, 22, -3, -209, -103, -212, -101, - -101, -420, -2837, -28, 398, 140, 1027, -187, - -2338, 406, -152, -288, 723, -412, -1851, 185, - 641, -190, 107, -7, -3194, -128, -382, 165, - -256, 85, 96, 155, -144, 431, -356, 342, - -2508, -2190, -265, -320, -1345, 27, -1981, -1949, - 95, -78, -456, -359, 382, -218, -102, 164, - 382, 907, 599, 665, 2843, 4275, 17, -156, - -264, 73, 104, -25, -120, 91, 84, 325, - 170, -65, -245, -23, 89, 52, 4651, 124, - 185, 30, 321, 145, 111, -1265, 128, -156, - 64, 24, -1934, 133, -84, -10, 34, 801, - -148, -88, 169, -1687, 419, 1739, -204, -70, - 185, 117, 379, -420, 145, -3650, -264, 1118, - 331, -818, -665, -420, 74, 32, -152, -226, - 6, 216, 4173, 23, 1230, 239, 2, -57, - -690, 516, 90, 58, -24, -61, 175, -2796, - -113, -270, 94, -2319, -158, -1075, -275, -647, - -3839, 37, 4267, 20, -49, -88, 72, -171, - -195, 45, -23, -159, -64, 110, -211, 42, - -211, 1591, 276, -3662, 213, 54, -180, 786, - -92, -329, 382, 344, 165, -63, 14, -7, - 66, 29, 8875, 43, -50, 65, 13, 15, - 48, -40, 114, 125, -27, 158, 3, 843, - 8, -646, 100, -3121, 1720, 88, 898, 346, -}; - -static const int16_t cb2224m1[] = { - 9581, -198, -100, -22, 237, -15, -101, -23, - 46, 129, 63, -143, 5, -307, -143, -9, - 27, 50, 40, 6048, 25, 58, -16, -161, - -109, -157, 137, 115, 121, 164, 4, -54, - 6477, -68, -120, -29, 45, -8, -13, 334, - -87, 105, -1460, 28, -334, -163, -64, -3629, - -71, 176, -195, 53, -1, -96, -560, -21, - 135, 178, -77, -4202, 20, 2544, -205, 85, - -332, 158, 61, -105, 398, -88, 14, 241, - -149, 62, -124, -136, -153, 27, 190, 2595, - 25, -2499, -530, 1809, -104, -2753, 298, 145, - -771, 139, 165, 2462, -502, 860, -174, 199, - 74, 163, -686, -25, 57, -103, -309, -360, - 39, -296, -2765, -319, -950, -678, -1159, -1743, - 1499, 1776, -176, 9, 44, -581, 69, 39, - 162, 326, -96, 329, -9, 1274, -2443, -105, - -50, 4212, -23, 146, -231, -22, -50, -128, - 11, 28, 116, -215, 46, 217, 204, 153, - -73, -156, -100, -31, 2632, -190, -2258, 199, - -1757, 194, 53, 38, -5723, 66, 169, 352, - -39, -150, -1, -462, 41, -98, -110, -40, - -5763, -190, -158, -1380, 205, -227, -402, 81, - -171, 407, -125, -320, -456, -317, 489, 698, - -308, 3989, -172, 402, 196, -457, -1238, -192, - -581, -63, -235, 153, -1094, -53, -45, -86, - 240, -192, -2660, 2356, 153, -60, 277, 33, - 198, -57, 1221, -2984, -327, -326, -48, 61, - 93, -34, -167, -311, 904, 348, 415, 57, - 2000, -77, 238, 40, -3072, -36, 283, -54, - -655, -250, -22, -569, -584, -18, 733, -251, - -72, -28, 80, -306, 211, 188, -149, 4596, - 305, 372, 351, -82, -184, -79, -65, 2688, - 2670, -54, -81, -170, 19, -88, 122, -117, - 33, 51, -29, -113, -2973, 46, -3294, 90, - 8, -180, -227, -62, 43, -25, 187, -380, - -29, -89, 138, -352, 231, 2632, 158, 1993, - -15, 350, 107, -982, -16, -1120, 136, -171, - -42, 2605, -186, 110, 167, 1673, 1140, -29, - -689, 81, 909, -455, 2979, 44, 1, -260, - 26, 28, -90, -568, -123, -175, 232, -38, - 2372, 111, 312, 529, -65, 331, 100, 488, - 12, -596, -497, 2311, -1097, 1242, -94, -2290, - -158, -2651, 16, -232, 3352, 24, -53, -83, - -5, -52, 205, -104, -294, 217, -196, -37, - -7, 0, -28, -45, 60, 13, 41, 111, - 142, -7331, -40, -200, 18, -166, -1266, -47, - -250, -592, -604, 33, 83, -204, -1131, -166, - 1348, -1337, 184, 50, -10066, 30, 24, -184, - 137, 53, 32, 87, -27, 151, 100, 10, - -47, 28, -138, 12, -2977, -376, 58, 168, - 1642, 144, 1039, -399, -807, 5, -1715, 12, - -142, -77, -306, 758, 674, -82, 3216, -369, - 60, 480, 276, -423, 5102, 3325, 169, 47, - 235, 37, 81, -86, -28, -56, -59, -205, - -126, 28, 279, -8433, 137, -26, -409, -19, - 106, -163, -76, -57, 235, 7, 131, -81, - -197, -318, 1281, 310, -2934, 972, -1335, 35, - -308, -93, -128, 433, 527, -193, -1303, 162, - -34, -87, -157, 262, 4999, 25, -311, -349, - 94, -262, 0, -219, 57, 12, -4, 10, - -17, 38, -320, 48, 156, 80, 5880, 48, - 45, 31, -1022, 31, 227, -727, -135, 261, - -21, -688, 307, 3196, 565, 627, -546, 237, - -2367, -33, 1622, -87, 1722, -201, 720, -539, - -288, -1012, 141, -388, -72, -20, -59, -2042, - -53, -101, 208, -233, -835, -16, 3092, 2, - 310, 94, -362, -163, -128, 30, -22, -145, - 420, -1, 322, -524, 2742, -276, 206, -2475, - 575, -653, -342, 1412, 1, 75, -14, 54, - 170, 66, 342, -261, 709, -75, 2240, -134, - 32, 665, 171, -134, 1822, 109, 569, 3129, - 168, -356, 53, 1259, -67, 43, 120, -124, - 2185, 2461, -17, -255, -349, -167, -158, -19, - 84, -732, -972, 286, 87, 4603, -160, 7, - 141, 1, 286, 310, -315, -99, 282, 384, - 68, 93, -1815, 63, -86, 121, -293, 210, - 115, 63, -174, 616, -1848, -124, 1275, 298, - 185, -267, 3516, -105, -162, -253, -434, -674, - -90, -2232, 38, 168, -261, 289, 70, 3714, - 4096, -81, 17, 56, 57, 68, -20, -146, - 28, -152, -17, -97, -131, 2648, 71, -3359, - 40, -277, 313, 85, -26, 41, -202, 76, - 8, -80, -160, -102, -17, 155, 189, 1552, - -3498, -446, -103, -232, -205, -574, -132, 169, - 206, 1689, 1043, -736, -178, -93, -2969, 26, - -251, -148, 139, 70, -325, 117, -3073, 9, - 43, -11, -380, -190, -314, -3012, 50, -330, - -26, 710, 153, 19, -2943, 58, -3052, -56, - 7, 40, 9, 321, -37, -461, -22, -374, - 57, -203, 16, -15, -25, -16, -37, -8, - -41, -116, 7964, 70, -59, 77, 200, 0, - -43, 118, -72, -67, 104, -6, 78, 171, - 13, -103, 793, 98, -4738, -204, 11, 30, - -72, 33, -62, 47, 157, 236, -147, -416, - -726, 578, 5, 4038, 162, -2, 2367, -138, - -185, 470, 3121, 70, 185, -22, -205, 37, - -63, -335, -397, 43, 10, -6557, -112, -254, - 106, -129, -236, 0, -250, 42, -128, 84, - -531, -27, 2259, -282, -21, -70, -408, 19, - -664, 945, -196, -1074, 1369, -40, -3233, 28, - 20, -2133, 125, 343, 113, 584, -14, 50, - -130, -464, 513, 807, -4474, -63, 57, 1120, - 64, -30, 346, 462, 129, 219, -30, 287, - 448, 384, 198, -359, 1097, -256, 828, -2635, - -314, 336, 506, -144, 194, 167, 1323, -273, - -4168, 2805, -118, -8, 136, -82, -212, 53, - -259, -61, 94, 214, 11, 29, -262, -69, - 24, 102, 45, -31, -186, 58, 641, 659, - -172, 3628, -192, -423, 34, 3, 45, 19, - 349, 117, -5, -4923, 99, -148, 180, 631, - 50, -204, 641, -92, 156, -1985, 1077, 201, - 56, -405, 710, -220, -1917, -273, -234, 100, -}; - -static const int16_t cb2224sl0[] = { - -3113, 97, 229, 309, -156, -226, -469, 582, - -3202, -336, 102, 20, 96, -960, 297, -227, - 592, -3352, 2798, -637, -133, 191, -407, 170, - -576, -203, -280, 808, 853, -502, -113, -1704, - -1025, 411, 2802, 233, -568, 360, -616, -1715, - 47, 391, -2117, -458, -291, -149, -82, 26, - -29, -88, -156, 7905, 32, -75, -154, -78, - -44, 155, -1, -338, -891, 170, -75, 155, - 226, -192, -328, -239, -574, -91, 95, -600, - 4271, 25, 990, -207, 4676, 59, -324, 884, - 363, 65, 423, -776, -906, -79, -4, 1475, - 549, -252, 3584, 3543, -409, 282, 278, 125, - -379, 125, -180, -123, -252, -316, -193, 347, - 53, 2009, 195, 152, -104, 233, -75, -546, - 564, -177, 3243, -865, -924, 518, -692, -381, - -1885, -110, -188, 1140, -2043, -438, -1721, 1019, - 1678, 13, 273, -751, 922, -291, -15, 75, - 232, -112, 60, 2702, 88, 175, -119, 43, - -549, -1094, -1879, 401, 1587, 1287, -41, 41, - -116, -23, 313, 168, 147, -101, -57, -115, - -6990, 54, -14, -240, -164, 127, 25, -703, - -361, 769, 1555, -2440, -2616, -192, 86, 769, - -29, -721, 554, -663, 327, 659, -31, -79, - 91, 365, -74, 1268, 115, 480, 3054, -1758, - 1704, 759, -657, -272, -329, 31, -145, -534, - 1265, 73, 435, -54, 480, -867, 2724, 2373, - 890, -314, -112, -2576, -598, 473, 121, 2764, - 1659, 105, 579, -416, -87, 158, 300, 447, - -281, -6109, 35, 217, 185, 56, -357, 151, - 108, -49, -282, -484, -220, -78, -141, 256, - -1095, 1812, -985, 1115, 555, -2116, 2317, -1141, - -792, -866, -119, 187, 615, -194, 73, -43, - 268, 437, 250, -52, 477, -249, -475, -2621, - 590, -2987, -603, -652, 971, -684, 337, -140, - -336, 2342, 390, -204, 295, 85, -44, 321, - 754, 2660, 61, 782, 1654, -76, 2727, 1590, - -1099, 354, 49, 2784, 443, -762, 828, -308, - -493, -755, -370, -336, -207, 388, 630, -127, - 1955, 1929, 1270, 2054, 525, 388, 562, 942, - -789, -453, 158, 995, -99, 2258, -317, -493, - 385, -90, -79, 199, -1187, 519, -254, 179, - 573, 2803, 2341, 407, 95, 515, 332, 1, - -6, -337, 142, -316, 418, 542, 3281, 10, - 604, -542, -1595, 43, 79, 10, 75, -122, - 100, -55, 212, -223, -353, -557, 490, 4870, - -3689, 3594, -145, -192, -47, -252, -380, -180, - -221, 656, 78, -188, 120, 135, -253, -437, - -208, -151, -504, 217, -3715, -150, 528, 121, - -1468, 383, 823, -55, -1167, -8, -198, -515, - -296, -24, 84, 129, -472, 7, 5071, -114, - -200, -16, -271, 59, -430, -142, -315, 90, - 273, -56, 370, 3342, -159, 235, 934, 1605, - -1499, 207, -1650, 1137, 396, -2250, 276, -320, - -317, -23, 276, -519, 163, 566, 366, -6, - 2262, -2035, -662, -3300, -133, -3811, -362, -348, - 113, 146, -79, -298, 238, 221, 99, 194, - 326, 325, -112, -8160, -59, -15, 8, -41, - -261, -20, -6, -68, -140, -41, 167, -125, - 129, 337, 2404, 281, -336, -475, 2085, -2646, - 572, -1308, 376, 114, -506, 1062, -575, -529, - 3347, -212, 520, 274, -163, -3058, -93, -203, - -932, -207, -36, 303, -117, 278, 287, 204, - 205, -228, -242, 227, 3, 611, -190, -458, - -44, -209, 122, -390, -4561, -139, 1378, -329, - 440, 989, -1782, -348, 1241, 967, -477, -2312, - 554, -970, -1103, 473, -771, -50, 150, 327, - 394, -267, -648, -680, 2376, -2543, 276, 1220, - 552, 10, 1399, -1498, -801, 9, 2351, -55, - 155, 327, 88, 864, 428, 179, -3234, 6, - 544, -647, -306, 132, 329, 1147, 1920, 1436, - -2107, -1122, 341, 2020, -432, -97, 117, 793, - 100, -693, 174, 3639, -570, 910, -2771, 231, - -148, -960, -1085, 57, 188, 744, -709, -441, - 533, -295, 1287, 2939, 2987, 885, 611, 700, - 364, -205, -855, -617, 48, -162, -244, -318, - 208, 772, -124, -2505, 454, 330, -220, 335, - -362, -899, -827, 2188, -40, -1638, 356, -160, - -127, 2886, -69, -41, 209, 1847, -236, 2752, - -24, 387, 354, -111, 526, -237, -2169, 1319, - 2211, 144, -348, -434, -319, 1373, 78, 906, - 701, 539, -134, 414, 496, -325, -36, 116, - 124, 4198, -35, -439, -208, -531, -100, 1453, - -175, 723, -908, -461, 87, 127, -91, -125, - -140, 8012, -186, 23, -93, 107, 176, 218, - 35, 193, 174, -27, -4, 77, -103, -199, - 116, -41, -80, 186, -6965, -188, 125, -54, - 43, 9, -49, -192, 69, -136, -24, -117, - -2244, 2289, 145, 226, -1161, -1950, 881, -152, - 1611, 1015, -174, -277, -158, 369, 49, -233, - 221, 275, 69, 108, 136, -124, 1, -470, - 376, 149, -7596, 55, 53, 213, -247, 80, - -217, -11, 189, 125, -17, -141, 165, -2890, - 14, 201, 106, 242, -254, -306, -3157, 459, - -10, 24, -271, 877, 437, -438, 18, -126, - -9, 5553, 63, 22, 55, 172, 21, -335, - 127, 160, 208, 121, 13, 1989, 676, -294, - 2208, -78, 634, -1518, -1037, 1309, 124, -39, - -322, -1420, -404, 377, -35, -14, 178, 110, - -8146, 26, -98, -153, -243, 145, 280, -8, - 29, -57, 85, -309, 281, 282, -47, -27, - 2827, -947, 141, 856, -2481, 406, -638, -362, - -1031, 230, -341, -119, -17, 1, 190, 41, - -15, 5111, 59, 74, 123, -282, -25, -300, - 4, -460, -216, 295, -217, 26, 227, 62, - 385, 748, 2923, 1946, 391, -1676, 599, 148, - -456, -96, 1066, 478, 117, 255, -169, -669, - -1939, -656, 2676, 677, -2020, -1314, 425, -525, - -89, -522, 2707, 153, 5, -207, 244, -1045, - 331, -1315, -82, 449, -2444, 326, -484, -2232, - 2380, -591, -999, -2552, -1581, 349, -440, 217, - 298, -729, -6, -396, -74, 110, -70, -3543, - -388, -51, 596, 126, 295, 2075, -123, -693, - -1072, -1779, -420, 127, 432, -3241, -231, -246, - 105, -437, -67, -119, -2941, -257, 47, -969, - 379, 618, -93, 7, 202, -425, -38, 140, - 458, 3599, 242, -24, -811, -624, -19, 524, - 2398, -300, 111, 376, 2015, 431, 125, 231, - -293, -2379, -634, 1842, -1, -1326, -610, -88, - 128, 80, 75, 30, 172, -235, 34, 206, - -79, 328, 128, -283, -6862, -101, 260, 68, -}; - -static const int16_t cb2224sl1[] = { - -3710, -340, 3183, 200, -124, 423, -417, -432, - 232, -808, 85, -145, 39, 196, -197, -60, - -154, -213, -320, -2941, 993, 3044, -508, 61, - -853, 75, 40, 873, -765, -365, -621, -2670, - 188, 57, -403, -230, -137, 40, 565, -1910, - -1120, -1019, -603, -1927, 150, -3089, 23, -416, - -199, -3265, 15, 128, -525, -531, 91, -39, - 578, -388, 315, 40, 2376, 1762, 2, -1475, - -1774, 111, 934, -459, 777, -582, 114, -218, - -82, -195, 165, 2171, 632, -67, 239, 345, - -257, 104, -34, -879, 488, -422, -2156, -823, - 1940, 699, 2911, -233, -125, -218, -111, -335, - -3475, -61, -71, -445, 249, -330, 102, 376, - -116, 2667, -453, 19, -4129, 90, -507, 236, - 418, 43, 79, 61, 296, 181, 190, 408, - 216, 198, 32, -81, 245, -157, 5555, -162, - 318, 179, 339, -463, -448, -254, -526, -192, - -427, 575, 588, 2792, 2683, -853, -566, 19, - -26, 106, -220, 518, 734, -233, 68, -604, - -231, 256, -187, -59, -405, 206, 331, -25, - -4837, -323, 146, 541, 723, 915, -144, 450, - 102, -371, 27, 88, -80, 276, 239, 101, - 157, -69, -14, 234, -8192, -18, -110, -52, - -8, 48, 79, -43, 153, 187, 211, -118, - -111, 238, 11, -2006, 680, 478, -695, 3078, - -30, 892, -23, 1512, -194, 423, -16, -318, - 895, 406, 634, 47, -3277, -205, -764, 297, - -357, -61, -188, -1547, -868, -174, 342, 261, - 1926, 88, -35, -3250, -20, 3168, -368, 778, - 376, 167, 598, 442, 134, 487, 164, -32, - 245, 436, 2067, 595, -578, 49, -163, 633, - 138, -279, -99, 118, 1141, -3168, 580, -90, - -3192, 551, -663, -2673, -55, 147, 1307, 9, - 15, 432, 307, 527, 1002, -469, -2380, -342, - -293, -73, -259, 410, 309, 76, -320, -161, - 282, -3300, -7, 160, 732, 484, -65, 147, - 2923, 2321, -840, 1933, 268, 684, 1172, -377, - -365, -568, -283, 492, -538, 409, -194, 17, - -297, -52, -123, -270, 161, -94, 92, 4495, - -396, 540, 229, -30, -108, 29, 1, 198, - 492, -572, -394, -2386, 2787, 885, -1175, -129, - -1137, 220, 148, 261, -65, -244, 1, 58, - 195, -49, -290, -94, -21, 105, 71, 6641, - -200, -407, -496, -75, 233, 222, 549, 363, - 188, 739, -869, 122, -355, 3326, 323, -2366, - 115, -3207, 2783, 2015, 148, 924, -153, -133, - -175, -287, 400, 73, -181, -174, 72, 45, - 219, -92, -11, 59, -5407, -362, -188, -120, - 239, 249, 133, -229, 158, 180, -575, -2386, - -354, 248, 532, -590, 615, -85, -69, 394, - 3052, -877, -320, 484, 218, -463, -202, -841, - 1729, 284, 1253, 2193, 526, -2444, -351, 1287, - -373, 387, 440, -203, 163, -153, 206, -57, - -96, 2616, -84, 552, 33, 705, -731, -843, - -2197, -2138, -570, 22, -264, 2143, 725, -132, - -392, 471, -245, 51, 739, -1057, 1049, -760, - 2701, 456, 20, 484, 595, 3248, -1415, -862, - 332, -417, 323, -431, 2082, 78, 684, -169, - 596, -228, -219, 172, 160, -180, -228, -3193, - -520, -100, -447, -629, -2178, -259, -246, -1788, - -2264, 223, 115, -74, 230, -2515, 212, -179, - 456, 209, -2379, -246, -345, -102, -559, 259, - -270, -426, 333, -358, 2866, -589, -1494, -418, - -160, -138, 2088, 683, -1313, 1061, -88, 916, - -148, -2329, -301, -271, -249, 2822, -525, -405, - 592, -322, -1328, -16, 135, -582, -676, -503, - -2162, -327, -237, 361, 166, 600, 1176, 1015, - 97, -5, 465, 2321, -4544, 202, -350, 313, - 149, 544, -420, 552, 183, 351, -1663, 688, - 238, 587, 907, -1719, 1267, -2325, 368, 236, - 296, -2608, 240, 997, 496, 105, 75, -179, - 235, 125, -40, 57, -22, -412, -464, -494, - -81, 576, -3461, -1037, -744, 1358, -856, -284, - -536, 387, -358, 184, -85, 2150, -1142, -124, - 119, 1242, 648, 711, 2161, -591, -1864, -672, - 62, 1879, -13, 55, 285, -167, 142, -130, - 322, 8, -35, -230, 632, -699, 4114, -500, - -189, -48, 2746, 47, 421, -1200, 2418, 460, - -306, 331, 164, -1358, 802, 453, 458, 3594, - 3065, -24, -134, -437, -892, -110, 241, -368, - 336, 673, -147, 130, 154, 89, 81, -341, - 7151, 175, 118, -227, -282, 262, 276, -118, - -118, -245, 7, 144, -87, -136, -146, -484, - 70, 221, -220, -13, -7638, 93, -38, -319, - -478, 26, -28, 281, -180, 182, -186, 90, - 192, 50, -2919, 153, -2651, 289, 47, -783, - 768, 384, 39, 194, -2358, 1242, -1679, 80, - 1292, 28, 682, 2807, 342, 466, 299, -380, - 376, 4466, 12, 553, 153, -447, 733, 99, - 8, -142, 606, -2364, 168, 167, -62, 404, - -3144, 352, 115, -3734, 360, -202, -462, -196, - 464, -412, 192, -363, -413, -405, 254, 357, - -2801, 1054, -1602, 642, -254, -430, -2259, -97, - 16, -311, 757, -64, 412, 339, -227, -216, - -29, 219, 67, 63, 26, -232, -138, -301, - 241, -52, -6118, 223, -379, -157, -221, -201, - -93, -5630, -286, -194, 133, 46, 151, 444, - -472, 103, -115, -259, -53, 673, 1744, -2374, - 359, 2541, 613, -393, 1235, 221, -117, -842, - 1166, 105, -142, 1426, 3, -423, 36, 398, - -2742, 723, -740, 985, 498, 431, -1312, 832, - -1644, 146, -69, -110, 420, -130, 335, 269, - -2865, -67, -88, 50, 2735, 1038, 973, 371, - 654, -169, -112, 579, -319, 2434, -760, 710, - 241, -1889, 39, -1807, -30, 1383, -1080, 449, - 639, -2478, -760, 559, 298, 56, -421, 818, - -442, 1558, -1610, 2136, -12, -11, 592, 73, - 77, -172, 77, 92, -113, 281, 581, -584, - -4448, 507, -195, 183, -508, 312, -724, 1043, - -18, -10, -776, -534, 249, -3178, 904, 1234, - -482, 382, -1040, -448, -579, 227, -82, 5628, - -165, 255, 109, -141, 7, -28, 63, 93, - -211, 0, 162, 581, -153, 5844, -66, 122, - -102, -90, -205, -181, 243, 312, 111, -435, - -105, -343, 272, -141, 6, -98, -16, -73, - -26, -125, -7627, -73, -66, 108, -175, 186, - -189, -102, -240, -37, -354, -260, -120, 30, - 87, 2560, 3157, 369, -662, 338, -503, -66, - -1405, 178, 1100, -683, -2618, 2459, -1291, -248, - -139, -683, -865, 1445, 165, 368, 507, -585, -}; - -static const int16_t cb2224ss0[] = { - -6880, 657, -621, 69, 219, -588, 681, 229, - 248, -302, -110, 734, 12, 253, -454, -890, - -3596, 778, -2600, -256, 529, 332, -69, 295, - -455, 982, -265, -70, -332, -367, 1494, 586, - -158, -1054, 2529, -313, -661, -1302, -2486, 476, - 5, 126, 581, 361, 1618, 650, 2033, 202, - 76, -265, -161, 3659, -800, 1069, -167, -1792, - 389, -580, 597, -268, 621, -1035, 710, 854, - 2004, -785, 2714, 1659, 785, 800, -80, 9, - -341, -1032, 789, 651, 1068, -609, 661, 747, - -928, -999, -1369, -1173, -416, 1596, -2800, 330, - 546, -1275, -746, -392, -529, -378, 3571, -2795, - -731, -183, -330, -1591, 371, 866, 323, -516, - -89, 2277, 1593, 960, -1726, -2229, 727, -415, - 189, 500, -145, -177, 550, 467, 240, 1131, - 474, -419, -1236, 674, -616, -519, 2439, -1213, - -650, 867, 974, -908, 1229, -512, 932, -495, - -2521, -865, -466, 8, -426, 912, -77, -236, - -407, 433, 128, 3653, 854, 243, 770, 191, - 224, -68, -453, -383, 279, -701, -691, 282, - -449, 1148, -783, 241, -5021, 643, 8113, -345, - 13, 90, -57, 475, 64, -268, -163, -100, - -95, 518, 577, 541, 2055, 358, -157, 360, - 280, -840, -1161, 500, 95, 302, -662, 1134, - 827, 3300, 695, 775, -798, -2651, -2891, -1123, - 555, -1125, 156, 328, 671, 751, -347, -972, - -392, -1216, 2725, -5152, -402, -15, 150, 31, - -182, -278, 245, 81, -3, -46, 310, -72, - -138, 1511, -1762, -1840, -364, 123, 2801, -16, - -543, -1312, 562, -262, 148, 521, -711, 61, - -863, 145, 329, 761, 76, -155, 101, -4986, - 192, 269, -364, -174, 640, -261, 629, 3638, - 397, -1757, -1177, 342, 388, 1089, 824, 115, - 150, 125, 806, 1271, -198, 800, -175, -897, - -649, -837, 690, -755, 1416, -2347, 1179, -781, - 826, 1567, -148, -156, -1036, -1572, 1248, -187, - 464, -260, -749, -1070, 85, -466, -2160, -2802, - 233, -181, 447, -482, 113, 548, 2957, -1600, - 1341, -559, 803, 2085, -807, -711, -1169, -456, - 657, -76, -147, 1932, -1054, -967, -1100, -49, - -2829, 1412, 929, 1207, 58, -146, 77, -458, - 538, -627, -12, 214, -2397, 692, 1284, 366, - 1286, 1997, -856, 267, 1866, 1236, 25, 254, - -1187, 3456, 283, 584, 2348, 604, -1130, 7, - 500, 232, -51, 120, -695, -930, 317, 67, - -1346, -500, 312, -1060, -2338, -1860, -1491, 1539, - -1707, 778, -653, -41, 401, 311, -13, 2155, - -1011, 1163, 712, 2090, 1336, -726, 574, 1200, - -1254, -1567, 723, 683, -877, -653, 1137, -1594, - 1127, 2641, 465, 259, -2095, 696, -405, 40, - -259, -808, -942, 395, -180, -1119, -966, -230, - -534, -114, 88, -661, 757, 75, -286, -119, - 924, -2925, 2483, 1662, 1823, 590, 4307, 810, - 447, 165, 243, -184, -162, 436, -126, -194, - 365, 601, -354, -1983, -211, -663, 276, 155, - -696, -2542, -830, 2374, -235, -585, -469, -478, - 21, 867, -1633, 1949, -949, -330, -546, 328, - -224, 1236, 266, -1117, 36, -61, 221, 153, - -3491, -1463, -237, 4676, -241, 273, 268, 347, - -393, -277, 168, 426, 155, -65, -605, -569, - -1416, -1303, 1248, 595, -148, 512, 3622, 291, - -444, -523, 616, 105, 101, 1357, 772, -337, - 494, 570, 15, 150, -400, 572, 590, 1674, - -4106, 940, 167, -327, -336, 696, 591, 362, - 279, 4489, -1325, 608, 294, -41, 549, 982, - -31, -184, 367, 77, -466, 398, -1928, -607, - 239, 55, 15, 1031, -486, 2788, 2151, -519, - -1197, -1144, 274, 671, 1620, 2079, -1555, -961, - 543, -11, 26, -627, 777, -581, -1060, -1177, - -808, 807, 2863, 607, 144, 195, -274, 18, - -5656, -355, -1026, 56, 116, -431, -493, 517, - 286, 353, 353, 199, -651, -863, -276, -556, - -562, -867, -143, -355, -323, -14, -54, -5354, - -43, -1592, 8, -543, 24, 94, -731, -545, - 705, -171, 504, -1078, -3367, 1349, 452, -148, - 1183, -1650, -1400, -246, -1032, -119, -309, -566, - 998, -3240, -444, -658, -605, -186, 491, 439, - -190, 688, -29, -965, 2562, -112, -329, -25, - -2593, 355, -53, 692, 12, -593, 1930, -804, - -82, 386, -632, 927, 1006, -229, -1147, -181, - -1075, -245, -3678, 904, -298, 2263, 50, 563, - 337, -1051, 173, 310, -3540, -615, -504, 749, - 192, -90, -113, -730, -1994, 802, -45, 2234, - 167, 289, 1722, -562, 682, 453, 1571, 171, - -2429, -441, -230, -1144, 985, -1602, 358, -685, - -23, -523, -529, -2438, 700, -624, 37, -1475, - -1318, 3292, 702, 394, -798, 2563, 1057, -335, - 614, 270, 3135, -1281, -2089, -250, -140, 45, - -517, -470, -1429, -172, 2637, 267, 55, -1037, - -174, 912, -865, -786, -406, 537, -2805, -642, - -1599, 888, -1044, -175, 312, 28, -1157, -240, - -181, 298, 521, 3802, -87, 93, 48, 1336, - -1071, -1870, 339, -1106, -944, -1036, 361, -3719, - -147, 625, 326, -122, 407, -217, 396, 273, - -2, -315, -262, 632, 6868, 228, -267, 207, - -29, -274, 192, 63, -353, 588, 550, -3, - 156, 2115, 1580, -2366, 306, 633, 1354, 2313, - -360, -345, 270, -499, -976, -3685, -1305, 907, - 1431, 1545, -1334, 18, 1159, 229, -124, 157, - 470, -105, 700, -1786, -1895, 795, -1052, -278, - 745, -111, -45, 694, 599, -3469, 552, -70, - -222, 45, 896, -251, 1, 250, -769, 301, - -1151, 1313, 4314, 710, 680, -169, -663, 40, - 399, 1171, 581, 775, 936, -488, -2918, 155, - -169, -1560, -862, -473, 783, -72, -1791, 567, - -2109, -156, 1250, -1486, 3253, 61, -50, -374, - -277, 942, 111, 607, -316, 197, -748, 871, - 612, -242, -296, 53, -193, 1233, 11, -962, - 505, -4492, 21, 754, -150, 451, 183, 881, - -652, -159, 6384, 170, 271, 1035, 401, 48, - -463, -240, -95, -625, 613, -91, -1138, 1172, - 542, -1483, -2638, -1396, -1173, 612, 512, 1355, - 977, -362, -22, -17, 124, -3178, -532, 352, - -2691, 610, 569, 740, -1603, -5, -492, 704, - -436, -96, -595, -1495, 2730, -3089, -164, 565, - 1300, -477, -569, 1069, 294, -233, -133, 708, - 150, 388, -2108, -1042, -1603, 2275, -1722, 561, - 140, 507, -899, -281, 162, -1297, 1504, -158, - 193, -730, -944, -2484, 615, -30, 32, -354, - -383, 86, 329, -3434, -382, -1604, -299, 208, -}; - -static const int16_t cb2224ss1[] = { - 8192, -187, -471, -201, 185, -465, 976, 257, - 83, -530, 310, 676, 341, 48, 265, -351, - 306, 280, 302, 48, 496, -339, 424, -5250, - -253, 604, -317, -289, 278, 573, -579, 79, - 3218, -574, -377, 276, 2831, -287, -254, 332, - -225, 42, 162, -457, -959, -1421, 683, -59, - -33, 3362, 393, 606, 249, -873, -930, 1224, - 1469, 37, -1592, 1665, -582, 1729, 284, 106, - -4753, -120, -475, 867, -444, -203, 431, -11, - -526, -324, 732, -1070, -160, -611, 1808, -297, - -536, -194, -822, 1224, 2220, -2330, 72, 1004, - -787, -149, 557, 2925, 29, 809, 2397, -1143, - 648, 904, -568, -707, -839, -274, -1322, 1177, - -467, -482, -5181, 234, 223, 354, 386, 737, - 1273, 234, -353, 31, -8, -392, 85, -234, - 1366, 1449, 120, -695, 838, -622, -96, 382, - -1421, 612, -173, -3199, -150, 474, -394, -561, - -1171, 2541, -271, 2513, 670, 285, 636, -452, - -202, 1319, -2182, -935, -586, 243, -813, -41, - -53, -1041, 212, 58, -3424, 111, 268, 964, - -3231, -500, 867, -191, 207, 543, 383, -1509, - -2712, -2752, 201, 428, 721, 498, 19, -747, - 67, 87, 500, 1200, 2244, -1158, 466, -1032, - -153, 1197, 2737, -324, 2002, -338, 89, -428, - 78, 575, 330, 2013, 175, 305, 567, -539, - 17, 384, 485, 860, 3330, 173, 586, 649, - 388, 963, 1820, -2610, 251, -2966, 1383, -153, - -146, 564, -718, 998, -1283, -566, -619, 394, - 459, -1233, 2566, -357, -2601, 98, -929, -367, - -501, 96, 1217, -1695, -324, 393, 261, 1745, - -1095, -751, 924, 1044, -337, -1243, 393, 2454, - -1499, -245, 902, 925, -2126, 167, 838, 638, - 2296, -294, 306, -715, 2794, 1522, -339, 21, - 318, -95, 1334, 75, -173, -91, -2012, -920, - -801, 334, -3363, -348, 550, -911, -261, -1073, - 185, -425, 431, 515, -339, 1817, -1589, 241, - 548, -337, -471, -3532, -1166, 888, 141, -277, - 1353, 310, -654, 198, -516, 2951, 2251, -534, - 701, 237, 20, -597, -301, 3, 410, -456, - -581, -1254, 1052, 1321, 165, 3108, 477, 196, - 2716, 85, 5, -34, 721, -562, 4, 84, - -793, 744, 243, 134, -385, -129, -122, -128, - -333, -483, -604, 269, 6209, 3, 515, -63, - -634, -551, -795, -1696, -2210, 2184, 348, 30, - 413, 2531, 214, 214, -186, -72, -552, 958, - 1727, -1639, 618, -61, -432, 365, -753, 15, - -14, 33, 976, -940, -355, 3318, 677, -1938, - 21, 881, -326, -83, -3355, 1483, -1211, -674, - 166, 139, -276, 158, -736, 1038, -1005, 1129, - 1219, 1115, -392, 558, 96, -188, 314, 536, - -423, -3262, 395, -130, 1099, 304, -181, 853, - -160, -1272, 428, -179, 634, 608, -173, 2690, - -2191, 1385, -518, -416, 3239, 3250, 313, -23, - 200, 643, -639, -17, -208, 27, -182, 262, - -203, -671, 157, -4131, 383, -404, 337, 51, - 431, 92, 138, -438, 29, 337, 488, -252, - 656, 509, 2037, -635, -1074, -1115, -2135, -772, - -386, -214, -654, -441, 1661, 542, -383, -1720, - 22, -103, -1474, -1288, 4361, 282, -1252, 734, - -858, -556, 294, 243, 293, 133, 848, 65, - -727, -887, -1314, 443, -96, -422, 4268, 672, - 142, 608, -442, 843, 365, -866, -157, 780, - 107, -888, 2089, 1769, 73, 739, -15, -1730, - -1235, 920, -1713, 163, 552, 1479, -692, -755, - 1430, -193, -276, -264, -690, 772, 1403, -40, - 679, -260, 642, -3562, 962, 2053, 1348, 36, - -2974, 155, 303, 821, -944, -179, -967, 632, - -725, 411, -447, -463, 694, -337, -146, 59, - -1, -416, 12, 524, -497, -4682, -745, 625, - 1011, 20, -462, -503, 2012, -475, -27, 85, - -1190, 534, 2250, 87, 2591, 1195, 1665, 423, - -813, -571, -372, 2601, -2013, -853, -734, -403, - 793, -549, 1243, 312, 722, -1013, -1434, -749, - -571, 494, -88, -129, 1331, 806, -1227, 326, - -1164, 2487, -59, 2346, 583, 519, 368, 793, - 1178, 661, 140, 1226, 378, -429, -1214, 1438, - -319, -77, -1495, 3598, 361, 21, 39, 1930, - 198, 1050, 531, 274, 32, -499, -349, -5, - -133, -3324, -379, -742, -250, -1618, -1536, 2084, - 1369, 765, -132, -324, 406, -2198, 314, 502, - -1431, 759, -729, 320, -2120, 1484, 2468, -3283, - 4, 272, -2, 492, 91, -803, 48, 691, - 375, 87, -508, -725, -632, 268, 2929, 1302, - -11, -628, -2225, 723, 533, 909, 934, 682, - 350, 1509, -707, -1142, 106, -2174, 342, -965, - 456, -655, 1137, -553, 415, -418, -2631, -121, - 237, 3, -1123, -1555, -1413, -3333, 717, 115, - -1030, -1007, -819, 130, -851, 281, -43, -473, - -1091, 326, 869, -377, 278, -148, 418, -2104, - -422, 623, -1777, 633, 1033, -2031, -1221, 4126, - -60, -16, 8025, 243, -340, -599, -501, -289, - -219, -104, -230, 464, 191, 18, 345, -65, - -68, -481, 625, -822, -4011, -516, 741, 734, - -316, 530, 122, 945, 371, -298, 1194, -250, - -167, 392, -95, -151, -1, -486, 189, 90, - -140, 30, 4485, 581, 54, 1905, -895, -2032, - -174, 2473, -688, -104, -315, -376, 830, 296, - -548, 754, 195, -901, -1548, -1931, 792, 510, - 294, 153, 619, -1034, -3038, 1134, 142, -29, - -806, -118, -29, -2314, -159, 770, -2899, 23, - -1045, 1037, 1496, 1104, -527, 135, -281, -310, - -59, 202, -346, -612, 206, 27, -456, 758, - 67, 3547, 867, 227, -3, 573, 1440, 421, - 170, 1491, -691, -43, -8, 784, 307, 557, - 618, -2387, 566, -396, 182, 877, -2666, -163, - 553, -155, 691, -188, -1584, -1085, 1033, -308, - 1356, -570, -721, -232, -3145, 104, 511, -964, - 2783, -685, -168, -51, 1554, -1816, 2431, 327, - -440, 1174, -265, -36, 120, -397, 1094, -1254, - -973, 574, 1085, -139, -751, -529, -240, 25, - 1137, -467, -3471, 338, -806, -2028, 94, -98, - -336, -537, 1189, -880, -3607, -168, -59, 100, - 309, 1097, 295, 262, 106, -8, 210, -7461, - 395, -248, 461, 490, -326, 264, 105, 13, - -160, 608, -443, -1331, 835, -1342, 3507, 763, - 966, 101, 1047, -469, -1455, -1080, 28, 99, - -44, 270, -752, 130, 2, 57, 358, -409, - 2, -658, -812, -899, 155, 141, 2101, 3616, - 40, -1957, -1028, -4137, 212, 1580, 578, 1019, - -512, 167, 366, -580, 448, 216, 79, -149, -}; - -static const int16_t cb2224sm0[] = { - -4334, 1434, -228, 1477, -1329, 230, 686, -558, - 486, -188, 424, -454, -568, -141, -326, -132, - -39, 2488, 9, 631, 513, 460, -417, 2656, - 633, -1404, -81, -283, -287, 480, 2558, -19, - -158, -2699, 405, 276, -639, -151, 529, 241, - -941, -796, -213, 1125, -391, 2515, 78, -177, - 2677, 217, 955, -687, 867, -485, -121, 1023, - -1572, -591, 139, 798, 1262, -467, 722, 2643, - -237, -1048, 386, -432, 180, -788, -178, 234, - 403, 267, 312, 2661, 585, -2775, -686, -88, - -16, -1243, -445, -259, 303, 298, 285, 277, - 2355, 163, -2399, -416, 115, 2277, -707, 194, - 283, 1183, 23, 119, 97, 8192, -40, 67, - -101, 151, 169, 21, -147, -160, 55, -207, - 550, -36, -500, -32, 225, 206, 72, 179, - 464, -406, 52, 696, -18, -4827, 1547, -516, - -2275, 855, 430, -523, 83, -1633, -1898, 285, - 202, -645, -167, 102, -124, 382, 24, 236, - 830, 324, -84, 491, -95, -154, 767, 25, - 4741, -574, -2576, -297, -250, -346, -2867, -64, - -1119, 1007, -883, 457, -328, -854, -981, -55, - 6922, 569, -307, 261, -100, -832, 129, 416, - -154, 681, -136, 1152, -144, -26, -2266, -320, - -141, -897, 544, -206, 845, -590, 88, 211, - -1761, -574, -653, -2788, 252, -266, -4252, 295, - 97, -2112, 209, -144, 655, -89, -369, 591, - 205, 1137, 30, -2907, 88, 92, -240, -3106, - -16, -398, -576, -720, 421, 427, -423, -195, - -18, 2503, -133, -918, 104, -512, -489, 2623, - -314, 215, -103, -1014, 761, 382, -1456, 1719, - -980, 248, 55, 644, -1945, 42, -162, -35, - -852, 1993, -189, 664, -149, 3132, -50, 3438, - 550, -234, -566, 434, 64, 379, -169, -291, - -718, -608, 31, -207, 651, -2567, -790, 906, - 518, 1740, 373, 1158, 114, -2044, 285, -1136, - -373, 932, -2185, -488, 148, 3, 724, 623, - -568, -359, -2748, 751, -1098, -858, -1140, -253, - -2377, -402, -312, -398, -47, -2618, 816, -568, - 1274, -158, 118, 107, 181, 394, 2758, 80, - -3057, 20, -279, 110, 482, 1010, -162, -1081, - -56, 685, 2207, -10, 82, 440, 593, 43, - 1010, -853, -624, 288, -3045, -426, 9, 132, - 104, 157, 466, -118, 116, 226, -214, -219, - 299, 6093, 122, 7, 174, 444, 200, -42, - -4, -313, 99, 218, 292, -159, -409, 523, - -1357, -4098, -96, 968, 8, -172, -444, -1040, - 755, -476, 967, 175, -100, 1689, -813, 3175, - 369, 1828, 248, -161, 6693, 631, 536, -125, - 274, -467, 259, -427, 130, -523, 361, 584, - 27, 60, -57, -30, -8192, 148, -64, 217, - -308, 163, -116, 89, 108, 191, -129, -149, - 128, 60, 575, 253, -385, -2937, 888, -1402, - -543, -607, 2639, 156, 251, 6966, -147, -382, - -388, 39, 476, 260, -1048, 575, 401, -245, - -441, 121, 389, -666, 95, 2919, -2212, -765, - 169, -161, 184, -320, -315, -497, 136, -470, - 479, -541, 712, 2966, 519, 2595, -77, 1089, - 18, -697, -616, 241, -54, 388, 461, 368, - 144, -149, 181, 7699, 11, 3, -368, 65, - 304, 358, -29, 255, -162, -169, -470, -16, - 198, 92, 2137, 233, 273, 255, 4078, -279, - -194, -274, 101, 45, -225, -716, -2522, -188, - 10, -590, -745, 894, 1976, -48, 2302, -4, - -4691, -67, -1325, -506, 605, -297, 317, -271, - -176, 1706, 541, 1, 31, -580, 103, 148, - -122, -141, -849, 76, -3094, -67, 2775, -38, - -598, -314, 793, 40, 324, 1474, 1986, 1505, - 832, -504, 739, -1233, 1201, 695, -1363, 670, - 805, 696, -137, -4977, -306, 137, -885, 455, - 1021, 600, -1711, 536, 235, -149, 31, -5, - -3747, -405, 394, 140, 102, -1576, 190, 408, - 663, -2075, -747, 466, 631, 807, 1867, -655, - 102, 341, 435, 551, 500, 426, -650, -88, - -26, 2672, -1791, 34, -86, 2963, -3330, -793, - -307, 277, -584, -240, -141, 258, 708, -242, - -499, 808, -104, -2061, -518, 684, 889, 406, - 259, 211, 462, 428, -2597, -1147, 1729, 683, - -2173, -167, 392, 440, 599, -815, -624, -368, - -2962, -172, 845, 423, 362, 711, 2131, -3899, - 84, 147, 826, -399, -637, 1132, 108, -480, - 230, 265, -423, 48, 11, 239, -599, -281, - 10, 541, -397, 142, -4322, 1172, -257, -101, - 292, -321, -401, 60, -309, 468, 267, 611, - 438, -638, 2194, 346, 1421, -1192, -3109, -170, - -3336, -49, -69, -75, 184, 3094, 591, 82, - -373, 140, -22, 848, 124, 589, 157, -4, - 260, -177, 147, 73, -284, 6253, 111, 302, - -74, 356, 381, -547, -16, -275, -500, 93, - 344, -346, -2837, 364, -43, -592, 1741, -702, - -2247, 848, -203, 168, 758, -849, -2454, 562, - 1104, -169, 463, -398, -2759, -299, -903, 647, - -62, -124, 301, 337, -201, 463, -86, -139, - -2189, -2424, -942, -376, -2043, -80, -1791, -1580, - 513, 29, -1115, -582, 1214, -642, 355, 240, - 285, 1759, 1209, 862, 1707, 3353, -223, 245, - -515, -928, 794, -190, -282, 1097, -32, 1675, - 857, -730, -15, 102, 356, -309, 3867, 24, - 93, 899, -608, -497, -215, -2244, 735, -194, - 102, -51, -1939, 846, 74, -116, 7, 1981, - 512, 233, 574, -2508, 83, 1966, -251, -96, - 532, 97, 897, -1120, 390, -3192, -652, 2045, - 193, -880, -398, -148, 548, -281, -19, -987, - 467, -326, 2777, 195, 1560, 1034, -828, 102, - -1531, 1292, -126, 539, -247, 36, 55, -2487, - -297, -362, 482, -2241, -1021, -1535, -244, 38, - -3416, 141, 3408, 35, -67, 95, 333, -427, - -235, -128, 304, -548, 337, -349, -330, 23, - -450, 1657, 327, -3087, 695, -273, -1090, 1262, - -111, -868, 1516, 269, 119, 192, 14, 200, - 141, -395, 7145, 48, 334, 143, -139, 154, - -102, -312, -2, 283, 238, -30, 626, 1328, - 242, -416, 442, -3050, 1388, -100, 1215, 817, -}; - -static const int16_t cb2224sm1[] = { - 8192, -13, 346, -52, 5, 131, -294, -167, - -65, -347, -438, -559, 57, -86, -223, -224, - -251, 629, -58, 5249, 127, -464, 644, 210, - -154, -480, 165, 211, 13, 318, 152, -173, - 5451, 235, 170, -100, -6, -460, -249, 390, - 54, 993, -1637, -288, -978, -197, 234, -2877, - -570, -151, -82, 772, 199, -385, -1899, 345, - -25, 527, -477, -2918, 385, 2784, 78, -524, - -759, 795, 433, 511, 856, -275, 511, 136, - -444, 151, 233, 208, -589, -375, 282, 2886, - 30, -2749, -930, 1079, 86, -2285, 980, -229, - -1369, 93, -80, 2314, -170, 1224, 397, 405, - 463, 1014, -377, -90, -269, -82, -376, -773, - 684, -94, -2893, -323, -644, -849, -1892, -2244, - 417, 2165, -164, 221, 454, -2337, 142, 99, - 418, 486, -49, 97, 138, 2221, -2301, -156, - -578, 3963, 196, 140, -374, 180, 451, 354, - -952, 946, -479, -874, -159, 145, 290, 240, - -240, -233, -418, 226, 2878, -571, -2491, 741, - -1438, 557, 197, -370, -4720, 379, 32, 821, - 39, -545, -141, -1507, 192, -1150, 905, -1095, - -5028, -169, 533, -23, 371, 162, -1198, 465, - -369, -14, -861, -656, -701, -296, 31, 450, - -387, 3060, -696, 597, 14, -1019, -2741, -208, - -1186, -338, 712, -64, -344, 41, 327, 9, - 576, -349, -2808, 2428, 433, -566, 908, -108, - -145, -1011, 201, -3042, -327, 210, -368, 230, - -310, -400, 12, -1034, 1734, 992, 1842, 1022, - 2162, 588, 366, 154, -3078, -587, 1096, 215, - -1072, -784, 472, -1089, 94, 487, 18, 72, - 34, -15, -374, -607, 316, 830, -146, 4377, - -301, 390, 838, 121, -110, -143, -93, 2988, - 2914, -352, -353, -744, -115, 99, 495, -343, - 309, 1261, -519, 101, -2662, -44, -3139, -491, - 1142, -323, -50, 776, 86, 187, 480, 271, - -167, 1, -267, -99, 991, 2492, -152, 2423, - -225, 34, 576, -1486, -236, -375, 160, -176, - -145, 2525, -131, 194, 317, 1215, 1553, 295, - -1408, 130, 2279, -1185, 2671, -137, -324, -23, - 26, -779, -431, -4, 488, -186, 174, -119, - 3062, -149, -168, 191, 169, 1124, 301, 1471, - -409, -999, -166, 2174, -1405, 992, -179, -2606, - -71, -3151, 92, -976, 3091, -322, 310, -374, - -779, 599, -55, 425, -697, 63, 27, -38, - 86, 170, -11, -616, -97, 525, 78, 14, - 684, -5556, -308, -444, 266, -396, -1665, 86, - -722, -1087, -921, -525, 3, -439, -1600, -37, - 2038, -2672, -187, 361, -8192, 425, 365, 54, - 343, -703, 253, 284, -57, -327, -154, 392, - 99, -181, 213, 395, -2412, -303, 182, 82, - 2311, 45, 1801, -209, -988, 42, -1430, 38, - -721, 118, -163, 1279, 2184, -18, 2851, 274, - -363, 297, 150, -220, 3653, 3135, -381, 335, - 254, 378, -52, 52, 328, -383, -61, -802, - -409, -49, 49, -8192, 362, -48, -430, -54, - 255, 243, -525, 14, 152, 10, -392, -301, - -594, -539, 1200, 626, -2979, 233, -1504, 664, - -728, -1293, -491, 394, 1317, 298, 169, 214, - -429, -1083, 42, 389, 4751, 510, 299, -542, - 456, -852, 30, 208, -63, -131, 72, -425, - 73, 213, -287, -277, 43, 128, 5528, 165, - -316, -135, -576, -583, 217, -1298, 47, 134, - 103, -1894, 148, 3406, 880, 964, -697, -94, - -1626, 223, 1256, -514, 2079, -529, 1917, -1452, - -616, -605, 385, -963, 395, 105, -154, -1627, - -214, 40, 969, -708, -1492, -824, 2457, 275, - 404, 876, -781, -1029, 34, 72, 229, -137, - 264, -387, 305, -57, 2908, -143, -249, -2473, - 202, -1467, -364, 2094, -521, -70, 260, 132, - 465, 71, 982, -36, 1792, 306, 2907, -55, - 254, 421, 231, 140, 1727, 474, 761, 3153, - -18, -356, 414, 2218, 564, -247, -510, 67, - 2390, 2531, 240, 117, -487, -310, 261, 222, - -286, -861, -2180, 480, -75, 4769, -407, 248, - 227, -224, 302, 901, -1200, -728, 1025, 734, - -336, 115, -1726, -179, 131, 43, -357, 364, - -681, 283, -189, 715, -2793, -692, 1367, 916, - 28, -500, 3094, -543, -627, -709, -506, -1094, - 34, -2464, 434, 257, 357, 10, -390, 3206, - 3483, 137, 147, 180, 231, -260, -707, -818, - 476, -528, 656, 824, -8, 3073, 362, -3034, - -199, 47, 694, -252, 819, -147, -479, -32, - 530, -141, -91, 251, -154, 376, -603, 2305, - -2853, -622, 316, -680, 402, -819, 323, 471, - -47, 1772, 1507, -1052, -685, 18, -2509, -418, - 377, -31, -412, 105, -906, -267, -2806, -189, - -97, 198, -802, -82, -658, -2980, 795, -447, - 646, 1037, 486, -689, -2654, 55, -3534, 540, - -68, 502, -90, 277, -87, -497, 24, -246, - 400, 392, 348, 76, -345, -231, -71, 155, - -7, -226, 6553, 371, 261, -290, 88, -44, - 311, 470, -5, 182, -105, 56, -324, 267, - 241, 327, 966, 218, -4695, -968, 27, -352, - -315, 202, -204, 435, 360, -539, -375, -527, - -1157, 1010, -241, 4171, -292, 66, 2343, 310, - -682, 595, 3040, 539, -118, -573, -128, 952, - -172, -547, -285, -1, 345, -5701, 345, -153, - 77, 349, -225, -364, -655, -270, -716, -825, - 27, 55, 2179, -154, -275, 359, -501, -992, - -665, 1538, -218, -1159, 2176, -845, -3018, 105, - -459, -3146, 67, -197, -293, 539, 115, -74, - 119, -158, -89, 1449, -3006, 104, 651, 886, - -310, -242, 1219, 1805, 176, 2235, 579, 294, - 634, 1345, -1, -454, 755, -1030, 1760, -2404, - -406, 894, 614, -74, 113, -1325, 1843, -392, - -3239, 2440, -54, 222, 1349, -695, -1009, 434, - -468, -509, -280, 462, 228, 573, 213, 55, - 325, 557, 100, -721, -674, 600, 795, 1567, - 407, 3273, -58, -1330, 349, -181, 417, -503, - 911, 350, -681, -4502, -127, -26, 330, 618, - 241, -147, 284, -226, -127, -2692, 484, -146, - -18, -416, 755, 85, -3119, -404, 0, -478, -}; - -static const int16_t cb4432l0[] = { - -3764, -227, 184, -258, -1713, 122, 410, -32, - -244, -1337, -328, -20, -236, -359, -13, -52, - -75, -260, 426, -96, -37, -38, 117, -938, - 487, 60, 286, 571, 368, -551, 198, -102, - 15, -11, 4535, -127, -241, 114, -77, -316, - 302, 195, -149, -73, 357, -128, -23, 34, - 319, -97, 189, 5918, -20, -134, -47, -249, - 7, 3, 116, 7, 48, 47, 92, 19, - 14, 31, -388, -329, -1878, -944, 958, 632, - 1973, 182, -130, -193, 2309, -868, 63, 260, - -12, -89, -88, -208, 127, -168, 237, 74, - 1153, 925, 2292, 2992, -35, 204, 766, -930, - -87, 341, -101, 501, 35, -182, 112, 91, - -28, 79, 193, -73, -71, 52, 82, -427, - -147, -69, 4722, 468, -187, 98, -295, 292, - -991, 43, 98, 225, -555, -595, -66, -181, - 91, -152, -3, 89, -219, 356, -375, -114, - -1546, -620, 648, 1946, 39, -608, -942, 103, - 179, 170, -2350, 157, 1132, -944, -283, 64, - -393, 15, -90, 761, -185, 644, -360, 5, - -5212, 106, -136, -40, -159, -40, -120, -43, - -8, -195, 208, -179, -295, -63, 19, 32, - -104, -23, 132, 660, -460, 237, 523, -676, - -378, -81, -184, 2718, 64, 531, 2119, -1564, - 614, 933, 6, 65, -50, 55, 243, -539, - 1168, 953, -283, 45, 476, -346, 2285, 1892, - 615, -521, 23, -2079, 57, -11, 208, 1029, - 371, 28, 170, -63, -167, 184, -217, 76, - -320, -2747, 542, -2098, -407, -10, -876, -1477, - -306, 565, 57, -49, -111, 185, -250, 120, - -186, 214, -520, 463, 792, -2420, 2760, -383, - -783, -1097, -441, -535, 1070, 78, 96, 122, - -193, 516, 114, 100, -413, 100, -23, -153, - 1267, -4210, -742, 228, 659, 399, -169, 412, - -81, 1056, 4, -254, 173, 109, -218, 196, - 64, 26, -113, -60, -8, 15, 5497, -76, - 169, -294, -394, 596, 379, 12, -64, -203, - -138, 41, -249, -53, -44, -19, 55, -34, - 99, 36, -70, 8, 46, 2787, 842, 1917, - -693, -424, 151, 464, -1162, 1027, 148, -1027, - -173, 328, 23, 792, -184, 395, -684, 229, - -139, -7, 2788, 404, 43, -1508, -590, 6, - -184, 904, 475, -37, 276, -361, 1924, -188, - -113, -1334, -176, 11, -34, -70, -68, 95, - -433, 225, 437, -451, 471, -272, -385, 2793, - -2685, 544, 881, 409, -789, 700, -5, -144, - 66, -17, 504, -397, 264, 74, -81, -1803, - 444, -573, 633, -391, -3339, 192, 484, 1126, - -306, 153, 303, 61, -253, -255, -57, -277, - -88, -100, 32, 79, -1320, -857, 3080, 1178, - 323, 353, -149, 1316, -399, 236, -129, 231, - 323, 696, 59, 1217, -567, -268, 642, 384, - -327, -47, 466, 1530, 1092, -1176, 612, 257, - -143, -270, 487, -62, 332, 1089, 961, -706, - 938, 78, 97, -2805, -1088, -871, -273, 87, - -345, 148, 113, 167, 97, 31, 68, -47, - -53, 53, 29, -5723, -53, -12, 241, 92, - 131, 139, 48, 102, -26, -47, 664, -580, - -7, 1287, 2531, 1061, -710, 24, 1389, -1742, - 254, -1147, 539, -150, -24, 495, -204, -171, - 955, 202, -111, 147, -1458, -3973, 421, -416, - -544, 392, 1419, -178, -168, -53, 50, -537, - -7, -346, -289, -52, -38, -259, -115, -136, - -138, -89, -205, -661, -4429, -110, 380, -721, - -180, 127, -1371, -78, 276, 319, 229, -934, - 267, -353, 44, 65, 449, -32, 159, -11, - -22, -571, 100, -676, 2892, -2740, 907, 511, - 248, 441, -62, -517, -347, -235, 319, -8, - -140, 309, 258, -106, 215, 1, -3252, 426, - 455, -2213, 1031, 430, 746, 367, 602, 187, - -147, -200, 97, 555, -107, -249, -71, 101, - 59, -94, -64, -33, 221, 184, -791, 671, - -191, 284, -1311, 402, -29, 250, -190, -503, - 38, 106, 586, 4767, 526, 147, -182, 249, - 146, 17, 293, -1095, 1079, -161, 141, -2, - 681, -275, -171, -4504, 61, -105, -306, -66, - 229, 20, -102, -93, 334, -189, 5, -6, - 417, 2551, -63, -852, 1608, 1820, 670, 1592, - 102, 203, 147, -767, -147, 310, -718, 175, - 551, -98, -202, 309, 70, 81, -55, 1518, - 222, 338, -356, 349, 97, 86, 495, -233, - -121, 2936, 200, 935, -381, 2474, 53, 494, - 248, -139, -45, 100, -1287, -181, -370, 311, - 287, 3016, -96, -128, 2146, 567, -383, -551, - -96, 144, 495, 428, -32, 137, 27, -272, - -149, 9, -61, 177, -5236, 91, -837, 611, - -279, -74, 652, 14, -178, -82, -89, 347, - -245, 647, -62, 49, -215, 29, -55, -27, - 178, 79, -19, -59, 177, -152, 0, 189, - -10, 128, -115, 33, 61, -106, 56, -13, - 135, 116, -5772, 157, 43, 26, -11, 102, - -4, -52, 208, -186, 198, 99, 81, -29, - -103, 193, -35, -84, -4, -111, -5251, 84, - 71, -85, -77, 55, 234, 38, 0, -35, - 60, 5875, 98, 36, -219, -17, -419, -136, - 47, 34, 55, -21, -17, -1, 72, 94, - 52, -3, -703, -1437, -518, 557, 121, 356, - -345, -717, -438, -279, 13, 70, -95, -2, - -4170, 40, 136, 17, -153, 8, -149, -27, - -559, 268, -237, -82, -220, -921, -588, -150, - 3481, -1906, 647, 675, -455, 598, -386, -52, - -7, 222, -201, 90, 54, 75, -283, 118, - -375, 5768, 20, -126, -141, -99, 64, 116, - 16, -58, 0, -31, -15, 250, -104, -30, - -144, 115, 12, 117, -482, -1709, -436, 122, - -246, -7, 271, 1961, 154, 149, -86, 147, - 258, 531, 1760, 914, -1196, -1800, 812, -621, - 125, -161, 1361, 50, -651, -1307, 360, -785, - 205, -156, 294, 21, -3484, -18, -79, -266, - 770, 307, 29, -765, -250, 183, 55, 131, - 1452, 260, 224, 221, -347, 360, -352, -2188, - -664, -503, 313, 406, -251, 3268, 210, -46, - 129, -276, 343, -143, 104, -55, 461, 17, - -576, -287, -289, 33, -2500, -85, -428, -1137, - 918, -245, -490, -260, -270, -133, -591, 199, - -294, 2784, 102, 19, -109, -745, 91, -524, - -44, 28, 252, -511, -80, -146, 271, 519, - -216, -2280, -411, 3699, -368, -538, 427, -158, - 114, -50, -589, -340, -180, 703, -186, 487, - -649, 668, -916, -436, -3684, -1016, 877, -65, - -153, -62, -148, -17, -106, 142, -73, -1, - -68, 567, -658, 815, 2270, -563, -519, -226, - -223, -282, 584, 240, -1522, -1935, 1169, 880, - 127, -1276, -127, 399, 63, 25, -1297, 2131, - 592, 1652, 2609, 69, -581, -179, 947, 597, - 150, 35, 0, -255, -232, -728, 239, 91, - 130, -234, 231, 56, -2181, 1774, -2196, 1633, - -1065, -662, 777, -175, -128, 267, -7, 51, - 27, -133, 95, -500, 188, -167, 94, -176, - -29, -65, -161, -141, -694, -968, 594, -269, - -422, -472, -731, 1210, -816, 2142, -1321, -1746, - -149, -983, 1310, -839, 762, 284, 99, -31, - -1169, -84, -1119, -55, -720, -944, -1115, -271, - -1032, 1064, 187, -1013, 2987, 26, -209, 516, - -8, 107, -24, 188, 278, -53, 624, 460, - -275, -1881, -2001, 851, -1740, -407, 1643, -352, - -17, -528, -538, -175, 179, 416, -297, 54, - 132, -491, -76, 34, -440, 175, 2065, -2006, - -164, 38, -403, 902, -129, 215, 1545, -414, - -1183, -532, 578, 248, -308, 189, -563, -345, - -949, -279, 1693, -959, 101, 783, 9, 1641, - 1494, 167, -294, -538, 951, 115, 590, 105, - -847, -1003, 464, -368, -1268, 641, 254, 243, - 488, 2636, -1209, -272, 437, 445, 781, -463, - -415, 538, -811, 588, 1083, 206, -547, 171, - -585, -744, 343, -604, 395, -76, 910, -523, - -108, -449, 625, -325, -1079, 273, -1473, -1096, - -137, -565, 2077, -623, 214, -342, -273, 769, - 1137, -879, -731, 56, -1098, 211, 822, 579, - -839, 164, -600, -80, 61, 316, 644, 1445, - 891, -1796, -1798, -162, -1631, -492, -626, 593, - 544, 66, 63, -857, -1273, 406, 1665, 899, - -467, 87, -117, -469, 126, 30, -931, 1446, - -190, 388, -1608, -316, -2199, -127, 484, -51, - 56, -524, 1524, -103, 1231, -740, 717, -861, - 823, -665, -1790, 411, -690, 303, -1615, 63, - -232, 19, 1090, -96, 137, 80, -1027, 581, - -61, 672, 133, 444, -767, 766, -42, -3174, - -270, -23, -126, -1111, 67, -1367, 4, 315, - -53, -90, -165, 48, -1657, -117, 392, 356, - 792, -610, -618, -219, 446, 102, 374, 207, - 1026, 2480, -461, -782, 1161, -1351, 1032, 486, - -308, 290, -272, 899, 1912, 36, -624, 286, - -428, -623, -665, 12, -621, -1985, -34, 468, - 318, -467, 127, -972, -39, -663, 2307, -26, - 406, -468, -657, -1404, -342, 2356, -395, -1422, - -1243, 465, 90, -665, -280, -290, -21, -1752, - 280, 271, 395, 240, -402, 55, 1077, 148, - -309, 1818, 483, -1293, 43, 261, 566, -131, - 947, -815, -872, -1021, -1001, -395, 263, -555, - 78, -2193, -360, -76, -1029, -493, -464, 1339, - -53, 750, -671, -1349, 133, -70, 114, 501, - 766, -816, 703, -992, -122, -520, -1323, -2539, - -365, -35, -555, -888, 1515, -191, 1322, 1633, - -674, 451, -1246, 270, -868, 703, -394, 106, - -779, 754, 650, 1066, -417, -1305, 149, -165, -}; - -static const int16_t cb4432l1[] = { - -3867, -448, 2202, 129, -100, 393, 37, -267, - -156, 23, -274, 222, 33, -191, 104, -140, - -50, -28, -148, -181, -22, 6, 489, 993, - -2764, 1191, -773, 781, -460, 843, -77, -1417, - 390, 124, -203, 205, 662, -16, 569, -963, - 609, -155, 64, -293, 2649, -2533, 70, -472, - -482, -1732, 235, -5, -485, 116, -177, -104, - 314, -355, 118, 25, 921, 285, 130, -94, - 77, 121, 1068, -435, 1407, 447, -427, -1096, - -757, 258, 19, 3236, 702, 362, -928, -348, - -150, -784, -687, -388, -176, -38, 16, -14, - 1017, 879, 935, 1280, 1014, -85, -256, -103, - -3384, -928, -200, -406, -175, 304, -54, 195, - -78, 676, -356, -167, -165, -56, -3133, 156, - -171, -684, -698, -135, 230, -30, 32, 542, - 1959, -124, -76, 162, 182, -174, 1011, -97, - 678, 10, 188, 30, 1086, -262, -157, 250, - 241, 233, -584, 3276, 2126, -50, -207, 637, - -440, 331, -434, 251, -267, 269, -392, 68, - -244, 8, 928, 827, -1096, -309, -356, -375, - -3204, 422, 695, 2, 240, 595, 641, 582, - 342, 42, 7, 539, -64, -116, 82, 16, - 26, -136, -122, -114, -5814, 22, -272, 10, - 113, 186, -422, -95, 309, 308, -118, -208, - 52, -175, 12, -106, -6, 20, 58, 6053, - -101, -20, 10, 70, 189, 57, -11, 210, - 83, 239, -6, -79, -233, -59, 31, -30, - -62, 64, -38, 25, -78, -202, -215, -115, - 1477, 255, 101, -2575, 186, 3140, -46, -45, - 53, -183, -89, -412, 183, -222, 50, -237, - 96, 35, 1684, -521, -169, -436, -295, 1390, - 261, 27, 163, 352, 68, -3677, 12, 310, - -599, 331, 138, -333, -269, -130, -44, -14, - 265, -626, 258, -59, 31, -17, 222, -10, - -364, 280, -183, -235, -217, 73, -67, 114, - 196, -5132, 269, 159, -6, -36, -248, 274, - -328, 2712, -393, 2763, 507, -110, -166, -84, - -72, -1111, -19, 370, 25, 5, 156, -32, - 237, -57, -106, -22, 370, -229, 1099, 4297, - 152, 72, -56, 347, 64, -501, -57, 178, - 175, -14, -84, -626, 555, 155, 20, -75, - 20, -33, -254, -125, -9, 150, 91, -7, - -45, 239, -109, 72, -66, -172, -211, 6063, - -205, 171, -75, 50, -75, 22, 109, 21, - -58, 58, -105, -432, 310, 3782, -18, -1071, - 19, 20, 1455, 337, -257, -288, -52, 519, - 43, 80, -175, -218, 9, 176, -28, -418, - 200, -514, 351, 119, -5920, -96, -33, -289, - 74, 26, 120, -37, 113, 47, -145, -17, - 334, 46, 47, 19, 274, 172, 159, -404, - 3151, -408, -559, 987, -178, 253, -90, -498, - 1454, 1183, 392, 762, 220, -1207, -220, -69, - -85, 22, 1644, 1858, 725, 1084, 0, -257, - 290, 1712, -151, -188, -390, 638, -327, -2185, - -322, -1116, -150, 120, -140, 198, 162, -83, - 1321, 232, 242, -52, -456, 778, -288, 65, - 2431, 37, 85, -489, 862, 2776, 260, -72, - 792, 100, 17, -210, 588, 49, 600, 246, - -258, 128, -51, -492, -395, -489, 50, -5308, - -67, 314, 124, 46, -188, -64, -101, 51, - -535, 108, 56, -4, -191, -923, 485, 578, - 1320, 228, -535, 310, 227, 395, -1441, 2660, - 226, -392, 221, -686, 1749, -175, -904, -571, - -129, 154, 2622, 609, -247, -240, -893, 98, - 291, -2277, 411, 260, -160, 2061, -203, -437, - 359, 21, -101, 19, 49, 15, -98, 82, - 3, -555, 164, -152, -58, 38, 175, -439, - -37, 68, -21, -181, -5556, -27, 8, 48, - 21, -151, 381, 3, -152, -74, 202, -29, - 1863, 1713, -922, -1976, 551, -1522, 525, -116, - 146, -1730, -238, -72, -183, 126, 234, -240, - 82, 138, -60, -131, -2226, 226, -702, 183, - -81, 462, -2851, -1419, -1005, 124, -81, -252, - -65, 147, -58, -179, 306, 154, 122, -69, - 69, 11, 115, 296, 3340, -501, -2580, -804, - 9, 591, -86, 88, 127, 588, 183, 48, - 79, -38, -199, 63, -140, 29, 88, -28, - 259, 69, 1743, -531, 110, -18, 776, -18, - -177, 112, 36, -243, -208, 528, -47, 4709, - 107, -125, 140, -1, 22, 15, 416, -194, - -267, -49, 43, -3, -308, 214, -128, 140, - 5372, -123, 70, 275, 210, 182, -147, -131, - -84, 69, 116, 29, -401, -162, -236, -173, - 378, 45, -12, -77, -6209, -103, 126, 54, - -19, -20, 43, 64, 92, -8, -12, 118, - -123, 58, -3628, -414, -2147, 76, 95, -99, - 357, -10, 278, 4, -608, 504, 105, -72, - -109, -92, -55, 367, -167, 40, -34, 76, - 220, 3434, -366, 191, 248, 29, 187, -177, - 155, -348, -341, -2466, 272, -136, 510, 139, - 81, 184, 33, -299, 92, -44, -402, -583, - -725, -400, -159, 751, -225, 377, -160, 1556, - -2652, 685, -1077, 1276, 332, -257, -1449, -282, - -231, -145, 58, 173, 421, 271, 401, -186, - 79, -258, 127, 252, 214, 96, 157, 195, - 205, 118, -4771, -95, -164, 217, 477, -51, - -4, 8, 1450, -51, -52, 952, 675, 929, - -273, 475, 9, 282, -249, 236, 746, -1407, - -272, 1845, 692, -105, 2690, 168, 1, -1, - 157, -599, 305, 255, -2252, 45, -199, 119, - -3489, -161, 6, -263, -259, 338, -251, 61, - 153, -124, 432, -7, 131, 5, 305, -322, - -3283, -32, -336, -273, 2243, 863, -1, 681, - -365, -246, -152, 375, -133, -15, -208, -104, - 89, 128, -135, 44, -255, 549, -2751, -48, - 270, -2584, -549, -631, 445, 182, -198, 743, - -215, -60, -400, 1383, 167, -65, 250, 146, - 185, 22, -484, -161, 86, 1758, 964, 404, - -2574, 1026, 6, -516, -724, 315, -1891, 311, - 2, 339, -39, 324, 299, -497, -12, 179, - -1242, 364, -185, -197, -1474, 232, -490, 4042, - -105, 887, 31, 539, 235, 75, -112, -200, - -31, 74, -76, -16, -20, 38, -159, -143, - 114, -77, -110, 28, -18, -84, -27, -53, - -82, -224, 75, 0, -46, -64, 44, -112, - 84, -85, -6030, -24, 661, -474, -178, 8, - -1023, -396, 199, -19, -50, -93, 385, 209, - -1227, 2492, 2163, 986, -1359, 399, 848, 681, - -829, 211, 696, -599, -1398, 1951, -113, 374, - -17, -1113, -1708, 1294, 666, 1774, 623, 259, - 105, 961, -87, 43, -463, 65, 155, -26, - -31, -1477, -508, 1091, -1463, -524, -1853, 1354, - 434, 86, 893, -871, 151, -1887, 205, 423, - 857, -55, -11, -39, 341, 61, 1158, 2650, - 899, -2491, -593, -843, -1399, -15, -713, -171, - -195, -523, -46, 243, 117, 241, -8, 140, - -149, -191, 70, 134, -1158, 1933, 1135, -2284, - -1049, 1717, 378, -155, -37, 171, -692, -280, - 918, -786, -123, 558, 571, 39, -315, 62, - 27, 59, 708, -134, -200, -168, -134, 148, - -142, 25, 164, -282, 284, -95, -35, 376, - 165, 367, -335, 271, 249, -4520, 176, -36, - -216, -1303, 375, 92, 602, -889, -390, 284, - 78, -1318, 1259, 1865, 1498, 2063, -234, -840, - -391, 88, 168, -235, -74, 31, -239, 1221, - 71, -1637, 1513, 68, 2201, 1513, -1099, -622, - 426, 343, -330, -648, 381, -156, 27, -31, - -92, 133, 210, 103, -155, 2061, -366, -1173, - -31, -274, -713, -471, 509, 1044, 208, 403, - 486, -66, -521, -1883, -180, -537, 1283, -98, - -1464, -456, 508, -619, -546, 685, 944, -85, - 311, 1172, -194, 1406, -99, -827, 1506, 396, - 196, -1534, -1181, 1588, 1250, 47, 1034, -171, - -1247, -98, -120, 1181, -2195, -384, 945, 627, - 26, -248, 1372, -671, 214, -649, -17, -44, - -500, -559, 577, -601, 32, 421, 531, 344, - -1233, 145, 348, 614, -560, -244, -357, -202, - 814, -494, -2320, 308, -2277, -481, -518, -431, - -851, 43, -204, -26, -742, 1083, -130, 2002, - 1642, -1156, 1746, -529, 937, -544, 416, -741, - 763, -232, 509, 243, -458, 78, -130, 143, - -123, 71, -666, -105, 31, -1061, 441, -48, - 411, -1547, 155, -730, 439, 1624, 873, -611, - -470, 2348, -157, 1184, 678, -174, 542, -95, - -12, -405, 237, 322, -1194, 1903, 1496, 357, - -34, -661, -1024, 2236, 860, -256, 617, 756, - -485, -273, -589, 536, 214, -286, 782, 418, - 346, -462, 443, 1056, -914, -304, -564, -332, - 1823, 2079, 93, -975, -891, -1089, -720, -1127, - 702, 300, 787, 374, -78, 1070, 691, 1339, - -797, 57, 482, 432, 748, 1538, 673, 1885, - -504, 1913, -190, -135, 881, -139, 84, 379, - -176, -129, -331, -34, -690, 282, -563, 51, - 71, -714, -103, 1074, -651, -582, 1388, -320, - -1115, 1547, -1088, -65, -2634, -201, -653, 116, - -238, -218, 476, 1417, 1671, 1135, -1025, 614, - -662, 127, 863, -117, 726, -971, 1382, -286, - 465, 1195, -715, 862, -1256, 105, 37, -1190, - -442, -1777, 50, 162, 1577, 580, 762, 253, - 92, -308, -1238, -161, 295, -150, 1733, 1831, - -527, -527, -28, 70, -359, -1590, 860, -221, - 47, -1201, -254, 39, 780, -326, 1097, -1019, - 834, 362, 357, 41, 693, -1099, -2687, 614, - 270, -128, -322, -1149, 631, -46, -343, 1495, - -896, -864, 1545, 200, -922, -1133, -637, -1231, - 484, -796, -743, -371, 999, 1300, 173, -19, -}; - -static const int16_t cb4432s0[] = { - -2558, 2751, -440, 1200, 1067, -725, -492, 588, - 234, -209, -108, -230, 223, -231, -235, -132, - -51, 88, -290, -214, -99, -60, 175, 2546, - -991, 907, 446, 635, 284, 707, 238, 220, - -308, 259, 8, -435, -2207, -1487, -1579, 46, - 285, -249, 154, -370, 37, 42, 1524, -1853, - 1393, 1204, 126, 1751, 82, 136, 363, -2411, - -782, -128, -818, -232, 765, -173, -127, 732, - 260, -101, 868, -249, 290, 32, 645, 55, - -1742, -1077, 392, -568, 629, -920, -243, 791, - -604, -363, 117, -1360, -15, -245, -3655, 54, - -297, 10, 124, 11, -1114, -567, 3882, -2042, - -1120, -42, -114, -914, 419, 307, 44, 277, - -101, 429, 170, 187, -528, -705, 348, -19, - 180, -76, 91, -1861, -181, -171, 804, -730, - 222, -184, 349, 191, -125, 14, 4270, -467, - -272, 29, -216, 212, 426, -222, 11, -16, - -852, 101, 576, 178, 351, 647, 90, 179, - -681, -187, 77, 4115, -976, -726, 711, 763, - 572, -1166, -46, -445, -103, 135, 294, 300, - 10, 737, 386, -399, -349, -52, 5393, -107, - -32, -229, -154, -181, 82, -68, -13, -77, - 48, 75, 117, -50, 254, 233, 98, 75, - -2218, -2214, 1491, 832, 225, -1057, 267, 539, - 1963, -245, -353, 454, -430, -54, -747, -58, - -438, -90, -64, 277, 214, -105, -47, -1301, - -404, -1179, 682, -4093, 764, -270, -342, -367, - -1378, 6, -83, 429, 398, 61, -149, 180, - 31, 169, -218, 152, -71, -38, 2605, 679, - -175, -533, 1787, 611, 484, -322, 158, -561, - 125, -35, -42, -190, 529, 449, 157, -3105, - 106, 168, -8, -66, -80, 1463, 1136, 4793, - -98, -432, 538, -145, 241, -158, 105, -372, - 39, -160, 92, -223, 81, 245, -142, -162, - -167, -297, -49, -98, 582, -5178, 1130, -271, - 567, -251, 55, 487, -303, 31, -25, 87, - -70, 154, -23, -221, 70, 208, 48, -137, - 46, 59, -9, -1397, -970, 224, 714, 161, - 24, -307, 1295, 1467, -155, -505, -521, -244, - 503, -25, -989, 3664, -148, 12, -135, 218, - -159, -156, -769, -421, 553, 715, 697, -181, - 1426, 425, -39, -103, -4558, 171, 347, 161, - 170, 128, -210, -35, 31, 125, -264, -135, - -100, 2685, -230, 2062, 1618, -99, -874, 926, - 757, 380, 404, -73, 30, 29, 462, 725, - -389, -246, 20, 150, -234, -58, -183, 10, - 156, 482, -232, 124, 115, 180, -615, -395, - 330, -85, -435, 3279, 1493, 686, 1157, 245, - -1067, -1953, 23, 796, -540, 175, 56, -1931, - 89, 705, -342, 551, -1999, 1951, -2305, -497, - -266, 275, -1503, 351, -355, -353, 236, -358, - -271, -40, 136, 217, -13, -45, -2091, 1141, - 730, -1888, 1131, 660, 1271, 439, 2597, 92, - 319, -91, 62, 316, 287, -260, 121, -33, - -117, -22, -79, -170, -164, 1486, 134, -62, - -36, -3367, -235, 1221, 1239, 78, -54, -489, - 268, -560, -774, 851, -973, -62, -174, -138, - -459, 390, -22, -42, 83, 1339, 1307, 462, - -3768, 511, 300, -525, -787, -89, 675, -2074, - 37, -48, 252, 598, -332, 67, -187, 2, - -106, -35, -148, -186, -542, 799, 2363, -155, - -665, -2867, -209, -200, -80, 1682, 1082, 2, - 516, -481, 276, -1, -220, 54, -12, 259, - 161, -148, 566, -1489, -731, 1262, 499, -816, - 115, 4057, -71, 701, 39, -132, -223, -16, - 229, -2, -40, -61, 234, 405, 108, 304, - -62, -396, 1369, -1438, -2045, 1954, 759, 969, - -166, -235, -115, -68, 1923, 1815, -776, -855, - 34, -63, 17, 87, 223, -145, -130, -16, - -313, -1704, -458, -332, 420, 1332, 676, 878, - -3847, -360, 427, 537, 651, -167, -451, -197, - 277, 136, -201, 517, 10, -156, 35, -927, - 1250, -173, 1004, -169, 322, -140, -559, -4656, - -343, -264, -61, -12, 195, -10, -123, -23, - -20, -6, -367, -102, -215, 41, 838, 1513, - 552, -1609, -753, -763, -656, -633, 14, 35, - 141, 117, -121, 857, -1494, 578, 2546, 1034, - -676, 571, 817, -218, -111, 1424, -51, 878, - -2860, -257, 104, -526, 782, 708, 2350, -500, - -342, 219, -406, 836, -117, 288, -415, 798, - 14, -311, -455, 3, -410, -144, -30, -977, - -145, -2466, -957, 1370, -3201, -327, -85, 149, - -580, 198, 350, 140, -104, 327, -128, -178, - 58, 294, 50, 1814, 581, -909, 287, -267, - -3992, 61, -860, 258, -271, -223, 237, -291, - -3, 66, 110, -620, 319, -62, 177, 364, - 110, -163, -921, -863, 251, 4922, 280, 121, - 128, 209, -126, 578, -56, 41, 124, 350, - 245, -465, -67, 5, 651, 147, 200, 0, - 21, -609, -332, -3, 247, -412, 128, 42, - -1405, -301, -341, -484, -491, -55, 361, -100, - -30, -405, 643, 4249, -31, -91, -10, 6, - 425, -350, -1501, 817, -1348, -201, -345, -3643, - 235, 691, 332, 219, 199, -398, 130, -50, - -190, 89, -23, 100, 1327, -200, 146, 482, - -624, -479, -391, 188, 129, 614, -335, -564, - 1021, -107, -199, 145, 201, 571, 1276, 4253, - 58, 121, 295, 38, 26, 47, -1333, 1138, - 3125, 357, -72, 347, 276, -272, 120, -77, - 535, 247, -71, -2054, -1860, -73, -62, 266, - -30, 183, 17, -46, -7, -140, 997, 526, - -47, -59, 1540, 373, 162, -150, -107, -74, - -278, -37, 4268, -21, -269, 359, 111, -115, - -5, -206, -87, -44, -517, 54, -2859, 189, - -297, -863, -918, -929, -543, 25, -2866, -79, - -1101, -275, -410, -458, -75, -211, -420, 96, - 467, -66, -15, -580, -420, -586, -7, 109, - 236, 227, -488, 106, 258, 76, 78, -8, - -199, -4888, -134, -205, -33, -243, -19, -10, - 157, 129, 120, -928, 604, -345, -47, -430, - -257, 273, 81, 1949, 490, 272, -205, 2460, - -54, 103, -2924, -529, -211, -60, 279, 220, - -57, 342, 209, 984, -1410, -3363, -1028, -1301, - -1293, 227, 1142, -1068, -512, 758, 364, 46, - -358, 16, 257, -158, -253, -182, -2, 181, - 1475, 1574, 215, -968, 246, 369, -273, -717, - 546, 74, -3872, 293, 98, 130, -244, 41, - 143, 699, -56, -126, 67, 54, -2, -878, - 2334, 883, 215, -1979, 246, -759, 499, 248, - 751, -202, 580, -3018, 359, -139, 210, -47, - -168, 89, -659, 259, -54, -40, -490, -169, - -769, 569, -171, 64, -845, 519, 1251, -71, - -459, -4436, 257, -334, -826, -183, 115, -408, - -77, 544, 173, -258, 48, 331, 1735, 1035, - 2793, 1154, -1901, 275, -109, -1185, -403, 1332, - -282, 36, -367, 21, 27, 362, -425, 217, - 150, -304, 192, 53, -1100, 27, 628, 698, - -634, -25, 84, 8, -103, 533, -301, 218, - 4350, 119, -109, 309, 24, -352, -147, -274, - 156, 85, 9, 1706, -854, 2012, -1573, 112, - -673, -1538, -91, 415, -1525, 866, 1493, -621, - -396, 277, -604, -363, 114, -360, -252, -18, - -31, -77, -591, 2483, 535, -1520, -1057, -2189, - -51, 798, 276, -1426, 72, -303, 402, 111, - 327, 272, -8, -216, 189, 1282, 152, -45, - -33, 1524, 2301, -341, 1992, 939, 1678, 1011, - 114, 167, 586, -500, 40, -473, -274, 596, - 1237, -126, 205, 254, -284, -367, -119, 64, - 1915, 437, -585, 1, 402, -271, -984, 530, - 267, 3634, 495, -219, -728, -67, -1340, 983, - 122, 6, 110, -166, 111, 102, -139, -2499, - 753, 1011, 1755, -1252, 872, -510, -1844, 1388, - -782, 287, 461, 36, 77, 437, -361, -216, - -415, 158, -77, -123, 57, -93, 3408, 504, - -942, 434, -648, -251, -420, -387, 1373, -229, - 236, -191, 3, 204, 612, 393, -285, 560, - -164, -199, 303, 146, 93, 1248, 2425, 1001, - 1261, -239, 1085, -1878, -375, -544, -995, -192, - -319, 542, 280, -716, -1323, -67, -34, 252, - -36, 206, -126, -28, 26, -1135, 2799, 527, - -47, -2008, 509, -232, -953, 332, -386, -108, - 290, 507, 578, -809, 375, 850, -1413, 831, - -137, 259, 25, -1075, 407, 1784, -1539, 1658, - 1450, -969, 467, 4, 785, -595, 912, 34, - 91, 286, 1035, -524, 276, -322, 11, 651, - 733, 243, 45, -145, 357, 524, -697, -259, - -757, -1057, 181, 1324, 148, -502, -64, -379, - -746, 1385, 395, 184, -749, -197, -3375, -546, - -4, 532, -270, 687, 501, 285, 401, 431, - -1888, -639, 655, -325, 1896, -1883, 53, -1018, - -1475, 802, -486, -68, 232, 1337, 428, 232, - 1754, -1687, -518, -372, 508, -1269, 327, -900, - -468, 1127, 1397, 1597, 837, 659, -617, 99, - 264, -460, 296, 44, -295, -209, -174, 1105, - 896, 1065, -174, 5, 845, 1311, 1370, -2548, - 351, -660, -24, -1089, -787, -1312, -22, -585, - -197, 749, 293, -112, -169, -23, 3, 1151, - 529, 1173, 224, -1517, 930, -52, 268, -1282, - -559, 466, -528, 1506, -231, -337, 993, -1314, - -250, -3042, 57, 19, 15, 1812, 697, -389, - -201, 647, -723, -1098, -177, -225, -2694, -495, - -431, -238, 388, -1731, 997, 227, -765, -222, - 94, -611, 35, 187, -935, -1470, 1013, 1051, - -378, 311, -710, -566, -532, -369, -1599, 553, - 167, 450, -1068, 2834, -125, 601, -113, -503, - 40, 14, -36, -220, -1543, 867, -612, -1834, - 888, -1791, 1296, -229, -593, -760, -197, 428, - -1290, 892, -62, 1113, -1228, -965, -90, -300, - 288, -133, 779, -1211, -627, 268, 180, 913, - 2230, -413, -146, -217, 170, -1157, -1551, 877, - 75, 1784, -174, -230, -757, 1243, 625, -49, - 114, -218, -409, 195, -1165, 1492, 213, 1100, - -101, -957, 1016, 663, -704, 817, 94, -279, - -256, 469, -75, -123, -2954, 948, -407, 275, -}; - -static const int16_t cb4432s1[] = { - 5416, -223, -123, 156, -33, 185, -144, -108, - -199, -68, -36, 11, 37, 124, -301, 58, - -21, 155, 99, -10, -78, -26, -70, -3160, - -1037, 98, 155, -373, 834, 652, -277, -429, - -529, -103, -358, 187, 1161, -157, 147, -400, - 461, 156, 237, 481, -67, 99, 939, 1179, - -659, 1337, 578, -489, -481, -427, -622, 131, - 1826, -734, -995, -5, -461, 514, -83, -271, - -2928, -86, -382, -205, -133, -386, -195, -67, - 508, 586, 607, -910, -181, -2046, 1212, -179, - 23, 408, -1929, 2044, 2160, -879, 74, 179, - 72, -164, 47, 162, 1497, 826, 2978, -912, - 454, -618, -1907, -501, -494, -299, 96, -138, - -114, -51, -171, 445, 1144, -187, 217, 224, - 402, 13, 42, -58, -1692, 4162, 1272, 970, - -278, 327, 88, -31, -182, 279, -610, 78, - -432, -147, -142, -725, -17, -95, 388, 133, - -61, 28, -1365, 1441, 606, 411, 923, -332, - 1843, 1934, -1451, -514, -283, 768, 940, -428, - 31, 1105, 248, -78, -1477, -367, 404, 68, - -178, 17, 691, -265, -105, 1681, -476, -1307, - -3434, -1700, -524, -871, 472, -171, 237, 104, - -142, -231, -292, -285, 266, -259, -166, -97, - -432, 4003, 1220, -356, 2110, -220, -465, -48, - 117, -178, 290, -21, 205, -19, 321, -343, - -328, -57, 215, -345, 304, 2, 10, -2071, - 185, 433, 212, -1165, 112, 242, -294, -162, - 1107, 1176, -396, 1400, -2600, -434, -640, 457, - 100, -268, 809, 128, -236, -66, -94, -842, - 82, 163, 227, -2641, -485, 291, -326, 42, - 234, -648, 1355, 3016, -1403, -71, 188, 792, - 15, -16, -522, -75, 106, -824, 1133, 947, - 477, -642, -531, -808, 4100, -34, -407, 133, - 33, 15, 63, 72, -223, -15, -491, 38, - 47, 258, -236, 192, 1628, 173, -2116, 687, - 295, -74, -183, 95, 529, 149, -372, 182, - 1317, 21, -1424, -3156, -111, -96, 580, 284, - -274, 41, 145, 1314, 79, 1830, 262, -325, - -16, 169, -245, -2038, 1959, 892, 946, 303, - -171, -432, 883, 34, -238, 2463, -294, 25, - 24, -106, -45, 509, -154, 496, 109, 115, - 169, 702, 396, -97, 657, -251, -112, -114, - -144, -230, 517, -190, 4885, -45, -152, -9, - -170, -2021, 541, -905, -2015, 2588, -936, -20, - -300, 384, 433, -123, 119, -505, -126, 295, - 526, -1352, 450, 142, -126, -115, 1, -140, - -734, 672, -147, -660, -747, 652, 161, -163, - 51, -616, -1974, 1413, -3145, 922, -1289, 215, - 182, -838, -171, 107, -333, 34, 216, -307, - -359, 496, -343, -325, -2552, -1573, 588, -441, - 1296, -3075, 119, -131, 54, 206, 278, 106, - -100, 112, 220, -49, -80, -229, 1051, 3271, - -1300, 324, -31, -1025, 1659, 1526, -161, 669, - -56, 430, 201, -535, -126, -9, -380, 222, - 212, -345, -282, 195, -41, -1235, -593, -593, - 1557, 71, 1023, -831, 545, -875, 161, -772, - 99, -190, 1616, 338, -251, -201, -3104, -774, - 4, -121, 178, -80, 652, -1018, -441, -343, - -236, -240, -244, -26, 2192, 75, -1348, 3771, - -22, -850, -251, 316, 132, -21, 63, 104, - 152, 185, -40, 275, -1356, 482, 3081, 571, - -481, -1387, 815, 1285, -352, -98, -41, 573, - -307, -1879, 427, 196, 169, -26, -232, -98, - -411, -231, -2034, -969, 271, 1421, -1485, -407, - 1404, -343, 861, 888, -11, 202, -245, -397, - 104, 229, 309, -2757, 315, 416, 393, 194, - -176, -663, -166, -229, 244, -152, 183, 24, - -205, 97, -255, -299, 123, -12, 53, 102, - -362, 371, 223, 46, 132, -5177, 157, -92, - -1114, -28, 135, -831, 627, -428, -1116, 421, - 761, 458, 3256, -167, 355, 2045, 113, 234, - -154, 20, -39, 61, -81, 63, 98, -171, - 1727, -1193, 2103, 416, -421, -575, -636, -114, - 700, -260, 1610, -336, 521, 2591, -738, 43, - 103, -63, -335, 168, 110, 41, 1995, 3554, - 1443, -53, -206, 992, 767, -372, 141, -24, - 173, 60, -237, 69, -173, -73, 137, 167, - -164, -159, 312, -151, -78, 619, -192, 689, - -69, -2805, -259, -288, -231, 28, -1682, 2316, - 2298, -336, -131, 59, 542, -218, -281, -214, - -41, 116, 138, 8, -297, -45, -215, -167, - 1587, -1061, -1976, -445, 401, -2392, -42, 581, - -519, -230, 1461, 542, 113, -634, 1776, 332, - 191, 5, 174, 1939, -26, -242, 120, 230, - -986, 3501, -1125, -89, 3, -580, -219, -255, - 37, -119, 94, -17, -297, -176, -434, -234, - 55, -63, -1167, -492, -1753, -3397, 185, -794, - 689, 819, -32, -836, 335, -133, 724, -299, - -318, 424, 558, -654, 119, -447, 140, -100, - 72, -872, -1432, -203, -40, -14, -59, 550, - 85, -53, 5007, 258, 401, -184, -313, -170, - 66, -185, -82, -61, 210, 48, -204, -96, - 130, -562, -1700, -1037, -3926, -884, 1115, -6, - -100, 842, -450, 877, 76, 568, -623, 27, - 73, -195, 328, 41, -24, 124, -77, 1499, - 540, -1064, 4517, -22, -35, 839, -48, 253, - -259, 96, 409, 90, 26, -177, 365, -48, - -324, -26, -23, -83, -77, -80, 1599, 1486, - 266, 659, 236, 231, -16, 359, -163, 455, - -999, -1169, 2453, -599, -945, 4, -2110, -174, - -736, 344, 232, 142, 32, -99, 763, 133, - -325, -56, 1635, -439, 843, 2, -1704, -13, - 771, 3680, -89, 182, 4, 42, 394, 404, - 82, 312, 91, 141, -1577, 1765, 3141, 625, - -271, -2122, 423, 353, 489, 606, -290, -190, - 486, -131, 118, 236, 248, -209, -2, -162, - -95, 95, 170, 278, -2233, 549, 34, -846, - 3595, 445, -400, -65, 131, -14, -16, 611, - -116, 1293, 98, -680, 189, 217, -15, -549, - 131, 8, -768, -1082, 841, -346, 129, -33, - -778, 322, -2508, -2128, -1895, -2021, -27, -42, - -51, -536, 239, -1, 78, 105, 48, 79, - 207, 422, -181, 18, -94, -152, -181, -5012, - -187, -3, -118, -397, -84, -49, 129, -276, - 188, 45, -146, -235, -109, 83, 32, -79, - 2039, -616, 257, -1575, -1756, -2364, 222, 195, - -1138, -290, 58, -641, -252, -11, 402, -31, - -1040, -592, 676, -118, -231, 94, -123, 1642, - 1404, -334, -728, -3425, 382, 111, -194, 677, - 177, -182, 434, 860, -1022, 84, 1214, -733, - 300, -2, -259, 140, 35, 96, 1164, -1476, - -757, -74, 239, -203, 1796, 1207, 1732, -3029, - -610, 658, 490, -465, 136, 56, -614, -612, - -123, 93, -151, 162, 56, 502, 1634, -1825, - 45, 1033, 1554, -2380, 1615, 1317, 786, 387, - -255, -423, -44, -246, -213, -149, 107, -74, - -94, 45, -204, 13, -1959, 936, 2023, 1000, - 1031, 112, 574, 323, 163, 947, -657, 492, - -2624, -44, 739, -305, -31, 247, 270, 213, - -46, -90, 43, -1504, 931, -61, 4045, -863, - 389, -386, -130, -374, -583, -800, -900, 158, - -455, 169, 134, -164, 54, -117, -185, -90, - -203, -41, -811, -2082, 169, 287, -378, -15, - 231, 83, 89, -187, 198, 18, 178, -18, - 527, -40, 94, 54, 79, -4356, 248, 162, - -94, -1431, -31, -2048, 651, 1231, -508, -1089, - -1255, 766, 1673, 357, 13, -813, -2403, 179, - -470, 65, -339, 154, 9, 56, 246, 66, - -2308, 1443, -947, -744, -2473, -1248, -113, 1017, - -608, 149, -182, 41, -524, 16, 285, -268, - -781, -57, -346, 194, 256, -51, 107, -484, - -190, -125, -645, 487, 314, 74, -555, -1012, - 325, 76, 233, -205, -189, -48, -4593, -122, - 10, 121, -91, 108, -49, 254, -1662, 2500, - 87, -1540, -200, 287, -329, -50, -401, 182, - -1300, 689, 915, -224, -768, 471, -339, 133, - 407, -344, 99, 96, 111, 1224, -1431, 2069, - -282, 127, 397, -119, 1332, -1299, 744, -535, - 800, 327, 874, 700, -424, -1596, 1365, -651, - -151, 113, 102, -24, 464, 125, 911, -1583, - -372, 747, 2, 429, -47, -64, 34, 1700, - -741, 343, 728, -226, 1889, 78, -515, 2827, - 77, -66, 108, 515, 90, 2227, -678, 1301, - -974, 122, -983, 2357, 64, -1479, 186, 1436, - -245, 204, 460, 191, -677, -335, -200, -135, - -106, -101, 1112, -2733, -641, 73, 1265, -1281, - -1332, -743, 675, 129, -1144, -1169, 331, -143, - -87, 809, -891, -848, 246, 243, 97, -170, - 36, -1109, 102, 1055, -1395, 1384, 1155, 439, - -1549, -300, -2069, 1014, 187, -782, 980, -971, - -345, -583, -66, -138, -317, -124, 48, -152, - -98, 92, 2446, 128, -1232, 2148, -337, -615, - 467, 1573, -613, 857, 303, 422, -1340, -420, - 305, -626, 94, -496, -386, -129, 243, 27, - -200, -1373, 1468, -2040, 151, -675, 65, 1464, - -432, 545, 269, -510, 584, -1935, 970, -319, - 1465, 490, 263, 555, -256, -49, 315, -242, - -394, -312, -88, 201, -121, -302, 172, 49, - 234, 59, 327, 155, 199, -187, -41, -74, - 52, -31, -59, -5574, -121, 282, 343, -125, - -200, -575, 1328, 155, -1928, 250, 702, 21, - -2718, -153, -102, 2131, 612, 432, -1072, -457, - 222, 427, 144, 149, -433, -1573, 1337, -650, - 176, 13, -1273, 280, -751, -236, 453, 204, - -1595, -2896, -272, 233, 485, 82, -139, -528, - -140, -399, -56, -274, -335, 176, -756, 243, - 2250, -305, 721, 1711, 7, -1230, -1590, -1872, - -137, -714, 263, -1643, 362, -266, -176, 64, - -36, -63, 687, -483, -1488, 709, 929, 1349, - -1245, 645, -1619, 735, -651, 1850, 1031, 159, - -625, 838, 242, -396, -397, -41, 1237, 304, - 81, -94, -736, 578, 1279, 1064, 81, 1900, - -179, 224, 266, -429, 734, 500, 995, -882, - 1563, 1813, -519, 758, 532, -27, 27, 453, -}; - -static const int16_t cb4432m0[] = { - -6132, -262, -273, -1250, -577, 984, -430, -410, - -464, 577, -578, -178, -32, 369, -624, 267, - -68, 474, -480, -225, 166, -409, 437, 4633, - 98, -1560, -464, -869, 103, 193, 461, 72, - 292, -245, 1102, 417, -325, 461, 74, 43, - -120, -213, 333, 160, -468, -212, 31, -81, - 6516, 182, 201, -212, -66, -49, -266, 148, - -108, 98, -46, -11, -59, -20, -20, 2332, - -294, -560, 198, -647, -47, -638, -3877, 11, - 834, 547, 47, 2541, -126, -5, -366, 339, - 3, 2, -66, 60, -526, 914, 321, -658, - 3605, 59, -2392, -655, 384, 775, 366, 327, - 356, 386, 751, -375, 38, -205, -15, -442, - -212, -1241, 1913, -421, -755, 45, -1637, -36, - -2435, 1504, -1248, -763, -664, 133, -123, 814, - 241, -243, -446, 66, -131, -213, 2036, 1294, - -2138, 677, -1042, -771, 294, 371, 474, 85, - 1403, -2618, -478, -537, 275, -826, 349, 84, - 264, -272, -61, -705, 175, -972, 868, 25, - 4183, 881, -639, -833, -757, -1063, -991, -257, - -137, -619, -285, -454, 77, -169, 316, -45, - 4362, -203, -2132, -424, -820, -503, 340, 340, - -612, 648, 2, -342, 81, 630, -1518, 235, - 216, 210, 665, 231, 130, -879, 38, 675, - -136, -48, 540, -234, -152, -169, -5745, -294, - -24, 8, -129, -8, 308, -14, -16, 147, - 62, 70, 248, -2014, 76, -190, -328, -1899, - -353, -140, 836, -365, -112, -3945, -736, 467, - -258, 601, 617, 74, 62, 394, 180, 1151, - -810, 36, 457, 406, 75, -8, -5004, 2335, - -108, -123, 299, -335, 112, -499, -268, -185, - 461, 208, -38, -164, 764, -504, 272, 4853, - 396, 265, -1133, -433, 769, -458, 1005, 645, - 81, -172, 385, -56, -130, -393, 128, -73, - 31, 2038, 127, -436, 123, -2525, 282, -448, - -489, -295, -14, 85, -462, -49, 262, -93, - 238, -148, -3953, -414, -259, 33, -892, 459, - -2186, 60, 444, -610, 844, -486, -299, 219, - -433, 19, -1183, 276, -29, 388, 3327, 102, - -914, -221, 486, -892, -550, 190, 151, -141, - -336, 194, -242, -224, 405, 879, 1600, 349, - -2082, -38, -514, 18, -3574, 161, -142, -38, - -1815, 540, 228, 33, 164, 1074, 4, -278, - -58, 4085, -295, -795, 31, 494, 555, -250, - 22, -202, -312, 92, 109, -238, -448, -622, - -1511, -4346, -417, -706, 37, 1157, -96, -199, - -59, 285, -43, -217, -22, -95, 103, 2242, - 244, 45, -74, -7, 366, -79, -359, -286, - 188, -14, 34, 49, 245, -108, -84, 88, - -333, -216, -79, 15, -5710, -36, -102, -552, - -213, -8, -356, 515, 212, -265, 80, 316, - -1163, -561, -517, -714, -375, -4176, 73, -666, - -363, -28, 1248, -68, 478, 2648, 642, -710, - -555, -744, -166, -744, -596, 138, 499, 59, - 453, -583, -290, -11, -48, 4174, -252, -74, - -78, -62, 449, -265, -818, -357, 171, -513, - 72, 106, -45, 649, 145, 5558, -60, -136, - 69, -172, -134, -66, -68, 100, 683, -427, - 795, -407, 345, 4930, -838, 361, 279, -190, - 173, -341, -9, 722, 383, -140, 123, -269, - 154, 31, 335, -465, 311, 46, 4535, -131, - 90, 151, 287, -11, -526, -614, -2253, -321, - -93, -550, -128, 25, 303, -139, 19, 0, - -3255, -161, 276, 103, -245, -515, 816, -1042, - -1449, 1693, -627, 1287, -837, -727, -80, -478, - -337, 116, 1, -270, -567, -311, -407, -1656, - -216, 196, 3004, -285, -521, 1510, 1818, 1392, - 42, -44, -244, -349, 959, -183, 25, 58, - 43, -345, -310, -8192, -84, 311, -60, -348, - 125, 33, -79, -138, 88, 138, -121, -37, - -211, -118, -142, -37, -132, 181, 162, -1423, - 1781, -3453, 1261, 134, 670, 1218, 761, 292, - -146, -825, 672, 737, 293, 433, 245, -392, - 46, 598, 257, -234, -1201, 718, -4549, -573, - -696, -224, -85, 75, -268, 244, 1817, 341, - -166, 436, -386, -1247, 22, -112, -55, -451, - 106, 388, -32, -254, -2400, -373, 892, 334, - -4114, -307, -107, -316, 41, -214, -403, -56, - -469, -246, 120, -237, 266, 43, 3257, -3925, - 291, 239, 752, -411, 162, 437, 159, 256, - 37, 71, -79, -136, -475, 124, -208, -216, - -245, 16, 40, -459, -4320, 340, -1462, 914, - 10, 490, 436, 162, 271, -238, -38, 2219, - 25, -141, 405, 107, 235, 282, -55, -7, - -3429, 565, -1095, -678, 1979, 233, -874, 592, - -474, 680, 402, -738, 21, 274, -321, 655, - -348, -546, 510, 62, 23, 4722, 572, 423, - -256, 473, 1240, -997, -899, -53, -73, 332, - -902, -771, -335, 0, 769, -587, 592, -703, - -600, -77, -94, -207, 792, -133, -758, 500, - -14, 330, 22, -281, -5460, 152, 607, 337, - -39, -118, -80, -51, 228, 65, -6, 540, - -3515, -1712, -449, -157, -164, -195, -1655, -1285, - 90, -517, -116, 11, 1402, -162, -64, -103, - 46, 302, 37, 71, 2903, 2952, 780, -487, - -297, -426, -369, 150, -129, -233, 813, 1639, - 190, 310, -311, 320, 94, -247, 1484, -32, - 70, -220, 560, 372, 54, 205, 96, -3567, - -680, 1683, -2377, 17, 548, -266, 257, 656, - 331, 205, -121, -814, 139, 326, -370, 625, - 2035, 818, 775, -1165, -41, -4258, 41, 1109, - 984, -885, -43, -314, 204, 204, 95, 407, - -351, 101, 133, -929, 899, -6, 384, -177, - -330, 240, 90, 78, -318, -455, -5, -365, - -61, -80, -72, -4850, -338, -384, 30, 181, - -2721, -767, 3217, 453, -226, -582, 283, 135, - -103, 265, 494, -1444, -120, 70, -976, -67, - -90, 660, 366, -609, 32, 205, 73, 51, - 346, -6, -120, -10, 300, 32, 270, 139, - -55, 453, 5712, 353, -145, 176, -168, 216, - 205, -30, -304, 1085, 221, 464, -426, 1662, - -1397, -1114, 301, -1058, 3553, -388, 743, 696, - -893, -296, -57, -254, -251, -178, 417, 82, - -988, -3566, 2171, -1312, -954, -23, -1349, 480, - 566, 24, -643, -292, -68, 303, 73, -81, - 296, 7, 371, 94, 1718, 498, -774, 857, - 1014, 358, 436, 210, -3481, -202, -416, 59, - 1987, 137, -476, 32, -627, 193, 368, -3, - -290, -3035, -352, -455, -609, -175, -5, -600, - -181, -249, -2551, 226, 105, -249, 1851, -86, - -1203, 214, -57, -505, -522, -247, -154, -40, - -17, -523, 333, -1777, -354, -1568, -3492, 1032, - 1577, 90, 153, 534, -106, -538, 102, 3, - -198, -99, -23, 835, 3495, -1099, 44, 732, - -350, 926, -472, 533, 1529, 54, -844, 1295, - 573, 414, -23, -71, 279, -891, 287, 126, - 1456, 973, 456, 1608, -646, -1244, 452, 651, - 694, 855, -235, -503, 745, -544, -3512, -138, - 678, 473, 220, -273, -9, 265, -1874, 397, - 1196, 284, -963, 298, 318, -2309, -162, 322, - -1250, -16, -1004, -5, 2800, -64, 72, -482, - -162, -412, -2922, 774, -335, 238, -1144, -134, - 1428, 558, 1969, -659, 902, -1698, 793, -858, - -613, 998, 253, -336, -348, -80, -117, -264, - 355, 808, 784, -559, 2030, 1952, -244, -1130, - -986, 1883, 1171, -493, -326, -880, 2588, -243, - -204, 194, -172, -65, 2026, 424, 587, -317, - 2550, -601, 203, -669, 475, -676, -1492, 27, - 41, -1078, -299, -630, 177, -164, -429, -246, - -357, 1191, -867, -1363, 1621, -110, 916, 217, - -1269, 622, -434, -1113, 888, -41, 1020, -1774, - 46, 80, -483, -892, -61, -472, 193, -192, - 2000, -103, 740, -223, 2493, 422, 2508, -331, - 470, -1233, 47, 595, 795, -465, -320, -163, - 128, 6, -209, 603, 536, -416, -1455, -87, - -1191, -98, -281, 1003, 1421, 388, 1163, -1146, - -81, -299, 2518, -1072, 207, -443, 506, -220, - -346, 98, 2119, -416, -2268, -498, 109, -1342, - -335, 1125, -712, 156, -1088, -2092, 1164, -500, - 113, -17, 551, -199, 262, -27, -692, -629, - 204, -1448, -1606, -1554, 289, 382, -691, 1229, - 414, -1746, -1198, 1113, -386, 310, 1354, -12, - -284, -569, 46, -558, 1495, 172, -899, 617, - 827, -365, 100, 1008, 136, 2111, 10, 2320, - -291, 364, -401, -408, -528, -612, 127, 1218, - -384, 129, -1603, 438, 1029, 2536, -150, -1432, - -856, 1068, 773, -762, -808, 676, -693, 404, - 145, 4, 27, -148, -318, -1019, -277, 1404, - 880, -1135, 861, 903, 739, 303, 139, 1918, - -952, 801, -306, -2439, -3, 442, -590, -1034, - 178, 430, 153, 1853, 1997, 742, 1745, -608, - -237, 160, 523, 950, 82, -1468, -1592, 807, - 719, 618, 319, 57, 235, 287, 1344, -50, - 324, -182, -365, -381, -377, 1989, 147, -573, - 1246, 1769, -473, -178, 961, -1297, -750, -1428, - -1246, 789, 158, 612, 17, -292, -227, -142, - 64, 51, -16, -301, -287, -60, -404, -267, - 109, -108, 189, -438, 48, 95, -5059, -42, -}; - -static const int16_t cb4432m1[] = { - 7567, 273, 268, -74, 201, 274, -149, -146, - -262, 243, -273, 63, -127, 135, -160, 231, - 120, 209, -91, -218, -38, -1206, -468, -159, - 278, 536, -995, -60, 22, 1041, -550, -121, - -241, -664, 427, -416, -1395, -732, 152, 3247, - -67, -154, -2430, 421, -405, -558, -73, -2887, - -272, -60, 365, 745, 287, -622, -1103, 412, - 266, 82, 61, -2172, -379, 529, -125, -1482, - 319, 643, 222, -508, 2451, -970, 71, 237, - -280, 202, 983, -223, -307, -130, 217, 3209, - 49, -30, 275, -12, -260, -3959, 1219, -104, - -2700, -201, 54, 851, -590, 691, -254, 408, - 296, -48, -364, 216, 16, 220, -415, 218, - 83, 43, -4032, -1359, 25, 15, -279, -2092, - 794, -433, -195, -162, 606, 166, 87, -316, - 508, 242, -359, 687, -178, 14, -2969, -500, - -1041, 3234, 679, 170, -791, -127, -630, -16, - -19, 181, -2, -185, -172, -88, -118, -167, - 128, 121, 239, 321, -125, 217, -7260, -157, - -161, -347, -257, 102, -1181, 71, -379, -205, - -268, 144, -174, -106, 305, 23, -47, 202, - -110, 660, 54, -2963, -119, -1371, -2823, 1171, - -726, 690, 534, 161, -435, 753, 58, 227, - 241, 138, -76, 473, 193, -1926, -2183, -2526, - -1428, 284, -1270, 336, -1458, 208, 41, -356, - 345, 153, -273, -166, 500, 42, 120, -35, - -81, 56, 1747, -3050, -2029, -764, -947, 888, - 422, 374, 143, -318, -225, 604, 343, -91, - 1626, 75, -211, 160, -667, -195, 38, -446, - -1269, -108, -959, -616, -530, 554, 2865, -156, - -358, -429, -261, 23, 511, 340, -548, 2347, - 105, 12, -32, 164, 170, -168, 268, 2587, - 3511, 612, 329, 159, 456, 273, -452, 168, - -394, 799, -58, 160, -480, -257, 242, 167, - 46, -1433, -1631, 50, 852, 509, 864, -381, - -306, -698, 261, -702, -19, 4113, -38, -153, - -11, 405, -441, -120, 139, -265, 225, 342, - 199, 2085, 237, 278, 252, 1537, 119, 182, - -174, -193, 2486, 87, 2903, -311, -304, 273, - -217, -256, -264, -675, -819, -188, -615, -1183, - 495, -154, -687, 2423, 197, -63, -146, 1151, - 896, -1129, -58, 1114, -1644, 1219, -648, -71, - -130, -2643, 533, -218, 3942, -83, 208, -724, - 198, -643, 590, -944, -56, -420, 115, 23, - -414, -144, 295, 219, -36, 393, -174, 91, - 290, -7066, 158, -275, -70, -119, -1, 302, - -262, -73, -61, 110, -196, -25, 87, -446, - -159, -6, -107, 115, -7562, 5, -33, 284, - -106, 34, -140, 160, -304, -272, -169, 25, - 93, -205, 28, 169, -165, -34, -50, 343, - 2204, 1440, 817, -1921, -590, -527, 81, -364, - -354, 163, -1058, 1977, 244, -75, 1201, -207, - 293, -289, -105, -121, 3588, 925, -2, -201, - -860, 917, 100, 265, -200, -44, -529, 351, - -579, -103, 186, -3622, 52, 181, -259, -411, - -4, -328, 380, 517, 306, 57, 340, -65, - -263, -311, 494, 326, -6136, 747, -141, 296, - 217, -2, -125, 8, -88, 254, -2934, -259, - 946, -905, 653, 436, 3393, -147, -157, 27, - 166, 299, 8, -16, 643, 114, 217, 57, - -21, -298, 19, 129, 1721, -134, 2337, 781, - -483, -748, 118, -330, -226, -3762, 222, -417, - -154, -24, -13, 1138, 210, 357, -122, 257, - -369, 863, 13, -320, -439, -433, 3469, -869, - 116, -2772, 202, 1065, -130, -287, 142, -288, - 54, 318, 131, -16, 84, 238, -361, 934, - 1341, 37, 130, -412, 146, -724, -3, -823, - 2555, -1263, 11, -147, 3164, -83, -39, -127, - 258, 26, -1181, 3339, -676, -30, -56, 691, - 867, 715, -903, 293, -205, -392, -22, 529, - -76, 2201, 433, 134, 1338, -18, 85, 3128, - 33, 924, 257, 1662, -769, 321, -449, -374, - -58, -597, -1670, 97, 222, -998, 404, -155, - 133, 358, -250, -125, 163, 6027, -228, -116, - -61, -878, -693, 710, -516, -191, -27, 443, - 83, -174, -695, -117, -107, -53, -142, 92, - -145, -114, -62, -710, -3192, -872, 3284, -521, - -36, -948, 252, -253, -143, 260, 109, -24, - 262, -169, -196, 195, 105, 27, -135, 1722, - 1862, -513, -270, -144, -414, -59, 91, -288, - -96, -56, -204, 273, 170, -171, -62, -4993, - -125, -67, -50, 226, -275, 600, 105, -217, - -450, -87, -20, -353, 24, -74, 167, 1881, - -4260, -144, 48, 92, 187, 319, 341, 22, - -4, 405, 147, 237, -120, 122, -237, 56, - -515, -153, 333, 834, 401, 210, -5516, 7, - 127, 147, -140, -479, -26, -1669, -21, -147, - 60, 387, 565, -140, -5827, -269, -1119, -324, - 118, -199, -11, 105, -49, 150, -148, 178, - 182, 162, 150, 68, -227, 3, 221, -330, - -23, 65, 6262, 71, 48, -41, -10, -1, - -44, -255, -50, -138, -109, -54, -31, 492, - -214, 239, -194, 35, -6348, -148, 9, 25, - -123, 84, -448, 241, 148, -35, 52, 35, - 7, 99, -16, 57, -43, -256, 3336, 373, - 211, -513, 2328, 86, -274, 386, 74, -174, - 624, -1037, -1154, 36, -209, -1028, -101, -412, - -103, -267, -107, -126, 163, -394, -1097, -100, - -1575, -542, 3326, -2149, 547, 626, -278, -414, - -781, 486, -186, -159, 138, -187, -821, 419, - 393, -4266, 828, 431, 86, 745, 1313, 1484, - 260, 52, 163, -455, -1071, 186, 522, 288, - 421, 18, 97, 1267, 200, 2637, -189, 729, - 746, 203, -639, -843, 2164, 671, 84, -2384, - 430, -161, 404, 166, -33, -17, 591, -227, - -3849, 1579, 175, -718, 99, -410, -844, -239, - 32, 212, 163, 480, 843, -379, -621, -317, - -424, 113, -262, 44, -93, 529, 144, -218, - 140, 3257, -575, -2697, 144, -83, -186, -44, - 977, 153, -230, -1530, 234, 212, 212, 331, - 412, -125, -3, 422, -329, -2181, 1406, 363, - -90, -86, 329, -267, -4462, -189, -87, 154, - 66, -200, 37, 80, -109, -199, 125, 1983, - 260, -438, -2417, 3259, -974, 453, 41, -77, - -538, 1123, 119, 120, 254, -239, -134, 33, - -384, -407, 27, 465, 1810, -910, 980, -15, - -1307, -919, 1880, -327, -303, -198, 149, 413, - 2176, 2269, -707, 343, 360, 169, 148, 182, - 104, 163, 857, 291, -153, 303, -679, -386, - -868, 2283, -320, 167, 3257, 1741, 338, 467, - 209, 207, 834, -226, -479, -120, 1674, -61, - 696, -93, -1327, 2176, 716, 402, 1688, 2219, - -339, 779, 366, 358, 241, -695, -272, -136, - -48, 36, -269, 862, -616, -118, -2028, 1678, - 1971, 115, 290, 71, -765, 31, -2874, 122, - 13, -424, -281, -320, 233, -1032, 40, -186, - 1208, 274, -2310, -1594, 289, 230, 1264, 962, - -310, 23, -548, 12, -38, -2734, 664, 37, - 346, -620, 266, -98, 82, 2369, 963, -1391, - -451, 833, 82, 175, 448, 1874, 345, -440, - 155, 130, 94, 326, 3223, 234, -163, -384, - -354, -539, 827, -9, 530, -226, -21, 332, - -2298, 3221, 1470, -282, -800, 231, 314, -998, - -1051, -648, -434, 743, -72, 119, 91, 414, - 379, 1370, -637, -998, 851, -2904, -266, -1652, - -1356, -1339, -1679, -181, 245, 731, -231, -2, - 221, -182, -325, -411, 346, 246, -2629, 1736, - -361, 24, 229, 1168, 747, 309, 425, -128, - -320, -496, 109, 1496, -70, -797, 37, -271, - -39, 906, -62, -194, 1753, 311, 689, 1354, - -1035, -973, -438, 1166, 2197, -99, -380, -274, - -1565, 447, 100, 349, 485, 653, 744, 50, - -582, -123, -1396, 156, -27, 349, -1067, -1382, - 1388, -1061, -554, 894, -80, -783, -1500, -736, - 897, 1158, -1386, -40, -280, -819, -672, -895, - 994, -308, -466, -578, 455, -1536, 879, -448, - 542, 1508, 850, -2465, 816, 641, -427, 310, - -168, -41, -908, -302, 1513, -29, -1144, 588, - -1703, 1144, 2623, 90, 284, 866, 335, -351, - 419, -745, 879, -183, -824, -1713, -34, -15, - -913, 37, -460, 778, 2130, -145, -153, 1761, - 1420, -243, -32, -877, 140, -700, 612, -2053, - 321, -78, -165, 200, 526, -1002, 2176, -1022, - 1436, 298, -21, -1378, 515, 304, 974, 1722, - 2054, 661, 425, 282, 471, 438, 70, 169, - 1587, -2076, -40, -702, 264, -146, -1499, -863, - -1775, -1059, -490, 92, 631, -1194, -1031, 335, - 257, -1299, 241, -270, -325, -322, -37, 0, - -685, 897, 984, -909, 1556, 1281, 1367, -1269, - -1591, 415, -1156, -374, -110, 1552, -695, 74, - -167, -473, 1421, -611, 175, 1521, 1322, 436, - 1969, -787, 1041, -730, -598, 188, -794, -531, - -2198, -317, -11, -8, -407, 198, -1180, -1675, - 174, 981, 467, -149, -890, 263, 1030, -121, - 2147, -135, 1975, -634, 431, -238, -695, 1338, - -172, 110, 147, -334, -726, 65, -873, 667, - 997, -1118, -339, 144, -700, 1303, -207, -609, - -1617, -765, 839, 505, -36, -58, -2894, 226, -}; - -static const int16_t cb4440sl0[] = { - -3624, -495, 158, -246, -529, -813, 689, 504, - -527, -2216, -198, -323, -690, -591, 175, 262, - 243, -3676, 2648, -986, 166, 243, 301, -700, - 324, -324, 13, 362, 222, -470, 30, 20, - -46, -147, 4050, -97, -560, 284, 317, -1611, - 655, -416, -1582, -675, 389, -124, 150, -27, - 325, -84, 48, 7474, 97, 105, 19, 38, - 133, 19, 28, 25, 40, 34, -59, 22, - 11, 27, 21, 5, -1596, -428, 439, 353, - 2288, -18, 357, -274, 2582, -126, -90, 71, - -9, -704, 205, 22, 44, -120, -43, 517, - 817, 1370, 2151, 2818, -470, 90, 395, -1243, - -345, 959, 19, -1, 123, -108, 347, 25, - -138, 15, 119, -117, -146, 142, 183, -254, - -276, -174, 5980, 283, -317, 70, 51, -15, - -2447, -79, 234, 736, -2600, -641, -1162, 376, - 959, -250, 701, -40, -102, 204, -38, -24, - -893, -387, 339, 1338, -91, -655, -864, 78, - 299, 228, -2732, 234, 1995, -1321, -139, 500, - -316, -140, 2, -80, 186, 11, 16, -69, - -7534, 85, -263, 189, -7, -1, -67, -68, - 3, 24, 391, -3299, -2952, -121, -393, 103, - -60, -113, 141, 185, -119, 240, 270, -392, - -105, 9, -39, 2529, -17, 353, 2966, -855, - 1042, 1294, 132, -257, -257, -496, 112, -179, - 424, 486, -63, 77, 275, -198, 2026, 1657, - 913, -255, -147, -1748, -5, 418, 356, 2022, - 927, -295, 194, 165, 28, 109, 13, 209, - -133, -2802, 420, -1873, -648, 309, -1172, -1825, - -36, 840, 280, 44, -118, 128, 34, 241, - -1005, 1160, -303, 318, 726, -1716, 2625, -950, - -839, -1257, -901, -238, 1123, 131, 252, 1, - 440, 1455, -14, -274, -461, 87, -515, -2299, - 928, -2867, -804, -215, 680, 147, 80, 215, - 15, 1339, 141, -95, 134, -35, 122, 53, - 429, 168, 476, -45, 745, 236, 4229, 318, - 247, -201, -372, 2289, 161, 431, 337, -707, - -1024, 121, -1773, -795, -1187, -401, 394, -1431, - 1526, -35, 432, 2929, 90, 1880, 628, 1298, - -552, -498, 207, -97, -1431, 1105, 29, -739, - -56, 62, 94, 537, -732, 1255, -766, 200, - -365, 2846, 2139, 435, 92, -710, -512, 360, - -339, 1021, 474, -132, 405, -440, 3435, 75, - -254, -2443, -880, 325, 343, 285, 230, -431, - -191, 215, 201, -443, 93, -81, -131, 2981, - -2986, 1003, 437, 434, -386, 17, 222, 70, - 173, -550, 267, -121, -43, 114, -11, -795, - 561, -147, 187, -198, -4969, 50, 59, 674, - -853, 163, 71, -205, -284, -50, -28, -1412, - -105, 262, 272, 565, -824, -541, 3381, 430, - -81, 228, -426, 978, -294, 422, -538, 13, - 9, 430, 180, 2329, -564, -1082, 1740, 1108, - -2011, 11, 343, 868, 723, -806, 342, 339, - -141, -173, 186, 50, 297, 705, 783, -593, - 1609, 212, 528, -2547, -863, -2457, -876, 164, - 162, 365, 68, 30, 11, 48, 47, -285, - -64, 166, -21, -6880, -191, -226, 89, -1, - 22, -93, -6, 44, 282, 52, 294, -690, - -147, 372, 2247, 804, -637, 54, 2385, -1799, - 315, -929, 692, -65, -54, 218, -752, -519, - 2171, 177, 907, 22, -778, -2656, 62, -418, - -434, 307, 1906, -280, 196, 76, 58, -46, - 70, -367, -67, 50, 125, 77, -547, -287, - -97, -10, -84, -271, -4856, 10, 490, -560, - -21, 66, -2469, -322, 1021, 936, 625, -2520, - 1144, -373, 270, 804, 603, -91, 262, 659, - 9, -324, 50, -712, 2705, -3016, 594, 87, - -88, 697, -205, -799, -128, 37, 504, 59, - -274, 655, 672, -20, 1294, -221, -2954, 198, - 674, -1676, 863, 324, 968, 731, 1125, -41, - -149, -303, 223, 1370, -67, -194, -1, -194, - 251, -459, -39, 4477, 113, -74, -386, 214, - -72, -77, -1593, 511, -461, 752, -559, -476, - 204, -722, 1050, 2080, 2468, -154, -208, 964, - 103, -58, 390, -1863, 910, -307, 209, -32, - 663, 103, -133, -3137, -423, 259, -605, -242, - 139, -391, -488, 77, -266, -1694, 397, -659, - 237, 2068, -3, -867, 870, 1647, 645, 1848, - 68, 382, 455, -551, -87, -99, -2926, 372, - 2438, -1166, -6, 521, -195, 1259, -162, 917, - 140, 275, -273, 133, 318, -25, 252, -119, - -132, 3120, 397, 398, -420, 1756, 666, 2176, - -141, 271, -51, 22, -494, -36, 57, 308, - 222, 3585, 16, -265, 2628, -24, 162, 13, - -240, -96, 620, 331, -449, 710, -123, -105, - 23, -170, 20, 256, -5228, 398, -186, 272, - 129, 175, 598, -16, -502, 11, -215, 28, - -110, 3570, 68, 199, -2535, -933, 781, -762, - 325, 18, -438, -319, 473, -677, 176, 290, - 0, 67, -6, -156, 31, 35, -131, -127, - 24, -100, -6826, -117, -53, -40, 99, -50, - -93, 31, 34, -251, 186, 487, -203, -662, - -182, -96, 239, 308, 338, -86, -4871, 264, - -48, 314, -66, 100, -188, 151, 24, 198, - 4, 5046, -47, -654, -43, 41, 109, 103, - -262, 93, -118, -63, 58, 2088, 336, -320, - 2326, 548, -810, -1315, -864, 461, 171, 76, - -1109, -1510, -874, -620, 97, 88, 40, -4, - -7295, -128, -39, 23, -100, -9, -74, 112, - -151, 67, 21, 53, 2, -29, -33, 52, - 3287, -2178, 626, 339, -817, 349, -1187, -550, - -390, 57, -41, 295, 756, 185, -215, 17, - 3, 7502, -134, -122, -31, -53, 91, -170, - -71, 133, -34, 57, -112, -5, -66, 17, - 1, 2328, 3714, 214, -123, -839, 9, -62, - 54, 70, -18, 817, 186, -61, -252, 37, - 98, 9, 2010, 738, -1651, -1924, 1106, -624, - 143, -548, 847, -198, -140, -691, 478, -758, - 56, 54, -7, 209, -2665, 109, -127, -134, - 2099, 333, -602, -2217, -743, 346, 74, 216, - 579, 223, 61, -30, 57, 94, 224, -2595, - -566, -851, 246, 314, 65, 2857, 114, -760, - 77, -611, 119, 181, 4, -2556, 127, 138, - -164, -219, -116, 157, -3143, 197, -98, -1040, - 235, -332, -424, -152, -338, -33, -220, 207, - 254, 5469, -102, -390, -125, -420, 113, -233, - 329, -34, 109, -171, 103, 50, 58, 96, - -500, -2317, -259, 2178, 109, -2030, 759, -780, - 448, 678, -384, -271, 213, 334, -271, 23, - -1121, 636, -1103, -482, -3059, -1200, 1160, 109, - -232, 541, -788, 130, -166, -300, 664, 233, - -97, -29, -286, 33, 1272, -298, -382, -242, - -199, 47, 479, 224, -1761, -1904, 1780, 1439, - -681, -1973, -118, -90, -148, 247, -758, 1936, - 182, 1373, 2346, 120, -758, -476, 1789, 1177, - 611, -394, -14, -39, -994, -674, 1049, -41, - 836, -391, 942, -1040, -1437, 1376, -1916, 1129, - -1018, -653, 1284, -72, -166, 321, 194, -142, - -151, -77, 251, -162, 732, -790, 107, -292, - -675, -4248, -51, -86, -299, -495, 413, -128, - -455, -105, -842, 881, -492, 1241, -1432, -1296, - -52, -430, 2533, -1765, 838, 84, -24, -798, - -428, -154, -658, 37, -388, -591, -931, -433, - -1837, 1363, -683, -717, 3115, 104, 0, 1104, - 208, 148, 404, 101, 18, 217, 58, 49, - 4, -49, -195, 187, -239, -21, 294, -138, -}; - -static const int16_t cb4440sl1[] = { - -3057, -853, 3212, -334, 5, 224, 63, -250, - -345, -102, -289, -115, 75, -99, 206, -8, - 19, 96, -254, -2566, 334, 2773, 136, 199, - -1076, 347, -187, 481, -64, 654, -9, -1094, - 196, 40, -95, 5, 163, -135, 253, -1053, - 316, -231, 24, -2307, 1480, -2052, -18, -459, - -550, -1860, -15, 98, -1406, -66, -250, 21, - 497, -404, -54, -228, 2477, 2011, -145, -1957, - -426, -906, 608, 15, 1453, 218, -79, -636, - -1005, -332, 304, 2338, 1356, 81, -1201, -170, - -126, -1177, -1644, -1046, 16, 182, -328, -347, - 346, 591, 418, 623, -110, -342, -227, 10, - -5055, -411, 128, -103, 87, -28, -133, 196, - 333, 1785, -479, -442, -2892, 453, -2292, -19, - -383, -44, -435, -193, 503, 130, 4, 144, - 2184, -245, -7, 458, 82, -76, 3052, -375, - 1299, -76, 364, -145, 372, 36, 59, -39, - 48, 385, -230, 2764, 2956, -741, -372, 428, - -504, -220, -821, -47, -49, 609, -62, 56, - 6, 216, 376, 519, -512, 54, -318, -183, - -4563, 297, 795, -182, 108, 234, 404, 218, - -123, -17, -192, 170, 349, 134, -91, 43, - -135, -24, -6, -32, -6681, 50, -138, -89, - -18, 15, 24, -416, 356, 311, 83, -267, - 81, 209, -155, -368, 396, 358, 232, 4696, - -347, 724, 112, 10, 331, 358, 197, 54, - 824, 646, -214, 113, -4425, 184, -11, 101, - -313, 186, 253, 169, 78, 52, -70, -108, - 1669, -22, -18, -2600, -27, 2806, 288, -106, - 506, 176, 616, -299, 58, -30, 1, -220, - 400, -177, 874, 70, -36, -274, -139, 1148, - 372, 40, 236, 505, 619, -4002, -95, -48, - -2854, 114, -69, -2805, -401, -9, 203, -1011, - 472, -1066, 412, -220, 245, -183, -27, 35, - -762, 312, -137, -292, -242, 896, 172, -345, - 106, -4490, 506, 569, -11, -352, -108, 334, - -165, 2389, -895, 2761, 467, 201, 150, -516, - 39, -1105, 4, 587, -152, -764, -184, -15, - -137, -30, -12, 7, 382, -461, 1577, 3519, - -173, 1370, 80, 499, 344, -771, 123, -13, - 288, 233, 111, -2472, 3952, 771, 216, -505, - -446, 531, -230, 103, -72, 34, 61, 249, - -175, 353, 83, 51, 169, -97, -60, 7827, - 95, 75, -13, 201, -27, 103, -11, 1, - 3, 121, -73, -28, 7, 2908, -209, -987, - -129, -341, 2840, 889, -147, -521, 123, 95, - -239, 552, -738, 279, -66, 0, 16, 116, - -45, -28, -43, -38, -7627, 30, -52, -209, - 281, -46, 23, -24, 56, -25, -23, -2534, - -107, -46, -93, -49, 238, -25, 96, -356, - 3483, -459, -414, 205, 102, 202, -150, -116, - 1785, 1399, 793, 543, 685, -2837, 255, 362, - -96, 410, 926, 1068, 416, 558, -169, 246, - 138, 2136, 39, -96, -605, 279, -130, -2741, - -1101, -935, -20, -227, 453, 1261, 103, 275, - 358, 43, 197, -23, -251, 322, -22, 233, - 2560, -214, 2, -101, 645, 2864, 287, -479, - 904, -65, 73, 224, 2418, -95, 428, -678, - -278, 71, -545, -571, -566, -181, -212, -2947, - 222, 780, -365, 124, -2703, -198, -69, -246, - -3056, -184, -598, -75, -145, -690, 380, 194, - 485, 214, -484, 54, 163, 363, -924, 1684, - 201, 34, 236, -539, 2374, -150, -490, -1313, - -61, 317, 2123, 315, -551, -26, -328, 207, - 253, -3015, 166, 109, -662, 2466, -157, -740, - 751, 254, -788, -369, -6, 100, -211, 107, - -309, -39, -47, 279, -126, -91, 97, -705, - 235, -231, 182, 283, -5097, -68, 285, 49, - 50, 637, 111, 39, -386, 923, 223, 115, - 1638, 1214, -640, -2168, 482, -2228, 857, 172, - 15, -2207, -89, 335, -18, 295, 718, -956, - 26, 604, -436, 2856, -1131, 98, -754, 243, - 9, 29, -4028, -1725, -1741, 432, -211, -60, - -535, 201, -273, 111, 444, 607, -250, 122, - 98, 159, 97, 281, 3071, -412, -2849, -721, - -14, 960, -43, 794, -427, 297, 478, 379, - -47, -22, 69, -60, -30, -732, 2456, 170, - 142, 6, 2520, -644, -201, -16, 1602, -20, - -293, 542, -451, -167, -9, 14, 1052, 2707, - 2980, -117, 479, -202, -92, 36, 904, -66, - -1088, -31, 75, -62, -110, -29, 112, -102, - 5217, -85, 14, -191, -202, -175, -71, 182, - -231, 275, 144, -1, -202, -13, -29, -19, - 70, 39, 46, 56, -7608, -53, -104, -61, - 44, 23, 1, -157, 42, 12, 38, 37, - 331, -609, -2516, -174, -2491, 258, -256, -926, - 983, 100, 83, 173, -965, 650, -304, -97, - 98, -166, 534, 2570, -611, 493, 103, -98, - 148, 3081, -131, 285, 13, -367, 205, -53, - 41, 29, -154, -2657, -51, -312, 134, 50, - -1514, 634, 411, -2885, -391, 365, -373, -54, - -74, -151, 80, 152, -91, -64, -209, 1134, - -2921, 316, -951, 1124, 713, 2, -2212, 31, - 164, -260, 103, 36, 229, 111, -23, -65, - -37, -220, -108, -30, 86, 17, 87, 205, - 163, 63, -5763, 254, 178, -18, 1760, -380, - 1453, -3151, 710, 106, 66, 387, 235, 463, - -295, 688, -124, 322, -193, 82, 1012, -2033, - -656, 1362, 805, -747, 2527, 470, 43, -1001, - 100, -83, 161, 74, -1128, -307, -82, -197, - -5470, 226, -327, 137, -131, 471, -432, -16, - 243, 224, 168, -164, -58, 125, 23, -2, - -2752, 268, -92, -466, 2876, 874, 182, 540, - -407, -338, -396, 562, -376, 536, -225, 160, - 44, -1501, -246, -1062, -378, 446, -2448, -124, - 499, -2297, -353, -637, 395, 598, -747, 418, - -495, 5, -1014, 2138, 289, -75, 301, 944, - 66, -457, -459, -253, -2, 678, 367, 116, - -2901, 436, -239, -303, -973, 384, -2574, 6, - -225, -164, -440, 627, 388, -3074, -263, 156, - -805, 381, -9, -112, -1481, 536, -711, 3770, - -496, 908, 483, 474, 298, -424, -793, -203, - -334, 134, -91, 208, -73, 5440, -316, -304, - 249, -1, -98, -214, 190, 242, -57, -38, - 244, -219, 30, -224, 66, -30, 22, 24, - 24, -109, -7594, -115, 90, -147, -83, 21, - -257, -52, 134, -49, 92, -117, 30, -8, - -636, 1551, 2207, -66, -1962, 212, 567, 969, - -1595, -562, 355, -467, -861, 937, -148, 15, - -68, -1516, -2118, 1477, 777, 1458, 976, 522, - 325, 957, -130, -132, -918, 448, 1088, 102, - 142, -644, -284, 687, -665, -132, -1870, 1387, - 733, -84, 920, -508, 53, -2183, 254, 565, - 2056, 97, 57, 219, 688, -344, 659, 2033, - 963, -1717, -290, -934, -2119, 57, -1452, 24, - -639, -739, -232, 170, 28, 359, -312, 310, - -103, -1067, -953, 1081, -857, 1926, 1364, -1719, - -863, 1832, 786, 55, 166, 383, -1373, -347, - 1710, -908, 91, 1257, 2013, -592, -1337, 1431, - -90, 617, 549, -356, -68, 134, -48, -133, - -176, -18, -65, 23, 84, -23, -36, -4, - 230, 297, -204, -150, 86, -4965, 742, 40, - 32, -1070, 149, 38, 302, -329, -386, -57, - 45, -1622, 1425, 1817, 1568, 2202, 7, -1192, - -201, -42, -62, -170, -32, -117, -38, 229, - 44, -226, 155, 70, 747, 259, -261, -120, -}; - -static const int16_t cb4440ss0[] = { - -3021, 2048, -450, 1147, 1487, -796, -657, 459, - 609, 63, -153, -1174, -144, 37, -176, -160, - 43, -31, -2577, 88, -797, 1179, -707, 3154, - -543, 875, 116, -40, -150, 326, 293, -112, - -73, -34, 61, 8, -2251, -1551, -2507, 6, - -52, -5, -323, -313, 1076, 920, 1116, -1100, - 1103, 310, -144, 904, 149, -59, 636, -1508, - -378, 381, -917, -868, 1388, -1225, -68, 1491, - 685, -220, 3253, 48, -504, 192, 114, -11, - -1718, -916, 660, -240, 767, -1061, 332, 591, - -477, -278, 25, -1485, 55, 216, -3238, -19, - -320, -148, 273, -876, 22, -529, 3263, -2535, - -756, -133, -481, -1024, 34, 418, -415, 412, - -92, -90, 161, -49, -1699, -2737, 2923, -243, - 122, 87, 984, -377, -37, 128, 350, -444, - -98, -52, 14, -14, -86, 255, 1997, -1239, - 42, 247, -15, 16, 405, 302, -17, 84, - -4033, -12, 254, -365, -205, -162, 329, 31, - -1158, -210, -376, 3958, -1601, -1128, 737, 731, - 300, -785, -777, -403, 463, -226, -109, -277, - -70, -53, -856, -785, -997, 71, 5565, 317, - 447, -279, -357, 254, 93, -47, -206, 133, - 88, 272, 7, 44, 2229, 1666, 234, 519, - -1996, -1195, 549, 449, 174, -1010, 622, 425, - 2288, -9, -390, 612, -40, 32, -1867, -673, - -70, -1174, 106, 134, 354, 61, -144, -290, - 82, -604, 202, -3954, 248, -76, 7, 224, - -1844, 99, -146, 206, -335, 243, 25, 60, - 186, 117, 67, -137, 119, 46, 4563, 45, - -46, -2, 874, 533, 216, -38, 185, -540, - -191, -163, -126, -108, -184, 193, -39, -4768, - 111, -89, -61, 17, 1064, 1678, 894, 4334, - 139, -892, 317, -351, 417, -87, -22, 195, - 20, 140, 234, -197, -268, -5, -1618, -756, - -119, -1749, -704, -943, 421, -3488, 871, -468, - 656, 266, -79, 325, -303, 45, -3, -31, - 1140, -707, -1578, -1434, 290, 327, -1365, -2913, - 1048, 38, -136, -871, -572, -30, 186, 343, - -30, -157, 1301, 1913, -515, -842, -723, -84, - -340, 270, -918, 3213, -1530, -394, -184, -60, - -391, -27, -110, 84, 104, 419, 1201, -810, - 1546, 39, -914, -334, -4257, 427, -95, -426, - -94, 256, -148, 246, -80, 9, -462, -1125, - 644, 3541, -140, 2346, 1045, -335, -867, 809, - 432, 386, -6, 159, 70, -10, 218, 43, - -2229, -607, 537, -924, -3038, -943, -968, 1261, - 28, 197, -285, 61, 137, 69, -2, -251, - 111, -19, -314, 2064, 960, 1529, 1056, 926, - -319, -1617, 1305, 1473, -867, 684, 1357, -834, - -66, 477, 74, -15, -1769, 1925, -2448, -1777, - -507, 264, -1740, 176, -518, -58, 32, -108, - 165, -68, 189, 35, 40, -85, -1152, 255, - 36, -1922, 1500, 1415, 841, -92, 3305, -110, - 3, -219, 167, 573, 219, 310, 27, 195, - 359, -244, 538, -2042, 355, 656, 51, -199, - -204, -3611, -396, 839, 743, -241, -80, -210, - -101, 28, -1399, 1062, -955, 54, -630, -178, - -376, 212, 237, -219, 47, 805, 216, 26, - -4334, 455, 4, 4, -1587, 95, 1186, -3101, - -140, -862, 916, 2063, 211, 96, 337, -185, - -195, 424, 1207, -31, -162, 206, 2485, -46, - -451, -1778, -40, 144, -155, 2884, 803, 396, - 1196, -635, 297, -76, -121, -162, -206, -149, - -2204, 1035, 232, -815, -49, 1006, 553, -407, - 161, 3650, -264, 370, -418, -28, 141, -177, - -113, -90, -315, 626, 62, 1392, -1815, 336, - -1276, -402, 486, -1060, -1848, 2610, 826, 485, - -250, 39, 208, 14, 2555, 2869, -813, -2074, - 337, 601, 855, -655, 566, -707, 189, -77, - 137, -510, -282, 79, 42, 73, 62, 650, - -4732, -486, 354, 420, 828, -645, -492, 388, - 753, 18, 2, 766, -212, 126, -43, 45, - 447, -283, 607, 251, -166, -10, 48, -5850, - -251, 128, -205, -95, 90, 90, 67, 24, - -50, -48, -167, -3231, -2926, 1831, 199, 484, - 169, -614, -135, -374, -418, -239, -89, -121, - 45, 75, -11, 16, -1058, 354, 1633, 589, - -1223, 1218, 842, -1146, 2186, 374, -363, 216, - -2153, -429, 429, -597, 93, 148, 1849, -797, - -162, 31, -325, 343, -323, 161, -373, 684, - -367, -452, -4306, -88, 28, -56, -59, 43, - -49, -1998, -956, 1331, -4214, -129, 30, 79, - -90, -129, 109, 130, -160, 409, 105, 298, - 208, 178, 1724, 731, 773, 128, 817, -425, - -4046, 180, -782, -116, 191, -259, 181, -31, - 162, 43, -41, -69, 1463, -1769, -2, -442, - -636, 1495, -218, -123, -58, 3616, 454, -475, - 247, -383, 304, 185, 155, 40, 1104, 1046, - -8, -736, -1155, -115, 3925, -257, -35, -599, - -437, -135, -256, 55, 214, -88, 215, -57, - -1097, 183, -501, -608, -135, 148, 405, 295, - 96, -513, 1013, 4350, -162, -61, 427, 315, - 24, -77, -1278, -167, -1774, -133, -323, -4339, - 732, 597, -30, -103, 79, -241, 177, -388, - 7, 44, 175, -143, 5030, 277, 58, 42, - -222, -133, -319, 6, 240, 217, -238, -198, - 218, -43, 439, 49, 37, 106, 1123, 2196, - 158, 171, 458, -932, -435, -2783, -300, 444, - 2317, -146, -339, -162, 157, -216, 1, 66, - 987, -190, -728, -3188, -3167, 378, -1, 158, - 459, 78, -42, 386, -133, 155, 294, 359, - -29, 78, 1763, 780, 1019, -330, 179, -51, - -393, 338, 4422, -296, -392, 170, 2, 52, - 253, 150, -191, 139, -371, 161, -2202, 156, - 37, -1004, -384, -466, 23, 183, -3701, 97, - -1293, -355, -83, -63, -26, 69, -1817, 641, - 2996, -16, 2011, -406, -647, -652, 332, 788, - 484, 918, -440, 1246, 165, 52, -260, 31, - -255, -7237, 14, 90, -135, 122, 14, 154, - 5, -78, 111, -254, 154, -23, -24, -83, - -9, 49, -426, 1657, 99, -36, -191, 2625, - 655, -20, -2723, -977, -222, -48, 155, 41, - 20, 194, -73, -26, -1206, -3517, -471, -815, - -1144, -371, 1353, -1069, -1238, 829, -227, 487, - -297, -101, 914, 100, -17, 115, -806, -798, - 585, 1097, -1, -792, 818, 29, -256, -417, - 942, 68, -4165, 34, -408, -252, 55, -77, - 246, 2055, -4, -313, -661, -836, 559, -393, - 2043, 153, 286, -2700, 98, -177, 1201, 99, - 308, -73, 1441, -3902, 730, -1610, 886, -599, - -126, 473, 43, -252, 45, 95, -291, 101, - -307, 259, -149, 26, -510, 498, 1403, -78, - -1039, -2551, 773, -1176, -1525, -405, -259, -283, - 398, 2080, -199, 62, 239, -26, 960, 582, - 2516, 799, -2127, 325, -253, -1652, -965, 1413, - 8, -119, 396, -342, 277, 541, 186, -142, - 1210, -732, 798, -47, -557, -12, 63, 537, - 148, -128, 328, 290, 203, 361, -328, -64, - 4004, 197, -640, 996, -93, -2314, 76, -914, - 1437, -964, -1735, 984, -578, 1389, -1025, -66, - -120, -1211, -32, 5, -1215, 771, 1621, -934, - -984, 148, -1592, -446, 19, -976, -1709, -1113, - -218, 191, -279, 2183, 10, -37, -842, -1582, - -92, 558, 227, -702, -365, -576, -100, 670, - -305, 285, 48, -329, 253, 3878, 156, 70, - -1008, 641, 1541, -234, 1440, 421, 1088, 735, - -206, -83, 460, -139, 107, -1160, -6, 2087, - 1894, -117, 962, 113, -990, 93, -29, 579, - 1217, -52, -342, -451, 670, 202, -1070, 837, - -132, 3507, -59, -114, -691, 208, -1170, 1089, - 305, -200, 603, -1301, -942, -1631, 1291, -2727, - 414, 80, 815, -443, 54, -34, -1141, 1301, - -1199, 372, 102, -257, 70, 450, -55, 80, - -227, 218, 264, 739, -52, -200, 3873, 83, -}; - -static const int16_t cb4440ss1[] = { - 6875, -104, -66, 161, 57, 24, -4, 76, - -122, -100, 31, 188, -119, -50, -244, 49, - 1, -100, 555, 253, 433, 633, -163, -5345, - -170, -217, -49, -29, 331, 633, -87, -46, - -29, 44, -174, -74, 2188, 434, 660, -593, - 1548, 379, 1443, 1676, -63, -2125, 246, 534, - -463, 872, -169, -12, 33, 211, -409, 408, - 1514, -189, -277, 391, -361, -35, 145, -362, - -4669, 212, -97, -65, 387, -81, 70, 36, - 448, 303, 332, -1077, -258, -1353, 1185, -50, - -12, -74, -2101, 2429, 1817, -939, 393, 169, - -22, -36, 1219, 3237, 816, 452, 1807, -646, - 407, -447, -1778, -370, -528, -127, 104, 416, - -121, -134, -62, 20, 1751, -640, -222, 950, - 1603, 555, 9, 219, -1272, 2724, 1004, 1237, - -395, 356, -453, -98, -24, 80, -1621, 474, - -1947, -237, -1059, -2091, 780, 1211, 939, 268, - -412, 1923, -419, 851, 230, 567, 143, 48, - 1506, 2228, -1226, -453, 246, 469, 540, -538, - -96, 977, 508, 105, -3150, -142, -37, 395, - 9, -38, 1, -135, -391, 1702, -179, -1566, - -3181, -1679, 203, -151, 387, 250, 563, 203, - 443, -168, 82, 61, 1604, -1878, 229, -82, - 208, 2965, 1093, 251, 1592, -432, -532, 153, - 407, 157, 191, -216, 52, -58, 935, -2161, - -409, -513, 977, -113, 3247, -1207, -743, -1178, - 136, 206, 184, -885, -64, 16, -23, -24, - 731, 1769, -941, 1543, -2386, -669, -958, 233, - 105, -1124, 948, 97, -1949, 59, -152, -65, - 114, 82, 387, -1908, -492, 129, -624, 93, - 658, -753, 1032, 2480, -1776, 360, -38, 1924, - 168, -12, -10, -128, -1712, -446, 939, 465, - 605, -586, -299, -393, 3878, 111, -379, 146, - 186, -50, -279, -30, -3, 35, -1941, 360, - -79, -111, -4287, -6, 671, -214, -792, 277, - 77, 58, 8, 16, 133, 161, 21, 33, - 1535, -296, -2668, -3198, -28, -386, 1156, 144, - -201, 256, -411, 298, 67, 670, 11, -227, - -4, -104, 12, -1000, 1192, 860, 813, 360, - 25, 93, 792, -350, 81, 4046, -178, 122, - 332, 28, -112, -8, 288, 539, -17, -63, - 8, 231, 55, -514, 105, -344, 252, -153, - 59, -10, -21, 51, 6793, 45, 259, 384, - 209, -2010, 311, -769, -1957, 2791, -463, -293, - -218, 1026, 897, -798, 47, -525, 31, -42, - 2018, -2767, 1658, 685, -1947, 46, -1468, 340, - -272, 318, 21, -421, -396, 244, -51, 290, - 45, 3, -1530, 1359, -3681, 1487, -1689, 209, - 438, -785, -220, 2, -55, -483, -35, 40, - 6, 189, -200, 2, -2026, -1747, 838, -880, - 1128, -3108, 184, -671, -261, 8, 296, -130, - -78, -268, -100, 18, -105, -9, 448, 3184, - -570, 656, -376, -969, 1682, 2635, -277, 577, - 217, 281, 219, -351, 31, 64, 101, 82, - 957, -1885, 774, -3536, -168, -431, -106, -479, - 1041, -103, 774, -142, 894, -724, -94, -766, - -58, 112, 2028, 566, -346, -139, -2671, -1907, - 1039, 189, -33, 1690, 263, -514, -225, -237, - 145, -319, 38, 116, 2891, -77, -2065, 2559, - -327, -763, 86, -172, -283, -147, 137, 245, - -333, 220, 92, 194, -176, 105, 3108, 329, - -372, -1188, 670, 773, -235, 34, -146, 876, - -259, -1580, 876, 105, 582, 259, -63, -99, - -1558, 1122, -1541, -438, 227, 1221, -1297, -746, - 2698, -29, 1169, 995, -2, 201, 392, -405, - -22, -36, 757, -4039, 725, 1960, 1478, -107, - 67, -367, -97, -88, 154, -80, 0, -265, - -163, 14, -109, 33, 597, 115, 543, 468, - -757, 826, 509, -176, -305, -4959, -118, -464, - -421, -72, 1, -187, 123, -88, -1086, 26, - 368, 610, 3394, -337, 364, 2594, 491, 759, - -309, 395, 152, 338, 249, 303, -122, 63, - 1019, -864, 1546, 196, 75, -633, -93, -631, - 777, -74, 1235, -745, 377, 3113, -174, -282, - -24, 89, -920, 2124, 620, 566, 1290, 2977, - 1180, 278, 188, 750, 981, -357, 80, 69, - 77, -151, 150, -15, 834, -893, 818, 1655, - -500, 237, 133, 243, 405, 239, 16, -152, - -70, -3692, -110, 145, 58, -57, -2527, 3072, - 2226, 218, -824, 384, -96, 119, -228, -194, - 136, 111, -251, -109, -179, -34, 143, 109, - 1157, -216, -1429, -702, 323, -1199, -60, 632, - -585, -340, 1040, 471, -32, -380, 3432, 455, - -138, -39, -2416, 652, -253, 145, 281, 393, - -671, 2841, -1616, -46, -385, -1417, -273, -168, - 318, -263, -2, -69, -638, -137, -2668, -359, - -86, 79, -777, -404, -560, -3533, 122, -113, - 617, 497, 117, -268, 110, 73, 752, -1105, - -521, 762, 695, -587, -147, -1235, 1866, -2250, - -671, -511, -2178, -820, -619, 162, -37, 102, - -342, -278, 6837, -278, 185, 10, 361, -52, - -171, 246, 184, -175, 19, 166, -48, -41, - 92, -152, -1227, -983, -3985, -703, 1143, 204, - -523, 1053, -623, 1002, 231, 53, -277, -409, - -67, -56, -90, -47, 448, 754, 554, 972, - 505, -331, 4946, -193, 89, 530, -24, -172, - 254, 244, 140, -10, 40, -77, 1655, -438, - -2776, 51, -553, 592, -2902, 280, 804, 776, - 131, 69, -207, 131, 7, 209, 93, -19, - -1148, -733, 2674, -1628, -1243, -506, -2346, -857, - -1028, 666, 365, -353, 105, 120, 210, -85, - 37, -40, 1027, 11, 1234, -5, -1976, 515, - 289, 3815, -142, -188, -248, -273, -265, 593, - 205, 164, -65, 70, -992, 1586, 2130, 779, - 92, -3067, 421, 1, 1172, 496, -917, -760, - 169, -64, 14, -40, -247, -95, 1769, -145, - 712, -794, -571, 240, -1774, -38, -129, -836, - 3372, 887, -451, 73, -107, 182, 100, 14, - -703, 2559, 490, -839, -333, 134, 804, -3549, - 50, -199, -215, -370, 453, -86, 151, -98, - -58, 128, -2624, -1507, -1623, -2186, -89, -55, - -472, -667, 2, -439, -1453, -262, 565, 56, - -118, 288, -56, 87, -398, 729, 40, -6015, - 219, -212, 287, -250, -211, -29, -61, -55, - -120, -92, 30, 129, -122, 111, 2037, 1260, - 943, -252, -13, -794, -2570, -1117, 297, 374, - -1629, -1, -407, -597, -324, -179, 408, 58, - -902, -1672, 611, -198, -61, 103, 366, 915, - 811, -280, -401, -3849, -111, 221, 353, 232, - 4, -18, 673, 1792, -2350, 132, 1979, -2318, - -417, -689, 326, 768, -377, -522, 373, -389, - -105, -103, 33, -48, 1497, 1125, 1893, -2744, - -1219, 921, 472, -165, -438, -129, -682, -783, - -685, 167, -715, 156, 64, 61, 1147, -892, - -72, 579, 1191, -2759, 1831, 1895, 663, 816, - -98, -61, -223, -366, -429, 31, -129, -121, - -255, 1804, 138, 180, -1063, 598, 763, 720, - 385, -526, 143, 80, 168, 976, -714, 236, - -3204, 93, 874, 238, -359, 1595, 191, 568, - -182, 20, -608, -288, 602, -224, 3874, -308, - -70, -826, -109, -42, -882, -1421, -1603, 625, - -1206, 31, 782, -106, -700, -246, -571, -124, - -848, -390, -523, -2903, -9, 39, -109, -199, - 497, -11, 377, 5, 25, -115, -61, 283, - 27, -131, -193, 280, 178, -5439, 44, -52, - -1210, -617, -162, -1097, -3, 748, -45, -1197, - -1058, 909, 1607, 693, 42, -749, -3001, 407, - -62, 45, 214, -312, -1054, 498, 1291, 1189, - -1268, 1083, -757, -319, -2796, -716, 310, 1583, - -608, 319, -84, -119, -1415, -602, 628, 463, - -1213, -794, -474, 2682, 931, 240, 2491, 76, - -234, -161, -690, 359, 28, -19, -774, -1023, - 738, 675, 248, 52, -348, -545, -2715, -599, - -252, 660, -387, -104, 2316, 456, -90, 100, -}; - -static const int16_t cb4440sm0[] = { - -6448, -59, 298, -659, -59, 329, -569, 397, - -224, 128, -216, 153, -100, 319, -53, -90, - 50, 3313, 4, -215, 405, -256, 78, 2890, - -187, -969, 195, -1022, -119, 214, 254, -360, - -222, 39, 2139, 91, -290, 529, -73, -16, - -318, 128, -348, 565, -1190, 202, -185, -234, - 3498, 48, 68, -1917, 1694, 212, -477, 239, - -3301, -489, 424, 418, -82, -61, 599, 1530, - -200, -252, 162, -243, 43, -534, -2695, 255, - 317, 489, 279, 3337, 246, -349, -149, -128, - -146, 256, -455, 137, -75, 836, 209, -349, - 3494, 255, -1948, -732, 367, 1373, -211, 608, - 345, -17, 43, 102, 19, -219, 173, -2361, - 130, -862, 637, -103, -589, 219, -1261, -238, - -2528, 1643, -1587, -690, -166, 7, -57, 1221, - 326, 103, -830, 608, 196, -3705, 1103, 568, - -1602, 543, -153, -416, 74, 185, 156, 34, - 1329, -798, -214, -515, 121, -797, 749, 346, - 629, -609, -877, -60, 184, -157, 250, 193, - 4385, 369, -181, -191, -308, -314, -395, -173, - -88, -388, -43, 46, 9, -167, 189, -192, - 6086, -226, -1795, 126, -941, -423, 397, 380, - 461, 319, 364, -194, 433, 1214, -3715, -274, - 9, -327, 212, -375, 130, -917, -63, 1120, - -651, -211, 149, -1128, 265, -73, -4630, 493, - -83, -20, -314, -91, 910, -109, -3, -417, - -109, 374, 357, -2773, 253, -234, -306, -3060, - -762, 53, 476, -299, -89, -2440, -658, -83, - -854, 3770, 374, 552, 450, 51, 346, 887, - -463, 189, 254, 182, 15, -37, -3263, 2594, - -647, -83, 404, 770, 691, -654, -301, 81, - -13, 742, 371, 54, 31, -83, -59, 4196, - 653, 256, -1075, -539, 1084, -1077, 1238, 259, - 20, -191, 854, 179, -47, -1025, -189, 281, - 2556, 1765, 106, -79, 320, -3066, 228, -500, - 1, -183, -46, 220, -233, -50, -98, -261, - -84, -25, -4378, -428, -1395, -582, -619, 443, - -1456, 375, 144, -32, 356, -454, 28, 136, - 5, 247, -1057, 709, -362, 293, 3084, 545, - -2804, -625, 16, -228, -238, 164, -201, -114, - -149, 58, -74, 203, 271, 462, 1037, 159, - -1652, -591, -846, -166, -3272, 710, 773, 824, - -1138, 630, -14, 209, 348, 1476, 322, -371, - 241, 4133, -877, -476, -391, 602, 1259, -1204, - 352, 90, -473, 43, -152, -439, -131, -217, - -1559, -5029, -186, -239, -44, 750, 33, -167, - -211, -67, -91, -143, 124, 32, -16, 8192, - 68, -102, 163, -31, 458, 38, 249, 21, - 157, -63, 36, 49, -22, 89, 9, 153, - 46, 60, -146, -13, -7506, -104, 101, -141, - 25, 165, -84, 219, 53, -182, -94, 46, - -1314, -371, -298, -527, 6, -1955, 52, -714, - -461, 174, 1450, -298, 107, 2965, 250, -65, - 46, -171, 296, -785, -784, 35, 36, 29, - 915, -891, -391, 168, 509, 3763, -1267, -138, - 132, 424, -53, -669, -1491, -927, 712, -638, - -440, -299, 522, 1593, 445, 3234, 547, 498, - 440, 145, -135, -188, -296, 1080, 468, 77, - 176, -315, 221, 4784, -666, 274, 762, -42, - 218, -86, -273, 116, 814, -21, 402, -266, - -392, -425, 1126, -68, 142, 357, 5143, 363, - -224, -198, 115, -221, -262, -736, -2774, -196, - -208, -613, 163, 696, 789, 132, 114, 121, - -3138, 164, 172, -189, 232, 53, 310, -50, - -407, 1207, -474, 249, -806, 21, 20, 72, - -534, 101, -47, -223, -4568, -128, -29, -910, - -254, 105, 3163, -119, -135, 1745, 1744, 1105, - 291, -333, -278, -441, 660, 141, -291, 314, - 149, 142, -121, -7878, -240, -204, 189, 376, - 3, -129, 59, 46, 170, 82, -150, -34, - 67, -110, 635, 148, 256, -2939, 157, -509, - 1439, -2470, 794, -298, 407, 980, 805, 349, - 208, -35, 1009, 1180, -114, 776, -339, -776, - 250, 1951, -557, 172, -395, 795, -3075, -348, - -106, 122, -47, -9, 55, 40, 3002, 421, - 538, -1, -277, -3062, -15, 168, 461, 521, - -525, 413, -196, 159, -3314, -85, 983, 565, - -3113, 38, 79, -172, 20, -228, -520, 346, - 47, 485, -177, 51, 175, 444, 3475, -3416, - -81, 118, 264, -162, 20, -192, -219, -111, - -57, -225, 159, -218, 117, -28, -150, -1100, - -681, 444, -54, -11, -4669, -216, -1151, 858, - 168, -39, 52, 387, 74, -39, -154, 2767, - 307, -132, 531, 175, 906, 14, -129, 49, - -3389, 476, -127, -329, 479, 118, -85, 209, - 4, 227, 154, -2, -238, 263, -24, 553, - -231, 78, 2, -183, 31, 5933, 117, 86, - 386, 359, 153, 101, -784, -553, -13, 256, - -347, -1311, -936, -64, 1718, -444, 168, -590, - -3252, -194, -243, -269, 2096, -994, -1081, 309, - 1003, 290, -66, 306, -3239, -25, 700, 365, - -770, 144, 4, 259, -185, 1493, -158, 726, - -3180, -1683, -119, 45, -493, -205, -1728, -1226, - -235, -87, -88, -87, 1966, 8, 142, 496, - 239, 828, 30, -517, 3150, 2266, 402, -315, - 74, -312, -414, -16, 458, 381, 376, 1287, - 1093, -410, -967, 80, 382, -106, 4419, 445, - 293, -283, 282, 324, -80, -25, 115, -1667, - -756, 1893, -2772, 395, 3, -349, 138, 1094, - 406, 432, 214, -1328, 632, -132, -100, 135, - 1627, 1062, 1026, -1341, 24, -3352, -173, 1265, - 861, -821, -87, -367, 278, 151, -101, -32, - 161, 387, 5778, -564, 492, 83, 324, 29, - -423, 91, -132, 190, -310, -457, -62, -99, - 171, -214, -159, -2500, -693, -1538, -311, -784, - -2422, -498, 1781, 342, -467, -78, 466, -252, - 241, 197, 186, -1039, -190, 346, -1881, -240, - -65, 1438, 1001, -3009, -52, 221, -490, 1224, - -63, -39, 53, 169, 130, 86, -56, -90, - 116, 4, 7098, -5, 61, -172, -65, 160, - -94, -30, -111, 270, -653, 521, -426, 1084, - -1169, -1158, 584, -2499, 2494, -321, 695, 823, - -429, 35, 529, -280, -45, -286, 2997, 207, - -633, -2207, 1708, -298, -413, 673, -1017, 292, - 493, 76, -136, -365, -65, 266, 852, 512, - 791, -129, 1364, -1065, 1371, 383, -524, 505, - 943, 147, 229, 39, -2969, 70, -295, 66, - 2759, -16, -435, -474, -1058, 762, 54, -257, - 560, -3167, -572, -418, -478, 370, 72, -20, - 296, 54, -2683, 550, -15, -155, 2146, -143, - -1144, 463, -117, -1690, -1917, 42, 249, -278, - -319, -513, 544, -2033, -317, -1955, -2646, 1345, - 759, 268, 207, 1243, 256, -32, -45, -750, - -211, -184, 2397, 473, 2572, -489, 260, 389, - -237, 602, -463, 569, 1673, -176, -227, 964, - 203, 130, -269, -190, 1339, -978, 973, 1986, - 1145, 1258, 272, 1779, -436, -1306, 652, 807, - 574, 1401, 53, -183, 1612, -828, -3094, -82, - 1061, 1042, -200, -891, -126, 181, -1324, 549, - 555, -4, -868, 79, 157, -1533, 18, 230, - -1096, -335, -669, -166, 1853, -310, -340, 249, - -954, -594, -2929, 415, 5, 135, -1315, -237, - 1868, 787, 1912, -1100, 1139, -1103, -217, -382, - -654, 2078, 528, 133, -115, -56, -41, -207, - 69, 461, 465, -396, 1725, 1306, -443, -720, - -1600, 1176, 652, -997, -306, -1040, 2258, -75, -}; - -static const int16_t cb4440sm1[] = { - 8192, 96, 214, -395, -106, 291, -401, 305, - -102, 194, -73, 31, 71, -19, -349, 65, - -183, 26, -21, 8154, 107, -136, -37, -35, - 85, 127, -202, 43, -195, 225, -51, -69, - -57, -107, 141, -120, -284, -227, 28, 680, - 218, 29, -1800, 488, -207, -453, -99, -3680, - -210, 39, 279, 1406, 278, -37, -1596, 232, - 376, 90, 234, -3348, 242, 1765, 555, -883, - 118, 115, 48, -116, 2166, -292, 136, 527, - -236, -18, 411, -20, -190, -480, 665, 3332, - 378, -287, 337, 199, -5, -3904, 311, -297, - -2720, -193, -17, 911, -224, 457, -48, 254, - 271, -24, -77, 165, 23, 182, -1122, 122, - -520, 309, -3604, -1013, -405, -647, -145, -1162, - 1019, -190, -278, 69, 362, -185, -78, -245, - 472, 670, -493, 620, 76, 717, -2296, -111, - -454, 3224, 27, 47, -351, -154, -293, 187, - -93, 96, 87, -453, -132, 9, 125, -209, - -26, 284, -552, 255, 87, 227, -5445, 112, - 172, -15, -448, 475, -5747, 367, 149, -228, - -797, 371, 67, -102, -118, -418, 332, 38, - -100, 90, -183, -3302, 15, -1049, -1560, 1299, - -710, 1257, 698, 316, -283, 955, 240, 182, - 269, 12, -37, 1817, 649, -1273, -2071, -1719, - -765, 977, -1159, 351, -1583, -85, -771, -215, - 123, 314, -158, 32, 560, 208, 265, -451, - -413, 32, 1954, -3598, -1680, -832, -646, 761, - 272, 394, 213, -35, -44, 343, 309, 244, - 3041, -399, -50, -126, -2755, -146, 243, -367, - -600, -166, -832, -537, 269, -48, 2419, -526, - -309, -17, -235, 73, 341, 351, -840, 3241, - -94, -432, 404, -588, 158, -127, -49, 3259, - 3543, 134, -256, -106, 622, -45, -170, -109, - 68, 377, -84, 210, -250, -267, 257, -77, - 6, -1109, -1498, -327, 1063, 992, 632, -245, - -656, -1100, -60, -456, -170, 3208, -6, 13, - -95, 606, -594, -2039, -369, -1743, 275, -93, - 117, 2828, -138, -108, 206, 1819, 98, -45, - 45, -163, 2962, -398, 3536, -183, -259, -581, - 65, -498, -288, -357, -339, -13, -71, -409, - 36, -15, -545, 1433, 135, -220, 99, 752, - 177, -455, -251, 1172, -1274, 1062, -774, -999, - -63, -2756, 99, -86, 4695, -171, -129, -856, - 26, -543, 610, -1350, -2, 271, 455, -150, - 358, 101, 536, 125, 101, 88, -16, -12, - 488, -7479, 110, 264, 140, -302, 110, 232, - 0, 15, 70, -28, -27, -110, -99, 201, - 78, 215, -108, -267, -7548, 34, 312, -86, - 197, 125, 80, -75, -117, -2, 128, -207, - -131, -513, 614, 33, -4844, -302, -323, 160, - 808, 645, 243, -603, 68, -70, 158, -131, - -212, -34, -247, 625, 134, -42, 525, -89, - 31, 116, -1, 508, 5021, 395, 111, -86, - -172, 1433, -114, -126, -148, -337, -260, 233, - -479, 275, -247, -5672, 386, -110, -99, -142, - -171, -154, -358, 30, 1028, -78, 575, 523, - -586, -739, 1586, 1076, -2519, 1572, -1448, -201, - 166, -54, 137, 1268, 1157, -411, -2905, 195, - 489, -740, 154, 522, 2276, -604, 194, -1112, - 192, 400, -271, 250, 413, 273, 158, -299, - -874, -228, -2454, 162, 819, 457, 3401, 689, - -208, -298, -461, -360, -70, -2133, -114, -124, - 81, -228, 625, 3525, 909, 254, -234, 1316, - -773, 531, -30, -16, -164, -84, 2360, -1900, - 351, -2979, 545, 653, 416, 273, -79, -825, - -107, 71, 495, 223, -176, 129, 40, 424, - 1627, 207, 47, -8, -273, -715, 60, -1253, - 1501, -1199, -248, 39, 2859, -432, 89, 299, - 948, -2608, -896, 3468, 84, 511, 55, 151, - 733, 270, -354, 470, -219, -115, -105, 91, - -259, 1941, 775, 12, 2764, 484, 557, 2288, - -118, 294, -32, 719, -62, -64, -295, -82, - -145, -285, -492, 87, -135, -98, 194, -288, - -8, 263, -475, -53, -388, 5621, 41, -28, - 34, -323, 138, 1935, -1806, -185, 340, 1380, - 48, -542, -2965, -339, 88, 554, 41, 4, - -151, 182, -39, -193, -3355, -312, 3106, -203, - 442, -110, 317, -269, 225, 31, -62, -277, - 163, -766, -408, 210, -58, 128, 161, 3308, - 3321, -138, -278, -149, 216, 134, -253, -135, - -154, -123, 254, 200, -2, 133, -307, -6253, - 310, -6, 959, 26, 191, 315, 528, -75, - -230, -203, 153, -265, -94, -61, -2, 2761, - -4623, -353, -19, 102, -139, 54, 438, 267, - -73, 447, 226, 71, -19, 75, -40, -32, - -850, -500, 422, 1237, -688, 357, -3158, -468, - -450, -279, -694, -1109, 734, -1602, -117, 122, - 261, 979, -20, 385, -2929, 342, -3164, -146, - 252, -104, 62, 469, 289, 249, -214, -38, - 73, 83, -7, 18, -394, -5, -140, -267, - 331, -147, 6540, 395, -103, -147, -271, -20, - 191, 73, -155, 197, 71, 503, 19, 138, - -129, 335, 209, 75, -6207, 140, -176, -5, - 35, -40, -61, -146, 1080, 58, 327, -49, - -842, 1431, 595, 3461, 1, 142, 2001, 297, - -16, -425, 1156, -101, -54, 1060, -222, -295, - 938, -1212, -2374, 73, -272, -3318, -8, -718, - 114, -154, 85, -9, 72, 86, -1330, 226, - -1414, -521, 3161, -1856, 133, 240, -499, -371, - -745, 779, -463, -506, 463, -229, -226, 389, - 135, -4137, 360, 735, -318, 777, 593, 977, - -174, 286, 187, -95, -1626, 245, 97, 9, - 277, 299, 1568, 1066, 375, 1342, -390, 884, - 271, 185, -258, -1100, 2113, -107, -447, -1917, - -58, -29, 1081, -455, -524, -196, 1869, -677, - -3564, 1443, 29, -425, -28, -370, -342, -28, - 30, -118, 58, 607, 454, 45, -120, 232, - 20, 21, -175, -112, -236, 492, 411, 42, - -42, 4041, 39, -2579, 235, -146, 122, 24, - 1301, 123, -461, -3264, 316, -88, -209, 140, - 387, -430, 78, 508, 149, -3588, 1107, 820, - -140, 654, 812, -566, -2578, -403, -72, 120, - 355, -136, -121, 209, 240, 116, 231, 1630, - 208, -178, -3160, 2203, -52, 451, 84, -310, - -1199, 596, 69, 285, 242, 15, 49, 341, - -154, -2286, 1206, -109, 1048, -647, 1127, 98, - -1264, -808, 1744, -1597, 13, 26, -216, 263, - 3276, 3192, -105, -390, -31, 676, 73, 265, - 31, 101, 479, -69, 123, -24, -49, 32, - -653, 2253, 49, -346, 1476, 1820, 396, 639, - -219, 792, 1728, 147, -765, -140, 1181, 98, - 153, -98, -755, 2473, 452, 231, 2031, 2468, - -416, 587, 724, 148, 500, -933, -229, 55, - 102, 74, -164, 652, -425, 100, -2684, 1358, - 1626, -350, 544, -301, -1589, -305, -1266, 11, - 243, -125, -330, 294, 1471, -2922, 1581, -546, - 582, 231, -1407, -877, 602, 219, 350, 1130, - -86, 214, -56, 201, -181, -2140, 1108, 493, - 456, -542, -113, -852, 1647, 1897, 840, -1178, - -369, 788, 488, 256, 366, 2298, 1167, -205, - 256, 585, -555, 292, 2615, 748, -247, -1102, - -1682, 226, 415, 20, 27, 100, 9, 436, - -1746, 2621, 1583, -211, -833, 441, 54, -1183, - -826, -916, -707, 564, -232, -14, 147, 453, - 70, 1094, -903, -337, 450, -1546, -662, -1047, - -2345, -811, -1037, 96, 560, 1381, -119, -383, -}; - -static const int16_t cb4448sl0[] = { - -3850, -1289, -449, -36, -1178, -1175, 705, -97, - 37, -650, 426, -477, -145, 124, 6, 207, - -96, -3145, 2917, -260, 349, 668, -72, 6, - 157, -62, -128, 20, -82, -1357, -707, -619, - -313, -229, 3010, -169, -27, 738, 971, -1450, - 246, 154, -163, -15, -93, 5, -35, -42, - 24, 31, -25, 6803, 33, -32, -68, -68, - -44, 317, 43, -106, 608, -999, -699, 582, - 46, 1631, 830, -1570, -2645, 992, 2126, 132, - 2377, 1551, 247, -247, 1508, -34, 162, -275, - -81, -654, -625, 125, -33, -210, 309, 900, - 571, 726, 2691, 2821, -698, 60, 46, -483, - 14, -210, -295, 102, 214, 226, 2622, -82, - -390, 1436, 107, 554, 381, 1307, 2283, -190, - 27, -35, 5557, 283, 103, 180, 104, -89, - -186, -319, -225, -141, 92, 1, -1942, 1025, - 906, 32, -3, -1089, 182, -799, 483, -368, - -1734, -103, 1680, 474, -133, -1067, -545, -219, - -118, -635, -2559, 1002, 2554, -640, -505, 179, - -344, -81, 107, -61, 79, -12, -29, -37, - -7574, -92, 64, 92, -164, -20, -61, -35, - -312, -159, 333, -3401, -2596, -344, 88, 604, - 535, -87, 365, -13, -77, 131, 127, 588, - 302, -94, -506, 2427, 99, 304, 2653, -1104, - 1380, 976, -530, -120, -105, 293, 9, -826, - 388, -66, 421, -202, 605, 675, 4060, 978, - 143, -94, 21, -2444, -30, 554, 695, 2878, - 657, -104, -435, -326, 307, 20, 20, 159, - 106, -3473, 326, -1029, -304, 670, -2109, -431, - 573, 704, 293, -45, -169, -119, -191, 599, - -910, 1976, -165, 581, 1209, -1689, 2365, -370, - -601, -696, 374, 202, -114, -61, 3, -63, - 30, 369, -158, -128, 198, 52, -98, -44, - -323, -5118, -1100, -669, 2256, 32, -66, 206, - 65, 2801, 783, -470, -973, 471, -211, -27, - 1879, 302, -388, -249, 301, 537, 2761, 321, - 571, 20, 337, 1336, 522, 231, 368, -363, - -2065, -57, -2565, -584, -611, 56, 814, -382, - 1671, 408, 492, 12, 1201, 1513, 247, 2165, - -592, -1246, -493, -1012, -1330, 1251, 75, -100, - 182, 52, -47, 710, -1137, 2420, -559, 266, - -801, 2523, 1229, 736, -409, -49, 269, -174, - -179, -24, 348, -661, 251, -1039, 2647, 283, - 728, -1850, -2088, 196, 39, -72, -35, -94, - -540, 266, 340, -450, 763, -5, 113, 2618, - -2737, 1047, -246, -522, -182, 376, 1068, 203, - 1238, -938, 211, -308, -395, -629, 596, -2634, - 1452, -1155, 83, -89, -3121, 419, 40, 2691, - -306, -343, 4, -347, -725, -117, -315, 115, - -215, 26, 429, 1074, -1831, -1850, 2609, 72, - 467, 191, 432, 857, -186, 0, -443, -24, - 500, 541, 30, 2324, -1160, -1153, 1783, 1282, - -1992, 101, -108, -108, 556, -2012, 506, 691, - -65, -610, 402, 610, 1941, -121, 942, 589, - 1879, 58, 312, -2218, -2056, -2284, -350, -453, - 306, 38, -579, -185, -101, -196, -150, 156, - 126, -44, -143, -7923, 126, -120, -138, -233, - 97, -20, -121, -175, -8, -13, -123, -365, - 251, 730, 2883, 667, -418, -208, 2170, -1442, - 196, -389, -516, 252, -98, 525, -1819, -647, - 1575, 768, 1124, -428, -1010, -2027, 411, -473, - 863, 210, 908, 40, 145, 37, 192, 189, - 52, -217, -168, 63, -7, -53, -121, 13, - -145, 0, -37, 61, -7979, -142, 32, 118, - 190, -7, -13, 113, 36, 31, 1461, -2088, - 2391, -939, -66, 822, 280, 246, -157, -183, - -433, -356, 88, -101, 3969, -3388, -84, 84, - 130, 35, 74, 37, 181, -195, 219, -29, - -23, -32, 69, 625, 2328, -192, -2617, 287, - 543, -1604, 823, -547, -277, 764, 276, 156, - 198, 17, 84, 346, -27, -129, 143, 217, - 212, -249, 20, 6449, 7, 51, -889, -88, - 265, 282, -1956, 1327, -1025, 1338, -1709, -1008, - 372, 57, 1404, 234, 2621, -18, 663, 301, - 0, 167, -372, -2534, 1945, -191, 198, 359, - -43, 92, 24, -5498, -63, 189, 36, -369, - 352, 381, -205, -144, -119, -267, -60, -10, - 387, 2388, -155, -450, 465, 1529, -216, 2673, - -146, 118, 50, 290, 147, 11, -2912, 863, - 2184, -689, -44, 59, -663, 663, 675, 295, - 1331, -115, -10, -54, -1, 31, 1699, 127, - 215, 2966, 163, 416, -1053, 1216, 356, 1428, - -166, -172, -2, -355, -169, -331, -94, -78, - -123, 4875, 311, 67, 1145, 397, -288, 212, - -344, -290, 126, 16, 176, 485, 551, -526, - 11, 120, -274, 83, -5399, -154, -1611, 887, - 321, -446, 1166, -333, 652, 310, -895, 62, - -219, 2840, -753, -34, -3203, -3600, 464, -249, - 336, 297, -85, 316, 144, 306, -249, 149, - 112, 73, 192, -89, 18, 197, 116, 51, - 37, 212, -7248, 163, 31, -52, -31, -101, - -1366, -353, -325, -1335, -440, 1193, 670, -2635, - 872, 1400, 733, 395, 122, 130, -4146, 0, - -382, 1486, 308, 1179, -412, 288, 701, 161, - 147, 959, 60, 77, -123, 17, 193, 204, - -226, 388, 272, -588, -157, 2823, 735, -745, - 2368, 359, -1088, -2004, -1293, 2018, 483, 320, - -1014, -806, -479, -68, -51, 168, 873, 27, - -7906, 57, 19, -23, 27, 43, -13, -50, - 93, 16, 29, 31, -26, 32, -22, 453, - 2922, -2560, 138, 923, -1245, -405, 10, 228, - -270, 145, -192, 83, 48, 101, 77, -226, - 36, 7792, 126, -275, -37, -36, 9, 45, - -89, 13, 148, 125, 24, -442, 111, -12, - 540, 1794, 3008, 1620, -185, -1394, -161, -25, - -313, -317, 591, 2507, 134, -369, 77, 527, - -619, -236, 2681, 87, -1060, -34, 1894, -1123, - 373, -628, 1934, -1279, -1689, -609, -472, -598, - 405, 229, 414, 12, -2923, -33, -435, -49, - 2380, -34, -344, -2171, -284, 274, 226, -287, - -84, -57, -1, -169, -50, 479, 707, -2774, - -532, -640, -244, 44, 458, 2519, -590, -472, -}; - -static const int16_t cb4448sl1[] = { - -2878, -714, 3098, -76, -51, 232, 118, -780, - -691, -267, -309, 105, -179, -5, -84, -11, - -120, -379, 458, -3161, 65, 2994, 64, 374, - -440, 62, -183, 28, -561, 73, 59, -2565, - 445, -451, -1026, 437, 10, -173, 1243, -2278, - -481, -395, -154, -2402, 945, -2789, 117, -1184, - 75, -704, 527, 478, -589, 17, 131, -110, - 574, -1055, -628, -277, 2798, 1483, -657, -1996, - -248, 194, -284, 822, 225, -170, -10, -302, - -427, -1700, -90, 2756, 2124, -49, -964, 372, - -637, 443, 13, -69, -71, 196, -1971, 110, - 1147, 698, 1333, 1369, 527, 165, 903, 577, - -2134, 56, -33, 34, 183, 247, -342, 974, - 1079, 2478, -26, 80, -2377, 430, -1422, 428, - -2187, -469, -1280, -326, -40, 188, 911, 405, - 2772, 279, -493, 265, 768, 45, 5778, 44, - 121, -257, -135, 124, 263, 15, 197, -114, - 5, -14, -8, -82, 3989, -511, 197, 2446, - -292, -205, -919, 162, -121, 145, -40, 71, - -105, 72, 2035, 960, -145, -467, -518, 167, - -2988, 421, 860, 320, 40, -446, 319, 160, - 140, 511, -55, 213, -148, -527, -666, 687, - 9, 23, 344, -156, -4646, -125, -220, 9, - 134, -25, 16, -1319, 763, 58, -1586, -438, - 301, -411, -337, -3398, 358, -68, -111, 5483, - -36, -456, -94, -116, 204, 95, 84, -73, - -163, 69, -190, 64, -3716, -326, 1815, -843, - 312, -498, 684, -641, -766, -104, 606, 70, - 2630, 51, -170, -3584, 167, 461, -162, 132, - 496, 91, 171, 255, 48, 2, -120, -1196, - 534, -431, 2669, -403, 8, 287, -391, 2557, - 849, 167, -275, -184, 605, -3570, 113, 22, - -2586, 668, 294, -910, 67, -141, 0, 418, - 271, 75, 90, -124, 446, -142, -635, 631, - -956, 1566, 25, -1982, 790, 2770, 33, -520, - 23, -7488, 67, -73, 60, 64, -46, -36, - 76, 3, 22, 149, 61, 34, 255, -380, - -284, -2531, -1423, 1507, -926, -1074, -929, -1430, - -141, 165, -80, -268, 21, -767, 1542, 3197, - -191, 2014, -304, 595, 536, -906, -126, -354, - -76, -162, -125, -3139, 3197, 934, 366, -923, - -330, 277, -284, -163, -12, 402, 15, -146, - 20, 83, 111, 196, 23, 71, 77, 7287, - -175, -13, -227, -59, -56, -28, 1, 163, - -50, 59, 635, 150, 95, 2750, 775, -2057, - 423, -1078, 1749, -3, -655, -365, -357, 145, - -76, 5, -93, 224, 150, 108, -34, 173, - 148, -371, 34, 48, -8037, 65, 50, 103, - -42, -10, -96, -90, -3, 60, 92, -79, - -76, 386, 114, -1947, 833, -1279, -484, 217, - 3156, 226, 485, 1191, 425, 88, -59, -243, - 2292, 1681, 671, 62, 899, -2453, -100, 1039, - 713, -104, 554, 219, 356, 963, 741, -102, - 455, 2067, -324, 172, 28, 772, 752, -2351, - -1438, -865, -1668, 105, 1034, 1195, 14, -350, - -425, -648, 2086, -532, 634, 1537, -33, -598, - 2888, -85, 184, 158, -164, 3339, 237, -284, - -54, -246, 46, -254, 365, 55, 1928, -346, - -357, 331, 139, 16, 674, -384, -67, -3399, - 165, 76, 215, 137, -3187, -146, -264, -165, - -3039, 235, -541, -630, -32, -33, -211, 160, - -121, -111, -1296, -47, -128, 292, -1523, 1540, - 771, -166, -509, 212, 2758, -327, -418, -305, - -9, 465, 2513, 195, -70, -209, -66, 127, - -147, -3161, -192, -541, -555, 131, -858, -1609, - 973, -156, -1877, 60, 1011, 66, -348, 912, - -1731, -1296, 305, -369, -560, 470, 46, -863, - -124, -37, 40, -395, -4886, -20, 221, 228, - 177, 182, 98, -151, -195, 854, -194, -374, - 301, 586, 58, -908, -19, -4198, -171, 330, - 48, -3312, -164, 1913, 1183, -42, 1287, -353, - 757, 620, -547, 251, -520, 59, 43, -179, - -191, -131, -2951, -944, -2479, 344, -813, 104, - -697, -44, -270, 198, 245, 2866, 208, 178, - -248, 38, 19, 577, 2812, -765, -855, -439, - -60, -30, -352, 1521, -1069, 457, 415, 572, - -749, -144, 100, 515, -794, -1554, 2507, -270, - 10, 62, 2507, -1550, -75, 70, 2530, 562, - 132, -141, 251, 156, 835, 102, 717, 3226, - 3327, 172, 84, -205, -11, 208, -310, 164, - -27, 11, 281, 37, -518, 20, -76, 82, - 5436, -543, -301, 112, 359, -140, -94, 78, - -18, 38, -196, -92, 13, -111, -23, 30, - -15, -94, 101, 142, -6455, 321, 322, 50, - -216, -321, -10, -465, 101, 45, -585, -969, - 1248, -456, -2523, -852, -2129, -889, 33, -1424, - 1462, 583, 749, 527, -1737, 1262, -594, 414, - -215, -1184, 412, 1758, -1836, 1248, 440, -178, - 784, 3591, -227, 43, -493, -766, -270, 150, - 151, -56, -110, -2832, -73, -166, 470, -179, - -681, 71, -114, -2743, -806, -560, 63, -244, - -90, 182, -143, 995, 404, -13, -1343, 1524, - -2472, 1718, -957, 1229, 458, -395, -2817, -579, - -99, 340, 1538, 684, -492, 1156, -45, -65, - -305, -1408, -325, -270, -358, -127, 92, -97, - 415, 85, -4749, 173, -296, -203, 331, 315, - 184, -46, 1315, -146, -55, 427, 37, 255, - -209, 272, 735, 506, 105, 103, 902, -3449, - 116, 2304, 616, -1564, 1508, 478, 320, -2418, - 244, -176, -32, 238, 92, 290, -168, -78, - -3464, 270, -1902, 2, 696, 92, -1610, -206, - -49, 178, 121, 27, 119, 72, -253, -398, - -2720, -81, -162, -550, 2595, 1445, 249, -104, - 218, -310, -95, 18, -473, 1908, 432, -227, - -168, -2725, -240, -1830, 199, 437, -1392, 304, - 1461, -2394, -603, -540, 769, 340, -104, 1569, - -21, 338, -874, 1533, 281, -59, 487, 2120, - 179, -140, -328, -57, 63, -110, -1330, -485, - -2427, 1159, 355, -26, -2055, 154, -563, -132, - 49, -329, -187, -24, -71, -3970, 276, 158, - 92, -202, 7, -422, -578, 186, -407, 4960, - -595, 1027, 417, 691, 69, 133, 123, -147, -}; - -static const int16_t cb4448ss0[] = { - -2680, 2499, -328, 2212, 1288, -57, -727, 76, - -210, -218, 41, -343, -26, -38, 43, 606, - -619, -531, -2082, 87, -1127, 1282, -23, 2272, - -1816, 104, -31, 85, -22, 60, 1293, 138, - 382, 432, 489, -372, -1649, -2809, -2556, -98, - -232, -233, 169, 186, 79, 1157, 2113, -942, - 636, 877, -601, 2277, 1411, 1165, 1029, -613, - -348, -38, -19, 45, 1318, -1980, 12, 2762, - 1519, 184, 1980, -49, -270, 361, -172, -601, - -196, 186, -67, -124, 1503, -1011, 263, 223, - -384, 153, -21, -1063, -239, 1171, -3501, 512, - -162, -180, 139, -680, 609, -1919, 2969, -2321, - -183, 194, -558, 26, 91, 340, -25, -31, - 127, 662, 182, 191, -2201, -2603, 2252, -523, - 277, 50, 355, 295, -65, 355, 207, 82, - -489, -143, -218, 89, 666, -359, 2716, -2310, - -1912, 417, 400, 43, 110, -93, -142, 61, - -3000, 454, -153, 0, -413, 469, 339, 318, - -197, 75, -80, 2894, -129, 82, 1431, 1183, - 429, -1556, -1339, -1573, -92, -911, -230, -12, - -4, -145, -388, -419, -5, -241, 7120, 165, - -125, -122, 126, -150, 109, -146, -61, -49, - 47, 70, -43, 40, 1867, 1473, -1278, 1229, - -2256, -90, 10, -744, 1196, -109, 402, 258, - 690, -74, 26, 1294, -1079, 142, -2384, -324, - -1696, -2741, 321, 66, 83, -127, -131, 156, - 166, 135, 1812, -3445, 10, 535, -547, 481, - -2243, 287, -335, 218, 195, -1, -25, -94, - 195, 1433, -1428, -1444, 520, 219, 3363, -388, - -807, -454, -29, 316, 125, 159, -144, -156, - -317, 752, 256, 216, 340, 488, 147, -5662, - 55, -110, 387, -102, -211, -66, -26, 3688, - -172, -2366, -244, -5, 353, 11, 503, 88, - 227, 69, -240, -187, -58, -389, -1783, -1427, - 20, -618, 544, -1337, 628, -3180, 708, -538, - -423, 115, 49, -161, 184, -682, -223, 689, - 1299, -891, -1073, -1228, -305, 47, -2221, -1559, - 598, -380, 166, 143, -366, 287, 2122, 509, - 629, 235, 1523, 2900, -640, -425, -462, -231, - -53, -27, -263, 2090, -1892, -1147, -42, 866, - -2301, 461, -1082, -625, -85, 148, 229, -25, - 85, 53, 259, -81, -4072, 2577, -12, -7, - 335, -151, -691, -137, 98, 372, -37, -192, - -17, 3318, -558, 2064, 396, 258, -1067, 229, - 1122, 298, -25, 40, 27, -134, -166, -247, - -2010, -440, 1066, -1400, -3454, -289, 428, 629, - -158, 126, 129, 183, -12, -171, -120, 421, - -445, 66, -900, 3680, 1583, 1985, 25, 229, - -535, -1, 45, 207, -54, -30, 1581, -938, - -703, 405, 878, -398, -1069, 1748, -2587, -1419, - -375, -441, -487, 109, 21, -1399, 648, -271, - -701, 635, 115, -138, -458, -600, -1891, 585, - 420, -1916, 1135, 7, 1584, 910, 4267, 1328, - 279, 395, -35, -99, -168, 503, 216, -126, - 211, 212, 193, -2205, 491, 696, 41, 283, - 649, -3425, -999, 200, 625, -261, -378, -47, - -15, -30, -1262, 1700, -2191, 196, -1773, -251, - 84, 498, -261, 150, 451, 41, 336, 27, - -56, 562, -86, -1, -1073, 1461, 2148, -2961, - -326, -257, 440, -42, -48, -320, 122, 94, - -1267, -830, 2810, -94, -201, 990, 2415, -740, - -166, -267, -157, 68, 301, 290, 65, 931, - 1969, -170, 6, 149, -272, -105, 542, -11, - -3888, 105, 305, 333, -14, -39, 1944, -1164, - 88, 3829, -1190, -535, -644, -330, 509, -93, - -314, -228, -294, -342, -26, 1143, -2371, -400, - 74, 101, -68, -583, -1091, 3367, 1146, -638, - -436, 136, 41, -92, 1518, 2818, -2214, -2044, - 636, -2, 79, -508, 676, -439, -358, -198, - -69, 271, 59, 1638, 468, 97, 264, -8, - -5152, -152, 152, 252, 401, -375, -17, -132, - 51, 63, 633, -180, 367, 111, -18, 15, - -52, 128, -54, 11, 96, -122, -26, -7257, - -42, -1221, -688, 197, -107, -217, 141, -289, - 141, 269, 439, -747, -3743, 2098, 226, 137, - 26, -1645, -1735, -80, 43, -216, 245, 544, - 157, 40, 238, 237, -989, 379, 88, 639, - -1335, 1542, 1147, -510, 1008, -134, -626, 696, - -3034, 334, -689, 115, -168, 39, 1750, -649, - -233, -99, -231, 515, 112, -11, -162, -133, - -138, -486, -4137, 204, -102, 867, -1030, 219, - -254, -2787, -128, 961, -2837, -482, -195, 691, - -170, -178, 164, -54, -2008, -116, 74, 398, - -96, -472, 407, 27, 287, 628, 97, -1425, - -3923, 6, 117, -1081, 930, 396, 452, 87, - -441, -155, -738, 1089, 2128, -3133, -21, -622, - -48, -127, 506, 985, -200, 3361, 184, -522, - 41, 503, 209, 14, -96, 791, 1263, 289, - -101, -1728, -1073, -517, 4156, -685, 214, -721, - -608, -102, -295, -114, 126, -340, 109, 88, - -1588, 82, -549, -376, 76, 84, -210, 59, - -130, 321, 678, 4704, 564, -1, 100, 325, - -296, 256, -936, -886, -1088, -191, 476, -3684, - 1359, 12, -397, -70, -17, 58, 569, 353, - 821, -77, 253, 153, 5697, -171, 181, 3, - -90, -413, -265, 142, 62, 959, 151, -103, - 845, -340, -280, -733, -592, -244, 2534, 3089, - 935, -393, -105, 145, -666, -2865, -1532, 717, - 2867, 206, -800, -125, -34, -189, -138, 42, - 189, -141, 107, -3030, -3795, -494, 108, -149, - 382, 760, -142, 337, -844, 228, 124, 232, - -23, -1, 2298, 750, 636, -353, 157, 676, - -191, 812, 3434, 759, 543, -17, -213, -95, - 316, -693, -604, -1059, 32, -496, -3334, -272, - -104, -495, -130, 627, -376, 74, -599, 55, - -2185, -968, 517, -343, 21, -249, -963, 268, - 3339, 239, 771, -134, 42, 231, 75, 1633, - 331, -125, -414, 457, -316, 111, -475, 363, - -687, -4105, 469, 443, 113, 72, 1498, 406, - 915, -229, 564, -377, 89, 137, 39, 2, - -29, -416, -149, 3598, -253, 12, -1015, 3016, - 916, -726, -2286, -99, -1085, -238, 690, -44, - -51, -115, 25, 56, -905, -3050, -1121, -24, - -2160, -1424, 1009, -180, -424, 188, -417, -66, - -86, 74, -28, -225, -937, -90, 251, -1850, - 1939, 1843, 833, -1879, -192, -318, 103, -363, - -22, -57, -2833, -118, -277, -98, -85, -495, - -874, 3027, -141, -1490, -172, -266, -32, 190, - -12, -364, -380, -2107, 249, -217, 662, -584, - 89, -563, 1153, -3091, -656, 463, 144, -26, -}; - -static const int16_t cb4448ss1[] = { - 6475, -60, 162, 42, -71, 50, -85, -278, - -14, -60, -53, 132, 28, -65, -71, -62, - 6, 119, 195, -140, 28, 37, -603, -4956, - -290, 700, -241, 11, -301, 297, -1009, 468, - 885, 192, 40, 495, 846, -28, 201, -255, - 927, -644, 2424, 2882, -82, -1764, 1077, 315, - 946, 843, 399, 176, 567, 546, 377, 283, - 2469, -1815, -65, 12, 422, -368, -639, -493, - -5606, 84, 122, 241, 267, -8, -257, -23, - -220, -118, 139, -1582, -218, -2436, 2539, -270, - 146, -262, -489, 1551, 604, -225, 363, 234, - -110, -166, 1058, 2342, 1950, 43, 2362, -1189, - 492, 172, -296, 159, -430, -311, -135, -182, - 77, -444, -1995, -855, 2080, -457, 389, 872, - 2549, 935, -128, 519, -374, 310, 96, 119, - -263, 1981, -1019, -628, 212, -173, -2292, 1066, - -1985, -426, 115, -746, 147, 3, 94, 195, - -1762, 1713, -337, 1884, -123, -480, 95, 777, - 1073, 2117, -969, 16, 11, 123, 374, -394, - -1419, 829, 1657, 1294, -2770, 286, 813, -290, - -115, 111, 312, 53, 44, 896, 34, -2288, - -3443, -2053, 98, 293, 429, -168, 74, -58, - 221, -383, 100, 63, 1925, -1207, 199, 94, - -94, 3060, 1825, 611, 292, -141, 382, 141, - 105, -151, 0, 1448, -267, 206, 932, -682, - 251, -183, 1080, 161, 4334, -397, 525, -91, - 127, -104, 921, -2282, -274, -1070, 387, -312, - 1380, 2769, -554, 1501, -921, 102, -183, -104, - -66, -1656, 2049, 122, -2271, 84, -276, -204, - 353, 380, -414, -1757, -1035, -318, -130, -10, - 163, -471, 2425, 2864, -1892, 294, 817, 754, - 277, -29, -214, -39, -312, -57, -54, 986, - 2286, -574, 34, -641, 3783, 214, -399, -155, - 38, -148, -42, -89, 97, -17, -2192, 729, - 272, 1168, -3593, 150, 96, -473, 211, -60, - 136, -26, 142, -285, 93, 666, -465, -181, - 2016, -338, -2186, -2608, -449, 107, -18, 45, - 24, 245, -119, 244, 442, 1509, 158, 242, - 169, -16, -221, 104, 115, 16, -217, 23, - -25, 130, 4076, 662, -315, 3068, -35, 36, - 2785, -223, -528, -157, 43, 186, -514, -240, - 15, -245, 520, -110, -781, -641, 294, -20, - 64, -44, 400, -109, 4756, 1334, -421, -195, - 130, -2182, 64, -897, -1423, 3081, -523, 378, - -164, 968, 593, -192, 71, 114, -143, -10, - 1961, -3141, 3173, -39, -110, -57, 144, -68, - -429, 30, -10, 467, 159, 40, 67, 260, - 814, -168, -836, 1073, -3562, 1786, -1205, -148, - -105, 94, 5, 143, 138, 18, -1384, 20, - 635, -126, -71, -87, -320, -407, 559, -151, - 1312, -4395, -755, -263, -77, 1657, 699, 426, - 469, -469, 253, -80, 317, -71, 268, 3592, - -2051, 304, 157, 43, 1872, 3794, -1537, 1226, - -159, -335, 340, -385, -253, -195, 21, 106, - -31, -187, -63, -2771, 446, -708, 202, -186, - 548, 832, 1757, -1274, 1234, -756, -160, 76, - -82, 64, 2169, 13, -849, 244, -2486, -2138, - 844, -178, 270, 297, 150, 202, -41, -188, - 121, -1272, 371, -319, 2848, -469, -2059, 1290, - -457, -380, 690, 148, -51, -340, 113, 57, - -1259, -396, -1404, 336, -511, 576, 4441, 124, - 143, -483, 85, 138, 196, 38, -188, 1177, - -764, -2067, 820, -264, 218, -300, -501, -230, - -2529, 1349, -1606, -199, 92, -55, -1324, -702, - 2078, -1269, 414, -50, 29, 12, 87, -593, - 217, -82, 94, -2392, 308, 2315, 2188, 768, - -1103, -77, 579, 1706, -826, -224, -297, 145, - -640, 570, 146, -199, 1187, -872, 327, -310, - -122, -23, -13, 808, -139, -4425, -670, 412, - -4, -70, -162, -1056, 685, -312, -957, 339, - 893, -252, 4040, -105, 76, 993, 281, -79, - -139, 168, -298, 795, -1107, 395, 386, -524, - 1052, -2341, 2537, 474, 726, -1028, -357, -52, - 115, -9, 1349, -2240, 785, 2751, 77, 922, - 385, -539, -148, 410, 251, -70, 199, 51, - 1728, -206, 1181, 1182, 1388, -791, 121, -3, - 8, -147, -95, 101, 886, -2412, 19, 2401, - -116, 718, -592, -221, 724, -33, 690, -180, - 868, -3330, 377, -336, 128, 267, -2075, 2848, - 2994, -300, 3, -153, 41, -456, 38, -31, - 309, -106, -92, -14, 96, 672, 634, 207, - 1556, 438, -2147, 282, 2443, -1662, 511, 457, - -259, -505, 173, -204, -858, -117, 2751, 852, - 220, -512, -2576, 1542, 357, -77, -4, 165, - -63, 189, 302, -699, -764, -1559, 25, -233, - 405, 173, 698, -73, -300, -1442, -2923, -1326, - -25, 98, -196, -2915, -1169, -3392, 691, 353, - -196, 96, 41, 180, 198, 280, 207, -158, - -19, 1556, 991, -523, -280, -1599, 1368, -3247, - -996, 159, -136, -469, -48, 0, 30, 95, - -765, 33, 6580, -180, 316, -176, 105, -21, - -9, 166, 148, -52, -49, 42, 2, 318, - -55, -91, -1461, -1474, -3086, -756, 1479, -29, - -668, -255, -51, 241, 249, -212, 132, -129, - -410, 113, 17, 301, 185, 96, 10, 188, - 38, -772, 5152, -13, -10, 1527, 806, -23, - -79, 1102, -77, 329, -99, -404, 2276, -873, - -2681, -765, 71, 20, -2448, -803, 1827, 1115, - -160, -15, 288, -46, 573, 100, -726, -694, - -406, 288, 61, -2216, -904, 77, -2983, -962, - -1438, 809, -38, -79, 95, 52, -231, 518, - 115, 41, 908, 780, 805, -207, -2161, 554, - 968, 3111, 133, -158, -13, -34, -182, -60, - 105, 718, -1245, 227, -818, 1184, 903, 603, - -988, -2647, 1847, 141, 817, -337, 131, 393, - 1653, 839, -261, 466, 465, -297, 1440, -431, - 2058, -1857, -1416, 310, -722, -54, 203, -266, - 3770, 172, -593, -73, -508, -61, 1110, 1261, - 275, 1681, 447, -147, -95, 33, 1281, -3119, - 24, -308, 366, -468, 232, 358, 667, -942, - 696, -924, -2059, -62, 151, -2102, 332, 258, - -186, -636, 685, 214, -3174, -1243, 573, -276, - 9, -262, -20, 158, -174, -21, 593, -6198, - -266, -270, -63, -203, 63, -396, -100, 191, - 212, 85, 120, -791, 37, -47, 2108, 652, - 519, 346, 106, -1840, -2566, -563, 14, 266, - 10, 214, 504, -1269, 50, 164, 120, -105, - -546, -212, -79, 41, -171, 675, -252, 4373, - -16, -1697, -1491, -3588, -587, 623, 67, 269, - 484, -25, 1067, 580, -598, 195, 47, -17, -}; - -static const int16_t cb4448sm0[] = { - -5114, 166, -785, 635, -528, -102, 269, 492, - -185, -614, 122, -124, 85, 145, 270, -154, - 39, 2524, 58, -57, 119, 5, 343, 2873, - -278, -787, 137, 62, -169, 2049, 1476, -325, - 130, -702, 2882, -19, 310, -258, -135, 88, - -268, 69, 69, 695, -1935, 815, 678, 44, - 3085, 278, -587, -1326, 360, 145, -17, 66, - -2475, -594, 132, 358, 406, -369, -237, 3363, - 329, -424, 52, 49, 291, -236, -2332, -261, - 49, -27, 170, 3656, -214, -603, 264, 60, - -87, 145, 116, 179, 190, 679, 339, -340, - 3272, 641, -2631, 484, 159, 305, 290, 208, - 226, 68, 102, -145, -356, 153, 647, -2046, - 937, -1666, 1093, -29, -1161, 749, -2360, 171, - -2185, 841, -1406, -1057, -1764, -300, -205, 452, - 2168, -214, -153, 291, -106, 79, 1717, -20, - -1771, 286, -466, 686, 167, 137, 5, 43, - 1075, -2601, 261, -86, -333, -724, 162, 186, - 4, -334, -412, -309, 888, -114, 531, 297, - 4284, 297, -1695, -212, 75, -263, -2313, 102, - -434, 352, -1813, -472, 114, -185, 6, 66, - 8061, 414, -577, 672, -152, 152, 1, 38, - -66, 48, -35, 62, -98, -19, -3762, 98, - 242, 114, 359, -162, 115, -3038, 340, 253, - -526, -144, 14, -147, 28, -352, -5858, 46, - -597, -392, 226, -54, -70, -47, -45, 16, - 53, 137, 172, -3017, -22, -163, -267, -3289, - -31, -174, 110, 794, 425, 67, 58, -72, - -156, 3937, -585, 2116, 99, -1115, -257, 801, - 270, -329, -257, -18, 122, -369, -2196, 1746, - -305, 599, 800, 749, 1466, -299, -1519, -255, - -233, 217, -117, -256, 301, -249, -327, 5530, - 86, 135, -784, -137, 610, -7, 55, 93, - -106, -50, 267, -229, -26, -1070, 13, -75, - 1733, 2929, -130, -713, 15, -2144, 104, -318, - 282, -8, -285, -468, -124, 59, 520, -78, - -332, -654, -5048, 212, -388, 97, -1523, 227, - -2545, 2159, -127, 1020, 79, -664, 403, -31, - -356, -1, -436, -86, 75, 610, 3048, 235, - -3133, -1189, -44, -23, -324, 260, 469, -113, - 22, 53, 525, 427, 469, 1016, 420, 493, - -1229, -238, -2671, 361, -2745, 193, -253, -59, - 15, 53, -57, 36, -144, 127, 25, 11, - -34, 6560, -12, -80, -72, 70, 654, -1135, - 158, 279, 298, 746, -190, -1382, 138, 527, - -1504, -2753, -106, -55, 225, 54, 136, 53, - 506, 174, 268, -533, -43, -416, -196, 6266, - -81, 22, -158, 350, 1177, -728, 594, 34, - -368, -226, -584, 247, 804, -1141, 78, 3923, - -53, 309, 58, -45, -7634, -73, 39, -152, - 55, -77, -45, -62, -25, -247, -161, 28, - -2629, -401, -295, -687, 298, -3240, 0, -251, - 7, -49, 494, -198, 202, 2201, -301, 83, - 45, -964, 256, -1499, -2394, 24, -267, -599, - 46, 161, -370, 81, 636, 3146, -2077, -964, - 322, 400, -635, -688, -630, -92, -235, 104, - -77, -541, 511, 2722, 441, 2757, 952, 739, - -257, -254, -438, -122, -151, 12, 578, -92, - -440, -63, 93, 4971, -499, 419, 1374, -165, - -417, 64, -13, -235, 1080, -77, 536, 68, - -842, -772, 1627, -471, -1350, -144, 2849, 219, - 114, 68, -55, 350, -11, -1334, -3042, 1166, - -147, -891, -483, 1461, 339, 808, 362, -101, - -2807, -24, -377, 518, -438, 194, -110, 194, - -826, 3380, -81, -30, -43, 103, -99, 1539, - -614, -13, -1154, 196, -3122, -521, 1454, -319, - 159, -428, 722, -208, 162, 1871, 2534, 2287, - 946, 261, -483, -645, 26, -170, -31, 17, - 164, 104, -44, -8192, -20, 94, -235, 56, - 68, -58, 380, -25, -170, 17, 16, -154, - 63, 477, 1280, 614, -529, -2347, -360, 159, - 1967, -2085, 485, 335, 378, 178, 1633, -437, - -46, 23, 640, 1465, -91, 1279, -1025, -1007, - -236, 2632, -257, 262, 177, 3029, -3149, -1001, - 231, -262, 87, -243, -68, -597, 109, 62, - -264, 37, -463, -3105, -633, 881, 1026, -86, - 417, 705, -1144, -68, -2084, 46, 124, -36, - -2461, -73, -126, -303, 1079, -358, -2764, -761, - -1454, -245, 203, 0, -179, -117, 2571, -4751, - -20, 194, 298, 258, 390, 270, -36, 182, - 152, -56, -97, -47, 138, -233, -111, -1490, - -490, -329, 662, -320, -4697, 443, 66, 352, - 203, -114, -119, 186, 649, -106, -5, 2280, - 1132, -376, 1168, 919, 1858, 271, -1741, -130, - -3388, 264, 618, -2375, 260, 1279, 110, 732, - 128, -373, 54, -182, 99, -131, 9, 30, - -83, 27, 204, 109, -306, 6903, 130, -7, - -115, 92, -241, 119, -640, -871, -40, 372, - -68, -147, -1503, -58, 920, -466, 311, 144, - -3648, -121, -357, 5, 1968, -737, -1491, 596, - 818, 122, 688, -137, -2415, -368, 236, 71, - -597, -193, -395, 795, 855, 657, -49, 844, - -3320, -1921, 846, 17, -293, -17, -1676, -1826, - -138, 897, -207, -3, 1838, -901, 86, 275, - 964, 230, 510, -10, 2879, 3949, 332, 289, - 109, -229, 18, 238, 244, 287, 44, 103, - 367, 21, -1134, -378, 1338, -828, 3500, 5, - 1027, 475, 208, 654, 589, -92, 236, -85, - -115, 1095, -2504, 827, -885, -806, -155, 2112, - -346, 1120, -350, -911, -234, 231, 55, 87, - 1957, 601, 755, -1248, 753, -2726, -481, 2038, - 96, -363, 309, 150, 299, -561, -698, -1030, - 118, 1224, 3240, -1523, 1476, 342, -688, -76, - 192, -8, -319, 350, 149, -331, 155, -436, - 286, -994, 160, -2696, -423, -2798, -135, -108, - -2846, -254, 3590, 350, 130, -810, 463, -123, - 59, -256, 251, -750, -76, -8, -1633, 150, - -931, 1958, 1523, -2527, 239, -287, 172, 332, - -13, 486, 247, -26, 149, 59, 130, 265, - 19, 209, 7220, -23, -99, -69, -66, -70, - -54, -75, 60, -264, -102, 1079, -535, 1587, - -557, -1499, 241, -2596, 1157, -140, 270, 33, -}; - -static const int16_t cb4448sm1[] = { - 7894, -331, 383, -556, 63, -371, -23, 73, - 46, -145, 105, 43, -199, -52, -85, -85, - 13, -21, -230, 7379, 268, -243, -460, 251, - 73, 12, 115, -18, -247, 433, -90, -518, - 962, 0, -960, 184, -305, -2003, 276, 1696, - 2418, 270, -2140, -215, -534, -389, -403, -3500, - 416, 567, -393, -183, 253, -100, -285, -107, - 100, 281, -527, -2944, -86, 2652, 311, -785, - -811, -283, 425, -77, 393, 136, 170, 1290, - -765, 108, 676, -213, -1226, -470, 427, 3499, - 616, -1211, -226, -37, 88, -2792, 351, 78, - -2975, 99, 192, 1390, -338, 47, -8, 58, - -255, 50, 221, -49, -788, -207, -2122, -167, - -692, 379, -3239, -965, -698, -463, -45, 34, - 1785, 1026, -1107, 113, 124, -258, -277, -714, - 2764, -178, -200, 907, -45, -213, -2575, -530, - -112, 3616, -128, 76, -366, -135, -22, -51, - 125, -100, -79, 142, 54, 107, 87, 493, - -34, -221, -448, -243, 994, 845, -4656, -105, - -487, 41, -112, 349, -4328, -72, 513, -112, - -685, -470, -138, -541, 340, -1505, -24, 37, - 169, -405, -434, -2994, -42, -416, -1927, 1551, - -1488, 420, 179, -66, 14, 92, 147, 141, - 497, 404, -412, 2301, 336, -2877, -1845, -948, - -784, 262, -211, 6, -1678, -434, -1433, -727, - 1254, 542, -1430, -302, 1558, 107, 617, -833, - -369, -178, 1682, -2569, -1232, -1556, -87, -178, - 400, -178, -427, -124, -63, 142, -221, 33, - 2880, -227, -356, -466, -3362, -398, -167, 164, - 126, 59, -1, 5, 212, 25, 2062, -462, - -33, -46, 45, -201, 823, -268, -302, 3623, - 389, 382, 136, -30, -64, 2, -600, 3114, - 2720, 273, -588, -235, -313, -141, 37, -28, - 355, 184, -433, -110, -576, -56, 134, -623, - -271, -2529, -2753, 947, 1319, -2, 620, 36, - -412, -1986, 221, -404, 514, 3223, -106, 1497, - -368, -167, -142, -366, -125, 16, 142, -435, - -160, 2845, -153, 470, 387, 3117, -75, -375, - 658, 259, 755, -3, 3744, -517, -1446, -667, - 1372, -1692, 117, -96, 195, -201, -134, -76, - 179, 97, 71, 1887, 161, 365, 228, 1177, - 235, -834, -48, 1667, -1123, 2217, -209, 100, - -219, -2778, 81, -579, 3421, -326, -492, -233, - 78, 32, 117, -74, -80, 85, -282, 453, - 500, 721, 800, 83, -624, 1000, 165, -20, - -516, -4193, -334, 107, 1221, -1507, -10, 523, - 85, -44, 21, 34, 199, -106, -2233, 525, - 2138, 40, -55, -63, -8179, 326, 333, -152, - -27, 137, 212, 130, -10, 76, -61, -113, - -544, -179, -187, 0, -5308, 322, -326, 513, - 415, 375, -92, -354, 69, 77, 65, 93, - -352, -165, -1837, 1790, 914, -276, 2215, -1418, - 343, 281, 4, 283, 4398, 1695, -248, 153, - -166, 751, 822, -406, -456, -251, 185, -251, - -222, -169, -266, -6323, 249, -40, -45, -203, - 47, -83, -621, -174, 327, 30, 114, -29, - -505, -224, 1804, 1582, -2292, 2102, -746, -421, - 170, 438, -171, 153, 84, -157, -2937, -123, - -81, -227, -98, 263, 3531, 36, 105, -479, - -94, -357, -22, -124, 279, -116, 543, 201, - -393, -226, -2255, -133, 1613, -123, 2687, 70, - 191, 240, -996, -676, 606, -1245, -306, 413, - -272, -539, 485, 3583, -224, 432, 389, 31, - -888, 318, -149, -228, 764, -426, 1608, -2656, - 254, -2193, 252, 484, -90, -117, -257, -2210, - -156, 553, 559, 680, 298, -16, -519, 1172, - 2172, 1288, -113, 186, -199, -1415, -83, -1984, - 667, -1013, 344, -399, 2889, -1175, -908, 186, - 185, -22, -328, 3132, -1166, 209, -213, 386, - 2140, 552, 1023, 719, 529, -169, 421, 196, - 76, 1995, 532, -75, 2060, -526, 396, 2974, - -264, -348, 149, 586, 22, 97, -337, -252, - 357, 103, -2308, -2578, -1836, -277, 346, -314, - -989, 185, -314, 102, 56, 3779, -265, -1029, - -12, -126, -431, 356, -2493, -86, 172, 116, - 61, -146, -2220, 211, -165, 233, -327, 73, - -7, -104, -546, 253, -2406, 361, 2252, 486, - 675, -177, 2643, 603, 300, 1123, -642, 361, - 684, -2151, 569, -1014, 120, -50, 321, 3174, - 3080, -733, -427, 299, 169, -123, -140, -13, - -315, 21, -120, -24, 174, -191, -350, -7842, - -145, -169, -419, -15, 150, -130, -73, 162, - -9, 38, -287, 109, 390, 147, 151, 1907, - -4243, 7, -207, -147, -230, -343, -117, -111, - 107, 132, 1457, -88, -8, -445, -176, -172, - -1799, -813, 486, 1150, -3026, -168, -2620, -584, - 178, -543, -1868, -359, -113, -1783, 214, -663, - 473, 866, -136, 169, -3324, -129, -3404, -249, - 234, 422, 251, 340, -343, 231, 134, -42, - 32, 64, -209, 12, 236, -267, -419, 1, - 260, -109, 6508, 105, 7, -273, -123, -107, - -152, -274, -157, 75, 74, -201, 46, 37, - 338, -21, -180, 208, -6417, 794, 250, -81, - -585, 4, -119, -314, 529, 219, 159, -132, - -277, 76, -613, 4933, 15, 213, 2461, 286, - 542, 177, 2767, 389, 136, 750, 559, -994, - 684, -12, -2081, -546, -89, -3733, 548, -620, - 675, 118, -121, 190, -52, 19, -19, 25, - -1224, 344, 3094, -2067, 7, 273, -1268, -375, - -297, -201, 271, -191, 123, 6, -260, 2284, - -308, -3062, 242, 668, -221, 1146, 1218, 473, - -133, 82, 57, 112, -1677, 78, -229, 354, - -463, 763, 1628, 2243, 1386, 1630, -145, 255, - -60, 228, 195, -864, 2539, -466, 985, -3075, - 2, 118, 221, -395, -450, -256, -158, -32, - -3829, 2012, -50, -465, 146, -1091, -318, 271, - -12, 596, 160, 120, 92, -209, -335, 104, - -28, 689, 305, -548, -849, 1617, 605, 185, - -414, 3899, -273, 51, 182, -192, 121, 616, - 1219, 414, -959, -4219, 1319, 60, 246, -468, - -32, 225, 338, -39, 1235, -2079, 2250, 626, - 121, 296, -137, -339, -1870, -47, -397, 124, -}; - -static const int16_t fcb8l[] = { - -1239, -1310, -1240, -1146, -1337, 1303, -482, 2215, - 2026, 2222, -1144, -1188, -1209, 2535, -1111, -844, - 1485, 625, 1254, 1204, 5932, -1116, -1235, -1208, - -801, -1020, -558, 1387, 1513, -1079, 3220, -896, - -1083, -1166, 2246, -1210, -838, -950, -960, 764, - 13941, -1307, -817, -1253, 1850, -1320, -1361, -1218, - -671, 780, -839, -1068, -776, 2977, -714, -944, - -823, -580, 357, 591, 302, -1078, -895, -1020, - 3116, -1144, 1438, -891, -71, 1528, -238, -1297, - -1020, 4616, -1185, -514, -1154, -1157, 1901, 2372, - -1131, -1289, -1273, -1289, -1311, -1331, -1340, 439, - 455, 2395, -537, -1180, 2409, -1084, -580, 1937, - 846, -51, 615, 1099, 3854, -1177, -912, -1095, - 656, -995, -647, 3298, -976, -436, 12323, -1291, - -1187, -1341, 4779, -1368, -1357, -1317, -985, 1407, - -513, -1387, -1224, -1069, -1218, -1117, -181, -1209, - 5376, 4256, -22, -1232, -1173, -834, -1054, -947, - -611, -822, -206, 5572, -988, 1067, -837, 738, - -332, -38, -59, 143, 248, 386, -447, -1233, - -1258, -1169, 3653, -1045, -657, -926, 2004, 2201, - -1164, 7042, -1302, -1313, -812, 150, -129, 305, - 442, 742, -1185, -1293, -1220, -872, -1304, -1260, - -853, -1293, 2962, 3011, -178, -1187, -1087, -896, - -895, -1053, 3788, 59, -169, 1632, -1201, -1289, - 5263, -896, 331, -852, 218, 825, 1129, 1024, - -39, -1186, -1054, 1862, -1198, 2010, -1075, -1005, - 702, 1550, 4491, -1055, -890, -645, -987, 2465, - 529, 194, -72, 370, 1547, -968, -849, -1153, - 6459, -1164, -1061, -1020, -838, 125, 3698, -1168, - -1066, 1882, -1159, -439, -1017, -759, 744, 1302, - -812, -985, -1002, -1029, -871, 3690, -170, 604, - 623, 1272, 6135, -1012, -1231, -1066, -927, -1082, - 2393, -843, 1537, 1240, -866, -1161, -866, 6639, - -994, -860, -264, -298, 469, 1184, -868, -1262, - 2167, -1177, 2132, -987, -563, 969, 1145, 1508, - -735, -1232, -1090, -1204, 1507, -1101, -393, 755, - 975, 1246, 1944, -1068, -1169, -1040, -987, -1301, - 5488, -1057, 3150, 1890, -1133, 2725, -1123, -963, - 1901, 260, -484, 449, 564, 1144, 679, -1118, - -989, -702, -556, 162, 689, 712, 673, 443, - -695, -1247, -1019, -1065, -406, -1143, 1750, -743, - 2644, 2402, -1171, -1157, -1059, -823, -688, 1314, - 1458, 629, 857, 856, -875, -1316, 3470, -1061, - -846, -761, -712, -955, 978, 1967, -980, 3517, - -994, -953, -903, 56, 228, -30, 359, 560, - 9926, -1178, -1056, -627, -952, -481, -1168, -268, - -701, -555, -887, -1212, 1768, -1156, -396, -755, - -119, 1594, 949, 1201, -844, 1734, 1312, -331, - -500, -280, -125, -219, -139, 496, -1121, -1227, - -1145, -215, -1123, -765, -173, 4055, 1086, 1465, - -714, -904, -901, -713, -1073, 1233, -797, 645, - 58, 897, -518, -624, -441, -554, 1139, 549, - 147, 72, 127, 428, -1104, -979, 2433, 1867, - -237, -745, -280, 110, 794, 631, -1049, 1141, - -974, -920, -849, -392, 634, 414, 614, 797, - -1162, -1344, -1192, -1259, -1079, -912, 2717, 2548, - 1847, 1920, -1004, -1091, -1006, -692, -85, -24, - 1014, 1427, 751, -584, 6057, -1206, -1072, -795, - -921, -1103, -1157, -623, -818, 2641, 3121, -1084, - -1095, -939, -664, -694, 884, 555, 144, 593, - -874, -1074, 417, -1027, -6, -790, 1687, 80, - 1018, 738, -527, -958, -701, -377, -4, 155, - 304, -348, -947, -342, 2269, -1040, 1124, -494, - -76, 76, 2, 114, -194, 348, 904, 466, - -577, -717, 107, -39, -29, 158, 101, 149, - -968, -921, 558, -264, -445, 138, -121, -33, - 105, 243, -478, -1047, -937, -751, -609, -822, - -709, -976, -1006, 2800, -1108, -1292, -1055, -1272, - -1295, -1152, 305, -1144, 635, 2067, -584, -1135, - -663, -1130, -754, -1009, -937, -515, 1473, 841, - -1235, -1338, -1305, -1141, -1109, -1217, -238, 1915, - 3550, 2306, -963, -985, -874, 763, -826, -694, - 19, 391, 379, 776, -582, -1216, -1285, -1164, - -1276, -1305, -1273, 2631, -579, 2487, 1058, -655, - -808, -878, -910, -1006, -1122, -590, -663, 428, - 2185, -1125, -1032, -1076, -873, -1139, -1029, -477, - 1720, 1238, -1111, -1311, -1343, 1074, -1328, -1181, - -970, -386, 2359, 1777, -1045, -1189, -1117, -1053, - -942, -329, 501, 1237, 808, 1022, -866, -1048, - -678, 1597, 1528, -262, -256, 231, 418, 728, -}; - -static const int16_t fcb8s[] = { - -1022, -858, -773, 304, -881, -771, -341, 937, - 270, 420, -684, -1000, -795, -903, -671, -575, - 14, 3327, 528, 893, 965, -541, -947, -1027, - 4008, -1081, -743, -991, -808, 933, -1406, -1173, - 7513, -824, -213, -797, -648, -40, 176, 217, - -1298, 6743, -755, -232, -440, -680, -269, -60, - -80, -85, -893, -1044, -726, -733, -834, -641, - 231, -779, -501, 1832, -1296, 2548, 2754, 19, - -210, -708, -205, -74, 18, 55, -1225, -1123, - -1239, 6991, -689, 272, -290, 56, 356, 675, - 1623, -1134, -607, 1426, -872, 511, -1060, 408, - 253, 423, 1960, -1337, -1152, -985, -924, 2020, - -398, 348, 4188, 1044, -650, -831, 2909, 2083, - -457, -5, -1037, -964, -128, -40, 6019, -858, - -937, -559, -624, -601, -411, 120, -289, 412, - -1271, -1351, 3858, -1214, 2224, -325, -165, 535, - 559, 386, 1868, 649, 269, 245, -708, -778, - -179, -12, 101, -12, -1235, -892, -829, 2570, - -574, -431, 170, 167, 492, 531, -930, -1093, - -1037, -1177, -1151, -912, -466, 303, 1601, 4089, - -1234, 3160, -631, -1090, -741, -274, 103, 13, - 356, 289, 2709, -1115, -1011, -965, -948, -563, - 1939, 870, 1187, 550, -1028, -1217, -726, -954, - -694, -753, 3729, 141, 518, 854, -1102, 1138, - -947, -620, -379, -436, 72, 449, 432, 428, - -1112, 1276, 544, -334, -445, 179, -32, -37, - 9, 28, -1252, 2983, -963, 1256, 419, -10, - 17, 211, 218, 191, 126, -942, -691, -529, - -533, -193, 1216, 150, 389, 152, -1191, -987, - -942, -860, -463, -705, -159, 184, 1893, 1080, - 1753, -694, -609, -699, 61, 269, -126, 93, - 236, 380, -527, -966, -334, 163, -662, 3295, - -477, 591, 259, 638, 397, 181, -598, -129, - 35, -51, -122, 64, -32, -98, -1351, -1140, - 3372, -753, -776, 718, 513, 134, 420, 354, - -1128, -546, -743, 297, 1819, -77, 179, 17, - 181, 206, -1028, -1027, -757, -755, -389, 1035, - 227, 249, 315, 395, -931, -881, 1207, -777, - -165, -531, -375, 73, 346, 332, -1159, -788, - 1196, 959, -432, -337, 243, 176, 321, -7, -}; - -static const int16_t fcb8m[] = { - -1379, -1331, -1277, -1266, -927, 0, 2552, 2575, - 425, 48, 2568, -26, -841, -762, -679, -562, - -420, 186, 68, 69, -743, -193, 266, 92, - 1714, -241, -357, -93, -252, -222, -884, -385, - 2436, -446, -150, -533, -192, -33, 226, 8, - -756, -1180, -1238, -1258, -1250, -1147, -764, 141, - 3075, 4136, -1255, -1288, -1202, -1188, -1222, -1257, - -500, 1989, 4062, 1328, -300, -186, -399, -329, - -330, -533, -313, 2030, 193, -128, -933, -1016, - 66, 1648, -228, -321, 236, 114, 356, 212, - -677, -826, -784, -670, -484, -423, -188, 215, - 2476, 652, 3424, 1991, 940, -576, -942, -1038, - -1097, -1161, -1120, -956, -763, -416, 2824, 1429, - -693, -755, -455, -670, -535, -225, 4814, 116, - -940, -953, -1008, -856, -797, -582, -531, -213, - -412, 2479, -156, -218, -319, -168, -236, -248, - -305, -515, -224, -382, -501, -759, 139, 1789, - -258, -343, -167, 721, -1014, -1092, -975, -1070, - -1126, -778, -178, 36, 522, 5371, -402, -1351, - -1577, -1662, -1642, -1560, -1249, -870, 602, 8968, - -1126, -1102, -1118, -1072, -946, -511, 482, 1635, - 1108, 2471, -935, -748, -302, -445, -810, -359, - 1433, -83, 336, 1834, -712, -773, -752, -609, - -391, 625, 2550, 403, -447, -18, -261, 91, - 5096, -199, -887, -1018, -728, -930, -921, -684, - -22, 2422, 2118, -417, -757, -789, -732, -794, - -785, -664, -627, 885, 471, 798, -429, -684, - -454, -185, 185, -26, -990, -369, 1048, -25, - -98, 720, 41, -60, -3, -92, -790, -147, - 846, 4007, -346, -907, -849, -730, -639, -842, - 9096, 617, -1164, -1275, -1380, -1396, -1391, -1364, - -1342, -1080, 655, 5687, 505, -818, -1134, -1125, - -1136, -1123, -1088, -996, 3, 36, -48, -28, - 121, -55, 172, -43, 21, -74, 1537, -69, - 378, -38, -113, 159, -149, -609, -693, -796, - -715, 588, 376, -744, -659, -316, 145, 448, - 659, 320, 787, -315, -956, -682, -595, -327, - 146, 348, 837, 577, -1011, -1014, -647, -159, - 679, 158, 294, 670, 507, 540, 418, 558, - 12, -674, -901, -897, -827, -682, 323, 2580, -}; - -static const int16_t fcb8sl[] = { - -1269, -1637, -1349, -1672, -1421, 2750, 212, 3563, - -74, 1555, -1495, -1148, -1172, 1351, -484, -473, - 1418, 557, 899, 635, 6124, -1140, -1154, 783, - -1444, -1509, -1041, 1793, 4459, 1325, 2055, -921, - -794, -713, 1625, -50, 78, -159, 361, 855, - 10282, -1533, -1105, -1582, -1704, -1697, -1440, -1001, - 864, 2038, -1347, -847, -1419, 1474, -1369, -1189, - -1125, -655, -134, 950, -1398, -222, -1498, -1262, - 2597, 729, 2521, -544, 457, 2058, 3821, -1568, - -1577, 2013, -1717, -1620, -1292, 2771, 2559, 4942, - -1497, -1576, -1724, -1550, -1775, -1734, -1097, -635, - 1934, 2706, -1399, -994, 1685, -1142, -511, 1595, - -275, 861, 484, 958, -1374, -764, -1105, -1493, - -1678, -1630, -521, 5138, 53, 1331, 4909, -1376, - 2134, -1638, 1562, -1565, -1487, -1625, 3232, 4742, - -1017, -1353, -1212, -1585, -1309, -1139, -71, -820, - 5928, 2987, -641, -1314, -1198, -1182, -1005, -542, - -1287, -1210, -1103, 6865, -1130, 1375, -884, 1241, - -532, -173, -68, 15, 309, 192, -1128, -1107, - -849, -1343, 2233, -1281, -535, -679, 3878, 1865, - -1427, 4508, -1022, -747, -1117, -1104, -33, 669, - 1216, 1482, -1360, -1075, -1483, -1390, -1366, -754, - -1042, -766, 3467, -624, -968, -1101, -393, -890, - -447, -995, 2346, -909, -784, 977, -1141, -1201, - 5256, -1552, -536, -1419, 0, 596, 556, 1654, - -1124, -1225, -830, 1267, -719, 1791, -546, -297, - 978, 378, 2674, -1261, -1159, -951, -1027, 2537, - -470, -360, -268, 1098, -1154, -1513, -729, -1455, - 5671, -1236, -800, -874, 1630, 1273, 1909, -623, - -724, 1417, -559, -326, -257, -189, 265, 220, - -284, -1302, -1272, -1223, -842, 4338, -934, -1001, - -495, 2944, 4295, -924, -1004, -1097, -1024, -328, - 1736, 106, 452, 158, -1024, -541, -1296, 4376, - -1117, -1224, -843, 1097, 1121, 1251, -829, -1374, - 2292, -1505, 1850, -1153, -943, -979, -534, 1444, - -1510, -1494, -1147, -1397, 1535, -794, -21, 1313, - 638, 1015, -1072, -1275, -1166, -1602, -1618, -1379, - 4541, -226, 2169, 888, -1369, 2392, -1087, -948, - 1074, 674, 384, 124, 500, 749, 398, -1091, - -721, -114, -15, 413, 200, 135, 290, 189, - -1185, -1188, -1339, -1549, -871, -574, 2333, -346, - 554, 3773, -1247, -1531, -1408, -1310, -1007, 2861, - 2465, 608, 1080, 1224, -1103, -1477, 1884, -1412, - -904, -1473, -846, -188, 782, 2049, -1473, 1531, - -1530, -1459, -1546, -1260, -856, 1191, 652, 933, - 5072, -1456, -1653, 3759, -1751, -531, -1391, 4297, - -374, -751, -1570, -1242, 1461, -1286, -913, -621, - 1768, 1246, 1291, 779, -1360, 1641, 1122, -629, - -328, -197, 241, 359, 560, 536, -1474, -506, - -1523, 298, -1551, -1254, -985, 3603, 4317, 958, - -885, -241, -1159, -930, -1249, 1490, -825, 274, - 347, 307, -1060, -1027, -809, -1063, 1554, 1708, - -242, -23, 424, 804, -1317, -853, 1571, 1898, - 239, -556, 298, -161, 777, 765, -1464, 1053, - -1198, -1156, -917, 0, 1460, 447, 1178, 629, - -1455, -1591, 296, -1785, -1694, -1631, 3669, 3819, - 3437, 3274, -956, -666, -874, -284, -858, -202, - -687, 1728, -512, -951, 4692, -1360, -1242, -1188, - -1513, -449, -1566, -1515, -1226, 3857, 1246, -1225, - -860, -1068, -748, -27, 380, 1190, 591, 552, - -1391, 194, -763, -463, 331, -265, 702, 181, - 290, -145, -838, -1359, -1381, -1569, -1399, -1088, - -1357, -1295, -486, -612, 1638, -586, 1458, -774, - -223, -620, -104, 189, 344, 269, 1555, 1428, - -867, -621, -294, -206, 32, 235, 261, 161, - -1021, -105, 654, -235, -282, -7, 189, -159, - -218, 113, -1096, -1318, -1256, -1335, -931, -476, - -1041, -1199, -1134, 2781, -1479, -1222, -1397, -867, - -815, -661, 740, -240, 1158, 735, -1435, -1003, - 351, -990, -245, -72, -347, -72, 1408, 634, - -1697, -1727, -1534, -1716, -1436, -102, 402, 1518, - 1903, 1311, -1477, -930, -355, 508, -162, 21, - -46, 454, 387, 173, -1312, -1284, -1486, -1172, - -1356, -965, -1106, 1760, -670, 2163, -70, 417, - -559, -667, -545, -945, -429, -363, 157, 1280, - 2059, -1319, -1291, -975, -1354, -1249, -780, -476, - 1410, 1252, -1193, -927, -1462, 871, -1281, -1327, - -900, 1540, 1531, 1227, -1651, -1334, -1073, -752, - -154, 710, 830, 773, 279, 307, -1294, -796, - -761, 1012, 1583, -420, -177, -323, 154, 582, -}; - -static const int16_t fcb8ss[] = { - -1481, -1069, -1082, -726, -818, -550, -417, 343, - 489, 275, -814, -510, -712, -933, -558, -236, - 32, 3051, 451, 301, -414, -237, -683, -599, - 3627, -445, -232, 56, 58, 112, -1226, -639, - 4096, -644, -226, -23, 90, 162, 313, 104, - -1385, 5607, -428, -860, -447, -265, -145, -132, - 115, -200, -1349, -1280, -1216, -1046, -657, 43, - 1333, 831, 675, 1174, -1394, 2288, 1840, -682, - -497, -256, 22, 22, 261, 70, -1369, -826, - -975, 2286, -329, -267, 142, 36, 437, 313, - 1570, 52, -470, 622, -244, -247, -114, 22, - -117, -541, -1167, -596, -809, -929, -669, -327, - 102, 516, 2790, 597, -1317, -870, 1327, 987, - -25, 391, -48, -82, 209, -242, 4424, -311, - -396, -765, -382, -336, -365, -414, -74, -13, - 1127, -588, 1363, -714, 368, -450, -390, -364, - 84, 139, 1864, 1881, -15, -790, -281, -286, - 38, -186, -31, -238, -1249, 262, -841, 731, - -414, -61, -274, 280, 100, 557, -841, -775, - -1007, -1063, -687, -374, -360, 31, 1048, 3471, - -1385, 2464, -840, -1105, -714, -400, 56, 445, - 588, 427, 1785, -1093, -783, -847, 41, -23, - 465, 392, 382, 428, -518, -249, -58, -791, - -689, -581, 3146, -183, 296, 66, -1243, 1059, - -1076, -874, 416, 544, 253, 66, 168, 211, - -1388, 1253, 138, -727, -509, 905, 319, -297, - 67, -525, -1470, 2237, -87, 547, 556, -239, - 90, -147, -114, -302, -1017, -824, -585, 25, - 0, 62, 1422, -155, -41, -320, -1125, -1069, - -1134, -783, 1129, 45, 183, 47, 716, 672, - 409, -1169, -910, -447, -34, 79, 95, 455, - 504, 381, 342, -877, -506, -812, -805, 3031, - -249, -518, -69, 564, 243, 261, -332, -434, - -173, -37, 61, 45, -5, 6, -1433, -1009, - 1428, -951, -582, 154, 143, 625, 383, 387, - -1392, -1222, -578, 229, 1294, 218, -142, 355, - -149, 201, -1341, -1135, -857, -767, -273, 2059, - 255, 578, 350, 315, -1041, -617, 254, -504, - -255, -96, -537, -396, 363, 1074, -1361, 484, - 538, -789, -704, -447, 200, 521, 213, 90, -}; - -static const int16_t fcb8sm[] = { - -1183, -1170, -867, -948, -746, 492, 1531, 1412, - 524, 82, 590, -994, -916, -859, -680, 12, - 742, 961, 230, 255, 34, 38, -176, -1, - 1880, -240, -769, -531, 269, -32, -772, -494, - 757, -583, -677, -281, 717, 440, 561, 91, - -1121, -1054, -1189, -1100, -745, -417, -61, 302, - 3079, 1817, -1384, -1479, -1477, -1509, -1077, -323, - 902, 2348, 1464, 1038, -487, -179, -447, -311, - -296, -439, -172, 2166, 245, -28, -1050, -390, - -238, 633, 302, -335, 843, -52, 185, 230, - -110, -433, -690, 148, 63, -289, -404, -469, - 1948, 245, 2016, 1337, -341, -554, -617, -457, - -436, -459, -400, -520, -661, -7, 1078, 971, - -326, -332, -23, -749, 83, -104, 2106, -947, - -867, -883, -705, -433, -35, 164, 427, 646, - -924, 2196, -656, -798, -282, 217, -227, 134, - 446, -15, -584, 33, 185, -571, -159, 1852, - -405, -94, -61, -83, -329, -516, -394, -450, - -173, -140, -54, -156, 226, 1850, -752, -1304, - -1378, -1275, -1017, -680, -337, 356, 1131, 4143, - -1120, -1253, -1269, -860, 90, 973, 152, 886, - 609, 1454, -29, 36, -117, -815, -651, -346, - 2085, -414, 24, -93, -235, -1103, -1132, -758, - -98, 1497, 1285, -289, -34, 402, -646, 637, - 2147, -677, -350, -266, -232, -61, -199, -359, - 167, 1546, 816, -453, -35, -251, -468, -491, - -371, -593, -878, 1445, -795, 651, 108, -155, - -201, -14, 250, -271, -732, 793, 154, -288, - -86, 16, 557, 642, -592, -587, -87, -365, - -309, 1753, -40, 95, -529, -87, -214, -234, - 4999, -466, -755, -800, -785, -722, -532, -703, - -526, -465, 591, 3937, -229, -804, -808, -698, - -576, -613, -506, -725, 10, 13, -117, -55, - 101, 52, 125, -76, -25, -28, 1469, -245, - 8, -25, 65, -53, -262, -282, -411, -588, - -667, 1374, 304, -787, -661, -675, 55, 320, - 720, -4, 366, -103, -136, -332, -314, -293, - -38, 127, 151, 380, -1330, -1338, -618, -40, - 1284, 1500, 466, -515, 105, -161, 19, 697, - -417, -559, -317, -712, -756, -567, 754, 1481, -}; - -static const int16_t fcb11l[] = { - -1291, -1237, -1175, -1186, -1139, 524, 1225, 1464, - -1042, -721, -901, 41, -728, 822, -657, 1078, - -483, 1530, -489, 1253, 926, -326, 404, 89, - -1191, -1170, -1237, 1633, 1493, -465, 986, 1184, - -857, -832, -300, -811, -936, -667, -254, 492, - 4044, -1136, -983, -855, -592, -199, 383, 876, - 2076, -1042, -1019, -729, 1435, -25, 64, 845, - -991, -921, -861, 916, -402, -551, 236, 429, - 5253, -1233, -1268, -414, 1793, -463, -569, 1693, - -1197, 6322, -887, -211, -945, -540, 626, 903, - -993, 1500, -490, 1445, -764, -136, 321, 548, - 462, -228, 127, -322, 481, -183, 88, 155, - -809, -844, -959, 4011, -581, -232, 330, 986, - -900, -916, -1069, -866, -979, -439, 4016, 1558, - -1023, 2121, 1717, -612, -588, -446, 223, 430, - 2567, -972, 2118, -1030, -900, -664, 180, 858, - 3232, -991, -1132, 2119, -446, -548, -258, 895, - -962, -184, 2639, 1081, -661, -222, 292, 530, - -952, 1767, -213, -701, 1079, 37, 131, 489, - -875, -749, 3167, -776, 1247, -109, -83, 636, - -1146, -1070, -1001, -1064, -942, 2891, 1137, 1585, - -1314, -632, -1179, -1105, 1101, 51, 2038, 2036, - -926, -727, 180, 1515, -566, 1191, 101, 595, - 2247, -364, -315, -105, -130, -79, 121, 210, - 7994, -1302, -898, -785, -758, -777, 31, 415, - 744, -652, 688, 1226, -649, -605, -268, 314, - 611, 662, -240, -411, -698, -434, 377, 339, - 953, -810, -931, 1054, -484, -298, 721, 522, - 922, -1046, -952, -871, -618, -270, 419, 635, - 1006, 129, -838, -724, 220, 481, 253, 329, - 205, -456, -724, 675, 598, 332, -14, 291, - -1016, -695, 542, 1270, 498, -456, -113, 362, - -547, -1068, -1178, -1261, -1161, -905, 390, 2204, - -1056, -1102, 5611, -1100, -1076, -902, 360, 978, - -538, -286, 1253, -430, -457, -148, -1, -60, - -1116, -955, 2869, -926, -680, 1111, 706, 842, - -1311, -1275, -1150, -236, 675, 897, 758, 912, - 1886, -1115, -999, -84, -588, 2190, -171, 739, - -737, 150, -902, -854, -917, 334, 557, 534, - -851, -39, -25, 214, -136, -73, 263, 234, - -1021, 1332, -543, -655, -712, -651, 80, 479, - 1555, 1933, -707, -485, -206, 139, 312, 405, - 2472, -1172, -945, -939, -713, 568, 1421, 684, - 70, -1263, -1235, 586, -195, -1065, -449, 3182, - -1143, 529, -926, -558, 419, 390, 375, 563, - -1090, 3370, -688, -528, -346, 136, 317, 615, - -803, -977, -1082, -806, 3607, -443, -156, 1130, - -1288, 1585, -1218, -1226, -979, 359, 1555, 1402, - -341, -416, -480, -360, -415, 542, -148, -322, - -1095, -1074, 762, -864, -634, 1770, 340, 466, - -1040, -834, 1508, -707, 143, 74, 1418, 905, - -1094, -710, -549, -860, 373, 1492, 2024, 741, - -938, -910, 2661, -1087, -1105, -901, 383, 906, - 755, -819, 581, -612, -420, 305, 344, 363, - -356, -991, -845, -1051, 2112, 1738, 554, 954, - -1028, -943, -892, -896, -236, -674, 1076, 679, - -611, -1099, -859, -914, -444, 910, 491, 709, - -1063, 775, 496, -669, -304, 672, 261, 496, - -1086, -963, 1037, -639, -134, -577, 33, 607, - -1070, -649, 730, -748, 1884, -18, 346, 627, - -1089, -1118, -955, 751, -690, 606, 1204, 1037, - -1016, -1095, 473, -919, -1036, -685, 1744, 1216, - -834, -916, -920, -634, 1086, -474, 161, 620, - -997, -899, -25, -499, 399, 405, 163, 401, -}; - -static const int16_t fcb11s[] = { - -1148, -1134, -1000, -585, 715, 774, 626, 650, - 2109, -898, -729, -239, -213, 847, 77, 371, - -902, -790, 1853, -871, -816, 163, 295, 377, - 1718, -1070, -840, -791, 1612, -129, 144, 450, - -830, 1909, -539, 803, -411, -188, 122, 148, - 1202, 705, -696, -578, -213, -25, 126, 142, - 3309, -1083, -865, -771, -470, -237, 980, 521, - 428, -995, -1003, 3088, -1000, -455, 320, 503, - -615, 1746, -751, -734, 1092, 31, 97, 225, - -1175, 2287, 1278, -421, -315, 91, 130, 120, - -1203, 4211, -970, -878, -228, 71, 327, 288, - -1012, -850, 1471, -732, 1228, 201, 146, 271, - -868, -528, 1196, 744, -186, 85, 38, 153, - -1081, -895, -742, 1014, 1110, 66, 237, 335, - -1012, -1137, 4357, -1062, -569, 377, 268, 445, - 1203, -717, 1070, -541, -72, -29, 91, 104, - 6448, -1148, -1069, -810, -659, 118, -284, 300, - -1085, -940, -214, -621, -781, -622, 1789, 711, - -1165, 1643, -890, -809, -533, 148, 384, 373, - -910, -986, -855, -1032, 3647, -478, -132, 713, - -3, -674, -1036, -956, -899, 2698, 629, 665, - -764, -1066, -1173, -1058, -692, -144, 1114, 3195, - -1012, -643, -670, 1547, -576, 351, 251, 273, - -950, 563, -742, 248, -149, 514, 100, 185, - -193, -616, -655, 255, -364, -323, 172, 256, - 308, 228, 16, -187, -243, 219, 88, 53, - -1024, 664, 450, -416, -189, -239, 43, 102, - -64, -499, -159, -400, 905, -64, -68, 46, - -1055, -77, -813, -661, 59, -77, 226, 321, - 1224, -553, -436, 793, -155, -83, -5, 72, - -652, -897, -157, -579, -539, 846, 181, 318, - 782, -967, -802, -569, -6, 364, 540, 513, -}; - -static const int16_t fcb11m[] = { - -453, -1087, -1133, -1125, -852, -158, 1152, 3313, - 1015, -444, 1085, -465, -317, -298, -471, -238, - -647, 1426, -241, 149, -300, -169, -19, -228, - 3282, -269, -1025, -1069, -1097, -1071, -539, 1303, - 1111, -933, -741, -801, -553, 98, 393, 1031, - -786, -729, -835, -810, -78, 1569, 631, 944, - 1031, 651, -409, -397, -346, -221, -99, -216, - -88, -211, -419, 193, 1298, 196, -221, -879, - -1036, -1303, -1282, -1052, -575, 283, 3110, 1337, - 489, -463, -640, 112, 341, -322, 261, 266, - 1646, -817, -1256, -1273, -1217, -1031, -142, 3691, - 3012, 1564, -289, -830, -970, -1032, -1075, -989, - 556, 52, -588, -589, -613, -748, -352, 2054, - -69, -785, -718, -499, -141, 192, 1396, 446, - -3, -514, -612, 3, 171, 1067, -114, -109, - -812, -893, -776, -342, 1428, 421, 438, 552, - -933, -1143, -207, 1312, 791, 166, -198, -79, - -632, 1122, -537, -620, 450, 97, -85, 174, - 1760, 123, -168, 485, -77, -567, -776, -952, - -758, -1176, -1322, -1355, -1207, -928, -177, 6229, - -413, 261, -327, -848, -725, -395, 849, 1533, - -201, -124, 2976, -335, -703, -674, -727, -949, - -521, 209, 1004, 838, 56, -477, -751, -603, - -922, -615, 1832, -448, -329, -148, 73, 467, - 4991, -86, -809, -928, -951, -956, -819, -751, - 1841, -790, -712, -116, -113, -91, 0, -388, - -729, -196, 758, -377, 68, 85, 428, -35, - -5, 2, -9, 18, -31, 53, -23, 26, - -896, -445, -188, 818, -347, -44, 502, 578, - 101, 2968, 269, -724, -702, -747, -719, -673, - 7587, 68, -1171, -1377, -1441, -1455, -1473, -1178, - 699, 585, 15, 2257, -503, -940, -1085, -1288, -}; - -static const int16_t fcb11sl[] = { - -1502, -1463, -1336, -1177, -367, 89, 475, 867, - 550, 820, -805, -580, -803, -89, -817, 1691, - -304, 120, 36, 564, 409, -525, -820, 362, - -969, -870, -605, 1983, 993, 722, 1505, 1101, - -842, -848, -918, -379, -71, 257, 499, 607, - 1619, -956, -1024, -869, -744, -74, 795, 684, - 532, 634, -1360, -818, 49, -981, 111, -473, - -718, -477, 377, 710, -1399, -1105, -1152, -1024, - 2426, -356, -191, 1079, 911, 1164, -809, -791, - -919, 2731, -851, -400, -113, 242, 508, 847, - -1229, 1199, -910, 1127, -686, -383, 26, 352, - 536, 646, -790, -1243, -1103, -1170, -1132, -1065, - -788, -521, 161, 3842, -1098, -883, -1052, 8, - -1103, -747, -552, -480, -241, 820, 3392, -770, - -770, -724, -588, -426, -153, 426, 639, 724, - 1626, -713, 1157, -736, -492, -512, -160, 461, - 569, 583, -1351, 1332, -1222, -1358, 240, 1541, - -724, 612, 1583, 1194, -1061, -990, -671, -969, - -952, 2368, -442, -413, 1933, 1023, -144, -283, - -992, -940, 983, -232, 818, 341, 502, 549, - -1420, -1268, -1279, -1213, -621, 2019, 685, 1948, - 1264, 1200, -1293, -664, 392, -848, 866, 1191, - -220, 95, 450, 640, -1334, 1098, -751, -701, - 1296, -347, -92, 233, 532, 599, -952, -694, - 3085, -908, -256, -494, -177, 123, 809, 941, - 18, -1089, -801, 303, -761, 11, 632, 288, - 476, 518, -241, -1138, -1068, -869, 292, 121, - -26, -96, 457, 548, -106, -784, 930, -700, - 1842, -812, -617, -307, 430, 655, -698, 1157, - 947, -803, -662, -743, -49, 1120, 348, 578, - 855, -1049, -753, -67, 710, -347, -28, 694, - 411, 468, -61, 239, 23, -1072, -757, 477, - -658, -362, 239, 576, -1479, -1279, -1286, -677, - -939, -722, 3217, 338, 1562, 1566, 925, 917, - -697, -708, 645, -447, -280, 714, 503, 552, - -1050, -1021, 889, -956, -934, 705, 457, 616, - 556, 667, -1331, -51, -256, -48, -234, 240, - 757, -74, 148, 356, -1278, 1538, 234, -372, - -472, -221, -424, -494, 170, 551, 216, 294, - -885, 231, -263, 334, -64, -54, 291, 350, - -1140, -1074, -1199, -1374, -1278, -845, -547, 667, - 4544, 1922, -899, -930, -954, -1120, -1092, 1156, - 1889, -404, 259, 1114, -956, -836, 881, -316, - -977, -860, 202, -249, 121, 816, -1188, 3644, - -829, -876, -670, -473, -161, 420, 851, 886, - -1014, 1191, -938, -958, -864, 741, 241, 957, - 288, 629, -1155, -898, 1104, -789, 28, -867, - -580, 2588, 836, 1234, -953, -749, 934, 1137, - -310, -177, -113, 244, 532, 424, -341, -602, - -880, -1105, -303, -381, -527, 1943, 126, 759, - -1277, -1037, 59, -783, 485, -589, 1341, 737, - 488, 709, -1473, -1208, -1082, 589, 791, 735, - 447, 322, 835, 731, -1116, -681, -592, 704, - 520, -545, -104, -24, 263, 458, 632, -721, - -1086, -1223, -1150, -866, 1537, 2815, 123, 1097, - -1238, -861, -1217, -1238, -1261, -914, 1165, 422, - 711, 883, -1196, -972, -428, -230, 171, 8, - -448, 1195, 445, 440, -413, -139, -375, -568, - -781, -520, 611, -586, 881, 589, -724, 972, - -907, -794, -819, -641, 1650, 66, 254, 703, - -1380, -1168, -967, 676, -765, -537, 578, 1542, - 687, 833, 1151, -811, -948, -995, -246, 1301, - -377, 262, 632, 652, 1530, -679, -682, 993, - -666, -457, -72, -20, 317, 516, 861, -528, - 24, -579, -386, 53, 526, -76, 66, 345, - -59, -612, 165, -181, -98, -34, -66, 286, - 95, 108, -1118, -147, 643, -1055, -768, -502, - -587, 27, 2113, 811, -1219, -947, -811, -1188, - 1143, -609, -753, 88, 2844, 1424, -1428, -1082, - -1273, 1086, -1206, -1171, 279, -510, 2325, 1757, - -1437, 654, -1278, -1267, -1117, -950, 779, 2205, - 1150, 1101, -1484, -1009, -1199, -1416, -1215, 657, - -737, 634, 1266, 1742, -1445, -1193, -1358, -1158, - -1015, -995, -655, 4035, 1966, 1903, -1069, 954, - -1099, -1171, -1029, -818, -576, -104, 1390, 1069, - 559, -914, -1034, -1152, -987, -582, -222, 394, - 1204, 775, -1464, -51, -959, -1005, -452, 347, - -94, 1, 525, 595, -1324, -1226, -1102, -825, - -927, -776, -582, 175, 1675, 632, -859, 28, - -914, -209, -468, -625, -230, 646, 579, 446, -}; - -static const int16_t fcb11ss[] = { - -1351, -1229, -1174, -767, 1403, 182, 532, 445, - 415, 610, -1095, -771, -1142, 3221, -803, -680, - -302, 318, 441, 438, -1188, 1145, 1552, -528, - 887, -547, -429, 124, 99, 128, -768, 1049, - -562, 1121, -593, -96, -105, 105, 251, 154, - 1684, 1598, -635, -685, -177, -211, -268, 234, - -118, -49, -719, -873, -1092, -985, -678, -406, - -234, 407, 653, 3195, 991, -584, -874, -14, - -683, 2964, -769, -450, 287, 350, 853, -803, - -574, 1761, -410, -60, -230, -78, -21, 19, - -1271, 4435, -673, -790, 110, -243, -81, 147, - 191, 145, 5571, -611, -634, -699, -195, -281, - -249, -302, -272, -67, -893, -656, -745, -697, - -550, -639, -409, 3085, 383, 798, -311, -340, - -564, -787, 3628, -332, -510, -219, 465, 351, - -747, -1084, -972, -727, -404, -630, -176, 437, - 3352, 978, -886, -751, -767, -580, -693, -942, - -803, -158, -36, -3, -966, -674, 3075, -926, - -172, -9, -40, 111, 169, 212, 181, -811, - -715, -986, -521, -686, 3915, 18, -58, 499, - 210, -1187, -903, -915, -522, 1038, 477, 788, - 290, 412, -1010, -791, -700, -710, 34, 1774, - -256, 96, 131, 241, -1251, 2086, -5, -765, - -446, 141, 93, 160, 88, 129, -1153, 1171, - -1192, -1073, -391, -187, 206, 416, 444, 648, - 707, -542, -504, -750, -623, -648, 776, 692, - 165, 330, 1112, -1199, -876, -428, 949, 65, - 250, 104, 108, 173, 2147, -905, -846, -540, - -376, -131, -113, 124, 314, 485, 1253, -515, - 1435, -527, 21, -100, -368, -84, -119, -144, - -1375, -1189, -1189, -999, -723, -190, 796, 639, - 699, 816, -1188, -919, 683, 842, 177, -62, - -25, 71, 15, 16, 157, 80, -331, -343, - 12, 193, -133, -94, -94, -64, -1306, 531, - -917, -142, 1274, 102, -15, 184, 159, 148, - -43, -1103, -581, -419, 447, -132, -204, 187, - 631, 461, -1302, -1162, -927, 896, 203, 164, - -55, 287, 544, 485, -1258, -791, 677, -945, - -244, -101, 423, 362, 298, 389, -825, -640, - -646, 274, -73, -274, 1473, -13, 132, 169, -}; - -static const int16_t fcb11sm[] = { - -767, -1179, -1188, -1069, -690, -172, 787, 1389, - 1623, 844, -169, -894, -919, 51, 15, 426, - -326, 1579, 182, 77, 202, -417, -357, -17, - 2154, -77, -607, -589, -375, -261, -376, 175, - -829, -801, -579, -290, -244, 533, 1307, 873, - -877, -1175, -1157, -726, 461, 1729, 433, 219, - 246, 606, -791, -827, 649, 891, 820, 720, - 407, -641, -727, -708, 2498, 961, -99, -542, - -530, -507, -536, -608, -642, -622, 316, 195, - -721, -549, -253, 1520, 171, -81, -372, -333, - 1166, -1072, -1230, -1123, -1031, -868, -370, 209, - 1561, 1751, 113, -367, 399, -663, -10, -271, - 950, 118, -335, -272, -863, 60, -875, 1850, - -242, -276, -38, -106, 471, 30, 823, -344, - -752, -714, -309, -419, 86, 1604, -250, -185, - -839, -703, -561, -281, 1813, -57, 255, 266, - -32, 99, 400, 2520, 315, -372, -306, -511, - -549, -659, -760, -729, -559, -137, -610, 174, - 924, -310, -705, -307, 885, 512, -611, -1097, - -1172, -1072, -758, -527, -192, 278, 740, 3398, - -1136, 409, -230, -353, -137, 322, 326, 365, - 133, 173, 2291, -644, -725, -596, -535, -340, - -88, -65, -53, 273, -760, -390, -649, 119, - -243, -222, 1726, -113, 44, 326, -618, 311, - 2345, -241, -398, -399, -382, -322, -444, -457, - 1873, -454, -505, 42, 481, 187, -49, -505, - -634, -754, 1052, -597, 1315, 297, -412, -110, - -205, -552, -682, -524, -1055, -431, 971, -363, - -539, -366, 39, 995, 181, 476, 662, 229, - -445, 1682, -205, -181, -273, -497, -685, -628, - 6135, -21, -834, -934, -1002, -1066, -931, -974, - -902, -643, -820, 1891, -706, -288, -252, -231, - -79, 126, 35, 37, 10, -10, -36, -6, - -9, -47, -7, 1, 11, -2, 644, 315, - 145, -353, -396, -428, -357, -60, 275, 109, - -1179, -952, -698, 138, 286, 171, 394, 263, - 814, 495, -490, 110, 369, 599, 9, 599, - -431, -233, -328, -69, 410, -1002, -462, 77, - 97, 196, 133, -91, 512, 49, 621, -436, - -352, -390, -211, -188, -454, -318, 44, 1424, -}; - -static const int16_t fcb16l[] = { - -13, -798, -772, 235, 515, -181, -120, -509, - -392, -1159, -844, -1041, -881, -1193, 1103, -1080, - 214, 1615, 1819, 1510, -914, -1190, -273, -1099, - -522, -996, -206, 3946, 996, 1678, -1220, -1201, - 2850, -1022, 1101, -814, -188, 879, 1549, 1279, - -1129, 1928, 1550, 38, -356, -574, -157, 286, - 481, 475, -1079, -1176, -861, -548, -657, -381, - 538, 948, -838, 779, -1149, -962, 1788, -779, - -742, -311, 205, 299, 472, 715, 702, -843, - -931, -790, -624, -332, 324, 778, 785, 670, - -1137, -1205, -103, -1182, -1071, -950, 101, 527, - 1596, 1004, 682, -564, -1053, -844, -1184, 1732, - -862, 1994, -988, 1131, -1069, -1276, -1053, 6414, - -1259, -186, -930, 118, 375, 1092, 6215, -900, - -920, -935, -981, -970, -766, -902, -334, 1629, - -1094, -1142, -1155, -779, -1092, 1011, -490, 1063, - 1569, 1340, 2242, -1313, 6027, -1319, -1337, -789, - -1296, -457, 819, 2276, -1071, -1065, -715, 802, - -996, 397, 2396, -27, 1225, 935, 1400, -862, - -802, 1846, -513, -249, -704, 515, 872, 662, - -1141, 5876, -691, -404, -603, -148, -57, 187, - 649, 788, -1116, -915, -551, 3843, -737, -133, - 498, 155, 227, 718, 1798, 1397, -868, -716, - -586, -580, -71, -67, 311, 536, 2465, -524, - 1837, -231, -210, 263, 231, -10, -164, -324, - -951, -1130, 5206, -525, -603, -401, 223, 438, - 1011, 1077, -726, -1102, -1013, -386, -786, 4281, - -329, 262, 550, 1292, -629, -943, -976, 773, - -867, 908, -680, -154, 362, 1056, -1051, -703, - -1333, -1424, -1026, -793, -859, -882, -148, 9958, - -1193, -1156, -1077, 1241, -1013, -726, -139, 551, - 1150, 1019, -733, -997, -651, -625, -54, 722, - 73, -14, 361, 435, 4013, -1260, -1195, 1452, - -1105, 1273, -670, 1546, 1038, 1680, -812, -1060, - -853, -1058, 2094, -801, -457, -320, 683, 960, - -1019, -1158, -1118, -1034, -617, 404, 1376, 847, - 1014, 951, -12, -1004, -1221, -1131, 649, -1052, - 442, -167, -859, 3868, -1216, -1298, -1311, 2866, - -1310, -639, -1079, 1576, 1760, 1837, 118, -1080, - -862, -845, -1065, -1069, 2199, -766, 495, 1309, - -996, -1040, -741, 1357, 1726, 382, 264, 92, - 659, 665, -781, -1356, 2055, -1198, 15, 2143, - 631, 569, 918, 1120, -948, -1253, -1234, 2442, - -1062, 2206, 48, 660, 1822, 1480, -639, 627, - -432, -477, 845, 216, 228, 152, 157, 295, - 2444, -908, -465, -768, 109, 251, 72, -59, - 169, 405, 4395, -837, -931, -839, -215, -564, - 655, 359, 503, 296, 3514, -1082, -1185, -827, - 2879, -1224, -811, -970, 804, 911, 3028, -1284, - -688, -1226, -1251, -551, -1247, -275, 3441, 2322, - -630, -1213, -108, -1191, 1129, -854, 2848, 1609, - 1048, 1535, 2784, -1245, 772, -1230, -1298, -686, - -1293, -639, 278, 2455, 9975, -1077, -1233, -1055, - -139, -853, -48, 24, -720, 533, -1191, 2809, - -1015, -899, -28, -765, -147, 146, 592, 814, - 12493, -1274, -1072, -1297, 877, -1068, -1179, -1032, - 1023, -1178, -840, 930, -660, 1216, -366, -406, - -97, 77, 179, 340, -973, -993, 2280, 1775, - -631, -17, -186, 507, 459, 645, 2095, -1019, - -1067, -949, -857, -1202, -904, -48, 1156, 1273, - -1230, -1245, -1203, -1036, -1150, -955, 1193, 1943, - 1437, 1329, -618, -1055, -730, -1014, 4953, -1125, - 1089, 1085, 1047, 1045, 813, -1036, 1270, -715, - -684, -96, -131, 289, 782, 628, -979, 1060, - -975, -964, -811, -14, 223, 422, 563, 696, - -901, -633, 496, -136, 22, -83, -52, 264, - 24, 147, -446, -1197, -1258, -687, -1239, -795, - -1066, -1196, 147, 2653, -1231, -1275, -1240, -1041, - -1260, -1159, 1961, -34, 2937, 2128, -1318, -1355, - -1326, -1300, -1345, -1326, -870, -298, 2014, 3890, - -933, -1014, -859, -1074, -506, -1163, -954, -819, - 440, 732, -582, -1268, -1206, -1037, -1081, -1255, - -1150, -835, 2360, 1469, -1232, -1384, -1388, 542, - -1359, -606, -1335, 1852, 2142, 3722, -1218, -1321, - -1268, -1207, -1203, -1316, -954, -696, 4730, 2920, - -1225, -1306, -1131, -1273, -1276, -1238, -1040, 2079, - 2652, 1931, -1167, -1302, 659, -532, -650, -560, - -1028, 186, 1224, 2811, -896, -449, -999, -823, - -81, -876, 502, -293, 680, 733, -836, -1111, - -1132, -865, -1141, -938, -980, 1287, 581, 1438, -}; - -static const int16_t fcb16s[] = { - 1260, -1427, -1400, -996, -958, -1195, 6261, 31, - 967, 752, 3776, -975, -840, -707, -696, -555, - 45, 1159, 4, 358, 4718, -1471, -1464, -1291, - -1364, -934, -878, 5198, -273, 1555, -1438, -1729, - -1579, -1470, -1820, -1436, -1255, -631, 4287, 4025, - 1233, -684, -748, -742, -547, -229, 321, 126, - 794, 670, 6689, -1041, -1160, -861, -1002, -976, - 147, -668, 521, 940, -1186, 2097, -570, 1759, - -251, -442, -92, 46, 99, 12, -1336, -1061, - 4427, -945, -861, -460, -306, 494, 481, 536, - -1101, -1105, 2695, 316, -801, -159, 1042, -577, - -78, 340, 2347, 1448, 135, -381, -688, -493, - -254, -234, -74, -80, -1047, -1246, -729, -985, - 5399, -1018, 643, 822, 889, 432, -328, -1386, - -1420, -702, -1450, 6927, -1107, 465, 1625, 1116, - -1258, 2847, -893, -895, -521, -263, 112, 157, - 556, 500, 182, -652, -226, 258, -638, -566, - -419, -669, -224, -221, -1197, -227, -582, 92, - 1914, -184, -11, -18, 270, 166, -1294, -62, - 1536, 2470, -413, -619, -399, 24, 106, 54, - -1223, 2672, 2400, -54, -577, -692, -301, -3, - 206, 89, -1424, -1491, 8425, -1072, -242, -420, - -194, -1, 489, 331, -938, -1319, 2493, -1355, - 551, 2297, 197, -9, 717, 434, -1237, -773, - -1021, 3945, -566, 116, 246, 150, 510, 370, - 11804, -457, -1006, -1231, -1175, -1086, -1221, 589, - -679, -757, -1183, 6502, -584, -454, -629, -570, - -413, -352, -279, -32, -1236, -946, -760, 1535, - -865, -712, -224, 343, 647, 613, -1348, -938, - -961, 8273, -1130, -591, -225, 210, 420, 140, - -1247, -1166, -966, -986, -1120, -907, -181, 470, - 1888, 1161, -1076, -1298, 3479, -1151, 2410, -396, - 1, -44, 357, 594, -896, 745, -33, -422, - -332, -259, 0, 48, 143, 190, -1009, -837, - -876, -371, -370, 1520, -150, 251, 240, 448, - -1024, -1008, -568, -450, -611, -536, 1763, -34, - 355, 454, -769, -599, -639, -737, -912, -725, - -504, -230, 532, 3294, -1077, -289, -875, -542, - -574, -604, -339, 2511, 479, 742, -1218, -946, - 1321, -522, -544, -950, -765, 632, 639, 497, -}; - -static const int16_t fcb16m[] = { - -940, -1197, -1190, -1200, -1192, -960, -718, 610, - 3300, 3253, -1515, -1689, -1798, -1798, -1793, -1764, - -1616, 33, 2377, 7778, -668, 1745, 1501, 785, - -336, -823, -708, -446, -455, -812, 8862, 159, - -1141, -1261, -1323, -1299, -1261, -1227, -1214, -1090, - 3584, 2092, 688, -531, -848, -1000, -1047, -1192, - -1104, -887, 5163, -347, -1129, -1285, -1336, -1291, - -1249, -1109, -498, 2511, -611, -703, -516, -240, - -68, 399, 1570, 252, -5, 43, -1163, -1168, - -1008, -921, -995, -569, 925, 1511, 1001, 2023, - 12926, 135, -1598, -1778, -1847, -1850, -1836, -1734, - -1695, -1690, 621, 4647, 588, -752, -973, -996, - -953, -1081, -1060, -672, -868, 259, 4940, -117, - -718, -907, -828, -776, -606, -981, -1002, -526, - -385, 527, 1501, -239, 38, 25, 112, -77, - 1122, -250, -352, -1113, -1101, -942, -681, 5156, - -800, -636, 5814, -160, -777, -825, -844, -747, - -697, -645, -668, -492, -936, 491, -280, 2573, - -269, -736, -375, -265, -98, -243, -920, -236, - 446, 1095, -666, -600, -246, 783, 282, 0, - -1064, -116, 2271, -118, -482, -240, -187, -271, - 36, 91, -695, -254, -383, -948, 745, 2722, - -129, -799, 238, -379, 2872, -516, -868, -623, - -551, -275, 22, 379, -185, -230, 1524, -672, - -1062, -1164, -1177, -1137, -1058, -790, 6, 4928, - -551, -389, -460, -394, -674, -586, -327, -178, - 615, 2868, -1467, -1203, -1316, -1120, -996, 747, - -219, 2023, 1875, 254, -871, -992, -1062, -1110, - -1149, -992, -492, 40, 528, 5374, 83, -559, - -862, -760, -541, 28, 207, 629, 502, 1260, - -473, -1110, -1336, -1390, -1412, -1379, -1329, -1081, - -238, 9844, -1332, -1306, -1275, -881, -1267, -1249, - -237, 2882, 3535, 584, -13, 52, -50, -4, - 7, 5, 20, -55, 5, 45, 1587, 350, - 191, 617, 153, -236, -336, -649, -798, -1063, - 1451, 707, 253, -733, -923, -859, -621, -738, - -555, 1623, 1727, -411, -724, -772, -746, -675, - -688, -209, 915, 622, -1038, -474, -343, -91, - -173, -104, 255, 96, 1547, 773, -625, 2272, - -90, -509, -527, -247, -147, -234, -45, 166, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const int16_t fcb16sl[] = { - -1337, -1122, -1559, -1452, -1353, -973, 3858, 1145, - 1225, 2103, -607, -181, 557, -429, 15, -496, - -444, -523, -1866, -1134, -1270, 3029, -1110, -798, - -824, -659, 44, 614, 1059, 1173, 714, -932, - -1095, -1061, -921, -1034, -873, 7, -872, 660, - -1335, -1496, -1623, -1405, -1070, -680, 943, 134, - -190, 2837, -1034, -221, -337, -540, -571, -173, - -411, 2314, -111, 970, -1220, -1036, -1096, -147, - 1087, 604, -367, 83, 461, 679, -1333, 194, - -1292, -1139, -1097, -570, -508, -109, 54, 962, - 2592, -1112, -944, -636, -521, 12, 230, 442, - 562, 624, -1107, -1190, 1554, -981, 1507, -1013, - -394, 595, 823, 1094, -1453, -1298, 242, -1185, - -686, -541, 858, 331, 695, 1197, -1259, 968, - -1180, -1254, -752, 1473, 222, 342, 973, 1029, - -1631, -1500, -1619, -1517, -1299, 1683, 2203, 1163, - 1225, 1497, -1189, -937, -931, 3193, -977, -708, - -262, 549, 917, 1465, 704, -565, -708, 846, - -130, -322, -257, 221, 367, 309, -1416, -1123, - -1323, -1260, -405, 3303, -210, 785, 1007, 1616, - -1043, -717, 44, 824, 419, -492, -579, -604, - -15, 676, -1067, -1079, 3897, -1211, -474, -1020, - -589, 114, 593, 1504, -1481, -1249, -1036, -1012, - -719, 846, -189, -297, -31, 1209, -1761, -1566, - -1449, -1645, -1464, 1422, 24, 2153, 1377, 1948, - -1480, 652, -929, -415, -689, -386, 1628, 489, - 487, 756, -1424, -805, 1241, 228, -697, -316, - 423, 660, 557, 587, 1248, -777, 1088, -848, - -498, -399, -60, 169, 497, 689, 5679, -778, - -1109, -1118, -895, -1042, -504, 390, 1670, 469, - 977, -929, -1173, -1058, -999, -696, 1912, 52, - 1297, 1081, -1469, -1243, -1055, 385, -529, 910, - 79, 508, 1225, 753, 656, -1307, -1239, -1470, - -1110, -1255, -362, 2351, 889, 1687, -1566, -1331, - -1410, -1385, 779, -499, -217, 936, 2064, 1493, - -1499, -1345, -1162, 790, -1115, -673, 2083, 1010, - 588, 1265, -1439, -1168, -1294, 752, -1421, -1234, - -169, -529, 1606, 2131, -1556, -1442, -1444, 487, - -1260, -1139, 360, 2528, 1994, 1686, -1548, -1473, - -563, -1125, 967, 1490, 1503, 487, 991, 1024, - -1430, -1151, -1215, -729, -746, -762, -472, 778, - 889, 774, -1329, -1129, 1383, -1230, -723, 1478, - 379, 161, 1266, 1238, -1467, -843, -1277, -1323, - -715, 58, -182, 5140, 762, 1723, -1285, 1134, - -1175, -1057, 1294, -4, -417, 557, 939, 1182, - 39, 565, -809, -703, -783, -883, -112, 412, - 1056, 691, -273, -1334, -898, -1345, -1069, -1247, - -105, 638, 6811, 1157, 982, -856, -805, -1093, - 1267, -747, -650, 311, 281, 1076, 1371, 1614, - -891, -886, -396, -246, -65, 77, 472, 605, - -943, 178, -509, 112, -142, 512, -66, 109, - 144, 76, 2934, -1203, -1428, -1525, -1269, -1618, - -1129, -184, -225, 3157, -249, -1276, -1055, -439, - -161, -268, 284, 614, 778, 670, -1243, 1682, - 919, -468, -479, -341, 31, 468, 325, 606, - -1081, -723, 83, -399, -275, -658, 240, 149, - 2746, 679, -1573, -1287, -494, 775, 975, -751, - -47, 1758, 652, 1155, -1465, -1073, -1087, -1026, - 289, 340, 448, 1348, 351, 682, 2065, -1183, - -1313, -1562, -466, -1546, -1077, -477, 3012, 2512, - -1560, -1532, -1441, -1229, 861, -421, 1515, 2195, - 1163, 1418, -1268, -1103, -804, -1094, 3254, -711, - -558, 713, 1414, 1684, 542, -781, -827, -814, - -245, 1129, -160, 210, 386, 618, -1633, 488, - -1584, -1571, -1349, -662, 711, 1516, 1661, 1673, - -1510, -1530, 1013, -1172, 425, -1415, -856, 2963, - 2258, 1919, -744, -1208, -863, -634, -729, -1068, - -857, -289, 701, 6703, -1502, -1353, -1531, -1372, - -1388, -1067, 1392, 100, 2570, 1703, -1551, -1500, - -1587, -1693, -1753, -1431, -1048, 1162, 1308, 3073, - -998, -1575, -517, -1346, -1293, -1493, -1375, -1109, - -803, 2972, -1446, -1316, -1114, -1405, -1240, -1057, - -1109, -589, 2623, 1626, -1555, -1026, -1346, -1467, - -902, 1291, 176, 630, 4293, 1949, -1233, -1362, - -930, -1175, -1118, -1375, -1172, -967, 4896, 4195, - -1744, -1562, -1797, -1815, -1577, -1194, 371, 3326, - 3183, 3071, -1425, -1773, -1562, -1358, -547, -246, - 24, -526, -1502, 29376, -860, -614, -857, -795, - 793, -616, 1691, -125, 156, 559, -1643, -1462, - -1523, -1413, -1251, -592, 1014, 1888, 243, 1041, -}; - -static const int16_t fcb16ss[] = { - 308, -532, -811, -974, -641, -431, 3409, 258, - 567, 641, 1315, -723, -738, -502, 142, 678, - -67, -170, 73, -65, 2717, -804, -958, -878, - -532, -562, 238, 497, 548, 718, -868, -669, - -932, -1004, -518, -502, -286, 405, 2987, 1420, - 174, -779, -748, -575, -153, -40, 340, 413, - 275, 387, 965, 82, -550, -744, -592, -591, - -604, -163, 428, 843, -1280, 1756, -368, 777, - -29, -453, -61, 43, 50, 137, 950, -229, - 1504, -491, -353, -167, -285, -158, -94, -185, - -1431, 303, 673, -758, -610, -308, 1247, 348, - 95, 31, 1631, 1963, -624, -770, -466, -150, - -122, -123, 34, -141, -883, -374, -948, -629, - 3420, -772, -392, -31, 603, 646, -760, -871, - -936, -948, -727, 3563, -376, 858, 699, 561, - -1370, 2366, -775, -1241, -1105, -247, 177, 432, - 414, 379, -1360, -1057, -945, -848, -568, -779, - -632, -328, -295, 425, -349, 630, -275, -527, - 438, 47, -194, -96, -239, -545, -1381, -689, - 1644, 1165, -437, -153, -193, 307, 183, 66, - -1335, 2590, 2169, -447, -435, -317, -82, 204, - 45, -145, -1324, -205, 4019, -973, -578, 28, - 175, 506, 235, -98, -908, -294, 1443, -850, - -556, 1707, -277, 58, 241, -188, -853, -572, - -577, 1258, 1007, -190, 1, -3, 103, -49, - 5385, 137, -707, -834, -510, -517, -392, -390, - -231, -275, -1249, 5229, -812, -893, -353, -663, - -29, 187, 45, 10, -1388, -1171, -1051, 412, - -379, -411, 240, 574, 632, 284, -838, -912, - -924, 3062, -695, -409, -224, 422, 293, 267, - -1436, -1237, -1303, -1305, -914, -243, 821, 839, - 1043, 1284, -1178, -496, 1594, -736, 1752, -601, - -396, 330, 231, 48, -1253, 808, -896, -967, - -653, -84, 4, 442, 363, 589, -1005, -672, - -687, -93, -274, 1376, -232, -52, 399, 255, - -1085, -1214, -1088, -748, 1036, 414, 220, 509, - 436, 499, -648, -765, -931, -983, -758, -543, - -379, -115, 780, 3327, -1086, -893, -773, -881, - -683, -11, -322, 3418, 739, 961, -1363, -929, - 899, -1005, -792, -338, -185, 702, 627, 638, -}; - -static const int16_t fcb16sm[] = { - -1125, -1385, -1439, -1387, -1120, -681, -135, 616, - 3086, 2537, -1440, -1209, -1027, -1209, -626, 173, - 662, 899, 861, 2180, 387, 1032, 936, 140, - -353, -302, -290, -330, -551, -1019, 3555, -68, - -441, -539, -500, -27, -423, -506, -522, -415, - 2347, 1890, -312, -742, -679, -679, -653, -609, - -433, -472, 2709, -755, -1153, -1066, -1028, -862, - -826, -315, 78, 1699, -363, -429, -690, -190, - -358, -667, 1909, 39, -1, 138, -1592, -1559, - -1357, -1554, -750, 813, 1676, 1537, 977, -269, - 8320, -602, -1140, -1153, -1136, -1174, -1004, -1091, - -1388, -1187, -507, 3103, -200, -665, -590, -381, - -365, -40, -295, -591, -963, 271, 2231, -547, - -65, -270, -64, 243, -183, -548, -796, -277, - -7, -168, 1575, -361, 35, -19, 192, -154, - -384, 144, -426, -528, -598, -778, -297, 1847, - 564, 218, 864, -654, -485, -435, 45, 709, - 630, -11, -691, -111, -775, -356, -522, 2247, - -79, -433, -620, 594, 79, 60, -828, -475, - 768, -79, -655, 550, -201, 77, 858, -11, - -803, 1173, 1027, -971, -656, -648, -40, 17, - 720, 176, -1055, -936, -258, 550, 1086, 1065, - 0, -473, -364, 30, 53, -6, -54, -24, - 21, -81, -88, -45, -14, 81, 674, -1189, - -1049, -846, -489, -24, -47, 165, 658, 1909, - -241, -390, -387, -454, -319, -549, -307, -112, - 778, 1486, -314, 34, -93, -799, -538, 2219, - -445, 39, -38, -258, -427, -943, -760, -602, - -575, -450, 376, 668, 879, 1215, -1216, -784, - -646, -291, 275, 1019, -77, 124, 256, 1166, - -410, -993, -1145, -1118, -940, -825, -560, -131, - 1006, 4878, -1401, -1286, -1316, -1394, 177, -919, - 162, 2292, 1792, 1242, -762, 937, -168, -900, - -829, 203, 1225, 626, -122, -515, 992, -198, - -782, -25, 74, 1019, -606, -364, -350, -5, - 451, 324, 265, -1143, -820, 382, -362, 85, - -797, 693, 1594, -335, -229, -396, -211, -356, - -97, -115, 92, 49, -476, -1124, -1084, -594, - -228, 728, 16, 589, 1213, 841, -829, 1874, - -907, -1000, 1411, -621, -707, 356, 437, 37, -}; - -static const int16_t fcb22l[] = { - 2735, -1224, -1198, -1073, -1115, -1054, -713, 1693, - -1106, -1259, 722, -1256, -1223, 1686, 1589, 2003, - -906, 2529, 2141, -396, -338, -36, 52, 476, - 319, -420, 561, -492, -526, -359, -221, -254, - -752, -1136, -690, -896, 4307, -363, -42, 1363, - -717, -1036, -874, 2315, -952, -872, 262, 1418, - 737, 1374, -506, -470, -275, -126, 242, 428, - -678, -681, -581, 1016, -553, -509, -485, -408, - 9595, -1015, -1168, -932, -812, -690, -167, 753, - -935, -439, 2105, -526, -710, -570, 9, 548, - 530, -1308, -1060, -351, -974, -1038, 93, 5579, - -737, -1282, 1386, -1284, -1243, -1105, 790, 2169, - -701, -660, -555, 1317, 2805, 792, 2209, -490, - -758, -1262, -1083, -1073, 930, -810, -170, 2326, - -1213, -1286, 3435, -1135, -1051, 220, 3040, 1999, - -933, -663, -714, -855, -372, -599, -437, 373, - 5873, -987, -1081, -1003, -747, -271, 582, 1069, - -917, -754, 5676, -565, -616, -396, 177, 908, - 3106, 1459, -678, -543, -340, 47, 336, 493, - -1060, 1427, -560, -763, -710, -661, 193, 595, - -996, 2488, -588, -752, 1306, 114, 292, 689, - -1202, 2334, -1173, -1167, -755, 353, 1711, 1572, - -932, -751, 2099, 2025, -417, 62, 458, 611, - -981, 4387, -639, -560, -520, -152, 262, 748, - -828, -818, -682, 5250, -640, -270, 385, 1049, - -1072, -774, 1870, -668, 1514, -158, 283, 793, - -1087, -1150, -899, -875, -188, -184, 6656, 2311, - -906, 1654, -446, 1677, -654, -101, 364, 721, - -1272, 7928, -812, -576, -708, -347, 397, 1128, - 3830, -1034, -1055, 2244, -759, -706, 79, 893, - -922, -1067, 2740, -868, -858, 1129, 34, 1096, - 2455, -694, 1970, -650, -674, -131, 370, 697, - -1069, -1137, -948, -1045, -1087, -964, 367, 1091, - 4096, -960, -921, -870, 1397, -511, -190, 545, - -657, -1194, -536, -951, -1094, 117, -720, 2532, - -1098, -1147, -1177, 1764, -757, -121, 2372, 2010, - 3662, -952, -995, -894, -625, 464, 731, 863, - -607, -505, 401, -423, -540, 2144, 755, -430, - -1499, -1242, -1202, -1190, -626, 1249, 3388, 2379, - -983, -1090, -907, -1021, -1012, -870, 2723, 1589, - -913, 332, -102, 99, 226, 6, 176, 354, - 156, -36, -829, -774, -685, -15, 498, 503, - 2030, -409, -599, -572, -341, -2, 111, 302, - 788, -1002, -978, -929, -1001, -886, 578, 995, - 1237, -747, -696, -653, 1143, 62, 506, 571, - 994, -993, -902, -871, -662, 1527, 370, 979, - 980, -466, -484, 787, -261, 61, 250, 377, - -112, -676, -535, -344, 274, 363, 185, 334, - -48, -1144, -1095, -1011, -552, 445, 1355, 1207, - -1108, -1128, -1085, -826, -83, 2001, 1265, 1429, - -1024, 1199, -671, -701, -444, 1192, 187, 673, - -1039, -1056, -953, -732, 359, 714, 787, 935, - -1187, -1133, -1112, -971, 2158, 1720, 801, 2016, - -1056, -1068, -889, 1808, 503, 892, 358, 1041, - -1180, -1184, -1068, -788, 1423, -573, 2141, 1949, - -1042, -924, -849, 512, -629, -272, 779, 815, - 1939, -1069, -1092, -1027, -770, 48, 1554, 1285, - -1109, -1148, -1157, -1033, -934, 779, 1358, 1560, - -1053, 222, -1095, -1001, -681, -26, 1112, 1035, - -1168, -1285, -1169, -1180, -1085, -1097, 1313, 3112, - -928, -655, -811, -618, 1555, -480, 71, 467, - -1220, -1123, -1008, -577, -845, 3854, 491, 1878, - -1051, -761, 617, -650, -453, 51, 784, 757, - -993, -883, -905, -708, -869, 969, -64, 655, -}; - -static const int16_t fcb22s[] = { - 9854, -479, -1163, -1147, -1316, -1137, -991, -942, - 522, 739, -1042, -1306, -1040, -126, 1147, 3526, - 1880, -477, -483, -328, -899, 1063, 1243, -610, - -721, -527, -372, 171, 90, 196, 6615, -1167, - -1189, -1079, -954, -817, -833, 2246, 439, 1038, - -1053, -1136, -938, -805, -1022, -1041, -717, 2021, - 341, 935, -1164, -1230, -573, 1768, 11111, -1113, - -874, -631, -367, 7, -1077, -925, 1558, -850, - -918, -755, -512, 452, 260, 400, -787, -966, - -690, -584, -843, -802, 2092, 120, 103, 580, - -746, -512, -241, -621, 2771, -486, -268, 258, - 171, 232, -1265, -1253, 15128, -1123, -1037, -885, - -1109, -664, -659, -240, 1558, -909, -1160, -1247, - -1223, -1031, -989, -415, 3504, 1569, -651, -1241, - -1145, -1014, -1322, -1000, -354, 59, 709, 4206, - -1124, -986, -633, -976, -907, -636, -371, 255, - 1195, 876, -145, -1146, -1018, -992, -480, -762, - 6904, -703, -431, 1043, -1048, -638, -142, 394, - -852, -730, -533, -361, 234, 221, -1070, -930, - -764, 3210, -780, -256, 1777, 258, 307, 382, - -1224, 987, 4894, 3525, -412, -558, -819, -863, - -572, -497, -1175, -1197, 7637, -1109, -748, -116, - -306, 27, 386, 630, -1334, -1378, -1302, 12592, - -1327, -971, 89, -731, 259, 201, -1135, -951, - -585, -64, 3489, 2765, 43, 75, -527, -162, - 2865, -1344, -1394, -1391, -1231, -748, -962, 5403, - 719, 1418, -724, -1101, -955, -743, -937, -1064, - -1095, -601, -60, 411, -1113, -873, -603, 2913, - 2512, -339, -36, 26, -39, 78, -757, -998, - -522, -838, 5507, -973, 796, 536, 250, 312, - -1363, -944, 6021, -58, 5313, -690, -549, -485, - -66, -133, -1257, 6004, 6374, 1487, -976, -987, - -969, -803, -1027, -624, -967, 1744, 3504, 6, - -659, -691, -326, -129, -49, 148, -1032, -683, - 1819, 1804, -491, -452, -295, 33, -20, 42, - -1226, -1086, -792, 6412, -657, -278, -103, -25, - -82, 207, 2450, -6, 2417, 251, -622, -593, - -409, -193, -339, -304, -862, -667, 2457, -500, - -438, -504, 1408, 143, 203, 265, -1128, -1148, - 2791, -373, -951, 2129, -842, -278, 81, 307, - -787, -822, 2655, -604, 2028, -787, 4, 335, - 170, 219, 649, -457, 972, -607, -359, -470, - -238, 68, -57, 107, 2285, -526, -490, -604, - 179, -41, 230, 64, 20, 50, -802, 1168, - -235, -264, -316, 1469, -499, 108, 183, 150, - -1068, -806, -399, 1244, -355, 487, -57, 450, - 195, 248, -1122, -1096, 3327, -956, 1084, 1306, - 247, 442, 169, 283, 3416, -609, -891, -879, - -853, -573, -285, -147, 380, 608, 1271, -874, - -931, 40, -989, 1432, 1981, -34, 285, 190, - -902, -974, 4117, -868, -784, -584, -358, 200, - 261, 521, -945, -981, -773, 3517, -961, 2420, - 9, 318, 187, 322, -1006, -779, -526, 2972, - -712, -578, -576, 167, 156, 270, 460, -74, - -237, 939, -440, -515, 126, 63, 82, 67, - -1069, -1104, -923, -634, -190, 1151, 526, 2920, - 125, 566, -1144, 4199, 1314, -458, -568, -336, - -515, -332, -352, -143, -770, 283, -770, -785, - -807, -348, 93, 427, 181, 334, -798, -830, - -300, -509, 1257, -554, 1341, 6, 242, 272, - -1030, 62, 1293, 340, 752, -493, -6, -34, - 33, 85, -893, -1202, 244, -131, -306, 7590, - -832, 420, 80, 423, -799, -870, -930, -720, - -640, 2390, -409, -177, 91, 370, -864, -949, - 838, -574, -234, 555, 46, -9, -83, 146, - -825, -478, -664, -57, 867, -296, -380, -73, - 70, 171, -1124, 10522, -228, -609, -958, -1025, - -548, -384, -257, 55, 5414, 436, -651, -748, - -671, -525, -25, -273, -264, 57, -1129, 1974, - -145, 1650, -317, -514, -305, -78, -154, 59, - 1269, 1008, -510, -711, -534, -358, 194, 117, - 102, 57, -837, 1260, -126, -494, 47, -162, - 924, -72, 130, 97, 742, -803, -711, -755, - -402, -188, 24, 309, 187, 379, -1092, 5862, - -647, -807, -715, -696, -408, -29, 104, 353, - 3298, 2193, -263, -772, -908, -754, -449, -164, - -157, -44, -986, 2313, -596, 56, 2057, -478, - 74, -51, 51, 121, -899, 1793, -595, -669, - -743, -689, -546, 71, 201, 382, -1061, 3375, - -776, -876, -648, -407, -44, 260, 258, 393, -}; - -static const int16_t fcb22m[] = { - 11522, 868, -1444, -1572, -1674, -1745, -1844, -1616, - -1723, -1508, 27, -321, -693, -597, -374, -380, - 327, 209, 611, 1182, -548, 176, -544, -485, - -341, -376, -383, 1024, 1316, -4, 192, -649, - -979, -945, -802, -183, 3749, 812, -416, -527, - -734, 1059, -521, 924, -462, -631, -76, 182, - 126, 100, -653, -643, -1189, -1264, -1312, -1311, - -1212, -1016, -218, 8415, -1005, 734, 1303, -272, - -397, -521, -245, 389, 242, -234, 458, -912, - -1215, -1228, -1288, -1131, -845, -404, 912, 5497, - 413, 3161, -432, -148, 1704, -663, -996, -1009, - -1419, -929, -36, -471, -640, -571, -197, -573, - -462, 2586, -179, -382, -757, -895, -1096, -1140, - -1216, -1051, -688, -44, 3311, 3518, -474, 2530, - 1475, -676, -702, -777, -380, -316, -538, -468, - -708, 542, -213, -713, -911, -482, -696, -135, - 1282, 2006, 5707, 476, -707, -771, -650, -788, - -778, -853, -962, -926, 10, -11, 3, 1, - -12, -14, 21, 7, -13, -10, -1410, -1712, - 1379, 5757, 218, -1232, -563, -929, -684, -827, - -261, 1040, -154, -309, -99, 62, 856, 199, - -614, -926, -626, 1568, -258, 374, 1071, -140, - -250, -332, -832, -706, -863, -714, -749, 3081, - 498, -695, -395, -600, -279, 588, 245, 3122, - -329, -677, -262, 67, 19, -530, -882, -862, - -1033, -160, 1542, 1916, -416, -600, -553, -219, - -130, -497, -699, 1719, 160, 3293, -212, -923, - -1045, -761, -1238, -1038, 1543, 738, -548, -541, - -403, -281, -115, -95, -313, -19, -292, 1136, - 3592, 696, -654, -856, -726, -693, -1057, -1267, - -722, -381, -683, 1364, -30, 589, 454, 262, - -57, -1018, -312, 846, -139, -587, -127, 2482, - -178, -233, -977, -796, -6, 250, 220, 1577, - 1141, -251, -649, -809, -1051, -873, -762, -990, - -1010, -890, -897, -639, -671, 1964, 788, 2310, - 6001, 20, -1008, -1159, -1208, -1208, -1318, -1227, - -829, 1680, -1023, -998, -1224, -945, -769, -41, - 2033, 196, 917, 1615, 2026, -654, -1014, -918, - -750, -675, -839, 1541, 282, 430, -1059, -708, - -507, -522, -169, 438, 196, 835, 778, 897, - 420, 526, 1239, 198, -736, -953, -835, -229, - -348, 726, -767, 1311, 248, -353, -550, 1017, - -250, -732, 256, -175, -638, 763, -761, -957, - -554, 539, 252, 299, 431, 613, 4398, -378, - -1022, -1020, -990, -757, -621, -83, -34, 122, - -476, 77, -799, -116, 4546, -787, -735, -462, - -875, -907, -1373, -1354, -1355, -1220, -1024, -88, - 1298, 2844, 940, 1135, 2261, 2142, 181, -735, - -924, -941, -799, -715, -662, 86, -719, -521, - 115, -576, -699, 1052, 1295, -57, 42, 230, - 2876, 501, -294, -158, 104, -157, -515, -662, - -987, -1069, -703, -985, -1061, -946, -878, -267, - 397, 132, 534, 3642, 1298, -560, -701, -526, - -294, 197, 310, 75, -3, 267, -342, 2058, - -328, -427, -709, -688, 14, -43, 237, 506, - 2822, -337, -900, -818, -638, -192, 883, -14, - -271, -559, 2822, -165, -988, -933, -917, -603, - -583, -397, 467, 1092, -1044, -479, 2478, -386, - -535, -253, 63, -49, 79, 27, -182, -100, - 362, -628, -661, -707, 1557, 136, 335, 89, - -197, 5697, 220, -473, -472, -1053, -1023, -1087, - -1203, -756, -377, -917, -925, -568, -237, 1422, - 197, -98, 614, 867, -831, -829, -969, -720, - 414, 1080, 1707, 828, -121, -757, -1044, -289, - 816, 284, 809, -84, -22, -552, -9, 193, - -359, 66, -582, -674, 1992, -31, 58, 427, - -515, -299, 932, -608, -1103, -1068, -1016, -770, - 200, 1031, 1112, 1026, -598, -818, -891, -635, - -828, -866, -650, 4795, -407, 215, -853, 373, - -696, 159, 995, 465, -509, 109, 60, 10, - 8455, 198, -999, -1131, -1111, -1195, -1246, -1192, - -1181, -934, -365, -764, -689, -589, -734, 2479, - -960, 1279, 104, -209, -1012, -824, -1059, -921, - -812, -204, 199, 601, 3136, 637, 3021, 3851, - -490, -18, -930, -1081, -1133, -1182, -1268, -980, - -864, -945, -278, 961, -514, -123, 562, 874, - -130, 336, 3314, -331, -1112, -1162, -1227, -1230, - -1172, -988, -319, 3582, 890, 50, -681, -788, - -906, -876, -829, -827, -41, 3416, -740, -913, - -893, 404, 2059, -651, -474, 302, 516, 578, -}; - -static const int16_t fcb22sl[] = { - 1098, -1107, -1125, -983, -770, -233, 201, 823, - -1433, -1294, -17, -1156, -301, 1185, 1307, 1108, - -1247, 1829, 1353, -537, -457, 116, 574, 712, - 159, -489, 511, -340, 54, 119, 213, 351, - -1489, -1256, -1324, -1132, 3710, 262, 1087, 1465, - -1434, -1027, -1116, 825, -662, -428, -109, 1045, - 229, 753, -604, -422, 122, -220, 279, 375, - -349, -684, -197, 490, -160, -116, -120, 146, - 5195, -895, -974, -758, -524, 21, 761, 1016, - -1216, 151, 864, -602, -715, -591, -347, 592, - -1265, -1328, -1375, -878, -660, -549, 143, 4302, - -1433, -1277, 360, -1032, -835, -385, 337, 1111, - -1345, -1250, -1156, 914, 1594, 22, 912, 1012, - -1576, -1411, -1364, -1153, 842, -184, 240, 1302, - -1486, -1162, 1246, -880, -830, 14, 2487, 1607, - -1384, -158, -572, -977, 43, -30, -184, 572, - 2759, -892, -768, -522, -289, -44, 351, 575, - -1292, -546, 3736, -609, -538, -25, 514, 924, - 1772, 1639, -903, -595, -263, 340, 579, 670, - -1425, 770, -1179, -920, -1158, -675, 496, 1208, - -1337, 1240, -1030, -1044, 1840, 312, 809, 908, - -1457, 1410, -1240, -1083, -541, 568, 2768, 1432, - -1249, -890, 1078, 1278, -558, 63, 573, 778, - -1285, 1932, -1004, -902, -339, 59, 17, 659, - -1352, -935, -877, 3421, -455, 160, 820, 1230, - -1326, -978, 986, -790, 1541, 41, 542, 743, - -1491, -1162, -1389, -1265, -928, -139, 5045, 2259, - -1182, 1358, -953, 1338, -502, 122, 749, 839, - -1284, 4389, -1001, -813, -421, 44, 855, 1072, - 1658, -881, -821, 1409, -299, 4, 453, 700, - -1144, -1112, 1230, -790, -421, 1250, -12, 655, - 1545, -872, 1199, -632, -365, 56, 415, 663, - -1401, -1189, -1403, -1189, -1145, -687, -116, 1120, - 1768, -1068, -1024, -629, 1440, 88, 578, 711, - -1651, -1561, -1564, -1430, -1037, 1264, -21, 1944, - -1552, -1336, -1277, 916, -412, 27, 2454, 1661, - 1996, -1087, -1223, -924, -393, 1673, 794, 1017, - -1362, -132, 151, 537, -992, 1830, 777, 991, - -1591, -1355, -1494, -1420, -666, 2407, 3210, 2092, - -1114, -624, -1087, -903, -808, -438, 1881, 654, - -1140, 254, -105, 212, 386, 49, 256, 314, - 83, 98, -1128, -901, -578, 362, 702, 691, - 1191, -204, -335, -226, -102, -44, -5, 120, - 57, -1110, -403, -651, -806, -202, 567, 690, - 349, -908, -1075, -941, 1487, 464, 763, 782, - 387, -1070, -990, -765, -295, 1669, 341, 881, - 232, -1013, -1043, 723, -311, 294, 646, 574, - 72, -1191, -546, -183, 493, 161, 201, 465, - -185, -1434, -1368, -1051, 64, 385, 748, 986, - -740, -530, -1199, -562, 142, 1388, 1487, 715, - -1359, 873, -1187, -923, -455, 1914, 403, 1016, - -1245, -1223, -624, -495, 724, 652, 433, 585, - -1499, -1277, -1381, -1148, 1679, 2138, 995, 1424, - -1345, -1319, -1296, 906, -228, 1534, 506, 1024, - -1628, -1410, -1422, -1197, 1393, -22, 2728, 1784, - -1245, -1056, -942, 2, -165, -115, 840, 569, - 1016, -1191, -1091, -862, -457, 95, 2087, 1029, - -1460, -1486, -1459, -1104, -571, 925, 1234, 935, - -1568, -49, -1325, -1255, -64, 315, 838, 962, - -1651, -1562, -1606, -1571, -1308, -380, 1988, 2117, - -848, -412, -987, -370, 1224, -304, 10, 498, - -1523, -1348, -1373, -959, -772, 3767, 621, 1773, - -931, -628, 169, -513, 61, -306, 994, 476, - -1116, -879, -875, -484, -795, 958, -162, 444, -}; - -static const int16_t fcb22ss[] = { - 6765, -638, -1108, -977, -679, -446, -325, -432, - -127, 96, -569, -621, -1050, -841, -800, 1474, - 1170, 60, 330, 223, -1317, 855, 307, -931, - -648, -549, -148, 535, 642, 445, 3666, -1146, - -1167, -944, -584, 942, -284, 25, 573, 472, - -1041, -1096, -1209, -1082, -770, -737, -139, 2073, - 753, 832, 507, -828, -1112, -1130, 4284, -722, - -261, -57, 499, 300, -1380, -1130, 135, -898, - -816, -395, 195, 453, 650, 537, -953, -1109, - -1221, -981, -747, -647, 2360, 467, 845, 684, - -1177, -792, -1254, -1148, 1344, -745, -323, 180, - 729, 739, -1020, 183, 5226, -638, -358, -86, - -268, -143, 84, -115, 480, -543, -1229, -1097, - -594, -983, -792, -391, 2637, 1405, -761, -866, - -1186, -973, -792, -640, -220, -102, 1165, 3159, - -1241, -1057, -1322, -1007, -731, 44, 264, 668, - 2645, 1592, 2885, -1155, -1347, -1209, -309, -1161, - 4216, -64, 830, 616, -688, -638, -596, 202, - -665, -623, -499, -248, 512, 749, -1395, -708, - -1086, 1209, -745, -367, 1397, 279, 374, 259, - -1357, -254, 2310, 1839, -147, 36, -402, 300, - -49, 47, -1328, -992, 3453, -889, -621, 135, - 437, 70, 663, 346, -1339, -1136, -1275, 6675, - -1309, 2285, -869, 1154, 640, 617, -505, -1042, - -984, -702, 1283, 1573, -168, 135, 249, 253, - -783, -1119, -1342, -975, -1127, 1391, -705, 4439, - 1160, 845, -1283, -1224, -1286, -1142, -1019, -901, - -658, -157, 231, 611, -994, -463, -1017, 1082, - 1831, -459, -164, 114, 0, 108, -1386, -1079, - -1318, -1091, 2540, -717, 762, 1414, 849, 576, - -1405, -566, 2704, -996, 2133, -678, 404, 281, - 4, -32, -1474, 3530, 2301, -711, -919, -305, - -125, 184, 450, 73, -1132, 1567, 1620, -551, - -198, -645, 19, 8, 190, 191, -741, -728, - 410, 1067, -322, -239, 86, 11, -137, -220, - -489, -607, -963, 3630, -624, -478, -12, 124, - 219, 63, 2040, 75, 1338, -293, -333, -336, - -330, -246, -360, -344, -953, -393, 1550, -701, - -616, -254, 1908, 211, 328, -43, -1089, -299, - 1070, -723, -923, 2170, -400, -13, -28, 108, - -812, -400, 876, -650, 1308, -772, -256, -200, - 117, 329, 649, -639, 437, -704, -567, -20, - -211, 197, 330, 342, 1670, -468, -920, -588, - 972, -310, 9, -46, 70, -29, -1313, 1684, - -794, -979, -752, 1864, -173, 108, 248, 292, - -1247, -1226, -1059, 288, -112, 189, 20, 540, - 454, 380, -1035, -803, 1267, -767, 746, 1331, - 107, 317, 158, -116, 2093, -723, -1064, -906, - -713, -789, -518, 48, 494, 1018, 1835, -1353, - -1303, -1098, -559, 800, 520, 662, 615, 574, - -1282, -526, 1829, -1086, -885, -356, -539, -50, - 493, 402, -777, -374, -754, 1721, -701, 2086, - -348, 218, 138, 109, -1367, -1226, -1041, 1949, - -433, -291, -363, 567, 613, 560, 1166, -481, - -737, 1193, -479, -163, -69, 2, 133, 239, - -1444, -1448, -1350, -987, -296, 606, 755, 543, - 741, 806, -851, 2437, 23, -681, -670, -271, - -439, -227, -243, -198, -1307, 424, -1212, -987, - -745, -369, 162, 641, 915, 611, -24, -728, - -1061, -659, 808, -532, 1241, -233, 266, 353, - 175, 210, -262, -328, 101, -238, 66, -339, - -472, -415, 952, -1490, -1302, -955, -1270, 5776, - -792, 777, 1097, 807, -1334, -1172, -1211, -924, - -877, 2458, -355, 593, 936, 699, -336, -700, - -762, -569, -337, 642, 97, 441, -188, -533, - -1062, 188, -873, -801, 418, -167, -57, -29, - 79, 241, -1110, 6430, -816, -807, -462, -601, - -56, -45, 188, 74, 2869, 43, -1122, -799, - -772, -847, 1394, -36, 294, 13, -1304, 2155, - -534, 1545, -315, -325, 183, 31, 372, 187, - 873, 1376, -1037, -810, -516, -235, 485, 99, - 287, 327, -1074, 1203, -1089, -882, -515, -544, - 2041, -40, 208, 191, 597, -1141, -1274, -885, - -386, 106, 593, 394, 671, 678, -1292, 3861, - -1085, -1150, -748, -218, 500, 55, 335, 469, - 3217, 2888, -882, -643, -590, -506, 43, -459, - -210, -222, -965, 2453, -830, -779, 1808, -588, - 130, 4, 130, -23, -1269, 1374, -1238, -1148, - -523, -659, -170, -302, 1055, 1389, -1467, 2505, - -930, -1181, -842, -516, 399, 886, 849, 738, -}; - -static const int16_t fcb22sm[] = { - 5761, -398, -743, -948, -944, -845, -883, -896, - -811, -604, -1142, -1388, -1190, -685, -118, 1498, - 1590, 293, 564, 352, 124, 851, -131, -652, - -573, -279, -756, -478, 833, 670, 2609, -1138, - -1107, -1024, -739, -646, -387, 33, 635, 1037, - -717, -990, -1161, -948, -660, -230, 69, 2510, - 1274, 841, -49, -872, -764, -211, 3046, -30, - -143, -311, -324, -413, -760, 67, 619, -699, - -725, 305, -484, 1292, 472, -156, -568, -1243, - -1256, -994, -803, -386, 1692, 596, 1325, 1290, - -492, -1007, -732, -788, 1136, -610, 45, 1307, - 420, 649, -534, -1075, -949, -367, 219, 444, - -120, 251, 476, 1806, 902, -927, -1151, -879, - -659, -741, -5, 298, 1861, 995, -244, -1031, - -1142, -1085, -952, -773, -468, -9, 1637, 3592, - -971, -1150, -1199, -985, -689, -317, 150, 540, - 2727, 1678, -223, -403, 102, -902, -773, -223, - 3182, -457, 75, -188, -291, -428, -101, -365, - -442, -336, -128, -33, 781, 1242, 501, -753, - -846, 757, -444, -311, 1182, 4, -8, -122, - 1866, -528, -142, 1598, -15, -219, -557, -804, - -916, -965, 114, 130, 3672, -19, -873, -280, - -777, -919, -824, -654, 1078, 39, -50, 119, - -411, -311, -359, -57, -137, 7, -780, -892, - -767, -167, 1302, 1693, -205, -51, -174, -71, - 838, -220, -1133, -993, -710, -340, 650, 1341, - 191, -5, 743, -543, -125, -567, 70, -42, - -501, -448, 47, 1151, 400, -774, -781, 1324, - 1089, 32, -256, -415, -352, -214, 912, -1141, - -988, -638, 1349, 251, 124, -4, 89, -16, - -678, -569, 1502, 146, 114, 816, -98, -269, - -622, -808, -634, 3319, 1218, -323, -750, -548, - -525, -575, -591, -730, 35, 764, 1423, 574, - -352, -672, -802, -314, -308, -29, -1040, -717, - 469, 421, -527, -420, 589, 195, 556, 472, - -626, -864, -133, 3531, -667, -460, -523, 103, - 23, -309, 2381, 136, 1197, -399, -399, -501, - -638, -899, -813, -707, -249, 719, 821, -989, - -629, -568, 642, -4, 297, 70, -1105, 454, - 400, -235, -562, 1607, -116, -205, 1, -490, - 7, -523, 764, 329, 992, -240, -249, -275, - -366, -265, 662, -803, 393, -567, -501, -32, - 178, 371, 126, -146, 1748, -516, -634, -395, - 268, 893, 154, -36, -620, -999, 304, 1490, - -512, -821, -479, 1922, -610, -481, -482, -805, - -996, -16, -567, 542, -22, 589, -114, 69, - 322, 358, -848, 1205, 509, -527, 25, 111, - -243, -197, -20, 62, 1500, -977, -974, -391, - -555, 448, -256, 79, 392, 547, 1472, -1276, - -1203, -987, -315, 515, 855, 183, 231, 62, - -1176, -397, 2831, -527, -575, -435, 174, -337, - 723, 107, -502, -765, -455, 1124, -218, 1444, - 53, -201, -135, -267, -510, -1058, -869, 1130, - -128, -394, 16, 873, 597, 455, 16, 0, - -11, 14, -12, 9, 6, -14, -11, -23, - -453, -1056, -988, -713, -267, 794, 954, 1361, - 822, -448, 379, 1163, 336, -724, 55, 109, - 237, -80, -732, -1017, -264, 654, -1043, -1015, - -654, 91, 17, 548, 504, 932, -1057, -1151, - -964, -130, 1171, -146, 740, 134, 790, 539, - -591, -577, -388, 154, 609, 341, 657, 838, - -379, -872, 711, -665, -818, -549, -151, 2501, - -28, -189, -255, -378, -363, -1157, -929, -887, - -338, 1926, -33, -26, 1009, 765, -79, -98, - -37, -967, -566, 1012, 905, -245, 41, 322, - 194, -148, -220, -171, -239, -242, -147, -14, - 221, 575, 1754, 3059, -246, -713, -696, -636, - -640, -843, -841, -755, 2554, -504, -568, -318, - -324, -171, -294, -238, -288, -174, -289, 1273, - -231, 1053, -284, -338, -394, -227, -303, -226, - 966, 742, -873, -503, -586, -286, 119, -59, - 339, -38, -843, 977, -448, -238, 227, -77, - 729, 6, 45, -493, 277, -1385, -1289, -846, - -117, 376, 763, 553, 769, 670, -652, 3280, - -762, -882, -396, -299, 124, -270, -31, -210, - 2413, 644, -790, -912, -581, -507, -110, -408, - -54, -30, 632, 969, -632, -206, 955, -95, - -578, -337, -377, -467, 1264, 67, -854, -863, - -909, -751, -616, -479, 563, 2070, -972, 1478, - -450, -715, -859, -689, 190, 736, 617, 530, -}; - -static const int16_t fcb44sl[] = { - 2433, -925, -1015, -1009, -875, -276, 378, 464, - 694, 795, -1044, -601, -658, 257, -898, -509, - -346, 2160, 694, 952, -1302, -619, 502, -378, - -624, -178, 349, -100, 204, 546, -1450, -1127, - -1302, -1297, -1051, -840, 3426, 1346, 1577, 1723, - -1267, -710, -872, 448, -1023, -728, -521, -134, - 874, 936, -1134, -549, 203, -932, -1051, 755, - -608, -199, 858, 1008, 1819, -842, -773, -739, - 818, -371, 289, 293, 656, 704, 308, -1009, - -959, -1089, 466, -468, 279, 897, 764, 797, - -1433, -1276, -1253, -1326, -1182, -992, -85, 4339, - 2135, 2136, 1131, -917, -966, -859, -889, 1178, - 62, 659, 771, 882, 1844, -607, 1184, -766, - -805, -385, -61, 502, 648, 732, -1245, 1315, - -818, -827, 621, -588, 193, 480, 649, 776, - -1178, -1202, -1152, -1088, -857, -191, -49, 129, - 1950, 1237, -1461, -1290, -1342, -1401, -1338, -1213, - -623, 224, 4086, 2517, -1150, -814, -747, 916, - 807, -288, 319, 436, 560, 718, 392, -973, - -988, 411, -954, -502, 214, 621, 856, 831, - -1268, 4012, -852, -1002, -1014, -577, 32, 552, - 987, 1138, -1205, -1319, -1145, -928, 80, 371, - 277, 779, 859, 902, -1141, -991, -957, 707, - -892, 1098, 126, 381, 668, 870, -1254, -995, - -1163, -926, -1149, 2572, -17, 747, 1456, 1509, - -1004, -867, 1205, -797, 938, -657, 346, 520, - 782, 872, -1328, -1080, -1111, -1067, 2227, -892, - 665, 1604, 1425, 1477, 1869, -668, -712, 1044, - -800, -139, 0, 355, 609, 717, -1192, -632, - 3546, -780, -870, -501, 141, 504, 921, 1027, - -1125, -1087, 1154, -660, -987, 937, 82, 1390, - 1360, 1243, 1259, -550, -769, -787, -743, -362, - -12, 177, 321, 505, -1147, -899, -947, -849, - 1371, -462, -127, 16, 752, 954, -1405, 448, - -1181, -1259, -1204, -868, -468, 110, 1293, 1263, - -1267, -1180, -1238, -930, -940, 916, 1793, 653, - 1070, 1137, -216, -997, -845, -659, -699, -174, - 758, 961, 417, 630, -1123, 1691, 1229, -732, - -937, -491, -78, 265, 744, 864, 4771, -856, - -1005, -1007, -934, -484, -17, 579, 861, 959, - -1264, 70, -961, -864, -860, -302, 314, 788, - 487, 686, -1133, -790, -466, 561, -812, -256, - 2078, -58, 757, 953, -1133, -286, -655, -476, - -23, -629, 7, 182, 426, 504, -1110, 314, - 497, -822, -662, -754, 1179, 1726, 696, 955, - 1793, -1143, -1268, -1279, -1207, -873, -183, 1546, - 1440, 1305, -1278, 1396, -779, 558, -840, -32, - -18, 257, 616, 757, 265, -906, 499, -897, - -846, -435, 362, 434, 752, 732, 453, 150, - -1029, -1182, -1195, -940, -297, 876, 1084, 1051, - -1377, 1354, -1148, -1313, -1211, -937, -366, 1942, - 1323, 1410, 311, -270, -81, -159, 42, 42, - 7, 357, 255, 285, 1973, 1386, -752, -873, - -916, -466, -39, 493, 638, 759, -1338, 1107, - -1081, -1165, -1038, -484, 1722, 534, 1038, 1102, - -1446, -1212, -1337, -1452, -1422, -1291, -690, 1634, - 1348, 1640, -1044, -184, -757, -683, -100, 1044, - 369, 349, 432, 584, -1137, -528, 1425, 1294, - -842, -257, -32, 289, 639, 796, -1418, -1229, - -1282, -1391, -1421, -1234, -852, -765, 737, 2076, - -1104, -928, -936, -1088, 378, -765, 1603, 581, - 753, 925, -1191, -841, -919, 2886, -907, -232, - 180, 543, 956, 1070, -1314, -843, 804, -1094, - -1209, -1031, -626, 698, 1049, 1152, 256, 831, - -841, -814, -841, -54, 134, 347, 535, 658, - 104, -801, -959, -519, -406, 156, 12, 13, - 380, 494, -1144, -1112, -973, -965, -916, -474, - -225, 460, 402, 734, -1448, -1316, -1278, 231, - -1086, -578, 584, 1115, 1275, 1260, -1321, -963, - -1127, -1288, 41, -1102, -31, 1331, 1003, 1145, - 112, -1270, -1343, -1376, -1114, -778, 392, 1918, - 1165, 1246, -1247, -870, -1232, -1147, -1075, 570, - 181, 1983, 971, 1216, -1309, -1199, 260, -1136, - -950, -742, 1067, 703, 1150, 1144, -1405, -1533, - -1564, -1549, -1264, -737, 1085, 1706, 1806, 1785, - 282, -1173, -1128, -1188, -971, -885, -291, 254, - 841, 987, -142, -1068, -1264, -1232, -1058, 138, - 546, 521, 1096, 987, 890, -936, -1020, -1051, - -871, -521, 1686, 625, 930, 936, -1343, -924, - -1231, -1247, -1052, -951, 1110, 125, 826, 1116, -}; - -static const int16_t fcb44ss[] = { - 6575, -881, -1291, -1258, -1090, -517, -268, -56, - 106, 295, -303, -1134, -1113, -650, -508, 1843, - -235, -141, 454, 832, -1212, 856, -404, -620, - -682, -487, -69, 865, 341, 95, 3626, -1037, - -1366, -1349, -1126, -558, 187, 343, 657, 765, - -410, -735, -1046, -1023, -897, -673, -366, 3174, - 1264, 720, -730, -922, -523, -821, 4042, -463, - 45, 329, 213, -93, 301, -1011, 277, -840, - -820, -451, 417, 470, 739, 953, -1219, -1286, - -1545, -1426, -1209, -803, 1156, 1311, 1329, 1329, - -643, -1136, -1200, -912, 1221, -695, 342, 910, - 905, 812, -996, -365, 4868, -738, -591, -621, - 17, -42, 0, 100, 2085, -1214, -1434, -1432, - -1243, -577, -626, 140, 1357, 1821, -1064, -1261, - -1629, -1525, -1488, -1101, -631, 551, 3556, 3974, - -635, -846, -1005, -646, -803, 123, -151, 357, - 2137, 953, -1168, -1055, -1115, -1061, -823, -651, - 3842, 606, 491, 491, -1297, -1063, -990, -1051, - -1202, -983, -468, -47, 163, 336, -1131, -446, - -683, 644, -660, -675, 1251, 373, 195, -123, - -1109, -430, 1820, 1883, -862, -743, -265, 119, - 66, -41, -1281, -768, 1941, -955, -1054, -856, - 528, 363, 488, 545, -936, -682, -814, 5534, - -826, -347, 58, -38, 168, 14, 1224, -719, - -300, -766, -407, 630, 269, 39, -230, -701, - 1601, -958, -945, -955, -734, -487, -20, 1392, - 544, 282, -118, -1133, -1161, -1065, -939, -213, - -129, -271, 451, 2570, -895, -805, -536, 1455, - 1496, -647, -199, 114, 95, -42, 2230, -855, - -715, -819, 1762, -699, -50, -109, 163, 207, - -334, -759, 3297, -645, 2561, 77, -239, -259, - -275, -445, -1304, 3536, 1610, -526, -926, -582, - -12, 44, -180, -69, -804, 1107, 1451, -868, - -851, -589, -354, -85, 88, 336, -537, -444, - 40, 231, -715, -523, -351, -379, -123, 171, - 1223, -328, -567, 2182, -291, -352, 20, -157, - -338, -635, 2194, -476, 1624, -802, -762, -585, - -245, 48, 63, -45, -32, -646, 847, -556, - -727, -259, 1309, 239, -128, -755, -1018, -640, - 876, -642, -906, 1394, -26, 338, 204, 148, - -988, -521, 135, -807, 1065, -525, -80, -248, - 383, 836, 521, 13, -553, -865, -928, -631, - -137, -83, 446, 221, 1924, 48, -621, -845, - -782, -544, -531, -418, -79, 915, -711, 1247, - -938, -766, -995, 1459, 31, 199, 261, 190, - -670, -1207, -1013, 108, -670, 204, 407, 266, - 473, 998, -606, -923, 1845, -1061, 910, -774, - 268, 493, 178, 61, 1938, -1237, -1010, -1097, - -780, -368, 1125, 354, 398, 550, 1032, -1128, - -1196, -908, -767, 529, 2326, 728, 227, -13, - -1113, -367, 382, -939, -1094, -896, -463, 446, - 896, 1128, -591, -823, -894, 3052, -968, 2157, - -153, -71, 111, 118, -1106, -930, -911, 1663, - -905, -691, -226, 503, 665, 702, 2067, -1149, - -828, 990, -850, -426, -159, 148, 379, 512, - -1268, -1390, -1492, -1343, -1419, 2246, -224, 2124, - 1523, 1338, 522, 1613, -344, -694, -487, -325, - 293, 96, -374, -679, -364, 124, -1201, -1274, - -1078, -513, 15, 1045, 529, 680, 131, -1067, - -1030, -888, -806, -122, 1002, 1302, 757, -473, - -530, -538, -821, -373, 72, 797, 864, 265, - -542, -1090, -241, -1095, -1205, -991, -1172, 5025, - -420, 728, 461, 103, 2325, -915, -1012, -854, - -1117, 2018, -377, -35, 266, 443, -949, -1163, - -1064, -1057, -802, 721, 1278, 470, 308, 263, - 474, -773, -1033, -892, 227, -30, 39, 101, - 456, 476, -1263, 7275, -946, -1157, -1304, -922, - 248, 143, -98, 312, 3419, -402, -649, -629, - -554, -48, 487, 72, -171, -687, -1167, 1869, - -524, 1490, -869, -236, 111, 68, 77, -85, - 1481, 906, -1189, -1321, -1124, -554, 429, 321, - 814, 699, -1048, 486, -858, -1096, -1072, -744, - 1676, -73, 593, 632, 779, -1265, -1470, -1379, - -1050, -548, 781, 524, 1022, 1079, -1149, 3719, - -1064, -1180, -1159, -775, -211, 241, 492, 555, - 3025, 2828, -849, -1133, -1063, -567, -70, -142, - -176, -62, -614, 1745, -684, -610, 1478, -619, - -235, -361, -84, -44, -1155, 1494, -1183, -1210, - -1294, -1017, -330, 210, 931, 1368, -1306, 2714, - -1052, -1128, -1220, -908, 2409, 441, 310, 318, -}; - -static const int16_t fcb44sm[] = { - 5619, -163, -1005, -856, -831, -644, -612, -759, - -770, -456, 199, -551, -1348, -80, 131, -481, - 334, 202, 366, 1246, -1245, 499, -1454, -396, - -675, -257, 525, 1001, 878, 1075, -1004, -1010, - -1127, -947, -976, 332, 3533, 1315, 265, -683, - -1114, 1056, -1009, 1154, -728, -212, 620, 169, - 102, -110, -658, -902, -1238, -1213, -1238, -926, - -735, -455, 1130, 5139, -1184, 190, 1590, -604, - -800, -373, -366, 251, 720, 571, -6, 304, - -1228, -369, -659, -506, -25, -234, 313, 2366, - 623, 1473, -315, 780, 1048, -416, -586, -737, - -1029, -1094, 483, -725, -771, -379, -268, -15, - 697, 1774, -1, -999, -987, -867, -1339, -1255, - -1018, -652, -125, 643, 3006, 2417, -543, 1629, - 1557, -684, -568, -474, -132, -291, -338, -321, - -1250, 641, -158, -935, -575, -575, 154, 415, - 798, 1421, 3147, 1903, -335, -767, -729, -627, - -611, -752, -836, -735, 678, 502, -946, 556, - -821, -51, -256, 94, 151, 70, -808, -324, - -359, 3637, 286, -90, -365, -613, -782, -871, - 75, 1051, -780, -487, 47, 273, 1768, -102, - -828, -1267, -1093, 1420, -624, 225, 1307, 85, - 239, -152, -649, -853, -1072, -796, -644, 1383, - 1143, -199, 94, -25, 70, 52, -1064, 2487, - -844, -607, -587, 148, 726, 224, -238, -484, - -957, -729, 1517, 1334, -475, -317, -253, -186, - 1, 17, -832, 1450, 423, 1408, -576, -825, - -630, -579, -312, 314, 788, 382, -1000, -1060, - -763, 968, -135, 56, 143, 477, -736, 30, - 4023, 68, -266, -420, -538, -751, -893, -879, - -935, 59, 465, 887, -351, 1396, 176, -250, - -684, -1019, -515, -815, -957, -439, 188, 3794, - 86, -98, -245, -829, 1894, -386, -865, 1513, - 24, -506, -281, -615, -476, -364, -1283, -963, - -339, -133, -161, -480, 25, 230, 1364, 1815, - 1766, -844, -1423, -1185, -972, -458, -275, 138, - 1317, 1778, -1295, -874, -1211, -792, -601, -500, - 2301, 901, 1336, 842, 1355, -426, -1160, -959, - -801, -433, 1852, 144, 284, 169, -1122, -851, - -957, 272, -393, 817, 862, 262, 333, 802, - 320, -576, 1615, -615, -886, -311, 108, 13, - 1, 320, -1205, 962, -483, -791, -749, 1158, - 677, -57, 166, 279, -860, 1237, -971, -1057, - -598, -285, 884, 1174, 657, -303, 2254, -706, - -1113, -655, 719, 234, -124, -199, -135, -360, - -758, -623, -385, -18, 3243, 470, -139, -286, - -520, -953, -1193, -1140, -1297, -1137, -764, 25, - 235, 2217, 1501, 1369, 2024, 781, -1353, -835, - -824, -601, -259, -140, 387, 671, 3, -974, - -760, -884, -485, 709, 1505, -95, 321, 739, - 1610, -156, 1515, -76, -420, -369, -189, -506, - -705, -907, -1052, -516, -1048, -996, -471, 1195, - 212, 184, 800, 1665, 747, -1029, -1013, 789, - -703, 559, -139, -98, 380, 523, -355, 2047, - -766, -991, -809, -566, -257, -242, 485, 1322, - 1989, -330, -945, -559, -448, 1241, 811, 10, - -767, -1218, 1600, -755, 428, -729, -355, -665, - -416, -120, 381, 548, -717, -14, 1587, -886, - -9, 353, 839, 201, -454, -1112, -1334, -309, - 660, -375, -661, -511, 1437, 540, 492, 0, - 95, 3911, -237, -301, -562, -483, -569, -799, - -883, -580, -670, -980, -1056, -896, -797, 1551, - 267, 1000, 1617, 75, -1132, -403, -988, -830, - -627, 1164, 1315, 1594, 310, -564, -1091, -563, - 1195, -442, 1086, -344, -176, -258, 175, 476, - 923, -37, -629, -919, 1278, -610, 113, -314, - -81, 192, 731, -944, -1297, -1108, -934, -259, - 640, 1164, 1326, 558, -767, -519, -875, -930, - -817, -533, 496, 2605, 1359, -131, -1010, 912, - -1055, -309, 768, -198, -166, -76, 429, 640, - 3283, -895, -1229, -853, -853, -399, 147, 44, - 237, 495, -833, -909, -1004, -811, 1039, 1627, - -194, 295, 738, 290, -771, 237, -912, -479, - -648, -518, -226, 573, 2346, 419, 1013, 1510, - -865, -873, -982, -557, 598, 50, 81, -81, - -1150, -640, -1011, 1991, -561, -140, 42, 175, - 521, 799, 3231, -46, -1004, -994, -1140, -1094, - -957, -860, 8, 2346, 212, -499, -55, -997, - -623, -588, 38, -58, 975, 1529, -986, -891, - -1121, -619, 1967, -463, -7, 632, 768, 953, -}; -#endif /* CONFIG_METASOUND_DECODER */ - -const float ff_metasound_lsp8[] = { - 0.2702, 0.5096, 0.6437, 0.7672, 0.9639, 1.0696, 1.2625, 1.5789, - 1.9285, 2.2383, 2.5129, 2.8470, 0.1740, 0.3677, 0.6082, 0.8387, - 1.1084, 1.3721, 1.6362, 1.8733, 2.0640, 2.3442, 2.6087, 2.8548, - 0.1536, 0.3279, 0.5143, 0.6859, 0.9763, 1.2744, 1.5605, 1.8566, - 2.1007, 2.3450, 2.6075, 2.8850, 0.2075, 0.4533, 0.7709, 1.0377, - 1.2953, 1.5132, 1.7826, 2.0351, 2.2590, 2.4996, 2.6795, 2.8748, - 0.1393, 0.2453, 0.3754, 0.5453, 0.8148, 1.1289, 1.4389, 1.7592, - 2.0353, 2.3215, 2.5934, 2.8588, 0.1250, 0.3627, 0.7613, 1.1380, - 1.4163, 1.5565, 1.6920, 1.8130, 1.8678, 2.0427, 2.4318, 2.8544, - 0.2256, 0.4223, 0.6452, 0.8599, 1.0673, 1.3118, 1.5486, 1.8366, - 2.0759, 2.3026, 2.5284, 2.8030, 0.2304, 0.4404, 0.6891, 0.8964, - 1.1510, 1.4202, 1.6483, 1.8580, 2.1181, 2.3686, 2.6078, 2.9128, - 0.2230, 0.3816, 0.5520, 0.6062, 0.7909, 1.0988, 1.4330, 1.7846, - 2.0713, 2.3457, 2.6048, 2.8708, 0.2447, 0.5800, 0.8249, 0.9905, - 1.1721, 1.3990, 1.6694, 1.9064, 2.1307, 2.4255, 2.6815, 2.9117, - 0.1974, 0.3812, 0.5802, 0.7759, 0.9280, 1.1547, 1.4170, 1.6369, - 1.8890, 2.2587, 2.5626, 2.8239, 0.1209, 0.2510, 0.4841, 0.8048, - 1.1197, 1.3563, 1.6073, 1.8926, 2.1350, 2.3669, 2.6291, 2.8985, - 0.2352, 0.4347, 0.6582, 0.8178, 0.9548, 1.1654, 1.4942, 1.8812, - 2.1703, 2.3779, 2.6412, 2.8871, 0.2091, 0.4084, 0.6730, 0.9151, - 1.1259, 1.3262, 1.5937, 1.8129, 2.0237, 2.3317, 2.5778, 2.8620, - 0.1167, 0.2406, 0.4520, 0.7298, 0.9848, 1.2448, 1.5137, 1.7874, - 2.0280, 2.3020, 2.5914, 2.8794, 0.3003, 0.4966, 0.6520, 0.8505, - 1.1600, 1.3981, 1.5805, 1.8346, 2.0757, 2.3102, 2.5760, 2.8499, - 0.2451, 0.4163, 0.5960, 0.7805, 0.9507, 1.2438, 1.5587, 1.8581, - 2.0735, 2.3198, 2.5704, 2.8220, 0.3112, 0.5517, 0.7032, 0.8528, - 1.1489, 1.4257, 1.6848, 1.9388, 2.1577, 2.4265, 2.6678, 2.9051, - 0.2249, 0.3897, 0.5559, 0.7473, 1.0158, 1.3581, 1.6914, 1.9930, - 2.1843, 2.3534, 2.5512, 2.8065, 0.2600, 0.4574, 0.7349, 0.9691, - 1.1696, 1.3848, 1.6335, 1.9021, 2.1174, 2.3481, 2.5902, 2.8390, - 0.2246, 0.3372, 0.4560, 0.5249, 0.7056, 1.0273, 1.3810, 1.7132, - 1.9819, 2.2574, 2.5410, 2.8491, 0.1419, 0.4834, 0.8835, 1.1453, - 1.2839, 1.4224, 1.5593, 1.7877, 2.1285, 2.4070, 2.6043, 2.8511, - 0.1886, 0.3677, 0.5617, 0.8099, 1.1277, 1.3841, 1.5804, 1.8136, - 2.0307, 2.2805, 2.5399, 2.8322, 0.2351, 0.4151, 0.6675, 0.8713, - 1.0464, 1.3292, 1.6586, 1.9281, 2.1355, 2.3495, 2.6222, 2.8782, - 0.2700, 0.4489, 0.6206, 0.7121, 0.7737, 0.9848, 1.3658, 1.7433, - 2.0139, 2.2243, 2.4806, 2.8175, 0.2479, 0.4425, 0.6490, 0.8745, - 1.1161, 1.3849, 1.6773, 1.9566, 2.1491, 2.3624, 2.5685, 2.8114, - 0.2035, 0.3701, 0.5567, 0.7953, 1.0082, 1.2758, 1.5373, 1.7822, - 2.0175, 2.2601, 2.4759, 2.7771, 0.1856, 0.3461, 0.5998, 0.9041, - 1.2383, 1.4612, 1.6667, 1.9305, 2.1617, 2.4107, 2.6477, 2.8656, - 0.2107, 0.3715, 0.5289, 0.6651, 0.8420, 1.1168, 1.4401, 1.7230, - 1.9901, 2.2687, 2.5452, 2.8655, 0.1218, 0.2999, 0.6348, 0.9482, - 1.2745, 1.5876, 1.9129, 2.2348, 2.4020, 2.4922, 2.6351, 2.8357, - 0.1617, 0.3483, 0.5869, 0.8163, 1.0366, 1.2344, 1.4609, 1.7029, - 1.9476, 2.2337, 2.5258, 2.8442, 0.2505, 0.4894, 0.7510, 0.9152, - 1.0845, 1.3657, 1.6528, 1.8346, 2.0160, 2.2811, 2.5338, 2.8136, - 0.0947, 0.1158, 0.0578, -0.0337, -0.0066, 0.0104, -0.0447, -0.0505, - -0.0778, -0.0293, 0.0251, -0.0143, 0.0349, -0.0227, -0.0909, 0.0523, - 0.0325, -0.0410, -0.1045, -0.0899, -0.0009, 0.0075, -0.0575, -0.0855, - -0.0129, 0.0575, 0.0597, 0.0391, 0.0371, -0.0184, -0.0083, 0.0287, - 0.0143, 0.0167, 0.0120, -0.0168, 0.0452, 0.0223, -0.0352, 0.0119, - -0.0496, -0.0965, -0.0661, -0.0072, 0.1099, 0.0843, -0.0087, -0.0478, - -0.0128, -0.0120, -0.0004, 0.0731, 0.1047, 0.0630, 0.0196, -0.0103, - -0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066, - 0.0223, 0.0634, 0.0343, -0.0134, 0.0727, 0.0241, 0.0066, 0.0437, - 0.0610, 0.0364, 0.0248, -0.0358, -0.0686, -0.0104, 0.0426, 0.0088, - -0.0137, -0.0165, 0.0671, 0.0815, -0.0863, -0.0644, -0.0088, 0.0023, - 0.0482, 0.1174, 0.1270, 0.0594, 0.0165, 0.0949, 0.1098, 0.0137, - 0.4951, 0.4999, 0.4958, 0.4907, 0.4984, 0.4965, 0.4958, 0.4996, - 0.4987, 0.4958, 0.4986, 0.4977, 0.2841, 0.2186, 0.1474, 0.1687, - 0.2217, 0.2632, 0.2706, 0.2624, 0.2162, 0.2453, 0.2460, 0.2531, -}; - -const float ff_metasound_lsp11[] = { - 0.1103, 0.3862, 0.6863, 0.8447, 0.9231, 1.0261, 1.1248, 1.4057, - 1.6621, 1.8010, 1.8692, 2.0704, 2.3490, 2.6060, 2.7539, 2.8977, - 0.1273, 0.2407, 0.3812, 0.6004, 0.7767, 0.9383, 1.1344, 1.3351, - 1.5233, 1.7262, 1.9466, 2.1739, 2.3495, 2.5162, 2.7164, 2.9202, - 0.2010, 0.3330, 0.4488, 0.6465, 0.8046, 0.9889, 1.1479, 1.2964, - 1.4770, 1.6606, 1.8789, 2.1155, 2.3287, 2.5199, 2.7101, 2.9119, - 0.1168, 0.2197, 0.3279, 0.4691, 0.6268, 0.8251, 1.0533, 1.2714, - 1.4712, 1.6762, 1.8831, 2.1114, 2.3230, 2.5297, 2.7365, 2.9270, - 0.1405, 0.3109, 0.4986, 0.6891, 0.8634, 1.0583, 1.2594, 1.4349, - 1.6232, 1.8116, 1.9905, 2.1935, 2.3799, 2.5656, 2.7661, 2.9486, - 0.1703, 0.3057, 0.4403, 0.5225, 0.5969, 0.8110, 1.0729, 1.3215, - 1.5407, 1.7381, 1.9477, 2.1680, 2.3586, 2.5612, 2.7630, 2.9410, - 0.1128, 0.2628, 0.4523, 0.6495, 0.8176, 0.9816, 1.1746, 1.3710, - 1.5568, 1.7518, 1.9497, 2.1452, 2.3346, 2.5389, 2.7362, 2.9264, - 0.1809, 0.3287, 0.5205, 0.7264, 0.9298, 1.1217, 1.2970, 1.4894, - 1.6874, 1.8493, 2.0576, 2.2382, 2.4097, 2.6041, 2.7796, 2.9389, - 0.2502, 0.4709, 0.6892, 0.8346, 0.9209, 1.0455, 1.2399, 1.4616, - 1.6463, 1.8380, 2.0475, 2.2397, 2.4665, 2.6550, 2.7701, 2.8895, - 0.1040, 0.2340, 0.3964, 0.5740, 0.7764, 0.9941, 1.2000, 1.4014, - 1.6024, 1.7974, 1.9939, 2.1959, 2.3783, 2.5663, 2.7613, 2.9484, - 0.1912, 0.3393, 0.4743, 0.6313, 0.8014, 0.9879, 1.1855, 1.3922, - 1.5678, 1.7289, 1.9271, 2.1165, 2.3089, 2.5414, 2.7448, 2.9269, - 0.0965, 0.2025, 0.3398, 0.4990, 0.6934, 0.9386, 1.1730, 1.3766, - 1.5783, 1.7783, 1.9790, 2.1831, 2.3670, 2.5578, 2.7641, 2.9516, - 0.2126, 0.3652, 0.5545, 0.7170, 0.8674, 1.0640, 1.2558, 1.4061, - 1.5904, 1.8095, 1.9760, 2.1505, 2.3549, 2.5575, 2.7023, 2.8877, - 0.1827, 0.3426, 0.4894, 0.6488, 0.7960, 0.9535, 1.1217, 1.2798, - 1.4566, 1.6453, 1.8044, 2.0042, 2.2379, 2.4611, 2.6697, 2.8966, - 0.2034, 0.3822, 0.5231, 0.6960, 0.9200, 1.0394, 1.1616, 1.3772, - 1.5493, 1.7330, 1.9646, 2.1233, 2.3334, 2.5361, 2.7087, 2.9470, - 0.1050, 0.2060, 0.3705, 0.5998, 0.8337, 1.0577, 1.2559, 1.4327, - 1.6334, 1.8165, 1.9853, 2.2058, 2.4063, 2.5818, 2.7625, 2.9458, - 0.1419, 0.4053, 0.6660, 0.8911, 1.0405, 1.1547, 1.2506, 1.3926, - 1.5669, 1.7527, 1.9694, 2.2054, 2.3889, 2.5743, 2.7586, 2.9174, - 0.1514, 0.2825, 0.4309, 0.5772, 0.7470, 0.9703, 1.1462, 1.3316, - 1.5321, 1.7259, 1.9282, 2.1266, 2.3106, 2.5064, 2.7067, 2.9094, - 0.1693, 0.3156, 0.4878, 0.6635, 0.8206, 0.9569, 1.1154, 1.3064, - 1.5109, 1.7184, 1.9179, 2.1036, 2.2763, 2.4820, 2.6949, 2.9105, - 0.1432, 0.2718, 0.4241, 0.5564, 0.6939, 0.9011, 1.1582, 1.3948, - 1.6181, 1.8024, 1.9814, 2.1740, 2.3459, 2.5456, 2.7491, 2.9307, - 0.2294, 0.3857, 0.5590, 0.7434, 0.9189, 1.0941, 1.2740, 1.4456, - 1.6178, 1.7994, 1.9689, 2.1644, 2.3525, 2.5385, 2.7468, 2.9405, - 0.1667, 0.3109, 0.4612, 0.6032, 0.7375, 0.8866, 1.0840, 1.3053, - 1.4982, 1.7044, 1.9146, 2.1117, 2.2942, 2.4983, 2.7084, 2.9132, - 0.1810, 0.3205, 0.4696, 0.6231, 0.7641, 0.9959, 1.2427, 1.4361, - 1.5889, 1.7544, 1.9083, 2.0733, 2.2457, 2.4461, 2.6793, 2.9098, - 0.1164, 0.3753, 0.6068, 0.7503, 1.0100, 1.2131, 1.3793, 1.5302, - 1.6300, 1.7950, 1.9057, 2.1031, 2.3830, 2.5745, 2.6949, 2.8779, - 0.1571, 0.4378, 0.6735, 0.8312, 0.8944, 0.9818, 1.1622, 1.4094, - 1.6423, 1.8066, 1.9258, 2.1838, 2.4363, 2.6279, 2.7358, 2.8790, - 0.1398, 0.2686, 0.4248, 0.6156, 0.7870, 1.0035, 1.2012, 1.3689, - 1.5363, 1.7398, 1.9604, 2.1619, 2.3345, 2.5097, 2.7271, 2.9368, - 0.1913, 0.3338, 0.4987, 0.6446, 0.7852, 1.0163, 1.1886, 1.3610, - 1.5379, 1.7230, 1.8880, 2.0862, 2.2960, 2.4928, 2.7122, 2.9151, - 0.0908, 0.1752, 0.2899, 0.5365, 0.7761, 1.0100, 1.2124, 1.4060, - 1.6019, 1.8010, 1.9774, 2.1905, 2.3733, 2.5623, 2.7660, 2.9565, - 0.1773, 0.3179, 0.4925, 0.6864, 0.8452, 0.9897, 1.1860, 1.3722, - 1.5515, 1.7658, 1.9802, 2.1819, 2.3620, 2.5442, 2.7250, 2.9220, - 0.1286, 0.2341, 0.3689, 0.5364, 0.7176, 0.9350, 1.1083, 1.2943, - 1.4974, 1.7059, 1.9047, 2.1145, 2.3242, 2.5361, 2.7453, 2.9329, - 0.2273, 0.3834, 0.5565, 0.7192, 0.8431, 0.9962, 1.1763, 1.3571, - 1.5774, 1.7419, 1.9202, 2.1131, 2.2919, 2.4898, 2.6895, 2.9180, - 0.1775, 0.3058, 0.4274, 0.6023, 0.8151, 1.0734, 1.3211, 1.5178, - 1.6706, 1.8154, 1.9686, 2.1537, 2.3461, 2.5276, 2.7181, 2.9121, - 0.1653, 0.4304, 0.6361, 0.7824, 0.9183, 1.0452, 1.2071, 1.4077, - 1.6206, 1.8299, 2.0089, 2.1948, 2.3900, 2.5982, 2.7844, 2.9487, - 0.1492, 0.2609, 0.3820, 0.5485, 0.7243, 0.9319, 1.1538, 1.3579, - 1.5266, 1.7002, 1.8873, 2.1016, 2.3175, 2.5221, 2.7241, 2.9243, - 0.2074, 0.3781, 0.5209, 0.6869, 0.8577, 0.9875, 1.1849, 1.3568, - 1.4907, 1.7335, 1.8902, 2.1224, 2.3099, 2.4918, 2.7023, 2.8765, - 0.1359, 0.2254, 0.3286, 0.4432, 0.6586, 0.8964, 1.1125, 1.3523, - 1.5626, 1.7579, 1.9846, 2.1905, 2.3548, 2.5542, 2.7663, 2.9346, - 0.1430, 0.2966, 0.4685, 0.6493, 0.8315, 1.0304, 1.2220, 1.4082, - 1.5995, 1.7888, 1.9774, 2.1737, 2.3607, 2.5577, 2.7558, 2.9405, - 0.1477, 0.2694, 0.4056, 0.5626, 0.7051, 0.8647, 1.0491, 1.2488, - 1.4814, 1.7072, 1.9150, 2.1147, 2.3038, 2.5144, 2.7184, 2.9202, - 0.1690, 0.3033, 0.4580, 0.6686, 0.8536, 1.0293, 1.2124, 1.3998, - 1.5718, 1.7607, 1.9580, 2.1245, 2.2971, 2.4762, 2.6896, 2.9177, - 0.1092, 0.2779, 0.4853, 0.6880, 0.9011, 1.0953, 1.2752, 1.4618, - 1.6623, 1.8484, 2.0264, 2.2152, 2.4017, 2.5835, 2.7671, 2.9436, - 0.1497, 0.3637, 0.6014, 0.8032, 0.9963, 1.1835, 1.3741, 1.5698, - 1.7382, 1.9094, 2.0710, 2.2392, 2.4082, 2.5926, 2.7762, 2.9536, - 0.1434, 0.2492, 0.3966, 0.5934, 0.8033, 1.0657, 1.2796, 1.4276, - 1.5745, 1.7833, 1.9288, 2.1247, 2.3543, 2.5412, 2.7049, 2.8872, - 0.1612, 0.2926, 0.4574, 0.6387, 0.8265, 1.0180, 1.1808, 1.3526, - 1.5564, 1.7536, 1.9187, 2.1192, 2.3149, 2.5006, 2.7101, 2.9217, - 0.0828, 0.1863, 0.3235, 0.5050, 0.7250, 0.9867, 1.2093, 1.3941, - 1.5980, 1.7932, 1.9809, 2.1894, 2.3918, 2.5773, 2.7540, 2.9329, - 0.2001, 0.3655, 0.5290, 0.6761, 0.8027, 0.9972, 1.2090, 1.4255, - 1.6085, 1.7825, 1.9804, 2.1681, 2.3457, 2.5325, 2.7319, 2.9196, - 0.1505, 0.2767, 0.4254, 0.6054, 0.7821, 0.9567, 1.1294, 1.3080, - 1.4984, 1.6954, 1.8666, 2.0736, 2.2875, 2.4969, 2.7072, 2.9163, - 0.1589, 0.4151, 0.5749, 0.6651, 0.8061, 1.0470, 1.2616, 1.3690, - 1.4985, 1.7808, 1.9825, 2.1068, 2.2751, 2.5448, 2.7133, 2.8689, - 0.0916, 0.1846, 0.3788, 0.6329, 0.8774, 1.0687, 1.2653, 1.4561, - 1.6573, 1.8449, 2.0402, 2.2254, 2.3968, 2.5861, 2.7792, 2.9508, - 0.2282, 0.4159, 0.5834, 0.6899, 0.8108, 1.0321, 1.2795, 1.5262, - 1.6936, 1.8469, 2.0922, 2.2607, 2.3795, 2.5301, 2.7386, 2.9530, - 0.1651, 0.3004, 0.4555, 0.6179, 0.7891, 0.9584, 1.1372, 1.3707, - 1.5951, 1.7880, 1.9434, 2.1465, 2.3311, 2.5081, 2.6977, 2.8970, - 0.1279, 0.3828, 0.6330, 0.8323, 0.9652, 1.1175, 1.2319, 1.3511, - 1.5115, 1.6392, 1.7835, 1.9558, 2.2008, 2.4635, 2.6910, 2.9058, - 0.1193, 0.2185, 0.3521, 0.5311, 0.7378, 0.9239, 1.1105, 1.3217, - 1.5362, 1.7504, 1.9536, 2.1627, 2.3560, 2.5506, 2.7548, 2.9453, - 0.1806, 0.3432, 0.4981, 0.6948, 0.8928, 1.0527, 1.2467, 1.4140, - 1.6326, 1.7950, 1.9935, 2.1969, 2.3512, 2.5682, 2.7445, 2.9277, - 0.1846, 0.3112, 0.4568, 0.5891, 0.7317, 0.8493, 1.0204, 1.2022, - 1.3688, 1.6020, 1.8428, 2.0710, 2.2725, 2.4879, 2.7057, 2.9160, - 0.0880, 0.2514, 0.5332, 0.7272, 0.8906, 1.1354, 1.3199, 1.4941, - 1.6010, 1.7151, 1.8712, 2.0643, 2.2755, 2.5375, 2.7054, 2.8891, - 0.1382, 0.2833, 0.4658, 0.6897, 0.9071, 1.0716, 1.2469, 1.4143, - 1.5910, 1.7947, 1.9805, 2.1581, 2.3338, 2.5215, 2.7292, 2.9211, - 0.1061, 0.3494, 0.6327, 0.8570, 0.9748, 1.0560, 1.1529, 1.3250, - 1.6032, 1.8340, 1.9711, 2.1157, 2.3011, 2.5464, 2.8078, 2.9803, - 0.1603, 0.2839, 0.4307, 0.5980, 0.7980, 1.0399, 1.1971, 1.3524, - 1.5715, 1.7838, 1.9468, 2.1498, 2.3627, 2.5514, 2.7327, 2.9148, - 0.1691, 0.3117, 0.4796, 0.6895, 0.8732, 1.0164, 1.1916, 1.3707, - 1.5384, 1.7202, 1.8857, 2.0672, 2.2487, 2.4593, 2.6789, 2.8940, - 0.0965, 0.1702, 0.3191, 0.5721, 0.8100, 1.0241, 1.2272, 1.4196, - 1.6093, 1.8057, 1.9884, 2.2037, 2.3925, 2.5805, 2.7578, 2.9366, - 0.1950, 0.3519, 0.5272, 0.6973, 0.8732, 1.0656, 1.2112, 1.3959, - 1.6116, 1.7821, 1.9445, 2.1592, 2.3348, 2.5142, 2.7440, 2.9297, - 0.1388, 0.2557, 0.4120, 0.5727, 0.7354, 0.9196, 1.0985, 1.2805, - 1.4643, 1.6535, 1.8340, 2.0546, 2.2758, 2.4778, 2.6921, 2.9122, - 0.1823, 0.3336, 0.4957, 0.6771, 0.8563, 1.0137, 1.2299, 1.3849, - 1.5718, 1.7667, 1.9193, 2.1326, 2.3135, 2.5268, 2.7133, 2.8998, - 0.0790, 0.1901, 0.4083, 0.6456, 0.8463, 1.0285, 1.2297, 1.4181, - 1.6159, 1.8056, 1.9971, 2.1912, 2.3816, 2.5746, 2.7692, 2.9497, - 0.0049, 0.0116, 0.0045, 0.0039, -0.0010, -0.0122, -0.0205, -0.0034, - -0.0140, -0.0041, 0.0191, -0.0322, 0.0002, -0.0124, -0.0269, 0.0059, - 0.0586, 0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211, - 0.0241, 0.0595, 0.0469, 0.0283, 0.0176, -0.0183, -0.0173, -0.0004, - 0.0024, 0.0145, 0.0534, 0.0197, -0.0065, -0.0067, 0.0133, 0.0358, - -0.0104, -0.0386, -0.0109, -0.0078, 0.0275, 0.0565, 0.0251, -0.0027, - -0.0053, 0.0171, 0.0088, 0.0495, 0.0141, 0.0039, -0.0445, -0.0426, - -0.0184, -0.0280, -0.0223, 0.0039, -0.0171, -0.0606, -0.0786, -0.0430, - 0.0544, 0.0595, 0.0320, -0.0012, 0.0108, 0.0185, 0.0066, 0.0408, - 0.0552, -0.0073, -0.0247, -0.0480, -0.0288, 0.0186, 0.0212, -0.0013, - 0.0403, 0.0598, 0.0690, 0.0516, -0.0298, -0.0177, 0.0278, 0.0168, - -0.0106, 0.0251, 0.0386, 0.0331, -0.0052, 0.0133, 0.0291, -0.0158, - -0.0329, -0.0367, 0.0287, 0.0462, -0.0176, 0.0049, 0.0242, -0.0034, - 0.0135, 0.0086, -0.0149, 0.0241, 0.0504, 0.0246, -0.0273, -0.0369, - -0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088, - 0.0098, 0.0009, -0.0004, 0.0007, -0.0314, -0.0208, -0.0138, -0.0277, - -0.0044, 0.0522, 0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201, - -0.0287, -0.0279, -0.0182, 0.0472, 0.0613, 0.0450, 0.0413, 0.0333, - 0.0444, 0.0223, 0.0061, 0.0316, 0.0321, 0.0501, 0.0460, 0.0250, - 0.0227, 0.0235, 0.0099, 0.0185, -0.0347, -0.0684, -0.0189, 0.0242, - -0.0190, -0.0273, -0.0012, -0.0253, 0.0293, -0.0231, -0.0219, -0.0010, - 0.0153, 0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390, - 0.0077, -0.0278, -0.0355, 0.0092, -0.0063, 0.0005, 0.0216, 0.0461, - 0.0538, 0.0451, 0.0298, -0.0130, 0.0058, 0.0206, 0.0471, 0.0499, - 0.0280, 0.0086, -0.0007, -0.0317, 0.0259, 0.0176, 0.0043, 0.0212, - 0.0138, 0.0106, 0.0220, -0.0025, 0.0050, 0.0122, -0.0051, -0.0086, - -0.0472, -0.0005, 0.0193, 0.0032, 0.0246, 0.0222, 0.0090, -0.0320, - -0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092, 0.0115, - -0.0129, 0.0053, -0.0344, -0.0385, 0.0392, 0.0599, 0.0414, 0.0165, - -0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110, 0.0084, 0.0172, - -0.0492, -0.0537, -0.0320, -0.0036, 0.0265, 0.0385, 0.0064, -0.0280, - -0.0230, 0.0134, 0.0241, 0.0106, 0.0387, 0.0105, 0.0068, 0.0260, - 0.4940, 0.4911, 0.4849, 0.4820, 0.4837, 0.4839, 0.4824, 0.4799, - 0.4812, 0.4782, 0.4788, 0.4711, 0.4706, 0.4671, 0.4601, 0.4578, - 0.2954, 0.2121, 0.1859, 0.1958, 0.1474, 0.1086, 0.1351, 0.1362, - 0.1486, 0.1342, 0.1215, 0.1423, 0.1634, 0.1588, 0.1539, 0.1857, -}; - -const float ff_metasound_lsp16[] = { - 0.1813, 0.3911, 0.6301, 0.8012, 1.0057, 1.2041, 1.4271, 1.6943, - 1.9402, 2.1733, 2.3521, 2.4989, 2.5839, 2.6846, 2.7634, 2.8950, - 0.1311, 0.3183, 0.4659, 0.5601, 0.6658, 0.7828, 1.0065, 1.2717, - 1.5185, 1.7339, 1.9530, 2.2189, 2.3739, 2.4991, 2.6984, 2.9256, - 0.1627, 0.4519, 0.6323, 0.7012, 0.7848, 0.9801, 1.1810, 1.3222, - 1.5413, 1.8129, 1.9338, 2.0809, 2.3180, 2.5189, 2.7066, 2.9514, - 0.1475, 0.2447, 0.4240, 0.5669, 0.7872, 0.9838, 1.1823, 1.3814, - 1.5358, 1.6820, 1.8794, 2.1419, 2.4132, 2.6112, 2.7911, 2.9511, - 0.1224, 0.2876, 0.5013, 0.6985, 0.8902, 1.0901, 1.2835, 1.4768, - 1.6596, 1.8538, 2.0467, 2.2304, 2.4124, 2.5942, 2.7729, 2.9531, - 0.1741, 0.3034, 0.4677, 0.5879, 0.7258, 0.9648, 1.1417, 1.3220, - 1.5081, 1.7151, 1.9212, 2.1286, 2.3208, 2.4938, 2.6765, 2.8891, - 0.1657, 0.3174, 0.4907, 0.6559, 0.8295, 1.0254, 1.2071, 1.3880, - 1.5737, 1.7845, 1.9027, 2.1139, 2.3323, 2.5157, 2.7323, 2.9015, - 0.1592, 0.2758, 0.4417, 0.6315, 0.8257, 0.9873, 1.1277, 1.2830, - 1.4337, 1.6315, 1.8899, 2.1356, 2.3572, 2.5632, 2.7468, 2.9420, - 0.1524, 0.4325, 0.5931, 0.7036, 0.7696, 0.8923, 1.1739, 1.4773, - 1.6609, 1.7911, 1.9666, 2.1972, 2.3754, 2.5045, 2.6613, 2.8882, - 0.2130, 0.3013, 0.3721, 0.4257, 0.5079, 0.7015, 0.9815, 1.2554, - 1.4648, 1.6966, 1.9138, 2.1075, 2.3318, 2.5292, 2.7453, 2.9347, - 0.1142, 0.3748, 0.6205, 0.7642, 0.8121, 0.9022, 0.9843, 1.1558, - 1.4467, 1.7422, 1.9574, 2.1302, 2.3812, 2.5898, 2.7720, 2.9583, - 0.1255, 0.2339, 0.3570, 0.5323, 0.7458, 1.0003, 1.1729, 1.3567, - 1.5217, 1.6977, 1.8924, 2.0942, 2.3145, 2.5408, 2.7553, 2.9337, - 0.1316, 0.2289, 0.4327, 0.6663, 0.8509, 0.9994, 1.1697, 1.3804, - 1.5609, 1.6903, 1.8572, 2.1019, 2.3687, 2.5789, 2.7715, 2.9472, - 0.1502, 0.2546, 0.3883, 0.5333, 0.6976, 0.9163, 1.1071, 1.3364, - 1.5420, 1.7525, 1.8948, 2.0839, 2.2819, 2.4651, 2.6875, 2.8987, - 0.1593, 0.3014, 0.4573, 0.6354, 0.8157, 0.9805, 1.1783, 1.3747, - 1.5678, 1.7326, 1.9286, 2.1340, 2.3253, 2.5280, 2.7180, 2.9298, - 0.1811, 0.3167, 0.4655, 0.6507, 0.8198, 1.0075, 1.1892, 1.3743, - 1.5227, 1.7090, 1.8849, 2.0743, 2.2750, 2.4830, 2.6896, 2.8953, - 0.1846, 0.3577, 0.5315, 0.7290, 0.9176, 1.1016, 1.2654, 1.4525, - 1.6315, 1.8268, 2.0238, 2.1934, 2.3868, 2.5753, 2.7682, 2.9469, - 0.0876, 0.1439, 0.2048, 0.3654, 0.6281, 0.8853, 1.0907, 1.2992, - 1.5227, 1.7373, 1.9395, 2.1419, 2.3488, 2.5486, 2.7466, 2.9348, - 0.1391, 0.4170, 0.6561, 0.7953, 0.8734, 0.9986, 1.1870, 1.4520, - 1.6042, 1.7910, 2.0135, 2.1870, 2.3358, 2.5066, 2.7409, 2.9955, - 0.0804, 0.1355, 0.2599, 0.4998, 0.7408, 0.9474, 1.1276, 1.3428, - 1.5556, 1.7712, 1.9699, 2.1535, 2.3605, 2.5548, 2.7489, 2.9325, - 0.1304, 0.3087, 0.4979, 0.6584, 0.8414, 1.0329, 1.2244, 1.4189, - 1.6118, 1.8200, 1.9985, 2.1893, 2.3915, 2.5794, 2.7647, 2.9344, - 0.1895, 0.2849, 0.3705, 0.4126, 0.6265, 0.9207, 1.1774, 1.3762, - 1.5757, 1.7728, 1.9568, 2.1662, 2.3615, 2.5575, 2.7561, 2.9416, - 0.1800, 0.3078, 0.4805, 0.6796, 0.8503, 1.0046, 1.1703, 1.3269, - 1.4862, 1.6502, 1.8454, 2.0873, 2.3175, 2.5356, 2.7516, 2.9469, - 0.1950, 0.3233, 0.4568, 0.5940, 0.7589, 0.9978, 1.1701, 1.3383, - 1.5017, 1.6565, 1.8243, 2.0605, 2.2938, 2.5147, 2.7419, 2.9396, - 0.2531, 0.4391, 0.5790, 0.7170, 0.8998, 1.1430, 1.3577, 1.5326, - 1.6328, 1.7627, 1.9726, 2.1762, 2.3563, 2.5478, 2.7385, 2.9067, - 0.1805, 0.2788, 0.3591, 0.3881, 0.5441, 0.8055, 1.0766, 1.3165, - 1.5316, 1.7508, 1.9477, 2.1374, 2.3438, 2.5484, 2.7501, 2.9410, - 0.2044, 0.3671, 0.5396, 0.7042, 0.8582, 0.9831, 1.1261, 1.3194, - 1.4769, 1.6979, 1.8717, 2.0463, 2.2620, 2.4739, 2.7054, 2.9208, - 0.1048, 0.2175, 0.4206, 0.5923, 0.7483, 0.9400, 1.1356, 1.3799, - 1.5958, 1.7320, 1.8984, 2.1296, 2.3594, 2.5492, 2.7387, 2.9305, - 0.0842, 0.1729, 0.3951, 0.6447, 0.8688, 1.0605, 1.2472, 1.4330, - 1.6232, 1.8144, 2.0216, 2.1915, 2.3878, 2.5763, 2.7685, 2.9464, - 0.1461, 0.2593, 0.4105, 0.5677, 0.7328, 0.8919, 1.0484, 1.2302, - 1.4386, 1.6635, 1.8873, 2.1024, 2.3116, 2.5268, 2.7273, 2.9269, - 0.1503, 0.3108, 0.4756, 0.6731, 0.8600, 1.0233, 1.2115, 1.3971, - 1.5915, 1.7892, 1.9517, 2.1603, 2.3487, 2.5460, 2.7308, 2.8998, - 0.2163, 0.3669, 0.5125, 0.6709, 0.8143, 0.9930, 1.2095, 1.4205, - 1.6176, 1.7112, 1.8398, 2.0896, 2.3513, 2.5290, 2.6667, 2.8960, - 0.2133, 0.4382, 0.6287, 0.8702, 1.1088, 1.3749, 1.6062, 1.7446, - 1.8333, 1.9122, 1.9614, 2.0669, 2.1789, 2.3449, 2.6038, 2.8849, - 0.1598, 0.2719, 0.3877, 0.4815, 0.5926, 0.7795, 1.0449, 1.3045, - 1.5210, 1.7391, 1.9462, 2.1397, 2.3553, 2.5458, 2.7540, 2.9392, - 0.2918, 0.5607, 0.6801, 0.7404, 0.8285, 0.9431, 1.1579, 1.4080, - 1.6332, 1.8472, 1.9738, 2.0771, 2.2890, 2.5178, 2.7445, 2.9830, - 0.1664, 0.2842, 0.3965, 0.5463, 0.8162, 1.0346, 1.1849, 1.3446, - 1.5122, 1.7563, 1.9960, 2.2002, 2.3796, 2.5689, 2.7712, 2.9550, - 0.0911, 0.2397, 0.5052, 0.7868, 1.0299, 1.1311, 1.2244, 1.3333, - 1.4395, 1.6790, 1.9369, 2.1717, 2.3689, 2.5538, 2.7340, 2.9326, - 0.1647, 0.2931, 0.3836, 0.4978, 0.6255, 0.9243, 1.1339, 1.3001, - 1.5269, 1.8010, 1.9715, 2.1419, 2.3784, 2.5503, 2.6719, 2.8745, - 0.2440, 0.3802, 0.4756, 0.6613, 0.8627, 1.0292, 1.2291, 1.4060, - 1.5198, 1.7354, 1.9044, 2.1010, 2.3147, 2.4996, 2.7171, 2.9041, - 0.1590, 0.2876, 0.4572, 0.5996, 0.7713, 0.9490, 1.1205, 1.2815, - 1.4516, 1.6385, 1.8179, 2.0457, 2.2759, 2.4785, 2.6861, 2.9080, - 0.2297, 0.4309, 0.5712, 0.6717, 0.8138, 1.0463, 1.2492, 1.4560, - 1.6796, 1.8458, 1.9642, 2.1452, 2.3636, 2.5395, 2.7456, 2.9495, - 0.2975, 0.4678, 0.4996, 0.5809, 0.6279, 0.6884, 0.8606, 1.1386, - 1.4412, 1.6876, 1.8760, 2.0932, 2.3178, 2.5166, 2.7345, 2.9280, - 0.1278, 0.3737, 0.6004, 0.7069, 0.8147, 1.0180, 1.2581, 1.3812, - 1.4855, 1.7268, 1.9970, 2.1258, 2.2936, 2.5702, 2.7563, 2.8983, - 0.1314, 0.2508, 0.3999, 0.5680, 0.7424, 0.9367, 1.1286, 1.3175, - 1.5336, 1.7404, 1.9317, 2.1404, 2.3514, 2.5562, 2.7510, 2.9402, - 0.1043, 0.2367, 0.4293, 0.6376, 0.8160, 0.9836, 1.1779, 1.3850, - 1.5835, 1.7875, 1.9765, 2.1593, 2.3654, 2.5577, 2.7465, 2.9398, - 0.1529, 0.2515, 0.3454, 0.4374, 0.7011, 0.9015, 1.0744, 1.3532, - 1.5699, 1.7545, 2.0021, 2.1259, 2.2278, 2.4546, 2.7264, 2.9425, - 0.1429, 0.2808, 0.4395, 0.6334, 0.8069, 0.9705, 1.1520, 1.3250, - 1.5109, 1.7285, 1.9356, 2.1469, 2.3479, 2.5554, 2.7512, 2.9348, - 0.1625, 0.3022, 0.4756, 0.6315, 0.8032, 0.9924, 1.1596, 1.3204, - 1.4994, 1.6929, 1.8955, 2.1090, 2.3025, 2.5018, 2.6908, 2.8980, - 0.1692, 0.3427, 0.5228, 0.7756, 0.9688, 1.0950, 1.3056, 1.4360, - 1.5675, 1.8049, 1.9376, 2.1151, 2.3407, 2.5012, 2.7192, 2.9258, - 0.0474, 0.1251, 0.1939, 0.3841, 0.6501, 0.9231, 1.1153, 1.3240, - 1.5478, 1.7599, 1.9651, 2.1510, 2.3645, 2.5552, 2.7542, 2.9393, - 0.2196, 0.4656, 0.7492, 0.9922, 1.1678, 1.2489, 1.3112, 1.3657, - 1.4223, 1.5302, 1.7212, 1.9996, 2.2523, 2.4844, 2.7036, 2.9145, - 0.1128, 0.2368, 0.3704, 0.5476, 0.7723, 0.9968, 1.1930, 1.3992, - 1.6013, 1.7957, 1.9888, 2.1857, 2.3825, 2.5705, 2.7616, 2.9434, - 0.1341, 0.2768, 0.4510, 0.6359, 0.8332, 1.0335, 1.2004, 1.3952, - 1.5762, 1.7681, 1.9815, 2.1735, 2.3657, 2.5552, 2.7514, 2.9498, - 0.1247, 0.2559, 0.3516, 0.4726, 0.6861, 0.9483, 1.1852, 1.3858, - 1.5851, 1.7815, 1.9778, 2.1737, 2.3729, 2.5664, 2.7620, 2.9429, - 0.1988, 0.3320, 0.4777, 0.6737, 0.8425, 1.0265, 1.1694, 1.3655, - 1.5463, 1.7135, 1.9385, 2.1650, 2.3529, 2.5367, 2.7545, 2.9585, - 0.1376, 0.2620, 0.4273, 0.6169, 0.7755, 0.9441, 1.1169, 1.3157, - 1.5179, 1.7020, 1.8931, 2.1059, 2.3112, 2.5136, 2.7169, 2.9198, - 0.2112, 0.4385, 0.6091, 0.7618, 0.9553, 1.1543, 1.3445, 1.5396, - 1.7153, 1.9192, 2.1263, 2.3593, 2.5958, 2.8171, 2.9394, 3.0409, - 0.1347, 0.2099, 0.2646, 0.3453, 0.5266, 0.7869, 1.0513, 1.2795, - 1.4880, 1.7181, 1.9294, 2.1332, 2.3362, 2.5442, 2.7433, 2.9362, - 0.3141, 0.5935, 0.7517, 0.8313, 0.8568, 0.9570, 1.0250, 1.1275, - 1.3422, 1.6303, 1.8577, 2.0705, 2.2957, 2.5095, 2.7244, 2.9262, - 0.0962, 0.2116, 0.3961, 0.5641, 0.7122, 0.8883, 1.1023, 1.3481, - 1.5623, 1.7554, 1.9618, 2.1675, 2.3706, 2.5556, 2.7430, 2.9337, - 0.0898, 0.1510, 0.3060, 0.5820, 0.8221, 1.0388, 1.2261, 1.4289, - 1.6054, 1.8103, 1.9941, 2.1844, 2.3742, 2.5711, 2.7632, 2.9474, - 0.1326, 0.2316, 0.3761, 0.5177, 0.6782, 0.8761, 1.0952, 1.3175, - 1.5078, 1.7034, 1.9051, 2.1245, 2.3424, 2.5484, 2.7444, 2.9389, - 0.1740, 0.3293, 0.5174, 0.6824, 0.8394, 1.0372, 1.2046, 1.3723, - 1.5656, 1.7444, 1.9442, 2.1386, 2.3139, 2.4960, 2.7071, 2.9297, - 0.2304, 0.3775, 0.4865, 0.6182, 0.7842, 0.9208, 1.1151, 1.2843, - 1.4641, 1.6988, 1.9209, 2.1260, 2.3099, 2.5229, 2.7414, 2.9276, - 0.0094, 0.0261, -0.0037, 0.0041, -0.0092, -0.0044, -0.0232, -0.0073, - -0.0047, -0.0021, 0.0250, -0.0580, -0.0140, -0.0342, -0.0586, 0.0020, - 0.0449, 0.0155, -0.0523, -0.0279, 0.0299, -0.0183, -0.0736, -0.0639, - -0.0017, 0.0336, 0.0209, 0.0046, 0.0077, -0.0148, -0.0114, -0.0120, - 0.0115, -0.0050, 0.0445, 0.0048, 0.0188, -0.0137, -0.0080, 0.0239, - -0.0184, -0.0524, -0.0195, -0.0126, 0.0284, 0.0632, 0.0141, -0.0093, - -0.0096, 0.0196, 0.0230, 0.0379, 0.0308, 0.0237, -0.0224, -0.0600, - -0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672, - 0.0504, 0.0676, 0.0336, -0.0042, 0.0729, 0.1013, 0.0868, 0.0846, - 0.0954, 0.0515, -0.0066, -0.0851, -0.0485, 0.0294, 0.0395, 0.0087, - 0.0078, 0.0446, 0.0881, 0.0672, -0.0384, -0.0025, 0.0415, 0.0353, - 0.0080, 0.0052, 0.0190, 0.0182, 0.0069, 0.0168, 0.0374, 0.0037, - -0.0292, -0.0429, 0.0302, 0.0681, -0.0233, -0.0238, -0.0003, -0.0043, - 0.0054, -0.0029, -0.0149, 0.0642, 0.0622, 0.0341, -0.0232, -0.0461, - -0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398, - -0.0318, -0.0116, 0.0011, 0.0009, -0.0384, -0.0384, -0.0156, -0.0260, - -0.0007, 0.0473, 0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090, - -0.0285, -0.0495, -0.0376, 0.0917, 0.1192, 0.1026, 0.0745, 0.0397, - 0.0463, 0.0253, 0.0025, 0.0465, 0.0100, 0.0488, 0.0416, 0.0223, - 0.0263, 0.0072, -0.0053, 0.0595, 0.0060, -0.0518, -0.0316, -0.0043, - -0.0133, -0.0233, -0.0075, -0.0251, 0.0277, -0.0067, -0.0136, -0.0004, - 0.0235, 0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384, - 0.0005, -0.0150, -0.0356, 0.0127, -0.0033, -0.0034, 0.0205, 0.0747, - 0.1138, 0.1015, 0.0995, -0.0161, -0.0045, 0.0129, 0.0472, 0.0575, - 0.0222, 0.0091, 0.0037, -0.0471, 0.0371, 0.0132, 0.0208, 0.0247, - 0.0117, 0.0164, 0.0225, 0.0124, -0.0023, 0.0088, -0.0046, 0.0047, - -0.0393, 0.0018, 0.0148, 0.0020, 0.0044, 0.0165, 0.0229, -0.0208, - -0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094, 0.0075, - -0.0102, -0.0045, -0.0504, -0.0709, 0.0822, 0.0710, 0.0426, 0.0014, - -0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015, 0.0134, - -0.0418, -0.0682, -0.0256, 0.0050, 0.0360, 0.0354, 0.0074, -0.0396, - -0.0235, 0.0284, 0.0494, 0.0153, 0.0448, 0.0025, -0.0061, 0.0252, - 0.1000, 0.2260, 0.2158, 0.2116, 0.2198, 0.2055, 0.2110, 0.1873, - 0.1907, 0.2071, 0.2164, 0.2009, 0.2059, 0.2124, 0.2141, 0.2093, - 0.0875, 0.0981, 0.1177, 0.1071, 0.1033, 0.1248, 0.1048, 0.1238, - 0.1166, 0.1008, 0.1062, 0.0992, 0.0994, 0.1067, 0.0999, 0.1187, - 0.0750, 0.0794, 0.0828, 0.0854, 0.0859, 0.0801, 0.0891, 0.0933, - 0.0969, 0.0920, 0.0915, 0.0862, 0.0868, 0.0891, 0.0842, 0.0824, - 0.0625, 0.0930, 0.0815, 0.0853, 0.0898, 0.0828, 0.0822, 0.0910, - 0.0873, 0.0906, 0.0856, 0.0840, 0.0774, 0.0785, 0.0684, 0.0711, - 0.3319, 0.4219, 0.4588, 0.4090, 0.4092, 0.4014, 0.3548, 0.3353, - 0.3708, 0.3352, 0.3720, 0.3538, 0.4084, 0.4289, 0.4060, 0.4210, - 0.0588, 0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346, - -0.0346, -0.0366, -0.0220, -0.0265, -0.0102, 0.0374, 0.0306, 0.0404, - 0.0306, 0.0090, -0.0054, 0.0333, 0.0047, 0.0238, 0.0141, 0.0165, - 0.0306, 0.0420, 0.0159, 0.0124, 0.0414, 0.0158, -0.0237, 0.0141, - 0.0765, 0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417, - -0.0429, -0.0615, -0.0893, -0.0618, -0.0384, -0.0134, -0.0232, -0.0238, -}; - -const float ff_metasound_lsp22[] = { - 0.0664, 0.1875, 0.4300, 0.6730, 0.8793, 1.0640, 1.2563, 1.4433, - 1.6394, 1.8176, 2.0029, 2.1921, 2.3796, 2.5671, 2.7595, 2.9536, - 0.2128, 0.4052, 0.5311, 0.6404, 0.7875, 0.8775, 1.0974, 1.3261, - 1.5563, 1.6790, 1.8339, 2.1195, 2.3226, 2.4609, 2.6440, 2.8947, - 0.2024, 0.3362, 0.4834, 0.6784, 0.9088, 1.0850, 1.2188, 1.4054, - 1.6102, 1.7767, 1.9679, 2.1436, 2.3445, 2.5467, 2.7429, 2.9320, - 0.1181, 0.2279, 0.4413, 0.6114, 0.7710, 0.9427, 1.1142, 1.2707, - 1.4892, 1.7416, 1.9526, 2.1466, 2.3629, 2.5445, 2.7293, 2.9205, - 0.1155, 0.2720, 0.4886, 0.6812, 0.8594, 1.0422, 1.2315, 1.4116, - 1.6137, 1.8020, 1.9758, 2.1743, 2.3602, 2.5568, 2.7472, 2.9374, - 0.1110, 0.3312, 0.4735, 0.5612, 0.7129, 0.8146, 1.0233, 1.3155, - 1.5765, 1.7746, 1.9574, 2.1416, 2.3220, 2.5384, 2.7334, 2.9318, - 0.1656, 0.3350, 0.4215, 0.5609, 0.6759, 0.8503, 1.1405, 1.4094, - 1.6057, 1.6860, 1.7639, 2.0031, 2.2680, 2.5076, 2.7263, 2.9368, - 0.1466, 0.3638, 0.4587, 0.5674, 0.7381, 0.8669, 0.9619, 1.1658, - 1.4667, 1.7440, 1.9335, 2.1018, 2.3022, 2.5281, 2.7359, 2.9261, - 0.1061, 0.2566, 0.4739, 0.6751, 0.8711, 1.0704, 1.2720, 1.4655, - 1.6605, 1.8494, 2.0290, 2.2197, 2.4008, 2.5912, 2.7772, 2.9513, - 0.1116, 0.2364, 0.3971, 0.6316, 0.8583, 1.0335, 1.1686, 1.3302, - 1.5612, 1.7877, 1.9829, 2.2052, 2.3596, 2.5460, 2.7341, 2.9290, - 0.2661, 0.4186, 0.5126, 0.6477, 0.8818, 1.1045, 1.2852, 1.4128, - 1.5851, 1.7593, 1.9399, 2.1757, 2.3684, 2.5136, 2.6927, 2.9064, - 0.1495, 0.2749, 0.4391, 0.6304, 0.8239, 1.0181, 1.1995, 1.3759, - 1.5669, 1.7722, 1.9671, 2.1635, 2.3586, 2.5528, 2.7445, 2.9311, - 0.0912, 0.1759, 0.3066, 0.5660, 0.8005, 0.9568, 1.1832, 1.4504, - 1.6259, 1.7948, 2.0113, 2.2002, 2.3654, 2.5583, 2.7929, 2.9735, - 0.1353, 0.2747, 0.4078, 0.5977, 0.7658, 0.9124, 1.1081, 1.3630, - 1.5875, 1.7847, 1.9323, 2.1181, 2.3321, 2.5046, 2.7183, 2.9225, - 0.1938, 0.4063, 0.4982, 0.6002, 0.7702, 0.9071, 1.1631, 1.3885, - 1.6043, 1.8118, 1.9306, 2.0893, 2.2724, 2.4609, 2.6283, 2.8802, - 0.1857, 0.3351, 0.4381, 0.6101, 0.7561, 0.8555, 1.0384, 1.3171, - 1.5667, 1.6904, 1.7552, 1.9689, 2.2597, 2.5260, 2.7272, 2.9337, - 0.1037, 0.2159, 0.4188, 0.6174, 0.8035, 1.0285, 1.2256, 1.4230, - 1.6400, 1.8322, 2.0144, 2.1988, 2.3810, 2.5682, 2.7613, 2.9438, - 0.1625, 0.2776, 0.4225, 0.6001, 0.7879, 0.9087, 1.0801, 1.2759, - 1.4899, 1.7448, 1.9911, 2.1770, 2.3723, 2.5777, 2.7971, 2.9444, - 0.2111, 0.3640, 0.5839, 0.7290, 0.8051, 1.0023, 1.2315, 1.4143, - 1.5878, 1.7755, 1.9804, 2.1498, 2.3312, 2.5350, 2.7613, 2.9472, - 0.1423, 0.2646, 0.4136, 0.6350, 0.8070, 0.9514, 1.1168, 1.3213, - 1.5776, 1.7721, 1.9404, 2.1545, 2.3385, 2.5137, 2.7396, 2.9553, - 0.1132, 0.2386, 0.4103, 0.5931, 0.7808, 0.9881, 1.1840, 1.3860, - 1.6021, 1.7990, 1.9922, 2.1885, 2.3852, 2.5717, 2.7640, 2.9510, - 0.1267, 0.2602, 0.3913, 0.5944, 0.7598, 0.9198, 1.0781, 1.2715, - 1.5299, 1.7573, 1.9308, 2.1346, 2.3267, 2.5419, 2.7466, 2.9320, - 0.2023, 0.3417, 0.4392, 0.6141, 0.7439, 0.8593, 1.1096, 1.3543, - 1.5185, 1.6553, 1.7862, 2.0341, 2.2718, 2.4834, 2.7103, 2.9466, - 0.1113, 0.2470, 0.3677, 0.5686, 0.7700, 0.9356, 1.0806, 1.2452, - 1.4830, 1.7344, 1.9268, 2.1404, 2.3371, 2.5169, 2.7329, 2.9012, - 0.1664, 0.3554, 0.5573, 0.7471, 0.9245, 1.0998, 1.2787, 1.4655, - 1.6654, 1.8346, 2.0179, 2.2159, 2.4096, 2.5946, 2.7790, 2.9530, - 0.1313, 0.2625, 0.4731, 0.6444, 0.8110, 0.9878, 1.1493, 1.3212, - 1.5719, 1.8138, 1.9861, 2.1943, 2.3714, 2.5578, 2.7346, 2.9296, - 0.1186, 0.3035, 0.5049, 0.6860, 0.8670, 0.9975, 1.1364, 1.3471, - 1.5695, 1.7412, 1.9346, 2.1506, 2.3413, 2.5531, 2.7794, 2.9627, - 0.1108, 0.2697, 0.4787, 0.6344, 0.7909, 0.9586, 1.1440, 1.3511, - 1.5686, 1.7601, 1.9246, 2.1241, 2.3293, 2.5390, 2.7315, 2.9333, - 0.0985, 0.2302, 0.3544, 0.5759, 0.7620, 0.9651, 1.1497, 1.3080, - 1.5500, 1.7845, 1.9518, 2.1734, 2.3565, 2.5665, 2.7605, 2.9102, - 0.1208, 0.2727, 0.4381, 0.5736, 0.7382, 0.8390, 1.0102, 1.2648, - 1.5100, 1.7440, 1.9619, 2.1430, 2.3307, 2.5159, 2.7264, 2.9211, - 0.1582, 0.2777, 0.4475, 0.6551, 0.8591, 1.0084, 1.1414, 1.3291, - 1.5902, 1.7826, 1.9543, 2.1659, 2.3233, 2.5044, 2.6935, 2.9199, - 0.1360, 0.2873, 0.4585, 0.6295, 0.7592, 0.9089, 1.0492, 1.2733, - 1.5391, 1.7768, 1.9372, 2.1329, 2.3168, 2.5015, 2.6857, 2.8837, - 0.0886, 0.1829, 0.3696, 0.6126, 0.8334, 1.0135, 1.2303, 1.4674, - 1.6743, 1.8564, 2.0530, 2.2370, 2.3960, 2.5787, 2.7756, 2.9377, - 0.2005, 0.3537, 0.4700, 0.6249, 0.7385, 0.9097, 1.1759, 1.3811, - 1.5314, 1.6705, 1.8546, 2.1229, 2.3292, 2.5251, 2.7951, 2.9646, - 0.1999, 0.3112, 0.4722, 0.7146, 0.8908, 1.0028, 1.1831, 1.3903, - 1.6125, 1.7514, 1.9083, 2.1248, 2.3271, 2.5339, 2.6945, 2.8918, - 0.1243, 0.2606, 0.4382, 0.5850, 0.7705, 0.9727, 1.1214, 1.3059, - 1.5218, 1.7406, 1.9137, 2.1353, 2.3354, 2.5299, 2.7287, 2.9068, - 0.1039, 0.2426, 0.4265, 0.6284, 0.8152, 0.9941, 1.2004, 1.4038, - 1.5912, 1.7763, 1.9650, 2.1598, 2.3474, 2.5488, 2.7419, 2.9322, - 0.1364, 0.2420, 0.3886, 0.5864, 0.7663, 0.8844, 1.0860, 1.3242, - 1.5518, 1.7893, 2.0004, 2.1562, 2.3619, 2.5516, 2.7687, 2.9181, - 0.1483, 0.2851, 0.4479, 0.6312, 0.7924, 0.9821, 1.1705, 1.3386, - 1.5375, 1.7226, 1.9053, 2.0991, 2.2898, 2.4953, 2.7000, 2.9146, - 0.2332, 0.4561, 0.5407, 0.6212, 0.7524, 0.8215, 0.9522, 1.1685, - 1.5216, 1.7132, 1.8291, 2.0647, 2.2811, 2.4857, 2.7071, 2.9281, - 0.1348, 0.3126, 0.5179, 0.7192, 0.9227, 1.1363, 1.3223, 1.4756, - 1.6509, 1.8191, 1.9991, 2.1976, 2.3877, 2.5768, 2.7590, 2.9386, - 0.1093, 0.2211, 0.4763, 0.6703, 0.8282, 0.9536, 1.1202, 1.3796, - 1.6043, 1.8031, 1.9832, 2.1604, 2.3578, 2.5856, 2.7650, 2.9291, - 0.1865, 0.3027, 0.4580, 0.6719, 0.8400, 1.0082, 1.1901, 1.3782, - 1.5448, 1.6885, 1.9477, 2.1381, 2.2797, 2.5113, 2.7465, 2.9414, - 0.1575, 0.3124, 0.4649, 0.6262, 0.8095, 0.9858, 1.1676, 1.3602, - 1.5646, 1.7582, 1.9550, 2.1671, 2.3628, 2.5734, 2.7670, 2.9519, - 0.1174, 0.2777, 0.4663, 0.6333, 0.8169, 1.0096, 1.1885, 1.3847, - 1.5803, 1.7571, 1.9380, 2.1398, 2.3414, 2.5407, 2.7360, 2.9375, - 0.1073, 0.2264, 0.4083, 0.5973, 0.7474, 0.9514, 1.1349, 1.3337, - 1.5433, 1.7348, 1.9380, 2.1436, 2.3441, 2.5438, 2.7457, 2.9383, - 0.1472, 0.2880, 0.4793, 0.6268, 0.8015, 1.0063, 1.1715, 1.3644, - 1.5525, 1.7410, 1.9258, 2.1227, 2.3214, 2.5149, 2.7148, 2.9196, - 0.1414, 0.2565, 0.4349, 0.6111, 0.7695, 0.9496, 1.1212, 1.3265, - 1.5218, 1.7209, 1.9015, 2.0887, 2.3158, 2.5077, 2.7233, 2.9421, - 0.1252, 0.2667, 0.4454, 0.6431, 0.8371, 1.0124, 1.2110, 1.4160, - 1.6240, 1.8242, 2.0047, 2.1974, 2.3902, 2.5778, 2.7637, 2.9481, - 0.1321, 0.2565, 0.3846, 0.5847, 0.7578, 0.9259, 1.0637, 1.2239, - 1.4690, 1.7346, 1.9750, 2.1882, 2.3712, 2.5509, 2.7280, 2.8885, - 0.1437, 0.2930, 0.4428, 0.6156, 0.8045, 0.9638, 1.1450, 1.3138, - 1.5144, 1.7355, 1.9469, 2.1534, 2.3414, 2.5452, 2.7353, 2.9334, - 0.1692, 0.2770, 0.3831, 0.6100, 0.7825, 0.9302, 1.0690, 1.2481, - 1.4615, 1.6799, 1.9165, 2.1739, 2.3435, 2.5349, 2.7520, 2.9163, - 0.1235, 0.2489, 0.4354, 0.6343, 0.8236, 1.0066, 1.1908, 1.3474, - 1.5656, 1.8275, 2.0620, 2.2548, 2.4135, 2.5913, 2.7639, 2.9334, - 0.1090, 0.1961, 0.3854, 0.5701, 0.7024, 0.8843, 1.1393, 1.3785, - 1.5940, 1.7797, 1.9442, 2.1740, 2.3853, 2.5773, 2.7727, 2.9406, - 0.1560, 0.3477, 0.5011, 0.6287, 0.7612, 0.9896, 1.1510, 1.3420, - 1.5435, 1.6816, 1.8731, 2.0651, 2.2613, 2.4999, 2.7027, 2.8971, - 0.1459, 0.2416, 0.3833, 0.5450, 0.7916, 0.9223, 1.0662, 1.1953, - 1.4029, 1.6616, 1.9320, 2.1459, 2.3386, 2.5081, 2.6799, 2.9195, - 0.1546, 0.3854, 0.6184, 0.8460, 1.0599, 1.2428, 1.3906, 1.5550, - 1.7388, 1.8945, 2.0757, 2.2386, 2.4014, 2.5705, 2.7574, 2.9400, - 0.1080, 0.2307, 0.4112, 0.6067, 0.7725, 0.9467, 1.1285, 1.3205, - 1.5348, 1.7609, 1.9937, 2.1878, 2.3583, 2.5515, 2.7199, 2.9049, - 0.1482, 0.3178, 0.4983, 0.6342, 0.7783, 0.9880, 1.2019, 1.3404, - 1.5223, 1.7296, 1.9211, 2.0943, 2.2928, 2.5008, 2.7136, 2.9224, - 0.1145, 0.2910, 0.4891, 0.6492, 0.8126, 0.9530, 1.1180, 1.3155, - 1.5054, 1.6893, 1.8899, 2.1188, 2.3389, 2.5512, 2.7313, 2.9224, - 0.0939, 0.1689, 0.3250, 0.5792, 0.7698, 0.9245, 1.1574, 1.3865, - 1.5959, 1.7977, 1.9821, 2.1528, 2.3326, 2.5540, 2.7553, 2.9179, - 0.1243, 0.2474, 0.3923, 0.6199, 0.7908, 0.9379, 1.1497, 1.3734, - 1.5582, 1.7420, 1.9539, 2.1385, 2.3240, 2.5277, 2.7311, 2.9178, - 0.1961, 0.3748, 0.5176, 0.6387, 0.8169, 1.0477, 1.2124, 1.3869, - 1.5604, 1.7225, 1.8770, 2.0837, 2.2960, 2.5103, 2.6945, 2.8862, - 0.1295, 0.2403, 0.4149, 0.6189, 0.7913, 0.9130, 1.0832, 1.2787, - 1.4860, 1.7112, 1.9502, 2.1348, 2.2776, 2.4982, 2.7431, 2.9522, - 0.0160, 0.0362, 0.0097, 0.0057, -0.0014, -0.0073, -0.0046, -0.0064, - -0.0121, 0.0019, 0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182, - 0.0170, 0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025, - 0.0307, 0.0351, 0.0338, 0.0420, 0.0138, -0.0175, -0.0102, 0.0053, - 0.0084, -0.0003, 0.0412, -0.0027, 0.0145, -0.0039, 0.0083, 0.0400, - 0.0001, -0.0262, 0.0055, -0.0082, 0.0348, 0.0433, 0.0137, -0.0024, - -0.0055, 0.0262, 0.0521, 0.0349, 0.0185, 0.0076, -0.0319, -0.0561, - -0.0460, -0.0253, -0.0097, 0.0163, 0.0184, -0.0037, -0.0480, -0.0371, - 0.0628, 0.0665, 0.0296, -0.0057, 0.0253, 0.0227, 0.0350, 0.0692, - 0.0545, 0.0218, 0.0094, -0.0449, -0.0372, 0.0005, 0.0258, 0.0118, - 0.0285, 0.0760, 0.0822, 0.0527, -0.0299, -0.0049, 0.0170, 0.0195, - 0.0136, 0.0286, 0.0289, 0.0139, 0.0054, 0.0152, 0.0244, 0.0028, - -0.0056, -0.0260, 0.0307, 0.0572, -0.0087, 0.0088, 0.0062, 0.0000, - 0.0125, 0.0000, -0.0292, 0.0820, 0.0872, 0.0646, 0.0346, 0.0076, - -0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166, - -0.0259, -0.0140, 0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019, - -0.0071, 0.0393, 0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186, - -0.0280, -0.0201, -0.0077, 0.0383, 0.0418, 0.0321, 0.0294, 0.0169, - 0.0468, 0.0301, 0.0133, 0.0363, 0.0516, 0.0937, 0.1240, 0.1404, - 0.1325, 0.1178, 0.0999, 0.0251, -0.0037, -0.0495, -0.0703, -0.0219, - -0.0261, -0.0304, -0.0204, -0.0372, 0.0355, 0.0131, -0.0093, -0.0099, - -0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243, - 0.0046, -0.0107, -0.0070, 0.0123, 0.0230, 0.0152, 0.0164, 0.0412, - 0.0619, 0.0858, 0.0862, -0.0056, 0.0125, 0.0182, 0.0347, 0.0388, - 0.0456, 0.0407, -0.0249, -0.0460, 0.0206, 0.0299, 0.0253, 0.0207, - 0.0177, 0.0238, 0.0253, 0.0030, 0.0042, 0.0020, -0.0081, -0.0136, - -0.0290, -0.0042, 0.0122, 0.0051, 0.0107, 0.0228, 0.0211, -0.0068, - -0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679, 0.0172, 0.0150, - -0.0051, 0.0081, -0.0512, -0.0616, 0.0576, 0.0799, 0.0803, 0.0336, - 0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050, 0.0174, - -0.0290, -0.0601, -0.0150, 0.0121, 0.0165, 0.0230, 0.0028, -0.0317, - -0.0165, 0.0356, 0.0451, 0.0120, 0.0321, 0.0084, -0.0058, 0.0122, - 0.1935, 0.1802, 0.2195, 0.2410, 0.2201, 0.1915, 0.1840, 0.1935, - 0.2213, 0.2079, 0.1858, 0.1974, 0.2239, 0.2173, 0.1840, 0.2120, - 0.4912, 0.4777, 0.4607, 0.4395, 0.4426, 0.4388, 0.4416, 0.4345, - 0.4239, 0.4331, 0.4522, 0.4423, 0.4475, 0.4387, 0.4525, 0.4446, -}; - -const float ff_metasound_lsp44[] = { - 0.0927, 0.2291, 0.4059, 0.5779, 0.7288, 0.8821, 1.0377, 1.1915, - 1.3433, 1.4931, 1.6475, 1.7989, 1.9381, 2.0858, 2.2321, 2.3765, - 2.5187, 2.6530, 2.7895, 2.9354, 0.0944, 0.1974, 0.3046, 0.4714, - 0.6116, 0.7829, 0.9027, 1.0375, 1.1869, 1.3488, 1.5036, 1.6781, - 1.8276, 1.9983, 2.1449, 2.3089, 2.4534, 2.6113, 2.7553, 2.9062, - 0.1168, 0.2843, 0.4907, 0.6706, 0.8100, 0.9417, 1.0753, 1.2014, - 1.3151, 1.4496, 1.5832, 1.7379, 1.8642, 2.0230, 2.1681, 2.3250, - 2.4676, 2.6242, 2.7602, 2.9066, 0.1353, 0.2335, 0.3370, 0.4380, - 0.5819, 0.7353, 0.8671, 1.0160, 1.1435, 1.2977, 1.4860, 1.6739, - 1.8412, 2.0028, 2.1537, 2.3124, 2.4741, 2.6272, 2.7862, 2.9536, - 0.1003, 0.2226, 0.3584, 0.4971, 0.6291, 0.7710, 0.9157, 1.0669, - 1.2143, 1.3624, 1.5104, 1.6681, 1.8164, 1.9823, 2.1394, 2.3082, - 2.4677, 2.6306, 2.7909, 2.9382, 0.1056, 0.2027, 0.2956, 0.4005, - 0.5215, 0.6708, 0.8545, 1.0557, 1.2344, 1.4023, 1.5676, 1.7278, - 1.8808, 2.0381, 2.1846, 2.3376, 2.4887, 2.6377, 2.7878, 2.9504, - 0.1015, 0.2462, 0.4122, 0.5783, 0.7233, 0.8833, 1.0377, 1.1903, - 1.3341, 1.4727, 1.6138, 1.7582, 1.8912, 2.0370, 2.1701, 2.3125, - 2.4500, 2.6006, 2.7507, 2.9166, 0.1787, 0.2418, 0.3265, 0.5379, - 0.6584, 0.7681, 0.9545, 1.1050, 1.2125, 1.3528, 1.4763, 1.6705, - 1.8136, 1.9594, 2.0936, 2.2724, 2.4394, 2.5919, 2.7037, 2.8747, - 0.0859, 0.1600, 0.2980, 0.4933, 0.6696, 0.8285, 0.9958, 1.1545, - 1.3107, 1.4591, 1.6127, 1.7652, 1.9143, 2.0680, 2.2171, 2.3643, - 2.5141, 2.6611, 2.8143, 2.9691, 0.0910, 0.2110, 0.3364, 0.4718, - 0.5856, 0.7298, 0.8910, 1.0514, 1.1988, 1.3572, 1.5178, 1.6861, - 1.8399, 2.0099, 2.1639, 2.3225, 2.4774, 2.6321, 2.7863, 2.9412, - 0.1904, 0.2874, 0.3681, 0.4981, 0.6248, 0.7880, 0.9121, 1.0750, - 1.2185, 1.3809, 1.5296, 1.7007, 1.8592, 2.0470, 2.1913, 2.3250, - 2.4519, 2.5984, 2.7408, 2.9023, 0.0917, 0.2067, 0.3246, 0.4961, - 0.6310, 0.8024, 0.9438, 1.1008, 1.2362, 1.3892, 1.5407, 1.7033, - 1.8427, 2.0061, 2.1498, 2.3117, 2.4550, 2.6053, 2.7462, 2.9029, - 0.0989, 0.2193, 0.3756, 0.5410, 0.6929, 0.8368, 0.9801, 1.1250, - 1.2677, 1.4184, 1.5677, 1.7292, 1.8770, 2.0311, 2.1803, 2.3306, - 2.4836, 2.6339, 2.7943, 2.9549, 0.0861, 0.1943, 0.3057, 0.4867, - 0.6194, 0.7592, 0.9184, 1.1052, 1.2486, 1.4064, 1.5609, 1.7273, - 1.8703, 2.0291, 2.1686, 2.3225, 2.4628, 2.6115, 2.7471, 2.9005, - 0.0932, 0.2110, 0.3737, 0.5479, 0.7120, 0.8570, 0.9975, 1.1364, - 1.2772, 1.4220, 1.5612, 1.7089, 1.8410, 1.9827, 2.1263, 2.2859, - 2.4459, 2.6172, 2.7788, 2.9395, 0.1193, 0.2341, 0.3523, 0.5029, - 0.6437, 0.7803, 0.9367, 1.1007, 1.2392, 1.3869, 1.5425, 1.7168, - 1.8709, 2.0248, 2.1584, 2.2949, 2.4308, 2.5823, 2.7235, 2.9034, - 0.0834, 0.1988, 0.3557, 0.5261, 0.6767, 0.8427, 1.0029, 1.1683, - 1.3138, 1.4527, 1.6046, 1.7583, 1.9011, 2.0517, 2.1928, 2.3397, - 2.4839, 2.6291, 2.7771, 2.9329, 0.0938, 0.1967, 0.3213, 0.4675, - 0.6068, 0.7664, 0.9418, 1.1120, 1.2535, 1.3932, 1.5243, 1.6801, - 1.8346, 1.9931, 2.1376, 2.3035, 2.4636, 2.6244, 2.7829, 2.9371, - 0.1017, 0.2552, 0.4327, 0.6017, 0.7467, 0.8797, 1.0097, 1.1442, - 1.2628, 1.4049, 1.5541, 1.7090, 1.8461, 1.9982, 2.1486, 2.3029, - 2.4513, 2.6075, 2.7594, 2.9209, 0.1031, 0.2295, 0.3747, 0.5122, - 0.6596, 0.7935, 0.9345, 1.1050, 1.2384, 1.3543, 1.4739, 1.6136, - 1.7447, 1.8914, 2.0434, 2.1916, 2.3557, 2.5396, 2.7419, 2.9401, - 0.1007, 0.2374, 0.3715, 0.5173, 0.6465, 0.8069, 0.9553, 1.1145, - 1.2594, 1.4143, 1.5617, 1.7166, 1.8457, 2.0012, 2.1462, 2.2864, - 2.4258, 2.5910, 2.7372, 2.9018, 0.0808, 0.1726, 0.2849, 0.4592, - 0.6118, 0.7853, 0.9588, 1.1256, 1.2751, 1.4392, 1.5898, 1.7514, - 1.8977, 2.0554, 2.1937, 2.3430, 2.4831, 2.6249, 2.7601, 2.9155, - 0.1669, 0.2574, 0.3694, 0.5569, 0.6773, 0.8061, 1.0160, 1.1667, - 1.2791, 1.4041, 1.5452, 1.7207, 1.8524, 2.0038, 2.1414, 2.3338, - 2.4747, 2.6157, 2.7303, 2.8848, 0.1598, 0.2521, 0.3416, 0.5149, - 0.6703, 0.7941, 0.9408, 1.1164, 1.2017, 1.3293, 1.4908, 1.6783, - 1.8438, 1.9927, 2.1149, 2.2698, 2.4420, 2.6193, 2.7583, 2.9103, - 0.0902, 0.1978, 0.3265, 0.4578, 0.5878, 0.7439, 0.9110, 1.0906, - 1.2556, 1.4125, 1.5688, 1.7295, 1.8829, 2.0472, 2.2058, 2.3537, - 2.5075, 2.6548, 2.8058, 2.9538, 0.0818, 0.1695, 0.2794, 0.4470, - 0.6069, 0.7641, 0.9313, 1.0946, 1.2411, 1.4072, 1.5640, 1.7186, - 1.8651, 2.0254, 2.1726, 2.3286, 2.4784, 2.6287, 2.7750, 2.9339, - 0.1980, 0.3134, 0.4099, 0.4975, 0.6491, 0.8376, 0.9441, 1.0298, - 1.1795, 1.3866, 1.5784, 1.7209, 1.8137, 1.9271, 2.0863, 2.2930, - 2.4696, 2.6184, 2.7587, 2.9251, 0.1338, 0.2341, 0.3566, 0.4797, - 0.6129, 0.7580, 0.9093, 1.0491, 1.1911, 1.3313, 1.4841, 1.6503, - 1.8035, 1.9685, 2.1128, 2.2694, 2.4093, 2.5728, 2.7206, 2.8994, - 0.0937, 0.2034, 0.3447, 0.5032, 0.6370, 0.7993, 0.9674, 1.1323, - 1.2830, 1.4199, 1.5492, 1.7010, 1.8513, 2.0087, 2.1550, 2.3115, - 2.4643, 2.6237, 2.7812, 2.9392, 0.1085, 0.2152, 0.3126, 0.4569, - 0.5718, 0.7213, 0.8837, 1.0604, 1.2053, 1.3755, 1.5397, 1.7001, - 1.8409, 2.0039, 2.1498, 2.3080, 2.4535, 2.6063, 2.7505, 2.9110, - 0.0562, 0.2066, 0.4034, 0.5490, 0.6682, 0.7924, 0.9495, 1.0800, - 1.1869, 1.3156, 1.4834, 1.6619, 1.8404, 2.0199, 2.1509, 2.2755, - 2.4072, 2.5580, 2.6993, 2.8913, 0.0939, 0.2303, 0.3742, 0.5260, - 0.6662, 0.8294, 0.9769, 1.1315, 1.2792, 1.4153, 1.5436, 1.6701, - 1.8215, 1.9920, 2.1310, 2.3005, 2.4534, 2.5786, 2.7204, 2.9068, - 0.1005, 0.2442, 0.3898, 0.5398, 0.6958, 0.8474, 1.0008, 1.1556, - 1.3020, 1.4456, 1.5954, 1.7470, 1.8922, 2.0500, 2.2019, 2.3492, - 2.4963, 2.6412, 2.7890, 2.9423, 0.1022, 0.2031, 0.3213, 0.4402, - 0.5637, 0.7117, 0.8673, 1.0242, 1.1727, 1.3206, 1.4846, 1.6465, - 1.8015, 1.9655, 2.1233, 2.2873, 2.4464, 2.6074, 2.7685, 2.9409, - 0.1985, 0.3497, 0.4622, 0.5982, 0.7489, 0.8752, 0.9925, 1.1679, - 1.3288, 1.4606, 1.5820, 1.7492, 1.8922, 2.0511, 2.1780, 2.3373, - 2.4760, 2.6233, 2.7466, 2.8978, 0.1284, 0.2433, 0.3630, 0.4852, - 0.6117, 0.7460, 0.8904, 1.0360, 1.1738, 1.3142, 1.4696, 1.6185, - 1.7719, 1.9318, 2.0961, 2.2697, 2.4408, 2.6046, 2.7681, 2.9451, - 0.1042, 0.2286, 0.3598, 0.5064, 0.6438, 0.7899, 0.9350, 1.0891, - 1.2323, 1.3807, 1.5225, 1.6747, 1.8153, 1.9669, 2.1145, 2.2832, - 2.4430, 2.6085, 2.7748, 2.9346, 0.0780, 0.1724, 0.2440, 0.3489, - 0.5280, 0.7426, 0.9272, 1.0914, 1.2562, 1.4188, 1.5804, 1.7376, - 1.8909, 2.0473, 2.1946, 2.3457, 2.4950, 2.6424, 2.7926, 2.9549, - 0.1103, 0.2608, 0.4087, 0.5538, 0.6923, 0.8418, 0.9940, 1.1507, - 1.2919, 1.4406, 1.5802, 1.7262, 1.8638, 2.0085, 2.1572, 2.2975, - 2.4329, 2.5866, 2.7380, 2.9107, 0.1297, 0.2532, 0.4003, 0.5329, - 0.6733, 0.7950, 0.9557, 1.0859, 1.2235, 1.3538, 1.5037, 1.6389, - 1.7964, 1.9285, 2.0898, 2.2541, 2.4231, 2.5711, 2.6875, 2.8947, - 0.0871, 0.1968, 0.3425, 0.4949, 0.6424, 0.7959, 0.9534, 1.1132, - 1.2656, 1.4229, 1.5785, 1.7271, 1.8729, 2.0355, 2.1998, 2.3562, - 2.5151, 2.6663, 2.8145, 2.9534, 0.1038, 0.2204, 0.3248, 0.4566, - 0.5947, 0.7443, 0.8811, 1.0379, 1.2031, 1.3772, 1.5430, 1.7092, - 1.8625, 2.0322, 2.1904, 2.3417, 2.4960, 2.6458, 2.7979, 2.9485, - 0.1329, 0.2763, 0.3943, 0.5147, 0.6512, 0.8071, 0.9410, 1.0879, - 1.2298, 1.3850, 1.5282, 1.6674, 1.8137, 1.9993, 2.1344, 2.2749, - 2.4257, 2.5863, 2.7410, 2.9184, 0.1052, 0.2142, 0.3584, 0.5033, - 0.6387, 0.7804, 0.9320, 1.0780, 1.2172, 1.3764, 1.5421, 1.6887, - 1.8246, 1.9833, 2.1245, 2.2797, 2.4237, 2.5779, 2.7257, 2.9097, - 0.1092, 0.2676, 0.4071, 0.5355, 0.6661, 0.8142, 0.9621, 1.1173, - 1.2628, 1.4185, 1.5696, 1.7220, 1.8595, 2.0178, 2.1720, 2.3221, - 2.4718, 2.6259, 2.7775, 2.9334, 0.0929, 0.2017, 0.3073, 0.4570, - 0.5775, 0.7635, 0.9299, 1.0832, 1.2334, 1.3935, 1.5420, 1.7112, - 1.8601, 2.0309, 2.1735, 2.3230, 2.4543, 2.6034, 2.7418, 2.8988, - 0.0775, 0.2005, 0.3490, 0.5200, 0.6747, 0.8383, 0.9885, 1.1738, - 1.3141, 1.4236, 1.5892, 1.7402, 1.8474, 2.0210, 2.1593, 2.2730, - 2.4235, 2.5604, 2.7128, 2.9005, 0.1104, 0.2292, 0.3353, 0.4732, - 0.6152, 0.7675, 0.9164, 1.0907, 1.2594, 1.4064, 1.5218, 1.6426, - 1.8018, 1.9937, 2.1362, 2.2961, 2.4523, 2.6083, 2.7613, 2.9202, - 0.0826, 0.2000, 0.3384, 0.5144, 0.6694, 0.8377, 0.9870, 1.1461, - 1.2950, 1.4495, 1.5872, 1.7387, 1.8793, 2.0329, 2.1723, 2.3114, - 2.4415, 2.5908, 2.7354, 2.9028, 0.1063, 0.2268, 0.3442, 0.4735, - 0.6116, 0.7507, 0.9028, 1.0768, 1.2426, 1.4052, 1.5566, 1.7015, - 1.8243, 1.9742, 2.1276, 2.2824, 2.4262, 2.5953, 2.7627, 2.9290, - 0.1150, 0.2814, 0.4543, 0.6095, 0.7373, 0.8592, 0.9908, 1.1108, - 1.2339, 1.3590, 1.4864, 1.6168, 1.7392, 1.8752, 2.0212, 2.1688, - 2.3128, 2.4869, 2.7019, 2.9239, 0.0948, 0.2074, 0.3433, 0.4943, - 0.6346, 0.7645, 0.8809, 1.0610, 1.2307, 1.3487, 1.4655, 1.6186, - 1.7534, 1.8859, 2.0486, 2.2200, 2.3835, 2.5581, 2.7565, 2.9502, - 0.1062, 0.2239, 0.3683, 0.5197, 0.6704, 0.8184, 0.9642, 1.1127, - 1.2556, 1.3976, 1.5405, 1.6940, 1.8375, 1.9888, 2.1377, 2.2980, - 2.4555, 2.6184, 2.7849, 2.9452, 0.0888, 0.2005, 0.2847, 0.4322, - 0.5763, 0.7577, 0.9262, 1.1095, 1.2719, 1.4331, 1.5843, 1.7452, - 1.8845, 2.0385, 2.1805, 2.3345, 2.4750, 2.6217, 2.7555, 2.9013, - 0.1713, 0.2617, 0.3868, 0.5859, 0.7073, 0.8535, 1.0593, 1.1778, - 1.3109, 1.4508, 1.5910, 1.7463, 1.8911, 2.0651, 2.2035, 2.3355, - 2.4947, 2.6440, 2.7424, 2.8943, 0.1346, 0.2549, 0.4089, 0.5488, - 0.6949, 0.8394, 0.9810, 1.1145, 1.2528, 1.4044, 1.5423, 1.6872, - 1.8274, 1.9726, 2.1403, 2.2809, 2.4128, 2.5564, 2.6887, 2.8895, - 0.0776, 0.1621, 0.2553, 0.4191, 0.5988, 0.7921, 0.9651, 1.1350, - 1.2930, 1.4475, 1.6011, 1.7585, 1.9068, 2.0638, 2.2102, 2.3594, - 2.5096, 2.6581, 2.8099, 2.9654, 0.0864, 0.1778, 0.2854, 0.4235, - 0.5568, 0.7220, 0.8963, 1.0609, 1.2217, 1.3830, 1.5422, 1.7018, - 1.8551, 2.0206, 2.1783, 2.3328, 2.4869, 2.6366, 2.7923, 2.9539, - 0.1144, 0.2576, 0.4186, 0.5594, 0.6875, 0.8221, 0.9598, 1.0944, - 1.2273, 1.3713, 1.5152, 1.6628, 1.8070, 1.9525, 2.0965, 2.2535, - 2.4132, 2.5725, 2.7250, 2.9150, 0.1079, 0.2221, 0.3334, 0.4845, - 0.6083, 0.7516, 0.9018, 1.0594, 1.2060, 1.3673, 1.5212, 1.6880, - 1.8208, 1.9831, 2.1269, 2.2909, 2.4366, 2.6027, 2.7339, 2.8924, - 0.0994, 0.2233, 0.3634, 0.5145, 0.6568, 0.8131, 0.9746, 1.1296, - 1.2666, 1.4116, 1.5748, 1.7264, 1.8649, 2.0217, 2.1716, 2.3293, - 2.4900, 2.6455, 2.7818, 2.9362, 0.1120, 0.2079, 0.3128, 0.4124, - 0.5291, 0.6816, 0.8478, 1.0150, 1.1772, 1.3456, 1.5208, 1.6882, - 1.8458, 2.0078, 2.1627, 2.3198, 2.4733, 2.6251, 2.7796, 2.9489, - 0.0853, 0.2030, 0.3669, 0.5326, 0.6678, 0.8086, 0.9526, 1.1142, - 1.2551, 1.4158, 1.5694, 1.7073, 1.8431, 1.9686, 2.1153, 2.2376, - 2.3686, 2.5591, 2.7320, 2.9104, 0.0905, 0.2166, 0.3539, 0.5201, - 0.6700, 0.8346, 0.9883, 1.1457, 1.2714, 1.3845, 1.5172, 1.6688, - 1.8008, 1.9535, 2.1019, 2.2708, 2.4135, 2.5974, 2.7486, 2.9033, - 0.0084, 0.0374, 0.0164, -0.0153, 0.0288, 0.0107, -0.0255, -0.0242, - 0.0000, -0.0055, -0.0081, -0.0075, -0.0022, -0.0052, -0.0069, -0.0017, - 0.0003, 0.0091, 0.0028, -0.0027, 0.0085, 0.0043, -0.0235, -0.0411, - 0.0202, 0.0359, 0.0376, 0.0321, 0.0306, -0.0358, -0.0276, -0.0090, - 0.0032, 0.0048, 0.0309, 0.0332, 0.0284, 0.0237, 0.0051, -0.0101, - -0.0233, -0.0428, -0.0585, -0.0387, 0.0039, 0.0081, 0.0029, -0.0017, - -0.0006, -0.0068, 0.0044, 0.0182, 0.0376, 0.0387, -0.0334, -0.0269, - -0.0182, -0.0069, -0.0026, 0.0035, -0.0049, -0.0212, -0.0408, -0.0245, - 0.0186, 0.0189, 0.0153, 0.0120, 0.0157, 0.0055, -0.0046, 0.0179, - 0.0284, -0.0032, -0.0261, -0.0205, -0.0039, 0.0174, 0.0299, 0.0207, - 0.0012, -0.0056, 0.0010, 0.0141, -0.0119, 0.0190, 0.0315, 0.0033, - -0.0128, 0.0300, 0.0328, 0.0308, 0.0353, 0.0266, 0.0066, -0.0328, - -0.0273, 0.0054, 0.0145, 0.0175, 0.0015, -0.0171, 0.0062, -0.0164, - 0.0045, -0.0071, 0.0025, 0.0278, 0.0283, 0.0117, -0.0026, -0.0285, - -0.0408, -0.0366, -0.0059, -0.0208, -0.0354, -0.0334, -0.0263, -0.0064, - 0.0072, -0.0006, -0.0235, -0.0037, -0.0307, -0.0294, -0.0163, -0.0197, - -0.0235, 0.0192, 0.0013, -0.0219, -0.0123, -0.0004, -0.0081, -0.0096, - -0.0123, -0.0101, 0.0021, 0.0151, 0.0106, 0.0151, 0.0292, 0.0033, - 0.0283, 0.0124, 0.0058, -0.0017, -0.0038, 0.0152, 0.0141, 0.0132, - 0.0178, 0.0157, 0.0073, 0.0176, 0.0141, 0.0097, -0.0092, -0.0163, - -0.0230, -0.0134, -0.0099, -0.0147, 0.0040, -0.0183, -0.0175, -0.0080, - -0.0083, -0.0290, -0.0417, -0.0398, -0.0269, -0.0199, -0.0143, -0.0053, - -0.0099, -0.0054, -0.0199, -0.0219, -0.0170, 0.0107, 0.0194, 0.0035, - 0.0437, 0.0406, 0.0215, 0.0120, 0.0053, -0.0028, 0.0238, 0.0337, - 0.0217, 0.0011, 0.0227, 0.0244, 0.0327, 0.0378, 0.0437, 0.0356, - -0.0033, 0.0113, 0.0407, 0.0334, -0.0125, -0.0003, -0.0141, -0.0273, - -0.0137, -0.0079, -0.0145, -0.0071, 0.0114, 0.0181, 0.0150, 0.0085, - -0.0077, -0.0038, -0.0219, -0.0263, -0.0187, -0.0233, 0.0133, 0.0265, - -0.0156, -0.0091, -0.0110, -0.0016, 0.0143, 0.0177, 0.0240, 0.0082, - -0.0143, -0.0257, -0.0014, 0.0002, 0.0082, 0.0180, 0.0325, 0.0340, - -0.0153, -0.0389, -0.0240, 0.0082, 0.0140, 0.0046, -0.0138, -0.0378, - -0.0366, 0.0297, 0.0252, 0.0078, 0.0063, 0.0006, 0.0044, 0.0074, - 0.0094, 0.0113, 0.0105, 0.0137, 0.0438, 0.0262, -0.0078, -0.0185, - -0.0215, -0.0407, -0.0435, -0.0208, -0.0004, -0.0144, -0.0205, -0.0248, - -0.0159, -0.0069, -0.0153, 0.0132, 0.0355, 0.0298, 0.0120, 0.0072, - 0.0236, 0.0526, 0.0479, 0.0233, -0.0133, -0.0283, -0.0468, -0.0549, - -0.0370, 0.0032, 0.0056, 0.0023, 0.0050, 0.0024, 0.0279, 0.0116, - -0.0045, -0.0012, 0.0107, 0.0190, 0.0253, 0.0191, 0.0043, 0.0193, - -0.0348, -0.0246, 0.0123, 0.0210, 0.0135, -0.0096, -0.0109, -0.0076, - -0.0156, -0.0290, 0.0160, 0.0194, 0.0219, 0.0259, 0.0250, 0.0195, - 0.4948, 0.4961, 0.4940, 0.4878, 0.4849, 0.4727, 0.4571, 0.4551, - 0.4534, 0.4468, 0.4412, 0.4354, 0.4298, 0.4272, 0.4498, 0.4506, - 0.4560, 0.4592, 0.4758, 0.4941, 0.2476, 0.1771, 0.1974, 0.1881, - 0.1667, 0.1826, 0.2067, 0.2031, 0.1734, 0.1534, 0.1415, 0.1761, - 0.1897, 0.1772, 0.1651, 0.1247, 0.1041, 0.1231, 0.1809, 0.2234, -}; - -#if CONFIG_METASOUND_DECODER -static const int16_t shape8[] = { - 2765, 1262, 6624, 867, 688, 1884, 3245, 1248, - -2160, 593, 182, -1004, -1067, 687, 1021, -920, - 1396, -242, -2817, -1838, -3351, 1000, 5995, 2459, - -283, 1909, 1452, -4569, 556, -2004, -42, -3393, - -50, -385, 597, 983, 420, 6311, -1572, -1665, - 6128, -1688, -5191, -337, -4199, 371, 1032, -84, - 2169, 931, -392, -250, 137, 831, 8194, -489, - -92, 209, 115, 1453, 246, -647, 936, 1097, - -400, 597, 392, 93, -7709, -711, -724, 2051, - 497, 1919, -876, -769, -172, 2972, 952, 555, - 151, -617, 773, 4840, -3671, 841, 244, -661, - -3424, 958, 81, 532, -315, 796, 5491, -516, - -1, -1371, -531, -5538, 313, -1749, 2413, -835, - -3143, -244, -3470, -850, -4241, -859, -74, 2141, - -1005, 4643, -339, 4089, -861, -6612, 483, -2888, - -580, -45, 3662, 918, -317, 3596, -741, 897, - -2578, -654, -1628, -1865, 629, 3219, 214, -1898, - 1173, -4509, 1682, -2161, 697, -147, 9839, 751, - -1094, -341, -669, -1322, 649, -832, -382, -5467, - -44, 3510, 1312, 3104, -202, 1870, -155, 601, - 719, -22, -350, 394, 81, 397, -9185, -174, - 351, -4717, -4450, 3672, 1163, 2351, 1720, 1048, - -1221, -280, -18, -15, 678, -3931, 4707, -99, - 1823, -535, -1836, 138, 1166, -3031, 5515, 1362, - 1235, 455, 595, -3671, 1102, -163, 62, 1104, - 813, 870, -295, -1088, -299, -3976, 805, -7468, - -412, -2109, 236, 46, -5764, 615, -1475, 853, - 790, -6197, 312, 637, -3923, -422, -1086, -5647, - 878, -1410, 2085, -51, -2941, -769, -63, 838, - 823, 741, 2785, 450, -7003, -121, -915, 60, - -41, 0, -39, 8774, 647, -521, 379, -342, - -344, 818, 1316, 1056, 182, 2765, -467, 7886, - 45, 791, -415, 3864, -2428, 2255, -661, -64, - 1693, 144, 1784, -1194, -46, -1856, 1208, 4131, - 914, 8028, -17, 1939, -1415, 533, 291, -466, - 186, -705, 668, -614, -253, -2190, 287, 3929, - 1472, -1561, 5, 889, -2020, 158, -14, -1419, - 1338, -353, 622, -54, 87, -1104, -2911, 513, - -632, 1533, -267, 22, 6567, 295, 325, 6883, - 963, -373, -349, 183, 896, 1845, -1157, 351, - -367, 1171, 4362, 508, 5632, 704, -1420, -1886, - 686, 5230, -9, 2422, 230, 264, 3738, -270, - -344, -528, -936, 2286, -540, 4274, 337, -665, - 737, 1639, -1307, 5827, 592, -1372, -412, 1419, - 4579, 335, 223, -1067, -112, -446, 149, 1375, - -155, -392, -1980, 561, -67, 341, 6957, 475, - 11449, 39, 81, 766, -1880, 558, -134, -7940, - -489, 249, -886, -358, 6850, 2794, -2217, 1111, - -1222, -1130, -818, 1076, -1823, 865, -2220, 1179, - 4492, 224, -2073, -338, -5351, -390, 133, 496, - -42, -16, 46, 437, 322, -275, -72, 48, - -325, 313, 1108, -1044, -851, -5030, 1035, 4316, - -1281, -913, -1419, -941, 1914, 960, 1242, 202, - 5109, 475, 1254, 1725, -1504, -4, -269, -421, - -150, -4409, -610, -1548, -1684, -817, -210, 72, - -679, -106, -3809, -1137, 4, 7220, -95, 810, - 2432, -331, 492, -81, 138, -62, -613, -636, - 106, 10908, 912, 144, 192, 1251, -3970, -954, - 1145, 1175, -1721, 5326, -1721, -569, -3661, -1166, - 6605, -744, -1494, 853, 134, 3259, -504, -1740, - 180, -207, -659, 196, 179, -106, 118, 789, - -834, 10339, -420, -3002, -456, 113, 6435, 949, - 721, -2709, -1599, -684, -8068, 174, -1416, -58, - 974, 308, -726, 1237, -1594, 519, -131, -198, - -1395, 1180, -173, 338, -5584, -279, -236, 6817, - 89, -220, 3967, -107, 65, 2479, -22, 642, - 7179, 1179, -229, -202, 4948, -5465, 1632, -1285, - 2188, -2037, 1763, 636, 4247, 995, 1176, 2, - -2398, 1236, -661, 382, -1075, 130, 103, -187, - 604, -306, -2635, -2185, 157, 775, 6373, -924, - 1758, -3043, 1707, 2852, -2148, 6779, 376, -1018, - -2374, -989, 249, -5393, -32, 538, -416, -5108, - -658, 1839, 419, 1153, -3956, -617, -1925, 5434, - 626, 1488, -3824, 140, 370, -2230, -7031, 1989, - -581, 639, -4249, -216, 1225, -776, -973, -542, - -2922, -1783, -2430, -3251, 958, 3313, 636, -6277, - 119, -866, -406, -156, -4839, 966, -469, 5559, - 193, 376, -4810, -870, 163, 4130, 2596, 2203, - -114, 2423, -622, -424, 2935, 749, 2500, 4230, - -162, -1489, 2169, -5156, 751, 2748, 2240, -1549, - 4821, 175, 2274, 854, 2993, 838, 322, -2663, - -794, -283, -98, 1393, -709, 362, 285, -1085, - 1075, 374, 1062, 6512, -3375, -3138, 3939, 3628, - 3926, -2442, 1989, -583, -1282, -1882, -3920, -4593, - 540, 2667, -155, 156, -2428, 1229, -436, 1754, - 2815, -1634, -2299, 1155, 990, 3689, -1242, 3145, - 3951, 45, 186, -1110, 257, -335, 8929, 533, - -173, 813, 21, 1584, 541, -44, 1349, 108, - -5163, -684, 5522, -868, -5795, 769, 583, 2827, - -818, -5551, 1485, 37, -631, -262, -4352, -532, - 61, 434, 1775, 8974, -112, -852, -1227, -1645, - 260, 298, -430, 863, -3860, -97, 6467, -328, - -2418, -61, -1253, 1575, 30, -5683, 2113, 973, - -371, -51, 5355, 471, -584, -492, -2187, 2799, - -506, 4435, 1950, -3415, -363, -404, 941, 2628, - -146, 434, 2853, 889, 634, 5749, -54, 126, - 189, -1384, -379, -3205, -540, 1720, 942, -6300, - -286, -58, -1083, 3782, 251, -334, 4172, 631, - 17, 83, 707, 1322, 3273, -573, 1024, -6112, - -540, 4916, 155, -1209, 308, -738, -2150, 786, - -168, 68, -201, -64, -752, -1595, -9188, 320, - -426, 111, -2183, 886, -737, 193, -837, 3219, - 5936, 4022, 764, -82, 3344, -855, 3705, -2652, - 1533, -206, -3673, 1235, 1163, -1217, 3183, 1313, - -745, 6554, 7019, 1302, 2129, 268, -70, 110, - 412, -155, -1703, -4945, 105, -1705, 412, -6588, - 2905, 1279, 73, -2446, -5635, 1168, 2974, 404, - -650, 265, -1773, -1857, -108, -651, 657, -824, - 3352, 177, 155, 1275, 2012, 31, -7, -1065, - 2062, 411, -2325, -208, -6306, 683, 1037, -1060, - 191, -187, -585, 6103, -459, 571, 1640, -693, - 922, -2291, 537, 1934, 263, 3847, -202, 7060, - 136, 4368, 2963, -1032, 18, 1836, -144, -3853, - 474, 2005, 1298, 2396, 825, -2274, 12, 3759, - -394, 907, 490, 2997, 2180, -1570, -1000, 5982, - -129, -820, -3001, 2684, -1132, -2908, 1101, 5044, - 393, -1637, 393, 1343, -1231, 404, 1817, 1463, - -443, 1053, -584, -7756, 45, 499, -4109, 214, - 535, -3348, 54, -1594, 6913, 0, -94, 8772, - 500, 13, 734, 5, 798, -1521, 853, -82, - -263, -619, 1558, 456, 5911, -1376, 1054, -971, - -1275, -147, -111, 4964, 321, 67, 7024, -525, - 620, 883, -1058, -1132, -3313, 630, 226, -6201, - -1011, 1111, -820, -295, 580, 636, 2452, -638, - 6840, -285, 655, 1502, -1049, -567, 329, -33, - -249, 570, 186, 167, 780, 1104, 42, 197, - 10034, -1295, -208, 32, -1473, 716, 159, -6672, - -45, 519, -4300, -246, 3692, 5062, 4305, -748, - -548, 181, -382, -881, -1968, 580, 964, -420, - -327, -3397, -1584, 2770, -3501, 1659, -1252, 2352, - 6, 30, 0, -273, 27, -204, -485, -432, - -6, 176, -428, 1562, 104, -6511, -1084, 2205, - -11, -5254, -132, -508, -69, 373, -1503, 208, - -58, 5311, 92, -966, -6563, -480, -24, 1424, - -1498, -165, 4594, -903, -1787, -353, -7284, 142, - 1008, 875, -6109, -16, 162, 4895, 30, -188, - 2099, 1581, 300, -259, -921, -386, -488, 140, - -482, 7135, -77, 494, -196, 3207, -250, -102, - 318, 978, 161, 7292, 55, -1347, -2605, 898, - 1833, 602, -1988, 630, -145, -102, -414, -133, - 417, -603, 156, -1151, -395, 625, -1676, 86, - 680, 13321, 322, -5816, -292, -223, 4205, -361, - 903, -224, 1745, 95, -6598, 79, 2323, -24, - 263, 778, 146, -939, 1814, 1945, 720, 367, - -2987, 899, -4409, 136, -3185, -342, -3304, 1016, - 284, -345, 2313, -403, 389, -1403, 1835, 151, - -132, -1702, -339, -5679, 2026, -2990, 47, -564, - 399, -2167, 1392, 1384, 5094, -2954, 4467, -22, - -23, 408, 1620, 1381, 2380, 805, 380, -36, - -803, 765, -778, 905, -200, -669, 3942, 289, - 176, -4767, 2015, -3554, 1206, 6071, 180, 2057, - -48, 365, -48, -2423, 585, -109, -1298, 2519, - -525, -589, 374, 976, 3667, 2091, -2890, 1371, - -726, -216, -1027, -116, 2122, -619, -3826, 4649, - 1167, 0, 1237, 1538, 2505, -548, -3093, 1344, - -558, -1927, 199, 2462, 1327, 4597, 833, -3660, - -341, -1010, 428, 148, -1682, 130, 1569, 8785, - -752, -1032, -2407, 353, -379, 3311, 892, 893, - -2596, -217, -835, -2291, 1137, -4339, -58, 2759, - 991, 3527, -281, -6050, -1251, 1802, 8, -3916, -}; - -static const int16_t shape8s[] = { - 2639, 550, 6487, 2812, 1014, 1926, 2959, 757, - -1452, -111, -45, -409, 401, 545, 1545, -1677, - 75, -607, -3658, -368, -4486, 272, 6017, -468, - 1108, 1056, 606, -3288, 1003, -830, -336, -2940, - 247, 227, 1700, 338, -161, 5694, 317, -584, - 6278, -2902, -3862, 293, -3400, 540, 177, -840, - -471, 963, -243, -289, 77, 39, 7626, 333, - 577, 327, -359, 999, -392, 107, 1410, 509, - -983, 36, -193, -68, -7612, -775, -178, 1415, - 1069, 1534, -1276, 1204, 615, 2065, 499, 124, - 265, -454, 1974, 6428, -4028, 1102, -1418, -85, - -816, -64, -46, 926, -960, 78, 4823, -41, - -74, -682, -761, -6598, 3084, -1597, 2945, -861, - -3203, -669, -3717, -310, -2865, -1447, 72, 1987, - 364, 4919, -247, 3678, -196, -6807, -127, -965, - 233, -133, 4000, -76, -182, 3825, 67, 700, - -1934, 545, -2467, -1441, 629, 3409, 512, -3333, - 539, -4896, 3413, -2083, 554, 574, 9430, 296, - -88, -533, -321, -1082, 2363, 42, -50, -5402, - -123, 4458, 1130, 2737, 378, 1509, -3267, 970, - 179, -2114, 602, 479, -438, 277, -9389, 1144, - 2453, -3705, -3842, 3965, 482, 1230, 2211, -281, - -1833, -1741, 1653, -868, 485, -3740, 5371, 989, - 1182, 10, -1812, 233, 1028, -3300, 4698, 1572, - 1580, 928, -314, -3452, 830, -1511, -1079, 554, - 641, 1383, 105, -1101, 1549, -3944, 902, -6557, - 493, -3117, 782, -699, -4806, 910, -259, -28, - 1713, -7012, 570, -1270, -4698, -8, 220, -4295, - 1135, -3905, 945, -467, -2164, -651, 181, 212, - 159, 587, 1587, 1101, -7153, -309, -1470, -1135, - -265, -326, 172, 8840, 726, -780, 170, -1038, - 466, 216, 764, 231, -547, 2456, -420, 8132, - 486, 866, -359, 3351, -1829, 2018, -352, -1353, - 711, 645, 1149, 74, -466, -669, 1009, 3086, - 240, 7468, -182, 1947, -221, 496, -448, 189, - -113, -752, 133, -214, -1310, -144, -1034, 5235, - -1939, -2664, 192, 1526, -2320, 762, -778, 357, - 1251, 424, -225, -1008, -229, -352, -3559, -271, - -1069, 1274, -175, 368, 6453, -505, 31, 7678, - 165, -418, -112, -649, 1421, 667, -334, 1041, - -353, 585, 4109, 1095, 5283, 685, -687, -1459, - 1054, 5048, -194, 2220, 81, 244, 3789, 12, - -923, -1459, 319, 2378, -53, 4097, -662, -1156, - 223, 2589, -547, 4951, -346, -1812, -111, 344, - 5247, 387, -459, -810, 1022, 234, 726, 1840, - -545, -888, 728, 106, 1027, -497, 349, -248, - 11173, -311, 126, 479, -2036, 265, -1286, -7196, - -511, 128, -1833, 496, 7620, 2539, -1809, 962, - -614, -876, 857, 2178, 642, -1180, -2294, 911, - 3932, 711, -1073, -1381, -5317, 237, -414, 579, - -78, -27, -78, -14, 100, -191, 142, -1, - 430, -182, 207, -61, -72, -4866, 583, 5099, - -704, -1496, 1065, -206, 2371, 1496, 1777, -308, - 4802, -1415, 1178, 2650, 312, -338, -250, -64, - -27, -3163, -561, -1283, 952, -902, 354, 1597, - -74, -685, -3266, -873, -744, 7079, 732, 697, - 550, -1362, 251, 34, -742, 0, 105, -608, - -1, 10459, 854, -103, -419, 2286, -3041, -3278, - -51, -491, -187, 4204, 857, -1085, -2501, -1647, - 6740, 605, -2079, 1748, 519, 3462, 106, -699, - 220, -615, -406, 420, 786, 572, 679, 218, - -888, 10283, 129, -2286, -705, -78, 5072, 634, - 702, -6315, -551, -307, -7946, 177, -1897, -579, - 1620, 125, 116, -89, -308, -1018, 142, -506, - -624, 917, -779, 632, -5103, 314, -155, 5687, - 77, -144, 2957, -176, 30, 1347, -426, -51, - 7829, 1201, -592, 1, 4617, -5476, 2216, 414, - 1281, -81, -423, -322, 3623, 447, 863, -375, - -489, 526, -485, 159, 1090, 463, 401, -131, - 223, 1630, -2462, -2261, 623, 1019, 6385, -595, - -654, -2787, 2381, 328, -2069, 5410, -402, -554, - -1594, -860, 83, -5011, -938, 1061, 163, -3523, - -1064, 1215, 761, 1604, -4224, 904, -2706, 4907, - -1838, 3287, -3118, -464, -217, -1187, -6792, 1748, - -569, 613, -3177, -253, 164, -845, 539, -440, - -1871, -2010, -2322, -3026, 478, 2297, -560, -5813, - 768, -1709, -620, 66, -4667, 805, -215, 5366, - -442, -233, -6732, 345, 106, 4483, 1720, 2725, - -109, 2746, -188, 204, 1905, 1225, 253, 3270, - 1912, -1852, -256, -4131, 768, 3984, 473, -1434, - 4380, 208, 2547, 1051, 3347, -171, 629, -2389, - -722, -759, 166, 2192, 325, -193, -289, -945, - -436, 931, 1352, 6918, -2707, -987, 2940, 3574, - 4135, -3205, 351, 927, 128, -1873, -4894, -4816, - -461, 696, -1618, 129, -28, 2195, 2450, 585, - 2557, -1308, -2204, -590, 2345, 3699, -312, 4436, - 3422, -611, -106, -2647, -1752, -73, 8914, -673, - 1625, 850, 720, -1182, -245, -113, 882, -223, - -4873, -1009, 5643, -97, -4779, -155, 444, 2894, - -876, -5534, 1268, -132, -881, -389, -4250, -153, - -44, 986, 1820, 8671, 662, -344, -198, -1909, - 1083, 114, -318, 1070, -3293, -375, 6621, 232, - -2973, -100, -483, -529, -120, -5312, 1702, 651, - -631, 485, 5675, 50, 1132, -465, -1053, 2675, - -1592, 5565, 1036, -2808, 325, 999, 524, 2813, - -265, 337, 4226, 514, 576, 6047, 175, 204, - -514, -617, -94, -2862, -294, 1774, 978, -7040, - -169, 835, -829, 2258, -37, -319, 2750, 138, - -289, -1092, 78, 1032, 4316, -1201, 808, -6243, - -940, 4136, 89, -1076, -647, -255, -207, 227, - -70, -62, -202, 66, 24, -988, -9542, -225, - -739, 161, -2698, 117, -608, 173, -629, 1770, - 5037, 5145, 2530, -1028, 3077, -496, 4671, -1859, - 2148, 447, -4231, 170, 713, 323, 746, 1447, - -1880, 5069, 7765, -492, -775, -659, -770, -59, - -258, -92, -1683, -4639, -1727, -2128, 545, -5060, - 2536, 1549, 492, -1280, -6034, 965, 3244, 475, - -1208, 680, -283, 295, -357, -257, 1753, -362, - 3159, 106, -181, 1805, 947, -1002, -136, 756, - 1189, 237, -2427, -263, -5746, 13, 2171, -1197, - -319, -372, -1300, 5458, 955, 1224, 618, -1087, - 2661, -2026, -20, 2137, 342, 4076, 482, 5441, - -6, 2126, -143, -1596, 274, 1009, 94, -3446, - 398, 1079, 289, 2042, 883, -2005, -320, 3848, - 395, 472, 615, 3245, 753, -1881, -216, 5670, - -64, -565, -2560, 1574, 772, -3824, 932, 4830, - 1182, -1054, 390, -40, 1833, -350, 151, 149, - -966, -62, -713, -8794, -593, 87, -3523, -243, - 560, -3296, 244, -775, 7174, 749, -271, 8566, - 99, 1258, 1239, -489, -107, -1699, -611, 1046, - 65, -509, 524, -354, 6400, -248, 148, -682, - -93, -1584, -61, 4509, 479, 110, 7116, -295, - 480, 1545, 3, 127, -2292, 894, 1261, -6288, - -45, -410, -402, -356, 2649, 649, 1652, -643, - 6587, 117, 876, -33, 956, -302, 1619, -1023, - -99, 386, -86, -498, 684, 1189, 146, 381, - 9832, -97, 264, 91, -1197, 461, 374, -6788, - 427, 294, -4776, 0, 2868, 5199, 4573, -827, - -1867, 623, -1214, -573, -1099, -1476, 306, -701, - -224, -4261, -1135, 2500, -4758, 1469, -101, 1812, - -129, 15, 760, -149, -892, -1417, 761, 1213, - -417, 1569, -98, 1675, -139, -7382, -633, 2584, - -519, -5483, 29, 320, -383, -596, -295, -357, - -416, 4054, -457, -355, -5213, -840, -319, 1321, - -424, -129, 5225, 181, -2696, -174, -7363, -327, - 519, 860, -5132, 275, -141, 4943, 204, -200, - 2989, 939, 390, -461, -333, -394, -174, 312, - -129, 7257, -402, 860, -1, 2677, 901, 609, - 248, 935, -493, 8147, 2081, -1171, -2145, 1560, - 1634, 55, -1746, 561, -747, 931, -712, -544, - 798, -98, 580, -829, -546, 238, -2052, -197, - 802, 13067, 373, -6438, 1159, -845, 4313, 19, - 670, -627, -944, 1277, -6997, -609, 1913, 607, - -454, -89, 859, -43, -71, 494, 169, -713, - -2014, 1570, -4712, 233, -4113, 210, -3689, 1019, - 200, 49, 1800, -611, -472, 1234, 579, 363, - -134, 233, 101, -5539, 1924, -1734, -982, -928, - -707, -1238, 1586, 3676, 4741, -2770, 3105, 942, - -1933, 1363, 288, -2528, 160, 485, -38, 23, - 113, -19, -518, -110, -173, -170, 589, -473, - 296, -3742, 1109, -2977, 1349, 5899, 98, 3130, - 855, 499, 3, -3111, -592, 572, -890, 687, - 697, 194, -344, 1139, 3255, 1270, -2451, 1958, - -395, 267, -951, -2224, 2108, -11, -3357, 2602, - 2403, 1596, -532, 2701, 2251, -1217, -2148, 691, - -757, -2051, 373, 1964, 1493, 4756, 1246, -4345, - -496, -1333, -20, -84, -1558, 305, 1183, 8148, - -628, -702, -1730, 232, -261, 2732, 245, 353, - -3745, 1013, 186, -2042, 810, -3894, 351, 2501, - 852, 4162, -425, -4941, -1536, 2237, 1348, -4274, -}; - -static const int16_t shape11[] = { - 347, -5391, 106, 156, -182, -36, 177, 401, - 700, 524, -1343, -402, -6982, 63, 194, -14, - 82, -36, -677, -393, 187, 7364, -507, -1173, - -759, -3759, -728, 2970, 1334, 32, -1322, -2965, - 156, -839, 382, -6382, -149, 874, 1352, -35, - -499, 99, -425, -3118, -32, -1596, 5608, -822, - -41, 2974, -592, 615, 1777, 2364, 5189, -4171, - -581, 936, -527, 318, -1606, -551, 5350, -448, - -40, 7476, 189, 319, -1390, 10, -921, 10016, - 573, -1065, 829, -1190, -22, -4263, 87, -1742, - -325, 313, -188, 540, -5542, -188, 511, -168, - -518, 17, 152, 1966, -2568, -860, 2735, -1210, - 404, -144, -6873, -129, 434, -2978, 2829, -48, - -9196, -1829, -11261, 1492, -4938, 1802, 93, 384, - 1340, 236, 10066, 731, 861, -195, -7571, -77, - -481, -700, 4694, -734, -6317, 281, 1773, 175, - -5535, 532, 31, 7012, -637, -3586, 1096, 3596, - -197, -7837, -611, 1825, -26, -259, 2307, 12, - 729, -1958, 156, 262, 5494, 26, -5792, -3146, - 450, -1075, 297, 509, 154, 668, 191, -268, - -1585, 369, 1314, -693, 677, 1482, 198, 378, - 11088, -83, 2321, -193, -1082, -3053, 20, -271, - 12975, 272, 1114, 476, -798, -309, -159, 5406, - -109, -675, 621, -2564, 11190, -1342, -88, 428, - -465, -4633, -503, 106, -9448, -454, -28, -402, - 1271, -7972, 754, -207, -2491, 518, -3701, -542, - -1268, -617, -177, 467, -130, 990, 4087, 857, - -524, -5822, 145, 217, -7703, -275, 6647, -81, - 550, 887, -433, -802, 532, 643, 188, 1965, - -920, -284, 3711, 1196, -8896, -357, -626, 908, - -284, -706, -1582, 182, 7705, -138, -2372, -158, - -888, 4247, 4381, -6722, -1619, -1810, 632, -1176, - -62, 4261, -89, 265, 1405, -1449, -389, -7068, - 258, -244, -272, -8149, 37, -457, -8839, 3243, - -4291, -396, -3935, 907, -58, 2388, -908, -1209, - -635, -487, -1717, 6989, -4834, 2136, -822, -699, - 2187, -96, -9775, -3464, 795, 634, -823, -669, - 146, -843, 15, -227, 671, -707, -10004, 198, - 81, -1611, -34, -2127, -2385, -689, 622, 1834, - -63, -4925, -215, -1181, -514, 7701, 607, 2030, - -264, 2479, 913, 178, 3625, -194, 613, 877, - -384, -7732, 1008, 2117, 528, -301, 540, -80, - 559, 28, 7542, -496, 1146, -6573, -1457, 7789, - -227, -1671, -76, -371, -865, -141, 42, 96, - 277, -410, -5606, 328, -8954, -222, -1792, 981, - -120, -650, 2269, -1412, 1038, -186, -8530, -264, - 2284, -727, 1511, -4611, -1653, 1985, -50, -8985, - -245, -3315, 407, -915, -23, -70, 30, -669, - -303, 902, 84, 433, 217, -8303, 7847, -1865, - -680, 254, -38, 364, 16, 50, 90, -534, - -4649, -800, 969, -1081, 454, 147, -62, 8797, - 84, -912, -518, -351, 76, -560, -1438, 629, - 16384, 656, 151, 880, 396, -90, 752, -138, - -861, 9605, 258, -440, -6441, 434, 5765, 282, - 1494, -260, -180, -769, 7867, -86, 536, -262, - -230, -8956, 5857, -591, 1533, 418, -505, -156, - 1165, 415, -168, -1504, -336, -667, 527, 5725, - 42, 429, 1691, 1, 85, -196, 3681, 36, - 469, -364, 559, 910, -1848, 259, 249, -1688, - 261, -36, -592, -156, -69, -5938, -180, -294, - 22, -903, 1389, 4853, 121, 5185, 970, 1210, - 561, 926, 472, -183, 6623, 357, -78, -5877, - 91, -188, -6746, -146, 342, -5648, 3697, 1336, - 728, -69, 398, 2667, -2103, 1901, -807, 258, - 72, -137, 341, 71, -169, -104, -83, 206, - -420, 1187, 744, 120, -5151, -574, 72, -8553, - -312, 140, -69, 6067, 5229, 202, -1722, -164, - 73, 1695, -1064, 234, 24, 4881, -849, -460, - 8641, -328, -1217, 1666, -283, -76, 2772, 401, - 843, -4756, 297, 8593, 367, -732, -225, -198, - -3936, 248, -436, 473, -19, -441, 164, 220, - -266, 3, 106, -244, -5814, 597, -666, -245, - -9298, -867, -480, 280, -40, -139, -6378, -4972, - -886, 3062, 747, -1991, -1668, -423, 534, 866, - -73, -6501, -195, 324, -51, -123, 298, 500, - 193, 278, -8503, -297, 1034, -16, -209, 7451, - 521, -305, -297, -1537, -3025, 689, 248, 319, - 5393, 1497, 2228, -773, -141, 2184, 1024, -4535, - -9160, -600, -932, -2145, -539, 460, -1943, 4265, - -2512, 4416, -304, 1744, 489, -362, 898, 2236, - -2224, 49, -192, 332, 366, -143, 329, -7747, - -4, 1075, 116, 551, 19, -7, 7090, -169, - 837, -71, -371, 451, -31, 474, 867, -421, - -4544, 78, 3208, -549, 1984, 1386, -2208, -1402, - 1616, 189, -37, -6953, -5733, 1589, -1314, 1040, - -1480, -5608, 2627, 3517, 250, 7930, 94, 4687, - 1522, 5543, -130, -462, 7613, -654, 647, -6187, - 139, 342, 5069, -729, 128, 17, -49, 176, - 122, 826, 503, 76, -196, 15583, 12884, 746, - -3942, 814, -1744, 1774, -338, 3089, -1694, 559, - -5355, 2834, -1448, 108, -329, -711, 350, 171, - 297, -123, 672, 625, -5884, 6822, 842, 276, - 242, -2254, -623, -846, 2441, 887, -2066, -1019, - 1329, 107, -83, 826, -67, -352, 549, 137, - -1023, -184, -11, 13790, 48, 883, 3538, -533, - -5553, 861, 738, -436, -5259, -66, -405, 3777, - -574, 738, 253, 363, -76, 288, 324, -337, - 157, -119, -97, 171, 514, -1932, -5171, 579, - 249, 1072, -204, -194, -311, 655, -6728, 186, - -178, 99, 5749, -329, 419, 924, -1131, 598, - -15, -103, -2277, 186, -716, -542, 153, -226, - 5689, 219, 52, 3706, -917, 140, -10576, -151, - 1060, 645, 404, 1310, 331, 216, -1413, -6030, - -5069, -3992, 1366, 932, 1559, -87, 7799, 3854, - 3762, -1043, 474, 1184, 102, -2775, -1199, -1079, - 358, -63, 9784, 141, 3947, 194, -132, -332, - -512, -212, -5839, -227, 7759, 807, -597, -1782, - -148, -352, -1225, -692, 147, -1970, 3508, -947, - 3463, -197, 4737, -698, 578, -172, -775, 8167, - 3102, 883, -914, 16, 827, 114, -1916, -909, - -606, 87, 1036, -435, 102, 96, -370, -204, - -11952, 21, 477, 1285, 6281, 855, -7717, 1155, - -501, -597, 5943, 145, -630, -3406, 13, -4211, - 679, 6570, -231, -6042, -503, -194, 1437, 5640, - -1222, 8181, 386, -986, -503, 1221, 839, 763, - -277, -1787, -1491, 5, -206, 42, 2800, -332, - -2841, -143, -456, 646, -668, -117, 883, 86, - 7111, -270, 624, -1133, -308, -479, -9149, -1424, - 242, -12048, 8, 2307, -6530, -529, 462, -1346, - -153, 4315, -182, -675, -78, -480, -49, 398, - -408, -1440, 8196, 436, -561, -184, 175, 1799, - -154, -439, -721, 2170, 322, 6555, -539, -1672, - -629, -2985, 239, -37, 7544, -1048, -1241, 7241, - -636, 2044, -750, 1206, 1363, -530, -5960, 342, - -7440, 616, 372, 4572, -118, 343, 1086, 570, - -164, 553, -433, 562, 33, 8225, -235, -234, - 1230, 234, 906, 563, -73, 10464, -353, -644, - -1453, 1119, 237, 670, -112, 7083, -451, 3410, - -105, 3244, -1331, 102, 738, -3602, 76, 413, - -318, 10, -5471, 1024, -335, 246, -7820, -164, - 2515, -1411, 673, 6022, 50, -6715, 268, 2152, - -951, -60, 234, -2085, 342, 3002, -169, 2473, - -667, -6846, 870, 5467, 150, -66, -4294, -299, - -612, -3859, 177, 353, -4726, 547, 340, -5646, - -2022, 117, -4949, -303, 280, -266, -361, 673, - -139, -5, -7123, -264, 243, -5245, 351, 656, - 5005, 682, -107, 298, -79, 1407, -449, -797, - -669, -552, -242, -8013, 56, 4092, 1583, -3981, - -49, -7972, 390, 366, -31, 1126, 272, 5120, - -10, 1147, -3682, -155, 252, 163, 455, 358, - -746, -2719, -431, 444, -433, 432, -357, 5370, - 328, -3, 1748, 514, 7198, -527, 172, 401, - -59, -3586, 1443, 534, 1029, 539, 3723, 5392, - -6619, -2559, 2344, 282, -980, 97, -317, -786, - 475, -8646, 307, 447, -3107, 211, -56, 3344, - -1549, -9223, 454, 352, -27, 205, 503, 260, - -372, -631, -1165, -6543, 444, 1535, 404, -1752, - -43, -9381, 754, -94, -7134, 2064, 170, 8222, - -280, -1250, -347, 1688, -1203, 239, -1048, -4570, - -4720, -434, -1008, -4151, -2211, -1414, -506, -5411, - 5379, 984, 4587, -63, 143, 968, -203, 5315, - 591, -756, 1228, -372, 703, 6829, -76, 6935, - 467, 3119, -2, -3825, 175, -4000, -3012, -7745, - -832, -2582, 173, 1992, 3768, 275, 39, 603, - -536, 5851, 474, 254, -72, 1286, -836, 5576, - 1357, 3524, 406, -9214, -554, 3974, -352, 1763, - -482, 658, 1628, 3885, 1938, 6172, 1693, -5183, - 150, -6729, 1238, 1062, -10035, -428, 48, 421, - -185, 659, -426, -633, 131, -741, 462, -463, - -391, -193, -270, -682, -343, -12130, -86, -148, -}; - -static const int16_t shape11s[] = { - 22, -5296, -415, -206, 306, 265, 189, 376, - 721, -1503, -429, -538, -6008, -97, -385, -570, - -313, -1469, -219, -1661, 10, 6256, -1230, -635, - -28, -4208, -344, 394, 138, 1174, -170, -822, - 114, -1087, -101, -7362, 84, 862, 1514, 341, - -115, 320, -120, -1625, 55, -719, 1443, -733, - -577, 7197, 148, 26, 120, 1969, 4940, -3777, - -607, 1675, 64, -634, -84, 334, 6882, -644, - -232, 5008, -316, -164, -138, -16, 15, 9441, - -74, -65, 262, 834, 1143, -101, 434, -329, - 123, -204, -45, 147, -4586, -742, 464, 1412, - 548, -1602, -56, 1356, -771, 263, 709, -481, - -193, 345, -8395, -41, 36, -1900, -178, 816, - -7590, 31, -3011, -371, -2698, 2234, -99, 0, - 714, -845, 9357, 701, -1269, -187, -4227, -450, - -73, -1637, 4679, -138, -4470, 356, 1416, 1462, - -3162, 453, -61, 5243, -241, -2385, 438, 4919, - -252, -3781, 150, 335, 58, -185, 1870, 179, - 192, -2572, -454, 77, 4819, 1891, -4843, -2106, - -472, -3842, 167, 1092, -671, 194, -870, 139, - -115, -455, 452, -519, 299, 1024, 330, -99, - 11189, 82, 57, -849, 167, -4190, 639, 768, - 7477, 626, 94, -1259, -303, 181, -280, 2873, - -589, -461, 1591, -29, 6940, -1264, 120, -282, - -159, -3755, -4, -61, -10172, 152, -12, -200, - 111, -8471, -243, 400, -842, 1661, -3099, 500, - -451, -423, -193, 230, 423, 263, 5011, 1010, - 1044, -4781, 707, 84, -6091, -213, 5193, 434, - 534, 1100, -520, -1590, 75, -322, 2, 2008, - -534, 153, 2641, 1510, -6830, -246, 4, 271, - 75, -1308, -1934, -257, 6748, 589, -301, 627, - 1197, 3708, 4450, -5582, -1312, -2859, 881, 429, - 552, 738, -882, 984, 488, -868, -464, -6969, - 721, -2078, 417, -6121, -184, -128, -7840, 2659, - -2584, -254, 176, -790, -727, 482, 357, 104, - -441, -158, -980, 4563, -4098, 1086, -1217, -562, - 2033, 512, -8331, -3506, -73, 808, -372, -1602, - 748, 911, -599, -1499, 58, 309, -10000, -115, - 70, 1603, 280, -146, -817, 517, 18, 1355, - -121, -4134, 152, -1300, 247, 7258, 415, 130, - -27, 2108, 337, -816, 2480, 396, 533, 66, - -171, -6213, 47, 3081, -648, -930, 1810, -233, - -433, -588, 5526, 58, -18, -3498, -381, 8009, - 7, 1229, 152, -410, -567, 423, -354, 463, - -82, -146, -2868, 271, -5773, 2694, -1006, 150, - -113, -521, 2553, -278, 593, -69, -6517, -785, - 369, -2483, -216, -3144, -889, 1724, -168, -6303, - 171, -1895, -798, -137, -172, -746, -54, 162, - -607, 409, 201, -284, -143, -10681, 7747, -1148, - 303, 58, 4, -96, -485, -146, -286, -577, - -644, -512, 236, 576, 421, 93, 293, 10284, - -2, -117, -590, -546, 350, 445, -301, -300, - 10823, -224, -96, -551, -148, 1042, -125, 224, - -706, 8583, -195, 52, -2732, 200, 4419, 390, - 870, 100, -184, 233, 6179, -317, -472, 1964, - -302, -8722, 2509, -644, 488, -3101, 891, -253, - -38, 133, -15, -1365, -779, -612, 673, 5587, - 834, 377, 835, -2018, 75, -185, 3641, 121, - 693, 63, 503, 646, -7, 348, 141, -1311, - 532, -513, 95, -315, -65, -6478, -16, -848, - -210, -120, 676, 5125, 533, 4147, -622, -4, - -150, -1507, -124, -185, 5365, 267, 1073, -4479, - 173, -204, -4164, -952, -23, -4088, 1391, 205, - 712, -473, -373, 547, -685, 4542, -49, -71, - 33, -271, 132, 246, -188, 6, -309, 118, - 96, 1774, 158, -83, -3573, 1175, -122, -6619, - -1677, -1161, -266, 4776, 3453, 62, -346, -450, - -1380, 103, -457, -1260, -71, 4271, -338, -1394, - 6462, 395, 647, 2430, -735, 444, 1837, 403, - 144, -5573, 211, 4608, -15, 804, 70, 1969, - -3451, -138, -352, 1176, -171, -518, -114, -88, - 335, -308, -64, -428, -4115, 318, -205, -126, - -7854, -609, 105, 144, 270, 266, -4543, -5246, - -311, 587, 305, -115, 372, 727, -294, 414, - 877, -7899, 411, -538, 394, 535, 233, -826, - 329, 491, -4848, -650, 331, 1026, -140, 6474, - 194, -457, 98, -871, -2293, 873, 353, 812, - 4510, 1102, 379, 651, -214, -110, 20, -2749, - -8040, -96, 221, 221, -39, 444, -280, 2814, - -536, 3509, 111, 830, 594, 553, 47, 2812, - -1898, 203, -353, -60, 371, 181, 824, -5448, - 297, 476, 42, -133, 97, 425, 8586, -317, - 121, 453, 1014, -350, 175, 747, -78, -287, - -5832, 625, 4170, -308, 1853, 2846, -3, -876, - 535, 431, -411, -2139, -6021, 374, 298, 1572, - 19, -4069, 1567, 144, 3, 5541, -438, 920, - 87, 1728, 230, 807, 5848, -413, 7, -6241, - 214, 205, 1312, -675, 70, 264, 114, -24, - -482, -72, -296, 327, 249, 11047, 11070, 18, - -937, 350, 22, 362, 555, 815, 130, -125, - -4545, 2662, 203, -318, -305, 323, 633, 416, - -254, 301, 99, 407, -4951, 4766, -790, 1334, - 912, -1046, -350, -135, 3744, 22, -1647, -422, - -151, -113, -130, -345, -2, -263, 18, -24, - -771, -34, -543, 10259, 183, 0, 1743, 1267, - -2554, 320, 611, -1064, -1446, 875, -808, 4865, - -816, 3452, 68, 326, -178, 177, -10, -138, - -33, -93, 65, 264, 185, -157, -5749, 110, - 407, 1240, -698, -61, 176, 1557, -6012, -606, - -555, 458, 3226, -939, 933, 153, -32, 928, - 69, -490, -1543, -87, -20, -196, -327, 423, - 7911, -189, 178, 335, -194, 459, -10572, -196, - 174, -286, 502, -1041, 12, 39, -101, -3983, - -1650, -2902, 386, -151, 1051, -619, 6854, 3408, - 1140, -1854, -755, -40, -1108, -1502, 221, -397, - 375, 1081, 10375, 389, 270, -239, 311, -212, - 384, 1237, -2951, 199, 5281, -56, 34, -704, - 942, 1169, 33, -310, 97, -1216, 3023, -836, - 3256, 404, 3951, -257, 2139, 111, 179, 8255, - 611, -240, -252, -367, -251, -296, -2282, 957, - 61, -265, 720, 232, 34, 146, 204, -290, - -9923, 529, 65, 696, 2958, 352, -3852, 1248, - -743, -395, 5969, 92, -132, -1206, 314, -4013, - 717, 5157, -770, -1878, -1201, -958, 525, 4028, - 116, 6772, -45, -1086, -335, 5815, 51, 57, - -85, -2301, -133, -300, 7, 227, 3429, -1075, - -4353, -832, 30, 1259, -484, 451, 604, -717, - 6765, 294, 118, -410, 299, 592, -3845, 66, - -502, -9088, -74, 259, 450, 475, 202, -1792, - 23, 4719, 709, -398, -1676, -351, -898, -622, - 145, -1392, 7305, 1014, -80, 519, -2065, 1531, - 860, -1448, 134, 1683, 689, 7179, -345, -327, - 1004, -2467, -340, -1302, 5825, 373, 50, 6796, - 314, 13, -270, -426, 702, 279, -4392, -508, - -6521, 60, -278, 2479, 847, -360, -68, -1948, - 91, 969, 421, 459, -341, 6020, -550, -77, - -687, -754, 5, 109, 410, 10860, -183, -317, - -734, -87, 501, -601, 158, 5836, -1057, 1236, - -850, 2965, -330, 547, 1249, -2804, 127, 218, - -455, -805, -4002, 108, -569, 660, -5356, -1091, - 581, -445, -311, 6409, 510, -6789, 519, 1607, - 296, 342, 368, -1440, -846, 1997, -227, 2332, - -2062, -4657, 1030, 5322, 135, 131, -3414, 320, - 1030, -3341, -256, -373, -4565, 1222, 171, -4972, - -1444, 303, -5427, 435, 208, 251, 467, 539, - 136, 199, -8876, -195, -771, -3096, 740, 368, - 1047, -490, 83, 485, 168, 531, -635, -801, - -953, 4, -95, -7603, -59, 2023, 739, -702, - 263, -9230, -313, -997, -510, -772, 156, 3986, - -113, 398, -2602, -1079, 195, -211, 128, 1917, - 221, -965, 11, 71, -101, 180, -36, 7839, - -144, -722, 288, 429, 5704, -984, -510, 775, - 440, -1849, -1348, 1989, 300, 43, 1928, 4341, - -3840, -2427, 2025, -660, -293, 23, -249, -177, - -327, -7858, 33, 245, -1334, 237, -687, 2800, - 30, -8807, -404, 43, 183, 289, 528, 510, - -197, 590, -94, -5423, 381, 1317, 141, -1639, - -432, -7628, -224, 56, -7788, 113, 134, 6981, - -636, 756, -743, 97, 159, 1263, -143, -2941, - -2680, -479, 1395, -1667, -472, -992, -451, -5708, - 4262, 334, 3053, 76, -584, -599, -276, 3518, - 264, -2118, 358, -106, 911, 5053, 480, 4538, - 949, 5203, -103, -14, 177, -3397, 55, -6813, - 680, -1788, 145, 2267, 1104, -789, 54, 261, - 228, 5494, 15, -224, 192, 740, 0, 7632, - 398, 2879, 430, -8212, -657, 815, -228, -488, - -90, -1296, 595, 2979, -15, 4055, -252, -3883, - -935, -7654, 330, 97, -10200, 462, 223, -1017, - -309, -342, -124, -1258, 211, 351, 316, 414, - -91, -18, -202, -74, 410, -11127, 326, 261, -}; - -static const int16_t shape16[] = { - -855, 1549, -4841, 629, 932, -5896, 840, -2041, - -305, -2574, 343, -31, -780, -773, -353, 403, - -1907, -2371, -555, -324, -479, 6961, -286, -4290, - 626, -953, -14, -1681, -443, 1504, -366, 513, - -1206, 870, 9239, 112, -213, 425, 381, 1802, - 750, 594, 61, -152, -2060, -8997, -752, 197, - -493, -176, -389, -591, 2988, 654, 2404, -204, - 304, -279, 202, 66, -185, 415, 159, -1514, - -6775, -37, -2617, -1246, -4012, 1208, -554, 3240, - -655, -394, -1464, -4448, 388, 1058, -364, -1760, - 1081, -558, -116, -108, 99, -925, 763, -1301, - -251, 258, -33, 311, 555, 227, -279, -601, - -135, -675, -10615, -937, 158, 503, -2044, 1075, - -114, 4278, -9040, 67, -1076, -705, -122, -533, - 3299, -1826, -1316, 708, -3840, -740, -370, -1074, - 87, -462, 2177, -1177, 57, -6311, -170, -777, - -256, 435, 291, 10371, -82, -425, -1757, -196, - 3824, -6289, 62, 4506, -519, -783, 1155, 878, - 295, -2044, 305, 186, 263, -1716, -482, -5678, - 415, 2709, 213, 7531, 1376, 813, 1803, 190, - 398, 6483, 1425, 235, 2713, 520, -2892, -1191, - 6074, 654, -6535, 320, -736, -478, 2563, -309, - -3477, -155, 275, 1024, 390, -386, -331, 14043, - 251, -410, 1496, 24, 1272, -816, 549, -238, - -2489, 158, 194, 1, -306, -3088, -264, 200, - -30, -520, -472, -30, -464, -764, 440, -659, - 88, 778, -31, -1794, -3817, -344, 887, -551, - 115, -763, -5338, 2906, 50, 736, 5536, -1101, - 330, -405, 416, 1022, -93, 71, 10034, -200, - -1258, -3405, 480, 141, 399, 500, 311, -503, - 301, 4398, 454, -922, 975, -101, -775, -81, - -1723, 1077, 857, -1682, 813, 847, 342, -276, - 3582, 2991, 5571, 713, 1280, 596, -1325, -1087, - -681, 1411, 391, -1728, 492, 544, 1512, -724, - -7445, -426, 6, -534, -3643, -1598, 2650, -834, - 2096, -333, 67, 1746, -1584, -1003, 1272, 1710, - 1666, 176, -11716, 329, -1829, 385, 802, -382, - 2244, -8, -222, -2351, 369, -1067, -9354, 293, - -51, -1849, -500, -2350, -1824, -826, -450, -2155, - 456, 245, 1796, 320, -73, -306, -122, 290, - 118, -298, -675, -180, -828, 86, -44, 165, - 435, -8249, 769, 630, -1670, -762, 453, 5893, - 259, -92, -1003, -358, -32, -1350, -535, -289, - 409, -558, -344, -752, 6037, -680, 2471, 581, - -351, 1251, -5827, 194, -104, 815, 1257, -619, - 243, 410, 4455, -969, 50, 1286, -1013, -293, - -7740, 73, 615, 523, -149, -824, 2235, 1571, - 970, 944, 4778, -132, -5082, 83, 129, -820, - -803, 694, 1615, 1163, 517, -402, -80, 762, - -107, -419, 142, -294, 11298, 301, 484, -513, - 105, 547, 1130, -4253, -742, 376, -1545, 1076, - 4372, 2338, -2847, 495, -190, -2444, 931, 6487, - 117, -1273, 1488, -75, -322, -487, -2614, -251, - 1233, 4111, -321, -219, -7961, -11, 107, -808, - 450, 111, 4395, 89, 772, -1878, -1894, 1075, - -544, -9467, -459, 637, 842, -956, -738, 4452, - 777, -75, -209, -302, -796, 785, -7413, 321, - 649, -55, 114, 43, -1026, -223, -611, 209, - -5543, 8206, 907, -3358, 1452, -543, -3173, 525, - -95, 35, -475, -525, -705, -569, 350, 206, - -108, -1523, -680, -283, -2583, -4992, -59, -968, - -1719, -2750, 5884, 455, 29, 436, 784, -101, - -216, 110, 612, -511, -12, 98, -67, 177, - -1210, 222, -345, 243, -12670, -472, 282, -2149, - 687, -2631, 4434, 77, -521, -404, -934, 212, - -695, -369, 1138, 1348, -905, 501, 299, -10467, - 1018, 818, 1941, 31, 257, 1219, 944, -157, - 1968, -1649, -126, -440, -599, -1, 6190, 2574, - -332, 753, 195, -131, 5972, -297, 672, -86, - -143, -303, 5, -121, -154, -613, 5541, -1516, - -304, 962, 69, -1857, 4142, -134, 706, 896, - -1226, -135, -310, -9261, 1135, -3437, 620, 802, - -33, -582, 1909, 1407, 242, 2599, -1533, -279, - 836, 8070, -1207, 5745, 200, -77, 162, 781, - -466, -1555, 3297, -957, 225, 1290, 7, 677, - 41, -549, -2778, 1400, 379, -3367, 369, 615, - -6402, 527, 58, 5679, -114, -180, 2842, 88, - -2611, -50, 371, 161, -444, 2062, -38, 272, - -8562, 769, 18, -2593, -226, -503, -959, -1295, - 189, -371, -675, -1528, -98, 514, -1236, 116, - 202, 13662, 1596, -328, 61, 3567, -486, -3316, - -8473, -317, 2868, -419, -17, 535, -965, -503, - -3848, 2222, 620, -1740, 2, 6505, 473, -297, - -70, 3043, -51, -1520, 993, 1046, 1965, 3240, - 1971, -60, -650, -53, -248, -4428, -365, -3723, - 1122, -1681, 1629, 1358, -17, 1136, -256, 2344, - -282, 156, 127, -155, 318, -1281, -1066, 57, - -889, -253, -1396, -579, -920, -1006, -9202, -703, - 195, 5186, 241, 1742, 996, 118, 1431, 4415, - -2452, 6837, -1272, -569, 3485, 328, 441, 832, - 553, 94, 648, 92, -378, 11167, 775, 457, - 1712, -24, 941, 5433, -1645, 2166, 249, -55, - -1816, 383, 735, -876, 443, -568, 293, -1266, - 6963, -178, -174, -1186, 1119, -208, 821, 1499, - -1496, -2171, 1434, 874, 133, -7466, -545, 2193, - -775, -1405, -1205, -575, -1996, -645, -552, -263, - 8861, -517, 76, -992, 278, 2417, -1369, 35, - -1461, -1399, 517, 185, -2895, 347, -3871, 3644, - 284, 3284, -12, -169, -1981, 1196, -67, 2868, - 910, 134, -530, 150, -1328, 1902, -746, 351, - -222, 522, -5702, 797, -1900, 241, 2270, 764, - -335, 1348, -349, 784, -1586, -537, 148, 3211, - -1692, 56, 1678, -321, -290, 7902, 69, 52, - 310, 337, 250, 596, 9998, 336, 1037, 163, - 64, -441, 2894, -1033, 730, -718, -1252, 459, - -131, 7840, -922, -555, 5671, 299, 689, 1115, - -646, -505, -263, 608, -494, 0, 442, -1802, - -598, -701, -4184, 70, -1319, -90, 9155, -339, - 0, 121, 462, 735, -639, 481, 125, 6924, - 3379, 683, 3053, -1219, -499, 1067, -148, -2705, - -11, 795, 1675, 898, 226, 1232, 49, -572, - -9309, 2223, 949, 767, -821, -91, 1075, -352, - -7829, 554, -593, 1284, -245, 1239, 1166, -1157, - -5274, 808, 871, -1446, 7575, -397, -755, 752, - 4193, 179, -205, -37, -750, -2675, -407, -700, - 220, -77, 1604, 63, 461, -9994, -645, -1629, - 103, 576, 132, 10005, -49, -1005, 97, -1608, - 515, -10, -146, -1878, 880, 429, -1271, 996, - -365, 76, -409, 2461, 29, 1159, 217, -6240, - -200, -746, 118, -1884, 457, -816, -608, 3215, - 244, 749, 2268, -236, -1276, -278, 1392, -1767, - 1255, -1474, -8136, 1388, -770, 225, -443, 10, - -392, 659, -1118, -1651, -514, -935, -111, 1112, - 973, -247, -235, -13010, -737, 40, -141, 5167, - -910, 279, -467, -3762, 847, -3935, 1018, 1922, - 830, 190, 253, -1130, -415, 371, 718, 3833, - 1036, -5358, -928, 866, -514, 2724, 2354, 449, - 210, 1462, 680, -1880, -62, 10988, 809, -602, - 145, -536, 114, -147, -568, 3193, -322, 892, - -637, -1381, -65, 761, 1615, 5025, -327, 4941, - -631, -5225, 1204, 3042, 998, -1047, -959, -106, - 1610, -151, 120, -1152, 191, 30, 11963, 101, - 18, -410, -1288, 370, -771, 1337, -544, -613, - 289, -117, 1625, -4506, 2582, -1690, -105, -5324, - -93, 285, -1167, -3564, -729, -4790, 595, 275, - -216, -217, -6000, 682, -171, -875, 224, -164, - 2919, 796, -81, 1434, 186, -375, -4113, -179, - 277, 1363, -453, 2505, 388, -1840, -165, -4800, - -42, -6632, 54, -735, -553, -1679, 917, -2, - -632, 417, -478, -494, -265, 73, -372, -360, - 179, -448, 265, 299, -152, -211, 12730, -77, - 1954, -534, 773, 524, 438, 1901, -4413, -358, - 1552, -248, -1588, -122, -127, 5405, 226, -849, - -7495, -357, -89, 185, 746, 851, 669, 305, - -247, 3457, -193, -161, 638, 600, 610, 855, - -1292, 398, 1528, 2250, 1651, -8414, 763, 1529, - -346, 3769, -111, -6494, 347, -742, 1941, 1967, - 582, -5499, -765, -818, 1850, -1604, -243, -943, - -11, 884, -2996, -2375, 1010, -374, 6605, -287, - -5073, 211, -758, 703, -2607, 747, -130, -429, - -2481, 4894, -457, 3225, 958, 8533, 542, 6177, - -1069, -1210, -963, -5943, -86, 1424, -567, 827, - -510, -6577, -258, -4, -4430, 115, 5401, 1390, - 354, 1755, -998, 852, 993, -481, 218, -987, - 779, -417, 591, 6011, 528, 289, -336, -558, - 60, 9124, -174, 235, -239, -144, -260, -3472, - 746, 4781, 652, -4831, -739, -21, 864, -2310, - 652, 7147, 116, -318, -50, -3485, -325, -345, - -5784, 1144, 2399, -1443, 991, -2318, -785, -281, - -207, -1448, 309, 1001, 952, 1472, -5901, -780, - -2459, 1518, 9878, -1229, 670, -523, 1217, -164, - -55, -95, 243, 7909, 86, -4380, -859, -599, - -183, -2339, 774, -1210, -502, -899, 53, 1039, - 34, -7753, -296, -1951, -4559, 1182, -150, 2878, - -4910, 2761, -1481, 2048, 2600, 1808, -2953, -2257, - 62, 162, 1115, 214, -4510, 926, -6669, 1443, - -124, 193, -314, 302, 699, -18, 745, 341, - 895, -615, -295, -181, 143, -427, 6528, 1074, - -1126, 374, -298, -1274, 22, 887, -511, -1057, - 3228, 722, 607, 624, -95, 11085, 1006, -788, - -285, -92, 1342, -325, -828, 42, -3588, -631, - -576, 4559, -668, -1294, 1739, 1697, -647, 2336, - 376, -120, 1350, 646, -325, 95, 5974, 775, - 199, -8557, 931, -336, -651, -561, -433, -2266, - -129, -657, -1184, 67, 577, 617, 1880, 552, - 90, -617, -273, -1571, -7481, 261, -26, -20, - -459, -1028, 57, -8516, -43, 2774, 1, -4238, - 680, -3310, -56, -152, 548, -1983, 920, 899, - 2180, -307, -2230, -1685, -998, 2091, -112, 21, - -1551, 1182, 6649, -326, 792, 1818, -7596, 563, - 1076, 7422, -908, 1524, -223, 5798, 1318, -3376, - 517, 4162, 756, -4142, 1776, 390, 334, -44, - 218, 5290, 792, 39, 1692, 542, -62, -595, - 590, 27, 8922, 989, 182, 725, 112, 458, - -9170, -1000, 1176, -1290, -1403, -726, 5990, -297, - 1234, -1724, -601, 528, 1072, 184, -146, 61, - 685, 1208, -88, -211, 356, 9569, -363, -135, - -159, -1061, -105, -410, -58, 335, -9986, -300, - -211, 607, 443, -410, -1730, -328, 275, 579, - 805, 899, -464, -18, 296, -446, 2396, -13, - 414, -9662, -385, -808, -1867, 154, -572, 3351, - -1839, -80, 1157, -326, 481, 8815, -1039, 1065, - 2110, 1223, -960, -33, -464, -5660, 490, -314, - 346, 730, -387, -1102, 6656, -719, -1173, -57, - -1186, 2394, -1300, -665, -586, -39, -71, 155, - 1184, 4, -3269, -333, -747, 580, 279, -583, - 7164, -185, 110, 2465, 428, 507, 4462, -4461, - 199, 337, -3597, -249, -70, -680, -5549, 1533, - 917, -303, -9230, -431, -124, -1019, 369, 139, - 1367, 151, -1047, 6820, -151, 222, -2934, -817, - 971, -7325, 556, 1035, -1240, 3115, -1326, 4012, - 2812, 1057, 2580, -261, 3989, 1999, 1624, 2402, - -310, 779, -354, -377, -149, 1035, -2363, 358, - 3666, -246, -1896, 375, 3919, -1392, 683, 624, - -5872, 644, 391, 288, -198, -237, 68, -284, - 88, -1016, 250, 32, 1188, -243, -608, -320, - -219, -11087, 543, 156, 1034, -169, -183, -549, - -66, 716, 996, -928, -309, 5577, 229, 125, - -1328, 9027, -698, -485, -1694, 839, 343, 449, - 1655, 1005, 1053, -408, 9106, 186, 670, 774, - 314, 573, 3888, -882, 26, 2518, -533, -195, - 555, 337, -246, -10779, -231, 31, -314, -941, - 1129, 333, -7503, 168, -551, 237, -159, 4399, - 421, 693, 198, -196, -561, 1035, -548, 1058, - 527, 3617, -361, 1317, -1975, -2638, -1966, -120, - -324, 5678, -2252, -663, 181, -273, -3073, -282, - -622, 363, 71, 184, -776, 284, -1516, -430, - 3, 937, 8587, 258, -1060, -1555, -830, -338, - 318, -9130, -110, 459, -572, 70, 93, 120, - -534, 1296, -168, 29, -914, -332, -997, -818, - 270, -243, 523, 56, -11847, -448, 11, -154, - 164, 2115, -13, -635, 708, -663, 43, -248, - -3244, 254, 19, -1125, 508, 154, 8697, 191, - 595, 4393, -2806, -168, -1916, 393, 3976, 897, - -1716, -35, -180, 605, -1057, -1194, 100, -384, - -37, -107, 2739, -207, 6899, 176, 81, -901, - 1280, -1670, -101, 281, 1147, 48, 21, -151, - -1236, 210, 98, -114, -573, 7940, -153, -302, - -1331, 337, -322, 6598, 477, 147, -999, -3166, - -232, -5104, -799, -1866, -58, -4213, 1376, 181, - 675, 562, 126, 235, 2260, -5152, -243, -699, - -1476, 4135, 569, 567, 737, -4163, 613, -1057, - 1778, 546, -450, -24, 325, 366, 2406, -1319, - 60, -5126, 49, 657, -5937, -194, 882, 3267, - 178, -298, 1873, 12422, 459, 272, 195, -1827, - 212, -802, 730, 471, 1556, 422, 640, 236, - 71, 597, 5783, 5378, -649, 1524, 829, 437, - -351, -122, -1400, 2119, -128, 75, -1677, -633, - -322, -6382, -573, -974, 1672, -378, -242, 3708, - 79, -1325, 397, -150, 1977, 442, 747, -127, -}; - -static const int16_t shape16s[] = { - -392, 96, -7720, 99, 524, -8272, -20, 164, - -434, -85, -428, 1362, 108, 223, 1053, -11, - -193, -5140, -191, -159, 193, 8005, -39, -483, - 1764, -1061, -268, -318, -880, 474, 49, -8, - -223, 130, 11263, 165, 12, -43, -103, -1145, - -588, -81, 299, 73, 444, -7243, -1411, -640, - -946, 16, -881, 496, 2403, -476, 1090, -294, - 29, -148, 109, 145, -52, 247, -545, 1115, - -7451, -491, -1459, 397, -8603, -1022, 1494, 298, - -5156, -358, -1097, -2911, 423, 652, -378, -2357, - -74, 415, -367, 402, 2173, -154, 122, 283, - 1352, 302, -373, -431, -283, -109, -64, -343, - -108, 55, -14644, 241, 37, -723, -71, -208, - -126, 4061, -9887, 494, 2273, -505, -4040, 66, - -806, -1121, -1894, 783, -1445, 426, -820, -1739, - -11, 650, -282, -518, 124, -7266, -21, 160, - -339, 5, -208, 11712, 198, -53, 921, 89, - 5987, -4806, 176, 1884, 64, -517, 2169, 108, - 297, -111, -389, -840, 663, 75, -485, -4862, - -177, 2663, -229, 8120, -219, 462, 3104, 955, - 384, 1310, -73, -504, 258, 170, -1796, -482, - 5691, -437, -8474, 583, -1685, -827, 292, -65, - 1994, -384, 105, 123, 256, -82, -367, 15204, - -128, -260, -10, 169, 249, -1286, 1055, 136, - 678, 61, 1420, -159, -15, -221, -250, 107, - -21, 297, 54, 242, -111, 468, 237, -36, - -159, 37, -102, -488, -4577, 72, 1009, -1, - 1218, 2023, -640, -437, 766, -299, 6144, 184, - -1023, 171, -388, 884, -1294, -320, 8718, 896, - -295, -976, -803, 3092, 1720, -255, -1354, -665, - -63, 4382, 41, -121, -157, 354, 127, 587, - -599, -231, 484, -150, -284, -498, -511, 79, - 5503, 13, 6537, 761, -1619, 1164, -2403, 3057, - -4966, 724, 1076, -1555, 889, -365, 60, -440, - -7144, -132, 283, -305, -126, -1482, 125, -52, - -33, 1284, -961, 1355, 953, -1012, -227, 86, - 731, -14, -15977, -56, -875, -1676, 127, 500, - 3390, -14, -319, -644, 143, 249, -10752, 23, - 54, -1075, -111, 680, -1714, 328, -2092, -852, - 622, 949, 61, 6, -17, 144, 190, 216, - 130, -65, 27, -322, -139, 43, 89, 76, - -84, -10120, -47, 367, -261, 38, 50, 4233, - -210, 14, -1, 25, 762, -299, -132, 177, - 974, -492, -145, -43, 5105, -394, -196, -91, - -25, 473, -8358, -476, 589, -1372, -254, -2387, - -293, -304, 3828, -254, -193, 493, 54, -108, - -8789, -262, -233, -821, -222, 714, 1270, -61, - 892, 13, 3952, -36, -1567, -620, -126, -1056, - 587, 390, -24, 2027, 267, 218, 15, -56, - -130, 40, 551, -29, 14594, -23, 106, -14, - -172, 279, 427, -241, 303, -20, -748, 55, - 5187, 598, -217, 2026, 643, 118, 911, 8023, - 296, 791, 39, -2621, 655, 228, -671, -272, - -176, 6644, -166, -264, -10429, 91, -83, -684, - -169, -344, 2123, -102, -333, -317, -826, 586, - 116, -9311, 445, 141, -1315, -758, 144, 5620, - 363, 66, 142, -161, -684, 454, -6584, -205, - 577, 205, 305, -1536, -4109, -318, 121, -323, - -1036, 8020, 1146, -4004, 175, -1568, -1537, -525, - 2284, 62, 11, 640, 1243, 260, -104, -344, - 102, -624, 122, -300, 266, -6104, -1149, 412, - -1380, 22, 7561, 360, 564, 398, -338, 174, - -76, 131, 44, -426, -12, -175, -113, 78, - 293, -120, -92, 331, -16163, -74, -101, -1198, - -298, -171, 4052, -139, -187, 131, 323, 370, - -144, -160, 131, -284, -190, 83, 878, -14817, - 14, 196, 198, 294, -120, 40, 800, 1841, - 393, -168, 337, -540, -356, 130, 9210, 880, - 304, -2304, -275, 1394, 9903, 673, -62, -4706, - -130, 274, 528, 89, -458, -90, 6318, -133, - 310, -5953, 682, 37, 2937, -371, 197, 77, - -184, 1240, 22, -7695, -171, -4874, -676, -1121, - -842, -642, 1160, -1088, -864, 352, -790, 794, - 801, 10564, -1777, 1095, -441, 1718, 116, 982, - -268, 199, -2408, -2042, 279, -146, 645, -1350, - 5, -150, -932, 113, 25, -672, 153, 158, - -6140, -262, 142, 4815, -1, -424, 810, 63, - 88, -510, -236, 3964, -66, 1229, -16, -758, - -11023, -1149, 48, -1756, 167, 2308, -96, -654, - -639, 369, -221, 47, 202, 329, -352, -26, - -19, 13198, -383, 124, -1211, 3879, -344, -1954, - -8702, 32, 924, 472, 7953, 692, -216, -415, - -3174, -1959, 935, 4048, 155, 7521, 854, -157, - 643, 3760, -107, -2536, 622, -742, 1881, 2262, - 758, -968, -271, -131, 385, -5107, -212, -2548, - 29, -132, -506, -190, -1065, 314, 202, 332, - -2274, 701, 4, -22, -439, 198, -265, -92, - -143, 460, -32, 189, 334, 87, -7639, 45, - -387, 4240, 1231, 92, 1032, -333, -280, 2061, - 296, 365, 2003, -426, -35, 96, -62, 882, - -784, 483, -128, -143, 474, 13740, -166, 184, - -714, 142, 278, 5622, -67, 282, 647, -130, - -31, 300, 727, 728, 409, 178, -601, 84, - 8305, -446, 179, 115, 209, -273, -47, 1932, - -255, -3171, -102, 461, -119, -8102, -809, 108, - -1680, -3171, -775, 324, -246, 132, -27, 84, - 8495, -45, 153, 21, -1384, 290, -869, 38, - -440, 133, -257, -22, -3046, 12, -2797, 4517, - 142, 1605, 423, 579, -558, -301, -257, 701, - -246, -468, -1946, 120, 321, 710, -217, -203, - -50, -44, -5866, 80, 259, 488, 754, 124, - -517, 703, -197, 146, 576, -717, 247, 4121, - 10, -422, -2686, 329, 1183, 14573, 72, 301, - 2043, -125, -1420, -1263, 10340, -678, -1226, 330, - -62, 173, 5885, -56, -178, -1090, -616, 953, - -216, 8277, -124, 411, 7758, -78, -326, 786, - 46, -1365, -555, 479, -774, -576, 8, 304, - 390, -186, -820, 72, -67, -585, 11070, -213, - -12, 344, -399, -748, -150, 2719, 195, 5652, - 4626, 549, 2782, -4, 1928, 482, 1008, -6398, - 843, 457, 1843, 269, 1247, 350, -661, -35, - -6477, 3727, 2313, -424, -907, 415, 1075, 3960, - -1499, 61, 594, -744, 110, 2486, 967, 27, - -5263, -618, -578, 313, 7055, -1081, 739, -492, - -2051, 317, 112, -155, -304, -507, 150, 253, - -42, 221, 92, -275, -355, -8494, -663, 109, - 282, -836, -271, 9316, 165, 63, -171, 10, - -38, -180, -219, -250, -924, -573, -241, 566, - -175, 20, 454, 251, -328, 236, -215, -5673, - 0, -265, 225, 354, 113, -488, 174, -132, - 134, -188, 1255, -94, -55, -193, 404, 504, - 784, -377, -5731, 333, -447, 222, 138, 72, - -256, -58, -230, -169, 728, -481, 95, -394, - -74, -489, -253, -13770, 61, 184, -36, 5025, - -232, 321, 253, -3414, 120, -2512, 799, -586, - 1186, -1135, -955, -54, 7, 83, 0, 5259, - 466, -6358, 254, 388, -211, 207, 2449, 379, - 430, -219, -442, 228, 151, 11819, 67, -101, - 239, -282, 121, -270, 1209, -386, 553, -108, - 789, -518, 237, -48, 497, 8986, 80, 8232, - -89, -359, -803, 473, 995, 1132, 624, 1353, - -305, 711, -71, -26, 18, 254, 13079, -72, - 178, -18, -116, 293, 155, -254, -819, -166, - -808, -190, 150, -4328, -33, -14, 272, -6417, - 78, 78, 67, 310, -177, -435, 225, 610, - -15, 1, -6706, 30, 1, -189, 270, -21, - 276, -182, 77, -231, 30, -116, -7713, 158, - 344, 560, 1466, 3575, -84, -4583, -1260, 372, - 1395, -5223, 284, -1911, 315, -2312, -47, -207, - 414, 129, 36, 85, 317, -125, -63, -212, - -76, 130, -385, 157, 117, 12, 16140, -171, - 375, -721, 161, -342, 950, -667, 1011, 15, - 536, -1203, 1039, -242, -159, 7664, -429, -264, - -8221, -109, 867, -74, -79, -414, 544, 206, - 120, 1859, -44, 73, 554, 121, -160, -127, - -33, 44, -24, 285, 589, -12514, 51, 464, - 17, 264, 58, -6861, 367, -672, 227, 2793, - 782, -6286, -420, -808, -1247, 895, 950, 1533, - -1079, -207, -1927, -4947, -803, -328, 7677, -386, - -4608, -329, -485, 2365, -1492, -1738, -378, -707, - -1850, 9044, 314, 3530, 61, 2921, 79, 9508, - -1102, -3487, 814, -2828, 550, -929, -712, -274, - -566, -2521, 536, -296, -97, 951, 11352, -614, - 106, -342, -1017, -1183, -157, -457, 266, 109, - 545, -313, 1015, 6961, 52, -224, 2247, -248, - -180, 12367, 311, 514, 1218, -561, -2546, -3275, - 218, 8281, 187, -6550, -96, -1001, 1777, 89, - 916, 1042, 399, -267, -97, -3552, 397, 1984, - -6134, 784, 2136, -1346, 619, -1450, -1022, -1226, - 185, 306, -274, -122, 343, 129, -4481, -749, - -759, -496, 8785, -178, 457, -601, 875, 1040, - -268, -1592, -531, 9667, 360, -4978, 525, -436, - 123, -1566, 227, 820, 74, -5, 1477, 154, - -1589, -9411, 248, -485, -3293, -690, 175, 53, - -21, 303, -2376, 106, 515, 2688, -401, -1278, - 425, 540, -353, 662, -7461, -397, -7029, -976, - 445, -1648, 164, -254, -563, 556, 876, -205, - 884, 214, -92, -509, 96, -53, 5734, -295, - -136, 211, 168, 261, -74, 411, 25, -59, - 3596, 400, 320, -69, -21, 14062, -510, 142, - -232, 1597, 34, 240, -476, 131, -3836, -186, - 2579, 2812, -1501, 274, 2685, 2809, -1100, 2696, - -402, 67, 650, -1804, -11, -216, 6751, 112, - 455, -7210, -251, -1075, -833, -966, 1443, -138, - 273, -494, 1557, -15, -339, -82, 402, 206, - 31, -77, -94, 78, -5468, -179, -44, 421, - 163, -386, -133, -6334, 427, 747, -121, -292, - 368, -1087, -338, -1534, 3740, -881, -2012, -1284, - 902, 97, -3407, -567, -118, 1340, -77, -445, - 642, 184, 901, -341, -81, 595, -6531, -248, - -167, 8740, 373, 408, 23, 10709, -299, -876, - -584, -1067, 20, -4556, 295, -1956, 990, -132, - -152, 4068, -92, 142, -1512, 23, -815, 454, - 330, -331, 9042, 120, -100, 34, 96, 152, - -11083, 345, -567, -498, 198, -37, 9276, -479, - 611, -2788, 253, -176, 617, -224, 248, 390, - 39, 25, -110, 127, -13, 6675, -84, 115, - 294, 84, -366, -405, -32, -109, -10469, 99, - 17, -88, -226, 316, -133, -203, -60, 311, - -87, -331, 357, -11, 158, 74, 562, 8, - 354, -10843, -114, -206, 699, -617, -141, 807, - 87, -149, 174, 199, -55, 10880, -332, 182, - 544, 651, -27, 261, -190, -655, 24, -443, - -630, 204, 207, -4174, 3557, 89, -386, 1754, - -485, -127, -97, 40, -1336, -488, -177, -750, - 88, -1040, -2215, -507, 169, 2908, 69, -52, - 8458, 601, 174, 1635, 480, 181, 3004, -3021, - 1868, -364, -2100, -256, -3065, -33, -7467, -890, - -1949, -20, -9472, -230, -847, -634, -377, -40, - 1184, 242, 265, 7056, 42, 16, -5070, -71, - 300, -1186, 187, 337, -1331, 77, -473, 3213, - 5738, 626, 2524, 531, 1001, -803, 1231, -1083, - -564, 539, 191, -498, 184, 603, -1777, -479, - 2298, -604, -2077, 634, 4682, -1387, -875, 498, - -10011, -173, 752, 109, -70, 171, -64, -261, - -79, 37, -233, 128, -66, -70, 356, -310, - 214, -14792, 6, 200, -227, 59, -241, 560, - -230, 479, 403, -22, 148, 7428, 110, -177, - 110, 7518, -2372, -1277, 223, -708, 731, 695, - -702, -2906, 256, -1160, 4941, 121, -1148, -68, - -424, -1590, 4697, 705, 525, 684, -451, -246, - -115, 556, 543, -6658, 384, -589, -1505, 12, - 114, 82, -5084, 164, 154, -295, 106, -271, - -40, -394, -437, 397, -279, -3825, -286, 632, - -1041, 1137, -93, 48, 192, -5914, -92, -235, - 682, 5817, -702, 180, -243, -219, -910, -174, - -146, 142, 12, -69, -207, -269, -53, 567, - -336, 114, 9601, -272, -270, 459, 610, -258, - 97, -10950, 397, 57, -7, 229, 1669, -173, - -173, -92, -347, -133, -357, 92, 132, -609, - 60, -124, 116, -54, -15205, 142, 109, 1127, - 268, -220, 336, -743, -238, -29, -902, 91, - -3597, -288, 1114, -3797, -1615, 32, 11481, 55, - 194, 3567, -1857, -2561, -237, -15, -48, -232, - -58, -21, 37, -535, -450, 857, 2001, 12, - 48, 840, 211, 126, 4833, 275, 176, -111, - 9, -112, -403, 182, 296, 181, -425, -14, - 276, 118, -240, 384, 139, 9183, -230, 143, - 2412, -70, 250, 10191, 809, -15, -257, -1242, - -163, -4253, -352, -436, 264, -4998, -17, -215, - 1412, 1592, 856, -159, 4756, -5032, 307, -251, - 194, 6414, -56, -7, -503, -261, -646, -1050, - -271, -578, -291, 614, 130, -336, -923, -120, - 149, -6012, 273, -295, -4586, 137, 206, 1246, - 498, 614, 991, 13776, 122, 52, -660, -76, - -211, -477, -224, 196, 411, 398, -590, 820, - -441, -35, 4394, 5010, -902, 509, 45, 747, - 1035, -455, -579, 105, 1103, -496, -1249, -248, - 46, -5771, -198, -386, 736, 15, -335, -85, - -624, -124, 580, -327, -102, -18, 866, 381, -}; - -static const int16_t shape22[] = { - 2560, -127, -137, -385, -1875, 90, -240, 140, - 1290, 200, -6762, 374, 1871, 8730, -111, -555, - -1524, -2175, -4689, 521, -179, 166, -1573, 1056, - -346, 247, -92, 5713, 561, 233, -360, 480, - -741, -7552, -1508, 259, -8746, 1604, 1385, 723, - 5678, 2243, 403, 12370, 3526, 574, 4982, 563, - 1713, -1337, 1336, -60, -890, -2184, -563, 9347, - 775, 6318, -883, 1476, -335, 736, -564, 635, - -5557, 617, 54, 257, -325, -66, -5689, 1061, - -897, 90, 8394, 2004, 9456, -222, -2026, -969, - 93, -5, -922, -6491, 1496, -1537, 651, -277, - -1038, 6072, -8534, -2526, 1645, 1459, 547, 2347, - -85, -761, -7210, -153, 414, 6096, 383, 320, - 370, -902, 823, 3071, 499, -731, 38, 473, - 1693, -9456, 946, 1218, -1054, 70, 367, -469, - -7861, -913, 401, 198, -83, 877, -308, 8633, - 253, -2025, 1925, 1412, 1351, -360, -948, -7526, - 1089, -7449, 1652, 141, -43, -2082, 44, 130, - -7525, -15049, -1345, 180, -3009, -4581, -267, 2309, - -1397, -112, -63, 307, -746, -13, 35, -8800, - -1947, -1143, -1096, -2582, -1210, 7683, -743, -1589, - 5699, -80, -1375, -93, -483, 129, 6076, -6099, - 374, -176, -1150, -416, 137, -4309, -1926, 3099, - 82, -836, 392, -655, 108, 428, 3361, 313, - 363, 7534, 1153, 334, 2262, -367, -69, -813, - -9702, 3074, -5461, 0, -1889, 1303, -8306, -113, - -677, 692, -2752, 1292, -171, 430, 4609, -2238, - 196, 1661, -25, -164, -2590, -4919, -615, -7, - -753, 5104, 5197, -66, -310, 827, -126, 615, - 70, -456, 238, 682, -639, -561, 369, 183, - 113, 430, -840, -792, -7282, -7537, 619, -445, - 588, 19, -1061, 652, 46, 861, 9641, -1251, - -41, -699, -605, -1389, 240, -10798, 733, 194, - -1230, -1092, -520, -219, 7, 518, -181, -12062, - 651, -40, 1128, -390, -220, -438, 471, 510, - 632, -321, 1393, 8827, -3241, -6683, 350, 1953, - -246, -582, -5486, -7576, -157, 888, 2965, -23, - 762, 6867, 3697, -43, -7905, -938, 2119, 377, - -25, 691, 136, -725, 7643, -730, 2024, -6932, - 804, 53, 392, 440, 336, 6235, -7037, -5584, - -1579, 1115, 1757, 1001, 32, -294, -592, 300, - -764, -8879, -1612, -845, 1722, 6968, 384, 267, - 862, 10830, -364, -1138, -49, 1041, -908, -14960, - 809, 628, -1150, -1348, -437, 805, 877, -64, - 1041, 5253, -270, 2022, 1253, -992, 11015, 2686, - 17, 80, -1463, 4229, 80, -834, -9286, 1179, - 66, -39, -64, -4057, -423, 116, -1441, -1733, - 752, 1674, 1443, 757, -3149, 9057, -3522, 4007, - -893, 1179, -388, 6368, -478, 4397, 13868, -2996, - 790, 704, -2299, -6003, 449, -5410, 1999, 181, - -1807, -362, -57, 454, -2371, 3658, -485, -212, - 11551, 1535, 478, -1570, -278, 584, 608, -5211, - 6965, 1042, -168, -337, -1071, 72, 451, -204, - -1000, -1044, 689, 186, -166, -375, 9426, 363, - 93, -717, 304, 107, 7853, -1251, 1093, 692, - -742, 33, 576, 447, 678, 452, 408, -4813, - 711, -595, -516, -1108, 1941, 3056, -219, -3413, - 10946, 1513, -2375, 48, -408, 49, -399, -5608, - -58, 161, 4808, 436, 68, -5675, 230, 832, - -1228, 6382, -588, -1312, 772, 4337, -405, -5467, - -222, 1382, 2158, 620, -840, 810, -3830, 48, - -101, 529, -2670, -249, 1035, -7620, -1081, -6646, - 1469, 1043, 743, 1553, -556, -274, 68, 238, - 1078, -110, -5163, 562, 735, -8317, 1202, -1325, - -962, 61, 4280, 570, 7450, 265, -1516, 696, - -1567, -681, 0, -4064, 1548, -2521, 657, 567, - -8343, 1691, -1430, 4827, 807, 905, -2601, -7415, - 921, -1741, 363, 309, 211, -521, 3013, -797, - 648, -3709, 961, 662, 403, -386, -719, -5752, - 1355, 6717, 191, 591, -371, -1225, -5125, 800, - -252, -5769, 1101, 657, -141, 2377, -1365, -218, - -114, 148, 276, 358, -354, 18, -31, -9413, - -5514, -1458, -220, 298, 666, 659, 359, 980, - -1389, 101, 1500, 4661, 472, 264, -7590, -1469, - 41, 38, -259, -346, -486, -9949, 812, 422, - -1354, -2461, -2057, -253, 1806, -107, -41, 16384, - -140, -684, 5421, 1907, -10, -889, -1877, -6815, - -818, -5854, -3196, -895, -1706, -186, 7944, 100, - -11260, -4573, -415, 4685, 395, -6035, 5789, -4566, - 624, -2146, 570, 130, -892, 1385, -262, 6638, - -2324, 348, -288, 607, -1574, 7119, -1037, -40, - -4955, -946, -5215, -1013, -1232, -875, -78, -399, - 231, -173, -5860, 189, -755, -8265, 745, 966, - 202, -1858, -26, -658, 55, 1131, -56, 3030, - 158, 3742, -1261, 317, 6397, 521, -508, -522, - -2040, -747, -6906, -868, -110, -719, 2602, 2570, - -1106, -787, -352, 9212, -545, 7339, -10183, -726, - 1104, -1118, -1655, 383, 1370, 1412, 528, -4689, - -398, -3802, -682, -11004, -2310, 8011, 2301, -5941, - -512, 3813, 210, 1379, -15209, 1143, -2344, 2459, - 2368, -6484, -2078, -246, 383, -204, 1449, -453, - -1539, 416, 508, -7168, -1930, 4279, 453, -215, - -296, -346, 5691, -200, -855, 552, 5921, -109, - 588, -3049, 1312, 6767, -78, -7204, 1187, -754, - -1043, -455, 412, -490, 3124, -273, 1468, -546, - 552, -306, 835, -263, -7234, 324, 318, -1224, - 240, 198, 193, -550, -684, -12416, 85, -1469, - -463, -301, 180, 290, -928, -6399, -931, 176, - 310, -692, 7964, -204, 512, 975, -6415, -394, - -30, -120, 1638, -1474, -381, 5912, 156, -830, - -575, -225, -4079, -787, -957, -801, 181, 575, - 1116, -795, -743, -981, 434, -365, -9780, -1814, - 1447, 1081, 153, 884, 8697, 259, 881, -661, - -1232, -547, 464, 898, -3988, -476, 790, 7589, - -525, -809, -2900, -1271, 170, 223, -5050, -2554, - 1458, -666, 537, -6733, 212, 448, -1556, 1459, - 802, -2716, -8785, 11020, -258, 1229, 1138, 843, - 508, 103, -657, 1273, 8140, 368, -605, 6856, - 110, -423, 5458, -417, 993, 257, 5552, -47, - 1401, -119, -1320, 6193, -1196, 56, -93, -1604, - -1491, -897, 238, 823, 4213, 104, 145, -1049, - -9286, -26, -813, -139, 499, -10351, -466, -515, - -1166, -412, -746, 503, 1872, 17, -11941, -3350, - -108, -7296, -411, 4811, -1870, 162, 5595, -658, - 339, -904, 6911, -715, -240, -71, 377, 4747, - -57, -8920, 521, 753, -375, -1185, 1322, -328, - 5, 525, -610, 127, 1519, 791, 784, -16384, - 116, -1007, -352, 486, -7871, 202, -3684, -387, - 676, -8942, -713, -447, -557, 1159, 974, -380, - -1183, 1049, -9, 838, -932, -139, 371, 1688, - -7617, 1192, 2350, -220, -4558, 2681, 1568, 102, - 1274, -446, -351, 1551, 1101, -8995, -5276, -4416, - 3411, 221, -429, 412, 1625, -4575, 254, -631, - 310, -378, 9743, 859, 934, 142, -1400, -6921, - 6466, -4068, 2664, 418, 70, 284, -903, -23, - -502, 4354, -5993, 125, -34, -1246, -1946, -204, - 1002, -7454, -88, -8628, 2449, 13715, 318, -8759, - 294, -2212, 138, -761, 285, -1686, 291, 606, - 180, 761, -359, -1467, 299, -417, -361, -895, - -5692, 127, -951, 165, 1, 396, -819, -5508, - 280, 760, -411, -1025, -649, -1688, -6290, 272, - -17, -7595, 9, 307, 128, -3995, -119, 481, - -3100, -255, 651, 139, -3492, -6, -4471, 452, - -71, 139, 1255, -6128, 1191, 326, 28, -238, - 1374, -334, -457, -836, -10390, 185, -616, 3366, - -39, 183, -21, 6240, 1141, 341, -348, 738, - 121, -65, -386, -27, -548, 337, -4, -126, - 571, 2263, 4936, -1093, -397, 961, -5886, -734, - 1509, -660, -61, 170, -783, -4197, -1459, 906, - -31, 400, -481, 561, 6, 489, -5397, -1666, - 41, -536, -116, 6713, 1288, -157, -116, 4256, - 1895, 6671, 1837, -544, 1276, 2031, 345, 6471, - -84, 1868, -2006, -1304, -7792, 702, -1189, 105, - -4869, -282, -790, 7083, -628, -1273, 252, -179, -}; - -static const int16_t shape22s[] = { - 493, -2, -310, -109, -1218, -193, -267, -11, - -466, -34, -2492, 287, 241, 3621, -537, 458, - 869, -915, -290, 782, 65, -90, -635, 1836, - 80, 519, 868, 1359, 550, -92, -704, 110, - -210, -4337, -376, -200, -2693, 6, 381, 688, - 556, 883, -88, 1698, 1081, 133, 1130, -78, - 853, -424, -39, -909, -1579, -2774, -372, 3604, - -519, 3777, -66, 1330, -1055, 1135, -995, 220, - -3124, 122, 83, 1045, -701, -120, -6800, -269, - 195, 1197, 5500, -490, 5453, -201, 411, 823, - -146, 46, 252, -2724, 606, -924, -1538, 394, - -420, 6405, -5632, -941, -402, -137, 984, -24, - 594, -40, -140, -20, 204, 1211, 290, -680, - 103, -434, -294, 1646, -159, -2296, -237, 507, - -67, -8999, -97, 403, -1473, -111, 22, -257, - -2203, -600, 577, -117, 48, 2216, -170, 1192, - 700, -477, 1678, 979, 2395, -69, -1746, -2139, - -294, -4210, 181, -372, 320, -180, -503, -550, - -3994, -6315, 502, -804, -432, -112, -457, -1016, - 637, 297, 932, 533, 798, 229, -1001, -2780, - -4009, 1176, 189, -1575, 21, 3512, -348, -1450, - 2488, 463, 611, -46, 85, 94, 3319, -3041, - -362, -261, -1534, -1900, 7, -519, -52, 1166, - -174, -152, -189, -415, 641, 27, 1764, 280, - -301, 2976, 146, -632, 4022, -1994, -84, -61, - -1633, 285, -439, 781, -592, 399, -4794, 203, - -295, 32, -1423, 216, -2773, -9, 3589, -3952, - -195, 161, -223, -2240, -1886, -2643, 978, 113, - -1019, 1645, 1493, -851, 1417, -74, 717, 411, - 887, -1384, 73, 117, -65, -7, 133, 18, - 69, 11, -98, 45, -1751, -2710, 11, -140, - 29, 185, 327, 705, 56, 152, 8202, -117, - 157, -478, 36, -564, 996, -9359, -707, 674, - 1169, 270, 156, -679, 15, 720, -38, -4952, - -196, 183, -356, -1004, 185, -148, -61, 151, - -229, -161, 23, 4350, -650, -4384, -21, 909, - 105, -271, -2538, -4018, -1268, 351, 396, -190, - -135, 970, 3159, -935, -6968, -131, -1031, 53, - -430, 242, -219, 384, 2832, -151, 152, -6891, - 1444, -63, -46, 72, 653, 3955, -4187, -321, - -298, 678, -471, 664, -42, -30, 825, 195, - -1147, -2728, -178, -2305, 680, 1980, -147, 320, - -348, 4307, 806, -263, -60, -102, 8, -10085, - 626, -130, 267, -621, 45, -157, 438, 190, - 78, 1608, -246, -386, 256, -255, 5651, -449, - -13, 198, -3193, 329, -500, -1368, -6647, 609, - -507, -96, 222, -1196, 171, -12, -299, -1423, - 442, 47, -5, -282, -18, 4969, -1764, 231, - -471, 5044, 412, 1496, -146, 35, 5083, -228, - 355, -482, -1063, 1265, 80, -1278, 1225, 826, - -1914, 779, 439, -511, -4177, 425, -38, -55, - 9786, 1005, -538, -664, -641, 638, 125, -2811, - 2308, 28, -1157, -229, -624, 45, 354, -368, - -1661, 90, 778, -328, 272, -223, 9558, 822, - -167, -12, -1020, 2962, 2372, -932, 1961, 1398, - 2660, 3, 235, 421, 114, -283, 371, -1652, - 329, -435, -113, -1296, -501, -686, 297, -384, - 10328, 472, 614, 139, -765, -309, 180, -2009, - -171, -175, 3571, 146, 46, -1356, -134, -15, - -166, 2046, 108, 119, -281, 971, -471, -1134, - 34, -104, 219, 746, -223, 245, -181, 12, - -165, 216, -792, 86, 562, -1807, -116, -1324, - 590, -320, -80, 1863, -420, -1066, -698, -2879, - -6, 182, -2325, 575, 97, -2616, 2938, -673, - -693, -116, 1905, -430, 4739, -12, -3307, 693, - -227, 223, -111, -1498, 5, 1751, -36, 234, - -4584, 838, -370, -296, -818, 337, -46, -8921, - 875, -423, 496, -1196, -24, -1014, 969, 294, - 237, -1733, 27, 2543, 1494, 190, 457, -1391, - 1209, 5651, 548, 504, 686, -2889, -151, 725, - 486, -3716, -285, 830, 31, 5132, 770, -24, - -482, -369, -126, -1552, -347, -272, -387, -9485, - -1547, -1189, 369, 812, 311, 536, 391, 361, - -1708, -288, -94, 2053, 557, -611, -4551, -2368, - 173, 472, 160, -1849, 96, -7569, 183, 484, - -393, -346, -309, -13, -7, 2, -239, 10395, - -587, -115, 1282, -634, 81, 90, -725, -2685, - -1214, -4455, -1897, -2903, -827, 124, 2215, 696, - -1225, -1353, -371, 343, 421, -640, 1480, -1174, - 76, -835, -716, -625, -547, 1250, -2696, 2132, - -548, 439, -607, 408, -221, 5026, 352, -344, - -1339, -602, -1650, -404, -458, -502, 61, -164, - 53, -26, -2652, -209, 64, -4068, 713, 193, - -117, -1290, 95, -86, -515, 1336, -492, 1654, - -2963, 3663, -4231, -1, 3017, 371, 276, -7, - -289, -33, -5942, 237, 30, 586, -264, -493, - 435, -388, -165, 10434, 192, 3897, -5414, 361, - 845, -259, 481, 331, 650, -232, 23, -1789, - 27, -4065, 1020, -4261, -651, 3174, 951, -3363, - 577, -112, 642, -1177, -1707, 492, -250, -1236, - 24, -1394, -1807, -853, 1681, -69, 851, -959, - -5759, -202, 30, -3466, -593, 5414, 65, 141, - -319, 674, 1183, -155, -312, 372, 2829, -75, - -60, -2618, -240, 2944, -631, -4221, -16, 467, - 211, -58, 55, -527, -51, -160, 642, -305, - 388, 413, 210, -81, -3383, -120, 144, -220, - -672, 1352, -630, -2324, -423, -8053, -131, -912, - -260, -380, 470, 154, -1346, -2417, -426, -403, - -137, -160, 2823, 609, -216, -173, -585, -514, - 95, -202, 222, 16, 136, 1751, 237, -1089, - 957, -144, -518, 416, -347, -60, 207, 277, - 512, -1133, 166, 1423, -883, -194, -7016, -1938, - 417, 2302, -992, -179, 738, -74, 411, -462, - -413, 67, 234, -322, -164, -47, -89, 1409, - 390, -1180, -2888, 655, 1958, 0, -1826, -471, - -1247, 307, 104, -8502, -198, -222, 191, 281, - -868, 47, -4553, 2434, 174, 263, 2844, -72, - -597, -1183, -374, -93, 3348, 13, 173, 6285, - -32, -213, 1882, 411, -608, -562, 2998, 293, - 54, -147, -120, 822, -93, 679, 206, -3229, - -767, -1603, -259, -310, 4306, 548, -9, -99, - -5722, -328, -176, 453, 338, -9687, -63, 844, - 322, 615, -1075, -370, 159, -33, -6213, -1375, - 741, -801, -1319, 1513, 1331, -69, 2702, -458, - -203, 103, 4696, -284, 465, -62, -40, 3184, - 238, -6131, 546, 1713, -365, -24, 116, -33, - 304, 807, -231, 291, 903, 749, -254, -12215, - 115, -35, -95, -166, -3776, -170, -4517, -151, - 67, -7725, 666, -573, -744, -719, 37, 31, - 373, 148, -125, 15, -150, -905, -42, 272, - -5223, 650, 5233, 109, -1235, 991, 211, 1522, - -555, -328, -52, 5335, -22, -5476, -3102, -637, - 986, 468, -37, -164, -264, -1290, 754, -940, - -685, -862, 7270, -279, -441, 472, -153, -2515, - 3899, -95, 360, 762, 14, 434, 619, 185, - -230, 1233, -1330, 1360, -756, 361, -1391, -247, - 120, -3573, 293, 375, 806, 5526, 536, 137, - 486, -484, 13, -37, 12, -4, 81, 43, - 10, 43, -38, -371, -64, -1167, -117, -371, - -1958, -166, 543, -97, -83, 391, -59, -1631, - 302, 1077, -128, -641, -64, 21, -2562, -235, - 342, -7121, -646, -49, -961, -141, -210, -555, - -1596, -988, 723, -209, -3585, 10, -35, 1051, - 0, 138, 941, -5002, 805, 3009, 35, -70, - 513, -21, -432, -224, -10628, -167, -1045, 2603, - 336, 360, 515, 683, 981, 3028, 492, -543, - -1844, 23, -30, 52, -40, 447, 11, 363, - -95, 1609, 2613, -13, -400, 719, -4513, -676, - -290, 456, -332, -11, -261, -455, 89, -301, - 285, 287, 202, 281, 87, -202, -1482, -535, - 874, -478, -201, 4715, 824, -204, 145, 2882, - 404, 3376, 363, -18, -127, 764, 106, 1626, - 178, 185, 22, -637, -6216, 1399, -961, -88, - -553, -91, 98, 1831, 9, -583, 1253, -1741, -}; - -static const int16_t shape44s[] = { - -20, -140, 683, -586, -1742, 177, -538, 1900, - 2193, -17, -2096, 261, 645, 339, 77, 1136, - -521, 537, -924, -156, -261, 195, 1049, -39, - 236, -137, 0, 3199, 225, 46, 86, -215, - 557, -5394, 17, 911, -1690, -48, -48, -175, - -11, -631, -153, 4474, -347, -39, 1759, 154, - 170, -180, -273, 603, -590, -5195, -74, 1789, - 240, -212, 431, 2447, 368, -76, -313, 11, - -2926, 19, -71, 208, -51, -728, -6412, -61, - 141, -112, 5280, -76, 4435, -402, -25, 46, - 210, -104, 172, -3830, -366, -23, 239, -112, - 137, 6692, -6288, -720, -132, -136, 552, -1688, - -345, -289, -485, 149, 174, 180, 361, -236, - 92, 407, 6, 2373, 380, -167, 845, 444, - -834, -9358, 413, -1302, 460, 77, 34, 56, - -1516, -143, 207, -43, -31, -106, -52, 403, - -309, 298, -88, 1552, -240, -776, 624, -4181, - -342, -4804, 57, -23, 160, -44, 469, -17, - -3997, -5079, -263, 72, 181, 1085, 538, -611, - -368, 59, -204, -195, -40, -201, -803, -5093, - -3216, 480, 46, -729, 244, 3320, 185, 503, - 2979, -416, 110, 25, 140, -502, 2236, -4420, - -36, -238, -278, 60, -82, -597, 218, 69, - -95, -2102, -2138, -2308, -3796, 20, -211, -229, - 297, 3665, 81, 148, 1315, -4537, -38, 186, - -3106, -526, 90, -35, -193, -302, -5860, 276, - -308, 206, 645, 1, -242, 580, 3025, -2583, - -90, 511, -315, -137, -2033, -4313, 693, 485, - -211, 1486, 1180, 181, -136, 204, 23, 383, - 1479, -213, 42, 32, -64, -136, -91, -146, - 434, 231, 36, -58, -3254, -2647, -18, 345, - 171, -60, 84, 209, 246, -587, 9447, -67, - -187, -108, -226, -458, -519, -11089, -422, -502, - 132, 79, 298, -475, -412, 196, -164, -7347, - 185, -131, 369, 18, -500, 644, -334, 93, - -77, 71, 341, 3566, -281, -4191, -145, 87, - 37, 306, -3482, -5739, 161, -245, 293, 208, - 380, 2888, 31, -23, -2061, -597, -56, 350, - -105, 1167, 64, 342, 3638, -79, -106, 148, - 5422, -719, -232, 8, -395, 3249, -5093, -222, - -707, 241, 318, 735, 376, 78, -166, -1614, - -9, -3373, 330, -1540, 2028, 3400, -9, 317, - 9, 4903, 262, 62, 222, -95, -208, -13376, - -101, 121, 298, 5, 172, 406, -164, 79, - 172, 1993, 235, 229, 1193, -274, 5944, -918, - -15, 1304, 307, 1150, -385, -794, -3467, 660, - 2143, 147, -279, -751, -305, 1052, 205, -108, - 572, -212, 29, -50, 6, 3749, 238, -2016, - -1118, -1329, -971, 2633, 519, 194, 3545, -11, - 77, -92, 1215, -439, 152, -863, 1604, 180, - -514, 252, 308, -131, -938, 133, 378, 11, - 12153, 51, 486, 71, -476, -599, 57, -127, - 2685, -173, -182, 468, -3469, -594, -380, 265, - -879, -352, -278, -309, 575, 124, 10814, -765, - -64, 710, -105, 296, 2562, 98, -358, 556, - 2921, -133, -5, -406, 42, 496, -1053, -1957, - 701, 266, 260, -441, 43, -192, -1, -2174, - 9894, -90, -181, 29, 50, -858, 59, -190, - 49, -282, 1632, 1525, 100, -3659, 13, 173, - -240, 5304, -383, 263, -311, 1747, 169, -2203, - -29, -106, 342, -301, 66, 49, 23, 857, - -607, 698, -1198, -191, -450, -1875, -329, -2156, - 156, 95, 145, 129, -321, 88, 1049, 3980, - -14, 321, -1484, 895, -30, -2174, 289, 933, - -933, 15, 2631, 68, 3054, 221, -87, 175, - 200, 937, -87, -2032, 348, 146, -372, 60, - -2566, 3497, -98, 313, 536, -299, -58, -8949, - 323, -524, -331, 713, -47, 360, 155, 168, - 687, -1391, 1973, 670, 788, -202, -129, -5113, - 54, 1178, 1218, 172, 630, -154, -1047, 840, - 71, -337, 91, 214, -474, 624, -773, 16, - -126, 340, -631, -482, -155, 419, 50, -10976, - -742, -781, 169, 149, 33, -169, 44, 354, - 26, 129, -179, 1401, 776, -155, -3996, -813, - 594, 238, -61, 168, -383, -9261, 294, 470, - -322, -190, -956, -290, 27, -438, -254, 12571, - 344, -393, -568, 56, 81, 171, -115, -4370, - 49, -322, -237, -692, -55, -49, 4317, -6, - -4837, -156, 179, 247, -338, -48, 952, -1061, - -33, -934, 250, -256, -1622, 1039, -738, 2719, - -20, -190, 249, -119, -235, 6080, 123, -502, - -1443, 86, -1684, -177, -128, -58, -237, -641, - -177, 64, -2416, 15, -116, -6465, -412, 161, - 419, 768, 36, 113, -944, -241, -1424, -95, - 635, 1798, -2257, -18, 3046, 173, -33, -207, - -52, -831, -5730, -54, -199, 194, -255, 467, - -211, -853, -512, 11619, 148, 3681, -4603, -282, - 129, -205, -606, 167, 306, 464, 485, -959, - -203, 254, 151, -6880, -262, 5180, 658, -1378, - 1174, -53, -59, -33, -3077, -127, -223, -17, - -31, -2190, 23, 317, -169, 203, -223, -222, - -5295, 116, 80, -2757, -666, 3377, -476, 85, - -630, -147, 1740, -175, -115, 207, 240, -248, - -95, -1016, 3966, 3998, -343, -4751, 187, -113, - -250, 111, -510, -203, 130, 89, 311, 608, - -221, -381, -253, -359, -2254, 45, 224, -141, - 45, -19, 480, -5074, 797, -4580, -163, 110, - -234, 337, 6, 707, 492, -5493, -2750, -94, - -363, 113, 2345, 344, 379, 464, -3222, -56, - -269, -262, -10, -609, 324, 3043, 209, 3092, - -600, 42, -615, -17, -53, 30, 1123, 224, - 593, 632, -90, 428, 1117, -1429, -6741, -95, - -293, -103, -2784, 251, 1688, 621, -349, 1059, - -1093, -148, 447, 149, 88, 92, 687, 1249, - 80, 289, -1841, 221, -10, -92, -1736, 118, - 136, 138, -162, -4162, -111, 62, 95, 166, - -172, -695, -3685, 5694, -527, 2032, -549, 43, - -101, 221, 181, -479, 7697, 2007, -127, 805, - -83, -535, 1354, -383, 253, -622, 2910, 1249, - 782, 13, 42, 994, -545, 75, -485, 330, - -16, 343, 272, -781, 360, -97, -25, -875, - -12689, -623, -307, 195, -256, -11644, 229, 180, - -42, -361, -124, -81, -23, -460, -1993, 212, - -634, -847, 1616, -546, -583, 99, 3800, 10, - 177, 366, 6106, -173, 265, -213, 10, 1108, - -288, -1690, -237, -312, 38, -2272, 431, -26, - -178, -764, 507, 355, 677, -214, -816, -12411, - 47, 12, 294, -295, -3916, -677, -4885, -250, - -453, -7716, 478, 231, 17, -248, 147, 1064, - 637, -80, -41, 265, -383, 142, 116, 2991, - -3060, 809, 2056, -119, -866, -22, -660, 233, - 306, -1873, -1141, 6995, 186, -8678, -109, -39, - -105, 730, 18, -846, 273, -2922, 210, 26, - -174, -142, 990, 131, -436, 1422, -217, -3152, - 3224, 35, 315, -47, 48, -221, 568, 44, - 182, 1696, -1755, -193, 527, 158, -555, -3485, - 171, -4552, -47, -4680, 95, -112, 184, 80, - -36, -915, 87, 24, -259, -1743, 68, -117, - 405, 11, 40, -320, -17, -158, -134, -186, - -1206, -466, 1262, 133, -254, -100, 210, -1735, - -636, 319, -978, 69, 197, -521, -5503, -78, - -544, -1011, 101, -489, -371, -79, -196, -18, - -839, 1091, 682, -1441, -2375, -1127, 54, 829, - -306, -255, 641, -3665, 473, 3504, -1035, -160, - -467, -275, -437, 79, -13513, 326, 132, 82, - 188, 362, -74, 1406, -46, 2864, 351, -558, - -1277, 108, -92, -53, 72, -41, -31, -97, - 353, 73, 1864, -207, 106, -81, -3930, 173, - 41, -539, -497, 135, -526, -823, 69, -10, - 176, 648, -1710, 564, 80, 237, -1956, 234, - 11, 142, -849, 4116, -473, 110, 129, 2137, - -170, 3193, 10, 245, -953, -827, -30, 1235, - 366, -67, 54, -567, -7377, 2461, 582, 74, - -1988, -33, -296, 3090, -54, 145, 564, -295, -}; - -static const uint16_t bark_tab_l8_512[] = { - 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 6, 6, 6, 8, 7, 9, - 9, 11, 11, 14, 15, 17, 20, 24, 28, 34, 41, 51, 64, 83, -}; - -static const uint16_t bark_tab_m8_256[] = { - 3, 4, 3, 4, 3, 4, 4, 5, 5, 6, 6, 8, 9, 11, 13, 17, 23, 29, 41, 58 -}; - -static const uint16_t bark_tab_s8_64[] = { - 2, 1, 2, 2, 3, 4, 5, 7, 13, 25 -}; - -static const uint16_t bark_tab_l8s_512[] = { - 7, 8, 7, 8, 8, 8, 8, 8, - 8, 9, 9, 10, 10, 11, 11, 12, - 12, 14, 15, 16, 18, 19, 21, 24, - 27, 30, 35, 40, 46, 53, -}; - -static const uint16_t bark_tab_s8s_64[] = { - 3, 3, 3, 3, 4, 5, 6, 8, - 12, 17, -}; - -static const uint16_t bark_tab_m8s_256[] = { - 6, 5, 6, 6, 6, 6, 7, 7, - 8, 8, 9, 10, 11, 13, 15, 18, - 20, 25, 31, 39, -}; - -static const uint16_t bark_tab_l11_512[] = { - 4, 4, 5, 4, 5, 4, 5, 6, - 6, 6, 7, 8, 9, 10, 12, 14, - 17, 21, 27, 33, 44, 58, 82, 121, -}; - -static const uint16_t bark_tab_s11_64[] = { - 2, 1, 2, 3, 4, 6, 13, 33, -}; - -static const uint16_t bark_tab_m11_256[] = { - 3, 3, 4, 3, 4, 4, 5, 6, - 7, 9, 11, 15, 21, 30, 48, 83, -}; - -static const uint16_t bark_tab_l11s_512[] = { - 6, 6, 6, 6, 6, 6, 7, 6, - 7, 7, 8, 8, 8, 9, 10, 10, - 11, 13, 13, 15, 17, 18, 21, 25, - 27, 33, 38, 45, 54, 66, -}; - -static const uint16_t bark_tab_s11s_64[] = { - 2, 3, 2, 3, 3, 4, 6, 8, - 12, 21, -}; - -static const uint16_t bark_tab_m11s_256[] = { - 4, 5, 4, 5, 5, 5, 6, 5, - 7, 7, 8, 9, 10, 12, 15, 17, - 22, 28, 35, 47, -}; - -static const uint16_t bark_tab_l16_1024[] = { - 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 9, 10, 11, - 12, 14, 17, 19, 22, 27, 33, 40, 51, 64, 84, 114, 164, 257 -}; - -static const uint16_t bark_tab_m16_512[] = { - 3, 3, 3, 3, 4, 3, 4, 4, 4, 5, 5, 6, 7, 8, 10, 12, - 14, 18, 24, 30, 42, 59, 89, 152 -}; - -static const uint16_t bark_tab_s16_128[] = { - 2, 2, 2, 3, 3, 5, 7, 12, 25, 67 -}; - -static const uint16_t bark_tab_l16s_1024[] = { - 9, 9, 8, 9, 10, 9, 10, 10, - 10, 12, 11, 13, 13, 14, 16, 17, - 19, 20, 24, 26, 30, 35, 40, 48, - 56, 68, 83, 102, 128, 165, -}; - -static const uint16_t bark_tab_s16s_128[] = { - 3, 4, 4, 4, 5, 7, 10, 16, - 26, 49, -}; - -static const uint16_t bark_tab_m16s_512[] = { - 7, 6, 7, 7, 7, 8, 9, 9, - 10, 11, 14, 15, 18, 22, 27, 34, - 44, 59, 81, 117, -}; - -static const uint16_t bark_tab_l22_1024[] = { - 3, 4, 3, 4, 3, 4, 4, 4, - 4, 4, 5, 5, 5, 6, 7, 7, - 8, 9, 11, 12, 14, 16, 20, 24, - 29, 36, 45, 60, 80, 113, 173, 302, -}; - -static const uint16_t bark_tab_l22s_1024[] = { - 6, 7, 6, 6, 7, 7, 7, 7, - 7, 8, 9, 8, 10, 10, 11, 12, - 13, 15, 16, 18, 21, 24, 27, 33, - 38, 46, 55, 68, 84, 107, 140, 191, -}; - -static const uint16_t bark_tab_s22s_128[] = { - 3, 2, 3, 4, 4, 6, 9, 14, - 26, 57, -}; - -static const uint16_t bark_tab_m22s_512[] = { - 5, 5, 5, 6, 5, 7, 6, 7, - 9, 9, 11, 13, 15, 20, 24, 33, - 43, 61, 88, 140, -}; - -static const uint16_t bark_tab_l44_2048[] = { - 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, - 9, 10, 11, 11, 13, 14, 16, 17, 19, 22, 25, 29, 33, 39, 46, 54, - 64, 79, 98, 123, 161, 220, 320, 512, -}; - -#define bark_tab_m22_512 bark_tab_m44_512 /* Both tables are identical */ -static const uint16_t bark_tab_m44_512[] = { - 3, 2, 3, 3, 3, 4, 3, 5, 4, 6, 7, 8, 10, 14, 18, 25, - 36, 55, 95, 208, -}; - -#define bark_tab_s22_128 bark_tab_s44_128 /* Both tables are identical */ -static const uint16_t bark_tab_s44_128[] = { - 1, 2, 1, 2, 3, 4, 6, 10, 23, 76 -}; - -const TwinVQModeTab ff_metasound_mode0806 = { - { - { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0806ss0, cb0806ss1, 27 }, - { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0806sm0, cb0806sm1, 22 }, - { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0806sl0, cb0806sl1, 24 } - }, - 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 -}; - -const TwinVQModeTab ff_metasound_mode0806s = { - { - { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0806ss0, cb0806ss1, 27 }, - { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0806sm0, cb0806sm1, 22 }, - { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0806sl0, cb0806sl1, 24 } - }, - 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 -}; - -const TwinVQModeTab ff_metasound_mode0808 = { - { - { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0808s0, cb0808s1, 18 }, - { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0808m0, cb0808m1, 16 }, - { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0808l0, cb0808l1, 17 } - }, - 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 -}; - -const TwinVQModeTab ff_metasound_mode0808s = { - { - { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0808ss0, cb0808ss1, 18 }, - { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0808sm0, cb0808sm1, 16 }, - { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0808sl0, cb0808sl1, 17 } - }, - 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 -}; - -const TwinVQModeTab ff_metasound_mode1110 = { - { - { 8, bark_tab_s11_64, 8, fcb11s, 1, 5, cb1110s0, cb1110s1, 21 }, - { 2, bark_tab_m11_256, 16, fcb11m, 2, 5, cb1110m0, cb1110m1, 18 }, - { 1, bark_tab_l11_512, 24, fcb11l, 3, 6, cb1110l0, cb1110l1, 19 } - }, - 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11, 9, 28, 20, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode1110s = { - { - { 8, bark_tab_s11s_64, 10, fcb11ss, 1, 5, cb1110ss0, cb1110ss1, 21 }, - { 2, bark_tab_m11s_256, 20, fcb11sm, 2, 5, cb1110sm0, cb1110sm1, 18 }, - { 1, bark_tab_l11s_512, 30, fcb11sl, 3, 6, cb1110sl0, cb1110sl1, 20 } - }, - 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11s, 9, 36, 30, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode1616 = { - { - { 8, bark_tab_s16_128, 10, fcb16s, 1, 5, cb1616s0, cb1616s1, 16 }, - { 2, bark_tab_m16_512, 24, fcb16m, 2, 5, cb1616m0, cb1616m1, 15 }, - { 1, bark_tab_l16_1024, 30, fcb16l, 3, 6, cb1616l0, cb1616l1, 16 } - }, - 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16, 9, 28, 30, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode1616s = { - { - { 8, bark_tab_s16s_128, 10, fcb16ss, 1, 5, cb1616ss0, cb1616ss1, 16 }, - { 2, bark_tab_m16s_512, 20, fcb16sm, 2, 5, cb1616sm0, cb1616sm1, 15 }, - { 1, bark_tab_l16s_1024, 30, fcb16sl, 3, 6, cb1616sl0, cb1616sl1, 16 } - }, - 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16s, 9, 56, 60, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode2224 = { - { - { 8, bark_tab_s22_128, 10, fcb22s, 1, 6, cb2224s0, cb2224s1, 15 }, - { 2, bark_tab_m22_512, 20, fcb22m, 2, 6, cb2224m0, cb2224m1, 14 }, - { 1, bark_tab_l22_1024, 32, fcb22l, 4, 6, cb2224l0, cb2224l1, 15 } - }, - 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22, 9, 56, 36, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode2224s = { - { - { 8, bark_tab_s22s_128, 10, fcb22ss, 1, 6, cb2224ss0, cb2224ss1, 15 }, - { 2, bark_tab_m22s_512, 20, fcb22sm, 2, 6, cb2224sm0, cb2224sm1, 14 }, - { 1, bark_tab_l22s_1024, 32, fcb22sl, 4, 6, cb2224sl0, cb2224sl1, 15 } - }, - 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22s, 9, 56, 36, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode4432 = { - { - { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4432s0, cb4432s1, 23 }, - { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4432m0, cb4432m1, 21 }, - { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4432l0, cb4432l1, 22 } - }, - 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200, -}; - -const TwinVQModeTab ff_metasound_mode4440 = { - { - { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4440ss0, cb4440ss1, 18 }, - { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4440sm0, cb4440sm1, 17 }, - { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4440sl0, cb4440sl1, 17 } - }, - 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 -}; - -const TwinVQModeTab ff_metasound_mode4448 = { - { - { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4448ss0, cb4448ss1, 15 }, - { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4448sm0, cb4448sm1, 14 }, - { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4448sl0, cb4448sl1, 14 } - }, - 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 -}; -#endif /* CONFIG_METASOUND_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_data.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,31 +22,13921 @@ #ifndef AVCODEC_METASOUND_DATA_H #define AVCODEC_METASOUND_DATA_H -#include -#include - #include "twinvq.h" -extern const float ff_metasound_lsp8[]; -extern const float ff_metasound_lsp11[]; -extern const float ff_metasound_lsp16[]; -extern const float ff_metasound_lsp22[]; -extern const float ff_metasound_lsp44[]; - -extern const TwinVQModeTab ff_metasound_mode0806; -extern const TwinVQModeTab ff_metasound_mode0806s; -extern const TwinVQModeTab ff_metasound_mode0808; -extern const TwinVQModeTab ff_metasound_mode0808s; -extern const TwinVQModeTab ff_metasound_mode1110; -extern const TwinVQModeTab ff_metasound_mode1110s; -extern const TwinVQModeTab ff_metasound_mode1616; -extern const TwinVQModeTab ff_metasound_mode1616s; -extern const TwinVQModeTab ff_metasound_mode2224; -extern const TwinVQModeTab ff_metasound_mode2224s; -extern const TwinVQModeTab ff_metasound_mode2232; -extern const TwinVQModeTab ff_metasound_mode2232s; -extern const TwinVQModeTab ff_metasound_mode4432; -extern const TwinVQModeTab ff_metasound_mode4440; -extern const TwinVQModeTab ff_metasound_mode4448; +static const int16_t cb0806sl0[] = { + -417, -225, -84, 16, -106, -34, -246, -164, + 112, 48, -47, 36, -65, -68, -172, -1655, + -36, 140, -3, -2, -2, 2, 0, 0, + 178, 7, -181, -177, 120, -64, -129, 80, + -6826, -38, -25, 147, 148, -13, -25, 110, + 21, 21, -1, 0, 0, 0, 0, 0, + 3319, 632, -734, -187, 40, -249, -155, -1, + -173, 95, 28, -2, 20, -44, 35, 120, + -47, -221, -5, 2, -7, 1, 0, 0, + 63, 268, -260, -419, 187, -75, -228, 296, + -470, 177, -515, 318, 124, 308, 92, 371, + 3046, 362, -1, -1, -10, 1, 0, 0, + -356, -16, -199, 117, -75, 46, -108, -14, + -124, -173, 4914, -75, -474, 105, 87, 190, + -183, -208, 0, 0, 1, 1, 0, -1, + 162, 89, 49, -314, -2788, 265, -263, -3, + -3156, 316, 112, 128, -333, -138, -114, -141, + -287, -234, -1, 0, 0, 0, 0, 1, + 733, 126, -424, -389, 642, 432, 134, -251, + 407, -51, -151, -491, -308, 91, 50, 3836, + 87, 100, -5, -6, 0, 1, 0, 0, + 304, 1727, 83, -8, 216, -81, -189, 152, + -67, 15, 310, -93, 6, -37, 54, -110, + -15, 78, 0, 0, 1, 12, 0, -1, + 129, -198, 1, -48, -66, -147, 30, 264, + -84, 102, 42, 126, 1, -6451, 225, -51, + 8, 123, 0, -1, 0, -1, 0, 0, + -374, 66, -256, -80, -1139, 303, 2002, -199, + -98, -98, -39, -76, 180, 15, -456, 148, + -183, 118, -2, 1, 0, 0, 0, 0, + 151, 13, -114, 65, 6156, 76, -82, -30, + -26, 163, 81, 167, -83, -101, 55, -40, + 161, -793, -8, 0, 0, -1, -1, 0, + -102, -33, 55, -131, 434, 108, 70, 68, + 62, 1913, -109, 235, 110, 124, -25, -58, + -76, 18, -1, -1, 0, 0, 0, 0, + -105, -7322, -9, 82, 53, -43, -5, 18, + 90, 91, 20, -34, 26, -93, -50, -46, + -77, 105, 0, 6, -12, -6, 1, 0, + -1334, 980, -163, -351, -514, 537, 62, -300, + 80, -318, 14, -3570, -52, -116, -280, 540, + 250, -775, -7, 0, 0, 0, 0, 0, + 507, 317, -417, -236, -2438, -72, -346, 2507, + 302, -185, 30, 1539, 205, 87, -112, -482, + -296, 132, -1, 0, -1, 1, 0, 0, + -64, -208, -159, 1, 336, -62, -14, 13, + 81, 101, 382, 32, 116, -5, -41, 25, + -175, -7829, 1, 0, 1, 0, 0, 0, + 7551, -7, 86, -165, -57, -17, 183, -207, + 69, 54, -99, -25, 167, -58, 107, -81, + 165, 172, 2, -2, 0, 1, 0, -9, + 26, 28, 86, -183, -320, -32, 116, -53, + -49, -15, 133, -283, -152, 576, 6630, 185, + 44, 25, 20, 1, -12, 1, -1, 0, + -145, -51, -114, -29, -228, 78, -409, 235, + 147, 45, -192, 177, -91, 68, -2572, -52, + 81, 181, -5, 13, -1, -1, -17, 0, + -65, -23, -28, 9, 242, 14, -35, 88, + 77, -20, 37, -7097, -58, 51, 137, 126, + -90, 136, 0, 4, -1, 0, 0, 0, + -266, -82, -205, 816, -309, 3267, 1053, 369, + -216, -302, 18, 168, 395, 273, 343, 243, + -98, -53, 1, 0, 0, 1, 0, 0, + -65, -76, 1850, -991, -454, -535, 2927, -145, + 101, 23, 20, 234, -74, 77, 114, 4, + -106, 527, -11, 4, 0, 1, -1, 0, + 573, -46, 207, 2640, -956, 47, 26, -10, + 317, -217, -5, -867, -3, 213, 52, 53, + -428, -175, 0, 0, -1, -1, 0, -1, + -223, -55, 135, 184, 313, 0, 2868, 245, + -3187, -721, -291, 9, -265, -120, -105, -36, + 454, 55, -1, 49, 0, 1, -1, 0, + -291, 41, 84, 557, -201, -2300, 429, 283, + 21, -2, 132, 286, -124, 149, -14, 146, + 320, -298, 0, -1, 1, -2, 0, 0, + -86, -3493, 131, -3581, 185, 26, -197, -65, + -96, 147, -53, -150, -35, -35, 179, 68, + -157, 0, 0, 2, 0, 1, 2, -1, + -22, -218, 13, -1447, -400, 288, -1295, 0, + -119, 69, -56, -139, 157, -26, -122, -61, + -38, -108, -1, 1, 0, 0, 0, 0, + -229, 3335, 103, -108, 10, 3008, -712, 50, + 27, 152, -307, -106, 148, -77, -178, -46, + 7, -114, 0, -9, 0, 0, 1, 0, + 932, -443, 311, -75, 62, -80, -179, 459, + -232, -160, 2, 169, 134, -260, 41, -149, + 23, 92, -2, 0, 11, 1, 0, 0, + 16, -90, -574, -171, 163, 261, -299, 2994, + 74, -3818, -396, -171, 13, -29, -45, -168, + -287, -390, 1, 0, 0, -4, 0, -1, + 89, -702, 2223, 101, -249, 2983, 36, -333, + -382, 410, -262, 185, -146, 98, -8, -317, + -279, -879, 0, 0, 0, 0, 4, 0, + -98, -325, 75, -229, -13, 112, -5743, -34, + -89, 263, -155, 80, 140, -50, 33, 143, + -60, -77, 1, -2, 0, -1, 1, 0, + 52, -576, -543, -1142, -947, -184, 449, -71, + -75, -156, -3412, -50, -487, 307, 663, -1000, + -415, -2348, -7, -1, -1, 0, 0, 0, + 64, 3, -35, 11, 14, -198, -2, -8042, + 140, -11, -93, 29, -65, 330, 34, 110, + -19, -137, 2, 0, 0, 0, 0, 0, + 1236, 303, 2681, 234, -217, -406, -395, -380, + 247, 349, -101, -33, 370, -39, 139, 59, + 18, 24, 0, 0, 0, 0, 0, 0, + 166, -21, -5392, -117, -296, 114, 230, -255, + 131, -53, 13, -45, 200, 7, -56, 87, + 46, 223, -59, 0, -1, 0, 0, -1, + 214, -511, 175, 204, -123, -47, -440, 6, + 23, 92, -355, 80, -4885, -238, -37, 78, + -218, 175, 0, 2, 0, 0, 0, 0, + -146, 74, -13, -4, 27, -45, 51, 81, + -80, 53, -18, 173, -146, -64, -8, 8192, + 79, 15, 0, -3, 0, 1, 0, 0, + -3, -16, -28, 288, -61, 4, -187, 6, + -5, -14, 77, -12, -53, 16, -41, -7, + -10, -2, 7, -1, -9, 1, 0, 0, + -285, -35, -8, 221, -68, 114, 135, -8, + -203, -181, -91, 2043, -58, 127, 201, 111, + 46, -344, -11, -49, 0, 1, 0, -1, + -160, -186, 58, 4761, 289, 51, -145, 51, + -32, 71, 62, 175, -13, 181, 203, 141, + -200, 106, -1, 4, -2, 0, 0, 0, + 803, -76, -96, -940, 300, 3429, -84, 3037, + 262, -9, -39, 120, -629, -309, 233, -374, + 398, 894, -12, 1, 1, 1, 0, 0, + -282, 2525, -31, -176, -2473, 53, 102, -610, + 180, -145, 42, -51, 223, 27, -69, 727, + -14, -51, 0, 0, 0, -3, 0, -40, + 214, 72, 41, 1, 190, 78, -228, -235, + 105, -4619, -140, -46, -7, 49, 9, -19, + 137, -2, 9, 1, 0, 0, 0, 0, + -142, -262, 29, -142, 39, -39, -92, 95, + 50, -282, 2, -106, 114, 8, 35, 78, + -121, 2589, 1, -4, -10, 1, 1, 0, + -192, 59, 287, 400, -67, -6989, -301, 446, + 115, 7, 33, -60, 111, 102, 8, 206, + 46, -31, -1, -1, -2, 0, 0, 0, + -104, 332, -223, 1066, -188, 1270, -222, 309, + -296, 259, 780, -460, -1914, 218, -556, 210, + 2962, 130, 1, -2, 2, 0, 1, 0, + -320, -365, -266, 822, -119, 824, -312, 58, + -1857, 235, 48, -3985, 118, -307, -703, -931, + -560, 105, -2, -3, 0, 0, 0, 1, + 156, -48, 187, 214, -212, 180, 342, 373, + 1973, 128, -5, 146, -40, -11, 71, -60, + 76, 17, 0, 0, -1, 2, 0, 7, + 214, 63, 274, 2876, -65, 314, 400, 344, + 140, 39, 193, -226, 124, -3177, 68, 46, + -60, -317, 2, 0, -1, 0, 7, 0, + -160, 118, 233, 239, -465, 96, 253, 3178, + -88, 299, 368, -220, 197, 397, -353, -463, + -202, -103, -4, 0, 0, 0, 0, 0, + 687, -448, -749, 87, -35, 112, 309, -33, + -16, 88, 141, 63, -51, 274, -113, -76, + 46, -273, -1, 1, 0, 1, 0, 1, + -298, -206, 670, 303, -451, -277, -493, 404, + -173, 284, 148, 626, -322, -296, -68, 3044, + -442, 1138, -7, 2, 0, 1, 0, 0, + -1338, 18, 2862, 223, 250, 260, 144, 259, + -38, -647, 602, -160, 75, -5, -8, 34, + 237, 50, 2, 0, 1, -1, -1, 0, + -412, 2153, 933, 478, 768, 186, -424, -657, + -3458, -443, 294, 224, -468, -58, -120, -1565, + 211, -420, 0, 0, 1, -1, 0, 0, + 198, 227, -112, 350, 297, -303, 108, -192, + 153, 32, -2717, -111, -1093, -200, 476, 326, + -271, 627, 0, -4, 0, 0, 0, -1, + 462, -616, 126, 316, -2413, 204, -350, -3549, + -263, -386, -112, 483, -1339, 636, 70, -531, + 96, 38, 8, -1, 0, -3, 0, 0, + -310, -1128, 616, -339, -168, -124, -905, -151, + -383, 76, 137, -44, 3689, -388, 184, 1799, + -102, -930, 6, -1, -1, -1, 0, 0, + -284, 280, 39, -728, 143, 15, 181, 798, + 382, 10, 2267, -12, -3582, -27, 357, 514, + -565, -121, 0, -1, 0, -9, -1, 0, + 429, -16, 2993, -2903, 47, -136, 30, 792, + -327, -347, -69, -50, -93, -223, -438, 158, + 203, -475, 0, -4, -1, 2, 0, 0, + -3465, 415, -963, 252, 397, -945, -448, -231, + -130, 673, 504, 55, -355, 221, 29, 167, + -19, 134, -1, -1, -4, 0, -14, -2, + 44, 433, -535, -216, 2485, 33, 19, -100, + -185, -171, 91, 336, -208, 140, -3, 46, + -67, -116, 32, 0, 5, 3, 0, 0, + 220, 91, -65, -15, -169, 217, -183, -169, + -47, 181, -272, 138, -166, 110, -9, 41, + -6957, 33, -5, -2, 1, 1, 0, -1, + 164, -4062, -109, 230, -220, 1748, -1338, -246, + -242, -98, 300, 217, -202, -130, 157, -3, + -19, -453, 0, 2, 0, 0, 0, 0, +}; + +static const int16_t cb0806sl1[] = { + 75, 87, -31, 607, -132, 5963, -262, 494, + 134, -4, 141, 19, 225, 229, 239, 93, + -20, -189, 2, 0, -3, -1, -1, 0, + 214, -206, 877, 83, -588, 83, 132, 78, + 5, -85, 66, -24, 47, -11, 25, 26, + -3, 46, 2, -5, 0, 1, -1, 0, + -113, 295, -81, 74, 223, -50, -93, -5671, + -28, 115, 256, -228, -31, -539, 300, -278, + -59, 426, -110, -1, 1, 1, 0, 0, + -95, -116, 266, 176, 761, -3, 90, -91, + 98, -209, -414, -27, -56, 26, -76, 6, + -32, 4634, 1, 0, -4, 0, 0, 0, + 177, 147, -236, -93, -7925, 11, -111, -74, + 36, 176, 352, 88, 112, 16, 144, -110, + 91, 329, -1, 2, 0, 1, 0, 1, + 119, 304, -94, -422, 113, 129, -70, 155, + 247, -116, -139, 327, -355, 77, 143, -5362, + 27, -377, -1, 7, 2, 1, 0, 0, + 179, 127, 1500, -324, -15, 673, 184, -1382, + 167, 1833, -3058, 200, -1203, 459, -1905, 1020, + -259, -120, 10, -4, 0, 1, 0, 0, + 995, -112, 37, -160, -21, -4011, 172, 228, + -210, 80, -131, 1, 20, -128, -252, -288, + -132, 337, -1, 0, -1, 0, 1, -1, + -60, 61, 197, -185, -40, -2951, -592, -57, + 210, -3248, -226, -44, 391, -167, -7, 219, + -15, 172, 0, -1, 1, 0, 0, 0, + 106, -70, -291, 192, 45, 162, 37, 143, + 91, 21, -7032, 12, -173, -30, 1, 259, + -286, 387, -36, 0, 0, 0, 0, 0, + -1593, -210, 83, 47, 194, 61, 85, -182, + -23, 40, -74, 22, 12, 216, 59, -165, + -163, -159, -8, 0, 0, 2, 0, 0, + -3, 182, -80, 2068, 702, 115, -164, -85, + 21, -124, -191, -113, 263, 138, 4235, 37, + 204, -436, 0, 24, 1, -1, 0, 0, + 147, 83, -177, -168, -609, -9, -16, -46, + 127, 120, -25, 3435, 51, 31, 49, 366, + 31, -129, 1, -32, 0, -1, 0, -2, + 295, 158, 116, 11, -280, 471, 169, 29, + -2589, 338, 32, 299, 172, -187, -32, 437, + -38, 359, -1, -1, 1, 0, 0, 0, + 243, 413, -29, -4774, 187, 12, -117, 168, + -114, -208, -55, 5, 0, -31, 436, 545, + -45, 272, 0, -4, 0, 0, 1, 0, + 127, 38, 6620, -33, -103, 34, 84, -35, + 30, -131, -8, -79, -126, -98, 17, -75, + -31, -176, 14, -1, 0, 0, -1, -1, + 273, -219, 176, -83, 187, -36, 1, 2639, + 158, 3812, 127, -233, 175, 310, 148, 387, + -14, 308, 0, -3, 0, 0, 0, 0, + 3321, -447, 153, -128, 254, -275, 79, -181, + 17, 146, 61, 46, -48, 253, 51, -17, + 1, 1, 0, 1, -1, -2, 0, -13, + 791, -130, 40, 78, -64, -179, 42, -455, + 422, 112, -19, -4499, -113, -341, 52, 69, + 67, 254, -6, -1, 4, 0, 0, 1, + -98, -976, 68, 1563, 228, 1018, 458, -1020, + 411, 249, -627, 2321, 738, -460, -1469, 362, + 884, -261, 0, -1, 1, 1, 0, 0, + -601, 378, -71, 61, -160, 800, -386, -773, + 303, -53, 248, -22, 59, -3809, -61, 102, + -45, 395, 0, 0, 28, 0, -12, 0, + 717, -424, 499, 296, -15, 11, 2732, -103, + -119, -116, 107, -50, 462, 73, -82, 75, + 41, 131, 0, 3, 1, -1, 0, 0, + -134, 109, 48, -1847, -205, -6, 20, -203, + 136, 197, 113, -77, -124, -50, 184, 225, + -175, -295, -1, -1, -6, -1, -1, 0, + -59, -2017, -193, -237, 226, 630, 1950, -2, + 179, -3666, -34, 140, 88, 157, 51, 81, + -263, -169, 1, 0, 0, 0, 0, 0, + 229, -14, -1590, -123, 162, 63, -224, -332, + 119, 2931, 21, -48, 406, 15, 320, -51, + 64, -228, -9, -1, 0, -1, 0, 0, + -453, 84, -320, -654, -4, -91, -61, 558, + -61, -233, 31, -224, -105, 63, 86, 3771, + 162, -1535, 3, -3, 1, 1, 0, 1, + -1992, -279, -59, -3048, -1696, 102, -168, 194, + 172, -142, 55, 134, 116, -146, -29, -287, + 102, 265, -3, 1, 0, 1, 0, 0, + -96, 46, -16, 2474, -58, -712, -25, -294, + 187, 22, -39, -102, 62, 2666, -237, -1, + 32, -41, 0, 0, 0, 0, 0, 0, + -282, -25, -198, -862, -127, -379, -210, -20, + 45, -79, -2805, -364, 575, 106, 215, -410, + -76, 511, 15, -44, -1, 1, 0, 0, + 329, 224, 130, 43, -1, -255, -51, -297, + 4529, 52, 186, 757, -68, -89, 46, 250, + 46, -79, 5, 1, 0, 1, 0, -19, + 79, 74, 65, 256, 260, 492, -106, -217, + -357, 20, 166, 233, 132, 165, 18, -1, + 4445, -22, 5, 3, -7, 0, 0, -6, + -922, 2156, 269, 1385, 235, -206, -94, 130, + 112, 145, -126, 166, 1, 45, 83, 36, + -153, -255, 0, -1, 0, 0, 1, 0, + 241, -237, -117, -510, 85, 7, -4418, 30, + 94, -92, 99, -71, 140, -265, 149, 69, + 286, 104, 0, -2, 1, 0, 0, 0, + -165, 22, -245, 29, 50, 145, -53, 1641, + -40, -128, -112, -190, 47, 53, -247, -50, + 88, 39, 1, -1, 0, 0, 0, 0, + -288, 130, 88, -132, 4055, -7, 55, -105, + 277, 81, 69, -66, -53, 52, -56, 90, + 160, 386, 1, -4, 0, -2, 0, 0, + 107, 124, -39, 40, 25, -6, -248, -81, + 70, -13, 46, 5, 20, 24, -5, -2, + -41, -34, 1, 1, -8, 0, -4, 0, + -61, 1, 457, 454, 768, 89, 640, 61, + 66, -360, -2727, -155, -370, -44, -292, 570, + 34, -3209, -5, -1, 1, 0, -1, 0, + 22, -82, -20, -125, -91, 98, 7843, 25, + -2, -31, 2, -52, -73, -25, 31, -35, + -6, -114, 1, -1, 2, 0, 0, 0, + 217, -5202, 86, -76, -76, 109, 389, -95, + -253, 124, 130, 58, 190, -44, -67, -142, + 54, 6, -1, 1, 1, 1, 0, 0, + -183, 547, -200, 348, 372, 437, 425, 547, + -457, 388, 87, 38, -522, -210, -556, 41, + -2979, -17, 7, -4, 6, 0, 0, 0, + 189, 196, 240, -75, 46, -50, 101, -160, + -16, -223, 92, 71, -7633, 78, 90, 69, + 190, -75, 2, 1, -2, -1, 0, 1, + 205, -433, -267, -175, 3068, -210, -514, 330, + -3099, -273, 155, 132, -306, 361, 316, -53, + -421, -125, -3, 0, -11, 0, 0, 0, + 179, -38, 151, -36, 215, -102, -145, 139, + 50, 200, 383, 37, 3102, -27, 9, -157, + -68, 367, 1, 1, 0, 0, 1, 0, + -50, 177, -24, 24, 119, 4, 76, 99, + -111, -7367, 26, 51, -11, -146, -125, -48, + 54, 50, 1, 0, 0, 0, -1, 0, + -71, -16, -184, -61, -36, -151, 79, -128, + -102, 135, -228, 190, -79, -10, -176, -113, + 1008, -856, -13, -4, 8, 28, 0, 1, + -4909, -93, -167, -141, 51, -203, 71, -199, + -49, 106, -142, -94, 126, -225, 158, 36, + 269, 159, 0, 1, 1, 0, 0, -5, + -61, -79, -20, 306, 67, -621, 1774, 346, + -442, 125, 305, -170, 55, -2537, -103, 118, + 87, 505, 16, -7, -2, 0, 20, 0, + 35, -154, -158, 224, -36, -344, 79, 4232, + 234, -219, -71, 204, -484, -131, 1153, 23, + 111, 499, 5, 0, -17, 0, 0, 1, + 1135, -3469, -489, 2572, -450, -432, -358, -34, + -78, -10, -775, 17, -131, -154, 218, 82, + -312, 279, 1, 0, 1, 0, 0, 0, + 96, 230, 18, 47, -5, -102, 646, -122, + 35, -81, 183, 171, -1479, 201, 84, -24, + 143, 302, 1, 5, 0, 0, 0, 0, + -34, -48, 89, 7789, -85, -27, -56, 46, + 39, 30, 98, -40, 138, -147, 104, -35, + -41, -151, 1, 9, 1, 0, 0, 0, + -140, -1970, -170, 273, 226, 33, -324, -38, + 11, 188, 603, 188, -183, 98, -58, -67, + -63, 7, 0, 0, 0, 0, 1, 0, + 384, 899, 493, 765, -1062, 646, 275, -2699, + 93, 796, 120, -25, 177, -85, 721, -189, + -295, -436, 0, -1, 0, 0, -1, 0, + -358, 117, -2435, 325, -3137, -158, 23, 97, + 6, 204, 288, -426, 156, 22, -101, 171, + -56, 235, 0, -1, 0, -1, 0, 0, + 656, 3878, -286, -383, 75, -50, 114, -377, + -105, 106, 154, -30, -204, -105, 171, -56, + 230, -587, 0, 1, 0, 8, 1, -1, + -58, 177, -7, 45, -159, 405, 45, 84, + -206, 77, 277, -259, 121, 3719, 140, 79, + -202, 843, -8, 0, -1, 1, -2, 0, + -248, 560, 2651, -49, -625, -147, -2416, 119, + -70, 87, 137, 18, -401, -147, -598, -150, + 239, -1004, 7, 3, 13, 1, 1, 1, + 276, 342, 97, 600, 230, 95, 213, 159, + -259, -25, -176, 3360, -283, -325, -37, -2626, + -151, 178, -1, -18, 0, 0, 0, 0, + -233, 237, -78, 290, -284, 141, -20, 146, + 58, -21, 73, -35, -101, -23, -4068, -116, + 49, -196, -5, -2, 0, 1, -1, 0, + -292, -195, 51, -714, 172, 44, -119, 134, + 168, 107, -74, -2379, 308, 173, -252, -3470, + -135, 641, -10, 0, 0, 1, 0, 0, + 146, 2060, -84, -164, -247, 26, -1724, 216, + 226, -2499, 312, -66, 850, 41, -1, 20, + -1339, 411, 0, 0, -1, -12, 0, 0, + 921, 17, -3510, -119, 325, 34, -97, -205, + 3, -188, 252, 91, 0, -135, -76, 208, + 199, -202, -1, 1, 1, 2, 0, -1, + -88, -461, 319, -963, 266, 1540, 643, -3424, + 76, -1058, 501, 342, 297, 268, -158, -103, + 26, -30, 0, -1, -1, 0, 0, 0, + 211, 245, 183, 1579, 106, 26, -3450, -22, + -1053, -266, -736, 113, 475, -241, 117, -85, + -492, 372, 0, 1, 1, 0, 0, 0, +}; + +static const int16_t cb0806ss0[] = { + -381, -1638, -8192, 5, 983, -1481, -20, -719, + -238, 767, 571, -200, 754, 460, 1678, 1376, + -155, -1998, 294, -455, 80, 2, 26, 3, + 10, 25, -931, -1098, -1166, -3221, -1995, 702, + 104, -2429, -2270, 1372, 2326, -37, -1492, 1692, + 644, -1283, 363, 624, -483, -15, 346, -6, + 2, 0, 1, 3, 2, -2429, -8192, -956, + 1190, 706, -955, 367, 959, -194, -723, -1104, + 375, 554, -962, -229, 66, 368, 18, -150, + 56, 968, -15, 0, -1, -5, 0, 9, + -250, -720, 1910, 827, 198, -645, 2021, 32, + -1972, -705, 441, 373, 800, -2293, 1747, 1504, + -537, -1731, -1192, 1597, -4031, 24, 0, -2, + 1, 1, 1, -131, 1594, -153, 1127, 2732, + 469, -558, -11, 1190, 115, -933, 1988, 1841, + -4530, 1385, 571, 2399, 1709, -63, -3663, -2681, + 57, -4, 11, -4, 0, -3, 426, -4257, + 2755, -76, -1667, 2450, -373, 3375, -91, -232, + 511, 648, 886, 1182, 1667, 65, -3029, -579, + 865, 2186, 2911, 537, 0, 2, -3, 0, + 7, 585, 8192, -2855, 8192, 5527, -5491, -1926, + -4231, -1204, 1953, -1193, 191, 3278, -1726, 259, + -2794, 4205, 4315, -6121, -606, -1922, 3666, -324, + -238, -313, -720, -1447, -539, -794, 3151, -1726, + 3444, 876, 584, -671, -497, 407, 909, -2183, + 2575, 246, -673, 270, 824, 1784, -201, 7329, + 589, -70, -1, 4, -5, -3, -8, -417, + 382, 2786, -972, 520, 1154, 886, 521, 6032, + -687, 3791, -522, -1226, 608, 428, 891, -1524, + -1015, 1147, 1278, 559, -6, 3, 0, 6, + 2, -3, 115, 3586, -2847, 95, 460, 2832, + 2326, -1665, 1720, 453, 965, 1154, 452, -1721, + -1375, -269, 2138, -2032, 55, -674, -870, -124, + 0, 5, 0, -5, -3, -283, 1077, 2604, + 1270, -1082, -1753, 6840, -2502, 988, -1790, 1378, + 1231, 438, -1188, 286, 540, -138, 1054, -111, + -2321, 74, 56, -3, -2, 0, -32, 5, + 1539, -1399, 7413, -903, -1698, 1781, -255, -466, + -1436, 3419, 1916, 852, 590, -1126, -1617, -1309, + -5560, -241, 3363, -1225, 2682, 620, -6, 58, + 2, -186, -17, -2959, 619, 2228, -2627, -3119, + 730, 3716, -538, -101, -1863, -516, 142, -2384, + -1514, -5506, -825, 514, 714, 746, -2790, 569, + -425, 4, -68, 70, 24, 12, 817, -276, + -3363, -2942, 103, -581, -925, 651, 561, 43, + 434, 712, -541, -2042, -1291, -453, -443, -4312, + -1344, 1277, 605, -4, 0, -1, -1, 1, + 2, -930, 276, 3219, -404, -944, -497, 840, + 278, -98, -1432, -1136, -1975, -1863, -1102, -1446, + 938, 693, -5186, -1, 1085, -2275, 1, 1, + -1, -1, -2, 3, -1194, -312, -1257, 1973, + 1570, -1703, -1637, 639, -855, 1925, 970, 604, + 1313, 780, -5170, -603, 220, -731, 2952, -872, + 166, 30, 0, -2, -1, 3, -1, -743, + 504, 1363, 1436, 1632, -634, -709, -2346, 87, + 1149, 3468, 2132, 3028, -1039, -92, 2087, -990, + -301, 966, -773, -1057, 42, 0, -2, 0, + 2, 2, 252, 217, 3625, -2323, 212, -381, + -1121, 1664, -307, 1680, 2193, -1854, -187, -3100, + 254, -673, 595, 1995, 669, -687, -509, 13, + 0, 8, -3, 11, -3, -552, -87, 6, + 2933, -267, -1392, 40, 644, 32, 2966, -1386, + -2480, -956, 1160, 1399, 1049, 3902, -2092, -525, + 1724, 69, -33, 0, -2, 0, 2, 2, + -452, -4739, -3237, -510, -598, -1397, 855, 1573, + 2143, -79, -1546, -17, -973, -2400, 1689, 133, + -1213, 784, 726, 916, -388, -390, 1, -1, + -3, -1, 0, 170, -205, -2905, 8192, -465, + 3119, 4407, -709, -403, 859, -373, -1301, -1397, + -750, -88, 277, -2097, -222, -134, -88, -1189, + 974, -56, -57, -83, -21, 102, 626, -114, + -2304, 979, -1836, -868, 1261, 2226, -261, 579, + 983, 655, -2578, 1803, 117, -1128, 365, 3971, + 3539, -21, -790, -62, 2, 3, 23, -3, + 31, 1273, 3212, -1617, 4116, -281, 725, -284, + 1079, 293, -3759, 2581, -1617, -259, -19, -1999, + 3040, -3077, -1522, 1056, -92, 897, 243, -1, + 36, -19, -10, -46, 231, 1129, 363, -1978, + -882, -1788, 319, 4807, -1707, -1379, -1465, 2327, + -827, -681, 410, -1816, -2507, 1036, 740, 730, + -687, 100, -1, -1, -1, 1, -4, -276, + 303, -2331, -2912, -1864, -3694, 412, -1218, 1642, + 4448, 658, -213, 872, 2867, 227, 868, -590, + 2293, 1759, -1666, -1585, -140, 1, -3, -1, + 26, -10, -287, 898, -2442, 3997, -1655, -1341, + -56, 689, -1869, 572, -2044, 616, -2603, -278, + 2987, 2397, -2055, 247, 128, 598, 1732, -146, + 0, 3, -1, -3, 5, 842, 597, 779, + -1529, -802, 2142, -1668, 2339, -3550, -2651, 1733, + -1531, -46, 600, 618, -867, -665, 1524, 392, + -1386, -3279, 45, 0, 9, -7, -3, -8, + -224, -2632, -147, -505, 2223, 1773, 1799, -1696, + 194, -1186, -543, 775, -1171, 5491, -2319, -3193, + -313, -355, -133, -1097, 125, -22, -2, 2, + 1, -3, -10, -354, -1447, -662, -313, -4302, + 3888, -121, -323, 1112, -801, -1513, -814, -1646, + -616, -1207, 347, 483, 670, 900, -35, -885, + 14, 1, 0, 1, -2, 7, -432, -486, + -1539, 785, 4853, 904, 925, 895, -1223, -2464, + 3395, -506, -808, 207, 197, 874, -928, 1347, + -107, 1512, 1063, -182, 1, -4, -1, -6, + 3, -1236, -1047, 774, 26, -630, 863, 1055, + -2632, -1187, -534, -619, -1079, -2574, -2037, 658, + 1229, -262, 2702, -3393, -2187, 1764, 66, 0, + 7, 0, 7, -3, 677, -444, -2111, -5256, + -4485, -1667, 2077, 1613, 1483, -1520, 1600, 1767, + 1148, 2054, 1676, 1866, 783, -2199, 765, 568, + 2779, -683, 4, 17, 0, -32, 15, 45, + 228, -2445, 752, 2510, -1657, -1039, 113, 1107, + -1054, -1765, -1245, -2527, 589, 455, 328, 640, + -579, 2370, 1313, -540, 31, 1, -1, -4, + 2, -3, -235, -560, 455, 3809, 102, 403, + -21, 1844, 402, 148, -32, 5573, -3765, -265, + -718, -399, -349, 366, -1105, 91, 1881, 34, + 1, 1, 5, 0, 9, 289, -1146, 795, + -2504, 412, 1156, -302, -946, 2063, -2569, -273, + -1434, 141, 642, -631, 4856, -1008, 169, -40, + 191, -2293, -86, 6, 1, -2, 0, 1, + 139, 1955, -1111, -944, 140, -1074, 1071, -1312, + -541, 664, 1801, -892, 1605, -1750, -654, -680, + -8102, 120, -24, 1014, -351, -120, 0, -2, + 1, -1, -1, 1038, 5199, 779, -1195, 128, + 462, 184, 3705, -1292, -2247, -2481, 2610, 4396, + 4161, 4039, 1111, 838, 188, -571, 2811, -1915, + -1909, 13, 99, -20, -2, 11, 395, 155, + 2667, -202, -2639, 1303, -912, -1734, 1097, -583, + 3532, -218, -1514, -3881, 378, -46, -1189, -957, + -3010, -743, -648, 15, 1, 3, 3, 4, + -4, 330, 198, -275, -677, -8192, -629, 1953, + -783, 592, 926, 1487, -39, -1002, 1134, 1560, + -27, -118, -1363, -360, 2163, 442, 92, 1, + 1, -2, 5, 1, -670, 326, 2773, 1346, + -26, 327, 184, -1091, -121, 576, -1324, 212, + -645, 860, -2111, -493, -2119, 316, -688, 475, + -652, -33, 0, 1, 2, 0, -3, 92, + 170, 6224, 2162, 761, -1994, 2176, 1692, -1773, + 561, -966, 3406, -20, -593, 574, -681, 1121, + -335, -412, -2651, -4712, -79, 1, 2, -1, + 4, -6, 932, -2579, 344, -2614, 1119, 6623, + -314, -1068, 338, 1977, -1375, -1338, -1996, 1310, + 118, -500, -393, 622, -1798, -1232, 3, -75, + 0, 17, 0, -2, -9, 715, 8135, 400, + 3748, 2156, 1882, 772, 2728, -403, -775, 2110, + 1603, -766, -2592, 767, -618, 4727, 668, 2280, + -1157, 1246, -794, -14, -2, 2, 5, 16, + -107, 642, -1806, -158, -2447, 309, -764, 2313, + -101, -766, 209, -691, 2001, 268, -273, 615, + 803, 6062, -434, 1287, -543, -3, 0, 0, + 1, 1, 0, 503, -598, -2043, -1160, 1074, + 1255, 3269, 1405, 1182, 197, 3098, -138, 2326, + -244, -772, 901, -225, 337, -65, -536, -331, + 15, 2, 13, 8, -3, 20, -32, -52, + -1012, 232, 1502, -17, -1574, -741, -57, 164, + -22, 74, -181, 1616, 296, -1483, 1387, -357, + -5380, -322, -1346, 6, -3, 2, -3, 1, + 0, -392, -811, -650, -485, 3038, 2750, -776, + -503, -1664, -323, 253, -280, -3459, -1313, 541, + 2182, 1287, -782, 1785, -695, -49, 72, -4, + 0, -15, 3, -21, -211, 1382, -149, 684, + 2210, 2654, -1440, -1209, 152, 1080, -3078, -694, + 4738, 985, -1337, 819, -518, 1799, -671, 3201, + 2636, 7, 1, -6, 14, -31, 0, -34, + 4296, -23, 194, 1976, -993, 1353, 709, -342, + -1142, -140, -271, 2291, -709, 1734, 818, -3571, + 1125, 912, -590, 784, -275, -2, -1, -5, + -1, 0, -381, 2754, 1545, -2270, 3608, 2308, + -1899, 178, 391, 1826, -127, -1417, -822, -712, + 1682, 2225, 2247, 446, 994, 56, 734, 196, + 7, 3, 8, 0, 7, 639, 833, -3313, + 675, -263, -648, 3016, -701, 235, -1304, -582, + -2930, -210, -1243, 374, -3095, -2013, 354, 599, + -1469, 140, -17, -1, -3, 2, 0, -2, + -183, 399, -603, 796, -1424, 2685, -3929, 416, + -2291, 1737, 1906, 1667, 810, -222, 3242, -3636, + 5196, -1542, 940, -124, 2047, -67, -4, 6, + -1, 13, 2, -161, 417, 4132, 492, -1068, + -817, 2732, -250, -1457, 1723, 2104, 1121, -1276, + 1147, 990, -523, -1533, 297, 1219, 3901, -2549, + -22, 0, 0, 0, 0, 2, -1632, 172, + 829, -747, -1229, -1990, -1070, 1134, 1623, 228, + 3689, 625, -757, 8192, -82, 738, 213, 1900, + -1200, 91, 892, -45, 15, -1, 5, -4, + 5, 392, -3067, -1903, 139, 661, 43, 2174, + -1919, -270, -1490, -569, 2, 85, -1091, 6740, + 886, 85, -1052, -647, -563, -2971, -145, -1, + 39, -5, -6, -7, -1023, -1104, -1774, -3154, + -1058, 3488, -2551, 3547, -253, -204, -235, -1544, + -73, -584, -302, -3118, -2314, -308, 1790, 916, + 152, -155, -11, 6, -26, -1, -31, 21, + 919, -1856, -456, -1050, 663, 1454, -1515, -2606, + -4287, 1553, 3564, 1334, 1797, 1540, -392, -701, + -971, -3442, 281, -271, 133, 1, 5, 4, + 32, 3, -521, -1530, -1368, 1787, -515, -913, + -2391, 93, 2690, -578, -576, -1656, 554, 649, + -1509, -258, -605, 1233, -2258, 640, 837, -43, + 1, -3, 0, 5, 3, 148, -4761, 1783, + 3244, -277, -1139, 1539, -2016, 1898, -1276, -776, + -1725, -1900, -51, 559, 311, 1737, -928, 3687, + -1087, 1329, 134, 2, -2, -7, 9, 5, + -77, -1116, 4986, -940, -905, -3229, -773, 3335, + -23, 578, -2376, 386, 122, 1253, 363, -2748, + -512, -4612, 1690, 848, -1116, 195, 5, 2, + 11, 1, 18, 659, -1282, 562, 1170, 4701, + 903, 490, -3508, 3468, -39, 654, -1196, -909, + -268, 980, 283, 3221, 348, 1121, -897, -1011, + -103, -11, -2, -9, 16, -8, -274, -4100, + -2312, -2379, 617, 1629, 2154, 3026, -1737, -603, + -803, -366, 977, 1035, -1835, -255, -275, -1245, + 1274, -161, -4476, -181, -4, 0, -2, 1, + 2, 156, 551, -832, -630, 3740, -2115, 344, + 229, 1295, 65, 290, -1462, -1794, 3297, -1049, + 2451, 322, -2642, -2810, -1246, 613, 90, -1, + -1, 0, 0, 0, -277, 854, 1259, 1542, + -433, 3601, -453, 1091, -113, 1438, 994, -2746, + -786, 867, 1422, 1093, -1723, -1167, -1389, -1062, + -436, -81, 2, 1, 11, 1, 26, -197, +}; + +static const int16_t cb0806ss1[] = { + 1760, -4335, 6384, -2036, 2874, -2504, -1529, 102, + 6995, -1267, -3141, 1050, -59, 1556, -1002, 1536, + 1024, 1867, 40, -1156, -2627, -213, -1034, -660, + 291, -963, -323, 462, -804, 2219, -859, 1709, + 550, -3390, 319, 24, 644, 3154, 4503, -1961, + 744, 194, -151, -1255, -1318, 3033, -899, -18, + 1, 0, 2, 0, 28, -1213, -3725, -2525, + -177, -1164, 361, -357, -649, -459, 1324, 2463, + -3108, -3323, -575, -2744, -108, -121, -508, -564, + -849, -773, -288, 0, 8, 0, -2, 5, + 691, -602, 2269, 2373, -2027, 786, 3011, 3234, + -1387, -310, 659, -358, 1058, -1554, 1031, 795, + 2254, -549, 334, 325, 599, -36, -1, -1, + -2, 3, 4, -450, -533, -1657, -1928, -1034, + -636, -1446, -320, 2695, 1184, 697, 1126, 1159, + 2970, 449, -30, -2058, -1171, -684, -66, 905, + -43, 1, 0, 3, 0, 3, 228, 272, + -79, -718, 1978, 667, -2760, 1507, -1893, -796, + 1164, 35, -4440, -4492, -1667, 4189, 6485, -495, + 1721, -1639, -526, 458, 0, 385, -183, 511, + -153, -2025, -376, 2948, -2606, -910, -741, -427, + -1080, 2128, 565, -483, 1791, -2222, -45, -1204, + 799, 512, -4790, 1462, 511, -1906, 15, 0, + 0, 1, 3, 8, -867, -685, -140, 5299, + 376, -891, 1657, 1843, -1465, -1297, 518, -4640, + 303, -277, -650, -97, 2308, -679, 720, -171, + -475, -269, 0, -5, 4, -1, 9, -1155, + -4954, 1684, -2045, 939, 819, -751, -165, -93, + -2327, 306, 965, 4999, 557, -55, -999, 30, + -36, 989, -1680, -1594, 318, -3, -8, -4, + 1, -9, -402, 8192, 475, 2080, -418, -1739, + -273, -55, -441, 794, -79, 272, -2039, 789, + 2266, 874, 2495, 627, 2203, 1212, -1052, 389, + 14, -24, -59, 10, 133, -535, -1160, -1139, + -146, 180, 1064, 3718, -1412, 1153, 1873, -549, + -1698, -1479, 209, 725, -940, 2152, 1848, 678, + 2493, 4608, -11, 0, -1, -3, -3, 2, + 334, 681, 673, -8192, 3958, -3111, 1641, 1500, + 1184, -268, -3147, 571, 958, -663, -1031, -870, + -674, -1098, -529, 78, 1212, 120, -8, -13, + -5, -42, -37, -498, 1304, -2541, 1730, -355, + 1462, 2315, 2017, -403, -2010, 555, 1391, 887, + 2039, 366, 135, 85, 371, 1291, -225, 335, + -45, 0, 1, 2, -1, 2, -1095, -261, + 3249, 3212, -1877, 934, -1671, -1289, 1398, -2287, + -205, 1659, 642, 1105, 751, 2864, 1171, -1001, + 318, -290, 60, -54, 5, 3, 5, 2, + 1, -105, 590, 36, -194, 1832, -639, 777, + 3243, 578, 2820, 428, 2020, 623, -2104, -52, + -331, -1015, 3064, -347, -303, -1100, 61, -1, + -1, 0, 2, -1, 592, 127, 887, -1094, + -2819, 2573, -2670, -1693, -2775, 48, -266, -961, + 1220, -472, 167, 3201, 1118, -173, 1304, -26, + -899, 76, 0, 3, 0, 1, -1, -718, + -746, 947, -524, 142, 958, -1609, -777, -1362, + 385, -578, -6947, 157, -290, 1357, -1703, 484, + 117, -2224, -3736, -838, -96, -1, 11, 5, + 4, 2, 475, -426, 500, -767, -2304, 1248, + 2200, -1829, -992, -225, -573, -1107, -832, 2555, + -2866, 3453, 4335, -88, -1160, -1666, -94, -33, + 0, 0, 1, -2, -7, -147, -8192, 1204, + -1181, -702, -604, -770, 1032, -173, 770, 861, + 611, -509, 802, -467, 839, 491, -785, 523, + -669, 73, -34, 0, 0, -2, -3, -3, + 286, -2183, -1238, 1743, 387, -2228, -1404, -3439, + -1701, -2371, -451, 2294, 2061, 3062, -1122, -1489, + -1274, 51, 5649, -170, 2197, 365, -1, -13, + 4, 3, -5, -15, -4099, 789, 4132, 4982, + -1996, 784, 748, 2123, 3535, -1493, -1454, -344, + -867, 40, 831, -1198, 66, 542, 1633, -2402, + 117, -119, -18, 49, 18, 40, -500, 808, + -726, 1192, 3623, 1526, -484, 1080, -2502, -579, + 1315, -1887, 84, 1771, -2902, 1387, -1098, 1559, + -1126, 652, -896, 32, -1, 3, 1, 3, + -2, 233, 782, 8192, 566, -701, -352, 1047, + 581, -1070, 3159, -1157, -1585, 1599, -978, -663, + -931, -2581, 5074, 781, -551, -590, -247, -63, + -54, -50, 253, -138, -313, 387, -3004, -1136, + 654, -1283, 1318, 434, 80, -1486, 694, -512, + 393, -238, -700, -232, 706, 1478, -8192, 377, + 601, 18, -1, -3, 0, -6, -3, 2221, + 3531, -862, 1792, -242, -3686, 420, 1891, 918, + 1324, 234, -819, -601, 2363, -1097, 2355, 754, + -125, 245, -615, 3285, 204, 0, 6, -4, + -3, -1, -637, 673, 1233, 2886, 265, -195, + -226, 2521, 281, -210, 1809, -2733, -3865, -2287, + 641, -2604, -4235, 107, 789, 1163, -2600, -463, + -5, 10, 2, -10, 39, 1380, 754, -5077, + 4061, -1633, -1738, -1604, 1937, 1815, 1039, 3696, + -593, 2218, -1061, 1081, -1217, 2062, -637, -1580, + 149, -626, -253, -3, -17, 2, 33, 1, + 118, 525, 158, 1213, 910, -105, -1437, -1311, + 2255, -419, -2394, 1542, -3830, -1167, -998, -1099, + 1635, 1678, -1112, -275, 122, -50, 0, 3, + 0, -1, -1, 998, -4020, -1913, -1083, -159, + 1853, -436, -683, 298, 211, 711, 4128, -1977, + -958, 1048, 642, -420, 329, -1150, 459, 2161, + 29, -4, 0, -1, -6, 1, 1365, 1053, + 1032, 952, 854, 2405, 5106, 1863, 3049, 981, + -863, -397, 508, -1283, -631, 17, 532, -1453, + -1056, 66, 501, -27, -1, 3, -1, -13, + -2, -273, -2924, 839, -433, -395, -252, 1945, + 195, -307, -1297, -1474, -985, 4412, -1017, 1074, + 2711, 996, 919, 183, -10, -605, 38, 1, + -1, -1, 2, 1, 2115, -422, 3655, -1972, + 1473, -2033, 2461, -1112, -1267, 179, -394, -906, + -1273, -432, 1082, 367, -720, 1746, -657, 595, + 701, 16, -1, 0, 0, 2, -3, -255, + 443, -1840, -2379, 296, 258, -675, -221, 406, + -216, -6295, -1041, 1062, 199, 1705, -1032, -1627, + -2399, 198, -1097, -271, -99, 0, 1, -2, + 2, -13, 343, -219, -1447, 1779, 630, -1944, + -1093, -1578, -62, -1334, 2811, -815, 1311, -3102, + -300, 67, 24, 98, 764, -1246, 203, 6, + 0, -4, 0, 1, 0, -18, -1704, -1427, + -352, -2665, -588, 287, 715, -454, 688, -424, + 1736, -1124, 1028, -7581, -752, -482, -363, -75, + -720, -619, 449, 0, 3, 0, 16, -3, + -1211, 2484, 3490, -547, -705, 1776, -286, -1580, + 2896, -2257, -214, -1784, -1266, -562, -1170, -542, + 785, 1606, 535, 51, -1405, -7, -1, -1, + 0, -1, 2, -428, -579, -1091, -2627, 2287, + -757, 1445, -411, -160, 567, 108, -1305, -4356, + -390, -917, 345, -2169, -896, 3772, 1224, 691, + -25, 1, 1, 1, -2, 1, 281, 1365, + -1628, -585, 3485, 169, 746, -395, 1072, 1569, + -1073, 744, 1274, -3472, 1035, -906, -3394, -1537, + -869, 2841, 401, 4, -1, -3, -3, -1, + -3, -37, -1628, -888, 785, 3328, 1105, 3551, + 6946, -1688, 2690, -2051, -2212, -3750, -1903, -497, + 1251, 1187, -6198, 3930, 85, -1077, 16, -23, + -80, -130, 43, 66, -974, 579, -2047, -3607, + -666, -2248, 4619, 6846, 88, -649, 1129, -255, + 3567, -124, 41, 58, 634, -1252, 696, 2536, + -1590, 209, 12, -102, -275, 27, 216, 1110, + 259, -2091, 1775, -3768, 598, 441, -1809, -431, + 22, -991, -621, 84, -1803, 1585, 559, -1101, + 42, 456, -392, -874, -4, 0, 0, 1, + -1, 0, -371, -211, -339, -1232, 438, -2683, + -1007, 1250, 5343, 861, -1305, -577, 2107, -2649, + -3227, 1020, -127, 562, 5495, -3136, -414, -529, + 12, -53, -34, 151, 106, -2946, -575, -1796, + 3095, -257, -591, 126, 967, -547, -271, 560, + 974, -3335, -2110, -1403, 5915, -1108, 388, -1266, + -522, 336, 167, 1, -3, -2, 2, -3, + -312, 19, 3356, 1123, -676, -247, 697, 548, + 1768, 1174, -525, -253, -423, 546, -2373, -2940, + -1055, -2304, 203, 1309, -574, -8, 0, -3, + 4, 0, 4, -215, 8192, -670, -1289, -1547, + -304, 1498, -967, -529, -582, -2205, 1752, 321, + 573, -1096, 64, 1152, -87, 574, -250, 539, + 62, 7, 2, -1, -3, 3, -465, 243, + -1179, 828, -2501, -223, 198, -883, -740, 1113, + -1821, -2068, -3234, 1715, 1989, 1817, 727, 1640, + 3386, -1538, -864, 45, 0, -4, 0, 0, + 2, 608, -1495, 1259, -132, 1311, 350, 537, + 2735, 1428, 151, 1324, 547, -3983, -1892, 104, + 2023, 1908, -1042, 1130, 1252, -701, 9, 0, + -2, -1, 1, 1, 602, -8192, -2776, -661, + 1640, 443, 3452, -738, 829, 637, 292, 232, + 1352, 4879, 1429, 912, 649, 1593, 308, -330, + 68, 63, -3, 4, -57, 26, 25, 1250, + 400, -4839, 211, -2748, -664, 996, 341, -1053, + 321, 2458, 764, 743, -729, 12, -283, -346, + 118, -249, -153, -2329, -37, 0, -1, 0, + 1, 1, 352, -878, 2336, -634, -2690, -3415, + -2949, -531, 1259, 394, 163, -994, 845, 1259, + 890, 1400, 279, 1908, 161, -2174, 1876, 76, + 1, -1, -1, 10, 0, 47, -1123, 1611, + 489, 618, -816, -7, 2001, -1190, 1857, -2749, + -311, -331, 733, 1412, 1390, -1525, 1262, -1393, + -263, 3124, -98, 0, 1, 0, 1, -2, + 514, -3533, -2394, 3623, 249, -1056, 515, 1279, + 2821, 477, 183, 689, 1182, 1378, 1287, -711, + 1264, -713, -278, 217, -664, -225, -1, 0, + 6, 2, 9, -1171, 3119, 1340, -1229, -1929, + 1984, -1333, 1018, 10, 1205, 63, 358, -1108, + -455, -413, 854, -1550, -423, -180, 2529, -8192, + -18, 0, -2, -1, 0, 0, -678, 3819, + -1316, 1159, 590, -231, 2203, -1533, 986, 4289, + 1114, 1135, -1162, -921, -58, 691, 11, -1718, + -270, -531, 530, 65, 0, -1, 1, 4, + 0, -1184, -1359, 7230, -533, -2077, -1188, 113, + -1472, 490, 1518, 1476, -1885, 934, 244, 1840, + -696, -480, -2476, 3324, -2433, 1102, 120, 1, + -11, -2, 18, -3, -1016, 189, -3835, -1659, + -46, -180, -2659, 1998, -1437, 1107, -2248, 165, + -657, -5079, -224, 1246, 469, 421, 1145, 1148, + 84, -18, 3, 0, 0, -6, 0, -66, + -206, 2279, -220, 1606, -421, -1482, -413, -1237, + 374, 3691, 491, -774, 410, 791, 380, 3385, + 615, -950, -620, -197, 65, -1, 3, -3, + 2, -1, -484, 1396, 273, -3591, 1317, -1013, + 1563, -134, 602, -1069, 733, -1167, 233, 319, + -262, 350, 780, -407, -496, -1285, 1326, -13, + 0, 2, -1, 0, -1, -328, -626, -848, + 745, -1047, 4048, -380, -456, -1894, 869, -1085, + -373, 2829, 622, 473, 394, 237, -2175, 1167, + -4942, 246, 100, -1, 1, -6, 1, -6, + -70, 35, 1613, 2597, 1307, 1756, -1184, 1082, + 971, -2004, -1459, -494, -40, 745, 2788, -830, + 76, 536, -2002, 401, -57, -20, 0, 0, + 0, 0, 0, -8, 244, 1927, 1162, -2416, + -1414, 463, -89, 1217, -798, 394, -1527, -719, + -666, 998, 1518, -2455, -3049, -1174, -2696, -3119, + 2, 0, -2, 2, 2, 3, 1093, -623, + 1660, -1635, 1457, 2560, 763, -2750, 931, 1798, + 2550, 1402, 914, -919, 1931, -383, -435, -583, + 439, 9, -1106, -12, -1, 0, 0, 0, + -2, -335, -730, -2102, -1414, 2576, -3869, 1025, + -1657, -2, 857, -336, -3011, 205, 1108, 364, + -789, -179, 171, 331, 2204, 527, -13, 1, + -3, 2, 1, -4, -565, -211, -139, 1799, + 195, -877, -632, 358, -244, -1459, 1398, 2271, + 550, 1987, 2206, -337, 199, -7036, 589, 195, + -466, 72, -1, 2, 1, 0, 0, -27, +}; + +static const int16_t cb0806sm0[] = { + -8192, 389, 245, -67, -42, 79, 503, -488, + -310, 107, -13, -431, -203, 96, 510, 151, + 270, 0, 0, 0, 0, 0, -463, -23, + -72, -322, 74, 1589, -152, -198, 81, 1120, + -125, -434, -3275, -2210, -348, -344, 91, 0, + 0, 0, 0, 0, -254, -224, 46, -154, + -131, -465, -57, 8192, 345, 112, -725, -49, + 183, -191, 246, 263, 370, 0, 0, 0, + 0, 0, 39, -739, -6603, -2454, -95, 312, + -53, -392, 63, -165, 31, -505, 111, 484, + -535, 179, 143, 0, 0, 0, 0, 0, + 1279, -139, -1769, 244, 59, -135, -429, 707, + 809, -4355, -354, 428, -300, 108, -799, -1421, + 599, 0, 0, 0, 0, 0, 4, -5, + 7, 75, 49, 8192, 276, 200, 191, -167, + -14, 82, 222, -277, -483, -216, -441, 0, + 0, 0, 0, 0, 171, -423, 174, 401, + -517, -377, -234, -644, -829, -350, -976, -146, + -928, 296, 3003, 3545, -30, 0, 0, 0, + 0, 0, 161, -6753, 1138, -855, -132, -242, + 559, -225, -346, -168, 10, -481, -6, -1208, + 252, -323, -191, 0, 0, 0, 0, 0, + -262, 574, 433, -145, 622, 329, -2634, -439, + -1178, 351, -433, -842, 4125, 296, 305, 359, + -22, 0, 0, 0, 0, 0, -34, -56, + -1019, -247, -163, 305, 574, -51, -179, 24, + -1097, 248, -166, -18, 303, 252, -555, 0, + 0, 0, 0, 0, -400, -254, -256, 2783, + -296, -1904, 552, 1284, -336, -2371, 3396, -1092, + 102, 176, 140, 640, -359, 0, 0, 0, + 0, 0, 373, 473, -2167, -774, -388, 405, + -1402, -1391, -1319, -155, 1104, -533, 382, 1561, + -2958, 406, 787, 0, 0, 0, 0, 0, + -3800, -58, 2098, -181, -570, 385, -4125, 759, + -1584, 9, -278, 201, -528, -527, -435, 436, + 681, 0, 0, 0, 0, 0, 30, -80, + -60, -4031, -70, -3367, 316, -861, 67, -169, + -144, 1598, 966, 32, -1263, -434, -738, 0, + 0, 0, 0, 0, 181, 12, 115, 91, + 253, 518, 517, 216, 830, 336, -568, -3125, + -796, -847, 1627, 58, -158, 0, 0, 0, + 0, 0, 48, -851, -286, 393, 390, 707, + 595, 427, -235, -116, 814, -198, 6145, -1590, + 647, 15, -259, 0, 0, 0, 0, 0, + -621, 152, 590, -16, 215, -633, -784, -140, + 1087, 723, -4191, 2701, 951, -972, 273, -554, + 387, 0, 0, 0, 0, 0, -124, -2939, + -38, 383, 234, 687, -2873, -466, 61, -472, + 854, -396, 305, -233, 82, -2677, -206, 0, + 0, 0, 0, 0, -120, -246, -614, -394, + 8192, 75, -450, 177, -251, 45, -142, 65, + -1248, -14, 389, 375, 114, 0, 0, 0, + 0, 0, 2870, 158, -473, -166, 928, -618, + -1909, 224, -931, 1898, -16, 427, 447, -1044, + 85, -333, 197, 0, 0, 0, 0, 0, + 78, 114, -167, 73, -1070, -80, 3512, -3004, + -1553, 769, 213, 851, -377, 978, 1097, 71, + 66, 0, 0, 0, 0, 0, -129, 248, + 455, -376, 344, 128, -60, 546, -321, -7898, + -719, -55, -941, 1242, 207, 215, 323, 0, + 0, 0, 0, 0, -24, -225, 136, 142, + -739, -117, 2, 242, -152, -20, -1775, -484, + -36, -408, -2767, -471, 251, 0, 0, 0, + 0, 0, 22, 111, -180, -7417, 365, 293, + -313, 1031, -191, 154, -210, -239, 121, -333, + -1504, 209, 146, 0, 0, 0, 0, 0, + 898, -643, 3080, 528, -91, -718, -512, 275, + -3564, 396, 160, -850, 346, -595, 1558, 684, + -310, 0, 0, 0, 0, 0, 234, -419, + -724, -433, 292, -1003, 682, -117, -1318, -914, + -5137, 128, 53, 291, 408, 1269, -284, 0, + 0, 0, 0, 0, -252, 190, -2911, 130, + 255, -172, -4331, 26, -267, 280, -133, -613, + -1063, -1135, 759, -1290, 216, 0, 0, 0, + 0, 0, 133, -177, 4069, -311, -197, 3260, + 341, 201, -117, -515, 105, -658, 975, 81, + -333, -333, 262, 0, 0, 0, 0, 0, + 273, -87, 321, 190, 1385, 274, 182, -2553, + -150, 164, -830, 89, -459, -5279, -624, -336, + 399, 0, 0, 0, 0, 0, -172, -232, + 11, 45, 121, -254, -457, 196, -3487, -838, + 512, -310, -2831, -85, 98, -145, -331, 0, + 0, 0, 0, 0, -55, -149, 2068, -61, + 3087, -143, 1574, -1381, 2853, 1899, -453, -580, + -137, 1211, -1413, 171, 125, 0, 0, 0, + 0, 0, -228, 30, -956, 5569, 209, -89, + 25, 573, -1669, 507, 182, -132, 697, -132, + -2964, -637, 139, 0, 0, 0, 0, 0, + -3078, -3278, -771, 928, -38, -463, 820, 1141, + -1234, 620, 652, -1710, -382, -1618, -409, 179, + 483, 0, 0, 0, 0, 0, -102, 4256, + -20, -162, 2021, 730, 1439, 2776, 459, 498, + -152, 482, 35, -271, 810, -1345, -249, 0, + 0, 0, 0, 0, 131, 5, -281, 431, + -2498, -1046, 482, 842, 297, -311, -1260, 148, + -906, -4217, -1411, -102, -361, 0, 0, 0, + 0, 0, 116, -3083, 235, -1195, -19, -646, + 42, 487, 309, 1654, 1051, -1643, 689, -823, + 2279, 1488, 571, 0, 0, 0, 0, 0, + 42, -95, -3, 36, -170, -114, 8104, 217, + 140, -217, 599, -774, -64, -675, -211, 166, + 204, 0, 0, 0, 0, 0, 99, 594, + -48, 224, 52, -1499, 271, 2224, -219, 3184, + -165, 828, -1345, -785, 181, 133, 124, 0, + 0, 0, 0, 0, -235, -286, 254, -171, + -4980, -453, -1432, 12, 734, -391, -640, 339, + 537, 313, -700, 1016, 148, 0, 0, 0, + 0, 0, -49, -19, 803, 935, 520, -90, + 641, 1053, -454, 2338, -6071, -478, 616, -559, + -339, 445, -1464, 0, 0, 0, 0, 0, + -175, 111, -132, 65, -264, 732, 221, 231, + -1972, -305, 325, -859, 583, 1272, -441, 2651, + 229, 0, 0, 0, 0, 0, -286, -4646, + -262, 593, 613, 936, 310, -615, 83, 223, + -816, 1910, 2041, 281, -190, -434, 114, 0, + 0, 0, 0, 0, -123, 684, -208, 524, + -606, -1223, 264, -983, -109, -1057, 696, 195, + -521, 945, -7503, 193, -120, 0, 0, 0, + 0, 0, 98, -358, -2165, 244, 277, 393, + 771, 3360, -258, -1218, -122, -1253, -2297, 806, + -198, 540, 7, 0, 0, 0, 0, 0, + 78, -281, -368, 2809, 159, 2611, 833, -120, + -3987, 933, 360, -49, -515, -106, -360, 650, + -125, 0, 0, 0, 0, 0, 203, 1369, + 749, -502, -2295, -326, 448, -309, 630, -84, + 345, -520, -4, -623, 1066, -3915, 373, 0, + 0, 0, 0, 0, -4603, -794, -625, -355, + 1071, -601, -553, 593, -296, 626, -328, 621, + 85, 1348, 92, -288, 204, 0, 0, 0, + 0, 0, -9, 602, -162, -749, -104, 464, + -372, -1375, -1905, 2200, 61, -3308, -897, 634, + 1036, -2112, -182, 0, 0, 0, 0, 0, + -76, 2341, -675, -72, -29, 704, -536, 1656, + -541, -736, -1420, -1539, 2458, -228, 674, -1258, + -3, 0, 0, 0, 0, 0, -133, 1111, + 63, 327, 470, 1226, 541, -276, -3042, -1594, + -3192, 357, -617, 658, -315, -978, 631, 0, + 0, 0, 0, 0, 111, -188, 619, 236, + 104, 54, 545, 424, 5912, -332, 711, -1249, + -533, 291, -1544, -216, 113, 0, 0, 0, + 0, 0, -199, 267, 152, -301, -172, 1294, + 2311, -482, -2451, -82, 1833, 214, 130, -1183, + -2212, 403, -625, 0, 0, 0, 0, 0, + -106, 662, -48, -131, 324, 2337, 445, 462, + -349, -189, 669, 4945, -1797, 16, 268, -602, + 2, 0, 0, 0, 0, 0, 55, 154, + 892, -35, -145, 357, 562, 42, -9, -284, + 177, 84, 422, -181, -358, 7618, 29, 0, + 0, 0, 0, 0, -353, 68, -41, -4096, + 177, -20, -267, 782, 954, -430, 1573, -696, + 1785, -3611, 89, -243, 683, 0, 0, 0, + 0, 0, -220, 1983, -891, 614, 226, -202, + 67, 761, 1904, 179, 226, 416, -657, -3409, + 1026, 2834, -438, 0, 0, 0, 0, 0, + -551, -229, -304, -462, -2277, -419, 451, -122, + -108, 258, 784, 1105, 382, 137, 5695, -241, + -491, 0, 0, 0, 0, 0, 34, -272, + -1687, 1769, -332, 365, 33, -2594, 3729, 325, + 85, -295, -290, -152, 2238, -611, -41, 0, + 0, 0, 0, 0, 102, 166, 241, 1098, + -107, 775, -414, 4256, -277, 935, -200, 495, + 255, 1144, 468, -184, -59, 0, 0, 0, + 0, 0, 94, -282, -57, 12, -390, 245, + 1872, -620, 1089, 3754, 432, 947, -509, -284, + -3836, 26, 482, 0, 0, 0, 0, 0, + 9, 971, -373, 1111, -480, 2342, -182, 528, + 802, 1196, -1017, -879, 499, 2800, -830, -230, + -4, 0, 0, 0, 0, 0, -382, -815, + -1669, -2437, -593, 193, -688, 632, 479, 2883, + 565, 540, 5, 1598, 1618, -640, -246, 0, + 0, 0, 0, 0, -421, -103, 1482, -3026, + -65, -101, 4, 3921, 688, -941, -234, 49, + 202, 1905, 935, -1155, -4, 0, 0, 0, + 0, 0, 210, -625, -118, -3215, 344, 978, + -10, 773, -126, -804, -1534, 182, -1146, -646, + -146, 2011, 463, 0, 0, 0, 0, 0, +}; + +static const int16_t cb0806sm1[] = { + 35, -237, 547, 705, -9, 1612, 382, 195, + -191, -250, -101, -357, 709, 153, 850, -5091, + -100, 0, 0, 0, 0, 0, -6406, -158, + -527, 137, -330, 580, -484, 63, 541, -1245, + -205, 138, 247, -489, -147, -132, -863, 0, + 0, 0, 0, 0, 53, -38, 283, -22, + -1506, -467, -418, 117, 133, -2152, -48, -991, + 808, -1047, 2402, 261, 423, 0, 0, 0, + 0, 0, -14, 500, 4697, -174, -544, 87, + -379, -243, 577, 682, 258, -1190, -1984, 599, + 607, -123, -290, 0, 0, 0, 0, 0, + 60, 4254, 194, 888, -81, -395, 422, -1786, + 916, 288, 1191, -658, 502, 2177, -977, -301, + 587, 0, 0, 0, 0, 0, 232, 204, + -452, -853, -4266, -219, 1164, 92, 91, 1561, + 950, -705, -1217, -734, 1617, 120, -324, 0, + 0, 0, 0, 0, -3442, -456, -667, 987, + -89, 1383, -704, -187, -280, -583, 341, -732, + 649, -2129, -3505, -175, -215, 0, 0, 0, + 0, 0, 200, -635, -471, -1221, 215, 2844, + 1633, 522, -720, 1722, -272, 473, 198, -604, + 480, -88, 169, 0, 0, 0, 0, 0, + -160, -268, 130, 284, -612, 95, 43, 42, + 641, -258, -6884, -167, -689, 123, 276, -592, + 717, 0, 0, 0, 0, 0, 313, -90, + -4310, 2706, -1708, 648, -796, 791, 998, -468, + 632, 1893, 43, 1937, -1279, -22, -64, 0, + 0, 0, 0, 0, -106, 135, -287, 335, + -7999, 51, -250, -388, 16, 285, -101, 685, + -944, 604, -624, -792, 209, 0, 0, 0, + 0, 0, 496, -205, 422, 49, 274, -229, + 220, 73, -734, 381, -394, -8192, -405, 755, + -9, 46, 116, 0, 0, 0, 0, 0, + -28, 332, 1152, -129, 244, 84, -2193, 632, + -1854, -384, 110, -302, -270, 435, -1689, -797, + 686, 0, 0, 0, 0, 0, -1660, 624, + -664, 2611, 30, -1155, -419, -3539, -568, 1719, + -1374, -676, -55, -1934, 863, 1391, 433, 0, + 0, 0, 0, 0, -1012, 290, 2302, -330, + -95, -2355, -55, -763, -1995, -298, -680, 715, + -85, 1615, 1011, -1989, -1028, 0, 0, 0, + 0, 0, 21, -5001, 507, -58, 229, -37, + -113, 632, 1809, -62, 334, -1201, -893, -344, + 98, 438, -65, 0, 0, 0, 0, 0, + 0, 143, 131, -18, -135, -306, 392, 232, + 265, 543, 376, -562, 362, 2458, 785, 3653, + -456, 0, 0, 0, 0, 0, 855, -4009, + -1207, 118, -86, -223, 266, 154, -1886, -1145, + 241, -397, 246, 244, -776, 808, -132, 0, + 0, 0, 0, 0, 2, -633, 113, -94, + -154, -173, -162, -168, 439, -6548, 778, -392, + -60, 99, -1901, 171, -130, 0, 0, 0, + 0, 0, -11, -324, 711, -903, 560, -1654, + 1473, -300, 1048, 137, -1140, -1115, -1302, -1008, + -792, -3264, -540, 0, 0, 0, 0, 0, + -347, 78, -103, -7, -3, 437, 6053, 299, + -435, 323, 664, 477, 1097, 158, 656, 273, + 200, 0, 0, 0, 0, 0, -101, 80, + -153, 144, -235, 492, -399, -3, 4958, 699, + -586, -162, 153, -860, 161, 665, 4, 0, + 0, 0, 0, 0, -87, -189, 1744, -350, + -1840, 325, -2354, 1193, 1386, -1589, 80, 1055, + -188, 273, 807, 2038, -419, 0, 0, 0, + 0, 0, 50, -185, 68, -59, -9, 78, + -585, -121, -7888, 771, -908, -284, 349, 158, + -1122, -139, -189, 0, 0, 0, 0, 0, + 310, -286, 235, -687, -919, -364, -697, -253, + 492, 300, -238, 272, 518, -525, -5863, -190, + -59, 0, 0, 0, 0, 0, 151, 616, + -4420, 227, 240, -252, 516, -250, 68, 411, + -192, -87, -607, 671, 1281, -317, -305, 0, + 0, 0, 0, 0, -9, 817, -451, -1079, + 86, 5060, -1157, -1159, -421, 302, 1636, -316, + -66, -518, 1010, 1068, 96, 0, 0, 0, + 0, 0, -576, -362, 107, 3516, 303, -364, + -402, 805, 574, 993, -554, 298, -925, 410, + 1898, 13, 138, 0, 0, 0, 0, 0, + -340, -150, 528, 142, -464, 1034, -397, 3944, + -697, 962, 902, 1393, 2212, -1021, -1034, -961, + -319, 0, 0, 0, 0, 0, 58, 38, + 382, 221, -212, 826, -1373, -4559, 1329, -123, + 216, -23, -736, 95, -300, -418, -4, 0, + 0, 0, 0, 0, -58, 7814, 218, 141, + -90, -124, 455, -27, 49, -311, -364, 80, + -136, -1257, 96, 332, -287, 0, 0, 0, + 0, 0, -8, 624, 127, 1857, -480, -869, + -575, -1461, -493, -261, 97, 32, -328, -467, + 173, -2588, 132, 0, 0, 0, 0, 0, + 5257, -1037, 191, -844, 247, 130, -571, -548, + -496, 216, -161, 336, 62, 990, 130, 517, + -65, 0, 0, 0, 0, 0, -89, 9, + -138, 405, -701, -479, 3605, 699, -629, -102, + 27, -1374, -1059, -18, -2707, -172, -557, 0, + 0, 0, 0, 0, -67, 209, 571, -93, + -405, -172, -260, -19, 86, 22, 659, -630, + 222, -8192, 106, -34, 60, 0, 0, 0, + 0, 0, -10, -3386, 336, 651, -1377, 681, + -16, -45, -382, 1102, -280, 169, -822, 522, + 434, -1111, -299, 0, 0, 0, 0, 0, + 194, -445, -231, -532, -438, -180, -591, -1680, + 179, 5921, -184, -685, -467, 875, -573, 282, + 235, 0, 0, 0, 0, 0, 339, 139, + -745, -68, -201, 467, -743, 477, -23, -1177, + 1384, -357, -1254, -3760, 454, 1175, 252, 0, + 0, 0, 0, 0, 109, -252, 8027, -765, + 136, 111, -86, -593, -84, -750, -121, 782, + 739, -296, 284, 213, -1196, 0, 0, 0, + 0, 0, -40, 69, 1992, 452, -75, -84, + 683, 1678, -1350, -1846, 3068, -749, -1410, -271, + 536, 1120, 117, 0, 0, 0, 0, 0, + 4053, 340, 108, -88, 411, 990, 217, 3675, + 755, 752, -206, 205, -297, -573, 188, 127, + -313, 0, 0, 0, 0, 0, 47, -2870, + -3417, 216, 1730, -83, 189, -1615, 1016, -44, + -502, 2151, 6, -1057, 550, 194, -498, 0, + 0, 0, 0, 0, -133, 1, -387, -497, + 586, 173, 923, -4078, -1232, 329, -2086, -185, + 592, 681, 3320, -914, -327, 0, 0, 0, + 0, 0, -132, 493, -179, 220, 142, -4345, + 422, -173, 357, 1317, 240, -525, 1613, -178, + -1584, -734, 549, 0, 0, 0, 0, 0, + -337, 111, -1238, 116, 302, 325, 189, 610, + -3180, -284, -817, 1383, 1559, -802, 422, 438, + 460, 0, 0, 0, 0, 0, -96, 372, + 335, -843, 3967, 221, 380, 227, 309, 447, + -199, -257, 372, -397, -534, 736, -152, 0, + 0, 0, 0, 0, -144, 463, -54, -288, + -83, 115, -574, -229, 485, -2643, 58, 4312, + -1155, 642, -647, 1122, 118, 0, 0, 0, + 0, 0, 157, 6, -1017, -1155, 687, -288, + 918, -212, -332, -2486, -197, -1025, -546, 4099, + 155, -731, -333, 0, 0, 0, 0, 0, + -43, -496, -546, -541, 283, -521, -47, -18, + 208, -552, 1899, 2107, 588, 818, -911, -1104, + -84, 0, 0, 0, 0, 0, -71, 40, + -326, 92, 216, -106, -255, 28, 120, -58, + -2720, -133, -288, -28, -1157, 1563, 400, 0, + 0, 0, 0, 0, 40, -4, 559, 1350, + 30, 3905, -675, -1092, -587, -1524, -1987, -1031, + 1892, -679, -623, 1051, -33, 0, 0, 0, + 0, 0, -98, 106, 105, -5887, -463, 424, + -42, -506, -589, 376, 840, 140, -640, 771, + 23, -441, -6, 0, 0, 0, 0, 0, + 22, 203, -3452, -635, -605, 1668, 422, 2973, + 394, -1605, -968, -739, 344, -1438, 820, -1318, + -26, 0, 0, 0, 0, 0, 258, -32, + 1061, 643, -152, 92, -454, -1305, 1621, 554, + 344, 82, -404, 5222, -344, 286, 177, 0, + 0, 0, 0, 0, 63, -360, -127, 814, + 3639, -3322, 390, 12, -515, -493, 1515, 1706, + -727, 394, 1164, 357, -208, 0, 0, 0, + 0, 0, -27, 648, -342, -125, -327, 194, + -3639, 598, 29, 244, 898, -493, 372, -635, + 567, 31, -237, 0, 0, 0, 0, 0, + -160, 2798, -1768, -2186, 493, 517, -82, -468, + -290, 2890, -460, 450, 414, -265, -1121, 219, + -1115, 0, 0, 0, 0, 0, 14, 76, + -2806, 338, -1429, -402, 253, -130, -235, -799, + 309, -525, 3823, 175, 36, 113, 247, 0, + 0, 0, 0, 0, 352, 521, 213, -107, + -71, -762, 790, -856, -252, -246, -729, -631, + 1258, -3276, 1534, -436, -635, 0, 0, 0, + 0, 0, -54, 118, -453, -124, -32, 539, + 356, -169, -202, -590, 721, -444, -6260, -275, + -239, -105, -52, 0, 0, 0, 0, 0, + -464, 507, -796, 1273, 2297, 790, 652, 392, + 3364, -1949, 2154, -701, -229, 99, 88, 471, + -524, 0, 0, 0, 0, 0, 71, -914, + 1835, -156, -242, -196, 513, 431, -481, -84, + -734, 4501, -510, 115, 461, -428, 83, 0, + 0, 0, 0, 0, -3987, 1063, -717, -2640, + -963, -667, -147, 536, -68, 422, 341, -1916, + -616, 996, 522, 568, 1174, 0, 0, 0, + 0, 0, 8, 112, 693, 392, 445, 5309, + 259, 121, 1670, 343, 176, 472, 197, 419, + -240, -1178, -107, 0, 0, 0, 0, 0, +}; + +static const int16_t cb0808l0[] = { + 164, -3637, -3563, -243, -123, -47, -87, -32, + 62, 129, -2, 131, -36, -202, -197, 37, + -35, -442, -139, -69, -59, 29, -62, -67, + -17, -42, 74, 10, 107, 74, -109, 40, + -10210, -33, -3210, -410, -106, 512, 40, -17, + 109, 67, 99, 170, 53, 34, -68, -16, + 3895, -71, -116, 1, 608, 66, -215, 34, + 77, 50, -45, -73, 3, 11, -33, 18, + -34, 58, 25, 4420, 96, 77, -67, 23, + -83, -6724, 226, -32, -150, -154, 30, -12, + -8, -7, 89, 42, 173, -51, 38, -1852, + 40, -48, -40, 81, 34, 81, 66, 16, + 20, 3, 99, 41, 123, 52, 154, 20, + -38, 6, 10889, -44, 22, -39, 55, -34, + 25, -45, -22, 139, 19, -20, -64, -2242, + -473, -113, 316, 127, -31, 128, -363, -124, + 196, 259, -60, -3792, -41, -103, 104, -80, + -389, 179, 110, 83, 3174, 60, -197, 101, + 66, -47, -107, 96, -27, 45, -21, 6, + 116, -51, -8, -594, 377, -279, 158, -159, + 4595, -163, -210, 19, 3, -292, -67, 14, + 115, -41, -125, -154, -263, -101, 4, -11, + -89, 130, 58, 32, 92, 16, 126, -93, + -99, -4239, -69, 88, 5, -113, -18, 35, + 31, -48, -16, 35, 62, -2839, 14, 121, + 19, 41, 125, -102, 26, -13144, 6, -30, + -7, 60, 4, 36, -40, -26, 54, -57, + -9, -30, 13, -1, 73, -131, 29, 256, + 39, -51, -12, 1788, 4, 10, -58, 17, + -36, -2, 13, 59, -20, -21, 173, 129, + -435, -107, -214, 33, 3078, 13, 31, 148, + -2975, -311, 38, 25, -247, -542, 34, 106, + -392, 85, -203, 182, -232, 423, 629, -183, + 800, -466, 3145, -2498, -305, 39, 22, 41, + 0, -14, 671, -181, 3197, 109, 2900, 72, + -64, 8, 414, 133, 244, -263, 53, -69, + 70, -13756, -13, 21, 50, 12, -14, -12, + -7, 97, -32, 24, 51, -24, -29, 53, + 34, -19, -2341, 976, 25, -58, 18, -48, + -2490, -55, -31, -165, -36, 28, -26, 92, + 60, 137, 69, -5341, -125, 1966, -154, -66, + -13, -84, -13, 81, -46, -96, 50, -50, + -114, 15, 30, -211, -147, -555, 3998, 88, + 358, -159, -105, -51, -109, -16, 70, 91, + 268, 125, -95, -62, 38, -3227, 3591, -15, + 92, -72, 115, 144, -40, 142, 172, 72, + -17, 23, 1, 28, -38, -135, 220, -80, + -179, 9, -32, -6, 37, -33, -3, -89, + 7314, 5, 194, -13, 23, 31, 42, 84, + 197, -163, -251, -273, 193, 206, -613, 394, + 3469, 2587, -701, 62, 301, -104, 200, 164, + -201, -473, 52, -473, 128, -381, 404, -69, + -230, -537, 157, 389, -7, 2783, 3058, 95, + -59, 1618, 1, 4, 53, -6, 28, 10, + 2, 82, 28, -8, -14, 25, 59, 10, + -4, 36, -777, -4984, 29, 8, 85, -43, + -137, -34, 53, -58, 1, -27, 91, 15, + 80, -19, -186, 467, 94, -382, 129, 327, + 3053, -221, 399, -2821, 1090, 278, -2, -163, + -398, 126, -266, 180, -235, 70, -18, -34, + -45, 159, -32, 66, 11, 3177, -188, 27, + 35, -52, 114, -28, -136, 186, 2146, 100, + 92, 6, 58, -70, 159, -14, -32, 9, + 6, -27, -73, 28, 23, -24, 101, 148, + 80, -52, -27, -53, -36, 4, -74, 47, + -30, -108, 34, 7213, 12, 31, -17, -185, + 3318, 199, 192, 3450, -87, 3, 47, 46, + -141, 49, 83, -82, -132, -82, 68, 138, + -1031, -236, 390, -37, 23, -94, -7, 9, + -2958, -1846, -43, 23, 25, -79, -193, -77, + -3332, -3355, -139, 56, 163, -3302, -82, -25, + 35, 96, 73, 166, -154, 174, -121, 14, + -89, 101, -3751, -344, -240, -35, 401, -14, + 47, -49, 24, -78, 24, 6, 68, 51, + -145, 20, 83, 57, 147, -100, 60, 33, + -53, 11, 37, -5793, -93, -67, -9, 117, + 112, -51, 60, 48, 49, 328, 293, 127, + -314, -3022, 374, 3283, -86, 588, -346, 436, + -7, -26, -88, 104, 205, 150, 147, 34, + 126, 85, 46, -125, -119, 75, 13, 144, + 3721, 275, -71, 43, 163, -73, -292, -381, + -79, 33, 79, -79, 34, -94, 18, 229, + 63, 28, -44, 97, -3606, 77, -95, -162, + 163, 62, 6180, 81, -51, -19, -5, 109, + 71, 7, -37, -100, -31, -94, 188, 169, + -14, 2606, -417, 18, -4371, -25, 180, 108, + 17, 33, 48, -46, -93, -77, 32, -37, + -71, -271, -48, -273, -14, 115, -59, -312, + -3334, -3046, 71, -166, 379, 209, -142, 22, + 89, -41, -40, -7, -50, 8, -15, 12, + -70, -27, -27, 25, -31, 38, -5, 2831, + -89, -8, -50, -110, 1368, -59, -2307, 6, + 179, 75, 189, 170, -55, 330, -70, 172, + 67, -492, -57, -3408, 9, -93, -11400, 14, + -1, -21, 65, -15, 45, -22, 40, -10, + -41, 23, -29, -96, -55, -66, -57, -61, + -29, -15, -101, -9831, 33, 42, -35, 42, + -44, -58, 11, -40, 27, 21, 715, -315, + -255, -115, 1736, 4, 41, -70, -51, -108, + 160, -9, 87, -6, 36, -20, -68, 10, + 82, -33, -42, 15, -57, -40, -31, 21, + 10023, 62, -41, -10, 85, -65, -12, -61, + -72, -610, 128, -76, 198, 367, -4564, 60, + 158, -13, -134, -45, -33, -11, -51, -72, + 111, -188, 232, -494, -27, 42, 46, -23, + 137, 3174, -3598, 211, 152, 155, -299, 56, + -23, -123, 132, 50, 28, -64, 28, 9, + -17, 31, 112, -19, 4, 45, -7175, 54, + -61, -7, 87, 164, 195, -29, -48, 28, + -60, 70, -69, 112, -295, 5, -89, 38, + 36, -11501, 17, -26, -64, -222, 91, -23, + -89, 0, -94, 2191, -74, -84, -61, -41, + 57, 24, -35, -28, -37, 486, 131, 3699, + -277, 64, -125, -243, 270, 313, -112, 145, + 47, -2862, -254, -110, -27, -69, -342, -120, + 216, 35, 24, 62, -39, -29, 2402, -7, + -3, 14, -47, -27, 4, 27, 20, 81, + 138, 75, 178, 421, -2943, -3080, -84, -40, + -58, -195, -182, 101, -187, 6, -83, 269, + -32, -99, 51, -38, 44, 82, -14, -35, + 0, 8, -23, 10754, -73, -57, 68, 107, + 85, 77, 101, 1, -28, 103, -10, 48, + 55, 33, -93, -18, 8, 28, -14, -575, + 28, -11712, 90, -186, 58, 38, -42, 2156, + -82, 28, -23, 43, 43, 8, 25, 65, + 0, -53, 28, -88, 388, -36, 363, 64, + 3068, 56, 320, -202, -3433, 73, -339, -157, + 373, -216, -43, 171, 140, -437, -143, -2820, + -101, 53, -111, 65, -39, 65, -30, 69, + -55, 49, 45, 126, 174, 220, 73, -101, + -60, -151, -13, -41, -48, -9, 25, -122, + -80, -2450, 19, 94, 14, -18, -19, 60, + -3252, -10, 3390, -15, -365, -15, -73, -222, + 307, 70, -95, 237, -142, -163, -44, -138, + -7, 6, -36, -67, 9, -22, 10235, -56, + -8, 44, -155, -117, -22, -32, -74, -14, +}; + +static const int16_t cb0808l1[] = { + -58, 222, -154, -74, -53, 4939, 421, 67, + 26, 132, 60, -97, -1, -43, 328, 2, + 460, -66, -11, -45, -56, -86, -10569, -129, + 58, -25, 39, 28, 26, 45, -61, -139, + -22, -135, -282, -517, -368, 55, -47, 30, + -110, 47, 75, -13, 65, -41, 104, 4745, + -149, -99, 28, 421, 517, -56, 81, -309, + 67, -42, -6, 17, -60, -151, 50, -84, + -9, 29, -72, -3019, 82, -195, 41, -14, + -206, -34, -58, -18, 30, 2154, -20, 2, + -1, 41, -10, 7, 86, 494, 123, 328, + 73, 213, -29, 17, 43, -92, -61, -9, + -130, -113, 33, -28, -6677, -198, -185, -236, + 183, -108, 739, 60, 98, -314, 66, 10, + -3161, -159, -2850, 118, 37, -41, -119, 3087, + 43, -36, 42, 106, -174, -3379, -92, -142, + -237, 94, -59, -123, -117, 144, -75, 146, + -268, 561, -1160, 336, 1477, 207, 89, 130, + 127, 3763, -372, 48, 99, 204, 84, 209, + 103, 118, 125, 326, -29, -206, 139, -61, + 94, 77, 6624, -163, 23, 27, -104, 150, + -76, -205, -186, -30, -227, -58, 17, 25, + -6536, -19, -66, -45, -72, 41, 49, -79, + 105, -4, -117, -37, -183, 216, -27, -23, + -31, -2720, 53, -23, -46, -9, -10, 50, + -12, -50, -56, 35, 5498, -110, -2, 44, + -1, 13, 52, -18, -61, -80, -29, 25, + 61, -37, 93, -19, 67, 75, -41, 254, + 161, 118, -3379, 398, -9, -208, -143, 207, + -135, -32, 171, 187, -194, 466, -55, 158, + 34, 105, 4986, 27, -41, 20, 87, -110, + 39, 80, -37, 8, -25, -44, -108, -171, + -366, 208, -225, 1, -124, 21, 81, -10349, + -51, 33, -51, 141, -36, 106, -100, 320, + 122, 3, 266, 72, -8, -112, 55, -107, + -4154, -69, 0, 71, -153, -80, -50, 20, + -112, 225, -1982, 273, -19, -127, 109, -25, + 47, 57, -98, -10, 42, -25, 10, 24, + 41, -73, 45, -3523, -370, 3213, 54, -87, + 67, -185, 100, -33, -41, 3, -38, 70, + -108, -120, -67, -144, -181, -33, -104, 429, + 89, 849, 3022, -2765, -341, 184, -248, 610, + 408, -222, 184, 84, -64, 479, -146, 47, + -100, 13, 17, -7, 58, -13, -36, -23, + -1, -25, 10, 2666, -113, -41, -140, 3064, + 105, 31, 3042, -75, -132, -113, 80, -100, + -39, 216, -4, 7, -43, 242, 19, -1031, + 731, -3659, -24, -20, 109, 126, 2980, 19, + -11, -48, 57, -138, -11, -211, -151, 540, + -113, -110, 0, -415, 150, -80, -80, 209, + -82, -5212, -125, 376, 8, 131, -138, 30, + -922, -320, 181, -75, 138, -112, 146, -72, + 64, -75, -262, 4872, -11, -61, 37, -205, + 48, -2257, 82, 106, 93, -66, 48, 71, + 29, 72, 32, 29, 17, 5, 34, 29, + -29, -72, 50, -7702, -114, -117, 47, 11, + 19, 100, 48, -28, -8, 53, 21, 80, + -43, 37, 164, 22, -15, -5258, -23, -32, + 108, 52, 7, -161, 11, 84, 141, -8, + -12, -25, 111, 146, -96, 66, 7388, 54, + 17, -54, 62, 44, -66, -13, 26, 13, + 85, -79, -21, 98, 156, 181, -103, -188, + -35, -179, 83, 117, -92, 49, -185, 3800, + -90, 14, 42, 94, -83, -178, -156, -8, + 33, 42, 204, 42, 1, -85, 47, 10, + 10804, 36, 8, 26, -47, -51, -189, 83, + -47, -23, 104, -7142, -67, 55, 21, 68, + 8, -84, -60, -43, 142, -41, 27, -72, + -70, -170, -141, 202, -198, -105, 41, -3553, + -34, -148, 34, -62, -161, -20, -73, 128, + 162, -8343, 4, -71, -46, 12, 27, 48, + -41, 50, -19, -88, 7, 79, 29, -19, + -31, -49, -147, -1886, -103, -213, 28, -183, + 4119, 87, 6, -6, 51, -190, -167, -116, + 23, -26, 7, -38, 5442, -1869, -81, 197, + 105, -122, 65, 220, 32, -57, -39, -15, + 4, 112, -55, -139, -825, 985, -109, 2558, + 218, 94, 65, -184, 3269, 101, -65, 42, + 372, -38, 58, 8, -143, -544, -268, 121, + 38, 61, -63, -10, -30, -52, -76, -74, + -6690, -5, -160, 76, -77, 74, 374, -917, + 239, -203, 550, -84, -305, 292, -51, 36, + 135, -79, 27, -69, -309, 4561, -67, 11, + -60, 43, 18, -2, 8, -15, 20, 22, + -2, -41, -2396, 37, -79, 67, 27, -84, + 353, -213, -2336, 58, 39, 126, -78, -98, + -90, -3, -9, -43, -2, -29, -5, -149, + 42, 98, -109, 137, 58, -83, -38, 51, + 6525, 50, 97, -31, 8, 132, -71, -55, + 11, 120, 2, -43, 136, -37, -85, 150, + 133, 67, -41, -452, -104, 4, 126, 100, + -2660, -108, -109, -64, 615, -75, 45, 10, + -57, -57, -108, 167, -218, -10, -331, -26, + -21, 6561, 73, -599, 126, -23, 250, -103, + -4, -28, -20, -35, -19, 51, 9, -25, + -40, -11220, -2, 28, -12, 23, 3481, 169, + 159, -217, -48, 114, -93, -34, -191, -63, + 31, 182, 79, 90, 55, 67, -145, 409, + 190, -7791, -26, 18, 71, -113, -80, 69, + -21, -27, -121, 51, -148, 103, 196, 2726, + -67, 3022, -28, 26, -99, 51, 24, 61, + 104, 89, -57, -23, -112, 43, 6, 13, + -184, -168, 117, -29, 1865, -3, 20, 8, + 30, 32, -81, 80, -20, -59, 37, 19, + -107, -3920, -259, 44, 23, -129, 24, -66, + -27, -3071, 116, 9, -76, 56, -83, 25, + 54, -20, 2, 230, 56, -41, 131, -15, + -62, 61, 56, 74, -34, 110, 4606, -4, + 18, -47, 331, -106, -78, 70, 53, 70, + -22, 77, -71, -60, -101, 70, 7, 104, + -7, 39, -27, 7210, 253, -15, 0, -96, + 32, 50, -10, 33, 2058, 11, -15, 42, + -14, 51, 4, -3, -11, -86, 10, 33, + 21, -18, -31, -7, 53, -7, 95, 7, + 75, -11314, 7, 17, -16, -83, -475, -887, + -1141, 1, -101, 5, -46, 110, -90, -47, + -15, 19, 66, -4078, 104, 43, 105, -126, + 181, 43, -1655, -81, -11, 33, -33, 33, + 28, -44, 35, -6, -38, 68, -40, 67, + 73, -29, 171, 11982, 42, -8, -66, -66, + 40, -19, 14, 33, -63, 24, 94, -94, + -106, 584, 330, -108, -3841, 782, -300, -11, + -303, -174, -217, -3, 24, 168, 187, -166, + 54, 238, -269, -27, 182, -4, -72, -47, + 32, 39, 7622, -46, -67, -53, 56, 123, + -50, 69, -36, -275, 628, -55, 195, -56, + -265, -132, -39, -4, 169, 113, -180, -19, + 88, -6427, 42, -257, 1180, 359, 335, 3821, + 116, 79, 3, -93, 67, -44, 58, -16, + 265, 172, -39, -44, 18, 92, 4, 218, + 122, -2993, 150, 138, 618, 66, -618, 402, + 2227, 10, 38, 308, 338, -70, 265, 1047, + -104, -182, 305, -162, -99, 510, -20, -114, + 529, -42, -3569, 52, -80, -314, 716, -31, + 259, 59, -73, -117, 38, -44, -16, -74, + -5060, 35, 10, -30, 54, 217, 36, -205, +}; + +static const int16_t cb0808s0[] = { + -2191, -865, -1906, -251, 274, 594, -1214, 677, + 482, -1176, 43, -1098, -203, -537, 1834, 1332, + 308, 432, -191, 3091, 1892, 926, -446, -1206, + -613, 198, 575, -38, 264, 375, 278, -691, + -107, 17, -239, 261, 848, -620, 183, 624, + 122, -358, -50, 1017, -1075, -705, -346, 337, + -121, 100, -218, -1051, -463, -4728, -513, -1151, + 737, 4356, 684, -1374, 1630, 521, -520, -52, + 90, 119, -43, -131, 24, -2, -184, -65, + 614, 371, -448, -414, 1415, -687, -224, 584, + -768, -1210, 2941, -3057, 132, 406, -952, 291, + 295, -798, 608, -1476, -516, 21, -302, 2085, + -1700, -2655, -355, 175, -409, 662, 46, -247, + -201, -580, 179, -54, 458, 836, 1543, 1829, + -282, -278, 412, 2422, 2077, 197, -897, 451, + 595, 1547, 538, 825, 563, 443, -576, -854, + -572, 241, -471, 201, -311, -529, 112, -5128, + -173, -233, -435, 340, 158, -41, 273, -224, + 919, -1570, 1075, 265, -282, 1256, 1007, 231, + 720, 417, -401, -4589, -747, -453, -1112, 54, + 156, -561, 2746, -422, -83, -91, -381, -270, + -1226, 987, -965, 625, -474, 565, 2890, -85, + 1291, -280, 626, -26, 840, 1122, -1915, 780, + -702, 792, -578, -122, -9, 1175, -194, -571, + 2940, 540, 31, 1817, -352, 264, 953, -2035, + 238, 3250, -1561, 653, -331, -393, 827, -382, + 323, 281, -1339, -819, 545, 207, 14, 338, + 432, 860, 1691, 142, 711, 381, -1151, 4164, + -867, -241, 111, -513, -863, 78, 1453, -363, + -128, -232, -1853, 2373, -1156, 210, 698, 1134, + -869, -177, -352, 1514, -1370, -789, -1193, 819, + 348, 80, 492, 179, -909, 591, -600, -377, + -1709, 59, -539, 557, -45, -362, 778, -4919, + -647, 203, 865, -313, -257, 173, -2415, 1005, + -1771, 843, -474, 1619, 1193, -186, 305, 636, + -662, 1976, 546, -82, -108, -751, 850, 521, + -1625, -3135, -388, 64, 249, -1189, -1552, 2629, + 2, -221, -105, 754, 251, 219, -270, -202, + 545, 147, 1019, 108, -1358, -1317, 1362, -1323, + -3322, -405, -371, -554, -334, 296, 493, 248, + -4, 1340, 123, -584, -804, -766, -164, -470, + 295, 218, -3, 62, -194, -657, 5016, 280, + -4, -69, -281, -994, 209, 307, 8648, -37, + -138, 45, -329, -101, -65, 98, 58, 714, + 56, -170, 60, -203, -248, 103, 107, -408, + 596, 170, 61, 584, 727, -434, -181, -5116, + -502, 494, 52, 83, -105, 325, 68, -561, + -274, 371, -1833, -78, -2990, 320, 141, -748, + 1764, 1157, -538, -276, -1594, -152, 838, -45, + 1137, 13, -803, -162, -838, -1199, 2003, 580, + 3687, -844, -552, -271, -462, -1034, -29, 273, + 862, 269, 95, 186, -222, -124, 79, -34, + -684, 808, -1061, -916, 610, 539, 1289, 782, + 1216, 3213, -38, -546, -1209, -398, 98, -39, + 58, -1271, -611, 573, 499, -2170, -157, -943, + -595, 436, 1203, 487, -1419, -570, 1468, 711, + -589, -101, 3299, -45, -1432, -453, 1820, 677, + 1052, -1793, 1071, -400, 268, -464, 443, 508, + -273, -736, -233, 270, -1187, -1931, -1208, -519, + -879, 325, 1032, 280, 565, 294, 2588, -303, + 640, -1398, 1070, 674, 57, -165, -46, 512, + 757, -3471, -812, -854, 45, 101, 3195, -786, + -61, 122, -1234, -74, 119, -389, 254, -84, + 829, 1465, -930, 171, -248, 201, 939, 1, + 52, -3517, -1854, 147, -843, 310, 502, 729, + 191, 525, 333, -669, -3358, 215, 552, 156, + -1771, 982, -746, 523, -187, -684, 456, 123, + -1544, -145, 58, -1083, -1646, -1309, 775, 1436, + 1409, -1114, -171, 26, -1775, 1103, -392, -2053, + -1221, 100, -1120, 25, -295, 306, -105, -514, + -4362, 156, -2172, -191, -90, 7, -62, 244, + -107, 521, 309, 22, -663, 239, -213, -226, + 100, 2228, -330, -197, -1247, -876, 1561, -1, + -354, 439, -163, -318, -61, -1184, -3022, 1434, + 65, 87, 806, -2093, 3016, 1022, -779, -391, + -18, -1371, -548, 910, -910, -438, 673, 48, + 1028, 548, 153, -337, 554, 353, 1686, 468, + -190, -113, -560, 542, 94, -140, -194, -58, + 165, -154, -311, 4744, -148, 49, -253, 180, + -65, -125, -139, -49, -115, -270, 439, 139, + 210, 202, -207, -65, -477, 168, -4720, -96, + -1091, -2071, -567, -1330, 237, 411, -123, 1197, + 2625, 1348, -230, 362, -147, -139, -699, 1210, + -299, 92, 2835, -36, -296, 287, 2426, -1171, + -218, 884, -320, 1130, -1085, 1177, -953, -776, + 609, 827, -90, 131, -2757, 567, 885, -2359, + 955, -200, -1883, 131, 282, -80, 141, -8, + -33, 333, 809, 357, -13, 499, 597, 923, + -1725, -1533, 465, -93, 2187, -841, 751, 74, + -2158, 99, -1078, -459, 648, -258, 349, -917, + 1200, 374, -1741, -1013, 724, -61, 182, 4032, + -581, 1123, -400, -459, -443, -316, 3, -271, + -248, -17, 595, 206, -1188, 2869, 1338, -253, + 316, -474, 1680, -856, -1487, 547, 679, 425, + -258, 92, -4, -24, 117, -157, 385, -257, + -332, -5597, -68, -329, -65, -108, -277, 202, + -400, 124, -51, 5, 71, 90, -927, 966, + 780, 305, 703, 802, -1661, -1415, -66, 437, + -610, 317, 795, 599, -189, 322, -519, -4010, + 729, -620, -2127, 351, 506, -68, 162, -983, + -288, 3167, -140, 991, -599, 128, 1868, 64, + -63, -1, 2047, 155, -871, -130, 226, 508, + 499, 882, 3762, -383, -23, 0, -345, -488, + 167, 648, 395, 114, 1121, 343, 232, -538, + 15, 342, -820, 38, 435, -468, -282, -415, + -5021, -293, 147, 533, -128, -70, 503, 844, + -86, 1836, -2103, -1143, -70, -510, 576, -689, + 410, -2101, 433, 339, -417, 820, 157, 173, + 454, -586, 1219, -73, -5123, 344, 397, 53, + 105, 501, -59, 515, 194, 356, 78, 706, + 303, 332, 4532, 739, 961, -521, -392, 20, + -697, 823, 607, -243, 332, 365, -330, 307, + 429, -865, -8, 545, -3, 6041, -310, 272, + 464, 22, -156, 142, -63, -87, 297, -24, + 562, -9, 147, 341, -21, 119, 1386, 947, + -1738, -500, -655, 95, 32, 32, 187, 518, + 1330, 95, -324, 3620, 737, -54, 55, 670, + -1252, 995, 484, 1347, -745, 244, 262, -83, + -122, 1194, -653, -1111, -327, -325, 3579, -214, + -37, -412, -267, -377, -62, 131, 360, 203, + -5713, -42, 94, 279, 406, -355, 34, -144, + 156, -256, -48, -98, -1392, 1273, 202, -1249, + -3457, -710, 1007, 37, -1788, 86, -570, 535, + 17, -369, 1640, 816, -117, 128, -969, -1381, + 224, 1519, -996, -833, 931, 185, 804, 465, + 82, 69, -247, 3312, -430, -23, 173, -223, + 3080, 1848, -1187, -1494, -485, -1131, 496, -517, + -596, 320, -853, -1303, 240, -298, 159, 527, + -257, 412, 839, -1020, 706, -3499, -175, -1089, + -717, -325, 261, 310, -1740, -1035, -403, -229, + -861, -970, -62, -192, 535, -2154, -364, -1133, + 979, -3299, 353, 982, -517, 1144, -563, 675, + 285, 63, 17, -1957, 82, 28, -513, 501, + -1183, 1476, -813, -254, -1584, -1181, -426, -56, + -916, 203, -2693, 209, -1066, -1174, 279, 439, + 201, 1179, 797, 407, 851, 927, 316, -640, + 1398, -128, 2741, 563, -1789, 989, 932, 247, + 6, -617, 268, -691, 1112, -569, 883, 298, + 37, -362, -661, -17, -154, -574, 721, 4578, + 205, 507, 77, -90, -433, -1613, 270, -500, + -1061, 1634, -388, -432, -648, -1985, 629, 2887, + -201, -32, 223, 621, 143, 446, 1384, 1109, + 299, 329, -1002, -356, 1504, -77, 49, 952, + 4166, -544, -85, -412, -249, 474, 27, -107, +}; + +static const int16_t cb0808s1[] = { + 2632, 1511, 944, -180, -2377, 54, -470, -187, + -710, -998, -516, -916, -440, -842, 285, 22, + -282, -459, -299, -2769, -2285, -380, -2194, 801, + -595, -252, 504, -69, -752, 972, 639, 277, + 502, 117, -1072, -145, 1462, -528, 2165, 880, + -182, -2953, 750, -1090, 596, 105, 187, 555, + -153, -113, 830, 161, 308, -44, -250, -58, + -507, -406, -626, 1453, 1357, 116, -456, 3242, + -607, 94, 390, 393, 114, 1069, -2, 2, + 2497, 1405, -755, 1353, 192, 1288, -187, 262, + 1722, 91, 885, -622, -321, 246, -1835, 17, + 213, -80, -658, -1940, 275, 845, -365, 276, + 2142, -216, -3402, -646, 549, -78, -176, -52, + 785, -1335, 44, 163, -409, 1273, 679, -377, + 788, -1355, -1721, 332, 223, 1409, -104, 165, + 354, 322, 2414, -1611, 216, -6, -232, -1770, + -1931, 2496, -530, 228, -924, -173, -329, -575, + -1709, -900, 199, 223, 690, -636, 73, -367, + 460, -823, -5105, 435, 957, 224, 246, 406, + -673, 752, 412, -158, -267, 4, 694, 10, + -45, 219, 1040, 778, -1910, 1886, -691, 674, + 1085, -537, 376, 1048, 858, -161, 613, 376, + 535, -1349, -1913, -518, -850, 665, 772, -2985, + -66, -42, 2142, -848, -1151, 237, -211, -161, + -2753, 603, 507, 39, -575, -61, -1053, -273, + 290, -258, -162, 139, 95, -12, -201, -236, + 709, -328, -314, -130, -5337, 100, -18, -97, + -206, 1827, 1722, 302, 924, -203, 761, -715, + -24, 372, -600, 2115, 1197, -1406, 676, -2068, + -167, -221, -936, 1419, 353, -317, 245, -2890, + 623, 265, -622, 204, 2549, 596, 239, -25, + -672, 583, 117, -13, -2251, -1325, 1984, 1431, + -1335, -1268, 735, 245, 105, 593, -193, -614, + 909, -339, -1033, 383, 102, 363, 732, 1439, + 1028, 1275, 442, 987, -3901, -257, -36, 224, + -116, -402, 200, -596, -125, 372, -572, 398, + -543, 1024, 1746, -736, -1056, -1736, 953, 1026, + -965, 442, -1565, -448, -96, 1498, 30, -231, + -483, 73, -3185, 1765, 1313, -100, 477, -198, + 782, 316, 364, -107, -431, -1795, -244, 122, + -423, -385, 457, -872, -535, -1098, 80, -110, + 1420, 646, 33, -3226, 648, 861, 328, -1269, + -558, 495, 881, 112, 479, 170, -309, 1904, + -1412, -768, -1220, -34, 995, -649, 162, 1, + 153, 985, 762, -263, -188, 77, 760, -2346, + 3430, -450, 1677, 1090, 1771, 2109, -14, -119, + -995, 268, 141, 33, 35, 31, 537, 65, + -345, 69, 192, 763, -18, 1078, 3829, 274, + 442, -173, -412, 434, -695, 924, 2, 1551, + 566, -85, 217, 976, 2196, -503, -1401, 759, + 922, -3024, -963, -3, 600, -452, -193, -787, + 7, 186, 828, 515, 148, -225, -1250, -985, + 443, -511, 2037, 1560, 3230, 647, 1418, -165, + -261, -369, 224, 450, -100, -271, -122, -511, + -691, -1444, 906, -144, 248, 452, 957, -70, + -517, 116, -3559, -877, -399, 418, -1300, -415, + -177, 770, -2566, -371, -1673, -1042, -500, -290, + -708, -631, 193, 2494, 319, 545, 767, 102, + 231, -43, -139, -97, -700, -1592, 282, 1325, + -1419, -647, 449, 1995, -737, 661, 1617, 725, + -1464, 615, 906, 202, -154, -228, -2194, -231, + 299, 110, 1318, 1053, -312, 843, -937, -1697, + -592, -1224, -633, -50, 792, 1600, -1187, -171, + 211, -744, -306, 186, 1914, -3119, -904, -159, + 178, -596, -654, 817, 94, -242, -2376, -218, + -421, -365, -699, 177, -427, -32, 265, -33, + 245, -34, 5309, -307, -262, -299, 86, 278, + 33, -200, -180, -56, 337, 1034, -229, 4952, + 306, -609, 189, -22, 280, -160, -507, 135, + -1265, -252, 434, -427, 158, -546, -130, -2500, + 597, 908, 918, 706, 1227, 3390, 995, 298, + -558, 1307, 765, -144, -37, -286, 122, 215, + -1251, 1090, 85, -914, 522, 316, 1829, -701, + -365, -3311, 312, 22, 680, -1351, 220, 243, + 166, -36, 780, 2395, -64, 836, 1037, 735, + 966, 173, 1114, 192, 510, -1054, 1341, -616, + 1559, 897, 338, -3, -194, -214, -573, -265, + 328, -365, 433, -505, -86, 33, -156, -129, + -137, 119, 143, 5773, -76, 68, 820, 1215, + 1315, 713, 12, 1590, 131, -193, -881, -227, + 736, 581, 736, -37, -434, -449, -348, 4189, + 2180, -1360, -1663, -74, 1215, 278, 2092, -66, + 313, 388, -1373, 25, 599, 888, -87, 293, + 30, 367, 1010, -883, 818, -910, -1918, 864, + 482, -968, -1249, 222, 1100, 23, -87, 2493, + -248, -622, 240, 151, 873, -2735, 1325, -700, + -411, 282, -2361, -1843, -631, -208, 103, -411, + 831, -446, -292, 450, 184, -158, 484, -1964, + 4663, 123, 18, 174, 621, 158, -788, 233, + 302, 441, -339, 200, -62, -197, -9, -236, + 984, 584, -521, -373, -205, 910, 392, 850, + -2968, 68, -727, 1330, 578, 36, -385, 754, + -538, -36, 271, 418, -548, 1775, -1045, -879, + -1407, 524, -1085, -1479, 371, 19, 873, 171, + 2932, -216, 42, 71, -1187, -570, -524, 344, + -770, -4086, -735, -515, 1055, -551, 945, -1408, + 913, -1005, -222, -443, 60, -194, -734, 1908, + -534, -1351, 72, -938, -66, -2756, 1313, -169, + -1550, 450, -610, 893, 1100, -583, 87, -145, + -210, 281, 1402, 674, 0, -38, 874, -363, + 2436, 2156, -1659, -481, -130, -63, -669, -316, + -761, -413, 108, 2362, 354, 76, -1725, -924, + -1443, 1251, 871, -2058, 518, 955, -283, 680, + -85, -560, -464, 127, -216, -1382, 1908, 238, + -182, 459, -1227, 1144, 2266, -96, 595, -750, + 912, -198, 1786, -1423, -618, -450, 185, -1212, + 706, -689, -154, -365, -681, -1378, 914, -1200, + -253, -532, 3244, 444, 1, -96, -404, -64, + -412, -1400, -2830, -785, 940, -217, 358, 618, + 208, -2974, -365, -32, -63, -233, -868, -413, + 358, -451, 1310, -751, -1329, -2480, 63, 458, + -273, 1270, 316, 93, -453, -463, -1258, -57, + -1073, -2037, 46, -160, 4609, -1193, 192, -355, + -963, -92, 752, 593, 102, -80, -121, 166, + -606, -274, 28, 258, 45, -45, 928, -949, + -134, -268, -77, 242, 1623, -1290, 739, 109, + 285, 175, -92, -4053, -482, 366, 217, -126, + -843, 950, -1068, 777, 1818, 550, -891, -34, + -995, 1976, 2677, -764, 45, -40, -1800, 569, + -323, -102, -1064, 4000, -109, -423, -289, 738, + -872, 808, -977, 504, -901, 41, -45, -287, + -140, -444, 477, -271, -876, 301, -2421, 1633, + -918, -660, -149, -2542, -503, -265, -107, -623, + -447, -782, -858, -535, -220, 442, 661, -209, + 878, -1601, 3610, 149, -331, 190, 102, 270, + 1451, 237, 13, -1026, 178, 1290, -281, -217, + 11, -1728, 1043, -2992, -718, -776, 357, -615, + -231, 813, -473, 1634, 539, -513, 240, 1158, + 144, 57, 1249, 1479, -481, -733, 1663, -757, + 641, 680, -468, -2697, -29, -62, 1253, 1142, + 292, 245, -96, 295, -664, -264, -308, -670, + -705, 155, -4024, 330, 191, -77, -1502, 326, + 9, 295, -567, 34, -104, -123, -320, -255, + 1124, 320, 98, 1299, -436, 1491, -341, 908, + 11, 8, 988, -1921, 5, -1391, 859, -1291, + -581, 546, -95, 272, -441, 185, -256, 313, + 466, -393, -50, 4430, -940, 87, -224, 390, + -539, -290, -1046, 531, -2329, 1275, -586, -1046, + -1682, 1159, 908, 2023, 951, -273, -68, 713, + -556, 770, 783, 223, 60, -881, -97, 760, + 556, -237, -263, -246, -240, 165, 526, 832, + -4761, 432, -339, 186, 492, 81, -136, -827, + -390, -1026, -371, -292, 937, -243, -136, 6, + 49, -223, -600, -355, 5306, 140, 34, -84, +}; + +static const int16_t cb0808m0[] = { + -3555, -106, -131, -53, -156, 196, -206, -104, + 18, -2948, 122, 146, -520, 2, 294, -419, + -1, -25, -257, 9334, 87, -55, -42, 30, + 92, 35, 195, 31, 59, 88, 47, 47, + -220, 564, -1686, 426, 106, 396, 97, 1315, + 2331, 167, -1261, 1003, 732, -300, -342, 418, + 87, 236, -245, 2235, 11, 725, -24, -169, + -480, 2845, 96, -34, 67, 857, 28, 50, + 92, 2100, -84, -600, -1990, -2208, -163, 299, + 431, -825, -283, 299, -98, 391, -65, -92, + -200, -689, 2236, -82, -81, -52, 127, 86, + -137, -319, -2561, -90, 547, -198, 10, 195, + -366, -2688, -77, -234, -112, -245, 270, 199, + 2674, -57, -673, -9, 1029, -31, 311, -50, + -160, -175, 2371, 2711, 409, -19, 22, -244, + 312, -158, 270, -125, -247, 118, -91, -602, + 86, 174, -216, 18, 3048, -1953, 171, -1985, + -297, 295, -38, -198, -229, 363, -13, 127, + 13, -202, -117, 65, 74, 63, 125, -62, + -2, -543, -680, -4269, -130, 325, -49, -245, + -50, -509, -151, -19, 3, 152, -980, -129, + -234, 399, 349, 171, -196, 4952, -2, 36, + 288, 771, 2313, 231, -39, 572, -3012, 77, + -501, -215, -228, -444, 830, 200, -188, -157, + 3248, 279, -3319, 0, 76, 10, 160, -80, + 135, 102, -349, 174, -30, -88, -145, -205, + 10, -185, 177, -34, 25, 31, 218, -4, + 191, 172, 228, -136, -178, 268, 638, 3559, + 55, 198, 145, 342, -25, -1940, 2866, -334, + -921, 1941, -464, 273, -181, -506, -21, -410, + 116, -179, -49, -273, -22, -36, -1298, 274, + -1831, 321, -382, 238, -3464, -68, -194, 32, + -95, -506, 72, 64, -329, 19, -39, 347, + -302, 204, 145, -72, 855, -112, -3596, 989, + -2801, 386, -2623, -471, 101, -155, 257, 291, + 30, -153, 185, 172, 511, 20, 166, 274, + 29, -3023, 129, 33, -219, -205, 6, 47, + -407, 137, 563, -106, -2065, 76, 201, -99, + -170, -77, 170, -4536, -440, -96, -940, -1066, + 81, 205, 358, 435, -78, -148, -201, -85, + -307, -306, 14, -47, -101, -187, -136, 380, + -4, -32, -34, -54, 528, -58, 6389, 302, + -79, 52, -28, -65, -77, -12, 9024, -100, + 262, 20, -67, -31, 50, -33, -30, -140, + 326, -1170, -304, -136, -233, 170, 60, 314, + -166, -208, -105, -245, -169, -72, 137, -7173, + -2, 375, 152, 226, -206, -341, 303, 47, + 1010, -188, 577, -292, -3581, -12, -195, 20, + 2165, -206, -88, -83, -132, -40, -443, 236, + -333, 179, -211, -56, 318, -409, 3106, 95, + 11636, 340, 204, -323, 167, 76, 61, 65, + -157, 71, -21, 38, 66, 391, -52, 20, + -17, 11, 259, 45, -194, 440, 3432, 122, + 468, -595, -1856, 94, -427, -133, 149, -273, + 61, -6622, 48, 97, -162, 93, 402, -104, + -207, 64, -278, 92, 387, 3, 96, -2, + -27, -30, 84, 64, 35, -65, 98, 85, + -16, -248, 7930, 74, 4, -104, 83, -48, + 40, -2104, -86, -89, 99, -142, 65, -2713, + 63, -431, 523, 687, 212, -1515, 3, 59, + 55, -6, 22, -8, -148, 180, 78, 7833, + -63, -83, 13, -187, -116, 156, -29, -186, + -160, 148, -82, -303, -166, 112, -103, -39, + -165, 2827, -54, -26, 24, -3055, 78, 21, + 128, -81, -25, -122, 51, -54, -19, 188, + -18, -1, -140, -18, -8085, 124, -46, 45, + -574, 12, -150, 147, 65, -209, -396, -444, + -3882, -291, -231, 296, 244, 76, 180, 36, + -2575, 659, -63, 3277, -85, 48, -518, -353, + 130, 50, 13, 338, -343, -276, -16, 353, + -6036, -77, 18, 139, 43, 335, 294, 99, + 219, 442, -25, -53, 40, 271, 175, -282, + -91, 430, -4428, -15, -2857, -62, -27, -170, + 33, -681, -110, -76, 153, 42, -134, -145, + 222, -177, -39, 314, 2270, 526, 500, 2417, + 339, 1808, -17, 464, -525, -97, 124, -32, + 370, 48, -1675, -62, -169, 2642, 2511, -43, + -1037, -184, 54, -569, -504, -247, -40, 327, + 7, 82, -197, 2774, -34, -2931, -204, -112, + 194, -362, 187, 65, -166, 115, -125, 14, + 210, 144, -75, 57, -255, -151, -3566, -153, + 182, 89, -2530, 98, -265, -173, -133, 260, + -25, -1292, 35, 131, -98, -85, -237, 82, + 1353, 47, 3842, 148, 171, 183, 234, 89, + -93, 47, 102, -4, 90, 2980, 289, -231, + 353, 497, -109, 190, -2869, 697, 136, 90, + -244, 298, -119, -519, -50, 207, -43, -1376, + 356, 1934, 701, -2323, 671, 71, -56, -167, + -3793, -3749, -103, 134, -228, -13, 27, -45, + -105, 172, -77, -23, 53, 110, -118, -80, + -164, -192, -563, 393, -58, -428, -360, 3696, + 162, -173, 1683, -430, 452, -92, 107, -41, + 28, -85, 421, -66, 354, -88, 723, 2751, + -2955, -481, -134, -231, -145, 3, 65, -88, + 189, 187, 151, 174, -36, 240, -253, -235, + -194, -5410, -47, -98, 338, -487, -81, -35, + -82, -440, 31, 109, 217, 276, -1805, 278, + 273, -369, 629, -293, -525, -3832, 73, -56, + -363, 1709, 177, -2813, 796, -162, -341, 1176, + -75, 533, 854, 719, 242, -194, 90, -147, + 203, -136, -138, -764, 6, -2787, -13, 1104, + 1497, 1097, 90, -867, -718, -317, 119, 180, + 160, 257, 2532, -557, -62, 14, 665, 1520, + 456, 826, 394, -605, 908, 222, -140, 121, + 121, 232, 124, 96, -87, 48, -51, 41, + -7821, -37, 130, -11, -33, -137, 16, 42, + 1509, -8, 119, -83, -18, 64, 41, -178, + -28, 182, 532, 678, -75, 277, -230, -70, + -71, -8, -150, 321, -6298, -20, -131, -65, + 139, -215, -155, -27, -110, -257, 32, 201, + 215, 184, 8932, -106, -50, 66, 15, -44, + 203, -38, 19, -78, 65, 135, -123, 166, + 117, 76, 4, 34, -90, 5984, 59, -72, + 356, -64, 6, -62, 43, -86, -175, -106, + 10, 25, 3812, -135, -3313, 142, 348, -101, + -35, 378, -250, -106, -299, 237, 40, -32, + 236, -521, 63, -143, 538, -256, 43, -45, + 1642, 726, -3225, 109, -997, 3, -256, -27, + -182, -78, -4092, -9, 231, 34, 9, -6, + 155, 2842, 53, -130, -390, -146, 168, -74, + -2023, -955, 576, -629, -76, 70, 140, -287, + -401, 966, 359, 1185, -226, 713, 753, -739, + -4238, 3364, 75, -213, 27, -172, -34, 171, + -118, -46, -164, -13, -54, -203, -154, -12, + 65, -3777, -3452, 297, -104, -93, -81, 69, + -179, -321, 51, 47, 242, -15, -144, -43, + 2827, 67, -305, 54, -3044, 57, -15, -427, + 311, -205, 226, -490, 37, 363, -88, -408, +}; + +static const int16_t cb0808m1[] = { + 3329, 59, 195, -91, -70, 3262, -132, 360, + 157, -410, 184, -99, -138, 337, 289, 317, + 156, -589, -127, -204, 37, -175, -5661, -52, + 942, 156, -1, -197, 353, 90, 57, -287, + -218, 438, -4, -262, 9, 322, -167, 2904, + -12, -2647, -248, -203, -267, -116, -135, 333, + -220, -200, 40, 228, 2677, -462, -183, -129, + 2898, -728, 793, 422, 541, -350, 28, 222, + 2790, -231, -195, -191, 3002, 182, -610, 145, + -226, -102, 285, 344, -357, 217, -146, -98, + 18, -255, 96, -151, 266, 208, -459, -132, + -345, 4059, -371, 79, 44, -63, -233, 334, + 44, 3884, 49, -3303, 88, -23, -287, -461, + 57, 94, -53, -129, 104, 167, -25, -79, + -125, -630, -2352, 150, -419, 40, -63, 603, + 67, 209, 321, -1765, -200, 68, 473, 622, + 5, -2883, 112, 188, -189, -2765, 169, 397, + -330, -642, -798, 129, -110, -164, -20, 176, + -213, -5415, 39, 31, 13, 270, -477, 166, + 167, 4, 216, -12, -528, -75, -291, 396, + -499, -2011, -172, -265, 96, 83, -279, 114, + -166, 833, 30, 2493, 94, 130, -183, -659, + 1, -227, 75, 349, -2757, 82, -116, 9, + 952, -112, -2444, -333, -206, -406, 201, 15, + -768, 88, 1390, -33, -558, 97, -201, 29, + 3470, 50, -40, -271, -171, -26, 47, 485, + -250, 3318, 112, 639, -2911, 123, -264, 3, + 8, 379, 73, 54, 88, 227, 73, 58, + -572, 782, -183, 305, 49, -23, -2968, -41, + 291, -25, 157, 295, -2118, 125, 5, -193, + -159, -543, -75, 1181, -191, -547, -93, 117, + -1831, 265, -607, -30, 194, -3929, -70, 159, + 79, -1519, 38, 201, 14, -24, -76, -366, + 14, -2748, 0, -372, 405, 39, -170, 320, + -257, 2153, -12, 158, 322, -4013, 22, -101, + 217, 637, 273, -430, 228, -428, 102, -356, + -266, 82, -31, 14, -223, -2595, -360, 2094, + -379, 624, -192, 245, 294, 1484, -117, 156, + -53, 3668, -3573, -118, -213, 257, -211, 66, + -62, -173, -166, -123, 163, -81, -39, -74, + -21, 126, 722, -136, 2050, -206, 86, 275, + 76, -249, 55, -2508, 95, -60, -34, -360, + -9, 187, 34, -87, -30, 137, 48, 4761, + 109, 511, -496, 104, 399, -361, 162, 78, + -29, 159, -112, 182, 246, 52, 255, 338, + -35, -1, -68, 5, 182, 7675, -119, -14, + -1901, -111, -106, 22, -16, 81, 159, -2423, + -71, -24, -153, -520, 126, 370, -186, 230, + -51, -401, 206, -32, 52, -71, -79, 503, + -239, -231, 55, -133, 5226, -45, -165, 57, + 2314, -209, 302, 78, 154, -3092, -605, -498, + 410, 159, 336, -147, -120, 143, 36, 587, + -182, -182, 1457, 1008, 2524, -446, 2333, -497, + -761, -162, 125, 420, 225, -117, -324, 437, + -50, 190, 129, 259, 33, -2, -9, 32, + -24, 91, 97, 201, 19, 169, 3535, 485, + -144, 330, -193, -2715, 603, 303, 1124, 107, + -1386, -1437, -203, 180, -81, 303, 209, -21, + -65, 26, 91, 98, -1349, 196, 2103, 917, + -732, 834, 1456, -92, -455, -130, -732, -288, + 39, -85, -557, -39, 3213, 297, 392, -378, + -520, 795, -2407, 6, 7, 406, 203, -73, + -247, 317, -3336, 3166, 206, -36, 159, -279, + 442, 54, -324, -18, 544, -250, 142, -440, + 100, -145, -3772, -199, 139, -156, -11, 34, + -178, -233, -370, 601, -58, 1679, -170, 76, + 684, -35, -73, -52, -33, -3, -89, -5, + -82, 73, -11, 51, -48, -12, -376, 4348, + -203, -432, 189, -35, 144, 31, 181, -106, + -5112, 552, 480, 0, 63, 31, 33, 504, + 1055, -3007, -214, 154, -100, 246, 269, -423, + 579, 63, 1668, -296, 390, 109, 21, -6, + 71, 3321, 246, 197, 355, -198, 472, 135, + 437, -1734, 1299, 227, -618, -48, -199, 217, + -230, 70, 99, 2632, -203, 3105, -87, 149, + 303, 124, 362, -322, -44, 38, 104, -28, + 48, -175, -468, -410, -4451, -152, 2157, 26, + -281, -581, 36, -205, 101, 230, 192, -129, + 319, 20, 65, 4879, 123, -236, -178, -128, + -387, -124, 528, 142, -775, -301, -88, -380, + 120, -42, -17, 64, -1074, -3350, 1335, -1078, + -14, -462, -113, 253, 450, 36, -8, -346, + -54, -7, 52, -100, 74, 8266, -193, -36, + -51, 12, 59, -68, 190, -36, 89, 38, + -59, 13, 269, 109, -15, -141, -64, -60, + 238, 6, -4338, 381, 1252, 354, -41, 41, + 191, -236, 122, -2712, 352, -117, -121, -284, + 1516, 473, -332, -277, -1792, -335, 84, 64, + 9595, -246, -278, 446, -95, -32, 60, -146, + 104, -84, -3, 107, -116, -377, 101, -149, + -45, 364, 104, -193, -254, 2929, -164, -93, + 324, 749, -928, 435, 2357, 350, -40, -153, + -48, -626, 390, -48, -4248, -458, -930, -218, + -486, 1769, 335, 152, 165, 111, 118, -407, + -87, -373, -333, -134, 86, -32, -144, -18, + -16, -7549, -146, 49, -184, 116, -28, -51, + 190, 115, 80, 68, 129, 206, 294, 331, + 179, -270, 174, 2444, 55, -3271, 70, -124, + 228, 330, -21, -419, 62, -140, -2388, 7, + -2683, -129, -1050, -548, 811, 189, 359, -385, + -82, 9031, 95, 77, -69, 164, 261, 61, + -73, 230, -163, 141, -38, -43, -150, 164, + 28, 164, 59, -58, -312, -134, 102, -67, + 166, -163, 63, -6795, -103, -147, 81, 273, + 133, 122, -162, -207, 127, -60, 4628, -1, + 1315, 518, -163, -246, 54, 239, 154, -154, + 265, 2000, 25, 227, 42, 179, 88, -3446, + -214, 182, 438, 90, 196, -69, 134, -56, + -451, 716, -1120, -287, 118, 230, -37, 145, + 284, -250, 139, -947, 203, -3176, -57, 151, + 3201, 818, -87, 347, -486, -201, 1176, -325, + -966, -263, -184, 238, -156, -396, 152, 959, + -59, -33, -159, -3, 9394, -119, -81, -50, + 67, 9, 27, -62, -121, -210, 48, -211, + 5, 396, 633, 34, -16, 67, -247, -77, + 128, 441, 3896, 251, 970, 119, -387, -35, + 124, -64, -664, -6550, 101, -52, 19, 44, + -132, 79, 731, -155, -262, -140, -31, -191, + -110, 276, -162, -49, 81, -117, 15, -570, + 420, -1232, -125, 3737, -95, 544, -149, 463, + -129, -345, 350, 183, 173, 197, 464, 180, + -249, -365, -785, -9, -3411, -235, -124, 225, + -4516, 196, -150, -89, -89, 54, -110, 137, + -431, 272, -12, -7, 114, -201, 166, 1570, + -74, -88, 6019, 350, -75, 68, -29, -81, + -50, 57, -62, 103, 61, 276, 22, -131, + -134, -3347, -60, -3397, -311, -105, 90, -159, + -222, 151, 224, -210, 264, 192, 29, -84, +}; + +static const int16_t cb0808sl0[] = { + 24, -3148, -3111, 106, 45, -114, -85, -211, + 154, 172, 246, 368, -130, 58, -135, 70, + 102, -150, -76, -7, 13, -1, -29, 20, + -7, 112, -234, -115, -138, -40, 106, 178, + -7276, -537, 25, 856, 460, 3107, 146, -520, + -631, -118, 393, 179, 144, -86, 47, 82, + 3031, 28, 164, -308, -411, 72, 138, 378, + 242, 253, 12, 158, -28, -60, -29, -46, + -5, -11, 84, 2753, -113, -65, 3, 5, + 13, -5110, -74, -126, -129, -82, -58, 116, + 15, 68, 243, -32, 126, -48, 11, -7, + 75, 10, 166, -153, 8, -43, -38, 81, + -41, 13, 100, 27, 46, -441, -56, 35, + 4, 51, 7528, 52, -141, -153, 39, -36, + -86, 80, -35, 50, -46, 23, 178, -3986, + -3350, 59, -278, 37, -2, 14, -157, -208, + -317, 218, 15, -296, -32, -51, 36, -27, + -2062, 28, -37, 322, 2286, 214, -196, -171, + -64, -163, 265, -50, 3, -177, -22, 68, + 124, 37, -15, -2202, 60, 133, 4, 371, + 2753, -111, 480, -446, 484, 43, 150, -331, + 1410, -791, 123, -136, -192, 267, 0, -89, + -105, 421, 68, -126, 79, 279, 202, -132, + -208, -3345, -105, 59, 118, -647, -48, -12, + 145, -403, 200, 7, -4, -3192, -223, 64, + 0, 415, 366, 136, 49, -7611, 79, -105, + 127, -69, -43, 103, -95, -93, -10, -30, + 94, 108, -109, 0, -87, -70, 300, -93, + 113, 25, -17, 2263, 41, 192, 18, 73, + 179, 129, 149, -81, -1, 0, 201, 184, + 651, 8, 18, 114, 2820, 383, -71, 376, + -2281, -1190, -143, 121, -45, -2157, -410, 81, + -14, 1537, -833, 29, 1150, -494, -8, -14, + 210, 188, 3073, -1775, -123, 80, -103, 227, + 296, 111, 1637, -197, 1349, 174, 3276, 49, + -98, 74, 660, 3, -252, -356, -9, 527, + -63, -7995, -16, 85, 249, 74, 26, 2, + 3, 26, -124, -61, -26, -144, 4, -52, + 6, -517, -95, 2566, -26, -190, -196, -509, + -2982, 4, -178, -9, -67, -25, 1, 193, + -68, -46, -82, -3734, -14, -339, -44, -151, + 55, 230, -3, 100, -47, -69, 35, 107, + 127, -175, -11, -10, -158, -140, 2934, -132, + 2571, -158, -217, 106, 137, -222, 74, -42, + 64, 559, 122, 73, -112, -2964, 2502, 13, + 301, -41, 203, -382, -151, -221, -147, -24, + 83, 37, -45, 56, 89, 71, 109, -14, + -43, -130, -108, -18, 74, -23, -34, 79, + 7662, -88, 70, 21, -110, 147, 26, 250, + 74, 165, 49, 43, 45, -22, -14, 293, + 5275, 57, -72, 93, 40, 115, -139, -332, + 95, 92, -26, 26, 169, -94, 332, 71, + -482, 137, 190, 114, 14, 151, 3125, 6, + 109, 6, 7, 1543, 282, -24, 24, 142, + 33, 123, 41, -72, -253, -33, 309, -107, + -64, -131, 56, -3528, 82, -17, 417, -47, + -588, 274, 155, 158, -245, 186, 147, -7, + -50, -218, 12, 118, -62, 652, 145, 64, + 2473, -146, 220, -2973, 97, 284, 29, 268, + 29, -208, -40, -251, -175, -16, -58, -65, + 28, 26, 55, 74, -12, 1911, 43, -82, + -150, -13, -119, 8, 119, 156, 1550, -88, + -102, 46, 226, -132, 95, 100, 87, 7, + -46, 8, -32, -16, -12, 317, -33, -27, + 291, -88, 169, 1, -101, -61, 161, 162, + -33, -1, 11, 5097, -34, 142, 31, 94, + 3619, -94, 67, 3379, -65, 28, 254, 189, + 110, 138, -41, 52, 32, -104, 154, 172, + -2365, -464, 281, 207, -66, -190, 399, -158, + 13, -155, -223, 92, -108, -25, 468, 189, + -4359, 42, -135, 138, 36, -1403, -264, -336, + -164, -49, 54, -125, -61, 62, 16, 172, + 182, 3134, -1373, 63, -227, -106, -133, -165, + -69, -57, -184, -46, 9, -57, 50, -3, + -62, -15, -123, 108, 111, 91, -161, 23, + -81, 7, 208, -5385, -244, 24, 95, 12, + -264, 62, -44, 21, -240, -299, -12, 117, + -61, -2551, 389, 2816, -179, 203, -421, 899, + -7, 174, -200, 98, 1036, -166, 11, -137, + 78, -7, -121, 245, -77, 124, 102, 51, + 3136, 74, -310, 40, 212, -239, -373, -154, + 398, 2967, 654, 488, 103, -230, -330, 831, + -63, -473, 152, -556, -2186, -371, 4, 86, + -12, -141, 5503, -87, -123, -17, -15, 154, + 192, -86, 97, 165, 352, 56, 154, 43, + -331, 1004, -52, -131, -3311, 3, 110, -153, + -70, 137, -168, -20, 115, 140, -25, -54, + -13, -300, 57, -131, 214, 261, -92, 618, + -2752, -3146, 61, -51, 210, -230, 87, -184, + 330, 22, -19, -107, -477, -39, 1, 127, + 178, -73, 425, 56, -25, -41, 135, 2423, + 59, -46, -10, 49, -116, -51, -2239, -228, + -75, 48, 3, 181, 161, -133, -355, 81, + 5, 84, -222, -83, 92, 33, -7558, -38, + -3, 159, 33, -58, -37, -107, 16, -61, + -94, 93, 97, 49, -275, 29, -198, -4, + -68, 87, 116, -7039, 46, 81, -25, 0, + -7, -46, 152, 64, -40, -143, -56, 147, + 403, 257, 2380, -538, -400, -132, -89, -29, + -2878, 457, -552, -12, -189, -370, -357, -3679, + 422, 63, 200, 116, -9, -229, -72, -100, + 3346, 88, -18, 28, -47, 159, 108, -160, + 253, 58, 2938, 55, 366, -33, -3209, 31, + -148, -10, -40, -443, 127, 120, 106, 9, + 4, -240, 200, 129, 328, -102, 187, 182, + 112, 2757, -3260, 314, -163, -3, -185, 354, + -97, -69, -199, 41, -143, 19, 108, -22, + -32, -18, -149, 35, 31, -5, -5083, 52, + 9, 5, -44, -52, 76, 7, -100, 7, + -79, 0, -33, 110, -208, 20, -159, -76, + 2, -8192, 156, 118, -306, -88, 136, -293, + -176, 163, 8, 1871, -112, 229, 311, -95, + -75, 17, 217, 152, 62, 17, -246, 3579, + 5, -87, -21, 92, 114, -185, 118, 8, + 196, -124, -220, 175, 104, 54, 104, -40, + -45, -152, 392, 216, -24, -28, 2024, -6, + 42, -91, -201, -9, -192, 35, -43, 1661, + -356, 1207, -1322, 340, -2937, -16, 163, -801, + -423, 197, -512, -70, 229, -412, 291, 511, + -36, -179, -98, -54, 93, 87, 263, -44, + 167, 77, -4, 7278, -101, -193, 91, -251, + -131, 269, 15, -168, -22, -26, 44, 24, + 154, 115, -11, -124, 28, 37, -14, -46, + -67, -8192, -51, -169, 41, -302, -81, 1991, + -11, 136, -175, 71, -104, 89, 60, 137, + 17, 106, 96, -238, -83, -52, -113, 53, + 2903, -47, 9, -227, -2784, -245, 146, -196, + -216, 41, -6, -128, -53, 1, -128, -145, + 149, 32, 25, -57, -14, 72, -135, 10, + -1946, -67, 74, -127, 141, -299, 55, 8, + 947, -2239, -271, 74, -227, -81, 31, 291, + -86, -2914, 22, -7, 293, 2, -25, 9, + -2997, 89, 3158, 192, -46, -246, -140, 46, + 287, 133, -110, 308, -114, -33, -106, 9, + -89, 105, 364, -172, 185, -61, 4464, -92, + -264, -66, -161, 102, -178, -264, -21, 114, +}; + +static const int16_t cb0808sl1[] = { + 246, -6, -180, 90, 127, 3322, 598, 182, + 81, 82, 67, -39, 87, -60, -8, -89, + 185, 99, -25, 27, 9, -59, -7421, 49, + -17, 116, -85, 6, -305, 88, -164, 99, + 61, -415, -114, -288, 1, -165, -12, 5, + -143, -142, -521, -245, -53, 38, -99, 3709, + -52, 0, -41, -135, 147, -217, 62, -2144, + 255, 132, 264, 65, -37, 204, -338, -280, + 192, -184, -158, -3685, -26, 203, 430, -29, + -16, 77, 230, -311, 597, 2553, -1126, -63, + 154, -431, -161, 315, 286, -147, 177, -3, + 93, 449, 253, -37, 101, -244, -77, 42, + -384, 22, 36, 235, -4973, 243, -120, -105, + -226, -114, -455, -404, 164, -505, 476, -124, + -2837, -82, -2920, -3, 0, 134, -94, 264, + -53, -53, 108, -3, -845, -2813, 228, -179, + -60, -2, 65, 33, -153, -16, -149, -2135, + 209, -929, -288, 227, 2656, -125, -42, 17, + 30, 3375, -367, 53, -262, -351, 108, -270, + 11, -57, -182, -51, -149, -287, -115, -24, + 99, -76, 6954, -75, -4, 38, -168, 138, + 109, -239, -45, 49, 28, -1376, 49, 66, + -83, -129, -61, -99, 135, 14, -93, 111, + 37, -16, 2, -76, 360, -77, 82, 161, + 149, -1660, 18, 98, -34, -12, -36, -65, + 126, -57, 28, 519, 2044, 297, 73, -218, + 51, 17, 21, -70, -32, -73, -39, -38, + -11, 60, 38, -129, -105, -173, 200, 7, + 124, -74, -2780, 2608, -57, -213, 54, -200, + 134, 208, -34, 236, 143, 101, 327, 558, + 75, 317, 3090, -188, 544, -186, 15, 116, + 237, 76, -105, 29, -300, -27, -211, 71, + -144, 183, -77, 38, -16, 39, 56, -7308, + -113, -116, -32, 222, 60, 76, -21, 59, + 52, 104, 383, 73, 149, 88, 127, 34, + -1819, -46, 50, 11, -159, -223, -163, -149, + 95, -163, -2168, -19, -937, -183, 66, -465, + -257, 341, -70, 111, 228, 52, 83, 63, + -52, -187, 16, -2539, -51, 3240, -81, 87, + -116, -183, -182, 96, -22, -191, -107, 217, + -10, -215, 9, -7, -97, -331, -55, 513, + -398, 1378, 2627, -2129, 563, 1462, -369, 498, + 1176, -469, 220, -953, -122, -236, -306, -276, + 31, 35, -167, 558, -134, 45, -54, 16, + 36, 18, 300, 2438, 62, -177, 77, 2638, + -108, -115, 3392, 274, -123, -66, 201, -400, + 170, 142, 151, 332, 53, -507, 81, -653, + -93, -3204, -5, 10, -43, 79, 3879, 77, + 191, 24, 23, -208, 6, -109, -97, 126, + -306, 629, 26, -516, 79, 21, 131, 43, + -253, -3463, 840, 653, -95, -48, 300, -1026, + -324, -909, -383, 195, 342, -136, -192, 422, + 262, -13, 534, 3125, 8, 1672, 176, -293, + 211, -1213, 537, 637, -10, -116, -149, 44, + 53, 105, 7, -97, 3, 17, 8, -21, + -7, -41, -38, -4959, -81, 1, 165, 196, + 98, 35, -35, 8, -28, 113, -20, 108, + -130, -65, 172, 2858, 41, -3295, 138, 10, + -95, -30, -173, 85, 42, 30, -119, 161, + 195, 125, -32, 136, 319, -33, 5142, 50, + 100, 128, -90, -53, -67, -203, 28, 19, + 37, -137, -124, -105, -25, -3405, -250, 294, + 409, -99, -1072, -383, -12, 212, -276, 3389, + -101, 171, -41, -554, -295, -437, 86, 158, + -242, 167, 135, 7, -149, 48, -4, -84, + 4911, 283, 5, -14, 105, -107, -384, 102, + 183, 47, 67, -5105, -5, 16, -155, 181, + 110, 24, -77, -32, 120, 1, 22, 167, + -90, -150, -5, 163, -44, -28, 54, -3058, + -174, 58, 152, -31, -179, -122, -57, 232, + -395, -4961, 61, -115, 31, 14, 82, -109, + -39, 59, -49, -133, 52, 17, 57, 52, + -63, 275, 146, 104, 53, 47, -55, 311, + 4871, -26, 48, -94, -11, -58, 63, 140, + -74, -94, -269, -77, 3372, -3116, 16, -47, + -74, -161, 115, 58, -247, -119, 399, 42, + -181, 154, -218, -24, -237, 58, -275, 2979, + 187, -124, 312, 301, 2767, -8, 40, -23, + -6, -38, -52, -363, -265, -78, -230, 286, + -135, -337, -81, 170, -13, -58, -117, 519, + -4784, 157, -193, 9, 62, -21, 180, 128, + 326, 213, 2440, 62, -601, -55, 2, -18, + -342, 142, 358, -632, -377, 3590, -248, -278, + -235, -28, 242, -133, 144, 26, -261, 113, + 45, -23, -1984, -77, 128, 249, -8, -266, + -38, -6, -1672, -45, -84, -377, 154, 17, + -83, -44, 156, -137, 43, 91, 253, 17, + -71, -92, 178, 12, 18, -8, -105, 101, + 7068, 71, -81, 84, -33, 79, 53, -7, + -85, -265, 117, 317, 114, 72, -482, -418, + -185, -97, 268, -1543, -79, -146, -48, -45, + -3259, -212, 1149, -165, 177, -158, -77, 100, + 86, -69, 107, 219, -512, -253, -418, -45, + 16, 5501, -184, 207, 67, 46, 109, -28, + -9, 33, 63, -16, 39, 92, 27, 23, + -10, -8192, 0, 50, -57, 68, -444, 1082, + 247, -138, 120, 472, -692, 212, -1576, 66, + 3061, 402, -160, 337, -685, -519, 227, -279, + 92, -4135, -393, -44, 6, -129, 59, 239, + 151, 153, -39, 116, 134, -40, 171, 118, + 207, 2615, 38, -167, -1671, 85, -135, -182, + -88, 246, 53, 29, -2, 16, 232, 544, + -46, -138, 122, -52, 1312, 9, 92, 13, + 4, 66, -35, -134, -56, 85, -43, -31, + 28, -3187, 100, -103, 70, -3, 186, -43, + 122, -3040, -27, -46, -121, 1, 37, 0, + -60, 2, -100, -152, -218, 175, -406, 175, + -193, 68, -208, -23, -230, 221, 3397, 45, + 48, 37, 337, 11, 15, -69, -4, -82, + 53, 33, -56, 75, -98, -69, -11, -19, + -12, 81, -52, 5428, 121, 82, 465, 10, + -229, 126, 32, 119, 439, 126, 1996, -85, + -81, -57, 88, 232, 108, -22, -24, 27, + -136, 91, -32, 18, 226, -33, 15, 117, + 145, -7737, 9, 58, -102, -113, 26, -2174, + 28, -421, -11, -70, -23, -70, -119, -96, + -133, 208, 20, -3750, -14, 23, 41, -180, + 2097, -103, -599, 146, 251, -77, -557, -76, + -96, 69, 266, 316, 74, -17, -227, 223, + 33, -261, 135, 8126, 250, -5, -57, 35, + 382, -44, 136, 81, 42, -80, 179, -73, + -75, -57, 274, -15, -3140, 3236, 196, 150, + -51, 222, -190, 13, 83, -313, -149, 89, + -281, -12, -42, 293, 567, 19, -43, 146, + 102, -39, 3666, 95, 76, -1, 12, 27, + 7, -5, 261, 132, -215, -295, -51, 496, + 77, 100, 16, -285, 649, -95, 280, 77, + 121, -2676, 25, -1148, 2912, -341, -91, 2380, + -80, -6, 269, -34, -686, -208, 19, 228, + 24, -5, -150, 11, 214, -316, 1187, 599, + -62, -2274, -240, 48, -86, 87, 86, 477, + 3832, 67, 135, 68, 747, 339, 385, -255, + -224, 184, 70, 171, -134, 2604, -231, 72, + 170, 51, -2785, -580, -86, -393, -63, -79, + -151, 334, 78, 329, -278, 102, -26, -55, + -3531, -378, -247, 176, -202, 147, 169, 87, +}; + +static const int16_t cb0808ss0[] = { + -1872, -332, -1311, -512, -934, -11, 112, 389, + -189, -1513, 1508, -1081, 185, -87, 3092, 529, + -166, -171, -1648, 2544, 2144, -259, -688, -1113, + -71, 387, 1194, -733, 175, 856, -976, 268, + 589, -1773, -426, -109, 1210, -486, 297, 195, + -991, -1543, -432, 1190, -1089, -531, -421, 80, + -225, 354, -231, -670, -299, -3694, -510, -882, + 31, 2804, 476, -478, 1897, 686, -1066, -1222, + -882, -374, -427, -1464, 957, 549, -1211, -204, + -218, -1412, -545, -968, 943, -342, 80, -281, + -249, -968, 3424, -2342, -212, 949, -167, -271, + 607, -838, -418, -891, -398, -877, 138, 1653, + -1034, -2515, -1363, -1535, -364, 432, -324, -1120, + 1531, 407, -698, 396, 325, 1432, 646, 2777, + 174, -836, -605, 2257, 1086, -888, 348, 36, + 513, 2229, 1543, 1293, 94, 2444, -574, -1030, + 933, -9, -668, 555, 346, 511, 715, -4033, + 409, -299, -166, 700, -560, 950, -1265, -245, + 1418, -1362, -20, 870, 152, 942, -331, -66, + 227, -186, 251, -3632, -1057, -989, -1798, 923, + 542, -630, 2889, -128, 1475, -97, -964, -860, + 534, -217, -746, 181, 321, -1007, 2595, -411, + 1298, 635, 310, 1955, -17, 846, -824, -11, + -952, 208, 328, -547, -1086, 1481, -264, -1574, + 3579, 500, 242, 1038, -1030, 353, -75, -2100, + -347, 2662, -2378, 261, 210, -1151, 525, 291, + 368, -200, -702, 105, -140, -81, 663, -716, + 334, 1220, 239, 21, 114, 301, -1898, 3647, + -302, 550, -489, -484, -853, -274, 1509, -419, + -330, -1121, -2666, 2507, -621, -818, 1188, -69, + -885, 231, 316, 1837, -740, -187, -102, 1148, + 1219, -123, 852, 1154, 27, 139, -344, -404, + -1133, 425, 353, 145, -123, 179, 49, -5836, + -571, 39, 274, -38, -457, 172, -80, 593, + -1977, -331, -421, 1965, 1768, -113, 64, 2272, + 475, 2165, 210, 873, -819, 757, -119, -530, + -1431, -2167, -1517, -864, 1060, -752, -1366, 2349, + -671, 1180, -179, 10, -450, 781, -799, -1303, + -393, -61, -113, 2053, -550, -843, 1028, -2044, + -2631, -1388, 1078, 171, 517, 496, -928, -1695, + 298, 708, -557, 122, -917, -197, -423, 1142, + 116, -528, -585, -470, 480, 400, 4605, 384, + -142, 57, -2340, -1507, -67, 907, 8192, 356, + -18, -704, 528, -32, -379, -611, 418, 703, + -396, 531, 155, 642, 678, -427, 85, 814, + 212, 845, -579, -590, -456, 103, -624, -4541, + -306, 638, -760, 36, -149, 1929, 1229, -717, + -543, 530, -694, 169, -2996, 423, -346, -897, + 1077, 255, -1054, -63, -1773, -479, 479, -701, + 1547, -1683, -342, -926, 112, -663, 1638, -9, + 2587, 311, -561, -932, -539, -335, 589, 779, + 2345, -432, 788, -967, 319, -4, 192, -588, + -103, 357, -3508, -257, 707, -473, 1521, -9, + 130, 3290, 274, -296, -802, -139, -814, -19, + 971, 849, 253, 486, 40, -1216, 1179, -1772, + -996, 1400, 838, 1955, -1432, -1925, 2324, 767, + 896, 1314, 3407, -1003, -552, -967, -166, -26, + 1099, -1965, 9, 239, -10, -243, 864, 1251, + 91, -2279, -691, -542, -473, -1908, -1208, -1447, + -891, -311, -1136, 1638, 1150, 586, 1656, 260, + 538, -1746, 1460, -478, -860, 297, -605, -139, + 822, -3718, -194, 307, 609, 30, 3418, 226, + -338, 161, -387, -344, -472, 354, -170, -421, + 433, 601, -1446, 821, -48, -31, 493, 916, + -347, -3740, -899, 1389, -355, 71, 382, -644, + 485, 218, 975, -542, -3191, 742, -102, -783, + -1607, 473, 196, 1692, -71, 258, 2446, 1507, + -968, -1025, -1087, 637, -921, -1405, 1192, -88, + 2044, -1813, 922, 156, -1096, 1007, -695, -485, + -1015, -468, -316, 1825, 190, 2132, -205, -218, + -3556, -286, -1350, -212, -634, 120, 417, -311, + -90, 219, 870, -334, -1304, 523, 999, -144, + 98, 2157, 205, 45, -247, 1401, 2423, 278, + -766, -66, 309, -121, 316, -543, -3418, 932, + -803, 637, 436, -2341, 2016, 928, -836, -1212, + 702, -1179, -544, 6, -1429, 1014, 464, 1166, + 581, -291, 136, 0, 983, -799, 693, -230, + -727, -186, -310, -76, 698, -6, -660, 762, + 814, 451, -328, 4469, -454, 14, -423, -116, + -134, -568, 1535, -562, -629, -269, 826, 380, + 68, 282, -409, 640, -384, 218, -5702, -280, + -638, -2586, -557, -877, 49, 648, 434, 1178, + 3442, 883, -78, 2024, -253, -210, -1090, 198, + -67, -52, 3226, -671, -1606, 49, 1775, -422, + -173, 309, -720, -667, -505, 2073, -678, -1152, + -231, -519, -719, 422, -2614, -394, 543, -993, + 1449, 437, -463, -1286, 1191, -1274, -710, -463, + 659, 1493, 45, -832, -414, 306, 94, 1284, + -669, -1312, 1082, -917, 2489, -494, 547, 738, + -1696, -174, 282, -1442, -1455, 1633, 912, -428, + 964, 12, -2404, -485, 631, -311, 1810, 2912, + -16, 576, 50, -927, -175, 37, 673, -201, + 995, 684, -244, -251, -1444, 3195, 1863, -88, + -1183, -966, 1769, 36, -825, 766, 489, -86, + -365, -106, -1477, -330, 125, -253, -250, -523, + -731, -5130, 653, 395, 99, -845, -721, 127, + -287, 850, 479, 25, -30, 36, -782, 611, + 448, 99, 933, -20, -853, -949, -286, -379, + -654, -385, 1298, 547, 235, 1242, -583, -4147, + 81, -547, -1142, 1280, -223, -1712, -1501, 458, + -142, 2065, 208, 855, -1115, -187, 861, 1090, + -760, -2551, 2326, -378, -1205, 488, -241, 893, + 113, 176, 4060, -225, -41, -717, -26, -442, + -445, -312, 813, 494, 314, -210, -98, -788, + 255, 632, -506, 166, -704, -334, -214, -860, + -5281, 60, -34, -238, -147, 643, 520, 2038, + 28, 2433, -1694, -1316, -615, 572, -150, -107, + 349, -1763, -307, 78, -1124, -631, 1162, -326, + -277, -591, 558, 1016, -4668, -324, -815, -251, + -1284, 52, 294, -1283, 598, 630, -345, 641, + -34, 1085, 4247, 637, 1695, -858, 212, -243, + -64, 327, 557, 426, -321, 363, -652, 372, + 777, -567, -749, -1704, 414, 5299, 389, 242, + 39, 31, -315, 179, -102, 11, 62, 248, + 557, 706, 359, -85, 303, -403, 1531, 409, + -2092, 144, -1354, 54, -48, 51, -1787, 1278, + 942, 1264, -1495, 1671, 92, -899, -1149, 1908, + -903, -596, 342, 1749, -825, -13, 509, -1163, + 1065, 2405, -253, -741, 1099, -528, 2971, -412, + -235, -869, -136, -352, -489, -384, 745, -398, + -4197, 84, 1152, -497, 955, -161, 461, -16, + -871, 801, -93, -15, -352, 1826, -490, -536, + -2853, -633, 128, -1537, -1670, 538, 788, 1276, + 554, -340, 565, 1216, -1758, 384, -1313, -628, + 24, 835, -862, -927, 1792, -1042, 209, -784, + 807, -383, -1399, 3531, 52, -537, 205, -271, + 3071, 1678, -694, -2313, -1279, -1656, -428, -1063, + -1576, -323, -342, -257, -227, -716, -458, 1161, + -180, -71, -40, -1276, 1778, -3123, -378, -1363, + -827, 880, 275, -274, -581, -186, -8, 661, + -1114, -199, -171, 379, 429, -1551, 1645, -857, + -163, -2623, 1217, 1458, -596, -68, 383, 973, + -485, -354, -597, -2875, -516, 234, -83, 340, + -396, 1365, -574, -816, -2086, -1059, -1589, -593, + -779, 334, -546, 49, -1065, -1959, 1736, 1134, + 187, 1833, 17, -82, 68, 803, -456, -89, + 1760, 836, 1570, 122, -985, 2549, 1616, 82, + 1102, 227, 222, -1236, -155, -1012, 633, 467, + 163, 445, 166, 766, -253, -347, 1041, 5121, + -21, 792, 81, -478, 128, -158, 316, -1180, + -372, 1692, -828, -31, 1122, -2583, 1346, 2483, + 195, 72, 549, 424, 947, -470, 1940, -75, + 505, 1377, 550, 58, 1785, 343, -817, 874, + 3483, -307, -576, 240, 35, 837, -717, -247, +}; + +static const int16_t cb0808ss1[] = { + 2328, 183, 1652, -907, -3005, 1329, -61, -465, + 0, -453, -1621, 223, 232, -59, 254, -312, + -117, -59, -477, -2648, -1176, -227, -1937, 962, + 141, -1489, 849, 93, -1284, 1000, 295, 192, + -139, -468, -736, -436, 2155, 371, 2475, -348, + 856, -1985, 38, 94, 496, 758, 954, -243, + 134, -1759, 491, -1406, 1114, -2554, -447, -692, + -2128, 44, -923, 1610, 787, 150, -500, 3442, + -698, 276, -517, -1555, 379, -72, 810, -1373, + 2897, 936, -586, -438, 925, 1881, -419, 211, + 1724, 721, 885, 614, 253, 613, -1440, 509, + 842, -2407, -216, -1765, 451, 1419, 599, 689, + 1473, -175, -2974, -1015, 1983, -68, 640, 21, + 140, -1295, -556, -89, -836, 718, -343, -1903, + 443, 502, -1064, 1328, 86, 2049, 1235, 130, + 892, 1105, 692, -2968, -755, 473, 423, -1371, + -2032, 1885, -29, -516, -1118, 285, 482, 164, + -1932, -685, -819, 695, 715, -1520, 1300, -1188, + -121, -197, -4233, -141, 1279, 299, 208, 1071, + 20, 772, 692, 531, 257, 428, 78, 202, + -399, -27, 793, 1150, -736, 388, -1922, 155, + -410, 85, 1135, 835, 133, -88, 65, 62, + -534, -136, -4590, -162, -968, 1378, -445, -2825, + -93, -519, 402, 12, -1110, -637, -765, 210, + -2305, 654, 447, 26, -265, -91, 71, -886, + 126, -109, 7, 346, 19, -713, -257, 774, + 1080, -579, 185, 200, -5691, 541, 228, 424, + 37, 512, -78, -201, 848, -369, 1099, -1001, + 214, -336, 266, 2502, 1583, -2131, -654, -2476, + -97, -787, -738, 1056, 1385, 124, 944, -3421, + 1172, -547, -226, 1249, 1552, 1194, -308, 489, + -1152, 751, -92, -168, -3112, -1451, 2038, 35, + 371, -1585, 535, 308, 5, -53, 523, -169, + 591, -175, -1028, 91, 743, -144, 230, 1831, + -177, 509, 1291, 1808, -3322, -815, -227, -475, + -1064, -647, 79, 1223, 174, -10, -412, 393, + -305, 1224, 1310, 12, -521, -1267, 1911, 2245, + 407, 724, -1232, -2017, 566, 506, -467, 813, + 660, -196, -3643, 2495, 870, -561, 289, 662, + 654, -508, -734, -325, 622, 220, -309, -307, + -181, -445, 131, -1655, -835, -631, 883, 211, + 737, 552, -881, -3103, -766, 595, 112, 151, + -1177, 601, 479, -14, 37, -926, -505, 1062, + -1755, -799, -178, -555, 2509, -694, -792, 662, + 737, 847, 1611, 397, -67, -134, 474, -2251, + 2698, -245, 2054, 1603, 1291, 1188, 40, 763, + -216, 1554, -297, -1769, 410, 1270, 1089, 440, + -967, 294, -37, 270, 471, 1287, 3773, -108, + -610, -275, -298, 270, -384, 2072, -675, 1002, + 174, 18, 171, 704, 3311, -105, -1774, 108, + 511, -3001, -69, 543, -227, -1196, 1431, -63, + 6, 1279, -1, 671, 239, -2127, -1924, -934, + 168, -300, 1075, 1071, 3088, -590, 1439, 329, + 1073, 127, 762, -131, 274, 837, -134, -610, + -399, -1415, 1047, -156, 415, 765, 698, 428, + -748, 241, -4226, 152, -829, 1040, -937, 145, + -852, -85, -2957, -130, -406, 726, 168, -37, + -1321, -1069, -1255, 1159, 1575, 552, 649, -1953, + -17, 1027, 1078, -385, -2761, -553, -201, 58, + -1900, -24, 283, 1248, -90, 419, 1122, 902, + -1548, -32, 34, -360, 707, 45, -3458, -246, + 287, 308, 397, 393, 822, 1323, -565, 505, + -1553, -1902, -677, 625, 1079, -135, -2132, -187, + -163, -1001, -1479, -932, 1131, -2588, -316, 53, + 1270, -747, -966, 980, 242, -266, -1575, -1146, + -605, -523, -221, 585, -787, 1365, -286, -183, + 411, 546, 4779, -286, -578, -101, 309, 896, + 34, 451, -1022, -699, 170, 935, 458, 4143, + 229, -572, -912, -397, -40, -132, -198, 98, + -1858, 612, 101, -98, -18, -349, 322, -1626, + 1304, 273, -235, 418, -509, 3961, -493, 1040, + -416, 1808, 161, 1443, 1052, -460, 55, -67, + 41, 514, 1305, -836, -1636, 1353, 379, 147, + 398, -3814, -679, 235, 327, -2293, -716, 1234, + -728, -323, 698, 1992, 4, -275, 944, 895, + 212, 334, 285, -710, -891, -1325, 3107, 3, + 367, -1779, 300, -868, -59, -644, -326, 111, + 267, -43, 421, 976, 57, 1461, -172, 245, + -188, 296, -215, 5269, -46, 177, 199, -539, + 92, -542, 251, 951, -231, 117, -580, -898, + 402, 847, 4, 384, -215, 161, -1991, 4422, + 2461, -1219, -751, 1843, 1483, 1072, 2621, -16, + -1157, 243, -557, 651, 953, 476, -417, -533, + 505, -590, 713, 153, 1268, -312, -217, -124, + 870, -484, -751, -161, 897, 755, -823, 4117, + -1311, -729, 447, -642, 929, -2408, -338, -967, + -104, -1048, -2216, -1722, -124, -204, -196, -1156, + 1460, 391, -543, 120, 70, 204, 1185, -2490, + 2950, -507, -615, 1243, -150, -363, -475, -531, + 783, 671, -205, -591, 217, -523, 263, -14, + 71, 958, -1185, -1029, -330, 327, -705, 1229, + -2925, 131, -495, 1756, 2101, 441, -11, 133, + 1274, 1253, -154, 772, 522, 1725, -277, -1012, + -726, 1339, -1200, -241, 1676, 974, 2256, 347, + 2743, 1482, -738, -241, -868, -1294, -664, 855, + -1329, -4174, -1647, -104, 101, 307, -647, -823, + 347, 4, -120, -1112, 334, 27, 265, 990, + 319, -1414, 313, -603, 52, -3138, 1552, -612, + -854, 626, 212, 773, 2334, 662, 614, 560, + 589, -533, 1337, 229, 557, -26, 1458, -626, + 1890, 2392, -1525, 1023, 667, -431, 72, 1691, + 1015, -97, -515, 1380, 796, 1192, -39, 162, + -2821, 2960, 1558, -1058, 1327, 793, 1231, -743, + -1190, -245, 29, 486, -494, -1371, 1633, -66, + -1806, 231, -664, -147, 2402, -584, 473, -527, + 1272, 464, 1991, -1007, -235, 357, 201, -1176, + -341, 223, -47, -2089, 815, 49, 192, -719, + -1041, -248, 3046, -40, -501, -346, -1347, -401, + 57, -1588, -1039, 443, 590, -1089, -182, -1365, + -1013, -3917, -382, -98, 1025, -51, 698, -197, + 848, -75, 1596, -408, -1796, -3191, 1155, 234, + -100, 698, 571, -1233, -315, -1502, -647, -571, + -322, 842, -1048, -1115, 8192, -784, -472, 17, + -718, 37, 1190, -393, 146, -547, 90, -433, + -321, -1143, -501, 468, 235, -486, -64, -2214, + -330, -837, 1214, -127, 709, -3, 623, -384, + 221, 297, -783, -3802, -408, -11, -707, 92, + -275, -268, -117, 1580, 1466, 710, -1300, 142, + -746, 1647, 2399, -1231, 114, 1220, -1112, 882, + 467, -973, -976, 3855, -647, -150, -1244, 973, + -364, -154, 473, -675, -817, -346, -266, -769, + -613, -476, 1181, -8, -1054, 405, -768, 1385, + -1598, -892, 672, -2185, 83, -27, 582, -434, + -944, 99, -888, -1658, -1516, 2392, 726, -222, + 284, 324, 4848, -67, -782, -45, 424, -203, + -194, -1229, -114, -189, -216, 275, -935, -93, + 117, -1725, 360, -2561, -1555, -1199, -769, -285, + 74, 1267, -387, 1368, 179, -113, 952, 1025, + 725, -542, -186, 1258, -1396, -747, 572, 603, + 1965, -668, -12, -2512, 1337, -255, 254, 2285, + 1136, 1397, 557, -671, -1149, -614, -462, -913, + -452, 1206, -2922, 485, -882, 270, -1309, -605, + -21, -580, -1284, -194, 169, -2314, -216, -229, + 1124, 103, -1205, 1500, 1118, 1456, -1149, 780, + -467, -385, 585, -1062, 289, -3356, 198, -309, + -310, 91, 44, -377, -632, -737, -516, 30, + -779, 73, -482, 4661, -275, 38, -632, 479, + -345, -406, 76, -208, -230, 80, -220, -313, + 203, -3, 1740, -131, 773, -30, 372, 767, + 1673, -770, 3326, 1586, 234, 408, -257, 474, + -584, -990, 1378, 696, 47, -612, -313, 189, + -3964, 795, -289, 202, -437, -1648, 373, -780, + -24, -952, 123, 438, 797, 539, -481, 191, + 291, 37, -790, -321, 4520, -49, -281, 211, +}; + +static const int16_t cb0808sm0[] = { + -4664, -115, 59, -280, -199, -25, 213, -937, + 344, -2137, -841, -370, 256, 512, 1098, -130, + 58, -121, -414, 8192, 489, -296, -33, 98, + 49, -217, 721, -42, -418, -227, -8, 205, + -276, 407, -1218, -146, -292, -143, 113, 978, + 2693, -9, -1032, 1781, 1777, -215, -978, -824, + 68, -162, 55, 2991, -844, 682, 497, 406, + -922, 2471, 599, 774, -129, 1292, -1004, 777, + 42, 314, -102, -963, -2794, -2620, 510, 355, + 372, -248, -391, -163, -298, 561, 117, 1183, + 38, 182, 1811, -4, 328, -13, -456, 305, + 368, -1691, -2818, -1074, 1029, 261, -1446, 343, + 12, -2757, 1021, -375, -3, -155, 116, 195, + 3420, 64, 139, 780, 187, -464, 261, -313, + -128, 185, 3703, 3160, 960, 706, 41, 405, + 10, 1191, 353, -549, 131, 164, 105, 1, + 23, 386, 73, -509, 2651, -1441, -834, -1657, + -645, 1005, -777, 695, 212, 1420, 65, 701, + 25, 335, 136, 359, -112, -150, 191, 392, + -258, -1140, 651, -4551, 411, 251, -169, 804, + -83, -208, -363, 81, 152, 75, -1194, -203, + -9, 157, 413, -62, -210, 5393, -22, -407, + 132, -288, 2360, 131, -1535, 553, -2524, -140, + 250, 1259, -30, -1, 1766, 99, -529, 91, + 3948, -262, -3752, -382, -339, -701, -140, -787, + 67, -11, 331, -828, -443, 596, 47, 1634, + 31, -318, 39, 147, -670, -776, 707, -921, + 172, 971, 1163, 48, -81, -1357, -181, 2872, + -152, 898, 1075, 529, 91, -2279, 2925, -848, + 589, 1910, 549, 1088, 743, -631, 42, -1528, + 23, 380, -5, 389, -1147, -209, -2041, 224, + -1998, 520, -776, 193, -2648, -78, -34, -131, + 22, -200, -28, 18, 328, 215, 67, 61, + 50, -72, 301, -207, 413, 720, -6194, 967, + -3275, 149, -2444, -521, -772, -278, 137, -159, + 932, -111, 1219, 525, 17, -684, -1229, -1776, + 66, -2307, -195, -527, 272, -470, -356, -7, + -338, 146, 1021, -893, -2980, 591, 129, -257, + 209, -58, 538, -3973, 576, -905, -642, -2092, + 153, 737, -596, 573, 236, -887, -1692, -370, + -189, -216, -58, 714, 10, -582, 517, -86, + 450, -147, -310, 162, 1747, -656, 3577, 700, + 190, -685, -170, 241, 91, -126, 5567, 441, + -50, -688, -73, 938, 320, -130, -839, 1154, + 149, -446, -10, -11, 12, -659, -138, 637, + -470, 933, -431, 235, -86, -2, -407, -5851, + -250, 1414, 525, 110, 421, 255, -149, 86, + 378, -321, 1380, 118, -2849, -1138, 180, 1175, + 1932, 32, -488, -121, -412, -441, 397, 249, + -172, -95, 420, 375, -132, -215, -167, -206, + 8192, -116, -61, -311, 269, 615, -353, -115, + -383, 366, -651, -196, -98, 85, 861, 543, + -231, 237, 493, 380, -766, -168, 3227, 659, + 701, 181, -3004, -7, 154, 298, 298, -257, + -32, -5713, 48, 102, -776, -148, -110, 316, + -645, 212, 213, 575, -69, 31, 553, -673, + -5, -48, -148, -133, 11, 143, 10, 159, + 319, 43, 7462, 162, 228, -90, 75, 151, + 103, -2542, -13, -338, 11, -442, 123, -3039, + -452, 7, 106, 502, 227, -2034, 90, 500, + -28, -646, -262, -62, -78, 40, 419, 6761, + -11, 40, 209, 61, -151, -68, -245, -401, + 26, -123, 189, -57, 611, 6, -1285, -99, + -890, 3609, -302, -808, 639, -3245, -226, 107, + 54, -108, -316, -61, -56, 228, -16, 195, + 275, 214, -60, 77, -7157, 130, 8, 244, + -2160, -760, 450, -186, -378, 32, -797, 214, + -3569, -450, 307, -17, -141, 16, 1024, 404, + -2063, -288, -160, 4056, 877, -346, -970, -87, + 336, 961, 666, 585, -465, -1329, 350, -338, + -5421, -173, -295, 72, -201, 533, 462, -133, + -937, 1891, 264, 71, -935, 640, 687, 852, + -386, -85, -5644, 306, 240, 640, 67, 94, + -902, -351, -417, -3, 284, 38, -156, 359, + 53, 139, 185, 274, 2613, 213, 1282, 2867, + 30, 1234, -911, 343, -93, -1671, 57, -814, + -19, 326, -256, -113, 72, 3177, 3393, -125, + 460, -261, -503, -1019, -681, -253, -957, -157, + -117, -231, -212, 1446, 225, -3009, 313, -435, + 387, -928, 696, -857, -452, 66, -2063, 782, + 14, -94, 51, 242, -422, 236, -3825, -666, + 348, 196, -2770, 429, -416, -266, -1215, -586, + 84, 328, -302, 219, -457, -532, -764, 85, + 2008, -806, 2906, -1405, 367, 835, 715, -986, + -217, 88, -328, 569, -586, 3096, 249, -615, + 453, 176, -540, 792, -2472, 2189, 876, -353, + 111, 212, -7, 597, -154, 818, -401, -1408, + 748, 2502, 1426, -2897, 1069, 326, -605, 120, + -4149, -3087, 729, 82, 224, 320, 353, -77, + -163, -322, 220, -1073, 10, 545, -518, -453, + 50, -386, -2002, 614, -705, -806, -928, 2941, + -520, -35, 1208, 413, 900, 138, -414, -289, + -15, -75, 185, -373, 649, -251, 666, 2708, + -2817, -749, -159, -112, 454, -385, 1037, -46, + -25, -14, 66, 552, 160, -40, -552, -156, + 151, -5287, 541, -242, -82, -1164, 849, -773, + -136, -162, -76, 23, -371, -222, -2245, 468, + 425, -356, 418, -3, -322, -3573, 148, 260, + -155, 3301, -165, -3186, -709, -458, 870, 386, + 59, -161, 533, -150, 598, 384, 900, -1233, + -74, -464, -519, -661, -55, -2562, 290, 1489, + 1739, 2277, 874, -1483, -447, 93, 309, 311, + -203, -19, 2271, -1280, -125, -443, -538, 2650, + -42, 290, 245, -149, 24, 38, -133, 1638, + 210, -239, -180, 516, -12, -719, -19, -517, + -6190, -181, -89, 318, 485, 631, 11, -205, + -57, 257, 573, -72, 273, -579, 107, -5, + 112, 425, 2449, 2741, 758, 656, -663, -282, + -48, -45, -294, -448, -5562, 61, -1, -464, + -263, -688, -115, -15, -108, -569, -448, -48, + -180, -105, 14, -180, 490, 274, 625, -588, + -120, -196, -305, -126, 435, -2490, -2693, -3414, + 31, 97, -167, -114, 247, 7695, -189, -580, + 219, 241, 188, 327, 179, -193, 135, -176, + 127, 479, 529, 234, 112, 234, -358, -286, + 1109, 2940, -610, -13, -2650, 495, 1355, -574, + -43, -1497, -292, -503, 564, -363, 24, -313, + 1387, 221, -3612, 783, 637, 43, 1351, 217, + -21, 149, -3104, 190, -259, -201, -342, -201, + 166, 2411, -1082, 283, -382, -725, 157, 155, + -1609, -592, 527, -2959, 9, 216, 526, 79, + 54, -132, 202, 785, 929, 1755, -663, 366, + -3735, 3282, 305, 572, -36, -111, -231, 119, + 603, 1357, -153, 553, 363, -760, -1188, 890, + 147, -3844, -3788, 150, 257, -588, -234, 497, + 361, -543, 255, -175, -377, 49, -616, -200, + 4115, -541, 130, 678, -3458, -506, -218, -1317, + 889, 29, -104, -2, 532, -393, 513, -792, +}; + +static const int16_t cb0808sm1[] = { + 4123, -74, 639, 326, -110, 1896, 826, -855, + -299, -452, 536, -323, 262, 79, 486, 144, + 270, -64, 277, 154, 399, 50, -7270, -61, + 14, -8, 19, -104, 333, 119, 374, 389, + -196, 77, -322, 261, 75, 386, 162, 2360, + 644, -2785, 355, 277, -121, -148, 156, 2136, + 112, -453, 429, 171, 2405, -1245, -775, -181, + 2110, -583, 127, 889, -290, -550, -165, 1027, + 2155, -351, -936, 432, 2689, 217, -20, 646, + -785, 908, 654, 970, -294, -41, 466, -245, + 138, 50, -108, -366, 177, 481, -2118, 968, + -594, 3892, 528, 188, -613, 18, 283, 733, + -35, 1598, 387, 1, 156, -206, -437, 203, + -244, -347, 325, 296, 100, 1171, 49, 920, + -418, -54, -2756, 24, 123, 1018, 303, -501, + 901, -447, 322, -2361, 1039, -1067, 877, 1329, + -143, -2773, 269, 1560, 398, -3193, 102, 990, + 279, 379, -204, -144, -174, 139, 411, -234, + 21, -5064, -188, 365, 278, 353, -189, 94, + 593, -402, -353, -257, -788, 383, -1036, 569, + -72, -1764, 571, 1003, 629, 670, -1400, 0, + -435, 64, 189, 2874, 239, 1128, 992, 1213, + 69, -128, 207, 713, -2436, -931, -387, -111, + 1064, -170, -2853, -1072, -367, -1048, -238, -60, + -49, 340, 2382, 370, -245, 351, 248, -64, + 2331, 458, -484, -34, 281, 689, 483, 636, + 199, 3153, 607, -124, -3296, 953, -407, 49, + 455, 1083, 690, -169, -725, 311, -493, -1761, + -3054, 376, -544, 479, 91, 159, -2837, -1257, + -830, -948, -254, 289, -1039, 856, 86, 1123, + 203, -768, 1089, 73, -866, 308, 437, 674, + -2067, -240, -1079, 33, -1069, -3502, 756, -676, + 45, -2544, 378, -365, -275, -293, -394, -649, + -507, -2850, 672, 370, 186, -417, 682, 185, + -15, 2863, 21, -165, 356, -3776, -103, 535, + -416, -345, -31, 24, -90, -205, 96, -966, + 94, 424, -5, -188, 149, -2193, -183, 2342, + 425, -647, -1697, -627, -444, 1248, -967, -702, + -48, 3616, -3484, 774, -299, 94, 421, 472, + 71, -144, -523, 114, -172, 349, -285, -106, + 101, 59, 429, 512, 3362, -38, -62, 50, + -225, -1408, 780, -2747, -404, 489, -975, 840, + 357, 982, 488, -275, -109, 393, 375, 4794, + 183, -110, 922, -760, 61, -1067, -8, 322, + 74, -101, 554, -350, -486, 66, 384, 748, + 14, 223, -45, -386, 69, 6231, 247, 325, + -320, -47, -50, -165, 153, -380, 589, -3243, + -173, -140, 341, -747, -1559, 639, -1658, 356, + 110, -150, -273, 76, -632, -425, -227, 640, + 211, 192, -747, -165, 4608, 290, -160, 1268, + 2754, -3, 578, 189, -485, -2747, -123, -1309, + 662, 601, 43, -136, 84, 1625, -1113, 1400, + 75, -126, 3581, -243, 2339, -514, 2203, -400, + -483, 521, 30, -246, -76, 359, 101, 663, + -40, 57, 52, 360, -447, -290, 254, 104, + 102, 113, 215, -163, -388, 299, 4570, 31, + 108, -41, 41, -2633, 2891, 1188, -505, 1061, + -349, -604, -449, -374, -320, 969, -304, -192, + 246, -152, 441, -46, -1416, 137, 1987, 495, + -63, 1087, 875, 699, 201, 211, -3157, -273, + -60, 195, -2813, -239, 2486, -55, 294, 315, + -133, 448, -1849, 363, 1063, 76, -928, -574, + -72, -57, 168, 5673, -156, -116, 400, -124, + 82, 218, -487, 37, 112, 53, -544, 178, + 99, 480, -7179, -196, 271, -160, 308, -62, + 393, 394, -220, -740, -14, 92, 408, -364, + 299, -305, 76, -239, 26, -312, -234, 34, + -189, 871, -297, 364, 282, -321, -927, 4511, + 2, 6, 308, -82, 87, -128, 518, 82, + -4509, 1145, 960, -109, -186, 83, -144, 752, + 84, -2876, -162, 877, -249, 317, 510, 338, + 298, 744, 2892, -791, 363, 1088, 630, -2506, + -1, 3150, 219, 130, 119, 313, -822, -668, + 1201, -2948, -237, -106, -711, 405, 276, -255, + 0, 440, 161, 2587, -734, 3376, 276, 154, + 287, -200, 594, -29, 198, -237, -608, -445, + -286, 202, -783, 112, -3879, 78, 2809, -337, + -606, -684, -434, 559, 273, 201, 331, 903, + -53, 346, 700, 2599, 302, -590, -2551, -498, + -26, -667, 576, -546, 457, -289, -1408, -1021, + -63, 78, 153, -83, -696, -3105, 2498, -1502, + -1249, -238, 254, -287, 215, 313, 279, -517, + 67, -58, -148, -1111, 58, 5151, 346, 283, + -367, -900, 542, 209, -438, -128, -135, 54, + 7, 869, 291, -1073, 775, -61, -145, 457, + 562, 1332, -4589, 99, 1366, 184, 980, -920, + 80, -266, -152, -1877, -266, 364, -1432, 272, + 2275, 567, 60, 50, -2504, -386, -700, 373, + 6775, -15, -434, 347, 215, -369, -20, -281, + -243, -325, 227, -283, -665, -74, 336, -674, + -112, -369, -53, -396, 328, 3588, -541, -557, + -164, 1305, -817, -462, 1986, 1249, -574, 130, + 152, -2375, -425, 442, -3827, 322, -728, 563, + -179, 534, 620, -937, 590, -1, -59, 584, + 175, -193, -168, -5, -150, 156, -175, -178, + -245, -7481, -273, 212, -35, 318, -178, 446, + -55, -26, 42, -46, -265, 767, 330, 295, + 910, -54, 490, 2952, 598, -2578, -644, 403, + 149, -88, 549, -510, 596, -225, -2341, -286, + -2724, 5, -1960, -262, 922, 537, 646, -62, + -18, 8192, 484, 112, -222, -211, -224, 317, + 112, 82, -853, 1, 176, -475, -162, 200, + -193, 166, -228, -214, 72, 417, -27, -16, + 4, 395, -515, -6832, 28, -47, 626, -173, + 63, 90, 141, 217, 1037, 335, 4520, -896, + 111, 91, -656, -103, -729, -29, 653, -599, + -11, 2734, -378, -291, 60, 228, 47, -3670, + -192, 653, 733, -597, 898, -420, 1572, -133, + -154, 329, -259, -225, 218, -82, 117, 300, + -479, 277, 787, -1719, 136, -3603, 702, 1357, + 3340, 362, -438, 131, -1463, 367, -467, 1722, + -2186, 343, -379, 1221, -562, -260, 1157, 2692, + 37, -89, -322, -322, 8192, -284, 235, -528, + 113, -359, 44, 74, 119, -917, 403, 410, + -150, 157, 514, 168, 407, -246, -31, 510, + 105, 449, 4612, 635, -90, -1260, 774, -284, + -80, 456, 7, -3000, -324, -212, -104, -374, + -440, 1268, 2736, 53, -1178, -403, -438, -534, + 121, 261, -497, -73, 10, -262, 17, -1870, + 178, -1339, 224, 3115, -436, -448, 385, 894, + -1, 105, -18, 268, 342, 270, 891, 367, + 121, -325, -1610, -75, -3233, -189, -1050, 961, + -2833, -304, -51, 400, -284, -810, 824, -71, + -135, 194, 297, -297, 1129, 660, 518, 2426, + -225, 251, 4677, -176, -464, 296, -1208, -423, + -875, -581, -707, -1150, 499, -778, 28, 29, + 101, -4213, -127, -3681, 425, 481, -529, -679, + 11, 266, 127, -445, 527, -577, 310, 1465, +}; + +static const int16_t cb1110l0[] = { + -3748, -3820, -105, 16, -22, -7, 112, -14, + 52, 28, -42, -113, 132, -81, -8, -112, + 19, 33, -251, 117, -33, -9, -13, -28, + 60, -30, 29, 27, -58, -7, 4, 43, + -10108, -38, -3, 48, 3, -23, 202, -175, + -202, 71, -2143, 3, -82, -38, -113, 141, + 38, -66, -118, -38, -14, 148, -264, 143, + -13, -56, -9, -21, -28, 8930, -23, 53, + -40, 30, 72, -46, 26, 66, 22, 32, + 44, 22, -50, -66, -115, -141, 24, -3013, + -3460, 492, 207, -62, -567, 134, -26, -64, + 287, 343, -213, 42, -274, -144, -144, -77, + -26, -39, 4, -4, 42, 43, 30, -16, + 34, 113, 9291, -171, -17, 24, -53, -27, + 45, 42, 533, 146, -65, 32, 156, -144, + 2821, 889, -7, 614, 11, 1, -473, 434, + 659, -323, -2448, 23, -138, -582, 436, -152, + -30, 29, -290, -302, 3127, 496, 14, -346, + -70, 457, -1976, -229, 53, -2077, -313, 58, + 33, -91, -175, 141, 2728, 3232, -2150, 245, + -142, 13, -318, 70, -152, -64, 132, -322, + 44, 30, -70, -184, 433, -25, -97, -2035, + 145, 47, 640, 179, -441, 48, -108, 1742, + -280, 33, -3259, 79, -147, 324, -80, 65, + 48, 90, -7, -21, 22, 3, 56, -30, + 14, -2, -111, 22, -8, -8252, -103, -36, + 57, -203, 287, -2761, -220, 143, 11, -3597, + 21, -81, 62, -99, 41, -172, 108, 29, + 351, -370, 15, -122, -207, 275, -93, -2760, + 400, -212, 225, 230, -239, -3530, -73, 211, + 288, 85, -6, -634, 57, -78, 361, -149, + -1843, -23, 17, -37, -71, -174, -237, 42, + -22, -243, 63, -101, 131, 35, 136, -4025, + 41, -262, -57, 197, -290, 307, 35, -16, + 3, -5, 45, -7, 1, -47, 41, -19, + 79, 78, 42, -85, 74, -414, 1696, 703, + 297, -3296, 108, -546, 1129, 44, 447, -433, + 315, -1012, 133, 141, 1051, 601, -18, -532, + -30, 712, -127, -210, 10, 2442, -95, -46, + -14, 77, 32, -11, 10, -103, -15, 637, + -60, 352, 694, -202, 284, -5524, 92, -82, + 5, 140, -54, -115, 45, 287, -14, -307, + -342, 10, -181, 50, -30, -6, 10144, 77, + 42, 13, 26, -20, 34, 10, 37, -37, + -47, 90, -5, -44, -85, -64, -51, -1, + 16, -152, -91, 212, 4, -25, -237, -6124, + 22, -120, -1, 171, -17, -43, 141, -13, + -57, -185, 80, 273, -493, 178, 45, 11, + -57, 16, -23, -30, -37, 82, 4, -13, + -130, 98, 272, -450, -161, 133, 5104, 14, + 4576, -193, 11, 55, -30, 1, 123, -265, + -84, -340, -18, 152, -24, -266, 33, -90, + -108, -639, 1662, 299, -14, -389, 4679, -226, + 21, 311, -294, 159, -209, 172, 184, 292, + -373, 169, 84, 55, -269, 1453, -50, 41, + 68, -9, -62, 35, 23, -132, 96, 58, + -122, -3956, -318, 210, -117, 678, -104, 378, + -842, 61, 2549, 37, 149, -512, 70, -2971, + 225, -411, 230, -214, 697, -58, -871, -281, + -128, -204, -37, -128, 51, -174, -405, 497, + -4455, -219, 124, -120, 63, 135, 201, -122, + -435, -677, 221, 138, 486, 535, 3153, 165, + 11, -275, 94, -100, 69, 52, -67, -742, + 212, 16, -93, -428, 863, -17, -2465, 767, + -35, -130, 97, 1387, 34, 72, -23, -17, + 2845, -90, -71, 213, 291, 87, 826, -63, + 189, 641, -256, 832, 2087, -199, -170, -193, + -62, -7, 37, -60, -4277, -43, 24, -69, + 574, -163, -113, 263, -86, 45, 171, 1075, + -154, -39, 121, 74, -132, 182, 34, 13, + -278, -41, 96, 716, -221, -626, 1205, 244, + -351, 3914, -78, -32, 2833, -150, -37, 95, + -227, -84, -3432, 57, 238, -143, -365, 39, + 27, -238, -307, -170, 124, 66, -133, 40, + 62, -19, 42, -66, 2, -80, -2, 60, + 7, 10, 263, -4987, -69, -389, 62, -53, + -66, 24, -87, 13, 34, -15, -25, -20, + 197, 9, 101, -83, -79, -156, -100, 2, + -108, 5687, -157, 878, -1728, 32, 72, -66, + 70, -2, -46, -163, 206, 17, 247, 2974, + -66, 1354, 335, 238, -249, -410, -553, 354, + -41, 132, -96, 68, 2174, -329, -58, -76, + 6, 3089, 284, -274, -398, 471, 283, 427, + -220, 81, 2676, 40, -23, -46, 251, 109, + -3059, 50, -25, -551, 124, -389, 228, 95, + 56, -1320, -79, 1027, -4938, -105, -82, 13, + -159, 52, -101, 23, -220, -77, -153, 113, + -282, 42, 185, -144, -402, 46, -144, -99, + -2862, -3432, -2, 16, -32, 23, -25, -145, + 181, 49, 6, -236, -226, -28, 234, -26, + -89, -14, -355, 146, 117, -50, 76, -10, + 441, -95, -2, 346, -242, -3745, 884, -305, + -184, 350, 18, -293, -328, 257, 109, 49, + 157, -44, -70, 35, 6, 89, -4085, -167, + -263, -59, 35, -13, 430, -212, 17, -618, + -5, -8968, 114, 41, 73, -85, 122, 5, + 38, 19, -60, 14, -36, -42, -89, 20, + 85, -17, 20, 282, -3396, -25, 3722, 151, + -183, 100, -150, 19, -221, 126, 34, -21, + 72, 28, 138, -90, 30, 162, 46, 40, + 27, 15, -55, -21, 38, 55, 32, 83, + 9675, 31, 26, -2, 4, 96, -51, 120, + -132, 213, 2106, 39, -251, 98, -2572, -429, + -331, 1436, 2078, 335, -381, 371, 299, 339, + 300, -141, -99, -303, 2952, 49, 93, 40, + -3949, -45, 50, -215, 73, -39, -165, -283, + 46, -123, -347, 23, -158, 41, 20, 41, + -46, 19, 34, 86, -8770, 40, 20, -32, + -30, -16, 77, 72, -4, 92, -34, 103, + -77, 128, -532, -314, 24, 728, 49, -36, + -178, 76, 22, -14, -164, -194, 69, 3133, + 1007, -130, -280, 2502, 482, -2, 45, -62, + -7, -94, 17, 23, -4, 9516, -27, 11, + 22, 54, -13, 2, -2, 6, -22, -63, + 67, -686, 130, -2180, -124, 57, -61, -158, + 3364, 518, 4, 315, -367, -103, -295, 259, + -597, 56, -6, 72, -86, -45, -13, -47, + -13, -27, -3, 48, -12, -52, -6, -14, + -26, -16, -34, 9554, 80, 91, -270, 1, + -121, 117, 33, 8, 40, -99, -79, 43, + -3451, -92, -70, -57, 43, 68, 64, 284, + -639, 458, 118, -54, -2755, 370, -66, 54, + 27, -198, 331, 115, -40, -209, -312, 82, + -16, 8, 230, 212, 1853, -94, 1957, -118, + 153, -13, -73, 71, 116, -72, -3285, 106, + 19, -121, 177, -300, 455, -29, 94, 190, + -21, -8, 201, 16, 2, 83, -6280, 32, + -18, 59, -18, -41, -132, 22, 1, -39, + -212, -198, 186, 3154, -102, 3463, -280, -118, + -132, -132, 63, -19, 353, -24, -77, 224, + 82, 143, -65, 165, -16, -3774, 3543, -28, + -44, 93, -45, -13, -24, -5, -40, 58, + 3, 89, 71, 113, 46, 62, 44, 160, + -77, -8, -59, -6505, 134, -42, -73, 0, + 85, 2, 16, 34, 157, -34, -60, 78, + 24, 64, 96, 478, 231, -125, -217, 13, + 21, 44, 83, 198, -69, 21, -167, -52, + 4085, -234, -393, 17, -446, -354, -28, 42, + 53, -37, 28, 15, -16, -10, -85, 9471, + -16, -89, -87, -56, 52, -97, 86, -7, + -103, -12, 71, -39, 17, -40, 23, 63, + 65, -19, -14, -106, 29, 9707, -1, -12, + 1, -86, 100, 7, 1097, 266, 252, 197, + -64, -214, -197, -28, 3843, -1577, 310, -117, + 594, 13, 90, -309, -384, 134, -90, -194, + -316, 2884, 156, -185, 196, -103, 75, 1009, + 69, 768, -75, -605, -1488, 389, 242, 368, + 278, -122, -2500, 121, 7, -303, 91, -10, + 3642, 23, -109, -13, 138, -405, 18, -43, + 3, 42, 194, -112, 237, -2241, 23, 296, + -83, -14, -58, -163, -8, -174, -239, 85, + -108, -82, -79, 344, 236, -427, 127, 52, +}; + +static const int16_t cb1110l1[] = { + -64, 11, -74, -96, 39, 6072, 16, 46, + -215, 137, 77, 128, -195, -192, -87, 96, + 379, -73, 367, 437, -366, 84, -155, -29, + -69, -61, -34, -129, 260, -177, 3738, 739, + -221, -14, -40, 2, -483, -269, 2664, 166, + 29, -256, 30, 92, 51, 111, -45, 3893, + 90, -30, -99, 12, 74, 201, -52, -96, + -196, -85, -36, 123, -44, -68, 2, 8666, + 33, -41, 24, -12, -52, 69, 59, -27, + 38, -148, -55, -20, -60, 50, 3363, 30, + 3749, -92, 228, 173, -239, -167, -75, -79, + -86, -217, 32, 34, -137, -13, 17, -128, + -1462, -170, -224, -393, -3383, -1243, -47, 24, + -223, 26, 311, -343, -47, 784, 459, -548, + 558, 983, 103, 269, 32, 13, 19, -84, + -37, -29, -47, -6286, 7, 48, -100, 13, + 11, -271, -86, 115, -17, 183, 3247, -3336, + 57, -67, -117, -87, 19, 74, -271, 237, + -24, 242, 49, -179, 298, 85, -69, 328, + -238, -34, 103, -50, 79, 2, -27, -16, + -103, -61, 5868, -105, -262, 74, -74, -158, + 263, -110, 154, 212, -3, -84, -126, 25, + -67, -2501, -12, -35, 139, 259, -95, -141, + 137, 90, 12, -244, -142, 314, 15, -124, + 1, -25, -27, -2, -6, 28, -48, -17, + -2, 43, 67, 42, 9023, -25, 19, -13, + -23, -43, 73, -30, 143, -1, 2884, -142, + -4, 3549, -49, -366, 110, 314, 19, -55, + 363, 204, 469, 189, 217, -181, 119, 41, + -133, 29, -55, -94, 71, -49, 41, 85, + -14, 6140, 71, -142, 10, 18, 169, 136, + 282, -49, 36, 446, -99, 263, 92, 2201, + -127, 43, -143, -350, 36, 389, -208, 15, + -3610, -275, 383, 1599, -179, -177, -1100, -4, + 67, -38, 2, 278, 39, 107, -120, 465, + 204, -397, 305, 416, 7, -262, 68, 2341, + 189, -75, -23, 25, -20, -74, 56, -43, + -125, 170, 509, 63, 26, 263, -741, -31, + 8, -296, 101, 20, -149, 2846, -218, 379, + -310, 151, 901, 84, -85, -83, -387, 161, + -3102, -158, -438, 38, 191, -58, -202, 127, + 126, -88, -430, -3077, -1829, -332, 61, -152, + -14, -32, -156, -5, -375, -1083, -5130, 110, + 77, -201, -15, 4, 13, 86, 119, 67, + 149, 80, 264, -253, -121, 63, 193, -103, + -129, 63, 120, -226, -100, 3196, 72, -11, + 8, -56, 279, -73, -192, 47, -87, 125, + -43, -108, 277, 188, -107, 289, 5966, -20, + -303, -78, -21, 40, -139, 44, 28, 6, + -254, -244, 47, -1, -151, 29, -344, -2318, + 30, -3767, 114, 84, -155, 85, -90, 155, + 111, -506, 6, 453, -241, 215, 131, -802, + 15, -343, 176, -430, 251, -74, 6, -41, + -44, -131, -105, -248, 346, 39, -4524, 93, + -120, -79, -777, -416, -570, -221, 21, 28, + -52, 56, 71, -187, 2949, -2531, 666, 799, + -137, 970, 243, -695, -148, -281, 326, 450, + -734, -99, -2078, 112, -83, -90, -78, 262, + -138, -31, -5, -74, -171, -99, 344, 143, + 4035, 56, -121, -921, -8, 46, 4576, 97, + -219, -34, 123, -44, -1, 85, -36, 399, + -260, -231, 132, -318, 55, -181, 156, -3093, + 142, -9, -3418, -31, 43, 126, 136, 309, + -50, -20, 170, -90, 188, -173, 175, 50, + 144, -244, 22, 64, -476, -22, -66, 272, + 3839, 715, -188, -82, -250, -587, 10, 368, + -507, 242, -40, -531, 451, 35, 560, -107, + 138, 15, 113, 56, 242, 33, -23, -27, + 81, -157, 301, -327, 359, 3648, 62, -1489, + -167, 136, -39, 183, 53, -151, -16, -60, + -65, -5182, -17, -257, -10, 56, -104, 713, + -2, 328, 72, 353, 43, -51, -5949, 40, + 32, -82, -36, -22, 57, 56, 55, 112, + -104, 76, 5, 80, -29, 173, -360, -113, + 42, -119, 180, -26, 120, 250, -3024, 198, + 115, -140, 22, 136, 275, 698, -149, 699, + 426, -220, 279, 63, 55, -63, -108, -51, + -70, -70, 419, -156, 5870, 33, -57, -114, + -388, -213, -164, 1543, 117, 165, 1944, 223, + -83, 46, 201, 12, -103, 228, 139, -207, + 136, -1218, -544, -723, 90, -652, 793, -1, + -100, -32, -236, 49, 164, 138, 16, 82, + -3221, -62, -168, 62, -313, 98, -652, -484, + 684, -91, 33, -2926, -3453, 566, 34, 35, + 104, 13, 189, 235, -49, -324, 126, 226, + -102, 123, -253, -403, 38, 160, -5, 100, + -30, 16, -19, -44, 2, -70, -30, 82, + 118, 6, 132, -15, -36, 59, -8835, -448, + 3707, 324, 87, 67, -110, 114, -76, 294, + 354, 7, 140, 11, 340, -117, -559, 67, + 129, 201, -314, 328, -209, 102, -121, 378, + -5010, 140, 53, 15, -253, -14, 414, -183, + -70, -25, -51, 34, -347, -171, 146, -98, + -101, -3, -99, 96, 66, 50, -5, -115, + -23, -45, -351, -4202, 143, 480, -46, 140, + 17, -6312, -110, -23, 150, 60, -39, -9, + -48, -60, -8, -20, 37, 57, -162, 60, + -137, 55, -101, 65, 100, -8952, 3, -49, + -3, -9, 28, 15, -89, -136, 59, 125, + -73, -35, -111, -69, -28, 111, -16, 48, + 27, 9272, 55, 34, -92, 66, 3, 3, + -38, 12, 59, 95, -100, 3, 51, 121, + 146, -200, 142, -254, 65, 3, -169, -8, + -65, 44, 10, 15, -99, 56, -6, -108, + -20, -5461, -89, 395, 2085, 486, -48, 324, + 422, -3703, 468, 198, 239, 0, -277, -115, + -227, 227, -29, 159, -128, -447, -291, -1953, + -110, 25, 2274, 141, 177, 204, 38, -258, + 90, -8, -131, -2636, 55, 561, -99, -220, + -33, 142, -334, -160, -117, -12, -33, 6, + 72, -3, -11, 50, 1, -45, 8, 23, + -15, -33, -15, 30, -32, 107, 145, 14, + 60, 114, 45, 24, 8811, -9, 61, 192, + 16, 124, 46, -54, -31, 89, -147, -112, + 3341, -395, 91, -323, 45, -156, 25, -18, + 34, -534, 118, 83, -187, -92, 180, 34, + 659, 135, 103, -2342, 54, 6, 179, 40, + 143, 232, -3858, -201, 179, 32, -56, 406, + -236, 541, -70, -88, -121, 447, 3028, -223, + 138, -557, 230, 3457, 96, -4, -22, -13, + -136, -45, -123, -8, 107, 270, 132, -64, + -32, 464, -33, -44, -2544, -251, -246, -71, + -4063, 40, 107, 384, -22, -197, 64, 166, + -137, -44, 98, -35, 193, 4, -2103, 57, + -109, 245, 3487, -55, -60, 21, 187, -267, + 279, 3, 166, -78, 108, -135, 126, -122, + 171, -133, -21, -134, 183, 25, -56, -6210, + 107, 109, 22, -93, 39, 95, 43, -11, + -44, -5, -82, 6, -54, -27, -116, -16, + 84, 44, 22, -68, -1, -57, 78, 35, + 83, 4664, 46, 1, -164, 3301, -358, -3757, + 236, 104, -81, -121, -278, -112, -20, 89, + -123, 35, 113, 17, -331, 273, -172, 125, + -73, 77, 2515, -3944, -170, -87, 174, 84, + 142, 138, 13, 227, 127, 146, 141, 196, + 38, -40, -112, 136, 2311, 328, 87, -22, + -77, -34, -195, 58, -333, 337, -159, 626, + -3008, 408, 523, -316, 539, -587, -81, -2824, + 98, 200, 613, -107, -170, -1190, 1121, 521, + 229, -217, 143, 144, -1248, -384, 1535, 470, + -655, 492, -429, -26, -132, -180, 52, 97, + 10, -35, -60, 7, -5422, -26, 154, -132, + -221, 124, 136, -17, -68, 25, 29, 4, + 5, -15, 9, 69, -16, -47, -76, 5, + 41, 6, -22, 63, -8, 9709, -33, 650, + -545, -159, 81, -75, 54, -92, -49, -80, + 14, -78, -145, -399, -3935, 186, -1144, 207, + 60, 286, 2642, 44, 117, 3758, -154, 426, + 331, -615, -216, 271, -121, -109, 495, 42, + 813, -19, 545, -149, 633, -2424, -2089, 265, + -136, -58, 4, -28, 147, 2, -123, -93, + 14, -50, 317, 131, -130, -152, 322, 1023, +}; + +static const int16_t cb1110s0[] = { + -6433, 495, -277, -630, 411, 1241, -326, -425, + 523, 114, -225, -53, -538, -702, -260, -417, + -401, -222, -263, -416, 163, -1256, 590, -1176, + 1865, 1483, -927, -65, -674, 1303, -147, -750, + -132, 407, -283, 852, 1788, -2257, 210, -450, + 303, -272, -2536, 94, 2010, 428, -921, -3, + -71, -875, 156, -681, 521, 49, 51, -523, + 1532, 1619, -690, 402, -923, 318, 865, 193, + -2187, -662, 553, -1104, -70, -1313, 462, -1045, + 320, 937, -1453, -514, 404, -231, -1748, -1592, + -2039, -217, -364, -1313, -428, 2419, 1257, -1292, + 19, 2867, -278, -1832, -239, -691, -383, 62, + 185, -455, -1589, 116, 419, -319, -418, 537, + -280, -1834, 2681, -857, -210, -156, -1143, -104, + -1774, 1702, 184, 1017, -135, -610, 525, 335, + -355, -494, -231, -154, 986, 434, 1134, 1213, + 914, 1457, -258, -1086, 477, -2247, 498, -1741, + -975, -262, 812, 108, 834, -412, 120, -1032, + -533, -456, 139, -301, -387, -690, 798, 3, + -1556, 1261, 745, -4486, 8, 213, 977, -151, + -269, -344, 13, 544, -270, -166, -706, 672, + 184, -943, -1714, 1510, -739, 1891, -477, 528, + 1847, -1572, 420, 103, -85, 508, 231, 2024, + -1343, 20, 238, -655, 668, -1561, -743, -651, + 709, -1136, -208, 979, 258, -693, -535, -1126, + -283, -944, -209, 603, -1797, -2998, 253, -296, + 842, 63, -203, -468, 675, 337, 1458, 114, + 259, 3202, 145, 419, 631, 352, 2309, 1337, + 815, -99, -824, -779, -1839, -1455, 166, -2092, + 1299, 162, -1026, -914, 128, 1321, 896, -209, + 255, -1144, 807, -2870, -632, -588, 866, 81, + 453, 154, -1258, -499, -452, -98, 2599, 3070, + 540, -834, -228, -1268, -313, 1269, -65, -56, + 1035, -499, -507, -657, 447, 26, 96, -175, + 133, -291, -538, -259, 7, -206, 411, 145, + 25, 215, 267, -4354, -442, 250, -814, -143, + -459, -182, -640, -1258, 169, 379, -1196, 429, + -128, -1971, 2681, -45, 1641, 152, -556, 909, + 365, -618, -417, -363, -434, 270, -1388, -473, + 62, 58, 509, -3909, 1327, 1571, 482, 1081, + -896, 459, 480, -557, -267, 390, -15, 484, + 248, 52, 49, 702, -10, 162, 245, -416, + 1397, 23, 183, 325, 591, -816, 4429, 674, + -332, -1243, 68, 285, 235, 759, -315, 799, + 313, -331, -182, -629, 394, -1079, 3879, -81, + 651, -774, -21, -297, 231, -1826, 47, 104, + 284, -171, -198, -110, -193, 881, -715, 294, + -490, 395, -1261, 2859, -3175, -1477, 668, -215, + 310, 10, 762, -837, 101, 142, 201, -940, + 453, -82, 493, -983, 23, -211, 990, 1327, + 4664, -27, 821, 809, 500, 243, 41, 568, + 44, -320, 105, 461, 306, -408, -793, -35, + -18, 229, -12, -416, 577, -301, 4870, -520, + 499, 57, -544, -21, 611, 226, -20, -412, + 440, -680, 448, 430, 226, -610, -310, -218, + 1161, 523, -400, -148, 783, 395, -126, 370, + 686, -497, -301, 161, -5, 238, 375, 357, + -126, 954, 5952, -53, 121, -405, 1571, 435, + 461, -1166, -1163, 1347, 1394, 170, 2035, -1580, + -958, 276, -680, -968, 275, -323, 524, 48, + -1896, 46, -495, 548, -929, -859, 224, 1079, + 863, 3080, -1594, -379, 302, -403, 710, 655, + -293, -719, -683, -944, 228, -341, 563, -495, + 920, 738, -614, 552, -249, -402, -164, -262, + -425, -4025, 164, -984, -518, 157, -1156, -729, + 1024, -768, 1003, 481, -116, 319, -918, 1563, + -662, 4852, 617, -250, 549, -265, -93, 680, + 470, 925, -293, 629, 142, 231, 44, 133, + 12, 40, -867, 269, -77, 445, -1132, -985, + -1304, 728, 424, 530, -258, -625, 377, -1400, + -2538, -470, -1711, 413, -1603, -81, -393, -1013, + 1130, 906, 287, 640, 3785, -463, -159, 43, + -165, -441, -513, -287, -554, 1547, 848, -275, + 936, 653, 769, -58, -1007, -698, -792, 2175, + 398, 1382, -122, 459, -7, 281, 2785, -637, + 632, -279, 293, -1078, -996, 96, -293, -1335, + -74, -587, -286, -565, -977, -228, 5080, 3, + 171, 111, -34, -177, -619, 577, 448, -280, + 189, 1033, -579, 134, -713, -947, -249, -1897, + 364, 1748, -2098, 21, 859, -73, -1881, 116, + 36, 1591, 1386, -1128, -346, -1015, -25, -90, + -691, -984, -120, 29, -635, -236, 26, -691, + -742, -203, 294, -472, -901, 2582, -171, -357, + 406, 162, 1561, -913, 308, -3319, 461, 779, + -305, -927, 290, -941, 615, -688, -508, 222, + -432, 387, 170, -115, -5338, 508, -212, 150, + 26, -38, 306, -15, 50, 2008, -1112, -187, + 44, 591, -280, 1187, 934, -228, 554, 65, + -1387, -1999, -805, 2555, -1225, -283, -435, -430, + -50, -655, -103, 248, -234, 32, -826, -708, + -704, -1006, 176, 784, 274, 626, -2353, 707, + 1852, -132, -196, -169, -463, -2117, 56, 413, + -141, -818, -365, 921, -816, -126, -135, 438, + -948, -145, -349, 700, 205, 1001, -3626, 314, + -493, -1182, 131, 733, 2404, -1244, 564, -960, + 328, -1137, -108, -755, -168, -995, 966, -1706, + -565, 806, -693, 1369, -269, -428, 675, 768, + 341, -794, 2265, -208, -1883, -801, -1889, 961, + 182, -504, -595, 871, -1280, 952, 1351, 665, + 474, 1032, 58, 451, -198, 345, 176, -853, + -2891, 2250, 624, -616, 183, 144, 736, 0, + -198, -138, -1218, -501, -658, -24, 1232, -286, + -233, -937, 2150, -1035, 449, -623, -2748, -2176, + 918, -170, 421, 1376, 93, 153, 627, 493, + 28, 549, -292, -175, 1066, 1037, -475, 413, + -2006, -2022, -334, 365, 901, 945, -663, 515, + -351, -597, 155, 1318, -153, 417, -425, 44, + 338, -1958, -355, -596, -2134, 360, 341, 2501, + 824, -2106, -282, -1723, -735, -550, -743, 113, + 1027, -479, -2114, -16, -631, -282, -1054, 1320, + -158, -234, 3479, 28, 1818, 627, 1464, -795, + -22, 897, -6, 392, -234, -170, 714, -382, + 1262, 67, -618, 145, 25, -710, -247, -545, + -1386, -1797, -995, 865, 465, -364, 830, -53, + -1108, -383, -538, 85, 731, -188, -813, 2, + -1667, 3379, 289, 425, 1319, -259, -592, -212, + 271, -268, -126, 1282, 306, 3859, -1423, 607, + 20, 755, 174, -782, 72, -234, 675, -1177, + 1101, -635, -1641, 2574, -978, -1390, -1743, 2183, + 53, 75, 650, -97, -456, -126, -719, -675, + 557, -375, 643, 853, -81, -192, -1174, -1288, + -954, -883, -806, -2182, -2111, -1426, 180, -266, + -301, 626, -443, 61, -149, -443, -935, -48, + 642, 250, 17, 596, 1342, -2127, 323, -1456, + 1995, 837, -1456, -1683, 945, -722, -1445, 452, + 178, -441, -250, -137, -128, -50, -311, -600, + 2237, 922, 139, -107, -637, 1770, -2503, 413, + -803, 496, 209, -391, 401, 412, -552, 605, + -37, -667, -1609, -19, -1073, 1522, -705, 670, + -992, 882, -1213, -854, 2150, -371, 73, -1167, + -592, -153, -509, -584, -495, -83, 2075, -1489, + 719, 1245, -1138, 72, 950, -950, 542, -590, + 988, 1646, -64, 562, -223, 73, 583, -151, + 215, 914, 1391, -2997, 161, 436, 49, 2225, + 271, -283, 3844, -578, 335, -90, -698, -162, + 1236, -117, 470, 383, -718, 520, 295, 29, + 292, -179, 774, 204, 372, -251, -824, -487, + -1822, -312, -731, 568, -1008, -255, 189, -1195, + 657, -227, 3422, 651, -220, -1204, -590, 713, + 365, -977, 204, 3118, 321, 922, -347, 1505, + 375, -77, -1520, -1411, -680, -507, 543, -492, + -1844, 135, 689, 384, -408, 140, 633, -1192, + 475, 220, -1711, -1318, 606, -103, -712, -1734, + -218, -855, -835, -3071, -109, 1391, 62, 21, + -75, -77, 369, 216, -1484, 2057, 661, 314, + 275, 1048, 175, 1842, 743, 808, -594, 338, + -1217, 1606, -531, -1360, -1073, 452, -531, -798, + -771, -1292, -918, 606, -1776, -509, 178, 1422, + 3424, 634, 722, -257, 525, 437, -197, -130, + 291, -411, -259, -890, -84, 368, 1117, -1321, + -324, -2122, 515, 1158, 1749, -963, 681, 39, + 268, 549, 324, -601, 151, -200, 829, 3881, + 797, 660, -572, -693, 633, 1023, -147, -581, + 102, -207, -163, -511, -30, -102, 379, 776, + 494, -510, 55, -1811, 1073, 4384, -318, 3277, + 1958, -209, -539, 1823, 1200, -182, -186, 213, + 123, 506, -471, -431, -698, -331, -1168, 88, + 276, -184, 733, -295, -1053, -717, 862, -1453, + -4235, 1063, 1049, -621, -429, 372, 1043, 599, + 271, -693, -689, 122, 466, -323, 332, -533, + 645, 516, -371, -207, -2046, 72, -1125, -229, + -2769, -330, 1387, -89, 342, 2786, -730, 152, + 629, 809, -459, -248, -266, 111, 380, 724, + -411, 640, -72, 323, 34, -277, 443, 289, + 151, -4816, 402, -171, -731, 635, -84, -133, + -310, 397, 904, 1193, -1512, -25, -1306, 587, + 322, -3762, 537, -306, -981, 917, 190, 787, + -613, 149, 301, -376, 366, 350, 18, 893, +}; + +static const int16_t cb1110s1[] = { + -332, 1306, 1626, 1555, -3510, -225, 418, 1520, + -969, -74, -286, 233, -313, -97, 375, 181, + -309, 1348, 969, -504, -141, 789, -1224, -137, + -704, 98, 1003, 466, 2259, 1485, -225, 61, + 272, -223, -347, -23, -368, 96, 2345, 112, + 363, -552, -6, -806, -1637, -1703, 1597, -2114, + -196, 293, -1173, -630, -863, -1224, 784, -722, + 744, 885, 798, -384, 92, 298, -873, 1808, + 1389, 488, -1569, -1541, -3064, -734, 3, 467, + -987, 346, 1915, -683, 205, -487, 341, -330, + 274, -25, 49, -83, 1246, -405, -777, 266, + 121, -250, 466, -1232, -3197, -871, -638, -332, + 1563, 1900, -470, 556, -465, -412, 901, -86, + -683, -577, -1033, 808, -863, 1212, -724, 2222, + 429, 2733, 413, 891, 1669, 515, -439, 187, + -359, 414, 176, -706, 679, -63, 1247, -1721, + 779, -2770, -484, -633, -993, -243, 1442, -312, + -324, -370, 392, -407, 229, 97, 1267, -18, + 46, -303, -684, 515, -166, 4212, -775, -23, + -53, 23, 1966, -465, 231, 1195, 252, -1036, + 16, -824, -116, -582, -286, 470, -159, 217, + -456, 549, 648, 60, -1119, 221, -747, 354, + -628, -486, 894, 1280, -2631, 247, 430, -1703, + 69, -236, 147, 1445, 540, -936, 181, -163, + 931, -1044, 669, 2457, 519, 597, -2031, 11, + -1319, -4, -1190, 85, 254, -1494, 230, 1583, + -547, 277, -2006, -103, 1195, -2522, 1301, -633, + -104, -511, 573, 1628, -451, -1022, 564, -692, + 255, 1029, -408, 757, 172, -395, -472, -1703, + -1856, -379, 289, 509, -628, -1349, -207, 404, + -399, 1671, 392, -935, -190, 952, -1267, 1150, + 1562, -609, 491, -346, -270, -483, 310, 1420, + -1017, 1714, -645, 897, -1327, 3154, -1046, -857, + -499, -496, -1348, 399, 63, -653, -315, 820, + 1645, 614, 2202, 779, 3001, 1382, 387, -843, + -1840, 422, -1017, 246, -219, -550, 105, -608, + 426, -346, -224, 375, 22, -448, -270, -1150, + -897, 4298, -882, 49, 633, -937, -694, 675, + -322, -793, -516, -360, -248, 1190, 575, -843, + -13, 50, -801, 1181, 452, -335, -495, -102, + -1057, 506, -206, 66, -647, 991, 259, 259, + -468, 197, 373, -4216, -750, 224, -182, 520, + -530, 1888, -2018, -1492, 656, -1447, 993, -790, + -785, 792, 1658, 373, 131, -460, -703, 1080, + -875, -212, -694, 747, -639, -2267, 1263, -415, + -749, -1278, 591, -745, -225, -1677, 69, 625, + -146, 212, 345, 728, -553, 1117, 471, 550, + -498, -729, -2070, 1006, -330, 939, 3636, 34, + 349, 761, -131, 372, 610, -399, 10, 86, + 110, 931, -1159, -175, 633, 568, 140, 712, + 2800, -1558, 2343, 3, -974, -673, 233, 1436, + -783, 599, -442, 852, 639, 447, -976, -564, + 1511, 36, 529, 433, 677, 1971, 2777, -820, + -655, -1463, -1392, -1142, -352, 432, 730, 439, + -273, 844, 108, 115, 408, -361, 504, 337, + 58, 1074, -1645, -1623, -493, -70, -1585, 2878, + -741, 636, -224, -974, 722, -147, 149, 135, + -107, -154, -1027, -18, -989, 282, 3173, 1123, + -778, 1389, -591, 337, 1660, -288, 1162, -65, + 660, 326, 141, 358, 679, -222, 460, 105, + 512, 36, -854, -477, -942, -2362, 265, 2252, + -164, -2059, 106, 666, -420, 521, -178, 396, + -1836, 475, 82, 356, 207, 433, -1005, 97, + 385, -304, -853, 1282, -239, -2134, 83, 84, + 201, -1894, -1603, 683, -1957, -113, 839, 1187, + -313, 774, -754, 941, -739, 748, 116, 716, + 1134, -530, -2178, 71, -611, 1544, 3527, -3, + 283, 527, 457, 399, 762, 17, -279, 196, + -518, -160, -1204, -289, -1354, 132, -315, -290, + -2179, 676, -1474, -1010, -1397, 363, -45, 783, + 1326, -33, -109, -617, -271, -967, -103, 1867, + 769, 740, -818, 1011, 1411, -693, -2458, 808, + 806, -213, 468, 31, -70, 166, 230, -405, + 163, 70, 652, 1077, -190, -622, 2343, -1328, + 601, 928, -1661, 174, 429, -2479, 501, 503, + -41, 1365, 671, 1006, -1968, 7, 103, -399, + -382, 573, -27, 554, -2263, -3174, 277, 177, + 807, -328, -816, 453, -1548, 828, -327, 187, + -393, -745, -76, -808, 575, -8, -326, -2062, + 601, 566, 755, 775, 595, 419, -3925, -226, + 272, 368, 395, 59, 1117, 548, -649, -429, + 321, 549, -744, 319, 82, 135, 73, 14, + 374, 93, -270, -453, 177, 4991, 569, 169, + 111, -246, -362, -88, -49, 583, -35, 60, + -759, 1327, 1768, 766, -350, -880, -106, -449, + -113, -683, -418, -999, 992, 559, -290, -147, + -324, 93, -947, -3932, -37, 307, 1087, -314, + -293, 432, 830, -130, -208, 59, 719, -348, + 4511, 224, 488, -174, 588, 795, -301, -246, + -447, 682, 917, -1207, -503, -450, 575, -116, + -126, 594, -22, -101, 5, -1188, -431, 1146, + -3869, -72, 402, -417, -390, 350, 1141, -138, + 697, 77, -3255, -268, -786, -106, -1386, 400, + -856, -691, -438, -1550, -228, 2162, 236, 64, + -382, 1, 1032, 153, -659, 1563, -410, 1280, + 1573, -3675, -1041, 240, 401, 215, -353, -1140, + 265, -103, -824, -93, -319, -849, 253, -477, + -463, 153, -1017, 538, 1233, -1041, 11, 998, + -437, -569, -970, 2118, -1577, 1, 321, 1784, + -298, 2315, 72, -20, 83, 905, -1289, -246, + 731, 4076, -1477, 602, -911, 978, 698, -239, + 391, -729, -276, 225, 143, -417, -500, -27, + -1220, 89, -403, -1453, -2546, 1015, 70, 78, + 2364, -159, -775, 29, 37, -231, 73, 433, + 426, -529, 420, -613, -100, -605, 1463, 1001, + 1159, -4082, -553, 348, -806, 624, -162, -1121, + -25, 919, -62, 90, -275, 233, 203, 32, + 745, -221, 458, 529, 901, 1088, 38, 1209, + 450, 451, 2250, -411, -205, 761, 249, -1226, + -266, -3195, -801, -31, 1015, -324, -596, -42, + 150, 207, 2597, 1041, -1045, -2254, -1428, 250, + 217, 69, -933, 1424, 280, 446, 524, 540, + 639, -1027, 23, 412, 36, -67, 475, -1126, + -739, 1160, 514, -157, -2832, -1432, 559, 77, + 740, -888, 134, 1304, -267, -267, 329, 8, + 1721, 1488, -29, -1760, -1904, -2634, -1342, -528, + 2233, -219, -194, -2919, 128, 1203, -623, -127, + 488, -386, -133, -329, 62, 85, 1271, -185, + -479, -588, -2964, 546, 1651, 1526, -830, 1046, + 347, 63, -1048, 239, 1402, -22, 307, -1606, + 768, 999, 304, -512, -175, -246, -373, 529, + 93, -521, 1310, -508, -4366, 27, -768, -358, + -575, -2, -593, -21, -838, 635, 197, 634, + 321, -263, -377, -549, 20, 739, 395, -9, + -392, 70, 5679, -133, -130, -240, -678, 421, + -101, 412, 143, 209, 194, 216, 200, -22, + -748, -399, 2863, 284, 231, 691, 571, -3460, + -200, 312, 480, -1338, -603, 435, -308, -615, + 520, 178, 68, -716, 45, -593, -32, -1393, + -554, -1000, -867, 613, 288, 507, 202, -113, + 17, 93, -141, -47, 665, 559, -808, -4091, + -575, -193, -873, -790, 673, -608, -941, 745, + 1562, -1060, 988, 1192, 29, -1207, 207, 653, + -622, -132, 370, 1435, 1977, -1878, -119, 101, + -100, -154, -869, -2375, 1254, 122, 188, 877, + 188, -838, -355, 667, 3813, 1076, 369, -771, + -712, -669, -14, 107, 1027, 112, 2306, 1418, + 133, 1055, 377, 249, 1023, -927, 12, -1983, + 1174, 223, 385, 827, 1425, -1694, -1178, -94, + -593, -286, 1263, -671, -425, 2002, 701, 1546, + 547, 182, 1013, 128, 351, -243, 407, 2349, + -376, 445, -93, 968, -337, -601, 1342, 987, + -1499, -644, 521, 327, -557, 1800, 12, 285, + 127, -269, -1989, -449, 87, -1042, 184, -499, + 1231, -1664, -352, 4, 1253, 403, -1064, 837, + -1702, 133, 1687, -1300, 2248, 179, -847, -617, + 460, 450, -260, 94, -780, -675, 1209, 38, + 453, 857, -631, 317, 535, 1086, -196, 638, + -288, -389, 688, -93, 1271, -4290, -96, 445, + 64, -211, 148, -74, 486, -1873, 1214, 1836, + -708, 1800, 1644, 576, -1088, -1212, 1147, -456, + 173, -911, 489, -443, 644, 534, 846, -1522, + -786, 497, -401, -1087, 1410, 1391, 837, -253, + 124, -598, -254, -3945, -1169, 103, -193, 50, + 846, -1014, 353, 455, 784, 1343, 3055, 178, + -628, -148, -266, -324, -96, -190, -930, 115, + 475, -651, -314, -82, -236, -88, -3753, -1048, + -283, -178, 351, -671, 325, 1054, 28, 540, + 113, -73, 763, 844, 543, -6, 799, 245, + 176, 124, 262, -112, 1010, 361, -843, 3290, + -3741, 914, -1835, -259, 2467, 297, -1205, 168, + -1917, 156, 87, 637, -677, -955, 312, 1246, + -219, 92, 1090, -292, -773, 343, -523, 299, + -513, 1321, -536, 586, -1324, 2345, 2384, -719, + -936, 1389, -27, 880, 338, -127, -666, -441, + 1603, 143, -218, 2167, -1335, 469, -1224, 2489, + 1365, 568, 19, -1322, -736, 208, -494, -454, + 990, -250, 305, -575, 206, -168, -1177, 282, +}; + +static const int16_t cb1110m0[] = { + 429, -104, -210, 216, 361, -2586, 253, -1350, + 145, 2795, -5, 663, -262, 37, -122, 205, + 270, 321, 2623, 256, 4, -42, -37, 112, + -346, 20, -51, 9, -90, -3342, 78, 52, + -239, -454, -207, 355, -136, -19, 394, -212, + -166, -73, -68, 1049, -2945, 385, -545, -211, + 116, -15, 687, -232, 1824, -66, 133, -403, + -63, 3, 46, -104, -101, 136, -61, 420, + 149, -24, -9, 4277, -149, -166, 96, -35, + 1786, -1044, 115, -1326, 3381, -520, 70, -134, + -433, -198, 146, -615, -143, 201, 342, 412, + -162, 22, 111, 16, -85, 14, -120, 79, + -30, -84, 56, -34, -52, -147, 19, 155, + 17, -120, 5853, 96, 767, 262, -194, 124, + -180, 13, 3081, 39, 402, 90, 292, 84, + 1999, -16, 866, 292, 416, -314, 177, -1, + 68, 3, -28, -56, -54, 10, -5, -63, + 89, -69, -251, 70, 7523, -83, 67, 62, + 178, -1723, -76, 101, 369, -139, 58, 135, + -32, 138, 3393, -575, 586, 292, -296, -505, + -634, 52, 280, 78, 14, 117, -39, 77, + 231, 136, 14, 51, 173, -96, 5, 378, + -52, -4340, -263, 61, 22, -2896, -20, 180, + 21, 3636, -138, 104, -279, 56, -407, -8, + -123, 134, -95, -500, 266, -64, -43, 1, + -170, 31, 110, 53, 56, -5938, 151, 49, + -76, -166, 34, -8, 193, 198, -118, -4, + -44, 249, -28, -102, -3614, 49, 464, -388, + -744, -500, 603, -88, -19, 1606, 325, -227, + -277, -142, 232, -1835, 150, -89, 29, 9, + 76, 425, -320, 179, 231, 1720, 424, -2730, + -298, 666, 72, -428, -1243, -299, 93, -12, + -20, -96, -123, 18, 188, -1, -235, -2, + 3328, 107, -1489, 199, 893, -63, 46, 3799, + 22, -118, -127, 283, 254, -2091, 293, 331, + 857, -92, 46, 13, -457, 169, 851, -19, + -231, -8735, -62, 69, -190, -103, -31, 108, + 66, 95, 53, -6, 12, 19, -73, 105, + -40, -29, 60, -263, -107, 2233, -246, 485, + 342, 1732, 76, 2489, 40, 44, -300, 280, + -109, -107, -990, -45, 1014, -5073, 1, -169, + 25, -55, -340, -427, 603, 206, 151, 360, + 312, -44, -106, 514, 683, 98, 3331, 19, + -106, 106, -3383, 85, -161, -88, 8, 12, + -163, 183, -393, 117, -243, -498, -60, 292, + -322, -2105, 920, 301, 41, -19, -142, -2485, + 631, -289, -849, 132, 800, -255, -390, 137, + -850, -411, 41, -93, -8653, 9, -25, 134, + -66, 222, 152, 59, 29, -193, -129, -105, + 39, -21, 188, 111, 25, -3, 0, -79, + 8907, -24, -18, 37, -33, -42, 87, -44, + 56, -79, -67, -52, 18, -132, 1925, 309, + 145, -443, 1279, 200, 1215, 281, 3343, 311, + 390, -154, -119, -523, 19, -529, 190, 272, + 541, -393, 278, 161, 13, 161, 891, -65, + -199, -1376, -350, -1409, 340, 2115, -209, 2459, + 30, -509, 141, 11, -557, -1560, -1912, -234, + 76, 787, 2781, 45, -158, 330, -623, 655, + -845, -463, -119, -252, -299, -1940, 145, 17, + -183, -71, 98, 67, 145, -134, -88, -5, + -3636, 3, 34, 231, 981, 33, -953, -403, + 129, 215, -11, 109, -188, 51, 5176, -89, + -113, 60, -138, -94, 142, 216, 322, -33, + 350, -285, 182, 92, -16, 12, 15, 126, + -27, 5, -5220, -154, 13, 109, 18, -326, + -257, 118, 313, 342, 2289, -35, -22, 115, + -256, -2908, 68, 1211, 203, -735, -380, -134, + 249, 522, 109, -48, -5114, 32, -42, 85, + -99, 265, -187, -93, 373, 341, -254, 16, + -121, -92, -260, -80, -2, -322, 234, -96, + -2834, 230, 146, -264, -3287, -153, 41, -349, + -149, -98, 140, -115, 628, -11, 292, 4, + -166, 82, -4548, 116, -23, -311, 612, -334, + 451, 259, 559, 320, -267, 517, -139, -166, + 126, 27, -89, -156, 14, 63, -3, 31, + 109, -43, 10, -7682, 36, -23, 73, 129, + 0, -116, 66, 5, 137, -17, 2523, 203, + 431, -2729, 175, 540, 454, -175, -297, -60, + 348, 53, 688, -49, 133, -72, 200, -348, + 136, -142, -2259, -3047, -60, -737, 48, -331, + 85, -134, 218, -962, -278, -148, -1077, -131, + 53, -127, -2265, 82, -31, -262, 226, -385, + 83, 756, -2715, -492, -115, 663, -312, 240, + -318, -819, 3040, -181, 148, 165, 376, 92, + -233, 188, -100, 902, -401, 1005, -52, 162, + 219, 1831, -68, -66, -10023, -90, -23, 39, + -91, -231, 23, 174, 42, 79, -57, -58, + 18, 175, 32, 122, -185, 266, 162, 300, + -3158, -3381, -3, -312, 178, -24, -234, 248, + 68, 293, 360, -146, -30, -2, 177, 113, + -1215, -538, -274, 79, -2, -17, 2791, 71, + -1300, 93, -818, -558, -331, 115, 215, -603, + -202, 113, -87, 39, -277, 3564, 75, -444, + 201, 111, -369, -1072, 212, -276, -322, -484, + -700, 37, -302, 177, 86, 10, -87, 56, + 76, -8941, -27, -73, -133, -51, -106, -28, + -52, 49, 68, 26, 16, -81, -423, 2834, + 7, -54, -107, 144, -3812, 17, -355, 3, + -32, -24, 14, 76, 169, -260, 349, -159, + 3691, -184, 4345, -46, 146, -14, 143, -384, + -75, 12, 144, 105, 47, 141, -32, -31, + 48, 187, 74, 139, 132, 86, -15, -317, + -267, 3112, 1821, -363, -125, -1152, -294, -449, + 277, 1151, -341, 12, -41, 210, -51, 6, + 18, 53, 11, 37, -36, -70, 65, 44, + -7302, 15, -133, 56, 150, 63, 515, 271, + -32, 47, 41, -130, 168, -158, -239, -60, + 226, 247, -593, -237, -3559, 65, 623, 16, + -212, 26, -181, 81, 83, 26, -25, -92, + -5, 36, -31, 277, -263, 135, 78, -173, + 220, -5260, 2239, -96, -19, -95, 75, -25, + -64, 244, -154, -2646, -446, 980, 512, 392, + -402, -1050, 276, -456, -1334, 1863, 636, -1512, + 234, 199, 237, 363, 66, 284, 198, -277, + -267, -540, -329, 856, -482, -645, 178, -240, + -178, 6633, -5, 127, -80, -167, 307, 7, + 248, 13, 53, 124, 215, -310, 255, -194, + -3066, -22, 3524, 51, 193, 165, 82, -80, + 54, -191, -278, -19, 379, 285, -58, -157, + -168, -183, 388, -198, 191, 107, 10, -2, + -6148, 45, -58, 48, -150, -72, 112, -124, + -41, -129, 36, -66, -3311, -4092, 15, -11, + 93, -54, 72, -105, 131, 66, 29, -54, + 201, -210, 221, 47, 55, -99, 31, -3626, + -3623, -175, 91, -53, 40, -98, -76, 224, + 15, 172, 85, 103, -147, -135, -214, -313, + 1304, 143, 190, 19, -2526, -91, -168, 875, + -27, 789, 791, -462, 912, -580, 70, 1523, + 787, -150, 567, 2717, -5, 2943, -107, 155, + 32, 65, 158, 133, -191, -44, 141, -149, + 199, 177, 270, -14, -57, -3669, 3891, -158, + 239, -17, 52, 244, -343, -118, 186, -54, + -134, 106, -133, -116, 186, -149, -894, -22, + -399, 1, 288, -3988, -260, 113, 66, -276, + 179, -226, 119, 420, 51, -483, 551, 129, + 245, 2013, 639, -87, 5058, 41, -53, -116, + -130, -223, -104, -760, 276, 117, 338, -137, + -233, -65, 119, 100, -3245, 2, 3877, 126, + 172, -2, -72, -153, 200, -109, -62, 135, + 194, -82, -150, 98, 550, -251, -274, 71, + 160, 121, -13, -365, 356, -212, -271, 5067, + -203, -251, 222, 75, -131, 17, 103, -911, + -348, -26, 6, 110, 120, -645, 355, -649, + -132, -3416, 65, -1478, 461, -109, 258, -15, +}; + +static const int16_t cb1110m1[] = { + -110, 2743, -31, 86, -11, 3705, 192, -89, + 57, -252, -11, -212, 163, 0, -137, 405, + -99, -124, -137, -407, 125, 106, -922, 1567, + 85, 165, 241, 110, 2918, 598, -443, 812, + 159, 518, 555, -1886, -65, -52, -3, -27, + 56, -30, -126, 126, 23, 74, 157, 6990, + -34, 56, -257, -172, 115, -23, -616, -243, + -441, 34, 159, 6, 78, -119, 49, 34, + -133, 988, -1007, 474, 77, -274, 354, 4907, + 222, -16, 69, -4, 924, -18, 3535, -299, + -38, -83, -111, 977, -138, -1075, -444, 540, + 199, 202, -502, -194, -198, 249, 101, 276, + -89, 96, -301, 6, -4023, -70, 174, 93, + 192, -120, 755, -560, -22, 78, 56, 29, + 28, -44, 65, -4, 0, 49, -250, 87, + 46, 44, -41, -7035, 14, 288, 632, -259, + -64, 20, -178, -343, -274, 106, 2842, 336, + -283, 245, -612, -5, 500, 77, 2492, -250, + 64, 171, -988, 4, -51, -34, -555, -171, + -2629, 272, 2852, -162, -98, -237, -278, -489, + 641, -96, 7815, -139, -116, -137, -121, -314, + -161, 211, 76, 136, -35, -124, -27, 76, + -98, 133, 85, 332, -4352, 507, -14, -275, + -212, 308, 258, 129, -165, -197, -104, -150, + -104, 60, 125, 568, -3, 1694, 62, -70, + 109, 122, -57, -18, 8642, 100, 50, 92, + 17, -86, -93, -68, -121, -61, -32, 27, + -188, 502, 123, -81, 37, 48, 187, 75, + -30, -22, -224, -292, 99, -49, 4273, 10, + 834, -25, 225, 2773, 78, -3281, -181, 234, + -130, -74, 101, 214, -26, -113, -268, -168, + -90, -435, -26, 38, -569, -4009, -1, 11, + 69, 3, 249, 98, 178, 131, 300, -826, + 48, 337, -828, -371, 96, 312, 712, -667, + -70, -2070, -242, 519, -676, 143, -613, 893, + -2193, 471, 1071, 213, -1231, -196, -580, 155, + 401, 78, -64, 27, -238, 22, -73, -19, + 194, 60, -87, -210, -155, 244, -123, -169, + -4442, 169, 3132, -181, 65, 3950, -396, 209, + 39, -52, -26, 166, 1, -164, 143, -66, + 169, 46, -16, -295, 39, 42, 40, 67, + 25, 17, -1, -8920, -82, -42, 49, 81, + -61, 1, 39, -40, 18, 74, 206, -131, + -71, 106, 7, 88, -13, 69, -113, -89, + 212, -4, 4373, -34, 283, 105, 252, 59, + -2578, -298, 1846, -110, -105, -310, -143, -127, + 274, 225, 861, 262, -815, -311, -26, -685, + 243, -620, -374, 2992, -112, -35, 2903, -94, + -56, -213, 65, 383, 41, 508, -258, -103, + -440, -237, 428, 132, 2793, -77, -113, -58, + -19, -3857, -25, 40, -167, -243, -233, -41, + -279, 213, -22, 8, 120, 126, 159, -212, + -244, 183, 1605, 62, -12, -244, 519, 780, + 116, -3197, -992, 341, 222, 681, -357, -669, + 55, 1213, 100, 441, 1, -57, 232, 10, + -114, 318, -147, 89, 188, 448, -327, 3735, + -292, 875, -216, 211, 111, 160, 172, 286, + -3513, -849, -185, -9, 31, 442, 747, -1045, + 187, 704, -219, 509, 48, 69, -25, -10, + 75, 23, 10, 23, -32, 89, 8628, -77, + -19, 27, 0, -232, 22, -50, -1904, -137, + -169, 128, 138, 78, -443, 243, 157, -3809, + 231, 277, -341, 73, -70, 596, 259, 157, + 2197, 575, 2445, 11, -53, 118, -115, 562, + 108, 30, -241, 30, -394, -155, -186, -344, + -237, -319, -2258, 343, -311, 14, 169, 59, + -15, 233, 732, 365, -692, -108, 1416, -463, + -279, -248, -1731, -406, -278, 298, 209, 5333, + -198, -167, 50, 439, 142, 91, -523, 226, + 262, -130, -15, 573, -4, 271, -2, -47, + 7, -9106, -69, -44, -144, -98, 199, -181, + 6, 45, 47, 37, -51, -68, -50, -116, + -105, 49, 376, -420, 187, 2894, 29, -471, + -221, 455, -1, -858, 55, -197, 359, -1972, + -188, 921, -134, 186, -843, -2542, 322, -1, + -158, -352, -307, -578, -60, 143, -1302, 333, + 681, 1373, -1021, 18, 284, -28, 8, -57, + -16, 15, 58, 31, 8389, -35, 18, 77, + -78, 15, 36, 17, -134, -17, 316, -680, + 491, 38, -217, -278, 276, -299, -75, -4030, + -293, -507, -62, -344, 64, -438, -344, -256, + 341, 199, -66, 28, -17, -17, 2, 142, + 6, -48, -169, -27, -117, 6739, 42, -61, + 140, 246, 3357, -3243, 48, -55, 49, 27, + 4, 172, -169, 6, 69, -265, 70, 25, + 223, 28, 129, 231, 57, -1608, 2640, -28, + -197, 29, -11, 138, 621, 427, 20, 514, + 663, 562, 447, -158, -909, 343, -321, -257, + 6641, -1, -20, -70, 62, 241, 51, -83, + -48, -156, -266, -335, -43, 421, 350, 306, + 165, -541, 47, 5, -40, 364, 21, 190, + -4584, -125, -441, 489, -571, -47, -10, 205, + 60, -73, -584, 417, 233, -34, -109, 85, + 41, 134, 485, -171, -183, -1522, 202, 390, + -3112, 144, 1675, 651, 402, 1953, 120, 93, + -276, -1930, -197, -61, 100, 81, -250, -155, + -19, 336, -178, -2340, 88, -543, 226, -2507, + -60, -62, 218, -9, 158, -3617, -66, 32, + 314, -192, -121, 372, 334, 516, 412, 247, + -609, -1237, 312, -120, -39, 47, 61, -63, + -90, 4500, -191, -353, 10, 54, -163, -345, + 121, -318, -235, 190, -99, 181, -3369, 4, + -188, -87, 128, 167, -507, -1132, -666, -354, + 121, 43, -546, 601, -409, 181, -47, -315, + 127, -2845, 487, 186, -2724, 343, 177, -837, + 387, -84, 259, 122, -159, 88, 117, 137, + 79, 126, 1584, -521, -2448, 2648, -246, -75, + 567, 114, 244, 653, -551, -196, -623, 205, + 816, 48, -326, 66, -94, -33, 133, 412, + -241, 491, -32, -712, -249, -3756, -185, -229, + 248, 268, 557, 73, 164, 24, -70, -27, + 54, -156, -51, -47, -26, 43, 187, 179, + -38, -137, 218, 1916, 4614, 435, -15, 21, + 145, 1868, 241, 240, 299, -204, 73, -24, + -118, -372, -89, 23, -298, 479, 2837, 959, + -76, -85, -2, 28, 94, -3245, 28, -130, + 159, 295, 264, -419, -98, -16, -159, 349, + 202, -158, -2680, -210, -390, -18, -8, 364, + 1367, -110, 932, -232, 1348, -80, 865, -291, + -408, 406, -118, 6462, -55, 10, -152, -161, + -132, 231, 258, 135, -13, -104, 247, 207, + -238, 212, -19, -31, -3303, -160, -24, 3402, + 50, 116, -191, 97, -139, -100, 71, -49, + -293, 133, -120, -10, 197, 196, -516, -686, + 79, -52, 6002, -47, 88, -201, 146, 136, + 54, 162, -180, 287, 67, 70, -55, 210, + -1938, 635, -162, 82, -120, -456, -75, -3753, + -83, 176, 137, 18, -6, -281, 232, 137, + -167, 373, 78, -2622, -38, -293, 89, 69, + -3476, 8, 152, 136, 32, -15, -140, 11, + 6, 13, 481, -175, -228, -254, 158, -3423, + 206, 22, 900, 2025, 266, -402, 132, -356, + 558, -592, -262, -419, 1002, 73, -246, -24, + -3145, 3220, -33, 283, 398, -31, -25, -7, + 103, -93, -143, 1, 32, -497, 206, -35, + 1424, 114, 140, 2393, 3245, -218, -163, 113, + 191, -164, -215, 504, -256, 140, -364, -226, + -340, 91, -464, 32, 188, 4, 15, -6068, + 69, 109, 219, 75, 196, -24, -84, -218, + 27, 57, -97, 8, -338, -4, 358, 23, + -52, -68, 552, 4023, -255, 684, 144, 188, + 100, -293, 462, 553, 9, 665, 12, -640, + -5099, -158, -245, -74, -168, 263, -355, -370, + -653, -163, -473, -394, -233, 750, 17, -31, +}; + +static const int16_t cb1110sl0[] = { + -3736, -3737, -18, -285, 383, -144, -155, -204, + 296, -399, -663, 356, -364, 329, -330, -5, + -52, -88, -41, 228, -21, -45, -136, -280, + -109, -86, 57, 91, -212, 158, -106, -90, + -8192, 70, -255, 78, -8, -89, -110, -58, + 104, -51, -2598, 411, -94, -567, 209, -464, + 139, -234, -336, 754, 863, 399, 345, 117, + -3435, -219, 369, 59, -325, 2439, -148, 6, + -48, 84, -14, 71, 94, 10, 6, 73, + 106, -490, -200, 186, 345, -8, 99, -3687, + -1571, 1836, -1593, 1111, -3700, 470, -6, 401, + -182, -119, 438, -263, 228, 785, -361, -56, + -492, 465, 333, 61, 53, 234, -23, -87, + 39, 105, 7282, 59, -47, -57, -77, -45, + -172, 12, 179, -134, 37, -157, -19, -206, + 9, 1186, -264, 600, 350, 374, 115, -55, + 727, -164, -3903, -735, 586, -24, 145, -786, + -118, 943, 514, 396, 3435, -35, 83, 294, + 107, 16, -3636, -93, 360, -307, -105, -172, + 204, 320, -148, 410, 175, 335, 0, -178, + 12, 94, -47, -91, -49, -159, -155, -65, + -17, -159, -316, 64, 155, -260, 81, -4766, + -150, -116, -332, 128, 675, -105, -479, 563, + -101, 101, -379, 33, 37, 1, 106, 151, + 69, 140, -6, -74, 157, -125, -120, -33, + -178, -286, 60, -158, 43, -7291, -295, -68, + -34, -68, -58, 8, 176, -42, -212, 176, + -533, -62, -27, 167, 291, 59, 311, -3050, + 552, -493, -207, 2576, -991, -375, -102, -980, + 1130, -565, -199, 559, -1390, -428, -618, 70, + -437, -245, -1132, -1302, -453, 83, 222, -1555, + -178, -1396, -1176, -228, 730, -3121, -1085, 84, + -326, 71, -185, -315, 889, 803, -2910, -3609, + -639, -199, 187, 137, -622, 473, 121, 181, + 85, 395, 523, 589, 71, 703, 123, 361, + 47, -675, 299, -446, 307, 591, 3341, 64, + 526, -1541, -50, -1369, 701, -144, 1720, -713, + 562, 297, 146, -34, 1315, 956, 761, -415, + -1311, 637, -1263, -1096, -385, 3228, -395, 317, + -354, -503, 255, -526, 245, 598, 853, -269, + -110, 1354, 333, 110, 855, -3346, 635, 636, + -917, -577, 260, 147, 1041, 1273, 385, -862, + 1751, -1099, 80, -148, 120, -118, 5565, -484, + -74, 326, 291, 234, -41, 212, 192, 207, + -108, 198, 118, -389, 178, -151, -252, -69, + -243, -800, 2640, -531, 84, -301, 157, -3428, + 3, -418, -173, -166, -722, 207, 448, -387, + -504, 202, 453, 210, -203, 304, 190, -264, + 101, -23, 36, 74, -146, 26, 29, -33, + 59, -127, 22, 213, -167, 103, 8192, 183, + 2709, -125, 324, -964, -259, -400, -41, -430, + 367, 127, 266, 369, 1081, -190, -220, -1083, + 641, -2733, 750, 525, -623, -18, 3159, 686, + -278, -2083, 1680, 587, 123, -6, -266, 376, + 522, -433, -499, 169, 106, 2041, 174, 571, + -108, 129, -116, -87, -252, 89, -14, 14, + 120, -7874, -204, 15, 19, -110, -82, -54, + 66, 31, 210, 55, 339, 61, -219, -3205, + 1292, 80, 344, -733, 3172, -21, -55, 712, + -192, 38, 408, 489, 388, -343, -763, 438, + -1812, -6, -129, -1392, -382, -28, 105, -284, + -168, -462, -284, 22, 113, 1203, 3253, -589, + -619, 348, 113, 847, 3, -557, 460, -636, + -601, -742, 46, -111, 51, -66, -2867, 551, + 455, 898, 17, 2205, 1004, -46, -1475, -367, + 2849, 766, -32, -119, 624, -722, 3371, 172, + -330, 93, -221, 457, -453, 84, -281, -360, + 108, 487, -301, 166, -2611, 577, 192, 34, + 1105, 705, 34, 29, -3041, -898, 172, 578, + 307, 483, -439, -327, 360, -935, -76, 387, + -2485, 800, 333, 601, -712, -973, -65, -442, + 220, 3577, -428, -210, 565, 757, -382, 289, + 726, -19, -182, 384, -32, 38, -810, -181, + -2978, 259, -213, -473, -187, -823, -279, 1518, + 26, -385, 1143, -409, 1310, 676, -2472, 64, + -391, -102, 455, -5751, 278, 30, 64, -177, + -113, -170, 94, -234, -167, 101, -2, -149, + -131, 351, -254, -138, 149, -42, 631, -21, + 237, 2893, -291, 2917, -1240, 211, -215, 22, + -827, -160, 140, -213, 156, -250, -1233, 691, + 498, -30, 350, -28, -12, 217, 34, -348, + -70, -140, 103, -60, 353, -200, -314, -74, + 112, 4435, -80, -287, 413, -99, 1407, 1519, + -2230, 114, 3179, -523, 39, 340, -379, 373, + -1552, -138, -446, -106, -762, -1017, -297, -183, + 498, -481, 374, 271, -5609, 297, 98, -378, + 187, -78, -125, 333, 114, -81, 62, -145, + 14, 362, 518, 134, 195, 130, -34, -72, + -3088, -2965, -114, 585, -78, 6, 552, -633, + -98, -224, 980, 338, -83, -1064, 42, 106, + -119, 644, -293, 496, 67, 128, -129, 620, + 20, 526, -177, 68, 351, -3703, 1465, 905, + -245, 86, 511, 39, -512, -150, 239, 86, + 60, 39, -79, -9, -65, 77, -7993, 57, + -19, 56, -38, 161, -221, -129, 8, 93, + 52, -5622, -114, 133, 26, 64, -194, -316, + -143, 225, -66, -81, -74, 240, 130, 137, + -549, 11, 352, -53, -4029, 513, 3164, -205, + 127, 80, -193, -197, -36, -885, 223, -858, + 5, -458, 290, 459, 247, -284, -176, -748, + 173, 191, 114, 406, 126, 3, 91, 84, + 8027, 379, -56, 47, 35, 246, -143, 65, + -36, 8, 59, 67, -69, -421, -3492, 312, + -252, 261, 3367, 319, -67, 77, -346, 386, + 34, 237, 18, 111, 348, -547, 186, -93, + -3558, -178, -3801, -133, -27, -561, -308, 112, + -224, 272, -195, -270, -179, -165, 199, -524, + 681, -117, -429, 37, -5891, 94, -55, -433, + -354, 122, -60, 67, -200, -80, 267, -136, + -42, 130, -324, -25, 156, 167, -47, 178, + 8, 289, 157, 88, -28, -39, -262, -11, + 9, -113, 76, 8192, 89, 115, -298, 137, + 34, 0, 261, -30, 49, 274, 130, 824, + -944, -56, 1074, -314, -76, 527, 75, -3321, + 733, -798, -352, -1038, 1049, 72, -233, 312, + 3363, 69, 104, -149, 22, 283, -20, -101, + -3350, 164, -328, -362, -993, 430, 78, 125, + 269, -29, 362, -73, -30, -1189, 1396, 59, + -1285, -216, -121, 3893, 84, -464, -38, -113, + -369, -181, -930, -1012, 394, 120, 274, -552, + -800, 105, -141, -12, 241, -667, 543, -416, + 28, -182, 51, 905, -3964, -1213, 12, -271, + 378, -234, 838, -113, 56, 567, 35, 48, + 490, -180, 1097, 170, 2596, -28, 3098, -220, + 424, 885, -42, 783, -30, 907, 63, 46, + -131, 28, -55, 54, -46, -25, 30, 58, + -15, -200, -6, 11, -70, 66, -8089, 86, + -136, 96, -56, -101, 300, -661, -41, -201, + 760, -252, 955, 189, 1459, 3562, -457, 35, + -54, -164, -329, -1245, -830, -365, -399, -23, + 616, -238, -1301, -198, 335, -3400, 149, 175, + -97, -279, -594, -92, -915, -830, 468, 628, + 728, 1024, -549, 1073, 222, -142, 296, -75, + -168, -5, -67, -7311, -50, -256, -321, 121, + 358, -272, 30, 258, 105, -161, -291, 462, + -7, -211, -227, -104, -151, -152, -72, -98, + -59, -23, -98, -203, 103, 89, 239, -484, + 7749, 110, 35, 345, 282, -578, 140, -51, + -62, -238, 102, 454, 64, -107, -223, -174, + 285, 110, -190, -16, 1624, 142, 3813, -849, + 43, 234, 84, 0, -132, 131, -135, -70, + -1, 125, -83, 171, 109, 8044, 97, -38, + 143, 64, 13, 4, -225, 181, 712, 626, + 20, 167, -467, 186, 3801, -2179, -647, -119, + -112, -183, -223, 295, -438, -407, -29, 36, + -34, 2536, -47, -402, -33, -62, -136, 2444, + -152, -717, -868, 86, -2323, 931, 659, -1281, + -98, 638, -162, 195, -5, -40, -88, 3019, + 3466, -323, 316, -784, -715, 5, 188, 42, + 155, -608, 500, 185, 475, 100, -51, 879, + -891, -158, 18, -453, 380, -207, -143, 401, + -153, 926, -184, 2775, 3176, -797, -198, -888, + 405, 460, 309, 304, -114, 2386, 2319, 658, + -2200, 216, 435, -1210, -655, 154, 81, 538, + 908, 220, -118, 482, -864, -526, -241, 857, + -473, 774, -288, -886, 46, 250, -96, 301, + 120, -488, -128, -233, 422, 38, -3416, -974, + -243, -226, 381, 2394, 652, 3124, -205, -1303, + 1484, -159, -152, -1037, -105, -121, -466, -76, + 605, 181, -55, -326, -527, -126, 1691, 1316, +}; + +static const int16_t cb1110sl1[] = { + -743, -300, -347, -441, 85, 5282, -250, 32, + 28, -306, -434, 78, -178, -112, -28, -162, + -188, -43, 17, 94, -242, -258, -2691, -471, + -556, -815, 120, -57, -36, -325, 3282, -765, + 355, 2, -162, -454, -72, 192, 86, 219, + -123, 237, 135, -42, 492, -471, -114, 5146, + -164, 28, 77, 70, 276, -148, 333, 64, + -89, -46, -135, 474, -218, -119, 351, 7619, + 93, -80, -84, -51, -110, -223, -13, -116, + -160, -102, -64, -140, -376, 156, -143, -421, + 105, 102, 519, 1256, 786, -284, -3029, -3021, + -365, -515, -1358, -273, 394, 489, -242, 31, + 239, -1328, 169, -488, -3069, -398, 303, -274, + 498, -2758, -748, -208, -324, -285, 78, -386, + -1063, 298, 5, 693, 160, -629, 1656, 186, + 457, 742, 422, -3723, 1997, 1025, -24, 291, + -588, 16, -327, 459, -521, 421, 1279, -408, + -2, -1320, 101, -372, -66, 100, -605, 3214, + -374, -660, -371, 207, 175, -553, -574, 2962, + 119, -551, -140, -62, 50, -608, -237, -100, + 108, 101, 3258, -31, -45, 375, -161, 132, + 2842, 1458, 235, 800, -113, 719, -291, -29, + -512, -267, 53, 780, -59, 3387, -175, 88, + -78, -475, -536, 584, -3025, -19, -105, 91, + 875, -55, -771, 143, 384, 810, -372, -253, + 160, -128, 232, 98, 7755, 181, -19, -177, + 46, -39, -30, -212, -289, 75, 127, -114, + 80, 79, 325, -128, -436, 2547, -73, -29, + 1046, 344, 3340, -335, 458, 637, -175, -695, + -366, 294, -322, 564, 542, 209, 524, -62, + 444, 2827, -53, 66, -959, 84, 484, -147, + 158, 259, -479, 3216, 232, -68, 583, -810, + 107, 93, 629, -168, 143, -552, 96, -71, + -3903, -438, 335, -133, -186, -278, 73, -575, + -253, -733, -91, -8, -1149, 350, 140, 12, + 3935, -236, 103, 469, 610, -536, -305, 3112, + 13, -182, -686, 637, 525, 327, 102, -49, + -450, -16, -480, 233, -82, -132, -3979, 426, + 757, 54, 152, -701, 513, 2330, 148, 242, + 1709, 162, -168, 146, 0, 891, -644, 109, + -549, 104, -50, 275, -193, -55, -144, -117, + 31, -234, 68, -5369, 72, 54, 54, 119, + -140, 192, 286, -42, -278, -3524, -3609, 692, + -366, -15, 343, -885, -267, 294, -387, -215, + -83, -469, 790, 85, 428, -613, 114, 634, + 279, -570, 616, -813, -117, 3073, 3121, -717, + -200, 285, -1061, -44, 945, 386, -166, 494, + 776, 36, -25, -444, -260, 407, 3885, 1049, + 1348, 185, 454, -136, -2275, 1064, -271, -316, + 645, -1050, 483, 430, 32, 569, -676, -335, + -328, -2982, -370, 50, 189, 155, 1058, -119, + -407, -310, 461, 3293, -604, 195, 48, 68, + 196, 194, 547, -210, 785, -383, -410, -268, + -149, 192, -88, -13, 20, -80, -5146, -86, + -111, 40, -36, -138, 12, 239, -36, -84, + -512, 149, -237, -672, 3477, -3446, 1198, 220, + 146, -747, 242, 48, -146, -196, -335, -777, + -405, 620, -340, -367, -389, -108, -27, -184, + -2024, 518, 241, -104, 417, -1356, -1961, 134, + 3221, -423, 286, -60, -110, -568, 14, 76, + -144, 159, 704, -410, 542, -43, 223, 105, + -154, -141, -84, -132, -271, -235, -285, -248, + 480, 430, -4711, -487, -86, 482, 80, 46, + -239, -93, -115, -54, -1, 7, 97, -12, + 151, -180, 159, -63, 65, -215, 54, 5712, + 2886, -115, -236, 113, -25, -301, -450, -276, + -78, 197, -55, -278, -511, 163, 3442, -910, + -74, -225, -103, 63, -204, -43, -126, -334, + 223, 192, -131, 202, -83, 5000, -66, 441, + 33, 0, -116, 237, -238, -37, 445, -48, + 7, -1855, -1154, -251, -117, -185, 125, 1877, + 375, 388, -904, 202, 649, 376, -3231, 897, + 101, -637, 376, 16, 1, 845, -550, -610, + -380, -1363, -955, 71, 1303, 296, -264, -584, + 247, 3247, 98, 1035, -670, 416, -2008, -448, + -56, -169, -1787, 3314, 408, 2541, -833, -2, + -169, -184, 193, -575, -81, 410, -293, -478, + 21, 194, 223, -111, 4648, 60, 354, -593, + -2429, -671, 150, -350, 151, -448, -5, 386, + -441, 131, -339, 87, 815, 279, 51, 131, + 56, -3194, -170, -3899, -297, 270, 21, -215, + 7, 205, -305, 141, 577, 83, -289, -502, + -66, -96, 433, -106, -685, -194, -82, 33, + 98, 315, 258, -2453, -2957, 608, 672, 152, + -681, 1804, -74, -459, -423, 114, -1183, -100, + -798, 357, -79, -3418, -676, 580, -1637, -506, + 306, 437, 1001, 731, -885, -1276, -583, -359, + 650, 15, -189, 190, 86, 39, -7987, -133, + 324, 174, 22, 86, -144, -125, -43, -81, + -49, 68, 39, -204, -159, -291, -217, -68, + 264, 193, 406, 247, 27, -272, -168, 536, + -5740, -141, 38, 18, -7, 258, -111, 125, + 476, -364, 5, 72, -2668, -197, -605, -671, + -82, 201, -752, 227, 240, 345, -11, -138, + 551, -351, -228, -2774, -132, 1115, -1038, -18, + 791, -3136, 81, 219, 357, 755, 579, 26, + -3129, -398, -719, 193, 495, 290, -1123, 854, + -381, -535, 33, 232, 2340, -4577, -94, 1023, + -117, 39, -54, 15, -161, -860, 64, -209, + -597, 415, -135, -407, 1068, 894, -784, 108, + 267, 7506, 140, 67, 198, 74, 52, -388, + -184, -24, -54, -24, 172, 172, -50, -184, + -113, 164, 128, -39, 252, 90, 356, -313, + -90, -313, -355, -73, 19, 139, 141, -122, + -231, -4548, -157, -227, 47, 231, -421, 60, + -80, -3619, 4252, -354, 69, 148, 336, 446, + -183, 86, 248, 35, 73, 120, 157, 156, + -291, -523, 35, -264, 3434, 189, 495, -59, + 533, -343, -554, -3014, -415, 17, 436, 552, + -240, -394, -761, 43, -766, 46, -1119, -254, + 1540, 195, -298, -833, 45, -93, 61, 40, + -171, 167, 82, 107, 16, 40, -166, -46, + 120, -185, 13, 151, 8151, -235, 92, -23, + 214, 206, 260, 93, 163, 78, 184, -60, + -12, -171, -499, -151, -219, 11, -221, 221, + 3253, -376, -1079, -481, 763, -257, -120, -10, + 34, -640, 341, -2953, 528, 567, -672, -335, + -175, -61, 581, -260, 1159, -802, 1070, 12, + 168, 2305, 291, 203, -15, -569, 3247, -179, + 620, 339, 224, 710, -416, 512, -86, 571, + 439, -167, 571, -72, -144, 236, -382, 11, + 268, -176, -136, -337, 220, 64, 341, 361, + -4474, 25, 385, 453, -153, 89, -572, 245, + -197, 33, 75, 588, 51, -199, -74, -149, + 224, 210, 4689, 282, 20, -47, 129, 221, + -72, 27, 76, 93, 331, 215, -5, -20, + 74, -80, 169, 126, -40, -137, -24, -8101, + -23, 165, 271, 403, -34, -19, 290, -199, + -14, 205, 657, 301, -885, 2457, -1965, -2266, + -1004, -224, -554, 182, -220, -467, -611, 1012, + -122, 3303, -73, -205, 93, 3549, 217, -223, + 55, -459, 541, 286, -46, 128, 354, 137, + 824, -313, 32, 301, 139, -492, 170, 136, + -35, -752, 4613, -830, -34, 41, 344, 279, + 643, -394, -461, 163, -330, 199, -215, 83, + 1096, 613, -473, 816, 3534, 210, -772, 935, + -275, -600, -341, 602, 104, -598, -217, -789, + -2428, 870, -351, 474, 50, 321, -148, -2929, + 25, -135, -46, 11, -566, -3057, -664, 700, + -300, 256, -960, 350, -480, 414, 431, 24, + -51, -228, 407, 142, -321, 316, -290, 149, + 56, -84, -359, -118, -4948, 138, 373, -49, + 142, 71, -163, -13, -279, 38, -121, 35, + -47, -70, -43, 116, 3, -159, -11, 97, + -116, -62, 156, 307, -173, 7294, -143, 288, + -34, 671, 613, 16, -240, -229, -414, -494, + -43, -169, -854, 336, -991, 719, -353, -163, + -750, 2685, 2837, -558, 129, 2076, -47, 641, + -37, -93, 226, -69, 598, -284, 127, 106, + -426, -555, -947, 485, 54, -3175, 622, -341, + -544, 278, -205, -689, 391, 238, 9, 152, + -233, -392, 28, 36, -394, -1059, 132, 3761, + -480, 87, -656, 1304, 478, -272, 65, -147, + 91, 520, -896, 166, 62, -30, -28, 194, + 542, 3, 625, 1795, 3613, 1097, 1030, 906, + 400, 133, -127, 219, 958, 93, -546, -702, + 2937, -524, -270, -767, -192, 725, -897, -643, + 2502, 141, -1147, 257, 279, 470, -3001, -104, + 79, 508, 450, 265, -21, -74, -437, 647, + -2755, -407, -816, 620, 24, 537, -668, 604, +}; + +static const int16_t cb1110ss0[] = { + -8187, 90, -694, -168, -452, -4, -259, -332, + 352, -554, 43, 389, 236, 508, -175, 461, + -277, 118, 651, -245, 696, -1423, 368, -1417, + 1782, 1650, -540, 27, -461, 516, -599, -185, + 422, -11, -181, 19, 1809, -3226, -839, -191, + 468, 180, -550, 198, 2487, -923, -1335, -1008, + 1029, 1716, 588, 371, 902, -1214, 179, 1026, + 1560, 1815, -1714, 1230, -712, 1675, 1867, -154, + -2860, -484, 2289, -1018, 33, -1494, 614, -2340, + -724, -1088, -1930, -775, -876, 642, -1358, -144, + -2518, 62, 543, -1049, -1081, 672, 1305, -1506, + -86, 2920, 518, -1836, -546, -132, -45, -642, + 381, -404, -2206, -1211, 698, -703, -667, -606, + -677, -2246, 526, -1157, 177, 510, -1420, -617, + -1819, 1710, 1631, 1049, -1697, -495, 961, -1250, + 39, 482, 445, -956, -71, 977, 426, 1826, + 286, 36, 295, 1786, 794, -3456, 1645, -766, + -1580, -2435, 1108, -286, 731, -659, 960, -1759, + -978, 316, -350, 91, -35, -222, -1417, -53, + -529, -679, 681, -4700, -524, -39, -350, 196, + 199, 191, 653, 1344, -942, -428, 156, 173, + 636, -1538, 1795, 1709, -190, 1265, 164, 650, + 2302, -1757, 1762, 413, -851, 44, -1371, 343, + -3845, -122, 1864, -489, 601, -748, -402, 590, + -124, -1988, -1536, -999, 399, -753, 295, -384, + -1316, 55, -669, 262, -1157, -3766, 992, -111, + -2928, -1424, -98, -62, -334, -1848, 377, 1560, + 947, 1568, 1554, 206, 664, 2014, 2098, -164, + -640, -2897, -647, -1675, -2307, -254, -555, -2426, + 1497, 465, -1525, -1148, 55, 632, 554, 2068, + 451, -1532, -715, -2065, -1177, -623, 478, -88, + -1140, -72, -450, -248, -1111, -250, 1356, 2717, + -1841, 420, -1299, -1715, 746, -101, 600, 1130, + -903, -473, 1225, -876, 193, 694, -193, -482, + -1838, 94, 157, 1131, 267, -242, 2021, -39, + 795, -285, 438, -4322, 1097, -621, -518, -338, + -289, -114, -671, 1700, -477, 449, -1664, -693, + 1403, -3629, 1480, -991, -234, -213, 354, -269, + -1140, -40, 1455, -758, 1273, 497, -686, -945, + 59, -66, -769, -2930, 2343, 2452, -1576, 995, + -734, 1009, 98, -350, -1116, 545, 189, 99, + 566, -916, 20, 117, -807, 986, -428, 177, + 1247, 485, -680, 1139, -1263, -256, 4828, 89, + 27, -1339, -1091, 149, -641, -703, -570, -112, + 346, -93, -641, -97, -991, -2247, 2284, 847, + 2110, -1393, -315, -1468, 514, -1493, -46, 1135, + -1231, 39, -913, -278, -762, 1775, -684, 735, + -1676, 386, -2030, 2534, -2371, -1661, 1204, -111, + -8, -607, 1233, -1532, -1263, 1530, -537, -1728, + -335, 269, -614, 12, -1187, -770, 471, 373, + 4743, 12, 197, 610, -101, 417, -350, 551, + 544, -898, 387, -682, -1216, 126, 96, 94, + -268, 535, 126, -778, 1595, -1379, 3366, 49, + 460, 1772, 198, -896, 75, 253, -1376, 68, + 838, -1121, -578, -630, -718, -975, -565, 1303, + 354, -769, -38, -246, -193, -408, 41, 165, + 374, -87, -155, -8, -746, -430, -869, -1842, + -385, 281, 5119, 432, 1119, -807, 1756, 816, + 131, -548, -528, 1347, 478, 1482, 2942, -290, + 650, 1012, 163, 840, -804, 94, 2507, 1514, + -953, -289, 23, 1128, -895, -1009, 1871, -370, + 699, 659, -3069, -695, -1559, 1435, 672, 94, + 1496, -637, -2208, 1083, 688, 485, 251, -828, + 1313, -21, -1948, 230, -603, 783, -829, 524, + -1142, -3845, -1383, 323, 1295, 732, 759, 591, + 68, -1869, -756, 1727, 339, -1565, -510, 2623, + 358, 3071, 281, -790, 1129, 243, -588, -431, + 492, 372, 96, 890, -935, -727, -236, -416, + 171, 226, -1090, 1257, -1063, -303, -817, -1506, + -947, 2282, -659, -406, 79, 772, -816, -2610, + -1802, -1019, -816, -1886, -1306, 1365, 624, -2314, + -57, 1012, 215, -130, 3404, -864, 959, 202, + -26, -1015, -1212, -34, -408, 3494, -284, 845, + 275, -1005, 458, 840, -2258, -13, -129, 2536, + 1269, 1216, 2071, -243, 624, 584, 2192, 720, + 604, -1397, 766, 984, -1050, 157, -246, 438, + 240, -587, 1251, -649, -22, 33, 5818, 608, + -996, 474, -523, -454, 1252, -791, 631, -465, + 663, 452, 1793, 853, 39, 3732, 758, -1329, + 11, 2217, -136, -540, 1335, 65, -2047, 943, + 701, 1886, 2085, -890, -16, -184, 325, -1077, + -271, -1246, 391, -1686, -651, -77, 319, 292, + -160, 1204, 1093, 776, -310, 1512, -1196, 149, + 46, 593, 1738, -566, 97, -3667, -485, -683, + -121, -216, -149, -344, 406, -989, -311, 383, + 979, -828, 394, -22, -5143, -1368, -18, -433, + 359, 607, 996, -1144, -229, 1365, -1243, 413, + -591, -621, 803, 1356, -625, 1149, -234, 182, + -1285, -2487, 359, 2640, -1426, -66, -688, 237, + 1307, -361, 108, 207, 1026, -500, -1156, -1043, + -2192, -2232, 1790, 1135, 1742, 1494, -1156, -698, + 2520, -2596, -620, 431, 748, 88, 912, 832, + 1122, -483, 1837, 1821, -826, 1112, -424, -306, + -750, 1085, 260, 152, -114, -1065, -4518, -300, + -976, 143, 1452, 1395, 1677, 59, -51, -1072, + 868, -171, -26, -914, -109, -2420, -48, 69, + -230, 630, -522, 2274, 1265, -1612, 2570, 836, + -2042, -1922, 2970, 775, -320, -2486, -2935, 553, + 178, 994, -1054, -1321, 699, 749, 1002, 513, + 586, 1550, 35, 654, -995, 1743, -1049, -405, + -3431, 1943, 700, 555, 111, -67, 1007, 111, + -57, 661, 404, -628, 425, 2185, 860, -516, + -523, 452, 238, -1778, -378, -721, -2197, 218, + 864, -1031, -832, 135, -2543, -447, 789, 1117, + -1491, 120, 1294, -702, 627, -412, -902, 404, + -1843, -786, -597, 900, 1963, 22, -843, 1168, + -1045, -797, 764, -423, 329, 2308, -1950, 331, + -1090, -2466, -483, 2023, -3363, 2126, 495, 2812, + 1922, -1488, -1041, -798, 135, 408, 33, 563, + 1333, -36, -2181, -787, 709, 287, -971, 93, + -459, -975, 2412, 280, 2555, 32, 2217, -1825, + 650, 313, 585, -947, 1170, 45, 1108, -435, + 1092, 220, -155, 512, 460, 211, -231, -627, + -836, -2205, -181, -113, 130, 226, -321, -765, + -1327, -1190, -676, -357, 691, 232, -365, -1818, + -3007, 2210, 997, 601, 2156, -782, 1626, -1081, + -49, -616, 685, -12, 40, 3480, 563, 515, + 245, 51, 290, 1227, 171, -1078, 520, -483, + 280, -1517, -1331, 2132, -1176, -1381, -1546, 1436, + -852, -505, 672, -807, 623, -244, -125, -1958, + 516, 798, 1185, 922, 441, 651, -610, -1430, + -1887, 114, -869, -2024, -1627, -2276, 2008, -1224, + 125, -609, 371, -1104, -506, -942, -624, -478, + 197, 141, -242, -1051, 1532, -1269, 666, -1055, + 1689, 444, 1720, 16, 301, -2311, 1196, 1108, + 1298, -564, -1197, -1858, 439, -198, 324, -1884, + 3193, 2281, 201, 587, -2028, 1969, -1087, -352, + -87, -632, 144, 165, 68, 1150, 173, 478, + -837, -470, -464, -195, -205, 2111, 15, 643, + -453, -339, -1128, -1368, 1182, 822, 654, -2331, + -1668, -215, -678, -2460, 1169, -664, 777, -348, + 2570, -767, -563, 254, 562, -557, 4, -97, + 1990, 373, -780, -677, 1996, -1527, -365, -416, + -325, 587, 910, -3780, -553, 104, 1705, 240, + -719, -1717, 2765, -582, -76, 399, -1152, 2379, + 3169, -1153, -725, -35, -1214, 362, 1600, -724, + 424, -722, 472, 872, 694, -126, -1649, -1314, + -1814, -95, -312, -34, 780, -884, 824, -864, + 526, -100, 3820, -56, -452, 43, 564, 487, + 177, 890, -1423, 894, -552, 1438, 204, 1015, + -4, 327, -3327, -433, -335, -869, 1312, -488, + -1287, -169, 2018, 435, 73, 508, 1160, -1060, + -134, -1304, -341, 623, 125, -15, -1120, 108, + -71, -1487, -189, -3640, 1424, 1740, 1116, 579, + 1603, -3294, 1241, -225, 1481, 2775, 1326, -242, + -632, -1560, 563, 559, 138, 115, -557, 2004, + -1771, 717, -1052, -1115, -1634, 889, -441, 1954, + -164, -1507, -1312, -407, 662, -867, -896, 225, + 2576, -224, -107, 237, -694, 859, 192, -1033, + 2255, -1225, -891, -1994, -90, 339, -382, -774, + 1460, -1553, 648, -521, 2370, 160, 714, 54, + -906, 1435, -1752, -274, -523, -36, 1208, 1553, + -339, 1000, -178, 209, -1001, 916, 495, 310, + 726, 127, -391, 107, -513, -1052, -376, 297, + -307, 933, -233, -253, 1196, 4619, -1278, 762, + -13, -387, -973, 2153, 68, 362, -887, -1922, + -106, 298, -1127, -2601, -2184, -111, 111, -1588, + 1002, -365, -2226, -290, -599, 610, 551, -1368, + -4344, 618, -172, 349, -914, -530, -192, 718, + 348, -675, -884, 913, -94, 215, -834, 353, + 753, -811, -84, -905, -128, -483, -1782, -1255, + -2333, -1110, 477, -566, 346, 2018, -1644, -325, + 1365, -1223, 158, -1786, 566, 203, 742, 281, + -555, 573, -978, -459, -1671, 378, -689, 349, + 606, -5961, 562, -13, -223, -419, -442, -447, + 125, -1052, 53, 2594, -1377, 209, -1549, 533, + -118, -2538, 1808, -364, -37, 1221, 607, 593, + 309, -240, 1574, 254, 434, -141, -220, -2018, +}; + +static const int16_t cb1110ss1[] = { + 631, 3041, 1215, 2376, -1843, -103, 750, 144, + -87, -249, 715, -201, 758, 202, -197, -135, + -523, 1243, 457, -717, -700, 1662, 918, -48, + -1008, 180, 411, 948, 2192, 2607, -826, -962, + -1130, -59, -1047, -305, -325, -1032, 2096, -287, + 395, -1543, -268, -1218, -2045, -1674, 951, -1846, + -636, 263, -138, -287, -327, -2208, -664, 496, + 2179, 1645, 340, -601, 473, 670, 950, 2774, + 364, 613, -1896, -1876, -3177, -105, 506, -164, + 281, 718, 2419, -1077, -50, 365, -1631, -134, + -384, 231, 767, -285, 1268, 321, -1408, 217, + -409, -725, 1225, -2551, -2622, -274, 473, 2752, + -11, 342, -495, 1627, 79, 240, 2, -1021, + 640, -508, -269, 648, -116, -1283, -217, 13, + -1674, 2402, -879, 1791, 2753, 2386, 1195, -700, + -282, -428, -671, -92, 1187, -672, 1037, -1913, + 246, -816, -69, -2284, -712, -996, 2498, 902, + 809, -149, 66, 775, -44, -566, 955, -1073, + -1438, -894, -978, 274, -390, 5528, 1153, 17, + -750, 63, 545, -725, -301, -323, 661, -813, + -347, 739, 335, 136, 203, 342, 802, -199, + -818, -679, -282, 2195, -1714, -757, -154, 182, + 132, -1737, 405, 2394, -3727, 1349, 213, -193, + -2495, -1354, -629, -1171, 1429, -16, 834, -1260, + 160, -1892, 874, 1754, -567, 344, -3499, 1612, + -987, -424, -997, -1640, 594, 1058, -783, 511, + -604, -1480, -1754, -424, 2262, -1991, 1297, -638, + 350, -588, -55, 1483, -456, -567, 146, -946, + 731, 1541, -759, 592, 1231, -270, 171, -1975, + -2707, -456, -227, 392, -891, 1008, -1066, -487, + 231, 1372, -51, -599, -227, 696, -820, 354, + 1928, -48, -1302, -570, 316, -283, -848, 2563, + -266, 2821, 540, 553, -1272, 1120, -1164, -451, + 384, -1058, -1018, 1735, 992, -1220, -83, 1490, + 2304, 122, 1630, 1108, 1997, 2346, -647, 301, + -1746, -218, 313, 462, 1486, -536, -508, -463, + 104, 930, 605, 2116, 793, 2881, -724, -1379, + -53, 4458, 793, 275, -180, -516, -489, -774, + -265, 704, 112, 175, 112, -121, 652, 310, + 564, -440, 773, 1885, 927, -672, -773, 1726, + -614, 818, 1589, -372, -207, 499, -894, 987, + 796, 652, -1228, -4010, -2208, 458, 645, 498, + -279, -852, -1897, -1820, -35, 674, 201, 474, + 77, 94, 2327, 723, -1081, 261, 209, 1179, + -1175, 623, -1293, 2154, -117, -3707, 940, 813, + -1059, -335, 1306, 525, -191, -2066, -425, 19, + -366, 529, -145, 822, -913, 254, 424, -354, + -167, -2437, -1433, 603, -318, -1517, 4250, 541, + -1360, 450, -531, 200, 534, 1200, -222, -535, + -162, -1211, -116, -144, -462, -139, -482, 511, + 2068, -2100, 971, -1487, -1050, -3150, -701, 119, + 16, 1535, 272, -1184, 2242, 488, -492, -915, + 1660, 212, -826, -444, 1003, 2705, 3591, -174, + -333, -431, -59, -903, 61, 751, 1087, -45, + -1031, 617, 686, -15, 848, -348, 947, 396, + 931, 1785, -552, -920, -669, -63, -1869, 2357, + -1549, 807, 889, -1581, -1071, 1587, -1108, 1300, + -658, -625, 300, -285, -977, 1656, 4183, 1487, + -191, 658, -300, 497, 1378, -300, 1031, 322, + 114, -449, 666, 1250, 264, 125, -109, 748, + -503, -40, 199, -1212, -1643, -2522, 151, 121, + -1128, -3200, 876, -446, 878, -989, 1510, 2261, + -1507, 1793, -402, 30, 228, -50, 985, -1568, + 755, 1559, -688, 1342, -423, -1507, 96, -501, + 474, -2926, -2493, -131, -656, 450, 1035, 812, + -14, -933, 941, 1396, -957, -621, -516, 379, + -225, -2063, -2048, 669, 287, 1688, 1727, 299, + -658, 852, 745, -260, 993, 158, -1236, -1422, + 33, 611, -112, -323, -194, 839, -1407, -1505, + -2010, 1267, -355, -675, -3779, 768, -228, -643, + 661, 1313, -529, 962, -948, -212, 1043, 1560, + -174, 1744, -938, 289, 1942, -2228, -1932, 1056, + -590, -940, 922, 601, -853, -791, -637, -2, + -52, -83, -209, 1422, 856, -1141, 2500, -1195, + 773, 1087, -1389, 409, 439, -3674, 453, 1637, + -15, 1013, 2635, 1530, -1104, 440, 895, -210, + 1118, -6, 45, 65, -1110, -3307, -331, 478, + -155, -410, -721, -1234, 129, -971, -1117, -27, + -1132, -1289, 1888, -1112, 203, -1091, 442, -2207, + 501, -343, 468, -52, 385, 269, -3102, -366, + -469, 391, 505, 176, 356, -69, -929, 1155, + -280, -1264, -897, 1006, -494, 155, 36, -627, + 924, -816, 154, -750, -837, 5263, -1099, 91, + -481, 71, -681, -574, 1229, 675, 1217, 1073, + -695, 274, -381, -140, 1372, -524, 1164, 341, + -149, -856, 793, -1294, 981, -961, 371, 1178, + 1463, 373, 1375, -4384, 239, 136, 67, -1196, + -126, -1001, -228, 150, 437, -1830, 477, 498, + 4246, 793, -661, 260, -1810, 1405, 76, 902, + -844, 908, 1830, 27, -124, 257, 765, -98, + 592, 487, -132, 202, 675, -669, -679, 1309, + -4002, -206, -66, -390, -253, -190, -921, -83, + 1411, -417, -2560, -646, 1853, -148, 548, -370, + -723, 959, -906, -3058, -276, 467, -1280, 970, + 687, 484, 506, 1143, -1509, 828, -2169, 2931, + 1322, -579, 1033, 209, -979, 217, -434, -1438, + 314, 2384, -906, -29, -1478, -31, 574, -373, + 1478, -124, -680, 330, 794, -753, -977, 1151, + -1190, -1479, -642, 1658, -2201, -1469, 1589, 587, + 52, 1298, 2092, -1483, 678, 1988, 918, -648, + 328, 2096, -1090, 2153, -1416, 295, 537, 261, + 398, -1389, -399, 1105, 10, -395, 1169, -431, + -423, -1617, 766, -1900, -3205, 131, -746, -852, + 2215, -317, -232, 1079, 293, -727, 50, -446, + -713, -897, 768, -896, -667, -281, 377, 115, + 1695, -4870, 713, -393, 251, 1268, 477, -497, + 294, 18, -359, 556, 308, -752, -863, -216, + 151, -163, 695, 587, 810, 2107, -107, 921, + 1203, -472, 1280, 372, 110, -581, -225, -714, + -58, -2587, -1980, -186, -372, -1410, -1504, -1020, + -745, -88, 2373, -568, -2841, -2041, -1841, 2065, + 389, -430, 1163, -208, 569, 375, 650, 317, + 1114, -1036, -959, -896, 1060, 1014, -599, -1743, + 1121, 808, 1556, 326, -2876, -1556, -1283, 384, + -1102, 378, 1433, 702, 1454, -1243, -725, 224, + -610, -455, 1413, -1747, -2516, -572, -1455, -313, + 231, 780, 1531, -2475, -34, 921, -1650, 269, + 818, 5, 835, -209, -911, -432, -1104, 165, + -1638, -46, -2031, -445, 1308, 1519, -1992, 1606, + 956, 757, 1139, 116, 829, -1376, 209, -893, + 963, -569, -466, -185, -1345, 1524, 1714, 269, + 219, -161, 482, -1178, -3621, -831, -668, 1871, + -529, -983, 558, -818, 81, 555, 33, -473, + -187, 113, 899, -577, -1093, 1408, 902, -258, + -111, -648, 4340, -780, -651, 789, -92, 2310, + -401, 669, -213, 369, -104, -820, -290, 48, + -917, 71, 1070, -239, -744, 891, 23, -5130, + -761, 312, 319, 842, 280, 78, -149, 352, + -594, -361, 354, -906, 42, -1610, 835, 157, + -631, 1100, -297, 1081, -96, 484, -825, -2132, + 549, 1305, 128, -314, -1733, -265, 1285, -4061, + -348, -136, -940, -507, -232, -1511, -876, 78, + 2120, 175, 2216, 1179, 497, 335, 350, -18, + -1307, -387, -2207, 587, 3209, -370, 1155, 1501, + -1687, -796, -1417, -733, -269, 801, 83, 1173, + 718, -2702, 19, -315, 4501, 1025, -365, 348, + -417, -510, -172, -1201, 1478, 671, 1933, 1759, + 676, 416, 30, 400, 531, 351, -1176, -2807, + 1969, -1398, 1159, -568, 754, -149, -1880, -274, + -1203, -43, 1391, 383, 702, 2116, 1299, 1952, + 646, -719, 1735, -986, 100, -956, 1040, 2287, + -1606, 612, 1760, 733, -2453, 531, -14, -1, + -3214, -1993, 371, 227, 45, 2011, -531, 1089, + -1029, 282, -2426, -525, 989, -469, 285, 1787, + 927, -335, 1127, -305, 1143, -412, -1626, 1759, + -2567, -82, 1170, -3051, 1266, 1522, -124, -1935, + 552, 1122, -51, 347, -674, -360, 1183, 223, + 3015, 955, -826, 1108, 2325, 868, 1152, 1079, + 223, 217, -428, 382, 642, -2849, -767, -70, + 407, 147, -392, -407, -55, -508, 1785, -683, + -885, 851, 3879, 471, -674, -231, 1493, 1621, + -1698, 528, 623, 300, 1367, -588, 816, -24, + 600, -182, -841, 854, 370, 715, 116, 714, + -1308, 1435, 1802, -2627, -814, 363, -318, -73, + 850, -1744, 2509, -303, 1077, 660, 2145, 2130, + -730, -88, -115, -517, -154, 160, -337, 27, + 1502, 509, -70, 502, 820, -309, -3740, -1294, + -610, 241, -662, -524, 1319, 456, 926, 958, + -111, -1004, 1795, -604, 1086, 462, -127, -125, + 264, -1093, 1427, 334, 838, 1979, -576, 3052, + -3590, 1607, 356, 728, 1619, -400, 279, 570, + -434, 777, -1448, -888, 156, -277, -1529, 1122, + 2235, -794, 3417, -830, -82, -664, -1837, 946, + -370, 1434, -50, 742, -2368, 1438, 1264, 1172, + -1338, -108, -226, -958, -2130, -2, 917, 896, + 1563, 2181, 2684, 2343, 237, -407, -2685, 1447, + 1028, -728, 109, -620, 478, 46, -542, -789, + -879, -438, 1244, 1075, -1730, 119, -694, 137, +}; + +static const int16_t cb1110sm0[] = { + 916, -269, -44, 343, 623, -2512, -171, -1904, + 1001, 2776, 226, 1487, 705, 763, -616, 288, + -212, -535, 3080, -352, -367, 512, -673, 620, + -874, 769, -956, 460, -601, -2793, -102, -765, + -431, -1369, 149, 481, -49, 109, -412, 670, + -615, 287, 150, 321, -3293, -237, -1627, 188, + 1867, 1481, 353, -134, 2706, 147, 74, -77, + -148, -224, 196, -60, 179, 125, -13, 1011, + -189, -172, 658, 4441, -540, 531, 239, -329, + 2782, 392, 97, -660, 3488, -78, 1308, -574, + -903, -170, -279, 173, -70, 601, -385, 123, + -423, -512, -193, -233, 106, 175, 210, 185, + 489, -236, 153, -670, 25, 61, -196, 213, + 67, 339, 5443, 116, -647, 149, -130, 197, + -11, 305, 2669, 1212, 298, 84, 219, -26, + 2661, 650, 1348, -65, 574, -1482, -268, -30, + 626, 328, 279, -245, 87, 94, -202, 2, + 366, -505, -592, 2, 5666, 384, 22, 227, + 208, -1221, 78, 155, 260, -1111, 165, 396, + -678, -739, 2503, -2395, 2025, 1424, -343, -759, + -837, 101, 55, 274, -481, 22, -568, 1044, + -271, -124, -609, -833, -206, 53, -591, 1150, + -1950, -2875, 1949, 59, -334, -3230, 176, 1133, + -372, 2937, -803, -663, 631, -659, -32, -82, + 851, 113, -60, -625, 556, 177, 112, -753, + -33, 313, -33, -208, -177, -5496, 55, -533, + -815, 123, -755, -215, 638, 223, -156, -917, + -166, -33, 504, 704, -3001, 124, -153, -1809, + -977, -717, 1718, 476, 212, 1661, 953, -1422, + -1014, -94, -524, -2562, -267, 371, 104, -63, + -546, 262, 193, -1714, 261, 1867, 738, -1878, + 400, 1754, -445, -405, -841, -439, 709, 44, + 675, 248, 640, -138, 1217, 393, -1402, 653, + 3110, -938, -2491, -688, 1214, -649, -1356, 2506, + 203, 172, 679, 1003, 772, -3010, 82, -998, + 1011, -980, -28, -138, -430, 614, 427, -341, + 201, -8082, -118, 224, -1167, 195, -920, -352, + -657, 5, 46, -39, -72, 698, -136, -40, + 391, 287, 157, -1197, -60, 2808, -123, 489, + 152, 2318, -805, 958, 98, -1496, -835, -846, + 589, 455, -868, 245, -10, -5047, 12, -50, + 1277, -95, 456, -49, 570, 608, -658, -352, + -277, -268, 214, 388, 1865, 2, 3033, -269, + 259, -75, -3437, 800, -190, 668, -263, -111, + 229, -43, -139, 659, -290, 782, -18, -854, + 271, -2223, 30, -162, 71, 47, 756, -1269, + 336, 863, -1998, -16, 1172, 236, 929, -477, + -2446, -92, -425, -193, -8192, 321, -102, 85, + -85, 108, 318, 149, -27, -182, 69, -237, + 35, 451, -263, -890, -348, -295, 64, 410, + 6427, 569, 604, 543, 38, 31, -15, 148, + 249, -83, -67, 457, -76, -560, 694, -797, + 190, -113, 2006, 136, 1705, -428, 3549, -550, + 70, -3, -147, -288, 1142, -919, 493, -1305, + -460, -151, 831, 623, -768, -211, 31, -296, + 167, -2721, -16, -654, 243, 2555, -311, 1845, + -531, -576, 143, -574, 490, -1089, -2302, 1080, + 701, 472, 2782, 320, -1455, -632, -218, 281, + -1492, -661, -1379, -538, -236, -1928, -502, -565, + -480, 525, -81, 38, 263, 3, 366, 163, + -3140, 882, 189, 1123, 382, -1748, -1210, 371, + -602, 696, -413, -207, 358, -616, 4725, -473, + -784, 249, 621, 764, -265, -1004, -570, 339, + -643, -123, 302, 284, 1, -159, -321, 250, + -297, -43, -3512, -1064, -493, 556, -1184, -263, + 1314, 2028, 1074, 9, 2941, -998, -271, 966, + -754, -2589, 88, 741, -307, 134, 152, -86, + 311, 904, -917, 1199, -5090, 118, 181, -311, + -412, 475, -647, -717, -637, -221, -291, -469, + 77, 946, -1196, -119, -175, 530, -465, 383, + -1253, 589, 826, 835, -3578, -319, -80, 488, + -238, -497, 360, 839, 1870, 762, -1669, -769, + 429, 778, -3121, -325, -55, -128, 2606, -874, + 1043, -902, 1746, -725, 115, 167, 142, 604, + -101, -725, -11, -458, -27, 450, 293, 2, + -383, 23, 172, -6725, 400, -205, 165, 45, + -38, 86, 372, 354, -68, 390, 2444, 521, + 4, -3586, 357, 129, 665, -328, 524, 113, + -446, -514, 1132, 289, -560, 239, 167, -349, + -724, 101, -3165, -3139, -163, -147, 865, -617, + 0, -789, 797, -1026, 432, 359, -460, -105, + 1119, 486, -233, -360, -175, -349, 837, 469, + -250, -521, -4470, -108, 1009, -575, 283, 22, + -555, -682, -234, -249, -33, -106, 521, 515, + -283, -78, 101, -135, -648, 506, 181, 392, + -517, 5405, 442, -106, -8168, 51, -310, -813, + 49, -314, 586, -479, 376, 113, 337, -151, + 245, 270, -1, 619, -312, -37, -215, -482, + -3055, -3261, -346, -493, -357, 306, -160, -21, + 258, 872, -577, -141, 18, -84, 693, 151, + 218, -533, -37, 540, 61, 40, 3150, 157, + -2549, -324, 267, -456, -1236, 798, 517, -224, + -196, 587, -495, 18, 258, 3147, -15, -568, + 957, -444, 637, -354, 828, 1182, -769, -137, + -2130, 408, -1667, 252, 282, 201, 239, 154, + 125, -7882, -332, 198, -47, 265, -289, 358, + -4, 103, -795, 207, 82, 229, 429, 361, + 263, -409, -451, -1036, -3419, 899, -568, -1480, + 898, 284, -53, 179, 975, -1283, 759, -150, + 3244, 408, 2579, -418, -117, 226, 583, 210, + -62, -1513, -148, -820, 1073, 1290, -263, -454, + 653, 555, 286, 218, -105, -135, 231, -892, + -284, 2513, 2715, -1530, -165, -1419, -223, -66, + 525, 1556, -18, -664, -19, 856, 179, 535, + -339, -245, 498, 193, 235, 328, -491, 231, + -5629, 65, -85, 313, -395, 6, 344, 267, + 672, -991, 178, -1335, -64, 9, -1508, -69, + 57, -310, -1793, -850, -3669, 427, -79, -720, + 219, 366, 131, 523, 141, -1055, -66, 13, + -843, -55, -794, 661, 112, -407, -496, 550, + 931, -3938, 1780, -509, -543, -157, -270, -1015, + 564, -231, -854, -3372, -327, 869, -196, -981, + -205, -215, 605, 746, -2188, 2250, 74, -2979, + -242, 832, -190, 365, -1327, 453, 95, 76, + 158, -683, 628, 297, -867, -542, -143, -568, + -414, 6018, -40, -35, -456, -632, -779, -226, + -442, -295, 310, -766, 578, -197, 84, -961, + -3346, -106, 3266, -3, -477, -8, 652, 122, + -606, 49, 34, 686, 385, -258, 214, -572, + -72, -193, 124, 440, 48, 45, 75, 9, + -7724, 200, -364, 578, 318, -461, 84, -233, + 46, -404, 185, 470, -3387, -3397, 374, -519, + -320, -378, 27, 921, -280, 188, -245, -69, + -322, 504, -72, 460, -80, -35, -220, -3098, + -3678, 477, 248, -801, 580, 187, 468, -636, + -364, -432, 183, -82, -79, 266, -787, -740, + 552, 228, 238, 482, -2229, 275, 149, -360, + -350, 2774, 871, -118, 55, -961, -165, 2429, + 982, 313, -502, 3094, -431, 3485, 473, -347, + 171, 544, 253, -324, -50, 464, 116, 650, + 1102, 495, 420, -404, -1, -2991, 4055, 207, + 374, -187, -121, 130, -451, -953, 822, 526, + 287, 120, -979, 376, 594, -79, -130, -362, + -979, 166, 693, -4108, 84, -135, -195, -703, + -1506, -1098, -611, 870, 935, -156, 974, 286, + -86, 83, 2975, -681, 3218, -286, -452, -70, + -113, -395, 137, -1295, -503, 853, 297, -352, + -1004, -117, 476, -431, -2848, -7, 3601, 402, + -534, 312, 86, 1524, -358, -164, -43, 913, + 1003, 239, -364, -88, -468, -672, 220, -211, + -326, -431, 438, -297, 380, 125, -146, 4550, + -271, -831, 768, -1360, -45, 266, -278, -246, + 625, -132, 153, 514, 115, -1311, 707, -361, + -601, -3224, 376, -2107, -259, -1155, 426, -646, +}; + +static const int16_t cb1110sm1[] = { + 360, 3106, -518, 185, -906, 3245, 508, -91, + 938, -1270, -492, 36, 168, -997, -208, 991, + 99, 1553, -294, 204, -22, -108, -2405, 2893, + 49, 72, -490, -529, -218, 1343, -786, 903, + 411, 207, 131, -636, -129, -134, 621, -253, + 319, 135, -234, -75, -293, 46, 207, 5985, + 280, -86, -78, 690, 984, -770, -565, -226, + -242, 374, 26, -696, 81, -277, -9, 639, + -730, 250, -232, -488, -284, 460, -398, 4336, + -303, -266, 546, -292, 2936, 70, 2077, 373, + -141, 292, 2102, 340, -312, -523, -341, 1017, + 457, 224, 315, 271, 1080, 152, 192, 568, + 1014, 155, 85, 329, -5235, 137, -503, 141, + 275, -7, 752, 282, -267, 321, -735, 746, + 489, 450, 478, 432, -152, 451, -1192, 1267, + -341, 1136, 100, -3538, -1551, 1547, -551, 294, + -473, -821, -51, 718, -655, -11, 2817, -26, + 73, -459, -1569, 181, 516, -151, 2846, -112, + 186, 714, -228, -210, -451, 920, -99, -132, + -2662, 589, 3040, 376, 662, -834, 782, 542, + 1485, 538, 3531, 107, 47, 62, 398, -11, + -15, -733, 471, -231, 668, -212, 38, -536, + -1905, 2769, -149, 1623, -3418, 237, 55, -328, + -770, 335, 2755, 340, 62, -466, 267, -946, + 427, 266, 80, 1134, 34, 949, 366, -339, + -112, 3, -105, 442, 5117, 545, -93, 611, + -186, 566, -39, -172, -59, -1120, 388, 703, + 619, -359, -117, -68, 569, 148, -214, -245, + 281, 617, -2337, -88, -255, 124, 3292, 443, + 434, -17, -1157, 3090, -205, -245, -983, 250, + -1086, 643, 1392, 831, 733, -59, -1199, 1747, + -415, 1073, 279, 428, -512, -3392, 0, -6, + 526, 275, -79, 477, 411, 85, 1485, 795, + -209, 495, -2628, 367, -1734, 900, 301, 239, + -53, -2068, 403, 1333, -1304, -566, -1420, -771, + -2300, -15, 842, 342, -2373, 61, -1379, 303, + 733, -108, -316, 94, -477, -254, -211, 807, + 273, -792, 159, -66, -857, 1092, -1001, -69, + -3770, 999, 2418, 854, 173, 2281, -681, 485, + 578, 145, -1245, 845, -375, 219, -259, 374, + 751, 226, -1347, -825, 66, 319, -173, 191, + 445, 284, 62, -8150, -71, 53, 637, -96, + 227, 75, 73, -88, 654, -24, -466, 477, + 671, -125, -942, 104, 248, -151, -383, 11, + 322, 332, 4160, 108, -301, 463, -402, 352, + -1799, 580, 1443, 396, 287, -158, -421, 340, + -349, 109, 61, 47, -2816, -298, -947, -817, + 673, 189, 36, 4069, -584, -335, 2608, 10, + -378, -630, -801, 228, 946, -405, -1186, 473, + 625, -2, -741, 523, 3747, 318, 733, 171, + 268, -2554, 402, -252, -205, 292, -351, 64, + 289, 801, 989, 435, -100, -163, -1215, -467, + 661, -714, 165, -228, -637, 1357, -498, -52, + 488, -3882, 130, -1053, 796, 1040, 381, -729, + 147, 803, 169, 46, -157, 167, -209, 126, + -1016, 88, -1018, -458, -527, 1259, 621, 3847, + -525, 1247, 18, 253, 642, 340, -705, 838, + -2769, -672, 153, 115, 453, 773, 9, -2285, + -291, 6, -219, 628, 284, -330, 568, -240, + -206, -127, 273, 373, 367, -494, 8192, -595, + -255, -158, -326, -60, 513, 334, -667, -549, + -110, 2, 573, 1086, -610, -368, 259, -3611, + -455, 1577, -524, 11, 904, 390, 313, 707, + 2670, -223, 2710, 593, -25, 228, 540, 663, + 740, -1108, 298, 1223, -531, -1978, 248, -661, + -341, -910, -2434, 111, 217, 748, 231, -305, + -419, 1873, 1094, -936, -1741, 1133, 1881, -671, + 41, 268, -1826, 466, 135, 37, -200, 4623, + -1212, -969, 541, 1278, 652, 1061, -759, -747, + -427, -107, -1329, -583, -255, -67, -311, -10, + -421, -8192, 322, -181, -442, 76, 176, -742, + -175, 147, 385, -275, -87, -704, -545, -315, + -414, 569, 81, -387, 628, 2954, -604, -1459, + -29, 1693, 840, -1024, -66, -317, 266, -2465, + -917, -14, 151, -369, 366, -2388, 1, -773, + 1333, -99, 223, -694, -1169, 917, -2496, -1290, + -286, -1007, -508, 734, 451, -256, 266, -105, + -143, 439, -120, -146, 7690, -183, 188, 68, + -385, 7, -278, -24, -66, 292, 137, 143, + 21, -495, -527, -284, 89, -1584, -64, -3664, + 286, -2258, 80, -932, -771, -338, -830, -1029, + -99, -32, -800, 351, -87, 600, -93, 133, + 389, -690, 269, 201, -328, 5489, 558, -702, + -487, 210, 3107, -3628, -96, -388, -169, -221, + 339, 403, -816, -24, 469, -112, 560, 844, + -441, 698, 169, -378, -283, -924, 2842, -479, + -694, -117, -94, 523, 974, 1356, -638, 590, + 820, 2164, 247, -532, 648, -243, -599, -67, + 5686, 174, 78, -608, 230, -172, 369, 342, + -113, 111, -345, -311, 594, 350, -260, -1423, + -425, -407, -1017, -298, -180, -738, -891, 66, + -3312, -1157, 1, 811, -1431, 612, 797, -1344, + -890, -959, 318, 392, -190, 735, 196, -347, + 61, -116, 344, 243, -411, -446, 62, -128, + -3386, 476, 2695, -193, -39, 1960, -7, 909, + -118, -2275, -28, -997, -210, 374, -586, -82, + 914, 323, -73, -2743, 858, -65, 43, -2444, + -246, 145, 78, -638, 844, -2079, 352, -332, + 615, -779, 270, 1799, 680, 500, 686, 1168, + -397, -2233, -31, -163, -18, 602, -232, -915, + -941, 3708, -337, -559, 315, -401, 42, 26, + 316, -100, -191, 36, 206, 214, -3336, -407, + 494, 749, -491, -162, -55, -2902, -1515, -198, + -311, -359, 439, 359, -935, 203, -214, -2401, + -607, -2843, 818, -579, -2066, 388, -514, -912, + 787, 564, 149, -103, -757, 389, 173, -303, + 154, 814, 1631, -393, -2264, 1664, -802, 904, + 541, 784, 1063, 1152, -2510, 297, 84, -154, + 160, -497, -78, 1503, -598, -543, 86, 1683, + -330, 46, -24, -892, 747, -3336, -393, -2268, + 107, 710, 1682, -277, -278, -276, 1253, 327, + -986, 802, 191, -732, 286, -761, 1008, 461, + 1615, -1041, 2127, 2456, 3927, -160, 187, 31, + -101, 3258, 202, -75, 330, 375, -301, -275, + -782, 949, 12, -621, -617, 572, 1007, 414, + -91, -428, -392, -985, -692, -3422, 199, 845, + 91, 418, 290, -983, 721, -1265, 208, 1200, + 91, -758, -2649, -451, -814, -623, -458, 272, + 2777, 809, 1282, 763, 1122, 21, 520, 50, + -1018, 428, 385, 6149, -255, 8, -12, 21, + 20, 293, -315, -446, -423, 549, 428, -56, + -497, 101, 653, -177, -3975, 56, -127, 3214, + 291, -384, -721, 478, -314, -231, -469, -362, + -682, 765, -308, 420, 456, 322, -54, -2, + 10, -239, 6916, -461, -482, -211, -286, -110, + -877, -711, -470, 159, 260, 59, 252, -97, + -2978, -646, -35, 156, -123, 360, 556, -3254, + -475, -313, -268, -1771, -538, 203, 967, 283, + -653, -565, 387, -3097, -255, 25, 295, 264, + -3716, 505, 1024, -315, -215, -222, -780, 660, + 431, -341, -521, 46, 127, -244, -772, -3741, + 190, -335, -17, 2135, 744, -35, 627, -1115, + 681, -343, 123, -1534, -86, -542, -297, -82, + -2772, 3914, -75, 526, 124, -523, -112, 500, + 863, 371, 190, 1036, 141, -1011, 373, 796, + 421, -682, 403, 2924, 3730, 6, 211, -691, + -167, -391, -655, 162, 348, 216, -227, -535, + -147, 367, -189, 331, -191, 159, 49, -4905, + -252, -290, 609, -452, 1042, 1027, -645, -159, + -633, -542, -925, -262, -91, 192, 1266, -2, + -164, 587, 188, 3434, -1014, 2, 1373, 1832, + -1224, -965, 831, -987, 1180, 1389, -925, 48, + -3239, 263, -329, -660, -733, 262, -988, 598, + -2421, 630, 720, -925, -455, 208, 1092, -294, +}; + +static const int16_t cb1616l0[] = { + -15, -7707, 115, 30, -36, -27, -22, -43, + 2, 5, 31, -1, 87, 2, 41, 21, + 270, 16, 3747, -773, 3027, 224, 92, -168, + -7, -62, -79, -44, -9, -4, -58, -78, + 1063, 203, -2, 76, 289, -36, 92, -29, + -78, -148, -5176, 137, 219, 299, 89, -233, + 62, -129, 33, 123, -30, 197, 4018, -37, + -38, 139, 41, 153, 71, -26, 27, 53, + 72, 3358, -68, -122, 293, -19, -355, 104, + 34, 3121, 16, 29, -344, 37, 174, -28, + -43, -102, -59, -1661, 14, 5, -62, -1, + 14, 15, -42, 4, -31, -2, 13, 23, + 957, -419, 20, 31, -14, 51, 24, -46, + 8, -16, 27, -75, -27, -33, -28, 18, + -67, -152, -48, 47, 90, 48, -74, -103, + -18, 4863, 3, 132, 414, -86, -60, 285, + 16, 32, -44, 0, 22, -163, 23, -3, + 23, -61, 13224, 52, -139, -13, 171, 215, + -51, -21, -48, 33, -10, -17, -21, -7662, + -57, -44, -51, 35, 35, 34, 105, 178, + -77, 77, 147, 67, -816, 2913, -3087, 516, + -112, -296, 21, 133, 211, 162, 87, -25, + -535, -830, -12, 46, -59, -10, -4, 42, + 0, -91, -9, 47, -90, -29, 74, 322, + -106, 83, 44, 4693, -788, -73, -85, -105, + -76, -1031, 34, 6, 78, -34, 160, -48, + -707, -12, -9, 39, 14, 23, 88, -2286, + 21, -25, 42, 130, 39, 251, 16, -50, + 397, -226, -2570, 88, -129, -347, 159, 92, + 0, -44, -49, 235, -196, -24, -36, 113, + 13387, 45, 22, 54, -20, 29, 27, -27, + 54, 38, -63, -12, -74, 45, -8, -115, + 591, 46, 5, -234, 57, 124, 86, -3794, + -51, 292, -160, -152, 96, -334, 348, 96, + -186, -3870, -3715, 54, 0, -29, -65, -68, + 6, 132, 47, -155, 62, 26, 66, -10, + -46, -3093, 66, 3633, 183, -171, -132, -24, + 154, 157, 129, -185, 12, -26, 96, -12, + 88, -34, 42, -15, 37, -6625, -27, 13, + 41, -30, 62, 142, -93, -168, 84, -22, + 139, -19, 18, 10590, -111, 36, 13, -44, + 4, -45, -3, -3, 28, -25, -4, 115, + 119, -49, 41, 33, 87, -85, 12444, 73, + 71, -111, 61, -15, 117, 23, -24, -5, + 131, -31, -1, -22, -57, -12, 50, 35, + -1555, -20, 38, 82, -52, 27, -128, -14106, + 808, 190, 89, 595, 63, -291, 282, -48, + 32, -706, -433, -673, 3285, 1311, 830, 3745, + -204, -1185, -584, -51, 952, 1005, -566, 1764, + 186, 1211, -495, -112, 1213, 192, 2320, -43, + -30, 24, -1152, 2, 2, 32, -55, -25, + -2, -17, -14, -6, 22, -54, 32, 45, + 10, -85, -26, -16, -66, -60, -210, -104, + 208, -248, 62, -28, -14552, -11, -44, 1601, + 47, -138, 46, -35, 2647, -81, -3, -38, + -66, -59, -33, -19, 43, -17, -79, 53, + 1821, -1572, 2582, 85, 48, -140, 78, -155, + -173, 96, -32, 121, -58, 201, -174, -54, + 74, -2442, -282, -771, 37, -2930, 15, 1762, + 154, 263, -15, -19, 139, 246, -243, -31, + 84, 145, 8, 152, 43, 128, 679, 1828, + 3476, 17, 92, 102, 258, -29, -275, -39, + -187, 88, 70, 28, 2, 2143, 274, 202, + -67, -13, -22, 68, -35, 135, 114, 108, + 27, 1, -11248, -100, 14, 26, 59, 10, + -24, 30, 1, -38, -9, 21, 18, -1, + 2029, -83, -342, 3443, -25, 7, 0, 54, + 78, 198, 45, 233, -6, 0, -109, -172, + -2250, 41, -79, 2820, 44, 216, 39, 59, + -41, 52, 79, -52, 12, 23, -72, -125, + 83, 17, -28, -32, 13, 2, 28, 0, + -26, 75, -81, 66, 25, -81, 6516, 9, + -93, 49, -4036, -2484, -42, -71, 178, 99, + -133, 79, -41, -112, 57, 66, -28, 13, + 39, 64, -123, 3174, 3061, 259, 55, 123, + -123, 246, -138, 139, 75, 31, -215, -154, + -218, 26, 16, 21, 126, 26, -33, -10, + -15, 16, -20, -53, 21, 15526, -35, -59, + -50, -11, -58, 67, -11, 107, -24, -37, + 8155, 31, -111, -62, 138, -60, -10, 84, + -128, 37, 24, -45, -10, 129, -68, -37, + 42, -80, -205, -79, 5994, -93, -270, -400, + 20, -89, -39, -200, 230, 197, 325, -305, + -294, 94, 3207, 128, 3119, 226, 28, -49, + 264, 186, 8, -29, -13, 27, 22, -63, + 43, 84, -19, 57, -2605, 316, 259, -43, + 50, -2241, 105, -12, -23, -36, 89, 41, + -15, 145, 10, -81, 7, -50, 70, 60, + -23, 55, -62, 0, 52, -77, 180, 74, + 79, -14297, 6, 24, 299, -107, 4, -29, + -3252, -51, 40, -143, 3550, -28, 102, 24, + 215, 147, -169, -60, -43, -486, 5, -1, + 62, -116, -2917, 430, 50, 2927, 139, 127, + 63, -53, 141, -255, -85, 95, -101, -176, + 195, 104, -3066, -56, 3239, -161, -214, 57, + 24, -375, -181, 0, -259, 130, -120, -2, + -6, 175, -147, -185, 68, 219, 425, 2685, + -3120, 266, 246, -270, -70, 273, 168, 121, + -143, 2641, -553, -547, 638, 113, 2965, -161, + 29, -374, 105, -869, 108, 70, 15, 230, + -54, -106, -21, -4, 86, 85, 155, -120, + -17, -21, -2534, 57, 149, -129, 21, -169, + -2289, -127, -19, -26, 3, 60, 35, 1, + -28, -7, 36, -180, -13, 87, -68, 56, + 80, 64, -8, -73, 6691, -32, 47, 48, + -6, 61, 36, -8, -41, -1, 13, 68, + 140, -51, 25, 12, 3, 57, -54, -33, + -19, 12, 28, -60, -56, -2399, -14, 127, + 1935, 84, 127, -193, -3, 3307, -56, 15, + 31, -116, -187, 236, -289, 261, 69, 144, + 1723, 79, -68, 102, 727, 69, 654, -60, + 21, 124, 3497, 248, -684, 1469, 368, -254, + -211, -2600, 771, -138, 368, 3089, 52, -206, + 147, 200, -15, -136, 194, -164, -352, -152, + -4870, 5, 191, -3, -97, 28, -41, 107, + 2, 11, 60, -76, -35, -42, 129, -77, + -2610, -295, -218, -369, 10, 253, 15, -125, + 74, -87, -70, 3366, 115, 240, -106, -93, + 121, 10, 36, 9, -18, -66, -77, 7, + 37, -76, -22, 2913, 242, 22, 172, 102, + 186, -231, 90, -11, -57, 45, -10, -44, + -84, 44, -117, -43, 49, 5585, 18, -166, + -43, 64, 28, -9, 26, -160, 31, -28, + 29, 56, 29, -57, 109, -25, 3140, -131, + 57, -20, 27, -27, -5, -42, -52, 18, + 23, -56, -38, -14, 213, -33, -86, -4741, + -151, -46, 1, -17, 46, 7, -13, 0, + 50, 28, -57, -7291, -20, 12, 66, 214, +}; + +static const int16_t cb1616l1[] = { + -81, 5, -16, 34, 19, 10938, 141, -21, + 27, -105, -110, 32, -67, -75, 19, -138, + 3, -14, -408, -302, 36, -4612, 23, -579, + -35, 19, -312, 35, 120, 97, 82, -109, + 41, -1745, -158, 299, -3069, 84, 18, -447, + -33, 65, -32, 45, -7, 144, 86, 100, + -1738, 250, -226, -137, 159, -45, 134, 438, + 102, 37, -15, -161, -23, 4221, 174, 47, + -264, -182, -182, 686, -248, 89, -41, 80, + -2687, -194, 2552, 407, -1106, -970, -181, -228, + 4395, 118, 1027, -255, 136, 100, -43, 246, + 80, 15, 34, 82, -54, -367, 698, 232, + -177, 45, -67, 49, 138, -158, 168, 202, + 43, -70, -101, 20, -97, -3465, -342, -255, + 127, 25, -52, -5, 7, 76, -3, 19, + -19, 42, 10, -63, 16, 121, 732, -3127, + -43, 116, 36, -2519, 23, 18, 181, 41, + -32, -11, 22, 51, 35, 16, -34, -62, + 1744, 94, 173, -1243, -262, 11, 3218, 239, + 149, -219, 29, 118, -382, -289, -42, 161, + 17, -1, 2551, -83, 90, -128, 138, 3238, + 43, -29, -112, 110, -268, 293, 23, -117, + -64, -137, 79, -70, -10747, -66, 73, 90, + 35, 90, -29, -78, -111, 75, 48, 8, + -169, 2944, 16, 89, 186, -34, 82, 241, + -46, 257, -243, 93, 2966, 178, -256, -18, + -33, 103, -320, -271, 3088, 2893, -250, 102, + 696, 124, -211, 18, -143, 97, 216, -99, + 195, 40, -35, 144, 26, 135, -152, -215, + 120, 25, -254, -1875, 657, 197, -3527, -332, + 310, -11, 1958, 102, -12, -45, 2, -127, + 4, 1, -19, 47, -20, -52, 97, -30, + -7738, 51, 26, 5, -21, 18, 15, 15, + 66, 30, -8, -7, -31, -1, -33, 38, + 164, 90, 6798, -33, -90, -17, -5, 14, + -42, 21, -20, -41, 48, -6, -36, 6, + -207, -4363, 5075, 31, 6, 100, 65, 86, + 19, -158, 28, -134, -91, -68, 9, -26, + -37, 2588, 307, 3467, -451, 101, -441, 323, + 62, 188, -132, -294, 98, -22, 152, -46, + 65, -39, -37, -82, -9, 18, 43, 17, + 8, 56, 97, -11564, 21, 15, 75, 85, + 155, 15, 32, 0, 20, -45, 7412, 48, + 3, 38, 72, 30, 23, 42, -20, -110, + -454, -233, 653, -325, -276, 504, -481, 583, + 270, -649, 481, -3166, 1619, 164, -90, 150, + 32, -96, -47, 49, -13, 115, -183, 75, + 62, -9026, 12, -93, -715, 6, 137, -338, + 810, -39, -277, -108, -20, 315, 572, -3, + -4570, 1053, -132, 13, 388, -223, -355, 31, + -47, 61, -113, 5, -38, 43, -47, -80, + 2550, 27, 247, 277, -86, 336, 139, 146, + -111, -73, 187, -312, 68, -276, 72, 638, + 73, 792, -170, 1383, 421, -703, -3813, 112, + 391, -195, -162, -28, -25, 317, 228, -83, + 4611, 654, 353, -380, -283, -627, -301, 161, + -156, -81, 5, -15, -13, -17, 53, -50, + 36, -66, -7921, -2, -54, -41, -26, 47, + -3, 22, -6, 11, 63, 2, 42, 71, + -50, -87, -39, 2, -56, -2, 11165, 44, + -119, -74, 131, 134, 5, 115, -39, 144, + -23, 0, 186, 4648, 351, 36, -70, -71, + 1706, 2131, -228, 42, 6, 8, 4, -43, + -12, -40, -44, -7, -14, 11, 83, -93, + -144, 186, -46, -9, 13, -87, -120, 70, + -209, 115, -3513, 139, -46, 133, 96, 25, + 215, -35, -437, 126, 403, -115, 145, 203, + -69, -334, 37, 934, -481, 3163, -2528, -49, + 57, 100, 76, 82, 251, 288, -114, 46, + -201, -161, -161, -716, -4080, 378, -830, -254, + 12, -2110, -300, 78, 288, 48, -90, -99, + -31, -110, 201, 66, 327, 119, -180, 148, + 633, 71, -4100, 33, 57, -9, -48, 151, + -20, 72, 71, -11, 39, -67, 176, 27, + 143, 198, 383, 155, 3182, -128, -152, -3209, + -172, -262, -13, 129, -167, -128, 55, 46, + -37, 70, 107, 7, -23, -2082, 241, 236, + -47, -85, 105, -47, -202, 208, 201, 30, + -106, -14, -38, 14, -45, 24, -24, 12083, + 22, 151, -58, -9, 59, 170, 113, -82, + 369, -155, 53, 97, -185, -57, 203, 311, + 236, 4789, -24, -591, -1463, 118, 94, -274, + 3188, -145, -406, 183, 0, -54, 17, -22, + 37, -55, -34, 63, -340, 175, -300, 106, + -190, -38, 67, -2, 19, -46, -42, 11, + -33, -33, -28, -10, -27, -9235, 29, 62, + -927, 1285, 49, 72, 65, 89, 57, -44, + -9, -15, 85, -1, 74, 81, -123, 160, + 69, -2803, -22, 47, -467, -74, 748, 168, + -9, 235, -3155, -154, 48, 483, -341, 74, + 2403, 97, 93, -106, 219, 136, -191, -50, + 7, 71, -103, 261, 3283, -124, -624, -2570, + 73, -31, 10, -73, 30, -15, -2256, -2, + -73, 55, 73, 14, -74, -81, 38, 352, + 108, -18, 25, 61, 54, 1, -5, 109, + 25, -2676, -25, -52, -316, 2, 36, -36, + -355, 40, -19, 120, 27, -4, -51, -8, + 42, -10, -28, -90, -143, 29, -10, -8442, + -22, -566, 59, -39, -1, 27, 29, -20, + 6, 19, 0, -36, 38, 68, -43, 35, + 22, -47, -146, 3567, 13, 12, 3230, -18, + -32, 75, -112, -8, -157, -23, 101, 165, + 198, 93, 383, 1236, 1077, -3592, -1401, 1135, + 844, -266, -74, -70, -280, -98, 67, -109, + 38, -5109, -66, -57, 89, -21, 6, 19, + -21, 70, 60, 76, 35, 18, 44, 51, + 45, 40, 54, -6685, -67, 9, 113, -29, + -10, -96, 80, 98, 103, -40, -8, -20, + -131, 15, 262, 47, -253, -116, -12, -4807, + 2, -81, 76, -46, 37, 353, -130, -191, + -127, -10, -35, 91, -122, 173, -165, -8, + -15179, 86, -186, 123, -295, -25, 21, 63, + -93, 730, 20, -120, -4624, 340, -253, -473, + 44, -18, -99, -37, -54, -317, 65, -52, + 2167, 68, -245, 224, 117, -180, -4695, -276, + 118, 142, -101, 202, -301, -33, -129, -303, + -90, -75, 50, 98, -56, -68, -153, -38, + 168, -278, -22, -64, 9757, -91, -23, 1284, + 53, 56, -11, -46, -1645, 11, 15, 12, + 8, -40, -2, 84, -56, 17, -7, -30, + -4010, -3557, -252, 56, -79, -87, -7, 8, + 79, 16, 21, 51, -63, -22, 118, 228, + -1525, -78, -22, -2, 16, -49, 17, -37, + -3, -14, 10, 31, 17, -111, 32, -144, + -3612, 3473, 79, 23, -89, 74, 33, -29, + 11, -42, -42, -129, -41, 155, 52, 31, + -162, 12609, 147, 17, 68, 2, 15, -12, + -39, 50, -108, -66, 121, 69, -27, 94, +}; + +static const int16_t cb1616s0[] = { + 1213, -1302, -1130, 90, -69, 22, -360, 360, + -55, 453, -705, 4416, 227, 173, -8, 149, + 210, -118, 51, -3759, 949, 2418, -238, 201, + -597, 94, -253, 24, 225, -497, -59, 273, + 576, 651, 608, -483, 335, -125, 256, -2873, + 318, -146, -650, -306, -2021, 1044, 41, -455, + -1120, 832, 978, 212, -463, -209, 12, -275, + -20, 118, 31, 639, 5933, -180, -121, -285, + 65, 212, 439, -135, 538, 116, -302, -245, + 2534, -623, 1549, -34, 727, -1750, 1477, 79, + 1669, -828, 618, -856, 773, -286, 343, -94, + 107, -320, -3144, -380, 694, -80, 843, 103, + -700, -269, 452, -6847, -12, -527, 97, -21, + -76, -246, 2, -104, -68, 98, 312, 117, + -342, 1025, 207, 838, -71, 2463, 60, -1294, + 1549, -1310, -202, -1585, 682, 327, 608, 649, + 664, -801, 588, 137, -468, 286, 234, -6726, + -107, 177, -147, 278, 118, -81, -242, 97, + -235, 1599, -877, 1985, 448, -319, -745, -504, + -433, -1859, -35, 286, -665, -1449, -124, -97, + 930, 2622, 682, 698, 1898, 1120, -323, -142, + -679, 294, -162, -539, -1649, 152, 23, -414, + 1493, 602, 913, 1428, -3212, -103, -330, 557, + 463, 92, 251, 339, 16, 936, -116, 229, + -827, -504, 2015, 1553, -503, -350, 214, 386, + 295, 2697, 429, 72, -705, -120, 427, -139, + -334, -318, -6613, -468, 10, -122, 59, -322, + -165, -144, 45, -427, -12, -79, -202, -266, + 981, -273, 240, -454, -30, -119, 340, 92, + -251, 247, 189, 71, 243, -5648, -601, -434, + -674, 867, -713, -428, -101, -231, 1144, -89, + -10, 57, 302, 154, 362, -425, 2014, 2577, + -8659, 389, -90, 76, 15, 147, 30, -202, + -99, -255, -242, -165, 257, 97, 41, -72, + 263, 613, 272, 400, 5020, -199, -196, -177, + -276, -25, 28, 97, -155, 119, 763, 33, + -3540, -1447, 16, -169, 148, -143, 707, -2483, + 178, 83, -83, 154, -75, -15, 153, 283, + -323, -139, -1390, 69, 725, -1744, 331, -3665, + 415, -514, -366, 124, 660, -295, 180, 77, + -228, 192, 684, -193, 4, 4409, 298, 427, + 591, 290, -159, -166, -372, -514, -1840, -562, + 795, -1765, -349, 1178, -1619, -391, 615, -784, + 1353, 746, -871, -994, 182, -464, -498, -96, + -306, -729, 743, 270, 223, -731, 73, 2692, + 1110, -2354, -328, -21, -172, -339, -528, 93, + -338, 548, 1498, 309, -134, 160, -247, -619, + 1127, 783, -1557, 400, 1035, -445, -155, -2443, + 590, -790, 137, 388, 1188, 844, -395, 1005, + 55, 1141, -122, -3174, 138, 155, -506, 306, + -3255, 2432, -116, -1289, -744, -350, 3, 192, + -156, 95, -552, -57, 329, -405, 737, 138, + -835, 4096, -1037, 797, -417, -418, -507, -694, + -256, 78, -94, -63, -93, 754, -555, -90, + -1518, -878, 167, -392, -100, -78, -80, -45, + 4774, 114, -284, -560, -21, 275, 15, -195, + -1692, -711, -1057, 167, -1555, -690, -263, -267, + 310, -229, -14, -880, 426, -2826, 320, -49, + -1223, -725, 3538, -270, -606, -1812, 481, -703, + 176, -284, -173, 271, 847, 711, 239, 314, + 1233, -61, 477, 429, -691, -156, 6712, 850, + 365, 229, -197, -355, 298, 250, 207, -437, + -1647, -261, 165, 114, 165, 1165, -58, -597, + -3290, -517, -478, -842, -187, -448, -302, -204, + 410, 544, 669, -2012, 476, 434, 214, 698, + 302, 100, 61, 63, -386, 918, 4434, -230, + 157, -1019, -1487, 2239, -774, -234, -378, 772, + -190, 270, -61, -19, 322, 488, 937, -3582, + -415, 2091, 1862, 81, -134, 1285, -2732, 221, + -235, 388, -216, -63, 664, -105, -37, 165, + 899, -373, 284, -375, 286, -263, -295, 276, + -246, 188, 5285, -303, 290, -60, -1, 95, + -703, -288, 74, -717, -127, -53, -422, -452, + 166, -54, -15, 268, 238, -31, -279, -5872, + 863, -907, -101, 885, 552, 442, -2336, -2142, + -804, -147, -791, 1000, 96, 250, -306, 134, + 743, -1648, -867, 673, 1594, 3725, 527, -676, + -661, 238, 262, 560, 277, -58, 444, 166, + -1039, -702, 558, -970, -1763, -1198, 580, 378, + -421, -972, 630, -279, -2456, -1222, -232, -749, + -3325, 174, 789, 729, -487, 583, -157, 1503, + -801, -38, -11, 556, 81, 1508, -140, 74, + 1373, 912, 1471, 4, -1080, -105, -58, -104, + -54, -544, -2392, 1550, 318, -506, -11, -180, + -1891, -230, -259, -1182, -154, 524, -568, 1972, + 546, 469, -720, 1089, -1530, -680, 1349, 429, + 82, -1524, 1894, -90, 188, -145, 15, -1113, + 15, 53, 282, 2212, -736, -941, -1148, -344, + 1473, 344, 392, -333, -556, -480, -3833, 35, + -160, -525, 151, -534, -782, 38, 520, -416, + -384, 7582, -158, -29, 74, -57, -23, 73, + -393, -245, -12, -260, -154, -319, 357, 247, + -306, 351, 273, 755, 227, 89, 283, -152, + 17, 5129, 191, -213, -531, 255, -468, -209, + 1128, 72, -807, 225, -319, 1638, 42, 20, + 935, -52, -326, 541, -1174, 130, 284, -112, + 444, 3959, 262, -631, -262, 275, 1025, 190, + 1125, -265, -95, 265, 35, 270, -92, -30, + -141, 325, -435, 45, -659, 149, 3648, 339, + -1701, -1338, -144, -989, -604, 84, -394, 168, + -302, -1294, -433, -921, 1271, 77, 374, -604, + -230, 97, 206, -138, 2909, 478, 707, 0, + 1242, -340, -1659, 349, 2751, -1175, -146, 1038, + 65, -775, -423, 14, 22, 41, -905, 287, + 280, -933, 195, -1817, 540, -2374, -661, -1102, + 879, 1232, 29, -1683, 286, -136, 658, -395, + -1782, -2823, -624, -223, -299, 2859, -103, -45, + 544, 82, -21, -263, -666, -362, -732, 249, + 1087, -242, 30, 663, -386, -350, 1240, -492, + -868, 69, -41, 35, 30, -1791, 3870, -455, + 1355, 1098, 2933, 347, 361, 79, 2855, -26, + -66, -598, -43, 21, -386, -802, -81, -436, + 846, -673, 377, -326, -1217, 1465, -480, -205, + -2168, -1689, 690, 355, 1192, 734, -113, 39, + -486, -644, 438, 1096, -723, -524, -1634, -621, + -394, 226, 167, -625, -709, 854, 3005, -910, + 13, -793, -1517, -1254, 18, -440, -836, 651, + -31, 229, -1081, -126, -191, -3612, 487, 451, + -292, 943, -2018, -618, -259, -649, -723, -447, + -238, 1096, -2228, 675, 563, -316, -1248, 32, + -28, 293, -1817, 226, 267, 1291, 624, -2279, + 143, 650, 5, -563, -504, -2124, -94, -1613, + -3050, 708, -3458, 442, 30, 65, -80, 89, + 204, -245, 94, 28, -2, -231, 623, -189, + -405, -2147, 1147, 3124, 806, 1048, 1145, 653, + 47, 86, -4, 46, 437, 229, -190, 310, + 1995, -48, -1015, -1806, -266, -941, 361, 179, + 172, 397, 182, 323, -516, 3435, 7, -5, +}; + +static const int16_t cb1616s1[] = { + -2521, -518, 1830, 985, -500, 109, -807, -197, + 543, -1036, 104, 1989, 428, 740, 1110, -366, + 1482, 899, -1828, 159, -3015, -311, -792, -42, + 3, -412, -157, -13, 863, -248, 261, -187, + -409, 156, 772, 271, 318, -262, 78, -571, + 28, 370, 119, 302, -4794, 106, -123, -153, + 1857, -702, 1090, -319, 415, -327, 2124, -170, + -411, 174, 62, -7, 921, -128, 735, -127, + 972, 1678, 166, -1471, -208, -224, 871, -900, + -223, -817, 288, -472, 10, 31, -401, -3201, + -1290, -3, -301, 183, 730, 473, 438, -81, + 882, -64, 2898, -242, 408, -211, -333, -254, + -820, 612, -1128, -60, -73, -2516, 45, 637, + -130, 459, -312, -223, -629, 1490, 1792, -199, + -21, -545, 1772, -1084, -173, 381, 380, 1289, + -117, 483, 138, -1200, -519, 598, -3453, 349, + -3102, 1260, -170, 238, -684, 48, -483, -883, + -879, 139, 298, -110, -203, -955, 195, 57, + -550, 1945, -711, -688, -1470, 1527, 58, 317, + 656, 310, 57, 162, 2006, 1387, 845, -127, + -398, 318, 2520, 2002, -906, -323, -194, 907, + 588, -228, -357, -316, 557, -596, -1559, -3, + 1614, 1317, -1701, 936, -89, -2270, 1327, 1046, + 400, -233, 18, -730, -23, -181, -593, 74, + -570, -969, 432, -261, -833, -90, -4675, 786, + -566, -183, -859, -554, 346, -493, -201, -220, + 241, -919, -1896, 265, -802, 1380, -718, -1103, + -574, 307, 138, -1260, 175, 2540, -82, 58, + 1046, -1381, 2486, 582, 455, 485, -824, -150, + 57, -45, -155, -490, -1108, -2191, 833, 423, + -2011, 267, 779, 140, -28, 57, 94, 6, + -301, 5, -833, -1226, -193, 1110, -63, 79, + -492, -1465, -2733, 444, 56, -1116, -601, 20, + -618, -1315, -695, 1146, -66, 336, -166, 158, + 530, -53, -371, -594, -685, 114, -146, 373, + 174, -1, 47, 119, -124, -121, -6697, -94, + -3544, 1506, 1221, -101, 2160, 558, -254, -728, + 511, 378, -383, 12, 626, 172, 183, 354, + 49, 1669, 1188, 3810, 409, 152, 694, -2520, + 342, 61, -85, -38, -170, 5, 305, 154, + -348, 699, 332, 2542, 673, -1130, -2601, 554, + 1483, 466, 271, 490, -644, 822, -96, 477, + 131, -2051, -111, 43, -31, -62, -767, -3257, + 663, 488, 1823, 522, -525, -249, 481, -7, + -1298, -941, -335, -566, 305, 534, -735, 207, + 709, -3170, 19, -20, -1888, 271, -1697, 117, + 1837, 2690, 305, -483, -463, 407, -706, 467, + 518, 1806, 244, -80, -453, -505, 882, 843, + 1328, -280, 175, 319, -842, 192, -680, -469, + 5440, -205, -187, 53, 332, 204, -184, 96, + 1026, -525, 20, 975, 125, -1562, -1873, -757, + -137, 133, -10, -340, -783, -1484, -2206, 1238, + -5212, -466, 129, -224, 17, 497, -41, 846, + 88, -41, 285, 284, -155, 21, -225, 150, + 223, -807, -444, -1141, -908, 292, -326, 559, + -446, -283, -41, -277, -3479, -667, 532, 83, + 257, 383, -2986, 1685, 697, 777, 1551, -142, + 1786, 579, -531, 787, 712, -984, 603, -174, + -459, 1303, -943, 741, 1103, -73, 600, -403, + -42, -169, -90, 220, 208, 105, -4083, -1069, + 981, -926, 124, 273, -145, -133, 307, 4720, + 209, 324, -79, 12, -41, -220, 211, -184, + 435, 307, -1544, 83, 1565, -445, -217, -648, + -379, -1270, -1590, -2337, -860, 348, 648, -157, + -785, 3318, -123, -138, -412, -876, 358, -173, + -280, -81, -149, -167, -160, -2113, 20, -40, + 1022, 432, -721, 55, -651, 17, -1135, -380, + -542, -1128, 2919, -475, -143, -53, 176, -152, + 7, -29, -172, 174, 195, -8005, 277, 105, + 35, 115, -314, 137, -253, 75, -278, 90, + -1508, 79, -153, -560, 1027, -349, -292, -466, + -1101, -324, -84, 4251, 822, -420, 55, 43, + 1886, 281, 964, 2408, 425, 1187, -27, -84, + -1277, 63, -978, -143, 506, 727, -155, -384, + 3434, 592, -262, -438, -30, 2849, -69, -58, + -181, -87, 20, 299, 412, -263, 702, 131, + -271, -10, 736, 121, -6299, -132, -116, 26, + -253, -586, 32, -145, -251, -12, 471, 135, + 585, 604, 29, 873, 363, -2, -1595, 41, + -1147, -142, 665, -2752, 1302, -358, -134, 29, + -691, -12, -702, -459, 100, 278, 9, 54, + 66, -458, 53, 213, 193, 14, -400, 4870, + -950, -209, 50, 470, 449, 3, -118, 2287, + -469, -58, 126, 1011, -826, 386, -1019, -2390, + -586, -1401, 137, 760, 141, -89, 117, -252, + 3106, -936, -198, 390, 463, -245, -509, -123, + 3057, 1200, 3451, 282, -332, -585, -662, -955, + 165, -276, 73, 373, 202, 506, 356, 125, + 141, -613, -670, 446, 2031, 1521, -446, 1339, + 198, -112, 214, 70, 265, -1310, 2492, -133, + -1880, -347, -961, 312, -3714, -475, 102, 391, + 64, 1091, -686, -101, 144, 447, 173, 66, + -374, 342, 69, -3379, -1331, 1160, -889, -858, + 982, -1613, -223, 57, 186, 428, 226, -477, + 449, -1052, -661, -382, 459, 277, -277, -250, + 12, 4077, -260, -161, -163, 38, 159, 243, + 131, 457, -2253, -301, -1626, 37, 806, 104, + 191, 1899, 346, 398, -1108, -623, -391, 1092, + 1252, 1126, 81, -116, 1192, 674, -1321, -32, + 1739, -708, -230, -844, -507, 415, 261, 211, + -619, -191, 5460, 8, 139, 197, 392, -556, + -215, 66, 64, -808, 0, -136, 151, 156, + 260, 94, 418, -1446, 1815, -540, -793, 451, + -477, 1788, -124, 330, 1638, 342, -503, -384, + -1201, -762, 929, -2886, 888, -63, 318, 598, + 42, -1226, -400, -462, -136, 321, 1872, 376, + 1260, 142, -79, 4377, 9, 294, -71, -190, + -21, -2612, -240, 26, -18, -227, 864, 79, + 2588, -882, 87, -2976, 9, 480, -1573, -170, + -429, 201, -124, 171, 632, -60, -447, 64, + -37, -1182, -86, -105, 2901, -3557, -134, 486, + 141, -259, 239, 465, 467, 1009, -409, 34, + 254, 2469, 1002, 834, 557, -845, 149, -747, + -504, 494, 1382, 1067, 353, 191, -1105, 1705, + -586, 1472, -444, -1303, 198, 602, 471, 468, + 4855, 127, -141, 487, -454, -138, -392, -118, + -491, -948, 58, -290, -7, -662, 229, -268, + -2, -537, -620, -4770, 1152, -173, 166, -69, + 32, -2555, 433, -583, -2219, 1107, 1082, -942, + -173, 399, -601, 250, 423, 125, -448, 352, + -571, -406, 0, 4735, -264, -174, -1020, 1105, + -1149, -171, -252, -130, -202, -74, 601, 601, + 570, -2742, -1403, 3129, -349, 194, 309, 130, + 261, 93, 154, -117, -418, -657, 270, -160, + 1660, -818, 613, -1458, -653, -3763, -232, 90, + -265, -99, -28, -13, -281, -553, 11, -142, + -1764, -4548, 936, -21, -683, -88, -806, -187, + 28, 78, -70, -99, -2, -493, -16, 48, +}; + +static const int16_t cb1616m0[] = { + -3821, -3397, 203, -25, -22, 68, 189, -13, + -286, 94, 18, 288, 29, -5, 3, -414, + 1483, -172, -1275, -180, -3792, 360, 145, -143, + 444, -139, -198, 70, -17, -353, -121, -6, + 76, -50, 2987, 173, -3070, -229, -16, 192, + 134, -55, -86, -200, 128, -2052, -59, -11, + -4, 309, 179, 494, -138, -363, -336, 119, + -127, 2497, -169, -316, -87, -538, 42, -534, + 315, 2364, 61, 269, -87, -94, 82, -2069, + 18, 1238, -7, 79, -9, 41, 70, 50, + 209, -158, -136, 28, -275, 62, 296, 77, + 6269, -184, 73, -19, -25, -57, 134, -52, + 8569, -176, -8, 17, 15, 79, 36, -137, + 12, 44, -270, 2335, 111, 517, -83, 207, + -276, 2577, -198, 83, 376, -75, -273, 62, + 109, 4, -48, 122, -41, 99, -87, 14, + -7696, -118, -66, 171, 96, -31, 123, -217, + -676, -439, 407, 97, -281, 1873, 626, -148, + -548, 1634, 704, 97, -2076, -336, 632, -371, + 113, 544, -88, 184, -2200, -420, -592, -168, + 759, 291, 2215, 704, -140, -145, -4088, 295, + 186, -270, 283, 294, -42, 76, 69, 41, + -140, 1635, -200, -682, 302, -192, 902, -540, + -843, -494, -529, 102, -759, -165, 3160, -180, + -1450, -424, -16, 6, -548, 296, -3056, 219, + -1883, -109, -566, -431, 95, -422, -532, -26, + 120, -46, 23, 174, 175, -369, 110, -2, + 25, 132, -1, -3338, -67, 2140, -25, 566, + -129, 35, 1187, 337, 1999, 2712, -71, 45, + -177, 94, -321, -197, -573, 98, 225, 46, + 53, 78, -40, 82, 23, 2718, 2534, 89, + -65, 77, 206, 343, 527, 102, -191, 94, + 463, 111, -4529, 97, 876, -205, -944, 181, + -132, 467, 366, 85, -302, -100, -33, -76, + -3087, -2546, 215, 277, -52, 352, 137, -45, + 162, 590, 406, 382, 85, -2824, 141, 219, + -3790, 40, 126, 32, 30, 100, 121, -210, + 196, -268, 178, 102, 1229, -80, -750, -11, + -57, 84, 238, 3571, 274, -254, 55, -1616, + -176, -755, 46, -1306, -201, -228, 101, 197, + -93, -156, 319, 82, -385, -17, -4660, 180, + 1278, -113, -215, 103, 832, -233, 412, 249, + -900, -132, -3427, 52, 416, 267, 317, -384, + 130, 78, 91, -360, 75, 386, 2219, -360, + -2975, 17, 286, -294, -213, 231, 131, 821, + -358, 222, -230, -44, -93, -1151, 294, -316, + -8, 129, 231, -993, -58, 3319, 48, -2546, + -213, -14, 3208, 162, -240, -176, 307, -165, + -20, 348, -113, -78, -91, -8, -261, 8033, + -179, 64, -7, -113, -59, -32, -170, 52, + 55, -80, 140, 64, -39, 915, 28, 416, + 38, -2328, 206, 115, 366, -92, 652, 110, + -2838, -59, 613, 23, 109, -151, -198, 185, + 3033, -122, 2863, -273, 86, 41, 114, -99, + 315, 372, 14, 2191, -171, 531, -18, -34, + -352, 130, -360, 117, -2896, 2, -564, 51, + 223, 57, -257, 3161, 3130, -384, 126, -40, + -160, -232, -138, 81, -34, -96, 82, 9, + 62, -161, 344, 100, 790, -243, -344, -393, + -531, 401, 90, 171, 144, -329, 7, -4639, + -135, -6, 351, -21, -195, 224, -25, 6027, + 224, -14, 344, 170, -169, -97, 252, -488, + -379, -73, 629, -9, 266, 152, -64, 330, + -8, 2080, -91, -3315, 229, 25, 45, -528, + -123, 2951, 40, -85, -4, -2695, -38, -112, + 84, -30, 79, 762, 151, -4089, -95, -151, + 9, 138, -206, -3, -2114, 99, -100, 116, + -403, -56, -8, -36, 115, -18, -195, -38, + -240, 8, -32, 122, 125, -7406, 45, -210, + 111, -152, -152, -35, -72, 28, -154, 303, + -3147, 459, -2881, -14, -13, -56, -126, -69, + -213, -97, 202, -88, -277, -557, 451, -376, + -91, 319, 141, 2728, 23, 2506, -101, 632, + 62, -314, 159, 44, 1231, -65, -37, 192, + 3118, -186, -396, -108, 71, 2111, 586, 95, + 15, -28, 176, 20, -67, 3, -265, 101, + -182, -21, -455, -15, -6225, -45, -353, -384, + -22, 113, -40, -47, 57, -73, -503, 134, + 736, -70, -125, -5, -250, 62, 165, 182, + 185, -132, 426, -276, 100, -497, -23, 81, + -112, -3528, -1997, -234, -154, -91, -125, -26, + 179, -611, 655, 767, -1064, 130, -264, 107, + 2811, -1391, 298, -20, 37, -74, -12, -157, + -270, -106, 2559, -89, -3107, 55, 187, -265, + 195, 140, 1, -484, 713, 171, -1123, -226, + 3666, -367, -516, -249, 38, 195, 236, -378, + -383, -205, -72, -7, 15, -9329, -6, -26, + 56, 141, 48, 6, -141, -95, -69, -40, + -99, -80, 73, -253, 456, -174, 51, -250, + -48, -2115, -63, -2555, -25, -2058, -58, 66, + 176, 14, -10053, -23, -39, -37, -15, 38, + 82, 11, 97, 169, 5, -67, 57, 61, + -2248, 108, -19, 256, -169, -122, -336, -431, + -77, -250, -156, -745, 184, 684, 10559, -199, + -34, -37, 96, -82, -17, 60, 65, 21, + -67, -337, 62, 35, 74, -214, 38, 47, + -129, 6139, -139, -57, -154, 261, 7, -127, + 109, 40, 179, -99, 198, -51, 48, -36, + -2377, -194, -334, -2826, 103, -220, -57, 41, + 979, -895, 68, -217, -1712, -430, -98, 91, + -107, -1755, 2615, 84, -500, 231, 480, -31, + 146, -157, -120, 152, 2342, -36, -1969, 57, + -109, 476, -243, 261, -58, 1998, 4, 1388, + -98, 45, -140, 400, -76, -321, -22, -9, + 210, 517, 5, -4708, 66, -330, -405, -19, + 2158, -65, -2163, 244, -16, -192, 494, -381, + -194, 413, 89, 220, 455, -54, 4, 206, + 221, -4998, 63, -365, 354, 364, 677, 207, + -66, -27, -477, -182, 841, 85, -40, 166, + -185, 321, -293, -181, -429, -231, 1401, -122, + 938, 67, -185, 51, 3188, -802, 421, -3230, + 1432, -432, -658, -587, -843, 421, 177, 446, + 510, -140, -90, -127, -78, 2, 1089, -185, + 301, -393, 4100, -152, 265, 224, 25, 95, + 534, 280, -254, -45, -5, -207, 49, -126, + 8922, 43, 9, 21, 28, 21, -42, -84, + 38, 90, -2014, 61, -149, 188, -3350, -120, + -43, 10, 14, 155, -225, -351, -114, 28, + -23, -4400, 367, -51, 76, -89, -113, 122, + 2007, 25, -348, -227, -370, -61, 135, -79, +}; + +static const int16_t cb1616m1[] = { + -321, -7, -6725, -36, 77, -20, -101, -529, + -166, 97, -76, -232, -70, 16, 13, 93, + -50, 222, -258, -4424, -125, 125, 83, 313, + -246, -325, 108, -331, 484, -188, 192, -964, + 2603, -38, -2236, 58, 337, -254, -17, -90, + -88, 40, -141, -1293, -56, -811, 247, -78, + -34, 144, 112, 43, 142, -137, -147, 56, + -406, 12, 210, 132, 3707, 109, -896, -268, + -2295, -509, 32, -219, 113, -104, 141, 273, + 18, -358, 16, -3354, 3474, -167, 220, 10, + 104, -175, -8, -71, -77, -48, 277, 82, + 86, 35, -712, -32, 36, -65, 213, 121, + -76, -742, 291, -4587, -169, -122, -77, -285, + 54, -120, 89, 71, 12, -133, 54, -215, + -1906, -115, 3220, -194, -391, 87, 415, -212, + -210, -138, 182, 590, 713, 944, 320, 142, + -1970, 197, -79, -548, 458, 2836, 33, -62, + -183, -149, -640, 147, -427, -113, -178, -1631, + -108, 2666, -58, 2210, -251, 288, 16, 382, + 2123, 636, -4, 1118, 232, 335, -33, -114, + 24, -68, 1309, -38, 2080, 534, 288, -162, + -630, -360, -643, 10, 62, -2229, 263, 19, + 310, -44, 419, 2846, -2579, -159, -246, 685, + -67, 394, 314, -356, -158, 19, 90, 116, + -2261, 163, 664, 163, -191, -49, -18, -308, + -15, 2508, -370, 693, -62, 818, -307, -658, + 133, 1858, -4900, 53, -2485, -48, -9, 126, + 159, 6, -71, 291, 102, -367, -62, 27, + 88, -6, 204, -65, -725, 31, -159, -1, + -5, 45, -133, -146, 261, -4481, -19, 694, + -261, -478, -177, 88, 214, -836, -14, -762, + -111, 501, 0, 254, 1971, -1024, 2678, -141, + -6064, 76, 430, 160, -195, -582, 280, 580, + 183, -315, -13, 665, -53, 315, -199, 438, + 220, 3267, 194, 2, 2808, -88, 42, 150, + -179, 237, -155, 143, 46, 99, 27, 30, + -6137, -51, -89, 201, 145, -179, 13, -358, + 55, 71, -3, 28, -9, -16, 125, 160, + 159, -21, -5407, -485, -4, -88, -89, 44, + 3, 166, 22, -413, 993, 80, 485, -107, + 446, -943, 1025, 261, -3, 2991, 547, -268, + -109, 536, -10, 187, 17, 388, -120, -71, + -343, -416, 162, 69, -9, 46, -477, 83, + 6134, 146, -236, -125, -94, -55, -274, -231, + 1120, 171, -139, -2714, 80, -111, 20, 2475, + -135, -1710, 317, -762, 155, 1222, 68, 1192, + -15, 1825, -36, -45, -120, -484, -131, -162, + -128, 163, -407, 72, -222, -46, -222, -5319, + 278, -373, -436, 284, 138, -243, -104, 28, + -77, 3022, 93, -15, -581, -498, 292, -165, + -1740, 121, 195, -1368, -134, -68, -20, -75, + -10, 113, 128, -381, -507, -237, -709, 13, + -22, 155, -5065, -95, 246, -226, 193, 687, + 1839, 246, -232, -359, 475, 106, 297, 205, + -2702, -378, -219, -20, 140, -3198, 192, -3077, + -135, -38, -23, 213, -72, 255, -90, -130, + -150, 62, -484, -94, -2625, -89, 344, -129, + 2655, 369, -35, 17, -697, 251, -343, 68, + 53, 176, 3104, 237, -75, -3020, 178, 45, + -86, 45, -115, 183, 49, 26, 140, 77, + 40, -2315, 249, 1791, 48, -755, -12, 201, + -455, -250, -62, 1729, -113, -959, 238, -114, + 289, -135, -2208, 2748, 65, 306, -83, 3, + -513, -481, -49, -163, -568, -88, 668, -51, + -2586, 106, -22, 584, -453, -350, 333, -177, + -236, -657, 536, -349, 394, -56, 14, 133, + -55, -84, 210, -19, -8647, 154, 80, 27, + -7, -76, -117, 100, -201, 1, 296, -101, + -6, 5642, 137, -59, -93, 95, -110, -280, + -61, -300, 25, 887, 43, -30, 2493, 76, + -22, -343, 489, 266, 308, 163, 132, -349, + 2021, 18, 15536, 61, 11, -41, -42, 41, + -4, -183, -40, -24, 26, 241, -102, -115, + -164, 2044, -35, -217, -226, 734, -228, -2546, + 218, 0, 122, -150, -528, -188, -1273, 155, + 107, -33, -37, -293, 6, 112, -155, -228, + 192, -2378, 153, -1045, 213, 2975, 39, -159, + -10, -41, 34, -125, 4, -30, 3907, -41, + 848, -346, 191, -195, -292, -126, 3421, -24, + -244, 92, 693, 64, -193, 192, 121, -33, + -141, 523, -162, 2754, 71, 59, 40, -63, + -142, -100, -338, 379, -136, -64, -196, 11, + 3198, 162, 2097, -132, -2359, -193, -398, -318, + 842, -635, -168, 425, 2001, -136, 290, 206, + 562, -96, -8, -214, -45, -11, 4, 52, + 177, -148, 229, 33, -48, -46, 6538, -106, + -27, -22, 6527, 20, -405, 157, 87, 208, + -117, -4, 30, 87, 28, -356, -76, -108, + -33, -568, -270, 177, 49, -457, -3210, 119, + 103, 256, -180, 211, -1209, -369, -256, 37, + -47, 4976, 84, 207, 225, 224, -425, 396, + 921, 58, -150, 104, 1509, 15, -58, 1724, + 47, -24, 21, 376, 353, 482, -236, 634, + 306, 3179, 73, -33, -54, -169, -214, 146, + 4322, -216, -644, 305, 305, -453, 53, 143, + -9, -1472, -141, 1314, 57, 40, -55, -80, + 67, 9264, 57, 86, 22, -147, 1, -6, + 0, 39, 7, 114, -51, -137, 155, -15, + -122, 5, 137, 125, 213, -6, 7158, 36, + -52, -54, 149, 901, 859, 703, 366, 673, + -13, 1186, 588, -202, -451, 18, -585, -250, + -2632, -134, 61, -3038, 1022, 78, -672, -276, + 96, 838, 533, -254, -525, -106, -378, 1627, + 12, 31, 317, -118, 81, 313, -186, 197, + 452, -2971, 83, 1326, 419, -2366, -328, -87, + -103, -243, -280, 25, -240, 590, -232, 105, + -2966, -2391, -326, 338, 80, -392, -243, 271, + -7, 1127, 1, 1901, -2279, -207, 32, -99, + 560, -193, 371, 494, 506, 255, 332, 10737, + 48, 8, -33, -33, 32, -33, 45, -104, + -259, -99, -37, -134, 72, -50, 138, 428, + -2258, 77, 744, 5, 96, 3020, -269, 49, + 112, -223, 186, 48, 224, 2571, 340, -129, + -39, -1900, -45, 1978, -261, 223, 294, 22, + -108, -58, 109, -31, -3252, -138, -2969, -19, + -133, 190, -36, 132, -136, 63, -175, 351, + -76, 232, -2708, -17, -24, -130, -474, 74, + -2978, 45, -139, -23, 227, -42, -141, 278, + 81, 8, -2491, -446, 315, -64, -167, -643, + -275, 100, 0, 2484, -482, -128, -144, -206, +}; + +static const int16_t cb1616sl0[] = { + -46, -5073, 119, -68, 8, -160, 201, -15, + 55, 44, 44, -197, -110, -83, -90, -66, + -29, -128, 2449, -182, 2226, 298, -69, 189, + -167, 199, -78, 60, -154, -169, -242, 189, + 214, 132, -41, 169, 222, -130, 209, 20, + -154, -327, -3458, 186, 1356, 672, 133, 100, + 375, -491, -52, -87, 153, 537, 2513, -349, + 47, -27, 118, -301, 250, 45, 191, -150, + 279, 2367, -70, 191, -301, -206, -5, -40, + -201, 3680, -67, 36, -341, -133, -197, -383, + -101, 21, -68, -1240, 69, -8, -7, -16, + 28, -47, -145, -169, 32, 170, 246, 149, + 3039, -2617, -42, -95, 184, -74, 71, -56, + -22, -85, -203, 129, 97, -105, -91, -304, + 4, 93, 89, 2724, 2809, -178, 52, -155, + -152, 149, 47, 182, 124, -75, 24, 256, + -38, 53, -135, 63, 70, 59, -59, 7, + 6, 46, 8192, -157, 142, 81, 121, 136, + -87, -147, -71, 59, 57, 119, 21, -1938, + 46, 186, 100, -158, -52, 34, 95, 22, + 20, 179, 112, 116, 234, 2551, -3012, -167, + -93, -379, -90, 24, 208, 257, 253, 23, + -1361, 209, 75, 191, -23, -115, 2024, 264, + 77, -159, 77, -219, -237, -154, 13, 273, + -3338, 122, -205, 3796, -96, 103, -136, -60, + 115, -81, 19, 69, 396, 225, -280, 86, + 329, 284, 505, 403, -37, 203, 310, -2587, + -2374, -241, -17, 492, -42, -32, 261, 112, + 123, -33, -1271, -112, -41, 12, 82, 67, + -71, 56, -10, -83, -28, 15, -12, 42, + 2292, 297, -235, -3, 528, -57, 159, -185, + -54, -84, -152, 775, 15, 54, 451, -294, + 53, -2, 141, 39, -65, 75, 149, -5460, + 17, -58, -126, -281, 264, 151, 362, -98, + 62, -2361, -2560, 173, 42, -290, -161, -96, + -52, 82, 130, -86, -150, 48, 20, -57, + 52, -2263, -96, 2662, -66, 21, 74, -37, + 22, 323, 64, 270, -141, -599, -300, -121, + -12, -128, -96, -3, -129, -4339, -293, -55, + 31, -82, 8, 82, -20, 58, 15, -238, + 140, -125, -98, 7632, -14, 96, -129, -12, + -39, 85, 0, -104, -225, 24, 3, 95, + -87, 115, 168, 19, 22, 95, 8056, 36, + -12, 106, -99, -15, -87, 112, -122, 55, + 14, 282, -31, 80, 42, -4, 81, -73, + 74, -10, 82, 35, 173, -20, -40, -8192, + -35, -386, 270, 263, -231, -142, 42, -445, + 204, 177, -330, -859, 715, 2731, 59, 2578, + 220, -478, 3, 410, -47, 61, -214, 2765, + -206, 174, 56, 427, 442, 118, 2708, -66, + -40, 41, 119, -65, -71, -21, 124, 106, + -18, -2586, -35, 106, -364, 286, -16, -178, + -146, -82, 157, 92, -4, -437, -131, -85, + -27, -90, 23, -58, -5332, 115, -69, -25, + -14, 13, 52, 14, -286, -13, -60, 16, + 19, 53, 35, 7, -21, 7, 231, 48, + 2495, -82, 2836, 44, -134, -76, 33, -394, + 47, -124, -175, 95, 103, 161, 57, -37, + 174, -499, 131, -394, 2007, -2596, -481, 294, + 152, 601, 144, -438, 109, -204, 317, 37, + 362, -153, 216, 269, -39, 1250, 505, 505, + 2571, -115, -595, -806, -998, 1226, -71, 26, + -67, 262, 51, -161, 183, 1622, -32, 233, + 3, -217, 19, -16, 209, 51, 40, -40, + -43, -27, -7227, 13, -128, -18, 82, 154, + 133, -121, 33, -66, 8, -102, 71, 8, + 2780, -43, 79, 3212, -282, -165, 125, 78, + -101, -59, 59, -136, 308, -61, -295, -241, + -29, 27, -326, 2932, -563, 308, -269, -34, + -158, -26, -64, -411, -75, 420, -294, -239, + -11, 429, 44, 36, 69, -200, -56, 279, + 80, -218, -294, -294, 252, 64, 7793, 7, + -155, -56, -3118, -2749, -178, 62, 441, 105, + -45, 23, 23, -101, -109, -26, -149, 566, + -29, -394, -850, 1699, 1986, 243, -665, 565, + 155, -1746, 96, -344, -651, 387, -363, 283, + 241, 101, 71, -18, -9, 43, 114, -22, + 9, -109, -119, -92, 117, 8192, -67, 87, + 174, -42, -195, 527, -155, -195, -167, -1619, + 2638, -824, 121, 44, 138, -808, 407, 584, + -217, -90, -278, 549, -118, -1278, 837, 220, + 142, -956, -294, 89, 2627, 269, -129, 253, + 10, 15, 167, 163, 87, -262, 89, 48, + 14, 24, 2967, -175, 2550, 51, 11, -152, + -111, 230, -267, -79, 321, -641, 507, -32, + -20, -238, 23, -322, -2506, 173, 2205, -91, + -21, -1594, 420, -157, 97, 64, 126, -38, + -84, 10, -85, 93, -21, 272, -427, 30, + -60, 61, -81, -40, 27, 18, -29, -208, + -70, -8192, 16, 15, 53, 34, 49, -26, + -2512, -152, 23, -77, 3015, 87, -164, 247, + 119, 91, 444, -43, -166, -26, 253, -93, + 50, 408, -3274, 913, 104, 119, 17, -54, + 42, 19, -294, -298, -416, -82, 38, -263, + 137, 132, -2609, -44, 2783, -34, -9, 266, + 8, 18, -183, 520, 515, -93, -159, -21, + 186, 27, -89, 137, 77, -60, -33, 34, + -5115, -44, -172, -122, -9, -104, 69, 16, + 94, 2813, -200, -142, -50, 375, 3276, -272, + -44, 47, -41, -188, 263, -237, -24, 312, + 120, -326, 823, 193, 410, -95, 356, 565, + 296, 1202, -2737, -968, 87, -204, -1329, -826, + -827, 584, 194, -31, -12, -109, -39, -7, + 73, 29, 24, -12, 256, -98, -46, 63, + 207, -8, 73, -342, 4578, -37, 60, -66, + 8, -39, -176, -125, -34, 57, -141, -52, + -39, -128, -50, -143, -85, -107, 19, -38, + 74, -40, -161, -54, -63, -3452, 176, 116, + 5274, 19, -42, 198, 3, 33, 80, -99, + -111, 11, -90, 97, -6, -3, -52, 301, + 2335, 148, -171, -88, 44, -404, 124, 4, + -80, 189, 2838, 62, -247, 394, -230, -91, + 92, -2587, 84, -139, -31, 3014, 25, 201, + -137, -64, 383, 2, -70, -115, -210, 43, + -1111, -403, -379, -9, 243, 77, -220, -60, + -38, -15, 7, 109, 41, 143, 56, -211, + -2492, -48, -218, -115, -321, -358, 388, -10, + -172, -52, 177, 2996, -96, 480, -23, -15, + 177, -225, 217, 10, 367, 129, -45, -114, + 23, 257, -48, 2497, 236, 12, 197, 245, + 19, -173, -321, 310, 406, -280, -72, -279, + 73, 3307, 245, 78, -186, 2928, 264, 263, + -227, 50, 172, 91, 293, 24, -148, -245, + -61, 219, -88, 169, 220, -99, 3222, 3, + 0, 103, 19, 116, 69, -180, -7, -49, + 26, -59, -93, -68, 123, 357, 241, -3308, + -297, 198, 40, -80, 285, 161, 90, -46, + -165, -32, 87, -5676, 254, -37, 7, -20, +}; + +static const int16_t cb1616sl1[] = { + 73, 78, -64, 76, 17, 6250, -4, -167, + 52, 4, -3, 11, -189, -19, -136, -220, + 15, 6, -420, -2205, 38, -2944, 16, 118, + -116, 61, 119, -390, 217, 548, 24, 161, + -24, -2342, -148, -159, -2783, 225, 401, -226, + 210, 643, -366, 240, 264, 167, 115, 827, + -39, -161, 30, -173, 42, 29, 98, 377, + -58, -163, -41, 27, 25, 4368, 87, -2836, + -175, -71, -62, -84, -476, 4, 2466, 113, + -2830, -916, 593, 276, -356, -427, -686, -215, + 2752, 395, -9, -345, 117, -122, -327, 92, + 107, -106, 32, 270, 271, 171, 3138, 198, + -46, -70, 46, 502, 91, 77, -19, 216, + 94, 122, -64, -392, -31, -2696, -364, -131, + -315, 129, -461, 229, 192, 236, 185, -263, + -173, 44, 24, -267, -40, -177, -149, -2471, + 26, 113, -183, -1693, -188, 48, 22, -73, + 50, -133, 58, -70, -173, -308, -442, -188, + 92, 389, -35, 167, 235, 66, 2593, 2435, + 244, 630, -22, 235, 112, -32, 533, -158, + 81, 71, 44, -59, -158, -23, 28, 8192, + -58, -181, 39, 220, -54, -124, -59, -277, + 71, 41, -82, -157, -6860, -4, 44, -84, + -48, 134, -193, 159, -45, 218, -47, -133, + 147, 1749, 765, -84, 184, -317, -286, -17, + -340, -262, -244, -21, 3122, 290, -127, -119, + 179, -128, -125, -439, 2766, 1917, 85, 57, + -32, 373, -16, 170, -74, 31, 425, 626, + 1, -511, 64, 387, 142, -621, 183, -224, + 220, 1195, 386, -3360, 332, 484, -1112, -96, + 187, 43, 1838, 39, -36, 13, -132, -8, + -1, -43, 29, -132, -19, 10, 10, -218, + -3659, 119, -103, -27, -29, -108, 13, 181, + 39, -117, 92, 37, -17, -198, 330, 538, + 17, 113, 4758, 1, 28, -10, 87, 22, + 96, -14, -99, -56, -130, 0, -55, 45, + -63, -2845, 2751, 464, -31, -62, 76, -154, + 88, 81, 125, 373, -348, 587, -314, -278, + -53, 2039, -516, 2437, 191, -212, 87, -2, + 181, -242, 117, 23, -63, 334, 145, 454, + 343, -235, 91, 69, -8, 2, -106, -108, + -5, 137, -168, -7818, -231, 25, 37, 75, + -138, 56, 142, -596, 130, -114, 3293, -366, + 290, 160, -2, -219, 83, 843, -18, 1289, + -177, 226, 667, 252, -683, 816, 26, 157, + 168, -487, -49, -3282, 432, 184, 1207, 23, + 164, 544, 965, -1, 61, -118, 92, 1359, + 89, -3234, 15, 496, 244, 177, -613, -160, + -23, -195, -111, -372, -115, 278, 96, 77, + -2567, 49, -423, -468, 13, -484, 1345, -298, + 194, -123, -248, -139, 738, 102, 1154, -335, + 2694, 1326, 213, 758, 17, 154, 609, -518, + -367, 201, -144, 61, 66, 2288, 50, 2688, + -87, 45, -13, -101, 127, -190, -40, -286, + 6, 121, 32, 31, 119, -85, 28, 93, + 8192, 273, 169, 44, 37, 255, -224, 219, + -34, -127, -134, 165, 169, 126, -188, -52, + 98, 15, -5820, -193, -331, -395, -1, 49, + -187, 55, -121, -196, 114, 10, 258, -145, + -14, -385, 105, -187, 59, 383, 5322, 147, + -110, -69, 378, 138, -352, -69, 15, -267, + 75, 162, -6, 3148, 515, 231, -74, -436, + 1288, 1234, -105, 68, -96, -166, -49, -64, + 144, -67, 135, 258, -71, -162, 156, -366, + -7, -67, -133, -20, -119, 71, -84, 31, + 26, 116, -2237, 212, 43, 380, -74, 13, + -7, 774, -1276, -103, -124, -48, -178, -319, + 26, 435, -111, 858, 295, 1601, -2727, -242, + 8, 36, -61, -20, -19, -19, 31, 258, + 21, -14, 381, -153, -8192, -99, 327, 72, + 175, -1181, -271, 104, -30, -135, -169, 21, + 29, -182, -25, 125, 165, -82, 73, -26, + 2311, -85, -2983, -125, 85, -206, -100, -100, + 36, -3, -77, -180, 35, 0, -170, 123, + 168, -302, 366, -334, 2936, -70, 404, -2870, + 13, 79, 226, -163, -242, -124, -40, -171, + -109, 189, 20, -52, 144, -1869, -88, 230, + -8, -27, 45, 131, -11, -188, 93, -227, + -452, -229, 158, 377, -9, -1736, 16, 3268, + -164, 41, 305, -414, -642, -111, -100, 118, + -155, -236, 936, -114, 51, 31, 60, 1299, + 5, 3048, 274, 273, -197, -289, -245, -288, + 1927, -7, 27, 307, 174, -243, -95, -134, + 14, 24, -119, -132, -2811, -254, 35, 95, + 22, 135, 21, -155, -80, -143, -60, -6, + 182, 77, 11, -197, -8, -6080, 28, 155, + 11, -27, 22, -48, -8, -50, -122, 11, + -34, 342, -1, 40, -208, 117, -35, -69, + 150, -3944, -425, 46, 456, 182, -451, -219, + 38, 15, -203, 766, -232, 243, -70, 179, + 2107, -222, 346, -166, 143, 239, 245, 59, + -137, 17, 475, -68, 2679, -423, 20, -313, + 74, 152, 171, -269, 68, 39, -4743, 94, + -3, 110, 134, -168, 73, 180, -116, 276, + -74, -203, 2, -83, 17, 170, 96, 169, + 75, -5541, 46, 20, -168, -22, 35, -74, + 104, -153, 264, 4, -57, 94, -192, 161, + 15, 7, 45, -186, 15, -125, 121, -4981, + -254, 179, 282, 72, 543, -97, 363, -5, + -67, -389, -66, 178, 427, -276, -2675, 447, + -2, -125, -223, 2869, -502, 117, 2017, -71, + 41, 9, 124, 19, 357, -562, 25, -385, + 80, -53, -175, 2532, -73, -2990, -164, 57, + -128, -254, 53, -150, -180, 16, -45, 322, + 266, -2418, -264, 317, 371, 5, 197, 7, + -2476, -93, 152, 90, -165, 11, -259, -24, + -55, -16, 98, -4904, -116, 53, 205, -45, + -57, 116, 75, 161, -55, 97, -292, 27, + -1396, 105, -127, 133, -265, -33, 5, -3622, + 25, -3, -104, 8, -283, -229, 236, -208, + 145, 627, -240, 118, 296, 108, -309, 48, + -3345, 582, 498, 259, 20, 785, -138, 421, + 97, 370, 161, 141, -2793, 106, -246, -140, + -172, 42, -194, -202, -319, -107, -24, 423, + 7293, -109, -13, -242, 55, 171, 13, -93, + 131, -141, 88, 132, 76, 176, 78, 153, + -63, -55, -410, -39, 6, 27, -223, -174, + 61, 645, 167, -35, 3079, -173, 950, 1, + -109, -118, -106, 15, -1345, -14, 50, -70, + -69, 24, 109, 182, 84, 31, -179, -93, + -3152, -3013, -60, 56, -60, 58, 166, -161, + 24, 129, 1, 181, 128, -12, 273, -43, + -1256, 134, 159, -36, 175, 43, -49, 41, + 48, -38, -45, 59, -36, -82, 48, -74, + -104, 2944, -124, -24, 98, 248, -146, -231, + -241, 72, -114, 776, -498, 242, -357, 250, + -102, 7121, 109, 11, 94, -53, 37, -37, + -133, 24, -157, 47, -46, -69, 62, -79, +}; + +static const int16_t cb1616ss0[] = { + 1401, 373, -516, 330, -711, -752, -475, -224, + 139, 492, -556, 4629, 1039, 333, 872, -542, + 474, -360, -378, -3459, 254, 1199, 113, -525, + -1705, 231, 46, 188, -50, -1038, 32, -198, + -109, 619, 1071, -1601, 1002, -411, -189, -3276, + 615, -468, -467, -275, -1286, 736, 541, -1107, + 423, 191, 439, -205, 17, -87, 500, 176, + 262, -341, -142, 268, 8164, -2, 112, -190, + 227, -50, -143, -326, 647, 601, 482, 443, + 2761, -497, 979, -298, 454, -2927, 746, -735, + 3921, 480, -167, -317, 1303, 111, 216, -961, + 110, -595, 244, 246, -222, -205, 46, 61, + -798, 258, 360, -7038, -654, -95, 75, 498, + -24, -250, 71, 138, 527, 240, -215, 250, + -408, 552, -325, 333, -989, 2648, -483, -1121, + 2344, -1647, -116, -901, 615, 327, 1, 497, + 411, -138, 332, 281, -145, 337, 163, -7379, + 70, 265, 365, 238, 604, 99, -149, 233, + 109, 827, -704, 1367, 1208, -717, -17, -223, + 15, -3259, 53, -485, -631, 285, 511, -8, + 242, 547, 129, 145, 2046, 520, 44, -177, + 382, 283, -169, -346, -2737, 294, -1311, 145, + 1873, 815, 1078, 677, -3419, -434, 484, 144, + -27, 669, 153, -242, -242, 814, 350, 361, + -462, -63, 2317, 1259, -373, -489, -534, 300, + 867, 2621, -117, -168, -414, -239, 812, 840, + 112, -463, -6286, -693, -830, 140, -168, 448, + 549, -149, 418, -105, 137, 31, -40, -43, + 422, -99, 297, 3, -220, -15, 81, 45, + -647, -535, -448, -731, 250, -6742, -320, -350, + -192, 1540, -1112, -1043, 1317, -1203, 1035, -506, + 673, 721, 854, -1487, 780, -294, 1173, 2142, + -8192, -170, -138, -54, -54, -233, -127, 145, + -233, -185, 87, 20, 530, -305, 141, -394, + 310, 40, 645, 809, 4801, -186, -432, -451, + 312, -144, -65, 65, 135, -64, -15, -357, + -3546, -1299, 216, 249, 261, -207, 117, -3138, + 527, 14, -142, 286, 100, 340, 581, 157, + 234, 739, -2521, -3, 639, -1440, 131, -3796, + 159, 39, 41, -659, 284, 165, 1100, -346, + -481, 295, 806, -227, -288, 4520, 253, 487, + -252, 88, -43, -1612, -5, -57, -66, 18, + 19, 557, -337, 1526, -2897, 144, 844, -404, + 1976, 787, 246, 264, -406, 778, -918, 51, + -113, -235, 518, 602, -307, -2046, -692, 2775, + 400, -2165, -184, 139, 403, -1855, -1317, 289, + 710, 1124, 1888, -517, 276, 190, 637, -441, + 717, 972, -370, 478, 626, -354, 241, -3651, + 145, 7, -738, 397, 991, -343, -826, 142, + 672, 2425, -616, -3278, 751, -193, -944, -35, + -1061, 1258, 631, -721, 145, -112, -69, 828, + -39, -196, -237, -73, 771, -195, 239, -533, + -1673, 3477, -559, 104, -647, -798, 167, -497, + -559, 591, 259, 300, -25, 422, 93, 39, + -63, 233, 144, -1170, 142, -456, 73, 411, + 6920, -338, -307, 436, 143, 420, 152, -9, + -1788, -1096, -2998, -727, -524, 128, 460, 782, + -102, -576, -138, -976, 1035, -3196, -436, -27, + -1047, -1389, 3244, -143, -883, -1012, 4, 327, + 16, 411, -497, 1444, 516, 1183, 252, 510, + -698, -676, 569, -70, -397, -227, 7829, 312, + -410, 20, 41, -65, -219, 175, 297, 40, + -1534, -498, 194, 871, 409, 280, 1098, -1471, + -2825, 931, -105, -545, -801, -795, -372, 73, + 331, 100, 488, -2101, 560, 44, 885, 1065, + 380, -195, 276, 124, -87, 193, 3979, 30, + 95, -509, -931, 2737, -457, 805, 10, 53, + -73, -203, -587, -177, 242, 238, 656, -3403, + -380, 2364, 2902, -226, 204, 1559, -2219, -40, + -442, 111, -703, -424, -252, -241, 461, 749, + 658, -481, 125, -366, 601, -246, -286, 132, + 297, -232, 5231, -141, 196, -121, -235, 406, + -199, -174, 87, -107, 363, 272, -563, -620, + 235, 223, -627, -339, -467, 349, -1596, -5496, + 644, -96, -81, 1938, 749, -160, -1976, -1436, + -1056, -1045, -1098, 2327, 976, -57, -124, 1139, + 275, -209, -636, 298, 2484, 2764, 962, -39, + 108, -718, -442, 9, 797, 1123, 1092, 1179, + -1170, -701, -381, -237, -1266, -1045, -337, -351, + -274, -981, -272, -111, -3409, -387, 421, -406, + -2123, 623, -18, 2473, 617, 176, 26, 1402, + -1351, 212, 23, -172, 296, 1572, -63, -402, + 837, -521, 2209, -613, -329, -309, -180, -1152, + -535, -1380, -2617, 475, 385, -672, 182, 92, + -2211, 320, 109, -633, -582, 1208, -1536, 1009, + 896, 1991, -374, 1750, -1259, -341, 1774, 1063, + 678, -2084, 987, -337, 48, -205, -82, -288, + 388, 217, 1263, 2427, -1472, -1073, -964, -836, + 2086, -161, 438, -449, -37, -926, -3706, 164, + -372, -616, 160, -572, -725, 727, 11, 53, + -84, 7494, -74, 523, -172, 464, 452, -426, + 803, 106, -262, 32, 298, -491, -181, -760, + -908, 303, 747, 1316, 272, 906, 767, 105, + 247, 6120, 948, -557, -928, -595, -342, -450, + 686, -815, -1243, -157, 572, 1414, 166, -229, + 3317, 1940, -283, 623, -781, 717, -212, -707, + 30, 3635, 1147, -696, -928, -637, 925, 797, + 843, -1359, 214, 1096, 1031, 852, -84, -228, + -34, 1067, -1109, 392, 292, -755, 3495, -40, + -1806, -637, -236, -602, -264, -147, -68, -233, + -55, -2005, -271, -647, 963, 309, -5, 56, + -275, -398, 34, -496, 2556, 1249, -87, -112, + 1663, -554, -1926, 627, 2515, -1128, -566, 1539, + 740, 38, -614, 272, -232, -152, -782, -420, + -304, -2313, -33, -944, -77, -3468, -69, -1730, + -21, 665, -314, -1640, 660, 661, 106, -21, + -1505, -2888, -427, -866, -666, 3128, 786, -55, + 739, 112, 8, 567, -602, -350, 165, 108, + 767, 64, -715, 980, 673, -186, 768, -545, + -298, -233, -524, -70, 511, -2051, 3816, -1104, + 529, 1012, 2577, 777, 342, -387, 2730, 247, + -20, -227, -432, -263, -885, -1192, -644, -259, + 2314, 38, 108, 614, -386, 470, -78, 681, + -3334, -1049, -300, 177, -174, -422, 110, -641, + -406, -472, 468, 885, -730, -877, -1972, -1372, + -410, 545, 543, -800, -1156, 279, 3290, -1305, + -213, -262, -832, -994, -1110, 718, -364, 1416, + -7, 963, 452, 680, 165, -3815, 903, 806, + 149, 11, -1332, -622, -451, 152, -618, -309, + 246, 435, -2098, 487, 469, -451, -1574, -204, + -187, 552, -333, 515, -331, 1452, 278, -2691, + -146, 1009, 353, -839, 6, -3206, -1080, -572, + -2698, 752, -1726, -318, 397, -152, -128, -77, + -36, -506, 456, 1094, 281, -158, -19, -149, + 48, -2831, 2042, 2545, -161, 619, 1129, 274, + 24, 1, 313, -164, 655, 157, 770, 182, + 1942, 241, -898, -1748, -589, 256, 322, 683, + -65, -73, 621, 74, -317, 2585, 185, -465, +}; + +static const int16_t cb1616ss1[] = { + -3218, -607, 1665, 1100, -563, 421, 377, 445, + -270, -3, -1503, 224, -593, -316, 31, 362, + 1186, 389, -1817, 589, -2842, 289, -1925, -356, + -228, -148, 618, 135, 358, 238, 1, -767, + -266, 1, 101, 245, 231, -167, 408, 1, + 162, -35, 241, 215, -4702, 486, 546, -339, + 349, -292, 1342, -881, 184, -675, 2639, -284, + -995, 346, -499, 1499, 1616, 578, 445, -78, + 844, 1800, -686, -414, -1425, 795, 754, -1418, + -178, -2226, 515, -143, 43, 569, 967, -2333, + -1991, 282, 528, 1410, -377, 736, 394, -230, + -365, -242, 2773, 136, -738, -36, -1171, -76, + -132, -300, -223, -680, -416, -2738, 93, 414, + 490, -346, 75, -1089, -1132, 2237, 1844, 395, + 325, -1514, 1913, -1850, 1162, -442, 689, -66, + -71, -83, 342, -197, -940, 206, -3381, -1275, + -423, -87, -455, 498, 865, 355, 1225, -115, + -3333, -404, -588, 1021, -2180, -1470, 1225, 728, + 59, 2592, -335, 194, -649, 3586, -951, -142, + -947, 898, -99, -269, 977, 1520, 488, -364, + -253, 127, 2524, 849, -1166, -191, 627, 372, + 772, 145, -21, 279, 402, -863, -2695, 1217, + 1543, 1005, -1419, 1712, 110, -2191, 969, 1563, + 183, 811, -218, -1078, -220, -1092, -322, 803, + -533, -359, 405, -70, -771, -267, -4730, 235, + -607, -387, -285, -68, 48, -60, -222, 229, + -1087, -1261, -2249, 1265, -1624, 864, -65, 223, + -322, 337, -262, -3170, -12, 4571, 19, 198, + 458, -1029, 2560, -3, -115, 619, -645, -836, + -399, 246, -81, -12, -1057, -2119, 2780, 25, + -1559, 291, 592, -513, 62, 157, 553, 570, + -657, 72, -118, -284, -454, 3853, 145, 259, + -1709, -2161, -3167, 189, -233, -1099, 141, 114, + -506, -1012, -775, 474, 331, 798, 469, 1915, + 96, -266, -385, -329, -658, 192, 16, 97, + -47, 284, -163, 200, 189, 18, -7453, 160, + -2988, 2725, 520, -132, 2593, 627, -694, -26, + -558, 44, -209, 40, 377, 491, -68, 384, + 271, 2117, 642, 3166, -569, 702, 513, -1858, + 108, 944, 248, 166, 681, 408, -908, 525, + -145, 1035, 189, 2812, 135, -356, -2551, 401, + 150, -508, -265, 244, 461, 958, -233, -204, + 744, -1603, 397, -229, -174, 539, -139, -4473, + 837, -310, 253, -635, 397, -80, 601, -371, + -2015, -261, -364, 50, 331, 89, -938, 709, + 1444, -2910, -228, -162, 419, 62, -319, -266, + 584, 3728, 57, 220, -543, 768, -630, 361, + 361, 642, -313, 182, -488, -48, 3001, -397, + 640, 179, 8, 1081, -1161, -58, -70, -64, + 4456, 323, 883, -191, -16, 61, 419, 429, + 627, -898, -883, 750, 499, -1335, -467, -1410, + -5, 283, -301, 276, -1636, 310, 114, -428, + -8192, 12, -114, 74, 215, 511, 317, -314, + -86, 198, 138, 315, -271, 246, -363, 426, + 608, -714, 367, -1356, -2217, 1178, -385, 1442, + 28, -642, -371, -87, -2895, -710, 303, -150, + -398, -868, -1727, 1548, 982, 1177, 332, -377, + 1580, 962, -1028, 1922, 1494, -824, 93, -1362, + -552, 1641, -1729, 228, 1054, 421, -185, -536, + 51, 87, -204, 88, -847, -754, -3761, -2706, + -138, -1242, 35, 64, 418, -460, 713, 3960, + 733, 468, -150, -823, -211, -674, 366, -269, + 180, -294, -384, 604, 1829, -121, 271, 241, + 192, -211, -2672, -1483, -1102, 960, 90, 49, + -1144, 2552, -887, -32, -301, 62, -183, 193, + 78, -781, 193, -606, -285, -3082, 240, 392, + 704, 20, -1103, -195, 166, 577, -105, -45, + -310, -106, 3035, 28, -369, 725, 53, 87, + -232, -191, 7, -282, -572, -8192, 325, 99, + 162, -113, -237, -209, 412, -573, 295, -389, + -1603, -66, -485, -867, 466, -882, 862, -216, + 221, 50, -51, 3927, 557, 441, 223, 234, + 4048, -173, 420, 1670, 436, 341, 175, -441, + -201, 75, -549, 315, 172, 418, -159, 7, + 2973, -3, -220, -1360, 26, 2781, 132, 295, + -15, 217, -166, 187, -282, 357, -121, 480, + -216, 294, 263, 95, -7367, 589, -63, -412, + -103, -201, 335, -96, -203, 240, 223, -435, + 366, -467, 118, 528, -472, -559, -417, -189, + -641, 339, 1546, -2741, 1413, -265, 637, -1556, + -49, 422, -195, 392, -21, 3, -2, 282, + -130, -272, -483, -860, -675, 762, -1455, 5212, + 178, 197, -468, 270, -310, 1038, 406, 2699, + -537, -33, 272, 225, -1986, 1295, -857, -2906, + -904, -1861, -206, 866, -145, -207, 252, -825, + 3051, -1361, -441, 85, -186, -127, 139, 285, + 3067, -332, 1163, 248, -483, -177, 268, 691, + 733, -104, -54, 2541, -1042, -226, 165, 250, + 7, -259, -383, 327, 2164, 2272, -750, 2482, + -930, -139, 1203, 766, 150, 320, 970, 28, + -1351, 467, 544, 521, -2908, -75, -902, 611, + 575, 1216, -209, -7, 541, 330, 528, 347, + -185, -306, -432, -3384, -1844, -380, 155, -1230, + 629, -1085, -413, 119, 114, 1093, 198, 806, + 491, -137, -518, 536, -64, 387, -1712, 608, + -24, 4961, 149, 299, -342, 505, 503, -387, + -944, -297, -2423, -98, -1027, -432, -259, 736, + 127, 3561, -473, -623, -751, 114, -438, 657, + 2448, 863, -413, -81, 2066, 988, -539, -528, + -111, 314, 390, -1228, -863, 19, 763, 2227, + -844, -24, 4164, 139, 130, -111, -630, -428, + 538, -606, 940, -877, 122, 526, 194, -104, + 127, 117, 907, -789, 2865, 526, -548, -253, + 289, 2329, 176, -70, 775, 681, 21, 38, + -1481, 766, 2093, -2974, -289, -571, -445, 1833, + 333, -84, -243, -413, 188, -492, -22, -867, + 605, -333, 904, 3192, -29, 491, -411, 370, + -556, -2671, -294, 132, -243, -233, 180, 181, + 383, -79, 26, -3539, 642, 1127, -2125, -170, + -386, -135, -703, -290, -157, -444, -885, -341, + -920, 460, -407, -176, 3153, -3084, -505, 543, + 7, 79, 1191, 1148, -401, -17, 289, -735, + 300, 1971, 626, -146, 110, -1281, -613, -649, + -206, 1850, 701, 1138, -803, 742, -1392, 147, + 554, 1861, -658, -1481, 108, 856, 1021, 574, + 3314, 518, -1156, -307, 42, -92, -132, 278, + -352, -37, 35, 146, -93, -662, 216, 125, + 823, -876, -170, -5027, 444, -182, 844, 189, + -490, -1441, -335, -907, -173, 1138, -472, -1505, + -1641, 648, 66, 627, 64, -1096, -620, 1588, + -506, 309, -100, 5702, -555, -157, -179, -85, + -299, -114, -20, 178, 415, 118, -581, -132, + 1025, -2631, -1154, 2623, -286, 201, 340, 949, + 235, 171, 649, 328, 397, -142, 1369, -7, + 2305, -373, 658, -1681, -744, -3574, 34, -183, + -504, 165, 81, 21, 635, -307, 428, -520, + 164, -4701, 744, 249, -844, -7, -334, 38, + 539, 267, -213, 73, 134, -251, -248, -923, +}; + +static const int16_t cb1616sm0[] = { + -4119, -2861, -76, -49, -192, -542, 0, 94, + -550, 6, 601, 236, -446, -202, 167, 238, + 2609, -688, -406, 265, -3078, 321, 59, -601, + 157, 200, -265, 78, -699, -679, 18, -54, + 203, -687, 2683, -111, -3037, -627, -493, 413, + -480, 54, 75, 276, 206, -1861, 17, -420, + -169, 312, 361, -277, -12, -363, -592, 758, + -123, 3267, 78, -862, 81, -356, 596, -536, + 729, 2239, -49, 553, 112, 444, 652, -2990, + -70, 1084, -436, 34, 53, -10, -23, 41, + -3, -126, 207, -130, -208, 63, 480, 191, + 6229, -45, -33, -82, 35, 56, 259, 1, + 8034, -97, 52, -159, -334, -41, 50, -57, + 56, -194, -567, 2050, 146, 987, -383, 416, + -258, 2846, 51, 8, 690, -126, -704, 316, + 16, -4, -90, 159, 34, 126, 65, 218, + -7037, -261, -87, -21, -185, 14, 112, 42, + -164, 274, -269, 1138, -208, 574, 589, -143, + -479, 2745, 782, -13, -2492, -132, 498, -406, + 260, 828, -580, 558, -2861, -600, -447, -313, + 1316, 800, 1772, 1131, 323, -48, -3972, 697, + 5, -403, 46, 95, 130, 84, -39, 219, + 117, 1629, -189, -1371, 25, -116, 2311, -681, + -411, -685, -1340, -409, 223, -462, 2530, -816, + -1118, 314, -893, -109, -262, 376, -2795, -48, + -2878, -6, 180, 53, -500, -181, 125, -291, + -265, -154, -23, -184, 185, -563, -1159, 675, + 24, -213, 273, -2905, -242, 2373, -6, -166, + 92, 276, 1375, -28, 1879, 2572, 205, -121, + 51, 356, -873, -308, -1060, 952, 719, 456, + 106, 116, -107, -211, -21, 3319, 2109, -172, + -172, 143, -718, -138, 1135, 232, -1361, 157, + -99, 522, -4367, 84, 605, 319, -937, -397, + 117, -434, 82, 633, 274, -1555, -221, -59, + -2419, -2486, -112, 136, -182, -480, 27, -548, + -237, 817, 530, 656, 252, -2685, -26, 703, + -3268, 381, -383, -323, 105, -500, 66, -299, + -1056, -363, -69, 21, 292, 398, -379, -106, + -356, 38, 169, 2866, 206, -523, -277, -2875, + -582, -69, 649, -3, 198, -30, 98, 145, + -125, -186, -19, -107, -102, -173, -7299, -62, + -503, -231, 24, 145, 1367, -355, -175, 373, + -953, -704, -3454, 170, 899, 386, 592, -754, + 620, 81, 86, -65, 84, 683, 3054, -280, + -2825, -757, 53, -10, 441, -145, 138, 1364, + -2, -92, -300, 225, -199, -2087, 1095, -363, + -75, 288, 765, -869, -7, 3261, 9, -2860, + -330, -382, 3309, 28, 629, 244, -143, -298, + -512, -409, -241, 104, -6, -271, -2, 8192, + -137, 139, -304, -14, 81, 262, -36, 51, + 380, 11, 101, 100, -153, 2167, -271, 267, + 306, -3008, 579, -277, 316, 327, 1168, 71, + -1401, 389, -25, -265, 101, -53, -170, -226, + 2861, 145, 3040, -159, 77, -16, 233, -570, + 490, 661, 452, 1986, -522, 212, -107, 196, + -247, 308, -353, 186, -2689, 486, -46, 813, + -24, 233, -166, 3305, 2832, -343, -82, 475, + 267, -385, 26, -35, -226, 27, 416, 231, + 12, 88, -209, -139, 404, -239, -109, -182, + -851, 260, 242, 109, 11, -1096, 85, -4226, + -124, 12, -139, -100, -604, -87, 89, 5820, + 59, -43, -84, 264, -543, 0, 428, -16, + -146, -556, -195, -159, 875, 27, 261, 207, + -182, 2367, -622, -3193, 481, -289, 52, 12, + 34, 3014, 10, -345, -94, -2883, -62, 400, + 249, 51, -178, 1190, -128, -3940, 41, -296, + -48, 13, -26, 223, -2392, 516, -384, 33, + -46, -161, -43, -224, -89, -4, -349, 135, + 540, -120, -276, -198, 129, -5113, 175, -45, + -34, -109, 419, -45, -104, -185, -393, 416, + -3514, 149, -3088, -115, -78, 431, -172, 21, + -290, -162, 216, 41, -56, -487, 705, -194, + -1003, 100, 172, 2793, -83, 2584, -189, 1198, + 551, -119, -73, -91, 2103, -619, 124, 128, + 2628, 192, 160, -110, 270, 1739, 1062, -568, + -73, -56, 328, 100, 384, -173, 83, 39, + -236, -25, -457, 53, -6413, 345, -459, -110, + 28, -127, -109, -593, 32, 141, -879, 254, + 2132, -410, -623, 1103, -2302, 528, 156, 28, + 81, 613, 602, 171, 500, -2356, 620, 17, + -523, -2961, -921, -107, -405, -230, -129, 18, + 363, -881, 1282, 1427, -363, 658, 205, -51, + 2835, -2003, 188, -26, 73, -231, 352, 74, + -490, -222, 2423, -341, -2762, -14, -56, -260, + -41, 33, 169, -190, 1248, -77, -2322, -607, + 3610, -104, -200, -90, -81, 719, -52, -359, + 394, -301, 66, -39, -56, -8192, 87, 56, + -291, 50, 231, 284, -211, -16, -86, -84, + -28, 52, 3, -51, 304, -224, 228, -374, + 458, -1958, -210, -2613, 401, -2128, -119, -12, + -60, -14, -8192, 53, 27, 113, 289, -7, + 22, 60, -192, 333, 72, -344, 238, 147, + -2235, 324, 124, 176, -415, 450, -476, -558, + -429, -246, -551, -287, 672, 2145, 8192, 161, + -165, -34, 193, -108, -137, -96, -68, 156, + 308, -182, 5, 438, -71, -27, -164, 187, + -110, 5786, -82, -130, -126, 197, -262, -182, + -118, -110, 121, -93, 235, -56, -99, -212, + -3013, -193, -10, -2944, 58, -135, -624, -170, + 84, 339, 115, -85, -1886, 250, 123, -104, + -374, -2241, 2454, -438, -168, 632, -136, -725, + -329, -394, -60, 19, 2795, 438, -796, 141, + -143, 132, 251, 37, 286, 1858, 39, 2381, + -9, -85, -110, 149, -415, 355, -172, -9, + -149, 554, -324, -4931, -537, -261, -585, -291, + 764, -92, -139, -8, -80, 65, -6, -26, + -81, 37, -14, 45, 115, 171, -321, 313, + 308, -4637, -128, -120, -174, 148, 768, 490, + 81, -175, -261, -136, 1501, 345, 25, -56, + -212, -324, -836, 207, -652, -752, 2406, -332, + 489, -275, -932, 284, 3103, -315, 614, -2711, + 1706, -1072, -163, -75, -1104, 163, -421, 1532, + -92, -163, -811, -118, -38, -754, 466, -314, + 232, -595, 3613, -30, 570, -62, 785, 1626, + 1080, 553, -407, 32, -105, 82, -156, -75, + 8063, -67, 114, -65, -65, -242, 98, -124, + 38, 441, -2645, -92, 69, 17, -3284, -278, + -278, 116, 567, -742, 182, -304, 432, 261, + 86, -4109, 389, 795, -138, 151, 111, -223, + 2392, 399, -135, -545, 182, -226, 61, 234, +}; + +static const int16_t cb1616sm1[] = { + -29, -13, -6217, -136, -196, 24, -228, -301, + -155, -37, -54, -91, -4, -130, -424, -89, + -181, 657, 110, -4526, -391, 762, 1033, -310, + -808, -282, -721, -690, 258, -259, 16, -555, + 2675, -379, -2580, 356, 198, -455, 95, -194, + -754, 383, -263, -873, 271, -107, -191, -28, + 11, -66, 91, 25, -215, 9, 152, 11, + -124, 66, 422, 521, 5401, 103, -179, -291, + -821, -1265, -396, 150, -69, -15, 154, 1504, + -445, 116, -136, -3528, 2819, -5, 174, 166, + 289, -60, 158, -701, 83, -636, -407, 194, + -240, -138, 124, -94, 132, -105, -106, 72, + 139, 101, 97, -7928, 6, 112, 164, -83, + -329, 41, 124, 389, -22, -194, 157, -378, + -2255, -431, 3176, -199, -310, 49, 483, -208, + -235, 11, 45, 637, 1220, 2309, 93, 514, + -1939, 136, 276, -165, 137, 2496, 56, 31, + 238, -538, -433, 690, -318, -44, 834, -1684, + -132, 2619, -157, 1959, -566, 119, 183, 227, + 2066, 401, -48, 1257, 604, 1306, 149, 273, + 586, -199, 2166, 257, 2047, -46, -377, -761, + -25, -454, -1592, -42, 432, -2312, 222, -528, + -87, -287, 532, 2906, -2011, 720, 554, 423, + -576, 425, 280, -894, -232, -179, 485, 628, + -2918, 405, 229, -2, -146, 127, -329, -243, + 194, 2443, -531, 592, -14, 1679, 292, -914, + -332, 2382, -3040, 297, -2856, -88, 236, -485, + 438, 241, -283, 448, 579, -660, 277, 233, + 201, 126, 15, -411, -560, -582, -389, -392, + -7, 238, 1, 344, -216, -4601, -457, 1027, + -114, 13, -301, 288, 172, -488, -124, -2721, + 100, -105, 434, -13, 2791, -827, 1600, -219, + -4992, -100, 411, 326, -608, -779, 94, 974, + 453, -1326, -236, 429, -189, 830, 32, 187, + 459, 2489, 476, 165, 3261, -445, 169, 179, + -113, 168, -393, 52, -383, -33, 73, 137, + -6021, -259, -121, -29, -46, -156, 68, -225, + 217, 152, -280, 7, 62, 3, 17, 295, + 221, -158, -5406, -335, 232, -454, -320, 467, + -45, 96, -170, -267, 1273, 287, 258, 536, + -695, -953, 1134, 428, 251, 3331, 717, -804, + 627, 1099, 120, 4, 42, 191, -9, 259, + -335, -337, -25, -56, 116, -228, -351, -463, + 5942, 193, -114, -64, -268, 300, 146, -15, + 657, 367, -2, -2911, 838, -251, -1, 2897, + -78, -609, -545, -588, 488, 1383, 486, 1820, + 126, 2971, -151, 11, 10, -349, -279, -260, + -265, 142, -683, -191, 172, 30, -293, -5103, + -61, -247, -38, 722, 275, -326, -34, 132, + 297, 3305, -46, 227, -1052, -1114, 562, 62, + -1618, 699, 362, -1624, -455, 150, -110, 61, + -266, -168, -168, -391, 136, -569, -772, -203, + 467, 20, -4747, -170, 142, -138, 129, 1719, + 1896, 210, -1008, 206, 585, -325, 295, 175, + -2542, -489, 121, -94, -38, -2766, -115, -3206, + -305, 320, -179, 503, 83, -72, -122, -52, + -181, 98, 39, -506, -2751, -93, -1, -59, + 2645, 248, -309, -203, 138, 324, -567, 696, + -493, 170, 2440, 919, -420, -3029, -335, -593, + -72, 536, -82, 202, 78, 510, 184, -2, + 227, -2830, 19, 1590, -281, 387, -46, 408, + -463, -536, 262, 2214, -115, -1614, -385, 203, + 32, -885, -2606, 2338, 97, 292, -449, 449, + -1038, -582, 0, -68, 211, -160, 62, -286, + -2466, -421, -48, 1903, -1037, -173, 1339, -591, + 152, -1231, 792, 524, 214, -92, 29, 181, + -225, -150, -1, 139, -8135, 238, -119, 189, + 34, -140, -188, 141, -112, 56, -176, 154, + 91, 5653, 298, -316, -23, 232, -74, -317, + -4, -630, -506, 105, -1655, -126, 2417, 113, + -95, -472, 134, 290, -755, 152, -1222, -58, + 981, -236, 8192, -154, 75, 218, -185, 107, + -10, 39, 265, -225, -87, 9, 123, -906, + -382, 2544, 44, -1985, -102, 407, -91, -1835, + -108, 122, 142, 169, 134, -721, -1530, -4, + -133, 45, 374, -1049, -76, 16, -357, 277, + 158, -2596, -4, -1484, -13, 2660, -198, 9, + -218, 408, -63, 177, -71, -195, 4293, -8, + 228, 34, -421, 695, -1409, 85, 2740, 350, + 44, 473, 141, -93, 144, -59, -220, -154, + -148, -168, -205, 3049, 229, 194, -107, 90, + -353, 508, -343, 473, -446, 457, -452, -116, + 3493, 504, 2152, -228, -1832, -463, -657, 555, + 657, 540, 546, 604, 2214, -68, 254, 563, + 267, 227, 92, -107, 143, 260, 23, 42, + 64, -67, 138, -167, 72, 457, 4958, 61, + -933, 1, 5341, -32, 89, 161, 504, 823, + 311, 11, -184, -574, -79, -1654, -74, -366, + 164, -363, 117, 53, 706, -701, -2966, 233, + 11, 165, 394, 462, -2632, 703, -291, -65, + -49, 4080, -862, -65, -19, -110, -872, 323, + 833, -154, 369, 475, 2211, 20, -212, 1711, + -24, -28, -58, 32, 1746, 41, -779, 614, + 508, 3050, 687, 423, -182, -484, -60, 242, + 3895, -565, -453, 110, 547, -961, 320, -34, + -347, -1963, -116, 730, -435, -34, 41, 26, + -51, 8192, -115, 312, 184, -148, -199, 157, + 153, 82, 99, 138, -32, -19, -64, -139, + 107, 43, 133, -87, 42, -148, 7080, -158, + -335, -249, -64, 81, 157, 813, -279, 2226, + -16, 1191, -705, 607, 205, -11, -1341, -548, + -2251, -326, -149, -2536, 139, -750, 73, -394, + -218, -35, 181, 925, -557, 226, -63, 2582, + -737, 164, 181, -167, -230, 413, 328, 406, + -287, -2992, 539, 1133, -85, -2162, -154, -357, + -245, -8, 162, -118, 111, 1275, 47, -314, + -2043, -2732, -1052, -28, 625, -810, -487, 40, + -131, 273, 105, 2605, -2974, 268, -19, -257, + 842, -662, 855, 505, 590, -243, 68, 6978, + 118, -101, 349, -232, -258, -318, 212, 55, + -686, -177, -173, -102, 480, 35, 149, 263, + -2838, -198, 942, 392, 135, 2980, 34, 92, + -237, -672, 224, -298, 298, 2128, 359, 254, + 150, -839, 1001, 3234, -169, 261, -302, 74, + -277, 498, 321, 194, -3275, -152, -2786, 33, + 70, 236, -222, 88, -393, 47, -636, 869, + -754, 842, -2326, -460, 133, 0, 264, 172, + -2955, -286, -243, 399, 882, -722, -382, 872, + -119, -65, -2403, -119, -246, -890, -185, 102, + -32, -573, 225, 3044, -484, -40, -809, 403, +}; + +static const int16_t cb2224l0[] = { + -3546, -433, -76, 46, 24, -641, 214, 114, + -779, -930, -57, -462, -569, -848, -413, 53, + 45, -3172, 2915, -734, 152, 487, -113, 246, + -196, -187, -136, 469, 475, 382, 213, -886, + -275, 313, 3148, -62, -773, 785, -24, -1499, + -65, -175, -1942, -325, 78, -15, -38, 2, + 6, -29, -16, 9690, -15, -49, -13, 12, + -21, 11, -45, -63, -528, 192, -137, 201, + 138, -154, 57, -88, -1695, 155, 105, 121, + 4249, -59, 467, -439, 4483, -130, -39, 262, + -21, -377, 441, -353, -768, 366, 23, 841, + 529, 195, 2722, 2892, -255, -67, 628, -498, + 33, 241, 212, -1020, -97, -723, 594, 35, + -31, 1459, 19, -75, -27, -1, 48, 28, + 267, -275, 3780, -515, -467, 36, -405, -272, + -1968, 60, 44, 449, -2877, -124, -1524, 1195, + 1042, 117, 115, -305, 225, 215, -357, 144, + 35, -23, 89, 2133, 2, 65, -27, -48, + -243, -216, -807, 700, 1258, 6, -140, 4, + -31, -21, 42, 67, 97, -2, 104, -10, + -7734, 134, -50, -95, -88, -269, 105, -18, + -229, 453, 1038, -2609, -2944, -57, 27, 372, + 59, -556, -87, -242, 114, 1083, -119, -139, + 175, 146, -55, 1689, 342, 501, 2722, -1273, + 1626, 868, -290, -145, 62, 194, -23, -179, + 1540, -85, 360, 254, 339, -681, 2081, 2730, + 838, -128, 31, -2133, -173, 483, -138, 2706, + 2007, 91, 293, -642, 35, 280, -132, 454, + -66, -6263, -24, 82, -31, -39, 5, 41, + 66, 239, 18, -57, 61, -117, 103, 16, + -1231, 1384, -164, 104, 370, -1891, 2237, -440, + -1399, -1394, 3, 274, 223, -30, -70, 579, + 361, 423, 355, -176, -164, -443, -306, -2382, + 713, -2987, -340, -691, 1407, -5, 439, -264, + -86, 1964, -17, 88, 175, 56, -119, 31, + 466, 1980, 176, 513, 1809, 17, 3000, 1861, + -71, 314, -255, 2041, 576, 203, 443, -392, + -539, -380, -685, -204, -161, 287, 378, -502, + 1898, 1540, 1073, 2282, 573, 867, 122, 1064, + -628, -564, 97, 280, -36, 1601, -90, -174, + -10, 45, -57, 159, -496, 641, -959, -91, + -90, 3057, 1680, -83, 80, 19, 63, -119, + 1, -72, 466, -335, 453, -177, 3930, -21, + 327, -199, -651, -38, -6, -13, 7, -77, + 1, 8, 40, -125, 36, -136, 272, 6266, + -3299, 3331, 24, 18, -71, 9, -79, -374, + -277, 128, -233, -175, -350, -216, 81, -693, + -49, 33, -44, -37, -4260, -70, 96, 177, + -319, 133, 178, -377, -45, 182, 156, -155, + -34, 10, 22, 53, -211, 4, 5740, 48, + -42, 114, 149, -30, 122, -106, -309, -148, + -82, 20, 130, 2734, -40, -596, 1309, 1163, + -1470, 396, -264, 884, 142, -1818, 67, -1, + 38, -52, -73, 1, 279, 143, 278, -45, + 1541, -886, -677, -2609, -88, -3766, -201, 237, + -40, 195, -50, -366, 88, 166, 403, 236, + -130, 205, -45, -8636, -13, -27, -50, 8, + 40, 21, 41, -36, -25, -40, -14, -14, + 42, 296, 2495, 372, -361, -501, 1951, -2141, + 220, -847, 98, 228, -250, 563, -1121, -29, + 2888, -196, 151, -19, -287, -2298, 65, -482, + -124, -186, 1215, 468, -781, -227, 621, 298, + -42, -44, -115, 0, 50, 179, 23, 9, + -65, -8, 10, -101, -4998, 77, 1181, -304, + 139, 250, -2257, -97, 847, 433, 385, -2411, + 800, -852, -528, 435, -953, -23, 4, 928, + -108, -634, -273, -879, 2566, -2609, 621, 807, + 295, -77, 627, -1114, -297, -109, 2103, -53, + -9, 44, 32, 339, 679, 77, -3186, -416, + 1234, -801, 472, 408, 153, 465, 1703, 879, + -2411, -553, 440, 2099, -899, -288, 310, 665, + -47, -148, 1457, 3932, -213, 243, -1763, -2, + 288, -425, -972, 478, -302, 552, -377, -352, + 179, -480, 1466, 2019, 2817, 5, 824, 13, + -384, -582, -297, -1165, 689, -120, 703, -118, + 663, 206, -49, -2853, -76, 32, 170, 11, + 42, -503, -1139, 1548, -287, -1112, 765, -455, + -35, 2452, 22, -134, 144, 1867, -149, 2771, + 19, 264, 700, -48, 286, -593, -2637, 408, + 2304, -14, 187, -135, -210, 745, 282, 724, + 861, 21, -414, 606, 836, -564, 212, 203, + 64, 4706, -30, -43, -85, -61, -90, 644, + -281, 287, -122, -340, -137, 36, -4, -22, + 8, 9486, -3, 4, 10, 4, 86, 58, + -8, 6, -105, -15, 15, -63, -58, -30, + 15, 0, -19, 78, -8267, -134, -8, -45, + 163, -19, 149, -298, -167, 34, 190, -39, + -2229, 2821, 126, 185, -791, -1229, 1003, -331, + 980, 659, -60, -60, -48, 20, 12, -167, + -60, -39, 66, 180, -22, -20, 84, -108, + 131, -10, -8493, -1, -18, -4, -53, 25, + -63, -14, 20, 25, -41, 40, -5, -2330, + -74, 59, -7, -154, -293, -64, -2702, 819, + 75, 977, -602, 1138, 160, 262, 26, -81, + 18, 5558, 118, -167, 98, 110, -5, -44, + -27, 72, 51, -189, 0, 1868, 743, -275, + 2530, 6, 180, -1019, -1307, 710, 303, -152, + -115, -1498, -501, -495, -103, -76, 78, -7, + -9337, -6, 31, -21, 16, -14, 57, 36, + -81, -67, -30, -535, 216, 313, 310, -157, + 2830, -914, 122, 1353, -1842, 298, -1165, -13, + -253, -100, -560, -61, 40, 24, 3, 56, + -18, 5709, 41, 13, -23, -55, -98, 214, + 109, -205, -45, 27, -26, 177, -290, 89, + 8, 1315, 3102, 1657, 210, -1032, 774, -211, + -581, -51, 896, 852, 331, 349, -474, -119, + -865, -145, 2270, 703, -1967, -2088, 610, -700, + 113, -231, 2062, -152, -599, -474, -38, -601, + 432, -983, -731, 744, -2880, 156, -240, -1903, + 2497, -89, -963, -2179, -1208, 189, 318, 150, + 204, 29, -167, -138, -93, 73, 292, -3225, + -310, -510, 173, -90, 154, 1831, 380, -1191, + -976, -1460, -514, 235, 13, -2950, 22, -95, + 228, 85, 10, 264, -3165, 46, -184, -782, + 143, -9, 37, 12, 108, -65, -64, 115, + 86, 5039, -55, -203, -163, -462, 77, -92, + 423, 139, 239, -5, 1887, 426, 729, 118, + -159, -2821, -124, 2147, -167, -1023, 92, -23, + 162, -159, -47, -3, 14, -34, 37, -29, + -97, 41, -92, -75, -6983, -224, 250, -80, +}; + +static const int16_t cb2224l1[] = { + -2888, -183, 3606, 0, 33, 99, -76, -264, + -351, -508, -546, -103, 252, -49, 46, -32, + 48, -245, 67, -2408, 340, 3153, -154, -280, + -440, 374, -224, -39, -720, -289, -136, -3095, + -98, -37, -86, 145, 51, 132, 773, -1158, + -330, -449, -141, -1831, 666, -2680, -110, -906, + -307, -3299, 287, 55, -521, -173, -431, -383, + 67, -28, 34, 247, 2814, 1479, 32, -2196, + -1625, 135, 72, 3, 634, 76, 502, -306, + -366, -120, -219, 1934, 372, -130, -113, 255, + -14, 30, -687, -576, 797, 306, -2360, -242, + 2062, 69, 2273, 26, -20, -21, -68, -69, + -4618, 60, -171, -235, -271, 175, -110, 147, + 100, 1628, -197, -2, -4002, 520, -1236, -21, + 62, -396, 513, -369, -168, 285, 561, 131, + 1347, 83, -101, 89, 206, 5, 4556, -23, + 1191, 39, 352, -158, 99, -195, -33, 481, + -446, -125, 181, 2678, 2860, -524, -239, 55, + -360, -358, -560, 93, 307, 285, 77, -295, + -90, 114, -45, 54, -328, 94, -222, -30, + -5004, -164, 100, 379, 208, 424, -11, 26, + 10, -26, -32, 114, 30, 18, -44, -221, + -184, -32, 0, -99, -9001, -7, -33, 1, + 41, -3, 13, 9, -46, -86, 47, 56, + 72, -7, 5, -1162, 101, 456, -217, 3440, + -220, 400, 100, 1503, 365, 655, -230, 42, + 1129, 767, 192, -16, -3440, -79, -236, 3, + -80, 51, -11, -984, -142, 29, 554, 339, + 1851, 105, -279, -2915, 116, 3090, -431, 233, + 337, 61, 927, 32, -174, 237, 255, -250, + 604, 115, 2036, 78, -79, -50, -349, 338, + 285, 169, 394, -49, 1194, -2966, 447, 57, + -2591, 415, -586, -2616, -197, -61, 596, -1159, + 130, -441, 356, 47, 1192, 496, -1801, -15, + -142, -23, 132, 21, 84, 234, -137, 23, + -147, -3254, 407, 107, 1132, 130, 74, 153, + 3148, 2184, -464, 1294, 222, 589, 457, -397, + -87, -605, -631, 311, -703, 110, 20, -23, + -75, 18, -43, -182, 8, -94, 151, 4989, + -619, 662, 82, 8, 69, -4, 126, -35, + -99, -277, -227, -2212, 3188, 1115, -467, -618, + -989, 681, 218, -25, -37, -9, 32, -46, + 97, 15, -23, -95, -6, 55, 19, 7904, + -14, -508, 3, 14, -12, -58, 28, 154, + 11, 271, -593, 344, -336, 3489, -41, -2998, + 622, -2739, 2796, 1536, 310, 176, -318, 399, + -70, -298, -509, 256, -381, -158, 322, -197, + 3, -53, 37, 98, -6136, -25, -54, 57, + 138, -74, 239, -46, -18, 29, -265, -2278, + 22, 110, -21, -147, 266, 85, -286, 137, + 3434, -485, 68, 475, -3, 159, -181, -237, + 1595, 759, 786, 1490, 926, -2841, -160, 1092, + -7, 130, 895, -345, -95, -31, -35, 139, + -98, 2106, 305, 672, -66, 349, 229, -1561, + -1694, -1786, -743, -76, -67, 1666, 76, 10, + -22, 60, -45, 5, 409, -458, 583, -405, + 2586, -264, 175, 633, 842, 3208, -1488, -802, + 40, -119, -197, -84, 1645, 328, 823, -175, + 342, 12, -217, 67, 124, -180, -106, -2877, + -336, 171, 185, 132, -2263, -75, -622, -631, + -2404, 176, -132, 35, 179, -1498, 182, 68, + 699, 597, -2728, 325, 52, 421, -863, 609, + 53, -159, 258, -307, 2919, 44, -826, -467, + 91, 542, 1883, 815, -682, 548, -419, 593, + 82, -2108, -158, -75, -524, 2440, -528, -469, + 723, -14, -1817, -487, 448, 4, -155, -70, + -1715, 34, -55, 134, 0, 19, 107, 419, + 334, 74, 446, 1241, -4288, 61, -65, 21, + 71, 133, 2, -88, -238, 322, -283, -6, + 404, 98, 78, -1951, 412, -1942, 418, 257, + -42, -2444, -97, 1491, 464, 346, 229, -154, + 96, 261, 29, 302, 39, -201, -40, -98, + -157, 335, -3624, -349, -573, 633, -116, -312, + -82, 263, -2, -101, -57, 1817, -424, 3, + -245, 386, 74, 609, 2171, -77, -2604, -1036, + -117, 1585, -2, 9, -23, 31, -12, 48, + 215, 84, 13, 219, 419, -275, 4373, -91, + -6, 18, 2228, -46, 157, -408, 2288, 654, + -725, -245, -10, -1182, 1726, 324, 367, 3013, + 3429, -140, 360, -122, -574, -165, 109, -330, + -82, 340, -133, 210, 355, -8, 47, -52, + 8064, 5, 60, -42, -95, -3, 91, -69, + -47, -42, 101, 118, -44, -16, -14, -9, + 27, 8, -33, -3, -9302, 27, 49, -6, + 61, 74, 204, 430, 252, -259, 73, 125, + 366, -458, -2846, 89, -2694, -106, -344, -702, + 809, 451, 69, 585, -1897, 608, -1138, 52, + 618, 106, 771, 2992, 266, 1007, 184, -486, + 36, 3317, -311, 38, 105, -89, 16, 97, + -88, 28, 183, -2834, -44, 387, -49, 467, + -2524, 77, -56, -3727, 81, -308, 63, -137, + 203, -77, 139, 254, -65, -264, -58, 631, + -2559, 739, -1343, 595, -117, -193, -2572, 322, + 267, 185, 669, -110, 641, 212, 45, -16, + 12, 14, -3, -12, 78, -48, -196, -128, + 179, 146, -7348, 177, -138, -48, 142, -33, + 34, -6037, 15, -105, 103, 136, -48, 217, + -169, 88, -31, 9, 24, 41, 1733, -2757, + -335, 1783, 988, -161, 1014, 633, -66, -1114, + 525, -266, 461, 1137, -26, -173, 89, 82, + -3365, 67, -198, -107, 44, 352, -793, 867, + -807, -166, 107, 4, 71, 61, 124, 27, + -2477, 178, -32, -172, 2895, 1301, 798, 707, + 267, -720, -403, 167, -157, 2572, -210, 527, + -312, -1664, -214, -1556, -332, 595, -1634, -58, + 203, -1777, -469, 24, 188, -59, -860, 879, + 15, 855, -1534, 2910, 534, -71, 276, 471, + 41, -25, 105, -37, -150, 110, 226, -277, + -4687, 574, 139, -152, -586, 67, -1082, 261, + -68, 25, -216, 110, 46, -3703, 281, 355, + -506, 80, -218, 164, -398, 75, -97, 5782, + 39, -68, 26, 76, 74, 38, -103, 105, + 44, 116, 187, 288, 90, 5847, -41, 28, + -19, 20, 129, -99, 258, 22, -28, -120, + -101, -121, 79, -180, -23, 22, -5, -60, + 63, 35, -8987, -11, 2, -15, -3, -28, + 47, 29, 241, 132, -166, -259, -48, 102, + 70, 2830, 3163, 285, -813, 0, 105, 176, + -455, 141, 1382, -481, -2282, 2971, -200, -473, + 37, -930, -1162, 930, 890, 412, 190, -160, +}; + +static const int16_t cb2224s0[] = { + -5789, 1229, -138, 1010, 823, -602, -987, -237, + 47, -29, 428, 210, 87, -11, -20, -261, + -3148, 1219, -2074, -132, -258, 707, -634, 878, + -486, 989, -276, -137, -263, 592, 1248, 474, + -293, -981, 2125, -653, -1451, -833, -1522, 387, + -269, 349, 698, 295, 870, 661, 1532, 202, + 654, 362, -1265, 3972, -651, 224, 213, -728, + -83, 575, -503, -766, 559, -657, 86, 941, + 1498, -72, 2297, 1413, -376, 697, -738, 384, + -807, -354, 1141, 374, 1186, -597, 222, 630, + -717, -1653, 106, -1377, -929, 982, -3469, -321, + -201, -1185, -147, -13, 268, 103, 2967, -2083, + -416, 702, 377, -1126, 92, 963, -494, -94, + -436, 1893, 1401, -40, -1464, -1608, 1980, 44, + 254, 676, 529, -891, -95, 9, -172, -129, + 158, -403, -1147, 1026, -410, 86, 2593, -1060, + -621, 480, 254, -780, 691, -1020, 79, -192, + -2264, -1219, -748, 602, 243, 338, 550, -444, + -130, 79, 24, 3396, 124, -572, 749, 976, + 33, -883, -368, -609, 694, -569, -560, 192, + 868, 644, 173, 86, -4302, 633, 7899, -360, + 478, 493, -306, 14, 244, 96, 71, -169, + 336, 346, 74, -52, 1779, 828, -252, 739, + -1005, -755, 31, -46, 200, 581, -11, 802, + 1104, 3252, -1053, 723, -491, -2492, -2330, -245, + 308, -1021, -312, 563, -85, 991, -16, 224, + -85, -957, 2262, -4585, -1475, 102, 310, 298, + -875, -6, -268, 8, -284, 324, -471, -224, + 133, 1502, -1714, -1095, -104, 809, 2584, -273, + -1014, -296, 130, 732, -259, -335, -745, -619, + -716, 247, 503, 862, -277, -137, -224, -4897, + 124, 277, 298, -40, 169, 678, 557, 4379, + 677, -2016, -506, -108, -47, 49, -115, -260, + -300, 206, 1196, -17, 202, 365, -808, -473, + -160, -609, 526, -1124, 1629, -2924, 713, -487, + -109, 540, -511, 221, -394, -1420, 1023, -460, + 424, -86, -875, -1557, -88, -244, -1597, -3015, + 355, 166, 330, -334, -325, 505, 3632, -1760, + 1626, -427, 573, 1197, -317, -566, -663, 460, + 338, -442, -597, 1565, -854, -534, -219, -128, + -2175, 739, 1064, 2050, -61, -349, 361, -375, + 1111, -122, -121, -164, -2573, 938, 1758, -15, + 884, 865, -630, -573, 994, 1112, -26, 9, + -30, 3893, -38, 1386, 605, 568, -680, 117, + 37, 572, 245, -53, -1030, -241, 397, 363, + -1632, -567, -26, -698, -2109, -1033, -1389, 1381, + -418, 402, -534, 9, 1143, 991, 693, 2557, + -1268, 1273, -192, 1225, 876, 472, 835, 509, + -452, -1519, 482, 1103, -626, -299, 1580, -1532, + 599, 2245, 503, -110, -1879, 978, -1158, -130, + -665, 448, -1247, 604, -528, -677, -711, 78, + -563, -349, -53, 261, 952, -338, -534, 43, + -2, -2555, 1976, 2393, 1715, 996, 5628, 1036, + 171, -28, -199, -83, -126, -35, -248, -393, + 36, 209, 77, -1793, 244, -108, -130, -41, + -578, -2347, -687, 1650, 131, -138, 407, -228, + -1348, -209, -841, 1332, -542, 220, -193, 843, + -103, 853, 261, -653, 217, -107, -113, -54, + -4151, -1303, -287, 4065, -376, -71, 43, -1481, + -359, -481, 78, 529, 689, -194, 178, 60, + -997, -1555, 1687, 345, 169, 266, 2894, 83, + -500, -425, -396, -245, 6, 517, 112, 129, + 725, -121, -404, 234, 47, -61, -122, 710, + -4283, 985, 56, -105, -45, 1043, 720, 73, + 321, 4452, -1614, 91, -620, -299, 506, 766, + -882, 650, -138, 123, -608, 210, -1582, -538, + -62, 246, 464, -332, -1560, 2271, 1559, -199, + -832, -1133, -797, 341, 1860, 1628, -1133, -607, + 637, -404, 437, -1148, 542, -474, -882, -610, + -1340, -159, 1524, 1424, 169, -6, 52, 447, + -5513, -592, 244, -294, 44, 164, -51, 147, + 202, -48, 139, 113, -399, -17, -173, -199, + 1, 17, -166, 15, -258, -7, 238, -5748, + -394, -852, -248, -46, 192, -32, -1033, -349, + 151, 483, 130, -1628, -3391, 1527, 694, -305, + 740, -357, -491, -186, -1649, -1394, -873, 213, + 652, -1975, 319, -1131, -103, -48, 673, 155, + -627, 1115, 469, -1122, 1901, -184, -237, -296, + -2887, -120, 211, 835, 57, -826, 1272, -255, + -937, 242, -525, 836, -334, 393, -624, 111, + -347, -178, -3441, 219, -352, 1831, -296, 587, + -357, -1099, 5, 313, -3806, -394, 814, -118, + -233, -23, -125, -21, -1414, 813, -403, 2482, + 442, -184, 934, 340, 472, 374, 1073, -283, + -2348, 477, -387, -713, 1071, -899, 252, -1299, + -502, -375, -410, -1785, 686, -605, -141, -871, + -1777, 2780, 53, -237, -237, 2701, 944, 44, + 595, 3, 1263, -1558, -2267, -998, 221, 355, + -319, -739, -1160, -594, 2977, 191, -41, -284, + 83, 484, 481, -73, -13, 138, -2761, -909, + -578, -139, -1056, 189, -645, -147, -61, -168, + 368, 130, 390, 4187, 101, 79, -45, 451, + -1374, -1941, -534, -301, -979, -668, -533, -2978, + 386, 574, -454, -4, 554, -120, 366, 83, + 1079, -351, 156, 389, 7724, 83, 102, -191, + -1059, -255, -86, 451, -211, 175, 774, 306, + -253, 2386, 1166, -2025, 223, 438, 1279, 1721, + -23, -91, 606, -1285, -775, -3228, -536, 543, + 877, 1140, -1616, -603, 550, -678, -462, 248, + 209, -515, -310, -2538, -2002, 231, -495, 319, + 538, 509, -113, -17, 143, -3062, -29, -52, + 299, 681, 595, 390, 530, -398, -969, 472, + -1145, 860, 4113, 329, -1183, -691, -605, 859, + 305, 986, -81, 2029, 408, 2, -2442, 59, + -85, -911, -285, -532, 28, 434, -2295, -76, + -2977, 51, 824, -1786, 2301, 622, -593, -9, + 643, 246, 427, 193, 51, 118, 4, 234, + 459, 31, -408, 710, -264, 144, -404, -476, + 278, -4836, -113, 382, -29, 177, 345, -33, + -17, -85, 6027, 72, -165, 544, -198, 75, + -278, -262, 155, 501, -305, -279, -439, 1506, + 827, -875, -2592, -1196, -1201, 149, 16, 547, + 1020, -616, 374, -193, -155, -3627, 231, 264, + -2143, 90, 419, 574, -795, 177, 328, 752, + -295, 210, -360, -1250, 2639, -3172, -13, -34, + 489, 484, -390, -159, -285, 27, 444, -252, + 265, 530, -2714, -340, -1543, 2330, -1152, -114, + 452, 304, -224, -451, -317, -579, 301, -567, + 1214, -594, -621, -2718, 59, 257, 410, -3, + 145, 70, 877, -3103, 244, -1134, 236, -1148, +}; + +static const int16_t cb2224s1[] = { + 8488, 277, 63, 173, 224, -30, -158, 64, + 133, -133, 234, 205, -65, 408, 249, -546, + -30, -1, -430, 80, 102, -450, -160, -5634, + 145, -406, -351, 37, 282, 232, -898, 430, + 3301, -1175, -559, 495, 2685, -21, -215, -87, + 728, -55, 235, 430, -250, -505, 506, -128, + -72, 3288, 1588, 291, 7, -39, -944, 478, + 1719, 168, -1085, 225, 330, 1480, -183, -597, + -6131, 668, -387, 672, -173, -55, 113, 40, + -113, -44, 341, -340, -594, -1001, 1757, 127, + -59, 537, -1834, 1401, 856, -1153, -234, 1232, + -562, 476, 110, 2188, 146, 119, 2119, -872, + 450, 597, -371, -1350, -996, -120, -495, 829, + 111, -897, -5445, -670, 390, -118, 4, 109, + 772, 495, 196, 410, -125, 812, 426, 900, + 436, 1155, -553, -1223, 275, 266, -891, 63, + -1267, 523, -548, -2445, 239, 1163, 72, -68, + -1576, 2212, -340, 1499, 494, -671, -73, -281, + 598, 1901, -1652, -845, 266, 795, -545, -574, + 19, -461, 371, 288, -3959, 421, 299, -121, + -2561, -65, 118, 181, -227, 719, -92, -2334, + -3178, -2497, -198, 58, 1279, -309, 152, -715, + 466, -316, 10, 98, 1568, -1015, -18, -435, + -42, 2606, 1971, -119, 705, 254, 443, 36, + 788, 1135, 1234, 2281, 942, 115, 581, -113, + -194, -694, 434, -30, 2835, -423, 436, 522, + 406, 1329, 1191, -2628, 421, -2601, 646, -202, + 637, 610, -584, 357, -1586, -499, -1230, 134, + -83, -1264, 2434, -58, -2924, 641, -285, 172, + -478, -402, 584, -1180, -137, -238, -151, -679, + -619, -495, 1044, 1281, -1180, -444, 376, 1969, + -693, -283, 618, 128, -2622, -90, -115, 672, + 1738, -459, 519, -924, 2582, 937, -555, 672, + 131, 31, 775, 307, -282, -527, -1299, -516, + 10, 239, -4069, 118, 10, -665, -15, -484, + 472, 262, 279, 677, -755, 1288, -1278, 403, + 666, -394, -1230, -2819, -221, 109, 603, 754, + 951, 488, -147, -107, -426, 1875, 2056, -129, + 239, -561, 81, -324, 243, 349, 197, -811, + -146, -929, 1193, 1433, -776, 3209, 434, -6, + 2465, -231, -57, 312, 899, -396, -170, -549, + 346, 135, 17, -596, 401, 269, 499, -64, + -321, -342, -132, -312, 5845, 276, -104, -9, + -50, -678, -478, -1125, -1477, 2058, 156, 538, + 451, 2572, 495, 101, 74, -753, 98, 685, + 2424, -1999, 1050, -280, -1030, 29, -178, -244, + -134, 130, -137, -103, -245, 2161, -446, -1016, + 464, 573, -473, 446, -3822, 942, -1261, -334, + 568, -528, -301, 415, -740, 661, -813, 849, + 1491, 774, -774, 1637, -977, -246, 647, -572, + -140, -2946, -654, -650, -311, 339, -165, 757, + 803, -958, 704, 171, 380, 763, 159, 2721, + -1599, 1006, -118, -597, 2985, 2699, 69, 395, + 523, 657, 438, 190, 72, 164, -268, -145, + 506, -550, 222, -3641, 5, -173, 60, -194, + 677, 686, 724, -107, 882, -339, 14, -54, + 555, 483, 1523, 119, -142, -394, -1683, -984, + 18, -108, -190, 141, 540, 281, -1238, -2195, + -341, -327, -1014, -990, 4694, 46, -1018, 360, + -671, -83, 218, 857, 144, -188, 463, -379, + -571, -865, -1345, -447, -18, -64, 5201, 132, + 90, -158, -132, 381, -85, -107, -103, 970, + -555, -1204, 1802, 1230, 253, 540, -372, -2347, + -386, 835, -705, -437, 941, 795, -182, -368, + 1088, 168, 256, 210, -667, 290, 1783, -636, + 165, -363, 638, -3527, 1872, 1997, 1503, -189, + -2587, -359, 384, 493, -384, -658, -1758, 993, + -306, 148, 198, 163, 430, -313, -149, -337, + 352, -354, 484, 358, -264, -4525, -560, -55, + 154, 374, -317, -426, 1446, -161, -285, -110, + 209, 299, 2329, 99, 1406, 1374, 993, 1178, + -413, -642, -103, 3678, -1829, -754, -1358, -349, + 648, -492, 755, 188, 114, -444, -930, -224, + 319, 212, 1223, -648, 593, 1293, -1289, 24, + -712, 2591, -494, 1503, -9, 534, 923, 1490, + 985, 491, 272, 988, 348, -503, -454, 893, + 409, -422, -1187, 3097, 602, -402, 462, 1598, + -219, 982, 319, 125, 558, -100, -261, 108, + -59, -3435, 76, -1065, -150, -1758, -1997, 1921, + 1239, 426, 507, 173, -856, -829, -538, 247, + -1203, 488, -1094, 453, -1104, 1021, 2185, -2855, + 427, 177, -778, -182, 641, -670, 91, 569, + 50, -90, 571, 108, -374, 174, 1997, 964, + 644, -428, -1868, 668, 171, 320, 676, 121, + -218, 1901, -857, -721, -194, -2433, -34, -1671, + 352, -644, 295, 571, 253, -288, -1786, 32, + 74, -73, -902, -1954, -1126, -3427, 168, -318, + 23, -755, -441, 201, -84, 499, 367, -153, + -426, 716, 650, -457, 80, -709, 859, -2098, + -723, -197, -1030, -253, 283, -1187, -899, 1403, + -117, -25, 7617, -63, -355, -283, -560, -85, + -358, -45, 63, 179, -193, 130, -294, -676, + -525, -907, -430, -627, -5267, -539, 257, 594, + -173, 890, 203, -33, -136, -803, 479, -56, + -634, 464, -919, -146, 306, 5, 198, -90, + -138, -337, 4826, -310, 259, 1651, -687, -1676, + 424, 2729, -966, -61, 386, 60, 769, -72, + -1652, 49, 106, 503, -1462, -1056, 892, 359, + 209, -129, 260, -130, -2081, 798, 488, 846, + -836, -366, 1786, -2237, -484, 72, -2680, -828, + -857, 920, 560, 930, -197, 56, -872, -34, + -355, 929, 35, -449, 514, 70, -1277, 208, + 353, 3654, -256, 134, -895, -184, 375, 402, + 1576, 1515, -100, -438, -679, 384, 1143, -24, + 100, -2818, 554, -219, 105, 652, -2778, -108, + 44, 306, 445, -470, -1151, -1170, 1305, -741, + 1223, -443, -838, 374, -3000, 72, -590, -587, + 3686, 76, -493, 246, 1348, -1215, 473, -244, + -304, 1937, -68, -626, 278, 392, 1167, -1899, + -309, 474, 226, -421, -95, -483, 105, -148, + 749, -430, -3057, -789, -1793, -1857, -158, -489, + -676, -204, 806, -930, -3192, -204, -106, -812, + 1159, 648, 119, -93, -205, -139, 280, -7786, + -388, -132, -12, -332, 32, -174, 100, 153, + -7, 289, -29, -984, -329, -592, 2568, 704, + 544, 66, 521, -661, -1632, -868, -310, 313, + -466, -347, -146, 197, 266, 765, -240, -201, + -265, -1129, -35, -563, -356, 172, 862, 3831, + 1547, -1618, -1445, -3726, 388, 548, -457, 143, + -38, 402, 255, 840, -703, -154, 776, -1038, +}; + +static const int16_t cb2224m0[] = { + -7078, 2846, 79, -111, -20, 330, 227, -36, + 305, 45, 81, 148, -13, 68, 364, -317, + -72, 2021, 28, 93, 328, -256, -181, 2547, + 235, -1102, 130, -577, -164, 1290, 1885, -171, + -147, -3247, 324, -72, -313, -62, 32, 284, + -138, -9, -146, 1709, -390, 1833, 289, 125, + 2369, 60, 223, -137, 642, -113, 204, 288, + -1516, -138, 228, 368, 219, -622, 273, 3211, + -215, -423, 139, 65, 85, -203, -953, 11, + 193, 294, 279, 3267, 246, -2377, -59, -324, + 136, -492, 23, -56, 79, 307, 115, -146, + 2229, 325, -1680, -597, -423, 2200, -44, 48, + 386, 396, -122, -36, 35, 9763, 33, -67, + 19, -34, 15, 41, -25, -30, -61, 20, + -121, 117, -155, -28, -65, -27, 40, 137, + 188, -211, -240, 71, -33, -4873, 1992, 56, + -2701, -1, 151, -96, 286, -398, -418, -221, + 295, -394, -119, -182, -124, 77, 7, -44, + 168, -34, -154, 257, 4, -114, 634, 131, + 4930, -118, -2364, 46, -204, -129, -3168, -138, + -489, 454, -96, 120, -447, 9, -230, 174, + 11359, 456, -261, -74, -249, -28, 149, -79, + -36, 211, -10, 213, -110, 337, -3800, 4, + -223, -18, 136, -290, -155, -235, 57, 447, + -495, -231, -15, -1036, -85, -154, -4421, -19, + -237, -1191, 12, -19, 2, -88, -84, 269, + -7, 431, -26, -2676, -100, 287, -31, -2916, + -160, -83, -198, 9, 183, -279, -68, -23, + -55, 2955, -121, -71, 183, -702, -323, 1689, + -132, 309, 136, -1217, 440, -125, -1671, 1569, + -161, -108, 232, 269, -516, 37, 21, -260, + -230, 564, -375, 224, 129, 4332, -120, 3306, + 153, -25, -260, -84, 123, 21, 5, -17, + -145, -44, 7, -1, 290, -2394, -182, 51, + 933, 1037, 26, 211, 187, -1783, 68, -749, + -52, 1428, -1571, -261, 34, -199, 722, -127, + -118, -114, -2385, 146, -1042, -71, -1475, -150, + -2195, 151, -29, 6, 96, -1213, 282, 219, + 466, 144, -300, 109, -74, 125, 2863, 2, + -2963, -218, 235, 3, 359, 319, 372, -500, + -271, 494, 2695, -65, -29, 47, 74, -34, + -95, -48, -76, -71, -2985, -30, -11, 26, + -176, 107, 96, 22, -60, 114, -70, -147, + -43, 6981, 110, -86, 33, 66, 8, -61, + 52, -169, 82, 233, 56, -115, -295, 241, + -1053, -3914, -79, 361, -869, -144, -144, -805, + 158, -278, 515, 4, -317, 917, -669, 3314, + 253, 1316, 259, 12, 8170, 15, 129, -200, + 120, -11, 34, -77, -13, 257, 79, 9, + 23, 54, 73, 0, -9972, 5, 7, 43, + 29, 4, -104, 43, -36, 76, -228, 1, + -77, -156, -69, -209, 84, -2826, 242, -1461, + -718, -14, 1784, 527, 226, 9852, 83, -15, + -389, 34, 51, -16, -46, -1, 232, 115, + 26, -42, -124, -78, 58, 3092, -2757, -111, + 223, -286, 23, -170, -166, -264, 331, -172, + -49, -26, 166, 2616, 128, 3118, 59, 844, + -121, -504, -193, -53, -95, 282, -21, -8, + -11, 58, -48, 9830, 25, -26, 53, 113, + 96, 125, 12, -64, 185, -31, 19, -251, + -307, -136, 1383, -37, -128, 56, 4303, -232, + -272, 44, -192, 531, -143, -697, -2291, 70, + 229, -432, -592, 1262, 906, -207, 1522, 261, + -7848, -39, -976, 150, 115, -139, 61, -26, + -211, 807, -25, 311, -98, -297, 133, 461, + -109, -6, -1031, 236, -2851, 86, 2184, -254, + -83, -119, 878, -107, -25, 1636, 1696, 1517, + 249, -41, -283, -66, 741, 704, -898, 302, + 470, 360, -7, -6002, 26, 268, -109, 150, + 202, 196, -262, -57, 160, 155, 7, 9, + -5770, 28, 127, 112, -76, -790, 45, -118, + 201, -831, 67, -81, 199, 296, 1692, -30, + -126, -121, 29, 387, 215, 269, -518, -232, + 155, 2735, -235, -82, -33, 3089, -3696, -39, + -51, 124, -220, 37, 51, -129, 194, -80, + 81, 0, -239, -1924, -244, 107, 372, 111, + 206, 418, 39, -118, -2059, -446, 1378, 661, + -2135, 122, -105, 60, 272, -91, -227, 48, + -3226, -88, -109, 199, 566, 158, 2412, -4380, + -177, 153, 252, 24, -323, 264, -116, -12, + -333, 99, -181, -124, 256, -131, -39, -45, + -88, 69, -26, -173, -4820, 286, -171, -82, + 431, 18, -827, -107, 142, 60, 300, 422, + 263, 61, 350, 85, 1088, -133, -1284, 70, + -4577, 5, 114, -23, 23, 2907, 174, 43, + 18, 33, -31, 320, -9, 290, 2, -7, + 39, -11, 52, 32, -4, 8454, 18, 10, + 67, 20, 22, -3, -209, -103, -212, -101, + -101, -420, -2837, -28, 398, 140, 1027, -187, + -2338, 406, -152, -288, 723, -412, -1851, 185, + 641, -190, 107, -7, -3194, -128, -382, 165, + -256, 85, 96, 155, -144, 431, -356, 342, + -2508, -2190, -265, -320, -1345, 27, -1981, -1949, + 95, -78, -456, -359, 382, -218, -102, 164, + 382, 907, 599, 665, 2843, 4275, 17, -156, + -264, 73, 104, -25, -120, 91, 84, 325, + 170, -65, -245, -23, 89, 52, 4651, 124, + 185, 30, 321, 145, 111, -1265, 128, -156, + 64, 24, -1934, 133, -84, -10, 34, 801, + -148, -88, 169, -1687, 419, 1739, -204, -70, + 185, 117, 379, -420, 145, -3650, -264, 1118, + 331, -818, -665, -420, 74, 32, -152, -226, + 6, 216, 4173, 23, 1230, 239, 2, -57, + -690, 516, 90, 58, -24, -61, 175, -2796, + -113, -270, 94, -2319, -158, -1075, -275, -647, + -3839, 37, 4267, 20, -49, -88, 72, -171, + -195, 45, -23, -159, -64, 110, -211, 42, + -211, 1591, 276, -3662, 213, 54, -180, 786, + -92, -329, 382, 344, 165, -63, 14, -7, + 66, 29, 8875, 43, -50, 65, 13, 15, + 48, -40, 114, 125, -27, 158, 3, 843, + 8, -646, 100, -3121, 1720, 88, 898, 346, +}; + +static const int16_t cb2224m1[] = { + 9581, -198, -100, -22, 237, -15, -101, -23, + 46, 129, 63, -143, 5, -307, -143, -9, + 27, 50, 40, 6048, 25, 58, -16, -161, + -109, -157, 137, 115, 121, 164, 4, -54, + 6477, -68, -120, -29, 45, -8, -13, 334, + -87, 105, -1460, 28, -334, -163, -64, -3629, + -71, 176, -195, 53, -1, -96, -560, -21, + 135, 178, -77, -4202, 20, 2544, -205, 85, + -332, 158, 61, -105, 398, -88, 14, 241, + -149, 62, -124, -136, -153, 27, 190, 2595, + 25, -2499, -530, 1809, -104, -2753, 298, 145, + -771, 139, 165, 2462, -502, 860, -174, 199, + 74, 163, -686, -25, 57, -103, -309, -360, + 39, -296, -2765, -319, -950, -678, -1159, -1743, + 1499, 1776, -176, 9, 44, -581, 69, 39, + 162, 326, -96, 329, -9, 1274, -2443, -105, + -50, 4212, -23, 146, -231, -22, -50, -128, + 11, 28, 116, -215, 46, 217, 204, 153, + -73, -156, -100, -31, 2632, -190, -2258, 199, + -1757, 194, 53, 38, -5723, 66, 169, 352, + -39, -150, -1, -462, 41, -98, -110, -40, + -5763, -190, -158, -1380, 205, -227, -402, 81, + -171, 407, -125, -320, -456, -317, 489, 698, + -308, 3989, -172, 402, 196, -457, -1238, -192, + -581, -63, -235, 153, -1094, -53, -45, -86, + 240, -192, -2660, 2356, 153, -60, 277, 33, + 198, -57, 1221, -2984, -327, -326, -48, 61, + 93, -34, -167, -311, 904, 348, 415, 57, + 2000, -77, 238, 40, -3072, -36, 283, -54, + -655, -250, -22, -569, -584, -18, 733, -251, + -72, -28, 80, -306, 211, 188, -149, 4596, + 305, 372, 351, -82, -184, -79, -65, 2688, + 2670, -54, -81, -170, 19, -88, 122, -117, + 33, 51, -29, -113, -2973, 46, -3294, 90, + 8, -180, -227, -62, 43, -25, 187, -380, + -29, -89, 138, -352, 231, 2632, 158, 1993, + -15, 350, 107, -982, -16, -1120, 136, -171, + -42, 2605, -186, 110, 167, 1673, 1140, -29, + -689, 81, 909, -455, 2979, 44, 1, -260, + 26, 28, -90, -568, -123, -175, 232, -38, + 2372, 111, 312, 529, -65, 331, 100, 488, + 12, -596, -497, 2311, -1097, 1242, -94, -2290, + -158, -2651, 16, -232, 3352, 24, -53, -83, + -5, -52, 205, -104, -294, 217, -196, -37, + -7, 0, -28, -45, 60, 13, 41, 111, + 142, -7331, -40, -200, 18, -166, -1266, -47, + -250, -592, -604, 33, 83, -204, -1131, -166, + 1348, -1337, 184, 50, -10066, 30, 24, -184, + 137, 53, 32, 87, -27, 151, 100, 10, + -47, 28, -138, 12, -2977, -376, 58, 168, + 1642, 144, 1039, -399, -807, 5, -1715, 12, + -142, -77, -306, 758, 674, -82, 3216, -369, + 60, 480, 276, -423, 5102, 3325, 169, 47, + 235, 37, 81, -86, -28, -56, -59, -205, + -126, 28, 279, -8433, 137, -26, -409, -19, + 106, -163, -76, -57, 235, 7, 131, -81, + -197, -318, 1281, 310, -2934, 972, -1335, 35, + -308, -93, -128, 433, 527, -193, -1303, 162, + -34, -87, -157, 262, 4999, 25, -311, -349, + 94, -262, 0, -219, 57, 12, -4, 10, + -17, 38, -320, 48, 156, 80, 5880, 48, + 45, 31, -1022, 31, 227, -727, -135, 261, + -21, -688, 307, 3196, 565, 627, -546, 237, + -2367, -33, 1622, -87, 1722, -201, 720, -539, + -288, -1012, 141, -388, -72, -20, -59, -2042, + -53, -101, 208, -233, -835, -16, 3092, 2, + 310, 94, -362, -163, -128, 30, -22, -145, + 420, -1, 322, -524, 2742, -276, 206, -2475, + 575, -653, -342, 1412, 1, 75, -14, 54, + 170, 66, 342, -261, 709, -75, 2240, -134, + 32, 665, 171, -134, 1822, 109, 569, 3129, + 168, -356, 53, 1259, -67, 43, 120, -124, + 2185, 2461, -17, -255, -349, -167, -158, -19, + 84, -732, -972, 286, 87, 4603, -160, 7, + 141, 1, 286, 310, -315, -99, 282, 384, + 68, 93, -1815, 63, -86, 121, -293, 210, + 115, 63, -174, 616, -1848, -124, 1275, 298, + 185, -267, 3516, -105, -162, -253, -434, -674, + -90, -2232, 38, 168, -261, 289, 70, 3714, + 4096, -81, 17, 56, 57, 68, -20, -146, + 28, -152, -17, -97, -131, 2648, 71, -3359, + 40, -277, 313, 85, -26, 41, -202, 76, + 8, -80, -160, -102, -17, 155, 189, 1552, + -3498, -446, -103, -232, -205, -574, -132, 169, + 206, 1689, 1043, -736, -178, -93, -2969, 26, + -251, -148, 139, 70, -325, 117, -3073, 9, + 43, -11, -380, -190, -314, -3012, 50, -330, + -26, 710, 153, 19, -2943, 58, -3052, -56, + 7, 40, 9, 321, -37, -461, -22, -374, + 57, -203, 16, -15, -25, -16, -37, -8, + -41, -116, 7964, 70, -59, 77, 200, 0, + -43, 118, -72, -67, 104, -6, 78, 171, + 13, -103, 793, 98, -4738, -204, 11, 30, + -72, 33, -62, 47, 157, 236, -147, -416, + -726, 578, 5, 4038, 162, -2, 2367, -138, + -185, 470, 3121, 70, 185, -22, -205, 37, + -63, -335, -397, 43, 10, -6557, -112, -254, + 106, -129, -236, 0, -250, 42, -128, 84, + -531, -27, 2259, -282, -21, -70, -408, 19, + -664, 945, -196, -1074, 1369, -40, -3233, 28, + 20, -2133, 125, 343, 113, 584, -14, 50, + -130, -464, 513, 807, -4474, -63, 57, 1120, + 64, -30, 346, 462, 129, 219, -30, 287, + 448, 384, 198, -359, 1097, -256, 828, -2635, + -314, 336, 506, -144, 194, 167, 1323, -273, + -4168, 2805, -118, -8, 136, -82, -212, 53, + -259, -61, 94, 214, 11, 29, -262, -69, + 24, 102, 45, -31, -186, 58, 641, 659, + -172, 3628, -192, -423, 34, 3, 45, 19, + 349, 117, -5, -4923, 99, -148, 180, 631, + 50, -204, 641, -92, 156, -1985, 1077, 201, + 56, -405, 710, -220, -1917, -273, -234, 100, +}; + +static const int16_t cb2224sl0[] = { + -3113, 97, 229, 309, -156, -226, -469, 582, + -3202, -336, 102, 20, 96, -960, 297, -227, + 592, -3352, 2798, -637, -133, 191, -407, 170, + -576, -203, -280, 808, 853, -502, -113, -1704, + -1025, 411, 2802, 233, -568, 360, -616, -1715, + 47, 391, -2117, -458, -291, -149, -82, 26, + -29, -88, -156, 7905, 32, -75, -154, -78, + -44, 155, -1, -338, -891, 170, -75, 155, + 226, -192, -328, -239, -574, -91, 95, -600, + 4271, 25, 990, -207, 4676, 59, -324, 884, + 363, 65, 423, -776, -906, -79, -4, 1475, + 549, -252, 3584, 3543, -409, 282, 278, 125, + -379, 125, -180, -123, -252, -316, -193, 347, + 53, 2009, 195, 152, -104, 233, -75, -546, + 564, -177, 3243, -865, -924, 518, -692, -381, + -1885, -110, -188, 1140, -2043, -438, -1721, 1019, + 1678, 13, 273, -751, 922, -291, -15, 75, + 232, -112, 60, 2702, 88, 175, -119, 43, + -549, -1094, -1879, 401, 1587, 1287, -41, 41, + -116, -23, 313, 168, 147, -101, -57, -115, + -6990, 54, -14, -240, -164, 127, 25, -703, + -361, 769, 1555, -2440, -2616, -192, 86, 769, + -29, -721, 554, -663, 327, 659, -31, -79, + 91, 365, -74, 1268, 115, 480, 3054, -1758, + 1704, 759, -657, -272, -329, 31, -145, -534, + 1265, 73, 435, -54, 480, -867, 2724, 2373, + 890, -314, -112, -2576, -598, 473, 121, 2764, + 1659, 105, 579, -416, -87, 158, 300, 447, + -281, -6109, 35, 217, 185, 56, -357, 151, + 108, -49, -282, -484, -220, -78, -141, 256, + -1095, 1812, -985, 1115, 555, -2116, 2317, -1141, + -792, -866, -119, 187, 615, -194, 73, -43, + 268, 437, 250, -52, 477, -249, -475, -2621, + 590, -2987, -603, -652, 971, -684, 337, -140, + -336, 2342, 390, -204, 295, 85, -44, 321, + 754, 2660, 61, 782, 1654, -76, 2727, 1590, + -1099, 354, 49, 2784, 443, -762, 828, -308, + -493, -755, -370, -336, -207, 388, 630, -127, + 1955, 1929, 1270, 2054, 525, 388, 562, 942, + -789, -453, 158, 995, -99, 2258, -317, -493, + 385, -90, -79, 199, -1187, 519, -254, 179, + 573, 2803, 2341, 407, 95, 515, 332, 1, + -6, -337, 142, -316, 418, 542, 3281, 10, + 604, -542, -1595, 43, 79, 10, 75, -122, + 100, -55, 212, -223, -353, -557, 490, 4870, + -3689, 3594, -145, -192, -47, -252, -380, -180, + -221, 656, 78, -188, 120, 135, -253, -437, + -208, -151, -504, 217, -3715, -150, 528, 121, + -1468, 383, 823, -55, -1167, -8, -198, -515, + -296, -24, 84, 129, -472, 7, 5071, -114, + -200, -16, -271, 59, -430, -142, -315, 90, + 273, -56, 370, 3342, -159, 235, 934, 1605, + -1499, 207, -1650, 1137, 396, -2250, 276, -320, + -317, -23, 276, -519, 163, 566, 366, -6, + 2262, -2035, -662, -3300, -133, -3811, -362, -348, + 113, 146, -79, -298, 238, 221, 99, 194, + 326, 325, -112, -8160, -59, -15, 8, -41, + -261, -20, -6, -68, -140, -41, 167, -125, + 129, 337, 2404, 281, -336, -475, 2085, -2646, + 572, -1308, 376, 114, -506, 1062, -575, -529, + 3347, -212, 520, 274, -163, -3058, -93, -203, + -932, -207, -36, 303, -117, 278, 287, 204, + 205, -228, -242, 227, 3, 611, -190, -458, + -44, -209, 122, -390, -4561, -139, 1378, -329, + 440, 989, -1782, -348, 1241, 967, -477, -2312, + 554, -970, -1103, 473, -771, -50, 150, 327, + 394, -267, -648, -680, 2376, -2543, 276, 1220, + 552, 10, 1399, -1498, -801, 9, 2351, -55, + 155, 327, 88, 864, 428, 179, -3234, 6, + 544, -647, -306, 132, 329, 1147, 1920, 1436, + -2107, -1122, 341, 2020, -432, -97, 117, 793, + 100, -693, 174, 3639, -570, 910, -2771, 231, + -148, -960, -1085, 57, 188, 744, -709, -441, + 533, -295, 1287, 2939, 2987, 885, 611, 700, + 364, -205, -855, -617, 48, -162, -244, -318, + 208, 772, -124, -2505, 454, 330, -220, 335, + -362, -899, -827, 2188, -40, -1638, 356, -160, + -127, 2886, -69, -41, 209, 1847, -236, 2752, + -24, 387, 354, -111, 526, -237, -2169, 1319, + 2211, 144, -348, -434, -319, 1373, 78, 906, + 701, 539, -134, 414, 496, -325, -36, 116, + 124, 4198, -35, -439, -208, -531, -100, 1453, + -175, 723, -908, -461, 87, 127, -91, -125, + -140, 8012, -186, 23, -93, 107, 176, 218, + 35, 193, 174, -27, -4, 77, -103, -199, + 116, -41, -80, 186, -6965, -188, 125, -54, + 43, 9, -49, -192, 69, -136, -24, -117, + -2244, 2289, 145, 226, -1161, -1950, 881, -152, + 1611, 1015, -174, -277, -158, 369, 49, -233, + 221, 275, 69, 108, 136, -124, 1, -470, + 376, 149, -7596, 55, 53, 213, -247, 80, + -217, -11, 189, 125, -17, -141, 165, -2890, + 14, 201, 106, 242, -254, -306, -3157, 459, + -10, 24, -271, 877, 437, -438, 18, -126, + -9, 5553, 63, 22, 55, 172, 21, -335, + 127, 160, 208, 121, 13, 1989, 676, -294, + 2208, -78, 634, -1518, -1037, 1309, 124, -39, + -322, -1420, -404, 377, -35, -14, 178, 110, + -8146, 26, -98, -153, -243, 145, 280, -8, + 29, -57, 85, -309, 281, 282, -47, -27, + 2827, -947, 141, 856, -2481, 406, -638, -362, + -1031, 230, -341, -119, -17, 1, 190, 41, + -15, 5111, 59, 74, 123, -282, -25, -300, + 4, -460, -216, 295, -217, 26, 227, 62, + 385, 748, 2923, 1946, 391, -1676, 599, 148, + -456, -96, 1066, 478, 117, 255, -169, -669, + -1939, -656, 2676, 677, -2020, -1314, 425, -525, + -89, -522, 2707, 153, 5, -207, 244, -1045, + 331, -1315, -82, 449, -2444, 326, -484, -2232, + 2380, -591, -999, -2552, -1581, 349, -440, 217, + 298, -729, -6, -396, -74, 110, -70, -3543, + -388, -51, 596, 126, 295, 2075, -123, -693, + -1072, -1779, -420, 127, 432, -3241, -231, -246, + 105, -437, -67, -119, -2941, -257, 47, -969, + 379, 618, -93, 7, 202, -425, -38, 140, + 458, 3599, 242, -24, -811, -624, -19, 524, + 2398, -300, 111, 376, 2015, 431, 125, 231, + -293, -2379, -634, 1842, -1, -1326, -610, -88, + 128, 80, 75, 30, 172, -235, 34, 206, + -79, 328, 128, -283, -6862, -101, 260, 68, +}; + +static const int16_t cb2224sl1[] = { + -3710, -340, 3183, 200, -124, 423, -417, -432, + 232, -808, 85, -145, 39, 196, -197, -60, + -154, -213, -320, -2941, 993, 3044, -508, 61, + -853, 75, 40, 873, -765, -365, -621, -2670, + 188, 57, -403, -230, -137, 40, 565, -1910, + -1120, -1019, -603, -1927, 150, -3089, 23, -416, + -199, -3265, 15, 128, -525, -531, 91, -39, + 578, -388, 315, 40, 2376, 1762, 2, -1475, + -1774, 111, 934, -459, 777, -582, 114, -218, + -82, -195, 165, 2171, 632, -67, 239, 345, + -257, 104, -34, -879, 488, -422, -2156, -823, + 1940, 699, 2911, -233, -125, -218, -111, -335, + -3475, -61, -71, -445, 249, -330, 102, 376, + -116, 2667, -453, 19, -4129, 90, -507, 236, + 418, 43, 79, 61, 296, 181, 190, 408, + 216, 198, 32, -81, 245, -157, 5555, -162, + 318, 179, 339, -463, -448, -254, -526, -192, + -427, 575, 588, 2792, 2683, -853, -566, 19, + -26, 106, -220, 518, 734, -233, 68, -604, + -231, 256, -187, -59, -405, 206, 331, -25, + -4837, -323, 146, 541, 723, 915, -144, 450, + 102, -371, 27, 88, -80, 276, 239, 101, + 157, -69, -14, 234, -8192, -18, -110, -52, + -8, 48, 79, -43, 153, 187, 211, -118, + -111, 238, 11, -2006, 680, 478, -695, 3078, + -30, 892, -23, 1512, -194, 423, -16, -318, + 895, 406, 634, 47, -3277, -205, -764, 297, + -357, -61, -188, -1547, -868, -174, 342, 261, + 1926, 88, -35, -3250, -20, 3168, -368, 778, + 376, 167, 598, 442, 134, 487, 164, -32, + 245, 436, 2067, 595, -578, 49, -163, 633, + 138, -279, -99, 118, 1141, -3168, 580, -90, + -3192, 551, -663, -2673, -55, 147, 1307, 9, + 15, 432, 307, 527, 1002, -469, -2380, -342, + -293, -73, -259, 410, 309, 76, -320, -161, + 282, -3300, -7, 160, 732, 484, -65, 147, + 2923, 2321, -840, 1933, 268, 684, 1172, -377, + -365, -568, -283, 492, -538, 409, -194, 17, + -297, -52, -123, -270, 161, -94, 92, 4495, + -396, 540, 229, -30, -108, 29, 1, 198, + 492, -572, -394, -2386, 2787, 885, -1175, -129, + -1137, 220, 148, 261, -65, -244, 1, 58, + 195, -49, -290, -94, -21, 105, 71, 6641, + -200, -407, -496, -75, 233, 222, 549, 363, + 188, 739, -869, 122, -355, 3326, 323, -2366, + 115, -3207, 2783, 2015, 148, 924, -153, -133, + -175, -287, 400, 73, -181, -174, 72, 45, + 219, -92, -11, 59, -5407, -362, -188, -120, + 239, 249, 133, -229, 158, 180, -575, -2386, + -354, 248, 532, -590, 615, -85, -69, 394, + 3052, -877, -320, 484, 218, -463, -202, -841, + 1729, 284, 1253, 2193, 526, -2444, -351, 1287, + -373, 387, 440, -203, 163, -153, 206, -57, + -96, 2616, -84, 552, 33, 705, -731, -843, + -2197, -2138, -570, 22, -264, 2143, 725, -132, + -392, 471, -245, 51, 739, -1057, 1049, -760, + 2701, 456, 20, 484, 595, 3248, -1415, -862, + 332, -417, 323, -431, 2082, 78, 684, -169, + 596, -228, -219, 172, 160, -180, -228, -3193, + -520, -100, -447, -629, -2178, -259, -246, -1788, + -2264, 223, 115, -74, 230, -2515, 212, -179, + 456, 209, -2379, -246, -345, -102, -559, 259, + -270, -426, 333, -358, 2866, -589, -1494, -418, + -160, -138, 2088, 683, -1313, 1061, -88, 916, + -148, -2329, -301, -271, -249, 2822, -525, -405, + 592, -322, -1328, -16, 135, -582, -676, -503, + -2162, -327, -237, 361, 166, 600, 1176, 1015, + 97, -5, 465, 2321, -4544, 202, -350, 313, + 149, 544, -420, 552, 183, 351, -1663, 688, + 238, 587, 907, -1719, 1267, -2325, 368, 236, + 296, -2608, 240, 997, 496, 105, 75, -179, + 235, 125, -40, 57, -22, -412, -464, -494, + -81, 576, -3461, -1037, -744, 1358, -856, -284, + -536, 387, -358, 184, -85, 2150, -1142, -124, + 119, 1242, 648, 711, 2161, -591, -1864, -672, + 62, 1879, -13, 55, 285, -167, 142, -130, + 322, 8, -35, -230, 632, -699, 4114, -500, + -189, -48, 2746, 47, 421, -1200, 2418, 460, + -306, 331, 164, -1358, 802, 453, 458, 3594, + 3065, -24, -134, -437, -892, -110, 241, -368, + 336, 673, -147, 130, 154, 89, 81, -341, + 7151, 175, 118, -227, -282, 262, 276, -118, + -118, -245, 7, 144, -87, -136, -146, -484, + 70, 221, -220, -13, -7638, 93, -38, -319, + -478, 26, -28, 281, -180, 182, -186, 90, + 192, 50, -2919, 153, -2651, 289, 47, -783, + 768, 384, 39, 194, -2358, 1242, -1679, 80, + 1292, 28, 682, 2807, 342, 466, 299, -380, + 376, 4466, 12, 553, 153, -447, 733, 99, + 8, -142, 606, -2364, 168, 167, -62, 404, + -3144, 352, 115, -3734, 360, -202, -462, -196, + 464, -412, 192, -363, -413, -405, 254, 357, + -2801, 1054, -1602, 642, -254, -430, -2259, -97, + 16, -311, 757, -64, 412, 339, -227, -216, + -29, 219, 67, 63, 26, -232, -138, -301, + 241, -52, -6118, 223, -379, -157, -221, -201, + -93, -5630, -286, -194, 133, 46, 151, 444, + -472, 103, -115, -259, -53, 673, 1744, -2374, + 359, 2541, 613, -393, 1235, 221, -117, -842, + 1166, 105, -142, 1426, 3, -423, 36, 398, + -2742, 723, -740, 985, 498, 431, -1312, 832, + -1644, 146, -69, -110, 420, -130, 335, 269, + -2865, -67, -88, 50, 2735, 1038, 973, 371, + 654, -169, -112, 579, -319, 2434, -760, 710, + 241, -1889, 39, -1807, -30, 1383, -1080, 449, + 639, -2478, -760, 559, 298, 56, -421, 818, + -442, 1558, -1610, 2136, -12, -11, 592, 73, + 77, -172, 77, 92, -113, 281, 581, -584, + -4448, 507, -195, 183, -508, 312, -724, 1043, + -18, -10, -776, -534, 249, -3178, 904, 1234, + -482, 382, -1040, -448, -579, 227, -82, 5628, + -165, 255, 109, -141, 7, -28, 63, 93, + -211, 0, 162, 581, -153, 5844, -66, 122, + -102, -90, -205, -181, 243, 312, 111, -435, + -105, -343, 272, -141, 6, -98, -16, -73, + -26, -125, -7627, -73, -66, 108, -175, 186, + -189, -102, -240, -37, -354, -260, -120, 30, + 87, 2560, 3157, 369, -662, 338, -503, -66, + -1405, 178, 1100, -683, -2618, 2459, -1291, -248, + -139, -683, -865, 1445, 165, 368, 507, -585, +}; + +static const int16_t cb2224ss0[] = { + -6880, 657, -621, 69, 219, -588, 681, 229, + 248, -302, -110, 734, 12, 253, -454, -890, + -3596, 778, -2600, -256, 529, 332, -69, 295, + -455, 982, -265, -70, -332, -367, 1494, 586, + -158, -1054, 2529, -313, -661, -1302, -2486, 476, + 5, 126, 581, 361, 1618, 650, 2033, 202, + 76, -265, -161, 3659, -800, 1069, -167, -1792, + 389, -580, 597, -268, 621, -1035, 710, 854, + 2004, -785, 2714, 1659, 785, 800, -80, 9, + -341, -1032, 789, 651, 1068, -609, 661, 747, + -928, -999, -1369, -1173, -416, 1596, -2800, 330, + 546, -1275, -746, -392, -529, -378, 3571, -2795, + -731, -183, -330, -1591, 371, 866, 323, -516, + -89, 2277, 1593, 960, -1726, -2229, 727, -415, + 189, 500, -145, -177, 550, 467, 240, 1131, + 474, -419, -1236, 674, -616, -519, 2439, -1213, + -650, 867, 974, -908, 1229, -512, 932, -495, + -2521, -865, -466, 8, -426, 912, -77, -236, + -407, 433, 128, 3653, 854, 243, 770, 191, + 224, -68, -453, -383, 279, -701, -691, 282, + -449, 1148, -783, 241, -5021, 643, 8113, -345, + 13, 90, -57, 475, 64, -268, -163, -100, + -95, 518, 577, 541, 2055, 358, -157, 360, + 280, -840, -1161, 500, 95, 302, -662, 1134, + 827, 3300, 695, 775, -798, -2651, -2891, -1123, + 555, -1125, 156, 328, 671, 751, -347, -972, + -392, -1216, 2725, -5152, -402, -15, 150, 31, + -182, -278, 245, 81, -3, -46, 310, -72, + -138, 1511, -1762, -1840, -364, 123, 2801, -16, + -543, -1312, 562, -262, 148, 521, -711, 61, + -863, 145, 329, 761, 76, -155, 101, -4986, + 192, 269, -364, -174, 640, -261, 629, 3638, + 397, -1757, -1177, 342, 388, 1089, 824, 115, + 150, 125, 806, 1271, -198, 800, -175, -897, + -649, -837, 690, -755, 1416, -2347, 1179, -781, + 826, 1567, -148, -156, -1036, -1572, 1248, -187, + 464, -260, -749, -1070, 85, -466, -2160, -2802, + 233, -181, 447, -482, 113, 548, 2957, -1600, + 1341, -559, 803, 2085, -807, -711, -1169, -456, + 657, -76, -147, 1932, -1054, -967, -1100, -49, + -2829, 1412, 929, 1207, 58, -146, 77, -458, + 538, -627, -12, 214, -2397, 692, 1284, 366, + 1286, 1997, -856, 267, 1866, 1236, 25, 254, + -1187, 3456, 283, 584, 2348, 604, -1130, 7, + 500, 232, -51, 120, -695, -930, 317, 67, + -1346, -500, 312, -1060, -2338, -1860, -1491, 1539, + -1707, 778, -653, -41, 401, 311, -13, 2155, + -1011, 1163, 712, 2090, 1336, -726, 574, 1200, + -1254, -1567, 723, 683, -877, -653, 1137, -1594, + 1127, 2641, 465, 259, -2095, 696, -405, 40, + -259, -808, -942, 395, -180, -1119, -966, -230, + -534, -114, 88, -661, 757, 75, -286, -119, + 924, -2925, 2483, 1662, 1823, 590, 4307, 810, + 447, 165, 243, -184, -162, 436, -126, -194, + 365, 601, -354, -1983, -211, -663, 276, 155, + -696, -2542, -830, 2374, -235, -585, -469, -478, + 21, 867, -1633, 1949, -949, -330, -546, 328, + -224, 1236, 266, -1117, 36, -61, 221, 153, + -3491, -1463, -237, 4676, -241, 273, 268, 347, + -393, -277, 168, 426, 155, -65, -605, -569, + -1416, -1303, 1248, 595, -148, 512, 3622, 291, + -444, -523, 616, 105, 101, 1357, 772, -337, + 494, 570, 15, 150, -400, 572, 590, 1674, + -4106, 940, 167, -327, -336, 696, 591, 362, + 279, 4489, -1325, 608, 294, -41, 549, 982, + -31, -184, 367, 77, -466, 398, -1928, -607, + 239, 55, 15, 1031, -486, 2788, 2151, -519, + -1197, -1144, 274, 671, 1620, 2079, -1555, -961, + 543, -11, 26, -627, 777, -581, -1060, -1177, + -808, 807, 2863, 607, 144, 195, -274, 18, + -5656, -355, -1026, 56, 116, -431, -493, 517, + 286, 353, 353, 199, -651, -863, -276, -556, + -562, -867, -143, -355, -323, -14, -54, -5354, + -43, -1592, 8, -543, 24, 94, -731, -545, + 705, -171, 504, -1078, -3367, 1349, 452, -148, + 1183, -1650, -1400, -246, -1032, -119, -309, -566, + 998, -3240, -444, -658, -605, -186, 491, 439, + -190, 688, -29, -965, 2562, -112, -329, -25, + -2593, 355, -53, 692, 12, -593, 1930, -804, + -82, 386, -632, 927, 1006, -229, -1147, -181, + -1075, -245, -3678, 904, -298, 2263, 50, 563, + 337, -1051, 173, 310, -3540, -615, -504, 749, + 192, -90, -113, -730, -1994, 802, -45, 2234, + 167, 289, 1722, -562, 682, 453, 1571, 171, + -2429, -441, -230, -1144, 985, -1602, 358, -685, + -23, -523, -529, -2438, 700, -624, 37, -1475, + -1318, 3292, 702, 394, -798, 2563, 1057, -335, + 614, 270, 3135, -1281, -2089, -250, -140, 45, + -517, -470, -1429, -172, 2637, 267, 55, -1037, + -174, 912, -865, -786, -406, 537, -2805, -642, + -1599, 888, -1044, -175, 312, 28, -1157, -240, + -181, 298, 521, 3802, -87, 93, 48, 1336, + -1071, -1870, 339, -1106, -944, -1036, 361, -3719, + -147, 625, 326, -122, 407, -217, 396, 273, + -2, -315, -262, 632, 6868, 228, -267, 207, + -29, -274, 192, 63, -353, 588, 550, -3, + 156, 2115, 1580, -2366, 306, 633, 1354, 2313, + -360, -345, 270, -499, -976, -3685, -1305, 907, + 1431, 1545, -1334, 18, 1159, 229, -124, 157, + 470, -105, 700, -1786, -1895, 795, -1052, -278, + 745, -111, -45, 694, 599, -3469, 552, -70, + -222, 45, 896, -251, 1, 250, -769, 301, + -1151, 1313, 4314, 710, 680, -169, -663, 40, + 399, 1171, 581, 775, 936, -488, -2918, 155, + -169, -1560, -862, -473, 783, -72, -1791, 567, + -2109, -156, 1250, -1486, 3253, 61, -50, -374, + -277, 942, 111, 607, -316, 197, -748, 871, + 612, -242, -296, 53, -193, 1233, 11, -962, + 505, -4492, 21, 754, -150, 451, 183, 881, + -652, -159, 6384, 170, 271, 1035, 401, 48, + -463, -240, -95, -625, 613, -91, -1138, 1172, + 542, -1483, -2638, -1396, -1173, 612, 512, 1355, + 977, -362, -22, -17, 124, -3178, -532, 352, + -2691, 610, 569, 740, -1603, -5, -492, 704, + -436, -96, -595, -1495, 2730, -3089, -164, 565, + 1300, -477, -569, 1069, 294, -233, -133, 708, + 150, 388, -2108, -1042, -1603, 2275, -1722, 561, + 140, 507, -899, -281, 162, -1297, 1504, -158, + 193, -730, -944, -2484, 615, -30, 32, -354, + -383, 86, 329, -3434, -382, -1604, -299, 208, +}; + +static const int16_t cb2224ss1[] = { + 8192, -187, -471, -201, 185, -465, 976, 257, + 83, -530, 310, 676, 341, 48, 265, -351, + 306, 280, 302, 48, 496, -339, 424, -5250, + -253, 604, -317, -289, 278, 573, -579, 79, + 3218, -574, -377, 276, 2831, -287, -254, 332, + -225, 42, 162, -457, -959, -1421, 683, -59, + -33, 3362, 393, 606, 249, -873, -930, 1224, + 1469, 37, -1592, 1665, -582, 1729, 284, 106, + -4753, -120, -475, 867, -444, -203, 431, -11, + -526, -324, 732, -1070, -160, -611, 1808, -297, + -536, -194, -822, 1224, 2220, -2330, 72, 1004, + -787, -149, 557, 2925, 29, 809, 2397, -1143, + 648, 904, -568, -707, -839, -274, -1322, 1177, + -467, -482, -5181, 234, 223, 354, 386, 737, + 1273, 234, -353, 31, -8, -392, 85, -234, + 1366, 1449, 120, -695, 838, -622, -96, 382, + -1421, 612, -173, -3199, -150, 474, -394, -561, + -1171, 2541, -271, 2513, 670, 285, 636, -452, + -202, 1319, -2182, -935, -586, 243, -813, -41, + -53, -1041, 212, 58, -3424, 111, 268, 964, + -3231, -500, 867, -191, 207, 543, 383, -1509, + -2712, -2752, 201, 428, 721, 498, 19, -747, + 67, 87, 500, 1200, 2244, -1158, 466, -1032, + -153, 1197, 2737, -324, 2002, -338, 89, -428, + 78, 575, 330, 2013, 175, 305, 567, -539, + 17, 384, 485, 860, 3330, 173, 586, 649, + 388, 963, 1820, -2610, 251, -2966, 1383, -153, + -146, 564, -718, 998, -1283, -566, -619, 394, + 459, -1233, 2566, -357, -2601, 98, -929, -367, + -501, 96, 1217, -1695, -324, 393, 261, 1745, + -1095, -751, 924, 1044, -337, -1243, 393, 2454, + -1499, -245, 902, 925, -2126, 167, 838, 638, + 2296, -294, 306, -715, 2794, 1522, -339, 21, + 318, -95, 1334, 75, -173, -91, -2012, -920, + -801, 334, -3363, -348, 550, -911, -261, -1073, + 185, -425, 431, 515, -339, 1817, -1589, 241, + 548, -337, -471, -3532, -1166, 888, 141, -277, + 1353, 310, -654, 198, -516, 2951, 2251, -534, + 701, 237, 20, -597, -301, 3, 410, -456, + -581, -1254, 1052, 1321, 165, 3108, 477, 196, + 2716, 85, 5, -34, 721, -562, 4, 84, + -793, 744, 243, 134, -385, -129, -122, -128, + -333, -483, -604, 269, 6209, 3, 515, -63, + -634, -551, -795, -1696, -2210, 2184, 348, 30, + 413, 2531, 214, 214, -186, -72, -552, 958, + 1727, -1639, 618, -61, -432, 365, -753, 15, + -14, 33, 976, -940, -355, 3318, 677, -1938, + 21, 881, -326, -83, -3355, 1483, -1211, -674, + 166, 139, -276, 158, -736, 1038, -1005, 1129, + 1219, 1115, -392, 558, 96, -188, 314, 536, + -423, -3262, 395, -130, 1099, 304, -181, 853, + -160, -1272, 428, -179, 634, 608, -173, 2690, + -2191, 1385, -518, -416, 3239, 3250, 313, -23, + 200, 643, -639, -17, -208, 27, -182, 262, + -203, -671, 157, -4131, 383, -404, 337, 51, + 431, 92, 138, -438, 29, 337, 488, -252, + 656, 509, 2037, -635, -1074, -1115, -2135, -772, + -386, -214, -654, -441, 1661, 542, -383, -1720, + 22, -103, -1474, -1288, 4361, 282, -1252, 734, + -858, -556, 294, 243, 293, 133, 848, 65, + -727, -887, -1314, 443, -96, -422, 4268, 672, + 142, 608, -442, 843, 365, -866, -157, 780, + 107, -888, 2089, 1769, 73, 739, -15, -1730, + -1235, 920, -1713, 163, 552, 1479, -692, -755, + 1430, -193, -276, -264, -690, 772, 1403, -40, + 679, -260, 642, -3562, 962, 2053, 1348, 36, + -2974, 155, 303, 821, -944, -179, -967, 632, + -725, 411, -447, -463, 694, -337, -146, 59, + -1, -416, 12, 524, -497, -4682, -745, 625, + 1011, 20, -462, -503, 2012, -475, -27, 85, + -1190, 534, 2250, 87, 2591, 1195, 1665, 423, + -813, -571, -372, 2601, -2013, -853, -734, -403, + 793, -549, 1243, 312, 722, -1013, -1434, -749, + -571, 494, -88, -129, 1331, 806, -1227, 326, + -1164, 2487, -59, 2346, 583, 519, 368, 793, + 1178, 661, 140, 1226, 378, -429, -1214, 1438, + -319, -77, -1495, 3598, 361, 21, 39, 1930, + 198, 1050, 531, 274, 32, -499, -349, -5, + -133, -3324, -379, -742, -250, -1618, -1536, 2084, + 1369, 765, -132, -324, 406, -2198, 314, 502, + -1431, 759, -729, 320, -2120, 1484, 2468, -3283, + 4, 272, -2, 492, 91, -803, 48, 691, + 375, 87, -508, -725, -632, 268, 2929, 1302, + -11, -628, -2225, 723, 533, 909, 934, 682, + 350, 1509, -707, -1142, 106, -2174, 342, -965, + 456, -655, 1137, -553, 415, -418, -2631, -121, + 237, 3, -1123, -1555, -1413, -3333, 717, 115, + -1030, -1007, -819, 130, -851, 281, -43, -473, + -1091, 326, 869, -377, 278, -148, 418, -2104, + -422, 623, -1777, 633, 1033, -2031, -1221, 4126, + -60, -16, 8025, 243, -340, -599, -501, -289, + -219, -104, -230, 464, 191, 18, 345, -65, + -68, -481, 625, -822, -4011, -516, 741, 734, + -316, 530, 122, 945, 371, -298, 1194, -250, + -167, 392, -95, -151, -1, -486, 189, 90, + -140, 30, 4485, 581, 54, 1905, -895, -2032, + -174, 2473, -688, -104, -315, -376, 830, 296, + -548, 754, 195, -901, -1548, -1931, 792, 510, + 294, 153, 619, -1034, -3038, 1134, 142, -29, + -806, -118, -29, -2314, -159, 770, -2899, 23, + -1045, 1037, 1496, 1104, -527, 135, -281, -310, + -59, 202, -346, -612, 206, 27, -456, 758, + 67, 3547, 867, 227, -3, 573, 1440, 421, + 170, 1491, -691, -43, -8, 784, 307, 557, + 618, -2387, 566, -396, 182, 877, -2666, -163, + 553, -155, 691, -188, -1584, -1085, 1033, -308, + 1356, -570, -721, -232, -3145, 104, 511, -964, + 2783, -685, -168, -51, 1554, -1816, 2431, 327, + -440, 1174, -265, -36, 120, -397, 1094, -1254, + -973, 574, 1085, -139, -751, -529, -240, 25, + 1137, -467, -3471, 338, -806, -2028, 94, -98, + -336, -537, 1189, -880, -3607, -168, -59, 100, + 309, 1097, 295, 262, 106, -8, 210, -7461, + 395, -248, 461, 490, -326, 264, 105, 13, + -160, 608, -443, -1331, 835, -1342, 3507, 763, + 966, 101, 1047, -469, -1455, -1080, 28, 99, + -44, 270, -752, 130, 2, 57, 358, -409, + 2, -658, -812, -899, 155, 141, 2101, 3616, + 40, -1957, -1028, -4137, 212, 1580, 578, 1019, + -512, 167, 366, -580, 448, 216, 79, -149, +}; + +static const int16_t cb2224sm0[] = { + -4334, 1434, -228, 1477, -1329, 230, 686, -558, + 486, -188, 424, -454, -568, -141, -326, -132, + -39, 2488, 9, 631, 513, 460, -417, 2656, + 633, -1404, -81, -283, -287, 480, 2558, -19, + -158, -2699, 405, 276, -639, -151, 529, 241, + -941, -796, -213, 1125, -391, 2515, 78, -177, + 2677, 217, 955, -687, 867, -485, -121, 1023, + -1572, -591, 139, 798, 1262, -467, 722, 2643, + -237, -1048, 386, -432, 180, -788, -178, 234, + 403, 267, 312, 2661, 585, -2775, -686, -88, + -16, -1243, -445, -259, 303, 298, 285, 277, + 2355, 163, -2399, -416, 115, 2277, -707, 194, + 283, 1183, 23, 119, 97, 8192, -40, 67, + -101, 151, 169, 21, -147, -160, 55, -207, + 550, -36, -500, -32, 225, 206, 72, 179, + 464, -406, 52, 696, -18, -4827, 1547, -516, + -2275, 855, 430, -523, 83, -1633, -1898, 285, + 202, -645, -167, 102, -124, 382, 24, 236, + 830, 324, -84, 491, -95, -154, 767, 25, + 4741, -574, -2576, -297, -250, -346, -2867, -64, + -1119, 1007, -883, 457, -328, -854, -981, -55, + 6922, 569, -307, 261, -100, -832, 129, 416, + -154, 681, -136, 1152, -144, -26, -2266, -320, + -141, -897, 544, -206, 845, -590, 88, 211, + -1761, -574, -653, -2788, 252, -266, -4252, 295, + 97, -2112, 209, -144, 655, -89, -369, 591, + 205, 1137, 30, -2907, 88, 92, -240, -3106, + -16, -398, -576, -720, 421, 427, -423, -195, + -18, 2503, -133, -918, 104, -512, -489, 2623, + -314, 215, -103, -1014, 761, 382, -1456, 1719, + -980, 248, 55, 644, -1945, 42, -162, -35, + -852, 1993, -189, 664, -149, 3132, -50, 3438, + 550, -234, -566, 434, 64, 379, -169, -291, + -718, -608, 31, -207, 651, -2567, -790, 906, + 518, 1740, 373, 1158, 114, -2044, 285, -1136, + -373, 932, -2185, -488, 148, 3, 724, 623, + -568, -359, -2748, 751, -1098, -858, -1140, -253, + -2377, -402, -312, -398, -47, -2618, 816, -568, + 1274, -158, 118, 107, 181, 394, 2758, 80, + -3057, 20, -279, 110, 482, 1010, -162, -1081, + -56, 685, 2207, -10, 82, 440, 593, 43, + 1010, -853, -624, 288, -3045, -426, 9, 132, + 104, 157, 466, -118, 116, 226, -214, -219, + 299, 6093, 122, 7, 174, 444, 200, -42, + -4, -313, 99, 218, 292, -159, -409, 523, + -1357, -4098, -96, 968, 8, -172, -444, -1040, + 755, -476, 967, 175, -100, 1689, -813, 3175, + 369, 1828, 248, -161, 6693, 631, 536, -125, + 274, -467, 259, -427, 130, -523, 361, 584, + 27, 60, -57, -30, -8192, 148, -64, 217, + -308, 163, -116, 89, 108, 191, -129, -149, + 128, 60, 575, 253, -385, -2937, 888, -1402, + -543, -607, 2639, 156, 251, 6966, -147, -382, + -388, 39, 476, 260, -1048, 575, 401, -245, + -441, 121, 389, -666, 95, 2919, -2212, -765, + 169, -161, 184, -320, -315, -497, 136, -470, + 479, -541, 712, 2966, 519, 2595, -77, 1089, + 18, -697, -616, 241, -54, 388, 461, 368, + 144, -149, 181, 7699, 11, 3, -368, 65, + 304, 358, -29, 255, -162, -169, -470, -16, + 198, 92, 2137, 233, 273, 255, 4078, -279, + -194, -274, 101, 45, -225, -716, -2522, -188, + 10, -590, -745, 894, 1976, -48, 2302, -4, + -4691, -67, -1325, -506, 605, -297, 317, -271, + -176, 1706, 541, 1, 31, -580, 103, 148, + -122, -141, -849, 76, -3094, -67, 2775, -38, + -598, -314, 793, 40, 324, 1474, 1986, 1505, + 832, -504, 739, -1233, 1201, 695, -1363, 670, + 805, 696, -137, -4977, -306, 137, -885, 455, + 1021, 600, -1711, 536, 235, -149, 31, -5, + -3747, -405, 394, 140, 102, -1576, 190, 408, + 663, -2075, -747, 466, 631, 807, 1867, -655, + 102, 341, 435, 551, 500, 426, -650, -88, + -26, 2672, -1791, 34, -86, 2963, -3330, -793, + -307, 277, -584, -240, -141, 258, 708, -242, + -499, 808, -104, -2061, -518, 684, 889, 406, + 259, 211, 462, 428, -2597, -1147, 1729, 683, + -2173, -167, 392, 440, 599, -815, -624, -368, + -2962, -172, 845, 423, 362, 711, 2131, -3899, + 84, 147, 826, -399, -637, 1132, 108, -480, + 230, 265, -423, 48, 11, 239, -599, -281, + 10, 541, -397, 142, -4322, 1172, -257, -101, + 292, -321, -401, 60, -309, 468, 267, 611, + 438, -638, 2194, 346, 1421, -1192, -3109, -170, + -3336, -49, -69, -75, 184, 3094, 591, 82, + -373, 140, -22, 848, 124, 589, 157, -4, + 260, -177, 147, 73, -284, 6253, 111, 302, + -74, 356, 381, -547, -16, -275, -500, 93, + 344, -346, -2837, 364, -43, -592, 1741, -702, + -2247, 848, -203, 168, 758, -849, -2454, 562, + 1104, -169, 463, -398, -2759, -299, -903, 647, + -62, -124, 301, 337, -201, 463, -86, -139, + -2189, -2424, -942, -376, -2043, -80, -1791, -1580, + 513, 29, -1115, -582, 1214, -642, 355, 240, + 285, 1759, 1209, 862, 1707, 3353, -223, 245, + -515, -928, 794, -190, -282, 1097, -32, 1675, + 857, -730, -15, 102, 356, -309, 3867, 24, + 93, 899, -608, -497, -215, -2244, 735, -194, + 102, -51, -1939, 846, 74, -116, 7, 1981, + 512, 233, 574, -2508, 83, 1966, -251, -96, + 532, 97, 897, -1120, 390, -3192, -652, 2045, + 193, -880, -398, -148, 548, -281, -19, -987, + 467, -326, 2777, 195, 1560, 1034, -828, 102, + -1531, 1292, -126, 539, -247, 36, 55, -2487, + -297, -362, 482, -2241, -1021, -1535, -244, 38, + -3416, 141, 3408, 35, -67, 95, 333, -427, + -235, -128, 304, -548, 337, -349, -330, 23, + -450, 1657, 327, -3087, 695, -273, -1090, 1262, + -111, -868, 1516, 269, 119, 192, 14, 200, + 141, -395, 7145, 48, 334, 143, -139, 154, + -102, -312, -2, 283, 238, -30, 626, 1328, + 242, -416, 442, -3050, 1388, -100, 1215, 817, +}; + +static const int16_t cb2224sm1[] = { + 8192, -13, 346, -52, 5, 131, -294, -167, + -65, -347, -438, -559, 57, -86, -223, -224, + -251, 629, -58, 5249, 127, -464, 644, 210, + -154, -480, 165, 211, 13, 318, 152, -173, + 5451, 235, 170, -100, -6, -460, -249, 390, + 54, 993, -1637, -288, -978, -197, 234, -2877, + -570, -151, -82, 772, 199, -385, -1899, 345, + -25, 527, -477, -2918, 385, 2784, 78, -524, + -759, 795, 433, 511, 856, -275, 511, 136, + -444, 151, 233, 208, -589, -375, 282, 2886, + 30, -2749, -930, 1079, 86, -2285, 980, -229, + -1369, 93, -80, 2314, -170, 1224, 397, 405, + 463, 1014, -377, -90, -269, -82, -376, -773, + 684, -94, -2893, -323, -644, -849, -1892, -2244, + 417, 2165, -164, 221, 454, -2337, 142, 99, + 418, 486, -49, 97, 138, 2221, -2301, -156, + -578, 3963, 196, 140, -374, 180, 451, 354, + -952, 946, -479, -874, -159, 145, 290, 240, + -240, -233, -418, 226, 2878, -571, -2491, 741, + -1438, 557, 197, -370, -4720, 379, 32, 821, + 39, -545, -141, -1507, 192, -1150, 905, -1095, + -5028, -169, 533, -23, 371, 162, -1198, 465, + -369, -14, -861, -656, -701, -296, 31, 450, + -387, 3060, -696, 597, 14, -1019, -2741, -208, + -1186, -338, 712, -64, -344, 41, 327, 9, + 576, -349, -2808, 2428, 433, -566, 908, -108, + -145, -1011, 201, -3042, -327, 210, -368, 230, + -310, -400, 12, -1034, 1734, 992, 1842, 1022, + 2162, 588, 366, 154, -3078, -587, 1096, 215, + -1072, -784, 472, -1089, 94, 487, 18, 72, + 34, -15, -374, -607, 316, 830, -146, 4377, + -301, 390, 838, 121, -110, -143, -93, 2988, + 2914, -352, -353, -744, -115, 99, 495, -343, + 309, 1261, -519, 101, -2662, -44, -3139, -491, + 1142, -323, -50, 776, 86, 187, 480, 271, + -167, 1, -267, -99, 991, 2492, -152, 2423, + -225, 34, 576, -1486, -236, -375, 160, -176, + -145, 2525, -131, 194, 317, 1215, 1553, 295, + -1408, 130, 2279, -1185, 2671, -137, -324, -23, + 26, -779, -431, -4, 488, -186, 174, -119, + 3062, -149, -168, 191, 169, 1124, 301, 1471, + -409, -999, -166, 2174, -1405, 992, -179, -2606, + -71, -3151, 92, -976, 3091, -322, 310, -374, + -779, 599, -55, 425, -697, 63, 27, -38, + 86, 170, -11, -616, -97, 525, 78, 14, + 684, -5556, -308, -444, 266, -396, -1665, 86, + -722, -1087, -921, -525, 3, -439, -1600, -37, + 2038, -2672, -187, 361, -8192, 425, 365, 54, + 343, -703, 253, 284, -57, -327, -154, 392, + 99, -181, 213, 395, -2412, -303, 182, 82, + 2311, 45, 1801, -209, -988, 42, -1430, 38, + -721, 118, -163, 1279, 2184, -18, 2851, 274, + -363, 297, 150, -220, 3653, 3135, -381, 335, + 254, 378, -52, 52, 328, -383, -61, -802, + -409, -49, 49, -8192, 362, -48, -430, -54, + 255, 243, -525, 14, 152, 10, -392, -301, + -594, -539, 1200, 626, -2979, 233, -1504, 664, + -728, -1293, -491, 394, 1317, 298, 169, 214, + -429, -1083, 42, 389, 4751, 510, 299, -542, + 456, -852, 30, 208, -63, -131, 72, -425, + 73, 213, -287, -277, 43, 128, 5528, 165, + -316, -135, -576, -583, 217, -1298, 47, 134, + 103, -1894, 148, 3406, 880, 964, -697, -94, + -1626, 223, 1256, -514, 2079, -529, 1917, -1452, + -616, -605, 385, -963, 395, 105, -154, -1627, + -214, 40, 969, -708, -1492, -824, 2457, 275, + 404, 876, -781, -1029, 34, 72, 229, -137, + 264, -387, 305, -57, 2908, -143, -249, -2473, + 202, -1467, -364, 2094, -521, -70, 260, 132, + 465, 71, 982, -36, 1792, 306, 2907, -55, + 254, 421, 231, 140, 1727, 474, 761, 3153, + -18, -356, 414, 2218, 564, -247, -510, 67, + 2390, 2531, 240, 117, -487, -310, 261, 222, + -286, -861, -2180, 480, -75, 4769, -407, 248, + 227, -224, 302, 901, -1200, -728, 1025, 734, + -336, 115, -1726, -179, 131, 43, -357, 364, + -681, 283, -189, 715, -2793, -692, 1367, 916, + 28, -500, 3094, -543, -627, -709, -506, -1094, + 34, -2464, 434, 257, 357, 10, -390, 3206, + 3483, 137, 147, 180, 231, -260, -707, -818, + 476, -528, 656, 824, -8, 3073, 362, -3034, + -199, 47, 694, -252, 819, -147, -479, -32, + 530, -141, -91, 251, -154, 376, -603, 2305, + -2853, -622, 316, -680, 402, -819, 323, 471, + -47, 1772, 1507, -1052, -685, 18, -2509, -418, + 377, -31, -412, 105, -906, -267, -2806, -189, + -97, 198, -802, -82, -658, -2980, 795, -447, + 646, 1037, 486, -689, -2654, 55, -3534, 540, + -68, 502, -90, 277, -87, -497, 24, -246, + 400, 392, 348, 76, -345, -231, -71, 155, + -7, -226, 6553, 371, 261, -290, 88, -44, + 311, 470, -5, 182, -105, 56, -324, 267, + 241, 327, 966, 218, -4695, -968, 27, -352, + -315, 202, -204, 435, 360, -539, -375, -527, + -1157, 1010, -241, 4171, -292, 66, 2343, 310, + -682, 595, 3040, 539, -118, -573, -128, 952, + -172, -547, -285, -1, 345, -5701, 345, -153, + 77, 349, -225, -364, -655, -270, -716, -825, + 27, 55, 2179, -154, -275, 359, -501, -992, + -665, 1538, -218, -1159, 2176, -845, -3018, 105, + -459, -3146, 67, -197, -293, 539, 115, -74, + 119, -158, -89, 1449, -3006, 104, 651, 886, + -310, -242, 1219, 1805, 176, 2235, 579, 294, + 634, 1345, -1, -454, 755, -1030, 1760, -2404, + -406, 894, 614, -74, 113, -1325, 1843, -392, + -3239, 2440, -54, 222, 1349, -695, -1009, 434, + -468, -509, -280, 462, 228, 573, 213, 55, + 325, 557, 100, -721, -674, 600, 795, 1567, + 407, 3273, -58, -1330, 349, -181, 417, -503, + 911, 350, -681, -4502, -127, -26, 330, 618, + 241, -147, 284, -226, -127, -2692, 484, -146, + -18, -416, 755, 85, -3119, -404, 0, -478, +}; + +static const int16_t cb4432l0[] = { + -3764, -227, 184, -258, -1713, 122, 410, -32, + -244, -1337, -328, -20, -236, -359, -13, -52, + -75, -260, 426, -96, -37, -38, 117, -938, + 487, 60, 286, 571, 368, -551, 198, -102, + 15, -11, 4535, -127, -241, 114, -77, -316, + 302, 195, -149, -73, 357, -128, -23, 34, + 319, -97, 189, 5918, -20, -134, -47, -249, + 7, 3, 116, 7, 48, 47, 92, 19, + 14, 31, -388, -329, -1878, -944, 958, 632, + 1973, 182, -130, -193, 2309, -868, 63, 260, + -12, -89, -88, -208, 127, -168, 237, 74, + 1153, 925, 2292, 2992, -35, 204, 766, -930, + -87, 341, -101, 501, 35, -182, 112, 91, + -28, 79, 193, -73, -71, 52, 82, -427, + -147, -69, 4722, 468, -187, 98, -295, 292, + -991, 43, 98, 225, -555, -595, -66, -181, + 91, -152, -3, 89, -219, 356, -375, -114, + -1546, -620, 648, 1946, 39, -608, -942, 103, + 179, 170, -2350, 157, 1132, -944, -283, 64, + -393, 15, -90, 761, -185, 644, -360, 5, + -5212, 106, -136, -40, -159, -40, -120, -43, + -8, -195, 208, -179, -295, -63, 19, 32, + -104, -23, 132, 660, -460, 237, 523, -676, + -378, -81, -184, 2718, 64, 531, 2119, -1564, + 614, 933, 6, 65, -50, 55, 243, -539, + 1168, 953, -283, 45, 476, -346, 2285, 1892, + 615, -521, 23, -2079, 57, -11, 208, 1029, + 371, 28, 170, -63, -167, 184, -217, 76, + -320, -2747, 542, -2098, -407, -10, -876, -1477, + -306, 565, 57, -49, -111, 185, -250, 120, + -186, 214, -520, 463, 792, -2420, 2760, -383, + -783, -1097, -441, -535, 1070, 78, 96, 122, + -193, 516, 114, 100, -413, 100, -23, -153, + 1267, -4210, -742, 228, 659, 399, -169, 412, + -81, 1056, 4, -254, 173, 109, -218, 196, + 64, 26, -113, -60, -8, 15, 5497, -76, + 169, -294, -394, 596, 379, 12, -64, -203, + -138, 41, -249, -53, -44, -19, 55, -34, + 99, 36, -70, 8, 46, 2787, 842, 1917, + -693, -424, 151, 464, -1162, 1027, 148, -1027, + -173, 328, 23, 792, -184, 395, -684, 229, + -139, -7, 2788, 404, 43, -1508, -590, 6, + -184, 904, 475, -37, 276, -361, 1924, -188, + -113, -1334, -176, 11, -34, -70, -68, 95, + -433, 225, 437, -451, 471, -272, -385, 2793, + -2685, 544, 881, 409, -789, 700, -5, -144, + 66, -17, 504, -397, 264, 74, -81, -1803, + 444, -573, 633, -391, -3339, 192, 484, 1126, + -306, 153, 303, 61, -253, -255, -57, -277, + -88, -100, 32, 79, -1320, -857, 3080, 1178, + 323, 353, -149, 1316, -399, 236, -129, 231, + 323, 696, 59, 1217, -567, -268, 642, 384, + -327, -47, 466, 1530, 1092, -1176, 612, 257, + -143, -270, 487, -62, 332, 1089, 961, -706, + 938, 78, 97, -2805, -1088, -871, -273, 87, + -345, 148, 113, 167, 97, 31, 68, -47, + -53, 53, 29, -5723, -53, -12, 241, 92, + 131, 139, 48, 102, -26, -47, 664, -580, + -7, 1287, 2531, 1061, -710, 24, 1389, -1742, + 254, -1147, 539, -150, -24, 495, -204, -171, + 955, 202, -111, 147, -1458, -3973, 421, -416, + -544, 392, 1419, -178, -168, -53, 50, -537, + -7, -346, -289, -52, -38, -259, -115, -136, + -138, -89, -205, -661, -4429, -110, 380, -721, + -180, 127, -1371, -78, 276, 319, 229, -934, + 267, -353, 44, 65, 449, -32, 159, -11, + -22, -571, 100, -676, 2892, -2740, 907, 511, + 248, 441, -62, -517, -347, -235, 319, -8, + -140, 309, 258, -106, 215, 1, -3252, 426, + 455, -2213, 1031, 430, 746, 367, 602, 187, + -147, -200, 97, 555, -107, -249, -71, 101, + 59, -94, -64, -33, 221, 184, -791, 671, + -191, 284, -1311, 402, -29, 250, -190, -503, + 38, 106, 586, 4767, 526, 147, -182, 249, + 146, 17, 293, -1095, 1079, -161, 141, -2, + 681, -275, -171, -4504, 61, -105, -306, -66, + 229, 20, -102, -93, 334, -189, 5, -6, + 417, 2551, -63, -852, 1608, 1820, 670, 1592, + 102, 203, 147, -767, -147, 310, -718, 175, + 551, -98, -202, 309, 70, 81, -55, 1518, + 222, 338, -356, 349, 97, 86, 495, -233, + -121, 2936, 200, 935, -381, 2474, 53, 494, + 248, -139, -45, 100, -1287, -181, -370, 311, + 287, 3016, -96, -128, 2146, 567, -383, -551, + -96, 144, 495, 428, -32, 137, 27, -272, + -149, 9, -61, 177, -5236, 91, -837, 611, + -279, -74, 652, 14, -178, -82, -89, 347, + -245, 647, -62, 49, -215, 29, -55, -27, + 178, 79, -19, -59, 177, -152, 0, 189, + -10, 128, -115, 33, 61, -106, 56, -13, + 135, 116, -5772, 157, 43, 26, -11, 102, + -4, -52, 208, -186, 198, 99, 81, -29, + -103, 193, -35, -84, -4, -111, -5251, 84, + 71, -85, -77, 55, 234, 38, 0, -35, + 60, 5875, 98, 36, -219, -17, -419, -136, + 47, 34, 55, -21, -17, -1, 72, 94, + 52, -3, -703, -1437, -518, 557, 121, 356, + -345, -717, -438, -279, 13, 70, -95, -2, + -4170, 40, 136, 17, -153, 8, -149, -27, + -559, 268, -237, -82, -220, -921, -588, -150, + 3481, -1906, 647, 675, -455, 598, -386, -52, + -7, 222, -201, 90, 54, 75, -283, 118, + -375, 5768, 20, -126, -141, -99, 64, 116, + 16, -58, 0, -31, -15, 250, -104, -30, + -144, 115, 12, 117, -482, -1709, -436, 122, + -246, -7, 271, 1961, 154, 149, -86, 147, + 258, 531, 1760, 914, -1196, -1800, 812, -621, + 125, -161, 1361, 50, -651, -1307, 360, -785, + 205, -156, 294, 21, -3484, -18, -79, -266, + 770, 307, 29, -765, -250, 183, 55, 131, + 1452, 260, 224, 221, -347, 360, -352, -2188, + -664, -503, 313, 406, -251, 3268, 210, -46, + 129, -276, 343, -143, 104, -55, 461, 17, + -576, -287, -289, 33, -2500, -85, -428, -1137, + 918, -245, -490, -260, -270, -133, -591, 199, + -294, 2784, 102, 19, -109, -745, 91, -524, + -44, 28, 252, -511, -80, -146, 271, 519, + -216, -2280, -411, 3699, -368, -538, 427, -158, + 114, -50, -589, -340, -180, 703, -186, 487, + -649, 668, -916, -436, -3684, -1016, 877, -65, + -153, -62, -148, -17, -106, 142, -73, -1, + -68, 567, -658, 815, 2270, -563, -519, -226, + -223, -282, 584, 240, -1522, -1935, 1169, 880, + 127, -1276, -127, 399, 63, 25, -1297, 2131, + 592, 1652, 2609, 69, -581, -179, 947, 597, + 150, 35, 0, -255, -232, -728, 239, 91, + 130, -234, 231, 56, -2181, 1774, -2196, 1633, + -1065, -662, 777, -175, -128, 267, -7, 51, + 27, -133, 95, -500, 188, -167, 94, -176, + -29, -65, -161, -141, -694, -968, 594, -269, + -422, -472, -731, 1210, -816, 2142, -1321, -1746, + -149, -983, 1310, -839, 762, 284, 99, -31, + -1169, -84, -1119, -55, -720, -944, -1115, -271, + -1032, 1064, 187, -1013, 2987, 26, -209, 516, + -8, 107, -24, 188, 278, -53, 624, 460, + -275, -1881, -2001, 851, -1740, -407, 1643, -352, + -17, -528, -538, -175, 179, 416, -297, 54, + 132, -491, -76, 34, -440, 175, 2065, -2006, + -164, 38, -403, 902, -129, 215, 1545, -414, + -1183, -532, 578, 248, -308, 189, -563, -345, + -949, -279, 1693, -959, 101, 783, 9, 1641, + 1494, 167, -294, -538, 951, 115, 590, 105, + -847, -1003, 464, -368, -1268, 641, 254, 243, + 488, 2636, -1209, -272, 437, 445, 781, -463, + -415, 538, -811, 588, 1083, 206, -547, 171, + -585, -744, 343, -604, 395, -76, 910, -523, + -108, -449, 625, -325, -1079, 273, -1473, -1096, + -137, -565, 2077, -623, 214, -342, -273, 769, + 1137, -879, -731, 56, -1098, 211, 822, 579, + -839, 164, -600, -80, 61, 316, 644, 1445, + 891, -1796, -1798, -162, -1631, -492, -626, 593, + 544, 66, 63, -857, -1273, 406, 1665, 899, + -467, 87, -117, -469, 126, 30, -931, 1446, + -190, 388, -1608, -316, -2199, -127, 484, -51, + 56, -524, 1524, -103, 1231, -740, 717, -861, + 823, -665, -1790, 411, -690, 303, -1615, 63, + -232, 19, 1090, -96, 137, 80, -1027, 581, + -61, 672, 133, 444, -767, 766, -42, -3174, + -270, -23, -126, -1111, 67, -1367, 4, 315, + -53, -90, -165, 48, -1657, -117, 392, 356, + 792, -610, -618, -219, 446, 102, 374, 207, + 1026, 2480, -461, -782, 1161, -1351, 1032, 486, + -308, 290, -272, 899, 1912, 36, -624, 286, + -428, -623, -665, 12, -621, -1985, -34, 468, + 318, -467, 127, -972, -39, -663, 2307, -26, + 406, -468, -657, -1404, -342, 2356, -395, -1422, + -1243, 465, 90, -665, -280, -290, -21, -1752, + 280, 271, 395, 240, -402, 55, 1077, 148, + -309, 1818, 483, -1293, 43, 261, 566, -131, + 947, -815, -872, -1021, -1001, -395, 263, -555, + 78, -2193, -360, -76, -1029, -493, -464, 1339, + -53, 750, -671, -1349, 133, -70, 114, 501, + 766, -816, 703, -992, -122, -520, -1323, -2539, + -365, -35, -555, -888, 1515, -191, 1322, 1633, + -674, 451, -1246, 270, -868, 703, -394, 106, + -779, 754, 650, 1066, -417, -1305, 149, -165, +}; + +static const int16_t cb4432l1[] = { + -3867, -448, 2202, 129, -100, 393, 37, -267, + -156, 23, -274, 222, 33, -191, 104, -140, + -50, -28, -148, -181, -22, 6, 489, 993, + -2764, 1191, -773, 781, -460, 843, -77, -1417, + 390, 124, -203, 205, 662, -16, 569, -963, + 609, -155, 64, -293, 2649, -2533, 70, -472, + -482, -1732, 235, -5, -485, 116, -177, -104, + 314, -355, 118, 25, 921, 285, 130, -94, + 77, 121, 1068, -435, 1407, 447, -427, -1096, + -757, 258, 19, 3236, 702, 362, -928, -348, + -150, -784, -687, -388, -176, -38, 16, -14, + 1017, 879, 935, 1280, 1014, -85, -256, -103, + -3384, -928, -200, -406, -175, 304, -54, 195, + -78, 676, -356, -167, -165, -56, -3133, 156, + -171, -684, -698, -135, 230, -30, 32, 542, + 1959, -124, -76, 162, 182, -174, 1011, -97, + 678, 10, 188, 30, 1086, -262, -157, 250, + 241, 233, -584, 3276, 2126, -50, -207, 637, + -440, 331, -434, 251, -267, 269, -392, 68, + -244, 8, 928, 827, -1096, -309, -356, -375, + -3204, 422, 695, 2, 240, 595, 641, 582, + 342, 42, 7, 539, -64, -116, 82, 16, + 26, -136, -122, -114, -5814, 22, -272, 10, + 113, 186, -422, -95, 309, 308, -118, -208, + 52, -175, 12, -106, -6, 20, 58, 6053, + -101, -20, 10, 70, 189, 57, -11, 210, + 83, 239, -6, -79, -233, -59, 31, -30, + -62, 64, -38, 25, -78, -202, -215, -115, + 1477, 255, 101, -2575, 186, 3140, -46, -45, + 53, -183, -89, -412, 183, -222, 50, -237, + 96, 35, 1684, -521, -169, -436, -295, 1390, + 261, 27, 163, 352, 68, -3677, 12, 310, + -599, 331, 138, -333, -269, -130, -44, -14, + 265, -626, 258, -59, 31, -17, 222, -10, + -364, 280, -183, -235, -217, 73, -67, 114, + 196, -5132, 269, 159, -6, -36, -248, 274, + -328, 2712, -393, 2763, 507, -110, -166, -84, + -72, -1111, -19, 370, 25, 5, 156, -32, + 237, -57, -106, -22, 370, -229, 1099, 4297, + 152, 72, -56, 347, 64, -501, -57, 178, + 175, -14, -84, -626, 555, 155, 20, -75, + 20, -33, -254, -125, -9, 150, 91, -7, + -45, 239, -109, 72, -66, -172, -211, 6063, + -205, 171, -75, 50, -75, 22, 109, 21, + -58, 58, -105, -432, 310, 3782, -18, -1071, + 19, 20, 1455, 337, -257, -288, -52, 519, + 43, 80, -175, -218, 9, 176, -28, -418, + 200, -514, 351, 119, -5920, -96, -33, -289, + 74, 26, 120, -37, 113, 47, -145, -17, + 334, 46, 47, 19, 274, 172, 159, -404, + 3151, -408, -559, 987, -178, 253, -90, -498, + 1454, 1183, 392, 762, 220, -1207, -220, -69, + -85, 22, 1644, 1858, 725, 1084, 0, -257, + 290, 1712, -151, -188, -390, 638, -327, -2185, + -322, -1116, -150, 120, -140, 198, 162, -83, + 1321, 232, 242, -52, -456, 778, -288, 65, + 2431, 37, 85, -489, 862, 2776, 260, -72, + 792, 100, 17, -210, 588, 49, 600, 246, + -258, 128, -51, -492, -395, -489, 50, -5308, + -67, 314, 124, 46, -188, -64, -101, 51, + -535, 108, 56, -4, -191, -923, 485, 578, + 1320, 228, -535, 310, 227, 395, -1441, 2660, + 226, -392, 221, -686, 1749, -175, -904, -571, + -129, 154, 2622, 609, -247, -240, -893, 98, + 291, -2277, 411, 260, -160, 2061, -203, -437, + 359, 21, -101, 19, 49, 15, -98, 82, + 3, -555, 164, -152, -58, 38, 175, -439, + -37, 68, -21, -181, -5556, -27, 8, 48, + 21, -151, 381, 3, -152, -74, 202, -29, + 1863, 1713, -922, -1976, 551, -1522, 525, -116, + 146, -1730, -238, -72, -183, 126, 234, -240, + 82, 138, -60, -131, -2226, 226, -702, 183, + -81, 462, -2851, -1419, -1005, 124, -81, -252, + -65, 147, -58, -179, 306, 154, 122, -69, + 69, 11, 115, 296, 3340, -501, -2580, -804, + 9, 591, -86, 88, 127, 588, 183, 48, + 79, -38, -199, 63, -140, 29, 88, -28, + 259, 69, 1743, -531, 110, -18, 776, -18, + -177, 112, 36, -243, -208, 528, -47, 4709, + 107, -125, 140, -1, 22, 15, 416, -194, + -267, -49, 43, -3, -308, 214, -128, 140, + 5372, -123, 70, 275, 210, 182, -147, -131, + -84, 69, 116, 29, -401, -162, -236, -173, + 378, 45, -12, -77, -6209, -103, 126, 54, + -19, -20, 43, 64, 92, -8, -12, 118, + -123, 58, -3628, -414, -2147, 76, 95, -99, + 357, -10, 278, 4, -608, 504, 105, -72, + -109, -92, -55, 367, -167, 40, -34, 76, + 220, 3434, -366, 191, 248, 29, 187, -177, + 155, -348, -341, -2466, 272, -136, 510, 139, + 81, 184, 33, -299, 92, -44, -402, -583, + -725, -400, -159, 751, -225, 377, -160, 1556, + -2652, 685, -1077, 1276, 332, -257, -1449, -282, + -231, -145, 58, 173, 421, 271, 401, -186, + 79, -258, 127, 252, 214, 96, 157, 195, + 205, 118, -4771, -95, -164, 217, 477, -51, + -4, 8, 1450, -51, -52, 952, 675, 929, + -273, 475, 9, 282, -249, 236, 746, -1407, + -272, 1845, 692, -105, 2690, 168, 1, -1, + 157, -599, 305, 255, -2252, 45, -199, 119, + -3489, -161, 6, -263, -259, 338, -251, 61, + 153, -124, 432, -7, 131, 5, 305, -322, + -3283, -32, -336, -273, 2243, 863, -1, 681, + -365, -246, -152, 375, -133, -15, -208, -104, + 89, 128, -135, 44, -255, 549, -2751, -48, + 270, -2584, -549, -631, 445, 182, -198, 743, + -215, -60, -400, 1383, 167, -65, 250, 146, + 185, 22, -484, -161, 86, 1758, 964, 404, + -2574, 1026, 6, -516, -724, 315, -1891, 311, + 2, 339, -39, 324, 299, -497, -12, 179, + -1242, 364, -185, -197, -1474, 232, -490, 4042, + -105, 887, 31, 539, 235, 75, -112, -200, + -31, 74, -76, -16, -20, 38, -159, -143, + 114, -77, -110, 28, -18, -84, -27, -53, + -82, -224, 75, 0, -46, -64, 44, -112, + 84, -85, -6030, -24, 661, -474, -178, 8, + -1023, -396, 199, -19, -50, -93, 385, 209, + -1227, 2492, 2163, 986, -1359, 399, 848, 681, + -829, 211, 696, -599, -1398, 1951, -113, 374, + -17, -1113, -1708, 1294, 666, 1774, 623, 259, + 105, 961, -87, 43, -463, 65, 155, -26, + -31, -1477, -508, 1091, -1463, -524, -1853, 1354, + 434, 86, 893, -871, 151, -1887, 205, 423, + 857, -55, -11, -39, 341, 61, 1158, 2650, + 899, -2491, -593, -843, -1399, -15, -713, -171, + -195, -523, -46, 243, 117, 241, -8, 140, + -149, -191, 70, 134, -1158, 1933, 1135, -2284, + -1049, 1717, 378, -155, -37, 171, -692, -280, + 918, -786, -123, 558, 571, 39, -315, 62, + 27, 59, 708, -134, -200, -168, -134, 148, + -142, 25, 164, -282, 284, -95, -35, 376, + 165, 367, -335, 271, 249, -4520, 176, -36, + -216, -1303, 375, 92, 602, -889, -390, 284, + 78, -1318, 1259, 1865, 1498, 2063, -234, -840, + -391, 88, 168, -235, -74, 31, -239, 1221, + 71, -1637, 1513, 68, 2201, 1513, -1099, -622, + 426, 343, -330, -648, 381, -156, 27, -31, + -92, 133, 210, 103, -155, 2061, -366, -1173, + -31, -274, -713, -471, 509, 1044, 208, 403, + 486, -66, -521, -1883, -180, -537, 1283, -98, + -1464, -456, 508, -619, -546, 685, 944, -85, + 311, 1172, -194, 1406, -99, -827, 1506, 396, + 196, -1534, -1181, 1588, 1250, 47, 1034, -171, + -1247, -98, -120, 1181, -2195, -384, 945, 627, + 26, -248, 1372, -671, 214, -649, -17, -44, + -500, -559, 577, -601, 32, 421, 531, 344, + -1233, 145, 348, 614, -560, -244, -357, -202, + 814, -494, -2320, 308, -2277, -481, -518, -431, + -851, 43, -204, -26, -742, 1083, -130, 2002, + 1642, -1156, 1746, -529, 937, -544, 416, -741, + 763, -232, 509, 243, -458, 78, -130, 143, + -123, 71, -666, -105, 31, -1061, 441, -48, + 411, -1547, 155, -730, 439, 1624, 873, -611, + -470, 2348, -157, 1184, 678, -174, 542, -95, + -12, -405, 237, 322, -1194, 1903, 1496, 357, + -34, -661, -1024, 2236, 860, -256, 617, 756, + -485, -273, -589, 536, 214, -286, 782, 418, + 346, -462, 443, 1056, -914, -304, -564, -332, + 1823, 2079, 93, -975, -891, -1089, -720, -1127, + 702, 300, 787, 374, -78, 1070, 691, 1339, + -797, 57, 482, 432, 748, 1538, 673, 1885, + -504, 1913, -190, -135, 881, -139, 84, 379, + -176, -129, -331, -34, -690, 282, -563, 51, + 71, -714, -103, 1074, -651, -582, 1388, -320, + -1115, 1547, -1088, -65, -2634, -201, -653, 116, + -238, -218, 476, 1417, 1671, 1135, -1025, 614, + -662, 127, 863, -117, 726, -971, 1382, -286, + 465, 1195, -715, 862, -1256, 105, 37, -1190, + -442, -1777, 50, 162, 1577, 580, 762, 253, + 92, -308, -1238, -161, 295, -150, 1733, 1831, + -527, -527, -28, 70, -359, -1590, 860, -221, + 47, -1201, -254, 39, 780, -326, 1097, -1019, + 834, 362, 357, 41, 693, -1099, -2687, 614, + 270, -128, -322, -1149, 631, -46, -343, 1495, + -896, -864, 1545, 200, -922, -1133, -637, -1231, + 484, -796, -743, -371, 999, 1300, 173, -19, +}; + +static const int16_t cb4432s0[] = { + -2558, 2751, -440, 1200, 1067, -725, -492, 588, + 234, -209, -108, -230, 223, -231, -235, -132, + -51, 88, -290, -214, -99, -60, 175, 2546, + -991, 907, 446, 635, 284, 707, 238, 220, + -308, 259, 8, -435, -2207, -1487, -1579, 46, + 285, -249, 154, -370, 37, 42, 1524, -1853, + 1393, 1204, 126, 1751, 82, 136, 363, -2411, + -782, -128, -818, -232, 765, -173, -127, 732, + 260, -101, 868, -249, 290, 32, 645, 55, + -1742, -1077, 392, -568, 629, -920, -243, 791, + -604, -363, 117, -1360, -15, -245, -3655, 54, + -297, 10, 124, 11, -1114, -567, 3882, -2042, + -1120, -42, -114, -914, 419, 307, 44, 277, + -101, 429, 170, 187, -528, -705, 348, -19, + 180, -76, 91, -1861, -181, -171, 804, -730, + 222, -184, 349, 191, -125, 14, 4270, -467, + -272, 29, -216, 212, 426, -222, 11, -16, + -852, 101, 576, 178, 351, 647, 90, 179, + -681, -187, 77, 4115, -976, -726, 711, 763, + 572, -1166, -46, -445, -103, 135, 294, 300, + 10, 737, 386, -399, -349, -52, 5393, -107, + -32, -229, -154, -181, 82, -68, -13, -77, + 48, 75, 117, -50, 254, 233, 98, 75, + -2218, -2214, 1491, 832, 225, -1057, 267, 539, + 1963, -245, -353, 454, -430, -54, -747, -58, + -438, -90, -64, 277, 214, -105, -47, -1301, + -404, -1179, 682, -4093, 764, -270, -342, -367, + -1378, 6, -83, 429, 398, 61, -149, 180, + 31, 169, -218, 152, -71, -38, 2605, 679, + -175, -533, 1787, 611, 484, -322, 158, -561, + 125, -35, -42, -190, 529, 449, 157, -3105, + 106, 168, -8, -66, -80, 1463, 1136, 4793, + -98, -432, 538, -145, 241, -158, 105, -372, + 39, -160, 92, -223, 81, 245, -142, -162, + -167, -297, -49, -98, 582, -5178, 1130, -271, + 567, -251, 55, 487, -303, 31, -25, 87, + -70, 154, -23, -221, 70, 208, 48, -137, + 46, 59, -9, -1397, -970, 224, 714, 161, + 24, -307, 1295, 1467, -155, -505, -521, -244, + 503, -25, -989, 3664, -148, 12, -135, 218, + -159, -156, -769, -421, 553, 715, 697, -181, + 1426, 425, -39, -103, -4558, 171, 347, 161, + 170, 128, -210, -35, 31, 125, -264, -135, + -100, 2685, -230, 2062, 1618, -99, -874, 926, + 757, 380, 404, -73, 30, 29, 462, 725, + -389, -246, 20, 150, -234, -58, -183, 10, + 156, 482, -232, 124, 115, 180, -615, -395, + 330, -85, -435, 3279, 1493, 686, 1157, 245, + -1067, -1953, 23, 796, -540, 175, 56, -1931, + 89, 705, -342, 551, -1999, 1951, -2305, -497, + -266, 275, -1503, 351, -355, -353, 236, -358, + -271, -40, 136, 217, -13, -45, -2091, 1141, + 730, -1888, 1131, 660, 1271, 439, 2597, 92, + 319, -91, 62, 316, 287, -260, 121, -33, + -117, -22, -79, -170, -164, 1486, 134, -62, + -36, -3367, -235, 1221, 1239, 78, -54, -489, + 268, -560, -774, 851, -973, -62, -174, -138, + -459, 390, -22, -42, 83, 1339, 1307, 462, + -3768, 511, 300, -525, -787, -89, 675, -2074, + 37, -48, 252, 598, -332, 67, -187, 2, + -106, -35, -148, -186, -542, 799, 2363, -155, + -665, -2867, -209, -200, -80, 1682, 1082, 2, + 516, -481, 276, -1, -220, 54, -12, 259, + 161, -148, 566, -1489, -731, 1262, 499, -816, + 115, 4057, -71, 701, 39, -132, -223, -16, + 229, -2, -40, -61, 234, 405, 108, 304, + -62, -396, 1369, -1438, -2045, 1954, 759, 969, + -166, -235, -115, -68, 1923, 1815, -776, -855, + 34, -63, 17, 87, 223, -145, -130, -16, + -313, -1704, -458, -332, 420, 1332, 676, 878, + -3847, -360, 427, 537, 651, -167, -451, -197, + 277, 136, -201, 517, 10, -156, 35, -927, + 1250, -173, 1004, -169, 322, -140, -559, -4656, + -343, -264, -61, -12, 195, -10, -123, -23, + -20, -6, -367, -102, -215, 41, 838, 1513, + 552, -1609, -753, -763, -656, -633, 14, 35, + 141, 117, -121, 857, -1494, 578, 2546, 1034, + -676, 571, 817, -218, -111, 1424, -51, 878, + -2860, -257, 104, -526, 782, 708, 2350, -500, + -342, 219, -406, 836, -117, 288, -415, 798, + 14, -311, -455, 3, -410, -144, -30, -977, + -145, -2466, -957, 1370, -3201, -327, -85, 149, + -580, 198, 350, 140, -104, 327, -128, -178, + 58, 294, 50, 1814, 581, -909, 287, -267, + -3992, 61, -860, 258, -271, -223, 237, -291, + -3, 66, 110, -620, 319, -62, 177, 364, + 110, -163, -921, -863, 251, 4922, 280, 121, + 128, 209, -126, 578, -56, 41, 124, 350, + 245, -465, -67, 5, 651, 147, 200, 0, + 21, -609, -332, -3, 247, -412, 128, 42, + -1405, -301, -341, -484, -491, -55, 361, -100, + -30, -405, 643, 4249, -31, -91, -10, 6, + 425, -350, -1501, 817, -1348, -201, -345, -3643, + 235, 691, 332, 219, 199, -398, 130, -50, + -190, 89, -23, 100, 1327, -200, 146, 482, + -624, -479, -391, 188, 129, 614, -335, -564, + 1021, -107, -199, 145, 201, 571, 1276, 4253, + 58, 121, 295, 38, 26, 47, -1333, 1138, + 3125, 357, -72, 347, 276, -272, 120, -77, + 535, 247, -71, -2054, -1860, -73, -62, 266, + -30, 183, 17, -46, -7, -140, 997, 526, + -47, -59, 1540, 373, 162, -150, -107, -74, + -278, -37, 4268, -21, -269, 359, 111, -115, + -5, -206, -87, -44, -517, 54, -2859, 189, + -297, -863, -918, -929, -543, 25, -2866, -79, + -1101, -275, -410, -458, -75, -211, -420, 96, + 467, -66, -15, -580, -420, -586, -7, 109, + 236, 227, -488, 106, 258, 76, 78, -8, + -199, -4888, -134, -205, -33, -243, -19, -10, + 157, 129, 120, -928, 604, -345, -47, -430, + -257, 273, 81, 1949, 490, 272, -205, 2460, + -54, 103, -2924, -529, -211, -60, 279, 220, + -57, 342, 209, 984, -1410, -3363, -1028, -1301, + -1293, 227, 1142, -1068, -512, 758, 364, 46, + -358, 16, 257, -158, -253, -182, -2, 181, + 1475, 1574, 215, -968, 246, 369, -273, -717, + 546, 74, -3872, 293, 98, 130, -244, 41, + 143, 699, -56, -126, 67, 54, -2, -878, + 2334, 883, 215, -1979, 246, -759, 499, 248, + 751, -202, 580, -3018, 359, -139, 210, -47, + -168, 89, -659, 259, -54, -40, -490, -169, + -769, 569, -171, 64, -845, 519, 1251, -71, + -459, -4436, 257, -334, -826, -183, 115, -408, + -77, 544, 173, -258, 48, 331, 1735, 1035, + 2793, 1154, -1901, 275, -109, -1185, -403, 1332, + -282, 36, -367, 21, 27, 362, -425, 217, + 150, -304, 192, 53, -1100, 27, 628, 698, + -634, -25, 84, 8, -103, 533, -301, 218, + 4350, 119, -109, 309, 24, -352, -147, -274, + 156, 85, 9, 1706, -854, 2012, -1573, 112, + -673, -1538, -91, 415, -1525, 866, 1493, -621, + -396, 277, -604, -363, 114, -360, -252, -18, + -31, -77, -591, 2483, 535, -1520, -1057, -2189, + -51, 798, 276, -1426, 72, -303, 402, 111, + 327, 272, -8, -216, 189, 1282, 152, -45, + -33, 1524, 2301, -341, 1992, 939, 1678, 1011, + 114, 167, 586, -500, 40, -473, -274, 596, + 1237, -126, 205, 254, -284, -367, -119, 64, + 1915, 437, -585, 1, 402, -271, -984, 530, + 267, 3634, 495, -219, -728, -67, -1340, 983, + 122, 6, 110, -166, 111, 102, -139, -2499, + 753, 1011, 1755, -1252, 872, -510, -1844, 1388, + -782, 287, 461, 36, 77, 437, -361, -216, + -415, 158, -77, -123, 57, -93, 3408, 504, + -942, 434, -648, -251, -420, -387, 1373, -229, + 236, -191, 3, 204, 612, 393, -285, 560, + -164, -199, 303, 146, 93, 1248, 2425, 1001, + 1261, -239, 1085, -1878, -375, -544, -995, -192, + -319, 542, 280, -716, -1323, -67, -34, 252, + -36, 206, -126, -28, 26, -1135, 2799, 527, + -47, -2008, 509, -232, -953, 332, -386, -108, + 290, 507, 578, -809, 375, 850, -1413, 831, + -137, 259, 25, -1075, 407, 1784, -1539, 1658, + 1450, -969, 467, 4, 785, -595, 912, 34, + 91, 286, 1035, -524, 276, -322, 11, 651, + 733, 243, 45, -145, 357, 524, -697, -259, + -757, -1057, 181, 1324, 148, -502, -64, -379, + -746, 1385, 395, 184, -749, -197, -3375, -546, + -4, 532, -270, 687, 501, 285, 401, 431, + -1888, -639, 655, -325, 1896, -1883, 53, -1018, + -1475, 802, -486, -68, 232, 1337, 428, 232, + 1754, -1687, -518, -372, 508, -1269, 327, -900, + -468, 1127, 1397, 1597, 837, 659, -617, 99, + 264, -460, 296, 44, -295, -209, -174, 1105, + 896, 1065, -174, 5, 845, 1311, 1370, -2548, + 351, -660, -24, -1089, -787, -1312, -22, -585, + -197, 749, 293, -112, -169, -23, 3, 1151, + 529, 1173, 224, -1517, 930, -52, 268, -1282, + -559, 466, -528, 1506, -231, -337, 993, -1314, + -250, -3042, 57, 19, 15, 1812, 697, -389, + -201, 647, -723, -1098, -177, -225, -2694, -495, + -431, -238, 388, -1731, 997, 227, -765, -222, + 94, -611, 35, 187, -935, -1470, 1013, 1051, + -378, 311, -710, -566, -532, -369, -1599, 553, + 167, 450, -1068, 2834, -125, 601, -113, -503, + 40, 14, -36, -220, -1543, 867, -612, -1834, + 888, -1791, 1296, -229, -593, -760, -197, 428, + -1290, 892, -62, 1113, -1228, -965, -90, -300, + 288, -133, 779, -1211, -627, 268, 180, 913, + 2230, -413, -146, -217, 170, -1157, -1551, 877, + 75, 1784, -174, -230, -757, 1243, 625, -49, + 114, -218, -409, 195, -1165, 1492, 213, 1100, + -101, -957, 1016, 663, -704, 817, 94, -279, + -256, 469, -75, -123, -2954, 948, -407, 275, +}; + +static const int16_t cb4432s1[] = { + 5416, -223, -123, 156, -33, 185, -144, -108, + -199, -68, -36, 11, 37, 124, -301, 58, + -21, 155, 99, -10, -78, -26, -70, -3160, + -1037, 98, 155, -373, 834, 652, -277, -429, + -529, -103, -358, 187, 1161, -157, 147, -400, + 461, 156, 237, 481, -67, 99, 939, 1179, + -659, 1337, 578, -489, -481, -427, -622, 131, + 1826, -734, -995, -5, -461, 514, -83, -271, + -2928, -86, -382, -205, -133, -386, -195, -67, + 508, 586, 607, -910, -181, -2046, 1212, -179, + 23, 408, -1929, 2044, 2160, -879, 74, 179, + 72, -164, 47, 162, 1497, 826, 2978, -912, + 454, -618, -1907, -501, -494, -299, 96, -138, + -114, -51, -171, 445, 1144, -187, 217, 224, + 402, 13, 42, -58, -1692, 4162, 1272, 970, + -278, 327, 88, -31, -182, 279, -610, 78, + -432, -147, -142, -725, -17, -95, 388, 133, + -61, 28, -1365, 1441, 606, 411, 923, -332, + 1843, 1934, -1451, -514, -283, 768, 940, -428, + 31, 1105, 248, -78, -1477, -367, 404, 68, + -178, 17, 691, -265, -105, 1681, -476, -1307, + -3434, -1700, -524, -871, 472, -171, 237, 104, + -142, -231, -292, -285, 266, -259, -166, -97, + -432, 4003, 1220, -356, 2110, -220, -465, -48, + 117, -178, 290, -21, 205, -19, 321, -343, + -328, -57, 215, -345, 304, 2, 10, -2071, + 185, 433, 212, -1165, 112, 242, -294, -162, + 1107, 1176, -396, 1400, -2600, -434, -640, 457, + 100, -268, 809, 128, -236, -66, -94, -842, + 82, 163, 227, -2641, -485, 291, -326, 42, + 234, -648, 1355, 3016, -1403, -71, 188, 792, + 15, -16, -522, -75, 106, -824, 1133, 947, + 477, -642, -531, -808, 4100, -34, -407, 133, + 33, 15, 63, 72, -223, -15, -491, 38, + 47, 258, -236, 192, 1628, 173, -2116, 687, + 295, -74, -183, 95, 529, 149, -372, 182, + 1317, 21, -1424, -3156, -111, -96, 580, 284, + -274, 41, 145, 1314, 79, 1830, 262, -325, + -16, 169, -245, -2038, 1959, 892, 946, 303, + -171, -432, 883, 34, -238, 2463, -294, 25, + 24, -106, -45, 509, -154, 496, 109, 115, + 169, 702, 396, -97, 657, -251, -112, -114, + -144, -230, 517, -190, 4885, -45, -152, -9, + -170, -2021, 541, -905, -2015, 2588, -936, -20, + -300, 384, 433, -123, 119, -505, -126, 295, + 526, -1352, 450, 142, -126, -115, 1, -140, + -734, 672, -147, -660, -747, 652, 161, -163, + 51, -616, -1974, 1413, -3145, 922, -1289, 215, + 182, -838, -171, 107, -333, 34, 216, -307, + -359, 496, -343, -325, -2552, -1573, 588, -441, + 1296, -3075, 119, -131, 54, 206, 278, 106, + -100, 112, 220, -49, -80, -229, 1051, 3271, + -1300, 324, -31, -1025, 1659, 1526, -161, 669, + -56, 430, 201, -535, -126, -9, -380, 222, + 212, -345, -282, 195, -41, -1235, -593, -593, + 1557, 71, 1023, -831, 545, -875, 161, -772, + 99, -190, 1616, 338, -251, -201, -3104, -774, + 4, -121, 178, -80, 652, -1018, -441, -343, + -236, -240, -244, -26, 2192, 75, -1348, 3771, + -22, -850, -251, 316, 132, -21, 63, 104, + 152, 185, -40, 275, -1356, 482, 3081, 571, + -481, -1387, 815, 1285, -352, -98, -41, 573, + -307, -1879, 427, 196, 169, -26, -232, -98, + -411, -231, -2034, -969, 271, 1421, -1485, -407, + 1404, -343, 861, 888, -11, 202, -245, -397, + 104, 229, 309, -2757, 315, 416, 393, 194, + -176, -663, -166, -229, 244, -152, 183, 24, + -205, 97, -255, -299, 123, -12, 53, 102, + -362, 371, 223, 46, 132, -5177, 157, -92, + -1114, -28, 135, -831, 627, -428, -1116, 421, + 761, 458, 3256, -167, 355, 2045, 113, 234, + -154, 20, -39, 61, -81, 63, 98, -171, + 1727, -1193, 2103, 416, -421, -575, -636, -114, + 700, -260, 1610, -336, 521, 2591, -738, 43, + 103, -63, -335, 168, 110, 41, 1995, 3554, + 1443, -53, -206, 992, 767, -372, 141, -24, + 173, 60, -237, 69, -173, -73, 137, 167, + -164, -159, 312, -151, -78, 619, -192, 689, + -69, -2805, -259, -288, -231, 28, -1682, 2316, + 2298, -336, -131, 59, 542, -218, -281, -214, + -41, 116, 138, 8, -297, -45, -215, -167, + 1587, -1061, -1976, -445, 401, -2392, -42, 581, + -519, -230, 1461, 542, 113, -634, 1776, 332, + 191, 5, 174, 1939, -26, -242, 120, 230, + -986, 3501, -1125, -89, 3, -580, -219, -255, + 37, -119, 94, -17, -297, -176, -434, -234, + 55, -63, -1167, -492, -1753, -3397, 185, -794, + 689, 819, -32, -836, 335, -133, 724, -299, + -318, 424, 558, -654, 119, -447, 140, -100, + 72, -872, -1432, -203, -40, -14, -59, 550, + 85, -53, 5007, 258, 401, -184, -313, -170, + 66, -185, -82, -61, 210, 48, -204, -96, + 130, -562, -1700, -1037, -3926, -884, 1115, -6, + -100, 842, -450, 877, 76, 568, -623, 27, + 73, -195, 328, 41, -24, 124, -77, 1499, + 540, -1064, 4517, -22, -35, 839, -48, 253, + -259, 96, 409, 90, 26, -177, 365, -48, + -324, -26, -23, -83, -77, -80, 1599, 1486, + 266, 659, 236, 231, -16, 359, -163, 455, + -999, -1169, 2453, -599, -945, 4, -2110, -174, + -736, 344, 232, 142, 32, -99, 763, 133, + -325, -56, 1635, -439, 843, 2, -1704, -13, + 771, 3680, -89, 182, 4, 42, 394, 404, + 82, 312, 91, 141, -1577, 1765, 3141, 625, + -271, -2122, 423, 353, 489, 606, -290, -190, + 486, -131, 118, 236, 248, -209, -2, -162, + -95, 95, 170, 278, -2233, 549, 34, -846, + 3595, 445, -400, -65, 131, -14, -16, 611, + -116, 1293, 98, -680, 189, 217, -15, -549, + 131, 8, -768, -1082, 841, -346, 129, -33, + -778, 322, -2508, -2128, -1895, -2021, -27, -42, + -51, -536, 239, -1, 78, 105, 48, 79, + 207, 422, -181, 18, -94, -152, -181, -5012, + -187, -3, -118, -397, -84, -49, 129, -276, + 188, 45, -146, -235, -109, 83, 32, -79, + 2039, -616, 257, -1575, -1756, -2364, 222, 195, + -1138, -290, 58, -641, -252, -11, 402, -31, + -1040, -592, 676, -118, -231, 94, -123, 1642, + 1404, -334, -728, -3425, 382, 111, -194, 677, + 177, -182, 434, 860, -1022, 84, 1214, -733, + 300, -2, -259, 140, 35, 96, 1164, -1476, + -757, -74, 239, -203, 1796, 1207, 1732, -3029, + -610, 658, 490, -465, 136, 56, -614, -612, + -123, 93, -151, 162, 56, 502, 1634, -1825, + 45, 1033, 1554, -2380, 1615, 1317, 786, 387, + -255, -423, -44, -246, -213, -149, 107, -74, + -94, 45, -204, 13, -1959, 936, 2023, 1000, + 1031, 112, 574, 323, 163, 947, -657, 492, + -2624, -44, 739, -305, -31, 247, 270, 213, + -46, -90, 43, -1504, 931, -61, 4045, -863, + 389, -386, -130, -374, -583, -800, -900, 158, + -455, 169, 134, -164, 54, -117, -185, -90, + -203, -41, -811, -2082, 169, 287, -378, -15, + 231, 83, 89, -187, 198, 18, 178, -18, + 527, -40, 94, 54, 79, -4356, 248, 162, + -94, -1431, -31, -2048, 651, 1231, -508, -1089, + -1255, 766, 1673, 357, 13, -813, -2403, 179, + -470, 65, -339, 154, 9, 56, 246, 66, + -2308, 1443, -947, -744, -2473, -1248, -113, 1017, + -608, 149, -182, 41, -524, 16, 285, -268, + -781, -57, -346, 194, 256, -51, 107, -484, + -190, -125, -645, 487, 314, 74, -555, -1012, + 325, 76, 233, -205, -189, -48, -4593, -122, + 10, 121, -91, 108, -49, 254, -1662, 2500, + 87, -1540, -200, 287, -329, -50, -401, 182, + -1300, 689, 915, -224, -768, 471, -339, 133, + 407, -344, 99, 96, 111, 1224, -1431, 2069, + -282, 127, 397, -119, 1332, -1299, 744, -535, + 800, 327, 874, 700, -424, -1596, 1365, -651, + -151, 113, 102, -24, 464, 125, 911, -1583, + -372, 747, 2, 429, -47, -64, 34, 1700, + -741, 343, 728, -226, 1889, 78, -515, 2827, + 77, -66, 108, 515, 90, 2227, -678, 1301, + -974, 122, -983, 2357, 64, -1479, 186, 1436, + -245, 204, 460, 191, -677, -335, -200, -135, + -106, -101, 1112, -2733, -641, 73, 1265, -1281, + -1332, -743, 675, 129, -1144, -1169, 331, -143, + -87, 809, -891, -848, 246, 243, 97, -170, + 36, -1109, 102, 1055, -1395, 1384, 1155, 439, + -1549, -300, -2069, 1014, 187, -782, 980, -971, + -345, -583, -66, -138, -317, -124, 48, -152, + -98, 92, 2446, 128, -1232, 2148, -337, -615, + 467, 1573, -613, 857, 303, 422, -1340, -420, + 305, -626, 94, -496, -386, -129, 243, 27, + -200, -1373, 1468, -2040, 151, -675, 65, 1464, + -432, 545, 269, -510, 584, -1935, 970, -319, + 1465, 490, 263, 555, -256, -49, 315, -242, + -394, -312, -88, 201, -121, -302, 172, 49, + 234, 59, 327, 155, 199, -187, -41, -74, + 52, -31, -59, -5574, -121, 282, 343, -125, + -200, -575, 1328, 155, -1928, 250, 702, 21, + -2718, -153, -102, 2131, 612, 432, -1072, -457, + 222, 427, 144, 149, -433, -1573, 1337, -650, + 176, 13, -1273, 280, -751, -236, 453, 204, + -1595, -2896, -272, 233, 485, 82, -139, -528, + -140, -399, -56, -274, -335, 176, -756, 243, + 2250, -305, 721, 1711, 7, -1230, -1590, -1872, + -137, -714, 263, -1643, 362, -266, -176, 64, + -36, -63, 687, -483, -1488, 709, 929, 1349, + -1245, 645, -1619, 735, -651, 1850, 1031, 159, + -625, 838, 242, -396, -397, -41, 1237, 304, + 81, -94, -736, 578, 1279, 1064, 81, 1900, + -179, 224, 266, -429, 734, 500, 995, -882, + 1563, 1813, -519, 758, 532, -27, 27, 453, +}; + +static const int16_t cb4432m0[] = { + -6132, -262, -273, -1250, -577, 984, -430, -410, + -464, 577, -578, -178, -32, 369, -624, 267, + -68, 474, -480, -225, 166, -409, 437, 4633, + 98, -1560, -464, -869, 103, 193, 461, 72, + 292, -245, 1102, 417, -325, 461, 74, 43, + -120, -213, 333, 160, -468, -212, 31, -81, + 6516, 182, 201, -212, -66, -49, -266, 148, + -108, 98, -46, -11, -59, -20, -20, 2332, + -294, -560, 198, -647, -47, -638, -3877, 11, + 834, 547, 47, 2541, -126, -5, -366, 339, + 3, 2, -66, 60, -526, 914, 321, -658, + 3605, 59, -2392, -655, 384, 775, 366, 327, + 356, 386, 751, -375, 38, -205, -15, -442, + -212, -1241, 1913, -421, -755, 45, -1637, -36, + -2435, 1504, -1248, -763, -664, 133, -123, 814, + 241, -243, -446, 66, -131, -213, 2036, 1294, + -2138, 677, -1042, -771, 294, 371, 474, 85, + 1403, -2618, -478, -537, 275, -826, 349, 84, + 264, -272, -61, -705, 175, -972, 868, 25, + 4183, 881, -639, -833, -757, -1063, -991, -257, + -137, -619, -285, -454, 77, -169, 316, -45, + 4362, -203, -2132, -424, -820, -503, 340, 340, + -612, 648, 2, -342, 81, 630, -1518, 235, + 216, 210, 665, 231, 130, -879, 38, 675, + -136, -48, 540, -234, -152, -169, -5745, -294, + -24, 8, -129, -8, 308, -14, -16, 147, + 62, 70, 248, -2014, 76, -190, -328, -1899, + -353, -140, 836, -365, -112, -3945, -736, 467, + -258, 601, 617, 74, 62, 394, 180, 1151, + -810, 36, 457, 406, 75, -8, -5004, 2335, + -108, -123, 299, -335, 112, -499, -268, -185, + 461, 208, -38, -164, 764, -504, 272, 4853, + 396, 265, -1133, -433, 769, -458, 1005, 645, + 81, -172, 385, -56, -130, -393, 128, -73, + 31, 2038, 127, -436, 123, -2525, 282, -448, + -489, -295, -14, 85, -462, -49, 262, -93, + 238, -148, -3953, -414, -259, 33, -892, 459, + -2186, 60, 444, -610, 844, -486, -299, 219, + -433, 19, -1183, 276, -29, 388, 3327, 102, + -914, -221, 486, -892, -550, 190, 151, -141, + -336, 194, -242, -224, 405, 879, 1600, 349, + -2082, -38, -514, 18, -3574, 161, -142, -38, + -1815, 540, 228, 33, 164, 1074, 4, -278, + -58, 4085, -295, -795, 31, 494, 555, -250, + 22, -202, -312, 92, 109, -238, -448, -622, + -1511, -4346, -417, -706, 37, 1157, -96, -199, + -59, 285, -43, -217, -22, -95, 103, 2242, + 244, 45, -74, -7, 366, -79, -359, -286, + 188, -14, 34, 49, 245, -108, -84, 88, + -333, -216, -79, 15, -5710, -36, -102, -552, + -213, -8, -356, 515, 212, -265, 80, 316, + -1163, -561, -517, -714, -375, -4176, 73, -666, + -363, -28, 1248, -68, 478, 2648, 642, -710, + -555, -744, -166, -744, -596, 138, 499, 59, + 453, -583, -290, -11, -48, 4174, -252, -74, + -78, -62, 449, -265, -818, -357, 171, -513, + 72, 106, -45, 649, 145, 5558, -60, -136, + 69, -172, -134, -66, -68, 100, 683, -427, + 795, -407, 345, 4930, -838, 361, 279, -190, + 173, -341, -9, 722, 383, -140, 123, -269, + 154, 31, 335, -465, 311, 46, 4535, -131, + 90, 151, 287, -11, -526, -614, -2253, -321, + -93, -550, -128, 25, 303, -139, 19, 0, + -3255, -161, 276, 103, -245, -515, 816, -1042, + -1449, 1693, -627, 1287, -837, -727, -80, -478, + -337, 116, 1, -270, -567, -311, -407, -1656, + -216, 196, 3004, -285, -521, 1510, 1818, 1392, + 42, -44, -244, -349, 959, -183, 25, 58, + 43, -345, -310, -8192, -84, 311, -60, -348, + 125, 33, -79, -138, 88, 138, -121, -37, + -211, -118, -142, -37, -132, 181, 162, -1423, + 1781, -3453, 1261, 134, 670, 1218, 761, 292, + -146, -825, 672, 737, 293, 433, 245, -392, + 46, 598, 257, -234, -1201, 718, -4549, -573, + -696, -224, -85, 75, -268, 244, 1817, 341, + -166, 436, -386, -1247, 22, -112, -55, -451, + 106, 388, -32, -254, -2400, -373, 892, 334, + -4114, -307, -107, -316, 41, -214, -403, -56, + -469, -246, 120, -237, 266, 43, 3257, -3925, + 291, 239, 752, -411, 162, 437, 159, 256, + 37, 71, -79, -136, -475, 124, -208, -216, + -245, 16, 40, -459, -4320, 340, -1462, 914, + 10, 490, 436, 162, 271, -238, -38, 2219, + 25, -141, 405, 107, 235, 282, -55, -7, + -3429, 565, -1095, -678, 1979, 233, -874, 592, + -474, 680, 402, -738, 21, 274, -321, 655, + -348, -546, 510, 62, 23, 4722, 572, 423, + -256, 473, 1240, -997, -899, -53, -73, 332, + -902, -771, -335, 0, 769, -587, 592, -703, + -600, -77, -94, -207, 792, -133, -758, 500, + -14, 330, 22, -281, -5460, 152, 607, 337, + -39, -118, -80, -51, 228, 65, -6, 540, + -3515, -1712, -449, -157, -164, -195, -1655, -1285, + 90, -517, -116, 11, 1402, -162, -64, -103, + 46, 302, 37, 71, 2903, 2952, 780, -487, + -297, -426, -369, 150, -129, -233, 813, 1639, + 190, 310, -311, 320, 94, -247, 1484, -32, + 70, -220, 560, 372, 54, 205, 96, -3567, + -680, 1683, -2377, 17, 548, -266, 257, 656, + 331, 205, -121, -814, 139, 326, -370, 625, + 2035, 818, 775, -1165, -41, -4258, 41, 1109, + 984, -885, -43, -314, 204, 204, 95, 407, + -351, 101, 133, -929, 899, -6, 384, -177, + -330, 240, 90, 78, -318, -455, -5, -365, + -61, -80, -72, -4850, -338, -384, 30, 181, + -2721, -767, 3217, 453, -226, -582, 283, 135, + -103, 265, 494, -1444, -120, 70, -976, -67, + -90, 660, 366, -609, 32, 205, 73, 51, + 346, -6, -120, -10, 300, 32, 270, 139, + -55, 453, 5712, 353, -145, 176, -168, 216, + 205, -30, -304, 1085, 221, 464, -426, 1662, + -1397, -1114, 301, -1058, 3553, -388, 743, 696, + -893, -296, -57, -254, -251, -178, 417, 82, + -988, -3566, 2171, -1312, -954, -23, -1349, 480, + 566, 24, -643, -292, -68, 303, 73, -81, + 296, 7, 371, 94, 1718, 498, -774, 857, + 1014, 358, 436, 210, -3481, -202, -416, 59, + 1987, 137, -476, 32, -627, 193, 368, -3, + -290, -3035, -352, -455, -609, -175, -5, -600, + -181, -249, -2551, 226, 105, -249, 1851, -86, + -1203, 214, -57, -505, -522, -247, -154, -40, + -17, -523, 333, -1777, -354, -1568, -3492, 1032, + 1577, 90, 153, 534, -106, -538, 102, 3, + -198, -99, -23, 835, 3495, -1099, 44, 732, + -350, 926, -472, 533, 1529, 54, -844, 1295, + 573, 414, -23, -71, 279, -891, 287, 126, + 1456, 973, 456, 1608, -646, -1244, 452, 651, + 694, 855, -235, -503, 745, -544, -3512, -138, + 678, 473, 220, -273, -9, 265, -1874, 397, + 1196, 284, -963, 298, 318, -2309, -162, 322, + -1250, -16, -1004, -5, 2800, -64, 72, -482, + -162, -412, -2922, 774, -335, 238, -1144, -134, + 1428, 558, 1969, -659, 902, -1698, 793, -858, + -613, 998, 253, -336, -348, -80, -117, -264, + 355, 808, 784, -559, 2030, 1952, -244, -1130, + -986, 1883, 1171, -493, -326, -880, 2588, -243, + -204, 194, -172, -65, 2026, 424, 587, -317, + 2550, -601, 203, -669, 475, -676, -1492, 27, + 41, -1078, -299, -630, 177, -164, -429, -246, + -357, 1191, -867, -1363, 1621, -110, 916, 217, + -1269, 622, -434, -1113, 888, -41, 1020, -1774, + 46, 80, -483, -892, -61, -472, 193, -192, + 2000, -103, 740, -223, 2493, 422, 2508, -331, + 470, -1233, 47, 595, 795, -465, -320, -163, + 128, 6, -209, 603, 536, -416, -1455, -87, + -1191, -98, -281, 1003, 1421, 388, 1163, -1146, + -81, -299, 2518, -1072, 207, -443, 506, -220, + -346, 98, 2119, -416, -2268, -498, 109, -1342, + -335, 1125, -712, 156, -1088, -2092, 1164, -500, + 113, -17, 551, -199, 262, -27, -692, -629, + 204, -1448, -1606, -1554, 289, 382, -691, 1229, + 414, -1746, -1198, 1113, -386, 310, 1354, -12, + -284, -569, 46, -558, 1495, 172, -899, 617, + 827, -365, 100, 1008, 136, 2111, 10, 2320, + -291, 364, -401, -408, -528, -612, 127, 1218, + -384, 129, -1603, 438, 1029, 2536, -150, -1432, + -856, 1068, 773, -762, -808, 676, -693, 404, + 145, 4, 27, -148, -318, -1019, -277, 1404, + 880, -1135, 861, 903, 739, 303, 139, 1918, + -952, 801, -306, -2439, -3, 442, -590, -1034, + 178, 430, 153, 1853, 1997, 742, 1745, -608, + -237, 160, 523, 950, 82, -1468, -1592, 807, + 719, 618, 319, 57, 235, 287, 1344, -50, + 324, -182, -365, -381, -377, 1989, 147, -573, + 1246, 1769, -473, -178, 961, -1297, -750, -1428, + -1246, 789, 158, 612, 17, -292, -227, -142, + 64, 51, -16, -301, -287, -60, -404, -267, + 109, -108, 189, -438, 48, 95, -5059, -42, +}; + +static const int16_t cb4432m1[] = { + 7567, 273, 268, -74, 201, 274, -149, -146, + -262, 243, -273, 63, -127, 135, -160, 231, + 120, 209, -91, -218, -38, -1206, -468, -159, + 278, 536, -995, -60, 22, 1041, -550, -121, + -241, -664, 427, -416, -1395, -732, 152, 3247, + -67, -154, -2430, 421, -405, -558, -73, -2887, + -272, -60, 365, 745, 287, -622, -1103, 412, + 266, 82, 61, -2172, -379, 529, -125, -1482, + 319, 643, 222, -508, 2451, -970, 71, 237, + -280, 202, 983, -223, -307, -130, 217, 3209, + 49, -30, 275, -12, -260, -3959, 1219, -104, + -2700, -201, 54, 851, -590, 691, -254, 408, + 296, -48, -364, 216, 16, 220, -415, 218, + 83, 43, -4032, -1359, 25, 15, -279, -2092, + 794, -433, -195, -162, 606, 166, 87, -316, + 508, 242, -359, 687, -178, 14, -2969, -500, + -1041, 3234, 679, 170, -791, -127, -630, -16, + -19, 181, -2, -185, -172, -88, -118, -167, + 128, 121, 239, 321, -125, 217, -7260, -157, + -161, -347, -257, 102, -1181, 71, -379, -205, + -268, 144, -174, -106, 305, 23, -47, 202, + -110, 660, 54, -2963, -119, -1371, -2823, 1171, + -726, 690, 534, 161, -435, 753, 58, 227, + 241, 138, -76, 473, 193, -1926, -2183, -2526, + -1428, 284, -1270, 336, -1458, 208, 41, -356, + 345, 153, -273, -166, 500, 42, 120, -35, + -81, 56, 1747, -3050, -2029, -764, -947, 888, + 422, 374, 143, -318, -225, 604, 343, -91, + 1626, 75, -211, 160, -667, -195, 38, -446, + -1269, -108, -959, -616, -530, 554, 2865, -156, + -358, -429, -261, 23, 511, 340, -548, 2347, + 105, 12, -32, 164, 170, -168, 268, 2587, + 3511, 612, 329, 159, 456, 273, -452, 168, + -394, 799, -58, 160, -480, -257, 242, 167, + 46, -1433, -1631, 50, 852, 509, 864, -381, + -306, -698, 261, -702, -19, 4113, -38, -153, + -11, 405, -441, -120, 139, -265, 225, 342, + 199, 2085, 237, 278, 252, 1537, 119, 182, + -174, -193, 2486, 87, 2903, -311, -304, 273, + -217, -256, -264, -675, -819, -188, -615, -1183, + 495, -154, -687, 2423, 197, -63, -146, 1151, + 896, -1129, -58, 1114, -1644, 1219, -648, -71, + -130, -2643, 533, -218, 3942, -83, 208, -724, + 198, -643, 590, -944, -56, -420, 115, 23, + -414, -144, 295, 219, -36, 393, -174, 91, + 290, -7066, 158, -275, -70, -119, -1, 302, + -262, -73, -61, 110, -196, -25, 87, -446, + -159, -6, -107, 115, -7562, 5, -33, 284, + -106, 34, -140, 160, -304, -272, -169, 25, + 93, -205, 28, 169, -165, -34, -50, 343, + 2204, 1440, 817, -1921, -590, -527, 81, -364, + -354, 163, -1058, 1977, 244, -75, 1201, -207, + 293, -289, -105, -121, 3588, 925, -2, -201, + -860, 917, 100, 265, -200, -44, -529, 351, + -579, -103, 186, -3622, 52, 181, -259, -411, + -4, -328, 380, 517, 306, 57, 340, -65, + -263, -311, 494, 326, -6136, 747, -141, 296, + 217, -2, -125, 8, -88, 254, -2934, -259, + 946, -905, 653, 436, 3393, -147, -157, 27, + 166, 299, 8, -16, 643, 114, 217, 57, + -21, -298, 19, 129, 1721, -134, 2337, 781, + -483, -748, 118, -330, -226, -3762, 222, -417, + -154, -24, -13, 1138, 210, 357, -122, 257, + -369, 863, 13, -320, -439, -433, 3469, -869, + 116, -2772, 202, 1065, -130, -287, 142, -288, + 54, 318, 131, -16, 84, 238, -361, 934, + 1341, 37, 130, -412, 146, -724, -3, -823, + 2555, -1263, 11, -147, 3164, -83, -39, -127, + 258, 26, -1181, 3339, -676, -30, -56, 691, + 867, 715, -903, 293, -205, -392, -22, 529, + -76, 2201, 433, 134, 1338, -18, 85, 3128, + 33, 924, 257, 1662, -769, 321, -449, -374, + -58, -597, -1670, 97, 222, -998, 404, -155, + 133, 358, -250, -125, 163, 6027, -228, -116, + -61, -878, -693, 710, -516, -191, -27, 443, + 83, -174, -695, -117, -107, -53, -142, 92, + -145, -114, -62, -710, -3192, -872, 3284, -521, + -36, -948, 252, -253, -143, 260, 109, -24, + 262, -169, -196, 195, 105, 27, -135, 1722, + 1862, -513, -270, -144, -414, -59, 91, -288, + -96, -56, -204, 273, 170, -171, -62, -4993, + -125, -67, -50, 226, -275, 600, 105, -217, + -450, -87, -20, -353, 24, -74, 167, 1881, + -4260, -144, 48, 92, 187, 319, 341, 22, + -4, 405, 147, 237, -120, 122, -237, 56, + -515, -153, 333, 834, 401, 210, -5516, 7, + 127, 147, -140, -479, -26, -1669, -21, -147, + 60, 387, 565, -140, -5827, -269, -1119, -324, + 118, -199, -11, 105, -49, 150, -148, 178, + 182, 162, 150, 68, -227, 3, 221, -330, + -23, 65, 6262, 71, 48, -41, -10, -1, + -44, -255, -50, -138, -109, -54, -31, 492, + -214, 239, -194, 35, -6348, -148, 9, 25, + -123, 84, -448, 241, 148, -35, 52, 35, + 7, 99, -16, 57, -43, -256, 3336, 373, + 211, -513, 2328, 86, -274, 386, 74, -174, + 624, -1037, -1154, 36, -209, -1028, -101, -412, + -103, -267, -107, -126, 163, -394, -1097, -100, + -1575, -542, 3326, -2149, 547, 626, -278, -414, + -781, 486, -186, -159, 138, -187, -821, 419, + 393, -4266, 828, 431, 86, 745, 1313, 1484, + 260, 52, 163, -455, -1071, 186, 522, 288, + 421, 18, 97, 1267, 200, 2637, -189, 729, + 746, 203, -639, -843, 2164, 671, 84, -2384, + 430, -161, 404, 166, -33, -17, 591, -227, + -3849, 1579, 175, -718, 99, -410, -844, -239, + 32, 212, 163, 480, 843, -379, -621, -317, + -424, 113, -262, 44, -93, 529, 144, -218, + 140, 3257, -575, -2697, 144, -83, -186, -44, + 977, 153, -230, -1530, 234, 212, 212, 331, + 412, -125, -3, 422, -329, -2181, 1406, 363, + -90, -86, 329, -267, -4462, -189, -87, 154, + 66, -200, 37, 80, -109, -199, 125, 1983, + 260, -438, -2417, 3259, -974, 453, 41, -77, + -538, 1123, 119, 120, 254, -239, -134, 33, + -384, -407, 27, 465, 1810, -910, 980, -15, + -1307, -919, 1880, -327, -303, -198, 149, 413, + 2176, 2269, -707, 343, 360, 169, 148, 182, + 104, 163, 857, 291, -153, 303, -679, -386, + -868, 2283, -320, 167, 3257, 1741, 338, 467, + 209, 207, 834, -226, -479, -120, 1674, -61, + 696, -93, -1327, 2176, 716, 402, 1688, 2219, + -339, 779, 366, 358, 241, -695, -272, -136, + -48, 36, -269, 862, -616, -118, -2028, 1678, + 1971, 115, 290, 71, -765, 31, -2874, 122, + 13, -424, -281, -320, 233, -1032, 40, -186, + 1208, 274, -2310, -1594, 289, 230, 1264, 962, + -310, 23, -548, 12, -38, -2734, 664, 37, + 346, -620, 266, -98, 82, 2369, 963, -1391, + -451, 833, 82, 175, 448, 1874, 345, -440, + 155, 130, 94, 326, 3223, 234, -163, -384, + -354, -539, 827, -9, 530, -226, -21, 332, + -2298, 3221, 1470, -282, -800, 231, 314, -998, + -1051, -648, -434, 743, -72, 119, 91, 414, + 379, 1370, -637, -998, 851, -2904, -266, -1652, + -1356, -1339, -1679, -181, 245, 731, -231, -2, + 221, -182, -325, -411, 346, 246, -2629, 1736, + -361, 24, 229, 1168, 747, 309, 425, -128, + -320, -496, 109, 1496, -70, -797, 37, -271, + -39, 906, -62, -194, 1753, 311, 689, 1354, + -1035, -973, -438, 1166, 2197, -99, -380, -274, + -1565, 447, 100, 349, 485, 653, 744, 50, + -582, -123, -1396, 156, -27, 349, -1067, -1382, + 1388, -1061, -554, 894, -80, -783, -1500, -736, + 897, 1158, -1386, -40, -280, -819, -672, -895, + 994, -308, -466, -578, 455, -1536, 879, -448, + 542, 1508, 850, -2465, 816, 641, -427, 310, + -168, -41, -908, -302, 1513, -29, -1144, 588, + -1703, 1144, 2623, 90, 284, 866, 335, -351, + 419, -745, 879, -183, -824, -1713, -34, -15, + -913, 37, -460, 778, 2130, -145, -153, 1761, + 1420, -243, -32, -877, 140, -700, 612, -2053, + 321, -78, -165, 200, 526, -1002, 2176, -1022, + 1436, 298, -21, -1378, 515, 304, 974, 1722, + 2054, 661, 425, 282, 471, 438, 70, 169, + 1587, -2076, -40, -702, 264, -146, -1499, -863, + -1775, -1059, -490, 92, 631, -1194, -1031, 335, + 257, -1299, 241, -270, -325, -322, -37, 0, + -685, 897, 984, -909, 1556, 1281, 1367, -1269, + -1591, 415, -1156, -374, -110, 1552, -695, 74, + -167, -473, 1421, -611, 175, 1521, 1322, 436, + 1969, -787, 1041, -730, -598, 188, -794, -531, + -2198, -317, -11, -8, -407, 198, -1180, -1675, + 174, 981, 467, -149, -890, 263, 1030, -121, + 2147, -135, 1975, -634, 431, -238, -695, 1338, + -172, 110, 147, -334, -726, 65, -873, 667, + 997, -1118, -339, 144, -700, 1303, -207, -609, + -1617, -765, 839, 505, -36, -58, -2894, 226, +}; + +static const int16_t cb4440sl0[] = { + -3624, -495, 158, -246, -529, -813, 689, 504, + -527, -2216, -198, -323, -690, -591, 175, 262, + 243, -3676, 2648, -986, 166, 243, 301, -700, + 324, -324, 13, 362, 222, -470, 30, 20, + -46, -147, 4050, -97, -560, 284, 317, -1611, + 655, -416, -1582, -675, 389, -124, 150, -27, + 325, -84, 48, 7474, 97, 105, 19, 38, + 133, 19, 28, 25, 40, 34, -59, 22, + 11, 27, 21, 5, -1596, -428, 439, 353, + 2288, -18, 357, -274, 2582, -126, -90, 71, + -9, -704, 205, 22, 44, -120, -43, 517, + 817, 1370, 2151, 2818, -470, 90, 395, -1243, + -345, 959, 19, -1, 123, -108, 347, 25, + -138, 15, 119, -117, -146, 142, 183, -254, + -276, -174, 5980, 283, -317, 70, 51, -15, + -2447, -79, 234, 736, -2600, -641, -1162, 376, + 959, -250, 701, -40, -102, 204, -38, -24, + -893, -387, 339, 1338, -91, -655, -864, 78, + 299, 228, -2732, 234, 1995, -1321, -139, 500, + -316, -140, 2, -80, 186, 11, 16, -69, + -7534, 85, -263, 189, -7, -1, -67, -68, + 3, 24, 391, -3299, -2952, -121, -393, 103, + -60, -113, 141, 185, -119, 240, 270, -392, + -105, 9, -39, 2529, -17, 353, 2966, -855, + 1042, 1294, 132, -257, -257, -496, 112, -179, + 424, 486, -63, 77, 275, -198, 2026, 1657, + 913, -255, -147, -1748, -5, 418, 356, 2022, + 927, -295, 194, 165, 28, 109, 13, 209, + -133, -2802, 420, -1873, -648, 309, -1172, -1825, + -36, 840, 280, 44, -118, 128, 34, 241, + -1005, 1160, -303, 318, 726, -1716, 2625, -950, + -839, -1257, -901, -238, 1123, 131, 252, 1, + 440, 1455, -14, -274, -461, 87, -515, -2299, + 928, -2867, -804, -215, 680, 147, 80, 215, + 15, 1339, 141, -95, 134, -35, 122, 53, + 429, 168, 476, -45, 745, 236, 4229, 318, + 247, -201, -372, 2289, 161, 431, 337, -707, + -1024, 121, -1773, -795, -1187, -401, 394, -1431, + 1526, -35, 432, 2929, 90, 1880, 628, 1298, + -552, -498, 207, -97, -1431, 1105, 29, -739, + -56, 62, 94, 537, -732, 1255, -766, 200, + -365, 2846, 2139, 435, 92, -710, -512, 360, + -339, 1021, 474, -132, 405, -440, 3435, 75, + -254, -2443, -880, 325, 343, 285, 230, -431, + -191, 215, 201, -443, 93, -81, -131, 2981, + -2986, 1003, 437, 434, -386, 17, 222, 70, + 173, -550, 267, -121, -43, 114, -11, -795, + 561, -147, 187, -198, -4969, 50, 59, 674, + -853, 163, 71, -205, -284, -50, -28, -1412, + -105, 262, 272, 565, -824, -541, 3381, 430, + -81, 228, -426, 978, -294, 422, -538, 13, + 9, 430, 180, 2329, -564, -1082, 1740, 1108, + -2011, 11, 343, 868, 723, -806, 342, 339, + -141, -173, 186, 50, 297, 705, 783, -593, + 1609, 212, 528, -2547, -863, -2457, -876, 164, + 162, 365, 68, 30, 11, 48, 47, -285, + -64, 166, -21, -6880, -191, -226, 89, -1, + 22, -93, -6, 44, 282, 52, 294, -690, + -147, 372, 2247, 804, -637, 54, 2385, -1799, + 315, -929, 692, -65, -54, 218, -752, -519, + 2171, 177, 907, 22, -778, -2656, 62, -418, + -434, 307, 1906, -280, 196, 76, 58, -46, + 70, -367, -67, 50, 125, 77, -547, -287, + -97, -10, -84, -271, -4856, 10, 490, -560, + -21, 66, -2469, -322, 1021, 936, 625, -2520, + 1144, -373, 270, 804, 603, -91, 262, 659, + 9, -324, 50, -712, 2705, -3016, 594, 87, + -88, 697, -205, -799, -128, 37, 504, 59, + -274, 655, 672, -20, 1294, -221, -2954, 198, + 674, -1676, 863, 324, 968, 731, 1125, -41, + -149, -303, 223, 1370, -67, -194, -1, -194, + 251, -459, -39, 4477, 113, -74, -386, 214, + -72, -77, -1593, 511, -461, 752, -559, -476, + 204, -722, 1050, 2080, 2468, -154, -208, 964, + 103, -58, 390, -1863, 910, -307, 209, -32, + 663, 103, -133, -3137, -423, 259, -605, -242, + 139, -391, -488, 77, -266, -1694, 397, -659, + 237, 2068, -3, -867, 870, 1647, 645, 1848, + 68, 382, 455, -551, -87, -99, -2926, 372, + 2438, -1166, -6, 521, -195, 1259, -162, 917, + 140, 275, -273, 133, 318, -25, 252, -119, + -132, 3120, 397, 398, -420, 1756, 666, 2176, + -141, 271, -51, 22, -494, -36, 57, 308, + 222, 3585, 16, -265, 2628, -24, 162, 13, + -240, -96, 620, 331, -449, 710, -123, -105, + 23, -170, 20, 256, -5228, 398, -186, 272, + 129, 175, 598, -16, -502, 11, -215, 28, + -110, 3570, 68, 199, -2535, -933, 781, -762, + 325, 18, -438, -319, 473, -677, 176, 290, + 0, 67, -6, -156, 31, 35, -131, -127, + 24, -100, -6826, -117, -53, -40, 99, -50, + -93, 31, 34, -251, 186, 487, -203, -662, + -182, -96, 239, 308, 338, -86, -4871, 264, + -48, 314, -66, 100, -188, 151, 24, 198, + 4, 5046, -47, -654, -43, 41, 109, 103, + -262, 93, -118, -63, 58, 2088, 336, -320, + 2326, 548, -810, -1315, -864, 461, 171, 76, + -1109, -1510, -874, -620, 97, 88, 40, -4, + -7295, -128, -39, 23, -100, -9, -74, 112, + -151, 67, 21, 53, 2, -29, -33, 52, + 3287, -2178, 626, 339, -817, 349, -1187, -550, + -390, 57, -41, 295, 756, 185, -215, 17, + 3, 7502, -134, -122, -31, -53, 91, -170, + -71, 133, -34, 57, -112, -5, -66, 17, + 1, 2328, 3714, 214, -123, -839, 9, -62, + 54, 70, -18, 817, 186, -61, -252, 37, + 98, 9, 2010, 738, -1651, -1924, 1106, -624, + 143, -548, 847, -198, -140, -691, 478, -758, + 56, 54, -7, 209, -2665, 109, -127, -134, + 2099, 333, -602, -2217, -743, 346, 74, 216, + 579, 223, 61, -30, 57, 94, 224, -2595, + -566, -851, 246, 314, 65, 2857, 114, -760, + 77, -611, 119, 181, 4, -2556, 127, 138, + -164, -219, -116, 157, -3143, 197, -98, -1040, + 235, -332, -424, -152, -338, -33, -220, 207, + 254, 5469, -102, -390, -125, -420, 113, -233, + 329, -34, 109, -171, 103, 50, 58, 96, + -500, -2317, -259, 2178, 109, -2030, 759, -780, + 448, 678, -384, -271, 213, 334, -271, 23, + -1121, 636, -1103, -482, -3059, -1200, 1160, 109, + -232, 541, -788, 130, -166, -300, 664, 233, + -97, -29, -286, 33, 1272, -298, -382, -242, + -199, 47, 479, 224, -1761, -1904, 1780, 1439, + -681, -1973, -118, -90, -148, 247, -758, 1936, + 182, 1373, 2346, 120, -758, -476, 1789, 1177, + 611, -394, -14, -39, -994, -674, 1049, -41, + 836, -391, 942, -1040, -1437, 1376, -1916, 1129, + -1018, -653, 1284, -72, -166, 321, 194, -142, + -151, -77, 251, -162, 732, -790, 107, -292, + -675, -4248, -51, -86, -299, -495, 413, -128, + -455, -105, -842, 881, -492, 1241, -1432, -1296, + -52, -430, 2533, -1765, 838, 84, -24, -798, + -428, -154, -658, 37, -388, -591, -931, -433, + -1837, 1363, -683, -717, 3115, 104, 0, 1104, + 208, 148, 404, 101, 18, 217, 58, 49, + 4, -49, -195, 187, -239, -21, 294, -138, +}; + +static const int16_t cb4440sl1[] = { + -3057, -853, 3212, -334, 5, 224, 63, -250, + -345, -102, -289, -115, 75, -99, 206, -8, + 19, 96, -254, -2566, 334, 2773, 136, 199, + -1076, 347, -187, 481, -64, 654, -9, -1094, + 196, 40, -95, 5, 163, -135, 253, -1053, + 316, -231, 24, -2307, 1480, -2052, -18, -459, + -550, -1860, -15, 98, -1406, -66, -250, 21, + 497, -404, -54, -228, 2477, 2011, -145, -1957, + -426, -906, 608, 15, 1453, 218, -79, -636, + -1005, -332, 304, 2338, 1356, 81, -1201, -170, + -126, -1177, -1644, -1046, 16, 182, -328, -347, + 346, 591, 418, 623, -110, -342, -227, 10, + -5055, -411, 128, -103, 87, -28, -133, 196, + 333, 1785, -479, -442, -2892, 453, -2292, -19, + -383, -44, -435, -193, 503, 130, 4, 144, + 2184, -245, -7, 458, 82, -76, 3052, -375, + 1299, -76, 364, -145, 372, 36, 59, -39, + 48, 385, -230, 2764, 2956, -741, -372, 428, + -504, -220, -821, -47, -49, 609, -62, 56, + 6, 216, 376, 519, -512, 54, -318, -183, + -4563, 297, 795, -182, 108, 234, 404, 218, + -123, -17, -192, 170, 349, 134, -91, 43, + -135, -24, -6, -32, -6681, 50, -138, -89, + -18, 15, 24, -416, 356, 311, 83, -267, + 81, 209, -155, -368, 396, 358, 232, 4696, + -347, 724, 112, 10, 331, 358, 197, 54, + 824, 646, -214, 113, -4425, 184, -11, 101, + -313, 186, 253, 169, 78, 52, -70, -108, + 1669, -22, -18, -2600, -27, 2806, 288, -106, + 506, 176, 616, -299, 58, -30, 1, -220, + 400, -177, 874, 70, -36, -274, -139, 1148, + 372, 40, 236, 505, 619, -4002, -95, -48, + -2854, 114, -69, -2805, -401, -9, 203, -1011, + 472, -1066, 412, -220, 245, -183, -27, 35, + -762, 312, -137, -292, -242, 896, 172, -345, + 106, -4490, 506, 569, -11, -352, -108, 334, + -165, 2389, -895, 2761, 467, 201, 150, -516, + 39, -1105, 4, 587, -152, -764, -184, -15, + -137, -30, -12, 7, 382, -461, 1577, 3519, + -173, 1370, 80, 499, 344, -771, 123, -13, + 288, 233, 111, -2472, 3952, 771, 216, -505, + -446, 531, -230, 103, -72, 34, 61, 249, + -175, 353, 83, 51, 169, -97, -60, 7827, + 95, 75, -13, 201, -27, 103, -11, 1, + 3, 121, -73, -28, 7, 2908, -209, -987, + -129, -341, 2840, 889, -147, -521, 123, 95, + -239, 552, -738, 279, -66, 0, 16, 116, + -45, -28, -43, -38, -7627, 30, -52, -209, + 281, -46, 23, -24, 56, -25, -23, -2534, + -107, -46, -93, -49, 238, -25, 96, -356, + 3483, -459, -414, 205, 102, 202, -150, -116, + 1785, 1399, 793, 543, 685, -2837, 255, 362, + -96, 410, 926, 1068, 416, 558, -169, 246, + 138, 2136, 39, -96, -605, 279, -130, -2741, + -1101, -935, -20, -227, 453, 1261, 103, 275, + 358, 43, 197, -23, -251, 322, -22, 233, + 2560, -214, 2, -101, 645, 2864, 287, -479, + 904, -65, 73, 224, 2418, -95, 428, -678, + -278, 71, -545, -571, -566, -181, -212, -2947, + 222, 780, -365, 124, -2703, -198, -69, -246, + -3056, -184, -598, -75, -145, -690, 380, 194, + 485, 214, -484, 54, 163, 363, -924, 1684, + 201, 34, 236, -539, 2374, -150, -490, -1313, + -61, 317, 2123, 315, -551, -26, -328, 207, + 253, -3015, 166, 109, -662, 2466, -157, -740, + 751, 254, -788, -369, -6, 100, -211, 107, + -309, -39, -47, 279, -126, -91, 97, -705, + 235, -231, 182, 283, -5097, -68, 285, 49, + 50, 637, 111, 39, -386, 923, 223, 115, + 1638, 1214, -640, -2168, 482, -2228, 857, 172, + 15, -2207, -89, 335, -18, 295, 718, -956, + 26, 604, -436, 2856, -1131, 98, -754, 243, + 9, 29, -4028, -1725, -1741, 432, -211, -60, + -535, 201, -273, 111, 444, 607, -250, 122, + 98, 159, 97, 281, 3071, -412, -2849, -721, + -14, 960, -43, 794, -427, 297, 478, 379, + -47, -22, 69, -60, -30, -732, 2456, 170, + 142, 6, 2520, -644, -201, -16, 1602, -20, + -293, 542, -451, -167, -9, 14, 1052, 2707, + 2980, -117, 479, -202, -92, 36, 904, -66, + -1088, -31, 75, -62, -110, -29, 112, -102, + 5217, -85, 14, -191, -202, -175, -71, 182, + -231, 275, 144, -1, -202, -13, -29, -19, + 70, 39, 46, 56, -7608, -53, -104, -61, + 44, 23, 1, -157, 42, 12, 38, 37, + 331, -609, -2516, -174, -2491, 258, -256, -926, + 983, 100, 83, 173, -965, 650, -304, -97, + 98, -166, 534, 2570, -611, 493, 103, -98, + 148, 3081, -131, 285, 13, -367, 205, -53, + 41, 29, -154, -2657, -51, -312, 134, 50, + -1514, 634, 411, -2885, -391, 365, -373, -54, + -74, -151, 80, 152, -91, -64, -209, 1134, + -2921, 316, -951, 1124, 713, 2, -2212, 31, + 164, -260, 103, 36, 229, 111, -23, -65, + -37, -220, -108, -30, 86, 17, 87, 205, + 163, 63, -5763, 254, 178, -18, 1760, -380, + 1453, -3151, 710, 106, 66, 387, 235, 463, + -295, 688, -124, 322, -193, 82, 1012, -2033, + -656, 1362, 805, -747, 2527, 470, 43, -1001, + 100, -83, 161, 74, -1128, -307, -82, -197, + -5470, 226, -327, 137, -131, 471, -432, -16, + 243, 224, 168, -164, -58, 125, 23, -2, + -2752, 268, -92, -466, 2876, 874, 182, 540, + -407, -338, -396, 562, -376, 536, -225, 160, + 44, -1501, -246, -1062, -378, 446, -2448, -124, + 499, -2297, -353, -637, 395, 598, -747, 418, + -495, 5, -1014, 2138, 289, -75, 301, 944, + 66, -457, -459, -253, -2, 678, 367, 116, + -2901, 436, -239, -303, -973, 384, -2574, 6, + -225, -164, -440, 627, 388, -3074, -263, 156, + -805, 381, -9, -112, -1481, 536, -711, 3770, + -496, 908, 483, 474, 298, -424, -793, -203, + -334, 134, -91, 208, -73, 5440, -316, -304, + 249, -1, -98, -214, 190, 242, -57, -38, + 244, -219, 30, -224, 66, -30, 22, 24, + 24, -109, -7594, -115, 90, -147, -83, 21, + -257, -52, 134, -49, 92, -117, 30, -8, + -636, 1551, 2207, -66, -1962, 212, 567, 969, + -1595, -562, 355, -467, -861, 937, -148, 15, + -68, -1516, -2118, 1477, 777, 1458, 976, 522, + 325, 957, -130, -132, -918, 448, 1088, 102, + 142, -644, -284, 687, -665, -132, -1870, 1387, + 733, -84, 920, -508, 53, -2183, 254, 565, + 2056, 97, 57, 219, 688, -344, 659, 2033, + 963, -1717, -290, -934, -2119, 57, -1452, 24, + -639, -739, -232, 170, 28, 359, -312, 310, + -103, -1067, -953, 1081, -857, 1926, 1364, -1719, + -863, 1832, 786, 55, 166, 383, -1373, -347, + 1710, -908, 91, 1257, 2013, -592, -1337, 1431, + -90, 617, 549, -356, -68, 134, -48, -133, + -176, -18, -65, 23, 84, -23, -36, -4, + 230, 297, -204, -150, 86, -4965, 742, 40, + 32, -1070, 149, 38, 302, -329, -386, -57, + 45, -1622, 1425, 1817, 1568, 2202, 7, -1192, + -201, -42, -62, -170, -32, -117, -38, 229, + 44, -226, 155, 70, 747, 259, -261, -120, +}; + +static const int16_t cb4440ss0[] = { + -3021, 2048, -450, 1147, 1487, -796, -657, 459, + 609, 63, -153, -1174, -144, 37, -176, -160, + 43, -31, -2577, 88, -797, 1179, -707, 3154, + -543, 875, 116, -40, -150, 326, 293, -112, + -73, -34, 61, 8, -2251, -1551, -2507, 6, + -52, -5, -323, -313, 1076, 920, 1116, -1100, + 1103, 310, -144, 904, 149, -59, 636, -1508, + -378, 381, -917, -868, 1388, -1225, -68, 1491, + 685, -220, 3253, 48, -504, 192, 114, -11, + -1718, -916, 660, -240, 767, -1061, 332, 591, + -477, -278, 25, -1485, 55, 216, -3238, -19, + -320, -148, 273, -876, 22, -529, 3263, -2535, + -756, -133, -481, -1024, 34, 418, -415, 412, + -92, -90, 161, -49, -1699, -2737, 2923, -243, + 122, 87, 984, -377, -37, 128, 350, -444, + -98, -52, 14, -14, -86, 255, 1997, -1239, + 42, 247, -15, 16, 405, 302, -17, 84, + -4033, -12, 254, -365, -205, -162, 329, 31, + -1158, -210, -376, 3958, -1601, -1128, 737, 731, + 300, -785, -777, -403, 463, -226, -109, -277, + -70, -53, -856, -785, -997, 71, 5565, 317, + 447, -279, -357, 254, 93, -47, -206, 133, + 88, 272, 7, 44, 2229, 1666, 234, 519, + -1996, -1195, 549, 449, 174, -1010, 622, 425, + 2288, -9, -390, 612, -40, 32, -1867, -673, + -70, -1174, 106, 134, 354, 61, -144, -290, + 82, -604, 202, -3954, 248, -76, 7, 224, + -1844, 99, -146, 206, -335, 243, 25, 60, + 186, 117, 67, -137, 119, 46, 4563, 45, + -46, -2, 874, 533, 216, -38, 185, -540, + -191, -163, -126, -108, -184, 193, -39, -4768, + 111, -89, -61, 17, 1064, 1678, 894, 4334, + 139, -892, 317, -351, 417, -87, -22, 195, + 20, 140, 234, -197, -268, -5, -1618, -756, + -119, -1749, -704, -943, 421, -3488, 871, -468, + 656, 266, -79, 325, -303, 45, -3, -31, + 1140, -707, -1578, -1434, 290, 327, -1365, -2913, + 1048, 38, -136, -871, -572, -30, 186, 343, + -30, -157, 1301, 1913, -515, -842, -723, -84, + -340, 270, -918, 3213, -1530, -394, -184, -60, + -391, -27, -110, 84, 104, 419, 1201, -810, + 1546, 39, -914, -334, -4257, 427, -95, -426, + -94, 256, -148, 246, -80, 9, -462, -1125, + 644, 3541, -140, 2346, 1045, -335, -867, 809, + 432, 386, -6, 159, 70, -10, 218, 43, + -2229, -607, 537, -924, -3038, -943, -968, 1261, + 28, 197, -285, 61, 137, 69, -2, -251, + 111, -19, -314, 2064, 960, 1529, 1056, 926, + -319, -1617, 1305, 1473, -867, 684, 1357, -834, + -66, 477, 74, -15, -1769, 1925, -2448, -1777, + -507, 264, -1740, 176, -518, -58, 32, -108, + 165, -68, 189, 35, 40, -85, -1152, 255, + 36, -1922, 1500, 1415, 841, -92, 3305, -110, + 3, -219, 167, 573, 219, 310, 27, 195, + 359, -244, 538, -2042, 355, 656, 51, -199, + -204, -3611, -396, 839, 743, -241, -80, -210, + -101, 28, -1399, 1062, -955, 54, -630, -178, + -376, 212, 237, -219, 47, 805, 216, 26, + -4334, 455, 4, 4, -1587, 95, 1186, -3101, + -140, -862, 916, 2063, 211, 96, 337, -185, + -195, 424, 1207, -31, -162, 206, 2485, -46, + -451, -1778, -40, 144, -155, 2884, 803, 396, + 1196, -635, 297, -76, -121, -162, -206, -149, + -2204, 1035, 232, -815, -49, 1006, 553, -407, + 161, 3650, -264, 370, -418, -28, 141, -177, + -113, -90, -315, 626, 62, 1392, -1815, 336, + -1276, -402, 486, -1060, -1848, 2610, 826, 485, + -250, 39, 208, 14, 2555, 2869, -813, -2074, + 337, 601, 855, -655, 566, -707, 189, -77, + 137, -510, -282, 79, 42, 73, 62, 650, + -4732, -486, 354, 420, 828, -645, -492, 388, + 753, 18, 2, 766, -212, 126, -43, 45, + 447, -283, 607, 251, -166, -10, 48, -5850, + -251, 128, -205, -95, 90, 90, 67, 24, + -50, -48, -167, -3231, -2926, 1831, 199, 484, + 169, -614, -135, -374, -418, -239, -89, -121, + 45, 75, -11, 16, -1058, 354, 1633, 589, + -1223, 1218, 842, -1146, 2186, 374, -363, 216, + -2153, -429, 429, -597, 93, 148, 1849, -797, + -162, 31, -325, 343, -323, 161, -373, 684, + -367, -452, -4306, -88, 28, -56, -59, 43, + -49, -1998, -956, 1331, -4214, -129, 30, 79, + -90, -129, 109, 130, -160, 409, 105, 298, + 208, 178, 1724, 731, 773, 128, 817, -425, + -4046, 180, -782, -116, 191, -259, 181, -31, + 162, 43, -41, -69, 1463, -1769, -2, -442, + -636, 1495, -218, -123, -58, 3616, 454, -475, + 247, -383, 304, 185, 155, 40, 1104, 1046, + -8, -736, -1155, -115, 3925, -257, -35, -599, + -437, -135, -256, 55, 214, -88, 215, -57, + -1097, 183, -501, -608, -135, 148, 405, 295, + 96, -513, 1013, 4350, -162, -61, 427, 315, + 24, -77, -1278, -167, -1774, -133, -323, -4339, + 732, 597, -30, -103, 79, -241, 177, -388, + 7, 44, 175, -143, 5030, 277, 58, 42, + -222, -133, -319, 6, 240, 217, -238, -198, + 218, -43, 439, 49, 37, 106, 1123, 2196, + 158, 171, 458, -932, -435, -2783, -300, 444, + 2317, -146, -339, -162, 157, -216, 1, 66, + 987, -190, -728, -3188, -3167, 378, -1, 158, + 459, 78, -42, 386, -133, 155, 294, 359, + -29, 78, 1763, 780, 1019, -330, 179, -51, + -393, 338, 4422, -296, -392, 170, 2, 52, + 253, 150, -191, 139, -371, 161, -2202, 156, + 37, -1004, -384, -466, 23, 183, -3701, 97, + -1293, -355, -83, -63, -26, 69, -1817, 641, + 2996, -16, 2011, -406, -647, -652, 332, 788, + 484, 918, -440, 1246, 165, 52, -260, 31, + -255, -7237, 14, 90, -135, 122, 14, 154, + 5, -78, 111, -254, 154, -23, -24, -83, + -9, 49, -426, 1657, 99, -36, -191, 2625, + 655, -20, -2723, -977, -222, -48, 155, 41, + 20, 194, -73, -26, -1206, -3517, -471, -815, + -1144, -371, 1353, -1069, -1238, 829, -227, 487, + -297, -101, 914, 100, -17, 115, -806, -798, + 585, 1097, -1, -792, 818, 29, -256, -417, + 942, 68, -4165, 34, -408, -252, 55, -77, + 246, 2055, -4, -313, -661, -836, 559, -393, + 2043, 153, 286, -2700, 98, -177, 1201, 99, + 308, -73, 1441, -3902, 730, -1610, 886, -599, + -126, 473, 43, -252, 45, 95, -291, 101, + -307, 259, -149, 26, -510, 498, 1403, -78, + -1039, -2551, 773, -1176, -1525, -405, -259, -283, + 398, 2080, -199, 62, 239, -26, 960, 582, + 2516, 799, -2127, 325, -253, -1652, -965, 1413, + 8, -119, 396, -342, 277, 541, 186, -142, + 1210, -732, 798, -47, -557, -12, 63, 537, + 148, -128, 328, 290, 203, 361, -328, -64, + 4004, 197, -640, 996, -93, -2314, 76, -914, + 1437, -964, -1735, 984, -578, 1389, -1025, -66, + -120, -1211, -32, 5, -1215, 771, 1621, -934, + -984, 148, -1592, -446, 19, -976, -1709, -1113, + -218, 191, -279, 2183, 10, -37, -842, -1582, + -92, 558, 227, -702, -365, -576, -100, 670, + -305, 285, 48, -329, 253, 3878, 156, 70, + -1008, 641, 1541, -234, 1440, 421, 1088, 735, + -206, -83, 460, -139, 107, -1160, -6, 2087, + 1894, -117, 962, 113, -990, 93, -29, 579, + 1217, -52, -342, -451, 670, 202, -1070, 837, + -132, 3507, -59, -114, -691, 208, -1170, 1089, + 305, -200, 603, -1301, -942, -1631, 1291, -2727, + 414, 80, 815, -443, 54, -34, -1141, 1301, + -1199, 372, 102, -257, 70, 450, -55, 80, + -227, 218, 264, 739, -52, -200, 3873, 83, +}; + +static const int16_t cb4440ss1[] = { + 6875, -104, -66, 161, 57, 24, -4, 76, + -122, -100, 31, 188, -119, -50, -244, 49, + 1, -100, 555, 253, 433, 633, -163, -5345, + -170, -217, -49, -29, 331, 633, -87, -46, + -29, 44, -174, -74, 2188, 434, 660, -593, + 1548, 379, 1443, 1676, -63, -2125, 246, 534, + -463, 872, -169, -12, 33, 211, -409, 408, + 1514, -189, -277, 391, -361, -35, 145, -362, + -4669, 212, -97, -65, 387, -81, 70, 36, + 448, 303, 332, -1077, -258, -1353, 1185, -50, + -12, -74, -2101, 2429, 1817, -939, 393, 169, + -22, -36, 1219, 3237, 816, 452, 1807, -646, + 407, -447, -1778, -370, -528, -127, 104, 416, + -121, -134, -62, 20, 1751, -640, -222, 950, + 1603, 555, 9, 219, -1272, 2724, 1004, 1237, + -395, 356, -453, -98, -24, 80, -1621, 474, + -1947, -237, -1059, -2091, 780, 1211, 939, 268, + -412, 1923, -419, 851, 230, 567, 143, 48, + 1506, 2228, -1226, -453, 246, 469, 540, -538, + -96, 977, 508, 105, -3150, -142, -37, 395, + 9, -38, 1, -135, -391, 1702, -179, -1566, + -3181, -1679, 203, -151, 387, 250, 563, 203, + 443, -168, 82, 61, 1604, -1878, 229, -82, + 208, 2965, 1093, 251, 1592, -432, -532, 153, + 407, 157, 191, -216, 52, -58, 935, -2161, + -409, -513, 977, -113, 3247, -1207, -743, -1178, + 136, 206, 184, -885, -64, 16, -23, -24, + 731, 1769, -941, 1543, -2386, -669, -958, 233, + 105, -1124, 948, 97, -1949, 59, -152, -65, + 114, 82, 387, -1908, -492, 129, -624, 93, + 658, -753, 1032, 2480, -1776, 360, -38, 1924, + 168, -12, -10, -128, -1712, -446, 939, 465, + 605, -586, -299, -393, 3878, 111, -379, 146, + 186, -50, -279, -30, -3, 35, -1941, 360, + -79, -111, -4287, -6, 671, -214, -792, 277, + 77, 58, 8, 16, 133, 161, 21, 33, + 1535, -296, -2668, -3198, -28, -386, 1156, 144, + -201, 256, -411, 298, 67, 670, 11, -227, + -4, -104, 12, -1000, 1192, 860, 813, 360, + 25, 93, 792, -350, 81, 4046, -178, 122, + 332, 28, -112, -8, 288, 539, -17, -63, + 8, 231, 55, -514, 105, -344, 252, -153, + 59, -10, -21, 51, 6793, 45, 259, 384, + 209, -2010, 311, -769, -1957, 2791, -463, -293, + -218, 1026, 897, -798, 47, -525, 31, -42, + 2018, -2767, 1658, 685, -1947, 46, -1468, 340, + -272, 318, 21, -421, -396, 244, -51, 290, + 45, 3, -1530, 1359, -3681, 1487, -1689, 209, + 438, -785, -220, 2, -55, -483, -35, 40, + 6, 189, -200, 2, -2026, -1747, 838, -880, + 1128, -3108, 184, -671, -261, 8, 296, -130, + -78, -268, -100, 18, -105, -9, 448, 3184, + -570, 656, -376, -969, 1682, 2635, -277, 577, + 217, 281, 219, -351, 31, 64, 101, 82, + 957, -1885, 774, -3536, -168, -431, -106, -479, + 1041, -103, 774, -142, 894, -724, -94, -766, + -58, 112, 2028, 566, -346, -139, -2671, -1907, + 1039, 189, -33, 1690, 263, -514, -225, -237, + 145, -319, 38, 116, 2891, -77, -2065, 2559, + -327, -763, 86, -172, -283, -147, 137, 245, + -333, 220, 92, 194, -176, 105, 3108, 329, + -372, -1188, 670, 773, -235, 34, -146, 876, + -259, -1580, 876, 105, 582, 259, -63, -99, + -1558, 1122, -1541, -438, 227, 1221, -1297, -746, + 2698, -29, 1169, 995, -2, 201, 392, -405, + -22, -36, 757, -4039, 725, 1960, 1478, -107, + 67, -367, -97, -88, 154, -80, 0, -265, + -163, 14, -109, 33, 597, 115, 543, 468, + -757, 826, 509, -176, -305, -4959, -118, -464, + -421, -72, 1, -187, 123, -88, -1086, 26, + 368, 610, 3394, -337, 364, 2594, 491, 759, + -309, 395, 152, 338, 249, 303, -122, 63, + 1019, -864, 1546, 196, 75, -633, -93, -631, + 777, -74, 1235, -745, 377, 3113, -174, -282, + -24, 89, -920, 2124, 620, 566, 1290, 2977, + 1180, 278, 188, 750, 981, -357, 80, 69, + 77, -151, 150, -15, 834, -893, 818, 1655, + -500, 237, 133, 243, 405, 239, 16, -152, + -70, -3692, -110, 145, 58, -57, -2527, 3072, + 2226, 218, -824, 384, -96, 119, -228, -194, + 136, 111, -251, -109, -179, -34, 143, 109, + 1157, -216, -1429, -702, 323, -1199, -60, 632, + -585, -340, 1040, 471, -32, -380, 3432, 455, + -138, -39, -2416, 652, -253, 145, 281, 393, + -671, 2841, -1616, -46, -385, -1417, -273, -168, + 318, -263, -2, -69, -638, -137, -2668, -359, + -86, 79, -777, -404, -560, -3533, 122, -113, + 617, 497, 117, -268, 110, 73, 752, -1105, + -521, 762, 695, -587, -147, -1235, 1866, -2250, + -671, -511, -2178, -820, -619, 162, -37, 102, + -342, -278, 6837, -278, 185, 10, 361, -52, + -171, 246, 184, -175, 19, 166, -48, -41, + 92, -152, -1227, -983, -3985, -703, 1143, 204, + -523, 1053, -623, 1002, 231, 53, -277, -409, + -67, -56, -90, -47, 448, 754, 554, 972, + 505, -331, 4946, -193, 89, 530, -24, -172, + 254, 244, 140, -10, 40, -77, 1655, -438, + -2776, 51, -553, 592, -2902, 280, 804, 776, + 131, 69, -207, 131, 7, 209, 93, -19, + -1148, -733, 2674, -1628, -1243, -506, -2346, -857, + -1028, 666, 365, -353, 105, 120, 210, -85, + 37, -40, 1027, 11, 1234, -5, -1976, 515, + 289, 3815, -142, -188, -248, -273, -265, 593, + 205, 164, -65, 70, -992, 1586, 2130, 779, + 92, -3067, 421, 1, 1172, 496, -917, -760, + 169, -64, 14, -40, -247, -95, 1769, -145, + 712, -794, -571, 240, -1774, -38, -129, -836, + 3372, 887, -451, 73, -107, 182, 100, 14, + -703, 2559, 490, -839, -333, 134, 804, -3549, + 50, -199, -215, -370, 453, -86, 151, -98, + -58, 128, -2624, -1507, -1623, -2186, -89, -55, + -472, -667, 2, -439, -1453, -262, 565, 56, + -118, 288, -56, 87, -398, 729, 40, -6015, + 219, -212, 287, -250, -211, -29, -61, -55, + -120, -92, 30, 129, -122, 111, 2037, 1260, + 943, -252, -13, -794, -2570, -1117, 297, 374, + -1629, -1, -407, -597, -324, -179, 408, 58, + -902, -1672, 611, -198, -61, 103, 366, 915, + 811, -280, -401, -3849, -111, 221, 353, 232, + 4, -18, 673, 1792, -2350, 132, 1979, -2318, + -417, -689, 326, 768, -377, -522, 373, -389, + -105, -103, 33, -48, 1497, 1125, 1893, -2744, + -1219, 921, 472, -165, -438, -129, -682, -783, + -685, 167, -715, 156, 64, 61, 1147, -892, + -72, 579, 1191, -2759, 1831, 1895, 663, 816, + -98, -61, -223, -366, -429, 31, -129, -121, + -255, 1804, 138, 180, -1063, 598, 763, 720, + 385, -526, 143, 80, 168, 976, -714, 236, + -3204, 93, 874, 238, -359, 1595, 191, 568, + -182, 20, -608, -288, 602, -224, 3874, -308, + -70, -826, -109, -42, -882, -1421, -1603, 625, + -1206, 31, 782, -106, -700, -246, -571, -124, + -848, -390, -523, -2903, -9, 39, -109, -199, + 497, -11, 377, 5, 25, -115, -61, 283, + 27, -131, -193, 280, 178, -5439, 44, -52, + -1210, -617, -162, -1097, -3, 748, -45, -1197, + -1058, 909, 1607, 693, 42, -749, -3001, 407, + -62, 45, 214, -312, -1054, 498, 1291, 1189, + -1268, 1083, -757, -319, -2796, -716, 310, 1583, + -608, 319, -84, -119, -1415, -602, 628, 463, + -1213, -794, -474, 2682, 931, 240, 2491, 76, + -234, -161, -690, 359, 28, -19, -774, -1023, + 738, 675, 248, 52, -348, -545, -2715, -599, + -252, 660, -387, -104, 2316, 456, -90, 100, +}; + +static const int16_t cb4440sm0[] = { + -6448, -59, 298, -659, -59, 329, -569, 397, + -224, 128, -216, 153, -100, 319, -53, -90, + 50, 3313, 4, -215, 405, -256, 78, 2890, + -187, -969, 195, -1022, -119, 214, 254, -360, + -222, 39, 2139, 91, -290, 529, -73, -16, + -318, 128, -348, 565, -1190, 202, -185, -234, + 3498, 48, 68, -1917, 1694, 212, -477, 239, + -3301, -489, 424, 418, -82, -61, 599, 1530, + -200, -252, 162, -243, 43, -534, -2695, 255, + 317, 489, 279, 3337, 246, -349, -149, -128, + -146, 256, -455, 137, -75, 836, 209, -349, + 3494, 255, -1948, -732, 367, 1373, -211, 608, + 345, -17, 43, 102, 19, -219, 173, -2361, + 130, -862, 637, -103, -589, 219, -1261, -238, + -2528, 1643, -1587, -690, -166, 7, -57, 1221, + 326, 103, -830, 608, 196, -3705, 1103, 568, + -1602, 543, -153, -416, 74, 185, 156, 34, + 1329, -798, -214, -515, 121, -797, 749, 346, + 629, -609, -877, -60, 184, -157, 250, 193, + 4385, 369, -181, -191, -308, -314, -395, -173, + -88, -388, -43, 46, 9, -167, 189, -192, + 6086, -226, -1795, 126, -941, -423, 397, 380, + 461, 319, 364, -194, 433, 1214, -3715, -274, + 9, -327, 212, -375, 130, -917, -63, 1120, + -651, -211, 149, -1128, 265, -73, -4630, 493, + -83, -20, -314, -91, 910, -109, -3, -417, + -109, 374, 357, -2773, 253, -234, -306, -3060, + -762, 53, 476, -299, -89, -2440, -658, -83, + -854, 3770, 374, 552, 450, 51, 346, 887, + -463, 189, 254, 182, 15, -37, -3263, 2594, + -647, -83, 404, 770, 691, -654, -301, 81, + -13, 742, 371, 54, 31, -83, -59, 4196, + 653, 256, -1075, -539, 1084, -1077, 1238, 259, + 20, -191, 854, 179, -47, -1025, -189, 281, + 2556, 1765, 106, -79, 320, -3066, 228, -500, + 1, -183, -46, 220, -233, -50, -98, -261, + -84, -25, -4378, -428, -1395, -582, -619, 443, + -1456, 375, 144, -32, 356, -454, 28, 136, + 5, 247, -1057, 709, -362, 293, 3084, 545, + -2804, -625, 16, -228, -238, 164, -201, -114, + -149, 58, -74, 203, 271, 462, 1037, 159, + -1652, -591, -846, -166, -3272, 710, 773, 824, + -1138, 630, -14, 209, 348, 1476, 322, -371, + 241, 4133, -877, -476, -391, 602, 1259, -1204, + 352, 90, -473, 43, -152, -439, -131, -217, + -1559, -5029, -186, -239, -44, 750, 33, -167, + -211, -67, -91, -143, 124, 32, -16, 8192, + 68, -102, 163, -31, 458, 38, 249, 21, + 157, -63, 36, 49, -22, 89, 9, 153, + 46, 60, -146, -13, -7506, -104, 101, -141, + 25, 165, -84, 219, 53, -182, -94, 46, + -1314, -371, -298, -527, 6, -1955, 52, -714, + -461, 174, 1450, -298, 107, 2965, 250, -65, + 46, -171, 296, -785, -784, 35, 36, 29, + 915, -891, -391, 168, 509, 3763, -1267, -138, + 132, 424, -53, -669, -1491, -927, 712, -638, + -440, -299, 522, 1593, 445, 3234, 547, 498, + 440, 145, -135, -188, -296, 1080, 468, 77, + 176, -315, 221, 4784, -666, 274, 762, -42, + 218, -86, -273, 116, 814, -21, 402, -266, + -392, -425, 1126, -68, 142, 357, 5143, 363, + -224, -198, 115, -221, -262, -736, -2774, -196, + -208, -613, 163, 696, 789, 132, 114, 121, + -3138, 164, 172, -189, 232, 53, 310, -50, + -407, 1207, -474, 249, -806, 21, 20, 72, + -534, 101, -47, -223, -4568, -128, -29, -910, + -254, 105, 3163, -119, -135, 1745, 1744, 1105, + 291, -333, -278, -441, 660, 141, -291, 314, + 149, 142, -121, -7878, -240, -204, 189, 376, + 3, -129, 59, 46, 170, 82, -150, -34, + 67, -110, 635, 148, 256, -2939, 157, -509, + 1439, -2470, 794, -298, 407, 980, 805, 349, + 208, -35, 1009, 1180, -114, 776, -339, -776, + 250, 1951, -557, 172, -395, 795, -3075, -348, + -106, 122, -47, -9, 55, 40, 3002, 421, + 538, -1, -277, -3062, -15, 168, 461, 521, + -525, 413, -196, 159, -3314, -85, 983, 565, + -3113, 38, 79, -172, 20, -228, -520, 346, + 47, 485, -177, 51, 175, 444, 3475, -3416, + -81, 118, 264, -162, 20, -192, -219, -111, + -57, -225, 159, -218, 117, -28, -150, -1100, + -681, 444, -54, -11, -4669, -216, -1151, 858, + 168, -39, 52, 387, 74, -39, -154, 2767, + 307, -132, 531, 175, 906, 14, -129, 49, + -3389, 476, -127, -329, 479, 118, -85, 209, + 4, 227, 154, -2, -238, 263, -24, 553, + -231, 78, 2, -183, 31, 5933, 117, 86, + 386, 359, 153, 101, -784, -553, -13, 256, + -347, -1311, -936, -64, 1718, -444, 168, -590, + -3252, -194, -243, -269, 2096, -994, -1081, 309, + 1003, 290, -66, 306, -3239, -25, 700, 365, + -770, 144, 4, 259, -185, 1493, -158, 726, + -3180, -1683, -119, 45, -493, -205, -1728, -1226, + -235, -87, -88, -87, 1966, 8, 142, 496, + 239, 828, 30, -517, 3150, 2266, 402, -315, + 74, -312, -414, -16, 458, 381, 376, 1287, + 1093, -410, -967, 80, 382, -106, 4419, 445, + 293, -283, 282, 324, -80, -25, 115, -1667, + -756, 1893, -2772, 395, 3, -349, 138, 1094, + 406, 432, 214, -1328, 632, -132, -100, 135, + 1627, 1062, 1026, -1341, 24, -3352, -173, 1265, + 861, -821, -87, -367, 278, 151, -101, -32, + 161, 387, 5778, -564, 492, 83, 324, 29, + -423, 91, -132, 190, -310, -457, -62, -99, + 171, -214, -159, -2500, -693, -1538, -311, -784, + -2422, -498, 1781, 342, -467, -78, 466, -252, + 241, 197, 186, -1039, -190, 346, -1881, -240, + -65, 1438, 1001, -3009, -52, 221, -490, 1224, + -63, -39, 53, 169, 130, 86, -56, -90, + 116, 4, 7098, -5, 61, -172, -65, 160, + -94, -30, -111, 270, -653, 521, -426, 1084, + -1169, -1158, 584, -2499, 2494, -321, 695, 823, + -429, 35, 529, -280, -45, -286, 2997, 207, + -633, -2207, 1708, -298, -413, 673, -1017, 292, + 493, 76, -136, -365, -65, 266, 852, 512, + 791, -129, 1364, -1065, 1371, 383, -524, 505, + 943, 147, 229, 39, -2969, 70, -295, 66, + 2759, -16, -435, -474, -1058, 762, 54, -257, + 560, -3167, -572, -418, -478, 370, 72, -20, + 296, 54, -2683, 550, -15, -155, 2146, -143, + -1144, 463, -117, -1690, -1917, 42, 249, -278, + -319, -513, 544, -2033, -317, -1955, -2646, 1345, + 759, 268, 207, 1243, 256, -32, -45, -750, + -211, -184, 2397, 473, 2572, -489, 260, 389, + -237, 602, -463, 569, 1673, -176, -227, 964, + 203, 130, -269, -190, 1339, -978, 973, 1986, + 1145, 1258, 272, 1779, -436, -1306, 652, 807, + 574, 1401, 53, -183, 1612, -828, -3094, -82, + 1061, 1042, -200, -891, -126, 181, -1324, 549, + 555, -4, -868, 79, 157, -1533, 18, 230, + -1096, -335, -669, -166, 1853, -310, -340, 249, + -954, -594, -2929, 415, 5, 135, -1315, -237, + 1868, 787, 1912, -1100, 1139, -1103, -217, -382, + -654, 2078, 528, 133, -115, -56, -41, -207, + 69, 461, 465, -396, 1725, 1306, -443, -720, + -1600, 1176, 652, -997, -306, -1040, 2258, -75, +}; + +static const int16_t cb4440sm1[] = { + 8192, 96, 214, -395, -106, 291, -401, 305, + -102, 194, -73, 31, 71, -19, -349, 65, + -183, 26, -21, 8154, 107, -136, -37, -35, + 85, 127, -202, 43, -195, 225, -51, -69, + -57, -107, 141, -120, -284, -227, 28, 680, + 218, 29, -1800, 488, -207, -453, -99, -3680, + -210, 39, 279, 1406, 278, -37, -1596, 232, + 376, 90, 234, -3348, 242, 1765, 555, -883, + 118, 115, 48, -116, 2166, -292, 136, 527, + -236, -18, 411, -20, -190, -480, 665, 3332, + 378, -287, 337, 199, -5, -3904, 311, -297, + -2720, -193, -17, 911, -224, 457, -48, 254, + 271, -24, -77, 165, 23, 182, -1122, 122, + -520, 309, -3604, -1013, -405, -647, -145, -1162, + 1019, -190, -278, 69, 362, -185, -78, -245, + 472, 670, -493, 620, 76, 717, -2296, -111, + -454, 3224, 27, 47, -351, -154, -293, 187, + -93, 96, 87, -453, -132, 9, 125, -209, + -26, 284, -552, 255, 87, 227, -5445, 112, + 172, -15, -448, 475, -5747, 367, 149, -228, + -797, 371, 67, -102, -118, -418, 332, 38, + -100, 90, -183, -3302, 15, -1049, -1560, 1299, + -710, 1257, 698, 316, -283, 955, 240, 182, + 269, 12, -37, 1817, 649, -1273, -2071, -1719, + -765, 977, -1159, 351, -1583, -85, -771, -215, + 123, 314, -158, 32, 560, 208, 265, -451, + -413, 32, 1954, -3598, -1680, -832, -646, 761, + 272, 394, 213, -35, -44, 343, 309, 244, + 3041, -399, -50, -126, -2755, -146, 243, -367, + -600, -166, -832, -537, 269, -48, 2419, -526, + -309, -17, -235, 73, 341, 351, -840, 3241, + -94, -432, 404, -588, 158, -127, -49, 3259, + 3543, 134, -256, -106, 622, -45, -170, -109, + 68, 377, -84, 210, -250, -267, 257, -77, + 6, -1109, -1498, -327, 1063, 992, 632, -245, + -656, -1100, -60, -456, -170, 3208, -6, 13, + -95, 606, -594, -2039, -369, -1743, 275, -93, + 117, 2828, -138, -108, 206, 1819, 98, -45, + 45, -163, 2962, -398, 3536, -183, -259, -581, + 65, -498, -288, -357, -339, -13, -71, -409, + 36, -15, -545, 1433, 135, -220, 99, 752, + 177, -455, -251, 1172, -1274, 1062, -774, -999, + -63, -2756, 99, -86, 4695, -171, -129, -856, + 26, -543, 610, -1350, -2, 271, 455, -150, + 358, 101, 536, 125, 101, 88, -16, -12, + 488, -7479, 110, 264, 140, -302, 110, 232, + 0, 15, 70, -28, -27, -110, -99, 201, + 78, 215, -108, -267, -7548, 34, 312, -86, + 197, 125, 80, -75, -117, -2, 128, -207, + -131, -513, 614, 33, -4844, -302, -323, 160, + 808, 645, 243, -603, 68, -70, 158, -131, + -212, -34, -247, 625, 134, -42, 525, -89, + 31, 116, -1, 508, 5021, 395, 111, -86, + -172, 1433, -114, -126, -148, -337, -260, 233, + -479, 275, -247, -5672, 386, -110, -99, -142, + -171, -154, -358, 30, 1028, -78, 575, 523, + -586, -739, 1586, 1076, -2519, 1572, -1448, -201, + 166, -54, 137, 1268, 1157, -411, -2905, 195, + 489, -740, 154, 522, 2276, -604, 194, -1112, + 192, 400, -271, 250, 413, 273, 158, -299, + -874, -228, -2454, 162, 819, 457, 3401, 689, + -208, -298, -461, -360, -70, -2133, -114, -124, + 81, -228, 625, 3525, 909, 254, -234, 1316, + -773, 531, -30, -16, -164, -84, 2360, -1900, + 351, -2979, 545, 653, 416, 273, -79, -825, + -107, 71, 495, 223, -176, 129, 40, 424, + 1627, 207, 47, -8, -273, -715, 60, -1253, + 1501, -1199, -248, 39, 2859, -432, 89, 299, + 948, -2608, -896, 3468, 84, 511, 55, 151, + 733, 270, -354, 470, -219, -115, -105, 91, + -259, 1941, 775, 12, 2764, 484, 557, 2288, + -118, 294, -32, 719, -62, -64, -295, -82, + -145, -285, -492, 87, -135, -98, 194, -288, + -8, 263, -475, -53, -388, 5621, 41, -28, + 34, -323, 138, 1935, -1806, -185, 340, 1380, + 48, -542, -2965, -339, 88, 554, 41, 4, + -151, 182, -39, -193, -3355, -312, 3106, -203, + 442, -110, 317, -269, 225, 31, -62, -277, + 163, -766, -408, 210, -58, 128, 161, 3308, + 3321, -138, -278, -149, 216, 134, -253, -135, + -154, -123, 254, 200, -2, 133, -307, -6253, + 310, -6, 959, 26, 191, 315, 528, -75, + -230, -203, 153, -265, -94, -61, -2, 2761, + -4623, -353, -19, 102, -139, 54, 438, 267, + -73, 447, 226, 71, -19, 75, -40, -32, + -850, -500, 422, 1237, -688, 357, -3158, -468, + -450, -279, -694, -1109, 734, -1602, -117, 122, + 261, 979, -20, 385, -2929, 342, -3164, -146, + 252, -104, 62, 469, 289, 249, -214, -38, + 73, 83, -7, 18, -394, -5, -140, -267, + 331, -147, 6540, 395, -103, -147, -271, -20, + 191, 73, -155, 197, 71, 503, 19, 138, + -129, 335, 209, 75, -6207, 140, -176, -5, + 35, -40, -61, -146, 1080, 58, 327, -49, + -842, 1431, 595, 3461, 1, 142, 2001, 297, + -16, -425, 1156, -101, -54, 1060, -222, -295, + 938, -1212, -2374, 73, -272, -3318, -8, -718, + 114, -154, 85, -9, 72, 86, -1330, 226, + -1414, -521, 3161, -1856, 133, 240, -499, -371, + -745, 779, -463, -506, 463, -229, -226, 389, + 135, -4137, 360, 735, -318, 777, 593, 977, + -174, 286, 187, -95, -1626, 245, 97, 9, + 277, 299, 1568, 1066, 375, 1342, -390, 884, + 271, 185, -258, -1100, 2113, -107, -447, -1917, + -58, -29, 1081, -455, -524, -196, 1869, -677, + -3564, 1443, 29, -425, -28, -370, -342, -28, + 30, -118, 58, 607, 454, 45, -120, 232, + 20, 21, -175, -112, -236, 492, 411, 42, + -42, 4041, 39, -2579, 235, -146, 122, 24, + 1301, 123, -461, -3264, 316, -88, -209, 140, + 387, -430, 78, 508, 149, -3588, 1107, 820, + -140, 654, 812, -566, -2578, -403, -72, 120, + 355, -136, -121, 209, 240, 116, 231, 1630, + 208, -178, -3160, 2203, -52, 451, 84, -310, + -1199, 596, 69, 285, 242, 15, 49, 341, + -154, -2286, 1206, -109, 1048, -647, 1127, 98, + -1264, -808, 1744, -1597, 13, 26, -216, 263, + 3276, 3192, -105, -390, -31, 676, 73, 265, + 31, 101, 479, -69, 123, -24, -49, 32, + -653, 2253, 49, -346, 1476, 1820, 396, 639, + -219, 792, 1728, 147, -765, -140, 1181, 98, + 153, -98, -755, 2473, 452, 231, 2031, 2468, + -416, 587, 724, 148, 500, -933, -229, 55, + 102, 74, -164, 652, -425, 100, -2684, 1358, + 1626, -350, 544, -301, -1589, -305, -1266, 11, + 243, -125, -330, 294, 1471, -2922, 1581, -546, + 582, 231, -1407, -877, 602, 219, 350, 1130, + -86, 214, -56, 201, -181, -2140, 1108, 493, + 456, -542, -113, -852, 1647, 1897, 840, -1178, + -369, 788, 488, 256, 366, 2298, 1167, -205, + 256, 585, -555, 292, 2615, 748, -247, -1102, + -1682, 226, 415, 20, 27, 100, 9, 436, + -1746, 2621, 1583, -211, -833, 441, 54, -1183, + -826, -916, -707, 564, -232, -14, 147, 453, + 70, 1094, -903, -337, 450, -1546, -662, -1047, + -2345, -811, -1037, 96, 560, 1381, -119, -383, +}; + +static const int16_t cb4448sl0[] = { + -3850, -1289, -449, -36, -1178, -1175, 705, -97, + 37, -650, 426, -477, -145, 124, 6, 207, + -96, -3145, 2917, -260, 349, 668, -72, 6, + 157, -62, -128, 20, -82, -1357, -707, -619, + -313, -229, 3010, -169, -27, 738, 971, -1450, + 246, 154, -163, -15, -93, 5, -35, -42, + 24, 31, -25, 6803, 33, -32, -68, -68, + -44, 317, 43, -106, 608, -999, -699, 582, + 46, 1631, 830, -1570, -2645, 992, 2126, 132, + 2377, 1551, 247, -247, 1508, -34, 162, -275, + -81, -654, -625, 125, -33, -210, 309, 900, + 571, 726, 2691, 2821, -698, 60, 46, -483, + 14, -210, -295, 102, 214, 226, 2622, -82, + -390, 1436, 107, 554, 381, 1307, 2283, -190, + 27, -35, 5557, 283, 103, 180, 104, -89, + -186, -319, -225, -141, 92, 1, -1942, 1025, + 906, 32, -3, -1089, 182, -799, 483, -368, + -1734, -103, 1680, 474, -133, -1067, -545, -219, + -118, -635, -2559, 1002, 2554, -640, -505, 179, + -344, -81, 107, -61, 79, -12, -29, -37, + -7574, -92, 64, 92, -164, -20, -61, -35, + -312, -159, 333, -3401, -2596, -344, 88, 604, + 535, -87, 365, -13, -77, 131, 127, 588, + 302, -94, -506, 2427, 99, 304, 2653, -1104, + 1380, 976, -530, -120, -105, 293, 9, -826, + 388, -66, 421, -202, 605, 675, 4060, 978, + 143, -94, 21, -2444, -30, 554, 695, 2878, + 657, -104, -435, -326, 307, 20, 20, 159, + 106, -3473, 326, -1029, -304, 670, -2109, -431, + 573, 704, 293, -45, -169, -119, -191, 599, + -910, 1976, -165, 581, 1209, -1689, 2365, -370, + -601, -696, 374, 202, -114, -61, 3, -63, + 30, 369, -158, -128, 198, 52, -98, -44, + -323, -5118, -1100, -669, 2256, 32, -66, 206, + 65, 2801, 783, -470, -973, 471, -211, -27, + 1879, 302, -388, -249, 301, 537, 2761, 321, + 571, 20, 337, 1336, 522, 231, 368, -363, + -2065, -57, -2565, -584, -611, 56, 814, -382, + 1671, 408, 492, 12, 1201, 1513, 247, 2165, + -592, -1246, -493, -1012, -1330, 1251, 75, -100, + 182, 52, -47, 710, -1137, 2420, -559, 266, + -801, 2523, 1229, 736, -409, -49, 269, -174, + -179, -24, 348, -661, 251, -1039, 2647, 283, + 728, -1850, -2088, 196, 39, -72, -35, -94, + -540, 266, 340, -450, 763, -5, 113, 2618, + -2737, 1047, -246, -522, -182, 376, 1068, 203, + 1238, -938, 211, -308, -395, -629, 596, -2634, + 1452, -1155, 83, -89, -3121, 419, 40, 2691, + -306, -343, 4, -347, -725, -117, -315, 115, + -215, 26, 429, 1074, -1831, -1850, 2609, 72, + 467, 191, 432, 857, -186, 0, -443, -24, + 500, 541, 30, 2324, -1160, -1153, 1783, 1282, + -1992, 101, -108, -108, 556, -2012, 506, 691, + -65, -610, 402, 610, 1941, -121, 942, 589, + 1879, 58, 312, -2218, -2056, -2284, -350, -453, + 306, 38, -579, -185, -101, -196, -150, 156, + 126, -44, -143, -7923, 126, -120, -138, -233, + 97, -20, -121, -175, -8, -13, -123, -365, + 251, 730, 2883, 667, -418, -208, 2170, -1442, + 196, -389, -516, 252, -98, 525, -1819, -647, + 1575, 768, 1124, -428, -1010, -2027, 411, -473, + 863, 210, 908, 40, 145, 37, 192, 189, + 52, -217, -168, 63, -7, -53, -121, 13, + -145, 0, -37, 61, -7979, -142, 32, 118, + 190, -7, -13, 113, 36, 31, 1461, -2088, + 2391, -939, -66, 822, 280, 246, -157, -183, + -433, -356, 88, -101, 3969, -3388, -84, 84, + 130, 35, 74, 37, 181, -195, 219, -29, + -23, -32, 69, 625, 2328, -192, -2617, 287, + 543, -1604, 823, -547, -277, 764, 276, 156, + 198, 17, 84, 346, -27, -129, 143, 217, + 212, -249, 20, 6449, 7, 51, -889, -88, + 265, 282, -1956, 1327, -1025, 1338, -1709, -1008, + 372, 57, 1404, 234, 2621, -18, 663, 301, + 0, 167, -372, -2534, 1945, -191, 198, 359, + -43, 92, 24, -5498, -63, 189, 36, -369, + 352, 381, -205, -144, -119, -267, -60, -10, + 387, 2388, -155, -450, 465, 1529, -216, 2673, + -146, 118, 50, 290, 147, 11, -2912, 863, + 2184, -689, -44, 59, -663, 663, 675, 295, + 1331, -115, -10, -54, -1, 31, 1699, 127, + 215, 2966, 163, 416, -1053, 1216, 356, 1428, + -166, -172, -2, -355, -169, -331, -94, -78, + -123, 4875, 311, 67, 1145, 397, -288, 212, + -344, -290, 126, 16, 176, 485, 551, -526, + 11, 120, -274, 83, -5399, -154, -1611, 887, + 321, -446, 1166, -333, 652, 310, -895, 62, + -219, 2840, -753, -34, -3203, -3600, 464, -249, + 336, 297, -85, 316, 144, 306, -249, 149, + 112, 73, 192, -89, 18, 197, 116, 51, + 37, 212, -7248, 163, 31, -52, -31, -101, + -1366, -353, -325, -1335, -440, 1193, 670, -2635, + 872, 1400, 733, 395, 122, 130, -4146, 0, + -382, 1486, 308, 1179, -412, 288, 701, 161, + 147, 959, 60, 77, -123, 17, 193, 204, + -226, 388, 272, -588, -157, 2823, 735, -745, + 2368, 359, -1088, -2004, -1293, 2018, 483, 320, + -1014, -806, -479, -68, -51, 168, 873, 27, + -7906, 57, 19, -23, 27, 43, -13, -50, + 93, 16, 29, 31, -26, 32, -22, 453, + 2922, -2560, 138, 923, -1245, -405, 10, 228, + -270, 145, -192, 83, 48, 101, 77, -226, + 36, 7792, 126, -275, -37, -36, 9, 45, + -89, 13, 148, 125, 24, -442, 111, -12, + 540, 1794, 3008, 1620, -185, -1394, -161, -25, + -313, -317, 591, 2507, 134, -369, 77, 527, + -619, -236, 2681, 87, -1060, -34, 1894, -1123, + 373, -628, 1934, -1279, -1689, -609, -472, -598, + 405, 229, 414, 12, -2923, -33, -435, -49, + 2380, -34, -344, -2171, -284, 274, 226, -287, + -84, -57, -1, -169, -50, 479, 707, -2774, + -532, -640, -244, 44, 458, 2519, -590, -472, +}; + +static const int16_t cb4448sl1[] = { + -2878, -714, 3098, -76, -51, 232, 118, -780, + -691, -267, -309, 105, -179, -5, -84, -11, + -120, -379, 458, -3161, 65, 2994, 64, 374, + -440, 62, -183, 28, -561, 73, 59, -2565, + 445, -451, -1026, 437, 10, -173, 1243, -2278, + -481, -395, -154, -2402, 945, -2789, 117, -1184, + 75, -704, 527, 478, -589, 17, 131, -110, + 574, -1055, -628, -277, 2798, 1483, -657, -1996, + -248, 194, -284, 822, 225, -170, -10, -302, + -427, -1700, -90, 2756, 2124, -49, -964, 372, + -637, 443, 13, -69, -71, 196, -1971, 110, + 1147, 698, 1333, 1369, 527, 165, 903, 577, + -2134, 56, -33, 34, 183, 247, -342, 974, + 1079, 2478, -26, 80, -2377, 430, -1422, 428, + -2187, -469, -1280, -326, -40, 188, 911, 405, + 2772, 279, -493, 265, 768, 45, 5778, 44, + 121, -257, -135, 124, 263, 15, 197, -114, + 5, -14, -8, -82, 3989, -511, 197, 2446, + -292, -205, -919, 162, -121, 145, -40, 71, + -105, 72, 2035, 960, -145, -467, -518, 167, + -2988, 421, 860, 320, 40, -446, 319, 160, + 140, 511, -55, 213, -148, -527, -666, 687, + 9, 23, 344, -156, -4646, -125, -220, 9, + 134, -25, 16, -1319, 763, 58, -1586, -438, + 301, -411, -337, -3398, 358, -68, -111, 5483, + -36, -456, -94, -116, 204, 95, 84, -73, + -163, 69, -190, 64, -3716, -326, 1815, -843, + 312, -498, 684, -641, -766, -104, 606, 70, + 2630, 51, -170, -3584, 167, 461, -162, 132, + 496, 91, 171, 255, 48, 2, -120, -1196, + 534, -431, 2669, -403, 8, 287, -391, 2557, + 849, 167, -275, -184, 605, -3570, 113, 22, + -2586, 668, 294, -910, 67, -141, 0, 418, + 271, 75, 90, -124, 446, -142, -635, 631, + -956, 1566, 25, -1982, 790, 2770, 33, -520, + 23, -7488, 67, -73, 60, 64, -46, -36, + 76, 3, 22, 149, 61, 34, 255, -380, + -284, -2531, -1423, 1507, -926, -1074, -929, -1430, + -141, 165, -80, -268, 21, -767, 1542, 3197, + -191, 2014, -304, 595, 536, -906, -126, -354, + -76, -162, -125, -3139, 3197, 934, 366, -923, + -330, 277, -284, -163, -12, 402, 15, -146, + 20, 83, 111, 196, 23, 71, 77, 7287, + -175, -13, -227, -59, -56, -28, 1, 163, + -50, 59, 635, 150, 95, 2750, 775, -2057, + 423, -1078, 1749, -3, -655, -365, -357, 145, + -76, 5, -93, 224, 150, 108, -34, 173, + 148, -371, 34, 48, -8037, 65, 50, 103, + -42, -10, -96, -90, -3, 60, 92, -79, + -76, 386, 114, -1947, 833, -1279, -484, 217, + 3156, 226, 485, 1191, 425, 88, -59, -243, + 2292, 1681, 671, 62, 899, -2453, -100, 1039, + 713, -104, 554, 219, 356, 963, 741, -102, + 455, 2067, -324, 172, 28, 772, 752, -2351, + -1438, -865, -1668, 105, 1034, 1195, 14, -350, + -425, -648, 2086, -532, 634, 1537, -33, -598, + 2888, -85, 184, 158, -164, 3339, 237, -284, + -54, -246, 46, -254, 365, 55, 1928, -346, + -357, 331, 139, 16, 674, -384, -67, -3399, + 165, 76, 215, 137, -3187, -146, -264, -165, + -3039, 235, -541, -630, -32, -33, -211, 160, + -121, -111, -1296, -47, -128, 292, -1523, 1540, + 771, -166, -509, 212, 2758, -327, -418, -305, + -9, 465, 2513, 195, -70, -209, -66, 127, + -147, -3161, -192, -541, -555, 131, -858, -1609, + 973, -156, -1877, 60, 1011, 66, -348, 912, + -1731, -1296, 305, -369, -560, 470, 46, -863, + -124, -37, 40, -395, -4886, -20, 221, 228, + 177, 182, 98, -151, -195, 854, -194, -374, + 301, 586, 58, -908, -19, -4198, -171, 330, + 48, -3312, -164, 1913, 1183, -42, 1287, -353, + 757, 620, -547, 251, -520, 59, 43, -179, + -191, -131, -2951, -944, -2479, 344, -813, 104, + -697, -44, -270, 198, 245, 2866, 208, 178, + -248, 38, 19, 577, 2812, -765, -855, -439, + -60, -30, -352, 1521, -1069, 457, 415, 572, + -749, -144, 100, 515, -794, -1554, 2507, -270, + 10, 62, 2507, -1550, -75, 70, 2530, 562, + 132, -141, 251, 156, 835, 102, 717, 3226, + 3327, 172, 84, -205, -11, 208, -310, 164, + -27, 11, 281, 37, -518, 20, -76, 82, + 5436, -543, -301, 112, 359, -140, -94, 78, + -18, 38, -196, -92, 13, -111, -23, 30, + -15, -94, 101, 142, -6455, 321, 322, 50, + -216, -321, -10, -465, 101, 45, -585, -969, + 1248, -456, -2523, -852, -2129, -889, 33, -1424, + 1462, 583, 749, 527, -1737, 1262, -594, 414, + -215, -1184, 412, 1758, -1836, 1248, 440, -178, + 784, 3591, -227, 43, -493, -766, -270, 150, + 151, -56, -110, -2832, -73, -166, 470, -179, + -681, 71, -114, -2743, -806, -560, 63, -244, + -90, 182, -143, 995, 404, -13, -1343, 1524, + -2472, 1718, -957, 1229, 458, -395, -2817, -579, + -99, 340, 1538, 684, -492, 1156, -45, -65, + -305, -1408, -325, -270, -358, -127, 92, -97, + 415, 85, -4749, 173, -296, -203, 331, 315, + 184, -46, 1315, -146, -55, 427, 37, 255, + -209, 272, 735, 506, 105, 103, 902, -3449, + 116, 2304, 616, -1564, 1508, 478, 320, -2418, + 244, -176, -32, 238, 92, 290, -168, -78, + -3464, 270, -1902, 2, 696, 92, -1610, -206, + -49, 178, 121, 27, 119, 72, -253, -398, + -2720, -81, -162, -550, 2595, 1445, 249, -104, + 218, -310, -95, 18, -473, 1908, 432, -227, + -168, -2725, -240, -1830, 199, 437, -1392, 304, + 1461, -2394, -603, -540, 769, 340, -104, 1569, + -21, 338, -874, 1533, 281, -59, 487, 2120, + 179, -140, -328, -57, 63, -110, -1330, -485, + -2427, 1159, 355, -26, -2055, 154, -563, -132, + 49, -329, -187, -24, -71, -3970, 276, 158, + 92, -202, 7, -422, -578, 186, -407, 4960, + -595, 1027, 417, 691, 69, 133, 123, -147, +}; + +static const int16_t cb4448ss0[] = { + -2680, 2499, -328, 2212, 1288, -57, -727, 76, + -210, -218, 41, -343, -26, -38, 43, 606, + -619, -531, -2082, 87, -1127, 1282, -23, 2272, + -1816, 104, -31, 85, -22, 60, 1293, 138, + 382, 432, 489, -372, -1649, -2809, -2556, -98, + -232, -233, 169, 186, 79, 1157, 2113, -942, + 636, 877, -601, 2277, 1411, 1165, 1029, -613, + -348, -38, -19, 45, 1318, -1980, 12, 2762, + 1519, 184, 1980, -49, -270, 361, -172, -601, + -196, 186, -67, -124, 1503, -1011, 263, 223, + -384, 153, -21, -1063, -239, 1171, -3501, 512, + -162, -180, 139, -680, 609, -1919, 2969, -2321, + -183, 194, -558, 26, 91, 340, -25, -31, + 127, 662, 182, 191, -2201, -2603, 2252, -523, + 277, 50, 355, 295, -65, 355, 207, 82, + -489, -143, -218, 89, 666, -359, 2716, -2310, + -1912, 417, 400, 43, 110, -93, -142, 61, + -3000, 454, -153, 0, -413, 469, 339, 318, + -197, 75, -80, 2894, -129, 82, 1431, 1183, + 429, -1556, -1339, -1573, -92, -911, -230, -12, + -4, -145, -388, -419, -5, -241, 7120, 165, + -125, -122, 126, -150, 109, -146, -61, -49, + 47, 70, -43, 40, 1867, 1473, -1278, 1229, + -2256, -90, 10, -744, 1196, -109, 402, 258, + 690, -74, 26, 1294, -1079, 142, -2384, -324, + -1696, -2741, 321, 66, 83, -127, -131, 156, + 166, 135, 1812, -3445, 10, 535, -547, 481, + -2243, 287, -335, 218, 195, -1, -25, -94, + 195, 1433, -1428, -1444, 520, 219, 3363, -388, + -807, -454, -29, 316, 125, 159, -144, -156, + -317, 752, 256, 216, 340, 488, 147, -5662, + 55, -110, 387, -102, -211, -66, -26, 3688, + -172, -2366, -244, -5, 353, 11, 503, 88, + 227, 69, -240, -187, -58, -389, -1783, -1427, + 20, -618, 544, -1337, 628, -3180, 708, -538, + -423, 115, 49, -161, 184, -682, -223, 689, + 1299, -891, -1073, -1228, -305, 47, -2221, -1559, + 598, -380, 166, 143, -366, 287, 2122, 509, + 629, 235, 1523, 2900, -640, -425, -462, -231, + -53, -27, -263, 2090, -1892, -1147, -42, 866, + -2301, 461, -1082, -625, -85, 148, 229, -25, + 85, 53, 259, -81, -4072, 2577, -12, -7, + 335, -151, -691, -137, 98, 372, -37, -192, + -17, 3318, -558, 2064, 396, 258, -1067, 229, + 1122, 298, -25, 40, 27, -134, -166, -247, + -2010, -440, 1066, -1400, -3454, -289, 428, 629, + -158, 126, 129, 183, -12, -171, -120, 421, + -445, 66, -900, 3680, 1583, 1985, 25, 229, + -535, -1, 45, 207, -54, -30, 1581, -938, + -703, 405, 878, -398, -1069, 1748, -2587, -1419, + -375, -441, -487, 109, 21, -1399, 648, -271, + -701, 635, 115, -138, -458, -600, -1891, 585, + 420, -1916, 1135, 7, 1584, 910, 4267, 1328, + 279, 395, -35, -99, -168, 503, 216, -126, + 211, 212, 193, -2205, 491, 696, 41, 283, + 649, -3425, -999, 200, 625, -261, -378, -47, + -15, -30, -1262, 1700, -2191, 196, -1773, -251, + 84, 498, -261, 150, 451, 41, 336, 27, + -56, 562, -86, -1, -1073, 1461, 2148, -2961, + -326, -257, 440, -42, -48, -320, 122, 94, + -1267, -830, 2810, -94, -201, 990, 2415, -740, + -166, -267, -157, 68, 301, 290, 65, 931, + 1969, -170, 6, 149, -272, -105, 542, -11, + -3888, 105, 305, 333, -14, -39, 1944, -1164, + 88, 3829, -1190, -535, -644, -330, 509, -93, + -314, -228, -294, -342, -26, 1143, -2371, -400, + 74, 101, -68, -583, -1091, 3367, 1146, -638, + -436, 136, 41, -92, 1518, 2818, -2214, -2044, + 636, -2, 79, -508, 676, -439, -358, -198, + -69, 271, 59, 1638, 468, 97, 264, -8, + -5152, -152, 152, 252, 401, -375, -17, -132, + 51, 63, 633, -180, 367, 111, -18, 15, + -52, 128, -54, 11, 96, -122, -26, -7257, + -42, -1221, -688, 197, -107, -217, 141, -289, + 141, 269, 439, -747, -3743, 2098, 226, 137, + 26, -1645, -1735, -80, 43, -216, 245, 544, + 157, 40, 238, 237, -989, 379, 88, 639, + -1335, 1542, 1147, -510, 1008, -134, -626, 696, + -3034, 334, -689, 115, -168, 39, 1750, -649, + -233, -99, -231, 515, 112, -11, -162, -133, + -138, -486, -4137, 204, -102, 867, -1030, 219, + -254, -2787, -128, 961, -2837, -482, -195, 691, + -170, -178, 164, -54, -2008, -116, 74, 398, + -96, -472, 407, 27, 287, 628, 97, -1425, + -3923, 6, 117, -1081, 930, 396, 452, 87, + -441, -155, -738, 1089, 2128, -3133, -21, -622, + -48, -127, 506, 985, -200, 3361, 184, -522, + 41, 503, 209, 14, -96, 791, 1263, 289, + -101, -1728, -1073, -517, 4156, -685, 214, -721, + -608, -102, -295, -114, 126, -340, 109, 88, + -1588, 82, -549, -376, 76, 84, -210, 59, + -130, 321, 678, 4704, 564, -1, 100, 325, + -296, 256, -936, -886, -1088, -191, 476, -3684, + 1359, 12, -397, -70, -17, 58, 569, 353, + 821, -77, 253, 153, 5697, -171, 181, 3, + -90, -413, -265, 142, 62, 959, 151, -103, + 845, -340, -280, -733, -592, -244, 2534, 3089, + 935, -393, -105, 145, -666, -2865, -1532, 717, + 2867, 206, -800, -125, -34, -189, -138, 42, + 189, -141, 107, -3030, -3795, -494, 108, -149, + 382, 760, -142, 337, -844, 228, 124, 232, + -23, -1, 2298, 750, 636, -353, 157, 676, + -191, 812, 3434, 759, 543, -17, -213, -95, + 316, -693, -604, -1059, 32, -496, -3334, -272, + -104, -495, -130, 627, -376, 74, -599, 55, + -2185, -968, 517, -343, 21, -249, -963, 268, + 3339, 239, 771, -134, 42, 231, 75, 1633, + 331, -125, -414, 457, -316, 111, -475, 363, + -687, -4105, 469, 443, 113, 72, 1498, 406, + 915, -229, 564, -377, 89, 137, 39, 2, + -29, -416, -149, 3598, -253, 12, -1015, 3016, + 916, -726, -2286, -99, -1085, -238, 690, -44, + -51, -115, 25, 56, -905, -3050, -1121, -24, + -2160, -1424, 1009, -180, -424, 188, -417, -66, + -86, 74, -28, -225, -937, -90, 251, -1850, + 1939, 1843, 833, -1879, -192, -318, 103, -363, + -22, -57, -2833, -118, -277, -98, -85, -495, + -874, 3027, -141, -1490, -172, -266, -32, 190, + -12, -364, -380, -2107, 249, -217, 662, -584, + 89, -563, 1153, -3091, -656, 463, 144, -26, +}; + +static const int16_t cb4448ss1[] = { + 6475, -60, 162, 42, -71, 50, -85, -278, + -14, -60, -53, 132, 28, -65, -71, -62, + 6, 119, 195, -140, 28, 37, -603, -4956, + -290, 700, -241, 11, -301, 297, -1009, 468, + 885, 192, 40, 495, 846, -28, 201, -255, + 927, -644, 2424, 2882, -82, -1764, 1077, 315, + 946, 843, 399, 176, 567, 546, 377, 283, + 2469, -1815, -65, 12, 422, -368, -639, -493, + -5606, 84, 122, 241, 267, -8, -257, -23, + -220, -118, 139, -1582, -218, -2436, 2539, -270, + 146, -262, -489, 1551, 604, -225, 363, 234, + -110, -166, 1058, 2342, 1950, 43, 2362, -1189, + 492, 172, -296, 159, -430, -311, -135, -182, + 77, -444, -1995, -855, 2080, -457, 389, 872, + 2549, 935, -128, 519, -374, 310, 96, 119, + -263, 1981, -1019, -628, 212, -173, -2292, 1066, + -1985, -426, 115, -746, 147, 3, 94, 195, + -1762, 1713, -337, 1884, -123, -480, 95, 777, + 1073, 2117, -969, 16, 11, 123, 374, -394, + -1419, 829, 1657, 1294, -2770, 286, 813, -290, + -115, 111, 312, 53, 44, 896, 34, -2288, + -3443, -2053, 98, 293, 429, -168, 74, -58, + 221, -383, 100, 63, 1925, -1207, 199, 94, + -94, 3060, 1825, 611, 292, -141, 382, 141, + 105, -151, 0, 1448, -267, 206, 932, -682, + 251, -183, 1080, 161, 4334, -397, 525, -91, + 127, -104, 921, -2282, -274, -1070, 387, -312, + 1380, 2769, -554, 1501, -921, 102, -183, -104, + -66, -1656, 2049, 122, -2271, 84, -276, -204, + 353, 380, -414, -1757, -1035, -318, -130, -10, + 163, -471, 2425, 2864, -1892, 294, 817, 754, + 277, -29, -214, -39, -312, -57, -54, 986, + 2286, -574, 34, -641, 3783, 214, -399, -155, + 38, -148, -42, -89, 97, -17, -2192, 729, + 272, 1168, -3593, 150, 96, -473, 211, -60, + 136, -26, 142, -285, 93, 666, -465, -181, + 2016, -338, -2186, -2608, -449, 107, -18, 45, + 24, 245, -119, 244, 442, 1509, 158, 242, + 169, -16, -221, 104, 115, 16, -217, 23, + -25, 130, 4076, 662, -315, 3068, -35, 36, + 2785, -223, -528, -157, 43, 186, -514, -240, + 15, -245, 520, -110, -781, -641, 294, -20, + 64, -44, 400, -109, 4756, 1334, -421, -195, + 130, -2182, 64, -897, -1423, 3081, -523, 378, + -164, 968, 593, -192, 71, 114, -143, -10, + 1961, -3141, 3173, -39, -110, -57, 144, -68, + -429, 30, -10, 467, 159, 40, 67, 260, + 814, -168, -836, 1073, -3562, 1786, -1205, -148, + -105, 94, 5, 143, 138, 18, -1384, 20, + 635, -126, -71, -87, -320, -407, 559, -151, + 1312, -4395, -755, -263, -77, 1657, 699, 426, + 469, -469, 253, -80, 317, -71, 268, 3592, + -2051, 304, 157, 43, 1872, 3794, -1537, 1226, + -159, -335, 340, -385, -253, -195, 21, 106, + -31, -187, -63, -2771, 446, -708, 202, -186, + 548, 832, 1757, -1274, 1234, -756, -160, 76, + -82, 64, 2169, 13, -849, 244, -2486, -2138, + 844, -178, 270, 297, 150, 202, -41, -188, + 121, -1272, 371, -319, 2848, -469, -2059, 1290, + -457, -380, 690, 148, -51, -340, 113, 57, + -1259, -396, -1404, 336, -511, 576, 4441, 124, + 143, -483, 85, 138, 196, 38, -188, 1177, + -764, -2067, 820, -264, 218, -300, -501, -230, + -2529, 1349, -1606, -199, 92, -55, -1324, -702, + 2078, -1269, 414, -50, 29, 12, 87, -593, + 217, -82, 94, -2392, 308, 2315, 2188, 768, + -1103, -77, 579, 1706, -826, -224, -297, 145, + -640, 570, 146, -199, 1187, -872, 327, -310, + -122, -23, -13, 808, -139, -4425, -670, 412, + -4, -70, -162, -1056, 685, -312, -957, 339, + 893, -252, 4040, -105, 76, 993, 281, -79, + -139, 168, -298, 795, -1107, 395, 386, -524, + 1052, -2341, 2537, 474, 726, -1028, -357, -52, + 115, -9, 1349, -2240, 785, 2751, 77, 922, + 385, -539, -148, 410, 251, -70, 199, 51, + 1728, -206, 1181, 1182, 1388, -791, 121, -3, + 8, -147, -95, 101, 886, -2412, 19, 2401, + -116, 718, -592, -221, 724, -33, 690, -180, + 868, -3330, 377, -336, 128, 267, -2075, 2848, + 2994, -300, 3, -153, 41, -456, 38, -31, + 309, -106, -92, -14, 96, 672, 634, 207, + 1556, 438, -2147, 282, 2443, -1662, 511, 457, + -259, -505, 173, -204, -858, -117, 2751, 852, + 220, -512, -2576, 1542, 357, -77, -4, 165, + -63, 189, 302, -699, -764, -1559, 25, -233, + 405, 173, 698, -73, -300, -1442, -2923, -1326, + -25, 98, -196, -2915, -1169, -3392, 691, 353, + -196, 96, 41, 180, 198, 280, 207, -158, + -19, 1556, 991, -523, -280, -1599, 1368, -3247, + -996, 159, -136, -469, -48, 0, 30, 95, + -765, 33, 6580, -180, 316, -176, 105, -21, + -9, 166, 148, -52, -49, 42, 2, 318, + -55, -91, -1461, -1474, -3086, -756, 1479, -29, + -668, -255, -51, 241, 249, -212, 132, -129, + -410, 113, 17, 301, 185, 96, 10, 188, + 38, -772, 5152, -13, -10, 1527, 806, -23, + -79, 1102, -77, 329, -99, -404, 2276, -873, + -2681, -765, 71, 20, -2448, -803, 1827, 1115, + -160, -15, 288, -46, 573, 100, -726, -694, + -406, 288, 61, -2216, -904, 77, -2983, -962, + -1438, 809, -38, -79, 95, 52, -231, 518, + 115, 41, 908, 780, 805, -207, -2161, 554, + 968, 3111, 133, -158, -13, -34, -182, -60, + 105, 718, -1245, 227, -818, 1184, 903, 603, + -988, -2647, 1847, 141, 817, -337, 131, 393, + 1653, 839, -261, 466, 465, -297, 1440, -431, + 2058, -1857, -1416, 310, -722, -54, 203, -266, + 3770, 172, -593, -73, -508, -61, 1110, 1261, + 275, 1681, 447, -147, -95, 33, 1281, -3119, + 24, -308, 366, -468, 232, 358, 667, -942, + 696, -924, -2059, -62, 151, -2102, 332, 258, + -186, -636, 685, 214, -3174, -1243, 573, -276, + 9, -262, -20, 158, -174, -21, 593, -6198, + -266, -270, -63, -203, 63, -396, -100, 191, + 212, 85, 120, -791, 37, -47, 2108, 652, + 519, 346, 106, -1840, -2566, -563, 14, 266, + 10, 214, 504, -1269, 50, 164, 120, -105, + -546, -212, -79, 41, -171, 675, -252, 4373, + -16, -1697, -1491, -3588, -587, 623, 67, 269, + 484, -25, 1067, 580, -598, 195, 47, -17, +}; + +static const int16_t cb4448sm0[] = { + -5114, 166, -785, 635, -528, -102, 269, 492, + -185, -614, 122, -124, 85, 145, 270, -154, + 39, 2524, 58, -57, 119, 5, 343, 2873, + -278, -787, 137, 62, -169, 2049, 1476, -325, + 130, -702, 2882, -19, 310, -258, -135, 88, + -268, 69, 69, 695, -1935, 815, 678, 44, + 3085, 278, -587, -1326, 360, 145, -17, 66, + -2475, -594, 132, 358, 406, -369, -237, 3363, + 329, -424, 52, 49, 291, -236, -2332, -261, + 49, -27, 170, 3656, -214, -603, 264, 60, + -87, 145, 116, 179, 190, 679, 339, -340, + 3272, 641, -2631, 484, 159, 305, 290, 208, + 226, 68, 102, -145, -356, 153, 647, -2046, + 937, -1666, 1093, -29, -1161, 749, -2360, 171, + -2185, 841, -1406, -1057, -1764, -300, -205, 452, + 2168, -214, -153, 291, -106, 79, 1717, -20, + -1771, 286, -466, 686, 167, 137, 5, 43, + 1075, -2601, 261, -86, -333, -724, 162, 186, + 4, -334, -412, -309, 888, -114, 531, 297, + 4284, 297, -1695, -212, 75, -263, -2313, 102, + -434, 352, -1813, -472, 114, -185, 6, 66, + 8061, 414, -577, 672, -152, 152, 1, 38, + -66, 48, -35, 62, -98, -19, -3762, 98, + 242, 114, 359, -162, 115, -3038, 340, 253, + -526, -144, 14, -147, 28, -352, -5858, 46, + -597, -392, 226, -54, -70, -47, -45, 16, + 53, 137, 172, -3017, -22, -163, -267, -3289, + -31, -174, 110, 794, 425, 67, 58, -72, + -156, 3937, -585, 2116, 99, -1115, -257, 801, + 270, -329, -257, -18, 122, -369, -2196, 1746, + -305, 599, 800, 749, 1466, -299, -1519, -255, + -233, 217, -117, -256, 301, -249, -327, 5530, + 86, 135, -784, -137, 610, -7, 55, 93, + -106, -50, 267, -229, -26, -1070, 13, -75, + 1733, 2929, -130, -713, 15, -2144, 104, -318, + 282, -8, -285, -468, -124, 59, 520, -78, + -332, -654, -5048, 212, -388, 97, -1523, 227, + -2545, 2159, -127, 1020, 79, -664, 403, -31, + -356, -1, -436, -86, 75, 610, 3048, 235, + -3133, -1189, -44, -23, -324, 260, 469, -113, + 22, 53, 525, 427, 469, 1016, 420, 493, + -1229, -238, -2671, 361, -2745, 193, -253, -59, + 15, 53, -57, 36, -144, 127, 25, 11, + -34, 6560, -12, -80, -72, 70, 654, -1135, + 158, 279, 298, 746, -190, -1382, 138, 527, + -1504, -2753, -106, -55, 225, 54, 136, 53, + 506, 174, 268, -533, -43, -416, -196, 6266, + -81, 22, -158, 350, 1177, -728, 594, 34, + -368, -226, -584, 247, 804, -1141, 78, 3923, + -53, 309, 58, -45, -7634, -73, 39, -152, + 55, -77, -45, -62, -25, -247, -161, 28, + -2629, -401, -295, -687, 298, -3240, 0, -251, + 7, -49, 494, -198, 202, 2201, -301, 83, + 45, -964, 256, -1499, -2394, 24, -267, -599, + 46, 161, -370, 81, 636, 3146, -2077, -964, + 322, 400, -635, -688, -630, -92, -235, 104, + -77, -541, 511, 2722, 441, 2757, 952, 739, + -257, -254, -438, -122, -151, 12, 578, -92, + -440, -63, 93, 4971, -499, 419, 1374, -165, + -417, 64, -13, -235, 1080, -77, 536, 68, + -842, -772, 1627, -471, -1350, -144, 2849, 219, + 114, 68, -55, 350, -11, -1334, -3042, 1166, + -147, -891, -483, 1461, 339, 808, 362, -101, + -2807, -24, -377, 518, -438, 194, -110, 194, + -826, 3380, -81, -30, -43, 103, -99, 1539, + -614, -13, -1154, 196, -3122, -521, 1454, -319, + 159, -428, 722, -208, 162, 1871, 2534, 2287, + 946, 261, -483, -645, 26, -170, -31, 17, + 164, 104, -44, -8192, -20, 94, -235, 56, + 68, -58, 380, -25, -170, 17, 16, -154, + 63, 477, 1280, 614, -529, -2347, -360, 159, + 1967, -2085, 485, 335, 378, 178, 1633, -437, + -46, 23, 640, 1465, -91, 1279, -1025, -1007, + -236, 2632, -257, 262, 177, 3029, -3149, -1001, + 231, -262, 87, -243, -68, -597, 109, 62, + -264, 37, -463, -3105, -633, 881, 1026, -86, + 417, 705, -1144, -68, -2084, 46, 124, -36, + -2461, -73, -126, -303, 1079, -358, -2764, -761, + -1454, -245, 203, 0, -179, -117, 2571, -4751, + -20, 194, 298, 258, 390, 270, -36, 182, + 152, -56, -97, -47, 138, -233, -111, -1490, + -490, -329, 662, -320, -4697, 443, 66, 352, + 203, -114, -119, 186, 649, -106, -5, 2280, + 1132, -376, 1168, 919, 1858, 271, -1741, -130, + -3388, 264, 618, -2375, 260, 1279, 110, 732, + 128, -373, 54, -182, 99, -131, 9, 30, + -83, 27, 204, 109, -306, 6903, 130, -7, + -115, 92, -241, 119, -640, -871, -40, 372, + -68, -147, -1503, -58, 920, -466, 311, 144, + -3648, -121, -357, 5, 1968, -737, -1491, 596, + 818, 122, 688, -137, -2415, -368, 236, 71, + -597, -193, -395, 795, 855, 657, -49, 844, + -3320, -1921, 846, 17, -293, -17, -1676, -1826, + -138, 897, -207, -3, 1838, -901, 86, 275, + 964, 230, 510, -10, 2879, 3949, 332, 289, + 109, -229, 18, 238, 244, 287, 44, 103, + 367, 21, -1134, -378, 1338, -828, 3500, 5, + 1027, 475, 208, 654, 589, -92, 236, -85, + -115, 1095, -2504, 827, -885, -806, -155, 2112, + -346, 1120, -350, -911, -234, 231, 55, 87, + 1957, 601, 755, -1248, 753, -2726, -481, 2038, + 96, -363, 309, 150, 299, -561, -698, -1030, + 118, 1224, 3240, -1523, 1476, 342, -688, -76, + 192, -8, -319, 350, 149, -331, 155, -436, + 286, -994, 160, -2696, -423, -2798, -135, -108, + -2846, -254, 3590, 350, 130, -810, 463, -123, + 59, -256, 251, -750, -76, -8, -1633, 150, + -931, 1958, 1523, -2527, 239, -287, 172, 332, + -13, 486, 247, -26, 149, 59, 130, 265, + 19, 209, 7220, -23, -99, -69, -66, -70, + -54, -75, 60, -264, -102, 1079, -535, 1587, + -557, -1499, 241, -2596, 1157, -140, 270, 33, +}; + +static const int16_t cb4448sm1[] = { + 7894, -331, 383, -556, 63, -371, -23, 73, + 46, -145, 105, 43, -199, -52, -85, -85, + 13, -21, -230, 7379, 268, -243, -460, 251, + 73, 12, 115, -18, -247, 433, -90, -518, + 962, 0, -960, 184, -305, -2003, 276, 1696, + 2418, 270, -2140, -215, -534, -389, -403, -3500, + 416, 567, -393, -183, 253, -100, -285, -107, + 100, 281, -527, -2944, -86, 2652, 311, -785, + -811, -283, 425, -77, 393, 136, 170, 1290, + -765, 108, 676, -213, -1226, -470, 427, 3499, + 616, -1211, -226, -37, 88, -2792, 351, 78, + -2975, 99, 192, 1390, -338, 47, -8, 58, + -255, 50, 221, -49, -788, -207, -2122, -167, + -692, 379, -3239, -965, -698, -463, -45, 34, + 1785, 1026, -1107, 113, 124, -258, -277, -714, + 2764, -178, -200, 907, -45, -213, -2575, -530, + -112, 3616, -128, 76, -366, -135, -22, -51, + 125, -100, -79, 142, 54, 107, 87, 493, + -34, -221, -448, -243, 994, 845, -4656, -105, + -487, 41, -112, 349, -4328, -72, 513, -112, + -685, -470, -138, -541, 340, -1505, -24, 37, + 169, -405, -434, -2994, -42, -416, -1927, 1551, + -1488, 420, 179, -66, 14, 92, 147, 141, + 497, 404, -412, 2301, 336, -2877, -1845, -948, + -784, 262, -211, 6, -1678, -434, -1433, -727, + 1254, 542, -1430, -302, 1558, 107, 617, -833, + -369, -178, 1682, -2569, -1232, -1556, -87, -178, + 400, -178, -427, -124, -63, 142, -221, 33, + 2880, -227, -356, -466, -3362, -398, -167, 164, + 126, 59, -1, 5, 212, 25, 2062, -462, + -33, -46, 45, -201, 823, -268, -302, 3623, + 389, 382, 136, -30, -64, 2, -600, 3114, + 2720, 273, -588, -235, -313, -141, 37, -28, + 355, 184, -433, -110, -576, -56, 134, -623, + -271, -2529, -2753, 947, 1319, -2, 620, 36, + -412, -1986, 221, -404, 514, 3223, -106, 1497, + -368, -167, -142, -366, -125, 16, 142, -435, + -160, 2845, -153, 470, 387, 3117, -75, -375, + 658, 259, 755, -3, 3744, -517, -1446, -667, + 1372, -1692, 117, -96, 195, -201, -134, -76, + 179, 97, 71, 1887, 161, 365, 228, 1177, + 235, -834, -48, 1667, -1123, 2217, -209, 100, + -219, -2778, 81, -579, 3421, -326, -492, -233, + 78, 32, 117, -74, -80, 85, -282, 453, + 500, 721, 800, 83, -624, 1000, 165, -20, + -516, -4193, -334, 107, 1221, -1507, -10, 523, + 85, -44, 21, 34, 199, -106, -2233, 525, + 2138, 40, -55, -63, -8179, 326, 333, -152, + -27, 137, 212, 130, -10, 76, -61, -113, + -544, -179, -187, 0, -5308, 322, -326, 513, + 415, 375, -92, -354, 69, 77, 65, 93, + -352, -165, -1837, 1790, 914, -276, 2215, -1418, + 343, 281, 4, 283, 4398, 1695, -248, 153, + -166, 751, 822, -406, -456, -251, 185, -251, + -222, -169, -266, -6323, 249, -40, -45, -203, + 47, -83, -621, -174, 327, 30, 114, -29, + -505, -224, 1804, 1582, -2292, 2102, -746, -421, + 170, 438, -171, 153, 84, -157, -2937, -123, + -81, -227, -98, 263, 3531, 36, 105, -479, + -94, -357, -22, -124, 279, -116, 543, 201, + -393, -226, -2255, -133, 1613, -123, 2687, 70, + 191, 240, -996, -676, 606, -1245, -306, 413, + -272, -539, 485, 3583, -224, 432, 389, 31, + -888, 318, -149, -228, 764, -426, 1608, -2656, + 254, -2193, 252, 484, -90, -117, -257, -2210, + -156, 553, 559, 680, 298, -16, -519, 1172, + 2172, 1288, -113, 186, -199, -1415, -83, -1984, + 667, -1013, 344, -399, 2889, -1175, -908, 186, + 185, -22, -328, 3132, -1166, 209, -213, 386, + 2140, 552, 1023, 719, 529, -169, 421, 196, + 76, 1995, 532, -75, 2060, -526, 396, 2974, + -264, -348, 149, 586, 22, 97, -337, -252, + 357, 103, -2308, -2578, -1836, -277, 346, -314, + -989, 185, -314, 102, 56, 3779, -265, -1029, + -12, -126, -431, 356, -2493, -86, 172, 116, + 61, -146, -2220, 211, -165, 233, -327, 73, + -7, -104, -546, 253, -2406, 361, 2252, 486, + 675, -177, 2643, 603, 300, 1123, -642, 361, + 684, -2151, 569, -1014, 120, -50, 321, 3174, + 3080, -733, -427, 299, 169, -123, -140, -13, + -315, 21, -120, -24, 174, -191, -350, -7842, + -145, -169, -419, -15, 150, -130, -73, 162, + -9, 38, -287, 109, 390, 147, 151, 1907, + -4243, 7, -207, -147, -230, -343, -117, -111, + 107, 132, 1457, -88, -8, -445, -176, -172, + -1799, -813, 486, 1150, -3026, -168, -2620, -584, + 178, -543, -1868, -359, -113, -1783, 214, -663, + 473, 866, -136, 169, -3324, -129, -3404, -249, + 234, 422, 251, 340, -343, 231, 134, -42, + 32, 64, -209, 12, 236, -267, -419, 1, + 260, -109, 6508, 105, 7, -273, -123, -107, + -152, -274, -157, 75, 74, -201, 46, 37, + 338, -21, -180, 208, -6417, 794, 250, -81, + -585, 4, -119, -314, 529, 219, 159, -132, + -277, 76, -613, 4933, 15, 213, 2461, 286, + 542, 177, 2767, 389, 136, 750, 559, -994, + 684, -12, -2081, -546, -89, -3733, 548, -620, + 675, 118, -121, 190, -52, 19, -19, 25, + -1224, 344, 3094, -2067, 7, 273, -1268, -375, + -297, -201, 271, -191, 123, 6, -260, 2284, + -308, -3062, 242, 668, -221, 1146, 1218, 473, + -133, 82, 57, 112, -1677, 78, -229, 354, + -463, 763, 1628, 2243, 1386, 1630, -145, 255, + -60, 228, 195, -864, 2539, -466, 985, -3075, + 2, 118, 221, -395, -450, -256, -158, -32, + -3829, 2012, -50, -465, 146, -1091, -318, 271, + -12, 596, 160, 120, 92, -209, -335, 104, + -28, 689, 305, -548, -849, 1617, 605, 185, + -414, 3899, -273, 51, 182, -192, 121, 616, + 1219, 414, -959, -4219, 1319, 60, 246, -468, + -32, 225, 338, -39, 1235, -2079, 2250, 626, + 121, 296, -137, -339, -1870, -47, -397, 124, +}; + +static const int16_t fcb8l[] = { + -1239, -1310, -1240, -1146, -1337, 1303, -482, 2215, + 2026, 2222, -1144, -1188, -1209, 2535, -1111, -844, + 1485, 625, 1254, 1204, 5932, -1116, -1235, -1208, + -801, -1020, -558, 1387, 1513, -1079, 3220, -896, + -1083, -1166, 2246, -1210, -838, -950, -960, 764, + 13941, -1307, -817, -1253, 1850, -1320, -1361, -1218, + -671, 780, -839, -1068, -776, 2977, -714, -944, + -823, -580, 357, 591, 302, -1078, -895, -1020, + 3116, -1144, 1438, -891, -71, 1528, -238, -1297, + -1020, 4616, -1185, -514, -1154, -1157, 1901, 2372, + -1131, -1289, -1273, -1289, -1311, -1331, -1340, 439, + 455, 2395, -537, -1180, 2409, -1084, -580, 1937, + 846, -51, 615, 1099, 3854, -1177, -912, -1095, + 656, -995, -647, 3298, -976, -436, 12323, -1291, + -1187, -1341, 4779, -1368, -1357, -1317, -985, 1407, + -513, -1387, -1224, -1069, -1218, -1117, -181, -1209, + 5376, 4256, -22, -1232, -1173, -834, -1054, -947, + -611, -822, -206, 5572, -988, 1067, -837, 738, + -332, -38, -59, 143, 248, 386, -447, -1233, + -1258, -1169, 3653, -1045, -657, -926, 2004, 2201, + -1164, 7042, -1302, -1313, -812, 150, -129, 305, + 442, 742, -1185, -1293, -1220, -872, -1304, -1260, + -853, -1293, 2962, 3011, -178, -1187, -1087, -896, + -895, -1053, 3788, 59, -169, 1632, -1201, -1289, + 5263, -896, 331, -852, 218, 825, 1129, 1024, + -39, -1186, -1054, 1862, -1198, 2010, -1075, -1005, + 702, 1550, 4491, -1055, -890, -645, -987, 2465, + 529, 194, -72, 370, 1547, -968, -849, -1153, + 6459, -1164, -1061, -1020, -838, 125, 3698, -1168, + -1066, 1882, -1159, -439, -1017, -759, 744, 1302, + -812, -985, -1002, -1029, -871, 3690, -170, 604, + 623, 1272, 6135, -1012, -1231, -1066, -927, -1082, + 2393, -843, 1537, 1240, -866, -1161, -866, 6639, + -994, -860, -264, -298, 469, 1184, -868, -1262, + 2167, -1177, 2132, -987, -563, 969, 1145, 1508, + -735, -1232, -1090, -1204, 1507, -1101, -393, 755, + 975, 1246, 1944, -1068, -1169, -1040, -987, -1301, + 5488, -1057, 3150, 1890, -1133, 2725, -1123, -963, + 1901, 260, -484, 449, 564, 1144, 679, -1118, + -989, -702, -556, 162, 689, 712, 673, 443, + -695, -1247, -1019, -1065, -406, -1143, 1750, -743, + 2644, 2402, -1171, -1157, -1059, -823, -688, 1314, + 1458, 629, 857, 856, -875, -1316, 3470, -1061, + -846, -761, -712, -955, 978, 1967, -980, 3517, + -994, -953, -903, 56, 228, -30, 359, 560, + 9926, -1178, -1056, -627, -952, -481, -1168, -268, + -701, -555, -887, -1212, 1768, -1156, -396, -755, + -119, 1594, 949, 1201, -844, 1734, 1312, -331, + -500, -280, -125, -219, -139, 496, -1121, -1227, + -1145, -215, -1123, -765, -173, 4055, 1086, 1465, + -714, -904, -901, -713, -1073, 1233, -797, 645, + 58, 897, -518, -624, -441, -554, 1139, 549, + 147, 72, 127, 428, -1104, -979, 2433, 1867, + -237, -745, -280, 110, 794, 631, -1049, 1141, + -974, -920, -849, -392, 634, 414, 614, 797, + -1162, -1344, -1192, -1259, -1079, -912, 2717, 2548, + 1847, 1920, -1004, -1091, -1006, -692, -85, -24, + 1014, 1427, 751, -584, 6057, -1206, -1072, -795, + -921, -1103, -1157, -623, -818, 2641, 3121, -1084, + -1095, -939, -664, -694, 884, 555, 144, 593, + -874, -1074, 417, -1027, -6, -790, 1687, 80, + 1018, 738, -527, -958, -701, -377, -4, 155, + 304, -348, -947, -342, 2269, -1040, 1124, -494, + -76, 76, 2, 114, -194, 348, 904, 466, + -577, -717, 107, -39, -29, 158, 101, 149, + -968, -921, 558, -264, -445, 138, -121, -33, + 105, 243, -478, -1047, -937, -751, -609, -822, + -709, -976, -1006, 2800, -1108, -1292, -1055, -1272, + -1295, -1152, 305, -1144, 635, 2067, -584, -1135, + -663, -1130, -754, -1009, -937, -515, 1473, 841, + -1235, -1338, -1305, -1141, -1109, -1217, -238, 1915, + 3550, 2306, -963, -985, -874, 763, -826, -694, + 19, 391, 379, 776, -582, -1216, -1285, -1164, + -1276, -1305, -1273, 2631, -579, 2487, 1058, -655, + -808, -878, -910, -1006, -1122, -590, -663, 428, + 2185, -1125, -1032, -1076, -873, -1139, -1029, -477, + 1720, 1238, -1111, -1311, -1343, 1074, -1328, -1181, + -970, -386, 2359, 1777, -1045, -1189, -1117, -1053, + -942, -329, 501, 1237, 808, 1022, -866, -1048, + -678, 1597, 1528, -262, -256, 231, 418, 728, +}; + +static const int16_t fcb8s[] = { + -1022, -858, -773, 304, -881, -771, -341, 937, + 270, 420, -684, -1000, -795, -903, -671, -575, + 14, 3327, 528, 893, 965, -541, -947, -1027, + 4008, -1081, -743, -991, -808, 933, -1406, -1173, + 7513, -824, -213, -797, -648, -40, 176, 217, + -1298, 6743, -755, -232, -440, -680, -269, -60, + -80, -85, -893, -1044, -726, -733, -834, -641, + 231, -779, -501, 1832, -1296, 2548, 2754, 19, + -210, -708, -205, -74, 18, 55, -1225, -1123, + -1239, 6991, -689, 272, -290, 56, 356, 675, + 1623, -1134, -607, 1426, -872, 511, -1060, 408, + 253, 423, 1960, -1337, -1152, -985, -924, 2020, + -398, 348, 4188, 1044, -650, -831, 2909, 2083, + -457, -5, -1037, -964, -128, -40, 6019, -858, + -937, -559, -624, -601, -411, 120, -289, 412, + -1271, -1351, 3858, -1214, 2224, -325, -165, 535, + 559, 386, 1868, 649, 269, 245, -708, -778, + -179, -12, 101, -12, -1235, -892, -829, 2570, + -574, -431, 170, 167, 492, 531, -930, -1093, + -1037, -1177, -1151, -912, -466, 303, 1601, 4089, + -1234, 3160, -631, -1090, -741, -274, 103, 13, + 356, 289, 2709, -1115, -1011, -965, -948, -563, + 1939, 870, 1187, 550, -1028, -1217, -726, -954, + -694, -753, 3729, 141, 518, 854, -1102, 1138, + -947, -620, -379, -436, 72, 449, 432, 428, + -1112, 1276, 544, -334, -445, 179, -32, -37, + 9, 28, -1252, 2983, -963, 1256, 419, -10, + 17, 211, 218, 191, 126, -942, -691, -529, + -533, -193, 1216, 150, 389, 152, -1191, -987, + -942, -860, -463, -705, -159, 184, 1893, 1080, + 1753, -694, -609, -699, 61, 269, -126, 93, + 236, 380, -527, -966, -334, 163, -662, 3295, + -477, 591, 259, 638, 397, 181, -598, -129, + 35, -51, -122, 64, -32, -98, -1351, -1140, + 3372, -753, -776, 718, 513, 134, 420, 354, + -1128, -546, -743, 297, 1819, -77, 179, 17, + 181, 206, -1028, -1027, -757, -755, -389, 1035, + 227, 249, 315, 395, -931, -881, 1207, -777, + -165, -531, -375, 73, 346, 332, -1159, -788, + 1196, 959, -432, -337, 243, 176, 321, -7, +}; + +static const int16_t fcb8m[] = { + -1379, -1331, -1277, -1266, -927, 0, 2552, 2575, + 425, 48, 2568, -26, -841, -762, -679, -562, + -420, 186, 68, 69, -743, -193, 266, 92, + 1714, -241, -357, -93, -252, -222, -884, -385, + 2436, -446, -150, -533, -192, -33, 226, 8, + -756, -1180, -1238, -1258, -1250, -1147, -764, 141, + 3075, 4136, -1255, -1288, -1202, -1188, -1222, -1257, + -500, 1989, 4062, 1328, -300, -186, -399, -329, + -330, -533, -313, 2030, 193, -128, -933, -1016, + 66, 1648, -228, -321, 236, 114, 356, 212, + -677, -826, -784, -670, -484, -423, -188, 215, + 2476, 652, 3424, 1991, 940, -576, -942, -1038, + -1097, -1161, -1120, -956, -763, -416, 2824, 1429, + -693, -755, -455, -670, -535, -225, 4814, 116, + -940, -953, -1008, -856, -797, -582, -531, -213, + -412, 2479, -156, -218, -319, -168, -236, -248, + -305, -515, -224, -382, -501, -759, 139, 1789, + -258, -343, -167, 721, -1014, -1092, -975, -1070, + -1126, -778, -178, 36, 522, 5371, -402, -1351, + -1577, -1662, -1642, -1560, -1249, -870, 602, 8968, + -1126, -1102, -1118, -1072, -946, -511, 482, 1635, + 1108, 2471, -935, -748, -302, -445, -810, -359, + 1433, -83, 336, 1834, -712, -773, -752, -609, + -391, 625, 2550, 403, -447, -18, -261, 91, + 5096, -199, -887, -1018, -728, -930, -921, -684, + -22, 2422, 2118, -417, -757, -789, -732, -794, + -785, -664, -627, 885, 471, 798, -429, -684, + -454, -185, 185, -26, -990, -369, 1048, -25, + -98, 720, 41, -60, -3, -92, -790, -147, + 846, 4007, -346, -907, -849, -730, -639, -842, + 9096, 617, -1164, -1275, -1380, -1396, -1391, -1364, + -1342, -1080, 655, 5687, 505, -818, -1134, -1125, + -1136, -1123, -1088, -996, 3, 36, -48, -28, + 121, -55, 172, -43, 21, -74, 1537, -69, + 378, -38, -113, 159, -149, -609, -693, -796, + -715, 588, 376, -744, -659, -316, 145, 448, + 659, 320, 787, -315, -956, -682, -595, -327, + 146, 348, 837, 577, -1011, -1014, -647, -159, + 679, 158, 294, 670, 507, 540, 418, 558, + 12, -674, -901, -897, -827, -682, 323, 2580, +}; + +static const int16_t fcb8sl[] = { + -1269, -1637, -1349, -1672, -1421, 2750, 212, 3563, + -74, 1555, -1495, -1148, -1172, 1351, -484, -473, + 1418, 557, 899, 635, 6124, -1140, -1154, 783, + -1444, -1509, -1041, 1793, 4459, 1325, 2055, -921, + -794, -713, 1625, -50, 78, -159, 361, 855, + 10282, -1533, -1105, -1582, -1704, -1697, -1440, -1001, + 864, 2038, -1347, -847, -1419, 1474, -1369, -1189, + -1125, -655, -134, 950, -1398, -222, -1498, -1262, + 2597, 729, 2521, -544, 457, 2058, 3821, -1568, + -1577, 2013, -1717, -1620, -1292, 2771, 2559, 4942, + -1497, -1576, -1724, -1550, -1775, -1734, -1097, -635, + 1934, 2706, -1399, -994, 1685, -1142, -511, 1595, + -275, 861, 484, 958, -1374, -764, -1105, -1493, + -1678, -1630, -521, 5138, 53, 1331, 4909, -1376, + 2134, -1638, 1562, -1565, -1487, -1625, 3232, 4742, + -1017, -1353, -1212, -1585, -1309, -1139, -71, -820, + 5928, 2987, -641, -1314, -1198, -1182, -1005, -542, + -1287, -1210, -1103, 6865, -1130, 1375, -884, 1241, + -532, -173, -68, 15, 309, 192, -1128, -1107, + -849, -1343, 2233, -1281, -535, -679, 3878, 1865, + -1427, 4508, -1022, -747, -1117, -1104, -33, 669, + 1216, 1482, -1360, -1075, -1483, -1390, -1366, -754, + -1042, -766, 3467, -624, -968, -1101, -393, -890, + -447, -995, 2346, -909, -784, 977, -1141, -1201, + 5256, -1552, -536, -1419, 0, 596, 556, 1654, + -1124, -1225, -830, 1267, -719, 1791, -546, -297, + 978, 378, 2674, -1261, -1159, -951, -1027, 2537, + -470, -360, -268, 1098, -1154, -1513, -729, -1455, + 5671, -1236, -800, -874, 1630, 1273, 1909, -623, + -724, 1417, -559, -326, -257, -189, 265, 220, + -284, -1302, -1272, -1223, -842, 4338, -934, -1001, + -495, 2944, 4295, -924, -1004, -1097, -1024, -328, + 1736, 106, 452, 158, -1024, -541, -1296, 4376, + -1117, -1224, -843, 1097, 1121, 1251, -829, -1374, + 2292, -1505, 1850, -1153, -943, -979, -534, 1444, + -1510, -1494, -1147, -1397, 1535, -794, -21, 1313, + 638, 1015, -1072, -1275, -1166, -1602, -1618, -1379, + 4541, -226, 2169, 888, -1369, 2392, -1087, -948, + 1074, 674, 384, 124, 500, 749, 398, -1091, + -721, -114, -15, 413, 200, 135, 290, 189, + -1185, -1188, -1339, -1549, -871, -574, 2333, -346, + 554, 3773, -1247, -1531, -1408, -1310, -1007, 2861, + 2465, 608, 1080, 1224, -1103, -1477, 1884, -1412, + -904, -1473, -846, -188, 782, 2049, -1473, 1531, + -1530, -1459, -1546, -1260, -856, 1191, 652, 933, + 5072, -1456, -1653, 3759, -1751, -531, -1391, 4297, + -374, -751, -1570, -1242, 1461, -1286, -913, -621, + 1768, 1246, 1291, 779, -1360, 1641, 1122, -629, + -328, -197, 241, 359, 560, 536, -1474, -506, + -1523, 298, -1551, -1254, -985, 3603, 4317, 958, + -885, -241, -1159, -930, -1249, 1490, -825, 274, + 347, 307, -1060, -1027, -809, -1063, 1554, 1708, + -242, -23, 424, 804, -1317, -853, 1571, 1898, + 239, -556, 298, -161, 777, 765, -1464, 1053, + -1198, -1156, -917, 0, 1460, 447, 1178, 629, + -1455, -1591, 296, -1785, -1694, -1631, 3669, 3819, + 3437, 3274, -956, -666, -874, -284, -858, -202, + -687, 1728, -512, -951, 4692, -1360, -1242, -1188, + -1513, -449, -1566, -1515, -1226, 3857, 1246, -1225, + -860, -1068, -748, -27, 380, 1190, 591, 552, + -1391, 194, -763, -463, 331, -265, 702, 181, + 290, -145, -838, -1359, -1381, -1569, -1399, -1088, + -1357, -1295, -486, -612, 1638, -586, 1458, -774, + -223, -620, -104, 189, 344, 269, 1555, 1428, + -867, -621, -294, -206, 32, 235, 261, 161, + -1021, -105, 654, -235, -282, -7, 189, -159, + -218, 113, -1096, -1318, -1256, -1335, -931, -476, + -1041, -1199, -1134, 2781, -1479, -1222, -1397, -867, + -815, -661, 740, -240, 1158, 735, -1435, -1003, + 351, -990, -245, -72, -347, -72, 1408, 634, + -1697, -1727, -1534, -1716, -1436, -102, 402, 1518, + 1903, 1311, -1477, -930, -355, 508, -162, 21, + -46, 454, 387, 173, -1312, -1284, -1486, -1172, + -1356, -965, -1106, 1760, -670, 2163, -70, 417, + -559, -667, -545, -945, -429, -363, 157, 1280, + 2059, -1319, -1291, -975, -1354, -1249, -780, -476, + 1410, 1252, -1193, -927, -1462, 871, -1281, -1327, + -900, 1540, 1531, 1227, -1651, -1334, -1073, -752, + -154, 710, 830, 773, 279, 307, -1294, -796, + -761, 1012, 1583, -420, -177, -323, 154, 582, +}; + +static const int16_t fcb8ss[] = { + -1481, -1069, -1082, -726, -818, -550, -417, 343, + 489, 275, -814, -510, -712, -933, -558, -236, + 32, 3051, 451, 301, -414, -237, -683, -599, + 3627, -445, -232, 56, 58, 112, -1226, -639, + 4096, -644, -226, -23, 90, 162, 313, 104, + -1385, 5607, -428, -860, -447, -265, -145, -132, + 115, -200, -1349, -1280, -1216, -1046, -657, 43, + 1333, 831, 675, 1174, -1394, 2288, 1840, -682, + -497, -256, 22, 22, 261, 70, -1369, -826, + -975, 2286, -329, -267, 142, 36, 437, 313, + 1570, 52, -470, 622, -244, -247, -114, 22, + -117, -541, -1167, -596, -809, -929, -669, -327, + 102, 516, 2790, 597, -1317, -870, 1327, 987, + -25, 391, -48, -82, 209, -242, 4424, -311, + -396, -765, -382, -336, -365, -414, -74, -13, + 1127, -588, 1363, -714, 368, -450, -390, -364, + 84, 139, 1864, 1881, -15, -790, -281, -286, + 38, -186, -31, -238, -1249, 262, -841, 731, + -414, -61, -274, 280, 100, 557, -841, -775, + -1007, -1063, -687, -374, -360, 31, 1048, 3471, + -1385, 2464, -840, -1105, -714, -400, 56, 445, + 588, 427, 1785, -1093, -783, -847, 41, -23, + 465, 392, 382, 428, -518, -249, -58, -791, + -689, -581, 3146, -183, 296, 66, -1243, 1059, + -1076, -874, 416, 544, 253, 66, 168, 211, + -1388, 1253, 138, -727, -509, 905, 319, -297, + 67, -525, -1470, 2237, -87, 547, 556, -239, + 90, -147, -114, -302, -1017, -824, -585, 25, + 0, 62, 1422, -155, -41, -320, -1125, -1069, + -1134, -783, 1129, 45, 183, 47, 716, 672, + 409, -1169, -910, -447, -34, 79, 95, 455, + 504, 381, 342, -877, -506, -812, -805, 3031, + -249, -518, -69, 564, 243, 261, -332, -434, + -173, -37, 61, 45, -5, 6, -1433, -1009, + 1428, -951, -582, 154, 143, 625, 383, 387, + -1392, -1222, -578, 229, 1294, 218, -142, 355, + -149, 201, -1341, -1135, -857, -767, -273, 2059, + 255, 578, 350, 315, -1041, -617, 254, -504, + -255, -96, -537, -396, 363, 1074, -1361, 484, + 538, -789, -704, -447, 200, 521, 213, 90, +}; + +static const int16_t fcb8sm[] = { + -1183, -1170, -867, -948, -746, 492, 1531, 1412, + 524, 82, 590, -994, -916, -859, -680, 12, + 742, 961, 230, 255, 34, 38, -176, -1, + 1880, -240, -769, -531, 269, -32, -772, -494, + 757, -583, -677, -281, 717, 440, 561, 91, + -1121, -1054, -1189, -1100, -745, -417, -61, 302, + 3079, 1817, -1384, -1479, -1477, -1509, -1077, -323, + 902, 2348, 1464, 1038, -487, -179, -447, -311, + -296, -439, -172, 2166, 245, -28, -1050, -390, + -238, 633, 302, -335, 843, -52, 185, 230, + -110, -433, -690, 148, 63, -289, -404, -469, + 1948, 245, 2016, 1337, -341, -554, -617, -457, + -436, -459, -400, -520, -661, -7, 1078, 971, + -326, -332, -23, -749, 83, -104, 2106, -947, + -867, -883, -705, -433, -35, 164, 427, 646, + -924, 2196, -656, -798, -282, 217, -227, 134, + 446, -15, -584, 33, 185, -571, -159, 1852, + -405, -94, -61, -83, -329, -516, -394, -450, + -173, -140, -54, -156, 226, 1850, -752, -1304, + -1378, -1275, -1017, -680, -337, 356, 1131, 4143, + -1120, -1253, -1269, -860, 90, 973, 152, 886, + 609, 1454, -29, 36, -117, -815, -651, -346, + 2085, -414, 24, -93, -235, -1103, -1132, -758, + -98, 1497, 1285, -289, -34, 402, -646, 637, + 2147, -677, -350, -266, -232, -61, -199, -359, + 167, 1546, 816, -453, -35, -251, -468, -491, + -371, -593, -878, 1445, -795, 651, 108, -155, + -201, -14, 250, -271, -732, 793, 154, -288, + -86, 16, 557, 642, -592, -587, -87, -365, + -309, 1753, -40, 95, -529, -87, -214, -234, + 4999, -466, -755, -800, -785, -722, -532, -703, + -526, -465, 591, 3937, -229, -804, -808, -698, + -576, -613, -506, -725, 10, 13, -117, -55, + 101, 52, 125, -76, -25, -28, 1469, -245, + 8, -25, 65, -53, -262, -282, -411, -588, + -667, 1374, 304, -787, -661, -675, 55, 320, + 720, -4, 366, -103, -136, -332, -314, -293, + -38, 127, 151, 380, -1330, -1338, -618, -40, + 1284, 1500, 466, -515, 105, -161, 19, 697, + -417, -559, -317, -712, -756, -567, 754, 1481, +}; + +static const int16_t fcb11l[] = { + -1291, -1237, -1175, -1186, -1139, 524, 1225, 1464, + -1042, -721, -901, 41, -728, 822, -657, 1078, + -483, 1530, -489, 1253, 926, -326, 404, 89, + -1191, -1170, -1237, 1633, 1493, -465, 986, 1184, + -857, -832, -300, -811, -936, -667, -254, 492, + 4044, -1136, -983, -855, -592, -199, 383, 876, + 2076, -1042, -1019, -729, 1435, -25, 64, 845, + -991, -921, -861, 916, -402, -551, 236, 429, + 5253, -1233, -1268, -414, 1793, -463, -569, 1693, + -1197, 6322, -887, -211, -945, -540, 626, 903, + -993, 1500, -490, 1445, -764, -136, 321, 548, + 462, -228, 127, -322, 481, -183, 88, 155, + -809, -844, -959, 4011, -581, -232, 330, 986, + -900, -916, -1069, -866, -979, -439, 4016, 1558, + -1023, 2121, 1717, -612, -588, -446, 223, 430, + 2567, -972, 2118, -1030, -900, -664, 180, 858, + 3232, -991, -1132, 2119, -446, -548, -258, 895, + -962, -184, 2639, 1081, -661, -222, 292, 530, + -952, 1767, -213, -701, 1079, 37, 131, 489, + -875, -749, 3167, -776, 1247, -109, -83, 636, + -1146, -1070, -1001, -1064, -942, 2891, 1137, 1585, + -1314, -632, -1179, -1105, 1101, 51, 2038, 2036, + -926, -727, 180, 1515, -566, 1191, 101, 595, + 2247, -364, -315, -105, -130, -79, 121, 210, + 7994, -1302, -898, -785, -758, -777, 31, 415, + 744, -652, 688, 1226, -649, -605, -268, 314, + 611, 662, -240, -411, -698, -434, 377, 339, + 953, -810, -931, 1054, -484, -298, 721, 522, + 922, -1046, -952, -871, -618, -270, 419, 635, + 1006, 129, -838, -724, 220, 481, 253, 329, + 205, -456, -724, 675, 598, 332, -14, 291, + -1016, -695, 542, 1270, 498, -456, -113, 362, + -547, -1068, -1178, -1261, -1161, -905, 390, 2204, + -1056, -1102, 5611, -1100, -1076, -902, 360, 978, + -538, -286, 1253, -430, -457, -148, -1, -60, + -1116, -955, 2869, -926, -680, 1111, 706, 842, + -1311, -1275, -1150, -236, 675, 897, 758, 912, + 1886, -1115, -999, -84, -588, 2190, -171, 739, + -737, 150, -902, -854, -917, 334, 557, 534, + -851, -39, -25, 214, -136, -73, 263, 234, + -1021, 1332, -543, -655, -712, -651, 80, 479, + 1555, 1933, -707, -485, -206, 139, 312, 405, + 2472, -1172, -945, -939, -713, 568, 1421, 684, + 70, -1263, -1235, 586, -195, -1065, -449, 3182, + -1143, 529, -926, -558, 419, 390, 375, 563, + -1090, 3370, -688, -528, -346, 136, 317, 615, + -803, -977, -1082, -806, 3607, -443, -156, 1130, + -1288, 1585, -1218, -1226, -979, 359, 1555, 1402, + -341, -416, -480, -360, -415, 542, -148, -322, + -1095, -1074, 762, -864, -634, 1770, 340, 466, + -1040, -834, 1508, -707, 143, 74, 1418, 905, + -1094, -710, -549, -860, 373, 1492, 2024, 741, + -938, -910, 2661, -1087, -1105, -901, 383, 906, + 755, -819, 581, -612, -420, 305, 344, 363, + -356, -991, -845, -1051, 2112, 1738, 554, 954, + -1028, -943, -892, -896, -236, -674, 1076, 679, + -611, -1099, -859, -914, -444, 910, 491, 709, + -1063, 775, 496, -669, -304, 672, 261, 496, + -1086, -963, 1037, -639, -134, -577, 33, 607, + -1070, -649, 730, -748, 1884, -18, 346, 627, + -1089, -1118, -955, 751, -690, 606, 1204, 1037, + -1016, -1095, 473, -919, -1036, -685, 1744, 1216, + -834, -916, -920, -634, 1086, -474, 161, 620, + -997, -899, -25, -499, 399, 405, 163, 401, +}; + +static const int16_t fcb11s[] = { + -1148, -1134, -1000, -585, 715, 774, 626, 650, + 2109, -898, -729, -239, -213, 847, 77, 371, + -902, -790, 1853, -871, -816, 163, 295, 377, + 1718, -1070, -840, -791, 1612, -129, 144, 450, + -830, 1909, -539, 803, -411, -188, 122, 148, + 1202, 705, -696, -578, -213, -25, 126, 142, + 3309, -1083, -865, -771, -470, -237, 980, 521, + 428, -995, -1003, 3088, -1000, -455, 320, 503, + -615, 1746, -751, -734, 1092, 31, 97, 225, + -1175, 2287, 1278, -421, -315, 91, 130, 120, + -1203, 4211, -970, -878, -228, 71, 327, 288, + -1012, -850, 1471, -732, 1228, 201, 146, 271, + -868, -528, 1196, 744, -186, 85, 38, 153, + -1081, -895, -742, 1014, 1110, 66, 237, 335, + -1012, -1137, 4357, -1062, -569, 377, 268, 445, + 1203, -717, 1070, -541, -72, -29, 91, 104, + 6448, -1148, -1069, -810, -659, 118, -284, 300, + -1085, -940, -214, -621, -781, -622, 1789, 711, + -1165, 1643, -890, -809, -533, 148, 384, 373, + -910, -986, -855, -1032, 3647, -478, -132, 713, + -3, -674, -1036, -956, -899, 2698, 629, 665, + -764, -1066, -1173, -1058, -692, -144, 1114, 3195, + -1012, -643, -670, 1547, -576, 351, 251, 273, + -950, 563, -742, 248, -149, 514, 100, 185, + -193, -616, -655, 255, -364, -323, 172, 256, + 308, 228, 16, -187, -243, 219, 88, 53, + -1024, 664, 450, -416, -189, -239, 43, 102, + -64, -499, -159, -400, 905, -64, -68, 46, + -1055, -77, -813, -661, 59, -77, 226, 321, + 1224, -553, -436, 793, -155, -83, -5, 72, + -652, -897, -157, -579, -539, 846, 181, 318, + 782, -967, -802, -569, -6, 364, 540, 513, +}; + +static const int16_t fcb11m[] = { + -453, -1087, -1133, -1125, -852, -158, 1152, 3313, + 1015, -444, 1085, -465, -317, -298, -471, -238, + -647, 1426, -241, 149, -300, -169, -19, -228, + 3282, -269, -1025, -1069, -1097, -1071, -539, 1303, + 1111, -933, -741, -801, -553, 98, 393, 1031, + -786, -729, -835, -810, -78, 1569, 631, 944, + 1031, 651, -409, -397, -346, -221, -99, -216, + -88, -211, -419, 193, 1298, 196, -221, -879, + -1036, -1303, -1282, -1052, -575, 283, 3110, 1337, + 489, -463, -640, 112, 341, -322, 261, 266, + 1646, -817, -1256, -1273, -1217, -1031, -142, 3691, + 3012, 1564, -289, -830, -970, -1032, -1075, -989, + 556, 52, -588, -589, -613, -748, -352, 2054, + -69, -785, -718, -499, -141, 192, 1396, 446, + -3, -514, -612, 3, 171, 1067, -114, -109, + -812, -893, -776, -342, 1428, 421, 438, 552, + -933, -1143, -207, 1312, 791, 166, -198, -79, + -632, 1122, -537, -620, 450, 97, -85, 174, + 1760, 123, -168, 485, -77, -567, -776, -952, + -758, -1176, -1322, -1355, -1207, -928, -177, 6229, + -413, 261, -327, -848, -725, -395, 849, 1533, + -201, -124, 2976, -335, -703, -674, -727, -949, + -521, 209, 1004, 838, 56, -477, -751, -603, + -922, -615, 1832, -448, -329, -148, 73, 467, + 4991, -86, -809, -928, -951, -956, -819, -751, + 1841, -790, -712, -116, -113, -91, 0, -388, + -729, -196, 758, -377, 68, 85, 428, -35, + -5, 2, -9, 18, -31, 53, -23, 26, + -896, -445, -188, 818, -347, -44, 502, 578, + 101, 2968, 269, -724, -702, -747, -719, -673, + 7587, 68, -1171, -1377, -1441, -1455, -1473, -1178, + 699, 585, 15, 2257, -503, -940, -1085, -1288, +}; + +static const int16_t fcb11sl[] = { + -1502, -1463, -1336, -1177, -367, 89, 475, 867, + 550, 820, -805, -580, -803, -89, -817, 1691, + -304, 120, 36, 564, 409, -525, -820, 362, + -969, -870, -605, 1983, 993, 722, 1505, 1101, + -842, -848, -918, -379, -71, 257, 499, 607, + 1619, -956, -1024, -869, -744, -74, 795, 684, + 532, 634, -1360, -818, 49, -981, 111, -473, + -718, -477, 377, 710, -1399, -1105, -1152, -1024, + 2426, -356, -191, 1079, 911, 1164, -809, -791, + -919, 2731, -851, -400, -113, 242, 508, 847, + -1229, 1199, -910, 1127, -686, -383, 26, 352, + 536, 646, -790, -1243, -1103, -1170, -1132, -1065, + -788, -521, 161, 3842, -1098, -883, -1052, 8, + -1103, -747, -552, -480, -241, 820, 3392, -770, + -770, -724, -588, -426, -153, 426, 639, 724, + 1626, -713, 1157, -736, -492, -512, -160, 461, + 569, 583, -1351, 1332, -1222, -1358, 240, 1541, + -724, 612, 1583, 1194, -1061, -990, -671, -969, + -952, 2368, -442, -413, 1933, 1023, -144, -283, + -992, -940, 983, -232, 818, 341, 502, 549, + -1420, -1268, -1279, -1213, -621, 2019, 685, 1948, + 1264, 1200, -1293, -664, 392, -848, 866, 1191, + -220, 95, 450, 640, -1334, 1098, -751, -701, + 1296, -347, -92, 233, 532, 599, -952, -694, + 3085, -908, -256, -494, -177, 123, 809, 941, + 18, -1089, -801, 303, -761, 11, 632, 288, + 476, 518, -241, -1138, -1068, -869, 292, 121, + -26, -96, 457, 548, -106, -784, 930, -700, + 1842, -812, -617, -307, 430, 655, -698, 1157, + 947, -803, -662, -743, -49, 1120, 348, 578, + 855, -1049, -753, -67, 710, -347, -28, 694, + 411, 468, -61, 239, 23, -1072, -757, 477, + -658, -362, 239, 576, -1479, -1279, -1286, -677, + -939, -722, 3217, 338, 1562, 1566, 925, 917, + -697, -708, 645, -447, -280, 714, 503, 552, + -1050, -1021, 889, -956, -934, 705, 457, 616, + 556, 667, -1331, -51, -256, -48, -234, 240, + 757, -74, 148, 356, -1278, 1538, 234, -372, + -472, -221, -424, -494, 170, 551, 216, 294, + -885, 231, -263, 334, -64, -54, 291, 350, + -1140, -1074, -1199, -1374, -1278, -845, -547, 667, + 4544, 1922, -899, -930, -954, -1120, -1092, 1156, + 1889, -404, 259, 1114, -956, -836, 881, -316, + -977, -860, 202, -249, 121, 816, -1188, 3644, + -829, -876, -670, -473, -161, 420, 851, 886, + -1014, 1191, -938, -958, -864, 741, 241, 957, + 288, 629, -1155, -898, 1104, -789, 28, -867, + -580, 2588, 836, 1234, -953, -749, 934, 1137, + -310, -177, -113, 244, 532, 424, -341, -602, + -880, -1105, -303, -381, -527, 1943, 126, 759, + -1277, -1037, 59, -783, 485, -589, 1341, 737, + 488, 709, -1473, -1208, -1082, 589, 791, 735, + 447, 322, 835, 731, -1116, -681, -592, 704, + 520, -545, -104, -24, 263, 458, 632, -721, + -1086, -1223, -1150, -866, 1537, 2815, 123, 1097, + -1238, -861, -1217, -1238, -1261, -914, 1165, 422, + 711, 883, -1196, -972, -428, -230, 171, 8, + -448, 1195, 445, 440, -413, -139, -375, -568, + -781, -520, 611, -586, 881, 589, -724, 972, + -907, -794, -819, -641, 1650, 66, 254, 703, + -1380, -1168, -967, 676, -765, -537, 578, 1542, + 687, 833, 1151, -811, -948, -995, -246, 1301, + -377, 262, 632, 652, 1530, -679, -682, 993, + -666, -457, -72, -20, 317, 516, 861, -528, + 24, -579, -386, 53, 526, -76, 66, 345, + -59, -612, 165, -181, -98, -34, -66, 286, + 95, 108, -1118, -147, 643, -1055, -768, -502, + -587, 27, 2113, 811, -1219, -947, -811, -1188, + 1143, -609, -753, 88, 2844, 1424, -1428, -1082, + -1273, 1086, -1206, -1171, 279, -510, 2325, 1757, + -1437, 654, -1278, -1267, -1117, -950, 779, 2205, + 1150, 1101, -1484, -1009, -1199, -1416, -1215, 657, + -737, 634, 1266, 1742, -1445, -1193, -1358, -1158, + -1015, -995, -655, 4035, 1966, 1903, -1069, 954, + -1099, -1171, -1029, -818, -576, -104, 1390, 1069, + 559, -914, -1034, -1152, -987, -582, -222, 394, + 1204, 775, -1464, -51, -959, -1005, -452, 347, + -94, 1, 525, 595, -1324, -1226, -1102, -825, + -927, -776, -582, 175, 1675, 632, -859, 28, + -914, -209, -468, -625, -230, 646, 579, 446, +}; + +static const int16_t fcb11ss[] = { + -1351, -1229, -1174, -767, 1403, 182, 532, 445, + 415, 610, -1095, -771, -1142, 3221, -803, -680, + -302, 318, 441, 438, -1188, 1145, 1552, -528, + 887, -547, -429, 124, 99, 128, -768, 1049, + -562, 1121, -593, -96, -105, 105, 251, 154, + 1684, 1598, -635, -685, -177, -211, -268, 234, + -118, -49, -719, -873, -1092, -985, -678, -406, + -234, 407, 653, 3195, 991, -584, -874, -14, + -683, 2964, -769, -450, 287, 350, 853, -803, + -574, 1761, -410, -60, -230, -78, -21, 19, + -1271, 4435, -673, -790, 110, -243, -81, 147, + 191, 145, 5571, -611, -634, -699, -195, -281, + -249, -302, -272, -67, -893, -656, -745, -697, + -550, -639, -409, 3085, 383, 798, -311, -340, + -564, -787, 3628, -332, -510, -219, 465, 351, + -747, -1084, -972, -727, -404, -630, -176, 437, + 3352, 978, -886, -751, -767, -580, -693, -942, + -803, -158, -36, -3, -966, -674, 3075, -926, + -172, -9, -40, 111, 169, 212, 181, -811, + -715, -986, -521, -686, 3915, 18, -58, 499, + 210, -1187, -903, -915, -522, 1038, 477, 788, + 290, 412, -1010, -791, -700, -710, 34, 1774, + -256, 96, 131, 241, -1251, 2086, -5, -765, + -446, 141, 93, 160, 88, 129, -1153, 1171, + -1192, -1073, -391, -187, 206, 416, 444, 648, + 707, -542, -504, -750, -623, -648, 776, 692, + 165, 330, 1112, -1199, -876, -428, 949, 65, + 250, 104, 108, 173, 2147, -905, -846, -540, + -376, -131, -113, 124, 314, 485, 1253, -515, + 1435, -527, 21, -100, -368, -84, -119, -144, + -1375, -1189, -1189, -999, -723, -190, 796, 639, + 699, 816, -1188, -919, 683, 842, 177, -62, + -25, 71, 15, 16, 157, 80, -331, -343, + 12, 193, -133, -94, -94, -64, -1306, 531, + -917, -142, 1274, 102, -15, 184, 159, 148, + -43, -1103, -581, -419, 447, -132, -204, 187, + 631, 461, -1302, -1162, -927, 896, 203, 164, + -55, 287, 544, 485, -1258, -791, 677, -945, + -244, -101, 423, 362, 298, 389, -825, -640, + -646, 274, -73, -274, 1473, -13, 132, 169, +}; + +static const int16_t fcb11sm[] = { + -767, -1179, -1188, -1069, -690, -172, 787, 1389, + 1623, 844, -169, -894, -919, 51, 15, 426, + -326, 1579, 182, 77, 202, -417, -357, -17, + 2154, -77, -607, -589, -375, -261, -376, 175, + -829, -801, -579, -290, -244, 533, 1307, 873, + -877, -1175, -1157, -726, 461, 1729, 433, 219, + 246, 606, -791, -827, 649, 891, 820, 720, + 407, -641, -727, -708, 2498, 961, -99, -542, + -530, -507, -536, -608, -642, -622, 316, 195, + -721, -549, -253, 1520, 171, -81, -372, -333, + 1166, -1072, -1230, -1123, -1031, -868, -370, 209, + 1561, 1751, 113, -367, 399, -663, -10, -271, + 950, 118, -335, -272, -863, 60, -875, 1850, + -242, -276, -38, -106, 471, 30, 823, -344, + -752, -714, -309, -419, 86, 1604, -250, -185, + -839, -703, -561, -281, 1813, -57, 255, 266, + -32, 99, 400, 2520, 315, -372, -306, -511, + -549, -659, -760, -729, -559, -137, -610, 174, + 924, -310, -705, -307, 885, 512, -611, -1097, + -1172, -1072, -758, -527, -192, 278, 740, 3398, + -1136, 409, -230, -353, -137, 322, 326, 365, + 133, 173, 2291, -644, -725, -596, -535, -340, + -88, -65, -53, 273, -760, -390, -649, 119, + -243, -222, 1726, -113, 44, 326, -618, 311, + 2345, -241, -398, -399, -382, -322, -444, -457, + 1873, -454, -505, 42, 481, 187, -49, -505, + -634, -754, 1052, -597, 1315, 297, -412, -110, + -205, -552, -682, -524, -1055, -431, 971, -363, + -539, -366, 39, 995, 181, 476, 662, 229, + -445, 1682, -205, -181, -273, -497, -685, -628, + 6135, -21, -834, -934, -1002, -1066, -931, -974, + -902, -643, -820, 1891, -706, -288, -252, -231, + -79, 126, 35, 37, 10, -10, -36, -6, + -9, -47, -7, 1, 11, -2, 644, 315, + 145, -353, -396, -428, -357, -60, 275, 109, + -1179, -952, -698, 138, 286, 171, 394, 263, + 814, 495, -490, 110, 369, 599, 9, 599, + -431, -233, -328, -69, 410, -1002, -462, 77, + 97, 196, 133, -91, 512, 49, 621, -436, + -352, -390, -211, -188, -454, -318, 44, 1424, +}; + +static const int16_t fcb16l[] = { + -13, -798, -772, 235, 515, -181, -120, -509, + -392, -1159, -844, -1041, -881, -1193, 1103, -1080, + 214, 1615, 1819, 1510, -914, -1190, -273, -1099, + -522, -996, -206, 3946, 996, 1678, -1220, -1201, + 2850, -1022, 1101, -814, -188, 879, 1549, 1279, + -1129, 1928, 1550, 38, -356, -574, -157, 286, + 481, 475, -1079, -1176, -861, -548, -657, -381, + 538, 948, -838, 779, -1149, -962, 1788, -779, + -742, -311, 205, 299, 472, 715, 702, -843, + -931, -790, -624, -332, 324, 778, 785, 670, + -1137, -1205, -103, -1182, -1071, -950, 101, 527, + 1596, 1004, 682, -564, -1053, -844, -1184, 1732, + -862, 1994, -988, 1131, -1069, -1276, -1053, 6414, + -1259, -186, -930, 118, 375, 1092, 6215, -900, + -920, -935, -981, -970, -766, -902, -334, 1629, + -1094, -1142, -1155, -779, -1092, 1011, -490, 1063, + 1569, 1340, 2242, -1313, 6027, -1319, -1337, -789, + -1296, -457, 819, 2276, -1071, -1065, -715, 802, + -996, 397, 2396, -27, 1225, 935, 1400, -862, + -802, 1846, -513, -249, -704, 515, 872, 662, + -1141, 5876, -691, -404, -603, -148, -57, 187, + 649, 788, -1116, -915, -551, 3843, -737, -133, + 498, 155, 227, 718, 1798, 1397, -868, -716, + -586, -580, -71, -67, 311, 536, 2465, -524, + 1837, -231, -210, 263, 231, -10, -164, -324, + -951, -1130, 5206, -525, -603, -401, 223, 438, + 1011, 1077, -726, -1102, -1013, -386, -786, 4281, + -329, 262, 550, 1292, -629, -943, -976, 773, + -867, 908, -680, -154, 362, 1056, -1051, -703, + -1333, -1424, -1026, -793, -859, -882, -148, 9958, + -1193, -1156, -1077, 1241, -1013, -726, -139, 551, + 1150, 1019, -733, -997, -651, -625, -54, 722, + 73, -14, 361, 435, 4013, -1260, -1195, 1452, + -1105, 1273, -670, 1546, 1038, 1680, -812, -1060, + -853, -1058, 2094, -801, -457, -320, 683, 960, + -1019, -1158, -1118, -1034, -617, 404, 1376, 847, + 1014, 951, -12, -1004, -1221, -1131, 649, -1052, + 442, -167, -859, 3868, -1216, -1298, -1311, 2866, + -1310, -639, -1079, 1576, 1760, 1837, 118, -1080, + -862, -845, -1065, -1069, 2199, -766, 495, 1309, + -996, -1040, -741, 1357, 1726, 382, 264, 92, + 659, 665, -781, -1356, 2055, -1198, 15, 2143, + 631, 569, 918, 1120, -948, -1253, -1234, 2442, + -1062, 2206, 48, 660, 1822, 1480, -639, 627, + -432, -477, 845, 216, 228, 152, 157, 295, + 2444, -908, -465, -768, 109, 251, 72, -59, + 169, 405, 4395, -837, -931, -839, -215, -564, + 655, 359, 503, 296, 3514, -1082, -1185, -827, + 2879, -1224, -811, -970, 804, 911, 3028, -1284, + -688, -1226, -1251, -551, -1247, -275, 3441, 2322, + -630, -1213, -108, -1191, 1129, -854, 2848, 1609, + 1048, 1535, 2784, -1245, 772, -1230, -1298, -686, + -1293, -639, 278, 2455, 9975, -1077, -1233, -1055, + -139, -853, -48, 24, -720, 533, -1191, 2809, + -1015, -899, -28, -765, -147, 146, 592, 814, + 12493, -1274, -1072, -1297, 877, -1068, -1179, -1032, + 1023, -1178, -840, 930, -660, 1216, -366, -406, + -97, 77, 179, 340, -973, -993, 2280, 1775, + -631, -17, -186, 507, 459, 645, 2095, -1019, + -1067, -949, -857, -1202, -904, -48, 1156, 1273, + -1230, -1245, -1203, -1036, -1150, -955, 1193, 1943, + 1437, 1329, -618, -1055, -730, -1014, 4953, -1125, + 1089, 1085, 1047, 1045, 813, -1036, 1270, -715, + -684, -96, -131, 289, 782, 628, -979, 1060, + -975, -964, -811, -14, 223, 422, 563, 696, + -901, -633, 496, -136, 22, -83, -52, 264, + 24, 147, -446, -1197, -1258, -687, -1239, -795, + -1066, -1196, 147, 2653, -1231, -1275, -1240, -1041, + -1260, -1159, 1961, -34, 2937, 2128, -1318, -1355, + -1326, -1300, -1345, -1326, -870, -298, 2014, 3890, + -933, -1014, -859, -1074, -506, -1163, -954, -819, + 440, 732, -582, -1268, -1206, -1037, -1081, -1255, + -1150, -835, 2360, 1469, -1232, -1384, -1388, 542, + -1359, -606, -1335, 1852, 2142, 3722, -1218, -1321, + -1268, -1207, -1203, -1316, -954, -696, 4730, 2920, + -1225, -1306, -1131, -1273, -1276, -1238, -1040, 2079, + 2652, 1931, -1167, -1302, 659, -532, -650, -560, + -1028, 186, 1224, 2811, -896, -449, -999, -823, + -81, -876, 502, -293, 680, 733, -836, -1111, + -1132, -865, -1141, -938, -980, 1287, 581, 1438, +}; + +static const int16_t fcb16s[] = { + 1260, -1427, -1400, -996, -958, -1195, 6261, 31, + 967, 752, 3776, -975, -840, -707, -696, -555, + 45, 1159, 4, 358, 4718, -1471, -1464, -1291, + -1364, -934, -878, 5198, -273, 1555, -1438, -1729, + -1579, -1470, -1820, -1436, -1255, -631, 4287, 4025, + 1233, -684, -748, -742, -547, -229, 321, 126, + 794, 670, 6689, -1041, -1160, -861, -1002, -976, + 147, -668, 521, 940, -1186, 2097, -570, 1759, + -251, -442, -92, 46, 99, 12, -1336, -1061, + 4427, -945, -861, -460, -306, 494, 481, 536, + -1101, -1105, 2695, 316, -801, -159, 1042, -577, + -78, 340, 2347, 1448, 135, -381, -688, -493, + -254, -234, -74, -80, -1047, -1246, -729, -985, + 5399, -1018, 643, 822, 889, 432, -328, -1386, + -1420, -702, -1450, 6927, -1107, 465, 1625, 1116, + -1258, 2847, -893, -895, -521, -263, 112, 157, + 556, 500, 182, -652, -226, 258, -638, -566, + -419, -669, -224, -221, -1197, -227, -582, 92, + 1914, -184, -11, -18, 270, 166, -1294, -62, + 1536, 2470, -413, -619, -399, 24, 106, 54, + -1223, 2672, 2400, -54, -577, -692, -301, -3, + 206, 89, -1424, -1491, 8425, -1072, -242, -420, + -194, -1, 489, 331, -938, -1319, 2493, -1355, + 551, 2297, 197, -9, 717, 434, -1237, -773, + -1021, 3945, -566, 116, 246, 150, 510, 370, + 11804, -457, -1006, -1231, -1175, -1086, -1221, 589, + -679, -757, -1183, 6502, -584, -454, -629, -570, + -413, -352, -279, -32, -1236, -946, -760, 1535, + -865, -712, -224, 343, 647, 613, -1348, -938, + -961, 8273, -1130, -591, -225, 210, 420, 140, + -1247, -1166, -966, -986, -1120, -907, -181, 470, + 1888, 1161, -1076, -1298, 3479, -1151, 2410, -396, + 1, -44, 357, 594, -896, 745, -33, -422, + -332, -259, 0, 48, 143, 190, -1009, -837, + -876, -371, -370, 1520, -150, 251, 240, 448, + -1024, -1008, -568, -450, -611, -536, 1763, -34, + 355, 454, -769, -599, -639, -737, -912, -725, + -504, -230, 532, 3294, -1077, -289, -875, -542, + -574, -604, -339, 2511, 479, 742, -1218, -946, + 1321, -522, -544, -950, -765, 632, 639, 497, +}; + +static const int16_t fcb16m[] = { + -940, -1197, -1190, -1200, -1192, -960, -718, 610, + 3300, 3253, -1515, -1689, -1798, -1798, -1793, -1764, + -1616, 33, 2377, 7778, -668, 1745, 1501, 785, + -336, -823, -708, -446, -455, -812, 8862, 159, + -1141, -1261, -1323, -1299, -1261, -1227, -1214, -1090, + 3584, 2092, 688, -531, -848, -1000, -1047, -1192, + -1104, -887, 5163, -347, -1129, -1285, -1336, -1291, + -1249, -1109, -498, 2511, -611, -703, -516, -240, + -68, 399, 1570, 252, -5, 43, -1163, -1168, + -1008, -921, -995, -569, 925, 1511, 1001, 2023, + 12926, 135, -1598, -1778, -1847, -1850, -1836, -1734, + -1695, -1690, 621, 4647, 588, -752, -973, -996, + -953, -1081, -1060, -672, -868, 259, 4940, -117, + -718, -907, -828, -776, -606, -981, -1002, -526, + -385, 527, 1501, -239, 38, 25, 112, -77, + 1122, -250, -352, -1113, -1101, -942, -681, 5156, + -800, -636, 5814, -160, -777, -825, -844, -747, + -697, -645, -668, -492, -936, 491, -280, 2573, + -269, -736, -375, -265, -98, -243, -920, -236, + 446, 1095, -666, -600, -246, 783, 282, 0, + -1064, -116, 2271, -118, -482, -240, -187, -271, + 36, 91, -695, -254, -383, -948, 745, 2722, + -129, -799, 238, -379, 2872, -516, -868, -623, + -551, -275, 22, 379, -185, -230, 1524, -672, + -1062, -1164, -1177, -1137, -1058, -790, 6, 4928, + -551, -389, -460, -394, -674, -586, -327, -178, + 615, 2868, -1467, -1203, -1316, -1120, -996, 747, + -219, 2023, 1875, 254, -871, -992, -1062, -1110, + -1149, -992, -492, 40, 528, 5374, 83, -559, + -862, -760, -541, 28, 207, 629, 502, 1260, + -473, -1110, -1336, -1390, -1412, -1379, -1329, -1081, + -238, 9844, -1332, -1306, -1275, -881, -1267, -1249, + -237, 2882, 3535, 584, -13, 52, -50, -4, + 7, 5, 20, -55, 5, 45, 1587, 350, + 191, 617, 153, -236, -336, -649, -798, -1063, + 1451, 707, 253, -733, -923, -859, -621, -738, + -555, 1623, 1727, -411, -724, -772, -746, -675, + -688, -209, 915, 622, -1038, -474, -343, -91, + -173, -104, 255, 96, 1547, 773, -625, 2272, + -90, -509, -527, -247, -147, -234, -45, 166, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const int16_t fcb16sl[] = { + -1337, -1122, -1559, -1452, -1353, -973, 3858, 1145, + 1225, 2103, -607, -181, 557, -429, 15, -496, + -444, -523, -1866, -1134, -1270, 3029, -1110, -798, + -824, -659, 44, 614, 1059, 1173, 714, -932, + -1095, -1061, -921, -1034, -873, 7, -872, 660, + -1335, -1496, -1623, -1405, -1070, -680, 943, 134, + -190, 2837, -1034, -221, -337, -540, -571, -173, + -411, 2314, -111, 970, -1220, -1036, -1096, -147, + 1087, 604, -367, 83, 461, 679, -1333, 194, + -1292, -1139, -1097, -570, -508, -109, 54, 962, + 2592, -1112, -944, -636, -521, 12, 230, 442, + 562, 624, -1107, -1190, 1554, -981, 1507, -1013, + -394, 595, 823, 1094, -1453, -1298, 242, -1185, + -686, -541, 858, 331, 695, 1197, -1259, 968, + -1180, -1254, -752, 1473, 222, 342, 973, 1029, + -1631, -1500, -1619, -1517, -1299, 1683, 2203, 1163, + 1225, 1497, -1189, -937, -931, 3193, -977, -708, + -262, 549, 917, 1465, 704, -565, -708, 846, + -130, -322, -257, 221, 367, 309, -1416, -1123, + -1323, -1260, -405, 3303, -210, 785, 1007, 1616, + -1043, -717, 44, 824, 419, -492, -579, -604, + -15, 676, -1067, -1079, 3897, -1211, -474, -1020, + -589, 114, 593, 1504, -1481, -1249, -1036, -1012, + -719, 846, -189, -297, -31, 1209, -1761, -1566, + -1449, -1645, -1464, 1422, 24, 2153, 1377, 1948, + -1480, 652, -929, -415, -689, -386, 1628, 489, + 487, 756, -1424, -805, 1241, 228, -697, -316, + 423, 660, 557, 587, 1248, -777, 1088, -848, + -498, -399, -60, 169, 497, 689, 5679, -778, + -1109, -1118, -895, -1042, -504, 390, 1670, 469, + 977, -929, -1173, -1058, -999, -696, 1912, 52, + 1297, 1081, -1469, -1243, -1055, 385, -529, 910, + 79, 508, 1225, 753, 656, -1307, -1239, -1470, + -1110, -1255, -362, 2351, 889, 1687, -1566, -1331, + -1410, -1385, 779, -499, -217, 936, 2064, 1493, + -1499, -1345, -1162, 790, -1115, -673, 2083, 1010, + 588, 1265, -1439, -1168, -1294, 752, -1421, -1234, + -169, -529, 1606, 2131, -1556, -1442, -1444, 487, + -1260, -1139, 360, 2528, 1994, 1686, -1548, -1473, + -563, -1125, 967, 1490, 1503, 487, 991, 1024, + -1430, -1151, -1215, -729, -746, -762, -472, 778, + 889, 774, -1329, -1129, 1383, -1230, -723, 1478, + 379, 161, 1266, 1238, -1467, -843, -1277, -1323, + -715, 58, -182, 5140, 762, 1723, -1285, 1134, + -1175, -1057, 1294, -4, -417, 557, 939, 1182, + 39, 565, -809, -703, -783, -883, -112, 412, + 1056, 691, -273, -1334, -898, -1345, -1069, -1247, + -105, 638, 6811, 1157, 982, -856, -805, -1093, + 1267, -747, -650, 311, 281, 1076, 1371, 1614, + -891, -886, -396, -246, -65, 77, 472, 605, + -943, 178, -509, 112, -142, 512, -66, 109, + 144, 76, 2934, -1203, -1428, -1525, -1269, -1618, + -1129, -184, -225, 3157, -249, -1276, -1055, -439, + -161, -268, 284, 614, 778, 670, -1243, 1682, + 919, -468, -479, -341, 31, 468, 325, 606, + -1081, -723, 83, -399, -275, -658, 240, 149, + 2746, 679, -1573, -1287, -494, 775, 975, -751, + -47, 1758, 652, 1155, -1465, -1073, -1087, -1026, + 289, 340, 448, 1348, 351, 682, 2065, -1183, + -1313, -1562, -466, -1546, -1077, -477, 3012, 2512, + -1560, -1532, -1441, -1229, 861, -421, 1515, 2195, + 1163, 1418, -1268, -1103, -804, -1094, 3254, -711, + -558, 713, 1414, 1684, 542, -781, -827, -814, + -245, 1129, -160, 210, 386, 618, -1633, 488, + -1584, -1571, -1349, -662, 711, 1516, 1661, 1673, + -1510, -1530, 1013, -1172, 425, -1415, -856, 2963, + 2258, 1919, -744, -1208, -863, -634, -729, -1068, + -857, -289, 701, 6703, -1502, -1353, -1531, -1372, + -1388, -1067, 1392, 100, 2570, 1703, -1551, -1500, + -1587, -1693, -1753, -1431, -1048, 1162, 1308, 3073, + -998, -1575, -517, -1346, -1293, -1493, -1375, -1109, + -803, 2972, -1446, -1316, -1114, -1405, -1240, -1057, + -1109, -589, 2623, 1626, -1555, -1026, -1346, -1467, + -902, 1291, 176, 630, 4293, 1949, -1233, -1362, + -930, -1175, -1118, -1375, -1172, -967, 4896, 4195, + -1744, -1562, -1797, -1815, -1577, -1194, 371, 3326, + 3183, 3071, -1425, -1773, -1562, -1358, -547, -246, + 24, -526, -1502, 29376, -860, -614, -857, -795, + 793, -616, 1691, -125, 156, 559, -1643, -1462, + -1523, -1413, -1251, -592, 1014, 1888, 243, 1041, +}; + +static const int16_t fcb16ss[] = { + 308, -532, -811, -974, -641, -431, 3409, 258, + 567, 641, 1315, -723, -738, -502, 142, 678, + -67, -170, 73, -65, 2717, -804, -958, -878, + -532, -562, 238, 497, 548, 718, -868, -669, + -932, -1004, -518, -502, -286, 405, 2987, 1420, + 174, -779, -748, -575, -153, -40, 340, 413, + 275, 387, 965, 82, -550, -744, -592, -591, + -604, -163, 428, 843, -1280, 1756, -368, 777, + -29, -453, -61, 43, 50, 137, 950, -229, + 1504, -491, -353, -167, -285, -158, -94, -185, + -1431, 303, 673, -758, -610, -308, 1247, 348, + 95, 31, 1631, 1963, -624, -770, -466, -150, + -122, -123, 34, -141, -883, -374, -948, -629, + 3420, -772, -392, -31, 603, 646, -760, -871, + -936, -948, -727, 3563, -376, 858, 699, 561, + -1370, 2366, -775, -1241, -1105, -247, 177, 432, + 414, 379, -1360, -1057, -945, -848, -568, -779, + -632, -328, -295, 425, -349, 630, -275, -527, + 438, 47, -194, -96, -239, -545, -1381, -689, + 1644, 1165, -437, -153, -193, 307, 183, 66, + -1335, 2590, 2169, -447, -435, -317, -82, 204, + 45, -145, -1324, -205, 4019, -973, -578, 28, + 175, 506, 235, -98, -908, -294, 1443, -850, + -556, 1707, -277, 58, 241, -188, -853, -572, + -577, 1258, 1007, -190, 1, -3, 103, -49, + 5385, 137, -707, -834, -510, -517, -392, -390, + -231, -275, -1249, 5229, -812, -893, -353, -663, + -29, 187, 45, 10, -1388, -1171, -1051, 412, + -379, -411, 240, 574, 632, 284, -838, -912, + -924, 3062, -695, -409, -224, 422, 293, 267, + -1436, -1237, -1303, -1305, -914, -243, 821, 839, + 1043, 1284, -1178, -496, 1594, -736, 1752, -601, + -396, 330, 231, 48, -1253, 808, -896, -967, + -653, -84, 4, 442, 363, 589, -1005, -672, + -687, -93, -274, 1376, -232, -52, 399, 255, + -1085, -1214, -1088, -748, 1036, 414, 220, 509, + 436, 499, -648, -765, -931, -983, -758, -543, + -379, -115, 780, 3327, -1086, -893, -773, -881, + -683, -11, -322, 3418, 739, 961, -1363, -929, + 899, -1005, -792, -338, -185, 702, 627, 638, +}; + +static const int16_t fcb16sm[] = { + -1125, -1385, -1439, -1387, -1120, -681, -135, 616, + 3086, 2537, -1440, -1209, -1027, -1209, -626, 173, + 662, 899, 861, 2180, 387, 1032, 936, 140, + -353, -302, -290, -330, -551, -1019, 3555, -68, + -441, -539, -500, -27, -423, -506, -522, -415, + 2347, 1890, -312, -742, -679, -679, -653, -609, + -433, -472, 2709, -755, -1153, -1066, -1028, -862, + -826, -315, 78, 1699, -363, -429, -690, -190, + -358, -667, 1909, 39, -1, 138, -1592, -1559, + -1357, -1554, -750, 813, 1676, 1537, 977, -269, + 8320, -602, -1140, -1153, -1136, -1174, -1004, -1091, + -1388, -1187, -507, 3103, -200, -665, -590, -381, + -365, -40, -295, -591, -963, 271, 2231, -547, + -65, -270, -64, 243, -183, -548, -796, -277, + -7, -168, 1575, -361, 35, -19, 192, -154, + -384, 144, -426, -528, -598, -778, -297, 1847, + 564, 218, 864, -654, -485, -435, 45, 709, + 630, -11, -691, -111, -775, -356, -522, 2247, + -79, -433, -620, 594, 79, 60, -828, -475, + 768, -79, -655, 550, -201, 77, 858, -11, + -803, 1173, 1027, -971, -656, -648, -40, 17, + 720, 176, -1055, -936, -258, 550, 1086, 1065, + 0, -473, -364, 30, 53, -6, -54, -24, + 21, -81, -88, -45, -14, 81, 674, -1189, + -1049, -846, -489, -24, -47, 165, 658, 1909, + -241, -390, -387, -454, -319, -549, -307, -112, + 778, 1486, -314, 34, -93, -799, -538, 2219, + -445, 39, -38, -258, -427, -943, -760, -602, + -575, -450, 376, 668, 879, 1215, -1216, -784, + -646, -291, 275, 1019, -77, 124, 256, 1166, + -410, -993, -1145, -1118, -940, -825, -560, -131, + 1006, 4878, -1401, -1286, -1316, -1394, 177, -919, + 162, 2292, 1792, 1242, -762, 937, -168, -900, + -829, 203, 1225, 626, -122, -515, 992, -198, + -782, -25, 74, 1019, -606, -364, -350, -5, + 451, 324, 265, -1143, -820, 382, -362, 85, + -797, 693, 1594, -335, -229, -396, -211, -356, + -97, -115, 92, 49, -476, -1124, -1084, -594, + -228, 728, 16, 589, 1213, 841, -829, 1874, + -907, -1000, 1411, -621, -707, 356, 437, 37, +}; + +static const int16_t fcb22l[] = { + 2735, -1224, -1198, -1073, -1115, -1054, -713, 1693, + -1106, -1259, 722, -1256, -1223, 1686, 1589, 2003, + -906, 2529, 2141, -396, -338, -36, 52, 476, + 319, -420, 561, -492, -526, -359, -221, -254, + -752, -1136, -690, -896, 4307, -363, -42, 1363, + -717, -1036, -874, 2315, -952, -872, 262, 1418, + 737, 1374, -506, -470, -275, -126, 242, 428, + -678, -681, -581, 1016, -553, -509, -485, -408, + 9595, -1015, -1168, -932, -812, -690, -167, 753, + -935, -439, 2105, -526, -710, -570, 9, 548, + 530, -1308, -1060, -351, -974, -1038, 93, 5579, + -737, -1282, 1386, -1284, -1243, -1105, 790, 2169, + -701, -660, -555, 1317, 2805, 792, 2209, -490, + -758, -1262, -1083, -1073, 930, -810, -170, 2326, + -1213, -1286, 3435, -1135, -1051, 220, 3040, 1999, + -933, -663, -714, -855, -372, -599, -437, 373, + 5873, -987, -1081, -1003, -747, -271, 582, 1069, + -917, -754, 5676, -565, -616, -396, 177, 908, + 3106, 1459, -678, -543, -340, 47, 336, 493, + -1060, 1427, -560, -763, -710, -661, 193, 595, + -996, 2488, -588, -752, 1306, 114, 292, 689, + -1202, 2334, -1173, -1167, -755, 353, 1711, 1572, + -932, -751, 2099, 2025, -417, 62, 458, 611, + -981, 4387, -639, -560, -520, -152, 262, 748, + -828, -818, -682, 5250, -640, -270, 385, 1049, + -1072, -774, 1870, -668, 1514, -158, 283, 793, + -1087, -1150, -899, -875, -188, -184, 6656, 2311, + -906, 1654, -446, 1677, -654, -101, 364, 721, + -1272, 7928, -812, -576, -708, -347, 397, 1128, + 3830, -1034, -1055, 2244, -759, -706, 79, 893, + -922, -1067, 2740, -868, -858, 1129, 34, 1096, + 2455, -694, 1970, -650, -674, -131, 370, 697, + -1069, -1137, -948, -1045, -1087, -964, 367, 1091, + 4096, -960, -921, -870, 1397, -511, -190, 545, + -657, -1194, -536, -951, -1094, 117, -720, 2532, + -1098, -1147, -1177, 1764, -757, -121, 2372, 2010, + 3662, -952, -995, -894, -625, 464, 731, 863, + -607, -505, 401, -423, -540, 2144, 755, -430, + -1499, -1242, -1202, -1190, -626, 1249, 3388, 2379, + -983, -1090, -907, -1021, -1012, -870, 2723, 1589, + -913, 332, -102, 99, 226, 6, 176, 354, + 156, -36, -829, -774, -685, -15, 498, 503, + 2030, -409, -599, -572, -341, -2, 111, 302, + 788, -1002, -978, -929, -1001, -886, 578, 995, + 1237, -747, -696, -653, 1143, 62, 506, 571, + 994, -993, -902, -871, -662, 1527, 370, 979, + 980, -466, -484, 787, -261, 61, 250, 377, + -112, -676, -535, -344, 274, 363, 185, 334, + -48, -1144, -1095, -1011, -552, 445, 1355, 1207, + -1108, -1128, -1085, -826, -83, 2001, 1265, 1429, + -1024, 1199, -671, -701, -444, 1192, 187, 673, + -1039, -1056, -953, -732, 359, 714, 787, 935, + -1187, -1133, -1112, -971, 2158, 1720, 801, 2016, + -1056, -1068, -889, 1808, 503, 892, 358, 1041, + -1180, -1184, -1068, -788, 1423, -573, 2141, 1949, + -1042, -924, -849, 512, -629, -272, 779, 815, + 1939, -1069, -1092, -1027, -770, 48, 1554, 1285, + -1109, -1148, -1157, -1033, -934, 779, 1358, 1560, + -1053, 222, -1095, -1001, -681, -26, 1112, 1035, + -1168, -1285, -1169, -1180, -1085, -1097, 1313, 3112, + -928, -655, -811, -618, 1555, -480, 71, 467, + -1220, -1123, -1008, -577, -845, 3854, 491, 1878, + -1051, -761, 617, -650, -453, 51, 784, 757, + -993, -883, -905, -708, -869, 969, -64, 655, +}; + +static const int16_t fcb22s[] = { + 9854, -479, -1163, -1147, -1316, -1137, -991, -942, + 522, 739, -1042, -1306, -1040, -126, 1147, 3526, + 1880, -477, -483, -328, -899, 1063, 1243, -610, + -721, -527, -372, 171, 90, 196, 6615, -1167, + -1189, -1079, -954, -817, -833, 2246, 439, 1038, + -1053, -1136, -938, -805, -1022, -1041, -717, 2021, + 341, 935, -1164, -1230, -573, 1768, 11111, -1113, + -874, -631, -367, 7, -1077, -925, 1558, -850, + -918, -755, -512, 452, 260, 400, -787, -966, + -690, -584, -843, -802, 2092, 120, 103, 580, + -746, -512, -241, -621, 2771, -486, -268, 258, + 171, 232, -1265, -1253, 15128, -1123, -1037, -885, + -1109, -664, -659, -240, 1558, -909, -1160, -1247, + -1223, -1031, -989, -415, 3504, 1569, -651, -1241, + -1145, -1014, -1322, -1000, -354, 59, 709, 4206, + -1124, -986, -633, -976, -907, -636, -371, 255, + 1195, 876, -145, -1146, -1018, -992, -480, -762, + 6904, -703, -431, 1043, -1048, -638, -142, 394, + -852, -730, -533, -361, 234, 221, -1070, -930, + -764, 3210, -780, -256, 1777, 258, 307, 382, + -1224, 987, 4894, 3525, -412, -558, -819, -863, + -572, -497, -1175, -1197, 7637, -1109, -748, -116, + -306, 27, 386, 630, -1334, -1378, -1302, 12592, + -1327, -971, 89, -731, 259, 201, -1135, -951, + -585, -64, 3489, 2765, 43, 75, -527, -162, + 2865, -1344, -1394, -1391, -1231, -748, -962, 5403, + 719, 1418, -724, -1101, -955, -743, -937, -1064, + -1095, -601, -60, 411, -1113, -873, -603, 2913, + 2512, -339, -36, 26, -39, 78, -757, -998, + -522, -838, 5507, -973, 796, 536, 250, 312, + -1363, -944, 6021, -58, 5313, -690, -549, -485, + -66, -133, -1257, 6004, 6374, 1487, -976, -987, + -969, -803, -1027, -624, -967, 1744, 3504, 6, + -659, -691, -326, -129, -49, 148, -1032, -683, + 1819, 1804, -491, -452, -295, 33, -20, 42, + -1226, -1086, -792, 6412, -657, -278, -103, -25, + -82, 207, 2450, -6, 2417, 251, -622, -593, + -409, -193, -339, -304, -862, -667, 2457, -500, + -438, -504, 1408, 143, 203, 265, -1128, -1148, + 2791, -373, -951, 2129, -842, -278, 81, 307, + -787, -822, 2655, -604, 2028, -787, 4, 335, + 170, 219, 649, -457, 972, -607, -359, -470, + -238, 68, -57, 107, 2285, -526, -490, -604, + 179, -41, 230, 64, 20, 50, -802, 1168, + -235, -264, -316, 1469, -499, 108, 183, 150, + -1068, -806, -399, 1244, -355, 487, -57, 450, + 195, 248, -1122, -1096, 3327, -956, 1084, 1306, + 247, 442, 169, 283, 3416, -609, -891, -879, + -853, -573, -285, -147, 380, 608, 1271, -874, + -931, 40, -989, 1432, 1981, -34, 285, 190, + -902, -974, 4117, -868, -784, -584, -358, 200, + 261, 521, -945, -981, -773, 3517, -961, 2420, + 9, 318, 187, 322, -1006, -779, -526, 2972, + -712, -578, -576, 167, 156, 270, 460, -74, + -237, 939, -440, -515, 126, 63, 82, 67, + -1069, -1104, -923, -634, -190, 1151, 526, 2920, + 125, 566, -1144, 4199, 1314, -458, -568, -336, + -515, -332, -352, -143, -770, 283, -770, -785, + -807, -348, 93, 427, 181, 334, -798, -830, + -300, -509, 1257, -554, 1341, 6, 242, 272, + -1030, 62, 1293, 340, 752, -493, -6, -34, + 33, 85, -893, -1202, 244, -131, -306, 7590, + -832, 420, 80, 423, -799, -870, -930, -720, + -640, 2390, -409, -177, 91, 370, -864, -949, + 838, -574, -234, 555, 46, -9, -83, 146, + -825, -478, -664, -57, 867, -296, -380, -73, + 70, 171, -1124, 10522, -228, -609, -958, -1025, + -548, -384, -257, 55, 5414, 436, -651, -748, + -671, -525, -25, -273, -264, 57, -1129, 1974, + -145, 1650, -317, -514, -305, -78, -154, 59, + 1269, 1008, -510, -711, -534, -358, 194, 117, + 102, 57, -837, 1260, -126, -494, 47, -162, + 924, -72, 130, 97, 742, -803, -711, -755, + -402, -188, 24, 309, 187, 379, -1092, 5862, + -647, -807, -715, -696, -408, -29, 104, 353, + 3298, 2193, -263, -772, -908, -754, -449, -164, + -157, -44, -986, 2313, -596, 56, 2057, -478, + 74, -51, 51, 121, -899, 1793, -595, -669, + -743, -689, -546, 71, 201, 382, -1061, 3375, + -776, -876, -648, -407, -44, 260, 258, 393, +}; + +static const int16_t fcb22m[] = { + 11522, 868, -1444, -1572, -1674, -1745, -1844, -1616, + -1723, -1508, 27, -321, -693, -597, -374, -380, + 327, 209, 611, 1182, -548, 176, -544, -485, + -341, -376, -383, 1024, 1316, -4, 192, -649, + -979, -945, -802, -183, 3749, 812, -416, -527, + -734, 1059, -521, 924, -462, -631, -76, 182, + 126, 100, -653, -643, -1189, -1264, -1312, -1311, + -1212, -1016, -218, 8415, -1005, 734, 1303, -272, + -397, -521, -245, 389, 242, -234, 458, -912, + -1215, -1228, -1288, -1131, -845, -404, 912, 5497, + 413, 3161, -432, -148, 1704, -663, -996, -1009, + -1419, -929, -36, -471, -640, -571, -197, -573, + -462, 2586, -179, -382, -757, -895, -1096, -1140, + -1216, -1051, -688, -44, 3311, 3518, -474, 2530, + 1475, -676, -702, -777, -380, -316, -538, -468, + -708, 542, -213, -713, -911, -482, -696, -135, + 1282, 2006, 5707, 476, -707, -771, -650, -788, + -778, -853, -962, -926, 10, -11, 3, 1, + -12, -14, 21, 7, -13, -10, -1410, -1712, + 1379, 5757, 218, -1232, -563, -929, -684, -827, + -261, 1040, -154, -309, -99, 62, 856, 199, + -614, -926, -626, 1568, -258, 374, 1071, -140, + -250, -332, -832, -706, -863, -714, -749, 3081, + 498, -695, -395, -600, -279, 588, 245, 3122, + -329, -677, -262, 67, 19, -530, -882, -862, + -1033, -160, 1542, 1916, -416, -600, -553, -219, + -130, -497, -699, 1719, 160, 3293, -212, -923, + -1045, -761, -1238, -1038, 1543, 738, -548, -541, + -403, -281, -115, -95, -313, -19, -292, 1136, + 3592, 696, -654, -856, -726, -693, -1057, -1267, + -722, -381, -683, 1364, -30, 589, 454, 262, + -57, -1018, -312, 846, -139, -587, -127, 2482, + -178, -233, -977, -796, -6, 250, 220, 1577, + 1141, -251, -649, -809, -1051, -873, -762, -990, + -1010, -890, -897, -639, -671, 1964, 788, 2310, + 6001, 20, -1008, -1159, -1208, -1208, -1318, -1227, + -829, 1680, -1023, -998, -1224, -945, -769, -41, + 2033, 196, 917, 1615, 2026, -654, -1014, -918, + -750, -675, -839, 1541, 282, 430, -1059, -708, + -507, -522, -169, 438, 196, 835, 778, 897, + 420, 526, 1239, 198, -736, -953, -835, -229, + -348, 726, -767, 1311, 248, -353, -550, 1017, + -250, -732, 256, -175, -638, 763, -761, -957, + -554, 539, 252, 299, 431, 613, 4398, -378, + -1022, -1020, -990, -757, -621, -83, -34, 122, + -476, 77, -799, -116, 4546, -787, -735, -462, + -875, -907, -1373, -1354, -1355, -1220, -1024, -88, + 1298, 2844, 940, 1135, 2261, 2142, 181, -735, + -924, -941, -799, -715, -662, 86, -719, -521, + 115, -576, -699, 1052, 1295, -57, 42, 230, + 2876, 501, -294, -158, 104, -157, -515, -662, + -987, -1069, -703, -985, -1061, -946, -878, -267, + 397, 132, 534, 3642, 1298, -560, -701, -526, + -294, 197, 310, 75, -3, 267, -342, 2058, + -328, -427, -709, -688, 14, -43, 237, 506, + 2822, -337, -900, -818, -638, -192, 883, -14, + -271, -559, 2822, -165, -988, -933, -917, -603, + -583, -397, 467, 1092, -1044, -479, 2478, -386, + -535, -253, 63, -49, 79, 27, -182, -100, + 362, -628, -661, -707, 1557, 136, 335, 89, + -197, 5697, 220, -473, -472, -1053, -1023, -1087, + -1203, -756, -377, -917, -925, -568, -237, 1422, + 197, -98, 614, 867, -831, -829, -969, -720, + 414, 1080, 1707, 828, -121, -757, -1044, -289, + 816, 284, 809, -84, -22, -552, -9, 193, + -359, 66, -582, -674, 1992, -31, 58, 427, + -515, -299, 932, -608, -1103, -1068, -1016, -770, + 200, 1031, 1112, 1026, -598, -818, -891, -635, + -828, -866, -650, 4795, -407, 215, -853, 373, + -696, 159, 995, 465, -509, 109, 60, 10, + 8455, 198, -999, -1131, -1111, -1195, -1246, -1192, + -1181, -934, -365, -764, -689, -589, -734, 2479, + -960, 1279, 104, -209, -1012, -824, -1059, -921, + -812, -204, 199, 601, 3136, 637, 3021, 3851, + -490, -18, -930, -1081, -1133, -1182, -1268, -980, + -864, -945, -278, 961, -514, -123, 562, 874, + -130, 336, 3314, -331, -1112, -1162, -1227, -1230, + -1172, -988, -319, 3582, 890, 50, -681, -788, + -906, -876, -829, -827, -41, 3416, -740, -913, + -893, 404, 2059, -651, -474, 302, 516, 578, +}; + +static const int16_t fcb22sl[] = { + 1098, -1107, -1125, -983, -770, -233, 201, 823, + -1433, -1294, -17, -1156, -301, 1185, 1307, 1108, + -1247, 1829, 1353, -537, -457, 116, 574, 712, + 159, -489, 511, -340, 54, 119, 213, 351, + -1489, -1256, -1324, -1132, 3710, 262, 1087, 1465, + -1434, -1027, -1116, 825, -662, -428, -109, 1045, + 229, 753, -604, -422, 122, -220, 279, 375, + -349, -684, -197, 490, -160, -116, -120, 146, + 5195, -895, -974, -758, -524, 21, 761, 1016, + -1216, 151, 864, -602, -715, -591, -347, 592, + -1265, -1328, -1375, -878, -660, -549, 143, 4302, + -1433, -1277, 360, -1032, -835, -385, 337, 1111, + -1345, -1250, -1156, 914, 1594, 22, 912, 1012, + -1576, -1411, -1364, -1153, 842, -184, 240, 1302, + -1486, -1162, 1246, -880, -830, 14, 2487, 1607, + -1384, -158, -572, -977, 43, -30, -184, 572, + 2759, -892, -768, -522, -289, -44, 351, 575, + -1292, -546, 3736, -609, -538, -25, 514, 924, + 1772, 1639, -903, -595, -263, 340, 579, 670, + -1425, 770, -1179, -920, -1158, -675, 496, 1208, + -1337, 1240, -1030, -1044, 1840, 312, 809, 908, + -1457, 1410, -1240, -1083, -541, 568, 2768, 1432, + -1249, -890, 1078, 1278, -558, 63, 573, 778, + -1285, 1932, -1004, -902, -339, 59, 17, 659, + -1352, -935, -877, 3421, -455, 160, 820, 1230, + -1326, -978, 986, -790, 1541, 41, 542, 743, + -1491, -1162, -1389, -1265, -928, -139, 5045, 2259, + -1182, 1358, -953, 1338, -502, 122, 749, 839, + -1284, 4389, -1001, -813, -421, 44, 855, 1072, + 1658, -881, -821, 1409, -299, 4, 453, 700, + -1144, -1112, 1230, -790, -421, 1250, -12, 655, + 1545, -872, 1199, -632, -365, 56, 415, 663, + -1401, -1189, -1403, -1189, -1145, -687, -116, 1120, + 1768, -1068, -1024, -629, 1440, 88, 578, 711, + -1651, -1561, -1564, -1430, -1037, 1264, -21, 1944, + -1552, -1336, -1277, 916, -412, 27, 2454, 1661, + 1996, -1087, -1223, -924, -393, 1673, 794, 1017, + -1362, -132, 151, 537, -992, 1830, 777, 991, + -1591, -1355, -1494, -1420, -666, 2407, 3210, 2092, + -1114, -624, -1087, -903, -808, -438, 1881, 654, + -1140, 254, -105, 212, 386, 49, 256, 314, + 83, 98, -1128, -901, -578, 362, 702, 691, + 1191, -204, -335, -226, -102, -44, -5, 120, + 57, -1110, -403, -651, -806, -202, 567, 690, + 349, -908, -1075, -941, 1487, 464, 763, 782, + 387, -1070, -990, -765, -295, 1669, 341, 881, + 232, -1013, -1043, 723, -311, 294, 646, 574, + 72, -1191, -546, -183, 493, 161, 201, 465, + -185, -1434, -1368, -1051, 64, 385, 748, 986, + -740, -530, -1199, -562, 142, 1388, 1487, 715, + -1359, 873, -1187, -923, -455, 1914, 403, 1016, + -1245, -1223, -624, -495, 724, 652, 433, 585, + -1499, -1277, -1381, -1148, 1679, 2138, 995, 1424, + -1345, -1319, -1296, 906, -228, 1534, 506, 1024, + -1628, -1410, -1422, -1197, 1393, -22, 2728, 1784, + -1245, -1056, -942, 2, -165, -115, 840, 569, + 1016, -1191, -1091, -862, -457, 95, 2087, 1029, + -1460, -1486, -1459, -1104, -571, 925, 1234, 935, + -1568, -49, -1325, -1255, -64, 315, 838, 962, + -1651, -1562, -1606, -1571, -1308, -380, 1988, 2117, + -848, -412, -987, -370, 1224, -304, 10, 498, + -1523, -1348, -1373, -959, -772, 3767, 621, 1773, + -931, -628, 169, -513, 61, -306, 994, 476, + -1116, -879, -875, -484, -795, 958, -162, 444, +}; + +static const int16_t fcb22ss[] = { + 6765, -638, -1108, -977, -679, -446, -325, -432, + -127, 96, -569, -621, -1050, -841, -800, 1474, + 1170, 60, 330, 223, -1317, 855, 307, -931, + -648, -549, -148, 535, 642, 445, 3666, -1146, + -1167, -944, -584, 942, -284, 25, 573, 472, + -1041, -1096, -1209, -1082, -770, -737, -139, 2073, + 753, 832, 507, -828, -1112, -1130, 4284, -722, + -261, -57, 499, 300, -1380, -1130, 135, -898, + -816, -395, 195, 453, 650, 537, -953, -1109, + -1221, -981, -747, -647, 2360, 467, 845, 684, + -1177, -792, -1254, -1148, 1344, -745, -323, 180, + 729, 739, -1020, 183, 5226, -638, -358, -86, + -268, -143, 84, -115, 480, -543, -1229, -1097, + -594, -983, -792, -391, 2637, 1405, -761, -866, + -1186, -973, -792, -640, -220, -102, 1165, 3159, + -1241, -1057, -1322, -1007, -731, 44, 264, 668, + 2645, 1592, 2885, -1155, -1347, -1209, -309, -1161, + 4216, -64, 830, 616, -688, -638, -596, 202, + -665, -623, -499, -248, 512, 749, -1395, -708, + -1086, 1209, -745, -367, 1397, 279, 374, 259, + -1357, -254, 2310, 1839, -147, 36, -402, 300, + -49, 47, -1328, -992, 3453, -889, -621, 135, + 437, 70, 663, 346, -1339, -1136, -1275, 6675, + -1309, 2285, -869, 1154, 640, 617, -505, -1042, + -984, -702, 1283, 1573, -168, 135, 249, 253, + -783, -1119, -1342, -975, -1127, 1391, -705, 4439, + 1160, 845, -1283, -1224, -1286, -1142, -1019, -901, + -658, -157, 231, 611, -994, -463, -1017, 1082, + 1831, -459, -164, 114, 0, 108, -1386, -1079, + -1318, -1091, 2540, -717, 762, 1414, 849, 576, + -1405, -566, 2704, -996, 2133, -678, 404, 281, + 4, -32, -1474, 3530, 2301, -711, -919, -305, + -125, 184, 450, 73, -1132, 1567, 1620, -551, + -198, -645, 19, 8, 190, 191, -741, -728, + 410, 1067, -322, -239, 86, 11, -137, -220, + -489, -607, -963, 3630, -624, -478, -12, 124, + 219, 63, 2040, 75, 1338, -293, -333, -336, + -330, -246, -360, -344, -953, -393, 1550, -701, + -616, -254, 1908, 211, 328, -43, -1089, -299, + 1070, -723, -923, 2170, -400, -13, -28, 108, + -812, -400, 876, -650, 1308, -772, -256, -200, + 117, 329, 649, -639, 437, -704, -567, -20, + -211, 197, 330, 342, 1670, -468, -920, -588, + 972, -310, 9, -46, 70, -29, -1313, 1684, + -794, -979, -752, 1864, -173, 108, 248, 292, + -1247, -1226, -1059, 288, -112, 189, 20, 540, + 454, 380, -1035, -803, 1267, -767, 746, 1331, + 107, 317, 158, -116, 2093, -723, -1064, -906, + -713, -789, -518, 48, 494, 1018, 1835, -1353, + -1303, -1098, -559, 800, 520, 662, 615, 574, + -1282, -526, 1829, -1086, -885, -356, -539, -50, + 493, 402, -777, -374, -754, 1721, -701, 2086, + -348, 218, 138, 109, -1367, -1226, -1041, 1949, + -433, -291, -363, 567, 613, 560, 1166, -481, + -737, 1193, -479, -163, -69, 2, 133, 239, + -1444, -1448, -1350, -987, -296, 606, 755, 543, + 741, 806, -851, 2437, 23, -681, -670, -271, + -439, -227, -243, -198, -1307, 424, -1212, -987, + -745, -369, 162, 641, 915, 611, -24, -728, + -1061, -659, 808, -532, 1241, -233, 266, 353, + 175, 210, -262, -328, 101, -238, 66, -339, + -472, -415, 952, -1490, -1302, -955, -1270, 5776, + -792, 777, 1097, 807, -1334, -1172, -1211, -924, + -877, 2458, -355, 593, 936, 699, -336, -700, + -762, -569, -337, 642, 97, 441, -188, -533, + -1062, 188, -873, -801, 418, -167, -57, -29, + 79, 241, -1110, 6430, -816, -807, -462, -601, + -56, -45, 188, 74, 2869, 43, -1122, -799, + -772, -847, 1394, -36, 294, 13, -1304, 2155, + -534, 1545, -315, -325, 183, 31, 372, 187, + 873, 1376, -1037, -810, -516, -235, 485, 99, + 287, 327, -1074, 1203, -1089, -882, -515, -544, + 2041, -40, 208, 191, 597, -1141, -1274, -885, + -386, 106, 593, 394, 671, 678, -1292, 3861, + -1085, -1150, -748, -218, 500, 55, 335, 469, + 3217, 2888, -882, -643, -590, -506, 43, -459, + -210, -222, -965, 2453, -830, -779, 1808, -588, + 130, 4, 130, -23, -1269, 1374, -1238, -1148, + -523, -659, -170, -302, 1055, 1389, -1467, 2505, + -930, -1181, -842, -516, 399, 886, 849, 738, +}; + +static const int16_t fcb22sm[] = { + 5761, -398, -743, -948, -944, -845, -883, -896, + -811, -604, -1142, -1388, -1190, -685, -118, 1498, + 1590, 293, 564, 352, 124, 851, -131, -652, + -573, -279, -756, -478, 833, 670, 2609, -1138, + -1107, -1024, -739, -646, -387, 33, 635, 1037, + -717, -990, -1161, -948, -660, -230, 69, 2510, + 1274, 841, -49, -872, -764, -211, 3046, -30, + -143, -311, -324, -413, -760, 67, 619, -699, + -725, 305, -484, 1292, 472, -156, -568, -1243, + -1256, -994, -803, -386, 1692, 596, 1325, 1290, + -492, -1007, -732, -788, 1136, -610, 45, 1307, + 420, 649, -534, -1075, -949, -367, 219, 444, + -120, 251, 476, 1806, 902, -927, -1151, -879, + -659, -741, -5, 298, 1861, 995, -244, -1031, + -1142, -1085, -952, -773, -468, -9, 1637, 3592, + -971, -1150, -1199, -985, -689, -317, 150, 540, + 2727, 1678, -223, -403, 102, -902, -773, -223, + 3182, -457, 75, -188, -291, -428, -101, -365, + -442, -336, -128, -33, 781, 1242, 501, -753, + -846, 757, -444, -311, 1182, 4, -8, -122, + 1866, -528, -142, 1598, -15, -219, -557, -804, + -916, -965, 114, 130, 3672, -19, -873, -280, + -777, -919, -824, -654, 1078, 39, -50, 119, + -411, -311, -359, -57, -137, 7, -780, -892, + -767, -167, 1302, 1693, -205, -51, -174, -71, + 838, -220, -1133, -993, -710, -340, 650, 1341, + 191, -5, 743, -543, -125, -567, 70, -42, + -501, -448, 47, 1151, 400, -774, -781, 1324, + 1089, 32, -256, -415, -352, -214, 912, -1141, + -988, -638, 1349, 251, 124, -4, 89, -16, + -678, -569, 1502, 146, 114, 816, -98, -269, + -622, -808, -634, 3319, 1218, -323, -750, -548, + -525, -575, -591, -730, 35, 764, 1423, 574, + -352, -672, -802, -314, -308, -29, -1040, -717, + 469, 421, -527, -420, 589, 195, 556, 472, + -626, -864, -133, 3531, -667, -460, -523, 103, + 23, -309, 2381, 136, 1197, -399, -399, -501, + -638, -899, -813, -707, -249, 719, 821, -989, + -629, -568, 642, -4, 297, 70, -1105, 454, + 400, -235, -562, 1607, -116, -205, 1, -490, + 7, -523, 764, 329, 992, -240, -249, -275, + -366, -265, 662, -803, 393, -567, -501, -32, + 178, 371, 126, -146, 1748, -516, -634, -395, + 268, 893, 154, -36, -620, -999, 304, 1490, + -512, -821, -479, 1922, -610, -481, -482, -805, + -996, -16, -567, 542, -22, 589, -114, 69, + 322, 358, -848, 1205, 509, -527, 25, 111, + -243, -197, -20, 62, 1500, -977, -974, -391, + -555, 448, -256, 79, 392, 547, 1472, -1276, + -1203, -987, -315, 515, 855, 183, 231, 62, + -1176, -397, 2831, -527, -575, -435, 174, -337, + 723, 107, -502, -765, -455, 1124, -218, 1444, + 53, -201, -135, -267, -510, -1058, -869, 1130, + -128, -394, 16, 873, 597, 455, 16, 0, + -11, 14, -12, 9, 6, -14, -11, -23, + -453, -1056, -988, -713, -267, 794, 954, 1361, + 822, -448, 379, 1163, 336, -724, 55, 109, + 237, -80, -732, -1017, -264, 654, -1043, -1015, + -654, 91, 17, 548, 504, 932, -1057, -1151, + -964, -130, 1171, -146, 740, 134, 790, 539, + -591, -577, -388, 154, 609, 341, 657, 838, + -379, -872, 711, -665, -818, -549, -151, 2501, + -28, -189, -255, -378, -363, -1157, -929, -887, + -338, 1926, -33, -26, 1009, 765, -79, -98, + -37, -967, -566, 1012, 905, -245, 41, 322, + 194, -148, -220, -171, -239, -242, -147, -14, + 221, 575, 1754, 3059, -246, -713, -696, -636, + -640, -843, -841, -755, 2554, -504, -568, -318, + -324, -171, -294, -238, -288, -174, -289, 1273, + -231, 1053, -284, -338, -394, -227, -303, -226, + 966, 742, -873, -503, -586, -286, 119, -59, + 339, -38, -843, 977, -448, -238, 227, -77, + 729, 6, 45, -493, 277, -1385, -1289, -846, + -117, 376, 763, 553, 769, 670, -652, 3280, + -762, -882, -396, -299, 124, -270, -31, -210, + 2413, 644, -790, -912, -581, -507, -110, -408, + -54, -30, 632, 969, -632, -206, 955, -95, + -578, -337, -377, -467, 1264, 67, -854, -863, + -909, -751, -616, -479, 563, 2070, -972, 1478, + -450, -715, -859, -689, 190, 736, 617, 530, +}; + +static const int16_t fcb44sl[] = { + 2433, -925, -1015, -1009, -875, -276, 378, 464, + 694, 795, -1044, -601, -658, 257, -898, -509, + -346, 2160, 694, 952, -1302, -619, 502, -378, + -624, -178, 349, -100, 204, 546, -1450, -1127, + -1302, -1297, -1051, -840, 3426, 1346, 1577, 1723, + -1267, -710, -872, 448, -1023, -728, -521, -134, + 874, 936, -1134, -549, 203, -932, -1051, 755, + -608, -199, 858, 1008, 1819, -842, -773, -739, + 818, -371, 289, 293, 656, 704, 308, -1009, + -959, -1089, 466, -468, 279, 897, 764, 797, + -1433, -1276, -1253, -1326, -1182, -992, -85, 4339, + 2135, 2136, 1131, -917, -966, -859, -889, 1178, + 62, 659, 771, 882, 1844, -607, 1184, -766, + -805, -385, -61, 502, 648, 732, -1245, 1315, + -818, -827, 621, -588, 193, 480, 649, 776, + -1178, -1202, -1152, -1088, -857, -191, -49, 129, + 1950, 1237, -1461, -1290, -1342, -1401, -1338, -1213, + -623, 224, 4086, 2517, -1150, -814, -747, 916, + 807, -288, 319, 436, 560, 718, 392, -973, + -988, 411, -954, -502, 214, 621, 856, 831, + -1268, 4012, -852, -1002, -1014, -577, 32, 552, + 987, 1138, -1205, -1319, -1145, -928, 80, 371, + 277, 779, 859, 902, -1141, -991, -957, 707, + -892, 1098, 126, 381, 668, 870, -1254, -995, + -1163, -926, -1149, 2572, -17, 747, 1456, 1509, + -1004, -867, 1205, -797, 938, -657, 346, 520, + 782, 872, -1328, -1080, -1111, -1067, 2227, -892, + 665, 1604, 1425, 1477, 1869, -668, -712, 1044, + -800, -139, 0, 355, 609, 717, -1192, -632, + 3546, -780, -870, -501, 141, 504, 921, 1027, + -1125, -1087, 1154, -660, -987, 937, 82, 1390, + 1360, 1243, 1259, -550, -769, -787, -743, -362, + -12, 177, 321, 505, -1147, -899, -947, -849, + 1371, -462, -127, 16, 752, 954, -1405, 448, + -1181, -1259, -1204, -868, -468, 110, 1293, 1263, + -1267, -1180, -1238, -930, -940, 916, 1793, 653, + 1070, 1137, -216, -997, -845, -659, -699, -174, + 758, 961, 417, 630, -1123, 1691, 1229, -732, + -937, -491, -78, 265, 744, 864, 4771, -856, + -1005, -1007, -934, -484, -17, 579, 861, 959, + -1264, 70, -961, -864, -860, -302, 314, 788, + 487, 686, -1133, -790, -466, 561, -812, -256, + 2078, -58, 757, 953, -1133, -286, -655, -476, + -23, -629, 7, 182, 426, 504, -1110, 314, + 497, -822, -662, -754, 1179, 1726, 696, 955, + 1793, -1143, -1268, -1279, -1207, -873, -183, 1546, + 1440, 1305, -1278, 1396, -779, 558, -840, -32, + -18, 257, 616, 757, 265, -906, 499, -897, + -846, -435, 362, 434, 752, 732, 453, 150, + -1029, -1182, -1195, -940, -297, 876, 1084, 1051, + -1377, 1354, -1148, -1313, -1211, -937, -366, 1942, + 1323, 1410, 311, -270, -81, -159, 42, 42, + 7, 357, 255, 285, 1973, 1386, -752, -873, + -916, -466, -39, 493, 638, 759, -1338, 1107, + -1081, -1165, -1038, -484, 1722, 534, 1038, 1102, + -1446, -1212, -1337, -1452, -1422, -1291, -690, 1634, + 1348, 1640, -1044, -184, -757, -683, -100, 1044, + 369, 349, 432, 584, -1137, -528, 1425, 1294, + -842, -257, -32, 289, 639, 796, -1418, -1229, + -1282, -1391, -1421, -1234, -852, -765, 737, 2076, + -1104, -928, -936, -1088, 378, -765, 1603, 581, + 753, 925, -1191, -841, -919, 2886, -907, -232, + 180, 543, 956, 1070, -1314, -843, 804, -1094, + -1209, -1031, -626, 698, 1049, 1152, 256, 831, + -841, -814, -841, -54, 134, 347, 535, 658, + 104, -801, -959, -519, -406, 156, 12, 13, + 380, 494, -1144, -1112, -973, -965, -916, -474, + -225, 460, 402, 734, -1448, -1316, -1278, 231, + -1086, -578, 584, 1115, 1275, 1260, -1321, -963, + -1127, -1288, 41, -1102, -31, 1331, 1003, 1145, + 112, -1270, -1343, -1376, -1114, -778, 392, 1918, + 1165, 1246, -1247, -870, -1232, -1147, -1075, 570, + 181, 1983, 971, 1216, -1309, -1199, 260, -1136, + -950, -742, 1067, 703, 1150, 1144, -1405, -1533, + -1564, -1549, -1264, -737, 1085, 1706, 1806, 1785, + 282, -1173, -1128, -1188, -971, -885, -291, 254, + 841, 987, -142, -1068, -1264, -1232, -1058, 138, + 546, 521, 1096, 987, 890, -936, -1020, -1051, + -871, -521, 1686, 625, 930, 936, -1343, -924, + -1231, -1247, -1052, -951, 1110, 125, 826, 1116, +}; + +static const int16_t fcb44ss[] = { + 6575, -881, -1291, -1258, -1090, -517, -268, -56, + 106, 295, -303, -1134, -1113, -650, -508, 1843, + -235, -141, 454, 832, -1212, 856, -404, -620, + -682, -487, -69, 865, 341, 95, 3626, -1037, + -1366, -1349, -1126, -558, 187, 343, 657, 765, + -410, -735, -1046, -1023, -897, -673, -366, 3174, + 1264, 720, -730, -922, -523, -821, 4042, -463, + 45, 329, 213, -93, 301, -1011, 277, -840, + -820, -451, 417, 470, 739, 953, -1219, -1286, + -1545, -1426, -1209, -803, 1156, 1311, 1329, 1329, + -643, -1136, -1200, -912, 1221, -695, 342, 910, + 905, 812, -996, -365, 4868, -738, -591, -621, + 17, -42, 0, 100, 2085, -1214, -1434, -1432, + -1243, -577, -626, 140, 1357, 1821, -1064, -1261, + -1629, -1525, -1488, -1101, -631, 551, 3556, 3974, + -635, -846, -1005, -646, -803, 123, -151, 357, + 2137, 953, -1168, -1055, -1115, -1061, -823, -651, + 3842, 606, 491, 491, -1297, -1063, -990, -1051, + -1202, -983, -468, -47, 163, 336, -1131, -446, + -683, 644, -660, -675, 1251, 373, 195, -123, + -1109, -430, 1820, 1883, -862, -743, -265, 119, + 66, -41, -1281, -768, 1941, -955, -1054, -856, + 528, 363, 488, 545, -936, -682, -814, 5534, + -826, -347, 58, -38, 168, 14, 1224, -719, + -300, -766, -407, 630, 269, 39, -230, -701, + 1601, -958, -945, -955, -734, -487, -20, 1392, + 544, 282, -118, -1133, -1161, -1065, -939, -213, + -129, -271, 451, 2570, -895, -805, -536, 1455, + 1496, -647, -199, 114, 95, -42, 2230, -855, + -715, -819, 1762, -699, -50, -109, 163, 207, + -334, -759, 3297, -645, 2561, 77, -239, -259, + -275, -445, -1304, 3536, 1610, -526, -926, -582, + -12, 44, -180, -69, -804, 1107, 1451, -868, + -851, -589, -354, -85, 88, 336, -537, -444, + 40, 231, -715, -523, -351, -379, -123, 171, + 1223, -328, -567, 2182, -291, -352, 20, -157, + -338, -635, 2194, -476, 1624, -802, -762, -585, + -245, 48, 63, -45, -32, -646, 847, -556, + -727, -259, 1309, 239, -128, -755, -1018, -640, + 876, -642, -906, 1394, -26, 338, 204, 148, + -988, -521, 135, -807, 1065, -525, -80, -248, + 383, 836, 521, 13, -553, -865, -928, -631, + -137, -83, 446, 221, 1924, 48, -621, -845, + -782, -544, -531, -418, -79, 915, -711, 1247, + -938, -766, -995, 1459, 31, 199, 261, 190, + -670, -1207, -1013, 108, -670, 204, 407, 266, + 473, 998, -606, -923, 1845, -1061, 910, -774, + 268, 493, 178, 61, 1938, -1237, -1010, -1097, + -780, -368, 1125, 354, 398, 550, 1032, -1128, + -1196, -908, -767, 529, 2326, 728, 227, -13, + -1113, -367, 382, -939, -1094, -896, -463, 446, + 896, 1128, -591, -823, -894, 3052, -968, 2157, + -153, -71, 111, 118, -1106, -930, -911, 1663, + -905, -691, -226, 503, 665, 702, 2067, -1149, + -828, 990, -850, -426, -159, 148, 379, 512, + -1268, -1390, -1492, -1343, -1419, 2246, -224, 2124, + 1523, 1338, 522, 1613, -344, -694, -487, -325, + 293, 96, -374, -679, -364, 124, -1201, -1274, + -1078, -513, 15, 1045, 529, 680, 131, -1067, + -1030, -888, -806, -122, 1002, 1302, 757, -473, + -530, -538, -821, -373, 72, 797, 864, 265, + -542, -1090, -241, -1095, -1205, -991, -1172, 5025, + -420, 728, 461, 103, 2325, -915, -1012, -854, + -1117, 2018, -377, -35, 266, 443, -949, -1163, + -1064, -1057, -802, 721, 1278, 470, 308, 263, + 474, -773, -1033, -892, 227, -30, 39, 101, + 456, 476, -1263, 7275, -946, -1157, -1304, -922, + 248, 143, -98, 312, 3419, -402, -649, -629, + -554, -48, 487, 72, -171, -687, -1167, 1869, + -524, 1490, -869, -236, 111, 68, 77, -85, + 1481, 906, -1189, -1321, -1124, -554, 429, 321, + 814, 699, -1048, 486, -858, -1096, -1072, -744, + 1676, -73, 593, 632, 779, -1265, -1470, -1379, + -1050, -548, 781, 524, 1022, 1079, -1149, 3719, + -1064, -1180, -1159, -775, -211, 241, 492, 555, + 3025, 2828, -849, -1133, -1063, -567, -70, -142, + -176, -62, -614, 1745, -684, -610, 1478, -619, + -235, -361, -84, -44, -1155, 1494, -1183, -1210, + -1294, -1017, -330, 210, 931, 1368, -1306, 2714, + -1052, -1128, -1220, -908, 2409, 441, 310, 318, +}; + +static const int16_t fcb44sm[] = { + 5619, -163, -1005, -856, -831, -644, -612, -759, + -770, -456, 199, -551, -1348, -80, 131, -481, + 334, 202, 366, 1246, -1245, 499, -1454, -396, + -675, -257, 525, 1001, 878, 1075, -1004, -1010, + -1127, -947, -976, 332, 3533, 1315, 265, -683, + -1114, 1056, -1009, 1154, -728, -212, 620, 169, + 102, -110, -658, -902, -1238, -1213, -1238, -926, + -735, -455, 1130, 5139, -1184, 190, 1590, -604, + -800, -373, -366, 251, 720, 571, -6, 304, + -1228, -369, -659, -506, -25, -234, 313, 2366, + 623, 1473, -315, 780, 1048, -416, -586, -737, + -1029, -1094, 483, -725, -771, -379, -268, -15, + 697, 1774, -1, -999, -987, -867, -1339, -1255, + -1018, -652, -125, 643, 3006, 2417, -543, 1629, + 1557, -684, -568, -474, -132, -291, -338, -321, + -1250, 641, -158, -935, -575, -575, 154, 415, + 798, 1421, 3147, 1903, -335, -767, -729, -627, + -611, -752, -836, -735, 678, 502, -946, 556, + -821, -51, -256, 94, 151, 70, -808, -324, + -359, 3637, 286, -90, -365, -613, -782, -871, + 75, 1051, -780, -487, 47, 273, 1768, -102, + -828, -1267, -1093, 1420, -624, 225, 1307, 85, + 239, -152, -649, -853, -1072, -796, -644, 1383, + 1143, -199, 94, -25, 70, 52, -1064, 2487, + -844, -607, -587, 148, 726, 224, -238, -484, + -957, -729, 1517, 1334, -475, -317, -253, -186, + 1, 17, -832, 1450, 423, 1408, -576, -825, + -630, -579, -312, 314, 788, 382, -1000, -1060, + -763, 968, -135, 56, 143, 477, -736, 30, + 4023, 68, -266, -420, -538, -751, -893, -879, + -935, 59, 465, 887, -351, 1396, 176, -250, + -684, -1019, -515, -815, -957, -439, 188, 3794, + 86, -98, -245, -829, 1894, -386, -865, 1513, + 24, -506, -281, -615, -476, -364, -1283, -963, + -339, -133, -161, -480, 25, 230, 1364, 1815, + 1766, -844, -1423, -1185, -972, -458, -275, 138, + 1317, 1778, -1295, -874, -1211, -792, -601, -500, + 2301, 901, 1336, 842, 1355, -426, -1160, -959, + -801, -433, 1852, 144, 284, 169, -1122, -851, + -957, 272, -393, 817, 862, 262, 333, 802, + 320, -576, 1615, -615, -886, -311, 108, 13, + 1, 320, -1205, 962, -483, -791, -749, 1158, + 677, -57, 166, 279, -860, 1237, -971, -1057, + -598, -285, 884, 1174, 657, -303, 2254, -706, + -1113, -655, 719, 234, -124, -199, -135, -360, + -758, -623, -385, -18, 3243, 470, -139, -286, + -520, -953, -1193, -1140, -1297, -1137, -764, 25, + 235, 2217, 1501, 1369, 2024, 781, -1353, -835, + -824, -601, -259, -140, 387, 671, 3, -974, + -760, -884, -485, 709, 1505, -95, 321, 739, + 1610, -156, 1515, -76, -420, -369, -189, -506, + -705, -907, -1052, -516, -1048, -996, -471, 1195, + 212, 184, 800, 1665, 747, -1029, -1013, 789, + -703, 559, -139, -98, 380, 523, -355, 2047, + -766, -991, -809, -566, -257, -242, 485, 1322, + 1989, -330, -945, -559, -448, 1241, 811, 10, + -767, -1218, 1600, -755, 428, -729, -355, -665, + -416, -120, 381, 548, -717, -14, 1587, -886, + -9, 353, 839, 201, -454, -1112, -1334, -309, + 660, -375, -661, -511, 1437, 540, 492, 0, + 95, 3911, -237, -301, -562, -483, -569, -799, + -883, -580, -670, -980, -1056, -896, -797, 1551, + 267, 1000, 1617, 75, -1132, -403, -988, -830, + -627, 1164, 1315, 1594, 310, -564, -1091, -563, + 1195, -442, 1086, -344, -176, -258, 175, 476, + 923, -37, -629, -919, 1278, -610, 113, -314, + -81, 192, 731, -944, -1297, -1108, -934, -259, + 640, 1164, 1326, 558, -767, -519, -875, -930, + -817, -533, 496, 2605, 1359, -131, -1010, 912, + -1055, -309, 768, -198, -166, -76, 429, 640, + 3283, -895, -1229, -853, -853, -399, 147, 44, + 237, 495, -833, -909, -1004, -811, 1039, 1627, + -194, 295, 738, 290, -771, 237, -912, -479, + -648, -518, -226, 573, 2346, 419, 1013, 1510, + -865, -873, -982, -557, 598, 50, 81, -81, + -1150, -640, -1011, 1991, -561, -140, 42, 175, + 521, 799, 3231, -46, -1004, -994, -1140, -1094, + -957, -860, 8, 2346, 212, -499, -55, -997, + -623, -588, 38, -58, 975, 1529, -986, -891, + -1121, -619, 1967, -463, -7, 632, 768, 953, +}; + +static const int16_t shape8[] = { + 2765, 1262, 6624, 867, 688, 1884, 3245, 1248, + -2160, 593, 182, -1004, -1067, 687, 1021, -920, + 1396, -242, -2817, -1838, -3351, 1000, 5995, 2459, + -283, 1909, 1452, -4569, 556, -2004, -42, -3393, + -50, -385, 597, 983, 420, 6311, -1572, -1665, + 6128, -1688, -5191, -337, -4199, 371, 1032, -84, + 2169, 931, -392, -250, 137, 831, 8194, -489, + -92, 209, 115, 1453, 246, -647, 936, 1097, + -400, 597, 392, 93, -7709, -711, -724, 2051, + 497, 1919, -876, -769, -172, 2972, 952, 555, + 151, -617, 773, 4840, -3671, 841, 244, -661, + -3424, 958, 81, 532, -315, 796, 5491, -516, + -1, -1371, -531, -5538, 313, -1749, 2413, -835, + -3143, -244, -3470, -850, -4241, -859, -74, 2141, + -1005, 4643, -339, 4089, -861, -6612, 483, -2888, + -580, -45, 3662, 918, -317, 3596, -741, 897, + -2578, -654, -1628, -1865, 629, 3219, 214, -1898, + 1173, -4509, 1682, -2161, 697, -147, 9839, 751, + -1094, -341, -669, -1322, 649, -832, -382, -5467, + -44, 3510, 1312, 3104, -202, 1870, -155, 601, + 719, -22, -350, 394, 81, 397, -9185, -174, + 351, -4717, -4450, 3672, 1163, 2351, 1720, 1048, + -1221, -280, -18, -15, 678, -3931, 4707, -99, + 1823, -535, -1836, 138, 1166, -3031, 5515, 1362, + 1235, 455, 595, -3671, 1102, -163, 62, 1104, + 813, 870, -295, -1088, -299, -3976, 805, -7468, + -412, -2109, 236, 46, -5764, 615, -1475, 853, + 790, -6197, 312, 637, -3923, -422, -1086, -5647, + 878, -1410, 2085, -51, -2941, -769, -63, 838, + 823, 741, 2785, 450, -7003, -121, -915, 60, + -41, 0, -39, 8774, 647, -521, 379, -342, + -344, 818, 1316, 1056, 182, 2765, -467, 7886, + 45, 791, -415, 3864, -2428, 2255, -661, -64, + 1693, 144, 1784, -1194, -46, -1856, 1208, 4131, + 914, 8028, -17, 1939, -1415, 533, 291, -466, + 186, -705, 668, -614, -253, -2190, 287, 3929, + 1472, -1561, 5, 889, -2020, 158, -14, -1419, + 1338, -353, 622, -54, 87, -1104, -2911, 513, + -632, 1533, -267, 22, 6567, 295, 325, 6883, + 963, -373, -349, 183, 896, 1845, -1157, 351, + -367, 1171, 4362, 508, 5632, 704, -1420, -1886, + 686, 5230, -9, 2422, 230, 264, 3738, -270, + -344, -528, -936, 2286, -540, 4274, 337, -665, + 737, 1639, -1307, 5827, 592, -1372, -412, 1419, + 4579, 335, 223, -1067, -112, -446, 149, 1375, + -155, -392, -1980, 561, -67, 341, 6957, 475, + 11449, 39, 81, 766, -1880, 558, -134, -7940, + -489, 249, -886, -358, 6850, 2794, -2217, 1111, + -1222, -1130, -818, 1076, -1823, 865, -2220, 1179, + 4492, 224, -2073, -338, -5351, -390, 133, 496, + -42, -16, 46, 437, 322, -275, -72, 48, + -325, 313, 1108, -1044, -851, -5030, 1035, 4316, + -1281, -913, -1419, -941, 1914, 960, 1242, 202, + 5109, 475, 1254, 1725, -1504, -4, -269, -421, + -150, -4409, -610, -1548, -1684, -817, -210, 72, + -679, -106, -3809, -1137, 4, 7220, -95, 810, + 2432, -331, 492, -81, 138, -62, -613, -636, + 106, 10908, 912, 144, 192, 1251, -3970, -954, + 1145, 1175, -1721, 5326, -1721, -569, -3661, -1166, + 6605, -744, -1494, 853, 134, 3259, -504, -1740, + 180, -207, -659, 196, 179, -106, 118, 789, + -834, 10339, -420, -3002, -456, 113, 6435, 949, + 721, -2709, -1599, -684, -8068, 174, -1416, -58, + 974, 308, -726, 1237, -1594, 519, -131, -198, + -1395, 1180, -173, 338, -5584, -279, -236, 6817, + 89, -220, 3967, -107, 65, 2479, -22, 642, + 7179, 1179, -229, -202, 4948, -5465, 1632, -1285, + 2188, -2037, 1763, 636, 4247, 995, 1176, 2, + -2398, 1236, -661, 382, -1075, 130, 103, -187, + 604, -306, -2635, -2185, 157, 775, 6373, -924, + 1758, -3043, 1707, 2852, -2148, 6779, 376, -1018, + -2374, -989, 249, -5393, -32, 538, -416, -5108, + -658, 1839, 419, 1153, -3956, -617, -1925, 5434, + 626, 1488, -3824, 140, 370, -2230, -7031, 1989, + -581, 639, -4249, -216, 1225, -776, -973, -542, + -2922, -1783, -2430, -3251, 958, 3313, 636, -6277, + 119, -866, -406, -156, -4839, 966, -469, 5559, + 193, 376, -4810, -870, 163, 4130, 2596, 2203, + -114, 2423, -622, -424, 2935, 749, 2500, 4230, + -162, -1489, 2169, -5156, 751, 2748, 2240, -1549, + 4821, 175, 2274, 854, 2993, 838, 322, -2663, + -794, -283, -98, 1393, -709, 362, 285, -1085, + 1075, 374, 1062, 6512, -3375, -3138, 3939, 3628, + 3926, -2442, 1989, -583, -1282, -1882, -3920, -4593, + 540, 2667, -155, 156, -2428, 1229, -436, 1754, + 2815, -1634, -2299, 1155, 990, 3689, -1242, 3145, + 3951, 45, 186, -1110, 257, -335, 8929, 533, + -173, 813, 21, 1584, 541, -44, 1349, 108, + -5163, -684, 5522, -868, -5795, 769, 583, 2827, + -818, -5551, 1485, 37, -631, -262, -4352, -532, + 61, 434, 1775, 8974, -112, -852, -1227, -1645, + 260, 298, -430, 863, -3860, -97, 6467, -328, + -2418, -61, -1253, 1575, 30, -5683, 2113, 973, + -371, -51, 5355, 471, -584, -492, -2187, 2799, + -506, 4435, 1950, -3415, -363, -404, 941, 2628, + -146, 434, 2853, 889, 634, 5749, -54, 126, + 189, -1384, -379, -3205, -540, 1720, 942, -6300, + -286, -58, -1083, 3782, 251, -334, 4172, 631, + 17, 83, 707, 1322, 3273, -573, 1024, -6112, + -540, 4916, 155, -1209, 308, -738, -2150, 786, + -168, 68, -201, -64, -752, -1595, -9188, 320, + -426, 111, -2183, 886, -737, 193, -837, 3219, + 5936, 4022, 764, -82, 3344, -855, 3705, -2652, + 1533, -206, -3673, 1235, 1163, -1217, 3183, 1313, + -745, 6554, 7019, 1302, 2129, 268, -70, 110, + 412, -155, -1703, -4945, 105, -1705, 412, -6588, + 2905, 1279, 73, -2446, -5635, 1168, 2974, 404, + -650, 265, -1773, -1857, -108, -651, 657, -824, + 3352, 177, 155, 1275, 2012, 31, -7, -1065, + 2062, 411, -2325, -208, -6306, 683, 1037, -1060, + 191, -187, -585, 6103, -459, 571, 1640, -693, + 922, -2291, 537, 1934, 263, 3847, -202, 7060, + 136, 4368, 2963, -1032, 18, 1836, -144, -3853, + 474, 2005, 1298, 2396, 825, -2274, 12, 3759, + -394, 907, 490, 2997, 2180, -1570, -1000, 5982, + -129, -820, -3001, 2684, -1132, -2908, 1101, 5044, + 393, -1637, 393, 1343, -1231, 404, 1817, 1463, + -443, 1053, -584, -7756, 45, 499, -4109, 214, + 535, -3348, 54, -1594, 6913, 0, -94, 8772, + 500, 13, 734, 5, 798, -1521, 853, -82, + -263, -619, 1558, 456, 5911, -1376, 1054, -971, + -1275, -147, -111, 4964, 321, 67, 7024, -525, + 620, 883, -1058, -1132, -3313, 630, 226, -6201, + -1011, 1111, -820, -295, 580, 636, 2452, -638, + 6840, -285, 655, 1502, -1049, -567, 329, -33, + -249, 570, 186, 167, 780, 1104, 42, 197, + 10034, -1295, -208, 32, -1473, 716, 159, -6672, + -45, 519, -4300, -246, 3692, 5062, 4305, -748, + -548, 181, -382, -881, -1968, 580, 964, -420, + -327, -3397, -1584, 2770, -3501, 1659, -1252, 2352, + 6, 30, 0, -273, 27, -204, -485, -432, + -6, 176, -428, 1562, 104, -6511, -1084, 2205, + -11, -5254, -132, -508, -69, 373, -1503, 208, + -58, 5311, 92, -966, -6563, -480, -24, 1424, + -1498, -165, 4594, -903, -1787, -353, -7284, 142, + 1008, 875, -6109, -16, 162, 4895, 30, -188, + 2099, 1581, 300, -259, -921, -386, -488, 140, + -482, 7135, -77, 494, -196, 3207, -250, -102, + 318, 978, 161, 7292, 55, -1347, -2605, 898, + 1833, 602, -1988, 630, -145, -102, -414, -133, + 417, -603, 156, -1151, -395, 625, -1676, 86, + 680, 13321, 322, -5816, -292, -223, 4205, -361, + 903, -224, 1745, 95, -6598, 79, 2323, -24, + 263, 778, 146, -939, 1814, 1945, 720, 367, + -2987, 899, -4409, 136, -3185, -342, -3304, 1016, + 284, -345, 2313, -403, 389, -1403, 1835, 151, + -132, -1702, -339, -5679, 2026, -2990, 47, -564, + 399, -2167, 1392, 1384, 5094, -2954, 4467, -22, + -23, 408, 1620, 1381, 2380, 805, 380, -36, + -803, 765, -778, 905, -200, -669, 3942, 289, + 176, -4767, 2015, -3554, 1206, 6071, 180, 2057, + -48, 365, -48, -2423, 585, -109, -1298, 2519, + -525, -589, 374, 976, 3667, 2091, -2890, 1371, + -726, -216, -1027, -116, 2122, -619, -3826, 4649, + 1167, 0, 1237, 1538, 2505, -548, -3093, 1344, + -558, -1927, 199, 2462, 1327, 4597, 833, -3660, + -341, -1010, 428, 148, -1682, 130, 1569, 8785, + -752, -1032, -2407, 353, -379, 3311, 892, 893, + -2596, -217, -835, -2291, 1137, -4339, -58, 2759, + 991, 3527, -281, -6050, -1251, 1802, 8, -3916, +}; + +static const int16_t shape8s[] = { + 2639, 550, 6487, 2812, 1014, 1926, 2959, 757, + -1452, -111, -45, -409, 401, 545, 1545, -1677, + 75, -607, -3658, -368, -4486, 272, 6017, -468, + 1108, 1056, 606, -3288, 1003, -830, -336, -2940, + 247, 227, 1700, 338, -161, 5694, 317, -584, + 6278, -2902, -3862, 293, -3400, 540, 177, -840, + -471, 963, -243, -289, 77, 39, 7626, 333, + 577, 327, -359, 999, -392, 107, 1410, 509, + -983, 36, -193, -68, -7612, -775, -178, 1415, + 1069, 1534, -1276, 1204, 615, 2065, 499, 124, + 265, -454, 1974, 6428, -4028, 1102, -1418, -85, + -816, -64, -46, 926, -960, 78, 4823, -41, + -74, -682, -761, -6598, 3084, -1597, 2945, -861, + -3203, -669, -3717, -310, -2865, -1447, 72, 1987, + 364, 4919, -247, 3678, -196, -6807, -127, -965, + 233, -133, 4000, -76, -182, 3825, 67, 700, + -1934, 545, -2467, -1441, 629, 3409, 512, -3333, + 539, -4896, 3413, -2083, 554, 574, 9430, 296, + -88, -533, -321, -1082, 2363, 42, -50, -5402, + -123, 4458, 1130, 2737, 378, 1509, -3267, 970, + 179, -2114, 602, 479, -438, 277, -9389, 1144, + 2453, -3705, -3842, 3965, 482, 1230, 2211, -281, + -1833, -1741, 1653, -868, 485, -3740, 5371, 989, + 1182, 10, -1812, 233, 1028, -3300, 4698, 1572, + 1580, 928, -314, -3452, 830, -1511, -1079, 554, + 641, 1383, 105, -1101, 1549, -3944, 902, -6557, + 493, -3117, 782, -699, -4806, 910, -259, -28, + 1713, -7012, 570, -1270, -4698, -8, 220, -4295, + 1135, -3905, 945, -467, -2164, -651, 181, 212, + 159, 587, 1587, 1101, -7153, -309, -1470, -1135, + -265, -326, 172, 8840, 726, -780, 170, -1038, + 466, 216, 764, 231, -547, 2456, -420, 8132, + 486, 866, -359, 3351, -1829, 2018, -352, -1353, + 711, 645, 1149, 74, -466, -669, 1009, 3086, + 240, 7468, -182, 1947, -221, 496, -448, 189, + -113, -752, 133, -214, -1310, -144, -1034, 5235, + -1939, -2664, 192, 1526, -2320, 762, -778, 357, + 1251, 424, -225, -1008, -229, -352, -3559, -271, + -1069, 1274, -175, 368, 6453, -505, 31, 7678, + 165, -418, -112, -649, 1421, 667, -334, 1041, + -353, 585, 4109, 1095, 5283, 685, -687, -1459, + 1054, 5048, -194, 2220, 81, 244, 3789, 12, + -923, -1459, 319, 2378, -53, 4097, -662, -1156, + 223, 2589, -547, 4951, -346, -1812, -111, 344, + 5247, 387, -459, -810, 1022, 234, 726, 1840, + -545, -888, 728, 106, 1027, -497, 349, -248, + 11173, -311, 126, 479, -2036, 265, -1286, -7196, + -511, 128, -1833, 496, 7620, 2539, -1809, 962, + -614, -876, 857, 2178, 642, -1180, -2294, 911, + 3932, 711, -1073, -1381, -5317, 237, -414, 579, + -78, -27, -78, -14, 100, -191, 142, -1, + 430, -182, 207, -61, -72, -4866, 583, 5099, + -704, -1496, 1065, -206, 2371, 1496, 1777, -308, + 4802, -1415, 1178, 2650, 312, -338, -250, -64, + -27, -3163, -561, -1283, 952, -902, 354, 1597, + -74, -685, -3266, -873, -744, 7079, 732, 697, + 550, -1362, 251, 34, -742, 0, 105, -608, + -1, 10459, 854, -103, -419, 2286, -3041, -3278, + -51, -491, -187, 4204, 857, -1085, -2501, -1647, + 6740, 605, -2079, 1748, 519, 3462, 106, -699, + 220, -615, -406, 420, 786, 572, 679, 218, + -888, 10283, 129, -2286, -705, -78, 5072, 634, + 702, -6315, -551, -307, -7946, 177, -1897, -579, + 1620, 125, 116, -89, -308, -1018, 142, -506, + -624, 917, -779, 632, -5103, 314, -155, 5687, + 77, -144, 2957, -176, 30, 1347, -426, -51, + 7829, 1201, -592, 1, 4617, -5476, 2216, 414, + 1281, -81, -423, -322, 3623, 447, 863, -375, + -489, 526, -485, 159, 1090, 463, 401, -131, + 223, 1630, -2462, -2261, 623, 1019, 6385, -595, + -654, -2787, 2381, 328, -2069, 5410, -402, -554, + -1594, -860, 83, -5011, -938, 1061, 163, -3523, + -1064, 1215, 761, 1604, -4224, 904, -2706, 4907, + -1838, 3287, -3118, -464, -217, -1187, -6792, 1748, + -569, 613, -3177, -253, 164, -845, 539, -440, + -1871, -2010, -2322, -3026, 478, 2297, -560, -5813, + 768, -1709, -620, 66, -4667, 805, -215, 5366, + -442, -233, -6732, 345, 106, 4483, 1720, 2725, + -109, 2746, -188, 204, 1905, 1225, 253, 3270, + 1912, -1852, -256, -4131, 768, 3984, 473, -1434, + 4380, 208, 2547, 1051, 3347, -171, 629, -2389, + -722, -759, 166, 2192, 325, -193, -289, -945, + -436, 931, 1352, 6918, -2707, -987, 2940, 3574, + 4135, -3205, 351, 927, 128, -1873, -4894, -4816, + -461, 696, -1618, 129, -28, 2195, 2450, 585, + 2557, -1308, -2204, -590, 2345, 3699, -312, 4436, + 3422, -611, -106, -2647, -1752, -73, 8914, -673, + 1625, 850, 720, -1182, -245, -113, 882, -223, + -4873, -1009, 5643, -97, -4779, -155, 444, 2894, + -876, -5534, 1268, -132, -881, -389, -4250, -153, + -44, 986, 1820, 8671, 662, -344, -198, -1909, + 1083, 114, -318, 1070, -3293, -375, 6621, 232, + -2973, -100, -483, -529, -120, -5312, 1702, 651, + -631, 485, 5675, 50, 1132, -465, -1053, 2675, + -1592, 5565, 1036, -2808, 325, 999, 524, 2813, + -265, 337, 4226, 514, 576, 6047, 175, 204, + -514, -617, -94, -2862, -294, 1774, 978, -7040, + -169, 835, -829, 2258, -37, -319, 2750, 138, + -289, -1092, 78, 1032, 4316, -1201, 808, -6243, + -940, 4136, 89, -1076, -647, -255, -207, 227, + -70, -62, -202, 66, 24, -988, -9542, -225, + -739, 161, -2698, 117, -608, 173, -629, 1770, + 5037, 5145, 2530, -1028, 3077, -496, 4671, -1859, + 2148, 447, -4231, 170, 713, 323, 746, 1447, + -1880, 5069, 7765, -492, -775, -659, -770, -59, + -258, -92, -1683, -4639, -1727, -2128, 545, -5060, + 2536, 1549, 492, -1280, -6034, 965, 3244, 475, + -1208, 680, -283, 295, -357, -257, 1753, -362, + 3159, 106, -181, 1805, 947, -1002, -136, 756, + 1189, 237, -2427, -263, -5746, 13, 2171, -1197, + -319, -372, -1300, 5458, 955, 1224, 618, -1087, + 2661, -2026, -20, 2137, 342, 4076, 482, 5441, + -6, 2126, -143, -1596, 274, 1009, 94, -3446, + 398, 1079, 289, 2042, 883, -2005, -320, 3848, + 395, 472, 615, 3245, 753, -1881, -216, 5670, + -64, -565, -2560, 1574, 772, -3824, 932, 4830, + 1182, -1054, 390, -40, 1833, -350, 151, 149, + -966, -62, -713, -8794, -593, 87, -3523, -243, + 560, -3296, 244, -775, 7174, 749, -271, 8566, + 99, 1258, 1239, -489, -107, -1699, -611, 1046, + 65, -509, 524, -354, 6400, -248, 148, -682, + -93, -1584, -61, 4509, 479, 110, 7116, -295, + 480, 1545, 3, 127, -2292, 894, 1261, -6288, + -45, -410, -402, -356, 2649, 649, 1652, -643, + 6587, 117, 876, -33, 956, -302, 1619, -1023, + -99, 386, -86, -498, 684, 1189, 146, 381, + 9832, -97, 264, 91, -1197, 461, 374, -6788, + 427, 294, -4776, 0, 2868, 5199, 4573, -827, + -1867, 623, -1214, -573, -1099, -1476, 306, -701, + -224, -4261, -1135, 2500, -4758, 1469, -101, 1812, + -129, 15, 760, -149, -892, -1417, 761, 1213, + -417, 1569, -98, 1675, -139, -7382, -633, 2584, + -519, -5483, 29, 320, -383, -596, -295, -357, + -416, 4054, -457, -355, -5213, -840, -319, 1321, + -424, -129, 5225, 181, -2696, -174, -7363, -327, + 519, 860, -5132, 275, -141, 4943, 204, -200, + 2989, 939, 390, -461, -333, -394, -174, 312, + -129, 7257, -402, 860, -1, 2677, 901, 609, + 248, 935, -493, 8147, 2081, -1171, -2145, 1560, + 1634, 55, -1746, 561, -747, 931, -712, -544, + 798, -98, 580, -829, -546, 238, -2052, -197, + 802, 13067, 373, -6438, 1159, -845, 4313, 19, + 670, -627, -944, 1277, -6997, -609, 1913, 607, + -454, -89, 859, -43, -71, 494, 169, -713, + -2014, 1570, -4712, 233, -4113, 210, -3689, 1019, + 200, 49, 1800, -611, -472, 1234, 579, 363, + -134, 233, 101, -5539, 1924, -1734, -982, -928, + -707, -1238, 1586, 3676, 4741, -2770, 3105, 942, + -1933, 1363, 288, -2528, 160, 485, -38, 23, + 113, -19, -518, -110, -173, -170, 589, -473, + 296, -3742, 1109, -2977, 1349, 5899, 98, 3130, + 855, 499, 3, -3111, -592, 572, -890, 687, + 697, 194, -344, 1139, 3255, 1270, -2451, 1958, + -395, 267, -951, -2224, 2108, -11, -3357, 2602, + 2403, 1596, -532, 2701, 2251, -1217, -2148, 691, + -757, -2051, 373, 1964, 1493, 4756, 1246, -4345, + -496, -1333, -20, -84, -1558, 305, 1183, 8148, + -628, -702, -1730, 232, -261, 2732, 245, 353, + -3745, 1013, 186, -2042, 810, -3894, 351, 2501, + 852, 4162, -425, -4941, -1536, 2237, 1348, -4274, +}; + +static const int16_t shape11[] = { + 347, -5391, 106, 156, -182, -36, 177, 401, + 700, 524, -1343, -402, -6982, 63, 194, -14, + 82, -36, -677, -393, 187, 7364, -507, -1173, + -759, -3759, -728, 2970, 1334, 32, -1322, -2965, + 156, -839, 382, -6382, -149, 874, 1352, -35, + -499, 99, -425, -3118, -32, -1596, 5608, -822, + -41, 2974, -592, 615, 1777, 2364, 5189, -4171, + -581, 936, -527, 318, -1606, -551, 5350, -448, + -40, 7476, 189, 319, -1390, 10, -921, 10016, + 573, -1065, 829, -1190, -22, -4263, 87, -1742, + -325, 313, -188, 540, -5542, -188, 511, -168, + -518, 17, 152, 1966, -2568, -860, 2735, -1210, + 404, -144, -6873, -129, 434, -2978, 2829, -48, + -9196, -1829, -11261, 1492, -4938, 1802, 93, 384, + 1340, 236, 10066, 731, 861, -195, -7571, -77, + -481, -700, 4694, -734, -6317, 281, 1773, 175, + -5535, 532, 31, 7012, -637, -3586, 1096, 3596, + -197, -7837, -611, 1825, -26, -259, 2307, 12, + 729, -1958, 156, 262, 5494, 26, -5792, -3146, + 450, -1075, 297, 509, 154, 668, 191, -268, + -1585, 369, 1314, -693, 677, 1482, 198, 378, + 11088, -83, 2321, -193, -1082, -3053, 20, -271, + 12975, 272, 1114, 476, -798, -309, -159, 5406, + -109, -675, 621, -2564, 11190, -1342, -88, 428, + -465, -4633, -503, 106, -9448, -454, -28, -402, + 1271, -7972, 754, -207, -2491, 518, -3701, -542, + -1268, -617, -177, 467, -130, 990, 4087, 857, + -524, -5822, 145, 217, -7703, -275, 6647, -81, + 550, 887, -433, -802, 532, 643, 188, 1965, + -920, -284, 3711, 1196, -8896, -357, -626, 908, + -284, -706, -1582, 182, 7705, -138, -2372, -158, + -888, 4247, 4381, -6722, -1619, -1810, 632, -1176, + -62, 4261, -89, 265, 1405, -1449, -389, -7068, + 258, -244, -272, -8149, 37, -457, -8839, 3243, + -4291, -396, -3935, 907, -58, 2388, -908, -1209, + -635, -487, -1717, 6989, -4834, 2136, -822, -699, + 2187, -96, -9775, -3464, 795, 634, -823, -669, + 146, -843, 15, -227, 671, -707, -10004, 198, + 81, -1611, -34, -2127, -2385, -689, 622, 1834, + -63, -4925, -215, -1181, -514, 7701, 607, 2030, + -264, 2479, 913, 178, 3625, -194, 613, 877, + -384, -7732, 1008, 2117, 528, -301, 540, -80, + 559, 28, 7542, -496, 1146, -6573, -1457, 7789, + -227, -1671, -76, -371, -865, -141, 42, 96, + 277, -410, -5606, 328, -8954, -222, -1792, 981, + -120, -650, 2269, -1412, 1038, -186, -8530, -264, + 2284, -727, 1511, -4611, -1653, 1985, -50, -8985, + -245, -3315, 407, -915, -23, -70, 30, -669, + -303, 902, 84, 433, 217, -8303, 7847, -1865, + -680, 254, -38, 364, 16, 50, 90, -534, + -4649, -800, 969, -1081, 454, 147, -62, 8797, + 84, -912, -518, -351, 76, -560, -1438, 629, + 16384, 656, 151, 880, 396, -90, 752, -138, + -861, 9605, 258, -440, -6441, 434, 5765, 282, + 1494, -260, -180, -769, 7867, -86, 536, -262, + -230, -8956, 5857, -591, 1533, 418, -505, -156, + 1165, 415, -168, -1504, -336, -667, 527, 5725, + 42, 429, 1691, 1, 85, -196, 3681, 36, + 469, -364, 559, 910, -1848, 259, 249, -1688, + 261, -36, -592, -156, -69, -5938, -180, -294, + 22, -903, 1389, 4853, 121, 5185, 970, 1210, + 561, 926, 472, -183, 6623, 357, -78, -5877, + 91, -188, -6746, -146, 342, -5648, 3697, 1336, + 728, -69, 398, 2667, -2103, 1901, -807, 258, + 72, -137, 341, 71, -169, -104, -83, 206, + -420, 1187, 744, 120, -5151, -574, 72, -8553, + -312, 140, -69, 6067, 5229, 202, -1722, -164, + 73, 1695, -1064, 234, 24, 4881, -849, -460, + 8641, -328, -1217, 1666, -283, -76, 2772, 401, + 843, -4756, 297, 8593, 367, -732, -225, -198, + -3936, 248, -436, 473, -19, -441, 164, 220, + -266, 3, 106, -244, -5814, 597, -666, -245, + -9298, -867, -480, 280, -40, -139, -6378, -4972, + -886, 3062, 747, -1991, -1668, -423, 534, 866, + -73, -6501, -195, 324, -51, -123, 298, 500, + 193, 278, -8503, -297, 1034, -16, -209, 7451, + 521, -305, -297, -1537, -3025, 689, 248, 319, + 5393, 1497, 2228, -773, -141, 2184, 1024, -4535, + -9160, -600, -932, -2145, -539, 460, -1943, 4265, + -2512, 4416, -304, 1744, 489, -362, 898, 2236, + -2224, 49, -192, 332, 366, -143, 329, -7747, + -4, 1075, 116, 551, 19, -7, 7090, -169, + 837, -71, -371, 451, -31, 474, 867, -421, + -4544, 78, 3208, -549, 1984, 1386, -2208, -1402, + 1616, 189, -37, -6953, -5733, 1589, -1314, 1040, + -1480, -5608, 2627, 3517, 250, 7930, 94, 4687, + 1522, 5543, -130, -462, 7613, -654, 647, -6187, + 139, 342, 5069, -729, 128, 17, -49, 176, + 122, 826, 503, 76, -196, 15583, 12884, 746, + -3942, 814, -1744, 1774, -338, 3089, -1694, 559, + -5355, 2834, -1448, 108, -329, -711, 350, 171, + 297, -123, 672, 625, -5884, 6822, 842, 276, + 242, -2254, -623, -846, 2441, 887, -2066, -1019, + 1329, 107, -83, 826, -67, -352, 549, 137, + -1023, -184, -11, 13790, 48, 883, 3538, -533, + -5553, 861, 738, -436, -5259, -66, -405, 3777, + -574, 738, 253, 363, -76, 288, 324, -337, + 157, -119, -97, 171, 514, -1932, -5171, 579, + 249, 1072, -204, -194, -311, 655, -6728, 186, + -178, 99, 5749, -329, 419, 924, -1131, 598, + -15, -103, -2277, 186, -716, -542, 153, -226, + 5689, 219, 52, 3706, -917, 140, -10576, -151, + 1060, 645, 404, 1310, 331, 216, -1413, -6030, + -5069, -3992, 1366, 932, 1559, -87, 7799, 3854, + 3762, -1043, 474, 1184, 102, -2775, -1199, -1079, + 358, -63, 9784, 141, 3947, 194, -132, -332, + -512, -212, -5839, -227, 7759, 807, -597, -1782, + -148, -352, -1225, -692, 147, -1970, 3508, -947, + 3463, -197, 4737, -698, 578, -172, -775, 8167, + 3102, 883, -914, 16, 827, 114, -1916, -909, + -606, 87, 1036, -435, 102, 96, -370, -204, + -11952, 21, 477, 1285, 6281, 855, -7717, 1155, + -501, -597, 5943, 145, -630, -3406, 13, -4211, + 679, 6570, -231, -6042, -503, -194, 1437, 5640, + -1222, 8181, 386, -986, -503, 1221, 839, 763, + -277, -1787, -1491, 5, -206, 42, 2800, -332, + -2841, -143, -456, 646, -668, -117, 883, 86, + 7111, -270, 624, -1133, -308, -479, -9149, -1424, + 242, -12048, 8, 2307, -6530, -529, 462, -1346, + -153, 4315, -182, -675, -78, -480, -49, 398, + -408, -1440, 8196, 436, -561, -184, 175, 1799, + -154, -439, -721, 2170, 322, 6555, -539, -1672, + -629, -2985, 239, -37, 7544, -1048, -1241, 7241, + -636, 2044, -750, 1206, 1363, -530, -5960, 342, + -7440, 616, 372, 4572, -118, 343, 1086, 570, + -164, 553, -433, 562, 33, 8225, -235, -234, + 1230, 234, 906, 563, -73, 10464, -353, -644, + -1453, 1119, 237, 670, -112, 7083, -451, 3410, + -105, 3244, -1331, 102, 738, -3602, 76, 413, + -318, 10, -5471, 1024, -335, 246, -7820, -164, + 2515, -1411, 673, 6022, 50, -6715, 268, 2152, + -951, -60, 234, -2085, 342, 3002, -169, 2473, + -667, -6846, 870, 5467, 150, -66, -4294, -299, + -612, -3859, 177, 353, -4726, 547, 340, -5646, + -2022, 117, -4949, -303, 280, -266, -361, 673, + -139, -5, -7123, -264, 243, -5245, 351, 656, + 5005, 682, -107, 298, -79, 1407, -449, -797, + -669, -552, -242, -8013, 56, 4092, 1583, -3981, + -49, -7972, 390, 366, -31, 1126, 272, 5120, + -10, 1147, -3682, -155, 252, 163, 455, 358, + -746, -2719, -431, 444, -433, 432, -357, 5370, + 328, -3, 1748, 514, 7198, -527, 172, 401, + -59, -3586, 1443, 534, 1029, 539, 3723, 5392, + -6619, -2559, 2344, 282, -980, 97, -317, -786, + 475, -8646, 307, 447, -3107, 211, -56, 3344, + -1549, -9223, 454, 352, -27, 205, 503, 260, + -372, -631, -1165, -6543, 444, 1535, 404, -1752, + -43, -9381, 754, -94, -7134, 2064, 170, 8222, + -280, -1250, -347, 1688, -1203, 239, -1048, -4570, + -4720, -434, -1008, -4151, -2211, -1414, -506, -5411, + 5379, 984, 4587, -63, 143, 968, -203, 5315, + 591, -756, 1228, -372, 703, 6829, -76, 6935, + 467, 3119, -2, -3825, 175, -4000, -3012, -7745, + -832, -2582, 173, 1992, 3768, 275, 39, 603, + -536, 5851, 474, 254, -72, 1286, -836, 5576, + 1357, 3524, 406, -9214, -554, 3974, -352, 1763, + -482, 658, 1628, 3885, 1938, 6172, 1693, -5183, + 150, -6729, 1238, 1062, -10035, -428, 48, 421, + -185, 659, -426, -633, 131, -741, 462, -463, + -391, -193, -270, -682, -343, -12130, -86, -148, +}; + +static const int16_t shape11s[] = { + 22, -5296, -415, -206, 306, 265, 189, 376, + 721, -1503, -429, -538, -6008, -97, -385, -570, + -313, -1469, -219, -1661, 10, 6256, -1230, -635, + -28, -4208, -344, 394, 138, 1174, -170, -822, + 114, -1087, -101, -7362, 84, 862, 1514, 341, + -115, 320, -120, -1625, 55, -719, 1443, -733, + -577, 7197, 148, 26, 120, 1969, 4940, -3777, + -607, 1675, 64, -634, -84, 334, 6882, -644, + -232, 5008, -316, -164, -138, -16, 15, 9441, + -74, -65, 262, 834, 1143, -101, 434, -329, + 123, -204, -45, 147, -4586, -742, 464, 1412, + 548, -1602, -56, 1356, -771, 263, 709, -481, + -193, 345, -8395, -41, 36, -1900, -178, 816, + -7590, 31, -3011, -371, -2698, 2234, -99, 0, + 714, -845, 9357, 701, -1269, -187, -4227, -450, + -73, -1637, 4679, -138, -4470, 356, 1416, 1462, + -3162, 453, -61, 5243, -241, -2385, 438, 4919, + -252, -3781, 150, 335, 58, -185, 1870, 179, + 192, -2572, -454, 77, 4819, 1891, -4843, -2106, + -472, -3842, 167, 1092, -671, 194, -870, 139, + -115, -455, 452, -519, 299, 1024, 330, -99, + 11189, 82, 57, -849, 167, -4190, 639, 768, + 7477, 626, 94, -1259, -303, 181, -280, 2873, + -589, -461, 1591, -29, 6940, -1264, 120, -282, + -159, -3755, -4, -61, -10172, 152, -12, -200, + 111, -8471, -243, 400, -842, 1661, -3099, 500, + -451, -423, -193, 230, 423, 263, 5011, 1010, + 1044, -4781, 707, 84, -6091, -213, 5193, 434, + 534, 1100, -520, -1590, 75, -322, 2, 2008, + -534, 153, 2641, 1510, -6830, -246, 4, 271, + 75, -1308, -1934, -257, 6748, 589, -301, 627, + 1197, 3708, 4450, -5582, -1312, -2859, 881, 429, + 552, 738, -882, 984, 488, -868, -464, -6969, + 721, -2078, 417, -6121, -184, -128, -7840, 2659, + -2584, -254, 176, -790, -727, 482, 357, 104, + -441, -158, -980, 4563, -4098, 1086, -1217, -562, + 2033, 512, -8331, -3506, -73, 808, -372, -1602, + 748, 911, -599, -1499, 58, 309, -10000, -115, + 70, 1603, 280, -146, -817, 517, 18, 1355, + -121, -4134, 152, -1300, 247, 7258, 415, 130, + -27, 2108, 337, -816, 2480, 396, 533, 66, + -171, -6213, 47, 3081, -648, -930, 1810, -233, + -433, -588, 5526, 58, -18, -3498, -381, 8009, + 7, 1229, 152, -410, -567, 423, -354, 463, + -82, -146, -2868, 271, -5773, 2694, -1006, 150, + -113, -521, 2553, -278, 593, -69, -6517, -785, + 369, -2483, -216, -3144, -889, 1724, -168, -6303, + 171, -1895, -798, -137, -172, -746, -54, 162, + -607, 409, 201, -284, -143, -10681, 7747, -1148, + 303, 58, 4, -96, -485, -146, -286, -577, + -644, -512, 236, 576, 421, 93, 293, 10284, + -2, -117, -590, -546, 350, 445, -301, -300, + 10823, -224, -96, -551, -148, 1042, -125, 224, + -706, 8583, -195, 52, -2732, 200, 4419, 390, + 870, 100, -184, 233, 6179, -317, -472, 1964, + -302, -8722, 2509, -644, 488, -3101, 891, -253, + -38, 133, -15, -1365, -779, -612, 673, 5587, + 834, 377, 835, -2018, 75, -185, 3641, 121, + 693, 63, 503, 646, -7, 348, 141, -1311, + 532, -513, 95, -315, -65, -6478, -16, -848, + -210, -120, 676, 5125, 533, 4147, -622, -4, + -150, -1507, -124, -185, 5365, 267, 1073, -4479, + 173, -204, -4164, -952, -23, -4088, 1391, 205, + 712, -473, -373, 547, -685, 4542, -49, -71, + 33, -271, 132, 246, -188, 6, -309, 118, + 96, 1774, 158, -83, -3573, 1175, -122, -6619, + -1677, -1161, -266, 4776, 3453, 62, -346, -450, + -1380, 103, -457, -1260, -71, 4271, -338, -1394, + 6462, 395, 647, 2430, -735, 444, 1837, 403, + 144, -5573, 211, 4608, -15, 804, 70, 1969, + -3451, -138, -352, 1176, -171, -518, -114, -88, + 335, -308, -64, -428, -4115, 318, -205, -126, + -7854, -609, 105, 144, 270, 266, -4543, -5246, + -311, 587, 305, -115, 372, 727, -294, 414, + 877, -7899, 411, -538, 394, 535, 233, -826, + 329, 491, -4848, -650, 331, 1026, -140, 6474, + 194, -457, 98, -871, -2293, 873, 353, 812, + 4510, 1102, 379, 651, -214, -110, 20, -2749, + -8040, -96, 221, 221, -39, 444, -280, 2814, + -536, 3509, 111, 830, 594, 553, 47, 2812, + -1898, 203, -353, -60, 371, 181, 824, -5448, + 297, 476, 42, -133, 97, 425, 8586, -317, + 121, 453, 1014, -350, 175, 747, -78, -287, + -5832, 625, 4170, -308, 1853, 2846, -3, -876, + 535, 431, -411, -2139, -6021, 374, 298, 1572, + 19, -4069, 1567, 144, 3, 5541, -438, 920, + 87, 1728, 230, 807, 5848, -413, 7, -6241, + 214, 205, 1312, -675, 70, 264, 114, -24, + -482, -72, -296, 327, 249, 11047, 11070, 18, + -937, 350, 22, 362, 555, 815, 130, -125, + -4545, 2662, 203, -318, -305, 323, 633, 416, + -254, 301, 99, 407, -4951, 4766, -790, 1334, + 912, -1046, -350, -135, 3744, 22, -1647, -422, + -151, -113, -130, -345, -2, -263, 18, -24, + -771, -34, -543, 10259, 183, 0, 1743, 1267, + -2554, 320, 611, -1064, -1446, 875, -808, 4865, + -816, 3452, 68, 326, -178, 177, -10, -138, + -33, -93, 65, 264, 185, -157, -5749, 110, + 407, 1240, -698, -61, 176, 1557, -6012, -606, + -555, 458, 3226, -939, 933, 153, -32, 928, + 69, -490, -1543, -87, -20, -196, -327, 423, + 7911, -189, 178, 335, -194, 459, -10572, -196, + 174, -286, 502, -1041, 12, 39, -101, -3983, + -1650, -2902, 386, -151, 1051, -619, 6854, 3408, + 1140, -1854, -755, -40, -1108, -1502, 221, -397, + 375, 1081, 10375, 389, 270, -239, 311, -212, + 384, 1237, -2951, 199, 5281, -56, 34, -704, + 942, 1169, 33, -310, 97, -1216, 3023, -836, + 3256, 404, 3951, -257, 2139, 111, 179, 8255, + 611, -240, -252, -367, -251, -296, -2282, 957, + 61, -265, 720, 232, 34, 146, 204, -290, + -9923, 529, 65, 696, 2958, 352, -3852, 1248, + -743, -395, 5969, 92, -132, -1206, 314, -4013, + 717, 5157, -770, -1878, -1201, -958, 525, 4028, + 116, 6772, -45, -1086, -335, 5815, 51, 57, + -85, -2301, -133, -300, 7, 227, 3429, -1075, + -4353, -832, 30, 1259, -484, 451, 604, -717, + 6765, 294, 118, -410, 299, 592, -3845, 66, + -502, -9088, -74, 259, 450, 475, 202, -1792, + 23, 4719, 709, -398, -1676, -351, -898, -622, + 145, -1392, 7305, 1014, -80, 519, -2065, 1531, + 860, -1448, 134, 1683, 689, 7179, -345, -327, + 1004, -2467, -340, -1302, 5825, 373, 50, 6796, + 314, 13, -270, -426, 702, 279, -4392, -508, + -6521, 60, -278, 2479, 847, -360, -68, -1948, + 91, 969, 421, 459, -341, 6020, -550, -77, + -687, -754, 5, 109, 410, 10860, -183, -317, + -734, -87, 501, -601, 158, 5836, -1057, 1236, + -850, 2965, -330, 547, 1249, -2804, 127, 218, + -455, -805, -4002, 108, -569, 660, -5356, -1091, + 581, -445, -311, 6409, 510, -6789, 519, 1607, + 296, 342, 368, -1440, -846, 1997, -227, 2332, + -2062, -4657, 1030, 5322, 135, 131, -3414, 320, + 1030, -3341, -256, -373, -4565, 1222, 171, -4972, + -1444, 303, -5427, 435, 208, 251, 467, 539, + 136, 199, -8876, -195, -771, -3096, 740, 368, + 1047, -490, 83, 485, 168, 531, -635, -801, + -953, 4, -95, -7603, -59, 2023, 739, -702, + 263, -9230, -313, -997, -510, -772, 156, 3986, + -113, 398, -2602, -1079, 195, -211, 128, 1917, + 221, -965, 11, 71, -101, 180, -36, 7839, + -144, -722, 288, 429, 5704, -984, -510, 775, + 440, -1849, -1348, 1989, 300, 43, 1928, 4341, + -3840, -2427, 2025, -660, -293, 23, -249, -177, + -327, -7858, 33, 245, -1334, 237, -687, 2800, + 30, -8807, -404, 43, 183, 289, 528, 510, + -197, 590, -94, -5423, 381, 1317, 141, -1639, + -432, -7628, -224, 56, -7788, 113, 134, 6981, + -636, 756, -743, 97, 159, 1263, -143, -2941, + -2680, -479, 1395, -1667, -472, -992, -451, -5708, + 4262, 334, 3053, 76, -584, -599, -276, 3518, + 264, -2118, 358, -106, 911, 5053, 480, 4538, + 949, 5203, -103, -14, 177, -3397, 55, -6813, + 680, -1788, 145, 2267, 1104, -789, 54, 261, + 228, 5494, 15, -224, 192, 740, 0, 7632, + 398, 2879, 430, -8212, -657, 815, -228, -488, + -90, -1296, 595, 2979, -15, 4055, -252, -3883, + -935, -7654, 330, 97, -10200, 462, 223, -1017, + -309, -342, -124, -1258, 211, 351, 316, 414, + -91, -18, -202, -74, 410, -11127, 326, 261, +}; + +static const int16_t shape16[] = { + -855, 1549, -4841, 629, 932, -5896, 840, -2041, + -305, -2574, 343, -31, -780, -773, -353, 403, + -1907, -2371, -555, -324, -479, 6961, -286, -4290, + 626, -953, -14, -1681, -443, 1504, -366, 513, + -1206, 870, 9239, 112, -213, 425, 381, 1802, + 750, 594, 61, -152, -2060, -8997, -752, 197, + -493, -176, -389, -591, 2988, 654, 2404, -204, + 304, -279, 202, 66, -185, 415, 159, -1514, + -6775, -37, -2617, -1246, -4012, 1208, -554, 3240, + -655, -394, -1464, -4448, 388, 1058, -364, -1760, + 1081, -558, -116, -108, 99, -925, 763, -1301, + -251, 258, -33, 311, 555, 227, -279, -601, + -135, -675, -10615, -937, 158, 503, -2044, 1075, + -114, 4278, -9040, 67, -1076, -705, -122, -533, + 3299, -1826, -1316, 708, -3840, -740, -370, -1074, + 87, -462, 2177, -1177, 57, -6311, -170, -777, + -256, 435, 291, 10371, -82, -425, -1757, -196, + 3824, -6289, 62, 4506, -519, -783, 1155, 878, + 295, -2044, 305, 186, 263, -1716, -482, -5678, + 415, 2709, 213, 7531, 1376, 813, 1803, 190, + 398, 6483, 1425, 235, 2713, 520, -2892, -1191, + 6074, 654, -6535, 320, -736, -478, 2563, -309, + -3477, -155, 275, 1024, 390, -386, -331, 14043, + 251, -410, 1496, 24, 1272, -816, 549, -238, + -2489, 158, 194, 1, -306, -3088, -264, 200, + -30, -520, -472, -30, -464, -764, 440, -659, + 88, 778, -31, -1794, -3817, -344, 887, -551, + 115, -763, -5338, 2906, 50, 736, 5536, -1101, + 330, -405, 416, 1022, -93, 71, 10034, -200, + -1258, -3405, 480, 141, 399, 500, 311, -503, + 301, 4398, 454, -922, 975, -101, -775, -81, + -1723, 1077, 857, -1682, 813, 847, 342, -276, + 3582, 2991, 5571, 713, 1280, 596, -1325, -1087, + -681, 1411, 391, -1728, 492, 544, 1512, -724, + -7445, -426, 6, -534, -3643, -1598, 2650, -834, + 2096, -333, 67, 1746, -1584, -1003, 1272, 1710, + 1666, 176, -11716, 329, -1829, 385, 802, -382, + 2244, -8, -222, -2351, 369, -1067, -9354, 293, + -51, -1849, -500, -2350, -1824, -826, -450, -2155, + 456, 245, 1796, 320, -73, -306, -122, 290, + 118, -298, -675, -180, -828, 86, -44, 165, + 435, -8249, 769, 630, -1670, -762, 453, 5893, + 259, -92, -1003, -358, -32, -1350, -535, -289, + 409, -558, -344, -752, 6037, -680, 2471, 581, + -351, 1251, -5827, 194, -104, 815, 1257, -619, + 243, 410, 4455, -969, 50, 1286, -1013, -293, + -7740, 73, 615, 523, -149, -824, 2235, 1571, + 970, 944, 4778, -132, -5082, 83, 129, -820, + -803, 694, 1615, 1163, 517, -402, -80, 762, + -107, -419, 142, -294, 11298, 301, 484, -513, + 105, 547, 1130, -4253, -742, 376, -1545, 1076, + 4372, 2338, -2847, 495, -190, -2444, 931, 6487, + 117, -1273, 1488, -75, -322, -487, -2614, -251, + 1233, 4111, -321, -219, -7961, -11, 107, -808, + 450, 111, 4395, 89, 772, -1878, -1894, 1075, + -544, -9467, -459, 637, 842, -956, -738, 4452, + 777, -75, -209, -302, -796, 785, -7413, 321, + 649, -55, 114, 43, -1026, -223, -611, 209, + -5543, 8206, 907, -3358, 1452, -543, -3173, 525, + -95, 35, -475, -525, -705, -569, 350, 206, + -108, -1523, -680, -283, -2583, -4992, -59, -968, + -1719, -2750, 5884, 455, 29, 436, 784, -101, + -216, 110, 612, -511, -12, 98, -67, 177, + -1210, 222, -345, 243, -12670, -472, 282, -2149, + 687, -2631, 4434, 77, -521, -404, -934, 212, + -695, -369, 1138, 1348, -905, 501, 299, -10467, + 1018, 818, 1941, 31, 257, 1219, 944, -157, + 1968, -1649, -126, -440, -599, -1, 6190, 2574, + -332, 753, 195, -131, 5972, -297, 672, -86, + -143, -303, 5, -121, -154, -613, 5541, -1516, + -304, 962, 69, -1857, 4142, -134, 706, 896, + -1226, -135, -310, -9261, 1135, -3437, 620, 802, + -33, -582, 1909, 1407, 242, 2599, -1533, -279, + 836, 8070, -1207, 5745, 200, -77, 162, 781, + -466, -1555, 3297, -957, 225, 1290, 7, 677, + 41, -549, -2778, 1400, 379, -3367, 369, 615, + -6402, 527, 58, 5679, -114, -180, 2842, 88, + -2611, -50, 371, 161, -444, 2062, -38, 272, + -8562, 769, 18, -2593, -226, -503, -959, -1295, + 189, -371, -675, -1528, -98, 514, -1236, 116, + 202, 13662, 1596, -328, 61, 3567, -486, -3316, + -8473, -317, 2868, -419, -17, 535, -965, -503, + -3848, 2222, 620, -1740, 2, 6505, 473, -297, + -70, 3043, -51, -1520, 993, 1046, 1965, 3240, + 1971, -60, -650, -53, -248, -4428, -365, -3723, + 1122, -1681, 1629, 1358, -17, 1136, -256, 2344, + -282, 156, 127, -155, 318, -1281, -1066, 57, + -889, -253, -1396, -579, -920, -1006, -9202, -703, + 195, 5186, 241, 1742, 996, 118, 1431, 4415, + -2452, 6837, -1272, -569, 3485, 328, 441, 832, + 553, 94, 648, 92, -378, 11167, 775, 457, + 1712, -24, 941, 5433, -1645, 2166, 249, -55, + -1816, 383, 735, -876, 443, -568, 293, -1266, + 6963, -178, -174, -1186, 1119, -208, 821, 1499, + -1496, -2171, 1434, 874, 133, -7466, -545, 2193, + -775, -1405, -1205, -575, -1996, -645, -552, -263, + 8861, -517, 76, -992, 278, 2417, -1369, 35, + -1461, -1399, 517, 185, -2895, 347, -3871, 3644, + 284, 3284, -12, -169, -1981, 1196, -67, 2868, + 910, 134, -530, 150, -1328, 1902, -746, 351, + -222, 522, -5702, 797, -1900, 241, 2270, 764, + -335, 1348, -349, 784, -1586, -537, 148, 3211, + -1692, 56, 1678, -321, -290, 7902, 69, 52, + 310, 337, 250, 596, 9998, 336, 1037, 163, + 64, -441, 2894, -1033, 730, -718, -1252, 459, + -131, 7840, -922, -555, 5671, 299, 689, 1115, + -646, -505, -263, 608, -494, 0, 442, -1802, + -598, -701, -4184, 70, -1319, -90, 9155, -339, + 0, 121, 462, 735, -639, 481, 125, 6924, + 3379, 683, 3053, -1219, -499, 1067, -148, -2705, + -11, 795, 1675, 898, 226, 1232, 49, -572, + -9309, 2223, 949, 767, -821, -91, 1075, -352, + -7829, 554, -593, 1284, -245, 1239, 1166, -1157, + -5274, 808, 871, -1446, 7575, -397, -755, 752, + 4193, 179, -205, -37, -750, -2675, -407, -700, + 220, -77, 1604, 63, 461, -9994, -645, -1629, + 103, 576, 132, 10005, -49, -1005, 97, -1608, + 515, -10, -146, -1878, 880, 429, -1271, 996, + -365, 76, -409, 2461, 29, 1159, 217, -6240, + -200, -746, 118, -1884, 457, -816, -608, 3215, + 244, 749, 2268, -236, -1276, -278, 1392, -1767, + 1255, -1474, -8136, 1388, -770, 225, -443, 10, + -392, 659, -1118, -1651, -514, -935, -111, 1112, + 973, -247, -235, -13010, -737, 40, -141, 5167, + -910, 279, -467, -3762, 847, -3935, 1018, 1922, + 830, 190, 253, -1130, -415, 371, 718, 3833, + 1036, -5358, -928, 866, -514, 2724, 2354, 449, + 210, 1462, 680, -1880, -62, 10988, 809, -602, + 145, -536, 114, -147, -568, 3193, -322, 892, + -637, -1381, -65, 761, 1615, 5025, -327, 4941, + -631, -5225, 1204, 3042, 998, -1047, -959, -106, + 1610, -151, 120, -1152, 191, 30, 11963, 101, + 18, -410, -1288, 370, -771, 1337, -544, -613, + 289, -117, 1625, -4506, 2582, -1690, -105, -5324, + -93, 285, -1167, -3564, -729, -4790, 595, 275, + -216, -217, -6000, 682, -171, -875, 224, -164, + 2919, 796, -81, 1434, 186, -375, -4113, -179, + 277, 1363, -453, 2505, 388, -1840, -165, -4800, + -42, -6632, 54, -735, -553, -1679, 917, -2, + -632, 417, -478, -494, -265, 73, -372, -360, + 179, -448, 265, 299, -152, -211, 12730, -77, + 1954, -534, 773, 524, 438, 1901, -4413, -358, + 1552, -248, -1588, -122, -127, 5405, 226, -849, + -7495, -357, -89, 185, 746, 851, 669, 305, + -247, 3457, -193, -161, 638, 600, 610, 855, + -1292, 398, 1528, 2250, 1651, -8414, 763, 1529, + -346, 3769, -111, -6494, 347, -742, 1941, 1967, + 582, -5499, -765, -818, 1850, -1604, -243, -943, + -11, 884, -2996, -2375, 1010, -374, 6605, -287, + -5073, 211, -758, 703, -2607, 747, -130, -429, + -2481, 4894, -457, 3225, 958, 8533, 542, 6177, + -1069, -1210, -963, -5943, -86, 1424, -567, 827, + -510, -6577, -258, -4, -4430, 115, 5401, 1390, + 354, 1755, -998, 852, 993, -481, 218, -987, + 779, -417, 591, 6011, 528, 289, -336, -558, + 60, 9124, -174, 235, -239, -144, -260, -3472, + 746, 4781, 652, -4831, -739, -21, 864, -2310, + 652, 7147, 116, -318, -50, -3485, -325, -345, + -5784, 1144, 2399, -1443, 991, -2318, -785, -281, + -207, -1448, 309, 1001, 952, 1472, -5901, -780, + -2459, 1518, 9878, -1229, 670, -523, 1217, -164, + -55, -95, 243, 7909, 86, -4380, -859, -599, + -183, -2339, 774, -1210, -502, -899, 53, 1039, + 34, -7753, -296, -1951, -4559, 1182, -150, 2878, + -4910, 2761, -1481, 2048, 2600, 1808, -2953, -2257, + 62, 162, 1115, 214, -4510, 926, -6669, 1443, + -124, 193, -314, 302, 699, -18, 745, 341, + 895, -615, -295, -181, 143, -427, 6528, 1074, + -1126, 374, -298, -1274, 22, 887, -511, -1057, + 3228, 722, 607, 624, -95, 11085, 1006, -788, + -285, -92, 1342, -325, -828, 42, -3588, -631, + -576, 4559, -668, -1294, 1739, 1697, -647, 2336, + 376, -120, 1350, 646, -325, 95, 5974, 775, + 199, -8557, 931, -336, -651, -561, -433, -2266, + -129, -657, -1184, 67, 577, 617, 1880, 552, + 90, -617, -273, -1571, -7481, 261, -26, -20, + -459, -1028, 57, -8516, -43, 2774, 1, -4238, + 680, -3310, -56, -152, 548, -1983, 920, 899, + 2180, -307, -2230, -1685, -998, 2091, -112, 21, + -1551, 1182, 6649, -326, 792, 1818, -7596, 563, + 1076, 7422, -908, 1524, -223, 5798, 1318, -3376, + 517, 4162, 756, -4142, 1776, 390, 334, -44, + 218, 5290, 792, 39, 1692, 542, -62, -595, + 590, 27, 8922, 989, 182, 725, 112, 458, + -9170, -1000, 1176, -1290, -1403, -726, 5990, -297, + 1234, -1724, -601, 528, 1072, 184, -146, 61, + 685, 1208, -88, -211, 356, 9569, -363, -135, + -159, -1061, -105, -410, -58, 335, -9986, -300, + -211, 607, 443, -410, -1730, -328, 275, 579, + 805, 899, -464, -18, 296, -446, 2396, -13, + 414, -9662, -385, -808, -1867, 154, -572, 3351, + -1839, -80, 1157, -326, 481, 8815, -1039, 1065, + 2110, 1223, -960, -33, -464, -5660, 490, -314, + 346, 730, -387, -1102, 6656, -719, -1173, -57, + -1186, 2394, -1300, -665, -586, -39, -71, 155, + 1184, 4, -3269, -333, -747, 580, 279, -583, + 7164, -185, 110, 2465, 428, 507, 4462, -4461, + 199, 337, -3597, -249, -70, -680, -5549, 1533, + 917, -303, -9230, -431, -124, -1019, 369, 139, + 1367, 151, -1047, 6820, -151, 222, -2934, -817, + 971, -7325, 556, 1035, -1240, 3115, -1326, 4012, + 2812, 1057, 2580, -261, 3989, 1999, 1624, 2402, + -310, 779, -354, -377, -149, 1035, -2363, 358, + 3666, -246, -1896, 375, 3919, -1392, 683, 624, + -5872, 644, 391, 288, -198, -237, 68, -284, + 88, -1016, 250, 32, 1188, -243, -608, -320, + -219, -11087, 543, 156, 1034, -169, -183, -549, + -66, 716, 996, -928, -309, 5577, 229, 125, + -1328, 9027, -698, -485, -1694, 839, 343, 449, + 1655, 1005, 1053, -408, 9106, 186, 670, 774, + 314, 573, 3888, -882, 26, 2518, -533, -195, + 555, 337, -246, -10779, -231, 31, -314, -941, + 1129, 333, -7503, 168, -551, 237, -159, 4399, + 421, 693, 198, -196, -561, 1035, -548, 1058, + 527, 3617, -361, 1317, -1975, -2638, -1966, -120, + -324, 5678, -2252, -663, 181, -273, -3073, -282, + -622, 363, 71, 184, -776, 284, -1516, -430, + 3, 937, 8587, 258, -1060, -1555, -830, -338, + 318, -9130, -110, 459, -572, 70, 93, 120, + -534, 1296, -168, 29, -914, -332, -997, -818, + 270, -243, 523, 56, -11847, -448, 11, -154, + 164, 2115, -13, -635, 708, -663, 43, -248, + -3244, 254, 19, -1125, 508, 154, 8697, 191, + 595, 4393, -2806, -168, -1916, 393, 3976, 897, + -1716, -35, -180, 605, -1057, -1194, 100, -384, + -37, -107, 2739, -207, 6899, 176, 81, -901, + 1280, -1670, -101, 281, 1147, 48, 21, -151, + -1236, 210, 98, -114, -573, 7940, -153, -302, + -1331, 337, -322, 6598, 477, 147, -999, -3166, + -232, -5104, -799, -1866, -58, -4213, 1376, 181, + 675, 562, 126, 235, 2260, -5152, -243, -699, + -1476, 4135, 569, 567, 737, -4163, 613, -1057, + 1778, 546, -450, -24, 325, 366, 2406, -1319, + 60, -5126, 49, 657, -5937, -194, 882, 3267, + 178, -298, 1873, 12422, 459, 272, 195, -1827, + 212, -802, 730, 471, 1556, 422, 640, 236, + 71, 597, 5783, 5378, -649, 1524, 829, 437, + -351, -122, -1400, 2119, -128, 75, -1677, -633, + -322, -6382, -573, -974, 1672, -378, -242, 3708, + 79, -1325, 397, -150, 1977, 442, 747, -127, +}; + +static const int16_t shape16s[] = { + -392, 96, -7720, 99, 524, -8272, -20, 164, + -434, -85, -428, 1362, 108, 223, 1053, -11, + -193, -5140, -191, -159, 193, 8005, -39, -483, + 1764, -1061, -268, -318, -880, 474, 49, -8, + -223, 130, 11263, 165, 12, -43, -103, -1145, + -588, -81, 299, 73, 444, -7243, -1411, -640, + -946, 16, -881, 496, 2403, -476, 1090, -294, + 29, -148, 109, 145, -52, 247, -545, 1115, + -7451, -491, -1459, 397, -8603, -1022, 1494, 298, + -5156, -358, -1097, -2911, 423, 652, -378, -2357, + -74, 415, -367, 402, 2173, -154, 122, 283, + 1352, 302, -373, -431, -283, -109, -64, -343, + -108, 55, -14644, 241, 37, -723, -71, -208, + -126, 4061, -9887, 494, 2273, -505, -4040, 66, + -806, -1121, -1894, 783, -1445, 426, -820, -1739, + -11, 650, -282, -518, 124, -7266, -21, 160, + -339, 5, -208, 11712, 198, -53, 921, 89, + 5987, -4806, 176, 1884, 64, -517, 2169, 108, + 297, -111, -389, -840, 663, 75, -485, -4862, + -177, 2663, -229, 8120, -219, 462, 3104, 955, + 384, 1310, -73, -504, 258, 170, -1796, -482, + 5691, -437, -8474, 583, -1685, -827, 292, -65, + 1994, -384, 105, 123, 256, -82, -367, 15204, + -128, -260, -10, 169, 249, -1286, 1055, 136, + 678, 61, 1420, -159, -15, -221, -250, 107, + -21, 297, 54, 242, -111, 468, 237, -36, + -159, 37, -102, -488, -4577, 72, 1009, -1, + 1218, 2023, -640, -437, 766, -299, 6144, 184, + -1023, 171, -388, 884, -1294, -320, 8718, 896, + -295, -976, -803, 3092, 1720, -255, -1354, -665, + -63, 4382, 41, -121, -157, 354, 127, 587, + -599, -231, 484, -150, -284, -498, -511, 79, + 5503, 13, 6537, 761, -1619, 1164, -2403, 3057, + -4966, 724, 1076, -1555, 889, -365, 60, -440, + -7144, -132, 283, -305, -126, -1482, 125, -52, + -33, 1284, -961, 1355, 953, -1012, -227, 86, + 731, -14, -15977, -56, -875, -1676, 127, 500, + 3390, -14, -319, -644, 143, 249, -10752, 23, + 54, -1075, -111, 680, -1714, 328, -2092, -852, + 622, 949, 61, 6, -17, 144, 190, 216, + 130, -65, 27, -322, -139, 43, 89, 76, + -84, -10120, -47, 367, -261, 38, 50, 4233, + -210, 14, -1, 25, 762, -299, -132, 177, + 974, -492, -145, -43, 5105, -394, -196, -91, + -25, 473, -8358, -476, 589, -1372, -254, -2387, + -293, -304, 3828, -254, -193, 493, 54, -108, + -8789, -262, -233, -821, -222, 714, 1270, -61, + 892, 13, 3952, -36, -1567, -620, -126, -1056, + 587, 390, -24, 2027, 267, 218, 15, -56, + -130, 40, 551, -29, 14594, -23, 106, -14, + -172, 279, 427, -241, 303, -20, -748, 55, + 5187, 598, -217, 2026, 643, 118, 911, 8023, + 296, 791, 39, -2621, 655, 228, -671, -272, + -176, 6644, -166, -264, -10429, 91, -83, -684, + -169, -344, 2123, -102, -333, -317, -826, 586, + 116, -9311, 445, 141, -1315, -758, 144, 5620, + 363, 66, 142, -161, -684, 454, -6584, -205, + 577, 205, 305, -1536, -4109, -318, 121, -323, + -1036, 8020, 1146, -4004, 175, -1568, -1537, -525, + 2284, 62, 11, 640, 1243, 260, -104, -344, + 102, -624, 122, -300, 266, -6104, -1149, 412, + -1380, 22, 7561, 360, 564, 398, -338, 174, + -76, 131, 44, -426, -12, -175, -113, 78, + 293, -120, -92, 331, -16163, -74, -101, -1198, + -298, -171, 4052, -139, -187, 131, 323, 370, + -144, -160, 131, -284, -190, 83, 878, -14817, + 14, 196, 198, 294, -120, 40, 800, 1841, + 393, -168, 337, -540, -356, 130, 9210, 880, + 304, -2304, -275, 1394, 9903, 673, -62, -4706, + -130, 274, 528, 89, -458, -90, 6318, -133, + 310, -5953, 682, 37, 2937, -371, 197, 77, + -184, 1240, 22, -7695, -171, -4874, -676, -1121, + -842, -642, 1160, -1088, -864, 352, -790, 794, + 801, 10564, -1777, 1095, -441, 1718, 116, 982, + -268, 199, -2408, -2042, 279, -146, 645, -1350, + 5, -150, -932, 113, 25, -672, 153, 158, + -6140, -262, 142, 4815, -1, -424, 810, 63, + 88, -510, -236, 3964, -66, 1229, -16, -758, + -11023, -1149, 48, -1756, 167, 2308, -96, -654, + -639, 369, -221, 47, 202, 329, -352, -26, + -19, 13198, -383, 124, -1211, 3879, -344, -1954, + -8702, 32, 924, 472, 7953, 692, -216, -415, + -3174, -1959, 935, 4048, 155, 7521, 854, -157, + 643, 3760, -107, -2536, 622, -742, 1881, 2262, + 758, -968, -271, -131, 385, -5107, -212, -2548, + 29, -132, -506, -190, -1065, 314, 202, 332, + -2274, 701, 4, -22, -439, 198, -265, -92, + -143, 460, -32, 189, 334, 87, -7639, 45, + -387, 4240, 1231, 92, 1032, -333, -280, 2061, + 296, 365, 2003, -426, -35, 96, -62, 882, + -784, 483, -128, -143, 474, 13740, -166, 184, + -714, 142, 278, 5622, -67, 282, 647, -130, + -31, 300, 727, 728, 409, 178, -601, 84, + 8305, -446, 179, 115, 209, -273, -47, 1932, + -255, -3171, -102, 461, -119, -8102, -809, 108, + -1680, -3171, -775, 324, -246, 132, -27, 84, + 8495, -45, 153, 21, -1384, 290, -869, 38, + -440, 133, -257, -22, -3046, 12, -2797, 4517, + 142, 1605, 423, 579, -558, -301, -257, 701, + -246, -468, -1946, 120, 321, 710, -217, -203, + -50, -44, -5866, 80, 259, 488, 754, 124, + -517, 703, -197, 146, 576, -717, 247, 4121, + 10, -422, -2686, 329, 1183, 14573, 72, 301, + 2043, -125, -1420, -1263, 10340, -678, -1226, 330, + -62, 173, 5885, -56, -178, -1090, -616, 953, + -216, 8277, -124, 411, 7758, -78, -326, 786, + 46, -1365, -555, 479, -774, -576, 8, 304, + 390, -186, -820, 72, -67, -585, 11070, -213, + -12, 344, -399, -748, -150, 2719, 195, 5652, + 4626, 549, 2782, -4, 1928, 482, 1008, -6398, + 843, 457, 1843, 269, 1247, 350, -661, -35, + -6477, 3727, 2313, -424, -907, 415, 1075, 3960, + -1499, 61, 594, -744, 110, 2486, 967, 27, + -5263, -618, -578, 313, 7055, -1081, 739, -492, + -2051, 317, 112, -155, -304, -507, 150, 253, + -42, 221, 92, -275, -355, -8494, -663, 109, + 282, -836, -271, 9316, 165, 63, -171, 10, + -38, -180, -219, -250, -924, -573, -241, 566, + -175, 20, 454, 251, -328, 236, -215, -5673, + 0, -265, 225, 354, 113, -488, 174, -132, + 134, -188, 1255, -94, -55, -193, 404, 504, + 784, -377, -5731, 333, -447, 222, 138, 72, + -256, -58, -230, -169, 728, -481, 95, -394, + -74, -489, -253, -13770, 61, 184, -36, 5025, + -232, 321, 253, -3414, 120, -2512, 799, -586, + 1186, -1135, -955, -54, 7, 83, 0, 5259, + 466, -6358, 254, 388, -211, 207, 2449, 379, + 430, -219, -442, 228, 151, 11819, 67, -101, + 239, -282, 121, -270, 1209, -386, 553, -108, + 789, -518, 237, -48, 497, 8986, 80, 8232, + -89, -359, -803, 473, 995, 1132, 624, 1353, + -305, 711, -71, -26, 18, 254, 13079, -72, + 178, -18, -116, 293, 155, -254, -819, -166, + -808, -190, 150, -4328, -33, -14, 272, -6417, + 78, 78, 67, 310, -177, -435, 225, 610, + -15, 1, -6706, 30, 1, -189, 270, -21, + 276, -182, 77, -231, 30, -116, -7713, 158, + 344, 560, 1466, 3575, -84, -4583, -1260, 372, + 1395, -5223, 284, -1911, 315, -2312, -47, -207, + 414, 129, 36, 85, 317, -125, -63, -212, + -76, 130, -385, 157, 117, 12, 16140, -171, + 375, -721, 161, -342, 950, -667, 1011, 15, + 536, -1203, 1039, -242, -159, 7664, -429, -264, + -8221, -109, 867, -74, -79, -414, 544, 206, + 120, 1859, -44, 73, 554, 121, -160, -127, + -33, 44, -24, 285, 589, -12514, 51, 464, + 17, 264, 58, -6861, 367, -672, 227, 2793, + 782, -6286, -420, -808, -1247, 895, 950, 1533, + -1079, -207, -1927, -4947, -803, -328, 7677, -386, + -4608, -329, -485, 2365, -1492, -1738, -378, -707, + -1850, 9044, 314, 3530, 61, 2921, 79, 9508, + -1102, -3487, 814, -2828, 550, -929, -712, -274, + -566, -2521, 536, -296, -97, 951, 11352, -614, + 106, -342, -1017, -1183, -157, -457, 266, 109, + 545, -313, 1015, 6961, 52, -224, 2247, -248, + -180, 12367, 311, 514, 1218, -561, -2546, -3275, + 218, 8281, 187, -6550, -96, -1001, 1777, 89, + 916, 1042, 399, -267, -97, -3552, 397, 1984, + -6134, 784, 2136, -1346, 619, -1450, -1022, -1226, + 185, 306, -274, -122, 343, 129, -4481, -749, + -759, -496, 8785, -178, 457, -601, 875, 1040, + -268, -1592, -531, 9667, 360, -4978, 525, -436, + 123, -1566, 227, 820, 74, -5, 1477, 154, + -1589, -9411, 248, -485, -3293, -690, 175, 53, + -21, 303, -2376, 106, 515, 2688, -401, -1278, + 425, 540, -353, 662, -7461, -397, -7029, -976, + 445, -1648, 164, -254, -563, 556, 876, -205, + 884, 214, -92, -509, 96, -53, 5734, -295, + -136, 211, 168, 261, -74, 411, 25, -59, + 3596, 400, 320, -69, -21, 14062, -510, 142, + -232, 1597, 34, 240, -476, 131, -3836, -186, + 2579, 2812, -1501, 274, 2685, 2809, -1100, 2696, + -402, 67, 650, -1804, -11, -216, 6751, 112, + 455, -7210, -251, -1075, -833, -966, 1443, -138, + 273, -494, 1557, -15, -339, -82, 402, 206, + 31, -77, -94, 78, -5468, -179, -44, 421, + 163, -386, -133, -6334, 427, 747, -121, -292, + 368, -1087, -338, -1534, 3740, -881, -2012, -1284, + 902, 97, -3407, -567, -118, 1340, -77, -445, + 642, 184, 901, -341, -81, 595, -6531, -248, + -167, 8740, 373, 408, 23, 10709, -299, -876, + -584, -1067, 20, -4556, 295, -1956, 990, -132, + -152, 4068, -92, 142, -1512, 23, -815, 454, + 330, -331, 9042, 120, -100, 34, 96, 152, + -11083, 345, -567, -498, 198, -37, 9276, -479, + 611, -2788, 253, -176, 617, -224, 248, 390, + 39, 25, -110, 127, -13, 6675, -84, 115, + 294, 84, -366, -405, -32, -109, -10469, 99, + 17, -88, -226, 316, -133, -203, -60, 311, + -87, -331, 357, -11, 158, 74, 562, 8, + 354, -10843, -114, -206, 699, -617, -141, 807, + 87, -149, 174, 199, -55, 10880, -332, 182, + 544, 651, -27, 261, -190, -655, 24, -443, + -630, 204, 207, -4174, 3557, 89, -386, 1754, + -485, -127, -97, 40, -1336, -488, -177, -750, + 88, -1040, -2215, -507, 169, 2908, 69, -52, + 8458, 601, 174, 1635, 480, 181, 3004, -3021, + 1868, -364, -2100, -256, -3065, -33, -7467, -890, + -1949, -20, -9472, -230, -847, -634, -377, -40, + 1184, 242, 265, 7056, 42, 16, -5070, -71, + 300, -1186, 187, 337, -1331, 77, -473, 3213, + 5738, 626, 2524, 531, 1001, -803, 1231, -1083, + -564, 539, 191, -498, 184, 603, -1777, -479, + 2298, -604, -2077, 634, 4682, -1387, -875, 498, + -10011, -173, 752, 109, -70, 171, -64, -261, + -79, 37, -233, 128, -66, -70, 356, -310, + 214, -14792, 6, 200, -227, 59, -241, 560, + -230, 479, 403, -22, 148, 7428, 110, -177, + 110, 7518, -2372, -1277, 223, -708, 731, 695, + -702, -2906, 256, -1160, 4941, 121, -1148, -68, + -424, -1590, 4697, 705, 525, 684, -451, -246, + -115, 556, 543, -6658, 384, -589, -1505, 12, + 114, 82, -5084, 164, 154, -295, 106, -271, + -40, -394, -437, 397, -279, -3825, -286, 632, + -1041, 1137, -93, 48, 192, -5914, -92, -235, + 682, 5817, -702, 180, -243, -219, -910, -174, + -146, 142, 12, -69, -207, -269, -53, 567, + -336, 114, 9601, -272, -270, 459, 610, -258, + 97, -10950, 397, 57, -7, 229, 1669, -173, + -173, -92, -347, -133, -357, 92, 132, -609, + 60, -124, 116, -54, -15205, 142, 109, 1127, + 268, -220, 336, -743, -238, -29, -902, 91, + -3597, -288, 1114, -3797, -1615, 32, 11481, 55, + 194, 3567, -1857, -2561, -237, -15, -48, -232, + -58, -21, 37, -535, -450, 857, 2001, 12, + 48, 840, 211, 126, 4833, 275, 176, -111, + 9, -112, -403, 182, 296, 181, -425, -14, + 276, 118, -240, 384, 139, 9183, -230, 143, + 2412, -70, 250, 10191, 809, -15, -257, -1242, + -163, -4253, -352, -436, 264, -4998, -17, -215, + 1412, 1592, 856, -159, 4756, -5032, 307, -251, + 194, 6414, -56, -7, -503, -261, -646, -1050, + -271, -578, -291, 614, 130, -336, -923, -120, + 149, -6012, 273, -295, -4586, 137, 206, 1246, + 498, 614, 991, 13776, 122, 52, -660, -76, + -211, -477, -224, 196, 411, 398, -590, 820, + -441, -35, 4394, 5010, -902, 509, 45, 747, + 1035, -455, -579, 105, 1103, -496, -1249, -248, + 46, -5771, -198, -386, 736, 15, -335, -85, + -624, -124, 580, -327, -102, -18, 866, 381, +}; + +static const int16_t shape22[] = { + 2560, -127, -137, -385, -1875, 90, -240, 140, + 1290, 200, -6762, 374, 1871, 8730, -111, -555, + -1524, -2175, -4689, 521, -179, 166, -1573, 1056, + -346, 247, -92, 5713, 561, 233, -360, 480, + -741, -7552, -1508, 259, -8746, 1604, 1385, 723, + 5678, 2243, 403, 12370, 3526, 574, 4982, 563, + 1713, -1337, 1336, -60, -890, -2184, -563, 9347, + 775, 6318, -883, 1476, -335, 736, -564, 635, + -5557, 617, 54, 257, -325, -66, -5689, 1061, + -897, 90, 8394, 2004, 9456, -222, -2026, -969, + 93, -5, -922, -6491, 1496, -1537, 651, -277, + -1038, 6072, -8534, -2526, 1645, 1459, 547, 2347, + -85, -761, -7210, -153, 414, 6096, 383, 320, + 370, -902, 823, 3071, 499, -731, 38, 473, + 1693, -9456, 946, 1218, -1054, 70, 367, -469, + -7861, -913, 401, 198, -83, 877, -308, 8633, + 253, -2025, 1925, 1412, 1351, -360, -948, -7526, + 1089, -7449, 1652, 141, -43, -2082, 44, 130, + -7525, -15049, -1345, 180, -3009, -4581, -267, 2309, + -1397, -112, -63, 307, -746, -13, 35, -8800, + -1947, -1143, -1096, -2582, -1210, 7683, -743, -1589, + 5699, -80, -1375, -93, -483, 129, 6076, -6099, + 374, -176, -1150, -416, 137, -4309, -1926, 3099, + 82, -836, 392, -655, 108, 428, 3361, 313, + 363, 7534, 1153, 334, 2262, -367, -69, -813, + -9702, 3074, -5461, 0, -1889, 1303, -8306, -113, + -677, 692, -2752, 1292, -171, 430, 4609, -2238, + 196, 1661, -25, -164, -2590, -4919, -615, -7, + -753, 5104, 5197, -66, -310, 827, -126, 615, + 70, -456, 238, 682, -639, -561, 369, 183, + 113, 430, -840, -792, -7282, -7537, 619, -445, + 588, 19, -1061, 652, 46, 861, 9641, -1251, + -41, -699, -605, -1389, 240, -10798, 733, 194, + -1230, -1092, -520, -219, 7, 518, -181, -12062, + 651, -40, 1128, -390, -220, -438, 471, 510, + 632, -321, 1393, 8827, -3241, -6683, 350, 1953, + -246, -582, -5486, -7576, -157, 888, 2965, -23, + 762, 6867, 3697, -43, -7905, -938, 2119, 377, + -25, 691, 136, -725, 7643, -730, 2024, -6932, + 804, 53, 392, 440, 336, 6235, -7037, -5584, + -1579, 1115, 1757, 1001, 32, -294, -592, 300, + -764, -8879, -1612, -845, 1722, 6968, 384, 267, + 862, 10830, -364, -1138, -49, 1041, -908, -14960, + 809, 628, -1150, -1348, -437, 805, 877, -64, + 1041, 5253, -270, 2022, 1253, -992, 11015, 2686, + 17, 80, -1463, 4229, 80, -834, -9286, 1179, + 66, -39, -64, -4057, -423, 116, -1441, -1733, + 752, 1674, 1443, 757, -3149, 9057, -3522, 4007, + -893, 1179, -388, 6368, -478, 4397, 13868, -2996, + 790, 704, -2299, -6003, 449, -5410, 1999, 181, + -1807, -362, -57, 454, -2371, 3658, -485, -212, + 11551, 1535, 478, -1570, -278, 584, 608, -5211, + 6965, 1042, -168, -337, -1071, 72, 451, -204, + -1000, -1044, 689, 186, -166, -375, 9426, 363, + 93, -717, 304, 107, 7853, -1251, 1093, 692, + -742, 33, 576, 447, 678, 452, 408, -4813, + 711, -595, -516, -1108, 1941, 3056, -219, -3413, + 10946, 1513, -2375, 48, -408, 49, -399, -5608, + -58, 161, 4808, 436, 68, -5675, 230, 832, + -1228, 6382, -588, -1312, 772, 4337, -405, -5467, + -222, 1382, 2158, 620, -840, 810, -3830, 48, + -101, 529, -2670, -249, 1035, -7620, -1081, -6646, + 1469, 1043, 743, 1553, -556, -274, 68, 238, + 1078, -110, -5163, 562, 735, -8317, 1202, -1325, + -962, 61, 4280, 570, 7450, 265, -1516, 696, + -1567, -681, 0, -4064, 1548, -2521, 657, 567, + -8343, 1691, -1430, 4827, 807, 905, -2601, -7415, + 921, -1741, 363, 309, 211, -521, 3013, -797, + 648, -3709, 961, 662, 403, -386, -719, -5752, + 1355, 6717, 191, 591, -371, -1225, -5125, 800, + -252, -5769, 1101, 657, -141, 2377, -1365, -218, + -114, 148, 276, 358, -354, 18, -31, -9413, + -5514, -1458, -220, 298, 666, 659, 359, 980, + -1389, 101, 1500, 4661, 472, 264, -7590, -1469, + 41, 38, -259, -346, -486, -9949, 812, 422, + -1354, -2461, -2057, -253, 1806, -107, -41, 16384, + -140, -684, 5421, 1907, -10, -889, -1877, -6815, + -818, -5854, -3196, -895, -1706, -186, 7944, 100, + -11260, -4573, -415, 4685, 395, -6035, 5789, -4566, + 624, -2146, 570, 130, -892, 1385, -262, 6638, + -2324, 348, -288, 607, -1574, 7119, -1037, -40, + -4955, -946, -5215, -1013, -1232, -875, -78, -399, + 231, -173, -5860, 189, -755, -8265, 745, 966, + 202, -1858, -26, -658, 55, 1131, -56, 3030, + 158, 3742, -1261, 317, 6397, 521, -508, -522, + -2040, -747, -6906, -868, -110, -719, 2602, 2570, + -1106, -787, -352, 9212, -545, 7339, -10183, -726, + 1104, -1118, -1655, 383, 1370, 1412, 528, -4689, + -398, -3802, -682, -11004, -2310, 8011, 2301, -5941, + -512, 3813, 210, 1379, -15209, 1143, -2344, 2459, + 2368, -6484, -2078, -246, 383, -204, 1449, -453, + -1539, 416, 508, -7168, -1930, 4279, 453, -215, + -296, -346, 5691, -200, -855, 552, 5921, -109, + 588, -3049, 1312, 6767, -78, -7204, 1187, -754, + -1043, -455, 412, -490, 3124, -273, 1468, -546, + 552, -306, 835, -263, -7234, 324, 318, -1224, + 240, 198, 193, -550, -684, -12416, 85, -1469, + -463, -301, 180, 290, -928, -6399, -931, 176, + 310, -692, 7964, -204, 512, 975, -6415, -394, + -30, -120, 1638, -1474, -381, 5912, 156, -830, + -575, -225, -4079, -787, -957, -801, 181, 575, + 1116, -795, -743, -981, 434, -365, -9780, -1814, + 1447, 1081, 153, 884, 8697, 259, 881, -661, + -1232, -547, 464, 898, -3988, -476, 790, 7589, + -525, -809, -2900, -1271, 170, 223, -5050, -2554, + 1458, -666, 537, -6733, 212, 448, -1556, 1459, + 802, -2716, -8785, 11020, -258, 1229, 1138, 843, + 508, 103, -657, 1273, 8140, 368, -605, 6856, + 110, -423, 5458, -417, 993, 257, 5552, -47, + 1401, -119, -1320, 6193, -1196, 56, -93, -1604, + -1491, -897, 238, 823, 4213, 104, 145, -1049, + -9286, -26, -813, -139, 499, -10351, -466, -515, + -1166, -412, -746, 503, 1872, 17, -11941, -3350, + -108, -7296, -411, 4811, -1870, 162, 5595, -658, + 339, -904, 6911, -715, -240, -71, 377, 4747, + -57, -8920, 521, 753, -375, -1185, 1322, -328, + 5, 525, -610, 127, 1519, 791, 784, -16384, + 116, -1007, -352, 486, -7871, 202, -3684, -387, + 676, -8942, -713, -447, -557, 1159, 974, -380, + -1183, 1049, -9, 838, -932, -139, 371, 1688, + -7617, 1192, 2350, -220, -4558, 2681, 1568, 102, + 1274, -446, -351, 1551, 1101, -8995, -5276, -4416, + 3411, 221, -429, 412, 1625, -4575, 254, -631, + 310, -378, 9743, 859, 934, 142, -1400, -6921, + 6466, -4068, 2664, 418, 70, 284, -903, -23, + -502, 4354, -5993, 125, -34, -1246, -1946, -204, + 1002, -7454, -88, -8628, 2449, 13715, 318, -8759, + 294, -2212, 138, -761, 285, -1686, 291, 606, + 180, 761, -359, -1467, 299, -417, -361, -895, + -5692, 127, -951, 165, 1, 396, -819, -5508, + 280, 760, -411, -1025, -649, -1688, -6290, 272, + -17, -7595, 9, 307, 128, -3995, -119, 481, + -3100, -255, 651, 139, -3492, -6, -4471, 452, + -71, 139, 1255, -6128, 1191, 326, 28, -238, + 1374, -334, -457, -836, -10390, 185, -616, 3366, + -39, 183, -21, 6240, 1141, 341, -348, 738, + 121, -65, -386, -27, -548, 337, -4, -126, + 571, 2263, 4936, -1093, -397, 961, -5886, -734, + 1509, -660, -61, 170, -783, -4197, -1459, 906, + -31, 400, -481, 561, 6, 489, -5397, -1666, + 41, -536, -116, 6713, 1288, -157, -116, 4256, + 1895, 6671, 1837, -544, 1276, 2031, 345, 6471, + -84, 1868, -2006, -1304, -7792, 702, -1189, 105, + -4869, -282, -790, 7083, -628, -1273, 252, -179, +}; + +static const int16_t shape22s[] = { + 493, -2, -310, -109, -1218, -193, -267, -11, + -466, -34, -2492, 287, 241, 3621, -537, 458, + 869, -915, -290, 782, 65, -90, -635, 1836, + 80, 519, 868, 1359, 550, -92, -704, 110, + -210, -4337, -376, -200, -2693, 6, 381, 688, + 556, 883, -88, 1698, 1081, 133, 1130, -78, + 853, -424, -39, -909, -1579, -2774, -372, 3604, + -519, 3777, -66, 1330, -1055, 1135, -995, 220, + -3124, 122, 83, 1045, -701, -120, -6800, -269, + 195, 1197, 5500, -490, 5453, -201, 411, 823, + -146, 46, 252, -2724, 606, -924, -1538, 394, + -420, 6405, -5632, -941, -402, -137, 984, -24, + 594, -40, -140, -20, 204, 1211, 290, -680, + 103, -434, -294, 1646, -159, -2296, -237, 507, + -67, -8999, -97, 403, -1473, -111, 22, -257, + -2203, -600, 577, -117, 48, 2216, -170, 1192, + 700, -477, 1678, 979, 2395, -69, -1746, -2139, + -294, -4210, 181, -372, 320, -180, -503, -550, + -3994, -6315, 502, -804, -432, -112, -457, -1016, + 637, 297, 932, 533, 798, 229, -1001, -2780, + -4009, 1176, 189, -1575, 21, 3512, -348, -1450, + 2488, 463, 611, -46, 85, 94, 3319, -3041, + -362, -261, -1534, -1900, 7, -519, -52, 1166, + -174, -152, -189, -415, 641, 27, 1764, 280, + -301, 2976, 146, -632, 4022, -1994, -84, -61, + -1633, 285, -439, 781, -592, 399, -4794, 203, + -295, 32, -1423, 216, -2773, -9, 3589, -3952, + -195, 161, -223, -2240, -1886, -2643, 978, 113, + -1019, 1645, 1493, -851, 1417, -74, 717, 411, + 887, -1384, 73, 117, -65, -7, 133, 18, + 69, 11, -98, 45, -1751, -2710, 11, -140, + 29, 185, 327, 705, 56, 152, 8202, -117, + 157, -478, 36, -564, 996, -9359, -707, 674, + 1169, 270, 156, -679, 15, 720, -38, -4952, + -196, 183, -356, -1004, 185, -148, -61, 151, + -229, -161, 23, 4350, -650, -4384, -21, 909, + 105, -271, -2538, -4018, -1268, 351, 396, -190, + -135, 970, 3159, -935, -6968, -131, -1031, 53, + -430, 242, -219, 384, 2832, -151, 152, -6891, + 1444, -63, -46, 72, 653, 3955, -4187, -321, + -298, 678, -471, 664, -42, -30, 825, 195, + -1147, -2728, -178, -2305, 680, 1980, -147, 320, + -348, 4307, 806, -263, -60, -102, 8, -10085, + 626, -130, 267, -621, 45, -157, 438, 190, + 78, 1608, -246, -386, 256, -255, 5651, -449, + -13, 198, -3193, 329, -500, -1368, -6647, 609, + -507, -96, 222, -1196, 171, -12, -299, -1423, + 442, 47, -5, -282, -18, 4969, -1764, 231, + -471, 5044, 412, 1496, -146, 35, 5083, -228, + 355, -482, -1063, 1265, 80, -1278, 1225, 826, + -1914, 779, 439, -511, -4177, 425, -38, -55, + 9786, 1005, -538, -664, -641, 638, 125, -2811, + 2308, 28, -1157, -229, -624, 45, 354, -368, + -1661, 90, 778, -328, 272, -223, 9558, 822, + -167, -12, -1020, 2962, 2372, -932, 1961, 1398, + 2660, 3, 235, 421, 114, -283, 371, -1652, + 329, -435, -113, -1296, -501, -686, 297, -384, + 10328, 472, 614, 139, -765, -309, 180, -2009, + -171, -175, 3571, 146, 46, -1356, -134, -15, + -166, 2046, 108, 119, -281, 971, -471, -1134, + 34, -104, 219, 746, -223, 245, -181, 12, + -165, 216, -792, 86, 562, -1807, -116, -1324, + 590, -320, -80, 1863, -420, -1066, -698, -2879, + -6, 182, -2325, 575, 97, -2616, 2938, -673, + -693, -116, 1905, -430, 4739, -12, -3307, 693, + -227, 223, -111, -1498, 5, 1751, -36, 234, + -4584, 838, -370, -296, -818, 337, -46, -8921, + 875, -423, 496, -1196, -24, -1014, 969, 294, + 237, -1733, 27, 2543, 1494, 190, 457, -1391, + 1209, 5651, 548, 504, 686, -2889, -151, 725, + 486, -3716, -285, 830, 31, 5132, 770, -24, + -482, -369, -126, -1552, -347, -272, -387, -9485, + -1547, -1189, 369, 812, 311, 536, 391, 361, + -1708, -288, -94, 2053, 557, -611, -4551, -2368, + 173, 472, 160, -1849, 96, -7569, 183, 484, + -393, -346, -309, -13, -7, 2, -239, 10395, + -587, -115, 1282, -634, 81, 90, -725, -2685, + -1214, -4455, -1897, -2903, -827, 124, 2215, 696, + -1225, -1353, -371, 343, 421, -640, 1480, -1174, + 76, -835, -716, -625, -547, 1250, -2696, 2132, + -548, 439, -607, 408, -221, 5026, 352, -344, + -1339, -602, -1650, -404, -458, -502, 61, -164, + 53, -26, -2652, -209, 64, -4068, 713, 193, + -117, -1290, 95, -86, -515, 1336, -492, 1654, + -2963, 3663, -4231, -1, 3017, 371, 276, -7, + -289, -33, -5942, 237, 30, 586, -264, -493, + 435, -388, -165, 10434, 192, 3897, -5414, 361, + 845, -259, 481, 331, 650, -232, 23, -1789, + 27, -4065, 1020, -4261, -651, 3174, 951, -3363, + 577, -112, 642, -1177, -1707, 492, -250, -1236, + 24, -1394, -1807, -853, 1681, -69, 851, -959, + -5759, -202, 30, -3466, -593, 5414, 65, 141, + -319, 674, 1183, -155, -312, 372, 2829, -75, + -60, -2618, -240, 2944, -631, -4221, -16, 467, + 211, -58, 55, -527, -51, -160, 642, -305, + 388, 413, 210, -81, -3383, -120, 144, -220, + -672, 1352, -630, -2324, -423, -8053, -131, -912, + -260, -380, 470, 154, -1346, -2417, -426, -403, + -137, -160, 2823, 609, -216, -173, -585, -514, + 95, -202, 222, 16, 136, 1751, 237, -1089, + 957, -144, -518, 416, -347, -60, 207, 277, + 512, -1133, 166, 1423, -883, -194, -7016, -1938, + 417, 2302, -992, -179, 738, -74, 411, -462, + -413, 67, 234, -322, -164, -47, -89, 1409, + 390, -1180, -2888, 655, 1958, 0, -1826, -471, + -1247, 307, 104, -8502, -198, -222, 191, 281, + -868, 47, -4553, 2434, 174, 263, 2844, -72, + -597, -1183, -374, -93, 3348, 13, 173, 6285, + -32, -213, 1882, 411, -608, -562, 2998, 293, + 54, -147, -120, 822, -93, 679, 206, -3229, + -767, -1603, -259, -310, 4306, 548, -9, -99, + -5722, -328, -176, 453, 338, -9687, -63, 844, + 322, 615, -1075, -370, 159, -33, -6213, -1375, + 741, -801, -1319, 1513, 1331, -69, 2702, -458, + -203, 103, 4696, -284, 465, -62, -40, 3184, + 238, -6131, 546, 1713, -365, -24, 116, -33, + 304, 807, -231, 291, 903, 749, -254, -12215, + 115, -35, -95, -166, -3776, -170, -4517, -151, + 67, -7725, 666, -573, -744, -719, 37, 31, + 373, 148, -125, 15, -150, -905, -42, 272, + -5223, 650, 5233, 109, -1235, 991, 211, 1522, + -555, -328, -52, 5335, -22, -5476, -3102, -637, + 986, 468, -37, -164, -264, -1290, 754, -940, + -685, -862, 7270, -279, -441, 472, -153, -2515, + 3899, -95, 360, 762, 14, 434, 619, 185, + -230, 1233, -1330, 1360, -756, 361, -1391, -247, + 120, -3573, 293, 375, 806, 5526, 536, 137, + 486, -484, 13, -37, 12, -4, 81, 43, + 10, 43, -38, -371, -64, -1167, -117, -371, + -1958, -166, 543, -97, -83, 391, -59, -1631, + 302, 1077, -128, -641, -64, 21, -2562, -235, + 342, -7121, -646, -49, -961, -141, -210, -555, + -1596, -988, 723, -209, -3585, 10, -35, 1051, + 0, 138, 941, -5002, 805, 3009, 35, -70, + 513, -21, -432, -224, -10628, -167, -1045, 2603, + 336, 360, 515, 683, 981, 3028, 492, -543, + -1844, 23, -30, 52, -40, 447, 11, 363, + -95, 1609, 2613, -13, -400, 719, -4513, -676, + -290, 456, -332, -11, -261, -455, 89, -301, + 285, 287, 202, 281, 87, -202, -1482, -535, + 874, -478, -201, 4715, 824, -204, 145, 2882, + 404, 3376, 363, -18, -127, 764, 106, 1626, + 178, 185, 22, -637, -6216, 1399, -961, -88, + -553, -91, 98, 1831, 9, -583, 1253, -1741, +}; + +static const int16_t shape44s[] = { + -20, -140, 683, -586, -1742, 177, -538, 1900, + 2193, -17, -2096, 261, 645, 339, 77, 1136, + -521, 537, -924, -156, -261, 195, 1049, -39, + 236, -137, 0, 3199, 225, 46, 86, -215, + 557, -5394, 17, 911, -1690, -48, -48, -175, + -11, -631, -153, 4474, -347, -39, 1759, 154, + 170, -180, -273, 603, -590, -5195, -74, 1789, + 240, -212, 431, 2447, 368, -76, -313, 11, + -2926, 19, -71, 208, -51, -728, -6412, -61, + 141, -112, 5280, -76, 4435, -402, -25, 46, + 210, -104, 172, -3830, -366, -23, 239, -112, + 137, 6692, -6288, -720, -132, -136, 552, -1688, + -345, -289, -485, 149, 174, 180, 361, -236, + 92, 407, 6, 2373, 380, -167, 845, 444, + -834, -9358, 413, -1302, 460, 77, 34, 56, + -1516, -143, 207, -43, -31, -106, -52, 403, + -309, 298, -88, 1552, -240, -776, 624, -4181, + -342, -4804, 57, -23, 160, -44, 469, -17, + -3997, -5079, -263, 72, 181, 1085, 538, -611, + -368, 59, -204, -195, -40, -201, -803, -5093, + -3216, 480, 46, -729, 244, 3320, 185, 503, + 2979, -416, 110, 25, 140, -502, 2236, -4420, + -36, -238, -278, 60, -82, -597, 218, 69, + -95, -2102, -2138, -2308, -3796, 20, -211, -229, + 297, 3665, 81, 148, 1315, -4537, -38, 186, + -3106, -526, 90, -35, -193, -302, -5860, 276, + -308, 206, 645, 1, -242, 580, 3025, -2583, + -90, 511, -315, -137, -2033, -4313, 693, 485, + -211, 1486, 1180, 181, -136, 204, 23, 383, + 1479, -213, 42, 32, -64, -136, -91, -146, + 434, 231, 36, -58, -3254, -2647, -18, 345, + 171, -60, 84, 209, 246, -587, 9447, -67, + -187, -108, -226, -458, -519, -11089, -422, -502, + 132, 79, 298, -475, -412, 196, -164, -7347, + 185, -131, 369, 18, -500, 644, -334, 93, + -77, 71, 341, 3566, -281, -4191, -145, 87, + 37, 306, -3482, -5739, 161, -245, 293, 208, + 380, 2888, 31, -23, -2061, -597, -56, 350, + -105, 1167, 64, 342, 3638, -79, -106, 148, + 5422, -719, -232, 8, -395, 3249, -5093, -222, + -707, 241, 318, 735, 376, 78, -166, -1614, + -9, -3373, 330, -1540, 2028, 3400, -9, 317, + 9, 4903, 262, 62, 222, -95, -208, -13376, + -101, 121, 298, 5, 172, 406, -164, 79, + 172, 1993, 235, 229, 1193, -274, 5944, -918, + -15, 1304, 307, 1150, -385, -794, -3467, 660, + 2143, 147, -279, -751, -305, 1052, 205, -108, + 572, -212, 29, -50, 6, 3749, 238, -2016, + -1118, -1329, -971, 2633, 519, 194, 3545, -11, + 77, -92, 1215, -439, 152, -863, 1604, 180, + -514, 252, 308, -131, -938, 133, 378, 11, + 12153, 51, 486, 71, -476, -599, 57, -127, + 2685, -173, -182, 468, -3469, -594, -380, 265, + -879, -352, -278, -309, 575, 124, 10814, -765, + -64, 710, -105, 296, 2562, 98, -358, 556, + 2921, -133, -5, -406, 42, 496, -1053, -1957, + 701, 266, 260, -441, 43, -192, -1, -2174, + 9894, -90, -181, 29, 50, -858, 59, -190, + 49, -282, 1632, 1525, 100, -3659, 13, 173, + -240, 5304, -383, 263, -311, 1747, 169, -2203, + -29, -106, 342, -301, 66, 49, 23, 857, + -607, 698, -1198, -191, -450, -1875, -329, -2156, + 156, 95, 145, 129, -321, 88, 1049, 3980, + -14, 321, -1484, 895, -30, -2174, 289, 933, + -933, 15, 2631, 68, 3054, 221, -87, 175, + 200, 937, -87, -2032, 348, 146, -372, 60, + -2566, 3497, -98, 313, 536, -299, -58, -8949, + 323, -524, -331, 713, -47, 360, 155, 168, + 687, -1391, 1973, 670, 788, -202, -129, -5113, + 54, 1178, 1218, 172, 630, -154, -1047, 840, + 71, -337, 91, 214, -474, 624, -773, 16, + -126, 340, -631, -482, -155, 419, 50, -10976, + -742, -781, 169, 149, 33, -169, 44, 354, + 26, 129, -179, 1401, 776, -155, -3996, -813, + 594, 238, -61, 168, -383, -9261, 294, 470, + -322, -190, -956, -290, 27, -438, -254, 12571, + 344, -393, -568, 56, 81, 171, -115, -4370, + 49, -322, -237, -692, -55, -49, 4317, -6, + -4837, -156, 179, 247, -338, -48, 952, -1061, + -33, -934, 250, -256, -1622, 1039, -738, 2719, + -20, -190, 249, -119, -235, 6080, 123, -502, + -1443, 86, -1684, -177, -128, -58, -237, -641, + -177, 64, -2416, 15, -116, -6465, -412, 161, + 419, 768, 36, 113, -944, -241, -1424, -95, + 635, 1798, -2257, -18, 3046, 173, -33, -207, + -52, -831, -5730, -54, -199, 194, -255, 467, + -211, -853, -512, 11619, 148, 3681, -4603, -282, + 129, -205, -606, 167, 306, 464, 485, -959, + -203, 254, 151, -6880, -262, 5180, 658, -1378, + 1174, -53, -59, -33, -3077, -127, -223, -17, + -31, -2190, 23, 317, -169, 203, -223, -222, + -5295, 116, 80, -2757, -666, 3377, -476, 85, + -630, -147, 1740, -175, -115, 207, 240, -248, + -95, -1016, 3966, 3998, -343, -4751, 187, -113, + -250, 111, -510, -203, 130, 89, 311, 608, + -221, -381, -253, -359, -2254, 45, 224, -141, + 45, -19, 480, -5074, 797, -4580, -163, 110, + -234, 337, 6, 707, 492, -5493, -2750, -94, + -363, 113, 2345, 344, 379, 464, -3222, -56, + -269, -262, -10, -609, 324, 3043, 209, 3092, + -600, 42, -615, -17, -53, 30, 1123, 224, + 593, 632, -90, 428, 1117, -1429, -6741, -95, + -293, -103, -2784, 251, 1688, 621, -349, 1059, + -1093, -148, 447, 149, 88, 92, 687, 1249, + 80, 289, -1841, 221, -10, -92, -1736, 118, + 136, 138, -162, -4162, -111, 62, 95, 166, + -172, -695, -3685, 5694, -527, 2032, -549, 43, + -101, 221, 181, -479, 7697, 2007, -127, 805, + -83, -535, 1354, -383, 253, -622, 2910, 1249, + 782, 13, 42, 994, -545, 75, -485, 330, + -16, 343, 272, -781, 360, -97, -25, -875, + -12689, -623, -307, 195, -256, -11644, 229, 180, + -42, -361, -124, -81, -23, -460, -1993, 212, + -634, -847, 1616, -546, -583, 99, 3800, 10, + 177, 366, 6106, -173, 265, -213, 10, 1108, + -288, -1690, -237, -312, 38, -2272, 431, -26, + -178, -764, 507, 355, 677, -214, -816, -12411, + 47, 12, 294, -295, -3916, -677, -4885, -250, + -453, -7716, 478, 231, 17, -248, 147, 1064, + 637, -80, -41, 265, -383, 142, 116, 2991, + -3060, 809, 2056, -119, -866, -22, -660, 233, + 306, -1873, -1141, 6995, 186, -8678, -109, -39, + -105, 730, 18, -846, 273, -2922, 210, 26, + -174, -142, 990, 131, -436, 1422, -217, -3152, + 3224, 35, 315, -47, 48, -221, 568, 44, + 182, 1696, -1755, -193, 527, 158, -555, -3485, + 171, -4552, -47, -4680, 95, -112, 184, 80, + -36, -915, 87, 24, -259, -1743, 68, -117, + 405, 11, 40, -320, -17, -158, -134, -186, + -1206, -466, 1262, 133, -254, -100, 210, -1735, + -636, 319, -978, 69, 197, -521, -5503, -78, + -544, -1011, 101, -489, -371, -79, -196, -18, + -839, 1091, 682, -1441, -2375, -1127, 54, 829, + -306, -255, 641, -3665, 473, 3504, -1035, -160, + -467, -275, -437, 79, -13513, 326, 132, 82, + 188, 362, -74, 1406, -46, 2864, 351, -558, + -1277, 108, -92, -53, 72, -41, -31, -97, + 353, 73, 1864, -207, 106, -81, -3930, 173, + 41, -539, -497, 135, -526, -823, 69, -10, + 176, 648, -1710, 564, 80, 237, -1956, 234, + 11, 142, -849, 4116, -473, 110, 129, 2137, + -170, 3193, 10, 245, -953, -827, -30, 1235, + 366, -67, 54, -567, -7377, 2461, 582, 74, + -1988, -33, -296, 3090, -54, 145, 564, -295, +}; + +static const uint16_t bark_tab_l8_512[] = { + 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 6, 6, 6, 8, 7, 9, + 9, 11, 11, 14, 15, 17, 20, 24, 28, 34, 41, 51, 64, 83, +}; + +static const uint16_t bark_tab_m8_256[] = { + 3, 4, 3, 4, 3, 4, 4, 5, 5, 6, 6, 8, 9, 11, 13, 17, 23, 29, 41, 58 +}; + +static const uint16_t bark_tab_s8_64[] = { + 2, 1, 2, 2, 3, 4, 5, 7, 13, 25 +}; + +static const uint16_t bark_tab_l8s_512[] = { + 7, 8, 7, 8, 8, 8, 8, 8, + 8, 9, 9, 10, 10, 11, 11, 12, + 12, 14, 15, 16, 18, 19, 21, 24, + 27, 30, 35, 40, 46, 53, +}; + +static const uint16_t bark_tab_s8s_64[] = { + 3, 3, 3, 3, 4, 5, 6, 8, + 12, 17, +}; + +static const uint16_t bark_tab_m8s_256[] = { + 6, 5, 6, 6, 6, 6, 7, 7, + 8, 8, 9, 10, 11, 13, 15, 18, + 20, 25, 31, 39, +}; + +static const uint16_t bark_tab_l11_512[] = { + 4, 4, 5, 4, 5, 4, 5, 6, + 6, 6, 7, 8, 9, 10, 12, 14, + 17, 21, 27, 33, 44, 58, 82, 121, +}; + +static const uint16_t bark_tab_s11_64[] = { + 2, 1, 2, 3, 4, 6, 13, 33, +}; + +static const uint16_t bark_tab_m11_256[] = { + 3, 3, 4, 3, 4, 4, 5, 6, + 7, 9, 11, 15, 21, 30, 48, 83, +}; + +static const uint16_t bark_tab_l11s_512[] = { + 6, 6, 6, 6, 6, 6, 7, 6, + 7, 7, 8, 8, 8, 9, 10, 10, + 11, 13, 13, 15, 17, 18, 21, 25, + 27, 33, 38, 45, 54, 66, +}; + +static const uint16_t bark_tab_s11s_64[] = { + 2, 3, 2, 3, 3, 4, 6, 8, + 12, 21, +}; + +static const uint16_t bark_tab_m11s_256[] = { + 4, 5, 4, 5, 5, 5, 6, 5, + 7, 7, 8, 9, 10, 12, 15, 17, + 22, 28, 35, 47, +}; + +static const uint16_t bark_tab_l16_1024[] = { + 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 9, 10, 11, + 12, 14, 17, 19, 22, 27, 33, 40, 51, 64, 84, 114, 164, 257 +}; + +static const uint16_t bark_tab_m16_512[] = { + 3, 3, 3, 3, 4, 3, 4, 4, 4, 5, 5, 6, 7, 8, 10, 12, + 14, 18, 24, 30, 42, 59, 89, 152 +}; + +static const uint16_t bark_tab_s16_128[] = { + 2, 2, 2, 3, 3, 5, 7, 12, 25, 67 +}; + +static const uint16_t bark_tab_l16s_1024[] = { + 9, 9, 8, 9, 10, 9, 10, 10, + 10, 12, 11, 13, 13, 14, 16, 17, + 19, 20, 24, 26, 30, 35, 40, 48, + 56, 68, 83, 102, 128, 165, +}; + +static const uint16_t bark_tab_s16s_128[] = { + 3, 4, 4, 4, 5, 7, 10, 16, + 26, 49, +}; + +static const uint16_t bark_tab_m16s_512[] = { + 7, 6, 7, 7, 7, 8, 9, 9, + 10, 11, 14, 15, 18, 22, 27, 34, + 44, 59, 81, 117, +}; + +static const uint16_t bark_tab_l22_1024[] = { + 3, 4, 3, 4, 3, 4, 4, 4, + 4, 4, 5, 5, 5, 6, 7, 7, + 8, 9, 11, 12, 14, 16, 20, 24, + 29, 36, 45, 60, 80, 113, 173, 302, +}; + +static const uint16_t bark_tab_l22s_1024[] = { + 6, 7, 6, 6, 7, 7, 7, 7, + 7, 8, 9, 8, 10, 10, 11, 12, + 13, 15, 16, 18, 21, 24, 27, 33, + 38, 46, 55, 68, 84, 107, 140, 191, +}; + +static const uint16_t bark_tab_s22s_128[] = { + 3, 2, 3, 4, 4, 6, 9, 14, + 26, 57, +}; + +static const uint16_t bark_tab_m22s_512[] = { + 5, 5, 5, 6, 5, 7, 6, 7, + 9, 9, 11, 13, 15, 20, 24, 33, + 43, 61, 88, 140, +}; + +static const uint16_t bark_tab_l44_2048[] = { + 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, + 9, 10, 11, 11, 13, 14, 16, 17, 19, 22, 25, 29, 33, 39, 46, 54, + 64, 79, 98, 123, 161, 220, 320, 512, +}; + +#define bark_tab_m22_512 bark_tab_m44_512 /* Both tables are identical */ +static const uint16_t bark_tab_m44_512[] = { + 3, 2, 3, 3, 3, 4, 3, 5, 4, 6, 7, 8, 10, 14, 18, 25, + 36, 55, 95, 208, +}; + +#define bark_tab_s22_128 bark_tab_s44_128 /* Both tables are identical */ +static const uint16_t bark_tab_s44_128[] = { + 1, 2, 1, 2, 3, 4, 6, 10, 23, 76 +}; + +static const TwinVQModeTab metasound_mode0806 = { + { + { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0806ss0, cb0806ss1, 27 }, + { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0806sm0, cb0806sm1, 22 }, + { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0806sl0, cb0806sl1, 24 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0806s = { + { + { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0806ss0, cb0806ss1, 27 }, + { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0806sm0, cb0806sm1, 22 }, + { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0806sl0, cb0806sl1, 24 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0808 = { + { + { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0808s0, cb0808s1, 18 }, + { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0808m0, cb0808m1, 16 }, + { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0808l0, cb0808l1, 17 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0808s = { + { + { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0808ss0, cb0808ss1, 18 }, + { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0808sm0, cb0808sm1, 16 }, + { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0808sl0, cb0808sl1, 17 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode1110 = { + { + { 8, bark_tab_s11_64, 8, fcb11s, 1, 5, cb1110s0, cb1110s1, 21 }, + { 2, bark_tab_m11_256, 16, fcb11m, 2, 5, cb1110m0, cb1110m1, 18 }, + { 1, bark_tab_l11_512, 24, fcb11l, 3, 6, cb1110l0, cb1110l1, 19 } + }, + 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11, 9, 28, 20, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1110s = { + { + { 8, bark_tab_s11s_64, 10, fcb11ss, 1, 5, cb1110ss0, cb1110ss1, 21 }, + { 2, bark_tab_m11s_256, 20, fcb11sm, 2, 5, cb1110sm0, cb1110sm1, 18 }, + { 1, bark_tab_l11s_512, 30, fcb11sl, 3, 6, cb1110sl0, cb1110sl1, 20 } + }, + 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11s, 9, 36, 30, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1616 = { + { + { 8, bark_tab_s16_128, 10, fcb16s, 1, 5, cb1616s0, cb1616s1, 16 }, + { 2, bark_tab_m16_512, 24, fcb16m, 2, 5, cb1616m0, cb1616m1, 15 }, + { 1, bark_tab_l16_1024, 30, fcb16l, 3, 6, cb1616l0, cb1616l1, 16 } + }, + 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16, 9, 28, 30, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1616s = { + { + { 8, bark_tab_s16s_128, 10, fcb16ss, 1, 5, cb1616ss0, cb1616ss1, 16 }, + { 2, bark_tab_m16s_512, 20, fcb16sm, 2, 5, cb1616sm0, cb1616sm1, 15 }, + { 1, bark_tab_l16s_1024, 30, fcb16sl, 3, 6, cb1616sl0, cb1616sl1, 16 } + }, + 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16s, 9, 56, 60, 7, 200 +}; + +static const TwinVQModeTab metasound_mode2224 = { + { + { 8, bark_tab_s22_128, 10, fcb22s, 1, 6, cb2224s0, cb2224s1, 15 }, + { 2, bark_tab_m22_512, 20, fcb22m, 2, 6, cb2224m0, cb2224m1, 14 }, + { 1, bark_tab_l22_1024, 32, fcb22l, 4, 6, cb2224l0, cb2224l1, 15 } + }, + 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22, 9, 56, 36, 7, 200 +}; + +static const TwinVQModeTab metasound_mode2224s = { + { + { 8, bark_tab_s22s_128, 10, fcb22ss, 1, 6, cb2224ss0, cb2224ss1, 15 }, + { 2, bark_tab_m22s_512, 20, fcb22sm, 2, 6, cb2224sm0, cb2224sm1, 14 }, + { 1, bark_tab_l22s_1024, 32, fcb22sl, 4, 6, cb2224sl0, cb2224sl1, 15 } + }, + 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22s, 9, 56, 36, 7, 200 +}; + +static const TwinVQModeTab metasound_mode4432 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4432s0, cb4432s1, 23 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4432m0, cb4432m1, 21 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4432l0, cb4432l1, 22 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200, +}; + +static const TwinVQModeTab metasound_mode4440 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4440ss0, cb4440ss1, 18 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4440sm0, cb4440sm1, 17 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4440sl0, cb4440sl1, 17 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 +}; + +static const TwinVQModeTab metasound_mode4448 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4448ss0, cb4448ss1, 15 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4448sm0, cb4448sm1, 14 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4448sl0, cb4448sl1, 14 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 +}; #endif /* AVCODEC_METASOUND_DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_twinvq_data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_twinvq_data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_twinvq_data.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/metasound_twinvq_data.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,814 @@ +/* + * MetaSound decoder + * Copyright (c) 2013 Konstantin Shishkov + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_METASOUND_TWINVQ_DATA_H +#define AVCODEC_METASOUND_TWINVQ_DATA_H + +#include "twinvq.h" + +const float ff_metasound_lsp8[] = { + 0.2702, 0.5096, 0.6437, 0.7672, 0.9639, 1.0696, 1.2625, 1.5789, + 1.9285, 2.2383, 2.5129, 2.8470, 0.1740, 0.3677, 0.6082, 0.8387, + 1.1084, 1.3721, 1.6362, 1.8733, 2.0640, 2.3442, 2.6087, 2.8548, + 0.1536, 0.3279, 0.5143, 0.6859, 0.9763, 1.2744, 1.5605, 1.8566, + 2.1007, 2.3450, 2.6075, 2.8850, 0.2075, 0.4533, 0.7709, 1.0377, + 1.2953, 1.5132, 1.7826, 2.0351, 2.2590, 2.4996, 2.6795, 2.8748, + 0.1393, 0.2453, 0.3754, 0.5453, 0.8148, 1.1289, 1.4389, 1.7592, + 2.0353, 2.3215, 2.5934, 2.8588, 0.1250, 0.3627, 0.7613, 1.1380, + 1.4163, 1.5565, 1.6920, 1.8130, 1.8678, 2.0427, 2.4318, 2.8544, + 0.2256, 0.4223, 0.6452, 0.8599, 1.0673, 1.3118, 1.5486, 1.8366, + 2.0759, 2.3026, 2.5284, 2.8030, 0.2304, 0.4404, 0.6891, 0.8964, + 1.1510, 1.4202, 1.6483, 1.8580, 2.1181, 2.3686, 2.6078, 2.9128, + 0.2230, 0.3816, 0.5520, 0.6062, 0.7909, 1.0988, 1.4330, 1.7846, + 2.0713, 2.3457, 2.6048, 2.8708, 0.2447, 0.5800, 0.8249, 0.9905, + 1.1721, 1.3990, 1.6694, 1.9064, 2.1307, 2.4255, 2.6815, 2.9117, + 0.1974, 0.3812, 0.5802, 0.7759, 0.9280, 1.1547, 1.4170, 1.6369, + 1.8890, 2.2587, 2.5626, 2.8239, 0.1209, 0.2510, 0.4841, 0.8048, + 1.1197, 1.3563, 1.6073, 1.8926, 2.1350, 2.3669, 2.6291, 2.8985, + 0.2352, 0.4347, 0.6582, 0.8178, 0.9548, 1.1654, 1.4942, 1.8812, + 2.1703, 2.3779, 2.6412, 2.8871, 0.2091, 0.4084, 0.6730, 0.9151, + 1.1259, 1.3262, 1.5937, 1.8129, 2.0237, 2.3317, 2.5778, 2.8620, + 0.1167, 0.2406, 0.4520, 0.7298, 0.9848, 1.2448, 1.5137, 1.7874, + 2.0280, 2.3020, 2.5914, 2.8794, 0.3003, 0.4966, 0.6520, 0.8505, + 1.1600, 1.3981, 1.5805, 1.8346, 2.0757, 2.3102, 2.5760, 2.8499, + 0.2451, 0.4163, 0.5960, 0.7805, 0.9507, 1.2438, 1.5587, 1.8581, + 2.0735, 2.3198, 2.5704, 2.8220, 0.3112, 0.5517, 0.7032, 0.8528, + 1.1489, 1.4257, 1.6848, 1.9388, 2.1577, 2.4265, 2.6678, 2.9051, + 0.2249, 0.3897, 0.5559, 0.7473, 1.0158, 1.3581, 1.6914, 1.9930, + 2.1843, 2.3534, 2.5512, 2.8065, 0.2600, 0.4574, 0.7349, 0.9691, + 1.1696, 1.3848, 1.6335, 1.9021, 2.1174, 2.3481, 2.5902, 2.8390, + 0.2246, 0.3372, 0.4560, 0.5249, 0.7056, 1.0273, 1.3810, 1.7132, + 1.9819, 2.2574, 2.5410, 2.8491, 0.1419, 0.4834, 0.8835, 1.1453, + 1.2839, 1.4224, 1.5593, 1.7877, 2.1285, 2.4070, 2.6043, 2.8511, + 0.1886, 0.3677, 0.5617, 0.8099, 1.1277, 1.3841, 1.5804, 1.8136, + 2.0307, 2.2805, 2.5399, 2.8322, 0.2351, 0.4151, 0.6675, 0.8713, + 1.0464, 1.3292, 1.6586, 1.9281, 2.1355, 2.3495, 2.6222, 2.8782, + 0.2700, 0.4489, 0.6206, 0.7121, 0.7737, 0.9848, 1.3658, 1.7433, + 2.0139, 2.2243, 2.4806, 2.8175, 0.2479, 0.4425, 0.6490, 0.8745, + 1.1161, 1.3849, 1.6773, 1.9566, 2.1491, 2.3624, 2.5685, 2.8114, + 0.2035, 0.3701, 0.5567, 0.7953, 1.0082, 1.2758, 1.5373, 1.7822, + 2.0175, 2.2601, 2.4759, 2.7771, 0.1856, 0.3461, 0.5998, 0.9041, + 1.2383, 1.4612, 1.6667, 1.9305, 2.1617, 2.4107, 2.6477, 2.8656, + 0.2107, 0.3715, 0.5289, 0.6651, 0.8420, 1.1168, 1.4401, 1.7230, + 1.9901, 2.2687, 2.5452, 2.8655, 0.1218, 0.2999, 0.6348, 0.9482, + 1.2745, 1.5876, 1.9129, 2.2348, 2.4020, 2.4922, 2.6351, 2.8357, + 0.1617, 0.3483, 0.5869, 0.8163, 1.0366, 1.2344, 1.4609, 1.7029, + 1.9476, 2.2337, 2.5258, 2.8442, 0.2505, 0.4894, 0.7510, 0.9152, + 1.0845, 1.3657, 1.6528, 1.8346, 2.0160, 2.2811, 2.5338, 2.8136, + 0.0947, 0.1158, 0.0578, -0.0337, -0.0066, 0.0104, -0.0447, -0.0505, + -0.0778, -0.0293, 0.0251, -0.0143, 0.0349, -0.0227, -0.0909, 0.0523, + 0.0325, -0.0410, -0.1045, -0.0899, -0.0009, 0.0075, -0.0575, -0.0855, + -0.0129, 0.0575, 0.0597, 0.0391, 0.0371, -0.0184, -0.0083, 0.0287, + 0.0143, 0.0167, 0.0120, -0.0168, 0.0452, 0.0223, -0.0352, 0.0119, + -0.0496, -0.0965, -0.0661, -0.0072, 0.1099, 0.0843, -0.0087, -0.0478, + -0.0128, -0.0120, -0.0004, 0.0731, 0.1047, 0.0630, 0.0196, -0.0103, + -0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066, + 0.0223, 0.0634, 0.0343, -0.0134, 0.0727, 0.0241, 0.0066, 0.0437, + 0.0610, 0.0364, 0.0248, -0.0358, -0.0686, -0.0104, 0.0426, 0.0088, + -0.0137, -0.0165, 0.0671, 0.0815, -0.0863, -0.0644, -0.0088, 0.0023, + 0.0482, 0.1174, 0.1270, 0.0594, 0.0165, 0.0949, 0.1098, 0.0137, + 0.4951, 0.4999, 0.4958, 0.4907, 0.4984, 0.4965, 0.4958, 0.4996, + 0.4987, 0.4958, 0.4986, 0.4977, 0.2841, 0.2186, 0.1474, 0.1687, + 0.2217, 0.2632, 0.2706, 0.2624, 0.2162, 0.2453, 0.2460, 0.2531, +}; + +const float ff_metasound_lsp11[] = { + 0.1103, 0.3862, 0.6863, 0.8447, 0.9231, 1.0261, 1.1248, 1.4057, + 1.6621, 1.8010, 1.8692, 2.0704, 2.3490, 2.6060, 2.7539, 2.8977, + 0.1273, 0.2407, 0.3812, 0.6004, 0.7767, 0.9383, 1.1344, 1.3351, + 1.5233, 1.7262, 1.9466, 2.1739, 2.3495, 2.5162, 2.7164, 2.9202, + 0.2010, 0.3330, 0.4488, 0.6465, 0.8046, 0.9889, 1.1479, 1.2964, + 1.4770, 1.6606, 1.8789, 2.1155, 2.3287, 2.5199, 2.7101, 2.9119, + 0.1168, 0.2197, 0.3279, 0.4691, 0.6268, 0.8251, 1.0533, 1.2714, + 1.4712, 1.6762, 1.8831, 2.1114, 2.3230, 2.5297, 2.7365, 2.9270, + 0.1405, 0.3109, 0.4986, 0.6891, 0.8634, 1.0583, 1.2594, 1.4349, + 1.6232, 1.8116, 1.9905, 2.1935, 2.3799, 2.5656, 2.7661, 2.9486, + 0.1703, 0.3057, 0.4403, 0.5225, 0.5969, 0.8110, 1.0729, 1.3215, + 1.5407, 1.7381, 1.9477, 2.1680, 2.3586, 2.5612, 2.7630, 2.9410, + 0.1128, 0.2628, 0.4523, 0.6495, 0.8176, 0.9816, 1.1746, 1.3710, + 1.5568, 1.7518, 1.9497, 2.1452, 2.3346, 2.5389, 2.7362, 2.9264, + 0.1809, 0.3287, 0.5205, 0.7264, 0.9298, 1.1217, 1.2970, 1.4894, + 1.6874, 1.8493, 2.0576, 2.2382, 2.4097, 2.6041, 2.7796, 2.9389, + 0.2502, 0.4709, 0.6892, 0.8346, 0.9209, 1.0455, 1.2399, 1.4616, + 1.6463, 1.8380, 2.0475, 2.2397, 2.4665, 2.6550, 2.7701, 2.8895, + 0.1040, 0.2340, 0.3964, 0.5740, 0.7764, 0.9941, 1.2000, 1.4014, + 1.6024, 1.7974, 1.9939, 2.1959, 2.3783, 2.5663, 2.7613, 2.9484, + 0.1912, 0.3393, 0.4743, 0.6313, 0.8014, 0.9879, 1.1855, 1.3922, + 1.5678, 1.7289, 1.9271, 2.1165, 2.3089, 2.5414, 2.7448, 2.9269, + 0.0965, 0.2025, 0.3398, 0.4990, 0.6934, 0.9386, 1.1730, 1.3766, + 1.5783, 1.7783, 1.9790, 2.1831, 2.3670, 2.5578, 2.7641, 2.9516, + 0.2126, 0.3652, 0.5545, 0.7170, 0.8674, 1.0640, 1.2558, 1.4061, + 1.5904, 1.8095, 1.9760, 2.1505, 2.3549, 2.5575, 2.7023, 2.8877, + 0.1827, 0.3426, 0.4894, 0.6488, 0.7960, 0.9535, 1.1217, 1.2798, + 1.4566, 1.6453, 1.8044, 2.0042, 2.2379, 2.4611, 2.6697, 2.8966, + 0.2034, 0.3822, 0.5231, 0.6960, 0.9200, 1.0394, 1.1616, 1.3772, + 1.5493, 1.7330, 1.9646, 2.1233, 2.3334, 2.5361, 2.7087, 2.9470, + 0.1050, 0.2060, 0.3705, 0.5998, 0.8337, 1.0577, 1.2559, 1.4327, + 1.6334, 1.8165, 1.9853, 2.2058, 2.4063, 2.5818, 2.7625, 2.9458, + 0.1419, 0.4053, 0.6660, 0.8911, 1.0405, 1.1547, 1.2506, 1.3926, + 1.5669, 1.7527, 1.9694, 2.2054, 2.3889, 2.5743, 2.7586, 2.9174, + 0.1514, 0.2825, 0.4309, 0.5772, 0.7470, 0.9703, 1.1462, 1.3316, + 1.5321, 1.7259, 1.9282, 2.1266, 2.3106, 2.5064, 2.7067, 2.9094, + 0.1693, 0.3156, 0.4878, 0.6635, 0.8206, 0.9569, 1.1154, 1.3064, + 1.5109, 1.7184, 1.9179, 2.1036, 2.2763, 2.4820, 2.6949, 2.9105, + 0.1432, 0.2718, 0.4241, 0.5564, 0.6939, 0.9011, 1.1582, 1.3948, + 1.6181, 1.8024, 1.9814, 2.1740, 2.3459, 2.5456, 2.7491, 2.9307, + 0.2294, 0.3857, 0.5590, 0.7434, 0.9189, 1.0941, 1.2740, 1.4456, + 1.6178, 1.7994, 1.9689, 2.1644, 2.3525, 2.5385, 2.7468, 2.9405, + 0.1667, 0.3109, 0.4612, 0.6032, 0.7375, 0.8866, 1.0840, 1.3053, + 1.4982, 1.7044, 1.9146, 2.1117, 2.2942, 2.4983, 2.7084, 2.9132, + 0.1810, 0.3205, 0.4696, 0.6231, 0.7641, 0.9959, 1.2427, 1.4361, + 1.5889, 1.7544, 1.9083, 2.0733, 2.2457, 2.4461, 2.6793, 2.9098, + 0.1164, 0.3753, 0.6068, 0.7503, 1.0100, 1.2131, 1.3793, 1.5302, + 1.6300, 1.7950, 1.9057, 2.1031, 2.3830, 2.5745, 2.6949, 2.8779, + 0.1571, 0.4378, 0.6735, 0.8312, 0.8944, 0.9818, 1.1622, 1.4094, + 1.6423, 1.8066, 1.9258, 2.1838, 2.4363, 2.6279, 2.7358, 2.8790, + 0.1398, 0.2686, 0.4248, 0.6156, 0.7870, 1.0035, 1.2012, 1.3689, + 1.5363, 1.7398, 1.9604, 2.1619, 2.3345, 2.5097, 2.7271, 2.9368, + 0.1913, 0.3338, 0.4987, 0.6446, 0.7852, 1.0163, 1.1886, 1.3610, + 1.5379, 1.7230, 1.8880, 2.0862, 2.2960, 2.4928, 2.7122, 2.9151, + 0.0908, 0.1752, 0.2899, 0.5365, 0.7761, 1.0100, 1.2124, 1.4060, + 1.6019, 1.8010, 1.9774, 2.1905, 2.3733, 2.5623, 2.7660, 2.9565, + 0.1773, 0.3179, 0.4925, 0.6864, 0.8452, 0.9897, 1.1860, 1.3722, + 1.5515, 1.7658, 1.9802, 2.1819, 2.3620, 2.5442, 2.7250, 2.9220, + 0.1286, 0.2341, 0.3689, 0.5364, 0.7176, 0.9350, 1.1083, 1.2943, + 1.4974, 1.7059, 1.9047, 2.1145, 2.3242, 2.5361, 2.7453, 2.9329, + 0.2273, 0.3834, 0.5565, 0.7192, 0.8431, 0.9962, 1.1763, 1.3571, + 1.5774, 1.7419, 1.9202, 2.1131, 2.2919, 2.4898, 2.6895, 2.9180, + 0.1775, 0.3058, 0.4274, 0.6023, 0.8151, 1.0734, 1.3211, 1.5178, + 1.6706, 1.8154, 1.9686, 2.1537, 2.3461, 2.5276, 2.7181, 2.9121, + 0.1653, 0.4304, 0.6361, 0.7824, 0.9183, 1.0452, 1.2071, 1.4077, + 1.6206, 1.8299, 2.0089, 2.1948, 2.3900, 2.5982, 2.7844, 2.9487, + 0.1492, 0.2609, 0.3820, 0.5485, 0.7243, 0.9319, 1.1538, 1.3579, + 1.5266, 1.7002, 1.8873, 2.1016, 2.3175, 2.5221, 2.7241, 2.9243, + 0.2074, 0.3781, 0.5209, 0.6869, 0.8577, 0.9875, 1.1849, 1.3568, + 1.4907, 1.7335, 1.8902, 2.1224, 2.3099, 2.4918, 2.7023, 2.8765, + 0.1359, 0.2254, 0.3286, 0.4432, 0.6586, 0.8964, 1.1125, 1.3523, + 1.5626, 1.7579, 1.9846, 2.1905, 2.3548, 2.5542, 2.7663, 2.9346, + 0.1430, 0.2966, 0.4685, 0.6493, 0.8315, 1.0304, 1.2220, 1.4082, + 1.5995, 1.7888, 1.9774, 2.1737, 2.3607, 2.5577, 2.7558, 2.9405, + 0.1477, 0.2694, 0.4056, 0.5626, 0.7051, 0.8647, 1.0491, 1.2488, + 1.4814, 1.7072, 1.9150, 2.1147, 2.3038, 2.5144, 2.7184, 2.9202, + 0.1690, 0.3033, 0.4580, 0.6686, 0.8536, 1.0293, 1.2124, 1.3998, + 1.5718, 1.7607, 1.9580, 2.1245, 2.2971, 2.4762, 2.6896, 2.9177, + 0.1092, 0.2779, 0.4853, 0.6880, 0.9011, 1.0953, 1.2752, 1.4618, + 1.6623, 1.8484, 2.0264, 2.2152, 2.4017, 2.5835, 2.7671, 2.9436, + 0.1497, 0.3637, 0.6014, 0.8032, 0.9963, 1.1835, 1.3741, 1.5698, + 1.7382, 1.9094, 2.0710, 2.2392, 2.4082, 2.5926, 2.7762, 2.9536, + 0.1434, 0.2492, 0.3966, 0.5934, 0.8033, 1.0657, 1.2796, 1.4276, + 1.5745, 1.7833, 1.9288, 2.1247, 2.3543, 2.5412, 2.7049, 2.8872, + 0.1612, 0.2926, 0.4574, 0.6387, 0.8265, 1.0180, 1.1808, 1.3526, + 1.5564, 1.7536, 1.9187, 2.1192, 2.3149, 2.5006, 2.7101, 2.9217, + 0.0828, 0.1863, 0.3235, 0.5050, 0.7250, 0.9867, 1.2093, 1.3941, + 1.5980, 1.7932, 1.9809, 2.1894, 2.3918, 2.5773, 2.7540, 2.9329, + 0.2001, 0.3655, 0.5290, 0.6761, 0.8027, 0.9972, 1.2090, 1.4255, + 1.6085, 1.7825, 1.9804, 2.1681, 2.3457, 2.5325, 2.7319, 2.9196, + 0.1505, 0.2767, 0.4254, 0.6054, 0.7821, 0.9567, 1.1294, 1.3080, + 1.4984, 1.6954, 1.8666, 2.0736, 2.2875, 2.4969, 2.7072, 2.9163, + 0.1589, 0.4151, 0.5749, 0.6651, 0.8061, 1.0470, 1.2616, 1.3690, + 1.4985, 1.7808, 1.9825, 2.1068, 2.2751, 2.5448, 2.7133, 2.8689, + 0.0916, 0.1846, 0.3788, 0.6329, 0.8774, 1.0687, 1.2653, 1.4561, + 1.6573, 1.8449, 2.0402, 2.2254, 2.3968, 2.5861, 2.7792, 2.9508, + 0.2282, 0.4159, 0.5834, 0.6899, 0.8108, 1.0321, 1.2795, 1.5262, + 1.6936, 1.8469, 2.0922, 2.2607, 2.3795, 2.5301, 2.7386, 2.9530, + 0.1651, 0.3004, 0.4555, 0.6179, 0.7891, 0.9584, 1.1372, 1.3707, + 1.5951, 1.7880, 1.9434, 2.1465, 2.3311, 2.5081, 2.6977, 2.8970, + 0.1279, 0.3828, 0.6330, 0.8323, 0.9652, 1.1175, 1.2319, 1.3511, + 1.5115, 1.6392, 1.7835, 1.9558, 2.2008, 2.4635, 2.6910, 2.9058, + 0.1193, 0.2185, 0.3521, 0.5311, 0.7378, 0.9239, 1.1105, 1.3217, + 1.5362, 1.7504, 1.9536, 2.1627, 2.3560, 2.5506, 2.7548, 2.9453, + 0.1806, 0.3432, 0.4981, 0.6948, 0.8928, 1.0527, 1.2467, 1.4140, + 1.6326, 1.7950, 1.9935, 2.1969, 2.3512, 2.5682, 2.7445, 2.9277, + 0.1846, 0.3112, 0.4568, 0.5891, 0.7317, 0.8493, 1.0204, 1.2022, + 1.3688, 1.6020, 1.8428, 2.0710, 2.2725, 2.4879, 2.7057, 2.9160, + 0.0880, 0.2514, 0.5332, 0.7272, 0.8906, 1.1354, 1.3199, 1.4941, + 1.6010, 1.7151, 1.8712, 2.0643, 2.2755, 2.5375, 2.7054, 2.8891, + 0.1382, 0.2833, 0.4658, 0.6897, 0.9071, 1.0716, 1.2469, 1.4143, + 1.5910, 1.7947, 1.9805, 2.1581, 2.3338, 2.5215, 2.7292, 2.9211, + 0.1061, 0.3494, 0.6327, 0.8570, 0.9748, 1.0560, 1.1529, 1.3250, + 1.6032, 1.8340, 1.9711, 2.1157, 2.3011, 2.5464, 2.8078, 2.9803, + 0.1603, 0.2839, 0.4307, 0.5980, 0.7980, 1.0399, 1.1971, 1.3524, + 1.5715, 1.7838, 1.9468, 2.1498, 2.3627, 2.5514, 2.7327, 2.9148, + 0.1691, 0.3117, 0.4796, 0.6895, 0.8732, 1.0164, 1.1916, 1.3707, + 1.5384, 1.7202, 1.8857, 2.0672, 2.2487, 2.4593, 2.6789, 2.8940, + 0.0965, 0.1702, 0.3191, 0.5721, 0.8100, 1.0241, 1.2272, 1.4196, + 1.6093, 1.8057, 1.9884, 2.2037, 2.3925, 2.5805, 2.7578, 2.9366, + 0.1950, 0.3519, 0.5272, 0.6973, 0.8732, 1.0656, 1.2112, 1.3959, + 1.6116, 1.7821, 1.9445, 2.1592, 2.3348, 2.5142, 2.7440, 2.9297, + 0.1388, 0.2557, 0.4120, 0.5727, 0.7354, 0.9196, 1.0985, 1.2805, + 1.4643, 1.6535, 1.8340, 2.0546, 2.2758, 2.4778, 2.6921, 2.9122, + 0.1823, 0.3336, 0.4957, 0.6771, 0.8563, 1.0137, 1.2299, 1.3849, + 1.5718, 1.7667, 1.9193, 2.1326, 2.3135, 2.5268, 2.7133, 2.8998, + 0.0790, 0.1901, 0.4083, 0.6456, 0.8463, 1.0285, 1.2297, 1.4181, + 1.6159, 1.8056, 1.9971, 2.1912, 2.3816, 2.5746, 2.7692, 2.9497, + 0.0049, 0.0116, 0.0045, 0.0039, -0.0010, -0.0122, -0.0205, -0.0034, + -0.0140, -0.0041, 0.0191, -0.0322, 0.0002, -0.0124, -0.0269, 0.0059, + 0.0586, 0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211, + 0.0241, 0.0595, 0.0469, 0.0283, 0.0176, -0.0183, -0.0173, -0.0004, + 0.0024, 0.0145, 0.0534, 0.0197, -0.0065, -0.0067, 0.0133, 0.0358, + -0.0104, -0.0386, -0.0109, -0.0078, 0.0275, 0.0565, 0.0251, -0.0027, + -0.0053, 0.0171, 0.0088, 0.0495, 0.0141, 0.0039, -0.0445, -0.0426, + -0.0184, -0.0280, -0.0223, 0.0039, -0.0171, -0.0606, -0.0786, -0.0430, + 0.0544, 0.0595, 0.0320, -0.0012, 0.0108, 0.0185, 0.0066, 0.0408, + 0.0552, -0.0073, -0.0247, -0.0480, -0.0288, 0.0186, 0.0212, -0.0013, + 0.0403, 0.0598, 0.0690, 0.0516, -0.0298, -0.0177, 0.0278, 0.0168, + -0.0106, 0.0251, 0.0386, 0.0331, -0.0052, 0.0133, 0.0291, -0.0158, + -0.0329, -0.0367, 0.0287, 0.0462, -0.0176, 0.0049, 0.0242, -0.0034, + 0.0135, 0.0086, -0.0149, 0.0241, 0.0504, 0.0246, -0.0273, -0.0369, + -0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088, + 0.0098, 0.0009, -0.0004, 0.0007, -0.0314, -0.0208, -0.0138, -0.0277, + -0.0044, 0.0522, 0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201, + -0.0287, -0.0279, -0.0182, 0.0472, 0.0613, 0.0450, 0.0413, 0.0333, + 0.0444, 0.0223, 0.0061, 0.0316, 0.0321, 0.0501, 0.0460, 0.0250, + 0.0227, 0.0235, 0.0099, 0.0185, -0.0347, -0.0684, -0.0189, 0.0242, + -0.0190, -0.0273, -0.0012, -0.0253, 0.0293, -0.0231, -0.0219, -0.0010, + 0.0153, 0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390, + 0.0077, -0.0278, -0.0355, 0.0092, -0.0063, 0.0005, 0.0216, 0.0461, + 0.0538, 0.0451, 0.0298, -0.0130, 0.0058, 0.0206, 0.0471, 0.0499, + 0.0280, 0.0086, -0.0007, -0.0317, 0.0259, 0.0176, 0.0043, 0.0212, + 0.0138, 0.0106, 0.0220, -0.0025, 0.0050, 0.0122, -0.0051, -0.0086, + -0.0472, -0.0005, 0.0193, 0.0032, 0.0246, 0.0222, 0.0090, -0.0320, + -0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092, 0.0115, + -0.0129, 0.0053, -0.0344, -0.0385, 0.0392, 0.0599, 0.0414, 0.0165, + -0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110, 0.0084, 0.0172, + -0.0492, -0.0537, -0.0320, -0.0036, 0.0265, 0.0385, 0.0064, -0.0280, + -0.0230, 0.0134, 0.0241, 0.0106, 0.0387, 0.0105, 0.0068, 0.0260, + 0.4940, 0.4911, 0.4849, 0.4820, 0.4837, 0.4839, 0.4824, 0.4799, + 0.4812, 0.4782, 0.4788, 0.4711, 0.4706, 0.4671, 0.4601, 0.4578, + 0.2954, 0.2121, 0.1859, 0.1958, 0.1474, 0.1086, 0.1351, 0.1362, + 0.1486, 0.1342, 0.1215, 0.1423, 0.1634, 0.1588, 0.1539, 0.1857, +}; + +const float ff_metasound_lsp16[] = { + 0.1813, 0.3911, 0.6301, 0.8012, 1.0057, 1.2041, 1.4271, 1.6943, + 1.9402, 2.1733, 2.3521, 2.4989, 2.5839, 2.6846, 2.7634, 2.8950, + 0.1311, 0.3183, 0.4659, 0.5601, 0.6658, 0.7828, 1.0065, 1.2717, + 1.5185, 1.7339, 1.9530, 2.2189, 2.3739, 2.4991, 2.6984, 2.9256, + 0.1627, 0.4519, 0.6323, 0.7012, 0.7848, 0.9801, 1.1810, 1.3222, + 1.5413, 1.8129, 1.9338, 2.0809, 2.3180, 2.5189, 2.7066, 2.9514, + 0.1475, 0.2447, 0.4240, 0.5669, 0.7872, 0.9838, 1.1823, 1.3814, + 1.5358, 1.6820, 1.8794, 2.1419, 2.4132, 2.6112, 2.7911, 2.9511, + 0.1224, 0.2876, 0.5013, 0.6985, 0.8902, 1.0901, 1.2835, 1.4768, + 1.6596, 1.8538, 2.0467, 2.2304, 2.4124, 2.5942, 2.7729, 2.9531, + 0.1741, 0.3034, 0.4677, 0.5879, 0.7258, 0.9648, 1.1417, 1.3220, + 1.5081, 1.7151, 1.9212, 2.1286, 2.3208, 2.4938, 2.6765, 2.8891, + 0.1657, 0.3174, 0.4907, 0.6559, 0.8295, 1.0254, 1.2071, 1.3880, + 1.5737, 1.7845, 1.9027, 2.1139, 2.3323, 2.5157, 2.7323, 2.9015, + 0.1592, 0.2758, 0.4417, 0.6315, 0.8257, 0.9873, 1.1277, 1.2830, + 1.4337, 1.6315, 1.8899, 2.1356, 2.3572, 2.5632, 2.7468, 2.9420, + 0.1524, 0.4325, 0.5931, 0.7036, 0.7696, 0.8923, 1.1739, 1.4773, + 1.6609, 1.7911, 1.9666, 2.1972, 2.3754, 2.5045, 2.6613, 2.8882, + 0.2130, 0.3013, 0.3721, 0.4257, 0.5079, 0.7015, 0.9815, 1.2554, + 1.4648, 1.6966, 1.9138, 2.1075, 2.3318, 2.5292, 2.7453, 2.9347, + 0.1142, 0.3748, 0.6205, 0.7642, 0.8121, 0.9022, 0.9843, 1.1558, + 1.4467, 1.7422, 1.9574, 2.1302, 2.3812, 2.5898, 2.7720, 2.9583, + 0.1255, 0.2339, 0.3570, 0.5323, 0.7458, 1.0003, 1.1729, 1.3567, + 1.5217, 1.6977, 1.8924, 2.0942, 2.3145, 2.5408, 2.7553, 2.9337, + 0.1316, 0.2289, 0.4327, 0.6663, 0.8509, 0.9994, 1.1697, 1.3804, + 1.5609, 1.6903, 1.8572, 2.1019, 2.3687, 2.5789, 2.7715, 2.9472, + 0.1502, 0.2546, 0.3883, 0.5333, 0.6976, 0.9163, 1.1071, 1.3364, + 1.5420, 1.7525, 1.8948, 2.0839, 2.2819, 2.4651, 2.6875, 2.8987, + 0.1593, 0.3014, 0.4573, 0.6354, 0.8157, 0.9805, 1.1783, 1.3747, + 1.5678, 1.7326, 1.9286, 2.1340, 2.3253, 2.5280, 2.7180, 2.9298, + 0.1811, 0.3167, 0.4655, 0.6507, 0.8198, 1.0075, 1.1892, 1.3743, + 1.5227, 1.7090, 1.8849, 2.0743, 2.2750, 2.4830, 2.6896, 2.8953, + 0.1846, 0.3577, 0.5315, 0.7290, 0.9176, 1.1016, 1.2654, 1.4525, + 1.6315, 1.8268, 2.0238, 2.1934, 2.3868, 2.5753, 2.7682, 2.9469, + 0.0876, 0.1439, 0.2048, 0.3654, 0.6281, 0.8853, 1.0907, 1.2992, + 1.5227, 1.7373, 1.9395, 2.1419, 2.3488, 2.5486, 2.7466, 2.9348, + 0.1391, 0.4170, 0.6561, 0.7953, 0.8734, 0.9986, 1.1870, 1.4520, + 1.6042, 1.7910, 2.0135, 2.1870, 2.3358, 2.5066, 2.7409, 2.9955, + 0.0804, 0.1355, 0.2599, 0.4998, 0.7408, 0.9474, 1.1276, 1.3428, + 1.5556, 1.7712, 1.9699, 2.1535, 2.3605, 2.5548, 2.7489, 2.9325, + 0.1304, 0.3087, 0.4979, 0.6584, 0.8414, 1.0329, 1.2244, 1.4189, + 1.6118, 1.8200, 1.9985, 2.1893, 2.3915, 2.5794, 2.7647, 2.9344, + 0.1895, 0.2849, 0.3705, 0.4126, 0.6265, 0.9207, 1.1774, 1.3762, + 1.5757, 1.7728, 1.9568, 2.1662, 2.3615, 2.5575, 2.7561, 2.9416, + 0.1800, 0.3078, 0.4805, 0.6796, 0.8503, 1.0046, 1.1703, 1.3269, + 1.4862, 1.6502, 1.8454, 2.0873, 2.3175, 2.5356, 2.7516, 2.9469, + 0.1950, 0.3233, 0.4568, 0.5940, 0.7589, 0.9978, 1.1701, 1.3383, + 1.5017, 1.6565, 1.8243, 2.0605, 2.2938, 2.5147, 2.7419, 2.9396, + 0.2531, 0.4391, 0.5790, 0.7170, 0.8998, 1.1430, 1.3577, 1.5326, + 1.6328, 1.7627, 1.9726, 2.1762, 2.3563, 2.5478, 2.7385, 2.9067, + 0.1805, 0.2788, 0.3591, 0.3881, 0.5441, 0.8055, 1.0766, 1.3165, + 1.5316, 1.7508, 1.9477, 2.1374, 2.3438, 2.5484, 2.7501, 2.9410, + 0.2044, 0.3671, 0.5396, 0.7042, 0.8582, 0.9831, 1.1261, 1.3194, + 1.4769, 1.6979, 1.8717, 2.0463, 2.2620, 2.4739, 2.7054, 2.9208, + 0.1048, 0.2175, 0.4206, 0.5923, 0.7483, 0.9400, 1.1356, 1.3799, + 1.5958, 1.7320, 1.8984, 2.1296, 2.3594, 2.5492, 2.7387, 2.9305, + 0.0842, 0.1729, 0.3951, 0.6447, 0.8688, 1.0605, 1.2472, 1.4330, + 1.6232, 1.8144, 2.0216, 2.1915, 2.3878, 2.5763, 2.7685, 2.9464, + 0.1461, 0.2593, 0.4105, 0.5677, 0.7328, 0.8919, 1.0484, 1.2302, + 1.4386, 1.6635, 1.8873, 2.1024, 2.3116, 2.5268, 2.7273, 2.9269, + 0.1503, 0.3108, 0.4756, 0.6731, 0.8600, 1.0233, 1.2115, 1.3971, + 1.5915, 1.7892, 1.9517, 2.1603, 2.3487, 2.5460, 2.7308, 2.8998, + 0.2163, 0.3669, 0.5125, 0.6709, 0.8143, 0.9930, 1.2095, 1.4205, + 1.6176, 1.7112, 1.8398, 2.0896, 2.3513, 2.5290, 2.6667, 2.8960, + 0.2133, 0.4382, 0.6287, 0.8702, 1.1088, 1.3749, 1.6062, 1.7446, + 1.8333, 1.9122, 1.9614, 2.0669, 2.1789, 2.3449, 2.6038, 2.8849, + 0.1598, 0.2719, 0.3877, 0.4815, 0.5926, 0.7795, 1.0449, 1.3045, + 1.5210, 1.7391, 1.9462, 2.1397, 2.3553, 2.5458, 2.7540, 2.9392, + 0.2918, 0.5607, 0.6801, 0.7404, 0.8285, 0.9431, 1.1579, 1.4080, + 1.6332, 1.8472, 1.9738, 2.0771, 2.2890, 2.5178, 2.7445, 2.9830, + 0.1664, 0.2842, 0.3965, 0.5463, 0.8162, 1.0346, 1.1849, 1.3446, + 1.5122, 1.7563, 1.9960, 2.2002, 2.3796, 2.5689, 2.7712, 2.9550, + 0.0911, 0.2397, 0.5052, 0.7868, 1.0299, 1.1311, 1.2244, 1.3333, + 1.4395, 1.6790, 1.9369, 2.1717, 2.3689, 2.5538, 2.7340, 2.9326, + 0.1647, 0.2931, 0.3836, 0.4978, 0.6255, 0.9243, 1.1339, 1.3001, + 1.5269, 1.8010, 1.9715, 2.1419, 2.3784, 2.5503, 2.6719, 2.8745, + 0.2440, 0.3802, 0.4756, 0.6613, 0.8627, 1.0292, 1.2291, 1.4060, + 1.5198, 1.7354, 1.9044, 2.1010, 2.3147, 2.4996, 2.7171, 2.9041, + 0.1590, 0.2876, 0.4572, 0.5996, 0.7713, 0.9490, 1.1205, 1.2815, + 1.4516, 1.6385, 1.8179, 2.0457, 2.2759, 2.4785, 2.6861, 2.9080, + 0.2297, 0.4309, 0.5712, 0.6717, 0.8138, 1.0463, 1.2492, 1.4560, + 1.6796, 1.8458, 1.9642, 2.1452, 2.3636, 2.5395, 2.7456, 2.9495, + 0.2975, 0.4678, 0.4996, 0.5809, 0.6279, 0.6884, 0.8606, 1.1386, + 1.4412, 1.6876, 1.8760, 2.0932, 2.3178, 2.5166, 2.7345, 2.9280, + 0.1278, 0.3737, 0.6004, 0.7069, 0.8147, 1.0180, 1.2581, 1.3812, + 1.4855, 1.7268, 1.9970, 2.1258, 2.2936, 2.5702, 2.7563, 2.8983, + 0.1314, 0.2508, 0.3999, 0.5680, 0.7424, 0.9367, 1.1286, 1.3175, + 1.5336, 1.7404, 1.9317, 2.1404, 2.3514, 2.5562, 2.7510, 2.9402, + 0.1043, 0.2367, 0.4293, 0.6376, 0.8160, 0.9836, 1.1779, 1.3850, + 1.5835, 1.7875, 1.9765, 2.1593, 2.3654, 2.5577, 2.7465, 2.9398, + 0.1529, 0.2515, 0.3454, 0.4374, 0.7011, 0.9015, 1.0744, 1.3532, + 1.5699, 1.7545, 2.0021, 2.1259, 2.2278, 2.4546, 2.7264, 2.9425, + 0.1429, 0.2808, 0.4395, 0.6334, 0.8069, 0.9705, 1.1520, 1.3250, + 1.5109, 1.7285, 1.9356, 2.1469, 2.3479, 2.5554, 2.7512, 2.9348, + 0.1625, 0.3022, 0.4756, 0.6315, 0.8032, 0.9924, 1.1596, 1.3204, + 1.4994, 1.6929, 1.8955, 2.1090, 2.3025, 2.5018, 2.6908, 2.8980, + 0.1692, 0.3427, 0.5228, 0.7756, 0.9688, 1.0950, 1.3056, 1.4360, + 1.5675, 1.8049, 1.9376, 2.1151, 2.3407, 2.5012, 2.7192, 2.9258, + 0.0474, 0.1251, 0.1939, 0.3841, 0.6501, 0.9231, 1.1153, 1.3240, + 1.5478, 1.7599, 1.9651, 2.1510, 2.3645, 2.5552, 2.7542, 2.9393, + 0.2196, 0.4656, 0.7492, 0.9922, 1.1678, 1.2489, 1.3112, 1.3657, + 1.4223, 1.5302, 1.7212, 1.9996, 2.2523, 2.4844, 2.7036, 2.9145, + 0.1128, 0.2368, 0.3704, 0.5476, 0.7723, 0.9968, 1.1930, 1.3992, + 1.6013, 1.7957, 1.9888, 2.1857, 2.3825, 2.5705, 2.7616, 2.9434, + 0.1341, 0.2768, 0.4510, 0.6359, 0.8332, 1.0335, 1.2004, 1.3952, + 1.5762, 1.7681, 1.9815, 2.1735, 2.3657, 2.5552, 2.7514, 2.9498, + 0.1247, 0.2559, 0.3516, 0.4726, 0.6861, 0.9483, 1.1852, 1.3858, + 1.5851, 1.7815, 1.9778, 2.1737, 2.3729, 2.5664, 2.7620, 2.9429, + 0.1988, 0.3320, 0.4777, 0.6737, 0.8425, 1.0265, 1.1694, 1.3655, + 1.5463, 1.7135, 1.9385, 2.1650, 2.3529, 2.5367, 2.7545, 2.9585, + 0.1376, 0.2620, 0.4273, 0.6169, 0.7755, 0.9441, 1.1169, 1.3157, + 1.5179, 1.7020, 1.8931, 2.1059, 2.3112, 2.5136, 2.7169, 2.9198, + 0.2112, 0.4385, 0.6091, 0.7618, 0.9553, 1.1543, 1.3445, 1.5396, + 1.7153, 1.9192, 2.1263, 2.3593, 2.5958, 2.8171, 2.9394, 3.0409, + 0.1347, 0.2099, 0.2646, 0.3453, 0.5266, 0.7869, 1.0513, 1.2795, + 1.4880, 1.7181, 1.9294, 2.1332, 2.3362, 2.5442, 2.7433, 2.9362, + 0.3141, 0.5935, 0.7517, 0.8313, 0.8568, 0.9570, 1.0250, 1.1275, + 1.3422, 1.6303, 1.8577, 2.0705, 2.2957, 2.5095, 2.7244, 2.9262, + 0.0962, 0.2116, 0.3961, 0.5641, 0.7122, 0.8883, 1.1023, 1.3481, + 1.5623, 1.7554, 1.9618, 2.1675, 2.3706, 2.5556, 2.7430, 2.9337, + 0.0898, 0.1510, 0.3060, 0.5820, 0.8221, 1.0388, 1.2261, 1.4289, + 1.6054, 1.8103, 1.9941, 2.1844, 2.3742, 2.5711, 2.7632, 2.9474, + 0.1326, 0.2316, 0.3761, 0.5177, 0.6782, 0.8761, 1.0952, 1.3175, + 1.5078, 1.7034, 1.9051, 2.1245, 2.3424, 2.5484, 2.7444, 2.9389, + 0.1740, 0.3293, 0.5174, 0.6824, 0.8394, 1.0372, 1.2046, 1.3723, + 1.5656, 1.7444, 1.9442, 2.1386, 2.3139, 2.4960, 2.7071, 2.9297, + 0.2304, 0.3775, 0.4865, 0.6182, 0.7842, 0.9208, 1.1151, 1.2843, + 1.4641, 1.6988, 1.9209, 2.1260, 2.3099, 2.5229, 2.7414, 2.9276, + 0.0094, 0.0261, -0.0037, 0.0041, -0.0092, -0.0044, -0.0232, -0.0073, + -0.0047, -0.0021, 0.0250, -0.0580, -0.0140, -0.0342, -0.0586, 0.0020, + 0.0449, 0.0155, -0.0523, -0.0279, 0.0299, -0.0183, -0.0736, -0.0639, + -0.0017, 0.0336, 0.0209, 0.0046, 0.0077, -0.0148, -0.0114, -0.0120, + 0.0115, -0.0050, 0.0445, 0.0048, 0.0188, -0.0137, -0.0080, 0.0239, + -0.0184, -0.0524, -0.0195, -0.0126, 0.0284, 0.0632, 0.0141, -0.0093, + -0.0096, 0.0196, 0.0230, 0.0379, 0.0308, 0.0237, -0.0224, -0.0600, + -0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672, + 0.0504, 0.0676, 0.0336, -0.0042, 0.0729, 0.1013, 0.0868, 0.0846, + 0.0954, 0.0515, -0.0066, -0.0851, -0.0485, 0.0294, 0.0395, 0.0087, + 0.0078, 0.0446, 0.0881, 0.0672, -0.0384, -0.0025, 0.0415, 0.0353, + 0.0080, 0.0052, 0.0190, 0.0182, 0.0069, 0.0168, 0.0374, 0.0037, + -0.0292, -0.0429, 0.0302, 0.0681, -0.0233, -0.0238, -0.0003, -0.0043, + 0.0054, -0.0029, -0.0149, 0.0642, 0.0622, 0.0341, -0.0232, -0.0461, + -0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398, + -0.0318, -0.0116, 0.0011, 0.0009, -0.0384, -0.0384, -0.0156, -0.0260, + -0.0007, 0.0473, 0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090, + -0.0285, -0.0495, -0.0376, 0.0917, 0.1192, 0.1026, 0.0745, 0.0397, + 0.0463, 0.0253, 0.0025, 0.0465, 0.0100, 0.0488, 0.0416, 0.0223, + 0.0263, 0.0072, -0.0053, 0.0595, 0.0060, -0.0518, -0.0316, -0.0043, + -0.0133, -0.0233, -0.0075, -0.0251, 0.0277, -0.0067, -0.0136, -0.0004, + 0.0235, 0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384, + 0.0005, -0.0150, -0.0356, 0.0127, -0.0033, -0.0034, 0.0205, 0.0747, + 0.1138, 0.1015, 0.0995, -0.0161, -0.0045, 0.0129, 0.0472, 0.0575, + 0.0222, 0.0091, 0.0037, -0.0471, 0.0371, 0.0132, 0.0208, 0.0247, + 0.0117, 0.0164, 0.0225, 0.0124, -0.0023, 0.0088, -0.0046, 0.0047, + -0.0393, 0.0018, 0.0148, 0.0020, 0.0044, 0.0165, 0.0229, -0.0208, + -0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094, 0.0075, + -0.0102, -0.0045, -0.0504, -0.0709, 0.0822, 0.0710, 0.0426, 0.0014, + -0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015, 0.0134, + -0.0418, -0.0682, -0.0256, 0.0050, 0.0360, 0.0354, 0.0074, -0.0396, + -0.0235, 0.0284, 0.0494, 0.0153, 0.0448, 0.0025, -0.0061, 0.0252, + 0.1000, 0.2260, 0.2158, 0.2116, 0.2198, 0.2055, 0.2110, 0.1873, + 0.1907, 0.2071, 0.2164, 0.2009, 0.2059, 0.2124, 0.2141, 0.2093, + 0.0875, 0.0981, 0.1177, 0.1071, 0.1033, 0.1248, 0.1048, 0.1238, + 0.1166, 0.1008, 0.1062, 0.0992, 0.0994, 0.1067, 0.0999, 0.1187, + 0.0750, 0.0794, 0.0828, 0.0854, 0.0859, 0.0801, 0.0891, 0.0933, + 0.0969, 0.0920, 0.0915, 0.0862, 0.0868, 0.0891, 0.0842, 0.0824, + 0.0625, 0.0930, 0.0815, 0.0853, 0.0898, 0.0828, 0.0822, 0.0910, + 0.0873, 0.0906, 0.0856, 0.0840, 0.0774, 0.0785, 0.0684, 0.0711, + 0.3319, 0.4219, 0.4588, 0.4090, 0.4092, 0.4014, 0.3548, 0.3353, + 0.3708, 0.3352, 0.3720, 0.3538, 0.4084, 0.4289, 0.4060, 0.4210, + 0.0588, 0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346, + -0.0346, -0.0366, -0.0220, -0.0265, -0.0102, 0.0374, 0.0306, 0.0404, + 0.0306, 0.0090, -0.0054, 0.0333, 0.0047, 0.0238, 0.0141, 0.0165, + 0.0306, 0.0420, 0.0159, 0.0124, 0.0414, 0.0158, -0.0237, 0.0141, + 0.0765, 0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417, + -0.0429, -0.0615, -0.0893, -0.0618, -0.0384, -0.0134, -0.0232, -0.0238, +}; + +const float ff_metasound_lsp22[] = { + 0.0664, 0.1875, 0.4300, 0.6730, 0.8793, 1.0640, 1.2563, 1.4433, + 1.6394, 1.8176, 2.0029, 2.1921, 2.3796, 2.5671, 2.7595, 2.9536, + 0.2128, 0.4052, 0.5311, 0.6404, 0.7875, 0.8775, 1.0974, 1.3261, + 1.5563, 1.6790, 1.8339, 2.1195, 2.3226, 2.4609, 2.6440, 2.8947, + 0.2024, 0.3362, 0.4834, 0.6784, 0.9088, 1.0850, 1.2188, 1.4054, + 1.6102, 1.7767, 1.9679, 2.1436, 2.3445, 2.5467, 2.7429, 2.9320, + 0.1181, 0.2279, 0.4413, 0.6114, 0.7710, 0.9427, 1.1142, 1.2707, + 1.4892, 1.7416, 1.9526, 2.1466, 2.3629, 2.5445, 2.7293, 2.9205, + 0.1155, 0.2720, 0.4886, 0.6812, 0.8594, 1.0422, 1.2315, 1.4116, + 1.6137, 1.8020, 1.9758, 2.1743, 2.3602, 2.5568, 2.7472, 2.9374, + 0.1110, 0.3312, 0.4735, 0.5612, 0.7129, 0.8146, 1.0233, 1.3155, + 1.5765, 1.7746, 1.9574, 2.1416, 2.3220, 2.5384, 2.7334, 2.9318, + 0.1656, 0.3350, 0.4215, 0.5609, 0.6759, 0.8503, 1.1405, 1.4094, + 1.6057, 1.6860, 1.7639, 2.0031, 2.2680, 2.5076, 2.7263, 2.9368, + 0.1466, 0.3638, 0.4587, 0.5674, 0.7381, 0.8669, 0.9619, 1.1658, + 1.4667, 1.7440, 1.9335, 2.1018, 2.3022, 2.5281, 2.7359, 2.9261, + 0.1061, 0.2566, 0.4739, 0.6751, 0.8711, 1.0704, 1.2720, 1.4655, + 1.6605, 1.8494, 2.0290, 2.2197, 2.4008, 2.5912, 2.7772, 2.9513, + 0.1116, 0.2364, 0.3971, 0.6316, 0.8583, 1.0335, 1.1686, 1.3302, + 1.5612, 1.7877, 1.9829, 2.2052, 2.3596, 2.5460, 2.7341, 2.9290, + 0.2661, 0.4186, 0.5126, 0.6477, 0.8818, 1.1045, 1.2852, 1.4128, + 1.5851, 1.7593, 1.9399, 2.1757, 2.3684, 2.5136, 2.6927, 2.9064, + 0.1495, 0.2749, 0.4391, 0.6304, 0.8239, 1.0181, 1.1995, 1.3759, + 1.5669, 1.7722, 1.9671, 2.1635, 2.3586, 2.5528, 2.7445, 2.9311, + 0.0912, 0.1759, 0.3066, 0.5660, 0.8005, 0.9568, 1.1832, 1.4504, + 1.6259, 1.7948, 2.0113, 2.2002, 2.3654, 2.5583, 2.7929, 2.9735, + 0.1353, 0.2747, 0.4078, 0.5977, 0.7658, 0.9124, 1.1081, 1.3630, + 1.5875, 1.7847, 1.9323, 2.1181, 2.3321, 2.5046, 2.7183, 2.9225, + 0.1938, 0.4063, 0.4982, 0.6002, 0.7702, 0.9071, 1.1631, 1.3885, + 1.6043, 1.8118, 1.9306, 2.0893, 2.2724, 2.4609, 2.6283, 2.8802, + 0.1857, 0.3351, 0.4381, 0.6101, 0.7561, 0.8555, 1.0384, 1.3171, + 1.5667, 1.6904, 1.7552, 1.9689, 2.2597, 2.5260, 2.7272, 2.9337, + 0.1037, 0.2159, 0.4188, 0.6174, 0.8035, 1.0285, 1.2256, 1.4230, + 1.6400, 1.8322, 2.0144, 2.1988, 2.3810, 2.5682, 2.7613, 2.9438, + 0.1625, 0.2776, 0.4225, 0.6001, 0.7879, 0.9087, 1.0801, 1.2759, + 1.4899, 1.7448, 1.9911, 2.1770, 2.3723, 2.5777, 2.7971, 2.9444, + 0.2111, 0.3640, 0.5839, 0.7290, 0.8051, 1.0023, 1.2315, 1.4143, + 1.5878, 1.7755, 1.9804, 2.1498, 2.3312, 2.5350, 2.7613, 2.9472, + 0.1423, 0.2646, 0.4136, 0.6350, 0.8070, 0.9514, 1.1168, 1.3213, + 1.5776, 1.7721, 1.9404, 2.1545, 2.3385, 2.5137, 2.7396, 2.9553, + 0.1132, 0.2386, 0.4103, 0.5931, 0.7808, 0.9881, 1.1840, 1.3860, + 1.6021, 1.7990, 1.9922, 2.1885, 2.3852, 2.5717, 2.7640, 2.9510, + 0.1267, 0.2602, 0.3913, 0.5944, 0.7598, 0.9198, 1.0781, 1.2715, + 1.5299, 1.7573, 1.9308, 2.1346, 2.3267, 2.5419, 2.7466, 2.9320, + 0.2023, 0.3417, 0.4392, 0.6141, 0.7439, 0.8593, 1.1096, 1.3543, + 1.5185, 1.6553, 1.7862, 2.0341, 2.2718, 2.4834, 2.7103, 2.9466, + 0.1113, 0.2470, 0.3677, 0.5686, 0.7700, 0.9356, 1.0806, 1.2452, + 1.4830, 1.7344, 1.9268, 2.1404, 2.3371, 2.5169, 2.7329, 2.9012, + 0.1664, 0.3554, 0.5573, 0.7471, 0.9245, 1.0998, 1.2787, 1.4655, + 1.6654, 1.8346, 2.0179, 2.2159, 2.4096, 2.5946, 2.7790, 2.9530, + 0.1313, 0.2625, 0.4731, 0.6444, 0.8110, 0.9878, 1.1493, 1.3212, + 1.5719, 1.8138, 1.9861, 2.1943, 2.3714, 2.5578, 2.7346, 2.9296, + 0.1186, 0.3035, 0.5049, 0.6860, 0.8670, 0.9975, 1.1364, 1.3471, + 1.5695, 1.7412, 1.9346, 2.1506, 2.3413, 2.5531, 2.7794, 2.9627, + 0.1108, 0.2697, 0.4787, 0.6344, 0.7909, 0.9586, 1.1440, 1.3511, + 1.5686, 1.7601, 1.9246, 2.1241, 2.3293, 2.5390, 2.7315, 2.9333, + 0.0985, 0.2302, 0.3544, 0.5759, 0.7620, 0.9651, 1.1497, 1.3080, + 1.5500, 1.7845, 1.9518, 2.1734, 2.3565, 2.5665, 2.7605, 2.9102, + 0.1208, 0.2727, 0.4381, 0.5736, 0.7382, 0.8390, 1.0102, 1.2648, + 1.5100, 1.7440, 1.9619, 2.1430, 2.3307, 2.5159, 2.7264, 2.9211, + 0.1582, 0.2777, 0.4475, 0.6551, 0.8591, 1.0084, 1.1414, 1.3291, + 1.5902, 1.7826, 1.9543, 2.1659, 2.3233, 2.5044, 2.6935, 2.9199, + 0.1360, 0.2873, 0.4585, 0.6295, 0.7592, 0.9089, 1.0492, 1.2733, + 1.5391, 1.7768, 1.9372, 2.1329, 2.3168, 2.5015, 2.6857, 2.8837, + 0.0886, 0.1829, 0.3696, 0.6126, 0.8334, 1.0135, 1.2303, 1.4674, + 1.6743, 1.8564, 2.0530, 2.2370, 2.3960, 2.5787, 2.7756, 2.9377, + 0.2005, 0.3537, 0.4700, 0.6249, 0.7385, 0.9097, 1.1759, 1.3811, + 1.5314, 1.6705, 1.8546, 2.1229, 2.3292, 2.5251, 2.7951, 2.9646, + 0.1999, 0.3112, 0.4722, 0.7146, 0.8908, 1.0028, 1.1831, 1.3903, + 1.6125, 1.7514, 1.9083, 2.1248, 2.3271, 2.5339, 2.6945, 2.8918, + 0.1243, 0.2606, 0.4382, 0.5850, 0.7705, 0.9727, 1.1214, 1.3059, + 1.5218, 1.7406, 1.9137, 2.1353, 2.3354, 2.5299, 2.7287, 2.9068, + 0.1039, 0.2426, 0.4265, 0.6284, 0.8152, 0.9941, 1.2004, 1.4038, + 1.5912, 1.7763, 1.9650, 2.1598, 2.3474, 2.5488, 2.7419, 2.9322, + 0.1364, 0.2420, 0.3886, 0.5864, 0.7663, 0.8844, 1.0860, 1.3242, + 1.5518, 1.7893, 2.0004, 2.1562, 2.3619, 2.5516, 2.7687, 2.9181, + 0.1483, 0.2851, 0.4479, 0.6312, 0.7924, 0.9821, 1.1705, 1.3386, + 1.5375, 1.7226, 1.9053, 2.0991, 2.2898, 2.4953, 2.7000, 2.9146, + 0.2332, 0.4561, 0.5407, 0.6212, 0.7524, 0.8215, 0.9522, 1.1685, + 1.5216, 1.7132, 1.8291, 2.0647, 2.2811, 2.4857, 2.7071, 2.9281, + 0.1348, 0.3126, 0.5179, 0.7192, 0.9227, 1.1363, 1.3223, 1.4756, + 1.6509, 1.8191, 1.9991, 2.1976, 2.3877, 2.5768, 2.7590, 2.9386, + 0.1093, 0.2211, 0.4763, 0.6703, 0.8282, 0.9536, 1.1202, 1.3796, + 1.6043, 1.8031, 1.9832, 2.1604, 2.3578, 2.5856, 2.7650, 2.9291, + 0.1865, 0.3027, 0.4580, 0.6719, 0.8400, 1.0082, 1.1901, 1.3782, + 1.5448, 1.6885, 1.9477, 2.1381, 2.2797, 2.5113, 2.7465, 2.9414, + 0.1575, 0.3124, 0.4649, 0.6262, 0.8095, 0.9858, 1.1676, 1.3602, + 1.5646, 1.7582, 1.9550, 2.1671, 2.3628, 2.5734, 2.7670, 2.9519, + 0.1174, 0.2777, 0.4663, 0.6333, 0.8169, 1.0096, 1.1885, 1.3847, + 1.5803, 1.7571, 1.9380, 2.1398, 2.3414, 2.5407, 2.7360, 2.9375, + 0.1073, 0.2264, 0.4083, 0.5973, 0.7474, 0.9514, 1.1349, 1.3337, + 1.5433, 1.7348, 1.9380, 2.1436, 2.3441, 2.5438, 2.7457, 2.9383, + 0.1472, 0.2880, 0.4793, 0.6268, 0.8015, 1.0063, 1.1715, 1.3644, + 1.5525, 1.7410, 1.9258, 2.1227, 2.3214, 2.5149, 2.7148, 2.9196, + 0.1414, 0.2565, 0.4349, 0.6111, 0.7695, 0.9496, 1.1212, 1.3265, + 1.5218, 1.7209, 1.9015, 2.0887, 2.3158, 2.5077, 2.7233, 2.9421, + 0.1252, 0.2667, 0.4454, 0.6431, 0.8371, 1.0124, 1.2110, 1.4160, + 1.6240, 1.8242, 2.0047, 2.1974, 2.3902, 2.5778, 2.7637, 2.9481, + 0.1321, 0.2565, 0.3846, 0.5847, 0.7578, 0.9259, 1.0637, 1.2239, + 1.4690, 1.7346, 1.9750, 2.1882, 2.3712, 2.5509, 2.7280, 2.8885, + 0.1437, 0.2930, 0.4428, 0.6156, 0.8045, 0.9638, 1.1450, 1.3138, + 1.5144, 1.7355, 1.9469, 2.1534, 2.3414, 2.5452, 2.7353, 2.9334, + 0.1692, 0.2770, 0.3831, 0.6100, 0.7825, 0.9302, 1.0690, 1.2481, + 1.4615, 1.6799, 1.9165, 2.1739, 2.3435, 2.5349, 2.7520, 2.9163, + 0.1235, 0.2489, 0.4354, 0.6343, 0.8236, 1.0066, 1.1908, 1.3474, + 1.5656, 1.8275, 2.0620, 2.2548, 2.4135, 2.5913, 2.7639, 2.9334, + 0.1090, 0.1961, 0.3854, 0.5701, 0.7024, 0.8843, 1.1393, 1.3785, + 1.5940, 1.7797, 1.9442, 2.1740, 2.3853, 2.5773, 2.7727, 2.9406, + 0.1560, 0.3477, 0.5011, 0.6287, 0.7612, 0.9896, 1.1510, 1.3420, + 1.5435, 1.6816, 1.8731, 2.0651, 2.2613, 2.4999, 2.7027, 2.8971, + 0.1459, 0.2416, 0.3833, 0.5450, 0.7916, 0.9223, 1.0662, 1.1953, + 1.4029, 1.6616, 1.9320, 2.1459, 2.3386, 2.5081, 2.6799, 2.9195, + 0.1546, 0.3854, 0.6184, 0.8460, 1.0599, 1.2428, 1.3906, 1.5550, + 1.7388, 1.8945, 2.0757, 2.2386, 2.4014, 2.5705, 2.7574, 2.9400, + 0.1080, 0.2307, 0.4112, 0.6067, 0.7725, 0.9467, 1.1285, 1.3205, + 1.5348, 1.7609, 1.9937, 2.1878, 2.3583, 2.5515, 2.7199, 2.9049, + 0.1482, 0.3178, 0.4983, 0.6342, 0.7783, 0.9880, 1.2019, 1.3404, + 1.5223, 1.7296, 1.9211, 2.0943, 2.2928, 2.5008, 2.7136, 2.9224, + 0.1145, 0.2910, 0.4891, 0.6492, 0.8126, 0.9530, 1.1180, 1.3155, + 1.5054, 1.6893, 1.8899, 2.1188, 2.3389, 2.5512, 2.7313, 2.9224, + 0.0939, 0.1689, 0.3250, 0.5792, 0.7698, 0.9245, 1.1574, 1.3865, + 1.5959, 1.7977, 1.9821, 2.1528, 2.3326, 2.5540, 2.7553, 2.9179, + 0.1243, 0.2474, 0.3923, 0.6199, 0.7908, 0.9379, 1.1497, 1.3734, + 1.5582, 1.7420, 1.9539, 2.1385, 2.3240, 2.5277, 2.7311, 2.9178, + 0.1961, 0.3748, 0.5176, 0.6387, 0.8169, 1.0477, 1.2124, 1.3869, + 1.5604, 1.7225, 1.8770, 2.0837, 2.2960, 2.5103, 2.6945, 2.8862, + 0.1295, 0.2403, 0.4149, 0.6189, 0.7913, 0.9130, 1.0832, 1.2787, + 1.4860, 1.7112, 1.9502, 2.1348, 2.2776, 2.4982, 2.7431, 2.9522, + 0.0160, 0.0362, 0.0097, 0.0057, -0.0014, -0.0073, -0.0046, -0.0064, + -0.0121, 0.0019, 0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182, + 0.0170, 0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025, + 0.0307, 0.0351, 0.0338, 0.0420, 0.0138, -0.0175, -0.0102, 0.0053, + 0.0084, -0.0003, 0.0412, -0.0027, 0.0145, -0.0039, 0.0083, 0.0400, + 0.0001, -0.0262, 0.0055, -0.0082, 0.0348, 0.0433, 0.0137, -0.0024, + -0.0055, 0.0262, 0.0521, 0.0349, 0.0185, 0.0076, -0.0319, -0.0561, + -0.0460, -0.0253, -0.0097, 0.0163, 0.0184, -0.0037, -0.0480, -0.0371, + 0.0628, 0.0665, 0.0296, -0.0057, 0.0253, 0.0227, 0.0350, 0.0692, + 0.0545, 0.0218, 0.0094, -0.0449, -0.0372, 0.0005, 0.0258, 0.0118, + 0.0285, 0.0760, 0.0822, 0.0527, -0.0299, -0.0049, 0.0170, 0.0195, + 0.0136, 0.0286, 0.0289, 0.0139, 0.0054, 0.0152, 0.0244, 0.0028, + -0.0056, -0.0260, 0.0307, 0.0572, -0.0087, 0.0088, 0.0062, 0.0000, + 0.0125, 0.0000, -0.0292, 0.0820, 0.0872, 0.0646, 0.0346, 0.0076, + -0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166, + -0.0259, -0.0140, 0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019, + -0.0071, 0.0393, 0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186, + -0.0280, -0.0201, -0.0077, 0.0383, 0.0418, 0.0321, 0.0294, 0.0169, + 0.0468, 0.0301, 0.0133, 0.0363, 0.0516, 0.0937, 0.1240, 0.1404, + 0.1325, 0.1178, 0.0999, 0.0251, -0.0037, -0.0495, -0.0703, -0.0219, + -0.0261, -0.0304, -0.0204, -0.0372, 0.0355, 0.0131, -0.0093, -0.0099, + -0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243, + 0.0046, -0.0107, -0.0070, 0.0123, 0.0230, 0.0152, 0.0164, 0.0412, + 0.0619, 0.0858, 0.0862, -0.0056, 0.0125, 0.0182, 0.0347, 0.0388, + 0.0456, 0.0407, -0.0249, -0.0460, 0.0206, 0.0299, 0.0253, 0.0207, + 0.0177, 0.0238, 0.0253, 0.0030, 0.0042, 0.0020, -0.0081, -0.0136, + -0.0290, -0.0042, 0.0122, 0.0051, 0.0107, 0.0228, 0.0211, -0.0068, + -0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679, 0.0172, 0.0150, + -0.0051, 0.0081, -0.0512, -0.0616, 0.0576, 0.0799, 0.0803, 0.0336, + 0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050, 0.0174, + -0.0290, -0.0601, -0.0150, 0.0121, 0.0165, 0.0230, 0.0028, -0.0317, + -0.0165, 0.0356, 0.0451, 0.0120, 0.0321, 0.0084, -0.0058, 0.0122, + 0.1935, 0.1802, 0.2195, 0.2410, 0.2201, 0.1915, 0.1840, 0.1935, + 0.2213, 0.2079, 0.1858, 0.1974, 0.2239, 0.2173, 0.1840, 0.2120, + 0.4912, 0.4777, 0.4607, 0.4395, 0.4426, 0.4388, 0.4416, 0.4345, + 0.4239, 0.4331, 0.4522, 0.4423, 0.4475, 0.4387, 0.4525, 0.4446, +}; + +const float ff_metasound_lsp44[] = { + 0.0927, 0.2291, 0.4059, 0.5779, 0.7288, 0.8821, 1.0377, 1.1915, + 1.3433, 1.4931, 1.6475, 1.7989, 1.9381, 2.0858, 2.2321, 2.3765, + 2.5187, 2.6530, 2.7895, 2.9354, 0.0944, 0.1974, 0.3046, 0.4714, + 0.6116, 0.7829, 0.9027, 1.0375, 1.1869, 1.3488, 1.5036, 1.6781, + 1.8276, 1.9983, 2.1449, 2.3089, 2.4534, 2.6113, 2.7553, 2.9062, + 0.1168, 0.2843, 0.4907, 0.6706, 0.8100, 0.9417, 1.0753, 1.2014, + 1.3151, 1.4496, 1.5832, 1.7379, 1.8642, 2.0230, 2.1681, 2.3250, + 2.4676, 2.6242, 2.7602, 2.9066, 0.1353, 0.2335, 0.3370, 0.4380, + 0.5819, 0.7353, 0.8671, 1.0160, 1.1435, 1.2977, 1.4860, 1.6739, + 1.8412, 2.0028, 2.1537, 2.3124, 2.4741, 2.6272, 2.7862, 2.9536, + 0.1003, 0.2226, 0.3584, 0.4971, 0.6291, 0.7710, 0.9157, 1.0669, + 1.2143, 1.3624, 1.5104, 1.6681, 1.8164, 1.9823, 2.1394, 2.3082, + 2.4677, 2.6306, 2.7909, 2.9382, 0.1056, 0.2027, 0.2956, 0.4005, + 0.5215, 0.6708, 0.8545, 1.0557, 1.2344, 1.4023, 1.5676, 1.7278, + 1.8808, 2.0381, 2.1846, 2.3376, 2.4887, 2.6377, 2.7878, 2.9504, + 0.1015, 0.2462, 0.4122, 0.5783, 0.7233, 0.8833, 1.0377, 1.1903, + 1.3341, 1.4727, 1.6138, 1.7582, 1.8912, 2.0370, 2.1701, 2.3125, + 2.4500, 2.6006, 2.7507, 2.9166, 0.1787, 0.2418, 0.3265, 0.5379, + 0.6584, 0.7681, 0.9545, 1.1050, 1.2125, 1.3528, 1.4763, 1.6705, + 1.8136, 1.9594, 2.0936, 2.2724, 2.4394, 2.5919, 2.7037, 2.8747, + 0.0859, 0.1600, 0.2980, 0.4933, 0.6696, 0.8285, 0.9958, 1.1545, + 1.3107, 1.4591, 1.6127, 1.7652, 1.9143, 2.0680, 2.2171, 2.3643, + 2.5141, 2.6611, 2.8143, 2.9691, 0.0910, 0.2110, 0.3364, 0.4718, + 0.5856, 0.7298, 0.8910, 1.0514, 1.1988, 1.3572, 1.5178, 1.6861, + 1.8399, 2.0099, 2.1639, 2.3225, 2.4774, 2.6321, 2.7863, 2.9412, + 0.1904, 0.2874, 0.3681, 0.4981, 0.6248, 0.7880, 0.9121, 1.0750, + 1.2185, 1.3809, 1.5296, 1.7007, 1.8592, 2.0470, 2.1913, 2.3250, + 2.4519, 2.5984, 2.7408, 2.9023, 0.0917, 0.2067, 0.3246, 0.4961, + 0.6310, 0.8024, 0.9438, 1.1008, 1.2362, 1.3892, 1.5407, 1.7033, + 1.8427, 2.0061, 2.1498, 2.3117, 2.4550, 2.6053, 2.7462, 2.9029, + 0.0989, 0.2193, 0.3756, 0.5410, 0.6929, 0.8368, 0.9801, 1.1250, + 1.2677, 1.4184, 1.5677, 1.7292, 1.8770, 2.0311, 2.1803, 2.3306, + 2.4836, 2.6339, 2.7943, 2.9549, 0.0861, 0.1943, 0.3057, 0.4867, + 0.6194, 0.7592, 0.9184, 1.1052, 1.2486, 1.4064, 1.5609, 1.7273, + 1.8703, 2.0291, 2.1686, 2.3225, 2.4628, 2.6115, 2.7471, 2.9005, + 0.0932, 0.2110, 0.3737, 0.5479, 0.7120, 0.8570, 0.9975, 1.1364, + 1.2772, 1.4220, 1.5612, 1.7089, 1.8410, 1.9827, 2.1263, 2.2859, + 2.4459, 2.6172, 2.7788, 2.9395, 0.1193, 0.2341, 0.3523, 0.5029, + 0.6437, 0.7803, 0.9367, 1.1007, 1.2392, 1.3869, 1.5425, 1.7168, + 1.8709, 2.0248, 2.1584, 2.2949, 2.4308, 2.5823, 2.7235, 2.9034, + 0.0834, 0.1988, 0.3557, 0.5261, 0.6767, 0.8427, 1.0029, 1.1683, + 1.3138, 1.4527, 1.6046, 1.7583, 1.9011, 2.0517, 2.1928, 2.3397, + 2.4839, 2.6291, 2.7771, 2.9329, 0.0938, 0.1967, 0.3213, 0.4675, + 0.6068, 0.7664, 0.9418, 1.1120, 1.2535, 1.3932, 1.5243, 1.6801, + 1.8346, 1.9931, 2.1376, 2.3035, 2.4636, 2.6244, 2.7829, 2.9371, + 0.1017, 0.2552, 0.4327, 0.6017, 0.7467, 0.8797, 1.0097, 1.1442, + 1.2628, 1.4049, 1.5541, 1.7090, 1.8461, 1.9982, 2.1486, 2.3029, + 2.4513, 2.6075, 2.7594, 2.9209, 0.1031, 0.2295, 0.3747, 0.5122, + 0.6596, 0.7935, 0.9345, 1.1050, 1.2384, 1.3543, 1.4739, 1.6136, + 1.7447, 1.8914, 2.0434, 2.1916, 2.3557, 2.5396, 2.7419, 2.9401, + 0.1007, 0.2374, 0.3715, 0.5173, 0.6465, 0.8069, 0.9553, 1.1145, + 1.2594, 1.4143, 1.5617, 1.7166, 1.8457, 2.0012, 2.1462, 2.2864, + 2.4258, 2.5910, 2.7372, 2.9018, 0.0808, 0.1726, 0.2849, 0.4592, + 0.6118, 0.7853, 0.9588, 1.1256, 1.2751, 1.4392, 1.5898, 1.7514, + 1.8977, 2.0554, 2.1937, 2.3430, 2.4831, 2.6249, 2.7601, 2.9155, + 0.1669, 0.2574, 0.3694, 0.5569, 0.6773, 0.8061, 1.0160, 1.1667, + 1.2791, 1.4041, 1.5452, 1.7207, 1.8524, 2.0038, 2.1414, 2.3338, + 2.4747, 2.6157, 2.7303, 2.8848, 0.1598, 0.2521, 0.3416, 0.5149, + 0.6703, 0.7941, 0.9408, 1.1164, 1.2017, 1.3293, 1.4908, 1.6783, + 1.8438, 1.9927, 2.1149, 2.2698, 2.4420, 2.6193, 2.7583, 2.9103, + 0.0902, 0.1978, 0.3265, 0.4578, 0.5878, 0.7439, 0.9110, 1.0906, + 1.2556, 1.4125, 1.5688, 1.7295, 1.8829, 2.0472, 2.2058, 2.3537, + 2.5075, 2.6548, 2.8058, 2.9538, 0.0818, 0.1695, 0.2794, 0.4470, + 0.6069, 0.7641, 0.9313, 1.0946, 1.2411, 1.4072, 1.5640, 1.7186, + 1.8651, 2.0254, 2.1726, 2.3286, 2.4784, 2.6287, 2.7750, 2.9339, + 0.1980, 0.3134, 0.4099, 0.4975, 0.6491, 0.8376, 0.9441, 1.0298, + 1.1795, 1.3866, 1.5784, 1.7209, 1.8137, 1.9271, 2.0863, 2.2930, + 2.4696, 2.6184, 2.7587, 2.9251, 0.1338, 0.2341, 0.3566, 0.4797, + 0.6129, 0.7580, 0.9093, 1.0491, 1.1911, 1.3313, 1.4841, 1.6503, + 1.8035, 1.9685, 2.1128, 2.2694, 2.4093, 2.5728, 2.7206, 2.8994, + 0.0937, 0.2034, 0.3447, 0.5032, 0.6370, 0.7993, 0.9674, 1.1323, + 1.2830, 1.4199, 1.5492, 1.7010, 1.8513, 2.0087, 2.1550, 2.3115, + 2.4643, 2.6237, 2.7812, 2.9392, 0.1085, 0.2152, 0.3126, 0.4569, + 0.5718, 0.7213, 0.8837, 1.0604, 1.2053, 1.3755, 1.5397, 1.7001, + 1.8409, 2.0039, 2.1498, 2.3080, 2.4535, 2.6063, 2.7505, 2.9110, + 0.0562, 0.2066, 0.4034, 0.5490, 0.6682, 0.7924, 0.9495, 1.0800, + 1.1869, 1.3156, 1.4834, 1.6619, 1.8404, 2.0199, 2.1509, 2.2755, + 2.4072, 2.5580, 2.6993, 2.8913, 0.0939, 0.2303, 0.3742, 0.5260, + 0.6662, 0.8294, 0.9769, 1.1315, 1.2792, 1.4153, 1.5436, 1.6701, + 1.8215, 1.9920, 2.1310, 2.3005, 2.4534, 2.5786, 2.7204, 2.9068, + 0.1005, 0.2442, 0.3898, 0.5398, 0.6958, 0.8474, 1.0008, 1.1556, + 1.3020, 1.4456, 1.5954, 1.7470, 1.8922, 2.0500, 2.2019, 2.3492, + 2.4963, 2.6412, 2.7890, 2.9423, 0.1022, 0.2031, 0.3213, 0.4402, + 0.5637, 0.7117, 0.8673, 1.0242, 1.1727, 1.3206, 1.4846, 1.6465, + 1.8015, 1.9655, 2.1233, 2.2873, 2.4464, 2.6074, 2.7685, 2.9409, + 0.1985, 0.3497, 0.4622, 0.5982, 0.7489, 0.8752, 0.9925, 1.1679, + 1.3288, 1.4606, 1.5820, 1.7492, 1.8922, 2.0511, 2.1780, 2.3373, + 2.4760, 2.6233, 2.7466, 2.8978, 0.1284, 0.2433, 0.3630, 0.4852, + 0.6117, 0.7460, 0.8904, 1.0360, 1.1738, 1.3142, 1.4696, 1.6185, + 1.7719, 1.9318, 2.0961, 2.2697, 2.4408, 2.6046, 2.7681, 2.9451, + 0.1042, 0.2286, 0.3598, 0.5064, 0.6438, 0.7899, 0.9350, 1.0891, + 1.2323, 1.3807, 1.5225, 1.6747, 1.8153, 1.9669, 2.1145, 2.2832, + 2.4430, 2.6085, 2.7748, 2.9346, 0.0780, 0.1724, 0.2440, 0.3489, + 0.5280, 0.7426, 0.9272, 1.0914, 1.2562, 1.4188, 1.5804, 1.7376, + 1.8909, 2.0473, 2.1946, 2.3457, 2.4950, 2.6424, 2.7926, 2.9549, + 0.1103, 0.2608, 0.4087, 0.5538, 0.6923, 0.8418, 0.9940, 1.1507, + 1.2919, 1.4406, 1.5802, 1.7262, 1.8638, 2.0085, 2.1572, 2.2975, + 2.4329, 2.5866, 2.7380, 2.9107, 0.1297, 0.2532, 0.4003, 0.5329, + 0.6733, 0.7950, 0.9557, 1.0859, 1.2235, 1.3538, 1.5037, 1.6389, + 1.7964, 1.9285, 2.0898, 2.2541, 2.4231, 2.5711, 2.6875, 2.8947, + 0.0871, 0.1968, 0.3425, 0.4949, 0.6424, 0.7959, 0.9534, 1.1132, + 1.2656, 1.4229, 1.5785, 1.7271, 1.8729, 2.0355, 2.1998, 2.3562, + 2.5151, 2.6663, 2.8145, 2.9534, 0.1038, 0.2204, 0.3248, 0.4566, + 0.5947, 0.7443, 0.8811, 1.0379, 1.2031, 1.3772, 1.5430, 1.7092, + 1.8625, 2.0322, 2.1904, 2.3417, 2.4960, 2.6458, 2.7979, 2.9485, + 0.1329, 0.2763, 0.3943, 0.5147, 0.6512, 0.8071, 0.9410, 1.0879, + 1.2298, 1.3850, 1.5282, 1.6674, 1.8137, 1.9993, 2.1344, 2.2749, + 2.4257, 2.5863, 2.7410, 2.9184, 0.1052, 0.2142, 0.3584, 0.5033, + 0.6387, 0.7804, 0.9320, 1.0780, 1.2172, 1.3764, 1.5421, 1.6887, + 1.8246, 1.9833, 2.1245, 2.2797, 2.4237, 2.5779, 2.7257, 2.9097, + 0.1092, 0.2676, 0.4071, 0.5355, 0.6661, 0.8142, 0.9621, 1.1173, + 1.2628, 1.4185, 1.5696, 1.7220, 1.8595, 2.0178, 2.1720, 2.3221, + 2.4718, 2.6259, 2.7775, 2.9334, 0.0929, 0.2017, 0.3073, 0.4570, + 0.5775, 0.7635, 0.9299, 1.0832, 1.2334, 1.3935, 1.5420, 1.7112, + 1.8601, 2.0309, 2.1735, 2.3230, 2.4543, 2.6034, 2.7418, 2.8988, + 0.0775, 0.2005, 0.3490, 0.5200, 0.6747, 0.8383, 0.9885, 1.1738, + 1.3141, 1.4236, 1.5892, 1.7402, 1.8474, 2.0210, 2.1593, 2.2730, + 2.4235, 2.5604, 2.7128, 2.9005, 0.1104, 0.2292, 0.3353, 0.4732, + 0.6152, 0.7675, 0.9164, 1.0907, 1.2594, 1.4064, 1.5218, 1.6426, + 1.8018, 1.9937, 2.1362, 2.2961, 2.4523, 2.6083, 2.7613, 2.9202, + 0.0826, 0.2000, 0.3384, 0.5144, 0.6694, 0.8377, 0.9870, 1.1461, + 1.2950, 1.4495, 1.5872, 1.7387, 1.8793, 2.0329, 2.1723, 2.3114, + 2.4415, 2.5908, 2.7354, 2.9028, 0.1063, 0.2268, 0.3442, 0.4735, + 0.6116, 0.7507, 0.9028, 1.0768, 1.2426, 1.4052, 1.5566, 1.7015, + 1.8243, 1.9742, 2.1276, 2.2824, 2.4262, 2.5953, 2.7627, 2.9290, + 0.1150, 0.2814, 0.4543, 0.6095, 0.7373, 0.8592, 0.9908, 1.1108, + 1.2339, 1.3590, 1.4864, 1.6168, 1.7392, 1.8752, 2.0212, 2.1688, + 2.3128, 2.4869, 2.7019, 2.9239, 0.0948, 0.2074, 0.3433, 0.4943, + 0.6346, 0.7645, 0.8809, 1.0610, 1.2307, 1.3487, 1.4655, 1.6186, + 1.7534, 1.8859, 2.0486, 2.2200, 2.3835, 2.5581, 2.7565, 2.9502, + 0.1062, 0.2239, 0.3683, 0.5197, 0.6704, 0.8184, 0.9642, 1.1127, + 1.2556, 1.3976, 1.5405, 1.6940, 1.8375, 1.9888, 2.1377, 2.2980, + 2.4555, 2.6184, 2.7849, 2.9452, 0.0888, 0.2005, 0.2847, 0.4322, + 0.5763, 0.7577, 0.9262, 1.1095, 1.2719, 1.4331, 1.5843, 1.7452, + 1.8845, 2.0385, 2.1805, 2.3345, 2.4750, 2.6217, 2.7555, 2.9013, + 0.1713, 0.2617, 0.3868, 0.5859, 0.7073, 0.8535, 1.0593, 1.1778, + 1.3109, 1.4508, 1.5910, 1.7463, 1.8911, 2.0651, 2.2035, 2.3355, + 2.4947, 2.6440, 2.7424, 2.8943, 0.1346, 0.2549, 0.4089, 0.5488, + 0.6949, 0.8394, 0.9810, 1.1145, 1.2528, 1.4044, 1.5423, 1.6872, + 1.8274, 1.9726, 2.1403, 2.2809, 2.4128, 2.5564, 2.6887, 2.8895, + 0.0776, 0.1621, 0.2553, 0.4191, 0.5988, 0.7921, 0.9651, 1.1350, + 1.2930, 1.4475, 1.6011, 1.7585, 1.9068, 2.0638, 2.2102, 2.3594, + 2.5096, 2.6581, 2.8099, 2.9654, 0.0864, 0.1778, 0.2854, 0.4235, + 0.5568, 0.7220, 0.8963, 1.0609, 1.2217, 1.3830, 1.5422, 1.7018, + 1.8551, 2.0206, 2.1783, 2.3328, 2.4869, 2.6366, 2.7923, 2.9539, + 0.1144, 0.2576, 0.4186, 0.5594, 0.6875, 0.8221, 0.9598, 1.0944, + 1.2273, 1.3713, 1.5152, 1.6628, 1.8070, 1.9525, 2.0965, 2.2535, + 2.4132, 2.5725, 2.7250, 2.9150, 0.1079, 0.2221, 0.3334, 0.4845, + 0.6083, 0.7516, 0.9018, 1.0594, 1.2060, 1.3673, 1.5212, 1.6880, + 1.8208, 1.9831, 2.1269, 2.2909, 2.4366, 2.6027, 2.7339, 2.8924, + 0.0994, 0.2233, 0.3634, 0.5145, 0.6568, 0.8131, 0.9746, 1.1296, + 1.2666, 1.4116, 1.5748, 1.7264, 1.8649, 2.0217, 2.1716, 2.3293, + 2.4900, 2.6455, 2.7818, 2.9362, 0.1120, 0.2079, 0.3128, 0.4124, + 0.5291, 0.6816, 0.8478, 1.0150, 1.1772, 1.3456, 1.5208, 1.6882, + 1.8458, 2.0078, 2.1627, 2.3198, 2.4733, 2.6251, 2.7796, 2.9489, + 0.0853, 0.2030, 0.3669, 0.5326, 0.6678, 0.8086, 0.9526, 1.1142, + 1.2551, 1.4158, 1.5694, 1.7073, 1.8431, 1.9686, 2.1153, 2.2376, + 2.3686, 2.5591, 2.7320, 2.9104, 0.0905, 0.2166, 0.3539, 0.5201, + 0.6700, 0.8346, 0.9883, 1.1457, 1.2714, 1.3845, 1.5172, 1.6688, + 1.8008, 1.9535, 2.1019, 2.2708, 2.4135, 2.5974, 2.7486, 2.9033, + 0.0084, 0.0374, 0.0164, -0.0153, 0.0288, 0.0107, -0.0255, -0.0242, + 0.0000, -0.0055, -0.0081, -0.0075, -0.0022, -0.0052, -0.0069, -0.0017, + 0.0003, 0.0091, 0.0028, -0.0027, 0.0085, 0.0043, -0.0235, -0.0411, + 0.0202, 0.0359, 0.0376, 0.0321, 0.0306, -0.0358, -0.0276, -0.0090, + 0.0032, 0.0048, 0.0309, 0.0332, 0.0284, 0.0237, 0.0051, -0.0101, + -0.0233, -0.0428, -0.0585, -0.0387, 0.0039, 0.0081, 0.0029, -0.0017, + -0.0006, -0.0068, 0.0044, 0.0182, 0.0376, 0.0387, -0.0334, -0.0269, + -0.0182, -0.0069, -0.0026, 0.0035, -0.0049, -0.0212, -0.0408, -0.0245, + 0.0186, 0.0189, 0.0153, 0.0120, 0.0157, 0.0055, -0.0046, 0.0179, + 0.0284, -0.0032, -0.0261, -0.0205, -0.0039, 0.0174, 0.0299, 0.0207, + 0.0012, -0.0056, 0.0010, 0.0141, -0.0119, 0.0190, 0.0315, 0.0033, + -0.0128, 0.0300, 0.0328, 0.0308, 0.0353, 0.0266, 0.0066, -0.0328, + -0.0273, 0.0054, 0.0145, 0.0175, 0.0015, -0.0171, 0.0062, -0.0164, + 0.0045, -0.0071, 0.0025, 0.0278, 0.0283, 0.0117, -0.0026, -0.0285, + -0.0408, -0.0366, -0.0059, -0.0208, -0.0354, -0.0334, -0.0263, -0.0064, + 0.0072, -0.0006, -0.0235, -0.0037, -0.0307, -0.0294, -0.0163, -0.0197, + -0.0235, 0.0192, 0.0013, -0.0219, -0.0123, -0.0004, -0.0081, -0.0096, + -0.0123, -0.0101, 0.0021, 0.0151, 0.0106, 0.0151, 0.0292, 0.0033, + 0.0283, 0.0124, 0.0058, -0.0017, -0.0038, 0.0152, 0.0141, 0.0132, + 0.0178, 0.0157, 0.0073, 0.0176, 0.0141, 0.0097, -0.0092, -0.0163, + -0.0230, -0.0134, -0.0099, -0.0147, 0.0040, -0.0183, -0.0175, -0.0080, + -0.0083, -0.0290, -0.0417, -0.0398, -0.0269, -0.0199, -0.0143, -0.0053, + -0.0099, -0.0054, -0.0199, -0.0219, -0.0170, 0.0107, 0.0194, 0.0035, + 0.0437, 0.0406, 0.0215, 0.0120, 0.0053, -0.0028, 0.0238, 0.0337, + 0.0217, 0.0011, 0.0227, 0.0244, 0.0327, 0.0378, 0.0437, 0.0356, + -0.0033, 0.0113, 0.0407, 0.0334, -0.0125, -0.0003, -0.0141, -0.0273, + -0.0137, -0.0079, -0.0145, -0.0071, 0.0114, 0.0181, 0.0150, 0.0085, + -0.0077, -0.0038, -0.0219, -0.0263, -0.0187, -0.0233, 0.0133, 0.0265, + -0.0156, -0.0091, -0.0110, -0.0016, 0.0143, 0.0177, 0.0240, 0.0082, + -0.0143, -0.0257, -0.0014, 0.0002, 0.0082, 0.0180, 0.0325, 0.0340, + -0.0153, -0.0389, -0.0240, 0.0082, 0.0140, 0.0046, -0.0138, -0.0378, + -0.0366, 0.0297, 0.0252, 0.0078, 0.0063, 0.0006, 0.0044, 0.0074, + 0.0094, 0.0113, 0.0105, 0.0137, 0.0438, 0.0262, -0.0078, -0.0185, + -0.0215, -0.0407, -0.0435, -0.0208, -0.0004, -0.0144, -0.0205, -0.0248, + -0.0159, -0.0069, -0.0153, 0.0132, 0.0355, 0.0298, 0.0120, 0.0072, + 0.0236, 0.0526, 0.0479, 0.0233, -0.0133, -0.0283, -0.0468, -0.0549, + -0.0370, 0.0032, 0.0056, 0.0023, 0.0050, 0.0024, 0.0279, 0.0116, + -0.0045, -0.0012, 0.0107, 0.0190, 0.0253, 0.0191, 0.0043, 0.0193, + -0.0348, -0.0246, 0.0123, 0.0210, 0.0135, -0.0096, -0.0109, -0.0076, + -0.0156, -0.0290, 0.0160, 0.0194, 0.0219, 0.0259, 0.0250, 0.0195, + 0.4948, 0.4961, 0.4940, 0.4878, 0.4849, 0.4727, 0.4571, 0.4551, + 0.4534, 0.4468, 0.4412, 0.4354, 0.4298, 0.4272, 0.4498, 0.4506, + 0.4560, 0.4592, 0.4758, 0.4941, 0.2476, 0.1771, 0.1974, 0.1881, + 0.1667, 0.1826, 0.2067, 0.2031, 0.1734, 0.1534, 0.1415, 0.1761, + 0.1897, 0.1772, 0.1651, 0.1247, 0.1041, 0.1231, 0.1809, 0.2234, +}; + +#endif /* AVCODEC_METASOUND_TWINVQ_DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -344,7 +344,7 @@ return NULL; } - IMFSample_SetSampleDuration(sample, mf_to_mf_time(avctx, frame->pkt_duration)); + IMFSample_SetSampleDuration(sample, mf_to_mf_time(avctx, frame->duration)); return sample; } @@ -1214,7 +1214,6 @@ return 0; } } - mf_close(avctx); return ret; } @@ -1230,7 +1229,7 @@ const FFCodec ff_ ## NAME ## _mf_encoder = { \ .p.priv_class = &ff_ ## NAME ## _mf_encoder_class, \ .p.name = #NAME "_mf", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#ID " via MediaFoundation"), \ + CODEC_LONG_NAME(#ID " via MediaFoundation"), \ .p.type = AVMEDIA_TYPE_ ## MEDIATYPE, \ .p.id = AV_CODEC_ID_ ## ID, \ .priv_data_size = sizeof(MFContext), \ @@ -1239,8 +1238,7 @@ FF_CODEC_RECEIVE_PACKET_CB(mf_receive_packet), \ FMTS \ CAPS \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | \ - FF_CODEC_CAP_INIT_CLEANUP, \ + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ }; #define AFMTS \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/microdvddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/microdvddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/microdvddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/microdvddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -370,12 +370,11 @@ const FFCodec ff_microdvd_decoder = { .p.name = "microdvd", - .p.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle"), + CODEC_LONG_NAME("MicroDVD subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MICRODVD, .init = microdvd_init, FF_CODEC_DECODE_SUB_CB(microdvd_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/midivid.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/midivid.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/midivid.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/midivid.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,13 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - #include "libavutil/imgutils.h" #include "libavutil/internal.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #define BITSTREAM_READER_LE @@ -33,7 +28,7 @@ #include "get_bits.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct MidiVidContext { GetByteContext gb; @@ -279,7 +274,7 @@ const FFCodec ff_mvdv_decoder = { .p.name = "mvdv", - .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid VQ"), + CODEC_LONG_NAME("MidiVid VQ"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MVDV, .priv_data_size = sizeof(MidiVidContext), @@ -288,5 +283,5 @@ .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mimic.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mimic.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mimic.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mimic.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include #include "libavutil/mem_internal.h" @@ -29,7 +27,7 @@ #include "avcodec.h" #include "blockdsp.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "bytestream.h" #include "bswapdsp.h" @@ -58,7 +56,7 @@ DECLARE_ALIGNED(32, int16_t, dct_block)[64]; GetBitContext gb; - ScanTable scantable; + uint8_t permutated_scantable[64]; BlockDSPContext bdsp; BswapDSPContext bbdsp; HpelDSPContext hdsp; @@ -135,11 +133,11 @@ ctx->prev_index = 0; ctx->cur_index = 15; - ff_blockdsp_init(&ctx->bdsp, avctx); + ff_blockdsp_init(&ctx->bdsp); ff_bswapdsp_init(&ctx->bbdsp); ff_hpeldsp_init(&ctx->hdsp, avctx->flags); ff_idctdsp_init(&ctx->idsp, avctx); - ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable, col_zag); + ff_permute_scantable(ctx->permutated_scantable, col_zag, ctx->idsp.idct_permutation); for (i = 0; i < FF_ARRAY_ELEMS(ctx->frames); i++) { ctx->frames[i].f = av_frame_alloc(); @@ -252,7 +250,7 @@ else /* TODO Use >> 10 instead of / 1001 */ coeff = (coeff * qscale) / 1001; - block[ctx->scantable.permutated[pos]] = coeff; + block[ctx->permutated_scantable[pos]] = coeff; } return 0; @@ -268,8 +266,9 @@ const int qscale = av_clip(10000 - quality, is_chroma ? 1000 : 2000, 10000) << 2; const int stride = ctx->frames[ctx->cur_index ].f->linesize[plane]; - const uint8_t *src = ctx->frames[ctx->prev_index].f->data[plane]; uint8_t *dst = ctx->frames[ctx->cur_index ].f->data[plane]; + /* src is unused for I frames; set to avoid UB pointer arithmetic. */ + const uint8_t *src = is_iframe ? dst : ctx->frames[ctx->prev_index].f->data[plane]; for (y = 0; y < ctx->num_vblocks[plane]; y++) { for (x = 0; x < ctx->num_hblocks[plane]; x++) { @@ -439,7 +438,7 @@ const FFCodec ff_mimic_decoder = { .p.name = "mimic", - .p.long_name = NULL_IF_CONFIG_SMALL("Mimic"), + CODEC_LONG_NAME("Mimic"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MIMIC, .priv_data_size = sizeof(MimicContext), @@ -447,7 +446,7 @@ .close = mimic_decode_end, FF_CODEC_DECODE_CB(mimic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context), + UPDATE_THREAD_CONTEXT(mimic_decode_update_thread_context), .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | - FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aaccoder_mips.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aaccoder_mips.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aaccoder_mips.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aaccoder_mips.c 2023-03-03 13:29:59.000000000 +0000 @@ -1472,7 +1472,7 @@ static float quantize_band_cost_bits(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, - int *bits, float *energy, int rtz) + int *bits, float *energy) { return get_band_numbits(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits); } @@ -2326,7 +2326,7 @@ static float quantize_band_cost(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, - int *bits, float *energy, int rtz) + int *bits, float *energy) { return get_band_cost(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits, energy); } @@ -2424,25 +2424,25 @@ sce0->ics.swb_sizes[g], sce0->sf_idx[w*16+g], sce0->band_type[w*16+g], - lambda / band0->threshold, INFINITY, &b1, NULL, 0); + lambda / band0->threshold, INFINITY, &b1, NULL); dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128], R34, sce1->ics.swb_sizes[g], sce1->sf_idx[w*16+g], sce1->band_type[w*16+g], - lambda / band1->threshold, INFINITY, &b2, NULL, 0); + lambda / band1->threshold, INFINITY, &b2, NULL); dist2 += quantize_band_cost(s, M, M34, sce0->ics.swb_sizes[g], mididx, midcb, - lambda / minthr, INFINITY, &b3, NULL, 0); + lambda / minthr, INFINITY, &b3, NULL); dist2 += quantize_band_cost(s, S, S34, sce1->ics.swb_sizes[g], sididx, sidcb, - mslambda / (minthr * bmax), INFINITY, &b4, NULL, 0); + mslambda / (minthr * bmax), INFINITY, &b4, NULL); B0 += b1+b2; B1 += b3+b4; dist1 -= b1+b2; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacdec_mips.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacdec_mips.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacdec_mips.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacdec_mips.c 2023-03-03 13:29:59.000000000 +0000 @@ -126,9 +126,9 @@ if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) { for (i = 0; i < 1024; i += 128) - ac->mdct_small.imdct_half(&ac->mdct_small, buf + i, in + i); + ac->mdct128_fn(ac->mdct128, buf + i, in + i, sizeof(float)); } else - ac->mdct.imdct_half(&ac->mdct, buf, in); + ac->mdct1024_fn(ac->mdct1024, buf, in, sizeof(float)); /* window overlapping * NOTE: To simplify the overlapping code, all 'meaningless' short to long diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacsbr_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacsbr_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacsbr_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/aacsbr_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -59,7 +59,7 @@ #include "libavutil/mips/asmdefs.h" #if HAVE_INLINE_ASM -static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, FFTContext *mdct, +static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, AVTXContext *mdct, av_tx_fn mdct_fn, SBRDSPContext *sbrdsp, const float *in, float *x, float z[320], float W[2][32][32][2], int buf_idx) { @@ -143,7 +143,7 @@ fdsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320); sbrdsp->sum64x5(z); sbrdsp->qmf_pre_shuffle(z); - mdct->imdct_half(mdct, z, z+64); + mdct_fn(mdct, z, z+64, sizeof(float)); sbrdsp->qmf_post_shuffle(W[buf_idx][i], z); x += 32; } @@ -151,7 +151,7 @@ #if HAVE_MIPSFPU #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6 -static void sbr_qmf_synthesis_mips(FFTContext *mdct, +static void sbr_qmf_synthesis_mips(AVTXContext *mdct, av_tx_fn mdct_fn, SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp, float *out, float X[2][38][64], float mdct_buf[2][64], @@ -180,12 +180,12 @@ X[0][i][ n] = -X[0][i][n]; X[0][i][32+n] = X[1][i][31-n]; } - mdct->imdct_half(mdct, mdct_buf[0], X[0][i]); + mdct_fn(mdct, mdct_buf[0], X[0][i], sizeof(float)); sbrdsp->qmf_deint_neg(v, mdct_buf[0]); } else { sbrdsp->neg_odd_64(X[1][i]); - mdct->imdct_half(mdct, mdct_buf[0], X[0][i]); - mdct->imdct_half(mdct, mdct_buf[1], X[1][i]); + mdct_fn(mdct, mdct_buf[0], X[0][i], sizeof(float)); + mdct_fn(mdct, mdct_buf[1], X[1][i], sizeof(float)); sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/ac3dsp_mips.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/ac3dsp_mips.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/ac3dsp_mips.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/ac3dsp_mips.c 2023-03-03 13:29:59.000000000 +0000 @@ -401,7 +401,8 @@ #endif /* HAVE_MIPSFPU */ #endif /* HAVE_INLINE_ASM */ -void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) { +void ff_ac3dsp_init_mips(AC3DSPContext *c) +{ #if HAVE_INLINE_ASM #if HAVE_MIPSDSP c->bit_alloc_calc_bap = ac3_bit_alloc_calc_bap_mips; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/fmtconvert_mips.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/fmtconvert_mips.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/fmtconvert_mips.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/fmtconvert_mips.c 2023-03-03 13:29:59.000000000 +0000 @@ -49,7 +49,6 @@ */ #include "config.h" #include "libavutil/attributes.h" -#include "libavcodec/avcodec.h" #include "libavcodec/fmtconvert.h" #include "libavutil/mips/asmdefs.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h263dsp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h263dsp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h263dsp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h263dsp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,6 @@ int32_t index, int32_t q_scale); void ff_dct_unquantize_h263_intra_msa(MpegEncContext *s, int16_t *block, int32_t index, int32_t q_scale); -int ff_pix_sum_msa(uint8_t *pix, int line_size); +int ff_pix_sum_msa(const uint8_t *pix, int line_size); #endif // #ifndef AVCODEC_MIPS_H263DSP_MIPS_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,26 +22,26 @@ #define AVCODEC_MIPS_H264CHROMA_MIPS_H #include "libavcodec/h264dec.h" -void ff_put_h264_chroma_mc8_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_put_h264_chroma_mc4_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_put_h264_chroma_mc2_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc2_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_avg_h264_chroma_mc8_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_avg_h264_chroma_mc4_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc4_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_avg_h264_chroma_mc2_msa(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc2_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y); -void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); #endif /* AVCODEC_MIPS_H264CHROMA_MIPS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mmi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mmi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mmi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_mmi.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "constants.h" #include "libavutil/mips/mmiutils.h" -void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { double ftmp[12]; @@ -289,7 +289,7 @@ } } -void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { double ftmp[10]; @@ -497,7 +497,7 @@ } } -void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { double ftmp[8]; @@ -618,7 +618,7 @@ } } -void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, +void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { double ftmp[8]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/h264chroma_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ 0, 1, 1, 2, 16, 17, 17, 18, 16, 17, 17, 18, 18, 19, 19, 20 }; -static void avc_chroma_hz_2x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { uint16_t out0, out1; @@ -60,7 +60,7 @@ SH(out1, dst); } -static void avc_chroma_hz_2x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3; @@ -88,7 +88,7 @@ ST_H4(res, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_2w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -99,7 +99,7 @@ } } -static void avc_chroma_hz_4x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16i8 src0, src1; @@ -124,7 +124,7 @@ ST_W2(res, 0, 1, dst, stride); } -static void avc_chroma_hz_4x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, out; @@ -147,7 +147,7 @@ ST_W4(out, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_4x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4, src5, src6, src7, out0, out1; @@ -171,7 +171,7 @@ ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_4w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -184,7 +184,7 @@ } } -static void avc_chroma_hz_8x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, out0, out1; @@ -207,7 +207,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hz_8x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4, src5, src6, src7; @@ -240,7 +240,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hz_nonmult_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_nonmult_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -289,7 +289,7 @@ } } -static void avc_chroma_hz_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hz_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -302,7 +302,7 @@ } } -static void avc_chroma_vt_2x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { uint16_t out0, out1; @@ -334,7 +334,7 @@ SH(out1, dst); } -static void avc_chroma_vt_2x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4; @@ -362,7 +362,7 @@ ST_H4(res, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_2w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -373,7 +373,7 @@ } } -static void avc_chroma_vt_4x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2; @@ -397,7 +397,7 @@ ST_W2(res, 0, 1, dst, stride); } -static void avc_chroma_vt_4x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4; @@ -421,7 +421,7 @@ ST_W4(out, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_4x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; @@ -449,7 +449,7 @@ ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_4w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -462,7 +462,7 @@ } } -static void avc_chroma_vt_8x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4, out0, out1; @@ -483,7 +483,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_vt_8x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; @@ -515,7 +515,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_vt_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_vt_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -526,7 +526,7 @@ } } -static void avc_chroma_hv_2x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -561,7 +561,7 @@ SH(out1, dst); } -static void avc_chroma_hv_2x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -595,7 +595,7 @@ ST_H4(res, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hv_2w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1, int32_t height) @@ -609,7 +609,7 @@ } } -static void avc_chroma_hv_4x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -637,7 +637,7 @@ ST_W2(res, 0, 1, dst, stride); } -static void avc_chroma_hv_4x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -670,7 +670,7 @@ ST_W2(res1, 0, 1, dst + 2 * stride, stride); } -static void avc_chroma_hv_4x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -710,7 +710,7 @@ ST_W8(res0, res1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hv_4w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1, int32_t height) @@ -727,7 +727,7 @@ } } -static void avc_chroma_hv_8x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -770,7 +770,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hv_8x8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1) { @@ -826,7 +826,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hv_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avc_chroma_hv_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, uint32_t coef_ver0, uint32_t coef_ver1, int32_t height) @@ -840,7 +840,7 @@ } } -static void avc_chroma_hz_and_aver_dst_2x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -882,7 +882,7 @@ SH(out1, dst); } -static void avc_chroma_hz_and_aver_dst_2x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -922,7 +922,7 @@ ST_H4(dst0, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_and_aver_dst_2w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -933,7 +933,7 @@ } } -static void avc_chroma_hz_and_aver_dst_4x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -966,7 +966,7 @@ ST_W2(dst_data, 0, 1, dst, stride); } -static void avc_chroma_hz_and_aver_dst_4x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -995,7 +995,7 @@ ST_W4(out, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_and_aver_dst_4x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1027,7 +1027,7 @@ ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hz_and_aver_dst_4w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1040,7 +1040,7 @@ } } -static void avc_chroma_hz_and_aver_dst_8x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1070,7 +1070,7 @@ ST_D4(dst0, dst1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hz_and_aver_dst_8x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1114,7 +1114,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hz_and_aver_dst_8w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hz_and_aver_dst_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1125,7 +1125,7 @@ } } -static void avc_chroma_vt_and_aver_dst_2x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1162,7 +1162,7 @@ SH(out1, dst); } -static void avc_chroma_vt_and_aver_dst_2x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1204,7 +1204,7 @@ ST_H4(res, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_and_aver_dst_2w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1215,7 +1215,7 @@ } } -static void avc_chroma_vt_and_aver_dst_4x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1247,7 +1247,7 @@ ST_W2(res, 0, 1, dst, stride); } -static void avc_chroma_vt_and_aver_dst_4x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1277,7 +1277,7 @@ ST_W4(out, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_and_aver_dst_4x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1313,7 +1313,7 @@ ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_vt_and_aver_dst_4w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1326,7 +1326,7 @@ } } -static void avc_chroma_vt_and_aver_dst_8x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1355,7 +1355,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_vt_and_aver_dst_8x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { @@ -1398,7 +1398,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_vt_and_aver_dst_8w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_vt_and_aver_dst_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { @@ -1409,7 +1409,7 @@ } } -static void avc_chroma_hv_and_aver_dst_2x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_2x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1451,7 +1451,7 @@ SH(out1, dst); } -static void avc_chroma_hv_and_aver_dst_2x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_2x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1496,7 +1496,7 @@ ST_H4(dst0, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hv_and_aver_dst_2w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_2w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1513,7 +1513,7 @@ } } -static void avc_chroma_hv_and_aver_dst_4x2_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_4x2_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1549,7 +1549,7 @@ ST_W2(dst0, 0, 1, dst, stride); } -static void avc_chroma_hv_and_aver_dst_4x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_4x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1588,7 +1588,7 @@ ST_W4(out, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hv_and_aver_dst_4x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_4x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1637,7 +1637,7 @@ ST_W8(res0, res1, 0, 1, 2, 3, 0, 1, 2, 3, dst, stride); } -static void avc_chroma_hv_and_aver_dst_4w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_4w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1657,7 +1657,7 @@ } } -static void avc_chroma_hv_and_aver_dst_8x4_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_8x4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1705,7 +1705,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hv_and_aver_dst_8x8_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_8x8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1774,7 +1774,7 @@ ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, stride); } -static void avc_chroma_hv_and_aver_dst_8w_msa(uint8_t *src, uint8_t *dst, +static void avc_chroma_hv_and_aver_dst_8w_msa(const uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coef_hor0, uint32_t coef_hor1, @@ -1791,7 +1791,7 @@ } } -static void copy_width4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void copy_width4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, int32_t height) { uint32_t tp0, tp1, tp2, tp3, tp4, tp5, tp6, tp7; @@ -1814,7 +1814,7 @@ } } -static void copy_width8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void copy_width8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, int32_t height) { uint64_t src0, src1, src2, src3, src4, src5, src6, src7; @@ -1832,7 +1832,7 @@ } } -static void avg_width4_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avg_width4_msa(const uint8_t *src, uint8_t *dst, int32_t stride, int32_t height) { uint32_t tp0, tp1, tp2, tp3; @@ -1867,7 +1867,7 @@ } } -static void avg_width8_msa(uint8_t *src, uint8_t *dst, int32_t stride, +static void avg_width8_msa(const uint8_t *src, uint8_t *dst, int32_t stride, int32_t height) { uint64_t tp0, tp1, tp2, tp3, tp4, tp5, tp6, tp7; @@ -1903,7 +1903,7 @@ } } -void ff_put_h264_chroma_mc8_msa(uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -1919,7 +1919,7 @@ } } -void ff_put_h264_chroma_mc4_msa(uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc4_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -1935,7 +1935,7 @@ } } -void ff_put_h264_chroma_mc2_msa(uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc2_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { int32_t cnt; @@ -1958,7 +1958,7 @@ } } -void ff_avg_h264_chroma_mc8_msa(uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -1976,7 +1976,7 @@ } } -void ff_avg_h264_chroma_mc4_msa(uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc4_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { av_assert2(x < 8 && y < 8 && x >= 0 && y >= 0); @@ -1993,7 +1993,7 @@ } } -void ff_avg_h264_chroma_mc2_msa(uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc2_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int height, int x, int y) { int32_t cnt; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #define MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -104,7 +104,7 @@ #define UNI_MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -184,7 +184,7 @@ void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t \ dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t \ src_stride, \ int height, \ @@ -267,9 +267,9 @@ #define BI_MC(PEL, DIR, WIDTH) \ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -348,10 +348,10 @@ void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t \ dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t \ src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ int denom, \ int weight0, \ @@ -433,32 +433,32 @@ void ff_hevc_loop_filter_luma_h_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int32_t beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void ff_hevc_loop_filter_luma_v_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q); + int32_t beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q); void ff_hevc_loop_filter_chroma_h_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q); void ff_hevc_loop_filter_chroma_v_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q); + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q); -void ff_hevc_sao_band_filter_0_8_msa(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_band_filter_0_8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height); -void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int eo, int width, int height); void ff_hevc_idct_4x4_msa(int16_t *coeffs, int col_limit); @@ -469,20 +469,20 @@ void ff_hevc_idct_dc_8x8_msa(int16_t *coeffs); void ff_hevc_idct_dc_16x16_msa(int16_t *coeffs); void ff_hevc_idct_dc_32x32_msa(int16_t *coeffs); -void ff_hevc_addblk_4x4_msa(uint8_t *dst, int16_t *pi16Coeffs, +void ff_hevc_addblk_4x4_msa(uint8_t *dst, const int16_t *pi16Coeffs, ptrdiff_t stride); -void ff_hevc_addblk_8x8_msa(uint8_t *dst, int16_t *pi16Coeffs, +void ff_hevc_addblk_8x8_msa(uint8_t *dst, const int16_t *pi16Coeffs, ptrdiff_t stride); -void ff_hevc_addblk_16x16_msa(uint8_t *dst, int16_t *pi16Coeffs, +void ff_hevc_addblk_16x16_msa(uint8_t *dst, const int16_t *pi16Coeffs, ptrdiff_t stride); -void ff_hevc_addblk_32x32_msa(uint8_t *dst, int16_t *pi16Coeffs, +void ff_hevc_addblk_32x32_msa(uint8_t *dst, const int16_t *pi16Coeffs, ptrdiff_t stride); void ff_hevc_idct_luma_4x4_msa(int16_t *pi16Coeffs); /* Loongson optimization */ #define L_MC(PEL, DIR, WIDTH, TYPE) \ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_##TYPE(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -509,9 +509,9 @@ #define L_BI_MC(PEL, DIR, WIDTH, TYPE) \ void ff_hevc_put_hevc_##PEL##_bi_##DIR##WIDTH##_8_##TYPE(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src2, \ + const int16_t *src2, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -553,7 +553,7 @@ #define L_UNI_MC(PEL, DIR, WIDTH, TYPE) \ void ff_hevc_put_hevc_##PEL##_uni_##DIR##WIDTH##_8_##TYPE(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mmi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mmi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mmi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_mmi.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,13 @@ #include "libavutil/mips/mmiutils.h" #define PUT_HEVC_QPEL_H(w, x_step, src_step, dst_step) \ -void ff_hevc_put_hevc_qpel_h##w##_8_mmi(int16_t *dst, uint8_t *_src, \ +void ff_hevc_put_hevc_qpel_h##w##_8_mmi(int16_t *dst, const uint8_t *_src, \ ptrdiff_t _srcstride, \ int height, intptr_t mx, \ intptr_t my, int width) \ { \ int x, y; \ - pixel *src = (pixel*)_src - 3; \ + const pixel *src = (const pixel*)_src - 3; \ ptrdiff_t srcstride = _srcstride / sizeof(pixel); \ double ftmp[15]; \ uint64_t rtmp[1]; \ @@ -80,7 +80,7 @@ "paddh %[ftmp3], %[ftmp3], %[ftmp4] \n\t" \ "paddh %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "paddh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp3], %[dst], 0x00) \ + MMI_USDC1(%[ftmp3], %[dst], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -118,14 +118,14 @@ PUT_HEVC_QPEL_H(64, 16, -64, -128); #define PUT_HEVC_QPEL_HV(w, x_step, src_step, dst_step) \ -void ff_hevc_put_hevc_qpel_hv##w##_8_mmi(int16_t *dst, uint8_t *_src, \ +void ff_hevc_put_hevc_qpel_hv##w##_8_mmi(int16_t *dst, const uint8_t *_src,\ ptrdiff_t _srcstride, \ int height, intptr_t mx, \ intptr_t my, int width) \ { \ int x, y; \ const int8_t *filter; \ - pixel *src = (pixel*)_src; \ + const pixel *src = (const pixel*)_src; \ ptrdiff_t srcstride = _srcstride / sizeof(pixel); \ int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE]; \ int16_t *tmp = tmp_array; \ @@ -178,7 +178,7 @@ "paddh %[ftmp3], %[ftmp3], %[ftmp4] \n\t" \ "paddh %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "paddh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp3], %[tmp], 0x00) \ + MMI_USDC1(%[ftmp3], %[tmp], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -303,14 +303,14 @@ #define PUT_HEVC_QPEL_BI_H(w, x_step, src_step, src2_step, dst_step) \ void ff_hevc_put_hevc_qpel_bi_h##w##_8_mmi(uint8_t *_dst, \ ptrdiff_t _dststride, \ - uint8_t *_src, \ + const uint8_t *_src, \ ptrdiff_t _srcstride, \ - int16_t *src2, int height, \ + const int16_t *src2, int height, \ intptr_t mx, intptr_t my, \ int width) \ { \ int x, y; \ - pixel *src = (pixel*)_src - 3; \ + const pixel *src = (const pixel*)_src - 3; \ ptrdiff_t srcstride = _srcstride / sizeof(pixel); \ pixel *dst = (pixel *)_dst; \ ptrdiff_t dststride = _dststride / sizeof(pixel); \ @@ -434,9 +434,9 @@ #define PUT_HEVC_QPEL_BI_HV(w, x_step, src_step, src2_step, dst_step) \ void ff_hevc_put_hevc_qpel_bi_hv##w##_8_mmi(uint8_t *_dst, \ ptrdiff_t _dststride, \ - uint8_t *_src, \ + const uint8_t *_src, \ ptrdiff_t _srcstride, \ - int16_t *src2, int height, \ + const int16_t *src2, int height, \ intptr_t mx, intptr_t my, \ int width) \ { \ @@ -654,9 +654,9 @@ #define PUT_HEVC_EPEL_BI_HV(w, x_step, src_step, src2_step, dst_step) \ void ff_hevc_put_hevc_epel_bi_hv##w##_8_mmi(uint8_t *_dst, \ ptrdiff_t _dststride, \ - uint8_t *_src, \ + const uint8_t *_src, \ ptrdiff_t _srcstride, \ - int16_t *src2, int height, \ + const int16_t *src2, int height, \ intptr_t mx, intptr_t my, \ int width) \ { \ @@ -690,10 +690,10 @@ \ "1: \n\t" \ "2: \n\t" \ - MMI_ULDC1(%[ftmp3], %[src], 0x00) \ - MMI_ULDC1(%[ftmp4], %[src], 0x01) \ - MMI_ULDC1(%[ftmp5], %[src], 0x02) \ - MMI_ULDC1(%[ftmp6], %[src], 0x03) \ + MMI_ULWC1(%[ftmp2], %[src], 0x00) \ + MMI_ULWC1(%[ftmp3], %[src], 0x01) \ + MMI_ULWC1(%[ftmp4], %[src], 0x02) \ + MMI_ULWC1(%[ftmp5], %[src], 0x03) \ "punpcklbh %[ftmp2], %[ftmp2], %[ftmp0] \n\t" \ "pmullh %[ftmp2], %[ftmp2], %[ftmp1] \n\t" \ "punpcklbh %[ftmp3], %[ftmp3], %[ftmp0] \n\t" \ @@ -707,7 +707,7 @@ "paddh %[ftmp2], %[ftmp2], %[ftmp3] \n\t" \ "paddh %[ftmp4], %[ftmp4], %[ftmp5] \n\t" \ "paddh %[ftmp2], %[ftmp2], %[ftmp4] \n\t" \ - MMI_ULDC1(%[ftmp2], %[tmp], 0x00) \ + MMI_USDC1(%[ftmp2], %[tmp], 0x00) \ \ "daddi %[x], %[x], -0x01 \n\t" \ PTR_ADDIU "%[src], %[src], 0x04 \n\t" \ @@ -773,7 +773,7 @@ "paddw %[ftmp5], %[ftmp5], %[ftmp6] \n\t" \ "psraw %[ftmp5], %[ftmp5], %[ftmp0] \n\t" \ "packsswh %[ftmp3], %[ftmp3], %[ftmp5] \n\t" \ - MMI_ULDC1(%[ftmp4], %[tmp], 0x02) \ + MMI_ULDC1(%[ftmp4], %[src2], 0x00) \ "li %[rtmp0], 0x10 \n\t" \ "dmtc1 %[rtmp0], %[ftmp8] \n\t" \ "punpcklhw %[ftmp5], %[ftmp2], %[ftmp3] \n\t" \ @@ -835,9 +835,9 @@ #define PUT_HEVC_PEL_BI_PIXELS(w, x_step, src_step, dst_step, src2_step) \ void ff_hevc_put_hevc_pel_bi_pixels##w##_8_mmi(uint8_t *_dst, \ ptrdiff_t _dststride, \ - uint8_t *_src, \ + const uint8_t *_src, \ ptrdiff_t _srcstride, \ - int16_t *src2, int height, \ + const int16_t *src2, int height, \ intptr_t mx, intptr_t my, \ int width) \ { \ @@ -945,7 +945,7 @@ #define PUT_HEVC_QPEL_UNI_HV(w, x_step, src_step, dst_step, tmp_step) \ void ff_hevc_put_hevc_qpel_uni_hv##w##_8_mmi(uint8_t *_dst, \ ptrdiff_t _dststride, \ - uint8_t *_src, \ + const uint8_t *_src, \ ptrdiff_t _srcstride, \ int height, \ intptr_t mx, intptr_t my, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcdsp_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ 0, 1, 1, 2, 2, 3, 3, 4, 16, 17, 17, 18, 18, 19, 19, 20 }; -static void hevc_copy_4w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -77,16 +77,17 @@ } } -static void hevc_copy_6w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_6w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { - uint32_t loop_cnt; + uint32_t loop_cnt = (height >> 3); + uint32_t res = height & 0x07; v16i8 zero = { 0 }; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v8i16 in0, in1, in2, in3, in4, in5, in6, in7; - for (loop_cnt = (height >> 3); loop_cnt--;) { + for (; loop_cnt--; ) { LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); src += (8 * src_stride); @@ -99,9 +100,22 @@ ST12x8_UB(in0, in1, in2, in3, in4, in5, in6, in7, dst, 2 * dst_stride); dst += (8 * dst_stride); } + for (; res--; ) { + uint64_t out0; + uint32_t out1; + src0 = LD_SB(src); + src += src_stride; + in0 = (v8i16)__msa_ilvr_b((v16i8) zero, (v16i8) src0); + in0 = in0 << 6; + out0 = __msa_copy_u_d((v2i64) in0, 0); + out1 = __msa_copy_u_w((v4i32) in0, 2); + SD(out0, dst); + SW(out1, dst + 4); + dst += dst_stride; + } } -static void hevc_copy_8w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -162,11 +176,12 @@ } } -static void hevc_copy_12w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { uint32_t loop_cnt; + uint32_t res = height & 0x07; v16i8 zero = { 0 }; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v8i16 in0, in1, in0_r, in1_r, in2_r, in3_r; @@ -197,9 +212,22 @@ ST_D4(in0, in1, 0, 1, 0, 1, dst + 8, dst_stride); dst += (4 * dst_stride); } + for (; res--; ) { + uint64_t out0; + src0 = LD_SB(src); + src += src_stride; + in0_r = (v8i16)__msa_ilvr_b((v16i8) zero, (v16i8) src0); + in0 = (v8i16)__msa_ilvl_b((v16i8) zero, (v16i8) src0); + in0_r = in0_r << 6; + in0 = in0 << 6; + ST_UH(in0_r, dst); + out0 = __msa_copy_u_d((v2i64) in0, 0); + SD(out0, dst + 8); + dst += dst_stride; + } } -static void hevc_copy_16w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -290,7 +318,7 @@ } } -static void hevc_copy_24w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -319,7 +347,7 @@ } } -static void hevc_copy_32w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -357,7 +385,7 @@ } } -static void hevc_copy_48w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_48w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -408,7 +436,7 @@ } } -static void hevc_copy_64w_msa(uint8_t *src, int32_t src_stride, +static void hevc_copy_64w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, int32_t height) { @@ -445,11 +473,12 @@ } } -static void hevc_hz_8t_4w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { uint32_t loop_cnt; + uint32_t res = (height & 0x07) >> 1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v8i16 filt0, filt1, filt2, filt3; v16i8 mask1, mask2, mask3; @@ -498,9 +527,21 @@ ST_D8(dst0, dst1, dst2, dst3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride); dst += (8 * dst_stride); } + for (; res--; ) { + LD_SB2(src, src_stride, src0, src1); + src += 2 * src_stride; + XORI_B2_128_SB(src0, src1); + VSHF_B4_SB(src0, src1, mask0, mask1, mask2, mask3, + vec0, vec1, vec2, vec3); + dst0 = const_vec; + DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, filt3, + dst0, dst0, dst0, dst0); + ST_D2(dst0, 0, 1, dst, dst_stride); + dst += 2 * dst_stride; + } } -static void hevc_hz_8t_8w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -555,7 +596,7 @@ } } -static void hevc_hz_8t_12w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -630,7 +671,7 @@ } } -static void hevc_hz_8t_16w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -687,7 +728,7 @@ } } -static void hevc_hz_8t_24w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -762,7 +803,7 @@ } } -static void hevc_hz_8t_32w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -822,7 +863,7 @@ } } -static void hevc_hz_8t_48w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_48w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -893,7 +934,7 @@ } } -static void hevc_hz_8t_64w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hz_8t_64w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -987,11 +1028,12 @@ } } -static void hevc_vt_8t_4w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { int32_t loop_cnt; + int32_t res = (height & 0x07) >> 1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; v16i8 src9, src10, src11, src12, src13, src14; v16i8 src10_r, src32_r, src54_r, src76_r, src98_r; @@ -1055,9 +1097,25 @@ src6554 = src14131312; src6 = src14; } + for (; res--; ) { + LD_SB2(src, src_stride, src7, src8); + src += 2 * src_stride; + ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); + src8776 = (v16i8)__msa_ilvr_d((v2i64) src87_r, src76_r); + src8776 = (v16i8)__msa_xori_b((v16i8) src8776, 128); + dst10 = const_vec; + DPADD_SB4_SH(src2110, src4332, src6554, src8776, + filt0, filt1, filt2, filt3, dst10, dst10, dst10, dst10); + ST_D2(dst10, 0, 1, dst, dst_stride); + dst += 2 * dst_stride; + src2110 = src4332; + src4332 = src6554; + src6554 = src8776; + src6 = src8; + } } -static void hevc_vt_8t_8w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1120,7 +1178,7 @@ } } -static void hevc_vt_8t_12w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1207,7 +1265,7 @@ } } -static void hevc_vt_8t_16multx4mult_msa(uint8_t *src, +static void hevc_vt_8t_16multx4mult_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1215,7 +1273,7 @@ int32_t height, int32_t width) { - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; int32_t loop_cnt, cnt; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; @@ -1315,7 +1373,7 @@ } } -static void hevc_vt_8t_16w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1323,7 +1381,7 @@ filter, height, 16); } -static void hevc_vt_8t_24w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1333,7 +1391,7 @@ filter, height); } -static void hevc_vt_8t_32w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1341,7 +1399,7 @@ filter, height, 32); } -static void hevc_vt_8t_48w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_48w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1349,7 +1407,7 @@ filter, height, 48); } -static void hevc_vt_8t_64w_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_8t_64w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1357,7 +1415,7 @@ filter, height, 64); } -static void hevc_hv_8t_4w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1464,7 +1522,7 @@ } } -static void hevc_hv_8t_8multx1mult_msa(uint8_t *src, +static void hevc_hv_8t_8multx1mult_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1473,7 +1531,7 @@ int32_t height, int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v8i16 filt0, filt1, filt2, filt3; @@ -1591,7 +1649,7 @@ } } -static void hevc_hv_8t_8w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1600,13 +1658,13 @@ filter_x, filter_y, height, 8); } -static void hevc_hv_8t_12w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; @@ -1795,7 +1853,7 @@ } } -static void hevc_hv_8t_16w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1804,7 +1862,7 @@ filter_x, filter_y, height, 16); } -static void hevc_hv_8t_24w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1813,7 +1871,7 @@ filter_x, filter_y, height, 24); } -static void hevc_hv_8t_32w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1822,7 +1880,7 @@ filter_x, filter_y, height, 32); } -static void hevc_hv_8t_48w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_48w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1831,7 +1889,7 @@ filter_x, filter_y, height, 48); } -static void hevc_hv_8t_64w_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_8t_64w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t height) @@ -1840,7 +1898,7 @@ filter_x, filter_y, height, 64); } -static void hevc_hz_4t_4x2_msa(uint8_t *src, +static void hevc_hz_4t_4x2_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1873,7 +1931,7 @@ ST_D2(dst0, 0, 1, dst, dst_stride); } -static void hevc_hz_4t_4x4_msa(uint8_t *src, +static void hevc_hz_4t_4x4_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1910,7 +1968,7 @@ ST_D4(dst0, dst1, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_hz_4t_4x8multiple_msa(uint8_t *src, +static void hevc_hz_4t_4x8multiple_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1959,7 +2017,7 @@ } } -static void hevc_hz_4t_4w_msa(uint8_t *src, +static void hevc_hz_4t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -1976,7 +2034,7 @@ } } -static void hevc_hz_4t_6w_msa(uint8_t *src, +static void hevc_hz_4t_6w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2047,7 +2105,7 @@ } } -static void hevc_hz_4t_8x2multiple_msa(uint8_t *src, +static void hevc_hz_4t_8x2multiple_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2091,7 +2149,7 @@ } } -static void hevc_hz_4t_8x4multiple_msa(uint8_t *src, +static void hevc_hz_4t_8x4multiple_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2144,7 +2202,7 @@ } } -static void hevc_hz_4t_8w_msa(uint8_t *src, +static void hevc_hz_4t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2160,7 +2218,7 @@ } } -static void hevc_hz_4t_12w_msa(uint8_t *src, +static void hevc_hz_4t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2221,7 +2279,7 @@ } } -static void hevc_hz_4t_16w_msa(uint8_t *src, +static void hevc_hz_4t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2293,7 +2351,7 @@ } } -static void hevc_hz_4t_24w_msa(uint8_t *src, +static void hevc_hz_4t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2394,7 +2452,7 @@ } } -static void hevc_hz_4t_32w_msa(uint8_t *src, +static void hevc_hz_4t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2446,7 +2504,7 @@ } } -static void hevc_vt_4t_4x2_msa(uint8_t *src, +static void hevc_vt_4t_4x2_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2479,7 +2537,7 @@ ST_D2(dst10, 0, 1, dst, dst_stride); } -static void hevc_vt_4t_4x4_msa(uint8_t *src, +static void hevc_vt_4t_4x4_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2516,7 +2574,7 @@ ST_D4(dst10, dst32, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_vt_4t_4x8_msa(uint8_t *src, +static void hevc_vt_4t_4x8_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2565,7 +2623,7 @@ ST_D8(dst10, dst32, dst54, dst76, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_vt_4t_4x16_msa(uint8_t *src, int32_t src_stride, +static void hevc_vt_4t_4x16_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2635,7 +2693,7 @@ ST_D8(dst10, dst32, dst54, dst76, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_vt_4t_4w_msa(uint8_t *src, +static void hevc_vt_4t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2653,7 +2711,7 @@ } } -static void hevc_vt_4t_6w_msa(uint8_t *src, +static void hevc_vt_4t_6w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2661,6 +2719,7 @@ int32_t height) { int32_t loop_cnt; + int32_t res = height & 0x03; uint32_t dst_val_int0, dst_val_int1, dst_val_int2, dst_val_int3; uint64_t dst_val0, dst_val1, dst_val2, dst_val3; v16i8 src0, src1, src2, src3, src4; @@ -2725,9 +2784,32 @@ SW(dst_val_int3, dst + 4); dst += dst_stride; } + if (res) { + LD_SB2(src, src_stride, src3, src4); + XORI_B2_128_SB(src3, src4); + ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); + + dst0_r = const_vec; + DPADD_SB2_SH(src10_r, src32_r, filt0, filt1, dst0_r, dst0_r); + dst1_r = const_vec; + DPADD_SB2_SH(src21_r, src43_r, filt0, filt1, dst1_r, dst1_r); + + dst_val0 = __msa_copy_u_d((v2i64) dst0_r, 0); + dst_val1 = __msa_copy_u_d((v2i64) dst1_r, 0); + + dst_val_int0 = __msa_copy_u_w((v4i32) dst0_r, 2); + dst_val_int1 = __msa_copy_u_w((v4i32) dst1_r, 2); + + SD(dst_val0, dst); + SW(dst_val_int0, dst + 4); + dst += dst_stride; + SD(dst_val1, dst); + SW(dst_val_int1, dst + 4); + dst += dst_stride; + } } -static void hevc_vt_4t_8x2_msa(uint8_t *src, +static void hevc_vt_4t_8x2_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2762,7 +2844,7 @@ ST_SH2(dst0_r, dst1_r, dst, dst_stride); } -static void hevc_vt_4t_8x6_msa(uint8_t *src, +static void hevc_vt_4t_8x6_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2824,7 +2906,7 @@ ST_SH2(dst0_r, dst1_r, dst, dst_stride); } -static void hevc_vt_4t_8x4multiple_msa(uint8_t *src, +static void hevc_vt_4t_8x4multiple_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2873,7 +2955,7 @@ } } -static void hevc_vt_4t_8w_msa(uint8_t *src, +static void hevc_vt_4t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2890,7 +2972,7 @@ } } -static void hevc_vt_4t_12w_msa(uint8_t *src, +static void hevc_vt_4t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -2961,7 +3043,7 @@ } } -static void hevc_vt_4t_16w_msa(uint8_t *src, +static void hevc_vt_4t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3028,7 +3110,7 @@ } } -static void hevc_vt_4t_24w_msa(uint8_t *src, +static void hevc_vt_4t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3126,7 +3208,7 @@ } } -static void hevc_vt_4t_32w_msa(uint8_t *src, +static void hevc_vt_4t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3232,7 +3314,7 @@ } } -static void hevc_hv_4t_4x2_msa(uint8_t *src, +static void hevc_hv_4t_4x2_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3286,7 +3368,7 @@ ST_D2(dst0, 0, 1, dst, dst_stride); } -static void hevc_hv_4t_4x4_msa(uint8_t *src, +static void hevc_hv_4t_4x4_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3349,7 +3431,7 @@ } -static void hevc_hv_4t_4multx8mult_msa(uint8_t *src, +static void hevc_hv_4t_4multx8mult_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3445,7 +3527,7 @@ } } -static void hevc_hv_4t_4w_msa(uint8_t *src, +static void hevc_hv_4t_4w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3465,7 +3547,7 @@ } } -static void hevc_hv_4t_6w_msa(uint8_t *src, +static void hevc_hv_4t_6w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3590,7 +3672,7 @@ ST_W4(tmp5, 0, 1, 2, 3, dst + 4, dst_stride); } -static void hevc_hv_4t_8x2_msa(uint8_t *src, +static void hevc_hv_4t_8x2_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3657,7 +3739,7 @@ ST_SW2(dst0_r, dst1_r, dst, dst_stride); } -static void hevc_hv_4t_8multx4_msa(uint8_t *src, int32_t src_stride, +static void hevc_hv_4t_8multx4_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, const int8_t *filter_x, const int8_t *filter_y, int32_t width8mult) @@ -3741,7 +3823,7 @@ } } -static void hevc_hv_4t_8x6_msa(uint8_t *src, +static void hevc_hv_4t_8x6_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3852,7 +3934,7 @@ ST_SW2(dst4_r, dst5_r, dst, dst_stride); } -static void hevc_hv_4t_8multx4mult_msa(uint8_t *src, +static void hevc_hv_4t_8multx4mult_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3862,7 +3944,7 @@ int32_t width8mult) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; v16i8 src0, src1, src2, src3, src4, src5, src6; v8i16 filt0, filt1; @@ -3969,7 +4051,7 @@ } } -static void hevc_hv_4t_8w_msa(uint8_t *src, +static void hevc_hv_4t_8w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -3993,7 +4075,7 @@ } } -static void hevc_hv_4t_12w_msa(uint8_t *src, +static void hevc_hv_4t_12w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -4002,7 +4084,7 @@ int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; int16_t *dst_tmp; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; @@ -4166,7 +4248,7 @@ } } -static void hevc_hv_4t_16w_msa(uint8_t *src, +static void hevc_hv_4t_16w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -4183,7 +4265,7 @@ } } -static void hevc_hv_4t_24w_msa(uint8_t *src, +static void hevc_hv_4t_24w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -4195,7 +4277,7 @@ filter_x, filter_y, height, 3); } -static void hevc_hv_4t_32w_msa(uint8_t *src, +static void hevc_hv_4t_32w_msa(const uint8_t *src, int32_t src_stride, int16_t *dst, int32_t dst_stride, @@ -4209,7 +4291,7 @@ #define MC_COPY(WIDTH) \ void ff_hevc_put_hevc_pel_pixels##WIDTH##_8_msa(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -4233,7 +4315,7 @@ #define MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_msa(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -4284,7 +4366,7 @@ #define MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_##PEL##_hv##WIDTH##_8_msa(int16_t *dst, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_idct_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_idct_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_idct_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_idct_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -713,7 +713,7 @@ } } -static void hevc_addblk_4x4_msa(int16_t *coeffs, uint8_t *dst, int32_t stride) +static void hevc_addblk_4x4_msa(const int16_t *coeffs, uint8_t *dst, int32_t stride) { uint32_t dst0, dst1, dst2, dst3; v8i16 dst_r0, dst_l0, in0, in1; @@ -730,7 +730,7 @@ ST_W4(dst_vec, 0, 1, 2, 3, dst, stride); } -static void hevc_addblk_8x8_msa(int16_t *coeffs, uint8_t *dst, int32_t stride) +static void hevc_addblk_8x8_msa(const int16_t *coeffs, uint8_t *dst, int32_t stride) { uint8_t *temp_dst = dst; uint64_t dst0, dst1, dst2, dst3; @@ -766,7 +766,7 @@ ST_D4(dst_r0, dst_r1, 0, 1, 0, 1, dst + 4 * stride, stride); } -static void hevc_addblk_16x16_msa(int16_t *coeffs, uint8_t *dst, int32_t stride) +static void hevc_addblk_16x16_msa(const int16_t *coeffs, uint8_t *dst, int32_t stride) { uint8_t loop_cnt; uint8_t *temp_dst = dst; @@ -833,7 +833,7 @@ ST_UB4(dst0, dst1, dst2, dst3, dst, stride); } -static void hevc_addblk_32x32_msa(int16_t *coeffs, uint8_t *dst, int32_t stride) +static void hevc_addblk_32x32_msa(const int16_t *coeffs, uint8_t *dst, int32_t stride) { uint8_t loop_cnt; uint8_t *temp_dst = dst; @@ -980,22 +980,22 @@ hevc_idct_32x32_msa(coeffs); } -void ff_hevc_addblk_4x4_msa(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) +void ff_hevc_addblk_4x4_msa(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride) { hevc_addblk_4x4_msa(coeffs, dst, stride); } -void ff_hevc_addblk_8x8_msa(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) +void ff_hevc_addblk_8x8_msa(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride) { hevc_addblk_8x8_msa(coeffs, dst, stride); } -void ff_hevc_addblk_16x16_msa(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) +void ff_hevc_addblk_16x16_msa(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride) { hevc_addblk_16x16_msa(coeffs, dst, stride); } -void ff_hevc_addblk_32x32_msa(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) +void ff_hevc_addblk_32x32_msa(uint8_t *dst, const int16_t *coeffs, ptrdiff_t stride) { hevc_addblk_32x32_msa(coeffs, dst, stride); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_lpf_sao_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_lpf_sao_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_lpf_sao_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_lpf_sao_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,8 @@ #include "libavcodec/mips/hevcdsp_mips.h" static void hevc_loopfilter_luma_hor_msa(uint8_t *src, int32_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm) + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm) { uint8_t *p3 = src - (stride << 2); uint8_t *p2 = src - ((stride << 1) + stride); @@ -448,8 +448,8 @@ } static void hevc_loopfilter_luma_ver_msa(uint8_t *src, int32_t stride, - int32_t beta, int32_t *tc, - uint8_t *p_is_pcm, uint8_t *q_is_pcm) + int32_t beta, const int32_t *tc, + const uint8_t *p_is_pcm, const uint8_t *q_is_pcm) { uint8_t *p3 = src; uint8_t *p2 = src + 3 * stride; @@ -914,8 +914,8 @@ } static void hevc_loopfilter_chroma_hor_msa(uint8_t *src, int32_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm) + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm) { uint8_t *p1_ptr = src - (stride << 1); uint8_t *p0_ptr = src - stride; @@ -977,8 +977,8 @@ } static void hevc_loopfilter_chroma_ver_msa(uint8_t *src, int32_t stride, - int32_t *tc, uint8_t *p_is_pcm, - uint8_t *q_is_pcm) + const int32_t *tc, const uint8_t *p_is_pcm, + const uint8_t *q_is_pcm) { v2i64 cmp0, cmp1, p_is_pcm_vec, q_is_pcm_vec; v16u8 src0, src1, src2, src3, src4, src5, src6, src7; @@ -1038,9 +1038,9 @@ } static void hevc_sao_band_filter_4width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, int32_t src_stride, + const uint8_t *src, int32_t src_stride, int32_t sao_left_class, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { v16u8 src0, src1, src2, src3; @@ -1100,9 +1100,9 @@ } static void hevc_sao_band_filter_8width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, int32_t src_stride, + const uint8_t *src, int32_t src_stride, int32_t sao_left_class, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { v16u8 src0, src1, src2, src3; @@ -1172,10 +1172,10 @@ static void hevc_sao_band_filter_16multiple_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, int32_t sao_left_class, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t width, int32_t height) { int32_t w_cnt; @@ -1254,9 +1254,9 @@ static void hevc_sao_edge_filter_0degree_4width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { uint32_t dst_val0, dst_val1; @@ -1346,9 +1346,9 @@ static void hevc_sao_edge_filter_0degree_8width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { uint64_t dst_val0, dst_val1; @@ -1440,13 +1440,14 @@ static void hevc_sao_edge_filter_0degree_16multiple_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t width, int32_t height) { - uint8_t *dst_ptr, *src_minus1; + const uint8_t *src_minus1; + uint8_t *dst_ptr; int32_t v_cnt; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -1556,9 +1557,9 @@ static void hevc_sao_edge_filter_90degree_4width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { uint32_t dst_val0, dst_val1; @@ -1661,9 +1662,9 @@ static void hevc_sao_edge_filter_90degree_8width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { uint64_t dst_val0, dst_val1; @@ -1763,14 +1764,14 @@ static void hevc_sao_edge_filter_90degree_16multiple_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t * + const int16_t * sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig = src; + const uint8_t *src_orig = src; uint8_t *dst_orig = dst; int32_t h_cnt, v_cnt; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -1865,12 +1866,12 @@ static void hevc_sao_edge_filter_45degree_4width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; uint32_t dst_val0, dst_val1; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -1978,12 +1979,12 @@ static void hevc_sao_edge_filter_45degree_8width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; uint64_t dst_val0, dst_val1; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -2094,14 +2095,14 @@ static void hevc_sao_edge_filter_45degree_16multiple_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t * + const int16_t * sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig = src; + const uint8_t *src_orig = src; uint8_t *dst_orig = dst; int32_t v_cnt; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -2214,12 +2215,12 @@ static void hevc_sao_edge_filter_135degree_4width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; uint32_t dst_val0, dst_val1; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -2329,12 +2330,12 @@ static void hevc_sao_edge_filter_135degree_8width_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int32_t height) { - uint8_t *src_orig; + const uint8_t *src_orig; uint64_t dst_val0, dst_val1; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -2441,14 +2442,15 @@ static void hevc_sao_edge_filter_135degree_16multiple_msa(uint8_t *dst, int32_t dst_stride, - uint8_t *src, + const uint8_t *src, int32_t src_stride, - int16_t * + const int16_t * sao_offset_val, int32_t width, int32_t height) { - uint8_t *src_orig, *dst_orig; + const uint8_t *src_orig; + uint8_t *dst_orig; int32_t v_cnt; v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); @@ -2563,39 +2565,39 @@ void ff_hevc_loop_filter_luma_h_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q) + int32_t beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q) { hevc_loopfilter_luma_hor_msa(src, src_stride, beta, tc, no_p, no_q); } void ff_hevc_loop_filter_luma_v_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t beta, int32_t *tc, - uint8_t *no_p, uint8_t *no_q) + int32_t beta, const int32_t *tc, + const uint8_t *no_p, const uint8_t *no_q) { hevc_loopfilter_luma_ver_msa(src, src_stride, beta, tc, no_p, no_q); } void ff_hevc_loop_filter_chroma_h_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { hevc_loopfilter_chroma_hor_msa(src, src_stride, tc, no_p, no_q); } void ff_hevc_loop_filter_chroma_v_8_msa(uint8_t *src, ptrdiff_t src_stride, - int32_t *tc, uint8_t *no_p, - uint8_t *no_q) + const int32_t *tc, const uint8_t *no_p, + const uint8_t *no_q) { hevc_loopfilter_chroma_ver_msa(src, src_stride, tc, no_p, no_q); } -void ff_hevc_sao_band_filter_0_8_msa(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_band_filter_0_8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, - int16_t *sao_offset_val, int sao_left_class, + const int16_t *sao_offset_val, int sao_left_class, int width, int height) { if (width >> 4) { @@ -2621,9 +2623,9 @@ } } -void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, uint8_t *src, +void ff_hevc_sao_edge_filter_8_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, - int16_t *sao_offset_val, + const int16_t *sao_offset_val, int eo, int width, int height) { ptrdiff_t stride_src = (2 * MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE) / sizeof(uint8_t); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_macros_msa.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_macros_msa.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_macros_msa.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_macros_msa.h 2023-03-03 13:29:59.000000000 +0000 @@ -52,6 +52,15 @@ out_m; \ } ) +#define HEVC_FILT_4TAP_SW(in0, in1, filt0, filt1) \ +( { \ + v4i32 out_m; \ + \ + out_m = __msa_dotp_s_w((v8i16) in0, (v8i16) filt0); \ + out_m = __msa_dpadd_s_w(out_m, (v8i16) in1, (v8i16) filt1); \ + out_m; \ +} ) + #define HEVC_FILT_4TAP(in0, in1, filt0, filt1) \ ( { \ v4i32 out_m; \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_bi_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,9 +58,9 @@ HEVC_BI_RND_CLIP2_MAX_SATU(in2, in3, vec2, vec3, rnd_val, out2, out3); \ } -static void hevc_bi_copy_4w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -126,9 +126,9 @@ } } -static void hevc_bi_copy_6w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -136,6 +136,7 @@ { uint32_t loop_cnt; uint64_t tp0, tp1, tp2, tp3; + int32_t res = height & 0x07; v16u8 out0, out1, out2, out3; v16i8 zero = { 0 }; v16i8 src0 = { 0 }, src1 = { 0 }, src2 = { 0 }, src3 = { 0 }; @@ -176,11 +177,50 @@ ST_H2(out3, 2, 6, dst + 2 * dst_stride + 4, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3); + src0_ptr += (4 * src_stride); + INSERT_D2_SB(tp0, tp1, src0); + INSERT_D2_SB(tp2, tp3, src1); + LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3); + INSERT_D2_SB(tp0, tp1, src2); + INSERT_D2_SB(tp2, tp3, src3); + LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7); + ILVRL_B2_SH(zero, src0, dst0, dst1); + ILVRL_B2_SH(zero, src1, dst2, dst3); + ILVRL_B2_SH(zero, src2, dst4, dst5); + ILVRL_B2_SH(zero, src3, dst6, dst7); + SLLI_4V(dst0, dst1, dst2, dst3, 6); + SLLI_4V(dst4, dst5, dst6, dst7, 6); + HEVC_BI_RND_CLIP4_MAX_SATU(in0, in1, in2, in3, dst0, dst1, dst2, dst3, + 7, dst0, dst1, dst2, dst3); + HEVC_BI_RND_CLIP4_MAX_SATU(in4, in5, in6, in7, dst4, dst5, dst6, dst7, + 7, dst4, dst5, dst6, dst7); + PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + if (res == 2) { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + } else if (res == 4) { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + } else { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + dst += (4 * dst_stride); + ST_W2(out2, 0, 2, dst, dst_stride); + ST_H2(out2, 2, 6, dst + 4, dst_stride); + } + } } -static void hevc_bi_copy_8w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -266,9 +306,9 @@ } } -static void hevc_bi_copy_12w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -305,9 +345,9 @@ } } -static void hevc_bi_copy_16w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -343,9 +383,9 @@ } } -static void hevc_bi_copy_24w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -389,9 +429,9 @@ } } -static void hevc_bi_copy_32w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -433,9 +473,9 @@ } } -static void hevc_bi_copy_48w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -487,9 +527,9 @@ } } -static void hevc_bi_copy_64w_msa(uint8_t *src0_ptr, +static void hevc_bi_copy_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -526,9 +566,9 @@ } } -static void hevc_hz_bi_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -536,6 +576,7 @@ int32_t height) { uint32_t loop_cnt; + int32_t res = height & 0x07; v8i16 filt0, filt1, filt2, filt3; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v16i8 mask1, mask2, mask3; @@ -597,11 +638,55 @@ ST_W8(dst0, dst1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); } + if (res) { + LD_SB8(src0_ptr, src_stride, src0, src1, src2, src3, + src4, src5, src6, src7); + LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7); + + ILVR_D2_SH(in1, in0, in3, in2, in0, in1); + ILVR_D2_SH(in5, in4, in7, in6, in2, in3); + XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); + + dst0 = const_vec; + dst1 = const_vec; + dst2 = const_vec; + dst3 = const_vec; + VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0, vec1); + VSHF_B2_SB(src4, src5, src6, src7, mask0, mask0, vec2, vec3); + DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt0, filt0, filt0, filt0, dst0, + dst1, dst2, dst3); + VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec0, vec1); + VSHF_B2_SB(src4, src5, src6, src7, mask1, mask1, vec2, vec3); + DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt1, filt1, filt1, filt1, dst0, + dst1, dst2, dst3); + VSHF_B2_SB(src0, src1, src2, src3, mask2, mask2, vec0, vec1); + VSHF_B2_SB(src4, src5, src6, src7, mask2, mask2, vec2, vec3); + DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt2, filt2, filt2, filt2, dst0, + dst1, dst2, dst3); + VSHF_B2_SB(src0, src1, src2, src3, mask3, mask3, vec0, vec1); + VSHF_B2_SB(src4, src5, src6, src7, mask3, mask3, vec2, vec3); + DPADD_SB4_SH(vec0, vec1, vec2, vec3, filt3, filt3, filt3, filt3, dst0, + dst1, dst2, dst3); + + HEVC_BI_RND_CLIP4(in0, in1, in2, in3, + dst0, dst1, dst2, dst3, 7, dst0, dst1, dst2, dst3); + + PCKEV_B2_SH(dst1, dst0, dst3, dst2, dst0, dst1); + if (res == 2) { + ST_W2(dst0, 0, 1, dst, dst_stride); + } else if (res == 4) { + ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride); + } else { + ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride); + dst += (4 * dst_stride); + ST_W2(dst1, 0, 1, dst, dst_stride); + } + } } -static void hevc_hz_bi_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -667,9 +752,9 @@ } } -static void hevc_hz_bi_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -755,9 +840,9 @@ } } -static void hevc_hz_bi_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -826,9 +911,9 @@ } } -static void hevc_hz_bi_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -898,9 +983,9 @@ } } -static void hevc_hz_bi_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -970,9 +1055,9 @@ } } -static void hevc_hz_bi_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1062,9 +1147,9 @@ } } -static void hevc_hz_bi_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1172,9 +1257,9 @@ } } -static void hevc_vt_bi_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1182,6 +1267,7 @@ int32_t height) { int32_t loop_cnt; + int32_t res = height & 0x07; v16i8 src0, src1, src2, src3, src4, src5; v16i8 src6, src7, src8, src9, src10; v8i16 in0, in1, in2, in3, in4, in5, in6, in7; @@ -1256,11 +1342,55 @@ src6554 = src14131312; src6 = src14; } + if (res) { + LD_SB8(src0_ptr, src_stride, + src7, src8, src9, src10, src11, src12, src13, src14); + LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7); + + ILVR_D2_SH(in1, in0, in3, in2, in0, in1); + ILVR_D2_SH(in5, in4, in7, in6, in2, in3); + ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, + src76_r, src87_r, src98_r, src109_r); + ILVR_B4_SB(src11, src10, src12, src11, src13, src12, src14, src13, + src1110_r, src1211_r, src1312_r, src1413_r); + ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r, + src1413_r, src1312_r, + src8776, src10998, src12111110, src14131312); + XORI_B4_128_SB(src8776, src10998, src12111110, src14131312); + + dst10 = const_vec; + DPADD_SB4_SH(src2110, src4332, src6554, src8776, + filt0, filt1, filt2, filt3, dst10, dst10, dst10, dst10); + dst32 = const_vec; + DPADD_SB4_SH(src4332, src6554, src8776, src10998, + filt0, filt1, filt2, filt3, dst32, dst32, dst32, dst32); + dst54 = const_vec; + DPADD_SB4_SH(src6554, src8776, src10998, src12111110, + filt0, filt1, filt2, filt3, dst54, dst54, dst54, dst54); + dst76 = const_vec; + DPADD_SB4_SH(src8776, src10998, src12111110, src14131312, + filt0, filt1, filt2, filt3, dst76, dst76, dst76, dst76); + + HEVC_BI_RND_CLIP4(in0, in1, in2, in3, + dst10, dst32, dst54, dst76, 7, + dst10, dst32, dst54, dst76); + + PCKEV_B2_SH(dst32, dst10, dst76, dst54, dst10, dst54); + if (res == 2) { + ST_W2(dst10, 0, 1, dst, dst_stride); + } else if (res == 4) { + ST_W4(dst10, 0, 1, 2, 3, dst, dst_stride); + } else { + ST_W4(dst10, 0, 1, 2, 3, dst, dst_stride); + dst += 4 * dst_stride; + ST_W2(dst54, 0, 1, dst, dst_stride); + } + } } -static void hevc_vt_bi_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1336,9 +1466,9 @@ } } -static void hevc_vt_bi_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1443,17 +1573,17 @@ } } -static void hevc_vt_bi_8t_16multx2mult_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_16multx2mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height, int32_t width) { - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; uint32_t loop_cnt; uint32_t cnt; @@ -1549,9 +1679,9 @@ } } -static void hevc_vt_bi_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1562,9 +1692,9 @@ dst, dst_stride, filter, height, 16); } -static void hevc_vt_bi_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1577,9 +1707,9 @@ dst + 16, dst_stride, filter, height); } -static void hevc_vt_bi_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1590,9 +1720,9 @@ dst, dst_stride, filter, height, 32); } -static void hevc_vt_bi_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1603,9 +1733,9 @@ dst, dst_stride, filter, height, 48); } -static void hevc_vt_bi_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1616,9 +1746,9 @@ dst, dst_stride, filter, height, 64); } -static void hevc_hv_bi_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1741,9 +1871,9 @@ } } -static void hevc_hv_bi_8t_8multx1mult_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_8multx1mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1753,8 +1883,8 @@ { uint32_t loop_cnt; uint32_t cnt; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; @@ -1874,9 +2004,9 @@ } } -static void hevc_hv_bi_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1889,9 +2019,9 @@ height, 8); } -static void hevc_hv_bi_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1900,8 +2030,9 @@ int32_t height) { uint32_t loop_cnt; - uint8_t *src0_ptr_tmp, *dst_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + uint8_t *dst_tmp; + const int16_t *src1_ptr_tmp; uint64_t tp0, tp1; v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; @@ -2103,9 +2234,9 @@ } } -static void hevc_hv_bi_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2118,9 +2249,9 @@ height, 16); } -static void hevc_hv_bi_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2133,9 +2264,9 @@ height, 24); } -static void hevc_hv_bi_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2148,9 +2279,9 @@ height, 32); } -static void hevc_hv_bi_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2163,9 +2294,9 @@ height, 48); } -static void hevc_hv_bi_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2178,9 +2309,9 @@ height, 64); } -static void hevc_hz_bi_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2221,9 +2352,9 @@ ST_W2(dst0, 0, 1, dst, dst_stride); } -static void hevc_hz_bi_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2267,9 +2398,9 @@ ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hz_bi_4t_4x8multiple_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_4x8multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2330,9 +2461,9 @@ } } -static void hevc_hz_bi_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2352,9 +2483,9 @@ } } -static void hevc_hz_bi_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2362,6 +2493,7 @@ int32_t height) { uint32_t loop_cnt; + int32_t res = height & 0x03; v8i16 filt0, filt1; v16i8 src0, src1, src2, src3; v8i16 in0, in1, in2, in3; @@ -2411,11 +2543,29 @@ ST_H2(dst1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD_SB2(src0_ptr, src_stride, src0, src1); + LD_SH2(src1_ptr, src2_stride, in0, in1); + XORI_B2_128_SB(src0, src1); + + dst0 = const_vec; + dst1 = const_vec; + VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec1); + DPADD_SB2_SH(vec0, vec1, filt0, filt0, dst0, dst1); + VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec0, vec1); + DPADD_SB2_SH(vec0, vec1, filt1, filt1, dst0, dst1); + + HEVC_BI_RND_CLIP2(in0, in1, dst0, dst1, 7, dst0, dst1); + + dst0 = (v8i16) __msa_pckev_b((v16i8) dst1, (v16i8) dst0); + ST_W2(dst0, 0, 2, dst, dst_stride); + ST_H2(dst0, 2, 6, dst + 4, dst_stride); + } } -static void hevc_hz_bi_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2456,9 +2606,9 @@ ST_D2(dst0, 0, 1, dst, dst_stride); } -static void hevc_hz_bi_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2520,9 +2670,9 @@ ST_D2(dst2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hz_bi_4t_8x4multiple_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_8x4multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2578,9 +2728,9 @@ } } -static void hevc_hz_bi_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2600,9 +2750,9 @@ } } -static void hevc_hz_bi_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2674,9 +2824,9 @@ } } -static void hevc_hz_bi_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2734,16 +2884,16 @@ } } -static void hevc_hz_bi_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { - int16_t *src1_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; uint32_t loop_cnt; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; @@ -2840,9 +2990,9 @@ } } -static void hevc_hz_bi_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_hz_bi_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2901,9 +3051,9 @@ } } -static void hevc_vt_bi_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2949,9 +3099,9 @@ ST_W2(dst10, 0, 1, dst, dst_stride); } -static void hevc_vt_bi_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2998,9 +3148,9 @@ ST_W4(dst10, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_vt_bi_4t_4x8multiple_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_4x8multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3071,9 +3221,9 @@ } } -static void hevc_vt_bi_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3093,9 +3243,9 @@ } } -static void hevc_vt_bi_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3191,9 +3341,9 @@ dst += (4 * dst_stride); } -static void hevc_vt_bi_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3235,9 +3385,9 @@ ST_D2(dst0_r, 0, 1, dst, dst_stride); } -static void hevc_vt_bi_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3295,9 +3445,9 @@ ST_D2(dst2_r, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_vt_bi_4t_8x4multiple_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_8x4multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3357,9 +3507,9 @@ } } -static void hevc_vt_bi_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3379,9 +3529,9 @@ } } -static void hevc_vt_bi_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3462,9 +3612,9 @@ } } -static void hevc_vt_bi_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3547,9 +3697,9 @@ } } -static void hevc_vt_bi_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3671,9 +3821,9 @@ } } -static void hevc_vt_bi_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_vt_bi_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3781,9 +3931,9 @@ } } -static void hevc_hv_bi_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3848,9 +3998,9 @@ ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_bi_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3924,9 +4074,9 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hv_bi_4t_4multx8mult_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_4multx8mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4043,9 +4193,9 @@ } } -static void hevc_hv_bi_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4067,9 +4217,9 @@ } } -static void hevc_hv_bi_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4217,9 +4367,9 @@ ST_H8(out2, 0, 1, 2, 3, 4, 5, 6, 7, dst + 4, dst_stride); } -static void hevc_hv_bi_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4291,9 +4441,9 @@ ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_bi_4t_8multx4_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_8multx4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4387,9 +4537,9 @@ } } -static void hevc_hv_bi_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4503,9 +4653,9 @@ ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hv_bi_4t_8multx4mult_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_8multx4mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4515,8 +4665,8 @@ int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6; @@ -4628,9 +4778,9 @@ } } -static void hevc_hv_bi_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4655,9 +4805,9 @@ } } -static void hevc_hv_bi_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4667,8 +4817,9 @@ { uint32_t loop_cnt; uint64_t tp0, tp1; - uint8_t *src0_ptr_tmp, *dst_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + uint8_t *dst_tmp; + const int16_t *src1_ptr_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; @@ -4857,9 +5008,9 @@ } } -static void hevc_hv_bi_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4877,9 +5028,9 @@ } } -static void hevc_hv_bi_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4892,9 +5043,9 @@ height, 24); } -static void hevc_hv_bi_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_hv_bi_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4910,9 +5061,9 @@ #define BI_MC_COPY(WIDTH) \ void ff_hevc_put_hevc_bi_pel_pixels##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -4937,9 +5088,9 @@ #define BI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ @@ -4991,9 +5142,9 @@ #define BI_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_bi_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ intptr_t mx, \ intptr_t my, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_biw_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,8 +42,8 @@ out1_l = __msa_dpadd_s_w(offset, (v8i16) out1_l, (v8i16) wgt); \ \ SRAR_W4_SW(out0_r, out1_r, out0_l, out1_l, rnd); \ + CLIP_SW4_0_255(out0_l, out0_r, out1_l, out1_r); \ PCKEV_H2_SH(out0_l, out0_r, out1_l, out1_r, out0, out1); \ - CLIP_SH2_0_255(out0, out1); \ } #define HEVC_BIW_RND_CLIP4(in0, in1, in2, in3, vec0, vec1, vec2, vec3, \ @@ -65,8 +65,8 @@ out0_l = __msa_dpadd_s_w(offset, (v8i16) out0_l, (v8i16) wgt); \ out1_l = __msa_dpadd_s_w(offset, (v8i16) out1_l, (v8i16) wgt); \ SRAR_W4_SW(out0_r, out1_r, out0_l, out1_l, rnd); \ + CLIP_SW4_0_255(out0_r, out1_r, out0_l, out1_l); \ PCKEV_H2_SH(out0_l, out0_r, out1_l, out1_r, out0, out1); \ - CLIP_SH2_0_255(out0, out1); \ } #define HEVC_BIW_RND_CLIP4_MAX_SATU(in0, in1, in2, in3, vec0, vec1, vec2, \ @@ -79,9 +79,9 @@ out2, out3); \ } -static void hevc_biwgt_copy_4w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -123,8 +123,8 @@ dst0_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst0_r, weight_vec); dst0_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst0_l, weight_vec); SRAR_W2_SW(dst0_r, dst0_l, rnd_vec); + CLIP_SW2_0_255(dst0_r, dst0_l); dst0 = (v8i16) __msa_pckev_h((v8i16) dst0_l, (v8i16) dst0_r); - CLIP_SH_0_255(dst0); out0 = (v16u8) __msa_pckev_b((v16i8) dst0, (v16i8) dst0); ST_W2(out0, 0, 1, dst, dst_stride); } else if (4 == height) { @@ -168,9 +168,9 @@ } } -static void hevc_biwgt_copy_6w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -182,6 +182,7 @@ int32_t rnd_val) { uint32_t loop_cnt; + int32_t res = height & 0x03; int32_t offset, weight; uint64_t tp0, tp1, tp2, tp3; v16u8 out0, out1; @@ -220,11 +221,32 @@ ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD4(src0_ptr, src_stride, tp0, tp1, tp2, tp3); + src0_ptr += (4 * src_stride); + INSERT_D2_SB(tp0, tp1, src0); + INSERT_D2_SB(tp2, tp3, src1); + LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3); + src1_ptr += (4 * src2_stride); + ILVRL_B2_SH(zero, src0, dst0, dst1); + ILVRL_B2_SH(zero, src1, dst2, dst3); + SLLI_4V(dst0, dst1, dst2, dst3, 6); + HEVC_BIW_RND_CLIP4_MAX_SATU(dst0, dst1, dst2, dst3, + in0, in1, in2, in3, + weight_vec, rnd_vec, offset_vec, + dst0, dst1, dst2, dst3); + + PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + } } -static void hevc_biwgt_copy_8w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -310,9 +332,9 @@ } } -static void hevc_biwgt_copy_12w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -340,7 +362,7 @@ weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val + 1); - for (loop_cnt = (16 >> 2); loop_cnt--;) { + for (loop_cnt = (height >> 2); loop_cnt--;) { LD_SB4(src0_ptr, src_stride, src0, src1, src2, src3); src0_ptr += (4 * src_stride); LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3); @@ -369,9 +391,9 @@ } } -static void hevc_biwgt_copy_16w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -424,9 +446,9 @@ } } -static void hevc_biwgt_copy_24w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -488,9 +510,9 @@ } } -static void hevc_biwgt_copy_32w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -549,9 +571,9 @@ } } -static void hevc_biwgt_copy_48w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -601,9 +623,9 @@ } } -static void hevc_biwgt_copy_64w_msa(uint8_t *src0_ptr, +static void hevc_biwgt_copy_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -656,9 +678,9 @@ } } -static void hevc_hz_biwgt_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -728,9 +750,9 @@ } } -static void hevc_hz_biwgt_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -808,9 +830,9 @@ } } -static void hevc_hz_biwgt_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -903,9 +925,9 @@ } } -static void hevc_hz_biwgt_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -987,9 +1009,9 @@ } } -static void hevc_hz_biwgt_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1069,8 +1091,8 @@ dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l, (v8i16) weight_vec); SRAR_W2_SW(dst2_r, dst2_l, rnd_vec); + CLIP_SW2_0_255(dst2_r, dst2_l); out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r); - CLIP_SH_0_255(out2); LD_SB2(src0_ptr, 16, src0, src1); src0_ptr += src_stride; @@ -1100,8 +1122,8 @@ dst2_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_r, (v8i16) weight_vec); dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l, (v8i16) weight_vec); SRAR_W2_SW(dst2_r, dst2_l, rnd_vec); + CLIP_SW2_0_255(dst2_r, dst2_l); out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r); - CLIP_SH_0_255(out2); PCKEV_B2_SH(out1, out0, out2, out2, out0, out2); dst_val0 = __msa_copy_u_d((v2i64) out2, 0); ST_SH(out0, dst); @@ -1109,9 +1131,9 @@ dst += dst_stride; } -static void hevc_hz_biwgt_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1195,9 +1217,9 @@ } } -static void hevc_hz_biwgt_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1299,9 +1321,9 @@ } } -static void hevc_hz_biwgt_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1313,9 +1335,9 @@ int32_t offset1, int32_t rnd_val) { - uint8_t *src0_ptr_tmp; + const uint8_t *src0_ptr_tmp; uint8_t *dst_tmp; - int16_t *src1_ptr_tmp; + const int16_t *src1_ptr_tmp; uint32_t loop_cnt, cnt; int32_t offset, weight, constant; v16i8 src0, src1, src2; @@ -1398,9 +1420,9 @@ } } -static void hevc_vt_biwgt_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1413,6 +1435,7 @@ int32_t rnd_val) { uint32_t loop_cnt; + int32_t res = height & 0x07; int32_t offset, weight; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src11, src12, src13, src14; @@ -1494,11 +1517,51 @@ src6554 = src14131312; src6 = src14; } + if (res) { + LD_SB8(src0_ptr, src_stride, + src7, src8, src9, src10, src11, src12, src13, src14); + src0_ptr += (8 * src_stride); + LD_SH8(src1_ptr, src2_stride, in0, in1, in2, in3, in4, in5, in6, in7); + src1_ptr += (8 * src2_stride); + + ILVR_D2_SH(in1, in0, in3, in2, in0, in1); + ILVR_D2_SH(in5, in4, in7, in6, in2, in3); + ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, + src76_r, src87_r, src98_r, src109_r); + ILVR_B4_SB(src11, src10, src12, src11, src13, src12, src14, src13, + src1110_r, src1211_r, src1312_r, src1413_r); + ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r, + src1413_r, src1312_r, + src8776, src10998, src12111110, src14131312); + XORI_B4_128_SB(src8776, src10998, src12111110, src14131312); + + DOTP_SB4_SH(src2110, src4332, src6554, src8776, filt0, filt0, filt0, + filt0, dst10, dst32, dst54, dst76); + DPADD_SB4_SH(src4332, src6554, src8776, src10998, filt1, filt1, filt1, + filt1, dst10, dst32, dst54, dst76); + DPADD_SB4_SH(src6554, src8776, src10998, src12111110, filt2, filt2, + filt2, filt2, dst10, dst32, dst54, dst76); + DPADD_SB4_SH(src8776, src10998, src12111110, src14131312, filt3, filt3, + filt3, filt3, dst10, dst32, dst54, dst76); + + HEVC_BIW_RND_CLIP4(dst10, dst32, dst54, dst76, + in0, in1, in2, in3, + weight_vec, rnd_vec, offset_vec, + out0, out1, out2, out3); + + PCKEV_B2_SH(out1, out0, out3, out2, out0, out1); + ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); + + src2110 = src10998; + src4332 = src12111110; + src6554 = src14131312; + src6 = src14; + } } -static void hevc_vt_biwgt_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1584,9 +1647,9 @@ } } -static void hevc_vt_biwgt_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1674,8 +1737,8 @@ dst2_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst2_l, (v8i16) weight_vec); SRAR_W2_SW(dst2_r, dst2_l, rnd_vec); + CLIP_SW2_0_255(dst2_r, dst2_l); out2 = __msa_pckev_h((v8i16) dst2_l, (v8i16) dst2_r); - CLIP_SH_0_255(out2); PCKEV_B2_SH(out1, out0, out2, out2, out0, out2); ST_D2(out0, 0, 1, dst, dst_stride); ST_W2(out2, 0, 1, dst + 8, dst_stride); @@ -1694,9 +1757,9 @@ } } -static void hevc_vt_biwgt_8t_16multx2mult_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_16multx2mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1709,8 +1772,8 @@ int32_t rnd_val, int32_t width) { - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; uint32_t loop_cnt, cnt; int32_t offset, weight; @@ -1810,9 +1873,9 @@ } } -static void hevc_vt_biwgt_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1831,9 +1894,9 @@ rnd_val, 16); } -static void hevc_vt_biwgt_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1856,9 +1919,9 @@ weight0, weight1, offset0, offset1, rnd_val); } -static void hevc_vt_biwgt_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1877,9 +1940,9 @@ rnd_val, 32); } -static void hevc_vt_biwgt_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1898,9 +1961,9 @@ rnd_val, 48); } -static void hevc_vt_biwgt_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -1919,9 +1982,9 @@ rnd_val, 64); } -static void hevc_hv_biwgt_8t_4w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2064,9 +2127,9 @@ } } -static void hevc_hv_biwgt_8t_8multx2mult_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_8multx2mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2082,8 +2145,8 @@ { uint32_t loop_cnt, cnt; int32_t offset, weight; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; @@ -2247,9 +2310,9 @@ } } -static void hevc_hv_biwgt_8t_8w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2269,9 +2332,9 @@ offset1, rnd_val, 1); } -static void hevc_hv_biwgt_8t_12w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2285,8 +2348,9 @@ int32_t rnd_val) { uint32_t loop_cnt; - uint8_t *src0_ptr_tmp, *dst_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + uint8_t *dst_tmp; + const int16_t *src1_ptr_tmp; int32_t offset, weight; uint64_t tp0, tp1; v16u8 out; @@ -2519,9 +2583,9 @@ } } -static void hevc_hv_biwgt_8t_16w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2541,9 +2605,9 @@ offset1, rnd_val, 2); } -static void hevc_hv_biwgt_8t_24w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2563,9 +2627,9 @@ offset1, rnd_val, 3); } -static void hevc_hv_biwgt_8t_32w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2585,9 +2649,9 @@ offset1, rnd_val, 4); } -static void hevc_hv_biwgt_8t_48w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_48w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2607,9 +2671,9 @@ offset1, rnd_val, 6); } -static void hevc_hv_biwgt_8t_64w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_8t_64w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2629,9 +2693,9 @@ offset1, rnd_val, 8); } -static void hevc_hz_biwgt_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2689,9 +2753,9 @@ ST_W2(out0, 0, 1, dst, dst_stride); } -static void hevc_hz_biwgt_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2749,9 +2813,9 @@ ST_W4(dst0, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hz_biwgt_4t_4x8multiple_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_4x8multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2824,9 +2888,9 @@ } } -static void hevc_hz_biwgt_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2855,9 +2919,9 @@ } } -static void hevc_hz_biwgt_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2929,9 +2993,9 @@ } } -static void hevc_hz_biwgt_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -2985,9 +3049,9 @@ ST_D2(dst0, 0, 1, dst, dst_stride); } -static void hevc_hz_biwgt_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3059,9 +3123,9 @@ ST_D2(dst3, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hz_biwgt_4t_8x4multiple_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_8x4multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3129,9 +3193,9 @@ } } -static void hevc_hz_biwgt_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3160,9 +3224,9 @@ } } -static void hevc_hz_biwgt_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3246,9 +3310,9 @@ } } -static void hevc_hz_biwgt_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3335,9 +3399,9 @@ } } -static void hevc_hz_biwgt_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3422,9 +3486,9 @@ } } -static void hevc_hz_biwgt_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_hz_biwgt_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3495,9 +3559,9 @@ } } -static void hevc_vt_biwgt_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3554,15 +3618,15 @@ dst10_r = __msa_dpadd_s_w(offset_vec, (v8i16) dst10_r, (v8i16) weight_vec); dst10_l = __msa_dpadd_s_w(offset_vec, (v8i16) dst10_l, (v8i16) weight_vec); SRAR_W2_SW(dst10_r, dst10_l, rnd_vec); + CLIP_SW2_0_255(dst10_r, dst10_l); out = __msa_pckev_h((v8i16) dst10_l, (v8i16) dst10_r); - CLIP_SH_0_255(out); out = (v8i16) __msa_pckev_b((v16i8) out, (v16i8) out); ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_vt_biwgt_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3627,9 +3691,9 @@ dst += (4 * dst_stride); } -static void hevc_vt_biwgt_4t_4x8multiple_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_4x8multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3713,9 +3777,9 @@ } } -static void hevc_vt_biwgt_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3744,9 +3808,9 @@ } } -static void hevc_vt_biwgt_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3759,6 +3823,7 @@ int32_t rnd_val) { uint32_t loop_cnt; + int32_t res = height & 0x03; int32_t offset, weight, constant; v16i8 src0, src1, src2, src3, src4; v8i16 in0, in1, in2, in3; @@ -3819,11 +3884,40 @@ ST_H2(tmp1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD_SB2(src0_ptr, src_stride, src3, src4); + src0_ptr += (2 * src_stride); + LD_SH4(src1_ptr, src2_stride, in0, in1, in2, in3); + src1_ptr += (4 * src2_stride); + XORI_B2_128_SB(src3, src4); + ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); + + tmp0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); + tmp1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); + + LD_SB2(src0_ptr, src_stride, src1, src2); + src0_ptr += (2 * src_stride); + XORI_B2_128_SB(src1, src2); + ILVR_B2_SB(src1, src4, src2, src1, src10_r, src21_r); + + tmp2 = HEVC_FILT_4TAP_SH(src32_r, src10_r, filt0, filt1); + tmp3 = HEVC_FILT_4TAP_SH(src43_r, src21_r, filt0, filt1); + HEVC_BIW_RND_CLIP4(tmp0, tmp1, tmp2, tmp3, + in0, in1, in2, in3, + weight_vec, rnd_vec, offset_vec, + tmp0, tmp1, tmp2, tmp3); + + PCKEV_B2_SH(tmp1, tmp0, tmp3, tmp2, tmp0, tmp1); + ST_W2(tmp0, 0, 2, dst, dst_stride); + ST_H2(tmp0, 2, 6, dst + 4, dst_stride); + ST_W2(tmp1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(tmp1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + } } -static void hevc_vt_biwgt_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3878,9 +3972,9 @@ ST_D2(tmp0, 0, 1, dst, dst_stride); } -static void hevc_vt_biwgt_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -3949,9 +4043,9 @@ ST_D2(tmp3, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_vt_biwgt_4t_8x4multiple_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_8x4multiple_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4023,9 +4117,9 @@ } } -static void hevc_vt_biwgt_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4054,9 +4148,9 @@ } } -static void hevc_vt_biwgt_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4146,9 +4240,9 @@ } } -static void hevc_vt_biwgt_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4240,9 +4334,9 @@ } } -static void hevc_vt_biwgt_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4377,9 +4471,9 @@ } } -static void hevc_vt_biwgt_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_vt_biwgt_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4496,9 +4590,9 @@ } } -static void hevc_hv_biwgt_4t_4x2_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_4x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4574,15 +4668,15 @@ dst0 = __msa_dpadd_s_w(offset_vec, tmp0, weight_vec); dst1 = __msa_dpadd_s_w(offset_vec, tmp1, weight_vec); SRAR_W2_SW(dst0, dst1, rnd_vec); + CLIP_SW2_0_255(dst0, dst1); tmp = __msa_pckev_h((v8i16) dst1, (v8i16) dst0); - CLIP_SH_0_255(tmp); out = (v16u8) __msa_pckev_b((v16i8) tmp, (v16i8) tmp); ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_biwgt_4t_4x4_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_4x4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4671,15 +4765,15 @@ dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec); dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); - CLIP_SH2_0_255(tmp0, tmp1); out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hv_biwgt_4t_4multx8mult_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_4multx8mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4808,9 +4902,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); @@ -4821,9 +4916,9 @@ } } -static void hevc_hv_biwgt_4t_4w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_4w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -4853,9 +4948,9 @@ } } -static void hevc_hv_biwgt_4t_6w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_6w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5006,9 +5101,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); @@ -5028,16 +5124,16 @@ dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec); dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp4, tmp5); - CLIP_SH2_0_255(tmp4, tmp5); out2 = (v16u8) __msa_pckev_b((v16i8) tmp5, (v16i8) tmp4); ST_H8(out2, 0, 1, 2, 3, 4, 5, 6, 7, dst + 4, dst_stride); } -static void hevc_hv_biwgt_4t_8x2_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_8x2_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5125,15 +5221,15 @@ dst1_r = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec); dst1_l = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec); SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); + CLIP_SW4_0_255(dst0_r, dst0_l, dst1_r, dst1_l); PCKEV_H2_SH(dst0_l, dst0_r, dst1_l, dst1_r, tmp0, tmp1); - CLIP_SH2_0_255(tmp0, tmp1); out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_biwgt_4t_8multx4_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_8multx4_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5246,18 +5342,19 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); dst += 8; } } -static void hevc_hv_biwgt_4t_8x6_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_8x6_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5385,9 +5482,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); PCKEV_H2_SW(dst4_l, dst4_r, dst5_l, dst5_r, dst0, dst1); @@ -5398,16 +5496,16 @@ dst2 = __msa_dpadd_s_w(offset_vec, tmp2, weight_vec); dst3 = __msa_dpadd_s_w(offset_vec, tmp3, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp4, tmp5); - CLIP_SH2_0_255(tmp4, tmp5); out2 = (v16u8) __msa_pckev_b((v16i8) tmp5, (v16i8) tmp4); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hv_biwgt_4t_8multx4mult_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_8multx4mult_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5424,8 +5522,8 @@ uint32_t loop_cnt; uint32_t cnt; int32_t offset, weight; - uint8_t *src0_ptr_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6; @@ -5535,9 +5633,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride); dst_tmp += (4 * dst_stride); @@ -5555,9 +5654,9 @@ } } -static void hevc_hv_biwgt_4t_8w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_8w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5592,9 +5691,9 @@ } } -static void hevc_hv_biwgt_4t_12w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_12w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5610,8 +5709,9 @@ uint32_t loop_cnt; uint64_t tp0, tp1; int32_t offset, weight; - uint8_t *src0_ptr_tmp, *dst_tmp; - int16_t *src1_ptr_tmp; + const uint8_t *src0_ptr_tmp; + const int16_t *src1_ptr_tmp; + uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; @@ -5722,9 +5822,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride); dst_tmp += (4 * dst_stride); @@ -5818,9 +5919,10 @@ dst7 = __msa_dpadd_s_w(offset_vec, tmp7, weight_vec); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); @@ -5831,9 +5933,9 @@ } } -static void hevc_hv_biwgt_4t_16w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_16w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5859,9 +5961,9 @@ } } -static void hevc_hv_biwgt_4t_24w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_24w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5881,9 +5983,9 @@ weight1, offset0, offset1, rnd_val, 24); } -static void hevc_hv_biwgt_4t_32w_msa(uint8_t *src0_ptr, +static void hevc_hv_biwgt_4t_32w_msa(const uint8_t *src0_ptr, int32_t src_stride, - int16_t *src1_ptr, + const int16_t *src1_ptr, int32_t src2_stride, uint8_t *dst, int32_t dst_stride, @@ -5906,9 +6008,9 @@ #define BI_W_MC_COPY(WIDTH) \ void ff_hevc_put_hevc_bi_w_pel_pixels##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ int denom, \ int weight0, \ @@ -5944,10 +6046,10 @@ void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t \ dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t \ src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ int denom, \ int weight0, \ @@ -6007,9 +6109,9 @@ #define BI_W_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_bi_w_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ - int16_t *src_16bit, \ + const int16_t *src_16bit, \ int height, \ int denom, \ int weight0, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uni_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -101,7 +101,7 @@ out0, out1, out2, out3); \ } -static void copy_width8_msa(uint8_t *src, int32_t src_stride, +static void copy_width8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -143,7 +143,7 @@ } } -static void copy_width12_msa(uint8_t *src, int32_t src_stride, +static void copy_width12_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -157,7 +157,7 @@ ST12x8_UB(src0, src1, src2, src3, src4, src5, src6, src7, dst, dst_stride); } -static void copy_width16_msa(uint8_t *src, int32_t src_stride, +static void copy_width16_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -193,7 +193,7 @@ } } -static void copy_width24_msa(uint8_t *src, int32_t src_stride, +static void copy_width24_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -216,7 +216,7 @@ } } -static void copy_width32_msa(uint8_t *src, int32_t src_stride, +static void copy_width32_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -233,7 +233,7 @@ } } -static void copy_width48_msa(uint8_t *src, int32_t src_stride, +static void copy_width48_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -254,7 +254,7 @@ } } -static void copy_width64_msa(uint8_t *src, int32_t src_stride, +static void copy_width64_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) { @@ -283,7 +283,7 @@ } } -static void common_hz_8t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -312,7 +312,7 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void common_hz_8t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -349,7 +349,7 @@ ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride); } -static void common_hz_8t_4x16_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_4x16_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -405,7 +405,7 @@ ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride); } -static void common_hz_8t_4w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -418,7 +418,7 @@ } } -static void common_hz_8t_8w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -470,7 +470,7 @@ } } -static void common_hz_8t_12w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -549,7 +549,7 @@ } } -static void common_hz_8t_16w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -607,7 +607,7 @@ } } -static void common_hz_8t_24w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -677,7 +677,7 @@ } } -static void common_hz_8t_32w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -738,7 +738,7 @@ } } -static void common_hz_8t_48w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -824,7 +824,7 @@ } } -static void common_hz_8t_64w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -903,11 +903,12 @@ } } -static void common_vt_8t_4w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { uint32_t loop_cnt; + uint32_t res = (height & 0x07) >> 1; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src11, src12, src13, src14; @@ -970,9 +971,30 @@ src6554 = src14131312; src6 = src14; } + for (; res--; ) { + LD_SB2(src, src_stride, src7, src8); + src += 2 * src_stride; + ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); + src8776 = (v16i8)__msa_ilvr_d((v2i64) src87_r, (v2i64) src76_r); + src8776 = (v16i8)__msa_xori_b(src8776, 128); + out10 = (v8i16)__msa_dotp_s_h((v16i8) src2110, (v16i8) filt0); + out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src4332, filt1); + out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src6554, filt2); + out10 = (v8i16)__msa_dpadd_s_h((v8i16) out10, src8776, filt3); + out10 = (v8i16)__msa_srari_h((v8i16) out10, 6); + out10 = (v8i16)__msa_sat_s_h((v8i16) out10, 7); + out0 = (v16u8)__msa_pckev_b((v16i8) out10, (v16i8) out10); + out0 = (v16u8)__msa_xori_b((v16u8) out0, 128); + ST_W2(out0, 0, 1, dst, dst_stride); + dst += 2 * dst_stride; + src2110 = src4332; + src4332 = src6554; + src6554 = src8776; + src6 = src8; + } } -static void common_vt_8t_8w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1027,7 +1049,7 @@ } } -static void common_vt_8t_12w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1129,7 +1151,7 @@ } } -static void common_vt_8t_16w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1208,12 +1230,12 @@ } } -static void common_vt_8t_16w_mult_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_16w_mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height, int32_t width) { - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; uint32_t loop_cnt, cnt; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; @@ -1297,7 +1319,7 @@ } } -static void common_vt_8t_24w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1308,7 +1330,7 @@ height); } -static void common_vt_8t_32w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1316,7 +1338,7 @@ 32); } -static void common_vt_8t_48w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1324,7 +1346,7 @@ 48); } -static void common_vt_8t_64w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1332,7 +1354,7 @@ 64); } -static void hevc_hv_uni_8t_4w_msa(uint8_t *src, +static void hevc_hv_uni_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1341,6 +1363,7 @@ int32_t height) { uint32_t loop_cnt; + uint32_t res = height & 0x07; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; v16i8 src9, src10, src11, src12, src13, src14; @@ -1464,9 +1487,75 @@ dst65_r = dst1413_r; dst66 = (v8i16) __msa_splati_d((v2i64) dst1410, 1); } + if (res) { + LD_SB8(src, src_stride, src7, src8, src9, src10, src11, src12, src13, + src14); + XORI_B8_128_SB(src7, src8, src9, src10, src11, src12, src13, src14); + + VSHF_B4_SB(src7, src11, mask0, mask1, mask2, mask3, + vec0, vec1, vec2, vec3); + VSHF_B4_SB(src8, src12, mask0, mask1, mask2, mask3, + vec4, vec5, vec6, vec7); + VSHF_B4_SB(src9, src13, mask0, mask1, mask2, mask3, + vec8, vec9, vec10, vec11); + VSHF_B4_SB(src10, src14, mask0, mask1, mask2, mask3, + vec12, vec13, vec14, vec15); + + dst117 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3); + dst128 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3); + dst139 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, + filt2, filt3); + dst1410 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, + filt2, filt3); + + dst76_r = __msa_ilvr_h(dst117, dst66); + ILVRL_H2_SH(dst128, dst117, dst87_r, dst1211_r); + ILVRL_H2_SH(dst139, dst128, dst98_r, dst1312_r); + ILVRL_H2_SH(dst1410, dst139, dst109_r, dst1413_r); + dst117 = (v8i16) __msa_splati_d((v2i64) dst117, 1); + dst1110_r = __msa_ilvr_h(dst117, dst1410); + + dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst1_r = HEVC_FILT_8TAP(dst21_r, dst43_r, dst65_r, dst87_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst2_r = HEVC_FILT_8TAP(dst32_r, dst54_r, dst76_r, dst98_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst3_r = HEVC_FILT_8TAP(dst43_r, dst65_r, dst87_r, dst109_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst4_r = HEVC_FILT_8TAP(dst54_r, dst76_r, dst98_r, dst1110_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst5_r = HEVC_FILT_8TAP(dst65_r, dst87_r, dst109_r, dst1211_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst6_r = HEVC_FILT_8TAP(dst76_r, dst98_r, dst1110_r, dst1312_r, filt_h0, + filt_h1, filt_h2, filt_h3); + dst7_r = HEVC_FILT_8TAP(dst87_r, dst109_r, dst1211_r, dst1413_r, + filt_h0, filt_h1, filt_h2, filt_h3); + + SRA_4V(dst0_r, dst1_r, dst2_r, dst3_r, 6); + SRA_4V(dst4_r, dst5_r, dst6_r, dst7_r, 6); + SRARI_W4_SW(dst0_r, dst1_r, dst2_r, dst3_r, 6); + SRARI_W4_SW(dst4_r, dst5_r, dst6_r, dst7_r, 6); + SAT_SW4_SW(dst0_r, dst1_r, dst2_r, dst3_r, 7); + SAT_SW4_SW(dst4_r, dst5_r, dst6_r, dst7_r, 7); + PCKEV_H2_SW(dst1_r, dst0_r, dst3_r, dst2_r, dst0_r, dst1_r); + PCKEV_H2_SW(dst5_r, dst4_r, dst7_r, dst6_r, dst4_r, dst5_r); + out0 = PCKEV_XORI128_UB(dst0_r, dst1_r); + out1 = PCKEV_XORI128_UB(dst4_r, dst5_r); + if (res == 2) { + ST_W2(out0, 0, 1, dst, dst_stride); + } else if(res == 4) { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + } else { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + ST_W2(out1, 0, 1, dst + 4 * dst_stride, dst_stride); + } + } } -static void hevc_hv_uni_8t_8multx2mult_msa(uint8_t *src, +static void hevc_hv_uni_8t_8multx2mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1475,7 +1564,7 @@ int32_t height, int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; @@ -1605,7 +1694,7 @@ } } -static void hevc_hv_uni_8t_8w_msa(uint8_t *src, +static void hevc_hv_uni_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1617,7 +1706,7 @@ filter_x, filter_y, height, 8); } -static void hevc_hv_uni_8t_12w_msa(uint8_t *src, +static void hevc_hv_uni_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1626,7 +1715,8 @@ int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src11, src12, src13, src14; @@ -1851,7 +1941,7 @@ } } -static void hevc_hv_uni_8t_16w_msa(uint8_t *src, +static void hevc_hv_uni_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1863,7 +1953,7 @@ filter_x, filter_y, height, 16); } -static void hevc_hv_uni_8t_24w_msa(uint8_t *src, +static void hevc_hv_uni_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1875,7 +1965,7 @@ filter_x, filter_y, height, 24); } -static void hevc_hv_uni_8t_32w_msa(uint8_t *src, +static void hevc_hv_uni_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1887,7 +1977,7 @@ filter_x, filter_y, height, 32); } -static void hevc_hv_uni_8t_48w_msa(uint8_t *src, +static void hevc_hv_uni_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1899,7 +1989,7 @@ filter_x, filter_y, height, 48); } -static void hevc_hv_uni_8t_64w_msa(uint8_t *src, +static void hevc_hv_uni_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1911,7 +2001,7 @@ filter_x, filter_y, height, 64); } -static void common_hz_4t_4x2_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1938,7 +2028,7 @@ ST_W2(out, 0, 1, dst, dst_stride); } -static void common_hz_4t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1965,7 +2055,7 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void common_hz_4t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -2000,7 +2090,7 @@ ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride); } -static void common_hz_4t_4x16_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x16_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -2048,7 +2138,7 @@ ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride); } -static void common_hz_4t_4w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2063,7 +2153,7 @@ } } -static void common_hz_4t_6w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2112,7 +2202,7 @@ ST_H2(out5, 2, 6, dst + 2 * dst_stride + 4, dst_stride); } -static void common_hz_4t_8x2mult_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_8x2mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2146,7 +2236,7 @@ } } -static void common_hz_4t_8x4mult_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_8x4mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2180,7 +2270,7 @@ } } -static void common_hz_4t_8w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2193,7 +2283,7 @@ } } -static void common_hz_4t_12w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2247,7 +2337,7 @@ } } -static void common_hz_4t_16w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2310,7 +2400,7 @@ } } -static void common_hz_4t_24w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2393,7 +2483,7 @@ } } -static void common_hz_4t_32w_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2461,7 +2551,7 @@ } } -static void common_vt_4t_4x2_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -2492,7 +2582,7 @@ ST_W2(out, 0, 1, dst, dst_stride); } -static void common_vt_4t_4x4multiple_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_4x4multiple_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2538,7 +2628,7 @@ } } -static void common_vt_4t_4w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2550,7 +2640,7 @@ } } -static void common_vt_4t_6w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2621,7 +2711,7 @@ ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); } -static void common_vt_4t_8x2_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_8x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -2647,7 +2737,7 @@ ST_D2(out, 0, 1, dst, dst_stride); } -static void common_vt_4t_8x6_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_8x6_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -2700,7 +2790,7 @@ } } -static void common_vt_4t_8x4mult_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_8x4mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2745,7 +2835,7 @@ } } -static void common_vt_4t_8w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2759,7 +2849,7 @@ } } -static void common_vt_4t_12w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2822,7 +2912,7 @@ } } -static void common_vt_4t_16w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2880,7 +2970,7 @@ } } -static void common_vt_4t_24w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -2991,7 +3081,7 @@ } } -static void common_vt_4t_32w_msa(uint8_t *src, int32_t src_stride, +static void common_vt_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -3084,7 +3174,7 @@ } } -static void hevc_hv_uni_4t_4x2_msa(uint8_t *src, +static void hevc_hv_uni_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3139,7 +3229,7 @@ ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_uni_4t_4x4_msa(uint8_t *src, +static void hevc_hv_uni_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3198,7 +3288,7 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hv_uni_4t_4multx8mult_msa(uint8_t *src, +static void hevc_hv_uni_4t_4multx8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3296,7 +3386,7 @@ } } -static void hevc_hv_uni_4t_4w_msa(uint8_t *src, +static void hevc_hv_uni_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3316,7 +3406,7 @@ } } -static void hevc_hv_uni_4t_6w_msa(uint8_t *src, +static void hevc_hv_uni_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3435,7 +3525,7 @@ ST_H8(out2, 0, 1, 2, 3, 4, 5, 6, 7, dst + 4, dst_stride); } -static void hevc_hv_uni_4t_8x2_msa(uint8_t *src, +static void hevc_hv_uni_4t_8x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3497,7 +3587,7 @@ ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_uni_4t_8multx4_msa(uint8_t *src, +static void hevc_hv_uni_4t_8multx4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3582,7 +3672,7 @@ } } -static void hevc_hv_uni_4t_8x6_msa(uint8_t *src, +static void hevc_hv_uni_4t_8x6_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3685,7 +3775,7 @@ ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hv_uni_4t_8multx4mult_msa(uint8_t *src, +static void hevc_hv_uni_4t_8multx4mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3695,7 +3785,7 @@ int32_t width8mult) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6; @@ -3799,7 +3889,7 @@ } } -static void hevc_hv_uni_4t_8w_msa(uint8_t *src, +static void hevc_hv_uni_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3822,7 +3912,7 @@ } } -static void hevc_hv_uni_4t_12w_msa(uint8_t *src, +static void hevc_hv_uni_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3831,7 +3921,8 @@ int32_t height) { uint32_t loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; @@ -3990,7 +4081,7 @@ } } -static void hevc_hv_uni_4t_16w_msa(uint8_t *src, +static void hevc_hv_uni_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4007,7 +4098,7 @@ } } -static void hevc_hv_uni_4t_24w_msa(uint8_t *src, +static void hevc_hv_uni_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4019,7 +4110,7 @@ filter_x, filter_y, height, 3); } -static void hevc_hv_uni_4t_32w_msa(uint8_t *src, +static void hevc_hv_uni_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4034,7 +4125,7 @@ #define UNI_MC_COPY(WIDTH) \ void ff_hevc_put_hevc_uni_pel_pixels##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -4057,7 +4148,7 @@ #define UNI_MC(PEL, DIR, WIDTH, TAP, DIR1, FILT_DIR) \ void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ @@ -4109,7 +4200,7 @@ #define UNI_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_uni_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ intptr_t mx, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevc_mc_uniw_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,15 +33,17 @@ out0_h, out1_h) \ { \ v4i32 in0_r_m, in0_l_m, in1_r_m, in1_l_m; \ + v8i16 zero = { 0 }; \ \ - ILVRL_H2_SW(in0_h, in0_h, in0_r_m, in0_l_m); \ - ILVRL_H2_SW(in1_h, in1_h, in1_r_m, in1_l_m); \ - DOTP_SH4_SW(in0_r_m, in1_r_m, in0_l_m, in1_l_m, wgt_w, wgt_w, wgt_w, \ - wgt_w, in0_r_m, in1_r_m, in0_l_m, in1_l_m); \ - SRAR_W4_SW(in0_r_m, in1_r_m, in0_l_m, in1_l_m, rnd_w); \ + ILVRL_H2_SW(zero, in0_h, in0_r_m, in0_l_m); \ + ILVRL_H2_SW(zero, in1_h, in1_r_m, in1_l_m); \ + MUL4(in0_r_m, wgt_w, in0_l_m, wgt_w, in1_r_m, wgt_w, in1_l_m, wgt_w, \ + in0_r_m, in0_l_m, in1_r_m, in1_l_m); \ + SRAR_W4_SW(in0_r_m, in0_l_m, in1_r_m, in1_l_m, rnd_w); \ + ADD4(in0_r_m, offset_h, in0_l_m, offset_h, in1_r_m, offset_h, in1_l_m, \ + offset_h, in0_r_m, in0_l_m, in1_r_m, in1_l_m); \ + CLIP_SW4_0_255(in0_r_m, in0_l_m, in1_r_m, in1_l_m); \ PCKEV_H2_SH(in0_l_m, in0_r_m, in1_l_m, in1_r_m, out0_h, out1_h); \ - ADDS_SH2_SH(out0_h, offset_h, out1_h, offset_h, out0_h, out1_h); \ - CLIP_SH2_0_255(out0_h, out1_h); \ } #define HEVC_UNIW_RND_CLIP4_MAX_SATU_H(in0_h, in1_h, in2_h, in3_h, wgt_w, \ @@ -54,7 +56,22 @@ out2_h, out3_h); \ } -static void hevc_uniwgt_copy_4w_msa(uint8_t *src, +#define HEVC_FILT_8TAP_4W_SH(in0, in1, in2, in3, filt0, filt1, \ + filt2, filt3, dst0, dst1) \ +{ \ + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; \ + ILVRL_B2_SH(zero, in0, tmp0, tmp4); \ + ILVRL_B2_SH(zero, in1, tmp1, tmp5); \ + ILVRL_B2_SH(zero, in2, tmp2, tmp6); \ + ILVRL_B2_SH(zero, in3, tmp3, tmp7); \ + dst0 = __msa_dotp_s_w((v8i16) tmp0, (v8i16) filt0); \ + dst1 = __msa_dotp_s_w((v8i16) tmp4, (v8i16) filt0); \ + DPADD_SH2_SW(tmp1, tmp5, filt1, filt1, dst0, dst1); \ + DPADD_SH2_SW(tmp2, tmp6, filt2, filt2, dst0, dst1); \ + DPADD_SH2_SW(tmp3, tmp7, filt3, filt3, dst0, dst1); \ +} + +static void hevc_uniwgt_copy_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -70,9 +87,8 @@ v8i16 dst0, dst1, dst2, dst3, offset_vec; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); if (2 == height) { @@ -83,12 +99,13 @@ dst0 = (v8i16) __msa_ilvr_b(zero, src0); dst0 <<= 6; - ILVRL_H2_SW(dst0, dst0, dst0_r, dst0_l); + ILVRL_H2_SW(zero, dst0, dst0_r, dst0_l); DOTP_SH2_SW(dst0_r, dst0_l, weight_vec, weight_vec, dst0_r, dst0_l); SRAR_W2_SW(dst0_r, dst0_l, rnd_vec); + dst0_r += offset_vec; + dst0_l += offset_vec; + CLIP_SW2_0_255(dst0_r, dst0_l); dst0 = __msa_pckev_h((v8i16) dst0_l, (v8i16) dst0_r); - dst0 += offset_vec; - CLIP_SH_0_255(dst0); out0 = (v16u8) __msa_pckev_b((v16i8) dst0, (v16i8) dst0); ST_W2(out0, 0, 1, dst, dst_stride); } else if (4 == height) { @@ -121,7 +138,7 @@ } } -static void hevc_uniwgt_copy_6w_msa(uint8_t *src, +static void hevc_uniwgt_copy_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -131,6 +148,7 @@ int32_t rnd_val) { uint32_t loop_cnt; + int32_t res = height & 0x07; uint64_t tp0, tp1, tp2, tp3; v16i8 zero = { 0 }; v16u8 out0, out1, out2, out3; @@ -138,9 +156,8 @@ v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, offset_vec; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = (height >> 3); loop_cnt--;) { @@ -181,9 +198,54 @@ ST_H2(out3, 2, 6, dst + 2 * dst_stride + 4, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD4(src, src_stride, tp0, tp1, tp2, tp3); + src += (4 * src_stride); + INSERT_D2_SB(tp0, tp1, src0); + INSERT_D2_SB(tp2, tp3, src1); + LD4(src, src_stride, tp0, tp1, tp2, tp3); + src += (4 * src_stride); + INSERT_D2_SB(tp0, tp1, src2); + INSERT_D2_SB(tp2, tp3, src3); + + ILVRL_B2_SH(zero, src0, dst0, dst1); + ILVRL_B2_SH(zero, src1, dst2, dst3); + ILVRL_B2_SH(zero, src2, dst4, dst5); + ILVRL_B2_SH(zero, src3, dst6, dst7); + + SLLI_4V(dst0, dst1, dst2, dst3, 6); + SLLI_4V(dst4, dst5, dst6, dst7, 6); + + HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, + offset_vec, rnd_vec, dst0, dst1, dst2, + dst3); + HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, + offset_vec, rnd_vec, dst4, dst5, dst6, + dst7); + PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + + if (res == 2) { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + } else if (res == 4) { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + } else { + ST_W2(out0, 0, 2, dst, dst_stride); + ST_H2(out0, 2, 6, dst + 4, dst_stride); + ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); + ST_H2(out1, 2, 6, dst + 2 * dst_stride + 4, dst_stride); + dst += (4 * dst_stride); + ST_W2(out2, 0, 2, dst, dst_stride); + ST_H2(out2, 2, 6, dst + 4, dst_stride); + } + } } -static void hevc_uniwgt_copy_8w_msa(uint8_t *src, +static void hevc_uniwgt_copy_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -200,9 +262,8 @@ v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, offset_vec; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); if (2 == height) { @@ -278,7 +339,7 @@ } } -static void hevc_uniwgt_copy_12w_msa(uint8_t *src, +static void hevc_uniwgt_copy_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -295,9 +356,8 @@ v16i8 zero = { 0 }; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = 4; loop_cnt--;) { @@ -323,7 +383,7 @@ } } -static void hevc_uniwgt_copy_16w_msa(uint8_t *src, +static void hevc_uniwgt_copy_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -339,9 +399,8 @@ v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, offset_vec; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = height >> 2; loop_cnt--;) { @@ -366,7 +425,7 @@ } } -static void hevc_uniwgt_copy_24w_msa(uint8_t *src, +static void hevc_uniwgt_copy_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -383,9 +442,8 @@ v8i16 dst8, dst9, dst10, dst11; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = (height >> 2); loop_cnt--;) { @@ -419,7 +477,7 @@ } } -static void hevc_uniwgt_copy_32w_msa(uint8_t *src, +static void hevc_uniwgt_copy_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -435,9 +493,8 @@ v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, offset_vec; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = (height >> 1); loop_cnt--;) { @@ -465,7 +522,7 @@ } } -static void hevc_uniwgt_copy_48w_msa(uint8_t *src, +static void hevc_uniwgt_copy_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -482,9 +539,8 @@ v8i16 dst6, dst7, dst8, dst9, dst10, dst11; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = (height >> 1); loop_cnt--;) { @@ -522,7 +578,7 @@ } } -static void hevc_uniwgt_copy_64w_msa(uint8_t *src, +static void hevc_uniwgt_copy_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -539,9 +595,8 @@ v8i16 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; v4i32 weight_vec, rnd_vec; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); - offset_vec = __msa_fill_h(offset); + offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); for (loop_cnt = (height >> 1); loop_cnt--;) { @@ -585,7 +640,7 @@ } } -static void hevc_hz_uniwgt_8t_4w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -596,33 +651,26 @@ int32_t rnd_val) { uint32_t loop_cnt; + uint32_t res = height & 0x07; v16u8 out0, out1; - v8i16 filt0, filt1, filt2, filt3; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; - v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10; - v16i8 mask0, mask1, mask2, mask3, vec11, vec12, vec13, vec14, vec15; - v8i16 filter_vec, dst01, dst23, dst45, dst67; - v8i16 dst0, dst1, dst2, dst3, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; + v8i16 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; + v16i8 mask0, mask1, mask2, mask3; + v8i16 filter_vec, filt0, filt1, filt2, filt3; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[16]); mask1 = mask0 + 2; @@ -632,8 +680,6 @@ for (loop_cnt = (height >> 3); loop_cnt--;) { LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); src += (8 * src_stride); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); - VSHF_B4_SB(src0, src1, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src2, src3, mask0, mask1, mask2, mask3, @@ -642,26 +688,81 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src6, src7, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst01 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst23 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst45 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst67 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst01, dst23, dst45, dst67, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); } + if (res) { + LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); + VSHF_B4_SB(src0, src1, mask0, mask1, mask2, mask3, + vec0, vec1, vec2, vec3); + VSHF_B4_SB(src2, src3, mask0, mask1, mask2, mask3, + vec4, vec5, vec6, vec7); + VSHF_B4_SB(src4, src5, mask0, mask1, mask2, mask3, + vec8, vec9, vec10, vec11); + VSHF_B4_SB(src6, src7, mask0, mask1, mask2, mask3, + vec12, vec13, vec14, vec15); + + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); + + if (res == 2) { + ST_W2(out0, 0, 1, dst, dst_stride); + } else if (res == 4) { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + } else { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + ST_W2(out1, 0, 1, dst + 4 * dst_stride, dst_stride); + } + } } -static void hevc_hz_uniwgt_8t_8w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -672,35 +773,27 @@ int32_t rnd_val) { uint32_t loop_cnt; + uint32_t res = height & 0x03; v16u8 out0, out1; v16i8 src0, src1, src2, src3; v8i16 filt0, filt1, filt2, filt3; v16i8 mask0, mask1, mask2, mask3; v8i16 filter_vec; - v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; + v8i16 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -710,7 +803,6 @@ for (loop_cnt = (height >> 2); loop_cnt--;) { LD_SB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -720,26 +812,57 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); dst += (4 * dst_stride); } + if (res) { + LD_SB2(src, src_stride, src0, src1); + + VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, + vec0, vec1, vec2, vec3); + VSHF_B4_SB(src1, src1, mask0, mask1, mask2, mask3, + vec4, vec5, vec6, vec7); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, vec0, vec1); + out0 = __msa_pckev_b((v16i8) vec1, (v16i8) vec0); + ST_D2(out0, 0, 1, dst, dst_stride); + } } -static void hevc_hz_uniwgt_8t_12w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -750,35 +873,26 @@ int32_t rnd_val) { uint32_t loop_cnt; - v16u8 out0, out1, out2; + v16u8 out0, out1; v8i16 filt0, filt1, filt2, filt3; - v16i8 src0, src1, src2, src3, src4, src5, src6, src7; + v16i8 src0, src1, src2, src3; v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; v8i16 filter_vec; - v8i16 dst01, dst23, dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3; + v4i32 dst00, dst01; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -789,51 +903,45 @@ mask6 = mask4 + 4; mask7 = mask4 + 6; - for (loop_cnt = (height >> 2); loop_cnt--;) { - LD_SB4(src, src_stride, src0, src1, src2, src3); - LD_SB4(src + 8, src_stride, src4, src5, src6, src7); - src += (4 * src_stride); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); + for (loop_cnt = (height >> 1); loop_cnt--;) { + LD_SB2(src, src_stride, src0, src1); + LD_SB2(src + 8, src_stride, src2, src3); + src += (2 * src_stride); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src1, src1, mask0, mask1, mask2, mask3, vec4, vec5, vec6, vec7); - VSHF_B4_SB(src2, src2, mask0, mask1, mask2, mask3, - vec8, vec9, vec10, vec11); - VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, - vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - VSHF_B4_SB(src4, src5, mask4, mask5, mask6, mask7, + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + VSHF_B4_SB(src2, src3, mask4, mask5, mask6, mask7, vec0, vec1, vec2, vec3); - VSHF_B4_SB(src6, src7, mask4, mask5, mask6, mask7, - vec4, vec5, vec6, vec7); - dst01 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst23 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst00, dst01); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst01, dst23, weight_vec, offset_vec, - rnd_vec, dst4, dst5); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL2(dst00, weight_vec, dst01, weight_vec, dst00, dst01); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W2_SW(dst00, dst01, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD2(dst00, offset_vec, dst01, offset_vec, dst00, dst01); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + CLIP_SW2_0_255(dst00, dst01); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, vec0, vec1); + vec2 = __msa_pckev_h((v8i16) dst01, (v8i16) dst00); + PCKEV_B2_UB(vec1, vec0, zero, vec2, out0, out1); - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); - ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); - ST_W4(out2, 0, 1, 2, 3, dst + 8, dst_stride); - dst += (4 * dst_stride); + ST_D2(out0, 0, 1, dst, dst_stride); + ST_W2(out1, 0, 1, dst + 8, dst_stride); + dst += (2 * dst_stride); } } -static void hevc_hz_uniwgt_8t_16w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -851,27 +959,19 @@ v8i16 filter_vec; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -882,7 +982,6 @@ LD_SB2(src, src_stride, src0, src2); LD_SB2(src + 8, src_stride, src1, src3); src += (2 * src_stride); - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -892,26 +991,36 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); ST_UB2(out0, out1, dst, dst_stride); dst += (2 * dst_stride); } } -static void hevc_hz_uniwgt_8t_24w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -928,27 +1037,21 @@ v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v8i16 filter_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -964,7 +1067,6 @@ src += src_stride; LD_SB2(src, 16, src2, src3); src += src_stride; - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src0, src1, mask4, mask5, mask6, mask7, @@ -973,38 +1075,53 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src2, src2, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); VSHF_B4_SB(src2, src3, mask4, mask5, mask6, mask7, vec0, vec1, vec2, vec3); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec4, vec5, vec6, vec7); - dst4 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst5 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst10, dst11); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11) + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, vec4, vec5); - PCKEV_B3_UB(dst1, dst0, dst4, dst3, dst5, dst2, out0, out1, out2); + PCKEV_B3_UB(vec1, vec0, vec4, vec3, vec5, vec2, out0, out1, out2); ST_UB2(out0, out1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 16, dst_stride); dst += (2 * dst_stride); } } -static void hevc_hz_uniwgt_8t_32w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1022,27 +1139,20 @@ v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; v8i16 filter_vec; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst10, dst11, dst12, dst13, dst14, dst15, dst16, dst17; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -1054,7 +1164,6 @@ src += src_stride; LD_SB4(src, 8, src4, src5, src6, src7); src += src_stride; - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1064,14 +1173,14 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); VSHF_B4_SB(src4, src4, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1081,24 +1190,44 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src7, src7, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst4 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst5 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst6 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst7 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, dst6, - dst7); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst10, dst11); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst12, dst13); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst14, dst15); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst16, dst17); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + MUL4(dst10, weight_vec, dst11, weight_vec, dst12, weight_vec, dst13, + weight_vec, dst10, dst11, dst12, dst13) + MUL4(dst14, weight_vec, dst15, weight_vec, dst16, weight_vec, dst17, + weight_vec, dst14, dst15, dst16, dst17); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + SRAR_W4_SW(dst10, dst11, dst12, dst13, rnd_vec); + SRAR_W4_SW(dst14, dst15, dst16, dst17, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + ADD4(dst10, offset_vec, dst11, offset_vec, dst12, offset_vec, dst13, + offset_vec, dst10, dst11, dst12, dst13); + ADD4(dst14, offset_vec, dst15, offset_vec, dst16, offset_vec, dst17, + offset_vec, dst14, dst15, dst16, dst17); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst10, dst11, dst12, dst13, dst14, dst15, dst16, dst17); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_H4_SH(dst11, dst10, dst13, dst12, dst15, dst14, dst17, dst16, + vec4, vec5, vec6, vec7); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); + PCKEV_B2_UB(vec5, vec4, vec7, vec6, out2, out3); ST_UB2(out0, out1, dst, 16); dst += dst_stride; ST_UB2(out2, out3, dst, 16); @@ -1106,7 +1235,7 @@ } } -static void hevc_hz_uniwgt_8t_48w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1123,28 +1252,21 @@ v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v8i16 filter_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -1159,7 +1281,6 @@ LD_SB3(src, 16, src0, src1, src2); src3 = LD_SB(src + 40); src += src_stride; - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1169,38 +1290,53 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src1, src2, mask4, mask5, mask6, mask7, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); VSHF_B4_SB(src2, src2, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec4, vec5, vec6, vec7); - dst4 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst5 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); - - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst10, dst11); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11) + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, vec4, vec5); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); + out2 = __msa_pckev_b((v16i8) vec5, (v16i8) vec4); ST_UB2(out0, out1, dst, 16); ST_UB(out2, dst + 32); dst += dst_stride; } } -static void hevc_hz_uniwgt_8t_64w_msa(uint8_t *src, +static void hevc_hz_uniwgt_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1210,7 +1346,7 @@ int32_t offset, int32_t rnd_val) { - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; uint32_t loop_cnt, cnt; v16u8 out0, out1; @@ -1219,27 +1355,20 @@ v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 filter_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 3; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -1258,7 +1387,6 @@ LD_SB2(src_tmp, 16, src0, src1); src2 = LD_SB(src_tmp + 24); src_tmp += 32; - XORI_B3_128_SB(src0, src1, src2); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1268,20 +1396,28 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src2, src2, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, - filt2, filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, - filt2, filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, - filt2, filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, - dst2, dst3); - - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst6, dst7); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); ST_UB2(out0, out1, dst_tmp, 16); dst_tmp += 32; } @@ -1291,7 +1427,7 @@ } } -static void hevc_vt_uniwgt_8t_4w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1302,6 +1438,7 @@ int32_t rnd_val) { int32_t loop_cnt; + int32_t res = height & 0x07; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; v16i8 src9, src10, src11, src12, src13, src14; @@ -1310,29 +1447,23 @@ v16i8 src1110_r, src1211_r, src1312_r, src1413_r; v16i8 src2110, src4332, src6554, src8776, src10998; v16i8 src12111110, src14131312; - v8i16 filter_vec, dst01, dst23, dst45, dst67; + v8i16 filter_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; v8i16 filt0, filt1, filt2, filt3; - v8i16 dst0, dst1, dst2, dst3, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 vec0, vec1, vec2, vec3; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (3 * src_stride); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += (7 * src_stride); @@ -1345,7 +1476,6 @@ ILVR_D3_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r, src2110, src4332, src6554); - XORI_B3_128_SB(src2110, src4332, src6554); for (loop_cnt = (height >> 3); loop_cnt--;) { LD_SB8(src, src_stride, @@ -1358,21 +1488,30 @@ ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r, src1413_r, src1312_r, src8776, src10998, src12111110, src14131312); - XORI_B4_128_SB(src8776, src10998, src12111110, src14131312); - dst01 = HEVC_FILT_8TAP_SH(src2110, src4332, src6554, src8776, filt0, - filt1, filt2, filt3); - dst23 = HEVC_FILT_8TAP_SH(src4332, src6554, src8776, src10998, filt0, - filt1, filt2, filt3); - dst45 = HEVC_FILT_8TAP_SH(src6554, src8776, src10998, src12111110, - filt0, filt1, filt2, filt3); - dst67 = HEVC_FILT_8TAP_SH(src8776, src10998, src12111110, src14131312, - filt0, filt1, filt2, filt3); + HEVC_FILT_8TAP_4W_SH(src2110, src4332, src6554, src8776, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src4332, src6554, src8776, src10998, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src6554, src8776, src10998, src12111110, + filt0, filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src8776, src10998, src12111110, src14131312, + filt0, filt1, filt2, filt3, dst6, dst7); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst01, dst23, dst45, dst67, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); @@ -1381,9 +1520,51 @@ src6554 = src14131312; src6 = src14; } + if (res) { + LD_SB8(src, src_stride, + src7, src8, src9, src10, src11, src12, src13, src14); + ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, + src76_r, src87_r, src98_r, src109_r); + ILVR_B4_SB(src11, src10, src12, src11, src13, src12, src14, src13, + src1110_r, src1211_r, src1312_r, src1413_r); + ILVR_D4_SB(src87_r, src76_r, src109_r, src98_r, src1211_r, src1110_r, + src1413_r, src1312_r, + src8776, src10998, src12111110, src14131312); + HEVC_FILT_8TAP_4W_SH(src2110, src4332, src6554, src8776, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src4332, src6554, src8776, src10998, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src6554, src8776, src10998, src12111110, + filt0, filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src8776, src10998, src12111110, src14131312, + filt0, filt1, filt2, filt3, dst6, dst7); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); + + if (res == 2) { + ST_W2(out0, 0, 1, dst, dst_stride); + } else if (res == 4) { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + } else { + ST_W4(out0, 0, 1, 2, 3, dst, dst_stride); + ST_W2(out1, 0, 1, dst + 4 * dst_stride, dst_stride); + } + } } -static void hevc_vt_uniwgt_8t_8w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1394,36 +1575,29 @@ int32_t rnd_val) { int32_t loop_cnt; + int32_t res = height & 0x03; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src10_r, src32_r, src54_r, src76_r, src98_r; v16i8 src21_r, src43_r, src65_r, src87_r, src109_r; v8i16 filt0, filt1, filt2, filt3; - v8i16 filter_vec; - v8i16 dst0, dst1, dst2, dst3, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, vec0, vec1, vec2, vec3; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (3 * src_stride); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r, src54_r, src21_r); @@ -1432,23 +1606,30 @@ for (loop_cnt = (height >> 2); loop_cnt--;) { LD_SB4(src, src_stride, src7, src8, src9, src10); src += (4 * src_stride); - XORI_B4_128_SB(src7, src8, src9, src10); ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r, src87_r, src98_r, src109_r); - dst0 = HEVC_FILT_8TAP_SH(src10_r, src32_r, src54_r, src76_r, filt0, - filt1, filt2, filt3); - dst1 = HEVC_FILT_8TAP_SH(src21_r, src43_r, src65_r, src87_r, filt0, - filt1, filt2, filt3); - dst2 = HEVC_FILT_8TAP_SH(src32_r, src54_r, src76_r, src98_r, filt0, - filt1, filt2, filt3); - dst3 = HEVC_FILT_8TAP_SH(src43_r, src65_r, src87_r, src109_r, filt0, - filt1, filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + HEVC_FILT_8TAP_4W_SH(src10_r, src32_r, src54_r, src76_r, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src21_r, src43_r, src65_r, src87_r, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src32_r, src54_r, src76_r, src98_r, + filt0, filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src43_r, src65_r, src87_r, src109_r, + filt0, filt1, filt2, filt3, dst6, dst7); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); dst += (4 * dst_stride); @@ -1460,9 +1641,26 @@ src65_r = src109_r; src6 = src10; } + if (res) { + LD_SB2(src, src_stride, src7, src8); + ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); + HEVC_FILT_8TAP_4W_SH(src10_r, src32_r, src54_r, src76_r, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src21_r, src43_r, src65_r, src87_r, filt0, + filt1, filt2, filt3, dst2, dst3); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, vec0, vec1); + out0 = __msa_pckev_b((v16i8) vec1, (v16i8) vec0); + ST_D2(out0, 0, 1, dst, dst_stride); + } } -static void hevc_vt_uniwgt_8t_12w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1481,32 +1679,24 @@ v16i8 src21_l, src43_l, src65_l, src87_l, src109_l; v16i8 src2110, src4332, src6554, src8776, src10998; v8i16 filt0, filt1, filt2, filt3; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 weight_vec_h, offset_vec, denom_vec, filter_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5; + v4i32 dst6, dst7, dst8, dst9, dst10, dst11; + v8i16 filter_vec, vec0, vec1, vec2, vec3, vec4, vec5; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (3 * src_stride); - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r, src54_r, src21_r); @@ -1520,7 +1710,6 @@ for (loop_cnt = 4; loop_cnt--;) { LD_SB4(src, src_stride, src7, src8, src9, src10); src += (4 * src_stride); - XORI_B4_128_SB(src7, src8, src9, src10); ILVR_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_r, src87_r, src98_r, src109_r); @@ -1528,26 +1717,40 @@ src76_l, src87_l, src98_l, src109_l); ILVR_D2_SB(src87_l, src76_l, src109_l, src98_l, src8776, src10998); - dst0 = HEVC_FILT_8TAP_SH(src10_r, src32_r, src54_r, src76_r, filt0, - filt1, filt2, filt3); - dst1 = HEVC_FILT_8TAP_SH(src21_r, src43_r, src65_r, src87_r, filt0, - filt1, filt2, filt3); - dst2 = HEVC_FILT_8TAP_SH(src32_r, src54_r, src76_r, src98_r, filt0, - filt1, filt2, filt3); - dst3 = HEVC_FILT_8TAP_SH(src43_r, src65_r, src87_r, src109_r, filt0, - filt1, filt2, filt3); - dst4 = HEVC_FILT_8TAP_SH(src2110, src4332, src6554, src8776, filt0, - filt1, filt2, filt3); - dst5 = HEVC_FILT_8TAP_SH(src4332, src6554, src8776, src10998, filt0, - filt1, filt2, filt3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); - - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + HEVC_FILT_8TAP_4W_SH(src10_r, src32_r, src54_r, src76_r, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src21_r, src43_r, src65_r, src87_r, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src32_r, src54_r, src76_r, src98_r, + filt0, filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src43_r, src65_r, src87_r, src109_r, + filt0, filt1, filt2, filt3, dst6, dst7); + HEVC_FILT_8TAP_4W_SH(src2110, src4332, src6554, src8776, + filt0, filt1, filt2, filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(src4332, src6554, src8776, src10998, + filt0, filt1, filt2, filt3, dst10, dst11); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, vec4, vec5); + PCKEV_B3_UB(vec1, vec0, vec3, vec2, vec5, vec4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_W4(out2, 0, 1, 2, 3, dst + 8, dst_stride); dst += (4 * dst_stride); @@ -1565,7 +1768,7 @@ } } -static void hevc_vt_uniwgt_8t_16multx4mult_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_16multx4mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1576,9 +1779,10 @@ int32_t rnd_val, int32_t weightmul16) { - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; int32_t loop_cnt, cnt; + int32_t res = height & 0x03; v16u8 out0, out1, out2, out3; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src10_r, src32_r, src54_r, src76_r; @@ -1587,28 +1791,22 @@ v16i8 src21_l, src43_l, src65_l, src87_l; v16i8 src98_r, src109_r, src98_l, src109_l; v8i16 filt0, filt1, filt2, filt3; - v8i16 filter_vec; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (3 * src_stride); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); + offset_vec = __msa_fill_w(offset); - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); filter_vec = LD_SH(filter); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); for (cnt = weightmul16; cnt--;) { src_tmp = src; @@ -1616,12 +1814,10 @@ LD_SB7(src_tmp, src_stride, src0, src1, src2, src3, src4, src5, src6); src_tmp += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); for (loop_cnt = (height >> 2); loop_cnt--;) { LD_SB4(src_tmp, src_stride, src7, src8, src9, src10); src_tmp += (4 * src_stride); - XORI_B4_128_SB(src7, src8, src9, src10); ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, src10_r, src32_r, src54_r, src21_r); @@ -1634,31 +1830,52 @@ ILVL_B4_SB(src7, src6, src8, src7, src9, src8, src10, src9, src76_l, src87_l, src98_l, src109_l); - dst0 = HEVC_FILT_8TAP_SH(src10_r, src32_r, src54_r, src76_r, filt0, - filt1, filt2, filt3); - dst1 = HEVC_FILT_8TAP_SH(src10_l, src32_l, src54_l, src76_l, filt0, - filt1, filt2, filt3); - dst2 = HEVC_FILT_8TAP_SH(src21_r, src43_r, src65_r, src87_r, filt0, - filt1, filt2, filt3); - dst3 = HEVC_FILT_8TAP_SH(src21_l, src43_l, src65_l, src87_l, filt0, - filt1, filt2, filt3); - dst4 = HEVC_FILT_8TAP_SH(src32_r, src54_r, src76_r, src98_r, filt0, - filt1, filt2, filt3); - dst5 = HEVC_FILT_8TAP_SH(src32_l, src54_l, src76_l, src98_l, filt0, - filt1, filt2, filt3); - dst6 = HEVC_FILT_8TAP_SH(src43_r, src65_r, src87_r, src109_r, filt0, - filt1, filt2, filt3); - dst7 = HEVC_FILT_8TAP_SH(src43_l, src65_l, src87_l, src109_l, filt0, - filt1, filt2, filt3); + HEVC_FILT_8TAP_4W_SH(src10_r, src32_r, src54_r, src76_r, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src10_l, src32_l, src54_l, src76_l, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src21_r, src43_r, src65_r, src87_r, filt0, + filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src21_l, src43_l, src65_l, src87_l, filt0, + filt1, filt2, filt3, dst6, dst7); + HEVC_FILT_8TAP_4W_SH(src32_r, src54_r, src76_r, src98_r, filt0, + filt1, filt2, filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(src32_l, src54_l, src76_l, src98_l, filt0, + filt1, filt2, filt3, dst10, dst11); + HEVC_FILT_8TAP_4W_SH(src43_r, src65_r, src87_r, src109_r, filt0, + filt1, filt2, filt3, dst12, dst13); + HEVC_FILT_8TAP_4W_SH(src43_l, src65_l, src87_l, src109_l, filt0, + filt1, filt2, filt3, dst14, dst15); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, dst15, + weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, dst15, + offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_H4_SH(dst9, dst8, dst11, dst10, dst13, dst12, dst15, + dst14, vec4, vec5, vec6, vec7); + PCKEV_B4_UB(vec1, vec0, vec3, vec2, vec5, vec4, vec7, vec6, + out0, out1, out2, out3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, - dst2, dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, - dst6, dst7); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); ST_UB4(out0, out1, out2, out3, dst_tmp, dst_stride); dst_tmp += (4 * dst_stride); @@ -1670,13 +1887,50 @@ src5 = src9; src6 = src10; } + if (res) { + LD_SB2(src_tmp, src_stride, src7, src8); + + ILVR_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, + src10_r, src32_r, src54_r, src21_r); + ILVR_B2_SB(src4, src3, src6, src5, src43_r, src65_r); + ILVL_B4_SB(src1, src0, src3, src2, src5, src4, src2, src1, + src10_l, src32_l, src54_l, src21_l); + ILVL_B2_SB(src4, src3, src6, src5, src43_l, src65_l); + ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); + ILVL_B2_SB(src7, src6, src8, src7, src76_l, src87_l); + + HEVC_FILT_8TAP_4W_SH(src10_r, src32_r, src54_r, src76_r, filt0, + filt1, filt2, filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(src10_l, src32_l, src54_l, src76_l, filt0, + filt1, filt2, filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(src21_r, src43_r, src65_r, src87_r, filt0, + filt1, filt2, filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(src21_l, src43_l, src65_l, src87_l, filt0, + filt1, filt2, filt3, dst6, dst7); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3) + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, dst7, + weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + vec0, vec1, vec2, vec3); + PCKEV_B2_UB(vec1, vec0, vec3, vec2, out0, out1); + + ST_UB2(out0, out1, dst_tmp, dst_stride); + } src += 16; dst += 16; } } -static void hevc_vt_uniwgt_8t_16w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1691,7 +1945,7 @@ offset, rnd_val, 1); } -static void hevc_vt_uniwgt_8t_24w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1709,7 +1963,7 @@ filter, 32, weight, offset, rnd_val); } -static void hevc_vt_uniwgt_8t_32w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1724,7 +1978,7 @@ offset, rnd_val, 2); } -static void hevc_vt_uniwgt_8t_48w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1739,7 +1993,7 @@ offset, rnd_val, 3); } -static void hevc_vt_uniwgt_8t_64w_msa(uint8_t *src, +static void hevc_vt_uniwgt_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1754,7 +2008,7 @@ offset, rnd_val, 4); } -static void hevc_hv_uniwgt_8t_4w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1774,20 +2028,21 @@ v8i16 filter_vec; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst30, dst41, dst52, dst63, dst66, dst97, dst108; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8, dst9, dst10; v8i16 dst10_r, dst32_r, dst54_r, dst76_r, dst98_r; v8i16 dst21_r, dst43_r, dst65_r, dst87_r, dst109_r; v4i32 dst0_r, dst1_r, dst2_r, dst3_r; - v4i32 weight_vec, offset_vec, rnd_vec, const_128, denom_vec; + v4i32 weight_vec, offset_vec, rnd_vec; v16i8 mask0 = LD_SB(ff_hevc_mask_arr + 16); + v8i16 zero = { 0 }; src -= ((3 * src_stride) + 3); filter_vec = LD_SH(filter_x); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W4_SH(filter_vec, filt_h0, filt_h1, filt_h2, filt_h3); mask1 = mask0 + 2; @@ -1797,15 +2052,9 @@ weight_vec = __msa_fill_w(weight); offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); - denom_vec = rnd_vec - 6; - - const_128 = __msa_ldi_w(128); - const_128 *= weight_vec; - offset_vec += __msa_srar_w(const_128, denom_vec); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); /* row 0 row 1 row 2 row 3 */ VSHF_B4_SB(src0, src3, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1814,39 +2063,41 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src3, src6, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst30 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst41 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst52 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst63 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, - filt3); - - ILVRL_H2_SH(dst41, dst30, dst10_r, dst43_r); - ILVRL_H2_SH(dst52, dst41, dst21_r, dst54_r); - ILVRL_H2_SH(dst63, dst52, dst32_r, dst65_r); - - dst66 = (v8i16) __msa_splati_d((v2i64) dst63, 1); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst3); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst1, dst4); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst2, dst5); + vec0 = __msa_ilvl_b((v16i8) zero, (v16i8) vec12); + vec1 = __msa_ilvl_b((v16i8) zero, (v16i8) vec13); + vec2 = __msa_ilvl_b((v16i8) zero, (v16i8) vec14); + vec3 = __msa_ilvl_b((v16i8) zero, (v16i8) vec15); + dst6 = __msa_dotp_s_w((v8i16) vec0, (v8i16) filt0); + dst6 = __msa_dpadd_s_w((v4i32) dst6, (v8i16) vec1, (v8i16) filt1); + dst6 = __msa_dpadd_s_w((v4i32) dst6, (v8i16) vec2, (v8i16) filt2); + dst6 = __msa_dpadd_s_w((v4i32) dst6, (v8i16) vec3, (v8i16) filt3); + + ILVEV_H2_SH(dst0, dst1, dst3, dst4, dst10_r, dst43_r); + ILVEV_H2_SH(dst1, dst2, dst4, dst5, dst21_r, dst54_r); + ILVEV_H2_SH(dst2, dst3, dst5, dst6, dst32_r, dst65_r); for (loop_cnt = height >> 2; loop_cnt--;) { LD_SB4(src, src_stride, src7, src8, src9, src10); src += (4 * src_stride); - XORI_B4_128_SB(src7, src8, src9, src10); VSHF_B4_SB(src7, src9, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src8, src10, mask0, mask1, mask2, mask3, vec4, vec5, vec6, vec7); - dst97 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst108 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - - dst76_r = __msa_ilvr_h(dst97, dst66); - ILVRL_H2_SH(dst108, dst97, dst87_r, dst109_r); - dst66 = (v8i16) __msa_splati_d((v2i64) dst97, 1); - dst98_r = __msa_ilvr_h(dst66, dst108); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst7, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst8, dst10); + + dst76_r = __msa_ilvev_h((v8i16) dst7, (v8i16) dst6); + ILVEV_H2_SH(dst7, dst8, dst9, dst10, dst87_r, dst109_r); + dst98_r = __msa_ilvev_h((v8i16) dst9, (v8i16) dst8); dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0, filt_h1, filt_h2, filt_h3); @@ -1875,11 +2126,11 @@ dst21_r = dst65_r; dst43_r = dst87_r; dst65_r = dst109_r; - dst66 = (v8i16) __msa_splati_d((v2i64) dst108, 1); + dst6 = dst10; } } -static void hevc_hv_uniwgt_8t_8multx2mult_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_8multx2mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -1892,37 +2143,36 @@ int32_t width) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; v8i16 filt0, filt1, filt2, filt3; - v4i32 filt_h0, filt_h1, filt_h2, filt_h3; + v8i16 filt_h0, filt_h1, filt_h2, filt_h3; v16i8 mask1, mask2, mask3; v8i16 filter_vec; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8; v4i32 dst0_r, dst0_l, dst1_r, dst1_l; v8i16 dst10_r, dst32_r, dst54_r, dst76_r; v8i16 dst10_l, dst32_l, dst54_l, dst76_l; v8i16 dst21_r, dst43_r, dst65_r, dst87_r; v8i16 dst21_l, dst43_l, dst65_l, dst87_l; - v4i32 weight_vec, offset_vec, rnd_vec, const_128, denom_vec; + v4i32 weight_vec, offset_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8, dst9, dst10; + v4i32 dst11, dst12, dst13, dst14, dst15; v16i8 mask0 = LD_SB(ff_hevc_mask_arr); + v8i16 zero = { 0 }; src -= ((3 * src_stride) + 3); weight_vec = __msa_fill_w(weight); offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); - denom_vec = rnd_vec - 6; - const_128 = __msa_ldi_w(128); - const_128 *= weight_vec; - offset_vec += __msa_srar_w(const_128, denom_vec); filter_vec = LD_SH(filter_x); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SW(filter_vec, filt0, filt1, filt2, filt3); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); @@ -1938,7 +2188,6 @@ LD_SB7(src_tmp, src_stride, src0, src1, src2, src3, src4, src5, src6); src_tmp += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1948,14 +2197,14 @@ vec8, vec9, vec10, vec11); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, + filt2, filt3, dst6, dst7); VSHF_B4_SB(src4, src4, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -1963,31 +2212,30 @@ vec4, vec5, vec6, vec7); VSHF_B4_SB(src6, src6, mask0, mask1, mask2, mask3, vec8, vec9, vec10, vec11); - dst4 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst5 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst6 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - - ILVR_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst2, dst1, - dst10_r, dst32_r, dst54_r, dst21_r); - ILVR_H2_SH(dst4, dst3, dst6, dst5, dst43_r, dst65_r); - ILVL_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst2, dst1, - dst10_l, dst32_l, dst54_l, dst21_l); - ILVL_H2_SH(dst4, dst3, dst6, dst5, dst43_l, dst65_l); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst10, dst11); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst12, dst13); + + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst32_r, dst32_l); + ILVEV_H2_SH(dst6, dst8, dst7, dst9, dst43_r, dst43_l); + ILVEV_H2_SH(dst8, dst10, dst9, dst11, dst54_r, dst54_l); + ILVEV_H2_SH(dst10, dst12, dst11, dst13, dst65_r, dst65_l); for (loop_cnt = height >> 1; loop_cnt--;) { LD_SB2(src_tmp, src_stride, src7, src8); src_tmp += 2 * src_stride; - XORI_B2_128_SB(src7, src8); VSHF_B4_SB(src7, src7, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); - dst7 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, + filt2, filt3, dst14, dst15); - ILVRL_H2_SH(dst7, dst6, dst76_r, dst76_l); + ILVEV_H2_SH(dst12, dst14, dst13, dst15, dst76_r, dst76_l); dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0, filt_h1, filt_h2, filt_h3); dst0_l = HEVC_FILT_8TAP(dst10_l, dst32_l, dst54_l, dst76_l, @@ -1998,10 +2246,10 @@ /* row 8 */ VSHF_B4_SB(src8, src8, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); - dst8 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, + filt2, filt3, dst0, dst1); - ILVRL_H2_SH(dst8, dst7, dst87_r, dst87_l); + ILVEV_H2_SH(dst14, dst0, dst15, dst1, dst87_r, dst87_l); dst1_r = HEVC_FILT_8TAP(dst21_r, dst43_r, dst65_r, dst87_r, filt_h0, filt_h1, filt_h2, filt_h3); dst1_l = HEVC_FILT_8TAP(dst21_l, dst43_l, dst65_l, dst87_l, @@ -2033,7 +2281,8 @@ dst21_l = dst43_l; dst43_l = dst65_l; dst65_l = dst87_l; - dst6 = dst8; + dst12 = dst0; + dst13 = dst1; } src += 8; @@ -2041,7 +2290,7 @@ } } -static void hevc_hv_uniwgt_8t_8w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2057,7 +2306,7 @@ offset, rnd_val, 8); } -static void hevc_hv_uniwgt_8t_12w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2069,25 +2318,28 @@ int32_t rnd_val) { uint32_t loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 mask0, mask1, mask2, mask3, mask4, mask5, mask6, mask7; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 vec8, vec9, vec10, vec11, vec12, vec13, vec14, vec15; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 dst30, dst41, dst52, dst63, dst66, dst97, dst108; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; v8i16 filt0, filt1, filt2, filt3, filt_h0, filt_h1, filt_h2, filt_h3; v8i16 dst10_r, dst32_r, dst54_r, dst76_r, dst10_l, dst32_l, dst54_l; v8i16 dst98_r, dst21_r, dst43_r, dst65_r, dst87_r, dst109_r; v8i16 dst76_l, filter_vec; v4i32 dst0_r, dst0_l, dst1_r, dst2_r, dst3_r; - v4i32 weight_vec, offset_vec, rnd_vec, const_128, denom_vec; + v4i32 weight_vec, offset_vec, rnd_vec; + v8i16 zero = { 0 }; src -= ((3 * src_stride) + 3); filter_vec = LD_SH(filter_x); - SPLATI_H4_SH(filter_vec, 0, 1, 2, 3, filt0, filt1, filt2, filt3); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W4_SH(filter_vec, filt0, filt1, filt2, filt3); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); @@ -2097,11 +2349,6 @@ weight_vec = __msa_fill_w(weight); offset_vec = __msa_fill_w(offset); rnd_vec = __msa_fill_w(rnd_val); - denom_vec = rnd_vec - 6; - - const_128 = __msa_ldi_w(128); - const_128 *= weight_vec; - offset_vec += __msa_srar_w(const_128, denom_vec); mask0 = LD_SB(ff_hevc_mask_arr); mask1 = mask0 + 2; @@ -2113,7 +2360,6 @@ LD_SB7(src_tmp, src_stride, src0, src1, src2, src3, src4, src5, src6); src_tmp += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); /* row 0 row 1 row 2 row 3 */ VSHF_B4_SB(src0, src0, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); @@ -2122,38 +2368,37 @@ vec11); VSHF_B4_SB(src3, src3, mask0, mask1, mask2, mask3, vec12, vec13, vec14, vec15); - dst0 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst1 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst2 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst3 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, - filt2, filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst1); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst2, dst3); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst4, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, + filt2, filt3, dst6, dst7); VSHF_B4_SB(src4, src4, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); VSHF_B4_SB(src5, src5, mask0, mask1, mask2, mask3, vec4, vec5, vec6, vec7); VSHF_B4_SB(src6, src6, mask0, mask1, mask2, mask3, vec8, vec9, vec10, vec11); - dst4 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst5 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst6 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst8, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst10, dst11); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst12, dst13); for (loop_cnt = 16; loop_cnt--;) { src7 = LD_SB(src_tmp); - src7 = (v16i8) __msa_xori_b((v16u8) src7, 128); src_tmp += src_stride; VSHF_B4_SB(src7, src7, mask0, mask1, mask2, mask3, vec0, vec1, vec2, vec3); - dst7 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - ILVRL_H2_SH(dst1, dst0, dst10_r, dst10_l); - ILVRL_H2_SH(dst3, dst2, dst32_r, dst32_l); - ILVRL_H2_SH(dst5, dst4, dst54_r, dst54_l); - ILVRL_H2_SH(dst7, dst6, dst76_r, dst76_l); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst14, dst15); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst32_r, dst32_l); + ILVEV_H2_SH(dst8, dst10, dst9, dst11, dst54_r, dst54_l); + ILVEV_H2_SH(dst12, dst14, dst13, dst15, dst76_r, dst76_l); dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0, filt_h1, filt_h2, filt_h3); @@ -2171,13 +2416,20 @@ ST_D1(out, 0, dst_tmp); dst_tmp += dst_stride; - dst0 = dst1; - dst1 = dst2; - dst2 = dst3; - dst3 = dst4; - dst4 = dst5; - dst5 = dst6; - dst6 = dst7; + dst0 = dst2; + dst1 = dst3; + dst2 = dst4; + dst3 = dst5; + dst4 = dst6; + dst5 = dst7; + dst6 = dst8; + dst7 = dst9; + dst8 = dst10; + dst9 = dst11; + dst10 = dst12; + dst11 = dst13; + dst12 = dst14; + dst13 = dst15; } src += 8; @@ -2190,7 +2442,6 @@ LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += (7 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); VSHF_B4_SB(src0, src3, mask4, mask5, mask6, mask7, vec0, vec1, vec2, vec3); VSHF_B4_SB(src1, src4, mask4, mask5, mask6, mask7, vec4, vec5, vec6, vec7); @@ -2198,38 +2449,33 @@ vec11); VSHF_B4_SB(src3, src6, mask4, mask5, mask6, mask7, vec12, vec13, vec14, vec15); - dst30 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst41 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - dst52 = HEVC_FILT_8TAP_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, - filt3); - dst63 = HEVC_FILT_8TAP_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, - filt3); - ILVRL_H2_SH(dst41, dst30, dst10_r, dst43_r); - ILVRL_H2_SH(dst52, dst41, dst21_r, dst54_r); - ILVRL_H2_SH(dst63, dst52, dst32_r, dst65_r); - - dst66 = (v8i16) __msa_splati_d((v2i64) dst63, 1); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst0, dst3); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst1, dst4); + HEVC_FILT_8TAP_4W_SH(vec8, vec9, vec10, vec11, filt0, filt1, filt2, + filt3, dst2, dst5); + HEVC_FILT_8TAP_4W_SH(vec12, vec13, vec14, vec15, filt0, filt1, filt2, + filt3, dst3, dst6); + ILVEV_H2_SH(dst0, dst1, dst3, dst4, dst10_r, dst43_r); + ILVEV_H2_SH(dst1, dst2, dst4, dst5, dst21_r, dst54_r); + ILVEV_H2_SH(dst2, dst3, dst5, dst6, dst32_r, dst65_r); for (loop_cnt = 4; loop_cnt--;) { LD_SB4(src, src_stride, src7, src8, src9, src10); src += (4 * src_stride); - XORI_B4_128_SB(src7, src8, src9, src10); VSHF_B4_SB(src7, src9, mask4, mask5, mask6, mask7, vec0, vec1, vec2, vec3); VSHF_B4_SB(src8, src10, mask4, mask5, mask6, mask7, vec4, vec5, vec6, vec7); - dst97 = HEVC_FILT_8TAP_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, - filt3); - dst108 = HEVC_FILT_8TAP_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, - filt3); - - dst76_r = __msa_ilvr_h(dst97, dst66); - ILVRL_H2_SH(dst108, dst97, dst87_r, dst109_r); - dst66 = (v8i16) __msa_splati_d((v2i64) dst97, 1); - dst98_r = __msa_ilvr_h(dst66, dst108); + HEVC_FILT_8TAP_4W_SH(vec0, vec1, vec2, vec3, filt0, filt1, filt2, + filt3, dst7, dst9); + HEVC_FILT_8TAP_4W_SH(vec4, vec5, vec6, vec7, filt0, filt1, filt2, + filt3, dst8, dst10); + + ILVEV_H2_SH(dst6, dst7, dst7, dst8, dst76_r, dst87_r); + ILVEV_H2_SH(dst9, dst10, dst8, dst9, dst109_r, dst98_r); dst0_r = HEVC_FILT_8TAP(dst10_r, dst32_r, dst54_r, dst76_r, filt_h0, filt_h1, filt_h2, filt_h3); @@ -2258,11 +2504,11 @@ dst21_r = dst65_r; dst43_r = dst87_r; dst65_r = dst109_r; - dst66 = (v8i16) __msa_splati_d((v2i64) dst108, 1); + dst6 = dst10; } } -static void hevc_hv_uniwgt_8t_16w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2278,7 +2524,7 @@ offset, rnd_val, 16); } -static void hevc_hv_uniwgt_8t_24w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2294,7 +2540,7 @@ offset, rnd_val, 24); } -static void hevc_hv_uniwgt_8t_32w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2310,7 +2556,7 @@ offset, rnd_val, 32); } -static void hevc_hv_uniwgt_8t_48w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_48w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2326,7 +2572,7 @@ offset, rnd_val, 48); } -static void hevc_hv_uniwgt_8t_64w_msa(uint8_t *src, +static void hevc_hv_uniwgt_8t_64w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2342,7 +2588,7 @@ offset, rnd_val, 64); } -static void hevc_hz_uniwgt_4t_4x2_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2352,55 +2598,46 @@ int32_t rnd_val) { v16u8 out; - v8i16 filt0, filt1; + v8i16 filt0, filt1, filter_vec; v16i8 src0, src1, vec0, vec1; + v8i16 tmp0, tmp1, tmp2, tmp3; v16i8 mask1; - v8i16 dst0; - v4i32 dst0_r, dst0_l; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1; + v4i32 weight_vec, rnd_vec, offset_vec; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[16]); + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); mask1 = mask0 + 2; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); LD_SB2(src, src_stride, src0, src1); - XORI_B2_128_SB(src0, src1); VSHF_B2_SB(src0, src1, src0, src1, mask0, mask1, vec0, vec1); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); - ILVRL_H2_SW(dst0, dst0, dst0_r, dst0_l); - DOTP_SH2_SW(dst0_r, dst0_l, weight_vec, weight_vec, dst0_r, dst0_l); - SRAR_W2_SW(dst0_r, dst0_l, rnd_vec); - dst0 = __msa_pckev_h((v8i16) dst0_l, (v8i16) dst0_r); - dst0 = __msa_adds_s_h(dst0, offset_vec); - CLIP_SH_0_255(dst0); - out = (v16u8) __msa_pckev_b((v16i8) dst0, (v16i8) dst0); + MUL2(dst0, weight_vec, dst1, weight_vec, dst0, dst1); + SRAR_W2_SW(dst0, dst1, rnd_vec); + ADD2(dst0, offset_vec, dst1, offset_vec, dst0, dst1); + CLIP_SW2_0_255(dst0, dst1); + vec0 = __msa_pckev_h((v8i16) dst1, (v8i16) dst0); + out = (v16u8) __msa_pckev_b((v16i8) vec0, (v16i8) vec0); ST_W2(out, 0, 1, dst, dst_stride); dst += (4 * dst_stride); } -static void hevc_hz_uniwgt_4t_4x4_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2413,51 +2650,52 @@ v8i16 filt0, filt1; v16i8 src0, src1, src2, src3; v16i8 mask1, vec0, vec1, vec2, vec3; - v8i16 dst0, dst1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3; + v8i16 filter_vec; + v4i32 weight_vec, rnd_vec, offset_vec; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[16]); + v8i16 zero = { 0 }; src -= 1; /* rearranging filter */ filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - mask1 = mask0 + 2; - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); + mask1 = mask0 + 2; LD_SB4(src, src_stride, src0, src1, src2, src3); - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B2_SB(src0, src1, src0, src1, mask0, mask1, vec0, vec1); VSHF_B2_SB(src2, src3, src2, src3, mask0, mask1, vec2, vec3); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst0, dst1, weight_vec, offset_vec, rnd_vec, - dst0, dst1); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + tmp0 = __msa_pckev_h((v8i16) dst1, (v8i16) dst0); + tmp1 = __msa_pckev_h((v8i16) dst3, (v8i16) dst2); - out = (v16u8) __msa_pckev_b((v16i8) dst1, (v16i8) dst0); + out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_W4(out, 0, 1, 2, 3, dst, dst_stride); - dst += (4 * dst_stride); } -static void hevc_hz_uniwgt_4t_4x8multiple_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_4x8multiple_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2472,31 +2710,22 @@ v8i16 filt0, filt1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v16i8 mask1, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; v8i16 filter_vec; - v8i16 weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 weight_vec, rnd_vec, offset_vec; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[16]); + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; @@ -2504,28 +2733,49 @@ LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); src += (8 * src_stride); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); - VSHF_B2_SB(src0, src1, src0, src1, mask0, mask1, vec0, vec1); VSHF_B2_SB(src2, src3, src2, src3, mask0, mask1, vec2, vec3); VSHF_B2_SB(src4, src5, src4, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src7, src6, src7, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + tmp0 = __msa_pckev_h((v8i16) dst1, (v8i16) dst0); + tmp1 = __msa_pckev_h((v8i16) dst3, (v8i16) dst2); + tmp2 = __msa_pckev_h((v8i16) dst5, (v8i16) dst4); + tmp3 = __msa_pckev_h((v8i16) dst7, (v8i16) dst6); + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); } } -static void hevc_hz_uniwgt_4t_4w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2548,7 +2798,7 @@ } } -static void hevc_hz_uniwgt_4t_6w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2559,65 +2809,101 @@ int32_t rnd_val) { v16u8 out0, out1, out2, out3; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v16i8 mask0 = LD_SB(ff_hevc_mask_arr); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec0, vec1); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec2, vec3); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec4, vec5); VSHF_B2_SB(src7, src7, src7, src7, mask0, mask1, vec6, vec7); - dst4 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, - weight_vec, offset_vec, rnd_vec, - dst4, dst5, dst6, dst7); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst12 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); + PCKEV_B2_UB(tmp5, tmp4, tmp7, tmp6, out2, out3); ST_W2(out0, 0, 2, dst, dst_stride); ST_H2(out0, 2, 6, dst + 4, dst_stride); ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); @@ -2629,7 +2915,7 @@ ST_H2(out3, 2, 6, dst + 2 * dst_stride + 4, dst_stride); } -static void hevc_hz_uniwgt_4t_8x2_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_8x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2639,52 +2925,53 @@ int32_t rnd_val) { v16u8 out; - v8i16 filt0, filt1, dst0, dst1; + v8i16 filter_vec, filt0, filt1; v16i8 src0, src1; v16i8 mask0 = LD_SB(ff_hevc_mask_arr); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v4i32 dst0, dst1, dst2, dst3; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); - + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; LD_SB2(src, src_stride, src0, src1); - XORI_B2_128_SB(src0, src1); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst0, dst1, weight_vec, offset_vec, rnd_vec, - dst0, dst1); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); - out = (v16u8) __msa_pckev_b((v16i8) dst1, (v16i8) dst0); + out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_hz_uniwgt_4t_8x4_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_8x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2696,52 +2983,67 @@ v16u8 out0, out1; v16i8 src0, src1, src2, src3; v16i8 mask0, mask1, vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 filt0, filt1, dst0, dst1, dst2, dst3; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; LD_SB4(src, src_stride, src0, src1, src2, src3); - XORI_B4_128_SB(src0, src1, src2, src3); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_hz_uniwgt_4t_8x6_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_8x6_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2751,40 +3053,31 @@ int32_t rnd_val) { v16u8 out0, out1, out2; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 src0, src1, src2, src3, src4, src5; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[0]); v16i8 mask1; v16i8 vec11; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; LD_SB6(src, src_stride, src0, src1, src2, src3, src4, src5); - XORI_B6_128_SB(src0, src1, src2, src3, src4, src5); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); @@ -2792,26 +3085,60 @@ VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec8, vec9); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec10, vec11); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec8, vec9, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec10, vec11, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec8, tmp0, tmp1); + ILVRL_B2_SH(zero, vec9, tmp2, tmp3); + ILVRL_B2_SH(zero, vec10, tmp4, tmp5); + ILVRL_B2_SH(zero, vec11, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, rnd_vec, - dst4, dst5); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hz_uniwgt_4t_8x8multiple_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_8x8multiple_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2822,76 +3149,113 @@ int32_t rnd_val) { uint32_t loop_cnt; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16u8 out0, out1, out2, out3; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[0]); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; for (loop_cnt = (height >> 3); loop_cnt--;) { LD_SB8(src, src_stride, src0, src1, src2, src3, src4, src5, src6, src7); src += (8 * src_stride); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec0, vec1); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec2, vec3); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec4, vec5); VSHF_B2_SB(src7, src7, src7, src7, mask0, mask1, vec6, vec7); - dst4 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, - weight_vec, offset_vec, rnd_vec, - dst4, dst5, dst6, dst7); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst12 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); + PCKEV_B2_UB(tmp5, tmp4, tmp7, tmp6, out2, out3); ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride); dst += (8 * dst_stride); } } -static void hevc_hz_uniwgt_4t_8w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2917,7 +3281,7 @@ } } -static void hevc_hz_uniwgt_4t_12w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -2929,37 +3293,29 @@ { uint32_t loop_cnt; v16u8 out0, out1, out2; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 src0, src1, src2, src3; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[0]); v16i8 mask2 = { 8, 9, 9, 10, 10, 11, 11, 12, 24, 25, 25, 26, 26, 27, 27, 28 }; v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v16i8 mask3, vec11; - v4i32 weight_vec, rnd_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; mask3 = mask2 + 2; @@ -2968,36 +3324,69 @@ LD_SB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); - XORI_B4_128_SB(src0, src1, src2, src3); - VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); VSHF_B2_SB(src0, src1, src0, src1, mask2, mask3, vec8, vec9); VSHF_B2_SB(src2, src3, src2, src3, mask2, mask3, vec10, vec11); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec8, vec9, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec10, vec11, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec8, tmp0, tmp1); + ILVRL_B2_SH(zero, vec9, tmp2, tmp3); + ILVRL_B2_SH(zero, vec10, tmp4, tmp5); + ILVRL_B2_SH(zero, vec11, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_W4(out2, 0, 1, 2, 3, dst + 8, dst_stride); dst += (4 * dst_stride); } } -static void hevc_hz_uniwgt_4t_16w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3010,33 +3399,25 @@ uint32_t loop_cnt; v16u8 out0, out1, out2, out3; v16i8 src0, src1, src2, src3, src4, src5, src6, src7; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[0]); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; @@ -3045,34 +3426,77 @@ LD_SB4(src + 8, src_stride, src1, src3, src5, src7); src += (4 * src_stride); - XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); - VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec0, vec1); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec2, vec3); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec4, vec5); VSHF_B2_SB(src7, src7, src7, src7, mask0, mask1, vec6, vec7); - dst4 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, - weight_vec, offset_vec, rnd_vec, - dst4, dst5, dst6, dst7); - - PCKEV_B4_UB(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst12 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B4_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, tmp7, tmp6, out0, out1, out2, out3); ST_UB4(out0, out1, out2, out3, dst, dst_stride); @@ -3080,7 +3504,7 @@ } } -static void hevc_hz_uniwgt_4t_24w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3093,31 +3517,24 @@ uint32_t loop_cnt; v16u8 out0, out1, out2; v16i8 src0, src1, src2, src3; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 mask0, mask1, mask2, mask3; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); - weight = weight & 0x0000FFFF; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask0 = LD_SB(&ff_hevc_mask_arr[0]); mask1 = mask0 + 2; @@ -3129,36 +3546,69 @@ LD_SB2(src + 16, src_stride, src1, src3); src += (2 * src_stride); - XORI_B4_128_SB(src0, src1, src2, src3); - VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src0, src1, src0, src1, mask2, mask3, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src2, src3, src2, src3, mask2, mask3, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec0, vec1); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec2, vec3); - dst4 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_UB2(out0, out1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 16, dst_stride); dst += (2 * dst_stride); } } -static void hevc_hz_uniwgt_4t_32w_msa(uint8_t *src, +static void hevc_hz_uniwgt_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3171,33 +3621,25 @@ uint32_t loop_cnt; v16u8 out0, out1, out2, out3; v16i8 src0, src1, src2, src3, src4, src5; - v8i16 filt0, filt1; + v8i16 filter_vec, filt0, filt1; v16i8 mask0 = LD_SB(&ff_hevc_mask_arr[0]); v16i8 mask1, mask2, mask3; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= 1; filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); - - weight = weight & 0x0000FFFF; + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); mask1 = mask0 + 2; mask2 = mask0 + 8; @@ -3210,34 +3652,78 @@ LD_SB2(src, 16, src3, src4); src5 = LD_SB(src + 24); src += src_stride; - XORI_B6_128_SB(src0, src1, src2, src3, src4, src5); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src0, src1, src0, src1, mask2, mask3, vec2, vec3); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec4, vec5); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec6, vec7); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src3, src4, src3, src4, mask2, mask3, vec2, vec3); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec4, vec5); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec6, vec7); - dst4 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, - weight_vec, offset_vec, rnd_vec, - dst4, dst5, dst6, dst7); - - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst12 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B4_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, tmp7, tmp6, + out0, out1, out2, out3); ST_UB2(out0, out1, dst, 16); dst += dst_stride; ST_UB2(out2, out3, dst, 16); @@ -3245,7 +3731,7 @@ } } -static void hevc_vt_uniwgt_4t_4x2_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3260,47 +3746,41 @@ v16i8 src2110, src4332; v8i16 dst0; v4i32 dst0_r, dst0_l; - v8i16 filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v8i16 tmp0, tmp1, tmp2, tmp3; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB5(src, src_stride, src0, src1, src2, src3, src4); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVR_D2_SB(src21_r, src10_r, src43_r, src32_r, src2110, src4332); - XORI_B2_128_SB(src2110, src4332); - dst0 = HEVC_FILT_4TAP_SH(src2110, src4332, filt0, filt1); - ILVRL_H2_SW(dst0, dst0, dst0_r, dst0_l); - DOTP_SH2_SW(dst0_r, dst0_l, weight_vec, weight_vec, dst0_r, dst0_l); + ILVRL_B2_SH(zero, src2110, tmp0, tmp1); + ILVRL_B2_SH(zero, src4332, tmp2, tmp3); + + dst0_r = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst0_l = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + + MUL2(dst0_r, weight_vec, dst0_l, weight_vec, dst0_r, dst0_l); SRAR_W2_SW(dst0_r, dst0_l, rnd_vec); + ADD2(dst0_r, offset_vec, dst0_l, offset_vec, dst0_r, dst0_l); + CLIP_SW2_0_255(dst0_r, dst0_l); dst0 = __msa_pckev_h((v8i16) dst0_l, (v8i16) dst0_r); - dst0 = __msa_adds_s_h(dst0, offset_vec); - CLIP_SH_0_255(dst0); out = (v16u8) __msa_pckev_b((v16i8) dst0, (v16i8) dst0); ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_vt_uniwgt_4t_4x4_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3313,30 +3793,21 @@ v16i8 src0, src1, src2, src3, src4, src5, src6; v16i8 src10_r, src32_r, src54_r, src21_r, src43_r, src65_r; v16i8 src2110, src4332, src6554; - v8i16 dst0, dst1; - v8i16 filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + v8i16 filter_vec, filt0, filt1; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); @@ -3344,17 +3815,29 @@ src32_r, src43_r, src54_r, src65_r); ILVR_D3_SB(src21_r, src10_r, src43_r, src32_r, src65_r, src54_r, src2110, src4332, src6554); - XORI_B3_128_SB(src2110, src4332, src6554); - dst0 = HEVC_FILT_4TAP_SH(src2110, src4332, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src4332, src6554, filt0, filt1); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst0, dst1, weight_vec, offset_vec, rnd_vec, - dst0, dst1); - out = (v16u8) __msa_pckev_b((v16i8) dst1, (v16i8) dst0); + ILVRL_B2_SH(zero, src2110, tmp0, tmp1); + ILVRL_B2_SH(zero, src4332, tmp2, tmp3); + ILVRL_B2_SH(zero, src6554, tmp4, tmp5); + + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp4, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp5, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_vt_uniwgt_4t_4x8multiple_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_4x8multiple_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3371,35 +3854,26 @@ v16i8 src21_r, src43_r, src65_r, src87_r, src109_r; v16i8 src2110, src4332, src6554, src8776; v16i8 src10998; - v8i16 dst0, dst1, dst2, dst3, filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 filter_vec, filt0, filt1; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); src2110 = (v16i8) __msa_ilvr_d((v2i64) src21_r, (v2i64) src10_r); - src2110 = (v16i8) __msa_xori_b((v16u8) src2110, 128); for (loop_cnt = (height >> 3); loop_cnt--;) { LD_SB8(src, src_stride, @@ -3411,17 +3885,36 @@ ILVR_B2_SB(src9, src8, src10, src9, src98_r, src109_r); ILVR_D4_SB(src43_r, src32_r, src65_r, src54_r, src87_r, src76_r, src109_r, src98_r, src4332, src6554, src8776, src10998); - XORI_B4_128_SB(src4332, src6554, src8776, src10998); - dst0 = HEVC_FILT_4TAP_SH(src2110, src4332, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src4332, src6554, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src6554, src8776, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src8776, src10998, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + ILVRL_B2_SH(zero, src2110, tmp0, tmp1); + ILVRL_B2_SH(zero, src4332, tmp2, tmp3); + ILVRL_B2_SH(zero, src6554, tmp4, tmp5); + ILVRL_B2_SH(zero, src8776, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp4, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp5, filt0, filt1); + ILVRL_B2_SH(zero, src10998, tmp0, tmp1); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp0, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp1, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); @@ -3430,7 +3923,7 @@ } } -static void hevc_vt_uniwgt_4t_4w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3453,7 +3946,7 @@ } } -static void hevc_vt_uniwgt_4t_6w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3467,59 +3960,90 @@ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src10_r, src32_r, src21_r, src43_r; v16i8 src54_r, src65_r, src76_r, src87_r, src98_r, src109_r; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); - XORI_B3_128_SB(src0, src1, src2); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVR_B2_SB(src5, src4, src6, src5, src54_r, src65_r); ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); ILVR_B2_SB(src9, src8, src10, src9, src98_r, src109_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src54_r, src76_r, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src65_r, src87_r, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(src76_r, src98_r, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src87_r, src109_r, filt0, filt1); - - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, - weight_vec, offset_vec, rnd_vec, - dst0, dst1, dst2, dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, - weight_vec, offset_vec, rnd_vec, - dst4, dst5, dst6, dst7); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src76_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src87_r, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src98_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src109_r, tmp2, tmp3); + dst12 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); + PCKEV_B2_UB(tmp5, tmp4, tmp7, tmp6, out2, out3); ST_W2(out0, 0, 2, dst, dst_stride); ST_H2(out0, 2, 6, dst + 4, dst_stride); ST_W2(out1, 0, 2, dst + 2 * dst_stride, dst_stride); @@ -3531,7 +4055,7 @@ ST_H2(out3, 2, 6, dst + 2 * dst_stride + 4, dst_stride); } -static void hevc_vt_uniwgt_4t_8x2_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_8x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3543,46 +4067,48 @@ v16u8 out; v16i8 src0, src1, src2, src3, src4; v16i8 src10_r, src32_r, src21_r, src43_r; - v8i16 dst0, dst1; - v8i16 filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 filter_vec, filt0, filt1; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB5(src, src_stride, src0, src1, src2, src3, src4); - XORI_B5_128_SB(src0, src1, src2, src3, src4); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst0, dst1, weight_vec, offset_vec, rnd_vec, - dst0, dst1); + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); - out = (v16u8) __msa_pckev_b((v16i8) dst1, (v16i8) dst0); + out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_vt_uniwgt_4t_8x4_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_8x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3595,49 +4121,60 @@ v16i8 src0, src1, src2, src3, src4; v16i8 src10_r, src32_r, src21_r, src43_r; v16i8 src5, src6, src54_r, src65_r; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); - src += (3 * src_stride); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVR_B2_SB(src5, src4, src6, src5, src54_r, src65_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); } -static void hevc_vt_uniwgt_4t_8x6_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_8x6_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3650,57 +4187,79 @@ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8; v16i8 src10_r, src32_r, src54_r, src76_r; v16i8 src21_r, src43_r, src65_r, src87_r; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5; - v8i16 filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 filter_vec, filt0, filt1; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); LD_SB6(src, src_stride, src3, src4, src5, src6, src7, src8); - XORI_B3_128_SB(src0, src1, src2); - XORI_B6_128_SB(src3, src4, src5, src6, src7, src8); ILVR_B4_SB(src1, src0, src2, src1, src3, src2, src4, src3, src10_r, src21_r, src32_r, src43_r); ILVR_B4_SB(src5, src4, src6, src5, src7, src6, src8, src7, src54_r, src65_r, src76_r, src87_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src54_r, src76_r, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src65_r, src87_r, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, rnd_vec, - dst4, dst5); - PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src76_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src87_r, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_vt_uniwgt_4t_8x8mult_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_8x8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3715,61 +4274,94 @@ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 src10_r, src32_r, src21_r, src43_r; v16i8 src54_r, src65_r, src76_r, src87_r, src98_r, src109_r; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); for (loop_cnt = (height >> 3); loop_cnt--;) { LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); src += (8 * src_stride); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVR_B2_SB(src5, src4, src6, src5, src54_r, src65_r); ILVR_B2_SB(src7, src6, src8, src7, src76_r, src87_r); ILVR_B2_SB(src9, src8, src10, src9, src98_r, src109_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src54_r, src76_r, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src65_r, src87_r, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(src76_r, src98_r, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src87_r, src109_r, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, dst6, - dst7); - PCKEV_B2_UB(dst1, dst0, dst3, dst2, out0, out1); - PCKEV_B2_UB(dst5, dst4, dst7, dst6, out2, out3); + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src76_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src87_r, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src98_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src109_r, tmp2, tmp3); + dst12 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); + PCKEV_B2_UB(tmp5, tmp4, tmp7, tmp6, out2, out3); ST_D8(out0, out1, out2, out3, 0, 1, 0, 1, 0, 1, 0, 1, dst, dst_stride); dst += (8 * dst_stride); @@ -3779,7 +4371,7 @@ } } -static void hevc_vt_uniwgt_4t_8w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3805,7 +4397,7 @@ } } -static void hevc_vt_uniwgt_4t_12w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3823,34 +4415,25 @@ v16i8 src2110, src4332; v16i8 src54_r, src76_r, src98_r, src65_r, src87_r, src109_r; v16i8 src76_l, src98_l, src87_l, src109_l, src6554, src8776, src10998; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8; - v8i16 dst9, dst10, dst11, filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8; + v4i32 dst9, dst10, dst11; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (1 * src_stride); - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVL_B2_SB(src1, src0, src2, src1, src10_l, src21_l); src2110 = (v16i8) __msa_ilvr_d((v2i64) src21_l, (v2i64) src10_l); @@ -3858,24 +4441,58 @@ for (loop_cnt = 2; loop_cnt--;) { LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); src += (8 * src_stride); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); ILVRL_B2_SB(src3, src2, src32_r, src32_l); ILVRL_B2_SB(src4, src3, src43_r, src43_l); ILVRL_B2_SB(src5, src4, src54_r, src54_l); ILVRL_B2_SB(src6, src5, src65_r, src65_l); src4332 = (v16i8) __msa_ilvr_d((v2i64) src43_l, (v2i64) src32_l); src6554 = (v16i8) __msa_ilvr_d((v2i64) src65_l, (v2i64) src54_l); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src2110, src4332, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src4332, src6554, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst4, dst5, weight_vec, offset_vec, - rnd_vec, dst4, dst5); + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src2110, tmp4, tmp5); + ILVRL_B2_SH(zero, src4332, tmp6, tmp7); + ILVRL_B2_SH(zero, src6554, tmp8, tmp9); + dst8 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp6, tmp8, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp7, tmp9, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, dst0, dst1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, dst2, dst3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, dst4, dst5); + PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_W4(out2, 0, 1, 2, 3, dst + 8, dst_stride); @@ -3887,18 +4504,51 @@ ILVRL_B2_SB(src10, src9, src109_r, src109_l); src8776 = (v16i8) __msa_ilvr_d((v2i64) src87_l, (v2i64) src76_l); src10998 = (v16i8) __msa_ilvr_d((v2i64) src109_l, (v2i64) src98_l); - dst6 = HEVC_FILT_4TAP_SH(src54_r, src76_r, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src65_r, src87_r, filt0, filt1); - dst8 = HEVC_FILT_4TAP_SH(src76_r, src98_r, filt0, filt1); - dst9 = HEVC_FILT_4TAP_SH(src87_r, src109_r, filt0, filt1); - dst10 = HEVC_FILT_4TAP_SH(src6554, src8776, filt0, filt1); - dst11 = HEVC_FILT_4TAP_SH(src8776, src10998, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst6, dst7, dst8, dst9, weight_vec, - offset_vec, rnd_vec, dst6, dst7, dst8, - dst9); - HEVC_UNIW_RND_CLIP2_MAX_SATU_H(dst10, dst11, weight_vec, offset_vec, - rnd_vec, dst10, dst11); - PCKEV_B3_UB(dst7, dst6, dst9, dst8, dst11, dst10, out3, out4, out5); + + ILVRL_B2_SH(zero, src76_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src87_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src98_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src109_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src8776, tmp4, tmp5); + ILVRL_B2_SH(zero, src10998, tmp6, tmp7); + ILVRL_B2_SH(zero, src6554, tmp8, tmp9); + dst8 = HEVC_FILT_4TAP_SW(tmp8, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp9, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + CLIP_SW4_0_255(dst8, dst9, dst10, dst11); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, dst0, dst1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, dst2, dst3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, dst4, dst5); + + PCKEV_B3_UB(dst1, dst0, dst3, dst2, dst5, dst4, out3, out4, out5); ST_D4(out3, out4, 0, 1, 0, 1, dst, dst_stride); ST_W4(out5, 0, 1, 2, 3, dst + 8, dst_stride); dst += (4 * dst_stride); @@ -3910,7 +4560,7 @@ } } -static void hevc_vt_uniwgt_4t_16w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -3926,60 +4576,94 @@ v16i8 src10_r, src32_r, src21_r, src43_r; v16i8 src10_l, src32_l, src21_l, src43_l; v16i8 src54_r, src54_l, src65_r, src65_l, src6; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVL_B2_SB(src1, src0, src2, src1, src10_l, src21_l); for (loop_cnt = (height >> 2); loop_cnt--;) { LD_SB4(src, src_stride, src3, src4, src5, src6); src += (4 * src_stride); - XORI_B4_128_SB(src3, src4, src5, src6); ILVRL_B2_SB(src3, src2, src32_r, src32_l); ILVRL_B2_SB(src4, src3, src43_r, src43_l); ILVRL_B2_SB(src5, src4, src54_r, src54_l); ILVRL_B2_SB(src6, src5, src65_r, src65_l); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src10_l, src32_l, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src21_l, src43_l, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(src32_l, src54_l, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src43_l, src65_l, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, dst6, - dst7); - PCKEV_B4_UB(dst4, dst0, dst5, dst1, dst6, dst2, dst7, dst3, out0, out1, + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src10_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_l, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_l, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_l, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_l, tmp2, tmp3); + dst12 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B4_UB(tmp4, tmp0, tmp5, tmp1, tmp6, tmp2, tmp7, tmp3, out0, out1, out2, out3); ST_UB4(out0, out1, out2, out3, dst, dst_stride); dst += (4 * dst_stride); @@ -3992,7 +4676,7 @@ } } -static void hevc_vt_uniwgt_4t_24w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4009,36 +4693,27 @@ v16i8 src10_r, src32_r, src54_r, src21_r, src43_r, src65_r; v16i8 src10_l, src32_l, src54_l, src21_l, src43_l, src65_l; v16i8 src87_r, src98_r, src109_r, src1110_r, src1211_r, src1312_r; - v8i16 filt0, filt1; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8, dst9, dst10; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec, dst11; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v4i32 dst16, dst17, dst18, dst19, dst20, dst21, dst22, dst23; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); LD_SB3(src + 16, src_stride, src7, src8, src9); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); - XORI_B3_128_SB(src7, src8, src9); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVL_B2_SB(src1, src0, src2, src1, src10_l, src21_l); ILVR_B2_SB(src8, src7, src9, src8, src87_r, src98_r); @@ -4047,38 +4722,103 @@ LD_SB4(src, src_stride, src3, src4, src5, src6); LD_SB4(src + 16, src_stride, src10, src11, src12, src13); src += (4 * src_stride); - XORI_B4_128_SB(src3, src4, src5, src6); - XORI_B4_128_SB(src10, src11, src12, src13); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVL_B2_SB(src3, src2, src4, src3, src32_l, src43_l); ILVRL_B2_SB(src5, src4, src54_r, src54_l); ILVRL_B2_SB(src6, src5, src65_r, src65_l); ILVR_B2_SB(src10, src9, src11, src10, src109_r, src1110_r); ILVR_B2_SB(src12, src11, src13, src12, src1211_r, src1312_r); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src32_r, src54_r, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src43_r, src65_r, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src10_l, src32_l, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src21_l, src43_l, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(src32_l, src54_l, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src43_l, src65_l, filt0, filt1); - dst8 = HEVC_FILT_4TAP_SH(src87_r, src109_r, filt0, filt1); - dst9 = HEVC_FILT_4TAP_SH(src98_r, src1110_r, filt0, filt1); - dst10 = HEVC_FILT_4TAP_SH(src109_r, src1211_r, filt0, filt1); - dst11 = HEVC_FILT_4TAP_SH(src1110_r, src1312_r, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, dst6, - dst7); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst8, dst9, dst10, dst11, weight_vec, - offset_vec, rnd_vec, dst8, dst9, dst10, - dst11); - PCKEV_B4_UB(dst4, dst0, dst5, dst1, dst6, dst2, dst7, dst3, out0, out1, + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_r, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src10_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_l, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_l, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_l, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src54_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src65_l, tmp2, tmp3); + dst12 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + ILVRL_B2_SH(zero, src87_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src98_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src109_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src1110_r, tmp6, tmp7); + dst16 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst17 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst18 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst19 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src1211_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src1312_r, tmp2, tmp3); + dst20 = HEVC_FILT_4TAP_SW(tmp4, tmp0, filt0, filt1); + dst21 = HEVC_FILT_4TAP_SW(tmp5, tmp1, filt0, filt1); + dst22 = HEVC_FILT_4TAP_SW(tmp6, tmp2, filt0, filt1); + dst23 = HEVC_FILT_4TAP_SW(tmp7, tmp3, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + MUL4(dst16, weight_vec, dst17, weight_vec, dst18, weight_vec, dst19, + weight_vec, dst16, dst17, dst18, dst19); + MUL4(dst20, weight_vec, dst21, weight_vec, dst22, weight_vec, + dst23, weight_vec, dst20, dst21, dst22, dst23); + SRAR_W4_SW(dst16, dst17, dst18, dst19, rnd_vec); + SRAR_W4_SW(dst20, dst21, dst22, dst23, rnd_vec); + ADD4(dst16, offset_vec, dst17, offset_vec, dst18, offset_vec, dst19, + offset_vec, dst16, dst17, dst18, dst19); + ADD4(dst20, offset_vec, dst21, offset_vec, dst22, offset_vec, + dst23, offset_vec, dst20, dst21, dst22, dst23); + CLIP_SW8_0_255(dst16, dst17, dst18, dst19, dst20, dst21, dst22, dst23); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B4_UB(tmp4, tmp0, tmp5, tmp1, tmp6, tmp2, tmp7, tmp3, out0, out1, out2, out3); - PCKEV_B2_UB(dst9, dst8, dst11, dst10, out4, out5); + + PCKEV_H2_SH(dst17, dst16, dst19, dst18, tmp0, tmp1); + PCKEV_H2_SH(dst21, dst20, dst23, dst22, tmp2, tmp3); + + PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out4, out5); ST_UB4(out0, out1, out2, out3, dst, dst_stride); ST_D4(out4, out5, 0, 1, 0, 1, dst + 16, dst_stride); dst += (4 * dst_stride); @@ -4094,7 +4834,7 @@ } } -static void hevc_vt_uniwgt_4t_32w_msa(uint8_t *src, +static void hevc_vt_uniwgt_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4109,37 +4849,28 @@ v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9; v16i8 src10_r, src32_r, src76_r, src98_r; v16i8 src21_r, src43_r, src65_r, src87_r; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; v16i8 src10_l, src32_l, src76_l, src98_l; v16i8 src21_l, src43_l, src65_l, src87_l; - v8i16 filt0, filt1; - v8i16 filter_vec, weight_vec_h, offset_vec, denom_vec; - v4i32 weight_vec, rnd_vec; + v8i16 filter_vec, filt0, filt1; + v4i32 weight_vec, rnd_vec, offset_vec; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v4i32 dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 zero = { 0 }; src -= src_stride; - weight = weight & 0x0000FFFF; - weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - weight *= 128; - rnd_val -= 6; - - weight_vec_h = __msa_fill_h(weight); - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val); - - weight_vec_h = __msa_srar_h(weight_vec_h, denom_vec); - offset_vec = __msa_adds_s_h(offset_vec, weight_vec_h); + offset_vec = __msa_fill_w(offset); filter_vec = LD_SH(filter); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); LD_SB3(src, src_stride, src0, src1, src2); LD_SB3(src + 16, src_stride, src5, src6, src7); src += (3 * src_stride); - XORI_B6_128_SB(src0, src1, src2, src5, src6, src7); ILVR_B2_SB(src1, src0, src2, src1, src10_r, src21_r); ILVL_B2_SB(src1, src0, src2, src1, src10_l, src21_l); ILVR_B2_SB(src6, src5, src7, src6, src65_r, src76_r); @@ -4149,26 +4880,75 @@ LD_SB2(src, src_stride, src3, src4); LD_SB2(src + 16, src_stride, src8, src9); src += (2 * src_stride); - XORI_B4_128_SB(src3, src4, src8, src9); ILVR_B2_SB(src3, src2, src4, src3, src32_r, src43_r); ILVL_B2_SB(src3, src2, src4, src3, src32_l, src43_l); ILVRL_B2_SB(src8, src7, src87_r, src87_l); ILVRL_B2_SB(src9, src8, src98_r, src98_l); - dst0 = HEVC_FILT_4TAP_SH(src10_r, src32_r, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(src21_r, src43_r, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(src10_l, src32_l, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(src21_l, src43_l, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(src65_r, src87_r, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(src76_r, src98_r, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(src65_l, src87_l, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(src76_l, src98_l, filt0, filt1); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst0, dst1, dst2, dst3, weight_vec, - offset_vec, rnd_vec, dst0, dst1, dst2, - dst3); - HEVC_UNIW_RND_CLIP4_MAX_SATU_H(dst4, dst5, dst6, dst7, weight_vec, - offset_vec, rnd_vec, dst4, dst5, dst6, - dst7); - PCKEV_B4_UB(dst2, dst0, dst3, dst1, dst6, dst4, dst7, dst5, out0, out1, + + ILVRL_B2_SH(zero, src10_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_r, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + + ILVRL_B2_SH(zero, src10_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src21_l, tmp2, tmp3); + ILVRL_B2_SH(zero, src32_l, tmp4, tmp5); + ILVRL_B2_SH(zero, src43_l, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + + ILVRL_B2_SH(zero, src65_r, tmp0, tmp1); + ILVRL_B2_SH(zero, src76_r, tmp2, tmp3); + ILVRL_B2_SH(zero, src87_r, tmp4, tmp5); + ILVRL_B2_SH(zero, src98_r, tmp6, tmp7); + dst8 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst11 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, src65_l, tmp0, tmp1); + ILVRL_B2_SH(zero, src76_l, tmp2, tmp3); + ILVRL_B2_SH(zero, src87_l, tmp4, tmp5); + ILVRL_B2_SH(zero, src98_l, tmp6, tmp7); + dst12 = HEVC_FILT_4TAP_SW(tmp0, tmp4, filt0, filt1); + dst13 = HEVC_FILT_4TAP_SW(tmp1, tmp5, filt0, filt1); + dst14 = HEVC_FILT_4TAP_SW(tmp2, tmp6, filt0, filt1); + dst15 = HEVC_FILT_4TAP_SW(tmp3, tmp7, filt0, filt1); + + MUL4(dst0, weight_vec, dst1, weight_vec, dst2, weight_vec, dst3, + weight_vec, dst0, dst1, dst2, dst3); + MUL4(dst4, weight_vec, dst5, weight_vec, dst6, weight_vec, + dst7, weight_vec, dst4, dst5, dst6, dst7); + SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, + dst7, offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); + + MUL4(dst8, weight_vec, dst9, weight_vec, dst10, weight_vec, dst11, + weight_vec, dst8, dst9, dst10, dst11); + MUL4(dst12, weight_vec, dst13, weight_vec, dst14, weight_vec, + dst15, weight_vec, dst12, dst13, dst14, dst15); + SRAR_W4_SW(dst8, dst9, dst10, dst11, rnd_vec); + SRAR_W4_SW(dst12, dst13, dst14, dst15, rnd_vec); + ADD4(dst8, offset_vec, dst9, offset_vec, dst10, offset_vec, dst11, + offset_vec, dst8, dst9, dst10, dst11); + ADD4(dst12, offset_vec, dst13, offset_vec, dst14, offset_vec, + dst15, offset_vec, dst12, dst13, dst14, dst15); + CLIP_SW8_0_255(dst8, dst9, dst10, dst11, dst12, dst13, dst14, dst15); + + PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); + PCKEV_H2_SH(dst5, dst4, dst7, dst6, tmp2, tmp3); + PCKEV_H2_SH(dst9, dst8, dst11, dst10, tmp4, tmp5); + PCKEV_H2_SH(dst13, dst12, dst15, dst14, tmp6, tmp7); + PCKEV_B4_UB(tmp2, tmp0, tmp3, tmp1, tmp6, tmp4, tmp7, tmp5, out0, out1, out2, out3); ST_UB2(out0, out2, dst, 16); dst += dst_stride; @@ -4188,7 +4968,7 @@ } } -static void hevc_hv_uniwgt_4t_4x2_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_4x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4205,54 +4985,59 @@ v16i8 mask1; v8i16 filt_h0, filt_h1, filter_vec, tmp; v16i8 vec0, vec1, vec2, vec3, vec4, vec5; - v8i16 dst20, dst31, dst42, dst10, dst32, dst21, dst43; - v8i16 offset_vec, const_128, denom_vec; - v4i32 dst0, dst1, weight_vec, rnd_vec; + v8i16 dst10, dst21, dst32, dst43; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB5(src, src_stride, src0, src1, src2, src3, src4); - XORI_B5_128_SB(src0, src1, src2, src3, src4); VSHF_B2_SB(src0, src2, src0, src2, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src3, src1, src3, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src4, src2, src4, mask0, mask1, vec4, vec5); - dst20 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst31 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst42 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - ILVRL_H2_SH(dst31, dst20, dst10, dst32); - ILVRL_H2_SH(dst42, dst31, dst21, dst43); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVL_B2_SH(zero, vec4, zero, vec5, tmp1, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + + ILVEV_H2_SH(dst0, dst1, dst2, dst3, dst10, dst32); + ILVEV_H2_SH(dst1, dst2, dst3, dst4, dst21, dst43); dst0 = HEVC_FILT_4TAP(dst10, dst32, filt_h0, filt_h1); dst1 = HEVC_FILT_4TAP(dst21, dst43, filt_h0, filt_h1); dst0 >>= 6; dst1 >>= 6; MUL2(dst0, weight_vec, dst1, weight_vec, dst0, dst1); SRAR_W2_SW(dst0, dst1, rnd_vec); + ADD2(dst0, offset_vec, dst1, offset_vec, dst0, dst1); + CLIP_SW2_0_255(dst0, dst1); tmp = __msa_pckev_h((v8i16) dst1, (v8i16) dst0); - tmp += offset_vec; - CLIP_SH_0_255(tmp); out = (v16u8) __msa_pckev_b((v16i8) tmp, (v16i8) tmp); ST_W2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_uniwgt_4t_4x4_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4265,47 +5050,55 @@ v16u8 out; v16i8 src0, src1, src2, src3, src4, src5, src6; v8i16 filt0, filt1; - v8i16 filt_h0, filt_h1, filter_vec, tmp0, tmp1; + v8i16 filt_h0, filt_h1, filter_vec; v16i8 mask0 = LD_SB(ff_hevc_mask_arr + 16); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst30, dst41, dst52, dst63, dst10, dst32, dst54, dst21, dst43, dst65; - v8i16 offset_vec, const_128, denom_vec; - v4i32 dst0, dst1, dst2, dst3, weight_vec, rnd_vec; + v8i16 dst10, dst32, dst54, dst21, dst43, dst65; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); VSHF_B2_SB(src0, src3, src0, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src4, src1, src4, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src5, src2, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src6, src3, src6, mask0, mask1, vec6, vec7); - dst30 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst41 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst52 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst63 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - ILVRL_H2_SH(dst41, dst30, dst10, dst43); - ILVRL_H2_SH(dst52, dst41, dst21, dst54); - ILVRL_H2_SH(dst63, dst52, dst32, dst65); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst4 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVL_B2_SH(zero, vec6, zero, vec7, tmp5, tmp7); + dst2 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst0, dst1, dst3, dst4, dst10, dst43); + ILVEV_H2_SH(dst1, dst2, dst4, dst5, dst21, dst54); + ILVEV_H2_SH(dst2, dst3, dst5, dst6, dst32, dst65); dst0 = HEVC_FILT_4TAP(dst10, dst32, filt_h0, filt_h1); dst1 = HEVC_FILT_4TAP(dst21, dst43, filt_h0, filt_h1); dst2 = HEVC_FILT_4TAP(dst32, dst54, filt_h0, filt_h1); @@ -4314,14 +5107,15 @@ MUL2(dst0, weight_vec, dst1, weight_vec, dst0, dst1); MUL2(dst2, weight_vec, dst3, weight_vec, dst2, dst3); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + CLIP_SW4_0_255(dst0, dst1, dst2, dst3); PCKEV_H2_SH(dst1, dst0, dst3, dst2, tmp0, tmp1); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - CLIP_SH2_0_255(tmp0, tmp1); out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void hevc_hv_uniwgt_4t_4multx8mult_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_4multx8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4338,65 +5132,78 @@ v8i16 filt0, filt1; v16i8 mask0 = LD_SB(ff_hevc_mask_arr + 16); v16i8 mask1; - v8i16 filt_h0, filt_h1, filter_vec, tmp0, tmp1, tmp2, tmp3; + v8i16 filter_vec, filt_h0, filt_h1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst10, dst21, dst22, dst73, dst84, dst95, dst106; v8i16 dst10_r, dst32_r, dst54_r, dst76_r; v8i16 dst21_r, dst43_r, dst65_r, dst87_r; - v8i16 dst98_r, dst109_r, offset_vec, const_128, denom_vec; - v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, weight_vec, rnd_vec; + v8i16 dst98_r, dst109_r; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8, dst9, dst10; + v4i32 offset_vec, weight_vec, rnd_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); VSHF_B2_SB(src0, src1, src0, src1, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src2, src1, src2, mask0, mask1, vec2, vec3); - dst10 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst21 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - ILVRL_H2_SH(dst21, dst10, dst10_r, dst21_r); - dst22 = (v8i16) __msa_splati_d((v2i64) dst21, 1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVL_B2_SH(zero, vec2, zero, vec3, tmp5, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + ILVEV_H2_SH(dst0, dst1, dst1, dst2, dst10_r, dst21_r); for (loop_cnt = height >> 3; loop_cnt--;) { LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); src += (8 * src_stride); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); VSHF_B2_SB(src3, src7, src3, src7, mask0, mask1, vec0, vec1); VSHF_B2_SB(src4, src8, src4, src8, mask0, mask1, vec2, vec3); VSHF_B2_SB(src5, src9, src5, src9, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src10, src6, src10, mask0, mask1, vec6, vec7); - dst73 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst84 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst95 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst106 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst32_r = __msa_ilvr_h(dst73, dst22); - ILVRL_H2_SH(dst84, dst73, dst43_r, dst87_r); - ILVRL_H2_SH(dst95, dst84, dst54_r, dst98_r); - ILVRL_H2_SH(dst106, dst95, dst65_r, dst109_r); - dst22 = (v8i16) __msa_splati_d((v2i64) dst73, 1); - dst76_r = __msa_ilvr_h(dst22, dst106); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst3 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst8 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst5 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + dst32_r = __msa_ilvev_h(dst3, dst2); + ILVEV_H2_SH(dst3, dst4, dst7, dst8, dst43_r, dst87_r); + ILVEV_H2_SH(dst4, dst5, dst8, dst9, dst54_r, dst98_r); + ILVEV_H2_SH(dst5, dst6, dst9, dst10, dst65_r, dst109_r); + dst76_r = __msa_ilvev_h(dst7, dst6); dst0 = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst1 = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); dst2 = HEVC_FILT_4TAP(dst32_r, dst54_r, filt_h0, filt_h1); @@ -4413,22 +5220,24 @@ MUL2(dst6, weight_vec, dst7, weight_vec, dst6, dst7); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD4(dst0, offset_vec, dst1, offset_vec, dst2, offset_vec, dst3, + offset_vec, dst0, dst1, dst2, dst3); + ADD4(dst4, offset_vec, dst5, offset_vec, dst6, offset_vec, dst7, + offset_vec, dst4, dst5, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); dst10_r = dst98_r; dst21_r = dst109_r; - dst22 = (v8i16) __msa_splati_d((v2i64) dst106, 1); + dst2 = dst10; } } -static void hevc_hv_uniwgt_4t_4w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4454,7 +5263,7 @@ } } -static void hevc_hv_uniwgt_4t_6w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_6w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4472,75 +5281,103 @@ v16i8 mask1; v8i16 filt_h0, filt_h1, filter_vec; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dsth0, dsth1, dsth2, dsth3, dsth4, dsth5, dsth6, dsth7, dsth8, dsth9; - v8i16 dsth10, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8, dst9; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v8i16 dst10_r, dst32_r, dst54_r, dst76_r, dst98_r, dst21_r, dst43_r; v8i16 dst65_r, dst87_r, dst109_r, dst10_l, dst32_l, dst54_l, dst76_l; v8i16 dst98_l, dst21_l, dst43_l, dst65_l, dst87_l, dst109_l; v8i16 dst1021_l, dst3243_l, dst5465_l, dst7687_l, dst98109_l; - v8i16 offset_vec, const_128, denom_vec; v4i32 dst0_r, dst1_r, dst2_r, dst3_r, dst4_r, dst5_r, dst6_r, dst7_r; - v4i32 dst0_l, dst1_l, dst2_l, dst3_l, weight_vec, rnd_vec; + v4i32 dst0_l, dst1_l, dst2_l, dst3_l, weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); - dsth0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dsth1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dsth2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - ILVRL_H2_SH(dsth1, dsth0, dst10_r, dst10_l); - ILVRL_H2_SH(dsth2, dsth1, dst21_r, dst21_l); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec2, vec3); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec6, vec7); - dsth3 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dsth4 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dsth5 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dsth6 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst6 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst8 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst32_r, dst32_l); + ILVEV_H2_SH(dst6, dst8, dst7, dst9, dst43_r, dst43_l); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst8, dst0, dst9, dst1, dst54_r, dst54_l); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst65_r, dst65_l); VSHF_B2_SB(src7, src7, src7, src7, mask0, mask1, vec0, vec1); VSHF_B2_SB(src8, src8, src8, src8, mask0, mask1, vec2, vec3); VSHF_B2_SB(src9, src9, src9, src9, mask0, mask1, vec4, vec5); VSHF_B2_SB(src10, src10, src10, src10, mask0, mask1, vec6, vec7); - dsth7 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dsth8 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dsth9 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dsth10 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - ILVRL_H2_SH(dsth3, dsth2, dst32_r, dst32_l); - ILVRL_H2_SH(dsth4, dsth3, dst43_r, dst43_l); - ILVRL_H2_SH(dsth5, dsth4, dst54_r, dst54_l); - ILVRL_H2_SH(dsth6, dsth5, dst65_r, dst65_l); - ILVRL_H2_SH(dsth7, dsth6, dst76_r, dst76_l); - ILVRL_H2_SH(dsth8, dsth7, dst87_r, dst87_l); - ILVRL_H2_SH(dsth9, dsth8, dst98_r, dst98_l); - ILVRL_H2_SH(dsth10, dsth9, dst109_r, dst109_l); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst76_r, dst76_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst87_r, dst87_l); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst6, dst0, dst7, dst1, dst98_r, dst98_l); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst109_r, dst109_l); PCKEV_D2_SH(dst21_l, dst10_l, dst43_l, dst32_l, dst1021_l, dst3243_l); PCKEV_D2_SH(dst65_l, dst54_l, dst87_l, dst76_l, dst5465_l, dst7687_l); dst98109_l = (v8i16) __msa_pckev_d((v2i64) dst109_l, (v2i64) dst98_l); @@ -4568,20 +5405,24 @@ SRAR_W4_SW(dst0_r, dst1_r, dst2_r, dst3_r, rnd_vec); SRAR_W4_SW(dst4_r, dst5_r, dst6_r, dst7_r, rnd_vec); SRAR_W4_SW(dst0_l, dst1_l, dst2_l, dst3_l, rnd_vec); + ADD4(dst0_r, offset_vec, dst1_r, offset_vec, dst2_r, offset_vec, dst3_r, + offset_vec, dst0_r, dst1_r, dst2_r, dst3_r); + ADD4(dst4_r, offset_vec, dst5_r, offset_vec, dst6_r, offset_vec, dst7_r, + offset_vec, dst4_r, dst5_r, dst6_r, dst7_r); + ADD4(dst0_l, offset_vec, dst1_l, offset_vec, dst2_l, offset_vec, dst3_l, + offset_vec, dst0_l, dst1_l, dst2_l, dst3_l); + CLIP_SW8_0_255(dst1_r, dst0_r, dst3_r, dst2_r, + dst4_r, dst5_r, dst6_r, dst7_r); + CLIP_SW4_0_255(dst0_l, dst1_l, dst2_l, dst3_l); PCKEV_H2_SH(dst1_r, dst0_r, dst3_r, dst2_r, tmp0, tmp1); PCKEV_H2_SH(dst5_r, dst4_r, dst7_r, dst6_r, tmp2, tmp3); PCKEV_H2_SH(dst1_l, dst0_l, dst3_l, dst2_l, tmp4, tmp5); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - ADD2(tmp4, offset_vec, tmp5, offset_vec, tmp4, tmp5); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); - CLIP_SH2_0_255(tmp4, tmp5); PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); ST_H8(out2, 0, 1, 2, 3, 4, 5, 6, 7, dst + 4, dst_stride); } -static void hevc_hv_uniwgt_4t_8x2_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_8x2_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4598,50 +5439,63 @@ v16i8 mask0 = LD_SB(ff_hevc_mask_arr); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9; - v8i16 dst0, dst1, dst2, dst3, dst4; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v4i32 dst0_r, dst0_l, dst1_r, dst1_l; v8i16 dst10_r, dst32_r, dst21_r, dst43_r; v8i16 dst10_l, dst32_l, dst21_l, dst43_l; - v8i16 tmp0, tmp1; - v8i16 offset_vec, const_128, denom_vec; - v4i32 weight_vec, rnd_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB5(src, src_stride, src0, src1, src2, src3, src4); - XORI_B5_128_SB(src0, src1, src2, src3, src4); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec6, vec7); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec8, vec9); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec8, vec9, filt0, filt1); - ILVRL_H2_SH(dst1, dst0, dst10_r, dst10_l); - ILVRL_H2_SH(dst2, dst1, dst21_r, dst21_l); - ILVRL_H2_SH(dst3, dst2, dst32_r, dst32_l); - ILVRL_H2_SH(dst4, dst3, dst43_r, dst43_l); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst32_r, dst32_l); + ILVRL_B2_SH(zero, vec8, tmp0, tmp1); + ILVRL_B2_SH(zero, vec9, tmp2, tmp3); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + ILVEV_H2_SH(dst6, dst0, dst7, dst1, dst43_r, dst43_l); + dst0_r = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst0_l = HEVC_FILT_4TAP(dst10_l, dst32_l, filt_h0, filt_h1); dst1_r = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); @@ -4650,14 +5504,15 @@ MUL2(dst0_r, weight_vec, dst1_r, weight_vec, dst0_r, dst1_r); MUL2(dst0_l, weight_vec, dst1_l, weight_vec, dst0_l, dst1_l); SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); + ADD4(dst0_r, offset_vec, dst0_l, offset_vec, dst1_r, offset_vec, + dst1_l, offset_vec, dst0_r, dst0_l, dst1_r, dst1_l); + CLIP_SW4_0_255(dst0_r, dst0_l, dst1_r, dst1_l); PCKEV_H2_SH(dst0_l, dst0_r, dst1_l, dst1_r, tmp0, tmp1); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - CLIP_SH2_0_255(tmp0, tmp1); out = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); ST_D2(out, 0, 1, dst, dst_stride); } -static void hevc_hv_uniwgt_4t_8multx4_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_8multx4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4673,21 +5528,22 @@ v16i8 src0, src1, src2, src3, src4, src5, src6, mask0, mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v8i16 filt0, filt1, filt_h0, filt_h1, filter_vec; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, tmp0, tmp1, tmp2, tmp3; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v8i16 dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r; v8i16 dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l; - v8i16 offset_vec, const_128, denom_vec; v4i32 dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l; - v4i32 weight_vec, rnd_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask0 = LD_SB(ff_hevc_mask_arr); @@ -4695,36 +5551,53 @@ weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); for (cnt = width8mult; cnt--;) { LD_SB7(src, src_stride, src0, src1, src2, src3, src4, src5, src6); src += 8; - XORI_B7_128_SB(src0, src1, src2, src3, src4, src5, src6); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - ILVRL_H2_SH(dst1, dst0, dst10_r, dst10_l); - ILVRL_H2_SH(dst2, dst1, dst21_r, dst21_l); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec2, vec3); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec6, vec7); - dst3 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - ILVRL_H2_SH(dst3, dst2, dst32_r, dst32_l); - ILVRL_H2_SH(dst4, dst3, dst43_r, dst43_l); - ILVRL_H2_SH(dst5, dst4, dst54_r, dst54_l); - ILVRL_H2_SH(dst6, dst5, dst65_r, dst65_l); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst4, dst0, dst5, dst1, dst32_r, dst32_l); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst43_r, dst43_l); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst54_r, dst54_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst65_r, dst65_l); + dst0_r = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst0_l = HEVC_FILT_4TAP(dst10_l, dst32_l, filt_h0, filt_h1); dst1_r = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); @@ -4741,18 +5614,21 @@ MUL2(dst2_l, weight_vec, dst3_l, weight_vec, dst2_l, dst3_l); SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); SRAR_W4_SW(dst2_r, dst2_l, dst3_r, dst3_l, rnd_vec); + ADD2(dst0_r, offset_vec, dst1_r, offset_vec, dst0_r, dst1_r); + ADD2(dst2_r, offset_vec, dst3_r, offset_vec, dst2_r, dst3_r); + ADD2(dst0_l, offset_vec, dst1_l, offset_vec, dst0_l, dst1_l); + ADD2(dst2_l, offset_vec, dst3_l, offset_vec, dst2_l, dst3_l); + CLIP_SW8_0_255(dst0_r, dst0_l, dst1_r, dst1_l, + dst2_r, dst2_l, dst3_r, dst3_l); PCKEV_H4_SH(dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r, dst3_l, dst3_r, tmp0, tmp1, tmp2, tmp3); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); dst += 8; } } -static void hevc_hv_uniwgt_4t_8x6_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_8x6_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4770,41 +5646,35 @@ v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9; v16i8 vec10, vec11, vec12, vec13, vec14, vec15, vec16, vec17; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, dst8; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; v4i32 dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l; - v4i32 dst4_r, dst4_l, dst5_r, dst5_l, weight_vec, rnd_vec; + v4i32 dst4_r, dst4_l, dst5_r, dst5_l, weight_vec, rnd_vec, offset_vec; v8i16 dst10_r, dst32_r, dst10_l, dst32_l; v8i16 dst21_r, dst43_r, dst21_l, dst43_l; v8i16 dst54_r, dst54_l, dst65_r, dst65_l; v8i16 dst76_r, dst76_l, dst87_r, dst87_l; - v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; - v8i16 offset_vec, const_128, denom_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); LD_SB5(src, src_stride, src0, src1, src2, src3, src4); src += (5 * src_stride); LD_SB4(src, src_stride, src5, src6, src7, src8); - XORI_B5_128_SB(src0, src1, src2, src3, src4); - XORI_B4_128_SB(src5, src6, src7, src8); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); @@ -4814,23 +5684,51 @@ VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec12, vec13); VSHF_B2_SB(src7, src7, src7, src7, mask0, mask1, vec14, vec15); VSHF_B2_SB(src8, src8, src8, src8, mask0, mask1, vec16, vec17); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst3 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec8, vec9, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec10, vec11, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec12, vec13, filt0, filt1); - dst7 = HEVC_FILT_4TAP_SH(vec14, vec15, filt0, filt1); - dst8 = HEVC_FILT_4TAP_SH(vec16, vec17, filt0, filt1); - ILVRL_H2_SH(dst1, dst0, dst10_r, dst10_l); - ILVRL_H2_SH(dst2, dst1, dst21_r, dst21_l); - ILVRL_H2_SH(dst3, dst2, dst32_r, dst32_l); - ILVRL_H2_SH(dst4, dst3, dst43_r, dst43_l); - ILVRL_H2_SH(dst5, dst4, dst54_r, dst54_l); - ILVRL_H2_SH(dst6, dst5, dst65_r, dst65_l); - ILVRL_H2_SH(dst7, dst6, dst76_r, dst76_l); - ILVRL_H2_SH(dst8, dst7, dst87_r, dst87_l); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst32_r, dst32_l); + ILVRL_B2_SH(zero, vec8, tmp0, tmp1); + ILVRL_B2_SH(zero, vec9, tmp2, tmp3); + ILVRL_B2_SH(zero, vec10, tmp4, tmp5); + ILVRL_B2_SH(zero, vec11, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst6, dst0, dst7, dst1, dst43_r, dst43_l); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst54_r, dst54_l); + ILVRL_B2_SH(zero, vec12, tmp0, tmp1); + ILVRL_B2_SH(zero, vec13, tmp2, tmp3); + ILVRL_B2_SH(zero, vec14, tmp4, tmp5); + ILVRL_B2_SH(zero, vec15, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst65_r, dst65_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst76_r, dst76_l); + ILVRL_B2_SH(zero, vec16, tmp0, tmp1); + ILVRL_B2_SH(zero, vec17, tmp2, tmp3); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + ILVEV_H2_SH(dst6, dst0, dst7, dst1, dst87_r, dst87_l); dst0_r = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst0_l = HEVC_FILT_4TAP(dst10_l, dst32_l, filt_h0, filt_h1); dst1_r = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); @@ -4855,20 +5753,24 @@ SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); SRAR_W4_SW(dst2_r, dst2_l, dst3_r, dst3_l, rnd_vec); SRAR_W4_SW(dst4_r, dst4_l, dst5_r, dst5_l, rnd_vec); + ADD2(dst0_r, offset_vec, dst1_r, offset_vec, dst0_r, dst1_r); + ADD2(dst2_r, offset_vec, dst3_r, offset_vec, dst2_r, dst3_r); + ADD2(dst4_r, offset_vec, dst5_r, offset_vec, dst4_r, dst5_r); + ADD2(dst0_l, offset_vec, dst1_l, offset_vec, dst0_l, dst1_l); + ADD2(dst2_l, offset_vec, dst3_l, offset_vec, dst2_l, dst3_l); + ADD2(dst4_l, offset_vec, dst5_l, offset_vec, dst4_l, dst5_l); + CLIP_SW8_0_255(dst0_r, dst1_r, dst2_r, dst3_r, + dst4_r, dst5_r, dst0_l, dst1_l); + CLIP_SW4_0_255(dst2_l, dst3_l, dst4_l, dst5_l); PCKEV_H4_SH(dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r, dst3_l, dst3_r, tmp0, tmp1, tmp2, tmp3); PCKEV_H2_SH(dst4_l, dst4_r, dst5_l, dst5_r, tmp4, tmp5); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - ADD2(tmp4, offset_vec, tmp5, offset_vec, tmp4, tmp5); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); - CLIP_SH2_0_255(tmp4, tmp5); PCKEV_B3_UB(tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, out0, out1, out2); ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); ST_D2(out2, 0, 1, dst + 4 * dst_stride, dst_stride); } -static void hevc_hv_uniwgt_4t_8multx4mult_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_8multx4mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -4881,7 +5783,7 @@ int32_t width8mult) { uint32_t loop_cnt, cnt; - uint8_t *src_tmp; + const uint8_t *src_tmp; uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6; @@ -4890,33 +5792,30 @@ v16i8 mask0 = LD_SB(ff_hevc_mask_arr); v16i8 mask1; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; - v8i16 dst0, dst1, dst2, dst3, dst4, dst5, dst6, tmp0, tmp1, tmp2, tmp3; + v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v8i16 dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r; v8i16 dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l; v4i32 dst0_r, dst0_l, dst1_r, dst1_l; - v8i16 offset_vec, const_128, denom_vec; v4i32 dst2_r, dst2_l, dst3_r, dst3_l; - v4i32 weight_vec, rnd_vec; + v4i32 weight_vec, rnd_vec, offset_vec; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask1 = mask0 + 2; weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); for (cnt = width8mult; cnt--;) { src_tmp = src; @@ -4924,35 +5823,55 @@ LD_SB3(src_tmp, src_stride, src0, src1, src2); src_tmp += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); - dst0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - ILVRL_H2_SH(dst1, dst0, dst10_r, dst10_l); - ILVRL_H2_SH(dst2, dst1, dst21_r, dst21_l); + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst10_r, dst10_l); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst21_r, dst21_l); for (loop_cnt = height >> 2; loop_cnt--;) { LD_SB4(src_tmp, src_stride, src3, src4, src5, src6); src_tmp += (4 * src_stride); - XORI_B4_128_SB(src3, src4, src5, src6); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec2, vec3); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec6, vec7); - dst3 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst4 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst5 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst6 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - ILVRL_H2_SH(dst3, dst2, dst32_r, dst32_l); - ILVRL_H2_SH(dst4, dst3, dst43_r, dst43_l); - ILVRL_H2_SH(dst5, dst4, dst54_r, dst54_l); - ILVRL_H2_SH(dst6, dst5, dst65_r, dst65_l); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst4, dst0, dst5, dst1, dst32_r, dst32_l); + ILVEV_H2_SH(dst0, dst2, dst1, dst3, dst43_r, dst43_l); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dst2, dst4, dst3, dst5, dst54_r, dst54_l); + ILVEV_H2_SH(dst4, dst6, dst5, dst7, dst65_r, dst65_l); dst0_r = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst0_l = HEVC_FILT_4TAP(dst10_l, dst32_l, filt_h0, filt_h1); dst1_r = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); @@ -4969,11 +5888,14 @@ MUL2(dst2_l, weight_vec, dst3_l, weight_vec, dst2_l, dst3_l); SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); SRAR_W4_SW(dst2_r, dst2_l, dst3_r, dst3_l, rnd_vec); + ADD2(dst0_r, offset_vec, dst1_r, offset_vec, dst0_r, dst1_r); + ADD2(dst2_r, offset_vec, dst3_r, offset_vec, dst2_r, dst3_r); + ADD2(dst0_l, offset_vec, dst1_l, offset_vec, dst0_l, dst1_l); + ADD2(dst2_l, offset_vec, dst3_l, offset_vec, dst2_l, dst3_l); + CLIP_SW8_0_255(dst0_r, dst0_l, dst1_r, dst1_l, + dst2_r, dst2_l, dst3_r, dst3_l); PCKEV_H4_SH(dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r, dst3_l, dst3_r, tmp0, tmp1, tmp2, tmp3); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride); dst_tmp += (4 * dst_stride); @@ -4982,7 +5904,8 @@ dst10_l = dst54_l; dst21_r = dst65_r; dst21_l = dst65_l; - dst2 = dst6; + dst4 = dst6; + dst5 = dst7; } src += 8; @@ -4990,7 +5913,7 @@ } } -static void hevc_hv_uniwgt_4t_8w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -5021,7 +5944,7 @@ } } -static void hevc_hv_uniwgt_4t_12w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_12w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -5033,29 +5956,31 @@ int32_t rnd_val) { uint32_t loop_cnt; - uint8_t *src_tmp, *dst_tmp; + const uint8_t *src_tmp; + uint8_t *dst_tmp; v16u8 out0, out1; v16i8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10; v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7; v16i8 mask0, mask1, mask2, mask3; - v8i16 filt0, filt1, filt_h0, filt_h1, filter_vec, tmp0, tmp1, tmp2, tmp3; - v8i16 dsth0, dsth1, dsth2, dsth3, dsth4, dsth5, dsth6; - v8i16 dst10, dst21, dst22, dst73, dst84, dst95, dst106; + v8i16 filt0, filt1, filt_h0, filt_h1, filter_vec; + v4i32 dsth0, dsth1, dsth2, dsth3, dsth4, dsth5, dsth6, dsth7; v8i16 dst76_r, dst98_r, dst87_r, dst109_r; v8i16 dst10_r, dst32_r, dst54_r, dst21_r, dst43_r, dst65_r; v8i16 dst10_l, dst32_l, dst54_l, dst21_l, dst43_l, dst65_l; - v8i16 offset_vec, const_128, denom_vec; v4i32 dst0_r, dst0_l, dst1_r, dst1_l, dst2_r, dst2_l, dst3_r, dst3_l; v4i32 dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, weight_vec, rnd_vec; + v4i32 dst8, dst9, dst10, offset_vec; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + v8i16 zero = { 0 }; src -= (src_stride + 1); filter_vec = LD_SH(filter_x); - SPLATI_H2_SH(filter_vec, 0, 1, filt0, filt1); + UNPCK_R_SB_SH(filter_vec, filter_vec); + SPLATI_W2_SH(filter_vec, 0, filt0, filt1); filter_vec = LD_SH(filter_y); UNPCK_R_SB_SH(filter_vec, filter_vec); - SPLATI_W2_SH(filter_vec, 0, filt_h0, filt_h1); mask0 = LD_SB(ff_hevc_mask_arr); @@ -5063,43 +5988,61 @@ weight_vec = __msa_fill_w(weight); rnd_vec = __msa_fill_w(rnd_val); - - offset_vec = __msa_fill_h(offset); - denom_vec = __msa_fill_h(rnd_val - 6); - const_128 = __msa_fill_h((128 * weight)); - offset_vec += __msa_srar_h(const_128, denom_vec); + offset_vec = __msa_fill_w(offset); src_tmp = src; dst_tmp = dst; LD_SB3(src_tmp, src_stride, src0, src1, src2); src_tmp += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); VSHF_B2_SB(src0, src0, src0, src0, mask0, mask1, vec0, vec1); VSHF_B2_SB(src1, src1, src1, src1, mask0, mask1, vec2, vec3); VSHF_B2_SB(src2, src2, src2, src2, mask0, mask1, vec4, vec5); - dsth0 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dsth1 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dsth2 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - ILVRL_H2_SH(dsth1, dsth0, dst10_r, dst10_l); - ILVRL_H2_SH(dsth2, dsth1, dst21_r, dst21_l); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dsth0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dsth1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dsth2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dsth3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + dsth4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dsth5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + ILVEV_H2_SH(dsth0, dsth2, dsth1, dsth3, dst10_r, dst10_l); + ILVEV_H2_SH(dsth2, dsth4, dsth3, dsth5, dst21_r, dst21_l); for (loop_cnt = 4; loop_cnt--;) { LD_SB4(src_tmp, src_stride, src3, src4, src5, src6); src_tmp += (4 * src_stride); - XORI_B4_128_SB(src3, src4, src5, src6); VSHF_B2_SB(src3, src3, src3, src3, mask0, mask1, vec0, vec1); VSHF_B2_SB(src4, src4, src4, src4, mask0, mask1, vec2, vec3); VSHF_B2_SB(src5, src5, src5, src5, mask0, mask1, vec4, vec5); VSHF_B2_SB(src6, src6, src6, src6, mask0, mask1, vec6, vec7); - dsth3 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dsth4 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dsth5 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dsth6 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - ILVRL_H2_SH(dsth3, dsth2, dst32_r, dst32_l); - ILVRL_H2_SH(dsth4, dsth3, dst43_r, dst43_l); - ILVRL_H2_SH(dsth5, dsth4, dst54_r, dst54_l); - ILVRL_H2_SH(dsth6, dsth5, dst65_r, dst65_l); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dsth0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dsth1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dsth2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dsth3 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dsth4, dsth0, dsth5, dsth1, dst32_r, dst32_l); + ILVEV_H2_SH(dsth0, dsth2, dsth1, dsth3, dst43_r, dst43_l); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dsth4 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dsth5 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dsth6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dsth7 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVEV_H2_SH(dsth2, dsth4, dsth3, dsth5, dst54_r, dst54_l); + ILVEV_H2_SH(dsth4, dsth6, dsth5, dsth7, dst65_r, dst65_l); + dst0_r = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst0_l = HEVC_FILT_4TAP(dst10_l, dst32_l, filt_h0, filt_h1); dst1_r = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); @@ -5116,11 +6059,14 @@ MUL2(dst2_l, weight_vec, dst3_l, weight_vec, dst2_l, dst3_l); SRAR_W4_SW(dst0_r, dst0_l, dst1_r, dst1_l, rnd_vec); SRAR_W4_SW(dst2_r, dst2_l, dst3_r, dst3_l, rnd_vec); + ADD2(dst0_r, offset_vec, dst1_r, offset_vec, dst0_r, dst1_r); + ADD2(dst2_r, offset_vec, dst3_r, offset_vec, dst2_r, dst3_r); + ADD2(dst0_l, offset_vec, dst1_l, offset_vec, dst0_l, dst1_l); + ADD2(dst2_l, offset_vec, dst3_l, offset_vec, dst2_l, dst3_l); + CLIP_SW8_0_255(dst0_r, dst0_l, dst1_r, dst1_l, + dst2_r, dst2_l, dst3_r, dst3_l); PCKEV_H4_SH(dst0_l, dst0_r, dst1_l, dst1_r, dst2_l, dst2_r, dst3_l, dst3_r, tmp0, tmp1, tmp2, tmp3); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_D4(out0, out1, 0, 1, 0, 1, dst_tmp, dst_stride); dst_tmp += (4 * dst_stride); @@ -5129,7 +6075,8 @@ dst10_l = dst54_l; dst21_r = dst65_r; dst21_l = dst65_l; - dsth2 = dsth6; + dsth4 = dsth6; + dsth5 = dsth7; } src += 8; @@ -5140,33 +6087,49 @@ LD_SB3(src, src_stride, src0, src1, src2); src += (3 * src_stride); - XORI_B3_128_SB(src0, src1, src2); VSHF_B2_SB(src0, src1, src0, src1, mask2, mask3, vec0, vec1); VSHF_B2_SB(src1, src2, src1, src2, mask2, mask3, vec2, vec3); - dst10 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst21 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - ILVRL_H2_SH(dst21, dst10, dst10_r, dst21_r); - dst22 = (v8i16) __msa_splati_d((v2i64) dst21, 1); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVL_B2_SH(zero, vec2, zero, vec3, tmp4, tmp6); + dst0 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst1 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst2 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + + ILVEV_H2_SH(dst0, dst1, dst1, dst2, dst10_r, dst21_r); for (loop_cnt = 2; loop_cnt--;) { LD_SB8(src, src_stride, src3, src4, src5, src6, src7, src8, src9, src10); src += (8 * src_stride); - XORI_B8_128_SB(src3, src4, src5, src6, src7, src8, src9, src10); VSHF_B2_SB(src3, src7, src3, src7, mask2, mask3, vec0, vec1); VSHF_B2_SB(src4, src8, src4, src8, mask2, mask3, vec2, vec3); VSHF_B2_SB(src5, src9, src5, src9, mask2, mask3, vec4, vec5); VSHF_B2_SB(src6, src10, src6, src10, mask2, mask3, vec6, vec7); - dst73 = HEVC_FILT_4TAP_SH(vec0, vec1, filt0, filt1); - dst84 = HEVC_FILT_4TAP_SH(vec2, vec3, filt0, filt1); - dst95 = HEVC_FILT_4TAP_SH(vec4, vec5, filt0, filt1); - dst106 = HEVC_FILT_4TAP_SH(vec6, vec7, filt0, filt1); - dst32_r = __msa_ilvr_h(dst73, dst22); - ILVRL_H2_SH(dst84, dst73, dst43_r, dst87_r); - ILVRL_H2_SH(dst95, dst84, dst54_r, dst98_r); - ILVRL_H2_SH(dst106, dst95, dst65_r, dst109_r); - dst22 = (v8i16) __msa_splati_d((v2i64) dst73, 1); - dst76_r = __msa_ilvr_h(dst22, dst106); + + ILVRL_B2_SH(zero, vec0, tmp0, tmp1); + ILVRL_B2_SH(zero, vec1, tmp2, tmp3); + ILVRL_B2_SH(zero, vec2, tmp4, tmp5); + ILVRL_B2_SH(zero, vec3, tmp6, tmp7); + dst3 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst7 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst4 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst8 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + ILVRL_B2_SH(zero, vec4, tmp0, tmp1); + ILVRL_B2_SH(zero, vec5, tmp2, tmp3); + ILVRL_B2_SH(zero, vec6, tmp4, tmp5); + ILVRL_B2_SH(zero, vec7, tmp6, tmp7); + dst5 = HEVC_FILT_4TAP_SW(tmp0, tmp2, filt0, filt1); + dst9 = HEVC_FILT_4TAP_SW(tmp1, tmp3, filt0, filt1); + dst6 = HEVC_FILT_4TAP_SW(tmp4, tmp6, filt0, filt1); + dst10 = HEVC_FILT_4TAP_SW(tmp5, tmp7, filt0, filt1); + + dst32_r = __msa_ilvev_h(dst3, dst2); + ILVEV_H2_SH(dst3, dst4, dst7, dst8, dst43_r, dst87_r); + ILVEV_H2_SH(dst4, dst5, dst8, dst9, dst54_r, dst98_r); + ILVEV_H2_SH(dst5, dst6, dst9, dst10, dst65_r, dst109_r); + dst76_r = __msa_ilvev_h(dst7, dst6); dst0 = HEVC_FILT_4TAP(dst10_r, dst32_r, filt_h0, filt_h1); dst1 = HEVC_FILT_4TAP(dst21_r, dst43_r, filt_h0, filt_h1); dst2 = HEVC_FILT_4TAP(dst32_r, dst54_r, filt_h0, filt_h1); @@ -5183,22 +6146,25 @@ MUL2(dst6, weight_vec, dst7, weight_vec, dst6, dst7); SRAR_W4_SW(dst0, dst1, dst2, dst3, rnd_vec); SRAR_W4_SW(dst4, dst5, dst6, dst7, rnd_vec); + ADD2(dst0, offset_vec, dst1, offset_vec, dst0, dst1); + ADD2(dst2, offset_vec, dst3, offset_vec, dst2, dst3); + ADD2(dst4, offset_vec, dst5, offset_vec, dst4, dst5); + ADD2(dst6, offset_vec, dst7, offset_vec, dst6, dst7); + CLIP_SW8_0_255(dst0, dst1, dst2, dst3, + dst4, dst5, dst6, dst7); PCKEV_H4_SH(dst1, dst0, dst3, dst2, dst5, dst4, dst7, dst6, tmp0, tmp1, tmp2, tmp3); - ADD2(tmp0, offset_vec, tmp1, offset_vec, tmp0, tmp1); - ADD2(tmp2, offset_vec, tmp3, offset_vec, tmp2, tmp3); - CLIP_SH4_0_255(tmp0, tmp1, tmp2, tmp3); PCKEV_B2_UB(tmp1, tmp0, tmp3, tmp2, out0, out1); ST_W8(out0, out1, 0, 1, 2, 3, 0, 1, 2, 3, dst, dst_stride); dst += (8 * dst_stride); dst10_r = dst98_r; dst21_r = dst109_r; - dst22 = (v8i16) __msa_splati_d((v2i64) dst106, 1); + dst2 = dst10; } } -static void hevc_hv_uniwgt_4t_16w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -5220,7 +6186,7 @@ } } -static void hevc_hv_uniwgt_4t_24w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_24w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -5236,7 +6202,7 @@ offset, rnd_val, 3); } -static void hevc_hv_uniwgt_4t_32w_msa(uint8_t *src, +static void hevc_hv_uniwgt_4t_32w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, @@ -5255,7 +6221,7 @@ #define UNIWGT_MC_COPY(WIDTH) \ void ff_hevc_put_hevc_uni_w_pel_pixels##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ int denom, \ @@ -5286,7 +6252,7 @@ void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t \ dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t \ src_stride, \ int height, \ @@ -5344,7 +6310,7 @@ #define UNI_W_MC_HV(PEL, WIDTH, TAP) \ void ff_hevc_put_hevc_uni_w_##PEL##_hv##WIDTH##_8_msa(uint8_t *dst, \ ptrdiff_t dst_stride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t src_stride, \ int height, \ int denom, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -67,7 +67,7 @@ const uint8_t *src_left, ptrdiff_t stride, int c_idx, int mode); -void ff_intra_pred_8_16x16_msa(struct HEVCContext *s, int x0, int y0, int c_idx); -void ff_intra_pred_8_32x32_msa(struct HEVCContext *s, int x0, int y0, int c_idx); +void ff_intra_pred_8_16x16_msa(struct HEVCLocalContext *s, int x0, int y0, int c_idx); +void ff_intra_pred_8_32x32_msa(struct HEVCLocalContext *s, int x0, int y0, int c_idx); #endif // #ifndef AVCODEC_MIPS_HEVCPRED_MIPS_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/hevcpred_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -1903,10 +1903,10 @@ } } -void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx) +void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) { v16u8 vec0; - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int i; int hshift = s->ps.sps->hshift[c_idx]; int vshift = s->ps.sps->vshift[c_idx]; @@ -2416,14 +2416,14 @@ } } -void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx) +void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) { v16u8 vec0, vec1; v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; v8i16 res0, res1, res2, res3; v8i16 mul_val0 = { 63, 62, 61, 60, 59, 58, 57, 56 }; v8i16 mul_val1 = { 1, 2, 3, 4, 5, 6, 7, 8 }; - HEVCLocalContext *lc = s->HEVClc; + const HEVCContext *const s = lc->parent; int i; int hshift = s->ps.sps->hshift[c_idx]; int vshift = s->ps.sps->vshift[c_idx]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/lsp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/lsp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/lsp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/lsp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -61,7 +61,7 @@ #include "libavutil/attributes.h" #include "libavutil/mips/asmdefs.h" -static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, int lp_half_order) +static av_always_inline void lsp2polyf_mips(const double *lsp, double *f, int lp_half_order) { int i, j = 0; double * p_fi = f; @@ -88,8 +88,8 @@ "addiu %[j], %[i], -2 \n\t" "ldc1 %[f_j_2], -8(%[p_f]) \n\t" "sdc1 %[tmp], 16(%[p_f]) \n\t" - "beqz %[j], ff_lsp2polyf_lp_j_end%= \n\t" - "ff_lsp2polyf_lp_j%=: \n\t" + "beqz %[j], lsp2polyf_lp_j_end%= \n\t" + "lsp2polyf_lp_j%=: \n\t" "add.d %[tmp], %[f_j], %[f_j_2] \n\t" "madd.d %[tmp], %[tmp], %[f_j_1], %[val] \n\t" "mov.d %[f_j], %[f_j_1] \n\t" @@ -98,8 +98,8 @@ "ldc1 %[f_j_2], -16(%[p_f]) \n\t" "sdc1 %[tmp], 8(%[p_f]) \n\t" PTR_ADDIU "%[p_f], -8 \n\t" - "bgtz %[j], ff_lsp2polyf_lp_j%= \n\t" - "ff_lsp2polyf_lp_j_end%=: \n\t" + "bgtz %[j], lsp2polyf_lp_j%= \n\t" + "lsp2polyf_lp_j_end%=: \n\t" : [f_j_2]"=&f"(f_j_2), [f_j_1]"=&f"(f_j_1), [val]"+f"(val), [tmp]"=&f"(tmp), [f_j]"=&f"(f_j), [p_f]"+r"(p_f), @@ -110,7 +110,7 @@ f[1] += val; } } -#define ff_lsp2polyf ff_lsp2polyf_mips +#define lsp2polyf lsp2polyf_mips #endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */ #endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM */ #endif /* AVCODEC_MIPS_LSP_MIPS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,37 +24,37 @@ #include "../mpegvideo.h" #include "libavcodec/bit_depth_template.c" -int ff_hadamard8_diff8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_diff8x8_msa(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h); -int ff_hadamard8_intra8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_intra8x8_msa(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h); -int ff_hadamard8_diff16_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_diff16_msa(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h); -int ff_hadamard8_intra16_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_intra16_msa(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h); -int ff_pix_abs16_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs16_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_x2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs16_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_y2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs16_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_xy2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs8_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs8_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_x2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs8_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_y2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_pix_abs8_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_xy2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sse16_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref, +int ff_sse16_msa(MpegEncContext *v, const uint8_t *pu8Src, const uint8_t *pu8Ref, ptrdiff_t stride, int i32Height); -int ff_sse8_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref, +int ff_sse8_msa(MpegEncContext *v, const uint8_t *pu8Src, const uint8_t *pu8Ref, ptrdiff_t stride, int i32Height); -int ff_sse4_msa(MpegEncContext *v, uint8_t *pu8Src, uint8_t *pu8Ref, +int ff_sse4_msa(MpegEncContext *v, const uint8_t *pu8Src, const uint8_t *pu8Ref, ptrdiff_t stride, int i32Height); -void ff_add_pixels8_msa(uint8_t *av_restrict pixels, int16_t *block, +void ff_add_pixels8_msa(const uint8_t *av_restrict pixels, int16_t *block, ptrdiff_t stride); #endif // #ifndef AVCODEC_MIPS_ME_CMP_MIPS_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/me_cmp_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,15 +21,17 @@ #include "libavutil/mips/generic_macros_msa.h" #include "me_cmp_mips.h" -static uint32_t sad_8width_msa(uint8_t *src, int32_t src_stride, - uint8_t *ref, int32_t ref_stride, +static uint32_t sad_8width_msa(const uint8_t *src, int32_t src_stride, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int res = (height & 0x03); v16u8 src0, src1, src2, src3, ref0, ref1, ref2, ref3; + v8u16 zero = { 0 }; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 2); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3); @@ -39,19 +41,30 @@ src0, src1, ref0, ref1); sad += SAD_UB2_UH(src0, src1, ref0, ref1); } + for (; res--; ) { + v16u8 diff; + src0 = LD_UB(src); + ref0 = LD_UB(ref); + src += src_stride; + ref += ref_stride; + diff = __msa_asub_u_b((v16u8) src0, (v16u8) ref0); + diff = (v16u8)__msa_ilvr_d((v2i64)zero, (v2i64)diff); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_16width_msa(uint8_t *src, int32_t src_stride, - uint8_t *ref, int32_t ref_stride, +static uint32_t sad_16width_msa(const uint8_t *src, int32_t src_stride, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int res = (height & 0x03); v16u8 src0, src1, ref0, ref1; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 2); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB2(src, src_stride, src0, src1); src += (2 * src_stride); LD_UB2(ref, ref_stride, ref0, ref1); @@ -64,22 +77,32 @@ ref += (2 * ref_stride); sad += SAD_UB2_UH(src0, src1, ref0, ref1); } - + for (; res > 0; res--) { + v16u8 diff; + src0 = LD_UB(src); + ref0 = LD_UB(ref); + src += src_stride; + ref += ref_stride; + diff = __msa_asub_u_b((v16u8) src0, (v16u8) ref0); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_horiz_bilinear_filter_8width_msa(uint8_t *src, +static uint32_t sad_horiz_bilinear_filter_8width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 3; + int32_t res = height & 0x07; v16u8 src0, src1, src2, src3, comp0, comp1; v16u8 ref0, ref1, ref2, ref3, ref4, ref5; + v8u16 zero = { 0 }; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 3); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); LD_UB4(ref, ref_stride, ref0, ref1, ref2, ref3); @@ -107,21 +130,34 @@ sad += SAD_UB2_UH(src0, src1, comp0, comp1); } + for (; res--; ) { + v16u8 diff; + src0 = LD_UB(src); + ref0 = LD_UB(ref); + ref1 = LD_UB(ref + 1); + src += src_stride; + ref += ref_stride; + comp0 = (v16u8)__msa_aver_u_b((v16u8) ref0, (v16u8) ref1); + diff = __msa_asub_u_b((v16u8) src0, (v16u8) comp0); + diff = (v16u8)__msa_ilvr_d((v2i64) zero, (v2i64) diff); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_horiz_bilinear_filter_16width_msa(uint8_t *src, +static uint32_t sad_horiz_bilinear_filter_16width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 3; + int32_t res = height & 0x07; v16u8 src0, src1, src2, src3, comp0, comp1; v16u8 ref00, ref10, ref20, ref30, ref01, ref11, ref21, ref31; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 3); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); LD_UB4(ref, ref_stride, ref00, ref10, ref20, ref30); @@ -145,21 +181,34 @@ sad += SAD_UB2_UH(src2, src3, comp0, comp1); } + for (; res--; ) { + v16u8 diff; + src0 = LD_UB(src); + ref00 = LD_UB(ref); + ref01 = LD_UB(ref + 1); + src += src_stride; + ref += ref_stride; + comp0 = (v16u8)__msa_aver_u_b((v16u8) ref00, (v16u8) ref01); + diff = __msa_asub_u_b((v16u8) src0, (v16u8) comp0); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_vert_bilinear_filter_8width_msa(uint8_t *src, +static uint32_t sad_vert_bilinear_filter_8width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 3; + int32_t res = height & 0x07; v16u8 src0, src1, src2, src3, comp0, comp1; v16u8 ref0, ref1, ref2, ref3, ref4; + v8u16 zero = { 0 }; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 3); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); LD_UB5(ref, ref_stride, ref0, ref1, ref2, ref3, ref4); @@ -183,21 +232,33 @@ sad += SAD_UB2_UH(src0, src1, comp0, comp1); } + for (; res--; ) { + v16u8 diff; + src0 = LD_UB(src); + LD_UB2(ref, ref_stride, ref0, ref1); + src += src_stride; + ref += ref_stride; + comp0 = (v16u8)__msa_aver_u_b((v16u8) ref0, (v16u8) ref1); + diff = __msa_asub_u_b((v16u8) src0, (v16u8) comp0); + diff = (v16u8)__msa_ilvr_d((v2i64) zero, (v2i64) diff); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_vert_bilinear_filter_16width_msa(uint8_t *src, +static uint32_t sad_vert_bilinear_filter_16width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 3; + int32_t res = height & 0x07; v16u8 src0, src1, src2, src3, comp0, comp1; v16u8 ref0, ref1, ref2, ref3, ref4; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 3); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB5(ref, ref_stride, ref4, ref0, ref1, ref2, ref3); ref += (5 * ref_stride); LD_UB4(src, src_stride, src0, src1, src2, src3); @@ -221,20 +282,32 @@ sad += SAD_UB2_UH(src2, src3, comp0, comp1); } + for (; res--; ) { + v16u8 diff; + src0 = LD_UB(src); + LD_UB2(ref, ref_stride, ref0, ref1); + src += src_stride; + ref += ref_stride; + comp0 = (v16u8)__msa_aver_u_b((v16u8) ref0, (v16u8) ref1); + diff = __msa_asub_u_b((v16u8) src0, (v16u8) comp0); + sad += __msa_hadd_u_h((v16u8) diff, (v16u8) diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_hv_bilinear_filter_8width_msa(uint8_t *src, +static uint32_t sad_hv_bilinear_filter_8width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int32_t res = height & 0x03; v16u8 src0, src1, src2, src3, temp0, temp1, diff; v16u8 ref0, ref1, ref2, ref3, ref4; v16i8 mask = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 }; v8u16 comp0, comp1, comp2, comp3; + v8u16 zero = { 0 }; v8u16 sad = { 0 }; for (ht_cnt = (height >> 2); ht_cnt--;) { @@ -277,23 +350,40 @@ sad += __msa_hadd_u_h(diff, diff); } + for (; res--; ) { + src0 = LD_UB(src); + LD_UB2(ref, ref_stride, ref0, ref1); + temp0 = (v16u8) __msa_vshf_b(mask, (v16i8) ref0, (v16i8) ref0); + temp1 = (v16u8) __msa_vshf_b(mask, (v16i8) ref1, (v16i8) ref1); + src += src_stride; + ref += ref_stride; + comp0 = __msa_hadd_u_h(temp0, temp0); + comp2 = __msa_hadd_u_h(temp1, temp1); + comp2 += comp0; + comp2 = (v8u16)__msa_srari_h((v8i16) comp2, 2); + comp0 = (v16u8) __msa_pckev_b((v16i8) zero, (v16i8) comp2); + diff = __msa_asub_u_b(src0, comp0); + diff = (v16u8)__msa_ilvr_d((v2i64) zero, (v2i64) diff); + sad += __msa_hadd_u_h(diff, diff); + } return (HADD_UH_U32(sad)); } -static uint32_t sad_hv_bilinear_filter_16width_msa(uint8_t *src, +static uint32_t sad_hv_bilinear_filter_16width_msa(const uint8_t *src, int32_t src_stride, - uint8_t *ref, + const uint8_t *ref, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 3; + int32_t res = height & 0x07; v16u8 src0, src1, src2, src3, comp, diff; v16u8 temp0, temp1, temp2, temp3; v16u8 ref00, ref01, ref02, ref03, ref04, ref10, ref11, ref12, ref13, ref14; v8u16 comp0, comp1, comp2, comp3; v8u16 sad = { 0 }; - for (ht_cnt = (height >> 3); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src, src_stride, src0, src1, src2, src3); src += (4 * src_stride); LD_UB5(ref, ref_stride, ref04, ref00, ref01, ref02, ref03); @@ -389,6 +479,25 @@ diff = __msa_asub_u_b(src3, comp); sad += __msa_hadd_u_h(diff, diff); } + for (; res--; ) { + src0 = LD_UB(src); + LD_UB2(ref, ref_stride, ref00, ref10); + LD_UB2(ref + 1, ref_stride, ref01, ref11); + src += src_stride; + ref += ref_stride; + ILVRL_B2_UB(ref10, ref00, temp0, temp1); + ILVRL_B2_UB(ref11, ref01, temp2, temp3); + comp0 = __msa_hadd_u_h(temp0, temp0); + comp1 = __msa_hadd_u_h(temp1, temp1); + comp2 = __msa_hadd_u_h(temp2, temp2); + comp3 = __msa_hadd_u_h(temp3, temp3); + comp2 += comp0; + comp3 += comp1; + SRARI_H2_UH(comp2, comp3, 2); + comp = (v16u8) __msa_pckev_b((v16i8) comp3, (v16i8) comp2); + diff = __msa_asub_u_b(src0, comp); + sad += __msa_hadd_u_h(diff, diff); + } return (HADD_UH_U32(sad)); } @@ -403,19 +512,21 @@ DPADD_SH2_SW(res_l0_m, res_l1_m, res_l0_m, res_l1_m, var, var); \ } -static uint32_t sse_4width_msa(uint8_t *src_ptr, int32_t src_stride, - uint8_t *ref_ptr, int32_t ref_stride, +static uint32_t sse_4width_msa(const uint8_t *src_ptr, int32_t src_stride, + const uint8_t *ref_ptr, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int32_t res = height & 0x03; uint32_t sse; uint32_t src0, src1, src2, src3; uint32_t ref0, ref1, ref2, ref3; - v16u8 src = { 0 }; - v16u8 ref = { 0 }; - v4i32 var = { 0 }; + v16u8 src = { 0 }; + v16u8 ref = { 0 }; + v16u8 zero = { 0 }; + v4i32 var = { 0 }; - for (ht_cnt = (height >> 2); ht_cnt--;) { + for (; ht_cnt--; ) { LW4(src_ptr, src_stride, src0, src1, src2, src3); src_ptr += (4 * src_stride); LW4(ref_ptr, ref_stride, ref0, ref1, ref2, ref3); @@ -426,22 +537,37 @@ CALC_MSE_B(src, ref, var); } + for (; res--; ) { + v16u8 reg0; + v8i16 tmp0; + src0 = LW(src_ptr); + ref0 = LW(ref_ptr); + src_ptr += src_stride; + ref_ptr += ref_stride; + src = (v16u8)__msa_insert_w((v4i32) src, 0, src0); + ref = (v16u8)__msa_insert_w((v4i32) ref, 0, ref0); + reg0 = (v16u8)__msa_ilvr_b(src, ref); + reg0 = (v16u8)__msa_ilvr_d((v2i64) zero, (v2i64) reg0); + tmp0 = (v8i16)__msa_hsub_u_h((v16u8) reg0, (v16u8) reg0); + var = (v4i32)__msa_dpadd_s_w((v4i32) var, (v8i16) tmp0, (v8i16) tmp0); + } sse = HADD_SW_S32(var); return sse; } -static uint32_t sse_8width_msa(uint8_t *src_ptr, int32_t src_stride, - uint8_t *ref_ptr, int32_t ref_stride, +static uint32_t sse_8width_msa(const uint8_t *src_ptr, int32_t src_stride, + const uint8_t *ref_ptr, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int32_t res = height & 0x03; uint32_t sse; v16u8 src0, src1, src2, src3; v16u8 ref0, ref1, ref2, ref3; v4i32 var = { 0 }; - for (ht_cnt = (height >> 2); ht_cnt--;) { + for (; ht_cnt--; ) { LD_UB4(src_ptr, src_stride, src0, src1, src2, src3); src_ptr += (4 * src_stride); LD_UB4(ref_ptr, ref_stride, ref0, ref1, ref2, ref3); @@ -453,21 +579,32 @@ CALC_MSE_B(src1, ref1, var); } + for (; res--; ) { + v8i16 tmp0; + src0 = LD_UB(src_ptr); + ref0 = LD_UB(ref_ptr); + src_ptr += src_stride; + ref_ptr += ref_stride; + ref1 = (v16u8)__msa_ilvr_b(src0, ref0); + tmp0 = (v8i16)__msa_hsub_u_h((v16u8) ref1, (v16u8) ref1); + var = (v4i32)__msa_dpadd_s_w((v4i32) var, (v8i16) tmp0, (v8i16) tmp0); + } sse = HADD_SW_S32(var); return sse; } -static uint32_t sse_16width_msa(uint8_t *src_ptr, int32_t src_stride, - uint8_t *ref_ptr, int32_t ref_stride, +static uint32_t sse_16width_msa(const uint8_t *src_ptr, int32_t src_stride, + const uint8_t *ref_ptr, int32_t ref_stride, int32_t height) { - int32_t ht_cnt; + int32_t ht_cnt = height >> 2; + int32_t res = height & 0x03; uint32_t sse; v16u8 src, ref; v4i32 var = { 0 }; - for (ht_cnt = (height >> 2); ht_cnt--;) { + for (; ht_cnt--; ) { src = LD_UB(src_ptr); src_ptr += src_stride; ref = LD_UB(ref_ptr); @@ -493,13 +630,21 @@ CALC_MSE_B(src, ref, var); } + for (; res--; ) { + src = LD_UB(src_ptr); + src_ptr += src_stride; + ref = LD_UB(ref_ptr); + ref_ptr += ref_stride; + CALC_MSE_B(src, ref, var); + } + sse = HADD_SW_S32(var); return sse; } -static int32_t hadamard_diff_8x8_msa(uint8_t *src, int32_t src_stride, - uint8_t *ref, int32_t ref_stride) +static int32_t hadamard_diff_8x8_msa(const uint8_t *src, int32_t src_stride, + const uint8_t *ref, int32_t ref_stride) { v16u8 src0, src1, src2, src3, src4, src5, src6, src7; v16u8 ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7; @@ -543,8 +688,8 @@ return (HADD_UH_U32(sum)); } -static int32_t hadamard_intra_8x8_msa(uint8_t *src, int32_t src_stride, - uint8_t *ref, int32_t ref_stride) +static int32_t hadamard_intra_8x8_msa(const uint8_t *src, int32_t src_stride, + const uint8_t *dumy, int32_t ref_stride) { int32_t sum_res = 0; v16u8 src0, src1, src2, src3, src4, src5, src6, src7; @@ -587,87 +732,87 @@ return sum_res; } -int ff_pix_abs16_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref, +int ff_pix_abs16_msa(MpegEncContext *v, const uint8_t *src, const uint8_t *ref, ptrdiff_t stride, int height) { return sad_16width_msa(src, stride, ref, stride, height); } -int ff_pix_abs8_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref, +int ff_pix_abs8_msa(MpegEncContext *v, const uint8_t *src, const uint8_t *ref, ptrdiff_t stride, int height) { return sad_8width_msa(src, stride, ref, stride, height); } -int ff_pix_abs16_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_x2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_horiz_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h); } -int ff_pix_abs16_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_y2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_vert_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h); } -int ff_pix_abs16_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs16_xy2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_hv_bilinear_filter_16width_msa(pix1, stride, pix2, stride, h); } -int ff_pix_abs8_x2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_x2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_horiz_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h); } -int ff_pix_abs8_y2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_y2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_vert_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h); } -int ff_pix_abs8_xy2_msa(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_pix_abs8_xy2_msa(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { return sad_hv_bilinear_filter_8width_msa(pix1, stride, pix2, stride, h); } -int ff_sse16_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref, +int ff_sse16_msa(MpegEncContext *v, const uint8_t *src, const uint8_t *ref, ptrdiff_t stride, int height) { return sse_16width_msa(src, stride, ref, stride, height); } -int ff_sse8_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref, +int ff_sse8_msa(MpegEncContext *v, const uint8_t *src, const uint8_t *ref, ptrdiff_t stride, int height) { return sse_8width_msa(src, stride, ref, stride, height); } -int ff_sse4_msa(MpegEncContext *v, uint8_t *src, uint8_t *ref, +int ff_sse4_msa(MpegEncContext *v, const uint8_t *src, const uint8_t *ref, ptrdiff_t stride, int height) { return sse_4width_msa(src, stride, ref, stride, height); } -int ff_hadamard8_diff8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_diff8x8_msa(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h) { return hadamard_diff_8x8_msa(src, stride, dst, stride); } -int ff_hadamard8_intra8x8_msa(MpegEncContext *s, uint8_t *dst, uint8_t *src, +int ff_hadamard8_intra8x8_msa(MpegEncContext *s, const uint8_t *src, const uint8_t *dummy, ptrdiff_t stride, int h) { - return hadamard_intra_8x8_msa(src, stride, dst, stride); + return hadamard_intra_8x8_msa(src, stride, dummy, stride); } /* Hadamard Transform functions */ #define WRAPPER8_16_SQ(name8, name16) \ -int name16(MpegEncContext *s, uint8_t *dst, uint8_t *src, \ +int name16(MpegEncContext *s, const uint8_t *dst, const uint8_t *src, \ ptrdiff_t stride, int h) \ { \ int score = 0; \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/mpegvideoencdsp_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "h263dsp_mips.h" #include "libavutil/mips/generic_macros_msa.h" -static int32_t sum_u8src_16width_msa(uint8_t *src, int32_t stride) +static int32_t sum_u8src_16width_msa(const uint8_t *src, int32_t stride) { uint32_t sum = 0; v16u8 in0, in1, in2, in3, in4, in5, in6, in7; @@ -56,7 +56,7 @@ return sum; } -int ff_pix_sum_msa(uint8_t *pix, int line_size) +int ff_pix_sum_msa(const uint8_t *pix, int line_size) { return sum_u8src_16width_msa(pix, line_size); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -179,16 +179,16 @@ void ff_vc1_h_loop_filter16_mmi(uint8_t *src, ptrdiff_t stride, int pq); void ff_put_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y); void ff_put_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y); void ff_avg_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y); void ff_avg_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y); void ff_vc1_inv_trans_8x8_msa(int16_t block[64]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mmi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mmi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mmi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vc1dsp_mmi.c 2023-03-03 13:29:59.000000000 +0000 @@ -2235,7 +2235,7 @@ void ff_put_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { union mmi_intfloat64 A, B, C, D; @@ -2291,7 +2291,7 @@ } void ff_put_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { union mmi_intfloat64 A, B, C, D; @@ -2345,7 +2345,7 @@ } void ff_avg_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { union mmi_intfloat64 A, B, C, D; @@ -2404,7 +2404,7 @@ } void ff_avg_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { union mmi_intfloat64 A, B, C, D; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/videodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/videodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/videodsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/videodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "libavutil/mips/asmdefs.h" #include "libavcodec/videodsp.h" -static void prefetch_mips(uint8_t *mem, ptrdiff_t stride, int h) +static void prefetch_mips(const uint8_t *mem, ptrdiff_t stride, int h) { register const uint8_t *p = mem; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8dsp_mips.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8dsp_mips.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8dsp_mips.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8dsp_mips.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,118 +28,118 @@ #include "constants.h" void ff_put_vp8_pixels4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); /* loop filter */ @@ -184,84 +184,84 @@ void ff_vp8_idct_dc_add4uv_mmi(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); -void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); -void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); -void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y); -void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); -void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); -void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); -void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); + const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my); // loop filter applied to edges between macroblocks void ff_vp8_v_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8_mc_msa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8_mc_msa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8_mc_msa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mips/vp8_mc_msa.c 2023-03-03 13:29:59.000000000 +0000 @@ -156,7 +156,7 @@ out0, out1, out2, out3); \ } -static void common_hz_6t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_6t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -184,7 +184,7 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void common_hz_6t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hz_6t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -220,7 +220,7 @@ } void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = subpel_filters_msa[mx - 1]; @@ -233,7 +233,7 @@ } void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -281,7 +281,7 @@ } void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -330,7 +330,7 @@ } void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -377,7 +377,7 @@ } void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -427,7 +427,7 @@ } void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -501,7 +501,7 @@ } void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -576,7 +576,7 @@ } void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -663,7 +663,7 @@ void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -677,7 +677,7 @@ } } -static void common_hz_4t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -704,7 +704,7 @@ ST_W4(out, 0, 1, 2, 3, dst, dst_stride); } -static void common_hz_4t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -739,7 +739,7 @@ ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride); } -static void common_hz_4t_4x16_msa(uint8_t *src, int32_t src_stride, +static void common_hz_4t_4x16_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -790,7 +790,7 @@ } void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = subpel_filters_msa[mx - 1]; @@ -805,7 +805,7 @@ } void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -840,7 +840,7 @@ } void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -889,7 +889,7 @@ } void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -936,7 +936,7 @@ } void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -982,7 +982,7 @@ } void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1041,7 +1041,7 @@ } void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1100,7 +1100,7 @@ } void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1167,7 +1167,7 @@ } void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -1182,7 +1182,7 @@ } void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1248,7 +1248,7 @@ } void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1321,7 +1321,7 @@ } void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -1336,7 +1336,7 @@ } void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1400,7 +1400,7 @@ } void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1475,7 +1475,7 @@ } void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t multiple8_cnt; @@ -1489,7 +1489,7 @@ } } -static void common_hz_2t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_2t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1512,7 +1512,7 @@ ST_W2(res1, 0, 1, dst + 2 * dst_stride, dst_stride); } -static void common_hz_2t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hz_2t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1542,7 +1542,7 @@ } void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = bilinear_filters_msa[mx - 1]; @@ -1554,7 +1554,7 @@ } } -static void common_hz_2t_8x4_msa(uint8_t *src, int32_t src_stride, +static void common_hz_2t_8x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1578,7 +1578,7 @@ ST_D4(src0, src1, 0, 1, 0, 1, dst, dst_stride); } -static void common_hz_2t_8x8mult_msa(uint8_t *src, int32_t src_stride, +static void common_hz_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1642,7 +1642,7 @@ } void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = bilinear_filters_msa[mx - 1]; @@ -1656,7 +1656,7 @@ } void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1722,7 +1722,7 @@ } } -static void common_vt_2t_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_vt_2t_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1748,7 +1748,7 @@ ST_W4(src2110, 0, 1, 2, 3, dst, dst_stride); } -static void common_vt_2t_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_vt_2t_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1783,7 +1783,7 @@ } void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = bilinear_filters_msa[my - 1]; @@ -1795,7 +1795,7 @@ } } -static void common_vt_2t_8x4_msa(uint8_t *src, int32_t src_stride, +static void common_vt_2t_8x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter) { @@ -1819,7 +1819,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); } -static void common_vt_2t_8x8mult_msa(uint8_t *src, int32_t src_stride, +static void common_vt_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter, int32_t height) { @@ -1865,7 +1865,7 @@ } void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter = bilinear_filters_msa[my - 1]; @@ -1879,7 +1879,7 @@ } void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -1932,7 +1932,7 @@ } } -static void common_hv_2ht_2vt_4x4_msa(uint8_t *src, int32_t src_stride, +static void common_hv_2ht_2vt_4x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_horiz, const int8_t *filter_vert) @@ -1966,7 +1966,7 @@ ST_W2(res1, 0, 1, dst + 2 * dst_stride, dst_stride); } -static void common_hv_2ht_2vt_4x8_msa(uint8_t *src, int32_t src_stride, +static void common_hv_2ht_2vt_4x8_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_horiz, const int8_t *filter_vert) @@ -2014,7 +2014,7 @@ } void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter_horiz = bilinear_filters_msa[mx - 1]; @@ -2029,7 +2029,7 @@ } } -static void common_hv_2ht_2vt_8x4_msa(uint8_t *src, int32_t src_stride, +static void common_hv_2ht_2vt_8x4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_horiz, const int8_t *filter_vert) @@ -2073,7 +2073,7 @@ ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride); } -static void common_hv_2ht_2vt_8x8mult_msa(uint8_t *src, int32_t src_stride, +static void common_hv_2ht_2vt_8x8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, const int8_t *filter_horiz, const int8_t *filter_vert, @@ -2154,7 +2154,7 @@ } void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { const int8_t *filter_horiz = bilinear_filters_msa[mx - 1]; @@ -2170,7 +2170,7 @@ } void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { uint32_t loop_cnt; @@ -2241,7 +2241,7 @@ } void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t cnt; @@ -2283,16 +2283,16 @@ } } -static void copy_16multx8mult_msa(uint8_t *src, int32_t src_stride, +static void copy_16multx8mult_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height, int32_t width) { int32_t cnt, loop_cnt; - uint8_t *src_tmp, *dst_tmp; + uint8_t *dst_tmp; v16u8 src0, src1, src2, src3, src4, src5, src6, src7; for (cnt = (width >> 4); cnt--;) { - src_tmp = src; + const uint8_t *src_tmp = src; dst_tmp = dst; for (loop_cnt = (height >> 3); loop_cnt--;) { @@ -2311,7 +2311,7 @@ } void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int height, int mx, int my) { int32_t cnt; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,186 @@ +/* + * Micronas SC-4 audio decoder + * Copyright (c) 2022 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 "bytestream.h" +#include "mathops.h" + +static const int16_t steps[16] = { + 4084, 18, 41, 64, 112, 198, 355, 1122, + 1122, 355, 198, 112, 64, 41, 18, 4084, +}; + +static const int16_t diffs[16] = { + 2048, 4, 135, 213, 273, 323, 373, 425, + 425, 373, 323, 273, 213, 135, 4, 2048, +}; + +typedef struct ChannelContext { + unsigned last_step; + int64_t new_pred; + int64_t pred; + int64_t weights_tab[6]; + int32_t diffs_tab[6]; +} ChannelContext; + +typedef struct MISC4Context { + GetByteContext gb; + + uint32_t marker; + + ChannelContext ch[2]; +} MISC4Context; + +static av_cold int misc4_init(AVCodecContext *avctx) +{ + MISC4Context *s = avctx->priv_data; + + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + switch (avctx->sample_rate) { + case 8000: + case 11025: + s->marker = 0x11b; + break; + case 16000: + case 32000: + s->marker = 0x2b2; + break; + } + + return 0; +} + +#define FRACBITS 12 +#define WEIGHTSBITS 26 + +static int64_t prediction(int delta, ChannelContext *c) +{ + const int isign = FFDIFFSIGN(delta, 0); + int64_t dotpr = 0; + + c->new_pred = delta * (1LL << FRACBITS) + c->pred; + + for (int i = 0; i < 6; i++) { + const int sign = FFSIGN(c->diffs_tab[i]); + c->weights_tab[i] = (c->weights_tab[i] * 255LL) / 256; + c->weights_tab[i] += (1LL << (WEIGHTSBITS + 1)) * sign * isign; + } + + memmove(&c->diffs_tab[1], &c->diffs_tab[0], 5 * sizeof(int32_t)); + + c->diffs_tab[0] = -delta * (1 << (FRACBITS-8)); + c->pred = c->new_pred; + + dotpr = 0; + for (int i = 0; i < 6; i++) + dotpr += ((int64_t)c->diffs_tab[i] * c->weights_tab[i]) >> WEIGHTSBITS; + + c->pred += dotpr; + c->pred = av_clip64(c->pred, -16383 * (1 << FRACBITS), 16383 * (1 << FRACBITS)); + c->pred = c->pred * 9 / 10; + + return c->new_pred; +} + +static int16_t decode(ChannelContext *c, unsigned nibble) +{ + int diff, diff_sign, adiff = 0, delta; + uint32_t step, newstep; + int64_t pred; + + diff_sign = nibble >> 3; + diff = diffs[nibble]; + step = diff + (c->last_step >> 2); + newstep = step & 0xfff; + if (newstep >> 11 == 0) + adiff = (((step & 0x7f) + 0x80) * 128) >> + (14 - (newstep >> 7)); + delta = diff_sign ? -adiff : adiff; + delta = av_clip_intp2(delta, 15); + pred = prediction(delta, c); + nibble = steps[nibble]; + newstep = nibble * 32 - c->last_step & 0x1ffff; + newstep = ((newstep >> 5) + (newstep & 0x10000 ? 0x1000 : 0) + c->last_step) & 0x1fff; + c->last_step = av_clip(newstep, 544, 5120); + + return av_clip_int16(pred >> (FRACBITS - 3)); +} + +static int misc4_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *pkt) +{ + MISC4Context *s = avctx->priv_data; + GetByteContext *gb = &s->gb; + uint32_t hdr; + int ret; + + bytestream2_init(gb, pkt->data, pkt->size); + + frame->nb_samples = 29 * (1 + (avctx->ch_layout.nb_channels == 1)); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + hdr = bytestream2_peek_be32(gb); + if (hdr == s->marker) { + bytestream2_skip(gb, 5); + } else if ((hdr >> 16) == s->marker) { + bytestream2_skip(gb, 3); + } + + { + int16_t *samples = (int16_t *)frame->data[0]; + const int st = avctx->ch_layout.nb_channels == 2; + int n; + + for (n = 0; n < 29; n++) { + int nibble = bytestream2_get_byte(gb); + samples[2*n+0] = decode(&s->ch[0 ], nibble >> 4); + samples[2*n+1] = decode(&s->ch[st], nibble & 15); + if (bytestream2_get_bytes_left(gb) <= 0) + break; + } + + if (n == 29 && bytestream2_get_byte(gb) != 0x55) + return AVERROR_INVALIDDATA; + } + + *got_frame_ptr = 1; + + return bytestream2_tell(gb); +} + +const FFCodec ff_misc4_decoder = { + .p.name = "misc4", + CODEC_LONG_NAME("Micronas SC-4 Audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MISC4, + .priv_data_size = sizeof(MISC4Context), + .init = misc4_init, + FF_CODEC_DECODE_CB(misc4_decode), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SUBFRAMES | + AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, + AV_SAMPLE_FMT_NONE }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4_parser.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/misc4_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Micronas SC-4 parser + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "parser.h" + +typedef struct MISC4Context { + ParseContext pc; +} MISC4Context; + +static int misc4_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + MISC4Context *ctx = s->priv_data; + uint32_t state = ctx->pc.state; + int next = END_NOT_FOUND, i = 0; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { + next = buf_size; + } else { + uint32_t marker = 0; + + switch (avctx->sample_rate) { + case 8000: + case 11025: + marker = 0x11b; + break; + case 16000: + case 32000: + marker = 0x2b2; + break; + } + + for (; i < buf_size; i++) { + state = (state << 8) | buf[i]; + if (state == marker && i > 3) { + next = i - 3; + break; + } + } + + ctx->pc.state = state; + if (ff_combine_frame(&ctx->pc, next, &buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; + return buf_size; + } + } + + *poutbuf = buf; + *poutbuf_size = buf_size; + + return next; +} + +const AVCodecParser ff_misc4_parser = { + .codec_ids = { AV_CODEC_ID_MISC4 }, + .priv_data_size = sizeof(MISC4Context), + .parser_parse = misc4_parse, + .parser_close = ff_parse_close, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegbdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegbdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegbdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegbdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -64,10 +64,8 @@ s->restart_count = 0; s->mjpb_skiptosod = 0; - if (buf_end - buf_ptr >= 1 << 28) - return AVERROR_INVALIDDATA; - - init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8); + if ((ret = init_get_bits8(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr))) < 0) + return ret; skip_bits(&hgb, 32); /* reserved zeros */ @@ -143,9 +141,10 @@ av_log(avctx, AV_LOG_WARNING, "no picture\n"); return buf_size; } - - if ((ret = av_frame_ref(rframe, s->picture_ptr)) < 0) - return ret; + av_frame_move_ref(rframe, s->picture_ptr); + s->got_picture = 0; + if (avctx->skip_frame == AVDISCARD_ALL) + return buf_size; *got_frame = 1; if (!s->lossless && avctx->debug & FF_DEBUG_QP) { @@ -158,7 +157,7 @@ const FFCodec ff_mjpegb_decoder = { .p.name = "mjpegb", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple MJPEG-B"), + CODEC_LONG_NAME("Apple MJPEG-B"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEGB, .priv_data_size = sizeof(MJpegDecodeContext), @@ -167,5 +166,20 @@ FF_CODEC_DECODE_CB(mjpegb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; + +const FFCodec ff_media100_decoder = { + .p.name = "media100", + CODEC_LONG_NAME("Media 100"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MEDIA100, + .priv_data_size = sizeof(MJpegDecodeContext), + .init = ff_mjpeg_decode_init, + .close = ff_mjpeg_decode_end, + FF_CODEC_DECODE_CB(mjpegb_decode_frame), + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .bsfs = "media100_to_mjpegb", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -115,8 +115,8 @@ MJpegDecodeContext *s = avctx->priv_data; ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable(s->idsp.idct_permutation, &s->scantable, - ff_zigzag_direct); + ff_permute_scantable(s->permutated_scantable, ff_zigzag_direct, + s->idsp.idct_permutation); } av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) @@ -131,10 +131,8 @@ s->picture_ptr = s->picture; } - s->pkt = avctx->internal->in_pkt; - s->avctx = avctx; - ff_blockdsp_init(&s->bdsp, avctx); + ff_blockdsp_init(&s->bdsp); ff_hpeldsp_init(&s->hdsp, avctx->flags); init_idct(avctx); s->buffer_size = 0; @@ -373,7 +371,7 @@ s->v_max = 1; for (i = 0; i < nb_components; i++) { /* component id */ - s->component_id[i] = get_bits(&s->gb, 8) - 1; + s->component_id[i] = get_bits(&s->gb, 8); h_count[i] = get_bits(&s->gb, 4); v_count[i] = get_bits(&s->gb, 4); /* compute hmax and vmax (only used in interleaved case) */ @@ -398,10 +396,10 @@ s->component_id[i], s->quant_index[i]); } if ( nb_components == 4 - && s->component_id[0] == 'C' - 1 - && s->component_id[1] == 'M' - 1 - && s->component_id[2] == 'Y' - 1 - && s->component_id[3] == 'K' - 1) + && s->component_id[0] == 'C' + && s->component_id[1] == 'M' + && s->component_id[2] == 'Y' + && s->component_id[3] == 'K') s->adobe_transform = 0; if (s->ls && (s->h_max > 1 || s->v_max > 1)) { @@ -438,7 +436,7 @@ /* test interlaced mode */ if (s->first_picture && - (s->multiscope != 2 || s->avctx->time_base.den >= 25 * s->avctx->time_base.num) && + (s->multiscope != 2 || s->avctx->pkt_timebase.den >= 25 * s->avctx->pkt_timebase.num) && s->orig_height != 0 && s->height < ((s->orig_height * 3) / 4)) { s->interlaced = 1; @@ -452,7 +450,8 @@ if (ret < 0) return ret; - if ((s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || + if (s->avctx->codec_id != AV_CODEC_ID_SMVJPEG && + (s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || s->avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && s->orig_height < height) s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, s->avctx->lowres); @@ -523,7 +522,7 @@ s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_BGR48; else { if ( s->adobe_transform == 0 - || s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) { + || s->component_id[0] == 'R' && s->component_id[1] == 'G' && s->component_id[2] == 'B') { s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16; } else { if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; @@ -596,7 +595,7 @@ case 0x14111100: case 0x22211100: case 0x22112100: - if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') { + if (s->component_id[0] == 'R' && s->component_id[1] == 'G' && s->component_id[2] == 'B') { if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP; else goto unk_pixfmt; @@ -611,7 +610,7 @@ } break; case 0x21111100: - if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') { + if (s->component_id[0] == 'R' && s->component_id[1] == 'G' && s->component_id[2] == 'B') { if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP; else goto unk_pixfmt; @@ -846,7 +845,7 @@ av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i); return AVERROR_INVALIDDATA; } - j = s->scantable.permutated[i]; + j = s->permutated_scantable[i]; block[j] = level * quant_matrix[i]; } } while (i < 63); @@ -909,14 +908,14 @@ if (i >= se) { if (i == se) { - j = s->scantable.permutated[se]; + j = s->permutated_scantable[se]; block[j] = level * (quant_matrix[se] << Al); break; } av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i); return AVERROR_INVALIDDATA; } - j = s->scantable.permutated[i]; + j = s->permutated_scantable[i]; block[j] = level * (quant_matrix[i] << Al); } else { if (run == 0xF) {// ZRL - skip 15 coefficients @@ -964,7 +963,7 @@ } \ break; \ } \ - j = s->scantable.permutated[i]; \ + j = s->permutated_scantable[i]; \ if (block[j]) \ REFINE_BIT(j) \ else if (run-- == 0) \ @@ -994,7 +993,7 @@ val = SHOW_UBITS(re, &s->gb, 1); LAST_SKIP_BITS(re, &s->gb, 1); ZERO_RUN; - j = s->scantable.permutated[i]; + j = s->permutated_scantable[i]; val--; block[j] = ((quant_matrix[i] << Al) ^ val) - val; if (i == se) { @@ -1026,7 +1025,7 @@ } for (; i <= last; i++) { - j = s->scantable.permutated[i]; + j = s->permutated_scantable[i]; if (block[j]) REFINE_BIT(j) } @@ -1512,7 +1511,7 @@ "error y=%d x=%d\n", mb_y, mb_x); return AVERROR_INVALIDDATA; } - if (ptr) { + if (ptr && linesize[c]) { s->idsp.idct_put(ptr, linesize[c], s->block); if (s->bits & 7) shift_output(s, ptr, linesize[c]); @@ -1677,7 +1676,7 @@ return AVERROR_INVALIDDATA; } for (i = 0; i < nb_components; i++) { - id = get_bits(&s->gb, 8) - 1; + id = get_bits(&s->gb, 8); av_log(s->avctx, AV_LOG_DEBUG, "component: %d\n", id); /* find component index */ for (index = 0; index < s->nb_components; index++) @@ -2346,67 +2345,9 @@ s->iccnum = 0; } -// SMV JPEG just stacks several output frames into one JPEG picture -// we handle that by setting up the cropping parameters appropriately -static int smv_process_frame(AVCodecContext *avctx, AVFrame *frame) -{ - MJpegDecodeContext *s = avctx->priv_data; - int ret; - - if (s->smv_next_frame > 0) { - av_assert0(s->smv_frame->buf[0]); - av_frame_unref(frame); - ret = av_frame_ref(frame, s->smv_frame); - if (ret < 0) - return ret; - } else { - av_assert0(frame->buf[0]); - av_frame_unref(s->smv_frame); - ret = av_frame_ref(s->smv_frame, frame); - if (ret < 0) - return ret; - } - - av_assert0((s->smv_next_frame + 1) * avctx->height <= avctx->coded_height); - - frame->width = avctx->coded_width; - frame->height = avctx->coded_height; - frame->crop_top = FFMIN(s->smv_next_frame * avctx->height, frame->height); - frame->crop_bottom = frame->height - (s->smv_next_frame + 1) * avctx->height; - - s->smv_next_frame = (s->smv_next_frame + 1) % s->smv_frames_per_jpeg; - - if (s->smv_next_frame == 0) - av_frame_unref(s->smv_frame); - - return 0; -} - -static int mjpeg_get_packet(AVCodecContext *avctx) -{ - MJpegDecodeContext *s = avctx->priv_data; - int ret; - - av_packet_unref(s->pkt); - ret = ff_decode_get_packet(avctx, s->pkt); - if (ret < 0) - return ret; - -#if CONFIG_SP5X_DECODER || CONFIG_AMV_DECODER - if (avctx->codec_id == AV_CODEC_ID_SP5X || - avctx->codec_id == AV_CODEC_ID_AMV) { - ret = ff_sp5x_process_packet(avctx, s->pkt); - if (ret < 0) - return ret; - } -#endif - - s->buf_size = s->pkt->size; - - return 0; -} - -int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) +int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, const AVPacket *avpkt, + const uint8_t *buf, const int buf_size) { MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; @@ -2421,8 +2362,7 @@ s->force_pal8 = 0; - if (avctx->codec_id == AV_CODEC_ID_SMVJPEG && s->smv_next_frame > 0) - return smv_process_frame(avctx, frame); + s->buf_size = buf_size; av_dict_free(&s->exif_metadata); av_freep(&s->stereo3d); @@ -2431,12 +2371,9 @@ if (s->iccnum != 0) reset_icc_profile(s); - ret = mjpeg_get_packet(avctx); - if (ret < 0) - return ret; redo_for_pal8: - buf_ptr = s->pkt->data; - buf_end = s->pkt->data + s->pkt->size; + buf_ptr = buf; + buf_end = buf + buf_size; while (buf_ptr < buf_end) { /* find start next marker */ start_code = ff_mjpeg_find_marker(s, &buf_ptr, buf_end, @@ -2448,7 +2385,7 @@ } else if (unescaped_buf_size > INT_MAX / 8) { av_log(avctx, AV_LOG_ERROR, "MJPEG packet 0x%x too big (%d/%d), corrupt data?\n", - start_code, unescaped_buf_size, s->pkt->size); + start_code, unescaped_buf_size, buf_size); return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n", @@ -2587,7 +2524,6 @@ } if (avctx->skip_frame == AVDISCARD_ALL) { s->got_picture = 0; - ret = AVERROR(EAGAIN); goto the_end_no_picture; } if (s->avctx->hwaccel) { @@ -2599,10 +2535,9 @@ } if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0) return ret; + *got_frame = 1; s->got_picture = 0; - frame->pkt_dts = s->pkt->dts; - if (!s->lossless && avctx->debug & FF_DEBUG_QP) { int qp = FFMAX3(s->qscale[0], s->qscale[1], @@ -2772,28 +2707,18 @@ } } if (s->flipped && !s->rgb) { - int j; ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); if (ret) return ret; - av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); + av_assert0(s->nb_components == av_pix_fmt_count_planes(frame->format)); for (index=0; indexnb_components; index++) { - uint8_t *dst = s->picture_ptr->data[index]; - int w = s->picture_ptr->width; - int h = s->picture_ptr->height; - if(index && index<3){ - w = AV_CEIL_RSHIFT(w, hshift); + int h = frame->height; + if (index && index < 3) h = AV_CEIL_RSHIFT(h, vshift); - } - if(dst){ - uint8_t *dst2 = dst + s->picture_ptr->linesize[index]*(h-1); - for (i=0; ipicture_ptr->linesize[index]; - dst2 -= s->picture_ptr->linesize[index]; - } + if (frame->data[index]) { + frame->data[index] += (h - 1) * frame->linesize[index]; + frame->linesize[index] *= -1; } } } @@ -2930,29 +2855,28 @@ av_dict_copy(&frame->metadata, s->exif_metadata, 0); av_dict_free(&s->exif_metadata); - if (avctx->codec_id == AV_CODEC_ID_SMVJPEG) { - ret = smv_process_frame(avctx, frame); - if (ret < 0) { - av_frame_unref(frame); - return ret; - } - } - if ((avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || + if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && + (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && avctx->coded_height > s->orig_height) { frame->height = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres); frame->crop_top = frame->height - avctx->height; } - ret = 0; - the_end_no_picture: av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n", buf_end - buf_ptr); + return buf_ptr - buf; +} - return ret; +int ff_mjpeg_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, + AVPacket *avpkt) +{ + return ff_mjpeg_decode_frame_from_buf(avctx, frame, got_frame, + avpkt, avpkt->data, avpkt->size); } + /* mxpeg may call the following function (with a blank MJpegDecodeContext) * even without having called ff_mjpeg_decode_init(). */ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) @@ -2960,7 +2884,7 @@ MJpegDecodeContext *s = avctx->priv_data; int i, j; - if (s->interlaced && s->bottom_field == !s->interlace_polarity && s->got_picture && !avctx->frame_number) { + if (s->interlaced && s->bottom_field == !s->interlace_polarity && s->got_picture && !avctx->frame_num) { av_log(avctx, AV_LOG_INFO, "Single field\n"); } @@ -3022,20 +2946,21 @@ const FFCodec ff_mjpeg_decoder = { .p.name = "mjpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), + CODEC_LONG_NAME("MJPEG (Motion JPEG)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, .p.priv_class = &mjpegdec_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_SETS_PKT_DTS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | + FF_CODEC_CAP_ICC_PROFILES, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MJPEG_NVDEC_HWACCEL HWACCEL_NVDEC(mjpeg), @@ -3050,34 +2975,95 @@ #if CONFIG_THP_DECODER const FFCodec ff_thp_decoder = { .p.name = "thp", - .p.long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"), + CODEC_LONG_NAME("Nintendo Gamecube THP video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_THP, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_SETS_PKT_DTS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_SMVJPEG_DECODER +// SMV JPEG just stacks several output frames into one JPEG picture +// we handle that by setting up the cropping parameters appropriately +static void smv_process_frame(AVCodecContext *avctx, AVFrame *frame) +{ + MJpegDecodeContext *s = avctx->priv_data; + + av_assert0((s->smv_next_frame + 1) * avctx->height <= avctx->coded_height); + + frame->width = avctx->coded_width; + frame->height = avctx->coded_height; + frame->crop_top = FFMIN(s->smv_next_frame * avctx->height, frame->height); + frame->crop_bottom = frame->height - (s->smv_next_frame + 1) * avctx->height; + + s->smv_next_frame = (s->smv_next_frame + 1) % s->smv_frames_per_jpeg; + + if (s->smv_next_frame == 0) + av_frame_unref(s->smv_frame); +} + +static int smvjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + MJpegDecodeContext *s = avctx->priv_data; + AVPacket *const pkt = avctx->internal->in_pkt; + int64_t pkt_dts; + int got_frame = 0; + int ret; + + if (s->smv_next_frame > 0) { + av_assert0(s->smv_frame->buf[0]); + ret = av_frame_ref(frame, s->smv_frame); + if (ret < 0) + return ret; + + smv_process_frame(avctx, frame); + return 0; + } + + ret = ff_decode_get_packet(avctx, pkt); + if (ret < 0) + return ret; + + ret = ff_mjpeg_decode_frame(avctx, frame, &got_frame, pkt); + pkt_dts = pkt->dts; + av_packet_unref(pkt); + if (ret < 0) + return ret; + + if (!got_frame) + return AVERROR(EAGAIN); + + frame->pkt_dts = pkt_dts; + + av_assert0(frame->buf[0]); + av_frame_unref(s->smv_frame); + ret = av_frame_ref(s->smv_frame, frame); + if (ret < 0) + return ret; + + smv_process_frame(avctx, frame); + return 0; +} + const FFCodec ff_smvjpeg_decoder = { .p.name = "smvjpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("SMV JPEG"), + CODEC_LONG_NAME("SMV JPEG"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SMVJPEG, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_RECEIVE_FRAME_CB(smvjpeg_receive_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | + .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegdec.h 2023-03-03 13:29:59.000000000 +0000 @@ -57,8 +57,6 @@ GetBitContext gb; int buf_size; - AVPacket *pkt; - int start_code; /* current start code */ int buffer_size; uint8_t *buffer; @@ -118,7 +116,7 @@ uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode) int palette_index; int force_pal8; - ScanTable scantable; + uint8_t permutated_scantable[64]; BlockDSPContext bdsp; HpelDSPContext hdsp; IDCTDSPContext idsp; @@ -173,7 +171,12 @@ const uint8_t *val_table, int is_ac, void *logctx); int ff_mjpeg_decode_init(AVCodecContext *avctx); int ff_mjpeg_decode_end(AVCodecContext *avctx); -int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame); +int ff_mjpeg_decode_frame(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + AVPacket *avpkt); +int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + const AVPacket *avpkt, const uint8_t *buf, int buf_size); int ff_mjpeg_decode_dqt(MJpegDecodeContext *s); int ff_mjpeg_decode_dht(MJpegDecodeContext *s); int ff_mjpeg_decode_sof(MJpegDecodeContext *s); @@ -184,6 +187,4 @@ const uint8_t **buf_ptr, const uint8_t *buf_end, const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size); -int ff_sp5x_process_packet(AVCodecContext *avctx, AVPacket *avpkt); - #endif /* AVCODEC_MJPEGDEC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -81,7 +81,7 @@ static void mjpeg_encode_picture_header(MpegEncContext *s) { ff_mjpeg_encode_picture_header(s->avctx, &s->pb, s->picture->f, s->mjpeg_ctx, - &s->intra_scantable, 0, + s->intra_scantable.permutated, 0, s->intra_matrix, s->chroma_intra_matrix, s->slice_context_count > 1); @@ -644,15 +644,16 @@ const FFCodec ff_mjpeg_encoder = { .p.name = "mjpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), + CODEC_LONG_NAME("MJPEG (Motion JPEG)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = mjpeg_encode_close, - .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, @@ -673,17 +674,18 @@ const FFCodec ff_amv_encoder = { .p.name = "amv", - .p.long_name = NULL_IF_CONFIG_SMALL("AMV Video"), + CODEC_LONG_NAME("AMV Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AMV, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(amv_encode_picture), .close = mjpeg_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE }, .p.priv_class = &amv_class, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,18 +58,16 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p, MJpegContext *m, - ScanTable *intra_scantable, + const uint8_t intra_matrix_permutation[64], uint16_t luma_intra_matrix[64], uint16_t chroma_intra_matrix[64], - int hsample[3], int use_slices) + int hsample[3], int use_slices, int matrices_differ) { int i, j, size; uint8_t *ptr; if (m) { - int matrix_count = 1 + !!memcmp(luma_intra_matrix, - chroma_intra_matrix, - sizeof(luma_intra_matrix[0]) * 64); + int matrix_count = 1 + matrices_differ; if (m->force_duplicated_matrix) matrix_count = 2; /* quant matrixes */ @@ -78,7 +76,7 @@ put_bits(p, 4, 0); /* 8 bit precision */ put_bits(p, 4, 0); /* table 0 */ for (int i = 0; i < 64; i++) { - uint8_t j = intra_scantable->permutated[i]; + uint8_t j = intra_matrix_permutation[i]; put_bits(p, 8, luma_intra_matrix[j]); } @@ -86,7 +84,7 @@ put_bits(p, 4, 0); /* 8 bit precision */ put_bits(p, 4, 1); /* table 1 */ for(i=0;i<64;i++) { - j = intra_scantable->permutated[i]; + j = intra_matrix_permutation[i]; put_bits(p, 8, chroma_intra_matrix[j]); } } @@ -277,7 +275,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb, const AVFrame *frame, struct MJpegContext *m, - ScanTable *intra_scantable, int pred, + const uint8_t intra_matrix_permutation[64], int pred, uint16_t luma_intra_matrix[64], uint16_t chroma_intra_matrix[64], int use_slices) @@ -285,9 +283,7 @@ const int lossless = !m; int hsample[4], vsample[4]; int components = 3 + (avctx->pix_fmt == AV_PIX_FMT_BGRA); - int chroma_matrix = !!memcmp(luma_intra_matrix, - chroma_intra_matrix, - sizeof(luma_intra_matrix[0])*64); + int chroma_matrix; ff_mjpeg_init_hvsample(avctx, hsample, vsample); @@ -299,9 +295,12 @@ jpeg_put_comments(avctx, pb, frame); - jpeg_table_header(avctx, pb, m, intra_scantable, + chroma_matrix = !lossless && !!memcmp(luma_intra_matrix, + chroma_intra_matrix, + sizeof(luma_intra_matrix[0]) * 64); + jpeg_table_header(avctx, pb, m, intra_matrix_permutation, luma_intra_matrix, chroma_intra_matrix, hsample, - use_slices); + use_slices, chroma_matrix); switch (avctx->codec_id) { case AV_CODEC_ID_MJPEG: put_marker(pb, SOF0 ); break; @@ -424,7 +423,6 @@ if(ff_count==0) return; - flush_put_bits(pb); skip_put_bytes(pb, ff_count); for(i=size-1; ff_count; i--){ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mjpegenc_common.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,6 @@ #include #include "avcodec.h" -#include "idctdsp.h" #include "put_bits.h" struct MJpegContext; @@ -33,7 +32,8 @@ size_t *max_pkt_size); void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb, const AVFrame *frame, struct MJpegContext *m, - ScanTable *intra_scantable, int pred, + const uint8_t intra_matrix_permutation[64], + int pred, uint16_t luma_intra_matrix[64], uint16_t chroma_intra_matrix[64], int use_slices); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,10 +36,8 @@ #include "libavutil/thread.h" #include "libavutil/opt.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" -#include "libavutil/crc.h" -#include "parser.h" #include "mlp_parse.h" #include "mlpdsp.h" #include "mlp.h" @@ -69,6 +67,8 @@ uint8_t min_channel; /// The index of the last channel coded in this substream. uint8_t max_channel; + /// The coded channels mask in this substream. + uint64_t coded_channels; /// The number of channels input into the rematrix stage. uint8_t max_matrix_channel; /// For each channel output by the matrix, the output channel to map it to @@ -153,6 +153,12 @@ /// Number of substreams contained within this stream. uint8_t num_substreams; + /// Which substream of substreams carry 16-channel presentation + uint8_t extended_substream_info; + + /// Which substream of substreams carry 2/6/8-channel presentation + uint8_t substream_info; + /// Index of the last substream to decode - further substreams are skipped. uint8_t max_decoded_substream; @@ -384,6 +390,7 @@ m->access_unit_size_pow2 = mh.access_unit_size_pow2; m->num_substreams = mh.num_substreams; + m->substream_info = mh.substream_info; /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */ m->max_decoded_substream = FFMIN(m->num_substreams - 1, 2); @@ -425,12 +432,18 @@ mh.stream_type); return AVERROR_PATCHWELCOME; } + m->substream[1].mask = mh.channel_layout_thd_stream1; if (mh.channels_thd_stream1 == 2 && mh.channels_thd_stream2 == 2 && m->avctx->ch_layout.nb_channels == 2) m->substream[0].mask = AV_CH_LAYOUT_STEREO; if ((substr = (mh.num_substreams > 1))) m->substream[0].mask = AV_CH_LAYOUT_STEREO; + if (mh.num_substreams == 1 && + mh.channels_thd_stream1 == 1 && + mh.channels_thd_stream2 == 1 && + m->avctx->ch_layout.nb_channels == 1) + m->substream[0].mask = AV_CH_LAYOUT_MONO; if (mh.num_substreams > 2) if (mh.channel_layout_thd_stream2) m->substream[2].mask = mh.channel_layout_thd_stream2; @@ -438,16 +451,6 @@ m->substream[2].mask = mh.channel_layout_thd_stream1; if (m->avctx->ch_layout.nb_channels > 2) m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream1; - - if (m->avctx->ch_layout.nb_channels <= 2 && - m->substream[substr].mask == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) { - av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n"); - m->max_decoded_substream = 0; - if (m->avctx->ch_layout.nb_channels == 2) { - av_channel_layout_uninit(&m->avctx->ch_layout); - m->avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; - } - } } m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20; @@ -541,15 +544,9 @@ return AVERROR_INVALIDDATA; } - if (max_channel != max_matrix_channel) { - av_log(m->avctx, AV_LOG_ERROR, - "Max channel must be equal max matrix channel.\n"); - return AVERROR_INVALIDDATA; - } - /* This should happen for TrueHD streams with >6 channels and MLP's noise * type. It is not yet known if this is allowed. */ - if (max_channel > MAX_MATRIX_CHANNEL_MLP && !noise_type) { + if (max_matrix_channel > MAX_MATRIX_CHANNEL_MLP && !noise_type) { avpriv_request_sample(m->avctx, "%d channels (more than the " "maximum supported by the decoder)", @@ -557,14 +554,12 @@ return AVERROR_PATCHWELCOME; } - if (min_channel > max_channel) { - av_log(m->avctx, AV_LOG_ERROR, - "Substream min channel cannot be greater than max channel.\n"); + if (max_channel + 1 > MAX_CHANNELS || max_channel + 1 < min_channel) return AVERROR_INVALIDDATA; - } s->min_channel = min_channel; s->max_channel = max_channel; + s->coded_channels = ((1LL << (max_channel - min_channel + 1)) - 1) << min_channel; s->max_matrix_channel = max_matrix_channel; s->noise_type = noise_type; @@ -1274,11 +1269,6 @@ for (substr = 0; substr <= m->max_decoded_substream; substr++) { SubStream *s = &m->substream[substr]; - if (substr != m->max_decoded_substream && - m->substream[m->max_decoded_substream].min_channel == 0 && - m->substream[m->max_decoded_substream].max_channel == avctx->ch_layout.nb_channels - 1) - goto skip_substr; - init_get_bits(&gb, buf, substream_data_len[substr] * 8); m->matrix_changed = 0; @@ -1303,6 +1293,28 @@ if (!s->restart_seen) goto next_substr; + if (((avctx->ch_layout.nb_channels == 6 && + ((m->substream_info >> 2) & 0x3) != 0x3) || + (avctx->ch_layout.nb_channels == 8 && + ((m->substream_info >> 4) & 0x7) != 0x7 && + ((m->substream_info >> 4) & 0x7) != 0x6 && + ((m->substream_info >> 4) & 0x7) != 0x3)) && + substr > 0 && substr < m->max_decoded_substream && + (s->min_channel <= m->substream[substr - 1].max_channel)) { + av_log(avctx, AV_LOG_DEBUG, + "Previous substream(%d) channels overlaps current substream(%d) channels, skipping.\n", + substr - 1, substr); + goto next_substr; + } + + if (substr != m->max_decoded_substream && + ((s->coded_channels & m->substream[m->max_decoded_substream].coded_channels) != 0)) { + av_log(avctx, AV_LOG_DEBUG, + "Current substream(%d) channels overlaps final substream(%d) channels, skipping.\n", + substr, m->max_decoded_substream); + goto next_substr; + } + if ((ret = read_block_data(m, &gb, substr)) < 0) return ret; @@ -1352,7 +1364,6 @@ av_log(m->avctx, AV_LOG_ERROR, "No restart header present in substream %d.\n", substr); -skip_substr: buf += substream_data_len[substr]; } @@ -1418,7 +1429,7 @@ #if CONFIG_MLP_DECODER const FFCodec ff_mlp_decoder = { .p.name = "mlp", - .p.long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), + CODEC_LONG_NAME("MLP (Meridian Lossless Packing)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MLP, .priv_data_size = sizeof(MLPDecodeContext), @@ -1427,13 +1438,12 @@ FF_CODEC_DECODE_CB(read_access_unit), .flush = mlp_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_TRUEHD_DECODER const FFCodec ff_truehd_decoder = { .p.name = "truehd", - .p.long_name = NULL_IF_CONFIG_SMALL("TrueHD"), + CODEC_LONG_NAME("TrueHD"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TRUEHD, .priv_data_size = sizeof(MLPDecodeContext), @@ -1442,6 +1452,5 @@ FF_CODEC_DECODE_CB(read_access_unit), .flush = mlp_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif /* CONFIG_TRUEHD_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "encode.h" #include "put_bits.h" #include "audio_frame_queue.h" +#include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/crc.h" #include "libavutil/avstring.h" @@ -122,6 +123,7 @@ /* channel_meaning */ int substream_info; + int thd_substream_info; int fs; int wordlength; int channel_occupancy; @@ -153,8 +155,8 @@ unsigned int min_restart_interval; ///< Min interval of access units in between two major frames. unsigned int restart_intervals; ///< Number of possible major frame sizes. - uint16_t timestamp; ///< Timestamp of current access unit. - uint16_t dts; ///< Decoding timestamp of current access unit. + uint16_t output_timing; ///< Timestamp of current access unit. + uint16_t input_timing; ///< Decoding timestamp of current access unit. uint8_t channel_arrangement; ///< channel arrangement for MLP streams @@ -479,6 +481,7 @@ static AVOnce init_static_once = AV_ONCE_INIT; MLPEncodeContext *ctx = avctx->priv_data; RestartHeader *const rh = &ctx->restart_header; + uint64_t channels_present; unsigned int sum = 0; size_t size; int ret; @@ -536,9 +539,8 @@ } ctx->substream_info |= SUBSTREAM_INFO_ALWAYS_SET; - if (avctx->ch_layout.nb_channels <= 2) { + if (avctx->ch_layout.nb_channels <= 2) ctx->substream_info |= SUBSTREAM_INFO_MAX_2_CHAN; - } switch (avctx->sample_fmt) { case AV_SAMPLE_FMT_S16: @@ -559,7 +561,7 @@ } ctx->coded_sample_fmt[1] = -1 & 0xf; - ctx->dts = -avctx->frame_size; + ctx->input_timing = -avctx->frame_size; ctx->num_channels = avctx->ch_layout.nb_channels + 2; /* +2 noise channels */ ctx->one_sample_buffer_size = avctx->frame_size @@ -589,23 +591,23 @@ ctx->num_substreams = 1; // TODO: change this after adding multi-channel support for TrueHD + channels_present = av_channel_layout_subset(&avctx->ch_layout, ~(uint64_t)0); if (ctx->avctx->codec_id == AV_CODEC_ID_MLP) { - static const AVChannelLayout layout_arrangement[] = { - AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, - AV_CHANNEL_LAYOUT_2_1, AV_CHANNEL_LAYOUT_QUAD, - AV_CHANNEL_LAYOUT_2POINT1, { 0 }, { 0 }, - AV_CHANNEL_LAYOUT_SURROUND, AV_CHANNEL_LAYOUT_4POINT0, - AV_CHANNEL_LAYOUT_5POINT0_BACK, AV_CHANNEL_LAYOUT_3POINT1, - AV_CHANNEL_LAYOUT_4POINT1, AV_CHANNEL_LAYOUT_5POINT1_BACK, + static const uint64_t layout_arrangement[] = { + AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_QUAD, + AV_CH_LAYOUT_2POINT1, 0, 0, + AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_3POINT1, + AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_5POINT1_BACK, }; int i; - for (i = 0; i < FF_ARRAY_ELEMS(layout_arrangement); i++) - if (!av_channel_layout_compare(&avctx->ch_layout, &layout_arrangement[i])) + for (i = 0;; i++) { + av_assert1(i < FF_ARRAY_ELEMS(layout_arrangement) || + !"Impossible channel layout"); + if (channels_present == layout_arrangement[i]) break; - if (i == FF_ARRAY_ELEMS(layout_arrangement)) { - av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n"); - return AVERROR(EINVAL); } ctx->channel_arrangement = i; ctx->flags = FLAGS_DVDA; @@ -613,27 +615,32 @@ ctx->summary_info = ff_mlp_ch_info[ctx->channel_arrangement].summary_info ; } else { /* TrueHD */ - if (!av_channel_layout_compare(&avctx->ch_layout, - &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) { - ctx->ch_modifier_thd0 = 0; - ctx->ch_modifier_thd1 = 0; - ctx->ch_modifier_thd2 = 0; + if (channels_present == AV_CH_LAYOUT_MONO) { + ctx->ch_modifier_thd0 = 3; + ctx->ch_modifier_thd1 = 3; + ctx->ch_modifier_thd2 = 3; + ctx->channel_arrangement = 2; + ctx->thd_substream_info = 0x14; + } else if (channels_present == AV_CH_LAYOUT_STEREO) { + ctx->ch_modifier_thd0 = 1; + ctx->ch_modifier_thd1 = 1; + ctx->ch_modifier_thd2 = 1; ctx->channel_arrangement = 1; - } else if (!av_channel_layout_compare(&avctx->ch_layout, - &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT0_BACK)) { + ctx->thd_substream_info = 0x14; + } else if (channels_present == AV_CH_LAYOUT_5POINT0) { ctx->ch_modifier_thd0 = 1; ctx->ch_modifier_thd1 = 1; ctx->ch_modifier_thd2 = 1; ctx->channel_arrangement = 11; - } else if (!av_channel_layout_compare(&avctx->ch_layout, - &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1_BACK)) { + ctx->thd_substream_info = 0x104; + } else if (channels_present == AV_CH_LAYOUT_5POINT1) { ctx->ch_modifier_thd0 = 2; ctx->ch_modifier_thd1 = 1; ctx->ch_modifier_thd2 = 2; ctx->channel_arrangement = 15; + ctx->thd_substream_info = 0x104; } else { - av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n"); - return AVERROR(EINVAL); + av_assert1(!"AVCodec.ch_layouts needs to be updated"); } ctx->flags = 0; ctx->channel_occupancy = 0; @@ -718,7 +725,9 @@ } else if (ctx->avctx->codec_id == AV_CODEC_ID_TRUEHD) { put_bits(&pb, 8, SYNC_TRUEHD ); put_bits(&pb, 4, ctx->coded_sample_rate[0]); - put_bits(&pb, 4, 0 ); /* ignored */ + put_bits(&pb, 1, 0 ); /* 6ch multichannel type */ + put_bits(&pb, 1, 0 ); /* 8ch multichannel type */ + put_bits(&pb, 2, 0 ); /* ignored */ put_bits(&pb, 2, ctx->ch_modifier_thd0 ); put_bits(&pb, 2, ctx->ch_modifier_thd1 ); put_bits(&pb, 5, ctx->channel_arrangement ); @@ -732,20 +741,41 @@ put_bits(&pb, 1, 1 ); /* is_vbr */ put_bits(&pb, 15, ctx->coded_peak_bitrate ); put_bits(&pb, 4, 1 ); /* num_substreams */ - put_bits(&pb, 4, 0x1 ); /* ignored */ + put_bits(&pb, 2, 0 ); /* ignored */ + put_bits(&pb, 2, 0 ); /* extended substream info */ /* channel_meaning */ - put_bits(&pb, 8, ctx->substream_info ); - put_bits(&pb, 5, ctx->fs ); - put_bits(&pb, 5, ctx->wordlength ); - put_bits(&pb, 6, ctx->channel_occupancy ); - put_bits(&pb, 3, 0 ); /* ignored */ - put_bits(&pb, 10, 0 ); /* speaker_layout */ - put_bits(&pb, 3, 0 ); /* copy_protection */ - put_bits(&pb, 16, 0x8080 ); /* ignored */ - put_bits(&pb, 7, 0 ); /* ignored */ - put_bits(&pb, 4, 0 ); /* source_format */ - put_bits(&pb, 5, ctx->summary_info ); + if (ctx->avctx->codec_id == AV_CODEC_ID_MLP) { + put_bits(&pb, 8, ctx->substream_info ); + put_bits(&pb, 5, ctx->fs ); + put_bits(&pb, 5, ctx->wordlength ); + put_bits(&pb, 6, ctx->channel_occupancy ); + put_bits(&pb, 3, 0 ); /* ignored */ + put_bits(&pb, 10, 0 ); /* speaker_layout */ + put_bits(&pb, 3, 0 ); /* copy_protection */ + put_bits(&pb, 16, 0x8080 ); /* ignored */ + put_bits(&pb, 7, 0 ); /* ignored */ + put_bits(&pb, 4, 0 ); /* source_format */ + put_bits(&pb, 5, ctx->summary_info ); + } else if (ctx->avctx->codec_id == AV_CODEC_ID_TRUEHD) { + put_bits(&pb, 8, ctx->thd_substream_info ); + put_bits(&pb, 6, 0 ); /* reserved */ + put_bits(&pb, 1, 0 ); /* 2ch control enabled */ + put_bits(&pb, 1, 0 ); /* 6ch control enabled */ + put_bits(&pb, 1, 0 ); /* 8ch control enabled */ + put_bits(&pb, 1, 0 ); /* reserved */ + put_bits(&pb, 7, 0 ); /* drc start up gain */ + put_bits(&pb, 6, 0 ); /* 2ch dialogue norm */ + put_bits(&pb, 6, 0 ); /* 2ch mix level */ + put_bits(&pb, 5, 0 ); /* 6ch dialogue norm */ + put_bits(&pb, 6, 0 ); /* 6ch mix level */ + put_bits(&pb, 5, 0 ); /* 6ch source format */ + put_bits(&pb, 5, 0 ); /* 8ch dialogue norm */ + put_bits(&pb, 6, 0 ); /* 8ch mix level */ + put_bits(&pb, 6, 0 ); /* 8ch source format */ + put_bits(&pb, 1, 0 ); /* reserved */ + put_bits(&pb, 1, 0 ); /* extra channel meaning present */ + } flush_put_bits(&pb); @@ -765,7 +795,7 @@ uint8_t checksum; put_bits(pb, 14, 0x31ea ); /* TODO 0x31eb */ - put_bits(pb, 16, ctx->timestamp ); + put_bits(pb, 16, ctx->output_timing ); put_bits(pb, 4, rh->min_channel ); put_bits(pb, 4, rh->max_channel ); put_bits(pb, 4, rh->max_matrix_channel); @@ -1092,7 +1122,7 @@ uint16_t access_unit_header = 0; uint16_t parity_nibble = 0; - parity_nibble = ctx->dts; + parity_nibble = ctx->input_timing; parity_nibble ^= length; for (unsigned int substr = 0; substr < ctx->num_substreams; substr++) { @@ -1118,7 +1148,7 @@ access_unit_header |= length & 0xFFF; AV_WB16(frame_header , access_unit_header); - AV_WB16(frame_header+2, ctx->dts ); + AV_WB16(frame_header+2, ctx->input_timing ); } /** Writes an entire access unit to the bitstream. */ @@ -1202,7 +1232,7 @@ } /** Wrapper function for inputting data in two different bit-depths. */ -static void input_data(MLPEncodeContext *ctx, void *samples, int nb_samples) +static void input_data(MLPEncodeContext *ctx, const void *samples, int nb_samples) { input_data_internal(ctx, samples, nb_samples, ctx->avctx->sample_fmt == AV_SAMPLE_FMT_S32); } @@ -2069,7 +2099,7 @@ int bytes_written = 0; int channels = avctx->ch_layout.nb_channels; int restart_frame, ret; - uint8_t *data; + const uint8_t *data; if (!frame && !ctx->last_frames) ctx->last_frames = (ctx->afq.remaining_samples + avctx->frame_size - 1) / avctx->frame_size; @@ -2088,7 +2118,7 @@ data = frame ? frame->data[0] : NULL; - ctx->frame_index = avctx->frame_number % ctx->max_restart_interval; + ctx->frame_index = avctx->frame_num % ctx->max_restart_interval; ctx->inout_buffer = ctx->major_inout_buffer + ctx->frame_index * ctx->one_sample_buffer_size; @@ -2098,7 +2128,7 @@ ctx->write_buffer = ctx->inout_buffer; - if (avctx->frame_number < ctx->max_restart_interval) { + if (avctx->frame_num < ctx->max_restart_interval) { if (data) goto input_and_return; } @@ -2117,8 +2147,8 @@ bytes_written = write_access_unit(ctx, avpkt->data, avpkt->size, restart_frame); - ctx->timestamp += avctx->frame_size; - ctx->dts += avctx->frame_size; + ctx->output_timing += avctx->frame_size; + ctx->input_timing += avctx->frame_size; input_and_return: @@ -2156,7 +2186,8 @@ input_to_sample_buffer(ctx); - analyze_sample_buffer(ctx); + if (number_of_samples > 0) + analyze_sample_buffer(ctx); } if (ctx->frame_index == (ctx->max_restart_interval - 1)) { @@ -2168,7 +2199,7 @@ } if (!frame && ctx->last_frames < ctx->max_restart_interval - 1) - avctx->frame_number++; + avctx->frame_num++; if (bytes_written > 0) { ff_af_queue_remove(&ctx->afq, @@ -2210,45 +2241,45 @@ #if CONFIG_MLP_ENCODER const FFCodec ff_mlp_encoder = { .p.name ="mlp", - .p.long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), + CODEC_LONG_NAME("MLP (Meridian Lossless Packing)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MLP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_EXPERIMENTAL, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .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}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_mlp_channel_layouts, -#endif + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) .p.ch_layouts = ff_mlp_ch_layouts, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_TRUEHD_ENCODER const FFCodec ff_truehd_encoder = { .p.name ="truehd", - .p.long_name = NULL_IF_CONFIG_SMALL("TrueHD"), + CODEC_LONG_NAME("TrueHD"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TRUEHD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_EXPERIMENTAL, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .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}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]) { + AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, - AV_CHANNEL_LAYOUT_5POINT0_BACK, - AV_CHANNEL_LAYOUT_5POINT1_BACK, + AV_CHANNEL_LAYOUT_5POINT0, + AV_CHANNEL_LAYOUT_5POINT1, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.c 2023-03-03 13:29:59.000000000 +0000 @@ -159,7 +159,11 @@ mh->num_substreams = get_bits(gb, 4); - skip_bits_long(gb, 4 + (header_size - 17) * 8); + skip_bits(gb, 2); + mh->extended_substream_info = get_bits(gb, 2); + mh->substream_info = get_bits(gb, 8); + + skip_bits_long(gb, (header_size - 18) * 8); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mlp_parse.h 2023-03-03 13:29:59.000000000 +0000 @@ -58,6 +58,9 @@ int peak_bitrate; ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR int num_substreams; ///< Number of substreams within stream + + int extended_substream_info; ///< Which substream of substreams carry 16-channel presentation + int substream_info; ///< Which substream of substreams carry 2/6/8-channel presentation } MLPHeaderInfo; static const uint8_t thd_chancount[13] = { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmaldec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmaldec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmaldec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmaldec.c 2023-03-03 13:29:59.000000000 +0000 @@ -831,7 +831,7 @@ #define FFMMAL_DEC(NAME, ID) \ const FFCodec ff_##NAME##_mmal_decoder = { \ .p.name = #NAME "_mmal", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \ + CODEC_LONG_NAME(#NAME " (mmal)"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = ID, \ .priv_data_size = sizeof(MMALDecodeContext), \ @@ -841,7 +841,8 @@ .flush = ffmmal_flush, \ .p.priv_class = &ffmmal_dec_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \ - .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_SETS_PKT_DTS, \ .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \ AV_PIX_FMT_YUV420P, \ AV_PIX_FMT_NONE}, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mmvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define MM_PREAMBLE_SIZE 6 @@ -240,7 +240,7 @@ const FFCodec ff_mmvideo_decoder = { .p.name = "mmvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("American Laser Games MM Video"), + CODEC_LONG_NAME("American Laser Games MM Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MMVIDEO, .priv_data_size = sizeof(MmContext), @@ -248,5 +248,4 @@ .close = mm_decode_end, FF_CODEC_DECODE_CB(mm_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mobiclip.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mobiclip.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mobiclip.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mobiclip.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,12 +27,12 @@ #include "libavutil/thread.h" #include "avcodec.h" -#include "bytestream.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "golomb.h" -#include "internal.h" +#include "mathops.h" #define MOBI_RL_VLC_BITS 12 #define MOBI_MV_VLC_BITS 6 @@ -1216,6 +1216,9 @@ AVFrame *frame = s->pic[s->current_pic]; int ret; + if (avctx->height/16 * (avctx->width/16) * 2 > 8LL*FFALIGN(pkt->size, 2)) + return AVERROR_INVALIDDATA; + av_fast_padded_malloc(&s->bitstream, &s->bitstream_size, pkt->size); @@ -1342,7 +1345,7 @@ const FFCodec ff_mobiclip_decoder = { .p.name = "mobiclip", - .p.long_name = NULL_IF_CONFIG_SMALL("MobiClip Video"), + CODEC_LONG_NAME("MobiClip Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MOBICLIP, .priv_data_size = sizeof(MobiClipContext), @@ -1351,5 +1354,5 @@ .flush = mobiclip_flush, .close = mobiclip_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.c 2023-03-03 13:29:59.000000000 +0000 @@ -79,7 +79,10 @@ #define FLAG_CHROMA 2 #define FLAG_DIRECT 4 -static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){ +static inline void init_ref(MotionEstContext *c, uint8_t *const src[3], + uint8_t *const ref[3], uint8_t *const ref2[3], + int x, int y, int ref_index) +{ const int offset[3]= { y*c-> stride + x, ((y*c->uvstride + x)>>1), @@ -110,8 +113,8 @@ const int stride= c->stride; const int hx = subx + x * (1 << (1 + qpel)); const int hy = suby + y * (1 << (1 + qpel)); - uint8_t * const * const ref= c->ref[ref_index]; - uint8_t * const * const src= c->src[src_index]; + const uint8_t * const * const ref = c->ref[ref_index]; + const uint8_t * const * const src = c->src[src_index]; int d; //FIXME check chroma 4mv, (no crashes ...) av_assert2(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)); @@ -184,8 +187,8 @@ const int dxy= subx + (suby<<(1+qpel)); //FIXME log2_subpel? const int hx= subx + x*(1<<(1+qpel)); const int hy= suby + y*(1<<(1+qpel)); - uint8_t * const * const ref= c->ref[ref_index]; - uint8_t * const * const src= c->src[src_index]; + const uint8_t * const * const ref = c->ref[ref_index]; + const uint8_t * const * const src = c->src[src_index]; int d; //FIXME check chroma 4mv, (no crashes ...) int uvdxy; /* no, it might not be used uninitialized */ @@ -293,7 +296,7 @@ #include "motion_est_template.c" -static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b, +static int zero_cmp(MpegEncContext *s, const uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h) { return 0; @@ -396,7 +399,7 @@ MotionEstContext * const c= &s->me; const int penalty_factor= c->sub_penalty_factor; int mx, my, dminh; - uint8_t *pix, *ptr; + const uint8_t *pix, *ptr; int stride= c->stride; LOAD_COMMON @@ -641,7 +644,7 @@ const int offset= ((block&1) + (block>>1)*stride)*8; uint8_t *dest_y = c->scratchpad + offset; if(s->quarter_sample){ - uint8_t *ref= c->ref[block][0] + (mx4>>2) + (my4>>2)*stride; + const uint8_t *ref = c->ref[block][0] + (mx4>>2) + (my4>>2)*stride; dxy = ((my4 & 3) << 2) | (mx4 & 3); if(s->no_rounding) @@ -649,7 +652,7 @@ else s->qdsp.put_qpel_pixels_tab[1][dxy](dest_y, ref, stride); }else{ - uint8_t *ref= c->ref[block][0] + (mx4>>1) + (my4>>1)*stride; + const uint8_t *ref = c->ref[block][0] + (mx4>>1) + (my4>>1)*stride; dxy = ((my4 & 1) << 1) | (mx4 & 1); if(s->no_rounding) @@ -805,7 +808,7 @@ int dxy; //FIXME chroma ME - uint8_t *ref= c->ref[field_select+ref_index][0] + (mx_i>>1) + (my_i>>1)*stride; + const uint8_t *ref = c->ref[field_select+ref_index][0] + (mx_i>>1) + (my_i>>1)*stride; dxy = ((my_i & 1) << 1) | (mx_i & 1); if(s->no_rounding){ @@ -885,14 +888,13 @@ int mb_x, int mb_y) { MotionEstContext * const c= &s->me; - uint8_t *pix, *ppix; + const uint8_t *pix, *ppix; int sum, mx = 0, my = 0, dmin = 0; int varc; ///< the variance of the block (sum of squared (p[y][x]-average)) int vard; ///< sum of squared differences with the estimated motion vector int P[10][2]; const int shift= 1+s->quarter_sample; int mb_type=0; - Picture * const pic= &s->current_picture; init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0); @@ -914,8 +916,8 @@ varc = s->mpvencdsp.pix_norm1(pix, s->linesize) - (((unsigned) sum * sum) >> 8) + 500; - pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8; - pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8; + s->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8; + s->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8; c->mb_var_sum_temp += (varc+128)>>8; if (s->motion_est != FF_ME_ZERO) { @@ -962,7 +964,7 @@ vard = s->mecc.sse[0](NULL, pix, ppix, s->linesize, 16); - pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8; + s->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8; c->mc_mb_var_sum_temp += (vard+128)>>8; if (c->avctx->mb_decision > FF_MB_DECISION_SIMPLE) { @@ -1187,13 +1189,13 @@ const uint8_t * const mv_penalty_b = c->mv_penalty[s->b_code] + MAX_DMV; // f_code of the prev frame int stride= c->stride; uint8_t *dest_y = c->scratchpad; - uint8_t *ptr; + const uint8_t *ptr; int dxy; int src_x, src_y; int fbmin; - uint8_t **src_data= c->src[0]; - uint8_t **ref_data= c->ref[0]; - uint8_t **ref2_data= c->ref[2]; + const uint8_t *const *src_data = c->src[0]; + const uint8_t *const *ref_data = c->ref[0]; + const uint8_t *const *ref2_data = c->ref[2]; if(s->quarter_sample){ dxy = ((motion_fy & 3) << 2) | (motion_fx & 3); @@ -1506,7 +1508,7 @@ score= ((unsigned)(score*score + 128*256))>>16; c->mc_mb_var_sum_temp += score; - s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE + s->mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0; return; @@ -1571,7 +1573,7 @@ score= ((unsigned)(score*score + 128*256))>>16; c->mc_mb_var_sum_temp += score; - s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE + s->mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE } if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){ @@ -1626,7 +1628,8 @@ continue; for(j=0; jpict_type==AV_PICTURE_TYPE_B || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy]) + if (s->pict_type == AV_PICTURE_TYPE_B || + s->mc_mb_var[xy] < s->mb_var[xy]) score[j]-= 170; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est.h 2023-03-03 13:29:59.000000000 +0000 @@ -51,10 +51,7 @@ int direct_basis_mv[4][2]; uint8_t *scratchpad; /**< data area for the ME algo, so that * the ME does not need to malloc/free. */ - uint8_t *best_mb; - uint8_t *temp_mb[2]; uint8_t *temp; - int best_bits; uint32_t *map; ///< map to avoid duplicate evaluations uint32_t *score_map; ///< map to store the scores unsigned map_generation; @@ -77,8 +74,8 @@ int ymax; int pred_x; int pred_y; - uint8_t *src[4][4]; - uint8_t *ref[4][4]; + const uint8_t *src[4][4]; + const uint8_t *ref[4][4]; int stride; int uvstride; /* temp variables for picture complexity calculation */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motion_est_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -281,7 +281,7 @@ for(i=0; i<8; i++){ if(score < best[i]){ memmove(&best[i+1], &best[i], sizeof(int)*(7-i)); - memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i)); + memmove(&best_pos[i + 1], &best_pos[i], sizeof(*best_pos) * (7 - i)); best[i]= score; best_pos[i][0]= nx + 4*mx; best_pos[i][1]= ny + 4*my; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motionpixels.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motionpixels.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motionpixels.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/motionpixels.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "get_bits.h" #include "bswapdsp.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define MAX_HUFF_CODES 16 @@ -185,7 +185,7 @@ int color; color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2]; - return mp_rgb_yuv_table[color]; + return mp_rgb_yuv_table[color & 0x7FFF]; } static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p) @@ -347,7 +347,7 @@ const FFCodec ff_motionpixels_decoder = { .p.name = "motionpixels", - .p.long_name = NULL_IF_CONFIG_SMALL("Motion Pixels video"), + CODEC_LONG_NAME("Motion Pixels video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MOTIONPIXELS, .priv_data_size = sizeof(MotionPixelsContext), @@ -355,5 +355,5 @@ .close = mp_decode_end, FF_CODEC_DECODE_CB(mp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -593,7 +593,7 @@ const FFCodec ff_movtext_decoder = { .p.name = "mov_text", - .p.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), + CODEC_LONG_NAME("3GPP Timed Text subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MOV_TEXT, .priv_data_size = sizeof(MovTextContext), @@ -602,5 +602,4 @@ FF_CODEC_DECODE_SUB_CB(mov_text_decode_frame), .close = mov_text_decode_close, .flush = mov_text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/movtextenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -701,7 +701,7 @@ const FFCodec ff_movtext_encoder = { .p.name = "mov_text", - .p.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), + CODEC_LONG_NAME("3GPP Timed Text subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MOV_TEXT, .priv_data_size = sizeof(MovTextContext), @@ -709,5 +709,5 @@ .init = mov_text_encode_init, FF_CODEC_ENCODE_SUB_CB(mov_text_encode_frame), .close = mov_text_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc7.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc7.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc7.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc7.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,8 +33,8 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "mpegaudiodsp.h" #include "mpc.h" @@ -311,7 +311,7 @@ const FFCodec ff_mpc7_decoder = { .p.name = "mpc7", - .p.long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"), + CODEC_LONG_NAME("Musepack SV7"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MUSEPACK7, .priv_data_size = sizeof(MPCContext), @@ -322,5 +322,4 @@ .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpc8.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,8 +30,8 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "mpegaudiodsp.h" #include "mpc.h" @@ -385,7 +385,7 @@ const FFCodec ff_mpc8_decoder = { .p.name = "mpc8", - .p.long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"), + CODEC_LONG_NAME("Musepack SV8"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MUSEPACK8, .priv_data_size = sizeof(MPCContext), @@ -395,5 +395,4 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,9 +34,10 @@ #include "avcodec.h" #include "mpegvideo.h" #include "mpeg12.h" +#include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12dec.h" -#include "mpegvideodata.h" +#include "rl.h" #include "startcode.h" static const uint8_t table_mb_ptype[7][2] = { @@ -63,13 +64,15 @@ { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -av_cold void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags) +av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags) { int i; 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, rl->n + 2, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); + 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); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -83,31 +86,23 @@ run = 0; level = code; } else { - if (code == rl->n) { //esc + if (code == n) { //esc run = 65; level = 0; - } else if (code == rl->n+1) { //eob + } else if (code == n + 1) { //eob run = 0; level = 127; } else { - run = rl->table_run [code] + 1; - level = rl->table_level[code]; + run = table_run [code] + 1; + level = table_level[code]; } } - rl->rl_vlc[0][i].len = len; - rl->rl_vlc[0][i].level = level; - rl->rl_vlc[0][i].run = run; + rl_vlc[i].len = len; + rl_vlc[i].level = level; + rl_vlc[i].run = run; } } -av_cold void ff_mpeg12_common_init(MpegEncContext *s) -{ - - s->y_dc_scale_table = - s->c_dc_scale_table = ff_mpeg2_dc_scale_table[s->intra_dc_precision]; - -} - void ff_mpeg1_clean_buffers(MpegEncContext *s) { s->last_dc[0] = 1 << (7 + s->intra_dc_precision); @@ -130,6 +125,9 @@ VLC ff_mb_btype_vlc; VLC ff_mb_pat_vlc; +RL_VLC_ELEM ff_mpeg1_rl_vlc[680]; +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, @@ -155,8 +153,12 @@ &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); - INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); - INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); + ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, + FF_ARRAY_ELEMS(ff_mpeg1_rl_vlc), 0); + ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, + FF_ARRAY_ELEMS(ff_mpeg2_rl_vlc), 0); } av_cold void ff_mpeg12_init_vlcs(void) @@ -165,72 +167,6 @@ ff_thread_once(&init_static_once, mpeg12_init_vlcs); } -#if FF_API_FLAG_TRUNCATED -/** - * Find the end of the current frame in the bitstream. - * @return the position of the first byte of the next frame, or -1 - */ -int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s) -{ - int i; - uint32_t state = pc->state; - - /* EOF considered as end of frame */ - if (buf_size == 0) - return 0; - -/* - 0 frame start -> 1/4 - 1 first_SEQEXT -> 0/2 - 2 first field start -> 3/0 - 3 second_SEQEXT -> 2/0 - 4 searching end -*/ - - for (i = 0; i < buf_size; i++) { - av_assert1(pc->frame_start_found >= 0 && pc->frame_start_found <= 4); - if (pc->frame_start_found & 1) { - if (state == EXT_START_CODE && (buf[i] & 0xF0) != 0x80) - pc->frame_start_found--; - else if (state == EXT_START_CODE + 2) { - if ((buf[i] & 3) == 3) - pc->frame_start_found = 0; - else - pc->frame_start_found = (pc->frame_start_found + 1) & 3; - } - state++; - } else { - i = avpriv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1; - if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) { - i++; - pc->frame_start_found = 4; - } - if (state == SEQ_END_CODE) { - pc->frame_start_found = 0; - pc->state=-1; - return i+1; - } - if (pc->frame_start_found == 2 && state == SEQ_START_CODE) - pc->frame_start_found = 0; - if (pc->frame_start_found < 4 && state == EXT_START_CODE) - pc->frame_start_found++; - if (pc->frame_start_found == 4 && (state & 0xFFFFFF00) == 0x100) { - if (state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE) { - pc->frame_start_found = 0; - pc->state = -1; - return i - 3; - } - } - if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) { - ff_fetch_timestamp(s, i - 3, 1, i > 3); - } - } - } - pc->state = state; - return END_NOT_FOUND; -} -#endif - #define MAX_INDEX (64 - 1) int ff_mpeg1_decode_block_intra(GetBitContext *gb, @@ -239,7 +175,6 @@ int16_t *block, int index, int qscale) { int dc, diff, i = 0, component; - RLTable *rl = &ff_rl_mpeg1; /* DC coefficient */ component = index <= 3 ? 0 : index - 4 + 1; @@ -264,7 +199,7 @@ while (1) { int level, run, j; - GET_RL_VLC(level, run, re, gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12codecs.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12codecs.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12codecs.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12codecs.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * MPEG-1/2 codecs common code + * Copyright (c) 2007 Aurelien Jacobs + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_MPEG12CODECS_H +#define AVCODEC_MPEG12CODECS_H + +#include "mpegvideo.h" + +void ff_mpeg1_clean_buffers(MpegEncContext *s); + +#endif /* AVCODEC_MPEG12CODECS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ */ #include "mpeg12data.h" +#include "mpeg12vlc.h" const uint16_t ff_mpeg1_default_intra_matrix[256] = { 8, 16, 19, 22, 26, 27, 29, 34, @@ -63,7 +64,7 @@ 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, }; -static const uint16_t mpeg1_vlc[113][2] = { +const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 }, { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 }, { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 }, @@ -96,7 +97,7 @@ { 0x2, 2 }, /* EOB */ }; -static const uint16_t mpeg2_vlc[113][2] = { +const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, @@ -129,7 +130,7 @@ {0x06,4}, /* EOB */ }; -static const int8_t mpeg1_level[111] = { +const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -146,7 +147,7 @@ 1, 1, 1, 1, 1, 1, 1, }; -static const int8_t mpeg1_run[111] = { +const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -163,22 +164,6 @@ 25, 26, 27, 28, 29, 30, 31, }; -RLTable ff_rl_mpeg1 = { - 111, - 111, - mpeg1_vlc, - mpeg1_run, - mpeg1_level, -}; - -RLTable ff_rl_mpeg2 = { - 111, - 111, - mpeg2_vlc, - mpeg1_run, - mpeg1_level, -}; - const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { {0x1, 1}, {0x3, 3}, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12data.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,6 @@ #include #include "libavutil/rational.h" -#include "rl.h" extern const uint16_t ff_mpeg1_default_intra_matrix[]; extern const uint16_t ff_mpeg1_default_non_intra_matrix[64]; @@ -40,9 +39,6 @@ extern const uint16_t ff_mpeg12_vlc_dc_chroma_code[12]; extern const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12]; -extern RLTable ff_rl_mpeg1; -extern RLTable ff_rl_mpeg2; - extern const uint8_t ff_mpeg12_mbAddrIncrTable[36][2]; extern const uint8_t ff_mpeg12_mbPatTable[64][2]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,12 +40,14 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "error_resilience.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" #include "mpeg_er.h" #include "mpeg12.h" +#include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12dec.h" #include "mpegutils.h" @@ -150,7 +152,6 @@ int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix = s->inter_matrix; const int qscale = s->qscale; @@ -173,7 +174,7 @@ } /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -239,7 +240,6 @@ int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const int qscale = s->qscale; @@ -262,7 +262,7 @@ /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -324,7 +324,6 @@ int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -356,7 +355,7 @@ /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { @@ -414,7 +413,6 @@ int16_t *block, int n) { int level, i, j, run; - RLTable *rl = &ff_rl_mpeg1; uint8_t *const scantable = s->intra_scantable.permutated; const int qscale = s->qscale; OPEN_READER(re, &s->gb); @@ -435,7 +433,7 @@ /* now quantify & encode AC coefficients */ for (;;) { - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); + GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { i += run; @@ -487,7 +485,7 @@ { int level, dc, diff, i, j, run; int component; - RLTable *rl; + const RL_VLC_ELEM *rl_vlc; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -510,16 +508,16 @@ mismatch = block[0] ^ 1; i = 0; if (s->intra_vlc_format) - rl = &ff_rl_mpeg2; + rl_vlc = ff_mpeg2_rl_vlc; else - rl = &ff_rl_mpeg1; + rl_vlc = ff_mpeg1_rl_vlc; { OPEN_READER(re, &s->gb); /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { @@ -573,7 +571,7 @@ { int level, dc, diff, i, j, run; int component; - RLTable *rl; + const RL_VLC_ELEM *rl_vlc; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; const int qscale = s->qscale; @@ -593,16 +591,16 @@ block[0] = dc * (1 << (3 - s->intra_dc_precision)); i = 0; if (s->intra_vlc_format) - rl = &ff_rl_mpeg2; + rl_vlc = ff_mpeg2_rl_vlc; else - rl = &ff_rl_mpeg1; + rl_vlc = ff_mpeg1_rl_vlc; { OPEN_READER(re, &s->gb); /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); - GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], + GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0); if (level >= 64 || i > 63) { @@ -1061,7 +1059,6 @@ /* we need some permutation to store matrices, * until the decoder sets the real permutation. */ ff_mpv_idct_init(s2); - ff_mpeg12_common_init(&s->mpeg_enc_ctx); ff_mpeg12_init_vlcs(); s2->chroma_format = 1; @@ -1242,14 +1239,7 @@ (s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) || 0) { if (s1->mpeg_enc_ctx_allocated) { -#if FF_API_FLAG_TRUNCATED - ParseContext pc = s->parse_context; - s->parse_context.buffer = 0; ff_mpv_common_end(s); - s->parse_context = pc; -#else - ff_mpv_common_end(s); -#endif s1->mpeg_enc_ctx_allocated = 0; } @@ -1697,7 +1687,10 @@ av_assert0(mb_y < s->mb_height); - init_get_bits(&s->gb, *buf, buf_size * 8); + ret = init_get_bits8(&s->gb, *buf, buf_size); + if (ret < 0) + return ret; + if (s->codec_id != AV_CODEC_ID_MPEG1VIDEO && s->mb_height > 2800/16) skip_bits(&s->gb, 3); @@ -1787,7 +1780,7 @@ return ret; // Note motion_val is normally NULL unless we want to extract the MVs. - if (s->current_picture.motion_val[0] && !s->encoding) { + if (s->current_picture.motion_val[0]) { const int wrap = s->b8_stride; int xy = s->mb_x * 2 + s->mb_y * 2 * wrap; int b8_xy = 4 * (s->mb_x + s->mb_y * s->mb_stride); @@ -2066,7 +2059,9 @@ int width, height; int i, v, j; - init_get_bits(&s->gb, buf, buf_size * 8); + int ret = init_get_bits8(&s->gb, buf, buf_size); + if (ret < 0) + return ret; width = get_bits(&s->gb, 12); height = get_bits(&s->gb, 12); @@ -2231,7 +2226,9 @@ int cc_count = 0; int i, ret; - init_get_bits8(&gb, p + 2, buf_size - 2); + ret = init_get_bits8(&gb, p + 2, buf_size - 2); + if (ret < 0) + return ret; cc_count = get_bits(&gb, 5); if (cc_count > 0) { int old_size = s1->a53_buf_ref ? s1->a53_buf_ref->size : 0; @@ -2403,7 +2400,7 @@ } } -static void mpeg_decode_gop(AVCodecContext *avctx, +static int mpeg_decode_gop(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { Mpeg1Context *s1 = avctx->priv_data; @@ -2411,7 +2408,9 @@ int broken_link; int64_t tc; - init_get_bits(&s->gb, buf, buf_size * 8); + int ret = init_get_bits8(&s->gb, buf, buf_size); + if (ret < 0) + return ret; tc = s1->timecode_frame_start = get_bits(&s->gb, 25); @@ -2428,6 +2427,8 @@ "GOP (%s) closed_gop=%d broken_link=%d\n", tcbuf, s1->closed_gop, broken_link); } + + return 0; } static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, @@ -2474,11 +2475,7 @@ if (avctx->err_recognition & AV_EF_EXPLODE && s2->er.error_count) return AVERROR_INVALIDDATA; -#if FF_API_FLAG_TRUNCATED - return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index); -#else return FFMAX(0, buf_ptr - buf); -#endif } input_size = buf_end - buf_ptr; @@ -2597,7 +2594,9 @@ case GOP_START_CODE: if (last_code == 0) { s2->first_field = 0; - mpeg_decode_gop(avctx, buf_ptr, input_size); + ret = mpeg_decode_gop(avctx, buf_ptr, input_size); + if (ret < 0) + return ret; s->sync = 1; } else { av_log(avctx, AV_LOG_ERROR, @@ -2737,7 +2736,9 @@ if (ret < 0) return ret; } - init_get_bits(&thread_context->gb, buf_ptr, input_size * 8); + ret = init_get_bits8(&thread_context->gb, buf_ptr, input_size); + if (ret < 0) + return ret; s->slice_count++; } buf_ptr += 2; // FIXME add minimum number of bytes per slice @@ -2787,18 +2788,6 @@ return buf_size; } -#if FF_API_FLAG_TRUNCATED - if (s2->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { - int next = ff_mpeg1_find_frame_end(&s2->parse_context, buf, - buf_size, NULL); - - if (ff_combine_frame(&s2->parse_context, next, - (const uint8_t **) &buf, &buf_size) < 0) - return buf_size; - } -#endif - - s2->codec_tag = ff_toupper4(avctx->codec_tag); if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2") || s2->codec_tag == AV_RL32("BW10") )) @@ -2851,6 +2840,7 @@ s->sync = 0; s->closed_gop = 0; + av_buffer_unref(&s->a53_buf_ref); ff_mpeg_flush(avctx); } @@ -2866,7 +2856,7 @@ const FFCodec ff_mpeg1video_decoder = { .p.name = "mpeg1video", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + CODEC_LONG_NAME("MPEG-1 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(Mpeg1Context), @@ -2874,15 +2864,11 @@ .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, .p.max_lowres = 3, - .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context), + UPDATE_THREAD_CONTEXT(mpeg_decode_update_thread_context), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG1_NVDEC_HWACCEL HWACCEL_NVDEC(mpeg1), @@ -2899,7 +2885,7 @@ const FFCodec ff_mpeg2video_decoder = { .p.name = "mpeg2video", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), + CODEC_LONG_NAME("MPEG-2 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(Mpeg1Context), @@ -2907,12 +2893,8 @@ .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, .p.max_lowres = 3, .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), @@ -2945,7 +2927,7 @@ //legacy decoder const FFCodec ff_mpegvideo_decoder = { .p.name = "mpegvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + CODEC_LONG_NAME("MPEG-1 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(Mpeg1Context), @@ -2953,12 +2935,8 @@ .close = mpeg_decode_end, FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, .p.max_lowres = 3, }; @@ -3079,7 +3057,6 @@ ff_mpv_decode_init(m, avctx); ff_mpv_idct_init(m); - ff_mpeg12_common_init(m); ff_mpeg12_init_vlcs(); for (int i = 0; i < 64; i++) { @@ -3110,7 +3087,7 @@ const FFCodec ff_ipu_decoder = { .p.name = "ipu", - .p.long_name = NULL_IF_CONFIG_SMALL("IPU Video"), + CODEC_LONG_NAME("IPU Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IPU, .priv_data_size = sizeof(IPUContext), @@ -3118,5 +3095,5 @@ FF_CODEC_DECODE_CB(ipu_decode_frame), .close = ipu_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12dec.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,16 +24,6 @@ #include "get_bits.h" #include "mpeg12vlc.h" -#include "rl.h" - -#define INIT_2D_VLC_RL(rl, static_size, flags)\ -{\ - static RL_VLC_ELEM rl_vlc_table[static_size];\ - rl.rl_vlc[0] = rl_vlc_table;\ - ff_init_2d_vlc_rl(&rl, static_size, flags);\ -} - -void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags); static inline int decode_dc(GetBitContext *gb, int component) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,10 +43,13 @@ #include "mpeg12.h" #include "mpeg12data.h" #include "mpeg12enc.h" +#include "mpeg12vlc.h" #include "mpegutils.h" #include "mpegvideo.h" +#include "mpegvideodata.h" #include "mpegvideoenc.h" #include "profiles.h" +#include "rl.h" #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER static const uint8_t svcd_scan_offset_placeholder[] = { @@ -60,6 +63,9 @@ static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2]; static uint8_t uni_mpeg2_ac_vlc_len[64 * 64 * 2]; +static uint8_t mpeg12_max_level[MAX_LEVEL + 1]; +static uint8_t mpeg12_index_run[MAX_RUN + 1]; + /* simple include everything table for dc, first byte is bits * number next 3 are code */ static uint32_t mpeg1_lum_dc_uni[512]; @@ -81,12 +87,21 @@ int a53_cc; int seq_disp_ext; int video_format; +#define VIDEO_FORMAT_COMPONENT 0 +#define VIDEO_FORMAT_PAL 1 +#define VIDEO_FORMAT_NTSC 2 +#define VIDEO_FORMAT_SECAM 3 +#define VIDEO_FORMAT_MAC 4 +#define VIDEO_FORMAT_UNSPECIFIED 5 } MPEG12EncContext; #define A53_MAX_CC_COUNT 0x1f #endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ -av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len) +av_cold void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], + const uint8_t index_run[], + const uint16_t table_vlc[][2], + uint8_t uni_ac_vlc_len[]) { int i; @@ -99,16 +114,16 @@ int len, code; int alevel = FFABS(level); - if (alevel > rl->max_level[0][run]) + if (alevel > max_level[run]) code = 111; /* rl->n */ else - code = rl->index_run[0][run] + alevel - 1; + code = index_run[run] + alevel - 1; if (code < 111) { /* rl->n */ /* length of VLC and sign */ - len = rl->table_vlc[code][1] + 1; + len = table_vlc[code][1] + 1; } else { - len = rl->table_vlc[111 /* rl->n */][1] + 6; + len = table_vlc[MPEG12_RL_NB_ELEMS][1] + 6; if (alevel < 128) len += 8; @@ -234,7 +249,6 @@ } } - mpeg12->drop_frame_timecode = mpeg12->drop_frame_timecode || !!(avctx->flags2 & AV_CODEC_FLAG2_DROP_FRAME_TIMECODE); if (mpeg12->drop_frame_timecode) mpeg12->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME; if (mpeg12->drop_frame_timecode && mpeg12->frame_rate_index != 4) { @@ -405,10 +419,10 @@ /* time code: we must convert from the real frame rate to a * fake MPEG frame rate in case of low frame rate */ fps = (framerate.num + framerate.den / 2) / framerate.den; - time_code = s->current_picture_ptr->f->coded_picture_number + + time_code = s->current_picture_ptr->coded_picture_number + mpeg12->timecode_frame_start; - mpeg12->gop_picture_number = s->current_picture_ptr->f->coded_picture_number; + mpeg12->gop_picture_number = s->current_picture_ptr->coded_picture_number; av_assert0(mpeg12->drop_frame_timecode == !!(mpeg12->tc.flags & AV_TIMECODE_FLAG_DROPFRAME)); if (mpeg12->drop_frame_timecode) @@ -453,7 +467,7 @@ put_bits(&s->pb, 1, 0); } -void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) +void ff_mpeg1_encode_picture_header(MpegEncContext *s) { MPEG12EncContext *const mpeg12 = (MPEG12EncContext*)s; AVFrameSideData *side_data; @@ -701,7 +715,7 @@ { int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; int code, component; - const uint16_t (*table_vlc)[2] = ff_rl_mpeg1.table_vlc; + const uint16_t (*table_vlc)[2] = ff_mpeg1_vlc_table; last_index = s->block_last_index[n]; @@ -714,7 +728,7 @@ s->last_dc[component] = dc; i = 1; if (s->intra_vlc_format) - table_vlc = ff_rl_mpeg2.table_vlc; + table_vlc = ff_mpeg2_vlc_table; } else { /* encode the first coefficient: needs to be done here because * it is handled slightly differently */ @@ -746,8 +760,8 @@ MASK_ABS(sign, alevel); sign &= 1; - if (alevel <= ff_rl_mpeg1.max_level[0][run]) { - code = ff_rl_mpeg1.index_run[0][run] + alevel - 1; + if (alevel <= mpeg12_max_level[run]) { + code = mpeg12_index_run[run] + alevel - 1; /* store the VLC & sign at once */ put_bits(&s->pb, table_vlc[code][1] + 1, (table_vlc[code][0] << 1) + sign); @@ -1065,13 +1079,13 @@ static av_cold void mpeg12_encode_init_static(void) { - static uint8_t mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; - - ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]); - ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]); + ff_rl_init_level_run(mpeg12_max_level, mpeg12_index_run, + ff_mpeg12_run, ff_mpeg12_level, MPEG12_RL_NB_ELEMS); - ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); - ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, + ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, + ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { @@ -1132,7 +1146,8 @@ { static AVOnce init_static_once = AV_ONCE_INIT; - ff_mpeg12_common_init(s); + s->y_dc_scale_table = + s->c_dc_scale_table = ff_mpeg12_dc_scale_table[s->intra_dc_precision]; s->me.mv_penalty = mv_penalty; s->fcode_tab = fcode_tab; @@ -1220,7 +1235,7 @@ const FFCodec ff_mpeg1video_encoder = { .p.name = "mpeg1video", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + CODEC_LONG_NAME("MPEG-1 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(MPEG12EncContext), @@ -1230,14 +1245,15 @@ .p.supported_framerates = ff_mpeg12_frame_rate_tab + 1, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &mpeg1_class, }; const FFCodec ff_mpeg2video_encoder = { .p.name = "mpeg2video", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), + CODEC_LONG_NAME("MPEG-2 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(MPEG12EncContext), @@ -1248,8 +1264,9 @@ .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &mpeg2_class, }; #endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,11 +25,8 @@ #include #include "mpegvideo.h" -#include "rl.h" -void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); - -void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_mpeg1_encode_picture_header(MpegEncContext *s); void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], int motion_x, int motion_y); void ff_mpeg1_encode_init(MpegEncContext *s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #ifndef AVCODEC_MPEG12_H #define AVCODEC_MPEG12_H -#include "mpegvideo.h" +#include "libavutil/rational.h" /* Start codes. */ #define SEQ_END_CODE 0x000001b7 @@ -34,13 +34,6 @@ #define EXT_START_CODE 0x000001b5 #define USER_START_CODE 0x000001b2 -void ff_mpeg12_common_init(MpegEncContext *s); - -void ff_mpeg1_clean_buffers(MpegEncContext *s); -#if FF_API_FLAG_TRUNCATED -int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s); -#endif - void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12vlc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12vlc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12vlc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg12vlc.h 2023-03-03 13:29:59.000000000 +0000 @@ -49,4 +49,22 @@ void ff_mpeg12_init_vlcs(void); +#define MPEG12_RL_NB_ELEMS 111 + +extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; +extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; + +extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; +extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; + +extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; +extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; + +void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags); + +void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], + const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); + #endif /* AVCODEC_MPEG12VLC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,6 @@ */ #include "get_bits.h" -#include "put_bits.h" #include "mpeg4audio.h" /** @@ -57,7 +56,7 @@ return 0; } -const uint8_t ff_mpeg4audio_channels[14] = { +const uint8_t ff_mpeg4audio_channels[15] = { 0, 1, // mono (1/0) 2, // stereo (2/0) @@ -71,7 +70,8 @@ 0, 7, // 3/3.1 8, // 3/2/2.1 - 24 // 3/3/3 - 5/2/3 - 3/0/0.2 + 24, // 3/3/3 - 5/2/3 - 3/0/0.2 + 8, // 3/2.1 - 2/0 }; static inline int get_object_type(GetBitContext *gb) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio_copy_pce.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio_copy_pce.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio_copy_pce.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio_copy_pce.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * MPEG-4 Audio PCE copying function + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_MPEG4AUDIO_COPY_PCE_H +#define AVCODEC_MPEG4AUDIO_COPY_PCE_H + +#include "libavutil/attributes.h" + +#include "get_bits.h" +#include "put_bits.h" + +static av_always_inline unsigned int ff_pce_copy_bits(PutBitContext *pb, + GetBitContext *gb, + int bits) +{ + unsigned int el = get_bits(gb, bits); + put_bits(pb, bits, el); + return el; +} + +static inline int ff_copy_pce_data(PutBitContext *pb, GetBitContext *gb) +{ + int five_bit_ch, four_bit_ch, comment_size, bits; + int offset = put_bits_count(pb); + + ff_pce_copy_bits(pb, gb, 10); // Tag, Object Type, Frequency + five_bit_ch = ff_pce_copy_bits(pb, gb, 4); // Front + five_bit_ch += ff_pce_copy_bits(pb, gb, 4); // Side + five_bit_ch += ff_pce_copy_bits(pb, gb, 4); // Back + four_bit_ch = ff_pce_copy_bits(pb, gb, 2); // LFE + four_bit_ch += ff_pce_copy_bits(pb, gb, 3); // Data + five_bit_ch += ff_pce_copy_bits(pb, gb, 4); // Coupling + if (ff_pce_copy_bits(pb, gb, 1)) // Mono Mixdown + ff_pce_copy_bits(pb, gb, 4); + if (ff_pce_copy_bits(pb, gb, 1)) // Stereo Mixdown + ff_pce_copy_bits(pb, gb, 4); + if (ff_pce_copy_bits(pb, gb, 1)) // Matrix Mixdown + ff_pce_copy_bits(pb, gb, 3); + for (bits = five_bit_ch*5+four_bit_ch*4; bits > 16; bits -= 16) + ff_pce_copy_bits(pb, gb, 16); + if (bits) + ff_pce_copy_bits(pb, gb, bits); + align_put_bits(pb); + align_get_bits(gb); + comment_size = ff_pce_copy_bits(pb, gb, 8); + for (; comment_size > 0; comment_size--) + ff_pce_copy_bits(pb, gb, 8); + + return put_bits_count(pb) - offset; +} + +#endif /* AVCODEC_MPEG4AUDIO_COPY_PCE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4audio.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,10 +24,7 @@ #include -#include "libavutil/attributes.h" - #include "get_bits.h" -#include "put_bits.h" typedef struct MPEG4AudioConfig { int object_type; @@ -45,7 +42,7 @@ } MPEG4AudioConfig; extern const int ff_mpeg4audio_sample_rates[16]; -extern const uint8_t ff_mpeg4audio_channels[14]; +extern const uint8_t ff_mpeg4audio_channels[15]; /** * Parse MPEG-4 systems extradata from a potentially unaligned GetBitContext to retrieve audio configuration. @@ -120,44 +117,4 @@ #define MAX_PCE_SIZE 320 /// 16; bits -= 16) - ff_pce_copy_bits(pb, gb, 16); - if (bits) - ff_pce_copy_bits(pb, gb, bits); - align_put_bits(pb); - align_get_bits(gb); - comment_size = ff_pce_copy_bits(pb, gb, 8); - for (; comment_size > 0; comment_size--) - ff_pce_copy_bits(pb, gb, 8); - - return put_bits_count(pb) - offset; -} - #endif /* AVCODEC_MPEG4AUDIO_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4data.h 2023-03-03 13:29:59.000000000 +0000 @@ -362,10 +362,6 @@ 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25 }; -const uint16_t ff_mpeg4_resync_prefix[8]={ - 0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000 -}; - const uint8_t ff_mpeg4_dc_threshold[8]={ 99, 13, 15, 17, 19, 21, 23, 0 }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4_unpack_bframes_bsf.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "bsf.h" #include "bsf_internal.h" -#include "mpeg4video.h" +#include "mpeg4videodefs.h" #include "startcode.h" typedef struct UnpackBFramesBSFContext { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodata.h 2023-03-03 13:29:59.000000000 +0000 @@ -50,7 +50,6 @@ extern const uint8_t ff_mpeg4_y_dc_scale_table[32]; extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; -extern const uint16_t ff_mpeg4_resync_prefix[8]; extern const uint8_t ff_mpeg4_dc_threshold[8]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,10 +38,12 @@ #include "mpeg4video.h" #include "mpeg4videodata.h" #include "mpeg4videodec.h" +#include "mpeg4videodefs.h" #include "h263.h" #include "h263data.h" #include "h263dec.h" #include "profiles.h" +#include "qpeldsp.h" #include "threadframe.h" #include "xvididct.h" #include "unary.h" @@ -71,6 +73,176 @@ MB_TYPE_L0 | MB_TYPE_16x16, }; +static void gmc1_motion(MpegEncContext *s, const Mpeg4DecContext *ctx, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture) +{ + const uint8_t *ptr; + int src_x, src_y, motion_x, motion_y; + ptrdiff_t offset, linesize, uvlinesize; + int emu = 0; + + motion_x = ctx->sprite_offset[0][0]; + motion_y = ctx->sprite_offset[0][1]; + src_x = s->mb_x * 16 + (motion_x >> (ctx->sprite_warping_accuracy + 1)); + src_y = s->mb_y * 16 + (motion_y >> (ctx->sprite_warping_accuracy + 1)); + motion_x *= 1 << (3 - ctx->sprite_warping_accuracy); + motion_y *= 1 << (3 - ctx->sprite_warping_accuracy); + src_x = av_clip(src_x, -16, s->width); + if (src_x == s->width) + motion_x = 0; + src_y = av_clip(src_y, -16, s->height); + if (src_y == s->height) + motion_y = 0; + + linesize = s->linesize; + uvlinesize = s->uvlinesize; + + ptr = ref_picture[0] + src_y * linesize + src_x; + + if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || + (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, + linesize, linesize, + 17, 17, + src_x, src_y, + s->h_edge_pos, s->v_edge_pos); + ptr = s->sc.edge_emu_buffer; + } + + if ((motion_x | motion_y) & 7) { + ctx->mdsp.gmc1(dest_y, ptr, linesize, 16, + motion_x & 15, motion_y & 15, 128 - s->no_rounding); + ctx->mdsp.gmc1(dest_y + 8, ptr + 8, linesize, 16, + motion_x & 15, motion_y & 15, 128 - s->no_rounding); + } else { + int dxy; + + dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2); + if (s->no_rounding) { + s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); + } else { + s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); + } + } + + if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) + return; + + motion_x = ctx->sprite_offset[1][0]; + motion_y = ctx->sprite_offset[1][1]; + src_x = s->mb_x * 8 + (motion_x >> (ctx->sprite_warping_accuracy + 1)); + src_y = s->mb_y * 8 + (motion_y >> (ctx->sprite_warping_accuracy + 1)); + motion_x *= 1 << (3 - ctx->sprite_warping_accuracy); + motion_y *= 1 << (3 - ctx->sprite_warping_accuracy); + src_x = av_clip(src_x, -8, s->width >> 1); + if (src_x == s->width >> 1) + motion_x = 0; + src_y = av_clip(src_y, -8, s->height >> 1); + if (src_y == s->height >> 1) + motion_y = 0; + + offset = (src_y * uvlinesize) + src_x; + ptr = ref_picture[1] + offset; + if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || + (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, + uvlinesize, uvlinesize, + 9, 9, + src_x, src_y, + s->h_edge_pos >> 1, s->v_edge_pos >> 1); + ptr = s->sc.edge_emu_buffer; + emu = 1; + } + ctx->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, + motion_x & 15, motion_y & 15, 128 - s->no_rounding); + + ptr = ref_picture[2] + offset; + if (emu) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, + uvlinesize, uvlinesize, + 9, 9, + src_x, src_y, + s->h_edge_pos >> 1, s->v_edge_pos >> 1); + ptr = s->sc.edge_emu_buffer; + } + ctx->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, + motion_x & 15, motion_y & 15, 128 - s->no_rounding); +} + +static void gmc_motion(MpegEncContext *s, const Mpeg4DecContext *ctx, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture) +{ + const uint8_t *ptr; + int linesize, uvlinesize; + const int a = ctx->sprite_warping_accuracy; + int ox, oy; + + linesize = s->linesize; + uvlinesize = s->uvlinesize; + + ptr = ref_picture[0]; + + ox = ctx->sprite_offset[0][0] + ctx->sprite_delta[0][0] * s->mb_x * 16 + + ctx->sprite_delta[0][1] * s->mb_y * 16; + oy = ctx->sprite_offset[0][1] + ctx->sprite_delta[1][0] * s->mb_x * 16 + + ctx->sprite_delta[1][1] * s->mb_y * 16; + + ctx->mdsp.gmc(dest_y, ptr, linesize, 16, + ox, oy, + ctx->sprite_delta[0][0], ctx->sprite_delta[0][1], + ctx->sprite_delta[1][0], ctx->sprite_delta[1][1], + a + 1, (1 << (2 * a + 1)) - s->no_rounding, + s->h_edge_pos, s->v_edge_pos); + ctx->mdsp.gmc(dest_y + 8, ptr, linesize, 16, + ox + ctx->sprite_delta[0][0] * 8, + oy + ctx->sprite_delta[1][0] * 8, + ctx->sprite_delta[0][0], ctx->sprite_delta[0][1], + ctx->sprite_delta[1][0], ctx->sprite_delta[1][1], + a + 1, (1 << (2 * a + 1)) - s->no_rounding, + s->h_edge_pos, s->v_edge_pos); + + if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) + return; + + ox = ctx->sprite_offset[1][0] + ctx->sprite_delta[0][0] * s->mb_x * 8 + + ctx->sprite_delta[0][1] * s->mb_y * 8; + oy = ctx->sprite_offset[1][1] + ctx->sprite_delta[1][0] * s->mb_x * 8 + + ctx->sprite_delta[1][1] * s->mb_y * 8; + + ptr = ref_picture[1]; + ctx->mdsp.gmc(dest_cb, ptr, uvlinesize, 8, + ox, oy, + ctx->sprite_delta[0][0], ctx->sprite_delta[0][1], + ctx->sprite_delta[1][0], ctx->sprite_delta[1][1], + a + 1, (1 << (2 * a + 1)) - s->no_rounding, + (s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1); + + ptr = ref_picture[2]; + ctx->mdsp.gmc(dest_cr, ptr, uvlinesize, 8, + ox, oy, + ctx->sprite_delta[0][0], ctx->sprite_delta[0][1], + ctx->sprite_delta[1][0], ctx->sprite_delta[1][1], + a + 1, (1 << (2 * a + 1)) - s->no_rounding, + (s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1); +} + +void ff_mpeg4_mcsel_motion(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture) +{ + const Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s; + + if (ctx->real_sprite_warping_points == 1) { + gmc1_motion(s, ctx, dest_y, dest_cb, dest_cr, + ref_picture); + } else { + gmc_motion(s, ctx, dest_y, dest_cb, dest_cr, + ref_picture); + } +} + void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int block_size, int uvlinesize, int dct_linesize, int dct_offset) @@ -219,7 +391,11 @@ if (v == 0x7F) return s->mb_num; } else { - if (v == ff_mpeg4_resync_prefix[bits_count & 7]) { + static const uint16_t mpeg4_resync_prefix[8] = { + 0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000 + }; + + if (v == mpeg4_resync_prefix[bits_count & 7]) { int len, mb_num; int mb_num_bits = av_log2(s->mb_num - 1) + 1; GetBitContext gb = s->gb; @@ -247,8 +423,8 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; - int a = 2 << s->sprite_warping_accuracy; - int rho = 3 - s->sprite_warping_accuracy; + int a = 2 << ctx->sprite_warping_accuracy; + int rho = 3 - ctx->sprite_warping_accuracy; int r = 16 / a; int alpha = 1; int beta = 0; @@ -436,7 +612,7 @@ sprite_delta[1][1] = a; ctx->sprite_shift[0] = 0; ctx->sprite_shift[1] = 0; - s->real_sprite_warping_points = 1; + ctx->real_sprite_warping_points = 1; } else { int shift_y = 16 - ctx->sprite_shift[0]; int shift_c = 16 - ctx->sprite_shift[1]; @@ -482,18 +658,18 @@ goto overflow; } } - s->real_sprite_warping_points = ctx->num_sprite_warping_points; + ctx->real_sprite_warping_points = ctx->num_sprite_warping_points; } for (i = 0; i < 4; i++) { - s->sprite_offset[i&1][i>>1] = sprite_offset[i&1][i>>1]; - s->sprite_delta [i&1][i>>1] = sprite_delta [i&1][i>>1]; + ctx->sprite_offset[i&1][i>>1] = sprite_offset[i&1][i>>1]; + ctx->sprite_delta [i&1][i>>1] = sprite_delta [i&1][i>>1]; } return 0; overflow: - memset(s->sprite_offset, 0, sizeof(s->sprite_offset)); - memset(s->sprite_delta, 0, sizeof(s->sprite_delta)); + memset(ctx->sprite_offset, 0, sizeof(ctx->sprite_offset)); + memset(ctx->sprite_delta, 0, sizeof(ctx->sprite_delta)); return AVERROR_PATCHWELCOME; } @@ -661,25 +837,25 @@ MpegEncContext *s = &ctx->m; int x, y, mb_v, sum, dx, dy, shift; int len = 1 << (s->f_code + 4); - const int a = s->sprite_warping_accuracy; + const int a = ctx->sprite_warping_accuracy; if (s->workaround_bugs & FF_BUG_AMV) len >>= s->quarter_sample; - if (s->real_sprite_warping_points == 1) { + if (ctx->real_sprite_warping_points == 1) { if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= s->quarter_sample) - sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample)); + sum = ctx->sprite_offset[0][n] / (1 << (a - s->quarter_sample)); else - sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a); + sum = RSHIFT(ctx->sprite_offset[0][n] * (1 << s->quarter_sample), a); } else { - dx = s->sprite_delta[n][0]; - dy = s->sprite_delta[n][1]; + dx = ctx->sprite_delta[n][0]; + dy = ctx->sprite_delta[n][1]; shift = ctx->sprite_shift[0]; if (n) dy -= 1 << (shift + a + 1); else dx -= 1 << (shift + a + 1); - mb_v = s->sprite_offset[0][n] + dx * s->mb_x * 16U + dy * s->mb_y * 16U; + mb_v = ctx->sprite_offset[0][n] + dx * s->mb_x * 16U + dy * s->mb_y * 16U; sum = 0; for (y = 0; y < 16; y++) { @@ -772,7 +948,8 @@ int dir = 0; mb_num++; - ff_update_block_index(s); + ff_update_block_index(s, s->avctx->bits_per_raw_sample, + s->avctx->lowres, s->chroma_x_shift); if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) s->first_slice_line = 0; @@ -963,7 +1140,8 @@ const int xy = s->mb_x + s->mb_y * s->mb_stride; mb_num++; - ff_update_block_index(s); + ff_update_block_index(s, s->avctx->bits_per_raw_sample, + s->avctx->lowres, s->chroma_x_shift); if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) s->first_slice_line = 0; @@ -1154,9 +1332,9 @@ } if (s->ac_pred) { if (dc_pred_dir == 0) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_intra_h_scantable; /* top */ } else { scan_table = s->intra_scantable.permutated; } @@ -1475,6 +1653,7 @@ int16_t *mot_val; static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; const int xy = s->mb_x + s->mb_y * s->mb_stride; + int next; av_assert2(s == (void*)ctx); av_assert2(s->h263_pred); @@ -1826,26 +2005,24 @@ end: /* per-MB end of slice check */ - if (s->codec_id == AV_CODEC_ID_MPEG4) { - int next = mpeg4_is_resync(ctx); - if (next) { - if (s->mb_x + s->mb_y*s->mb_width + 1 > next && (s->avctx->err_recognition & AV_EF_AGGRESSIVE)) { - return AVERROR_INVALIDDATA; - } else if (s->mb_x + s->mb_y*s->mb_width + 1 >= next) - return SLICE_END; - - if (s->pict_type == AV_PICTURE_TYPE_B) { - const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; - ff_thread_await_progress(&s->next_picture_ptr->tf, - (s->mb_x + delta >= s->mb_width) - ? FFMIN(s->mb_y + 1, s->mb_height - 1) - : s->mb_y, 0); - if (s->next_picture.mbskip_table[xy + delta]) - return SLICE_OK; - } - + next = mpeg4_is_resync(ctx); + if (next) { + if (s->mb_x + s->mb_y*s->mb_width + 1 > next && (s->avctx->err_recognition & AV_EF_AGGRESSIVE)) { + return AVERROR_INVALIDDATA; + } else if (s->mb_x + s->mb_y*s->mb_width + 1 >= next) return SLICE_END; + + if (s->pict_type == AV_PICTURE_TYPE_B) { + const int delta = s->mb_x + 1 == s->mb_width ? 2 : 1; + ff_thread_await_progress(&s->next_picture_ptr->tf, + (s->mb_x + delta >= s->mb_width) + ? FFMIN(s->mb_y + 1, s->mb_height - 1) + : s->mb_y, 0); + if (s->next_picture.mbskip_table[xy + delta]) + return SLICE_OK; } + + return SLICE_END; } return SLICE_OK; @@ -2471,8 +2648,6 @@ else s->avctx->framerate.den = 1; - s->avctx->time_base = av_inv_q(av_mul_q(s->avctx->framerate, (AVRational){s->avctx->ticks_per_frame, 1})); - ctx->t_frame = 0; if (ctx->shape != BIN_ONLY_SHAPE) { @@ -2525,7 +2700,7 @@ ctx->num_sprite_warping_points = 0; return AVERROR_INVALIDDATA; } - s->sprite_warping_accuracy = get_bits(gb, 2); + ctx->sprite_warping_accuracy = get_bits(gb, 2); ctx->sprite_brightness_change = get_bits1(gb); if (ctx->vol_sprite_usage == STATIC_SPRITE) skip_bits1(gb); // low_latency_sprite @@ -2911,7 +3086,6 @@ ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && - s->codec_id == AV_CODEC_ID_MPEG4 && avctx->idct_algo == FF_IDCT_AUTO) { avctx->idct_algo = FF_IDCT_XVID; ff_mpv_idct_init(s); @@ -2969,7 +3143,6 @@ "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; - s->avctx->time_base = av_inv_q(av_mul_q(s->avctx->framerate, (AVRational){s->avctx->ticks_per_frame, 1})); } } @@ -3087,13 +3260,17 @@ if (s->alternate_scan) { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } else { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } /* Skip at this point when only parsing since the remaining @@ -3113,8 +3290,8 @@ if (ctx->vol_sprite_usage == STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n"); } else { - memset(s->sprite_offset, 0, sizeof(s->sprite_offset)); - memset(s->sprite_delta, 0, sizeof(s->sprite_delta)); + memset(ctx->sprite_offset, 0, sizeof(ctx->sprite_offset)); + memset(ctx->sprite_delta, 0, sizeof(ctx->sprite_delta)); } } @@ -3156,7 +3333,7 @@ gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first, s->quarter_sample ? 'q' : 'h', s->data_partitioning, ctx->resync_marker, - ctx->num_sprite_warping_points, s->sprite_warping_accuracy, + ctx->num_sprite_warping_points, ctx->sprite_warping_accuracy, 1 - s->no_rounding, ctx->vo_type, ctx->vol_control_parameters ? " VOLC" : " ", ctx->intra_dc_threshold, ctx->cplx_estimation_trash_i, ctx->cplx_estimation_trash_p, @@ -3261,13 +3438,17 @@ if (s->alternate_scan) { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_alternate_vertical_scan); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } else { ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } mpeg4_load_default_matrices(s); @@ -3513,6 +3694,7 @@ return 0; } +#if CONFIG_MPEG4_DECODER #if HAVE_THREADS static int mpeg4_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) @@ -3531,7 +3713,9 @@ s->shape = s1->shape; s->vol_sprite_usage = s1->vol_sprite_usage; s->sprite_brightness_change = s1->sprite_brightness_change; + s->sprite_warping_accuracy = s1->sprite_warping_accuracy; s->num_sprite_warping_points = s1->num_sprite_warping_points; + s->m.data_partitioning = s1->m.data_partitioning; s->rvlc = s1->rvlc; s->resync_marker = s1->resync_marker; s->t_frame = s1->t_frame; @@ -3554,7 +3738,7 @@ memcpy(s->sprite_shift, s1->sprite_shift, sizeof(s1->sprite_shift)); memcpy(s->sprite_traj, s1->sprite_traj, sizeof(s1->sprite_traj)); - if (CONFIG_MPEG4_DECODER && !init && s1->xvid_build >= 0) + if (!init && s1->xvid_build >= 0) ff_xvid_idct_init(&s->m.idsp, dst); return 0; @@ -3642,6 +3826,9 @@ avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; + ff_qpeldsp_init(&s->qdsp); + ff_mpeg4videodsp_init(&ctx->mdsp); + ff_thread_once(&init_static_once, mpeg4_init_static); return 0; @@ -3664,7 +3851,7 @@ const FFCodec ff_mpeg4_decoder = { .p.name = "mpeg4", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + CODEC_LONG_NAME("MPEG-4 part 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(Mpeg4DecContext), @@ -3672,19 +3859,15 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | -#if FF_API_FLAG_TRUNCATED - AV_CODEC_CAP_TRUNCATED | -#endif AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), - .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context), - .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context_for_user), + UPDATE_THREAD_CONTEXT(mpeg4_update_thread_context), + UPDATE_THREAD_CONTEXT_FOR_USER(mpeg4_update_thread_context_for_user), .p.priv_class = &mpeg4_class, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG4_NVDEC_HWACCEL @@ -3702,3 +3885,4 @@ NULL }, }; +#endif /* CONFIG_MPEG4_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodec.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "get_bits.h" #include "mpegvideo.h" +#include "mpeg4videodsp.h" typedef struct Mpeg4DecContext { @@ -37,7 +38,11 @@ int shape; int vol_sprite_usage; int sprite_brightness_change; + int sprite_warping_accuracy; int num_sprite_warping_points; + int real_sprite_warping_points; + int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY] + int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY] /// sprite trajectory points uint16_t sprite_traj[4][2]; /// sprite shift [isChroma] @@ -76,6 +81,8 @@ int rgb; + Mpeg4VideoDSPContext mdsp; + int32_t block32[12][64]; // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan int dpcm_direction; @@ -87,6 +94,9 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int block_size, int uvlinesize, int dct_linesize, int dct_offset); +void ff_mpeg4_mcsel_motion(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture); int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx); int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx); int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodefs.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodefs.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodefs.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodefs.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * MPEG-4 definitions. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MPEG4VIDEODEFS_H +#define AVCODEC_MPEG4VIDEODEFS_H + +// shapes +#define RECT_SHAPE 0 +#define BIN_SHAPE 1 +#define BIN_ONLY_SHAPE 2 +#define GRAY_SHAPE 3 + +#define SIMPLE_VO_TYPE 1 +#define CORE_VO_TYPE 3 +#define MAIN_VO_TYPE 4 +#define NBIT_VO_TYPE 5 +#define ARTS_VO_TYPE 10 +#define ACE_VO_TYPE 12 +#define SIMPLE_STUDIO_VO_TYPE 14 +#define CORE_STUDIO_VO_TYPE 15 +#define ADV_SIMPLE_VO_TYPE 17 + +#define VOT_VIDEO_ID 1 +#define VOT_STILL_TEXTURE_ID 2 + +// aspect_ratio_info +#define EXTENDED_PAR 15 + +//vol_sprite_usage / sprite_enable +#define STATIC_SPRITE 1 +#define GMC_SPRITE 2 + +#define MOTION_MARKER 0x1F001 +#define DC_MARKER 0x6B001 + +#define VOS_STARTCODE 0x1B0 +#define USER_DATA_STARTCODE 0x1B2 +#define GOP_STARTCODE 0x1B3 +#define VISUAL_OBJ_STARTCODE 0x1B5 +#define VOP_STARTCODE 0x1B6 +#define SLICE_STARTCODE 0x1B7 +#define EXT_STARTCODE 0x1B8 + +#define QUANT_MATRIX_EXT_ID 0x3 + +/* smaller packets likely don't contain a real frame */ +#define MAX_NVOP_SIZE 19 + +#endif /* AVCODEC_MPEG4VIDEODEFS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/common.h" +#include "mpeg4videodsp.h" + +static void gmc1_c(uint8_t *dst, const uint8_t *src, int stride, int h, + int x16, int y16, int rounder) +{ + const int A = (16 - x16) * (16 - y16); + const int B = (x16) * (16 - y16); + const int C = (16 - x16) * (y16); + const int D = (x16) * (y16); + int i; + + for (i = 0; i < h; i++) { + dst[0] = (A * src[0] + B * src[1] + C * src[stride + 0] + D * src[stride + 1] + rounder) >> 8; + dst[1] = (A * src[1] + B * src[2] + C * src[stride + 1] + D * src[stride + 2] + rounder) >> 8; + dst[2] = (A * src[2] + B * src[3] + C * src[stride + 2] + D * src[stride + 3] + rounder) >> 8; + dst[3] = (A * src[3] + B * src[4] + C * src[stride + 3] + D * src[stride + 4] + rounder) >> 8; + dst[4] = (A * src[4] + B * src[5] + C * src[stride + 4] + D * src[stride + 5] + rounder) >> 8; + dst[5] = (A * src[5] + B * src[6] + C * src[stride + 5] + D * src[stride + 6] + rounder) >> 8; + dst[6] = (A * src[6] + B * src[7] + C * src[stride + 6] + D * src[stride + 7] + rounder) >> 8; + dst[7] = (A * src[7] + B * src[8] + C * src[stride + 7] + D * src[stride + 8] + rounder) >> 8; + dst += stride; + src += stride; + } +} + +void ff_gmc_c(uint8_t *dst, const uint8_t *src, int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, int shift, int r, + int width, int height) +{ + int y, vx, vy; + const int s = 1 << shift; + + width--; + height--; + + for (y = 0; y < h; y++) { + int x; + + vx = ox; + vy = oy; + for (x = 0; x < 8; x++) { // FIXME: optimize + int index; + int src_x = vx >> 16; + int src_y = vy >> 16; + int frac_x = src_x & (s - 1); + int frac_y = src_y & (s - 1); + + src_x >>= shift; + src_y >>= shift; + + if ((unsigned) src_x < width) { + if ((unsigned) src_y < height) { + index = src_x + src_y * stride; + dst[y * stride + x] = + ((src[index] * (s - frac_x) + + src[index + 1] * frac_x) * (s - frac_y) + + (src[index + stride] * (s - frac_x) + + src[index + stride + 1] * frac_x) * frac_y + + r) >> (shift * 2); + } else { + index = src_x + av_clip(src_y, 0, height) * stride; + dst[y * stride + x] = + ((src[index] * (s - frac_x) + + src[index + 1] * frac_x) * s + + r) >> (shift * 2); + } + } else { + if ((unsigned) src_y < height) { + index = av_clip(src_x, 0, width) + src_y * stride; + dst[y * stride + x] = + ((src[index] * (s - frac_y) + + src[index + stride] * frac_y) * s + + r) >> (shift * 2); + } else { + index = av_clip(src_x, 0, width) + + av_clip(src_y, 0, height) * stride; + dst[y * stride + x] = src[index]; + } + } + + vx += dxx; + vy += dyx; + } + ox += dxy; + oy += dyy; + } +} + +av_cold void ff_mpeg4videodsp_init(Mpeg4VideoDSPContext *c) +{ + c->gmc1 = gmc1_c; + c->gmc = ff_gmc_c; + +#if ARCH_PPC + ff_mpeg4videodsp_init_ppc(c); +#elif ARCH_X86 + ff_mpeg4videodsp_init_x86(c); +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videodsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MPEG4VIDEODSP_H +#define AVCODEC_MPEG4VIDEODSP_H + +#include + +void ff_gmc_c(uint8_t *dst, const uint8_t *src, int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, int shift, int r, + int width, int height); + +typedef struct Mpeg4VideoDSPContext { + /** + * translational global motion compensation. + */ + void (*gmc1)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */, + int srcStride, int h, int x16, int y16, int rounder); + /** + * global motion compensation. + */ + void (*gmc)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */, + int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, + int shift, int r, int width, int height); +} Mpeg4VideoDSPContext; + +void ff_mpeg4videodsp_init(Mpeg4VideoDSPContext *c); +void ff_mpeg4videodsp_init_ppc(Mpeg4VideoDSPContext *c); +void ff_mpeg4videodsp_init_x86(Mpeg4VideoDSPContext *c); + +#endif /* AVCODEC_MPEG4VIDEODSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,7 @@ #include "h263enc.h" #include "mpeg4video.h" #include "mpeg4videodata.h" +#include "mpeg4videodefs.h" #include "mpeg4videoenc.h" #include "mpegvideoenc.h" #include "profiles.h" @@ -174,7 +175,7 @@ ac_val1[i + 8] = level; } } - st[n] = s->intra_h_scantable.permutated; + st[n] = s->permutated_intra_h_scantable; } else { const int xy = s->mb_x - 1 + s->mb_y * s->mb_stride; /* left prediction */ @@ -196,7 +197,7 @@ ac_val1[i + 8] = block[n][s->idsp.idct_permutation[i]]; } } - st[n] = s->intra_v_scantable.permutated; + st[n] = s->permutated_intra_v_scantable; } for (i = 63; i > 0; i--) // FIXME optimize @@ -639,7 +640,7 @@ if (s->max_b_frames > 0) { int i; int x, y, offset; - uint8_t *p_pic; + const uint8_t *p_pic; x = s->mb_x * 16; y = s->mb_y * 16; @@ -649,7 +650,7 @@ s->mb_skipped = 1; for (i = 0; i < s->max_b_frames; i++) { - uint8_t *b_pic; + const uint8_t *b_pic; int diff; Picture *pic = s->reordered_input_picture[i + 1]; @@ -1055,7 +1056,7 @@ } /* write MPEG-4 VOP header */ -int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number) +int ff_mpeg4_encode_picture_header(MpegEncContext *s) { uint64_t time_incr; int64_t time_div, time_mod; @@ -1064,7 +1065,7 @@ if (!(s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)) { if (s->avctx->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) // HACK, the reference sw is buggy mpeg4_encode_visual_object_header(s); - if (s->avctx->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number == 0) // HACK, the reference sw is buggy + if (s->avctx->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || s->picture_number == 0) // HACK, the reference sw is buggy mpeg4_encode_vol_header(s, 0, 0); } if (!(s->workaround_bugs & FF_BUG_MS)) @@ -1081,8 +1082,8 @@ time_mod = FFUMOD(s->time, s->avctx->time_base.den); time_incr = time_div - s->last_time_base; - // This limits the frame duration to max 1 hour - if (time_incr > 3600) { + // This limits the frame duration to max 1 day + if (time_incr > 3600*24) { av_log(s->avctx, AV_LOG_ERROR, "time_incr %"PRIu64" too large\n", time_incr); return AVERROR(EINVAL); } @@ -1286,6 +1287,7 @@ return AVERROR(EINVAL); } + ff_qpeldsp_init(&s->qdsp); if ((ret = ff_mpv_encode_init(avctx)) < 0) return ret; @@ -1393,7 +1395,7 @@ const FFCodec ff_mpeg4_encoder = { .p.name = "mpeg4", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + CODEC_LONG_NAME("MPEG-4 part 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(MpegEncContext), @@ -1401,7 +1403,8 @@ FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &mpeg4enc_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4videoenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ int16_t block[6][64], int motion_x, int motion_y); void ff_set_mpeg4_time(MpegEncContext *s); -int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); +int ff_mpeg4_encode_picture_header(MpegEncContext *s); void ff_mpeg4_encode_video_packet_header(MpegEncContext *s); void ff_mpeg4_stuffing(PutBitContext *pbc); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,48 +27,6 @@ #include "mpegvideo.h" -// shapes -#define RECT_SHAPE 0 -#define BIN_SHAPE 1 -#define BIN_ONLY_SHAPE 2 -#define GRAY_SHAPE 3 - -#define SIMPLE_VO_TYPE 1 -#define CORE_VO_TYPE 3 -#define MAIN_VO_TYPE 4 -#define NBIT_VO_TYPE 5 -#define ARTS_VO_TYPE 10 -#define ACE_VO_TYPE 12 -#define SIMPLE_STUDIO_VO_TYPE 14 -#define CORE_STUDIO_VO_TYPE 15 -#define ADV_SIMPLE_VO_TYPE 17 - -#define VOT_VIDEO_ID 1 -#define VOT_STILL_TEXTURE_ID 2 - -// aspect_ratio_info -#define EXTENDED_PAR 15 - -//vol_sprite_usage / sprite_enable -#define STATIC_SPRITE 1 -#define GMC_SPRITE 2 - -#define MOTION_MARKER 0x1F001 -#define DC_MARKER 0x6B001 - -#define VOS_STARTCODE 0x1B0 -#define USER_DATA_STARTCODE 0x1B2 -#define GOP_STARTCODE 0x1B3 -#define VISUAL_OBJ_STARTCODE 0x1B5 -#define VOP_STARTCODE 0x1B6 -#define SLICE_STARTCODE 0x1B7 -#define EXT_STARTCODE 0x1B8 - -#define QUANT_MATRIX_EXT_ID 0x3 - -/* smaller packets likely don't contain a real frame */ -#define MAX_NVOP_SIZE 19 - void ff_mpeg4_clean_buffers(MpegEncContext *s); int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); void ff_mpeg4_init_direct_mv(MpegEncContext *s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,15 +22,11 @@ #define UNCHECKED_BITSTREAM_READER 1 -#include "internal.h" +#include "decode.h" #include "parser.h" #include "mpegvideo.h" -#include "mpeg4video.h" #include "mpeg4videodec.h" -#if FF_API_FLAG_TRUNCATED -/* Nuke this header when removing FF_API_FLAG_TRUNCATED */ -#include "mpeg4video_parser.h" -#endif +#include "mpeg4videodefs.h" struct Mp4vParseContext { ParseContext pc; @@ -38,15 +34,11 @@ int first_picture; }; -#if FF_API_FLAG_TRUNCATED -int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) -#else /** * Find the end of the current frame in the bitstream. * @return the position of the first byte of the next frame, or -1 */ static int mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) -#endif { int vop_found, i; uint32_t state; @@ -114,11 +106,11 @@ if (ret < 0) return ret; } - if((s1->flags & PARSER_FLAG_USE_CODEC_TS) && s->avctx->time_base.den>0 && ret>=0){ + if((s1->flags & PARSER_FLAG_USE_CODEC_TS) && s->avctx->framerate.num>0 && ret>=0){ av_assert1(s1->pts == AV_NOPTS_VALUE); av_assert1(s1->dts == AV_NOPTS_VALUE); - s1->pts = av_rescale_q(s->time, (AVRational){1, s->avctx->time_base.den}, (AVRational){1, 1200000}); + s1->pts = av_rescale_q(s->time, (AVRational){1, s->avctx->framerate.num}, (AVRational){1, 1200000}); } s1->pict_type = s->pict_type; @@ -148,11 +140,7 @@ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { next = buf_size; } else { -#if FF_API_FLAG_TRUNCATED - next = ff_mpeg4_find_frame_end(pc, buf, buf_size); -#else next = mpeg4_find_frame_end(pc, buf, buf_size); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg4video_parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * MPEG-4 video parser prototypes - * Copyright (c) 2003 Fabrice Bellard - * Copyright (c) 2003 Michael Niedermayer - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_MPEG4VIDEO_PARSER_H -#define AVCODEC_MPEG4VIDEO_PARSER_H - -#include "parser.h" - -/** - * Find the end of the current frame in the bitstream. - * @return the position of the first byte of the next frame, or -1 - */ -int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); - -#endif /* AVCODEC_MPEG4VIDEO_PARSER_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -369,7 +369,7 @@ { 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 22050 */ { 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, - 18, 22, 26, 32, 38, 46, 52, 64, 70, 76, 36, }, /* 24000 */ + 18, 22, 26, 32, 38, 46, 54, 62, 70, 76, 36, }, /* 24000 */ { 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 16000 */ { 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -63,7 +63,7 @@ #if CONFIG_MP1_DECODER const FFCodec ff_mp1_decoder = { .p.name = "mp1", - .p.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), + CODEC_LONG_NAME("MP1 (MPEG audio layer 1)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), @@ -75,13 +75,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2_DECODER const FFCodec ff_mp2_decoder = { .p.name = "mp2", - .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + CODEC_LONG_NAME("MP2 (MPEG audio layer 2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), @@ -93,13 +92,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3_DECODER const FFCodec ff_mp3_decoder = { .p.name = "mp3", - .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), @@ -111,13 +109,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADU_DECODER const FFCodec ff_mp3adu_decoder = { .p.name = "mp3adu", - .p.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), @@ -129,13 +126,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4_DECODER const FFCodec ff_mp3on4_decoder = { .p.name = "mp3on4", - .p.long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), + CODEC_LONG_NAME("MP3onMP4"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3ON4, .priv_data_size = sizeof(MP3On4DecodeContext), @@ -147,6 +143,6 @@ .flush = flush_mp3on4, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_float.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_float.c 2023-03-03 13:29:59.000000000 +0000 @@ -76,7 +76,7 @@ #if CONFIG_MP1FLOAT_DECODER const FFCodec ff_mp1float_decoder = { .p.name = "mp1float", - .p.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), + CODEC_LONG_NAME("MP1 (MPEG audio layer 1)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), @@ -88,13 +88,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2FLOAT_DECODER const FFCodec ff_mp2float_decoder = { .p.name = "mp2float", - .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + CODEC_LONG_NAME("MP2 (MPEG audio layer 2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), @@ -106,13 +105,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3FLOAT_DECODER const FFCodec ff_mp3float_decoder = { .p.name = "mp3float", - .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), @@ -124,13 +122,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADUFLOAT_DECODER const FFCodec ff_mp3adufloat_decoder = { .p.name = "mp3adufloat", - .p.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), + CODEC_LONG_NAME("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), @@ -142,13 +139,12 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4FLOAT_DECODER const FFCodec ff_mp3on4float_decoder = { .p.name = "mp3on4float", - .p.long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), + CODEC_LONG_NAME("MP3onMP4"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP3ON4, .priv_data_size = sizeof(MP3On4DecodeContext), @@ -160,6 +156,6 @@ .flush = flush_mp3on4, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudiodec_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,8 +36,8 @@ #include "libavutil/thread.h" #include "avcodec.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "mathops.h" #include "mpegaudiodsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,9 +25,10 @@ const FFCodec ff_mp2fixed_encoder = { .p.name = "mp2fixed", - .p.long_name = NULL_IF_CONFIG_SMALL("MP2 fixed point (MPEG audio layer 2)"), + CODEC_LONG_NAME("MP2 fixed point (MPEG audio layer 2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, FF_CODEC_ENCODE_CB(MPA_encode_frame), @@ -36,14 +37,9 @@ .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .defaults = mp2_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_float.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_float.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,9 +26,10 @@ const FFCodec ff_mp2_encoder = { .p.name = "mp2", - .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + CODEC_LONG_NAME("MP2 (MPEG audio layer 2)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MP2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, FF_CODEC_ENCODE_CB(MPA_encode_frame), @@ -37,14 +38,9 @@ .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .defaults = mp2_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegaudioenc_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,6 @@ #include "avcodec.h" #include "encode.h" -#include "internal.h" #include "put_bits.h" #define FRAC_BITS 15 /* fractional bits for sb_samples and dct */ @@ -83,10 +82,6 @@ int i, v, table; float a; - if (channels <= 0 || channels > 2){ - av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels); - return AVERROR(EINVAL); - } bitrate = bitrate / 1000; s->nb_channels = channels; avctx->frame_size = MPA_FRAME_SIZE; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg_er.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg_er.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg_er.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpeg_er.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,6 +18,7 @@ #include "error_resilience.h" #include "mpegvideo.h" +#include "mpegvideodec.h" #include "mpeg_er.h" static void set_erpic(ERPicture *dst, Picture *src) @@ -75,7 +76,8 @@ memcpy(s->mv, mv, sizeof(*mv)); ff_init_block_index(s); - ff_update_block_index(s); + ff_update_block_index(s, s->avctx->bits_per_raw_sample, + s->avctx->lowres, s->chroma_x_shift); s->bdsp.clear_blocks(s->block[0]); if (!s->chroma_y_shift) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,9 +37,6 @@ pic->alloc_mb_width = pic->alloc_mb_height = 0; - av_buffer_unref(&pic->mb_var_buf); - av_buffer_unref(&pic->mc_mb_var_buf); - av_buffer_unref(&pic->mb_mean_buf); av_buffer_unref(&pic->mbskip_table_buf); av_buffer_unref(&pic->qscale_table_buf); av_buffer_unref(&pic->mb_type_buf); @@ -50,26 +47,38 @@ } } +static int make_table_writable(AVBufferRef **ref) +{ + AVBufferRef *old = *ref, *new; + + if (av_buffer_is_writable(old)) + return 0; + new = av_buffer_allocz(old->size); + if (!new) + return AVERROR(ENOMEM); + av_buffer_unref(ref); + *ref = new; + return 0; +} + static int make_tables_writable(Picture *pic) { - int ret, i; #define MAKE_WRITABLE(table) \ do {\ - if (pic->table &&\ - (ret = av_buffer_make_writable(&pic->table)) < 0)\ - return ret;\ + int ret = make_table_writable(&pic->table); \ + if (ret < 0) \ + return ret; \ } while (0) - MAKE_WRITABLE(mb_var_buf); - MAKE_WRITABLE(mc_mb_var_buf); - MAKE_WRITABLE(mb_mean_buf); MAKE_WRITABLE(mbskip_table_buf); MAKE_WRITABLE(qscale_table_buf); MAKE_WRITABLE(mb_type_buf); - for (i = 0; i < 2; i++) { - MAKE_WRITABLE(motion_val_buf[i]); - MAKE_WRITABLE(ref_index_buf[i]); + if (pic->motion_val_buf[0]) { + for (int i = 0; i < 2; i++) { + MAKE_WRITABLE(motion_val_buf[i]); + MAKE_WRITABLE(ref_index_buf[i]); + } } return 0; @@ -218,14 +227,6 @@ if (!pic->mbskip_table_buf || !pic->qscale_table_buf || !pic->mb_type_buf) return AVERROR(ENOMEM); - if (encoding) { - pic->mb_var_buf = av_buffer_allocz(mb_array_size * sizeof(int16_t)); - pic->mc_mb_var_buf = av_buffer_allocz(mb_array_size * sizeof(int16_t)); - pic->mb_mean_buf = av_buffer_allocz(mb_array_size); - if (!pic->mb_var_buf || !pic->mc_mb_var_buf || !pic->mb_mean_buf) - return AVERROR(ENOMEM); - } - if (out_format == FMT_H263 || encoding || (avctx->export_side_data & AV_CODEC_EXPORT_DATA_MVS)) { int mv_size = 2 * (b8_array_size + 4) * sizeof(int16_t); @@ -285,12 +286,6 @@ if (ret < 0) goto fail; - if (encoding) { - pic->mb_var = (uint16_t*)pic->mb_var_buf->data; - pic->mc_mb_var = (uint16_t*)pic->mc_mb_var_buf->data; - pic->mb_mean = pic->mb_mean_buf->data; - } - pic->mbskip_table = pic->mbskip_table_buf->data; pic->qscale_table = pic->qscale_table_buf->data + 2 * mb_stride + 1; pic->mb_type = (uint32_t*)pic->mb_type_buf->data + 2 * mb_stride + 1; @@ -316,8 +311,6 @@ */ void ff_mpeg_unref_picture(AVCodecContext *avctx, Picture *pic) { - int off = offsetof(Picture, mb_mean) + sizeof(pic->mb_mean); - pic->tf.f = pic->f; /* WM Image / Screen codecs allocate internal buffers with different * dimensions / colorspaces; ignore user-defined callbacks for these. */ @@ -333,17 +326,21 @@ if (pic->needs_realloc) free_picture_tables(pic); - memset((uint8_t*)pic + off, 0, sizeof(*pic) - off); + pic->hwaccel_picture_private = NULL; + pic->field_picture = 0; + pic->b_frame_score = 0; + pic->needs_realloc = 0; + pic->reference = 0; + pic->shared = 0; + pic->display_picture_number = 0; + pic->coded_picture_number = 0; } int ff_update_picture_tables(Picture *dst, const Picture *src) { int i, ret; - ret = av_buffer_replace(&dst->mb_var_buf, src->mb_var_buf); - ret |= av_buffer_replace(&dst->mc_mb_var_buf, src->mc_mb_var_buf); - ret |= av_buffer_replace(&dst->mb_mean_buf, src->mb_mean_buf); - ret |= av_buffer_replace(&dst->mbskip_table_buf, src->mbskip_table_buf); + ret = av_buffer_replace(&dst->mbskip_table_buf, src->mbskip_table_buf); ret |= av_buffer_replace(&dst->qscale_table_buf, src->qscale_table_buf); ret |= av_buffer_replace(&dst->mb_type_buf, src->mb_type_buf); for (i = 0; i < 2; i++) { @@ -356,9 +353,6 @@ return ret; } - dst->mb_var = src->mb_var; - dst->mc_mb_var = src->mc_mb_var; - dst->mb_mean = src->mb_mean; dst->mbskip_table = src->mbskip_table; dst->qscale_table = src->qscale_table; dst->mb_type = src->mb_type; @@ -401,15 +395,12 @@ } dst->field_picture = src->field_picture; - dst->mb_var_sum = src->mb_var_sum; - dst->mc_mb_var_sum = src->mc_mb_var_sum; dst->b_frame_score = src->b_frame_score; dst->needs_realloc = src->needs_realloc; dst->reference = src->reference; dst->shared = src->shared; - - memcpy(dst->encoding_error, src->encoding_error, - sizeof(dst->encoding_error)); + dst->display_picture_number = src->display_picture_number; + dst->coded_picture_number = src->coded_picture_number; return 0; fail: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegpicture.h 2023-03-03 13:29:59.000000000 +0000 @@ -62,34 +62,23 @@ AVBufferRef *ref_index_buf[2]; int8_t *ref_index[2]; - AVBufferRef *mb_var_buf; - uint16_t *mb_var; ///< Table for MB variances - - AVBufferRef *mc_mb_var_buf; - uint16_t *mc_mb_var; ///< Table for motion compensated MB variances - int alloc_mb_width; ///< mb_width used to allocate tables int alloc_mb_height; ///< mb_height used to allocate tables int alloc_mb_stride; ///< mb_stride used to allocate tables - AVBufferRef *mb_mean_buf; - uint8_t *mb_mean; ///< Table for MB luminance - AVBufferRef *hwaccel_priv_buf; void *hwaccel_picture_private; ///< Hardware accelerator private data int field_picture; ///< whether or not the picture was encoded in separate fields - int64_t mb_var_sum; ///< sum of MB variance for current frame - int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame - int b_frame_score; int needs_realloc; ///< Picture needs to be reallocated (eg due to a frame size change) int reference; int shared; - uint64_t encoding_error[MPEGVIDEO_MAX_PLANES]; + int display_picture_number; + int coded_picture_number; } Picture; /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.c 2023-03-03 13:29:59.000000000 +0000 @@ -49,13 +49,17 @@ } void ff_draw_horiz_band(AVCodecContext *avctx, - AVFrame *cur, AVFrame *last, + const AVFrame *cur, const AVFrame *last, int y, int h, int picture_structure, int first_field, int low_delay) { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); - int vshift = desc->log2_chroma_h; const int field_pic = picture_structure != PICT_FRAME; + const AVFrame *src; + int offset[AV_NUM_DATA_POINTERS]; + + if (!avctx->draw_horiz_band) + return; + if (field_pic) { h <<= 1; y <<= 1; @@ -67,42 +71,93 @@ !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) return; - if (avctx->draw_horiz_band) { - AVFrame *src; - int offset[AV_NUM_DATA_POINTERS]; - int i; - - if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay || - (avctx->slice_flags & SLICE_FLAG_CODED_ORDER)) - src = cur; - else if (last) - src = last; - else - return; + if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay || + (avctx->slice_flags & SLICE_FLAG_CODED_ORDER)) + src = cur; + else if (last) + src = last; + else + return; - if (cur->pict_type == AV_PICTURE_TYPE_B && - picture_structure == PICT_FRAME && - avctx->codec_id != AV_CODEC_ID_SVQ3) { - for (i = 0; i < AV_NUM_DATA_POINTERS; i++) - offset[i] = 0; - } else { - offset[0]= y * src->linesize[0]; - offset[1]= - offset[2]= (y >> vshift) * src->linesize[1]; - for (i = 3; i < AV_NUM_DATA_POINTERS; i++) - offset[i] = 0; - } + if (cur->pict_type == AV_PICTURE_TYPE_B && + picture_structure == PICT_FRAME && + avctx->codec_id != AV_CODEC_ID_SVQ3) { + for (int i = 0; i < AV_NUM_DATA_POINTERS; i++) + offset[i] = 0; + } else { + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); + int vshift = desc->log2_chroma_h; + + offset[0] = y * src->linesize[0]; + offset[1] = + offset[2] = (y >> vshift) * src->linesize[1]; + for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) + offset[i] = 0; + } - emms_c(); + emms_c(); + + avctx->draw_horiz_band(avctx, src, offset, + y, picture_structure, h); +} - avctx->draw_horiz_band(avctx, src, offset, - y, picture_structure, h); +static char get_type_mv_char(int mb_type) +{ + // Type & MV direction + if (IS_PCM(mb_type)) + return 'P'; + else if (IS_INTRA(mb_type) && IS_ACPRED(mb_type)) + return 'A'; + else if (IS_INTRA4x4(mb_type)) + return 'i'; + else if (IS_INTRA16x16(mb_type)) + return 'I'; + else if (IS_DIRECT(mb_type) && IS_SKIP(mb_type)) + return 'd'; + else if (IS_DIRECT(mb_type)) + return 'D'; + else if (IS_GMC(mb_type) && IS_SKIP(mb_type)) + return 'g'; + else if (IS_GMC(mb_type)) + return 'G'; + else if (IS_SKIP(mb_type)) + return 'S'; + else if (!USES_LIST(mb_type, 1)) + return '>'; + else if (!USES_LIST(mb_type, 0)) + return '<'; + else { + av_assert2(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1)); + return 'X'; } } -void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_table, - uint32_t *mbtype_table, int8_t *qscale_table, int16_t (*motion_val[2])[2], - int mb_width, int mb_height, int mb_stride, int quarter_sample) +static char get_segmentation_char(int mb_type) +{ + if (IS_8X8(mb_type)) + return '+'; + else if (IS_16X8(mb_type)) + return '-'; + else if (IS_8X16(mb_type)) + return '|'; + else if (IS_INTRA(mb_type) || IS_16X16(mb_type)) + return ' '; + + return '?'; +} + +static char get_interlacement_char(int mb_type) +{ + if (IS_INTERLACED(mb_type)) + return '='; + else + return ' '; +} + +void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, + const uint8_t *mbskip_table, const uint32_t *mbtype_table, + const int8_t *qscale_table, int16_t (*const motion_val[2])[2], + int mb_width, int mb_height, int mb_stride, int quarter_sample) { if ((avctx->export_side_data & AV_CODEC_EXPORT_DATA_MVS) && mbtype_table && motion_val[0]) { const int shift = 1 + quarter_sample; @@ -175,7 +230,7 @@ if (mbcount) { AVFrameSideData *sd; - av_log(avctx, AV_LOG_DEBUG, "Adding %d MVs info to frame %d\n", mbcount, avctx->frame_number); + av_log(avctx, AV_LOG_DEBUG, "Adding %d MVs info to frame %"PRId64"\n", mbcount, avctx->frame_num); sd = av_frame_new_side_data(pict, AV_FRAME_DATA_MOTION_VECTORS, mbcount * sizeof(AVMotionVector)); if (!sd) { av_freep(&mvs); @@ -211,51 +266,11 @@ } if (avctx->debug & FF_DEBUG_MB_TYPE) { int mb_type = mbtype_table[x + y * mb_stride]; - // Type & MV direction - if (IS_PCM(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "P"); - else if (IS_INTRA(mb_type) && IS_ACPRED(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "A"); - else if (IS_INTRA4x4(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "i"); - else if (IS_INTRA16x16(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "I"); - else if (IS_DIRECT(mb_type) && IS_SKIP(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "d"); - else if (IS_DIRECT(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "D"); - else if (IS_GMC(mb_type) && IS_SKIP(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "g"); - else if (IS_GMC(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "G"); - else if (IS_SKIP(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "S"); - else if (!USES_LIST(mb_type, 1)) - av_log(avctx, AV_LOG_DEBUG, ">"); - else if (!USES_LIST(mb_type, 0)) - av_log(avctx, AV_LOG_DEBUG, "<"); - else { - av_assert2(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1)); - av_log(avctx, AV_LOG_DEBUG, "X"); - } - // segmentation - if (IS_8X8(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "+"); - else if (IS_16X8(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "-"); - else if (IS_8X16(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "|"); - else if (IS_INTRA(mb_type) || IS_16X16(mb_type)) - av_log(avctx, AV_LOG_DEBUG, " "); - else - av_log(avctx, AV_LOG_DEBUG, "?"); - - - if (IS_INTERLACED(mb_type)) - av_log(avctx, AV_LOG_DEBUG, "="); - else - av_log(avctx, AV_LOG_DEBUG, " "); + av_log(avctx, AV_LOG_DEBUG, "%c%c%c", + get_type_mv_char(mb_type), + get_segmentation_char(mb_type), + get_interlacement_char(mb_type)); } } av_log(avctx, AV_LOG_DEBUG, "\n"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegutils.h 2023-03-03 13:29:59.000000000 +0000 @@ -127,15 +127,16 @@ * * @param h is the normal height, this will be reduced automatically if needed */ -void ff_draw_horiz_band(AVCodecContext *avctx, AVFrame *cur, AVFrame *last, +void ff_draw_horiz_band(AVCodecContext *avctx, const AVFrame *cur, const AVFrame *last, int y, int h, int picture_structure, int first_field, int low_delay); /** * Print debugging info for the given picture. */ -void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_table, - uint32_t *mbtype_table, int8_t *qscale_table, int16_t (*motion_val[2])[2], - int mb_width, int mb_height, int mb_stride, int quarter_sample); +void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, + const uint8_t *mbskip_table, const uint32_t *mbtype_table, + const int8_t *qscale_table, int16_t (*const motion_val[2])[2], + int mb_width, int mb_height, int mb_stride, int quarter_sample); #endif /* AVCODEC_MPEGUTILS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,6 @@ * The simplest mpeg encoder (well, it was the simplest!). */ -#include "config_components.h" - #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/imgutils.h" @@ -36,18 +34,12 @@ #include "avcodec.h" #include "blockdsp.h" -#include "h264chroma.h" #include "idctdsp.h" #include "mathops.h" #include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" -#include "mpeg4videodec.h" #include "mpegvideodata.h" -#include "qpeldsp.h" -#include "threadframe.h" -#include "wmv2dec.h" -#include static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, int16_t *block, int n, int qscale) @@ -281,10 +273,8 @@ /* init common dct for both encoder and decoder */ static av_cold int dct_init(MpegEncContext *s) { - ff_blockdsp_init(&s->bdsp, s->avctx); - ff_h264chroma_init(&s->h264chroma, 8); //for lowres + ff_blockdsp_init(&s->bdsp); ff_hpeldsp_init(&s->hdsp, s->avctx->flags); - ff_mpegvideodsp_init(&s->mdsp); ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample); if (s->avctx->debug & FF_DEBUG_NOMC) { @@ -328,6 +318,27 @@ return 0; } +av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st, + const uint8_t *src_scantable) +{ + int end; + + st->scantable = src_scantable; + + for (int i = 0; i < 64; i++) { + int j = src_scantable[i]; + st->permutated[i] = permutation[j]; + } + + end = -1; + for (int i = 0; i < 64; i++) { + int j = st->permutated[i]; + if (j > end) + end = j; + st->raster_end[i] = end; + } +} + av_cold void ff_mpv_idct_init(MpegEncContext *s) { if (s->codec_id == AV_CODEC_ID_MPEG4) @@ -344,8 +355,10 @@ ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_zigzag_direct); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); } - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan, + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan, + s->idsp.idct_permutation); } static int init_duplicate_context(MpegEncContext *s) @@ -359,16 +372,17 @@ yc_size += 2*s->b8_stride + 2*s->mb_stride; if (s->encoding) { - if (!FF_ALLOCZ_TYPED_ARRAY(s->me.map, ME_MAP_SIZE) || - !FF_ALLOCZ_TYPED_ARRAY(s->me.score_map, ME_MAP_SIZE)) + s->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->me.map)); + if (!s->me.map) return AVERROR(ENOMEM); + s->me.score_map = s->me.map + ME_MAP_SIZE; if (s->noise_reduction) { if (!FF_ALLOCZ_TYPED_ARRAY(s->dct_error_sum, 2)) return AVERROR(ENOMEM); } } - if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 2)) + if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 1 + s->encoding)) return AVERROR(ENOMEM); s->block = s->blocks[0]; @@ -431,7 +445,7 @@ av_freep(&s->dct_error_sum); av_freep(&s->me.map); - av_freep(&s->me.score_map); + s->me.score_map = NULL; av_freep(&s->blocks); av_freep(&s->ac_val_base); s->block = NULL; @@ -526,6 +540,11 @@ { int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; + if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence) + s->mb_height = (s->height + 31) / 32 * 2; + else + s->mb_height = (s->height + 15) / 16; + s->mb_width = (s->width + 15) / 16; s->mb_stride = s->mb_width + 1; s->b8_stride = s->mb_width * 2 + 1; @@ -561,61 +580,13 @@ s->mb_index2xy[s->mb_height * s->mb_width] = (s->mb_height - 1) * s->mb_stride + s->mb_width; // FIXME really needed? - if (s->encoding) { - /* Allocate MV tables */ - if (!FF_ALLOCZ_TYPED_ARRAY(s->p_mv_table_base, mv_table_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->b_forw_mv_table_base, mv_table_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->b_back_mv_table_base, mv_table_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_forw_mv_table_base, mv_table_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_back_mv_table_base, mv_table_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->b_direct_mv_table_base, mv_table_size)) - return AVERROR(ENOMEM); - s->p_mv_table = s->p_mv_table_base + s->mb_stride + 1; - s->b_forw_mv_table = s->b_forw_mv_table_base + s->mb_stride + 1; - s->b_back_mv_table = s->b_back_mv_table_base + s->mb_stride + 1; - s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base + s->mb_stride + 1; - s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base + s->mb_stride + 1; - s->b_direct_mv_table = s->b_direct_mv_table_base + s->mb_stride + 1; - - /* Allocate MB type table */ - if (!FF_ALLOCZ_TYPED_ARRAY(s->mb_type, mb_array_size) || - !FF_ALLOCZ_TYPED_ARRAY(s->lambda_table, mb_array_size) || - !FF_ALLOC_TYPED_ARRAY (s->cplx_tab, mb_array_size) || - !FF_ALLOC_TYPED_ARRAY (s->bits_tab, mb_array_size)) - return AVERROR(ENOMEM); - -#define ALLOCZ_ARRAYS(p, mult, numb) ((p) = av_calloc(numb, mult * sizeof(*(p)))) - if (s->codec_id == AV_CODEC_ID_MPEG4 || - (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) { - int16_t (*tmp1)[2]; - uint8_t *tmp2; - if (!(tmp1 = ALLOCZ_ARRAYS(s->b_field_mv_table_base, 8, mv_table_size)) || - !(tmp2 = ALLOCZ_ARRAYS(s->b_field_select_table[0][0], 2 * 4, mv_table_size)) || - !ALLOCZ_ARRAYS(s->p_field_select_table[0], 2 * 2, mv_table_size)) - return AVERROR(ENOMEM); - - s->p_field_select_table[1] = s->p_field_select_table[0] + 2 * mv_table_size; - tmp1 += s->mb_stride + 1; - - for (int i = 0; i < 2; i++) { - for (int j = 0; j < 2; j++) { - for (int k = 0; k < 2; k++) { - s->b_field_mv_table[i][j][k] = tmp1; - tmp1 += mv_table_size; - } - s->b_field_select_table[i][j] = tmp2; - tmp2 += 2 * mv_table_size; - } - } - } - } - if (s->codec_id == AV_CODEC_ID_MPEG4 || (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) { - int16_t (*tmp)[2]; /* interlaced direct mode decoding tables */ - if (!(tmp = ALLOCZ_ARRAYS(s->p_field_mv_table_base, 4, mv_table_size))) + int16_t (*tmp)[2] = av_calloc(mv_table_size, 4 * sizeof(*tmp)); + if (!tmp) return AVERROR(ENOMEM); + s->p_field_mv_table_base = tmp; tmp += s->mb_stride + 1; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { @@ -646,10 +617,10 @@ s->dc_val_base[i] = 1024; } - /* which mb is an intra block, init macroblock skip table */ - if (!(s->mbintra_table = av_mallocz(mb_array_size)) || - // Note the + 1 is for a quicker MPEG-4 slice_end detection - !(s->mbskip_table = av_mallocz(mb_array_size + 2))) + // Note the + 1 is for a quicker MPEG-4 slice_end detection + if (!(s->mbskip_table = av_mallocz(mb_array_size + 2)) || + /* which mb is an intra block, init macroblock skip table */ + !(s->mbintra_table = av_malloc(mb_array_size))) return AVERROR(ENOMEM); memset(s->mbintra_table, 1, mb_array_size); @@ -658,8 +629,6 @@ static void clear_context(MpegEncContext *s) { - int i, j, k; - memset(&s->next_picture, 0, sizeof(s->next_picture)); memset(&s->last_picture, 0, sizeof(s->last_picture)); memset(&s->current_picture, 0, sizeof(s->current_picture)); @@ -688,31 +657,10 @@ s->bitstream_buffer = NULL; s->allocated_bitstream_buffer_size = 0; s->picture = NULL; - s->mb_type = NULL; - s->p_mv_table_base = NULL; - s->b_forw_mv_table_base = NULL; - s->b_back_mv_table_base = NULL; - s->b_bidir_forw_mv_table_base = NULL; - s->b_bidir_back_mv_table_base = NULL; - s->b_direct_mv_table_base = NULL; - s->p_mv_table = NULL; - s->b_forw_mv_table = NULL; - s->b_back_mv_table = NULL; - s->b_bidir_forw_mv_table = NULL; - s->b_bidir_back_mv_table = NULL; - s->b_direct_mv_table = NULL; - s->b_field_mv_table_base = NULL; s->p_field_mv_table_base = NULL; - for (i = 0; i < 2; i++) { - for (j = 0; j < 2; j++) { - for (k = 0; k < 2; k++) { - s->b_field_mv_table[i][j][k] = NULL; - } - s->b_field_select_table[i][j] = NULL; + for (int i = 0; i < 2; i++) + for (int j = 0; j < 2; j++) s->p_field_mv_table[i][j] = NULL; - } - s->p_field_select_table[i] = NULL; - } s->dc_val_base = NULL; s->coded_block_base = NULL; @@ -725,10 +673,6 @@ s->er.error_status_table = NULL; s->er.er_temp_buffer = NULL; s->mb_index2xy = NULL; - s->lambda_table = NULL; - - s->cplx_tab = NULL; - s->bits_tab = NULL; } /** @@ -747,28 +691,12 @@ if (s->encoding && s->avctx->slices) nb_slices = s->avctx->slices; - if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence) - s->mb_height = (s->height + 31) / 32 * 2; - else - s->mb_height = (s->height + 15) / 16; - if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log(s->avctx, AV_LOG_ERROR, "decoding to AV_PIX_FMT_NONE is not supported.\n"); return AVERROR(EINVAL); } - if (nb_slices > MAX_THREADS || (nb_slices > s->mb_height && s->mb_height)) { - int max_slices; - if (s->mb_height) - max_slices = FFMIN(MAX_THREADS, s->mb_height); - else - max_slices = MAX_THREADS; - av_log(s->avctx, AV_LOG_WARNING, "too many threads/slices (%d)," - " reducing to %d\n", nb_slices, max_slices); - nb_slices = max_slices; - } - if ((s->width || s->height) && av_image_check_size(s->width, s->height, 0, s->avctx)) return AVERROR(EINVAL); @@ -799,9 +727,16 @@ if ((ret = ff_mpv_init_context_frame(s))) goto fail; -#if FF_API_FLAG_TRUNCATED - s->parse_context.state = -1; -#endif + if (nb_slices > MAX_THREADS || (nb_slices > s->mb_height && s->mb_height)) { + int max_slices; + if (s->mb_height) + max_slices = FFMIN(MAX_THREADS, s->mb_height); + else + max_slices = MAX_THREADS; + av_log(s->avctx, AV_LOG_WARNING, "too many threads/slices (%d)," + " reducing to %d\n", nb_slices, max_slices); + nb_slices = max_slices; + } s->context_initialized = 1; memset(s->thread_context, 0, sizeof(s->thread_context)); @@ -824,37 +759,12 @@ void ff_mpv_free_context_frame(MpegEncContext *s) { - int i, j, k; - free_duplicate_contexts(s); - av_freep(&s->mb_type); - av_freep(&s->p_mv_table_base); - av_freep(&s->b_forw_mv_table_base); - av_freep(&s->b_back_mv_table_base); - av_freep(&s->b_bidir_forw_mv_table_base); - av_freep(&s->b_bidir_back_mv_table_base); - av_freep(&s->b_direct_mv_table_base); - s->p_mv_table = NULL; - s->b_forw_mv_table = NULL; - s->b_back_mv_table = NULL; - s->b_bidir_forw_mv_table = NULL; - s->b_bidir_back_mv_table = NULL; - s->b_direct_mv_table = NULL; - av_freep(&s->b_field_mv_table_base); - av_freep(&s->b_field_select_table[0][0]); av_freep(&s->p_field_mv_table_base); - av_freep(&s->p_field_select_table[0]); - for (i = 0; i < 2; i++) { - for (j = 0; j < 2; j++) { - for (k = 0; k < 2; k++) { - s->b_field_mv_table[i][j][k] = NULL; - } - s->b_field_select_table[i][j] = NULL; + for (int i = 0; i < 2; i++) + for (int j = 0; j < 2; j++) s->p_field_mv_table[i][j] = NULL; - } - s->p_field_select_table[i] = NULL; - } av_freep(&s->dc_val_base); av_freep(&s->coded_block_base); @@ -867,29 +777,16 @@ av_freep(&s->er.error_status_table); av_freep(&s->er.er_temp_buffer); av_freep(&s->mb_index2xy); - av_freep(&s->lambda_table); - - av_freep(&s->cplx_tab); - av_freep(&s->bits_tab); s->linesize = s->uvlinesize = 0; } -/* init common structure for both encoder and decoder */ void ff_mpv_common_end(MpegEncContext *s) { - if (!s) - return; - ff_mpv_free_context_frame(s); if (s->slice_context_count > 1) s->slice_context_count = 1; -#if FF_API_FLAG_TRUNCATED - av_freep(&s->parse_context.buffer); - s->parse_context.buffer_size = 0; -#endif - av_freep(&s->bitstream_buffer); s->allocated_bitstream_buffer_size = 0; @@ -915,456 +812,6 @@ } -static inline int hpel_motion_lowres(MpegEncContext *s, - uint8_t *dest, uint8_t *src, - int field_based, int field_select, - int src_x, int src_y, - int width, int height, ptrdiff_t stride, - int h_edge_pos, int v_edge_pos, - int w, int h, h264_chroma_mc_func *pix_op, - int motion_x, int motion_y) -{ - const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); - const int s_mask = (2 << lowres) - 1; - int emu = 0; - int sx, sy; - - if (s->quarter_sample) { - motion_x /= 2; - motion_y /= 2; - } - - sx = motion_x & s_mask; - sy = motion_y & s_mask; - src_x += motion_x >> lowres + 1; - src_y += motion_y >> lowres + 1; - - src += src_y * stride + src_x; - - if ((unsigned)src_x > FFMAX( h_edge_pos - (!!sx) - w, 0) || - (unsigned)src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, src, - s->linesize, s->linesize, - w + 1, (h + 1) << field_based, - src_x, src_y << field_based, - h_edge_pos, v_edge_pos); - src = s->sc.edge_emu_buffer; - emu = 1; - } - - sx = (sx << 2) >> lowres; - sy = (sy << 2) >> lowres; - if (field_select) - src += s->linesize; - pix_op[op_index](dest, src, stride, h, sx, sy); - return emu; -} - -/* apply one mpeg motion vector to the three components */ -static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, - uint8_t *dest_y, - uint8_t *dest_cb, - uint8_t *dest_cr, - int field_based, - int bottom_field, - int field_select, - uint8_t **ref_picture, - h264_chroma_mc_func *pix_op, - int motion_x, int motion_y, - int h, int mb_y) -{ - uint8_t *ptr_y, *ptr_cb, *ptr_cr; - int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy; - ptrdiff_t uvlinesize, linesize; - const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres-1+s->chroma_x_shift, 3); - const int block_s = 8>>lowres; - const int s_mask = (2 << lowres) - 1; - const int h_edge_pos = s->h_edge_pos >> lowres; - const int v_edge_pos = s->v_edge_pos >> lowres; - linesize = s->current_picture.f->linesize[0] << field_based; - uvlinesize = s->current_picture.f->linesize[1] << field_based; - - // FIXME obviously not perfect but qpel will not work in lowres anyway - if (s->quarter_sample) { - motion_x /= 2; - motion_y /= 2; - } - - if(field_based){ - motion_y += (bottom_field - field_select)*((1 << lowres)-1); - } - - sx = motion_x & s_mask; - sy = motion_y & s_mask; - src_x = s->mb_x * 2 * block_s + (motion_x >> lowres + 1); - src_y = (mb_y * 2 * block_s >> field_based) + (motion_y >> lowres + 1); - - if (s->out_format == FMT_H263) { - uvsx = ((motion_x >> 1) & s_mask) | (sx & 1); - uvsy = ((motion_y >> 1) & s_mask) | (sy & 1); - uvsrc_x = src_x >> 1; - uvsrc_y = src_y >> 1; - } else if (s->out_format == FMT_H261) { - // even chroma mv's are full pel in H261 - mx = motion_x / 4; - my = motion_y / 4; - uvsx = (2 * mx) & s_mask; - uvsy = (2 * my) & s_mask; - uvsrc_x = s->mb_x * block_s + (mx >> lowres); - uvsrc_y = mb_y * block_s + (my >> lowres); - } else { - if(s->chroma_y_shift){ - mx = motion_x / 2; - my = motion_y / 2; - uvsx = mx & s_mask; - uvsy = my & s_mask; - uvsrc_x = s->mb_x * block_s + (mx >> lowres + 1); - uvsrc_y = (mb_y * block_s >> field_based) + (my >> lowres + 1); - } else { - if(s->chroma_x_shift){ - //Chroma422 - mx = motion_x / 2; - uvsx = mx & s_mask; - uvsy = motion_y & s_mask; - uvsrc_y = src_y; - uvsrc_x = s->mb_x*block_s + (mx >> (lowres+1)); - } else { - //Chroma444 - uvsx = motion_x & s_mask; - uvsy = motion_y & s_mask; - uvsrc_x = src_x; - uvsrc_y = src_y; - } - } - } - - ptr_y = ref_picture[0] + src_y * linesize + src_x; - ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x; - ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x; - - if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 || - (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, - linesize >> field_based, linesize >> field_based, - 17, 17 + field_based, - src_x, src_y << field_based, h_edge_pos, - v_edge_pos); - ptr_y = s->sc.edge_emu_buffer; - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize; - uint8_t *vbuf =ubuf + 10 * s->uvlinesize; - if (s->workaround_bugs & FF_BUG_IEDGE) - vbuf -= s->uvlinesize; - s->vdsp.emulated_edge_mc(ubuf, ptr_cb, - uvlinesize >> field_based, uvlinesize >> field_based, - 9, 9 + field_based, - uvsrc_x, uvsrc_y << field_based, - h_edge_pos >> 1, v_edge_pos >> 1); - s->vdsp.emulated_edge_mc(vbuf, ptr_cr, - uvlinesize >> field_based,uvlinesize >> field_based, - 9, 9 + field_based, - uvsrc_x, uvsrc_y << field_based, - h_edge_pos >> 1, v_edge_pos >> 1); - ptr_cb = ubuf; - ptr_cr = vbuf; - } - } - - // FIXME use this for field pix too instead of the obnoxious hack which changes picture.f->data - if (bottom_field) { - dest_y += s->linesize; - dest_cb += s->uvlinesize; - dest_cr += s->uvlinesize; - } - - if (field_select) { - ptr_y += s->linesize; - ptr_cb += s->uvlinesize; - ptr_cr += s->uvlinesize; - } - - sx = (sx << 2) >> lowres; - sy = (sy << 2) >> lowres; - pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy); - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; - uvsx = (uvsx << 2) >> lowres; - uvsy = (uvsy << 2) >> lowres; - if (hc) { - pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy); - pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy); - } - } - // FIXME h261 lowres loop filter -} - -static inline void chroma_4mv_motion_lowres(MpegEncContext *s, - uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, - h264_chroma_mc_func * pix_op, - int mx, int my) -{ - const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); - const int block_s = 8 >> lowres; - const int s_mask = (2 << lowres) - 1; - const int h_edge_pos = s->h_edge_pos >> lowres + 1; - const int v_edge_pos = s->v_edge_pos >> lowres + 1; - int emu = 0, src_x, src_y, sx, sy; - ptrdiff_t offset; - uint8_t *ptr; - - if (s->quarter_sample) { - mx /= 2; - my /= 2; - } - - /* In case of 8X8, we construct a single chroma motion vector - with a special rounding */ - mx = ff_h263_round_chroma(mx); - my = ff_h263_round_chroma(my); - - sx = mx & s_mask; - sy = my & s_mask; - src_x = s->mb_x * block_s + (mx >> lowres + 1); - src_y = s->mb_y * block_s + (my >> lowres + 1); - - offset = src_y * s->uvlinesize + src_x; - ptr = ref_picture[1] + offset; - if ((unsigned) src_x > FFMAX(h_edge_pos - (!!sx) - block_s, 0) || - (unsigned) src_y > FFMAX(v_edge_pos - (!!sy) - block_s, 0)) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, - s->uvlinesize, s->uvlinesize, - 9, 9, - src_x, src_y, h_edge_pos, v_edge_pos); - ptr = s->sc.edge_emu_buffer; - emu = 1; - } - sx = (sx << 2) >> lowres; - sy = (sy << 2) >> lowres; - pix_op[op_index](dest_cb, ptr, s->uvlinesize, block_s, sx, sy); - - ptr = ref_picture[2] + offset; - if (emu) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, - s->uvlinesize, s->uvlinesize, - 9, 9, - src_x, src_y, h_edge_pos, v_edge_pos); - ptr = s->sc.edge_emu_buffer; - } - pix_op[op_index](dest_cr, ptr, s->uvlinesize, block_s, sx, sy); -} - -/** - * motion compensation of a single macroblock - * @param s context - * @param dest_y luma destination pointer - * @param dest_cb chroma cb/u destination pointer - * @param dest_cr chroma cr/v destination pointer - * @param dir direction (0->forward, 1->backward) - * @param ref_picture array[3] of pointers to the 3 planes of the reference picture - * @param pix_op halfpel motion compensation function (average or put normally) - * the motion vectors are taken from s->mv and the MV type from s->mv_type - */ -static inline void MPV_motion_lowres(MpegEncContext *s, - uint8_t *dest_y, uint8_t *dest_cb, - uint8_t *dest_cr, - int dir, uint8_t **ref_picture, - h264_chroma_mc_func *pix_op) -{ - int mx, my; - int mb_x, mb_y, i; - const int lowres = s->avctx->lowres; - const int block_s = 8 >>lowres; - - mb_x = s->mb_x; - mb_y = s->mb_y; - - switch (s->mv_type) { - case MV_TYPE_16X16: - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 0, 0, 0, - ref_picture, pix_op, - s->mv[dir][0][0], s->mv[dir][0][1], - 2 * block_s, mb_y); - break; - case MV_TYPE_8X8: - mx = 0; - my = 0; - for (i = 0; i < 4; i++) { - hpel_motion_lowres(s, dest_y + ((i & 1) + (i >> 1) * - s->linesize) * block_s, - ref_picture[0], 0, 0, - (2 * mb_x + (i & 1)) * block_s, - (2 * mb_y + (i >> 1)) * block_s, - s->width, s->height, s->linesize, - s->h_edge_pos >> lowres, s->v_edge_pos >> lowres, - block_s, block_s, pix_op, - s->mv[dir][i][0], s->mv[dir][i][1]); - - mx += s->mv[dir][i][0]; - my += s->mv[dir][i][1]; - } - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) - chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture, - pix_op, mx, my); - break; - case MV_TYPE_FIELD: - if (s->picture_structure == PICT_FRAME) { - /* top field */ - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 1, 0, s->field_select[dir][0], - ref_picture, pix_op, - s->mv[dir][0][0], s->mv[dir][0][1], - block_s, mb_y); - /* bottom field */ - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 1, 1, s->field_select[dir][1], - ref_picture, pix_op, - s->mv[dir][1][0], s->mv[dir][1][1], - block_s, mb_y); - } else { - if (s->picture_structure != s->field_select[dir][0] + 1 && - s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { - ref_picture = s->current_picture_ptr->f->data; - - } - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 0, 0, s->field_select[dir][0], - ref_picture, pix_op, - s->mv[dir][0][0], - s->mv[dir][0][1], 2 * block_s, mb_y >> 1); - } - break; - case MV_TYPE_16X8: - for (i = 0; i < 2; i++) { - uint8_t **ref2picture; - - if (s->picture_structure == s->field_select[dir][i] + 1 || - s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { - ref2picture = ref_picture; - } else { - ref2picture = s->current_picture_ptr->f->data; - } - - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 0, 0, s->field_select[dir][i], - ref2picture, pix_op, - s->mv[dir][i][0], s->mv[dir][i][1] + - 2 * block_s * i, block_s, mb_y >> 1); - - dest_y += 2 * block_s * s->linesize; - dest_cb += (2 * block_s >> s->chroma_y_shift) * s->uvlinesize; - dest_cr += (2 * block_s >> s->chroma_y_shift) * s->uvlinesize; - } - break; - case MV_TYPE_DMV: - if (s->picture_structure == PICT_FRAME) { - for (i = 0; i < 2; i++) { - int j; - for (j = 0; j < 2; j++) { - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 1, j, j ^ i, - ref_picture, pix_op, - s->mv[dir][2 * i + j][0], - s->mv[dir][2 * i + j][1], - block_s, mb_y); - } - pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; - } - } else { - for (i = 0; i < 2; i++) { - mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, - 0, 0, s->picture_structure != i + 1, - ref_picture, pix_op, - s->mv[dir][2 * i][0],s->mv[dir][2 * i][1], - 2 * block_s, mb_y >> 1); - - // after put we make avg of the same block - pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; - - // opposite parity is always in the same - // frame if this is second field - if (!s->first_field) { - ref_picture = s->current_picture_ptr->f->data; - } - } - } - break; - default: - av_assert2(0); - } -} - -/** - * find the lowest MB row referenced in the MVs - */ -static int lowest_referenced_row(MpegEncContext *s, int dir) -{ - int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample; - int my, off, i, mvs; - - if (s->picture_structure != PICT_FRAME || s->mcsel) - goto unhandled; - - switch (s->mv_type) { - case MV_TYPE_16X16: - mvs = 1; - break; - case MV_TYPE_16X8: - mvs = 2; - break; - case MV_TYPE_8X8: - mvs = 4; - break; - default: - goto unhandled; - } - - for (i = 0; i < mvs; i++) { - my = s->mv[dir][i][1]; - my_max = FFMAX(my_max, my); - my_min = FFMIN(my_min, my); - } - - off = ((FFMAX(-my_min, my_max)<> 6; - - return av_clip(s->mb_y + off, 0, s->mb_height - 1); -unhandled: - return s->mb_height-1; -} - -/* put block[] to dest[] */ -static inline void put_dct(MpegEncContext *s, - int16_t *block, int i, uint8_t *dest, int line_size, int qscale) -{ - s->dct_unquantize_intra(s, block, i, qscale); - s->idsp.idct_put(dest, line_size, block); -} - -/* add block[] to dest[] */ -static inline void add_dct(MpegEncContext *s, - int16_t *block, int i, uint8_t *dest, int line_size) -{ - if (s->block_last_index[i] >= 0) { - s->idsp.idct_add(dest, line_size, block); - } -} - -static inline void add_dequant_dct(MpegEncContext *s, - int16_t *block, int i, uint8_t *dest, int line_size, int qscale) -{ - if (s->block_last_index[i] >= 0) { - s->dct_unquantize_inter(s, block, i, qscale); - - s->idsp.idct_add(dest, line_size, block); - } -} - /** * Clean dc, ac, coded_block for the current non-intra MB. */ @@ -1398,278 +845,6 @@ s->mbintra_table[xy]= 0; } -/* generic function called after a macroblock has been parsed by the - decoder or after it has been encoded by the encoder. - - Important variables used: - s->mb_intra : true if intra macroblock - s->mv_dir : motion vector direction - s->mv_type : motion vector type - s->mv : motion vector - s->interlaced_dct : true if interlaced dct used (mpeg2) - */ -static av_always_inline -void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], - int lowres_flag, int is_mpeg12) -{ -#define IS_ENCODER(s) (CONFIG_MPEGVIDEOENC && !lowres_flag && (s)->encoding) -#define IS_MPEG12(s) (CONFIG_SMALL ? ((s)->out_format == FMT_MPEG1) : is_mpeg12) - const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; - - s->current_picture.qscale_table[mb_xy] = s->qscale; - - /* update DC predictors for P macroblocks */ - if (!s->mb_intra) { - if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) { - if(s->mbintra_table[mb_xy]) - ff_clean_intra_table_entries(s); - } else { - s->last_dc[0] = - s->last_dc[1] = - s->last_dc[2] = 128 << s->intra_dc_precision; - } - } - else if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) - s->mbintra_table[mb_xy]=1; - - if (!IS_ENCODER(s) || (s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->frame_skip_threshold || s->frame_skip_factor || - !((s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) && - s->avctx->mb_decision != FF_MB_DECISION_RD)) { // FIXME precalc - uint8_t *dest_y, *dest_cb, *dest_cr; - int dct_linesize, dct_offset; - op_pixels_func (*op_pix)[4]; - qpel_mc_func (*op_qpix)[16]; - const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics - const int uvlinesize = s->current_picture.f->linesize[1]; - const int readable = s->pict_type != AV_PICTURE_TYPE_B || IS_ENCODER(s) || s->avctx->draw_horiz_band || lowres_flag; - const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8; - - /* avoid copy if macroblock skipped in last frame too */ - /* skip only during decoding as we might trash the buffers during encoding a bit */ - if (!IS_ENCODER(s)) { - uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy]; - - if (s->mb_skipped) { - s->mb_skipped= 0; - av_assert2(s->pict_type!=AV_PICTURE_TYPE_I); - *mbskip_ptr = 1; - } else if(!s->current_picture.reference) { - *mbskip_ptr = 1; - } else{ - *mbskip_ptr = 0; /* not skipped */ - } - } - - dct_linesize = linesize << s->interlaced_dct; - dct_offset = s->interlaced_dct ? linesize : linesize * block_size; - - if(readable){ - dest_y= s->dest[0]; - dest_cb= s->dest[1]; - dest_cr= s->dest[2]; - }else{ - dest_y = s->sc.b_scratchpad; - dest_cb= s->sc.b_scratchpad+16*linesize; - dest_cr= s->sc.b_scratchpad+32*linesize; - } - - if (!s->mb_intra) { - /* motion handling */ - /* decoding or more than one mb_type (MC was already done otherwise) */ - if (!IS_ENCODER(s)) { - - if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) { - if (s->mv_dir & MV_DIR_FORWARD) { - ff_thread_await_progress(&s->last_picture_ptr->tf, - lowest_referenced_row(s, 0), - 0); - } - if (s->mv_dir & MV_DIR_BACKWARD) { - ff_thread_await_progress(&s->next_picture_ptr->tf, - lowest_referenced_row(s, 1), - 0); - } - } - - if(lowres_flag){ - h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; - - if (s->mv_dir & MV_DIR_FORWARD) { - MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix); - op_pix = s->h264chroma.avg_h264_chroma_pixels_tab; - } - if (s->mv_dir & MV_DIR_BACKWARD) { - MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix); - } - }else{ - op_qpix = s->me.qpel_put; - if ((is_mpeg12 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { - op_pix = s->hdsp.put_pixels_tab; - }else{ - op_pix = s->hdsp.put_no_rnd_pixels_tab; - } - if (s->mv_dir & MV_DIR_FORWARD) { - ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); - op_pix = s->hdsp.avg_pixels_tab; - op_qpix= s->me.qpel_avg; - } - if (s->mv_dir & MV_DIR_BACKWARD) { - ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); - } - } - } - - /* skip dequant / idct if we are really late ;) */ - if(s->avctx->skip_idct){ - if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) - ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) - || s->avctx->skip_idct >= AVDISCARD_ALL) - goto skip_idct; - } - - /* add dct residue */ - if (IS_ENCODER(s) || !(IS_MPEG12(s) || s->msmpeg4_version - || (s->codec_id==AV_CODEC_ID_MPEG4 && !s->mpeg_quant))){ - add_dequant_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale); - add_dequant_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale); - add_dequant_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale); - add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale); - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - if (s->chroma_y_shift){ - add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); - add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); - }else{ - dct_linesize >>= 1; - dct_offset >>=1; - add_dequant_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale); - add_dequant_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale); - add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale); - add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale); - } - } - } else if(is_mpeg12 || (s->codec_id != AV_CODEC_ID_WMV2)){ - add_dct(s, block[0], 0, dest_y , dct_linesize); - add_dct(s, block[1], 1, dest_y + block_size, dct_linesize); - add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize); - add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize); - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - if(s->chroma_y_shift){//Chroma420 - add_dct(s, block[4], 4, dest_cb, uvlinesize); - add_dct(s, block[5], 5, dest_cr, uvlinesize); - }else{ - //chroma422 - dct_linesize = uvlinesize << s->interlaced_dct; - dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize*block_size; - - add_dct(s, block[4], 4, dest_cb, dct_linesize); - add_dct(s, block[5], 5, dest_cr, dct_linesize); - add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize); - add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize); - if(!s->chroma_x_shift){//Chroma444 - add_dct(s, block[8], 8, dest_cb+block_size, dct_linesize); - add_dct(s, block[9], 9, dest_cr+block_size, dct_linesize); - add_dct(s, block[10], 10, dest_cb+block_size+dct_offset, dct_linesize); - add_dct(s, block[11], 11, dest_cr+block_size+dct_offset, dct_linesize); - } - } - }//fi gray - } else if (CONFIG_WMV2_DECODER) { - ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr); - } - } else { - /* Only MPEG-4 Simple Studio Profile is supported in > 8-bit mode. - TODO: Integrate 10-bit properly into mpegvideo.c so that ER works properly */ - if (!is_mpeg12 && CONFIG_MPEG4_DECODER && /* s->codec_id == AV_CODEC_ID_MPEG4 && */ - s->avctx->bits_per_raw_sample > 8) { - ff_mpeg4_decode_studio(s, dest_y, dest_cb, dest_cr, block_size, - uvlinesize, dct_linesize, dct_offset); - } - /* dct only in intra block */ - else if (IS_ENCODER(s) || !IS_MPEG12(s)) { - put_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale); - put_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale); - put_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale); - put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale); - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - if(s->chroma_y_shift){ - put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); - put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); - }else{ - dct_offset >>=1; - dct_linesize >>=1; - put_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale); - put_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale); - put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale); - put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale); - } - } - }else{ - s->idsp.idct_put(dest_y, dct_linesize, block[0]); - s->idsp.idct_put(dest_y + block_size, dct_linesize, block[1]); - s->idsp.idct_put(dest_y + dct_offset, dct_linesize, block[2]); - s->idsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]); - - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - if(s->chroma_y_shift){ - s->idsp.idct_put(dest_cb, uvlinesize, block[4]); - s->idsp.idct_put(dest_cr, uvlinesize, block[5]); - }else{ - - dct_linesize = uvlinesize << s->interlaced_dct; - dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize*block_size; - - s->idsp.idct_put(dest_cb, dct_linesize, block[4]); - s->idsp.idct_put(dest_cr, dct_linesize, block[5]); - s->idsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]); - s->idsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]); - if(!s->chroma_x_shift){//Chroma444 - s->idsp.idct_put(dest_cb + block_size, dct_linesize, block[8]); - s->idsp.idct_put(dest_cr + block_size, dct_linesize, block[9]); - s->idsp.idct_put(dest_cb + block_size + dct_offset, dct_linesize, block[10]); - s->idsp.idct_put(dest_cr + block_size + dct_offset, dct_linesize, block[11]); - } - } - }//gray - } - } -skip_idct: - if(!readable){ - s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16); - if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { - s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift); - s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift); - } - } - } -} - -void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]) -{ - if (s->avctx->debug & FF_DEBUG_DCT_COEFF) { - /* print DCT coefficients */ - av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); - for (int i = 0; i < 6; i++) { - for (int j = 0; j < 64; j++) { - av_log(s->avctx, AV_LOG_DEBUG, "%5d", - block[i][s->idsp.idct_permutation[j]]); - } - av_log(s->avctx, AV_LOG_DEBUG, "\n"); - } - } - -#if !CONFIG_SMALL - if(s->out_format == FMT_MPEG1) { - if(s->avctx->lowres) mpv_reconstruct_mb_internal(s, block, 1, 1); - else mpv_reconstruct_mb_internal(s, block, 0, 1); - } else -#endif - if(s->avctx->lowres) mpv_reconstruct_mb_internal(s, block, 1, 0); - else mpv_reconstruct_mb_internal(s, block, 0, 0); -} - void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics const int uvlinesize = s->current_picture.f->linesize[1]; @@ -1688,18 +863,15 @@ s->dest[1] = s->current_picture.f->data[1] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); s->dest[2] = s->current_picture.f->data[2] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); - if(!(s->pict_type==AV_PICTURE_TYPE_B && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME)) - { - if(s->picture_structure==PICT_FRAME){ + if (s->picture_structure == PICT_FRAME) { s->dest[0] += s->mb_y * linesize << height_of_mb; s->dest[1] += s->mb_y * uvlinesize << (height_of_mb - s->chroma_y_shift); s->dest[2] += s->mb_y * uvlinesize << (height_of_mb - s->chroma_y_shift); - }else{ - s->dest[0] += (s->mb_y>>1) * linesize << height_of_mb; - s->dest[1] += (s->mb_y>>1) * uvlinesize << (height_of_mb - s->chroma_y_shift); - s->dest[2] += (s->mb_y>>1) * uvlinesize << (height_of_mb - s->chroma_y_shift); - av_assert1((s->mb_y&1) == (s->picture_structure == PICT_BOTTOM_FIELD)); - } + } else { + s->dest[0] += (s->mb_y>>1) * linesize << height_of_mb; + s->dest[1] += (s->mb_y>>1) * uvlinesize << (height_of_mb - s->chroma_y_shift); + s->dest[2] += (s->mb_y>>1) * uvlinesize << (height_of_mb - s->chroma_y_shift); + av_assert1((s->mb_y&1) == (s->picture_structure == PICT_BOTTOM_FIELD)); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,55 +30,23 @@ 56, 64, 72, 80, 88, 96, 104, 112, }; -const uint8_t ff_mpeg1_dc_scale_table[128] = { +const uint8_t ff_mpeg12_dc_scale_table[4][32] = { +{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -}; - -static const uint8_t mpeg2_dc_scale_table1[128] = { +}, +{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -}; - -static const uint8_t mpeg2_dc_scale_table2[128] = { +}, +{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -}; - -static const uint8_t mpeg2_dc_scale_table3[128] = { +}, +{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -}; - -const uint8_t *const ff_mpeg2_dc_scale_table[4] = { - ff_mpeg1_dc_scale_table, - mpeg2_dc_scale_table1, - mpeg2_dc_scale_table2, - mpeg2_dc_scale_table3, +}, }; const uint8_t ff_alternate_horizontal_scan[64] = { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodata.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,15 +21,19 @@ #include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; extern const uint8_t ff_alternate_vertical_scan[64]; -extern const uint8_t ff_mpeg1_dc_scale_table[128]; -extern const uint8_t * const ff_mpeg2_dc_scale_table[4]; +extern const uint8_t ff_mpeg12_dc_scale_table[4][32]; +static const uint8_t *const ff_mpeg1_dc_scale_table = ff_mpeg12_dc_scale_table[0]; extern const uint8_t ff_mpeg2_non_linear_qscale[32]; extern const uint8_t ff_default_chroma_qscale_table[32]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_MPEGVIDEODATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,17 +22,22 @@ #include +#include "config_components.h" + #include "libavutil/avassert.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/video_enc_params.h" #include "avcodec.h" +#include "h264chroma.h" #include "internal.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" +#include "mpeg4videodec.h" #include "threadframe.h" +#include "wmv2dec.h" void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) { @@ -46,6 +51,8 @@ /* convert fourcc to upper case */ s->codec_tag = ff_toupper4(avctx->codec_tag); + + ff_h264chroma_init(&s->h264chroma, 8); //for lowres } int ff_mpeg_update_thread_context(AVCodecContext *dst, @@ -73,13 +80,12 @@ s->bitstream_buffer_size = s->allocated_bitstream_buffer_size = 0; if (s1->context_initialized) { -// s->picture_range_start += MAX_PICTURE_COUNT; -// s->picture_range_end += MAX_PICTURE_COUNT; ff_mpv_idct_init(s); if ((err = ff_mpv_common_init(s)) < 0) { memset(s, 0, sizeof(*s)); s->avctx = dst; s->private_ctx = private_ctx; + memcpy(&s->h264chroma, &s1->h264chroma, sizeof(s->h264chroma)); return err; } } @@ -92,11 +98,6 @@ return ret; } - s->avctx->coded_height = s1->avctx->coded_height; - s->avctx->coded_width = s1->avctx->coded_width; - s->avctx->width = s1->avctx->width; - s->avctx->height = s1->avctx->height; - s->quarter_sample = s1->quarter_sample; s->coded_picture_number = s1->coded_picture_number; @@ -208,12 +209,6 @@ s->next_picture_ptr = s->current_picture_ptr = NULL; - // init - if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && !s->progressive_sequence) - s->mb_height = (s->height + 31) / 32 * 2; - else - s->mb_height = (s->height + 15) / 16; - if ((s->width || s->height) && (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0) goto fail; @@ -292,12 +287,12 @@ ff_mpeg_unref_picture(s->avctx, s->last_picture_ptr); } - /* release forgotten pictures */ - /* if (MPEG-124 / H.263) */ + /* release non reference/forgotten frames */ for (int i = 0; i < MAX_PICTURE_COUNT; i++) { - if (&s->picture[i] != s->last_picture_ptr && - &s->picture[i] != s->next_picture_ptr && - s->picture[i].reference && !s->picture[i].needs_realloc) { + if (!s->picture[i].reference || + (&s->picture[i] != s->last_picture_ptr && + &s->picture[i] != s->next_picture_ptr && + !s->picture[i].needs_realloc)) { ff_mpeg_unref_picture(s->avctx, &s->picture[i]); } } @@ -306,12 +301,6 @@ ff_mpeg_unref_picture(s->avctx, &s->last_picture); ff_mpeg_unref_picture(s->avctx, &s->next_picture); - /* release non reference frames */ - for (int i = 0; i < MAX_PICTURE_COUNT; i++) { - if (!s->picture[i].reference) - ff_mpeg_unref_picture(s->avctx, &s->picture[i]); - } - if (s->current_picture_ptr && !s->current_picture_ptr->f->buf[0]) { // we already have an unused image // (maybe it was set before reading the header) @@ -331,7 +320,11 @@ pic->reference = 3; } +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS pic->f->coded_picture_number = s->coded_picture_number++; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if (alloc_picture(s, pic) < 0) return -1; @@ -465,8 +458,8 @@ if (s->picture_structure != PICT_FRAME) { for (int i = 0; i < 4; i++) { if (s->picture_structure == PICT_BOTTOM_FIELD) { - s->current_picture.f->data[i] += - s->current_picture.f->linesize[i]; + s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], + s->current_picture.f->linesize[i]); } s->current_picture.f->linesize[i] *= 2; s->last_picture.f->linesize[i] *= 2; @@ -503,14 +496,14 @@ ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); } -void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict) +void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict) { ff_print_debug_info2(s->avctx, pict, s->mbskip_table, p->mb_type, p->qscale_table, p->motion_val, s->mb_width, s->mb_height, s->mb_stride, s->quarter_sample); } -int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type) +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type) { AVVideoEncParams *par; int mult = (qp_type == FF_MPV_QSCALE_TYPE_MPEG1) ? 2 : 1; @@ -565,14 +558,6 @@ s->mb_x = s->mb_y = 0; -#if FF_API_FLAG_TRUNCATED - s->parse_context.state = -1; - s->parse_context.frame_start_found = 0; - s->parse_context.overread = 0; - s->parse_context.overread_index = 0; - s->parse_context.index = 0; - s->parse_context.last_index = 0; -#endif s->bitstream_buffer_size = 0; s->pp_time = 0; } @@ -582,3 +567,465 @@ if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred) ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0); } + + +static inline int hpel_motion_lowres(MpegEncContext *s, + uint8_t *dest, const uint8_t *src, + int field_based, int field_select, + int src_x, int src_y, + int width, int height, ptrdiff_t stride, + int h_edge_pos, int v_edge_pos, + int w, int h, const h264_chroma_mc_func *pix_op, + int motion_x, int motion_y) +{ + const int lowres = s->avctx->lowres; + const int op_index = FFMIN(lowres, 3); + const int s_mask = (2 << lowres) - 1; + int emu = 0; + int sx, sy; + + if (s->quarter_sample) { + motion_x /= 2; + motion_y /= 2; + } + + sx = motion_x & s_mask; + sy = motion_y & s_mask; + src_x += motion_x >> lowres + 1; + src_y += motion_y >> lowres + 1; + + src += src_y * stride + src_x; + + if ((unsigned)src_x > FFMAX( h_edge_pos - (!!sx) - w, 0) || + (unsigned)src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, src, + s->linesize, s->linesize, + w + 1, (h + 1) << field_based, + src_x, src_y * (1 << field_based), + h_edge_pos, v_edge_pos); + src = s->sc.edge_emu_buffer; + emu = 1; + } + + sx = (sx << 2) >> lowres; + sy = (sy << 2) >> lowres; + if (field_select) + src += s->linesize; + pix_op[op_index](dest, src, stride, h, sx, sy); + return emu; +} + +/* apply one mpeg motion vector to the three components */ +static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, + uint8_t *dest_y, + uint8_t *dest_cb, + uint8_t *dest_cr, + int field_based, + int bottom_field, + int field_select, + uint8_t *const *ref_picture, + const h264_chroma_mc_func *pix_op, + int motion_x, int motion_y, + int h, int mb_y) +{ + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; + int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy; + ptrdiff_t uvlinesize, linesize; + const int lowres = s->avctx->lowres; + const int op_index = FFMIN(lowres - 1 + s->chroma_x_shift, 3); + const int block_s = 8 >> lowres; + const int s_mask = (2 << lowres) - 1; + const int h_edge_pos = s->h_edge_pos >> lowres; + const int v_edge_pos = s->v_edge_pos >> lowres; + linesize = s->current_picture.f->linesize[0] << field_based; + uvlinesize = s->current_picture.f->linesize[1] << field_based; + + // FIXME obviously not perfect but qpel will not work in lowres anyway + if (s->quarter_sample) { + motion_x /= 2; + motion_y /= 2; + } + + if (field_based) { + motion_y += (bottom_field - field_select)*((1 << lowres)-1); + } + + sx = motion_x & s_mask; + sy = motion_y & s_mask; + src_x = s->mb_x * 2 * block_s + (motion_x >> lowres + 1); + src_y = (mb_y * 2 * block_s >> field_based) + (motion_y >> lowres + 1); + + if (s->out_format == FMT_H263) { + uvsx = ((motion_x >> 1) & s_mask) | (sx & 1); + uvsy = ((motion_y >> 1) & s_mask) | (sy & 1); + uvsrc_x = src_x >> 1; + uvsrc_y = src_y >> 1; + } else if (s->out_format == FMT_H261) { + // even chroma mv's are full pel in H261 + mx = motion_x / 4; + my = motion_y / 4; + uvsx = (2 * mx) & s_mask; + uvsy = (2 * my) & s_mask; + uvsrc_x = s->mb_x * block_s + (mx >> lowres); + uvsrc_y = mb_y * block_s + (my >> lowres); + } else { + if (s->chroma_y_shift) { + mx = motion_x / 2; + my = motion_y / 2; + uvsx = mx & s_mask; + uvsy = my & s_mask; + uvsrc_x = s->mb_x * block_s + (mx >> lowres + 1); + uvsrc_y = (mb_y * block_s >> field_based) + (my >> lowres + 1); + } else { + if (s->chroma_x_shift) { + //Chroma422 + mx = motion_x / 2; + uvsx = mx & s_mask; + uvsy = motion_y & s_mask; + uvsrc_y = src_y; + uvsrc_x = s->mb_x*block_s + (mx >> (lowres+1)); + } else { + //Chroma444 + uvsx = motion_x & s_mask; + uvsy = motion_y & s_mask; + uvsrc_x = src_x; + uvsrc_y = src_y; + } + } + } + + ptr_y = ref_picture[0] + src_y * linesize + src_x; + ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x; + ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x; + + if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 || + (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, + linesize >> field_based, linesize >> field_based, + 17, 17 + field_based, + src_x, src_y * (1 << field_based), h_edge_pos, + v_edge_pos); + ptr_y = s->sc.edge_emu_buffer; + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize; + uint8_t *vbuf =ubuf + 10 * s->uvlinesize; + if (s->workaround_bugs & FF_BUG_IEDGE) + vbuf -= s->uvlinesize; + s->vdsp.emulated_edge_mc(ubuf, ptr_cb, + uvlinesize >> field_based, uvlinesize >> field_based, + 9, 9 + field_based, + uvsrc_x, uvsrc_y * (1 << field_based), + h_edge_pos >> 1, v_edge_pos >> 1); + s->vdsp.emulated_edge_mc(vbuf, ptr_cr, + uvlinesize >> field_based,uvlinesize >> field_based, + 9, 9 + field_based, + uvsrc_x, uvsrc_y * (1 << field_based), + h_edge_pos >> 1, v_edge_pos >> 1); + ptr_cb = ubuf; + ptr_cr = vbuf; + } + } + + // FIXME use this for field pix too instead of the obnoxious hack which changes picture.f->data + if (bottom_field) { + dest_y += s->linesize; + dest_cb += s->uvlinesize; + dest_cr += s->uvlinesize; + } + + if (field_select) { + ptr_y += s->linesize; + ptr_cb += s->uvlinesize; + ptr_cr += s->uvlinesize; + } + + sx = (sx << 2) >> lowres; + sy = (sy << 2) >> lowres; + pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy); + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; + uvsx = (uvsx << 2) >> lowres; + uvsy = (uvsy << 2) >> lowres; + if (hc) { + pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy); + pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy); + } + } + // FIXME h261 lowres loop filter +} + +static inline void chroma_4mv_motion_lowres(MpegEncContext *s, + uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture, + const h264_chroma_mc_func * pix_op, + int mx, int my) +{ + const int lowres = s->avctx->lowres; + const int op_index = FFMIN(lowres, 3); + const int block_s = 8 >> lowres; + const int s_mask = (2 << lowres) - 1; + const int h_edge_pos = s->h_edge_pos >> lowres + 1; + const int v_edge_pos = s->v_edge_pos >> lowres + 1; + int emu = 0, src_x, src_y, sx, sy; + ptrdiff_t offset; + const uint8_t *ptr; + + if (s->quarter_sample) { + mx /= 2; + my /= 2; + } + + /* In case of 8X8, we construct a single chroma motion vector + with a special rounding */ + mx = ff_h263_round_chroma(mx); + my = ff_h263_round_chroma(my); + + sx = mx & s_mask; + sy = my & s_mask; + src_x = s->mb_x * block_s + (mx >> lowres + 1); + src_y = s->mb_y * block_s + (my >> lowres + 1); + + offset = src_y * s->uvlinesize + src_x; + ptr = ref_picture[1] + offset; + if ((unsigned) src_x > FFMAX(h_edge_pos - (!!sx) - block_s, 0) || + (unsigned) src_y > FFMAX(v_edge_pos - (!!sy) - block_s, 0)) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, + s->uvlinesize, s->uvlinesize, + 9, 9, + src_x, src_y, h_edge_pos, v_edge_pos); + ptr = s->sc.edge_emu_buffer; + emu = 1; + } + sx = (sx << 2) >> lowres; + sy = (sy << 2) >> lowres; + pix_op[op_index](dest_cb, ptr, s->uvlinesize, block_s, sx, sy); + + ptr = ref_picture[2] + offset; + if (emu) { + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, + s->uvlinesize, s->uvlinesize, + 9, 9, + src_x, src_y, h_edge_pos, v_edge_pos); + ptr = s->sc.edge_emu_buffer; + } + pix_op[op_index](dest_cr, ptr, s->uvlinesize, block_s, sx, sy); +} + +/** + * motion compensation of a single macroblock + * @param s context + * @param dest_y luma destination pointer + * @param dest_cb chroma cb/u destination pointer + * @param dest_cr chroma cr/v destination pointer + * @param dir direction (0->forward, 1->backward) + * @param ref_picture array[3] of pointers to the 3 planes of the reference picture + * @param pix_op halfpel motion compensation function (average or put normally) + * the motion vectors are taken from s->mv and the MV type from s->mv_type + */ +static inline void MPV_motion_lowres(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, + uint8_t *dest_cr, + int dir, uint8_t *const *ref_picture, + const h264_chroma_mc_func *pix_op) +{ + int mx, my; + int mb_x, mb_y; + const int lowres = s->avctx->lowres; + const int block_s = 8 >>lowres; + + mb_x = s->mb_x; + mb_y = s->mb_y; + + switch (s->mv_type) { + case MV_TYPE_16X16: + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 0, 0, 0, + ref_picture, pix_op, + s->mv[dir][0][0], s->mv[dir][0][1], + 2 * block_s, mb_y); + break; + case MV_TYPE_8X8: + mx = 0; + my = 0; + for (int i = 0; i < 4; i++) { + hpel_motion_lowres(s, dest_y + ((i & 1) + (i >> 1) * + s->linesize) * block_s, + ref_picture[0], 0, 0, + (2 * mb_x + (i & 1)) * block_s, + (2 * mb_y + (i >> 1)) * block_s, + s->width, s->height, s->linesize, + s->h_edge_pos >> lowres, s->v_edge_pos >> lowres, + block_s, block_s, pix_op, + s->mv[dir][i][0], s->mv[dir][i][1]); + + mx += s->mv[dir][i][0]; + my += s->mv[dir][i][1]; + } + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) + chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture, + pix_op, mx, my); + break; + case MV_TYPE_FIELD: + if (s->picture_structure == PICT_FRAME) { + /* top field */ + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 1, 0, s->field_select[dir][0], + ref_picture, pix_op, + s->mv[dir][0][0], s->mv[dir][0][1], + block_s, mb_y); + /* bottom field */ + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 1, 1, s->field_select[dir][1], + ref_picture, pix_op, + s->mv[dir][1][0], s->mv[dir][1][1], + block_s, mb_y); + } else { + if (s->picture_structure != s->field_select[dir][0] + 1 && + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { + ref_picture = s->current_picture_ptr->f->data; + + } + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 0, 0, s->field_select[dir][0], + ref_picture, pix_op, + s->mv[dir][0][0], + s->mv[dir][0][1], 2 * block_s, mb_y >> 1); + } + break; + case MV_TYPE_16X8: + for (int i = 0; i < 2; i++) { + uint8_t *const *ref2picture; + + if (s->picture_structure == s->field_select[dir][i] + 1 || + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { + ref2picture = ref_picture; + } else { + ref2picture = s->current_picture_ptr->f->data; + } + + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 0, 0, s->field_select[dir][i], + ref2picture, pix_op, + s->mv[dir][i][0], s->mv[dir][i][1] + + 2 * block_s * i, block_s, mb_y >> 1); + + dest_y += 2 * block_s * s->linesize; + dest_cb += (2 * block_s >> s->chroma_y_shift) * s->uvlinesize; + dest_cr += (2 * block_s >> s->chroma_y_shift) * s->uvlinesize; + } + break; + case MV_TYPE_DMV: + if (s->picture_structure == PICT_FRAME) { + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 1, j, j ^ i, + ref_picture, pix_op, + s->mv[dir][2 * i + j][0], + s->mv[dir][2 * i + j][1], + block_s, mb_y); + } + pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; + } + } else { + for (int i = 0; i < 2; i++) { + mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, + 0, 0, s->picture_structure != i + 1, + ref_picture, pix_op, + s->mv[dir][2 * i][0],s->mv[dir][2 * i][1], + 2 * block_s, mb_y >> 1); + + // after put we make avg of the same block + pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; + + // opposite parity is always in the same + // frame if this is second field + if (!s->first_field) { + ref_picture = s->current_picture_ptr->f->data; + } + } + } + break; + default: + av_assert2(0); + } +} + +/** + * find the lowest MB row referenced in the MVs + */ +static int lowest_referenced_row(MpegEncContext *s, int dir) +{ + int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample; + int off, mvs; + + if (s->picture_structure != PICT_FRAME || s->mcsel) + goto unhandled; + + switch (s->mv_type) { + case MV_TYPE_16X16: + mvs = 1; + break; + case MV_TYPE_16X8: + mvs = 2; + break; + case MV_TYPE_8X8: + mvs = 4; + break; + default: + goto unhandled; + } + + for (int i = 0; i < mvs; i++) { + int my = s->mv[dir][i][1]; + my_max = FFMAX(my_max, my); + my_min = FFMIN(my_min, my); + } + + off = ((FFMAX(-my_min, my_max) << qpel_shift) + 63) >> 6; + + return av_clip(s->mb_y + off, 0, s->mb_height - 1); +unhandled: + return s->mb_height - 1; +} + +/* add block[] to dest[] */ +static inline void add_dct(MpegEncContext *s, + int16_t *block, int i, uint8_t *dest, int line_size) +{ + if (s->block_last_index[i] >= 0) { + s->idsp.idct_add(dest, line_size, block); + } +} + +#define IS_ENCODER 0 +#include "mpv_reconstruct_mb_template.c" + +void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]) +{ + if (s->avctx->debug & FF_DEBUG_DCT_COEFF) { + /* print DCT coefficients */ + av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 64; j++) { + av_log(s->avctx, AV_LOG_DEBUG, "%5d", + block[i][s->idsp.idct_permutation[j]]); + } + av_log(s->avctx, AV_LOG_DEBUG, "\n"); + } + } + + if (!s->avctx->lowres) { +#if !CONFIG_SMALL + if (s->out_format == FMT_MPEG1) + mpv_reconstruct_mb_internal(s, block, 0, DEFINITELY_MPEG12); + else + mpv_reconstruct_mb_internal(s, block, 0, NOT_MPEG12); +#else + mpv_reconstruct_mb_internal(s, block, 0, MAY_BE_MPEG12); +#endif + } else + mpv_reconstruct_mb_internal(s, block, 1, MAY_BE_MPEG12); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodec.h 2023-03-03 13:29:59.000000000 +0000 @@ -50,15 +50,16 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s); int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); +void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); void ff_mpv_report_decode_progress(MpegEncContext *s); void ff_mpv_frame_end(MpegEncContext *s); -int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type); +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p, int qp_type); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h); void ff_mpeg_flush(AVCodecContext *avctx); -void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict); +void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict); static inline int mpeg_get_qscale(MpegEncContext *s) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "libavutil/attributes.h" -#include "libavutil/common.h" -#include "mpegvideodsp.h" - -static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, - int x16, int y16, int rounder) -{ - const int A = (16 - x16) * (16 - y16); - const int B = (x16) * (16 - y16); - const int C = (16 - x16) * (y16); - const int D = (x16) * (y16); - int i; - - for (i = 0; i < h; i++) { - dst[0] = (A * src[0] + B * src[1] + C * src[stride + 0] + D * src[stride + 1] + rounder) >> 8; - dst[1] = (A * src[1] + B * src[2] + C * src[stride + 1] + D * src[stride + 2] + rounder) >> 8; - dst[2] = (A * src[2] + B * src[3] + C * src[stride + 2] + D * src[stride + 3] + rounder) >> 8; - dst[3] = (A * src[3] + B * src[4] + C * src[stride + 3] + D * src[stride + 4] + rounder) >> 8; - dst[4] = (A * src[4] + B * src[5] + C * src[stride + 4] + D * src[stride + 5] + rounder) >> 8; - dst[5] = (A * src[5] + B * src[6] + C * src[stride + 5] + D * src[stride + 6] + rounder) >> 8; - dst[6] = (A * src[6] + B * src[7] + C * src[stride + 6] + D * src[stride + 7] + rounder) >> 8; - dst[7] = (A * src[7] + B * src[8] + C * src[stride + 7] + D * src[stride + 8] + rounder) >> 8; - dst += stride; - src += stride; - } -} - -void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, - int dxx, int dxy, int dyx, int dyy, int shift, int r, - int width, int height) -{ - int y, vx, vy; - const int s = 1 << shift; - - width--; - height--; - - for (y = 0; y < h; y++) { - int x; - - vx = ox; - vy = oy; - for (x = 0; x < 8; x++) { // FIXME: optimize - int index; - int src_x = vx >> 16; - int src_y = vy >> 16; - int frac_x = src_x & (s - 1); - int frac_y = src_y & (s - 1); - - src_x >>= shift; - src_y >>= shift; - - if ((unsigned) src_x < width) { - if ((unsigned) src_y < height) { - index = src_x + src_y * stride; - dst[y * stride + x] = - ((src[index] * (s - frac_x) + - src[index + 1] * frac_x) * (s - frac_y) + - (src[index + stride] * (s - frac_x) + - src[index + stride + 1] * frac_x) * frac_y + - r) >> (shift * 2); - } else { - index = src_x + av_clip(src_y, 0, height) * stride; - dst[y * stride + x] = - ((src[index] * (s - frac_x) + - src[index + 1] * frac_x) * s + - r) >> (shift * 2); - } - } else { - if ((unsigned) src_y < height) { - index = av_clip(src_x, 0, width) + src_y * stride; - dst[y * stride + x] = - ((src[index] * (s - frac_y) + - src[index + stride] * frac_y) * s + - r) >> (shift * 2); - } else { - index = av_clip(src_x, 0, width) + - av_clip(src_y, 0, height) * stride; - dst[y * stride + x] = src[index]; - } - } - - vx += dxx; - vy += dyx; - } - ox += dxy; - oy += dyy; - } -} - -av_cold void ff_mpegvideodsp_init(MpegVideoDSPContext *c) -{ - c->gmc1 = gmc1_c; - c->gmc = ff_gmc_c; - -#if ARCH_PPC - ff_mpegvideodsp_init_ppc(c); -#elif ARCH_X86 - ff_mpegvideodsp_init_x86(c); -#endif -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideodsp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_MPEGVIDEODSP_H -#define AVCODEC_MPEGVIDEODSP_H - -#include - -void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, - int dxx, int dxy, int dyx, int dyy, int shift, int r, - int width, int height); - -typedef struct MpegVideoDSPContext { - /** - * translational global motion compensation. - */ - void (*gmc1)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */, - int srcStride, int h, int x16, int y16, int rounder); - /** - * global motion compensation. - */ - void (*gmc)(uint8_t *dst /* align 8 */, uint8_t *src /* align 1 */, - int stride, int h, int ox, int oy, - int dxx, int dxy, int dyx, int dyy, - int shift, int r, int width, int height); -} MpegVideoDSPContext; - -void ff_mpegvideodsp_init(MpegVideoDSPContext *c); -void ff_mpegvideodsp_init_ppc(MpegVideoDSPContext *c); -void ff_mpegvideodsp_init_x86(MpegVideoDSPContext *c); - -#endif /* AVCODEC_MPEGVIDEODSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,7 +46,7 @@ #include "dct.h" #include "encode.h" #include "idctdsp.h" -#include "mpeg12.h" +#include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12enc.h" #include "mpegvideo.h" @@ -83,7 +83,7 @@ #define QMAT_SHIFT_MMX 16 #define QMAT_SHIFT 21 -static int encode_picture(MpegEncContext *s, int picture_number); +static int encode_picture(MpegEncContext *s); static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale); static int sse_mb(MpegEncContext *s); static void denoise_dct_c(MpegEncContext *s, int16_t *block); @@ -313,6 +313,7 @@ MpegEncContext *s = avctx->priv_data; AVCPBProperties *cpb_props; int i, ret; + int mb_array_size, mv_table_size; mpv_encode_defaults(s); @@ -646,17 +647,17 @@ s->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1; switch (avctx->codec->id) { - case AV_CODEC_ID_MPEG1VIDEO: - s->out_format = FMT_MPEG1; - s->low_delay = !!(avctx->flags & AV_CODEC_FLAG_LOW_DELAY); - avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); - break; +#if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER case AV_CODEC_ID_MPEG2VIDEO: + s->rtp_mode = 1; + /* fallthrough */ + case AV_CODEC_ID_MPEG1VIDEO: s->out_format = FMT_MPEG1; s->low_delay = !!(avctx->flags & AV_CODEC_FLAG_LOW_DELAY); avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); - s->rtp_mode = 1; + ff_mpeg1_encode_init(s); break; +#endif #if CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_AMV: @@ -681,13 +682,9 @@ case AV_CODEC_ID_H261: if (!CONFIG_H261_ENCODER) return AVERROR_ENCODER_NOT_FOUND; - if (ff_h261_get_picture_format(s->width, s->height) < 0) { - av_log(avctx, AV_LOG_ERROR, - "The specified picture size of %dx%d is not valid for the " - "H.261 codec.\nValid sizes are 176x144, 352x288\n", - s->width, s->height); - return AVERROR(EINVAL); - } + ret = ff_h261_encode_init(s); + if (ret < 0) + return ret; s->out_format = FMT_H261; avctx->delay = 0; s->low_delay = 1; @@ -810,7 +807,6 @@ ff_me_cmp_init(&s->mecc, avctx); ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); ff_pixblockdsp_init(&s->pdsp, avctx); - ff_qpeldsp_init(&s->qdsp); if (!(avctx->stats_out = av_mallocz(256)) || !FF_ALLOCZ_TYPED_ARRAY(s->q_intra_matrix, 32) || @@ -823,6 +819,59 @@ !FF_ALLOCZ_TYPED_ARRAY(s->reordered_input_picture, MAX_PICTURE_COUNT)) return AVERROR(ENOMEM); + /* Allocate MV tables; the MV and MB tables will be copied + * to slice contexts by ff_update_duplicate_context(). */ + mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; + if (!FF_ALLOCZ_TYPED_ARRAY(s->p_mv_table_base, mv_table_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->b_forw_mv_table_base, mv_table_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->b_back_mv_table_base, mv_table_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_forw_mv_table_base, mv_table_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_back_mv_table_base, mv_table_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->b_direct_mv_table_base, mv_table_size)) + return AVERROR(ENOMEM); + s->p_mv_table = s->p_mv_table_base + s->mb_stride + 1; + s->b_forw_mv_table = s->b_forw_mv_table_base + s->mb_stride + 1; + s->b_back_mv_table = s->b_back_mv_table_base + s->mb_stride + 1; + s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base + s->mb_stride + 1; + s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base + s->mb_stride + 1; + s->b_direct_mv_table = s->b_direct_mv_table_base + s->mb_stride + 1; + + /* Allocate MB type table */ + mb_array_size = s->mb_stride * s->mb_height; + if (!FF_ALLOCZ_TYPED_ARRAY(s->mb_type, mb_array_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->lambda_table, mb_array_size) || + !FF_ALLOC_TYPED_ARRAY (s->cplx_tab, mb_array_size) || + !FF_ALLOC_TYPED_ARRAY (s->bits_tab, mb_array_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->mc_mb_var, mb_array_size) || + !FF_ALLOCZ_TYPED_ARRAY(s->mb_var, mb_array_size) || + !(s->mb_mean = av_mallocz(mb_array_size))) + return AVERROR(ENOMEM); + +#define ALLOCZ_ARRAYS(p, mult, numb) ((p) = av_calloc(numb, mult * sizeof(*(p)))) + if (s->codec_id == AV_CODEC_ID_MPEG4 || + (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) { + int16_t (*tmp1)[2]; + uint8_t *tmp2; + if (!(tmp1 = ALLOCZ_ARRAYS(s->b_field_mv_table_base, 8, mv_table_size)) || + !(tmp2 = ALLOCZ_ARRAYS(s->b_field_select_table[0][0], 2 * 4, mv_table_size)) || + !ALLOCZ_ARRAYS(s->p_field_select_table[0], 2 * 2, mv_table_size)) + return AVERROR(ENOMEM); + + s->p_field_select_table[1] = s->p_field_select_table[0] + 2 * mv_table_size; + tmp1 += s->mb_stride + 1; + + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + for (int k = 0; k < 2; k++) { + s->b_field_mv_table[i][j][k] = tmp1; + tmp1 += mv_table_size; + } + s->b_field_select_table[i][j] = tmp2; + tmp2 += 2 * mv_table_size; + } + } + } + if (s->noise_reduction) { if (!FF_ALLOCZ_TYPED_ARRAY(s->dct_offset, 2)) return AVERROR(ENOMEM); @@ -830,6 +879,17 @@ ff_dct_encode_init(s); + if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra; + s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter; + } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) { + s->dct_unquantize_intra = s->dct_unquantize_h263_intra; + s->dct_unquantize_inter = s->dct_unquantize_h263_inter; + } else { + s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra; + s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter; + } + if ((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant) s->chroma_qscale_table = ff_h263_chroma_qscale_table; @@ -845,14 +905,9 @@ ff_set_cmp(&s->mecc, s->mecc.ildct_cmp, avctx->ildct_cmp); ff_set_cmp(&s->mecc, s->mecc.frame_skip_cmp, s->frame_skip_cmp); - if (CONFIG_H261_ENCODER && s->out_format == FMT_H261) { - ff_h261_encode_init(s); - } else if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) - && s->out_format == FMT_MPEG1) { - ff_mpeg1_encode_init(s); - } else if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) { + if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) { ff_h263_encode_init(s); - if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version) + if (CONFIG_MSMPEG4ENC && s->msmpeg4_version) ff_msmpeg4_encode_init(s); } @@ -938,6 +993,22 @@ av_freep(&avctx->stats_out); + av_freep(&s->p_mv_table_base); + av_freep(&s->b_forw_mv_table_base); + av_freep(&s->b_back_mv_table_base); + av_freep(&s->b_bidir_forw_mv_table_base); + av_freep(&s->b_bidir_back_mv_table_base); + av_freep(&s->b_direct_mv_table_base); + av_freep(&s->b_field_mv_table_base); + av_freep(&s->b_field_select_table[0][0]); + av_freep(&s->p_field_select_table[0]); + + av_freep(&s->mb_type); + av_freep(&s->lambda_table); + + av_freep(&s->cplx_tab); + av_freep(&s->bits_tab); + if(s->q_chroma_intra_matrix != s->q_intra_matrix ) av_freep(&s->q_chroma_intra_matrix); if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16); s->q_chroma_intra_matrix= NULL; @@ -949,11 +1020,34 @@ av_freep(&s->input_picture); av_freep(&s->reordered_input_picture); av_freep(&s->dct_offset); + av_freep(&s->mb_var); + av_freep(&s->mc_mb_var); + av_freep(&s->mb_mean); return 0; } -static int get_sae(uint8_t *src, int ref, int stride) +#define IS_ENCODER 1 +#include "mpv_reconstruct_mb_template.c" + +static void mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]) +{ + if (s->avctx->debug & FF_DEBUG_DCT_COEFF) { + /* print DCT coefficients */ + av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 64; j++) { + av_log(s->avctx, AV_LOG_DEBUG, "%5d", + block[i][s->idsp.idct_permutation[j]]); + } + av_log(s->avctx, AV_LOG_DEBUG, "\n"); + } + } + + mpv_reconstruct_mb_internal(s, block, 0, MAY_BE_MPEG12); +} + +static int get_sae(const uint8_t *src, int ref, int stride) { int x,y; int acc = 0; @@ -967,8 +1061,8 @@ return acc; } -static int get_intra_count(MpegEncContext *s, uint8_t *src, - uint8_t *ref, int stride) +static int get_intra_count(MpegEncContext *s, const uint8_t *src, + const uint8_t *ref, int stride) { int x, y, w, h; int acc = 0; @@ -1087,7 +1181,7 @@ int v_shift = i ? v_chroma_shift : 0; int w = s->width >> h_shift; int h = s->height >> v_shift; - uint8_t *src = pic_arg->data[i]; + const uint8_t *src = pic_arg->data[i]; uint8_t *dst = pic->f->data[i]; int vpad = 16; @@ -1125,7 +1219,7 @@ if (ret < 0) return ret; - pic->f->display_picture_number = display_picture_number; + pic->display_picture_number = display_picture_number; pic->f->pts = pts; // we set this here to avoid modifying pic_arg } else { /* Flushing: When we have not received enough input frames, @@ -1144,12 +1238,12 @@ for (i = flush_offset; i < MAX_PICTURE_COUNT /*s->encoding_delay + 1*/; i++) s->input_picture[i - flush_offset] = s->input_picture[i]; - s->input_picture[encoding_delay] = (Picture*) pic; + s->input_picture[encoding_delay] = pic; return 0; } -static int skip_check(MpegEncContext *s, Picture *p, Picture *ref) +static int skip_check(MpegEncContext *s, const Picture *p, const Picture *ref) { int x, y, plane; int score = 0; @@ -1161,8 +1255,8 @@ for (y = 0; y < s->mb_height * bw; y++) { for (x = 0; x < s->mb_width * bw; x++) { int off = p->shared ? 0 : 16; - uint8_t *dptr = p->f->data[plane] + 8 * (x + y * stride) + off; - uint8_t *rptr = ref->f->data[plane] + 8 * (x + y * stride); + const uint8_t *dptr = p->f->data[plane] + 8 * (x + y * stride) + off; + const uint8_t *rptr = ref->f->data[plane] + 8 * (x + y * stride); int v = s->mecc.frame_skip_cmp[1](s, dptr, rptr, stride, 8); switch (FFABS(s->frame_skip_exp)) { @@ -1190,7 +1284,7 @@ return 0; } -static int encode_frame(AVCodecContext *c, AVFrame *frame, AVPacket *pkt) +static int encode_frame(AVCodecContext *c, const AVFrame *frame, AVPacket *pkt) { int ret; int size = 0; @@ -1239,15 +1333,14 @@ FF_LAMBDA_SHIFT; for (i = 0; i < s->max_b_frames + 2; i++) { - Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] : - s->next_picture_ptr; - uint8_t *data[4]; + const Picture *pre_input_ptr = i ? s->input_picture[i - 1] : + s->next_picture_ptr; - if (pre_input_ptr && (!i || s->input_picture[i - 1])) { - pre_input = *pre_input_ptr; + if (pre_input_ptr) { + const uint8_t *data[4]; memcpy(data, pre_input_ptr->f->data, sizeof(data)); - if (!pre_input.shared && i) { + if (!pre_input_ptr->shared && i) { data[0] += INPLACE_OFFSET; data[1] += INPLACE_OFFSET; data[2] += INPLACE_OFFSET; @@ -1256,17 +1349,17 @@ s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[0], s->tmp_frames[i]->linesize[0], data[0], - pre_input.f->linesize[0], + pre_input_ptr->f->linesize[0], width, height); s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[1], s->tmp_frames[i]->linesize[1], data[1], - pre_input.f->linesize[1], + pre_input_ptr->f->linesize[1], width >> 1, height >> 1); s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[2], s->tmp_frames[i]->linesize[2], data[2], - pre_input.f->linesize[2], + pre_input_ptr->f->linesize[2], width >> 1, height >> 1); } } @@ -1384,14 +1477,14 @@ !s->next_picture_ptr || s->intra_only) { s->reordered_input_picture[0] = s->input_picture[0]; s->reordered_input_picture[0]->f->pict_type = AV_PICTURE_TYPE_I; - s->reordered_input_picture[0]->f->coded_picture_number = + s->reordered_input_picture[0]->coded_picture_number = s->coded_picture_number++; } else { int b_frames = 0; if (s->avctx->flags & AV_CODEC_FLAG_PASS2) { for (i = 0; i < s->max_b_frames + 1; i++) { - int pict_num = s->input_picture[0]->f->display_picture_number + i; + int pict_num = s->input_picture[0]->display_picture_number + i; if (pict_num >= s->rc_context.num_entries) break; @@ -1470,13 +1563,13 @@ s->reordered_input_picture[0] = s->input_picture[b_frames]; if (s->reordered_input_picture[0]->f->pict_type != AV_PICTURE_TYPE_I) s->reordered_input_picture[0]->f->pict_type = AV_PICTURE_TYPE_P; - s->reordered_input_picture[0]->f->coded_picture_number = + s->reordered_input_picture[0]->coded_picture_number = s->coded_picture_number++; for (i = 0; i < b_frames; i++) { s->reordered_input_picture[i + 1] = s->input_picture[i]; s->reordered_input_picture[i + 1]->f->pict_type = AV_PICTURE_TYPE_B; - s->reordered_input_picture[i + 1]->f->coded_picture_number = + s->reordered_input_picture[i + 1]->coded_picture_number = s->coded_picture_number++; } } @@ -1511,6 +1604,8 @@ ret = av_frame_copy_props(pic->f, s->reordered_input_picture[0]->f); if (ret < 0) return ret; + pic->coded_picture_number = s->reordered_input_picture[0]->coded_picture_number; + pic->display_picture_number = s->reordered_input_picture[0]->display_picture_number; /* mark us unused / free shared pic */ av_frame_unref(s->reordered_input_picture[0]->f); @@ -1525,7 +1620,8 @@ s->new_picture->data[i] += INPLACE_OFFSET; } } - s->picture_number = s->new_picture->display_picture_number; + s->picture_number = s->current_picture_ptr->display_picture_number; + } return 0; } @@ -1640,17 +1736,6 @@ } } - if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra; - s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter; - } else if (s->out_format == FMT_H263 || s->out_format == FMT_H261) { - s->dct_unquantize_intra = s->dct_unquantize_h263_intra; - s->dct_unquantize_inter = s->dct_unquantize_h263_inter; - } else { - s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra; - s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter; - } - if (s->dct_error_sum) { av_assert2(s->noise_reduction && s->encoding); update_noise_reduction(s); @@ -1713,7 +1798,7 @@ if (ret < 0) return ret; vbv_retry: - ret = encode_picture(s, s->picture_number); + ret = encode_picture(s); if (growing_buffer) { av_assert0(s->pb.buf == avctx->internal->byte_buffer); pkt->data = s->pb.buf; @@ -1773,11 +1858,10 @@ ff_write_pass1_stats(s); for (i = 0; i < 4; i++) { - s->current_picture_ptr->encoding_error[i] = s->current_picture.encoding_error[i]; - avctx->error[i] += s->current_picture_ptr->encoding_error[i]; + avctx->error[i] += s->encoding_error[i]; } ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, - s->current_picture_ptr->encoding_error, + s->encoding_error, (avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0, s->pict_type); @@ -1871,14 +1955,23 @@ s->total_bits += s->frame_bits; pkt->pts = s->current_picture.f->pts; + pkt->duration = s->current_picture.f->duration; if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) { - if (!s->current_picture.f->coded_picture_number) + if (!s->current_picture.coded_picture_number) pkt->dts = pkt->pts - s->dts_delta; else pkt->dts = s->reordered_pts; s->reordered_pts = pkt->pts; } else pkt->dts = pkt->pts; + + // the no-delay case is handled in generic code + if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY) { + ret = ff_encode_reordered_opaque(avctx, pkt, s->current_picture.f); + if (ret < 0) + return ret; + } + if (s->current_picture.f->key_frame) pkt->flags |= AV_PKT_FLAG_KEY; if (s->mb_info) @@ -1990,7 +2083,7 @@ overflow, minlevel, maxlevel); } -static void get_visual_weight(int16_t *weight, uint8_t *ptr, int stride) +static void get_visual_weight(int16_t *weight, const uint8_t *ptr, int stride) { int x, y; // FIXME optimize @@ -2035,7 +2128,7 @@ int skip_dct[12]; int dct_offset = s->linesize * 8; // default for progressive frames int uv_dct_offset = s->uvlinesize * 8; - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; ptrdiff_t wrap_y, wrap_c; for (i = 0; i < mb_block_count; i++) @@ -2235,8 +2328,7 @@ } } /* pre quantization */ - if (s->current_picture.mc_mb_var[s->mb_stride * mb_y + mb_x] < - 2 * s->qscale * s->qscale) { + if (s->mc_mb_var[s->mb_stride * mb_y + mb_x] < 2 * s->qscale * s->qscale) { // FIXME optimize if (s->mecc.sad[1](NULL, ptr_y, dest_y, wrap_y, 8) < 20 * s->qscale) skip_dct[0] = 1; @@ -2372,7 +2464,7 @@ case AV_CODEC_ID_MSMPEG4V2: case AV_CODEC_ID_MSMPEG4V3: case AV_CODEC_ID_WMV1: - if (CONFIG_MSMPEG4_ENCODER) + if (CONFIG_MSMPEG4ENC) ff_msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case AV_CODEC_ID_WMV2: @@ -2516,7 +2608,7 @@ } if(s->avctx->mb_decision == FF_MB_DECISION_RD){ - ff_mpv_reconstruct_mb(s, s->block); + mpv_reconstruct_mb(s, s->block); score *= s->lambda2; score += sse_mb(s) << FF_LAMBDA_SHIFT; @@ -2534,7 +2626,7 @@ } } -static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride){ +static int sse(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2, int w, int h, int stride){ const uint32_t *sq = ff_square_tab + 256; int acc=0; int x,y; @@ -2641,15 +2733,15 @@ for(mb_x=0; mb_x < s->mb_width; mb_x++) { int xx = mb_x * 16; int yy = mb_y * 16; - uint8_t *pix = s->new_picture->data[0] + (yy * s->linesize) + xx; + const uint8_t *pix = s->new_picture->data[0] + (yy * s->linesize) + xx; int varc; int sum = s->mpvencdsp.pix_sum(pix, s->linesize); varc = (s->mpvencdsp.pix_norm1(pix, s->linesize) - (((unsigned) sum * sum) >> 8) + 500 + 128) >> 8; - s->current_picture.mb_var [s->mb_stride * mb_y + mb_x] = varc; - s->current_picture.mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8; + s->mb_var [s->mb_stride * mb_y + mb_x] = varc; + s->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8; s->me.mb_var_sum_temp += varc; } } @@ -2783,7 +2875,7 @@ /* note: quant matrix value (8) is implied here */ s->last_dc[i] = 128 << s->intra_dc_precision; - s->current_picture.encoding_error[i] = 0; + s->encoding_error[i] = 0; } if(s->codec_id==AV_CODEC_ID_AMV){ s->last_dc[0] = 128*8/13; @@ -2852,7 +2944,7 @@ s->mb_x = mb_x; s->mb_y = mb_y; // moved into loop, can get changed by H.261 - ff_update_block_index(s); + ff_update_block_index(s, 8, 0, s->chroma_x_shift); if(CONFIG_H261_ENCODER && s->codec_id == AV_CODEC_ID_H261){ ff_h261_reorder_mb_index(s); @@ -3226,7 +3318,7 @@ } if(s->avctx->mb_decision == FF_MB_DECISION_BITS) - ff_mpv_reconstruct_mb(s, s->block); + mpv_reconstruct_mb(s, s->block); } else { int motion_x = 0, motion_y = 0; s->mv_type=MV_TYPE_16X16; @@ -3345,7 +3437,7 @@ s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) ff_h263_update_motion_val(s); - ff_mpv_reconstruct_mb(s, s->block); + mpv_reconstruct_mb(s, s->block); } /* clean the MV table in IPS frames for direct mode in B-frames */ @@ -3361,13 +3453,13 @@ if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16; if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16; - s->current_picture.encoding_error[0] += sse( + s->encoding_error[0] += sse( s, s->new_picture->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize); - s->current_picture.encoding_error[1] += sse( + s->encoding_error[1] += sse( s, s->new_picture->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize); - s->current_picture.encoding_error[2] += sse( + s->encoding_error[2] += sse( s, s->new_picture->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize); } @@ -3381,7 +3473,7 @@ } //not beautiful here but we must write it before flushing so it has to be here - if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I) + if (CONFIG_MSMPEG4ENC && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I) ff_msmpeg4_encode_ext_header(s); write_slice_end(s); @@ -3407,9 +3499,9 @@ MERGE(i_count); MERGE(skip_count); MERGE(misc_bits); - MERGE(current_picture.encoding_error[0]); - MERGE(current_picture.encoding_error[1]); - MERGE(current_picture.encoding_error[2]); + MERGE(encoding_error[0]); + MERGE(encoding_error[1]); + MERGE(encoding_error[2]); if (dst->noise_reduction){ for(i=0; i<64; i++){ @@ -3476,14 +3568,12 @@ } } -static int encode_picture(MpegEncContext *s, int picture_number) +static int encode_picture(MpegEncContext *s) { int i, ret; int bits; int context_count = s->slice_context_count; - s->picture_number = picture_number; - /* Reset the average MB variance */ s->me.mb_var_sum_temp = s->me.mc_mb_var_sum_temp = 0; @@ -3561,8 +3651,8 @@ for(i=1; ithread_context[i]); } - s->current_picture.mc_mb_var_sum= s->current_picture_ptr->mc_mb_var_sum= s->me.mc_mb_var_sum_temp; - s->current_picture. mb_var_sum= s->current_picture_ptr-> mb_var_sum= s->me. mb_var_sum_temp; + s->mc_mb_var_sum = s->me.mc_mb_var_sum_temp; + s->mb_var_sum = s->me. mb_var_sum_temp; emms_c(); if (s->me.scene_change_score > s->scenechange_threshold && @@ -3573,7 +3663,7 @@ if(s->msmpeg4_version >= 3) s->no_rounding=1; ff_dlog(s, "Scene change detected, encoding as I Frame %"PRId64" %"PRId64"\n", - s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); + s->mb_var_sum, s->mc_mb_var_sum); } if(!s->umvplus){ @@ -3655,9 +3745,9 @@ s-> intra_matrix[j] = av_clip_uint8(( luma_matrix[i] * s->qscale) >> 3); } s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision]; + s->c_dc_scale_table = ff_mpeg12_dc_scale_table[s->intra_dc_precision]; s->chroma_intra_matrix[0] = - s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8]; + s->intra_matrix[0] = ff_mpeg12_dc_scale_table[s->intra_dc_precision][8]; ff_convert_matrix(s, s->q_intra_matrix, s->q_intra_matrix16, s->intra_matrix, s->intra_quant_bias, 8, 8, 1); ff_convert_matrix(s, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16, @@ -3683,9 +3773,6 @@ s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1); s->qscale = 8; } - } else if (s->out_format == FMT_SPEEDHQ) { - s->y_dc_scale_table= - s->c_dc_scale_table= ff_mpeg2_dc_scale_table[3]; } //FIXME var duplication @@ -3711,32 +3798,32 @@ break; case FMT_H261: if (CONFIG_H261_ENCODER) - ff_h261_encode_picture_header(s, picture_number); + ff_h261_encode_picture_header(s); break; case FMT_H263: if (CONFIG_WMV2_ENCODER && s->codec_id == AV_CODEC_ID_WMV2) - ff_wmv2_encode_picture_header(s, picture_number); - else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version) - ff_msmpeg4_encode_picture_header(s, picture_number); + ff_wmv2_encode_picture_header(s); + else if (CONFIG_MSMPEG4ENC && s->msmpeg4_version) + ff_msmpeg4_encode_picture_header(s); else if (CONFIG_MPEG4_ENCODER && s->h263_pred) { - ret = ff_mpeg4_encode_picture_header(s, picture_number); + ret = ff_mpeg4_encode_picture_header(s); if (ret < 0) return ret; } else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10) { - ret = ff_rv10_encode_picture_header(s, picture_number); + ret = ff_rv10_encode_picture_header(s); if (ret < 0) return ret; } else if (CONFIG_RV20_ENCODER && s->codec_id == AV_CODEC_ID_RV20) - ff_rv20_encode_picture_header(s, picture_number); + ff_rv20_encode_picture_header(s); else if (CONFIG_FLV_ENCODER && s->codec_id == AV_CODEC_ID_FLV1) - ff_flv_encode_picture_header(s, picture_number); + ff_flv_encode_picture_header(s); else if (CONFIG_H263_ENCODER) - ff_h263_encode_picture_header(s, picture_number); + ff_h263_encode_picture_header(s); break; case FMT_MPEG1: if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) - ff_mpeg1_encode_picture_header(s, picture_number); + ff_mpeg1_encode_picture_header(s); break; default: av_assert0(0); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,8 @@ #include "me_cmp.h" #include "mpegvideoencdsp.h" -static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], - int16_t basis[64], int scale) +static int try_8x8basis_c(const int16_t rem[64], const int16_t weight[64], + const int16_t basis[64], int scale) { int i; unsigned int sum = 0; @@ -47,7 +47,7 @@ return sum >> 2; } -static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale) +static void add_8x8basis_c(int16_t rem[64], const int16_t basis[64], int scale) { int i; @@ -57,7 +57,7 @@ (BASIS_SHIFT - RECON_SHIFT); } -static int pix_sum_c(uint8_t *pix, int line_size) +static int pix_sum_c(const uint8_t *pix, int line_size) { int s = 0, i, j; @@ -78,7 +78,7 @@ return s; } -static int pix_norm1_c(uint8_t *pix, int line_size) +static int pix_norm1_c(const uint8_t *pix, int line_size) { int s = 0, i, j; const uint32_t *sq = ff_square_tab + 256; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideoencdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,12 +30,12 @@ #define EDGE_BOTTOM 2 typedef struct MpegvideoEncDSPContext { - int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], - int16_t basis[64], int scale); - void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale); + int (*try_8x8basis)(const int16_t rem[64], const int16_t weight[64], + const int16_t basis[64], int scale); + void (*add_8x8basis)(int16_t rem[64], const int16_t basis[64], int scale); - int (*pix_sum)(uint8_t *pix, int line_size); - int (*pix_norm1)(uint8_t *pix, int line_size); + int (*pix_sum)(const uint8_t *pix, int line_size); + int (*pix_norm1)(const uint8_t *pix, int line_size); void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo.h 2023-03-03 13:29:59.000000000 +0000 @@ -40,14 +40,10 @@ #include "me_cmp.h" #include "motion_est.h" #include "mpegpicture.h" -#include "mpegvideodsp.h" #include "mpegvideoencdsp.h" #include "pixblockdsp.h" #include "put_bits.h" #include "ratecontrol.h" -#if FF_API_FLAG_TRUNCATED -#include "parser.h" -#endif #include "mpegutils.h" #include "qpeldsp.h" #include "videodsp.h" @@ -57,6 +53,15 @@ #define MAX_B_FRAMES 16 /** + * Scantable. + */ +typedef struct ScanTable { + const uint8_t *scantable; + uint8_t permutated[64]; + uint8_t raster_end[64]; +} ScanTable; + +/** * MpegEncContext. */ typedef struct MpegEncContext { @@ -69,13 +74,14 @@ /* scantables */ ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce the cache usage - ScanTable intra_scantable; - ScanTable intra_h_scantable; - ScanTable intra_v_scantable; /* WARNING: changes above this line require updates to hardcoded * offsets used in ASM. */ + ScanTable intra_scantable; + uint8_t permutated_intra_h_scantable[64]; + uint8_t permutated_intra_v_scantable[64]; + struct AVCodecContext *avctx; /* The following pointer is intended for codecs sharing code * between decoder and encoder and in need of a common context to do so. */ @@ -108,6 +114,7 @@ int input_picture_number; ///< used to set pic->display_picture_number, should not be used for/by anything else int coded_picture_number; ///< used to set pic->coded_picture_number, should not be used for/by anything else int picture_number; //FIXME remove, unclear definition + int extradata_parsed; int picture_in_gop_number; ///< 0-> first pic in gop, ... int mb_width, mb_height; ///< number of MBs horizontally & vertically int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 @@ -165,6 +172,7 @@ Picture *last_picture_ptr; ///< pointer to the previous picture. Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred) Picture *current_picture_ptr; ///< pointer to the current picture + int skipped_last_frame; int last_dc[3]; ///< last DC values for MPEG-1 int16_t *dc_val_base; int16_t *dc_val[3]; ///< used for MPEG-4 DC prediction, all 3 arrays must be continuous @@ -209,7 +217,6 @@ HpelDSPContext hdsp; IDCTDSPContext idsp; MECmpContext mecc; - MpegVideoDSPContext mdsp; MpegvideoEncDSPContext mpvencdsp; PixblockDSPContext pdsp; QpelDSPContext qdsp; @@ -235,6 +242,15 @@ int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced B-frame encoding uint8_t (*p_field_select_table[2]); ///< Only the first element is allocated uint8_t (*b_field_select_table[2][2]); ///< Only the first element is allocated + + /* The following fields are encoder-only */ + uint16_t *mb_var; ///< Table for MB variances + uint16_t *mc_mb_var; ///< Table for motion compensated MB variances + uint8_t *mb_mean; ///< Table for MB luminance + int64_t mb_var_sum; ///< sum of MB variance for current frame + int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame + uint64_t encoding_error[MPEGVIDEO_MAX_PLANES]; + int motion_est; ///< ME algorithm int me_penalty_compensation; int me_pre; ///< prepass for motion estimation @@ -334,10 +350,6 @@ GetBitContext last_resync_gb; ///< used to search for the next resync marker int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only) -#if FF_API_FLAG_TRUNCATED - ParseContext parse_context; -#endif - /* H.263 specific */ int gob_index; int obmc; ///< overlapped block motion compensation @@ -369,13 +381,9 @@ uint16_t pb_time; ///< time distance between the last b and p,s,i frame uint16_t pp_field_time; uint16_t pb_field_time; ///< like above, just for interlaced - int real_sprite_warping_points; - int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY] - int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY] int mcsel; int quant_precision; int quarter_sample; ///< 1->qpel, 0->half pel ME/MC - int sprite_warping_accuracy; int data_partitioning; ///< data partitioning flag from header int partitioned_frame; ///< is current frame partitioned int low_delay; ///< no reordering needed / has no B-frames @@ -436,12 +444,6 @@ int brd_scale; int intra_vlc_format; int alternate_scan; -#define VIDEO_FORMAT_COMPONENT 0 -#define VIDEO_FORMAT_PAL 1 -#define VIDEO_FORMAT_NTSC 2 -#define VIDEO_FORMAT_SECAM 3 -#define VIDEO_FORMAT_MAC 4 -#define VIDEO_FORMAT_UNSPECIFIED 5 int repeat_first_field; int chroma_420_type; int chroma_format; @@ -573,26 +575,28 @@ void ff_mpv_common_end(MpegEncContext *s); -void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); - void ff_clean_intra_table_entries(MpegEncContext *s); int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src); void ff_set_qscale(MpegEncContext * s, int qscale); void ff_mpv_idct_init(MpegEncContext *s); +void ff_init_scantable(const uint8_t *permutation, ScanTable *st, + const uint8_t *src_scantable); void ff_init_block_index(MpegEncContext *s); void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]); -static inline void ff_update_block_index(MpegEncContext *s){ - const int bytes_per_pixel = 1 + (s->avctx->bits_per_raw_sample > 8); - const int block_size= (8*bytes_per_pixel) >> s->avctx->lowres; +static inline void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, + int lowres, int chroma_x_shift) +{ + const int bytes_per_pixel = 1 + (bits_per_raw_sample > 8); + const int block_size = (8 * bytes_per_pixel) >> lowres; s->block_index[0]+=2; s->block_index[1]+=2; @@ -601,8 +605,8 @@ s->block_index[4]++; s->block_index[5]++; s->dest[0]+= 2*block_size; - s->dest[1]+= (2 >> s->chroma_x_shift) * block_size; - s->dest[2]+= (2 >> s->chroma_x_shift) * block_size; + s->dest[1] += (2 >> chroma_x_shift) * block_size; + s->dest[2] += (2 >> chroma_x_shift) * block_size; } #endif /* AVCODEC_MPEGVIDEO_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_motion.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_motion.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_motion.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_motion.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,164 +31,10 @@ #include "h261.h" #include "mpegutils.h" #include "mpegvideo.h" +#include "mpeg4videodec.h" #include "qpeldsp.h" #include "wmv2.h" -static void gmc1_motion(MpegEncContext *s, - uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture) -{ - uint8_t *ptr; - int src_x, src_y, motion_x, motion_y; - ptrdiff_t offset, linesize, uvlinesize; - int emu = 0; - - motion_x = s->sprite_offset[0][0]; - motion_y = s->sprite_offset[0][1]; - src_x = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy + 1)); - src_y = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy + 1)); - motion_x *= 1 << (3 - s->sprite_warping_accuracy); - motion_y *= 1 << (3 - s->sprite_warping_accuracy); - src_x = av_clip(src_x, -16, s->width); - if (src_x == s->width) - motion_x = 0; - src_y = av_clip(src_y, -16, s->height); - if (src_y == s->height) - motion_y = 0; - - linesize = s->linesize; - uvlinesize = s->uvlinesize; - - ptr = ref_picture[0] + src_y * linesize + src_x; - - if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || - (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, - linesize, linesize, - 17, 17, - src_x, src_y, - s->h_edge_pos, s->v_edge_pos); - ptr = s->sc.edge_emu_buffer; - } - - if ((motion_x | motion_y) & 7) { - s->mdsp.gmc1(dest_y, ptr, linesize, 16, - motion_x & 15, motion_y & 15, 128 - s->no_rounding); - s->mdsp.gmc1(dest_y + 8, ptr + 8, linesize, 16, - motion_x & 15, motion_y & 15, 128 - s->no_rounding); - } else { - int dxy; - - dxy = ((motion_x >> 3) & 1) | ((motion_y >> 2) & 2); - if (s->no_rounding) { - s->hdsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); - } else { - s->hdsp.put_pixels_tab[0][dxy](dest_y, ptr, linesize, 16); - } - } - - if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) - return; - - motion_x = s->sprite_offset[1][0]; - motion_y = s->sprite_offset[1][1]; - src_x = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy + 1)); - src_y = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy + 1)); - motion_x *= 1 << (3 - s->sprite_warping_accuracy); - motion_y *= 1 << (3 - s->sprite_warping_accuracy); - src_x = av_clip(src_x, -8, s->width >> 1); - if (src_x == s->width >> 1) - motion_x = 0; - src_y = av_clip(src_y, -8, s->height >> 1); - if (src_y == s->height >> 1) - motion_y = 0; - - offset = (src_y * uvlinesize) + src_x; - ptr = ref_picture[1] + offset; - if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || - (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, - uvlinesize, uvlinesize, - 9, 9, - src_x, src_y, - s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->sc.edge_emu_buffer; - emu = 1; - } - s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, - motion_x & 15, motion_y & 15, 128 - s->no_rounding); - - ptr = ref_picture[2] + offset; - if (emu) { - s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, - uvlinesize, uvlinesize, - 9, 9, - src_x, src_y, - s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->sc.edge_emu_buffer; - } - s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, - motion_x & 15, motion_y & 15, 128 - s->no_rounding); -} - -static void gmc_motion(MpegEncContext *s, - uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture) -{ - uint8_t *ptr; - int linesize, uvlinesize; - const int a = s->sprite_warping_accuracy; - int ox, oy; - - linesize = s->linesize; - uvlinesize = s->uvlinesize; - - ptr = ref_picture[0]; - - ox = s->sprite_offset[0][0] + s->sprite_delta[0][0] * s->mb_x * 16 + - s->sprite_delta[0][1] * s->mb_y * 16; - oy = s->sprite_offset[0][1] + s->sprite_delta[1][0] * s->mb_x * 16 + - s->sprite_delta[1][1] * s->mb_y * 16; - - s->mdsp.gmc(dest_y, ptr, linesize, 16, - ox, oy, - s->sprite_delta[0][0], s->sprite_delta[0][1], - s->sprite_delta[1][0], s->sprite_delta[1][1], - a + 1, (1 << (2 * a + 1)) - s->no_rounding, - s->h_edge_pos, s->v_edge_pos); - s->mdsp.gmc(dest_y + 8, ptr, linesize, 16, - ox + s->sprite_delta[0][0] * 8, - oy + s->sprite_delta[1][0] * 8, - s->sprite_delta[0][0], s->sprite_delta[0][1], - s->sprite_delta[1][0], s->sprite_delta[1][1], - a + 1, (1 << (2 * a + 1)) - s->no_rounding, - s->h_edge_pos, s->v_edge_pos); - - if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) - return; - - ox = s->sprite_offset[1][0] + s->sprite_delta[0][0] * s->mb_x * 8 + - s->sprite_delta[0][1] * s->mb_y * 8; - oy = s->sprite_offset[1][1] + s->sprite_delta[1][0] * s->mb_x * 8 + - s->sprite_delta[1][1] * s->mb_y * 8; - - ptr = ref_picture[1]; - s->mdsp.gmc(dest_cb, ptr, uvlinesize, 8, - ox, oy, - s->sprite_delta[0][0], s->sprite_delta[0][1], - s->sprite_delta[1][0], s->sprite_delta[1][1], - a + 1, (1 << (2 * a + 1)) - s->no_rounding, - (s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1); - - ptr = ref_picture[2]; - s->mdsp.gmc(dest_cr, ptr, uvlinesize, 8, - ox, oy, - s->sprite_delta[0][0], s->sprite_delta[0][1], - s->sprite_delta[1][0], s->sprite_delta[1][1], - a + 1, (1 << (2 * a + 1)) - s->no_rounding, - (s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1); -} - static inline int hpel_motion(MpegEncContext *s, uint8_t *dest, uint8_t *src, int src_x, int src_y, @@ -232,7 +78,7 @@ int field_based, int bottom_field, int field_select, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, @@ -241,7 +87,7 @@ int is_16x8, int mb_y) { - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, block_y_half; ptrdiff_t uvlinesize, linesize; @@ -369,7 +215,7 @@ /* apply one mpeg motion vector to the three components */ static void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - int field_select, uint8_t **ref_picture, + int field_select, uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, int is_16x8, int mb_y) { @@ -388,7 +234,7 @@ static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int bottom_field, int field_select, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h, int mb_y) { @@ -489,12 +335,12 @@ uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, - int field_select, uint8_t **ref_picture, + int field_select, uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16], int motion_x, int motion_y, int h) { - uint8_t *ptr_y, *ptr_cb, *ptr_cr; + const uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos; ptrdiff_t linesize, uvlinesize; @@ -593,11 +439,11 @@ */ static void chroma_4mv_motion(MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func *pix_op, int mx, int my) { - uint8_t *ptr; + const uint8_t *ptr; int src_x, src_y, dxy, emu = 0; ptrdiff_t offset; @@ -643,7 +489,7 @@ pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8); } -static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir) +static inline void prefetch_motion(MpegEncContext *s, uint8_t *const *pix, int dir) { /* fetch pixels for estimated mv 4 macroblocks ahead * optimized for 64byte cache lines */ @@ -661,11 +507,11 @@ uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4]) { LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]); - Picture *cur_frame = &s->current_picture; + const Picture *cur_frame = &s->current_picture; int mb_x = s->mb_x; int mb_y = s->mb_y; const int xy = mb_x + mb_y * s->mb_stride; @@ -749,7 +595,7 @@ uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, qpel_mc_func (*qpix_op)[16], op_pixels_func (*pix_op)[4]) { @@ -757,7 +603,8 @@ int i; int mb_x = s->mb_x; int mb_y = s->mb_y; - uint8_t *ptr, *dest; + uint8_t *dest; + const uint8_t *ptr; mx = 0; my = 0; @@ -833,7 +680,7 @@ uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16], int is_mpeg12) @@ -848,14 +695,8 @@ switch (s->mv_type) { case MV_TYPE_16X16: - if (!is_mpeg12 && s->mcsel) { - if (s->real_sprite_warping_points == 1) { - gmc1_motion(s, dest_y, dest_cb, dest_cr, - ref_picture); - } else { - gmc_motion(s, dest_y, dest_cb, dest_cr, - ref_picture); - } + if (CONFIG_MPEG4_DECODER && !is_mpeg12 && s->mcsel) { + ff_mpeg4_mcsel_motion(s, dest_y, dest_cb, dest_cr, ref_picture); } else if (!is_mpeg12 && s->quarter_sample) { qpel_motion(s, dest_y, dest_cb, dest_cr, 0, 0, 0, @@ -912,7 +753,7 @@ case MV_TYPE_16X8: if (CONFIG_SMALL || is_mpeg12) { for (i = 0; i < 2; i++) { - uint8_t **ref2picture; + uint8_t *const *ref2picture; if ((s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && @@ -974,7 +815,7 @@ void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, - uint8_t **ref_picture, + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16]) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpegvideo_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "internal.h" +#include "libavutil/avassert.h" +#include "decode.h" #include "parser.h" #include "mpeg12.h" #include "mpeg12data.h" @@ -33,7 +34,6 @@ int width, height; }; -#if !FF_API_FLAG_TRUNCATED /** * Find the end of the current frame in the bitstream. * @return the position of the first byte of the next frame, or -1 @@ -98,7 +98,6 @@ pc->state = state; return END_NOT_FOUND; } -#endif static void mpegvideo_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx, @@ -241,11 +240,6 @@ s->coded_width = FFALIGN(pc->width, 16); s->coded_height = FFALIGN(pc->height, 16); } - -#if FF_API_AVCTX_TIMEBASE - if (avctx->framerate.num) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); -#endif } static int mpegvideo_parse(AVCodecParserContext *s, @@ -260,11 +254,7 @@ if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ next= buf_size; }else{ -#if FF_API_FLAG_TRUNCATED - next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s); -#else next = mpeg1_find_frame_end(pc, buf, buf_size, s); -#endif if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { *poutbuf = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpl2dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpl2dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpl2dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpl2dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -83,12 +83,11 @@ const FFCodec ff_mpl2_decoder = { .p.name = "mpl2", - .p.long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitle"), + CODEC_LONG_NAME("MPL2 subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MPL2, FF_CODEC_DECODE_SUB_CB(mpl2_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mpv_reconstruct_mb_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,303 @@ +/* + * MPEG macroblock reconstruction + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define NOT_MPEG12 0 +#define MAY_BE_MPEG12 1 +#define DEFINITELY_MPEG12 2 + +/* put block[] to dest[] */ +static inline void put_dct(MpegEncContext *s, + int16_t *block, int i, uint8_t *dest, int line_size, int qscale) +{ + s->dct_unquantize_intra(s, block, i, qscale); + s->idsp.idct_put(dest, line_size, block); +} + +static inline void add_dequant_dct(MpegEncContext *s, + int16_t *block, int i, uint8_t *dest, int line_size, int qscale) +{ + if (s->block_last_index[i] >= 0) { + s->dct_unquantize_inter(s, block, i, qscale); + + s->idsp.idct_add(dest, line_size, block); + } +} + +/* generic function called after a macroblock has been parsed by the + decoder or after it has been encoded by the encoder. + + Important variables used: + s->mb_intra : true if intra macroblock + s->mv_dir : motion vector direction + s->mv_type : motion vector type + s->mv : motion vector + s->interlaced_dct : true if interlaced dct used (mpeg2) + */ +static av_always_inline +void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], + int lowres_flag, int is_mpeg12) +{ +#define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG1) : is_mpeg12) + const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; + + s->current_picture.qscale_table[mb_xy] = s->qscale; + + /* update DC predictors for P macroblocks */ + if (!s->mb_intra) { + if (is_mpeg12 != DEFINITELY_MPEG12 && (s->h263_pred || s->h263_aic)) { + if (s->mbintra_table[mb_xy]) + ff_clean_intra_table_entries(s); + } else { + s->last_dc[0] = + s->last_dc[1] = + s->last_dc[2] = 128 << s->intra_dc_precision; + } + } else if (is_mpeg12 != DEFINITELY_MPEG12 && (s->h263_pred || s->h263_aic)) + s->mbintra_table[mb_xy] = 1; + +#if IS_ENCODER + if ((s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->frame_skip_threshold || s->frame_skip_factor || + !((s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) && + s->avctx->mb_decision != FF_MB_DECISION_RD)) // FIXME precalc +#endif /* IS_ENCODER */ + { + uint8_t *dest_y, *dest_cb, *dest_cr; + int dct_linesize, dct_offset; + const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics + const int uvlinesize = s->current_picture.f->linesize[1]; + const int readable = IS_ENCODER || lowres_flag || s->pict_type != AV_PICTURE_TYPE_B; + const int block_size = lowres_flag ? 8 >> s->avctx->lowres : 8; + + /* avoid copy if macroblock skipped in last frame too */ + /* skip only during decoding as we might trash the buffers during encoding a bit */ + if (!IS_ENCODER) { + uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy]; + + if (s->mb_skipped) { + s->mb_skipped = 0; + av_assert2(s->pict_type!=AV_PICTURE_TYPE_I); + *mbskip_ptr = 1; + } else if(!s->current_picture.reference) { + *mbskip_ptr = 1; + } else{ + *mbskip_ptr = 0; /* not skipped */ + } + } + + dct_linesize = linesize << s->interlaced_dct; + dct_offset = s->interlaced_dct ? linesize : linesize * block_size; + + if (readable) { + dest_y = s->dest[0]; + dest_cb = s->dest[1]; + dest_cr = s->dest[2]; + } else { + dest_y = s->sc.b_scratchpad; + dest_cb = s->sc.b_scratchpad + 16 * linesize; + dest_cr = s->sc.b_scratchpad + 32 * linesize; + } + + if (!s->mb_intra) { + /* motion handling */ + /* decoding or more than one mb_type (MC was already done otherwise) */ + +#if !IS_ENCODER + if (HAVE_THREADS && is_mpeg12 != DEFINITELY_MPEG12 && + s->avctx->active_thread_type & FF_THREAD_FRAME) { + if (s->mv_dir & MV_DIR_FORWARD) { + ff_thread_await_progress(&s->last_picture_ptr->tf, + lowest_referenced_row(s, 0), 0); + } + if (s->mv_dir & MV_DIR_BACKWARD) { + ff_thread_await_progress(&s->next_picture_ptr->tf, + lowest_referenced_row(s, 1), 0); + } + } + + if (lowres_flag) { + const h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; + + if (s->mv_dir & MV_DIR_FORWARD) { + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix); + op_pix = s->h264chroma.avg_h264_chroma_pixels_tab; + } + if (s->mv_dir & MV_DIR_BACKWARD) { + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix); + } + } else { + op_pixels_func (*op_pix)[4]; + qpel_mc_func (*op_qpix)[16]; + + if ((is_mpeg12 == DEFINITELY_MPEG12 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { + op_pix = s->hdsp.put_pixels_tab; + op_qpix = s->qdsp.put_qpel_pixels_tab; + } else { + op_pix = s->hdsp.put_no_rnd_pixels_tab; + op_qpix = s->qdsp.put_no_rnd_qpel_pixels_tab; + } + if (s->mv_dir & MV_DIR_FORWARD) { + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); + op_pix = s->hdsp.avg_pixels_tab; + op_qpix = s->qdsp.avg_qpel_pixels_tab; + } + if (s->mv_dir & MV_DIR_BACKWARD) { + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); + } + } + + /* skip dequant / idct if we are really late ;) */ + if (s->avctx->skip_idct) { + if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) + ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) + || s->avctx->skip_idct >= AVDISCARD_ALL) + goto skip_idct; + } + + /* add dct residue */ + if (!(IS_MPEG12(s) || s->msmpeg4_version || + (s->codec_id == AV_CODEC_ID_MPEG4 && !s->mpeg_quant))) +#endif /* !IS_ENCODER */ + { + add_dequant_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale); + add_dequant_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale); + add_dequant_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale); + add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale); + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (s->chroma_y_shift) { + add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); + add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); + } else { + dct_linesize >>= 1; + dct_offset >>= 1; + add_dequant_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale); + add_dequant_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale); + add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale); + add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale); + } + } + } +#if !IS_ENCODER + else if (is_mpeg12 == DEFINITELY_MPEG12 || (s->codec_id != AV_CODEC_ID_WMV2)) { + add_dct(s, block[0], 0, dest_y , dct_linesize); + add_dct(s, block[1], 1, dest_y + block_size, dct_linesize); + add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize); + add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize); + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (s->chroma_y_shift) {//Chroma420 + add_dct(s, block[4], 4, dest_cb, uvlinesize); + add_dct(s, block[5], 5, dest_cr, uvlinesize); + } else { + //chroma422 + dct_linesize = uvlinesize << s->interlaced_dct; + dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize*block_size; + + add_dct(s, block[4], 4, dest_cb, dct_linesize); + add_dct(s, block[5], 5, dest_cr, dct_linesize); + add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize); + add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize); + if (!s->chroma_x_shift) {//Chroma444 + add_dct(s, block[8], 8, dest_cb+block_size, dct_linesize); + add_dct(s, block[9], 9, dest_cr+block_size, dct_linesize); + add_dct(s, block[10], 10, dest_cb+block_size+dct_offset, dct_linesize); + add_dct(s, block[11], 11, dest_cr+block_size+dct_offset, dct_linesize); + } + } + } //fi gray + } else if (CONFIG_WMV2_DECODER) { + ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr); + } +#endif /* !IS_ENCODER */ + } else { +#if !IS_ENCODER + /* Only MPEG-4 Simple Studio Profile is supported in > 8-bit mode. + TODO: Integrate 10-bit properly into mpegvideo.c so that ER works properly */ + if (is_mpeg12 != DEFINITELY_MPEG12 && CONFIG_MPEG4_DECODER && + /* s->codec_id == AV_CODEC_ID_MPEG4 && */ + s->avctx->bits_per_raw_sample > 8) { + ff_mpeg4_decode_studio(s, dest_y, dest_cb, dest_cr, block_size, + uvlinesize, dct_linesize, dct_offset); + } else if (!IS_MPEG12(s)) +#endif /* !IS_ENCODER */ + { + /* dct only in intra block */ + put_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale); + put_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale); + put_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale); + put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale); + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (s->chroma_y_shift) { + put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale); + put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale); + } else { + dct_offset >>=1; + dct_linesize >>=1; + put_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale); + put_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale); + put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale); + put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale); + } + } + } +#if !IS_ENCODER + else { + s->idsp.idct_put(dest_y, dct_linesize, block[0]); + s->idsp.idct_put(dest_y + block_size, dct_linesize, block[1]); + s->idsp.idct_put(dest_y + dct_offset, dct_linesize, block[2]); + s->idsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]); + + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (s->chroma_y_shift) { + s->idsp.idct_put(dest_cb, uvlinesize, block[4]); + s->idsp.idct_put(dest_cr, uvlinesize, block[5]); + } else { + dct_linesize = uvlinesize << s->interlaced_dct; + dct_offset = s->interlaced_dct ? uvlinesize : uvlinesize*block_size; + + s->idsp.idct_put(dest_cb, dct_linesize, block[4]); + s->idsp.idct_put(dest_cr, dct_linesize, block[5]); + s->idsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]); + s->idsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]); + if (!s->chroma_x_shift) { //Chroma444 + s->idsp.idct_put(dest_cb + block_size, dct_linesize, block[8]); + s->idsp.idct_put(dest_cr + block_size, dct_linesize, block[9]); + s->idsp.idct_put(dest_cb + block_size + dct_offset, dct_linesize, block[10]); + s->idsp.idct_put(dest_cr + block_size + dct_offset, dct_linesize, block[11]); + } + } + } //gray + } + } +skip_idct: + if (!readable) { + s->hdsp.put_pixels_tab[0][0](s->dest[0], dest_y, linesize, 16); + if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { + s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize, 16 >> s->chroma_y_shift); + s->hdsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize, 16 >> s->chroma_y_shift); + } +#endif /* !IS_ENCODER */ + } + } +} + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mscc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mscc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mscc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mscc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,12 @@ */ #include -#include #include #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include @@ -253,7 +252,7 @@ const FFCodec ff_mscc_decoder = { .p.name = "mscc", - .p.long_name = NULL_IF_CONFIG_SMALL("Mandsoft Screen Capture Codec"), + CODEC_LONG_NAME("Mandsoft Screen Capture Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSCC, .priv_data_size = sizeof(MSCCContext), @@ -261,12 +260,12 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_srgc_decoder = { .p.name = "srgc", - .p.long_name = NULL_IF_CONFIG_SMALL("Screen Recorder Gold Codec"), + CODEC_LONG_NAME("Screen Recorder Gold Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SRGC, .priv_data_size = sizeof(MSCCContext), @@ -274,5 +273,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,6 @@ * MSMPEG4 backend for encoder and decoder */ -#include "config_components.h" - #include "libavutil/thread.h" #include "avcodec.h" @@ -38,9 +36,8 @@ #include "libavutil/x86/asm.h" #include "mpeg4videodata.h" #include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "mpegvideodata.h" -#include "vc1data.h" -#include "libavutil/imgutils.h" /* * You can also call this codec: MPEG-4 with a twist! @@ -138,21 +135,15 @@ s->y_dc_scale_table= ff_wmv1_y_dc_scale_table; s->c_dc_scale_table= ff_wmv1_c_dc_scale_table; break; -#if CONFIG_VC1_DECODER - case 6: - s->y_dc_scale_table= ff_wmv3_dc_scale_table; - s->c_dc_scale_table= ff_wmv3_dc_scale_table; - break; -#endif - } - if(s->msmpeg4_version>=4){ ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, ff_wmv1_scantable[2]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, ff_wmv1_scantable[3]); ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_wmv1_scantable[3], + s->idsp.idct_permutation); } //Note the default tables are set in common_init in mpegvideo.c diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,34 +30,11 @@ #include "h263data.h" #include "mpeg4videodata.h" #include "msmpeg4data.h" +#include "rl.h" uint32_t ff_v2_dc_lum_table[512][2]; uint32_t ff_v2_dc_chroma_table[512][2]; -VLC ff_msmp4_mb_i_vlc; -VLC ff_msmp4_dc_luma_vlc[2]; -VLC ff_msmp4_dc_chroma_vlc[2]; - -/* intra picture macroblock coded block pattern */ -const uint16_t ff_msmp4_mb_i_table[64][2] = { - { 0x1, 1 }, { 0x17, 6 }, { 0x9, 5 }, { 0x5, 5 }, - { 0x6, 5 }, { 0x47, 9 }, { 0x20, 7 }, { 0x10, 7 }, - { 0x2, 5 }, { 0x7c, 9 }, { 0x3a, 7 }, { 0x1d, 7 }, - { 0x2, 6 }, { 0xec, 9 }, { 0x77, 8 }, { 0x0, 8 }, - { 0x3, 5 }, { 0xb7, 9 }, { 0x2c, 7 }, { 0x13, 7 }, - { 0x1, 6 }, { 0x168, 10 }, { 0x46, 8 }, { 0x3f, 8 }, - { 0x1e, 6 }, { 0x712, 13 }, { 0xb5, 9 }, { 0x42, 8 }, - { 0x22, 7 }, { 0x1c5, 11 }, { 0x11e, 10 }, { 0x87, 9 }, - { 0x6, 4 }, { 0x3, 9 }, { 0x1e, 7 }, { 0x1c, 6 }, - { 0x12, 7 }, { 0x388, 12 }, { 0x44, 9 }, { 0x70, 9 }, - { 0x1f, 6 }, { 0x23e, 11 }, { 0x39, 8 }, { 0x8e, 9 }, - { 0x1, 7 }, { 0x1c6, 11 }, { 0xb6, 9 }, { 0x45, 9 }, - { 0x14, 6 }, { 0x23f, 11 }, { 0x7d, 9 }, { 0x18, 9 }, - { 0x7, 7 }, { 0x1c7, 11 }, { 0x86, 9 }, { 0x19, 9 }, - { 0x15, 6 }, { 0x1db, 10 }, { 0x2, 9 }, { 0x46, 9 }, - { 0xd, 8 }, { 0x713, 13 }, { 0x1da, 10 }, { 0x169, 10 }, -}; - /* non intra picture macroblock coded block pattern + mb type */ const uint32_t ff_table_mb_non_intra[128][2] = { { 0x40, 7 }, { 0x13c9, 13 }, { 0x9fd, 12 }, { 0x1fc, 15 }, @@ -94,142 +71,6 @@ { 0x5, 5 }, { 0xb, 10 }, { 0x9c, 8 }, { 0xe, 10 }, }; -/* dc table 0 */ - -const uint32_t ff_table0_dc_lum[120][2] = { - { 0x1, 1 }, { 0x1, 2 }, { 0x1, 4 }, { 0x1, 5 }, - { 0x5, 5 }, { 0x7, 5 }, { 0x8, 6 }, { 0xc, 6 }, - { 0x0, 7 }, { 0x2, 7 }, { 0x12, 7 }, { 0x1a, 7 }, - { 0x3, 8 }, { 0x7, 8 }, { 0x27, 8 }, { 0x37, 8 }, - { 0x5, 9 }, { 0x4c, 9 }, { 0x6c, 9 }, { 0x6d, 9 }, - { 0x8, 10 }, { 0x19, 10 }, { 0x9b, 10 }, { 0x1b, 10 }, - { 0x9a, 10 }, { 0x13, 11 }, { 0x34, 11 }, { 0x35, 11 }, - { 0x61, 12 }, { 0x48, 13 }, { 0xc4, 13 }, { 0x4a, 13 }, - { 0xc6, 13 }, { 0xc7, 13 }, { 0x92, 14 }, { 0x18b, 14 }, - { 0x93, 14 }, { 0x183, 14 }, { 0x182, 14 }, { 0x96, 14 }, - { 0x97, 14 }, { 0x180, 14 }, { 0x314, 15 }, { 0x315, 15 }, - { 0x605, 16 }, { 0x604, 16 }, { 0x606, 16 }, { 0xc0e, 17 }, - { 0x303cd, 23 }, { 0x303c9, 23 }, { 0x303c8, 23 }, { 0x303ca, 23 }, - { 0x303cb, 23 }, { 0x303cc, 23 }, { 0x303ce, 23 }, { 0x303cf, 23 }, - { 0x303d0, 23 }, { 0x303d1, 23 }, { 0x303d2, 23 }, { 0x303d3, 23 }, - { 0x303d4, 23 }, { 0x303d5, 23 }, { 0x303d6, 23 }, { 0x303d7, 23 }, - { 0x303d8, 23 }, { 0x303d9, 23 }, { 0x303da, 23 }, { 0x303db, 23 }, - { 0x303dc, 23 }, { 0x303dd, 23 }, { 0x303de, 23 }, { 0x303df, 23 }, - { 0x303e0, 23 }, { 0x303e1, 23 }, { 0x303e2, 23 }, { 0x303e3, 23 }, - { 0x303e4, 23 }, { 0x303e5, 23 }, { 0x303e6, 23 }, { 0x303e7, 23 }, - { 0x303e8, 23 }, { 0x303e9, 23 }, { 0x303ea, 23 }, { 0x303eb, 23 }, - { 0x303ec, 23 }, { 0x303ed, 23 }, { 0x303ee, 23 }, { 0x303ef, 23 }, - { 0x303f0, 23 }, { 0x303f1, 23 }, { 0x303f2, 23 }, { 0x303f3, 23 }, - { 0x303f4, 23 }, { 0x303f5, 23 }, { 0x303f6, 23 }, { 0x303f7, 23 }, - { 0x303f8, 23 }, { 0x303f9, 23 }, { 0x303fa, 23 }, { 0x303fb, 23 }, - { 0x303fc, 23 }, { 0x303fd, 23 }, { 0x303fe, 23 }, { 0x303ff, 23 }, - { 0x60780, 24 }, { 0x60781, 24 }, { 0x60782, 24 }, { 0x60783, 24 }, - { 0x60784, 24 }, { 0x60785, 24 }, { 0x60786, 24 }, { 0x60787, 24 }, - { 0x60788, 24 }, { 0x60789, 24 }, { 0x6078a, 24 }, { 0x6078b, 24 }, - { 0x6078c, 24 }, { 0x6078d, 24 }, { 0x6078e, 24 }, { 0x6078f, 24 }, -}; - -const uint32_t ff_table0_dc_chroma[120][2] = { - { 0x0, 2 }, { 0x1, 2 }, { 0x5, 3 }, { 0x9, 4 }, - { 0xd, 4 }, { 0x11, 5 }, { 0x1d, 5 }, { 0x1f, 5 }, - { 0x21, 6 }, { 0x31, 6 }, { 0x38, 6 }, { 0x33, 6 }, - { 0x39, 6 }, { 0x3d, 6 }, { 0x61, 7 }, { 0x79, 7 }, - { 0x80, 8 }, { 0xc8, 8 }, { 0xca, 8 }, { 0xf0, 8 }, - { 0x81, 8 }, { 0xc0, 8 }, { 0xc9, 8 }, { 0x107, 9 }, - { 0x106, 9 }, { 0x196, 9 }, { 0x183, 9 }, { 0x1e3, 9 }, - { 0x1e2, 9 }, { 0x20a, 10 }, { 0x20b, 10 }, { 0x609, 11 }, - { 0x412, 11 }, { 0x413, 11 }, { 0x60b, 11 }, { 0x411, 11 }, - { 0x60a, 11 }, { 0x65f, 11 }, { 0x410, 11 }, { 0x65d, 11 }, - { 0x65e, 11 }, { 0xcb8, 12 }, { 0xc10, 12 }, { 0xcb9, 12 }, - { 0x1823, 13 }, { 0x3045, 14 }, { 0x6089, 15 }, { 0xc110, 16 }, - { 0x304448, 22 }, { 0x304449, 22 }, { 0x30444a, 22 }, { 0x30444b, 22 }, - { 0x30444c, 22 }, { 0x30444d, 22 }, { 0x30444e, 22 }, { 0x30444f, 22 }, - { 0x304450, 22 }, { 0x304451, 22 }, { 0x304452, 22 }, { 0x304453, 22 }, - { 0x304454, 22 }, { 0x304455, 22 }, { 0x304456, 22 }, { 0x304457, 22 }, - { 0x304458, 22 }, { 0x304459, 22 }, { 0x30445a, 22 }, { 0x30445b, 22 }, - { 0x30445c, 22 }, { 0x30445d, 22 }, { 0x30445e, 22 }, { 0x30445f, 22 }, - { 0x304460, 22 }, { 0x304461, 22 }, { 0x304462, 22 }, { 0x304463, 22 }, - { 0x304464, 22 }, { 0x304465, 22 }, { 0x304466, 22 }, { 0x304467, 22 }, - { 0x304468, 22 }, { 0x304469, 22 }, { 0x30446a, 22 }, { 0x30446b, 22 }, - { 0x30446c, 22 }, { 0x30446d, 22 }, { 0x30446e, 22 }, { 0x30446f, 22 }, - { 0x304470, 22 }, { 0x304471, 22 }, { 0x304472, 22 }, { 0x304473, 22 }, - { 0x304474, 22 }, { 0x304475, 22 }, { 0x304476, 22 }, { 0x304477, 22 }, - { 0x304478, 22 }, { 0x304479, 22 }, { 0x30447a, 22 }, { 0x30447b, 22 }, - { 0x30447c, 22 }, { 0x30447d, 22 }, { 0x30447e, 22 }, { 0x30447f, 22 }, - { 0x608880, 23 }, { 0x608881, 23 }, { 0x608882, 23 }, { 0x608883, 23 }, - { 0x608884, 23 }, { 0x608885, 23 }, { 0x608886, 23 }, { 0x608887, 23 }, - { 0x608888, 23 }, { 0x608889, 23 }, { 0x60888a, 23 }, { 0x60888b, 23 }, - { 0x60888c, 23 }, { 0x60888d, 23 }, { 0x60888e, 23 }, { 0x60888f, 23 }, -}; - -/* dc table 1 */ - -const uint32_t ff_table1_dc_lum[120][2] = { - { 0x2, 2 }, { 0x3, 2 }, { 0x3, 3 }, { 0x2, 4 }, - { 0x5, 4 }, { 0x1, 5 }, { 0x3, 5 }, { 0x8, 5 }, - { 0x0, 6 }, { 0x5, 6 }, { 0xd, 6 }, { 0xf, 6 }, - { 0x13, 6 }, { 0x8, 7 }, { 0x18, 7 }, { 0x1c, 7 }, - { 0x24, 7 }, { 0x4, 8 }, { 0x6, 8 }, { 0x12, 8 }, - { 0x32, 8 }, { 0x3b, 8 }, { 0x4a, 8 }, { 0x4b, 8 }, - { 0xb, 9 }, { 0x26, 9 }, { 0x27, 9 }, { 0x66, 9 }, - { 0x74, 9 }, { 0x75, 9 }, { 0x14, 10 }, { 0x1c, 10 }, - { 0x1f, 10 }, { 0x1d, 10 }, { 0x2b, 11 }, { 0x3d, 11 }, - { 0x19d, 11 }, { 0x19f, 11 }, { 0x54, 12 }, { 0x339, 12 }, - { 0x338, 12 }, { 0x33d, 12 }, { 0xab, 13 }, { 0xf1, 13 }, - { 0x678, 13 }, { 0xf2, 13 }, { 0x1e0, 14 }, { 0x1e1, 14 }, - { 0x154, 14 }, { 0xcf2, 14 }, { 0x3cc, 15 }, { 0x2ab, 15 }, - { 0x19e7, 15 }, { 0x3ce, 15 }, { 0x19e6, 15 }, { 0x554, 16 }, - { 0x79f, 16 }, { 0x555, 16 }, { 0xf3d, 17 }, { 0xf37, 17 }, - { 0xf3c, 17 }, { 0xf35, 17 }, { 0x1e6d, 18 }, { 0x1e68, 18 }, - { 0x3cd8, 19 }, { 0x3cd3, 19 }, { 0x3cd9, 19 }, { 0x79a4, 20 }, - { 0xf34ba, 25 }, { 0xf34b4, 25 }, { 0xf34b5, 25 }, { 0xf34b6, 25 }, - { 0xf34b7, 25 }, { 0xf34b8, 25 }, { 0xf34b9, 25 }, { 0xf34bb, 25 }, - { 0xf34bc, 25 }, { 0xf34bd, 25 }, { 0xf34be, 25 }, { 0xf34bf, 25 }, - { 0x1e6940, 26 }, { 0x1e6941, 26 }, { 0x1e6942, 26 }, { 0x1e6943, 26 }, - { 0x1e6944, 26 }, { 0x1e6945, 26 }, { 0x1e6946, 26 }, { 0x1e6947, 26 }, - { 0x1e6948, 26 }, { 0x1e6949, 26 }, { 0x1e694a, 26 }, { 0x1e694b, 26 }, - { 0x1e694c, 26 }, { 0x1e694d, 26 }, { 0x1e694e, 26 }, { 0x1e694f, 26 }, - { 0x1e6950, 26 }, { 0x1e6951, 26 }, { 0x1e6952, 26 }, { 0x1e6953, 26 }, - { 0x1e6954, 26 }, { 0x1e6955, 26 }, { 0x1e6956, 26 }, { 0x1e6957, 26 }, - { 0x1e6958, 26 }, { 0x1e6959, 26 }, { 0x1e695a, 26 }, { 0x1e695b, 26 }, - { 0x1e695c, 26 }, { 0x1e695d, 26 }, { 0x1e695e, 26 }, { 0x1e695f, 26 }, - { 0x1e6960, 26 }, { 0x1e6961, 26 }, { 0x1e6962, 26 }, { 0x1e6963, 26 }, - { 0x1e6964, 26 }, { 0x1e6965, 26 }, { 0x1e6966, 26 }, { 0x1e6967, 26 }, -}; - -const uint32_t ff_table1_dc_chroma[120][2] = { - { 0x0, 2 }, { 0x1, 2 }, { 0x4, 3 }, { 0x7, 3 }, - { 0xb, 4 }, { 0xd, 4 }, { 0x15, 5 }, { 0x28, 6 }, - { 0x30, 6 }, { 0x32, 6 }, { 0x52, 7 }, { 0x62, 7 }, - { 0x66, 7 }, { 0xa6, 8 }, { 0xc6, 8 }, { 0xcf, 8 }, - { 0x14f, 9 }, { 0x18e, 9 }, { 0x19c, 9 }, { 0x29d, 10 }, - { 0x33a, 10 }, { 0x538, 11 }, { 0x63c, 11 }, { 0x63e, 11 }, - { 0x63f, 11 }, { 0x676, 11 }, { 0xa73, 12 }, { 0xc7a, 12 }, - { 0xcef, 12 }, { 0x14e5, 13 }, { 0x19dd, 13 }, { 0x29c8, 14 }, - { 0x29c9, 14 }, { 0x63dd, 15 }, { 0x33b8, 14 }, { 0x33b9, 14 }, - { 0xc7b6, 16 }, { 0x63d8, 15 }, { 0x63df, 15 }, { 0xc7b3, 16 }, - { 0xc7b4, 16 }, { 0xc7b5, 16 }, { 0x63de, 15 }, { 0xc7b7, 16 }, - { 0xc7b8, 16 }, { 0xc7b9, 16 }, { 0x18f65, 17 }, { 0x31ec8, 18 }, - { 0xc7b248, 24 }, { 0xc7b249, 24 }, { 0xc7b24a, 24 }, { 0xc7b24b, 24 }, - { 0xc7b24c, 24 }, { 0xc7b24d, 24 }, { 0xc7b24e, 24 }, { 0xc7b24f, 24 }, - { 0xc7b250, 24 }, { 0xc7b251, 24 }, { 0xc7b252, 24 }, { 0xc7b253, 24 }, - { 0xc7b254, 24 }, { 0xc7b255, 24 }, { 0xc7b256, 24 }, { 0xc7b257, 24 }, - { 0xc7b258, 24 }, { 0xc7b259, 24 }, { 0xc7b25a, 24 }, { 0xc7b25b, 24 }, - { 0xc7b25c, 24 }, { 0xc7b25d, 24 }, { 0xc7b25e, 24 }, { 0xc7b25f, 24 }, - { 0xc7b260, 24 }, { 0xc7b261, 24 }, { 0xc7b262, 24 }, { 0xc7b263, 24 }, - { 0xc7b264, 24 }, { 0xc7b265, 24 }, { 0xc7b266, 24 }, { 0xc7b267, 24 }, - { 0xc7b268, 24 }, { 0xc7b269, 24 }, { 0xc7b26a, 24 }, { 0xc7b26b, 24 }, - { 0xc7b26c, 24 }, { 0xc7b26d, 24 }, { 0xc7b26e, 24 }, { 0xc7b26f, 24 }, - { 0xc7b270, 24 }, { 0xc7b271, 24 }, { 0xc7b272, 24 }, { 0xc7b273, 24 }, - { 0xc7b274, 24 }, { 0xc7b275, 24 }, { 0xc7b276, 24 }, { 0xc7b277, 24 }, - { 0xc7b278, 24 }, { 0xc7b279, 24 }, { 0xc7b27a, 24 }, { 0xc7b27b, 24 }, - { 0xc7b27c, 24 }, { 0xc7b27d, 24 }, { 0xc7b27e, 24 }, { 0xc7b27f, 24 }, - { 0x18f6480, 25 }, { 0x18f6481, 25 }, { 0x18f6482, 25 }, { 0x18f6483, 25 }, - { 0x18f6484, 25 }, { 0x18f6485, 25 }, { 0x18f6486, 25 }, { 0x18f6487, 25 }, - { 0x18f6488, 25 }, { 0x18f6489, 25 }, { 0x18f648a, 25 }, { 0x18f648b, 25 }, - { 0x18f648c, 25 }, { 0x18f648d, 25 }, { 0x18f648e, 25 }, { 0x18f648f, 25 }, -}; - /* vlc table 0, for intra luma */ static const uint16_t table0_vlc[133][2] = { @@ -1803,40 +1644,6 @@ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 }; -const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64] = { - { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11, - 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28, - 0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05, - 0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A, - 0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, - 0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34, - 0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35, - 0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F, }, - { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11, - 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28, - 0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D, - 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A, - 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D, - 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25, - 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35, - 0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F, }, - { 0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18, - 0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20, - 0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07, - 0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, - 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D, - 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E, - 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35, - 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, }, - { 0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09, - 0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29, - 0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13, - 0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C, - 0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24, - 0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E, - 0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35, - 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, } -}; const uint8_t ff_table_inter_intra[4][2] = { { 0, 1 } /* Luma-Left Chroma-Left */, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4data.h 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,8 @@ #include +#include "libavutil/attributes_internal.h" + #include "rl.h" #include "vlc.h" @@ -45,17 +47,7 @@ VLC vlc; /* decoding: vlc */ } MVTable; -extern VLC ff_msmp4_mb_i_vlc; -extern VLC ff_msmp4_dc_luma_vlc[2]; -extern VLC ff_msmp4_dc_chroma_vlc[2]; - -/* intra picture macroblock coded block pattern */ -extern const uint16_t ff_msmp4_mb_i_table[64][2]; - -#define WMV1_SCANTABLE_COUNT 4 - -extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]; - +FF_VISIBILITY_PUSH_HIDDEN #define NB_RL_TABLES 6 extern RLTable ff_rl_table[NB_RL_TABLES]; @@ -76,12 +68,8 @@ extern const uint32_t ff_table_mb_non_intra[128][2]; extern const uint8_t ff_table_inter_intra[4][2]; -extern const uint32_t ff_table0_dc_lum[120][2]; -extern const uint32_t ff_table1_dc_lum[120][2]; -extern const uint32_t ff_table0_dc_chroma[120][2]; -extern const uint32_t ff_table1_dc_chroma[120][2]; - #define WMV2_INTER_CBP_TABLE_COUNT 4 extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_MSMPEG4DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include "libavutil/thread.h" #include "avcodec.h" @@ -38,9 +36,8 @@ #include "h263dec.h" #include "mpeg4videodec.h" #include "msmpeg4data.h" -#include "wmv2dec.h" +#include "msmpeg4_vc1_data.h" -#define DC_VLC_BITS 9 #define V2_INTRA_CBPC_VLC_BITS 3 #define V2_MB_TYPE_VLC_BITS 7 #define MV_VLC_BITS 9 @@ -240,7 +237,7 @@ cbp = code & 0x3f; } else { s->mb_intra = 1; - code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); + code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MSMP4_MB_INTRA_VLC_BITS, 2); /* predict coded block pattern */ cbp = 0; for(i=0;i<6;i++) { @@ -320,23 +317,10 @@ mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 2694); - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], 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], 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], 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], DC_VLC_BITS, 120, - &ff_table1_dc_chroma[0][1], 8, 4, - &ff_table1_dc_chroma[0][0], 8, 4, 1216); - - INIT_VLC_STATIC(&v2_dc_lum_vlc, DC_VLC_BITS, 512, + INIT_VLC_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, DC_VLC_BITS, 512, + INIT_VLC_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); @@ -358,13 +342,10 @@ offset += ff_mb_non_intra_vlc[i].table_size; } - INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64, - &ff_msmp4_mb_i_table[0][1], 4, 2, - &ff_msmp4_mb_i_table[0][0], 4, 2, 536); - INIT_VLC_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(); } av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) @@ -391,10 +372,6 @@ s->decode_mb= msmpeg4v34_decode_mb; break; case 5: - if (CONFIG_WMV2_DECODER) - s->decode_mb= ff_wmv2_decode_mb; - case 6: - //FIXME + TODO VC1 decode mb break; } @@ -595,9 +572,9 @@ if(s->msmpeg4_version<=2){ if (n < 4) { - level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, DC_VLC_BITS, 3); + level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, MSMP4_DC_VLC_BITS, 3); } else { - level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3); + level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, MSMP4_DC_VLC_BITS, 3); } if (level < 0) { av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); @@ -607,9 +584,11 @@ level-=256; }else{ //FIXME optimize use unified tables & index if (n < 4) { - level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } else { - level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } if (level == DC_MAX) { @@ -687,9 +666,9 @@ } if (s->ac_pred) { if (dc_pred_dir == 0) - scan_table = s->intra_v_scantable.permutated; /* left */ + scan_table = s->permutated_intra_v_scantable; /* left */ else - scan_table = s->intra_h_scantable.permutated; /* top */ + scan_table = s->permutated_intra_h_scantable; /* top */ } else { scan_table = s->intra_scantable.permutated; } @@ -866,7 +845,7 @@ const FFCodec ff_msmpeg4v1_decoder = { .p.name = "msmpeg4v1", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"), + CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSMPEG4V1, .priv_data_size = sizeof(MpegEncContext), @@ -874,8 +853,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -885,7 +863,7 @@ const FFCodec ff_msmpeg4v2_decoder = { .p.name = "msmpeg4v2", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), + CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSMPEG4V2, .priv_data_size = sizeof(MpegEncContext), @@ -893,8 +871,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -904,7 +881,7 @@ const FFCodec ff_msmpeg4v3_decoder = { .p.name = "msmpeg4", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), + CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 3"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSMPEG4V3, .priv_data_size = sizeof(MpegEncContext), @@ -912,8 +889,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -923,7 +899,7 @@ const FFCodec ff_wmv1_decoder = { .p.name = "wmv1", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), + CODEC_LONG_NAME("Windows Media Video 7"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV1, .priv_data_size = sizeof(MpegEncContext), @@ -931,8 +907,7 @@ .close = ff_h263_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4dec.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,13 +22,11 @@ #ifndef AVCODEC_MSMPEG4DEC_H #define AVCODEC_MSMPEG4DEC_H -#include "config.h" #include "avcodec.h" #include "mpegvideo.h" #define INTER_INTRA_VLC_BITS 3 #define MB_NON_INTRA_VLC_BITS 9 -#define MB_INTRA_VLC_BITS 9 extern VLC ff_mb_non_intra_vlc[4]; extern VLC ff_inter_intra_vlc; @@ -40,11 +38,4 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, int n, int coded, const uint8_t *scan_table); -#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ - CONFIG_MSMPEG4V2_DECODER || \ - CONFIG_MSMPEG4V3_DECODER || \ - CONFIG_WMV1_DECODER || \ - CONFIG_WMV2_DECODER || \ - CONFIG_VC1_DECODER) - #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -41,6 +41,7 @@ #include "mpeg4video.h" #include "msmpeg4.h" #include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "msmpeg4enc.h" #include "put_bits.h" #include "rl.h" @@ -215,7 +216,7 @@ } /* write MSMPEG4 compatible frame header */ -void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) +void ff_msmpeg4_encode_picture_header(MpegEncContext * s) { MSMPEG4EncContext *const ms = (MSMPEG4EncContext*)s; @@ -279,15 +280,15 @@ void ff_msmpeg4_encode_ext_header(MpegEncContext * s) { - unsigned fps = s->avctx->time_base.den / s->avctx->time_base.num / FFMAX(s->avctx->ticks_per_frame, 1); - put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29 + unsigned fps = s->avctx->time_base.den / s->avctx->time_base.num / FFMAX(s->avctx->ticks_per_frame, 1); + put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29 - put_bits(&s->pb, 11, FFMIN(s->bit_rate/1024, 2047)); + put_bits(&s->pb, 11, FFMIN(s->bit_rate / 1024, 2047)); - if(s->msmpeg4_version>=3) - put_bits(&s->pb, 1, s->flipflop_rounding); - else - av_assert0(s->flipflop_rounding==0); + if (s->msmpeg4_version >= 3) + put_bits(&s->pb, 1, s->flipflop_rounding); + else + av_assert0(!s->flipflop_rounding); } void ff_msmpeg4_encode_motion(MpegEncContext * s, @@ -678,12 +679,13 @@ const FFCodec ff_msmpeg4v2_encoder = { .p.name = "msmpeg4v2", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), + CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSMPEG4V2, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &ff_mpv_enc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), @@ -692,12 +694,13 @@ const FFCodec ff_msmpeg4v3_encoder = { .p.name = "msmpeg4", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), + CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 3"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSMPEG4V3, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &ff_mpv_enc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), @@ -706,12 +709,13 @@ const FFCodec ff_wmv1_encoder = { .p.name = "wmv1", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), + CODEC_LONG_NAME("Windows Media Video 7"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV1, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &ff_mpv_enc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,6 @@ #ifndef AVCODEC_MSMPEG4ENC_H #define AVCODEC_MSMPEG4ENC_H -#include "config.h" #include "mpegvideo.h" #include "put_bits.h" #include "rl.h" @@ -35,7 +34,7 @@ } MSMPEG4EncContext; void ff_msmpeg4_encode_init(MpegEncContext *s); -void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_msmpeg4_encode_picture_header(MpegEncContext *s); void ff_msmpeg4_encode_ext_header(MpegEncContext *s); void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y); @@ -45,9 +44,4 @@ void ff_msmpeg4_code012(PutBitContext *pb, int n); -#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \ - CONFIG_MSMPEG4V3_ENCODER || \ - CONFIG_WMV1_ENCODER || \ - CONFIG_WMV2_ENCODER) - #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,254 @@ +/* + * Common MSMPEG-4 and VC-1 tables and VLC init code + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * msmpeg4v1 & v2 stuff by Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Common MSMPEG-4 and VC-1 tables and VLC init code + */ + +#include "msmpeg4_vc1_data.h" +#include "vlc.h" +#include "libavutil/attributes.h" +#include "libavutil/thread.h" + +VLC ff_msmp4_mb_i_vlc; +VLC ff_msmp4_dc_luma_vlc[2]; +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, + &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, + &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, + &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, + &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, + &ff_msmp4_mb_i_table[0][1], 4, 2, + &ff_msmp4_mb_i_table[0][0], 4, 2, 536); +} + +av_cold void ff_msmp4_vc1_vlcs_init_once(void) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + ff_thread_once(&init_static_once, msmp4_vc1_vlcs_init); +} + +/* intra picture macroblock coded block pattern */ +const uint16_t ff_msmp4_mb_i_table[64][2] = { + { 0x1, 1 }, { 0x17, 6 }, { 0x9, 5 }, { 0x5, 5 }, + { 0x6, 5 }, { 0x47, 9 }, { 0x20, 7 }, { 0x10, 7 }, + { 0x2, 5 }, { 0x7c, 9 }, { 0x3a, 7 }, { 0x1d, 7 }, + { 0x2, 6 }, { 0xec, 9 }, { 0x77, 8 }, { 0x0, 8 }, + { 0x3, 5 }, { 0xb7, 9 }, { 0x2c, 7 }, { 0x13, 7 }, + { 0x1, 6 }, { 0x168, 10 }, { 0x46, 8 }, { 0x3f, 8 }, + { 0x1e, 6 }, { 0x712, 13 }, { 0xb5, 9 }, { 0x42, 8 }, + { 0x22, 7 }, { 0x1c5, 11 }, { 0x11e, 10 }, { 0x87, 9 }, + { 0x6, 4 }, { 0x3, 9 }, { 0x1e, 7 }, { 0x1c, 6 }, + { 0x12, 7 }, { 0x388, 12 }, { 0x44, 9 }, { 0x70, 9 }, + { 0x1f, 6 }, { 0x23e, 11 }, { 0x39, 8 }, { 0x8e, 9 }, + { 0x1, 7 }, { 0x1c6, 11 }, { 0xb6, 9 }, { 0x45, 9 }, + { 0x14, 6 }, { 0x23f, 11 }, { 0x7d, 9 }, { 0x18, 9 }, + { 0x7, 7 }, { 0x1c7, 11 }, { 0x86, 9 }, { 0x19, 9 }, + { 0x15, 6 }, { 0x1db, 10 }, { 0x2, 9 }, { 0x46, 9 }, + { 0xd, 8 }, { 0x713, 13 }, { 0x1da, 10 }, { 0x169, 10 }, +}; + +/* dc table 0 */ + +const uint32_t ff_table0_dc_lum[120][2] = { + { 0x1, 1 }, { 0x1, 2 }, { 0x1, 4 }, { 0x1, 5 }, + { 0x5, 5 }, { 0x7, 5 }, { 0x8, 6 }, { 0xc, 6 }, + { 0x0, 7 }, { 0x2, 7 }, { 0x12, 7 }, { 0x1a, 7 }, + { 0x3, 8 }, { 0x7, 8 }, { 0x27, 8 }, { 0x37, 8 }, + { 0x5, 9 }, { 0x4c, 9 }, { 0x6c, 9 }, { 0x6d, 9 }, + { 0x8, 10 }, { 0x19, 10 }, { 0x9b, 10 }, { 0x1b, 10 }, + { 0x9a, 10 }, { 0x13, 11 }, { 0x34, 11 }, { 0x35, 11 }, + { 0x61, 12 }, { 0x48, 13 }, { 0xc4, 13 }, { 0x4a, 13 }, + { 0xc6, 13 }, { 0xc7, 13 }, { 0x92, 14 }, { 0x18b, 14 }, + { 0x93, 14 }, { 0x183, 14 }, { 0x182, 14 }, { 0x96, 14 }, + { 0x97, 14 }, { 0x180, 14 }, { 0x314, 15 }, { 0x315, 15 }, + { 0x605, 16 }, { 0x604, 16 }, { 0x606, 16 }, { 0xc0e, 17 }, + { 0x303cd, 23 }, { 0x303c9, 23 }, { 0x303c8, 23 }, { 0x303ca, 23 }, + { 0x303cb, 23 }, { 0x303cc, 23 }, { 0x303ce, 23 }, { 0x303cf, 23 }, + { 0x303d0, 23 }, { 0x303d1, 23 }, { 0x303d2, 23 }, { 0x303d3, 23 }, + { 0x303d4, 23 }, { 0x303d5, 23 }, { 0x303d6, 23 }, { 0x303d7, 23 }, + { 0x303d8, 23 }, { 0x303d9, 23 }, { 0x303da, 23 }, { 0x303db, 23 }, + { 0x303dc, 23 }, { 0x303dd, 23 }, { 0x303de, 23 }, { 0x303df, 23 }, + { 0x303e0, 23 }, { 0x303e1, 23 }, { 0x303e2, 23 }, { 0x303e3, 23 }, + { 0x303e4, 23 }, { 0x303e5, 23 }, { 0x303e6, 23 }, { 0x303e7, 23 }, + { 0x303e8, 23 }, { 0x303e9, 23 }, { 0x303ea, 23 }, { 0x303eb, 23 }, + { 0x303ec, 23 }, { 0x303ed, 23 }, { 0x303ee, 23 }, { 0x303ef, 23 }, + { 0x303f0, 23 }, { 0x303f1, 23 }, { 0x303f2, 23 }, { 0x303f3, 23 }, + { 0x303f4, 23 }, { 0x303f5, 23 }, { 0x303f6, 23 }, { 0x303f7, 23 }, + { 0x303f8, 23 }, { 0x303f9, 23 }, { 0x303fa, 23 }, { 0x303fb, 23 }, + { 0x303fc, 23 }, { 0x303fd, 23 }, { 0x303fe, 23 }, { 0x303ff, 23 }, + { 0x60780, 24 }, { 0x60781, 24 }, { 0x60782, 24 }, { 0x60783, 24 }, + { 0x60784, 24 }, { 0x60785, 24 }, { 0x60786, 24 }, { 0x60787, 24 }, + { 0x60788, 24 }, { 0x60789, 24 }, { 0x6078a, 24 }, { 0x6078b, 24 }, + { 0x6078c, 24 }, { 0x6078d, 24 }, { 0x6078e, 24 }, { 0x6078f, 24 }, +}; + +const uint32_t ff_table0_dc_chroma[120][2] = { + { 0x0, 2 }, { 0x1, 2 }, { 0x5, 3 }, { 0x9, 4 }, + { 0xd, 4 }, { 0x11, 5 }, { 0x1d, 5 }, { 0x1f, 5 }, + { 0x21, 6 }, { 0x31, 6 }, { 0x38, 6 }, { 0x33, 6 }, + { 0x39, 6 }, { 0x3d, 6 }, { 0x61, 7 }, { 0x79, 7 }, + { 0x80, 8 }, { 0xc8, 8 }, { 0xca, 8 }, { 0xf0, 8 }, + { 0x81, 8 }, { 0xc0, 8 }, { 0xc9, 8 }, { 0x107, 9 }, + { 0x106, 9 }, { 0x196, 9 }, { 0x183, 9 }, { 0x1e3, 9 }, + { 0x1e2, 9 }, { 0x20a, 10 }, { 0x20b, 10 }, { 0x609, 11 }, + { 0x412, 11 }, { 0x413, 11 }, { 0x60b, 11 }, { 0x411, 11 }, + { 0x60a, 11 }, { 0x65f, 11 }, { 0x410, 11 }, { 0x65d, 11 }, + { 0x65e, 11 }, { 0xcb8, 12 }, { 0xc10, 12 }, { 0xcb9, 12 }, + { 0x1823, 13 }, { 0x3045, 14 }, { 0x6089, 15 }, { 0xc110, 16 }, + { 0x304448, 22 }, { 0x304449, 22 }, { 0x30444a, 22 }, { 0x30444b, 22 }, + { 0x30444c, 22 }, { 0x30444d, 22 }, { 0x30444e, 22 }, { 0x30444f, 22 }, + { 0x304450, 22 }, { 0x304451, 22 }, { 0x304452, 22 }, { 0x304453, 22 }, + { 0x304454, 22 }, { 0x304455, 22 }, { 0x304456, 22 }, { 0x304457, 22 }, + { 0x304458, 22 }, { 0x304459, 22 }, { 0x30445a, 22 }, { 0x30445b, 22 }, + { 0x30445c, 22 }, { 0x30445d, 22 }, { 0x30445e, 22 }, { 0x30445f, 22 }, + { 0x304460, 22 }, { 0x304461, 22 }, { 0x304462, 22 }, { 0x304463, 22 }, + { 0x304464, 22 }, { 0x304465, 22 }, { 0x304466, 22 }, { 0x304467, 22 }, + { 0x304468, 22 }, { 0x304469, 22 }, { 0x30446a, 22 }, { 0x30446b, 22 }, + { 0x30446c, 22 }, { 0x30446d, 22 }, { 0x30446e, 22 }, { 0x30446f, 22 }, + { 0x304470, 22 }, { 0x304471, 22 }, { 0x304472, 22 }, { 0x304473, 22 }, + { 0x304474, 22 }, { 0x304475, 22 }, { 0x304476, 22 }, { 0x304477, 22 }, + { 0x304478, 22 }, { 0x304479, 22 }, { 0x30447a, 22 }, { 0x30447b, 22 }, + { 0x30447c, 22 }, { 0x30447d, 22 }, { 0x30447e, 22 }, { 0x30447f, 22 }, + { 0x608880, 23 }, { 0x608881, 23 }, { 0x608882, 23 }, { 0x608883, 23 }, + { 0x608884, 23 }, { 0x608885, 23 }, { 0x608886, 23 }, { 0x608887, 23 }, + { 0x608888, 23 }, { 0x608889, 23 }, { 0x60888a, 23 }, { 0x60888b, 23 }, + { 0x60888c, 23 }, { 0x60888d, 23 }, { 0x60888e, 23 }, { 0x60888f, 23 }, +}; + +/* dc table 1 */ + +const uint32_t ff_table1_dc_lum[120][2] = { + { 0x2, 2 }, { 0x3, 2 }, { 0x3, 3 }, { 0x2, 4 }, + { 0x5, 4 }, { 0x1, 5 }, { 0x3, 5 }, { 0x8, 5 }, + { 0x0, 6 }, { 0x5, 6 }, { 0xd, 6 }, { 0xf, 6 }, + { 0x13, 6 }, { 0x8, 7 }, { 0x18, 7 }, { 0x1c, 7 }, + { 0x24, 7 }, { 0x4, 8 }, { 0x6, 8 }, { 0x12, 8 }, + { 0x32, 8 }, { 0x3b, 8 }, { 0x4a, 8 }, { 0x4b, 8 }, + { 0xb, 9 }, { 0x26, 9 }, { 0x27, 9 }, { 0x66, 9 }, + { 0x74, 9 }, { 0x75, 9 }, { 0x14, 10 }, { 0x1c, 10 }, + { 0x1f, 10 }, { 0x1d, 10 }, { 0x2b, 11 }, { 0x3d, 11 }, + { 0x19d, 11 }, { 0x19f, 11 }, { 0x54, 12 }, { 0x339, 12 }, + { 0x338, 12 }, { 0x33d, 12 }, { 0xab, 13 }, { 0xf1, 13 }, + { 0x678, 13 }, { 0xf2, 13 }, { 0x1e0, 14 }, { 0x1e1, 14 }, + { 0x154, 14 }, { 0xcf2, 14 }, { 0x3cc, 15 }, { 0x2ab, 15 }, + { 0x19e7, 15 }, { 0x3ce, 15 }, { 0x19e6, 15 }, { 0x554, 16 }, + { 0x79f, 16 }, { 0x555, 16 }, { 0xf3d, 17 }, { 0xf37, 17 }, + { 0xf3c, 17 }, { 0xf35, 17 }, { 0x1e6d, 18 }, { 0x1e68, 18 }, + { 0x3cd8, 19 }, { 0x3cd3, 19 }, { 0x3cd9, 19 }, { 0x79a4, 20 }, + { 0xf34ba, 25 }, { 0xf34b4, 25 }, { 0xf34b5, 25 }, { 0xf34b6, 25 }, + { 0xf34b7, 25 }, { 0xf34b8, 25 }, { 0xf34b9, 25 }, { 0xf34bb, 25 }, + { 0xf34bc, 25 }, { 0xf34bd, 25 }, { 0xf34be, 25 }, { 0xf34bf, 25 }, + { 0x1e6940, 26 }, { 0x1e6941, 26 }, { 0x1e6942, 26 }, { 0x1e6943, 26 }, + { 0x1e6944, 26 }, { 0x1e6945, 26 }, { 0x1e6946, 26 }, { 0x1e6947, 26 }, + { 0x1e6948, 26 }, { 0x1e6949, 26 }, { 0x1e694a, 26 }, { 0x1e694b, 26 }, + { 0x1e694c, 26 }, { 0x1e694d, 26 }, { 0x1e694e, 26 }, { 0x1e694f, 26 }, + { 0x1e6950, 26 }, { 0x1e6951, 26 }, { 0x1e6952, 26 }, { 0x1e6953, 26 }, + { 0x1e6954, 26 }, { 0x1e6955, 26 }, { 0x1e6956, 26 }, { 0x1e6957, 26 }, + { 0x1e6958, 26 }, { 0x1e6959, 26 }, { 0x1e695a, 26 }, { 0x1e695b, 26 }, + { 0x1e695c, 26 }, { 0x1e695d, 26 }, { 0x1e695e, 26 }, { 0x1e695f, 26 }, + { 0x1e6960, 26 }, { 0x1e6961, 26 }, { 0x1e6962, 26 }, { 0x1e6963, 26 }, + { 0x1e6964, 26 }, { 0x1e6965, 26 }, { 0x1e6966, 26 }, { 0x1e6967, 26 }, +}; + +const uint32_t ff_table1_dc_chroma[120][2] = { + { 0x0, 2 }, { 0x1, 2 }, { 0x4, 3 }, { 0x7, 3 }, + { 0xb, 4 }, { 0xd, 4 }, { 0x15, 5 }, { 0x28, 6 }, + { 0x30, 6 }, { 0x32, 6 }, { 0x52, 7 }, { 0x62, 7 }, + { 0x66, 7 }, { 0xa6, 8 }, { 0xc6, 8 }, { 0xcf, 8 }, + { 0x14f, 9 }, { 0x18e, 9 }, { 0x19c, 9 }, { 0x29d, 10 }, + { 0x33a, 10 }, { 0x538, 11 }, { 0x63c, 11 }, { 0x63e, 11 }, + { 0x63f, 11 }, { 0x676, 11 }, { 0xa73, 12 }, { 0xc7a, 12 }, + { 0xcef, 12 }, { 0x14e5, 13 }, { 0x19dd, 13 }, { 0x29c8, 14 }, + { 0x29c9, 14 }, { 0x63dd, 15 }, { 0x33b8, 14 }, { 0x33b9, 14 }, + { 0xc7b6, 16 }, { 0x63d8, 15 }, { 0x63df, 15 }, { 0xc7b3, 16 }, + { 0xc7b4, 16 }, { 0xc7b5, 16 }, { 0x63de, 15 }, { 0xc7b7, 16 }, + { 0xc7b8, 16 }, { 0xc7b9, 16 }, { 0x18f65, 17 }, { 0x31ec8, 18 }, + { 0xc7b248, 24 }, { 0xc7b249, 24 }, { 0xc7b24a, 24 }, { 0xc7b24b, 24 }, + { 0xc7b24c, 24 }, { 0xc7b24d, 24 }, { 0xc7b24e, 24 }, { 0xc7b24f, 24 }, + { 0xc7b250, 24 }, { 0xc7b251, 24 }, { 0xc7b252, 24 }, { 0xc7b253, 24 }, + { 0xc7b254, 24 }, { 0xc7b255, 24 }, { 0xc7b256, 24 }, { 0xc7b257, 24 }, + { 0xc7b258, 24 }, { 0xc7b259, 24 }, { 0xc7b25a, 24 }, { 0xc7b25b, 24 }, + { 0xc7b25c, 24 }, { 0xc7b25d, 24 }, { 0xc7b25e, 24 }, { 0xc7b25f, 24 }, + { 0xc7b260, 24 }, { 0xc7b261, 24 }, { 0xc7b262, 24 }, { 0xc7b263, 24 }, + { 0xc7b264, 24 }, { 0xc7b265, 24 }, { 0xc7b266, 24 }, { 0xc7b267, 24 }, + { 0xc7b268, 24 }, { 0xc7b269, 24 }, { 0xc7b26a, 24 }, { 0xc7b26b, 24 }, + { 0xc7b26c, 24 }, { 0xc7b26d, 24 }, { 0xc7b26e, 24 }, { 0xc7b26f, 24 }, + { 0xc7b270, 24 }, { 0xc7b271, 24 }, { 0xc7b272, 24 }, { 0xc7b273, 24 }, + { 0xc7b274, 24 }, { 0xc7b275, 24 }, { 0xc7b276, 24 }, { 0xc7b277, 24 }, + { 0xc7b278, 24 }, { 0xc7b279, 24 }, { 0xc7b27a, 24 }, { 0xc7b27b, 24 }, + { 0xc7b27c, 24 }, { 0xc7b27d, 24 }, { 0xc7b27e, 24 }, { 0xc7b27f, 24 }, + { 0x18f6480, 25 }, { 0x18f6481, 25 }, { 0x18f6482, 25 }, { 0x18f6483, 25 }, + { 0x18f6484, 25 }, { 0x18f6485, 25 }, { 0x18f6486, 25 }, { 0x18f6487, 25 }, + { 0x18f6488, 25 }, { 0x18f6489, 25 }, { 0x18f648a, 25 }, { 0x18f648b, 25 }, + { 0x18f648c, 25 }, { 0x18f648d, 25 }, { 0x18f648e, 25 }, { 0x18f648f, 25 }, +}; + +const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64] = { + { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11, + 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28, + 0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05, + 0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A, + 0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, + 0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34, + 0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35, + 0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F, }, + { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11, + 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28, + 0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D, + 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A, + 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D, + 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25, + 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35, + 0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F, }, + { 0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18, + 0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20, + 0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07, + 0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, + 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D, + 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E, + 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35, + 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, }, + { 0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09, + 0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29, + 0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13, + 0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C, + 0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24, + 0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E, + 0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35, + 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, } +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msmpeg4_vc1_data.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Common MSMPEG-4 and VC-1 tables + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * msmpeg4v1 & v2 stuff by Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MSMPEG4_VC1_DATA_H +#define AVCODEC_MSMPEG4_VC1_DATA_H + +#include + +#include "vlc.h" +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +void ff_msmp4_vc1_vlcs_init_once(void); + +#define MSMP4_MB_INTRA_VLC_BITS 9 +extern VLC ff_msmp4_mb_i_vlc; +#define MSMP4_DC_VLC_BITS 9 +extern VLC ff_msmp4_dc_luma_vlc[2]; +extern VLC ff_msmp4_dc_chroma_vlc[2]; + +/* intra picture macroblock coded block pattern */ +extern const uint16_t ff_msmp4_mb_i_table[64][2]; + +#define WMV1_SCANTABLE_COUNT 4 + +extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]; + +extern const uint32_t ff_table0_dc_lum[120][2]; +extern const uint32_t ff_table1_dc_lum[120][2]; +extern const uint32_t ff_table0_dc_chroma[120][2]; +extern const uint32_t ff_table1_dc_chroma[120][2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MSMPEG4_VC1_DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msp2dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msp2dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msp2dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msp2dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static int msp2_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) @@ -94,7 +94,7 @@ const FFCodec ff_msp2_decoder = { .p.name = "msp2", - .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP) version 2"), + CODEC_LONG_NAME("Microsoft Paint (MSP) version 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSP2, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msrle.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msrle.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msrle.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msrle.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,14 +28,11 @@ * The MS RLE decoder outputs PAL8 colorspace data. */ -#include -#include #include #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #include "msrledec.h" #include "libavutil/imgutils.h" @@ -161,7 +158,7 @@ const FFCodec ff_msrle_decoder = { .p.name = "msrle", - .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft RLE"), + CODEC_LONG_NAME("Microsoft RLE"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSRLE, .priv_data_size = sizeof(MsrleContext), @@ -170,5 +167,4 @@ FF_CODEC_DECODE_CB(msrle_decode_frame), .flush = msrle_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss1.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mss12.h" typedef struct MSS1Context { @@ -221,7 +221,7 @@ const FFCodec ff_mss1_decoder = { .p.name = "mss1", - .p.long_name = NULL_IF_CONFIG_SMALL("MS Screen 1"), + CODEC_LONG_NAME("MS Screen 1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSS1, .priv_data_size = sizeof(MSS1Context), @@ -229,5 +229,4 @@ .close = mss1_decode_end, FF_CODEC_DECODE_CB(mss1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss2.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,11 +25,10 @@ #include "libavutil/avassert.h" #include "codec_internal.h" +#include "decode.h" #include "error_resilience.h" -#include "internal.h" #include "mpeg_er.h" #include "mpegvideodec.h" -#include "msmpeg4dec.h" #include "qpeldsp.h" #include "vc1.h" #include "wmv2data.h" @@ -468,6 +467,39 @@ int coded, x, y, w, h; }; +struct Rectangle2 { + int left, right, top, bottom; +}; + +static void calc_draw_region(struct Rectangle2 * draw, const struct Rectangle2 * rect) +{ +#define COMPARE(top, bottom, left, right) \ + if (rect->top <= draw->top && rect->bottom >= draw->bottom) { \ + if (rect->left <= draw->left && rect->right >= draw->left) \ + draw->left = FFMIN(rect->right, draw->right); \ + \ + if (rect->right >= draw->right) { \ + if (rect->left >= draw->left) { \ + if (rect->left < draw->right) \ + draw->right = rect->left; \ + } else { \ + draw->right = draw->left; \ + } \ + } \ + } + + COMPARE(top, bottom, left, right) + COMPARE(left, right, top, bottom) +} + +static int calc_split_position(int split_position, const struct Rectangle2 * rect, int height) +{ + if (rect->top || rect->bottom != height) + split_position = rect->top + split_position * (rect->bottom - rect->top) / height; + + return av_clip(split_position, rect->top + 1, rect->bottom - 1); +} + #define MAX_WMV9_RECTANGLES 20 #define ARITH2_PADDING 2 @@ -485,7 +517,8 @@ int keyframe, has_wmv9, has_mv, is_rle, is_555, ret; struct Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r; - int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask); + struct Rectangle2 draw; + int used_rects = 0, i, implicit_rect = 0, wmv9_mask = -1; if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) return ret; @@ -671,11 +704,32 @@ bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING); arith2_init(&acoder, &gB); c->keyframe = keyframe; - if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0, - avctx->width, - ctx->split_position)) + + draw.left = 0; + draw.top = 0; + draw.right = avctx->width; + draw.bottom = avctx->height; + if (wmv9_mask == -1) { + for (i = 0; i < used_rects; i++) { + struct Rectangle2 r; + r.left = wmv9rects[i].x; + r.top = wmv9rects[i].y; + r.right = r.left + wmv9rects[i].w; + r.bottom = r.top + wmv9rects[i].h; + calc_draw_region(&draw, &r); + } + } + + if (draw.left >= avctx->width || draw.right > avctx->width || + draw.top >= avctx->height || draw.bottom > avctx->height) return AVERROR_INVALIDDATA; + if (c->slice_split && draw.bottom - draw.top >= 10) { + ctx->split_position = calc_split_position(ctx->split_position, &draw, avctx->height); + if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, draw.top, + avctx->width, + ctx->split_position - draw.top)) + return AVERROR_INVALIDDATA; buf += arith2_get_consumed_bytes(&acoder); buf_size -= arith2_get_consumed_bytes(&acoder); if (c->slice_split) { @@ -686,7 +740,14 @@ if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0, ctx->split_position, avctx->width, - avctx->height - ctx->split_position)) + draw.bottom - ctx->split_position)) + return AVERROR_INVALIDDATA; + buf += arith2_get_consumed_bytes(&acoder); + buf_size -= arith2_get_consumed_bytes(&acoder); + } + } else { + if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, draw.left, draw.top, + draw.right - draw.left, draw.bottom - draw.top)) return AVERROR_INVALIDDATA; buf += arith2_get_consumed_bytes(&acoder); @@ -790,14 +851,10 @@ ff_vc1_init_transposed_scantables(v); - if ((ret = ff_msmpeg4_decode_init(avctx)) < 0 || - (ret = ff_vc1_decode_init_alloc_tables(v)) < 0) + ret = ff_vc1_decode_init(avctx); + if (ret < 0) return ret; - /* error concealment */ - v->s.me.qpel_put = v->s.qdsp.put_qpel_pixels_tab; - v->s.me.qpel_avg = v->s.qdsp.avg_qpel_pixels_tab; - return 0; } @@ -846,7 +903,7 @@ const FFCodec ff_mss2_decoder = { .p.name = "mss2", - .p.long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"), + CODEC_LONG_NAME("MS Windows Media Video V9 Screen"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSS2, .priv_data_size = sizeof(MSS2Context), @@ -854,5 +911,4 @@ .close = mss2_decode_end, FF_CODEC_DECODE_CB(mss2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss34dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss34dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss34dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss34dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,33 +22,12 @@ #include #include "libavutil/common.h" #include "mss34dsp.h" - -static const uint8_t luma_quant[64] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 -}; - -static const uint8_t chroma_quant[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; +#include "jpegquanttables.h" void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma) { int i; - const uint8_t *qsrc = luma ? luma_quant : chroma_quant; + const uint8_t *qsrc = luma ? ff_mjpeg_std_luminance_quant_tbl : ff_mjpeg_std_chrominance_quant_tbl; if (quality >= 50) { int scale = 200 - 2 * quality; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss3.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" #include "mss34dsp.h" @@ -862,7 +862,7 @@ const FFCodec ff_msa1_decoder = { .p.name = "msa1", - .p.long_name = NULL_IF_CONFIG_SMALL("MS ATC Screen"), + CODEC_LONG_NAME("MS ATC Screen"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSA1, .priv_data_size = sizeof(MSS3Context), @@ -870,5 +870,5 @@ .close = mss3_decode_end, FF_CODEC_DECODE_CB(mss3_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mss4.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,8 +31,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "jpegtables.h" #include "mss34dsp.h" #include "unary.h" @@ -611,7 +611,7 @@ const FFCodec ff_mts2_decoder = { .p.name = "mts2", - .p.long_name = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"), + CODEC_LONG_NAME("MS Expression Encoder Screen"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MTS2, .priv_data_size = sizeof(MSS4Context), @@ -619,5 +619,5 @@ .close = mss4_decode_end, FF_CODEC_DECODE_CB(mss4_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,6 @@ * http://www.pcisys.net/~melanson/codecs/ */ -#include -#include #include #include "libavutil/internal.h" @@ -35,7 +33,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #define PALETTE_COUNT 256 #define CHECK_STREAM_PTR(n) \ @@ -343,7 +340,7 @@ const FFCodec ff_msvideo1_decoder = { .p.name = "msvideo1", - .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video 1"), + CODEC_LONG_NAME("Microsoft Video 1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSVIDEO1, .priv_data_size = sizeof(Msvideo1Context), @@ -351,5 +348,4 @@ .close = msvideo1_decode_end, FF_CODEC_DECODE_CB(msvideo1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/msvideo1enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -69,7 +69,7 @@ { Msvideo1EncContext * const c = avctx->priv_data; const AVFrame *p = pict; - uint16_t *src; + const uint16_t *src; uint8_t *prevptr; uint8_t *dst, *buf; int keyframe = 0; @@ -85,7 +85,7 @@ if(!c->prev) c->prev = av_malloc(avctx->width * 3 * (avctx->height + 3)); prevptr = c->prev + avctx->width * 3 * (FFALIGN(avctx->height, 4) - 1); - src = (uint16_t*)(p->data[0] + p->linesize[0]*(FFALIGN(avctx->height, 4) - 1)); + src = (const uint16_t*)(p->data[0] + p->linesize[0]*(FFALIGN(avctx->height, 4) - 1)); if(c->keyint >= avctx->keyint_min) keyframe = 1; @@ -304,13 +304,13 @@ const FFCodec ff_msvideo1_encoder = { .p.name = "msvideo1", - .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"), + CODEC_LONG_NAME("Microsoft Video-1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSVIDEO1, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(Msvideo1EncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mv30.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mv30.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mv30.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mv30.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include +#include #include #include "libavutil/thread.h" @@ -30,10 +29,10 @@ #include "bytestream.h" #include "codec_internal.h" #include "copy_block.h" +#include "decode.h" #include "mathops.h" #include "blockdsp.h" #include "get_bits.h" -#include "internal.h" #include "aandcttab.h" #define CBP_VLC_BITS 9 @@ -671,7 +670,7 @@ avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->color_range = AVCOL_RANGE_JPEG; - ff_blockdsp_init(&s->bdsp, avctx); + ff_blockdsp_init(&s->bdsp); s->prev_frame = av_frame_alloc(); if (!s->prev_frame) @@ -704,7 +703,7 @@ const FFCodec ff_mv30_decoder = { .p.name = "mv30", - .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid 3.0"), + CODEC_LONG_NAME("MidiVid 3.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MV30, .priv_data_size = sizeof(MV30Context), @@ -713,6 +712,5 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvcdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct MvcContext { int vflip; @@ -257,27 +257,25 @@ #if CONFIG_MVC1_DECODER const FFCodec ff_mvc1_decoder = { .p.name = "mvc1", - .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 1"), + CODEC_LONG_NAME("Silicon Graphics Motion Video Compressor 1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MVC1, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, FF_CODEC_DECODE_CB(mvc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MVC2_DECODER const FFCodec ff_mvc2_decoder = { .p.name = "mvc2", - .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 2"), + CODEC_LONG_NAME("Silicon Graphics Motion Video Compressor 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MVC2, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, FF_CODEC_DECODE_CB(mvc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvha.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvha.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvha.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mvha.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,18 +20,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - #define CACHED_BITSTREAM_READER !ARCH_X86_32 #include "libavutil/intreadwrite.h" #include "avcodec.h" -#include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "lossless_videodsp.h" #include "zlib_wrapper.h" @@ -164,9 +159,6 @@ if (size < 1 || size >= avpkt->size) return AVERROR_INVALIDDATA; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) - return ret; - if (type == MKTAG('L','Z','Y','V')) { z_stream *const zstream = &s->zstream.zstream; ret = inflateReset(zstream); @@ -175,6 +167,9 @@ return AVERROR_EXTERNAL; } + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + zstream->next_in = avpkt->data + 8; zstream->avail_in = avpkt->size - 8; @@ -223,10 +218,16 @@ } } + if (get_bits_left(gb) < avctx->height * avctx->width) + return AVERROR_INVALIDDATA; + ret = build_vlc(avctx, &s->vlc); if (ret < 0) return ret; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + for (int p = 0; p < 3; p++) { int width = avctx->width >> (p > 0); ptrdiff_t stride = frame->linesize[p]; @@ -300,7 +301,7 @@ const FFCodec ff_mvha_decoder = { .p.name = "mvha", - .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid Archive Codec"), + CODEC_LONG_NAME("MidiVid Archive Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MVHA, .priv_data_size = sizeof(MVHAContext), @@ -308,6 +309,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mwsc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mwsc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mwsc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mwsc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,13 +21,11 @@ */ #include -#include -#include #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include @@ -170,7 +168,7 @@ const FFCodec ff_mwsc_decoder = { .p.name = "mwsc", - .p.long_name = NULL_IF_CONFIG_SMALL("MatchWare Screen Capture Codec"), + CODEC_LONG_NAME("MatchWare Screen Capture Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MWSC, .priv_data_size = sizeof(MWSCContext), @@ -178,6 +176,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mxpegdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mxpegdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mxpegdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/mxpegdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ */ #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mjpeg.h" #include "mjpegdec.h" @@ -344,7 +344,7 @@ const FFCodec ff_mxpeg_decoder = { .p.name = "mxpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("Mobotix MxPEG video"), + CODEC_LONG_NAME("Mobotix MxPEG video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MXPEG, .priv_data_size = sizeof(MXpegDecodeContext), @@ -353,5 +353,5 @@ FF_CODEC_DECODE_CB(mxpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,14 +35,13 @@ #include "libavutil/float_dsp.h" #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" -#include "libavutil/random_seed.h" +#include "libavutil/tx.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" -#include "fft.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "nellymoser.h" #include "sinewin.h" @@ -53,7 +52,8 @@ GetBitContext gb; float scale_bias; AVFloatDSPContext *fdsp; - FFTContext imdct_ctx; + AVTXContext *imdct_ctx; + av_tx_fn imdct_fn; DECLARE_ALIGNED(32, float, imdct_buf)[2][NELLY_BUF_LEN]; float *imdct_out; float *imdct_prev; @@ -106,7 +106,7 @@ memset(&aptr[NELLY_FILL_LEN], 0, (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float)); - s->imdct_ctx.imdct_half(&s->imdct_ctx, s->imdct_out, aptr); + s->imdct_fn(s->imdct_ctx, s->imdct_out, aptr, sizeof(float)); s->fdsp->vector_fmul_window(aptr, s->imdct_prev + NELLY_BUF_LEN / 2, s->imdct_out, ff_sine_128, NELLY_BUF_LEN / 2); @@ -114,14 +114,19 @@ } } -static av_cold int decode_init(AVCodecContext * avctx) { +static av_cold int decode_init(AVCodecContext * avctx) +{ + int ret; + float scale = 1.0f; NellyMoserDecodeContext *s = avctx->priv_data; s->avctx = avctx; s->imdct_out = s->imdct_buf[0]; s->imdct_prev = s->imdct_buf[1]; av_lfg_init(&s->random_state, 0); - ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0); + if ((ret = av_tx_init(&s->imdct_ctx, &s->imdct_fn, AV_TX_FLOAT_MDCT, + 1, 128, &scale, 0)) < 0) + return ret; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!s->fdsp) @@ -180,7 +185,7 @@ static av_cold int decode_end(AVCodecContext * avctx) { NellyMoserDecodeContext *s = avctx->priv_data; - ff_mdct_end(&s->imdct_ctx); + av_tx_uninit(&s->imdct_ctx); av_freep(&s->fdsp); return 0; @@ -188,7 +193,7 @@ const FFCodec ff_nellymoser_decoder = { .p.name = "nellymoser", - .p.long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + CODEC_LONG_NAME("Nellymoser Asao"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_NELLYMOSER, .priv_data_size = sizeof(NellyMoserDecodeContext), @@ -198,5 +203,4 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nellymoserenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,12 +39,12 @@ #include "libavutil/float_dsp.h" #include "libavutil/mathematics.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "audio_frame_queue.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "fft.h" #include "nellymoser.h" #include "sinewin.h" @@ -59,7 +59,8 @@ AVCodecContext *avctx; int last_frame; AVFloatDSPContext *fdsp; - FFTContext mdct_ctx; + AVTXContext *mdct_ctx; + av_tx_fn mdct_fn; AudioFrameQueue afq; DECLARE_ALIGNED(32, float, mdct_out)[NELLY_SAMPLES]; DECLARE_ALIGNED(32, float, in_buff)[NELLY_SAMPLES]; @@ -126,18 +127,18 @@ s->fdsp->vector_fmul (s->in_buff, in0, ff_sine_128, NELLY_BUF_LEN); s->fdsp->vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, in1, ff_sine_128, NELLY_BUF_LEN); - s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out, s->in_buff); + s->mdct_fn(s->mdct_ctx, s->mdct_out, s->in_buff, sizeof(float)); s->fdsp->vector_fmul (s->in_buff, in1, ff_sine_128, NELLY_BUF_LEN); s->fdsp->vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, in2, ff_sine_128, NELLY_BUF_LEN); - s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->in_buff); + s->mdct_fn(s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->in_buff, sizeof(float)); } static av_cold int encode_end(AVCodecContext *avctx) { NellyMoserEncodeContext *s = avctx->priv_data; - ff_mdct_end(&s->mdct_ctx); + av_tx_uninit(&s->mdct_ctx); av_freep(&s->opt); av_freep(&s->path); @@ -169,6 +170,7 @@ { static AVOnce init_static_once = AV_ONCE_INIT; NellyMoserEncodeContext *s = avctx->priv_data; + float scale = 32768.0; int ret; if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 && @@ -183,7 +185,7 @@ avctx->initial_padding = NELLY_BUF_LEN; ff_af_queue_init(avctx, &s->afq); s->avctx = avctx; - if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0) + if ((ret = av_tx_init(&s->mdct_ctx, &s->mdct_fn, AV_TX_FLOAT_MDCT, 0, 128, &scale, 0)) < 0) return ret; s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!s->fdsp) @@ -415,7 +417,7 @@ const FFCodec ff_nellymoser_encoder = { .p.name = "nellymoser", - .p.long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + CODEC_LONG_NAME("Nellymoser Asao"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_NELLYMOSER, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -427,5 +429,5 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/notchlc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/notchlc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/notchlc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/notchlc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,16 +20,14 @@ */ #include -#include #include #define BITSTREAM_READER_LE -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "lzf.h" #include "thread.h" @@ -537,7 +535,7 @@ const FFCodec ff_notchlc_decoder = { .p.name = "notchlc", - .p.long_name = NULL_IF_CONFIG_SMALL("NotchLC"), + CODEC_LONG_NAME("NotchLC"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_NOTCHLC, .priv_data_size = sizeof(NotchLCContext), @@ -545,5 +543,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/null.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/null.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/null.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/null.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,97 @@ +/* + * Null codecs + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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_components.h" + +#include "codec_internal.h" +#include "decode.h" +#include "encode.h" + +#if CONFIG_VNULL_DECODER || CONFIG_ANULL_DECODER +static int null_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) +{ + *got_frame = 0; + return avpkt->size; +} + +#if CONFIG_VNULL_DECODER +const FFCodec ff_vnull_decoder = { + .p.name = "vnull", + CODEC_LONG_NAME("null video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VNULL, + .p.capabilities = AV_CODEC_CAP_DR1, + FF_CODEC_DECODE_CB(null_decode), +}; +#endif + +#if CONFIG_ANULL_DECODER +const FFCodec ff_anull_decoder = { + .p.name = "anull", + CODEC_LONG_NAME("null audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ANULL, + .p.capabilities = AV_CODEC_CAP_DR1, + FF_CODEC_DECODE_CB(null_decode), +}; +#endif + +#endif + +#if CONFIG_VNULL_ENCODER || CONFIG_ANULL_ENCODER +static int null_encode(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet) +{ + *got_packet = 0; + return 0; +} + +#if CONFIG_VNULL_ENCODER +const FFCodec ff_vnull_encoder = { + .p.name = "vnull", + CODEC_LONG_NAME("null video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VNULL, + FF_CODEC_ENCODE_CB(null_encode), +}; +#endif + +#if CONFIG_ANULL_ENCODER +const FFCodec ff_anull_encoder = { + .p.name = "anull", + CODEC_LONG_NAME("null audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ANULL, + .p.capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE, + .p.sample_fmts = (const enum AVSampleFormat[]){ + AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, + AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P, + AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, + AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, + AV_SAMPLE_FMT_NONE, + }, + FF_CODEC_ENCODE_CB(null_encode), +}; +#endif + +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nuv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nuv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nuv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nuv.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,19 +19,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include +#include #include -#include "libavutil/bswap.h" #include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "libavutil/lzo.h" #include "libavutil/imgutils.h" #include "avcodec.h" #include "codec_internal.h" -#include "idctdsp.h" -#include "internal.h" +#include "decode.h" +#include "jpegquanttables.h" #include "rtjpeg.h" typedef struct NuvContext { @@ -45,28 +43,6 @@ RTJpegContext rtj; } NuvContext; -static const uint8_t fallback_lquant[] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 -}; - -static const uint8_t fallback_cquant[] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; - /** * @brief copy frame data from buffer to AVFrame, handling stride. * @param f destination AVFrame @@ -110,8 +86,8 @@ int i; quality = FFMAX(quality, 1); for (i = 0; i < 64; i++) { - c->lq[i] = (fallback_lquant[i] << 7) / quality; - c->cq[i] = (fallback_cquant[i] << 7) / quality; + c->lq[i] = (ff_mjpeg_std_luminance_quant_tbl[i] << 7) / quality; + c->cq[i] = (ff_mjpeg_std_chrominance_quant_tbl[i] << 7) / quality; } } @@ -163,7 +139,7 @@ int size_change = 0; int minsize = 0; int flags = 0; - int result, init_frame = !avctx->frame_number; + int result, init_frame = !avctx->frame_num; enum { NUV_UNCOMPRESSED = '0', NUV_RTJPEG = '1', @@ -364,7 +340,7 @@ const FFCodec ff_nuv_decoder = { .p.name = "nuv", - .p.long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"), + CODEC_LONG_NAME("NuppelVideo/RTJPEG"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_NUV, .priv_data_size = sizeof(NuvContext), @@ -372,5 +348,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -51,6 +51,8 @@ CudaFunctions *cudl; CuvidFunctions *cvdl; + + int unsafe_output; } NVDECDecoder; typedef struct NVDECFramePool { @@ -344,6 +346,8 @@ int cuvid_codec_type, cuvid_chroma_format, chroma_444; int ret = 0; + int unsafe_output = !!(avctx->hwaccel_flags & AV_HWACCEL_FLAG_UNSAFE_OUTPUT); + sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); if (!sw_desc) return AVERROR_BUG; @@ -402,7 +406,7 @@ params.CodecType = cuvid_codec_type; params.ChromaFormat = cuvid_chroma_format; params.ulNumDecodeSurfaces = frames_ctx->initial_pool_size; - params.ulNumOutputSurfaces = frames_ctx->initial_pool_size; + params.ulNumOutputSurfaces = unsafe_output ? frames_ctx->initial_pool_size : 1; ret = nvdec_decoder_create(&ctx->decoder_ref, frames_ctx->device_ref, ¶ms, avctx); if (ret < 0) { @@ -417,6 +421,7 @@ } decoder = (NVDECDecoder*)ctx->decoder_ref->data; + decoder->unsafe_output = unsafe_output; decoder->real_hw_frames_ref = real_hw_frames_ref; real_hw_frames_ref = NULL; @@ -524,16 +529,16 @@ goto copy_fail; } - av_buffer_unref(&frame->hw_frames_ctx); - frame->hw_frames_ctx = av_buffer_ref(decoder->real_hw_frames_ref); - if (!frame->hw_frames_ctx) { - ret = AVERROR(ENOMEM); + ret = av_buffer_replace(&frame->hw_frames_ctx, decoder->real_hw_frames_ref); + if (ret < 0) goto copy_fail; - } unmap_data->idx = cf->idx; - unmap_data->idx_ref = av_buffer_ref(cf->idx_ref); - unmap_data->decoder_ref = av_buffer_ref(cf->decoder_ref); + if (!(unmap_data->idx_ref = av_buffer_ref(cf->idx_ref)) || + !(unmap_data->decoder_ref = av_buffer_ref(cf->decoder_ref))) { + ret = AVERROR(ENOMEM); + goto copy_fail; + } av_pix_fmt_get_chroma_sub_sample(hwctx->sw_format, &shift_h, &shift_v); for (i = 0; frame->linesize[i]; i++) { @@ -554,7 +559,11 @@ finish: CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy)); - return ret; + + if (ret < 0 || decoder->unsafe_output) + return ret; + + return av_frame_make_writable(frame); } int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -204,8 +204,8 @@ ppc->row_height_minus1[i] = pps->row_height[i] - 1; #if NVDECAPI_CHECK_VERSION(9, 0) - if (pps->chroma_qp_offset_list_len_minus1 > FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) || - pps->chroma_qp_offset_list_len_minus1 > FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) { + if (pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) || + pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) { av_log(avctx, AV_LOG_ERROR, "Too many chroma_qp_offsets\n"); return AVERROR(ENOSYS); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mjpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mjpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mjpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mjpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include "avcodec.h" #include "internal.h" #include "mjpegdec.h" @@ -71,7 +69,6 @@ return ff_nvdec_frame_params(avctx, hw_frames_ctx, 1, 0); } -#if CONFIG_MJPEG_NVDEC_HWACCEL AVHWAccel ff_mjpeg_nvdec_hwaccel = { .name = "mjpeg_nvdec", .type = AVMEDIA_TYPE_VIDEO, @@ -85,4 +82,3 @@ .uninit = ff_nvdec_decode_uninit, .priv_data_size = sizeof(NVDECContext), }; -#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mpeg4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mpeg4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mpeg4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_mpeg4.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,8 @@ #include "avcodec.h" #include "internal.h" -#include "mpeg4video.h" #include "mpeg4videodec.h" +#include "mpeg4videodefs.h" #include "nvdec.h" #include "decode.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_vp8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_vp8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_vp8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvdec_vp8.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,7 +39,7 @@ CUVIDPICPARAMS *pp = &ctx->pic_params; FrameDecodeData *fdd; NVDECFrame *cf; - AVFrame *cur_frame = h->framep[VP56_FRAME_CURRENT]->tf.f; + AVFrame *cur_frame = h->framep[VP8_FRAME_CURRENT]->tf.f; int ret; @@ -61,9 +61,9 @@ .first_partition_size = h->header_partition_size, - .LastRefIdx = safe_get_ref_idx(h->framep[VP56_FRAME_PREVIOUS]), - .GoldenRefIdx = safe_get_ref_idx(h->framep[VP56_FRAME_GOLDEN]), - .AltRefIdx = safe_get_ref_idx(h->framep[VP56_FRAME_GOLDEN2]), + .LastRefIdx = safe_get_ref_idx(h->framep[VP8_FRAME_PREVIOUS]), + .GoldenRefIdx = safe_get_ref_idx(h->framep[VP8_FRAME_GOLDEN]), + .AltRefIdx = safe_get_ref_idx(h->framep[VP8_FRAME_ALTREF]), /* * Explicit braces for anonymous inners and unnamed fields * to work around limitations in ancient versions of gcc. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_av1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_av1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_av1.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_av1.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,190 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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 "avcodec.h" +#include "codec_internal.h" + +#include "nvenc.h" + +#define OFFSET(x) offsetof(NvencContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "preset", "Set the encoding preset", OFFSET(preset), AV_OPT_TYPE_INT, { .i64 = PRESET_P4 }, PRESET_DEFAULT, PRESET_P7, VE, "preset" }, + { "default", "", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_DEFAULT }, 0, 0, VE, "preset" }, + { "slow", "hq 2 passes", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_SLOW }, 0, 0, VE, "preset" }, + { "medium", "hq 1 pass", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_MEDIUM }, 0, 0, VE, "preset" }, + { "fast", "hp 1 pass", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_FAST }, 0, 0, VE, "preset" }, + { "p1", "fastest (lowest quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P1 }, 0, 0, VE, "preset" }, + { "p2", "faster (lower quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P2 }, 0, 0, VE, "preset" }, + { "p3", "fast (low quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P3 }, 0, 0, VE, "preset" }, + { "p4", "medium (default)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P4 }, 0, 0, VE, "preset" }, + { "p5", "slow (good quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P5 }, 0, 0, VE, "preset" }, + { "p6", "slower (better quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P6 }, 0, 0, VE, "preset" }, + { "p7", "slowest (best quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P7 }, 0, 0, VE, "preset" }, + { "tune", "Set the encoding tuning info", OFFSET(tuning_info), AV_OPT_TYPE_INT, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, NV_ENC_TUNING_INFO_HIGH_QUALITY, NV_ENC_TUNING_INFO_LOSSLESS, VE, "tune" }, + { "hq", "High quality", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, 0, 0, VE, "tune" }, + { "ll", "Low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOW_LATENCY }, 0, 0, VE, "tune" }, + { "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" }, + { "level", "Set the encoding level restriction", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = NV_ENC_LEVEL_AV1_AUTOSELECT }, NV_ENC_LEVEL_AV1_2, NV_ENC_LEVEL_AV1_AUTOSELECT, VE, "level" }, + { "auto", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_AUTOSELECT }, 0, 0, VE, "level" }, + { "2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_2 }, 0, 0, VE, "level" }, + { "2.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_2 }, 0, 0, VE, "level" }, + { "2.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_21 }, 0, 0, VE, "level" }, + { "2.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_22 }, 0, 0, VE, "level" }, + { "2.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_23 }, 0, 0, VE, "level" }, + { "3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_3 }, 0, 0, VE, "level" }, + { "3.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_3 }, 0, 0, VE, "level" }, + { "3.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_31 }, 0, 0, VE, "level" }, + { "3.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_32 }, 0, 0, VE, "level" }, + { "3.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_33 }, 0, 0, VE, "level" }, + { "4", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_4 }, 0, 0, VE, "level" }, + { "4.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_4 }, 0, 0, VE, "level" }, + { "4.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_41 }, 0, 0, VE, "level" }, + { "4.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_42 }, 0, 0, VE, "level" }, + { "4.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_43 }, 0, 0, VE, "level" }, + { "5", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_5 }, 0, 0, VE, "level" }, + { "5.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_5 }, 0, 0, VE, "level" }, + { "5.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_51 }, 0, 0, VE, "level" }, + { "5.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_52 }, 0, 0, VE, "level" }, + { "5.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_53 }, 0, 0, VE, "level" }, + { "6", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_6 }, 0, 0, VE, "level" }, + { "6.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_6 }, 0, 0, VE, "level" }, + { "6.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_61 }, 0, 0, VE, "level" }, + { "6.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_62 }, 0, 0, VE, "level" }, + { "6.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_63 }, 0, 0, VE, "level" }, + { "7", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_7 }, 0, 0, VE, "level" }, + { "7.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_7 }, 0, 0, VE, "level" }, + { "7.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_71 }, 0, 0, VE, "level" }, + { "7.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_72 }, 0, 0, VE, "level" }, + { "7.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_73 }, 0, 0, VE, "level" }, + { "tier", "Set the encoding tier", OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = NV_ENC_TIER_AV1_0 }, NV_ENC_TIER_AV1_0, NV_ENC_TIER_AV1_1, VE, "tier"}, + { "0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TIER_AV1_0 }, 0, 0, VE, "tier" }, + { "1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TIER_AV1_1 }, 0, 0, VE, "tier" }, + { "rc", "Override the preset rate-control", OFFSET(rc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "rc" }, + { "constqp", "Constant QP mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CONSTQP }, 0, 0, VE, "rc" }, + { "vbr", "Variable bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR }, 0, 0, VE, "rc" }, + { "cbr", "Constant bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR }, 0, 0, VE, "rc" }, + { "multipass", "Set the multipass encoding", OFFSET(multipass), AV_OPT_TYPE_INT, { .i64 = NV_ENC_MULTI_PASS_DISABLED }, NV_ENC_MULTI_PASS_DISABLED, NV_ENC_TWO_PASS_FULL_RESOLUTION, VE, "multipass" }, + { "disabled", "Single Pass", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_MULTI_PASS_DISABLED }, 0, 0, VE, "multipass" }, + { "qres", "Two Pass encoding is enabled where first Pass is quarter resolution", + 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TWO_PASS_QUARTER_RESOLUTION }, 0, 0, VE, "multipass" }, + { "fullres", "Two Pass encoding is enabled where first Pass is full resolution", + 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TWO_PASS_FULL_RESOLUTION }, 0, 0, VE, "multipass" }, + { "highbitdepth", "Enable 10 bit encode for 8 bit input",OFFSET(highbitdepth),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "tile-rows", "Number of tile rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_MAX_TILE_ROWS_AV1, VE }, + { "tile-columns", "Number of tile columns to encode with", OFFSET(tile_cols), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_MAX_TILE_COLS_AV1, VE }, + { "surfaces", "Number of concurrent surfaces", OFFSET(nb_surfaces), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_REGISTERED_FRAMES, VE }, + { "gpu", "Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.", + OFFSET(device), AV_OPT_TYPE_INT, { .i64 = ANY_DEVICE }, -2, INT_MAX, VE, "gpu" }, + { "any", "Pick the first device available", 0, AV_OPT_TYPE_CONST, { .i64 = ANY_DEVICE }, 0, 0, VE, "gpu" }, + { "list", "List the available devices", 0, AV_OPT_TYPE_CONST, { .i64 = LIST_DEVICES }, 0, 0, VE, "gpu" }, + { "delay", "Delay frame output by the given amount of frames", + OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 0, INT_MAX, VE }, + { "rc-lookahead", "Number of frames to look ahead for rate-control", + OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, + { "cq", "Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control", + OFFSET(quality), AV_OPT_TYPE_FLOAT, { .dbl = 0.}, 0., 51., VE }, + { "init_qpP", "Initial QP value for P frame", OFFSET(init_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, + { "init_qpB", "Initial QP value for B frame", OFFSET(init_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, + { "init_qpI", "Initial QP value for I frame", OFFSET(init_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, + { "qp", "Constant quantization parameter rate control method", + OFFSET(cqp), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, + { "qp_cb_offset", "Quantization parameter offset for cb channel", + OFFSET(qp_cb_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, -12, 12, VE }, + { "qp_cr_offset", "Quantization parameter offset for cr channel", + OFFSET(qp_cr_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, -12, 12, VE }, + { "no-scenecut", "When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts", + OFFSET(no_scenecut), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "forced-idr", "If forcing keyframes, force them as IDR frames.", + OFFSET(forced_idr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE }, + { "b_adapt", "When lookahead is enabled, set this to 0 to disable adaptive B-frame decision", + OFFSET(b_adapt), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, + { "spatial-aq", "set to 1 to enable Spatial AQ", OFFSET(aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "temporal-aq", "set to 1 to enable Temporal AQ", OFFSET(temporal_aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "zerolatency", "Set 1 to indicate zero latency operation (no reordering delay)", + OFFSET(zerolatency), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "nonref_p", "Set this to 1 to enable automatic insertion of non-reference P-frames", + OFFSET(nonref_p), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "strict_gop", "Set 1 to minimize GOP-to-GOP rate fluctuations", + OFFSET(strict_gop), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "aq-strength", "When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)", + OFFSET(aq_strength), AV_OPT_TYPE_INT, { .i64 = 8 }, 1, 15, VE }, + { "weighted_pred","Enable weighted prediction", OFFSET(weighted_pred),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" }, + { "disabled", "B frames will not be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, 0, 0, VE, "b_ref_mode" }, + { "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" }, + { "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" }, + { "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)", + OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, + { "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR", + OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE }, + { "intra-refresh","Use Periodic Intra Refresh instead of IDR frames", + OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "timing-info", "Include timing info in sequence/frame headers", + OFFSET(timing_info), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "extra_sei", "Pass on extra SEI data (e.g. a53 cc) to be included in the bitstream", + OFFSET(extra_sei), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, + { "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, + { "s12m_tc", "Use timecode (if available)", OFFSET(s12m_tc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE }, + { NULL } +}; + +static const FFCodecDefault defaults[] = { + { "b", "2M" }, + { "qmin", "-1" }, + { "qmax", "-1" }, + { "qdiff", "-1" }, + { "qblur", "-1" }, + { "qcomp", "-1" }, + { "g", "250" }, + { "bf", "-1" }, + { "refs", "0" }, + { NULL }, +}; + +static const AVClass av1_nvenc_class = { + .class_name = "av1_nvenc", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFCodec ff_av1_nvenc_encoder = { + .p.name = "av1_nvenc", + CODEC_LONG_NAME("NVIDIA NVENC av1 encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .init = ff_nvenc_encode_init, + FF_CODEC_RECEIVE_PACKET_CB(ff_nvenc_receive_packet), + .close = ff_nvenc_encode_close, + .flush = ff_nvenc_encode_flush, + .priv_data_size = sizeof(NvencContext), + .p.priv_class = &av1_nvenc_class, + .defaults = defaults, + .p.pix_fmts = ff_nvenc_pix_fmts, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, + .p.wrapper_name = "nvenc", + .hw_configs = ff_nvenc_hw_configs, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * H.264/HEVC hardware encoding using nvidia nvenc + * H.264/HEVC/AV1 hardware encoding using nvidia nvenc * Copyright (c) 2016 Timo Rothenpieler * * This file is part of FFmpeg. @@ -24,13 +24,18 @@ #include "nvenc.h" #include "hevc_sei.h" +#if CONFIG_AV1_NVENC_ENCODER +#include "av1.h" +#endif +#include "libavutil/buffer.h" #include "libavutil/hwcontext_cuda.h" #include "libavutil/hwcontext.h" #include "libavutil/cuda_check.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" #include "libavutil/pixdesc.h" +#include "libavutil/mathematics.h" #include "atsc_a53.h" #include "encode.h" #include "internal.h" @@ -78,6 +83,8 @@ #define IS_10BIT(pix_fmt) (pix_fmt == AV_PIX_FMT_P010 || \ pix_fmt == AV_PIX_FMT_P016 || \ pix_fmt == AV_PIX_FMT_YUV444P16 || \ + pix_fmt == AV_PIX_FMT_X2RGB10 || \ + pix_fmt == AV_PIX_FMT_X2BGR10 || \ pix_fmt == AV_PIX_FMT_GBRP16) #define IS_YUV444(pix_fmt) (pix_fmt == AV_PIX_FMT_YUV444P || \ @@ -156,6 +163,27 @@ return ret; } +typedef struct FrameData { + int64_t pts; + int64_t duration; +#if FF_API_REORDERED_OPAQUE + int64_t reordered_opaque; +#endif + + void *frame_opaque; + AVBufferRef *frame_opaque_ref; +} FrameData; + +static void reorder_queue_flush(AVFifo *queue) +{ + FrameData fd; + + av_assert0(queue); + + while (av_fifo_read(queue, &fd, 1) >= 0) + av_buffer_unref(&fd.frame_opaque_ref); +} + typedef struct GUIDTuple { const GUID guid; int flags; @@ -222,8 +250,14 @@ static void nvenc_print_driver_requirement(AVCodecContext *avctx, int level) { -#if NVENCAPI_CHECK_VERSION(11, 2) +#if NVENCAPI_CHECK_VERSION(12, 1) const char *minver = "(unknown)"; +#elif NVENCAPI_CHECK_VERSION(12, 0) +# if defined(_WIN32) || defined(__CYGWIN__) + const char *minver = "522.25"; +# else + const char *minver = "520.56.06"; +# endif #elif NVENCAPI_CHECK_VERSION(11, 1) # if defined(_WIN32) || defined(__CYGWIN__) const char *minver = "471.41"; @@ -658,6 +692,11 @@ case AV_CODEC_ID_HEVC: ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_HEVC_GUID; break; +#if CONFIG_AV1_NVENC_ENCODER + case AV_CODEC_ID_AV1: + ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_AV1_GUID; + break; +#endif default: return AVERROR_BUG; } @@ -761,6 +800,11 @@ { NvencContext *ctx = avctx->priv_data; NV_ENC_RC_PARAMS *rc = &ctx->encode_config.rcParams; +#if CONFIG_AV1_NVENC_ENCODER + int qmax = avctx->codec->id == AV_CODEC_ID_AV1 ? 255 : 51; +#else + int qmax = 51; +#endif rc->rateControlMode = NV_ENC_PARAMS_RC_CONSTQP; @@ -771,9 +815,9 @@ rc->constQP.qpInterB = ctx->init_qp_b; } else if (avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) { rc->constQP.qpIntra = av_clip( - rc->constQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51); + rc->constQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, qmax); rc->constQP.qpInterB = av_clip( - rc->constQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51); + rc->constQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, qmax); } else { rc->constQP.qpIntra = rc->constQP.qpInterP; rc->constQP.qpInterB = rc->constQP.qpInterP; @@ -781,9 +825,9 @@ } else if (ctx->cqp >= 0) { rc->constQP.qpInterP = rc->constQP.qpInterB = rc->constQP.qpIntra = ctx->cqp; if (avctx->b_quant_factor != 0.0) - rc->constQP.qpInterB = av_clip(ctx->cqp * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51); + rc->constQP.qpInterB = av_clip(ctx->cqp * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, qmax); if (avctx->i_quant_factor != 0.0) - rc->constQP.qpIntra = av_clip(ctx->cqp * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51); + rc->constQP.qpIntra = av_clip(ctx->cqp * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, qmax); } avctx->qmin = -1; @@ -795,6 +839,11 @@ NvencContext *ctx = avctx->priv_data; NV_ENC_RC_PARAMS *rc = &ctx->encode_config.rcParams; int qp_inter_p; +#if CONFIG_AV1_NVENC_ENCODER + int qmax = avctx->codec->id == AV_CODEC_ID_AV1 ? 255 : 51; +#else + int qmax = 51; +#endif if (avctx->qmin >= 0 && avctx->qmax >= 0) { rc->enableMinQP = 1; @@ -832,7 +881,7 @@ if (ctx->init_qp_i < 0) { if (avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) { rc->initialRCQP.qpIntra = av_clip( - rc->initialRCQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51); + rc->initialRCQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, qmax); } else { rc->initialRCQP.qpIntra = rc->initialRCQP.qpInterP; } @@ -843,7 +892,7 @@ if (ctx->init_qp_b < 0) { if (avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) { rc->initialRCQP.qpInterB = av_clip( - rc->initialRCQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51); + rc->initialRCQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, qmax); } else { rc->initialRCQP.qpInterB = rc->initialRCQP.qpInterP; } @@ -1049,6 +1098,7 @@ ctx->encode_config.frameIntervalP - 4; if (lkd_bound < 0) { + ctx->encode_config.rcParams.enableLookahead = 0; av_log(avctx, AV_LOG_WARNING, "Lookahead not enabled. Increase buffer delay (-delay).\n"); } else { @@ -1061,6 +1111,9 @@ ctx->encode_config.rcParams.lookaheadDepth, ctx->encode_config.rcParams.disableIadapt ? "disabled" : "enabled", ctx->encode_config.rcParams.disableBadapt ? "disabled" : "enabled"); + if (ctx->encode_config.rcParams.lookaheadDepth < ctx->rc_lookahead) + av_log(avctx, AV_LOG_WARNING, "Clipping lookahead depth to %d (from %d) due to lack of surfaces/delay", + ctx->encode_config.rcParams.lookaheadDepth, ctx->rc_lookahead); } } @@ -1097,11 +1150,20 @@ NV_ENC_CONFIG_H264 *h264 = &cc->encodeCodecConfig.h264Config; NV_ENC_CONFIG_H264_VUI_PARAMETERS *vui = &h264->h264VUIParameters; - vui->colourMatrix = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace; - vui->colourPrimaries = avctx->color_primaries; - vui->transferCharacteristics = avctx->color_trc; - vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG - || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P); + const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(ctx->data_pix_fmt); + + if ((pixdesc->flags & AV_PIX_FMT_FLAG_RGB) && !IS_GBRP(ctx->data_pix_fmt)) { + vui->colourMatrix = AVCOL_SPC_BT470BG; + vui->colourPrimaries = avctx->color_primaries; + vui->transferCharacteristics = avctx->color_trc; + vui->videoFullRangeFlag = 0; + } else { + vui->colourMatrix = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace; + vui->colourPrimaries = avctx->color_primaries; + vui->transferCharacteristics = avctx->color_trc; + vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG + || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P); + } vui->colourDescriptionPresentFlag = (vui->colourMatrix != 2 || vui->colourPrimaries != 2 || vui->transferCharacteristics != 2); @@ -1191,7 +1253,8 @@ h264->entropyCodingMode = ctx->coder; #ifdef NVENC_HAVE_BFRAME_REF_MODE - h264->useBFramesAsRef = ctx->b_ref_mode; + if (ctx->b_ref_mode >= 0) + h264->useBFramesAsRef = ctx->b_ref_mode; #endif #ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES @@ -1209,11 +1272,20 @@ NV_ENC_CONFIG_HEVC *hevc = &cc->encodeCodecConfig.hevcConfig; NV_ENC_CONFIG_HEVC_VUI_PARAMETERS *vui = &hevc->hevcVUIParameters; - vui->colourMatrix = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace; - vui->colourPrimaries = avctx->color_primaries; - vui->transferCharacteristics = avctx->color_trc; - vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG - || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P); + const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(ctx->data_pix_fmt); + + if ((pixdesc->flags & AV_PIX_FMT_FLAG_RGB) && !IS_GBRP(ctx->data_pix_fmt)) { + vui->colourMatrix = AVCOL_SPC_BT470BG; + vui->colourPrimaries = avctx->color_primaries; + vui->transferCharacteristics = avctx->color_trc; + vui->videoFullRangeFlag = 0; + } else { + vui->colourMatrix = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace; + vui->colourPrimaries = avctx->color_primaries; + vui->transferCharacteristics = avctx->color_trc; + vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG + || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P); + } vui->colourDescriptionPresentFlag = (vui->colourMatrix != 2 || vui->colourPrimaries != 2 || vui->transferCharacteristics != 2); @@ -1297,7 +1369,8 @@ hevc->tier = ctx->tier; #ifdef NVENC_HAVE_HEVC_BFRAME_REF_MODE - hevc->useBFramesAsRef = ctx->b_ref_mode; + if (ctx->b_ref_mode >= 0) + hevc->useBFramesAsRef = ctx->b_ref_mode; #endif #ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES @@ -1308,6 +1381,86 @@ return 0; } +#if CONFIG_AV1_NVENC_ENCODER +static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx) +{ + NvencContext *ctx = avctx->priv_data; + NV_ENC_CONFIG *cc = &ctx->encode_config; + NV_ENC_CONFIG_AV1 *av1 = &cc->encodeCodecConfig.av1Config; + + const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(ctx->data_pix_fmt); + + if ((pixdesc->flags & AV_PIX_FMT_FLAG_RGB) && !IS_GBRP(ctx->data_pix_fmt)) { + av1->matrixCoefficients = AVCOL_SPC_BT470BG; + av1->colorPrimaries = avctx->color_primaries; + av1->transferCharacteristics = avctx->color_trc; + av1->colorRange = 0; + } else { + av1->matrixCoefficients = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace; + av1->colorPrimaries = avctx->color_primaries; + av1->transferCharacteristics = avctx->color_trc; + av1->colorRange = (avctx->color_range == AVCOL_RANGE_JPEG + || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P); + } + + if (IS_YUV444(ctx->data_pix_fmt)) { + av_log(avctx, AV_LOG_ERROR, "AV1 High Profile not supported, required for 4:4:4 encoding\n"); + return AVERROR(ENOTSUP); + } else { + cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID; + avctx->profile = FF_PROFILE_AV1_MAIN; + } + + if (ctx->dpb_size >= 0) { + /* 0 means "let the hardware decide" */ + av1->maxNumRefFramesInDPB = ctx->dpb_size; + } + + if (ctx->intra_refresh) { + av1->enableIntraRefresh = 1; + av1->intraRefreshPeriod = avctx->gop_size; + av1->intraRefreshCnt = avctx->gop_size - 1; + + av1->idrPeriod = NVENC_INFINITE_GOPLENGTH; + } else if (avctx->gop_size >= 0) { + av1->idrPeriod = avctx->gop_size; + } + + if (IS_CBR(cc->rcParams.rateControlMode)) { + av1->enableBitstreamPadding = 1; + } + + if (ctx->tile_cols >= 0) + av1->numTileColumns = ctx->tile_cols; + if (ctx->tile_rows >= 0) + av1->numTileRows = ctx->tile_rows; + + av1->outputAnnexBFormat = 0; + + av1->level = ctx->level; + av1->tier = ctx->tier; + + av1->enableTimingInfo = ctx->timing_info; + + /* mp4 encapsulation requires sequence headers to be present on all keyframes for AV1 */ + av1->disableSeqHdr = 0; + av1->repeatSeqHdr = 1; + + av1->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1; + + av1->inputPixelBitDepthMinus8 = IS_10BIT(ctx->data_pix_fmt) ? 2 : 0; + av1->pixelBitDepthMinus8 = (IS_10BIT(ctx->data_pix_fmt) || ctx->highbitdepth) ? 2 : 0; + + if (ctx->b_ref_mode >= 0) + av1->useBFramesAsRef = ctx->b_ref_mode; + + av1->numFwdRefs = avctx->refs; + av1->numBwdRefs = avctx->refs; + + return 0; +} +#endif + static av_cold int nvenc_setup_codec_config(AVCodecContext *avctx) { switch (avctx->codec->id) { @@ -1315,6 +1468,10 @@ return nvenc_setup_h264_config(avctx); case AV_CODEC_ID_HEVC: return nvenc_setup_hevc_config(avctx); +#if CONFIG_AV1_NVENC_ENCODER + case AV_CODEC_ID_AV1: + return nvenc_setup_av1_config(avctx); +#endif /* Earlier switch/case will return if unknown codec is passed. */ } @@ -1327,6 +1484,25 @@ sw = avctx->width; sh = avctx->height; +#if CONFIG_AV1_NVENC_ENCODER + if (avctx->codec->id == AV_CODEC_ID_AV1) { + /* For AV1 we actually need to calculate the render width/height, not the dar */ + if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0 + && avctx->sample_aspect_ratio.num != avctx->sample_aspect_ratio.den) + { + if (avctx->sample_aspect_ratio.num > avctx->sample_aspect_ratio.den) { + sw = av_rescale(sw, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den); + } else { + sh = av_rescale(sh, avctx->sample_aspect_ratio.den, avctx->sample_aspect_ratio.num); + } + } + + *dw = sw; + *dh = sh; + return; + } +#endif + if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) { sw *= avctx->sample_aspect_ratio.num; sh *= avctx->sample_aspect_ratio.den; @@ -1594,8 +1770,8 @@ if (!ctx->surfaces) return AVERROR(ENOMEM); - ctx->timestamp_list = av_fifo_alloc2(ctx->nb_surfaces, sizeof(int64_t), 0); - if (!ctx->timestamp_list) + ctx->reorder_queue = av_fifo_alloc2(ctx->nb_surfaces, sizeof(FrameData), 0); + if (!ctx->reorder_queue) return AVERROR(ENOMEM); ctx->unused_surface_queue = av_fifo_alloc2(ctx->nb_surfaces, sizeof(NvencSurface*), 0); @@ -1634,7 +1810,8 @@ NVENCSTATUS nv_status; uint32_t outSize = 0; - char tmpHeader[256]; + char tmpHeader[NV_MAX_SEQ_HDR_LEN]; + NV_ENC_SEQUENCE_PARAM_PAYLOAD payload = { 0 }; payload.version = NV_ENC_SEQUENCE_PARAM_PAYLOAD_VER; @@ -1678,7 +1855,11 @@ p_nvenc->nvEncEncodePicture(ctx->nvencoder, ¶ms); } - av_fifo_freep2(&ctx->timestamp_list); + if (ctx->reorder_queue) { + reorder_queue_flush(ctx->reorder_queue); + av_fifo_freep2(&ctx->reorder_queue); + } + av_fifo_freep2(&ctx->output_surface_ready_queue); av_fifo_freep2(&ctx->output_surface_queue); av_fifo_freep2(&ctx->unused_surface_queue); @@ -2006,21 +2187,69 @@ } break; +#if CONFIG_AV1_NVENC_ENCODER + case AV_CODEC_ID_AV1: + params->codecPicParams.av1PicParams.numTileColumns = + ctx->encode_config.encodeCodecConfig.av1Config.numTileColumns; + params->codecPicParams.av1PicParams.numTileRows = + ctx->encode_config.encodeCodecConfig.av1Config.numTileRows; + if (sei_count > 0) { + params->codecPicParams.av1PicParams.obuPayloadArray = sei_data; + params->codecPicParams.av1PicParams.obuPayloadArrayCnt = sei_count; + } + + break; +#endif } } -static inline void timestamp_queue_enqueue(AVFifo *queue, int64_t timestamp) +static void reorder_queue_enqueue(AVFifo *queue, const AVCodecContext *avctx, + const AVFrame *frame, AVBufferRef **opaque_ref) { - av_fifo_write(queue, ×tamp, 1); + FrameData fd; + + fd.pts = frame->pts; + fd.duration = frame->duration; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + fd.reordered_opaque = frame->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + fd.frame_opaque = frame->opaque; + fd.frame_opaque_ref = *opaque_ref; + + *opaque_ref = NULL; + + av_fifo_write(queue, &fd, 1); } -static inline int64_t timestamp_queue_dequeue(AVFifo *queue) +static int64_t reorder_queue_dequeue(AVFifo *queue, AVCodecContext *avctx, + AVPacket *pkt) { - int64_t timestamp = AV_NOPTS_VALUE; + FrameData fd; + // The following call might fail if the queue is empty. - av_fifo_read(queue, ×tamp, 1); + if (av_fifo_read(queue, &fd, 1) < 0) + return AV_NOPTS_VALUE; - return timestamp; + if (pkt) { +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS + avctx->reordered_opaque = fd.reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = fd.duration; + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + pkt->opaque = fd.frame_opaque; + pkt->opaque_ref = fd.frame_opaque_ref; + fd.frame_opaque_ref = NULL; + } + } + + av_buffer_unref(&fd.frame_opaque_ref); + + return fd.pts; } static int nvenc_set_timestamp(AVCodecContext *avctx, @@ -2028,11 +2257,17 @@ AVPacket *pkt) { NvencContext *ctx = avctx->priv_data; + int64_t dts; pkt->pts = params->outputTimeStamp; - pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list); - pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1); + dts = reorder_queue_dequeue(ctx->reorder_queue, avctx, pkt); + + if (avctx->codec_descriptor->props & AV_CODEC_PROP_REORDER) { + pkt->dts = dts - FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1); + } else { + pkt->dts = pkt->pts; + } return 0; } @@ -2043,38 +2278,16 @@ NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs; NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs; - uint32_t slice_mode_data; - uint32_t *slice_offsets = NULL; NV_ENC_LOCK_BITSTREAM lock_params = { 0 }; NVENCSTATUS nv_status; int res = 0; enum AVPictureType pict_type; - switch (avctx->codec->id) { - case AV_CODEC_ID_H264: - slice_mode_data = ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData; - break; - case AV_CODEC_ID_H265: - slice_mode_data = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData; - break; - default: - av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n"); - res = AVERROR(EINVAL); - goto error; - } - slice_offsets = av_mallocz(slice_mode_data * sizeof(*slice_offsets)); - - if (!slice_offsets) { - res = AVERROR(ENOMEM); - goto error; - } - lock_params.version = NV_ENC_LOCK_BITSTREAM_VER; lock_params.doNotWait = 0; lock_params.outputBitstream = tmpoutsurf->output_surface; - lock_params.sliceOffsets = slice_offsets; nv_status = p_nvenc->nvEncLockBitstream(ctx->nvencoder, &lock_params); if (nv_status != NV_ENC_SUCCESS) { @@ -2145,16 +2358,12 @@ if (res < 0) goto error2; - av_free(slice_offsets); - return 0; error: - timestamp_queue_dequeue(ctx->timestamp_list); + reorder_queue_dequeue(ctx->reorder_queue, avctx, NULL); error2: - av_free(slice_offsets); - return res; } @@ -2195,8 +2404,15 @@ } else { ctx->sei_data = tmp; ctx->sei_data[sei_count].payloadSize = (uint32_t)a53_size; - ctx->sei_data[sei_count].payloadType = 4; ctx->sei_data[sei_count].payload = (uint8_t*)a53_data; + +#if CONFIG_AV1_NVENC_ENCODER + if (avctx->codec->id == AV_CODEC_ID_AV1) + ctx->sei_data[sei_count].payloadType = AV1_METADATA_TYPE_ITUT_T35; + else +#endif + ctx->sei_data[sei_count].payloadType = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; + sei_count++; } } @@ -2221,8 +2437,15 @@ } else { ctx->sei_data = tmp; ctx->sei_data[sei_count].payloadSize = (uint32_t)tc_size; - ctx->sei_data[sei_count].payloadType = SEI_TYPE_TIME_CODE; ctx->sei_data[sei_count].payload = (uint8_t*)tc_data; + +#if CONFIG_AV1_NVENC_ENCODER + if (avctx->codec->id == AV_CODEC_ID_AV1) + ctx->sei_data[sei_count].payloadType = AV1_METADATA_TYPE_TIMECODE; + else +#endif + ctx->sei_data[sei_count].payloadType = SEI_TYPE_TIME_CODE; + sei_count++; } } @@ -2368,6 +2591,8 @@ int sei_count = 0; int i; + AVBufferRef *opaque_ref = NULL; + NvencContext *ctx = avctx->priv_data; NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs; NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs; @@ -2435,9 +2660,17 @@ pic_params.encodePicFlags = NV_ENC_PIC_FLAG_EOS; } + // make a reference for enqueing in the reorder queue here, + // so that reorder_queue_enqueue() cannot fail + if (frame && frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + opaque_ref = av_buffer_ref(frame->opaque_ref); + if (!opaque_ref) + return AVERROR(ENOMEM); + } + res = nvenc_push_context(avctx); if (res < 0) - return res; + goto opaque_ref_fail; nv_status = p_nvenc->nvEncEncodePicture(ctx->nvencoder, &pic_params); @@ -2446,15 +2679,17 @@ res = nvenc_pop_context(avctx); if (res < 0) - return res; + goto opaque_ref_fail; if (nv_status != NV_ENC_SUCCESS && - nv_status != NV_ENC_ERR_NEED_MORE_INPUT) - return nvenc_print_error(avctx, nv_status, "EncodePicture failed!"); + nv_status != NV_ENC_ERR_NEED_MORE_INPUT) { + res = nvenc_print_error(avctx, nv_status, "EncodePicture failed!"); + goto opaque_ref_fail; + } if (frame && frame->buf[0]) { av_fifo_write(ctx->output_surface_queue, &in_surf, 1); - timestamp_queue_enqueue(ctx->timestamp_list, frame->pts); + reorder_queue_enqueue(ctx->reorder_queue, avctx, frame, &opaque_ref); } /* all the pending buffers are now ready for output */ @@ -2464,6 +2699,10 @@ } return 0; + +opaque_ref_fail: + av_buffer_unref(&opaque_ref); + return res; } int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt) @@ -2522,5 +2761,5 @@ NvencContext *ctx = avctx->priv_data; nvenc_send_frame(avctx, NULL); - av_fifo_reset2(ctx->timestamp_list); + reorder_queue_flush(ctx->reorder_queue); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -171,7 +171,7 @@ AVFifo *unused_surface_queue; AVFifo *output_surface_queue; AVFifo *output_surface_ready_queue; - AVFifo *timestamp_list; + AVFifo *reorder_queue; NV_ENC_SEI_PAYLOAD *sei_data; int sei_data_size; @@ -199,6 +199,8 @@ int tier; int rc; int cbr; + int tile_rows; + int tile_cols; int twopass; int device; int flags; @@ -236,6 +238,8 @@ int single_slice_intra_refresh; int constrained_encoding; int udu_sei; + int timing_info; + int highbitdepth; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_h264.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_h264.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_h264.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_h264.c 2023-03-03 13:29:59.000000000 +0000 @@ -161,12 +161,12 @@ { "ac", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_H264_ENTROPY_CODING_MODE_CABAC }, 0, 0, VE, "coder" }, { "vlc", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC }, 0, 0, VE, "coder" }, #ifdef NVENC_HAVE_BFRAME_REF_MODE - { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, NV_ENC_BFRAME_REF_MODE_DISABLED, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" }, + { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" }, { "disabled", "B frames will not be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, 0, 0, VE, "b_ref_mode" }, { "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" }, { "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" }, #else - { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE, "b_ref_mode" }, + { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "b_ref_mode" }, { "disabled", "", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "b_ref_mode" }, { "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" }, { "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" }, @@ -221,7 +221,7 @@ const FFCodec ff_h264_nvenc_encoder = { .p.name = "h264_nvenc", - .p.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"), + CODEC_LONG_NAME("NVIDIA NVENC H.264 encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .init = ff_nvenc_encode_init, @@ -232,8 +232,10 @@ .p.priv_class = &h264_nvenc_class, .defaults = defaults, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = ff_nvenc_pix_fmts, .p.wrapper_name = "nvenc", .hw_configs = ff_nvenc_hw_configs, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/nvenc_hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -141,12 +141,12 @@ { "weighted_pred","Set 1 to enable weighted prediction", OFFSET(weighted_pred),AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, #ifdef NVENC_HAVE_HEVC_BFRAME_REF_MODE - { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, NV_ENC_BFRAME_REF_MODE_DISABLED, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" }, + { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" }, { "disabled", "B frames will not be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, 0, 0, VE, "b_ref_mode" }, { "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" }, { "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" }, #else - { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE, "b_ref_mode" }, + { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "b_ref_mode" }, { "disabled", "", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "b_ref_mode" }, { "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" }, { "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" }, @@ -202,7 +202,7 @@ const FFCodec ff_hevc_nvenc_encoder = { .p.name = "hevc_nvenc", - .p.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC hevc encoder"), + CODEC_LONG_NAME("NVIDIA NVENC hevc encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .init = ff_nvenc_encode_init, @@ -214,8 +214,10 @@ .defaults = defaults, .p.pix_fmts = ff_nvenc_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "nvenc", .hw_configs = ff_nvenc_hw_configs, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/omx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/omx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/omx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/omx.c 2023-03-03 13:29:59.000000000 +0000 @@ -938,7 +938,7 @@ }; const FFCodec ff_mpeg4_omx_encoder = { .p.name = "mpeg4_omx", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL MPEG-4 video encoder"), + CODEC_LONG_NAME("OpenMAX IL MPEG-4 video encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(OMXCodecContext), @@ -947,7 +947,7 @@ .close = omx_encode_end, .p.pix_fmts = omx_encoder_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &omx_mpeg4enc_class, }; @@ -959,7 +959,7 @@ }; const FFCodec ff_h264_omx_encoder = { .p.name = "h264_omx", - .p.long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL H.264 video encoder"), + CODEC_LONG_NAME("OpenMAX IL H.264 video encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(OMXCodecContext), @@ -968,6 +968,6 @@ .close = omx_encode_end, .p.pix_fmts = omx_encoder_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &omx_h264enc_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/on2avc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/on2avc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/on2avc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/on2avc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,13 @@ #include "libavutil/ffmath.h" #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "fft.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "on2avcdata.h" @@ -50,8 +50,10 @@ typedef struct On2AVCContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; - FFTContext mdct, mdct_half, mdct_small; - FFTContext fft128, fft256, fft512, fft1024; + AVTXContext *mdct, *mdct_half, *mdct_small; + AVTXContext *fft128, *fft256, *fft512, *fft1024; + av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; + av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); int is_av500; @@ -465,67 +467,57 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, float *tmp0, float *tmp1) { - memcpy(src, tmp0, 384 * sizeof(*tmp0)); - memcpy(tmp0 + 384, src + 384, 128 * sizeof(*tmp0)); + memcpy(tmp1, tmp0, 384 * sizeof(*tmp0)); + memcpy(tmp0 + 384, tmp1 + 384, 128 * sizeof(*tmp0)); + + zero_head_and_tail(tmp1, 128, 16, 4); + zero_head_and_tail(tmp1 + 128, 128, 16, 4); + 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)); - zero_head_and_tail(src, 128, 16, 4); - zero_head_and_tail(src + 128, 128, 16, 4); - zero_head_and_tail(src + 256, 128, 13, 7); - zero_head_and_tail(src + 384, 128, 15, 5); - - c->fft128.fft_permute(&c->fft128, (FFTComplex*)src); - c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 128)); - c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 256)); - c->fft128.fft_permute(&c->fft128, (FFTComplex*)(src + 384)); - c->fft128.fft_calc(&c->fft128, (FFTComplex*)src); - c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 128)); - c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 256)); - c->fft128.fft_calc(&c->fft128, (FFTComplex*)(src + 384)); combine_fft(src, src + 128, src + 256, src + 384, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); - c->fft512.fft_permute(&c->fft512, (FFTComplex*)tmp1); - c->fft512.fft_calc(&c->fft512, (FFTComplex*)tmp1); - pretwiddle(&tmp0[ 0], tmp1, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); - pretwiddle(&tmp0[128], tmp1, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); - pretwiddle(&tmp0[256], tmp1, 512, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3); - pretwiddle(&tmp0[384], tmp1, 512, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4); + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); - memcpy(src, tmp1, 512 * 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); + pretwiddle(&tmp0[256], src, 512, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3); + pretwiddle(&tmp0[384], src, 512, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4); } static void wtf_end_1024(On2AVCContext *c, float *out, float *src, float *tmp0, float *tmp1) { - memcpy(src, tmp0, 768 * sizeof(*tmp0)); - memcpy(tmp0 + 768, src + 768, 256 * sizeof(*tmp0)); + memcpy(tmp1, tmp0, 768 * sizeof(*tmp0)); + memcpy(tmp0 + 768, tmp1 + 768, 256 * sizeof(*tmp0)); + + zero_head_and_tail(tmp1, 256, 16, 4); + zero_head_and_tail(tmp1 + 256, 256, 16, 4); + 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)); - zero_head_and_tail(src, 256, 16, 4); - zero_head_and_tail(src + 256, 256, 16, 4); - zero_head_and_tail(src + 512, 256, 13, 7); - zero_head_and_tail(src + 768, 256, 15, 5); - - c->fft256.fft_permute(&c->fft256, (FFTComplex*)src); - c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 256)); - c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 512)); - c->fft256.fft_permute(&c->fft256, (FFTComplex*)(src + 768)); - c->fft256.fft_calc(&c->fft256, (FFTComplex*)src); - c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 256)); - c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 512)); - c->fft256.fft_calc(&c->fft256, (FFTComplex*)(src + 768)); combine_fft(src, src + 256, src + 512, src + 768, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); - c->fft1024.fft_permute(&c->fft1024, (FFTComplex*)tmp1); - c->fft1024.fft_calc(&c->fft1024, (FFTComplex*)tmp1); - pretwiddle(&tmp0[ 0], tmp1, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); - pretwiddle(&tmp0[256], tmp1, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); - pretwiddle(&tmp0[512], tmp1, 1024, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3); - pretwiddle(&tmp0[768], tmp1, 1024, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4); + c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); - memcpy(src, tmp1, 1024 * 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); + pretwiddle(&tmp0[512], src, 1024, 84, 4, 13, 7, ff_on2avc_tabs_20_84_3); + pretwiddle(&tmp0[768], src, 1024, 84, 4, 15, 5, ff_on2avc_tabs_20_84_4); } static void wtf_40(On2AVCContext *c, float *out, float *src, int size) @@ -701,20 +693,20 @@ switch (c->window_type) { case WINDOW_TYPE_EXT7: - c->mdct.imdct_half(&c->mdct, buf, in); + c->mdct_fn(c->mdct, buf, in, sizeof(float)); break; case WINDOW_TYPE_EXT4: c->wtf(c, buf, in, 1024); break; case WINDOW_TYPE_EXT5: c->wtf(c, buf, in, 512); - c->mdct.imdct_half(&c->mdct_half, buf + 512, in + 512); + c->mdct_half_fn(c->mdct, buf + 512, in + 512, sizeof(float)); for (i = 0; i < 256; i++) { FFSWAP(float, buf[i + 512], buf[1023 - i]); } break; case WINDOW_TYPE_EXT6: - c->mdct.imdct_half(&c->mdct_half, buf, in); + c->mdct_half_fn(c->mdct_half, buf, in, sizeof(float)); for (i = 0; i < 256; i++) { FFSWAP(float, buf[i], buf[511 - i]); } @@ -747,11 +739,11 @@ case WINDOW_TYPE_LONG_START: case WINDOW_TYPE_LONG_STOP: case WINDOW_TYPE_LONG: - c->mdct.imdct_half(&c->mdct, buf, in); + c->mdct_fn(c->mdct, buf, in, sizeof(float)); break; case WINDOW_TYPE_8SHORT: for (i = 0; i < ON2AVC_SUBFRAME_SIZE; i += ON2AVC_SUBFRAME_SIZE / 8) - c->mdct_small.imdct_half(&c->mdct_small, buf + i, in + i); + c->mdct_small_fn(c->mdct_small, buf + i, in + i, sizeof(float)); break; } @@ -911,6 +903,7 @@ const uint8_t *lens = ff_on2avc_cb_lens; const uint16_t *syms = ff_on2avc_cb_syms; int channels = avctx->ch_layout.nb_channels; + float scale; int i, ret; if (channels > 2U) { @@ -951,13 +944,27 @@ c->wtf = (avctx->sample_rate <= 40000) ? wtf_40 : wtf_44; - ff_mdct_init(&c->mdct, 11, 1, 1.0 / (32768.0 * 1024.0)); - ff_mdct_init(&c->mdct_half, 10, 1, 1.0 / (32768.0 * 512.0)); - ff_mdct_init(&c->mdct_small, 8, 1, 1.0 / (32768.0 * 128.0)); - ff_fft_init(&c->fft128, 6, 0); - ff_fft_init(&c->fft256, 7, 0); - ff_fft_init(&c->fft512, 8, 1); - ff_fft_init(&c->fft1024, 9, 1); + scale = 1.0 / (1024*32768); + if ((ret = av_tx_init(&c->mdct, &c->mdct_fn, AV_TX_FLOAT_MDCT, 1, 1024, &scale, 0)) < 0) + return ret; + + scale = 1.0 / (512*32768); + if ((ret = av_tx_init(&c->mdct_half, &c->mdct_half_fn, AV_TX_FLOAT_MDCT, 1, 512, &scale, 0)) < 0) + return ret; + + scale = 1.0 / (128*32768); + 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) + return ret; + if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) + return ret; + c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); @@ -988,13 +995,13 @@ { On2AVCContext *c = avctx->priv_data; - ff_mdct_end(&c->mdct); - ff_mdct_end(&c->mdct_half); - ff_mdct_end(&c->mdct_small); - ff_fft_end(&c->fft128); - ff_fft_end(&c->fft256); - ff_fft_end(&c->fft512); - ff_fft_end(&c->fft1024); + av_tx_uninit(&c->mdct); + av_tx_uninit(&c->mdct_half); + av_tx_uninit(&c->mdct_small); + av_tx_uninit(&c->fft128); + av_tx_uninit(&c->fft256); + av_tx_uninit(&c->fft512); + av_tx_uninit(&c->fft1024); av_freep(&c->fdsp); @@ -1006,7 +1013,7 @@ const FFCodec ff_on2avc_decoder = { .p.name = "on2avc", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"), + CODEC_LONG_NAME("On2 Audio for Video Codec"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ON2AVC, .priv_data_size = sizeof(On2AVCContext), @@ -1014,7 +1021,7 @@ FF_CODEC_DECODE_CB(on2avc_decode_frame), .close = on2avc_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options.c 2023-03-03 13:29:59.000000000 +0000 @@ -124,7 +124,11 @@ s->sw_pix_fmt = AV_PIX_FMT_NONE; s->sample_fmt = AV_SAMPLE_FMT_NONE; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS s->reordered_opaque = AV_NOPTS_VALUE; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if(codec && codec2->priv_data_size){ s->priv_data = av_mallocz(codec2->priv_data_size); if (!s->priv_data) @@ -185,39 +189,6 @@ return &av_codec_context_class; } -#if FF_API_GET_FRAME_CLASS -FF_DISABLE_DEPRECATION_WARNINGS -#define FOFFSET(x) offsetof(AVFrame,x) - -static const AVOption frame_options[]={ -{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0}, -{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0}, -{"pkt_size", "", FOFFSET(pkt_size), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0}, -{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0}, -{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0}, -{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0}, -{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.i64 = -1 }, 0, INT_MAX, 0}, -#if FF_API_OLD_CHANNEL_LAYOUT -{"channel_layout", "", FOFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, 0}, -#endif -{"sample_rate", "", FOFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0}, -{NULL}, -}; - -static const AVClass av_frame_class = { - .class_name = "AVFrame", - .item_name = NULL, - .option = frame_options, - .version = LIBAVUTIL_VERSION_INT, -}; - -const AVClass *avcodec_get_frame_class(void) -{ - return &av_frame_class; -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - #define SROFFSET(x) offsetof(AVSubtitleRect,x) static const AVOption subtitle_rect_options[]={ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options_table.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options_table.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options_table.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/options_table.h 2023-03-03 13:29:59.000000000 +0000 @@ -57,13 +57,13 @@ {"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"}, {"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"}, {"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"}, +{"recon_frame", "export reconstructed frames", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_RECON_FRAME}, .unit = "flags"}, +{"copy_opaque", "propagate opaque values", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_COPY_OPAQUE}, .unit = "flags"}, +{"frame_duration", "use frame durations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_FRAME_DURATION}, .unit = "flags"}, {"pass1", "use internal 2-pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"}, {"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"}, {"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"}, {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_FLAG_TRUNCATED -{"truncated", "(Deprecated, use parsers instead.) Input bitstream might be randomly truncated", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, V|D | AV_OPT_FLAG_DEPRECATED, "flags"}, -#endif {"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"}, {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"}, @@ -83,6 +83,7 @@ {"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, "flags2"}, {"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, A|D, "flags2"}, {"ass_ro_flush_noop", "do not reset ASS ReadOrder field on flush", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_RO_FLUSH_NOOP}, INT_MIN, INT_MAX, S|D, "flags2"}, +{"icc_profiles", "generate/parse embedded ICC profiles from/to colorimetry tags", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_ICC_PROFILES}, INT_MIN, INT_MAX, S|D, "flags2"}, {"export_side_data", "Export metadata as side data", OFFSET(export_side_data), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, A|V|S|D|E, "export_side_data"}, {"mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_MVS}, INT_MIN, INT_MAX, V|D, "export_side_data"}, {"prft", "export Producer Reference Time through packet side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_PRFT}, INT_MIN, INT_MAX, A|V|S|E, "export_side_data"}, @@ -96,7 +97,7 @@ #endif {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E}, {"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|E}, -{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"frame_number", NULL, OFFSET(frame_num), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, {"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, {"qcomp", "video quantizer scale compression (VBR). Constant of ratecontrol equation. " "Recommended range for default rc_eq: 0.0-1.0", @@ -375,10 +376,6 @@ {"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"}, {"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"}, {"ignore", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_IGNORE}, INT_MIN, INT_MAX, S|D, "sub_charenc_mode"}, -#if FF_API_SUB_TEXT_FORMAT -{"sub_text_format", "Deprecated, does nothing", OFFSET(sub_text_format), AV_OPT_TYPE_INT, {.i64 = FF_SUB_TEXT_FMT_ASS}, 0, 1, S|D | AV_OPT_FLAG_DEPRECATED, "sub_text_format"}, -{"ass", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_TEXT_FMT_ASS}, INT_MIN, INT_MAX, S|D, "sub_text_format"}, -#endif {"apply_cropping", NULL, OFFSET(apply_cropping), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, V | D }, {"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, V|D }, {"field_order", "Field order", OFFSET(field_order), AV_OPT_TYPE_INT, {.i64 = AV_FIELD_UNKNOWN }, 0, 5, V|D|E, "field_order" }, @@ -397,6 +394,7 @@ {"ignore_level", "ignore level even if the codec level used is unknown or higher than the maximum supported level reported by the hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, "hwaccel_flags" }, {"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"}, {"allow_profile_mismatch", "attempt to decode anyway if HW accelerated decoder's supported profiles do not exactly match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"}, +{"unsafe_output", "allow potentially unsafe hwaccel frame output that might require special care to process successfully", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_UNSAFE_OUTPUT }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"}, {"extra_hw_frames", "Number of extra hardware frames to allocate for the user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, V|D }, {"discard_damaged_percentage", "Percentage of damaged samples to discard a frame", OFFSET(discard_damaged_percentage), AV_OPT_TYPE_INT, {.i64 = 95 }, 0, 100, V|D }, {NULL}, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,925 +0,0 @@ -/* - * Copyright (c) 2012 Andrew D'Addesio - * Copyright (c) 2013-2014 Mozilla Corporation - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * Opus decoder/parser shared code - */ - -#include - -#include "libavutil/channel_layout.h" -#include "libavutil/error.h" -#include "libavutil/ffmath.h" - -#include "opus_celt.h" -#include "opustab.h" -#include "internal.h" -#include "vorbis.h" - -static const uint16_t opus_frame_duration[32] = { - 480, 960, 1920, 2880, - 480, 960, 1920, 2880, - 480, 960, 1920, 2880, - 480, 960, - 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, -}; - -/** - * Read a 1- or 2-byte frame length - */ -static inline int xiph_lacing_16bit(const uint8_t **ptr, const uint8_t *end) -{ - int val; - - if (*ptr >= end) - return AVERROR_INVALIDDATA; - val = *(*ptr)++; - if (val >= 252) { - if (*ptr >= end) - return AVERROR_INVALIDDATA; - val += 4 * *(*ptr)++; - } - return val; -} - -/** - * Read a multi-byte length (used for code 3 packet padding size) - */ -static inline int xiph_lacing_full(const uint8_t **ptr, const uint8_t *end) -{ - int val = 0; - int next; - - while (1) { - if (*ptr >= end || val > INT_MAX - 254) - return AVERROR_INVALIDDATA; - next = *(*ptr)++; - val += next; - if (next < 255) - break; - else - val--; - } - return val; -} - -/** - * Parse Opus packet info from raw packet data - */ -int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, - int self_delimiting) -{ - const uint8_t *ptr = buf; - const uint8_t *end = buf + buf_size; - int padding = 0; - int frame_bytes, i; - - if (buf_size < 1) - goto fail; - - /* TOC byte */ - i = *ptr++; - pkt->code = (i ) & 0x3; - pkt->stereo = (i >> 2) & 0x1; - pkt->config = (i >> 3) & 0x1F; - - /* code 2 and code 3 packets have at least 1 byte after the TOC */ - if (pkt->code >= 2 && buf_size < 2) - goto fail; - - switch (pkt->code) { - case 0: - /* 1 frame */ - pkt->frame_count = 1; - pkt->vbr = 0; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len > end - ptr) - goto fail; - end = ptr + len; - buf_size = end - buf; - } - - frame_bytes = end - ptr; - if (frame_bytes > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - break; - case 1: - /* 2 frames, equal size */ - pkt->frame_count = 2; - pkt->vbr = 0; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || 2 * len > end - ptr) - goto fail; - end = ptr + 2 * len; - buf_size = end - buf; - } - - frame_bytes = end - ptr; - if (frame_bytes & 1 || frame_bytes >> 1 > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes >> 1; - pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; - pkt->frame_size[1] = frame_bytes >> 1; - break; - case 2: - /* 2 frames, different sizes */ - pkt->frame_count = 2; - pkt->vbr = 1; - - /* read 1st frame size */ - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0) - goto fail; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len + frame_bytes > end - ptr) - goto fail; - end = ptr + frame_bytes + len; - buf_size = end - buf; - } - - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - - /* calculate 2nd frame size */ - frame_bytes = end - ptr - pkt->frame_size[0]; - if (frame_bytes < 0 || frame_bytes > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; - pkt->frame_size[1] = frame_bytes; - break; - case 3: - /* 1 to 48 frames, can be different sizes */ - i = *ptr++; - pkt->frame_count = (i ) & 0x3F; - padding = (i >> 6) & 0x01; - pkt->vbr = (i >> 7) & 0x01; - - if (pkt->frame_count == 0 || pkt->frame_count > MAX_FRAMES) - goto fail; - - /* read padding size */ - if (padding) { - padding = xiph_lacing_full(&ptr, end); - if (padding < 0) - goto fail; - } - - /* read frame sizes */ - if (pkt->vbr) { - /* for VBR, all frames except the final one have their size coded - in the bitstream. the last frame size is implicit. */ - int total_bytes = 0; - for (i = 0; i < pkt->frame_count - 1; i++) { - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0) - goto fail; - pkt->frame_size[i] = frame_bytes; - total_bytes += frame_bytes; - } - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len + total_bytes + padding > end - ptr) - goto fail; - end = ptr + total_bytes + len + padding; - buf_size = end - buf; - } - - frame_bytes = end - ptr - padding; - if (total_bytes > frame_bytes) - goto fail; - pkt->frame_offset[0] = ptr - buf; - for (i = 1; i < pkt->frame_count; i++) - pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; - pkt->frame_size[pkt->frame_count-1] = frame_bytes - total_bytes; - } else { - /* for CBR, the remaining packet bytes are divided evenly between - the frames */ - if (self_delimiting) { - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0 || pkt->frame_count * frame_bytes + padding > end - ptr) - goto fail; - end = ptr + pkt->frame_count * frame_bytes + padding; - buf_size = end - buf; - } else { - frame_bytes = end - ptr - padding; - if (frame_bytes % pkt->frame_count || - frame_bytes / pkt->frame_count > MAX_FRAME_SIZE) - goto fail; - frame_bytes /= pkt->frame_count; - } - - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - for (i = 1; i < pkt->frame_count; i++) { - pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; - pkt->frame_size[i] = frame_bytes; - } - } - } - - pkt->packet_size = buf_size; - pkt->data_size = pkt->packet_size - padding; - - /* total packet duration cannot be larger than 120ms */ - pkt->frame_duration = opus_frame_duration[pkt->config]; - if (pkt->frame_duration * pkt->frame_count > MAX_PACKET_DUR) - goto fail; - - /* set mode and bandwidth */ - if (pkt->config < 12) { - pkt->mode = OPUS_MODE_SILK; - pkt->bandwidth = pkt->config >> 2; - } else if (pkt->config < 16) { - pkt->mode = OPUS_MODE_HYBRID; - pkt->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND + (pkt->config >= 14); - } else { - pkt->mode = OPUS_MODE_CELT; - pkt->bandwidth = (pkt->config - 16) >> 2; - /* skip medium band */ - if (pkt->bandwidth) - pkt->bandwidth++; - } - - return 0; - -fail: - memset(pkt, 0, sizeof(*pkt)); - return AVERROR_INVALIDDATA; -} - -static int channel_reorder_vorbis(int nb_channels, int channel_idx) -{ - return ff_vorbis_channel_layout_offsets[nb_channels - 1][channel_idx]; -} - -static int channel_reorder_unknown(int nb_channels, int channel_idx) -{ - return channel_idx; -} - -av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, - OpusContext *s) -{ - static const uint8_t default_channel_map[2] = { 0, 1 }; - - int (*channel_reorder)(int, int) = channel_reorder_unknown; - int channels = avctx->ch_layout.nb_channels; - - const uint8_t *extradata, *channel_map; - int extradata_size; - int version, map_type, streams, stereo_streams, i, j, ret; - AVChannelLayout layout = { 0 }; - - if (!avctx->extradata) { - if (channels > 2) { - av_log(avctx, AV_LOG_ERROR, - "Multichannel configuration without extradata.\n"); - return AVERROR(EINVAL); - } - extradata = opus_default_extradata; - extradata_size = sizeof(opus_default_extradata); - } else { - extradata = avctx->extradata; - extradata_size = avctx->extradata_size; - } - - if (extradata_size < 19) { - av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", - extradata_size); - return AVERROR_INVALIDDATA; - } - - version = extradata[8]; - if (version > 15) { - avpriv_request_sample(avctx, "Extradata version %d", version); - return AVERROR_PATCHWELCOME; - } - - avctx->delay = AV_RL16(extradata + 10); - if (avctx->internal) - avctx->internal->skip_samples = avctx->delay; - - channels = avctx->extradata ? extradata[9] : (channels == 1) ? 1 : 2; - if (!channels) { - av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extradata\n"); - return AVERROR_INVALIDDATA; - } - - s->gain_i = AV_RL16(extradata + 16); - if (s->gain_i) - s->gain = ff_exp10(s->gain_i / (20.0 * 256)); - - map_type = extradata[18]; - if (!map_type) { - if (channels > 2) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 0 is only specified for up to 2 channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - layout = (channels == 1) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO : - (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; - streams = 1; - stereo_streams = channels - 1; - channel_map = default_channel_map; - } else if (map_type == 1 || map_type == 2 || map_type == 255) { - if (extradata_size < 21 + channels) { - av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", - extradata_size); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - streams = extradata[19]; - stereo_streams = extradata[20]; - if (!streams || stereo_streams > streams || - streams + stereo_streams > 255) { - av_log(avctx, AV_LOG_ERROR, - "Invalid stream/stereo stream count: %d/%d\n", streams, stereo_streams); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - if (map_type == 1) { - if (channels > 8) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 1 is only specified for up to 8 channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - av_channel_layout_copy(&layout, &ff_vorbis_ch_layouts[channels - 1]); - channel_reorder = channel_reorder_vorbis; - } else if (map_type == 2) { - int ambisonic_order = ff_sqrt(channels) - 1; - if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && - channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 2 is only specified for channel counts" - " which can be written as (n + 1)^2 or (n + 1)^2 + 2" - " for nonnegative integer n\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - if (channels > 227) { - av_log(avctx, AV_LOG_ERROR, "Too many channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - layout.order = AV_CHANNEL_ORDER_AMBISONIC; - layout.nb_channels = channels; - if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1))) - layout.u.mask = AV_CH_LAYOUT_STEREO; - } else { - layout.order = AV_CHANNEL_ORDER_UNSPEC; - layout.nb_channels = channels; - } - - channel_map = extradata + 21; - } else { - avpriv_request_sample(avctx, "Mapping type %d", map_type); - return AVERROR_PATCHWELCOME; - } - - s->channel_maps = av_calloc(channels, sizeof(*s->channel_maps)); - if (!s->channel_maps) { - ret = AVERROR(ENOMEM); - goto fail; - } - - for (i = 0; i < channels; i++) { - ChannelMap *map = &s->channel_maps[i]; - uint8_t idx = channel_map[channel_reorder(channels, i)]; - - if (idx == 255) { - map->silence = 1; - continue; - } else if (idx >= streams + stereo_streams) { - av_log(avctx, AV_LOG_ERROR, - "Invalid channel map for output channel %d: %d\n", i, idx); - av_freep(&s->channel_maps); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - /* check that we did not see this index yet */ - map->copy = 0; - for (j = 0; j < i; j++) - if (channel_map[channel_reorder(channels, j)] == idx) { - map->copy = 1; - map->copy_idx = j; - break; - } - - if (idx < 2 * stereo_streams) { - map->stream_idx = idx / 2; - map->channel_idx = idx & 1; - } else { - map->stream_idx = idx - stereo_streams; - map->channel_idx = 0; - } - } - - ret = av_channel_layout_copy(&avctx->ch_layout, &layout); - if (ret < 0) - goto fail; - - s->nb_streams = streams; - s->nb_stereo_streams = stereo_streams; - - return 0; -fail: - av_channel_layout_uninit(&layout); - return ret; -} - -void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc) -{ - float lowband_scratch[8 * 22]; - float norm1[2 * 8 * 100]; - float *norm2 = norm1 + 8 * 100; - - int totalbits = (f->framebits << 3) - f->anticollapse_needed; - - int update_lowband = 1; - int lowband_offset = 0; - - int i, j; - - for (i = f->start_band; i < f->end_band; i++) { - uint32_t cm[2] = { (1 << f->blocks) - 1, (1 << f->blocks) - 1 }; - int band_offset = ff_celt_freq_bands[i] << f->size; - int band_size = ff_celt_freq_range[i] << f->size; - float *X = f->block[0].coeffs + band_offset; - float *Y = (f->channels == 2) ? f->block[1].coeffs + band_offset : NULL; - float *norm_loc1, *norm_loc2; - - int consumed = opus_rc_tell_frac(rc); - int effective_lowband = -1; - int b = 0; - - /* Compute how many bits we want to allocate to this band */ - if (i != f->start_band) - f->remaining -= consumed; - f->remaining2 = totalbits - consumed - 1; - if (i <= f->coded_bands - 1) { - int curr_balance = f->remaining / FFMIN(3, f->coded_bands-i); - b = av_clip_uintp2(FFMIN(f->remaining2 + 1, f->pulses[i] + curr_balance), 14); - } - - if ((ff_celt_freq_bands[i] - ff_celt_freq_range[i] >= ff_celt_freq_bands[f->start_band] || - i == f->start_band + 1) && (update_lowband || lowband_offset == 0)) - lowband_offset = i; - - if (i == f->start_band + 1) { - /* Special Hybrid Folding (RFC 8251 section 9). Copy the first band into - the second to ensure the second band never has to use the LCG. */ - int count = (ff_celt_freq_range[i] - ff_celt_freq_range[i-1]) << f->size; - - memcpy(&norm1[band_offset], &norm1[band_offset - count], count * sizeof(float)); - - if (f->channels == 2) - memcpy(&norm2[band_offset], &norm2[band_offset - count], count * sizeof(float)); - } - - /* Get a conservative estimate of the collapse_mask's for the bands we're - going to be folding from. */ - if (lowband_offset != 0 && (f->spread != CELT_SPREAD_AGGRESSIVE || - f->blocks > 1 || f->tf_change[i] < 0)) { - int foldstart, foldend; - - /* This ensures we never repeat spectral content within one band */ - effective_lowband = FFMAX(ff_celt_freq_bands[f->start_band], - ff_celt_freq_bands[lowband_offset] - ff_celt_freq_range[i]); - foldstart = lowband_offset; - while (ff_celt_freq_bands[--foldstart] > effective_lowband); - foldend = lowband_offset - 1; - while (++foldend < i && ff_celt_freq_bands[foldend] < effective_lowband + ff_celt_freq_range[i]); - - cm[0] = cm[1] = 0; - for (j = foldstart; j < foldend; j++) { - cm[0] |= f->block[0].collapse_masks[j]; - cm[1] |= f->block[f->channels - 1].collapse_masks[j]; - } - } - - if (f->dual_stereo && i == f->intensity_stereo) { - /* Switch off dual stereo to do intensity */ - f->dual_stereo = 0; - for (j = ff_celt_freq_bands[f->start_band] << f->size; j < band_offset; j++) - norm1[j] = (norm1[j] + norm2[j]) / 2; - } - - norm_loc1 = effective_lowband != -1 ? norm1 + (effective_lowband << f->size) : NULL; - norm_loc2 = effective_lowband != -1 ? norm2 + (effective_lowband << f->size) : NULL; - - if (f->dual_stereo) { - cm[0] = f->pvq->quant_band(f->pvq, f, rc, i, X, NULL, band_size, b >> 1, - f->blocks, norm_loc1, f->size, - norm1 + band_offset, 0, 1.0f, - lowband_scratch, cm[0]); - - cm[1] = f->pvq->quant_band(f->pvq, f, rc, i, Y, NULL, band_size, b >> 1, - f->blocks, norm_loc2, f->size, - norm2 + band_offset, 0, 1.0f, - lowband_scratch, cm[1]); - } else { - cm[0] = f->pvq->quant_band(f->pvq, f, rc, i, X, Y, band_size, b >> 0, - f->blocks, norm_loc1, f->size, - norm1 + band_offset, 0, 1.0f, - lowband_scratch, cm[0] | cm[1]); - cm[1] = cm[0]; - } - - f->block[0].collapse_masks[i] = (uint8_t)cm[0]; - f->block[f->channels - 1].collapse_masks[i] = (uint8_t)cm[1]; - f->remaining += f->pulses[i] + consumed; - - /* Update the folding position only as long as we have 1 bit/sample depth */ - update_lowband = (b > band_size << 3); - } -} - -#define NORMC(bits) ((bits) << (f->channels - 1) << f->size >> 2) - -void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode) -{ - int i, j, low, high, total, done, bandbits, remaining, tbits_8ths; - int skip_startband = f->start_band; - int skip_bit = 0; - int intensitystereo_bit = 0; - int dualstereo_bit = 0; - int dynalloc = 6; - int extrabits = 0; - - int boost[CELT_MAX_BANDS] = { 0 }; - int trim_offset[CELT_MAX_BANDS]; - int threshold[CELT_MAX_BANDS]; - int bits1[CELT_MAX_BANDS]; - int bits2[CELT_MAX_BANDS]; - - /* Spread */ - if (opus_rc_tell(rc) + 4 <= f->framebits) { - if (encode) - ff_opus_rc_enc_cdf(rc, f->spread, ff_celt_model_spread); - else - f->spread = ff_opus_rc_dec_cdf(rc, ff_celt_model_spread); - } else { - f->spread = CELT_SPREAD_NORMAL; - } - - /* Initialize static allocation caps */ - for (i = 0; i < CELT_MAX_BANDS; i++) - f->caps[i] = NORMC((ff_celt_static_caps[f->size][f->channels - 1][i] + 64) * ff_celt_freq_range[i]); - - /* Band boosts */ - tbits_8ths = f->framebits << 3; - for (i = f->start_band; i < f->end_band; i++) { - int quanta = ff_celt_freq_range[i] << (f->channels - 1) << f->size; - int b_dynalloc = dynalloc; - int boost_amount = f->alloc_boost[i]; - quanta = FFMIN(quanta << 3, FFMAX(6 << 3, quanta)); - - while (opus_rc_tell_frac(rc) + (b_dynalloc << 3) < tbits_8ths && boost[i] < f->caps[i]) { - int is_boost; - if (encode) { - is_boost = boost_amount--; - ff_opus_rc_enc_log(rc, is_boost, b_dynalloc); - } else { - is_boost = ff_opus_rc_dec_log(rc, b_dynalloc); - } - - if (!is_boost) - break; - - boost[i] += quanta; - tbits_8ths -= quanta; - - b_dynalloc = 1; - } - - if (boost[i]) - dynalloc = FFMAX(dynalloc - 1, 2); - } - - /* Allocation trim */ - if (!encode) - f->alloc_trim = 5; - if (opus_rc_tell_frac(rc) + (6 << 3) <= tbits_8ths) - if (encode) - ff_opus_rc_enc_cdf(rc, f->alloc_trim, ff_celt_model_alloc_trim); - else - f->alloc_trim = ff_opus_rc_dec_cdf(rc, ff_celt_model_alloc_trim); - - /* Anti-collapse bit reservation */ - tbits_8ths = (f->framebits << 3) - opus_rc_tell_frac(rc) - 1; - f->anticollapse_needed = 0; - if (f->transient && f->size >= 2 && tbits_8ths >= ((f->size + 2) << 3)) - f->anticollapse_needed = 1 << 3; - tbits_8ths -= f->anticollapse_needed; - - /* Band skip bit reservation */ - if (tbits_8ths >= 1 << 3) - skip_bit = 1 << 3; - tbits_8ths -= skip_bit; - - /* Intensity/dual stereo bit reservation */ - if (f->channels == 2) { - intensitystereo_bit = ff_celt_log2_frac[f->end_band - f->start_band]; - if (intensitystereo_bit <= tbits_8ths) { - tbits_8ths -= intensitystereo_bit; - if (tbits_8ths >= 1 << 3) { - dualstereo_bit = 1 << 3; - tbits_8ths -= 1 << 3; - } - } else { - intensitystereo_bit = 0; - } - } - - /* Trim offsets */ - for (i = f->start_band; i < f->end_band; i++) { - int trim = f->alloc_trim - 5 - f->size; - int band = ff_celt_freq_range[i] * (f->end_band - i - 1); - int duration = f->size + 3; - int scale = duration + f->channels - 1; - - /* PVQ minimum allocation threshold, below this value the band is - * skipped */ - threshold[i] = FFMAX(3 * ff_celt_freq_range[i] << duration >> 4, - f->channels << 3); - - trim_offset[i] = trim * (band << scale) >> 6; - - if (ff_celt_freq_range[i] << f->size == 1) - trim_offset[i] -= f->channels << 3; - } - - /* Bisection */ - low = 1; - high = CELT_VECTORS - 1; - while (low <= high) { - int center = (low + high) >> 1; - done = total = 0; - - for (i = f->end_band - 1; i >= f->start_band; i--) { - bandbits = NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[center][i]); - - if (bandbits) - bandbits = FFMAX(bandbits + trim_offset[i], 0); - bandbits += boost[i]; - - if (bandbits >= threshold[i] || done) { - done = 1; - total += FFMIN(bandbits, f->caps[i]); - } else if (bandbits >= f->channels << 3) { - total += f->channels << 3; - } - } - - if (total > tbits_8ths) - high = center - 1; - else - low = center + 1; - } - high = low--; - - /* Bisection */ - for (i = f->start_band; i < f->end_band; i++) { - bits1[i] = NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[low][i]); - bits2[i] = high >= CELT_VECTORS ? f->caps[i] : - NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[high][i]); - - if (bits1[i]) - bits1[i] = FFMAX(bits1[i] + trim_offset[i], 0); - if (bits2[i]) - bits2[i] = FFMAX(bits2[i] + trim_offset[i], 0); - - if (low) - bits1[i] += boost[i]; - bits2[i] += boost[i]; - - if (boost[i]) - skip_startband = i; - bits2[i] = FFMAX(bits2[i] - bits1[i], 0); - } - - /* Bisection */ - low = 0; - high = 1 << CELT_ALLOC_STEPS; - for (i = 0; i < CELT_ALLOC_STEPS; i++) { - int center = (low + high) >> 1; - done = total = 0; - - for (j = f->end_band - 1; j >= f->start_band; j--) { - bandbits = bits1[j] + (center * bits2[j] >> CELT_ALLOC_STEPS); - - if (bandbits >= threshold[j] || done) { - done = 1; - total += FFMIN(bandbits, f->caps[j]); - } else if (bandbits >= f->channels << 3) - total += f->channels << 3; - } - if (total > tbits_8ths) - high = center; - else - low = center; - } - - /* Bisection */ - done = total = 0; - for (i = f->end_band - 1; i >= f->start_band; i--) { - bandbits = bits1[i] + (low * bits2[i] >> CELT_ALLOC_STEPS); - - if (bandbits >= threshold[i] || done) - done = 1; - else - bandbits = (bandbits >= f->channels << 3) ? - f->channels << 3 : 0; - - bandbits = FFMIN(bandbits, f->caps[i]); - f->pulses[i] = bandbits; - total += bandbits; - } - - /* Band skipping */ - for (f->coded_bands = f->end_band; ; f->coded_bands--) { - int allocation; - j = f->coded_bands - 1; - - if (j == skip_startband) { - /* all remaining bands are not skipped */ - tbits_8ths += skip_bit; - break; - } - - /* determine the number of bits available for coding "do not skip" markers */ - remaining = tbits_8ths - total; - bandbits = remaining / (ff_celt_freq_bands[j+1] - ff_celt_freq_bands[f->start_band]); - remaining -= bandbits * (ff_celt_freq_bands[j+1] - ff_celt_freq_bands[f->start_band]); - allocation = f->pulses[j] + bandbits * ff_celt_freq_range[j]; - allocation += FFMAX(remaining - (ff_celt_freq_bands[j] - ff_celt_freq_bands[f->start_band]), 0); - - /* a "do not skip" marker is only coded if the allocation is - * above the chosen threshold */ - if (allocation >= FFMAX(threshold[j], (f->channels + 1) << 3)) { - int do_not_skip; - if (encode) { - do_not_skip = f->coded_bands <= f->skip_band_floor; - ff_opus_rc_enc_log(rc, do_not_skip, 1); - } else { - do_not_skip = ff_opus_rc_dec_log(rc, 1); - } - - if (do_not_skip) - break; - - total += 1 << 3; - allocation -= 1 << 3; - } - - /* the band is skipped, so reclaim its bits */ - total -= f->pulses[j]; - if (intensitystereo_bit) { - total -= intensitystereo_bit; - intensitystereo_bit = ff_celt_log2_frac[j - f->start_band]; - total += intensitystereo_bit; - } - - total += f->pulses[j] = (allocation >= f->channels << 3) ? f->channels << 3 : 0; - } - - /* IS start band */ - if (encode) { - if (intensitystereo_bit) { - f->intensity_stereo = FFMIN(f->intensity_stereo, f->coded_bands); - ff_opus_rc_enc_uint(rc, f->intensity_stereo, f->coded_bands + 1 - f->start_band); - } - } else { - f->intensity_stereo = f->dual_stereo = 0; - if (intensitystereo_bit) - f->intensity_stereo = f->start_band + ff_opus_rc_dec_uint(rc, f->coded_bands + 1 - f->start_band); - } - - /* DS flag */ - if (f->intensity_stereo <= f->start_band) - tbits_8ths += dualstereo_bit; /* no intensity stereo means no dual stereo */ - else if (dualstereo_bit) - if (encode) - ff_opus_rc_enc_log(rc, f->dual_stereo, 1); - else - f->dual_stereo = ff_opus_rc_dec_log(rc, 1); - - /* Supply the remaining bits in this frame to lower bands */ - remaining = tbits_8ths - total; - bandbits = remaining / (ff_celt_freq_bands[f->coded_bands] - ff_celt_freq_bands[f->start_band]); - remaining -= bandbits * (ff_celt_freq_bands[f->coded_bands] - ff_celt_freq_bands[f->start_band]); - for (i = f->start_band; i < f->coded_bands; i++) { - const int bits = FFMIN(remaining, ff_celt_freq_range[i]); - f->pulses[i] += bits + bandbits * ff_celt_freq_range[i]; - remaining -= bits; - } - - /* Finally determine the allocation */ - for (i = f->start_band; i < f->coded_bands; i++) { - int N = ff_celt_freq_range[i] << f->size; - int prev_extra = extrabits; - f->pulses[i] += extrabits; - - if (N > 1) { - int dof; /* degrees of freedom */ - int temp; /* dof * channels * log(dof) */ - int fine_bits; - int max_bits; - int offset; /* fine energy quantization offset, i.e. - * extra bits assigned over the standard - * totalbits/dof */ - - extrabits = FFMAX(f->pulses[i] - f->caps[i], 0); - f->pulses[i] -= extrabits; - - /* intensity stereo makes use of an extra degree of freedom */ - dof = N * f->channels + (f->channels == 2 && N > 2 && !f->dual_stereo && i < f->intensity_stereo); - temp = dof * (ff_celt_log_freq_range[i] + (f->size << 3)); - offset = (temp >> 1) - dof * CELT_FINE_OFFSET; - if (N == 2) /* dof=2 is the only case that doesn't fit the model */ - offset += dof << 1; - - /* grant an additional bias for the first and second pulses */ - if (f->pulses[i] + offset < 2 * (dof << 3)) - offset += temp >> 2; - else if (f->pulses[i] + offset < 3 * (dof << 3)) - offset += temp >> 3; - - fine_bits = (f->pulses[i] + offset + (dof << 2)) / (dof << 3); - max_bits = FFMIN((f->pulses[i] >> 3) >> (f->channels - 1), CELT_MAX_FINE_BITS); - max_bits = FFMAX(max_bits, 0); - f->fine_bits[i] = av_clip(fine_bits, 0, max_bits); - - /* If fine_bits was rounded down or capped, - * give priority for the final fine energy pass */ - f->fine_priority[i] = (f->fine_bits[i] * (dof << 3) >= f->pulses[i] + offset); - - /* the remaining bits are assigned to PVQ */ - f->pulses[i] -= f->fine_bits[i] << (f->channels - 1) << 3; - } else { - /* all bits go to fine energy except for the sign bit */ - extrabits = FFMAX(f->pulses[i] - (f->channels << 3), 0); - f->pulses[i] -= extrabits; - f->fine_bits[i] = 0; - f->fine_priority[i] = 1; - } - - /* hand back a limited number of extra fine energy bits to this band */ - if (extrabits > 0) { - int fineextra = FFMIN(extrabits >> (f->channels + 2), - CELT_MAX_FINE_BITS - f->fine_bits[i]); - f->fine_bits[i] += fineextra; - - fineextra <<= f->channels + 2; - f->fine_priority[i] = (fineextra >= extrabits - prev_extra); - extrabits -= fineextra; - } - } - f->remaining = extrabits; - - /* skipped bands dedicate all of their bits for fine energy */ - for (; i < f->end_band; i++) { - f->fine_bits[i] = f->pulses[i] >> (f->channels - 1) >> 3; - f->pulses[i] = 0; - f->fine_priority[i] = f->fine_bits[i] < 1; - } -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,7 +1,6 @@ /* * Copyright (c) 2012 Andrew D'Addesio * Copyright (c) 2013-2014 Mozilla Corporation - * Copyright (c) 2016 Rostislav Pehlivanov * * This file is part of FFmpeg. * @@ -20,561 +19,466 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * @file - * Opus CELT decoder - */ +#include #include "opus_celt.h" -#include "opustab.h" #include "opus_pvq.h" +#include "opustab.h" -/* Use the 2D z-transform to apply prediction in both the time domain (alpha) - * and the frequency domain (beta) */ -static void celt_decode_coarse_energy(CeltFrame *f, OpusRangeCoder *rc) +void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc) { - int i, j; - float prev[2] = { 0 }; - float alpha = ff_celt_alpha_coef[f->size]; - float beta = ff_celt_beta_coef[f->size]; - const uint8_t *model = ff_celt_coarse_energy_dist[f->size][0]; - - /* intra frame */ - if (opus_rc_tell(rc) + 3 <= f->framebits && ff_opus_rc_dec_log(rc, 3)) { - alpha = 0.0f; - beta = 1.0f - (4915.0f/32768.0f); - model = ff_celt_coarse_energy_dist[f->size][1]; - } - - for (i = 0; i < CELT_MAX_BANDS; i++) { - for (j = 0; j < f->channels; j++) { - CeltBlock *block = &f->block[j]; - float value; - int available; - - if (i < f->start_band || i >= f->end_band) { - block->energy[i] = 0.0; - continue; - } + float lowband_scratch[8 * 22]; + float norm1[2 * 8 * 100]; + float *norm2 = norm1 + 8 * 100; - available = f->framebits - opus_rc_tell(rc); - if (available >= 15) { - /* decode using a Laplace distribution */ - int k = FFMIN(i, 20) << 1; - value = ff_opus_rc_dec_laplace(rc, model[k] << 7, model[k+1] << 6); - } else if (available >= 2) { - int x = ff_opus_rc_dec_cdf(rc, ff_celt_model_energy_small); - value = (x>>1) ^ -(x&1); - } else if (available >= 1) { - value = -(float)ff_opus_rc_dec_log(rc, 1); - } else value = -1; + int totalbits = (f->framebits << 3) - f->anticollapse_needed; - block->energy[i] = FFMAX(-9.0f, block->energy[i]) * alpha + prev[j] + value; - prev[j] += beta * value; - } - } -} + int update_lowband = 1; + int lowband_offset = 0; -static void celt_decode_fine_energy(CeltFrame *f, OpusRangeCoder *rc) -{ - int i; - for (i = f->start_band; i < f->end_band; i++) { - int j; - if (!f->fine_bits[i]) - continue; - - for (j = 0; j < f->channels; j++) { - CeltBlock *block = &f->block[j]; - int q2; - float offset; - q2 = ff_opus_rc_get_raw(rc, f->fine_bits[i]); - offset = (q2 + 0.5f) * (1 << (14 - f->fine_bits[i])) / 16384.0f - 0.5f; - block->energy[i] += offset; - } - } -} - -static void celt_decode_final_energy(CeltFrame *f, OpusRangeCoder *rc) -{ - int priority, i, j; - int bits_left = f->framebits - opus_rc_tell(rc); + int i, j; - for (priority = 0; priority < 2; priority++) { - for (i = f->start_band; i < f->end_band && bits_left >= f->channels; i++) { - if (f->fine_priority[i] != priority || f->fine_bits[i] >= CELT_MAX_FINE_BITS) - continue; - - for (j = 0; j < f->channels; j++) { - int q2; - float offset; - q2 = ff_opus_rc_get_raw(rc, 1); - offset = (q2 - 0.5f) * (1 << (14 - f->fine_bits[i] - 1)) / 16384.0f; - f->block[j].energy[i] += offset; - bits_left--; + for (i = f->start_band; i < f->end_band; i++) { + uint32_t cm[2] = { (1 << f->blocks) - 1, (1 << f->blocks) - 1 }; + int band_offset = ff_celt_freq_bands[i] << f->size; + int band_size = ff_celt_freq_range[i] << f->size; + float *X = f->block[0].coeffs + band_offset; + float *Y = (f->channels == 2) ? f->block[1].coeffs + band_offset : NULL; + float *norm_loc1, *norm_loc2; + + int consumed = opus_rc_tell_frac(rc); + int effective_lowband = -1; + int b = 0; + + /* Compute how many bits we want to allocate to this band */ + if (i != f->start_band) + f->remaining -= consumed; + f->remaining2 = totalbits - consumed - 1; + if (i <= f->coded_bands - 1) { + int curr_balance = f->remaining / FFMIN(3, f->coded_bands-i); + b = av_clip_uintp2(FFMIN(f->remaining2 + 1, f->pulses[i] + curr_balance), 14); + } + + if ((ff_celt_freq_bands[i] - ff_celt_freq_range[i] >= ff_celt_freq_bands[f->start_band] || + i == f->start_band + 1) && (update_lowband || lowband_offset == 0)) + lowband_offset = i; + + if (i == f->start_band + 1) { + /* Special Hybrid Folding (RFC 8251 section 9). Copy the first band into + the second to ensure the second band never has to use the LCG. */ + int count = (ff_celt_freq_range[i] - ff_celt_freq_range[i-1]) << f->size; + + memcpy(&norm1[band_offset], &norm1[band_offset - count], count * sizeof(float)); + + if (f->channels == 2) + memcpy(&norm2[band_offset], &norm2[band_offset - count], count * sizeof(float)); + } + + /* Get a conservative estimate of the collapse_mask's for the bands we're + going to be folding from. */ + if (lowband_offset != 0 && (f->spread != CELT_SPREAD_AGGRESSIVE || + f->blocks > 1 || f->tf_change[i] < 0)) { + int foldstart, foldend; + + /* This ensures we never repeat spectral content within one band */ + effective_lowband = FFMAX(ff_celt_freq_bands[f->start_band], + ff_celt_freq_bands[lowband_offset] - ff_celt_freq_range[i]); + foldstart = lowband_offset; + while (ff_celt_freq_bands[--foldstart] > effective_lowband); + foldend = lowband_offset - 1; + while (++foldend < i && ff_celt_freq_bands[foldend] < effective_lowband + ff_celt_freq_range[i]); + + cm[0] = cm[1] = 0; + for (j = foldstart; j < foldend; j++) { + cm[0] |= f->block[0].collapse_masks[j]; + cm[1] |= f->block[f->channels - 1].collapse_masks[j]; } } - } -} -static void celt_decode_tf_changes(CeltFrame *f, OpusRangeCoder *rc) -{ - int i, diff = 0, tf_select = 0, tf_changed = 0, tf_select_bit; - int consumed, bits = f->transient ? 2 : 4; + if (f->dual_stereo && i == f->intensity_stereo) { + /* Switch off dual stereo to do intensity */ + f->dual_stereo = 0; + for (j = ff_celt_freq_bands[f->start_band] << f->size; j < band_offset; j++) + norm1[j] = (norm1[j] + norm2[j]) / 2; + } + + norm_loc1 = effective_lowband != -1 ? norm1 + (effective_lowband << f->size) : NULL; + norm_loc2 = effective_lowband != -1 ? norm2 + (effective_lowband << f->size) : NULL; + + if (f->dual_stereo) { + cm[0] = f->pvq->quant_band(f->pvq, f, rc, i, X, NULL, band_size, b >> 1, + f->blocks, norm_loc1, f->size, + norm1 + band_offset, 0, 1.0f, + lowband_scratch, cm[0]); + + cm[1] = f->pvq->quant_band(f->pvq, f, rc, i, Y, NULL, band_size, b >> 1, + f->blocks, norm_loc2, f->size, + norm2 + band_offset, 0, 1.0f, + lowband_scratch, cm[1]); + } else { + cm[0] = f->pvq->quant_band(f->pvq, f, rc, i, X, Y, band_size, b >> 0, + f->blocks, norm_loc1, f->size, + norm1 + band_offset, 0, 1.0f, + lowband_scratch, cm[0] | cm[1]); + cm[1] = cm[0]; + } - consumed = opus_rc_tell(rc); - tf_select_bit = (f->size != 0 && consumed+bits+1 <= f->framebits); + f->block[0].collapse_masks[i] = (uint8_t)cm[0]; + f->block[f->channels - 1].collapse_masks[i] = (uint8_t)cm[1]; + f->remaining += f->pulses[i] + consumed; - for (i = f->start_band; i < f->end_band; i++) { - if (consumed+bits+tf_select_bit <= f->framebits) { - diff ^= ff_opus_rc_dec_log(rc, bits); - consumed = opus_rc_tell(rc); - tf_changed |= diff; - } - f->tf_change[i] = diff; - bits = f->transient ? 4 : 5; - } - - if (tf_select_bit && ff_celt_tf_select[f->size][f->transient][0][tf_changed] != - ff_celt_tf_select[f->size][f->transient][1][tf_changed]) - tf_select = ff_opus_rc_dec_log(rc, 1); - - for (i = f->start_band; i < f->end_band; i++) { - f->tf_change[i] = ff_celt_tf_select[f->size][f->transient][tf_select][f->tf_change[i]]; + /* Update the folding position only as long as we have 1 bit/sample depth */ + update_lowband = (b > band_size << 3); } } -static void celt_denormalize(CeltFrame *f, CeltBlock *block, float *data) -{ - int i, j; - - for (i = f->start_band; i < f->end_band; i++) { - float *dst = data + (ff_celt_freq_bands[i] << f->size); - float log_norm = block->energy[i] + ff_celt_mean_energy[i]; - float norm = exp2f(FFMIN(log_norm, 32.0f)); - - for (j = 0; j < ff_celt_freq_range[i] << f->size; j++) - dst[j] *= norm; - } -} +#define NORMC(bits) ((bits) << (f->channels - 1) << f->size >> 2) -static void celt_postfilter_apply_transition(CeltBlock *block, float *data) +void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode) { - const int T0 = block->pf_period_old; - const int T1 = block->pf_period; + int i, j, low, high, total, done, bandbits, remaining, tbits_8ths; + int skip_startband = f->start_band; + int skip_bit = 0; + int intensitystereo_bit = 0; + int dualstereo_bit = 0; + int dynalloc = 6; + int extrabits = 0; - float g00, g01, g02; - float g10, g11, g12; + int boost[CELT_MAX_BANDS] = { 0 }; + int trim_offset[CELT_MAX_BANDS]; + int threshold[CELT_MAX_BANDS]; + int bits1[CELT_MAX_BANDS]; + int bits2[CELT_MAX_BANDS]; - float x0, x1, x2, x3, x4; - - int i; - - if (block->pf_gains[0] == 0.0 && - block->pf_gains_old[0] == 0.0) - return; - - g00 = block->pf_gains_old[0]; - g01 = block->pf_gains_old[1]; - g02 = block->pf_gains_old[2]; - g10 = block->pf_gains[0]; - g11 = block->pf_gains[1]; - g12 = block->pf_gains[2]; - - x1 = data[-T1 + 1]; - x2 = data[-T1]; - x3 = data[-T1 - 1]; - x4 = data[-T1 - 2]; - - for (i = 0; i < CELT_OVERLAP; i++) { - float w = ff_celt_window2[i]; - x0 = data[i - T1 + 2]; - - data[i] += (1.0 - w) * g00 * data[i - T0] + - (1.0 - w) * g01 * (data[i - T0 - 1] + data[i - T0 + 1]) + - (1.0 - w) * g02 * (data[i - T0 - 2] + data[i - T0 + 2]) + - w * g10 * x2 + - w * g11 * (x1 + x3) + - w * g12 * (x0 + x4); - x4 = x3; - x3 = x2; - x2 = x1; - x1 = x0; + /* Spread */ + if (opus_rc_tell(rc) + 4 <= f->framebits) { + if (encode) + ff_opus_rc_enc_cdf(rc, f->spread, ff_celt_model_spread); + else + f->spread = ff_opus_rc_dec_cdf(rc, ff_celt_model_spread); + } else { + f->spread = CELT_SPREAD_NORMAL; } -} - -static void celt_postfilter(CeltFrame *f, CeltBlock *block) -{ - int len = f->blocksize * f->blocks; - const int filter_len = len - 2 * CELT_OVERLAP; - - celt_postfilter_apply_transition(block, block->buf + 1024); - block->pf_period_old = block->pf_period; - memcpy(block->pf_gains_old, block->pf_gains, sizeof(block->pf_gains)); + /* Initialize static allocation caps */ + for (i = 0; i < CELT_MAX_BANDS; i++) + f->caps[i] = NORMC((ff_celt_static_caps[f->size][f->channels - 1][i] + 64) * ff_celt_freq_range[i]); - block->pf_period = block->pf_period_new; - memcpy(block->pf_gains, block->pf_gains_new, sizeof(block->pf_gains)); - - if (len > CELT_OVERLAP) { - celt_postfilter_apply_transition(block, block->buf + 1024 + CELT_OVERLAP); - - if (block->pf_gains[0] > FLT_EPSILON && filter_len > 0) - f->opusdsp.postfilter(block->buf + 1024 + 2 * CELT_OVERLAP, - block->pf_period, block->pf_gains, - filter_len); - - block->pf_period_old = block->pf_period; - memcpy(block->pf_gains_old, block->pf_gains, sizeof(block->pf_gains)); - } + /* Band boosts */ + tbits_8ths = f->framebits << 3; + for (i = f->start_band; i < f->end_band; i++) { + int quanta = ff_celt_freq_range[i] << (f->channels - 1) << f->size; + int b_dynalloc = dynalloc; + int boost_amount = f->alloc_boost[i]; + quanta = FFMIN(quanta << 3, FFMAX(6 << 3, quanta)); + + while (opus_rc_tell_frac(rc) + (b_dynalloc << 3) < tbits_8ths && boost[i] < f->caps[i]) { + int is_boost; + if (encode) { + is_boost = boost_amount--; + ff_opus_rc_enc_log(rc, is_boost, b_dynalloc); + } else { + is_boost = ff_opus_rc_dec_log(rc, b_dynalloc); + } - memmove(block->buf, block->buf + len, (1024 + CELT_OVERLAP / 2) * sizeof(float)); -} + if (!is_boost) + break; -static int parse_postfilter(CeltFrame *f, OpusRangeCoder *rc, int consumed) -{ - int i; + boost[i] += quanta; + tbits_8ths -= quanta; - memset(f->block[0].pf_gains_new, 0, sizeof(f->block[0].pf_gains_new)); - memset(f->block[1].pf_gains_new, 0, sizeof(f->block[1].pf_gains_new)); + b_dynalloc = 1; + } - if (f->start_band == 0 && consumed + 16 <= f->framebits) { - int has_postfilter = ff_opus_rc_dec_log(rc, 1); - if (has_postfilter) { - float gain; - int tapset, octave, period; - - octave = ff_opus_rc_dec_uint(rc, 6); - period = (16 << octave) + ff_opus_rc_get_raw(rc, 4 + octave) - 1; - gain = 0.09375f * (ff_opus_rc_get_raw(rc, 3) + 1); - tapset = (opus_rc_tell(rc) + 2 <= f->framebits) ? - ff_opus_rc_dec_cdf(rc, ff_celt_model_tapset) : 0; - - for (i = 0; i < 2; i++) { - CeltBlock *block = &f->block[i]; - - block->pf_period_new = FFMAX(period, CELT_POSTFILTER_MINPERIOD); - block->pf_gains_new[0] = gain * ff_celt_postfilter_taps[tapset][0]; - block->pf_gains_new[1] = gain * ff_celt_postfilter_taps[tapset][1]; - block->pf_gains_new[2] = gain * ff_celt_postfilter_taps[tapset][2]; + if (boost[i]) + dynalloc = FFMAX(dynalloc - 1, 2); + } + + /* Allocation trim */ + if (!encode) + f->alloc_trim = 5; + if (opus_rc_tell_frac(rc) + (6 << 3) <= tbits_8ths) + if (encode) + ff_opus_rc_enc_cdf(rc, f->alloc_trim, ff_celt_model_alloc_trim); + else + f->alloc_trim = ff_opus_rc_dec_cdf(rc, ff_celt_model_alloc_trim); + + /* Anti-collapse bit reservation */ + tbits_8ths = (f->framebits << 3) - opus_rc_tell_frac(rc) - 1; + f->anticollapse_needed = 0; + if (f->transient && f->size >= 2 && tbits_8ths >= ((f->size + 2) << 3)) + f->anticollapse_needed = 1 << 3; + tbits_8ths -= f->anticollapse_needed; + + /* Band skip bit reservation */ + if (tbits_8ths >= 1 << 3) + skip_bit = 1 << 3; + tbits_8ths -= skip_bit; + + /* Intensity/dual stereo bit reservation */ + if (f->channels == 2) { + intensitystereo_bit = ff_celt_log2_frac[f->end_band - f->start_band]; + if (intensitystereo_bit <= tbits_8ths) { + tbits_8ths -= intensitystereo_bit; + if (tbits_8ths >= 1 << 3) { + dualstereo_bit = 1 << 3; + tbits_8ths -= 1 << 3; } + } else { + intensitystereo_bit = 0; } - - consumed = opus_rc_tell(rc); } - return consumed; -} - -static void process_anticollapse(CeltFrame *f, CeltBlock *block, float *X) -{ - int i, j, k; - + /* Trim offsets */ for (i = f->start_band; i < f->end_band; i++) { - int renormalize = 0; - float *xptr; - float prev[2]; - float Ediff, r; - float thresh, sqrt_1; - int depth; - - /* depth in 1/8 bits */ - depth = (1 + f->pulses[i]) / (ff_celt_freq_range[i] << f->size); - thresh = exp2f(-1.0 - 0.125f * depth); - sqrt_1 = 1.0f / sqrtf(ff_celt_freq_range[i] << f->size); - - xptr = X + (ff_celt_freq_bands[i] << f->size); - - prev[0] = block->prev_energy[0][i]; - prev[1] = block->prev_energy[1][i]; - if (f->channels == 1) { - CeltBlock *block1 = &f->block[1]; - - prev[0] = FFMAX(prev[0], block1->prev_energy[0][i]); - prev[1] = FFMAX(prev[1], block1->prev_energy[1][i]); - } - Ediff = block->energy[i] - FFMIN(prev[0], prev[1]); - Ediff = FFMAX(0, Ediff); - - /* r needs to be multiplied by 2 or 2*sqrt(2) depending on LM because - short blocks don't have the same energy as long */ - r = exp2f(1 - Ediff); - if (f->size == 3) - r *= M_SQRT2; - r = FFMIN(thresh, r) * sqrt_1; - for (k = 0; k < 1 << f->size; k++) { - /* Detect collapse */ - if (!(block->collapse_masks[i] & 1 << k)) { - /* Fill with noise */ - for (j = 0; j < ff_celt_freq_range[i]; j++) - xptr[(j << f->size) + k] = (celt_rng(f) & 0x8000) ? r : -r; - renormalize = 1; + int trim = f->alloc_trim - 5 - f->size; + int band = ff_celt_freq_range[i] * (f->end_band - i - 1); + int duration = f->size + 3; + int scale = duration + f->channels - 1; + + /* PVQ minimum allocation threshold, below this value the band is + * skipped */ + threshold[i] = FFMAX(3 * ff_celt_freq_range[i] << duration >> 4, + f->channels << 3); + + trim_offset[i] = trim * (band << scale) >> 6; + + if (ff_celt_freq_range[i] << f->size == 1) + trim_offset[i] -= f->channels << 3; + } + + /* Bisection */ + low = 1; + high = CELT_VECTORS - 1; + while (low <= high) { + int center = (low + high) >> 1; + done = total = 0; + + for (i = f->end_band - 1; i >= f->start_band; i--) { + bandbits = NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[center][i]); + + if (bandbits) + bandbits = FFMAX(bandbits + trim_offset[i], 0); + bandbits += boost[i]; + + if (bandbits >= threshold[i] || done) { + done = 1; + total += FFMIN(bandbits, f->caps[i]); + } else if (bandbits >= f->channels << 3) { + total += f->channels << 3; } } - /* We just added some energy, so we need to renormalize */ - if (renormalize) - celt_renormalize_vector(xptr, ff_celt_freq_range[i] << f->size, 1.0f); - } -} - -int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, - float **output, int channels, int frame_size, - int start_band, int end_band) -{ - int i, j, downmix = 0; - int consumed; // bits of entropy consumed thus far for this frame - MDCT15Context *imdct; - - if (channels != 1 && channels != 2) { - av_log(f->avctx, AV_LOG_ERROR, "Invalid number of coded channels: %d\n", - channels); - return AVERROR_INVALIDDATA; - } - if (start_band < 0 || start_band > end_band || end_band > CELT_MAX_BANDS) { - av_log(f->avctx, AV_LOG_ERROR, "Invalid start/end band: %d %d\n", - start_band, end_band); - return AVERROR_INVALIDDATA; + if (total > tbits_8ths) + high = center - 1; + else + low = center + 1; } + high = low--; - f->silence = 0; - f->transient = 0; - f->anticollapse = 0; - f->flushed = 0; - f->channels = channels; - f->start_band = start_band; - f->end_band = end_band; - f->framebits = rc->rb.bytes * 8; - - f->size = av_log2(frame_size / CELT_SHORT_BLOCKSIZE); - if (f->size > CELT_MAX_LOG_BLOCKS || - frame_size != CELT_SHORT_BLOCKSIZE * (1 << f->size)) { - av_log(f->avctx, AV_LOG_ERROR, "Invalid CELT frame size: %d\n", - frame_size); - return AVERROR_INVALIDDATA; - } - - if (!f->output_channels) - f->output_channels = channels; - - for (i = 0; i < f->channels; i++) { - memset(f->block[i].coeffs, 0, sizeof(f->block[i].coeffs)); - memset(f->block[i].collapse_masks, 0, sizeof(f->block[i].collapse_masks)); - } - - consumed = opus_rc_tell(rc); - - /* obtain silence flag */ - if (consumed >= f->framebits) - f->silence = 1; - else if (consumed == 1) - f->silence = ff_opus_rc_dec_log(rc, 15); - - - if (f->silence) { - consumed = f->framebits; - rc->total_bits += f->framebits - opus_rc_tell(rc); - } - - /* obtain post-filter options */ - consumed = parse_postfilter(f, rc, consumed); - - /* obtain transient flag */ - if (f->size != 0 && consumed+3 <= f->framebits) - f->transient = ff_opus_rc_dec_log(rc, 3); - - f->blocks = f->transient ? 1 << f->size : 1; - f->blocksize = frame_size / f->blocks; - - imdct = f->imdct[f->transient ? 0 : f->size]; - - if (channels == 1) { - for (i = 0; i < CELT_MAX_BANDS; i++) - f->block[0].energy[i] = FFMAX(f->block[0].energy[i], f->block[1].energy[i]); - } - - celt_decode_coarse_energy(f, rc); - celt_decode_tf_changes (f, rc); - ff_celt_bitalloc (f, rc, 0); - celt_decode_fine_energy (f, rc); - ff_celt_quant_bands (f, rc); - - if (f->anticollapse_needed) - f->anticollapse = ff_opus_rc_get_raw(rc, 1); - - celt_decode_final_energy(f, rc); - - /* apply anti-collapse processing and denormalization to - * each coded channel */ - for (i = 0; i < f->channels; i++) { - CeltBlock *block = &f->block[i]; - - if (f->anticollapse) - process_anticollapse(f, block, f->block[i].coeffs); - - celt_denormalize(f, block, f->block[i].coeffs); - } - - /* stereo -> mono downmix */ - if (f->output_channels < f->channels) { - f->dsp->vector_fmac_scalar(f->block[0].coeffs, f->block[1].coeffs, 1.0, FFALIGN(frame_size, 16)); - downmix = 1; - } else if (f->output_channels > f->channels) - memcpy(f->block[1].coeffs, f->block[0].coeffs, frame_size * sizeof(float)); - - if (f->silence) { - for (i = 0; i < 2; i++) { - CeltBlock *block = &f->block[i]; - - for (j = 0; j < FF_ARRAY_ELEMS(block->energy); j++) - block->energy[j] = CELT_ENERGY_SILENCE; - } - memset(f->block[0].coeffs, 0, sizeof(f->block[0].coeffs)); - memset(f->block[1].coeffs, 0, sizeof(f->block[1].coeffs)); - } - - /* transform and output for each output channel */ - for (i = 0; i < f->output_channels; i++) { - CeltBlock *block = &f->block[i]; + /* Bisection */ + for (i = f->start_band; i < f->end_band; i++) { + bits1[i] = NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[low][i]); + bits2[i] = high >= CELT_VECTORS ? f->caps[i] : + NORMC(ff_celt_freq_range[i] * ff_celt_static_alloc[high][i]); + + if (bits1[i]) + bits1[i] = FFMAX(bits1[i] + trim_offset[i], 0); + if (bits2[i]) + bits2[i] = FFMAX(bits2[i] + trim_offset[i], 0); + + if (low) + bits1[i] += boost[i]; + bits2[i] += boost[i]; + + if (boost[i]) + skip_startband = i; + bits2[i] = FFMAX(bits2[i] - bits1[i], 0); + } + + /* Bisection */ + low = 0; + high = 1 << CELT_ALLOC_STEPS; + for (i = 0; i < CELT_ALLOC_STEPS; i++) { + int center = (low + high) >> 1; + done = total = 0; + + for (j = f->end_band - 1; j >= f->start_band; j--) { + bandbits = bits1[j] + (center * bits2[j] >> CELT_ALLOC_STEPS); + + if (bandbits >= threshold[j] || done) { + done = 1; + total += FFMIN(bandbits, f->caps[j]); + } else if (bandbits >= f->channels << 3) + total += f->channels << 3; + } + if (total > tbits_8ths) + high = center; + else + low = center; + } + + /* Bisection */ + done = total = 0; + for (i = f->end_band - 1; i >= f->start_band; i--) { + bandbits = bits1[i] + (low * bits2[i] >> CELT_ALLOC_STEPS); + + if (bandbits >= threshold[i] || done) + done = 1; + else + bandbits = (bandbits >= f->channels << 3) ? + f->channels << 3 : 0; + + bandbits = FFMIN(bandbits, f->caps[i]); + f->pulses[i] = bandbits; + total += bandbits; + } + + /* Band skipping */ + for (f->coded_bands = f->end_band; ; f->coded_bands--) { + int allocation; + j = f->coded_bands - 1; + + if (j == skip_startband) { + /* all remaining bands are not skipped */ + tbits_8ths += skip_bit; + break; + } + + /* determine the number of bits available for coding "do not skip" markers */ + remaining = tbits_8ths - total; + bandbits = remaining / (ff_celt_freq_bands[j+1] - ff_celt_freq_bands[f->start_band]); + remaining -= bandbits * (ff_celt_freq_bands[j+1] - ff_celt_freq_bands[f->start_band]); + allocation = f->pulses[j] + bandbits * ff_celt_freq_range[j]; + allocation += FFMAX(remaining - (ff_celt_freq_bands[j] - ff_celt_freq_bands[f->start_band]), 0); + + /* a "do not skip" marker is only coded if the allocation is + * above the chosen threshold */ + if (allocation >= FFMAX(threshold[j], (f->channels + 1) << 3)) { + int do_not_skip; + if (encode) { + do_not_skip = f->coded_bands <= f->skip_band_floor; + ff_opus_rc_enc_log(rc, do_not_skip, 1); + } else { + do_not_skip = ff_opus_rc_dec_log(rc, 1); + } - /* iMDCT and overlap-add */ - for (j = 0; j < f->blocks; j++) { - float *dst = block->buf + 1024 + j * f->blocksize; + if (do_not_skip) + break; - imdct->imdct_half(imdct, dst + CELT_OVERLAP / 2, f->block[i].coeffs + j, - f->blocks); - f->dsp->vector_fmul_window(dst, dst, dst + CELT_OVERLAP / 2, - ff_celt_window, CELT_OVERLAP / 2); + total += 1 << 3; + allocation -= 1 << 3; } - if (downmix) - f->dsp->vector_fmul_scalar(&block->buf[1024], &block->buf[1024], 0.5f, frame_size); - - /* postfilter */ - celt_postfilter(f, block); - - /* deemphasis */ - block->emph_coeff = f->opusdsp.deemphasis(output[i], - &block->buf[1024 - frame_size], - block->emph_coeff, frame_size); - } + /* the band is skipped, so reclaim its bits */ + total -= f->pulses[j]; + if (intensitystereo_bit) { + total -= intensitystereo_bit; + intensitystereo_bit = ff_celt_log2_frac[j - f->start_band]; + total += intensitystereo_bit; + } + + total += f->pulses[j] = (allocation >= f->channels << 3) ? f->channels << 3 : 0; + } + + /* IS start band */ + if (encode) { + if (intensitystereo_bit) { + f->intensity_stereo = FFMIN(f->intensity_stereo, f->coded_bands); + ff_opus_rc_enc_uint(rc, f->intensity_stereo, f->coded_bands + 1 - f->start_band); + } + } else { + f->intensity_stereo = f->dual_stereo = 0; + if (intensitystereo_bit) + f->intensity_stereo = f->start_band + ff_opus_rc_dec_uint(rc, f->coded_bands + 1 - f->start_band); + } + + /* DS flag */ + if (f->intensity_stereo <= f->start_band) + tbits_8ths += dualstereo_bit; /* no intensity stereo means no dual stereo */ + else if (dualstereo_bit) + if (encode) + ff_opus_rc_enc_log(rc, f->dual_stereo, 1); + else + f->dual_stereo = ff_opus_rc_dec_log(rc, 1); + + /* Supply the remaining bits in this frame to lower bands */ + remaining = tbits_8ths - total; + bandbits = remaining / (ff_celt_freq_bands[f->coded_bands] - ff_celt_freq_bands[f->start_band]); + remaining -= bandbits * (ff_celt_freq_bands[f->coded_bands] - ff_celt_freq_bands[f->start_band]); + for (i = f->start_band; i < f->coded_bands; i++) { + const int bits = FFMIN(remaining, ff_celt_freq_range[i]); + f->pulses[i] += bits + bandbits * ff_celt_freq_range[i]; + remaining -= bits; + } + + /* Finally determine the allocation */ + for (i = f->start_band; i < f->coded_bands; i++) { + int N = ff_celt_freq_range[i] << f->size; + int prev_extra = extrabits; + f->pulses[i] += extrabits; + + if (N > 1) { + int dof; /* degrees of freedom */ + int temp; /* dof * channels * log(dof) */ + int fine_bits; + int max_bits; + int offset; /* fine energy quantization offset, i.e. + * extra bits assigned over the standard + * totalbits/dof */ + + extrabits = FFMAX(f->pulses[i] - f->caps[i], 0); + f->pulses[i] -= extrabits; + + /* intensity stereo makes use of an extra degree of freedom */ + dof = N * f->channels + (f->channels == 2 && N > 2 && !f->dual_stereo && i < f->intensity_stereo); + temp = dof * (ff_celt_log_freq_range[i] + (f->size << 3)); + offset = (temp >> 1) - dof * CELT_FINE_OFFSET; + if (N == 2) /* dof=2 is the only case that doesn't fit the model */ + offset += dof << 1; + + /* grant an additional bias for the first and second pulses */ + if (f->pulses[i] + offset < 2 * (dof << 3)) + offset += temp >> 2; + else if (f->pulses[i] + offset < 3 * (dof << 3)) + offset += temp >> 3; + + fine_bits = (f->pulses[i] + offset + (dof << 2)) / (dof << 3); + max_bits = FFMIN((f->pulses[i] >> 3) >> (f->channels - 1), CELT_MAX_FINE_BITS); + max_bits = FFMAX(max_bits, 0); + f->fine_bits[i] = av_clip(fine_bits, 0, max_bits); + + /* If fine_bits was rounded down or capped, + * give priority for the final fine energy pass */ + f->fine_priority[i] = (f->fine_bits[i] * (dof << 3) >= f->pulses[i] + offset); - if (channels == 1) - memcpy(f->block[1].energy, f->block[0].energy, sizeof(f->block[0].energy)); - - for (i = 0; i < 2; i++ ) { - CeltBlock *block = &f->block[i]; - - if (!f->transient) { - memcpy(block->prev_energy[1], block->prev_energy[0], sizeof(block->prev_energy[0])); - memcpy(block->prev_energy[0], block->energy, sizeof(block->prev_energy[0])); + /* the remaining bits are assigned to PVQ */ + f->pulses[i] -= f->fine_bits[i] << (f->channels - 1) << 3; } else { - for (j = 0; j < CELT_MAX_BANDS; j++) - block->prev_energy[0][j] = FFMIN(block->prev_energy[0][j], block->energy[j]); - } - - for (j = 0; j < f->start_band; j++) { - block->prev_energy[0][j] = CELT_ENERGY_SILENCE; - block->energy[j] = 0.0; - } - for (j = f->end_band; j < CELT_MAX_BANDS; j++) { - block->prev_energy[0][j] = CELT_ENERGY_SILENCE; - block->energy[j] = 0.0; - } + /* all bits go to fine energy except for the sign bit */ + extrabits = FFMAX(f->pulses[i] - (f->channels << 3), 0); + f->pulses[i] -= extrabits; + f->fine_bits[i] = 0; + f->fine_priority[i] = 1; + } + + /* hand back a limited number of extra fine energy bits to this band */ + if (extrabits > 0) { + int fineextra = FFMIN(extrabits >> (f->channels + 2), + CELT_MAX_FINE_BITS - f->fine_bits[i]); + f->fine_bits[i] += fineextra; + + fineextra <<= f->channels + 2; + f->fine_priority[i] = (fineextra >= extrabits - prev_extra); + extrabits -= fineextra; + } + } + f->remaining = extrabits; + + /* skipped bands dedicate all of their bits for fine energy */ + for (; i < f->end_band; i++) { + f->fine_bits[i] = f->pulses[i] >> (f->channels - 1) >> 3; + f->pulses[i] = 0; + f->fine_priority[i] = f->fine_bits[i] < 1; } - - f->seed = rc->range; - - return 0; -} - -void ff_celt_flush(CeltFrame *f) -{ - int i, j; - - if (f->flushed) - return; - - for (i = 0; i < 2; i++) { - CeltBlock *block = &f->block[i]; - - for (j = 0; j < CELT_MAX_BANDS; j++) - block->prev_energy[0][j] = block->prev_energy[1][j] = CELT_ENERGY_SILENCE; - - memset(block->energy, 0, sizeof(block->energy)); - memset(block->buf, 0, sizeof(block->buf)); - - memset(block->pf_gains, 0, sizeof(block->pf_gains)); - memset(block->pf_gains_old, 0, sizeof(block->pf_gains_old)); - memset(block->pf_gains_new, 0, sizeof(block->pf_gains_new)); - - /* libopus uses CELT_EMPH_COEFF on init, but 0 is better since there's - * a lesser discontinuity when seeking. - * The deemphasis functions differ from libopus in that they require - * an initial state divided by the coefficient. */ - block->emph_coeff = 0.0f / CELT_EMPH_COEFF; - } - f->seed = 0; - - f->flushed = 1; -} - -void ff_celt_free(CeltFrame **f) -{ - CeltFrame *frm = *f; - int i; - - if (!frm) - return; - - for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++) - ff_mdct15_uninit(&frm->imdct[i]); - - ff_celt_pvq_uninit(&frm->pvq); - - av_freep(&frm->dsp); - av_freep(f); -} - -int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels, - int apply_phase_inv) -{ - CeltFrame *frm; - int i, ret; - - if (output_channels != 1 && output_channels != 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", - output_channels); - return AVERROR(EINVAL); - } - - frm = av_mallocz(sizeof(*frm)); - if (!frm) - return AVERROR(ENOMEM); - - frm->avctx = avctx; - frm->output_channels = output_channels; - frm->apply_phase_inv = apply_phase_inv; - - for (i = 0; i < FF_ARRAY_ELEMS(frm->imdct); i++) - if ((ret = ff_mdct15_init(&frm->imdct[i], 1, i + 3, -1.0f/32768)) < 0) - goto fail; - - if ((ret = ff_celt_pvq_init(&frm->pvq, 0)) < 0) - goto fail; - - frm->dsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); - if (!frm->dsp) { - ret = AVERROR(ENOMEM); - goto fail; - } - - ff_opus_dsp_init(&frm->opusdsp); - ff_celt_flush(frm); - - *f = frm; - - return 0; -fail: - ff_celt_free(&frm); - return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_celt.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Opus decoder/demuxer common functions + * Opus decoder/encoder CELT functions * Copyright (c) 2012 Andrew D'Addesio * Copyright (c) 2013-2014 Mozilla Corporation * Copyright (c) 2016 Rostislav Pehlivanov @@ -24,16 +24,22 @@ #ifndef AVCODEC_OPUS_CELT_H #define AVCODEC_OPUS_CELT_H -#include +#include -#include "opus.h" -#include "opus_pvq.h" +#include "avcodec.h" #include "opusdsp.h" +#include "opus_rc.h" -#include "mdct15.h" #include "libavutil/float_dsp.h" #include "libavutil/libm.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#define CELT_SHORT_BLOCKSIZE 120 +#define CELT_OVERLAP CELT_SHORT_BLOCKSIZE +#define CELT_MAX_LOG_BLOCKS 3 +#define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS)) +#define CELT_MAX_BANDS 21 #define CELT_VECTORS 11 #define CELT_ALLOC_STEPS 6 @@ -45,8 +51,6 @@ #define CELT_POSTFILTER_MINPERIOD 15 #define CELT_ENERGY_SILENCE (-28.0f) -typedef struct CeltPVQ CeltPVQ; - enum CeltSpread { CELT_SPREAD_NONE, CELT_SPREAD_LIGHT, @@ -90,13 +94,14 @@ float emph_coeff; } CeltBlock; -struct CeltFrame { +typedef struct CeltFrame { // constant values that do not change during context lifetime AVCodecContext *avctx; - MDCT15Context *imdct[4]; + AVTXContext *tx[4]; + av_tx_fn tx_fn[4]; AVFloatDSPContext *dsp; CeltBlock block[2]; - CeltPVQ *pvq; + struct CeltPVQ *pvq; OpusDSP opusdsp; int channels; int output_channels; @@ -138,7 +143,7 @@ int fine_priority[CELT_MAX_BANDS]; int pulses [CELT_MAX_BANDS]; int tf_change [CELT_MAX_BANDS]; -}; +} CeltFrame; /* LCG for noise generation */ static av_always_inline uint32_t celt_rng(CeltFrame *f) @@ -169,4 +174,10 @@ int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, float **output, int coded_channels, int frame_size, int startband, int endband); +/* Encode or decode CELT bands */ +void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc); + +/* Encode or decode CELT bitallocation */ +void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode); + #endif /* AVCODEC_OPUS_CELT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,18 +38,23 @@ #include "libavutil/attributes.h" #include "libavutil/audio_fifo.h" #include "libavutil/channel_layout.h" +#include "libavutil/ffmath.h" +#include "libavutil/float_dsp.h" +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" #include "libavutil/opt.h" #include "libswresample/swresample.h" #include "avcodec.h" #include "codec_internal.h" -#include "get_bits.h" -#include "internal.h" -#include "mathops.h" +#include "decode.h" #include "opus.h" #include "opustab.h" #include "opus_celt.h" +#include "opus_parse.h" +#include "opus_rc.h" +#include "opus_silk.h" static const uint16_t silk_frame_duration_ms[16] = { 10, 20, 40, 60, @@ -65,6 +70,63 @@ 4, 8, 11, 11, 11 }; +typedef struct OpusStreamContext { + AVCodecContext *avctx; + int output_channels; + + /* number of decoded samples for this stream */ + int decoded_samples; + /* current output buffers for this stream */ + float *out[2]; + int out_size; + /* Buffer with samples from this stream for synchronizing + * the streams when they have different resampling delays */ + AVAudioFifo *sync_buffer; + + OpusRangeCoder rc; + OpusRangeCoder redundancy_rc; + SilkContext *silk; + CeltFrame *celt; + AVFloatDSPContext *fdsp; + + float silk_buf[2][960]; + float *silk_output[2]; + DECLARE_ALIGNED(32, float, celt_buf)[2][960]; + float *celt_output[2]; + + DECLARE_ALIGNED(32, float, redundancy_buf)[2][960]; + float *redundancy_output[2]; + + /* buffers for the next samples to be decoded */ + float *cur_out[2]; + int remaining_out_size; + + float *out_dummy; + int out_dummy_allocated_size; + + SwrContext *swr; + AVAudioFifo *celt_delay; + int silk_samplerate; + /* number of samples we still want to get from the resampler */ + int delayed_samples; + + OpusPacket packet; + + int redundancy_idx; +} OpusStreamContext; + +typedef struct OpusContext { + AVClass *av_class; + + struct OpusStreamContext *streams; + int apply_phase_inv; + + AVFloatDSPContext *fdsp; + float gain; + + OpusParseContext p; +} OpusContext; + static int get_silk_samplerate(int config) { if (config < 4) @@ -424,7 +486,7 @@ int i, ret; /* calculate the number of delayed samples */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; s->out[0] = s->out[1] = NULL; @@ -435,7 +497,7 @@ /* decode the header of the first sub-packet to find out the sample count */ if (buf) { OpusPacket *pkt = &c->streams[0].packet; - ret = ff_opus_parse_packet(pkt, buf, buf_size, c->nb_streams > 1); + ret = ff_opus_parse_packet(pkt, buf, buf_size, c->p.nb_streams > 1); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n"); return ret; @@ -459,13 +521,13 @@ frame->nb_samples = 0; for (i = 0; i < avctx->ch_layout.nb_channels; i++) { - ChannelMap *map = &c->channel_maps[i]; + ChannelMap *map = &c->p.channel_maps[i]; if (!map->copy) c->streams[map->stream_idx].out[map->channel_idx] = (float*)frame->extended_data[i]; } /* read the data from the sync buffers */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; float **out = s->out; int sync_size = av_audio_fifo_size(s->sync_buffer); @@ -497,11 +559,11 @@ } /* decode each sub-packet */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; if (i && buf) { - ret = ff_opus_parse_packet(&s->packet, buf, buf_size, i != c->nb_streams - 1); + ret = ff_opus_parse_packet(&s->packet, buf, buf_size, i != c->p.nb_streams - 1); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n"); return ret; @@ -527,7 +589,7 @@ } /* buffer the extra samples */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; int buffer_samples = s->decoded_samples - decoded_samples; if (buffer_samples) { @@ -542,7 +604,7 @@ } for (i = 0; i < avctx->ch_layout.nb_channels; i++) { - ChannelMap *map = &c->channel_maps[i]; + ChannelMap *map = &c->p.channel_maps[i]; /* handle copied channels */ if (map->copy) { @@ -553,7 +615,7 @@ memset(frame->extended_data[i], 0, frame->linesize[0]); } - if (c->gain_i && decoded_samples > 0) { + if (c->p.gain_i && decoded_samples > 0) { c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i], (float*)frame->extended_data[i], c->gain, FFALIGN(decoded_samples, 8)); @@ -569,9 +631,8 @@ static av_cold void opus_decode_flush(AVCodecContext *ctx) { OpusContext *c = ctx->priv_data; - int i; - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; memset(&s->packet, 0, sizeof(s->packet)); @@ -590,9 +651,8 @@ static av_cold int opus_decode_close(AVCodecContext *avctx) { OpusContext *c = avctx->priv_data; - int i; - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; ff_silk_free(&s->silk); @@ -608,9 +668,9 @@ av_freep(&c->streams); - c->nb_streams = 0; + c->p.nb_streams = 0; - av_freep(&c->channel_maps); + av_freep(&c->p.channel_maps); av_freep(&c->fdsp); return 0; @@ -619,7 +679,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) { OpusContext *c = avctx->priv_data; - int ret, i, j; + int ret; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->sample_rate = 48000; @@ -629,26 +689,28 @@ return AVERROR(ENOMEM); /* find out the channel configuration */ - ret = ff_opus_parse_extradata(avctx, c); + ret = ff_opus_parse_extradata(avctx, &c->p); if (ret < 0) return ret; + if (c->p.gain_i) + c->gain = ff_exp10(c->p.gain_i / (20.0 * 256)); /* allocate and init each independent decoder */ - c->streams = av_calloc(c->nb_streams, sizeof(*c->streams)); + c->streams = av_calloc(c->p.nb_streams, sizeof(*c->streams)); if (!c->streams) { - c->nb_streams = 0; + c->p.nb_streams = 0; return AVERROR(ENOMEM); } - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; - uint64_t layout; + AVChannelLayout layout; - s->output_channels = (i < c->nb_stereo_streams) ? 2 : 1; + s->output_channels = (i < c->p.nb_stereo_streams) ? 2 : 1; s->avctx = avctx; - for (j = 0; j < s->output_channels; j++) { + for (int j = 0; j < s->output_channels; j++) { s->silk_output[j] = s->silk_buf[j]; s->celt_output[j] = s->celt_buf[j]; s->redundancy_output[j] = s->redundancy_buf[j]; @@ -660,11 +722,12 @@ if (!s->swr) return AVERROR(ENOMEM); - layout = (s->output_channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO; + layout = (s->output_channels == 1) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO : + (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; av_opt_set_int(s->swr, "in_sample_fmt", avctx->sample_fmt, 0); av_opt_set_int(s->swr, "out_sample_fmt", avctx->sample_fmt, 0); - av_opt_set_int(s->swr, "in_channel_layout", layout, 0); - av_opt_set_int(s->swr, "out_channel_layout", layout, 0); + av_opt_set_chlayout(s->swr, "in_chlayout", &layout, 0); + av_opt_set_chlayout(s->swr, "out_chlayout", &layout, 0); av_opt_set_int(s->swr, "out_sample_rate", avctx->sample_rate, 0); av_opt_set_int(s->swr, "filter_size", 16, 0); @@ -706,7 +769,7 @@ const FFCodec ff_opus_decoder = { .p.name = "opus", - .p.long_name = NULL_IF_CONFIG_SMALL("Opus"), + CODEC_LONG_NAME("Opus"), .p.priv_class = &opus_class, .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_OPUS, @@ -716,5 +779,5 @@ FF_CODEC_DECODE_CB(opus_decode_packet), .flush = opus_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec_celt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec_celt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec_celt.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdec_celt.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * Copyright (c) 2016 Rostislav Pehlivanov + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Opus CELT decoder + */ + +#include + +#include "opus_celt.h" +#include "opustab.h" +#include "opus_pvq.h" + +/* Use the 2D z-transform to apply prediction in both the time domain (alpha) + * and the frequency domain (beta) */ +static void celt_decode_coarse_energy(CeltFrame *f, OpusRangeCoder *rc) +{ + int i, j; + float prev[2] = { 0 }; + float alpha = ff_celt_alpha_coef[f->size]; + float beta = ff_celt_beta_coef[f->size]; + const uint8_t *model = ff_celt_coarse_energy_dist[f->size][0]; + + /* intra frame */ + if (opus_rc_tell(rc) + 3 <= f->framebits && ff_opus_rc_dec_log(rc, 3)) { + alpha = 0.0f; + beta = 1.0f - (4915.0f/32768.0f); + model = ff_celt_coarse_energy_dist[f->size][1]; + } + + for (i = 0; i < CELT_MAX_BANDS; i++) { + for (j = 0; j < f->channels; j++) { + CeltBlock *block = &f->block[j]; + float value; + int available; + + if (i < f->start_band || i >= f->end_band) { + block->energy[i] = 0.0; + continue; + } + + available = f->framebits - opus_rc_tell(rc); + if (available >= 15) { + /* decode using a Laplace distribution */ + int k = FFMIN(i, 20) << 1; + value = ff_opus_rc_dec_laplace(rc, model[k] << 7, model[k+1] << 6); + } else if (available >= 2) { + int x = ff_opus_rc_dec_cdf(rc, ff_celt_model_energy_small); + value = (x>>1) ^ -(x&1); + } else if (available >= 1) { + value = -(float)ff_opus_rc_dec_log(rc, 1); + } else value = -1; + + block->energy[i] = FFMAX(-9.0f, block->energy[i]) * alpha + prev[j] + value; + prev[j] += beta * value; + } + } +} + +static void celt_decode_fine_energy(CeltFrame *f, OpusRangeCoder *rc) +{ + int i; + for (i = f->start_band; i < f->end_band; i++) { + int j; + if (!f->fine_bits[i]) + continue; + + for (j = 0; j < f->channels; j++) { + CeltBlock *block = &f->block[j]; + int q2; + float offset; + q2 = ff_opus_rc_get_raw(rc, f->fine_bits[i]); + offset = (q2 + 0.5f) * (1 << (14 - f->fine_bits[i])) / 16384.0f - 0.5f; + block->energy[i] += offset; + } + } +} + +static void celt_decode_final_energy(CeltFrame *f, OpusRangeCoder *rc) +{ + int priority, i, j; + int bits_left = f->framebits - opus_rc_tell(rc); + + for (priority = 0; priority < 2; priority++) { + for (i = f->start_band; i < f->end_band && bits_left >= f->channels; i++) { + if (f->fine_priority[i] != priority || f->fine_bits[i] >= CELT_MAX_FINE_BITS) + continue; + + for (j = 0; j < f->channels; j++) { + int q2; + float offset; + q2 = ff_opus_rc_get_raw(rc, 1); + offset = (q2 - 0.5f) * (1 << (14 - f->fine_bits[i] - 1)) / 16384.0f; + f->block[j].energy[i] += offset; + bits_left--; + } + } + } +} + +static void celt_decode_tf_changes(CeltFrame *f, OpusRangeCoder *rc) +{ + int i, diff = 0, tf_select = 0, tf_changed = 0, tf_select_bit; + int consumed, bits = f->transient ? 2 : 4; + + consumed = opus_rc_tell(rc); + tf_select_bit = (f->size != 0 && consumed+bits+1 <= f->framebits); + + for (i = f->start_band; i < f->end_band; i++) { + if (consumed+bits+tf_select_bit <= f->framebits) { + diff ^= ff_opus_rc_dec_log(rc, bits); + consumed = opus_rc_tell(rc); + tf_changed |= diff; + } + f->tf_change[i] = diff; + bits = f->transient ? 4 : 5; + } + + if (tf_select_bit && ff_celt_tf_select[f->size][f->transient][0][tf_changed] != + ff_celt_tf_select[f->size][f->transient][1][tf_changed]) + tf_select = ff_opus_rc_dec_log(rc, 1); + + for (i = f->start_band; i < f->end_band; i++) { + f->tf_change[i] = ff_celt_tf_select[f->size][f->transient][tf_select][f->tf_change[i]]; + } +} + +static void celt_denormalize(CeltFrame *f, CeltBlock *block, float *data) +{ + int i, j; + + for (i = f->start_band; i < f->end_band; i++) { + float *dst = data + (ff_celt_freq_bands[i] << f->size); + float log_norm = block->energy[i] + ff_celt_mean_energy[i]; + float norm = exp2f(FFMIN(log_norm, 32.0f)); + + for (j = 0; j < ff_celt_freq_range[i] << f->size; j++) + dst[j] *= norm; + } +} + +static void celt_postfilter_apply_transition(CeltBlock *block, float *data) +{ + const int T0 = block->pf_period_old; + const int T1 = block->pf_period; + + float g00, g01, g02; + float g10, g11, g12; + + float x0, x1, x2, x3, x4; + + int i; + + if (block->pf_gains[0] == 0.0 && + block->pf_gains_old[0] == 0.0) + return; + + g00 = block->pf_gains_old[0]; + g01 = block->pf_gains_old[1]; + g02 = block->pf_gains_old[2]; + g10 = block->pf_gains[0]; + g11 = block->pf_gains[1]; + g12 = block->pf_gains[2]; + + x1 = data[-T1 + 1]; + x2 = data[-T1]; + x3 = data[-T1 - 1]; + x4 = data[-T1 - 2]; + + for (i = 0; i < CELT_OVERLAP; i++) { + float w = ff_celt_window2[i]; + x0 = data[i - T1 + 2]; + + data[i] += (1.0 - w) * g00 * data[i - T0] + + (1.0 - w) * g01 * (data[i - T0 - 1] + data[i - T0 + 1]) + + (1.0 - w) * g02 * (data[i - T0 - 2] + data[i - T0 + 2]) + + w * g10 * x2 + + w * g11 * (x1 + x3) + + w * g12 * (x0 + x4); + x4 = x3; + x3 = x2; + x2 = x1; + x1 = x0; + } +} + +static void celt_postfilter(CeltFrame *f, CeltBlock *block) +{ + int len = f->blocksize * f->blocks; + const int filter_len = len - 2 * CELT_OVERLAP; + + celt_postfilter_apply_transition(block, block->buf + 1024); + + block->pf_period_old = block->pf_period; + memcpy(block->pf_gains_old, block->pf_gains, sizeof(block->pf_gains)); + + block->pf_period = block->pf_period_new; + memcpy(block->pf_gains, block->pf_gains_new, sizeof(block->pf_gains)); + + if (len > CELT_OVERLAP) { + celt_postfilter_apply_transition(block, block->buf + 1024 + CELT_OVERLAP); + + if (block->pf_gains[0] > FLT_EPSILON && filter_len > 0) + f->opusdsp.postfilter(block->buf + 1024 + 2 * CELT_OVERLAP, + block->pf_period, block->pf_gains, + filter_len); + + block->pf_period_old = block->pf_period; + memcpy(block->pf_gains_old, block->pf_gains, sizeof(block->pf_gains)); + } + + memmove(block->buf, block->buf + len, (1024 + CELT_OVERLAP / 2) * sizeof(float)); +} + +static int parse_postfilter(CeltFrame *f, OpusRangeCoder *rc, int consumed) +{ + int i; + + memset(f->block[0].pf_gains_new, 0, sizeof(f->block[0].pf_gains_new)); + memset(f->block[1].pf_gains_new, 0, sizeof(f->block[1].pf_gains_new)); + + if (f->start_band == 0 && consumed + 16 <= f->framebits) { + int has_postfilter = ff_opus_rc_dec_log(rc, 1); + if (has_postfilter) { + float gain; + int tapset, octave, period; + + octave = ff_opus_rc_dec_uint(rc, 6); + period = (16 << octave) + ff_opus_rc_get_raw(rc, 4 + octave) - 1; + gain = 0.09375f * (ff_opus_rc_get_raw(rc, 3) + 1); + tapset = (opus_rc_tell(rc) + 2 <= f->framebits) ? + ff_opus_rc_dec_cdf(rc, ff_celt_model_tapset) : 0; + + for (i = 0; i < 2; i++) { + CeltBlock *block = &f->block[i]; + + block->pf_period_new = FFMAX(period, CELT_POSTFILTER_MINPERIOD); + block->pf_gains_new[0] = gain * ff_celt_postfilter_taps[tapset][0]; + block->pf_gains_new[1] = gain * ff_celt_postfilter_taps[tapset][1]; + block->pf_gains_new[2] = gain * ff_celt_postfilter_taps[tapset][2]; + } + } + + consumed = opus_rc_tell(rc); + } + + return consumed; +} + +static void process_anticollapse(CeltFrame *f, CeltBlock *block, float *X) +{ + int i, j, k; + + for (i = f->start_band; i < f->end_band; i++) { + int renormalize = 0; + float *xptr; + float prev[2]; + float Ediff, r; + float thresh, sqrt_1; + int depth; + + /* depth in 1/8 bits */ + depth = (1 + f->pulses[i]) / (ff_celt_freq_range[i] << f->size); + thresh = exp2f(-1.0 - 0.125f * depth); + sqrt_1 = 1.0f / sqrtf(ff_celt_freq_range[i] << f->size); + + xptr = X + (ff_celt_freq_bands[i] << f->size); + + prev[0] = block->prev_energy[0][i]; + prev[1] = block->prev_energy[1][i]; + if (f->channels == 1) { + CeltBlock *block1 = &f->block[1]; + + prev[0] = FFMAX(prev[0], block1->prev_energy[0][i]); + prev[1] = FFMAX(prev[1], block1->prev_energy[1][i]); + } + Ediff = block->energy[i] - FFMIN(prev[0], prev[1]); + Ediff = FFMAX(0, Ediff); + + /* r needs to be multiplied by 2 or 2*sqrt(2) depending on LM because + short blocks don't have the same energy as long */ + r = exp2f(1 - Ediff); + if (f->size == 3) + r *= M_SQRT2; + r = FFMIN(thresh, r) * sqrt_1; + for (k = 0; k < 1 << f->size; k++) { + /* Detect collapse */ + if (!(block->collapse_masks[i] & 1 << k)) { + /* Fill with noise */ + for (j = 0; j < ff_celt_freq_range[i]; j++) + xptr[(j << f->size) + k] = (celt_rng(f) & 0x8000) ? r : -r; + renormalize = 1; + } + } + + /* We just added some energy, so we need to renormalize */ + if (renormalize) + celt_renormalize_vector(xptr, ff_celt_freq_range[i] << f->size, 1.0f); + } +} + +int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, + float **output, int channels, int frame_size, + int start_band, int end_band) +{ + int i, j, downmix = 0; + int consumed; // bits of entropy consumed thus far for this frame + AVTXContext *imdct; + av_tx_fn imdct_fn; + + if (channels != 1 && channels != 2) { + av_log(f->avctx, AV_LOG_ERROR, "Invalid number of coded channels: %d\n", + channels); + return AVERROR_INVALIDDATA; + } + if (start_band < 0 || start_band > end_band || end_band > CELT_MAX_BANDS) { + av_log(f->avctx, AV_LOG_ERROR, "Invalid start/end band: %d %d\n", + start_band, end_band); + return AVERROR_INVALIDDATA; + } + + f->silence = 0; + f->transient = 0; + f->anticollapse = 0; + f->flushed = 0; + f->channels = channels; + f->start_band = start_band; + f->end_band = end_band; + f->framebits = rc->rb.bytes * 8; + + f->size = av_log2(frame_size / CELT_SHORT_BLOCKSIZE); + if (f->size > CELT_MAX_LOG_BLOCKS || + frame_size != CELT_SHORT_BLOCKSIZE * (1 << f->size)) { + av_log(f->avctx, AV_LOG_ERROR, "Invalid CELT frame size: %d\n", + frame_size); + return AVERROR_INVALIDDATA; + } + + if (!f->output_channels) + f->output_channels = channels; + + for (i = 0; i < f->channels; i++) { + memset(f->block[i].coeffs, 0, sizeof(f->block[i].coeffs)); + memset(f->block[i].collapse_masks, 0, sizeof(f->block[i].collapse_masks)); + } + + consumed = opus_rc_tell(rc); + + /* obtain silence flag */ + if (consumed >= f->framebits) + f->silence = 1; + else if (consumed == 1) + f->silence = ff_opus_rc_dec_log(rc, 15); + + + if (f->silence) { + consumed = f->framebits; + rc->total_bits += f->framebits - opus_rc_tell(rc); + } + + /* obtain post-filter options */ + consumed = parse_postfilter(f, rc, consumed); + + /* obtain transient flag */ + if (f->size != 0 && consumed+3 <= f->framebits) + f->transient = ff_opus_rc_dec_log(rc, 3); + + f->blocks = f->transient ? 1 << f->size : 1; + f->blocksize = frame_size / f->blocks; + + imdct = f->tx[f->transient ? 0 : f->size]; + imdct_fn = f->tx_fn[f->transient ? 0 : f->size]; + + if (channels == 1) { + for (i = 0; i < CELT_MAX_BANDS; i++) + f->block[0].energy[i] = FFMAX(f->block[0].energy[i], f->block[1].energy[i]); + } + + celt_decode_coarse_energy(f, rc); + celt_decode_tf_changes (f, rc); + ff_celt_bitalloc (f, rc, 0); + celt_decode_fine_energy (f, rc); + ff_celt_quant_bands (f, rc); + + if (f->anticollapse_needed) + f->anticollapse = ff_opus_rc_get_raw(rc, 1); + + celt_decode_final_energy(f, rc); + + /* apply anti-collapse processing and denormalization to + * each coded channel */ + for (i = 0; i < f->channels; i++) { + CeltBlock *block = &f->block[i]; + + if (f->anticollapse) + process_anticollapse(f, block, f->block[i].coeffs); + + celt_denormalize(f, block, f->block[i].coeffs); + } + + /* stereo -> mono downmix */ + if (f->output_channels < f->channels) { + f->dsp->vector_fmac_scalar(f->block[0].coeffs, f->block[1].coeffs, 1.0, FFALIGN(frame_size, 16)); + downmix = 1; + } else if (f->output_channels > f->channels) + memcpy(f->block[1].coeffs, f->block[0].coeffs, frame_size * sizeof(float)); + + if (f->silence) { + for (i = 0; i < 2; i++) { + CeltBlock *block = &f->block[i]; + + for (j = 0; j < FF_ARRAY_ELEMS(block->energy); j++) + block->energy[j] = CELT_ENERGY_SILENCE; + } + memset(f->block[0].coeffs, 0, sizeof(f->block[0].coeffs)); + memset(f->block[1].coeffs, 0, sizeof(f->block[1].coeffs)); + } + + /* transform and output for each output channel */ + for (i = 0; i < f->output_channels; i++) { + CeltBlock *block = &f->block[i]; + + /* iMDCT and overlap-add */ + for (j = 0; j < f->blocks; j++) { + float *dst = block->buf + 1024 + j * f->blocksize; + + imdct_fn(imdct, dst + CELT_OVERLAP / 2, f->block[i].coeffs + j, + sizeof(float)*f->blocks); + f->dsp->vector_fmul_window(dst, dst, dst + CELT_OVERLAP / 2, + ff_celt_window, CELT_OVERLAP / 2); + } + + if (downmix) + f->dsp->vector_fmul_scalar(&block->buf[1024], &block->buf[1024], 0.5f, frame_size); + + /* postfilter */ + celt_postfilter(f, block); + + /* deemphasis */ + block->emph_coeff = f->opusdsp.deemphasis(output[i], + &block->buf[1024 - frame_size], + block->emph_coeff, frame_size); + } + + if (channels == 1) + memcpy(f->block[1].energy, f->block[0].energy, sizeof(f->block[0].energy)); + + for (i = 0; i < 2; i++ ) { + CeltBlock *block = &f->block[i]; + + if (!f->transient) { + memcpy(block->prev_energy[1], block->prev_energy[0], sizeof(block->prev_energy[0])); + memcpy(block->prev_energy[0], block->energy, sizeof(block->prev_energy[0])); + } else { + for (j = 0; j < CELT_MAX_BANDS; j++) + block->prev_energy[0][j] = FFMIN(block->prev_energy[0][j], block->energy[j]); + } + + for (j = 0; j < f->start_band; j++) { + block->prev_energy[0][j] = CELT_ENERGY_SILENCE; + block->energy[j] = 0.0; + } + for (j = f->end_band; j < CELT_MAX_BANDS; j++) { + block->prev_energy[0][j] = CELT_ENERGY_SILENCE; + block->energy[j] = 0.0; + } + } + + f->seed = rc->range; + + return 0; +} + +void ff_celt_flush(CeltFrame *f) +{ + int i, j; + + if (f->flushed) + return; + + for (i = 0; i < 2; i++) { + CeltBlock *block = &f->block[i]; + + for (j = 0; j < CELT_MAX_BANDS; j++) + block->prev_energy[0][j] = block->prev_energy[1][j] = CELT_ENERGY_SILENCE; + + memset(block->energy, 0, sizeof(block->energy)); + memset(block->buf, 0, sizeof(block->buf)); + + memset(block->pf_gains, 0, sizeof(block->pf_gains)); + memset(block->pf_gains_old, 0, sizeof(block->pf_gains_old)); + memset(block->pf_gains_new, 0, sizeof(block->pf_gains_new)); + + /* libopus uses CELT_EMPH_COEFF on init, but 0 is better since there's + * a lesser discontinuity when seeking. + * The deemphasis functions differ from libopus in that they require + * an initial state divided by the coefficient. */ + block->emph_coeff = 0.0f / CELT_EMPH_COEFF; + } + f->seed = 0; + + f->flushed = 1; +} + +void ff_celt_free(CeltFrame **f) +{ + CeltFrame *frm = *f; + int i; + + if (!frm) + return; + + for (i = 0; i < FF_ARRAY_ELEMS(frm->tx); i++) + av_tx_uninit(&frm->tx[i]); + + ff_celt_pvq_uninit(&frm->pvq); + + av_freep(&frm->dsp); + av_freep(f); +} + +int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels, + int apply_phase_inv) +{ + CeltFrame *frm; + int i, ret; + + if (output_channels != 1 && output_channels != 2) { + av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", + output_channels); + return AVERROR(EINVAL); + } + + frm = av_mallocz(sizeof(*frm)); + if (!frm) + return AVERROR(ENOMEM); + + frm->avctx = avctx; + frm->output_channels = output_channels; + frm->apply_phase_inv = apply_phase_inv; + + for (i = 0; i < FF_ARRAY_ELEMS(frm->tx); i++) { + const float scale = -1.0f/32768; + if ((ret = av_tx_init(&frm->tx[i], &frm->tx_fn[i], AV_TX_FLOAT_MDCT, 1, 15 << (i + 3), &scale, 0)) < 0) + goto fail; + } + + if ((ret = ff_celt_pvq_init(&frm->pvq, 0)) < 0) + goto fail; + + frm->dsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); + if (!frm->dsp) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ff_opus_dsp_init(&frm->opusdsp); + ff_celt_flush(frm); + + *f = frm; + + return 0; +fail: + ff_celt_free(&frm); + return ret; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,6 +58,8 @@ #if ARCH_AARCH64 ff_opus_dsp_init_aarch64(ctx); +#elif ARCH_RISCV + ff_opus_dsp_init_riscv(ctx); #elif ARCH_X86 ff_opus_dsp_init_x86(ctx); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,5 +30,6 @@ void ff_opus_dsp_init_x86(OpusDSP *ctx); void ff_opus_dsp_init_aarch64(OpusDSP *ctx); +void ff_opus_dsp_init_riscv(OpusDSP *ctx); #endif /* AVCODEC_OPUSDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "encode.h" #include "opusenc.h" #include "opus_pvq.h" @@ -40,7 +42,8 @@ AVCodecContext *avctx; AudioFrameQueue afq; AVFloatDSPContext *dsp; - MDCT15Context *mdct[CELT_BLOCK_NB]; + AVTXContext *tx[CELT_BLOCK_NB]; + av_tx_fn tx_fn[CELT_BLOCK_NB]; CeltPVQ *pvq; struct FFBufQueue bufqueue; @@ -202,9 +205,9 @@ float *src2 = &b->samples[CELT_OVERLAP*t]; s->dsp->vector_fmul(win, src1, ff_celt_window, 128); s->dsp->vector_fmul_reverse(&win[CELT_OVERLAP], src2, - ff_celt_window - 8, 128); + ff_celt_window_padded, 128); src1 = src2; - s->mdct[0]->mdct(s->mdct[0], b->coeffs + t, win, f->blocks); + s->tx_fn[0](s->tx[0], b->coeffs + t, win, sizeof(float)*f->blocks); } } } else { @@ -223,10 +226,10 @@ /* Samples, windowed */ s->dsp->vector_fmul_reverse(temp, b->samples + rwin, - ff_celt_window - 8, 128); + ff_celt_window_padded, 128); memcpy(win + lap_dst + blk_len, temp, CELT_OVERLAP*sizeof(float)); - s->mdct[f->size]->mdct(s->mdct[f->size], b->coeffs, win, 1); + s->tx_fn[f->size](s->tx[f->size], b->coeffs, win, sizeof(float)); } } @@ -551,7 +554,7 @@ ff_bufqueue_add(avctx, &s->bufqueue, av_frame_clone(frame)); } else { ff_opus_psy_signal_eof(&s->psyctx); - if (!s->afq.remaining_samples || !avctx->frame_number) + if (!s->afq.remaining_samples || !avctx->frame_num) return 0; /* We've been flushed and there's nothing left to encode */ } @@ -591,7 +594,7 @@ opus_packet_assembler(s, avpkt); /* Update the psychoacoustic system */ - ff_opus_psy_postencode_update(&s->psyctx, s->frame, s->rc); + ff_opus_psy_postencode_update(&s->psyctx, s->frame); /* Remove samples from queue and skip if needed */ ff_af_queue_remove(&s->afq, s->packet.frames*frame_size, &avpkt->pts, &avpkt->duration); @@ -612,7 +615,7 @@ OpusEncContext *s = avctx->priv_data; for (int i = 0; i < CELT_BLOCK_NB; i++) - ff_mdct15_uninit(&s->mdct[i]); + av_tx_uninit(&s->tx[i]); ff_celt_pvq_uninit(&s->pvq); av_freep(&s->dsp); @@ -668,9 +671,11 @@ return AVERROR(ENOMEM); /* I have no idea why a base scaling factor of 68 works, could be the twiddles */ - for (int i = 0; i < CELT_BLOCK_NB; i++) - if ((ret = ff_mdct15_init(&s->mdct[i], 0, i + 3, 68 << (CELT_BLOCK_NB - 1 - i)))) + for (int i = 0; i < CELT_BLOCK_NB; i++) { + const float scale = 68 << (CELT_BLOCK_NB - 1 - i); + if ((ret = av_tx_init(&s->tx[i], &s->tx_fn[i], AV_TX_FLOAT_MDCT, 0, 15 << (i + 3), &scale, 0))) return AVERROR(ENOMEM); + } /* Zero out previous energy (matters for inter first frame) */ for (int ch = 0; ch < s->channels; ch++) @@ -727,22 +732,20 @@ const FFCodec ff_opus_encoder = { .p.name = "opus", - .p.long_name = NULL_IF_CONFIG_SMALL("Opus"), + CODEC_LONG_NAME("Opus"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_OPUS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_EXPERIMENTAL, .defaults = opusenc_defaults, .p.priv_class = &opusenc_class, .priv_data_size = sizeof(OpusEncContext), .init = opus_encode_init, FF_CODEC_ENCODE_CB(opus_encode_frame), .close = opus_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = (const int []){ 48000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,8 @@ #ifndef AVCODEC_OPUSENC_H #define AVCODEC_OPUSENC_H -#include "opus_celt.h" +#include "libavutil/intmath.h" +#include "opus.h" /* Determines the maximum delay the psychoacoustic system will use for lookahead */ #define FF_BUFQUEUE_SIZE 145 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,11 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "opusenc_psy.h" +#include "opus_celt.h" #include "opus_pvq.h" #include "opustab.h" -#include "mdct15.h" -#include "libavutil/qsort.h" +#include "libavfilter/window_func.h" static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int band, float *bits, float lambda) @@ -99,7 +101,8 @@ s->dsp->vector_fmul(s->scratch, s->scratch, s->window[s->bsize_analysis], (OPUS_BLOCK_SIZE(s->bsize_analysis) << 1)); - s->mdct[s->bsize_analysis]->mdct(s->mdct[s->bsize_analysis], st->coeffs[ch], s->scratch, 1); + s->mdct_fn[s->bsize_analysis](s->mdct[s->bsize_analysis], st->coeffs[ch], + s->scratch, sizeof(float)); for (i = 0; i < CELT_MAX_BANDS; i++) st->bands[ch][i] = &st->coeffs[ch][ff_celt_freq_bands[i] << s->bsize_analysis]; @@ -356,7 +359,7 @@ rate /= s->avctx->sample_rate/frame_size; f_out->framebits = lrintf(rate); - f_out->framebits = FFMIN(f_out->framebits, OPUS_MAX_PACKET_SIZE*8); + f_out->framebits = FFMIN(f_out->framebits, OPUS_MAX_FRAME_SIZE * 8); f_out->framebits = FFALIGN(f_out->framebits, 8); } @@ -467,16 +470,13 @@ if (f->transient != start_transient_flag) { f->blocks = f->transient ? OPUS_BLOCK_SIZE(s->p.framesize)/CELT_OVERLAP : 1; - s->redo_analysis = 1; return 1; } - s->redo_analysis = 0; - return 0; } -void ff_opus_psy_postencode_update(OpusPsyContext *s, CeltFrame *f, OpusRangeCoder *rc) +void ff_opus_psy_postencode_update(OpusPsyContext *s, CeltFrame *f) { int i, frame_size = OPUS_BLOCK_SIZE(s->p.framesize); int steps_out = s->p.frames*(frame_size/120); @@ -506,7 +506,6 @@ s->avg_is_band /= (s->p.frames + 1); - s->cs_num = 0; s->steps_to_process = 0; s->buffered_steps -= steps_out; s->total_packets_out += s->p.frames; @@ -518,7 +517,6 @@ { int i, ch, ret; - s->redo_analysis = 0; s->lambda = 1.0f; s->options = options; s->avctx = avctx; @@ -558,13 +556,16 @@ for (i = 0; i < CELT_BLOCK_NB; i++) { float tmp; const int len = OPUS_BLOCK_SIZE(i); + const float scale = 68 << (CELT_BLOCK_NB - 1 - i); s->window[i] = av_malloc(2*len*sizeof(float)); if (!s->window[i]) { ret = AVERROR(ENOMEM); goto fail; } generate_window_func(s->window[i], 2*len, WFUNC_SINE, &tmp); - if ((ret = ff_mdct15_init(&s->mdct[i], 0, i + 3, 68 << (CELT_BLOCK_NB - 1 - i)))) + ret = av_tx_init(&s->mdct[i], &s->mdct_fn[i], AV_TX_FLOAT_MDCT, + 0, 15 << (i + 3), &scale, 0); + if (ret < 0) goto fail; } @@ -575,7 +576,7 @@ av_freep(&s->dsp); for (i = 0; i < CELT_BLOCK_NB; i++) { - ff_mdct15_uninit(&s->mdct[i]); + av_tx_uninit(&s->mdct[i]); av_freep(&s->window[i]); } @@ -598,7 +599,7 @@ av_freep(&s->dsp); for (i = 0; i < CELT_BLOCK_NB; i++) { - ff_mdct15_uninit(&s->mdct[i]); + av_tx_uninit(&s->mdct[i]); av_freep(&s->window[i]); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_psy.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,11 +22,12 @@ #ifndef AVCODEC_OPUSENC_PSY_H #define AVCODEC_OPUSENC_PSY_H +#include "libavutil/tx.h" #include "libavutil/mem_internal.h" #include "opusenc.h" +#include "opus_celt.h" #include "opusenc_utils.h" -#include "libavfilter/window_func.h" /* Each step is 2.5ms */ typedef struct OpusPsyStep { @@ -48,20 +49,12 @@ float excitation_init; } OpusBandExcitation; -typedef struct PsyChain { - int start; - int end; -} PsyChain; - typedef struct OpusPsyContext { AVCodecContext *avctx; AVFloatDSPContext *dsp; struct FFBufQueue *bufqueue; OpusEncOptions *options; - PsyChain cs[128]; - int cs_num; - OpusBandExcitation ex[OPUS_MAX_CHANNELS][CELT_MAX_BANDS]; FFBesselFilter bfilter_lo[OPUS_MAX_CHANNELS][CELT_MAX_BANDS]; FFBesselFilter bfilter_hi[OPUS_MAX_CHANNELS][CELT_MAX_BANDS]; @@ -70,21 +63,19 @@ int max_steps; float *window[CELT_BLOCK_NB]; - MDCT15Context *mdct[CELT_BLOCK_NB]; + AVTXContext *mdct[CELT_BLOCK_NB]; + av_tx_fn mdct_fn[CELT_BLOCK_NB]; int bsize_analysis; DECLARE_ALIGNED(32, float, scratch)[2048]; /* Stats */ - float rc_waste; float avg_is_band; int64_t dual_stereo_used; int64_t total_packets_out; /* State */ - FFBesselFilter lambda_lp; OpusPacketInfo p; - int redo_analysis; int buffered_steps; int steps_to_process; int eof; @@ -96,7 +87,7 @@ int ff_opus_psy_process (OpusPsyContext *s, OpusPacketInfo *p); void ff_opus_psy_celt_frame_init (OpusPsyContext *s, CeltFrame *f, int index); int ff_opus_psy_celt_frame_process(OpusPsyContext *s, CeltFrame *f, int index); -void ff_opus_psy_postencode_update (OpusPsyContext *s, CeltFrame *f, OpusRangeCoder *rc); +void ff_opus_psy_postencode_update (OpusPsyContext *s, CeltFrame *f); int ff_opus_psy_init(OpusPsyContext *s, AVCodecContext *avctx, struct FFBufQueue *bufqueue, OpusEncOptions *options); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_utils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_utils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_utils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opusenc_utils.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,9 @@ #ifndef AVCODEC_OPUSENC_UTILS_H #define AVCODEC_OPUSENC_UTILS_H +#include +#include + #include "opus.h" typedef struct FFBesselFilter { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Opus decoder/demuxer common functions + * Opus common header * Copyright (c) 2012 Andrew D'Addesio * Copyright (c) 2013-2014 Mozilla Corporation * @@ -25,31 +25,9 @@ #include -#include "libavutil/audio_fifo.h" -#include "libavutil/float_dsp.h" -#include "libavutil/frame.h" -#include "libavutil/mem_internal.h" - -#include "libswresample/swresample.h" - -#include "avcodec.h" -#include "opus_rc.h" - -#define MAX_FRAME_SIZE 1275 -#define MAX_FRAMES 48 -#define MAX_PACKET_DUR 5760 - -#define CELT_SHORT_BLOCKSIZE 120 -#define CELT_OVERLAP CELT_SHORT_BLOCKSIZE -#define CELT_MAX_LOG_BLOCKS 3 -#define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS)) -#define CELT_MAX_BANDS 21 - -#define SILK_HISTORY 322 -#define SILK_MAX_LPC 16 - -#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) -#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) +#define OPUS_MAX_FRAME_SIZE 1275 +#define OPUS_MAX_FRAMES 48 +#define OPUS_MAX_PACKET_DUR 5760 #define OPUS_TS_HEADER 0x7FE0 // 0x3ff (11 bits) #define OPUS_TS_MASK 0xFFE0 // top 11 bits @@ -78,124 +56,4 @@ OPUS_BANDWITH_NB }; -typedef struct SilkContext SilkContext; - -typedef struct CeltFrame CeltFrame; - -typedef struct OpusPacket { - int packet_size; /**< packet size */ - int data_size; /**< size of the useful data -- packet size - padding */ - int code; /**< packet code: specifies the frame layout */ - int stereo; /**< whether this packet is mono or stereo */ - int vbr; /**< vbr flag */ - int config; /**< configuration: tells the audio mode, - ** bandwidth, and frame duration */ - int frame_count; /**< frame count */ - int frame_offset[MAX_FRAMES]; /**< frame offsets */ - int frame_size[MAX_FRAMES]; /**< frame sizes */ - int frame_duration; /**< frame duration, in samples @ 48kHz */ - enum OpusMode mode; /**< mode */ - enum OpusBandwidth bandwidth; /**< bandwidth */ -} OpusPacket; - -typedef struct OpusStreamContext { - AVCodecContext *avctx; - int output_channels; - - /* number of decoded samples for this stream */ - int decoded_samples; - /* current output buffers for this stream */ - float *out[2]; - int out_size; - /* Buffer with samples from this stream for synchronizing - * the streams when they have different resampling delays */ - AVAudioFifo *sync_buffer; - - OpusRangeCoder rc; - OpusRangeCoder redundancy_rc; - SilkContext *silk; - CeltFrame *celt; - AVFloatDSPContext *fdsp; - - float silk_buf[2][960]; - float *silk_output[2]; - DECLARE_ALIGNED(32, float, celt_buf)[2][960]; - float *celt_output[2]; - - DECLARE_ALIGNED(32, float, redundancy_buf)[2][960]; - float *redundancy_output[2]; - - /* buffers for the next samples to be decoded */ - float *cur_out[2]; - int remaining_out_size; - - float *out_dummy; - int out_dummy_allocated_size; - - SwrContext *swr; - AVAudioFifo *celt_delay; - int silk_samplerate; - /* number of samples we still want to get from the resampler */ - int delayed_samples; - - OpusPacket packet; - - int redundancy_idx; -} OpusStreamContext; - -// a mapping between an opus stream and an output channel -typedef struct ChannelMap { - int stream_idx; - int channel_idx; - - // when a single decoded channel is mapped to multiple output channels, we - // write to the first output directly and copy from it to the others - // this field is set to 1 for those copied output channels - int copy; - // this is the index of the output channel to copy from - int copy_idx; - - // this channel is silent - int silence; -} ChannelMap; - -typedef struct OpusContext { - AVClass *av_class; - OpusStreamContext *streams; - int apply_phase_inv; - - int nb_streams; - int nb_stereo_streams; - - AVFloatDSPContext *fdsp; - int16_t gain_i; - float gain; - - ChannelMap *channel_maps; -} OpusContext; - -int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, - int self_delimited); - -int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s); - -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); -void ff_silk_free(SilkContext **ps); -void ff_silk_flush(SilkContext *s); - -/** - * Decode the LP layer of one Opus frame (which may correspond to several SILK - * frames). - */ -int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, - float *output[2], - enum OpusBandwidth bandwidth, int coded_channels, - int duration_ms); - -/* Encode or decode CELT bands */ -void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc); - -/* Encode or decode CELT bitallocation */ -void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode); - #endif /* AVCODEC_OPUS_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Opus decoder/parser shared code + */ + +#include "libavutil/attributes.h" +#include "libavutil/channel_layout.h" +#include "libavutil/error.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" + +#include "avcodec.h" +#include "internal.h" +#include "mathops.h" +#include "opus.h" +#include "opus_parse.h" +#include "vorbis_data.h" + +static const uint16_t opus_frame_duration[32] = { + 480, 960, 1920, 2880, + 480, 960, 1920, 2880, + 480, 960, 1920, 2880, + 480, 960, + 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, +}; + +/** + * Read a 1- or 2-byte frame length + */ +static inline int xiph_lacing_16bit(const uint8_t **ptr, const uint8_t *end) +{ + int val; + + if (*ptr >= end) + return AVERROR_INVALIDDATA; + val = *(*ptr)++; + if (val >= 252) { + if (*ptr >= end) + return AVERROR_INVALIDDATA; + val += 4 * *(*ptr)++; + } + return val; +} + +/** + * Read a multi-byte length (used for code 3 packet padding size) + */ +static inline int xiph_lacing_full(const uint8_t **ptr, const uint8_t *end) +{ + int val = 0; + int next; + + while (1) { + if (*ptr >= end || val > INT_MAX - 254) + return AVERROR_INVALIDDATA; + next = *(*ptr)++; + val += next; + if (next < 255) + break; + else + val--; + } + return val; +} + +/** + * Parse Opus packet info from raw packet data + */ +int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, + int self_delimiting) +{ + const uint8_t *ptr = buf; + const uint8_t *end = buf + buf_size; + int padding = 0; + int frame_bytes, i; + + if (buf_size < 1) + goto fail; + + /* TOC byte */ + i = *ptr++; + pkt->code = (i ) & 0x3; + pkt->stereo = (i >> 2) & 0x1; + pkt->config = (i >> 3) & 0x1F; + + /* code 2 and code 3 packets have at least 1 byte after the TOC */ + if (pkt->code >= 2 && buf_size < 2) + goto fail; + + switch (pkt->code) { + case 0: + /* 1 frame */ + pkt->frame_count = 1; + pkt->vbr = 0; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len > end - ptr) + goto fail; + end = ptr + len; + buf_size = end - buf; + } + + frame_bytes = end - ptr; + if (frame_bytes > OPUS_MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + break; + case 1: + /* 2 frames, equal size */ + pkt->frame_count = 2; + pkt->vbr = 0; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || 2 * len > end - ptr) + goto fail; + end = ptr + 2 * len; + buf_size = end - buf; + } + + frame_bytes = end - ptr; + if (frame_bytes & 1 || frame_bytes >> 1 > OPUS_MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes >> 1; + pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; + pkt->frame_size[1] = frame_bytes >> 1; + break; + case 2: + /* 2 frames, different sizes */ + pkt->frame_count = 2; + pkt->vbr = 1; + + /* read 1st frame size */ + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0) + goto fail; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len + frame_bytes > end - ptr) + goto fail; + end = ptr + frame_bytes + len; + buf_size = end - buf; + } + + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + + /* calculate 2nd frame size */ + frame_bytes = end - ptr - pkt->frame_size[0]; + if (frame_bytes < 0 || frame_bytes > OPUS_MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; + pkt->frame_size[1] = frame_bytes; + break; + case 3: + /* 1 to 48 frames, can be different sizes */ + i = *ptr++; + pkt->frame_count = (i ) & 0x3F; + padding = (i >> 6) & 0x01; + pkt->vbr = (i >> 7) & 0x01; + + if (pkt->frame_count == 0 || pkt->frame_count > OPUS_MAX_FRAMES) + goto fail; + + /* read padding size */ + if (padding) { + padding = xiph_lacing_full(&ptr, end); + if (padding < 0) + goto fail; + } + + /* read frame sizes */ + if (pkt->vbr) { + /* for VBR, all frames except the final one have their size coded + in the bitstream. the last frame size is implicit. */ + int total_bytes = 0; + for (i = 0; i < pkt->frame_count - 1; i++) { + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0) + goto fail; + pkt->frame_size[i] = frame_bytes; + total_bytes += frame_bytes; + } + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len + total_bytes + padding > end - ptr) + goto fail; + end = ptr + total_bytes + len + padding; + buf_size = end - buf; + } + + frame_bytes = end - ptr - padding; + if (total_bytes > frame_bytes) + goto fail; + pkt->frame_offset[0] = ptr - buf; + for (i = 1; i < pkt->frame_count; i++) + pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; + pkt->frame_size[pkt->frame_count-1] = frame_bytes - total_bytes; + } else { + /* for CBR, the remaining packet bytes are divided evenly between + the frames */ + if (self_delimiting) { + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0 || pkt->frame_count * frame_bytes + padding > end - ptr) + goto fail; + end = ptr + pkt->frame_count * frame_bytes + padding; + buf_size = end - buf; + } else { + frame_bytes = end - ptr - padding; + if (frame_bytes % pkt->frame_count || + frame_bytes / pkt->frame_count > OPUS_MAX_FRAME_SIZE) + goto fail; + frame_bytes /= pkt->frame_count; + } + + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + for (i = 1; i < pkt->frame_count; i++) { + pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; + pkt->frame_size[i] = frame_bytes; + } + } + } + + pkt->packet_size = buf_size; + pkt->data_size = pkt->packet_size - padding; + + /* total packet duration cannot be larger than 120ms */ + pkt->frame_duration = opus_frame_duration[pkt->config]; + if (pkt->frame_duration * pkt->frame_count > OPUS_MAX_PACKET_DUR) + goto fail; + + /* set mode and bandwidth */ + if (pkt->config < 12) { + pkt->mode = OPUS_MODE_SILK; + pkt->bandwidth = pkt->config >> 2; + } else if (pkt->config < 16) { + pkt->mode = OPUS_MODE_HYBRID; + pkt->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND + (pkt->config >= 14); + } else { + pkt->mode = OPUS_MODE_CELT; + pkt->bandwidth = (pkt->config - 16) >> 2; + /* skip medium band */ + if (pkt->bandwidth) + pkt->bandwidth++; + } + + return 0; + +fail: + memset(pkt, 0, sizeof(*pkt)); + return AVERROR_INVALIDDATA; +} + +static int channel_reorder_vorbis(int nb_channels, int channel_idx) +{ + return ff_vorbis_channel_layout_offsets[nb_channels - 1][channel_idx]; +} + +static int channel_reorder_unknown(int nb_channels, int channel_idx) +{ + return channel_idx; +} + +av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, + OpusParseContext *s) +{ + static const uint8_t default_channel_map[2] = { 0, 1 }; + + int (*channel_reorder)(int, int) = channel_reorder_unknown; + int channels = avctx->ch_layout.nb_channels; + + const uint8_t *extradata, *channel_map; + int extradata_size; + int version, map_type, streams, stereo_streams, i, j, ret; + AVChannelLayout layout = { 0 }; + + if (!avctx->extradata) { + if (channels > 2) { + av_log(avctx, AV_LOG_ERROR, + "Multichannel configuration without extradata.\n"); + return AVERROR(EINVAL); + } + extradata = opus_default_extradata; + extradata_size = sizeof(opus_default_extradata); + } else { + extradata = avctx->extradata; + extradata_size = avctx->extradata_size; + } + + if (extradata_size < 19) { + av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", + extradata_size); + return AVERROR_INVALIDDATA; + } + + version = extradata[8]; + if (version > 15) { + avpriv_request_sample(avctx, "Extradata version %d", version); + return AVERROR_PATCHWELCOME; + } + + avctx->delay = AV_RL16(extradata + 10); + if (avctx->internal) + avctx->internal->skip_samples = avctx->delay; + + channels = avctx->extradata ? extradata[9] : (channels == 1) ? 1 : 2; + if (!channels) { + av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extradata\n"); + return AVERROR_INVALIDDATA; + } + + s->gain_i = AV_RL16(extradata + 16); + + map_type = extradata[18]; + if (!map_type) { + if (channels > 2) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 0 is only specified for up to 2 channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + layout = (channels == 1) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO : + (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + streams = 1; + stereo_streams = channels - 1; + channel_map = default_channel_map; + } else if (map_type == 1 || map_type == 2 || map_type == 255) { + if (extradata_size < 21 + channels) { + av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", + extradata_size); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + streams = extradata[19]; + stereo_streams = extradata[20]; + if (!streams || stereo_streams > streams || + streams + stereo_streams > 255) { + av_log(avctx, AV_LOG_ERROR, + "Invalid stream/stereo stream count: %d/%d\n", streams, stereo_streams); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + if (map_type == 1) { + if (channels > 8) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 1 is only specified for up to 8 channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + av_channel_layout_copy(&layout, &ff_vorbis_ch_layouts[channels - 1]); + channel_reorder = channel_reorder_vorbis; + } else if (map_type == 2) { + int ambisonic_order = ff_sqrt(channels) - 1; + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && + channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 2 is only specified for channel counts" + " which can be written as (n + 1)^2 or (n + 1)^2 + 2" + " for nonnegative integer n\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + if (channels > 227) { + av_log(avctx, AV_LOG_ERROR, "Too many channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + layout.order = AV_CHANNEL_ORDER_AMBISONIC; + layout.nb_channels = channels; + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1))) + layout.u.mask = AV_CH_LAYOUT_STEREO; + } else { + layout.order = AV_CHANNEL_ORDER_UNSPEC; + layout.nb_channels = channels; + } + + channel_map = extradata + 21; + } else { + avpriv_request_sample(avctx, "Mapping type %d", map_type); + return AVERROR_PATCHWELCOME; + } + + s->channel_maps = av_calloc(channels, sizeof(*s->channel_maps)); + if (!s->channel_maps) { + ret = AVERROR(ENOMEM); + goto fail; + } + + for (i = 0; i < channels; i++) { + ChannelMap *map = &s->channel_maps[i]; + uint8_t idx = channel_map[channel_reorder(channels, i)]; + + if (idx == 255) { + map->silence = 1; + continue; + } else if (idx >= streams + stereo_streams) { + av_log(avctx, AV_LOG_ERROR, + "Invalid channel map for output channel %d: %d\n", i, idx); + av_freep(&s->channel_maps); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + /* check that we did not see this index yet */ + map->copy = 0; + for (j = 0; j < i; j++) + if (channel_map[channel_reorder(channels, j)] == idx) { + map->copy = 1; + map->copy_idx = j; + break; + } + + if (idx < 2 * stereo_streams) { + map->stream_idx = idx / 2; + map->channel_idx = idx & 1; + } else { + map->stream_idx = idx - stereo_streams; + map->channel_idx = 0; + } + } + + ret = av_channel_layout_copy(&avctx->ch_layout, &layout); + if (ret < 0) + goto fail; + + s->nb_streams = streams; + s->nb_stereo_streams = stereo_streams; + + return 0; +fail: + av_channel_layout_uninit(&layout); + return ret; +} + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parse.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Opus decoder/parser common functions and structures + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_OPUS_PARSE_H +#define AVCODEC_OPUS_PARSE_H + +#include + +#include "avcodec.h" +#include "opus.h" + +typedef struct OpusPacket { + int packet_size; /**< packet size */ + int data_size; /**< size of the useful data -- packet size - padding */ + int code; /**< packet code: specifies the frame layout */ + int stereo; /**< whether this packet is mono or stereo */ + int vbr; /**< vbr flag */ + int config; /**< configuration: tells the audio mode, + ** bandwidth, and frame duration */ + int frame_count; /**< frame count */ + int frame_offset[OPUS_MAX_FRAMES]; /**< frame offsets */ + int frame_size[OPUS_MAX_FRAMES]; /**< frame sizes */ + int frame_duration; /**< frame duration, in samples @ 48kHz */ + enum OpusMode mode; /**< mode */ + enum OpusBandwidth bandwidth; /**< bandwidth */ +} OpusPacket; + +// a mapping between an opus stream and an output channel +typedef struct ChannelMap { + int stream_idx; + int channel_idx; + + // when a single decoded channel is mapped to multiple output channels, we + // write to the first output directly and copy from it to the others + // this field is set to 1 for those copied output channels + int copy; + // this is the index of the output channel to copy from + int copy_idx; + + // this channel is silent + int silence; +} ChannelMap; + +typedef struct OpusParseContext { + int nb_streams; + int nb_stereo_streams; + + int16_t gain_i; + + ChannelMap *channel_maps; +} OpusParseContext; + +int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, + int self_delimited); + +int ff_opus_parse_extradata(AVCodecContext *avctx, OpusParseContext *s); + +#endif /* AVCODEC_OPUS_PARSE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,15 +28,16 @@ #include "avcodec.h" #include "bytestream.h" #include "opus.h" +#include "opus_parse.h" #include "parser.h" -typedef struct OpusParseContext { +typedef struct OpusParserContext { ParseContext pc; - OpusContext ctx; + OpusParseContext ctx; OpusPacket pkt; int extradata_parsed; int ts_framing; -} OpusParseContext; +} OpusParserContext; static const uint8_t *parse_opus_ts_header(const uint8_t *start, int *payload_len, int buf_len) { @@ -83,7 +84,7 @@ static int opus_find_frame_end(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t *buf, int buf_size, int *header_len) { - OpusParseContext *s = ctx->priv_data; + OpusParserContext *s = ctx->priv_data; ParseContext *pc = &s->pc; int ret, start_found, i = 0, payload_len = 0; const uint8_t *payload; @@ -166,7 +167,7 @@ const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { - OpusParseContext *s = ctx->priv_data; + OpusParserContext *s = ctx->priv_data; ParseContext *pc = &s->pc; int next, header_len; @@ -192,7 +193,7 @@ const AVCodecParser ff_opus_parser = { .codec_ids = { AV_CODEC_ID_OPUS }, - .priv_data_size = sizeof(OpusParseContext), + .priv_data_size = sizeof(OpusParserContext), .parser_parse = opus_parse, .parser_close = ff_parse_close }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,11 +23,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "config_components.h" +#include "mathops.h" #include "opustab.h" #include "opus_pvq.h" +#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) + #define CELT_PVQ_U(n, k) (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)]) #define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1)) @@ -361,6 +366,7 @@ return celt_cwrsi(N, K, idx, y); } +#if CONFIG_OPUS_ENCODER /* * Faster than libopus's search, operates entirely in the signed domain. * Slightly worse/better depending on N, K and the input vector. @@ -413,6 +419,7 @@ return (float)y_norm; } +#endif static uint32_t celt_alg_quant(OpusRangeCoder *rc, float *X, uint32_t N, uint32_t K, enum CeltSpread spread, uint32_t blocks, float gain, @@ -902,12 +909,14 @@ if (!s) return AVERROR(ENOMEM); - s->pvq_search = ppp_pvq_search_c; s->quant_band = encode ? pvq_encode_band : pvq_decode_band; -#if CONFIG_OPUS_ENCODER && ARCH_X86 +#if CONFIG_OPUS_ENCODER + s->pvq_search = ppp_pvq_search_c; +#if ARCH_X86 ff_celt_pvq_init_x86(s); #endif +#endif *pvq = s; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_pvq.h 2023-03-03 13:29:59.000000000 +0000 @@ -34,13 +34,13 @@ float *lowband_out, int level, float gain, \ float *lowband_scratch, int fill) -struct CeltPVQ { +typedef struct CeltPVQ { DECLARE_ALIGNED(32, int, qcoeff )[256]; DECLARE_ALIGNED(32, float, hadamard_tmp)[256]; float (*pvq_search)(float *X, int *y, int K, int N); QUANT_FN(*quant_band); -}; +} CeltPVQ; void ff_celt_pvq_init_x86(struct CeltPVQ *s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.c 2023-03-03 13:29:59.000000000 +0000 @@ -390,7 +390,7 @@ int i, lap; uint8_t *rb_src, *rb_dst; ff_opus_rc_put_raw(rc, 0, 32 - rc->rb.cachelen); - rb_src = rc->buf + OPUS_MAX_PACKET_SIZE + 12 - rc->rb.bytes; + rb_src = rc->buf + OPUS_MAX_FRAME_SIZE + 12 - rc->rb.bytes; rb_dst = dst + FFMAX(size - rc->rb.bytes, 0); lap = &dst[rng_bytes] - rb_dst; for (i = 0; i < lap; i++) @@ -407,5 +407,5 @@ rc->rem = -1; rc->ext = 0; rc->rng_cur = rc->buf; - ff_opus_rc_dec_raw_init(rc, rc->buf + OPUS_MAX_PACKET_SIZE + 8, 0); + ff_opus_rc_dec_raw_init(rc, rc->buf + OPUS_MAX_FRAME_SIZE + 8, 0); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_rc.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,8 +25,7 @@ #include #include "get_bits.h" - -#define OPUS_MAX_PACKET_SIZE 1275 +#include "opus.h" #define opus_ilog(i) (av_log2(i) + !!(i)) @@ -45,7 +44,7 @@ uint32_t total_bits; /* Encoder */ - uint8_t buf[OPUS_MAX_PACKET_SIZE + 12]; /* memcpy vs (memmove + overreading) */ + uint8_t buf[OPUS_MAX_FRAME_SIZE + 12]; /* memcpy vs (memmove + overreading) */ uint8_t *rng_cur; /* Current range coded byte */ int ext; /* Awaiting propagation */ int rem; /* Carryout flag */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,9 +26,14 @@ #include +#include "mathops.h" #include "opus.h" +#include "opus_rc.h" +#include "opus_silk.h" #include "opustab.h" +#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) + typedef struct SilkFrame { int coded; int log_gain; @@ -833,6 +838,8 @@ int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1; silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1); } + + s->midonly = 0; } for (i = 0; i < nb_frames; i++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opus_silk.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * Opus Silk functions/definitions + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_OPUS_SILK_H +#define AVCODEC_OPUS_SILK_H + +#include "avcodec.h" +#include "opus.h" +#include "opus_rc.h" + +#define SILK_HISTORY 322 +#define SILK_MAX_LPC 16 + +typedef struct SilkContext SilkContext; + +int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); +void ff_silk_free(SilkContext **ps); +void ff_silk_flush(SilkContext *s); + +/** + * Decode the LP layer of one Opus frame (which may correspond to several SILK + * frames). + */ +int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, + float *output[2], + enum OpusBandwidth bandwidth, int coded_channels, + int duration_ms); + +#endif /* AVCODEC_OPUS_SILK_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.c 2023-03-03 13:29:59.000000000 +0000 @@ -1101,7 +1101,7 @@ { 0.7998046875f, 0.1000976562f, 0.0 } }; -DECLARE_ALIGNED(32, static const float, ff_celt_window_padded)[136] = { +DECLARE_ALIGNED(32, const float, ff_celt_window_padded)[136] = { 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 6.7286966e-05f, 0.00060551348f, 0.0016815970f, 0.0032947962f, 0.0054439943f, @@ -1132,8 +1132,6 @@ 1.00000000f, 1.00000000f, 1.00000000f, }; -const float *const ff_celt_window = &ff_celt_window_padded[8]; - /* square of the window, used for the postfilter */ const float ff_celt_window2[120] = { 4.5275357e-09f, 3.66647e-07f, 2.82777e-06f, 1.08557e-05f, 2.96371e-05f, 6.60594e-05f, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/opustab.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,9 @@ #include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN extern const uint8_t ff_celt_band_end[]; extern const uint8_t ff_opus_default_coupled_streams[]; @@ -154,8 +157,11 @@ extern const float ff_celt_postfilter_taps[3][3]; extern const float ff_celt_window2[120]; -extern const float *const ff_celt_window; + +extern const float ff_celt_window_padded[]; +static const float *const ff_celt_window = &ff_celt_window_padded[8]; extern const uint32_t * const ff_celt_pvq_u_row[15]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_OPUSTAB_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/packet.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/packet.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/packet.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/packet.h 2023-03-03 13:29:59.000000000 +0000 @@ -161,7 +161,7 @@ * the packet may contain "dual mono" audio specific to Japanese DTV * and if it is true, recommends only the selected channel to be used. * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) + * u8 selected channels (0=main/left, 1=sub/right, 2=both) * @endcode */ AV_PKT_DATA_JP_DUALMONO, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" #include "paf.h" @@ -75,11 +75,10 @@ const FFCodec ff_paf_audio_decoder = { .p.name = "paf_audio", - .p.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"), + CODEC_LONG_NAME("Amazing Studio Packed Animation File Audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PAF_AUDIO, .init = paf_audio_init, FF_CODEC_DECODE_CB(paf_audio_decode), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pafvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "bytestream.h" #include "copy_block.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static const uint8_t block_sequences[16][8] = { @@ -410,7 +410,7 @@ const FFCodec ff_paf_video_decoder = { .p.name = "paf_video", - .p.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"), + CODEC_LONG_NAME("Amazing Studio Packed Animation File Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PAF_VIDEO, .priv_data_size = sizeof(PAFVideoDecContext), @@ -418,5 +418,5 @@ .close = paf_video_close, FF_CODEC_DECODE_CB(paf_video_decode), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pamenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pamenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pamenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pamenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,8 @@ const AVFrame *p, int *got_packet) { int i, h, w, n, linesize, depth, maxval, ret, header_size; - uint8_t *bytestream, *ptr; + uint8_t *bytestream; + const uint8_t *ptr; const char *tuple_type; char header[100]; @@ -129,10 +130,10 @@ const FFCodec ff_pam_encoder = { .p.name = "pam", - .p.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), + CODEC_LONG_NAME("PAM (Portable AnyMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PAM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pam_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, @@ -141,5 +142,4 @@ AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parser.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parser.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parser.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parser.h 2023-03-03 13:29:59.000000000 +0000 @@ -45,8 +45,6 @@ * AVERROR(ENOMEM) if there was a memory allocation error */ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size); -int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf, - int buf_size); void ff_parse_close(AVCodecParserContext *s); /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parsers.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parsers.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parsers.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/parsers.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,7 @@ extern const AVCodecParser ff_dvdsub_parser; extern const AVCodecParser ff_dvd_nav_parser; extern const AVCodecParser ff_flac_parser; +extern const AVCodecParser ff_ftr_parser; extern const AVCodecParser ff_g723_1_parser; extern const AVCodecParser ff_g729_parser; extern const AVCodecParser ff_gif_parser; @@ -50,8 +51,10 @@ extern const AVCodecParser ff_h263_parser; extern const AVCodecParser ff_h264_parser; 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_misc4_parser; extern const AVCodecParser ff_mjpeg_parser; extern const AVCodecParser ff_mlp_parser; extern const AVCodecParser ff_mpeg4video_parser; @@ -74,6 +77,7 @@ extern const AVCodecParser ff_webp_parser; extern const AVCodecParser ff_xbm_parser; extern const AVCodecParser ff_xma_parser; +extern const AVCodecParser ff_xwd_parser; #include "libavcodec/parser_list.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-bluray.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-bluray.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-bluray.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-bluray.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" /* * Channel Mapping according to @@ -301,7 +301,7 @@ const FFCodec ff_pcm_bluray_decoder = { .p.name = "pcm_bluray", - .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), + CODEC_LONG_NAME("PCM signed 16|20|24-bit big-endian for Blu-ray media"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PCM_BLURAY, FF_CODEC_DECODE_CB(pcm_bluray_decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-blurayenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-blurayenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-blurayenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-blurayenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" typedef struct BlurayPCMEncContext { uint16_t header; // Header added to every frame @@ -64,7 +63,7 @@ return AVERROR_BUG; } - switch (avctx->ch_layout.u.mask) { + switch (av_channel_layout_subset(&avctx->ch_layout, ~(uint64_t)0)) { case AV_CH_LAYOUT_MONO: ch_layout = 1; break; @@ -266,8 +265,6 @@ return AVERROR_BUG; } - avpkt->pts = frame->pts; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; return 0; @@ -275,15 +272,14 @@ const FFCodec ff_pcm_bluray_encoder = { .p.name = "pcm_bluray", - .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), + CODEC_LONG_NAME("PCM signed 16|20|24-bit big-endian for Blu-ray media"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PCM_BLURAY, .priv_data_size = sizeof(BlurayPCMEncContext), .init = pcm_bluray_encode_init, FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { + CODEC_OLD_CHANNEL_LAYOUTS( AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -293,9 +289,7 @@ AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT0, - AV_CH_LAYOUT_7POINT1, - 0 }, -#endif + AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, @@ -310,6 +304,5 @@ { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,9 +33,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" -#include "internal.h" -#include "mathops.h" #include "pcm_tablegen.h" static av_cold int pcm_encode_init(AVCodecContext *avctx) @@ -255,11 +254,6 @@ AVFloatDSPContext *fdsp; int i; - if (avctx->ch_layout.nb_channels <= 0) { - av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n"); - return AVERROR(EINVAL); - } - switch (avctx->codec_id) { case AV_CODEC_ID_PCM_ALAW: for (i = 0; i < 256; i++) @@ -556,15 +550,15 @@ #define PCM_ENCODER_1(id_, sample_fmt_, name_, long_name_) \ const FFCodec ff_ ## name_ ## _encoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = AV_CODEC_ID_ ## id_, \ - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | \ + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, \ .init = pcm_encode_init, \ FF_CODEC_ENCODE_CB(pcm_encode_frame), \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } #define PCM_ENCODER_2(cf, id, sample_fmt, name, long_name) \ @@ -578,7 +572,7 @@ #define PCM_DECODER_1(id_, sample_fmt_, name_, long_name_) \ const FFCodec ff_ ## name_ ## _decoder = { \ .p.name = #name_, \ - .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + CODEC_LONG_NAME(long_name_), \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = AV_CODEC_ID_ ## id_, \ .priv_data_size = sizeof(PCMDecode), \ @@ -587,7 +581,6 @@ .p.capabilities = AV_CODEC_CAP_DR1, \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } #define PCM_DECODER_2(cf, id, sample_fmt, name, long_name) \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvd.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct PCMDVDContext { uint32_t last_header; // Cached header to see if parsing is needed @@ -297,7 +297,7 @@ const FFCodec ff_pcm_dvd_decoder = { .p.name = "pcm_dvd", - .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), + CODEC_LONG_NAME("PCM signed 16|20|24-bit big-endian for DVD media"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PCM_DVD, .priv_data_size = sizeof(PCMDVDContext), @@ -308,5 +308,4 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvdenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvdenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvdenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcm-dvdenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" typedef struct PCMDVDContext { uint8_t header[3]; // Header added to every frame @@ -167,8 +166,6 @@ break; } - avpkt->pts = frame->pts; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; return 0; @@ -176,21 +173,17 @@ const FFCodec ff_pcm_dvd_encoder = { .p.name = "pcm_dvd", - .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), + CODEC_LONG_NAME("PCM signed 16|20|24-bit big-endian for DVD media"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PCM_DVD, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_encode_init, FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_5POINT1, - AV_CH_LAYOUT_7POINT1, - 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_5POINT1, @@ -199,5 +192,4 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcx.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define PCX_HEADER_SIZE 128 @@ -251,7 +250,7 @@ const FFCodec ff_pcx_decoder = { .p.name = "pcx", - .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), + CODEC_LONG_NAME("PC Paintbrush PCX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PCX, FF_CODEC_DECODE_CB(pcx_decode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pcxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -194,9 +194,10 @@ const FFCodec ff_pcx_encoder = { .p.name = "pcx", - .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), + CODEC_LONG_NAME("PC Paintbrush PCX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PCX, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pcx_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, @@ -205,5 +206,4 @@ AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgssubdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgssubdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgssubdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgssubdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,11 +27,10 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mathops.h" #include "libavutil/colorspace.h" -#include "libavutil/imgutils.h" #include "libavutil/opt.h" #define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) @@ -692,7 +691,7 @@ const FFCodec ff_pgssub_decoder = { .p.name = "pgssub", - .p.long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"), + CODEC_LONG_NAME("HDMV Presentation Graphic Stream subtitles"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_HDMV_PGS_SUBTITLE, .priv_data_size = sizeof(PGSSubContext), @@ -700,5 +699,4 @@ .close = close_decoder, FF_CODEC_DECODE_SUB_CB(decode), .p.priv_class = &pgsdec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pgxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,10 +20,9 @@ */ #include "avcodec.h" -#include "internal.h" #include "bytestream.h" #include "codec_internal.h" -#include "libavutil/imgutils.h" +#include "decode.h" static int pgx_get_number(AVCodecContext *avctx, GetByteContext *g, int *number) { int ret = AVERROR_INVALIDDATA; @@ -153,7 +152,7 @@ const FFCodec ff_pgx_decoder = { .p.name = "pgx", - .p.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"), + CODEC_LONG_NAME("PGX (JPEG2000 Test Format)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGX, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/photocd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/photocd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/photocd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/photocd.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,8 +36,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "thread.h" typedef struct PhotoCDContext { @@ -325,6 +325,9 @@ if (ret < 0) return ret; + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0) return ret; @@ -466,6 +469,6 @@ .close = photocd_decode_close, FF_CODEC_DECODE_CB(photocd_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .p.long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, + CODEC_LONG_NAME("Kodak Photo CD"), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pictordec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pictordec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pictordec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pictordec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "bytestream.h" #include "cga_data.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct PicContext { int width, height; @@ -162,6 +162,25 @@ if (av_image_check_size(s->width, s->height, 0, avctx) < 0) return -1; + + /* + There are 2 coding modes, RLE and RAW. + Undamaged RAW should be proportional to W*H and thus bigger than RLE + RLE codes the most compressed runs by + 1 byte for val (=marker) + 1 byte run (=0) + 2 bytes run + 1 byte val + thats 5 bytes and the maximum run we can code is 65535 + + The RLE decoder can exit prematurly but it does not on any image available + Based on this the formula is assumed correct for undamaged images. + If an image is found which exploits the special end + handling and breaks this formula then this needs to be adapted. + */ + if (bytestream2_get_bytes_left(&s->g) < s->width * s->height / 65535 * 5) + return AVERROR_INVALIDDATA; + if (s->width != avctx->width || s->height != avctx->height) { ret = ff_set_dimensions(avctx, s->width, s->height); if (ret < 0) @@ -243,8 +262,6 @@ run = bytestream2_get_le16(&s->g); val = bytestream2_get_byte(&s->g); } - if (!bytestream2_get_bytes_left(&s->g)) - break; if (bits_per_plane == 8) { picmemset_8bpp(s, frame, val, run, &x, &y); @@ -281,7 +298,7 @@ const FFCodec ff_pictor_decoder = { .p.name = "pictor", - .p.long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), + CODEC_LONG_NAME("Pictor/PC Paint"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PICTOR, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -109,6 +109,8 @@ ff_pixblockdsp_init_arm(c, avctx, high_bit_depth); #elif ARCH_PPC ff_pixblockdsp_init_ppc(c, avctx, high_bit_depth); +#elif ARCH_RISCV + ff_pixblockdsp_init_riscv(c, avctx, high_bit_depth); #elif ARCH_X86 ff_pixblockdsp_init_x86(c, avctx, high_bit_depth); #elif ARCH_MIPS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixblockdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -52,6 +52,8 @@ unsigned high_bit_depth); void ff_pixblockdsp_init_ppc(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); +void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); void ff_pixblockdsp_init_x86(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixlet.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixlet.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixlet.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pixlet.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,15 +21,13 @@ #include -#include "libavutil/imgutils.h" #include "libavutil/intmath.h" -#include "libavutil/opt.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "thread.h" #include "unary.h" @@ -694,7 +692,7 @@ const FFCodec ff_pixlet_decoder = { .p.name = "pixlet", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"), + CODEC_LONG_NAME("Apple Pixlet"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PIXLET, .init = pixlet_init, @@ -703,6 +701,5 @@ .priv_data_size = sizeof(PixletContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,15 +26,17 @@ #include "libavutil/avassert.h" #include "libavutil/bprint.h" #include "libavutil/crc.h" +#include "libavutil/csp.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" #include "libavutil/stereo3d.h" -#include "libavutil/mastering_display_metadata.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "apng.h" #include "png.h" #include "pngdsp.h" @@ -73,6 +75,11 @@ int have_chrm; uint32_t white_point[2]; uint32_t display_primaries[3][2]; + int have_srgb; + int have_cicp; + enum AVColorPrimaries cicp_primaries; + enum AVColorTransferCharacteristic cicp_trc; + enum AVColorRange cicp_range; enum PNGHeaderState hdr_state; enum PNGImageState pic_state; @@ -322,7 +329,7 @@ static void deloco_ ## NAME(TYPE *dst, int size, int alpha) \ { \ int i; \ - for (i = 0; i < size; i += 3 + alpha) { \ + for (i = 0; i < size - 2; i += 3 + alpha) { \ int g = dst [i + 1]; \ dst[i + 0] += g; \ dst[i + 2] += g; \ @@ -496,20 +503,20 @@ return ret; } -static uint8_t *iso88591_to_utf8(const uint8_t *in, size_t size_in) +static char *iso88591_to_utf8(const char *in, size_t size_in) { size_t extra = 0, i; - uint8_t *out, *q; + char *out, *q; for (i = 0; i < size_in; i++) - extra += in[i] >= 0x80; + extra += !!(in[i] & 0x80); if (size_in == SIZE_MAX || extra > SIZE_MAX - size_in - 1) return NULL; q = out = av_malloc(size_in + extra + 1); if (!out) return NULL; for (i = 0; i < size_in; i++) { - if (in[i] >= 0x80) { + if (in[i] & 0x80) { *(q++) = 0xC0 | (in[i] >> 6); *(q++) = 0x80 | (in[i] & 0x3F); } else { @@ -525,9 +532,10 @@ int ret, method; const uint8_t *data = gb->buffer; const uint8_t *data_end = gb->buffer_end; - const uint8_t *keyword = data; - const uint8_t *keyword_end = memchr(keyword, 0, data_end - keyword); - uint8_t *kw_utf8 = NULL, *text, *txt_utf8 = NULL; + const char *keyword = data; + const char *keyword_end = memchr(keyword, 0, data_end - data); + char *kw_utf8 = NULL, *txt_utf8 = NULL; + const char *text; unsigned text_len; AVBPrint bp; @@ -543,21 +551,20 @@ return AVERROR_INVALIDDATA; if ((ret = decode_zbuf(&bp, data, data_end, s->avctx)) < 0) return ret; + text = bp.str; text_len = bp.len; - ret = av_bprint_finalize(&bp, (char **)&text); - if (ret < 0) - return ret; } else { - text = (uint8_t *)data; - text_len = data_end - text; + text = data; + text_len = data_end - data; } - kw_utf8 = iso88591_to_utf8(keyword, keyword_end - keyword); txt_utf8 = iso88591_to_utf8(text, text_len); - if (text != data) - av_free(text); - if (!(kw_utf8 && txt_utf8)) { - av_free(kw_utf8); + if (compressed) + av_bprint_finalize(&bp, NULL); + if (!txt_utf8) + return AVERROR(ENOMEM); + kw_utf8 = iso88591_to_utf8(keyword, keyword_end - keyword); + if (!kw_utf8) { av_free(txt_utf8); return AVERROR(ENOMEM); } @@ -1231,6 +1238,7 @@ } av_log(avctx, AV_LOG_ERROR, ", skipping\n"); bytestream2_skip(&s->gb, length + 8); /* tag */ + continue; } } tag = bytestream2_get_le32(&s->gb); @@ -1311,6 +1319,24 @@ } break; } + case MKTAG('c', 'I', 'C', 'P'): + s->cicp_primaries = bytestream2_get_byte(&gb_chunk); + s->cicp_trc = bytestream2_get_byte(&gb_chunk); + if (bytestream2_get_byte(&gb_chunk) != 0) + av_log(avctx, AV_LOG_WARNING, "nonzero cICP matrix\n"); + s->cicp_range = bytestream2_get_byte(&gb_chunk); + if (s->cicp_range != 0 && s->cicp_range != 1) { + av_log(avctx, AV_LOG_ERROR, "invalid cICP range: %d\n", s->cicp_range); + ret = AVERROR_INVALIDDATA; + goto fail; + } + s->have_cicp = 1; + break; + case MKTAG('s', 'R', 'G', 'B'): + /* skip rendering intent byte */ + bytestream2_skip(&gb_chunk, 1); + s->have_srgb = 1; + break; case MKTAG('i', 'C', 'C', 'P'): { if ((ret = decode_iccp_chunk(s, &gb_chunk, p)) < 0) goto fail; @@ -1362,8 +1388,10 @@ return 0; } - if (percent_missing(s) > avctx->discard_damaged_percentage) - return AVERROR_INVALIDDATA; + if (percent_missing(s) > avctx->discard_damaged_percentage) { + ret = AVERROR_INVALIDDATA; + goto fail; + } if (s->bits_per_pixel <= 4) handle_small_bpp(s, p); @@ -1387,7 +1415,7 @@ if (s->has_trns && s->color_type != PNG_COLOR_TYPE_PALETTE) { size_t byte_depth = s->bit_depth > 8 ? 2 : 1; size_t raw_bpp = s->bpp - byte_depth; - unsigned x, y; + ptrdiff_t x, y; av_assert0(s->bit_depth > 1); @@ -1464,15 +1492,29 @@ s->stereo_mode = -1; s->have_chrm = 0; + s->have_srgb = 0; + s->have_cicp = 0; av_dict_free(&s->frame_metadata); } static int output_frame(PNGDecContext *s, AVFrame *f) { + AVCodecContext *avctx = s->avctx; int ret; - if (s->iccp_data) { + if (s->have_cicp) { + if (s->cicp_primaries >= AVCOL_PRI_NB) + av_log(avctx, AV_LOG_WARNING, "unrecognized cICP primaries\n"); + else + avctx->color_primaries = f->color_primaries = s->cicp_primaries; + if (s->cicp_trc >= AVCOL_TRC_NB) + av_log(avctx, AV_LOG_WARNING, "unrecognized cICP transfer\n"); + else + avctx->color_trc = f->color_trc = s->cicp_trc; + avctx->color_range = f->color_range = + s->cicp_range == 0 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; + } else if (s->iccp_data) { AVFrameSideData *sd = av_frame_new_side_data(f, AV_FRAME_DATA_ICC_PROFILE, s->iccp_data_len); if (!sd) { ret = AVERROR(ENOMEM); @@ -1481,8 +1523,33 @@ memcpy(sd->data, s->iccp_data, s->iccp_data_len); av_dict_set(&sd->metadata, "name", s->iccp_name, 0); + } else if (s->have_srgb) { + avctx->color_primaries = f->color_primaries = AVCOL_PRI_BT709; + avctx->color_trc = f->color_trc = AVCOL_TRC_IEC61966_2_1; + } else if (s->have_chrm) { + AVColorPrimariesDesc desc; + enum AVColorPrimaries prim; + desc.wp.x = av_make_q(s->white_point[0], 100000); + desc.wp.y = av_make_q(s->white_point[1], 100000); + desc.prim.r.x = av_make_q(s->display_primaries[0][0], 100000); + desc.prim.r.y = av_make_q(s->display_primaries[0][1], 100000); + desc.prim.g.x = av_make_q(s->display_primaries[1][0], 100000); + desc.prim.g.y = av_make_q(s->display_primaries[1][1], 100000); + desc.prim.b.x = av_make_q(s->display_primaries[2][0], 100000); + desc.prim.b.y = av_make_q(s->display_primaries[2][1], 100000); + prim = av_csp_primaries_id_from_desc(&desc); + if (prim != AVCOL_PRI_UNSPECIFIED) + avctx->color_primaries = f->color_primaries = prim; + else + av_log(avctx, AV_LOG_WARNING, "unknown cHRM primaries\n"); } + /* these chunks override gAMA */ + if (s->iccp_data || s->have_srgb || s->have_cicp) + av_dict_set(&s->frame_metadata, "gamma", NULL, 0); + + avctx->colorspace = f->colorspace = AVCOL_SPC_RGB; + if (s->stereo_mode >= 0) { AVStereo3D *stereo3d = av_stereo3d_create_side_data(f); if (!stereo3d) { @@ -1494,25 +1561,6 @@ stereo3d->flags = s->stereo_mode ? 0 : AV_STEREO3D_FLAG_INVERT; } - if (s->have_chrm) { - AVMasteringDisplayMetadata *mdm = av_mastering_display_metadata_create_side_data(f); - if (!mdm) { - ret = AVERROR(ENOMEM); - goto fail; - } - - mdm->white_point[0] = av_make_q(s->white_point[0], 100000); - mdm->white_point[1] = av_make_q(s->white_point[1], 100000); - - /* RGB Primaries */ - for (int i = 0; i < 3; i++) { - mdm->display_primaries[i][0] = av_make_q(s->display_primaries[i][0], 100000); - mdm->display_primaries[i][1] = av_make_q(s->display_primaries[i][1], 100000); - } - - mdm->has_primaries = 1; - } - FFSWAP(AVDictionary*, f->metadata, s->frame_metadata); return 0; @@ -1715,33 +1763,35 @@ #if CONFIG_APNG_DECODER const FFCodec ff_apng_decoder = { .p.name = "apng", - .p.long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), + CODEC_LONG_NAME("APNG (Animated Portable Network Graphics) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_APNG, .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, FF_CODEC_DECODE_CB(decode_frame_apng), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + UPDATE_THREAD_CONTEXT(update_thread_context), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_ALLOCATE_PROGRESS | + FF_CODEC_CAP_ICC_PROFILES, }; #endif #if CONFIG_PNG_DECODER const FFCodec ff_png_decoder = { .p.name = "png", - .p.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), + CODEC_LONG_NAME("PNG (Portable Network Graphics) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PNG, .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, FF_CODEC_DECODE_CB(decode_frame_png), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, - .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, + UPDATE_THREAD_CONTEXT(update_thread_context), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | + FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP | + FF_CODEC_CAP_ICC_PROFILES, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pngenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,10 @@ #include "libavutil/avassert.h" #include "libavutil/crc.h" +#include "libavutil/csp.h" #include "libavutil/libm.h" #include "libavutil/opt.h" -#include "libavutil/color_utils.h" +#include "libavutil/rational.h" #include "libavutil/stereo3d.h" #include @@ -120,7 +121,7 @@ } } -static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, +static void sub_png_paeth_prediction(uint8_t *dst, const uint8_t *src, const uint8_t *top, int w, int bpp) { int i; @@ -165,7 +166,7 @@ } static void png_filter_row(PNGEncContext *c, uint8_t *dst, int filter_type, - uint8_t *src, uint8_t *top, int size, int bpp) + const uint8_t *src, const uint8_t *top, int size, int bpp) { int i; @@ -194,7 +195,7 @@ } static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst, - uint8_t *src, uint8_t *top, int size, int bpp) + const uint8_t *src, const uint8_t *top, int size, int bpp) { int pred = s->filter_type; av_assert0(bpp || !pred); @@ -250,7 +251,7 @@ const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE); uint32_t crc = ~0U; - if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_number == 0) { + if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_num == 0) { png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, length); return; } @@ -294,51 +295,28 @@ } #define AV_WB32_PNG(buf, n) AV_WB32(buf, lrint((n) * 100000)) +#define AV_WB32_PNG_D(buf, d) AV_WB32_PNG(buf, av_q2d(d)) static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf) { - double rx, ry, gx, gy, bx, by, wx = 0.3127, wy = 0.3290; - switch (prim) { - case AVCOL_PRI_BT709: - rx = 0.640; ry = 0.330; - gx = 0.300; gy = 0.600; - bx = 0.150; by = 0.060; - break; - case AVCOL_PRI_BT470M: - rx = 0.670; ry = 0.330; - gx = 0.210; gy = 0.710; - bx = 0.140; by = 0.080; - wx = 0.310; wy = 0.316; - break; - case AVCOL_PRI_BT470BG: - rx = 0.640; ry = 0.330; - gx = 0.290; gy = 0.600; - bx = 0.150; by = 0.060; - break; - case AVCOL_PRI_SMPTE170M: - case AVCOL_PRI_SMPTE240M: - rx = 0.630; ry = 0.340; - gx = 0.310; gy = 0.595; - bx = 0.155; by = 0.070; - break; - case AVCOL_PRI_BT2020: - rx = 0.708; ry = 0.292; - gx = 0.170; gy = 0.797; - bx = 0.131; by = 0.046; - break; - default: - return 0; - } + const AVColorPrimariesDesc *desc = av_csp_primaries_desc_from_id(prim); + if (!desc) + return 0; + + AV_WB32_PNG_D(buf, desc->wp.x); + AV_WB32_PNG_D(buf + 4, desc->wp.y); + AV_WB32_PNG_D(buf + 8, desc->prim.r.x); + AV_WB32_PNG_D(buf + 12, desc->prim.r.y); + AV_WB32_PNG_D(buf + 16, desc->prim.g.x); + AV_WB32_PNG_D(buf + 20, desc->prim.g.y); + AV_WB32_PNG_D(buf + 24, desc->prim.b.x); + AV_WB32_PNG_D(buf + 28, desc->prim.b.y); - AV_WB32_PNG(buf , wx); AV_WB32_PNG(buf + 4 , wy); - AV_WB32_PNG(buf + 8 , rx); AV_WB32_PNG(buf + 12, ry); - AV_WB32_PNG(buf + 16, gx); AV_WB32_PNG(buf + 20, gy); - AV_WB32_PNG(buf + 24, bx); AV_WB32_PNG(buf + 28, by); return 1; } static int png_get_gama(enum AVColorTransferCharacteristic trc, uint8_t *buf) { - double gamma = avpriv_get_gamma_from_trc(trc); + double gamma = av_csp_approximate_trc_gamma(trc); if (gamma <= 1e-6) return 0; @@ -433,11 +411,30 @@ } } + side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_ICC_PROFILE); + if ((ret = png_write_iccp(s, side_data))) + return ret; + /* write colorspace information */ if (pict->color_primaries == AVCOL_PRI_BT709 && pict->color_trc == AVCOL_TRC_IEC61966_2_1) { s->buf[0] = 1; /* rendering intent, relative colorimetric by default */ png_write_chunk(&s->bytestream, MKTAG('s', 'R', 'G', 'B'), s->buf, 1); + } else if (pict->color_trc != AVCOL_TRC_UNSPECIFIED && !side_data) { + /* + * Avoid writing cICP if the transfer is unknown. Known primaries + * with unknown transfer can be handled by cHRM. + * + * We also avoid writing cICP if an ICC Profile is present, because + * the standard requires that cICP overrides iCCP. + * + * These values match H.273 so no translation is needed. + */ + s->buf[0] = pict->color_primaries; + s->buf[1] = pict->color_trc; + s->buf[2] = 0; /* colorspace = RGB */ + s->buf[3] = pict->color_range == AVCOL_RANGE_MPEG ? 0 : 1; + png_write_chunk(&s->bytestream, MKTAG('c', 'I', 'C', 'P'), s->buf, 4); } if (png_get_chrm(pict->color_primaries, s->buf)) @@ -445,10 +442,6 @@ if (png_get_gama(pict->color_trc, s->buf)) png_write_chunk(&s->bytestream, MKTAG('g', 'A', 'M', 'A'), s->buf, 4); - side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_ICC_PROFILE); - if ((ret = png_write_iccp(s, side_data))) - return ret; - /* put the palette if needed, must be after colorspace information */ if (s->color_type == PNG_COLOR_TYPE_PALETTE) { int has_alpha, alpha, i; @@ -486,7 +479,7 @@ const AVFrame *const p = pict; int y, len, ret; int row_size, pass_row_size; - uint8_t *ptr, *top, *crow_buf, *crow; + uint8_t *crow_buf, *crow; uint8_t *crow_base = NULL; uint8_t *progressive_buf = NULL; uint8_t *top_buf = NULL; @@ -520,10 +513,10 @@ * output */ pass_row_size = ff_png_pass_row_size(pass, s->bits_per_pixel, pict->width); if (pass_row_size > 0) { - top = NULL; + uint8_t *top = NULL; for (y = 0; y < pict->height; y++) if ((ff_png_pass_ymask[pass] << (y & 7)) & 0x80) { - ptr = p->data[0] + y * p->linesize[0]; + const uint8_t *ptr = p->data[0] + y * p->linesize[0]; FFSWAP(uint8_t *, progressive_buf, top_buf); png_get_interlaced_row(progressive_buf, pass_row_size, s->bits_per_pixel, pass, @@ -536,9 +529,9 @@ } } } else { - top = NULL; + const uint8_t *top = NULL; for (y = 0; y < pict->height; y++) { - ptr = p->data[0] + y * p->linesize[0]; + const uint8_t *ptr = p->data[0] + y * p->linesize[0]; crow = png_choose_filter(s, crow_buf, ptr, top, row_size, s->bits_per_pixel >> 3); png_write_row(avctx, crow, row_size + 1); @@ -723,7 +716,7 @@ } for (y = topmost_y; y < bottommost_y; ++y) { - uint8_t *foreground = input->data[0] + input_linesize * y + bpp * leftmost_x; + const uint8_t *foreground = input->data[0] + input_linesize * y + bpp * leftmost_x; uint8_t *background = output->data[0] + output_linesize * y + bpp * leftmost_x; output_data = output->data[0] + output_linesize * (y - topmost_y); for (x = leftmost_x; x < rightmost_x; ++x, foreground += bpp, background += bpp, output_data += bpp) { @@ -806,7 +799,7 @@ APNGFctlChunk last_fctl_chunk = *best_last_fctl_chunk; APNGFctlChunk fctl_chunk = *best_fctl_chunk; - if (avctx->frame_number == 0) { + if (avctx->frame_num == 0) { best_fctl_chunk->width = pict->width; best_fctl_chunk->height = pict->height; best_fctl_chunk->x_offset = 0; @@ -931,7 +924,7 @@ if (pict && s->color_type == PNG_COLOR_TYPE_PALETTE) { uint32_t checksum = ~av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), ~0U, pict->data[1], 256 * sizeof(uint32_t)); - if (avctx->frame_number == 0) { + if (avctx->frame_num == 0) { s->palette_checksum = checksum; } else if (checksum != s->palette_checksum) { av_log(avctx, AV_LOG_ERROR, @@ -953,7 +946,7 @@ if (max_packet_size > INT_MAX) return AVERROR(ENOMEM); - if (avctx->frame_number == 0) { + if (avctx->frame_num == 0) { if (!pict) return AVERROR(EINVAL); @@ -976,7 +969,12 @@ return ret; memcpy(pkt->data, s->last_frame_packet, s->last_frame_packet_size); - pkt->pts = pkt->dts = s->last_frame->pts; + pkt->pts = s->last_frame->pts; + pkt->duration = s->last_frame->duration; + + ret = ff_encode_reordered_opaque(avctx, pkt, s->last_frame); + if (ret < 0) + return ret; } if (pict) { @@ -1056,7 +1054,7 @@ } av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, (AVFrame*)pict); + ret = av_frame_ref(s->last_frame, pict); if (ret < 0) return ret; @@ -1193,14 +1191,15 @@ const FFCodec ff_png_encoder = { .p.name = "png", - .p.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), + CODEC_LONG_NAME("PNG (Portable Network Graphics) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PNG, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, FF_CODEC_ENCODE_CB(encode_png), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, @@ -1210,15 +1209,16 @@ AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, .p.priv_class = &pngenc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_ICC_PROFILES, }; const FFCodec ff_apng_encoder = { .p.name = "apng", - .p.long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), + CODEC_LONG_NAME("APNG (Animated Portable Network Graphics) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_APNG, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, @@ -1232,5 +1232,5 @@ AV_PIX_FMT_NONE }, .p.priv_class = &pngenc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_ICC_PROFILES, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "libavutil/imgutils.h" #include "libavutil/avstring.h" #include "avcodec.h" -#include "internal.h" +#include "decode.h" #include "pnm.h" static inline int pnm_space(int c) @@ -38,7 +38,7 @@ { char *s; int c; - uint8_t *bs = sc->bytestream; + const uint8_t *bs = sc->bytestream; const uint8_t *end = sc->bytestream_end; /* skip spaces and comments */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,12 +21,13 @@ #include "config_components.h" +#include "libavutil/half2float.h" + #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "put_bits.h" #include "pnm.h" -#include "half2float.h" static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval) { @@ -52,12 +53,15 @@ float scale; s->bytestream_start = - s->bytestream = (uint8_t *)buf; - s->bytestream_end = (uint8_t *)buf + buf_size; + s->bytestream = buf; + s->bytestream_end = buf + buf_size; if ((ret = ff_pnm_decode_header(avctx, s)) < 0) return ret; + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; p->pict_type = AV_PICTURE_TYPE_I; @@ -166,23 +170,23 @@ ptr+= linesize; } }else{ - for (i = 0; i < avctx->height; i++) { - if (!upgrade) - samplecpy(ptr, s->bytestream, n, s->maxval); - else if (upgrade == 1) { - unsigned int j, f = (255 * 128 + s->maxval / 2) / s->maxval; - for (j = 0; j < n; j++) - ptr[j] = (s->bytestream[j] * f + 64) >> 7; - } else if (upgrade == 2) { - unsigned int j, v, f = (65535 * 32768 + s->maxval / 2) / s->maxval; - for (j = 0; j < n / 2; j++) { - v = AV_RB16(s->bytestream + 2*j); - ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15; + for (int i = 0; i < avctx->height; i++) { + if (!upgrade) + samplecpy(ptr, s->bytestream, n, s->maxval); + else if (upgrade == 1) { + unsigned int f = (255 * 128 + s->maxval / 2) / s->maxval; + for (unsigned j = 0; j < n; j++) + ptr[j] = (s->bytestream[j] * f + 64) >> 7; + } else if (upgrade == 2) { + unsigned int f = (65535 * 32768 + s->maxval / 2) / s->maxval; + for (unsigned j = 0; j < n / 2; j++) { + unsigned v = AV_RB16(s->bytestream + 2*j); + ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15; + } } + s->bytestream += n; + ptr += linesize; } - s->bytestream += n; - ptr += linesize; - } } break; case AV_PIX_FMT_YUV420P: @@ -260,46 +264,46 @@ break; case AV_PIX_FMT_GBRPF32: if (!s->half) { - if (avctx->width * avctx->height * 12 > s->bytestream_end - s->bytestream) - return AVERROR_INVALIDDATA; - scale = 1.f / s->scale; - if (s->endian) { - float *r, *g, *b; - - r = (float *)p->data[2]; - g = (float *)p->data[0]; - b = (float *)p->data[1]; - for (int i = 0; i < avctx->height; i++) { - for (int j = 0; j < avctx->width; j++) { - r[j] = av_int2float(AV_RL32(s->bytestream+0)) * scale; - g[j] = av_int2float(AV_RL32(s->bytestream+4)) * scale; - b[j] = av_int2float(AV_RL32(s->bytestream+8)) * scale; - s->bytestream += 12; - } + if (avctx->width * avctx->height * 12 > s->bytestream_end - s->bytestream) + return AVERROR_INVALIDDATA; + scale = 1.f / s->scale; + if (s->endian) { + float *r, *g, *b; - r += p->linesize[2] / 4; - g += p->linesize[0] / 4; - b += p->linesize[1] / 4; - } - } else { - float *r, *g, *b; + r = (float *)p->data[2]; + g = (float *)p->data[0]; + b = (float *)p->data[1]; + for (int i = 0; i < avctx->height; i++) { + for (int j = 0; j < avctx->width; j++) { + r[j] = av_int2float(AV_RL32(s->bytestream+0)) * scale; + g[j] = av_int2float(AV_RL32(s->bytestream+4)) * scale; + b[j] = av_int2float(AV_RL32(s->bytestream+8)) * scale; + s->bytestream += 12; + } - r = (float *)p->data[2]; - g = (float *)p->data[0]; - b = (float *)p->data[1]; - for (int i = 0; i < avctx->height; i++) { - for (int j = 0; j < avctx->width; j++) { - r[j] = av_int2float(AV_RB32(s->bytestream+0)) * scale; - g[j] = av_int2float(AV_RB32(s->bytestream+4)) * scale; - b[j] = av_int2float(AV_RB32(s->bytestream+8)) * scale; - s->bytestream += 12; + r += p->linesize[2] / 4; + g += p->linesize[0] / 4; + b += p->linesize[1] / 4; } + } else { + float *r, *g, *b; + + r = (float *)p->data[2]; + g = (float *)p->data[0]; + b = (float *)p->data[1]; + for (int i = 0; i < avctx->height; i++) { + for (int j = 0; j < avctx->width; j++) { + r[j] = av_int2float(AV_RB32(s->bytestream+0)) * scale; + g[j] = av_int2float(AV_RB32(s->bytestream+4)) * scale; + b[j] = av_int2float(AV_RB32(s->bytestream+8)) * scale; + s->bytestream += 12; + } - r += p->linesize[2] / 4; - g += p->linesize[0] / 4; - b += p->linesize[1] / 4; + r += p->linesize[2] / 4; + g += p->linesize[0] / 4; + b += p->linesize[1] / 4; + } } - } } else { if (avctx->width * avctx->height * 6 > s->bytestream_end - s->bytestream) return AVERROR_INVALIDDATA; @@ -312,18 +316,9 @@ b = (float *)p->data[1]; for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - r[j] = av_int2float(half2float(AV_RL16(s->bytestream+0), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; - g[j] = av_int2float(half2float(AV_RL16(s->bytestream+2), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; - b[j] = av_int2float(half2float(AV_RL16(s->bytestream+4), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; + r[j] = av_int2float(half2float(AV_RL16(s->bytestream+0), &s->h2f_tables)) * scale; + g[j] = av_int2float(half2float(AV_RL16(s->bytestream+2), &s->h2f_tables)) * scale; + b[j] = av_int2float(half2float(AV_RL16(s->bytestream+4), &s->h2f_tables)) * scale; s->bytestream += 6; } @@ -339,18 +334,9 @@ b = (float *)p->data[1]; for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - r[j] = av_int2float(half2float(AV_RB16(s->bytestream+0), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; - g[j] = av_int2float(half2float(AV_RB16(s->bytestream+2), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; - b[j] = av_int2float(half2float(AV_RB16(s->bytestream+4), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; + r[j] = av_int2float(half2float(AV_RB16(s->bytestream+0), &s->h2f_tables)) * scale; + g[j] = av_int2float(half2float(AV_RB16(s->bytestream+2), &s->h2f_tables)) * scale; + b[j] = av_int2float(half2float(AV_RB16(s->bytestream+4), &s->h2f_tables)) * scale; s->bytestream += 6; } @@ -358,32 +344,40 @@ g += p->linesize[0] / 4; b += p->linesize[1] / 4; } - } } + } + } + /* PFM is encoded from bottom to top */ + p->data[0] += (avctx->height - 1) * p->linesize[0]; + p->data[1] += (avctx->height - 1) * p->linesize[1]; + p->data[2] += (avctx->height - 1) * p->linesize[2]; + p->linesize[0] = -p->linesize[0]; + p->linesize[1] = -p->linesize[1]; + p->linesize[2] = -p->linesize[2]; break; case AV_PIX_FMT_GRAYF32: if (!s->half) { - if (avctx->width * avctx->height * 4 > s->bytestream_end - s->bytestream) - return AVERROR_INVALIDDATA; - scale = 1.f / s->scale; - if (s->endian) { - float *g = (float *)p->data[0]; - for (int i = 0; i < avctx->height; i++) { - for (int j = 0; j < avctx->width; j++) { - g[j] = av_int2float(AV_RL32(s->bytestream)) * scale; - s->bytestream += 4; + if (avctx->width * avctx->height * 4 > s->bytestream_end - s->bytestream) + return AVERROR_INVALIDDATA; + scale = 1.f / s->scale; + if (s->endian) { + float *g = (float *)p->data[0]; + for (int i = 0; i < avctx->height; i++) { + for (int j = 0; j < avctx->width; j++) { + g[j] = av_int2float(AV_RL32(s->bytestream)) * scale; + s->bytestream += 4; + } + g += p->linesize[0] / 4; } - g += p->linesize[0] / 4; - } - } else { - float *g = (float *)p->data[0]; - for (int i = 0; i < avctx->height; i++) { - for (int j = 0; j < avctx->width; j++) { - g[j] = av_int2float(AV_RB32(s->bytestream)) * scale; - s->bytestream += 4; + } else { + float *g = (float *)p->data[0]; + for (int i = 0; i < avctx->height; i++) { + for (int j = 0; j < avctx->width; j++) { + g[j] = av_int2float(AV_RB32(s->bytestream)) * scale; + s->bytestream += 4; + } + g += p->linesize[0] / 4; } - g += p->linesize[0] / 4; } - } } else { if (avctx->width * avctx->height * 2 > s->bytestream_end - s->bytestream) return AVERROR_INVALIDDATA; @@ -392,10 +386,7 @@ float *g = (float *)p->data[0]; for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - g[j] = av_int2float(half2float(AV_RL16(s->bytestream), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; + g[j] = av_int2float(half2float(AV_RL16(s->bytestream), &s->h2f_tables)) * scale; s->bytestream += 2; } g += p->linesize[0] / 4; @@ -404,16 +395,16 @@ float *g = (float *)p->data[0]; for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - g[j] = av_int2float(half2float(AV_RB16(s->bytestream), - s->mantissatable, - s->exponenttable, - s->offsettable)) * scale; + g[j] = av_int2float(half2float(AV_RB16(s->bytestream), &s->h2f_tables)) * scale; s->bytestream += 2; } g += p->linesize[0] / 4; } } } + /* PFM is encoded from bottom to top */ + p->data[0] += (avctx->height - 1) * p->linesize[0]; + p->linesize[0] = -p->linesize[0]; break; } *got_frame = 1; @@ -425,11 +416,12 @@ #if CONFIG_PGM_DECODER const FFCodec ff_pgm_decoder = { .p.name = "pgm", - .p.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), + CODEC_LONG_NAME("PGM (Portable GrayMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -437,11 +429,12 @@ #if CONFIG_PGMYUV_DECODER const FFCodec ff_pgmyuv_decoder = { .p.name = "pgmyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), + CODEC_LONG_NAME("PGMYUV (Portable GrayMap YUV) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGMYUV, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -449,11 +442,12 @@ #if CONFIG_PPM_DECODER const FFCodec ff_ppm_decoder = { .p.name = "ppm", - .p.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), + CODEC_LONG_NAME("PPM (Portable PixelMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PPM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -461,11 +455,12 @@ #if CONFIG_PBM_DECODER const FFCodec ff_pbm_decoder = { .p.name = "pbm", - .p.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), + CODEC_LONG_NAME("PBM (Portable BitMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PBM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -473,11 +468,12 @@ #if CONFIG_PAM_DECODER const FFCodec ff_pam_decoder = { .p.name = "pam", - .p.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), + CODEC_LONG_NAME("PAM (Portable AnyMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PAM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -485,11 +481,12 @@ #if CONFIG_PFM_DECODER const FFCodec ff_pfm_decoder = { .p.name = "pfm", - .p.long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), + CODEC_LONG_NAME("PFM (Portable FloatMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PFM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -499,19 +496,20 @@ { PNMContext *s = avctx->priv_data; - half2float_table(s->mantissatable, s->exponenttable, s->offsettable); + ff_init_half2float_tables(&s->h2f_tables); return 0; } const FFCodec ff_phm_decoder = { .p.name = "phm", - .p.long_name = NULL_IF_CONFIG_SMALL("PHM (Portable HalfFloatMap) image"), + CODEC_LONG_NAME("PHM (Portable HalfFloatMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PHM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .init = phm_dec_init, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,14 +24,13 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" +#include "libavutil/float2half.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "float2half.h" typedef struct PHMEncContext { - uint16_t basetable[512]; - uint8_t shifttable[512]; + Float2HalfTables f2h_tables; } PHMEncContext; static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, @@ -40,11 +39,13 @@ PHMEncContext *s = avctx->priv_data; uint8_t *bytestream, *bytestream_start, *bytestream_end; int i, h, h1, c, n, linesize, ret; - uint8_t *ptr, *ptr1, *ptr2; int size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); - if ((ret = ff_get_encode_buffer(avctx, pkt, size + 200, 0)) < 0) + if (size < 0) + return size; + + if ((ret = ff_get_encode_buffer(avctx, pkt, size + 200U, 0)) < 0) return ret; bytestream_start = @@ -135,9 +136,10 @@ if ((avctx->pix_fmt == AV_PIX_FMT_GBRPF32LE || avctx->pix_fmt == AV_PIX_FMT_GBRPF32BE) && c == 'F') { - float *r = (float *)p->data[2]; - float *g = (float *)p->data[0]; - float *b = (float *)p->data[1]; + /* PFM is encoded from bottom to top */ + const float *r = (const float *)(p->data[2] + p->linesize[2] * (avctx->height - 1)); + const float *g = (const float *)(p->data[0] + p->linesize[0] * (avctx->height - 1)); + const float *b = (const float *)(p->data[1] + p->linesize[1] * (avctx->height - 1)); for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { @@ -147,13 +149,14 @@ bytestream += 12; } - r += p->linesize[2] / 4; - g += p->linesize[0] / 4; - b += p->linesize[1] / 4; + r -= p->linesize[2] / 4; + g -= p->linesize[0] / 4; + b -= p->linesize[1] / 4; } } else if ((avctx->pix_fmt == AV_PIX_FMT_GRAYF32LE || avctx->pix_fmt == AV_PIX_FMT_GRAYF32BE) && c == 'f') { - const float *g = (const float *)p->data[0]; + /* PFM is encoded from bottom to top */ + const float *g = (const float *)(p->data[0] + p->linesize[0] * (avctx->height - 1)); for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { @@ -161,18 +164,18 @@ bytestream += 4; } - g += p->linesize[0] / 4; + g -= p->linesize[0] / 4; } } else if (avctx->pix_fmt == AV_PIX_FMT_GBRPF32 && c == 'H') { - float *r = (float *)p->data[2]; - float *g = (float *)p->data[0]; - float *b = (float *)p->data[1]; + const float *r = (const float *)p->data[2]; + const float *g = (const float *)p->data[0]; + const float *b = (const float *)p->data[1]; for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - AV_WN16(bytestream + 0, float2half(av_float2int(r[j]), s->basetable, s->shifttable)); - AV_WN16(bytestream + 2, float2half(av_float2int(g[j]), s->basetable, s->shifttable)); - AV_WN16(bytestream + 4, float2half(av_float2int(b[j]), s->basetable, s->shifttable)); + AV_WN16(bytestream + 0, float2half(av_float2int(r[j]), &s->f2h_tables)); + AV_WN16(bytestream + 2, float2half(av_float2int(g[j]), &s->f2h_tables)); + AV_WN16(bytestream + 4, float2half(av_float2int(b[j]), &s->f2h_tables)); bytestream += 6; } @@ -185,14 +188,14 @@ for (int i = 0; i < avctx->height; i++) { for (int j = 0; j < avctx->width; j++) { - AV_WN16(bytestream, float2half(av_float2int(g[j]), s->basetable, s->shifttable)); + AV_WN16(bytestream, float2half(av_float2int(g[j]), &s->f2h_tables)); bytestream += 2; } g += p->linesize[0] / 4; } } else { - ptr = p->data[0]; + const uint8_t *ptr = p->data[0]; linesize = p->linesize[0]; for (i = 0; i < h; i++) { memcpy(bytestream, ptr, n); @@ -202,10 +205,9 @@ } if (avctx->pix_fmt == AV_PIX_FMT_YUV420P || avctx->pix_fmt == AV_PIX_FMT_YUV420P16BE) { + const uint8_t *ptr1 = p->data[1], *ptr2 = p->data[2]; h >>= 1; n >>= 1; - ptr1 = p->data[1]; - ptr2 = p->data[2]; for (i = 0; i < h; i++) { memcpy(bytestream, ptr1, n); bytestream += n; @@ -224,76 +226,71 @@ #if CONFIG_PGM_ENCODER const FFCodec ff_pgm_encoder = { .p.name = "pgm", - .p.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), + CODEC_LONG_NAME("PGM (Portable GrayMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PGMYUV_ENCODER const FFCodec ff_pgmyuv_encoder = { .p.name = "pgmyuv", - .p.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), + CODEC_LONG_NAME("PGMYUV (Portable GrayMap YUV) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGMYUV, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PPM_ENCODER const FFCodec ff_ppm_encoder = { .p.name = "ppm", - .p.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), + CODEC_LONG_NAME("PPM (Portable PixelMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PPM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PBM_ENCODER const FFCodec ff_pbm_encoder = { .p.name = "pbm", - .p.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), + CODEC_LONG_NAME("PBM (Portable BitMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PBM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PFM_ENCODER const FFCodec ff_pfm_encoder = { .p.name = "pfm", - .p.long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), + CODEC_LONG_NAME("PFM (Portable FloatMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PFM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32LE, AV_PIX_FMT_GRAYF32LE, AV_PIX_FMT_GBRPF32BE, AV_PIX_FMT_GRAYF32BE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -302,23 +299,22 @@ { PHMEncContext *s = avctx->priv_data; - float2half_tables(s->basetable, s->shifttable); + ff_init_float2half_tables(&s->f2h_tables); return 0; } const FFCodec ff_phm_encoder = { .p.name = "phm", - .p.long_name = NULL_IF_CONFIG_SMALL("PHM (Portable HalfFloatMap) image"), + CODEC_LONG_NAME("PHM (Portable HalfFloatMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PHM, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(PHMEncContext), .init = phm_enc_init, FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GRAYF32, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,21 +22,20 @@ #ifndef AVCODEC_PNM_H #define AVCODEC_PNM_H +#include "libavutil/half2float.h" #include "avcodec.h" typedef struct PNMContext { - uint8_t *bytestream; - uint8_t *bytestream_start; - uint8_t *bytestream_end; + const uint8_t *bytestream; + const uint8_t *bytestream_start; + const uint8_t *bytestream_end; int maxval; ///< maximum value of a pixel int type; int endian; int half; float scale; - uint32_t mantissatable[2048]; - uint32_t exponenttable[64]; - uint16_t offsettable[64]; + Half2FloatTables h2f_tables; } PNMContext; int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pnm_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -65,8 +65,8 @@ pnmctx.bytestream_end = pc->buffer + pc->index; } else { pnmctx.bytestream_start = - pnmctx.bytestream = (uint8_t *) buf + skip; /* casts avoid warnings */ - pnmctx.bytestream_end = (uint8_t *) buf + buf_size - skip; + pnmctx.bytestream = buf + skip; + pnmctx.bytestream_end = buf + buf_size - skip; } if (ff_pnm_decode_header(avctx, &pnmctx) < 0) { if (pnmctx.bytestream < pnmctx.bytestream_end) { @@ -81,9 +81,9 @@ goto retry; } } else if (pnmctx.type < 4) { - uint8_t *bs = pnmctx.bytestream; + const uint8_t *bs = pnmctx.bytestream; const uint8_t *end = pnmctx.bytestream_end; - uint8_t *sync = bs; + const uint8_t *sync = bs; if (pc->index) { av_assert0(pnmpc->ascii_scan <= end - bs); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/fmtconvert_altivec.c 2023-03-03 13:29:59.000000000 +0000 @@ -54,8 +54,7 @@ #endif /* HAVE_ALTIVEC */ -av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c, - AVCodecContext *avctx) +av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/h264chroma_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/h264chroma_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/h264chroma_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/h264chroma_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -109,7 +109,7 @@ #endif /* HAVE_BIGENDIAN */ #ifdef PREFIX_h264_chroma_mc8_altivec -static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, +static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, const uint8_t * src, ptrdiff_t stride, int h, int x, int y) { @@ -184,7 +184,7 @@ /* this code assume that stride % 16 == 0 */ #ifdef PREFIX_no_rnd_vc1_chroma_mc8_altivec -static void PREFIX_no_rnd_vc1_chroma_mc8_altivec(uint8_t *dst, uint8_t *src, +static void PREFIX_no_rnd_vc1_chroma_mc8_altivec(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -14,8 +14,7 @@ OBJS-$(CONFIG_LLVIDDSP) += ppc/lossless_videodsp_altivec.o OBJS-$(CONFIG_ME_CMP) += ppc/me_cmp.o OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodsp_altivec.o -OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o \ - ppc/mpegvideodsp.o +OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o OBJS-$(CONFIG_MPEGVIDEOENC) += ppc/mpegvideoencdsp.o OBJS-$(CONFIG_PIXBLOCKDSP) += ppc/pixblockdsp.o OBJS-$(CONFIG_VC1DSP) += ppc/vc1dsp_altivec.o @@ -26,6 +25,7 @@ # decoders/encoders OBJS-$(CONFIG_HEVC_DECODER) += ppc/hevcdsp.o OBJS-$(CONFIG_LLAUDDSP) += ppc/lossless_audiodsp_altivec.o +OBJS-$(CONFIG_MPEG4_DECODER) += ppc/mpeg4videodsp.o OBJS-$(CONFIG_SVQ1_ENCODER) += ppc/svq1enc_altivec.o OBJS-$(CONFIG_VORBIS_DECODER) += ppc/vorbisdsp_altivec.o OBJS-$(CONFIG_VP7_DECODER) += ppc/vp8dsp_altivec.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/me_cmp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/me_cmp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/me_cmp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/me_cmp.c 2023-03-03 13:29:59.000000000 +0000 @@ -51,7 +51,7 @@ iv = vec_vsx_ld(1, pix);\ } #endif -static int sad16_x2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_x2_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -91,7 +91,7 @@ return s; } -static int sad16_y2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_y2_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -102,7 +102,7 @@ vector unsigned int sad = (vector unsigned int) vec_splat_u32(0); vector signed int sumdiffs; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; /* Due to the fact that pix3 = pix2 + stride, the pix3 of one * iteration becomes pix2 in the next iteration. We can use this @@ -141,12 +141,12 @@ return s; } -static int sad16_xy2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_xy2_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; int __attribute__((aligned(16))) s = 0; - uint8_t *pix3 = pix2 + stride; + const uint8_t *pix3 = pix2 + stride; const vector unsigned char zero = (const vector unsigned char) vec_splat_u8(0); const vector unsigned short two = @@ -230,7 +230,7 @@ return s; } -static int sad16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -265,7 +265,7 @@ return s; } -static int sad8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sad8_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -309,7 +309,7 @@ /* Sum of Squared Errors for an 8x8 block, AltiVec-enhanced. * It's the sad8_altivec code above w/ squaring added. */ -static int sse8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sse8_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -354,7 +354,7 @@ /* Sum of Squared Errors for a 16x16 block, AltiVec-enhanced. * It's the sad16_altivec code above w/ squaring added. */ -static int sse16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +static int sse16_altivec(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int i; @@ -392,8 +392,8 @@ return s; } -static int hadamard8_diff8x8_altivec(MpegEncContext *s, uint8_t *dst, - uint8_t *src, ptrdiff_t stride, int h) +static int hadamard8_diff8x8_altivec(MpegEncContext *s, const uint8_t *dst, + const uint8_t *src, ptrdiff_t stride, int h) { int __attribute__((aligned(16))) sum; register const vector unsigned char vzero = @@ -518,8 +518,8 @@ * On the 970, the hand-made RA is still a win (around 690 vs. around 780), * but xlc goes to around 660 on the regular C code... */ -static int hadamard8_diff16x8_altivec(MpegEncContext *s, uint8_t *dst, - uint8_t *src, ptrdiff_t stride, int h) +static int hadamard8_diff16x8_altivec(MpegEncContext *s, const uint8_t *dst, + const uint8_t *src, ptrdiff_t stride, int h) { int __attribute__((aligned(16))) sum; register vector signed short @@ -709,8 +709,8 @@ return sum; } -static int hadamard8_diff16_altivec(MpegEncContext *s, uint8_t *dst, - uint8_t *src, ptrdiff_t stride, int h) +static int hadamard8_diff16_altivec(MpegEncContext *s, const uint8_t *dst, + const uint8_t *src, ptrdiff_t stride, int h) { int score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpeg4videodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpeg4videodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpeg4videodsp.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpeg4videodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * GMC (Global Motion Compensation), AltiVec-enabled + * + * Copyright (c) 2003 Romain Dolbeau + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/mem_internal.h" +#include "libavutil/ppc/cpu.h" +#include "libavutil/ppc/util_altivec.h" + +#include "libavcodec/mpeg4videodsp.h" + +#if HAVE_ALTIVEC +/* AltiVec-enhanced gmc1. ATM this code assumes stride is a multiple of 8 + * to preserve proper dst alignment. */ +static void gmc1_altivec(uint8_t *dst /* align 8 */, const uint8_t *src /* align1 */, + int stride, int h, int x16, int y16, int rounder) +{ + int i; + const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder; + const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = { + (16 - x16) * (16 - y16), /* A */ + (x16) * (16 - y16), /* B */ + (16 - x16) * (y16), /* C */ + (x16) * (y16), /* D */ + 0, 0, 0, 0 /* padding */ + }; + register const vector unsigned char vczero = + (const vector unsigned char) vec_splat_u8(0); + register const vector unsigned short vcsr8 = + (const vector unsigned short) vec_splat_u16(8); + register vector unsigned char dstv, dstv2, srcvB, srcvC, srcvD; + register vector unsigned short tempB, tempC, tempD; + unsigned long dst_odd = (unsigned long) dst & 0x0000000F; + unsigned long src_really_odd = (unsigned long) src & 0x0000000F; + register vector unsigned short tempA = + vec_ld(0, (const unsigned short *) ABCD); + register vector unsigned short Av = vec_splat(tempA, 0); + register vector unsigned short Bv = vec_splat(tempA, 1); + register vector unsigned short Cv = vec_splat(tempA, 2); + register vector unsigned short Dv = vec_splat(tempA, 3); + register vector unsigned short rounderV = + vec_splat((vec_u16) vec_lde(0, &rounder_a), 0); + + /* we'll be able to pick-up our 9 char elements at src from those + * 32 bytes we load the first batch here, as inside the loop we can + * reuse 'src + stride' from one iteration as the 'src' of the next. */ + register vector unsigned char src_0 = vec_ld(0, src); + register vector unsigned char src_1 = vec_ld(16, src); + register vector unsigned char srcvA = vec_perm(src_0, src_1, + vec_lvsl(0, src)); + + if (src_really_odd != 0x0000000F) + /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned + * on the second vector. */ + srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src)); + else + srcvB = src_1; + srcvA = vec_mergeh(vczero, srcvA); + srcvB = vec_mergeh(vczero, srcvB); + + for (i = 0; i < h; i++) { + dst_odd = (unsigned long) dst & 0x0000000F; + src_really_odd = (((unsigned long) src) + stride) & 0x0000000F; + + dstv = vec_ld(0, dst); + + /* We'll be able to pick-up our 9 char elements at src + stride from + * those 32 bytes then reuse the resulting 2 vectors srvcC and srcvD + * as the next srcvA and srcvB. */ + src_0 = vec_ld(stride + 0, src); + src_1 = vec_ld(stride + 16, src); + srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src)); + + if (src_really_odd != 0x0000000F) + /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned + * on the second vector. */ + srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src)); + else + srcvD = src_1; + + srcvC = vec_mergeh(vczero, srcvC); + srcvD = vec_mergeh(vczero, srcvD); + + /* OK, now we (finally) do the math :-) + * Those four instructions replace 32 int muls & 32 int adds. + * Isn't AltiVec nice? */ + tempA = vec_mladd((vector unsigned short) srcvA, Av, rounderV); + tempB = vec_mladd((vector unsigned short) srcvB, Bv, tempA); + tempC = vec_mladd((vector unsigned short) srcvC, Cv, tempB); + tempD = vec_mladd((vector unsigned short) srcvD, Dv, tempC); + + srcvA = srcvC; + srcvB = srcvD; + + tempD = vec_sr(tempD, vcsr8); + + dstv2 = vec_pack(tempD, (vector unsigned short) vczero); + + if (dst_odd) + dstv2 = vec_perm(dstv, dstv2, vcprm(0, 1, s0, s1)); + else + dstv2 = vec_perm(dstv, dstv2, vcprm(s0, s1, 2, 3)); + + vec_st(dstv2, 0, dst); + + dst += stride; + src += stride; + } +} +#endif /* HAVE_ALTIVEC */ + +av_cold void ff_mpeg4videodsp_init_ppc(Mpeg4VideoDSPContext *c) +{ +#if HAVE_ALTIVEC + if (!PPC_ALTIVEC(av_get_cpu_flags())) + return; + + c->gmc1 = gmc1_altivec; +#endif /* HAVE_ALTIVEC */ +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideodsp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* - * GMC (Global Motion Compensation), AltiVec-enabled - * - * Copyright (c) 2003 Romain Dolbeau - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "libavutil/attributes.h" -#include "libavutil/cpu.h" -#include "libavutil/mem_internal.h" -#include "libavutil/ppc/cpu.h" -#include "libavutil/ppc/util_altivec.h" - -#include "libavcodec/mpegvideodsp.h" - -#if HAVE_ALTIVEC -/* AltiVec-enhanced gmc1. ATM this code assumes stride is a multiple of 8 - * to preserve proper dst alignment. */ -static void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, - int stride, int h, int x16, int y16, int rounder) -{ - int i; - const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder; - const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = { - (16 - x16) * (16 - y16), /* A */ - (x16) * (16 - y16), /* B */ - (16 - x16) * (y16), /* C */ - (x16) * (y16), /* D */ - 0, 0, 0, 0 /* padding */ - }; - register const vector unsigned char vczero = - (const vector unsigned char) vec_splat_u8(0); - register const vector unsigned short vcsr8 = - (const vector unsigned short) vec_splat_u16(8); - register vector unsigned char dstv, dstv2, srcvB, srcvC, srcvD; - register vector unsigned short tempB, tempC, tempD; - unsigned long dst_odd = (unsigned long) dst & 0x0000000F; - unsigned long src_really_odd = (unsigned long) src & 0x0000000F; - register vector unsigned short tempA = - vec_ld(0, (const unsigned short *) ABCD); - register vector unsigned short Av = vec_splat(tempA, 0); - register vector unsigned short Bv = vec_splat(tempA, 1); - register vector unsigned short Cv = vec_splat(tempA, 2); - register vector unsigned short Dv = vec_splat(tempA, 3); - register vector unsigned short rounderV = - vec_splat((vec_u16) vec_lde(0, &rounder_a), 0); - - /* we'll be able to pick-up our 9 char elements at src from those - * 32 bytes we load the first batch here, as inside the loop we can - * reuse 'src + stride' from one iteration as the 'src' of the next. */ - register vector unsigned char src_0 = vec_ld(0, src); - register vector unsigned char src_1 = vec_ld(16, src); - register vector unsigned char srcvA = vec_perm(src_0, src_1, - vec_lvsl(0, src)); - - if (src_really_odd != 0x0000000F) - /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned - * on the second vector. */ - srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src)); - else - srcvB = src_1; - srcvA = vec_mergeh(vczero, srcvA); - srcvB = vec_mergeh(vczero, srcvB); - - for (i = 0; i < h; i++) { - dst_odd = (unsigned long) dst & 0x0000000F; - src_really_odd = (((unsigned long) src) + stride) & 0x0000000F; - - dstv = vec_ld(0, dst); - - /* We'll be able to pick-up our 9 char elements at src + stride from - * those 32 bytes then reuse the resulting 2 vectors srvcC and srcvD - * as the next srcvA and srcvB. */ - src_0 = vec_ld(stride + 0, src); - src_1 = vec_ld(stride + 16, src); - srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src)); - - if (src_really_odd != 0x0000000F) - /* If (src & 0xF) == 0xF, then (src + 1) is properly aligned - * on the second vector. */ - srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src)); - else - srcvD = src_1; - - srcvC = vec_mergeh(vczero, srcvC); - srcvD = vec_mergeh(vczero, srcvD); - - /* OK, now we (finally) do the math :-) - * Those four instructions replace 32 int muls & 32 int adds. - * Isn't AltiVec nice? */ - tempA = vec_mladd((vector unsigned short) srcvA, Av, rounderV); - tempB = vec_mladd((vector unsigned short) srcvB, Bv, tempA); - tempC = vec_mladd((vector unsigned short) srcvC, Cv, tempB); - tempD = vec_mladd((vector unsigned short) srcvD, Dv, tempC); - - srcvA = srcvC; - srcvB = srcvD; - - tempD = vec_sr(tempD, vcsr8); - - dstv2 = vec_pack(tempD, (vector unsigned short) vczero); - - if (dst_odd) - dstv2 = vec_perm(dstv, dstv2, vcprm(0, 1, s0, s1)); - else - dstv2 = vec_perm(dstv, dstv2, vcprm(s0, s1, 2, 3)); - - vec_st(dstv2, 0, dst); - - dst += stride; - src += stride; - } -} -#endif /* HAVE_ALTIVEC */ - -av_cold void ff_mpegvideodsp_init_ppc(MpegVideoDSPContext *c) -{ -#if HAVE_ALTIVEC - if (!PPC_ALTIVEC(av_get_cpu_flags())) - return; - - c->gmc1 = gmc1_altivec; -#endif /* HAVE_ALTIVEC */ -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideoencdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideoencdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideoencdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/mpegvideoencdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #if HAVE_ALTIVEC #if HAVE_VSX -static int pix_norm1_altivec(uint8_t *pix, int line_size) +static int pix_norm1_altivec(const uint8_t *pix, int line_size) { int i, s = 0; const vector unsigned int zero = @@ -57,7 +57,7 @@ return s; } #else -static int pix_norm1_altivec(uint8_t *pix, int line_size) +static int pix_norm1_altivec(const uint8_t *pix, int line_size) { int i, s = 0; const vector unsigned int zero = @@ -87,7 +87,7 @@ #endif /* HAVE_VSX */ #if HAVE_VSX -static int pix_sum_altivec(uint8_t *pix, int line_size) +static int pix_sum_altivec(const uint8_t *pix, int line_size) { int i, s; const vector unsigned int zero = @@ -115,7 +115,7 @@ return s; } #else -static int pix_sum_altivec(uint8_t *pix, int line_size) +static int pix_sum_altivec(const uint8_t *pix, int line_size) { int i, s; const vector unsigned int zero = diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/svq1enc_altivec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/svq1enc_altivec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/svq1enc_altivec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/svq1enc_altivec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" -#include "libavcodec/svq1enc.h" +#include "libavcodec/svq1encdsp.h" #if HAVE_ALTIVEC static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, @@ -71,7 +71,7 @@ } #endif /* HAVE_ALTIVEC */ -av_cold void ff_svq1enc_init_ppc(SVQ1EncContext *c) +av_cold void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/videodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/videodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/videodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/videodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "libavutil/attributes.h" #include "libavcodec/videodsp.h" -static void prefetch_ppc(uint8_t *mem, ptrdiff_t stride, int h) +static void prefetch_ppc(const uint8_t *mem, ptrdiff_t stride, int h) { register const uint8_t *p = mem; do { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vorbisdsp_altivec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vorbisdsp_altivec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vorbisdsp_altivec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vorbisdsp_altivec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,14 +29,14 @@ #if HAVE_ALTIVEC static void vorbis_inverse_coupling_altivec(float *mag, float *ang, - intptr_t blocksize) + ptrdiff_t blocksize) { - int i; vector float m, a; vector bool int t0, t1; const vector unsigned int v_31 = //XXX vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1)); - for (i = 0; i < blocksize; i += 4) { + + for (ptrdiff_t i = 0; i < blocksize; i += 4) { m = vec_ld(0, mag+i); a = vec_ld(0, ang+i); t0 = vec_cmple(m, (vector float)vec_splat_u32(0)); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c 2023-03-03 13:29:59.000000000 +0000 @@ -96,7 +96,7 @@ static av_always_inline void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int w, int is6tap) { LOAD_H_SUBPEL_FILTER(mx-1); @@ -193,7 +193,7 @@ static av_always_inline void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, - uint8_t *src, ptrdiff_t src_stride, + const uint8_t *src, ptrdiff_t src_stride, int h, int my, int w, int is6tap) { LOAD_V_SUBPEL_FILTER(my-1); @@ -259,19 +259,19 @@ #define EPEL_FUNCS(WIDTH, TAPS) \ static av_noinline \ -void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \ +void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \ { \ put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \ } \ \ static av_noinline \ -void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \ +void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \ { \ put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \ } #define EPEL_HV(WIDTH, HTAPS, VTAPS) \ -static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \ +static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \ { \ DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \ if (VTAPS == 6) { \ @@ -299,7 +299,7 @@ EPEL_HV(4, 6,4) EPEL_HV(4, 4,4) -static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) +static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { register vector unsigned char perm; int i; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,30 +43,3 @@ 30, 23, 31, 38, 45, 52, 60, 53, 46, 39, 47, 54, 61, 62, 55, 63 }; - - -const uint8_t ff_prores_dc_codebook[4] = { - 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 - 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 - 0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1 - 0x70 // rice_order = 3, exp_golomb_order = 4, switch_bits = 0 -}; - -const uint8_t ff_prores_ac_codebook[7] = { - 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 - 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 - 0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0 - 0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1 - 0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1 - 0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2 - 0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2 -}; - -/** - * Lookup tables for adaptive switching between codebooks - * according with previous run/level value. - */ -const uint8_t ff_prores_run_to_cb_index[16] = - { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 }; - -const uint8_t ff_prores_lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdata.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,9 +31,5 @@ extern const uint8_t ff_prores_interlaced_scan[64]; #define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0 -extern const uint8_t ff_prores_dc_codebook[4]; -extern const uint8_t ff_prores_ac_codebook[7]; -extern const uint8_t ff_prores_run_to_cb_index[16]; -extern const uint8_t ff_prores_lev_to_cb_index[10]; #endif /* AVCODEC_PRORESDATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdec2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdec2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdec2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresdec2.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,12 +35,11 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "hwconfig.h" #include "idctdsp.h" -#include "internal.h" #include "profiles.h" -#include "simple_idct.h" #include "proresdec.h" #include "proresdata.h" #include "thread.h" @@ -178,7 +177,7 @@ av_log(avctx, AV_LOG_DEBUG, "Auto bitdepth precision. Use 12b decoding based on codec tag.\n"); } - ff_blockdsp_init(&ctx->bdsp, avctx); + ff_blockdsp_init(&ctx->bdsp); ret = ff_proresdsp_init(&ctx->prodsp, avctx); 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); @@ -290,10 +289,10 @@ avctx->pix_fmt = ret; } - avctx->color_primaries = buf[14]; - avctx->color_trc = buf[15]; - avctx->colorspace = buf[16]; - avctx->color_range = AVCOL_RANGE_MPEG; + ctx->frame->color_primaries = buf[14]; + ctx->frame->color_trc = buf[15]; + ctx->frame->colorspace = buf[16]; + ctx->frame->color_range = AVCOL_RANGE_MPEG; ptr = buf + 20; flags = buf[19]; @@ -500,7 +499,7 @@ static av_always_inline int decode_ac_coeffs(AVCodecContext *avctx, GetBitContext *gb, int16_t *out, int blocks_per_slice) { - ProresContext *ctx = avctx->priv_data; + const ProresContext *ctx = avctx->priv_data; int block_mask, sign; unsigned pos, run, level; int max_coeffs, i, bits_left; @@ -545,7 +544,7 @@ const uint8_t *buf, unsigned buf_size, const int16_t *qmat) { - ProresContext *ctx = avctx->priv_data; + const ProresContext *ctx = avctx->priv_data; LOCAL_ALIGNED_32(int16_t, blocks, [8*4*64]); int16_t *block; GetBitContext gb; @@ -611,7 +610,7 @@ /** * Decode alpha slice plane. */ -static void decode_slice_alpha(ProresContext *ctx, +static void decode_slice_alpha(const ProresContext *ctx, uint16_t *dst, int dst_stride, const uint8_t *buf, int buf_size, int blocks_per_slice) @@ -643,7 +642,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr) { - ProresContext *ctx = avctx->priv_data; + const ProresContext *ctx = avctx->priv_data; SliceContext *slice = &ctx->slices[jobnr]; const uint8_t *buf = slice->data; AVFrame *pic = ctx->frame; @@ -872,17 +871,16 @@ const FFCodec ff_prores_decoder = { .p.name = "prores", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + CODEC_LONG_NAME("Apple ProRes (iCodec Pro)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = decode_init, .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), + UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL HWACCEL_VIDEOTOOLBOX(prores), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_anatoliy.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_anatoliy.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_anatoliy.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_anatoliy.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,6 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" -#include "dct.h" #include "encode.h" #include "internal.h" #include "profiles.h" @@ -305,7 +304,7 @@ } } -static void get(uint8_t *pixels, int stride, int16_t* block) +static void get(const uint8_t *pixels, int stride, int16_t* block) { int i; @@ -317,13 +316,13 @@ } } -static void fdct_get(FDCTDSPContext *fdsp, uint8_t *pixels, int stride, int16_t* block) +static void fdct_get(FDCTDSPContext *fdsp, const uint8_t *pixels, int stride, int16_t* block) { get(pixels, stride, block); fdsp->fdct(block); } -static void calc_plane_dct(FDCTDSPContext *fdsp, uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) +static void calc_plane_dct(FDCTDSPContext *fdsp, const uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) { int16_t *block; int i; @@ -473,7 +472,7 @@ } } -static inline void subimage_with_fill_template(uint16_t *src, unsigned x, unsigned y, +static inline void subimage_with_fill_template(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_alpha_plane, int is_interlaced, int is_top_field) @@ -521,7 +520,7 @@ } } -static void subimage_with_fill(uint16_t *src, unsigned x, unsigned y, +static void subimage_with_fill(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) { @@ -529,7 +528,7 @@ } /* reorganize alpha data and convert 10b -> 16b */ -static void subimage_alpha_with_fill(uint16_t *src, unsigned x, unsigned y, +static void subimage_alpha_with_fill(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) { @@ -544,7 +543,7 @@ ProresContext* ctx = avctx->priv_data; int hdr_size = 6 + (ctx->need_alpha * 2); /* v data size is write when there is alpha */ int ret = 0, slice_size; - uint8_t *dest_y, *dest_u, *dest_v; + const uint8_t *dest_y, *dest_u, *dest_v; unsigned y_data_size = 0, u_data_size = 0, v_data_size = 0, a_data_size = 0; FDCTDSPContext *fdsp = &ctx->fdsp; int tgt_bits = (mb_count * bitrate_table[avctx->profile]) >> 2; @@ -577,13 +576,13 @@ } if (unsafe) { - subimage_with_fill((uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, luma_stride, avctx->width, avctx->height, (uint16_t *) ctx->fill_y, mb_count << 4, 16, is_interlaced, is_top_field); - subimage_with_fill((uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, chroma_stride, avctx->width >> ctx->is_422, avctx->height, (uint16_t *) ctx->fill_u, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); - subimage_with_fill((uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, chroma_stride, avctx->width >> ctx->is_422, avctx->height, (uint16_t *) ctx->fill_v, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); @@ -640,7 +639,7 @@ if (ctx->need_alpha) { AV_WB16(buf + 6, v_data_size); /* write v data size only if there is alpha */ - subimage_alpha_with_fill((uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, + subimage_alpha_with_fill((const uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, alpha_stride, avctx->width, avctx->height, (uint16_t *) ctx->fill_a, mb_count << 4, 16, is_interlaced, is_top_field); ret = encode_alpha_slice_data(avctx, ctx->fill_a, mb_count, @@ -942,32 +941,34 @@ const FFCodec ff_prores_aw_encoder = { .p.name = "prores_aw", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), + CODEC_LONG_NAME("Apple ProRes"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PRORES, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = pix_fmts, .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, FF_CODEC_ENCODE_CB(prores_encode_frame), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &prores_enc_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_prores_encoder = { .p.name = "prores", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), + CODEC_LONG_NAME("Apple ProRes"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PRORES, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = pix_fmts, .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, FF_CODEC_ENCODE_CB(prores_encode_frame), - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &prores_enc_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_kostya.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_kostya.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_kostya.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/proresenc_kostya.c 2023-03-03 13:29:59.000000000 +0000 @@ -135,6 +135,32 @@ }, }; +static const uint8_t prores_dc_codebook[4] = { + 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 + 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 + 0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1 + 0x70 // rice_order = 3, exp_golomb_order = 4, switch_bits = 0 +}; + +static const uint8_t prores_ac_codebook[7] = { + 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 + 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 + 0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0 + 0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1 + 0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1 + 0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2 + 0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2 +}; + +/** + * Lookup tables for adaptive switching between codebooks + * according with previous run/level value. + */ +static const uint8_t prores_run_to_cb_index[16] = + { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 }; + +static const uint8_t prores_lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 }; + #define NUM_MB_LIMITS 4 static const int prores_mb_limits[NUM_MB_LIMITS] = { 1620, // up to 720x576 @@ -423,7 +449,7 @@ new_sign = GET_SIGN(delta); delta = (delta ^ sign) - sign; code = MAKE_CODE(delta); - encode_vlc_codeword(pb, ff_prores_dc_codebook[codebook], code); + encode_vlc_codeword(pb, prores_dc_codebook[codebook], code); codebook = (code + (code & 1)) >> 1; codebook = FFMIN(codebook, 3); sign = new_sign; @@ -441,8 +467,8 @@ int max_coeffs, abs_level; max_coeffs = blocks_per_slice << 6; - run_cb = ff_prores_run_to_cb_index[4]; - lev_cb = ff_prores_lev_to_cb_index[2]; + run_cb = prores_run_to_cb_index[4]; + lev_cb = prores_lev_to_cb_index[2]; run = 0; for (i = 1; i < 64; i++) { @@ -450,13 +476,13 @@ level = blocks[idx] / qmat[scan[i]]; if (level) { abs_level = FFABS(level); - encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run); - encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb], + encode_vlc_codeword(pb, prores_ac_codebook[run_cb], run); + encode_vlc_codeword(pb, prores_ac_codebook[lev_cb], abs_level - 1); put_sbits(pb, 1, GET_SIGN(level)); - run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)]; - lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)]; + run_cb = prores_run_to_cb_index[FFMIN(run, 15)]; + lev_cb = prores_lev_to_cb_index[FFMIN(abs_level, 9)]; run = 0; } else { run++; @@ -667,7 +693,7 @@ new_sign = GET_SIGN(delta); delta = (delta ^ sign) - sign; code = MAKE_CODE(delta); - bits += estimate_vlc(ff_prores_dc_codebook[codebook], code); + bits += estimate_vlc(prores_dc_codebook[codebook], code); codebook = (code + (code & 1)) >> 1; codebook = FFMIN(codebook, 3); sign = new_sign; @@ -687,8 +713,8 @@ int bits = 0; max_coeffs = blocks_per_slice << 6; - run_cb = ff_prores_run_to_cb_index[4]; - lev_cb = ff_prores_lev_to_cb_index[2]; + run_cb = prores_run_to_cb_index[4]; + lev_cb = prores_lev_to_cb_index[2]; run = 0; for (i = 1; i < 64; i++) { @@ -697,12 +723,12 @@ *error += FFABS(blocks[idx]) % qmat[scan[i]]; if (level) { abs_level = FFABS(level); - bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run); - bits += estimate_vlc(ff_prores_ac_codebook[lev_cb], + bits += estimate_vlc(prores_ac_codebook[run_cb], run); + bits += estimate_vlc(prores_ac_codebook[lev_cb], abs_level - 1) + 1; - run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)]; - lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)]; + run_cb = prores_run_to_cb_index[FFMIN(run, 15)]; + lev_cb = prores_lev_to_cb_index[FFMIN(abs_level, 9)]; run = 0; } else { run++; @@ -1395,19 +1421,20 @@ const FFCodec ff_prores_ks_encoder = { .p.name = "prores_ks", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + CODEC_LONG_NAME("Apple ProRes (iCodec Pro)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = encode_init, .close = encode_close, FF_CODEC_ENCODE_CB(encode_frame), - .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE }, .p.priv_class = &proresenc_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/prosumer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/prosumer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/prosumer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/prosumer.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include #include -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" @@ -31,7 +30,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct ProSumerContext { GetByteContext gb; @@ -367,7 +366,7 @@ const FFCodec ff_prosumer_decoder = { .p.name = "prosumer", - .p.long_name = NULL_IF_CONFIG_SMALL("Brooktree ProSumer Video"), + CODEC_LONG_NAME("Brooktree ProSumer Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PROSUMER, .priv_data_size = sizeof(ProSumerContext), @@ -375,6 +374,5 @@ FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/psd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/psd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/psd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/psd.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" enum PsdCompr { PSD_RAW, @@ -546,7 +546,7 @@ const FFCodec ff_psd_decoder = { .p.name = "psd", - .p.long_name = NULL_IF_CONFIG_SMALL("Photoshop PSD file"), + CODEC_LONG_NAME("Photoshop PSD file"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PSD, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,9 +48,6 @@ static void validate_thread_parameters(AVCodecContext *avctx) { int frame_threading_supported = (avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) -#if FF_API_FLAG_TRUNCATED - && !(avctx->flags & AV_CODEC_FLAG_TRUNCATED) -#endif && !(avctx->flags & AV_CODEC_FLAG_LOW_DELAY) && !(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS); if (avctx->thread_count == 1) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_frame.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_frame.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_frame.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_frame.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" #include "internal.h" #include "pthread_internal.h" @@ -98,22 +99,6 @@ atomic_int state; -#if FF_API_THREAD_SAFE_CALLBACKS - /** - * Array of frames passed to ff_thread_release_buffer(). - * Frames are released after all threads referencing them are finished. - */ - AVFrame **released_buffers; - int num_released_buffers; - int released_buffers_allocated; - - AVFrame *requested_frame; ///< AVFrame the codec passed to get_buffer() - int requested_flags; ///< flags passed to get_buffer() for requested_frame - - const enum AVPixelFormat *available_formats; ///< Format array for get_format() - enum AVPixelFormat result_format; ///< get_format() result -#endif - int die; ///< Set when the thread should exit. int hwaccel_serializing; @@ -155,11 +140,6 @@ void *stash_hwaccel_priv; } FrameThreadContext; -#if FF_API_THREAD_SAFE_CALLBACKS -#define THREAD_SAFE_CALLBACKS(avctx) \ -((avctx)->thread_safe_callbacks || (avctx)->get_buffer2 == avcodec_default_get_buffer2) -#endif - static void async_lock(FrameThreadContext *fctx) { pthread_mutex_lock(&fctx->async_mutex); @@ -178,6 +158,17 @@ pthread_mutex_unlock(&fctx->async_mutex); } +static void thread_set_name(PerThreadContext *p) +{ + AVCodecContext *avctx = p->avctx; + int idx = p - p->parent->threads; + char name[16]; + + snprintf(name, sizeof(name), "av:%.7s:df%d", avctx->codec->name, idx); + + ff_thread_setname(name); +} + /** * Codec worker thread. * @@ -191,6 +182,8 @@ AVCodecContext *avctx = p->avctx; const FFCodec *codec = ffcodec(avctx->codec); + thread_set_name(p); + pthread_mutex_lock(&p->mutex); while (1) { while (atomic_load(&p->state) == STATE_INPUT_READY && !p->die) @@ -198,14 +191,8 @@ if (p->die) break; -FF_DISABLE_DEPRECATION_WARNINGS - if (!codec->update_thread_context -#if FF_API_THREAD_SAFE_CALLBACKS - && THREAD_SAFE_CALLBACKS(avctx) -#endif - ) + if (!codec->update_thread_context) ff_thread_finish_setup(avctx); -FF_ENABLE_DEPRECATION_WARNINGS /* If a decoder supports hwaccel, then it must call ff_get_format(). * Since that call must happen before ff_thread_finish_setup(), the @@ -357,6 +344,8 @@ */ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src) { + int err; + dst->flags = src->flags; dst->draw_horiz_band= src->draw_horiz_band; @@ -373,11 +362,15 @@ dst->skip_idct = src->skip_idct; dst->skip_frame = src->skip_frame; + dst->frame_num = src->frame_num; +#if FF_API_AVCTX_FRAME_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS dst->frame_number = src->frame_number; - dst->reordered_opaque = src->reordered_opaque; -#if FF_API_THREAD_SAFE_CALLBACKS +FF_ENABLE_DEPRECATION_WARNINGS +#endif +#if FF_API_REORDERED_OPAQUE FF_DISABLE_DEPRECATION_WARNINGS - dst->thread_safe_callbacks = src->thread_safe_callbacks; + dst->reordered_opaque = src->reordered_opaque; FF_ENABLE_DEPRECATION_WARNINGS #endif @@ -392,31 +385,14 @@ src->slice_count * sizeof(*dst->slice_offset)); } dst->slice_count = src->slice_count; - return 0; -} - -#if FF_API_THREAD_SAFE_CALLBACKS -/// Releases the buffers that this decoding thread was the last user of. -static void release_delayed_buffers(PerThreadContext *p) -{ - FrameThreadContext *fctx = p->parent; - - while (p->num_released_buffers > 0) { - AVFrame *f; - pthread_mutex_lock(&fctx->buffer_mutex); - - // fix extended data in case the caller screwed it up - av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO || - p->avctx->codec_type == AVMEDIA_TYPE_AUDIO); - f = p->released_buffers[--p->num_released_buffers]; - f->extended_data = f->data; - av_frame_unref(f); + av_packet_unref(dst->internal->last_pkt_props); + err = av_packet_copy_props(dst->internal->last_pkt_props, src->internal->last_pkt_props); + if (err < 0) + return err; - pthread_mutex_unlock(&fctx->buffer_mutex); - } + return 0; } -#endif static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx, AVPacket *avpkt) @@ -440,10 +416,6 @@ (p->avctx->debug & FF_DEBUG_THREADS) != 0, memory_order_relaxed); -#if FF_API_THREAD_SAFE_CALLBACKS - release_delayed_buffers(p); -#endif - if (prev_thread) { int err; if (atomic_load(&prev_thread->state) == STATE_SETTING_UP) { @@ -478,44 +450,6 @@ pthread_cond_signal(&p->input_cond); pthread_mutex_unlock(&p->mutex); -#if FF_API_THREAD_SAFE_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS - /* - * If the client doesn't have a thread-safe get_buffer(), - * then decoding threads call back to the main thread, - * and it calls back to the client here. - */ - - if (!p->avctx->thread_safe_callbacks && ( - p->avctx->get_format != avcodec_default_get_format || - p->avctx->get_buffer2 != avcodec_default_get_buffer2)) { - while (atomic_load(&p->state) != STATE_SETUP_FINISHED && atomic_load(&p->state) != STATE_INPUT_READY) { - int call_done = 1; - pthread_mutex_lock(&p->progress_mutex); - while (atomic_load(&p->state) == STATE_SETTING_UP) - pthread_cond_wait(&p->progress_cond, &p->progress_mutex); - - switch (atomic_load_explicit(&p->state, memory_order_acquire)) { - case STATE_GET_BUFFER: - p->result = ff_get_buffer(p->avctx, p->requested_frame, p->requested_flags); - break; - case STATE_GET_FORMAT: - p->result_format = ff_get_format(p->avctx, p->available_formats); - break; - default: - call_done = 0; - break; - } - if (call_done) { - atomic_store(&p->state, STATE_SETTING_UP); - pthread_cond_signal(&p->progress_cond); - } - pthread_mutex_unlock(&p->progress_mutex); - } - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - fctx->prev_thread = p; fctx->next_decoding++; @@ -630,7 +564,7 @@ pthread_mutex_unlock(&p->progress_mutex); } -void ff_thread_await_progress(ThreadFrame *f, int n, int field) +void ff_thread_await_progress(const ThreadFrame *f, int n, int field) { PerThreadContext *p; atomic_int *progress = f->progress ? (atomic_int*)f->progress->data : NULL; @@ -746,12 +680,6 @@ if (codec->close && p->thread_init != UNINITIALIZED) codec->close(ctx); -#if FF_API_THREAD_SAFE_CALLBACKS - release_delayed_buffers(p); - for (int j = 0; j < p->released_buffers_allocated; j++) - av_frame_free(&p->released_buffers[j]); - av_freep(&p->released_buffers); -#endif if (ctx->priv_data) { if (codec->p.priv_class) av_opt_free(ctx->priv_data); @@ -761,6 +689,7 @@ av_freep(&ctx->slice_offset); av_buffer_unref(&ctx->internal->pool); + av_packet_free(&ctx->internal->last_pkt_props); av_freep(&ctx->internal); av_buffer_unref(&ctx->hw_frames_ctx); } @@ -834,11 +763,14 @@ if (!(p->frame = av_frame_alloc()) || !(p->avpkt = av_packet_alloc())) return AVERROR(ENOMEM); - copy->internal->last_pkt_props = p->avpkt; if (!first) copy->internal->is_copy = 1; + copy->internal->last_pkt_props = av_packet_alloc(); + if (!copy->internal->last_pkt_props) + return AVERROR(ENOMEM); + if (codec->init) { err = codec->init(copy); if (err < 0) { @@ -945,10 +877,6 @@ av_frame_unref(p->frame); p->result = 0; -#if FF_API_THREAD_SAFE_CALLBACKS - release_delayed_buffers(p); -#endif - if (ffcodec(avctx->codec)->flush) ffcodec(avctx->codec)->flush(p->avctx); } @@ -957,16 +885,12 @@ int ff_thread_can_start_frame(AVCodecContext *avctx) { PerThreadContext *p = avctx->internal->thread_ctx; -FF_DISABLE_DEPRECATION_WARNINGS + if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP && - (ffcodec(avctx->codec)->update_thread_context -#if FF_API_THREAD_SAFE_CALLBACKS - || !THREAD_SAFE_CALLBACKS(avctx) -#endif - )) { + ffcodec(avctx->codec)->update_thread_context) { return 0; } -FF_ENABLE_DEPRECATION_WARNINGS + return 1; } @@ -981,80 +905,20 @@ p = avctx->internal->thread_ctx; FF_DISABLE_DEPRECATION_WARNINGS if (atomic_load(&p->state) != STATE_SETTING_UP && - (ffcodec(avctx->codec)->update_thread_context -#if FF_API_THREAD_SAFE_CALLBACKS - || !THREAD_SAFE_CALLBACKS(avctx) -#endif - )) { + ffcodec(avctx->codec)->update_thread_context) { FF_ENABLE_DEPRECATION_WARNINGS av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n"); return -1; } pthread_mutex_lock(&p->parent->buffer_mutex); -#if !FF_API_THREAD_SAFE_CALLBACKS - err = ff_get_buffer(avctx, f->f, flags); -#else -FF_DISABLE_DEPRECATION_WARNINGS - if (THREAD_SAFE_CALLBACKS(avctx)) { - err = ff_get_buffer(avctx, f, flags); - } else { - pthread_mutex_lock(&p->progress_mutex); - p->requested_frame = f; - p->requested_flags = flags; - atomic_store_explicit(&p->state, STATE_GET_BUFFER, memory_order_release); - pthread_cond_broadcast(&p->progress_cond); - - while (atomic_load(&p->state) != STATE_SETTING_UP) - pthread_cond_wait(&p->progress_cond, &p->progress_mutex); - - err = p->result; - - pthread_mutex_unlock(&p->progress_mutex); - - } - if (!THREAD_SAFE_CALLBACKS(avctx) && !ffcodec(avctx->codec)->update_thread_context) - ff_thread_finish_setup(avctx); -FF_ENABLE_DEPRECATION_WARNINGS -#endif + err = ff_get_buffer(avctx, f, flags); pthread_mutex_unlock(&p->parent->buffer_mutex); return err; } -#if FF_API_THREAD_SAFE_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS -enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) -{ - enum AVPixelFormat res; - PerThreadContext *p; - if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avctx->thread_safe_callbacks || - avctx->get_format == avcodec_default_get_format) - return ff_get_format(avctx, fmt); - - p = avctx->internal->thread_ctx; - if (atomic_load(&p->state) != STATE_SETTING_UP) { - av_log(avctx, AV_LOG_ERROR, "get_format() cannot be called after ff_thread_finish_setup()\n"); - return -1; - } - pthread_mutex_lock(&p->progress_mutex); - p->available_formats = fmt; - atomic_store(&p->state, STATE_GET_FORMAT); - pthread_cond_broadcast(&p->progress_cond); - - while (atomic_load(&p->state) != STATE_SETTING_UP) - pthread_cond_wait(&p->progress_cond, &p->progress_mutex); - - res = p->result_format; - - pthread_mutex_unlock(&p->progress_mutex); - - return res; -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags) { int ret = thread_get_buffer_internal(avctx, f, flags); @@ -1096,69 +960,13 @@ void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f) { -#if FF_API_THREAD_SAFE_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS - PerThreadContext *p; - FrameThreadContext *fctx; - AVFrame *dst; - int ret = 0; - int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) || - THREAD_SAFE_CALLBACKS(avctx); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (!f) return; if (avctx->debug & FF_DEBUG_BUFFERS) av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p\n", f); -#if !FF_API_THREAD_SAFE_CALLBACKS - av_frame_unref(f->f); -#else - // when the frame buffers are not allocated, just reset it to clean state - if (can_direct_free || !f->buf[0]) { - av_frame_unref(f); - return; - } - - p = avctx->internal->thread_ctx; - fctx = p->parent; - pthread_mutex_lock(&fctx->buffer_mutex); - - if (p->num_released_buffers == p->released_buffers_allocated) { - AVFrame **tmp = av_realloc_array(p->released_buffers, p->released_buffers_allocated + 1, - sizeof(*p->released_buffers)); - if (tmp) { - tmp[p->released_buffers_allocated] = av_frame_alloc(); - p->released_buffers = tmp; - } - - if (!tmp || !tmp[p->released_buffers_allocated]) { - ret = AVERROR(ENOMEM); - goto fail; - } - p->released_buffers_allocated++; - } - - dst = p->released_buffers[p->num_released_buffers]; - av_frame_move_ref(dst, f); - - p->num_released_buffers++; - -fail: - pthread_mutex_unlock(&fctx->buffer_mutex); - - // make sure the frame is clean even if we fail to free it - // this leaks, but it is better than crashing - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "Could not queue a frame for freeing, this will leak\n"); - memset(f->buf, 0, sizeof(f->buf)); - if (f->extended_buf) - memset(f->extended_buf, 0, f->nb_extended_buf * sizeof(*f->extended_buf)); - av_frame_unref(f); - } -#endif + av_frame_unref(f); } void ff_thread_release_ext_buffer(AVCodecContext *avctx, ThreadFrame *f) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_slice.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_slice.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_slice.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/pthread_slice.c 2023-03-03 13:29:59.000000000 +0000 @@ -237,14 +237,16 @@ pthread_mutex_unlock(&progress->mutex); } -int ff_alloc_entries(AVCodecContext *avctx, int count) +int ff_slice_thread_allocz_entries(AVCodecContext *avctx, int count) { if (avctx->active_thread_type & FF_THREAD_SLICE) { SliceThreadContext *p = avctx->internal->thread_ctx; - if (p->entries) { - av_freep(&p->entries); + if (p->entries_count == count) { + memset(p->entries, 0, p->entries_count * sizeof(*p->entries)); + return 0; } + av_freep(&p->entries); p->entries = av_calloc(count, sizeof(*p->entries)); if (!p->entries) { @@ -256,9 +258,3 @@ return 0; } - -void ff_reset_entries(AVCodecContext *avctx) -{ - SliceThreadContext *p = avctx->internal->thread_ctx; - memset(p->entries, 0, p->entries_count * sizeof(int)); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ptx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ptx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ptx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ptx.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,10 +21,9 @@ #include "libavutil/common.h" #include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static int ptx_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) @@ -88,7 +87,7 @@ const FFCodec ff_ptx_decoder = { .p.name = "ptx", - .p.long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"), + CODEC_LONG_NAME("V.Flash PTX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PTX, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_bits.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_bits.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_bits.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_bits.h 2023-03-03 13:29:59.000000000 +0000 @@ -363,6 +363,13 @@ } } +static inline void put_sbits63(PutBitContext *pb, int n, int64_t value) +{ + av_assert2(n >= 0 && n < 64); + + put_bits64(pb, n, (uint64_t)(value) & (~(UINT64_MAX << n))); +} + /** * Return the pointer to the byte where the bitstream writer will put * the next bit. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_golomb.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_golomb.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_golomb.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/put_golomb.h 2023-03-03 13:29:59.000000000 +0000 @@ -151,18 +151,4 @@ set_ur_golomb(pb, v, k, limit, esc_len); } -/** - * write signed golomb rice code (flac). - */ -static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k, - int limit, int esc_len) -{ - int v; - - v = -2 * i - 1; - v ^= (v >> 31); - - set_ur_golomb_jpegls(pb, v, k, limit, esc_len); -} - #endif /* AVCODEC_PUT_GOLOMB_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qcelpdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qcelpdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qcelpdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qcelpdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,14 +27,12 @@ * @remark Development mentored by Benjamin Larson */ -#include - #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/float_dsp.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "qcelpdata.h" #include "celp_filters.h" @@ -648,8 +646,8 @@ static void warn_insufficient_frame_quality(AVCodecContext *avctx, const char *message) { - av_log(avctx, AV_LOG_WARNING, "Frame #%d, IFQ: %s\n", - avctx->frame_number, message); + av_log(avctx, AV_LOG_WARNING, "Frame #%"PRId64", IFQ: %s\n", + avctx->frame_num, message); } static void postfilter(QCELPContext *q, float *samples, float *lpc) @@ -792,12 +790,11 @@ const FFCodec ff_qcelp_decoder = { .p.name = "qcelp", - .p.long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"), + CODEC_LONG_NAME("QCELP / PureVoice"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_QCELP, .init = qcelp_decode_init, FF_CODEC_DECODE_CB(qcelp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(QCELPContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdm2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdm2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdm2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdm2.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,21 +33,20 @@ #include #include -#include #include "libavutil/channel_layout.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "mpegaudio.h" #include "mpegaudiodsp.h" -#include "rdft.h" #include "qdm2_tablegen.h" @@ -97,14 +96,9 @@ struct QDM2SubPNode *next; ///< pointer to next packet in the list, NULL if leaf node } QDM2SubPNode; -typedef struct QDM2Complex { - float re; - float im; -} QDM2Complex; - typedef struct FFTTone { float level; - QDM2Complex *complex; + AVComplexFloat *complex; const float *table; int phase; int phase_shift; @@ -122,7 +116,8 @@ } FFTCoefficient; typedef struct QDM2FFT { - DECLARE_ALIGNED(32, QDM2Complex, complex)[MPA_MAX_CHANNELS][256]; + DECLARE_ALIGNED(32, AVComplexFloat, complex)[MPA_MAX_CHANNELS][256 + 1]; + DECLARE_ALIGNED(32, AVComplexFloat, temp)[MPA_MAX_CHANNELS][256]; } QDM2FFT; /** @@ -162,7 +157,8 @@ int fft_coefs_min_index[5]; int fft_coefs_max_index[5]; int fft_level_exp[6]; - RDFTContext rdft_ctx; + AVTXContext *rdft_ctx; + av_tx_fn rdft_fn; QDM2FFT fft; /// I/O data @@ -1429,7 +1425,7 @@ { float level, f[6]; int i; - QDM2Complex c; + AVComplexFloat c; const double iscale = 2.0 * M_PI / 512.0; tone->phase += tone->phase_shift; @@ -1477,7 +1473,7 @@ const double iscale = 0.25 * M_PI; for (ch = 0; ch < q->channels; ch++) { - memset(q->fft.complex[ch], 0, q->fft_size * sizeof(QDM2Complex)); + memset(q->fft.complex[ch], 0, q->fft_size * sizeof(AVComplexFloat)); } @@ -1485,7 +1481,7 @@ if (q->fft_coefs_min_index[4] >= 0) for (i = q->fft_coefs_min_index[4]; i < q->fft_coefs_max_index[4]; i++) { float level; - QDM2Complex c; + AVComplexFloat c; if (q->fft_coefs[i].sub_packet != sub_packet) break; @@ -1546,14 +1542,19 @@ { const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f; float *out = q->output_buffer + channel; - int i; + q->fft.complex[channel][0].re *= 2.0f; q->fft.complex[channel][0].im = 0.0f; - q->rdft_ctx.rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]); + q->fft.complex[channel][q->fft_size].re = 0.0f; + q->fft.complex[channel][q->fft_size].im = 0.0f; + + q->rdft_fn(q->rdft_ctx, q->fft.temp[channel], q->fft.complex[channel], + sizeof(AVComplexFloat)); + /* add samples to output buffer */ - for (i = 0; i < FFALIGN(q->fft_size, 8); i++) { - out[0] += q->fft.complex[channel][i].re * gain; - out[q->channels] += q->fft.complex[channel][i].im * gain; + for (int i = 0; i < FFALIGN(q->fft_size, 8); i++) { + out[0] += q->fft.temp[channel][i].re * gain; + out[q->channels] += q->fft.temp[channel][i].im * gain; out += 2 * q->channels; } } @@ -1614,7 +1615,8 @@ { static AVOnce init_static_once = AV_ONCE_INIT; QDM2Context *s = avctx->priv_data; - int tmp_val, tmp, size; + int ret, tmp_val, tmp, size; + float scale = 1.0f / 2.0f; GetByteContext gb; /* extradata parsing @@ -1757,7 +1759,10 @@ return AVERROR_INVALIDDATA; } - ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R); + ret = av_tx_init(&s->rdft_ctx, &s->rdft_fn, AV_TX_FLOAT_RDFT, 1, 2*s->fft_size, &scale, 0); + if (ret < 0) + return ret; + ff_mpadsp_init(&s->mpadsp); avctx->sample_fmt = AV_SAMPLE_FMT_S16; @@ -1771,7 +1776,7 @@ { QDM2Context *s = avctx->priv_data; - ff_rdft_end(&s->rdft_ctx); + av_tx_uninit(&s->rdft_ctx); return 0; } @@ -1871,7 +1876,7 @@ const FFCodec ff_qdm2_decoder = { .p.name = "qdm2", - .p.long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"), + CODEC_LONG_NAME("QDesign Music Codec 2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_QDM2, .priv_data_size = sizeof(QDM2Context), @@ -1879,5 +1884,4 @@ .close = qdm2_decode_close, FF_CODEC_DECODE_CB(qdm2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdmc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdmc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdmc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdmc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,19 +21,19 @@ #include #include -#include #define BITSTREAM_READER_LE #include "libavutil/channel_layout.h" +#include "libavutil/mem_internal.h" #include "libavutil/thread.h" #include "libavutil/tx.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct QDMCTone { uint8_t mode; @@ -730,7 +730,7 @@ const FFCodec ff_qdmc_decoder = { .p.name = "qdmc", - .p.long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 1"), + CODEC_LONG_NAME("QDesign Music Codec 1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_QDMC, .priv_data_size = sizeof(QDMCContext), @@ -739,5 +739,4 @@ FF_CODEC_DECODE_CB(qdmc_decode_frame), .flush = qdmc_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdrw.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdrw.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdrw.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qdrw.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" enum QuickdrawOpcodes { CLIP = 0x0001, @@ -515,7 +515,7 @@ const FFCodec ff_qdraw_decoder = { .p.name = "qdraw", - .p.long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"), + CODEC_LONG_NAME("Apple QuickDraw"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QDRAW, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoidec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoidec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoidec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoidec.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,32 +18,28 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - -#include "libavutil/imgutils.h" #include "avcodec.h" -#include "internal.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "thread.h" #include "qoi.h" static int qoi_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; - int ret, buf_size = avpkt->size; int width, height, channels, space, run = 0; uint8_t index[64][4] = { 0 }; uint8_t px[4] = { 0, 0, 0, 255 }; GetByteContext gb; uint8_t *dst; uint64_t len; + int ret; - if (buf_size < 20) + if (avpkt->size < 20) return AVERROR_INVALIDDATA; - bytestream2_init(&gb, buf, buf_size); + bytestream2_init(&gb, avpkt->data, avpkt->size); bytestream2_skip(&gb, 4); width = bytestream2_get_be32(&gb); height = bytestream2_get_be32(&gb); @@ -64,6 +60,9 @@ default: return AVERROR_INVALIDDATA; } + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0) return ret; @@ -112,14 +111,15 @@ *got_frame = 1; - return buf_size; + return avpkt->size; } const FFCodec ff_qoi_decoder = { .p.name = "qoi", - .p.long_name = NULL_IF_CONFIG_SMALL("QOI (Quite OK Image format) image"), + CODEC_LONG_NAME("QOI (Quite OK Image format) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QOI, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(qoi_decode_frame), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoienc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoienc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoienc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qoienc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,8 @@ uint8_t px[4] = { 0, 0, 0, 255 }; uint8_t index[64][4] = { 0 }; int64_t packet_size; - uint8_t *buf, *src; + uint8_t *buf; + const uint8_t *src; int ret, run = 0; packet_size = avctx->width * avctx->height * (channels + 1LL) + 14LL + 8LL; @@ -127,14 +128,14 @@ const FFCodec ff_qoi_encoder = { .p.name = "qoi", - .p.long_name = NULL_IF_CONFIG_SMALL("QOI (Quite OK Image format) image"), + CODEC_LONG_NAME("QOI (Quite OK Image format) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QOI, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(qoi_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" typedef struct QpegContext{ AVCodecContext *avctx; @@ -353,7 +352,7 @@ const FFCodec ff_qpeg_decoder = { .p.name = "qpeg", - .p.long_name = NULL_IF_CONFIG_SMALL("Q-team QPEG"), + CODEC_LONG_NAME("Q-team QPEG"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QPEG, .priv_data_size = sizeof(QpegContext), @@ -362,6 +361,5 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,9 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include +#include +#include #include #include @@ -37,8 +36,20 @@ #include "qsv_internal.h" #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) +#define QSV_HAVE_USER_PLUGIN !QSV_ONEVPL +#define QSV_HAVE_AUDIO !QSV_ONEVPL -#include "mfx/mfxvp8.h" +#include "mfxvp8.h" + +#if QSV_HAVE_USER_PLUGIN +#include +#endif + +#if QSV_ONEVPL +#include +#else +#define MFXUnload(a) do { } while(0) +#endif int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) { @@ -76,10 +87,14 @@ } qsv_iopatterns[] = { {MFX_IOPATTERN_IN_VIDEO_MEMORY, "input is video memory surface" }, {MFX_IOPATTERN_IN_SYSTEM_MEMORY, "input is system memory surface" }, +#if QSV_HAVE_OPAQUE {MFX_IOPATTERN_IN_OPAQUE_MEMORY, "input is opaque memory surface" }, +#endif {MFX_IOPATTERN_OUT_VIDEO_MEMORY, "output is video memory surface" }, {MFX_IOPATTERN_OUT_SYSTEM_MEMORY, "output is system memory surface" }, +#if QSV_HAVE_OPAQUE {MFX_IOPATTERN_OUT_OPAQUE_MEMORY, "output is opaque memory surface" }, +#endif }; int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, @@ -125,8 +140,12 @@ { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL), "invalid video parameters" }, { MFX_ERR_UNDEFINED_BEHAVIOR, AVERROR_BUG, "undefined behavior" }, { MFX_ERR_DEVICE_FAILED, AVERROR(EIO), "device failed" }, +#if QSV_HAVE_AUDIO { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters" }, { MFX_ERR_INVALID_AUDIO_PARAM, AVERROR(EINVAL), "invalid audio parameters" }, +#endif + { MFX_ERR_GPU_HANG, AVERROR(EIO), "GPU Hang" }, + { MFX_ERR_REALLOC_SURFACE, AVERROR_UNKNOWN, "need bigger surface for output" }, { MFX_WRN_IN_EXECUTION, 0, "operation in execution" }, { MFX_WRN_DEVICE_BUSY, 0, "device busy" }, @@ -136,7 +155,13 @@ { MFX_WRN_VALUE_NOT_CHANGED, 0, "value is saturated" }, { MFX_WRN_OUT_OF_RANGE, 0, "value out of range" }, { MFX_WRN_FILTER_SKIPPED, 0, "filter skipped" }, +#if QSV_HAVE_AUDIO { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0, "incompatible audio parameters" }, +#endif + +#if QSV_VERSION_ATLEAST(1, 31) + { MFX_ERR_NONE_PARTIAL_OUTPUT, 0, "partial output" }, +#endif }; /** @@ -186,38 +211,73 @@ #if CONFIG_VAAPI case MFX_FOURCC_YUY2: return AV_PIX_FMT_YUYV422; case MFX_FOURCC_Y210: return AV_PIX_FMT_Y210; + case MFX_FOURCC_AYUV: return AV_PIX_FMT_VUYX; + case MFX_FOURCC_Y410: return AV_PIX_FMT_XV30; +#if QSV_VERSION_ATLEAST(1, 31) + case MFX_FOURCC_P016: return AV_PIX_FMT_P012; + case MFX_FOURCC_Y216: return AV_PIX_FMT_Y212; + case MFX_FOURCC_Y416: return AV_PIX_FMT_XV36; +#endif #endif } return AV_PIX_FMT_NONE; } -int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc) +int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift) { switch (format) { case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_NV12: *fourcc = MFX_FOURCC_NV12; + *shift = 0; return AV_PIX_FMT_NV12; case AV_PIX_FMT_YUV420P10: case AV_PIX_FMT_P010: *fourcc = MFX_FOURCC_P010; + *shift = 1; return AV_PIX_FMT_P010; case AV_PIX_FMT_X2RGB10: *fourcc = MFX_FOURCC_A2RGB10; + *shift = 1; return AV_PIX_FMT_X2RGB10; case AV_PIX_FMT_BGRA: *fourcc = MFX_FOURCC_RGB4; + *shift = 0; return AV_PIX_FMT_BGRA; #if CONFIG_VAAPI case AV_PIX_FMT_YUV422P: case AV_PIX_FMT_YUYV422: *fourcc = MFX_FOURCC_YUY2; + *shift = 0; return AV_PIX_FMT_YUYV422; case AV_PIX_FMT_YUV422P10: case AV_PIX_FMT_Y210: *fourcc = MFX_FOURCC_Y210; + *shift = 1; return AV_PIX_FMT_Y210; + case AV_PIX_FMT_VUYX: + *fourcc = MFX_FOURCC_AYUV; + *shift = 0; + return AV_PIX_FMT_VUYX; + case AV_PIX_FMT_XV30: + *fourcc = MFX_FOURCC_Y410; + *shift = 0; + return AV_PIX_FMT_XV30; +#if QSV_VERSION_ATLEAST(1, 31) + case AV_PIX_FMT_P012: + *fourcc = MFX_FOURCC_P016; + *shift = 1; + return AV_PIX_FMT_P012; + case AV_PIX_FMT_Y212: + *fourcc = MFX_FOURCC_Y216; + *shift = 1; + return AV_PIX_FMT_Y212; + case AV_PIX_FMT_XV36: + *fourcc = MFX_FOURCC_Y416; + *shift = 1; + return AV_PIX_FMT_XV36; +#endif #endif default: return AVERROR(ENOSYS); @@ -229,6 +289,7 @@ switch (frame->format) { case AV_PIX_FMT_NV12: case AV_PIX_FMT_P010: + case AV_PIX_FMT_P012: surface->Data.Y = frame->data[0]; surface->Data.UV = frame->data[1]; /* The SDK checks Data.V when using system memory for VP9 encoding */ @@ -248,10 +309,34 @@ break; case AV_PIX_FMT_Y210: + case AV_PIX_FMT_Y212: surface->Data.Y16 = (mfxU16 *)frame->data[0]; surface->Data.U16 = (mfxU16 *)frame->data[0] + 1; surface->Data.V16 = (mfxU16 *)frame->data[0] + 3; break; + + case AV_PIX_FMT_VUYX: + surface->Data.V = frame->data[0]; + surface->Data.U = frame->data[0] + 1; + surface->Data.Y = frame->data[0] + 2; + // Only set Data.A to a valid address, the SDK doesn't + // use the value from the frame. + surface->Data.A = frame->data[0] + 3; + break; + + case AV_PIX_FMT_XV30: + surface->Data.U = frame->data[0]; + break; + + case AV_PIX_FMT_XV36: + surface->Data.U = frame->data[0]; + surface->Data.Y = frame->data[0] + 2; + surface->Data.V = frame->data[0] + 4; + // Only set Data.A to a valid address, the SDK doesn't + // use the value from the frame. + surface->Data.A = frame->data[0] + 6; + break; + default: return AVERROR(ENOSYS); } @@ -323,6 +408,7 @@ static int qsv_load_plugins(mfxSession session, const char *load_plugins, void *logctx) { +#if QSV_HAVE_USER_PLUGIN if (!load_plugins || !*load_plugins) return 0; @@ -366,6 +452,7 @@ if (err < 0) return err; } +#endif return 0; @@ -404,6 +491,193 @@ } #endif //AVCODEC_QSV_LINUX_SESSION_HANDLE +#if QSV_ONEVPL +static int qsv_new_mfx_loader(AVCodecContext *avctx, + mfxIMPL implementation, + mfxVersion *pver, + void **ploader) +{ + mfxStatus sts; + mfxLoader loader = NULL; + mfxConfig cfg; + mfxVariant impl_value; + + loader = MFXLoad(); + if (!loader) { + av_log(avctx, AV_LOG_ERROR, "Error creating a MFX loader\n"); + goto fail; + } + + /* Create configurations for implementation */ + cfg = MFXCreateConfig(loader); + if (!cfg) { + av_log(avctx, AV_LOG_ERROR, "Error creating a MFX configurations\n"); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + impl_value.Data.U32 = (implementation == MFX_IMPL_SOFTWARE) ? + MFX_IMPL_TYPE_SOFTWARE : MFX_IMPL_TYPE_HARDWARE; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxImplDescription.Impl", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(avctx, AV_LOG_ERROR, "Error adding a MFX configuration " + "property: %d\n", sts); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + impl_value.Data.U32 = pver->Version; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxImplDescription.ApiVersion.Version", + impl_value); + if (sts != MFX_ERR_NONE) { + av_log(avctx, AV_LOG_ERROR, "Error adding a MFX configuration " + "property: %d\n", sts); + goto fail; + } + + *ploader = loader; + + return 0; + +fail: + if (loader) + MFXUnload(loader); + + *ploader = NULL; + return AVERROR_UNKNOWN; +} + +static int qsv_create_mfx_session_from_loader(void *ctx, mfxLoader loader, mfxSession *psession) +{ + mfxStatus sts; + mfxSession session = NULL; + uint32_t impl_idx = 0; + + while (1) { + /* Enumerate all implementations */ + mfxImplDescription *impl_desc; + + sts = MFXEnumImplementations(loader, impl_idx, + MFX_IMPLCAPS_IMPLDESCSTRUCTURE, + (mfxHDL *)&impl_desc); + /* Failed to find an available implementation */ + if (sts == MFX_ERR_NOT_FOUND) + break; + else if (sts != MFX_ERR_NONE) { + impl_idx++; + continue; + } + + sts = MFXCreateSession(loader, impl_idx, &session); + MFXDispReleaseImplDescription(loader, impl_desc); + if (sts == MFX_ERR_NONE) + break; + + impl_idx++; + } + + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error creating a MFX session: %d.\n", sts); + goto fail; + } + + *psession = session; + + return 0; + +fail: + if (session) + MFXClose(session); + + *psession = NULL; + return AVERROR_UNKNOWN; +} + +static int qsv_create_mfx_session(AVCodecContext *avctx, + mfxIMPL implementation, + mfxVersion *pver, + int gpu_copy, + mfxSession *psession, + void **ploader) +{ + mfxLoader loader = NULL; + + /* Don't create a new MFX loader if the input loader is valid */ + if (*ploader == NULL) { + av_log(avctx, AV_LOG_VERBOSE, + "Use Intel(R) oneVPL to create MFX session, the required " + "implementation version is %d.%d\n", + pver->Major, pver->Minor); + + if (qsv_new_mfx_loader(avctx, implementation, pver, (void **)&loader)) + goto fail; + + av_assert0(loader); + } else { + av_log(avctx, AV_LOG_VERBOSE, + "Use Intel(R) oneVPL to create MFX session with the specified MFX loader\n"); + + loader = *ploader; + } + + if (qsv_create_mfx_session_from_loader(avctx, loader, psession)) + goto fail; + + if (!*ploader) + *ploader = loader; + + return 0; + +fail: + if (!*ploader && loader) + MFXUnload(loader); + + return AVERROR_UNKNOWN; +} + +#else + +static int qsv_create_mfx_session(AVCodecContext *avctx, + mfxIMPL implementation, + mfxVersion *pver, + int gpu_copy, + mfxSession *psession, + void **ploader) +{ + mfxInitParam init_par = { MFX_IMPL_AUTO_ANY }; + mfxSession session = NULL; + mfxStatus sts; + + av_log(avctx, AV_LOG_VERBOSE, + "Use Intel(R) Media SDK to create MFX session, the required " + "implementation version is %d.%d\n", + pver->Major, pver->Minor); + + *psession = NULL; + *ploader = NULL; + + init_par.GPUCopy = gpu_copy; + init_par.Implementation = implementation; + init_par.Version = *pver; + sts = MFXInitEx(init_par, &session); + if (sts < 0) + return ff_qsv_print_error(avctx, sts, + "Error initializing a MFX session"); + else if (sts > 0) { + ff_qsv_print_warning(avctx, sts, + "Warning in MFX initialization"); + return AVERROR_UNKNOWN; + } + + *psession = session; + + return 0; +} + +#endif + int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, const char *load_plugins, int gpu_copy) { @@ -413,18 +687,12 @@ mfxIMPL impl = MFX_IMPL_AUTO_ANY; #endif mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } }; - mfxInitParam init_par = { MFX_IMPL_AUTO_ANY }; const char *desc; - int ret; - - init_par.GPUCopy = gpu_copy; - init_par.Implementation = impl; - init_par.Version = ver; - ret = MFXInitEx(init_par, &qs->session); - if (ret < 0) - return ff_qsv_print_error(avctx, ret, - "Error initializing an internal MFX session"); + int ret = qsv_create_mfx_session(avctx, impl, &ver, gpu_copy, &qs->session, + &qs->loader); + if (ret) + return ret; #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE ret = ff_qsv_set_display_handle(avctx, qs); @@ -728,7 +996,7 @@ AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)device_ref->data; AVQSVDeviceContext *device_hwctx = device_ctx->hwctx; mfxSession parent_session = device_hwctx->session; - mfxInitParam init_par = { MFX_IMPL_AUTO_ANY }; + void *loader = device_hwctx->loader; mfxHDL handle = NULL; int hw_handle_supported = 0; @@ -769,13 +1037,10 @@ "from the session\n"); } - init_par.GPUCopy = gpu_copy; - init_par.Implementation = impl; - init_par.Version = ver; - err = MFXInitEx(init_par, &session); - if (err != MFX_ERR_NONE) - return ff_qsv_print_error(avctx, err, - "Error initializing a child MFX session"); + ret = qsv_create_mfx_session(avctx, impl, &ver, gpu_copy, &session, + &loader); + if (ret) + return ret; if (handle) { err = MFXVideoCORE_SetHandle(session, handle_type, handle); @@ -854,6 +1119,12 @@ MFXClose(qs->session); qs->session = NULL; } + + if (qs->loader) { + MFXUnload(qs->loader); + qs->loader = NULL; + } + #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE av_buffer_unref(&qs->va_device_ref); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/fifo.h" @@ -41,6 +41,7 @@ #include "libavutil/time.h" #include "libavutil/imgutils.h" #include "libavutil/film_grain_params.h" +#include "libavutil/mastering_display_metadata.h" #include "avcodec.h" #include "codec_internal.h" @@ -50,6 +51,12 @@ #include "qsv.h" #include "qsv_internal.h" +#if QSV_ONEVPL +#include +#else +#define MFXUnload(a) do { } while(0) +#endif + static const AVRational mfx_tb = { 1, 90000 }; #define PTS_TO_MFX_PTS(pts, pts_tb) ((pts) == AV_NOPTS_VALUE ? \ @@ -121,7 +128,9 @@ { int ret = 0; - ff_decode_frame_props(avctx, frame); + ret = ff_decode_frame_props(avctx, frame); + if (ret < 0) + return ret; frame->width = avctx->width; frame->height = avctx->height; @@ -131,12 +140,19 @@ frame->linesize[0] = FFALIGN(avctx->width, 128); break; case AV_PIX_FMT_P010: + case AV_PIX_FMT_P012: case AV_PIX_FMT_YUYV422: frame->linesize[0] = 2 * FFALIGN(avctx->width, 128); break; case AV_PIX_FMT_Y210: + case AV_PIX_FMT_VUYX: + case AV_PIX_FMT_XV30: + case AV_PIX_FMT_Y212: frame->linesize[0] = 4 * FFALIGN(avctx->width, 128); break; + case AV_PIX_FMT_XV36: + frame->linesize[0] = 8 * FFALIGN(avctx->width, 128); + break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format.\n"); return AVERROR(EINVAL); @@ -148,7 +164,8 @@ frame->data[0] = frame->buf[0]->data; if (avctx->pix_fmt == AV_PIX_FMT_NV12 || - avctx->pix_fmt == AV_PIX_FMT_P010) { + avctx->pix_fmt == AV_PIX_FMT_P010 || + avctx->pix_fmt == AV_PIX_FMT_P012) { frame->linesize[1] = frame->linesize[0]; frame->data[1] = frame->data[0] + frame->linesize[0] * FFALIGN(avctx->height, 64); @@ -187,7 +204,11 @@ ret = ff_qsv_init_session_frames(avctx, &q->internal_qs.session, &q->frames_ctx, q->load_plugins, +#if QSV_HAVE_OPAQUE q->iopattern == MFX_IOPATTERN_OUT_OPAQUE_MEMORY, +#else + 0, +#endif q->gpu_copy); if (ret < 0) { av_buffer_unref(&q->frames_ctx.hw_frames_ctx); @@ -227,6 +248,11 @@ q->internal_qs.session = NULL; } + if (q->internal_qs.loader) { + MFXUnload(q->internal_qs.loader); + q->internal_qs.loader = NULL; + } + return AVERROR_EXTERNAL; } @@ -300,10 +326,15 @@ AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx; if (!iopattern) { +#if QSV_HAVE_OPAQUE if (frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME) iopattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY; else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET) iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; +#else + if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET) + iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; +#endif } } @@ -464,6 +495,22 @@ } #endif +#if QSV_VERSION_ATLEAST(1, 35) + if (QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 35) && avctx->codec_id == AV_CODEC_ID_HEVC) { + frame->mdcv.Header.BufferId = MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME; + frame->mdcv.Header.BufferSz = sizeof(frame->mdcv); + // The data in mdcv is valid when this flag is 1 + frame->mdcv.InsertPayloadToggle = 0; + ff_qsv_frame_add_ext_param(avctx, frame, (mfxExtBuffer *)&frame->mdcv); + + frame->clli.Header.BufferId = MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO; + frame->clli.Header.BufferSz = sizeof(frame->clli); + // The data in clli is valid when this flag is 1 + frame->clli.InsertPayloadToggle = 0; + ff_qsv_frame_add_ext_param(avctx, frame, (mfxExtBuffer *)&frame->clli); + } +#endif + frame->used = 1; return 0; @@ -600,6 +647,53 @@ } #endif +#if QSV_VERSION_ATLEAST(1, 35) +static int qsv_export_hdr_side_data(AVCodecContext *avctx, mfxExtMasteringDisplayColourVolume *mdcv, + mfxExtContentLightLevelInfo *clli, AVFrame *frame) +{ + // The SDK re-uses this flag for HDR SEI parsing + if (mdcv->InsertPayloadToggle) { + AVMasteringDisplayMetadata *mastering = av_mastering_display_metadata_create_side_data(frame); + const int mapping[3] = {2, 0, 1}; + const int chroma_den = 50000; + const int luma_den = 10000; + int i; + + if (!mastering) + return AVERROR(ENOMEM); + + for (i = 0; i < 3; i++) { + const int j = mapping[i]; + mastering->display_primaries[i][0] = av_make_q(mdcv->DisplayPrimariesX[j], chroma_den); + mastering->display_primaries[i][1] = av_make_q(mdcv->DisplayPrimariesY[j], chroma_den); + } + + mastering->white_point[0] = av_make_q(mdcv->WhitePointX, chroma_den); + mastering->white_point[1] = av_make_q(mdcv->WhitePointY, chroma_den); + + mastering->max_luminance = av_make_q(mdcv->MaxDisplayMasteringLuminance, luma_den); + mastering->min_luminance = av_make_q(mdcv->MinDisplayMasteringLuminance, luma_den); + + mastering->has_luminance = 1; + mastering->has_primaries = 1; + } + + // The SDK re-uses this flag for HDR SEI parsing + if (clli->InsertPayloadToggle) { + AVContentLightMetadata *light = av_content_light_metadata_create_side_data(frame); + + if (!light) + return AVERROR(ENOMEM); + + light->MaxCLL = clli->MaxContentLightLevel; + light->MaxFALL = clli->MaxPicAverageLightLevel; + } + + return 0; +} + +#endif + static int qsv_decode(AVCodecContext *avctx, QSVContext *q, AVFrame *frame, int *got_frame, const AVPacket *avpkt) @@ -721,6 +815,15 @@ } #endif +#if QSV_VERSION_ATLEAST(1, 35) + if (QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 35) && avctx->codec_id == AV_CODEC_ID_HEVC) { + ret = qsv_export_hdr_side_data(avctx, &aframe.frame->mdcv, &aframe.frame->clli, frame); + + if (ret < 0) + return ret; + } +#endif + frame->repeat_pict = outsurf->Info.PicStruct & MFX_PICSTRUCT_FRAME_TRIPLING ? 4 : outsurf->Info.PicStruct & MFX_PICSTRUCT_FRAME_DOUBLING ? 2 : @@ -1006,7 +1109,7 @@ }; \ const FFCodec ff_##x##_qsv_decoder = { \ .p.name = #x "_qsv", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#X " video (Intel Quick Sync Video acceleration)"), \ + CODEC_LONG_NAME(#X " video (Intel Quick Sync Video acceleration)"), \ .priv_data_size = sizeof(QSVDecContext), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = AV_CODEC_ID_##X, \ @@ -1019,12 +1122,18 @@ .p.priv_class = &x##_qsv_class, \ .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ + AV_PIX_FMT_P012, \ AV_PIX_FMT_YUYV422, \ AV_PIX_FMT_Y210, \ + AV_PIX_FMT_Y212, \ + AV_PIX_FMT_VUYX, \ + AV_PIX_FMT_XV30, \ + AV_PIX_FMT_XV36, \ AV_PIX_FMT_QSV, \ AV_PIX_FMT_NONE }, \ .hw_configs = qsv_hw_configs, \ .p.wrapper_name = "qsv", \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \ }; \ #define DEFINE_QSV_DECODER(x, X, bsf_name) DEFINE_QSV_DECODER_WITH_OPTION(x, X, bsf_name, options) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_av1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_av1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_av1.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_av1.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,158 @@ +/* + * Intel MediaSDK QSV based AV1 encoder + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#include +#include + +#include + +#include "libavutil/common.h" +#include "libavutil/opt.h" + +#include "avcodec.h" +#include "codec_internal.h" +#include "bsf.h" +#include "qsv.h" +#include "qsvenc.h" + +typedef struct QSVAV1EncContext { + AVClass *class; + AVBSFContext *extra_data_bsf; + QSVEncContext qsv; +} QSVAV1EncContext; + +static av_cold int qsv_enc_init(AVCodecContext *avctx) +{ + QSVAV1EncContext *q = avctx->priv_data; + int ret; + + if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { + const AVBitStreamFilter *filter = av_bsf_get_by_name("extract_extradata"); + if (!filter) { + av_log(avctx, AV_LOG_ERROR, "Cannot get extract_extradata bitstream filter\n"); + return AVERROR_BUG; + } + ret = av_bsf_alloc(filter, &q->extra_data_bsf); + if (ret < 0) + return ret; + ret = avcodec_parameters_from_context(q->extra_data_bsf->par_in, avctx); + if (ret < 0) + return ret; + ret = av_bsf_init(q->extra_data_bsf); + if (ret < 0) + return ret; + } + + return ff_qsv_enc_init(avctx, &q->qsv); +} + +static int qsv_enc_frame(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet) +{ + QSVAV1EncContext *q = avctx->priv_data; + int ret; + + ret = ff_qsv_encode(avctx, &q->qsv, pkt, frame, got_packet); + if (ret < 0) + return ret; + + if (*got_packet && avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { + ret = av_bsf_send_packet(q->extra_data_bsf, pkt); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "extract_extradata filter " + "failed to send input packet\n"); + return ret; + } + + ret = av_bsf_receive_packet(q->extra_data_bsf, pkt); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "extract_extradata filter " + "failed to receive output packet\n"); + return ret; + } + } + + return ret; +} + +static av_cold int qsv_enc_close(AVCodecContext *avctx) +{ + QSVAV1EncContext *q = avctx->priv_data; + + av_bsf_free(&q->extra_data_bsf); + + return ff_qsv_enc_close(avctx, &q->qsv); +} + +#define OFFSET(x) offsetof(QSVAV1EncContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + QSV_COMMON_OPTS + QSV_OPTION_B_STRATEGY + QSV_OPTION_ADAPTIVE_I + QSV_OPTION_ADAPTIVE_B + QSV_OPTION_EXTBRC + QSV_OPTION_LOW_DELAY_BRC + QSV_OPTION_MAX_FRAME_SIZE + { "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" }, + { "unknown" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, + { "main" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AV1_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "tile_cols", "Number of columns for tiled encoding", OFFSET(qsv.tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, + { "tile_rows", "Number of rows for tiled encoding", OFFSET(qsv.tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, + { "look_ahead_depth", "Depth of look ahead in number frames, available when extbrc option is enabled", OFFSET(qsv.look_ahead_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, VE }, + { NULL }, +}; + +static const AVClass class = { + .class_name = "av1_qsv encoder", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +static const FFCodecDefault qsv_enc_defaults[] = { + { "b", "1M" }, + { "g", "-1" }, + { "bf", "-1" }, + { "refs", "0" }, + { NULL }, +}; + +FFCodec ff_av1_qsv_encoder = { + .p.name = "av1_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("AV1 (Intel Quick Sync Video acceleration)"), + .priv_data_size = sizeof(QSVAV1EncContext), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .init = qsv_enc_init, + FF_CODEC_ENCODE_CB(qsv_enc_frame), + .close = qsv_enc_close, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + AV_PIX_FMT_P010, + AV_PIX_FMT_QSV, + AV_PIX_FMT_NONE }, + .p.priv_class = &class, + .defaults = qsv_enc_defaults, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.wrapper_name = "qsv", + .hw_configs = ff_qsv_enc_hw_configs, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/hwcontext.h" @@ -82,6 +82,14 @@ { MFX_PROFILE_VP9_3, "vp9 3" }, }; +static const struct profile_names av1_profiles[] = { +#if QSV_VERSION_ATLEAST(1, 34) + { MFX_PROFILE_AV1_MAIN, "av1 main" }, + { MFX_PROFILE_AV1_HIGH, "av1 high" }, + { MFX_PROFILE_AV1_PRO, "av1 professional" }, +#endif +}; + typedef struct QSVPacket { AVPacket pkt; mfxSyncPoint *sync; @@ -114,6 +122,11 @@ num_profiles = FF_ARRAY_ELEMS(vp9_profiles); break; + case AV_CODEC_ID_AV1: + profiles = av1_profiles; + num_profiles = FF_ARRAY_ELEMS(av1_profiles); + break; + default: return "unknown"; } @@ -141,7 +154,9 @@ #if QSV_HAVE_VCM { MFX_RATECONTROL_VCM, "VCM" }, #endif +#if !QSV_ONEVPL { MFX_RATECONTROL_LA_EXT, "LA_EXT" }, +#endif { MFX_RATECONTROL_LA_HRD, "LA_HRD" }, { MFX_RATECONTROL_QVBR, "QVBR" }, }; @@ -154,6 +169,8 @@ } \ } while (0) \ +#define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) + static const char *print_ratecontrol(mfxU16 rc_mode) { int i; @@ -182,6 +199,11 @@ mfxExtCodingOption2 *co2 = NULL; mfxExtCodingOption3 *co3 = NULL; mfxExtHEVCTiles *exthevctiles = NULL; +#if QSV_HAVE_HE + mfxExtHyperModeParam *exthypermodeparam = NULL; +#endif + + const char *tmp_str = NULL; if (q->co2_idx > 0) co2 = (mfxExtCodingOption2*)coding_opts[q->co2_idx]; @@ -192,16 +214,20 @@ if (q->exthevctiles_idx > 0) exthevctiles = (mfxExtHEVCTiles *)coding_opts[q->exthevctiles_idx]; +#if QSV_HAVE_HE + if (q->exthypermodeparam_idx > 0) + exthypermodeparam = (mfxExtHyperModeParam *)coding_opts[q->exthypermodeparam_idx]; +#endif + av_log(avctx, AV_LOG_VERBOSE, "profile: %s; level: %"PRIu16"\n", print_profile(avctx->codec_id, info->CodecProfile), info->CodecLevel); - av_log(avctx, AV_LOG_VERBOSE, "GopPicSize: %"PRIu16"; GopRefDist: %"PRIu16"; GopOptFlag: ", - info->GopPicSize, info->GopRefDist); - if (info->GopOptFlag & MFX_GOP_CLOSED) - av_log(avctx, AV_LOG_VERBOSE, "closed "); - if (info->GopOptFlag & MFX_GOP_STRICT) - av_log(avctx, AV_LOG_VERBOSE, "strict "); - av_log(avctx, AV_LOG_VERBOSE, "; IdrInterval: %"PRIu16"\n", info->IdrInterval); + av_log(avctx, AV_LOG_VERBOSE, + "GopPicSize: %"PRIu16"; GopRefDist: %"PRIu16"; GopOptFlag:%s%s; IdrInterval: %"PRIu16"\n", + info->GopPicSize, info->GopRefDist, + info->GopOptFlag & MFX_GOP_CLOSED ? " closed" : "", + info->GopOptFlag & MFX_GOP_STRICT ? " strict" : "", + info->IdrInterval); av_log(avctx, AV_LOG_VERBOSE, "TargetUsage: %"PRIu16"; RateControlMethod: %s\n", info->TargetUsage, print_ratecontrol(info->RateControlMethod)); @@ -269,64 +295,79 @@ av_log(avctx, AV_LOG_VERBOSE, "IntRefType: %"PRIu16"; IntRefCycleSize: %"PRIu16"; IntRefQPDelta: %"PRId16"\n", co2->IntRefType, co2->IntRefCycleSize, co2->IntRefQPDelta); - av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d; ", co2->MaxFrameSize); - av_log(avctx, AV_LOG_VERBOSE, "MaxSliceSize: %d; ", co2->MaxSliceSize); - av_log(avctx, AV_LOG_VERBOSE, "\n"); + av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d; MaxSliceSize: %d\n", + co2->MaxFrameSize, co2->MaxSliceSize); av_log(avctx, AV_LOG_VERBOSE, "BitrateLimit: %s; MBBRC: %s; ExtBRC: %s\n", print_threestate(co2->BitrateLimit), print_threestate(co2->MBBRC), print_threestate(co2->ExtBRC)); - av_log(avctx, AV_LOG_VERBOSE, "Trellis: "); if (co2->Trellis & MFX_TRELLIS_OFF) { - av_log(avctx, AV_LOG_VERBOSE, "off"); + av_log(avctx, AV_LOG_VERBOSE, "Trellis: off\n"); } else if (!co2->Trellis) { - av_log(avctx, AV_LOG_VERBOSE, "auto"); + av_log(avctx, AV_LOG_VERBOSE, "Trellis: auto\n"); } else { - if (co2->Trellis & MFX_TRELLIS_I) av_log(avctx, AV_LOG_VERBOSE, "I"); - if (co2->Trellis & MFX_TRELLIS_P) av_log(avctx, AV_LOG_VERBOSE, "P"); - if (co2->Trellis & MFX_TRELLIS_B) av_log(avctx, AV_LOG_VERBOSE, "B"); + char trellis_type[4]; + int i = 0; + if (co2->Trellis & MFX_TRELLIS_I) trellis_type[i++] = 'I'; + if (co2->Trellis & MFX_TRELLIS_P) trellis_type[i++] = 'P'; + if (co2->Trellis & MFX_TRELLIS_B) trellis_type[i++] = 'B'; + trellis_type[i] = 0; + av_log(avctx, AV_LOG_VERBOSE, "Trellis: %s\n", trellis_type); } - av_log(avctx, AV_LOG_VERBOSE, "\n"); - av_log(avctx, AV_LOG_VERBOSE, - "RepeatPPS: %s; NumMbPerSlice: %"PRIu16"; LookAheadDS: ", - print_threestate(co2->RepeatPPS), co2->NumMbPerSlice); switch (co2->LookAheadDS) { - case MFX_LOOKAHEAD_DS_OFF: av_log(avctx, AV_LOG_VERBOSE, "off"); break; - case MFX_LOOKAHEAD_DS_2x: av_log(avctx, AV_LOG_VERBOSE, "2x"); break; - case MFX_LOOKAHEAD_DS_4x: av_log(avctx, AV_LOG_VERBOSE, "4x"); break; - default: av_log(avctx, AV_LOG_VERBOSE, "unknown"); break; + case MFX_LOOKAHEAD_DS_OFF: tmp_str = "off"; break; + case MFX_LOOKAHEAD_DS_2x: tmp_str = "2x"; break; + case MFX_LOOKAHEAD_DS_4x: tmp_str = "4x"; break; + default: tmp_str = "unknown"; break; } - av_log(avctx, AV_LOG_VERBOSE, "\n"); + av_log(avctx, AV_LOG_VERBOSE, + "RepeatPPS: %s; NumMbPerSlice: %"PRIu16"; LookAheadDS: %s\n", + print_threestate(co2->RepeatPPS), co2->NumMbPerSlice, tmp_str); - av_log(avctx, AV_LOG_VERBOSE, "AdaptiveI: %s; AdaptiveB: %s; BRefType: ", - print_threestate(co2->AdaptiveI), print_threestate(co2->AdaptiveB)); switch (co2->BRefType) { - case MFX_B_REF_OFF: av_log(avctx, AV_LOG_VERBOSE, "off"); break; - case MFX_B_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid"); break; - default: av_log(avctx, AV_LOG_VERBOSE, "auto"); break; + case MFX_B_REF_OFF: tmp_str = "off"; break; + case MFX_B_REF_PYRAMID: tmp_str = "pyramid"; break; + default: tmp_str = "auto"; break; } + av_log(avctx, AV_LOG_VERBOSE, + "AdaptiveI: %s; AdaptiveB: %s; BRefType:%s\n", + print_threestate(co2->AdaptiveI), print_threestate(co2->AdaptiveB), tmp_str); av_log(avctx, AV_LOG_VERBOSE, "MinQPI: %"PRIu8"; MaxQPI: %"PRIu8"; MinQPP: %"PRIu8"; MaxQPP: %"PRIu8"; MinQPB: %"PRIu8"; MaxQPB: %"PRIu8"\n", co2->MinQPI, co2->MaxQPI, co2->MinQPP, co2->MaxQPP, co2->MinQPB, co2->MaxQPB); av_log(avctx, AV_LOG_VERBOSE, "DisableDeblockingIdc: %"PRIu32" \n", co2->DisableDeblockingIdc); + + switch (co2->SkipFrame) { + case MFX_SKIPFRAME_NO_SKIP: + av_log(avctx, AV_LOG_VERBOSE, "SkipFrame: no_skip\n"); + break; + case MFX_SKIPFRAME_INSERT_DUMMY: + av_log(avctx, AV_LOG_VERBOSE, "SkipFrame: insert_dummy\n"); + break; + case MFX_SKIPFRAME_INSERT_NOTHING: + av_log(avctx, AV_LOG_VERBOSE, "SkipFrame: insert_nothing\n"); + break; + case MFX_SKIPFRAME_BRC_ONLY: + av_log(avctx, AV_LOG_VERBOSE, "SkipFrame: brc_only\n"); + break; + default: break; + } } if (co3) { if (info->RateControlMethod == MFX_RATECONTROL_QVBR) av_log(avctx, AV_LOG_VERBOSE, "QVBRQuality: %"PRIu16"\n", co3->QVBRQuality); - av_log(avctx, AV_LOG_VERBOSE, "PRefType: "); switch (co3->PRefType) { - case MFX_P_REF_DEFAULT: av_log(avctx, AV_LOG_VERBOSE, "default"); break; - case MFX_P_REF_SIMPLE: av_log(avctx, AV_LOG_VERBOSE, "simple"); break; - case MFX_P_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid"); break; - default: av_log(avctx, AV_LOG_VERBOSE, "unknown"); break; + case MFX_P_REF_DEFAULT: av_log(avctx, AV_LOG_VERBOSE, "PRefType: default\n"); break; + case MFX_P_REF_SIMPLE: av_log(avctx, AV_LOG_VERBOSE, "PRefType: simple\n"); break; + case MFX_P_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "PRefType: pyramid\n"); break; + default: av_log(avctx, AV_LOG_VERBOSE, "PRefType: unknown\n"); break; } - av_log(avctx, AV_LOG_VERBOSE, "\n"); if (avctx->codec_id == AV_CODEC_ID_HEVC) av_log(avctx, AV_LOG_VERBOSE,"GPB: %s\n", print_threestate(co3->GPB)); @@ -336,12 +377,28 @@ av_log(avctx, AV_LOG_VERBOSE, "LowDelayBRC: %s\n", print_threestate(co3->LowDelayBRC)); av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSizeI: %d; ", co3->MaxFrameSizeI); av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSizeP: %d\n", co3->MaxFrameSizeP); + av_log(avctx, AV_LOG_VERBOSE, "ScenarioInfo: %"PRId16"\n", co3->ScenarioInfo); } if (exthevctiles) { av_log(avctx, AV_LOG_VERBOSE, "NumTileColumns: %"PRIu16"; NumTileRows: %"PRIu16"\n", exthevctiles->NumTileColumns, exthevctiles->NumTileRows); } + +#if QSV_HAVE_HE + if (exthypermodeparam) { + av_log(avctx, AV_LOG_VERBOSE, "HyperEncode: "); + + if (exthypermodeparam->Mode == MFX_HYPERMODE_OFF) + av_log(avctx, AV_LOG_VERBOSE, "OFF"); + if (exthypermodeparam->Mode == MFX_HYPERMODE_ON) + av_log(avctx, AV_LOG_VERBOSE, "ON"); + if (exthypermodeparam->Mode == MFX_HYPERMODE_ADAPTIVE) + av_log(avctx, AV_LOG_VERBOSE, "Adaptive"); + + av_log(avctx, AV_LOG_VERBOSE, "\n"); + } +#endif } static void dump_video_vp9_param(AVCodecContext *avctx, QSVEncContext *q, @@ -360,13 +417,12 @@ av_log(avctx, AV_LOG_VERBOSE, "profile: %s \n", print_profile(avctx->codec_id, info->CodecProfile)); - av_log(avctx, AV_LOG_VERBOSE, "GopPicSize: %"PRIu16"; GopRefDist: %"PRIu16"; GopOptFlag: ", - info->GopPicSize, info->GopRefDist); - if (info->GopOptFlag & MFX_GOP_CLOSED) - av_log(avctx, AV_LOG_VERBOSE, "closed "); - if (info->GopOptFlag & MFX_GOP_STRICT) - av_log(avctx, AV_LOG_VERBOSE, "strict "); - av_log(avctx, AV_LOG_VERBOSE, "; IdrInterval: %"PRIu16"\n", info->IdrInterval); + av_log(avctx, AV_LOG_VERBOSE, + "GopPicSize: %"PRIu16"; GopRefDist: %"PRIu16"; GopOptFlag:%s%s; IdrInterval: %"PRIu16"\n", + info->GopPicSize, info->GopRefDist, + info->GopOptFlag & MFX_GOP_CLOSED ? " closed" : "", + info->GopOptFlag & MFX_GOP_STRICT ? " strict" : "", + info->IdrInterval); av_log(avctx, AV_LOG_VERBOSE, "TargetUsage: %"PRIu16"; RateControlMethod: %s\n", info->TargetUsage, print_ratecontrol(info->RateControlMethod)); @@ -396,8 +452,7 @@ "IntRefType: %"PRIu16"; IntRefCycleSize: %"PRIu16"; IntRefQPDelta: %"PRId16"\n", co2->IntRefType, co2->IntRefCycleSize, co2->IntRefQPDelta); - av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d; ", co2->MaxFrameSize); - av_log(avctx, AV_LOG_VERBOSE, "\n"); + av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d\n", co2->MaxFrameSize); av_log(avctx, AV_LOG_VERBOSE, "BitrateLimit: %s; MBBRC: %s; ExtBRC: %s\n", @@ -429,6 +484,90 @@ info->FrameInfo.FrameRateExtD, info->FrameInfo.FrameRateExtN); } +#if QSV_HAVE_EXT_AV1_PARAM +static void dump_video_av1_param(AVCodecContext *avctx, QSVEncContext *q, + mfxExtBuffer **coding_opts) +{ + mfxInfoMFX *info = &q->param.mfx; + mfxExtAV1TileParam *av1_tile_param = (mfxExtAV1TileParam *)coding_opts[0]; + mfxExtAV1BitstreamParam *av1_bs_param = (mfxExtAV1BitstreamParam *)coding_opts[1]; + mfxExtCodingOption2 *co2 = (mfxExtCodingOption2*)coding_opts[2]; + mfxExtCodingOption3 *co3 = (mfxExtCodingOption3*)coding_opts[3]; + + av_log(avctx, AV_LOG_VERBOSE, "profile: %s; level: %"PRIu16"\n", + print_profile(avctx->codec_id, info->CodecProfile), info->CodecLevel); + + av_log(avctx, AV_LOG_VERBOSE, + "GopPicSize: %"PRIu16"; GopRefDist: %"PRIu16"; GopOptFlag:%s%s; IdrInterval: %"PRIu16"\n", + info->GopPicSize, info->GopRefDist, + info->GopOptFlag & MFX_GOP_CLOSED ? " closed" : "", + info->GopOptFlag & MFX_GOP_STRICT ? " strict" : "", + info->IdrInterval); + + av_log(avctx, AV_LOG_VERBOSE, "TargetUsage: %"PRIu16"; RateControlMethod: %s\n", + info->TargetUsage, print_ratecontrol(info->RateControlMethod)); + + if (info->RateControlMethod == MFX_RATECONTROL_CBR || + info->RateControlMethod == MFX_RATECONTROL_VBR) + av_log(avctx, AV_LOG_VERBOSE, + "BufferSizeInKB: %"PRIu16"; InitialDelayInKB: %"PRIu16"; TargetKbps: %"PRIu16"; MaxKbps: %"PRIu16"; BRCParamMultiplier: %"PRIu16"\n", + info->BufferSizeInKB, info->InitialDelayInKB, info->TargetKbps, info->MaxKbps, info->BRCParamMultiplier); + else if (info->RateControlMethod == MFX_RATECONTROL_CQP) + av_log(avctx, AV_LOG_VERBOSE, "QPI: %"PRIu16"; QPP: %"PRIu16"; QPB: %"PRIu16"\n", + info->QPI, info->QPP, info->QPB); + else if (info->RateControlMethod == MFX_RATECONTROL_ICQ) + av_log(avctx, AV_LOG_VERBOSE, "ICQQuality: %"PRIu16"\n", info->ICQQuality); + else + av_log(avctx, AV_LOG_VERBOSE, "Unsupported ratecontrol method: %d \n", info->RateControlMethod); + + av_log(avctx, AV_LOG_VERBOSE, "NumRefFrame: %"PRIu16"\n", info->NumRefFrame); + + av_log(avctx, AV_LOG_VERBOSE, + "IntRefType: %"PRIu16"; IntRefCycleSize: %"PRIu16 + "; IntRefQPDelta: %"PRId16"; IntRefCycleDist: %"PRId16"\n", + co2->IntRefType, co2->IntRefCycleSize, + co2->IntRefQPDelta, co3->IntRefCycleDist); + + av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d;\n", co2->MaxFrameSize); + + av_log(avctx, AV_LOG_VERBOSE, + "BitrateLimit: %s; MBBRC: %s; ExtBRC: %s\n", + print_threestate(co2->BitrateLimit), print_threestate(co2->MBBRC), + print_threestate(co2->ExtBRC)); + + av_log(avctx, AV_LOG_VERBOSE, "VDENC: %s\n", print_threestate(info->LowPower)); + + switch (co2->BRefType) { + case MFX_B_REF_OFF: av_log(avctx, AV_LOG_VERBOSE, "BRefType: off\n"); break; + case MFX_B_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "BRefType: pyramid\n"); break; + default: av_log(avctx, AV_LOG_VERBOSE, "BRefType: auto\n"); break; + } + + switch (co3->PRefType) { + case MFX_P_REF_DEFAULT: av_log(avctx, AV_LOG_VERBOSE, "PRefType: default\n"); break; + case MFX_P_REF_SIMPLE: av_log(avctx, AV_LOG_VERBOSE, "PRefType: simple\n"); break; + case MFX_P_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "PRefType: pyramid\n"); break; + default: av_log(avctx, AV_LOG_VERBOSE, "PRefType: unknown\n"); break; + } + + av_log(avctx, AV_LOG_VERBOSE, + "MinQPI: %"PRIu8"; MaxQPI: %"PRIu8"; MinQPP: %"PRIu8"; MaxQPP: %"PRIu8"; MinQPB: %"PRIu8"; MaxQPB: %"PRIu8"\n", + co2->MinQPI, co2->MaxQPI, co2->MinQPP, co2->MaxQPP, co2->MinQPB, co2->MaxQPB); + + av_log(avctx, AV_LOG_VERBOSE, "FrameRateExtD: %"PRIu32"; FrameRateExtN: %"PRIu32" \n", + info->FrameInfo.FrameRateExtD, info->FrameInfo.FrameRateExtN); + + av_log(avctx, AV_LOG_VERBOSE, + "NumTileRows: %"PRIu16"; NumTileColumns: %"PRIu16"; NumTileGroups: %"PRIu16"\n", + av1_tile_param->NumTileRows, av1_tile_param->NumTileColumns, av1_tile_param->NumTileGroups); + + av_log(avctx, AV_LOG_VERBOSE, "WriteIVFHeaders: %s \n", + print_threestate(av1_bs_param->WriteIVFHeaders)); + av_log(avctx, AV_LOG_VERBOSE, "LowDelayBRC: %s\n", print_threestate(co3->LowDelayBRC)); + av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d;\n", co2->MaxFrameSize); +} +#endif + static int select_rc_mode(AVCodecContext *avctx, QSVEncContext *q) { const char *rc_desc; @@ -479,7 +618,10 @@ rc_desc = "constant bitrate (CBR)"; } #if QSV_HAVE_AVBR - else if (!avctx->rc_max_rate) { + else if (!avctx->rc_max_rate && + (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_HEVC) && + q->avbr_accuracy && + q->avbr_convergence) { rc_mode = MFX_RATECONTROL_AVBR; rc_desc = "average variable bitrate (AVBR)"; } @@ -530,6 +672,12 @@ return 1; } +static int is_strict_gop(QSVEncContext *q) { + if (q->adaptive_b == 0 && q->adaptive_i == 0) + return 1; + return 0; +} + static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q) { enum AVPixelFormat sw_format = avctx->pix_fmt == AV_PIX_FMT_QSV ? @@ -550,7 +698,7 @@ if (!desc) return AVERROR_BUG; - ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC); + ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC, &q->param.mfx.FrameInfo.Shift); if (ret < 0) return AVERROR_BUG; @@ -564,7 +712,6 @@ !desc->log2_chroma_w + !desc->log2_chroma_h; q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth; q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; - q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, 16); q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 16); @@ -612,8 +759,11 @@ return AVERROR_BUG; q->param.mfx.CodecId = ret; - if (avctx->level > 0) + if (avctx->level > 0) { q->param.mfx.CodecLevel = avctx->level; + if (avctx->codec_id == AV_CODEC_ID_HEVC && avctx->level >= MFX_LEVEL_HEVC_4) + q->param.mfx.CodecLevel |= q->tier; + } if (avctx->compression_level == FF_COMPRESSION_DEFAULT) { avctx->compression_level = q->preset; @@ -636,9 +786,11 @@ q->param.mfx.CodecProfile = q->profile; q->param.mfx.TargetUsage = avctx->compression_level; q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size); + q->old_gop_size = avctx->gop_size; q->param.mfx.GopRefDist = FFMAX(-1, avctx->max_b_frames) + 1; q->param.mfx.GopOptFlag = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ? - MFX_GOP_CLOSED : MFX_GOP_STRICT; + MFX_GOP_CLOSED : is_strict_gop(q) ? + MFX_GOP_STRICT : 0; q->param.mfx.IdrInterval = q->idr_interval; q->param.mfx.NumSlice = avctx->slices; q->param.mfx.NumRefFrame = FFMAX(0, avctx->refs); @@ -649,7 +801,7 @@ if (!desc) return AVERROR_BUG; - ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC); + ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC, &q->param.mfx.FrameInfo.Shift); if (ret < 0) return AVERROR_BUG; @@ -663,7 +815,6 @@ !desc->log2_chroma_w + !desc->log2_chroma_h; q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth; q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; - q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; // If the minor version is greater than or equal to 19, // then can use the same alignment settings as H.264 for HEVC @@ -701,6 +852,7 @@ q->param.mfx.FrameInfo.FrameRateExtN = avctx->time_base.den; q->param.mfx.FrameInfo.FrameRateExtD = avctx->time_base.num; } + q->old_framerate = avctx->framerate; ret = select_rc_mode(avctx, q); if (ret < 0) @@ -713,6 +865,10 @@ max_bitrate_kbps = avctx->rc_max_rate / 1000; brc_param_multiplier = (FFMAX(FFMAX3(target_bitrate_kbps, max_bitrate_kbps, buffer_size_in_kilobytes), initial_delay_in_kilobytes) + 0x10000) / 0x10000; + q->old_rc_buffer_size = avctx->rc_buffer_size; + q->old_rc_initial_buffer_occupancy = avctx->rc_initial_buffer_occupancy; + q->old_bit_rate = avctx->bit_rate; + q->old_rc_max_rate = avctx->rc_max_rate; switch (q->param.mfx.RateControlMethod) { case MFX_RATECONTROL_CBR: @@ -734,10 +890,20 @@ break; case MFX_RATECONTROL_CQP: quant = avctx->global_quality / FF_QP2LAMBDA; - - q->param.mfx.QPI = av_clip(quant * fabs(avctx->i_quant_factor) + avctx->i_quant_offset, 0, 51); - q->param.mfx.QPP = av_clip(quant, 0, 51); - q->param.mfx.QPB = av_clip(quant * fabs(avctx->b_quant_factor) + avctx->b_quant_offset, 0, 51); + if (avctx->codec_id == AV_CODEC_ID_AV1) { + q->param.mfx.QPI = av_clip_uintp2(quant * fabs(avctx->i_quant_factor) + avctx->i_quant_offset, 8); + q->param.mfx.QPP = av_clip_uintp2(quant, 8); + q->param.mfx.QPB = av_clip_uintp2(quant * fabs(avctx->b_quant_factor) + avctx->b_quant_offset, 8); + } else { + q->param.mfx.QPI = av_clip(quant * fabs(avctx->i_quant_factor) + avctx->i_quant_offset, 0, 51); + q->param.mfx.QPP = av_clip(quant, 0, 51); + q->param.mfx.QPB = av_clip(quant * fabs(avctx->b_quant_factor) + avctx->b_quant_offset, 0, 51); + } + q->old_global_quality = avctx->global_quality; + q->old_i_quant_factor = avctx->i_quant_factor; + q->old_i_quant_offset = avctx->i_quant_offset; + q->old_b_quant_factor = avctx->b_quant_factor; + q->old_b_quant_offset = avctx->b_quant_offset; break; #if QSV_HAVE_AVBR @@ -770,6 +936,7 @@ q->extco.PicTimingSEI = q->pic_timing_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN; + q->old_pic_timing_sei = q->pic_timing_sei; if (q->rdo >= 0) q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; @@ -812,11 +979,6 @@ q->extco2.LookAheadDS = q->look_ahead_downsampling; q->extco2.RepeatPPS = q->repeat_pps ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; - - if (q->adaptive_i >= 0) - q->extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; - if (q->adaptive_b >= 0) - q->extco2.AdaptiveB = q->adaptive_b ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; } if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_HEVC) { @@ -824,18 +986,26 @@ q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; if (q->max_frame_size >= 0) q->extco2.MaxFrameSize = q->max_frame_size; + q->old_max_frame_size = q->max_frame_size; if (q->int_ref_type >= 0) q->extco2.IntRefType = q->int_ref_type; + q->old_int_ref_type = q->int_ref_type; if (q->int_ref_cycle_size >= 0) q->extco2.IntRefCycleSize = q->int_ref_cycle_size; + q->old_int_ref_cycle_size = q->int_ref_cycle_size; if (q->int_ref_qp_delta != INT16_MIN) q->extco2.IntRefQPDelta = q->int_ref_qp_delta; + q->old_int_ref_qp_delta = q->int_ref_qp_delta; if (q->max_slice_size >= 0) q->extco2.MaxSliceSize = q->max_slice_size; q->extco2.DisableDeblockingIdc = q->dblk_idc; if (q->b_strategy >= 0) q->extco2.BRefType = q->b_strategy ? MFX_B_REF_PYRAMID : MFX_B_REF_OFF; + if (q->adaptive_i >= 0) + q->extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + if (q->adaptive_b >= 0) + q->extco2.AdaptiveB = q->adaptive_b ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; if ((avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > avctx->qmax) || (q->max_qp_i >= 0 && q->min_qp_i >= 0 && q->min_qp_i > q->max_qp_i) || (q->max_qp_p >= 0 && q->min_qp_p >= 0 && q->min_qp_p > q->max_qp_p) || @@ -849,24 +1019,50 @@ q->extco2.MinQPI = avctx->qmin > 51 ? 51 : avctx->qmin; q->extco2.MinQPP = q->extco2.MinQPB = q->extco2.MinQPI; } + q->old_qmin = avctx->qmin; if (avctx->qmax >= 0) { q->extco2.MaxQPI = avctx->qmax > 51 ? 51 : avctx->qmax; q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI; } + q->old_qmax = avctx->qmax; if (q->min_qp_i >= 0) q->extco2.MinQPI = q->min_qp_i > 51 ? 51 : q->min_qp_i; + q->old_min_qp_i = q->min_qp_i; if (q->max_qp_i >= 0) q->extco2.MaxQPI = q->max_qp_i > 51 ? 51 : q->max_qp_i; + q->old_max_qp_i = q->max_qp_i; if (q->min_qp_p >= 0) q->extco2.MinQPP = q->min_qp_p > 51 ? 51 : q->min_qp_p; + q->old_min_qp_p = q->min_qp_p; if (q->max_qp_p >= 0) q->extco2.MaxQPP = q->max_qp_p > 51 ? 51 : q->max_qp_p; + q->old_max_qp_p = q->max_qp_p; if (q->min_qp_b >= 0) q->extco2.MinQPB = q->min_qp_b > 51 ? 51 : q->min_qp_b; + q->old_min_qp_b = q->min_qp_b; if (q->max_qp_b >= 0) q->extco2.MaxQPB = q->max_qp_b > 51 ? 51 : q->max_qp_b; + q->old_max_qp_b = q->max_qp_b; if (q->mbbrc >= 0) q->extco2.MBBRC = q->mbbrc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + if (q->skip_frame >= 0) + q->extco2.SkipFrame = q->skip_frame; + + q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; + q->extco2.Header.BufferSz = sizeof(q->extco2); + + q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco2; + } else if (avctx->codec_id == AV_CODEC_ID_AV1) { + if (q->extbrc >= 0) + q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + if (q->b_strategy >= 0) + q->extco2.BRefType = q->b_strategy ? MFX_B_REF_PYRAMID : MFX_B_REF_OFF; + if (q->adaptive_i >= 0) + q->extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + if (q->adaptive_b >= 0) + q->extco2.AdaptiveB = q->adaptive_b ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + if (q->max_frame_size >= 0) + q->extco2.MaxFrameSize = q->max_frame_size; q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; q->extco2.Header.BufferSz = sizeof(q->extco2); @@ -914,12 +1110,19 @@ } if (q->int_ref_cycle_dist >= 0) q->extco3.IntRefCycleDist = q->int_ref_cycle_dist; + q->old_int_ref_cycle_dist = q->int_ref_cycle_dist; if (q->low_delay_brc >= 0) q->extco3.LowDelayBRC = q->low_delay_brc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + q->old_low_delay_brc = q->low_delay_brc; if (q->max_frame_size_i >= 0) q->extco3.MaxFrameSizeI = q->max_frame_size_i; if (q->max_frame_size_p >= 0) q->extco3.MaxFrameSizeP = q->max_frame_size_p; + + q->extco3.ScenarioInfo = q->scenario; + } else if (avctx->codec_id == AV_CODEC_ID_AV1) { + if (q->low_delay_brc >= 0) + q->extco3.LowDelayBRC = q->low_delay_brc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; } if (avctx->codec_id == AV_CODEC_ID_HEVC) { @@ -944,6 +1147,27 @@ q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extvp9param; } +#if QSV_HAVE_EXT_AV1_PARAM + if (avctx->codec_id == AV_CODEC_ID_AV1) { + if (QSV_RUNTIME_VERSION_ATLEAST(q->ver, 2, 5)) { + q->extav1tileparam.Header.BufferId = MFX_EXTBUFF_AV1_TILE_PARAM; + q->extav1tileparam.Header.BufferSz = sizeof(q->extav1tileparam); + q->extav1tileparam.NumTileColumns = q->tile_cols; + q->extav1tileparam.NumTileRows = q->tile_rows; + q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extav1tileparam; + + q->extav1bsparam.Header.BufferId = MFX_EXTBUFF_AV1_BITSTREAM_PARAM; + q->extav1bsparam.Header.BufferSz = sizeof(q->extav1bsparam); + q->extav1bsparam.WriteIVFHeaders = MFX_CODINGOPTION_OFF; + q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extav1bsparam; + } else { + av_log(avctx, AV_LOG_ERROR, + "This version of runtime doesn't support AV1 encoding\n"); + return AVERROR_UNKNOWN; + } + } +#endif + if (avctx->codec_id == AV_CODEC_ID_HEVC) { q->exthevctiles.Header.BufferId = MFX_EXTBUFF_HEVC_TILES; q->exthevctiles.Header.BufferSz = sizeof(q->exthevctiles); @@ -961,15 +1185,68 @@ q->extvsi.ColourDescriptionPresent = 1; q->extvsi.ColourPrimaries = avctx->color_primaries; q->extvsi.TransferCharacteristics = avctx->color_trc; - q->extvsi.MatrixCoefficients = avctx->colorspace; + if (avctx->colorspace == AVCOL_SPC_RGB) + // RGB will be converted to YUV, so RGB colorspace is not supported + q->extvsi.MatrixCoefficients = AVCOL_SPC_UNSPECIFIED; + else + q->extvsi.MatrixCoefficients = avctx->colorspace; + } - if (q->extvsi.VideoFullRange || q->extvsi.ColourDescriptionPresent) { + if ((avctx->codec_id != AV_CODEC_ID_VP9) && (q->extvsi.VideoFullRange || q->extvsi.ColourDescriptionPresent)) { q->extvsi.Header.BufferId = MFX_EXTBUFF_VIDEO_SIGNAL_INFO; q->extvsi.Header.BufferSz = sizeof(q->extvsi); q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extvsi; } +#if QSV_HAVE_HE + if (q->dual_gfx) { + if (QSV_RUNTIME_VERSION_ATLEAST(q->ver, 2, 4)) { + mfxIMPL impl; + MFXQueryIMPL(q->session, &impl); + + if (MFX_IMPL_VIA_MASK(impl) != MFX_IMPL_VIA_D3D11) { + av_log(avctx, AV_LOG_ERROR, "Dual GFX mode requires D3D11VA \n"); + return AVERROR_UNKNOWN; + } + if (q->param.mfx.LowPower != MFX_CODINGOPTION_ON) { + av_log(avctx, AV_LOG_ERROR, "Dual GFX mode supports only low-power encoding mode \n"); + return AVERROR_UNKNOWN; + } + if (q->param.mfx.CodecId != MFX_CODEC_AVC && q->param.mfx.CodecId != MFX_CODEC_HEVC) { + av_log(avctx, AV_LOG_ERROR, "Not supported encoder for dual GFX mode. " + "Supported: h264_qsv and hevc_qsv \n"); + return AVERROR_UNKNOWN; + } + if (q->param.mfx.RateControlMethod != MFX_RATECONTROL_VBR && + q->param.mfx.RateControlMethod != MFX_RATECONTROL_CQP && + q->param.mfx.RateControlMethod != MFX_RATECONTROL_ICQ) { + av_log(avctx, AV_LOG_WARNING, "Not supported BRC for dual GFX mode. " + "Supported: VBR, CQP and ICQ \n"); + } + if ((q->param.mfx.CodecId == MFX_CODEC_AVC && q->param.mfx.IdrInterval != 0) || + (q->param.mfx.CodecId == MFX_CODEC_HEVC && q->param.mfx.IdrInterval != 1)) { + av_log(avctx, AV_LOG_WARNING, "Dual GFX mode requires closed GOP for AVC and strict GOP for HEVC, -idr_interval 0 \n"); + } + if (q->param.mfx.GopPicSize < 30) { + av_log(avctx, AV_LOG_WARNING, "For better performance in dual GFX mode GopPicSize must be >= 30 \n"); + } + if (q->param.AsyncDepth < 30) { + av_log(avctx, AV_LOG_WARNING, "For better performance in dual GFX mode AsyncDepth must be >= 30 \n"); + } + + q->exthypermodeparam.Header.BufferId = MFX_EXTBUFF_HYPER_MODE_PARAM; + q->exthypermodeparam.Header.BufferSz = sizeof(q->exthypermodeparam); + q->exthypermodeparam.Mode = q->dual_gfx; + q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->exthypermodeparam; + } else { + av_log(avctx, AV_LOG_ERROR, + "This version of runtime doesn't support Hyper Encode\n"); + return AVERROR_UNKNOWN; + } + } +#endif + if (!check_enc_param(avctx,q)) { av_log(avctx, AV_LOG_ERROR, "some encoding parameters are not supported by the QSV " @@ -1054,11 +1331,61 @@ return 0; } +static int qsv_retrieve_enc_av1_params(AVCodecContext *avctx, QSVEncContext *q) +{ +#if QSV_HAVE_EXT_AV1_PARAM + int ret = 0; + mfxExtAV1TileParam av1_extend_tile_buf = { + .Header.BufferId = MFX_EXTBUFF_AV1_TILE_PARAM, + .Header.BufferSz = sizeof(av1_extend_tile_buf), + }; + mfxExtAV1BitstreamParam av1_bs_param = { + .Header.BufferId = MFX_EXTBUFF_AV1_BITSTREAM_PARAM, + .Header.BufferSz = sizeof(av1_bs_param), + }; + + mfxExtCodingOption2 co2 = { + .Header.BufferId = MFX_EXTBUFF_CODING_OPTION2, + .Header.BufferSz = sizeof(co2), + }; + + mfxExtCodingOption3 co3 = { + .Header.BufferId = MFX_EXTBUFF_CODING_OPTION3, + .Header.BufferSz = sizeof(co3), + }; + + mfxExtBuffer *ext_buffers[] = { + (mfxExtBuffer*)&av1_extend_tile_buf, + (mfxExtBuffer*)&av1_bs_param, + (mfxExtBuffer*)&co2, + (mfxExtBuffer*)&co3, + }; + + if (!QSV_RUNTIME_VERSION_ATLEAST(q->ver, 2, 5)) { + av_log(avctx, AV_LOG_ERROR, + "This version of runtime doesn't support AV1 encoding\n"); + return AVERROR_UNKNOWN; + } + + q->param.ExtParam = ext_buffers; + q->param.NumExtParam = FF_ARRAY_ELEMS(ext_buffers); + + ret = MFXVideoENCODE_GetVideoParam(q->session, &q->param); + if (ret < 0) + return ff_qsv_print_error(avctx, ret, + "Error calling GetVideoParam"); + + q->packet_size = q->param.mfx.BufferSizeInKB * q->param.mfx.BRCParamMultiplier * 1000; + dump_video_av1_param(avctx, q, ext_buffers); +#endif + return 0; +} + static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q) { AVCPBProperties *cpb_props; - uint8_t sps_buf[128]; + uint8_t sps_buf[512]; uint8_t pps_buf[128]; mfxExtCodingOptionSPSPPS extradata = { @@ -1094,12 +1421,19 @@ .Header.BufferSz = sizeof(hevc_tile_buf), }; - mfxExtBuffer *ext_buffers[6]; +#if QSV_HAVE_HE + mfxExtHyperModeParam hyper_mode_param_buf = { + .Header.BufferId = MFX_EXTBUFF_HYPER_MODE_PARAM, + .Header.BufferSz = sizeof(hyper_mode_param_buf), + }; +#endif + + mfxExtBuffer *ext_buffers[6 + QSV_HAVE_HE]; int need_pps = avctx->codec_id != AV_CODEC_ID_MPEG2VIDEO; int ret, ext_buf_num = 0, extradata_offset = 0; - q->co2_idx = q->co3_idx = q->exthevctiles_idx = -1; + q->co2_idx = q->co3_idx = q->exthevctiles_idx = q->exthypermodeparam_idx = -1; ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&extradata; ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&co; @@ -1121,6 +1455,12 @@ q->exthevctiles_idx = ext_buf_num; ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&hevc_tile_buf; } +#if QSV_HAVE_HE + if (q->dual_gfx && QSV_RUNTIME_VERSION_ATLEAST(q->ver, 2, 4)) { + q->exthypermodeparam_idx = ext_buf_num; + ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&hyper_mode_param_buf; + } +#endif q->param.ExtParam = ext_buffers; q->param.NumExtParam = ext_buf_num; @@ -1172,6 +1512,7 @@ return 0; } +#if QSV_HAVE_OPAQUE static int qsv_init_opaque_alloc(AVCodecContext *avctx, QSVEncContext *q) { AVQSVContext *qsv = avctx->hwaccel_context; @@ -1208,6 +1549,7 @@ return 0; } +#endif static int qsvenc_init_session(AVCodecContext *avctx, QSVEncContext *q) { @@ -1223,7 +1565,11 @@ ret = ff_qsv_init_session_frames(avctx, &q->internal_qs.session, &q->frames_ctx, q->load_plugins, +#if QSV_HAVE_OPAQUE q->param.IOPattern == MFX_IOPATTERN_IN_OPAQUE_MEMORY, +#else + 0, +#endif MFX_GPUCOPY_OFF); if (ret < 0) { av_buffer_unref(&q->frames_ctx.hw_frames_ctx); @@ -1259,7 +1605,7 @@ q->param.AsyncDepth = q->async_depth; - q->async_fifo = av_fifo_alloc2(q->async_depth, sizeof(QSVPacket), 0); + q->async_fifo = av_fifo_alloc2(q->async_depth, sizeof(QSVPacket), AV_FIFO_FLAG_AUTO_GROW); if (!q->async_fifo) return AVERROR(ENOMEM); @@ -1275,11 +1621,17 @@ AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx; if (!iopattern) { +#if QSV_HAVE_OPAQUE if (frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME) iopattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY; else if (frames_hwctx->frame_type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) iopattern = MFX_IOPATTERN_IN_VIDEO_MEMORY; +#else + if (frames_hwctx->frame_type & + (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) + iopattern = MFX_IOPATTERN_IN_VIDEO_MEMORY; +#endif } } @@ -1353,9 +1705,16 @@ "Error querying (IOSurf) the encoding parameters"); if (opaque_alloc) { +#if QSV_HAVE_OPAQUE ret = qsv_init_opaque_alloc(avctx, q); if (ret < 0) return ret; +#else + av_log(avctx, AV_LOG_ERROR, "User is requesting to allocate OPAQUE surface, " + "however libmfx %d.%d doesn't support OPAQUE memory.\n", + q->ver.Major, q->ver.Minor); + return AVERROR_UNKNOWN; +#endif } ret = MFXVideoENCODE_Init(q->session, &q->param); @@ -1373,6 +1732,9 @@ case AV_CODEC_ID_VP9: ret = qsv_retrieve_enc_vp9_params(avctx, q); break; + case AV_CODEC_ID_AV1: + ret = qsv_retrieve_enc_av1_params(avctx, q); + break; default: ret = qsv_retrieve_enc_params(avctx, q); break; @@ -1387,25 +1749,16 @@ return 0; } -static void free_encoder_ctrl_payloads(mfxEncodeCtrl* enc_ctrl) +static void free_encoder_ctrl(mfxEncodeCtrl* enc_ctrl) { if (enc_ctrl) { - int i; - for (i = 0; i < enc_ctrl->NumPayload && i < QSV_MAX_ENC_PAYLOAD; i++) { + for (int i = 0; i < enc_ctrl->NumPayload && i < QSV_MAX_ENC_PAYLOAD; i++) av_freep(&enc_ctrl->Payload[i]); - } - enc_ctrl->NumPayload = 0; - } -} -static void free_encoder_ctrl_extparam(mfxEncodeCtrl* enc_ctrl) -{ - if (enc_ctrl) { - int i; - for (i = 0; i < enc_ctrl->NumExtParam && i < QSV_MAX_ENC_EXTPARAM; i++) { - if (enc_ctrl->ExtParam[i]) - av_freep(&(enc_ctrl->ExtParam[i])); - } + for (int i = 0; i < enc_ctrl->NumExtParam && i < QSV_MAX_ENC_EXTPARAM; i++) + av_freep(&enc_ctrl->ExtParam[i]); + + enc_ctrl->NumPayload = 0; enc_ctrl->NumExtParam = 0; } } @@ -1415,8 +1768,7 @@ QSVFrame *cur = q->work_frames; while (cur) { if (cur->used && !cur->surface.Data.Locked) { - free_encoder_ctrl_payloads(&cur->enc_ctrl); - free_encoder_ctrl_extparam(&cur->enc_ctrl); + free_encoder_ctrl(&cur->enc_ctrl); //do not reuse enc_ctrl from previous frame memset(&cur->enc_ctrl, 0, sizeof(cur->enc_ctrl)); cur->enc_ctrl.Payload = cur->payloads; @@ -1467,6 +1819,64 @@ return 0; } +static int qsvenc_fill_padding_area(AVFrame *frame, int new_w, int new_h) +{ + const AVPixFmtDescriptor *desc; + int max_step[4], filled[4] = { 0 }; + + desc = av_pix_fmt_desc_get(frame->format); + av_assert0(desc); + av_image_fill_max_pixsteps(max_step, NULL, desc); + + for (int i = 0; i < desc->nb_components; i++) { + const AVComponentDescriptor *comp = &desc->comp[i]; + int sheight, dheight, plane = comp->plane; + ptrdiff_t swidth = av_image_get_linesize(frame->format, + frame->width, + plane); + ptrdiff_t dwidth = av_image_get_linesize(frame->format, + new_w, + plane); + + if (swidth < 0 || dwidth < 0) { + av_log(NULL, AV_LOG_ERROR, "av_image_get_linesize failed\n"); + return AVERROR(EINVAL); + } + + if (filled[plane]) + continue; + + sheight = frame->height; + dheight = new_h; + + if (plane) { + sheight = AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h); + dheight = AV_CEIL_RSHIFT(new_h, desc->log2_chroma_h); + } + + // Fill right padding + if (new_w > frame->width) { + for (int j = 0; j < sheight; j++) { + void *line_ptr = frame->data[plane] + j * frame->linesize[plane] + swidth; + + av_memcpy_backptr(line_ptr, + max_step[plane], + new_w - frame->width); + } + } + + // Fill bottom padding + for (int j = sheight; j < dheight; j++) + memcpy(frame->data[plane] + j * frame->linesize[plane], + frame->data[plane] + (sheight - 1) * frame->linesize[plane], + dwidth); + + filled[plane] = 1; + } + + return 0; +} + static int submit_frame(QSVEncContext *q, const AVFrame *frame, QSVFrame **new_frame) { @@ -1496,8 +1906,9 @@ /* and to make allocation continious for data[0]/data[1] */ if ((frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) || (frame->data[1] - frame->data[0] != frame->linesize[0] * FFALIGN(qf->frame->height, q->height_align))) { - qf->frame->height = FFALIGN(frame->height, q->height_align); - qf->frame->width = FFALIGN(frame->width, q->width_align); + int tmp_w, tmp_h; + qf->frame->height = tmp_h = FFALIGN(frame->height, q->height_align); + qf->frame->width = tmp_w = FFALIGN(frame->width, q->width_align); qf->frame->format = frame->format; @@ -1515,6 +1926,12 @@ av_frame_unref(qf->frame); return ret; } + + ret = qsvenc_fill_padding_area(qf->frame, tmp_w, tmp_h); + if (ret < 0) { + av_frame_unref(qf->frame); + return ret; + } } else { av_frame_unref(qf->frame); ret = av_frame_ref(qf->frame, frame); @@ -1621,81 +2038,267 @@ return 0; } -static int update_qp(AVCodecContext *avctx, QSVEncContext *q, - const AVFrame *frame) +static void set_skip_frame_encode_ctrl(AVCodecContext *avctx, const AVFrame *frame, + mfxEncodeCtrl *enc_ctrl) +{ + AVDictionaryEntry* skip_frame_dict = NULL; + if (!frame->metadata) + return; + skip_frame_dict = av_dict_get(frame->metadata, "qsv_skip_frame", NULL, 0); + if (!skip_frame_dict) + return; + enc_ctrl->SkipFrame = strtol(skip_frame_dict->value, NULL, 10); + return; +} + +static int update_qp(AVCodecContext *avctx, QSVEncContext *q) { - int updated = 0, qp = 0, new_qp; - char *tail; - AVDictionaryEntry *entry = NULL; + int updated = 0, new_qp = 0; if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC) return 0; - entry = av_dict_get(frame->metadata, "qsv_config_qp", NULL, 0); - if (entry && q->param.mfx.RateControlMethod == MFX_RATECONTROL_CQP) { - qp = strtol(entry->value, &tail, 10); - if (*tail) { - av_log(avctx, AV_LOG_WARNING, "Invalid qsv_config_qp string. Ignore this metadata\n"); + if (q->param.mfx.RateControlMethod == MFX_RATECONTROL_CQP) { + UPDATE_PARAM(q->old_global_quality, avctx->global_quality); + UPDATE_PARAM(q->old_i_quant_factor, avctx->i_quant_factor); + UPDATE_PARAM(q->old_i_quant_offset, avctx->i_quant_offset); + UPDATE_PARAM(q->old_b_quant_factor, avctx->b_quant_factor); + UPDATE_PARAM(q->old_b_quant_offset, avctx->b_quant_offset); + if (!updated) return 0; - } - if (qp < 0 || qp > 51) { - av_log(avctx, AV_LOG_WARNING, "Invalid qp, clip to 0 ~ 51\n"); - qp = av_clip(qp, 0, 51); - } - av_log(avctx, AV_LOG_DEBUG, "Configure qp: %d\n",qp); - UPDATE_PARAM(q->param.mfx.QPP, qp); - new_qp = av_clip(qp * fabs(avctx->i_quant_factor) + - avctx->i_quant_offset, 0, 51); - UPDATE_PARAM(q->param.mfx.QPI, new_qp); - new_qp = av_clip(qp * fabs(avctx->b_quant_factor) + - avctx->b_quant_offset, 0, 51); - UPDATE_PARAM(q->param.mfx.QPB, new_qp); + + new_qp = avctx->global_quality / FF_QP2LAMBDA; + q->param.mfx.QPI = av_clip(new_qp * fabs(avctx->i_quant_factor) + + avctx->i_quant_offset, 0, 51); + q->param.mfx.QPP = av_clip(new_qp, 0, 51); + q->param.mfx.QPB = av_clip(new_qp * fabs(avctx->b_quant_factor) + + avctx->b_quant_offset, 0, 51); av_log(avctx, AV_LOG_DEBUG, - "using fixed qp = %d/%d/%d for idr/p/b frames\n", - q->param.mfx.QPI, q->param.mfx.QPP, q->param.mfx.QPB); + "Reset qp = %d/%d/%d for idr/p/b frames\n", + q->param.mfx.QPI, q->param.mfx.QPP, q->param.mfx.QPB); } return updated; } -static int update_parameters(AVCodecContext *avctx, QSVEncContext *q, - const AVFrame *frame) +static int update_max_frame_size(AVCodecContext *avctx, QSVEncContext *q) { - int needReset = 0, ret = 0; + int updated = 0; - if (!frame) + if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC) return 0; - needReset = update_qp(avctx, q, frame); - if (!needReset) + UPDATE_PARAM(q->old_max_frame_size, q->max_frame_size); + if (!updated) return 0; - if (avctx->hwaccel_context) { - AVQSVContext *qsv = avctx->hwaccel_context; - int i, j; - q->param.ExtParam = q->extparam; - for (i = 0; i < qsv->nb_ext_buffers; i++) - q->param.ExtParam[i] = qsv->ext_buffers[i]; - q->param.NumExtParam = qsv->nb_ext_buffers; + q->extco2.MaxFrameSize = FFMAX(0, q->max_frame_size); + av_log(avctx, AV_LOG_DEBUG, + "Reset MaxFrameSize: %d;\n", q->extco2.MaxFrameSize); - for (i = 0; i < q->nb_extparam_internal; i++) { - for (j = 0; j < qsv->nb_ext_buffers; j++) { - if (qsv->ext_buffers[j]->BufferId == q->extparam_internal[i]->BufferId) - break; - } - if (j < qsv->nb_ext_buffers) - continue; - q->param.ExtParam[q->param.NumExtParam++] = q->extparam_internal[i]; - } + return updated; +} + +static int update_gop_size(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + UPDATE_PARAM(q->old_gop_size, avctx->gop_size); + if (!updated) + return 0; + + q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size); + av_log(avctx, AV_LOG_DEBUG, "reset GopPicSize to %d\n", + q->param.mfx.GopPicSize); + + return updated; +} + +static int update_rir(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + + if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC) + return 0; + + UPDATE_PARAM(q->old_int_ref_type, q->int_ref_type); + UPDATE_PARAM(q->old_int_ref_cycle_size, q->int_ref_cycle_size); + UPDATE_PARAM(q->old_int_ref_qp_delta, q->int_ref_qp_delta); + UPDATE_PARAM(q->old_int_ref_cycle_dist, q->int_ref_cycle_dist); + if (!updated) + return 0; + + q->extco2.IntRefType = FFMAX(0, q->int_ref_type); + q->extco2.IntRefCycleSize = FFMAX(0, q->int_ref_cycle_size); + q->extco2.IntRefQPDelta = + q->int_ref_qp_delta != INT16_MIN ? q->int_ref_qp_delta : 0; + q->extco3.IntRefCycleDist = FFMAX(0, q->int_ref_cycle_dist); + av_log(avctx, AV_LOG_DEBUG, + "Reset IntRefType: %d; IntRefCycleSize: %d; " + "IntRefQPDelta: %d; IntRefCycleDist: %d\n", + q->extco2.IntRefType, q->extco2.IntRefCycleSize, + q->extco2.IntRefQPDelta, q->extco3.IntRefCycleDist); + + return updated; +} + +static int update_min_max_qp(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + + if (avctx->codec_id != AV_CODEC_ID_H264) + return 0; + + UPDATE_PARAM(q->old_qmin, avctx->qmin); + UPDATE_PARAM(q->old_qmax, avctx->qmax); + UPDATE_PARAM(q->old_min_qp_i, q->min_qp_i); + UPDATE_PARAM(q->old_max_qp_i, q->max_qp_i); + UPDATE_PARAM(q->old_min_qp_p, q->min_qp_p); + UPDATE_PARAM(q->old_max_qp_p, q->max_qp_p); + UPDATE_PARAM(q->old_min_qp_b, q->min_qp_b); + UPDATE_PARAM(q->old_max_qp_b, q->max_qp_b); + if (!updated) + return 0; + + if ((avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > avctx->qmax) || + (q->max_qp_i >= 0 && q->min_qp_i >= 0 && q->min_qp_i > q->max_qp_i) || + (q->max_qp_p >= 0 && q->min_qp_p >= 0 && q->min_qp_p > q->max_qp_p) || + (q->max_qp_b >= 0 && q->min_qp_b >= 0 && q->min_qp_b > q->max_qp_b)) { + av_log(avctx, AV_LOG_ERROR, + "qmin and or qmax are set but invalid," + " please make sure min <= max\n"); + return AVERROR(EINVAL); + } + + q->extco2.MinQPI = 0; + q->extco2.MaxQPI = 0; + q->extco2.MinQPP = 0; + q->extco2.MaxQPP = 0; + q->extco2.MinQPB = 0; + q->extco2.MaxQPB = 0; + if (avctx->qmin >= 0) { + q->extco2.MinQPI = avctx->qmin > 51 ? 51 : avctx->qmin; + q->extco2.MinQPB = q->extco2.MinQPP = q->extco2.MinQPI; + } + if (avctx->qmax >= 0) { + q->extco2.MaxQPI = avctx->qmax > 51 ? 51 : avctx->qmax; + q->extco2.MaxQPB = q->extco2.MaxQPP = q->extco2.MaxQPI; + } + if (q->min_qp_i >= 0) + q->extco2.MinQPI = q->min_qp_i > 51 ? 51 : q->min_qp_i; + if (q->max_qp_i >= 0) + q->extco2.MaxQPI = q->max_qp_i > 51 ? 51 : q->max_qp_i; + if (q->min_qp_p >= 0) + q->extco2.MinQPP = q->min_qp_p > 51 ? 51 : q->min_qp_p; + if (q->max_qp_p >= 0) + q->extco2.MaxQPP = q->max_qp_p > 51 ? 51 : q->max_qp_p; + if (q->min_qp_b >= 0) + q->extco2.MinQPB = q->min_qp_b > 51 ? 51 : q->min_qp_b; + if (q->max_qp_b >= 0) + q->extco2.MaxQPB = q->max_qp_b > 51 ? 51 : q->max_qp_b; + + av_log(avctx, AV_LOG_VERBOSE, "Reset MinQPI: %d; MaxQPI: %d; " + "MinQPP: %d; MaxQPP: %d; " + "MinQPB: %d; MaxQPB: %d\n", + q->extco2.MinQPI, q->extco2.MaxQPI, + q->extco2.MinQPP, q->extco2.MaxQPP, + q->extco2.MinQPB, q->extco2.MaxQPB); + + return updated; +} + +static int update_low_delay_brc(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + + if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC) + return 0; + + UPDATE_PARAM(q->old_low_delay_brc, q->low_delay_brc); + if (!updated) + return 0; + + q->extco3.LowDelayBRC = MFX_CODINGOPTION_UNKNOWN; + if (q->low_delay_brc >= 0) + q->extco3.LowDelayBRC = q->low_delay_brc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; + av_log(avctx, AV_LOG_DEBUG, "Reset LowDelayBRC: %s\n", + print_threestate(q->extco3.LowDelayBRC)); + + return updated; +} + +static int update_frame_rate(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + + UPDATE_PARAM(q->old_framerate.num, avctx->framerate.num); + UPDATE_PARAM(q->old_framerate.den, avctx->framerate.den); + if (!updated) + return 0; + + if (avctx->framerate.den > 0 && avctx->framerate.num > 0) { + q->param.mfx.FrameInfo.FrameRateExtN = avctx->framerate.num; + q->param.mfx.FrameInfo.FrameRateExtD = avctx->framerate.den; } else { - q->param.ExtParam = q->extparam_internal; - q->param.NumExtParam = q->nb_extparam_internal; + q->param.mfx.FrameInfo.FrameRateExtN = avctx->time_base.den; + q->param.mfx.FrameInfo.FrameRateExtD = avctx->time_base.num; } - av_log(avctx, AV_LOG_DEBUG, "Parameter change, call msdk reset.\n"); - ret = MFXVideoENCODE_Reset(q->session, &q->param); - if (ret < 0) - return ff_qsv_print_error(avctx, ret, "Error during resetting"); + av_log(avctx, AV_LOG_DEBUG, "Reset framerate: %d/%d (%.2f fps).\n", + q->param.mfx.FrameInfo.FrameRateExtN, + q->param.mfx.FrameInfo.FrameRateExtD, + (double)q->param.mfx.FrameInfo.FrameRateExtN / q->param.mfx.FrameInfo.FrameRateExtD); - return 0; + return updated; +} + +static int update_bitrate(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + int target_bitrate_kbps, max_bitrate_kbps, brc_param_multiplier; + int buffer_size_in_kilobytes, initial_delay_in_kilobytes; + + UPDATE_PARAM(q->old_rc_buffer_size, avctx->rc_buffer_size); + UPDATE_PARAM(q->old_rc_initial_buffer_occupancy, avctx->rc_initial_buffer_occupancy); + UPDATE_PARAM(q->old_bit_rate, avctx->bit_rate); + UPDATE_PARAM(q->old_rc_max_rate, avctx->rc_max_rate); + if (!updated) + return 0; + + buffer_size_in_kilobytes = avctx->rc_buffer_size / 8000; + initial_delay_in_kilobytes = avctx->rc_initial_buffer_occupancy / 8000; + target_bitrate_kbps = avctx->bit_rate / 1000; + max_bitrate_kbps = avctx->rc_max_rate / 1000; + brc_param_multiplier = (FFMAX(FFMAX3(target_bitrate_kbps, max_bitrate_kbps, buffer_size_in_kilobytes), + initial_delay_in_kilobytes) + 0x10000) / 0x10000; + + q->param.mfx.BufferSizeInKB = buffer_size_in_kilobytes / brc_param_multiplier; + q->param.mfx.InitialDelayInKB = initial_delay_in_kilobytes / brc_param_multiplier; + q->param.mfx.TargetKbps = target_bitrate_kbps / brc_param_multiplier; + q->param.mfx.MaxKbps = max_bitrate_kbps / brc_param_multiplier; + q->param.mfx.BRCParamMultiplier = brc_param_multiplier; + av_log(avctx, AV_LOG_VERBOSE, + "Reset BufferSizeInKB: %d; InitialDelayInKB: %d; " + "TargetKbps: %d; MaxKbps: %d; BRCParamMultiplier: %d\n", + q->param.mfx.BufferSizeInKB, q->param.mfx.InitialDelayInKB, + q->param.mfx.TargetKbps, q->param.mfx.MaxKbps, q->param.mfx.BRCParamMultiplier); + return updated; +} + +static int update_pic_timing_sei(AVCodecContext *avctx, QSVEncContext *q) +{ + int updated = 0; + + if (avctx->codec_id != AV_CODEC_ID_H264 && avctx->codec_id != AV_CODEC_ID_HEVC) + return 0; + + UPDATE_PARAM(q->old_pic_timing_sei, q->pic_timing_sei); + if (!updated) + return 0; + + q->extco.PicTimingSEI = q->pic_timing_sei ? + MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN; + av_log(avctx, AV_LOG_DEBUG, "Reset PicTimingSEI: %s\n", + print_threestate(q->extco.PicTimingSEI)); + + return updated; } static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, @@ -1756,8 +2359,8 @@ pkt.bs->ExtParam = enc_buf; } - if (q->set_encode_ctrl_cb) { - q->set_encode_ctrl_cb(avctx, frame, &qsv_frame->enc_ctrl); + if (q->set_encode_ctrl_cb && enc_ctrl) { + q->set_encode_ctrl_cb(avctx, frame, enc_ctrl); } if ((avctx->codec_id == AV_CODEC_ID_H264 || @@ -1767,6 +2370,11 @@ if (ret < 0) goto free; } + if ((avctx->codec_id == AV_CODEC_ID_H264 || + avctx->codec_id == AV_CODEC_ID_H265) && + q->skip_frame != MFX_SKIPFRAME_NO_SKIP && + enc_ctrl && QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 13)) + set_skip_frame_encode_ctrl(avctx, frame, enc_ctrl); pkt.sync = av_mallocz(sizeof(*pkt.sync)); if (!pkt.sync) @@ -1783,7 +2391,7 @@ if (ret < 0) { ret = (ret == MFX_ERR_MORE_DATA) ? - 0 : ff_qsv_print_error(avctx, ret, "Error during encoding"); + AVERROR(EAGAIN) : ff_qsv_print_error(avctx, ret, "Error during encoding"); goto free; } @@ -1793,7 +2401,9 @@ ret = 0; if (*pkt.sync) { - av_fifo_write(q->async_fifo, &pkt, 1); + ret = av_fifo_write(q->async_fifo, &pkt, 1); + if (ret < 0) + goto free; } else { free: av_freep(&pkt.sync); @@ -1811,6 +2421,66 @@ goto free; } +static int update_parameters(AVCodecContext *avctx, QSVEncContext *q, + const AVFrame *frame) +{ + int needReset = 0, ret = 0; + + if (!frame || avctx->codec_id == AV_CODEC_ID_MJPEG) + return 0; + + needReset = update_qp(avctx, q); + needReset |= update_max_frame_size(avctx, q); + needReset |= update_gop_size(avctx, q); + needReset |= update_rir(avctx, q); + needReset |= update_low_delay_brc(avctx, q); + needReset |= update_frame_rate(avctx, q); + needReset |= update_bitrate(avctx, q); + needReset |= update_pic_timing_sei(avctx, q); + ret = update_min_max_qp(avctx, q); + if (ret < 0) + return ret; + needReset |= ret; + if (!needReset) + return 0; + + if (avctx->hwaccel_context) { + AVQSVContext *qsv = avctx->hwaccel_context; + int i, j; + q->param.ExtParam = q->extparam; + for (i = 0; i < qsv->nb_ext_buffers; i++) + q->param.ExtParam[i] = qsv->ext_buffers[i]; + q->param.NumExtParam = qsv->nb_ext_buffers; + + for (i = 0; i < q->nb_extparam_internal; i++) { + for (j = 0; j < qsv->nb_ext_buffers; j++) { + if (qsv->ext_buffers[j]->BufferId == q->extparam_internal[i]->BufferId) + break; + } + if (j < qsv->nb_ext_buffers) + continue; + q->param.ExtParam[q->param.NumExtParam++] = q->extparam_internal[i]; + } + } else { + q->param.ExtParam = q->extparam_internal; + q->param.NumExtParam = q->nb_extparam_internal; + } + + // Flush codec before reset configuration. + while (ret != AVERROR(EAGAIN)) { + ret = encode_frame(avctx, q, NULL); + if (ret < 0 && ret != AVERROR(EAGAIN)) + return ret; + } + + av_log(avctx, AV_LOG_DEBUG, "Parameter change, call msdk reset.\n"); + ret = MFXVideoENCODE_Reset(q->session, &q->param); + if (ret < 0) + return ff_qsv_print_error(avctx, ret, "Error during resetting"); + + return 0; +} + int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, AVPacket *pkt, const AVFrame *frame, int *got_packet) { @@ -1821,7 +2491,7 @@ return ret; ret = encode_frame(avctx, q, frame); - if (ret < 0) + if (ret < 0 && ret != AVERROR(EAGAIN)) return ret; if ((av_fifo_can_read(q->async_fifo) >= q->async_depth) || @@ -1894,8 +2564,7 @@ while (cur) { q->work_frames = cur->next; av_frame_free(&cur->frame); - free_encoder_ctrl_extparam(&cur->enc_ctrl); - free_encoder_ctrl_payloads(&cur->enc_ctrl); + free_encoder_ctrl(&cur->enc_ctrl); av_freep(&cur); cur = q->work_frames; } @@ -1916,8 +2585,10 @@ av_fifo_freep2(&q->async_fifo); } +#if QSV_HAVE_OPAQUE av_freep(&q->opaque_surfaces); av_buffer_unref(&q->opaque_alloc_buf); +#endif av_freep(&q->extparam); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,11 @@ #include #include -#include +#include +#include "libavutil/common.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_qsv.h" #include "libavutil/avutil.h" #include "libavutil/fifo.h" @@ -36,22 +39,23 @@ #include "qsv_internal.h" #define QSV_HAVE_EXT_VP9_TILES QSV_VERSION_ATLEAST(1, 29) +#define QSV_HAVE_EXT_AV1_PARAM QSV_VERSION_ATLEAST(2, 5) #if defined(_WIN32) || defined(__CYGWIN__) #define QSV_HAVE_AVBR 1 #define QSV_HAVE_VCM 1 #define QSV_HAVE_MF 0 +#define QSV_HAVE_HE QSV_VERSION_ATLEAST(2, 4) #else #define QSV_HAVE_AVBR 0 #define QSV_HAVE_VCM 0 -#define QSV_HAVE_MF 1 +#define QSV_HAVE_MF !QSV_ONEVPL +#define QSV_HAVE_HE 0 #endif #define QSV_COMMON_OPTS \ { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE }, \ -{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol (unit of tenth of percent)", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, UINT16_MAX, VE }, \ -{ "avbr_convergence", "Convergence of the AVBR ratecontrol (unit of 100 frames)", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, UINT16_MAX, VE }, \ -{ "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_BALANCED }, MFX_TARGETUSAGE_BEST_QUALITY, MFX_TARGETUSAGE_BEST_SPEED, VE, "preset" }, \ +{ "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_UNKNOWN }, MFX_TARGETUSAGE_UNKNOWN, MFX_TARGETUSAGE_BEST_SPEED, VE, "preset" }, \ { "veryfast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, "preset" }, \ { "faster", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_6 }, INT_MIN, INT_MAX, VE, "preset" }, \ { "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_5 }, INT_MIN, INT_MAX, VE, "preset" }, \ @@ -62,6 +66,14 @@ { "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \ { "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, VE}, +#if QSV_HAVE_HE +#define QSV_HE_OPTIONS \ +{ "dual_gfx", "Prefer processing on both iGfx and dGfx simultaneously", OFFSET(qsv.dual_gfx), AV_OPT_TYPE_INT, { .i64 = MFX_HYPERMODE_OFF }, MFX_HYPERMODE_OFF, MFX_HYPERMODE_ADAPTIVE, VE, "dual_gfx" }, \ +{ "off", "Disable HyperEncode mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_OFF }, INT_MIN, INT_MAX, VE, "dual_gfx" }, \ +{ "on", "Enable HyperEncode mode and return error if incompatible parameters during initialization", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_ON }, INT_MIN, INT_MAX, VE, "dual_gfx" }, \ +{ "adaptive", "Enable HyperEncode mode or fallback to single GPU if incompatible parameters during initialization", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_ADAPTIVE }, INT_MIN, INT_MAX, VE, "dual_gfx" }, +#endif + #define QSV_OPTION_RDO \ { "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, @@ -108,6 +120,35 @@ { "max_qp_b", "Maximum video quantizer scale for B frame", OFFSET(qsv.max_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ { "min_qp_b", "Minimum video quantizer scale for B frame", OFFSET(qsv.min_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, +#define QSV_OPTION_SCENARIO \ +{ "scenario", "A hint to encoder about the scenario for the encoding session", OFFSET(qsv.scenario), AV_OPT_TYPE_INT, { .i64 = MFX_SCENARIO_UNKNOWN }, \ + MFX_SCENARIO_UNKNOWN, MFX_SCENARIO_REMOTE_GAMING, VE, "scenario" }, \ +{ "unknown", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_UNKNOWN }, .flags = VE, "scenario" }, \ +{ "displayremoting", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_DISPLAY_REMOTING }, .flags = VE, "scenario" }, \ +{ "videoconference", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_VIDEO_CONFERENCE }, .flags = VE, "scenario" }, \ +{ "archive", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_ARCHIVE }, .flags = VE, "scenario" }, \ +{ "livestreaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_LIVE_STREAMING }, .flags = VE, "scenario" }, \ +{ "cameracapture", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_CAMERA_CAPTURE }, .flags = VE, "scenario" }, \ +{ "videosurveillance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_VIDEO_SURVEILLANCE }, .flags = VE, "scenario" }, \ +{ "gamestreaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_GAME_STREAMING }, .flags = VE, "scenario" }, \ +{ "remotegaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_REMOTE_GAMING }, .flags = VE, "scenario" }, + +#define QSV_OPTION_AVBR \ +{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol (unit of tenth of percent)", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, \ +{ "avbr_convergence", "Convergence of the AVBR ratecontrol (unit of 100 frames)", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, + +#define QSV_OPTION_SKIP_FRAME \ +{ "skip_frame", "Allow frame skipping", OFFSET(qsv.skip_frame), AV_OPT_TYPE_INT, { .i64 = MFX_SKIPFRAME_NO_SKIP }, \ + MFX_SKIPFRAME_NO_SKIP, MFX_SKIPFRAME_BRC_ONLY, VE, "skip_frame" }, \ +{ "no_skip", "Frame skipping is disabled", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_NO_SKIP }, .flags = VE, "skip_frame" }, \ +{ "insert_dummy", "Encoder inserts into bitstream frame where all macroblocks are encoded as skipped", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_INSERT_DUMMY }, .flags = VE, "skip_frame" }, \ +{ "insert_nothing", "Encoder inserts nothing into bitstream", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_INSERT_NOTHING }, .flags = VE, "skip_frame" }, \ +{ "brc_only", "skip_frame metadata indicates the number of missed frames before the current frame", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_BRC_ONLY }, .flags = VE, "skip_frame" }, + extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[]; typedef int SetEncodeCtrlCB (AVCodecContext *avctx, @@ -136,14 +177,22 @@ #endif mfxExtHEVCTiles exthevctiles; mfxExtVP9Param extvp9param; - +#if QSV_HAVE_EXT_AV1_PARAM + mfxExtAV1TileParam extav1tileparam; + mfxExtAV1BitstreamParam extav1bsparam; +#endif +#if QSV_HAVE_HE + mfxExtHyperModeParam exthypermodeparam; +#endif +#if QSV_HAVE_OPAQUE mfxExtOpaqueSurfaceAlloc opaque_alloc; mfxFrameSurface1 **opaque_surfaces; AVBufferRef *opaque_alloc_buf; +#endif mfxExtVideoSignalInfo extvsi; - mfxExtBuffer *extparam_internal[5 + (QSV_HAVE_MF * 2)]; + mfxExtBuffer *extparam_internal[5 + (QSV_HAVE_MF * 2) + (QSV_HAVE_EXT_AV1_PARAM * 2) + QSV_HAVE_HE]; int nb_extparam_internal; mfxExtBuffer **extparam; @@ -160,6 +209,7 @@ int async_depth; int idr_interval; int profile; + int tier; int preset; int avbr_accuracy; int avbr_convergence; @@ -174,6 +224,7 @@ int max_frame_size_p; int max_slice_size; int dblk_idc; + int scenario; int tile_cols; int tile_rows; @@ -216,6 +267,7 @@ int co2_idx; int co3_idx; int exthevctiles_idx; + int exthypermodeparam_idx; int vp9_idx; int max_qp_i; @@ -224,6 +276,44 @@ int min_qp_p; int max_qp_b; int min_qp_b; + // These are used for qp reset + int old_global_quality; + float old_i_quant_factor; + float old_i_quant_offset; + float old_b_quant_factor; + float old_b_quant_offset; + // This is used for max_frame_size reset + int old_max_frame_size; + // This is used for gop reset + int old_gop_size; + // These are used for intra refresh reset + int old_int_ref_type; + int old_int_ref_cycle_size; + int old_int_ref_qp_delta; + int old_int_ref_cycle_dist; + // These are used for max/min qp reset; + int old_qmax; + int old_qmin; + int old_max_qp_i; + int old_min_qp_i; + int old_max_qp_p; + int old_min_qp_p; + int old_max_qp_b; + int old_min_qp_b; + // This is used for low_delay_brc reset + int old_low_delay_brc; + // This is used for framerate reset + AVRational old_framerate; + // These are used for bitrate control reset + int old_bit_rate; + int old_rc_buffer_size; + int old_rc_initial_buffer_occupancy; + int old_rc_max_rate; + // This is used for SEI Timing reset + int old_pic_timing_sei; + int skip_frame; + // This is used for Hyper Encode + int dual_gfx; } QSVEncContext; int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_h264.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_h264.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_h264.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_h264.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" @@ -32,7 +32,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "qsv.h" -#include "qsv_internal.h" #include "qsvenc.h" #include "atsc_a53.h" @@ -115,6 +114,12 @@ QSV_OPTION_DBLK_IDC QSV_OPTION_LOW_DELAY_BRC QSV_OPTION_MAX_MIN_QP + QSV_OPTION_SCENARIO + QSV_OPTION_AVBR + QSV_OPTION_SKIP_FRAME +#if QSV_HAVE_HE + QSV_HE_OPTIONS +#endif { "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, #if QSV_HAVE_VCM @@ -139,6 +144,7 @@ { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .flags = VE, "int_ref_type" }, { "vertical", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .flags = VE, "int_ref_type" }, { "horizontal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, .flags = VE, "int_ref_type" }, + { "slice" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, .flags = VE, "int_ref_type" }, { "int_ref_cycle_size", "Number of frames in the intra refresh cycle", OFFSET(qsv.int_ref_cycle_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, { "int_ref_qp_delta", "QP difference for the refresh MBs", OFFSET(qsv.int_ref_qp_delta), AV_OPT_TYPE_INT, { .i64 = INT16_MIN }, INT16_MIN, INT16_MAX, VE }, { "recovery_point_sei", "Insert recovery point SEI messages", OFFSET(qsv.recovery_point_sei), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, @@ -174,9 +180,8 @@ static const FFCodecDefault qsv_enc_defaults[] = { { "b", "1M" }, { "refs", "0" }, - // same as the x264 default - { "g", "250" }, - { "bf", "3" }, + { "g", "-1" }, + { "bf", "-1" }, { "qmin", "-1" }, { "qmax", "-1" }, { "trellis", "-1" }, @@ -186,7 +191,7 @@ const FFCodec ff_h264_qsv_encoder = { .p.name = "h264_qsv", - .p.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"), + CODEC_LONG_NAME("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVH264EncContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, @@ -195,12 +200,12 @@ .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, - AV_PIX_FMT_P010, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, .p.priv_class = &class, .defaults = qsv_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,10 +22,11 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" +#include "libavutil/mastering_display_metadata.h" #include "avcodec.h" #include "bytestream.h" @@ -35,7 +36,6 @@ #include "hevcdec.h" #include "h2645_parse.h" #include "qsv.h" -#include "qsv_internal.h" #include "qsvenc.h" enum LoadPlugin { @@ -161,6 +161,83 @@ return 0; } +static int qsv_hevc_set_encode_ctrl(AVCodecContext *avctx, + const AVFrame *frame, mfxEncodeCtrl *enc_ctrl) +{ + QSVHEVCEncContext *q = avctx->priv_data; + AVFrameSideData *sd; + + if (!frame || !QSV_RUNTIME_VERSION_ATLEAST(q->qsv.ver, 1, 25)) + return 0; + + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA); + if (sd) { + AVMasteringDisplayMetadata *mdm = (AVMasteringDisplayMetadata *)sd->data; + + // SEI is needed when both the primaries and luminance are set + if (mdm->has_primaries && mdm->has_luminance) { + const int mapping[3] = {1, 2, 0}; + const int chroma_den = 50000; + const int luma_den = 10000; + int i; + mfxExtMasteringDisplayColourVolume *mdcv = av_mallocz(sizeof(mfxExtMasteringDisplayColourVolume)); + + if (!mdcv) + return AVERROR(ENOMEM); + + mdcv->Header.BufferId = MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME; + mdcv->Header.BufferSz = sizeof(*mdcv); + + for (i = 0; i < 3; i++) { + const int j = mapping[i]; + + mdcv->DisplayPrimariesX[i] = + FFMIN(lrint(chroma_den * + av_q2d(mdm->display_primaries[j][0])), + chroma_den); + mdcv->DisplayPrimariesY[i] = + FFMIN(lrint(chroma_den * + av_q2d(mdm->display_primaries[j][1])), + chroma_den); + } + + mdcv->WhitePointX = + FFMIN(lrint(chroma_den * av_q2d(mdm->white_point[0])), + chroma_den); + mdcv->WhitePointY = + FFMIN(lrint(chroma_den * av_q2d(mdm->white_point[1])), + chroma_den); + + mdcv->MaxDisplayMasteringLuminance = + lrint(luma_den * av_q2d(mdm->max_luminance)); + mdcv->MinDisplayMasteringLuminance = + FFMIN(lrint(luma_den * av_q2d(mdm->min_luminance)), + mdcv->MaxDisplayMasteringLuminance); + + enc_ctrl->ExtParam[enc_ctrl->NumExtParam++] = (mfxExtBuffer *)mdcv; + } + } + + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_CONTENT_LIGHT_LEVEL); + if (sd) { + AVContentLightMetadata *clm = (AVContentLightMetadata *)sd->data; + mfxExtContentLightLevelInfo * clli = av_mallocz(sizeof(mfxExtContentLightLevelInfo)); + + if (!clli) + return AVERROR(ENOMEM); + + clli->Header.BufferId = MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO; + clli->Header.BufferSz = sizeof(*clli); + + clli->MaxContentLightLevel = FFMIN(clm->MaxCLL, 65535); + clli->MaxPicAverageLightLevel = FFMIN(clm->MaxFALL, 65535); + + enc_ctrl->ExtParam[enc_ctrl->NumExtParam++] = (mfxExtBuffer *)clli; + } + + return 0; +} + static av_cold int qsv_enc_init(AVCodecContext *avctx) { QSVHEVCEncContext *q = avctx->priv_data; @@ -190,6 +267,8 @@ // HEVC and H264 meaning of the value is shifted by 1, make it consistent q->qsv.idr_interval++; + q->qsv.set_encode_ctrl_cb = qsv_hevc_set_encode_ctrl; + ret = ff_qsv_enc_init(avctx, &q->qsv); if (ret < 0) return ret; @@ -234,6 +313,14 @@ QSV_OPTION_DBLK_IDC QSV_OPTION_LOW_DELAY_BRC QSV_OPTION_MAX_MIN_QP + QSV_OPTION_ADAPTIVE_I + QSV_OPTION_ADAPTIVE_B + QSV_OPTION_SCENARIO + QSV_OPTION_AVBR + QSV_OPTION_SKIP_FRAME +#if QSV_HAVE_HE + QSV_HE_OPTIONS +#endif { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT_MAX, VE, "idr_interval" }, { "begin_only", "Output an IDR-frame only at the beginning of the stream", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "idr_interval" }, @@ -255,6 +342,9 @@ #if QSV_VERSION_ATLEAST(1, 32) { "scc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_SCC }, INT_MIN, INT_MAX, VE, "profile" }, #endif + { "tier", "Set the encoding tier (only level >= 4 can support high tier)", OFFSET(qsv.tier), AV_OPT_TYPE_INT, { .i64 = MFX_TIER_HEVC_HIGH }, MFX_TIER_HEVC_MAIN, MFX_TIER_HEVC_HIGH, VE, "tier" }, + { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TIER_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "tier" }, + { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TIER_HEVC_HIGH }, INT_MIN, INT_MAX, VE, "tier" }, { "gpb", "1: GPB (generalized P/B frame); 0: regular P frame", OFFSET(qsv.gpb), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE}, @@ -268,6 +358,7 @@ { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .flags = VE, "int_ref_type" }, { "vertical", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .flags = VE, "int_ref_type" }, { "horizontal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, .flags = VE, "int_ref_type" }, + { "slice" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, .flags = VE, "int_ref_type" }, { "int_ref_cycle_size", "Number of frames in the intra refresh cycle", OFFSET(qsv.int_ref_cycle_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, { "int_ref_qp_delta", "QP difference for the refresh MBs", OFFSET(qsv.int_ref_qp_delta), AV_OPT_TYPE_INT, { .i64 = INT16_MIN }, INT16_MIN, INT16_MAX, VE }, { "int_ref_cycle_dist", "Distance between the beginnings of the intra-refresh cycles in frames", OFFSET(qsv.int_ref_cycle_dist), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT16_MAX, VE }, @@ -285,19 +376,17 @@ static const FFCodecDefault qsv_enc_defaults[] = { { "b", "1M" }, { "refs", "0" }, - // same as the x264 default - { "g", "248" }, + { "g", "-1" }, { "bf", "-1" }, { "qmin", "-1" }, { "qmax", "-1" }, { "trellis", "-1" }, - { "flags", "+cgop" }, { NULL }, }; const FFCodec ff_hevc_qsv_encoder = { .p.name = "hevc_qsv", - .p.long_name = NULL_IF_CONFIG_SMALL("HEVC (Intel Quick Sync Video acceleration)"), + CODEC_LONG_NAME("HEVC (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVHEVCEncContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, @@ -307,15 +396,19 @@ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, + AV_PIX_FMT_P012, AV_PIX_FMT_YUYV422, AV_PIX_FMT_Y210, AV_PIX_FMT_QSV, AV_PIX_FMT_BGRA, AV_PIX_FMT_X2RGB10, + AV_PIX_FMT_VUYX, + AV_PIX_FMT_XV30, AV_PIX_FMT_NONE }, .p.priv_class = &class, .defaults = qsv_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_jpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_jpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_jpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_jpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" @@ -30,7 +30,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "qsv.h" -#include "qsv_internal.h" #include "qsvenc.h" typedef struct QSVMJPEGEncContext { @@ -81,7 +80,7 @@ const FFCodec ff_mjpeg_qsv_encoder = { .p.name = "mjpeg_qsv", - .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Intel Quick Sync Video acceleration)"), + CODEC_LONG_NAME("MJPEG (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVMJPEGEncContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEG, @@ -90,10 +89,13 @@ .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + AV_PIX_FMT_YUYV422, + AV_PIX_FMT_BGRA, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, .p.priv_class = &class, .defaults = qsv_enc_defaults, .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_mpeg2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_mpeg2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_mpeg2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_mpeg2.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" @@ -30,7 +30,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "qsv.h" -#include "qsv_internal.h" #include "qsvenc.h" typedef struct QSVMpeg2EncContext { @@ -95,7 +94,7 @@ const FFCodec ff_mpeg2_qsv_encoder = { .p.name = "mpeg2_qsv", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick Sync Video acceleration)"), + CODEC_LONG_NAME("MPEG-2 video (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVMpeg2EncContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, @@ -108,7 +107,8 @@ AV_PIX_FMT_NONE }, .p.priv_class = &class, .defaults = qsv_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_vp9.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_vp9.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_vp9.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsvenc_vp9.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include #include -#include +#include #include "libavutil/common.h" #include "libavutil/opt.h" @@ -30,7 +30,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "qsv.h" -#include "qsv_internal.h" #include "qsvenc.h" typedef struct QSVVP9EncContext { @@ -104,7 +103,7 @@ const FFCodec ff_vp9_qsv_encoder = { .p.name = "vp9_qsv", - .p.long_name = NULL_IF_CONFIG_SMALL("VP9 video (Intel Quick Sync Video acceleration)"), + CODEC_LONG_NAME("VP9 video (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVVP9EncContext), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, @@ -114,11 +113,14 @@ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, + AV_PIX_FMT_VUYX, AV_PIX_FMT_QSV, + AV_PIX_FMT_XV30, AV_PIX_FMT_NONE }, .p.priv_class = &class, .defaults = qsv_enc_defaults, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #ifndef AVCODEC_QSV_H #define AVCODEC_QSV_H -#include +#include #include "libavutil/buffer.h" @@ -61,6 +61,8 @@ * required by the encoder and the user-provided value nb_opaque_surfaces. * The array of the opaque surfaces will be exported to the caller through * the opaque_surfaces field. + * + * The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0) */ int opaque_alloc; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qsv_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -39,7 +39,7 @@ #include "libavutil/hwcontext_vaapi.h" #endif -#include +#include #include "libavutil/frame.h" @@ -51,7 +51,7 @@ #define ASYNC_DEPTH_DEFAULT 4 // internal parallelism #define QSV_MAX_ENC_PAYLOAD 2 // # of mfxEncodeCtrl payloads supported -#define QSV_MAX_ENC_EXTPARAM 2 +#define QSV_MAX_ENC_EXTPARAM 8 // # of mfxEncodeCtrl extparam supported #define QSV_MAX_ROI_NUM 256 @@ -65,6 +65,9 @@ ((MFX_VERSION.Major > (MAJOR)) || \ (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR))) +#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) +#define QSV_HAVE_OPAQUE !QSV_ONEVPL + typedef struct QSVMid { AVBufferRef *hw_frames_ref; mfxHDLPair *handle_pair; @@ -82,6 +85,12 @@ #if QSV_VERSION_ATLEAST(1, 34) mfxExtAV1FilmGrainParam av1_film_grain_param; #endif + +#if QSV_VERSION_ATLEAST(1, 35) + mfxExtMasteringDisplayColourVolume mdcv; + mfxExtContentLightLevelInfo clli; +#endif + mfxExtBuffer *ext_param[QSV_MAX_FRAME_EXT_PARAMS]; int num_ext_params; @@ -100,6 +109,7 @@ AVBufferRef *va_device_ref; AVHWDeviceContext *va_device_ctx; #endif + void *loader; } QSVSession; typedef struct QSVFramesContext { @@ -128,7 +138,7 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc); -int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc); +int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift); enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type); enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrle.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrle.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrle.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrle.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,15 +31,12 @@ * data. 24-bit data is RGB24 and 32-bit data is RGB32. */ -#include -#include #include #include "avcodec.h" #include "decode.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" typedef struct QtrleContext { AVCodecContext *avctx; @@ -583,7 +580,7 @@ const FFCodec ff_qtrle_decoder = { .p.name = "qtrle", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), + CODEC_LONG_NAME("QuickTime Animation (RLE) video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QTRLE, .priv_data_size = sizeof(QtrleContext), @@ -592,5 +589,4 @@ FF_CODEC_DECODE_CB(qtrle_decode_frame), .flush = qtrle_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrleenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrleenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrleenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/qtrleenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -374,7 +374,7 @@ return ret; if (avctx->gop_size == 0 || !s->previous_frame->data[0] || - (s->avctx->frame_number % avctx->gop_size) == 0) { + (s->avctx->frame_num % avctx->gop_size) == 0) { /* I-Frame */ s->key_frame = 1; } else { @@ -401,9 +401,10 @@ const FFCodec ff_qtrle_encoder = { .p.name = "qtrle", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), + CODEC_LONG_NAME("QuickTime Animation (RLE) video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QTRLE, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(QtrleEncContext), .init = qtrle_encode_init, FF_CODEC_ENCODE_CB(qtrle_encode_frame), @@ -411,5 +412,5 @@ .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "config_components.h" -#include "internal.h" +#include "decode.h" #include "libavutil/bswap.h" #include "libavutil/common.h" @@ -105,36 +105,33 @@ #if CONFIG_R210_DECODER const FFCodec ff_r210_decoder = { .p.name = "r210", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), + CODEC_LONG_NAME("Uncompressed RGB 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R210, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_R10K_DECODER const FFCodec ff_r10k_decoder = { .p.name = "r10k", - .p.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), + CODEC_LONG_NAME("AJA Kona 10-bit RGB Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R10K, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_AVRP_DECODER const FFCodec ff_avrp_decoder = { .p.name = "avrp", - .p.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), + CODEC_LONG_NAME("Avid 1:1 10-bit RGB Packer"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVRP, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/r210enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,7 +47,7 @@ int aligned_width = FFALIGN(avctx->width, avctx->codec_id == AV_CODEC_ID_R10K ? 1 : 64); int pad = (aligned_width - avctx->width) * 4; - uint8_t *srcr_line, *srcg_line, *srcb_line; + const uint8_t *srcr_line, *srcg_line, *srcb_line; uint8_t *dst; ret = ff_get_encode_buffer(avctx, pkt, 4 * aligned_width * avctx->height, 0); @@ -60,9 +60,9 @@ dst = pkt->data; for (i = 0; i < avctx->height; i++) { - uint16_t *srcr = (uint16_t *)srcr_line; - uint16_t *srcg = (uint16_t *)srcg_line; - uint16_t *srcb = (uint16_t *)srcb_line; + const uint16_t *srcr = (const uint16_t *)srcr_line; + const uint16_t *srcg = (const uint16_t *)srcg_line; + const uint16_t *srcb = (const uint16_t *)srcb_line; for (j = 0; j < avctx->width; j++) { uint32_t pixel; unsigned r = *srcr++; @@ -93,39 +93,36 @@ #if CONFIG_R210_ENCODER const FFCodec ff_r210_encoder = { .p.name = "r210", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), + CODEC_LONG_NAME("Uncompressed RGB 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R210, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_R10K_ENCODER const FFCodec ff_r10k_encoder = { .p.name = "r10k", - .p.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), + CODEC_LONG_NAME("AJA Kona 10-bit RGB Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R10K, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_AVRP_ENCODER const FFCodec ff_avrp_encoder = { .p.name = "avrp", - .p.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), + CODEC_LONG_NAME("Avid 1:1 10-bit RGB Packer"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVRP, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,8 +25,8 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "ra144.h" @@ -128,12 +128,11 @@ const FFCodec ff_ra_144_decoder = { .p.name = "real_144", - .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), + CODEC_LONG_NAME("RealAudio 1.0 (14.4K)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_RA_144, .priv_data_size = sizeof(RA144Context), .init = ra144_decode_init, FF_CODEC_DECODE_CB(ra144_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra144enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -537,7 +537,7 @@ const FFCodec ff_ra_144_encoder = { .p.name = "real_144", - .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), + CODEC_LONG_NAME("RealAudio 1.0 (14.4K)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_RA_144, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -549,9 +549,6 @@ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]){ 8000, 0 }, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra288.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra288.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra288.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ra288.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,8 @@ #include "avcodec.h" #include "celp_filters.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "lpc.h" #include "ra288.h" @@ -239,12 +239,11 @@ const FFCodec ff_ra_288_decoder = { .p.name = "real_288", - .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"), + CODEC_LONG_NAME("RealAudio 2.0 (28.8K)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_RA_288, .priv_data_size = sizeof(RA288Context), .init = ra288_decode_init, FF_CODEC_DECODE_CB(ra288_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ralf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ralf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ralf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ralf.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,9 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "golomb.h" -#include "internal.h" #include "unary.h" #include "ralfdata.h" @@ -63,7 +63,6 @@ unsigned bias[2]; ///< a constant value added to channel data after filtering - int num_blocks; ///< number of blocks inside the frame int sample_offset; int block_size[1 << 12]; ///< size of the blocks int block_pts[1 << 12]; ///< block start time (in milliseconds) @@ -418,7 +417,7 @@ int16_t *samples1; int ret; GetBitContext gb; - int table_size, table_bytes, i; + int table_size, table_bytes, num_blocks; const uint8_t *src, *block_pointer; int src_size; int bytes_left; @@ -451,12 +450,6 @@ src_size = avpkt->size; } - frame->nb_samples = ctx->max_frame_size; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) - return ret; - samples0 = (int16_t *)frame->data[0]; - samples1 = (int16_t *)frame->data[1]; - if (src_size < 5) { av_log(avctx, AV_LOG_ERROR, "too short packets are too short!\n"); return AVERROR_INVALIDDATA; @@ -468,23 +461,28 @@ return AVERROR_INVALIDDATA; } init_get_bits(&gb, src + 2, table_size); - ctx->num_blocks = 0; + num_blocks = 0; while (get_bits_left(&gb) > 0) { - if (ctx->num_blocks >= FF_ARRAY_ELEMS(ctx->block_size)) + if (num_blocks >= FF_ARRAY_ELEMS(ctx->block_size)) return AVERROR_INVALIDDATA; - ctx->block_size[ctx->num_blocks] = get_bits(&gb, 13 + avctx->ch_layout.nb_channels); + ctx->block_size[num_blocks] = get_bits(&gb, 13 + avctx->ch_layout.nb_channels); if (get_bits1(&gb)) { - ctx->block_pts[ctx->num_blocks] = get_bits(&gb, 9); + ctx->block_pts[num_blocks] = get_bits(&gb, 9); } else { - ctx->block_pts[ctx->num_blocks] = 0; + ctx->block_pts[num_blocks] = 0; } - ctx->num_blocks++; + num_blocks++; } + frame->nb_samples = ctx->max_frame_size; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + samples0 = (int16_t *)frame->data[0]; + samples1 = (int16_t *)frame->data[1]; block_pointer = src + table_bytes + 2; bytes_left = src_size - table_bytes - 2; ctx->sample_offset = 0; - for (i = 0; i < ctx->num_blocks; i++) { + for (int i = 0; i < num_blocks; i++) { if (bytes_left < ctx->block_size[i]) { av_log(avctx, AV_LOG_ERROR, "I'm pedaling backwards\n"); break; @@ -515,7 +513,7 @@ const FFCodec ff_ralf_decoder = { .p.name = "ralf", - .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"), + CODEC_LONG_NAME("RealAudio Lossless"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_RALF, .priv_data_size = sizeof(RALFContext), @@ -527,5 +525,5 @@ AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rasc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rasc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rasc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rasc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,16 +21,14 @@ */ #include -#include #include -#include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include @@ -799,7 +797,7 @@ const FFCodec ff_rasc_decoder = { .p.name = "rasc", - .p.long_name = NULL_IF_CONFIG_SMALL("RemotelyAnywhere Screen Capture"), + CODEC_LONG_NAME("RemotelyAnywhere Screen Capture"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RASC, .priv_data_size = sizeof(RASCContext), @@ -808,7 +806,6 @@ FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &rasc_decoder_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,8 +39,8 @@ snprintf(s->avctx->stats_out, 256, "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d " "fcode:%d bcode:%d mc-var:%"PRId64" var:%"PRId64" icount:%d skipcount:%d hbits:%d;\n", - s->current_picture_ptr->f->display_picture_number, - s->current_picture_ptr->f->coded_picture_number, + s->current_picture_ptr->display_picture_number, + s->current_picture_ptr->coded_picture_number, s->pict_type, s->current_picture.f->quality, s->i_tex_bits, @@ -49,8 +49,8 @@ s->misc_bits, s->f_code, s->b_code, - s->current_picture.mc_mb_var_sum, - s->current_picture.mb_var_sum, + s->mc_mb_var_sum, + s->mb_var_sum, s->i_count, s->skip_count, s->header_bits); } @@ -751,15 +751,14 @@ float *bits_tab = s->bits_tab; const int qmin = s->avctx->mb_lmin; const int qmax = s->avctx->mb_lmax; - Picture *const pic = &s->current_picture; const int mb_width = s->mb_width; const int mb_height = s->mb_height; for (i = 0; i < s->mb_num; i++) { const int mb_xy = s->mb_index2xy[i]; - float temp_cplx = sqrt(pic->mc_mb_var[mb_xy]); // FIXME merge in pow() - float spat_cplx = sqrt(pic->mb_var[mb_xy]); - const int lumi = pic->mb_mean[mb_xy]; + float temp_cplx = sqrt(s->mc_mb_var[mb_xy]); // FIXME merge in pow() + float spat_cplx = sqrt(s->mb_var[mb_xy]); + const int lumi = s->mb_mean[mb_xy]; float bits, cplx, factor; int mb_x = mb_xy % s->mb_stride; int mb_y = mb_xy / s->mb_stride; @@ -881,7 +880,6 @@ double rate_factor; int64_t var; const int pict_type = s->pict_type; - Picture * const pic = &s->current_picture; emms_c(); get_qminmax(&qmin, &qmax, s, pict_type); @@ -930,7 +928,7 @@ if (br_compensation <= 0.0) br_compensation = 0.001; - var = pict_type == AV_PICTURE_TYPE_I ? pic->mb_var_sum : pic->mc_mb_var_sum; + var = pict_type == AV_PICTURE_TYPE_I ? s->mb_var_sum : s->mc_mb_var_sum; short_term_q = 0; /* avoid warning */ if (s->avctx->flags & AV_CODEC_FLAG_PASS2) { @@ -943,8 +941,8 @@ } else { rce->pict_type = rce->new_pict_type = pict_type; - rce->mc_mb_var_sum = pic->mc_mb_var_sum; - rce->mb_var_sum = pic->mb_var_sum; + rce->mc_mb_var_sum = s->mc_mb_var_sum; + rce->mb_var_sum = s->mb_var_sum; rce->qscale = FF_QP2LAMBDA * 2; rce->f_code = s->f_code; rce->b_code = s->b_code; @@ -1004,7 +1002,7 @@ qmin, q, qmax, picture_number, wanted_bits / 1000, s->total_bits / 1000, br_compensation, short_term_q, s->frame_bits, - pic->mb_var_sum, pic->mc_mb_var_sum, + s->mb_var_sum, s->mc_mb_var_sum, s->bit_rate / 1000, (int)fps); } @@ -1020,8 +1018,8 @@ if (!dry_run) { rcc->last_qscale = q; - rcc->last_mc_mb_var_sum = pic->mc_mb_var_sum; - rcc->last_mb_var_sum = pic->mb_var_sum; + rcc->last_mc_mb_var_sum = s->mc_mb_var_sum; + rcc->last_mb_var_sum = s->mb_var_sum; } return q; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ratecontrol.h 2023-03-03 13:29:59.000000000 +0000 @@ -80,9 +80,6 @@ int frame_count[5]; int last_non_b_pict_type; - void *non_lavc_opaque; ///< context for non lavc rc code (for example xvid) - float dry_run_qscale; ///< for xvid rc - int last_picture_number; ///< for xvid rc AVExpr * rc_eq_eval; }RateControlContext; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/raw.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/raw.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/raw.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/raw.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,6 +72,7 @@ { AV_PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') }, { AV_PIX_FMT_NV12, MKTAG('N', 'V', '1', '2') }, { AV_PIX_FMT_NV21, MKTAG('N', 'V', '2', '1') }, + { AV_PIX_FMT_VUYA, MKTAG('A', 'Y', 'U', 'V') }, /* MS 4:4:4:4 */ /* nut */ { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -233,9 +233,6 @@ if (res < 0) return res; - frame->pkt_pos = avctx->internal->last_pkt_props->pos; - frame->pkt_duration = avctx->internal->last_pkt_props->duration; - if (context->tff >= 0) { frame->interlaced_frame = 1; frame->top_field_first = context->tff; @@ -482,7 +479,7 @@ const FFCodec ff_rawvideo_decoder = { .p.name = "rawvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("raw video"), + CODEC_LONG_NAME("raw video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RAWVIDEO, .priv_data_size = sizeof(RawVideoContext), @@ -491,5 +488,4 @@ FF_CODEC_DECODE_CB(raw_decode), .p.priv_class = &rawdec_class, .p.capabilities = AV_CODEC_CAP_PARAM_CHANGE, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rawenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -83,11 +83,11 @@ const FFCodec ff_rawvideo_encoder = { .p.name = "rawvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("raw video"), + CODEC_LONG_NAME("raw video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RAWVIDEO, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = raw_encode_init, FF_CODEC_ENCODE_CB(raw_encode), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/realtextdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/realtextdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/realtextdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/realtextdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -76,12 +76,11 @@ const FFCodec ff_realtext_decoder = { .p.name = "realtext", - .p.long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), + CODEC_LONG_NAME("RealText subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_REALTEXT, FF_CODEC_DECODE_SUB_CB(realtext_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * 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 + */ + +#include "config.h" + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/aacpsdsp.h" + +void ff_ps_add_squares_rvv(float *dst, const float (*src)[2], int n); +void ff_ps_mul_pair_single_rvv(float (*dst)[2], float (*src0)[2], float *src1, + int n); +void ff_ps_hybrid_analysis_rvv(float (*out)[2], float (*in)[2], + const float (*filter)[8][2], ptrdiff_t, int n); +void ff_ps_hybrid_analysis_ileave_rvv(float (*out)[32][2], float L[2][38][64], + int i, int len); +void ff_ps_hybrid_synthesis_deint_rvv(float out[2][38][64], float (*in)[32][2], + int i, int len); + +void ff_ps_stereo_interpolate_rvv(float (*l)[2], float (*r)[2], + float h[2][4], float h_step[2][4], int len); + +av_cold void ff_psdsp_init_riscv(PSDSPContext *c) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_F32) { + c->add_squares = ff_ps_add_squares_rvv; + c->mul_pair_single = ff_ps_mul_pair_single_rvv; + c->hybrid_analysis = ff_ps_hybrid_analysis_rvv; + c->stereo_interpolate[0] = ff_ps_stereo_interpolate_rvv; + } + + if (flags & AV_CPU_FLAG_RVV_I32) { + c->hybrid_analysis_ileave = ff_ps_hybrid_analysis_ileave_rvv; + c->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,279 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_ps_add_squares_rvv, zve32f +1: + vsetvli t0, a2, e32, m1, ta, ma + vlseg2e32.v v24, (a1) + sub a2, a2, t0 + vle32.v v16, (a0) + sh3add a1, t0, a1 + vfmacc.vv v16, v24, v24 + vfmacc.vv v16, v25, v25 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc + +func ff_ps_mul_pair_single_rvv, zve32f +1: + vsetvli t0, a3, e32, m1, 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 + vsseg2e32.v v24, (a0) + sh3add a0, t0, a0 + bnez a3, 1b + + ret +endfunc + +func ff_ps_hybrid_analysis_rvv, zve32f + /* We need 26 FP registers, for 20 scratch ones. Spill fs0-fs5. */ + addi sp, sp, -48 + .irp n, 0, 1, 2, 3, 4, 5 +HWD fsd fs\n, (8 * \n)(sp) +NOHWD fsw fs\n, (4 * \n)(sp) + .endr + + .macro input, j, fd0, fd1, fd2, fd3 + flw \fd0, (4 * ((\j * 2) + 0))(a1) + flw fs4, (4 * (((12 - \j) * 2) + 0))(a1) + flw \fd1, (4 * ((\j * 2) + 1))(a1) + fsub.s \fd3, \fd0, fs4 + flw fs5, (4 * (((12 - \j) * 2) + 1))(a1) + fadd.s \fd2, \fd1, fs5 + fadd.s \fd0, \fd0, fs4 + fsub.s \fd1, \fd1, fs5 + .endm + + // re0, re1, im0, im1 + input 0, ft0, ft1, ft2, ft3 + input 1, ft4, ft5, ft6, ft7 + input 2, ft8, ft9, ft10, ft11 + input 3, fa0, fa1, fa2, fa3 + input 4, fa4, fa5, fa6, fa7 + input 5, fs0, fs1, fs2, fs3 + flw fs4, (4 * ((6 * 2) + 0))(a1) + flw fs5, (4 * ((6 * 2) + 1))(a1) + + add a2, a2, 6 * 2 * 4 // point to filter[i][6][0] + li t4, 8 * 2 * 4 // filter byte stride + slli a3, a3, 3 // output byte stride +1: + .macro filter, vs0, vs1, fo0, fo1, fo2, fo3 + vfmacc.vf v8, \fo0, \vs0 + vfmacc.vf v9, \fo2, \vs0 + vfnmsac.vf v8, \fo1, \vs1 + vfmacc.vf v9, \fo3, \vs1 + .endm + + vsetvli t0, a4, e32, m1, ta, ma + /* + * The filter (a2) has 16 segments, of which 13 need to be extracted. + * R-V V supports only up to 8 segments, so unrolling is unavoidable. + */ + addi t1, a2, -48 + vlse32.v v22, (a2), t4 + addi t2, a2, -44 + vlse32.v v16, (t1), t4 + addi t1, a2, -40 + vfmul.vf v8, v22, fs4 + vlse32.v v24, (t2), t4 + addi t2, a2, -36 + vfmul.vf v9, v22, fs5 + vlse32.v v17, (t1), t4 + addi t1, a2, -32 + vlse32.v v25, (t2), t4 + addi t2, a2, -28 + filter v16, v24, ft0, ft1, ft2, ft3 + vlse32.v v18, (t1), t4 + addi t1, a2, -24 + vlse32.v v26, (t2), t4 + addi t2, a2, -20 + filter v17, v25, ft4, ft5, ft6, ft7 + vlse32.v v19, (t1), t4 + addi t1, a2, -16 + vlse32.v v27, (t2), t4 + addi t2, a2, -12 + filter v18, v26, ft8, ft9, ft10, ft11 + vlse32.v v20, (t1), t4 + addi t1, a2, -8 + vlse32.v v28, (t2), t4 + addi t2, a2, -4 + filter v19, v27, fa0, fa1, fa2, fa3 + vlse32.v v21, (t1), t4 + sub a4, a4, t0 + vlse32.v v29, (t2), t4 + slli t1, t0, 3 + 1 + 2 // ctz(8 * 2 * 4) + add a2, a2, t1 + filter v20, v28, fa4, fa5, fa6, fa7 + filter v21, v29, fs0, fs1, fs2, fs3 + + add t2, a0, 4 + vsse32.v v8, (a0), a3 + mul t0, t0, a3 + vsse32.v v9, (t2), a3 + add a0, a0, t0 + bnez a4, 1b + + .irp n, 5, 4, 3, 2, 1, 0 +HWD fld fs\n, (8 * \n)(sp) +NOHWD flw fs\n, (4 * \n)(sp) + .endr + addi sp, sp, 48 + ret + .purgem input + .purgem filter +endfunc + +func ff_ps_hybrid_analysis_ileave_rvv, zve32x /* no needs for zve32f here */ + slli t0, a2, 5 + 1 + 2 // ctz(32 * 2 * 4) + sh2add a1, a2, a1 + add a0, a0, t0 + addi a2, a2, -64 + li t1, 38 * 64 * 4 + li t6, 64 * 4 // (uint8_t *)L[x][j+1][i] - L[x][j][i] + add a4, a1, t1 // &L[1] + beqz a2, 3f +1: + mv t0, a0 + mv t1, a1 + mv t3, a3 + mv t4, a4 + addi a2, a2, 1 +2: + vsetvli t5, t3, e32, m1, ta, ma + vlse32.v v16, (t1), t6 + sub t3, t3, t5 + vlse32.v v17, (t4), t6 + mul t2, t5, t6 + vsseg2e32.v v16, (t0) + sh3add t0, t5, t0 + add t1, t1, t2 + add t4, t4, t2 + bnez t3, 2b + + add a0, a0, 32 * 2 * 4 + add a1, a1, 4 + add a4, a4, 4 + bnez a2, 1b +3: + ret +endfunc + +func ff_ps_hybrid_synthesis_deint_rvv, zve32x + slli t1, a2, 5 + 1 + 2 + sh2add a0, a2, a0 + add a1, a1, t1 + addi a2, a2, -64 + li t1, 38 * 64 * 4 + li t6, 64 * 4 + add a4, a0, t1 + beqz a2, 3f +1: + mv t0, a0 + mv t1, a1 + mv t3, a3 + mv t4, a4 + addi a2, a2, 1 +2: + vsetvli t5, t3, e32, m1, ta, ma + vlseg2e32.v v16, (t1) + sub t3, t3, t5 + vsse32.v v16, (t0), t6 + mul t2, t5, t6 + vsse32.v v17, (t4), t6 + sh3add t1, t5, t1 + add t0, t0, t2 + add t4, t4, t2 + bnez t3, 2b + + add a0, a0, 4 + add a1, a1, 32 * 2 * 4 + add a4, a4, 4 + bnez a2, 1b +3: + ret +endfunc + +func ff_ps_stereo_interpolate_rvv, zve32f + vsetvli t0, zero, e32, m1, ta, ma + vid.v v24 + flw ft0, (a2) + vadd.vi v24, v24, 1 // v24[i] = i + 1 + flw ft1, 4(a2) + vfcvt.f.xu.v v24, v24 + flw ft2, 8(a2) + vfmv.v.f v16, ft0 + flw ft3, 12(a2) + vfmv.v.f v17, ft1 + flw ft0, (a3) + vfmv.v.f v18, ft2 + flw ft1, 4(a3) + vfmv.v.f v19, 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 + fmul.s ft0, ft0, ft4 + vfmv.v.f v23, ft3 + fmul.s ft1, ft1, ft4 + vfmacc.vv v16, v24, v20 // h0 += (i + 1) * h0_step + fmul.s ft2, ft2, ft4 + vfmacc.vv v17, v24, v21 + 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 + 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) + sh3add a0, t0, a0 + vsseg2e32.v v14, (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 + bnez a4, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * 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 + */ + +#include + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/alacdsp.h" + +void ff_alac_decorrelate_stereo_rvv(int32_t *buffer[2], int nb_samples, + int decorr_shift, int decorr_left_weight); +void ff_alac_append_extra_bits_mono_rvv(int32_t *buffer[2], + int32_t *extra_bits_buf[2], + int extra_bits, int channels, + int nb_samples); +void ff_alac_append_extra_bits_stereo_rvv(int32_t *buffer[2], + int32_t *extra_bits_buf[2], + int extra_bits, int channels, + int nb_samples); + +av_cold void ff_alacdsp_init_riscv(ALACDSPContext *c) +{ +#if HAVE_RVV && (__riscv_xlen == 64) + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_I32) { + c->decorrelate_stereo = ff_alac_decorrelate_stereo_rvv; + c->append_extra_bits[0] = ff_alac_append_extra_bits_mono_rvv; + c->append_extra_bits[1] = ff_alac_append_extra_bits_stereo_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/alacdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +#if (__riscv_xlen == 64) +func ff_alac_decorrelate_stereo_rvv, zve32x + ld a4, 8(a0) + ld a0, 0(a0) +1: + vsetvli t0, a1, e32, m1, ta, ma + vle32.v v24, (a4) + sub a1, a1, t0 + vle32.v v16, (a0) + vmul.vx v8, v24, a3 + vadd.vv v24, v24, v16 + vsra.vx v8, v8, a2 + vsub.vv v16, v16, v8 + vsub.vv v24, v24, v8 + vse32.v v16, (a4) + sh2add a4, t0, a4 + vse32.v v24, (a0) + sh2add a0, t0, a0 + bnez a1, 1b + + ret +endfunc + +func ff_alac_append_extra_bits_mono_rvv, zve32x + ld a0, (a0) + ld a1, (a1) +1: + vsetvli t0, a4, e32, m1, ta, ma + vle32.v v16, (a0) + sub a4, a4, t0 + vle32.v v24, (a1) + sh2add a1, t0, a1 + vsll.vx v16, v16, a2 + vor.vv v16, v24, v16 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a4, 1b + + ret +endfunc + +func ff_alac_append_extra_bits_stereo_rvv, zve32x + ld a6, 8(a0) + ld a0, (a0) + ld a7, 8(a1) + ld a1, (a1) +1: + vsetvli t0, a4, e32, m1, ta, ma + vle32.v v16, (a0) + sub a4, a4, t0 + vle32.v v0, (a6) + vsll.vx v16, v16, a2 + vsll.vx v0, v0, a2 + vle32.v v24, (a1) + sh2add a1, t0, a1 + vle32.v v8, (a7) + sh2add a7, t0, a7 + vor.vv v16, v24, v16 + vor.vv v0, v8, v0 + vse32.v v16, (a0) + sh2add a0, t0, a0 + vse32.v v0, (a6) + sh2add a6, t0, a6 + bnez a4, 1b + + ret +endfunc +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * 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 + */ + +#include "config.h" + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/audiodsp.h" + +void ff_vector_clipf_rvf(float *dst, const float *src, int len, float min, float max); + +int32_t ff_scalarproduct_int16_rvv(const int16_t *v1, const int16_t *v2, int len); +void ff_vector_clip_int32_rvv(int32_t *dst, const int32_t *src, int32_t min, + int32_t max, unsigned int len); +void ff_vector_clipf_rvv(float *dst, const float *src, int len, float min, float max); + +av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c) +{ + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVF) + c->vector_clipf = ff_vector_clipf_rvf; +#if HAVE_RVV + if (flags & AV_CPU_FLAG_RVV_I32) { + c->scalarproduct_int16 = ff_scalarproduct_int16_rvv; + c->vector_clip_int32 = ff_vector_clip_int32_rvv; + } + if (flags & AV_CPU_FLAG_RVV_F32) + c->vector_clipf = ff_vector_clipf_rvv; +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvf.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvf.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvf.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvf.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_vector_clipf_rvf, f +NOHWF fmv.w.x fa0, a3 +NOHWF fmv.w.x fa1, a4 +1: + flw ft0, (a1) + flw ft1, 4(a1) + fmax.s ft0, ft0, fa0 + flw ft2, 8(a1) + fmax.s ft1, ft1, fa0 + flw ft3, 12(a1) + fmax.s ft2, ft2, fa0 + addi a2, a2, -4 + fmax.s ft3, ft3, fa0 + addi a1, a1, 16 + fmin.s ft0, ft0, fa1 + fmin.s ft1, ft1, fa1 + fsw ft0, (a0) + fmin.s ft2, ft2, fa1 + fsw ft1, 4(a0) + fmin.s ft3, ft3, fa1 + fsw ft2, 8(a0) + fsw ft3, 12(a0) + addi a0, a0, 16 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/audiodsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_scalarproduct_int16_rvv, zve32x + vsetivli zero, 1, e32, m1, ta, ma + vmv.s.x v8, zero +1: + vsetvli t0, a2, e16, m1, ta, ma + vle16.v v16, (a0) + sub a2, a2, t0 + vle16.v v24, (a1) + sh1add a0, t0, a0 + vwmul.vv v0, v16, v24 + sh1add a1, t0, a1 + vsetvli zero, t0, e32, m2, ta, ma + vredsum.vs v8, v0, v8 + bnez a2, 1b + + vmv.x.s a0, v8 + ret +endfunc + +func ff_vector_clip_int32_rvv, zve32x +1: + vsetvli t0, a4, e32, m1, ta, ma + vle32.v v8, (a1) + sub a4, a4, t0 + vmax.vx v8, v8, a2 + sh2add a1, t0, a1 + vmin.vx v8, v8, a3 + vse32.v v8, (a0) + sh2add a0, t0, a0 + bnez a4, 1b + + ret +endfunc + +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 + vle32.v v8, (a1) + sub a2, a2, t0 + vfmax.vf v8, v8, fa0 + sh2add a1, t0, a1 + vfmin.vf v8, v8, fa1 + vse32.v v8, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * 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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/bswapdsp.h" + +void ff_bswap32_buf_rvb(uint32_t *dst, const uint32_t *src, int len); +void ff_bswap32_buf_rvv(uint32_t *dst, const uint32_t *src, int len); +void ff_bswap16_buf_rvv(uint16_t *dst, const uint16_t *src, int len); + +av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c) +{ + int cpu_flags = av_get_cpu_flags(); + +#if (__riscv_xlen >= 64) + if (cpu_flags & AV_CPU_FLAG_RVB_BASIC) + c->bswap_buf = ff_bswap32_buf_rvb; +#endif +#if HAVE_RVV + if (cpu_flags & AV_CPU_FLAG_RVV_I32) { + c->bswap_buf = ff_bswap32_buf_rvv; + c->bswap16_buf = ff_bswap16_buf_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * 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 + */ + +#include "config.h" +#include "libavutil/riscv/asm.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 +endfunc +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/bswapdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * 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 + */ + +#include "config.h" +#include "libavutil/riscv/asm.S" + +func ff_bswap32_buf_rvv, zve32x + li t4, 4 + addi t1, a0, 1 + addi t2, a0, 2 + addi t3, a0, 3 +1: + vsetvli t0, a2, e8, m1, ta, ma + vlseg4e8.v v8, (a1) + sub a2, a2, t0 + sh2add a1, t0, a1 + vsse8.v v8, (t3), t4 + sh2add t3, t0, t3 + vsse8.v v9, (t2), t4 + sh2add t2, t0, t2 + vsse8.v v10, (t1), t4 + sh2add t1, t0, t1 + vsse8.v v11, (a0), t4 + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc + +func ff_bswap16_buf_rvv, zve32x + li t2, 2 + addi t1, a0, 1 +1: + vsetvli t0, a2, e8, m1, ta, ma + vlseg2e8.v v8, (a1) + sub a2, a2, t0 + sh1add a1, t0, a1 + vsse8.v v8, (t1), t2 + sh1add t1, t0, t1 + vsse8.v v9, (a0), t2 + sh1add a0, t0, a0 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * 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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/fmtconvert.h" + +void ff_int32_to_float_fmul_scalar_rvv(float *dst, const int32_t *src, + float mul, int len); +void ff_int32_to_float_fmul_array8_rvv(FmtConvertContext *c, float *dst, + const int32_t *src, const float *mul, + int len); + +av_cold void ff_fmt_convert_init_riscv(FmtConvertContext *c) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_F32) { + c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_rvv; + c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +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 + vle32.v v24, (a1) + sub a2, a2, t0 + vfcvt.f.x.v v24, v24 + sh2add a1, t0, a1 + vfmul.vf v24, v24, fa0 + vse32.v v24, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc + +func ff_int32_to_float_fmul_array8_rvv, zve32f + srai a4, a4, 3 + +1: vsetvli t0, a4, e32, m1, ta, ma + vle32.v v24, (a3) + slli t2, t0, 2 + 3 + vlseg8e32.v v16, (a2) + vsetvli t3, zero, e32, m8, ta, ma + vfcvt.f.x.v v16, v16 + vsetvli zero, a4, e32, m1, ta, ma + vfmul.vv v16, v16, v24 + sub a4, a4, t0 + vfmul.vv v17, v17, v24 + sh2add a3, t0, a3 + vfmul.vv v18, v18, v24 + add a2, a2, t2 + vfmul.vv v19, v19, v24 + vfmul.vv v20, v20, v24 + vfmul.vv v21, v21, v24 + vfmul.vv v22, v22, v24 + vfmul.vv v23, v23, v24 + vsseg8e32.v v16, (a1) + add a1, a1, t2 + bnez a4, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * 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 + */ + +#include + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/idctdsp.h" + +void ff_put_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels, + ptrdiff_t stride); +void ff_put_signed_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels, + ptrdiff_t stride); +void ff_add_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels, + ptrdiff_t stride); + +av_cold void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) { + c->put_pixels_clamped = ff_put_pixels_clamped_rvv; + c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_rvv; + c->add_pixels_clamped = ff_add_pixels_clamped_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/idctdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_put_pixels_clamped_rvv, zve32x + vsetivli zero, 8, e16, m1, ta, ma + vlseg8e16.v v24, (a0) +1: + /* RVV only has signed-signed and unsigned-unsigned clipping. + * We need two steps for signed-to-unsigned clipping. */ + vsetvli t0, zero, e16, m8, ta, ma + vmax.vx v24, v24, zero + + vsetivli zero, 8, e8, mf2, ta, ma + vnclipu.wi v16, v24, 0 + vnclipu.wi v17, v25, 0 + vnclipu.wi v18, v26, 0 + vnclipu.wi v19, v27, 0 + vnclipu.wi v20, v28, 0 + vnclipu.wi v21, v29, 0 + vnclipu.wi v22, v30, 0 + vnclipu.wi v23, v31, 0 + vssseg8e8.v v16, (a1), a2 + ret +endfunc + +func ff_put_signed_pixels_clamped_rvv, zve32x + vsetivli zero, 8, e16, m1, ta, ma + vlseg8e16.v v24, (a0) + + li t1, 128 + vsetivli zero, 8, e8, mf2, ta, ma + vnclip.wi v16, v24, 0 + vnclip.wi v17, v25, 0 + vnclip.wi v18, v26, 0 + vnclip.wi v19, v27, 0 + vnclip.wi v20, v28, 0 + vnclip.wi v21, v29, 0 + vnclip.wi v22, v30, 0 + vnclip.wi v23, v31, 0 + vsetvli t0, zero, e8, m8, ta, ma + vadd.vx v16, v16, t1 + vsetivli zero, 8, e8, mf2, ta, ma + vssseg8e8.v v16, (a1), a2 + ret +endfunc + +func ff_add_pixels_clamped_rvv, zve32x + vsetivli zero, 8, e8, mf2, ta, ma + vlseg8e16.v v24, (a0) + vlsseg8e8.v v16, (a1), a2 + vwaddu.wv v24, v24, v16 + vwaddu.wv v25, v25, v17 + vwaddu.wv v26, v26, v18 + vwaddu.wv v27, v27, v19 + vwaddu.wv v28, v28, v20 + vwaddu.wv v29, v29, v21 + vwaddu.wv v30, v30, v22 + vwaddu.wv v31, v31, v23 + j 1b +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,21 @@ +OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o +RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o +OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o +RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o +OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \ + riscv/audiodsp_rvf.o +RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o +OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \ + riscv/bswapdsp_rvb.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_IDCTDSP) += riscv/idctdsp_init.o +RVV-OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_rvv.o +OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o +RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o +OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \ + riscv/pixblockdsp_rvi.o +RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o +OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o +RVV-OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_rvv.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * 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 + */ + +#include "config.h" + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/opusdsp.h" + +void ff_opus_postfilter_rvv_128(float *data, int period, float *g, int len); +void ff_opus_postfilter_rvv_256(float *data, int period, float *g, int len); +void ff_opus_postfilter_rvv_512(float *data, int period, float *g, int len); +void ff_opus_postfilter_rvv_1024(float *data, int period, float *g, int len); + +av_cold void ff_opus_dsp_init_riscv(OpusDSP *d) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_F32) + switch (ff_get_rv_vlenb()) { + case 16: + d->postfilter = ff_opus_postfilter_rvv_128; + break; + case 32: + d->postfilter = ff_opus_postfilter_rvv_256; + break; + case 64: + d->postfilter = ff_opus_postfilter_rvv_512; + break; + case 128: + d->postfilter = ff_opus_postfilter_rvv_512; + break; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/opusdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_opus_postfilter_rvv_128, zve32f + lvtypei a5, e32, m2, ta, ma + j 1f +endfunc + +func ff_opus_postfilter_rvv_512, zve32f + lvtypei a5, e32, mf2, ta, ma + j 1f +endfunc + +func ff_opus_postfilter_rvv_1024, zve32f + lvtypei a5, e32, mf4, ta, ma + j 1f +endfunc + +func ff_opus_postfilter_rvv_256, zve32f + lvtypei a5, e32, m1, ta, ma +1: + li a4, 5 + addi a1, a1, 2 + slli a1, a1, 2 + lw t1, 4(a2) + vsetivli zero, 3, e32, m1, ta, ma + vle32.v v24, (a2) + sub a1, a0, a1 // a1 = &x4 = &data[-(period + 2)] + vsetvl zero, a4, a5 + vslide1up.vx v8, v24, t1 + lw t2, 8(a2) + vle32.v v16, (a1) + vslide1up.vx v24, v8, t2 // v24 = { g[2], g[1], g[0], g[1], g[2] } +2: + vsetvl t0, a3, a5 + vle32.v v0, (a0) + sub a3, a3, t0 +3: + vsetvl zero, a4, a5 + lw t2, 20(a1) + vfmul.vv v8, v24, v16 + addi a0, a0, 4 + vslide1down.vx v16, v16, t2 + addi a1, a1, 4 + vfredusum.vs v0, v8, v0 + vsetvl zero, t0, a5 + vmv.x.s t1, v0 + addi t0, t0, -1 + vslide1down.vx v0, v0, zero + sw t1, -4(a0) + bnez t0, 3b + + bnez a3, 2b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/pixblockdsp.h" + +void ff_get_pixels_8_rvi(int16_t *block, const uint8_t *pixels, + ptrdiff_t stride); +void ff_get_pixels_16_rvi(int16_t *block, const uint8_t *pixels, + ptrdiff_t stride); + +void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels, + ptrdiff_t stride); +void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels, + ptrdiff_t stride); +void ff_diff_pixels_rvv(int16_t *block, const uint8_t *s1, const uint8_t *s2, + ptrdiff_t stride); + +av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, + AVCodecContext *avctx, + unsigned high_bit_depth) +{ + int cpu_flags = av_get_cpu_flags(); + + if (cpu_flags & AV_CPU_FLAG_RVI) { + if (high_bit_depth) + c->get_pixels = ff_get_pixels_16_rvi; + else + c->get_pixels = ff_get_pixels_8_rvi; + } + +#if HAVE_RVV + if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) { + if (high_bit_depth) + c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_16_rvv; + else + c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv; + + c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvi.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvi.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvi.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvi.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_get_pixels_8_rvi +.irp row, 0, 1, 2, 3, 4, 5, 6, 7 + ld t0, (a1) + add a1, a1, a2 + sd zero, ((\row * 16) + 0)(a0) + addi t6, t6, -1 + sd zero, ((\row * 16) + 8)(a0) + srli t1, t0, 8 + sb t0, ((\row * 16) + 0)(a0) + srli t2, t0, 16 + sb t1, ((\row * 16) + 2)(a0) + srli t3, t0, 24 + sb t2, ((\row * 16) + 4)(a0) + srli t4, t0, 32 + sb t3, ((\row * 16) + 6)(a0) + srli t1, t0, 40 + sb t4, ((\row * 16) + 8)(a0) + srli t2, t0, 48 + sb t1, ((\row * 16) + 10)(a0) + srli t3, t0, 56 + sb t2, ((\row * 16) + 12)(a0) + sb t3, ((\row * 16) + 14)(a0) +.endr + ret +endfunc + +func ff_get_pixels_16_rvi +.irp row, 0, 1, 2, 3, 4, 5, 6, 7 + ld t0, 0(a1) + ld t1, 8(a1) + add a1, a1, a2 + sd t0, ((\row * 16) + 0)(a0) + sd t1, ((\row * 16) + 8)(a0) +.endr + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/pixblockdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_get_pixels_8_rvv, zve32x + vsetivli zero, 8, e8, mf2, ta, ma + vlsseg8e8.v v16, (a1), a2 + vwcvtu.x.x.v v8, v16 + vwcvtu.x.x.v v9, v17 + vwcvtu.x.x.v v10, v18 + vwcvtu.x.x.v v11, v19 + vwcvtu.x.x.v v12, v20 + vwcvtu.x.x.v v13, v21 + vwcvtu.x.x.v v14, v22 + vwcvtu.x.x.v v15, v23 + vsseg8e16.v v8, (a0) + ret +endfunc + +func ff_get_pixels_16_rvv, zve32x + vsetivli zero, 8, e16, m1, ta, ma + vlsseg8e16.v v0, (a1), a2 + vsseg8e16.v v0, (a0) + ret +endfunc + +func ff_diff_pixels_rvv, zve32x + vsetivli zero, 8, e8, mf2, ta, ma + vlsseg8e8.v v16, (a1), a3 + vlsseg8e8.v v24, (a2), a3 + vwsubu.vv v8, v16, v24 + vwsubu.vv v9, v17, v25 + vwsubu.vv v10, v18, v26 + vwsubu.vv v11, v19, v27 + vwsubu.vv v12, v20, v28 + vwsubu.vv v13, v21, v29 + vwsubu.vv v14, v22, v30 + vwsubu.vv v15, v23, v31 + vsseg8e16.v v8, (a0) + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * 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 + */ + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/vorbisdsp.h" + +void ff_vorbis_inverse_coupling_rvv(float *mag, float *ang, + ptrdiff_t blocksize); + +av_cold void ff_vorbisdsp_init_riscv(VorbisDSPContext *c) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_I32) + c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_rvv; +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/riscv/vorbisdsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_vorbis_inverse_coupling_rvv, zve32f + fmv.w.x ft0, zero +1: + vsetvli t0, a2, e32, m1, ta, ma + vle32.v v16, (a1) + sub a2, a2, t0 + vle32.v v24, (a0) + vfmax.vf v8, v16, ft0 + vfmin.vf v16, v16, ft0 + vfsgnj.vv v8, v8, v24 + vfsgnj.vv v16, v16, v24 + vfsub.vv v8, v24, v8 + vfsub.vv v24, v24, v16 + vse32.v v8, (a1) + sh2add a1, t0, a1 + vse32.v v24, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rka.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rka.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rka.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rka.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,989 @@ +/* + * RKA 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/channel_layout.h" +#include "libavutil/intreadwrite.h" + +#include "avcodec.h" +#include "codec_internal.h" +#include "bytestream.h" +#include "decode.h" + +typedef struct ACoder { + GetByteContext gb; + uint32_t low, high; + uint32_t value; +} ACoder; + +typedef struct FiltCoeffs { + int32_t coeffs[257]; + unsigned size; +} FiltCoeffs; + +typedef struct Model64 { + uint32_t zero[2]; + uint32_t sign[2]; + unsigned size; + int bits; + + uint16_t val4[65]; + uint16_t val1[65]; +} Model64; + +typedef struct AdaptiveModel { + int last; + int total; + int buf_size; + int16_t sum; + uint16_t aprob0; + uint16_t aprob1; + uint16_t *prob[2]; +} AdaptiveModel; + +typedef struct ChContext { + int cmode; + int cmode2; + int last_nb_decoded; + unsigned srate_pad; + unsigned pos_idx; + + AdaptiveModel *filt_size; + AdaptiveModel *filt_bits; + + uint32_t *bprob[2]; + + AdaptiveModel position; + AdaptiveModel fshift; + AdaptiveModel nb_segments; + AdaptiveModel coeff_bits[11]; + + Model64 mdl64[4][11]; + + int32_t buf0[131072+2560]; + int32_t buf1[131072+2560]; +} ChContext; + +typedef struct RKAContext { + AVClass *class; + + ACoder ac; + ChContext ch[2]; + + int bps; + int align; + int channels; + int correlated; + int frame_samples; + int last_nb_samples; + uint32_t total_nb_samples; + uint32_t samples_left; + + uint32_t bprob[2][257]; + + AdaptiveModel filt_size; + AdaptiveModel filt_bits; +} RKAContext; + +static int adaptive_model_init(AdaptiveModel *am, int buf_size) +{ + am->buf_size = buf_size; + am->sum = 2000; + am->aprob0 = 0; + am->aprob1 = 0; + am->total = 0; + + if (!am->prob[0]) + am->prob[0] = av_malloc_array(buf_size + 5, sizeof(*am->prob[0])); + if (!am->prob[1]) + am->prob[1] = av_malloc_array(buf_size + 5, sizeof(*am->prob[1])); + + if (!am->prob[0] || !am->prob[1]) + return AVERROR(ENOMEM); + memset(am->prob[0], 0, (buf_size + 5) * sizeof(*am->prob[0])); + memset(am->prob[1], 0, (buf_size + 5) * sizeof(*am->prob[1])); + return 0; +} + +static void adaptive_model_free(AdaptiveModel *am) +{ + av_freep(&am->prob[0]); + av_freep(&am->prob[1]); +} + +static av_cold int rka_decode_init(AVCodecContext *avctx) +{ + RKAContext *s = avctx->priv_data; + int cmode; + + if (avctx->extradata_size < 16) + return AVERROR_INVALIDDATA; + + s->bps = avctx->bits_per_raw_sample = avctx->extradata[13]; + + switch (s->bps) { + case 8: + avctx->sample_fmt = AV_SAMPLE_FMT_U8P; + break; + case 16: + avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + break; + default: + return AVERROR_INVALIDDATA; + } + + av_channel_layout_uninit(&avctx->ch_layout); + s->channels = avctx->ch_layout.nb_channels = avctx->extradata[12]; + if (s->channels < 1 || s->channels > 2) + return AVERROR_INVALIDDATA; + + s->align = (s->channels * (avctx->bits_per_raw_sample >> 3)); + s->samples_left = s->total_nb_samples = (AV_RL32(avctx->extradata + 4)) / s->align; + s->frame_samples = 131072 / s->align; + s->last_nb_samples = s->total_nb_samples % s->frame_samples; + s->correlated = avctx->extradata[15] & 1; + + cmode = avctx->extradata[14] & 0xf; + if ((avctx->extradata[15] & 4) != 0) + cmode = -cmode; + + 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); + + return 0; +} + +static void model64_init(Model64 *m, unsigned bits) +{ + unsigned x; + + m->bits = bits; + m->size = 64; + m->zero[0] = 1; + + x = (1 << (bits >> 1)) + 3; + x = FFMIN(x, 20); + + m->zero[1] = x; + m->sign[0] = 1; + m->sign[1] = 1; + + for (int i = 0; i < FF_ARRAY_ELEMS(m->val4); i++) { + m->val4[i] = 4; + m->val1[i] = 1; + } +} + +static int chctx_init(RKAContext *s, ChContext *c, + int sample_rate, int bps) +{ + int ret; + + memset(c->buf0, 0, sizeof(c->buf0)); + memset(c->buf1, 0, sizeof(c->buf1)); + + c->filt_size = &s->filt_size; + c->filt_bits = &s->filt_bits; + + c->bprob[0] = s->bprob[0]; + c->bprob[1] = s->bprob[1]; + + c->srate_pad = (sample_rate << 13) / 44100 & 0xFFFFFFFCU; + c->pos_idx = 1; + + for (int i = 0; i < FF_ARRAY_ELEMS(s->bprob[0]); i++) + c->bprob[0][i] = c->bprob[1][i] = 1; + + for (int i = 0; i < 11; i++) { + ret = adaptive_model_init(&c->coeff_bits[i], 32); + if (ret < 0) + return ret; + + model64_init(&c->mdl64[0][i], i); + model64_init(&c->mdl64[1][i], i); + model64_init(&c->mdl64[2][i], i+1); + model64_init(&c->mdl64[3][i], i+1); + } + + ret = adaptive_model_init(c->filt_size, 256); + if (ret < 0) + return ret; + ret = adaptive_model_init(c->filt_bits, 16); + if (ret < 0) + return ret; + ret = adaptive_model_init(&c->position, 16); + if (ret < 0) + return ret; + ret = adaptive_model_init(&c->nb_segments, 8); + if (ret < 0) + return ret; + return adaptive_model_init(&c->fshift, 32); +} + +static void init_acoder(ACoder *ac) +{ + ac->low = 0x0; + ac->high = 0xffffffff; + ac->value = bytestream2_get_be32(&ac->gb); +} + +static int ac_decode_bool(ACoder *ac, int freq1, int freq2) +{ + unsigned help, add, high, value; + int low; + + low = ac->low; + help = ac->high / (unsigned)(freq2 + freq1); + value = ac->value; + add = freq1 * help; + ac->high = help; + + if (value - low >= add) { + ac->low = low = add + low; + ac->high = high = freq2 * help; + while (1) { + if ((low ^ (high + low)) > 0xFFFFFF) { + if (high > 0xFFFF) + return 1; + ac->high = (uint16_t)-(int16_t)low; + } + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + break; + ac->value = bytestream2_get_byteu(&ac->gb) | (ac->value << 8); + ac->high = high = ac->high << 8; + low = ac->low = ac->low << 8; + } + return -1; + } + + ac->high = add; + while (1) { + if ((low ^ (add + low)) > 0xFFFFFF) { + if (add > 0xFFFF) + return 0; + ac->high = (uint16_t)-(int16_t)low; + } + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + break; + ac->value = bytestream2_get_byteu(&ac->gb) | (ac->value << 8); + ac->high = add = ac->high << 8; + low = ac->low = ac->low << 8; + } + return -1; +} + +static int decode_bool(ACoder *ac, ChContext *c, int idx) +{ + uint32_t x; + int b; + + x = c->bprob[0][idx]; + if (x + c->bprob[1][idx] > 4096) { + c->bprob[0][idx] = (x >> 1) + 1; + c->bprob[1][idx] = (c->bprob[1][idx] >> 1) + 1; + } + + b = ac_decode_bool(ac, c->bprob[0][idx], c->bprob[1][idx]); + if (b < 0) + return b; + + c->bprob[b][idx]++; + + return b; +} + +static int ac_get_freq(ACoder *ac, unsigned freq, int *result) +{ + uint32_t new_high; + + if (freq == 0) + return -1; + + new_high = ac->high / freq; + ac->high = new_high; + + if (new_high == 0) + return -1; + + *result = (ac->value - ac->low) / new_high; + + return 0; +} + +static int ac_update(ACoder *ac, int freq, int mul) +{ + uint32_t low, high; + + low = ac->low = ac->high * freq + ac->low; + high = ac->high = ac->high * mul; + + while (1) { + if (((high + low) ^ low) > 0xffffff) { + if (high > 0xffff) + return 0; + ac->high = (uint16_t)-(int16_t)low; + } + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + break; + + ac->value = (ac->value << 8) | bytestream2_get_byteu(&ac->gb); + low = ac->low = ac->low << 8; + high = ac->high = ac->high << 8; + } + + return -1; +} + +static void amdl_update_prob(AdaptiveModel *am, int val, int diff) +{ + am->aprob0 += diff; + if (val <= 0) { + am->prob[0][0] += diff; + } else { + do { + am->prob[0][val] += diff; + val += (val & -val); + } while (val < am->buf_size); + } +} + +static void update_ch_subobj(AdaptiveModel *am) +{ + int idx2, idx = am->buf_size - 1; + + if (idx >= 0) { + do { + uint16_t *prob = am->prob[0]; + int diff, prob_idx = prob[idx]; + + idx2 = idx - 1; + if (idx > 0) { + int idx3 = idx - 1; + + if ((idx2 & idx) != idx2) { + do { + prob_idx -= prob[idx3]; + idx3 &= idx3 - 1; + } while ((idx2 & idx) != idx3); + } + } + + diff = ((prob_idx > 0) - prob_idx) >> 1; + amdl_update_prob(am, idx, diff); + idx--; + } while (idx2 >= 0); + } + + if (am->sum < 8000) + am->sum += 200; + + am->aprob1 = (am->aprob1 + 1) >> 1; +} + +static int amdl_decode_int(AdaptiveModel *am, ACoder *ac, unsigned *dst, unsigned size) +{ + unsigned freq, size2, val, mul; + int j; + + size = FFMIN(size, am->buf_size - 1); + + if (am->aprob0 >= am->sum) + update_ch_subobj(am); + + if (am->aprob1 && (am->total == am->buf_size || + ac_decode_bool(ac, am->aprob0, am->aprob1) == 0)) { + if (am->total <= 1) { + dst[0] = am->last; + amdl_update_prob(am, dst[0], 1); + return 0; + } + if (size == am->buf_size - 1) { + freq = am->aprob0; + } else { + freq = am->prob[0][0]; + for (int j = size; j > 0; j &= (j - 1) ) + freq += am->prob[0][j]; + } + ac_get_freq(ac, freq, &freq); + size2 = am->buf_size >> 1; + val = am->prob[0][0]; + if (freq >= val) { + int sum = 0; + for (j = freq - val; size2; size2 >>= 1) { + unsigned v = am->prob[0][size2 + sum]; + if (j >= v) { + sum += size2; + j -= v; + } + } + freq -= j; + val = sum + 1; + } else { + freq = 0; + val = 0; + } + dst[0] = val; + mul = am->prob[0][val]; + if (val > 0) { + for (int k = val - 1; (val & (val - 1)) != k; k &= k - 1) + mul -= am->prob[0][k]; + } + ac_update(ac, freq, mul); + amdl_update_prob(am, dst[0], 1); + return 0; + } + am->aprob1++; + if (size == am->buf_size - 1) { + ac_get_freq(ac, am->buf_size - am->total, &val); + } else { + freq = 1; + for (dst[0] = 0; dst[0] < size; dst[0]++) { + if (!am->prob[1][dst[0]]) + freq++; + } + ac_get_freq(ac, freq, &val); + } + freq = 0; + dst[0] = 0; + if (val > 0 && am->buf_size > 0) { + for (dst[0] = 0; dst[0] < size & freq < val; dst[0]++) { + if (!am->prob[1][dst[0]]) + freq++; + } + } + if (am->prob[1][dst[0]]) { + do { + val = dst[0]++; + } while (val + 1 < am->buf_size && am->prob[1][val + 1]); + } + ac_update(ac, freq, 1); + am->prob[1][dst[0]]++; + am->total++; + amdl_update_prob(am, dst[0], 1); + am->last = dst[0]; + + return 0; +} + +static int decode_filt_coeffs(RKAContext *s, ChContext *ctx, ACoder *ac, FiltCoeffs *dst) +{ + unsigned val, bits; + int idx = 0; + + if (amdl_decode_int(ctx->filt_size, ac, &dst->size, 256) < 0) + return -1; + + if (dst->size == 0) + return 0; + + if (amdl_decode_int(ctx->filt_bits, ac, &bits, 10) < 0) + return -1; + + do { + if (((idx == 8) || (idx == 20)) && (0 < bits)) + bits--; + + if (bits > 10) + return -1; + + if (amdl_decode_int(&ctx->coeff_bits[bits], ac, &val, 31) < 0) + return -1; + + if (val == 31) { + ac_get_freq(ac, 65536, &val); + ac_update(ac, val, 1); + } + + if (val == 0) { + dst->coeffs[idx++] = 0; + } else { + unsigned freq = 0; + int sign; + + if (bits > 0) { + ac_get_freq(ac, 1 << bits, &freq); + ac_update(ac, freq, 1); + } + dst->coeffs[idx] = freq + 1 + ((val - 1U) << bits); + sign = decode_bool(ac, ctx, idx); + if (sign < 0) + return -1; + if (sign == 1) + dst->coeffs[idx] = -dst->coeffs[idx]; + idx++; + } + } while (idx < dst->size); + + return 0; +} + +static int ac_dec_bit(ACoder *ac) +{ + uint32_t high, low; + + low = ac->low; + ac->high = high = ac->high >> 1; + if (ac->value - low < high) { + do { + if (((high + low) ^ low) > 0xffffff) { + if (high > 0xffff) + return 0; + ac->high = (uint16_t)-(int16_t)low; + } + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + break; + + ac->value = (ac->value << 8) | bytestream2_get_byteu(&ac->gb); + ac->high = high = ac->high << 8; + ac->low = low = ac->low << 8; + } while (1); + + return -1; + } + ac->low = low = low + high; + do { + if (((high + low) ^ low) > 0xffffff) { + if (high > 0xffff) + return 1; + ac->high = (uint16_t)-(int16_t)low; + } + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + break; + + ac->value = (ac->value << 8) | bytestream2_get_byteu(&ac->gb); + ac->high = high = ac->high << 8; + ac->low = low = ac->low << 8; + } while (1); + + return -1; +} + +static int mdl64_decode(ACoder *ac, Model64 *ctx, int *dst) +{ + int sign, idx, bits; + unsigned val = 0; + + if (ctx->zero[0] + ctx->zero[1] > 4000U) { + ctx->zero[0] = (ctx->zero[0] >> 1) + 1; + ctx->zero[1] = (ctx->zero[1] >> 1) + 1; + } + if (ctx->sign[0] + ctx->sign[1] > 4000U) { + ctx->sign[0] = (ctx->sign[0] >> 1) + 1; + ctx->sign[1] = (ctx->sign[1] >> 1) + 1; + } + sign = ac_decode_bool(ac, ctx->zero[0], ctx->zero[1]); + if (sign == 0) { + ctx->zero[0] += 2; + dst[0] = 0; + return 0; + } else if (sign < 0) { + return -1; + } + + ctx->zero[1] += 2; + sign = ac_decode_bool(ac, ctx->sign[0], ctx->sign[1]); + if (sign < 0) + return -1; + ctx->sign[sign]++; + bits = ctx->bits; + if (bits > 0) { + if (bits < 13) { + ac_get_freq(ac, 1 << bits, &val); + ac_update(ac, val, 1); + } else { + int hbits = bits / 2; + ac_get_freq(ac, 1 << hbits, &val); + ac_update(ac, val, 1); + ac_get_freq(ac, 1 << (ctx->bits - (hbits)), &bits); + ac_update(ac, val, 1); + val += (bits << hbits); + } + } + bits = ctx->size; + idx = 0; + if (bits >= 0) { + do { + uint16_t *val4 = ctx->val4; + int b; + + if (val4[idx] + ctx->val1[idx] > 2000U) { + val4[idx] = (val4[idx] >> 1) + 1; + ctx->val1[idx] = (ctx->val1[idx] >> 1) + 1; + } + b = ac_decode_bool(ac, ctx->val4[idx], ctx->val1[idx]); + if (b == 1) { + ctx->val1[idx] += 4; + break; + } else if (b < 0) { + return -1; + } + ctx->val4[idx] += 4; + idx++; + } while (idx <= ctx->size); + bits = ctx->size; + if (idx <= bits) { + dst[0] = val + 1 + (idx << ctx->bits); + if (sign) + dst[0] = -dst[0]; + return 0; + } + } + bits++; + while (ac_dec_bit(ac) == 0) + bits += 64; + ac_get_freq(ac, 64, &idx); + ac_update(ac, idx, 1); + idx += bits; + dst[0] = val + 1 + (idx << ctx->bits); + if (sign) + dst[0] = -dst[0]; + + 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 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; + + if (ctx->cmode == 0) { + if (amdl_decode_int(&ctx->fshift, ac, &bits, 15) < 0) + return -1; + bits &= 31U; + } + + ret = decode_filt_coeffs(s, ctx, ac, &filt); + if (ret < 0) + return ret; + + if (size < 512) + split = size / 2; + else + split = size >> 4; + + if (size <= 1) + return 0; + + for (int x = 0; x < size;) { + if (amdl_decode_int(&ctx->position, ac, &idx, 10) < 0) + return -1; + + idx = (ctx->pos_idx + idx) % 11; + ctx->pos_idx = idx; + + for (int y = 0; y < FFMIN(split, size - x); y++, off++) { + int midx, shift = idx, *src, sum = 16; + + if (off >= FF_ARRAY_ELEMS(ctx->buf0)) + return -1; + + midx = FFABS(last_val) >> shift; + if (midx >= 15) { + mdl64 = &ctx->mdl64[3][idx]; + } else if (midx >= 7) { + mdl64 = &ctx->mdl64[2][idx]; + } else if (midx >= 4) { + mdl64 = &ctx->mdl64[1][idx]; + } else { + mdl64 = &ctx->mdl64[0][idx]; + } + ret = mdl64_decode(ac, mdl64, &val); + if (ret < 0) + return -1; + last_val = val; + src = &ctx->buf1[off + -1]; + for (int i = 0; i < filt.size && i < 15; i++) + sum += filt.coeffs[i] * (unsigned)src[-i]; + sum = sum * 2U; + for (int i = 15; i < filt.size; i++) + sum += filt.coeffs[i] * (unsigned)src[-i]; + sum = sum >> 6; + if (ctx->cmode == 0) { + if (bits == 0) { + ctx->buf1[off] = sum + val; + } else { + ctx->buf1[off] = (val + (sum >> bits)) * (1 << bits) + + (((1U << bits) - 1U) & ctx->buf1[off + -1]); + } + ctx->buf0[off] = ctx->buf1[off] + ctx->buf0[off + -1]; + } else { + val *= 1 << ctx->cmode; + sum += ctx->buf0[off + -1] + val; + switch (s->bps) { + case 16: sum = av_clip_int16(sum); break; + case 8: sum = av_clip_int8(sum); break; + } + ctx->buf1[off] = sum - ctx->buf0[off + -1]; + ctx->buf0[off] = sum; + m += FFABS(ctx->buf1[off]); + } + } + if (ctx->cmode2 != 0) { + int sum = 0; + for (int i = (m << 6) / split; i > 0; i = i >> 1) + sum++; + sum = sum - (ctx->cmode2 + 7); + ctx->cmode = FFMAX(sum, tab[ctx->cmode2]); + } + + x += split; + } + + return 0; +} + +static int decode_samples(AVCodecContext *avctx, ACoder *ac, ChContext *ctx, int offset) +{ + RKAContext *s = avctx->priv_data; + int segment_size, offset2, mode, ret; + + ret = amdl_decode_int(&ctx->nb_segments, ac, &mode, 5); + if (ret < 0) + return ret; + + if (mode == 5) { + ret = ac_get_freq(ac, ctx->srate_pad >> 2, &segment_size); + if (ret < 0) + return ret; + ac_update(ac, segment_size, 1); + segment_size *= 4; + ret = decode_filter(s, ctx, ac, offset, segment_size); + if (ret < 0) + return ret; + } else { + segment_size = ctx->srate_pad; + + if (mode) { + if (mode > 2) { + ret = decode_filter(s, ctx, ac, offset, segment_size / 4); + if (ret < 0) + return ret; + offset2 = segment_size / 4 + offset; + ret = decode_filter(s, ctx, ac, offset2, segment_size / 4); + if (ret < 0) + return ret; + offset2 = segment_size / 4 + offset2; + } else { + ret = decode_filter(s, ctx, ac, offset, segment_size / 2); + if (ret < 0) + return ret; + offset2 = segment_size / 2 + offset; + } + if (mode & 1) { + ret = decode_filter(s, ctx, ac, offset2, segment_size / 2); + if (ret < 0) + return ret; + } else { + ret = decode_filter(s, ctx, ac, offset2, segment_size / 4); + if (ret < 0) + return ret; + ret = decode_filter(s, ctx, ac, segment_size / 4 + offset2, segment_size / 4); + if (ret < 0) + return ret; + } + } else { + ret = decode_filter(s, ctx, ac, offset, ctx->srate_pad); + if (ret < 0) + return ret; + } + } + + return segment_size; +} + +static int decode_ch_samples(AVCodecContext *avctx, ChContext *c) +{ + RKAContext *s = avctx->priv_data; + ACoder *ac = &s->ac; + int nb_decoded = 0; + + if (bytestream2_get_bytes_left(&ac->gb) <= 0) + return 0; + + memmove(c->buf0, &c->buf0[c->last_nb_decoded], 2560 * sizeof(*c->buf0)); + memmove(c->buf1, &c->buf1[c->last_nb_decoded], 2560 * sizeof(*c->buf1)); + + nb_decoded = decode_samples(avctx, ac, c, 2560); + if (nb_decoded < 0) + return nb_decoded; + c->last_nb_decoded = nb_decoded; + + return nb_decoded; +} + +static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) +{ + RKAContext *s = avctx->priv_data; + ACoder *ac = &s->ac; + int ret; + + bytestream2_init(&ac->gb, avpkt->data, avpkt->size); + init_acoder(ac); + + for (int ch = 0; ch < s->channels; ch++) { + ret = chctx_init(s, &s->ch[ch], avctx->sample_rate, + avctx->bits_per_raw_sample); + if (ret < 0) + return ret; + } + + frame->nb_samples = s->frame_samples; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + if (s->channels == 2 && s->correlated) { + int16_t *l16 = (int16_t *)frame->extended_data[0]; + int16_t *r16 = (int16_t *)frame->extended_data[1]; + uint8_t *l8 = frame->extended_data[0]; + uint8_t *r8 = frame->extended_data[1]; + + for (int n = 0; n < frame->nb_samples;) { + ret = decode_ch_samples(avctx, &s->ch[0]); + if (ret == 0) { + frame->nb_samples = n; + break; + } + if (ret < 0 || n + ret > frame->nb_samples) + return AVERROR_INVALIDDATA; + + ret = decode_ch_samples(avctx, &s->ch[1]); + if (ret == 0) { + frame->nb_samples = n; + break; + } + if (ret < 0 || n + ret > frame->nb_samples) + return AVERROR_INVALIDDATA; + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_S16P: + for (int i = 0; i < ret; i++) { + int l = s->ch[0].buf0[2560 + i]; + int r = s->ch[1].buf0[2560 + i]; + + l16[n + i] = (l * 2 + r + 1) >> 1; + r16[n + i] = (l * 2 - r + 1) >> 1; + } + break; + case AV_SAMPLE_FMT_U8P: + for (int i = 0; i < ret; i++) { + int l = s->ch[0].buf0[2560 + i]; + int r = s->ch[1].buf0[2560 + i]; + + l8[n + i] = ((l * 2 + r + 1) >> 1) + 0x7f; + r8[n + i] = ((l * 2 - r + 1) >> 1) + 0x7f; + } + break; + default: + return AVERROR_INVALIDDATA; + } + + n += ret; + } + } else { + for (int n = 0; n < frame->nb_samples;) { + for (int ch = 0; ch < s->channels; ch++) { + int16_t *m16 = (int16_t *)frame->data[ch]; + uint8_t *m8 = frame->data[ch]; + + ret = decode_ch_samples(avctx, &s->ch[ch]); + if (ret == 0) { + frame->nb_samples = n; + break; + } + + if (ret < 0 || n + ret > frame->nb_samples) + return AVERROR_INVALIDDATA; + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_S16P: + for (int i = 0; i < ret; i++) { + int m = s->ch[ch].buf0[2560 + i]; + + m16[n + i] = m; + } + break; + case AV_SAMPLE_FMT_U8P: + for (int i = 0; i < ret; i++) { + int m = s->ch[ch].buf0[2560 + i]; + + m8[n + i] = m + 0x7f; + } + break; + default: + return AVERROR_INVALIDDATA; + } + } + + n += ret; + } + } + + *got_frame_ptr = 1; + + return avpkt->size; +} + +static av_cold int rka_decode_close(AVCodecContext *avctx) +{ + RKAContext *s = avctx->priv_data; + + for (int ch = 0; ch < 2; ch++) { + ChContext *c = &s->ch[ch]; + + for (int i = 0; i < 11; i++) + adaptive_model_free(&c->coeff_bits[i]); + + adaptive_model_free(&c->position); + adaptive_model_free(&c->nb_segments); + adaptive_model_free(&c->fshift); + } + + adaptive_model_free(&s->filt_size); + adaptive_model_free(&s->filt_bits); + + return 0; +} + +const FFCodec ff_rka_decoder = { + .p.name = "rka", + CODEC_LONG_NAME("RKA (RK Audio)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_RKA, + .priv_data_size = sizeof(RKAContext), + .init = rka_decode_init, + .close = rka_decode_close, + FF_CODEC_DECODE_CB(rka_decode_frame), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rkmppdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rkmppdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rkmppdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rkmppdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -563,7 +563,7 @@ RKMPP_DEC_CLASS(NAME) \ const FFCodec ff_##NAME##_rkmpp_decoder = { \ .p.name = #NAME "_rkmpp", \ - .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (rkmpp)"), \ + CODEC_LONG_NAME(#NAME " (rkmpp)"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = ID, \ .priv_data_size = sizeof(RKMPPDecodeContext), \ @@ -578,6 +578,7 @@ .hw_configs = rkmpp_hw_configs, \ .bsfs = BSFS, \ .p.wrapper_name = "rkmpp", \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \ }; RKMPP_DEC(h264, AV_CODEC_ID_H264, "h264_mp4toannexb") diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl2.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,8 +26,6 @@ * @see http://wiki.multimedia.cx/index.php?title=RL2 */ -#include -#include #include #include "libavutil/internal.h" @@ -35,7 +33,7 @@ #include "libavutil/mem.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr count, palette @@ -59,25 +57,27 @@ * @param video_base offset of the rle data inside the frame */ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, - uint8_t *out, int stride, int video_base) + uint8_t *out, ptrdiff_t stride, int video_base) { int base_x = video_base % s->avctx->width; int base_y = video_base / s->avctx->width; - int stride_adj = stride - s->avctx->width; - int i; + ptrdiff_t stride_adj = stride - s->avctx->width; const uint8_t *back_frame = s->back_frame; const uint8_t *in_end = in + size; - const uint8_t *out_end = out + stride * s->avctx->height; + const uint8_t *out_end = out + stride * s->avctx->height - stride_adj; uint8_t *line_end; /** copy start of the background frame */ - for (i = 0; i <= base_y; i++) { - if (s->back_frame) + if (s->back_frame) { + for (int i = 0; i <= base_y; i++) { memcpy(out, back_frame, s->avctx->width); - out += stride; - back_frame += s->avctx->width; + out += stride; + back_frame += s->avctx->width; + } + back_frame += base_x - s->avctx->width; + } else { + out += stride * (base_y + 1); } - back_frame += base_x - s->avctx->width; line_end = out - stride_adj; out += base_x - stride; @@ -91,32 +91,47 @@ len = *in++; if (!len) break; + val &= 0x7F; } - if (len >= out_end - out) - break; - - if (s->back_frame) + if (back_frame) { + if (!val) { + do { + size_t copy = FFMIN(line_end - out, len); + memcpy(out, back_frame, copy); + out += copy; + back_frame += copy; + len -= copy; + if (out == line_end) { + if (out == out_end) + return; + out += stride_adj; + line_end += stride; + } + } while (len > 0); + continue; + } + back_frame += len; val |= 0x80; - else - val &= ~0x80; + } while (len--) { - *out++ = (val == 0x80) ? *back_frame : val; - back_frame++; + *out++ = val; if (out == line_end) { - out += stride_adj; - line_end += stride; - if (len >= out_end - out) - break; + if (out == out_end) + return; + out += stride_adj; + line_end += stride; } } } /** copy the rest from the background frame */ if (s->back_frame) { - while (out < out_end) { + while (1) { memcpy(out, back_frame, line_end - out); + if (line_end == out_end) + break; back_frame += line_end - out; out = line_end + stride_adj; line_end += stride; @@ -167,7 +182,9 @@ back_size = avctx->extradata_size - EXTRADATA1_SIZE; if (back_size > 0) { - uint8_t *back_frame = av_mallocz(avctx->width*avctx->height); + /* The 254 are padding to ensure that pointer arithmetic stays within + * the buffer. */ + uint8_t *back_frame = av_mallocz(avctx->width * avctx->height + 254); if (!back_frame) return AVERROR(ENOMEM); rl2_rle_decode(s, avctx->extradata + EXTRADATA1_SIZE, back_size, @@ -219,7 +236,7 @@ const FFCodec ff_rl2_decoder = { .p.name = "rl2", - .p.long_name = NULL_IF_CONFIG_SMALL("RL2 video"), + CODEC_LONG_NAME("RL2 video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RL2, .priv_data_size = sizeof(Rl2Context), @@ -227,5 +244,4 @@ .close = rl2_decode_end, FF_CODEC_DECODE_CB(rl2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,23 @@ #include "rl.h" +av_cold void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], + int n) +{ + memset(index_run, n, MAX_RUN + 1); + for (int i = 0; i < n; i++) { + int run = table_run[i]; + int level = table_level[i]; + if (index_run[run] == n) + index_run[run] = i; + if (level > max_level[run]) + max_level[run] = level; + } +} + av_cold void ff_rl_init(RLTable *rl, uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rl.h 2023-03-03 13:29:59.000000000 +0000 @@ -49,6 +49,16 @@ } RLTable; /** + * Initialize max_level and index_run from table_run and table_level; + * this is equivalent to initializing RLTable.max_level[0] and + * RLTable.index_run[0] with ff_rl_init(). + */ +void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], int n); + +/** * Initialize index_run, max_level and max_run from n, last, table_vlc, * table_run and table_level. * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqaudioenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqaudioenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqaudioenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqaudioenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -174,7 +174,7 @@ /* Write the actual samples */ for (i = 0; i < data_size; i++) - *out++ = dpcm_predict(&context->lastSample[i & 1], *in++); + *out++ = dpcm_predict(&context->lastSample[(i & 1) & stereo], *in++); avpkt->pts = context->input_frames <= 7 ? context->first_pts : frame->pts; avpkt->duration = data_size / channels; @@ -189,7 +189,7 @@ const FFCodec ff_roq_dpcm_encoder = { .p.name = "roq_dpcm", - .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"), + CODEC_LONG_NAME("id RoQ DPCM"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ROQ_DPCM, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, @@ -199,5 +199,4 @@ .close = roq_dpcm_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,12 +26,11 @@ */ #include "libavutil/avassert.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "roqvideo.h" static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) @@ -235,7 +234,7 @@ const FFCodec ff_roq_decoder = { .p.name = "roqvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), + CODEC_LONG_NAME("id RoQ video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ROQ, .priv_data_size = sizeof(RoqContext), @@ -243,5 +242,5 @@ .close = roq_decode_end, FF_CODEC_DECODE_CB(roq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideoenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideoenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideoenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/roqvideoenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -64,7 +64,6 @@ #include "codec_internal.h" #include "elbg.h" #include "encode.h" -#include "internal.h" #include "mathops.h" #define CHROMA_BIAS 1 @@ -1120,9 +1119,10 @@ const FFCodec ff_roq_encoder = { .p.name = "roqvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), + CODEC_LONG_NAME("id RoQ video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ROQ, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(RoqEncContext), .init = roq_encode_init, FF_CODEC_ENCODE_CB(roq_encode_frame), @@ -1130,5 +1130,5 @@ .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE }, .p.priv_class = &roq_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpza.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpza.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpza.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpza.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,15 +35,12 @@ */ #include -#include -#include -#include #include "libavutil/internal.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct RpzaContext { @@ -288,7 +285,7 @@ const FFCodec ff_rpza_decoder = { .p.name = "rpza", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), + CODEC_LONG_NAME("QuickTime video (RPZA)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RPZA, .priv_data_size = sizeof(RpzaContext), @@ -296,5 +293,4 @@ .close = rpza_decode_end, FF_CODEC_DECODE_CB(rpza_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpzaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpzaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpzaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rpzaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -80,11 +80,12 @@ int block_index; uint16_t start; int rowstride; + int prev_rowstride; int blocks_per_row; int total_blocks; } BlockInfo; -static void get_colors(uint8_t *min, uint8_t *max, uint8_t color4[4][3]) +static void get_colors(const uint8_t *min, const uint8_t *max, uint8_t color4[4][3]) { uint8_t step; @@ -113,7 +114,7 @@ } /* Fill BlockInfo struct with information about a 4x4 block of the image */ -static int get_block_info(BlockInfo *bi, int block) +static int get_block_info(BlockInfo *bi, int block, int prev_frame) { bi->row = block / bi->blocks_per_row; bi->col = block % bi->blocks_per_row; @@ -132,10 +133,10 @@ bi->block_height = 4; } - return block ? (bi->col * 4) + (bi->row * bi->rowstride * 4) : 0; + return block ? (bi->col * 4) + (bi->row * (prev_frame ? bi->prev_rowstride : bi->rowstride) * 4) : 0; } -static uint16_t rgb24_to_rgb555(uint8_t *rgb24) +static uint16_t rgb24_to_rgb555(const uint8_t *rgb24) { uint16_t rgb555 = 0; uint32_t r, g, b; @@ -154,7 +155,7 @@ /* * Returns the total difference between two 24 bit color values */ -static int diff_colors(uint8_t *colorA, uint8_t *colorB) +static int diff_colors(const uint8_t *colorA, const uint8_t *colorB) { int tot; @@ -168,7 +169,7 @@ /* * Returns the maximum channel difference */ -static int max_component_diff(uint16_t *colorA, uint16_t *colorB) +static int max_component_diff(const uint16_t *colorA, const uint16_t *colorB) { int diff, max = 0; @@ -192,7 +193,7 @@ * color values. Put the minimum value in min, maximum in max and the channel * in chan. */ -static void get_max_component_diff(BlockInfo *bi, uint16_t *block_ptr, +static void get_max_component_diff(const BlockInfo *bi, const uint16_t *block_ptr, uint8_t *min, uint8_t *max, channel_offset *chan) { int x, y; @@ -205,7 +206,7 @@ // loop thru and compare pixels for (y = 0; y < bi->block_height; y++) { - for (x = 0; x < bi->block_width; x++){ + for (x = 0; x < bi->block_width; x++) { // TODO: optimize min_r = FFMIN(R(block_ptr[x]), min_r); min_g = FFMIN(G(block_ptr[x]), min_g); @@ -242,7 +243,8 @@ * blocks is greater than the thresh parameter. Returns -1 if difference * exceeds threshold or zero otherwise. */ -static int compare_blocks(uint16_t *block1, uint16_t *block2, BlockInfo *bi, int thresh) +static int compare_blocks(const uint16_t *block1, const uint16_t *block2, + const BlockInfo *bi, int thresh) { int x, y, diff = 0; for (y = 0; y < bi->block_height; y++) { @@ -252,7 +254,7 @@ return -1; } } - block1 += bi->rowstride; + block1 += bi->prev_rowstride; block2 += bi->rowstride; } return 0; @@ -262,7 +264,7 @@ * Determine the fit of one channel to another within a 4x4 block. This * is used to determine the best palette choices for 4-color encoding. */ -static int leastsquares(uint16_t *block_ptr, BlockInfo *bi, +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) { @@ -277,7 +279,7 @@ return -1; for (i = 0; i < bi->block_height; i++) { - for (j = 0; j < bi->block_width; j++){ + for (j = 0; j < bi->block_width; j++) { x = GET_CHAN(block_ptr[j], xchannel); y = GET_CHAN(block_ptr[j], ychannel); sumx += x; @@ -315,7 +317,7 @@ /* * Determine the amount of error in the leastsquares fit. */ -static int calc_lsq_max_fit_error(uint16_t *block_ptr, BlockInfo *bi, +static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi, int min, int max, int tmp_min, int tmp_max, channel_offset xchannel, channel_offset ychannel) { @@ -324,7 +326,7 @@ int max_err = 0; for (i = 0; i < bi->block_height; i++) { - for (j = 0; j < bi->block_width; j++){ + for (j = 0; j < bi->block_width; j++) { int x_inc, lin_y, lin_x; x = GET_CHAN(block_ptr[j], xchannel); y = GET_CHAN(block_ptr[j], ychannel); @@ -356,7 +358,7 @@ /* * Find the closest match to a color within the 4-color palette */ -static int match_color(uint16_t *color, uint8_t colors[4][3]) +static int match_color(const uint16_t *color, uint8_t colors[4][3]) { int ret = 0; int smallest_variance = INT_MAX; @@ -383,12 +385,14 @@ * blocks encoded (until we implement multi-block 4 color runs this will * always be 1) */ -static int encode_four_color_block(uint8_t *min_color, uint8_t *max_color, - PutBitContext *pb, uint16_t *block_ptr, BlockInfo *bi) +static int encode_four_color_block(const uint8_t *min_color, const uint8_t *max_color, + PutBitContext *pb, const uint16_t *block_ptr, const BlockInfo *bi) { - int x, y, idx; + const int y_size = FFMIN(4, bi->image_height - bi->row * 4); + const int x_size = FFMIN(4, bi->image_width - bi->col * 4); uint8_t color4[4][3]; uint16_t rounded_max, rounded_min; + int idx; // round min and max wider rounded_min = rgb24_to_rgb555(min_color); @@ -402,13 +406,21 @@ get_colors(min_color, max_color, color4); - for (y = 0; y < 4; y++) { - for (x = 0; x < 4; x++) { + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < x_size; x++) { idx = match_color(&block_ptr[x], color4); put_bits(pb, 2, idx); } + + for (int x = x_size; x < 4; x++) + put_bits(pb, 2, idx); block_ptr += bi->rowstride; } + + for (int y = y_size; y < 4; y++) { + for (int x = 0; x < 4; x++) + put_bits(pb, 2, 0); + } return 1; // num blocks encoded } @@ -419,9 +431,12 @@ uint16_t *dest_pixels, const BlockInfo *bi, int block_counter) { - for (int y = 0; y < 4; y++) { - memcpy(dest_pixels, src_pixels, 8); - dest_pixels += bi->rowstride; + const int y_size = FFMIN(4, bi->image_height - bi->row * 4); + const int x_size = FFMIN(4, bi->image_width - bi->col * 4) * 2; + + for (int y = 0; y < y_size; y++) { + memcpy(dest_pixels, src_pixels, x_size); + dest_pixels += bi->prev_rowstride; src_pixels += bi->rowstride; } } @@ -441,7 +456,7 @@ * the statistics of this block. Otherwise, the stats are unchanged * and don't include the current block. */ -static int update_block_stats(RpzaContext *s, BlockInfo *bi, uint16_t *block, +static int update_block_stats(RpzaContext *s, const BlockInfo *bi, const uint16_t *block, uint8_t min_color[3], uint8_t max_color[3], int *total_rgb, int *total_pixels, uint8_t avg_color[3], int first_block) @@ -553,6 +568,7 @@ int total_blocks; int prev_block_offset; int block_offset = 0; + int pblock_offset = 0; uint8_t min = 0, max = 0; channel_offset chan; int i; @@ -562,7 +578,7 @@ int pixel_count; uint8_t min_color[3], max_color[3]; double slope, y_intercept, correlation_coef; - uint16_t *src_pixels = (uint16_t *)pict->data[0]; + const uint16_t *src_pixels = (const uint16_t *)pict->data[0]; uint16_t *prev_pixels = (uint16_t *)s->prev_frame->data[0]; /* Number of 4x4 blocks in frame. */ @@ -571,6 +587,7 @@ bi.image_width = s->frame_width; bi.image_height = s->frame_height; bi.rowstride = pict->linesize[0] / 2; + bi.prev_rowstride = s->prev_frame->linesize[0] / 2; bi.blocks_per_row = (s->frame_width + 3) / 4; @@ -583,8 +600,8 @@ prev_block_offset = 0; while (n_blocks < 32 && block_counter + n_blocks < total_blocks) { - - block_offset = get_block_info(&bi, block_counter + n_blocks); + block_offset = get_block_info(&bi, block_counter + n_blocks, 0); + pblock_offset = get_block_info(&bi, block_counter + n_blocks, 1); // multi-block opcodes cannot span multiple rows. // If we're starting a new row, break out and write the opcode @@ -599,7 +616,7 @@ prev_block_offset = block_offset; - if (compare_blocks(&prev_pixels[block_offset], + if (compare_blocks(&prev_pixels[pblock_offset], &src_pixels[block_offset], &bi, s->skip_frame_thresh) != 0) { // write out skipable blocks if (n_blocks) { @@ -620,7 +637,7 @@ */ // update_block_in_prev_frame(&src_pixels[block_offset], - // &prev_pixels[block_offset], &bi, block_counter + n_blocks); + // &prev_pixels[pblock_offset], &bi, block_counter + n_blocks); n_blocks++; } @@ -636,7 +653,8 @@ } } else { - block_offset = get_block_info(&bi, block_counter); + block_offset = get_block_info(&bi, block_counter, 0); + pblock_offset = get_block_info(&bi, block_counter, 1); } post_skip : @@ -650,11 +668,12 @@ /* update this block in the previous frame buffer */ update_block_in_prev_frame(&src_pixels[block_offset], - &prev_pixels[block_offset], &bi, block_counter + n_blocks); + &prev_pixels[pblock_offset], &bi, block_counter + n_blocks); // check for subsequent blocks with the same color while (n_blocks < 32 && block_counter + n_blocks < total_blocks) { - block_offset = get_block_info(&bi, block_counter + n_blocks); + block_offset = get_block_info(&bi, block_counter + n_blocks, 0); + pblock_offset = get_block_info(&bi, block_counter + n_blocks, 1); // multi-block opcodes cannot span multiple rows. // If we've hit end of a row, break out and write the opcode @@ -672,7 +691,7 @@ /* update this block in the previous frame buffer */ update_block_in_prev_frame(&src_pixels[block_offset], - &prev_pixels[block_offset], &bi, block_counter + n_blocks); + &prev_pixels[pblock_offset], &bi, block_counter + n_blocks); n_blocks++; } @@ -728,15 +747,17 @@ } if (err > s->sixteen_color_thresh) { // DO SIXTEEN COLOR BLOCK - uint16_t *row_ptr; - int rgb555; + const uint16_t *row_ptr; + int y_size, rgb555; - block_offset = get_block_info(&bi, block_counter); + block_offset = get_block_info(&bi, block_counter, 0); + pblock_offset = get_block_info(&bi, block_counter, 1); row_ptr = &src_pixels[block_offset]; + y_size = FFMIN(4, bi.image_height - bi.row * 4); - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 4; x++){ + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < 4; x++) { rgb555 = row_ptr[x] & ~0x8000; put_bits(&s->pb, 16, rgb555); @@ -744,6 +765,11 @@ row_ptr += bi.rowstride; } + for (int y = y_size; y < 4; y++) { + for (int x = 0; x < 4; x++) + put_bits(&s->pb, 16, 0); + } + block_counter++; } else { // FOUR COLOR BLOCK block_counter += encode_four_color_block(min_color, max_color, @@ -752,7 +778,7 @@ /* update this block in the previous frame buffer */ update_block_in_prev_frame(&src_pixels[block_offset], - &prev_pixels[block_offset], &bi, block_counter); + &prev_pixels[pblock_offset], &bi, block_counter); } } } @@ -772,12 +798,11 @@ } static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt, - const AVFrame *frame, int *got_packet) + const AVFrame *pict, int *got_packet) { RpzaContext *s = avctx->priv_data; - const AVFrame *pict = frame; uint8_t *buf; - int ret = ff_alloc_packet(avctx, pkt, 6LL * avctx->height * avctx->width); + int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * avctx->height * avctx->width); if (ret < 0) return ret; @@ -845,15 +870,15 @@ const FFCodec ff_rpza_encoder = { .p.name = "rpza", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), + CODEC_LONG_NAME("QuickTime video (RPZA)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RPZA, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(RpzaContext), .p.priv_class = &rpza_class, .init = rpza_encode_init, FF_CODEC_ENCODE_CB(rpza_encode_frame), .close = rpza_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rscc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rscc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rscc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rscc.c 2023-03-03 13:29:59.000000000 +0000 @@ -45,7 +45,6 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #define TILE_SIZE 8 @@ -364,7 +363,7 @@ const FFCodec ff_rscc_decoder = { .p.name = "rscc", - .p.long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture Codec"), + CODEC_LONG_NAME("innoHeim/Rsupport Screen Capture Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RSCC, .init = rscc_init, @@ -372,6 +371,5 @@ .close = rscc_close, .priv_data_size = sizeof(RsccContext), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,11 +32,11 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "error_resilience.h" #include "h263.h" #include "h263data.h" #include "h263dec.h" -#include "internal.h" #include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" @@ -531,7 +531,7 @@ /* decode each macroblock */ for (s->mb_num_left = mb_count; s->mb_num_left > 0; s->mb_num_left--) { int ret; - ff_update_block_index(s); + ff_update_block_index(s, 8, s->avctx->lowres, 1); ff_tlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y); s->mv_dir = MV_DIR_FORWARD; @@ -603,7 +603,7 @@ int slice_count; const uint8_t *slices_hdr = NULL; - ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size); + ff_dlog(avctx, "*****frame %"PRId64" size=%d\n", avctx->frame_num, buf_size); /* no supplementary picture */ if (buf_size == 0) { @@ -683,7 +683,7 @@ const FFCodec ff_rv10_decoder = { .p.name = "rv10", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), + CODEC_LONG_NAME("RealVideo 1.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV10, .priv_data_size = sizeof(RVDecContext), @@ -691,7 +691,6 @@ .close = rv10_decode_end, FF_CODEC_DECODE_CB(rv10_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -701,7 +700,7 @@ const FFCodec ff_rv20_decoder = { .p.name = "rv20", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), + CODEC_LONG_NAME("RealVideo 2.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV20, .priv_data_size = sizeof(RVDecContext), @@ -709,7 +708,6 @@ .close = rv10_decode_end, FF_CODEC_DECODE_CB(rv10_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = ff_mpeg_flush, .p.max_lowres = 3, .p.pix_fmts = (const enum AVPixelFormat[]) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "put_bits.h" #include "rv10enc.h" -int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number) +int ff_rv10_encode_picture_header(MpegEncContext *s) { int full_frame= 0; @@ -67,14 +67,15 @@ const FFCodec ff_rv10_encoder = { .p.name = "rv10", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), + CODEC_LONG_NAME("RealVideo 1.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV10, .p.priv_class = &ff_mpv_enc_class, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv10enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "mpegvideo.h" -int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number); -void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number); +int ff_rv10_encode_picture_header(MpegEncContext *s); +void ff_rv20_encode_picture_header(MpegEncContext *s); #endif /* AVCODEC_RV10ENC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv20enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv20enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv20enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv20enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,12 +34,12 @@ #include "put_bits.h" #include "rv10enc.h" -void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){ +void ff_rv20_encode_picture_header(MpegEncContext *s) { put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ? put_bits(&s->pb, 1, 0); /* unknown bit */ put_bits(&s->pb, 5, s->qscale); - put_sbits(&s->pb, 8, picture_number); //FIXME wrong, but correct is not known + put_sbits(&s->pb, 8, s->picture_number); //FIXME wrong, but correct is not known s->mb_x= s->mb_y= 0; ff_h263_encode_mba(s); @@ -64,14 +64,15 @@ const FFCodec ff_rv20_encoder = { .p.name = "rv20", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), + CODEC_LONG_NAME("RealVideo 2.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV20, .p.priv_class = &ff_mpv_enc_class, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv30.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv30.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv30.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv30.c 2023-03-03 13:29:59.000000000 +0000 @@ -293,7 +293,7 @@ const FFCodec ff_rv30_decoder = { .p.name = "rv30", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"), + CODEC_LONG_NAME("RealVideo 3.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV30, .priv_data_size = sizeof(RV34DecContext), @@ -307,7 +307,6 @@ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv34.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv34.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv34.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv34.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,15 +29,14 @@ #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" -#include "libavutil/video_enc_params.h" #include "avcodec.h" +#include "decode.h" #include "error_resilience.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "golomb.h" -#include "internal.h" #include "mathops.h" #include "mpeg_er.h" #include "qpeldsp.h" @@ -703,7 +702,7 @@ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) { /* wait for the referenced mb row to be finished */ int mb_row = s->mb_y + ((yoff + my + 5 + 8 * height) >> 4); - ThreadFrame *f = dir ? &s->next_picture_ptr->tf : &s->last_picture_ptr->tf; + const ThreadFrame *f = dir ? &s->next_picture_ptr->tf : &s->last_picture_ptr->tf; ff_thread_await_progress(f, mb_row, 0); } @@ -1445,7 +1444,7 @@ ff_init_block_index(s); while(!check_slice_end(r, s)) { - ff_update_block_index(s); + ff_update_block_index(s, 8, 0, 1); if(r->si.type) res = rv34_decode_inter_macroblock(r, r->intra_types + s->mb_x * 4 + 4); @@ -1569,7 +1568,7 @@ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); - if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { + if (s->pict_type == AV_PICTURE_TYPE_B) { if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) return ret; ff_print_debug_info(s, s->current_picture_ptr, pict); @@ -1614,7 +1613,7 @@ /* no supplementary picture */ if (buf_size == 0) { /* special case for last picture */ - if (s->low_delay==0 && s->next_picture_ptr) { + if (s->next_picture_ptr) { if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) return ret; s->next_picture_ptr = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40.c 2023-03-03 13:29:59.000000000 +0000 @@ -576,7 +576,7 @@ const FFCodec ff_rv40_decoder = { .p.name = "rv40", - .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 4.0"), + CODEC_LONG_NAME("RealVideo 4.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RV40, .priv_data_size = sizeof(RV34DecContext), @@ -590,7 +590,6 @@ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context), + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/rv40dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -292,7 +292,7 @@ #define RV40_CHROMA_MC(OPNAME, OP)\ static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst /*align 8*/,\ - uint8_t *src /*align 1*/,\ + const uint8_t *src /*align 1*/,\ ptrdiff_t stride, int h, int x, int y)\ {\ const int A = (8-x) * (8-y);\ @@ -328,7 +328,7 @@ }\ \ static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/,\ - uint8_t *src/*align 1*/,\ + const uint8_t *src/*align 1*/,\ ptrdiff_t stride, int h, int x, int y)\ {\ const int A = (8-x) * (8-y);\ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302m.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302m.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302m.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302m.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,7 @@ #include "libavutil/reverse.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" -#include "mathops.h" +#include "decode.h" #define AES3_HEADER_LEN 4 @@ -229,7 +228,7 @@ const FFCodec ff_s302m_decoder = { .p.name = "s302m", - .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), + CODEC_LONG_NAME("SMPTE 302M"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_S302M, .p.priv_class = &s302m_class, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302menc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302menc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302menc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/s302menc.c 2023-03-03 13:29:59.000000000 +0000 @@ -172,11 +172,12 @@ const FFCodec ff_s302m_encoder = { .p.name = "s302m", - .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), + CODEC_LONG_NAME("SMPTE 302M"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_S302M, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | - AV_CODEC_CAP_VARIABLE_FRAME_SIZE, + AV_CODEC_CAP_VARIABLE_FRAME_SIZE | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(S302MEncContext), .init = s302m_encode_init, FF_CODEC_ENCODE_CB(s302m_encode2_frame), @@ -184,10 +185,4 @@ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]) { 48000, 0 }, - /* .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX, - 0 }, */ - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/samidec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/samidec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/samidec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/samidec.c 2023-03-03 13:29:59.000000000 +0000 @@ -182,7 +182,7 @@ const FFCodec ff_sami_decoder = { .p.name = "sami", - .p.long_name = NULL_IF_CONFIG_SMALL("SAMI subtitle"), + CODEC_LONG_NAME("SAMI subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SAMI, .priv_data_size = sizeof(SAMIContext), @@ -190,5 +190,4 @@ .close = sami_close, FF_CODEC_DECODE_SUB_CB(sami_decode_frame), .flush = sami_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sanm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sanm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sanm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sanm.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,14 +21,12 @@ */ #include "libavutil/avassert.h" -#include "libavutil/bswap.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "copy_block.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define NGLYPHS 256 #define GLYPH_COORD_VECT_SIZE 16 @@ -1518,7 +1516,7 @@ const FFCodec ff_sanm_decoder = { .p.name = "sanm", - .p.long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/Smush video"), + CODEC_LONG_NAME("LucasArts SANM/Smush video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SANM, .priv_data_size = sizeof(SANMVideoContext), @@ -1526,5 +1524,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" @@ -343,9 +343,6 @@ SBCDecContext *sbc = avctx->priv_data; int ret, frame_length; - if (!sbc) - return AVERROR(EIO); - frame_length = sbc_unpack_frame(avpkt->data, &sbc->frame, avpkt->size); if (frame_length <= 0) return frame_length; @@ -367,18 +364,14 @@ const FFCodec ff_sbc_decoder = { .p.name = "sbc", - .p.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), + CODEC_LONG_NAME("SBC (low-complexity subband codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SBC, .priv_data_size = sizeof(SBCDecContext), .init = sbc_decode_init, FF_CODEC_DECODE_CB(sbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -345,18 +345,15 @@ const FFCodec ff_sbc_encoder = { .p.name = "sbc", - .p.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), + CODEC_LONG_NAME("SBC (low-complexity subband codec)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SBC, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SBCEncContext), .init = sbc_encode_init, FF_CODEC_ENCODE_CB(sbc_encode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, 0}, -#endif + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #define USE_FIXED 0 #include "aac.h" -#include "config.h" #include "libavutil/attributes.h" #include "libavutil/intfloat.h" #include "sbrdsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp_fixed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp_fixed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp_fixed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp_fixed.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,6 @@ #define USE_FIXED 1 #include "aac.h" -#include "config.h" #include "libavutil/attributes.h" #include "libavutil/intfloat.h" #include "sbrdsp.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbrdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include #include "aac_defines.h" -#include "libavutil/softfloat.h" typedef struct SBRDSPContext { void (*sum64x5)(INTFLOAT *z); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbr.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbr.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbr.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sbr.h 2023-03-03 13:29:59.000000000 +0000 @@ -32,8 +32,8 @@ #include #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" -#include "fft.h" #include "aacps.h" #include "sbrdsp.h" @@ -211,8 +211,10 @@ AAC_FLOAT s_m[7][48]; AAC_FLOAT gain[7][48]; DECLARE_ALIGNED(32, INTFLOAT, qmf_filter_scratch)[5][64]; - FFTContext mdct_ana; - FFTContext mdct; + AVTXContext *mdct_ana; + av_tx_fn mdct_ana_fn; + AVTXContext *mdct; + av_tx_fn mdct_fn; SBRDSPContext dsp; AACSBRContext c; }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr3.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,6 @@ #include "avcodec.h" #include "bytestream.h" -#include "internal.h" #include "scpr.h" static void renew_table3(uint32_t nsym, uint32_t *cntsum, @@ -1168,6 +1167,9 @@ int run, bx = x * 16 + sx1, by = y * 16 + sy1; uint32_t clr, ptype = 0, r, g, b; + if (bx >= avctx->width) + return AVERROR_INVALIDDATA; + for (; by < y * 16 + sy2 && by < avctx->height;) { ret = decode_value3(s, 5, &s->op_model3[ptype].cntsum, s->op_model3[ptype].freqs[0], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/scpr.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,14 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "scpr.h" #include "scpr3.h" @@ -460,6 +458,9 @@ int run, bx = x * 16 + sx1, by = y * 16 + sy1; uint32_t r, g, b, clr, ptype = 0; + if (bx >= avctx->width) + return AVERROR_INVALIDDATA; + for (; by < y * 16 + sy2 && by < avctx->height;) { ret = decode_value(s, s->op_model[ptype], 6, 1000, &ptype); if (ret < 0) @@ -669,7 +670,7 @@ const FFCodec ff_scpr_decoder = { .p.name = "scpr", - .p.long_name = NULL_IF_CONFIG_SMALL("ScreenPressor"), + CODEC_LONG_NAME("ScreenPressor"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SCPR, .priv_data_size = sizeof(SCPRContext), @@ -677,6 +678,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/screenpresso.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/screenpresso.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/screenpresso.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/screenpresso.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,7 +34,6 @@ */ #include -#include #include #include "libavutil/imgutils.h" @@ -43,7 +42,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct ScreenpressoContext { AVFrame *current; @@ -185,7 +184,7 @@ const FFCodec ff_screenpresso_decoder = { .p.name = "screenpresso", - .p.long_name = NULL_IF_CONFIG_SMALL("Screenpresso"), + CODEC_LONG_NAME("Screenpresso"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SCREENPRESSO, .init = screenpresso_init, @@ -193,6 +192,5 @@ .close = screenpresso_close, .priv_data_size = sizeof(ScreenpressoContext), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sei.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sei.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sei.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sei.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ // The content of the payload data depends on the standard, though // many generic parts have the same interpretation everywhere (such as // mastering-display-colour-volume and user-data-unregistered). -enum { +enum SEIType { SEI_TYPE_BUFFERING_PERIOD = 0, SEI_TYPE_PIC_TIMING = 1, SEI_TYPE_PAN_SCAN_RECT = 2, @@ -137,4 +137,21 @@ SEI_TYPE_SAMPLE_ASPECT_RATIO_INFO = 204, }; +/** + * frame_packing_arrangement types. H.265 and H.274 use only 3..5 + * with all the other values being reserved. H.264 uses a few more values + * that are prefixed with SEI_FPA_H264 in the enum below. + * + * The semantics of the common values are the same for all standards. + */ +typedef enum { + SEI_FPA_H264_TYPE_CHECKERBOARD = 0, + SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN = 1, + SEI_FPA_H264_TYPE_INTERLEAVE_ROW = 2, + SEI_FPA_TYPE_SIDE_BY_SIDE = 3, + SEI_FPA_TYPE_TOP_BOTTOM = 4, + SEI_FPA_TYPE_INTERLEAVE_TEMPORAL = 5, + SEI_FPA_H264_TYPE_2D = 6, +} SEIFpaType; + #endif /* AVCODEC_SEI_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sga.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sga.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sga.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sga.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "get_bits.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define PALDATA_FOLLOWS_TILEDATA 4 #define HAVE_COMPRESSED_TILEMAP 32 @@ -521,7 +521,7 @@ const FFCodec ff_sga_decoder = { .p.name = "sga", - .p.long_name = NULL_IF_CONFIG_SMALL("Digital Pictures SGA Video"), + CODEC_LONG_NAME("Digital Pictures SGA Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGA_VIDEO, .priv_data_size = sizeof(SGAVideoContext), @@ -529,5 +529,4 @@ FF_CODEC_DECODE_CB(sga_decode_frame), .close = sga_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgidec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgidec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgidec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgidec.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,106 +19,91 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "sgi.h" -typedef struct SgiState { - AVCodecContext *avctx; - unsigned int width; - unsigned int height; - unsigned int depth; - unsigned int bytes_per_channel; - int linesize; - GetByteContext g; -} SgiState; - /** * Expand an RLE row into a channel. - * @param s the current image state + * @param logctx a logcontext * @param out_buf Points to one line after the output buffer. - * @param len length of out_buf in bytes - * @param pixelstride pixel stride of input buffer - * @return size of output in bytes, else return error code. + * @param g GetByteContext used to read input from + * @param width length of out_buf in nb of elements + * @return nb of elements written, else return error code. */ -static int expand_rle_row8(SgiState *s, uint8_t *out_buf, - int len, int pixelstride) +static int expand_rle_row8(void *logctx, uint8_t *out_buf, + GetByteContext *g, unsigned width) { unsigned char pixel, count; unsigned char *orig = out_buf; - uint8_t *out_end = out_buf + len; + uint8_t *out_end = out_buf + width; while (out_buf < out_end) { - if (bytestream2_get_bytes_left(&s->g) < 1) + if (bytestream2_get_bytes_left(g) < 1) return AVERROR_INVALIDDATA; - pixel = bytestream2_get_byteu(&s->g); + pixel = bytestream2_get_byteu(g); if (!(count = (pixel & 0x7f))) { break; } /* Check for buffer overflow. */ - if (out_end - out_buf <= pixelstride * (count - 1)) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n"); + if (out_end - out_buf < count) { + av_log(logctx, AV_LOG_ERROR, "Invalid pixel count.\n"); return AVERROR_INVALIDDATA; } if (pixel & 0x80) { - while (count--) { - *out_buf = bytestream2_get_byte(&s->g); - out_buf += pixelstride; - } + while (count--) + *out_buf++ = bytestream2_get_byte(g); } else { - pixel = bytestream2_get_byte(&s->g); + pixel = bytestream2_get_byte(g); - while (count--) { - *out_buf = pixel; - out_buf += pixelstride; - } + while (count--) + *out_buf++ = pixel; } } - return (out_buf - orig) / pixelstride; + return out_buf - orig; } -static int expand_rle_row16(SgiState *s, uint16_t *out_buf, - int len, int pixelstride) +static int expand_rle_row16(void *logctx, uint16_t *out_buf, + GetByteContext *g, unsigned width) { unsigned short pixel; unsigned char count; unsigned short *orig = out_buf; - uint16_t *out_end = out_buf + len; + uint16_t *out_end = out_buf + width; while (out_buf < out_end) { - if (bytestream2_get_bytes_left(&s->g) < 2) + if (bytestream2_get_bytes_left(g) < 2) return AVERROR_INVALIDDATA; - pixel = bytestream2_get_be16u(&s->g); + pixel = bytestream2_get_be16u(g); if (!(count = (pixel & 0x7f))) break; /* Check for buffer overflow. */ - if (out_end - out_buf <= pixelstride * (count - 1)) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n"); + if (out_end - out_buf < count) { + av_log(logctx, AV_LOG_ERROR, "Invalid pixel count.\n"); return AVERROR_INVALIDDATA; } if (pixel & 0x80) { while (count--) { - pixel = bytestream2_get_ne16(&s->g); + pixel = bytestream2_get_ne16(g); AV_WN16A(out_buf, pixel); - out_buf += pixelstride; + out_buf++; } } else { - pixel = bytestream2_get_ne16(&s->g); + pixel = bytestream2_get_ne16(g); while (count--) { AV_WN16A(out_buf, pixel); - out_buf += pixelstride; + out_buf++; } } } - return (out_buf - orig) / pixelstride; + return out_buf - orig; } @@ -128,33 +113,34 @@ * @param s the current image state * @return 0 if no error, else return error code. */ -static int read_rle_sgi(uint8_t *out_buf, SgiState *s) +static int read_rle_sgi(void *logctx, uint8_t *out[4], ptrdiff_t stride[4], + GetByteContext *g, unsigned width, int height, + unsigned nb_components, unsigned bytes_per_channel) { - uint8_t *dest_row; - unsigned int len = s->height * s->depth * 4; - GetByteContext g_table = s->g; - unsigned int y, z; + unsigned int len = height * nb_components * 4; + GetByteContext g_table = *g; unsigned int start_offset; - int linesize, ret; + int ret; /* size of RLE offset and length tables */ - if (len * 2 > bytestream2_get_bytes_left(&s->g)) { + if (len * 2 > bytestream2_get_bytes_left(g)) { return AVERROR_INVALIDDATA; } - for (z = 0; z < s->depth; z++) { - dest_row = out_buf; - for (y = 0; y < s->height; y++) { - linesize = s->width * s->depth; - dest_row -= s->linesize; + for (unsigned z = 0; z < nb_components; z++) { + uint8_t *dest_row = out[z] + (height - 1) * stride[z]; + while (1) { start_offset = bytestream2_get_be32(&g_table); - bytestream2_seek(&s->g, start_offset, SEEK_SET); - if (s->bytes_per_channel == 1) - ret = expand_rle_row8(s, dest_row + z, linesize, s->depth); + bytestream2_seek(g, start_offset, SEEK_SET); + if (bytes_per_channel == 1) + ret = expand_rle_row8(logctx, dest_row, g, width); else - ret = expand_rle_row16(s, (uint16_t *)dest_row + z, linesize, s->depth); - if (ret != s->width) + ret = expand_rle_row16(logctx, (uint16_t *)dest_row, g, width); + if (ret != width) return AVERROR_INVALIDDATA; + if (dest_row == out[z]) + break; + dest_row -= stride[z]; } } return 0; @@ -166,34 +152,23 @@ * @param s the current image state * @return 0 if read success, else return error code. */ -static int read_uncompressed_sgi(unsigned char *out_buf, SgiState *s) +static int read_uncompressed_sgi(uint8_t *const out[4], const ptrdiff_t stride[4], + GetByteContext *g, unsigned width, int height, + unsigned nb_components, unsigned bytes_per_channel) { - int x, y, z; - unsigned int offset = s->height * s->width * s->bytes_per_channel; - GetByteContext gp[4]; - uint8_t *out_end; + unsigned rowsize = width * bytes_per_channel; /* Test buffer size. */ - if (offset * s->depth > bytestream2_get_bytes_left(&s->g)) + if (rowsize * (int64_t)height * nb_components > bytestream2_get_bytes_left(g)) return AVERROR_INVALIDDATA; - /* Create a reader for each plane */ - for (z = 0; z < s->depth; z++) { - gp[z] = s->g; - bytestream2_skip(&gp[z], z * offset); - } - - for (y = s->height - 1; y >= 0; y--) { - out_end = out_buf + (y * s->linesize); - if (s->bytes_per_channel == 1) { - for (x = s->width; x > 0; x--) - for (z = 0; z < s->depth; z++) - *out_end++ = bytestream2_get_byteu(&gp[z]); - } else { - uint16_t *out16 = (uint16_t *)out_end; - for (x = s->width; x > 0; x--) - for (z = 0; z < s->depth; z++) - *out16++ = bytestream2_get_ne16u(&gp[z]); + for (unsigned z = 0; z < nb_components; z++) { + uint8_t *cur_row = out[z] + (height - 1) * stride[z]; + while (1) { + bytestream2_get_bufferu(g, cur_row, rowsize); + if (cur_row == out[z]) + break; + cur_row -= stride[z]; } } return 0; @@ -202,31 +177,33 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - SgiState *s = avctx->priv_data; - unsigned int dimension, rle; + GetByteContext g; + unsigned int bytes_per_channel, nb_components, dimension, rle, width; + uint8_t *out[4]; + ptrdiff_t linesize[4]; + int height; int ret = 0; - uint8_t *out_buf, *out_end; - bytestream2_init(&s->g, avpkt->data, avpkt->size); - if (bytestream2_get_bytes_left(&s->g) < SGI_HEADER_SIZE) { + bytestream2_init(&g, avpkt->data, avpkt->size); + if (bytestream2_get_bytes_left(&g) < SGI_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "buf_size too small (%d)\n", avpkt->size); return AVERROR_INVALIDDATA; } /* Test for SGI magic. */ - if (bytestream2_get_be16u(&s->g) != SGI_MAGIC) { + if (bytestream2_get_be16u(&g) != SGI_MAGIC) { av_log(avctx, AV_LOG_ERROR, "bad magic number\n"); return AVERROR_INVALIDDATA; } - rle = bytestream2_get_byteu(&s->g); - s->bytes_per_channel = bytestream2_get_byteu(&s->g); - dimension = bytestream2_get_be16u(&s->g); - s->width = bytestream2_get_be16u(&s->g); - s->height = bytestream2_get_be16u(&s->g); - s->depth = bytestream2_get_be16u(&s->g); + rle = bytestream2_get_byteu(&g); + bytes_per_channel = bytestream2_get_byteu(&g); + dimension = bytestream2_get_be16u(&g); + width = bytestream2_get_be16u(&g); + height = bytestream2_get_be16u(&g); + nb_components = bytestream2_get_be16u(&g); - if (s->bytes_per_channel != 1 && s->bytes_per_channel != 2) { + if (bytes_per_channel != 1 && bytes_per_channel != 2) { av_log(avctx, AV_LOG_ERROR, "wrong channel number\n"); return AVERROR_INVALIDDATA; } @@ -237,38 +214,51 @@ return AVERROR_INVALIDDATA; } - if (s->depth == SGI_GRAYSCALE) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8; - } else if (s->depth == SGI_RGB) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24; - } else if (s->depth == SGI_RGBA) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGBA64BE : AV_PIX_FMT_RGBA; + if (nb_components == SGI_GRAYSCALE) { + avctx->pix_fmt = bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8; + } else if (nb_components == SGI_RGB) { + avctx->pix_fmt = bytes_per_channel == 2 ? AV_PIX_FMT_GBRP16BE : AV_PIX_FMT_GBRP; + } else if (nb_components == SGI_RGBA) { + avctx->pix_fmt = bytes_per_channel == 2 ? AV_PIX_FMT_GBRAP16BE : AV_PIX_FMT_GBRAP; } else { av_log(avctx, AV_LOG_ERROR, "wrong picture format\n"); return AVERROR_INVALIDDATA; } - ret = ff_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, width, height); if (ret < 0) return ret; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; + switch (nb_components) { +#define MAP(in_idx, out_idx) \ + out[(in_idx)] = p->data[(out_idx)]; \ + linesize[(in_idx)] = p->linesize[(out_idx)] + case SGI_GRAYSCALE: + MAP(0, 0); + break; + case SGI_RGBA: + MAP(3, 3); + /* fallthrough */ + case SGI_RGB: + MAP(0, 2); + MAP(1, 0); + MAP(2, 1); + break; + } p->pict_type = AV_PICTURE_TYPE_I; p->key_frame = 1; - out_buf = p->data[0]; - - out_end = out_buf + p->linesize[0] * s->height; - - s->linesize = p->linesize[0]; /* Skip header. */ - bytestream2_seek(&s->g, SGI_HEADER_SIZE, SEEK_SET); + bytestream2_seek(&g, SGI_HEADER_SIZE, SEEK_SET); if (rle) { - ret = read_rle_sgi(out_end, s); + ret = read_rle_sgi(avctx, out, linesize, &g, + width, height, nb_components, bytes_per_channel); } else { - ret = read_uncompressed_sgi(out_buf, s); + ret = read_uncompressed_sgi(out, linesize, &g, + width, height, nb_components, bytes_per_channel); } if (ret) return ret; @@ -277,23 +267,11 @@ return avpkt->size; } -static av_cold int sgi_decode_init(AVCodecContext *avctx) -{ - SgiState *s = avctx->priv_data; - - s->avctx = avctx; - - return 0; -} - const FFCodec ff_sgi_decoder = { .p.name = "sgi", - .p.long_name = NULL_IF_CONFIG_SMALL("SGI image"), + CODEC_LONG_NAME("SGI image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGI, - .priv_data_size = sizeof(SgiState), FF_CODEC_DECODE_CB(decode_frame), - .init = sgi_decode_init, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgienc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgienc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgienc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgienc.c 2023-03-03 13:29:59.000000000 +0000 @@ -96,7 +96,7 @@ SgiContext *s = avctx->priv_data; const AVFrame * const p = frame; PutByteContext pbc; - uint8_t *in_buf, *encode_buf; + uint8_t *encode_buf; int x, y, z, length, tablesize, ret, i; unsigned int width, height, depth, dimension; unsigned int bytes_per_channel, pixmax, put_be; @@ -200,7 +200,7 @@ return AVERROR(ENOMEM); for (z = 0; z < depth; z++) { - in_buf = p->data[0] + p->linesize[0] * (height - 1) + z * bytes_per_channel; + const uint8_t *in_buf = p->data[0] + p->linesize[0] * (height - 1) + z * bytes_per_channel; for (y = 0; y < height; y++) { bytestream2_put_be32(&taboff_pcb, bytestream2_tell_p(&pbc)); @@ -231,7 +231,7 @@ av_free(encode_buf); } else { for (z = 0; z < depth; z++) { - in_buf = p->data[0] + p->linesize[0] * (height - 1) + z * bytes_per_channel; + const uint8_t *in_buf = p->data[0] + p->linesize[0] * (height - 1) + z * bytes_per_channel; for (y = 0; y < height; y++) { for (x = 0; x < width * depth; x += depth) @@ -272,9 +272,10 @@ const FFCodec ff_sgi_encoder = { .p.name = "sgi", - .p.long_name = NULL_IF_CONFIG_SMALL("SGI image"), + CODEC_LONG_NAME("SGI image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGI, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SgiContext), .p.priv_class = &sgi_class, .init = encode_init, @@ -286,5 +287,4 @@ AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgirledec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgirledec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgirledec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sgirledec.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int sgirle_decode_init(AVCodecContext *avctx) { @@ -133,11 +133,10 @@ const FFCodec ff_sgirle_decoder = { .p.name = "sgirle", - .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics RLE 8-bit video"), + CODEC_LONG_NAME("Silicon Graphics RLE 8-bit video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGIRLE, .init = sgirle_decode_init, FF_CODEC_DECODE_CB(sgirle_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sheervideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sheervideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sheervideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sheervideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -2000,7 +2000,7 @@ const FFCodec ff_sheervideo_decoder = { .p.name = "sheervideo", - .p.long_name = NULL_IF_CONFIG_SMALL("BitJazz SheerVideo"), + CODEC_LONG_NAME("BitJazz SheerVideo"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SHEERVIDEO, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/shorten.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/shorten.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/shorten.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/shorten.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,9 +30,9 @@ #include "bswapdsp.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "golomb.h" -#include "internal.h" #define MAX_CHANNELS 8 #define MAX_BLOCKSIZE 65535 @@ -805,7 +805,7 @@ const FFCodec ff_shorten_decoder = { .p.name = "shorten", - .p.long_name = NULL_IF_CONFIG_SMALL("Shorten"), + CODEC_LONG_NAME("Shorten"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SHORTEN, .priv_data_size = sizeof(ShortenContext), @@ -819,5 +819,4 @@ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,8 +35,11 @@ printf("SINETABLE("#size") = {\n"); \ write_int32_t_array(sine_ ## size ## _fixed, size); \ printf("};\n") + PRINT_TABLE(120); PRINT_TABLE(128); + PRINT_TABLE(480); PRINT_TABLE(512); + PRINT_TABLE(960); PRINT_TABLE(1024); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sinewin_fixed_tablegen.h 2023-03-03 13:29:59.000000000 +0000 @@ -44,8 +44,11 @@ #include "libavutil/attributes.h" #define SINETABLE_CONST +SINETABLE( 120); SINETABLE( 128); +SINETABLE( 480); SINETABLE( 512); +SINETABLE( 960); SINETABLE(1024); #define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) @@ -59,8 +62,11 @@ static av_cold void init_sine_windows_fixed(void) { + sine_window_init_fixed(sine_120_fixed, 120); sine_window_init_fixed(sine_128_fixed, 128); + sine_window_init_fixed(sine_480_fixed, 480); sine_window_init_fixed(sine_512_fixed, 512); + sine_window_init_fixed(sine_960_fixed, 960); sine_window_init_fixed(sine_1024_fixed, 1024); } #endif /* CONFIG_HARDCODED_TABLES */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sipr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sipr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sipr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sipr.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,8 +32,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "lsp.h" #include "acelp_vectors.h" #include "acelp_pitch_delay.h" @@ -564,12 +564,11 @@ const FFCodec ff_sipr_decoder = { .p.name = "sipr", - .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"), + CODEC_LONG_NAME("RealAudio SIPR / ACELP.NET"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SIPR, .priv_data_size = sizeof(SiprContext), .init = sipr_decoder_init, FF_CODEC_DECODE_CB(sipr_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/siren.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/siren.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/siren.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/siren.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,9 +28,8 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" -#include "mathops.h" static const uint8_t index_table[8] = {4, 4, 3, 3, 2, 2, 1, 0}; static const uint8_t vector_dimension[8] = { 2, 2, 2, 4, 4, 5, 5, 1 }; @@ -721,8 +720,8 @@ if ((ret = init_get_bits(gb, avpkt->data, bits_per_frame)) < 0) return ret; } else - if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) - return ret; + if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) + return ret; skip_bits(gb, s->sample_rate_bits); @@ -843,7 +842,7 @@ const FFCodec ff_siren_decoder = { .p.name = "siren", - .p.long_name = NULL_IF_CONFIG_SMALL("Siren"), + CODEC_LONG_NAME("Siren"), .priv_data_size = sizeof(SirenContext), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SIREN, @@ -853,13 +852,12 @@ .flush = siren_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_msnsiren_decoder = { .p.name = "msnsiren", - .p.long_name = NULL_IF_CONFIG_SMALL("MSN Siren"), + CODEC_LONG_NAME("MSN Siren"), .priv_data_size = sizeof(SirenContext), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_MSNSIREN, @@ -869,6 +867,5 @@ .flush = siren_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smacker.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smacker.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smacker.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smacker.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,7 @@ * Based on http://wiki.multimedia.cx/index.php?title=Smacker */ -#include -#include +#include #include "libavutil/channel_layout.h" @@ -51,9 +50,8 @@ #define BITSTREAM_READER_LE #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" -#include "mathops.h" typedef struct SmackVContext { AVCodecContext *avctx; @@ -744,7 +742,7 @@ const FFCodec ff_smacker_decoder = { .p.name = "smackvid", - .p.long_name = NULL_IF_CONFIG_SMALL("Smacker video"), + CODEC_LONG_NAME("Smacker video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SMACKVIDEO, .priv_data_size = sizeof(SmackVContext), @@ -752,16 +750,15 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_smackaud_decoder = { .p.name = "smackaud", - .p.long_name = NULL_IF_CONFIG_SMALL("Smacker audio"), + CODEC_LONG_NAME("Smacker audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SMACKAUDIO, .init = smka_decode_init, FF_CODEC_DECODE_CB(smka_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,16 +28,12 @@ * The SMC decoder outputs PAL8 colorspace data. */ -#include -#include #include -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #define CPAIR 2 #define CQUAD 4 @@ -50,8 +46,6 @@ AVCodecContext *avctx; AVFrame *frame; - GetByteContext gb; - /* SMC color tables */ uint8_t color_pairs[COLORS_PER_TABLE * CPAIR]; uint8_t color_quads[COLORS_PER_TABLE * CQUAD]; @@ -79,9 +73,8 @@ } \ } -static int smc_decode_stream(SmcContext *s) +static int smc_decode_stream(SmcContext *s, GetByteContext *gb) { - GetByteContext *gb = &s->gb; int width = s->avctx->width; int height = s->avctx->height; int stride = s->frame->linesize[0]; @@ -434,20 +427,20 @@ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SmcContext *s = avctx->priv_data; + GetByteContext gb; int ret; int total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4); if (total_blocks / 1024 > avpkt->size) return AVERROR_INVALIDDATA; - bytestream2_init(&s->gb, buf, buf_size); - if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; s->frame->palette_has_changed = ff_copy_palette(s->pal, avpkt, avctx); - ret = smc_decode_stream(s); + bytestream2_init(&gb, buf, buf_size); + ret = smc_decode_stream(s, &gb); if (ret < 0) return ret; @@ -470,7 +463,7 @@ const FFCodec ff_smc_decoder = { .p.name = "smc", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), + CODEC_LONG_NAME("QuickTime Graphics (SMC)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SMC, .priv_data_size = sizeof(SmcContext), @@ -478,5 +471,4 @@ .close = smc_decode_end, FF_CODEC_DECODE_CB(smc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/smcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -57,10 +57,13 @@ { \ for (int block = 0; block < nb_blocks && pixel_ptr && row_ptr; block++) { \ pixel_ptr += 4; \ + cur_x += 4; \ if (pixel_ptr - row_ptr >= width) \ { \ row_ptr += stride * 4; \ pixel_ptr = row_ptr; \ + cur_y += 4; \ + cur_x = 0; \ } \ } \ } @@ -113,25 +116,24 @@ PutByteContext *pb) { const uint8_t *src_pixels = (const uint8_t *)frame->data[0]; - const int stride = frame->linesize[0]; + const ptrdiff_t stride = frame->linesize[0]; const uint8_t *prev_pixels = (const uint8_t *)s->prev_frame->data[0]; + const ptrdiff_t prev_stride = s->prev_frame->linesize[0]; uint8_t *distinct_values = s->distinct_values; const uint8_t *pixel_ptr, *row_ptr; + const int height = frame->height; const int width = frame->width; - uint8_t block_values[16]; int block_counter = 0; int color_pair_index = 0; int color_quad_index = 0; int color_octet_index = 0; int color_table_index; /* indexes to color pair, quad, or octet tables */ int total_blocks; - - memset(s->color_pairs, 0, sizeof(s->color_pairs)); - memset(s->color_quads, 0, sizeof(s->color_quads)); - memset(s->color_octets, 0, sizeof(s->color_octets)); + int cur_y = 0; + int cur_x = 0; /* Number of 4x4 blocks in frame. */ - total_blocks = ((frame->width + 3) / 4) * ((frame->height + 3) / 4); + total_blocks = ((width + 3) / 4) * ((height + 3) / 4); pixel_ptr = row_ptr = src_pixels; @@ -145,15 +147,18 @@ int cache_index; int distinct = 0; int blocks = 0; + int frame_y = cur_y; + int frame_x = cur_x; while (prev_pixels && s->key_frame == 0 && block_counter + inter_skip_blocks < total_blocks) { + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); int compare = 0; - for (int y = 0; y < 4; y++) { - const ptrdiff_t offset = pixel_ptr - src_pixels; - const uint8_t *prev_pixel_ptr = prev_pixels + offset; + for (int y = 0; y < y_size; y++) { + const uint8_t *prev_pixel_ptr = prev_pixels + (y + cur_y) * prev_stride + cur_x; - compare |= memcmp(prev_pixel_ptr + y * stride, pixel_ptr + y * stride, 4); + compare |= !!memcmp(prev_pixel_ptr, pixel_ptr + y * stride, x_size); if (compare) break; } @@ -161,27 +166,31 @@ if (compare) break; + inter_skip_blocks++; if (inter_skip_blocks >= 256) break; - inter_skip_blocks++; ADVANCE_BLOCK(pixel_ptr, row_ptr, 1) } pixel_ptr = xpixel_ptr; row_ptr = xrow_ptr; + cur_y = frame_y; + cur_x = frame_x; while (block_counter > 0 && block_counter + intra_skip_blocks < total_blocks) { - const ptrdiff_t offset = pixel_ptr - src_pixels; + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); + const ptrdiff_t offset = xpixel_ptr - src_pixels; const int sy = offset / stride; const int sx = offset % stride; const int ny = sx < 4 ? sy - 4 : sy; - const int nx = sx < 4 ? width - 4 : sx - 4; + const int nx = sx < 4 ? width - 4 + (width & 3) : sx - 4; const uint8_t *old_pixel_ptr = src_pixels + nx + ny * stride; int compare = 0; - for (int y = 0; y < 4; y++) { - compare |= memcmp(old_pixel_ptr + y * stride, pixel_ptr + y * stride, 4); + for (int y = 0; y < y_size; y++) { + compare |= !!memcmp(old_pixel_ptr + y * stride, pixel_ptr + y * stride, x_size); if (compare) break; } @@ -189,21 +198,28 @@ if (compare) break; + intra_skip_blocks++; if (intra_skip_blocks >= 256) break; - intra_skip_blocks++; + ADVANCE_BLOCK(pixel_ptr, row_ptr, 1) } pixel_ptr = xpixel_ptr; row_ptr = xrow_ptr; + cur_y = frame_y; + cur_x = frame_x; while (block_counter + coded_blocks < total_blocks && coded_blocks < 256) { - for (int y = 0; y < 4; y++) - memcpy(block_values + y * 4, pixel_ptr + y * stride, 4); + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); + const int nb_elements = x_size * y_size; + uint8_t block_values[16] = { 0 }; + for (int y = 0; y < y_size; y++) + memcpy(block_values + y * x_size, pixel_ptr + y * stride, x_size); - qsort(block_values, 16, sizeof(block_values[0]), smc_cmp_values); - s->next_nb_distinct = count_distinct_items(block_values, s->next_distinct_values, 16); + qsort(block_values, nb_elements, sizeof(block_values[0]), smc_cmp_values); + s->next_nb_distinct = count_distinct_items(block_values, s->next_distinct_values, nb_elements); if (coded_blocks == 0) { memcpy(distinct_values, s->next_distinct_values, sizeof(s->distinct_values)); s->nb_distinct = s->next_nb_distinct; @@ -216,42 +232,48 @@ s->mono_value = block_values[0]; coded_distinct = s->nb_distinct; - ADVANCE_BLOCK(pixel_ptr, row_ptr, 1) coded_blocks++; if (coded_distinct > 1 && coded_blocks >= 16) break; + + ADVANCE_BLOCK(pixel_ptr, row_ptr, 1) } pixel_ptr = xpixel_ptr; row_ptr = xrow_ptr; + cur_y = frame_y; + cur_x = frame_x; - blocks = coded_blocks; + blocks = coded_distinct <= 8 ? coded_blocks : 0; distinct = coded_distinct; - if (intra_skip_blocks > 0 && intra_skip_blocks >= inter_skip_blocks && - intra_skip_blocks > 0) { + if (intra_skip_blocks >= blocks && intra_skip_blocks >= inter_skip_blocks) { distinct = 17; blocks = intra_skip_blocks; } if (intra_skip_blocks > 16 && intra_skip_blocks >= inter_skip_blocks && - intra_skip_blocks > 0) { + intra_skip_blocks >= blocks) { distinct = 18; blocks = intra_skip_blocks; } - if (inter_skip_blocks > 0 && inter_skip_blocks > intra_skip_blocks && - inter_skip_blocks > 0) { + if (inter_skip_blocks >= blocks && inter_skip_blocks > intra_skip_blocks) { distinct = 19; blocks = inter_skip_blocks; } if (inter_skip_blocks > 16 && inter_skip_blocks > intra_skip_blocks && - inter_skip_blocks > 0) { + inter_skip_blocks >= blocks) { distinct = 20; blocks = inter_skip_blocks; } + if (blocks == 0) { + blocks = coded_blocks; + distinct = coded_distinct; + } + switch (distinct) { case 1: if (blocks <= 16) { @@ -292,15 +314,18 @@ } for (int i = 0; i < blocks; i++) { + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); uint8_t value = s->color_pairs[color_table_index][1]; uint16_t flags = 0; int shift = 15; - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 4; x++) { + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < x_size; x++) { flags |= (value == pixel_ptr[x + y * stride]) << shift; shift--; } + shift -= 4 - x_size; } bytestream2_put_be16(pb, flags); @@ -340,6 +365,8 @@ } for (int i = 0; i < blocks; i++) { + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); uint32_t flags = 0; uint8_t quad[4]; int shift = 30; @@ -347,8 +374,8 @@ for (int k = 0; k < 4; k++) quad[k] = s->color_quads[color_table_index][k]; - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 4; x++) { + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < x_size; x++) { int pixel = pixel_ptr[x + y * stride]; uint32_t idx = 0; @@ -362,6 +389,8 @@ flags |= idx << shift; shift -= 2; } + + shift -= 2 * (4 - x_size); } bytestream2_put_be32(pb, flags); @@ -407,6 +436,8 @@ } for (int i = 0; i < blocks; i++) { + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); uint64_t flags = 0; uint8_t octet[8]; int shift = 45; @@ -414,8 +445,8 @@ for (int k = 0; k < 8; k++) octet[k] = s->color_octets[color_table_index][k]; - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 4; x++) { + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < x_size; x++) { int pixel = pixel_ptr[x + y * stride]; uint64_t idx = 0; @@ -429,6 +460,8 @@ flags |= idx << shift; shift -= 3; } + + shift -= 3 * (4 - x_size); } bytestream2_put_be16(pb, ((flags >> 32) & 0xFFF0) | ((flags >> 8) & 0xF)); @@ -441,9 +474,18 @@ default: bytestream2_put_byte(pb, 0xE0 | (blocks - 1)); for (int i = 0; i < blocks; i++) { - for (int y = 0; y < 4; y++) { - for (int x = 0; x < 4; x++) + const int y_size = FFMIN(4, height - cur_y); + const int x_size = FFMIN(4, width - cur_x); + for (int y = 0; y < y_size; y++) { + for (int x = 0; x < x_size; x++) bytestream2_put_byte(pb, pixel_ptr[x + y * stride]); + for (int x = x_size; x < 4; x++) + bytestream2_put_byte(pb, 0); + } + + for (int y = y_size; y < 4; y++) { + for (int x = 0; x < 4; x++) + bytestream2_put_byte(pb, 0); } ADVANCE_BLOCK(pixel_ptr, row_ptr, 1) @@ -500,7 +542,7 @@ return ret; if (avctx->gop_size == 0 || !s->prev_frame->data[0] || - (avctx->frame_number % avctx->gop_size) == 0) { + (avctx->frame_num % avctx->gop_size) == 0) { s->key_frame = 1; } else { s->key_frame = 0; @@ -550,14 +592,14 @@ const FFCodec ff_smc_encoder = { .p.name = "smc", - .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), + CODEC_LONG_NAME("QuickTime Graphics (SMC)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SMC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SMCContext), .init = smc_encode_init, FF_CODEC_ENCODE_CB(smc_encode_frame), .close = smc_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,21 +18,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/intmath.h" #include "libavutil/log.h" -#include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" +#include "decode.h" #include "encode.h" -#include "me_cmp.h" #include "snow_dwt.h" -#include "internal.h" #include "snow.h" #include "snowdata.h" -#include "rangecoder.h" -#include "mathops.h" - void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8){ @@ -359,7 +353,7 @@ } } }else{ - uint8_t *src= s->last_picture[block->ref]->data[plane_index]; + const uint8_t *src = s->last_picture[block->ref]->data[plane_index]; const int scale= plane_index ? (2*s->mv_scale)>>s->chroma_h_shift : 2*s->mv_scale; int mx= block->mx*scale; int my= block->my*scale; @@ -439,7 +433,6 @@ 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_me_cmp_init(&s->mecc, avctx); ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_videodsp_init(&s->vdsp, 8); ff_dwt_init(&s->dwt); @@ -587,72 +580,12 @@ return 0; } -#define USE_HALFPEL_PLANE 0 - -static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *frame){ - int p,x,y; - - for(p=0; p < s->nb_planes; p++){ - int is_chroma= !!p; - int w= is_chroma ? AV_CEIL_RSHIFT(s->avctx->width, s->chroma_h_shift) : s->avctx->width; - int h= is_chroma ? AV_CEIL_RSHIFT(s->avctx->height, s->chroma_v_shift) : s->avctx->height; - int ls= frame->linesize[p]; - uint8_t *src= frame->data[p]; - - halfpel[1][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH)); - halfpel[2][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH)); - halfpel[3][p] = av_malloc_array(ls, (h + 2 * EDGE_WIDTH)); - if (!halfpel[1][p] || !halfpel[2][p] || !halfpel[3][p]) { - av_freep(&halfpel[1][p]); - av_freep(&halfpel[2][p]); - av_freep(&halfpel[3][p]); - return AVERROR(ENOMEM); - } - halfpel[1][p] += EDGE_WIDTH * (1 + ls); - halfpel[2][p] += EDGE_WIDTH * (1 + ls); - halfpel[3][p] += EDGE_WIDTH * (1 + ls); - - halfpel[0][p]= src; - for(y=0; y>5; - } - } - for(y=0; y>5; - } - } - src= halfpel[1][p]; - for(y=0; y>5; - } - } - -//FIXME border! - } - return 0; -} - void ff_snow_release_buffer(AVCodecContext *avctx) { SnowContext *s = avctx->priv_data; - int i; if(s->last_picture[s->max_ref_frames-1]->data[0]){ av_frame_unref(s->last_picture[s->max_ref_frames-1]); - for(i=0; i<9; i++) - if(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3]) { - av_free(s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3] - EDGE_WIDTH*(1+s->current_picture->linesize[i%3])); - s->halfpel_plane[s->max_ref_frames-1][1+i/3][i%3] = NULL; - } } } @@ -665,11 +598,6 @@ tmp= s->last_picture[s->max_ref_frames-1]; for(i=s->max_ref_frames-1; i>0; i--) s->last_picture[i] = s->last_picture[i-1]; - memmove(s->halfpel_plane+1, s->halfpel_plane, (s->max_ref_frames-1)*sizeof(void*)*4*4); - if(USE_HALFPEL_PLANE && s->current_picture->data[0]) { - if((ret = halfpel_interpol(s, s->halfpel_plane[0], s->current_picture)) < 0) - return ret; - } s->last_picture[0] = s->current_picture; s->current_picture = tmp; @@ -707,7 +635,6 @@ s->m.me.temp= NULL; av_freep(&s->m.me.scratchpad); av_freep(&s->m.me.map); - av_freep(&s->m.me.score_map); av_freep(&s->m.sc.obmc_scratchpad); av_freep(&s->block); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -655,14 +655,13 @@ const FFCodec ff_snow_decoder = { .p.name = "snow", - .p.long_name = NULL_IF_CONFIG_SMALL("Snow"), + CODEC_LONG_NAME("Snow"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SNOW, .priv_data_size = sizeof(SnowContext), .init = ff_snow_common_init, .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), - .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.c 2023-03-03 13:29:59.000000000 +0000 @@ -740,7 +740,7 @@ decomposition_count, y); } -static inline int w_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, +static inline int w_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int w, int h, int type) { int s, i, j; @@ -778,10 +778,10 @@ for (i = 0; i < h; i++) { for (j = 0; j < w; j += 4) { - tmp[32 * i + j + 0] = (pix1[j + 0] - pix2[j + 0]) << 4; - tmp[32 * i + j + 1] = (pix1[j + 1] - pix2[j + 1]) << 4; - tmp[32 * i + j + 2] = (pix1[j + 2] - pix2[j + 2]) << 4; - tmp[32 * i + j + 3] = (pix1[j + 3] - pix2[j + 3]) << 4; + tmp[32 * i + j + 0] = (pix1[j + 0] - pix2[j + 0]) * (1 << 4); + tmp[32 * i + j + 1] = (pix1[j + 1] - pix2[j + 1]) * (1 << 4); + tmp[32 * i + j + 2] = (pix1[j + 2] - pix2[j + 2]) * (1 << 4); + tmp[32 * i + j + 3] = (pix1[j + 3] - pix2[j + 3]) * (1 << 4); } pix1 += line_size; pix2 += line_size; @@ -809,32 +809,32 @@ return s >> 9; } -static int w53_8_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +static int w53_8_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 8, h, 1); } -static int w97_8_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +static int w97_8_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 8, h, 0); } -static int w53_16_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +static int w53_16_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 16, h, 1); } -static int w97_16_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +static int w97_16_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 16, h, 0); } -int ff_w53_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +int ff_w53_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 32, h, 1); } -int ff_w97_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h) +int ff_w97_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { return w_c(v, pix1, pix2, line_size, 32, h, 0); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow_dwt.h 2023-03-03 13:29:59.000000000 +0000 @@ -104,8 +104,8 @@ int src_y, int src_stride, slice_buffer *sb, int add, uint8_t *dst8); -int ff_w53_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h); -int ff_w97_32_c(struct MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t line_size, int h); +int ff_w53_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h); +int ff_w97_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h); void ff_spatial_dwt(int *buffer, int *temp, int width, int height, int stride, int type, int decomposition_count); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snowenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" +#include "me_cmp.h" #include "packet_internal.h" #include "snow_dwt.h" #include "snow.h" @@ -66,6 +67,7 @@ if ((ret = ff_snow_common_init(avctx)) < 0) { return ret; } + ff_me_cmp_init(&s->mecc, avctx); ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); ff_snow_alloc_blocks(s); @@ -80,11 +82,11 @@ s->m.me.temp = s->m.me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); - s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); - s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->m.sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); - if (!s->m.me.scratchpad || !s->m.me.map || !s->m.me.score_map || !s->m.sc.obmc_scratchpad) + 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) return AVERROR(ENOMEM); + s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; ff_h263_encode_init(&s->m); //mv_penalty @@ -151,7 +153,7 @@ } //near copy & paste from dsputil, FIXME -static int pix_sum(uint8_t * pix, int line_size, int w, int h) +static int pix_sum(const uint8_t * pix, int line_size, int w, int h) { int s, i, j; @@ -167,7 +169,7 @@ } //near copy & paste from dsputil, FIXME -static int pix_norm1(uint8_t * pix, int line_size, int w) +static int pix_norm1(const uint8_t * pix, int line_size, int w) { int s, i, j; const uint32_t *sq = ff_square_tab + 256; @@ -245,7 +247,7 @@ int l,cr,cb; const int stride= s->current_picture->linesize[0]; const int uvstride= s->current_picture->linesize[1]; - uint8_t *current_data[3]= { s->input_picture->data[0] + (x + y* stride)*block_w, + const uint8_t *const current_data[3] = { s->input_picture->data[0] + (x + y* stride)*block_w, s->input_picture->data[1] + ((x*block_w)>>s->chroma_h_shift) + ((y*uvstride*block_w)>>s->chroma_v_shift), s->input_picture->data[2] + ((x*block_w)>>s->chroma_h_shift) + ((y*uvstride*block_w)>>s->chroma_v_shift)}; int P[10][2]; @@ -508,7 +510,7 @@ const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+s->chroma_h_shift] : ff_obmc_tab[s->block_max_depth]; 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]; - uint8_t *src= s-> input_picture->data[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 const int b_stride = s->b_width << s->block_max_depth; const int w= p->width; @@ -603,7 +605,7 @@ 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]; uint8_t *dst= s->current_picture->data[plane_index]; - uint8_t *src= s-> input_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; uint8_t *cur = s->scratchbuf; uint8_t *tmp = s->emu_edge_buffer; @@ -706,7 +708,7 @@ 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]; uint8_t *dst= s->current_picture->data[plane_index]; - uint8_t *src= s-> input_picture->data[plane_index]; + const uint8_t *src = s->input_picture->data[plane_index]; //FIXME zero_dst is const but add_yblock changes dst if add is 0 (this is never the case for dst=zero_dst // const has only been removed from zero_dst to suppress a warning static IDWTELEM zero_dst[4096]; //FIXME @@ -892,34 +894,23 @@ // encode_subband_dzr(s, b, src, parent, stride, orientation); } -static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){ +static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y, int p[3], + uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) +{ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; - unsigned value; - int rd, index; + int rd; av_assert2(mb_x>=0 && mb_y>=0); av_assert2(mb_xcolor[0] = p[0]; - block->color[1] = p[1]; - block->color[2] = p[2]; - block->type |= BLOCK_INTRA; - }else{ - index= (p[0] + 31*p[1]) & (ME_CACHE_SIZE-1); - value= s->me_cache_generation + (p[0]>>10) + (p[1]<<6) + (block->ref<<12); - if(s->me_cache[index] == value) - return 0; - s->me_cache[index]= value; - - block->mx= p[0]; - block->my= p[1]; - block->type &= ~BLOCK_INTRA; - } + block->color[0] = p[0]; + block->color[1] = p[1]; + block->color[2] = p[2]; + block->type |= BLOCK_INTRA; - rd= get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty * !!intra; + rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty; //FIXME chroma if(rd < *best_rd){ @@ -934,8 +925,35 @@ /* 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){ - int p[2] = {p0, p1}; - return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd); + const int b_stride = s->b_width << s->block_max_depth; + BlockNode *block = &s->block[mb_x + mb_y * b_stride]; + BlockNode backup = *block; + unsigned value; + int rd, index; + + av_assert2(mb_x >= 0 && mb_y >= 0); + 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) + return 0; + s->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); + +//FIXME chroma + if (rd < *best_rd) { + *best_rd = rd; + return 1; + } else { + *block = backup; + return 0; + } } 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){ @@ -1060,7 +1078,7 @@ //skip stuff outside the picture if(mb_x==0 || mb_y==0 || mb_x==b_width-1 || mb_y==b_height-1){ - uint8_t *src= s-> input_picture->data[0]; + const uint8_t *src = s->input_picture->data[0]; uint8_t *dst= s->current_picture->data[0]; const int stride= s->current_picture->linesize[0]; const int block_w= MB_SIZE >> s->block_max_depth; @@ -1092,7 +1110,7 @@ // 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(s, mb_x, mb_y, color0, 1, obmc_edged, &best_rd); + check_block_intra(s, 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); @@ -1150,7 +1168,7 @@ } best_rd= ref_rd; *block= ref_b; - check_block(s, mb_x, mb_y, color, 1, obmc_edged, &best_rd); + check_block_intra(s, 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; @@ -1511,11 +1529,11 @@ coef_sum = (uint64_t)coef_sum * coef_sum >> 16; if(pict->pict_type == AV_PICTURE_TYPE_I){ - s->m.current_picture.mb_var_sum= coef_sum; - s->m.current_picture.mc_mb_var_sum= 0; + s->m.mb_var_sum = coef_sum; + s->m.mc_mb_var_sum = 0; }else{ - s->m.current_picture.mc_mb_var_sum= coef_sum; - s->m.current_picture.mb_var_sum= 0; + s->m.mc_mb_var_sum = coef_sum; + s->m.mb_var_sum = 0; } pict->quality= ff_rate_estimate_qscale(&s->m, 1); @@ -1589,9 +1607,9 @@ pic->pict_type = pict->pict_type; pic->quality = pict->quality; - s->m.picture_number= avctx->frame_number; + s->m.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_number].new_pict_type; + s->m.pict_type = pic->pict_type = s->m.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); @@ -1599,11 +1617,11 @@ return -1; } }else{ - s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0; + 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; } - if(s->pass1_rc && avctx->frame_number == 0) + if(s->pass1_rc && avctx->frame_num == 0) pic->quality = 2*FF_QP2LAMBDA; if (pic->quality) { s->qlog = qscale2qlog(pic->quality); @@ -1798,7 +1816,7 @@ if(s->qlog == LOSSLESS_QLOG){ for(y=0; yspatial_idwt_buffer[y*w + x]<<=FRAC_BITS; + s->spatial_idwt_buffer[y*w + x] *= 1 << FRAC_BITS; } } } @@ -1838,13 +1856,12 @@ ff_snow_release_buffer(avctx); - s->current_picture->coded_picture_number = avctx->frame_number; 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.f->display_picture_number = - s->m.current_picture.f->coded_picture_number = avctx->frame_number; + 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) @@ -1914,9 +1931,10 @@ const FFCodec ff_snow_encoder = { .p.name = "snow", - .p.long_name = NULL_IF_CONFIG_SMALL("Snow"), + CODEC_LONG_NAME("Snow"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SNOW, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SnowContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), @@ -1927,6 +1945,5 @@ AV_PIX_FMT_NONE }, .p.priv_class = &snowenc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/snow.h 2023-03-03 13:29:59.000000000 +0000 @@ -127,7 +127,6 @@ AVFrame *input_picture; ///< new_picture with the internal linesizes AVFrame *current_picture; AVFrame *last_picture[MAX_REF_FRAMES]; - uint8_t *halfpel_plane[MAX_REF_FRAMES][4][4]; AVFrame *mconly_picture; // uint8_t q_context[16]; uint8_t header_state[32]; @@ -487,7 +486,7 @@ } } -static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){ +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, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sonic.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sonic.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sonic.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sonic.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,10 +23,10 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "encode.h" #include "get_bits.h" #include "golomb.h" -#include "internal.h" #include "put_golomb.h" #include "rangecoder.h" @@ -1078,7 +1078,7 @@ const FFCodec ff_sonic_decoder = { .p.name = "sonic", - .p.long_name = NULL_IF_CONFIG_SMALL("Sonic"), + CODEC_LONG_NAME("Sonic"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SONIC, .priv_data_size = sizeof(SonicContext), @@ -1086,22 +1086,23 @@ .close = sonic_decode_close, FF_CODEC_DECODE_CB(sonic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_SONIC_DECODER */ #if CONFIG_SONIC_ENCODER const FFCodec ff_sonic_encoder = { .p.name = "sonic", - .p.long_name = NULL_IF_CONFIG_SMALL("Sonic"), + CODEC_LONG_NAME("Sonic"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SONIC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, FF_CODEC_ENCODE_CB(sonic_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; #endif @@ -1109,15 +1110,16 @@ #if CONFIG_SONIC_LS_ENCODER const FFCodec ff_sonic_ls_encoder = { .p.name = "sonicls", - .p.long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), + CODEC_LONG_NAME("Sonic lossless"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SONIC_LS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, FF_CODEC_ENCODE_CB(sonic_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sp5xdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sp5xdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sp5xdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sp5xdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,21 +32,23 @@ #include "mjpegdec.h" #include "sp5x.h" -int ff_sp5x_process_packet(AVCodecContext *avctx, AVPacket *avpkt) + +static int sp5x_decode_frame(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVBufferRef *buf_recoded; uint8_t *recoded; int i = 0, j = 0; + int ret; if (!avctx->width || !avctx->height) return -1; - buf_recoded = av_buffer_allocz(buf_size + 1024); - if (!buf_recoded) + recoded = av_mallocz(buf_size + 1024); + if (!recoded) return -1; - recoded = buf_recoded->data; /* SOI */ recoded[j++] = 0xFF; @@ -83,43 +85,41 @@ recoded[j++] = 0xFF; recoded[j++] = 0xD9; - av_buffer_unref(&avpkt->buf); - avpkt->buf = buf_recoded; - avpkt->data = recoded; - avpkt->size = j; + ret = ff_mjpeg_decode_frame_from_buf(avctx, frame, got_frame, + avpkt, recoded, j); + + av_free(recoded); - return 0; + return ret < 0 ? ret : avpkt->size; } #if CONFIG_SP5X_DECODER const FFCodec ff_sp5x_decoder = { .p.name = "sp5x", - .p.long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"), + CODEC_LONG_NAME("Sunplus JPEG (SP5X)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SP5X, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_DECODE_CB(sp5x_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_SETS_PKT_DTS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_AMV_DECODER const FFCodec ff_amv_decoder = { .p.name = "amv", - .p.long_name = NULL_IF_CONFIG_SMALL("AMV Video"), + CODEC_LONG_NAME("AMV Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AMV, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), + FF_CODEC_DECODE_CB(sp5x_decode_frame), .p.max_lowres = 3, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | - FF_CODEC_CAP_SETS_PKT_DTS, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * NewTek SpeedHQ codec + * NewTek SpeedHQ common data * Copyright 2017 Steinar H. Gunderson * * This file is part of FFmpeg. @@ -19,52 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * @file - * NewTek SpeedHQ decoder. - */ - -#define BITSTREAM_READER_LE - -#include "config.h" -#include "config_components.h" -#include "libavutil/attributes.h" -#include "libavutil/mem_internal.h" - -#include "avcodec.h" -#include "blockdsp.h" -#include "codec_internal.h" -#include "get_bits.h" -#include "idctdsp.h" -#include "internal.h" -#include "libavutil/thread.h" -#include "mathops.h" -#include "mpeg12dec.h" -#include "mpeg12data.h" -#include "mpeg12vlc.h" - -#define MAX_INDEX (64 - 1) - -/* - * 5 bits makes for very small tables, with no more than two lookups needed - * for the longest (10-bit) codes. - */ -#define ALPHA_VLC_BITS 5 - -typedef struct SHQContext { - AVCodecContext *avctx; - BlockDSPContext bdsp; - IDCTDSPContext idsp; - ScanTable intra_scantable; - int quant_matrix[64]; - enum { SHQ_SUBSAMPLING_420, SHQ_SUBSAMPLING_422, SHQ_SUBSAMPLING_444 } - subsampling; - enum { SHQ_NO_ALPHA, SHQ_RLE_ALPHA, SHQ_DCT_ALPHA } alpha_type; -} SHQContext; - +#include +#include "speedhq.h" /* AC codes: Very similar but not identical to MPEG-2. */ -static const uint16_t speedhq_vlc[123][2] = { +const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2] = { {0x0001, 2}, {0x0003, 3}, {0x000E, 4}, {0x0007, 5}, {0x0017, 5}, {0x0028, 6}, {0x0008, 6}, {0x006F, 7}, {0x001F, 7}, {0x00C4, 8}, {0x0044, 8}, {0x005F, 8}, @@ -100,7 +59,7 @@ {0x0006, 4} /* EOB */ }; -static const uint8_t speedhq_level[121] = { +const uint8_t ff_speedhq_level[121] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -119,7 +78,7 @@ 1, }; -static const uint8_t speedhq_run[121] = { +const uint8_t ff_speedhq_run[121] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -137,602 +96,3 @@ 23, 24, 25, 26, 27, 28, 29, 30, 31, }; - -RLTable ff_rl_speedhq = { - 121, - 121, - speedhq_vlc, - speedhq_run, - speedhq_level, -}; - -#if CONFIG_SPEEDHQ_DECODER -/* NOTE: The first element is always 16, unscaled. */ -static const uint8_t unscaled_quant_matrix[64] = { - 16, 16, 19, 22, 26, 27, 29, 34, - 16, 16, 22, 24, 27, 29, 34, 37, - 19, 22, 26, 27, 29, 34, 34, 38, - 22, 22, 26, 27, 29, 34, 37, 40, - 22, 26, 27, 29, 32, 35, 40, 48, - 26, 27, 29, 32, 35, 40, 48, 58, - 26, 27, 29, 34, 38, 46, 56, 69, - 27, 29, 35, 38, 46, 56, 69, 83 -}; - -static VLC dc_lum_vlc_le; -static VLC dc_chroma_vlc_le; -static VLC dc_alpha_run_vlc_le; -static VLC dc_alpha_level_vlc_le; - -static inline int decode_dc_le(GetBitContext *gb, int component) -{ - int code, diff; - - if (component == 0 || component == 3) { - code = get_vlc2(gb, dc_lum_vlc_le.table, DC_VLC_BITS, 2); - } else { - code = get_vlc2(gb, dc_chroma_vlc_le.table, DC_VLC_BITS, 2); - } - if (!code) { - diff = 0; - } else { - diff = get_xbits_le(gb, code); - } - return diff; -} - -static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize) -{ - uint8_t block[128]; - int i = 0, x, y; - - memset(block, 0, sizeof(block)); - - { - OPEN_READER(re, gb); - - for ( ;; ) { - int run, level; - - UPDATE_CACHE_LE(re, gb); - GET_VLC(run, re, gb, dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2); - - if (run < 0) break; - i += run; - if (i >= 128) - return AVERROR_INVALIDDATA; - - UPDATE_CACHE_LE(re, gb); - GET_VLC(level, re, gb, dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2); - block[i++] = level; - } - - CLOSE_READER(re, gb); - } - - for (y = 0; y < 8; y++) { - for (x = 0; x < 16; x++) { - last_alpha[x] -= block[y * 16 + x]; - } - memcpy(dest, last_alpha, 16); - dest += linesize; - } - - return 0; -} - -static inline int decode_dct_block(const SHQContext *s, GetBitContext *gb, int last_dc[4], int component, uint8_t *dest, int linesize) -{ - const int *quant_matrix = s->quant_matrix; - const uint8_t *scantable = s->intra_scantable.permutated; - LOCAL_ALIGNED_32(int16_t, block, [64]); - int dc_offset; - - s->bdsp.clear_block(block); - - dc_offset = decode_dc_le(gb, component); - last_dc[component] -= dc_offset; /* Note: Opposite of most codecs. */ - block[scantable[0]] = last_dc[component]; /* quant_matrix[0] is always 16. */ - - /* Read AC coefficients. */ - { - int i = 0; - OPEN_READER(re, gb); - for ( ;; ) { - int level, run; - UPDATE_CACHE_LE(re, gb); - GET_RL_VLC(level, run, re, gb, ff_rl_speedhq.rl_vlc[0], - TEX_VLC_BITS, 2, 0); - if (level == 127) { - break; - } else if (level) { - i += run; - if (i > MAX_INDEX) - return AVERROR_INVALIDDATA; - /* If next bit is 1, level = -level */ - level = (level ^ SHOW_SBITS(re, gb, 1)) - - SHOW_SBITS(re, gb, 1); - LAST_SKIP_BITS(re, gb, 1); - } else { - /* Escape. */ -#if MIN_CACHE_BITS < 6 + 6 + 12 -#error MIN_CACHE_BITS is too small for the escape code, add UPDATE_CACHE -#endif - run = SHOW_UBITS(re, gb, 6) + 1; - SKIP_BITS(re, gb, 6); - level = SHOW_UBITS(re, gb, 12) - 2048; - LAST_SKIP_BITS(re, gb, 12); - - i += run; - if (i > MAX_INDEX) - return AVERROR_INVALIDDATA; - } - - block[scantable[i]] = (level * quant_matrix[i]) >> 4; - } - CLOSE_READER(re, gb); - } - - s->idsp.idct_put(dest, linesize, block); - - return 0; -} - -static int decode_speedhq_border(const SHQContext *s, GetBitContext *gb, AVFrame *frame, int field_number, int line_stride) -{ - int linesize_y = frame->linesize[0] * line_stride; - int linesize_cb = frame->linesize[1] * line_stride; - int linesize_cr = frame->linesize[2] * line_stride; - int linesize_a; - int ret; - - if (s->alpha_type != SHQ_NO_ALPHA) - linesize_a = frame->linesize[3] * line_stride; - - for (int y = 0; y < frame->height; y += 16 * line_stride) { - int last_dc[4] = { 1024, 1024, 1024, 1024 }; - uint8_t *dest_y, *dest_cb, *dest_cr, *dest_a; - uint8_t last_alpha[16]; - int x = frame->width - 8; - - dest_y = frame->data[0] + frame->linesize[0] * (y + field_number) + x; - if (s->subsampling == SHQ_SUBSAMPLING_420) { - dest_cb = frame->data[1] + frame->linesize[1] * (y/2 + field_number) + x / 2; - dest_cr = frame->data[2] + frame->linesize[2] * (y/2 + field_number) + x / 2; - } else { - av_assert2(s->subsampling == SHQ_SUBSAMPLING_422); - dest_cb = frame->data[1] + frame->linesize[1] * (y + field_number) + x / 2; - dest_cr = frame->data[2] + frame->linesize[2] * (y + field_number) + x / 2; - } - if (s->alpha_type != SHQ_NO_ALPHA) { - memset(last_alpha, 255, sizeof(last_alpha)); - dest_a = frame->data[3] + frame->linesize[3] * (y + field_number) + x; - } - - if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8 * linesize_y, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8 * linesize_y + 8, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 1, dest_cb, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 2, dest_cr, linesize_cr)) < 0) - return ret; - - if (s->subsampling != SHQ_SUBSAMPLING_420) { - if ((ret = decode_dct_block(s, gb, last_dc, 1, dest_cb + 8 * linesize_cb, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 2, dest_cr + 8 * linesize_cr, linesize_cr)) < 0) - return ret; - } - - if (s->alpha_type == SHQ_RLE_ALPHA) { - /* Alpha coded using 16x8 RLE blocks. */ - if ((ret = decode_alpha_block(s, gb, last_alpha, dest_a, linesize_a)) < 0) - return ret; - if ((ret = decode_alpha_block(s, gb, last_alpha, dest_a + 8 * linesize_a, linesize_a)) < 0) - return ret; - } else if (s->alpha_type == SHQ_DCT_ALPHA) { - /* Alpha encoded exactly like luma. */ - if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8 * linesize_a, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8 * linesize_a + 8, linesize_a)) < 0) - return ret; - } - } - - return 0; -} - -static int decode_speedhq_field(const SHQContext *s, const uint8_t *buf, int buf_size, AVFrame *frame, int field_number, int start, int end, int line_stride) -{ - int ret, slice_number, slice_offsets[5]; - int linesize_y = frame->linesize[0] * line_stride; - int linesize_cb = frame->linesize[1] * line_stride; - int linesize_cr = frame->linesize[2] * line_stride; - int linesize_a; - GetBitContext gb; - - if (s->alpha_type != SHQ_NO_ALPHA) - linesize_a = frame->linesize[3] * line_stride; - - if (end < start || end - start < 3 || end > buf_size) - return AVERROR_INVALIDDATA; - - slice_offsets[0] = start; - slice_offsets[4] = end; - for (slice_number = 1; slice_number < 4; slice_number++) { - uint32_t last_offset, slice_len; - - last_offset = slice_offsets[slice_number - 1]; - slice_len = AV_RL24(buf + last_offset); - slice_offsets[slice_number] = last_offset + slice_len; - - if (slice_len < 3 || slice_offsets[slice_number] > end - 3) - return AVERROR_INVALIDDATA; - } - - for (slice_number = 0; slice_number < 4; slice_number++) { - uint32_t slice_begin, slice_end; - int x, y; - - slice_begin = slice_offsets[slice_number]; - slice_end = slice_offsets[slice_number + 1]; - - if ((ret = init_get_bits8(&gb, buf + slice_begin + 3, slice_end - slice_begin - 3)) < 0) - return ret; - - for (y = slice_number * 16 * line_stride; y < frame->height; y += line_stride * 64) { - uint8_t *dest_y, *dest_cb, *dest_cr, *dest_a; - int last_dc[4] = { 1024, 1024, 1024, 1024 }; - uint8_t last_alpha[16]; - - memset(last_alpha, 255, sizeof(last_alpha)); - - dest_y = frame->data[0] + frame->linesize[0] * (y + field_number); - if (s->subsampling == SHQ_SUBSAMPLING_420) { - dest_cb = frame->data[1] + frame->linesize[1] * (y/2 + field_number); - dest_cr = frame->data[2] + frame->linesize[2] * (y/2 + field_number); - } else { - dest_cb = frame->data[1] + frame->linesize[1] * (y + field_number); - dest_cr = frame->data[2] + frame->linesize[2] * (y + field_number); - } - if (s->alpha_type != SHQ_NO_ALPHA) { - dest_a = frame->data[3] + frame->linesize[3] * (y + field_number); - } - - for (x = 0; x < frame->width - 8 * (s->subsampling != SHQ_SUBSAMPLING_444); x += 16) { - /* Decode the four luma blocks. */ - if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8 * linesize_y, linesize_y)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8 * linesize_y + 8, linesize_y)) < 0) - return ret; - - /* - * Decode the first chroma block. For 4:2:0, this is the only one; - * for 4:2:2, it's the top block; for 4:4:4, it's the top-left block. - */ - if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr, linesize_cr)) < 0) - return ret; - - if (s->subsampling != SHQ_SUBSAMPLING_420) { - /* For 4:2:2, this is the bottom block; for 4:4:4, it's the bottom-left block. */ - if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8 * linesize_cb, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8 * linesize_cr, linesize_cr)) < 0) - return ret; - - if (s->subsampling == SHQ_SUBSAMPLING_444) { - /* Top-right and bottom-right blocks. */ - if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8, linesize_cr)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8 * linesize_cb + 8, linesize_cb)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8 * linesize_cr + 8, linesize_cr)) < 0) - return ret; - - dest_cb += 8; - dest_cr += 8; - } - } - dest_y += 16; - dest_cb += 8; - dest_cr += 8; - - if (s->alpha_type == SHQ_RLE_ALPHA) { - /* Alpha coded using 16x8 RLE blocks. */ - if ((ret = decode_alpha_block(s, &gb, last_alpha, dest_a, linesize_a)) < 0) - return ret; - if ((ret = decode_alpha_block(s, &gb, last_alpha, dest_a + 8 * linesize_a, linesize_a)) < 0) - return ret; - dest_a += 16; - } else if (s->alpha_type == SHQ_DCT_ALPHA) { - /* Alpha encoded exactly like luma. */ - if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8 * linesize_a, linesize_a)) < 0) - return ret; - if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8 * linesize_a + 8, linesize_a)) < 0) - return ret; - dest_a += 16; - } - } - } - } - - if (s->subsampling != SHQ_SUBSAMPLING_444 && (frame->width & 15)) - return decode_speedhq_border(s, &gb, frame, field_number, line_stride); - - return 0; -} - -static void compute_quant_matrix(int *output, int qscale) -{ - int i; - for (i = 0; i < 64; i++) output[i] = unscaled_quant_matrix[ff_zigzag_direct[i]] * qscale; -} - -static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame, - int *got_frame, AVPacket *avpkt) -{ - SHQContext * const s = avctx->priv_data; - const uint8_t *buf = avpkt->data; - int buf_size = avpkt->size; - uint8_t quality; - uint32_t second_field_offset; - int ret; - - if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 != 0) - return AVERROR_INVALIDDATA; - - quality = buf[0]; - if (quality >= 100) { - return AVERROR_INVALIDDATA; - } - - compute_quant_matrix(s->quant_matrix, 100 - quality); - - second_field_offset = AV_RL24(buf + 1); - if (second_field_offset >= buf_size - 3) { - return AVERROR_INVALIDDATA; - } - - avctx->coded_width = FFALIGN(avctx->width, 16); - avctx->coded_height = FFALIGN(avctx->height, 16); - - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { - return ret; - } - frame->key_frame = 1; - - if (second_field_offset == 4 || second_field_offset == (buf_size-4)) { - /* - * Overlapping first and second fields is used to signal - * encoding only a single field. In this case, "height" - * is ambiguous; it could mean either the height of the - * frame as a whole, or of the field. The former would make - * more sense for compatibility with legacy decoders, - * but this matches the convention used in NDI, which is - * the primary user of this trick. - */ - if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, buf_size, 1)) < 0) - return ret; - } else { - if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, second_field_offset, 2)) < 0) - return ret; - if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 1, second_field_offset, buf_size, 2)) < 0) - return ret; - } - - *got_frame = 1; - return buf_size; -} - -/* - * Alpha VLC. Run and level are independently coded, and would be - * outside the default limits for MAX_RUN/MAX_LEVEL, so we don't - * bother with combining them into one table. - */ -static av_cold void compute_alpha_vlcs(void) -{ - uint16_t run_code[134], level_code[266]; - uint8_t run_bits[134], level_bits[266]; - int16_t run_symbols[134], level_symbols[266]; - int entry, i, sign; - - /* Initialize VLC for alpha run. */ - entry = 0; - - /* 0 -> 0. */ - run_code[entry] = 0; - run_bits[entry] = 1; - run_symbols[entry] = 0; - ++entry; - - /* 10xx -> xx plus 1. */ - for (i = 0; i < 4; ++i) { - run_code[entry] = (i << 2) | 1; - run_bits[entry] = 4; - run_symbols[entry] = i + 1; - ++entry; - } - - /* 111xxxxxxx -> xxxxxxx. */ - for (i = 0; i < 128; ++i) { - run_code[entry] = (i << 3) | 7; - run_bits[entry] = 10; - run_symbols[entry] = i; - ++entry; - } - - /* 110 -> EOB. */ - run_code[entry] = 3; - run_bits[entry] = 3; - run_symbols[entry] = -1; - ++entry; - - av_assert0(entry == FF_ARRAY_ELEMS(run_code)); - - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, - FF_ARRAY_ELEMS(run_code), - run_bits, 1, 1, - run_code, 2, 2, - run_symbols, 2, 2, 160); - - /* Initialize VLC for alpha level. */ - entry = 0; - - for (sign = 0; sign <= 1; ++sign) { - /* 1s -> -1 or +1 (depending on sign bit). */ - level_code[entry] = (sign << 1) | 1; - level_bits[entry] = 2; - level_symbols[entry] = sign ? -1 : 1; - ++entry; - - /* 01sxx -> xx plus 2 (2..5 or -2..-5, depending on sign bit). */ - for (i = 0; i < 4; ++i) { - level_code[entry] = (i << 3) | (sign << 2) | 2; - level_bits[entry] = 5; - level_symbols[entry] = sign ? -(i + 2) : (i + 2); - ++entry; - } - } - - /* - * 00xxxxxxxx -> xxxxxxxx, in two's complement. There are many codes - * here that would better be encoded in other ways (e.g. 0 would be - * encoded by increasing run, and +/- 1 would be encoded with a - * shorter code), but it doesn't hurt to allow everything. - */ - for (i = 0; i < 256; ++i) { - level_code[entry] = i << 2; - level_bits[entry] = 10; - level_symbols[entry] = i; - ++entry; - } - - av_assert0(entry == FF_ARRAY_ELEMS(level_code)); - - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, - FF_ARRAY_ELEMS(level_code), - level_bits, 1, 1, - level_code, 2, 2, - level_symbols, 2, 2, 288); -} - -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, - 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, - ff_mpeg12_vlc_dc_chroma_bits, 1, 1, - ff_mpeg12_vlc_dc_chroma_code, 2, 2, - INIT_VLC_OUTPUT_LE, 514); - - INIT_2D_VLC_RL(ff_rl_speedhq, 674, INIT_VLC_LE); - - compute_alpha_vlcs(); -} - -static av_cold int speedhq_decode_init(AVCodecContext *avctx) -{ - int ret; - static AVOnce init_once = AV_ONCE_INIT; - SHQContext * const s = avctx->priv_data; - - s->avctx = avctx; - - ret = ff_thread_once(&init_once, speedhq_static_init); - if (ret) - return AVERROR_UNKNOWN; - - ff_blockdsp_init(&s->bdsp, avctx); - ff_idctdsp_init(&s->idsp, avctx); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); - - switch (avctx->codec_tag) { - case MKTAG('S', 'H', 'Q', '0'): - s->subsampling = SHQ_SUBSAMPLING_420; - s->alpha_type = SHQ_NO_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUV420P; - break; - case MKTAG('S', 'H', 'Q', '1'): - s->subsampling = SHQ_SUBSAMPLING_420; - s->alpha_type = SHQ_RLE_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUVA420P; - break; - case MKTAG('S', 'H', 'Q', '2'): - s->subsampling = SHQ_SUBSAMPLING_422; - s->alpha_type = SHQ_NO_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUV422P; - break; - case MKTAG('S', 'H', 'Q', '3'): - s->subsampling = SHQ_SUBSAMPLING_422; - s->alpha_type = SHQ_RLE_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUVA422P; - break; - case MKTAG('S', 'H', 'Q', '4'): - s->subsampling = SHQ_SUBSAMPLING_444; - s->alpha_type = SHQ_NO_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUV444P; - break; - case MKTAG('S', 'H', 'Q', '5'): - s->subsampling = SHQ_SUBSAMPLING_444; - s->alpha_type = SHQ_RLE_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUVA444P; - break; - case MKTAG('S', 'H', 'Q', '7'): - s->subsampling = SHQ_SUBSAMPLING_422; - s->alpha_type = SHQ_DCT_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUVA422P; - break; - case MKTAG('S', 'H', 'Q', '9'): - s->subsampling = SHQ_SUBSAMPLING_444; - s->alpha_type = SHQ_DCT_ALPHA; - avctx->pix_fmt = AV_PIX_FMT_YUVA444P; - break; - default: - av_log(avctx, AV_LOG_ERROR, "Unknown NewTek SpeedHQ FOURCC provided (%08X)\n", - avctx->codec_tag); - return AVERROR_INVALIDDATA; - } - - /* This matches what NDI's RGB -> Y'CbCr 4:2:2 converter uses. */ - avctx->colorspace = AVCOL_SPC_BT470BG; - avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; - - return 0; -} - -const FFCodec ff_speedhq_decoder = { - .p.name = "speedhq", - .p.long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), - .p.type = AVMEDIA_TYPE_VIDEO, - .p.id = AV_CODEC_ID_SPEEDHQ, - .priv_data_size = sizeof(SHQContext), - .init = speedhq_decode_init, - FF_CODEC_DECODE_CB(speedhq_decode_frame), - .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -}; -#endif /* CONFIG_SPEEDHQ_DECODER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqdec.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,653 @@ +/* + * NewTek SpeedHQ codec + * Copyright 2017 Steinar H. Gunderson + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * NewTek SpeedHQ decoder. + */ + +#define BITSTREAM_READER_LE + +#include "libavutil/attributes.h" +#include "libavutil/mem_internal.h" + +#include "avcodec.h" +#include "blockdsp.h" +#include "codec_internal.h" +#include "decode.h" +#include "get_bits.h" +#include "idctdsp.h" +#include "libavutil/thread.h" +#include "mathops.h" +#include "mpeg12data.h" +#include "mpeg12vlc.h" +#include "speedhq.h" + +#define MAX_INDEX (64 - 1) + +/* + * 5 bits makes for very small tables, with no more than two lookups needed + * for the longest (10-bit) codes. + */ +#define ALPHA_VLC_BITS 5 + +typedef struct SHQContext { + BlockDSPContext bdsp; + IDCTDSPContext idsp; + uint8_t permutated_intra_scantable[64]; + int quant_matrix[64]; + enum { SHQ_SUBSAMPLING_420, SHQ_SUBSAMPLING_422, SHQ_SUBSAMPLING_444 } + subsampling; + enum { SHQ_NO_ALPHA, SHQ_RLE_ALPHA, SHQ_DCT_ALPHA } alpha_type; +} SHQContext; + +/* NOTE: The first element is always 16, unscaled. */ +static const uint8_t unscaled_quant_matrix[64] = { + 16, 16, 19, 22, 26, 27, 29, 34, + 16, 16, 22, 24, 27, 29, 34, 37, + 19, 22, 26, 27, 29, 34, 34, 38, + 22, 22, 26, 27, 29, 34, 37, 40, + 22, 26, 27, 29, 32, 35, 40, 48, + 26, 27, 29, 32, 35, 40, 48, 58, + 26, 27, 29, 34, 38, 46, 56, 69, + 27, 29, 35, 38, 46, 56, 69, 83 +}; + +static VLC dc_lum_vlc_le; +static VLC dc_chroma_vlc_le; +static VLC dc_alpha_run_vlc_le; +static VLC dc_alpha_level_vlc_le; + +static RL_VLC_ELEM speedhq_rl_vlc[674]; + +static inline int decode_dc_le(GetBitContext *gb, int component) +{ + int code, diff; + + if (component == 0 || component == 3) { + code = get_vlc2(gb, dc_lum_vlc_le.table, DC_VLC_BITS, 2); + } else { + code = get_vlc2(gb, dc_chroma_vlc_le.table, DC_VLC_BITS, 2); + } + if (!code) { + diff = 0; + } else { + diff = get_xbits_le(gb, code); + } + return diff; +} + +static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize) +{ + uint8_t block[128]; + int i = 0, x, y; + + memset(block, 0, sizeof(block)); + + { + OPEN_READER(re, gb); + + for ( ;; ) { + int run, level; + + UPDATE_CACHE_LE(re, gb); + GET_VLC(run, re, gb, dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2); + + if (run < 0) break; + i += run; + if (i >= 128) + return AVERROR_INVALIDDATA; + + UPDATE_CACHE_LE(re, gb); + GET_VLC(level, re, gb, dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2); + block[i++] = level; + } + + CLOSE_READER(re, gb); + } + + for (y = 0; y < 8; y++) { + for (x = 0; x < 16; x++) { + last_alpha[x] -= block[y * 16 + x]; + } + memcpy(dest, last_alpha, 16); + dest += linesize; + } + + return 0; +} + +static inline int decode_dct_block(const SHQContext *s, GetBitContext *gb, int last_dc[4], int component, uint8_t *dest, int linesize) +{ + const int *quant_matrix = s->quant_matrix; + const uint8_t *scantable = s->permutated_intra_scantable; + LOCAL_ALIGNED_32(int16_t, block, [64]); + int dc_offset; + + s->bdsp.clear_block(block); + + dc_offset = decode_dc_le(gb, component); + last_dc[component] -= dc_offset; /* Note: Opposite of most codecs. */ + block[scantable[0]] = last_dc[component]; /* quant_matrix[0] is always 16. */ + + /* Read AC coefficients. */ + { + int i = 0; + OPEN_READER(re, gb); + for ( ;; ) { + int level, run; + UPDATE_CACHE_LE(re, gb); + GET_RL_VLC(level, run, re, gb, speedhq_rl_vlc, + TEX_VLC_BITS, 2, 0); + if (level == 127) { + break; + } else if (level) { + i += run; + if (i > MAX_INDEX) + return AVERROR_INVALIDDATA; + /* If next bit is 1, level = -level */ + level = (level ^ SHOW_SBITS(re, gb, 1)) - + SHOW_SBITS(re, gb, 1); + LAST_SKIP_BITS(re, gb, 1); + } else { + /* Escape. */ +#if MIN_CACHE_BITS < 6 + 6 + 12 +#error MIN_CACHE_BITS is too small for the escape code, add UPDATE_CACHE +#endif + run = SHOW_UBITS(re, gb, 6) + 1; + SKIP_BITS(re, gb, 6); + level = SHOW_UBITS(re, gb, 12) - 2048; + LAST_SKIP_BITS(re, gb, 12); + + i += run; + if (i > MAX_INDEX) + return AVERROR_INVALIDDATA; + } + + block[scantable[i]] = (level * quant_matrix[i]) >> 4; + } + CLOSE_READER(re, gb); + } + + s->idsp.idct_put(dest, linesize, block); + + return 0; +} + +static int decode_speedhq_border(const SHQContext *s, GetBitContext *gb, AVFrame *frame, int field_number, int line_stride) +{ + int linesize_y = frame->linesize[0] * line_stride; + int linesize_cb = frame->linesize[1] * line_stride; + int linesize_cr = frame->linesize[2] * line_stride; + int linesize_a; + int ret; + + if (s->alpha_type != SHQ_NO_ALPHA) + linesize_a = frame->linesize[3] * line_stride; + + for (int y = 0; y < frame->height; y += 16 * line_stride) { + int last_dc[4] = { 1024, 1024, 1024, 1024 }; + uint8_t *dest_y, *dest_cb, *dest_cr, *dest_a; + uint8_t last_alpha[16]; + int x = frame->width - 8; + + dest_y = frame->data[0] + frame->linesize[0] * (y + field_number) + x; + if (s->subsampling == SHQ_SUBSAMPLING_420) { + dest_cb = frame->data[1] + frame->linesize[1] * (y/2 + field_number) + x / 2; + dest_cr = frame->data[2] + frame->linesize[2] * (y/2 + field_number) + x / 2; + } else { + av_assert2(s->subsampling == SHQ_SUBSAMPLING_422); + dest_cb = frame->data[1] + frame->linesize[1] * (y + field_number) + x / 2; + dest_cr = frame->data[2] + frame->linesize[2] * (y + field_number) + x / 2; + } + if (s->alpha_type != SHQ_NO_ALPHA) { + memset(last_alpha, 255, sizeof(last_alpha)); + dest_a = frame->data[3] + frame->linesize[3] * (y + field_number) + x; + } + + if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8 * linesize_y, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 0, dest_y + 8 * linesize_y + 8, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 1, dest_cb, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 2, dest_cr, linesize_cr)) < 0) + return ret; + + if (s->subsampling != SHQ_SUBSAMPLING_420) { + if ((ret = decode_dct_block(s, gb, last_dc, 1, dest_cb + 8 * linesize_cb, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 2, dest_cr + 8 * linesize_cr, linesize_cr)) < 0) + return ret; + } + + if (s->alpha_type == SHQ_RLE_ALPHA) { + /* Alpha coded using 16x8 RLE blocks. */ + if ((ret = decode_alpha_block(s, gb, last_alpha, dest_a, linesize_a)) < 0) + return ret; + if ((ret = decode_alpha_block(s, gb, last_alpha, dest_a + 8 * linesize_a, linesize_a)) < 0) + return ret; + } else if (s->alpha_type == SHQ_DCT_ALPHA) { + /* Alpha encoded exactly like luma. */ + if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8 * linesize_a, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, gb, last_dc, 3, dest_a + 8 * linesize_a + 8, linesize_a)) < 0) + return ret; + } + } + + return 0; +} + +static int decode_speedhq_field(const SHQContext *s, const uint8_t *buf, int buf_size, AVFrame *frame, int field_number, int start, int end, int line_stride) +{ + int ret, slice_number, slice_offsets[5]; + int linesize_y = frame->linesize[0] * line_stride; + int linesize_cb = frame->linesize[1] * line_stride; + int linesize_cr = frame->linesize[2] * line_stride; + int linesize_a; + GetBitContext gb; + + if (s->alpha_type != SHQ_NO_ALPHA) + linesize_a = frame->linesize[3] * line_stride; + + if (end < start || end - start < 3 || end > buf_size) + return AVERROR_INVALIDDATA; + + slice_offsets[0] = start; + slice_offsets[4] = end; + for (slice_number = 1; slice_number < 4; slice_number++) { + uint32_t last_offset, slice_len; + + last_offset = slice_offsets[slice_number - 1]; + slice_len = AV_RL24(buf + last_offset); + slice_offsets[slice_number] = last_offset + slice_len; + + if (slice_len < 3 || slice_offsets[slice_number] > end - 3) + return AVERROR_INVALIDDATA; + } + + for (slice_number = 0; slice_number < 4; slice_number++) { + uint32_t slice_begin, slice_end; + int x, y; + + slice_begin = slice_offsets[slice_number]; + slice_end = slice_offsets[slice_number + 1]; + + if ((ret = init_get_bits8(&gb, buf + slice_begin + 3, slice_end - slice_begin - 3)) < 0) + return ret; + + for (y = slice_number * 16 * line_stride; y < frame->height; y += line_stride * 64) { + uint8_t *dest_y, *dest_cb, *dest_cr, *dest_a; + int last_dc[4] = { 1024, 1024, 1024, 1024 }; + uint8_t last_alpha[16]; + + memset(last_alpha, 255, sizeof(last_alpha)); + + dest_y = frame->data[0] + frame->linesize[0] * (y + field_number); + if (s->subsampling == SHQ_SUBSAMPLING_420) { + dest_cb = frame->data[1] + frame->linesize[1] * (y/2 + field_number); + dest_cr = frame->data[2] + frame->linesize[2] * (y/2 + field_number); + } else { + dest_cb = frame->data[1] + frame->linesize[1] * (y + field_number); + dest_cr = frame->data[2] + frame->linesize[2] * (y + field_number); + } + if (s->alpha_type != SHQ_NO_ALPHA) { + dest_a = frame->data[3] + frame->linesize[3] * (y + field_number); + } + + for (x = 0; x < frame->width - 8 * (s->subsampling != SHQ_SUBSAMPLING_444); x += 16) { + /* Decode the four luma blocks. */ + if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8 * linesize_y, linesize_y)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 0, dest_y + 8 * linesize_y + 8, linesize_y)) < 0) + return ret; + + /* + * Decode the first chroma block. For 4:2:0, this is the only one; + * for 4:2:2, it's the top block; for 4:4:4, it's the top-left block. + */ + if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr, linesize_cr)) < 0) + return ret; + + if (s->subsampling != SHQ_SUBSAMPLING_420) { + /* For 4:2:2, this is the bottom block; for 4:4:4, it's the bottom-left block. */ + if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8 * linesize_cb, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8 * linesize_cr, linesize_cr)) < 0) + return ret; + + if (s->subsampling == SHQ_SUBSAMPLING_444) { + /* Top-right and bottom-right blocks. */ + if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8, linesize_cr)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 1, dest_cb + 8 * linesize_cb + 8, linesize_cb)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 2, dest_cr + 8 * linesize_cr + 8, linesize_cr)) < 0) + return ret; + + dest_cb += 8; + dest_cr += 8; + } + } + dest_y += 16; + dest_cb += 8; + dest_cr += 8; + + if (s->alpha_type == SHQ_RLE_ALPHA) { + /* Alpha coded using 16x8 RLE blocks. */ + if ((ret = decode_alpha_block(s, &gb, last_alpha, dest_a, linesize_a)) < 0) + return ret; + if ((ret = decode_alpha_block(s, &gb, last_alpha, dest_a + 8 * linesize_a, linesize_a)) < 0) + return ret; + dest_a += 16; + } else if (s->alpha_type == SHQ_DCT_ALPHA) { + /* Alpha encoded exactly like luma. */ + if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8 * linesize_a, linesize_a)) < 0) + return ret; + if ((ret = decode_dct_block(s, &gb, last_dc, 3, dest_a + 8 * linesize_a + 8, linesize_a)) < 0) + return ret; + dest_a += 16; + } + } + } + } + + if (s->subsampling != SHQ_SUBSAMPLING_444 && (frame->width & 15)) + return decode_speedhq_border(s, &gb, frame, field_number, line_stride); + + return 0; +} + +static void compute_quant_matrix(int *output, int qscale) +{ + int i; + for (i = 0; i < 64; i++) output[i] = unscaled_quant_matrix[ff_zigzag_direct[i]] * qscale; +} + +static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) +{ + SHQContext * const s = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + uint8_t quality; + uint32_t second_field_offset; + int ret; + + if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 != 0) + return AVERROR_INVALIDDATA; + if (buf_size < avctx->width*avctx->height / 64 / 4) + return AVERROR_INVALIDDATA; + + quality = buf[0]; + if (quality >= 100) { + return AVERROR_INVALIDDATA; + } + + compute_quant_matrix(s->quant_matrix, 100 - quality); + + second_field_offset = AV_RL24(buf + 1); + if (second_field_offset >= buf_size - 3) { + return AVERROR_INVALIDDATA; + } + + avctx->coded_width = FFALIGN(avctx->width, 16); + avctx->coded_height = FFALIGN(avctx->height, 16); + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { + return ret; + } + frame->key_frame = 1; + + if (second_field_offset == 4 || second_field_offset == (buf_size-4)) { + /* + * Overlapping first and second fields is used to signal + * encoding only a single field. In this case, "height" + * is ambiguous; it could mean either the height of the + * frame as a whole, or of the field. The former would make + * more sense for compatibility with legacy decoders, + * but this matches the convention used in NDI, which is + * the primary user of this trick. + */ + if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, buf_size, 1)) < 0) + return ret; + } else { + if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, second_field_offset, 2)) < 0) + return ret; + if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 1, second_field_offset, buf_size, 2)) < 0) + return ret; + } + + *got_frame = 1; + return buf_size; +} + +/* + * Alpha VLC. Run and level are independently coded, and would be + * outside the default limits for MAX_RUN/MAX_LEVEL, so we don't + * bother with combining them into one table. + */ +static av_cold void compute_alpha_vlcs(void) +{ + uint16_t run_code[134], level_code[266]; + uint8_t run_bits[134], level_bits[266]; + int16_t run_symbols[134], level_symbols[266]; + int entry, i, sign; + + /* Initialize VLC for alpha run. */ + entry = 0; + + /* 0 -> 0. */ + run_code[entry] = 0; + run_bits[entry] = 1; + run_symbols[entry] = 0; + ++entry; + + /* 10xx -> xx plus 1. */ + for (i = 0; i < 4; ++i) { + run_code[entry] = (i << 2) | 1; + run_bits[entry] = 4; + run_symbols[entry] = i + 1; + ++entry; + } + + /* 111xxxxxxx -> xxxxxxx. */ + for (i = 0; i < 128; ++i) { + run_code[entry] = (i << 3) | 7; + run_bits[entry] = 10; + run_symbols[entry] = i; + ++entry; + } + + /* 110 -> EOB. */ + run_code[entry] = 3; + run_bits[entry] = 3; + run_symbols[entry] = -1; + ++entry; + + av_assert0(entry == FF_ARRAY_ELEMS(run_code)); + + INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, + FF_ARRAY_ELEMS(run_code), + run_bits, 1, 1, + run_code, 2, 2, + run_symbols, 2, 2, 160); + + /* Initialize VLC for alpha level. */ + entry = 0; + + for (sign = 0; sign <= 1; ++sign) { + /* 1s -> -1 or +1 (depending on sign bit). */ + level_code[entry] = (sign << 1) | 1; + level_bits[entry] = 2; + level_symbols[entry] = sign ? -1 : 1; + ++entry; + + /* 01sxx -> xx plus 2 (2..5 or -2..-5, depending on sign bit). */ + for (i = 0; i < 4; ++i) { + level_code[entry] = (i << 3) | (sign << 2) | 2; + level_bits[entry] = 5; + level_symbols[entry] = sign ? -(i + 2) : (i + 2); + ++entry; + } + } + + /* + * 00xxxxxxxx -> xxxxxxxx, in two's complement. There are many codes + * here that would better be encoded in other ways (e.g. 0 would be + * encoded by increasing run, and +/- 1 would be encoded with a + * shorter code), but it doesn't hurt to allow everything. + */ + for (i = 0; i < 256; ++i) { + level_code[entry] = i << 2; + level_bits[entry] = 10; + level_symbols[entry] = i; + ++entry; + } + + av_assert0(entry == FF_ARRAY_ELEMS(level_code)); + + INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, + FF_ARRAY_ELEMS(level_code), + level_bits, 1, 1, + level_code, 2, 2, + level_symbols, 2, 2, 288); +} + +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, + 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, + ff_mpeg12_vlc_dc_chroma_bits, 1, 1, + ff_mpeg12_vlc_dc_chroma_code, 2, 2, + INIT_VLC_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); + + compute_alpha_vlcs(); +} + +static av_cold int speedhq_decode_init(AVCodecContext *avctx) +{ + int ret; + static AVOnce init_once = AV_ONCE_INIT; + SHQContext * const s = avctx->priv_data; + + ret = ff_thread_once(&init_once, speedhq_static_init); + if (ret) + return AVERROR_UNKNOWN; + + ff_blockdsp_init(&s->bdsp); + ff_idctdsp_init(&s->idsp, avctx); + ff_permute_scantable(s->permutated_intra_scantable, ff_zigzag_direct, + s->idsp.idct_permutation); + + switch (avctx->codec_tag) { + case MKTAG('S', 'H', 'Q', '0'): + s->subsampling = SHQ_SUBSAMPLING_420; + s->alpha_type = SHQ_NO_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; + break; + case MKTAG('S', 'H', 'Q', '1'): + s->subsampling = SHQ_SUBSAMPLING_420; + s->alpha_type = SHQ_RLE_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUVA420P; + break; + case MKTAG('S', 'H', 'Q', '2'): + s->subsampling = SHQ_SUBSAMPLING_422; + s->alpha_type = SHQ_NO_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; + break; + case MKTAG('S', 'H', 'Q', '3'): + s->subsampling = SHQ_SUBSAMPLING_422; + s->alpha_type = SHQ_RLE_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUVA422P; + break; + case MKTAG('S', 'H', 'Q', '4'): + s->subsampling = SHQ_SUBSAMPLING_444; + s->alpha_type = SHQ_NO_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; + break; + case MKTAG('S', 'H', 'Q', '5'): + s->subsampling = SHQ_SUBSAMPLING_444; + s->alpha_type = SHQ_RLE_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUVA444P; + break; + case MKTAG('S', 'H', 'Q', '7'): + s->subsampling = SHQ_SUBSAMPLING_422; + s->alpha_type = SHQ_DCT_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUVA422P; + break; + case MKTAG('S', 'H', 'Q', '9'): + s->subsampling = SHQ_SUBSAMPLING_444; + s->alpha_type = SHQ_DCT_ALPHA; + avctx->pix_fmt = AV_PIX_FMT_YUVA444P; + break; + default: + av_log(avctx, AV_LOG_ERROR, "Unknown NewTek SpeedHQ FOURCC provided (%08X)\n", + avctx->codec_tag); + return AVERROR_INVALIDDATA; + } + + /* This matches what NDI's RGB -> Y'CbCr 4:2:2 converter uses. */ + avctx->colorspace = AVCOL_SPC_BT470BG; + avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; + + return 0; +} + +const FFCodec ff_speedhq_decoder = { + .p.name = "speedhq", + CODEC_LONG_NAME("NewTek SpeedHQ"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SPEEDHQ, + .priv_data_size = sizeof(SHQContext), + .init = speedhq_decode_init, + FF_CODEC_DECODE_CB(speedhq_decode_frame), + .p.capabilities = AV_CODEC_CAP_DR1, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,20 +27,21 @@ * SpeedHQ encoder. */ -#include "config_components.h" - #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" #include "mpeg12data.h" -#include "mpeg12enc.h" +#include "mpeg12vlc.h" #include "mpegvideo.h" +#include "mpegvideodata.h" #include "mpegvideoenc.h" +#include "rl.h" +#include "speedhq.h" #include "speedhqenc.h" -extern RLTable ff_rl_speedhq; -static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; +static uint8_t speedhq_max_level[MAX_LEVEL + 1]; +static uint8_t speedhq_index_run[MAX_RUN + 1]; /* Exactly the same as MPEG-2, except little-endian. */ static const uint16_t mpeg12_vlc_dc_lum_code_reversed[12] = { @@ -65,7 +66,8 @@ static av_cold void speedhq_init_static_data(void) { - ff_rl_init(&ff_rl_speedhq, speedhq_static_rl_table_store); + ff_rl_init_level_run(speedhq_max_level, speedhq_index_run, + ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { @@ -89,7 +91,8 @@ speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } - ff_mpeg1_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len); + ff_mpeg1_init_uni_ac_vlc(speedhq_max_level, speedhq_index_run, + ff_speedhq_vlc_table, uni_speedhq_ac_vlc_len); } av_cold int ff_speedhq_encode_init(MpegEncContext *s) @@ -111,6 +114,9 @@ s->intra_chroma_ac_vlc_length = s->intra_chroma_ac_vlc_last_length = uni_speedhq_ac_vlc_len; + s->y_dc_scale_table = + s->c_dc_scale_table = ff_mpeg12_dc_scale_table[3]; + switch (s->avctx->pix_fmt) { case AV_PIX_FMT_YUV420P: s->avctx->codec_tag = MKTAG('S','H','Q','0'); @@ -217,14 +223,14 @@ MASK_ABS(sign, alevel); sign &= 1; - if (alevel <= ff_rl_speedhq.max_level[0][run]) { - code = ff_rl_speedhq.index_run[0][run] + alevel - 1; + if (alevel <= speedhq_max_level[run]) { + code = speedhq_index_run[run] + alevel - 1; /* store the VLC & sign at once */ - put_bits_le(&s->pb, ff_rl_speedhq.table_vlc[code][1] + 1, - ff_rl_speedhq.table_vlc[code][0] + (sign << ff_rl_speedhq.table_vlc[code][1])); + put_bits_le(&s->pb, ff_speedhq_vlc_table[code][1] + 1, + ff_speedhq_vlc_table[code][0] | (sign << ff_speedhq_vlc_table[code][1])); } else { /* escape seems to be pretty rare <5% so I do not optimize it; - * the values correspond to ff_rl_speedhq.table_vlc[121] */ + * the values correspond to ff_speedhq_vlc_table[121] */ put_bits_le(&s->pb, 6, 32); /* escape: only clip in this case */ put_bits_le(&s->pb, 6, run); @@ -233,7 +239,7 @@ last_non_zero = i; } } - /* end of block; the values correspond to ff_rl_speedhq.table_vlc[122] */ + /* end of block; the values correspond to ff_speedhq_vlc_table[122] */ put_bits_le(&s->pb, 4, 6); } @@ -276,21 +282,20 @@ return mb_y_order * 4 + slice_num; } -#if CONFIG_SPEEDHQ_ENCODER const FFCodec ff_speedhq_encoder = { .p.name = "speedhq", - .p.long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), + CODEC_LONG_NAME("NewTek SpeedHQ"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SPEEDHQ, .p.priv_class = &ff_mpv_enc_class, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SpeedHQEncContext), .init = ff_mpv_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, }; -#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhqenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,10 +31,7 @@ #include -#include "mjpeg.h" -#include "mjpegenc_common.h" #include "mpegvideo.h" -#include "put_bits.h" int ff_speedhq_encode_init(MpegEncContext *s); void ff_speedhq_encode_close(MpegEncContext *s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speedhq.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * NewTek SpeedHQ common header + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_SPEEDHQ_H +#define AVCODEC_SPEEDHQ_H + +#include +#include "libavutil/attributes_internal.h" + +#define SPEEDHQ_RL_NB_ELEMS 121 + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; +extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; +extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_SPEEDHQ_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speexdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speexdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speexdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/speexdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -56,8 +56,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "speexdata.h" #define SPEEX_NB_MODES 3 @@ -1452,7 +1452,7 @@ return AVERROR_INVALIDDATA; s->nb_channels = avctx->ch_layout.nb_channels; - if (s->nb_channels <= 0) + if (s->nb_channels <= 0 || s->nb_channels > 2) return AVERROR_INVALIDDATA; switch (s->rate) { @@ -1462,7 +1462,7 @@ default: s->mode = 2; } - s->frames_per_packet = 1; + s->frames_per_packet = 64; s->frame_size = NB_FRAME_SIZE << s->mode; } @@ -1537,6 +1537,7 @@ int *got_frame_ptr, AVPacket *avpkt) { SpeexContext *s = avctx->priv_data; + int frames_per_packet = s->frames_per_packet; const float scale = 1.f / 32768.f; int buf_size = avpkt->size; float *dst; @@ -1547,26 +1548,31 @@ if ((ret = init_get_bits8(&s->gb, avpkt->data, buf_size)) < 0) return ret; - frame->nb_samples = FFALIGN(s->frame_size * s->frames_per_packet, 4); + frame->nb_samples = FFALIGN(s->frame_size * frames_per_packet, 4); if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; dst = (float *)frame->extended_data[0]; - for (int i = 0; i < s->frames_per_packet; i++) { + for (int i = 0; i < frames_per_packet; i++) { ret = speex_modes[s->mode].decode(avctx, &s->st[s->mode], &s->gb, dst + i * s->frame_size); if (ret < 0) return ret; if (avctx->ch_layout.nb_channels == 2) speex_decode_stereo(dst + i * s->frame_size, s->frame_size, &s->stereo); + if (get_bits_left(&s->gb) < 5 || + show_bits(&s->gb, 5) == 15) { + frames_per_packet = i + 1; + break; + } } dst = (float *)frame->extended_data[0]; s->fdsp->vector_fmul_scalar(dst, dst, scale, frame->nb_samples * frame->ch_layout.nb_channels); - frame->nb_samples = s->frame_size * s->frames_per_packet; + frame->nb_samples = s->frame_size * frames_per_packet; *got_frame_ptr = 1; - return buf_size; + return (get_bits_count(&s->gb) + 7) >> 3; } static av_cold int speex_decode_close(AVCodecContext *avctx) @@ -1578,7 +1584,7 @@ const FFCodec ff_speex_decoder = { .p.name = "speex", - .p.long_name = NULL_IF_CONFIG_SMALL("Speex"), + CODEC_LONG_NAME("Speex"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SPEEX, .init = speex_decode_init, @@ -1586,5 +1592,5 @@ .close = speex_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(SpeexContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -92,27 +92,25 @@ /* deprecated decoder */ const FFCodec ff_srt_decoder = { .p.name = "srt", - .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + CODEC_LONG_NAME("SubRip subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, FF_CODEC_DECODE_SUB_CB(srt_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_SUBRIP_DECODER const FFCodec ff_subrip_decoder = { .p.name = "subrip", - .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + CODEC_LONG_NAME("SubRip subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, FF_CODEC_DECODE_SUB_CB(srt_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/srtenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -295,41 +295,38 @@ /* deprecated encoder */ const FFCodec ff_srt_encoder = { .p.name = "srt", - .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + CODEC_LONG_NAME("SubRip subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, FF_CODEC_ENCODE_SUB_CB(srt_encode_frame), .close = srt_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_SUBRIP_ENCODER const FFCodec ff_subrip_encoder = { .p.name = "subrip", - .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + CODEC_LONG_NAME("SubRip subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, FF_CODEC_ENCODE_SUB_CB(srt_encode_frame), .close = srt_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_TEXT_ENCODER const FFCodec ff_text_encoder = { .p.name = "text", - .p.long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), + CODEC_LONG_NAME("Raw text subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_TEXT, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, FF_CODEC_ENCODE_SUB_CB(text_encode_frame), .close = srt_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/startcode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/startcode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/startcode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/startcode.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ * @author Michael Niedermayer */ +#include "libavutil/intreadwrite.h" #include "startcode.h" #include "config.h" @@ -38,14 +39,14 @@ */ #if HAVE_FAST_64BIT while (i < size && - !((~*(const uint64_t *)(buf + i) & - (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) & + !((~AV_RN64(buf + i) & + (AV_RN64(buf + i) - 0x0101010101010101ULL)) & 0x8080808080808080ULL)) i += 8; #else while (i < size && - !((~*(const uint32_t *)(buf + i) & - (*(const uint32_t *)(buf + i) - 0x01010101U)) & + !((~AV_RN32(buf + i) & + (AV_RN32(buf + i) - 0x01010101U)) & 0x80808080U)) i += 4; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/subviewerdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/subviewerdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/subviewerdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/subviewerdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -67,12 +67,11 @@ const FFCodec ff_subviewer_decoder = { .p.name = "subviewer", - .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle"), + CODEC_LONG_NAME("SubViewer subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER, FF_CODEC_DECODE_SUB_CB(subviewer_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrast.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrast.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrast.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrast.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,12 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "sunrast.h" static int sunrast_decode_frame(AVCodecContext *avctx, AVFrame *p, @@ -32,7 +32,8 @@ { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; - unsigned int w, h, depth, type, maptype, maplength, stride, x, y, len, alen; + unsigned int w, h, depth, type, maptype, maplength, x, y, len, alen; + ptrdiff_t stride; uint8_t *ptr, *ptr2 = NULL; const uint8_t *bufstart = buf; int ret; @@ -75,6 +76,12 @@ return AVERROR_PATCHWELCOME; } + if (maplength > 768) { + av_log(avctx, AV_LOG_WARNING, "invalid colormap length\n"); + return AVERROR_INVALIDDATA; + } + + // This also checks depth to be valid switch (depth) { case 1: avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_MONOWHITE; @@ -96,15 +103,23 @@ return AVERROR_INVALIDDATA; } + // This checks w and h to be valid in the sense that bytes of a padded bitmap are addressable with 32bit int ret = ff_set_dimensions(avctx, w, h); if (ret < 0) return ret; + // ensured by ff_set_dimensions() + av_assert0(w <= (INT32_MAX - 7) / depth); + /* scanlines are aligned on 16 bit boundaries */ len = (depth * w + 7) >> 3; alen = len + (len & 1); - if (buf_end - buf < maplength + (len * h) * 3 / 256) + // ensured by ff_set_dimensions() + av_assert0(h <= INT32_MAX / (3 * len)); + + // maplength is limited to 768 and the right term is limited to INT32_MAX / 256 so the add needs no check + if (buf_end - buf < (uint64_t)maplength + (len * h) * 3 / 256) return AVERROR_INVALIDDATA; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) @@ -118,7 +133,7 @@ } else if (maplength) { unsigned int len = maplength / 3; - if (maplength % 3 || maplength > 768) { + if (maplength % 3) { av_log(avctx, AV_LOG_WARNING, "invalid colormap length\n"); return AVERROR_INVALIDDATA; } @@ -142,7 +157,7 @@ if (type == RT_BYTE_ENCODED) { int value, run; - uint8_t *end = ptr + h * stride; + uint8_t *end = ptr + (ptrdiff_t)h * stride; x = 0; while (ptr != end && buf < buf_end) { @@ -207,7 +222,7 @@ const FFCodec ff_sunrast_decoder = { .p.name = "sunrast", - .p.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), + CODEC_LONG_NAME("Sun Rasterfile image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SUNRAST, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrastenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrastenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrastenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/sunrastenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -210,9 +210,10 @@ const FFCodec ff_sunrast_encoder = { .p.name = "sunrast", - .p.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), + CODEC_LONG_NAME("Sun Rasterfile image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SUNRAST, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SUNRASTContext), .init = sunrast_encode_init, FF_CODEC_ENCODE_CB(sunrast_encode_frame), @@ -222,5 +223,4 @@ AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,10 +37,10 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "h263data.h" #include "hpeldsp.h" -#include "internal.h" #include "mathops.h" #include "svq1.h" @@ -73,6 +73,8 @@ int height; int frame_code; int nonref; // 1 if the current frame won't be referenced + + int last_tempref; } SVQ1Context; static const uint8_t string_table[256] = { @@ -229,7 +231,7 @@ } static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, - ptrdiff_t pitch) + ptrdiff_t pitch, int buggy) { uint32_t bit_cache; uint8_t *list[63]; @@ -270,6 +272,13 @@ mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256; + if (buggy) { + if (mean == -128) + mean = 128; + else if (mean == 128) + mean = -128; + } + SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks); for (y = 0; y < height; y++) { @@ -455,7 +464,7 @@ GetBitContext *bitbuf, uint8_t *current, uint8_t *previous, ptrdiff_t pitch, svq1_pmv *motion, int x, int y, - int width, int height) + int width, int height, int buggy) { uint32_t block_type; int result = 0; @@ -487,7 +496,7 @@ ff_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result); break; } - result = svq1_decode_block_non_intra(bitbuf, current, pitch); + result = svq1_decode_block_non_intra(bitbuf, current, pitch, buggy); break; case SVQ1_BLOCK_INTER_4V: @@ -498,7 +507,7 @@ ff_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result); break; } - result = svq1_decode_block_non_intra(bitbuf, current, pitch); + result = svq1_decode_block_non_intra(bitbuf, current, pitch, buggy); break; case SVQ1_BLOCK_INTRA: @@ -524,15 +533,18 @@ out[i] = 0; } -static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) +static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame, int * buggy) { SVQ1Context *s = avctx->priv_data; GetBitContext *bitbuf = &s->gb; int frame_size_code; int width = s->width; int height = s->height; + int tempref; - skip_bits(bitbuf, 8); /* temporal_reference */ + tempref = get_bits(bitbuf, 8); /* temporal_reference */ + *buggy = tempref == 0 && s->last_tempref == 0 && avctx->extradata_size == 0; + s->last_tempref = tempref; /* frame type */ s->nonref = 0; @@ -624,7 +636,7 @@ int buf_size = avpkt->size; SVQ1Context *s = avctx->priv_data; uint8_t *current; - int result, i, x, y, width, height; + int result, i, x, y, width, height, buggy; int ret; /* initialize bit buffer */ @@ -664,7 +676,7 @@ src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i]; } - result = svq1_decode_frame_header(avctx, cur); + result = svq1_decode_frame_header(avctx, cur, &buggy); if (result != 0) { ff_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result); return result; @@ -734,7 +746,7 @@ result = svq1_decode_delta_block(avctx, &s->hdsp, &s->gb, ¤t[x], previous, linesize, - s->pmv, x, y, width, height); + s->pmv, x, y, width, height, buggy); if (result != 0) { ff_dlog(avctx, "Error in svq1_decode_delta_block %i\n", @@ -820,6 +832,8 @@ ff_thread_once(&init_static_once, svq1_static_init); + s->last_tempref = 0xFF; + return 0; } @@ -845,7 +859,7 @@ const FFCodec ff_svq1_decoder = { .p.name = "svq1", - .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), + CODEC_LONG_NAME("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SVQ1, .priv_data_size = sizeof(SVQ1Context), @@ -856,5 +870,4 @@ .flush = svq1_flush, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,44 +37,100 @@ #include "internal.h" #include "mpegutils.h" #include "packet_internal.h" +#include "put_bits.h" #include "svq1.h" -#include "svq1enc.h" +#include "svq1encdsp.h" #include "svq1enc_cb.h" +#include "version.h" + #include "libavutil/avassert.h" +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" + +// Workaround for GCC bug 102513 +#if AV_GCC_VERSION_AT_LEAST(10, 0) && AV_GCC_VERSION_AT_MOST(12, 0) \ + && !defined(__clang__) && !defined(__INTEL_COMPILER) +#pragma GCC optimize ("no-ipa-cp-clone") +#endif + +typedef struct SVQ1EncContext { + /* FIXME: Needed for motion estimation, should not be used for anything + * else, the idea is to make the motion estimation eventually independent + * of MpegEncContext, so this will be removed then. */ + MpegEncContext m; + AVCodecContext *avctx; + MECmpContext mecc; + HpelDSPContext hdsp; + AVFrame *current_picture; + AVFrame *last_picture; + + /* Some compression statistics */ + enum AVPictureType pict_type; + int quality; + + /* why ooh why this sick breadth first order, + * everything is slower and more complex */ + PutBitContext reorder_pb[6]; + + int frame_width; + int frame_height; + + /* Y plane block dimensions */ + int y_block_width; + int y_block_height; + + /* U & V plane (C planes) block dimensions */ + int c_block_width; + int c_block_height; + + DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256]; + + uint16_t *mb_type; + uint32_t *dummy; + int16_t (*motion_val8[3])[2]; + int16_t (*motion_val16[3])[2]; + + int64_t rd_total; + uint8_t *scratchbuf; -static void svq1_write_header(SVQ1EncContext *s, int frame_type) + int motion_est; + + SVQ1EncDSPContext svq1encdsp; +} SVQ1EncContext; + +static void svq1_write_header(SVQ1EncContext *s, PutBitContext *pb, int frame_type) { int i; /* frame code */ - put_bits(&s->pb, 22, 0x20); + put_bits(pb, 22, 0x20); /* temporal reference (sure hope this is a "don't care") */ - put_bits(&s->pb, 8, 0x00); + put_bits(pb, 8, 0x00); /* frame type */ - put_bits(&s->pb, 2, frame_type - 1); + put_bits(pb, 2, frame_type - 1); if (frame_type == AV_PICTURE_TYPE_I) { /* no checksum since frame code is 0x20 */ /* no embedded string either */ /* output 5 unknown bits (2 + 2 + 1) */ - put_bits(&s->pb, 5, 2); /* 2 needed by quicktime decoder */ + put_bits(pb, 5, 2); /* 2 needed by quicktime decoder */ i = ff_match_2uint16((void*)ff_svq1_frame_size_table, FF_ARRAY_ELEMS(ff_svq1_frame_size_table), s->frame_width, s->frame_height); - put_bits(&s->pb, 3, i); + put_bits(pb, 3, i); if (i == 7) { - put_bits(&s->pb, 12, s->frame_width); - put_bits(&s->pb, 12, s->frame_height); + put_bits(pb, 12, s->frame_width); + put_bits(pb, 12, s->frame_height); } } /* no checksum or extra data (next 2 bits get 0) */ - put_bits(&s->pb, 2, 0); + put_bits(pb, 2, 0); } #define QUALITY_THRESHOLD 100 @@ -91,7 +147,7 @@ } static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref, - uint8_t *decoded, int stride, int level, + uint8_t *decoded, int stride, unsigned level, int threshold, int lambda, int intra) { int count, y, x, i, j, split, best_mean, best_score, best_count; @@ -154,7 +210,7 @@ int sqr, diff, score; vector = codebook + stage * size * 16 + i * size; - sqr = s->ssd_int8_vs_int16(vector, block[stage], size); + sqr = s->svq1encdsp.ssd_int8_vs_int16(vector, block[stage], size); diff = block_sum[stage] - sum; score = sqr - (diff * (int64_t)diff >> (level + 3)); // FIXME: 64 bits slooow if (score < best_vector_score) { @@ -185,6 +241,11 @@ } } + if (best_mean == -128) + best_mean = -127; + else if (best_mean == 128) + best_mean = 127; + split = 0; if (best_score > threshold && level) { int score = 0; @@ -248,7 +309,8 @@ } static int svq1_encode_plane(SVQ1EncContext *s, int plane, - unsigned char *src_plane, + PutBitContext *pb, + const unsigned char *src_plane, unsigned char *ref_plane, unsigned char *decoded_plane, int width, int height, int src_stride, int stride) @@ -313,9 +375,9 @@ s->m.mb_type = s->mb_type; // dummies, to avoid segfaults - s->m.current_picture.mb_mean = (uint8_t *)s->dummy; - s->m.current_picture.mb_var = (uint16_t *)s->dummy; - s->m.current_picture.mc_mb_var = (uint16_t *)s->dummy; + s->m.mb_mean = (uint8_t *)s->dummy; + s->m.mb_var = (uint16_t *)s->dummy; + s->m.mc_mb_var = (uint16_t *)s->dummy; s->m.current_picture.mb_type = s->dummy; s->m.current_picture.motion_val[0] = s->motion_val8[plane] + 2; @@ -371,11 +433,11 @@ int count[2][6]; int offset = y * 16 * stride + x * 16; uint8_t *decoded = decoded_plane + offset; - uint8_t *ref = ref_plane + offset; + const uint8_t *ref = ref_plane + offset; int score[4] = { 0, 0, 0, 0 }, best; uint8_t *temp = s->scratchbuf; - if (put_bytes_left(&s->pb, 0) < 3000) { // FIXME: check size + if (put_bytes_left(pb, 0) < 3000) { // FIXME: check size av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } @@ -390,9 +452,8 @@ init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7 * 32); if (s->pict_type == AV_PICTURE_TYPE_P) { - const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; - put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); - score[0] = vlc[1] * lambda; + put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, SVQ1_BLOCK_INTRA_CODE); + score[0] = SVQ1_BLOCK_INTRA_LEN * lambda; } score[0] += encode_block(s, src + 16 * x, NULL, temp, stride, 5, 64, lambda, 1); @@ -406,7 +467,6 @@ best = 0; if (s->pict_type == AV_PICTURE_TYPE_P) { - const uint8_t *vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; int mx, my, pred_x, pred_y, dxy; int16_t *motion_ptr; @@ -417,7 +477,7 @@ init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7 * 32); - put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); + put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTER_LEN, SVQ1_BLOCK_INTER_CODE); s->m.pb = s->reorder_pb[5]; mx = motion_ptr[0]; @@ -442,14 +502,13 @@ decoded, stride, 5, 64, lambda, 0); best = score[1] <= score[0]; - vlc = ff_svq1_block_type_vlc[SVQ1_BLOCK_SKIP]; score[2] = s->mecc.sse[0](NULL, src + 16 * x, ref, stride, 16); - score[2] += vlc[1] * lambda; + score[2] += SVQ1_BLOCK_SKIP_LEN * lambda; if (score[2] < score[best] && mx == 0 && my == 0) { best = 2; s->hdsp.put_pixels_tab[0][0](decoded, ref, stride, 16); - put_bits(&s->pb, vlc[1], vlc[0]); + put_bits(pb, SVQ1_BLOCK_SKIP_LEN, SVQ1_BLOCK_SKIP_CODE); } } @@ -474,7 +533,7 @@ if (best != 2) for (i = 5; i >= 0; i--) - ff_copy_bits(&s->pb, reorder_buffer[best][i], + ff_copy_bits(pb, reorder_buffer[best][i], count[best][i]); if (best == 0) s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16); @@ -489,17 +548,16 @@ SVQ1EncContext *const s = avctx->priv_data; int i; - if (avctx->frame_number) + if (avctx->frame_num) av_log(avctx, AV_LOG_DEBUG, "RD: %f\n", s->rd_total / (double)(avctx->width * avctx->height * - avctx->frame_number)); + avctx->frame_num)); s->m.mb_type = NULL; ff_mpv_common_end(&s->m); av_freep(&s->m.me.scratchpad); av_freep(&s->m.me.map); - av_freep(&s->m.me.score_map); av_freep(&s->mb_type); av_freep(&s->dummy); av_freep(&s->scratchbuf); @@ -515,6 +573,19 @@ return 0; } +static av_cold int write_ident(AVCodecContext *avctx, const char *ident) +{ + int size = strlen(ident); + avctx->extradata = av_malloc(size + 8); + if (!avctx->extradata) + return AVERROR(ENOMEM); + AV_WB32(avctx->extradata, size + 8); + AV_WL32(avctx->extradata + 4, MKTAG('S', 'V', 'Q', '1')); + memcpy(avctx->extradata + 8, ident, size); + avctx->extradata_size = size + 8; + return 0; +} + static av_cold int svq1_encode_init(AVCodecContext *avctx) { SVQ1EncContext *const s = avctx->priv_data; @@ -555,34 +626,34 @@ s->m.me.temp = s->m.me.scratchpad = av_mallocz((avctx->width + 64) * 2 * 16 * 2 * sizeof(uint8_t)); - s->m.me.map = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t)); - s->m.me.score_map = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t)); s->mb_type = av_mallocz((s->y_block_width + 1) * s->y_block_height * sizeof(int16_t)); s->dummy = av_mallocz((s->y_block_width + 1) * s->y_block_height * sizeof(int32_t)); - s->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; + s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map)); + s->svq1encdsp.ssd_int8_vs_int16 = ssd_int8_vs_int16_c; if (!s->m.me.temp || !s->m.me.scratchpad || !s->m.me.map || - !s->m.me.score_map || !s->mb_type || !s->dummy) { + !s->mb_type || !s->dummy) return AVERROR(ENOMEM); - } + s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; #if ARCH_PPC - ff_svq1enc_init_ppc(s); + ff_svq1enc_init_ppc(&s->svq1encdsp); #elif ARCH_X86 - ff_svq1enc_init_x86(s); + ff_svq1enc_init_x86(&s->svq1encdsp); #endif ff_h263_encode_init(&s->m); // mv_penalty - return 0; + return write_ident(avctx, s->avctx->flags & AV_CODEC_FLAG_BITEXACT ? "Lavc" : LIBAVCODEC_IDENT); } static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { SVQ1EncContext *const s = avctx->priv_data; + PutBitContext pb; int i, ret; ret = ff_alloc_packet(avctx, pkt, s->y_block_width * s->y_block_height * @@ -613,9 +684,7 @@ FFSWAP(AVFrame*, s->current_picture, s->last_picture); - init_put_bits(&s->pb, pkt->data, pkt->size); - - if (avctx->gop_size && (avctx->frame_number % avctx->gop_size)) + if (avctx->gop_size && (avctx->frame_num % avctx->gop_size)) s->pict_type = AV_PICTURE_TYPE_P; else s->pict_type = AV_PICTURE_TYPE_I; @@ -623,9 +692,10 @@ ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type); - svq1_write_header(s, s->pict_type); + init_put_bits(&pb, pkt->data, pkt->size); + svq1_write_header(s, &pb, s->pict_type); for (i = 0; i < 3; i++) { - int ret = svq1_encode_plane(s, i, + int ret = svq1_encode_plane(s, i, &pb, pict->data[i], s->last_picture->data[i], s->current_picture->data[i], @@ -645,13 +715,13 @@ } } - // align_put_bits(&s->pb); - while (put_bits_count(&s->pb) & 31) - put_bits(&s->pb, 1, 0); + // align_put_bits(&pb); + while (put_bits_count(&pb) & 31) + put_bits(&pb, 1, 0); - flush_put_bits(&s->pb); + flush_put_bits(&pb); - pkt->size = put_bytes_output(&s->pb); + pkt->size = put_bytes_output(&pb); if (s->pict_type == AV_PICTURE_TYPE_I) pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; @@ -679,9 +749,10 @@ const FFCodec ff_svq1_encoder = { .p.name = "svq1", - .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), + CODEC_LONG_NAME("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SVQ1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(SVQ1EncContext), .p.priv_class = &svq1enc_class, .init = svq1_encode_init, @@ -689,5 +760,5 @@ .close = svq1_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1encdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1encdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1encdsp.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1encdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * SVQ1 encoder DSP + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_SVQ1ENCDSP_H +#define AVCODEC_SVQ1ENCDSP_H + +#include + +typedef struct SVQ1EncDSPContext { + int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2, + intptr_t size); +} SVQ1EncDSPContext; + +void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c); +void ff_svq1enc_init_x86(SVQ1EncDSPContext *c); + +#endif /* AVCODEC_SVQ1ENCDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1enc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* - * SVQ1 encoder - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_SVQ1ENC_H -#define AVCODEC_SVQ1ENC_H - -#include - -#include "libavutil/frame.h" -#include "libavutil/mem_internal.h" - -#include "avcodec.h" -#include "hpeldsp.h" -#include "me_cmp.h" -#include "mpegvideo.h" -#include "put_bits.h" - -typedef struct SVQ1EncContext { - /* FIXME: Needed for motion estimation, should not be used for anything - * else, the idea is to make the motion estimation eventually independent - * of MpegEncContext, so this will be removed then. */ - MpegEncContext m; - AVCodecContext *avctx; - MECmpContext mecc; - HpelDSPContext hdsp; - AVFrame *current_picture; - AVFrame *last_picture; - PutBitContext pb; - - /* Some compression statistics */ - enum AVPictureType pict_type; - int quality; - - /* why ooh why this sick breadth first order, - * everything is slower and more complex */ - PutBitContext reorder_pb[6]; - - int frame_width; - int frame_height; - - /* Y plane block dimensions */ - int y_block_width; - int y_block_height; - - /* U & V plane (C planes) block dimensions */ - int c_block_width; - int c_block_height; - - DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256]; - - uint16_t *mb_type; - uint32_t *dummy; - int16_t (*motion_val8[3])[2]; - int16_t (*motion_val16[3])[2]; - - int64_t rd_total; - - uint8_t *scratchbuf; - - int motion_est; - - int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2, - intptr_t size); -} SVQ1EncContext; - -void ff_svq1enc_init_ppc(SVQ1EncContext *c); -void ff_svq1enc_init_x86(SVQ1EncContext *c); - -#endif /* AVCODEC_SVQ1ENC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1.h 2023-03-03 13:29:59.000000000 +0000 @@ -37,11 +37,21 @@ #include +#include "libavutil/attributes_internal.h" + #define SVQ1_BLOCK_SKIP 0 #define SVQ1_BLOCK_INTER 1 #define SVQ1_BLOCK_INTER_4V 2 #define SVQ1_BLOCK_INTRA 3 +#define SVQ1_BLOCK_SKIP_CODE 1 +#define SVQ1_BLOCK_SKIP_LEN 1 +#define SVQ1_BLOCK_INTER_CODE 1 +#define SVQ1_BLOCK_INTER_LEN 2 +#define SVQ1_BLOCK_INTRA_CODE 0 +#define SVQ1_BLOCK_INTRA_LEN 3 + +FF_VISIBILITY_PUSH_HIDDEN extern const int8_t *const ff_svq1_inter_codebooks[6]; extern const int8_t *const ff_svq1_intra_codebooks[6]; @@ -52,5 +62,6 @@ extern const uint16_t ff_svq1_inter_mean_vlc[512][2]; extern const uint16_t ff_svq1_frame_size_table[7][2]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_SVQ1_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1_vlc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1_vlc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1_vlc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq1_vlc.h 2023-03-03 13:29:59.000000000 +0000 @@ -167,7 +167,7 @@ { 0xA0, 22 }, { 0xA1, 22 }, { 0xA2, 22 }, { 0xA3, 22 }, { 0xA4, 22 }, { 0xA5, 22 }, { 0xA6, 22 }, { 0xA7, 22 }, { 0xA8, 22 }, { 0xA9, 22 }, { 0xAA, 22 }, { 0xAB, 22 }, - { 0x7F, 22 }, { 0x8F, 21 }, { 0xAC, 22 }, { 0xAD, 22 }, + { 0x8E, 21 }, { 0x8F, 21 }, { 0xAC, 22 }, { 0xAD, 22 }, { 0xAE, 22 }, { 0xAF, 22 }, { 0xB0, 22 }, { 0xB1, 22 }, { 0x53, 20 }, { 0x90, 21 }, { 0xB2, 22 }, { 0x91, 21 }, { 0xB3, 22 }, { 0xB4, 22 }, { 0x54, 20 }, { 0xB5, 22 }, @@ -231,7 +231,7 @@ { 0x87, 21 }, { 0x4F, 20 }, { 0x35, 19 }, { 0x4E, 20 }, { 0x33, 19 }, { 0x32, 19 }, { 0x4D, 20 }, { 0x4C, 20 }, { 0x83, 22 }, { 0x4B, 20 }, { 0x81, 22 }, { 0x80, 22 }, - { 0x8E, 21 }, { 0x7E, 22 }, { 0x7D, 22 }, { 0x84, 21 }, + { 0x7F, 22 }, { 0x7E, 22 }, { 0x7D, 22 }, { 0x84, 21 }, { 0x8D, 21 }, { 0x7A, 22 }, { 0x79, 22 }, { 0x4A, 20 }, { 0x77, 22 }, { 0x76, 22 }, { 0x89, 21 }, { 0x74, 22 }, { 0x73, 22 }, { 0x72, 22 }, { 0x49, 20 }, { 0x70, 22 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/svq3.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,7 +47,7 @@ #include "libavutil/mem_internal.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "avcodec.h" #include "mpegutils.h" #include "h264data.h" @@ -65,8 +65,6 @@ #include #endif -#include "svq1.h" - /** * @file * svq3 decoder. @@ -1039,15 +1037,16 @@ } memcpy(s->slice_buf, s->gb.buffer + s->gb.index / 8, slice_bytes); + if (length > 0) { + memmove(s->slice_buf, &s->slice_buf[slice_length], length - 1); + } + if (s->watermark_key) { uint32_t header = AV_RL32(&s->slice_buf[1]); AV_WL32(&s->slice_buf[1], header ^ s->watermark_key); } init_get_bits(&s->gb_slice, s->slice_buf, slice_bits); - if (length > 0) { - memmove(s->slice_buf, &s->slice_buf[slice_length], length - 1); - } skip_bits_long(&s->gb, slice_bytes * 8); } @@ -1543,12 +1542,12 @@ left = buf_size*8 - get_bits_count(&s->gb_slice); if (s->mb_y != s->mb_height || s->mb_x != s->mb_width) { - av_log(avctx, AV_LOG_INFO, "frame num %d incomplete pic x %d y %d left %d\n", avctx->frame_number, s->mb_y, s->mb_x, left); + av_log(avctx, AV_LOG_INFO, "frame num %"PRId64" incomplete pic x %d y %d left %d\n", avctx->frame_num, s->mb_y, s->mb_x, left); //av_hex_dump(stderr, buf+buf_size-8, 8); } if (left < 0) { - av_log(avctx, AV_LOG_ERROR, "frame num %d left %d\n", avctx->frame_number, left); + av_log(avctx, AV_LOG_ERROR, "frame num %"PRId64" left %d\n", avctx->frame_num, left); return -1; } @@ -1590,7 +1589,7 @@ const FFCodec ff_svq3_decoder = { .p.name = "svq3", - .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"), + CODEC_LONG_NAME("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SVQ3, .priv_data_size = sizeof(SVQ3Context), @@ -1602,5 +1601,5 @@ AV_CODEC_CAP_DELAY, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE}, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,20 +19,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "fft.h" #include "dcadct.h" #include "dcamath.h" #include "synth_filter.h" -static void synth_filter_float(FFTContext *imdct, +static void synth_filter_float(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], - float out[32], const float in[32], float scale) + float out[32], float in[32], float scale, + av_tx_fn imdct_fn) { float *synth_buf = synth_buf_ptr + *synth_buf_offset; int i, j; - imdct->imdct_half(imdct, synth_buf, in); + imdct_fn(imdct, synth_buf, in, sizeof(float)); for (i = 0; i < 16; i++) { float a = synth_buf2[i ]; @@ -60,15 +60,16 @@ *synth_buf_offset = (*synth_buf_offset - 32) & 511; } -static void synth_filter_float_64(FFTContext *imdct, +static void synth_filter_float_64(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[64], const float window[1024], - float out[64], const float in[64], float scale) + float out[64], float in[64], float scale, + av_tx_fn imdct_fn) { float *synth_buf = synth_buf_ptr + *synth_buf_offset; int i, j; - imdct->imdct_half(imdct, synth_buf, in); + imdct_fn(imdct, synth_buf, in, sizeof(float)); for (i = 0; i < 32; i++) { float a = synth_buf2[i ]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/synth_filter.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,19 +21,20 @@ #ifndef AVCODEC_SYNTH_FILTER_H #define AVCODEC_SYNTH_FILTER_H -#include "fft.h" +#include "libavutil/tx.h" #include "dcadct.h" typedef struct SynthFilterContext { - void (*synth_filter_float)(FFTContext *imdct, + void (*synth_filter_float)(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], - float out[32], const float in[32], - float scale); - void (*synth_filter_float_64)(FFTContext *imdct, + float out[32], float in[32], + float scale, av_tx_fn imdct_fn); + void (*synth_filter_float_64)(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[64], const float window[1024], - float out[64], const float in[64], float scale); + float out[64], float in[64], float scale, + av_tx_fn imdct_fn); void (*synth_filter_fixed)(DCADCTContext *imdct, int32_t *synth_buf_ptr, int *synth_buf_offset, int32_t synth_buf2[32], const int32_t window[512], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavutil/crc.h" #include "libavutil/intreadwrite.h" +#define CACHED_BITSTREAM_READER !ARCH_X86_32 #define BITSTREAM_READER_LE #include "tak.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/takdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/takdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/takdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/takdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "libavutil/mem_internal.h" #include "libavutil/samplefmt.h" +#define CACHED_BITSTREAM_READER !ARCH_X86_32 #define BITSTREAM_READER_LE #include "audiodsp.h" #include "thread.h" @@ -502,8 +503,6 @@ memcpy(s->residues, &s->residues[y], 2 * filter_order); } - emms_c(); - return 0; } @@ -660,8 +659,6 @@ memmove(s->residues, &s->residues[tmp], 2 * filter_order); } - - emms_c(); break; } } @@ -943,18 +940,17 @@ const FFCodec ff_tak_decoder = { .p.name = "tak", - .p.long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"), + CODEC_LONG_NAME("TAK (Tom's lossless Audio Kompressor)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TAK, .priv_data_size = sizeof(TAKDecContext), .init = tak_decode_init, .close = tak_decode_close, FF_CODEC_DECODE_CB(tak_decode_frame), - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), + UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tak_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ * TAK parser **/ +#define CACHED_BITSTREAM_READER !ARCH_X86_32 #define BITSTREAM_READER_LE #include "parser.h" #include "tak.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,12 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "targa.h" typedef struct TargaContext { @@ -255,49 +253,48 @@ } } - if (compr & TGA_RLE) { - int res = targa_decode_rle(avctx, s, dst, w, h, stride, bpp, interleave); - if (res < 0) - return res; - } else { - uint8_t *line; - if (bytestream2_get_bytes_left(&s->gb) < img_size * h) { - av_log(avctx, AV_LOG_ERROR, - "Not enough data available for image\n"); - return AVERROR_INVALIDDATA; - } - - line = dst; - y = 0; - do { - bytestream2_get_buffer(&s->gb, line, img_size); - line = advance_line(dst, line, stride, &y, h, interleave); - } while (line); + if (compr & TGA_RLE) { + int res = targa_decode_rle(avctx, s, dst, w, h, stride, bpp, interleave); + if (res < 0) + return res; + } else { + uint8_t *line; + if (bytestream2_get_bytes_left(&s->gb) < img_size * h) { + av_log(avctx, AV_LOG_ERROR, + "Not enough data available for image\n"); + return AVERROR_INVALIDDATA; } - if (flags & TGA_RIGHTTOLEFT) { // right-to-left, needs horizontal flip - int x; - for (y = 0; y < h; y++) { - void *line = &p->data[0][y * p->linesize[0]]; - for (x = 0; x < w >> 1; x++) { - switch (bpp) { - case 32: - FFSWAP(uint32_t, ((uint32_t *)line)[x], ((uint32_t *)line)[w - x - 1]); - break; - case 24: - FFSWAP(uint8_t, ((uint8_t *)line)[3 * x ], ((uint8_t *)line)[3 * w - 3 * x - 3]); - FFSWAP(uint8_t, ((uint8_t *)line)[3 * x + 1], ((uint8_t *)line)[3 * w - 3 * x - 2]); - FFSWAP(uint8_t, ((uint8_t *)line)[3 * x + 2], ((uint8_t *)line)[3 * w - 3 * x - 1]); - break; - case 16: - FFSWAP(uint16_t, ((uint16_t *)line)[x], ((uint16_t *)line)[w - x - 1]); - break; - case 8: - FFSWAP(uint8_t, ((uint8_t *)line)[x], ((uint8_t *)line)[w - x - 1]); - } + line = dst; + y = 0; + do { + bytestream2_get_buffer(&s->gb, line, img_size); + line = advance_line(dst, line, stride, &y, h, interleave); + } while (line); + } + + if (flags & TGA_RIGHTTOLEFT) { // right-to-left, needs horizontal flip + for (int y = 0; y < h; y++) { + void *line = &p->data[0][y * p->linesize[0]]; + for (int x = 0; x < w >> 1; x++) { + switch (bpp) { + case 32: + FFSWAP(uint32_t, ((uint32_t *)line)[x], ((uint32_t *)line)[w - x - 1]); + break; + case 24: + FFSWAP(uint8_t, ((uint8_t *)line)[3 * x ], ((uint8_t *)line)[3 * w - 3 * x - 3]); + FFSWAP(uint8_t, ((uint8_t *)line)[3 * x + 1], ((uint8_t *)line)[3 * w - 3 * x - 2]); + FFSWAP(uint8_t, ((uint8_t *)line)[3 * x + 2], ((uint8_t *)line)[3 * w - 3 * x - 1]); + break; + case 16: + FFSWAP(uint16_t, ((uint16_t *)line)[x], ((uint16_t *)line)[w - x - 1]); + break; + case 8: + FFSWAP(uint8_t, ((uint8_t *)line)[x], ((uint8_t *)line)[w - x - 1]); } } } + } *got_frame = 1; @@ -307,7 +304,7 @@ const FFCodec ff_targa_decoder = { .p.name = "targa", - .p.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), + CODEC_LONG_NAME("Truevision Targa image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TARGA, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,7 +72,7 @@ { int i, n = bpp * w; uint8_t *out = outbuf; - uint8_t *ptr = pic->data[0]; + const uint8_t *ptr = pic->data[0]; for(i=0; i < h; i++) { memcpy(out, ptr, n); @@ -204,9 +204,10 @@ const FFCodec ff_targa_encoder = { .p.name = "targa", - .p.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), + CODEC_LONG_NAME("Truevision Targa image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TARGA, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(TargaContext), .p.priv_class = &targa_class, .init = targa_encode_init, @@ -215,5 +216,4 @@ AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa_y216dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa_y216dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa_y216dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/targa_y216dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int y216_decode_init(AVCodecContext *avctx) { @@ -75,11 +75,10 @@ const FFCodec ff_targa_y216_decoder = { .p.name = "targa_y216", - .p.long_name = NULL_IF_CONFIG_SMALL("Pinnacle TARGA CineWave YUV16"), + CODEC_LONG_NAME("Pinnacle TARGA CineWave YUV16"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TARGA_Y216, .init = y216_decode_init, FF_CODEC_DECODE_CB(y216_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tdsc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tdsc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tdsc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tdsc.c 2023-03-03 13:29:59.000000000 +0000 @@ -41,7 +41,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define BITMAPINFOHEADER_SIZE 0x28 #define TDSF_HEADER_SIZE 0x56 @@ -623,7 +623,7 @@ const FFCodec ff_tdsc_decoder = { .p.name = "tdsc", - .p.long_name = NULL_IF_CONFIG_SMALL("TDSC"), + CODEC_LONG_NAME("TDSC"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TDSC, .init = tdsc_init, @@ -631,6 +631,5 @@ .close = tdsc_close, .priv_data_size = sizeof(TDSCContext), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/avcodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/avcodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/avcodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/avcodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -155,6 +155,13 @@ if (codec->capabilities & AV_CODEC_CAP_FRAME_THREADS && codec->capabilities & AV_CODEC_CAP_ENCODER_FLUSH) ERR("Frame-threaded encoder %s claims to support flushing\n"); + if (codec->capabilities & AV_CODEC_CAP_FRAME_THREADS && + codec->capabilities & AV_CODEC_CAP_DELAY) + ERR("Frame-threaded encoder %s claims to have delay\n"); + + if (codec2->caps_internal & FF_CODEC_CAP_EOF_FLUSH && + !(codec->capabilities & AV_CODEC_CAP_DELAY)) + ERR("EOF_FLUSH encoder %s is not marked as having delay\n"); } else { if ((codec->type == AVMEDIA_TYPE_SUBTITLE) != (codec2->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB)) ERR("Subtitle decoder %s does not implement decode_sub callback\n"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_be.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_be.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_be.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_be.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "bitstream_template.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_le.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_le.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_le.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_le.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,20 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define BITSTREAM_LE +#include "bitstream_template.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_template.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/bitstream_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,200 @@ +/* + * cached bitstream reader test + * copyright (c) 2022 Anton Khirnov + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define ASSERT_LEVEL 2 + +#include "libavutil/avassert.h" +#include "libavutil/lfg.h" +#include "libavutil/random_seed.h" + +#include "libavcodec/bitstream.h" +#include "libavcodec/defs.h" + +#ifdef BITSTREAM_LE +#define BITSTREAM_WRITER_LE +#endif +#include "libavcodec/put_bits.h" + +#define SIZE 157 + +enum Op { + OP_READ, + OP_READ_NZ, + OP_READ_BIT, + OP_READ_63, + OP_READ_64, + OP_READ_SIGNED, + OP_READ_SIGNED_NZ, + OP_APPLY_SIGN, + OP_ALIGN, + OP_NB, +}; + +int main(int argc, char **argv) +{ + BitstreamContext bc; + PutBitContext pb; + AVLFG lfg; + + uint8_t buf[SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; + uint8_t dst[SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; + + uint32_t random_seed; + uint64_t val, val1; + int32_t sval, sval1; + unsigned count; + + /* generate random input, using a given or random seed */ + if (argc > 1) + random_seed = strtoul(argv[1], NULL, 0); + else + random_seed = av_get_random_seed(); + + fprintf(stderr, "Testing with LFG seed: %"PRIu32"\n", random_seed); + av_lfg_init(&lfg, random_seed); + + for (unsigned i = 0; i < SIZE; i++) + buf[i] = av_lfg_get(&lfg); + + bits_init8 (&bc, buf, SIZE); + init_put_bits(&pb, dst, SIZE); + + /* use a random sequence of bitreading operations to transfer data + * from BitstreamContext to PutBitContext */ + while (bits_left(&bc) > 0) { + enum Op op = av_lfg_get(&lfg) % OP_NB; + + switch (op) { + case OP_READ: + count = av_lfg_get(&lfg) % FFMIN(33, bits_left(&bc) + 1); + val1 = bits_peek(&bc, count); + val = bits_read(&bc, count); + + fprintf(stderr, "%d read %u: %"PRIu64"\n", bits_tell(&bc) - count, count, val); + + av_assert0(val == val1); + + put_bits64(&pb, count, val); + break; + case OP_READ_NZ: + count = av_lfg_get(&lfg) % FFMIN(33, bits_left(&bc) + 1); + count = FFMAX(count, 1); + val1 = bits_peek_nz(&bc, count); + val = bits_read_nz(&bc, count); + + fprintf(stderr, "%d read_nz %u: %"PRIu64"\n", bits_tell(&bc) - count, count, val); + + av_assert0(val == val1); + + put_bits64(&pb, count, val); + break; + case OP_READ_BIT: + val = bits_read_bit(&bc); + + fprintf(stderr, "%d read_bit: %"PRIu64"\n", bits_tell(&bc) - 1, val); + + put_bits(&pb, 1, val); + break; + case OP_READ_63: + count = av_lfg_get(&lfg) % FFMIN(64, bits_left(&bc) + 1); + val = bits_read_63(&bc, count); + + fprintf(stderr, "%d read_63 %u: %"PRIu64"\n", bits_tell(&bc) - count, count, val); + + put_bits64(&pb, count, val); + break; + case OP_READ_64: + count = av_lfg_get(&lfg) % FFMIN(65, bits_left(&bc) + 1); + val = bits_read_64(&bc, count); + + fprintf(stderr, "%d read_64 %u: %"PRIu64"\n", bits_tell(&bc) - count, count, val); + + put_bits64(&pb, count, val); + break; + case OP_READ_SIGNED: + count = av_lfg_get(&lfg) % FFMIN(33, bits_left(&bc) + 1); + sval1 = bits_peek_signed(&bc, count); + sval = bits_read_signed(&bc, count); + + fprintf(stderr, "%d read_signed %u: %"PRId32"\n", bits_tell(&bc) - count, count, sval); + + av_assert0(sval == sval1); + + if (count == 32) put_bits32(&pb, sval); + else put_sbits(&pb, count, sval); + break; + case OP_READ_SIGNED_NZ: + count = av_lfg_get(&lfg) % FFMIN(33, bits_left(&bc) + 1); + count = FFMAX(count, 1); + sval1 = bits_peek_signed_nz(&bc, count); + sval = bits_read_signed_nz(&bc, count); + + fprintf(stderr, "%d read_signed_nz %u: %"PRId32"\n", bits_tell(&bc) - count, count, sval); + + av_assert0(sval == sval1); + + if (count == 32) put_bits32(&pb, sval); + else put_sbits(&pb, count, sval); + break; + case OP_ALIGN: + count = (bits_tell(&bc) + 7) / 8 * 8 - bits_tell(&bc); + + fprintf(stderr, "%d align %u\n", bits_tell(&bc), count); + + put_bits(&pb, count, bits_peek(&bc, count)); + bits_align(&bc); + break; + case OP_APPLY_SIGN: + if (bits_left(&bc) < 2) + continue; + + count = av_lfg_get(&lfg) % FFMIN(32, bits_left(&bc)); + count = FFMAX(count, 1); + + if (!bits_peek(&bc, count)) + continue; + + val = bits_read(&bc, count); + sval = bits_apply_sign(&bc, val); + + fprintf(stderr, "%d apply_sign %u %"PRId32"\n", + bits_tell(&bc) - count - 1, count, sval); + + put_bits64(&pb, count, FFABS(sval)); + put_bits(&pb, 1, sval < 0); + + break; + default: + av_assert0(0); + } + } + + flush_put_bits(&pb); + + for (unsigned i = 0; i < SIZE; i++) + if (buf[i] != dst[i]) { + fprintf(stderr, "Mismatch at byte %u: %hhu %hhu; seed %"PRIu32"\n", + i, buf[i], dst[i], random_seed); + return 1; + } + + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/fft.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/fft.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/fft.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/fft.c 2023-03-03 13:29:59.000000000 +0000 @@ -226,6 +226,7 @@ #endif } +#if CONFIG_MDCT static inline void mdct_init(FFTContext **s, int nbits, int inverse, double scale) { #if AVFFT @@ -252,6 +253,7 @@ s->imdct_calc(s, output, input); #endif } +#endif static inline void fft_permute(FFTContext *s, FFTComplex *z) { @@ -592,12 +594,14 @@ time_start = av_gettime_relative(); for (it = 0; it < nb_its; it++) { switch (transform) { +#if CONFIG_MDCT case TRANSFORM_MDCT: if (do_inverse) imdct_calc(m, &tab->re, &tab1->re); else mdct_calc(m, &tab->re, &tab1->re); break; +#endif case TRANSFORM_FFT: memcpy(tab, tab1, fft_size * sizeof(FFTComplex)); fft_calc(s, tab); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/mpeg12framerate.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/mpeg12framerate.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/mpeg12framerate.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tests/mpeg12framerate.c 2023-03-03 13:29:59.000000000 +0000 @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + +#include "libavutil/log.h" #include "libavcodec/mpeg12.h" #include "libavcodec/mpeg12data.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/textdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/textdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/textdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/textdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -82,7 +82,7 @@ #if CONFIG_TEXT_DECODER const FFCodec ff_text_decoder = { .p.name = "text", - .p.long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), + CODEC_LONG_NAME("Raw text subtitle"), .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_TEXT, @@ -90,7 +90,6 @@ .init = ff_ass_subtitle_header_default, .p.priv_class = &textsub_decoder_class, .flush = text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -106,7 +105,7 @@ #if CONFIG_VPLAYER_DECODER const FFCodec ff_vplayer_decoder = { .p.name = "vplayer", - .p.long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitle"), + CODEC_LONG_NAME("VPlayer subtitle"), .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_VPLAYER, @@ -114,14 +113,13 @@ .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_STL_DECODER const FFCodec ff_stl_decoder = { .p.name = "stl", - .p.long_name = NULL_IF_CONFIG_SMALL("Spruce subtitle format"), + CODEC_LONG_NAME("Spruce subtitle format"), .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_STL, @@ -129,14 +127,13 @@ .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PJS_DECODER const FFCodec ff_pjs_decoder = { .p.name = "pjs", - .p.long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"), + CODEC_LONG_NAME("PJS subtitle"), .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_PJS, @@ -144,14 +141,13 @@ .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_SUBVIEWER1_DECODER const FFCodec ff_subviewer1_decoder = { .p.name = "subviewer1", - .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"), + CODEC_LONG_NAME("SubViewer1 subtitle"), .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER1, @@ -159,7 +155,6 @@ .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/threadframe.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/threadframe.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/threadframe.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/threadframe.h 2023-03-03 13:29:59.000000000 +0000 @@ -56,7 +56,7 @@ * @param field The field being referenced, for field-picture codecs. * 0 for top field or frame pictures, 1 for bottom field. */ -void ff_thread_await_progress(ThreadFrame *f, int progress, int field); +void ff_thread_await_progress(const ThreadFrame *f, int progress, int field); /** * Wrapper around ff_get_buffer() for frame-multithreaded codecs. @@ -84,4 +84,6 @@ int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src); +int ff_thread_can_start_frame(AVCodecContext *avctx); + #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/thread.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/thread.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/thread.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/thread.h 2023-03-03 13:29:59.000000000 +0000 @@ -62,19 +62,7 @@ */ void ff_thread_finish_setup(AVCodecContext *avctx); -#if FF_API_THREAD_SAFE_CALLBACKS -/** - * Wrapper around get_format() for frame-multithreaded codecs. - * Call this function instead of avctx->get_format(). - * Cannot be called after the codec has called ff_thread_finish_setup(). - * - * @param avctx The current context. - * @param fmt The list of available formats. - */ -enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); -#else #define ff_thread_get_format ff_get_format -#endif /** * Wrapper around get_buffer() for frame-multithreaded codecs. @@ -104,8 +92,7 @@ int (*action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr), int (*main_func)(AVCodecContext *c), void *arg, int *ret, int job_count); void ff_thread_free(AVCodecContext *s); -int ff_alloc_entries(AVCodecContext *avctx, int count); -void ff_reset_entries(AVCodecContext *avctx); +int ff_slice_thread_allocz_entries(AVCodecContext *avctx, int count); int ff_slice_thread_init_progress(AVCodecContext *avctx); void ff_thread_report_progress2(AVCodecContext *avctx, int field, int thread, int n); void ff_thread_await_progress2(AVCodecContext *avctx, int field, int thread, int shift); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiertexseqv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiertexseqv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiertexseqv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiertexseqv.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,8 +27,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct SeqVideoContext { @@ -263,7 +263,7 @@ const FFCodec ff_tiertexseqvideo_decoder = { .p.name = "tiertexseqvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ video"), + CODEC_LONG_NAME("Tiertex Limited SEQ video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TIERTEXSEQVIDEO, .priv_data_size = sizeof(SeqVideoContext), @@ -271,5 +271,4 @@ .close = seqvideo_decode_end, FF_CODEC_DECODE_CB(seqvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,20 +33,19 @@ #include #endif +#include + #include "libavutil/attributes.h" -#include "libavutil/avstring.h" #include "libavutil/error.h" #include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/reverse.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "faxcompr.h" -#include "internal.h" #include "lzw.h" -#include "mathops.h" #include "tiff.h" #include "tiff_data.h" #include "mjpegdec.h" @@ -85,8 +84,17 @@ unsigned last_tag; int is_bayer; + int use_color_matrix; uint8_t pattern[4]; - unsigned black_level; + + float analog_balance[4]; + float as_shot_neutral[4]; + float as_shot_white[4]; + float color_matrix[3][4]; + float camera_calibration[4][4]; + float premultiply[4]; + float black_level[4]; + unsigned white_level; uint16_t dng_lut[65536]; @@ -102,7 +110,6 @@ int is_tiled; int tile_byte_counts_offset, tile_offsets_offset; int tile_width, tile_length; - int tile_count; int is_jpeg; @@ -115,6 +122,8 @@ TiffGeoTag *geotags; } TiffContext; +static const float d65_white[3] = { 0.950456f, 1.f, 1.088754f }; + static void tiff_set_type(TiffContext *s, enum TiffType tiff_type) { if (s->tiff_type < tiff_type) // Prioritize higher-valued entries s->tiff_type = tiff_type; @@ -280,29 +289,26 @@ */ static uint16_t av_always_inline dng_process_color16(uint16_t value, const uint16_t *lut, - uint16_t black_level, + float black_level, float scale_factor) { float value_norm; // Lookup table lookup - if (lut) - value = lut[value]; + value = lut[value]; // Black level subtraction - value = av_clip_uint16_c((unsigned)value - black_level); - // Color scaling - value_norm = (float)value * scale_factor; + value_norm = ((float)value - black_level) * scale_factor; - value = av_clip_uint16_c(value_norm * 65535); + value = av_clip_uint16(lrintf(value_norm)); return value; } static uint16_t av_always_inline dng_process_color8(uint16_t value, const uint16_t *lut, - uint16_t black_level, + float black_level, float scale_factor) { return dng_process_color16(value, lut, black_level, scale_factor) >> 8; @@ -310,12 +316,18 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int width, int height, - int is_single_comp, int is_u16) + int is_single_comp, int is_u16, int odd_line) { + float scale_factor[4]; int line, col; - float scale_factor; - scale_factor = 1.0f / (s->white_level - s->black_level); + if (s->is_bayer) { + for (int i = 0; i < 4; i++) + scale_factor[i] = s->premultiply[s->pattern[i]] * 65535.f / (s->white_level - s->black_level[i]); + } else { + for (int i = 0; i < 4; i++) + scale_factor[i] = s->premultiply[ i ] * 65535.f / (s->white_level - s->black_level[i]); + } if (is_single_comp) { if (!is_u16) @@ -329,7 +341,7 @@ /* Blit first half of input row row to initial row of output */ for (col = 0; col < width; col++) - *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, s->black_level, scale_factor); + *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, s->black_level[col&1], scale_factor[col&1]); /* Advance the destination pointer by a row (source pointer remains in the same place) */ dst += dst_stride * sizeof(uint16_t); @@ -337,7 +349,7 @@ /* Blit second half of input row row to next row of output */ for (col = 0; col < width; col++) - *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, s->black_level, scale_factor); + *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, s->black_level[(col&1) + 2], scale_factor[(col&1) + 2]); dst += dst_stride * sizeof(uint16_t); src += src_stride * sizeof(uint16_t); @@ -351,7 +363,9 @@ uint16_t *src_u16 = (uint16_t *)src; for (col = 0; col < width; col++) - *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, s->black_level, scale_factor); + *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, + s->black_level[(col&1) + 2 * ((line&1) + odd_line)], + scale_factor[(col&1) + 2 * ((line&1) + odd_line)]); dst += dst_stride * sizeof(uint16_t); src += src_stride * sizeof(uint16_t); @@ -362,7 +376,9 @@ const uint8_t *src_u8 = src; for (col = 0; col < width; col++) - *dst_u8++ = dng_process_color8(*src_u8++, s->dng_lut, s->black_level, scale_factor); + *dst_u8++ = dng_process_color8(*src_u8++, s->dng_lut, + s->black_level[(col&1) + 2 * ((line&1) + odd_line)], + scale_factor[(col&1) + 2 * ((line&1) + odd_line)]); dst += dst_stride; src += src_stride; @@ -716,7 +732,7 @@ w, h, is_single_comp, - is_u16); + is_u16, 0); av_frame_unref(s->jpgframe); @@ -896,7 +912,8 @@ elements, 1, 0, // single-component variation is only preset in JPEG-encoded DNGs - is_u16); + is_u16, + (line + strip_start)&1); } src += width; @@ -976,7 +993,7 @@ tile_count_y = (s->height + s->tile_length - 1) / s->tile_length; /* Iterate over the number of tiles */ - for (tile_idx = 0; tile_idx < s->tile_count; tile_idx++) { + for (tile_idx = 0; tile_idx < tile_count_x * tile_count_y; tile_idx++) { tile_x = tile_idx % tile_count_x; tile_y = tile_idx / tile_count_x; @@ -1030,14 +1047,14 @@ int create_gray_palette = 0; // make sure there is no aliasing in the following switch - if (s->bpp >= 100 || s->bppcount >= 10) { + if (s->bpp > 128 || s->bppcount >= 10) { av_log(s->avctx, AV_LOG_ERROR, "Unsupported image parameters: bpp=%d, bppcount=%d\n", s->bpp, s->bppcount); return AVERROR_INVALIDDATA; } - switch (s->planar * 1000 + s->bpp * 10 + s->bppcount + s->is_bayer * 10000) { + switch (s->planar * 10000 + s->bpp * 10 + s->bppcount + s->is_bayer * 100000) { case 11: if (!s->palette_is_set) { s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; @@ -1056,7 +1073,7 @@ case 121: s->avctx->pix_fmt = AV_PIX_FMT_GRAY12; break; - case 10081: + case 100081: switch (AV_RL32(s->pattern)) { case 0x02010100: s->avctx->pix_fmt = AV_PIX_FMT_BAYER_RGGB8; @@ -1076,10 +1093,10 @@ return AVERROR_PATCHWELCOME; } break; - case 10101: - case 10121: - case 10141: - case 10161: + case 100101: + case 100121: + case 100141: + case 100161: switch (AV_RL32(s->pattern)) { case 0x02010100: s->avctx->pix_fmt = AV_PIX_FMT_BAYER_RGGB16; @@ -1147,18 +1164,30 @@ case 644: s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGBA64LE : AV_PIX_FMT_RGBA64BE; break; - case 1243: + case 10243: s->avctx->pix_fmt = AV_PIX_FMT_GBRP; break; - case 1324: + case 10324: s->avctx->pix_fmt = AV_PIX_FMT_GBRAP; break; - case 1483: + case 10483: s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GBRP16LE : AV_PIX_FMT_GBRP16BE; break; - case 1644: + case 10644: s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GBRAP16LE : AV_PIX_FMT_GBRAP16BE; break; + case 963: + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGBF32LE : AV_PIX_FMT_RGBF32BE; + break; + case 1284: + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGBAF32LE : AV_PIX_FMT_RGBAF32BE; + break; + case 10963: + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GBRPF32LE : AV_PIX_FMT_GBRPF32BE; + break; + case 11284: + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GBRAPF32LE : AV_PIX_FMT_GBRAPF32BE; + break; default: av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, bppcount=%d)\n", @@ -1181,6 +1210,10 @@ if (ret < 0) return ret; } + + if (s->avctx->skip_frame >= AVDISCARD_ALL) + return 0; + if ((ret = ff_thread_get_buffer(s->avctx, frame, 0)) < 0) return ret; if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) { @@ -1194,7 +1227,7 @@ pal[i] = 0xFFU << 24 | i * 255 / ((1<bpp) - 1) * 0x010101; } } - return 0; + return 1; } static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den) @@ -1370,7 +1403,7 @@ } else s->strippos = off; s->strips = count; - if (s->strips == 1) + if (s->strips == s->bppcount) s->rps = s->height; s->sot = type; break; @@ -1396,7 +1429,6 @@ break; case TIFF_TILE_OFFSETS: s->tile_offsets_offset = off; - s->tile_count = count; s->is_tiled = 1; break; case TIFF_TILE_BYTE_COUNTS: @@ -1417,29 +1449,43 @@ else if (count > 1) s->sub_ifd = ff_tget(&s->gb, TIFF_LONG, s->le); /** Only get the first SubIFD */ break; + case TIFF_GRAY_RESPONSE_CURVE: case DNG_LINEARIZATION_TABLE: if (count > FF_ARRAY_ELEMS(s->dng_lut)) return AVERROR_INVALIDDATA; for (int i = 0; i < count; i++) s->dng_lut[i] = ff_tget(&s->gb, type, s->le); + s->white_level = s->dng_lut[count-1]; break; case DNG_BLACK_LEVEL: - if (count > 1) { /* Use the first value in the pattern (assume they're all the same) */ + if (count > FF_ARRAY_ELEMS(s->black_level)) + return AVERROR_INVALIDDATA; + s->black_level[0] = value / (float)value2; + for (int i = 0; i < count && count > 1; i++) { if (type == TIFF_RATIONAL) { value = ff_tget(&s->gb, TIFF_LONG, s->le); value2 = ff_tget(&s->gb, TIFF_LONG, s->le); if (!value2) { - av_log(s->avctx, AV_LOG_WARNING, "Invalid black level denominator\n"); + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); value2 = 1; } - s->black_level = value / value2; - } else - s->black_level = ff_tget(&s->gb, type, s->le); - av_log(s->avctx, AV_LOG_WARNING, "Assuming black level pattern values are identical\n"); - } else { - s->black_level = value / value2; + s->black_level[i] = value / (float)value2; + } else if (type == TIFF_SRATIONAL) { + int value = ff_tget(&s->gb, TIFF_LONG, s->le); + int value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + + s->black_level[i] = value / (float)value2; + } else { + s->black_level[i] = ff_tget(&s->gb, type, s->le); + } } + for (int i = count; i < 4 && count > 0; i++) + s->black_level[i] = s->black_level[count - 1]; break; case DNG_WHITE_LEVEL: s->white_level = value; @@ -1719,6 +1765,84 @@ tiff_set_type(s, TIFF_TYPE_DNG); } break; + case DNG_ANALOG_BALANCE: + if (type != TIFF_RATIONAL) + break; + + for (int i = 0; i < 3; i++) { + value = ff_tget(&s->gb, TIFF_LONG, s->le); + value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + + s->analog_balance[i] = value / (float)value2; + } + break; + case DNG_AS_SHOT_NEUTRAL: + if (type != TIFF_RATIONAL) + break; + + for (int i = 0; i < 3; i++) { + value = ff_tget(&s->gb, TIFF_LONG, s->le); + value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + + s->as_shot_neutral[i] = value / (float)value2; + } + break; + case DNG_AS_SHOT_WHITE_XY: + if (type != TIFF_RATIONAL) + break; + + for (int i = 0; i < 2; i++) { + value = ff_tget(&s->gb, TIFF_LONG, s->le); + value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + + s->as_shot_white[i] = value / (float)value2; + } + s->as_shot_white[2] = 1.f - s->as_shot_white[0] - s->as_shot_white[1]; + for (int i = 0; i < 3; i++) { + s->as_shot_white[i] /= d65_white[i]; + } + break; + case DNG_COLOR_MATRIX1: + case DNG_COLOR_MATRIX2: + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + int value = ff_tget(&s->gb, TIFF_LONG, s->le); + int value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + s->color_matrix[i][j] = value / (float)value2; + } + s->use_color_matrix = 1; + } + break; + case DNG_CAMERA_CALIBRATION1: + case DNG_CAMERA_CALIBRATION2: + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + int value = ff_tget(&s->gb, TIFF_LONG, s->le); + int value2 = ff_tget(&s->gb, TIFF_LONG, s->le); + if (!value2) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); + value2 = 1; + } + s->camera_calibration[i][j] = value / (float)value2; + } + } + break; case CINEMADNG_TIME_CODES: case CINEMADNG_FRAME_RATE: case CINEMADNG_T_STOP: @@ -1735,7 +1859,7 @@ } } end: - if (s->bpp > 64U) { + if (s->bpp > 128U) { av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count); @@ -1746,6 +1870,38 @@ return 0; } +static const float xyz2rgb[3][3] = { + { 0.412453f, 0.357580f, 0.180423f }, + { 0.212671f, 0.715160f, 0.072169f }, + { 0.019334f, 0.119193f, 0.950227f }, +}; + +static void camera_xyz_coeff(TiffContext *s, + float rgb2cam[3][4], + double cam2xyz[4][3]) +{ + double cam2rgb[4][3], num; + int i, j, k; + + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + cam2rgb[i][j] = 0.; + for (k = 0; k < 3; k++) + cam2rgb[i][j] += cam2xyz[i][k] * xyz2rgb[k][j]; + } + } + + for (i = 0; i < 3; i++) { + for (num = j = 0; j < 3; j++) + num += cam2rgb[i][j]; + if (!num) + num = 1; + for (j = 0; j < 3; j++) + cam2rgb[i][j] /= num; + s->premultiply[i] = 1.f / num; + } +} + static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { @@ -1775,6 +1931,7 @@ // TIFF_BPP is not a required tag and defaults to 1 s->tiff_type = TIFF_TYPE_TIFF; + s->use_color_matrix = 0; again: s->is_thumbnail = 0; s->bppcount = s->bpp = 1; @@ -1791,6 +1948,25 @@ for (i = 0; i < 65536; i++) s->dng_lut[i] = i; + for (i = 0; i < FF_ARRAY_ELEMS(s->black_level); i++) + s->black_level[i] = 0.f; + + for (i = 0; i < FF_ARRAY_ELEMS(s->as_shot_neutral); i++) + s->as_shot_neutral[i] = 0.f; + + for (i = 0; i < FF_ARRAY_ELEMS(s->as_shot_white); i++) + s->as_shot_white[i] = 1.f; + + for (i = 0; i < FF_ARRAY_ELEMS(s->analog_balance); i++) + s->analog_balance[i] = 1.f; + + for (i = 0; i < FF_ARRAY_ELEMS(s->premultiply); i++) + s->premultiply[i] = 1.f; + + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + s->camera_calibration[i][j] = i == j; + free_geotags(s); // Reset these offsets so we can tell if they were set this frame @@ -1863,8 +2039,39 @@ } if (is_dng) { + double cam2xyz[4][3]; + float cmatrix[3][4]; + float pmin = FLT_MAX; int bps; + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) + s->camera_calibration[i][j] *= s->analog_balance[i]; + } + + if (!s->use_color_matrix) { + for (i = 0; i < 3; i++) { + if (s->camera_calibration[i][i]) + s->premultiply[i] /= s->camera_calibration[i][i]; + } + } else { + for (int c = 0; c < 3; c++) { + for (i = 0; i < 3; i++) { + cam2xyz[c][i] = 0.; + for (j = 0; j < 3; j++) + cam2xyz[c][i] += s->camera_calibration[c][j] * s->color_matrix[j][i] * s->as_shot_white[i]; + } + } + + camera_xyz_coeff(s, cmatrix, cam2xyz); + } + + for (int c = 0; c < 3; c++) + pmin = fminf(pmin, s->premultiply[c]); + + for (int c = 0; c < 3; c++) + s->premultiply[c] /= pmin; + if (s->bpp % s->bppcount) return AVERROR_INVALIDDATA; bps = s->bpp / s->bppcount; @@ -1874,9 +2081,9 @@ if (s->white_level == 0) s->white_level = (1LL << bps) - 1; /* Default value as per the spec */ - if (s->white_level <= s->black_level) { - av_log(avctx, AV_LOG_ERROR, "BlackLevel (%"PRId32") must be less than WhiteLevel (%"PRId32")\n", - s->black_level, s->white_level); + if (s->white_level <= s->black_level[0]) { + av_log(avctx, AV_LOG_ERROR, "BlackLevel (%g) must be less than WhiteLevel (%"PRId32")\n", + s->black_level[0], s->white_level); return AVERROR_INVALIDDATA; } @@ -1889,7 +2096,7 @@ return AVERROR_INVALIDDATA; } - has_tile_bits = s->is_tiled || s->tile_byte_counts_offset || s->tile_offsets_offset || s->tile_width || s->tile_length || s->tile_count; + has_tile_bits = s->is_tiled || s->tile_byte_counts_offset || s->tile_offsets_offset || s->tile_width || s->tile_length; has_strip_bits = s->strippos || s->strips || s->stripoff || s->rps || s->sot || s->sstype || s->stripsize || s->stripsizesoff; if (has_tile_bits && has_strip_bits) { @@ -1900,7 +2107,7 @@ } /* now we have the data and may start decoding */ - if ((ret = init_image(s, p)) < 0) + if ((ret = init_image(s, p)) <= 0) return ret; if (!s->is_tiled || has_strip_bits) { @@ -2039,6 +2246,74 @@ } } + /* Floating point predictor + TIFF Technical Note 3 http://chriscox.org/TIFFTN3d1.pdf */ + if (s->predictor == 3) { + int channels = s->bppcount; + int group_size; + uint8_t *tmpbuf; + int bpc; + + dst = five_planes ? five_planes : p->data[plane]; + soff = s->bpp >> 3; + if (s->planar) { + soff = FFMAX(soff / s->bppcount, 1); + channels = 1; + } + ssize = s->width * soff; + bpc = FFMAX(soff / s->bppcount, 1); /* Bytes per component */ + group_size = s->width * channels; + + tmpbuf = av_malloc(ssize); + if (!tmpbuf) + return AVERROR(ENOMEM); + + if (s->avctx->pix_fmt == AV_PIX_FMT_RGBF32LE || + s->avctx->pix_fmt == AV_PIX_FMT_RGBAF32LE) { + for (i = 0; i < decoded_height; i++) { + /* Copy first sample byte for each channel */ + for (j = 0; j < channels; j++) + tmpbuf[j] = dst[j]; + + /* Decode horizontal differences */ + for (j = channels; j < ssize; j++) + tmpbuf[j] = dst[j] + tmpbuf[j-channels]; + + /* Combine shuffled bytes from their separate groups. Each + byte of every floating point value in a row of pixels is + split and combined into separate groups. A group of all + the sign/exponents bytes in the row and groups for each + of the upper, mid, and lower mantissa bytes in the row. */ + for (j = 0; j < group_size; j++) { + for (int k = 0; k < bpc; k++) { + dst[bpc * j + k] = tmpbuf[(bpc - k - 1) * group_size + j]; + } + } + dst += stride; + } + } else if (s->avctx->pix_fmt == AV_PIX_FMT_RGBF32BE || + s->avctx->pix_fmt == AV_PIX_FMT_RGBAF32BE) { + /* Same as LE only the shuffle at the end is reversed */ + for (i = 0; i < decoded_height; i++) { + for (j = 0; j < channels; j++) + tmpbuf[j] = dst[j]; + + for (j = channels; j < ssize; j++) + tmpbuf[j] = dst[j] + tmpbuf[j-channels]; + + for (j = 0; j < group_size; j++) { + for (int k = 0; k < bpc; k++) { + dst[bpc * j + k] = tmpbuf[k * group_size + j]; + } + } + dst += stride; + } + } else { + av_log(s->avctx, AV_LOG_ERROR, "unsupported floating point pixel format\n"); + } + av_free(tmpbuf); + } + if (s->photometric == TIFF_PHOTOMETRIC_WHITE_IS_ZERO) { int c = (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 ? (1<bpp) - 1 : 255); dst = p->data[plane]; @@ -2185,7 +2460,7 @@ const FFCodec ff_tiff_decoder = { .p.name = "tiff", - .p.long_name = NULL_IF_CONFIG_SMALL("TIFF image"), + CODEC_LONG_NAME("TIFF image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TIFF, .priv_data_size = sizeof(TiffContext), @@ -2193,6 +2468,7 @@ .close = tiff_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES | + FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .p.priv_class = &tiff_decoder_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiffenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiffenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiffenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiffenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -207,8 +207,8 @@ { int i, j, k; int w = (s->width - 1) / s->subsampling[0] + 1; - uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]]; - uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]]; + const uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]]; + const uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]]; if (s->width % s->subsampling[0] || s->height % s->subsampling[1]) { for (i = 0; i < w; i++) { for (j = 0; j < s->subsampling[1]; j++) @@ -571,13 +571,14 @@ const FFCodec ff_tiff_encoder = { .p.name = "tiff", - .p.long_name = NULL_IF_CONFIG_SMALL("TIFF image"), + CODEC_LONG_NAME("TIFF image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TIFF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(TiffEncoderContext), .init = encode_init, .close = encode_close, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8, @@ -589,5 +590,4 @@ AV_PIX_FMT_NONE }, .p.priv_class = &tiffenc_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tiff.h 2023-03-03 13:29:59.000000000 +0000 @@ -66,6 +66,7 @@ TIFF_PAGE_NAME = 0x11D, TIFF_XPOS = 0x11E, TIFF_YPOS = 0x11F, + TIFF_GRAY_RESPONSE_CURVE= 0x123, TIFF_T4OPTIONS = 0x124, TIFF_T6OPTIONS, TIFF_RES_UNIT = 0x128, @@ -105,6 +106,13 @@ DNG_LINEARIZATION_TABLE = 0xC618, DNG_BLACK_LEVEL = 0xC61A, DNG_WHITE_LEVEL = 0xC61D, + DNG_COLOR_MATRIX1 = 0xC621, + DNG_COLOR_MATRIX2 = 0xC622, + DNG_CAMERA_CALIBRATION1 = 0xC623, + DNG_CAMERA_CALIBRATION2 = 0xC624, + DNG_ANALOG_BALANCE = 0xC627, + DNG_AS_SHOT_NEUTRAL = 0xC628, + DNG_AS_SHOT_WHITE_XY = 0xC629, }; /** list of CinemaDNG tags */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tmv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tmv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tmv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tmv.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/internal.h" #include "libavutil/xga_font_data.h" @@ -88,11 +88,10 @@ const FFCodec ff_tmv_decoder = { .p.name = "tmv", - .p.long_name = NULL_IF_CONFIG_SMALL("8088flex TMV"), + CODEC_LONG_NAME("8088flex TMV"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TMV, .init = tmv_decode_init, FF_CODEC_DECODE_CB(tmv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion1.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" @@ -912,7 +912,7 @@ const FFCodec ff_truemotion1_decoder = { .p.name = "truemotion1", - .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"), + CODEC_LONG_NAME("Duck TrueMotion 1.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TRUEMOTION1, .priv_data_size = sizeof(TrueMotion1Context), @@ -920,5 +920,5 @@ .close = truemotion1_decode_end, FF_CODEC_DECODE_CB(truemotion1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,8 +30,8 @@ #include "bswapdsp.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define TM2_ESCAPE 0x80000000 #define TM2_DELTAS 64 @@ -1010,7 +1010,7 @@ const FFCodec ff_truemotion2_decoder = { .p.name = "truemotion2", - .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0"), + CODEC_LONG_NAME("Duck TrueMotion 2.0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TRUEMOTION2, .priv_data_size = sizeof(TM2Context), @@ -1018,5 +1018,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2rt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2rt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2rt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truemotion2rt.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,19 +18,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - -#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" typedef struct TrueMotion2RTContext { GetBitContext gb; @@ -221,12 +216,11 @@ const FFCodec ff_truemotion2rt_decoder = { .p.name = "truemotion2rt", - .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0 Real Time"), + CODEC_LONG_NAME("Duck TrueMotion 2.0 Real Time"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TRUEMOTION2RT, .priv_data_size = sizeof(TrueMotion2RTContext), .init = truemotion2rt_decode_init, FF_CODEC_DECODE_CB(truemotion2rt_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truespeech.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truespeech.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truespeech.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/truespeech.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,14 +20,13 @@ */ #include "libavutil/channel_layout.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "avcodec.h" #include "bswapdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "truespeech_data.h" /** @@ -358,12 +357,11 @@ const FFCodec ff_truespeech_decoder = { .p.name = "truespeech", - .p.long_name = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"), + CODEC_LONG_NAME("DSP Group TrueSpeech"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TRUESPEECH, .priv_data_size = sizeof(TSContext), .init = truespeech_decode_init, FF_CODEC_DECODE_CB(truespeech_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc2.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,8 +32,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "mathops.h" #include "tscc2data.h" @@ -358,7 +358,7 @@ const FFCodec ff_tscc2_decoder = { .p.name = "tscc2", - .p.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Codec 2"), + CODEC_LONG_NAME("TechSmith Screen Codec 2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TSCC2, .priv_data_size = sizeof(TSCC2Context), @@ -366,5 +366,5 @@ .close = tscc2_decode_end, FF_CODEC_DECODE_CB(tscc2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tscc.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,13 +34,9 @@ * Supports: BGR8,BGR555,BGR24 - only BGR8 and BGR555 tested */ -#include -#include - #include "avcodec.h" #include "codec_internal.h" #include "decode.h" -#include "internal.h" #include "msrledec.h" #include "zlib_wrapper.h" @@ -172,7 +168,7 @@ const FFCodec ff_tscc_decoder = { .p.name = "camtasia", - .p.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"), + CODEC_LONG_NAME("TechSmith Screen Capture Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TSCC, .priv_data_size = sizeof(CamtasiaContext), @@ -180,5 +176,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tta.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tta.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tta.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/tta.c 2023-03-03 13:29:59.000000000 +0000 @@ -160,7 +160,8 @@ av_channel_layout_uninit(&avctx->ch_layout); if (s->channels > 1 && s->channels < 9) { av_channel_layout_from_mask(&avctx->ch_layout, tta_channel_layouts[s->channels-2]); - } else { + } + if (avctx->ch_layout.nb_channels == 0) { avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; avctx->ch_layout.nb_channels = s->channels; } @@ -364,28 +365,24 @@ switch (s->bps) { case 1: { uint8_t *samples = (uint8_t *)frame->data[0]; - for (p = s->decode_buffer; (int32_t*)p < s->decode_buffer + (framelen * s->channels); p++) - *samples++ = *p + 0x80; + p = s->decode_buffer; + for (i = 0; i < framelen * s->channels; i++) + samples[i] = p[i] + 0x80; break; } case 2: { int16_t *samples = (int16_t *)frame->data[0]; - for (p = s->decode_buffer; (int32_t*)p < s->decode_buffer + (framelen * s->channels); p++) - *samples++ = *p; + p = s->decode_buffer; + for (i = 0; i < framelen * s->channels; i++) + samples[i] = p[i]; break; } case 3: { // shift samples for 24-bit sample format int32_t *samples = (int32_t *)frame->data[0]; - int overflow = 0; - for (i = 0; i < framelen * s->channels; i++) { - int scaled = *samples * 256U; - overflow += (scaled >> 8 != *samples); - *samples++ = scaled; - } - if (overflow) - av_log(avctx, AV_LOG_WARNING, "%d overflows occurred on 24bit upscale\n", overflow); + for (i = 0; i < framelen * s->channels; i++) + samples[i] = samples[i] * 256U; // reset decode buffer s->decode_buffer = NULL; break; @@ -429,7 +426,7 @@ const FFCodec ff_tta_decoder = { .p.name = "tta", - .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), + CODEC_LONG_NAME("TTA (True Audio)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TTA, .priv_data_size = sizeof(TTAContext), @@ -438,5 +435,5 @@ FF_CODEC_DECODE_CB(tta_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .p.priv_class = &tta_decoder_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,6 @@ #include "codec_internal.h" #include "encode.h" #include "put_bits.h" -#include "internal.h" #include "libavutil/crc.h" typedef struct TTAEncContext { @@ -188,9 +187,7 @@ put_bits32(&pb, av_crc(s->crc_table, UINT32_MAX, avpkt->data, out_bytes) ^ UINT32_MAX); flush_put_bits(&pb); - avpkt->pts = frame->pts; avpkt->size = out_bytes + 4; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; return 0; } @@ -204,17 +201,17 @@ const FFCodec ff_tta_encoder = { .p.name = "tta", - .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), + CODEC_LONG_NAME("TTA (True Audio)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TTA, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(TTAEncContext), .init = tta_encode_init, .close = tta_encode_close, FF_CODEC_ENCODE_CB(tta_encode_frame), - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -315,7 +315,7 @@ } // write the first string in extradata, attributes in the base "tt" element. - av_bprintf(&s->buffer, ttml_default_namespacing); + av_bprintf(&s->buffer, TTML_DEFAULT_NAMESPACING); // the cell resolution is in character cells, so not exactly 1:1 against // a pixel based resolution, but as the tts:extent in the root // "tt" element is frowned upon (and disallowed in the EBU-TT profile), @@ -385,12 +385,12 @@ const FFCodec ff_ttml_encoder = { .p.name = "ttml", - .p.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"), + CODEC_LONG_NAME("TTML subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_TTML, .priv_data_size = sizeof(TTMLContext), .init = ttml_encode_init, FF_CODEC_ENCODE_SUB_CB(ttml_encode_frame), .close = ttml_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ttmlenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,10 +25,10 @@ #define TTMLENC_EXTRADATA_SIGNATURE "lavc-ttmlenc" #define TTMLENC_EXTRADATA_SIGNATURE_SIZE (sizeof(TTMLENC_EXTRADATA_SIGNATURE) - 1) -static const char ttml_default_namespacing[] = -" xmlns=\"http://www.w3.org/ns/ttml\"\n" -" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n" -" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n" -" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n"; +#define TTML_DEFAULT_NAMESPACING \ +" xmlns=\"http://www.w3.org/ns/ttml\"\n" \ +" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n" \ +" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n" \ +" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n" #endif /* AVCODEC_TTMLENC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,9 +25,9 @@ #include "libavutil/channel_layout.h" #include "libavutil/float_dsp.h" #include "avcodec.h" -#include "fft.h" -#include "internal.h" +#include "decode.h" #include "lsp.h" +#include "metasound_twinvq_data.h" #include "sinewin.h" #include "twinvq.h" @@ -328,7 +328,8 @@ static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype, int wtype, float *in, float *prev, int ch) { - FFTContext *mdct = &tctx->mdct_ctx[ftype]; + AVTXContext *tx = tctx->tx[ftype]; + av_tx_fn tx_fn = tctx->tx_fn[ftype]; const TwinVQModeTab *mtab = tctx->mtab; int bsize = mtab->size / mtab->fmode[ftype].sub; int size = mtab->size; @@ -357,7 +358,7 @@ wsize = types_sizes[wtype_to_wsize[sub_wtype]]; - mdct->imdct_half(mdct, buf1 + bsize * j, in + bsize * j); + tx_fn(tx, buf1 + bsize * j, in + bsize * j, sizeof(float)); tctx->fdsp->vector_fmul_window(out2, prev_buf + (bsize - wsize) / 2, buf1 + bsize * j, @@ -543,8 +544,9 @@ for (i = 0; i < 3; i++) { int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub; - if ((ret = ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1, - -sqrt(norm / bsize) / (1 << 15)))) + const float scale = -sqrt(norm / bsize) / (1 << 15); + if ((ret = av_tx_init(&tctx->tx[i], &tctx->tx_fn[i], AV_TX_FLOAT_MDCT, + 1, bsize, &scale, 0))) return ret; } @@ -745,7 +747,7 @@ int i; for (i = 0; i < 3; i++) { - ff_mdct_end(&tctx->mdct_ctx[i]); + av_tx_uninit(&tctx->tx[i]); av_freep(&tctx->cos_tabs[i]); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvqdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvqdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvqdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvqdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,6 @@ #include "codec_internal.h" #include "get_bits.h" #include "twinvq.h" -#include "metasound_data.h" #include "twinvq_data.h" static const TwinVQModeTab mode_08_08 = { @@ -416,7 +415,7 @@ const FFCodec ff_twinvq_decoder = { .p.name = "twinvq", - .p.long_name = NULL_IF_CONFIG_SMALL("VQF TwinVQ"), + CODEC_LONG_NAME("VQF TwinVQ"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_TWINVQ, .priv_data_size = sizeof(TwinVQContext), @@ -426,5 +425,5 @@ .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_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/twinvq.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,10 +25,11 @@ #include #include +#include "libavutil/attributes_internal.h" +#include "libavutil/tx.h" #include "libavutil/common.h" #include "libavutil/float_dsp.h" #include "avcodec.h" -#include "fft.h" enum TwinVQCodec { TWINVQ_CODEC_VQF, @@ -136,7 +137,8 @@ typedef struct TwinVQContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; - FFTContext mdct_ctx[3]; + AVTXContext *tx[3]; + av_tx_fn tx_fn[3]; const TwinVQModeTab *mtab; @@ -179,8 +181,15 @@ const float *shape, float *speech); } TwinVQContext; +FF_VISIBILITY_PUSH_HIDDEN extern const enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[]; +extern const float ff_metasound_lsp8[]; +extern const float ff_metasound_lsp11[]; +extern const float ff_metasound_lsp16[]; +extern const float ff_metasound_lsp22[]; +extern const float ff_metasound_lsp44[]; + /** @note not speed critical, hence not optimized */ static inline void twinvq_memset_float(float *buf, float val, int size) { @@ -199,5 +208,6 @@ int ff_twinvq_decode_close(AVCodecContext *avctx); /** Requires the caller to call ff_twinvq_decode_close() upon failure. */ int ff_twinvq_decode_init(AVCodecContext *avctx); +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_TWINVQ_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/txd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/txd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/txd.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/txd.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,12 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "bytestream.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "texturedsp.h" #define TXD_DXT1 0x31545844 @@ -166,7 +164,7 @@ const FFCodec ff_txd_decoder = { .p.name = "txd", - .p.long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"), + CODEC_LONG_NAME("Renderware TXD (TeXture Dictionary) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TXD, .p.capabilities = AV_CODEC_CAP_DR1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ulti.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ulti.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ulti.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ulti.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,14 +24,10 @@ * IBM Ultimotion Video Decoder. */ -#include -#include -#include - #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "ulti_cb.h" @@ -420,7 +416,7 @@ const FFCodec ff_ulti_decoder = { .p.name = "ultimotion", - .p.long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"), + CODEC_LONG_NAME("IBM UltiMotion"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ULTI, .priv_data_size = sizeof(UltimotionDecodeContext), @@ -428,5 +424,4 @@ .close = ulti_decode_end, FF_CODEC_DECODE_CB(ulti_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utils.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,6 +36,7 @@ #include "avcodec.h" #include "codec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" #include "thread.h" #include "threadframe.h" @@ -242,6 +243,8 @@ case AV_PIX_FMT_GBRAP16BE: w_align = 16; //FIXME assume 16 pixel per macroblock h_align = 16 * 2; // interlaced needs 2 macroblocks height + if (s->codec_id == AV_CODEC_ID_BINKVIDEO) + w_align = 16*2; break; case AV_PIX_FMT_YUV411P: case AV_PIX_FMT_YUVJ411P: @@ -320,6 +323,7 @@ *width = FFALIGN(*width, w_align); *height = FFALIGN(*height, h_align); if (s->codec_id == AV_CODEC_ID_H264 || s->lowres || + s->codec_id == AV_CODEC_ID_VC1 || s->codec_id == AV_CODEC_ID_WMV3 || s->codec_id == AV_CODEC_ID_VP5 || s->codec_id == AV_CODEC_ID_VP6 || s->codec_id == AV_CODEC_ID_VP6F || s->codec_id == AV_CODEC_ID_VP6A ) { @@ -333,6 +337,9 @@ // the next rounded up width is 32 *width = FFMAX(*width, 32); } + if (s->codec_id == AV_CODEC_ID_SVQ3) { + *width = FFMAX(*width, 32); + } for (i = 0; i < 4; i++) linesize_align[i] = STRIDE_ALIGN; @@ -352,29 +359,17 @@ align = FFMAX3(align, linesize_align[1], linesize_align[2]); *width = FFALIGN(*width, align); } - +#if FF_API_AVCODEC_CHROMA_POS int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos) { - if (pos <= AVCHROMA_LOC_UNSPECIFIED || pos >= AVCHROMA_LOC_NB) - return AVERROR(EINVAL); - pos--; - - *xpos = (pos&1) * 128; - *ypos = ((pos>>1)^(pos<4)) * 128; - - return 0; + return av_chroma_location_enum_to_pos(xpos, ypos, pos); } enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos) { - int pos, xout, yout; - - for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) { - if (avcodec_enum_to_chroma_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos) - return pos; - } - return AVCHROMA_LOC_UNSPECIFIED; + return av_chroma_location_pos_to_enum(xpos, ypos); } +#endif int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, @@ -525,7 +520,9 @@ case AV_CODEC_ID_PCM_SGA: case AV_CODEC_ID_PCM_U8: case AV_CODEC_ID_SDX2_DPCM: + case AV_CODEC_ID_CBD2_DPCM: case AV_CODEC_ID_DERF_DPCM: + case AV_CODEC_ID_WADY_DPCM: return 8; case AV_CODEC_ID_PCM_S16BE: case AV_CODEC_ID_PCM_S16BE_PLANAR: @@ -638,6 +635,7 @@ case AV_CODEC_ID_MP2: case AV_CODEC_ID_MUSEPACK7: return 1152; case AV_CODEC_ID_AC3: return 1536; + case AV_CODEC_ID_FTR: return 1024; } if (sr > 0) { @@ -681,6 +679,10 @@ return 256 * (frame_bytes / 64); if (id == AV_CODEC_ID_RA_144) return 160 * (frame_bytes / 20); + if (id == AV_CODEC_ID_APTX) + return 4 * (frame_bytes / 4); + if (id == AV_CODEC_ID_APTX_HD) + return 4 * (frame_bytes / 6); if (bps > 0) { /* calc from frame_bytes and bits_per_coded_sample */ @@ -771,6 +773,9 @@ case AV_CODEC_ID_ADPCM_MTAF: tmp = blocks * (ba - 16LL) * 2 / ch; break; + case AV_CODEC_ID_ADPCM_XMD: + tmp = blocks * 32; + break; } if (tmp) { if (tmp != (int)tmp) @@ -912,11 +917,6 @@ #if !HAVE_THREADS -enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) -{ - return ff_get_format(avctx, fmt); -} - int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags) { return ff_get_buffer(avctx, f, flags); @@ -949,7 +949,7 @@ { } -void ff_thread_await_progress(ThreadFrame *f, int progress, int field) +void ff_thread_await_progress(const ThreadFrame *f, int progress, int field) { } @@ -963,15 +963,11 @@ return 0; } -int ff_alloc_entries(AVCodecContext *avctx, int count) +int ff_slice_thread_allocz_entries(AVCodecContext *avctx, int count) { return 0; } -void ff_reset_entries(AVCodecContext *avctx) -{ -} - void ff_thread_await_progress2(AVCodecContext *avctx, int field, int thread, int shift) { } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -1052,7 +1052,7 @@ const FFCodec ff_utvideo_decoder = { .p.name = "utvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Ut Video"), + CODEC_LONG_NAME("Ut Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_UTVIDEO, .priv_data_size = sizeof(UtvideoContext), @@ -1060,5 +1060,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideoenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideoenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideoenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/utvideoenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -277,7 +277,7 @@ #undef B /* Write data to a plane with median prediction */ -static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, +static void median_predict(UtvideoContext *c, const uint8_t *src, uint8_t *dst, ptrdiff_t stride, int width, int height) { int i, j; @@ -376,7 +376,7 @@ return put_bytes_output(&pb); } -static int encode_plane(AVCodecContext *avctx, uint8_t *src, +static int encode_plane(AVCodecContext *avctx, const uint8_t *src, uint8_t *dst, ptrdiff_t stride, int plane_no, int width, int height, PutByteContext *pb) { @@ -645,18 +645,19 @@ const FFCodec ff_utvideo_encoder = { .p.name = "utvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Ut Video"), + CODEC_LONG_NAME("Ut Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_UTVIDEO, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(UtvideoContext), .p.priv_class = &utvideo_class, .init = utvideo_encode_init, FF_CODEC_ENCODE_CB(utvideo_encode_frame), .close = utvideo_encode_close, - .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -233,7 +233,7 @@ const FFCodec ff_v210_decoder = { .p.name = "v210", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:2:2 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V210, .priv_data_size = sizeof(V210DecContext), @@ -243,5 +243,4 @@ AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &v210dec_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -109,13 +109,13 @@ const FFCodec ff_v210_encoder = { .p.name = "v210", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:2:2 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V210, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(V210EncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210x.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210x.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210x.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v210x.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/bswap.h" #include "libavutil/internal.h" @@ -121,11 +121,10 @@ const FFCodec ff_v210x_decoder = { .p.name = "v210x", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:2:2 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V210X, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int v308_decode_init(AVCodecContext *avctx) { @@ -74,11 +74,10 @@ const FFCodec ff_v308_decoder = { .p.name = "v308", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), + CODEC_LONG_NAME("Uncompressed packed 4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V308, .init = v308_decode_init, FF_CODEC_DECODE_CB(v308_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v308enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,7 +43,7 @@ const AVFrame *pic, int *got_packet) { uint8_t *dst; - uint8_t *y, *u, *v; + const uint8_t *y, *u, *v; int i, j, ret; ret = ff_get_encode_buffer(avctx, pkt, avctx->width * avctx->height * 3, 0); @@ -72,12 +72,11 @@ const FFCodec ff_v308_encoder = { .p.name = "v308", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), + CODEC_LONG_NAME("Uncompressed packed 4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V308, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = v308_encode_init, FF_CODEC_ENCODE_CB(v308_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,12 +23,16 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int v408_decode_init(AVCodecContext *avctx) { avctx->pix_fmt = AV_PIX_FMT_YUVA444P; +#if FF_API_AYUV_CODECID + if (avctx->codec_id==AV_CODEC_ID_AYUV) + av_log(avctx, AV_LOG_WARNING, "This decoder is deprecated and will be removed.\n"); +#endif return 0; } @@ -57,12 +61,15 @@ for (i = 0; i < avctx->height; i++) { for (j = 0; j < avctx->width; j++) { +#if FF_API_AYUV_CODECID if (avctx->codec_id==AV_CODEC_ID_AYUV) { v[j] = *src++; u[j] = *src++; y[j] = *src++; a[j] = *src++; - } else { + } else +#endif + { u[j] = *src++; y[j] = *src++; v[j] = *src++; @@ -81,27 +88,27 @@ return avpkt->size; } +#if FF_API_AYUV_CODECID #if CONFIG_AYUV_DECODER const FFCodec ff_ayuv_decoder = { .p.name = "ayuv", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), + CODEC_LONG_NAME("Uncompressed packed MS 4:4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AYUV, .init = v408_decode_init, FF_CODEC_DECODE_CB(v408_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif +#endif #if CONFIG_V408_DECODER const FFCodec ff_v408_decoder = { .p.name = "v408", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), + CODEC_LONG_NAME("Uncompressed packed QT 4:4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V408, .init = v408_decode_init, FF_CODEC_DECODE_CB(v408_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v408enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,11 @@ avctx->bits_per_coded_sample = 32; avctx->bit_rate = ff_guess_coded_bitrate(avctx); +#if FF_API_AYUV_CODECID + if (avctx->codec_id == AV_CODEC_ID_AYUV) + av_log(avctx, AV_LOG_WARNING, "This encoder is deprecated and will be removed.\n"); +#endif + return 0; } @@ -40,7 +45,7 @@ const AVFrame *pic, int *got_packet) { uint8_t *dst; - uint8_t *y, *u, *v, *a; + const uint8_t *y, *u, *v, *a; int i, j, ret; ret = ff_get_encode_buffer(avctx, pkt, avctx->width * avctx->height * 4, 0); @@ -55,12 +60,15 @@ for (i = 0; i < avctx->height; i++) { for (j = 0; j < avctx->width; j++) { +#if FF_API_AYUV_CODECID if (avctx->codec_id==AV_CODEC_ID_AYUV) { *dst++ = v[j]; *dst++ = u[j]; *dst++ = y[j]; *dst++ = a[j]; - } else { + } else +#endif + { *dst++ = u[j]; *dst++ = y[j]; *dst++ = v[j]; @@ -79,29 +87,29 @@ static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; +#if FF_API_AYUV_CODECID #if CONFIG_AYUV_ENCODER const FFCodec ff_ayuv_encoder = { .p.name = "ayuv", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), + CODEC_LONG_NAME("Uncompressed packed MS 4:4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AYUV, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = v408_encode_init, FF_CODEC_ENCODE_CB(v408_encode_frame), .p.pix_fmts = pix_fmt, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif +#endif #if CONFIG_V408_ENCODER const FFCodec ff_v408_encoder = { .p.name = "v408", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), + CODEC_LONG_NAME("Uncompressed packed QT 4:4:4:4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V408, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = v408_encode_init, FF_CODEC_ENCODE_CB(v408_encode_frame), .p.pix_fmts = pix_fmt, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -116,12 +116,11 @@ const FFCodec ff_v410_decoder = { .p.name = "v410", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:4:4 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V410, .init = v410_decode_init, FF_CODEC_DECODE_CB(v410_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v410enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,7 @@ const AVFrame *pic, int *got_packet) { uint8_t *dst; - uint16_t *y, *u, *v; + const uint16_t *y, *u, *v; uint32_t val; int i, j, ret; @@ -76,12 +76,11 @@ const FFCodec ff_v410_encoder = { .p.name = "v410", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), + CODEC_LONG_NAME("Uncompressed 4:4:4 10-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V410, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = v410_encode_init, FF_CODEC_ENCODE_CB(v410_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_context.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_context.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_context.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_context.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include #include #include "libavcodec/avcodec.h" -#include "libavcodec/internal.h" +#include "decode.h" #include "v4l2_buffers.h" #include "v4l2_fmt.h" #include "v4l2_m2m.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.c 2023-03-03 13:29:59.000000000 +0000 @@ -148,13 +148,15 @@ ofmt = s->output.format; cfmt = s->capture.format; - av_log(log_ctx, AV_LOG_INFO, "requesting formats: output=%s capture=%s\n", + av_log(log_ctx, AV_LOG_INFO, "requesting formats: output=%s/%s capture=%s/%s\n", av_fourcc2str(V4L2_TYPE_IS_MULTIPLANAR(ofmt.type) ? ofmt.fmt.pix_mp.pixelformat : ofmt.fmt.pix.pixelformat), + av_get_pix_fmt_name(s->output.av_pix_fmt) ?: "none", av_fourcc2str(V4L2_TYPE_IS_MULTIPLANAR(cfmt.type) ? cfmt.fmt.pix_mp.pixelformat : - cfmt.fmt.pix.pixelformat)); + cfmt.fmt.pix.pixelformat), + av_get_pix_fmt_name(s->capture.av_pix_fmt) ?: "none"); ret = ff_v4l2_context_set_format(&s->output); if (ret) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -226,7 +226,7 @@ static const AVOption options[] = { V4L_M2M_DEFAULT_OPTS, { "num_capture_buffers", "Number of buffers in the capture context", - OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20, INT_MAX, FLAGS }, + OFFSET(num_capture_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 2, INT_MAX, FLAGS }, { NULL}, }; @@ -242,7 +242,7 @@ M2MDEC_CLASS(NAME) \ const FFCodec ff_ ## NAME ## _v4l2m2m_decoder = { \ .p.name = #NAME "_v4l2m2m" , \ - .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"), \ + CODEC_LONG_NAME("V4L2 mem2mem " LONGNAME " decoder wrapper"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = CODEC , \ .priv_data_size = sizeof(V4L2m2mPriv), \ @@ -252,7 +252,8 @@ .close = v4l2_decode_close, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ - .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, \ .p.wrapper_name = "v4l2m2m", \ } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -423,7 +423,7 @@ M2MENC_CLASS(NAME, OPTIONS_NAME) \ const FFCodec ff_ ## NAME ## _v4l2m2m_encoder = { \ .p.name = #NAME "_v4l2m2m" , \ - .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ + CODEC_LONG_NAME("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = CODEC , \ .priv_data_size = sizeof(V4L2m2mPriv), \ @@ -433,7 +433,8 @@ .close = v4l2_encode_close, \ .defaults = v4l2_m2m_defaults, \ .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \ + FF_CODEC_CAP_INIT_CLEANUP, \ .p.wrapper_name = "v4l2m2m", \ } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/v4l2_m2m.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ #define V4L_M2M_DEFAULT_OPTS \ { "num_output_buffers", "Number of buffers in the output context",\ - OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 6, INT_MAX, FLAGS } + OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 2, INT_MAX, FLAGS } typedef struct V4L2m2mContext { char devname[PATH_MAX]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_av1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_av1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_av1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_av1.c 2023-03-03 13:29:59.000000000 +0000 @@ -274,7 +274,7 @@ }; for (int i = 0; i < AV1_NUM_REF_FRAMES; i++) { - if (pic_param.pic_info_fields.bits.frame_type == AV1_FRAME_KEY) + if (pic_param.pic_info_fields.bits.frame_type == AV1_FRAME_KEY && frame_header->show_frame) pic_param.ref_frame_map[i] = VA_INVALID_ID; else pic_param.ref_frame_map[i] = ctx->ref_tab[i].valid ? diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_decode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_decode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_decode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_decode.c 2023-03-03 13:29:59.000000000 +0000 @@ -263,14 +263,29 @@ #ifdef VA_FOURCC_Y210 MAP(Y210, Y210), #endif +#ifdef VA_FOURCC_Y212 + MAP(Y212, Y212), +#endif // 4:4:0 MAP(422V, YUV440P), // 4:4:4 MAP(444P, YUV444P), +#ifdef VA_FOURCC_XYUV + MAP(XYUV, VUYX), +#endif +#ifdef VA_FOURCC_Y410 + MAP(Y410, XV30), +#endif +#ifdef VA_FOURCC_Y412 + MAP(Y412, XV36), +#endif // 4:2:0 10-bit #ifdef VA_FOURCC_P010 MAP(P010, P010), #endif +#ifdef VA_FOURCC_P012 + MAP(P012, P012), +#endif #ifdef VA_FOURCC_I010 MAP(I010, YUV420P10), #endif @@ -357,6 +372,8 @@ ctx->pixel_format_attribute = (VASurfaceAttrib) { .type = VASurfaceAttribPixelFormat, + .flags = VA_SURFACE_ATTRIB_SETTABLE, + .value.type = VAGenericValueTypeInteger, .value.value.i = best_fourcc, }; @@ -410,7 +427,9 @@ MAP(VP9, VP9_0, VP9Profile0 ), #endif #if VA_CHECK_VERSION(0, 39, 0) + MAP(VP9, VP9_1, VP9Profile1 ), MAP(VP9, VP9_2, VP9Profile2 ), + MAP(VP9, VP9_3, VP9Profile3 ), #endif #if VA_CHECK_VERSION(1, 8, 0) MAP(AV1, AV1_MAIN, AV1Profile0), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.c 2023-03-03 13:29:59.000000000 +0000 @@ -695,6 +695,7 @@ pkt->flags |= AV_PKT_FLAG_KEY; pkt->pts = pic->pts; + pkt->duration = pic->duration; vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); if (vas != VA_STATUS_SUCCESS) { @@ -704,6 +705,14 @@ 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) { + pkt->opaque = pic->opaque; + pkt->opaque_ref = pic->opaque_ref; + pic->opaque_ref = NULL; + } + av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; @@ -777,6 +786,8 @@ av_frame_free(&pic->input_image); av_frame_free(&pic->recon_image); + av_buffer_unref(&pic->opaque_ref); + av_freep(&pic->param_buffers); av_freep(&pic->slices); // Output buffer should already be destroyed. @@ -1144,6 +1155,15 @@ pic->input_surface = (VASurfaceID)(uintptr_t)frame->data[3]; pic->pts = frame->pts; + pic->duration = frame->duration; + + if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + err = av_buffer_replace(&pic->opaque_ref, frame->opaque_ref); + if (err < 0) + goto fail; + + pic->opaque = frame->opaque; + } av_frame_move_ref(pic->input_image, frame); @@ -1305,9 +1325,14 @@ { "YUV420", VA_RT_FORMAT_YUV420, 8, 3, 1, 1 }, { "YUV422", VA_RT_FORMAT_YUV422, 8, 3, 1, 0 }, #if VA_CHECK_VERSION(1, 2, 0) + { "YUV420_12", VA_RT_FORMAT_YUV420_12, 12, 3, 1, 1 }, { "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 }, + { "YUV422_12", VA_RT_FORMAT_YUV422_12, 12, 3, 1, 0 }, + { "YUV444_10", VA_RT_FORMAT_YUV444_10, 10, 3, 0, 0 }, + { "YUV444_12", VA_RT_FORMAT_YUV444_12, 12, 3, 0, 0 }, #endif { "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 }, + { "XYUV", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 }, { "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 }, #if VA_CHECK_VERSION(0, 38, 1) { "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode.h 2023-03-03 13:29:59.000000000 +0000 @@ -75,8 +75,12 @@ int64_t display_order; int64_t encode_order; int64_t pts; + int64_t duration; int force_idr; + void *opaque; + AVBufferRef *opaque_ref; + #if VA_CHECK_VERSION(1, 0, 0) // ROI regions. VAEncROI *roi; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h264.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h264.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h264.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h264.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "libavutil/internal.h" #include "libavutil/opt.h" +#include "atsc_a53.h" #include "avcodec.h" #include "cbs.h" #include "cbs_h264.h" @@ -33,6 +34,7 @@ #include "h264.h" #include "h264_levels.h" #include "h264_sei.h" +#include "h2645data.h" #include "vaapi_encode.h" #include "version.h" @@ -40,6 +42,7 @@ SEI_TIMING = 0x01, SEI_IDENTIFIER = 0x02, SEI_RECOVERY_POINT = 0x04, + SEI_A53_CC = 0x08, }; // Random (version 4) ISO 11578 UUID. @@ -98,6 +101,8 @@ H264RawSEIRecoveryPoint sei_recovery_point; SEIRawUserDataUnregistered sei_identifier; char *sei_identifier_string; + SEIRawUserDataRegistered sei_a53cc; + void *sei_a53cc_data; int aud_needed; int sei_needed; @@ -248,6 +253,13 @@ if (err < 0) goto fail; } + if (priv->sei_needed & SEI_A53_CC) { + err = ff_cbs_sei_add_message(priv->cbc, au, 1, + SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35, + &priv->sei_a53cc, NULL); + if (err < 0) + goto fail; + } priv->sei_needed = 0; @@ -349,8 +361,10 @@ sps->chroma_format_idc = 1; sps->log2_max_frame_num_minus4 = 4; - sps->pic_order_cnt_type = 0; - sps->log2_max_pic_order_cnt_lsb_minus4 = 4; + sps->pic_order_cnt_type = ctx->max_b_depth ? 0 : 2; + if (sps->pic_order_cnt_type == 0) { + sps->log2_max_pic_order_cnt_lsb_minus4 = 4; + } sps->max_num_ref_frames = priv->dpb_frames; @@ -378,24 +392,17 @@ if (avctx->sample_aspect_ratio.num != 0 && avctx->sample_aspect_ratio.den != 0) { - static const AVRational sar_idc[] = { - { 0, 0 }, - { 1, 1 }, { 12, 11 }, { 10, 11 }, { 16, 11 }, - { 40, 33 }, { 24, 11 }, { 20, 11 }, { 32, 11 }, - { 80, 33 }, { 18, 11 }, { 15, 11 }, { 64, 33 }, - { 160, 99 }, { 4, 3 }, { 3, 2 }, { 2, 1 }, - }; int num, den, i; av_reduce(&num, &den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535); - for (i = 0; i < FF_ARRAY_ELEMS(sar_idc); i++) { - if (num == sar_idc[i].num && - den == sar_idc[i].den) { + for (i = 0; i < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect); i++) { + if (num == ff_h2645_pixel_aspect[i].num && + den == ff_h2645_pixel_aspect[i].den) { sps->vui.aspect_ratio_idc = i; break; } } - if (i >= FF_ARRAY_ELEMS(sar_idc)) { + if (i >= FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) { sps->vui.aspect_ratio_idc = 255; sps->vui.sar_width = num; sps->vui.sar_height = den; @@ -638,6 +645,10 @@ } } hpic->pic_order_cnt = pic->display_order - hpic->last_idr_frame; + if (priv->raw_sps.pic_order_cnt_type == 2) { + hpic->pic_order_cnt *= 2; + } + hpic->dpb_delay = pic->display_order - pic->encode_order + ctx->max_b_depth; hpic->cpb_delay = pic->encode_order - hpic->last_idr_frame; @@ -681,6 +692,22 @@ priv->sei_needed |= SEI_RECOVERY_POINT; } + if (priv->sei & SEI_A53_CC) { + int err; + size_t sei_a53cc_len; + av_freep(&priv->sei_a53cc_data); + err = ff_alloc_a53_sei(pic->input_image, 0, &priv->sei_a53cc_data, &sei_a53cc_len); + if (err < 0) + return err; + if (priv->sei_a53cc_data != NULL) { + priv->sei_a53cc.itu_t_t35_country_code = 181; + priv->sei_a53cc.data = (uint8_t *)priv->sei_a53cc_data + 1; + priv->sei_a53cc.data_length = sei_a53cc_len - 1; + + priv->sei_needed |= SEI_A53_CC; + } + } + vpic->CurrPic = (VAPictureH264) { .picture_id = pic->recon_surface, .frame_idx = hpic->frame_num, @@ -1226,6 +1253,7 @@ ff_cbs_fragment_free(&priv->current_access_unit); ff_cbs_close(&priv->cbc); av_freep(&priv->sei_identifier_string); + av_freep(&priv->sei_a53cc_data); return ff_vaapi_encode_close(avctx); } @@ -1252,7 +1280,7 @@ { "sei", "Set SEI to include", OFFSET(sei), AV_OPT_TYPE_FLAGS, - { .i64 = SEI_IDENTIFIER | SEI_TIMING | SEI_RECOVERY_POINT }, + { .i64 = SEI_IDENTIFIER | SEI_TIMING | SEI_RECOVERY_POINT | SEI_A53_CC }, 0, INT_MAX, FLAGS, "sei" }, { "identifier", "Include encoder version identifier", 0, AV_OPT_TYPE_CONST, { .i64 = SEI_IDENTIFIER }, @@ -1263,6 +1291,9 @@ { "recovery_point", "Include recovery points where appropriate", 0, AV_OPT_TYPE_CONST, { .i64 = SEI_RECOVERY_POINT }, INT_MIN, INT_MAX, FLAGS, "sei" }, + { "a53_cc", "Include A/53 caption data", + 0, AV_OPT_TYPE_CONST, { .i64 = SEI_A53_CC }, + INT_MIN, INT_MAX, FLAGS, "sei" }, { "profile", "Set profile (profile_idc and constraint_set*_flag)", OFFSET(profile), AV_OPT_TYPE_INT, @@ -1327,7 +1358,7 @@ const FFCodec ff_h264_vaapi_encoder = { .p.name = "h264_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("H.264/AVC (VAAPI)"), + CODEC_LONG_NAME("H.264/AVC (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(VAAPIEncodeH264Context), @@ -1336,8 +1367,9 @@ .close = &vaapi_encode_h264_close, .p.priv_class = &vaapi_encode_h264_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + 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_h264_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h265.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h265.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h265.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_h265.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,10 +27,12 @@ #include "libavutil/opt.h" #include "libavutil/mastering_display_metadata.h" +#include "atsc_a53.h" #include "avcodec.h" #include "cbs.h" #include "cbs_h265.h" #include "codec_internal.h" +#include "h2645data.h" #include "h265_profile_level.h" #include "hevc.h" #include "hevc_sei.h" @@ -40,6 +42,7 @@ enum { SEI_MASTERING_DISPLAY = 0x08, SEI_CONTENT_LIGHT_LEVEL = 0x10, + SEI_A53_CC = 0x20, }; typedef struct VAAPIEncodeH265Picture { @@ -84,6 +87,8 @@ SEIRawMasteringDisplayColourVolume sei_mastering_display; SEIRawContentLightLevelInfo sei_content_light_level; + SEIRawUserDataRegistered sei_a53cc; + void *sei_a53cc_data; CodedBitstreamContext *cbc; CodedBitstreamFragment current_access_unit; @@ -226,6 +231,13 @@ if (err < 0) goto fail; } + if (priv->sei_needed & SEI_A53_CC) { + err = ff_cbs_sei_add_message(priv->cbc, au, 1, + SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35, + &priv->sei_a53cc, NULL); + if (err < 0) + goto fail; + } priv->sei_needed = 0; @@ -496,24 +508,17 @@ if (avctx->sample_aspect_ratio.num != 0 && avctx->sample_aspect_ratio.den != 0) { - static const AVRational sar_idc[] = { - { 0, 0 }, - { 1, 1 }, { 12, 11 }, { 10, 11 }, { 16, 11 }, - { 40, 33 }, { 24, 11 }, { 20, 11 }, { 32, 11 }, - { 80, 33 }, { 18, 11 }, { 15, 11 }, { 64, 33 }, - { 160, 99 }, { 4, 3 }, { 3, 2 }, { 2, 1 }, - }; int num, den, i; av_reduce(&num, &den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535); - for (i = 0; i < FF_ARRAY_ELEMS(sar_idc); i++) { - if (num == sar_idc[i].num && - den == sar_idc[i].den) { + for (i = 0; i < FF_ARRAY_ELEMS(ff_h2645_pixel_aspect); i++) { + if (num == ff_h2645_pixel_aspect[i].num && + den == ff_h2645_pixel_aspect[i].den) { vui->aspect_ratio_idc = i; break; } } - if (i >= FF_ARRAY_ELEMS(sar_idc)) { + if (i >= FF_ARRAY_ELEMS(ff_h2645_pixel_aspect)) { vui->aspect_ratio_idc = 255; vui->sar_width = num; vui->sar_height = den; @@ -888,6 +893,22 @@ } } + if (priv->sei & SEI_A53_CC) { + int err; + size_t sei_a53cc_len; + av_freep(&priv->sei_a53cc_data); + err = ff_alloc_a53_sei(pic->input_image, 0, &priv->sei_a53cc_data, &sei_a53cc_len); + if (err < 0) + return err; + if (priv->sei_a53cc_data != NULL) { + priv->sei_a53cc.itu_t_t35_country_code = 181; + priv->sei_a53cc.data = (uint8_t *)priv->sei_a53cc_data + 1; + priv->sei_a53cc.data_length = sei_a53cc_len - 1; + + priv->sei_needed |= SEI_A53_CC; + } + } + vpic->decoded_curr_pic = (VAPictureHEVC) { .picture_id = pic->recon_surface, .pic_order_cnt = hpic->pic_order_cnt, @@ -1276,8 +1297,13 @@ { FF_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 }, #endif { FF_PROFILE_UNKNOWN } }; @@ -1350,6 +1376,7 @@ ff_cbs_fragment_free(&priv->current_access_unit); ff_cbs_close(&priv->cbc); + av_freep(&priv->sei_a53cc_data); return ff_vaapi_encode_close(avctx); } @@ -1408,7 +1435,7 @@ { "sei", "Set SEI to include", OFFSET(sei), AV_OPT_TYPE_FLAGS, - { .i64 = SEI_MASTERING_DISPLAY | SEI_CONTENT_LIGHT_LEVEL }, + { .i64 = SEI_MASTERING_DISPLAY | SEI_CONTENT_LIGHT_LEVEL | SEI_A53_CC }, 0, INT_MAX, FLAGS, "sei" }, { "hdr", "Include HDR metadata for mastering display colour volume " @@ -1416,6 +1443,11 @@ 0, AV_OPT_TYPE_CONST, { .i64 = SEI_MASTERING_DISPLAY | SEI_CONTENT_LIGHT_LEVEL }, INT_MIN, INT_MAX, FLAGS, "sei" }, + { "a53_cc", + "Include A/53 caption data", + 0, AV_OPT_TYPE_CONST, + { .i64 = SEI_A53_CC }, + INT_MIN, INT_MAX, FLAGS, "sei" }, { "tiles", "Tile columns x rows", OFFSET(common.tile_cols), AV_OPT_TYPE_IMAGE_SIZE, @@ -1446,7 +1478,7 @@ const FFCodec ff_hevc_vaapi_encoder = { .p.name = "hevc_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("H.265/HEVC (VAAPI)"), + CODEC_LONG_NAME("H.265/HEVC (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .priv_data_size = sizeof(VAAPIEncodeH265Context), @@ -1455,8 +1487,9 @@ .close = &vaapi_encode_h265_close, .p.priv_class = &vaapi_encode_h265_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + 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_h265_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mjpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mjpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mjpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mjpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -566,7 +566,7 @@ const FFCodec ff_mjpeg_vaapi_encoder = { .p.name = "mjpeg_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (VAAPI)"), + CODEC_LONG_NAME("MJPEG (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(VAAPIEncodeMJPEGContext), @@ -574,8 +574,10 @@ FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &vaapi_encode_mjpeg_close, .p.priv_class = &vaapi_encode_mjpeg_class, - .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = 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_mjpeg_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mpeg2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mpeg2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mpeg2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_mpeg2.c 2023-03-03 13:29:59.000000000 +0000 @@ -689,7 +689,7 @@ const FFCodec ff_mpeg2_vaapi_encoder = { .p.name = "mpeg2_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 (VAAPI)"), + CODEC_LONG_NAME("MPEG-2 (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(VAAPIEncodeMPEG2Context), @@ -698,8 +698,9 @@ .close = &vaapi_encode_mpeg2_close, .p.priv_class = &vaapi_encode_mpeg2_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + 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_mpeg2_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp8.c 2023-03-03 13:29:59.000000000 +0000 @@ -244,7 +244,7 @@ const FFCodec ff_vp8_vaapi_encoder = { .p.name = "vp8_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("VP8 (VAAPI)"), + CODEC_LONG_NAME("VP8 (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP8, .priv_data_size = sizeof(VAAPIEncodeVP8Context), @@ -253,8 +253,9 @@ .close = &ff_vaapi_encode_close, .p.priv_class = &vaapi_encode_vp8_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + 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_vp8_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp9.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp9.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp9.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_encode_vp9.c 2023-03-03 13:29:59.000000000 +0000 @@ -228,7 +228,9 @@ 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 } }; @@ -297,7 +299,7 @@ const FFCodec ff_vp9_vaapi_encoder = { .p.name = "vp9_vaapi", - .p.long_name = NULL_IF_CONFIG_SMALL("VP9 (VAAPI)"), + CODEC_LONG_NAME("VP9 (VAAPI)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, .priv_data_size = sizeof(VAAPIEncodeVP9Context), @@ -306,8 +308,9 @@ .close = &ff_vaapi_encode_close, .p.priv_class = &vaapi_encode_vp9_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | - AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + 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_vp9_defaults, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -567,15 +567,24 @@ } #if VA_CHECK_VERSION(1, 2, 0) - if (!strcmp(profile->name, "Main 4:2:2 10") || + if (!strcmp(profile->name, "Main 12") || + !strcmp(profile->name, "Main 12 Intra")) + return VAProfileHEVCMain12; + else if (!strcmp(profile->name, "Main 4:2:2 10") || !strcmp(profile->name, "Main 4:2:2 10 Intra")) return VAProfileHEVCMain422_10; + else if (!strcmp(profile->name, "Main 4:2:2 12") || + !strcmp(profile->name, "Main 4:2:2 12 Intra")) + return VAProfileHEVCMain422_12; else if (!strcmp(profile->name, "Main 4:4:4") || !strcmp(profile->name, "Main 4:4:4 Intra")) return VAProfileHEVCMain444; else if (!strcmp(profile->name, "Main 4:4:4 10") || !strcmp(profile->name, "Main 4:4:4 10 Intra")) return VAProfileHEVCMain444_10; + else if (!strcmp(profile->name, "Main 4:4:4 12") || + !strcmp(profile->name, "Main 4:4:4 12 Intra")) + return VAProfileHEVCMain444_12; #else av_log(avctx, AV_LOG_WARNING, "HEVC profile %s is " "not supported with this VA version.\n", profile->name); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_mpeg4.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_mpeg4.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_mpeg4.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_mpeg4.c 2023-03-03 13:29:59.000000000 +0000 @@ -66,7 +66,7 @@ .interlaced = !s->progressive_sequence, .obmc_disable = 1, .sprite_enable = ctx->vol_sprite_usage, - .sprite_warping_accuracy = s->sprite_warping_accuracy, + .sprite_warping_accuracy = ctx->sprite_warping_accuracy, .quant_type = s->mpeg_quant, .quarter_sample = s->quarter_sample, .data_partitioned = s->data_partitioning, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vc1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vc1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vc1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vc1.c 2023-03-03 13:29:59.000000000 +0000 @@ -457,8 +457,6 @@ if (ret < 0) goto fail; - ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - fail: return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vp8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vp8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vp8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vaapi_vp8.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,21 +36,21 @@ av_unused uint32_t size) { const VP8Context *s = avctx->priv_data; - VAAPIDecodePicture *pic = s->framep[VP56_FRAME_CURRENT]->hwaccel_picture_private; + VAAPIDecodePicture *pic = s->framep[VP8_FRAME_CURRENT]->hwaccel_picture_private; VAPictureParameterBufferVP8 pp; VAProbabilityDataBufferVP8 prob; VAIQMatrixBufferVP8 quant; int err, i, j, k; - pic->output_surface = vaapi_vp8_surface_id(s->framep[VP56_FRAME_CURRENT]); + pic->output_surface = vaapi_vp8_surface_id(s->framep[VP8_FRAME_CURRENT]); pp = (VAPictureParameterBufferVP8) { .frame_width = avctx->width, .frame_height = avctx->height, - .last_ref_frame = vaapi_vp8_surface_id(s->framep[VP56_FRAME_PREVIOUS]), - .golden_ref_frame = vaapi_vp8_surface_id(s->framep[VP56_FRAME_GOLDEN]), - .alt_ref_frame = vaapi_vp8_surface_id(s->framep[VP56_FRAME_GOLDEN2]), + .last_ref_frame = vaapi_vp8_surface_id(s->framep[VP8_FRAME_PREVIOUS]), + .golden_ref_frame = vaapi_vp8_surface_id(s->framep[VP8_FRAME_GOLDEN]), + .alt_ref_frame = vaapi_vp8_surface_id(s->framep[VP8_FRAME_ALTREF]), .out_of_loop_frame = VA_INVALID_SURFACE, .pic_fields.bits = { @@ -67,8 +67,8 @@ .loop_filter_adj_enable = s->lf_delta.enabled, .mode_ref_lf_delta_update = s->lf_delta.update, - .sign_bias_golden = s->sign_bias[VP56_FRAME_GOLDEN], - .sign_bias_alternate = s->sign_bias[VP56_FRAME_GOLDEN2], + .sign_bias_golden = s->sign_bias[VP8_FRAME_GOLDEN], + .sign_bias_alternate = s->sign_bias[VP8_FRAME_ALTREF], .mb_no_coeff_skip = s->mbskip_enabled, .loop_filter_disable = s->filter.level == 0, @@ -177,7 +177,7 @@ static int vaapi_vp8_end_frame(AVCodecContext *avctx) { const VP8Context *s = avctx->priv_data; - VAAPIDecodePicture *pic = s->framep[VP56_FRAME_CURRENT]->hwaccel_picture_private; + VAAPIDecodePicture *pic = s->framep[VP8_FRAME_CURRENT]->hwaccel_picture_private; return ff_vaapi_decode_issue(avctx, pic); } @@ -187,7 +187,7 @@ uint32_t size) { const VP8Context *s = avctx->priv_data; - VAAPIDecodePicture *pic = s->framep[VP56_FRAME_CURRENT]->hwaccel_picture_private; + VAAPIDecodePicture *pic = s->framep[VP8_FRAME_CURRENT]->hwaccel_picture_private; VASliceParameterBufferVP8 sp; int err, i; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vb.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vb.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vb.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vb.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,10 @@ * VB Video decoder */ -#include -#include - #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" enum VBFlags { VB_HAS_GMC = 0x01, @@ -280,7 +277,7 @@ const FFCodec ff_vb_decoder = { .p.name = "vb", - .p.long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"), + CODEC_LONG_NAME("Beam Software VB"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VB, .priv_data_size = sizeof(VBDecContext), @@ -288,5 +285,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vble.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vble.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vble.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vble.c 2023-03-03 13:29:59.000000000 +0000 @@ -203,7 +203,7 @@ const FFCodec ff_vble_decoder = { .p.name = "vble", - .p.long_name = NULL_IF_CONFIG_SMALL("VBLE Lossless Codec"), + CODEC_LONG_NAME("VBLE Lossless Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VBLE, .priv_data_size = sizeof(VBLEContext), @@ -211,5 +211,4 @@ .close = vble_decode_close, FF_CODEC_DECODE_CB(vble_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbndec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbndec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbndec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbndec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "texturedsp.h" #include "vbn.h" #include "libavutil/imgutils.h" @@ -175,12 +175,11 @@ const FFCodec ff_vbn_decoder = { .p.name = "vbn", - .p.long_name = NULL_IF_CONFIG_SMALL("Vizrt Binary Image"), + CODEC_LONG_NAME("Vizrt Binary Image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VBN, .init = vbn_init, FF_CODEC_DECODE_CB(vbn_decode_frame), .priv_data_size = sizeof(VBNContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbnenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbnenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbnenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vbnenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -116,7 +116,7 @@ ctx->enc.tex_data.out = pkt->data + VBN_HEADER_SIZE; avctx->execute2(avctx, ff_texturedsp_compress_thread, &ctx->enc, NULL, ctx->enc.slice_count); } else { - uint8_t *flipped = frame->data[0] + frame->linesize[0] * (frame->height - 1); + const uint8_t *flipped = frame->data[0] + frame->linesize[0] * (frame->height - 1); av_image_copy_plane(pkt->data + VBN_HEADER_SIZE, linesize, flipped, -frame->linesize[0], linesize, frame->height); } @@ -150,10 +150,11 @@ const FFCodec ff_vbn_encoder = { .p.name = "vbn", - .p.long_name = NULL_IF_CONFIG_SMALL("Vizrt Binary Image"), + CODEC_LONG_NAME("Vizrt Binary Image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VBN, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.priv_class = &vbnenc_class, .init = vbn_init, FF_CODEC_ENCODE_CB(vbn_encode), @@ -161,6 +162,5 @@ .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE, }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_block.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_block.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_block.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_block.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,16 +30,13 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" -#include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "unary.h" #include "vc1.h" #include "vc1_pred.h" #include "vc1acdata.h" #include "vc1data.h" -#define MB_INTRA_VLC_BITS 9 -#define DC_VLC_BITS 9 - // offset tables for interlaced picture MVDATA decoding static const uint8_t offset_table[2][9] = { { 0, 1, 2, 4, 8, 16, 32, 64, 128 }, @@ -68,6 +65,13 @@ } } +static inline void update_block_index(MpegEncContext *s) +{ + /* VC1 is always 420 except when using AV_CODEC_FLAG_GRAY + * (or a HWAccel). Shall we inline this value? */ + ff_update_block_index(s, 8, 0, s->chroma_x_shift); +} + /** @} */ //Bitplane group static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) @@ -589,9 +593,11 @@ /* Get DC differential */ if (n < 4) { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } else { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } if (dcdiff) { const int m = (v->pq == 1 || v->pq == 2) ? 3 - v->pq : 0; @@ -733,9 +739,11 @@ /* Get DC differential */ if (n < 4) { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } else { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } if (dcdiff) { const int m = (quant == 1 || quant == 2) ? 3 - quant : 0; @@ -933,9 +941,11 @@ /* Get DC differential */ if (n < 4) { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } else { - dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); + dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, + MSMP4_DC_VLC_BITS, 3); } if (dcdiff) { const int m = (quant == 1 || quant == 2) ? 3 - quant : 0; @@ -2570,7 +2580,7 @@ s->mb_x = 0; init_block_index(v); for (; s->mb_x < v->end_mb_x; s->mb_x++) { - ff_update_block_index(s); + update_block_index(s); s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); mb_pos = s->mb_x + s->mb_y * s->mb_width; s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; @@ -2581,7 +2591,8 @@ } // do actual MB decoding and displaying - cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); + cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, + MSMP4_MB_INTRA_VLC_BITS, 2); v->s.ac_pred = get_bits1(&v->s.gb); for (k = 0; k < 6; k++) { @@ -2633,15 +2644,9 @@ v->left_blk_idx = (v->left_blk_idx + 1) % (v->end_mb_x + 2); v->cur_blk_idx = (v->cur_blk_idx + 1) % (v->end_mb_x + 2); } - if (!v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16); - else if (s->mb_y) - ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16); s->first_slice_line = 0; } - if (v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16); /* This is intentionally mb_height and not end_mb_y - unlike in advanced * profile, these only differ are when decoding MSS2 rectangles. */ @@ -2705,7 +2710,7 @@ init_block_index(v); for (;s->mb_x < s->mb_width; s->mb_x++) { mquant = v->pq; - ff_update_block_index(s); + update_block_index(s); s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); mb_pos = s->mb_x + s->mb_y * s->mb_stride; s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; @@ -2722,7 +2727,8 @@ return 0; } - cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); + cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, + MSMP4_MB_INTRA_VLC_BITS, 2); if (v->acpred_is_raw) v->s.ac_pred = get_bits1(&v->s.gb); else @@ -2779,15 +2785,9 @@ inc_blk_idx(v->left_blk_idx); inc_blk_idx(v->cur_blk_idx); } - if (!v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16); - else if (s->mb_y) - ff_mpeg_draw_horiz_band(s, (s->mb_y-1) * 16, 16); s->first_slice_line = 0; } - if (v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16); ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1, (s->end_mb_y << v->field_mode) - 1, ER_MB_END); return 0; @@ -2830,7 +2830,7 @@ s->mb_x = 0; init_block_index(v); for (; s->mb_x < s->mb_width; s->mb_x++) { - ff_update_block_index(s); + update_block_index(s); if (v->fcm == ILACE_FIELD || (v->fcm == PROGRESSIVE && v->mv_type_is_raw) || v->skip_is_raw) if (get_bits_left(&v->s.gb) <= 1) { @@ -2875,12 +2875,8 @@ memmove(v->luma_mv_base, v->luma_mv - s->mb_stride, sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride); - if (s->mb_y != s->start_mb_y) - ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16); s->first_slice_line = 0; } - if (s->end_mb_y >= s->start_mb_y) - ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16); ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1, (s->end_mb_y << v->field_mode) - 1, ER_MB_END); } @@ -2919,7 +2915,7 @@ s->mb_x = 0; init_block_index(v); for (; s->mb_x < s->mb_width; s->mb_x++) { - ff_update_block_index(s); + update_block_index(s); if (v->fcm == ILACE_FIELD || v->skip_is_raw || v->dmb_is_raw) if (get_bits_left(&v->s.gb) <= 1) { @@ -2957,14 +2953,8 @@ memmove(v->is_intra_base, v->is_intra - s->mb_stride, sizeof(v->is_intra_base[0]) * 2 * s->mb_stride); - if (!v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16); - else if (s->mb_y) - ff_mpeg_draw_horiz_band(s, (s->mb_y - 1) * 16, 16); s->first_slice_line = 0; } - if (v->s.loop_filter) - ff_mpeg_draw_horiz_band(s, (s->end_mb_y - 1) * 16, 16); ff_er_add_slice(&s->er, 0, s->start_mb_y << v->field_mode, s->mb_width - 1, (s->end_mb_y << v->field_mode) - 1, ER_MB_END); } @@ -2981,14 +2971,12 @@ for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) { s->mb_x = 0; init_block_index(v); - ff_update_block_index(s); + update_block_index(s); memcpy(s->dest[0], s->last_picture.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16); memcpy(s->dest[1], s->last_picture.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); - ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16); s->first_slice_line = 0; } - s->pict_type = AV_PICTURE_TYPE_P; } void ff_vc1_decode_blocks(VC1Context *v) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,16 +26,13 @@ * VC-1 and WMV3 decoder common code */ -#include "libavutil/attributes.h" -#include "libavutil/thread.h" -#include "internal.h" #include "avcodec.h" +#include "decode.h" #include "mpegvideo.h" #include "vc1.h" #include "vc1data.h" #include "wmv2data.h" #include "unary.h" -#include "simple_idct.h" /***********************************************************************/ /** @@ -314,16 +311,6 @@ v->res_x8 = get_bits1(gb); //reserved v->multires = get_bits1(gb); v->res_fasttx = get_bits1(gb); - if (!v->res_fasttx) { - v->vc1dsp.vc1_inv_trans_8x8 = ff_simple_idct_int16_8bit; - v->vc1dsp.vc1_inv_trans_8x4 = ff_simple_idct84_add; - v->vc1dsp.vc1_inv_trans_4x8 = ff_simple_idct48_add; - v->vc1dsp.vc1_inv_trans_4x4 = ff_simple_idct44_add; - v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit; - v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add; - v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add; - v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add; - } v->fastuvmc = get_bits1(gb); //common if (!v->profile && !v->fastuvmc) { @@ -613,9 +600,12 @@ } static int read_bfraction(VC1Context *v, GetBitContext* gb) { - int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); + int bfraction_lut_index = get_bits(gb, 3); + + if (bfraction_lut_index == 7) + bfraction_lut_index = 7 + get_bits(gb, 4); - if (bfraction_lut_index == 21 || bfraction_lut_index < 0) { + if (bfraction_lut_index == 21) { av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n"); return AVERROR_INVALIDDATA; } @@ -632,8 +622,6 @@ v->fcm = PROGRESSIVE; if (v->finterpflag) v->interpfrm = get_bits1(gb); - if (!v->s.avctx->codec) - return -1; if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2) v->respic = v->rangered = @@ -935,8 +923,6 @@ v->rnd = get_bits1(gb); if (v->interlace) v->uvsamp = get_bits1(gb); - if(!ff_vc1_bfraction_vlc.table) - return 0; //parsing only, vlc tables havnt been allocated if (v->field_mode) { if (!v->refdist_flag) v->refdist = 0; @@ -1350,365 +1336,3 @@ return 0; } - -static const uint32_t vc1_ac_tables[AC_MODES][186][2] = { -{ -{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7}, -{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10}, -{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14}, -{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9}, -{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13}, -{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7}, -{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13}, -{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7}, -{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13}, -{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11}, -{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11}, -{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14}, -{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10}, -{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14}, -{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13}, -{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11}, -{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14}, -{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12}, -{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13}, -{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4}, -{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5}, -{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10}, -{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14}, -{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8}, -{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8}, -{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8}, -{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9}, -{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11}, -{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12}, -{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13}, -{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9} -}, -{ -{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7}, -{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11}, -{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13}, -{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4}, -{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11}, -{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7}, -{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15}, -{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14}, -{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14}, -{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7}, -{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13}, -{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11}, -{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13}, -{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10}, -{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12}, -{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14}, -{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8}, -{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15}, -{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4}, -{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12}, -{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10}, -{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12}, -{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13}, -{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12}, -{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10}, -{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11}, -{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14}, -{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14}, -{ 0x0169, 9} -}, -{ -{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7}, -{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10}, -{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5}, -{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11}, -{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8}, -{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5}, -{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13}, -{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6}, -{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11}, -{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10}, -{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10}, -{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11}, -{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12}, -{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11}, -{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5}, -{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12}, -{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7}, -{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8}, -{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8}, -{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9}, -{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12}, -{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13}, -{ 0x0016, 7} -}, -{ -{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10}, -{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14}, -{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11}, -{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5}, -{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9}, -{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14}, -{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11}, -{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11}, -{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12}, -{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12}, -{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9}, -{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11}, -{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12}, -{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10}, -{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15}, -{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15}, -{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12}, -{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13}, -{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12}, -{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15}, -{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10}, -{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9}, -{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13}, -{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14}, -{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9} -}, -{ -{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6}, -{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8}, -{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10}, -{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11}, -{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7}, -{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12}, -{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12}, -{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9}, -{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9}, -{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10}, -{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10}, -{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10}, -{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10}, -{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11}, -{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8}, -{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9}, -{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, -{ 0x0003, 7} -}, -{ -{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9}, -{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, -{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12}, -{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9}, -{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10}, -{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10}, -{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12}, -{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9}, -{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9}, -{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9}, -{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6}, -{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8}, -{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8}, -{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, -{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10}, -{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12}, -{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, -{ 0x0003, 7} -}, -{ -{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5}, -{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7}, -{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8}, -{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9}, -{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10}, -{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11}, -{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11}, -{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12}, -{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12}, -{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7}, -{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10}, -{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12}, -{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7}, -{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12}, -{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10}, -{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10}, -{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11}, -{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13}, -{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13}, -{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11}, -{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13}, -{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11}, -{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12}, -{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13}, -{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14}, -{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16}, -{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13}, -{ 0x007A, 7} -}, -{ -{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7}, -{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9}, -{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11}, -{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12}, -{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13}, -{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8}, -{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12}, -{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8}, -{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5}, -{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5}, -{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10}, -{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14}, -{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15}, -{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9}, -{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10}, -{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11}, -{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12}, -{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13}, -{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6}, -{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7}, -{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13}, -{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15}, -{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15}, -{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17}, -{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20}, -{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20}, -{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21}, -{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22}, -{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13}, -{ 0x0073, 7} -} -}; - -static const uint16_t vlc_offs[] = { - 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436, - 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342, - 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522, - 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980, - 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866, - 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186, - 31714, 31746, 31778, 32306, 32340, 32372 -}; - -static av_cold void vc1_init_static(void) -{ - static VLCElem vlc_table[32372]; - - INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, - ff_vc1_bfraction_bits, 1, 1, - ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, - ff_vc1_norm2_bits, 1, 1, - ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, - ff_vc1_norm6_bits, 1, 1, - ff_vc1_norm6_codes, 2, 2, 556); - INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, - ff_vc1_imode_bits, 1, 1, - ff_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, - ff_vc1_ttmb_bits[i], 1, 1, - ff_vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_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, - ff_vc1_ttblk_bits[i], 1, 1, - ff_vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_subblkpat_bits[i], 1, 1, - ff_vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_4mv_block_pattern_bits[i], 1, 1, - ff_vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_cbpcy_p_bits[i], 1, 1, - ff_vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_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, - ff_vc1_mv_diff_bits[i], 1, 1, - ff_vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_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], - &vc1_ac_tables[i][0][1], 8, 4, - &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_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, - ff_vc1_2ref_mvdata_bits[i], 1, 1, - ff_vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_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, - ff_vc1_intfr_4mv_mbmode_bits[i], 1, 1, - ff_vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_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, - ff_vc1_intfr_non4mv_mbmode_bits[i], 1, 1, - ff_vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_1ref_mvdata_bits[i], 1, 1, - ff_vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_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, - ff_vc1_2mv_block_pattern_bits[i], 1, 1, - ff_vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_icbpcy_p_bits[i], 1, 1, - ff_vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_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, - ff_vc1_if_mmv_mbmode_bits[i], 1, 1, - ff_vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_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, - ff_vc1_if_1mv_mbmode_bits[i], 1, 1, - ff_vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); - } -} - -/** - * Init VC-1 specific tables and VC1Context members - * @param v The VC1Context to initialize - * @return Status - */ -av_cold void ff_vc1_init_common(VC1Context *v) -{ - static AVOnce init_static_once = AV_ONCE_INIT; - - /* defaults */ - v->pq = -1; - v->mvrange = 0; /* 7.1.1.18, p80 */ - - ff_vc1dsp_init(&v->vc1dsp); - - /* VLC tables */ - ff_thread_once(&init_static_once, vc1_init_static); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.c 2023-03-03 13:29:59.000000000 +0000 @@ -98,52 +98,31 @@ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31 } }; -/** @name VC-1 VLC tables and defines +/** @name VC-1 VLC tables * @todo TODO move this into the context */ //@{ -#define VC1_BFRACTION_VLC_BITS 7 -VLC ff_vc1_bfraction_vlc; -#define VC1_IMODE_VLC_BITS 4 VLC ff_vc1_imode_vlc; -#define VC1_NORM2_VLC_BITS 3 VLC ff_vc1_norm2_vlc; -#define VC1_NORM6_VLC_BITS 9 VLC ff_vc1_norm6_vlc; /* Could be optimized, one table only needs 8 bits */ -#define VC1_TTMB_VLC_BITS 9 //12 VLC ff_vc1_ttmb_vlc[3]; -#define VC1_MV_DIFF_VLC_BITS 9 //15 VLC ff_vc1_mv_diff_vlc[4]; -#define VC1_CBPCY_P_VLC_BITS 9 //14 VLC ff_vc1_cbpcy_p_vlc[4]; -#define VC1_ICBPCY_VLC_BITS 9 VLC ff_vc1_icbpcy_vlc[8]; -#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6 VLC ff_vc1_4mv_block_pattern_vlc[4]; -#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3 VLC ff_vc1_2mv_block_pattern_vlc[4]; -#define VC1_TTBLK_VLC_BITS 5 VLC ff_vc1_ttblk_vlc[3]; -#define VC1_SUBBLKPAT_VLC_BITS 6 VLC ff_vc1_subblkpat_vlc[3]; -#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9 VLC ff_vc1_intfr_4mv_mbmode_vlc[4]; -#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6 VLC ff_vc1_intfr_non4mv_mbmode_vlc[4]; -#define VC1_IF_MMV_MBMODE_VLC_BITS 5 VLC ff_vc1_if_mmv_mbmode_vlc[8]; -#define VC1_IF_1MV_MBMODE_VLC_BITS 5 VLC ff_vc1_if_1mv_mbmode_vlc[8]; -#define VC1_1REF_MVDATA_VLC_BITS 9 VLC ff_vc1_1ref_mvdata_vlc[4]; -#define VC1_2REF_MVDATA_VLC_BITS 9 VLC ff_vc1_2ref_mvdata_vlc[8]; VLC ff_vc1_ac_coeff_table[8]; -#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS - // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same //@} @@ -171,25 +150,6 @@ }; #endif -const uint8_t ff_vc1_bfraction_bits[23] = { - 3, 3, 3, 3, - 3, 3, 3, - 7, 7, 7, 7, - 7, 7, 7, 7, - 7, 7, 7, 7, - 7, 7, - 7, 7 -}; -const uint8_t ff_vc1_bfraction_codes[23] = { - 0, 1, 2, 3, - 4, 5, 6, - 112, 113, 114, 115, - 116, 117, 118, 119, - 120, 121, 122, 123, - 124, 125, - 126, 127 -}; - //Same as H.264 const AVRational ff_vc1_pixel_aspect[16] = { { 0, 1 }, @@ -210,811 +170,11 @@ { 0, 1 } }; -/* BitPlane IMODE - such a small table... */ -const uint8_t ff_vc1_imode_codes[7] = { - 0, 2, 1, 3, 1, 2, 3 -}; -const uint8_t ff_vc1_imode_bits[7] = { - 4, 2, 3, 2, 4, 3, 3 -}; - -/* Normal-2 imode */ -const uint8_t ff_vc1_norm2_codes[4] = { - 0, 4, 5, 3 -}; -const uint8_t ff_vc1_norm2_bits[4] = { - 1, 3, 3, 2 -}; - -const uint16_t ff_vc1_norm6_codes[64] = { - 0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E, - 0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037, - 0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036, - 0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007, -}; - -const uint8_t ff_vc1_norm6_bits[64] = { - 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13, - 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, - 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, - 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6, -}; - -/* 4MV Block pattern VLC tables */ -const uint8_t ff_vc1_4mv_block_pattern_codes[4][16] = { - { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2 }, - { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0 }, - { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0 }, - { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 10 } -}; -const uint8_t ff_vc1_4mv_block_pattern_bits[4][16] = { - { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 }, - { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 }, - { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 }, - { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 } -}; - -/* 2MV Block pattern VLC tables */ -const uint8_t ff_vc1_2mv_block_pattern_codes[4][4] = { - { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 } -}; - -const uint8_t ff_vc1_2mv_block_pattern_bits[4][4] = { - { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 } -}; - -/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */ -const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15] = { - { 22, 17, 0, 47, 32, 10, 1, 3, 67, 133, 132, 92, 19, 93, 18 }, - { 3, 45, 0, 7, 23, 6, 1, 2, 10, 39, 44, 8, 18, 77, 76 }, - { 15, 6, 28, 9, 41, 6, 2, 15, 14, 8, 40, 29, 0, 21, 11 }, - { 7, 198, 1, 2, 193, 13, 25, 0, 97, 1599, 98, 398, 798, 192, 1598 } -}; - -const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15] = { - { 5, 5, 2, 6, 6, 4, 2, 2, 7, 8, 8, 7, 5, 7, 5 }, - { 3, 6, 3, 3, 5, 3, 3, 3, 4, 6, 6, 4, 5, 7, 7 }, - { 4, 3, 5, 5, 7, 4, 2, 5, 5, 5, 7, 5, 2, 6, 5 }, - { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 } -}; - -/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */ -const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9] = { - { 9, 22, 0, 17, 16, 10, 1, 3, 23 }, - { 7, 0, 5, 2, 1, 1, 6, 3, 4 }, - { 1, 0, 10, 23, 44, 8, 3, 9, 45 }, - { 7, 97, 1, 2, 49, 13, 25, 0, 96 } -}; - -const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9] = { - { 4, 5, 2, 5, 5, 4, 2, 2, 5 }, - { 3, 4, 6, 2, 3, 2, 3, 5, 6 }, - { 2, 2, 4, 5, 6, 4, 2, 4, 6 }, - { 4, 8, 1, 3, 7, 5, 6, 2, 8 } -}; - -/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ -/* mixed-MV */ -const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8] = { - { 16, 17, 3, 3, 0, 5, 9, 2 }, - { 8, 9, 3, 6, 7, 0, 5, 2 }, - { 16, 17, 5, 3, 0, 3, 9, 2 }, - { 56, 57, 15, 4, 5, 6, 29, 0 }, - { 52, 53, 27, 14, 15, 2, 12, 0 }, - { 56, 57, 29, 5, 6, 0, 15, 4 }, - { 16, 17, 6, 7, 0, 1, 9, 5 }, - { 56, 57, 0, 5, 6, 29, 4, 15 } -}; -const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8] = { - { 6, 6, 2, 3, 2, 4, 5, 2 }, - { 5, 5, 3, 3, 3, 2, 4, 2 }, - { 6, 6, 4, 3, 2, 2, 5, 2 }, - { 6, 6, 4, 3, 3, 3, 5, 1 }, - { 6, 6, 5, 4, 4, 2, 4, 1 }, - { 6, 6, 5, 3, 3, 1, 4, 3 }, - { 5, 5, 3, 3, 2, 2, 4, 3 }, - { 6, 6, 1, 3, 3, 5, 3, 4 } -}; -/* 1MV */ -const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6] = { - { 0, 1, 1, 1, 1, 1 }, - { 0, 1, 1, 1, 1, 1 }, - { 16, 17, 3, 0, 9, 5 }, - { 20, 21, 3, 11, 0, 4 }, - { 4, 5, 2, 3, 3, 0 }, - { 4, 5, 3, 2, 0, 3 }, - { 0, 1, 1, 1, 1, 1 }, - { 16, 17, 9, 5, 3, 0 } -}; -const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = { - { 5, 5, 1, 3, 2, 4 }, - { 5, 5, 1, 2, 3, 4 }, - { 5, 5, 2, 1, 4, 3 }, - { 5, 5, 2, 4, 1, 3 }, - { 4, 4, 2, 3, 2, 2 }, - { 4, 4, 3, 2, 2, 2 }, - { 5, 5, 3, 4, 1, 2 }, - { 5, 5, 4, 3, 2, 1 } -}; - -/* Interlaced frame/field picture MVDATA VLC tables */ - -/* 1-reference tables */ -const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */ - { - 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070, - 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE, - 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D, - 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035, - 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9, - 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C, - 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727, - 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE, - 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266 - }, - { - 0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6, - 0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066, - 0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B, - 0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC, - 0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014, - 0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E, - 0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479, - 0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E, - 0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86 - }, - { - 0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0, - 0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD, - 0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5, - 0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042, - 0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5, - 0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190, - 0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9, - 0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE, - 0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266 - }, - { - 0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D, - 0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3, - 0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093, - 0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029, - 0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008, - 0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092, - 0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9, - 0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E, - 0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26 - } -}; - -const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = { - { - 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4, - 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6, - 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9, - 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16 - }, - { - 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4, - 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5, - 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8, - 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19 - }, - { - 3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4, - 7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7, - 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9, - 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18 - }, - { - 4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4, - 6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5, - 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7, - 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13 - } -}; - -/* 2-reference tables */ -const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */ - { - 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368, - 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC, - 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7, - 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE, - 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052, - 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018, - 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D, - 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5, - 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004, - 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85, - 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D, - 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2, - 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454, - 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0, - 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0, - 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38 - }, - { - 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555, - 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3, - 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B, - 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376, - 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3, - 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF, - 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF, - 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5, - 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B, - 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1, - 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570, - 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554, - 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674, - 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4, - 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40, - 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553 - }, - { - 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E, - 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D, - 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3, - 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD, - 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A, - 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D, - 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032, - 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA, - 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036, - 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350, - 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A, - 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356, - 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351, - 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2, - 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0, - 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9 - }, - { - 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190, - 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F, - 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E, - 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA, - 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174, - 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0, - 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC, - 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C, - 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033, - 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F, - 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F, - 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B, - 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E, - 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A, - 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D, - 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137 - }, - { - 0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2, - 0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED, - 0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED, - 0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039, - 0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070, - 0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A, - 0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7, - 0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F, - 0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085, - 0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434, - 0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2, - 0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC, - 0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2, - 0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD, - 0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F, - 0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386 - }, - { - 0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6, - 0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C, - 0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163, - 0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A, - 0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2, - 0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2, - 0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9, - 0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F, - 0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022, - 0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C, - 0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C, - 0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7, - 0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A, - 0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56, - 0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4, - 0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7 - }, - { - 0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163, - 0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC, - 0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C, - 0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED, - 0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF, - 0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014, - 0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152, - 0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0, - 0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB, - 0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516, - 0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585, - 0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519, - 0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B, - 0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80, - 0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84, - 0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9 - }, - { - 0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E, - 0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707, - 0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37, - 0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661, - 0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199, - 0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033, - 0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E, - 0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012, - 0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338, - 0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB, - 0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C, - 0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D, - 0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4, - 0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C, - 0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076, - 0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB - } -}; - -const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = { - { - 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9, - 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9, - 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7, - 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9, - 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14, - 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12, - 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13, - 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13 - }, - { - 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11, - 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10, - 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8, - 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9, - 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13, - 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11, - 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13, - 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11 - }, - { - 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9, - 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9, - 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8, - 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10, - 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11, - 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11, - 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11, - 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10 - }, - { - 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11, - 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11, - 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8, - 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11, - 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15, - 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13, - 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13, - 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14 - }, - { - 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9, - 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7, - 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7, - 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9, - 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11, - 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11, - 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13, - 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11 - }, - { - 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8, - 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8, - 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8, - 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8, - 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13, - 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12, - 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13, - 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12 - }, - { - 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12, - 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12, - 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8, - 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11, - 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21, - 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21, - 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20, - 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16 - }, - { - 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13, - 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12, - 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8, - 10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9, - 9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20, - 11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13, - 20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13, - 15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16 - } -}; - const uint8_t ff_wmv3_dc_scale_table[32] = { 0, 2, 4, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21 }; -/* P-Picture CBPCY VLC tables */ -// Looks like original tables are not conforming to standard at all. Are they used for old WMV? -const uint16_t ff_vc1_cbpcy_p_codes[4][64] = { - { - 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119, - 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63, - 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62, - 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3 - }, - { - 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30, - 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247, - 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31, - 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125 - }, - { - 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492, - 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247, - 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493, - 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31 - }, - { - 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28, - 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30, - 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29, - 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31 - } -}; - -const uint8_t ff_vc1_cbpcy_p_bits[4][64] = { - { - 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8, - 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7, - 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7, - 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2 - }, - { - 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13, - 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8, - 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13, - 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7 - }, - { - 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9, - 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8, - 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9, - 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5 - }, - { - 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8, - 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8 - } -}; - -/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ -const uint16_t ff_vc1_icbpcy_p_codes[8][63] = { - { - 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091, - 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092, - 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134, - 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093, - 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E, - 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051, - 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054, - 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001 - }, - { - 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045, - 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047, - 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B, - 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009, - 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026, - 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014, - 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F, - 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003 - }, - { - 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027, - 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028, - 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5, - 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029, - 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020, - 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F, - 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024, - 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000 - }, - { - 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001, - 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002, - 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010, - 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003, - 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009, - 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006, - 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012, - 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E - }, - { - 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B, - 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C, - 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B, - 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D, - 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013, - 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008, - 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F, - 0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004 - }, - { - 0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B, - 0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C, - 0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018, - 0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D, - 0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009, - 0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005, - 0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011, - 0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002 - }, - { - 0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001, - 0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002, - 0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021, - 0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003, - 0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016, - 0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A, - 0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B, - 0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0 - }, - { - 0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005, - 0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006, - 0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009, - 0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007, - 0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A, - 0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004, - 0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000, - 0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013 - } -}; - -const uint8_t ff_vc1_icbpcy_p_bits[8][63] = { - { - 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9, - 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9, - 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8, - 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1 - }, - { - 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7, - 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, - 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6, - 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2 - }, - { - 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6, - 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, - 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5, - 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2 - }, - { - 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4, - 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, - 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4, - 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4 - }, - { - 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5, - 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5, - 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5, - 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3 - }, - { - 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4, - 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, - 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4, - 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4 - }, - { - 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3, - 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3, - 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4, - 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9 - }, - { - 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3, - 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3, - 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4, - 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9 - } -}; - -/* MacroBlock Transform Type: 7.1.3.11, p89 - * 8x8:B - * 8x4:B:btm 8x4:B:top 8x4:B:both, - * 4x8:B:right 4x8:B:left 4x8:B:both - * 4x4:B 8x8:MB - * 8x4:MB:btm 8x4:MB:top 8x4,MB,both - * 4x8,MB,right 4x8,MB,left - * 4x4,MB */ -const uint16_t ff_vc1_ttmb_codes[3][16] = { - { - 0x0003, - 0x002E, 0x005F, 0x0000, - 0x0016, 0x0015, 0x0001, - 0x0004, 0x0014, - 0x02F1, 0x0179, 0x017B, - 0x0BC0, 0x0BC1, 0x05E1, - 0x017A - }, - { - 0x0006, - 0x0006, 0x0003, 0x0007, - 0x000F, 0x000E, 0x0000, - 0x0002, 0x0002, - 0x0014, 0x0011, 0x000B, - 0x0009, 0x0021, 0x0015, - 0x0020 - }, - { - 0x0006, - 0x0000, 0x000E, 0x0005, - 0x0002, 0x0003, 0x0003, - 0x000F, 0x0002, - 0x0081, 0x0021, 0x0009, - 0x0101, 0x0041, 0x0011, - 0x0100 - } -}; - -const uint8_t ff_vc1_ttmb_bits[3][16] = { - { - 2, - 6, 7, 2, - 5, 5, 2, - 3, 5, - 10, 9, 9, - 12, 12, 11, - 9 - }, - { - 3, - 4, 4, 4, - 4, 4, 3, - 3, 2, - 7, 7, 6, - 6, 8, 7, - 8 - }, - { - 3, - 3, 4, 5, - 3, 3, 4, - 4, 2, - 10, 8, 6, - 11, 9, 7, - 11 - } -}; - -/* TTBLK (Transform Type per Block) tables */ -const uint8_t ff_vc1_ttblk_codes[3][8] = { - { 0, 1, 3, 5, 16, 17, 18, 19 }, - { 3, 0, 1, 2, 3, 5, 8, 9 }, - { 1, 0, 1, 4, 6, 7, 10, 11 } -}; -const uint8_t ff_vc1_ttblk_bits[3][8] = { - { 2, 2, 2, 3, 5, 5, 5, 5 }, - { 2, 3, 3, 3, 3, 3, 4, 4 }, - { 2, 3, 3, 3, 3, 3, 4, 4 } -}; - -/* SUBBLKPAT tables, p93-94, reordered */ -const uint8_t ff_vc1_subblkpat_codes[3][15] = { - { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1 }, - { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1 }, - { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15 } -}; -const uint8_t ff_vc1_subblkpat_bits[3][15] = { - { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1}, - { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2}, - { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4} -}; - -/* MV differential tables, p265 */ -const uint16_t ff_vc1_mv_diff_codes[4][73] = { - { - 0, 2, 3, 8, 576, 3, 2, 6, - 5, 577, 578, 7, 8, 9, 40, 19, - 37, 82, 21, 22, 23, 579, 580, 166, - 96, 167, 49, 194, 195, 581, 582, 583, - 292, 293, 294, 13, 2, 7, 24, 50, - 102, 295, 13, 7, 8, 18, 50, 103, - 38, 20, 21, 22, 39, 204, 103, 23, - 24, 25, 104, 410, 105, 106, 107, 108, - 109, 220, 411, 442, 222, 443, 446, 447, - 7 /* 73 elements */ - }, - { - 0, 4, 5, 3, 4, 3, 4, 5, - 20, 6, 21, 44, 45, 46, 3008, 95, - 112, 113, 57, 3009, 3010, 116, 117, 3011, - 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018, - 3019, 3020, 3021, 3022, 1, 4, 15, 160, - 161, 41, 6, 11, 42, 162, 43, 119, - 56, 57, 58, 163, 236, 237, 3023, 119, - 120, 242, 122, 486, 1512, 487, 246, 494, - 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519, - 31 /* 73 elements */ - }, - { - 0, 512, 513, 514, 515, 2, 3, 258, - 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 1, 5, 287, 288, - 289, 290, 6, 7, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, - 319 /* 73 elements */ - }, - { - 0, 1, 1, 2, 3, 4, 1, 5, - 4, 3, 5, 8, 6, 9, 10, 11, - 12, 7, 104, 14, 105, 4, 10, 15, - 11, 6, 14, 8, 106, 107, 108, 15, - 109, 9, 55, 10, 1, 2, 1, 2, - 3, 12, 6, 2, 6, 7, 28, 7, - 15, 8, 5, 18, 29, 152, 77, 24, - 25, 26, 39, 108, 13, 109, 55, 56, - 57, 116, 11, 153, 234, 235, 118, 119, - 15 /* 73 elements */ - } -}; -const uint8_t ff_vc1_mv_diff_bits[4][73] = { - { - 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9, - 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14, - 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9, - 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7, - 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */ - }, - { - 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9, - 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9, - 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9, - 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */ - - }, - { - 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */ - }, - { - 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12, - 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11, - 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8, - 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6, - 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */ - } -}; /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ @@ -1129,7 +289,3 @@ { 26, 17, 12, 10 }, // ZONE1OFFSET_X { 7, 4, 3, 3 } // ZONE1OFFSET_Y }; - -const int ff_vc1_ac_sizes[AC_MODES] = { - 186, 169, 133, 149, 103, 103, 163, 175 -}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1data.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,10 +30,12 @@ #include +#include "libavutil/attributes_internal.h" #include "libavutil/rational.h" #include "vlc.h" +FF_VISIBILITY_PUSH_HIDDEN /** Table for conversion between TTBLK and TTMB */ extern const int ff_vc1_ttblk_to_tt[3][8]; @@ -53,8 +55,6 @@ * @todo TODO move this into the context */ //@{ -#define VC1_BFRACTION_VLC_BITS 7 -extern VLC ff_vc1_bfraction_vlc; #define VC1_IMODE_VLC_BITS 4 extern VLC ff_vc1_imode_vlc; #define VC1_NORM2_VLC_BITS 3 @@ -93,93 +93,20 @@ extern VLC ff_vc1_ac_coeff_table[8]; -#define VC1_IF_MBMODE_VLC_BITS 5 +#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS + // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same //@} #define B_FRACTION_DEN 256 /* pre-computed scales for all bfractions and base=256 */ extern const int16_t ff_vc1_bfraction_lut[23]; -extern const uint8_t ff_vc1_bfraction_bits[23]; -extern const uint8_t ff_vc1_bfraction_codes[23]; //Same as H.264 extern const AVRational ff_vc1_pixel_aspect[16]; -/* BitPlane IMODE - such a small table... */ -extern const uint8_t ff_vc1_imode_codes[7]; -extern const uint8_t ff_vc1_imode_bits[7]; - -/* Normal-2 imode */ -extern const uint8_t ff_vc1_norm2_codes[4]; -extern const uint8_t ff_vc1_norm2_bits[4]; -extern const uint16_t ff_vc1_norm6_codes[64]; -extern const uint8_t ff_vc1_norm6_bits[64]; -/* Normal-6 imode */ -extern const uint8_t ff_vc1_norm6_spec[64][5]; - -/* 4MV Block pattern VLC tables */ -extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16]; -extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16]; - -/* 2MV Block pattern VLC tables */ -extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4]; -extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4]; - extern const uint8_t ff_wmv3_dc_scale_table[32]; -/* P-Picture CBPCY VLC tables */ -extern const uint16_t ff_vc1_cbpcy_p_codes[4][64]; -extern const uint8_t ff_vc1_cbpcy_p_bits[4][64]; - -/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ -extern const uint16_t ff_vc1_icbpcy_p_codes[8][63]; -extern const uint8_t ff_vc1_icbpcy_p_bits[8][63]; - -/* MacroBlock Transform Type: 7.1.3.11, p89 - * 8x8:B - * 8x4:B:btm 8x4:B:top 8x4:B:both, - * 4x8:B:right 4x8:B:left 4x8:B:both - * 4x4:B 8x8:MB - * 8x4:MB:btm 8x4:MB:top 8x4,MB,both - * 4x8,MB,right 4x8,MB,left - * 4x4,MB */ -extern const uint16_t ff_vc1_ttmb_codes[3][16]; - -extern const uint8_t ff_vc1_ttmb_bits[3][16]; - -/* TTBLK (Transform Type per Block) tables */ -extern const uint8_t ff_vc1_ttblk_codes[3][8]; -extern const uint8_t ff_vc1_ttblk_bits[3][8]; - -/* SUBBLKPAT tables, p93-94, reordered */ -extern const uint8_t ff_vc1_subblkpat_codes[3][15]; -extern const uint8_t ff_vc1_subblkpat_bits[3][15]; - -/* MV differential tables, p265 */ -extern const uint16_t ff_vc1_mv_diff_codes[4][73]; -extern const uint8_t ff_vc1_mv_diff_bits[4][73]; - -/* Interlaced frame picture MBMODE VLC tables (p. 246, p. 360) */ -extern const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15]; -extern const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15]; -extern const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9]; -extern const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9]; - -/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ -extern const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8]; -extern const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8]; -extern const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6]; -extern const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6]; - -/* Interlaced frame/field picture MVDATA VLC tables */ -/* 1-reference tables */ -extern const uint32_t ff_vc1_1ref_mvdata_codes[4][72]; -extern const uint8_t ff_vc1_1ref_mvdata_bits[4][72]; -/* 2-reference tables */ -extern const uint32_t ff_vc1_2ref_mvdata_codes[8][126]; -extern const uint8_t ff_vc1_2ref_mvdata_bits[8][126]; - /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ /* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */ @@ -190,8 +117,6 @@ extern const uint8_t ff_vc1_adv_interlaced_8x4_zz [32]; extern const uint8_t ff_vc1_adv_interlaced_4x8_zz [32]; extern const uint8_t ff_vc1_adv_interlaced_4x4_zz [16]; -extern const uint8_t ff_vc1_intra_horz_8x8_zz [64]; -extern const uint8_t ff_vc1_intra_vert_8x8_zz [64]; /* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */ extern const int32_t ff_vc1_dqscale[63]; @@ -204,5 +129,6 @@ #define AC_MODES 8 extern const int ff_vc1_ac_sizes[AC_MODES]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_VC1DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,18 +31,23 @@ #include "avcodec.h" #include "blockdsp.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" +#include "h263dec.h" #include "hwconfig.h" -#include "internal.h" #include "mpeg_er.h" #include "mpegvideo.h" #include "mpegvideodec.h" -#include "msmpeg4data.h" -#include "msmpeg4dec.h" +#include "msmpeg4_vc1_data.h" #include "profiles.h" +#include "simple_idct.h" #include "vc1.h" #include "vc1data.h" +#include "vc1_vlc_data.h" +#include "libavutil/attributes.h" #include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/thread.h" #if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER @@ -325,10 +330,10 @@ #endif -av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) +static av_cold int vc1_decode_init_alloc_tables(VC1Context *v) { MpegEncContext *s = &v->s; - int i, ret = AVERROR(ENOMEM); + int i, ret; int mb_height = FFALIGN(s->mb_height, 2); /* Allocate mb bitplanes */ @@ -340,31 +345,31 @@ v->over_flags_plane = av_malloc (s->mb_stride * mb_height); if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->forward_mb_plane || !v->fieldtx_plane || !v->acpred_plane || !v->over_flags_plane) - goto error; + return AVERROR(ENOMEM); v->n_allocated_blks = s->mb_width + 2; v->block = av_malloc(sizeof(*v->block) * v->n_allocated_blks); v->cbp_base = av_malloc(sizeof(v->cbp_base[0]) * 3 * s->mb_stride); if (!v->block || !v->cbp_base) - goto error; + return AVERROR(ENOMEM); v->cbp = v->cbp_base + 2 * s->mb_stride; v->ttblk_base = av_malloc(sizeof(v->ttblk_base[0]) * 3 * s->mb_stride); if (!v->ttblk_base) - goto error; + return AVERROR(ENOMEM); v->ttblk = v->ttblk_base + 2 * s->mb_stride; v->is_intra_base = av_mallocz(sizeof(v->is_intra_base[0]) * 3 * s->mb_stride); if (!v->is_intra_base) - goto error; + return AVERROR(ENOMEM); v->is_intra = v->is_intra_base + 2 * s->mb_stride; v->luma_mv_base = av_mallocz(sizeof(v->luma_mv_base[0]) * 3 * s->mb_stride); if (!v->luma_mv_base) - goto error; + return AVERROR(ENOMEM); v->luma_mv = v->luma_mv_base + 2 * s->mb_stride; /* allocate block type info in that way so it could be used with s->block_index[] */ v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); if (!v->mb_type_base) - goto error; + return AVERROR(ENOMEM); v->mb_type[0] = v->mb_type_base + s->b8_stride + 1; v->mb_type[1] = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1; v->mb_type[2] = v->mb_type[1] + s->mb_stride * (mb_height + 1); @@ -372,36 +377,81 @@ /* allocate memory to store block level MV info */ v->blk_mv_type_base = av_mallocz( s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); if (!v->blk_mv_type_base) - goto error; + return AVERROR(ENOMEM); v->blk_mv_type = v->blk_mv_type_base + s->b8_stride + 1; v->mv_f_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); if (!v->mv_f_base) - goto error; + return AVERROR(ENOMEM); v->mv_f[0] = v->mv_f_base + s->b8_stride + 1; v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); if (!v->mv_f_next_base) - goto error; + return AVERROR(ENOMEM); v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { for (i = 0; i < 4; i++) if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width))) - goto error; + return AVERROR(ENOMEM); } - ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp, + ret = ff_intrax8_common_init(s->avctx, &v->x8, s->block, s->block_last_index, s->mb_width, s->mb_height); if (ret < 0) - goto error; + return ret; return 0; +} -error: - ff_vc1_decode_end(s->avctx); - return ret; +static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx) +{ + if (avctx->codec_id == AV_CODEC_ID_MSS2) + return AV_PIX_FMT_YUV420P; + + if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) { + if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED) + avctx->color_range = AVCOL_RANGE_MPEG; + return AV_PIX_FMT_GRAY8; + } + + return ff_get_format(avctx, avctx->codec->pix_fmts); +} + +av_cold int ff_vc1_decode_init(AVCodecContext *avctx) +{ + VC1Context *const v = avctx->priv_data; + MpegEncContext *const s = &v->s; + int ret; + + ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); + if (ret < 0) + return ret; + + ff_mpv_decode_init(s, avctx); + ff_mpv_idct_init(s); + + avctx->pix_fmt = vc1_get_format(avctx); + + ret = ff_mpv_common_init(s); + if (ret < 0) + return ret; + + s->y_dc_scale_table = ff_wmv3_dc_scale_table; + s->c_dc_scale_table = ff_wmv3_dc_scale_table; + + ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, + ff_wmv1_scantable[0]); + ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, + ff_wmv1_scantable[1]); + + ret = vc1_decode_init_alloc_tables(v); + if (ret < 0) { + ff_vc1_decode_end(avctx); + return ret; + } + return 0; } av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) @@ -419,6 +469,155 @@ v->top_blk_sh = 3; } +static const uint16_t vlc_offs[] = { + 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436, + 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342, + 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522, + 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980, + 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866, + 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186, + 31714, 31746, 31778, 32306, 32340, 32372 +}; + +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, + 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, + vc1_norm6_bits, 1, 1, + vc1_norm6_codes, 2, 2, 556); + INIT_VLC_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, + vc1_ttmb_bits[i], 1, 1, + vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_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, + vc1_ttblk_bits[i], 1, 1, + vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_subblkpat_bits[i], 1, 1, + vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_4mv_block_pattern_bits[i], 1, 1, + vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_cbpcy_p_bits[i], 1, 1, + vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_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, + vc1_mv_diff_bits[i], 1, 1, + vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_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], + &vc1_ac_tables[i][0][1], 8, 4, + &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_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, + vc1_2ref_mvdata_bits[i], 1, 1, + vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_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, + vc1_intfr_4mv_mbmode_bits[i], 1, 1, + vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_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, + vc1_intfr_non4mv_mbmode_bits[i], 1, 1, + vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_1ref_mvdata_bits[i], 1, 1, + vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_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, + vc1_2mv_block_pattern_bits[i], 1, 1, + vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_icbpcy_p_bits[i], 1, 1, + vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_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, + vc1_if_mmv_mbmode_bits[i], 1, 1, + vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_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, + vc1_if_1mv_mbmode_bits[i], 1, 1, + vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + } + ff_msmp4_vc1_vlcs_init_once(); +} + +/** + * Init VC-1 specific tables and VC1Context members + * @param v The VC1Context to initialize + * @return Status + */ +av_cold void ff_vc1_init_common(VC1Context *v) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + MpegEncContext *const s = &v->s; + + /* defaults */ + v->pq = -1; + v->mvrange = 0; /* 7.1.1.18, p80 */ + + s->avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; + s->out_format = FMT_H263; + + s->h263_pred = 1; + s->msmpeg4_version = 6; + + ff_vc1dsp_init(&v->vc1dsp); + + /* For error resilience */ + ff_qpeldsp_init(&s->qdsp); + + /* VLC tables */ + ff_thread_once(&init_static_once, vc1_init_static); +} + /** Initialize a VC1/WMV3 decoder * @todo TODO: Handle VC-1 IDUs (Transport level?) * @todo TODO: Decipher remaining bits in extra_data @@ -530,19 +729,8 @@ avctx->color_range = AVCOL_RANGE_MPEG; } - // ensure static VLC tables are initialized - if ((ret = ff_msmpeg4_decode_init(avctx)) < 0) - return ret; - if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0) - return ret; - // Hack to ensure the above functions will be called - // again once we know all necessary settings. - // That this is necessary might indicate a bug. - ff_vc1_decode_end(avctx); - - ff_blockdsp_init(&s->bdsp, avctx); + ff_blockdsp_init(&s->bdsp); ff_h264chroma_init(&v->h264chroma, 8); - ff_qpeldsp_init(&s->qdsp); avctx->has_b_frames = !!avctx->max_b_frames; @@ -562,6 +750,14 @@ memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64); v->left_blk_sh = 3; v->top_blk_sh = 0; + v->vc1dsp.vc1_inv_trans_8x8 = ff_simple_idct_int16_8bit; + v->vc1dsp.vc1_inv_trans_8x4 = ff_simple_idct84_add; + v->vc1dsp.vc1_inv_trans_4x8 = ff_simple_idct48_add; + v->vc1dsp.vc1_inv_trans_4x4 = ff_simple_idct44_add; + v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit; + v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add; + v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add; + v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add; } if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { @@ -806,12 +1002,9 @@ } if (!s->context_initialized) { - if ((ret = ff_msmpeg4_decode_init(avctx)) < 0) - goto err; - if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0) { - ff_mpv_common_end(s); + ret = ff_vc1_decode_init(avctx); + if (ret < 0) goto err; - } s->low_delay = !avctx->has_b_frames || v->res_sprite; @@ -895,9 +1088,6 @@ s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2; } - s->me.qpel_put = s->qdsp.put_qpel_pixels_tab; - s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; - if (avctx->hwaccel) { s->mb_y = 0; if (v->field_mode && buf_start_second_field) { @@ -1203,7 +1393,7 @@ const FFCodec ff_vc1_decoder = { .p.name = "vc1", - .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), + CODEC_LONG_NAME("SMPTE VC-1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VC1, .priv_data_size = sizeof(VC1Context), @@ -1212,7 +1402,6 @@ FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VC1_DXVA2_HWACCEL @@ -1241,7 +1430,7 @@ #if CONFIG_WMV3_DECODER const FFCodec ff_wmv3_decoder = { .p.name = "wmv3", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), + CODEC_LONG_NAME("Windows Media Video 9"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV3, .priv_data_size = sizeof(VC1Context), @@ -1250,7 +1439,6 @@ FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_WMV3_DXVA2_HWACCEL @@ -1280,7 +1468,7 @@ #if CONFIG_WMV3IMAGE_DECODER const FFCodec ff_wmv3image_decoder = { .p.name = "wmv3image", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"), + CODEC_LONG_NAME("Windows Media Video 9 Image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV3IMAGE, .priv_data_size = sizeof(VC1Context), @@ -1288,7 +1476,6 @@ .close = ff_vc1_decode_end, FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -1300,7 +1487,7 @@ #if CONFIG_VC1IMAGE_DECODER const FFCodec ff_vc1image_decoder = { .p.name = "vc1image", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"), + CODEC_LONG_NAME("Windows Media Video 9 Image v2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VC1IMAGE, .priv_data_size = sizeof(VC1Context), @@ -1308,7 +1495,6 @@ .close = ff_vc1_decode_end, FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -787,7 +787,7 @@ ((A * src[a] + B * src[a + 1] + \ C * src[stride + a] + D * src[stride + a + 1] + 32 - 4) >> 6) static void put_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { const int A = (8 - x) * (8 - y); @@ -812,7 +812,7 @@ } } -static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, uint8_t *src, +static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y) { const int A = (8 - x) * (8 - y); @@ -835,7 +835,7 @@ #define avg2(a, b) (((a) + (b) + 1) >> 1) static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { const int A = (8 - x) * (8 - y); @@ -861,7 +861,7 @@ } static void avg_no_rnd_vc1_chroma_mc4_c(uint8_t *dst /* align 8 */, - uint8_t *src /* align 1 */, + const uint8_t *src /* align 1 */, ptrdiff_t stride, int h, int x, int y) { const int A = (8 - x) * (8 - y); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1.h 2023-03-03 13:29:59.000000000 +0000 @@ -413,7 +413,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb); void ff_vc1_init_common(VC1Context *v); -int ff_vc1_decode_init_alloc_tables(VC1Context *v); +int ff_vc1_decode_init(AVCodecContext *avctx); void ff_vc1_init_transposed_scantables(VC1Context *v); int ff_vc1_decode_end(AVCodecContext *avctx); void ff_vc1_decode_blocks(VC1Context *v); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_parser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "parser.h" #include "vc1.h" #include "get_bits.h" +#include "vc1dsp.h" /** The maximum number of bytes of a sequence, entry point or * frame header whose values we pay any attention to */ @@ -65,7 +66,6 @@ GetBitContext gb; int ret; vpc->v.s.avctx = avctx; - vpc->v.parse_only = 1; init_get_bits8(&gb, buf, buf_size); switch (vpc->prev_start_code) { case VC1_CODE_SEQHDR & 0xFF: @@ -112,8 +112,6 @@ break; } - if (avctx->framerate.num) - avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); s->format = vpc->v.chromaformat == 1 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_NONE; if (avctx->width && avctx->height) { @@ -260,11 +258,12 @@ VC1ParseContext *vpc = s->priv_data; vpc->v.s.slice_context_count = 1; vpc->v.first_pic_header_flag = 1; + vpc->v.parse_only = 1; vpc->prev_start_code = 0; vpc->bytes_to_skip = 0; vpc->unesc_index = 0; vpc->search_state = NO_MATCH; - ff_vc1_init_common(&vpc->v); + ff_vc1dsp_init(&vpc->v.vc1dsp); /* startcode_find_candidate */ return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_vlc_data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_vlc_data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_vlc_data.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc1_vlc_data.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1063 @@ +/* + * VC-1 and WMV3 decoder VLC table data + * copyright (c) 2011 Mashiat Sarker Shakkhar + * copyright (c) 2006 Konstantin Shishkov + * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * VC-1 tables. + */ + +#ifndef AVCODEC_VC1_VLC_DATA_H +#define AVCODEC_VC1_VLC_DATA_H + +#include + +#include "vc1data.h" + +/* BitPlane IMODE - such a small table... */ +static const uint8_t vc1_imode_codes[7] = { + 0, 2, 1, 3, 1, 2, 3 +}; +static const uint8_t vc1_imode_bits[7] = { + 4, 2, 3, 2, 4, 3, 3 +}; + +/* Normal-2 imode */ +static const uint8_t vc1_norm2_codes[4] = { + 0, 4, 5, 3 +}; +static const uint8_t vc1_norm2_bits[4] = { + 1, 3, 3, 2 +}; + +static const uint16_t vc1_norm6_codes[64] = { + 0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E, + 0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037, + 0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036, + 0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007, +}; + +static const uint8_t vc1_norm6_bits[64] = { + 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13, + 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, + 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9, + 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6, +}; + +/* 4MV Block pattern VLC tables */ +static const uint8_t vc1_4mv_block_pattern_codes[4][16] = { + { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2 }, + { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0 }, + { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0 }, + { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 10 } +}; +static const uint8_t vc1_4mv_block_pattern_bits[4][16] = { + { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 }, + { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 }, + { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 }, + { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 } +}; + +/* 2MV Block pattern VLC tables */ +static const uint8_t vc1_2mv_block_pattern_codes[4][4] = { + { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 } +}; + +static const uint8_t vc1_2mv_block_pattern_bits[4][4] = { + { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 } +}; + +/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */ +static const uint16_t vc1_intfr_4mv_mbmode_codes[4][15] = { + { 22, 17, 0, 47, 32, 10, 1, 3, 67, 133, 132, 92, 19, 93, 18 }, + { 3, 45, 0, 7, 23, 6, 1, 2, 10, 39, 44, 8, 18, 77, 76 }, + { 15, 6, 28, 9, 41, 6, 2, 15, 14, 8, 40, 29, 0, 21, 11 }, + { 7, 198, 1, 2, 193, 13, 25, 0, 97, 1599, 98, 398, 798, 192, 1598 } +}; + +static const uint8_t vc1_intfr_4mv_mbmode_bits[4][15] = { + { 5, 5, 2, 6, 6, 4, 2, 2, 7, 8, 8, 7, 5, 7, 5 }, + { 3, 6, 3, 3, 5, 3, 3, 3, 4, 6, 6, 4, 5, 7, 7 }, + { 4, 3, 5, 5, 7, 4, 2, 5, 5, 5, 7, 5, 2, 6, 5 }, + { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 } +}; + +/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */ +static const uint8_t vc1_intfr_non4mv_mbmode_codes[4][9] = { + { 9, 22, 0, 17, 16, 10, 1, 3, 23 }, + { 7, 0, 5, 2, 1, 1, 6, 3, 4 }, + { 1, 0, 10, 23, 44, 8, 3, 9, 45 }, + { 7, 97, 1, 2, 49, 13, 25, 0, 96 } +}; + +static const uint8_t vc1_intfr_non4mv_mbmode_bits[4][9] = { + { 4, 5, 2, 5, 5, 4, 2, 2, 5 }, + { 3, 4, 6, 2, 3, 2, 3, 5, 6 }, + { 2, 2, 4, 5, 6, 4, 2, 4, 6 }, + { 4, 8, 1, 3, 7, 5, 6, 2, 8 } +}; + +/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ +/* mixed-MV */ +static const uint8_t vc1_if_mmv_mbmode_codes[8][8] = { + { 16, 17, 3, 3, 0, 5, 9, 2 }, + { 8, 9, 3, 6, 7, 0, 5, 2 }, + { 16, 17, 5, 3, 0, 3, 9, 2 }, + { 56, 57, 15, 4, 5, 6, 29, 0 }, + { 52, 53, 27, 14, 15, 2, 12, 0 }, + { 56, 57, 29, 5, 6, 0, 15, 4 }, + { 16, 17, 6, 7, 0, 1, 9, 5 }, + { 56, 57, 0, 5, 6, 29, 4, 15 } +}; +static const uint8_t vc1_if_mmv_mbmode_bits[8][8] = { + { 6, 6, 2, 3, 2, 4, 5, 2 }, + { 5, 5, 3, 3, 3, 2, 4, 2 }, + { 6, 6, 4, 3, 2, 2, 5, 2 }, + { 6, 6, 4, 3, 3, 3, 5, 1 }, + { 6, 6, 5, 4, 4, 2, 4, 1 }, + { 6, 6, 5, 3, 3, 1, 4, 3 }, + { 5, 5, 3, 3, 2, 2, 4, 3 }, + { 6, 6, 1, 3, 3, 5, 3, 4 } +}; + +/* 1MV */ +static const uint8_t vc1_if_1mv_mbmode_codes[8][6] = { + { 0, 1, 1, 1, 1, 1 }, + { 0, 1, 1, 1, 1, 1 }, + { 16, 17, 3, 0, 9, 5 }, + { 20, 21, 3, 11, 0, 4 }, + { 4, 5, 2, 3, 3, 0 }, + { 4, 5, 3, 2, 0, 3 }, + { 0, 1, 1, 1, 1, 1 }, + { 16, 17, 9, 5, 3, 0 } +}; +static const uint8_t vc1_if_1mv_mbmode_bits[8][6] = { + { 5, 5, 1, 3, 2, 4 }, + { 5, 5, 1, 2, 3, 4 }, + { 5, 5, 2, 1, 4, 3 }, + { 5, 5, 2, 4, 1, 3 }, + { 4, 4, 2, 3, 2, 2 }, + { 4, 4, 3, 2, 2, 2 }, + { 5, 5, 3, 4, 1, 2 }, + { 5, 5, 4, 3, 2, 1 } +}; + +/* Interlaced frame/field picture MVDATA VLC tables */ + +/* 1-reference tables */ +static const uint32_t vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */ + { + 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070, + 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE, + 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D, + 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035, + 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9, + 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C, + 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727, + 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE, + 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266 + }, + { + 0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6, + 0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066, + 0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B, + 0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC, + 0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014, + 0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E, + 0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479, + 0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E, + 0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86 + }, + { + 0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0, + 0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD, + 0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5, + 0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042, + 0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5, + 0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190, + 0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9, + 0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE, + 0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266 + }, + { + 0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D, + 0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3, + 0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093, + 0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029, + 0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008, + 0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092, + 0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9, + 0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E, + 0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26 + } +}; + +static const uint8_t vc1_1ref_mvdata_bits[4][72] = { + { + 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4, + 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6, + 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9, + 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16 + }, + { + 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4, + 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5, + 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8, + 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19 + }, + { + 3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4, + 7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7, + 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9, + 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18 + }, + { + 4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4, + 6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5, + 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7, + 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13 + } +}; + +/* 2-reference tables */ +static const uint32_t vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */ + { + 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368, + 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC, + 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7, + 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE, + 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052, + 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018, + 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D, + 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5, + 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004, + 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85, + 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D, + 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2, + 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454, + 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0, + 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0, + 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38 + }, + { + 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555, + 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3, + 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B, + 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376, + 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3, + 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF, + 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF, + 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5, + 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B, + 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1, + 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570, + 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554, + 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674, + 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4, + 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40, + 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553 + }, + { + 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E, + 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D, + 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3, + 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD, + 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A, + 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D, + 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032, + 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA, + 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036, + 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350, + 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A, + 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356, + 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351, + 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2, + 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0, + 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9 + }, + { + 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190, + 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F, + 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E, + 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA, + 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174, + 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0, + 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC, + 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C, + 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033, + 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F, + 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F, + 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B, + 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E, + 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A, + 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D, + 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137 + }, + { + 0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2, + 0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED, + 0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED, + 0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039, + 0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070, + 0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A, + 0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7, + 0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F, + 0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085, + 0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434, + 0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2, + 0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC, + 0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2, + 0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD, + 0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F, + 0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386 + }, + { + 0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6, + 0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C, + 0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163, + 0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A, + 0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2, + 0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2, + 0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9, + 0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F, + 0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022, + 0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C, + 0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C, + 0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7, + 0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A, + 0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56, + 0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4, + 0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7 + }, + { + 0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163, + 0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC, + 0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C, + 0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED, + 0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF, + 0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014, + 0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152, + 0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0, + 0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB, + 0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516, + 0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585, + 0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519, + 0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B, + 0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80, + 0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84, + 0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9 + }, + { + 0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E, + 0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707, + 0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37, + 0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661, + 0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199, + 0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033, + 0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E, + 0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012, + 0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338, + 0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB, + 0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C, + 0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D, + 0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4, + 0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C, + 0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076, + 0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB + } +}; + +static const uint8_t vc1_2ref_mvdata_bits[8][126] = { + { + 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9, + 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9, + 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7, + 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9, + 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14, + 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12, + 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13, + 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13 + }, + { + 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11, + 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10, + 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8, + 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9, + 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13, + 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11, + 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13, + 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11 + }, + { + 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9, + 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9, + 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8, + 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10, + 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11, + 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11, + 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11, + 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10 + }, + { + 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11, + 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11, + 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8, + 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11, + 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15, + 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13, + 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13, + 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14 + }, + { + 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9, + 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7, + 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7, + 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9, + 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11, + 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11, + 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13, + 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11 + }, + { + 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8, + 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8, + 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8, + 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8, + 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13, + 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12, + 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13, + 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12 + }, + { + 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12, + 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12, + 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8, + 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11, + 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21, + 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21, + 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20, + 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16 + }, + { + 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13, + 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12, + 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8, + 10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9, + 9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20, + 11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13, + 20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13, + 15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16 + } +}; + +/* P-Picture CBPCY VLC tables */ +// Looks like original tables are not conforming to standard at all. Are they used for old WMV? +static const uint16_t vc1_cbpcy_p_codes[4][64] = { + { + 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119, + 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63, + 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62, + 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3 + }, + { + 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30, + 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247, + 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31, + 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125 + }, + { + 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492, + 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247, + 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493, + 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31 + }, + { + 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28, + 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30, + 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29, + 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31 + } +}; + +static const uint8_t vc1_cbpcy_p_bits[4][64] = { + { + 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8, + 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7, + 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7, + 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2 + }, + { + 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13, + 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8, + 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13, + 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7 + }, + { + 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9, + 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8, + 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9, + 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5 + }, + { + 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8, + 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, + 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8 + } +}; + +/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ +static const uint16_t vc1_icbpcy_p_codes[8][63] = { + { + 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091, + 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092, + 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134, + 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093, + 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E, + 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051, + 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054, + 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001 + }, + { + 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045, + 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047, + 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B, + 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009, + 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026, + 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014, + 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F, + 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003 + }, + { + 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027, + 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028, + 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5, + 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029, + 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020, + 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F, + 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024, + 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000 + }, + { + 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001, + 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002, + 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010, + 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003, + 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009, + 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006, + 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012, + 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E + }, + { + 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B, + 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C, + 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B, + 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D, + 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013, + 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008, + 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F, + 0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004 + }, + { + 0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B, + 0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C, + 0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018, + 0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D, + 0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009, + 0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005, + 0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011, + 0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002 + }, + { + 0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001, + 0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002, + 0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021, + 0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003, + 0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016, + 0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A, + 0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B, + 0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0 + }, + { + 0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005, + 0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006, + 0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009, + 0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007, + 0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A, + 0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004, + 0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000, + 0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013 + } +}; + +static const uint8_t vc1_icbpcy_p_bits[8][63] = { + { + 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9, + 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9, + 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8, + 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1 + }, + { + 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7, + 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, + 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6, + 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2 + }, + { + 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6, + 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6, + 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5, + 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2 + }, + { + 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4, + 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, + 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4, + 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4 + }, + { + 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5, + 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5, + 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5, + 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3 + }, + { + 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4, + 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4, + 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4, + 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4 + }, + { + 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3, + 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3, + 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4, + 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9 + }, + { + 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3, + 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3, + 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4, + 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9 + } +}; + +/* MacroBlock Transform Type: 7.1.3.11, p89 + * 8x8:B + * 8x4:B:btm 8x4:B:top 8x4:B:both, + * 4x8:B:right 4x8:B:left 4x8:B:both + * 4x4:B 8x8:MB + * 8x4:MB:btm 8x4:MB:top 8x4,MB,both + * 4x8,MB,right 4x8,MB,left + * 4x4,MB */ +static const uint16_t vc1_ttmb_codes[3][16] = { + { + 0x0003, + 0x002E, 0x005F, 0x0000, + 0x0016, 0x0015, 0x0001, + 0x0004, 0x0014, + 0x02F1, 0x0179, 0x017B, + 0x0BC0, 0x0BC1, 0x05E1, + 0x017A + }, + { + 0x0006, + 0x0006, 0x0003, 0x0007, + 0x000F, 0x000E, 0x0000, + 0x0002, 0x0002, + 0x0014, 0x0011, 0x000B, + 0x0009, 0x0021, 0x0015, + 0x0020 + }, + { + 0x0006, + 0x0000, 0x000E, 0x0005, + 0x0002, 0x0003, 0x0003, + 0x000F, 0x0002, + 0x0081, 0x0021, 0x0009, + 0x0101, 0x0041, 0x0011, + 0x0100 + } +}; + +static const uint8_t vc1_ttmb_bits[3][16] = { + { + 2, + 6, 7, 2, + 5, 5, 2, + 3, 5, + 10, 9, 9, + 12, 12, 11, + 9 + }, + { + 3, + 4, 4, 4, + 4, 4, 3, + 3, 2, + 7, 7, 6, + 6, 8, 7, + 8 + }, + { + 3, + 3, 4, 5, + 3, 3, 4, + 4, 2, + 10, 8, 6, + 11, 9, 7, + 11 + } +}; + +/* TTBLK (Transform Type per Block) tables */ +static const uint8_t vc1_ttblk_codes[3][8] = { + { 0, 1, 3, 5, 16, 17, 18, 19 }, + { 3, 0, 1, 2, 3, 5, 8, 9 }, + { 1, 0, 1, 4, 6, 7, 10, 11 } +}; +static const uint8_t vc1_ttblk_bits[3][8] = { + { 2, 2, 2, 3, 5, 5, 5, 5 }, + { 2, 3, 3, 3, 3, 3, 4, 4 }, + { 2, 3, 3, 3, 3, 3, 4, 4 } +}; + +/* SUBBLKPAT tables, p93-94, reordered */ +static const uint8_t vc1_subblkpat_codes[3][15] = { + { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1 }, + { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1 }, + { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15 } +}; +static const uint8_t vc1_subblkpat_bits[3][15] = { + { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1}, + { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2}, + { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4} +}; + +/* MV differential tables, p265 */ +static const uint16_t vc1_mv_diff_codes[4][73] = { + { + 0, 2, 3, 8, 576, 3, 2, 6, + 5, 577, 578, 7, 8, 9, 40, 19, + 37, 82, 21, 22, 23, 579, 580, 166, + 96, 167, 49, 194, 195, 581, 582, 583, + 292, 293, 294, 13, 2, 7, 24, 50, + 102, 295, 13, 7, 8, 18, 50, 103, + 38, 20, 21, 22, 39, 204, 103, 23, + 24, 25, 104, 410, 105, 106, 107, 108, + 109, 220, 411, 442, 222, 443, 446, 447, + 7 /* 73 elements */ + }, + { + 0, 4, 5, 3, 4, 3, 4, 5, + 20, 6, 21, 44, 45, 46, 3008, 95, + 112, 113, 57, 3009, 3010, 116, 117, 3011, + 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018, + 3019, 3020, 3021, 3022, 1, 4, 15, 160, + 161, 41, 6, 11, 42, 162, 43, 119, + 56, 57, 58, 163, 236, 237, 3023, 119, + 120, 242, 122, 486, 1512, 487, 246, 494, + 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519, + 31 /* 73 elements */ + }, + { + 0, 512, 513, 514, 515, 2, 3, 258, + 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 1, 5, 287, 288, + 289, 290, 6, 7, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 317, 318, + 319 /* 73 elements */ + }, + { + 0, 1, 1, 2, 3, 4, 1, 5, + 4, 3, 5, 8, 6, 9, 10, 11, + 12, 7, 104, 14, 105, 4, 10, 15, + 11, 6, 14, 8, 106, 107, 108, 15, + 109, 9, 55, 10, 1, 2, 1, 2, + 3, 12, 6, 2, 6, 7, 28, 7, + 15, 8, 5, 18, 29, 152, 77, 24, + 25, 26, 39, 108, 13, 109, 55, 56, + 57, 116, 11, 153, 234, 235, 118, 119, + 15 /* 73 elements */ + } +}; +static const uint8_t vc1_mv_diff_bits[4][73] = { + { + 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9, + 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14, + 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9, + 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7, + 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */ + }, + { + 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9, + 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9, + 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9, + 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */ + + }, + { + 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */ + }, + { + 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12, + 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11, + 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8, + 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6, + 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */ + } +}; + +static const uint32_t vc1_ac_tables[AC_MODES][186][2] = { +{ +{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7}, +{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10}, +{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14}, +{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9}, +{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13}, +{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7}, +{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13}, +{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7}, +{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13}, +{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11}, +{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11}, +{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14}, +{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10}, +{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14}, +{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13}, +{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11}, +{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14}, +{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12}, +{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13}, +{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4}, +{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5}, +{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10}, +{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14}, +{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8}, +{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8}, +{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8}, +{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9}, +{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11}, +{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12}, +{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13}, +{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9} +}, +{ +{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7}, +{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11}, +{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13}, +{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4}, +{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11}, +{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7}, +{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15}, +{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14}, +{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14}, +{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7}, +{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13}, +{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11}, +{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13}, +{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10}, +{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12}, +{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14}, +{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8}, +{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15}, +{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4}, +{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12}, +{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10}, +{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12}, +{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13}, +{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12}, +{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10}, +{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11}, +{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14}, +{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14}, +{ 0x0169, 9} +}, +{ +{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7}, +{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10}, +{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5}, +{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11}, +{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8}, +{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5}, +{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13}, +{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6}, +{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11}, +{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10}, +{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10}, +{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11}, +{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12}, +{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11}, +{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5}, +{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12}, +{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7}, +{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8}, +{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8}, +{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9}, +{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12}, +{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13}, +{ 0x0016, 7} +}, +{ +{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10}, +{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14}, +{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11}, +{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5}, +{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9}, +{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14}, +{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11}, +{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11}, +{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12}, +{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12}, +{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9}, +{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11}, +{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12}, +{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10}, +{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15}, +{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15}, +{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12}, +{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13}, +{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12}, +{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15}, +{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10}, +{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9}, +{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13}, +{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14}, +{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9} +}, +{ +{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6}, +{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8}, +{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10}, +{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11}, +{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7}, +{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12}, +{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12}, +{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9}, +{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9}, +{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10}, +{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10}, +{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10}, +{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10}, +{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11}, +{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8}, +{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9}, +{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, +{ 0x0003, 7} +}, +{ +{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9}, +{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, +{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12}, +{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9}, +{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10}, +{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10}, +{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12}, +{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9}, +{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9}, +{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9}, +{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6}, +{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8}, +{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8}, +{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, +{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10}, +{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12}, +{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12}, +{ 0x0003, 7} +}, +{ +{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5}, +{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7}, +{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8}, +{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9}, +{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10}, +{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11}, +{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11}, +{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12}, +{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12}, +{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7}, +{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10}, +{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12}, +{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7}, +{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12}, +{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10}, +{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10}, +{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11}, +{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13}, +{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13}, +{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11}, +{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13}, +{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11}, +{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12}, +{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13}, +{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14}, +{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16}, +{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13}, +{ 0x007A, 7} +}, +{ +{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7}, +{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9}, +{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11}, +{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12}, +{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13}, +{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8}, +{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12}, +{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8}, +{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5}, +{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5}, +{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10}, +{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14}, +{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15}, +{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9}, +{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10}, +{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11}, +{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12}, +{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13}, +{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6}, +{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7}, +{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13}, +{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15}, +{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15}, +{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17}, +{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20}, +{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20}, +{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21}, +{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22}, +{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13}, +{ 0x0073, 7} +} +}; + +const int ff_vc1_ac_sizes[AC_MODES] = { + 186, 169, 133, 149, 103, 103, 163, 175 +}; + +#endif /* AVCODEC_VC1_VLC_DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -117,7 +117,7 @@ typedef struct TransformArgs { void *ctx; Plane *plane; - void *idata; + const void *idata; ptrdiff_t istride; int field; VC2TransformContext t; @@ -233,7 +233,7 @@ align_put_bits(&s->pb); - cur_pos = put_bits_count(&s->pb) >> 3; + cur_pos = put_bytes_count(&s->pb, 0); /* Magic string */ ff_put_string(&s->pb, "BBCD", 0); @@ -746,7 +746,7 @@ /* Luma + 2 Chroma planes */ for (p = 0; p < 3; p++) { int bytes_start, bytes_len, pad_s, pad_c; - bytes_start = put_bits_count(pb) >> 3; + bytes_start = put_bytes_count(pb, 0); put_bits(pb, 8, 0); for (level = 0; level < s->wavelet_depth; level++) { for (orientation = !!level; orientation < 4; orientation++) { @@ -755,10 +755,10 @@ quants[level][orientation]); } } - align_put_bits(pb); - bytes_len = (put_bits_count(pb) >> 3) - bytes_start - 1; + flush_put_bits(pb); + bytes_len = put_bytes_output(pb) - bytes_start - 1; if (p == 2) { - int len_diff = slice_bytes_max - (put_bits_count(pb) >> 3); + int len_diff = slice_bytes_max - put_bytes_output(pb); pad_s = FFALIGN((bytes_len + len_diff), s->size_scaler)/s->size_scaler; pad_c = (pad_s*s->size_scaler) - bytes_len; } else { @@ -766,7 +766,6 @@ pad_c = (pad_s*s->size_scaler) - bytes_len; } pb->buf[bytes_start] = pad_s; - flush_put_bits(pb); /* vc2-reference uses that padding that decodes to '0' coeffs */ memset(put_bits_ptr(pb), 0xFF, pad_c); skip_put_bytes(pb, pad_c); @@ -1226,11 +1225,12 @@ const FFCodec ff_vc2_encoder = { .p.name = "vc2", - .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-2"), + CODEC_LONG_NAME("SMPTE VC-2"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DIRAC, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(VC2EncContext), .init = vc2_encode_init, .close = vc2_encode_end, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc_dwt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc_dwt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc_dwt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vc2enc_dwt.c 2023-03-03 13:29:59.000000000 +0000 @@ -151,7 +151,7 @@ */ for (y = 0; y < synth_height; y++) { for (x = 0; x < synth_width; x++) - synthl[x] = datal[x] << 1; + synthl[x] = datal[x] * 2; synthl += synth_width; datal += stride; } @@ -223,9 +223,8 @@ /* Horizontal synthesis. */ for (y = 0; y < synth_height; y++) { for (x = 0; x < synth_width; x += 2) { - synthl[y*synth_width + x + 1] = (datal[y*stride + x + 1] << s) - - (datal[y*stride + x] << s); - synthl[y*synth_width + x] = (datal[y*stride + x + 0] << s) + + synthl[y*synth_width + x + 1] = (datal[y*stride + x + 1] - datal[y*stride + x]) * (1 << s); + synthl[y*synth_width + x] = datal[y*stride + x + 0] * (1 << s) + ((synthl[y*synth_width + x + 1] + 1) >> 1); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vcr1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vcr1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vcr1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vcr1.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "libavutil/avassert.h" #include "libavutil/internal.h" @@ -123,12 +123,11 @@ const FFCodec ff_vcr1_decoder = { .p.name = "vcr1", - .p.long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), + CODEC_LONG_NAME("ATI VCR1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VCR1, .priv_data_size = sizeof(VCR1Context), .init = vcr1_decode_init, FF_CODEC_DECODE_CB(vcr1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vdpau.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vdpau.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vdpau.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vdpau.h 2023-03-03 13:29:59.000000000 +0000 @@ -152,6 +152,6 @@ */ AVVDPAUContext *av_vdpau_alloc_context(void); -/* @}*/ +/** @} */ #endif /* AVCODEC_VDPAU_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 37 +#define LIBAVCODEC_VERSION_MINOR 3 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ * Libavcodec version macros. */ -#define LIBAVCODEC_VERSION_MAJOR 59 +#define LIBAVCODEC_VERSION_MAJOR 60 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -37,18 +37,16 @@ * at once through the bump. This improves the git bisect-ability of the change. */ -#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60) +#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) + +// reminder to remove CrystalHD decoders on next major bump +#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) #endif /* AVCODEC_VERSION_MAJOR_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #include "videodsp_template.c" #undef BIT_DEPTH -static void just_return(uint8_t *buf, ptrdiff_t stride, int h) +static void just_return(const uint8_t *buf, ptrdiff_t stride, int h) { } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -72,7 +72,7 @@ * @param stride distance between two lines of buf (in bytes) * @param h number of lines to prefetch */ - void (*prefetch)(uint8_t *buf, ptrdiff_t stride, int h); + void (*prefetch)(const uint8_t *buf, ptrdiff_t stride, int h); } VideoDSPContext; void ff_videodsp_init(VideoDSPContext *ctx, int bpc); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videodsp_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -64,7 +64,7 @@ av_assert2(start_x < end_x && block_w); w = end_x - start_x; - src += start_y * src_linesize + start_x * sizeof(pixel); + src += start_y * src_linesize + start_x * (ptrdiff_t)sizeof(pixel); buf += start_x * sizeof(pixel); // top @@ -87,7 +87,7 @@ buf += buf_linesize; } - buf -= block_h * buf_linesize + start_x * sizeof(pixel); + buf -= block_h * buf_linesize + start_x * (ptrdiff_t)sizeof(pixel); while (block_h--) { pixel *bufp = (pixel *) buf; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.c 2023-03-03 13:29:59.000000000 +0000 @@ -1173,6 +1173,22 @@ return AV_PIX_FMT_NV12; } +static AVVideotoolboxContext *videotoolbox_alloc_context_with_pix_fmt(enum AVPixelFormat pix_fmt, + bool full_range) +{ + AVVideotoolboxContext *ret = av_mallocz(sizeof(*ret)); + + if (ret) { + OSType cv_pix_fmt_type = av_map_videotoolbox_format_from_pixfmt2(pix_fmt, full_range); + if (cv_pix_fmt_type == 0) { + cv_pix_fmt_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; + } + ret->cv_pix_fmt_type = cv_pix_fmt_type; + } + + return ret; +} + int ff_videotoolbox_common_init(AVCodecContext *avctx) { VTContext *vtctx = avctx->internal->hwaccel_priv_data; @@ -1181,9 +1197,9 @@ vtctx->logctx = avctx; - // Old API - do nothing. - if (avctx->hwaccel_context) - return 0; + if (!avctx->hw_frames_ctx && !avctx->hw_device_ctx && + avctx->hwaccel_context) + return videotoolbox_start(avctx); if (!avctx->hw_frames_ctx && !avctx->hw_device_ctx) { av_log(avctx, AV_LOG_ERROR, @@ -1191,7 +1207,7 @@ return AVERROR(EINVAL); } - vtctx->vt_ctx = av_videotoolbox_alloc_context(); + vtctx->vt_ctx = videotoolbox_alloc_context_with_pix_fmt(AV_PIX_FMT_NONE, false); if (!vtctx->vt_ctx) { err = AVERROR(ENOMEM); goto fail; @@ -1371,27 +1387,12 @@ .priv_data_size = sizeof(VTContext), }; -static AVVideotoolboxContext *av_videotoolbox_alloc_context_with_pix_fmt(enum AVPixelFormat pix_fmt, - bool full_range) -{ - AVVideotoolboxContext *ret = av_mallocz(sizeof(*ret)); - - if (ret) { - ret->output_callback = videotoolbox_decoder_callback; - - OSType cv_pix_fmt_type = av_map_videotoolbox_format_from_pixfmt2(pix_fmt, full_range); - if (cv_pix_fmt_type == 0) { - cv_pix_fmt_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; - } - ret->cv_pix_fmt_type = cv_pix_fmt_type; - } - return ret; -} +#if FF_API_VT_HWACCEL_CONTEXT AVVideotoolboxContext *av_videotoolbox_alloc_context(void) { - return av_videotoolbox_alloc_context_with_pix_fmt(AV_PIX_FMT_NONE, false); + return videotoolbox_alloc_context_with_pix_fmt(AV_PIX_FMT_NONE, false); } int av_videotoolbox_default_init(AVCodecContext *avctx) @@ -1403,10 +1404,10 @@ { enum AVPixelFormat pix_fmt = videotoolbox_best_pixel_format(avctx); bool full_range = avctx->color_range == AVCOL_RANGE_JPEG; - avctx->hwaccel_context = vtctx ?: av_videotoolbox_alloc_context_with_pix_fmt(pix_fmt, full_range); + avctx->hwaccel_context = vtctx ?: videotoolbox_alloc_context_with_pix_fmt(pix_fmt, full_range); if (!avctx->hwaccel_context) return AVERROR(ENOMEM); - return videotoolbox_start(avctx); + return 0; } void av_videotoolbox_default_free(AVCodecContext *avctx) @@ -1415,4 +1416,6 @@ videotoolbox_stop(avctx); av_freep(&avctx->hwaccel_context); } +#endif /* FF_API_VT_HWACCEL_CONTEXT */ + #endif /* CONFIG_VIDEOTOOLBOX */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolboxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolboxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolboxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolboxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -101,6 +101,7 @@ CFStringRef kVTCompressionPropertyKey_RealTime; CFStringRef kVTCompressionPropertyKey_TargetQualityForAlpha; CFStringRef kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality; + CFStringRef kVTCompressionPropertyKey_ConstantBitRate; CFStringRef kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder; CFStringRef kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder; @@ -164,6 +165,7 @@ "TargetQualityForAlpha"); GET_SYM(kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality, "PrioritizeEncodingSpeedOverQuality"); + GET_SYM(kVTCompressionPropertyKey_ConstantBitRate, "ConstantBitRate"); GET_SYM(kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, "EnableHardwareAcceleratedVideoEncoder"); @@ -236,6 +238,7 @@ int realtime; int frames_before; int frames_after; + bool constant_bit_rate; int allow_sw; int require_sw; @@ -396,6 +399,10 @@ length_code_size, size_buf); + if (status != kCMBlockBufferNoErr) { + return AVERROR_EXTERNAL; + } + for (i = 0; i < length_code_size; i++) { box_len <<= 8; box_len |= size_buf[i]; @@ -840,13 +847,22 @@ int* av_pixel_format, int* range_guessed) { + const char *range_name; if (range_guessed) *range_guessed = range != AVCOL_RANGE_MPEG && range != AVCOL_RANGE_JPEG; //MPEG range is used when no range is set *av_pixel_format = av_map_videotoolbox_format_from_pixfmt2(fmt, range == AVCOL_RANGE_JPEG); + if (*av_pixel_format) + return 0; - return *av_pixel_format ? 0 : AVERROR(EINVAL); + range_name = av_color_range_name(range); + av_log(avctx, AV_LOG_ERROR, + "Could not get pixel format for color format '%s' range '%s'.\n", + av_get_pix_fmt_name(fmt), + range_name ? range_name : "Unknown"); + + return AVERROR(EINVAL); } static void add_color_attr(AVCodecContext *avctx, CFMutableDictionaryRef dict) { @@ -1079,6 +1095,7 @@ CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info, + bool constant_bit_rate, VTCompressionSessionRef *session) { VTEncContext *vtctx = avctx->priv_data; @@ -1139,9 +1156,20 @@ &bit_rate); if (!bit_rate_num) return AVERROR(ENOMEM); - status = VTSessionSetProperty(vtctx->session, - kVTCompressionPropertyKey_AverageBitRate, - bit_rate_num); + if (constant_bit_rate) { + status = VTSessionSetProperty(vtctx->session, + compat_keys.kVTCompressionPropertyKey_ConstantBitRate, + bit_rate_num); + if (status == kVTPropertyNotSupportedErr) { + av_log(avctx, AV_LOG_ERROR, "Error: -constant_bit_rate true is not supported by the encoder.\n"); + return AVERROR_EXTERNAL; + } + } else { + status = VTSessionSetProperty(vtctx->session, + kVTCompressionPropertyKey_AverageBitRate, + bit_rate_num); + } + CFRelease(bit_rate_num); } @@ -1425,7 +1453,7 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) { CFMutableDictionaryRef enc_info; - CFMutableDictionaryRef pixel_buffer_info; + CFMutableDictionaryRef pixel_buffer_info = NULL; CMVideoCodecType codec_type; VTEncContext *vtctx = avctx->priv_data; CFStringRef profile_level = NULL; @@ -1502,8 +1530,6 @@ status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info); if (status) goto init_cleanup; - } else { - pixel_buffer_info = NULL; } vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; @@ -1530,6 +1556,7 @@ gamma_level, enc_info, pixel_buffer_info, + vtctx->constant_bit_rate, &vtctx->session); init_cleanup: @@ -1623,7 +1650,6 @@ { int nal_type; size_t sei_payload_size = 0; - int sei_payload_type = 0; *sei_end = NULL; uint8_t *nal_start = nal_data; @@ -1642,7 +1668,6 @@ while (nal_size > 0 && *nal_data > 0) { do{ - sei_payload_type += *nal_data; nal_data++; nal_size--; } while (nal_size > 0 && *nal_data == 0xFF); @@ -2130,18 +2155,8 @@ return AVERROR(EINVAL); status = get_cv_pixel_format(avctx, av_format, av_color_range, color, &range_guessed); - if (status) { - av_log(avctx, - AV_LOG_ERROR, - "Could not get pixel format for color format '%s' range '%s'.\n", - av_get_pix_fmt_name(av_format), - av_color_range > AVCOL_RANGE_UNSPECIFIED && - av_color_range < AVCOL_RANGE_NB ? - av_color_range_name(av_color_range) : - "Unknown"); - - return AVERROR(EINVAL); - } + if (status) + return status; if (range_guessed) { if (!vtctx->warned_color_range) { @@ -2323,7 +2338,7 @@ status ); - return AVERROR_EXTERNAL; + return status; } pix_buf_pool = VTCompressionSessionGetPixelBufferPool(vtctx->session); @@ -2532,6 +2547,7 @@ gamma_level, enc_info, pixel_buffer_info, + vtctx->constant_bit_rate, &vtctx->session); if (status) goto pe_cleanup; @@ -2539,6 +2555,7 @@ pool = VTCompressionSessionGetPixelBufferPool(vtctx->session); if(!pool){ av_log(avctx, AV_LOG_ERROR, "Error getting pixel buffer pool.\n"); + status = AVERROR_EXTERNAL; goto pe_cleanup; } @@ -2548,6 +2565,7 @@ if(status != kCVReturnSuccess){ av_log(avctx, AV_LOG_ERROR, "Error creating frame from pool: %d\n", status); + status = AVERROR_EXTERNAL; goto pe_cleanup; } @@ -2565,7 +2583,7 @@ AV_LOG_ERROR, "Error sending frame for extradata: %d\n", status); - + status = AVERROR_EXTERNAL; goto pe_cleanup; } @@ -2573,8 +2591,10 @@ status = VTCompressionSessionCompleteFrames(vtctx->session, kCMTimeIndefinite); - if (status) + if (status) { + status = AVERROR_EXTERNAL; goto pe_cleanup; + } status = vtenc_q_pop(vtctx, 0, &buf, NULL); if (status) { @@ -2727,6 +2747,8 @@ { "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, VE }, + { "constant_bit_rate", "Require constant bit rate (macOS 13 or newer)", OFFSET(constant_bit_rate), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + COMMON_OPTIONS { NULL }, }; @@ -2740,7 +2762,7 @@ const FFCodec ff_h264_videotoolbox_encoder = { .p.name = "h264_videotoolbox", - .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"), + CODEC_LONG_NAME("VideoToolbox H.264 Encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, @@ -2750,8 +2772,7 @@ FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &h264_videotoolbox_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; static const AVOption hevc_options[] = { @@ -2761,6 +2782,8 @@ { "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE }, + { "constant_bit_rate", "Require constant bit rate (macOS 13 or newer)", OFFSET(constant_bit_rate), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + COMMON_OPTIONS { NULL }, }; @@ -2774,7 +2797,7 @@ const FFCodec ff_hevc_videotoolbox_encoder = { .p.name = "hevc_videotoolbox", - .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"), + CODEC_LONG_NAME("VideoToolbox H.265 Encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -2785,8 +2808,7 @@ FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &hevc_videotoolbox_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "videotoolbox", }; @@ -2813,7 +2835,7 @@ const FFCodec ff_prores_videotoolbox_encoder = { .p.name = "prores_videotoolbox", - .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"), + CODEC_LONG_NAME("VideoToolbox ProRes Encoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PRORES, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | @@ -2824,7 +2846,6 @@ FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &prores_videotoolbox_class, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.wrapper_name = "videotoolbox", }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,15 @@ * Public libavcodec Videotoolbox header. */ +/** + * @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder + * @ingroup lavc_codec_hwaccel + * + * Hardware accelerated decoding using VideoToolbox on Apple Platforms + * + * @{ + */ + #include #define Picture QuickdrawPicture @@ -37,6 +46,8 @@ #include "libavcodec/avcodec.h" +#include "libavutil/attributes.h" + /** * This struct holds all the information that needs to be passed * between the caller and libavcodec for initializing Videotoolbox decoding. @@ -46,15 +57,17 @@ typedef struct AVVideotoolboxContext { /** * Videotoolbox decompression session object. - * Created and freed the caller. */ VTDecompressionSessionRef session; +#if FF_API_VT_OUTPUT_CALLBACK /** * The output callback that must be passed to the session. * Set by av_videottoolbox_default_init() */ + attribute_deprecated VTDecompressionOutputCallback output_callback; +#endif /** * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames. @@ -65,17 +78,17 @@ /** * CoreMedia Format Description that Videotoolbox will use to create the decompression session. - * Set by the caller. */ CMVideoFormatDescriptionRef cm_fmt_desc; /** * CoreMedia codec type that Videotoolbox will use to create the decompression session. - * Set by the caller. */ int cm_codec_type; } AVVideotoolboxContext; +#if FF_API_VT_HWACCEL_CONTEXT + /** * Allocate and initialize a Videotoolbox context. * @@ -88,7 +101,9 @@ * object and free the Videotoolbox context using av_free(). * * @return the newly allocated context or NULL on failure + * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. */ +attribute_deprecated AVVideotoolboxContext *av_videotoolbox_alloc_context(void); /** @@ -98,7 +113,9 @@ * @param avctx the corresponding codec context * * @return >= 0 on success, a negative AVERROR code on failure + * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. */ +attribute_deprecated int av_videotoolbox_default_init(AVCodecContext *avctx); /** @@ -109,7 +126,9 @@ * @param vtctx the Videotoolbox context to use * * @return >= 0 on success, a negative AVERROR code on failure + * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. */ +attribute_deprecated int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); /** @@ -117,9 +136,13 @@ * av_videotoolbox_default_init(). * * @param avctx the corresponding codec context + * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. */ +attribute_deprecated void av_videotoolbox_default_free(AVCodecContext *avctx); +#endif /* FF_API_VT_HWACCEL_CONTEXT */ + /** * @} */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox_vp9.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox_vp9.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox_vp9.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/videotoolbox_vp9.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "videotoolbox.h" #include "libavutil/hwcontext_videotoolbox.h" #include "vt_internal.h" +#include "libavutil/avassert.h" #include "libavutil/avutil.h" #include "libavutil/frame.h" #include "libavutil/hwcontext.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vima.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vima.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vima.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vima.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,8 +31,8 @@ #include "adpcm_data.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" static uint16_t predict_table[5786 * 2]; @@ -209,11 +209,10 @@ const FFCodec ff_adpcm_vima_decoder = { .p.name = "adpcm_vima", - .p.long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"), + CODEC_LONG_NAME("LucasArts VIMA audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_VIMA, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdaudio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdaudio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdaudio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdaudio.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define BLOCK_TYPE_AUDIO 1 #define BLOCK_TYPE_INITIAL 2 @@ -230,12 +230,11 @@ const FFCodec ff_vmdaudio_decoder = { .p.name = "vmdaudio", - .p.long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"), + CODEC_LONG_NAME("Sierra VMD audio"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_VMDAUDIO, .priv_data_size = sizeof(VmdAudioContext), .init = vmdaudio_decode_init, FF_CODEC_DECODE_CB(vmdaudio_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdvideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdvideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdvideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmdvideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,7 +40,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "bytestream.h" #define VMD_HEADER_SIZE 0x330 @@ -466,7 +466,7 @@ const FFCodec ff_vmdvideo_decoder = { .p.name = "vmdvideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"), + CODEC_LONG_NAME("Sierra VMD video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VMDVIDEO, .priv_data_size = sizeof(VmdVideoContext), @@ -474,5 +474,5 @@ .close = vmdvideo_decode_end, FF_CODEC_DECODE_CB(vmdvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmnc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmnc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmnc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vmnc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,14 +25,10 @@ * As Alex Beregszaszi discovered, this is effectively RFB data dump */ -#include -#include - #include "libavutil/common.h" -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "bytestream.h" enum EncTypes { @@ -575,7 +571,7 @@ const FFCodec ff_vmnc_decoder = { .p.name = "vmnc", - .p.long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"), + CODEC_LONG_NAME("VMware Screen Codec / VMware Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VMNC, .priv_data_size = sizeof(VmncContext), @@ -583,5 +579,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "avcodec.h" #include "vorbis.h" +#include "vorbis_data.h" /* Helper functions */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/mem_internal.h" -#include "vorbis.h" +#include "vorbis_data.h" const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { { 0 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis_data.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VORBIS_DATA_H +#define AVCODEC_VORBIS_DATA_H + +#include + +#include "libavutil/channel_layout.h" + +extern const float ff_vorbis_floor1_inverse_db_table[256]; +extern const float * const ff_vorbis_vwin[8]; +extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; +#if FF_API_OLD_CHANNEL_LAYOUT +extern const uint64_t ff_vorbis_channel_layouts[9]; +#endif +extern const AVChannelLayout ff_vorbis_ch_layouts[9]; + +#endif /* AVCODEC_VORBIS_DATA_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,15 +31,16 @@ #include "libavutil/avassert.h" #include "libavutil/float_dsp.h" +#include "libavutil/tx.h" #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" -#include "fft.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #include "vorbis.h" #include "vorbisdsp.h" +#include "vorbis_data.h" #include "xiph.h" #define V_NB_BITS 8 @@ -129,8 +130,11 @@ VorbisDSPContext dsp; AVFloatDSPContext *fdsp; - FFTContext mdct[2]; + AVTXContext *mdct[2]; + av_tx_fn mdct_fn[2]; + uint8_t first_frame; + int64_t initial_pts; uint32_t version; uint8_t audio_channels; uint32_t audio_samplerate; @@ -200,8 +204,8 @@ av_freep(&vc->residues); av_freep(&vc->modes); - ff_mdct_end(&vc->mdct[0]); - ff_mdct_end(&vc->mdct[1]); + av_tx_uninit(&vc->mdct[0]); + av_tx_uninit(&vc->mdct[1]); if (vc->codebooks) for (i = 0; i < vc->codebook_count; ++i) { @@ -962,6 +966,8 @@ { GetBitContext *gb = &vc->gb; unsigned bl0, bl1; + float scale = -1.0; + int ret; if ((get_bits(gb, 8) != 'v') || (get_bits(gb, 8) != 'o') || (get_bits(gb, 8) != 'r') || (get_bits(gb, 8) != 'b') || @@ -1007,8 +1013,16 @@ vc->previous_window = -1; - ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0); - ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0); + ret = av_tx_init(&vc->mdct[0], &vc->mdct_fn[0], AV_TX_FLOAT_MDCT, 1, + vc->blocksize[0] >> 1, &scale, 0); + if (ret < 0) + return ret; + + ret = av_tx_init(&vc->mdct[1], &vc->mdct_fn[1], AV_TX_FLOAT_MDCT, 1, + vc->blocksize[1] >> 1, &scale, 0); + if (ret < 0) + return ret; + vc->fdsp = avpriv_float_dsp_alloc(vc->avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!vc->fdsp) return AVERROR(ENOMEM); @@ -1578,36 +1592,13 @@ } } -void ff_vorbis_inverse_coupling(float *mag, float *ang, intptr_t blocksize) -{ - int i; - for (i = 0; i < blocksize; i++) { - if (mag[i] > 0.0) { - if (ang[i] > 0.0) { - ang[i] = mag[i] - ang[i]; - } else { - float temp = ang[i]; - ang[i] = mag[i]; - mag[i] += temp; - } - } else { - if (ang[i] > 0.0) { - ang[i] += mag[i]; - } else { - float temp = ang[i]; - ang[i] = mag[i]; - mag[i] -= temp; - } - } - } -} - // Decode the audio packet using the functions above static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr) { GetBitContext *gb = &vc->gb; - FFTContext *mdct; + AVTXContext *mdct; + av_tx_fn mdct_fn; int previous_window = vc->previous_window; unsigned mode_number, blockflag, blocksize; int i, j; @@ -1729,12 +1720,13 @@ // Dotproduct, MDCT - mdct = &vc->mdct[blockflag]; + mdct = vc->mdct[blockflag]; + mdct_fn = vc->mdct_fn[blockflag]; for (j = vc->audio_channels-1;j >= 0; j--) { ch_res_ptr = vc->channel_residues + res_chan[j] * blocksize / 2; vc->fdsp->vector_fmul(floor_ptr[j], floor_ptr[j], ch_res_ptr, blocksize / 2); - mdct->imdct_half(mdct, ch_res_ptr, floor_ptr[j]); + mdct_fn(mdct, ch_res_ptr, floor_ptr[j], sizeof(float)); } // Overlap/add, save data for next overlapping @@ -1847,6 +1839,10 @@ if (!vc->first_frame) { vc->first_frame = 1; + vc->initial_pts = frame->pts; + } + + if (frame->pts == vc->initial_pts) { *got_frame_ptr = 0; av_frame_unref(frame); return buf_size; @@ -1881,12 +1877,11 @@ sizeof(*vc->saved)); } vc->previous_window = -1; - vc->first_frame = 0; } const FFCodec ff_vorbis_decoder = { .p.name = "vorbis", - .p.long_name = NULL_IF_CONFIG_SMALL("Vorbis"), + CODEC_LONG_NAME("Vorbis"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_VORBIS, .priv_data_size = sizeof(vorbis_context), @@ -1895,10 +1890,8 @@ FF_CODEC_DECODE_CB(vorbis_decode_frame), .flush = vorbis_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, -#if FF_API_OLD_CHANNEL_LAYOUT - .p.channel_layouts = ff_vorbis_channel_layouts, -#endif + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_vorbis_channel_layouts) .p.ch_layouts = ff_vorbis_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,11 +19,33 @@ #include "config.h" #include "libavutil/attributes.h" #include "vorbisdsp.h" -#include "vorbis.h" + +static void vorbis_inverse_coupling_c(float *mag, float *ang, ptrdiff_t blocksize) +{ + for (ptrdiff_t i = 0; i < blocksize; i++) { + float angi = ang[i], magi = mag[i]; + + if (magi > 0.f) { + if (angi > 0.f) { + ang[i] = magi - angi; + } else { + ang[i] = magi; + mag[i] = magi + angi; + } + } else { + if (angi > 0.f) { + ang[i] = magi + angi; + } else { + ang[i] = magi; + mag[i] = magi - angi; + } + } + } +} av_cold void ff_vorbisdsp_init(VorbisDSPContext *dsp) { - dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling; + dsp->vorbis_inverse_coupling = vorbis_inverse_coupling_c; #if ARCH_AARCH64 ff_vorbisdsp_init_aarch64(dsp); @@ -31,6 +53,8 @@ ff_vorbisdsp_init_arm(dsp); #elif ARCH_PPC ff_vorbisdsp_init_ppc(dsp); +#elif ARCH_RISCV + ff_vorbisdsp_init_riscv(dsp); #elif ARCH_X86 ff_vorbisdsp_init_x86(dsp); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -19,12 +19,12 @@ #ifndef AVCODEC_VORBISDSP_H #define AVCODEC_VORBISDSP_H -#include +#include typedef struct VorbisDSPContext { /* assume len is a multiple of 4, and arrays are 16-byte aligned */ void (*vorbis_inverse_coupling)(float *mag, float *ang, - intptr_t blocksize); + ptrdiff_t blocksize); } VorbisDSPContext; void ff_vorbisdsp_init(VorbisDSPContext *dsp); @@ -34,5 +34,6 @@ void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp); void ff_vorbisdsp_init_arm(VorbisDSPContext *dsp); void ff_vorbisdsp_init_ppc(VorbisDSPContext *dsp); +void ff_vorbisdsp_init_riscv(VorbisDSPContext *dsp); #endif /* AVCODEC_VORBISDSP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbisenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,13 +26,14 @@ #include #include "libavutil/float_dsp.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "fft.h" #include "mathops.h" #include "vorbis.h" +#include "vorbis_data.h" #include "vorbis_enc_data.h" #include "audio_frame_queue.h" @@ -106,7 +107,8 @@ int channels; int sample_rate; int log2_blocksize[2]; - FFTContext mdct[2]; + AVTXContext *mdct[2]; + av_tx_fn mdct_fn[2]; const float *win[2]; int have_saved; float *saved; @@ -250,6 +252,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, vorbis_enc_context *venc) { int ret = 0; + float scale = 1.0f; venc->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!venc->fdsp) @@ -259,9 +262,11 @@ venc->win[0] = ff_vorbis_vwin[venc->log2_blocksize[0] - 6]; venc->win[1] = ff_vorbis_vwin[venc->log2_blocksize[1] - 6]; - if ((ret = ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0, 1.0)) < 0) + if ((ret = av_tx_init(&venc->mdct[0], &venc->mdct_fn[0], AV_TX_FLOAT_MDCT, + 0, 1 << (venc->log2_blocksize[0] - 1), &scale, 0)) < 0) return ret; - if ((ret = ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0, 1.0)) < 0) + if ((ret = av_tx_init(&venc->mdct[1], &venc->mdct_fn[1], AV_TX_FLOAT_MDCT, + 0, 1 << (venc->log2_blocksize[1] - 1), &scale, 0)) < 0) return ret; return 0; @@ -1021,8 +1026,8 @@ fdsp->vector_fmul_reverse(offset, offset, win, window_len); fdsp->vector_fmul_scalar(offset, offset, 1/n, window_len); - venc->mdct[1].mdct_calc(&venc->mdct[1], venc->coeffs + channel * window_len, - venc->samples + channel * window_len * 2); + venc->mdct_fn[1](venc->mdct[1], venc->coeffs + channel * window_len, + venc->samples + channel * window_len * 2, sizeof(float)); } return 1; } @@ -1255,8 +1260,8 @@ av_freep(&venc->scratch); av_freep(&venc->fdsp); - ff_mdct_end(&venc->mdct[0]); - ff_mdct_end(&venc->mdct[1]); + av_tx_uninit(&venc->mdct[0]); + av_tx_uninit(&venc->mdct[1]); ff_af_queue_close(&venc->afq); ff_bufqueue_discard_all(&venc->bufqueue); @@ -1297,15 +1302,16 @@ const FFCodec ff_vorbis_encoder = { .p.name = "vorbis", - .p.long_name = NULL_IF_CONFIG_SMALL("Vorbis"), + CODEC_LONG_NAME("Vorbis"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_VORBIS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_EXPERIMENTAL, .priv_data_size = sizeof(vorbis_enc_context), .init = vorbis_encode_init, FF_CODEC_ENCODE_CB(vorbis_encode_frame), .close = vorbis_encode_close, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vorbis.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,15 +21,9 @@ #ifndef AVCODEC_VORBIS_H #define AVCODEC_VORBIS_H -#include "avcodec.h" +#include -extern const float ff_vorbis_floor1_inverse_db_table[256]; -extern const float * const ff_vorbis_vwin[8]; -extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_vorbis_channel_layouts[9]; -#endif -extern const AVChannelLayout ff_vorbis_ch_layouts[9]; +#include "avcodec.h" typedef struct vorbis_floor1_entry { uint16_t x; @@ -45,7 +39,6 @@ void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint16_t *y_list, int *flag, int multiplier, float * out, int samples); -void ff_vorbis_inverse_coupling(float *mag, float *ang, intptr_t blocksize); #define ilog(i) av_log2(2*(i)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,8 +32,7 @@ #include "config_components.h" -#include -#include +#include #include #include "libavutil/imgutils.h" @@ -41,9 +40,10 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "hpeldsp.h" -#include "internal.h" +#include "jpegquanttables.h" #include "mathops.h" #include "thread.h" #include "threadframe.h" @@ -1950,7 +1950,7 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int motion_y, int y) { - ThreadFrame *ref_frame; + const ThreadFrame *ref_frame; int ref_row; int border = motion_y & 1; @@ -2419,7 +2419,7 @@ s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i]; s->coded_ac_scale_factor[i] = s->version < 2 ? vp31_ac_scale_factor[i] : vp4_ac_scale_factor[i]; s->base_matrix[0][i] = s->version < 2 ? vp31_intra_y_dequant[i] : vp4_generic_dequant[i]; - s->base_matrix[1][i] = s->version < 2 ? vp31_intra_c_dequant[i] : vp4_generic_dequant[i]; + s->base_matrix[1][i] = s->version < 2 ? ff_mjpeg_std_chrominance_quant_tbl[i] : vp4_generic_dequant[i]; s->base_matrix[2][i] = s->version < 2 ? vp31_inter_dequant[i] : vp4_generic_dequant[i]; s->filter_limit_values[i] = s->version < 2 ? vp31_filter_limit_values[i] : vp4_filter_limit_values[i]; } @@ -2654,8 +2654,8 @@ s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) - av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n", - s->keyframe ? "key" : "", avctx->frame_number + 1, s->qps[0]); + av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%"PRId64": Q index = %d\n", + s->keyframe ? "key" : "", avctx->frame_num + 1, s->qps[0]); s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] || avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL @@ -2701,7 +2701,7 @@ } #endif s->version = version; - if (avctx->frame_number == 0) + if (avctx->frame_num == 0) av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version); } @@ -3170,7 +3170,7 @@ const FFCodec ff_theora_decoder = { .p.name = "theora", - .p.long_name = NULL_IF_CONFIG_SMALL("Theora"), + CODEC_LONG_NAME("Theora"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_THEORA, .priv_data_size = sizeof(Vp3DecodeContext), @@ -3180,15 +3180,15 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + UPDATE_THREAD_CONTEXT(vp3_update_thread_context), + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; #endif const FFCodec ff_vp3_decoder = { .p.name = "vp3", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP3"), + CODEC_LONG_NAME("On2 VP3"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP3, .priv_data_size = sizeof(Vp3DecodeContext), @@ -3198,15 +3198,15 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + UPDATE_THREAD_CONTEXT(vp3_update_thread_context), + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; #if CONFIG_VP4_DECODER const FFCodec ff_vp4_decoder = { .p.name = "vp4", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP4"), + CODEC_LONG_NAME("On2 VP4"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP4, .priv_data_size = sizeof(Vp3DecodeContext), @@ -3216,8 +3216,8 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + UPDATE_THREAD_CONTEXT(vp3_update_thread_context), + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3data.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3data.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3data.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp3data.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include /* these coefficients dequantize intraframe Y plane coefficients - * (note: same as JPEG) */ + * (note: almost the same as JPEG) */ static const uint8_t vp31_intra_y_dequant[64] = { 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, @@ -37,19 +37,6 @@ 72, 92, 95, 98, 112, 100, 103, 99 }; -/* these coefficients dequantize intraframe C plane coefficients - * (note: same as JPEG) */ -static const uint8_t vp31_intra_c_dequant[64] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 -}; - /* these coefficients dequantize interframe coefficients (all planes) */ static const uint8_t vp31_inter_dequant[64] = { 16, 16, 16, 20, 24, 28, 32, 40, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,10 +25,11 @@ #include "avcodec.h" #include "bytestream.h" -#include "internal.h" +#include "decode.h" #include "h264chroma.h" #include "vp56.h" #include "vp56data.h" +#include "vpx_rac.h" void ff_vp56_init_dequant(VP56Context *s, int quantizer) @@ -80,22 +81,22 @@ static void vp56_parse_mb_type_models(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int i, ctx, type; for (ctx=0; ctx<3; ctx++) { - if (vp56_rac_get_prob_branchy(c, 174)) { + if (vpx_rac_get_prob_branchy(c, 174)) { int idx = vp56_rac_gets(c, 4); memcpy(model->mb_types_stats[ctx], ff_vp56_pre_def_mb_type_stats[idx][ctx], sizeof(model->mb_types_stats[ctx])); } - if (vp56_rac_get_prob_branchy(c, 254)) { + if (vpx_rac_get_prob_branchy(c, 254)) { for (type=0; type<10; type++) { for(i=0; i<2; i++) { - if (vp56_rac_get_prob_branchy(c, 205)) { - int delta, sign = vp56_rac_get(c); + if (vpx_rac_get_prob_branchy(c, 205)) { + int delta, sign = vpx_rac_get(c); delta = vp56_rac_get_tree(c, ff_vp56_pmbtm_tree, ff_vp56_mb_type_model_model); @@ -153,9 +154,9 @@ VP56mb prev_type, int ctx) { uint8_t *mb_type_model = s->modelp->mb_type[ctx][prev_type]; - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; - if (vp56_rac_get_prob_branchy(c, mb_type_model[0])) + if (vpx_rac_get_prob_branchy(c, mb_type_model[0])) return prev_type; else return vp56_rac_get_tree(c, ff_vp56_pmbt_tree, mb_type_model); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,11 +31,11 @@ #include "avcodec.h" #include "get_bits.h" #include "hpeldsp.h" -#include "bytestream.h" #include "h264chroma.h" #include "videodsp.h" #include "vp3dsp.h" #include "vp56dsp.h" +#include "vpx_rac.h" typedef struct vp56_context VP56Context; @@ -44,7 +44,6 @@ VP56_FRAME_CURRENT = 0, VP56_FRAME_PREVIOUS = 1, VP56_FRAME_GOLDEN = 2, - VP56_FRAME_GOLDEN2 = 3, } VP56Frame; typedef enum { @@ -84,16 +83,6 @@ typedef int (*VP56ParseHeader)(VP56Context *s, const uint8_t *buf, int buf_size); -typedef struct VP56RangeCoder { - int high; - int bits; /* stored negated (i.e. negative "bits" is a positive number of - bits left) in order to eliminate a negate in cache refilling */ - const uint8_t *buffer; - const uint8_t *end; - unsigned int code_word; - int end_reached; -} VP56RangeCoder; - typedef struct VP56RefDc { uint8_t not_null_dc; VP56Frame ref_frame; @@ -134,9 +123,9 @@ AVFrame *frames[4]; uint8_t *edge_emu_buffer_alloc; uint8_t *edge_emu_buffer; - VP56RangeCoder c; - VP56RangeCoder cc; - VP56RangeCoder *ccp; + VPXRangeCoder c; + VPXRangeCoder cc; + VPXRangeCoder *ccp; int sub_version; /* frame info */ @@ -232,160 +221,31 @@ * vp56 specific range coder implementation */ -extern const uint8_t ff_vp56_norm_shift[256]; -int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size); - -/** - * vp5689 returns 1 if the end of the stream has been reached, 0 otherwise. - */ -static av_always_inline int vpX_rac_is_end(VP56RangeCoder *c) -{ - if (c->end <= c->buffer && c->bits >= 0) - c->end_reached ++; - return c->end_reached > 10; -} - -static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c) -{ - int shift = ff_vp56_norm_shift[c->high]; - int bits = c->bits; - unsigned int code_word = c->code_word; - - c->high <<= shift; - code_word <<= shift; - bits += shift; - if(bits >= 0 && c->buffer < c->end) { - code_word |= bytestream_get_be16(&c->buffer) << bits; - bits -= 16; - } - c->bits = bits; - return code_word; -} - -#if ARCH_ARM -#include "arm/vp56_arith.h" -#elif ARCH_X86 -#include "x86/vp56_arith.h" -#endif - -#ifndef vp56_rac_get_prob -#define vp56_rac_get_prob vp56_rac_get_prob -static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) -{ - unsigned int code_word = vp56_rac_renorm(c); - unsigned int low = 1 + (((c->high - 1) * prob) >> 8); - unsigned int low_shift = low << 16; - int bit = code_word >= low_shift; - - c->high = bit ? c->high - low : low; - c->code_word = bit ? code_word - low_shift : code_word; - - return bit; -} -#endif - -#ifndef vp56_rac_get_prob_branchy -// branchy variant, to be used where there's a branch based on the bit decoded -static av_always_inline int vp56_rac_get_prob_branchy(VP56RangeCoder *c, int prob) -{ - unsigned long code_word = vp56_rac_renorm(c); - unsigned low = 1 + (((c->high - 1) * prob) >> 8); - unsigned low_shift = low << 16; - - if (code_word >= low_shift) { - c->high -= low; - c->code_word = code_word - low_shift; - return 1; - } - - c->high = low; - c->code_word = code_word; - return 0; -} -#endif - -static av_always_inline int vp56_rac_get(VP56RangeCoder *c) -{ - unsigned int code_word = vp56_rac_renorm(c); - /* equiprobable */ - int low = (c->high + 1) >> 1; - unsigned int low_shift = low << 16; - int bit = code_word >= low_shift; - if (bit) { - c->high -= low; - code_word -= low_shift; - } else { - c->high = low; - } - - c->code_word = code_word; - return bit; -} - -// rounding is different than vp56_rac_get, is vp56_rac_get wrong? -static av_always_inline int vp8_rac_get(VP56RangeCoder *c) -{ - return vp56_rac_get_prob(c, 128); -} - -static int vp56_rac_gets(VP56RangeCoder *c, int bits) +static int vp56_rac_gets(VPXRangeCoder *c, int bits) { int value = 0; while (bits--) { - value = (value << 1) | vp56_rac_get(c); + value = (value << 1) | vpx_rac_get(c); } return value; } -static int vp8_rac_get_uint(VP56RangeCoder *c, int bits) -{ - int value = 0; - - while (bits--) { - value = (value << 1) | vp8_rac_get(c); - } - - return value; -} - -// fixme: add 1 bit to all the calls to this? -static av_unused int vp8_rac_get_sint(VP56RangeCoder *c, int bits) -{ - int v; - - if (!vp8_rac_get(c)) - return 0; - - v = vp8_rac_get_uint(c, bits); - - if (vp8_rac_get(c)) - v = -v; - - return v; -} - // P(7) -static av_unused int vp56_rac_gets_nn(VP56RangeCoder *c, int bits) +static av_unused int vp56_rac_gets_nn(VPXRangeCoder *c, int bits) { int v = vp56_rac_gets(c, 7) << 1; return v + !v; } -static av_unused int vp8_rac_get_nn(VP56RangeCoder *c) -{ - int v = vp8_rac_get_uint(c, 7) << 1; - return v + !v; -} - static av_always_inline -int vp56_rac_get_tree(VP56RangeCoder *c, +int vp56_rac_get_tree(VPXRangeCoder *c, const VP56Tree *tree, const uint8_t *probs) { while (tree->val > 0) { - if (vp56_rac_get_prob_branchy(c, probs[tree->prob_idx])) + if (vpx_rac_get_prob_branchy(c, probs[tree->prob_idx])) tree += tree->val; else tree++; @@ -393,30 +253,4 @@ return -tree->val; } -// how probabilities are associated with decisions is different I think -// well, the new scheme fits in the old but this way has one fewer branches per decision -static av_always_inline int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t (*tree)[2], - const uint8_t *probs) -{ - int i = 0; - - do { - i = tree[i][vp56_rac_get_prob(c, probs[i])]; - } while (i > 0); - - return -i; -} - -// DCTextra -static av_always_inline int vp8_rac_get_coeff(VP56RangeCoder *c, const uint8_t *prob) -{ - int v = 0; - - do { - v = (v<<1) + vp56_rac_get_prob(c, *prob++); - } while (*prob); - - return v; -} - #endif /* AVCODEC_VP56_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56rac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56rac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56rac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp56rac.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * VP5/6/8 decoder - * Copyright (c) 2010 Fiona Glaser - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * 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/error.h" -#include "bytestream.h" -#include "vp56.h" - -const uint8_t ff_vp56_norm_shift[256]= { - 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -}; - -int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size) -{ - c->high = 255; - c->bits = -16; - c->buffer = buf; - c->end = buf + buf_size; - c->end_reached = 0; - if (buf_size < 1) - return AVERROR_INVALIDDATA; - c->code_word = bytestream_get_be24(&c->buffer); - return 0; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp5.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp5.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp5.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp5.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,29 +23,29 @@ * VP5 compatible video decoder */ -#include #include #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "vp56.h" #include "vp56data.h" #include "vp5data.h" +#include "vpx_rac.h" static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int rows, cols; int ret; - ret = ff_vp56_init_range_decoder(&s->c, buf, buf_size); + ret = ff_vpx_init_range_decoder(&s->c, buf, buf_size); if (ret < 0) return ret; - s->frames[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c); - vp56_rac_get(c); + s->frames[VP56_FRAME_CURRENT]->key_frame = !vpx_rac_get(c); + vpx_rac_get(c); ff_vp56_init_dequant(s, vp56_rac_gets(c, 6)); if (s->frames[VP56_FRAME_CURRENT]->key_frame) { @@ -55,7 +55,7 @@ if(vp56_rac_gets(c, 5) > 5) return AVERROR_INVALIDDATA; vp56_rac_gets(c, 2); - if (vp56_rac_get(c)) { + if (vpx_rac_get(c)) { avpriv_report_missing_feature(s->avctx, "Interlacing"); return AVERROR_PATCHWELCOME; } @@ -87,16 +87,16 @@ static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int comp, di; for (comp=0; comp<2; comp++) { int delta = 0; - if (vp56_rac_get_prob_branchy(c, model->vector_dct[comp])) { - int sign = vp56_rac_get_prob(c, model->vector_sig[comp]); - di = vp56_rac_get_prob(c, model->vector_pdi[comp][0]); - di |= vp56_rac_get_prob(c, model->vector_pdi[comp][1]) << 1; + if (vpx_rac_get_prob_branchy(c, model->vector_dct[comp])) { + int sign = vpx_rac_get_prob(c, model->vector_sig[comp]); + di = vpx_rac_get_prob(c, model->vector_pdi[comp][0]); + di |= vpx_rac_get_prob(c, model->vector_pdi[comp][1]) << 1; delta = vp56_rac_get_tree(c, ff_vp56_pva_tree, model->vector_pdv[comp]); delta = di | (delta << 2); @@ -111,30 +111,30 @@ static void vp5_parse_vector_models(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int comp, node; for (comp=0; comp<2; comp++) { - if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][0])) + if (vpx_rac_get_prob_branchy(c, vp5_vmc_pct[comp][0])) model->vector_dct[comp] = vp56_rac_gets_nn(c, 7); - if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][1])) + if (vpx_rac_get_prob_branchy(c, vp5_vmc_pct[comp][1])) model->vector_sig[comp] = vp56_rac_gets_nn(c, 7); - if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][2])) + if (vpx_rac_get_prob_branchy(c, vp5_vmc_pct[comp][2])) model->vector_pdi[comp][0] = vp56_rac_gets_nn(c, 7); - if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][3])) + if (vpx_rac_get_prob_branchy(c, vp5_vmc_pct[comp][3])) model->vector_pdi[comp][1] = vp56_rac_gets_nn(c, 7); } for (comp=0; comp<2; comp++) for (node=0; node<7; node++) - if (vp56_rac_get_prob_branchy(c, vp5_vmc_pct[comp][4 + node])) + if (vpx_rac_get_prob_branchy(c, vp5_vmc_pct[comp][4 + node])) model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7); } static int vp5_parse_coeff_models(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; uint8_t def_prob[11]; int node, cg, ctx; @@ -145,7 +145,7 @@ for (pt=0; pt<2; pt++) for (node=0; node<11; node++) - if (vp56_rac_get_prob_branchy(c, vp5_dccv_pct[pt][node])) { + if (vpx_rac_get_prob_branchy(c, vp5_dccv_pct[pt][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_dccv[pt][node] = def_prob[node]; } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { @@ -156,7 +156,7 @@ for (pt=0; pt<2; pt++) for (cg=0; cg<6; cg++) for (node=0; node<11; node++) - if (vp56_rac_get_prob_branchy(c, vp5_ract_pct[ct][pt][cg][node])) { + if (vpx_rac_get_prob_branchy(c, vp5_ract_pct[ct][pt][cg][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_ract[pt][ct][cg][node] = def_prob[node]; } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { @@ -181,7 +181,7 @@ static int vp5_parse_coeff(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; uint8_t *permute = s->idct_scantable; uint8_t *model1, *model2; @@ -189,7 +189,7 @@ int b, i, cg, idx, ctx, ctx_last; int pt = 0; /* plane type (0 for Y, 1 for U or V) */ - if (vpX_rac_is_end(c)) { + if (vpx_rac_is_end(c)) { av_log(s->avctx, AV_LOG_ERROR, "End of AC stream reached in vp5_parse_coeff\n"); return AVERROR_INVALIDDATA; } @@ -206,30 +206,30 @@ coeff_idx = 0; for (;;) { - if (vp56_rac_get_prob_branchy(c, model2[0])) { - if (vp56_rac_get_prob_branchy(c, model2[2])) { - if (vp56_rac_get_prob_branchy(c, model2[3])) { + if (vpx_rac_get_prob_branchy(c, model2[0])) { + if (vpx_rac_get_prob_branchy(c, model2[2])) { + if (vpx_rac_get_prob_branchy(c, model2[3])) { s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 4; idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1); - sign = vp56_rac_get(c); + sign = vpx_rac_get(c); coeff = ff_vp56_coeff_bias[idx+5]; for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--) - coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; + coeff += vpx_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; } else { - if (vp56_rac_get_prob_branchy(c, model2[4])) { - coeff = 3 + vp56_rac_get_prob(c, model1[5]); + if (vpx_rac_get_prob_branchy(c, model2[4])) { + coeff = 3 + vpx_rac_get_prob(c, model1[5]); s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 3; } else { coeff = 2; s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 2; } - sign = vp56_rac_get(c); + sign = vpx_rac_get(c); } ct = 2; } else { ct = 1; s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 1; - sign = vp56_rac_get(c); + sign = vpx_rac_get(c); coeff = 1; } coeff = (coeff ^ -sign) + sign; @@ -237,7 +237,7 @@ coeff *= s->dequant_ac; s->block_coeff[b][permute[coeff_idx]] = coeff; } else { - if (ct && !vp56_rac_get_prob_branchy(c, model2[1])) + if (ct && !vpx_rac_get_prob_branchy(c, model2[1])) break; ct = 0; s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 0; @@ -305,7 +305,7 @@ const FFCodec ff_vp5_decoder = { .p.name = "vp5", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP5"), + CODEC_LONG_NAME("On2 VP5"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP5, .priv_data_size = sizeof(VP56Context), @@ -313,5 +313,5 @@ .close = vp56_free, FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp6.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp6.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp6.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp6.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,13 +31,14 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "huffman.h" -#include "internal.h" #include "vp56.h" #include "vp56data.h" #include "vp6data.h" +#include "vpx_rac.h" #define VP6_MAX_HUFF_SIZE 12 @@ -46,7 +47,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int parse_filter_info = 0; int coeff_offset = 0; int vrt_shift = 0; @@ -107,7 +108,7 @@ res = VP56_SIZE_CHANGE; } - ret = ff_vp56_init_range_decoder(c, buf+6, buf_size-6); + ret = ff_vpx_init_range_decoder(c, buf+6, buf_size-6); if (ret < 0) goto fail; vp56_rac_gets(c, 2); @@ -126,26 +127,26 @@ buf += 2; buf_size -= 2; } - ret = ff_vp56_init_range_decoder(c, buf+1, buf_size-1); + ret = ff_vpx_init_range_decoder(c, buf+1, buf_size-1); if (ret < 0) return ret; - s->golden_frame = vp56_rac_get(c); + s->golden_frame = vpx_rac_get(c); if (s->filter_header) { - s->deblock_filtering = vp56_rac_get(c); + s->deblock_filtering = vpx_rac_get(c); if (s->deblock_filtering) - vp56_rac_get(c); + vpx_rac_get(c); if (s->sub_version > 7) - parse_filter_info = vp56_rac_get(c); + parse_filter_info = vpx_rac_get(c); } } if (parse_filter_info) { - if (vp56_rac_get(c)) { + if (vpx_rac_get(c)) { s->filter_mode = 2; s->sample_variance_threshold = vp56_rac_gets(c, 5) << vrt_shift; s->max_vector_length = 2 << vp56_rac_gets(c, 3); - } else if (vp56_rac_get(c)) { + } else if (vpx_rac_get(c)) { s->filter_mode = 1; } else { s->filter_mode = 0; @@ -156,7 +157,7 @@ s->filter_selection = 16; } - s->use_huffman = vp56_rac_get(c); + s->use_huffman = vpx_rac_get(c); s->parse_coeff = vp6_parse_coeff; if (coeff_offset) { @@ -172,7 +173,7 @@ if (ret < 0) return ret; } else { - ret = ff_vp56_init_range_decoder(&s->cc, buf, buf_size); + ret = ff_vpx_init_range_decoder(&s->cc, buf, buf_size); if (ret < 0) goto fail; s->ccp = &s->cc; @@ -231,25 +232,25 @@ static void vp6_parse_vector_models(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int comp, node; for (comp=0; comp<2; comp++) { - if (vp56_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][0])) + if (vpx_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][0])) model->vector_dct[comp] = vp56_rac_gets_nn(c, 7); - if (vp56_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][1])) + if (vpx_rac_get_prob_branchy(c, vp6_sig_dct_pct[comp][1])) model->vector_sig[comp] = vp56_rac_gets_nn(c, 7); } for (comp=0; comp<2; comp++) for (node=0; node<7; node++) - if (vp56_rac_get_prob_branchy(c, vp6_pdv_pct[comp][node])) + if (vpx_rac_get_prob_branchy(c, vp6_pdv_pct[comp][node])) model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7); for (comp=0; comp<2; comp++) for (node=0; node<8; node++) - if (vp56_rac_get_prob_branchy(c, vp6_fdv_pct[comp][node])) + if (vpx_rac_get_prob_branchy(c, vp6_fdv_pct[comp][node])) model->vector_fdv[comp][node] = vp56_rac_gets_nn(c, 7); } @@ -284,7 +285,7 @@ static int vp6_parse_coeff_models(VP56Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int def_prob[11]; int node, cg, ctx, pos; @@ -295,30 +296,30 @@ for (pt=0; pt<2; pt++) for (node=0; node<11; node++) - if (vp56_rac_get_prob_branchy(c, vp6_dccv_pct[pt][node])) { + if (vpx_rac_get_prob_branchy(c, vp6_dccv_pct[pt][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_dccv[pt][node] = def_prob[node]; } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { model->coeff_dccv[pt][node] = def_prob[node]; } - if (vp56_rac_get(c)) { + if (vpx_rac_get(c)) { for (pos=1; pos<64; pos++) - if (vp56_rac_get_prob_branchy(c, vp6_coeff_reorder_pct[pos])) + if (vpx_rac_get_prob_branchy(c, vp6_coeff_reorder_pct[pos])) model->coeff_reorder[pos] = vp56_rac_gets(c, 4); vp6_coeff_order_table_init(s); } for (cg=0; cg<2; cg++) for (node=0; node<14; node++) - if (vp56_rac_get_prob_branchy(c, vp6_runv_pct[cg][node])) + if (vpx_rac_get_prob_branchy(c, vp6_runv_pct[cg][node])) model->coeff_runv[cg][node] = vp56_rac_gets_nn(c, 7); for (ct=0; ct<3; ct++) for (pt=0; pt<2; pt++) for (cg=0; cg<6; cg++) for (node=0; node<11; node++) - if (vp56_rac_get_prob_branchy(c, vp6_ract_pct[ct][pt][cg][node])) { + if (vpx_rac_get_prob_branchy(c, vp6_ract_pct[ct][pt][cg][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_ract[pt][ct][cg][node] = def_prob[node]; } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { @@ -353,7 +354,7 @@ static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; VP56Model *model = s->modelp; int comp; @@ -364,14 +365,14 @@ for (comp=0; comp<2; comp++) { int i, delta = 0; - if (vp56_rac_get_prob_branchy(c, model->vector_dct[comp])) { + if (vpx_rac_get_prob_branchy(c, model->vector_dct[comp])) { static const uint8_t prob_order[] = {0, 1, 2, 7, 6, 5, 4}; for (i=0; ivector_fdv[comp][j])<vector_fdv[comp][j])<vector_fdv[comp][3])<<3; + delta |= vpx_rac_get_prob(c, model->vector_fdv[comp][3])<<3; else delta |= 8; } else { @@ -379,7 +380,7 @@ model->vector_pdv[comp]); } - if (delta && vp56_rac_get_prob_branchy(c, model->vector_sig[comp])) + if (delta && vpx_rac_get_prob_branchy(c, model->vector_sig[comp])) delta = -delta; if (!comp) @@ -468,7 +469,7 @@ static int vp6_parse_coeff(VP56Context *s) { - VP56RangeCoder *c = s->ccp; + VPXRangeCoder *c = s->ccp; VP56Model *model = s->modelp; uint8_t *permute = s->idct_scantable; uint8_t *model1, *model2, *model3; @@ -476,7 +477,7 @@ int b, i, cg, idx, ctx; int pt = 0; /* plane type (0 for Y, 1 for U or V) */ - if (vpX_rac_is_end(c)) { + if (vpx_rac_is_end(c)) { av_log(s->avctx, AV_LOG_ERROR, "End of AC stream reached in vp6_parse_coeff\n"); return AVERROR_INVALIDDATA; } @@ -494,17 +495,17 @@ coeff_idx = 0; for (;;) { - if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob_branchy(c, model2[0])) { + if ((coeff_idx>1 && ct==0) || vpx_rac_get_prob_branchy(c, model2[0])) { /* parse a coeff */ - if (vp56_rac_get_prob_branchy(c, model2[2])) { - if (vp56_rac_get_prob_branchy(c, model2[3])) { + if (vpx_rac_get_prob_branchy(c, model2[2])) { + if (vpx_rac_get_prob_branchy(c, model2[3])) { idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1); coeff = ff_vp56_coeff_bias[idx+5]; for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--) - coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; + coeff += vpx_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; } else { - if (vp56_rac_get_prob_branchy(c, model2[4])) - coeff = 3 + vp56_rac_get_prob(c, model1[5]); + if (vpx_rac_get_prob_branchy(c, model2[4])) + coeff = 3 + vpx_rac_get_prob(c, model1[5]); else coeff = 2; } @@ -513,7 +514,7 @@ ct = 1; coeff = 1; } - sign = vp56_rac_get(c); + sign = vpx_rac_get(c); coeff = (coeff ^ -sign) + sign; if (coeff_idx) coeff *= s->dequant_ac; @@ -524,14 +525,14 @@ /* parse a run */ ct = 0; if (coeff_idx > 0) { - if (!vp56_rac_get_prob_branchy(c, model2[1])) + if (!vpx_rac_get_prob_branchy(c, model2[1])) break; model3 = model->coeff_runv[coeff_idx >= 6]; run = vp56_rac_get_tree(c, vp6_pcr_tree, model3); if (!run) for (run=9, i=0; i<6; i++) - run += vp56_rac_get_prob(c, model3[i+8]) << i; + run += vpx_rac_get_prob(c, model3[i+8]) << i; } } coeff_idx += run; @@ -714,7 +715,7 @@ const FFCodec ff_vp6_decoder = { .p.name = "vp6", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6"), + CODEC_LONG_NAME("On2 VP6"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP6, .priv_data_size = sizeof(VP56Context), @@ -722,13 +723,13 @@ .close = vp6_decode_free, FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; /* flash version, not flipped upside-down */ const FFCodec ff_vp6f_decoder = { .p.name = "vp6f", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"), + CODEC_LONG_NAME("On2 VP6 (Flash version)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP6F, .priv_data_size = sizeof(VP56Context), @@ -736,13 +737,13 @@ .close = vp6_decode_free, FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; /* flash version, not flipped upside-down, with alpha channel */ const FFCodec ff_vp6a_decoder = { .p.name = "vp6a", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"), + CODEC_LONG_NAME("On2 VP6 (Flash version, with alpha channel)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP6A, .priv_data_size = 2 /* Main context + alpha context */ * sizeof(VP56Context), @@ -750,5 +751,5 @@ .close = vp6_decode_free, FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp89_rac.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp89_rac.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp89_rac.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp89_rac.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Range decoder functions common to VP8 and VP9 + */ + +#ifndef AVCODEC_VP89_RAC_H +#define AVCODEC_VP89_RAC_H + +#include + +#include "libavutil/attributes.h" + +#include "vpx_rac.h" + +// rounding is different than vpx_rac_get, is vpx_rac_get wrong? +static av_always_inline int vp89_rac_get(VPXRangeCoder *c) +{ + return vpx_rac_get_prob(c, 128); +} + +static av_unused int vp89_rac_get_uint(VPXRangeCoder *c, int bits) +{ + int value = 0; + + while (bits--) { + value = (value << 1) | vp89_rac_get(c); + } + + return value; +} + +// how probabilities are associated with decisions is different I think +// well, the new scheme fits in the old but this way has one fewer branches per decision +static av_always_inline int vp89_rac_get_tree(VPXRangeCoder *c, const int8_t (*tree)[2], + const uint8_t *probs) +{ + int i = 0; + + do { + i = tree[i][vpx_rac_get_prob(c, probs[i])]; + } while (i > 0); + + return -i; +} + +#endif /* AVCODEC_VP89_RAC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,31 +26,57 @@ #include "config_components.h" -#include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "hwconfig.h" -#include "internal.h" #include "mathops.h" -#include "rectangle.h" #include "thread.h" #include "threadframe.h" #include "vp8.h" +#include "vp89_rac.h" #include "vp8data.h" +#include "vpx_rac.h" #if ARCH_ARM # include "arm/vp8.h" #endif -#if CONFIG_VP7_DECODER && CONFIG_VP8_DECODER -#define VPX(vp7, f) (vp7 ? vp7_ ## f : vp8_ ## f) -#elif CONFIG_VP7_DECODER -#define VPX(vp7, f) vp7_ ## f -#else // CONFIG_VP8_DECODER -#define VPX(vp7, f) vp8_ ## f -#endif +// fixme: add 1 bit to all the calls to this? +static int vp8_rac_get_sint(VPXRangeCoder *c, int bits) +{ + int v; + + if (!vp89_rac_get(c)) + return 0; + + v = vp89_rac_get_uint(c, bits); + + if (vp89_rac_get(c)) + v = -v; + + return v; +} + +static int vp8_rac_get_nn(VPXRangeCoder *c) +{ + int v = vp89_rac_get_uint(c, 7) << 1; + return v + !v; +} + +// DCTextra +static int vp8_rac_get_coeff(VPXRangeCoder *c, const uint8_t *prob) +{ + int v = 0; + + do { + v = (v<<1) + vpx_rac_get_prob(c, *prob++); + } while (*prob); + + return v; +} static void free_buffers(VP8Context *s) { @@ -106,7 +132,7 @@ } #if CONFIG_VP8_DECODER -static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, VP8Frame *src) +static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, const VP8Frame *src) { int ret; @@ -155,10 +181,10 @@ // find a free buffer for (i = 0; i < 5; i++) - if (&s->frames[i] != s->framep[VP56_FRAME_CURRENT] && - &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] && - &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] && - &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) { + if (&s->frames[i] != s->framep[VP8_FRAME_CURRENT] && + &s->frames[i] != s->framep[VP8_FRAME_PREVIOUS] && + &s->frames[i] != s->framep[VP8_FRAME_GOLDEN] && + &s->frames[i] != s->framep[VP8_FRAME_ALTREF]) { frame = &s->frames[i]; break; } @@ -266,14 +292,14 @@ static void parse_segment_info(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i; - s->segmentation.update_map = vp8_rac_get(c); - s->segmentation.update_feature_data = vp8_rac_get(c); + s->segmentation.update_map = vp89_rac_get(c); + s->segmentation.update_feature_data = vp89_rac_get(c); if (s->segmentation.update_feature_data) { - s->segmentation.absolute_vals = vp8_rac_get(c); + s->segmentation.absolute_vals = vp89_rac_get(c); for (i = 0; i < 4; i++) s->segmentation.base_quant[i] = vp8_rac_get_sint(c, 7); @@ -283,28 +309,28 @@ } if (s->segmentation.update_map) for (i = 0; i < 3; i++) - s->prob->segmentid[i] = vp8_rac_get(c) ? vp8_rac_get_uint(c, 8) : 255; + s->prob->segmentid[i] = vp89_rac_get(c) ? vp89_rac_get_uint(c, 8) : 255; } static void update_lf_deltas(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i; for (i = 0; i < 4; i++) { - if (vp8_rac_get(c)) { - s->lf_delta.ref[i] = vp8_rac_get_uint(c, 6); + if (vp89_rac_get(c)) { + s->lf_delta.ref[i] = vp89_rac_get_uint(c, 6); - if (vp8_rac_get(c)) + if (vp89_rac_get(c)) s->lf_delta.ref[i] = -s->lf_delta.ref[i]; } } for (i = MODE_I4x4; i <= VP8_MVMODE_SPLIT; i++) { - if (vp8_rac_get(c)) { - s->lf_delta.mode[i] = vp8_rac_get_uint(c, 6); + if (vp89_rac_get(c)) { + s->lf_delta.mode[i] = vp89_rac_get_uint(c, 6); - if (vp8_rac_get(c)) + if (vp89_rac_get(c)) s->lf_delta.mode[i] = -s->lf_delta.mode[i]; } } @@ -316,7 +342,7 @@ int i; int ret; - s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2); + s->num_coeff_partitions = 1 << vp89_rac_get_uint(&s->c, 2); buf += 3 * (s->num_coeff_partitions - 1); buf_size -= 3 * (s->num_coeff_partitions - 1); @@ -329,7 +355,7 @@ return -1; s->coeff_partition_size[i] = size; - ret = ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size); + ret = ff_vpx_init_range_decoder(&s->coeff_partition[i], buf, size); if (ret < 0) return ret; buf += size; @@ -337,21 +363,21 @@ } s->coeff_partition_size[i] = buf_size; - ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size); + ff_vpx_init_range_decoder(&s->coeff_partition[i], buf, buf_size); return 0; } static void vp7_get_quants(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; - int yac_qi = vp8_rac_get_uint(c, 7); - int ydc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi; - int y2dc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi; - int y2ac_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi; - int uvdc_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi; - int uvac_qi = vp8_rac_get(c) ? vp8_rac_get_uint(c, 7) : yac_qi; + int yac_qi = vp89_rac_get_uint(c, 7); + int ydc_qi = vp89_rac_get(c) ? vp89_rac_get_uint(c, 7) : yac_qi; + int y2dc_qi = vp89_rac_get(c) ? vp89_rac_get_uint(c, 7) : yac_qi; + int y2ac_qi = vp89_rac_get(c) ? vp89_rac_get_uint(c, 7) : yac_qi; + int uvdc_qi = vp89_rac_get(c) ? vp89_rac_get_uint(c, 7) : yac_qi; + int uvac_qi = vp89_rac_get(c) ? vp89_rac_get_uint(c, 7) : yac_qi; s->qmat[0].luma_qmul[0] = vp7_ydc_qlookup[ydc_qi]; s->qmat[0].luma_qmul[1] = vp7_yac_qlookup[yac_qi]; @@ -363,10 +389,10 @@ static void vp8_get_quants(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i, base_qi; - s->quant.yac_qi = vp8_rac_get_uint(c, 7); + s->quant.yac_qi = vp89_rac_get_uint(c, 7); s->quant.ydc_delta = vp8_rac_get_sint(c, 4); s->quant.y2dc_delta = vp8_rac_get_sint(c, 4); s->quant.y2ac_delta = vp8_rac_get_sint(c, 4); @@ -399,28 +425,28 @@ * The spec isn't clear here, so I'm going by my understanding of what libvpx does * * Intra frames update all 3 references - * Inter frames update VP56_FRAME_PREVIOUS if the update_last flag is set + * Inter frames update VP8_FRAME_PREVIOUS if the update_last flag is set * If the update (golden|altref) flag is set, it's updated with the current frame - * if update_last is set, and VP56_FRAME_PREVIOUS otherwise. + * if update_last is set, and VP8_FRAME_PREVIOUS otherwise. * If the flag is not set, the number read means: * 0: no update - * 1: VP56_FRAME_PREVIOUS + * 1: VP8_FRAME_PREVIOUS * 2: update golden with altref, or update altref with golden */ -static VP56Frame ref_to_update(VP8Context *s, int update, VP56Frame ref) +static VP8FrameType ref_to_update(VP8Context *s, int update, VP8FrameType ref) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; if (update) - return VP56_FRAME_CURRENT; + return VP8_FRAME_CURRENT; - switch (vp8_rac_get_uint(c, 2)) { + switch (vp89_rac_get_uint(c, 2)) { case 1: - return VP56_FRAME_PREVIOUS; + return VP8_FRAME_PREVIOUS; case 2: - return (ref == VP56_FRAME_GOLDEN) ? VP56_FRAME_GOLDEN2 : VP56_FRAME_GOLDEN; + return (ref == VP8_FRAME_GOLDEN) ? VP8_FRAME_ALTREF : VP8_FRAME_GOLDEN; } - return VP56_FRAME_NONE; + return VP8_FRAME_NONE; } static void vp78_reset_probability_tables(VP8Context *s) @@ -434,15 +460,15 @@ static void vp78_update_probability_tables(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i, j, k, l, m; for (i = 0; i < 4; i++) for (j = 0; j < 8; j++) for (k = 0; k < 3; k++) for (l = 0; l < NUM_DCT_TOKENS-1; l++) - if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) { - int prob = vp8_rac_get_uint(c, 8); + if (vpx_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) { + int prob = vp89_rac_get_uint(c, 8); for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++) s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob; } @@ -454,35 +480,35 @@ static void vp78_update_pred16x16_pred8x8_mvc_probabilities(VP8Context *s, int mvc_size) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i, j; - if (vp8_rac_get(c)) + if (vp89_rac_get(c)) for (i = 0; i < 4; i++) - s->prob->pred16x16[i] = vp8_rac_get_uint(c, 8); - if (vp8_rac_get(c)) + s->prob->pred16x16[i] = vp89_rac_get_uint(c, 8); + if (vp89_rac_get(c)) for (i = 0; i < 3; i++) - s->prob->pred8x8c[i] = vp8_rac_get_uint(c, 8); + s->prob->pred8x8c[i] = vp89_rac_get_uint(c, 8); // 17.2 MV probability update for (i = 0; i < 2; i++) for (j = 0; j < mvc_size; j++) - if (vp56_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j])) + if (vpx_rac_get_prob_branchy(c, vp8_mv_update_prob[i][j])) s->prob->mvc[i][j] = vp8_rac_get_nn(c); } static void update_refs(VP8Context *s) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; - int update_golden = vp8_rac_get(c); - int update_altref = vp8_rac_get(c); + int update_golden = vp89_rac_get(c); + int update_altref = vp89_rac_get(c); - s->update_golden = ref_to_update(s, update_golden, VP56_FRAME_GOLDEN); - s->update_altref = ref_to_update(s, update_altref, VP56_FRAME_GOLDEN2); + s->update_golden = ref_to_update(s, update_golden, VP8_FRAME_GOLDEN); + s->update_altref = ref_to_update(s, update_altref, VP8_FRAME_ALTREF); } -static void copy_chroma(AVFrame *dst, AVFrame *src, int width, int height) +static void copy_chroma(AVFrame *dst, const AVFrame *src, int width, int height) { int i, j; @@ -516,24 +542,25 @@ if (!s->keyframe && (alpha || beta)) { int width = s->mb_width * 16; int height = s->mb_height * 16; - AVFrame *src, *dst; + const AVFrame *src; + AVFrame *dst; - if (!s->framep[VP56_FRAME_PREVIOUS] || - !s->framep[VP56_FRAME_GOLDEN]) { + if (!s->framep[VP8_FRAME_PREVIOUS] || + !s->framep[VP8_FRAME_GOLDEN]) { av_log(s->avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n"); return AVERROR_INVALIDDATA; } - dst = - src = s->framep[VP56_FRAME_PREVIOUS]->tf.f; + src = + dst = s->framep[VP8_FRAME_PREVIOUS]->tf.f; /* preserve the golden frame, write a new previous frame */ - if (s->framep[VP56_FRAME_GOLDEN] == s->framep[VP56_FRAME_PREVIOUS]) { - s->framep[VP56_FRAME_PREVIOUS] = vp8_find_free_buffer(s); - if ((ret = vp8_alloc_frame(s, s->framep[VP56_FRAME_PREVIOUS], 1)) < 0) + if (s->framep[VP8_FRAME_GOLDEN] == s->framep[VP8_FRAME_PREVIOUS]) { + s->framep[VP8_FRAME_PREVIOUS] = vp8_find_free_buffer(s); + if ((ret = vp8_alloc_frame(s, s->framep[VP8_FRAME_PREVIOUS], 1)) < 0) return ret; - dst = s->framep[VP56_FRAME_PREVIOUS]->tf.f; + dst = s->framep[VP8_FRAME_PREVIOUS]->tf.f; copy_chroma(dst, src, width, height); } @@ -548,12 +575,13 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int part1_size, hscale, vscale, i, j, ret; int width = s->avctx->width; int height = s->avctx->height; int alpha = 0; int beta = 0; + int fade_present = 1; if (buf_size < 4) { return AVERROR_INVALIDDATA; @@ -579,7 +607,7 @@ memcpy(s->put_pixels_tab, s->vp8dsp.put_vp8_epel_pixels_tab, sizeof(s->put_pixels_tab)); - ret = ff_vp56_init_range_decoder(c, buf, part1_size); + ret = ff_vpx_init_range_decoder(c, buf, part1_size); if (ret < 0) return ret; buf += part1_size; @@ -587,14 +615,14 @@ /* A. Dimension information (keyframes only) */ if (s->keyframe) { - width = vp8_rac_get_uint(c, 12); - height = vp8_rac_get_uint(c, 12); - hscale = vp8_rac_get_uint(c, 2); - vscale = vp8_rac_get_uint(c, 2); + width = vp89_rac_get_uint(c, 12); + height = vp89_rac_get_uint(c, 12); + hscale = vp89_rac_get_uint(c, 2); + vscale = vp89_rac_get_uint(c, 2); if (hscale || vscale) avpriv_request_sample(s->avctx, "Upscaling"); - s->update_golden = s->update_altref = VP56_FRAME_CURRENT; + s->update_golden = s->update_altref = VP8_FRAME_CURRENT; vp78_reset_probability_tables(s); memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter, sizeof(s->prob->pred16x16)); @@ -613,18 +641,18 @@ /* B. Decoding information for all four macroblock-level features */ for (i = 0; i < 4; i++) { - s->feature_enabled[i] = vp8_rac_get(c); + s->feature_enabled[i] = vp89_rac_get(c); if (s->feature_enabled[i]) { - s->feature_present_prob[i] = vp8_rac_get_uint(c, 8); + s->feature_present_prob[i] = vp89_rac_get_uint(c, 8); for (j = 0; j < 3; j++) s->feature_index_prob[i][j] = - vp8_rac_get(c) ? vp8_rac_get_uint(c, 8) : 255; + vp89_rac_get(c) ? vp89_rac_get_uint(c, 8) : 255; if (vp7_feature_value_size[s->profile][i]) for (j = 0; j < 4; j++) s->feature_value[i][j] = - vp8_rac_get(c) ? vp8_rac_get_uint(c, vp7_feature_value_size[s->profile][i]) : 0; + vp89_rac_get(c) ? vp89_rac_get_uint(c, vp7_feature_value_size[s->profile][i]) : 0; } } @@ -633,7 +661,7 @@ s->lf_delta.enabled = 0; s->num_coeff_partitions = 1; - ret = ff_vp56_init_range_decoder(&s->coeff_partition[0], buf, buf_size); + ret = ff_vpx_init_range_decoder(&s->coeff_partition[0], buf, buf_size); if (ret < 0) return ret; @@ -649,45 +677,44 @@ /* D. Golden frame update flag (a Flag) for interframes only */ if (!s->keyframe) { - s->update_golden = vp8_rac_get(c) ? VP56_FRAME_CURRENT : VP56_FRAME_NONE; - s->sign_bias[VP56_FRAME_GOLDEN] = 0; + s->update_golden = vp89_rac_get(c) ? VP8_FRAME_CURRENT : VP8_FRAME_NONE; + s->sign_bias[VP8_FRAME_GOLDEN] = 0; } s->update_last = 1; s->update_probabilities = 1; - s->fade_present = 1; if (s->profile > 0) { - s->update_probabilities = vp8_rac_get(c); + s->update_probabilities = vp89_rac_get(c); if (!s->update_probabilities) s->prob[1] = s->prob[0]; if (!s->keyframe) - s->fade_present = vp8_rac_get(c); + fade_present = vp89_rac_get(c); } - if (vpX_rac_is_end(c)) + if (vpx_rac_is_end(c)) return AVERROR_INVALIDDATA; /* E. Fading information for previous frame */ - if (s->fade_present && vp8_rac_get(c)) { - alpha = (int8_t) vp8_rac_get_uint(c, 8); - beta = (int8_t) vp8_rac_get_uint(c, 8); + if (fade_present && vp89_rac_get(c)) { + alpha = (int8_t) vp89_rac_get_uint(c, 8); + beta = (int8_t) vp89_rac_get_uint(c, 8); } /* F. Loop filter type */ if (!s->profile) - s->filter.simple = vp8_rac_get(c); + s->filter.simple = vp89_rac_get(c); /* G. DCT coefficient ordering specification */ - if (vp8_rac_get(c)) + if (vp89_rac_get(c)) for (i = 1; i < 16; i++) - s->prob[0].scan[i] = ff_zigzag_scan[vp8_rac_get_uint(c, 4)]; + s->prob[0].scan[i] = ff_zigzag_scan[vp89_rac_get_uint(c, 4)]; /* H. Loop filter levels */ if (s->profile > 0) - s->filter.simple = vp8_rac_get(c); - s->filter.level = vp8_rac_get_uint(c, 6); - s->filter.sharpness = vp8_rac_get_uint(c, 3); + s->filter.simple = vp89_rac_get(c); + s->filter.level = vp89_rac_get_uint(c, 6); + s->filter.sharpness = vp89_rac_get_uint(c, 3); /* I. DCT coefficient probability update; 13.3 Token Probability Updates */ vp78_update_probability_tables(s); @@ -696,12 +723,12 @@ /* J. The remaining frame header data occurs ONLY FOR INTERFRAMES */ if (!s->keyframe) { - s->prob->intra = vp8_rac_get_uint(c, 8); - s->prob->last = vp8_rac_get_uint(c, 8); + s->prob->intra = vp89_rac_get_uint(c, 8); + s->prob->last = vp89_rac_get_uint(c, 8); vp78_update_pred16x16_pred8x8_mvc_probabilities(s, VP7_MVC_SIZE); } - if (vpX_rac_is_end(c)) + if (vpx_rac_is_end(c)) return AVERROR_INVALIDDATA; if ((ret = vp7_fade_frame(s, alpha, beta)) < 0) @@ -712,7 +739,7 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int header_size, hscale, vscale, ret; int width = s->avctx->width; int height = s->avctx->height; @@ -762,7 +789,7 @@ if (hscale || vscale) avpriv_request_sample(s->avctx, "Upscaling"); - s->update_golden = s->update_altref = VP56_FRAME_CURRENT; + s->update_golden = s->update_altref = VP8_FRAME_CURRENT; vp78_reset_probability_tables(s); memcpy(s->prob->pred16x16, vp8_pred16x16_prob_inter, sizeof(s->prob->pred16x16)); @@ -774,30 +801,30 @@ memset(&s->lf_delta, 0, sizeof(s->lf_delta)); } - ret = ff_vp56_init_range_decoder(c, buf, header_size); + ret = ff_vpx_init_range_decoder(c, buf, header_size); if (ret < 0) return ret; buf += header_size; buf_size -= header_size; if (s->keyframe) { - s->colorspace = vp8_rac_get(c); + s->colorspace = vp89_rac_get(c); if (s->colorspace) av_log(s->avctx, AV_LOG_WARNING, "Unspecified colorspace\n"); - s->fullrange = vp8_rac_get(c); + s->fullrange = vp89_rac_get(c); } - if ((s->segmentation.enabled = vp8_rac_get(c))) + if ((s->segmentation.enabled = vp89_rac_get(c))) parse_segment_info(s); else s->segmentation.update_map = 0; // FIXME: move this to some init function? - s->filter.simple = vp8_rac_get(c); - s->filter.level = vp8_rac_get_uint(c, 6); - s->filter.sharpness = vp8_rac_get_uint(c, 3); + s->filter.simple = vp89_rac_get(c); + s->filter.level = vp89_rac_get_uint(c, 6); + s->filter.sharpness = vp89_rac_get_uint(c, 3); - if ((s->lf_delta.enabled = vp8_rac_get(c))) { - s->lf_delta.update = vp8_rac_get(c); + if ((s->lf_delta.enabled = vp89_rac_get(c))) { + s->lf_delta.update = vp89_rac_get(c); if (s->lf_delta.update) update_lf_deltas(s); } @@ -817,31 +844,31 @@ if (!s->keyframe) { update_refs(s); - s->sign_bias[VP56_FRAME_GOLDEN] = vp8_rac_get(c); - s->sign_bias[VP56_FRAME_GOLDEN2 /* altref */] = vp8_rac_get(c); + s->sign_bias[VP8_FRAME_GOLDEN] = vp89_rac_get(c); + s->sign_bias[VP8_FRAME_ALTREF] = vp89_rac_get(c); } // if we aren't saving this frame's probabilities for future frames, // make a copy of the current probabilities - if (!(s->update_probabilities = vp8_rac_get(c))) + if (!(s->update_probabilities = vp89_rac_get(c))) s->prob[1] = s->prob[0]; - s->update_last = s->keyframe || vp8_rac_get(c); + s->update_last = s->keyframe || vp89_rac_get(c); vp78_update_probability_tables(s); - if ((s->mbskip_enabled = vp8_rac_get(c))) - s->prob->mbskip = vp8_rac_get_uint(c, 8); + if ((s->mbskip_enabled = vp89_rac_get(c))) + s->prob->mbskip = vp89_rac_get_uint(c, 8); if (!s->keyframe) { - s->prob->intra = vp8_rac_get_uint(c, 8); - s->prob->last = vp8_rac_get_uint(c, 8); - s->prob->golden = vp8_rac_get_uint(c, 8); + s->prob->intra = vp89_rac_get_uint(c, 8); + s->prob->last = vp89_rac_get_uint(c, 8); + s->prob->golden = vp89_rac_get_uint(c, 8); vp78_update_pred16x16_pred8x8_mvc_probabilities(s, VP8_MVC_SIZE); } // Record the entropy coder state here so that hwaccels can use it. - s->c.code_word = vp56_rac_renorm(&s->c); + s->c.code_word = vpx_rac_renorm(&s->c); s->coder_state_at_header_end.input = s->c.buffer - (-s->c.bits / 8); s->coder_state_at_header_end.range = s->c.high; s->coder_state_at_header_end.value = s->c.code_word >> 16; @@ -851,7 +878,7 @@ } static av_always_inline -void clamp_mv(VP8mvbounds *s, VP56mv *dst, const VP56mv *src) +void clamp_mv(const VP8mvbounds *s, VP8mv *dst, const VP8mv *src) { dst->x = av_clip(src->x, av_clip(s->mv_min.x, INT16_MIN, INT16_MAX), av_clip(s->mv_max.x, INT16_MIN, INT16_MAX)); @@ -862,40 +889,40 @@ /** * Motion vector coding, 17.1. */ -static av_always_inline int read_mv_component(VP56RangeCoder *c, const uint8_t *p, int vp7) +static av_always_inline int read_mv_component(VPXRangeCoder *c, const uint8_t *p, int vp7) { int bit, x = 0; - if (vp56_rac_get_prob_branchy(c, p[0])) { + if (vpx_rac_get_prob_branchy(c, p[0])) { int i; for (i = 0; i < 3; i++) - x += vp56_rac_get_prob(c, p[9 + i]) << i; + x += vpx_rac_get_prob(c, p[9 + i]) << i; for (i = (vp7 ? 7 : 9); i > 3; i--) - x += vp56_rac_get_prob(c, p[9 + i]) << i; - if (!(x & (vp7 ? 0xF0 : 0xFFF0)) || vp56_rac_get_prob(c, p[12])) + x += vpx_rac_get_prob(c, p[9 + i]) << i; + if (!(x & (vp7 ? 0xF0 : 0xFFF0)) || vpx_rac_get_prob(c, p[12])) x += 8; } else { // small_mvtree const uint8_t *ps = p + 2; - bit = vp56_rac_get_prob(c, *ps); + bit = vpx_rac_get_prob(c, *ps); ps += 1 + 3 * bit; x += 4 * bit; - bit = vp56_rac_get_prob(c, *ps); + bit = vpx_rac_get_prob(c, *ps); ps += 1 + bit; x += 2 * bit; - x += vp56_rac_get_prob(c, *ps); + x += vpx_rac_get_prob(c, *ps); } - return (x && vp56_rac_get_prob(c, p[1])) ? -x : x; + return (x && vpx_rac_get_prob(c, p[1])) ? -x : x; } -static int vp7_read_mv_component(VP56RangeCoder *c, const uint8_t *p) +static int vp7_read_mv_component(VPXRangeCoder *c, const uint8_t *p) { return read_mv_component(c, p, 1); } -static int vp8_read_mv_component(VP56RangeCoder *c, const uint8_t *p) +static int vp8_read_mv_component(VPXRangeCoder *c, const uint8_t *p) { return read_mv_component(c, p, 0); } @@ -918,18 +945,18 @@ * @returns the number of motion vectors parsed (2, 4 or 16) */ static av_always_inline -int decode_splitmvs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, +int decode_splitmvs(const VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb, int layout, int is_vp7) { int part_idx; int n, num; - VP8Macroblock *top_mb; - VP8Macroblock *left_mb = &mb[-1]; + const VP8Macroblock *top_mb; + const VP8Macroblock *left_mb = &mb[-1]; const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning]; const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx; - VP56mv *top_mv; - VP56mv *left_mv = left_mb->bmv; - VP56mv *cur_mv = mb->bmv; + const VP8mv *top_mv; + const VP8mv *left_mv = left_mb->bmv; + const VP8mv *cur_mv = mb->bmv; if (!layout) // layout is inlined, s->mb_layout is not top_mb = &mb[2]; @@ -938,9 +965,9 @@ mbsplits_top = vp8_mbsplits[top_mb->partitioning]; top_mv = top_mb->bmv; - if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[0])) { - if (vp56_rac_get_prob_branchy(c, vp8_mbsplit_prob[1])) - part_idx = VP8_SPLITMVMODE_16x8 + vp56_rac_get_prob(c, vp8_mbsplit_prob[2]); + if (vpx_rac_get_prob_branchy(c, vp8_mbsplit_prob[0])) { + if (vpx_rac_get_prob_branchy(c, vp8_mbsplit_prob[1])) + part_idx = VP8_SPLITMVMODE_16x8 + vpx_rac_get_prob(c, vp8_mbsplit_prob[2]); else part_idx = VP8_SPLITMVMODE_8x8; } else { @@ -968,9 +995,9 @@ submv_prob = get_submv_prob(left, above, is_vp7); - if (vp56_rac_get_prob_branchy(c, submv_prob[0])) { - if (vp56_rac_get_prob_branchy(c, submv_prob[1])) { - if (vp56_rac_get_prob_branchy(c, submv_prob[2])) { + if (vpx_rac_get_prob_branchy(c, submv_prob[0])) { + if (vpx_rac_get_prob_branchy(c, submv_prob[1])) { + if (vpx_rac_get_prob_branchy(c, submv_prob[2])) { mb->bmv[n].y = mb->mv.y + read_mv_component(c, s->prob->mvc[0], is_vp7); mb->bmv[n].x = mb->mv.x + @@ -1013,7 +1040,7 @@ return 1; } -static const VP56mv *get_bmv_ptr(const VP8Macroblock *mb, int subblock) +static const VP8mv *get_bmv_ptr(const VP8Macroblock *mb, int subblock) { return &mb->bmv[mb->mode == VP8_MVMODE_SPLIT ? vp8_mbsplits[mb->partitioning][subblock] : 0]; } @@ -1022,13 +1049,12 @@ void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout) { - VP8Macroblock *mb_edge[12]; enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR }; enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT }; int idx = CNT_ZERO; - VP56mv near_mv[3]; + VP8mv near_mv[3]; uint8_t cnt[3] = { 0 }; - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; int i; AV_ZERO32(&near_mv[0]); @@ -1041,11 +1067,11 @@ if (vp7_calculate_mb_offset(mb_x, mb_y, s->mb_width, pred->xoffset, pred->yoffset, !s->profile, &edge_x, &edge_y)) { - VP8Macroblock *edge = mb_edge[i] = (s->mb_layout == 1) - ? s->macroblocks_base + 1 + edge_x + - (s->mb_width + 1) * (edge_y + 1) - : s->macroblocks + edge_x + - (s->mb_height - edge_y - 1) * 2; + const VP8Macroblock *edge = (s->mb_layout == 1) + ? s->macroblocks_base + 1 + edge_x + + (s->mb_width + 1) * (edge_y + 1) + : s->macroblocks + edge_x + + (s->mb_height - edge_y - 1) * 2; uint32_t mv = AV_RN32A(get_bmv_ptr(edge, vp7_mv_pred[i].subblock)); if (mv) { if (AV_RN32A(&near_mv[CNT_NEAREST])) { @@ -1074,19 +1100,19 @@ mb->partitioning = VP8_SPLITMVMODE_NONE; - if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_ZERO]][0])) { + if (vpx_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_ZERO]][0])) { mb->mode = VP8_MVMODE_MV; - if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAREST]][1])) { + if (vpx_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAREST]][1])) { - if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][2])) { + if (vpx_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][2])) { if (cnt[CNT_NEAREST] > cnt[CNT_NEAR]) AV_WN32A(&mb->mv, cnt[CNT_ZERO] > cnt[CNT_NEAREST] ? 0 : AV_RN32A(&near_mv[CNT_NEAREST])); else AV_WN32A(&mb->mv, cnt[CNT_ZERO] > cnt[CNT_NEAR] ? 0 : AV_RN32A(&near_mv[CNT_NEAR])); - if (vp56_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][3])) { + if (vpx_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][3])) { mb->mode = VP8_MVMODE_SPLIT; mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout, IS_VP7) - 1]; } else { @@ -1110,7 +1136,7 @@ } static av_always_inline -void vp8_decode_mvs(VP8Context *s, VP8mvbounds *mv_bounds, VP8Macroblock *mb, +void vp8_decode_mvs(VP8Context *s, const VP8mvbounds *mv_bounds, VP8Macroblock *mb, int mb_x, int mb_y, int layout) { VP8Macroblock *mb_edge[3] = { 0 /* top */, @@ -1120,10 +1146,10 @@ enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT }; int idx = CNT_ZERO; int cur_sign_bias = s->sign_bias[mb->ref_frame]; - int8_t *sign_bias = s->sign_bias; - VP56mv near_mv[4]; + const int8_t *sign_bias = s->sign_bias; + VP8mv near_mv[4]; uint8_t cnt[4] = { 0 }; - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; if (!layout) { // layout is inlined (s->mb_layout is not) mb_edge[0] = mb + 2; @@ -1140,9 +1166,9 @@ /* Process MB on top, left and top-left */ #define MV_EDGE_CHECK(n) \ { \ - VP8Macroblock *edge = mb_edge[n]; \ + const VP8Macroblock *edge = mb_edge[n]; \ int edge_ref = edge->ref_frame; \ - if (edge_ref != VP56_FRAME_CURRENT) { \ + if (edge_ref != VP8_FRAME_CURRENT) { \ uint32_t mv = AV_RN32A(&edge->mv); \ if (mv) { \ if (cur_sign_bias != sign_bias[edge_ref]) { \ @@ -1164,7 +1190,7 @@ MV_EDGE_CHECK(2) mb->partitioning = VP8_SPLITMVMODE_NONE; - if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_ZERO]][0])) { + if (vpx_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_ZERO]][0])) { mb->mode = VP8_MVMODE_MV; /* If we have three distinct MVs, merge first and last if they're the same */ @@ -1175,18 +1201,18 @@ /* Swap near and nearest if necessary */ if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) { FFSWAP(uint8_t, cnt[CNT_NEAREST], cnt[CNT_NEAR]); - FFSWAP( VP56mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]); + FFSWAP(VP8mv, near_mv[CNT_NEAREST], near_mv[CNT_NEAR]); } - if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAREST]][1])) { - if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAR]][2])) { + if (vpx_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAREST]][1])) { + if (vpx_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_NEAR]][2])) { /* Choose the best mv out of 0,0 and the nearest mv */ clamp_mv(mv_bounds, &mb->mv, &near_mv[CNT_ZERO + (cnt[CNT_NEAREST] >= cnt[CNT_ZERO])]); cnt[CNT_SPLITMV] = ((mb_edge[VP8_EDGE_LEFT]->mode == VP8_MVMODE_SPLIT) + (mb_edge[VP8_EDGE_TOP]->mode == VP8_MVMODE_SPLIT)) * 2 + (mb_edge[VP8_EDGE_TOPLEFT]->mode == VP8_MVMODE_SPLIT); - if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_SPLITMV]][3])) { + if (vpx_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[CNT_SPLITMV]][3])) { mb->mode = VP8_MVMODE_SPLIT; mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout, IS_VP8) - 1]; } else { @@ -1210,7 +1236,7 @@ } static av_always_inline -void decode_intra4x4_modes(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, +void decode_intra4x4_modes(VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb, int mb_x, int keyframe, int layout) { uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb; @@ -1231,7 +1257,7 @@ for (x = 0; x < 4; x++) { const uint8_t *ctx; ctx = vp8_pred4x4_prob_intra[top[x]][left[y]]; - *intra4x4 = vp8_rac_get_tree(c, vp8_pred4x4_tree, ctx); + *intra4x4 = vp89_rac_get_tree(c, vp8_pred4x4_tree, ctx); left[y] = top[x] = *intra4x4; intra4x4++; } @@ -1239,17 +1265,17 @@ } else { int i; for (i = 0; i < 16; i++) - intra4x4[i] = vp8_rac_get_tree(c, vp8_pred4x4_tree, - vp8_pred4x4_prob_inter); + intra4x4[i] = vp89_rac_get_tree(c, vp8_pred4x4_tree, + vp8_pred4x4_prob_inter); } } static av_always_inline -void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds, +void decode_mb_mode(VP8Context *s, const VP8mvbounds *mv_bounds, VP8Macroblock *mb, int mb_x, int mb_y, - uint8_t *segment, uint8_t *ref, int layout, int is_vp7) + uint8_t *segment, const uint8_t *ref, int layout, int is_vp7) { - VP56RangeCoder *c = &s->c; + VPXRangeCoder *c = &s->c; static const char * const vp7_feature_name[] = { "q-index", "lf-delta", "partial-golden-update", @@ -1259,9 +1285,9 @@ *segment = 0; for (i = 0; i < 4; i++) { if (s->feature_enabled[i]) { - if (vp56_rac_get_prob_branchy(c, s->feature_present_prob[i])) { - int index = vp8_rac_get_tree(c, vp7_feature_index_tree, - s->feature_index_prob[i]); + if (vpx_rac_get_prob_branchy(c, s->feature_present_prob[i])) { + int index = vp89_rac_get_tree(c, vp7_feature_index_tree, + s->feature_index_prob[i]); av_log(s->avctx, AV_LOG_WARNING, "Feature %s present in macroblock (value 0x%x)\n", vp7_feature_name[i], s->feature_value[i][index]); @@ -1269,17 +1295,17 @@ } } } else if (s->segmentation.update_map) { - int bit = vp56_rac_get_prob(c, s->prob->segmentid[0]); - *segment = vp56_rac_get_prob(c, s->prob->segmentid[1+bit]) + 2*bit; + int bit = vpx_rac_get_prob(c, s->prob->segmentid[0]); + *segment = vpx_rac_get_prob(c, s->prob->segmentid[1+bit]) + 2*bit; } else if (s->segmentation.enabled) *segment = ref ? *ref : *segment; mb->segment = *segment; - mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0; + mb->skip = s->mbskip_enabled ? vpx_rac_get_prob(c, s->prob->mbskip) : 0; if (s->keyframe) { - mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, - vp8_pred16x16_prob_intra); + mb->mode = vp89_rac_get_tree(c, vp8_pred16x16_tree_intra, + vp8_pred16x16_prob_intra); if (mb->mode == MODE_I4x4) { decode_intra4x4_modes(s, c, mb, mb_x, 1, layout); @@ -1293,17 +1319,17 @@ AV_WN32A(s->intra4x4_pred_mode_left, modes); } - mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, - vp8_pred8x8c_prob_intra); - mb->ref_frame = VP56_FRAME_CURRENT; - } else if (vp56_rac_get_prob_branchy(c, s->prob->intra)) { + mb->chroma_pred_mode = vp89_rac_get_tree(c, vp8_pred8x8c_tree, + vp8_pred8x8c_prob_intra); + mb->ref_frame = VP8_FRAME_CURRENT; + } else if (vpx_rac_get_prob_branchy(c, s->prob->intra)) { // inter MB, 16.2 - if (vp56_rac_get_prob_branchy(c, s->prob->last)) + if (vpx_rac_get_prob_branchy(c, s->prob->last)) mb->ref_frame = - (!is_vp7 && vp56_rac_get_prob(c, s->prob->golden)) ? VP56_FRAME_GOLDEN2 /* altref */ - : VP56_FRAME_GOLDEN; + (!is_vp7 && vpx_rac_get_prob(c, s->prob->golden)) ? VP8_FRAME_ALTREF + : VP8_FRAME_GOLDEN; else - mb->ref_frame = VP56_FRAME_PREVIOUS; + mb->ref_frame = VP8_FRAME_PREVIOUS; s->ref_count[mb->ref_frame - 1]++; // motion vectors, 16.3 @@ -1313,14 +1339,15 @@ vp8_decode_mvs(s, mv_bounds, mb, mb_x, mb_y, layout); } else { // intra MB, 16.1 - mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_inter, s->prob->pred16x16); + mb->mode = vp89_rac_get_tree(c, vp8_pred16x16_tree_inter, + s->prob->pred16x16); if (mb->mode == MODE_I4x4) decode_intra4x4_modes(s, c, mb, mb_x, 0, layout); - mb->chroma_pred_mode = vp8_rac_get_tree(c, vp8_pred8x8c_tree, - s->prob->pred8x8c); - mb->ref_frame = VP56_FRAME_CURRENT; + mb->chroma_pred_mode = vp89_rac_get_tree(c, vp8_pred8x8c_tree, + s->prob->pred8x8c); + mb->ref_frame = VP8_FRAME_CURRENT; mb->partitioning = VP8_SPLITMVMODE_NONE; AV_ZERO32(&mb->bmv[0]); } @@ -1337,21 +1364,21 @@ * otherwise, the index of the last coeff decoded plus one */ static av_always_inline -int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16], +int decode_block_coeffs_internal(VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], - int i, uint8_t *token_prob, int16_t qmul[2], + int i, const uint8_t *token_prob, const int16_t qmul[2], const uint8_t scan[16], int vp7) { - VP56RangeCoder c = *r; + VPXRangeCoder c = *r; goto skip_eob; do { int coeff; restart: - if (!vp56_rac_get_prob_branchy(&c, token_prob[0])) // DCT_EOB + if (!vpx_rac_get_prob_branchy(&c, token_prob[0])) // DCT_EOB break; skip_eob: - if (!vp56_rac_get_prob_branchy(&c, token_prob[1])) { // DCT_0 + if (!vpx_rac_get_prob_branchy(&c, token_prob[1])) { // DCT_0 if (++i == 16) break; // invalid input; blocks should end with EOB token_prob = probs[i][0]; @@ -1360,28 +1387,28 @@ goto skip_eob; } - if (!vp56_rac_get_prob_branchy(&c, token_prob[2])) { // DCT_1 + if (!vpx_rac_get_prob_branchy(&c, token_prob[2])) { // DCT_1 coeff = 1; token_prob = probs[i + 1][1]; } else { - if (!vp56_rac_get_prob_branchy(&c, token_prob[3])) { // DCT 2,3,4 - coeff = vp56_rac_get_prob_branchy(&c, token_prob[4]); + if (!vpx_rac_get_prob_branchy(&c, token_prob[3])) { // DCT 2,3,4 + coeff = vpx_rac_get_prob_branchy(&c, token_prob[4]); if (coeff) - coeff += vp56_rac_get_prob(&c, token_prob[5]); + coeff += vpx_rac_get_prob(&c, token_prob[5]); coeff += 2; } else { // DCT_CAT* - if (!vp56_rac_get_prob_branchy(&c, token_prob[6])) { - if (!vp56_rac_get_prob_branchy(&c, token_prob[7])) { // DCT_CAT1 - coeff = 5 + vp56_rac_get_prob(&c, vp8_dct_cat1_prob[0]); + if (!vpx_rac_get_prob_branchy(&c, token_prob[6])) { + if (!vpx_rac_get_prob_branchy(&c, token_prob[7])) { // DCT_CAT1 + coeff = 5 + vpx_rac_get_prob(&c, vp8_dct_cat1_prob[0]); } else { // DCT_CAT2 coeff = 7; - coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[0]) << 1; - coeff += vp56_rac_get_prob(&c, vp8_dct_cat2_prob[1]); + coeff += vpx_rac_get_prob(&c, vp8_dct_cat2_prob[0]) << 1; + coeff += vpx_rac_get_prob(&c, vp8_dct_cat2_prob[1]); } } else { // DCT_CAT3 and up - int a = vp56_rac_get_prob(&c, token_prob[8]); - int b = vp56_rac_get_prob(&c, token_prob[9 + a]); + int a = vpx_rac_get_prob(&c, token_prob[8]); + int b = vpx_rac_get_prob(&c, token_prob[9 + a]); int cat = (a << 1) + b; coeff = 3 + (8 << cat); coeff += vp8_rac_get_coeff(&c, ff_vp8_dct_cat_prob[cat]); @@ -1389,7 +1416,7 @@ } token_prob = probs[i + 1][2]; } - block[scan[i]] = (vp8_rac_get(&c) ? -coeff : coeff) * qmul[!!i]; + block[scan[i]] = (vp89_rac_get(&c) ? -coeff : coeff) * qmul[!!i]; } while (++i < 16); *r = c; @@ -1419,11 +1446,11 @@ return ret; } -static int vp7_decode_block_coeffs_internal(VP56RangeCoder *r, +static int vp7_decode_block_coeffs_internal(VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], - int i, uint8_t *token_prob, - int16_t qmul[2], + int i, const uint8_t *token_prob, + const int16_t qmul[2], const uint8_t scan[16]) { return decode_block_coeffs_internal(r, block, probs, i, @@ -1431,11 +1458,11 @@ } #ifndef vp8_decode_block_coeffs_internal -static int vp8_decode_block_coeffs_internal(VP56RangeCoder *r, +static int vp8_decode_block_coeffs_internal(VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], - int i, uint8_t *token_prob, - int16_t qmul[2]) + int i, const uint8_t *token_prob, + const int16_t qmul[2]) { return decode_block_coeffs_internal(r, block, probs, i, token_prob, qmul, ff_zigzag_scan, IS_VP8); @@ -1456,13 +1483,13 @@ * otherwise, the index of the last coeff decoded plus one */ static av_always_inline -int decode_block_coeffs(VP56RangeCoder *c, int16_t block[16], +int decode_block_coeffs(VPXRangeCoder *c, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], - int i, int zero_nhood, int16_t qmul[2], + int i, int zero_nhood, const int16_t qmul[2], const uint8_t scan[16], int vp7) { - uint8_t *token_prob = probs[i][zero_nhood]; - if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB + const uint8_t *token_prob = probs[i][zero_nhood]; + if (!vpx_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB return 0; return vp7 ? vp7_decode_block_coeffs_internal(c, block, probs, i, token_prob, qmul, scan) @@ -1471,7 +1498,7 @@ } static av_always_inline -void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VP56RangeCoder *c, +void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VPXRangeCoder *c, VP8Macroblock *mb, uint8_t t_nnz[9], uint8_t l_nnz[9], int is_vp7) { @@ -1546,8 +1573,8 @@ } static av_always_inline -void backup_mb_border(uint8_t *top_border, uint8_t *src_y, - uint8_t *src_cb, uint8_t *src_cr, +void backup_mb_border(uint8_t *top_border, const uint8_t *src_y, + const uint8_t *src_cb, const uint8_t *src_cr, ptrdiff_t linesize, ptrdiff_t uvlinesize, int simple) { AV_COPY128(top_border, src_y + 15 * linesize); @@ -1672,7 +1699,7 @@ } static av_always_inline -void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], +void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7) { int x, y, mode, nnz; @@ -1690,14 +1717,14 @@ s->hpc.pred16x16[mode](dst[0], s->linesize); } else { uint8_t *ptr = dst[0]; - uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb; + const uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb; const uint8_t lo = is_vp7 ? 128 : 127; const uint8_t hi = is_vp7 ? 128 : 129; - uint8_t tr_top[4] = { lo, lo, lo, lo }; + const uint8_t tr_top[4] = { lo, lo, lo, lo }; // all blocks on the right edge of the macroblock use bottom edge // the top macroblock for their topright edge - uint8_t *tr_right = ptr - s->linesize + 16; + const uint8_t *tr_right = ptr - s->linesize + 16; // if we're on the right edge of the frame, said edge is extended // from the top macroblock @@ -1710,7 +1737,7 @@ AV_ZERO128(td->non_zero_count_cache); for (y = 0; y < 4; y++) { - uint8_t *topright = ptr + 4 - s->linesize; + const uint8_t *topright = ptr + 4 - s->linesize; for (x = 0; x < 4; x++) { int copy = 0; ptrdiff_t linesize = s->linesize; @@ -1811,12 +1838,12 @@ */ static av_always_inline void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst, - ThreadFrame *ref, const VP56mv *mv, + const ThreadFrame *ref, const VP8mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) { - uint8_t *src = ref->f->data[0]; + const uint8_t *src = ref->f->data[0]; if (AV_RN32A(mv)) { ptrdiff_t src_linesize = linesize; @@ -1869,12 +1896,12 @@ */ static av_always_inline void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, - uint8_t *dst2, ThreadFrame *ref, const VP56mv *mv, + uint8_t *dst2, const ThreadFrame *ref, const VP8mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) { - uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2]; + const uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2]; if (AV_RN32A(mv)) { int mx = mv->x & 7, mx_idx = subpel_idx[0][mx]; @@ -1918,12 +1945,12 @@ } static av_always_inline -void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], - ThreadFrame *ref_frame, int x_off, int y_off, +void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], + const ThreadFrame *ref_frame, int x_off, int y_off, int bx_off, int by_off, int block_w, int block_h, - int width, int height, VP56mv *mv) + int width, int height, const VP8mv *mv) { - VP56mv uvmv = *mv; + VP8mv uvmv = *mv; /* Y */ vp8_mc_luma(s, td, dst[0] + by_off * s->linesize + bx_off, @@ -1956,8 +1983,8 @@ /* Fetch pixels for estimated mv 4 macroblocks ahead. * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */ static av_always_inline -void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, - int mb_xy, int ref) +void prefetch_motion(const VP8Context *s, const VP8Macroblock *mb, + int mb_x, int mb_y, int mb_xy, int ref) { /* Don't prefetch refs that haven't been used very often this frame. */ if (s->ref_count[ref - 1] > (mb_xy >> 5)) { @@ -1979,13 +2006,13 @@ * Apply motion vectors to prediction buffer, chapter 18. */ static av_always_inline -void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], +void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], VP8Macroblock *mb, int mb_x, int mb_y) { int x_off = mb_x << 4, y_off = mb_y << 4; int width = 16 * s->mb_width, height = 16 * s->mb_height; - ThreadFrame *ref = &s->framep[mb->ref_frame]->tf; - VP56mv *bmv = mb->bmv; + const ThreadFrame *ref = &s->framep[mb->ref_frame]->tf; + const VP8mv *bmv = mb->bmv; switch (mb->partitioning) { case VP8_SPLITMVMODE_NONE: @@ -1994,7 +2021,7 @@ break; case VP8_SPLITMVMODE_4x4: { int x, y; - VP56mv uvmv; + VP8mv uvmv; /* Y */ for (y = 0; y < 4; y++) { @@ -2063,7 +2090,8 @@ } static av_always_inline -void idct_mb(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], VP8Macroblock *mb) +void idct_mb(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], + const VP8Macroblock *mb) { int x, y, ch; @@ -2125,7 +2153,7 @@ } static av_always_inline -void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, +void filter_level_for_mb(const VP8Context *s, const VP8Macroblock *mb, VP8FilterStrength *f, int is_vp7) { int interior_limit, filter_level; @@ -2158,7 +2186,7 @@ } static av_always_inline -void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, +void filter_mb(const VP8Context *s, uint8_t *const dst[3], const VP8FilterStrength *f, int mb_x, int mb_y, int is_vp7) { int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh; @@ -2245,7 +2273,7 @@ } static av_always_inline -void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f, +void filter_mb_simple(const VP8Context *s, uint8_t *dst, const VP8FilterStrength *f, int mb_x, int mb_y) { int mbedge_lim, bedge_lim; @@ -2280,7 +2308,7 @@ #define MARGIN (16 << 2) static av_always_inline int vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe, - VP8Frame *prev_frame, int is_vp7) + const VP8Frame *prev_frame, int is_vp7) { VP8Context *s = avctx->priv_data; int mb_x, mb_y; @@ -2298,7 +2326,7 @@ s->mv_bounds.mv_max.x = ((s->mb_width - 1) << 6) + MARGIN; for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) { - if (vpX_rac_is_end(&s->c)) { + if (vpx_rac_is_end(&s->c)) { return AVERROR_INVALIDDATA; } if (mb_y == 0) @@ -2317,13 +2345,13 @@ } static int vp7_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame, - VP8Frame *prev_frame) + const VP8Frame *prev_frame) { return vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP7); } static int vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame, - VP8Frame *prev_frame) + const VP8Frame *prev_frame) { return vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP8); } @@ -2374,8 +2402,10 @@ int mb_y = atomic_load(&td->thread_mb_pos) >> 16; int mb_x, mb_xy = mb_y * s->mb_width; int num_jobs = s->num_jobs; - VP8Frame *curframe = s->curframe, *prev_frame = s->prev_frame; - VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions - 1)]; + const VP8Frame *prev_frame = s->prev_frame; + VP8Frame *curframe = s->curframe; + VPXRangeCoder *coeff_c = &s->coeff_partition[mb_y & (s->num_coeff_partitions - 1)]; + VP8Macroblock *mb; uint8_t *dst[3] = { curframe->tf.f->data[0] + 16 * mb_y * s->linesize, @@ -2383,7 +2413,7 @@ curframe->tf.f->data[2] + 8 * mb_y * s->uvlinesize }; - if (vpX_rac_is_end(c)) + if (vpx_rac_is_end(&s->c)) return AVERROR_INVALIDDATA; if (mb_y == 0) @@ -2414,7 +2444,7 @@ td->mv_bounds.mv_max.x = ((s->mb_width - 1) << 6) + MARGIN; for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) { - if (vpX_rac_is_end(c)) + if (vpx_rac_is_end(&s->c)) return AVERROR_INVALIDDATA; // Wait for previous thread to read mb_x+2, and reach mb_y-1. if (prev_td != td) { @@ -2439,17 +2469,20 @@ prev_frame && prev_frame->seg_map ? prev_frame->seg_map->data + mb_xy : NULL, 0, is_vp7); - prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_PREVIOUS); + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_PREVIOUS); - if (!mb->skip) - decode_mb_coeffs(s, td, c, mb, s->top_nnz[mb_x], td->left_nnz, is_vp7); + if (!mb->skip) { + if (vpx_rac_is_end(coeff_c)) + return AVERROR_INVALIDDATA; + decode_mb_coeffs(s, td, coeff_c, mb, s->top_nnz[mb_x], td->left_nnz, is_vp7); + } if (mb->mode <= MODE_I4x4) intra_predict(s, td, dst, mb, mb_x, mb_y, is_vp7); else inter_predict(s, td, dst, mb, mb_x, mb_y); - prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN); + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_GOLDEN); if (!mb->skip) { idct_mb(s, td, dst, mb); @@ -2477,7 +2510,7 @@ dst[1], dst[2], s->linesize, s->uvlinesize, 0); } - prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_GOLDEN2); + prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_ALTREF); dst[0] += 16; dst[1] += 8; @@ -2536,7 +2569,7 @@ next_td = &s->thread_data[(jobnr + 1) % num_jobs]; for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) { - VP8FilterStrength *f = &td->filter_strength[mb_x]; + const VP8FilterStrength *f = &td->filter_strength[mb_x]; if (prev_td != td) check_thread_pos(td, prev_td, (mb_x + 1) + (s->mb_width + 3), mb_y - 1); @@ -2581,7 +2614,7 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) { - VP8Context *s = avctx->priv_data; + const VP8Context *s = avctx->priv_data; VP8ThreadData *td = &s->thread_data[jobnr]; VP8ThreadData *next_td = NULL, *prev_td = NULL; VP8Frame *curframe = s->curframe; @@ -2652,10 +2685,10 @@ avctx->pix_fmt = s->pix_fmt; } - prev_frame = s->framep[VP56_FRAME_CURRENT]; + prev_frame = s->framep[VP8_FRAME_CURRENT]; - referenced = s->update_last || s->update_golden == VP56_FRAME_CURRENT || - s->update_altref == VP56_FRAME_CURRENT; + referenced = s->update_last || s->update_golden == VP8_FRAME_CURRENT || + s->update_altref == VP8_FRAME_CURRENT; skip_thresh = !referenced ? AVDISCARD_NONREF : !s->keyframe ? AVDISCARD_NONKEY @@ -2672,12 +2705,12 @@ for (i = 0; i < 5; i++) if (s->frames[i].tf.f->buf[0] && &s->frames[i] != prev_frame && - &s->frames[i] != s->framep[VP56_FRAME_PREVIOUS] && - &s->frames[i] != s->framep[VP56_FRAME_GOLDEN] && - &s->frames[i] != s->framep[VP56_FRAME_GOLDEN2]) + &s->frames[i] != s->framep[VP8_FRAME_PREVIOUS] && + &s->frames[i] != s->framep[VP8_FRAME_GOLDEN] && + &s->frames[i] != s->framep[VP8_FRAME_ALTREF]) vp8_release_frame(s, &s->frames[i]); - curframe = s->framep[VP56_FRAME_CURRENT] = vp8_find_free_buffer(s); + curframe = s->framep[VP8_FRAME_CURRENT] = vp8_find_free_buffer(s); if (!s->colorspace) avctx->colorspace = AVCOL_SPC_BT470BG; @@ -2690,9 +2723,9 @@ * likely that the values we have on a random interframe are complete * junk if we didn't start decode on a keyframe. So just don't display * anything rather than junk. */ - if (!s->keyframe && (!s->framep[VP56_FRAME_PREVIOUS] || - !s->framep[VP56_FRAME_GOLDEN] || - !s->framep[VP56_FRAME_GOLDEN2])) { + if (!s->keyframe && (!s->framep[VP8_FRAME_PREVIOUS] || + !s->framep[VP8_FRAME_GOLDEN] || + !s->framep[VP8_FRAME_ALTREF])) { av_log(avctx, AV_LOG_WARNING, "Discarding interframe without a prior keyframe!\n"); ret = AVERROR_INVALIDDATA; @@ -2706,22 +2739,22 @@ goto err; // check if golden and altref are swapped - if (s->update_altref != VP56_FRAME_NONE) - s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[s->update_altref]; + if (s->update_altref != VP8_FRAME_NONE) + s->next_framep[VP8_FRAME_ALTREF] = s->framep[s->update_altref]; else - s->next_framep[VP56_FRAME_GOLDEN2] = s->framep[VP56_FRAME_GOLDEN2]; + s->next_framep[VP8_FRAME_ALTREF] = s->framep[VP8_FRAME_ALTREF]; - if (s->update_golden != VP56_FRAME_NONE) - s->next_framep[VP56_FRAME_GOLDEN] = s->framep[s->update_golden]; + if (s->update_golden != VP8_FRAME_NONE) + s->next_framep[VP8_FRAME_GOLDEN] = s->framep[s->update_golden]; else - s->next_framep[VP56_FRAME_GOLDEN] = s->framep[VP56_FRAME_GOLDEN]; + s->next_framep[VP8_FRAME_GOLDEN] = s->framep[VP8_FRAME_GOLDEN]; if (s->update_last) - s->next_framep[VP56_FRAME_PREVIOUS] = curframe; + s->next_framep[VP8_FRAME_PREVIOUS] = curframe; else - s->next_framep[VP56_FRAME_PREVIOUS] = s->framep[VP56_FRAME_PREVIOUS]; + s->next_framep[VP8_FRAME_PREVIOUS] = s->framep[VP8_FRAME_PREVIOUS]; - s->next_framep[VP56_FRAME_CURRENT] = curframe; + s->next_framep[VP8_FRAME_CURRENT] = curframe; if (ffcodec(avctx->codec)->update_thread_context) ff_thread_finish_setup(avctx); @@ -2941,7 +2974,7 @@ #if CONFIG_VP7_DECODER const FFCodec ff_vp7_decoder = { .p.name = "vp7", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP7"), + CODEC_LONG_NAME("On2 VP7"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP7, .priv_data_size = sizeof(VP8Context), @@ -2949,7 +2982,6 @@ .close = ff_vp8_decode_free, FF_CODEC_DECODE_CB(vp7_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vp8_decode_flush, }; #endif /* CONFIG_VP7_DECODER */ @@ -2957,7 +2989,7 @@ #if CONFIG_VP8_DECODER const FFCodec ff_vp8_decoder = { .p.name = "vp8", - .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), + CODEC_LONG_NAME("On2 VP8"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP8, .priv_data_size = sizeof(VP8Context), @@ -2966,10 +2998,9 @@ FF_CODEC_DECODE_CB(ff_vp8_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_ALLOCATE_PROGRESS, + .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = vp8_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context), + UPDATE_THREAD_CONTEXT(vp8_decode_update_thread_context), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VP8_VAAPI_HWACCEL HWACCEL_VAAPI(vp8), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -468,7 +468,7 @@ #define PUT_PIXELS(WIDTH) \ static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t srcstride, \ + const uint8_t *src, ptrdiff_t srcstride, \ int h, int x, int y) \ { \ int i; \ @@ -492,7 +492,7 @@ #define VP8_EPEL_H(SIZE, TAPS) \ static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \ ptrdiff_t dststride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t srcstride, \ int h, int mx, int my) \ { \ @@ -510,7 +510,7 @@ #define VP8_EPEL_V(SIZE, TAPS) \ static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \ ptrdiff_t dststride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t srcstride, \ int h, int mx, int my) \ { \ @@ -529,7 +529,7 @@ static void \ put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, \ ptrdiff_t dststride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t srcstride, \ int h, int mx, \ int my) \ @@ -586,7 +586,7 @@ #define VP8_BILINEAR(SIZE) \ static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \ - uint8_t *src, ptrdiff_t sstride, \ + const uint8_t *src, ptrdiff_t sstride, \ int h, int mx, int my) \ { \ int a = 8 - mx, b = mx; \ @@ -600,7 +600,7 @@ } \ \ static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \ - uint8_t *src, ptrdiff_t sstride, \ + const uint8_t *src, ptrdiff_t sstride, \ int h, int mx, int my) \ { \ int c = 8 - my, d = my; \ @@ -615,7 +615,7 @@ \ static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \ ptrdiff_t dstride, \ - uint8_t *src, \ + const uint8_t *src, \ ptrdiff_t sstride, \ int h, int mx, int my) \ { \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include typedef void (*vp8_mc_func)(uint8_t *dst /* align 8 */, ptrdiff_t dstStride, - uint8_t *src /* align 1 */, ptrdiff_t srcStride, + const uint8_t *src /* align 1 */, ptrdiff_t srcStride, int h, int x, int y); typedef struct VP8DSPContext { @@ -81,13 +81,6 @@ vp8_mc_func put_vp8_bilinear_pixels_tab[3][3][3]; } VP8DSPContext; -void ff_put_vp8_pixels16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride, - int h, int x, int y); -void ff_put_vp8_pixels8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride, - int h, int x, int y); -void ff_put_vp8_pixels4_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride, - int h, int x, int y); - void ff_vp7dsp_init(VP8DSPContext *c); void ff_vp78dsp_init(VP8DSPContext *c); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp8.h 2023-03-03 13:29:59.000000000 +0000 @@ -34,11 +34,20 @@ #include "h264pred.h" #include "threadframe.h" -#include "vp56.h" +#include "videodsp.h" #include "vp8dsp.h" +#include "vpx_rac.h" #define VP8_MAX_QUANT 127 +typedef enum { + VP8_FRAME_NONE = -1, + VP8_FRAME_CURRENT = 0, + VP8_FRAME_PREVIOUS = 1, + VP8_FRAME_GOLDEN = 2, + VP8_FRAME_ALTREF = 3, +} VP8FrameType; + enum dct_token { DCT_0, DCT_1, @@ -73,6 +82,11 @@ VP8_SPLITMVMODE_NONE, ///< (only used in prediction) no split MVs }; +typedef struct VP8mv { + DECLARE_ALIGNED(4, int16_t, x); + int16_t y; +} VP8mv; + typedef struct VP8FilterStrength { uint8_t filter_level; uint8_t inner_limit; @@ -90,8 +104,8 @@ uint8_t segment; uint8_t intra4x4_pred_mode_mb[16]; DECLARE_ALIGNED(4, uint8_t, intra4x4_pred_mode_top)[4]; - VP56mv mv; - VP56mv bmv[16]; + VP8mv mv; + VP8mv bmv[16]; } VP8Macroblock; typedef struct VP8intmv { @@ -234,10 +248,10 @@ /** * filter strength adjustment for macroblocks that reference: - * [0] - intra / VP56_FRAME_CURRENT - * [1] - VP56_FRAME_PREVIOUS - * [2] - VP56_FRAME_GOLDEN - * [3] - altref / VP56_FRAME_GOLDEN2 + * [0] - intra / VP8_FRAME_CURRENT + * [1] - VP8_FRAME_PREVIOUS + * [2] - VP8_FRAME_GOLDEN + * [3] - altref / VP8_FRAME_ALTREF */ int8_t ref[4]; } lf_delta; @@ -245,7 +259,7 @@ uint8_t (*top_border)[16 + 8 + 8]; uint8_t (*top_nnz)[9]; - VP56RangeCoder c; ///< header context, includes mb modes and motion vectors + VPXRangeCoder c; ///< header context, includes mb modes and motion vectors /* This contains the entropy coder state at the end of the header * block, in the form specified by the standard. For use by @@ -282,8 +296,8 @@ VP8Macroblock *macroblocks_base; int invisible; - int update_last; ///< update VP56_FRAME_PREVIOUS with the current one - int update_golden; ///< VP56_FRAME_NONE if not updated, or which frame to copy if so + int update_last; ///< update VP8_FRAME_PREVIOUS with the current one + int update_golden; ///< VP8_FRAME_NONE if not updated, or which frame to copy if so int update_altref; /** @@ -297,7 +311,7 @@ * There can be 1, 2, 4, or 8 of these after the header context. */ int num_coeff_partitions; - VP56RangeCoder coeff_partition[8]; + VPXRangeCoder coeff_partition[8]; int coeff_partition_size[8]; VideoDSPContext vdsp; VP8DSPContext vp8dsp; @@ -322,14 +336,9 @@ int vp7; /** - * Fade bit present in bitstream (VP7) - */ - int fade_present; - - /** * Interframe DC prediction (VP7) - * [0] VP56_FRAME_PREVIOUS - * [1] VP56_FRAME_GOLDEN + * [0] VP8_FRAME_PREVIOUS + * [1] VP8_FRAME_GOLDEN */ uint16_t inter_dc_pred[2][2]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9block.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9block.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9block.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9block.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,10 +24,11 @@ #include "libavutil/avassert.h" #include "threadframe.h" -#include "vp56.h" +#include "vp89_rac.h" #include "vp9.h" #include "vp9data.h" #include "vp9dec.h" +#include "vpx_rac.h" static av_always_inline void setctx_2d(uint8_t *ptr, int w, int h, ptrdiff_t stride, int v) @@ -87,7 +88,7 @@ TX_32X32, TX_32X32, TX_32X32, TX_32X32, TX_16X16, TX_16X16, TX_16X16, TX_8X8, TX_8X8, TX_8X8, TX_4X4, TX_4X4, TX_4X4 }; - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col, row7 = td->row7; enum TxfmMode max_tx = max_tx_for_bl_bp[b->bs]; @@ -100,10 +101,11 @@ b->seg_id = 0; } else if (s->s.h.keyframe || s->s.h.intraonly) { b->seg_id = !s->s.h.segmentation.update_map ? 0 : - vp8_rac_get_tree(td->c, ff_vp9_segmentation_tree, s->s.h.segmentation.prob); + vp89_rac_get_tree(td->c, ff_vp9_segmentation_tree, + s->s.h.segmentation.prob); } else if (!s->s.h.segmentation.update_map || (s->s.h.segmentation.temporal && - vp56_rac_get_prob_branchy(td->c, + vpx_rac_get_prob_branchy(td->c, s->s.h.segmentation.pred_prob[s->above_segpred_ctx[col] + td->left_segpred_ctx[row7]]))) { if (!s->s.h.errorres && s->s.frames[REF_FRAME_SEGMAP].segmentation_map) { @@ -126,8 +128,8 @@ memset(&s->above_segpred_ctx[col], 1, w4); memset(&td->left_segpred_ctx[row7], 1, h4); } else { - b->seg_id = vp8_rac_get_tree(td->c, ff_vp9_segmentation_tree, - s->s.h.segmentation.prob); + b->seg_id = vp89_rac_get_tree(td->c, ff_vp9_segmentation_tree, + s->s.h.segmentation.prob); memset(&s->above_segpred_ctx[col], 0, w4); memset(&td->left_segpred_ctx[row7], 0, h4); @@ -142,7 +144,7 @@ s->s.h.segmentation.feat[b->seg_id].skip_enabled; if (!b->skip) { int c = td->left_skip_ctx[row7] + s->above_skip_ctx[col]; - b->skip = vp56_rac_get_prob(td->c, s->prob.p.skip[c]); + b->skip = vpx_rac_get_prob(td->c, s->prob.p.skip[c]); td->counts.skip[c][b->skip]++; } @@ -160,7 +162,7 @@ c = have_a ? 2 * s->above_intra_ctx[col] : have_l ? 2 * td->left_intra_ctx[row7] : 0; } - bit = vp56_rac_get_prob(td->c, s->prob.p.intra[c]); + bit = vpx_rac_get_prob(td->c, s->prob.p.intra[c]); td->counts.intra[c][bit]++; b->intra = !bit; } @@ -185,22 +187,22 @@ } switch (max_tx) { case TX_32X32: - b->tx = vp56_rac_get_prob(td->c, s->prob.p.tx32p[c][0]); + b->tx = vpx_rac_get_prob(td->c, s->prob.p.tx32p[c][0]); if (b->tx) { - b->tx += vp56_rac_get_prob(td->c, s->prob.p.tx32p[c][1]); + b->tx += vpx_rac_get_prob(td->c, s->prob.p.tx32p[c][1]); if (b->tx == 2) - b->tx += vp56_rac_get_prob(td->c, s->prob.p.tx32p[c][2]); + b->tx += vpx_rac_get_prob(td->c, s->prob.p.tx32p[c][2]); } td->counts.tx32p[c][b->tx]++; break; case TX_16X16: - b->tx = vp56_rac_get_prob(td->c, s->prob.p.tx16p[c][0]); + b->tx = vpx_rac_get_prob(td->c, s->prob.p.tx16p[c][0]); if (b->tx) - b->tx += vp56_rac_get_prob(td->c, s->prob.p.tx16p[c][1]); + b->tx += vpx_rac_get_prob(td->c, s->prob.p.tx16p[c][1]); td->counts.tx16p[c][b->tx]++; break; case TX_8X8: - b->tx = vp56_rac_get_prob(td->c, s->prob.p.tx8p[c]); + b->tx = vpx_rac_get_prob(td->c, s->prob.p.tx8p[c]); td->counts.tx8p[c][b->tx]++; break; case TX_4X4: @@ -221,11 +223,11 @@ // necessary, they're just there to make the code slightly // simpler for now b->mode[0] = - a[0] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_ymode_probs[a[0]][l[0]]); + a[0] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_ymode_probs[a[0]][l[0]]); if (b->bs != BS_8x4) { - b->mode[1] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_ymode_probs[a[1]][b->mode[0]]); + b->mode[1] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_ymode_probs[a[1]][b->mode[0]]); l[0] = a[1] = b->mode[1]; } else { @@ -235,11 +237,11 @@ } if (b->bs != BS_4x8) { b->mode[2] = - a[0] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_ymode_probs[a[0]][l[1]]); + a[0] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_ymode_probs[a[0]][l[1]]); if (b->bs != BS_8x4) { - b->mode[3] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_ymode_probs[a[1]][b->mode[2]]); + b->mode[3] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_ymode_probs[a[1]][b->mode[2]]); l[1] = a[1] = b->mode[3]; } else { @@ -254,8 +256,8 @@ b->mode[3] = b->mode[1]; } } else { - b->mode[0] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_ymode_probs[*a][*l]); + b->mode[0] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_ymode_probs[*a][*l]); b->mode[3] = b->mode[2] = b->mode[1] = b->mode[0]; @@ -263,28 +265,28 @@ memset(a, b->mode[0], ff_vp9_bwh_tab[0][b->bs][0]); memset(l, b->mode[0], ff_vp9_bwh_tab[0][b->bs][1]); } - b->uvmode = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - ff_vp9_default_kf_uvmode_probs[b->mode[3]]); + b->uvmode = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + ff_vp9_default_kf_uvmode_probs[b->mode[3]]); } else if (b->intra) { b->comp = 0; if (b->bs > BS_8x8) { - b->mode[0] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.y_mode[0]); + b->mode[0] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.y_mode[0]); td->counts.y_mode[0][b->mode[0]]++; if (b->bs != BS_8x4) { - b->mode[1] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.y_mode[0]); + b->mode[1] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.y_mode[0]); td->counts.y_mode[0][b->mode[1]]++; } else { b->mode[1] = b->mode[0]; } if (b->bs != BS_4x8) { - b->mode[2] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.y_mode[0]); + b->mode[2] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.y_mode[0]); td->counts.y_mode[0][b->mode[2]]++; if (b->bs != BS_8x4) { - b->mode[3] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.y_mode[0]); + b->mode[3] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.y_mode[0]); td->counts.y_mode[0][b->mode[3]]++; } else { b->mode[3] = b->mode[2]; @@ -299,15 +301,15 @@ }; int sz = size_group[b->bs]; - b->mode[0] = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.y_mode[sz]); + b->mode[0] = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.y_mode[sz]); b->mode[1] = b->mode[2] = b->mode[3] = b->mode[0]; td->counts.y_mode[sz][b->mode[3]]++; } - b->uvmode = vp8_rac_get_tree(td->c, ff_vp9_intramode_tree, - s->prob.p.uv_mode[b->mode[3]]); + b->uvmode = vp89_rac_get_tree(td->c, ff_vp9_intramode_tree, + s->prob.p.uv_mode[b->mode[3]]); td->counts.uv_mode[b->mode[3]][b->uvmode]++; } else { static const uint8_t inter_mode_ctx_lut[14][14] = { @@ -365,7 +367,7 @@ } else { c = 1; } - b->comp = vp56_rac_get_prob(td->c, s->prob.p.comp[c]); + b->comp = vpx_rac_get_prob(td->c, s->prob.p.comp[c]); td->counts.comp[c][b->comp]++; } @@ -437,7 +439,7 @@ } else { c = 2; } - bit = vp56_rac_get_prob(td->c, s->prob.p.comp_ref[c]); + bit = vpx_rac_get_prob(td->c, s->prob.p.comp_ref[c]); b->ref[var_idx] = s->s.h.varcompref[bit]; td->counts.comp_ref[c][bit]++; } else /* single reference */ { @@ -477,7 +479,7 @@ } else { c = 2; } - bit = vp56_rac_get_prob(td->c, s->prob.p.single_ref[c][0]); + bit = vpx_rac_get_prob(td->c, s->prob.p.single_ref[c][0]); td->counts.single_ref[c][0][bit]++; if (!bit) { b->ref[0] = 0; @@ -564,7 +566,7 @@ } else { c = 2; } - bit = vp56_rac_get_prob(td->c, s->prob.p.single_ref[c][1]); + bit = vpx_rac_get_prob(td->c, s->prob.p.single_ref[c][1]); td->counts.single_ref[c][1][bit]++; b->ref[0] = 1 + bit; } @@ -587,8 +589,8 @@ int c = inter_mode_ctx_lut[s->above_mode_ctx[col + off[b->bs]]] [td->left_mode_ctx[row7 + off[b->bs]]]; - b->mode[0] = vp8_rac_get_tree(td->c, ff_vp9_inter_mode_tree, - s->prob.p.mv_mode[c]); + b->mode[0] = vp89_rac_get_tree(td->c, ff_vp9_inter_mode_tree, + s->prob.p.mv_mode[c]); b->mode[1] = b->mode[2] = b->mode[3] = b->mode[0]; @@ -612,8 +614,8 @@ c = 3; } - filter_id = vp8_rac_get_tree(td->c, ff_vp9_filter_tree, - s->prob.p.filter[c]); + filter_id = vp89_rac_get_tree(td->c, ff_vp9_filter_tree, + s->prob.p.filter[c]); td->counts.filter[c][filter_id]++; b->filter = ff_vp9_filter_lut[filter_id]; } else { @@ -623,14 +625,14 @@ if (b->bs > BS_8x8) { int c = inter_mode_ctx_lut[s->above_mode_ctx[col]][td->left_mode_ctx[row7]]; - b->mode[0] = vp8_rac_get_tree(td->c, ff_vp9_inter_mode_tree, - s->prob.p.mv_mode[c]); + b->mode[0] = vp89_rac_get_tree(td->c, ff_vp9_inter_mode_tree, + s->prob.p.mv_mode[c]); td->counts.mv_mode[c][b->mode[0] - 10]++; ff_vp9_fill_mv(td, b->mv[0], b->mode[0], 0); if (b->bs != BS_8x4) { - b->mode[1] = vp8_rac_get_tree(td->c, ff_vp9_inter_mode_tree, - s->prob.p.mv_mode[c]); + b->mode[1] = vp89_rac_get_tree(td->c, ff_vp9_inter_mode_tree, + s->prob.p.mv_mode[c]); td->counts.mv_mode[c][b->mode[1] - 10]++; ff_vp9_fill_mv(td, b->mv[1], b->mode[1], 1); } else { @@ -640,14 +642,14 @@ } if (b->bs != BS_4x8) { - b->mode[2] = vp8_rac_get_tree(td->c, ff_vp9_inter_mode_tree, - s->prob.p.mv_mode[c]); + b->mode[2] = vp89_rac_get_tree(td->c, ff_vp9_inter_mode_tree, + s->prob.p.mv_mode[c]); td->counts.mv_mode[c][b->mode[2] - 10]++; ff_vp9_fill_mv(td, b->mv[2], b->mode[2], 2); if (b->bs != BS_8x4) { - b->mode[3] = vp8_rac_get_tree(td->c, ff_vp9_inter_mode_tree, - s->prob.p.mv_mode[c]); + b->mode[3] = vp89_rac_get_tree(td->c, ff_vp9_inter_mode_tree, + s->prob.p.mv_mode[c]); td->counts.mv_mode[c][b->mode[3] - 10]++; ff_vp9_fill_mv(td, b->mv[3], b->mode[3], 3); } else { @@ -800,11 +802,11 @@ // FIXME merge cnt/eob arguments? static av_always_inline int -decode_coeffs_b_generic(VP56RangeCoder *c, int16_t *coef, int n_coeffs, +decode_coeffs_b_generic(VPXRangeCoder *c, int16_t *coef, int n_coeffs, int is_tx32x32, int is8bitsperpixel, int bpp, unsigned (*cnt)[6][3], - unsigned (*eob)[6][2], uint8_t (*p)[6][11], + unsigned (*eob)[6][2], const uint8_t (*p)[6][11], int nnz, const int16_t *scan, const int16_t (*nb)[2], - const int16_t *band_counts, int16_t *qmul) + const int16_t *band_counts, const int16_t *qmul) { int i = 0, band = 0, band_left = band_counts[band]; const uint8_t *tp = p[0][nnz]; @@ -813,13 +815,13 @@ do { int val, rc; - val = vp56_rac_get_prob_branchy(c, tp[0]); // eob + val = vpx_rac_get_prob_branchy(c, tp[0]); // eob eob[band][nnz][val]++; if (!val) break; skip_eob: - if (!vp56_rac_get_prob_branchy(c, tp[1])) { // zero + if (!vpx_rac_get_prob_branchy(c, tp[1])) { // zero cnt[band][nnz][0]++; if (!--band_left) band_left = band_counts[++band]; @@ -832,70 +834,70 @@ } rc = scan[i]; - if (!vp56_rac_get_prob_branchy(c, tp[2])) { // one + if (!vpx_rac_get_prob_branchy(c, tp[2])) { // one cnt[band][nnz][1]++; val = 1; cache[rc] = 1; } else { cnt[band][nnz][2]++; - if (!vp56_rac_get_prob_branchy(c, tp[3])) { // 2, 3, 4 - if (!vp56_rac_get_prob_branchy(c, tp[4])) { + if (!vpx_rac_get_prob_branchy(c, tp[3])) { // 2, 3, 4 + if (!vpx_rac_get_prob_branchy(c, tp[4])) { cache[rc] = val = 2; } else { - val = 3 + vp56_rac_get_prob(c, tp[5]); + val = 3 + vpx_rac_get_prob(c, tp[5]); cache[rc] = 3; } - } else if (!vp56_rac_get_prob_branchy(c, tp[6])) { // cat1/2 + } else if (!vpx_rac_get_prob_branchy(c, tp[6])) { // cat1/2 cache[rc] = 4; - if (!vp56_rac_get_prob_branchy(c, tp[7])) { - val = vp56_rac_get_prob(c, 159) + 5; + if (!vpx_rac_get_prob_branchy(c, tp[7])) { + val = vpx_rac_get_prob(c, 159) + 5; } else { - val = (vp56_rac_get_prob(c, 165) << 1) + 7; - val += vp56_rac_get_prob(c, 145); + val = (vpx_rac_get_prob(c, 165) << 1) + 7; + val += vpx_rac_get_prob(c, 145); } } else { // cat 3-6 cache[rc] = 5; - if (!vp56_rac_get_prob_branchy(c, tp[8])) { - if (!vp56_rac_get_prob_branchy(c, tp[9])) { - val = 11 + (vp56_rac_get_prob(c, 173) << 2); - val += (vp56_rac_get_prob(c, 148) << 1); - val += vp56_rac_get_prob(c, 140); + if (!vpx_rac_get_prob_branchy(c, tp[8])) { + if (!vpx_rac_get_prob_branchy(c, tp[9])) { + val = 11 + (vpx_rac_get_prob(c, 173) << 2); + val += (vpx_rac_get_prob(c, 148) << 1); + val += vpx_rac_get_prob(c, 140); } else { - val = 19 + (vp56_rac_get_prob(c, 176) << 3); - val += (vp56_rac_get_prob(c, 155) << 2); - val += (vp56_rac_get_prob(c, 140) << 1); - val += vp56_rac_get_prob(c, 135); + val = 19 + (vpx_rac_get_prob(c, 176) << 3); + val += (vpx_rac_get_prob(c, 155) << 2); + val += (vpx_rac_get_prob(c, 140) << 1); + val += vpx_rac_get_prob(c, 135); } - } else if (!vp56_rac_get_prob_branchy(c, tp[10])) { - val = (vp56_rac_get_prob(c, 180) << 4) + 35; - val += (vp56_rac_get_prob(c, 157) << 3); - val += (vp56_rac_get_prob(c, 141) << 2); - val += (vp56_rac_get_prob(c, 134) << 1); - val += vp56_rac_get_prob(c, 130); + } else if (!vpx_rac_get_prob_branchy(c, tp[10])) { + val = (vpx_rac_get_prob(c, 180) << 4) + 35; + val += (vpx_rac_get_prob(c, 157) << 3); + val += (vpx_rac_get_prob(c, 141) << 2); + val += (vpx_rac_get_prob(c, 134) << 1); + val += vpx_rac_get_prob(c, 130); } else { val = 67; if (!is8bitsperpixel) { if (bpp == 12) { - val += vp56_rac_get_prob(c, 255) << 17; - val += vp56_rac_get_prob(c, 255) << 16; + val += vpx_rac_get_prob(c, 255) << 17; + val += vpx_rac_get_prob(c, 255) << 16; } - val += (vp56_rac_get_prob(c, 255) << 15); - val += (vp56_rac_get_prob(c, 255) << 14); + val += (vpx_rac_get_prob(c, 255) << 15); + val += (vpx_rac_get_prob(c, 255) << 14); } - val += (vp56_rac_get_prob(c, 254) << 13); - val += (vp56_rac_get_prob(c, 254) << 12); - val += (vp56_rac_get_prob(c, 254) << 11); - val += (vp56_rac_get_prob(c, 252) << 10); - val += (vp56_rac_get_prob(c, 249) << 9); - val += (vp56_rac_get_prob(c, 243) << 8); - val += (vp56_rac_get_prob(c, 230) << 7); - val += (vp56_rac_get_prob(c, 196) << 6); - val += (vp56_rac_get_prob(c, 177) << 5); - val += (vp56_rac_get_prob(c, 153) << 4); - val += (vp56_rac_get_prob(c, 140) << 3); - val += (vp56_rac_get_prob(c, 133) << 2); - val += (vp56_rac_get_prob(c, 130) << 1); - val += vp56_rac_get_prob(c, 129); + val += (vpx_rac_get_prob(c, 254) << 13); + val += (vpx_rac_get_prob(c, 254) << 12); + val += (vpx_rac_get_prob(c, 254) << 11); + val += (vpx_rac_get_prob(c, 252) << 10); + val += (vpx_rac_get_prob(c, 249) << 9); + val += (vpx_rac_get_prob(c, 243) << 8); + val += (vpx_rac_get_prob(c, 230) << 7); + val += (vpx_rac_get_prob(c, 196) << 6); + val += (vpx_rac_get_prob(c, 177) << 5); + val += (vpx_rac_get_prob(c, 153) << 4); + val += (vpx_rac_get_prob(c, 140) << 3); + val += (vpx_rac_get_prob(c, 133) << 2); + val += (vpx_rac_get_prob(c, 130) << 1); + val += vpx_rac_get_prob(c, 129); } } } @@ -909,9 +911,9 @@ if (!--band_left) band_left = band_counts[++band]; if (is_tx32x32) - STORE_COEF(coef, rc, (int)((vp8_rac_get(c) ? -val : val) * (unsigned)qmul[!!i]) / 2); + STORE_COEF(coef, rc, (int)((vp89_rac_get(c) ? -val : val) * (unsigned)qmul[!!i]) / 2); else - STORE_COEF(coef, rc, (vp8_rac_get(c) ? -val : val) * (unsigned)qmul[!!i]); + STORE_COEF(coef, rc, (vp89_rac_get(c) ? -val : val) * (unsigned)qmul[!!i]); nnz = (1 + cache[nb[i][0]] + cache[nb[i][1]]) >> 1; tp = p[band][nnz]; } while (++i < n_coeffs); @@ -921,9 +923,9 @@ static int decode_coeffs_b_8bpp(VP9TileData *td, int16_t *coef, int n_coeffs, unsigned (*cnt)[6][3], unsigned (*eob)[6][2], - uint8_t (*p)[6][11], int nnz, const int16_t *scan, + const uint8_t (*p)[6][11], int nnz, const int16_t *scan, const int16_t (*nb)[2], const int16_t *band_counts, - int16_t *qmul) + const int16_t *qmul) { return decode_coeffs_b_generic(td->c, coef, n_coeffs, 0, 1, 8, cnt, eob, p, nnz, scan, nb, band_counts, qmul); @@ -931,9 +933,9 @@ static int decode_coeffs_b32_8bpp(VP9TileData *td, int16_t *coef, int n_coeffs, unsigned (*cnt)[6][3], unsigned (*eob)[6][2], - uint8_t (*p)[6][11], int nnz, const int16_t *scan, + const uint8_t (*p)[6][11], int nnz, const int16_t *scan, const int16_t (*nb)[2], const int16_t *band_counts, - int16_t *qmul) + const int16_t *qmul) { return decode_coeffs_b_generic(td->c, coef, n_coeffs, 1, 1, 8, cnt, eob, p, nnz, scan, nb, band_counts, qmul); @@ -941,9 +943,9 @@ static int decode_coeffs_b_16bpp(VP9TileData *td, int16_t *coef, int n_coeffs, unsigned (*cnt)[6][3], unsigned (*eob)[6][2], - uint8_t (*p)[6][11], int nnz, const int16_t *scan, + const uint8_t (*p)[6][11], int nnz, const int16_t *scan, const int16_t (*nb)[2], const int16_t *band_counts, - int16_t *qmul) + const int16_t *qmul) { return decode_coeffs_b_generic(td->c, coef, n_coeffs, 0, 0, td->s->s.h.bpp, cnt, eob, p, nnz, scan, nb, band_counts, qmul); @@ -951,9 +953,9 @@ static int decode_coeffs_b32_16bpp(VP9TileData *td, int16_t *coef, int n_coeffs, unsigned (*cnt)[6][3], unsigned (*eob)[6][2], - uint8_t (*p)[6][11], int nnz, const int16_t *scan, + const uint8_t (*p)[6][11], int nnz, const int16_t *scan, const int16_t (*nb)[2], const int16_t *band_counts, - int16_t *qmul) + const int16_t *qmul) { return decode_coeffs_b_generic(td->c, coef, n_coeffs, 1, 0, td->s->s.h.bpp, cnt, eob, p, nnz, scan, nb, band_counts, qmul); @@ -961,17 +963,17 @@ static av_always_inline int decode_coeffs(VP9TileData *td, int is8bitsperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col; - uint8_t (*p)[6][11] = s->prob.coef[b->tx][0 /* y */][!b->intra]; + const uint8_t (*p)[6][11] = s->prob.coef[b->tx][0 /* y */][!b->intra]; unsigned (*c)[6][3] = td->counts.coef[b->tx][0 /* y */][!b->intra]; unsigned (*e)[6][2] = td->counts.eob[b->tx][0 /* y */][!b->intra]; int w4 = ff_vp9_bwh_tab[1][b->bs][0] << 1, h4 = ff_vp9_bwh_tab[1][b->bs][1] << 1; int end_x = FFMIN(2 * (s->cols - col), w4); int end_y = FFMIN(2 * (s->rows - row), h4); int n, pl, x, y, ret; - int16_t (*qmul)[2] = s->s.h.segmentation.feat[b->seg_id].qmul; + const int16_t (*qmul)[2] = s->s.h.segmentation.feat[b->seg_id].qmul; int tx = 4 * s->s.h.lossless + b->tx; const int16_t * const *yscans = ff_vp9_scans[tx]; const int16_t (* const * ynbs)[2] = ff_vp9_scans_nb[tx]; @@ -1262,7 +1264,7 @@ VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff, enum BlockLevel bl, enum BlockPartition bp) { - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; enum BlockSize bs = bl * 3 + bp; int bytesperpixel = s->bytesperpixel; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,19 +25,20 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" #include "hwconfig.h" -#include "internal.h" #include "profiles.h" #include "thread.h" #include "threadframe.h" #include "pthread_internal.h" #include "videodsp.h" -#include "vp56.h" +#include "vp89_rac.h" #include "vp9.h" #include "vp9data.h" #include "vp9dec.h" +#include "vpx_rac.h" #include "libavutil/avassert.h" #include "libavutil/pixdesc.h" #include "libavutil/video_enc_params.h" @@ -233,6 +234,13 @@ *fmtp++ = AV_PIX_FMT_VDPAU; #endif break; + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV444P12: +#if CONFIG_VP9_VAAPI_HWACCEL + *fmtp++ = AV_PIX_FMT_VAAPI; +#endif + break; } *fmtp++ = s->pix_fmt; @@ -274,7 +282,7 @@ assign(s->intra_pred_data[2], uint8_t *, 64 * bytesperpixel); assign(s->above_y_nnz_ctx, uint8_t *, 16); assign(s->above_mode_ctx, uint8_t *, 16); - assign(s->above_mv_ctx, VP56mv(*)[2], 16); + assign(s->above_mv_ctx, VP9mv(*)[2], 16); assign(s->above_uv_nnz_ctx[0], uint8_t *, 16); assign(s->above_uv_nnz_ctx[1], uint8_t *, 16); assign(s->above_partition_ctx, uint8_t *, 8); @@ -379,7 +387,7 @@ } // differential forward probability updates -static int update_prob(VP56RangeCoder *c, int p) +static int update_prob(VPXRangeCoder *c, int p) { static const uint8_t inv_map_table[255] = { 7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, @@ -419,16 +427,16 @@ * updates vs. the 'fine, exact' updates further down the range, which * adds one extra dimension to this differential update model. */ - if (!vp8_rac_get(c)) { - d = vp8_rac_get_uint(c, 4) + 0; - } else if (!vp8_rac_get(c)) { - d = vp8_rac_get_uint(c, 4) + 16; - } else if (!vp8_rac_get(c)) { - d = vp8_rac_get_uint(c, 5) + 32; + if (!vp89_rac_get(c)) { + d = vp89_rac_get_uint(c, 4) + 0; + } else if (!vp89_rac_get(c)) { + d = vp89_rac_get_uint(c, 4) + 16; + } else if (!vp89_rac_get(c)) { + d = vp89_rac_get_uint(c, 5) + 32; } else { - d = vp8_rac_get_uint(c, 7); + d = vp89_rac_get_uint(c, 7); if (d >= 65) - d = (d << 1) - 65 + vp8_rac_get(c); + d = (d << 1) - 65 + vp89_rac_get(c); d += 64; av_assert2(d < FF_ARRAY_ELEMS(inv_map_table)); } @@ -784,7 +792,7 @@ s->s.h.tiling.tile_rows = 1 << s->s.h.tiling.log2_tile_rows; if (s->s.h.tiling.tile_cols != (1 << s->s.h.tiling.log2_tile_cols)) { int n_range_coders; - VP56RangeCoder *rc; + VPXRangeCoder *rc; if (s->td) { for (i = 0; i < s->active_tile_cols; i++) @@ -802,10 +810,10 @@ n_range_coders = s->s.h.tiling.tile_cols; } s->td = av_calloc(s->active_tile_cols, sizeof(VP9TileData) + - n_range_coders * sizeof(VP56RangeCoder)); + n_range_coders * sizeof(VPXRangeCoder)); if (!s->td) return AVERROR(ENOMEM); - rc = (VP56RangeCoder *) &s->td[s->active_tile_cols]; + rc = (VPXRangeCoder *) &s->td[s->active_tile_cols]; for (i = 0; i < s->active_tile_cols; i++) { s->td[i].s = s; s->td[i].c_b = rc; @@ -877,11 +885,11 @@ av_log(avctx, AV_LOG_ERROR, "Invalid compressed header size\n"); return AVERROR_INVALIDDATA; } - ret = ff_vp56_init_range_decoder(&s->c, data2, size2); + ret = ff_vpx_init_range_decoder(&s->c, data2, size2); if (ret < 0) return ret; - if (vp56_rac_get_prob_branchy(&s->c, 128)) { // marker bit + if (vpx_rac_get_prob_branchy(&s->c, 128)) { // marker bit av_log(avctx, AV_LOG_ERROR, "Marker bit was set\n"); return AVERROR_INVALIDDATA; } @@ -905,22 +913,22 @@ if (s->s.h.lossless) { s->s.h.txfmmode = TX_4X4; } else { - s->s.h.txfmmode = vp8_rac_get_uint(&s->c, 2); + s->s.h.txfmmode = vp89_rac_get_uint(&s->c, 2); if (s->s.h.txfmmode == 3) - s->s.h.txfmmode += vp8_rac_get(&s->c); + s->s.h.txfmmode += vp89_rac_get(&s->c); if (s->s.h.txfmmode == TX_SWITCHABLE) { for (i = 0; i < 2; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.tx8p[i] = update_prob(&s->c, s->prob.p.tx8p[i]); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.tx16p[i][j] = update_prob(&s->c, s->prob.p.tx16p[i][j]); for (i = 0; i < 2; i++) for (j = 0; j < 3; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.tx32p[i][j] = update_prob(&s->c, s->prob.p.tx32p[i][j]); } @@ -929,7 +937,7 @@ // coef updates for (i = 0; i < 4; i++) { uint8_t (*ref)[2][6][6][3] = s->prob_ctx[c].coef[i]; - if (vp8_rac_get(&s->c)) { + if (vp89_rac_get(&s->c)) { for (j = 0; j < 2; j++) for (k = 0; k < 2; k++) for (l = 0; l < 6; l++) @@ -939,7 +947,7 @@ if (m >= 3 && l == 0) // dc only has 3 pt break; for (n = 0; n < 3; n++) { - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) p[n] = update_prob(&s->c, r[n]); else p[n] = r[n]; @@ -965,33 +973,33 @@ // mode updates for (i = 0; i < 3; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.skip[i] = update_prob(&s->c, s->prob.p.skip[i]); if (!s->s.h.keyframe && !s->s.h.intraonly) { for (i = 0; i < 7; i++) for (j = 0; j < 3; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_mode[i][j] = update_prob(&s->c, s->prob.p.mv_mode[i][j]); if (s->s.h.filtermode == FILTER_SWITCHABLE) for (i = 0; i < 4; i++) for (j = 0; j < 2; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.filter[i][j] = update_prob(&s->c, s->prob.p.filter[i][j]); for (i = 0; i < 4; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.intra[i] = update_prob(&s->c, s->prob.p.intra[i]); if (s->s.h.allowcompinter) { - s->s.h.comppredmode = vp8_rac_get(&s->c); + s->s.h.comppredmode = vp89_rac_get(&s->c); if (s->s.h.comppredmode) - s->s.h.comppredmode += vp8_rac_get(&s->c); + s->s.h.comppredmode += vp89_rac_get(&s->c); if (s->s.h.comppredmode == PRED_SWITCHABLE) for (i = 0; i < 5; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.comp[i] = update_prob(&s->c, s->prob.p.comp[i]); } else { @@ -1000,10 +1008,10 @@ if (s->s.h.comppredmode != PRED_COMPREF) { for (i = 0; i < 5; i++) { - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.single_ref[i][0] = update_prob(&s->c, s->prob.p.single_ref[i][0]); - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.single_ref[i][1] = update_prob(&s->c, s->prob.p.single_ref[i][1]); } @@ -1011,72 +1019,72 @@ if (s->s.h.comppredmode != PRED_SINGLEREF) { for (i = 0; i < 5; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.comp_ref[i] = update_prob(&s->c, s->prob.p.comp_ref[i]); } for (i = 0; i < 4; i++) for (j = 0; j < 9; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.y_mode[i][j] = update_prob(&s->c, s->prob.p.y_mode[i][j]); for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) for (k = 0; k < 3; k++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.partition[3 - i][j][k] = update_prob(&s->c, s->prob.p.partition[3 - i][j][k]); // mv fields don't use the update_prob subexp model for some reason for (i = 0; i < 3; i++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) - s->prob.p.mv_joint[i] = (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + if (vpx_rac_get_prob_branchy(&s->c, 252)) + s->prob.p.mv_joint[i] = (vp89_rac_get_uint(&s->c, 7) << 1) | 1; for (i = 0; i < 2; i++) { - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].sign = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; for (j = 0; j < 10; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].classes[j] = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].class0 = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; for (j = 0; j < 10; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].bits[j] = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; } for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) for (k = 0; k < 3; k++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].class0_fp[j][k] = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; for (j = 0; j < 3; j++) - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].fp[j] = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; } if (s->s.h.highprecisionmvs) { for (i = 0; i < 2; i++) { - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].class0_hp = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; - if (vp56_rac_get_prob_branchy(&s->c, 252)) + if (vpx_rac_get_prob_branchy(&s->c, 252)) s->prob.p.mv_comp[i].hp = - (vp8_rac_get_uint(&s->c, 7) << 1) | 1; + (vp89_rac_get_uint(&s->c, 7) << 1) | 1; } } } @@ -1099,11 +1107,11 @@ int bytesperpixel = s->bytesperpixel; if (bl == BL_8X8) { - bp = vp8_rac_get_tree(td->c, ff_vp9_partition_tree, p); + bp = vp89_rac_get_tree(td->c, ff_vp9_partition_tree, p); ff_vp9_decode_block(td, row, col, lflvl, yoff, uvoff, bl, bp); } else if (col + hbs < s->cols) { // FIXME why not <=? if (row + hbs < s->rows) { // FIXME why not <=? - bp = vp8_rac_get_tree(td->c, ff_vp9_partition_tree, p); + bp = vp89_rac_get_tree(td->c, ff_vp9_partition_tree, p); switch (bp) { case PARTITION_NONE: ff_vp9_decode_block(td, row, col, lflvl, yoff, uvoff, bl, bp); @@ -1135,7 +1143,7 @@ default: av_assert0(0); } - } else if (vp56_rac_get_prob_branchy(td->c, p[1])) { + } else if (vpx_rac_get_prob_branchy(td->c, p[1])) { bp = PARTITION_SPLIT; decode_sb(td, row, col, lflvl, yoff, uvoff, bl + 1); decode_sb(td, row, col + hbs, lflvl, @@ -1146,7 +1154,7 @@ ff_vp9_decode_block(td, row, col, lflvl, yoff, uvoff, bl, bp); } } else if (row + hbs < s->rows) { // FIXME why not <=? - if (vp56_rac_get_prob_branchy(td->c, p[2])) { + if (vpx_rac_get_prob_branchy(td->c, p[2])) { bp = PARTITION_SPLIT; decode_sb(td, row, col, lflvl, yoff, uvoff, bl + 1); yoff += hbs * 8 * y_stride; @@ -1287,17 +1295,13 @@ data += 4; size -= 4; } - if (tile_size > size) { - ff_thread_report_progress(&s->s.frames[CUR_FRAME].tf, INT_MAX, 0); + if (tile_size > size) return AVERROR_INVALIDDATA; - } - ret = ff_vp56_init_range_decoder(&td->c_b[tile_col], data, tile_size); + ret = ff_vpx_init_range_decoder(&td->c_b[tile_col], data, tile_size); if (ret < 0) return ret; - if (vp56_rac_get_prob_branchy(&td->c_b[tile_col], 128)) { // marker bit - ff_thread_report_progress(&s->s.frames[CUR_FRAME].tf, INT_MAX, 0); + if (vpx_rac_get_prob_branchy(&td->c_b[tile_col], 128)) // marker bit return AVERROR_INVALIDDATA; - } data += tile_size; size -= tile_size; } @@ -1340,7 +1344,7 @@ decode_sb_mem(td, row, col, lflvl_ptr, yoff2, uvoff2, BL_64X64); } else { - if (vpX_rac_is_end(td->c)) { + if (vpx_rac_is_end(td->c)) { return AVERROR_INVALIDDATA; } decode_sb(td, row, col, lflvl_ptr, @@ -1714,10 +1718,10 @@ } if (tile_size > size) return AVERROR_INVALIDDATA; - ret = ff_vp56_init_range_decoder(&s->td[tile_col].c_b[tile_row], data, tile_size); + ret = ff_vpx_init_range_decoder(&s->td[tile_col].c_b[tile_row], data, tile_size); if (ret < 0) return ret; - if (vp56_rac_get_prob_branchy(&s->td[tile_col].c_b[tile_row], 128)) // marker bit + if (vpx_rac_get_prob_branchy(&s->td[tile_col].c_b[tile_row], 128)) // marker bit return AVERROR_INVALIDDATA; data += tile_size; size -= tile_size; @@ -1868,7 +1872,7 @@ const FFCodec ff_vp9_decoder = { .p.name = "vp9", - .p.long_name = NULL_IF_CONFIG_SMALL("Google VP9"), + CODEC_LONG_NAME("Google VP9"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, .priv_data_size = sizeof(VP9Context), @@ -1876,11 +1880,11 @@ .close = vp9_decode_free, FF_CODEC_DECODE_CB(vp9_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SLICE_THREAD_HAS_MF | FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = vp9_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(vp9_decode_update_thread_context), + UPDATE_THREAD_CONTEXT(vp9_decode_update_thread_context), .p.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), .bsfs = "vp9_superframe_split", .hw_configs = (const AVCodecHWConfigInternal *const []) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dec.h 2023-03-03 13:29:59.000000000 +0000 @@ -33,9 +33,12 @@ #include "libavutil/thread.h" #include "libavutil/internal.h" +#include "get_bits.h" +#include "videodsp.h" #include "vp9.h" #include "vp9dsp.h" #include "vp9shared.h" +#include "vpx_rac.h" #define REF_INVALID_SCALE 0xFFFF @@ -82,7 +85,7 @@ typedef struct VP9Block { uint8_t seg_id, intra, comp, ref[2], mode[4], uvmode, skip; enum FilterMode filter; - VP56mv mv[4 /* b_idx */][2 /* ref */]; + VP9mv mv[4 /* b_idx */][2 /* ref */]; enum BlockSize bs; enum TxfmMode tx, uvtx; enum BlockLevel bl; @@ -98,7 +101,7 @@ VP9DSPContext dsp; VideoDSPContext vdsp; GetBitContext gb; - VP56RangeCoder c; + VPXRangeCoder c; int pass, active_tile_cols; #if HAVE_THREADS @@ -146,7 +149,7 @@ uint8_t *above_comp_ctx; // 1bit uint8_t *above_ref_ctx; // 2bit uint8_t *above_filter_ctx; - VP56mv (*above_mv_ctx)[2]; + VP9mv (*above_mv_ctx)[2]; // whole-frame cache uint8_t *intra_pred_data[3]; @@ -163,11 +166,9 @@ } VP9Context; struct VP9TileData { - //VP9Context should be const, but because of the threading API(generates - //a lot of warnings) it's not. - VP9Context *s; - VP56RangeCoder *c_b; - VP56RangeCoder *c; + const VP9Context *s; + VPXRangeCoder *c_b; + VPXRangeCoder *c; int row, row7, col, col7; uint8_t *dst[3]; ptrdiff_t y_stride, uv_stride; @@ -209,7 +210,7 @@ // contextual (left) cache DECLARE_ALIGNED(16, uint8_t, left_y_nnz_ctx)[16]; DECLARE_ALIGNED(16, uint8_t, left_mode_ctx)[16]; - DECLARE_ALIGNED(16, VP56mv, left_mv_ctx)[16][2]; + DECLARE_ALIGNED(16, VP9mv, left_mv_ctx)[16][2]; DECLARE_ALIGNED(16, uint8_t, left_uv_nnz_ctx)[2][16]; DECLARE_ALIGNED(8, uint8_t, left_partition_ctx)[8]; DECLARE_ALIGNED(8, uint8_t, left_skip_ctx)[8]; @@ -237,7 +238,7 @@ unsigned int nb_block_structure; }; -void ff_vp9_fill_mv(VP9TileData *td, VP56mv *mv, int mode, int sb); +void ff_vp9_fill_mv(VP9TileData *td, VP9mv *mv, int mode, int sb); void ff_vp9_adapt_probs(VP9Context *s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include #include "libavcodec/vp9.h" +#include "libavutil/attributes_internal.h" typedef void (*vp9_mc_func)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *ref, ptrdiff_t ref_stride, @@ -120,7 +121,7 @@ vp9_scaled_mc_func smc[5][N_FILTERS][2]; } VP9DSPContext; -extern const int16_t ff_vp9_subpel_filters[3][16][8]; +extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][16][8]; void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9_mc_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9_mc_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9_mc_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9_mc_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,9 +22,9 @@ */ #define ROUNDED_DIV_MVx2(a, b) \ - (VP56mv) { .x = ROUNDED_DIV(a.x + b.x, 2), .y = ROUNDED_DIV(a.y + b.y, 2) } + (VP9mv) { .x = ROUNDED_DIV(a.x + b.x, 2), .y = ROUNDED_DIV(a.y + b.y, 2) } #define ROUNDED_DIV_MVx4(a, b, c, d) \ - (VP56mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \ + (VP9mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \ .y = ROUNDED_DIV(a.y + b.y + c.y + d.y, 4) } static void FN(inter_pred)(VP9TileData *td) @@ -33,11 +33,11 @@ { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, }; - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col; - ThreadFrame *tref1 = &s->s.refs[s->s.h.refidx[b->ref[0]]], *tref2; - AVFrame *ref1 = tref1->f, *ref2; + const ThreadFrame *tref1 = &s->s.refs[s->s.h.refidx[b->ref[0]]], *tref2; + const AVFrame *ref1 = tref1->f, *ref2; int w1 = ref1->width, h1 = ref1->height, w2, h2; ptrdiff_t ls_y = td->y_stride, ls_uv = td->uv_stride; int bytesperpixel = BYTES_PER_PIXEL; @@ -51,7 +51,7 @@ // y inter pred if (b->bs > BS_8x8) { - VP56mv uvmv; + VP9mv uvmv; #if SCALED == 0 if (b->bs == BS_8x4) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9mvs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9mvs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9mvs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9mvs.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,12 @@ */ #include "threadframe.h" -#include "vp56.h" -#include "vp9.h" +#include "vp89_rac.h" #include "vp9data.h" #include "vp9dec.h" +#include "vpx_rac.h" -static av_always_inline void clamp_mv(VP56mv *dst, const VP56mv *src, +static av_always_inline void clamp_mv(VP9mv *dst, const VP9mv *src, VP9TileData *td) { dst->x = av_clip(src->x, td->min_mv.x, td->max_mv.x); @@ -35,7 +35,7 @@ } static void find_ref_mvs(VP9TileData *td, - VP56mv *pmv, int ref, int z, int idx, int sb) + VP9mv *pmv, int ref, int z, int idx, int sb) { static const int8_t mv_ref_blk_off[N_BS_SIZES][8][2] = { [BS_64x64] = { { 3, -1 }, { -1, 3 }, { 4, -1 }, { -1, 4 }, @@ -65,7 +65,7 @@ [BS_4x4] = { { 0, -1 }, { -1, 0 }, { -1, -1 }, { 0, -2 }, { -2, 0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } }, }; - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col, row7 = td->row7; const int8_t (*p)[2] = mv_ref_blk_off[b->bs]; @@ -99,7 +99,7 @@ #define RETURN_MV(mv) \ do { \ if (sb > 0) { \ - VP56mv tmp; \ + VP9mv tmp; \ uint32_t m; \ av_assert2(idx == 1); \ av_assert2(mem != INVALID_MV); \ @@ -185,7 +185,7 @@ #define RETURN_SCALE_MV(mv, scale) \ do { \ if (scale) { \ - VP56mv mv_temp = { -mv.x, -mv.y }; \ + VP9mv mv_temp = { -mv.x, -mv.y }; \ RETURN_MV(mv_temp); \ } else { \ RETURN_MV(mv); \ @@ -235,10 +235,10 @@ static av_always_inline int read_mv_component(VP9TileData *td, int idx, int hp) { - VP9Context *s = td->s; - int bit, sign = vp56_rac_get_prob(td->c, s->prob.p.mv_comp[idx].sign); - int n, c = vp8_rac_get_tree(td->c, ff_vp9_mv_class_tree, - s->prob.p.mv_comp[idx].classes); + const VP9Context *s = td->s; + int bit, sign = vpx_rac_get_prob(td->c, s->prob.p.mv_comp[idx].sign); + int n, c = vp89_rac_get_tree(td->c, ff_vp9_mv_class_tree, + s->prob.p.mv_comp[idx].classes); td->counts.mv_comp[idx].sign[sign]++; td->counts.mv_comp[idx].classes[c]++; @@ -246,17 +246,17 @@ int m; for (n = 0, m = 0; m < c; m++) { - bit = vp56_rac_get_prob(td->c, s->prob.p.mv_comp[idx].bits[m]); + bit = vpx_rac_get_prob(td->c, s->prob.p.mv_comp[idx].bits[m]); n |= bit << m; td->counts.mv_comp[idx].bits[m][bit]++; } n <<= 3; - bit = vp8_rac_get_tree(td->c, ff_vp9_mv_fp_tree, - s->prob.p.mv_comp[idx].fp); + bit = vp89_rac_get_tree(td->c, ff_vp9_mv_fp_tree, + s->prob.p.mv_comp[idx].fp); n |= bit << 1; td->counts.mv_comp[idx].fp[bit]++; if (hp) { - bit = vp56_rac_get_prob(td->c, s->prob.p.mv_comp[idx].hp); + bit = vpx_rac_get_prob(td->c, s->prob.p.mv_comp[idx].hp); td->counts.mv_comp[idx].hp[bit]++; n |= bit; } else { @@ -267,14 +267,14 @@ } n += 8 << c; } else { - n = vp56_rac_get_prob(td->c, s->prob.p.mv_comp[idx].class0); + n = vpx_rac_get_prob(td->c, s->prob.p.mv_comp[idx].class0); td->counts.mv_comp[idx].class0[n]++; - bit = vp8_rac_get_tree(td->c, ff_vp9_mv_fp_tree, - s->prob.p.mv_comp[idx].class0_fp[n]); + bit = vp89_rac_get_tree(td->c, ff_vp9_mv_fp_tree, + s->prob.p.mv_comp[idx].class0_fp[n]); td->counts.mv_comp[idx].class0_fp[n][bit]++; n = (n << 3) | (bit << 1); if (hp) { - bit = vp56_rac_get_prob(td->c, s->prob.p.mv_comp[idx].class0_hp); + bit = vpx_rac_get_prob(td->c, s->prob.p.mv_comp[idx].class0_hp); td->counts.mv_comp[idx].class0_hp[bit]++; n |= bit; } else { @@ -288,9 +288,9 @@ return sign ? -(n + 1) : (n + 1); } -void ff_vp9_fill_mv(VP9TileData *td, VP56mv *mv, int mode, int sb) +void ff_vp9_fill_mv(VP9TileData *td, VP9mv *mv, int mode, int sb) { - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; if (mode == ZEROMV) { @@ -319,8 +319,8 @@ } } if (mode == NEWMV) { - enum MVJoint j = vp8_rac_get_tree(td->c, ff_vp9_mv_joint_tree, - s->prob.p.mv_joint); + enum MVJoint j = vp89_rac_get_tree(td->c, ff_vp9_mv_joint_tree, + s->prob.p.mv_joint); td->counts.mv_joint[j]++; if (j >= MV_JOINT_V) @@ -350,8 +350,8 @@ } } if (mode == NEWMV) { - enum MVJoint j = vp8_rac_get_tree(td->c, ff_vp9_mv_joint_tree, - s->prob.p.mv_joint); + enum MVJoint j = vp89_rac_get_tree(td->c, ff_vp9_mv_joint_tree, + s->prob.p.mv_joint); td->counts.mv_joint[j]++; if (j >= MV_JOINT_V) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9prob.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9prob.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9prob.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9prob.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,9 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "vp56.h" #include "vp9.h" -#include "vp9data.h" #include "vp9dec.h" static av_always_inline void adapt_prob(uint8_t *p, unsigned ct0, unsigned ct1, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9recon.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9recon.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9recon.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9recon.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,7 +36,7 @@ int row, int y, enum TxfmMode tx, int p, int ss_h, int ss_v, int bytesperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; int have_top = row > 0 || y > 0; int have_left = col > td->tile_col_start || x > 0; int have_right = x < w - 1; @@ -218,7 +218,7 @@ static av_always_inline void intra_recon(VP9TileData *td, ptrdiff_t y_off, ptrdiff_t uv_off, int bytesperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col; int w4 = ff_vp9_bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n; @@ -295,14 +295,14 @@ intra_recon(td, y_off, uv_off, 2); } -static av_always_inline void mc_luma_unscaled(VP9TileData *td, vp9_mc_func (*mc)[2], +static av_always_inline void mc_luma_unscaled(VP9TileData *td, const vp9_mc_func (*mc)[2], uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *ref, ptrdiff_t ref_stride, - ThreadFrame *ref_frame, - ptrdiff_t y, ptrdiff_t x, const VP56mv *mv, + const ThreadFrame *ref_frame, + ptrdiff_t y, ptrdiff_t x, const VP9mv *mv, int bw, int bh, int w, int h, int bytesperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; int mx = mv->x, my = mv->y, th; y += my >> 3; @@ -331,16 +331,16 @@ mc[!!mx][!!my](dst, dst_stride, ref, ref_stride, bh, mx << 1, my << 1); } -static av_always_inline void mc_chroma_unscaled(VP9TileData *td, vp9_mc_func (*mc)[2], +static av_always_inline void mc_chroma_unscaled(VP9TileData *td, const vp9_mc_func (*mc)[2], uint8_t *dst_u, uint8_t *dst_v, ptrdiff_t dst_stride, const uint8_t *ref_u, ptrdiff_t src_stride_u, const uint8_t *ref_v, ptrdiff_t src_stride_v, - ThreadFrame *ref_frame, - ptrdiff_t y, ptrdiff_t x, const VP56mv *mv, + const ThreadFrame *ref_frame, + ptrdiff_t y, ptrdiff_t x, const VP9mv *mv, int bw, int bh, int w, int h, int bytesperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; int mx = mv->x * (1 << !s->ss_h), my = mv->y * (1 << !s->ss_v), th; y += my >> 4; @@ -404,16 +404,16 @@ #undef SCALED static av_always_inline void mc_luma_scaled(VP9TileData *td, vp9_scaled_mc_func smc, - vp9_mc_func (*mc)[2], + const vp9_mc_func (*mc)[2], uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *ref, ptrdiff_t ref_stride, - ThreadFrame *ref_frame, - ptrdiff_t y, ptrdiff_t x, const VP56mv *in_mv, + const ThreadFrame *ref_frame, + ptrdiff_t y, ptrdiff_t x, const VP9mv *in_mv, int px, int py, int pw, int ph, int bw, int bh, int w, int h, int bytesperpixel, const uint16_t *scale, const uint8_t *step) { - VP9Context *s = td->s; + const VP9Context *s = td->s; if (s->s.frames[CUR_FRAME].tf.f->width == ref_frame->f->width && s->s.frames[CUR_FRAME].tf.f->height == ref_frame->f->height) { mc_luma_unscaled(td, mc, dst, dst_stride, ref, ref_stride, ref_frame, @@ -423,7 +423,7 @@ int mx, my; int refbw_m1, refbh_m1; int th; - VP56mv mv; + VP9mv mv; mv.x = av_clip(in_mv->x, -(x + pw - px + 4) * 8, (s->cols * 8 - x + px + 3) * 8); mv.y = av_clip(in_mv->y, -(y + ph - py + 4) * 8, (s->rows * 8 - y + py + 3) * 8); @@ -462,18 +462,18 @@ } static av_always_inline void mc_chroma_scaled(VP9TileData *td, vp9_scaled_mc_func smc, - vp9_mc_func (*mc)[2], + const vp9_mc_func (*mc)[2], uint8_t *dst_u, uint8_t *dst_v, ptrdiff_t dst_stride, const uint8_t *ref_u, ptrdiff_t src_stride_u, const uint8_t *ref_v, ptrdiff_t src_stride_v, - ThreadFrame *ref_frame, - ptrdiff_t y, ptrdiff_t x, const VP56mv *in_mv, + const ThreadFrame *ref_frame, + ptrdiff_t y, ptrdiff_t x, const VP9mv *in_mv, int px, int py, int pw, int ph, int bw, int bh, int w, int h, int bytesperpixel, const uint16_t *scale, const uint8_t *step) { - VP9Context *s = td->s; + const VP9Context *s = td->s; if (s->s.frames[CUR_FRAME].tf.f->width == ref_frame->f->width && s->s.frames[CUR_FRAME].tf.f->height == ref_frame->f->height) { mc_chroma_unscaled(td, mc, dst_u, dst_v, dst_stride, ref_u, src_stride_u, @@ -483,7 +483,7 @@ int mx, my; int refbw_m1, refbh_m1; int th; - VP56mv mv; + VP9mv mv; if (s->ss_h) { // BUG https://code.google.com/p/webm/issues/detail?id=820 @@ -568,7 +568,7 @@ static av_always_inline void inter_recon(VP9TileData *td, int bytesperpixel) { - VP9Context *s = td->s; + const VP9Context *s = td->s; VP9Block *b = td->b; int row = td->row, col = td->col; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9shared.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9shared.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9shared.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vp9shared.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,9 +27,10 @@ #include #include +#include "libavutil/mem_internal.h" + #include "vp9.h" #include "threadframe.h" -#include "vp56.h" enum BlockPartition { PARTITION_NONE, // [ ] <-. @@ -51,8 +52,13 @@ PRED_SWITCHABLE, }; +typedef struct VP9mv { + DECLARE_ALIGNED(4, int16_t, x); + int16_t y; +} VP9mv; + typedef struct VP9mvrefPair { - VP56mv mv[2]; + VP9mv mv[2]; int8_t ref[2]; } VP9mvrefPair; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * VP5/6/8 decoder + * Copyright (c) 2010 Fiona Glaser + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/error.h" +#include "bytestream.h" +#include "vpx_rac.h" + +const uint8_t ff_vpx_norm_shift[256]= { + 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +int ff_vpx_init_range_decoder(VPXRangeCoder *c, const uint8_t *buf, int buf_size) +{ + c->high = 255; + c->bits = -16; + c->buffer = buf; + c->end = buf + buf_size; + c->end_reached = 0; + if (buf_size < 1) + return AVERROR_INVALIDDATA; + c->code_word = bytestream_get_be24(&c->buffer); + return 0; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vpx_rac.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Common VP5-VP9 range decoder stuff + */ + +#ifndef AVCODEC_VPX_RAC_H +#define AVCODEC_VPX_RAC_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "bytestream.h" + +typedef struct VPXRangeCoder { + int high; + int bits; /* stored negated (i.e. negative "bits" is a positive number of + bits left) in order to eliminate a negate in cache refilling */ + const uint8_t *buffer; + const uint8_t *end; + unsigned int code_word; + int end_reached; +} VPXRangeCoder; + +extern const uint8_t ff_vpx_norm_shift[256]; +int ff_vpx_init_range_decoder(VPXRangeCoder *c, const uint8_t *buf, int buf_size); + +/** + * returns 1 if the end of the stream has been reached, 0 otherwise. + */ +static av_always_inline int vpx_rac_is_end(VPXRangeCoder *c) +{ + if (c->end <= c->buffer && c->bits >= 0) + c->end_reached ++; + return c->end_reached > 10; +} + +static av_always_inline unsigned int vpx_rac_renorm(VPXRangeCoder *c) +{ + int shift = ff_vpx_norm_shift[c->high]; + int bits = c->bits; + unsigned int code_word = c->code_word; + + c->high <<= shift; + code_word <<= shift; + bits += shift; + if(bits >= 0 && c->buffer < c->end) { + code_word |= bytestream_get_be16(&c->buffer) << bits; + bits -= 16; + } + c->bits = bits; + return code_word; +} + +#if ARCH_ARM +#include "arm/vpx_arith.h" +#elif ARCH_X86 +#include "x86/vpx_arith.h" +#endif + +#ifndef vpx_rac_get_prob +#define vpx_rac_get_prob vpx_rac_get_prob +static av_always_inline int vpx_rac_get_prob(VPXRangeCoder *c, uint8_t prob) +{ + unsigned int code_word = vpx_rac_renorm(c); + unsigned int low = 1 + (((c->high - 1) * prob) >> 8); + unsigned int low_shift = low << 16; + int bit = code_word >= low_shift; + + c->high = bit ? c->high - low : low; + c->code_word = bit ? code_word - low_shift : code_word; + + return bit; +} +#endif + +#ifndef vpx_rac_get_prob_branchy +// branchy variant, to be used where there's a branch based on the bit decoded +static av_always_inline int vpx_rac_get_prob_branchy(VPXRangeCoder *c, int prob) +{ + unsigned long code_word = vpx_rac_renorm(c); + unsigned low = 1 + (((c->high - 1) * prob) >> 8); + unsigned low_shift = low << 16; + + if (code_word >= low_shift) { + c->high -= low; + c->code_word = code_word - low_shift; + return 1; + } + + c->high = low; + c->code_word = code_word; + return 0; +} +#endif + +static av_always_inline int vpx_rac_get(VPXRangeCoder *c) +{ + unsigned int code_word = vpx_rac_renorm(c); + /* equiprobable */ + int low = (c->high + 1) >> 1; + unsigned int low_shift = low << 16; + int bit = code_word >= low_shift; + if (bit) { + c->high -= low; + code_word -= low_shift; + } else { + c->high = low; + } + + c->code_word = code_word; + return bit; +} + +#endif /* AVCODEC_VPX_RAC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqavideo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqavideo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqavideo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqavideo.c 2023-03-03 13:29:59.000000000 +0000 @@ -70,15 +70,13 @@ */ #include -#include #include #include "libavutil/intreadwrite.h" -#include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define PALETTE_COUNT 256 #define VQA_HEADER_SIZE 0x2A @@ -848,7 +846,7 @@ const FFCodec ff_vqa_decoder = { .p.name = "vqavideo", - .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"), + CODEC_LONG_NAME("Westwood Studios VQA (Vector Quantized Animation) video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WS_VQA, .priv_data_size = sizeof(VqaContext), @@ -857,5 +855,5 @@ FF_CODEC_DECODE_CB(vqa_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .defaults = vqa_defaults, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqcdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqcdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqcdec.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/vqcdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,439 @@ +/* + * ViewQuest VQC decoder + * Copyright (C) 2022 Peter Ross + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "avcodec.h" +#include "get_bits.h" +#include "codec_internal.h" +#include "decode.h" +#include "libavutil/thread.h" + +#define VECTOR_VLC_BITS 6 + +static const uint8_t vector_nbits[] = { + 2, 4, 4, 4, 4, 2, 4, 4, + 6, 6, 6, 6, 6, 6, 6, 6 +}; + +enum { + SKIP_3 = 0x10, + SKIP_4, + SKIP_5, + SKIP_6, + STOP_RUN, + SIGNED_8BIT, + SIGNED_6BIT +}; + +/* vector symbols are signed, but returned unsigned by get_vlc2() + codebook indexes are cast as uint8_t in seed_codebook() to compensate */ +static const int8_t vector_symbols[] = { + 0, SKIP_3, SKIP_4, SKIP_5, SKIP_6, STOP_RUN, 1, -1, + 2, 3, 4, SIGNED_8BIT, -2, -3, -4, SIGNED_6BIT +}; + +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), + vector_nbits, 1, + vector_symbols, 1, 1, + 0, 0, 1 << VECTOR_VLC_BITS); +} + +typedef struct VqcContext { + AVFrame *frame; + uint8_t * vectors; + int16_t * coeff, *tmp1, *tmp2; + int16_t codebook[4][256]; +} VqcContext; + +static av_cold int vqc_decode_init(AVCodecContext * avctx) +{ + static AVOnce init_static_once = AV_ONCE_INIT; + VqcContext *s = avctx->priv_data; + + if (avctx->width & 15) + return AVERROR_PATCHWELCOME; + + s->vectors = av_malloc((avctx->width * avctx->height * 3) / 2); + if (!s->vectors) + return AVERROR(ENOMEM); + + s->coeff = av_malloc_array(2 * avctx->width, sizeof(s->coeff[0])); + if (!s->coeff) + return AVERROR(ENOMEM); + + s->tmp1 = av_malloc_array(avctx->width / 2, sizeof(s->tmp1[0])); + if (!s->tmp1) + return AVERROR(ENOMEM); + + s->tmp2 = av_malloc_array(avctx->width / 2, sizeof(s->tmp2[0])); + if (!s->tmp2) + return AVERROR(ENOMEM); + + avctx->pix_fmt = AV_PIX_FMT_YUV420P; + s->frame = av_frame_alloc(); + if (!s->frame) + return AVERROR(ENOMEM); + + ff_thread_once(&init_static_once, vqc_init_static_data); + + return 0; +} + +static int seed_pow1(int x) +{ + return x >= 1 && x <= 5 ? 1 << x : 0; +} + +static int seed_pow2(int x) +{ + return x >= 1 && x <= 4 ? 1 << x : 1; +} + +static int bias(int x, int c) +{ + if (x < 0) + return x - c; + else if (x > 0) + return x + c; + else + return 0; +} + +static void seed_codebooks(VqcContext * s, const int * seed) +{ + int book1 = -256 * seed[3]; + int book2 = -128 * seed[4]; + int book3 = -128 * seed[5]; + int book4 = -128 * seed[6]; + + for (int i = -128; i < 128; i++) { + s->codebook[0][(uint8_t)i] = book1; + s->codebook[1][(uint8_t)i] = bias(book2, seed[0]); + s->codebook[2][(uint8_t)i] = bias(book3, seed[1]); + s->codebook[3][(uint8_t)i] = bias(book4, seed[2]); + + book1 += 2 * seed[3]; + book2 += seed[4]; + book3 += seed[5]; + book4 += seed[6]; + } +} + +static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int width, int height) +{ + GetBitContext gb; + uint8_t * vectors = s->vectors; + uint8_t * vectors_end = s->vectors + (width * height * 3) / 2; + + memset(vectors, 0, 3 * width * height / 2); + + init_get_bits8(&gb, buf, size); + + for (int i = 0; i < 3 * width * height / 2 / 32; i++) { + uint8_t * dst = vectors; + int symbol; + + *dst++ = get_bits(&gb, 8); + *dst++ = get_bits(&gb, 8); + + while (show_bits(&gb, 2) != 2) { + if (dst >= vectors_end - 1) + return 0; + + if (get_bits_left(&gb) < 4) + return AVERROR_INVALIDDATA; + + if (!show_bits(&gb, 4)) { + *dst++ = 0; + *dst++ = 0; + skip_bits(&gb, 4); + continue; + } + + symbol = get_vlc2(&gb, vector_vlc.table, VECTOR_VLC_BITS, 1); + switch(symbol) { + case SKIP_3: dst += 3; break; + case SKIP_4: dst += 4; break; + case SKIP_5: dst += 5; break; + case SKIP_6: dst += 6; break; + case SIGNED_8BIT: *dst++ = get_sbits(&gb, 8); break; + case SIGNED_6BIT: *dst++ = get_sbits(&gb, 6); break; + default: + *dst++ = symbol; + } + } + + skip_bits(&gb, 2); + vectors += 32; + } + + return 0; +} + +static void load_coeffs(VqcContext * s, const uint8_t * v, int width, int coeff_width) +{ + int16_t * c0 = s->coeff; + int16_t * c1 = s->coeff + coeff_width; + int16_t * c0_125 = s->coeff + (coeff_width >> 3); + int16_t * c1_125 = s->coeff + coeff_width + (coeff_width >> 3); + int16_t * c0_25 = s->coeff + (coeff_width >> 2); + int16_t * c1_25 = s->coeff + coeff_width + (coeff_width >> 2); + int16_t * c0_5 = s->coeff + (coeff_width >> 1); + int16_t * c1_5 = s->coeff + coeff_width + (coeff_width >> 1); + + for (int i = 0; i < width; i++) { + c0[0] = s->codebook[0][v[0]]; + c0[1] = s->codebook[0][v[1]]; + c0 += 2; + + c1[0] = s->codebook[0][v[2]]; + c1[1] = s->codebook[0][v[3]]; + c1 += 2; + + c0_125[0] = s->codebook[1][v[4]]; + c0_125[1] = s->codebook[1][v[5]]; + c0_125 += 2; + + c1_125[0] = s->codebook[1][v[6]]; + c1_125[1] = s->codebook[1][v[7]]; + c1_125 += 2; + + c0_25[0] = s->codebook[2][v[8]]; + c0_25[1] = s->codebook[2][v[9]]; + c0_25[2] = s->codebook[2][v[10]]; + c0_25[3] = s->codebook[2][v[11]]; + c0_25 += 4; + + c1_25[0] = s->codebook[2][v[12]]; + c1_25[1] = s->codebook[2][v[13]]; + c1_25[2] = s->codebook[2][v[14]]; + c1_25[3] = s->codebook[2][v[15]]; + c1_25 += 4; + + if (v[16] | v[17] | v[18] | v[19]) { + c0_5[0] = s->codebook[3][v[16]]; + c0_5[1] = s->codebook[3][v[17]]; + c0_5[2] = s->codebook[3][v[18]]; + c0_5[3] = s->codebook[3][v[19]]; + } else { + c0_5[0] = c0_5[1] = c0_5[2] = c0_5[3] = 0; + } + + if (v[20] | v[21] | v[22] | v[23]) { + c0_5[4] = s->codebook[3][v[20]]; + c0_5[5] = s->codebook[3][v[21]]; + c0_5[6] = s->codebook[3][v[22]]; + c0_5[7] = s->codebook[3][v[23]]; + } else { + c0_5[4] = c0_5[5] = c0_5[6] = c0_5[7] = 0; + } + c0_5 += 8; + + if (v[24] | v[25] | v[26] | v[27]) { + c1_5[0] = s->codebook[3][v[24]]; + c1_5[1] = s->codebook[3][v[25]]; + c1_5[2] = s->codebook[3][v[26]]; + c1_5[3] = s->codebook[3][v[27]]; + } else { + c1_5[0] = c1_5[1] = c1_5[2] = c1_5[3] = 0; + } + + if (v[28] | v[29] | v[30] | v[31]) { + c1_5[4] = s->codebook[3][v[28]]; + c1_5[5] = s->codebook[3][v[29]]; + c1_5[6] = s->codebook[3][v[30]]; + c1_5[7] = s->codebook[3][v[31]]; + } else { + c1_5[4] = c1_5[5] = c1_5[6] = c1_5[7] = 0; + } + c1_5 += 8; + + v += 32; + } +} + +static void transform1(const int16_t * a, const int16_t * b, int16_t * dst, int width) +{ + int s0 = a[0] + (b[0] >> 1); + + for (int i = 0; i < width / 2 - 1; i++) { + dst[i * 2] = s0; + s0 = a[i + 1] + ((b[i] + b[i + 1]) >> 1); + dst[i * 2 + 1] = ((dst[i * 2] + s0) >> 1) - 2 * b[i]; + } + + dst[width - 2] = s0; + dst[width - 1] = a[width / 2 - 1] + ((b[width / 2 - 2] - 2 * b[width / 2 - 1]) >> 2) - b[width / 2 - 1]; +} + +static uint8_t clip(int x) +{ + return x >= -128 ? x <= 127 ? x + 0x80 : 0x00 : 0xFF; +} + +static void transform2(const int16_t * a, const int16_t * b, uint8_t * dst, int width) +{ + int s0 = a[0] + (b[0] >> 1); + int tmp; + + for (int i = 0; i < width / 2 - 1; i++) { + dst[i * 2] = av_clip_uint8(s0 + 0x80); + tmp = a[i + 1] + ((b[i] + b[i + 1]) >> 1); + dst[i * 2 + 1] = av_clip_uint8(((tmp + s0) >> 1) - 2 * b[i] + 0x80); + s0 = tmp; + } + + dst[width - 2] = clip(s0); + dst[width - 1] = clip(a[width / 2 - 1] + ((b[width / 2 - 2] - 2 * b[width / 2 - 1]) >> 2) - b[width / 2 - 1]); +} + +static void decode_strip(VqcContext * s, uint8_t * dst, int stride, int width) +{ + const int16_t * coeff; + + for (int i = 0; i < width; i++) { + int v0 = s->coeff[i]; + int v1 = s->coeff[width + i]; + s->coeff[i] = v0 - v1; + s->coeff[width + i] = v0 + v1; + } + + coeff = s->coeff; + + transform1(coeff, coeff + width / 8, s->tmp1, width / 4); + transform1(s->tmp1, coeff + width / 4, s->tmp2, width / 2); + transform2(s->tmp2, coeff + width / 2, dst, width); + + coeff += width; + dst += stride; + + transform1(coeff, coeff + width / 8, s->tmp1, width / 4); + transform1(s->tmp1, coeff + width / 4, s->tmp2, width / 2); + transform2(s->tmp2, coeff + width / 2, dst, width); +} + +static void decode_frame(VqcContext * s, int width, int height) +{ + uint8_t * vectors = s->vectors; + uint8_t * y = s->frame->data[0]; + uint8_t * u = s->frame->data[1]; + uint8_t * v = s->frame->data[2]; + + for (int j = 0; j < height / 4; j++) { + load_coeffs(s, vectors, width / 16, width); + decode_strip(s, y, s->frame->linesize[0], width); + vectors += 2 * width; + y += 2 * s->frame->linesize[0]; + + load_coeffs(s, vectors, width / 32, width / 2); + decode_strip(s, u, s->frame->linesize[1], width / 2); + vectors += width; + u += 2 * s->frame->linesize[1]; + + load_coeffs(s, vectors, width / 16, width); + decode_strip(s, y, s->frame->linesize[0], width); + vectors += 2 * width; + y += 2 * s->frame->linesize[0]; + + load_coeffs(s, vectors, width / 32, width / 2); + decode_strip(s, v, s->frame->linesize[2], width / 2); + vectors += width; + v += 2 * s->frame->linesize[2]; + } +} + +static int vqc_decode_frame(AVCodecContext *avctx, AVFrame * rframe, + int * got_frame, AVPacket * avpkt) +{ + VqcContext *s = avctx->priv_data; + int ret; + const uint8_t * buf = avpkt->data; + int cache, seed[7], gamma, contrast; + + if (avpkt->size < 7) + return AVERROR_INVALIDDATA; + + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) + return ret; + + av_log(avctx, AV_LOG_DEBUG, "VQC%d format\n", (buf[2] & 1) + 1); + + if (((buf[0] >> 1) & 7) != 5) { + avpriv_request_sample(avctx, "subversion != 5\n"); + return AVERROR_PATCHWELCOME; + } + + cache = AV_RL24(buf + 4); + seed[2] = seed_pow1((cache >> 1) & 7); + seed[1] = seed_pow1((cache >> 4) & 7); + seed[0] = seed_pow1((cache >> 7) & 7); + seed[6] = seed_pow2((cache >> 10) & 7); + seed[5] = seed_pow2((cache >> 13) & 7); + seed[4] = seed_pow2((cache >> 16) & 7); + seed[3] = seed_pow2((cache >> 19) & 7); + + gamma = buf[0] >> 4; + contrast = AV_RL16(buf + 2) >> 1; + if (gamma || contrast) + avpriv_request_sample(avctx, "gamma=0x%x, contrast=0x%x\n", gamma, contrast); + + seed_codebooks(s, seed); + ret = decode_vectors(s, buf + 7, avpkt->size - 7, avctx->width, avctx->height); + if (ret < 0) + return ret; + decode_frame(s, avctx->width, avctx->height); + + if ((ret = av_frame_ref(rframe, s->frame)) < 0) + return ret; + + *got_frame = 1; + + return avpkt->size; +} + +static av_cold int vqc_decode_end(AVCodecContext * avctx) +{ + VqcContext *s = avctx->priv_data; + + av_freep(&s->vectors); + av_freep(&s->coeff); + av_freep(&s->tmp1); + av_freep(&s->tmp2); + av_frame_free(&s->frame); + + return 0; +} + +const FFCodec ff_vqc_decoder = { + .p.name = "vqc", + CODEC_LONG_NAME("ViewQuest VQC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VQC, + .priv_data_size = sizeof(VqcContext), + .init = vqc_decode_init, + .close = vqc_decode_end, + FF_CODEC_DECODE_CB(vqc_decode_frame), + .p.capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavarc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavarc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavarc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavarc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,505 @@ +/* + * WavArc 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 "get_bits.h" +#include "bytestream.h" +#include "mathops.h" +#include "unary.h" + +typedef struct WavArcContext { + GetBitContext gb; + + int shift; + int nb_samples; + int offset; + int align; + + int eof; + int skip; + uint8_t *bitstream; + int64_t max_framesize; + int bitstream_size; + int bitstream_index; + + int pred[2][70]; + int filter[2][70]; + int samples[2][640]; +} WavArcContext; + +static av_cold int wavarc_init(AVCodecContext *avctx) +{ + WavArcContext *s = avctx->priv_data; + + if (avctx->extradata_size < 52) + return AVERROR_INVALIDDATA; + if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F')) + return AVERROR_INVALIDDATA; + if (AV_RL32(avctx->extradata + 24) != MKTAG('W','A','V','E')) + return AVERROR_INVALIDDATA; + if (AV_RL32(avctx->extradata + 28) != MKTAG('f','m','t',' ')) + return AVERROR_INVALIDDATA; + if (AV_RL16(avctx->extradata + 38) != 1 && + AV_RL16(avctx->extradata + 38) != 2) + return AVERROR_INVALIDDATA; + + av_channel_layout_uninit(&avctx->ch_layout); + av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38)); + avctx->sample_rate = AV_RL32(avctx->extradata + 40); + + s->align = avctx->ch_layout.nb_channels; + + switch (AV_RL16(avctx->extradata + 50)) { + case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; + case 16: s->align *= 2; + avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; + } + + s->shift = 0; + switch (avctx->codec_tag) { + case MKTAG('0','C','P','Y'): + s->nb_samples = 640; + s->offset = 0; + break; + case MKTAG('1','D','I','F'): + s->nb_samples = 256; + s->offset = 4; + break; + case MKTAG('2','S','L','P'): + case MKTAG('3','N','L','P'): + case MKTAG('4','A','L','P'): + s->nb_samples = 570; + s->offset = 70; + break; + default: + return AVERROR_INVALIDDATA; + } + + s->max_framesize = s->nb_samples * 16; + s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + return 0; +} + +static unsigned get_urice(GetBitContext *gb, int k) +{ + unsigned x = get_unary(gb, 1, get_bits_left(gb)); + unsigned y = get_bits_long(gb, k); + unsigned z = (x << k) | y; + + return z; +} + +static int get_srice(GetBitContext *gb, int k) +{ + unsigned z = get_urice(gb, k); + + return (z & 1) ? ~((int)(z >> 1)) : z >> 1; +} + +static void do_stereo(WavArcContext *s, int ch, int correlated, int len) +{ + const int nb_samples = s->nb_samples; + const int shift = s->shift; + + if (ch == 0) { + if (correlated) { + for (int n = 0; n < len; n++) { + s->samples[0][n] = s->samples[0][nb_samples + n] >> shift; + s->samples[1][n] = s->pred[1][n] >> shift; + } + } else { + for (int n = 0; n < len; n++) { + s->samples[0][n] = s->samples[0][nb_samples + n] >> shift; + s->samples[1][n] = s->pred[0][n] >> shift; + } + } + } else { + if (correlated) { + for (int n = 0; n < nb_samples; n++) + s->samples[1][n + len] += 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]; + } + } +} + +static int decode_0cpy(AVCodecContext *avctx, + WavArcContext *s, GetBitContext *gb) +{ + const int bits = s->align * 8; + + s->nb_samples = FFMIN(640, get_bits_left(gb) / bits); + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8P: + for (int n = 0; n < s->nb_samples; n++) { + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) + s->samples[ch][n] = get_bits(gb, 8) - 0x80; + } + break; + case AV_SAMPLE_FMT_S16P: + for (int n = 0; n < s->nb_samples; n++) { + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) + s->samples[ch][n] = sign_extend(av_bswap16(get_bits(gb, 16)), 16); + } + break; + } + return 0; +} + +static int decode_1dif(AVCodecContext *avctx, + WavArcContext *s, GetBitContext *gb) +{ + int ch, finished, fill, correlated; + + ch = 0; + finished = 0; + while (!finished) { + int *samples = s->samples[ch]; + int k, block_type; + + if (get_bits_left(gb) <= 0) + return AVERROR_INVALIDDATA; + + block_type = get_urice(gb, 1); + 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) + return AVERROR_INVALIDDATA; + } + + switch (block_type) { + case 8: + s->eof = 1; + return AVERROR_EOF; + case 7: + s->nb_samples = get_bits(gb, 8); + continue; + case 6: + s->shift = get_urice(gb, 2); + continue; + case 5: + if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { + fill = (int8_t)get_bits(gb, 8); + fill -= 0x80; + } else { + fill = (int16_t)get_bits(gb, 16); + fill -= 0x8000; + } + + for (int n = 0; n < s->nb_samples; n++) + samples[n + 4] = fill; + finished = 1; + break; + case 4: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 4] = 0; + finished = 1; + 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 + 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]); + finished = 1; + break; + case 1: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 4] = get_srice(gb, k) + samples[n + 3]; + finished = 1; + break; + case 0: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 4] = get_srice(gb, k); + finished = 1; + break; + default: + return AVERROR_INVALIDDATA; + } + + if (finished == 1 && avctx->ch_layout.nb_channels == 2) { + if (ch == 0) + correlated = get_bits1(gb); + finished = ch != 0; + do_stereo(s, ch, correlated, 4); + ch = 1; + } + } + + if (avctx->ch_layout.nb_channels == 1) { + for (int n = 0; n < 4; n++) + s->samples[0][n] = s->samples[0][s->nb_samples + n]; + } + + return 0; +} + +static int decode_2slp(AVCodecContext *avctx, + WavArcContext *s, GetBitContext *gb) +{ + int ch, finished, fill, correlated, order; + + ch = 0; + finished = 0; + while (!finished) { + int *samples = s->samples[ch]; + int k, block_type; + + if (get_bits_left(gb) <= 0) + return AVERROR_INVALIDDATA; + + block_type = get_urice(gb, 1); + 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) + return AVERROR_INVALIDDATA; + } + + switch (block_type) { + case 9: + s->eof = 1; + return AVERROR_EOF; + case 8: + s->nb_samples = get_urice(gb, 8); + if (s->nb_samples > 570) { + s->nb_samples = 570; + return AVERROR_INVALIDDATA; + } + continue; + case 7: + s->shift = get_urice(gb, 2); + continue; + case 6: + if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { + fill = (int8_t)get_bits(gb, 8); + fill -= 0x80; + } else { + fill = (int16_t)get_bits(gb, 16); + fill -= 0x8000; + } + + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] = fill; + finished = 1; + break; + case 5: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] = 0; + finished = 1; + 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 + 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]); + finished = 1; + break; + case 2: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] = get_srice(gb, k); + finished = 1; + break; + case 1: + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] = get_srice(gb, k) + samples[n + 69]; + finished = 1; + break; + case 0: + order = get_urice(gb, 2); + for (int o = 0; o < order; o++) + s->filter[ch][o] = get_srice(gb, 2); + for (int n = 0; n < s->nb_samples; n++) { + int sum = 15; + + for (int o = 0; o < order; o++) + sum += s->filter[ch][o] * samples[n + 70 - o - 1]; + + samples[n + 70] = get_srice(gb, k) + (sum >> 4); + } + finished = 1; + break; + default: + return AVERROR_INVALIDDATA; + } + + if (finished == 1 && avctx->ch_layout.nb_channels == 2) { + if (ch == 0) + correlated = get_bits1(gb); + finished = ch != 0; + do_stereo(s, ch, correlated, 70); + ch = 1; + } + } + + if (avctx->ch_layout.nb_channels == 1) { + for (int n = 0; n < 70; n++) + s->samples[0][n] = s->samples[0][s->nb_samples + n]; + } + + return 0; +} + +static int wavarc_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *pkt) +{ + WavArcContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + int buf_size, input_buf_size; + const uint8_t *buf; + int ret, n; + + if ((!pkt->size && !s->bitstream_size) || s->nb_samples == 0 || s->eof) { + *got_frame_ptr = 0; + return pkt->size; + } + + buf_size = FFMIN(pkt->size, s->max_framesize - s->bitstream_size); + input_buf_size = buf_size; + if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE > s->max_framesize) { + memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size); + s->bitstream_index = 0; + } + if (pkt->data) + memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], pkt->data, buf_size); + buf = &s->bitstream[s->bitstream_index]; + buf_size += s->bitstream_size; + s->bitstream_size = buf_size; + if (buf_size < s->max_framesize && pkt->data) { + *got_frame_ptr = 0; + return input_buf_size; + } + + if ((ret = init_get_bits8(gb, buf, buf_size)) < 0) + goto fail; + skip_bits(gb, s->skip); + + switch (avctx->codec_tag) { + case MKTAG('0','C','P','Y'): + ret = decode_0cpy(avctx, s, gb); + break; + case MKTAG('1','D','I','F'): + ret = decode_1dif(avctx, s, gb); + break; + case MKTAG('2','S','L','P'): + case MKTAG('3','N','L','P'): + case MKTAG('4','A','L','P'): + ret = decode_2slp(avctx, s, gb); + break; + default: + ret = AVERROR_INVALIDDATA; + } + + if (ret < 0) + goto fail; + + s->skip = get_bits_count(gb) - 8 * (get_bits_count(gb) / 8); + n = get_bits_count(gb) / 8; + + if (n > buf_size) { +fail: + s->bitstream_size = 0; + s->bitstream_index = 0; + if (ret == AVERROR_EOF) + return 0; + return AVERROR_INVALIDDATA; + } + + frame->nb_samples = s->nb_samples; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto fail; + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8P: + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + uint8_t *dst = (uint8_t *)frame->extended_data[ch]; + const int *src = s->samples[ch] + s->offset; + + for (int n = 0; n < frame->nb_samples; n++) + dst[n] = src[n] * (1 << s->shift) + 0x80U; + } + break; + case AV_SAMPLE_FMT_S16P: + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + int16_t *dst = (int16_t *)frame->extended_data[ch]; + const int *src = s->samples[ch] + s->offset; + + for (int n = 0; n < frame->nb_samples; n++) + dst[n] = src[n] * (1 << s->shift); + } + break; + } + + *got_frame_ptr = 1; + + if (s->bitstream_size) { + s->bitstream_index += n; + s->bitstream_size -= n; + return input_buf_size; + } + + return n; +} + +static av_cold int wavarc_close(AVCodecContext *avctx) +{ + WavArcContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + s->bitstream_size = 0; + + return 0; +} + +const FFCodec ff_wavarc_decoder = { + .p.name = "wavarc", + CODEC_LONG_NAME("Waveform Archiver"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WAVARC, + .priv_data_size = sizeof(WavArcContext), + .init = wavarc_init, + FF_CODEC_DECODE_CB(wavarc_decode), + .close = wavarc_close, + .p.capabilities = AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_SUBFRAMES | + AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_NONE }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpack.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpack.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpack.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpack.c 2023-03-03 13:29:59.000000000 +0000 @@ -119,17 +119,17 @@ #define LEVEL_DECAY(a) (((a) + 0x80) >> 8) -static av_always_inline unsigned get_tail(GetBitContext *gb, int k) +static av_always_inline unsigned get_tail(GetBitContext *gb, unsigned k) { int p, e, res; if (k < 1) return 0; p = av_log2(k); - e = (1 << (p + 1)) - k - 1; - res = get_bitsz(gb, p); + e = (1LL << (p + 1)) - k - 1; + res = get_bits_long(gb, p); if (res >= e) - res = (res << 1) - e + get_bits1(gb); + res = res * 2U - e + get_bits1(gb); return res; } @@ -266,10 +266,6 @@ INC_MED(2); } if (!c->error_limit) { - if (add >= 0x2000000U) { - av_log(ctx->avctx, AV_LOG_ERROR, "k %d is too large\n", add); - goto error; - } ret = base + get_tail(gb, add); if (get_bits_left(gb) <= 0) goto error; @@ -499,6 +495,8 @@ sp[0].fltr0 = 0; } + if (DSD_BYTE_READY(high, low) && !bytestream2_get_bytes_left(&s->gbyte)) + return AVERROR_INVALIDDATA; while (DSD_BYTE_READY(high, low) && bytestream2_get_bytes_left(&s->gbyte)) { value = (value << 8) | bytestream2_get_byte(&s->gbyte); high = (high << 8) | 0xff; @@ -534,6 +532,8 @@ sp[1].fltr0 = 0; } + if (DSD_BYTE_READY(high, low) && !bytestream2_get_bytes_left(&s->gbyte)) + return AVERROR_INVALIDDATA; while (DSD_BYTE_READY(high, low) && bytestream2_get_bytes_left(&s->gbyte)) { value = (value << 8) | bytestream2_get_byte(&s->gbyte); high = (high << 8) | 0xff; @@ -1616,7 +1616,7 @@ static int dsd_channel(AVCodecContext *avctx, void *frmptr, int jobnr, int threadnr) { - WavpackContext *s = avctx->priv_data; + const WavpackContext *s = avctx->priv_data; AVFrame *frame = frmptr; ff_dsd2pcm_translate (&s->dsdctx [jobnr], s->samples, 0, @@ -1703,7 +1703,7 @@ const FFCodec ff_wavpack_decoder = { .p.name = "wavpack", - .p.long_name = NULL_IF_CONFIG_SMALL("WavPack"), + CODEC_LONG_NAME("WavPack"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WAVPACK, .priv_data_size = sizeof(WavpackContext), @@ -1711,9 +1711,9 @@ .close = wavpack_decode_end, FF_CODEC_DECODE_CB(wavpack_decode_frame), .flush = wavpack_decode_flush, - .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), + UPDATE_THREAD_CONTEXT(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpackenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpackenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpackenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wavpackenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "put_bits.h" #include "bytestream.h" #include "wavpackenc.h" @@ -2905,9 +2904,7 @@ } s->sample_index += frame->nb_samples; - avpkt->pts = frame->pts; avpkt->size = buf - avpkt->data; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; return 0; } @@ -2963,19 +2960,19 @@ const FFCodec ff_wavpack_encoder = { .p.name = "wavpack", - .p.long_name = NULL_IF_CONFIG_SMALL("WavPack"), + CODEC_LONG_NAME("WavPack"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WAVPACK, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(WavPackEncodeContext), .p.priv_class = &wavpack_encoder_class, .init = wavpack_encode_init, FF_CODEC_ENCODE_CB(wavpack_encode_frame), .close = wavpack_encode_close, - .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpdec.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * WBMP (Wireless Application Protocol Bitmap) image + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "codec_internal.h" +#include "decode.h" +#include "thread.h" + +static unsigned int getv(GetByteContext * gb) +{ + int i; + unsigned int v = 0; + + do { + i = bytestream2_get_byte(gb); + v = (v << 7) | (i & 0x7F); + } while (i & 0x80); + return v; +} + +static void readbits(uint8_t * dst, int width, int height, int linesize, const uint8_t * src, int size) +{ + int wpad = (width + 7) / 8; + for (int j = 0; j < height && size > 0; j++) { + memcpy(dst, src, FFMIN(wpad, size)); + src += wpad; + size -= wpad; + dst += linesize; + } +} + +static int wbmp_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) +{ + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size, width, height, ret; + GetByteContext gb; + + bytestream2_init(&gb, buf, buf_size); + + if (getv(&gb)) + return AVERROR_INVALIDDATA; + bytestream2_skip(&gb, 1); + width = getv(&gb); + height = getv(&gb); + + if ((ret = ff_set_dimensions(avctx, width, height)) < 0) + return ret; + + avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; + if ((ret = ff_thread_get_buffer(avctx, p, 0)) < 0) + return ret; + + if (p->linesize[0] == (width + 7) / 8) + bytestream2_get_buffer(&gb, p->data[0], height * ((width + 7) / 8)); + else + readbits(p->data[0], width, height, p->linesize[0], gb.buffer, gb.buffer_end - gb.buffer); + + p->key_frame = 1; + p->pict_type = AV_PICTURE_TYPE_I; + + *got_frame = 1; + + return buf_size; +} + +const FFCodec ff_wbmp_decoder = { + .p.name = "wbmp", + CODEC_LONG_NAME("WBMP (Wireless Application Protocol Bitmap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WBMP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + FF_CODEC_DECODE_CB(wbmp_decode_frame), +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpenc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wbmpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * WBMP (Wireless Application Protocol Bitmap) image + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "codec_internal.h" +#include "encode.h" + +static void putv(uint8_t ** bufp, unsigned int v) +{ + unsigned int vv = 0; + int n = 0; + + while (vv != v) + vv += v & (0x7F << 7 * n++); + + while (--n > 0) + bytestream_put_byte(bufp, 0x80 | (v & (0x7F << 7 * n)) >> 7 * n); + + bytestream_put_byte(bufp, v & 0x7F); +} + +static void writebits(uint8_t ** bufp, const uint8_t * src, int width, int height, int linesize) +{ + int wpad = (width + 7) / 8; + for (int j = 0; j < height; j++) { + memcpy(*bufp, src, wpad); + *bufp += wpad; + src += linesize; + } +} + +static int wbmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet) +{ + int64_t size = avctx->height * ((avctx->width + 7) / 8) + 32; + uint8_t *buf; + int ret; + + if ((ret = ff_get_encode_buffer(avctx, pkt, size, 0)) < 0) + return ret; + + buf = pkt->data; + + putv(&buf, 0); + bytestream_put_byte(&buf, 0); + putv(&buf, avctx->width); + putv(&buf, avctx->height); + + if (frame->linesize[0] == (avctx->width + 7) / 8) + bytestream_put_buffer(&buf, frame->data[0], avctx->height * ((avctx->width + 7) / 8)); + else + writebits(&buf, frame->data[0], avctx->width, avctx->height, frame->linesize[0]); + + av_shrink_packet(pkt, buf - pkt->data); + + *got_packet = 1; + return 0; +} + +const FFCodec ff_wbmp_encoder = { + .p.name = "wbmp", + CODEC_LONG_NAME("WBMP (Wireless Application Protocol Bitmap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WBMP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + FF_CODEC_ENCODE_CB(wbmp_encode_frame), + .p.pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_MONOBLACK, + AV_PIX_FMT_NONE + }, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wcmv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wcmv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wcmv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wcmv.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,15 +21,13 @@ */ #include -#include -#include #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include @@ -158,7 +156,7 @@ if (bytestream2_get_bytes_left(&gb) < 8LL * blocks) return AVERROR_INVALIDDATA; - if (!avctx->frame_number) { + if (!avctx->frame_num) { ptrdiff_t linesize[4] = { s->prev_frame->linesize[0], 0, 0, 0 }; av_image_fill_black(s->prev_frame->data, linesize, avctx->pix_fmt, 0, avctx->width, avctx->height); @@ -242,7 +240,7 @@ const FFCodec ff_wcmv_decoder = { .p.name = "wcmv", - .p.long_name = NULL_IF_CONFIG_SMALL("WinCAM Motion Video"), + CODEC_LONG_NAME("WinCAM Motion Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WCMV, .priv_data_size = sizeof(WCMVContext), @@ -250,6 +248,5 @@ .close = decode_close, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webp.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,9 +46,9 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "exif.h" #include "get_bits.h" -#include "internal.h" #include "thread.h" #include "tiff_common.h" #include "vp8.h" @@ -1557,7 +1557,7 @@ const FFCodec ff_webp_decoder = { .p.name = "webp", - .p.long_name = NULL_IF_CONFIG_SMALL("WebP image"), + CODEC_LONG_NAME("WebP image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WEBP, .priv_data_size = sizeof(WebPContext), @@ -1565,5 +1565,5 @@ FF_CODEC_DECODE_CB(webp_decode_frame), .close = webp_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_ICC_PROFILES, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -100,12 +100,11 @@ const FFCodec ff_webvtt_decoder = { .p.name = "webvtt", - .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), + CODEC_LONG_NAME("WebVTT subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_WEBVTT, FF_CODEC_DECODE_SUB_CB(webvtt_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/webvttenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -213,12 +213,11 @@ const FFCodec ff_webvtt_encoder = { .p.name = "webvtt", - .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), + CODEC_LONG_NAME("WebVTT subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_WEBVTT, .priv_data_size = sizeof(WebVTTContext), .init = webvtt_encode_init, FF_CODEC_ENCODE_SUB_CB(webvtt_encode_frame), .close = webvtt_encode_close, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.c 2023-03-03 13:29:59.000000000 +0000 @@ -369,7 +369,7 @@ int i; for (i = 0; i < s->nb_block_sizes; i++) - ff_mdct_end(&s->mdct_ctx[i]); + av_tx_uninit(&s->mdct_ctx[i]); if (s->use_exp_vlc) ff_free_vlc(&s->exp_vlc); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmadec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmadec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmadec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmadec.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,6 +40,7 @@ #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "internal.h" #include "wma.h" @@ -110,8 +111,9 @@ /* init MDCT */ for (i = 0; i < s->nb_block_sizes; i++) { - ret = ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, - 1, 1.0 / 32768.0); + float scale = 1.0 / 32768.0; + ret = av_tx_init(&s->mdct_ctx[i], &s->mdct_fn[i], AV_TX_FLOAT_MDCT, + 1, 1 << (s->frame_len_bits - i), &scale, AV_TX_FULL_IMDCT); if (ret < 0) return ret; } @@ -447,7 +449,8 @@ int coef_nb_bits, total_gain; int nb_coefs[MAX_CHANNELS]; float mdct_norm; - FFTContext *mdct; + AVTXContext *mdct; + av_tx_fn mdct_fn; #ifdef TRACE ff_tlog(s->avctx, "***decode_block: %d:%d\n", @@ -756,14 +759,15 @@ } next: - mdct = &s->mdct_ctx[bsize]; + mdct = s->mdct_ctx[bsize]; + mdct_fn = s->mdct_fn[bsize]; for (ch = 0; ch < channels; ch++) { int n4, index; n4 = s->block_len / 2; if (s->channel_coded[ch]) - mdct->imdct_calc(mdct, s->output, s->coefs[ch]); + mdct_fn(mdct, s->output, s->coefs[ch], sizeof(float)); else if (!(s->ms_stereo && ch == 1)) memset(s->output, 0, sizeof(s->output)); @@ -841,6 +845,7 @@ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; + frame->pts = AV_NOPTS_VALUE; for (i = 0; i < s->avctx->ch_layout.nb_channels; i++) memcpy(frame->extended_data[i], &s->frame_out[i][0], frame->nb_samples * sizeof(s->frame_out[i][0])); @@ -1001,7 +1006,7 @@ #if CONFIG_WMAV1_DECODER const FFCodec ff_wmav1_decoder = { .p.name = "wmav1", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), + CODEC_LONG_NAME("Windows Media Audio 1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAV1, .priv_data_size = sizeof(WMACodecContext), @@ -1012,13 +1017,13 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_WMAV2_DECODER const FFCodec ff_wmav2_decoder = { .p.name = "wmav2", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), + CODEC_LONG_NAME("Windows Media Audio 2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAV2, .priv_data_size = sizeof(WMACodecContext), @@ -1029,6 +1034,6 @@ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "wma.h" #include "libavutil/avassert.h" @@ -93,7 +92,9 @@ /* init MDCT */ for (i = 0; i < s->nb_block_sizes; i++) { - ret = ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0); + float scale = 1.0f; + ret = av_tx_init(&s->mdct_ctx[i], &s->mdct_fn[i], AV_TX_FLOAT_MDCT, + 0, 1 << (s->frame_len_bits - i), &scale, 0); if (ret < 0) return ret; } @@ -110,10 +111,11 @@ static int apply_window_and_mdct(AVCodecContext *avctx, const AVFrame *frame) { WMACodecContext *s = avctx->priv_data; - float **audio = (float **) frame->extended_data; + const float *const *audio = (const float *const *) frame->extended_data; int len = frame->nb_samples; int window_index = s->frame_len_bits - s->block_len_bits; - FFTContext *mdct = &s->mdct_ctx[window_index]; + AVTXContext *mdct = s->mdct_ctx[window_index]; + av_tx_fn mdct_fn = s->mdct_fn[window_index]; int ch; const float *win = s->windows[window_index]; int window_len = 1 << s->block_len_bits; @@ -125,7 +127,7 @@ s->fdsp->vector_fmul_reverse(&s->output[window_len], s->frame_out[ch], win, len); s->fdsp->vector_fmul(s->frame_out[ch], s->frame_out[ch], win, len); - mdct->mdct_calc(mdct, s->coefs[ch], s->output); + mdct_fn(mdct, s->coefs[ch], s->output, sizeof(float)); if (!isfinite(s->coefs[ch][0])) { av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n"); return AVERROR(EINVAL); @@ -435,30 +437,32 @@ #if CONFIG_WMAV1_ENCODER const FFCodec ff_wmav1_encoder = { .p.name = "wmav1", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), + CODEC_LONG_NAME("Windows Media Audio 1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAV1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_superframe), .close = ff_wma_end, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_WMAV2_ENCODER const FFCodec ff_wmav2_encoder = { .p.name = "wmav2", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), + CODEC_LONG_NAME("Windows Media Audio 2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAV2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_superframe), .close = ff_wma_end, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wma.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,9 +24,9 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "avcodec.h" -#include "fft.h" #include "get_bits.h" #include "put_bits.h" @@ -115,8 +115,9 @@ float max_exponent[MAX_CHANNELS]; WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; DECLARE_ALIGNED(32, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE]; - DECLARE_ALIGNED(32, FFTSample, output)[BLOCK_MAX_SIZE * 2]; - FFTContext mdct_ctx[BLOCK_NB_SIZES]; + DECLARE_ALIGNED(32, float, output)[BLOCK_MAX_SIZE * 2]; + AVTXContext *mdct_ctx[BLOCK_NB_SIZES]; + av_tx_fn mdct_fn[BLOCK_NB_SIZES]; const float *windows[BLOCK_NB_SIZES]; /* output buffer for one frame and the last for IMDCT windowing */ DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmalosslessdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmalosslessdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmalosslessdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmalosslessdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,11 +30,10 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "put_bits.h" #include "lossless_audiodsp.h" -#include "wma.h" #include "wma_common.h" /** current decoder limitations */ @@ -783,7 +782,6 @@ s->channel_residues[ch][icoef] = input; \ } \ } \ - if (bits <= 16) emms_c(); \ } CD_LMS(16, WMALL_COEFF_PAD_SIZE) @@ -1194,16 +1192,15 @@ s->frame->nb_samples = 0; - if (!buf_size && s->num_saved_bits > get_bits_count(&s->gb)) { + if (!buf_size) { s->packet_done = 0; + if (s->num_saved_bits <= get_bits_count(&s->gb)) + return 0; if (!decode_frame(s)) s->num_saved_bits = 0; } else if (s->packet_done || s->packet_loss) { s->packet_done = 0; - if (!buf_size) - return 0; - s->next_packet_start = buf_size - FFMIN(avctx->block_align, buf_size); buf_size = FFMIN(avctx->block_align, buf_size); s->buf_bit_size = buf_size << 3; @@ -1301,7 +1298,7 @@ s->packet_offset = get_bits_count(gb) & 7; - return (s->packet_loss) ? AVERROR_INVALIDDATA : buf_size ? get_bits_count(gb) >> 3 : 0; + return (s->packet_loss) ? AVERROR_INVALIDDATA : get_bits_count(gb) >> 3; } static void flush(AVCodecContext *avctx) @@ -1329,7 +1326,7 @@ const FFCodec ff_wmalossless_decoder = { .p.name = "wmalossless", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"), + CODEC_LONG_NAME("Windows Media Audio Lossless"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMALOSSLESS, .priv_data_size = sizeof(WmallDecodeCtx), @@ -1338,7 +1335,7 @@ FF_CODEC_DECODE_CB(decode_packet), .flush = flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodata.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodata.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodata.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodata.h 2023-03-03 13:29:59.000000000 +0000 @@ -48,42 +48,32 @@ */ #define HUFF_SCALE_SIZE 121 #define HUFF_SCALE_MAXBITS 19 -static const uint16_t scale_huffcodes[HUFF_SCALE_SIZE] = { - 0xE639, 0xE6C2, 0xE6C1, 0xE6C0, 0xE63F, 0xE63E, 0xE63D, 0xE63C, - 0xE63B, 0xE63A, 0xE638, 0xE637, 0xE636, 0xE635, 0xE634, 0xE632, - 0xE633, 0xE620, 0x737B, 0xE610, 0xE611, 0xE612, 0xE613, 0xE614, - 0xE615, 0xE616, 0xE617, 0xE618, 0xE619, 0xE61A, 0xE61B, 0xE61C, - 0xE61D, 0xE61E, 0xE61F, 0xE6C3, 0xE621, 0xE622, 0xE623, 0xE624, - 0xE625, 0xE626, 0xE627, 0xE628, 0xE629, 0xE62A, 0xE62B, 0xE62C, - 0xE62D, 0xE62E, 0xE62F, 0xE630, 0xE631, 0x1CDF, 0x0E60, 0x0399, - 0x00E7, 0x001D, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, - 0x0002, 0x0007, 0x0006, 0x000F, 0x0038, 0x0072, 0x039A, 0xE6C4, - 0xE6C5, 0xE6C6, 0xE6C7, 0xE6C8, 0xE6C9, 0xE6CA, 0xE6CB, 0xE6CC, - 0xE6CD, 0xE6CE, 0xE6CF, 0xE6D0, 0xE6D1, 0xE6D2, 0xE6D3, 0xE6D4, - 0xE6D5, 0xE6D6, 0xE6D7, 0xE6D8, 0xE6D9, 0xE6DA, 0xE6DB, 0xE6DC, - 0xE6DD, 0xE6DE, 0xE6DF, 0xE6E0, 0xE6E1, 0xE6E2, 0xE6E3, 0xE6E4, - 0xE6E5, 0xE6E6, 0xE6E7, 0xE6E8, 0xE6E9, 0xE6EA, 0xE6EB, 0xE6EC, - 0xE6ED, 0xE6EE, 0xE6EF, 0xE6F0, 0xE6F1, 0xE6F2, 0xE6F3, 0xE6F4, - 0xE6F5, -}; - -static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = { - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 18, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 16, 15, 13, - 11, 8, 5, 2, 1, 3, 5, 6, - 6, 7, 7, 7, 9, 10, 13, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, - 19, +static const uint8_t scale_table[HUFF_SCALE_SIZE][2] = { + { 58, 5 }, { 64, 6 }, { 66, 7 }, { 65, 7 }, { 62, 5 }, + { 63, 6 }, { 68, 9 }, { 69, 10 }, { 54, 15 }, { 19, 19 }, + { 20, 19 }, { 21, 19 }, { 22, 19 }, { 23, 19 }, { 24, 19 }, + { 25, 19 }, { 26, 19 }, { 27, 19 }, { 28, 19 }, { 29, 19 }, + { 30, 19 }, { 31, 19 }, { 32, 19 }, { 33, 19 }, { 34, 19 }, + { 17, 19 }, { 36, 19 }, { 37, 19 }, { 38, 19 }, { 39, 19 }, + { 40, 19 }, { 41, 19 }, { 42, 19 }, { 43, 19 }, { 44, 19 }, + { 45, 19 }, { 46, 19 }, { 47, 19 }, { 48, 19 }, { 49, 19 }, + { 50, 19 }, { 51, 19 }, { 52, 19 }, { 15, 19 }, { 16, 19 }, + { 14, 19 }, { 13, 19 }, { 12, 19 }, { 11, 19 }, { 10, 19 }, + { 0, 19 }, { 9, 19 }, { 8, 19 }, { 7, 19 }, { 6, 19 }, + { 5, 19 }, { 4, 19 }, { 55, 13 }, { 70, 13 }, { 3, 19 }, + { 2, 19 }, { 1, 19 }, { 35, 19 }, { 71, 19 }, { 72, 19 }, + { 73, 19 }, { 74, 19 }, { 75, 19 }, { 76, 19 }, { 77, 19 }, + { 78, 19 }, { 79, 19 }, { 80, 19 }, { 81, 19 }, { 82, 19 }, + { 83, 19 }, { 84, 19 }, { 85, 19 }, { 86, 19 }, { 87, 19 }, + { 88, 19 }, { 89, 19 }, { 90, 19 }, { 91, 19 }, { 92, 19 }, + { 93, 19 }, { 94, 19 }, { 95, 19 }, { 96, 19 }, { 97, 19 }, + { 98, 19 }, { 99, 19 }, { 100, 19 }, { 101, 19 }, { 102, 19 }, + { 103, 19 }, { 104, 19 }, { 105, 19 }, { 106, 19 }, { 107, 19 }, + { 108, 19 }, { 109, 19 }, { 110, 19 }, { 111, 19 }, { 112, 19 }, + { 113, 19 }, { 114, 19 }, { 115, 19 }, { 116, 19 }, { 117, 19 }, + { 118, 19 }, { 119, 19 }, { 120, 19 }, { 18, 18 }, { 53, 16 }, + { 56, 11 }, { 57, 8 }, { 67, 7 }, { 61, 3 }, { 59, 2 }, + { 60, 1 }, }; /** @} */ @@ -94,46 +84,31 @@ */ #define HUFF_SCALE_RL_SIZE 120 #define HUFF_SCALE_RL_MAXBITS 21 -static const uint32_t scale_rl_huffcodes[HUFF_SCALE_RL_SIZE] = { - 0x00010C, 0x000001, 0x10FE2A, 0x000003, 0x000003, 0x000001, 0x000013, - 0x000020, 0x000029, 0x000014, 0x000016, 0x000045, 0x000049, 0x00002F, - 0x000042, 0x00008E, 0x00008F, 0x000129, 0x000009, 0x00000D, 0x0004AC, - 0x00002C, 0x000561, 0x0002E6, 0x00087C, 0x0002E2, 0x00095C, 0x000018, - 0x000001, 0x000016, 0x000044, 0x00002A, 0x000007, 0x000159, 0x000143, - 0x000128, 0x00015A, 0x00012D, 0x00002B, 0x0000A0, 0x000142, 0x00012A, - 0x0002EF, 0x0004AF, 0x00087D, 0x004AE9, 0x0043F9, 0x000067, 0x000199, - 0x002B05, 0x001583, 0x0021FE, 0x10FE2C, 0x000004, 0x00002E, 0x00010D, - 0x00000A, 0x000244, 0x000017, 0x000245, 0x000011, 0x00010E, 0x00012C, - 0x00002A, 0x00002F, 0x000121, 0x000046, 0x00087E, 0x0000BA, 0x000032, - 0x0087F0, 0x0056DC, 0x0002EC, 0x0043FA, 0x002B6F, 0x004AE8, 0x0002B7, - 0x10FE2B, 0x000001, 0x000051, 0x000010, 0x0002EE, 0x000B9C, 0x002576, - 0x000198, 0x0056DD, 0x0000CD, 0x000AC0, 0x000170, 0x004AEF, 0x00002D, - 0x0004AD, 0x0021FF, 0x0005CF, 0x002B04, 0x10FE29, 0x10FE28, 0x0002ED, - 0x002E74, 0x021FC4, 0x004AEE, 0x010FE3, 0x087F17, 0x000000, 0x000097, - 0x0002E3, 0x000ADA, 0x002575, 0x00173B, 0x0043FB, 0x002E75, 0x10FE2D, - 0x0015B6, 0x00056C, 0x000057, 0x000123, 0x000120, 0x00021E, 0x000172, - 0x0002B1, -}; - -static const uint8_t scale_rl_huffbits[HUFF_SCALE_RL_SIZE] = { - 9, 2, 21, 2, 4, 5, 5, - 6, 6, 7, 7, 7, 7, 6, - 7, 8, 8, 9, 10, 10, 11, - 12, 11, 12, 12, 12, 12, 11, - 4, 5, 7, 8, 9, 9, 9, - 9, 9, 9, 8, 8, 9, 9, - 12, 11, 12, 15, 15, 13, 15, - 14, 13, 14, 21, 5, 6, 9, - 10, 10, 11, 10, 11, 9, 9, - 6, 8, 9, 7, 12, 10, 12, - 16, 15, 12, 15, 14, 15, 10, - 21, 6, 7, 11, 12, 14, 14, - 15, 15, 14, 12, 11, 15, 12, - 11, 14, 13, 14, 21, 21, 12, - 16, 18, 15, 17, 20, 7, 8, - 12, 12, 14, 15, 15, 16, 21, - 13, 11, 7, 9, 9, 10, 11, - 10, +static const uint8_t scale_rl_table[HUFF_SCALE_RL_SIZE][2] = { + { 103, 7 }, { 80, 11 }, { 60, 11 }, { 18, 10 }, { 56, 10 }, + { 21, 12 }, { 90, 12 }, { 58, 11 }, { 27, 11 }, { 69, 12 }, + { 84, 15 }, { 48, 15 }, { 86, 14 }, { 47, 13 }, { 19, 10 }, + { 32, 9 }, { 78, 6 }, { 5, 5 }, { 28, 4 }, { 53, 5 }, + { 9, 7 }, { 31, 8 }, { 38, 8 }, { 10, 7 }, { 88, 11 }, + { 25, 12 }, { 105, 12 }, { 118, 11 }, { 23, 12 }, { 82, 14 }, + { 98, 16 }, { 110, 16 }, { 108, 15 }, { 93, 13 }, { 68, 10 }, + { 72, 12 }, { 97, 12 }, { 81, 12 }, { 42, 12 }, { 64, 8 }, + { 4, 4 }, { 1, 2 }, { 7, 6 }, { 14, 7 }, { 0, 9 }, + { 55, 9 }, { 61, 9 }, { 117, 10 }, { 24, 12 }, { 44, 12 }, + { 67, 12 }, { 70, 16 }, { 99, 18 }, { 96, 21 }, { 95, 21 }, + { 2, 21 }, { 77, 21 }, { 52, 21 }, { 111, 21 }, { 102, 20 }, + { 101, 17 }, { 46, 15 }, { 73, 15 }, { 109, 15 }, { 51, 14 }, + { 92, 14 }, { 30, 7 }, { 11, 7 }, { 66, 7 }, { 15, 8 }, + { 16, 8 }, { 116, 9 }, { 65, 9 }, { 57, 10 }, { 59, 10 }, + { 115, 9 }, { 12, 7 }, { 35, 9 }, { 17, 9 }, { 41, 9 }, + { 20, 11 }, { 91, 11 }, { 26, 12 }, { 75, 15 }, { 45, 15 }, + { 107, 14 }, { 83, 14 }, { 100, 15 }, { 89, 15 }, { 43, 11 }, + { 62, 9 }, { 37, 9 }, { 104, 8 }, { 6, 5 }, { 39, 8 }, + { 40, 9 }, { 34, 9 }, { 79, 7 }, { 8, 6 }, { 63, 6 }, + { 87, 12 }, { 94, 14 }, { 49, 14 }, { 50, 13 }, { 22, 11 }, + { 119, 10 }, { 33, 9 }, { 36, 9 }, { 113, 11 }, { 106, 12 }, + { 112, 13 }, { 71, 15 }, { 85, 15 }, { 74, 14 }, { 76, 10 }, + { 114, 7 }, { 29, 5 }, { 54, 6 }, { 13, 6 }, { 3, 2 }, }; @@ -165,167 +140,99 @@ */ #define HUFF_COEF0_SIZE 272 #define HUFF_COEF0_MAXBITS 21 -static const uint32_t coef0_huffcodes[HUFF_COEF0_SIZE] = { - 0x00004A, 0x00002B, 0x000000, 0x000003, 0x000006, 0x000009, 0x00000F, - 0x000010, 0x000016, 0x000011, 0x000016, 0x000028, 0x00002F, 0x000026, - 0x000029, 0x000045, 0x000055, 0x00005D, 0x000042, 0x00004E, 0x000051, - 0x00005E, 0x00008D, 0x0000A8, 0x0000AD, 0x000080, 0x000096, 0x00009F, - 0x0000AA, 0x0000BE, 0x00011C, 0x000153, 0x000158, 0x000170, 0x000104, - 0x00010D, 0x000105, 0x000103, 0x00012F, 0x000177, 0x000175, 0x000157, - 0x000174, 0x000225, 0x00023B, 0x00020D, 0x00021F, 0x000281, 0x00027B, - 0x000282, 0x0002AC, 0x0002FD, 0x00044F, 0x000478, 0x00044D, 0x0002EC, - 0x00044E, 0x000564, 0x000409, 0x00040B, 0x000501, 0x000545, 0x0004F3, - 0x000541, 0x00043B, 0x0004F1, 0x0004F4, 0x0008FD, 0x000A94, 0x000811, - 0x000B88, 0x000B91, 0x000B93, 0x0008EA, 0x000899, 0x000B8A, 0x000972, - 0x0009E5, 0x000A8F, 0x000A84, 0x000A8E, 0x000A00, 0x000830, 0x0008E8, - 0x000B95, 0x000871, 0x00083A, 0x000814, 0x000873, 0x000BFE, 0x001728, - 0x001595, 0x001712, 0x00102A, 0x001021, 0x001729, 0x00152E, 0x0013C3, - 0x001721, 0x001597, 0x00151B, 0x0010F2, 0x001403, 0x001703, 0x001503, - 0x001708, 0x0013C1, 0x00170E, 0x00170C, 0x0010E1, 0x0011EA, 0x001020, - 0x001500, 0x0017FA, 0x001704, 0x001705, 0x0017F0, 0x0017FB, 0x0021E6, - 0x002B2D, 0x0020C6, 0x002B29, 0x002E4A, 0x0023AC, 0x001519, 0x0023F3, - 0x002B2C, 0x0021C0, 0x0017FE, 0x0023D7, 0x0017F9, 0x0012E7, 0x0013C0, - 0x002261, 0x0023D3, 0x002057, 0x002056, 0x0021D2, 0x0020C7, 0x0023D2, - 0x0020EC, 0x0044C0, 0x002FE2, 0x00475B, 0x002A03, 0x002FE3, 0x0021E2, - 0x0021D0, 0x002A31, 0x002E13, 0x002E05, 0x0047E5, 0x00000E, 0x000024, - 0x000088, 0x0000B9, 0x00010C, 0x000224, 0x0002B3, 0x000283, 0x0002ED, - 0x00047B, 0x00041E, 0x00043D, 0x0004F5, 0x0005FD, 0x000A92, 0x000B96, - 0x000838, 0x000971, 0x000B83, 0x000B80, 0x000BF9, 0x0011D3, 0x0011E8, - 0x0011D7, 0x001527, 0x0011F8, 0x001073, 0x0010F0, 0x0010E4, 0x0017F8, - 0x001062, 0x001402, 0x0017E3, 0x00151A, 0x001077, 0x00152B, 0x00170D, - 0x0021D3, 0x002E41, 0x0013C2, 0x000029, 0x0000A9, 0x00025D, 0x000419, - 0x000544, 0x000B8B, 0x0009E4, 0x0011D2, 0x001526, 0x001724, 0x0012E6, - 0x00150B, 0x0017FF, 0x002E26, 0x002E4B, 0x002B28, 0x0021E3, 0x002A14, - 0x00475A, 0x002E12, 0x000057, 0x00023E, 0x000A90, 0x000BF0, 0x001072, - 0x001502, 0x0023D6, 0x0020ED, 0x002A30, 0x0044C7, 0x00008C, 0x00047F, - 0x00152A, 0x002262, 0x002E04, 0x0000A1, 0x0005F9, 0x000173, 0x000875, - 0x000171, 0x00152D, 0x0002E3, 0x0017E2, 0x0002AD, 0x0021C1, 0x000479, - 0x0021E7, 0x00041F, 0x005C4E, 0x000543, 0x005C4F, 0x000A91, 0x00898D, - 0x000B97, 0x008746, 0x000970, 0x008745, 0x000B85, 0x00A856, 0x00152F, - 0x010E8E, 0x0010E5, 0x00A857, 0x00170F, 0x021D11, 0x002A58, 0x010E8F, - 0x002E40, 0x021D13, 0x002A59, 0x043A25, 0x002A02, 0x043A21, 0x0044C1, - 0x087448, 0x0047E4, 0x043A20, 0x00542A, 0x087449, 0x00898C, -}; - -static const uint8_t coef0_huffbits[HUFF_COEF0_SIZE] = { - 8, 7, 2, 3, 3, 4, 4, - 5, 5, 6, 6, 6, 6, 7, - 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 10, - 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 13, - 12, 12, 12, 12, 12, 12, 13, - 13, 13, 13, 13, 13, 13, 12, - 12, 13, 13, 13, 13, 13, 13, - 13, 13, 14, 14, 13, 13, 14, - 13, 13, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 13, 14, - 14, 14, 14, 14, 14, 14, 15, - 14, 15, 14, 14, 14, 14, 14, - 14, 15, 14, 14, 14, 14, 14, - 14, 14, 15, 15, 15, 15, 14, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 4, 7, - 8, 9, 10, 10, 10, 11, 11, - 11, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 13, 14, - 15, 14, 14, 6, 9, 11, 12, - 12, 12, 13, 13, 13, 13, 14, - 14, 14, 14, 14, 14, 15, 15, - 15, 15, 7, 10, 12, 13, 14, - 14, 14, 15, 15, 15, 8, 11, - 13, 14, 15, 9, 12, 9, 13, - 10, 13, 10, 14, 11, 15, 11, - 15, 12, 15, 12, 15, 12, 16, - 12, 17, 13, 17, 13, 17, 13, - 18, 14, 17, 14, 19, 14, 18, - 14, 19, 14, 20, 15, 20, 15, - 21, 15, 20, 16, 21, 16, +static const uint8_t coef0_lens[HUFF_COEF0_SIZE] = { + 2, 9, 14, 14, 13, 12, 13, 14, 15, 15, 12, 10, 10, 10, 13, 14, 15, 15, 12, + 11, 13, 14, 14, 13, 15, 15, 14, 12, 12, 8, 10, 10, 15, 15, 14, 13, 14, 14, + 13, 15, 20, 20, 19, 21, 21, 20, 19, 17, 17, 18, 18, 15, 15, 13, 12, 14, 15, + 15, 14, 15, 15, 12, 11, 6, 7, 8, 9, 13, 13, 13, 14, 14, 11, 10, 7, 8, + 14, 14, 14, 14, 12, 13, 13, 12, 12, 12, 11, 9, 13, 14, 14, 12, 11, 11, 11, + 9, 8, 7, 14, 15, 15, 14, 14, 12, 13, 15, 16, 17, 17, 14, 12, 12, 12, 15, + 15, 14, 14, 14, 13, 13, 9, 9, 11, 11, 10, 7, 6, 13, 15, 15, 14, 14, 14, + 13, 14, 15, 15, 13, 14, 14, 14, 14, 10, 9, 10, 10, 11, 11, 10, 8, 9, 13, + 14, 14, 12, 11, 14, 15, 15, 13, 12, 14, 14, 14, 14, 13, 14, 14, 3, 5, 8, + 10, 10, 15, 15, 14, 14, 16, 16, 15, 12, 11, 11, 11, 7, 8, 8, 9, 12, 13, + 13, 12, 14, 15, 15, 13, 10, 11, 11, 13, 14, 14, 13, 14, 14, 11, 10, 13, 15, + 15, 14, 12, 11, 4, 6, 6, 8, 12, 12, 12, 13, 13, 12, 13, 13, 14, 14, 13, + 13, 13, 9, 7, 9, 11, 14, 14, 13, 14, 14, 13, 10, 8, 7, 5, 9, 12, 13, + 14, 15, 15, 12, 12, 10, 14, 14, 13, 12, 13, 14, 14, 12, 13, 13, 12, 12, 12, + 9, 7, 6, 3, 4, 4, +}; + +static const uint16_t coef0_syms[HUFF_COEF0_SIZE] = { + 2, 25, 111, 94, 69, 58, 87, 93, 136, 135, 59, 37, 34, 36, 82, + 182, 120, 138, 195, 45, 168, 216, 178, 86, 140, 219, 186, 162, 239, 18, + 156, 35, 127, 236, 109, 85, 180, 253, 88, 147, 268, 264, 256, 266, 270, + 262, 260, 248, 246, 252, 258, 137, 189, 230, 64, 179, 146, 208, 101, 118, + 238, 163, 46, 9, 153, 0, 26, 247, 169, 76, 202, 131, 194, 38, 13, + 19, 132, 106, 191, 97, 65, 198, 77, 62, 66, 164, 48, 27, 81, 183, + 102, 60, 47, 49, 159, 227, 20, 14, 112, 263, 144, 217, 104, 63, 79, + 209, 269, 250, 254, 203, 241, 196, 61, 220, 148, 124, 185, 100, 80, 78, + 193, 28, 50, 235, 41, 1, 10, 171, 226, 150, 103, 114, 115, 170, 105, + 211, 149, 249, 108, 188, 107, 255, 231, 155, 42, 40, 55, 160, 39, 21, + 29, 215, 234, 184, 228, 51, 116, 142, 145, 172, 165, 181, 130, 113, 117, + 89, 128, 204, 3, 7, 154, 157, 43, 141, 265, 133, 225, 271, 244, 221, + 74, 54, 56, 52, 15, 222, 22, 30, 83, 199, 173, 73, 123, 210, 143, + 175, 44, 53, 237, 174, 139, 134, 110, 218, 129, 161, 213, 177, 267, 151, + 125, 67, 223, 5, 11, 192, 23, 214, 243, 166, 200, 176, 68, 224, 187, + 257, 261, 232, 96, 251, 31, 16, 32, 57, 207, 121, 91, 126, 119, 99, + 158, 24, 212, 8, 33, 70, 92, 205, 240, 242, 75, 197, 233, 259, 190, + 98, 71, 201, 122, 206, 72, 90, 95, 84, 167, 245, 229, 17, 12, 4, + 152, 6, }; #define HUFF_COEF1_SIZE 244 #define HUFF_COEF1_MAXBITS 22 -static const uint32_t coef1_huffcodes[HUFF_COEF1_SIZE] = { - 0x0001E2, 0x00007F, 0x000000, 0x000002, 0x000008, 0x00000E, 0x000019, - 0x00002F, 0x000037, 0x000060, 0x00006C, 0x000095, 0x0000C6, 0x0000F0, - 0x00012E, 0x000189, 0x0001A5, 0x0001F8, 0x000253, 0x00030A, 0x000344, - 0x00034D, 0x0003F2, 0x0004BD, 0x0005D7, 0x00062A, 0x00068B, 0x000693, - 0x000797, 0x00097D, 0x000BAB, 0x000C52, 0x000C5E, 0x000D21, 0x000D20, - 0x000F1A, 0x000FCE, 0x000FD1, 0x0012F1, 0x001759, 0x0018AC, 0x0018A7, - 0x0018BF, 0x001A2B, 0x001E52, 0x001E50, 0x001E31, 0x001FB8, 0x0025E6, - 0x0025E7, 0x002EB4, 0x002EB7, 0x003169, 0x00315B, 0x00317C, 0x00316C, - 0x0034CA, 0x00348D, 0x003F40, 0x003CA2, 0x003F76, 0x004BC3, 0x004BE5, - 0x003F73, 0x004BF8, 0x004BF9, 0x006131, 0x00628B, 0x006289, 0x0062DA, - 0x00628A, 0x0062D4, 0x006997, 0x0062B4, 0x006918, 0x00794D, 0x007E7B, - 0x007E87, 0x007EEA, 0x00794E, 0x00699D, 0x007967, 0x00699F, 0x0062DB, - 0x007E7A, 0x007EEB, 0x00BAC0, 0x0097C9, 0x00C537, 0x00C5AB, 0x00D233, - 0x00D338, 0x00BAC1, 0x00D23D, 0x012F91, 0x00D339, 0x00FDC8, 0x00D23C, - 0x00FDDC, 0x00FDC9, 0x00FDDD, 0x00D33C, 0x000003, 0x000016, 0x00003E, - 0x0000C3, 0x0001A1, 0x000347, 0x00062E, 0x000BAA, 0x000F2D, 0x001A2A, - 0x001E58, 0x00309B, 0x003CA3, 0x005D6A, 0x00629A, 0x006996, 0x00794F, - 0x007EE5, 0x00BAD7, 0x00C5AA, 0x00C5F4, 0x00FDDF, 0x00FDDE, 0x018A20, - 0x018A6D, 0x01A67B, 0x01A464, 0x025F21, 0x01F9E2, 0x01F9E3, 0x00000A, - 0x00003D, 0x000128, 0x0003C7, 0x000C24, 0x0018A3, 0x002EB1, 0x003CB2, - 0x00691F, 0x007E79, 0x000013, 0x0000BB, 0x00034E, 0x000D14, 0x0025FD, - 0x004BE7, 0x000024, 0x000188, 0x0007EF, 0x000035, 0x000308, 0x0012F2, - 0x00005C, 0x0003F6, 0x0025E0, 0x00006D, 0x000698, 0x000096, 0x000C25, - 0x0000C7, 0x000F1B, 0x0000F3, 0x0012FF, 0x000174, 0x001A66, 0x0001A0, - 0x003099, 0x0001E4, 0x00316B, 0x000252, 0x003F31, 0x00030B, 0x004BE6, - 0x000346, 0x0062FB, 0x00034F, 0x007966, 0x0003F5, 0x007E86, 0x0005D4, - 0x00C511, 0x00062C, 0x00C5F5, 0x000692, 0x00F299, 0x000795, 0x00F298, - 0x0007E9, 0x018A21, 0x00097E, 0x0175AD, 0x000C27, 0x01A67A, 0x000C57, - 0x02EB59, 0x000D22, 0x0314D9, 0x000F19, 0x03F3C2, 0x000FCD, 0x0348CB, - 0x0012F8, 0x04BE41, 0x0018A0, 0x03F3C1, 0x0018A1, 0x04BE40, 0x0018B7, - 0x0629B0, 0x001A64, 0x0D2329, 0x001E30, 0x03F3C3, 0x001F9F, 0x0BAD62, - 0x001F99, 0x0FCF00, 0x00309A, 0x0629B1, 0x002EB6, 0x175AC3, 0x00314C, - 0x069195, 0x003168, 0x0BAD63, 0x00348E, 0x175AC1, 0x003F30, 0x07E781, - 0x003F41, 0x0D2328, 0x003F42, 0x1F9E03, 0x004BC2, 0x175AC2, 0x003F74, - 0x175AC0, 0x005D61, 0x3F3C05, 0x006130, 0x3F3C04, 0x0062B5, -}; - -static const uint8_t coef1_huffbits[HUFF_COEF1_SIZE] = { - 9, 7, 2, 3, 4, 4, 5, - 6, 6, 7, 7, 8, 8, 8, - 9, 9, 9, 9, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, - 11, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 14, - 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 15, 15, - 14, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, - 15, 15, 16, 16, 16, 16, 16, - 16, 16, 16, 17, 16, 16, 16, - 16, 16, 16, 16, 3, 5, 6, - 8, 9, 10, 11, 12, 12, 13, - 13, 14, 14, 15, 15, 15, 15, - 15, 16, 16, 16, 16, 16, 17, - 17, 17, 17, 18, 17, 17, 4, - 6, 9, 10, 12, 13, 14, 14, - 15, 15, 5, 8, 10, 12, 14, - 15, 6, 9, 11, 6, 10, 13, - 7, 10, 14, 7, 11, 8, 12, - 8, 12, 8, 13, 9, 13, 9, - 14, 9, 14, 10, 14, 10, 15, - 10, 15, 10, 15, 10, 15, 11, - 16, 11, 16, 11, 16, 11, 16, - 11, 17, 12, 17, 12, 17, 12, - 18, 12, 18, 12, 18, 12, 18, - 13, 19, 13, 18, 13, 19, 13, - 19, 13, 20, 13, 18, 13, 20, - 13, 20, 14, 19, 14, 21, 14, - 19, 14, 20, 14, 21, 14, 19, - 14, 20, 14, 21, 15, 21, 14, - 21, 15, 22, 15, 22, 15, +static const uint8_t coef1_table[HUFF_COEF1_SIZE][2] = { + { 2, 2 }, { 3, 3 }, { 102, 3 }, { 4, 4 }, { 148, 6 }, + { 134, 9 }, { 171, 10 }, { 18, 10 }, { 11, 8 }, { 159, 8 }, + { 14, 9 }, { 156, 14 }, { 235, 15 }, { 61, 15 }, { 38, 13 }, + { 153, 13 }, { 48, 14 }, { 49, 14 }, { 23, 11 }, { 203, 13 }, + { 208, 19 }, { 204, 19 }, { 129, 18 }, { 94, 17 }, { 87, 16 }, + { 62, 15 }, { 174, 15 }, { 147, 15 }, { 29, 12 }, { 191, 12 }, + { 64, 15 }, { 65, 15 }, { 146, 14 }, { 164, 13 }, { 142, 5 }, + { 132, 4 }, { 103, 5 }, { 154, 7 }, { 165, 9 }, { 181, 11 }, + { 109, 12 }, { 30, 12 }, { 86, 16 }, { 92, 16 }, { 239, 15 }, + { 138, 14 }, { 39, 13 }, { 50, 14 }, { 115, 15 }, { 238, 21 }, + { 228, 21 }, { 236, 21 }, { 222, 21 }, { 216, 20 }, { 226, 20 }, + { 196, 18 }, { 192, 17 }, { 120, 16 }, { 221, 14 }, { 51, 14 }, + { 24, 11 }, { 143, 8 }, { 7, 6 }, { 9, 7 }, { 152, 10 }, + { 136, 12 }, { 160, 12 }, { 241, 15 }, { 66, 15 }, { 168, 14 }, + { 219, 14 }, { 113, 14 }, { 193, 12 }, { 19, 10 }, { 173, 10 }, + { 105, 8 }, { 149, 9 }, { 15, 9 }, { 205, 13 }, { 207, 13 }, + { 125, 17 }, { 190, 17 }, { 182, 16 }, { 68, 15 }, { 70, 15 }, + { 67, 15 }, { 137, 13 }, { 31, 12 }, { 223, 14 }, { 116, 15 }, + { 210, 19 }, { 220, 19 }, { 198, 18 }, { 126, 17 }, { 88, 16 }, + { 41, 13 }, { 25, 11 }, { 40, 13 }, { 73, 15 }, { 243, 15 }, + { 53, 14 }, { 195, 12 }, { 183, 11 }, { 225, 14 }, { 52, 14 }, + { 71, 15 }, { 121, 16 }, { 89, 16 }, { 170, 14 }, { 55, 14 }, + { 69, 15 }, { 83, 15 }, { 209, 13 }, { 108, 11 }, { 32, 12 }, + { 54, 14 }, { 122, 16 }, { 184, 16 }, { 176, 15 }, { 42, 13 }, + { 12, 8 }, { 161, 8 }, { 6, 5 }, { 167, 9 }, { 106, 9 }, + { 20, 10 }, { 145, 12 }, { 111, 13 }, { 43, 13 }, { 26, 11 }, + { 175, 10 }, { 107, 10 }, { 34, 12 }, { 33, 12 }, { 197, 12 }, + { 74, 15 }, { 128, 17 }, { 232, 20 }, { 212, 20 }, { 224, 19 }, + { 202, 18 }, { 90, 16 }, { 57, 14 }, { 227, 14 }, { 97, 16 }, + { 93, 16 }, { 140, 15 }, { 185, 11 }, { 27, 11 }, { 16, 9 }, + { 158, 11 }, { 211, 13 }, { 56, 14 }, { 117, 15 }, { 72, 15 }, + { 166, 13 }, { 91, 16 }, { 95, 16 }, { 80, 15 }, { 101, 16 }, + { 194, 17 }, { 127, 17 }, { 82, 15 }, { 21, 10 }, { 144, 10 }, + { 177, 10 }, { 151, 6 }, { 10, 7 }, { 157, 7 }, { 8, 6 }, + { 5, 4 }, { 13, 8 }, { 0, 9 }, { 213, 13 }, { 46, 13 }, + { 199, 12 }, { 35, 12 }, { 162, 12 }, { 135, 10 }, { 169, 9 }, + { 45, 13 }, { 59, 14 }, { 114, 14 }, { 44, 13 }, { 188, 16 }, + { 186, 16 }, { 75, 15 }, { 79, 15 }, { 118, 15 }, { 187, 11 }, + { 112, 13 }, { 139, 14 }, { 178, 15 }, { 81, 15 }, { 110, 12 }, + { 28, 11 }, { 163, 8 }, { 133, 6 }, { 104, 6 }, { 17, 9 }, + { 22, 10 }, { 229, 14 }, { 172, 14 }, { 217, 13 }, { 201, 12 }, + { 36, 12 }, { 218, 20 }, { 242, 22 }, { 240, 22 }, { 234, 21 }, + { 230, 19 }, { 206, 18 }, { 200, 18 }, { 214, 18 }, { 130, 17 }, + { 131, 17 }, { 141, 15 }, { 84, 15 }, { 76, 15 }, { 215, 13 }, + { 58, 14 }, { 231, 14 }, { 233, 14 }, { 180, 15 }, { 77, 15 }, + { 37, 12 }, { 189, 11 }, { 179, 10 }, { 155, 10 }, { 47, 13 }, + { 96, 16 }, { 99, 16 }, { 119, 15 }, { 63, 14 }, { 237, 14 }, + { 78, 15 }, { 85, 15 }, { 60, 14 }, { 98, 16 }, { 100, 16 }, + { 124, 16 }, { 123, 16 }, { 150, 11 }, { 1, 7 }, }; @@ -418,153 +325,100 @@ */ #define HUFF_VEC4_SIZE 127 #define HUFF_VEC4_MAXBITS 14 -static const uint16_t vec4_huffcodes[HUFF_VEC4_SIZE] = { - 0x0019, 0x0027, 0x00F2, 0x03BA, 0x0930, 0x1267, 0x0031, 0x0030, - 0x0097, 0x0221, 0x058B, 0x0124, 0x00EB, 0x01D4, 0x03D8, 0x0584, - 0x0364, 0x045F, 0x0F66, 0x0931, 0x24CD, 0x002F, 0x0039, 0x00E8, - 0x02C3, 0x078A, 0x0037, 0x0029, 0x0084, 0x01B1, 0x00ED, 0x0086, - 0x00F9, 0x03AB, 0x01EB, 0x08BC, 0x011E, 0x00F3, 0x0220, 0x058A, - 0x00EC, 0x008E, 0x012B, 0x01EA, 0x0119, 0x04B0, 0x04B1, 0x03B8, - 0x0691, 0x0365, 0x01ED, 0x049A, 0x0EA9, 0x0EA8, 0x08BD, 0x24CC, - 0x0026, 0x0035, 0x00DB, 0x02C4, 0x07B2, 0x0038, 0x002B, 0x007F, - 0x01B3, 0x00F4, 0x0091, 0x0116, 0x03BB, 0x0215, 0x0932, 0x002D, - 0x002A, 0x008A, 0x01DE, 0x0028, 0x0020, 0x005C, 0x0090, 0x0068, - 0x01EE, 0x00E9, 0x008D, 0x012A, 0x0087, 0x005D, 0x0118, 0x0349, - 0x01EF, 0x01E3, 0x08B9, 0x00F0, 0x00D3, 0x0214, 0x049B, 0x00DA, - 0x0089, 0x0125, 0x0217, 0x012D, 0x0690, 0x0094, 0x007D, 0x011F, - 0x007E, 0x0059, 0x0127, 0x01A5, 0x0111, 0x00F8, 0x045D, 0x03B9, - 0x0259, 0x0580, 0x02C1, 0x01DF, 0x0585, 0x0216, 0x0163, 0x01B0, - 0x03C4, 0x08B8, 0x078B, 0x0755, 0x0581, 0x0F67, 0x0000, -}; - -static const uint8_t vec4_huffbits[HUFF_VEC4_SIZE] = { - 5, 6, 8, 10, 12, 13, 6, 6, - 8, 10, 11, 9, 8, 9, 10, 11, - 10, 11, 12, 12, 14, 6, 6, 8, - 10, 11, 6, 6, 8, 9, 8, 8, - 8, 10, 9, 12, 9, 8, 10, 11, - 8, 8, 9, 9, 9, 11, 11, 10, - 11, 10, 9, 11, 12, 12, 12, 14, - 6, 6, 8, 10, 11, 6, 6, 7, - 9, 8, 8, 9, 10, 10, 12, 6, - 6, 8, 9, 6, 6, 7, 8, 7, - 9, 8, 8, 9, 8, 7, 9, 10, - 9, 9, 12, 8, 8, 10, 11, 8, - 8, 9, 10, 9, 11, 8, 7, 9, - 7, 7, 9, 9, 9, 8, 11, 10, - 10, 11, 10, 9, 11, 10, 9, 9, - 10, 12, 11, 11, 11, 12, 1, +static const uint8_t vec4_lens[HUFF_VEC4_SIZE] = { + 1, 6, 8, 10, 10, 10, 10, 8, 8, 10, 10, 9, 8, 8, 9, 12, 12, 11, + 12, 12, 11, 9, 9, 8, 8, 9, 9, 8, 8, 9, 9, 12, 12, 12, 14, 14, + 13, 11, 11, 9, 8, 9, 9, 11, 11, 10, 9, 8, 6, 6, 6, 6, 6, 6, + 11, 11, 10, 11, 11, 10, 10, 11, 11, 9, 7, 6, 7, 7, 6, 6, 6, 5, + 7, 11, 11, 10, 9, 8, 6, 9, 9, 10, 10, 9, 8, 8, 6, 6, 6, 8, + 8, 9, 12, 12, 11, 10, 8, 8, 8, 10, 10, 10, 10, 9, 9, 8, 10, 11, + 11, 9, 8, 8, 8, 9, 9, 10, 11, 12, 12, 9, 9, 9, 8, 8, 7, 7, + 7, +}; + +/* The entry in the following table with symbol zero indicates + * that four further entries are coded explicitly; all other + * entries encode four numbers in the 0..15 range via + * the four nibbles of (symbol - 1). */ +static const uint16_t vec4_syms[HUFF_VEC4_SIZE] = { + 0, 4370, 275, 8195, 4146, 12545, 8225, 290, 4625, 515, + 20, 8706, 8210, 4355, 4131, 16385, 5121, 8961, 321, 1041, + 51, 4641, 546, 4610, 530, 513, 8451, 4385, 4130, 33, + 8211, 5, 66, 4161, 1281, 81, 6, 801, 8196, 8481, + 8449, 4611, 531, 561, 769, 12290, 8226, 19, 4097, 2, + 4369, 274, 4354, 4114, 12291, 16641, 12305, 49, 12321, 260, + 4100, 516, 21, 12546, 8466, 4353, 4371, 4626, 257, 18, + 17, 1, 4386, 8241, 771, 4865, 8705, 8194, 4098, 12561, + 276, 50, 785, 4116, 8209, 4099, 273, 4113, 258, 259, + 4609, 35, 1026, 1025, 16401, 305, 34, 529, 289, 770, + 12289, 4, 4145, 4356, 12306, 8193, 12801, 261, 16386, 4881, + 3, 514, 4129, 545, 306, 36, 4101, 65, 20481, 786, + 4401, 4866, 8721, 291, 8450, 8465, 4115, }; #define HUFF_VEC2_SIZE 137 #define HUFF_VEC2_MAXBITS 12 -static const uint16_t vec2_huffcodes[HUFF_VEC2_SIZE] = { - 0x055, 0x01C, 0x01A, 0x02B, 0x028, 0x067, 0x08B, 0x039, - 0x170, 0x10D, 0x2A5, 0x047, 0x464, 0x697, 0x523, 0x8CB, - 0x01B, 0x00E, 0x000, 0x010, 0x012, 0x036, 0x048, 0x04C, - 0x0C2, 0x09B, 0x171, 0x03B, 0x224, 0x34A, 0x2D6, 0x019, - 0x00F, 0x002, 0x014, 0x017, 0x006, 0x05D, 0x054, 0x0C7, - 0x0B4, 0x192, 0x10E, 0x233, 0x043, 0x02C, 0x00F, 0x013, - 0x006, 0x02F, 0x02C, 0x068, 0x077, 0x0DF, 0x111, 0x1A4, - 0x16A, 0x2A4, 0x027, 0x011, 0x018, 0x02D, 0x00F, 0x04A, - 0x040, 0x097, 0x01F, 0x11B, 0x022, 0x16D, 0x066, 0x035, - 0x005, 0x02B, 0x049, 0x009, 0x075, 0x0CB, 0x0AA, 0x187, - 0x106, 0x08A, 0x047, 0x060, 0x06E, 0x01D, 0x074, 0x0C4, - 0x01E, 0x118, 0x1A7, 0x038, 0x042, 0x053, 0x076, 0x0A8, - 0x0CA, 0x082, 0x110, 0x18D, 0x12D, 0x0B9, 0x0C8, 0x0DE, - 0x01C, 0x0AB, 0x113, 0x18C, 0x10F, 0x09A, 0x0A5, 0x0B7, - 0x11A, 0x186, 0x1A6, 0x259, 0x153, 0x18A, 0x193, 0x020, - 0x10C, 0x046, 0x03A, 0x107, 0x149, 0x16C, 0x2D7, 0x225, - 0x258, 0x316, 0x696, 0x317, 0x042, 0x522, 0x290, 0x8CA, - 0x001, -}; - -static const uint8_t vec2_huffbits[HUFF_VEC2_SIZE] = { - 7, 6, 6, 6, 7, 7, 8, 9, - 9, 10, 10, 11, 11, 11, 12, 12, - 6, 4, 5, 5, 6, 6, 7, 8, - 8, 9, 9, 10, 10, 10, 11, 6, - 4, 5, 5, 6, 7, 7, 8, 8, - 9, 9, 10, 10, 11, 6, 5, 5, - 6, 6, 7, 7, 8, 8, 9, 9, - 10, 10, 7, 6, 6, 6, 7, 7, - 8, 8, 9, 9, 10, 10, 7, 6, - 7, 7, 7, 8, 8, 8, 9, 9, - 10, 8, 7, 7, 7, 8, 8, 8, - 9, 9, 9, 9, 8, 8, 8, 8, - 8, 9, 9, 9, 9, 8, 8, 8, - 9, 9, 9, 9, 10, 9, 9, 9, - 9, 9, 9, 10, 9, 9, 9, 10, - 10, 11, 10, 10, 10, 10, 11, 10, - 10, 10, 11, 10, 11, 12, 11, 12, - 3, +/* The entry in the following table with symbol zero indicates + * that two further entries are coded explicitly; all other + * entries encode two numbers in the 0..15 range via + * (symbol - 1) & 0xF and (symbol - 1) >> 4. */ +static const uint8_t vec2_table[HUFF_VEC2_SIZE][2] = { + { 19, 5 }, { 165, 10 }, { 211, 11 }, { 46, 11 }, { 75, 10 }, + { 177, 11 }, { 12, 11 }, { 86, 8 }, { 83, 7 }, { 38, 7 }, + { 133, 9 }, { 178, 10 }, { 28, 10 }, { 104, 9 }, { 73, 9 }, + { 35, 5 }, { 52, 6 }, { 113, 9 }, { 8, 9 }, { 101, 8 }, + { 69, 7 }, { 0, 3 }, { 71, 8 }, { 119, 9 }, { 91, 10 }, + { 179, 10 }, { 114, 8 }, { 166, 10 }, { 10, 10 }, { 44, 10 }, + { 145, 10 }, { 66, 6 }, { 21, 6 }, { 24, 8 }, { 146, 9 }, + { 26, 9 }, { 65, 7 }, { 5, 7 }, { 226, 11 }, { 225, 12 }, + { 15, 12 }, { 180, 10 }, { 147, 9 }, { 115, 8 }, { 40, 8 }, + { 89, 9 }, { 134, 9 }, { 84, 7 }, { 54, 7 }, { 42, 9 }, + { 60, 10 }, { 31, 11 }, { 193, 11 }, { 181, 10 }, { 76, 10 }, + { 148, 9 }, { 37, 6 }, { 67, 6 }, { 33, 6 }, { 3, 6 }, + { 17, 6 }, { 2, 6 }, { 102, 8 }, { 87, 8 }, { 116, 8 }, + { 56, 8 }, { 50, 5 }, { 20, 5 }, { 120, 9 }, { 58, 9 }, + { 29, 10 }, { 194, 10 }, { 135, 9 }, { 97, 8 }, { 7, 8 }, + { 105, 9 }, { 13, 11 }, { 241, 12 }, { 16, 12 }, { 45, 10 }, + { 149, 9 }, { 74, 9 }, { 98, 7 }, { 23, 7 }, { 85, 7 }, + { 70, 7 }, { 195, 10 }, { 161, 10 }, { 129, 9 }, { 72, 8 }, + { 51, 5 }, { 36, 5 }, { 117, 8 }, { 61, 10 }, { 11, 10 }, + { 162, 9 }, { 1, 7 }, { 4, 6 }, { 49, 6 }, { 68, 6 }, + { 9, 9 }, { 27, 9 }, { 130, 8 }, { 39, 7 }, { 53, 6 }, + { 99, 7 }, { 25, 8 }, { 150, 9 }, { 90, 9 }, { 103, 8 }, + { 163, 9 }, { 196, 10 }, { 210, 10 }, { 136, 9 }, { 121, 9 }, + { 41, 8 }, { 131, 8 }, { 43, 9 }, { 164, 9 }, { 118, 8 }, + { 88, 8 }, { 81, 7 }, { 6, 7 }, { 55, 7 }, { 59, 9 }, + { 30, 10 }, { 209, 11 }, { 14, 11 }, { 151, 9 }, { 106, 9 }, + { 82, 6 }, { 22, 6 }, { 100, 7 }, { 132, 8 }, { 57, 8 }, + { 18, 4 }, { 34, 4 }, }; #define HUFF_VEC1_SIZE 101 #define HUFF_VEC1_MAXBITS 11 -static const uint16_t vec1_huffcodes[HUFF_VEC1_SIZE] = { - 0x01A, 0x003, 0x017, 0x010, 0x00C, 0x009, 0x005, 0x000, - 0x00D, 0x00A, 0x009, 0x00C, 0x00F, 0x002, 0x004, 0x007, - 0x00B, 0x00F, 0x01C, 0x006, 0x010, 0x015, 0x01C, 0x022, - 0x03B, 0x00E, 0x019, 0x023, 0x034, 0x036, 0x03A, 0x047, - 0x008, 0x00A, 0x01E, 0x031, 0x037, 0x050, 0x053, 0x06B, - 0x06F, 0x08C, 0x0E8, 0x0EA, 0x0EB, 0x016, 0x03E, 0x03F, - 0x06C, 0x089, 0x08A, 0x0A3, 0x0A4, 0x0D4, 0x0DD, 0x0EC, - 0x0EE, 0x11A, 0x1D2, 0x024, 0x025, 0x02E, 0x027, 0x0C2, - 0x0C0, 0x0DA, 0x0DB, 0x111, 0x144, 0x116, 0x14A, 0x145, - 0x1B8, 0x1AB, 0x1DA, 0x1DE, 0x1DB, 0x1DF, 0x236, 0x237, - 0x3A6, 0x3A7, 0x04D, 0x04C, 0x05E, 0x05F, 0x183, 0x182, - 0x186, 0x221, 0x187, 0x220, 0x22E, 0x22F, 0x296, 0x354, - 0x297, 0x355, 0x372, 0x373, 0x016, -}; - -static const uint8_t vec1_huffbits[HUFF_VEC1_SIZE] = { - 7, 6, 5, 5, 5, 5, 5, 5, - 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 5, 6, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 5, -}; - - -static const uint16_t symbol_to_vec4[HUFF_VEC4_SIZE] = { - 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, - 20, 32, 33, 34, 35, 48, 49, 50, 64, 65, - 80, 256, 257, 258, 259, 260, 272, 273, 274, 275, - 288, 289, 290, 304, 305, 320, 512, 513, 514, 515, - 528, 529, 530, 544, 545, 560, 768, 769, 770, 784, - 785, 800, 1024, 1025, 1040, 1280, 4096, 4097, 4098, 4099, - 4100, 4112, 4113, 4114, 4115, 4128, 4129, 4130, 4144, 4145, - 4160, 4352, 4353, 4354, 4355, 4368, 4369, 4370, 4384, 4385, - 4400, 4608, 4609, 4610, 4624, 4625, 4640, 4864, 4865, 4880, - 5120, 8192, 8193, 8194, 8195, 8208, 8209, 8210, 8224, 8225, - 8240, 8448, 8449, 8450, 8464, 8465, 8480, 8704, 8705, 8720, - 8960, 12288, 12289, 12290, 12304, 12305, 12320, 12544, 12545, 12560, - 12800, 16384, 16385, 16400, 16640, 20480, 0, -}; - - -static const uint8_t symbol_to_vec2[HUFF_VEC2_SIZE] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 112, 113, 114, 115, 116, 117, 118, 119, 120, 128, 129, 130, 131, 132, - 133, 134, 135, 144, 145, 146, 147, 148, 149, 150, 160, 161, 162, 163, 164, - 165, 176, 177, 178, 179, 180, 192, 193, 194, 195, 208, 209, 210, 224, 225, - 240, 0, +static const uint8_t vec1_table[HUFF_VEC1_SIZE][2] = { + { 7, 5 }, { 32, 8 }, { 59, 10 }, { 60, 10 }, { 83, 11 }, + { 82, 11 }, { 62, 10 }, { 33, 8 }, { 45, 9 }, { 61, 10 }, + { 84, 11 }, { 85, 11 }, { 1, 6 }, { 13, 5 }, { 19, 6 }, + { 25, 7 }, { 34, 8 }, { 46, 9 }, { 47, 9 }, { 14, 5 }, + { 6, 5 }, { 64, 10 }, { 87, 11 }, { 86, 11 }, { 63, 10 }, + { 88, 11 }, { 90, 11 }, { 35, 8 }, { 26, 7 }, { 0, 7 }, + { 48, 9 }, { 65, 10 }, { 66, 10 }, { 36, 8 }, { 15, 5 }, + { 20, 6 }, { 91, 11 }, { 89, 11 }, { 67, 10 }, { 49, 9 }, + { 50, 9 }, { 69, 10 }, { 92, 11 }, { 93, 11 }, { 27, 7 }, + { 5, 5 }, { 37, 8 }, { 68, 10 }, { 71, 10 }, { 51, 9 }, + { 52, 9 }, { 70, 10 }, { 94, 11 }, { 96, 11 }, { 38, 8 }, + { 21, 6 }, { 16, 5 }, { 4, 5 }, { 28, 7 }, { 53, 9 }, + { 95, 11 }, { 97, 11 }, { 73, 10 }, { 39, 8 }, { 29, 7 }, + { 72, 10 }, { 98, 11 }, { 99, 11 }, { 54, 9 }, { 40, 8 }, + { 22, 6 }, { 30, 7 }, { 55, 9 }, { 74, 10 }, { 76, 10 }, + { 56, 9 }, { 75, 10 }, { 77, 10 }, { 17, 5 }, { 3, 5 }, + { 23, 6 }, { 41, 8 }, { 57, 9 }, { 78, 10 }, { 79, 10 }, + { 31, 7 }, { 10, 4 }, { 9, 4 }, { 100, 5 }, { 2, 5 }, + { 11, 4 }, { 8, 4 }, { 18, 5 }, { 42, 8 }, { 58, 9 }, + { 80, 10 }, { 81, 10 }, { 43, 8 }, { 44, 8 }, { 24, 6 }, + { 12, 4 }, }; /** @} */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmaprodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -89,6 +89,7 @@ #include #include "libavutil/audio_fifo.h" +#include "libavutil/tx.h" #include "libavutil/ffmath.h" #include "libavutil/float_dsp.h" #include "libavutil/intfloat.h" @@ -98,8 +99,9 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" +#include "internal.h" #include "put_bits.h" #include "wmaprodata.h" #include "sinewin.h" @@ -184,7 +186,8 @@ uint8_t frame_data[MAX_FRAMESIZE + AV_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data PutBitContext pb; ///< context for filling the frame_data buffer - FFTContext mdct_ctx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size + AVTXContext *tx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size + av_tx_fn tx_fn[WMAPRO_BLOCK_SIZES]; DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer const float* windows[WMAPRO_BLOCK_SIZES]; ///< windows for the different block sizes @@ -286,7 +289,7 @@ av_freep(&s->fdsp); for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) - ff_mdct_end(&s->mdct_ctx[i]); + av_tx_uninit(&s->tx[i]); return 0; } @@ -317,27 +320,27 @@ static av_cold void decode_init_static(void) { - INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, - scale_huffbits, 1, 1, - scale_huffcodes, 2, 2, 616); - INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, - scale_rl_huffbits, 1, 1, - scale_rl_huffcodes, 4, 4, 1406); - INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, - coef0_huffbits, 1, 1, - coef0_huffcodes, 4, 4, 2108); - INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, - coef1_huffbits, 1, 1, - coef1_huffcodes, 4, 4, 3912); - INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, - vec4_huffbits, 1, 1, - vec4_huffcodes, 2, 2, 604); - INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, - vec2_huffbits, 1, 1, - vec2_huffcodes, 2, 2, 562); - INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, - vec1_huffbits, 1, 1, - vec1_huffcodes, 2, 2, 562); + INIT_VLC_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, + &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, + coef0_lens, 1, + coef0_syms, 2, 2, 0, 0, 2108); + INIT_VLC_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, + vec4_lens, 1, + vec4_syms, 2, 2, -1, 0, 604); + INIT_VLC_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, + &vec1_table[0][1], 2, + &vec1_table[0][0], 2, 1, 0, 0, 562); /** calculate sine values for the decorrelation matrix */ for (int i = 0; i < 33; i++) @@ -357,7 +360,7 @@ static AVOnce init_static_once = AV_ONCE_INIT; uint8_t *edata_ptr = avctx->extradata; unsigned int channel_mask; - int i, bits, ret; + int i, bits; int log2_max_num_subframes; int num_possible_block_sizes; @@ -551,12 +554,13 @@ return AVERROR(ENOMEM); /** init MDCT, FIXME: only init needed sizes */ - for (int i = 0; i < WMAPRO_BLOCK_SIZES; i++) { - ret = ff_mdct_init(&s->mdct_ctx[i], WMAPRO_BLOCK_MIN_BITS + 1 + i, 1, - 1.0 / (1 << (WMAPRO_BLOCK_MIN_BITS + i - 1)) - / (1ll << (s->bits_per_sample - 1))); - if (ret < 0) - return ret; + for (i = 0; i < WMAPRO_BLOCK_SIZES; i++) { + const float scale = 1.0 / (1 << (WMAPRO_BLOCK_MIN_BITS + i - 1)) + / (1ll << (s->bits_per_sample - 1)); + int err = av_tx_init(&s->tx[i], &s->tx_fn[i], AV_TX_FLOAT_MDCT, 1, + 1 << (WMAPRO_BLOCK_MIN_BITS + i), &scale, 0); + if (err < 0) + return err; } /** init MDCT windows: simple sine window */ @@ -956,10 +960,10 @@ idx = get_vlc2(&s->gb, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH); - if (idx == HUFF_VEC4_SIZE - 1) { + if ((int)idx < 0) { for (i = 0; i < 4; i += 2) { idx = get_vlc2(&s->gb, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH); - if (idx == HUFF_VEC2_SIZE - 1) { + if ((int)idx < 0) { uint32_t v0, v1; v0 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH); if (v0 == HUFF_VEC1_SIZE - 1) @@ -970,15 +974,15 @@ vals[i ] = av_float2int(v0); vals[i+1] = av_float2int(v1); } else { - vals[i] = fval_tab[symbol_to_vec2[idx] >> 4 ]; - vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF]; + vals[i] = fval_tab[idx >> 4 ]; + vals[i+1] = fval_tab[idx & 0xF]; } } } else { - vals[0] = fval_tab[ symbol_to_vec4[idx] >> 12 ]; - vals[1] = fval_tab[(symbol_to_vec4[idx] >> 8) & 0xF]; - vals[2] = fval_tab[(symbol_to_vec4[idx] >> 4) & 0xF]; - vals[3] = fval_tab[ symbol_to_vec4[idx] & 0xF]; + vals[0] = fval_tab[ idx >> 12 ]; + vals[1] = fval_tab[(idx >> 8) & 0xF]; + vals[2] = fval_tab[(idx >> 4) & 0xF]; + vals[3] = fval_tab[ idx & 0xF]; } /** decode sign */ @@ -1055,7 +1059,7 @@ s->channel[c].scale_factor_step = get_bits(&s->gb, 2) + 1; val = 45 / s->channel[c].scale_factor_step; for (sf = s->channel[c].scale_factors; sf < sf_end; sf++) { - val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH) - 60; + val += get_vlc2(&s->gb, sf_vlc.table, SCALEVLCBITS, SCALEMAXDEPTH); *sf = val; } } else { @@ -1385,7 +1389,8 @@ get_bits_count(&s->gb) - s->subframe_offset); if (transmit_coeffs) { - FFTContext *mdct = &s->mdct_ctx[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; + AVTXContext *tx = s->tx[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; + av_tx_fn tx_fn = s->tx_fn[av_log2(subframe_len) - WMAPRO_BLOCK_MIN_BITS]; /** reconstruct the per channel data */ inverse_channel_transform(s); for (i = 0; i < s->channels_for_cur_subframe; i++) { @@ -1411,7 +1416,7 @@ } /** apply imdct (imdct_half == DCTIV with reverse) */ - mdct->imdct_half(mdct, s->channel[c].coeffs, s->tmp); + tx_fn(tx, s->channel[c].coeffs, s->tmp, sizeof(float)); } } @@ -1673,7 +1678,7 @@ skip_bits(gb, 2); } else { int num_frames = get_bits(gb, 6); - ff_dlog(avctx, "packet[%d]: number of frames %d\n", avctx->frame_number, num_frames); + ff_dlog(avctx, "packet[%"PRId64"]: number of frames %d\n", avctx->frame_num, num_frames); packet_sequence_number = 0; } @@ -1682,10 +1687,10 @@ if (avctx->codec_id != AV_CODEC_ID_WMAPRO) { skip_bits(gb, 3); s->skip_packets = get_bits(gb, 8); - ff_dlog(avctx, "packet[%d]: skip packets %d\n", avctx->frame_number, s->skip_packets); + ff_dlog(avctx, "packet[%"PRId64"]: skip packets %d\n", avctx->frame_num, s->skip_packets); } - ff_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number, + ff_dlog(avctx, "packet[%"PRId64"]: nbpf %x\n", avctx->frame_num, num_bits_prev_frame); /** check for packet loss */ @@ -2082,7 +2087,7 @@ */ const FFCodec ff_wmapro_decoder = { .p.name = "wmapro", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"), + CODEC_LONG_NAME("Windows Media Audio 9 Professional"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAPRO, .priv_data_size = sizeof(WMAProDecodeCtx), @@ -2093,27 +2098,28 @@ .flush = wmapro_flush, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_xma1_decoder = { .p.name = "xma1", - .p.long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 1"), + CODEC_LONG_NAME("Xbox Media Audio 1"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_XMA1, .priv_data_size = sizeof(XMADecodeCtx), .init = xma_decode_init, .close = xma_decode_end, FF_CODEC_DECODE_CB(xma_decode_packet), + .flush = xma_flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; const FFCodec ff_xma2_decoder = { .p.name = "xma2", - .p.long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 2"), + CODEC_LONG_NAME("Xbox Media Audio 2"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_XMA2, .priv_data_size = sizeof(XMADecodeCtx), @@ -2124,5 +2130,5 @@ .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmavoice.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmavoice.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmavoice.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmavoice.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "get_bits.h" #include "put_bits.h" #include "wmavoice_data.h" @@ -320,18 +320,10 @@ 10, 10, 10, 12, 12, 12, 14, 14, 14, 14 }; - static const uint16_t codes[] = { - 0x0000, 0x0001, 0x0002, // 00/01/10 - 0x000c, 0x000d, 0x000e, // 11+00/01/10 - 0x003c, 0x003d, 0x003e, // 1111+00/01/10 - 0x00fc, 0x00fd, 0x00fe, // 111111+00/01/10 - 0x03fc, 0x03fd, 0x03fe, // 11111111+00/01/10 - 0x0ffc, 0x0ffd, 0x0ffe, // 1111111111+00/01/10 - 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx - }; - INIT_VLC_STATIC(&frame_type_vlc, VLC_NBITS, sizeof(bits), - bits, 1, 1, codes, 2, 2, 132); + INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, + FF_ARRAY_ELEMS(bits), bits, + 1, NULL, 0, 0, 0, 0, 132); } static av_cold void wmavoice_flush(AVCodecContext *ctx) @@ -1908,6 +1900,8 @@ { WMAVoiceContext *s = ctx->priv_data; GetBitContext *gb = &s->gb; + const uint8_t *buf = avpkt->data; + uint8_t dummy[1]; int size, res, pos; /* Packets are sometimes a multiple of ctx->block_align, with a packet @@ -1916,7 +1910,10 @@ * in a single "muxer" packet, so we artificially emulate that by * capping the packet size at ctx->block_align. */ for (size = avpkt->size; size > ctx->block_align; size -= ctx->block_align); - init_get_bits8(&s->gb, avpkt->data, size); + buf = size ? buf : dummy; + res = init_get_bits8(&s->gb, buf, size); + if (res < 0) + return res; /* size == ctx->block_align is used to indicate whether we are dealing with * a new packet or a packet of which we already read the packet header @@ -1939,7 +1936,7 @@ if (cnt + s->spillover_nbits > avpkt->size * 8) { s->spillover_nbits = avpkt->size * 8 - cnt; } - copy_bits(&s->pb, avpkt->data, size, gb, s->spillover_nbits); + copy_bits(&s->pb, buf, size, gb, s->spillover_nbits); flush_put_bits(&s->pb); s->sframe_cache_size += s->spillover_nbits; if ((res = synth_superframe(ctx, frame, got_frame_ptr)) == 0 && @@ -1976,7 +1973,7 @@ } else if ((s->sframe_cache_size = pos) > 0) { /* ... cache it for spillover in next packet */ init_put_bits(&s->pb, s->sframe_cache, SFRAME_CACHE_MAXSIZE); - copy_bits(&s->pb, avpkt->data, size, gb, s->sframe_cache_size); + copy_bits(&s->pb, buf, size, gb, s->sframe_cache_size); // FIXME bad - just copy bytes as whole and add use the // skip_bits_next field } @@ -2000,7 +1997,7 @@ const FFCodec ff_wmavoice_decoder = { .p.name = "wmavoice", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"), + CODEC_LONG_NAME("Windows Media Audio Voice"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WMAVOICE, .priv_data_size = sizeof(WMAVoiceContext), @@ -2008,6 +2005,6 @@ .close = wmavoice_decode_end, FF_CODEC_DECODE_CB(wmavoice_decode_packet), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = wmavoice_flush, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include "avcodec.h" #include "idctdsp.h" #include "mpegvideo.h" -#include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "wmv2.h" @@ -29,19 +29,19 @@ { WMV2Context *const w = s->private_ctx; - ff_blockdsp_init(&s->bdsp, s->avctx); + ff_blockdsp_init(&s->bdsp); ff_wmv2dsp_init(&w->wdsp); s->idsp.perm_type = w->wdsp.idct_perm; ff_init_scantable_permutation(s->idsp.idct_permutation, w->wdsp.idct_perm); ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_h_scantable, - ff_wmv1_scantable[2]); - ff_init_scantable(s->idsp.idct_permutation, &s->intra_v_scantable, - ff_wmv1_scantable[3]); ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]); + ff_permute_scantable(s->permutated_intra_h_scantable, ff_wmv1_scantable[2], + s->idsp.idct_permutation); + ff_permute_scantable(s->permutated_intra_v_scantable, ff_wmv1_scantable[3], + s->idsp.idct_permutation); s->idsp.idct_put = w->wdsp.idct_put; s->idsp.idct_add = w->wdsp.idct_add; s->idsp.idct = NULL; @@ -49,11 +49,11 @@ void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h) { WMV2Context *const w = s->private_ctx; - uint8_t *ptr; + const uint8_t *ptr; int dxy, mx, my, src_x, src_y, v_edge_pos; ptrdiff_t offset, linesize, uvlinesize; int emu = 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "mpegutils.h" #include "mpegvideo.h" #include "msmpeg4.h" -#include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "msmpeg4dec.h" #include "simple_idct.h" #include "wmv2.h" @@ -52,7 +52,6 @@ int per_mb_rl_bit; int skip_type; - ScanTable abt_scantable[2]; DECLARE_ALIGNED(32, int16_t, abt_block2)[6][64]; } WMV2DecContext; @@ -242,6 +241,10 @@ WMV2DecContext *const w = (WMV2DecContext *) s; if (s->pict_type == AV_PICTURE_TYPE_I) { + /* Is filling with zeroes really the right thing to do? */ + memset(s->current_picture_ptr->mb_type, 0, + sizeof(*s->current_picture_ptr->mb_type) * + s->mb_height * s->mb_stride); if (w->j_type_bit) w->j_type = get_bits1(&s->gb); else @@ -421,9 +424,7 @@ w->abt_type_table[n] = w->abt_type; if (w->abt_type) { -// const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].permutated; - const uint8_t *scantable = w->abt_scantable[w->abt_type - 1].scantable; -// const uint8_t *scantable = w->abt_type - 1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable; + const uint8_t *scantable = w->abt_type == 1 ? ff_wmv2_scantableA : ff_wmv2_scantableB; sub_cbp = sub_cbp_table[decode012(&s->gb)]; @@ -444,7 +445,7 @@ } } -int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) +static int wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) { /* The following is only allowed because this encoder * does not use slice threading. */ @@ -481,7 +482,8 @@ s->mb_intra = 1; if (get_bits_left(&s->gb) <= 0) return AVERROR_INVALIDDATA; - code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); + code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, + MSMP4_MB_INTRA_VLC_BITS, 2); /* predict coded block pattern */ cbp = 0; for (i = 0; i < 6; i++) { @@ -572,13 +574,11 @@ if ((ret = ff_msmpeg4_decode_init(avctx)) < 0) return ret; + s->decode_mb = wmv2_decode_mb; + ff_wmv2_common_init(s); - ff_init_scantable(s->idsp.idct_permutation, &w->abt_scantable[0], - ff_wmv2_scantableA); - ff_init_scantable(s->idsp.idct_permutation, &w->abt_scantable[1], - ff_wmv2_scantableB); - return ff_intrax8_common_init(avctx, &w->x8, &w->s.idsp, + return ff_intrax8_common_init(avctx, &w->x8, w->s.block, w->s.block_last_index, w->s.mb_width, w->s.mb_height); } @@ -593,7 +593,7 @@ const FFCodec ff_wmv2_decoder = { .p.name = "wmv2", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), + CODEC_LONG_NAME("Windows Media Video 8"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV2, .priv_data_size = sizeof(WMV2DecContext), @@ -601,7 +601,7 @@ .close = wmv2_decode_end, FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2dec.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include "mpegvideo.h" -int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]); int ff_wmv2_decode_picture_header(MpegEncContext * s); int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s); void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,9 +26,12 @@ #include "msmpeg4.h" #include "msmpeg4enc.h" #include "msmpeg4data.h" +#include "msmpeg4_vc1_data.h" #include "wmv2.h" #include "wmv2enc.h" +#define WMV2_EXTRADATA_SIZE 4 + typedef struct WMV2EncContext { MSMPEG4EncContext msmpeg4; WMV2Context common; @@ -49,7 +52,7 @@ PutBitContext pb; int code; - init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size); + init_put_bits(&pb, s->avctx->extradata, WMV2_EXTRADATA_SIZE); put_bits(&pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); // yes 29.97 -> 29 put_bits(&pb, 11, FFMIN(s->bit_rate / 1024, 2047)); @@ -80,7 +83,7 @@ ff_wmv2_common_init(s); - avctx->extradata_size = 4; + avctx->extradata_size = WMV2_EXTRADATA_SIZE; avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!avctx->extradata) return AVERROR(ENOMEM); @@ -90,7 +93,7 @@ return 0; } -int ff_wmv2_encode_picture_header(MpegEncContext *s, int picture_number) +int ff_wmv2_encode_picture_header(MpegEncContext *s) { WMV2EncContext *const w = (WMV2EncContext *) s; @@ -235,15 +238,16 @@ const FFCodec ff_wmv2_encoder = { .p.name = "wmv2", - .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), + CODEC_LONG_NAME("Windows Media Video 8"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WMV2, .p.priv_class = &ff_mpv_enc_class, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(WMV2EncContext), .init = wmv2_encode_init, FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2enc.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "mpegvideo.h" -int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); +int ff_wmv2_encode_picture_header(MpegEncContext * s); void ff_wmv2_encode_mb(MpegEncContext * s, int16_t block[6][64], int motion_x, int motion_y); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wmv2.h 2023-03-03 13:29:59.000000000 +0000 @@ -39,7 +39,7 @@ void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, - uint8_t **ref_picture, op_pixels_func (*pix_op)[4], + uint8_t *const *ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wnv1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wnv1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wnv1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wnv1.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,8 +29,8 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" static const uint8_t code_tab[16][2] = { { 7, 1 }, { 8, 3 }, { 6, 3 }, { 9, 4 }, { 5, 4 }, { 10, 5 }, { 4, 5 }, @@ -137,11 +137,10 @@ const FFCodec ff_wnv1_decoder = { .p.name = "wnv1", - .p.long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"), + CODEC_LONG_NAME("Winnov WNV1"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WNV1, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wrapped_avframe.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wrapped_avframe.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wrapped_avframe.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/wrapped_avframe.c 2023-03-03 13:29:59.000000000 +0000 @@ -92,11 +92,13 @@ in = (AVFrame*)pkt->data; - err = ff_decode_frame_props(avctx, out); + err = av_frame_ref(out, in); if (err < 0) return err; - av_frame_move_ref(out, in); + err = ff_decode_frame_props(avctx, out); + if (err < 0) + return err; *got_frame = 1; return 0; @@ -104,18 +106,17 @@ const FFCodec ff_wrapped_avframe_encoder = { .p.name = "wrapped_avframe", - .p.long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), + CODEC_LONG_NAME("AVFrame to AVPacket passthrough"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(wrapped_avframe_encode), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; const FFCodec ff_wrapped_avframe_decoder = { .p.name = "wrapped_avframe", - .p.long_name = NULL_IF_CONFIG_SMALL("AVPacket to AVFrame passthrough"), + CODEC_LONG_NAME("AVPacket to AVFrame passthrough"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, FF_CODEC_DECODE_CB(wrapped_avframe_decode), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ws-snd1.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ws-snd1.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ws-snd1.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ws-snd1.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" /** * @file @@ -172,11 +172,10 @@ const FFCodec ff_ws_snd1_decoder = { .p.name = "ws_snd1", - .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Audio (SND1)"), + CODEC_LONG_NAME("Westwood Audio (SND1)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WESTWOOD_SND1, .init = ws_snd_decode_init, FF_CODEC_DECODE_CB(ws_snd_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -49,7 +49,7 @@ add dstq, mmsize add nq, mmsize*2 jl .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -83,7 +83,7 @@ add src2q, mmsize add nq, mmsize*2 jl .loop - REP_RET + RET ;*********************************************************************** ;void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2], @@ -116,7 +116,7 @@ movhps [rq+nq], m2 add nq, 8 jl .loop - REP_RET + RET ;*************************************************************************** ;void ps_stereo_interpolate_ipdopd_sse3(float (*l)[2], float (*r)[2], @@ -164,7 +164,7 @@ movhps [rq+nq], m2 add nq, 8 jl .loop - REP_RET + RET ;********************************************************** ;void ps_hybrid_analysis_ileave_sse(float out[2][38][64], @@ -400,49 +400,63 @@ ; const float (*filter)[8][2], ; ptrdiff_t stride, int n); ;******************************************************************* -%macro PS_HYBRID_ANALYSIS_LOOP 3 - movu %1, [inq+mmsize*%3] - movu m1, [inq+mmsize*(5-%3)+8] +%macro PS_HYBRID_ANALYSIS_IN 1 + movu m0, [inq+mmsize*%1] + movu m1, [inq+mmsize*(5-%1)+8] + shufps m3, m0, m0, q2301 + shufps m4, m1, m1, q0123 + shufps m1, m1, q1032 %if cpuflag(sse3) - pshufd %2, %1, q2301 - pshufd m4, m1, q0123 - pshufd m1, m1, q1032 - pshufd m2, [filterq+nq+mmsize*%3], q2301 - addsubps %2, m4 - addsubps %1, m1 + addsubps m3, m4 + addsubps m0, m1 %else - mova m2, [filterq+nq+mmsize*%3] - mova %2, %1 - mova m4, m1 - shufps %2, %2, q2301 - shufps m4, m4, q0123 - shufps m1, m1, q1032 - shufps m2, m2, q2301 xorps m4, m7 xorps m1, m7 - subps %2, m4 - subps %1, m1 + subps m3, m4 + subps m0, m1 %endif + mova [rsp+mmsize*%1*2], m3 + mova [rsp+mmsize+mmsize*%1*2], m0 +%endmacro + +%macro PS_HYBRID_ANALYSIS_LOOP 3 + mova m2, [filterq+nq+mmsize*%3] + shufps m2, m2, q2301 +%if cpuflag(fma3) +%if %3 + fmaddps m3, m2, [rsp+mmsize*%3*2], m3 + fmaddps m0, m2, [rsp+mmsize+mmsize*%3*2], m0 +%else + mulps m3, m2, [rsp] + mulps m0, m2, [rsp+mmsize] +%endif +%else ; cpuflag(sse) + mova %2, [rsp+mmsize*%3*2] + mova %1, [rsp+mmsize+mmsize*%3*2] mulps %2, m2 mulps %1, m2 %if %3 addps m3, %2 addps m0, %1 %endif +%endif %endmacro %macro PS_HYBRID_ANALYSIS 0 -cglobal ps_hybrid_analysis, 5, 5, 8, out, in, filter, stride, n +cglobal ps_hybrid_analysis, 5, 5, 5 + notcpuflag(fma3) * 3, 24 * 4, out, in, filter, stride, n %if cpuflag(sse3) %define MOVH movsd %else %define MOVH movlps + mova m7, [ps_p1m1p1m1] %endif shl strideq, 3 shl nd, 6 add filterq, nq neg nq - mova m7, [ps_p1m1p1m1] + PS_HYBRID_ANALYSIS_IN 0 + PS_HYBRID_ANALYSIS_IN 1 + PS_HYBRID_ANALYSIS_IN 2 align 16 .loop: @@ -450,38 +464,30 @@ PS_HYBRID_ANALYSIS_LOOP m5, m6, 1 PS_HYBRID_ANALYSIS_LOOP m5, m6, 2 -%if cpuflag(sse3) - pshufd m3, m3, q2301 - xorps m0, m7 - hsubps m3, m0 - pshufd m1, m3, q0020 - pshufd m3, m3, q0031 - addps m1, m3 - movsd m2, [inq+6*8] -%else - mova m1, m3 - mova m2, m0 - shufps m1, m1, q2301 - shufps m2, m2, q2301 + shufps m1, m3, m3, q2301 + shufps m2, m0, m0, q2301 subps m1, m3 addps m2, m0 unpcklps m3, m1, m2 unpckhps m1, m2 addps m1, m3 movu m2, [inq+6*8] ; faster than movlps and no risk of overread -%endif movss m3, [filterq+nq+8*6] SPLATD m3 +%if cpuflag(fma3) + fmaddps m1, m2, m3, m1 +%else mulps m2, m3 addps m1, m2 +%endif MOVH [outq], m1 add outq, strideq add nq, 64 jl .loop - REP_RET + RET %endmacro INIT_XMM sse PS_HYBRID_ANALYSIS -INIT_XMM sse3 +INIT_XMM fma3 PS_HYBRID_ANALYSIS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/aacpsdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ void ff_ps_hybrid_analysis_sse (float (*out)[2], float (*in)[2], const float (*filter)[8][2], ptrdiff_t stride, int n); -void ff_ps_hybrid_analysis_sse3(float (*out)[2], float (*in)[2], +void ff_ps_hybrid_analysis_fma3(float (*out)[2], float (*in)[2], const float (*filter)[8][2], ptrdiff_t stride, int n); void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2], @@ -64,9 +64,11 @@ s->add_squares = ff_ps_add_squares_sse3; s->stereo_interpolate[0] = ff_ps_stereo_interpolate_sse3; s->stereo_interpolate[1] = ff_ps_stereo_interpolate_ipdopd_sse3; - s->hybrid_analysis = ff_ps_hybrid_analysis_sse3; } if (EXTERNAL_SSE4(cpu_flags)) { s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_sse4; } + if (EXTERNAL_FMA3(cpu_flags)) { + s->hybrid_analysis = ff_ps_hybrid_analysis_fma3; + } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -60,7 +60,7 @@ sub expnq, mmsize jg .nextexp .end: - REP_RET + RET %endmacro %define LOOP_ALIGN ALIGN 16 @@ -126,7 +126,7 @@ sub lenq, 16 %endif ja .loop - REP_RET + RET ;------------------------------------------------------------------------------ ; int ff_ac3_compute_mantissa_size(uint16_t mant_cnt[6][16]) @@ -220,7 +220,7 @@ add lenq, 4 jl .loop - REP_RET + RET %endmacro %if HAVE_SSE2_EXTERNAL diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/ac3dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ void ff_ac3_extract_exponents_sse2 (uint8_t *exp, int32_t *coef, int nb_coefs); void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs); -av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) +av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c) { int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/alacdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/alacdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/alacdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/alacdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -100,7 +100,7 @@ add lenq, mmsize*2 jl .loop - REP_RET + RET %if ARCH_X86_64 cglobal alac_append_extra_bits_mono, 2, 5, 3, buf, exbuf, exbits, ch, len @@ -130,4 +130,4 @@ add lenq, mmsize*2 jl .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -44,6 +44,24 @@ movd eax, m2 RET +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +cglobal scalarproduct_int16, 3,3,2, v1, v2, order + add orderd, orderd + add v1q, orderq + add v2q, orderq + neg orderq + pxor m1, m1 +.loop: + movu m0, [v1q + orderq] + pmaddwd m0, [v2q + orderq] + paddd m1, m0 + add orderq, mmsize + jl .loop + HADDD m1, m0 + movd eax, xm1 + RET +%endif ;----------------------------------------------------------------------------- ; void ff_vector_clip_int32(int32_t *dst, const int32_t *src, int32_t min, @@ -105,7 +123,7 @@ add dstq, mmsize*4*(%2+%3) sub lend, mmsize*(%2+%3) jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/audiodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,9 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/audiodsp.h" +int32_t ff_scalarproduct_int16_avx2(const int16_t *v1, const int16_t *v2, + int order); + int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2, int order); @@ -53,4 +56,7 @@ if (EXTERNAL_SSE4(cpu_flags)) c->vector_clip_int32 = ff_vector_clip_int32_sse4; + + if (EXTERNAL_AVX2_FAST(cpu_flags)) + c->scalarproduct_int16 = ff_scalarproduct_int16_avx2; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/blockdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/blockdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/blockdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/blockdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,8 +29,7 @@ void ff_clear_blocks_sse(int16_t *blocks); void ff_clear_blocks_avx(int16_t *blocks); -av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, - AVCodecContext *avctx) +av_cold void ff_blockdsp_init_x86(BlockDSPContext *c) { #if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cavsdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cavsdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cavsdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cavsdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -308,10 +308,6 @@ }\ #define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t" -#define AVG_3DNOW_OP(a,b,temp, size) \ -"mov" #size " " #b ", " #temp " \n\t"\ -"pavgusb " #temp ", " #a " \n\t"\ -"mov" #size " " #a ", " #b " \n\t" #define AVG_MMXEXT_OP(a, b, temp, size) \ "mov" #size " " #b ", " #temp " \n\t"\ "pavgb " #temp ", " #a " \n\t"\ @@ -345,8 +341,7 @@ } #endif -static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c, - AVCodecContext *avctx) +static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c) { #if HAVE_MMX_EXTERNAL c->put_cavs_qpel_pixels_tab[1][0] = put_cavs_qpel8_mc00_mmx; @@ -369,12 +364,12 @@ CAVS_MC(avg_, 16, mmxext) #endif /* HAVE_MMXEXT_INLINE */ -av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx) +av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c) { av_unused int cpu_flags = av_get_cpu_flags(); if (X86_MMX(cpu_flags)) - cavsdsp_init_mmx(c, avctx); + cavsdsp_init_mmx(c); #if HAVE_MMXEXT_INLINE if (INLINE_MMXEXT(cpu_flags)) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cfhdencdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cfhdencdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cfhdencdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/cfhdencdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,11 +27,11 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/cfhdencdsp.h" -void ff_cfhdenc_horiz_filter_sse2(int16_t *input, int16_t *low, int16_t *high, +void ff_cfhdenc_horiz_filter_sse2(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height); -void ff_cfhdenc_vert_filter_sse2(int16_t *input, int16_t *low, int16_t *high, +void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *high, ptrdiff_t in_stride, ptrdiff_t low_stride, ptrdiff_t high_stride, int width, int height); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt.asm 2023-03-03 13:29:59.000000000 +0000 @@ -75,7 +75,7 @@ COMPOSE_53iL0 m0, m1, [b2q+2*widthq], m2 mova [b1q+2*widthq], m0 jg .loop - REP_RET + RET ; void vertical_compose_dirac53iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, ; int width) @@ -93,7 +93,7 @@ paddw m0, [b1q+2*widthq] mova [b1q+2*widthq], m0 jg .loop - REP_RET + RET ; void vertical_compose_dd97iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, ; IDWTELEM *b3, IDWTELEM *b4, int width) @@ -110,7 +110,7 @@ COMPOSE_DD97iH0 [b2q+2*widthq], [b3q+2*widthq], [b4q+2*widthq] mova [b2q+2*widthq], m1 jg .loop - REP_RET + RET ; void vertical_compose_dd137iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, ; IDWTELEM *b3, IDWTELEM *b4, int width) @@ -139,7 +139,7 @@ psubw m5, m1 mova [b2q+2*widthq], m5 jg .loop - REP_RET + RET ; void vertical_compose_haar(IDWTELEM *b0, IDWTELEM *b1, int width) cglobal vertical_compose_haar_%1, 3,4,3, b0, b1, width @@ -159,7 +159,7 @@ paddw m2, m0 mova [b1q+2*widthq], m2 jg .loop - REP_RET + RET %endmacro ; extend the left and right edges of the tmp array by %1 and %2 respectively @@ -225,7 +225,7 @@ cmp xq, w2q jl .highpass_loop .end: - REP_RET + RET %endmacro @@ -290,7 +290,7 @@ cmp xd, w2d jl .highpass_loop .end: - REP_RET + RET INIT_XMM diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/dirac_dwt_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -165,23 +165,23 @@ switch (type) { case DWT_DIRAC_DD9_7: - d->vertical_compose_l0 = (void*)vertical_compose53iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dd97iH0_sse2; + d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2; + d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2; break; case DWT_DIRAC_LEGALL5_3: - d->vertical_compose_l0 = (void*)vertical_compose53iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dirac53iH0_sse2; + d->vertical_compose_l0.tap3 = vertical_compose53iL0_sse2; + d->vertical_compose_h0.tap3 = vertical_compose_dirac53iH0_sse2; break; case DWT_DIRAC_DD13_7: - d->vertical_compose_l0 = (void*)vertical_compose_dd137iL0_sse2; - d->vertical_compose_h0 = (void*)vertical_compose_dd97iH0_sse2; + d->vertical_compose_l0.tap5 = vertical_compose_dd137iL0_sse2; + d->vertical_compose_h0.tap5 = vertical_compose_dd97iH0_sse2; break; case DWT_DIRAC_HAAR0: - d->vertical_compose = (void*)vertical_compose_haar_sse2; + d->vertical_compose = vertical_compose_haar_sse2; d->horizontal_compose = horizontal_compose_haar0i_sse2; break; case DWT_DIRAC_HAAR1: - d->vertical_compose = (void*)vertical_compose_haar_sse2; + d->vertical_compose = vertical_compose_haar_sse2; d->horizontal_compose = horizontal_compose_haar1i_sse2; break; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fft.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fft.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fft.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fft.asm 2023-03-03 13:29:59.000000000 +0000 @@ -475,7 +475,7 @@ mov r0, r1 mov r1, r3 FFT_DISPATCH _interleave %+ SUFFIX, r1 - REP_RET + RET %endif @@ -510,7 +510,7 @@ add r2, mmsize*2 jl .loop .end: - REP_RET + RET cglobal fft_permute, 2,7,1 mov r4, [r0 + FFTContext.revtab] @@ -543,7 +543,7 @@ movaps [r1 + r2 + 16], xmm1 add r2, 32 jl .loopcopy - REP_RET + RET INIT_XMM sse cglobal imdct_calc, 3,5,3 @@ -583,7 +583,7 @@ sub r3, mmsize add r2, mmsize jl .loop - REP_RET + RET %ifdef PIC %define SECTION_REL - $$ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,10 @@ %include "libavutil/x86/x86util.asm" +SECTION_RODATA + +vector: db 0,1,4,5,8,9,12,13,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,4,5,8,9,12,13, + SECTION .text %macro PMACSDQL 5 @@ -75,7 +79,7 @@ movd [decodedq+4], m1 jg .loop_sample .ret: - REP_RET + RET %endmacro %if HAVE_XOP_EXTERNAL @@ -89,6 +93,9 @@ ;---------------------------------------------------------------------------------- %macro FLAC_DECORRELATE_16 3-4 cglobal flac_decorrelate_%1_16, 2, 4, 4, out, in0, in1, len +%ifidn %1, indep2 + VBROADCASTI128 m2, [vector] +%endif %if ARCH_X86_32 mov lend, lenm %endif @@ -112,15 +119,21 @@ %endif %ifnidn %1, indep2 p%4d m2, m0, m1 + packssdw m%2, m%2 + packssdw m%3, m%3 + punpcklwd m%2, m%3 + psllw m%2, m3 +%else + pslld m%2, m3 + pslld m%3, m3 + pshufb m%2, m%2, m2 + pshufb m%3, m%3, m2 + punpcklwd m%2, m%3 %endif - packssdw m%2, m%2 - packssdw m%3, m%3 - punpcklwd m%2, m%3 - psllw m%2, m3 mova [outq + lenq], m%2 add lenq, 16 jl .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -164,7 +177,7 @@ add outq, mmsize*2 sub lend, mmsize/4 jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -289,10 +302,10 @@ add outq, mmsize*REPCOUNT sub lend, mmsize/4 jg .loop - REP_RET + RET %endmacro -INIT_XMM sse2 +INIT_XMM ssse3 FLAC_DECORRELATE_16 indep2, 0, 1 ; Reuse stereo 16bits macro FLAC_DECORRELATE_INDEP 32, 2, 3, d FLAC_DECORRELATE_INDEP 16, 4, 3, w diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,22 +22,21 @@ #include "libavcodec/flacdsp.h" #include "libavutil/x86/cpu.h" #include "config.h" -#include "config_components.h" void ff_flac_lpc_32_sse4(int32_t *samples, const int coeffs[32], int order, int qlevel, int len); void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order, int qlevel, int len); -void ff_flac_enc_lpc_16_sse4(int32_t *, const int32_t *, int, int, const int32_t *,int); - #define DECORRELATE_FUNCS(fmt, opt) \ void ff_flac_decorrelate_ls_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \ int len, int shift); \ void ff_flac_decorrelate_rs_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \ int len, int shift); \ void ff_flac_decorrelate_ms_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \ - int len, int shift); \ + int len, int shift) + +#define DECORRELATE_IFUNCS(fmt, opt) \ void ff_flac_decorrelate_indep2_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \ int len, int shift); \ void ff_flac_decorrelate_indep4_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \ @@ -51,39 +50,46 @@ DECORRELATE_FUNCS(16, avx); DECORRELATE_FUNCS(32, sse2); DECORRELATE_FUNCS(32, avx); +DECORRELATE_IFUNCS(16, ssse3); +DECORRELATE_IFUNCS(16, avx); +DECORRELATE_IFUNCS(32, ssse3); +DECORRELATE_IFUNCS(32, avx); -av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int channels, - int bps) +av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int channels) { #if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); -#if CONFIG_FLAC_DECODER if (EXTERNAL_SSE2(cpu_flags)) { if (fmt == AV_SAMPLE_FMT_S16) { + c->decorrelate[1] = ff_flac_decorrelate_ls_16_sse2; + c->decorrelate[2] = ff_flac_decorrelate_rs_16_sse2; + c->decorrelate[3] = ff_flac_decorrelate_ms_16_sse2; + } else if (fmt == AV_SAMPLE_FMT_S32) { + c->decorrelate[1] = ff_flac_decorrelate_ls_32_sse2; + c->decorrelate[2] = ff_flac_decorrelate_rs_32_sse2; + c->decorrelate[3] = ff_flac_decorrelate_ms_32_sse2; + } + } + if (EXTERNAL_SSSE3(cpu_flags)) { + if (fmt == AV_SAMPLE_FMT_S16) { if (channels == 2) - c->decorrelate[0] = ff_flac_decorrelate_indep2_16_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep2_16_ssse3; else if (channels == 4) - c->decorrelate[0] = ff_flac_decorrelate_indep4_16_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep4_16_ssse3; else if (channels == 6) - c->decorrelate[0] = ff_flac_decorrelate_indep6_16_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep6_16_ssse3; else if (ARCH_X86_64 && channels == 8) - c->decorrelate[0] = ff_flac_decorrelate_indep8_16_sse2; - c->decorrelate[1] = ff_flac_decorrelate_ls_16_sse2; - c->decorrelate[2] = ff_flac_decorrelate_rs_16_sse2; - c->decorrelate[3] = ff_flac_decorrelate_ms_16_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep8_16_ssse3; } else if (fmt == AV_SAMPLE_FMT_S32) { if (channels == 2) - c->decorrelate[0] = ff_flac_decorrelate_indep2_32_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep2_32_ssse3; else if (channels == 4) - c->decorrelate[0] = ff_flac_decorrelate_indep4_32_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep4_32_ssse3; else if (channels == 6) - c->decorrelate[0] = ff_flac_decorrelate_indep6_32_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep6_32_ssse3; else if (ARCH_X86_64 && channels == 8) - c->decorrelate[0] = ff_flac_decorrelate_indep8_32_sse2; - c->decorrelate[1] = ff_flac_decorrelate_ls_32_sse2; - c->decorrelate[2] = ff_flac_decorrelate_rs_32_sse2; - c->decorrelate[3] = ff_flac_decorrelate_ms_32_sse2; + c->decorrelate[0] = ff_flac_decorrelate_indep8_32_ssse3; } } if (EXTERNAL_SSE4(cpu_flags)) { @@ -105,13 +111,5 @@ if (EXTERNAL_XOP(cpu_flags)) { c->lpc32 = ff_flac_lpc_32_xop; } -#endif - -#if CONFIG_FLAC_ENCODER - if (EXTERNAL_SSE4(cpu_flags)) { - if (CONFIG_GPL) - c->lpc16_encode = ff_flac_enc_lpc_16_sse4; - } -#endif #endif /* HAVE_X86ASM */ } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacencdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacencdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacencdsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/flacencdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014 James Almer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/x86/cpu.h" +#include "libavcodec/flacencdsp.h" + +void ff_flac_enc_lpc_16_sse4(int32_t *, const int32_t *, int, int, const int32_t *,int); + +av_cold void ff_flacencdsp_init_x86(FLACEncDSPContext *c) +{ +#if HAVE_X86ASM && CONFIG_GPL + int cpu_flags = av_get_cpu_flags(); + + if (EXTERNAL_SSE4(cpu_flags)) { + if (CONFIG_GPL) + c->lpc16_encode = ff_flac_enc_lpc_16_sse4; + } +#endif /* HAVE_X86ASM */ +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fmtconvert_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fmtconvert_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fmtconvert_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/fmtconvert_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,7 @@ #endif /* HAVE_X86ASM */ -av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx) +av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c) { #if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264chroma_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264chroma_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264chroma_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264chroma_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,35 +24,35 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/h264chroma.h" -void ff_put_h264_chroma_mc8_rnd_mmx (uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc8_rnd_mmx (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_rnd_mmxext(uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc8_rnd_mmxext(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc4_mmx (uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc4_mmx (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc4_mmxext (uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc4_mmxext (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc2_mmxext (uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc2_mmxext (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc2_mmxext (uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc2_mmxext (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src, +void ff_put_h264_chroma_mc4_ssse3 (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc8_rnd_ssse3(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_h264_chroma_mc4_ssse3 (uint8_t *dst, uint8_t *src, +void ff_avg_h264_chroma_mc4_ssse3 (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); #define CHROMA_MC(OP, NUM, DEPTH, OPT) \ void ff_ ## OP ## _h264_chroma_mc ## NUM ## _ ## DEPTH ## _ ## OPT \ - (uint8_t *dst, uint8_t *src, \ - ptrdiff_t stride, int h, int x, int y); + (uint8_t *dst, const uint8_t *src, \ + ptrdiff_t stride, int h, int x, int y); CHROMA_MC(put, 2, 10, mmxext) CHROMA_MC(avg, 2, 10, mmxext) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -57,7 +57,7 @@ %endmacro ;----------------------------------------------------------------------------- -; void ff_put/avg_h264_chroma_mc8(pixel *dst, pixel *src, ptrdiff_t stride, +; void ff_put/avg_h264_chroma_mc8(pixel *dst, const pixel *src, ptrdiff_t stride, ; int h, int mx, int my) ;----------------------------------------------------------------------------- %macro CHROMA_MC8 1 @@ -67,7 +67,7 @@ jne .at_least_one_non_zero ; mx == 0 AND my == 0 - no filter needed MV0_PIXELS_MC8 - REP_RET + RET .at_least_one_non_zero: mov r6d, 2 @@ -102,7 +102,7 @@ add r1, r2 dec r3d jne .next1drow - REP_RET + RET .xy_interpolation: ; general case, bilinear movd m4, r4m ; x @@ -144,7 +144,7 @@ add r0, r2 dec r3d jne .next2drow - REP_RET + RET %endmacro ;----------------------------------------------------------------------------- @@ -194,11 +194,11 @@ MC4_OP m6, m0 sub r3d, 2 jnz .next2rows - REP_RET + RET %endmacro ;----------------------------------------------------------------------------- -; void ff_put/avg_h264_chroma_mc2(pixel *dst, pixel *src, ptrdiff_t stride, +; void ff_put/avg_h264_chroma_mc2(pixel *dst, const pixel *src, ptrdiff_t stride, ; int h, int mx, int my) ;----------------------------------------------------------------------------- %macro CHROMA_MC2 1 @@ -234,7 +234,7 @@ add r0, r2 dec r3d jnz .nextrow - REP_RET + RET %endmacro %macro NOTHING 2-3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_chromamc.asm 2023-03-03 13:29:59.000000000 +0000 @@ -104,7 +104,7 @@ %define extra_regs 0 %endif ; rv40 ; void ff_put/avg_h264_chroma_mc8_*(uint8_t *dst /* align 8 */, -; uint8_t *src /* align 1 */, +; const uint8_t *src /* align 1 */, ; ptrdiff_t stride, int h, int mx, int my) cglobal %1_%2_chroma_mc8%3, 6, 7 + extra_regs, 0 mov r6d, r5d @@ -112,7 +112,7 @@ jne .at_least_one_non_zero ; mx == 0 AND my == 0 - no filter needed mv0_pixels_mc8 - REP_RET + RET .at_least_one_non_zero: %ifidn %2, rv40 @@ -192,7 +192,7 @@ add r1, r2 dec r3d jne .next1drow - REP_RET + RET .both_non_zero: ; general case, bilinear movd m4, r4d ; x @@ -365,7 +365,7 @@ add r0, r2 sub r3d, 2 jnz .next2rows - REP_RET + RET %endmacro %macro chroma_mc2_mmx_func 2 @@ -407,7 +407,7 @@ add r0, r2 sub r3d, 1 jnz .nextrow - REP_RET + RET %endmacro %define rnd_1d_h264 pw_4 @@ -453,7 +453,7 @@ jne .at_least_one_non_zero ; mx == 0 AND my == 0 - no filter needed mv0_pixels_mc8 - REP_RET + RET .at_least_one_non_zero: test r5d, r5d @@ -514,7 +514,7 @@ sub r3d, 2 lea r0, [r0+r2*2] jg .next2rows - REP_RET + RET .my_is_zero: mov r5d, r4d @@ -551,7 +551,7 @@ lea r0, [r0+r2*2] lea r1, [r1+r2*2] jg .next2xrows - REP_RET + RET .mx_is_zero: mov r4d, r5d @@ -588,7 +588,7 @@ sub r3d, 2 lea r0, [r0+r2*2] jg .next2yrows - REP_RET + RET %endmacro %macro chroma_mc4_ssse3_func 2 @@ -638,7 +638,7 @@ sub r3d, 2 lea r0, [r0+r2*2] jg .next2rows - REP_RET + RET %endmacro %define CHROMAMC_AVG NOTHING diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_deblock_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -372,7 +372,7 @@ add r4, 2 dec r3 jg .loop - REP_RET + RET cglobal deblock_h_luma_10, 5,7,15 shl r2d, 2 @@ -411,7 +411,7 @@ lea r5, [r5+r1*8] dec r6 jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -648,7 +648,7 @@ add r4, mmsize dec r6 jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_deblock_h_luma_intra_10(uint16_t *pix, int stride, int alpha, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -155,7 +155,7 @@ ADD16_OP 13, 7+3*8 ADD16_OP 14, 6+4*8 ADD16_OP 15, 7+4*8 - REP_RET + RET %endmacro INIT_XMM sse2 @@ -292,7 +292,7 @@ ADD16_OP_INTRA 10, 4+4*8 ADD16_OP_INTRA 12, 6+3*8 ADD16_OP_INTRA 14, 6+4*8 - REP_RET + RET AC 8 AC 10 AC 12 @@ -335,7 +335,7 @@ %endif ADD16_OP_INTRA 32, 4+11*8 ADD16_OP_INTRA 34, 4+12*8 - REP_RET + RET AC 16 AC 18 AC 32 @@ -384,7 +384,7 @@ ADD16_OP_INTRA 34, 4+12*8 ADD16_OP_INTRA 40, 4+13*8 ; i+4 ADD16_OP_INTRA 42, 4+14*8 ; i+4 -REP_RET +RET AC 16 AC 18 AC 24 ; i+4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_idct.asm 2023-03-03 13:29:59.000000000 +0000 @@ -354,7 +354,7 @@ add r2, 128 cmp r5, 16 jl .nextblock - REP_RET + RET .no_dc: INIT_XMM cpuname mov dst2d, dword [r1+r5*4] @@ -368,7 +368,7 @@ add r2, 128 cmp r5, 16 jl .nextblock - REP_RET + RET INIT_MMX mmx h264_idct_add8_mmx_plane: @@ -508,7 +508,7 @@ add16_sse2_cycle 5, 0x24 add16_sse2_cycle 6, 0x1e add16_sse2_cycle 7, 0x26 -REP_RET +RET %macro add16intra_sse2_cycle 2 movzx r0, word [r4+%2] @@ -555,7 +555,7 @@ add16intra_sse2_cycle 5, 0x24 add16intra_sse2_cycle 6, 0x1e add16intra_sse2_cycle 7, 0x26 -REP_RET +RET %macro add8_sse2_cycle 2 movzx r0, word [r4+%2] @@ -610,7 +610,7 @@ %endif add8_sse2_cycle 2, 0x5c add8_sse2_cycle 3, 0x64 -REP_RET +RET ;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -327,7 +327,7 @@ lea r0, [r0+r1*2] dec r2d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_predict_8x8_dc_10(pixel *src, ptrdiff_t stride) @@ -481,7 +481,7 @@ add r0, r1 dec r2d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- @@ -994,7 +994,7 @@ lea r0, [r0+r1*2] dec r2d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_horizontal_10(pixel *src, ptrdiff_t stride) @@ -1012,7 +1012,7 @@ lea r0, [r0+r1*2] dec r2d jg .vloop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_dc_10(pixel *src, ptrdiff_t stride) @@ -1048,7 +1048,7 @@ lea r5, [r5+r1*2] dec r3d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_top_dc_10(pixel *src, ptrdiff_t stride) @@ -1070,7 +1070,7 @@ lea r0, [r0+r1*2] dec r2d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_left_dc_10(pixel *src, ptrdiff_t stride) @@ -1101,7 +1101,7 @@ lea r5, [r5+r1*2] dec r3d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_128_dc_10(pixel *src, ptrdiff_t stride) @@ -1116,4 +1116,4 @@ lea r0, [r0+r1*2] dec r2d jg .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_intrapred.asm 2023-03-03 13:29:59.000000000 +0000 @@ -62,7 +62,7 @@ lea r0, [r0+r1*2] dec r2 jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred16x16_horizontal_8(uint8_t *src, ptrdiff_t stride) @@ -95,7 +95,7 @@ lea r0, [r0+r1*2] dec r2 jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -146,7 +146,7 @@ lea r4, [r4+r1*2] dec r3d jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -192,7 +192,7 @@ lea r0, [r0+r1*2] dec r5d jg .loop - REP_RET + RET %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 @@ -228,7 +228,7 @@ lea dstq, [dstq+strideq*4] dec iterationd jg .loop - REP_RET + RET %endif ;----------------------------------------------------------------------------- @@ -427,7 +427,7 @@ lea r0, [r0+r2*2] dec r4 jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -556,7 +556,7 @@ lea r0, [r0+r2*2] dec r4 jg .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -599,7 +599,7 @@ lea r0, [r0+r1*2] dec r2 jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -737,7 +737,7 @@ lea r4, [r4+r1*2] dec r3d jg .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_pred8x8_tm_vp8_8(uint8_t *src, ptrdiff_t stride) @@ -770,7 +770,7 @@ lea r0, [r0+r1*2] dec r5d jg .loop - REP_RET + RET INIT_XMM ssse3 cglobal pred8x8_tm_vp8_8, 2,3,6 @@ -797,7 +797,7 @@ lea r0, [r0+r1*2] dec r2d jg .loop - REP_RET + RET ; dest, left, right, src, tmp ; output: %1 = (t[n-1] + t[n]*2 + t[n+1] + 2) >> 2 @@ -1802,7 +1802,7 @@ lea r0, [r0+r2*2] dec r5d jg .loop - REP_RET + RET INIT_XMM ssse3 cglobal pred4x4_tm_vp8_8, 3,3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -211,7 +211,7 @@ lea r1, [r1+r2*2] dec r3d jg .loop - REP_RET + RET %endmacro %define OP_MOV mova diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_8bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_8bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_8bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel_8bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -89,7 +89,7 @@ add r1, r3 dec r4d jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -149,7 +149,7 @@ add r1, r3 dec r4d jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -192,7 +192,7 @@ add r0, r2 dec r4d jne .loop - REP_RET + RET %endmacro INIT_XMM ssse3 @@ -239,7 +239,7 @@ add r2, r4 dec r5d jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -303,7 +303,7 @@ add r2, r4 dec r5d jg .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -350,7 +350,7 @@ add r2, r4 dec r5d jg .loop - REP_RET + RET %endmacro INIT_XMM ssse3 @@ -458,7 +458,7 @@ FILT_V %1 FILT_V %1 .end: - REP_RET + RET %endmacro INIT_XMM sse2 @@ -531,7 +531,7 @@ add r1, r2 dec r3d jnz .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -574,7 +574,7 @@ FILT_HV 14*48 FILT_HV 15*48 .end: - REP_RET + RET %endmacro INIT_XMM sse2 @@ -619,7 +619,7 @@ add r0, r2 dec r4d jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -710,7 +710,7 @@ dec r4d jne .op16 .done: - REP_RET + RET %endmacro INIT_XMM ssse3 @@ -776,7 +776,7 @@ lea r0, [r0+2*r3] sub r5d, 2 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -845,7 +845,7 @@ add r2, r4 dec r5d jg .loop - REP_RET + RET %endmacro INIT_XMM ssse3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_qpel.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/avassert.h" #include "libavutil/cpu.h" #include "libavutil/mem_internal.h" #include "libavutil/x86/asm.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -101,7 +101,7 @@ add r0, r1 dec r2d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -120,7 +120,7 @@ add r0, r1 dec r2d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -142,7 +142,7 @@ add r0, r3 dec r2d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -234,7 +234,7 @@ add r1, r2 dec r3d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -253,7 +253,7 @@ add r1, r2 dec r3d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -275,7 +275,7 @@ add r1, r4 dec r3d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/h264_weight.asm 2023-03-03 13:29:59.000000000 +0000 @@ -79,7 +79,7 @@ add r0, r1 dec r2d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -102,7 +102,7 @@ add r0, r3 dec r2d jnz .nextrow - REP_RET + RET %endmacro INIT_MMX mmxext @@ -196,7 +196,7 @@ add r1, r2 dec r3d jnz .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -223,7 +223,7 @@ add r1, r4 dec r3d jnz .nextrow - REP_RET + RET %endmacro INIT_MMX mmxext @@ -258,7 +258,7 @@ add r1, r2 dec r3d jnz .nextrow - REP_RET + RET INIT_XMM ssse3 cglobal h264_biweight_8, 7, 8, 8 @@ -281,4 +281,4 @@ add r1, r4 dec r3d jnz .nextrow - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_add_res.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_add_res.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_add_res.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_add_res.asm 2023-03-03 13:29:59.000000000 +0000 @@ -47,7 +47,7 @@ INIT_MMX mmxext -; void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, int16_t *res, ptrdiff_t stride) +; void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, const int16_t *res, ptrdiff_t stride) cglobal hevc_add_residual_4_8, 3, 3, 6 pxor m4, m4 ADD_RES_MMX_4_8 @@ -118,7 +118,7 @@ %macro TRANSFORM_ADD_8 0 -; void ff_hevc_add_residual_8_8_(uint8_t *dst, int16_t *res, ptrdiff_t stride) +; void ff_hevc_add_residual_8_8_(uint8_t *dst, const int16_t *res, ptrdiff_t stride) cglobal hevc_add_residual_8_8, 3, 4, 8 pxor m4, m4 lea r3, [r2*3] @@ -128,7 +128,7 @@ ADD_RES_SSE_8_8 RET -; void ff_hevc_add_residual_16_8_(uint8_t *dst, int16_t *res, ptrdiff_t stride) +; void ff_hevc_add_residual_16_8_(uint8_t *dst, const int16_t *res, ptrdiff_t stride) cglobal hevc_add_residual_16_8, 3, 5, 7 pxor m0, m0 lea r3, [r2*3] @@ -142,7 +142,7 @@ jg .loop RET -; void ff_hevc_add_residual_32_8_(uint8_t *dst, int16_t *res, ptrdiff_t stride) +; void ff_hevc_add_residual_32_8_(uint8_t *dst, const int16_t *res, ptrdiff_t stride) cglobal hevc_add_residual_32_8, 3, 5, 7 pxor m0, m0 mov r4d, 16 @@ -163,7 +163,7 @@ %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 -; void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, int16_t *res, ptrdiff_t stride) +; void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride) cglobal hevc_add_residual_32_8, 3, 5, 7 pxor m0, m0 lea r3, [r2*3] @@ -289,7 +289,7 @@ mova [%1+%2+32], m3 %endmacro -; void ff_hevc_add_residual_<4|8|16|32>_10(pixel *dst, int16_t *block, ptrdiff_t stride) +; void ff_hevc_add_residual_<4|8|16|32>_10(pixel *dst, const int16_t *block, ptrdiff_t stride) INIT_MMX mmxext cglobal hevc_add_residual_4_10, 3, 3, 6 pxor m2, m2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,11 +38,11 @@ #define PEL_PROTOTYPE(name, D, opt) \ -void ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); \ -void ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); \ -void ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); \ -void ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); \ -void ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) +void ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); \ +void ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); \ +void ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); \ +void ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); \ +void ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width) /////////////////////////////////////////////////////////////////////////////// @@ -71,8 +71,8 @@ PEL_PROTOTYPE(fname##64, bitd, opt) #define WEIGHTING_PROTOTYPE(width, bitd, opt) \ -void ff_hevc_put_hevc_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, int height, int denom, int _wx, int _ox); \ -void ff_hevc_put_hevc_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, int16_t *_src2, int height, int denom, int _wx0, int _wx1, int _ox0, int _ox1) +void ff_hevc_put_hevc_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, int height, int denom, int _wx, int _ox); \ +void ff_hevc_put_hevc_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, const int16_t *_src2, int height, int denom, int _wx0, int _wx1, int _ox0, int _ox1) #define WEIGHTING_PROTOTYPES(bitd, opt) \ WEIGHTING_PROTOTYPE(2, bitd, opt); \ @@ -94,38 +94,38 @@ EPEL_PROTOTYPES(pel_pixels , 10, sse4); EPEL_PROTOTYPES(pel_pixels , 12, sse4); -void ff_hevc_put_hevc_pel_pixels16_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels24_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels32_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels48_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels64_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); - -void ff_hevc_put_hevc_pel_pixels16_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels24_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels32_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels48_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_pel_pixels64_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels16_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels24_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels32_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels48_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels64_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); + +void ff_hevc_put_hevc_pel_pixels16_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels24_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels32_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels48_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_pel_pixels64_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_uni_pel_pixels32_8_avx2(uint8_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_uni_pel_pixels48_8_avx2(uint8_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_uni_pel_pixels64_8_avx2(uint8_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); -void ff_hevc_put_hevc_uni_pel_pixels96_8_avx2(uint8_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); //used for 10bit -void ff_hevc_put_hevc_uni_pel_pixels128_8_avx2(uint8_t *dst, ptrdiff_t dststride,uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);//used for 10bit - - -void ff_hevc_put_hevc_bi_pel_pixels16_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels24_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels48_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels64_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); - -void ff_hevc_put_hevc_bi_pel_pixels16_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels24_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels32_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels48_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_bi_pel_pixels64_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_uni_pel_pixels32_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_uni_pel_pixels48_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_uni_pel_pixels64_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); +void ff_hevc_put_hevc_uni_pel_pixels96_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); //used for 10bit +void ff_hevc_put_hevc_uni_pel_pixels128_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);//used for 10bit + + +void ff_hevc_put_hevc_bi_pel_pixels16_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels24_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels48_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels64_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); + +void ff_hevc_put_hevc_bi_pel_pixels16_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels24_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels32_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels48_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_bi_pel_pixels64_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width); /////////////////////////////////////////////////////////////////////////////// // EPEL @@ -233,34 +233,34 @@ WEIGHTING_PROTOTYPES(10, sse4); WEIGHTING_PROTOTYPES(12, sse4); -void ff_hevc_put_hevc_qpel_h4_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_qpel_h8_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_qpel_h16_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_qpel_h32_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_qpel_h64_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); -void ff_hevc_put_hevc_qpel_hv8_8_avx512icl(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h4_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h16_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h32_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_h64_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); +void ff_hevc_put_hevc_qpel_hv8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); /////////////////////////////////////////////////////////////////////////////// // TRANSFORM_ADD /////////////////////////////////////////////////////////////////////////////// -void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_8_8_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_16_8_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_32_8_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); - -void ff_hevc_add_residual_8_8_avx(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_16_8_avx(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_32_8_avx(uint8_t *dst, int16_t *res, ptrdiff_t stride); - -void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, int16_t *res, ptrdiff_t stride); - -void ff_hevc_add_residual_4_10_mmxext(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_8_10_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_16_10_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_32_10_sse2(uint8_t *dst, int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_8_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_16_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_32_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); + +void ff_hevc_add_residual_8_8_avx(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_16_8_avx(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_32_8_avx(uint8_t *dst, const int16_t *res, ptrdiff_t stride); + +void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); + +void ff_hevc_add_residual_4_10_mmxext(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_8_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_16_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_32_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_16_10_avx2(uint8_t *dst, int16_t *res, ptrdiff_t stride); -void ff_hevc_add_residual_32_10_avx2(uint8_t *dst, int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_16_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); +void ff_hevc_add_residual_32_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride); #endif // AVCODEC_X86_HEVCDSP_H diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevcdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,10 +29,10 @@ #include "libavcodec/x86/hevcdsp.h" #define LFC_FUNC(DIR, DEPTH, OPT) \ -void ff_hevc_ ## DIR ## _loop_filter_chroma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int *tc, uint8_t *no_p, uint8_t *no_q); +void ff_hevc_ ## DIR ## _loop_filter_chroma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, const int *tc, const uint8_t *no_p, const uint8_t *no_q); #define LFL_FUNC(DIR, DEPTH, OPT) \ -void ff_hevc_ ## DIR ## _loop_filter_luma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int beta, int *tc, uint8_t *no_p, uint8_t *no_q); +void ff_hevc_ ## DIR ## _loop_filter_luma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int beta, const int *tc, const uint8_t *no_p, const uint8_t *no_q); #define LFC_FUNCS(type, depth, opt) \ LFC_FUNC(h, depth, opt) \ @@ -85,46 +85,42 @@ #define mc_rep_func(name, bitd, step, W, opt) \ void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *_dst, \ - uint8_t *_src, ptrdiff_t _srcstride, int height, \ + const uint8_t *_src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ int i; \ - uint8_t *src; \ int16_t *dst; \ for (i = 0; i < W; i += step) { \ - src = _src + (i * ((bitd + 7) / 8)); \ + const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \ dst = _dst + i; \ ff_hevc_put_hevc_##name##step##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \ } \ } #define mc_rep_uni_func(name, bitd, step, W, opt) \ void ff_hevc_put_hevc_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \ - uint8_t *_src, ptrdiff_t _srcstride, int height, \ + const uint8_t *_src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ int i; \ - uint8_t *src; \ uint8_t *dst; \ for (i = 0; i < W; i += step) { \ - src = _src + (i * ((bitd + 7) / 8)); \ + const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \ dst = _dst + (i * ((bitd + 7) / 8)); \ ff_hevc_put_hevc_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \ height, mx, my, width); \ } \ } #define mc_rep_bi_func(name, bitd, step, W, opt) \ -void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, uint8_t *_src, \ - ptrdiff_t _srcstride, int16_t* _src2, \ +void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const uint8_t *_src, \ + ptrdiff_t _srcstride, const int16_t *_src2, \ int height, intptr_t mx, intptr_t my, int width) \ { \ int i; \ - uint8_t *src; \ uint8_t *dst; \ - int16_t *src2; \ for (i = 0; i < W ; i += step) { \ - src = _src + (i * ((bitd + 7) / 8)); \ + const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \ + const int16_t *src2 = _src2 + i; \ dst = _dst + (i * ((bitd + 7) / 8)); \ - src2 = _src2 + i; \ ff_hevc_put_hevc_bi_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, \ height, mx, my, width); \ } \ @@ -137,7 +133,7 @@ #define mc_rep_func2(name, bitd, step1, step2, W, opt) \ void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *dst, \ - uint8_t *src, ptrdiff_t _srcstride, int height, \ + const uint8_t *src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_##name##step1##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \ @@ -146,7 +142,7 @@ } #define mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \ void ff_hevc_put_hevc_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t _srcstride, int height, \ + const uint8_t *src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_uni_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width);\ @@ -155,8 +151,8 @@ height, mx, my, width); \ } #define mc_rep_bi_func2(name, bitd, step1, step2, W, opt) \ -void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ - ptrdiff_t _srcstride, int16_t* src2, \ +void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ + ptrdiff_t _srcstride, const int16_t *src2, \ int height, intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_bi_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, height, mx, my, width);\ @@ -173,7 +169,7 @@ #if ARCH_X86_64 && HAVE_SSE4_EXTERNAL #define mc_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \ -void ff_hevc_put_hevc_##name##width1##_10_##opt1(int16_t *dst, uint8_t *src, ptrdiff_t _srcstride, \ +void ff_hevc_put_hevc_##name##width1##_10_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride, \ int height, intptr_t mx, intptr_t my, int width) \ \ { \ @@ -182,8 +178,8 @@ } #define mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \ -void ff_hevc_put_hevc_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ - ptrdiff_t _srcstride, int16_t *src2, \ +void ff_hevc_put_hevc_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ + ptrdiff_t _srcstride, const int16_t *src2, \ int height, intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_bi_##name##width2##_10_##opt1(dst, dststride, src, _srcstride, src2, \ @@ -194,7 +190,7 @@ #define mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \ void ff_hevc_put_hevc_uni_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t _srcstride, int height, \ + const uint8_t *src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_uni_##name##width2##_10_##opt1(dst, dststride, src, _srcstride, \ @@ -209,7 +205,7 @@ mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) #define mc_rep_mix_8(name, width1, width2, width3, opt1, opt2) \ -void ff_hevc_put_hevc_##name##width1##_8_##opt1(int16_t *dst, uint8_t *src, ptrdiff_t _srcstride, \ +void ff_hevc_put_hevc_##name##width1##_8_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride, \ int height, intptr_t mx, intptr_t my, int width) \ \ { \ @@ -218,8 +214,8 @@ } #define mc_bi_rep_mix_8(name, width1, width2, width3, opt1, opt2) \ -void ff_hevc_put_hevc_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ - ptrdiff_t _srcstride, int16_t* src2, \ +void ff_hevc_put_hevc_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ + ptrdiff_t _srcstride, const int16_t *src2, \ int height, intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_bi_##name##width2##_8_##opt1(dst, dststride, src, _srcstride, \ @@ -230,7 +226,7 @@ #define mc_uni_rep_mix_8(name, width1, width2, width3, opt1, opt2) \ void ff_hevc_put_hevc_uni_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, \ - uint8_t *src, ptrdiff_t _srcstride, int height, \ + const uint8_t *src, ptrdiff_t _srcstride, int height, \ intptr_t mx, intptr_t my, int width) \ { \ ff_hevc_put_hevc_uni_##name##width2##_8_##opt1(dst, dststride, src, _srcstride, \ @@ -434,14 +430,13 @@ mc_rep_funcs(qpel_hv,12, 4, 12, sse4) #define mc_rep_uni_w(bitd, step, W, opt) \ -void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, \ +void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const int16_t *_src, \ int height, int denom, int _wx, int _ox) \ { \ int i; \ - int16_t *src; \ uint8_t *dst; \ for (i = 0; i < W; i += step) { \ - src= _src + i; \ + const int16_t *src = _src + i; \ dst= _dst + (i * ((bitd + 7) / 8)); \ ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, \ height, denom, _wx, _ox); \ @@ -470,17 +465,15 @@ mc_rep_uni_w(12, 8, 64, sse4) #define mc_rep_bi_w(bitd, step, W, opt) \ -void ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, \ - int16_t *_src2, int height, \ +void ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const int16_t *_src, \ + const int16_t *_src2, int height, \ int denom, int _wx0, int _wx1, int _ox0, int _ox1) \ { \ int i; \ - int16_t *src; \ - int16_t *src2; \ uint8_t *dst; \ for (i = 0; i < W; i += step) { \ - src = _src + i; \ - src2 = _src2 + i; \ + const int16_t *src = _src + i; \ + const int16_t *src2 = _src2 + i; \ dst = _dst + (i * ((bitd + 7) / 8)); \ ff_hevc_put_hevc_bi_w##step##_##bitd##_##opt(dst, dststride, src, src2, \ height, denom, _wx0, _wx1, _ox0, _ox1); \ @@ -510,7 +503,7 @@ #define mc_uni_w_func(name, bitd, W, opt) \ void ff_hevc_put_hevc_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \ - uint8_t *_src, ptrdiff_t _srcstride, \ + const uint8_t *_src, ptrdiff_t _srcstride, \ int height, int denom, \ int _wx, int _ox, \ intptr_t mx, intptr_t my, int width) \ @@ -568,8 +561,8 @@ #define mc_bi_w_func(name, bitd, W, opt) \ void ff_hevc_put_hevc_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \ - uint8_t *_src, ptrdiff_t _srcstride, \ - int16_t *_src2, \ + const uint8_t *_src, ptrdiff_t _srcstride, \ + const int16_t *_src2, \ int height, int denom, \ int _wx0, int _wx1, int _ox0, int _ox1, \ intptr_t mx, intptr_t my, int width) \ @@ -628,16 +621,16 @@ #endif //ARCH_X86_64 && HAVE_SSE4_EXTERNAL #define SAO_BAND_FILTER_FUNCS(bitd, opt) \ -void ff_hevc_sao_band_filter_8_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ - int16_t *sao_offset_val, int sao_left_class, int width, int height); \ -void ff_hevc_sao_band_filter_16_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ - int16_t *sao_offset_val, int sao_left_class, int width, int height); \ -void ff_hevc_sao_band_filter_32_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ - int16_t *sao_offset_val, int sao_left_class, int width, int height); \ -void ff_hevc_sao_band_filter_48_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ - int16_t *sao_offset_val, int sao_left_class, int width, int height); \ -void ff_hevc_sao_band_filter_64_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ - int16_t *sao_offset_val, int sao_left_class, int width, int height); +void ff_hevc_sao_band_filter_8_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ + const int16_t *sao_offset_val, int sao_left_class, int width, int height); \ +void ff_hevc_sao_band_filter_16_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ + const int16_t *sao_offset_val, int sao_left_class, int width, int height); \ +void ff_hevc_sao_band_filter_32_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ + const int16_t *sao_offset_val, int sao_left_class, int width, int height); \ +void ff_hevc_sao_band_filter_48_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ + const int16_t *sao_offset_val, int sao_left_class, int width, int height); \ +void ff_hevc_sao_band_filter_64_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \ + const int16_t *sao_offset_val, int sao_left_class, int width, int height); SAO_BAND_FILTER_FUNCS(8, sse2) SAO_BAND_FILTER_FUNCS(10, sse2) @@ -657,17 +650,17 @@ c->sao_band_filter[4] = ff_hevc_sao_band_filter_64_##bitd##_##opt; \ } while (0) -#define SAO_EDGE_FILTER_FUNCS(bitd, opt) \ -void ff_hevc_sao_edge_filter_8_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \ - int eo, int width, int height); \ -void ff_hevc_sao_edge_filter_16_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \ - int eo, int width, int height); \ -void ff_hevc_sao_edge_filter_32_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \ - int eo, int width, int height); \ -void ff_hevc_sao_edge_filter_48_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \ - int eo, int width, int height); \ -void ff_hevc_sao_edge_filter_64_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \ - int eo, int width, int height); \ +#define SAO_EDGE_FILTER_FUNCS(bitd, opt) \ +void ff_hevc_sao_edge_filter_8_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \ + const int16_t *sao_offset_val, int eo, int width, int height); \ +void ff_hevc_sao_edge_filter_16_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \ + const int16_t *sao_offset_val, int eo, int width, int height); \ +void ff_hevc_sao_edge_filter_32_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \ + const int16_t *sao_offset_val, int eo, int width, int height); \ +void ff_hevc_sao_edge_filter_48_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \ + const int16_t *sao_offset_val, int eo, int width, int height); \ +void ff_hevc_sao_edge_filter_64_##bitd##_##opt(uint8_t *_dst, const uint8_t *_src, ptrdiff_t stride_dst, \ + const int16_t *sao_offset_val, int eo, int width, int height); \ SAO_EDGE_FILTER_FUNCS(8, ssse3) SAO_EDGE_FILTER_FUNCS(8, avx2) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_mc.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_mc.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_mc.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_mc.asm 2023-03-03 13:29:59.000000000 +0000 @@ -711,7 +711,7 @@ ; ****************************** ; void put_hevc_mc_pixels(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my) ; ****************************** @@ -765,7 +765,7 @@ ; ****************************** ; void put_hevc_epel_hX(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my, int width); ; ****************************** @@ -820,7 +820,7 @@ ; ****************************** ; void put_hevc_epel_v(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my, int width) ; ****************************** @@ -877,7 +877,7 @@ ; ****************************** ; void put_hevc_epel_hv(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my, int width) ; ****************************** @@ -1088,7 +1088,7 @@ ; ****************************** ; void put_hevc_qpel_hX_X_X(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my, int width) ; ****************************** @@ -1144,7 +1144,7 @@ ; ****************************** ; void put_hevc_qpel_vX_X_X(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my, int width) ; ****************************** @@ -1206,7 +1206,7 @@ ; ****************************** ; void put_hevc_qpel_hvX_X(int16_t *dst, ptrdiff_t dststride, -; uint8_t *_src, ptrdiff_t _srcstride, +; const uint8_t *_src, ptrdiff_t _srcstride, ; int height, int mx, int my) ; ****************************** %macro HEVC_PUT_HEVC_QPEL_HV 2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao_10bit.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao_10bit.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao_10bit.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao_10bit.asm 2023-03-03 13:29:59.000000000 +0000 @@ -92,7 +92,7 @@ mov heightd, r7m %endmacro -;void ff_hevc_sao_band_filter___(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, +;void ff_hevc_sao_band_filter___(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, ; int16_t *sao_offset_val, int sao_left_class, int width, int height); %macro HEVC_SAO_BAND_FILTER 3 cglobal hevc_sao_band_filter_%2_%1, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left @@ -145,7 +145,7 @@ add srcq, srcstrideq dec heightd jg .loop - REP_RET + RET %endmacro %macro HEVC_SAO_BAND_FILTER_FUNCS 0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hevc_sao.asm 2023-03-03 13:29:59.000000000 +0000 @@ -119,7 +119,7 @@ %endif ; ARCH %endmacro -;void ff_hevc_sao_band_filter__8_(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, +;void ff_hevc_sao_band_filter__8_(uint8_t *_dst, const uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, ; int16_t *sao_offset_val, int sao_left_class, int width, int height); %macro HEVC_SAO_BAND_FILTER 2 cglobal hevc_sao_band_filter_%1_8, 6, 6, 15, 7*mmsize*ARCH_X86_32, dst, src, dststride, srcstride, offset, left @@ -166,7 +166,7 @@ add srcq, srcstrideq ; src += srcstride dec heightd ; cmp height jnz .loop ; height loop - REP_RET + RET %endmacro diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -78,7 +78,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -120,7 +120,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -162,7 +162,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET ; void ff_put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) @@ -194,7 +194,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -232,7 +232,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET ; void ff_avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) @@ -280,7 +280,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -323,7 +323,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -370,7 +370,7 @@ add r0, r4 sub r3d, 4 jne .loop - REP_RET + RET ; void ff_avg_pixels16_xy2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) @@ -448,7 +448,7 @@ add r4, r2 sub r3d, 2 jnz .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -514,7 +514,7 @@ add r4, r2 sub r3d, 2 jnz .loop - REP_RET + RET %endmacro INIT_MMX ssse3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp_vp3.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp_vp3.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp_vp3.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/hpeldsp_vp3.asm 2023-03-03 13:29:59.000000000 +0000 @@ -60,7 +60,7 @@ lea r0, [r0+r2*4] sub r3d, 4 jg .loop - REP_RET + RET ; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) @@ -96,4 +96,4 @@ lea r0, [r0+r2*4] sub r3d, 4 jg .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -74,7 +74,7 @@ jl .loop movd m0, [dstq-4] movd [leftq], m0 - REP_RET + RET ; void add_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int mask, int w, int *left, int *left_top) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvencdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvencdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvencdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/huffyuvencdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,10 +35,10 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, unsigned mask, int w, int *left, int *left_top); -av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx) +av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { av_unused int cpu_flags = av_get_cpu_flags(); - const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt); + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc && pix_desc->comp[0].depth<16) { c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/jpeg2000dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/jpeg2000dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/jpeg2000dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/jpeg2000dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -113,7 +113,7 @@ movaps [src1q+csizeq], m5 add csizeq, mmsize jl .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -153,7 +153,7 @@ mova [src0q+csizeq], m2 add csizeq, mmsize jl .loop - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videodsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videodsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videodsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videodsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -229,7 +229,7 @@ inc wq jl .3 .end: - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -110,7 +110,7 @@ inc wq jl .loop_gpr_%1%2 .end_%1%2: - REP_RET + RET %endmacro INIT_XMM sse2 @@ -145,7 +145,7 @@ ;-------------------------------------------------------------------------------------------------- -;void sub_left_predict(uint8_t *dst, uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height) +;void sub_left_predict(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height) ;-------------------------------------------------------------------------------------------------- INIT_XMM avx diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lossless_videoencdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,7 +34,7 @@ void ff_diff_bytes_avx2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, intptr_t w); -void ff_sub_left_predict_avx(uint8_t *dst, uint8_t *src, +void ff_sub_left_predict_avx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height); #if HAVE_INLINE_ASM diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.asm 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.asm 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,263 @@ +;****************************************************************************** +;* Copyright (c) Lynne +;* +;* This file is part of FFmpeg. +;* +;* FFmpeg is free software; you can redistribute it and/or +;* modify it under the terms of the GNU Lesser General Public +;* License as published by the Free Software Foundation; either +;* version 2.1 of the License, or (at your option) any later version. +;* +;* FFmpeg is distributed in the hope that it will be useful, +;* but WITHOUT ANY WARRANTY; without even the implied warranty of +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;* Lesser General Public License for more details. +;* +;* You should have received a copy of the GNU Lesser General Public +;* License along with FFmpeg; if not, write to the Free Software +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +;****************************************************************************** + +%include "libavutil/x86/x86util.asm" + +SECTION_RODATA 32 + +one_tab: times 4 dq 1.0 +seq_tab_avx2: dq 3.0, 2.0, 1.0, 0.0 +sub_tab: dq -1.0, -2.0, -3.0, -4.0 +add_tab_avx2: times 4 dq 4.0 +dec_tab_avx2: times 4 dq -4.0 +add_tab_sse2: times 2 dq 2.0 +dec_tab_sse2: times 2 dq -2.0 +dec_tab_scalar: times 2 dq -1.0 +seq_tab_sse2: dq 1.0, 0.0 + +SECTION .text + +%macro APPLY_WELCH_FN 0 +cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2 + cmp lenq, 0 + je .end_e + cmp lenq, 2 + je .two + cmp lenq, 1 + je .one + + movapd m6, [one_tab] + + movd xm1, lend + cvtdq2pd xm1, xm1 ; len +%if cpuflag(avx2) + vbroadcastsd m1, xm1 +%else + shufpd m1, m1, 00b +%endif + + addpd m0, m6, m6 ; 2.0 + subpd m1, m6 ; len - 1 + divpd m0, m1 ; 2.0 / (len - 1) + + mov off1q, lenq + and off1q, 1 + je .even + + movapd m5, m0 + addpd m0, [sub_tab] + + lea off2q, [lenq*4 - mmsize/2] + sub lenq, mmsize/4 ; avoid overwriting + xor off1q, off1q + + cmp lenq, mmsize/4 + jl .scalar_o + +%if cpuflag(avx2) + movapd m7, [dec_tab_avx2] +%else + movapd m7, [dec_tab_sse2] +%endif + +.loop_o: + movapd m1, m6 +%if cpuflag(avx2) + fnmaddpd m1, m0, m0, m1 + vpermpd m2, m1, q0123 +%else + mulpd m2, m0, m0 + subpd m1, m2 + shufpd m2, m1, m1, 01b +%endif + + cvtdq2pd m3, [dataq + off1q] + cvtdq2pd m4, [dataq + off2q] + + mulpd m1, m3 + mulpd m2, m4 + + movupd [outq + off1q*2], m1 + movupd [outq + off2q*2], m2 + + addpd m0, m7 + add off1q, mmsize/2 + sub off2q, mmsize/2 + sub lenq, mmsize/4 + jg .loop_o + + add lend, (mmsize/4 - 1) + cmp lend, 0 + je .end_o + sub lenq, (mmsize/4 - 1) + +.scalar_o: + movapd xm7, [dec_tab_scalar] + + ; Set offsets + add off2q, (mmsize/4) + 4*cpuflag(avx2) + add lenq, mmsize/4 - 2 + +.loop_o_scalar: + movapd xm1, xm6 +%if cpuflag(avx2) + fnmaddpd xm1, xm0, xm0, xm1 +%else + mulpd xm2, xm0, xm0 + subpd xm1, xm2 +%endif + + cvtdq2pd xm3, [dataq + off1q] + cvtdq2pd xm4, [dataq + off2q] + + mulpd xm3, xm1 + mulpd xm4, xm1 + + movlpd [outq + off1q*2], xm3 + movlpd [outq + off2q*2], xm4 + + addpd xm0, xm7 + + add off1q, 4 + sub off2q, 4 + + sub lenq, 2 + jg .loop_o_scalar + +.end_o: + xorpd xm3, xm3 + movlpd [outq + off1q*2], xm3 + RET + +.even: +%if cpuflag(avx2) + addpd m0, [seq_tab_avx2] +%else + addpd m0, [seq_tab_sse2] +%endif + + mov off1d, lend + shr off1d, 1 + movd xm1, off1d + cvtdq2pd xm1, xm1 ; len/2 +%if cpuflag(avx2) + vbroadcastsd m1, xm1 +%else + shufpd m1, m1, 00b +%endif + subpd m0, m1 + +%if cpuflag(avx2) + movapd m7, [add_tab_avx2] +%else + movapd m7, [add_tab_sse2] +%endif + + lea off2q, [lenq*2] + lea off1q, [lenq*2 - mmsize/2] + sub lenq, mmsize/4 + + cmp lenq, mmsize/4 + jl .scalar_e + +.loop_e: + movapd m1, m6 +%if cpuflag(avx2) + fnmaddpd m1, m0, m0, m1 +%else + mulpd m2, m0, m0 + subpd m1, m2 +%endif +%if cpuflag(avx2) + vpermpd m2, m1, q0123 +%else + shufpd m2, m1, m1, 01b +%endif + + cvtdq2pd m3, [dataq + off1q] + cvtdq2pd m4, [dataq + off2q] + + mulpd m1, m3 + mulpd m2, m4 + + movupd [outq + off1q*2], m1 + movupd [outq + off2q*2], m2 + + addpd m0, m7 + add off2q, mmsize/2 + sub off1q, mmsize/2 + sub lenq, mmsize/4 + jge .loop_e + +.scalar_e: + subpd xm0, xm7 + movapd xm7, [dec_tab_scalar] + subpd xm0, xm7 + + add off1q, (mmsize/2) + sub off2q, (mmsize/2) - 8*cpuflag(avx2) + add lenq, 6 + 4*cpuflag(avx2) + + addpd xm0, [sub_tab] + +.loop_e_scalar: + movapd xm1, xm6 +%if cpuflag(avx2) + fnmaddpd xm1, xm0, xm0, xm1 +%else + mulpd xm2, xm0, xm0 + subpd xm1, xm2 +%endif + + cvtdq2pd xm3, [dataq + off1q] + cvtdq2pd xm4, [dataq + off2q] + + mulpd xm3, xm1 + shufpd xm1, xm1, 00b + mulpd xm4, xm1 + + movlpd [outq + off1q*2], xm3 + movhpd [outq + off2q*2 + 8], xm4 + + subpd xm0, xm7 + + add off2q, 4 + sub off1q, 4 + sub lenq, 2 + jg .loop_e_scalar + RET + +.two: + xorpd xm0, xm0 + movhpd [outq + 8], xm0 +.one: + xorpd xm0, xm0 + movhpd [outq], xm0 +.end_e: + RET +%endmacro + +INIT_XMM sse2 +APPLY_WELCH_FN + +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +APPLY_WELCH_FN +%endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* - * SIMD-optimized LPC functions - * Copyright (c) 2007 Loren Merritt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "libavutil/attributes.h" -#include "libavutil/cpu.h" -#include "libavutil/mem_internal.h" -#include "libavutil/x86/asm.h" -#include "libavutil/x86/cpu.h" -#include "libavcodec/lpc.h" - -DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 }; -DECLARE_ASM_CONST(16, double, pd_2)[2] = { 2.0, 2.0 }; - -#if HAVE_SSE2_INLINE - -static void lpc_apply_welch_window_sse2(const int32_t *data, int len, - double *w_data) -{ - double c = 2.0 / (len-1.0); - int n2 = len>>1; - x86_reg i = -n2*sizeof(int32_t); - x86_reg j = n2*sizeof(int32_t); - __asm__ volatile( - "movsd %4, %%xmm7 \n\t" - "movapd "MANGLE(pd_1)", %%xmm6 \n\t" - "movapd "MANGLE(pd_2)", %%xmm5 \n\t" - "movlhps %%xmm7, %%xmm7 \n\t" - "subpd %%xmm5, %%xmm7 \n\t" - "addsd %%xmm6, %%xmm7 \n\t" - "test $1, %5 \n\t" - "jz 2f \n\t" -#define WELCH(MOVPD, offset)\ - "1: \n\t"\ - "movapd %%xmm7, %%xmm1 \n\t"\ - "mulpd %%xmm1, %%xmm1 \n\t"\ - "movapd %%xmm6, %%xmm0 \n\t"\ - "subpd %%xmm1, %%xmm0 \n\t"\ - "pshufd $0x4e, %%xmm0, %%xmm1 \n\t"\ - "cvtpi2pd (%3,%0), %%xmm2 \n\t"\ - "cvtpi2pd "#offset"*4(%3,%1), %%xmm3 \n\t"\ - "mulpd %%xmm0, %%xmm2 \n\t"\ - "mulpd %%xmm1, %%xmm3 \n\t"\ - "movapd %%xmm2, (%2,%0,2) \n\t"\ - MOVPD" %%xmm3, "#offset"*8(%2,%1,2) \n\t"\ - "subpd %%xmm5, %%xmm7 \n\t"\ - "sub $8, %1 \n\t"\ - "add $8, %0 \n\t"\ - "jl 1b \n\t"\ - - WELCH("movupd", -1) - "jmp 3f \n\t" - "2: \n\t" - WELCH("movapd", -2) - "3: \n\t" - :"+&r"(i), "+&r"(j) - :"r"(w_data+n2), "r"(data+n2), "m"(c), "r"(len) - NAMED_CONSTRAINTS_ARRAY_ADD(pd_1,pd_2) - XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3", - "%xmm5", "%xmm6", "%xmm7") - ); -#undef WELCH -} - -static void lpc_compute_autocorr_sse2(const double *data, int len, int lag, - double *autoc) -{ - int j; - - if((x86_reg)data & 15) - data++; - - for(j=0; jlpc_apply_welch_window = lpc_apply_welch_window_sse2; - c->lpc_compute_autocorr = lpc_compute_autocorr_sse2; - } -#endif /* HAVE_SSE2_INLINE */ -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/lpc_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * SIMD-optimized LPC functions + * Copyright (c) 2007 Loren Merritt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/attributes.h" +#include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" +#include "libavcodec/lpc.h" + +void ff_lpc_apply_welch_window_sse2(const int32_t *data, ptrdiff_t len, + double *w_data); +void ff_lpc_apply_welch_window_avx2(const int32_t *data, ptrdiff_t len, + double *w_data); + +DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 }; + +#if HAVE_SSE2_INLINE + +static void lpc_compute_autocorr_sse2(const double *data, ptrdiff_t len, int lag, + double *autoc) +{ + int j; + + if((x86_reg)data & 15) + data++; + + for(j=0; jlpc_compute_autocorr = lpc_compute_autocorr_sse2; +#endif + + if (EXTERNAL_SSE2(cpu_flags)) + c->lpc_apply_welch_window = ff_lpc_apply_welch_window_sse2; + + if (EXTERNAL_AVX2(cpu_flags)) + c->lpc_apply_welch_window = ff_lpc_apply_welch_window_avx2; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -10,7 +10,6 @@ x86/dirac_dwt_init.o OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o OBJS-$(CONFIG_FFT) += x86/fft_init.o -OBJS-$(CONFIG_FLACDSP) += x86/flacdsp_init.o OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert_init.o OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o @@ -24,12 +23,10 @@ OBJS-$(CONFIG_HUFFYUVDSP) += x86/huffyuvdsp_init.o OBJS-$(CONFIG_HUFFYUVENCDSP) += x86/huffyuvencdsp_init.o OBJS-$(CONFIG_IDCTDSP) += x86/idctdsp_init.o -OBJS-$(CONFIG_LPC) += x86/lpc.o -OBJS-$(CONFIG_MDCT15) += x86/mdct15_init.o +OBJS-$(CONFIG_LPC) += x86/lpc_init.o OBJS-$(CONFIG_ME_CMP) += x86/me_cmp_init.o OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodsp.o -OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o \ - x86/mpegvideodsp.o +OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o \ x86/mpegvideoencdsp_init.o OBJS-$(CONFIG_PIXBLOCKDSP) += x86/pixblockdsp_init.o @@ -55,13 +52,15 @@ OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o x86/synth_filter_init.o OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o OBJS-$(CONFIG_EXR_DECODER) += x86/exrdsp_init.o +OBJS-$(CONFIG_FLAC_DECODER) += x86/flacdsp_init.o +OBJS-$(CONFIG_FLAC_ENCODER) += x86/flacencdsp_init.o OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp_init.o OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_init.o OBJS-$(CONFIG_HEVC_DECODER) += x86/hevcdsp_init.o OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp_init.o OBJS-$(CONFIG_LSCR_DECODER) += x86/pngdsp_init.o OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp_init.o -OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct_init.o +OBJS-$(CONFIG_MPEG4_DECODER) += x86/mpeg4videodsp.o x86/xvididct_init.o OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o @@ -126,7 +125,7 @@ X86ASM-OBJS-$(CONFIG_LLAUDDSP) += x86/lossless_audiodsp.o X86ASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o X86ASM-OBJS-$(CONFIG_LLVIDENCDSP) += x86/lossless_videoencdsp.o -X86ASM-OBJS-$(CONFIG_MDCT15) += x86/mdct15.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_MPEGVIDEOENC) += x86/mpegvideoencdsp.o @@ -139,8 +138,11 @@ X86ASM-OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp.o X86ASM-OBJS-$(CONFIG_VC1DSP) += x86/vc1dsp_loopfilter.o \ x86/vc1dsp_mc.o -X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct10.o \ - x86/simple_idct.o +ifdef ARCH_X86_64 +X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct10.o +else +X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o +endif X86ASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o X86ASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o X86ASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15.asm 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ -;****************************************************************************** -;* SIMD optimized non-power-of-two MDCT functions -;* -;* Copyright (C) 2017 Rostislav Pehlivanov -;* -;* This file is part of FFmpeg. -;* -;* FFmpeg is free software; you can redistribute it and/or -;* modify it under the terms of the GNU Lesser General Public -;* License as published by the Free Software Foundation; either -;* version 2.1 of the License, or (at your option) any later version. -;* -;* FFmpeg is distributed in the hope that it will be useful, -;* but WITHOUT ANY WARRANTY; without even the implied warranty of -;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;* Lesser General Public License for more details. -;* -;* You should have received a copy of the GNU Lesser General Public -;* License along with FFmpeg; if not, write to the Free Software -;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -;****************************************************************************** - -%include "libavutil/x86/x86util.asm" - -SECTION_RODATA 32 - -perm_neg: dd 2, 5, 3, 4, 6, 1, 7, 0 -perm_pos: dd 0, 7, 1, 6, 4, 3, 5, 2 -sign_adjust_r: times 4 dd 0x80000000, 0x00000000 - -sign_adjust_5: dd 0x00000000, 0x80000000, 0x80000000, 0x00000000 - -SECTION .text - -%if ARCH_X86_64 - -;***************************************************************************************** -;void ff_fft15_avx(FFTComplex *out, FFTComplex *in, FFTComplex *exptab, ptrdiff_t stride); -;***************************************************************************************** -%macro FFT5 3 ; %1 - in_offset, %2 - dst1 (64bit used), %3 - dst2 - VBROADCASTSD m0, [inq + %1] ; in[ 0].re, in[ 0].im, in[ 0].re, in[ 0].im - movsd xm1, [inq + 1*16 + 8 + %1] ; in[ 3].re, in[ 3].im, 0, 0 - movsd xm4, [inq + 6*16 + 0 + %1] ; in[12].re, in[12].im, 0, 0 - movhps xm1, [inq + 3*16 + 0 + %1] ; in[ 3].re, in[ 3].im, in[ 6].re, in[ 6].im - movhps xm4, [inq + 4*16 + 8 + %1] ; in[12].re, in[12].im, in[ 9].re, in[ 9].im - - subps xm2, xm1, xm4 ; t[2].im, t[2].re, t[3].im, t[3].re - addps xm1, xm4 ; t[0].re, t[0].im, t[1].re, t[1].im - - movhlps %2, xm1 ; t[0].re, t[1].re, t[0].im, t[1].im - addps %2, xm1 - addps %2, xm0 ; DC[0].re, DC[0].im, junk... - movlhps %2, %2 ; DC[0].re, DC[0].im, DC[0].re, DC[0].im - - shufps xm3, xm1, xm2, q0110 ; t[0].re, t[0].im, t[2].re, t[2].im - shufps xm1, xm2, q2332 ; t[1].re, t[1].im, t[3].re, t[3].im - - mulps xm%3, xm1, xm5 - mulps xm4, xm3, xm6 - mulps xm1, xm6 - - xorps xm1, xm7 - mulps xm3, xm5 - addsubps xm3, xm1 ; t[0].re, t[0].im, t[2].re, t[2].im - subps xm%3, xm4 ; t[4].re, t[4].im, t[5].re, t[5].im - - movhlps xm2, xm%3, xm3 ; t[2].re, t[2].im, t[5].re, t[5].im - movlhps xm3, xm%3 ; t[0].re, t[0].im, t[4].re, t[4].im - - xorps xm2, xm7 - addps xm%3, xm2, xm3 - subps xm3, xm2 - - shufps xm3, xm3, q1032 - vinsertf128 m%3, m%3, xm3, 1 ; All ACs (tmp[1] through to tmp[4]) - addps m%3, m%3, m0 ; Finally offset with DCs -%endmacro - -%macro BUTTERFLIES_DC 1 ; %1 - exptab_offset - mulps xm0, xm9, [exptabq + %1 + 16*0] - mulps xm1, xm10, [exptabq + %1 + 16*1] - - haddps xm0, xm1 - movhlps xm1, xm0 ; t[0].re, t[1].re, t[0].im, t[1].im - - addps xm0, xm1 - addps xm0, xm8 - - movsd [outq], xm0 -%endmacro - -%macro BUTTERFLIES_AC 1 ; %1 - exptab_offset - mulps m0, m12, [exptabq + 64*0 + 0*mmsize + %1] - mulps m1, m12, [exptabq + 64*0 + 1*mmsize + %1] - mulps m2, m13, [exptabq + 64*1 + 0*mmsize + %1] - mulps m3, m13, [exptabq + 64*1 + 1*mmsize + %1] - - addps m0, m0, m2 - addps m1, m1, m3 - addps m0, m0, m11 - - shufps m1, m1, m1, q2301 - addps m0, m0, m1 - - vextractf128 xm1, m0, 1 - - movlps [outq + strideq*1], xm0 - movhps [outq + strideq*2], xm0 - movlps [outq + stride3q], xm1 - movhps [outq + strideq*4], xm1 -%endmacro - -INIT_YMM avx -cglobal fft15, 4, 5, 14, out, in, exptab, stride, stride5 - shl strideq, 3 - - movaps xm5, [exptabq + 480 + 16*0] - movaps xm6, [exptabq + 480 + 16*1] - movaps xm7, [sign_adjust_5] - - FFT5 0, xm8, 11 - FFT5 8, xm9, 12 - FFT5 16, xm10, 13 - -%define stride3q inq - lea stride3q, [strideq + strideq*2] - lea stride5q, [strideq + strideq*4] - - BUTTERFLIES_DC (8*6 + 4*0)*2*4 - BUTTERFLIES_AC (8*0 + 0*0)*2*4 - - add outq, stride5q - BUTTERFLIES_DC (8*6 + 4*1)*2*4 - BUTTERFLIES_AC (8*2 + 0*0)*2*4 - - add outq, stride5q - BUTTERFLIES_DC (8*6 + 4*2)*2*4 - BUTTERFLIES_AC (8*4 + 0*0)*2*4 - - RET - -%endif ; ARCH_X86_64 - -;******************************************************************************************************* -;void ff_mdct15_postreindex(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8); -;******************************************************************************************************* -%macro LUT_LOAD_4D 3 - mov r4d, [lutq + %3q*4 + 0] - movsd xmm%1, [inq + r4q*8] - mov r4d, [lutq + %3q*4 + 4] - movhps xmm%1, [inq + r4q*8] -%if cpuflag(avx2) - mov r4d, [lutq + %3q*4 + 8] - movsd %2, [inq + r4q*8] - mov r4d, [lutq + %3q*4 + 12] - movhps %2, [inq + r4q*8] - vinsertf128 %1, %1, %2, 1 -%endif -%endmacro - -%macro POSTROTATE_FN 1 -cglobal mdct15_postreindex, 5, 7, 8 + cpuflag(avx2)*2, out, in, exp, lut, len8, offset_p, offset_n - - xor offset_nq, offset_nq - lea offset_pq, [len8q*2 - %1] - - movaps m7, [sign_adjust_r] - -%if cpuflag(avx2) - movaps m8, [perm_pos] - movaps m9, [perm_neg] -%endif - -.loop: - movups m0, [expq + offset_pq*8] ; exp[p0].re, exp[p0].im, exp[p1].re, exp[p1].im, exp[p2].re, exp[p2].im, exp[p3].re, exp[p3].im - movups m1, [expq + offset_nq*8] ; exp[n3].re, exp[n3].im, exp[n2].re, exp[n2].im, exp[n1].re, exp[n1].im, exp[n0].re, exp[n0].im - - LUT_LOAD_4D m3, xm4, offset_p ; in[p0].re, in[p0].im, in[p1].re, in[p1].im, in[p2].re, in[p2].im, in[p3].re, in[p3].im - LUT_LOAD_4D m4, xm5, offset_n ; in[n3].re, in[n3].im, in[n2].re, in[n2].im, in[n1].re, in[n1].im, in[n0].re, in[n0].im - - mulps m5, m3, m0 ; in[p].reim * exp[p].reim - mulps m6, m4, m1 ; in[n].reim * exp[n].reim - - xorps m5, m7 ; in[p].re *= -1, in[p].im *= 1 - xorps m6, m7 ; in[n].re *= -1, in[n].im *= 1 - - shufps m3, m3, m3, q2301 ; in[p].imre - shufps m4, m4, m4, q2301 ; in[n].imre - - mulps m3, m0 ; in[p].imre * exp[p].reim - mulps m4, m1 ; in[n].imre * exp[n].reim - - haddps m3, m6 ; out[n0].im, out[n1].im, out[n3].re, out[n2].re, out[n2].im, out[n3].im, out[n1].re, out[n0].re - haddps m5, m4 ; out[p0].re, out[p1].re, out[p3].im, out[p2].im, out[p2].re, out[p3].re, out[p1].im, out[p0].im - -%if cpuflag(avx2) - vpermps m3, m9, m3 ; out[n3].im, out[n3].re, out[n2].im, out[n2].re, out[n1].im, out[n1].re, out[n0].im, out[n0].re - vpermps m5, m8, m5 ; out[p0].re, out[p0].im, out[p1].re, out[p1].im, out[p2].re, out[p2].im, out[p3].re, out[p3].im -%else - shufps m3, m3, m3, q0312 - shufps m5, m5, m5, q2130 -%endif - - movups [outq + offset_nq*8], m3 - movups [outq + offset_pq*8], m5 - - sub offset_pq, %1 - add offset_nq, %1 - cmp offset_nq, offset_pq - jle .loop - - REP_RET -%endmacro - -INIT_XMM sse3 -POSTROTATE_FN 2 - -%if ARCH_X86_64 && HAVE_AVX2_EXTERNAL -INIT_YMM avx2 -POSTROTATE_FN 4 -%endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mdct15_init.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * SIMD optimized non-power-of-two MDCT functions - * - * Copyright (C) 2017 Rostislav Pehlivanov - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -#include "config.h" - -#include "libavutil/attributes.h" -#include "libavutil/x86/cpu.h" -#include "libavcodec/mdct15.h" - -void ff_mdct15_postreindex_sse3(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8); -void ff_mdct15_postreindex_avx2(FFTComplex *out, FFTComplex *in, FFTComplex *exp, int *lut, ptrdiff_t len8); - -void ff_fft15_avx(FFTComplex *out, FFTComplex *in, FFTComplex *exptab, ptrdiff_t stride); - -static void perm_twiddles(MDCT15Context *s) -{ - int k; - FFTComplex tmp[30]; - - /* 5-point FFT twiddles */ - s->exptab[60].re = s->exptab[60].im = s->exptab[19].re; - s->exptab[61].re = s->exptab[61].im = s->exptab[19].im; - s->exptab[62].re = s->exptab[62].im = s->exptab[20].re; - s->exptab[63].re = s->exptab[63].im = s->exptab[20].im; - - /* 15-point FFT twiddles */ - for (k = 0; k < 5; k++) { - tmp[6*k + 0] = s->exptab[k + 0]; - tmp[6*k + 2] = s->exptab[k + 5]; - tmp[6*k + 4] = s->exptab[k + 10]; - - tmp[6*k + 1] = s->exptab[2 * (k + 0)]; - tmp[6*k + 3] = s->exptab[2 * (k + 5)]; - tmp[6*k + 5] = s->exptab[2 * k + 5 ]; - } - - for (k = 0; k < 6; k++) { - FFTComplex ac_exp[] = { - { tmp[6*1 + k].re, tmp[6*1 + k].re }, - { tmp[6*2 + k].re, tmp[6*2 + k].re }, - { tmp[6*3 + k].re, tmp[6*3 + k].re }, - { tmp[6*4 + k].re, tmp[6*4 + k].re }, - { tmp[6*1 + k].im, -tmp[6*1 + k].im }, - { tmp[6*2 + k].im, -tmp[6*2 + k].im }, - { tmp[6*3 + k].im, -tmp[6*3 + k].im }, - { tmp[6*4 + k].im, -tmp[6*4 + k].im }, - }; - memcpy(s->exptab + 8*k, ac_exp, 8*sizeof(FFTComplex)); - } - - /* Specialcase when k = 0 */ - for (k = 0; k < 3; k++) { - FFTComplex dc_exp[] = { - { tmp[2*k + 0].re, -tmp[2*k + 0].im }, - { tmp[2*k + 0].im, tmp[2*k + 0].re }, - { tmp[2*k + 1].re, -tmp[2*k + 1].im }, - { tmp[2*k + 1].im, tmp[2*k + 1].re }, - }; - memcpy(s->exptab + 8*6 + 4*k, dc_exp, 4*sizeof(FFTComplex)); - } -} - -av_cold void ff_mdct15_init_x86(MDCT15Context *s) -{ - int adjust_twiddles = 0; - int cpu_flags = av_get_cpu_flags(); - - if (EXTERNAL_SSE3(cpu_flags)) - s->postreindex = ff_mdct15_postreindex_sse3; - -#if ARCH_X86_64 - if (EXTERNAL_AVX(cpu_flags)) { - s->fft15 = ff_fft15_avx; - adjust_twiddles = 1; - } - - if (EXTERNAL_AVX2_FAST(cpu_flags)) - s->postreindex = ff_mdct15_postreindex_avx2; -#endif - - if (adjust_twiddles) - perm_twiddles(s); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ psubw %1, %2 %endmacro -; %1=uint8_t *pix1, %2=uint8_t *pix2, %3=static offset, %4=stride, %5=stride*3 +; %1=const uint8_t *pix1, %2=const uint8_t *pix2, %3=static offset, %4=stride, %5=stride*3 ; %6=temporary storage location ; this macro requires $mmsize stack space (aligned) on %6 (except on SSE+x86-64) %macro DIFF_PIXELS_8 6 @@ -214,8 +214,8 @@ hadamard8_16_wrapper %1, 3 %elif cpuflag(mmx) ALIGN 16 -; int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1, -; uint8_t *src2, ptrdiff_t stride, int h) +; int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, const uint8_t *src1, +; const uint8_t *src2, ptrdiff_t stride, int h) ; r0 = void *s = unused, int h = unused (always 8) ; note how r1, r2 and r3 are not clobbered in this function, so 16x16 ; can simply call this 2x2x (and that's why we access rsp+gprsize @@ -278,7 +278,7 @@ %define ABS_SUM_8x8 ABS_SUM_8x8_64 HADAMARD8_DIFF 9 -; int ff_sse*_*(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +; int ff_sse*_*(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ; ptrdiff_t line_size, int h) %macro SUM_SQUARED_ERRORS 1 @@ -357,7 +357,7 @@ SUM_SQUARED_ERRORS 16 ;----------------------------------------------- -;int ff_sum_abs_dctelem(int16_t *block) +;int ff_sum_abs_dctelem(const int16_t *block) ;----------------------------------------------- ; %1 = number of xmm registers used ; %2 = number of inline loops @@ -390,7 +390,7 @@ SUM_ABS_DCTELEM 6, 2 ;------------------------------------------------------------------------------ -; int ff_hf_noise*_mmx(uint8_t *pix1, ptrdiff_t lsize, int h) +; int ff_hf_noise*_mmx(const uint8_t *pix1, ptrdiff_t lsize, int h) ;------------------------------------------------------------------------------ ; %1 = 8/16. %2-5=m# %macro HF_NOISE_PART1 5 @@ -458,7 +458,7 @@ psrlq m6, 32 paddd m0, m6 movd eax, m0 ; eax = result of hf_noise8; - REP_RET ; return eax; + RET ; return eax; %endmacro INIT_MMX mmx @@ -466,7 +466,7 @@ HF_NOISE 16 ;--------------------------------------------------------------------------------------- -;int ff_sad_(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t stride, int h); +;int ff_sad_(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); ;--------------------------------------------------------------------------------------- ;%1 = 8/16 %macro SAD 1 @@ -521,7 +521,7 @@ SAD 16 ;------------------------------------------------------------------------------------------ -;int ff_sad_x2_(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t stride, int h); +;int ff_sad_x2_(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); ;------------------------------------------------------------------------------------------ ;%1 = 8/16 %macro SAD_X2 1 @@ -598,7 +598,7 @@ SAD_X2 16 ;------------------------------------------------------------------------------------------ -;int ff_sad_y2_(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t stride, int h); +;int ff_sad_y2_(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); ;------------------------------------------------------------------------------------------ ;%1 = 8/16 %macro SAD_Y2 1 @@ -668,7 +668,7 @@ SAD_Y2 16 ;------------------------------------------------------------------------------------------- -;int ff_sad_approx_xy2_(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, ptrdiff_t stride, int h); +;int ff_sad_approx_xy2_(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); ;------------------------------------------------------------------------------------------- ;%1 = 8/16 %macro SAD_APPROX_XY2 1 @@ -769,7 +769,7 @@ SAD_APPROX_XY2 16 ;-------------------------------------------------------------------- -;int ff_vsad_intra(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +;int ff_vsad_intra(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ; ptrdiff_t line_size, int h); ;-------------------------------------------------------------------- ; %1 = 8/16 @@ -830,7 +830,7 @@ VSAD_INTRA 16 ;--------------------------------------------------------------------- -;int ff_vsad_approx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +;int ff_vsad_approx(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ; ptrdiff_t line_size, int h); ;--------------------------------------------------------------------- ; %1 = 8/16 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/me_cmp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,65 +30,65 @@ #include "libavcodec/me_cmp.h" #include "libavcodec/mpegvideo.h" -int ff_sum_abs_dctelem_sse2(int16_t *block); -int ff_sum_abs_dctelem_ssse3(int16_t *block); -int ff_sse8_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sum_abs_dctelem_sse2(const int16_t *block); +int ff_sum_abs_dctelem_ssse3(const int16_t *block); +int ff_sse8_mmx(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sse16_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sse16_mmx(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sse16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sse16_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_hf_noise8_mmx(uint8_t *pix1, ptrdiff_t stride, int h); -int ff_hf_noise16_mmx(uint8_t *pix1, ptrdiff_t stride, int h); -int ff_sad8_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_hf_noise8_mmx(const uint8_t *pix1, ptrdiff_t stride, int h); +int ff_hf_noise16_mmx(const uint8_t *pix1, ptrdiff_t stride, int h); +int ff_sad8_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad8_x2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad8_x2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_x2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_x2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_x2_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_x2_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad8_y2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad8_y2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_y2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_y2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_y2_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_y2_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad8_approx_xy2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad8_approx_xy2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_approx_xy2_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_approx_xy2_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_sad16_approx_xy2_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_sad16_approx_xy2_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad_intra8_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad_intra8_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad_intra16_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad_intra16_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad_intra16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad_intra16_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad8_approx_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad8_approx_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad16_approx_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad16_approx_mmxext(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); -int ff_vsad16_approx_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +int ff_vsad16_approx_sse2(MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h); #define hadamard_func(cpu) \ - int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1, \ - uint8_t *src2, ptrdiff_t stride, int h); \ - int ff_hadamard8_diff16_ ## cpu(MpegEncContext *s, uint8_t *src1, \ - uint8_t *src2, ptrdiff_t stride, int h); + int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, const uint8_t *src1, \ + const uint8_t *src2, ptrdiff_t stride, int h); \ + int ff_hadamard8_diff16_ ## cpu(MpegEncContext *s, const uint8_t *src1, \ + const uint8_t *src2, ptrdiff_t stride, int h); hadamard_func(mmxext) hadamard_func(sse2) hadamard_func(ssse3) #if HAVE_X86ASM -static int nsse16_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2, +static int nsse16_mmx(MpegEncContext *c, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int score1, score2; @@ -106,7 +106,7 @@ return score1 + FFABS(score2) * 8; } -static int nsse8_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2, +static int nsse8_mmx(MpegEncContext *c, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t stride, int h) { int score1 = ff_sse8_mmx(c, pix1, pix2, stride, h); @@ -129,7 +129,7 @@ 0x0002000200020002ULL, }; -static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, +static inline void sad8_4_mmx(const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h) { x86_reg len = -stride * h; @@ -199,22 +199,21 @@ } #define PIX_SADXY(suf) \ -static int sad8_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ - uint8_t *blk1, ptrdiff_t stride, int h) \ +static int sad8_xy2_ ## suf(MpegEncContext *v, const uint8_t *blk2, \ + const uint8_t *blk1, ptrdiff_t stride, int h) \ { \ - av_assert2(h == 8); \ __asm__ volatile ( \ "pxor %%mm7, %%mm7 \n\t" \ "pxor %%mm6, %%mm6 \n\t" \ ::); \ \ - sad8_4_ ## suf(blk1, blk2, stride, 8); \ + sad8_4_ ## suf(blk1, blk2, stride, h); \ \ return sum_ ## suf(); \ } \ \ -static int sad16_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ - uint8_t *blk1, ptrdiff_t stride, int h) \ +static int sad16_xy2_ ## suf(MpegEncContext *v, const uint8_t *blk2, \ + const uint8_t *blk1, ptrdiff_t stride, int h) \ { \ __asm__ volatile ( \ "pxor %%mm7, %%mm7 \n\t" \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpeg4videodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpeg4videodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpeg4videodsp.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpeg4videodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/x86/cpu.h" +#include "libavcodec/mpeg4videodsp.h" +#include "libavcodec/videodsp.h" + +#if HAVE_INLINE_ASM + +static void gmc_mmx(uint8_t *dst, const uint8_t *src, + int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, + int shift, int r, int width, int height) +{ + const int w = 8; + const int ix = ox >> (16 + shift); + const int iy = oy >> (16 + shift); + const int oxs = ox >> 4; + const int oys = oy >> 4; + const int dxxs = dxx >> 4; + const int dxys = dxy >> 4; + const int dyxs = dyx >> 4; + const int dyys = dyy >> 4; + const uint16_t r4[4] = { r, r, r, r }; + const uint16_t dxy4[4] = { dxys, dxys, dxys, dxys }; + const uint16_t dyy4[4] = { dyys, dyys, dyys, dyys }; + const uint64_t shift2 = 2 * shift; +#define MAX_STRIDE 4096U +#define MAX_H 8U + uint8_t edge_buf[(MAX_H + 1) * MAX_STRIDE]; + int x, y; + + const int dxw = (dxx - (1 << (16 + shift))) * (w - 1); + const int dyh = (dyy - (1 << (16 + shift))) * (h - 1); + const int dxh = dxy * (h - 1); + const int dyw = dyx * (w - 1); + int need_emu = (unsigned) ix >= width - w || width < w || + (unsigned) iy >= height - h || height< h + ; + + if ( // non-constant fullpel offset (3% of blocks) + ((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) | + (oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift) || + // uses more than 16 bits of subpel mv (only at huge resolution) + (dxx | dxy | dyx | dyy) & 15 || + (need_emu && (h > MAX_H || stride > MAX_STRIDE))) { + // FIXME could still use mmx for some of the rows + ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, + shift, r, width, height); + return; + } + + src += ix + iy * stride; + if (need_emu) { + ff_emulated_edge_mc_8(edge_buf, src, stride, stride, w + 1, h + 1, ix, iy, width, height); + src = edge_buf; + } + + __asm__ volatile ( + "movd %0, %%mm6 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "punpcklwd %%mm6, %%mm6 \n\t" + "punpcklwd %%mm6, %%mm6 \n\t" + :: "r" (1 << shift)); + + for (x = 0; x < w; x += 4) { + uint16_t dx4[4] = { oxs - dxys + dxxs * (x + 0), + oxs - dxys + dxxs * (x + 1), + oxs - dxys + dxxs * (x + 2), + oxs - dxys + dxxs * (x + 3) }; + uint16_t dy4[4] = { oys - dyys + dyxs * (x + 0), + oys - dyys + dyxs * (x + 1), + oys - dyys + dyxs * (x + 2), + oys - dyys + dyxs * (x + 3) }; + + for (y = 0; y < h; y++) { + __asm__ volatile ( + "movq %0, %%mm4 \n\t" + "movq %1, %%mm5 \n\t" + "paddw %2, %%mm4 \n\t" + "paddw %3, %%mm5 \n\t" + "movq %%mm4, %0 \n\t" + "movq %%mm5, %1 \n\t" + "psrlw $12, %%mm4 \n\t" + "psrlw $12, %%mm5 \n\t" + : "+m" (*dx4), "+m" (*dy4) + : "m" (*dxy4), "m" (*dyy4)); + + __asm__ volatile ( + "movq %%mm6, %%mm2 \n\t" + "movq %%mm6, %%mm1 \n\t" + "psubw %%mm4, %%mm2 \n\t" + "psubw %%mm5, %%mm1 \n\t" + "movq %%mm2, %%mm0 \n\t" + "movq %%mm4, %%mm3 \n\t" + "pmullw %%mm1, %%mm0 \n\t" // (s - dx) * (s - dy) + "pmullw %%mm5, %%mm3 \n\t" // dx * dy + "pmullw %%mm5, %%mm2 \n\t" // (s - dx) * dy + "pmullw %%mm4, %%mm1 \n\t" // dx * (s - dy) + + "movd %4, %%mm5 \n\t" + "movd %3, %%mm4 \n\t" + "punpcklbw %%mm7, %%mm5 \n\t" + "punpcklbw %%mm7, %%mm4 \n\t" + "pmullw %%mm5, %%mm3 \n\t" // src[1, 1] * dx * dy + "pmullw %%mm4, %%mm2 \n\t" // src[0, 1] * (s - dx) * dy + + "movd %2, %%mm5 \n\t" + "movd %1, %%mm4 \n\t" + "punpcklbw %%mm7, %%mm5 \n\t" + "punpcklbw %%mm7, %%mm4 \n\t" + "pmullw %%mm5, %%mm1 \n\t" // src[1, 0] * dx * (s - dy) + "pmullw %%mm4, %%mm0 \n\t" // src[0, 0] * (s - dx) * (s - dy) + "paddw %5, %%mm1 \n\t" + "paddw %%mm3, %%mm2 \n\t" + "paddw %%mm1, %%mm0 \n\t" + "paddw %%mm2, %%mm0 \n\t" + + "psrlw %6, %%mm0 \n\t" + "packuswb %%mm0, %%mm0 \n\t" + "movd %%mm0, %0 \n\t" + + : "=m" (dst[x + y * stride]) + : "m" (src[0]), "m" (src[1]), + "m" (src[stride]), "m" (src[stride + 1]), + "m" (*r4), "m" (shift2)); + src += stride; + } + src += 4 - h * stride; + } +} + +#endif /* HAVE_INLINE_ASM */ + +av_cold void ff_mpeg4videodsp_init_x86(Mpeg4VideoDSPContext *c) +{ +#if HAVE_INLINE_ASM + int cpu_flags = av_get_cpu_flags(); + + if (INLINE_MMX(cpu_flags)) + c->gmc = gmc_mmx; +#endif /* HAVE_INLINE_ASM */ +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideodsp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "libavutil/attributes.h" -#include "libavutil/cpu.h" -#include "libavutil/x86/cpu.h" -#include "libavcodec/mpegvideodsp.h" -#include "libavcodec/videodsp.h" - -#if HAVE_INLINE_ASM - -static void gmc_mmx(uint8_t *dst, uint8_t *src, - int stride, int h, int ox, int oy, - int dxx, int dxy, int dyx, int dyy, - int shift, int r, int width, int height) -{ - const int w = 8; - const int ix = ox >> (16 + shift); - const int iy = oy >> (16 + shift); - const int oxs = ox >> 4; - const int oys = oy >> 4; - const int dxxs = dxx >> 4; - const int dxys = dxy >> 4; - const int dyxs = dyx >> 4; - const int dyys = dyy >> 4; - const uint16_t r4[4] = { r, r, r, r }; - const uint16_t dxy4[4] = { dxys, dxys, dxys, dxys }; - const uint16_t dyy4[4] = { dyys, dyys, dyys, dyys }; - const uint64_t shift2 = 2 * shift; -#define MAX_STRIDE 4096U -#define MAX_H 8U - uint8_t edge_buf[(MAX_H + 1) * MAX_STRIDE]; - int x, y; - - const int dxw = (dxx - (1 << (16 + shift))) * (w - 1); - const int dyh = (dyy - (1 << (16 + shift))) * (h - 1); - const int dxh = dxy * (h - 1); - const int dyw = dyx * (w - 1); - int need_emu = (unsigned) ix >= width - w || width < w || - (unsigned) iy >= height - h || height< h - ; - - if ( // non-constant fullpel offset (3% of blocks) - ((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) | - (oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift) || - // uses more than 16 bits of subpel mv (only at huge resolution) - (dxx | dxy | dyx | dyy) & 15 || - (need_emu && (h > MAX_H || stride > MAX_STRIDE))) { - // FIXME could still use mmx for some of the rows - ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, - shift, r, width, height); - return; - } - - src += ix + iy * stride; - if (need_emu) { - ff_emulated_edge_mc_8(edge_buf, src, stride, stride, w + 1, h + 1, ix, iy, width, height); - src = edge_buf; - } - - __asm__ volatile ( - "movd %0, %%mm6 \n\t" - "pxor %%mm7, %%mm7 \n\t" - "punpcklwd %%mm6, %%mm6 \n\t" - "punpcklwd %%mm6, %%mm6 \n\t" - :: "r" (1 << shift)); - - for (x = 0; x < w; x += 4) { - uint16_t dx4[4] = { oxs - dxys + dxxs * (x + 0), - oxs - dxys + dxxs * (x + 1), - oxs - dxys + dxxs * (x + 2), - oxs - dxys + dxxs * (x + 3) }; - uint16_t dy4[4] = { oys - dyys + dyxs * (x + 0), - oys - dyys + dyxs * (x + 1), - oys - dyys + dyxs * (x + 2), - oys - dyys + dyxs * (x + 3) }; - - for (y = 0; y < h; y++) { - __asm__ volatile ( - "movq %0, %%mm4 \n\t" - "movq %1, %%mm5 \n\t" - "paddw %2, %%mm4 \n\t" - "paddw %3, %%mm5 \n\t" - "movq %%mm4, %0 \n\t" - "movq %%mm5, %1 \n\t" - "psrlw $12, %%mm4 \n\t" - "psrlw $12, %%mm5 \n\t" - : "+m" (*dx4), "+m" (*dy4) - : "m" (*dxy4), "m" (*dyy4)); - - __asm__ volatile ( - "movq %%mm6, %%mm2 \n\t" - "movq %%mm6, %%mm1 \n\t" - "psubw %%mm4, %%mm2 \n\t" - "psubw %%mm5, %%mm1 \n\t" - "movq %%mm2, %%mm0 \n\t" - "movq %%mm4, %%mm3 \n\t" - "pmullw %%mm1, %%mm0 \n\t" // (s - dx) * (s - dy) - "pmullw %%mm5, %%mm3 \n\t" // dx * dy - "pmullw %%mm5, %%mm2 \n\t" // (s - dx) * dy - "pmullw %%mm4, %%mm1 \n\t" // dx * (s - dy) - - "movd %4, %%mm5 \n\t" - "movd %3, %%mm4 \n\t" - "punpcklbw %%mm7, %%mm5 \n\t" - "punpcklbw %%mm7, %%mm4 \n\t" - "pmullw %%mm5, %%mm3 \n\t" // src[1, 1] * dx * dy - "pmullw %%mm4, %%mm2 \n\t" // src[0, 1] * (s - dx) * dy - - "movd %2, %%mm5 \n\t" - "movd %1, %%mm4 \n\t" - "punpcklbw %%mm7, %%mm5 \n\t" - "punpcklbw %%mm7, %%mm4 \n\t" - "pmullw %%mm5, %%mm1 \n\t" // src[1, 0] * dx * (s - dy) - "pmullw %%mm4, %%mm0 \n\t" // src[0, 0] * (s - dx) * (s - dy) - "paddw %5, %%mm1 \n\t" - "paddw %%mm3, %%mm2 \n\t" - "paddw %%mm1, %%mm0 \n\t" - "paddw %%mm2, %%mm0 \n\t" - - "psrlw %6, %%mm0 \n\t" - "packuswb %%mm0, %%mm0 \n\t" - "movd %%mm0, %0 \n\t" - - : "=m" (dst[x + y * stride]) - : "m" (src[0]), "m" (src[1]), - "m" (src[stride]), "m" (src[stride + 1]), - "m" (*r4), "m" (shift2)); - src += stride; - } - src += 4 - h * stride; - } -} - -#endif /* HAVE_INLINE_ASM */ - -av_cold void ff_mpegvideodsp_init_x86(MpegVideoDSPContext *c) -{ -#if HAVE_INLINE_ASM - int cpu_flags = av_get_cpu_flags(); - - if (INLINE_MMX(cpu_flags)) - c->gmc = gmc_mmx; -#endif /* HAVE_INLINE_ASM */ -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ %include "libavutil/x86/x86util.asm" SECTION .text -; int ff_pix_sum16(uint8_t *pix, int line_size) +; int ff_pix_sum16(const uint8_t *pix, int line_size) ; %1 = number of loops ; %2 = number of GPRs used %macro PIX_SUM16 3 @@ -72,7 +72,7 @@ PIX_SUM16 4, 4, 4 %endif -; int ff_pix_norm1(uint8_t *pix, int line_size) +; int ff_pix_norm1(const uint8_t *pix, int line_size) ; %1 = number of xmm registers used ; %2 = number of loops %macro PIX_NORM1 2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoencdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,9 +23,9 @@ #include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" -int ff_pix_sum16_sse2(uint8_t *pix, int line_size); -int ff_pix_sum16_xop(uint8_t *pix, int line_size); -int ff_pix_norm1_sse2(uint8_t *pix, int line_size); +int ff_pix_sum16_sse2(const uint8_t *pix, int line_size); +int ff_pix_sum16_xop(const uint8_t *pix, int line_size); +int ff_pix_norm1_sse2(const uint8_t *pix, int line_size); #if HAVE_INLINE_ASM diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoenc_qns_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoenc_qns_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoenc_qns_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/mpegvideoenc_qns_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #define MAX_ABS (512 >> (SCALE_OFFSET>0 ? SCALE_OFFSET : 0)) -static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale) +static int DEF(try_8x8basis)(const int16_t rem[64], const int16_t weight[64], const int16_t basis[64], int scale) { x86_reg i=0; @@ -74,7 +74,7 @@ return i; } -static void DEF(add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale) +static void DEF(add_8x8basis)(int16_t rem[64], const int16_t basis[64], int scale) { x86_reg i=0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -29,9 +29,8 @@ SECTION .text -; %1 = nr. of xmm registers used -%macro ADD_BYTES_FN 1 -cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i +INIT_XMM sse2 +cglobal add_bytes_l2, 4, 6, 2, dst, src1, src2, wa, w, i %if ARCH_X86_64 movsxd waq, wad %endif @@ -53,7 +52,6 @@ cmp iq, waq jl .loop_v -%if mmsize == 16 ; vector loop mov waq, wq and waq, ~7 @@ -66,7 +64,6 @@ .end_l: cmp iq, waq jl .loop_l -%endif ; scalar loop for leftover jmp .end_s @@ -78,16 +75,7 @@ .end_s: cmp iq, wq jl .loop_s - REP_RET -%endmacro - -%if ARCH_X86_32 -INIT_MMX mmx -ADD_BYTES_FN 0 -%endif - -INIT_XMM sse2 -ADD_BYTES_FN 2 + RET %macro ADD_PAETH_PRED_FN 1 cglobal add_png_paeth_prediction, 5, 7, %1, dst, src, top, w, bpp, end, cntr diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/pngdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,6 @@ */ #include -#include "config.h" #include "libavutil/attributes.h" #include "libavutil/x86/cpu.h" #include "libavcodec/pngdsp.h" @@ -29,8 +28,6 @@ uint8_t *top, int w, int bpp); void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp); -void ff_add_bytes_l2_mmx (uint8_t *dst, uint8_t *src1, - uint8_t *src2, int w); void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w); @@ -38,10 +35,6 @@ { int cpu_flags = av_get_cpu_flags(); -#if ARCH_X86_32 - if (EXTERNAL_MMX(cpu_flags)) - dsp->add_bytes_l2 = ff_add_bytes_l2_mmx; -#endif if (EXTERNAL_MMXEXT(cpu_flags)) dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmxext; if (EXTERNAL_SSE2(cpu_flags)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpel.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpel.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpel.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpel.asm 2023-03-03 13:29:59.000000000 +0000 @@ -81,7 +81,7 @@ add r2, 16 sub r5d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -125,7 +125,7 @@ add r2, 32 sub r5d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -171,7 +171,7 @@ add r2, 32 sub r5d, 2 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpeldsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpeldsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpeldsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/qpeldsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -92,7 +92,7 @@ add r2, 32 sub r5d, 4 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -161,7 +161,7 @@ add r2, 32 sub r5d, 2 jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -274,7 +274,7 @@ add r0, r2 dec r4d jne .loop - REP_RET + RET %endmacro %macro PUT_OP 2-3 @@ -357,7 +357,7 @@ add r0, r2 dec r4d jne .loop - REP_RET + RET %endmacro INIT_MMX mmxext @@ -466,7 +466,7 @@ add r0, r1 dec r4d jne .loopv - REP_RET + RET %endmacro %macro PUT_OPH 2-3 @@ -543,7 +543,7 @@ add r0, r1 dec r4d jne .loopv - REP_RET + RET %endmacro INIT_MMX mmxext diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv34dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv34dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv34dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv34dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -54,7 +54,7 @@ movq [r0+ 8], m0 movq [r0+16], m0 movq [r0+24], m0 - REP_RET + RET ; Load coeffs and perform row transform ; Output: coeffs in mm[0467], rounder in mm5 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -170,7 +170,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %endmacro %macro FILTER_H 1 @@ -227,7 +227,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -280,7 +280,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET cglobal %1_rv40_qpel_h, 6,6+npicregs,8, dst, dststride, src, srcstride, height, mx, picreg %ifdef PIC @@ -313,7 +313,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %endmacro INIT_XMM ssse3 @@ -464,7 +464,7 @@ .loop: MAIN_LOOP %2, RND jnz .loop - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/rv40dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -40,14 +40,14 @@ } #if HAVE_X86ASM -void ff_put_rv40_chroma_mc8_mmx (uint8_t *dst, uint8_t *src, +void ff_put_rv40_chroma_mc8_mmx (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_rv40_chroma_mc8_mmxext(uint8_t *dst, uint8_t *src, +void ff_avg_rv40_chroma_mc8_mmxext(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_rv40_chroma_mc4_mmx (uint8_t *dst, uint8_t *src, +void ff_put_rv40_chroma_mc4_mmx (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_rv40_chroma_mc4_mmxext(uint8_t *dst, uint8_t *src, +void ff_avg_rv40_chroma_mc4_mmxext(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); #define DECLARE_WEIGHT(opt) \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/sbrdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/sbrdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/sbrdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/sbrdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -208,7 +208,7 @@ add zq, 32 cmp zq, r1q jne .loop - REP_RET + RET INIT_XMM sse cglobal sbr_qmf_post_shuffle, 2,3,4,W,z @@ -227,7 +227,7 @@ add zq, 16 cmp zq, r2q jl .loop - REP_RET + RET INIT_XMM sse cglobal sbr_neg_odd_64, 1,2,4,z @@ -248,7 +248,7 @@ add zq, 64 cmp zq, r1q jne .loop - REP_RET + RET ; void ff_sbr_qmf_deint_bfly_sse2(float *v, const float *src0, const float *src1) INIT_XMM sse2 @@ -276,7 +276,7 @@ add vrevq, 2*mmsize sub cq, 2*mmsize jge .loop - REP_RET + RET INIT_XMM sse2 cglobal sbr_qmf_pre_shuffle, 1,4,6,z @@ -306,7 +306,7 @@ jge .loop movq m2, [zq] movq [r2q], m2 - REP_RET + RET %ifdef PIC %define NREGS 1 @@ -432,7 +432,7 @@ sub vq, mmsize add cq, mmsize jl .loop - REP_RET + RET %macro SBR_AUTOCORRELATE 0 cglobal sbr_autocorrelate, 2,3,8,32, x, phi, cnt diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/simple_idct.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/simple_idct.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/simple_idct.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/simple_idct.asm 2023-03-03 13:29:59.000000000 +0000 @@ -25,9 +25,9 @@ %include "libavutil/x86/x86util.asm" -%if ARCH_X86_32 SECTION_RODATA +%if ARCH_X86_32 cextern pb_80 wm1010: dw 0, 0xffff, 0, 0xffff diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/svq1enc_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/svq1enc_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/svq1enc_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/svq1enc_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,12 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" -#include "libavcodec/svq1enc.h" +#include "libavcodec/svq1encdsp.h" int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2, intptr_t size); -av_cold void ff_svq1enc_init_x86(SVQ1EncContext *c) +av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c) { int cpu_flags = av_get_cpu_flags(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/synth_filter_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/synth_filter_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/synth_filter_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/synth_filter_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,14 +27,15 @@ void ff_synth_filter_inner_##opt(float *synth_buf_ptr, float synth_buf2[32], \ const float window[512], \ float out[32], intptr_t offset, float scale); \ -static void synth_filter_##opt(FFTContext *imdct, \ +static void synth_filter_##opt(AVTXContext *imdct, \ float *synth_buf_ptr, int *synth_buf_offset, \ float synth_buf2[32], const float window[512], \ - float out[32], const float in[32], float scale) \ + float out[32], float in[32], float scale, \ + av_tx_fn imdct_fn) \ { \ float *synth_buf= synth_buf_ptr + *synth_buf_offset; \ \ - imdct->imdct_half(imdct, synth_buf, in); \ + imdct_fn(imdct, synth_buf, in, sizeof(float)); \ \ ff_synth_filter_inner_##opt(synth_buf, synth_buf2, window, \ out, *synth_buf_offset, scale); \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/takdsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/takdsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/takdsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/takdsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -43,7 +43,7 @@ mova [p2q+lengthq+mmsize*1], m1 add lengthq, mmsize*2 jl .loop - REP_RET + RET cglobal tak_decorrelate_sr, 3, 3, 2, p1, p2, length shl lengthd, 2 @@ -60,7 +60,7 @@ mova [p1q+lengthq+mmsize*1], m1 add lengthq, mmsize*2 jl .loop - REP_RET + RET cglobal tak_decorrelate_sm, 3, 3, 6, p1, p2, length shl lengthd, 2 @@ -87,7 +87,7 @@ mova [p2q+lengthq+mmsize], m4 add lengthq, mmsize*2 jl .loop - REP_RET + RET INIT_XMM sse4 cglobal tak_decorrelate_sf, 3, 3, 5, p1, p2, length, dshift, dfactor @@ -113,4 +113,4 @@ mova [p1q+lengthq], m1 add lengthq, mmsize jl .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/utvideodsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/utvideodsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/utvideodsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/utvideodsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -69,7 +69,7 @@ add src_bq, linesize_bq sub hd, 1 jg .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 @@ -125,7 +125,7 @@ add src_bq, linesize_bq sub hd, 1 jg .nextrow - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210.asm 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,21 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA 32 +SECTION_RODATA 64 + +perm_y: + db 0,1, 4,5, 6,7, 8,9, 12,13, 14,15, 16,17, 20,21 + db 22,23, 24,25, 28,29, 30,31, 32,33, 36,37, 38,39, 40,41 + db 44,45, 46,47, 48,49, 52,53, 54,55, 56,57, 60,61, 62,63 +times 16 db 0xff ; align to 64 + +perm_uv: + db 0,1, 4,5, 10,11, 16,17, 20,21, 26,27, 32,33, 36,37 + db 42,43, 48,49, 52,53, 58,59 +times 8 db 0xff ; align to 32 + db 2,3, 8,9, 12,13, 18,19, 24,25, 28,29, 34,35, 40,41 + db 44,45, 50,51, 56,57, 60,61 +times 8 db 0xff ; align to 32 ; for AVX2 version only v210_luma_permute: dd 0,1,2,4,5,6,7,7 ; 32-byte alignment required @@ -34,6 +48,9 @@ v210_luma_shuf: db 8,9,0,1,2,3,12,13,4,5,6,7,-1,-1,-1,-1 v210_chroma_shuf: db 0,1,8,9,6,7,-1,-1,2,3,4,5,12,13,-1,-1 +shift: times 4 dw 6, 2 +kmask: dw 0x5555, 0xaaaa + SECTION .text %macro v210_planar_unpack 1 @@ -65,18 +82,18 @@ mova m0, [srcq] %endif - pmullw m1, m0, m3 - pslld m0, 12 - psrlw m1, 6 ; yB yA u5 v4 y8 y7 v3 u3 y5 y4 u2 v1 y2 y1 v0 u0 - psrld m0, 22 ; 00 v5 00 y9 00 u4 00 y6 00 v2 00 y3 00 u1 00 y0 + pmullw m1, m0, m3 ; shifts the 1st and 3rd sample of each dword into the high 10 bits of each word + pslld m0, 12 ; shifts the 2nd sample of each dword into the high 10 bits of each dword + psrlw m1, 6 ; shifts the 1st and 3rd samples back into the low 10 bits + psrld m0, 22 ; shifts the 2nd sample back into the low 10 bits of each dword %if cpuflag(avx2) - vpblendd m2, m1, m0, 0x55 ; yB yA 00 y9 y8 y7 00 y6 y5 y4 00 y3 y2 y1 00 y0 + vpblendd m2, m1, m0, 0x55 ; merge the odd dwords from m0 and even from m1 ; yB yA 00 y9 y8 y7 00 y6 y5 y4 00 y3 y2 y1 00 y0 pshufb m2, m4 ; 00 00 yB yA y9 y8 y7 y6 00 00 y5 y4 y3 y2 y1 y0 vpermd m2, m6, m2 ; 00 00 00 00 yB yA y9 y8 y7 y6 y5 y4 y3 y2 y1 y0 movu [yq+2*wq], m2 - vpblendd m1, m1, m0, 0xaa ; 00 v5 u5 v4 00 u4 v3 u3 00 v2 u2 v1 00 u1 v0 u0 + vpblendd m1, m1, m0, 0xaa ; merge the even dwords from m0 and odd from m1 ; 00 v5 u5 v4 00 u4 v3 u3 00 v2 u2 v1 00 u1 v0 u0 pshufb m1, m5 ; 00 v5 v4 v3 00 u5 u4 u3 00 v2 v1 v0 00 u2 u1 u0 vpermq m1, m1, 0xd8 ; 00 v5 v4 v3 00 v2 v1 v0 00 u5 u4 u3 00 u2 u1 u0 pshufb m1, m7 ; 00 00 v5 v4 v3 v2 v1 v0 00 00 u5 u4 u3 u2 u1 u0 @@ -99,7 +116,7 @@ add wq, (mmsize*3)/8 jl .loop - REP_RET + RET %endmacro INIT_XMM ssse3 @@ -127,3 +144,44 @@ INIT_YMM avx2 v210_planar_unpack aligned %endif + +%if HAVE_AVX512ICL_EXTERNAL + +INIT_ZMM avx512icl + +cglobal v210_planar_unpack, 5, 5, 6, src, y, u, v, w + movsxdifnidn wq, wd + lea yq, [yq+2*wq] + add uq, wq + add vq, wq + neg wq + + kmovw k1, [kmask] ; odd dword mask + kmovw k2, [kmask+2] ; even dword mask + + VBROADCASTI128 m0, [shift] + mova m1, [perm_y] + mova m2, [perm_uv] + + .loop: + movu m3, [srcq] + vpsllvw m4, m3, m0 + pslld m5, m3, 12 + psrlw m4, 6 + psrld m5, 22 + + vpblendmd m3{k1}, m4, m5 + vpermb m3, m1, m3 ; could use vpcompressw + movu [yq+2*wq], m3 + + vpblendmd m5{k2}, m4, m5 + vpermb m5, m2, m5 + movu [uq+wq], ym5 + vextracti32x8 [vq+wq], zm5, 1 + + add srcq, mmsize + add wq, (mmsize*3)/8 + jl .loop +RET + +%endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc.asm 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA 32 +SECTION_RODATA 64 cextern pw_4 %define v210_enc_min_10 pw_4 @@ -46,13 +46,53 @@ v210_enc_chroma_mult_8: times 2 dw 4,16,64,0,64,4,16,0 +v210enc_8_permb: db 32, 0,48,-1 , 1,33, 2,-1 , 49, 3,34,-1 , 4,50, 5,-1 + db 35, 6,51,-1 , 7,36, 8,-1 , 52, 9,37,-1 , 10,53,11,-1 + db 38,12,54,-1 , 13,39,14,-1 , 55,15,40,-1 , 16,56,17,-1 + db 41,18,57,-1 , 19,42,20,-1 , 58,21,43,-1 , 22,59,23,-1 +v210enc_8_shufb: db 0, 8, 1,-1 , 9, 2,10,-1 , 3,11, 4,-1 , 12, 5,13,-1 + db 2,10, 3,-1 , 11, 4,12,-1 , 5,13, 6,-1 , 14, 7,15,-1 +v210enc_8_permd: dd 0,1,4,5, 1,2,5,6 +v210enc_8_mult: db 4, 0, 64, 0 +v210enc_8_mask: dd 255<<12 + +icl_perm_y: ; vpermb does not set bytes to zero when the high bit is set unlike pshufb +%assign i 0 +%rep 8 + db -1,i+0,i+1,-1 , i+2,i+3,i+4,i+5 + %assign i i+6 +%endrep + +icl_perm_uv: ; vpermb does not set bytes to zero when the high bit is set unlike pshufb +%assign i 0 +%rep 4 + db i+0,i+1,i+32,i+33 , -1,i+2,i+3,-1 , i+34,i+35,i+4,i+5 , -1,i+36,i+37,-1 + %assign i i+6 +%endrep + +icl_perm_y_kmask: times 8 db 1111_0110b +icl_perm_uv_kmask: times 8 db 0110_1111b + +icl_shift_y: times 10 dw 2,0,4 + times 4 db 0 ; padding to 64 bytes +icl_shift_uv: times 5 dw 0,2,4 + times 2 db 0 ; padding to 32 bytes + times 5 dw 4,0,2 + times 2 db 0 ; padding to 32 bytes + +v210enc_10_permd_y: dd 0,1,2,-1 , 3,4,5,-1 +v210enc_10_shufb_y: db -1,0,1,-1 , 2,3,4,5 , -1,6,7,-1 , 8,9,10,11 +v210enc_10_permd_uv: dd 0,1,4,5 , 1,2,5,6 +v210enc_10_shufb_uv: db 0,1, 8, 9 , -1,2,3,-1 , 10,11,4,5 , -1,12,13,-1 + db 2,3,10,11 , -1,4,5,-1 , 12,13,6,7 , -1,14,15,-1 + SECTION .text %macro v210_planar_pack_10 0 ; v210_planar_pack_10(const uint16_t *y, const uint16_t *u, const uint16_t *v, uint8_t *dst, ptrdiff_t width) cglobal v210_planar_pack_10, 5, 5, 4+cpuflag(avx2), y, u, v, dst, width - lea r0, [yq+2*widthq] + lea yq, [yq+2*widthq] add uq, widthq add vq, widthq neg widthq @@ -103,6 +143,75 @@ v210_planar_pack_10 %endif +%macro v210_planar_pack_10_new 0 + +cglobal v210_planar_pack_10, 5, 5, 8+2*notcpuflag(avx512icl), y, u, v, dst, width + lea yq, [yq+2*widthq] + add uq, widthq + add vq, widthq + neg widthq + + %if cpuflag(avx512icl) + movu m6, [icl_perm_y] + movu m7, [icl_perm_uv] + kmovq k1, [icl_perm_y_kmask] + kmovq k2, [icl_perm_uv_kmask] + %else + movu m6, [v210enc_10_permd_y] + VBROADCASTI128 m7, [v210enc_10_shufb_y] + movu m8, [v210enc_10_permd_uv] + movu m9, [v210enc_10_shufb_uv] + %endif + movu m2, [icl_shift_y] + movu m3, [icl_shift_uv] + VBROADCASTI128 m4, [v210_enc_min_10] ; only ymm sized + VBROADCASTI128 m5, [v210_enc_max_10] ; only ymm sized + + .loop: + movu m0, [yq + widthq*2] + %if cpuflag(avx512icl) + movu ym1, [uq + widthq*1] + vinserti32x8 zm1, [vq + widthq*1], 1 + %else + movu xm1, [uq + widthq*1] + vinserti128 ym1, [vq + widthq*1], 1 + %endif + CLIPW m0, m4, m5 + CLIPW m1, m4, m5 + + vpsllvw m0, m2 + vpsllvw m1, m3 + %if cpuflag(avx512icl) + vpermb m0{k1}{z}, m6, m0 ; make space for uv where the k-mask sets to zero + vpermb m1{k2}{z}, m7, m1 ; interleave uv and make space for y where the k-mask sets to zero + %else + vpermd m0, m6, m0 + pshufb m0, m7 + vpermd m1, m8, m1 + pshufb m1, m9 + %endif + por m0, m1 + + movu [dstq], m0 + add dstq, mmsize + add widthq, (mmsize*3)/8 + jl .loop +RET + +%endmacro + +%if ARCH_X86_64 +%if HAVE_AVX512_EXTERNAL +INIT_YMM avx512 +v210_planar_pack_10_new +%endif +%endif + +%if HAVE_AVX512ICL_EXTERNAL +INIT_ZMM avx512icl +v210_planar_pack_10_new +%endif + %macro v210_planar_pack_8 0 ; v210_planar_pack_8(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, ptrdiff_t width) @@ -178,7 +287,72 @@ v210_planar_pack_8 %endif +%macro v210_planar_pack_8_new 0 + +cglobal v210_planar_pack_8, 5, 5, 7+notcpuflag(avx512icl), y, u, v, dst, width + add yq, widthq + shr widthq, 1 + add uq, widthq + add vq, widthq + neg widthq + + %if cpuflag(avx512icl) + mova m2, [v210enc_8_permb] + %else + mova m2, [v210enc_8_permd] + %endif + vpbroadcastd m3, [v210enc_8_mult] + VBROADCASTI128 m4, [v210_enc_min_8] ; only ymm sized + VBROADCASTI128 m5, [v210_enc_max_8] ; only ymm sized + vpbroadcastd m6, [v210enc_8_mask] + %if notcpuflag(avx512icl) + movu m7, [v210enc_8_shufb] + %endif + + .loop: + %if cpuflag(avx512icl) + movu ym1, [yq + 2*widthq] + vinserti32x4 m1, [uq + 1*widthq], 2 + vinserti32x4 m1, [vq + 1*widthq], 3 + vpermb m1, m2, m1 ; uyvx yuyx vyux yvyx + %else + movq xm0, [uq + 1*widthq] ; uuuu uuxx + movq xm1, [vq + 1*widthq] ; vvvv vvxx + punpcklbw xm1, xm0, xm1 ; uvuv uvuv uvuv xxxx + vinserti128 m1, m1, [yq + 2*widthq], 1 ; uvuv uvuv uvuv xxxx yyyy yyyy yyyy xxxx + vpermd m1, m2, m1 ; uvuv uvxx yyyy yyxx xxuv uvuv xxyy yyyy + pshufb m1, m7 ; uyv0 yuy0 vyu0 yvy0 + %endif + CLIPUB m1, m4, m5 + + pmaddubsw m0, m1, m3 ; shift high and low samples of each dword and mask out other bits + pslld m1, 4 ; shift center sample of each dword + %if cpuflag(avx512) + vpternlogd m0, m1, m6, 0xd8 ; C?B:A ; merge and mask out bad bits from B + %else + pand m1, m6, m1 + por m0, m0, m1 + %endif + + movu [dstq], m0 + add dstq, mmsize + add widthq, (mmsize*3)/16 + jl .loop +RET + +%endmacro + %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 -v210_planar_pack_8 +v210_planar_pack_8_new +%endif + +%if HAVE_AVX512_EXTERNAL +INIT_YMM avx512 +v210_planar_pack_8_new +%endif + +%if HAVE_AVX512ICL_EXTERNAL +INIT_ZMM avx512icl +v210_planar_pack_8_new %endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210enc_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,12 +27,22 @@ const uint8_t *v, uint8_t *dst, ptrdiff_t width); void ff_v210_planar_pack_8_avx2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, ptrdiff_t width); +void ff_v210_planar_pack_8_avx512(const uint8_t *y, const uint8_t *u, + const uint8_t *v, uint8_t *dst, ptrdiff_t width); +void ff_v210_planar_pack_8_avx512icl(const uint8_t *y, const uint8_t *u, + const uint8_t *v, uint8_t *dst, ptrdiff_t width); void ff_v210_planar_pack_10_ssse3(const uint16_t *y, const uint16_t *u, const uint16_t *v, uint8_t *dst, ptrdiff_t width); void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u, const uint16_t *v, uint8_t *dst, ptrdiff_t width); +void ff_v210_planar_pack_10_avx512(const uint16_t *y, const uint16_t *u, + const uint16_t *v, uint8_t *dst, + ptrdiff_t width); +void ff_v210_planar_pack_10_avx512icl(const uint16_t *y, const uint16_t *u, + const uint16_t *v, uint8_t *dst, + ptrdiff_t width); av_cold void ff_v210enc_init_x86(V210EncContext *s) { @@ -52,4 +62,20 @@ s->sample_factor_10 = 2; s->pack_line_10 = ff_v210_planar_pack_10_avx2; } + + if (EXTERNAL_AVX512(cpu_flags)) { + s->sample_factor_8 = 2; + s->pack_line_8 = ff_v210_planar_pack_8_avx512; +#if ARCH_X86_64 + s->sample_factor_10 = 2; + s->pack_line_10 = ff_v210_planar_pack_10_avx512; +#endif + } + + if (EXTERNAL_AVX512ICL(cpu_flags)) { + s->sample_factor_8 = 4; + s->pack_line_8 = ff_v210_planar_pack_8_avx512icl; + s->sample_factor_10 = 4; + s->pack_line_10 = ff_v210_planar_pack_10_avx512icl; + } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210-init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210-init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210-init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/v210-init.c 2023-03-03 13:29:59.000000000 +0000 @@ -17,7 +17,7 @@ */ #include "libavutil/attributes.h" -#include "libavutil/cpu.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/v210dec.h" extern void ff_v210_planar_unpack_unaligned_ssse3(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); @@ -28,6 +28,8 @@ extern void ff_v210_planar_unpack_aligned_avx(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); extern void ff_v210_planar_unpack_aligned_avx2(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); +extern void ff_v210_planar_unpack_avx512icl(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); + av_cold void ff_v210_x86_init(V210DecContext *s) { #if HAVE_X86ASM @@ -42,6 +44,9 @@ if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2) s->unpack_frame = ff_v210_planar_unpack_aligned_avx2; + + if (EXTERNAL_AVX512ICL(cpu_flags)) + s->unpack_frame = ff_v210_planar_unpack_avx512icl; } else { if (cpu_flags & AV_CPU_FLAG_SSSE3) @@ -52,6 +57,9 @@ if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2) s->unpack_frame = ff_v210_planar_unpack_unaligned_avx2; + + if (EXTERNAL_AVX512ICL(cpu_flags)) + s->unpack_frame = ff_v210_planar_unpack_avx512icl; } #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -80,13 +80,13 @@ #endif /* HAVE_X86ASM */ -void ff_put_vc1_chroma_mc8_nornd_mmx (uint8_t *dst, uint8_t *src, +void ff_put_vc1_chroma_mc8_nornd_mmx (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_nornd_mmxext(uint8_t *dst, uint8_t *src, +void ff_avg_vc1_chroma_mc8_nornd_mmxext(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, +void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, +void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y); void ff_vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_mc.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_mc.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_mc.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vc1dsp_mc.asm 2023-03-03 13:29:59.000000000 +0000 @@ -139,7 +139,7 @@ add dstq, 8 dec i jnz .loop - REP_RET + RET %undef rnd %undef shift %undef stride_neg2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -433,4 +433,4 @@ add bufq, strideq dec hd jg .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/videodsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -215,7 +215,7 @@ #endif /* HAVE_AVX2_EXTERNAL */ #endif /* HAVE_X86ASM */ -void ff_prefetch_mmxext(uint8_t *buf, ptrdiff_t stride, int h); +void ff_prefetch_mmxext(const uint8_t *buf, ptrdiff_t stride, int h); av_cold void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vorbisdsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vorbisdsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vorbisdsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vorbisdsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,7 +25,7 @@ #include "libavcodec/vorbisdsp.h" void ff_vorbis_inverse_coupling_sse(float *mag, float *ang, - intptr_t blocksize); + ptrdiff_t blocksize); av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp56_arith.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp56_arith.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp56_arith.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp56_arith.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/** - * VP5 and VP6 compatible video decoder (arith decoder) - * - * Copyright (C) 2006 Aurelien Jacobs - * Copyright (C) 2010 Eli Friedman - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_X86_VP56_ARITH_H -#define AVCODEC_X86_VP56_ARITH_H - -#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_6REGS -#include "libavutil/attributes.h" - -#define vp56_rac_get_prob vp56_rac_get_prob -static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) -{ - unsigned int code_word = vp56_rac_renorm(c); - unsigned int low = 1 + (((c->high - 1) * prob) >> 8); - unsigned int low_shift = low << 16; - int bit = 0; - c->code_word = code_word; - - __asm__( - "subl %4, %1 \n\t" - "subl %3, %2 \n\t" - "setae %b0 \n\t" - "cmovb %4, %1 \n\t" - "cmovb %5, %2 \n\t" - : "+q"(bit), "+&r"(c->high), "+&r"(c->code_word) - : "r"(low_shift), "r"(low), "r"(code_word) - ); - - return bit; -} -#endif - -#endif /* AVCODEC_X86_VP56_ARITH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -157,7 +157,7 @@ ; subpel MC functions: ; ; void ff_put_vp8_epel_hv_(uint8_t *dst, ptrdiff_t deststride, -; uint8_t *src, ptrdiff_t srcstride, +; const uint8_t *src, ptrdiff_t srcstride, ; int height, int mx, int my); ;------------------------------------------------------------------------------- @@ -200,7 +200,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET cglobal put_vp8_epel%1_h4, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg shl mxd, 4 @@ -230,7 +230,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my shl myd, 4 @@ -268,7 +268,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my lea myd, [myq*3] @@ -314,7 +314,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %endmacro INIT_MMX ssse3 @@ -368,7 +368,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET ; 4x4 block, H-only 6-tap filter INIT_MMX mmxext @@ -426,7 +426,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET INIT_XMM sse2 cglobal put_vp8_epel8_h4, 6, 6 + npicregs, 10, dst, dststride, src, srcstride, height, mx, picreg @@ -474,7 +474,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET INIT_XMM sse2 cglobal put_vp8_epel8_h6, 6, 6 + npicregs, 14, dst, dststride, src, srcstride, height, mx, picreg @@ -537,7 +537,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %macro FILTER_V 1 ; 4x4 block, V-only 4-tap filter @@ -590,7 +590,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET ; 4x4 block, V-only 6-tap filter @@ -655,7 +655,7 @@ add srcq, srcstrideq dec heightd ; next row jg .nextrow - REP_RET + RET %endmacro INIT_MMX mmxext @@ -738,7 +738,7 @@ lea srcq, [srcq+srcstrideq*2] sub heightd, 2 jg .nextrow - REP_RET + RET %if cpuflag(ssse3) cglobal put_vp8_bilinear%1_h, 6, 6 + npicregs, 5, dst, dststride, src, srcstride, height, mx, picreg @@ -815,7 +815,7 @@ lea srcq, [srcq+srcstrideq*2] sub heightd, 2 jg .nextrow - REP_RET + RET %endmacro INIT_MMX mmxext @@ -838,7 +838,7 @@ lea dstq, [dstq+dststrideq*2] sub heightd, 2 jg .nextrow - REP_RET + RET INIT_XMM sse cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height @@ -851,7 +851,7 @@ lea dstq, [dstq+dststrideq*2] sub heightd, 2 jg .nextrow - REP_RET + RET ;----------------------------------------------------------------------------- ; void ff_vp8_idct_dc_add_(uint8_t *dst, int16_t block[16], ptrdiff_t stride); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vp8dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,93 +32,93 @@ * MC functions */ void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride, - uint8_t *src, ptrdiff_t srcstride, + const uint8_t *src, ptrdiff_t srcstride, int height, int mx, int my); #define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \ static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \ - uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ + uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ ptrdiff_t srcstride, int height, int mx, int my) \ { \ ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \ @@ -149,7 +149,7 @@ #define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \ static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \ - uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ + uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ ptrdiff_t srcstride, int height, int mx, int my) \ { \ LOCAL_ALIGNED(ALIGN, uint8_t, tmp, [SIZE * (MAXHEIGHT + TAPNUMY - 1)]); \ @@ -186,7 +186,7 @@ #define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \ static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \ - uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \ + uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \ ptrdiff_t srcstride, int height, int mx, int my) \ { \ LOCAL_ALIGNED(ALIGN, uint8_t, tmp, [SIZE * (MAXHEIGHT + 2)]); \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vpx_arith.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vpx_arith.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vpx_arith.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/x86/vpx_arith.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,55 @@ +/** + * VP5 and VP6 compatible video decoder (arith decoder) + * + * Copyright (C) 2006 Aurelien Jacobs + * Copyright (C) 2010 Eli Friedman + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_X86_VPX_ARITH_H +#define AVCODEC_X86_VPX_ARITH_H + +#include "libavutil/x86/asm.h" + +#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_6REGS +#include "libavutil/attributes.h" + +#define vpx_rac_get_prob vpx_rac_get_prob +static av_always_inline int vpx_rac_get_prob(VPXRangeCoder *c, uint8_t prob) +{ + unsigned int code_word = vpx_rac_renorm(c); + unsigned int low = 1 + (((c->high - 1) * prob) >> 8); + unsigned int low_shift = low << 16; + int bit = 0; + c->code_word = code_word; + + __asm__( + "subl %4, %1 \n\t" + "subl %3, %2 \n\t" + "setae %b0 \n\t" + "cmovb %4, %1 \n\t" + "cmovb %5, %2 \n\t" + : "+q"(bit), "+&r"(c->high), "+&r"(c->code_word) + : "r"(low_shift), "r"(low), "r"(code_word) + ); + + return bit; +} +#endif + +#endif /* AVCODEC_X86_VPX_ARITH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xan.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xan.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xan.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xan.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,6 @@ * The xan_wc3 decoder outputs PAL8 data. */ -#include -#include #include #include "libavutil/intreadwrite.h" @@ -39,8 +37,8 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" +#include "decode.h" #include "get_bits.h" -#include "internal.h" #define RUNTIME_GAMMA 0 @@ -636,7 +634,7 @@ const FFCodec ff_xan_wc3_decoder = { .p.name = "xan_wc3", - .p.long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"), + CODEC_LONG_NAME("Wing Commander III / Xan"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XAN_WC3, .priv_data_size = sizeof(XanContext), @@ -644,5 +642,5 @@ .close = xan_decode_end, FF_CODEC_DECODE_CB(xan_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,13 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/avstring.h" #include "libavutil/reverse.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" -#include "mathops.h" +#include "decode.h" static int get_nibble(uint8_t x) { @@ -84,6 +82,9 @@ if ((ret = ff_set_dimensions(avctx, width, height)) < 0) return ret; + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; @@ -139,9 +140,10 @@ const FFCodec ff_xbm_decoder = { .p.name = "xbm", - .p.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), + CODEC_LONG_NAME("XBM (X BitMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XBM, .p.capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(xbm_decode_frame), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xbmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,8 @@ const AVFrame *p, int *got_packet) { int i, j, l, commas, ret, size, linesize, lineout, rowsout; - uint8_t *ptr, *buf; + const uint8_t *ptr; + uint8_t *buf; linesize = lineout = (avctx->width + 7) / 8; commas = avctx->height * linesize; @@ -78,9 +79,10 @@ const FFCodec ff_xbm_encoder = { .p.name = "xbm", - .p.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), + CODEC_LONG_NAME("XBM (X BitMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XBM, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(xbm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfacedec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfacedec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfacedec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfacedec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,11 +24,9 @@ * X-Face decoder, based on libcompface, by James Ashton. */ -#include "libavutil/pixdesc.h" #include "avcodec.h" -#include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "xface.h" static int pop_integer(BigInt *b, const ProbRange *pranges) @@ -177,7 +175,7 @@ const FFCodec ff_xface_decoder = { .p.name = "xface", - .p.long_name = NULL_IF_CONFIG_SMALL("X-face image"), + CODEC_LONG_NAME("X-face image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XFACE, .p.capabilities = AV_CODEC_CAP_DR1, @@ -185,5 +183,4 @@ .init = xface_decode_init, FF_CODEC_DECODE_CB(xface_decode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfaceenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfaceenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfaceenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xfaceenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -213,10 +213,10 @@ const FFCodec ff_xface_encoder = { .p.name = "xface", - .p.long_name = NULL_IF_CONFIG_SMALL("X-face image"), + CODEC_LONG_NAME("X-face image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XFACE, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .priv_data_size = sizeof(XFaceContext), FF_CODEC_ENCODE_CB(xface_encode_frame), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xl.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static const int xl_table[32] = { 0, 1, 2, 3, 4, 5, 6, 7, @@ -128,11 +128,10 @@ const FFCodec ff_xl_decoder = { .p.name = "xl", - .p.long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"), + CODEC_LONG_NAME("Miro VideoXL"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VIXL, .init = decode_init, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xpmdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xpmdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xpmdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xpmdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,11 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/parseutils.h" #include "libavutil/avstring.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #define MIN_ELEMENT ' ' #define MAX_ELEMENT 0xfe @@ -355,12 +354,18 @@ return AVERROR_INVALIDDATA; } + if (size > SIZE_MAX / 4) + return AVERROR(ENOMEM); + size *= 4; ptr += mod_strcspn(ptr, ",") + 1; if (end - ptr < 1) return AVERROR_INVALIDDATA; + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; @@ -438,11 +443,12 @@ const FFCodec ff_xpm_decoder = { .p.name = "xpm", - .p.long_name = NULL_IF_CONFIG_SMALL("XPM (X PixMap) image"), + CODEC_LONG_NAME("XPM (X PixMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XPM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(XPMDecContext), .close = xpm_decode_close, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(xpm_decode_frame), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -156,10 +156,9 @@ const FFCodec ff_xsub_decoder = { .p.name = "xsub", - .p.long_name = NULL_IF_CONFIG_SMALL("XSUB"), + CODEC_LONG_NAME("XSUB"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_XSUB, .init = decode_init, FF_CODEC_DECODE_SUB_CB(decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xsubenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -213,10 +213,9 @@ const FFCodec ff_xsub_encoder = { .p.name = "xsub", - .p.long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), + CODEC_LONG_NAME("DivX subtitles (XSUB)"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_XSUB, .init = xsub_encoder_init, FF_CODEC_ENCODE_SUB_CB(xsub_encode), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,14 +26,12 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "xwd.h" static int xwd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; - int i, ret, buf_size = avpkt->size; uint32_t version, header_size, vclass, ncolors; uint32_t xoffset, be, bpp, lsize, rsize; uint32_t pixformat, pixdepth, bunit, bitorder, bpad; @@ -41,11 +39,12 @@ uint8_t *ptr; int width, height; GetByteContext gb; + int ret; - if (buf_size < XWD_HEADER_SIZE) + if (avpkt->size < XWD_HEADER_SIZE) return AVERROR_INVALIDDATA; - bytestream2_init(&gb, buf, buf_size); + bytestream2_init(&gb, avpkt->data, avpkt->size); header_size = bytestream2_get_be32u(&gb); version = bytestream2_get_be32u(&gb); @@ -54,7 +53,7 @@ return AVERROR_INVALIDDATA; } - if (buf_size < header_size || header_size < XWD_HEADER_SIZE) { + if (avpkt->size < header_size || header_size < XWD_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "invalid header size\n"); return AVERROR_INVALIDDATA; } @@ -211,6 +210,9 @@ return AVERROR_PATCHWELCOME; } + if (avctx->skip_frame >= AVDISCARD_ALL) + return avpkt->size; + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; @@ -221,8 +223,7 @@ uint32_t *dst = (uint32_t *)p->data[1]; uint8_t red, green, blue; - for (i = 0; i < ncolors; i++) { - + for (int i = 0; i < ncolors; i++) { bytestream2_skipu(&gb, 4); // skip colormap entry number red = bytestream2_get_byteu(&gb); bytestream2_skipu(&gb, 1); @@ -236,7 +237,7 @@ } ptr = p->data[0]; - for (i = 0; i < avctx->height; i++) { + for (int i = 0; i < avctx->height; i++) { bytestream2_get_bufferu(&gb, ptr, rsize); bytestream2_skipu(&gb, lsize - rsize); ptr += p->linesize[0]; @@ -244,14 +245,15 @@ *got_frame = 1; - return buf_size; + return avpkt->size; } const FFCodec ff_xwd_decoder = { .p.name = "xwd", - .p.long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), + CODEC_LONG_NAME("XWD (X Window Dump) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XWD, .p.capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, FF_CODEC_DECODE_CB(xwd_decode_frame), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwdenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwdenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwdenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwdenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #define WINDOW_NAME_SIZE 11 static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, - const AVFrame *pict, int *got_packet) + const AVFrame *p, int *got_packet) { enum AVPixelFormat pix_fmt = avctx->pix_fmt; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); @@ -39,8 +39,8 @@ uint32_t rgb[3] = { 0 }, bitorder = 0; uint32_t header_size; int i, out_size, ret; - uint8_t *ptr, *buf; - AVFrame * const p = (AVFrame *)pict; + const uint8_t *ptr; + uint8_t *buf; uint32_t pal[256]; pixdepth = av_get_bits_per_pixel(desc); @@ -151,9 +151,6 @@ return ret; buf = pkt->data; - p->key_frame = 1; - p->pict_type = AV_PICTURE_TYPE_I; - bytestream_put_be32(&buf, header_size); bytestream_put_be32(&buf, XWD_VERSION); // file version bytestream_put_be32(&buf, XWD_Z_PIXMAP); // pixmap format @@ -216,10 +213,10 @@ const FFCodec ff_xwd_encoder = { .p.name = "xwd", - .p.long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), + CODEC_LONG_NAME("XWD (X Window Dump) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XWD, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, FF_CODEC_ENCODE_CB(xwd_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, AV_PIX_FMT_RGBA, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwd_parser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwd_parser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwd_parser.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xwd_parser.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * XWD parser + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * XWD parser + **/ + +#include "libavutil/intreadwrite.h" +#include "parser.h" +#include "xwd.h" + +typedef struct XWDParseContext { + ParseContext pc; + int left; + int idx; + uint8_t hdr[XWD_HEADER_SIZE]; +} XWDParseContext; + +static int xwd_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + XWDParseContext *t = s->priv_data; + ParseContext *pc = &t->pc; + int next = END_NOT_FOUND; + + s->pict_type = AV_PICTURE_TYPE_NONE; + + *poutbuf = NULL; + *poutbuf_size = 0; + + if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { + next = buf_size; + } else { + for (int i = 0; i < buf_size; i++) { + if (t->left > 0) { + t->left--; + if (t->left == 0) { + next = i; + break; + } + continue; + } + + if (t->idx >= 100) { + t->idx = 99; + memmove(&t->hdr[0], &t->hdr[1], XWD_HEADER_SIZE-1); + } + + t->hdr[t->idx++] = buf[i]; + + if (t->idx >= 100 && AV_RB32(t->hdr + 4) == XWD_VERSION) { + uint32_t header_size = AV_RB32(t->hdr + 0); + uint32_t height = AV_RB32(t->hdr + 20); + uint32_t lsize = AV_RB32(t->hdr + 48); + uint32_t ncolors = AV_RB32(t->hdr + 76); + uint32_t size = header_size + ncolors * XWD_CMAP_SIZE + height * lsize; + pc->frame_start_found = 1; + t->left = size - XWD_HEADER_SIZE + 1; + t->idx = 0; + memset(t->hdr, 0, sizeof(t->hdr)); + } + } + + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) + return buf_size; + } + + *poutbuf = buf; + *poutbuf_size = buf_size; + + s->pict_type = AV_PICTURE_TYPE_I; + s->key_frame = 1; + s->duration = 1; + + return next; +} + +const AVCodecParser ff_xwd_parser = { + .codec_ids = { AV_CODEC_ID_XWD }, + .priv_data_size = sizeof(XWDParseContext), + .parser_parse = xwd_parse, + .parser_close = ff_parse_close, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xxan.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xxan.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xxan.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/xxan.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,7 +26,7 @@ #include "avcodec.h" #include "bytestream.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct XanContext { AVCodecContext *avctx; @@ -435,7 +435,7 @@ const FFCodec ff_xan_wc4_decoder = { .p.name = "xan_wc4", - .p.long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"), + CODEC_LONG_NAME("Wing Commander IV / Xxan"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XAN_WC4, .priv_data_size = sizeof(XanContext), @@ -443,5 +443,5 @@ .close = xan_decode_end, FF_CODEC_DECODE_CB(xan_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41pdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41pdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41pdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41pdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int y41p_decode_init(AVCodecContext *avctx) { @@ -83,11 +83,10 @@ const FFCodec ff_y41p_decoder = { .p.name = "y41p", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), + CODEC_LONG_NAME("Uncompressed YUV 4:1:1 12-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_Y41P, .init = y41p_decode_init, FF_CODEC_DECODE_CB(y41p_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41penc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41penc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41penc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/y41penc.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ const AVFrame *pic, int *got_packet) { uint8_t *dst; - uint8_t *y, *u, *v; + const uint8_t *y, *u, *v; int i, j, ret; ret = ff_get_encode_buffer(avctx, pkt, avctx->width * avctx->height * 1.5, 0); @@ -79,13 +79,12 @@ const FFCodec ff_y41p_encoder = { .p.name = "y41p", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), + CODEC_LONG_NAME("Uncompressed YUV 4:1:1 12-bit"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_Y41P, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .init = y41p_encode_init, FF_CODEC_ENCODE_CB(y41p_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ylc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ylc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ylc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/ylc.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,21 +18,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include #define YLC_VLC_BITS 10 -#include "libavutil/imgutils.h" -#include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" +#include "libavutil/pixfmt.h" #include "avcodec.h" #include "bswapdsp.h" #include "codec_internal.h" #include "get_bits.h" -#include "huffyuvdsp.h" #include "thread.h" #include "unary.h" @@ -451,7 +447,7 @@ const FFCodec ff_ylc_decoder = { .p.name = "ylc", - .p.long_name = NULL_IF_CONFIG_SMALL("YUY2 Lossless Codec"), + CODEC_LONG_NAME("YUY2 Lossless Codec"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_YLC, .priv_data_size = sizeof(YLCContext), @@ -459,5 +455,4 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yop.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yop.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yop.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yop.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,11 +26,10 @@ #include "libavutil/imgutils.h" #include "libavutil/internal.h" -#include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" typedef struct YopDecContext { AVCodecContext *avctx; @@ -208,7 +207,7 @@ if ((ret = ff_reget_buffer(avctx, frame, 0)) < 0) return ret; - if (!avctx->frame_number) + if (!avctx->frame_num) memset(frame->data[1], 0, AVPALETTE_SIZE); s->dstbuf = frame->data[0]; @@ -268,12 +267,11 @@ const FFCodec ff_yop_decoder = { .p.name = "yop", - .p.long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), + CODEC_LONG_NAME("Psygnosis YOP Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_YOP, .priv_data_size = sizeof(YopDecContext), .init = yop_decode_init, .close = yop_decode_close, FF_CODEC_DECODE_CB(yop_decode_frame), - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,7 +22,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" static av_cold int yuv4_decode_init(AVCodecContext *avctx) { @@ -75,11 +75,10 @@ const FFCodec ff_yuv4_decoder = { .p.name = "yuv4", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), + CODEC_LONG_NAME("Uncompressed packed 4:2:0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_YUV4, .init = yuv4_decode_init, FF_CODEC_DECODE_CB(yuv4_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/yuv4enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ const AVFrame *pic, int *got_packet) { uint8_t *dst; - uint8_t *y, *u, *v; + const uint8_t *y, *u, *v; int i, j, ret; ret = ff_get_encode_buffer(avctx, pkt, 6 * (avctx->width + 1 >> 1) @@ -61,10 +61,10 @@ const FFCodec ff_yuv4_encoder = { .p.name = "yuv4", - .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), + CODEC_LONG_NAME("Uncompressed packed 4:2:0"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_YUV4, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, FF_CODEC_ENCODE_CB(yuv4_encode_frame), }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zerocodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zerocodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zerocodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zerocodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,7 @@ #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include "libavutil/common.h" @@ -84,11 +84,12 @@ return AVERROR_INVALIDDATA; } - if (!(avpkt->flags & AV_PKT_FLAG_KEY)) + if (!(avpkt->flags & AV_PKT_FLAG_KEY)) { for (j = 0; j < avctx->width << 1; j++) dst[j] += prev[j] & -!dst[j]; + prev -= prev_pic->linesize[0]; + } - prev -= prev_pic->linesize[0]; dst -= pic->linesize[0]; } @@ -136,7 +137,7 @@ const FFCodec ff_zerocodec_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.name = "zerocodec", - .p.long_name = NULL_IF_CONFIG_SMALL("ZeroCodec Lossless Video"), + CODEC_LONG_NAME("ZeroCodec Lossless Video"), .p.id = AV_CODEC_ID_ZEROCODEC, .priv_data_size = sizeof(ZeroCodecContext), .init = zerocodec_decode_init, @@ -144,6 +145,5 @@ .flush = zerocodec_decode_flush, .close = zerocodec_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbv.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,15 +24,14 @@ * Zip Motion Blocks Video decoder */ -#include -#include +#include #include "libavutil/common.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "codec_internal.h" -#include "internal.h" +#include "decode.h" #include "zlib_wrapper.h" #include @@ -647,7 +646,7 @@ const FFCodec ff_zmbv_decoder = { .p.name = "zmbv", - .p.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), + CODEC_LONG_NAME("Zip Motion Blocks Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ZMBV, .priv_data_size = sizeof(ZmbvContext), @@ -655,5 +654,5 @@ .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavcodec/zmbvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -84,8 +84,8 @@ /** Block comparing function * XXX should be optimized and moved to DSPContext */ -static inline int block_cmp(ZmbvEncContext *c, uint8_t *src, int stride, - uint8_t *src2, int stride2, int bw, int bh, +static inline int block_cmp(ZmbvEncContext *c, const uint8_t *src, int stride, + const uint8_t *src2, int stride2, int bw, int bh, int *xored) { int sum = 0; @@ -119,7 +119,7 @@ /** Motion estimation function * TODO make better ME decisions */ -static int zmbv_me(ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev, +static int zmbv_me(ZmbvEncContext *c, const uint8_t *src, int sstride, const uint8_t *prev, int pstride, int x, int y, int *mx, int *my, int *xored) { int dx, dy, txored, tv, bv, bw, bh; @@ -171,7 +171,8 @@ ZmbvEncContext * const c = avctx->priv_data; z_stream *const zstream = &c->zstream.zstream; const AVFrame * const p = pict; - uint8_t *src, *prev, *buf; + const uint8_t *src; + uint8_t *prev, *buf; uint32_t *palptr; int keyframe, chpal; int fl; @@ -218,7 +219,7 @@ } }else{ int x, y, bh2, bw2, xored; - uint8_t *tsrc, *tprev; + const uint8_t *tsrc, *tprev; uint8_t *mv; int mx = 0, my = 0; @@ -412,10 +413,10 @@ const FFCodec ff_zmbv_encoder = { .p.name = "zmbv", - .p.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), + CODEC_LONG_NAME("Zip Motion Blocks Video"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ZMBV, - .p.capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, .priv_data_size = sizeof(ZmbvEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), @@ -428,5 +429,5 @@ #endif //ZMBV_ENABLE_24BPP AV_PIX_FMT_BGR0, AV_PIX_FMT_NONE }, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alldevices.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alldevices.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alldevices.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alldevices.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,40 +19,41 @@ */ #include "libavformat/internal.h" +#include "libavformat/mux.h" #include "avdevice.h" /* devices */ extern const AVInputFormat ff_alsa_demuxer; -extern const AVOutputFormat ff_alsa_muxer; +extern const FFOutputFormat ff_alsa_muxer; extern const AVInputFormat ff_android_camera_demuxer; -extern const AVOutputFormat ff_audiotoolbox_muxer; +extern const FFOutputFormat ff_audiotoolbox_muxer; extern const AVInputFormat ff_avfoundation_demuxer; extern const AVInputFormat ff_bktr_demuxer; -extern const AVOutputFormat ff_caca_muxer; +extern const FFOutputFormat ff_caca_muxer; extern const AVInputFormat ff_decklink_demuxer; -extern const AVOutputFormat ff_decklink_muxer; +extern const FFOutputFormat ff_decklink_muxer; extern const AVInputFormat ff_dshow_demuxer; extern const AVInputFormat ff_fbdev_demuxer; -extern const AVOutputFormat ff_fbdev_muxer; +extern const FFOutputFormat ff_fbdev_muxer; extern const AVInputFormat ff_gdigrab_demuxer; extern const AVInputFormat ff_iec61883_demuxer; extern const AVInputFormat ff_jack_demuxer; extern const AVInputFormat ff_kmsgrab_demuxer; extern const AVInputFormat ff_lavfi_demuxer; extern const AVInputFormat ff_openal_demuxer; -extern const AVOutputFormat ff_opengl_muxer; +extern const FFOutputFormat ff_opengl_muxer; extern const AVInputFormat ff_oss_demuxer; -extern const AVOutputFormat ff_oss_muxer; +extern const FFOutputFormat ff_oss_muxer; extern const AVInputFormat ff_pulse_demuxer; -extern const AVOutputFormat ff_pulse_muxer; -extern const AVOutputFormat ff_sdl2_muxer; +extern const FFOutputFormat ff_pulse_muxer; +extern const FFOutputFormat ff_sdl2_muxer; extern const AVInputFormat ff_sndio_demuxer; -extern const AVOutputFormat ff_sndio_muxer; +extern const FFOutputFormat ff_sndio_muxer; extern const AVInputFormat ff_v4l2_demuxer; -extern const AVOutputFormat ff_v4l2_muxer; +extern const FFOutputFormat ff_v4l2_muxer; extern const AVInputFormat ff_vfwcap_demuxer; extern const AVInputFormat ff_xcbgrab_demuxer; -extern const AVOutputFormat ff_xv_muxer; +extern const FFOutputFormat ff_xv_muxer; /* external libraries */ extern const AVInputFormat ff_libcdio_demuxer; @@ -97,12 +98,12 @@ const AVClass *pc; const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_OUTPUT; AVClassCategory category = AV_CLASS_CATEGORY_NA; - const AVOutputFormat *fmt = NULL; + const FFOutputFormat *fmt = NULL; int i = 0; while (prev && (fmt = outdev_list[i])) { i++; - if (prev == fmt) + if (prev == &fmt->p) break; } @@ -110,7 +111,7 @@ fmt = outdev_list[i++]; if (!fmt) break; - pc = fmt->priv_class; + pc = fmt->p.priv_class; if (!pc) continue; category = pc->category; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alsa_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alsa_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alsa_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/alsa_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -131,7 +131,14 @@ pkt.data = (*frame)->data[0]; pkt.size = (*frame)->nb_samples * s->frame_size; pkt.dts = (*frame)->pkt_dts; - pkt.duration = (*frame)->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if ((*frame)->pkt_duration) + pkt.duration = (*frame)->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt.duration = (*frame)->duration; return audio_write_packet(s1, &pkt); } @@ -158,18 +165,18 @@ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, }; -const AVOutputFormat ff_alsa_muxer = { - .name = "alsa", - .long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"), +const FFOutputFormat ff_alsa_muxer = { + .p.name = "alsa", + .p.long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"), .priv_data_size = sizeof(AlsaData), - .audio_codec = DEFAULT_CODEC_ID, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = DEFAULT_CODEC_ID, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = ff_alsa_close, .write_uncoded_frame = audio_write_frame, .get_device_list = audio_get_device_list, .get_output_timestamp = audio_get_output_timestamp, - .flags = AVFMT_NOFILE, - .priv_class = &alsa_muxer_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &alsa_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/audiotoolbox.m mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/audiotoolbox.m --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/audiotoolbox.m 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/audiotoolbox.m 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "libavutil/opt.h" #include "libavformat/internal.h" +#include "libavformat/mux.h" #include "libavutil/internal.h" #include "avdevice.h" @@ -173,7 +174,7 @@ device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S16BE) ? kAudioFormatFlagIsBigEndian : 0; device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S24BE) ? kAudioFormatFlagIsBigEndian : 0; device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S32BE) ? kAudioFormatFlagIsBigEndian : 0; - device_format.mChannelsPerFrame = codecpar->channels; + device_format.mChannelsPerFrame = codecpar->ch_layout.nb_channels; device_format.mBitsPerChannel = (codecpar->codec_id == AV_NE(AV_CODEC_ID_PCM_S24BE, AV_CODEC_ID_PCM_S24LE)) ? 24 : (av_get_bytes_per_sample(codecpar->format) << 3); device_format.mBytesPerFrame = (device_format.mBitsPerChannel >> 3) * device_format.mChannelsPerFrame; device_format.mFramesPerPacket = 1; @@ -193,9 +194,9 @@ av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags |= %s\n", (codecpar->codec_id == AV_CODEC_ID_PCM_S24BE) ? "kAudioFormatFlagIsBigEndian" : "0"); av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags |= %s\n", (codecpar->codec_id == AV_CODEC_ID_PCM_S32BE) ? "kAudioFormatFlagIsBigEndian" : "0"); av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags == %i\n", device_format.mFormatFlags); - av_log(ctx, AV_LOG_DEBUG, "device_format.mChannelsPerFrame = %i\n", codecpar->channels); + av_log(ctx, AV_LOG_DEBUG, "device_format.mChannelsPerFrame = %i\n", codecpar->ch_layout.nb_channels); av_log(ctx, AV_LOG_DEBUG, "device_format.mBitsPerChannel = %i\n", av_get_bytes_per_sample(codecpar->format) << 3); - av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerFrame = %i\n", (device_format.mBitsPerChannel >> 3) * codecpar->channels); + av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerFrame = %i\n", (device_format.mBitsPerChannel >> 3) * codecpar->ch_layout.nb_channels); av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerPacket = %i\n", device_format.mBytesPerFrame); av_log(ctx, AV_LOG_DEBUG, "device_format.mFramesPerPacket = %i\n", 1); av_log(ctx, AV_LOG_DEBUG, "device_format.mReserved = %i\n", 0); @@ -294,15 +295,15 @@ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, }; -const AVOutputFormat ff_audiotoolbox_muxer = { - .name = "audiotoolbox", - .long_name = NULL_IF_CONFIG_SMALL("AudioToolbox output device"), +const FFOutputFormat ff_audiotoolbox_muxer = { + .p.name = "audiotoolbox", + .p.long_name = NULL_IF_CONFIG_SMALL("AudioToolbox output device"), .priv_data_size = sizeof(ATContext), - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.video_codec = AV_CODEC_ID_NONE, .write_header = at_write_header, .write_packet = at_write_packet, .write_trailer = at_write_trailer, - .flags = AVFMT_NOFILE, - .priv_class = &at_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &at_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,19 +19,14 @@ #include "libavutil/avassert.h" #include "avdevice.h" #include "internal.h" - -#if FF_API_DEVICE_CAPABILITIES -const AVOption av_device_capabilities[] = { - { NULL } -}; -#endif +#include "libavformat/mux.h" int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToDevMessageType type, void *data, size_t data_size) { - if (!s->oformat || !s->oformat->control_message) + if (!s->oformat || !ffofmt(s->oformat)->control_message) return AVERROR(ENOSYS); - return s->oformat->control_message(s, type, data, data_size); + return ffofmt(s->oformat)->control_message(s, type, data, data_size); } int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, @@ -42,26 +37,13 @@ return s->control_message_cb(s, type, data, data_size); } -#if FF_API_DEVICE_CAPABILITIES -int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, - AVDictionary **device_options) -{ - return AVERROR(ENOSYS); -} - -void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s) -{ - return; -} -#endif - int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list) { int ret; av_assert0(s); av_assert0(device_list); av_assert0(s->oformat || s->iformat); - if ((s->oformat && !s->oformat->get_device_list) || + if ((s->oformat && !ffofmt(s->oformat)->get_device_list) || (s->iformat && !s->iformat->get_device_list)) { *device_list = NULL; return AVERROR(ENOSYS); @@ -72,7 +54,7 @@ /* no default device by default */ (*device_list)->default_device = -1; if (s->oformat) - ret = s->oformat->get_device_list(s, *device_list); + ret = ffofmt(s->oformat)->get_device_list(s, *device_list); else ret = s->iformat->get_device_list(s, *device_list); if (ret < 0) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avdevice.h 2023-03-03 13:29:59.000000000 +0000 @@ -327,136 +327,6 @@ enum AVDevToAppMessageType type, void *data, size_t data_size); -#if FF_API_DEVICE_CAPABILITIES -/** - * Following API allows user to probe device capabilities (supported codecs, - * pixel formats, sample formats, resolutions, channel counts, etc). - * It is build on top op AVOption API. - * Queried capabilities make it possible to set up converters of video or audio - * parameters that fit to the device. - * - * List of capabilities that can be queried: - * - Capabilities valid for both audio and video devices: - * - codec: supported audio/video codecs. - * type: AV_OPT_TYPE_INT (AVCodecID value) - * - Capabilities valid for audio devices: - * - sample_format: supported sample formats. - * type: AV_OPT_TYPE_INT (AVSampleFormat value) - * - sample_rate: supported sample rates. - * type: AV_OPT_TYPE_INT - * - channels: supported number of channels. - * type: AV_OPT_TYPE_INT - * - channel_layout: supported channel layouts. - * type: AV_OPT_TYPE_INT64 - * - Capabilities valid for video devices: - * - pixel_format: supported pixel formats. - * type: AV_OPT_TYPE_INT (AVPixelFormat value) - * - window_size: supported window sizes (describes size of the window size presented to the user). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - frame_size: supported frame sizes (describes size of provided video frames). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - fps: supported fps values - * type: AV_OPT_TYPE_RATIONAL - * - * Value of the capability may be set by user using av_opt_set() function - * and AVDeviceCapabilitiesQuery object. Following queries will - * limit results to the values matching already set capabilities. - * For example, setting a codec may impact number of formats or fps values - * returned during next query. Setting invalid value may limit results to zero. - * - * Example of the usage basing on opengl output device: - * - * @code - * AVFormatContext *oc = NULL; - * AVDeviceCapabilitiesQuery *caps = NULL; - * AVOptionRanges *ranges; - * int ret; - * - * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0) - * goto fail; - * if (avdevice_capabilities_create(&caps, oc, NULL) < 0) - * goto fail; - * - * //query codecs - * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick codec here and set it - * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0); - * - * //query format - * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick format here and set it - * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0); - * - * //query and set more capabilities - * - * fail: - * //clean up code - * avdevice_capabilities_free(&query, oc); - * avformat_free_context(oc); - * @endcode - */ - -/** - * Structure describes device capabilities. - * - * It is used by devices in conjunction with av_device_capabilities AVOption table - * to implement capabilities probing API based on AVOption API. Should not be used directly. - */ -typedef struct AVDeviceCapabilitiesQuery { - const AVClass *av_class; - AVFormatContext *device_context; - enum AVCodecID codec; - enum AVSampleFormat sample_format; - enum AVPixelFormat pixel_format; - int sample_rate; - int channels; - int64_t channel_layout; - int window_width; - int window_height; - int frame_width; - int frame_height; - AVRational fps; -} AVDeviceCapabilitiesQuery; - -/** - * AVOption table used by devices to implement device capabilities API. Should not be used by a user. - */ -attribute_deprecated -extern const AVOption av_device_capabilities[]; - -/** - * Initialize capabilities probing API based on AVOption API. - * - * avdevice_capabilities_free() must be called when query capabilities API is - * not used anymore. - * - * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed. - * @param s Context of the device. - * @param device_options An AVDictionary filled with device-private options. - * On return this parameter will be destroyed and replaced with a dict - * containing options that were not found. May be NULL. - * The same options must be passed later to avformat_write_header() for output - * devices or avformat_open_input() for input devices, or at any other place - * that affects device-private options. - * - * @return >= 0 on success, negative otherwise. - */ -attribute_deprecated -int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, - AVDictionary **device_options); - -/** - * Free resources created by avdevice_capabilities_create() - * - * @param caps Device capabilities data to be freed. - * @param s Context of the device. - */ -attribute_deprecated -void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s); -#endif - /** * Structure describes basic parameters of the device. */ @@ -494,7 +364,7 @@ /** * Convenient function to free result of avdevice_list_devices(). * - * @param devices device list to be freed. + * @param device_list device list to be freed. */ void avdevice_free_list_devices(AVDeviceInfoList **device_list); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avfoundation.m mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avfoundation.m --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avfoundation.m 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/avfoundation.m 2023-03-03 13:29:59.000000000 +0000 @@ -706,8 +706,7 @@ stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; stream->codecpar->sample_rate = basic_desc->mSampleRate; - stream->codecpar->channels = basic_desc->mChannelsPerFrame; - stream->codecpar->channel_layout = av_get_default_channel_layout(stream->codecpar->channels); + av_channel_layout_default(&stream->codecpar->ch_layout, basic_desc->mChannelsPerFrame); ctx->audio_channels = basic_desc->mChannelsPerFrame; ctx->audio_bits_per_sample = basic_desc->mBitsPerChannel; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/bktr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/bktr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/bktr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/bktr.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ */ #include "libavformat/internal.h" +#include "libavutil/file_open.h" #include "libavutil/internal.h" #include "libavutil/log.h" #include "libavutil/opt.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/caca.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/caca.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/caca.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/caca.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavformat/mux.h" #include "avdevice.h" typedef struct CACAContext { @@ -220,15 +221,15 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_caca_muxer = { - .name = "caca", - .long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"), +const FFOutputFormat ff_caca_muxer = { + .p.name = "caca", + .p.long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"), .priv_data_size = sizeof(CACAContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = caca_write_header, .write_packet = caca_write_packet, .deinit = caca_deinit, - .flags = AVFMT_NOFILE, - .priv_class = &caca_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &caca_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/decklink_enc_c.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/decklink_enc_c.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/decklink_enc_c.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/decklink_enc_c.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "libavformat/avformat.h" +#include "libavformat/mux.h" #include "libavutil/opt.h" #include "decklink_common_c.h" @@ -71,15 +72,15 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_decklink_muxer = { - .name = "decklink", - .long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, - .subtitle_codec = AV_CODEC_ID_NONE, - .flags = AVFMT_NOFILE, +const FFOutputFormat ff_decklink_muxer = { + .p.name = "decklink", + .p.long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink output"), + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.subtitle_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &decklink_muxer_class, .get_device_list = ff_decklink_list_output_devices, - .priv_class = &decklink_muxer_class, .priv_data_size = sizeof(struct decklink_cctx), .write_header = ff_decklink_write_header, .write_packet = ff_decklink_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include #include "fbdev_common.h" #include "libavutil/common.h" +#include "libavutil/file_open.h" #include "avdevice.h" struct rgb_pixfmt_map_entry { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,6 +34,7 @@ #include #include +#include "libavutil/file_open.h" #include "libavutil/internal.h" #include "libavutil/log.h" #include "libavutil/opt.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/fbdev_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,10 +23,12 @@ #include #include #include +#include "libavutil/file_open.h" #include "libavutil/pixdesc.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "libavformat/avformat.h" +#include "libavformat/mux.h" #include "fbdev_common.h" #include "avdevice.h" @@ -205,16 +207,16 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_fbdev_muxer = { - .name = "fbdev", - .long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"), +const FFOutputFormat ff_fbdev_muxer = { + .p.name = "fbdev", + .p.long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"), .priv_data_size = sizeof(FBDevContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = fbdev_write_header, .write_packet = fbdev_write_packet, .write_trailer = fbdev_write_trailer, .get_device_list = fbdev_get_device_list, - .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, - .priv_class = &fbdev_class, + .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, + .p.priv_class = &fbdev_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/jack.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/jack.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/jack.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/jack.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,6 @@ #include "libavutil/fifo.h" #include "libavutil/opt.h" #include "libavutil/time.h" -#include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavformat/internal.h" #include "timefilter.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/lavfi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/lavfi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/lavfi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/lavfi.c 2023-03-03 13:29:59.000000000 +0000 @@ -54,32 +54,10 @@ int *sink_eof; int *stream_sink_map; int *sink_stream_subcc_map; - AVFrame *decoded_frame; int nb_sinks; AVPacket subcc_packet; } LavfiContext; -static int *create_all_formats(int n) -{ - int i, j, *fmts, count = 0; - - for (i = 0; i < n; i++) { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i); - if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) - count++; - } - - if (!(fmts = av_malloc_array(count + 1, sizeof(*fmts)))) - return NULL; - for (j = 0, i = 0; i < n; i++) { - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i); - if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) - fmts[j++] = i; - } - fmts[j] = AV_PIX_FMT_NONE; - return fmts; -} - av_cold static int lavfi_read_close(AVFormatContext *avctx) { LavfiContext *lavfi = avctx->priv_data; @@ -90,7 +68,6 @@ av_freep(&lavfi->sink_stream_subcc_map); av_freep(&lavfi->sinks); avfilter_graph_free(&lavfi->graph); - av_frame_free(&lavfi->decoded_frame); return 0; } @@ -125,15 +102,11 @@ LavfiContext *lavfi = avctx->priv_data; AVFilterInOut *input_links = NULL, *output_links = NULL, *inout; const AVFilter *buffersink, *abuffersink; - int *pix_fmts = create_all_formats(AV_PIX_FMT_NB); enum AVMediaType type; int ret = 0, i, n; #define FAIL(ERR) { ret = ERR; goto end; } - if (!pix_fmts) - FAIL(AVERROR(ENOMEM)); - buffersink = avfilter_get_by_name("buffersink"); abuffersink = avfilter_get_by_name("abuffersink"); @@ -264,8 +237,6 @@ ret = avfilter_graph_create_filter(&sink, buffersink, inout->name, NULL, NULL, lavfi->graph); - if (ret >= 0) - ret = av_opt_set_int_list(sink, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); if (ret < 0) goto end; } else if (type == AVMEDIA_TYPE_AUDIO) { @@ -316,21 +287,23 @@ for (i = 0; i < lavfi->nb_sinks; i++) { AVFilterContext *sink = lavfi->sinks[lavfi->stream_sink_map[i]]; AVRational time_base = av_buffersink_get_time_base(sink); + AVRational frame_rate = av_buffersink_get_frame_rate(sink); AVStream *st = avctx->streams[i]; AVCodecParameters *const par = st->codecpar; avpriv_set_pts_info(st, 64, time_base.num, time_base.den); par->codec_type = av_buffersink_get_type(sink); if (par->codec_type == AVMEDIA_TYPE_VIDEO) { - int64_t probesize; - par->codec_id = AV_CODEC_ID_RAWVIDEO; + par->codec_id = AV_CODEC_ID_WRAPPED_AVFRAME; par->format = av_buffersink_get_format(sink); par->width = av_buffersink_get_w(sink); par->height = av_buffersink_get_h(sink); - probesize = par->width * par->height * 30 * - av_get_padded_bits_per_pixel(av_pix_fmt_desc_get(par->format)); - avctx->probesize = FFMAX(avctx->probesize, probesize); - st ->sample_aspect_ratio = + avctx->probesize = FFMAX(avctx->probesize, sizeof(AVFrame) * 30); + st ->sample_aspect_ratio = par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink); + if (frame_rate.num > 0 && frame_rate.den > 0) { + st->avg_frame_rate = frame_rate; + st->r_frame_rate = frame_rate; + } } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { par->sample_rate = av_buffersink_get_sample_rate(sink); ret = av_buffersink_get_ch_layout(sink, &par->ch_layout); @@ -348,11 +321,7 @@ if ((ret = create_subcc_streams(avctx)) < 0) goto end; - if (!(lavfi->decoded_frame = av_frame_alloc())) - FAIL(AVERROR(ENOMEM)); - end: - av_free(pix_fmts); avfilter_inout_free(&input_links); avfilter_inout_free(&output_links); return ret; @@ -378,15 +347,20 @@ return 0; } +static void lavfi_free_frame(void *opaque, uint8_t *data) +{ + AVFrame *frame = (AVFrame*)data; + av_frame_free(&frame); +} + static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) { LavfiContext *lavfi = avctx->priv_data; double min_pts = DBL_MAX; int stream_idx, min_pts_sink_idx = 0; - AVFrame *frame = lavfi->decoded_frame; + AVFrame *frame; AVDictionary *frame_metadata; int ret, i; - int size = 0; AVStream *st; if (lavfi->subcc_packet.size) { @@ -394,12 +368,15 @@ return pkt->size; } + frame = av_frame_alloc(); + if (!frame) + return AVERROR(ENOMEM); + /* iterate through all the graph sinks. Select the sink with the * minimum PTS */ for (i = 0; i < lavfi->nb_sinks; i++) { AVRational tb = av_buffersink_get_time_base(lavfi->sinks[i]); double d; - int ret; if (lavfi->sink_eof[i]) continue; @@ -411,7 +388,7 @@ lavfi->sink_eof[i] = 1; continue; } else if (ret < 0) - return ret; + goto fail; d = av_rescale_q_rnd(frame->pts, tb, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); ff_dlog(avctx, "sink_idx:%d time:%f\n", i, d); av_frame_unref(frame); @@ -421,8 +398,10 @@ min_pts_sink_idx = i; } } - if (min_pts == DBL_MAX) - return AVERROR_EOF; + if (min_pts == DBL_MAX) { + ret = AVERROR_EOF; + goto fail; + } ff_dlog(avctx, "min_pts_sink_idx:%i\n", min_pts_sink_idx); @@ -431,15 +410,19 @@ st = avctx->streams[stream_idx]; if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { - size = av_image_get_buffer_size(frame->format, frame->width, frame->height, 1); - if ((ret = av_new_packet(pkt, size)) < 0) + pkt->buf = av_buffer_create((uint8_t*)frame, sizeof(*frame), + &lavfi_free_frame, NULL, 0); + if (!pkt->buf) { + ret = AVERROR(ENOMEM); goto fail; + } - av_image_copy_to_buffer(pkt->data, size, (const uint8_t **)frame->data, frame->linesize, - frame->format, frame->width, frame->height, 1); + pkt->data = pkt->buf->data; + pkt->size = pkt->buf->size; + pkt->flags |= AV_PKT_FLAG_TRUSTED; } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { - size = frame->nb_samples * av_get_bytes_per_sample(frame->format) * - frame->ch_layout.nb_channels; + int size = frame->nb_samples * av_get_bytes_per_sample(frame->format) * + frame->ch_layout.nb_channels; if ((ret = av_new_packet(pkt, size)) < 0) goto fail; memcpy(pkt->data, frame->data[0], size); @@ -468,10 +451,13 @@ pkt->stream_index = stream_idx; pkt->pts = frame->pts; pkt->pos = frame->pkt_pos; - av_frame_unref(frame); - return size; + + if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) + av_frame_free(&frame); + + return pkt->size; fail: - av_frame_unref(frame); + av_frame_free(&frame); return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -59,7 +59,7 @@ SHLIBOBJS-$(CONFIG_DECKLINK_INDEV) += reverse.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o SKIPHEADERS += decklink_common.h SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h decklink_dec.h \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/opengl_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/opengl_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/opengl_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/opengl_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -1292,17 +1292,17 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_opengl_muxer = { - .name = "opengl", - .long_name = NULL_IF_CONFIG_SMALL("OpenGL output"), +const FFOutputFormat ff_opengl_muxer = { + .p.name = "opengl", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenGL output"), + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, + .p.priv_class = &opengl_class, .priv_data_size = sizeof(OpenGLContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, .write_header = opengl_write_header, .write_packet = opengl_write_packet, .write_uncoded_frame = opengl_write_frame, .write_trailer = opengl_write_trailer, .control_message = opengl_control_message, - .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, - .priv_class = &opengl_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include #include +#include "libavutil/file_open.h" #include "libavutil/log.h" #include "avdevice.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/oss_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "avdevice.h" #include "libavformat/internal.h" +#include "libavformat/mux.h" #include "oss.h" @@ -94,18 +95,18 @@ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, }; -const AVOutputFormat ff_oss_muxer = { - .name = "oss", - .long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"), +const FFOutputFormat ff_oss_muxer = { + .p.name = "oss", + .p.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"), .priv_data_size = sizeof(OSSAudioData), /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = audio_write_trailer, - .flags = AVFMT_NOFILE, - .priv_class = &oss_muxer_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &oss_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/pulse_audio_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/pulse_audio_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/pulse_audio_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/pulse_audio_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -686,7 +686,14 @@ pkt.data = (*frame)->data[0]; pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->ch_layout.nb_channels; pkt.dts = (*frame)->pkt_dts; - pkt.duration = (*frame)->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if ((*frame)->pkt_duration) + pkt.duration = (*frame)->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt.duration = (*frame)->duration; return pulse_write_packet(h, &pkt); } @@ -781,12 +788,12 @@ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, }; -const AVOutputFormat ff_pulse_muxer = { - .name = "pulse", - .long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"), +const FFOutputFormat ff_pulse_muxer = { + .p.name = "pulse", + .p.long_name = NULL_IF_CONFIG_SMALL("Pulse audio output"), .priv_data_size = sizeof(PulseData), - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.video_codec = AV_CODEC_ID_NONE, .write_header = pulse_write_header, .write_packet = pulse_write_packet, .write_uncoded_frame = pulse_write_frame, @@ -794,6 +801,6 @@ .get_output_timestamp = pulse_get_output_timestamp, .get_device_list = pulse_get_device_list, .control_message = pulse_control_message, - .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH, - .priv_class = &pulse_muxer_class, + .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH, + .p.priv_class = &pulse_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sdl2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sdl2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sdl2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sdl2.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/time.h" #include "avdevice.h" +#include "libavformat/mux.h" typedef struct { AVClass *class; @@ -355,15 +356,15 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_sdl2_muxer = { - .name = "sdl,sdl2", - .long_name = NULL_IF_CONFIG_SMALL("SDL2 output device"), +const FFOutputFormat ff_sdl2_muxer = { + .p.name = "sdl,sdl2", + .p.long_name = NULL_IF_CONFIG_SMALL("SDL2 output device"), .priv_data_size = sizeof(SDLContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = sdl2_write_header, .write_packet = sdl2_write_packet, .write_trailer = sdl2_write_trailer, - .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, - .priv_class = &sdl2_class, + .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, + .p.priv_class = &sdl2_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sndio_enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sndio_enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sndio_enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/sndio_enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/internal.h" +#include "libavformat/mux.h" #include "libavdevice/avdevice.h" #include "libavdevice/sndio.h" @@ -86,18 +87,18 @@ .category = AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, }; -const AVOutputFormat ff_sndio_muxer = { - .name = "sndio", - .long_name = NULL_IF_CONFIG_SMALL("sndio audio playback"), +const FFOutputFormat ff_sndio_muxer = { + .p.name = "sndio", + .p.long_name = NULL_IF_CONFIG_SMALL("sndio audio playback"), .priv_data_size = sizeof(SndioData), /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = audio_write_trailer, - .flags = AVFMT_NOFILE, - .priv_class = &sndio_muxer_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &sndio_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,6 +38,7 @@ #include "libavutil/parseutils.h" #include "libavutil/pixdesc.h" #include "libavutil/time.h" +#include "libavcodec/avcodec.h" #include "libavcodec/codec_desc.h" #include "libavformat/demux.h" #include "libavformat/internal.h" @@ -1011,6 +1012,7 @@ mmap_close(s); + ff_timefilter_destroy(s->timefilter); v4l2_close(s->fd); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/v4l2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" #include "libavformat/avformat.h" +#include "libavformat/mux.h" #include "v4l2-common.h" typedef struct { @@ -111,15 +112,15 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_v4l2_muxer = { - .name = "video4linux2,v4l2", - .long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"), +const FFOutputFormat ff_v4l2_muxer = { + .p.name = "video4linux2,v4l2", + .p.long_name = NULL_IF_CONFIG_SMALL("Video4Linux2 output device"), .priv_data_size = sizeof(V4L2Context), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = write_header, .write_packet = write_packet, .write_trailer = write_trailer, - .flags = AVFMT_NOFILE, - .priv_class = &v4l2_class, + .p.flags = AVFMT_NOFILE, + .p.priv_class = &v4l2_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVDEVICE_VERSION_MINOR 7 +#define LIBAVDEVICE_VERSION_MINOR 1 #define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,13 +25,12 @@ * Libavdevice version macros */ -#define LIBAVDEVICE_VERSION_MAJOR 59 +#define LIBAVDEVICE_VERSION_MAJOR 60 /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. */ -#define FF_API_DEVICE_CAPABILITIES (LIBAVDEVICE_VERSION_MAJOR < 60) #endif /* AVDEVICE_VERSION_MAJOR_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/xv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/xv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/xv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavdevice/xv.c 2023-03-03 13:29:59.000000000 +0000 @@ -376,17 +376,17 @@ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT, }; -const AVOutputFormat ff_xv_muxer = { - .name = "xv", - .long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"), +const FFOutputFormat ff_xv_muxer = { + .p.name = "xv", + .p.long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"), + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, + .p.priv_class = &xv_class, .priv_data_size = sizeof(XVContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, .write_header = xv_write_header, .write_packet = xv_write_packet, .write_uncoded_frame = xv_write_frame, .write_trailer = xv_write_trailer, .control_message = xv_control_message, - .flags = AVFMT_NOFILE | AVFMT_VARIABLE_FPS | AVFMT_NOTIMESTAMPS, - .priv_class = &xv_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adrc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,508 @@ +/* + * Copyright (c) 2022 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 + +#include "libavutil/eval.h" +#include "libavutil/ffmath.h" +#include "libavutil/opt.h" +#include "libavutil/tx.h" +#include "audio.h" +#include "avfilter.h" +#include "filters.h" +#include "internal.h" + +static const char * const var_names[] = { + "ch", ///< the value of the current channel + "sn", ///< number of samples + "nb_channels", + "t", ///< timestamp expressed in seconds + "sr", ///< sample rate + "p", ///< input power in dB for frequency bin + "f", ///< frequency in Hz + NULL +}; + +enum var_name { + VAR_CH, + VAR_SN, + VAR_NB_CHANNELS, + VAR_T, + VAR_SR, + VAR_P, + VAR_F, + VAR_VARS_NB +}; + +typedef struct AudioDRCContext { + const AVClass *class; + + double attack_ms; + double release_ms; + char *expr_str; + + double attack; + double release; + + int fft_size; + int overlap; + int channels; + + float fx; + float *window; + + AVFrame *drc_frame; + AVFrame *energy; + AVFrame *envelope; + AVFrame *factors; + AVFrame *in; + AVFrame *in_buffer; + AVFrame *in_frame; + AVFrame *out_dist_frame; + AVFrame *spectrum_buf; + AVFrame *target_gain; + AVFrame *windowed_frame; + + char *channels_to_filter; + AVChannelLayout ch_layout; + + AVTXContext **tx_ctx; + av_tx_fn tx_fn; + AVTXContext **itx_ctx; + av_tx_fn itx_fn; + + AVExpr *expr; + double var_values[VAR_VARS_NB]; +} AudioDRCContext; + +#define OFFSET(x) offsetof(AudioDRCContext, x) +#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM + +static const AVOption adrc_options[] = { + { "transfer", "set the transfer expression", OFFSET(expr_str), AV_OPT_TYPE_STRING, {.str="p"}, 0, 0, FLAGS }, + { "attack", "set the attack", OFFSET(attack_ms), AV_OPT_TYPE_DOUBLE, {.dbl=50.}, 1, 1000, FLAGS }, + { "release", "set the release", OFFSET(release_ms), AV_OPT_TYPE_DOUBLE, {.dbl=100.}, 5, 2000, FLAGS }, + { "channels", "set channels to filter",OFFSET(channels_to_filter),AV_OPT_TYPE_STRING,{.str="all"},0, 0, FLAGS }, + {NULL} +}; + +AVFILTER_DEFINE_CLASS(adrc); + +static void generate_hann_window(float *window, int size) +{ + for (int i = 0; i < size; i++) { + float value = 0.5f * (1.f - cosf(2.f * M_PI * i / size)); + + window[i] = value; + } +} + +static int config_input(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + AudioDRCContext *s = ctx->priv; + float scale; + int ret; + + s->fft_size = inlink->sample_rate > 100000 ? 1024 : inlink->sample_rate > 50000 ? 512 : 256; + s->fx = inlink->sample_rate * 0.5f / (s->fft_size / 2 + 1); + s->overlap = s->fft_size / 4; + + s->window = av_calloc(s->fft_size, sizeof(*s->window)); + if (!s->window) + return AVERROR(ENOMEM); + + s->drc_frame = ff_get_audio_buffer(inlink, s->fft_size * 2); + s->energy = ff_get_audio_buffer(inlink, s->fft_size / 2 + 1); + s->envelope = ff_get_audio_buffer(inlink, s->fft_size / 2 + 1); + s->factors = ff_get_audio_buffer(inlink, s->fft_size / 2 + 1); + s->in_buffer = ff_get_audio_buffer(inlink, s->fft_size * 2); + s->in_frame = ff_get_audio_buffer(inlink, s->fft_size * 2); + s->out_dist_frame = ff_get_audio_buffer(inlink, s->fft_size * 2); + s->spectrum_buf = ff_get_audio_buffer(inlink, s->fft_size * 2); + s->target_gain = ff_get_audio_buffer(inlink, s->fft_size / 2 + 1); + s->windowed_frame = ff_get_audio_buffer(inlink, s->fft_size * 2); + if (!s->in_buffer || !s->in_frame || !s->target_gain || + !s->out_dist_frame || !s->windowed_frame || !s->envelope || + !s->drc_frame || !s->spectrum_buf || !s->energy || !s->factors) + return AVERROR(ENOMEM); + + generate_hann_window(s->window, s->fft_size); + + s->channels = inlink->ch_layout.nb_channels; + + s->tx_ctx = av_calloc(s->channels, sizeof(*s->tx_ctx)); + s->itx_ctx = av_calloc(s->channels, sizeof(*s->itx_ctx)); + if (!s->tx_ctx || !s->itx_ctx) + return AVERROR(ENOMEM); + + for (int ch = 0; ch < s->channels; ch++) { + scale = 1.f / s->fft_size; + ret = av_tx_init(&s->tx_ctx[ch], &s->tx_fn, AV_TX_FLOAT_RDFT, 0, s->fft_size, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.f; + ret = av_tx_init(&s->itx_ctx[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, 1, s->fft_size, &scale, 0); + if (ret < 0) + return ret; + } + + s->var_values[VAR_SR] = inlink->sample_rate; + s->var_values[VAR_NB_CHANNELS] = s->channels; + + return av_expr_parse(&s->expr, s->expr_str, var_names, NULL, NULL, + NULL, NULL, 0, ctx); +} + +static void apply_window(AudioDRCContext *s, + const float *in_frame, float *out_frame, const int add_to_out_frame) +{ + const float *window = s->window; + const int fft_size = s->fft_size; + + if (add_to_out_frame) { + for (int i = 0; i < fft_size; i++) + out_frame[i] += in_frame[i] * window[i]; + } else { + for (int i = 0; i < fft_size; i++) + out_frame[i] = in_frame[i] * window[i]; + } +} + +static float sqrf(float x) +{ + return x * x; +} + +static void get_energy(AVFilterContext *ctx, + int len, + float *energy, + const float *spectral) +{ + for (int n = 0; n < len; n++) { + energy[n] = 10.f * log10f(sqrf(spectral[2 * n]) + sqrf(spectral[2 * n + 1])); + if (!isnormal(energy[n])) + energy[n] = -351.f; + } +} + +static void get_target_gain(AVFilterContext *ctx, + int len, + float *gain, + const float *energy, + double *var_values, + float fx, int bypass) +{ + AudioDRCContext *s = ctx->priv; + + if (bypass) { + memcpy(gain, energy, sizeof(*gain) * len); + return; + } + + for (int n = 0; n < len; n++) { + const float Xg = energy[n]; + + var_values[VAR_P] = Xg; + var_values[VAR_F] = n * fx; + + gain[n] = av_expr_eval(s->expr, var_values, s); + } +} + +static void get_envelope(AVFilterContext *ctx, + int len, + float *envelope, + const float *energy, + const float *gain) +{ + AudioDRCContext *s = ctx->priv; + const float release = s->release; + const float attack = s->attack; + + for (int n = 0; n < len; n++) { + const float Bg = gain[n] - energy[n]; + const float Vg = envelope[n]; + + if (Bg > Vg) { + envelope[n] = attack * Vg + (1.f - attack) * Bg; + } else if (Bg <= Vg) { + envelope[n] = release * Vg + (1.f - release) * Bg; + } else { + envelope[n] = 0.f; + } + } +} + +static void get_factors(AVFilterContext *ctx, + int len, + float *factors, + const float *envelope) +{ + for (int n = 0; n < len; n++) + factors[n] = sqrtf(ff_exp10f(envelope[n] / 10.f)); +} + +static void apply_factors(AVFilterContext *ctx, + int len, + float *spectrum, + const float *factors) +{ + for (int n = 0; n < len; n++) { + spectrum[2*n+0] *= factors[n]; + spectrum[2*n+1] *= factors[n]; + } +} + +static void feed(AVFilterContext *ctx, int ch, + const float *in_samples, float *out_samples, + float *in_frame, float *out_dist_frame, + float *windowed_frame, float *drc_frame, + float *spectrum_buf, float *energy, + float *target_gain, float *envelope, + float *factors) +{ + AudioDRCContext *s = ctx->priv; + double var_values[VAR_VARS_NB]; + const int fft_size = s->fft_size; + const int nb_coeffs = s->fft_size / 2 + 1; + const int overlap = s->overlap; + enum AVChannel channel = av_channel_layout_channel_from_index(&ctx->inputs[0]->ch_layout, ch); + const int bypass = av_channel_layout_index_from_channel(&s->ch_layout, channel) < 0; + + memcpy(var_values, s->var_values, sizeof(var_values)); + + var_values[VAR_CH] = ch; + + // shift in/out buffers + memmove(in_frame, in_frame + overlap, (fft_size - overlap) * sizeof(*in_frame)); + memmove(out_dist_frame, out_dist_frame + overlap, (fft_size - overlap) * sizeof(*out_dist_frame)); + + memcpy(in_frame + fft_size - overlap, in_samples, sizeof(*in_frame) * overlap); + memset(out_dist_frame + fft_size - overlap, 0, sizeof(*out_dist_frame) * overlap); + + apply_window(s, in_frame, windowed_frame, 0); + s->tx_fn(s->tx_ctx[ch], spectrum_buf, windowed_frame, sizeof(float)); + + get_energy(ctx, nb_coeffs, energy, spectrum_buf); + get_target_gain(ctx, nb_coeffs, target_gain, energy, var_values, s->fx, bypass); + get_envelope(ctx, nb_coeffs, envelope, energy, target_gain); + get_factors(ctx, nb_coeffs, factors, envelope); + apply_factors(ctx, nb_coeffs, spectrum_buf, factors); + + s->itx_fn(s->itx_ctx[ch], drc_frame, spectrum_buf, sizeof(AVComplexFloat)); + + apply_window(s, drc_frame, out_dist_frame, 1); + + // 4 times overlap with squared hanning window results in 1.5 time increase in amplitude + if (!ctx->is_disabled) { + for (int i = 0; i < overlap; i++) + out_samples[i] = out_dist_frame[i] / 1.5f; + } else { + memcpy(out_samples, in_frame, sizeof(*out_samples) * overlap); + } +} + +static int drc_channel(AVFilterContext *ctx, AVFrame *in, AVFrame *out, int ch) +{ + AudioDRCContext *s = ctx->priv; + const float *src = (const float *)in->extended_data[ch]; + float *in_buffer = (float *)s->in_buffer->extended_data[ch]; + float *dst = (float *)out->extended_data[ch]; + + memcpy(in_buffer, src, sizeof(*in_buffer) * s->overlap); + + feed(ctx, ch, in_buffer, dst, + (float *)(s->in_frame->extended_data[ch]), + (float *)(s->out_dist_frame->extended_data[ch]), + (float *)(s->windowed_frame->extended_data[ch]), + (float *)(s->drc_frame->extended_data[ch]), + (float *)(s->spectrum_buf->extended_data[ch]), + (float *)(s->energy->extended_data[ch]), + (float *)(s->target_gain->extended_data[ch]), + (float *)(s->envelope->extended_data[ch]), + (float *)(s->factors->extended_data[ch])); + + return 0; +} + +static int drc_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + AudioDRCContext *s = ctx->priv; + AVFrame *in = s->in; + AVFrame *out = arg; + const int start = (out->ch_layout.nb_channels * jobnr) / nb_jobs; + const int end = (out->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; + + for (int ch = start; ch < end; ch++) + drc_channel(ctx, in, out, ch); + + return 0; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; + AudioDRCContext *s = ctx->priv; + AVFrame *out; + int ret; + + out = ff_get_audio_buffer(outlink, s->overlap); + if (!out) { + ret = AVERROR(ENOMEM); + goto fail; + } + + s->var_values[VAR_SN] = outlink->sample_count_in; + s->var_values[VAR_T] = s->var_values[VAR_SN] * (double)1/outlink->sample_rate; + + s->in = in; + av_frame_copy_props(out, in); + ff_filter_execute(ctx, drc_channels, out, NULL, + FFMIN(outlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); + + out->pts = in->pts; + out->nb_samples = in->nb_samples; + ret = ff_filter_frame(outlink, out); +fail: + av_frame_free(&in); + s->in = NULL; + return ret < 0 ? ret : 0; +} + +static int activate(AVFilterContext *ctx) +{ + AVFilterLink *inlink = ctx->inputs[0]; + AVFilterLink *outlink = ctx->outputs[0]; + AudioDRCContext *s = ctx->priv; + AVFrame *in = NULL; + int ret = 0, status; + int64_t pts; + + ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout); + if (ret < 0) + return ret; + if (strcmp(s->channels_to_filter, "all")) + av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter); + + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + + ret = ff_inlink_consume_samples(inlink, s->overlap, s->overlap, &in); + if (ret < 0) + return ret; + + if (ret > 0) { + s->attack = expf(-1.f / (s->attack_ms * inlink->sample_rate / 1000.f)); + s->release = expf(-1.f / (s->release_ms * inlink->sample_rate / 1000.f)); + + return filter_frame(inlink, in); + } else if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { + ff_outlink_set_status(outlink, status, pts); + return 0; + } else { + if (ff_inlink_queued_samples(inlink) >= s->overlap) { + ff_filter_set_ready(ctx, 10); + } else if (ff_outlink_frame_wanted(outlink)) { + ff_inlink_request_frame(inlink); + } + return 0; + } +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + AudioDRCContext *s = ctx->priv; + + av_channel_layout_uninit(&s->ch_layout); + + av_expr_free(s->expr); + s->expr = NULL; + + av_freep(&s->window); + + av_frame_free(&s->drc_frame); + av_frame_free(&s->energy); + av_frame_free(&s->envelope); + av_frame_free(&s->factors); + av_frame_free(&s->in_buffer); + av_frame_free(&s->in_frame); + av_frame_free(&s->out_dist_frame); + av_frame_free(&s->spectrum_buf); + av_frame_free(&s->target_gain); + av_frame_free(&s->windowed_frame); + + for (int ch = 0; ch < s->channels; ch++) { + if (s->tx_ctx) + av_tx_uninit(&s->tx_ctx[ch]); + if (s->itx_ctx) + av_tx_uninit(&s->itx_ctx[ch]); + } + + av_freep(&s->tx_ctx); + av_freep(&s->itx_ctx); +} + +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, + char *res, int res_len, int flags) +{ + AudioDRCContext *s = ctx->priv; + char *old_expr_str = av_strdup(s->expr_str); + int ret; + + ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); + if (ret >= 0 && strcmp(old_expr_str, s->expr_str)) { + ret = av_expr_parse(&s->expr, s->expr_str, var_names, NULL, NULL, + NULL, NULL, 0, ctx); + } + av_free(old_expr_str); + return ret; +} + +static const AVFilterPad inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .config_props = config_input, + }, +}; + +static const AVFilterPad outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + }, +}; + +const AVFilter ff_af_adrc = { + .name = "adrc", + .description = NULL_IF_CONFIG_SMALL("Audio Spectral Dynamic Range Controller."), + .priv_size = sizeof(AudioDRCContext), + .priv_class = &adrc_class, + .uninit = uninit, + FILTER_INPUTS(inputs), + FILTER_OUTPUTS(outputs), + FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_FLTP), + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | + AVFILTER_FLAG_SLICE_THREADS, + .activate = activate, + .process_command = process_command, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adynamicequalizer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adynamicequalizer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adynamicequalizer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_adynamicequalizer.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,13 +34,13 @@ double ratio; double range; double makeup; - double knee; - double slew; double attack; double release; double attack_coef; double release_coef; int mode; + int direction; + int detection; int type; AVFrame *state; @@ -55,6 +55,12 @@ if (!s->state) return AVERROR(ENOMEM); + for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { + double *state = (double *)s->state->extended_data[ch]; + + state[4] = 1.; + } + return 0; } @@ -71,69 +77,6 @@ return m[0] * v0 + m[1] * v1 + m[2] * v2; } -static inline double from_dB(double x) -{ - return exp(0.05 * x * M_LN10); -} - -static inline double to_dB(double x) -{ - return 20. * log10(x); -} - -static inline double sqr(double x) -{ - return x * x; -} - -static double get_gain(double in, double srate, double makeup, - double aattack, double iratio, double knee, double range, - double thresdb, double slewfactor, double *state, - double attack_coeff, double release_coeff, double nc) -{ - double width = (6. * knee) + 0.01; - double cdb = 0.; - double Lgain = 1.; - double Lxg, Lxl, Lyg, Lyl, Ly1; - double checkwidth = 0.; - double slewwidth = 1.8; - int attslew = 0; - - Lyg = 0.; - Lxg = to_dB(fabs(in) + DBL_EPSILON); - - Lyg = Lxg + (iratio - 1.) * sqr(Lxg - thresdb + width * .5) / (2. * width); - - checkwidth = 2. * fabs(Lxg - thresdb); - if (2. * (Lxg - thresdb) < -width) { - Lyg = Lxg; - } else if (checkwidth <= width) { - Lyg = thresdb + (Lxg - thresdb) * iratio; - if (checkwidth <= slewwidth) { - if (Lyg >= state[2]) - attslew = 1; - } - } else if (2. * (Lxg - thresdb) > width) { - Lyg = thresdb + (Lxg - thresdb) * iratio; - } - - attack_coeff = attslew ? aattack : attack_coeff; - - Lxl = Lxg - Lyg; - - Ly1 = fmax(Lxl, release_coeff * state[1] +(1. - release_coeff) * Lxl); - Lyl = attack_coeff * state[0] + (1. - attack_coeff) * Ly1; - - cdb = -Lyl; - Lgain = from_dB(nc * fmin(cdb - makeup, range)); - - state[0] = Lyl; - state[1] = Ly1; - state[2] = Lyg; - - return Lgain; -} - typedef struct ThreadData { AVFrame *in, *out; } ThreadData; @@ -146,25 +89,24 @@ AVFrame *out = td->out; const double sample_rate = in->sample_rate; const double makeup = s->makeup; - const double iratio = 1. / s->ratio; + const double ratio = s->ratio; const double range = s->range; const double dfrequency = fmin(s->dfrequency, sample_rate * 0.5); const double tfrequency = fmin(s->tfrequency, sample_rate * 0.5); - const double threshold = to_dB(s->threshold + DBL_EPSILON); const double release = s->release_coef; + const double irelease = 1. - release; const double attack = s->attack_coef; + const double iattack = 1. - attack; const double dqfactor = s->dqfactor; const double tqfactor = s->tqfactor; const double fg = tan(M_PI * tfrequency / sample_rate); const double dg = tan(M_PI * dfrequency / sample_rate); const int start = (in->ch_layout.nb_channels * jobnr) / nb_jobs; const int end = (in->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; + const int detection = s->detection; + const int direction = s->direction; const int mode = s->mode; const int type = s->type; - const double knee = s->knee; - const double slew = s->slew; - const double aattack = exp(-1000. / ((s->attack + 2.0 * (slew - 1.)) * sample_rate)); - const double nc = mode == 0 ? 1. : -1.; double da[3], dm[3]; { @@ -175,7 +117,7 @@ da[2] = dg * da[1]; dm[0] = 0.; - dm[1] = 1.; + dm[1] = k; dm[2] = 0.; } @@ -183,6 +125,10 @@ const double *src = (const double *)in->extended_data[ch]; double *dst = (double *)out->extended_data[ch]; double *state = (double *)s->state->extended_data[ch]; + const double threshold = detection == 0 ? state[5] : s->threshold; + + if (detection < 0) + state[5] = threshold; for (int n = 0; n < out->nb_samples; n++) { double detect, gain, v, listen; @@ -192,46 +138,74 @@ detect = listen = get_svf(src[n], dm, da, state); detect = fabs(detect); - gain = get_gain(detect, sample_rate, makeup, - aattack, iratio, knee, range, threshold, slew, - &state[4], attack, release, nc); - - switch (type) { - case 0: - k = 1. / (tqfactor * gain); - - fa[0] = 1. / (1. + fg * (fg + k)); - fa[1] = fg * fa[0]; - fa[2] = fg * fa[1]; - - fm[0] = 1.; - fm[1] = k * (gain * gain - 1.); - fm[2] = 0.; - break; - case 1: - k = 1. / tqfactor; - g = fg / sqrt(gain); - - fa[0] = 1. / (1. + g * (g + k)); - fa[1] = g * fa[0]; - fa[2] = g * fa[1]; - - fm[0] = 1.; - fm[1] = k * (gain - 1.); - fm[2] = gain * gain - 1.; - break; - case 2: - k = 1. / tqfactor; - g = fg / sqrt(gain); - - fa[0] = 1. / (1. + g * (g + k)); - fa[1] = g * fa[0]; - fa[2] = g * fa[1]; - - fm[0] = gain * gain; - fm[1] = k * (1. - gain) * gain; - fm[2] = 1. - gain * gain; - break; + if (detection > 0) + state[5] = fmax(state[5], detect); + + if (direction == 0 && mode == 0 && detect < threshold) + detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range); + else if (direction == 0 && mode == 1 && detect < threshold) + detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range); + else if (direction == 1 && mode == 0 && detect > threshold) + detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range); + else if (direction == 1 && mode == 1 && detect > threshold) + detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range); + else + detect = 1.; + + if (direction == 0) { + if (detect > state[4]) { + detect = iattack * detect + attack * state[4]; + } else { + detect = irelease * detect + release * state[4]; + } + } else { + if (detect < state[4]) { + detect = iattack * detect + attack * state[4]; + } else { + detect = irelease * detect + release * state[4]; + } + } + + if (state[4] != detect || n == 0) { + state[4] = gain = detect; + + switch (type) { + case 0: + k = 1. / (tqfactor * gain); + + fa[0] = 1. / (1. + fg * (fg + k)); + fa[1] = fg * fa[0]; + fa[2] = fg * fa[1]; + + fm[0] = 1.; + fm[1] = k * (gain * gain - 1.); + fm[2] = 0.; + break; + case 1: + k = 1. / tqfactor; + g = fg / sqrt(gain); + + fa[0] = 1. / (1. + g * (g + k)); + fa[1] = g * fa[0]; + fa[2] = g * fa[1]; + + fm[0] = 1.; + fm[1] = k * (gain - 1.); + fm[2] = gain * gain - 1.; + break; + case 2: + k = 1. / tqfactor; + g = fg / sqrt(gain); + + fa[0] = 1. / (1. + g * (g + k)); + fa[1] = g * fa[0]; + fa[2] = g * fa[1]; + + fm[0] = gain * gain; + fm[1] = k * (1. - gain) * gain; + fm[2] = 1. - gain * gain; + break; + } } v = get_svf(src[n], fm, fa, &state[2]); @@ -298,11 +272,9 @@ { "tqfactor", "set target Q factor", OFFSET(tqfactor), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.001, 1000, FLAGS }, { "attack", "set attack duration", OFFSET(attack), AV_OPT_TYPE_DOUBLE, {.dbl=20}, 1, 2000, FLAGS }, { "release", "set release duration", OFFSET(release), AV_OPT_TYPE_DOUBLE, {.dbl=200}, 1, 2000, FLAGS }, - { "knee", "set knee factor", OFFSET(knee), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 8, FLAGS }, - { "ratio", "set ratio factor", OFFSET(ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 20, FLAGS }, - { "makeup", "set makeup gain", OFFSET(makeup), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 30, FLAGS }, - { "range", "set max gain", OFFSET(range), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 200, FLAGS }, - { "slew", "set slew factor", OFFSET(slew), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 200, FLAGS }, + { "ratio", "set ratio factor", OFFSET(ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 30, FLAGS }, + { "makeup", "set makeup gain", OFFSET(makeup), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 100, FLAGS }, + { "range", "set max gain", OFFSET(range), AV_OPT_TYPE_DOUBLE, {.dbl=50}, 1, 200, FLAGS }, { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, -1, 1, FLAGS, "mode" }, { "listen", 0, 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, "mode" }, { "cut", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode" }, @@ -311,6 +283,13 @@ { "bell", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "type" }, { "lowshelf", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "type" }, { "highshelf",0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "type" }, + { "direction", "set direction", OFFSET(direction), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "direction" }, + { "downward", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "direction" }, + { "upward", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "direction" }, + { "auto", "set auto threshold", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=-1}, -1, 1, FLAGS, "auto" }, + { "disabled", 0, 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, FLAGS, "auto" }, + { "off", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "auto" }, + { "on", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "auto" }, { NULL } }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afade.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afade.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afade.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afade.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,6 +39,8 @@ int64_t start_sample; int64_t duration; int64_t start_time; + double silence; + double unity; int overlap; int cf0_eof; int crossfade_is_over; @@ -46,7 +48,10 @@ void (*fade_samples)(uint8_t **dst, uint8_t * const *src, int nb_samples, int channels, int direction, - int64_t start, int64_t range, int curve); + int64_t start, int64_t range, int curve, + double silence, double unity); + void (*scale_samples)(uint8_t **dst, uint8_t * const *src, + int nb_samples, int channels, double unity); void (*crossfade_samples)(uint8_t **dst, uint8_t * const *cf0, uint8_t * const *cf1, int nb_samples, int channels, @@ -67,7 +72,7 @@ AV_SAMPLE_FMT_NONE }; -static double fade_gain(int curve, int64_t index, int64_t range) +static double fade_gain(int curve, int64_t index, int64_t range, double silence, double unity) { #define CUBE(a) ((a)*(a)*(a)) double gain; @@ -142,18 +147,19 @@ break; } - return gain; + return silence + (unity - silence) * gain; } #define FADE_PLANAR(name, type) \ static void fade_samples_## name ##p(uint8_t **dst, uint8_t * const *src, \ int nb_samples, int channels, int dir, \ - int64_t start, int64_t range, int curve) \ + int64_t start, int64_t range,int curve,\ + double silence, double unity) \ { \ int i, c; \ \ for (i = 0; i < nb_samples; i++) { \ - double gain = fade_gain(curve, start + i * dir, range); \ + double gain = fade_gain(curve, start + i * dir,range,silence,unity);\ for (c = 0; c < channels; c++) { \ type *d = (type *)dst[c]; \ const type *s = (type *)src[c]; \ @@ -166,14 +172,15 @@ #define FADE(name, type) \ static void fade_samples_## name (uint8_t **dst, uint8_t * const *src, \ int nb_samples, int channels, int dir, \ - int64_t start, int64_t range, int curve) \ + int64_t start, int64_t range, int curve, \ + double silence, double unity) \ { \ type *d = (type *)dst[0]; \ const type *s = (type *)src[0]; \ int i, c, k = 0; \ \ for (i = 0; i < nb_samples; i++) { \ - double gain = fade_gain(curve, start + i * dir, range); \ + double gain = fade_gain(curve, start + i * dir,range,silence,unity);\ for (c = 0; c < channels; c++, k++) \ d[k] = s[k] * gain; \ } \ @@ -189,20 +196,77 @@ FADE(s16, int16_t) FADE(s32, int32_t) +#define SCALE_PLANAR(name, type) \ +static void scale_samples_## name ##p(uint8_t **dst, uint8_t * const *src, \ + int nb_samples, int channels, \ + double gain) \ +{ \ + int i, c; \ + \ + for (i = 0; i < nb_samples; i++) { \ + for (c = 0; c < channels; c++) { \ + type *d = (type *)dst[c]; \ + const type *s = (type *)src[c]; \ + \ + d[i] = s[i] * gain; \ + } \ + } \ +} + +#define SCALE(name, type) \ +static void scale_samples_## name (uint8_t **dst, uint8_t * const *src, \ + int nb_samples, int channels, double gain)\ +{ \ + type *d = (type *)dst[0]; \ + const type *s = (type *)src[0]; \ + int i, c, k = 0; \ + \ + for (i = 0; i < nb_samples; i++) { \ + for (c = 0; c < channels; c++, k++) \ + d[k] = s[k] * gain; \ + } \ +} + +SCALE_PLANAR(dbl, double) +SCALE_PLANAR(flt, float) +SCALE_PLANAR(s16, int16_t) +SCALE_PLANAR(s32, int32_t) + +SCALE(dbl, double) +SCALE(flt, float) +SCALE(s16, int16_t) +SCALE(s32, int32_t) + static int config_output(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; AudioFadeContext *s = ctx->priv; switch (outlink->format) { - case AV_SAMPLE_FMT_DBL: s->fade_samples = fade_samples_dbl; break; - case AV_SAMPLE_FMT_DBLP: s->fade_samples = fade_samples_dblp; break; - case AV_SAMPLE_FMT_FLT: s->fade_samples = fade_samples_flt; break; - case AV_SAMPLE_FMT_FLTP: s->fade_samples = fade_samples_fltp; break; - case AV_SAMPLE_FMT_S16: s->fade_samples = fade_samples_s16; break; - case AV_SAMPLE_FMT_S16P: s->fade_samples = fade_samples_s16p; break; - case AV_SAMPLE_FMT_S32: s->fade_samples = fade_samples_s32; break; - case AV_SAMPLE_FMT_S32P: s->fade_samples = fade_samples_s32p; break; + case AV_SAMPLE_FMT_DBL: s->fade_samples = fade_samples_dbl; + s->scale_samples = scale_samples_dbl; + break; + case AV_SAMPLE_FMT_DBLP: s->fade_samples = fade_samples_dblp; + s->scale_samples = scale_samples_dblp; + break; + case AV_SAMPLE_FMT_FLT: s->fade_samples = fade_samples_flt; + s->scale_samples = scale_samples_flt; + break; + case AV_SAMPLE_FMT_FLTP: s->fade_samples = fade_samples_fltp; + s->scale_samples = scale_samples_fltp; + break; + case AV_SAMPLE_FMT_S16: s->fade_samples = fade_samples_s16; + s->scale_samples = scale_samples_s16; + break; + case AV_SAMPLE_FMT_S16P: s->fade_samples = fade_samples_s16p; + s->scale_samples = scale_samples_s16p; + break; + case AV_SAMPLE_FMT_S32: s->fade_samples = fade_samples_s32; + s->scale_samples = scale_samples_s32; + break; + case AV_SAMPLE_FMT_S32P: s->fade_samples = fade_samples_s32p; + s->scale_samples = scale_samples_s32p; + break; } if (s->duration) @@ -252,6 +316,8 @@ { "losi", "logistic sigmoid", 0, AV_OPT_TYPE_CONST, {.i64 = LOSI }, 0, 0, TFLAGS, "curve" }, { "sinc", "sine cardinal function", 0, AV_OPT_TYPE_CONST, {.i64 = SINC }, 0, 0, TFLAGS, "curve" }, { "isinc", "inverted sine cardinal function", 0, AV_OPT_TYPE_CONST, {.i64 = ISINC}, 0, 0, TFLAGS, "curve" }, + { "silence", "set the silence gain", OFFSET(silence), AV_OPT_TYPE_DOUBLE, {.dbl = 0 }, 0, 1, TFLAGS }, + { "unity", "set the unity gain", OFFSET(unity), AV_OPT_TYPE_DOUBLE, {.dbl = 1 }, 0, 1, TFLAGS }, { NULL } }; @@ -275,8 +341,9 @@ AVFrame *out_buf; int64_t cur_sample = av_rescale_q(buf->pts, inlink->time_base, (AVRational){1, inlink->sample_rate}); - if ((!s->type && (s->start_sample + s->nb_samples < cur_sample)) || - ( s->type && (cur_sample + nb_samples < s->start_sample))) + if (s->unity == 1.0 && + ((!s->type && (s->start_sample + s->nb_samples < cur_sample)) || + ( s->type && (cur_sample + nb_samples < s->start_sample)))) return ff_filter_frame(outlink, buf); if (av_frame_is_writable(buf)) { @@ -290,8 +357,19 @@ if ((!s->type && (cur_sample + nb_samples < s->start_sample)) || ( s->type && (s->start_sample + s->nb_samples < cur_sample))) { - av_samples_set_silence(out_buf->extended_data, 0, nb_samples, - out_buf->ch_layout.nb_channels, out_buf->format); + if (s->silence == 0.) { + av_samples_set_silence(out_buf->extended_data, 0, nb_samples, + out_buf->ch_layout.nb_channels, out_buf->format); + } else { + s->scale_samples(out_buf->extended_data, buf->extended_data, + nb_samples, buf->ch_layout.nb_channels, + s->silence); + } + } else if (( s->type && (cur_sample + nb_samples < s->start_sample)) || + (!s->type && (s->start_sample + s->nb_samples < cur_sample))) { + s->scale_samples(out_buf->extended_data, buf->extended_data, + nb_samples, buf->ch_layout.nb_channels, + s->unity); } else { int64_t start; @@ -303,7 +381,7 @@ s->fade_samples(out_buf->extended_data, buf->extended_data, nb_samples, buf->ch_layout.nb_channels, s->type ? -1 : 1, start, - s->nb_samples, s->curve); + s->nb_samples, s->curve, s->silence, s->unity); } if (buf != out_buf) @@ -402,8 +480,8 @@ int i, c; \ \ for (i = 0; i < nb_samples; i++) { \ - double gain0 = fade_gain(curve0, nb_samples - 1 - i, nb_samples); \ - double gain1 = fade_gain(curve1, i, nb_samples); \ + double gain0 = fade_gain(curve0, nb_samples - 1 - i, nb_samples,0.,1.);\ + double gain1 = fade_gain(curve1, i, nb_samples, 0., 1.); \ for (c = 0; c < channels; c++) { \ type *d = (type *)dst[c]; \ const type *s0 = (type *)cf0[c]; \ @@ -426,8 +504,8 @@ int i, c, k = 0; \ \ for (i = 0; i < nb_samples; i++) { \ - double gain0 = fade_gain(curve0, nb_samples - 1 - i, nb_samples); \ - double gain1 = fade_gain(curve1, i, nb_samples); \ + double gain0 = fade_gain(curve0, nb_samples - 1-i,nb_samples,0.,1.);\ + double gain1 = fade_gain(curve1, i, nb_samples, 0., 1.); \ for (c = 0; c < channels; c++, k++) \ d[k] = s0[k] * gain0 + s1[k] * gain1; \ } \ @@ -525,7 +603,7 @@ } s->fade_samples(out->extended_data, cf[0]->extended_data, s->nb_samples, - outlink->ch_layout.nb_channels, -1, s->nb_samples - 1, s->nb_samples, s->curve); + outlink->ch_layout.nb_channels, -1, s->nb_samples - 1, s->nb_samples, s->curve, 0., 1.); out->pts = s->pts; s->pts += av_rescale_q(s->nb_samples, (AVRational){ 1, outlink->sample_rate }, outlink->time_base); @@ -545,7 +623,7 @@ } s->fade_samples(out->extended_data, cf[1]->extended_data, s->nb_samples, - outlink->ch_layout.nb_channels, 1, 0, s->nb_samples, s->curve2); + outlink->ch_layout.nb_channels, 1, 0, s->nb_samples, s->curve2, 0., 1.); out->pts = s->pts; s->pts += av_rescale_q(s->nb_samples, (AVRational){ 1, outlink->sample_rate }, outlink->time_base); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftdn.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftdn.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftdn.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftdn.c 2023-03-03 13:29:59.000000000 +0000 @@ -81,8 +81,8 @@ double *abs_var; double *rel_var; double *min_abs_var; - float *fft_in; - AVComplexFloat *fft_out; + void *fft_in; + void *fft_out; AVTXContext *fft, *ifft; av_tx_fn tx_fn, itx_fn; @@ -105,6 +105,10 @@ typedef struct AudioFFTDeNoiseContext { const AVClass *class; + int format; + size_t sample_size; + size_t complex_sample_size; + float noise_reduction; float noise_floor; int noise_type; @@ -347,7 +351,6 @@ static void process_frame(AVFilterContext *ctx, AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch, - AVComplexFloat *fft_data, double *prior, double *prior_band_excit, int track_noise) { AVFilterLink *outlink = ctx->outputs[0]; @@ -359,12 +362,22 @@ double *band_excit = dnch->band_excit; double *band_amt = dnch->band_amt; double *smoothed_gain = dnch->smoothed_gain; + AVComplexDouble *fft_data_dbl = dnch->fft_out; + AVComplexFloat *fft_data_flt = dnch->fft_out; double *gain = dnch->gain; for (int i = 0; i < s->bin_count; i++) { double sqr_new_gain, new_gain, power, mag, mag_abs_var, new_mag_abs_var; - noisy_data[i] = mag = hypot(fft_data[i].re, fft_data[i].im); + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + noisy_data[i] = mag = hypot(fft_data_flt[i].re, fft_data_flt[i].im); + break; + case AV_SAMPLE_FMT_DBLP: + noisy_data[i] = mag = hypot(fft_data_dbl[i].re, fft_data_dbl[i].im); + break; + } + power = mag * mag; mag_abs_var = power / abs_var[i]; new_mag_abs_var = ratio * prior[i] + rratio * fmax(mag_abs_var - 1.0, 0.0); @@ -446,11 +459,23 @@ } } - for (int i = 0; i < s->bin_count; i++) { - const double new_gain = smoothed_gain[i]; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int i = 0; i < s->bin_count; i++) { + const float new_gain = smoothed_gain[i]; + + fft_data_flt[i].re *= new_gain; + fft_data_flt[i].im *= new_gain; + } + break; + case AV_SAMPLE_FMT_DBLP: + for (int i = 0; i < s->bin_count; i++) { + const double new_gain = smoothed_gain[i]; - fft_data[i].re *= new_gain; - fft_data[i].im *= new_gain; + fft_data_dbl[i].re *= new_gain; + fft_data_dbl[i].im *= new_gain; + } + break; } } @@ -604,7 +629,27 @@ AVFilterContext *ctx = inlink->dst; AudioFFTDeNoiseContext *s = ctx->priv; double wscale, sar, sum, sdiv; - int i, j, k, m, n, ret; + int i, j, k, m, n, ret, tx_type; + double dscale = 1.; + float fscale = 1.f; + void *scale; + + s->format = inlink->format; + + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + s->sample_size = sizeof(float); + s->complex_sample_size = sizeof(AVComplexFloat); + tx_type = AV_TX_FLOAT_RDFT; + scale = &fscale; + break; + case AV_SAMPLE_FMT_DBLP: + s->sample_size = sizeof(double); + s->complex_sample_size = sizeof(AVComplexDouble); + tx_type = AV_TX_DOUBLE_RDFT; + scale = &dscale; + break; + } s->dnch = av_calloc(inlink->ch_layout.nb_channels, sizeof(*s->dnch)); if (!s->dnch) @@ -671,7 +716,6 @@ for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { DeNoiseChannel *dnch = &s->dnch[ch]; - float scale = 1.f; switch (s->noise_type) { case WHITE_NOISE: @@ -708,12 +752,12 @@ dnch->abs_var = av_calloc(s->bin_count, sizeof(*dnch->abs_var)); dnch->rel_var = av_calloc(s->bin_count, sizeof(*dnch->rel_var)); dnch->min_abs_var = av_calloc(s->bin_count, sizeof(*dnch->min_abs_var)); - dnch->fft_in = av_calloc(s->fft_length2, sizeof(*dnch->fft_in)); - dnch->fft_out = av_calloc(s->fft_length2 + 1, sizeof(*dnch->fft_out)); - ret = av_tx_init(&dnch->fft, &dnch->tx_fn, AV_TX_FLOAT_RDFT, 0, s->fft_length2, &scale, 0); + dnch->fft_in = av_calloc(s->fft_length2, s->sample_size); + dnch->fft_out = av_calloc(s->fft_length2 + 1, s->complex_sample_size); + ret = av_tx_init(&dnch->fft, &dnch->tx_fn, tx_type, 0, s->fft_length2, scale, 0); if (ret < 0) return ret; - ret = av_tx_init(&dnch->ifft, &dnch->itx_fn, AV_TX_FLOAT_RDFT, 1, s->fft_length2, &scale, 0); + ret = av_tx_init(&dnch->ifft, &dnch->itx_fn, tx_type, 1, s->fft_length2, scale, 0); if (ret < 0) return ret; dnch->spread_function = av_calloc(s->number_of_bands * s->number_of_bands, @@ -861,17 +905,33 @@ DeNoiseChannel *dnch, AVFrame *in, int ch) { - float *src = (float *)in->extended_data[ch]; + double *src_dbl = (double *)in->extended_data[ch]; + float *src_flt = (float *)in->extended_data[ch]; double mag2, var = 0.0, avr = 0.0, avi = 0.0; + AVComplexDouble *fft_out_dbl = dnch->fft_out; + AVComplexFloat *fft_out_flt = dnch->fft_out; + double *fft_in_dbl = dnch->fft_in; + float *fft_in_flt = dnch->fft_in; int edge, j, k, n, edgemax; - for (int i = 0; i < s->window_length; i++) - dnch->fft_in[i] = s->window[i] * src[i] * (1LL << 23); - - for (int i = s->window_length; i < s->fft_length2; i++) - dnch->fft_in[i] = 0.0; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int i = 0; i < s->window_length; i++) + fft_in_flt[i] = s->window[i] * src_flt[i] * (1LL << 23); + + for (int i = s->window_length; i < s->fft_length2; i++) + fft_in_flt[i] = 0.f; + break; + case AV_SAMPLE_FMT_DBLP: + for (int i = 0; i < s->window_length; i++) + fft_in_dbl[i] = s->window[i] * src_dbl[i] * (1LL << 23); + + for (int i = s->window_length; i < s->fft_length2; i++) + fft_in_dbl[i] = 0.; + break; + } - dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, sizeof(float)); + dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size); edge = s->noise_band_edge[0]; j = edge; @@ -896,10 +956,21 @@ avr = 0.0; avi = 0.0; } - avr += dnch->fft_out[n].re; - avi += dnch->fft_out[n].im; - mag2 = dnch->fft_out[n].re * dnch->fft_out[n].re + - dnch->fft_out[n].im * dnch->fft_out[n].im; + + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + avr += fft_out_flt[n].re; + avi += fft_out_flt[n].im; + mag2 = fft_out_flt[n].re * fft_out_flt[n].re + + fft_out_flt[n].im * fft_out_flt[n].im; + break; + case AV_SAMPLE_FMT_DBLP: + avr += fft_out_dbl[n].re; + avi += fft_out_dbl[n].im; + mag2 = fft_out_dbl[n].re * fft_out_dbl[n].re + + fft_out_dbl[n].im * fft_out_dbl[n].im; + break; + } mag2 = fmax(mag2, s->sample_floor); @@ -980,27 +1051,48 @@ for (int ch = start; ch < end; ch++) { DeNoiseChannel *dnch = &s->dnch[ch]; - const float *src = (const float *)in->extended_data[ch]; + const double *src_dbl = (const double *)in->extended_data[ch]; + const float *src_flt = (const float *)in->extended_data[ch]; double *dst = dnch->out_samples; - float *fft_in = dnch->fft_in; + double *fft_in_dbl = dnch->fft_in; + float *fft_in_flt = dnch->fft_in; - for (int m = 0; m < window_length; m++) - fft_in[m] = window[m] * src[m] * (1LL << 23); + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int m = 0; m < window_length; m++) + fft_in_flt[m] = window[m] * src_flt[m] * (1LL << 23); - for (int m = window_length; m < s->fft_length2; m++) - fft_in[m] = 0; + for (int m = window_length; m < s->fft_length2; m++) + fft_in_flt[m] = 0.f; + break; + case AV_SAMPLE_FMT_DBLP: + for (int m = 0; m < window_length; m++) + fft_in_dbl[m] = window[m] * src_dbl[m] * (1LL << 23); - dnch->tx_fn(dnch->fft, dnch->fft_out, fft_in, sizeof(float)); + for (int m = window_length; m < s->fft_length2; m++) + fft_in_dbl[m] = 0.; + break; + } - process_frame(ctx, s, dnch, dnch->fft_out, + dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size); + + process_frame(ctx, s, dnch, dnch->prior, dnch->prior_band_excit, s->track_noise); - dnch->itx_fn(dnch->ifft, fft_in, dnch->fft_out, sizeof(float)); + dnch->itx_fn(dnch->ifft, dnch->fft_in, dnch->fft_out, s->complex_sample_size); - for (int m = 0; m < window_length; m++) - dst[m] += s->window[m] * fft_in[m] / (1LL << 23); + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int m = 0; m < window_length; m++) + dst[m] += s->window[m] * fft_in_flt[m] / (1LL << 23); + break; + case AV_SAMPLE_FMT_DBLP: + for (int m = 0; m < window_length; m++) + dst[m] += s->window[m] * fft_in_dbl[m] / (1LL << 23); + break; + } } return 0; @@ -1016,11 +1108,14 @@ AVFrame *out; for (int ch = 0; ch < s->channels; ch++) { - float *src = (float *)s->winframe->extended_data[ch]; + uint8_t *src = (uint8_t *)s->winframe->extended_data[ch]; - memmove(src, &src[s->sample_advance], offset * sizeof(float)); - memcpy(&src[offset], in->extended_data[ch], in->nb_samples * sizeof(float)); - memset(&src[offset + in->nb_samples], 0, (s->sample_advance - in->nb_samples) * sizeof(float)); + memmove(src, src + s->sample_advance * s->sample_size, + offset * s->sample_size); + memcpy(src + offset * s->sample_size, in->extended_data[ch], + in->nb_samples * s->sample_size); + memset(src + s->sample_size * (offset + in->nb_samples), 0, + (s->sample_advance - in->nb_samples) * s->sample_size); } if (s->track_noise) { @@ -1101,27 +1196,53 @@ return AVERROR(ENOMEM); } - out->pts = in->pts; + av_frame_copy_props(out, in); } for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { DeNoiseChannel *dnch = &s->dnch[ch]; double *src = dnch->out_samples; - const float *orig = (const float *)s->winframe->extended_data[ch]; - float *dst = (float *)out->extended_data[ch]; + const double *orig_dbl = (const double *)s->winframe->extended_data[ch]; + const float *orig_flt = (const float *)s->winframe->extended_data[ch]; + double *dst_dbl = (double *)out->extended_data[ch]; + float *dst_flt = (float *)out->extended_data[ch]; switch (output_mode) { case IN_MODE: - for (int m = 0; m < out->nb_samples; m++) - dst[m] = orig[m]; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int m = 0; m < out->nb_samples; m++) + dst_flt[m] = orig_flt[m]; + break; + case AV_SAMPLE_FMT_DBLP: + for (int m = 0; m < out->nb_samples; m++) + dst_dbl[m] = orig_dbl[m]; + break; + } break; case OUT_MODE: - for (int m = 0; m < out->nb_samples; m++) - dst[m] = src[m]; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int m = 0; m < out->nb_samples; m++) + dst_flt[m] = src[m]; + break; + case AV_SAMPLE_FMT_DBLP: + for (int m = 0; m < out->nb_samples; m++) + dst_dbl[m] = src[m]; + break; + } break; case NOISE_MODE: - for (int m = 0; m < out->nb_samples; m++) - dst[m] = orig[m] - src[m]; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + for (int m = 0; m < out->nb_samples; m++) + dst_flt[m] = orig_flt[m] - src[m]; + break; + case AV_SAMPLE_FMT_DBLP: + for (int m = 0; m < out->nb_samples; m++) + dst_dbl[m] = orig_dbl[m] - src[m]; + break; + } break; default: if (in != out) @@ -1129,6 +1250,7 @@ av_frame_free(&out); return AVERROR_BUG; } + memmove(src, src + s->sample_advance, (s->window_length - s->sample_advance) * sizeof(*src)); memset(src + (s->window_length - s->sample_advance), 0, s->sample_advance * sizeof(*src)); } @@ -1251,7 +1373,7 @@ .uninit = uninit, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_FLTP), + FILTER_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP), .process_command = process_command, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftfilt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftfilt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftfilt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afftfilt.c 2023-03-03 13:29:59.000000000 +0000 @@ -240,7 +240,7 @@ AVComplexFloat *fft_in = s->fft_in[ch]; AVComplexFloat *fft_out = s->fft_out[ch]; - s->tx_fn(s->fft[ch], fft_out, fft_in, sizeof(float)); + s->tx_fn(s->fft[ch], fft_out, fft_in, sizeof(*fft_in)); } return 0; @@ -292,7 +292,7 @@ } } - s->itx_fn(s->ifft[ch], fft_out, fft_temp, sizeof(float)); + s->itx_fn(s->ifft[ch], fft_out, fft_temp, sizeof(*fft_temp)); memmove(buf, buf + s->hop_size, window_size * sizeof(float)); for (int i = 0; i < window_size; i++) @@ -345,7 +345,7 @@ goto fail; } - out->pts = in->pts; + av_frame_copy_props(out, in); out->nb_samples = in->nb_samples; for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include +#include "libavutil/cpu.h" #include "libavutil/tx.h" #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" @@ -104,8 +105,9 @@ static int fir_channel(AVFilterContext *ctx, AVFrame *out, int ch) { AudioFIRContext *s = ctx->priv; + const int min_part_size = s->min_part_size; - for (int offset = 0; offset < out->nb_samples; offset += s->min_part_size) { + for (int offset = 0; offset < out->nb_samples; offset += min_part_size) { switch (s->format) { case AV_SAMPLE_FMT_FLTP: fir_quantum_float(ctx, out, ch, offset); @@ -125,9 +127,8 @@ const int start = (out->ch_layout.nb_channels * jobnr) / nb_jobs; const int end = (out->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; - for (int ch = start; ch < end; ch++) { + for (int ch = start; ch < end; ch++) fir_channel(ctx, out, ch); - } return 0; } @@ -135,14 +136,15 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; - AVFrame *out = NULL; + AVFrame *out; out = ff_get_audio_buffer(outlink, in->nb_samples); if (!out) { av_frame_free(&in); return AVERROR(ENOMEM); } - out->pts = in->pts; + av_frame_copy_props(out, in); + out->pts = s->pts = in->pts; s->in = in; ff_filter_execute(ctx, fir_channels, out, NULL, @@ -154,57 +156,76 @@ return ff_filter_frame(outlink, out); } -static int init_segment(AVFilterContext *ctx, AudioFIRSegment *seg, - int offset, int nb_partitions, int part_size) +static int init_segment(AVFilterContext *ctx, AudioFIRSegment *seg, int selir, + int offset, int nb_partitions, int part_size, int index) { AudioFIRContext *s = ctx->priv; + const size_t cpu_align = av_cpu_max_align(); + union { double d; float f; } cscale, scale, iscale; + enum AVTXType tx_type; + int ret; seg->tx = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->tx)); + seg->ctx = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->ctx)); seg->itx = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->itx)); - if (!seg->tx || !seg->itx) + if (!seg->tx || !seg->ctx || !seg->itx) return AVERROR(ENOMEM); - seg->fft_length = part_size * 2 + 1; + seg->fft_length = (part_size + 1) * 2; seg->part_size = part_size; - seg->block_size = FFALIGN(seg->fft_length, 32); - seg->coeff_size = FFALIGN(seg->part_size + 1, 32); + seg->block_size = FFALIGN(seg->fft_length, cpu_align); + seg->coeff_size = FFALIGN(seg->part_size + 1, cpu_align); seg->nb_partitions = nb_partitions; seg->input_size = offset + s->min_part_size; seg->input_offset = offset; + seg->loading = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->loading)); seg->part_index = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->part_index)); seg->output_offset = av_calloc(ctx->inputs[0]->ch_layout.nb_channels, sizeof(*seg->output_offset)); - if (!seg->part_index || !seg->output_offset) + if (!seg->part_index || !seg->output_offset || !seg->loading) return AVERROR(ENOMEM); - for (int ch = 0; ch < ctx->inputs[0]->ch_layout.nb_channels && part_size >= 8; ch++) { - double dscale = 1.0, idscale = 1.0 / part_size; - float fscale = 1.f, ifscale = 1.f / part_size; + switch (s->format) { + case AV_SAMPLE_FMT_FLTP: + cscale.f = 1.f; + scale.f = 1.f / sqrtf(2.f * part_size); + iscale.f = 1.f / sqrtf(2.f * part_size); + tx_type = AV_TX_FLOAT_RDFT; + break; + case AV_SAMPLE_FMT_DBLP: + cscale.d = 1.0; + scale.d = 1.0 / sqrt(2.0 * part_size); + iscale.d = 1.0 / sqrt(2.0 * part_size); + tx_type = AV_TX_DOUBLE_RDFT; + break; + } - switch (s->format) { - case AV_SAMPLE_FMT_FLTP: - av_tx_init(&seg->tx[ch], &seg->tx_fn, AV_TX_FLOAT_RDFT, 0, 2 * part_size, &fscale, 0); - av_tx_init(&seg->itx[ch], &seg->itx_fn, AV_TX_FLOAT_RDFT, 1, 2 * part_size, &ifscale, 0); - break; - case AV_SAMPLE_FMT_DBLP: - av_tx_init(&seg->tx[ch], &seg->tx_fn, AV_TX_DOUBLE_RDFT, 0, 2 * part_size, &dscale, 0); - av_tx_init(&seg->itx[ch], &seg->itx_fn, AV_TX_DOUBLE_RDFT, 1, 2 * part_size, &idscale, 0); - break; - } + for (int ch = 0; ch < ctx->inputs[0]->ch_layout.nb_channels && part_size >= 1; ch++) { + ret = av_tx_init(&seg->ctx[ch], &seg->ctx_fn, tx_type, + 0, 2 * part_size, &cscale, 0); + if (ret < 0) + return ret; - if (!seg->tx[ch] || !seg->itx[ch]) - return AVERROR(ENOMEM); + ret = av_tx_init(&seg->tx[ch], &seg->tx_fn, tx_type, + 0, 2 * part_size, &scale, 0); + if (ret < 0) + return ret; + ret = av_tx_init(&seg->itx[ch], &seg->itx_fn, tx_type, + 1, 2 * part_size, &iscale, 0); + if (ret < 0) + return ret; } seg->sumin = ff_get_audio_buffer(ctx->inputs[0], seg->fft_length); seg->sumout = ff_get_audio_buffer(ctx->inputs[0], seg->fft_length); - seg->blockin = ff_get_audio_buffer(ctx->inputs[0], seg->nb_partitions * seg->block_size); - seg->blockout = ff_get_audio_buffer(ctx->inputs[0], seg->nb_partitions * seg->block_size); + seg->blockout = ff_get_audio_buffer(ctx->inputs[0], seg->block_size * seg->nb_partitions); + seg->tempin = ff_get_audio_buffer(ctx->inputs[0], seg->block_size); + seg->tempout = ff_get_audio_buffer(ctx->inputs[0], seg->block_size); seg->buffer = ff_get_audio_buffer(ctx->inputs[0], seg->part_size); - seg->coeff = ff_get_audio_buffer(ctx->inputs[1 + s->selir], seg->nb_partitions * seg->coeff_size * 2); seg->input = ff_get_audio_buffer(ctx->inputs[0], seg->input_size); - seg->output = ff_get_audio_buffer(ctx->inputs[0], seg->part_size); - if (!seg->buffer || !seg->sumin || !seg->sumout || !seg->blockin || !seg->blockout || !seg->coeff || !seg->input || !seg->output) + seg->output = ff_get_audio_buffer(ctx->inputs[0], seg->part_size * 5); + if (!seg->buffer || !seg->sumin || !seg->sumout || !seg->blockout || + !seg->input || !seg->output || !seg->tempin || !seg->tempout) return AVERROR(ENOMEM); return 0; @@ -214,63 +235,73 @@ { AudioFIRContext *s = ctx->priv; + if (seg->ctx) { + for (int ch = 0; ch < s->nb_channels; ch++) + av_tx_uninit(&seg->ctx[ch]); + } + av_freep(&seg->ctx); + if (seg->tx) { - for (int ch = 0; ch < s->nb_channels; ch++) { + for (int ch = 0; ch < s->nb_channels; ch++) av_tx_uninit(&seg->tx[ch]); - } } av_freep(&seg->tx); if (seg->itx) { - for (int ch = 0; ch < s->nb_channels; ch++) { + for (int ch = 0; ch < s->nb_channels; ch++) av_tx_uninit(&seg->itx[ch]); - } } av_freep(&seg->itx); + av_freep(&seg->loading); av_freep(&seg->output_offset); av_freep(&seg->part_index); - av_frame_free(&seg->blockin); + av_frame_free(&seg->tempin); + av_frame_free(&seg->tempout); av_frame_free(&seg->blockout); av_frame_free(&seg->sumin); av_frame_free(&seg->sumout); av_frame_free(&seg->buffer); - av_frame_free(&seg->coeff); av_frame_free(&seg->input); av_frame_free(&seg->output); seg->input_size = 0; + + for (int i = 0; i < MAX_IR_STREAMS; i++) + av_frame_free(&seg->coeff[i]); } -static int convert_coeffs(AVFilterContext *ctx) +static int convert_coeffs(AVFilterContext *ctx, int selir) { AudioFIRContext *s = ctx->priv; - int ret, i, cur_nb_taps; + int ret, nb_taps, cur_nb_taps; - if (!s->nb_taps) { + if (!s->nb_taps[selir]) { int part_size, max_part_size; int left, offset = 0; - s->nb_taps = ff_inlink_queued_samples(ctx->inputs[1 + s->selir]); - if (s->nb_taps <= 0) + s->nb_taps[selir] = ff_inlink_queued_samples(ctx->inputs[1 + selir]); + if (s->nb_taps[selir] <= 0) return AVERROR(EINVAL); - if (s->minp > s->maxp) { + if (s->minp > s->maxp) s->maxp = s->minp; - } - left = s->nb_taps; + if (s->nb_segments) + goto skip; + + left = s->nb_taps[selir]; part_size = 1 << av_log2(s->minp); max_part_size = 1 << av_log2(s->maxp); s->min_part_size = part_size; - for (i = 0; left > 0; i++) { + for (int i = 0; left > 0; i++) { int step = part_size == max_part_size ? INT_MAX : 1 + (i == 0); int nb_partitions = FFMIN(step, (left + part_size - 1) / part_size); s->nb_segments = i + 1; - ret = init_segment(ctx, &s->seg[i], offset, nb_partitions, part_size); + ret = init_segment(ctx, &s->seg[i], selir, offset, nb_partitions, part_size, i); if (ret < 0) return ret; offset += nb_partitions * part_size; @@ -280,8 +311,9 @@ } } - if (!s->ir[s->selir]) { - ret = ff_inlink_consume_samples(ctx->inputs[1 + s->selir], s->nb_taps, s->nb_taps, &s->ir[s->selir]); +skip: + if (!s->ir[selir]) { + ret = ff_inlink_consume_samples(ctx->inputs[1 + selir], s->nb_taps[selir], s->nb_taps[selir], &s->ir[selir]); if (ret < 0) return ret; if (ret == 0) @@ -299,34 +331,70 @@ } } - s->gain = 1; - cur_nb_taps = s->ir[s->selir]->nb_samples; + cur_nb_taps = s->ir[selir]->nb_samples; + nb_taps = cur_nb_taps; - switch (s->format) { - case AV_SAMPLE_FMT_FLTP: - ret = get_power_float(ctx, s, cur_nb_taps); - break; - case AV_SAMPLE_FMT_DBLP: - ret = get_power_double(ctx, s, cur_nb_taps); - break; + if (!s->norm_ir[selir] || s->norm_ir[selir]->nb_samples < nb_taps) { + av_frame_free(&s->norm_ir[selir]); + s->norm_ir[selir] = ff_get_audio_buffer(ctx->inputs[0], FFALIGN(nb_taps, 8)); + if (!s->norm_ir[selir]) + return AVERROR(ENOMEM); } - if (ret < 0) - return ret; - av_log(ctx, AV_LOG_DEBUG, "nb_taps: %d\n", cur_nb_taps); av_log(ctx, AV_LOG_DEBUG, "nb_segments: %d\n", s->nb_segments); switch (s->format) { case AV_SAMPLE_FMT_FLTP: - convert_channels_float(ctx, s); + for (int ch = 0; ch < s->nb_channels; ch++) { + const float *tsrc = (const float *)s->ir[selir]->extended_data[!s->one2many * ch]; + float *time = (float *)s->norm_ir[selir]->extended_data[ch]; + + memcpy(time, tsrc, sizeof(*time) * nb_taps); + for (int i = FFMAX(1, s->length * nb_taps); i < nb_taps; i++) + time[i] = 0; + + get_power_float(ctx, s, nb_taps, ch, time); + + for (int n = 0; n < s->nb_segments; n++) { + AudioFIRSegment *seg = &s->seg[n]; + + if (!seg->coeff[selir]) + seg->coeff[selir] = ff_get_audio_buffer(ctx->inputs[0], seg->nb_partitions * seg->coeff_size * 2); + if (!seg->coeff[selir]) + return AVERROR(ENOMEM); + + for (int i = 0; i < seg->nb_partitions; i++) + convert_channel_float(ctx, s, ch, seg, i, selir); + } + } break; case AV_SAMPLE_FMT_DBLP: - convert_channels_double(ctx, s); + for (int ch = 0; ch < s->nb_channels; ch++) { + const double *tsrc = (const double *)s->ir[selir]->extended_data[!s->one2many * ch]; + double *time = (double *)s->norm_ir[selir]->extended_data[ch]; + + memcpy(time, tsrc, sizeof(*time) * nb_taps); + for (int i = FFMAX(1, s->length * nb_taps); i < nb_taps; i++) + time[i] = 0; + + get_power_double(ctx, s, nb_taps, ch, time); + for (int n = 0; n < s->nb_segments; n++) { + AudioFIRSegment *seg = &s->seg[n]; + + if (!seg->coeff[selir]) + seg->coeff[selir] = ff_get_audio_buffer(ctx->inputs[0], seg->nb_partitions * seg->coeff_size * 2); + if (!seg->coeff[selir]) + return AVERROR(ENOMEM); + + for (int i = 0; i < seg->nb_partitions; i++) + convert_channel_double(ctx, s, ch, seg, i, selir); + } + } break; } - s->have_coeffs = 1; + s->have_coeffs[selir] = 1; return 0; } @@ -375,8 +443,8 @@ } } - if (!s->have_coeffs && s->eof_coeffs[s->selir]) { - ret = convert_coeffs(ctx); + if (!s->have_coeffs[s->selir] && s->eof_coeffs[s->selir]) { + ret = convert_coeffs(ctx, s->selir); if (ret < 0) return ret; } @@ -390,7 +458,7 @@ if (ret < 0) return ret; - if (s->response && s->have_coeffs) { + if (s->response && s->have_coeffs[s->selir]) { int64_t old_pts = s->video->pts; int64_t new_pts = av_rescale_q(s->pts, ctx->inputs[0]->time_base, ctx->outputs[1]->time_base); @@ -501,9 +569,8 @@ return ret; outlink->ch_layout.nb_channels = ctx->inputs[0]->ch_layout.nb_channels; - s->nb_channels = outlink->ch_layout.nb_channels; - s->nb_coef_channels = ctx->inputs[1 + s->selir]->ch_layout.nb_channels; s->format = outlink->format; + s->nb_channels = outlink->ch_layout.nb_channels; return 0; } @@ -512,14 +579,14 @@ { AudioFIRContext *s = ctx->priv; - for (int i = 0; i < s->nb_segments; i++) { + for (int i = 0; i < s->nb_segments; i++) uninit_segment(ctx, &s->seg[i]); - } av_freep(&s->fdsp); for (int i = 0; i < s->nb_irs; i++) { av_frame_free(&s->ir[i]); + av_frame_free(&s->norm_ir[i]); } av_frame_free(&s->video); @@ -550,6 +617,8 @@ AVFilterPad pad, vpad; int ret; + s->prev_selir = FFMIN(s->nb_irs - 1, s->selir); + pad = (AVFilterPad) { .name = "main", .type = AVMEDIA_TYPE_AUDIO, @@ -612,16 +681,22 @@ int flags) { AudioFIRContext *s = ctx->priv; - int prev_ir = s->selir; - int ret = ff_filter_process_command(ctx, cmd, arg, res, res_len, flags); + int prev_selir, ret; + prev_selir = s->selir; + ret = ff_filter_process_command(ctx, cmd, arg, res, res_len, flags); if (ret < 0) return ret; s->selir = FFMIN(s->nb_irs - 1, s->selir); + if (s->selir != prev_selir) { + s->prev_selir = prev_selir; + for (int n = 0; n < s->nb_segments; n++) { + AudioFIRSegment *seg = &s->seg[n]; - if (prev_ir != s->selir) { - s->have_coeffs = 0; + for (int ch = 0; ch < s->nb_channels; ch++) + seg->loading[ch] = 0; + } } return 0; @@ -633,14 +708,16 @@ #define OFFSET(x) offsetof(AudioFIRContext, x) static const AVOption afir_options[] = { - { "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AF }, - { "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AF }, + { "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AFR }, + { "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AFR }, { "length", "set IR length", OFFSET(length), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF }, - { "gtype", "set IR auto gain type",OFFSET(gtype), AV_OPT_TYPE_INT, {.i64=0}, -1, 2, AF, "gtype" }, + { "gtype", "set IR auto gain type",OFFSET(gtype), AV_OPT_TYPE_INT, {.i64=0}, -1, 4, AF, "gtype" }, { "none", "without auto gain", 0, AV_OPT_TYPE_CONST, {.i64=-1}, 0, 0, AF, "gtype" }, { "peak", "peak gain", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "gtype" }, { "dc", "DC gain", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "gtype" }, { "gn", "gain to noise", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, AF, "gtype" }, + { "ac", "AC gain", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, AF, "gtype" }, + { "rms", "RMS gain", 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, AF, "gtype" }, { "irgain", "set IR gain", OFFSET(ir_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF }, { "irfmt", "set IR format", OFFSET(ir_format), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, AF, "irfmt" }, { "mono", "single channel", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "irfmt" }, @@ -650,8 +727,8 @@ { "channel", "set IR channel to display frequency response", OFFSET(ir_channel), AV_OPT_TYPE_INT, {.i64=0}, 0, 1024, VF }, { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "hd720"}, 0, 0, VF }, { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT32_MAX, VF }, - { "minp", "set min partition size", OFFSET(minp), AV_OPT_TYPE_INT, {.i64=8192}, 1, 32768, AF }, - { "maxp", "set max partition size", OFFSET(maxp), AV_OPT_TYPE_INT, {.i64=8192}, 8, 32768, AF }, + { "minp", "set min partition size", OFFSET(minp), AV_OPT_TYPE_INT, {.i64=8192}, 1, 65536, AF }, + { "maxp", "set max partition size", OFFSET(maxp), AV_OPT_TYPE_INT, {.i64=8192}, 8, 65536, AF }, { "nbirs", "set number of input IRs",OFFSET(nb_irs),AV_OPT_TYPE_INT, {.i64=1}, 1, 32, AF }, { "ir", "select IR", OFFSET(selir), AV_OPT_TYPE_INT, {.i64=0}, 0, 31, AFR }, { "precision", "set processing precision", OFFSET(precision), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, AF, "precision" }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_afir.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,8 @@ #include "avfilter.h" #include "af_afirdsp.h" +#define MAX_IR_STREAMS 32 + typedef struct AudioFIRSegment { int nb_partitions; int part_size; @@ -37,20 +39,22 @@ int input_size; int input_offset; + int *loading; int *output_offset; int *part_index; AVFrame *sumin; AVFrame *sumout; - AVFrame *blockin; AVFrame *blockout; + AVFrame *tempin; + AVFrame *tempout; AVFrame *buffer; - AVFrame *coeff; + AVFrame *coeff[MAX_IR_STREAMS]; AVFrame *input; AVFrame *output; - AVTXContext **tx, **itx; - av_tx_fn tx_fn, itx_fn; + AVTXContext **ctx, **tx, **itx; + av_tx_fn ctx_fn, tx_fn, itx_fn; } AudioFIRSegment; typedef struct AudioFIRContext { @@ -70,24 +74,23 @@ int minp; int maxp; int nb_irs; + int prev_selir; int selir; int precision; int format; - double gain; - - int eof_coeffs[32]; - int have_coeffs; - int nb_taps; + int eof_coeffs[MAX_IR_STREAMS]; + int have_coeffs[MAX_IR_STREAMS]; + int nb_taps[MAX_IR_STREAMS]; int nb_channels; - int nb_coef_channels; int one2many; AudioFIRSegment seg[1024]; int nb_segments; AVFrame *in; - AVFrame *ir[32]; + AVFrame *ir[MAX_IR_STREAMS]; + AVFrame *norm_ir[MAX_IR_STREAMS]; AVFrame *video; int min_part_size; int64_t pts; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_alimiter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_alimiter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_alimiter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_alimiter.c 2023-03-03 13:29:59.000000000 +0000 @@ -194,10 +194,11 @@ } else { for (i = s->nextiter; i < s->nextiter + s->nextlen; i++) { int j = i % buffer_size; - double ppeak, pdelta; + double ppeak = 0, pdelta; - ppeak = fabs(buffer[nextpos[j]]) > fabs(buffer[nextpos[j] + 1]) ? - fabs(buffer[nextpos[j]]) : fabs(buffer[nextpos[j] + 1]); + for (c = 0; c < channels; c++) { + ppeak = FFMAX(ppeak, fabs(buffer[nextpos[j] + c])); + } pdelta = (limit / peak - limit / ppeak) / (((buffer_size - nextpos[j] + s->pos) % buffer_size) / channels); if (pdelta < nextdelta[j]) { nextdelta[j] = pdelta; @@ -241,14 +242,16 @@ s->delta = get_rdelta(s, release, inlink->sample_rate, peak, limit, s->att, 1); if (s->nextlen > 1) { + double ppeak = 0, pdelta; int pnextpos = nextpos[(s->nextiter + 1) % buffer_size]; - double ppeak = fabs(buffer[pnextpos]) > fabs(buffer[pnextpos + 1]) ? - fabs(buffer[pnextpos]) : - fabs(buffer[pnextpos + 1]); - double pdelta = (limit / ppeak - s->att) / - (((buffer_size + pnextpos - - ((s->pos + channels) % buffer_size)) % - buffer_size) / channels); + + for (c = 0; c < channels; c++) { + ppeak = FFMAX(ppeak, fabs(buffer[pnextpos + c])); + } + pdelta = (limit / ppeak - s->att) / + (((buffer_size + pnextpos - + ((s->pos + channels) % buffer_size)) % + buffer_size) / channels); if (pdelta < s->delta) s->delta = pdelta; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_apsyclip.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_apsyclip.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_apsyclip.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_apsyclip.c 2023-03-03 13:29:59.000000000 +0000 @@ -188,7 +188,7 @@ AudioPsyClipContext *s = ctx->priv; static const int points[][2] = { {0,14}, {125,14}, {250,16}, {500,18}, {1000,20}, {2000,20}, {4000,20}, {8000,17}, {16000,14}, {20000,-10} }; static const int num_points = 10; - float scale; + float scale = 1.f; int ret; s->fft_size = inlink->sample_rate > 100000 ? 1024 : inlink->sample_rate > 50000 ? 512 : 256; @@ -417,7 +417,7 @@ apply_window(s, in_frame, windowed_frame, 0); r2c(windowed_frame, s->fft_size); - s->tx_fn(s->tx_ctx[ch], spectrum_buf, windowed_frame, sizeof(float)); + s->tx_fn(s->tx_ctx[ch], spectrum_buf, windowed_frame, sizeof(AVComplexFloat)); c2r(windowed_frame, s->fft_size); calculate_mask_curve(s, spectrum_buf, mask_curve); @@ -447,11 +447,11 @@ clip_to_window(s, windowed_frame, clipping_delta, delta_boost); r2c(clipping_delta, s->fft_size); - s->tx_fn(s->tx_ctx[ch], spectrum_buf, clipping_delta, sizeof(float)); + s->tx_fn(s->tx_ctx[ch], spectrum_buf, clipping_delta, sizeof(AVComplexFloat)); limit_clip_spectrum(s, spectrum_buf, mask_curve); - s->itx_fn(s->itx_ctx[ch], clipping_delta, spectrum_buf, sizeof(float)); + s->itx_fn(s->itx_ctx[ch], clipping_delta, spectrum_buf, sizeof(AVComplexFloat)); c2r(clipping_delta, s->fft_size); for (int i = 0; i < s->fft_size; i++) @@ -556,6 +556,7 @@ } s->in = in; + av_frame_copy_props(out, in); ff_filter_execute(ctx, psy_channels, out, NULL, FFMIN(outlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_arnndn.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_arnndn.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_arnndn.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_arnndn.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,10 +31,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "libavutil/avassert.h" -#include "libavutil/avstring.h" +#include "libavutil/file_open.h" #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" @@ -375,14 +373,15 @@ for (int i = 0; i < s->channels; i++) { DenoiseState *st = &s->st[i]; + float scale = 1.f; if (!st->tx) - ret = av_tx_init(&st->tx, &st->tx_fn, AV_TX_FLOAT_FFT, 0, WINDOW_SIZE, NULL, 0); + ret = av_tx_init(&st->tx, &st->tx_fn, AV_TX_FLOAT_FFT, 0, WINDOW_SIZE, &scale, 0); if (ret < 0) return ret; if (!st->txi) - ret = av_tx_init(&st->txi, &st->txi_fn, AV_TX_FLOAT_FFT, 1, WINDOW_SIZE, NULL, 0); + ret = av_tx_init(&st->txi, &st->txi_fn, AV_TX_FLOAT_FFT, 1, WINDOW_SIZE, &scale, 0); if (ret < 0) return ret; } @@ -418,7 +417,7 @@ x[i].im = 0; } - st->tx_fn(st->tx, y, x, sizeof(float)); + st->tx_fn(st->tx, y, x, sizeof(AVComplexFloat)); RNN_COPY(out, y, FREQ_SIZE); } @@ -435,7 +434,7 @@ x[i].im = -x[WINDOW_SIZE - i].im; } - st->txi_fn(st->txi, y, x, sizeof(float)); + st->txi_fn(st->txi, y, x, sizeof(AVComplexFloat)); for (int i = 0; i < WINDOW_SIZE; i++) out[i] = y[i].re / WINDOW_SIZE; @@ -1438,7 +1437,7 @@ av_frame_free(&in); return AVERROR(ENOMEM); } - out->pts = in->pts; + av_frame_copy_props(out, in); td.in = in; td.out = out; ff_filter_execute(ctx, rnnoise_channels, &td, NULL, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_aspectralstats.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_aspectralstats.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_aspectralstats.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_aspectralstats.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,22 @@ #include "internal.h" #include "window_func.h" +#define MEASURE_ALL UINT_MAX +#define MEASURE_NONE 0 +#define MEASURE_MEAN (1 << 0) +#define MEASURE_VARIANCE (1 << 1) +#define MEASURE_CENTROID (1 << 2) +#define MEASURE_SPREAD (1 << 3) +#define MEASURE_SKEWNESS (1 << 4) +#define MEASURE_KURTOSIS (1 << 5) +#define MEASURE_ENTROPY (1 << 6) +#define MEASURE_FLATNESS (1 << 7) +#define MEASURE_CREST (1 << 8) +#define MEASURE_FLUX (1 << 9) +#define MEASURE_SLOPE (1 << 10) +#define MEASURE_DECREASE (1 << 11) +#define MEASURE_ROLLOFF (1 << 12) + typedef struct ChannelSpectralStats { float mean; float variance; @@ -47,6 +63,7 @@ typedef struct AudioSpectralStatsContext { const AVClass *class; + unsigned measure; int win_size; int win_func; float overlap; @@ -70,6 +87,22 @@ { "win_size", "set the window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64=2048}, 32, 65536, A }, WIN_FUNC_OPTION("win_func", OFFSET(win_func), A, WFUNC_HANNING), { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, A }, + { "measure", "select the parameters which are measured", OFFSET(measure), AV_OPT_TYPE_FLAGS, {.i64=MEASURE_ALL}, 0, UINT_MAX, A, "measure" }, + { "none", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NONE }, 0, 0, A, "measure" }, + { "all", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ALL }, 0, 0, A, "measure" }, + { "mean", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MEAN }, 0, 0, A, "measure" }, + { "variance", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_VARIANCE}, 0, 0, A, "measure" }, + { "centroid", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_CENTROID}, 0, 0, A, "measure" }, + { "spread", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_SPREAD }, 0, 0, A, "measure" }, + { "skewness", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_SKEWNESS}, 0, 0, A, "measure" }, + { "kurtosis", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_KURTOSIS}, 0, 0, A, "measure" }, + { "entropy", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ENTROPY }, 0, 0, A, "measure" }, + { "flatness", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_FLATNESS}, 0, 0, A, "measure" }, + { "crest", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_CREST }, 0, 0, A, "measure" }, + { "flux", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_FLUX }, 0, 0, A, "measure" }, + { "slope", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_SLOPE }, 0, 0, A, "measure" }, + { "decrease", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_DECREASE}, 0, 0, A, "measure" }, + { "rolloff", "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ROLLOFF }, 0, 0, A, "measure" }, { NULL } }; @@ -78,7 +111,7 @@ static int config_output(AVFilterLink *outlink) { AudioSpectralStatsContext *s = outlink->src->priv; - float overlap, scale; + float overlap, scale = 1.f; int ret; s->nb_channels = outlink->ch_layout.nb_channels; @@ -166,19 +199,32 @@ for (int ch = 0; ch < s->nb_channels; ch++) { ChannelSpectralStats *stats = &s->stats[ch]; - set_meta(metadata, ch + 1, "mean", "%g", stats->mean); - set_meta(metadata, ch + 1, "variance", "%g", stats->variance); - set_meta(metadata, ch + 1, "centroid", "%g", stats->centroid); - set_meta(metadata, ch + 1, "spread", "%g", stats->spread); - set_meta(metadata, ch + 1, "skewness", "%g", stats->skewness); - set_meta(metadata, ch + 1, "kurtosis", "%g", stats->kurtosis); - set_meta(metadata, ch + 1, "entropy", "%g", stats->entropy); - set_meta(metadata, ch + 1, "flatness", "%g", stats->flatness); - set_meta(metadata, ch + 1, "crest", "%g", stats->crest); - set_meta(metadata, ch + 1, "flux", "%g", stats->flux); - set_meta(metadata, ch + 1, "slope", "%g", stats->slope); - set_meta(metadata, ch + 1, "decrease", "%g", stats->decrease); - set_meta(metadata, ch + 1, "rolloff", "%g", stats->rolloff); + if (s->measure & MEASURE_MEAN) + set_meta(metadata, ch + 1, "mean", "%g", stats->mean); + if (s->measure & MEASURE_VARIANCE) + set_meta(metadata, ch + 1, "variance", "%g", stats->variance); + if (s->measure & MEASURE_CENTROID) + set_meta(metadata, ch + 1, "centroid", "%g", stats->centroid); + if (s->measure & MEASURE_SPREAD) + set_meta(metadata, ch + 1, "spread", "%g", stats->spread); + if (s->measure & MEASURE_SKEWNESS) + set_meta(metadata, ch + 1, "skewness", "%g", stats->skewness); + if (s->measure & MEASURE_KURTOSIS) + set_meta(metadata, ch + 1, "kurtosis", "%g", stats->kurtosis); + if (s->measure & MEASURE_ENTROPY) + set_meta(metadata, ch + 1, "entropy", "%g", stats->entropy); + if (s->measure & MEASURE_FLATNESS) + set_meta(metadata, ch + 1, "flatness", "%g", stats->flatness); + if (s->measure & MEASURE_CREST) + set_meta(metadata, ch + 1, "crest", "%g", stats->crest); + if (s->measure & MEASURE_FLUX) + set_meta(metadata, ch + 1, "flux", "%g", stats->flux); + if (s->measure & MEASURE_SLOPE) + set_meta(metadata, ch + 1, "slope", "%g", stats->slope); + if (s->measure & MEASURE_DECREASE) + set_meta(metadata, ch + 1, "decrease", "%g", stats->decrease); + if (s->measure & MEASURE_ROLLOFF) + set_meta(metadata, ch + 1, "rolloff", "%g", stats->rolloff); } } @@ -414,7 +460,7 @@ fft_in[n].im = 0; } - s->tx_fn(s->fft[ch], fft_out, fft_in, sizeof(float)); + s->tx_fn(s->fft[ch], fft_out, fft_in, sizeof(*fft_in)); for (int n = 0; n < s->win_size / 2; n++) { fft_out[n].re *= scale; @@ -424,19 +470,32 @@ for (int n = 0; n < s->win_size / 2; n++) magnitude[n] = hypotf(fft_out[n].re, fft_out[n].im); - stats->mean = spectral_mean(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->variance = spectral_variance(magnitude, s->win_size / 2, in->sample_rate / 2, stats->mean); - stats->centroid = spectral_centroid(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->spread = spectral_spread(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid); - stats->skewness = spectral_skewness(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid, stats->spread); - stats->kurtosis = spectral_kurtosis(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid, stats->spread); - stats->entropy = spectral_entropy(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->flatness = spectral_flatness(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->crest = spectral_crest(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->flux = spectral_flux(magnitude, prev_magnitude, s->win_size / 2, in->sample_rate / 2); - stats->slope = spectral_slope(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->decrease = spectral_decrease(magnitude, s->win_size / 2, in->sample_rate / 2); - stats->rolloff = spectral_rolloff(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & (MEASURE_MEAN | MEASURE_VARIANCE)) + stats->mean = spectral_mean(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_VARIANCE) + stats->variance = spectral_variance(magnitude, s->win_size / 2, in->sample_rate / 2, stats->mean); + if (s->measure & (MEASURE_SPREAD | MEASURE_KURTOSIS | MEASURE_SKEWNESS | MEASURE_CENTROID)) + stats->centroid = spectral_centroid(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & (MEASURE_SPREAD | MEASURE_KURTOSIS | MEASURE_SKEWNESS)) + stats->spread = spectral_spread(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid); + if (s->measure & MEASURE_SKEWNESS) + stats->skewness = spectral_skewness(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid, stats->spread); + if (s->measure & MEASURE_KURTOSIS) + stats->kurtosis = spectral_kurtosis(magnitude, s->win_size / 2, in->sample_rate / 2, stats->centroid, stats->spread); + if (s->measure & MEASURE_ENTROPY) + stats->entropy = spectral_entropy(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_FLATNESS) + stats->flatness = spectral_flatness(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_CREST) + stats->crest = spectral_crest(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_FLUX) + stats->flux = spectral_flux(magnitude, prev_magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_SLOPE) + stats->slope = spectral_slope(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_DECREASE) + stats->decrease = spectral_decrease(magnitude, s->win_size / 2, in->sample_rate / 2); + if (s->measure & MEASURE_ROLLOFF) + stats->rolloff = spectral_rolloff(magnitude, s->win_size / 2, in->sample_rate / 2); memcpy(prev_magnitude, magnitude, s->win_size * sizeof(float)); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_astats.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_astats.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_astats.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_astats.c 2023-03-03 13:29:59.000000000 +0000 @@ -99,6 +99,7 @@ double time_constant; double mult; int metadata; + int used; int reset_count; int nb_frames; int maxbitdepth; @@ -118,31 +119,31 @@ { "measure_perchannel", "Select the parameters which are measured per channel", OFFSET(measure_perchannel), AV_OPT_TYPE_FLAGS, {.i64=MEASURE_ALL}, 0, UINT_MAX, FLAGS, "measure" }, { "none" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NONE }, 0, 0, FLAGS, "measure" }, { "all" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ALL }, 0, 0, FLAGS, "measure" }, + { "Bit_depth" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_BIT_DEPTH }, 0, 0, FLAGS, "measure" }, + { "Crest_factor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_CREST_FACTOR }, 0, 0, FLAGS, "measure" }, { "DC_offset" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_DC_OFFSET }, 0, 0, FLAGS, "measure" }, - { "Min_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MIN_LEVEL }, 0, 0, FLAGS, "measure" }, - { "Max_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MAX_LEVEL }, 0, 0, FLAGS, "measure" }, - { "Min_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MIN_DIFFERENCE }, 0, 0, FLAGS, "measure" }, + { "Dynamic_range" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_DYNAMIC_RANGE }, 0, 0, FLAGS, "measure" }, + { "Entropy" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ENTROPY }, 0, 0, FLAGS, "measure" }, + { "Flat_factor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_FLAT_FACTOR }, 0, 0, FLAGS, "measure" }, { "Max_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MAX_DIFFERENCE }, 0, 0, FLAGS, "measure" }, + { "Max_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MAX_LEVEL }, 0, 0, FLAGS, "measure" }, { "Mean_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MEAN_DIFFERENCE }, 0, 0, FLAGS, "measure" }, - { "RMS_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_RMS_DIFFERENCE }, 0, 0, FLAGS, "measure" }, + { "Min_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MIN_DIFFERENCE }, 0, 0, FLAGS, "measure" }, + { "Min_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_MIN_LEVEL }, 0, 0, FLAGS, "measure" }, + { "Noise_floor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NOISE_FLOOR }, 0, 0, FLAGS, "measure" }, + { "Noise_floor_count" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NOISE_FLOOR_COUNT }, 0, 0, FLAGS, "measure" }, + { "Number_of_Infs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_INFS }, 0, 0, FLAGS, "measure" }, + { "Number_of_NaNs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_NANS }, 0, 0, FLAGS, "measure" }, + { "Number_of_denormals" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_DENORMALS }, 0, 0, FLAGS, "measure" }, + { "Number_of_samples" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_SAMPLES }, 0, 0, FLAGS, "measure" }, + { "Peak_count" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_PEAK_COUNT }, 0, 0, FLAGS, "measure" }, { "Peak_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_PEAK_LEVEL }, 0, 0, FLAGS, "measure" }, + { "RMS_difference" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_RMS_DIFFERENCE }, 0, 0, FLAGS, "measure" }, { "RMS_level" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_RMS_LEVEL }, 0, 0, FLAGS, "measure" }, { "RMS_peak" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_RMS_PEAK }, 0, 0, FLAGS, "measure" }, { "RMS_trough" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_RMS_TROUGH }, 0, 0, FLAGS, "measure" }, - { "Crest_factor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_CREST_FACTOR }, 0, 0, FLAGS, "measure" }, - { "Flat_factor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_FLAT_FACTOR }, 0, 0, FLAGS, "measure" }, - { "Peak_count" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_PEAK_COUNT }, 0, 0, FLAGS, "measure" }, - { "Bit_depth" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_BIT_DEPTH }, 0, 0, FLAGS, "measure" }, - { "Dynamic_range" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_DYNAMIC_RANGE }, 0, 0, FLAGS, "measure" }, { "Zero_crossings" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ZERO_CROSSINGS }, 0, 0, FLAGS, "measure" }, { "Zero_crossings_rate" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ZERO_CROSSINGS_RATE }, 0, 0, FLAGS, "measure" }, - { "Noise_floor" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NOISE_FLOOR }, 0, 0, FLAGS, "measure" }, - { "Noise_floor_count" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NOISE_FLOOR_COUNT }, 0, 0, FLAGS, "measure" }, - { "Entropy" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ENTROPY }, 0, 0, FLAGS, "measure" }, - { "Number_of_samples" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_SAMPLES }, 0, 0, FLAGS, "measure" }, - { "Number_of_NaNs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_NANS }, 0, 0, FLAGS, "measure" }, - { "Number_of_Infs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_INFS }, 0, 0, FLAGS, "measure" }, - { "Number_of_denormals" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_DENORMALS }, 0, 0, FLAGS, "measure" }, { "measure_overall", "Select the parameters which are measured overall", OFFSET(measure_overall), AV_OPT_TYPE_FLAGS, {.i64=MEASURE_ALL}, 0, UINT_MAX, FLAGS, "measure" }, { NULL } }; @@ -637,6 +638,8 @@ s->nb_frames++; } + if (s->used == 0) + s->used = buf->nb_samples > 0; ff_filter_execute(ctx, filter_channel, buf, NULL, FFMIN(inlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); @@ -668,6 +671,9 @@ for (c = 0; c < s->nb_channels; c++) { ChannelStats *p = &s->chstats[c]; + if (p->nb_samples == 0 && !s->used) + continue; + if (p->nb_samples < s->tc_samples) p->min_sigma_x2 = p->max_sigma_x2 = p->sigma_x2 / p->nb_samples; @@ -754,6 +760,9 @@ av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals); } + if (nb_samples == 0 && !s->used) + return; + if (s->measure_overall != MEASURE_NONE) av_log(ctx, AV_LOG_INFO, "Overall\n"); if (s->measure_overall & MEASURE_DC_OFFSET) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_atempo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_atempo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_atempo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_atempo.c 2023-03-03 13:29:59.000000000 +0000 @@ -619,7 +619,7 @@ } // apply inverse rDFT: - c2r_fn(complex_to_real, xcorr, xcorr_in, sizeof(float)); + c2r_fn(complex_to_real, xcorr, xcorr_in, sizeof(*xc)); } /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_biquads.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_biquads.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_biquads.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_biquads.c 2023-03-03 13:29:59.000000000 +0000 @@ -729,7 +729,7 @@ a[1] = g * a[0]; a[2] = g * a[1]; m[0] = 0.; - m[1] = s->csg ? 1. : 2.; + m[1] = s->csg ? 1. : k; m[2] = 0.; break; case bandreject: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compand.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compand.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compand.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compand.c 2023-03-03 13:29:59.000000000 +0000 @@ -306,8 +306,6 @@ int nb_attacks, nb_decays, nb_points; int new_nb_items, num; int i; - int err; - count_items(s->attacks, &nb_attacks); count_items(s->decays, &nb_decays); @@ -495,25 +493,9 @@ return 0; } - s->delay_frame = av_frame_alloc(); - if (!s->delay_frame) { - uninit(ctx); + s->delay_frame = ff_get_audio_buffer(outlink, s->delay_samples); + if (!s->delay_frame) return AVERROR(ENOMEM); - } - - s->delay_frame->format = outlink->format; - s->delay_frame->nb_samples = s->delay_samples; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - s->delay_frame->channel_layout = outlink->channel_layout; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if ((err = av_channel_layout_copy(&s->delay_frame->ch_layout, &outlink->ch_layout)) < 0) - return err; - - err = av_frame_get_buffer(s->delay_frame, 0); - if (err) - return err; s->compand = compand_delay; return 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compensationdelay.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compensationdelay.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compensationdelay.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_compensationdelay.c 2023-03-03 13:29:59.000000000 +0000 @@ -68,7 +68,6 @@ AVFilterContext *ctx = inlink->dst; CompensationDelayContext *s = ctx->priv; unsigned min_size, new_size = 1; - int ret; s->delay = (s->distance_m * 100. + s->distance_cm * 1. + s->distance_mm * .1) * COMP_DELAY_SOUND_FRONT_DELAY(s->temp) * inlink->sample_rate; @@ -77,23 +76,12 @@ while (new_size < min_size) new_size <<= 1; - s->delay_frame = av_frame_alloc(); + s->buf_size = new_size; + s->delay_frame = ff_get_audio_buffer(inlink, s->buf_size); if (!s->delay_frame) return AVERROR(ENOMEM); - s->buf_size = new_size; - s->delay_frame->format = inlink->format; - s->delay_frame->nb_samples = new_size; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - s->delay_frame->channel_layout = inlink->channel_layout; - s->delay_frame->channels = inlink->ch_layout.nb_channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if ((ret = av_channel_layout_copy(&s->delay_frame->ch_layout, &inlink->ch_layout)) < 0) - return ret; - - return av_frame_get_buffer(s->delay_frame, 0); + return 0; } static int filter_frame(AVFilterLink *inlink, AVFrame *in) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dialoguenhance.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dialoguenhance.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dialoguenhance.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dialoguenhance.c 2023-03-03 13:29:59.000000000 +0000 @@ -286,7 +286,7 @@ get_final(center, windowed_oleft, windowed_oright, vad, s->fft_size / 2 + 1, s->original, s->enhance); - s->itx_fn(s->itx_ctx, windowed_oleft, center, sizeof(float)); + s->itx_fn(s->itx_ctx, windowed_oleft, center, sizeof(AVComplexFloat)); apply_window(s, windowed_oleft, left_out, 1); @@ -320,7 +320,7 @@ s->in = in; de_stereo(ctx, out); - out->pts = in->pts; + av_frame_copy_props(out, in); out->nb_samples = in->nb_samples; ret = ff_filter_frame(outlink, out); fail: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dynaudnorm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dynaudnorm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dynaudnorm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_dynaudnorm.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" +#include "libavutil/eval.h" #include "libavutil/opt.h" #define MIN_FILTER_SIZE 3 @@ -41,6 +42,26 @@ #include "filters.h" #include "internal.h" +static const char * const var_names[] = { + "ch", ///< the value of the current channel + "sn", ///< number of samples + "nb_channels", + "t", ///< timestamp expressed in seconds + "sr", ///< sample rate + "p", ///< peak value + NULL +}; + +enum var_name { + VAR_CH, + VAR_SN, + VAR_NB_CHANNELS, + VAR_T, + VAR_SR, + VAR_P, + VAR_VARS_NB +}; + typedef struct local_gain { double max_gain; double threshold; @@ -65,6 +86,7 @@ int channels_coupled; int alt_boundary_mode; double overlap; + char *expr_str; double peak_value; double max_amplification; @@ -91,8 +113,16 @@ cqueue *is_enabled; AVFrame *window; + + AVExpr *expr; + double var_values[VAR_VARS_NB]; } DynamicAudioNormalizerContext; +typedef struct ThreadData { + AVFrame *in, *out; + int enabled; +} ThreadData; + #define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x) #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM @@ -117,10 +147,12 @@ { "s", "set the compress factor", OFFSET(compress_factor), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, 0.0, 30.0, FLAGS }, { "threshold", "set the threshold value", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, 0.0, 1.0, FLAGS }, { "t", "set the threshold value", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, 0.0, 1.0, FLAGS }, - { "channels", "set channels to filter", OFFSET(channels_to_filter),AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS }, - { "h", "set channels to filter", OFFSET(channels_to_filter),AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS }, + { "channels", "set channels to filter", OFFSET(channels_to_filter),AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS }, + { "h", "set channels to filter", OFFSET(channels_to_filter),AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS }, { "overlap", "set the frame overlap", OFFSET(overlap), AV_OPT_TYPE_DOUBLE, {.dbl=.0}, 0.0, 1.0, FLAGS }, { "o", "set the frame overlap", OFFSET(overlap), AV_OPT_TYPE_DOUBLE, {.dbl=.0}, 0.0, 1.0, FLAGS }, + { "curve", "set the custom peak mapping curve",OFFSET(expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, + { "v", "set the custom peak mapping curve",OFFSET(expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, { NULL } }; @@ -304,12 +336,15 @@ ff_bufqueue_discard_all(&s->queue); av_frame_free(&s->window); + av_expr_free(s->expr); + s->expr = NULL; } static int config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; DynamicAudioNormalizerContext *s = ctx->priv; + int ret = 0; uninit(ctx); @@ -353,7 +388,13 @@ return AVERROR(ENOMEM); s->sample_advance = FFMAX(1, lrint(s->frame_len * (1. - s->overlap))); - return 0; + s->var_values[VAR_SR] = inlink->sample_rate; + s->var_values[VAR_NB_CHANNELS] = s->channels; + + if (s->expr_str) + ret = av_expr_parse(&s->expr, s->expr_str, var_names, NULL, NULL, + NULL, NULL, 0, ctx); + return ret; } static inline double fade(double prev, double next, int pos, int length) @@ -428,10 +469,22 @@ const double peak_magnitude = find_peak_magnitude(frame, channel); const double maximum_gain = s->peak_value / peak_magnitude; const double rms_gain = s->target_rms > DBL_EPSILON ? (s->target_rms / compute_frame_rms(frame, channel)) : DBL_MAX; + double target_gain = DBL_MAX; local_gain gain; + if (s->expr_str) { + double var_values[VAR_VARS_NB]; + + memcpy(var_values, s->var_values, sizeof(var_values)); + + var_values[VAR_CH] = channel; + var_values[VAR_P] = peak_magnitude; + + target_gain = av_expr_eval(s->expr, var_values, s) / peak_magnitude; + } + gain.threshold = peak_magnitude > s->threshold; - gain.max_gain = bound(s->max_amplification, fmin(maximum_gain, rms_gain)); + gain.max_gain = bound(s->max_amplification, fmin(target_gain, fmin(maximum_gain, rms_gain))); return gain; } @@ -521,6 +574,20 @@ } } +static int update_gain_histories(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + DynamicAudioNormalizerContext *s = ctx->priv; + AVFrame *analyze_frame = arg; + const int channels = s->channels; + const int start = (channels * jobnr) / nb_jobs; + const int end = (channels * (jobnr+1)) / nb_jobs; + + for (int c = start; c < end; c++) + update_gain_history(s, c, get_max_local_gain(s, analyze_frame, c)); + + return 0; +} + static inline double update_value(double new, double old, double aggressiveness) { av_assert0((aggressiveness >= 0.0) && (aggressiveness <= 1.0)); @@ -655,8 +722,9 @@ } } -static int analyze_frame(DynamicAudioNormalizerContext *s, AVFilterLink *outlink, AVFrame **frame) +static int analyze_frame(AVFilterContext *ctx, AVFilterLink *outlink, AVFrame **frame) { + DynamicAudioNormalizerContext *s = ctx->priv; AVFrame *analyze_frame; if (s->dc_correction || s->compress_factor > DBL_EPSILON) { @@ -707,43 +775,61 @@ analyze_frame = s->window; } else { av_samples_copy(s->window->extended_data, (*frame)->extended_data, 0, 0, - s->frame_len, (*frame)->ch_layout.nb_channels, (*frame)->format); + FFMIN(s->frame_len, (*frame)->nb_samples), (*frame)->ch_layout.nb_channels, (*frame)->format); analyze_frame = *frame; } + s->var_values[VAR_SN] = outlink->sample_count_in; + s->var_values[VAR_T] = s->var_values[VAR_SN] * (double)1/outlink->sample_rate; + if (s->channels_coupled) { const local_gain gain = get_max_local_gain(s, analyze_frame, -1); for (int c = 0; c < s->channels; c++) update_gain_history(s, c, gain); } else { - for (int c = 0; c < s->channels; c++) - update_gain_history(s, c, get_max_local_gain(s, analyze_frame, c)); + ff_filter_execute(ctx, update_gain_histories, analyze_frame, NULL, + FFMIN(s->channels, ff_filter_get_nb_threads(ctx))); } return 0; } -static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *in, - AVFrame *frame, int enabled) +static void amplify_channel(DynamicAudioNormalizerContext *s, AVFrame *in, + AVFrame *frame, int enabled, int c) { - for (int c = 0; c < s->channels; c++) { - const int bypass = bypass_channel(s, frame, c); - const double *src_ptr = (const double *)in->extended_data[c]; - double *dst_ptr = (double *)frame->extended_data[c]; - double current_amplification_factor; + const int bypass = bypass_channel(s, frame, c); + const double *src_ptr = (const double *)in->extended_data[c]; + double *dst_ptr = (double *)frame->extended_data[c]; + double current_amplification_factor; - cqueue_dequeue(s->gain_history_smoothed[c], ¤t_amplification_factor); + cqueue_dequeue(s->gain_history_smoothed[c], ¤t_amplification_factor); - for (int i = 0; i < frame->nb_samples && enabled && !bypass; i++) { - const double amplification_factor = fade(s->prev_amplification_factor[c], - current_amplification_factor, i, - frame->nb_samples); + for (int i = 0; i < frame->nb_samples && enabled && !bypass; i++) { + const double amplification_factor = fade(s->prev_amplification_factor[c], + current_amplification_factor, i, + frame->nb_samples); - dst_ptr[i] = src_ptr[i] * amplification_factor; - } - - s->prev_amplification_factor[c] = current_amplification_factor; + dst_ptr[i] = src_ptr[i] * amplification_factor; } + + s->prev_amplification_factor[c] = current_amplification_factor; +} + +static int amplify_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + DynamicAudioNormalizerContext *s = ctx->priv; + ThreadData *td = arg; + AVFrame *out = td->out; + AVFrame *in = td->in; + const int enabled = td->enabled; + const int channels = s->channels; + const int start = (channels * jobnr) / nb_jobs; + const int end = (channels * (jobnr+1)) / nb_jobs; + + for (int ch = start; ch < end; ch++) + amplify_channel(s, in, out, enabled, ch); + + return 0; } static int filter_frame(AVFilterLink *inlink, AVFrame *in) @@ -751,6 +837,7 @@ AVFilterContext *ctx = inlink->dst; DynamicAudioNormalizerContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; + ThreadData td; int ret; while (((s->queue.available >= s->filter_size) || @@ -773,7 +860,12 @@ av_frame_copy_props(out, in); } - amplify_frame(s, in, out, is_enabled > 0.); + td.in = in; + td.out = out; + td.enabled = is_enabled > 0.; + ff_filter_execute(ctx, amplify_channels, &td, NULL, + FFMIN(s->channels, ff_filter_get_nb_threads(ctx))); + s->pts = out->pts + av_rescale_q(out->nb_samples, av_make_q(1, outlink->sample_rate), outlink->time_base); if (out != in) @@ -783,7 +875,7 @@ return ret; } - ret = analyze_frame(s, outlink, &in); + ret = analyze_frame(ctx, outlink, &in); if (ret < 0) return ret; if (!s->eof) { @@ -824,19 +916,13 @@ AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; DynamicAudioNormalizerContext *s = ctx->priv; - int ret = 0; - - if (!cqueue_empty(s->gain_history_smoothed[0])) { - ret = flush_buffer(s, inlink, outlink); - } else if (s->queue.available) { - AVFrame *out = ff_bufqueue_get(&s->queue); - s->pts = out->pts + av_rescale_q(out->nb_samples, av_make_q(1, outlink->sample_rate), - outlink->time_base); - ret = ff_filter_frame(outlink, out); + while (s->eof && cqueue_empty(s->gain_history_smoothed[0])) { + for (int c = 0; c < s->channels; c++) + update_gain_history(s, c, (local_gain){ cqueue_peek(s->gain_history_original[c], 0), 1.0}); } - return ret; + return flush_buffer(s, inlink, outlink); } static int activate(AVFilterContext *ctx) @@ -916,7 +1002,12 @@ s->frame_len = frame_size(inlink->sample_rate, s->frame_len_msec); s->sample_advance = FFMAX(1, lrint(s->frame_len * (1. - s->overlap))); - + if (s->expr_str) { + ret = av_expr_parse(&s->expr, s->expr_str, var_names, NULL, NULL, + NULL, NULL, 0, ctx); + if (ret < 0) + return ret; + } return 0; } @@ -946,6 +1037,7 @@ FILTER_OUTPUTS(avfilter_af_dynaudnorm_outputs), FILTER_SINGLE_SAMPLEFMT(AV_SAMPLE_FMT_DBLP), .priv_class = &dynaudnorm_class, - .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | + AVFILTER_FLAG_SLICE_THREADS, .process_command = process_command, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_firequalizer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_firequalizer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_firequalizer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_firequalizer.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,10 +19,11 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" #include "libavutil/eval.h" #include "libavutil/avassert.h" -#include "libavcodec/avfft.h" +#include "libavutil/tx.h" #include "avfilter.h" #include "internal.h" #include "audio.h" @@ -66,22 +67,33 @@ typedef struct FIREqualizerContext { const AVClass *class; - RDFTContext *analysis_rdft; - RDFTContext *analysis_irdft; - RDFTContext *rdft; - RDFTContext *irdft; - FFTContext *fft_ctx; - RDFTContext *cepstrum_rdft; - RDFTContext *cepstrum_irdft; + AVTXContext *analysis_rdft; + av_tx_fn analysis_rdft_fn; + AVTXContext *analysis_irdft; + av_tx_fn analysis_irdft_fn; + AVTXContext *rdft; + av_tx_fn rdft_fn; + AVTXContext *irdft; + av_tx_fn irdft_fn; + AVTXContext *fft_ctx; + av_tx_fn fft_fn; + AVTXContext *cepstrum_rdft; + av_tx_fn cepstrum_rdft_fn; + AVTXContext *cepstrum_irdft; + av_tx_fn cepstrum_irdft_fn; int analysis_rdft_len; int rdft_len; int cepstrum_len; float *analysis_buf; + float *analysis_tbuf; float *dump_buf; float *kernel_tmp_buf; + float *kernel_tmp_tbuf; float *kernel_buf; + float *tx_buf; float *cepstrum_buf; + float *cepstrum_tbuf; float *conv_buf; OverlapIndex *conv_idx; int fir_len; @@ -150,23 +162,27 @@ static void common_uninit(FIREqualizerContext *s) { - av_rdft_end(s->analysis_rdft); - av_rdft_end(s->analysis_irdft); - av_rdft_end(s->rdft); - av_rdft_end(s->irdft); - av_fft_end(s->fft_ctx); - av_rdft_end(s->cepstrum_rdft); - av_rdft_end(s->cepstrum_irdft); + av_tx_uninit(&s->analysis_rdft); + av_tx_uninit(&s->analysis_irdft); + av_tx_uninit(&s->rdft); + av_tx_uninit(&s->irdft); + av_tx_uninit(&s->fft_ctx); + av_tx_uninit(&s->cepstrum_rdft); + av_tx_uninit(&s->cepstrum_irdft); s->analysis_rdft = s->analysis_irdft = s->rdft = s->irdft = NULL; s->fft_ctx = NULL; s->cepstrum_rdft = NULL; s->cepstrum_irdft = NULL; av_freep(&s->analysis_buf); + av_freep(&s->analysis_tbuf); av_freep(&s->dump_buf); av_freep(&s->kernel_tmp_buf); + av_freep(&s->kernel_tmp_tbuf); av_freep(&s->kernel_buf); + av_freep(&s->tx_buf); av_freep(&s->cepstrum_buf); + av_freep(&s->cepstrum_tbuf); av_freep(&s->conv_buf); av_freep(&s->conv_idx); } @@ -186,22 +202,21 @@ if (nsamples <= s->nsamples_max) { float *buf = conv_buf + idx->buf_idx * s->rdft_len; float *obuf = conv_buf + !idx->buf_idx * s->rdft_len + idx->overlap_idx; + float *tbuf = s->tx_buf; int center = s->fir_len/2; int k; memset(buf, 0, center * sizeof(*data)); memcpy(buf + center, data, nsamples * sizeof(*data)); memset(buf + center + nsamples, 0, (s->rdft_len - nsamples - center) * sizeof(*data)); - av_rdft_calc(s->rdft, buf); + s->rdft_fn(s->rdft, tbuf, buf, sizeof(float)); - buf[0] *= kernel_buf[0]; - buf[1] *= kernel_buf[s->rdft_len/2]; - for (k = 1; k < s->rdft_len/2; k++) { - buf[2*k] *= kernel_buf[k]; - buf[2*k+1] *= kernel_buf[k]; + for (k = 0; k <= s->rdft_len/2; k++) { + tbuf[2*k] *= kernel_buf[k]; + tbuf[2*k+1] *= kernel_buf[k]; } - av_rdft_calc(s->irdft, buf); + s->irdft_fn(s->irdft, buf, tbuf, sizeof(AVComplexFloat)); for (k = 0; k < s->rdft_len - idx->overlap_idx; k++) buf[k] += obuf[k]; memcpy(data, buf, nsamples * sizeof(*data)); @@ -225,23 +240,22 @@ if (nsamples <= s->nsamples_max) { float *buf = conv_buf + idx->buf_idx * s->rdft_len; float *obuf = conv_buf + !idx->buf_idx * s->rdft_len + idx->overlap_idx; + float *tbuf = s->tx_buf; int k; memcpy(buf, data, nsamples * sizeof(*data)); memset(buf + nsamples, 0, (s->rdft_len - nsamples) * sizeof(*data)); - av_rdft_calc(s->rdft, buf); + s->rdft_fn(s->rdft, tbuf, buf, sizeof(float)); - buf[0] *= kernel_buf[0]; - buf[1] *= kernel_buf[1]; - for (k = 2; k < s->rdft_len; k += 2) { + for (k = 0; k < s->rdft_len + 2; k += 2) { float re, im; - re = buf[k] * kernel_buf[k] - buf[k+1] * kernel_buf[k+1]; - im = buf[k] * kernel_buf[k+1] + buf[k+1] * kernel_buf[k]; - buf[k] = re; - buf[k+1] = im; + re = tbuf[k] * kernel_buf[k] - tbuf[k+1] * kernel_buf[k+1]; + im = tbuf[k] * kernel_buf[k+1] + tbuf[k+1] * kernel_buf[k]; + tbuf[k] = re; + tbuf[k+1] = im; } - av_rdft_calc(s->irdft, buf); + s->irdft_fn(s->irdft, buf, tbuf, sizeof(AVComplexFloat)); for (k = 0; k < s->rdft_len - idx->overlap_idx; k++) buf[k] += obuf[k]; memcpy(data, buf, nsamples * sizeof(*data)); @@ -258,12 +272,13 @@ } } -static void fast_convolute2(FIREqualizerContext *av_restrict s, const float *av_restrict kernel_buf, FFTComplex *av_restrict conv_buf, +static void fast_convolute2(FIREqualizerContext *av_restrict s, const float *av_restrict kernel_buf, AVComplexFloat *av_restrict conv_buf, OverlapIndex *av_restrict idx, float *av_restrict data0, float *av_restrict data1, int nsamples) { if (nsamples <= s->nsamples_max) { - FFTComplex *buf = conv_buf + idx->buf_idx * s->rdft_len; - FFTComplex *obuf = conv_buf + !idx->buf_idx * s->rdft_len + idx->overlap_idx; + AVComplexFloat *buf = conv_buf + idx->buf_idx * s->rdft_len; + AVComplexFloat *obuf = conv_buf + !idx->buf_idx * s->rdft_len + idx->overlap_idx; + AVComplexFloat *tbuf = (AVComplexFloat *)s->tx_buf; int center = s->fir_len/2; int k; float tmp; @@ -274,29 +289,27 @@ buf[center+k].im = data1[k]; } memset(buf + center + nsamples, 0, (s->rdft_len - nsamples - center) * sizeof(*buf)); - av_fft_permute(s->fft_ctx, buf); - av_fft_calc(s->fft_ctx, buf); + s->fft_fn(s->fft_ctx, tbuf, buf, sizeof(AVComplexFloat)); /* swap re <-> im, do backward fft using forward fft_ctx */ /* normalize with 0.5f */ - tmp = buf[0].re; - buf[0].re = 0.5f * kernel_buf[0] * buf[0].im; - buf[0].im = 0.5f * kernel_buf[0] * tmp; + tmp = tbuf[0].re; + tbuf[0].re = 0.5f * kernel_buf[0] * tbuf[0].im; + tbuf[0].im = 0.5f * kernel_buf[0] * tmp; for (k = 1; k < s->rdft_len/2; k++) { int m = s->rdft_len - k; - tmp = buf[k].re; - buf[k].re = 0.5f * kernel_buf[k] * buf[k].im; - buf[k].im = 0.5f * kernel_buf[k] * tmp; - tmp = buf[m].re; - buf[m].re = 0.5f * kernel_buf[k] * buf[m].im; - buf[m].im = 0.5f * kernel_buf[k] * tmp; - } - tmp = buf[k].re; - buf[k].re = 0.5f * kernel_buf[k] * buf[k].im; - buf[k].im = 0.5f * kernel_buf[k] * tmp; + tmp = tbuf[k].re; + tbuf[k].re = 0.5f * kernel_buf[k] * tbuf[k].im; + tbuf[k].im = 0.5f * kernel_buf[k] * tmp; + tmp = tbuf[m].re; + tbuf[m].re = 0.5f * kernel_buf[k] * tbuf[m].im; + tbuf[m].im = 0.5f * kernel_buf[k] * tmp; + } + tmp = tbuf[k].re; + tbuf[k].re = 0.5f * kernel_buf[k] * tbuf[k].im; + tbuf[k].im = 0.5f * kernel_buf[k] * tmp; - av_fft_permute(s->fft_ctx, buf); - av_fft_calc(s->fft_ctx, buf); + s->fft_fn(s->fft_ctx, buf, tbuf, sizeof(AVComplexFloat)); for (k = 0; k < s->rdft_len - idx->overlap_idx; k++) { buf[k].re += obuf[k].re; @@ -360,17 +373,17 @@ fprintf(fp, "%15.10f %15.10f\n", (double)x / rate, (double) s->analysis_buf[x]); } - av_rdft_calc(s->analysis_rdft, s->analysis_buf); + s->analysis_rdft_fn(s->analysis_rdft, s->analysis_tbuf, s->analysis_buf, sizeof(float)); fprintf(fp, "\n\n# freq[%d] (frequency desired_gain actual_gain)\n", ch); for (x = 0; x <= s->analysis_rdft_len/2; x++) { - int i = (x == s->analysis_rdft_len/2) ? 1 : 2 * x; + int i = 2 * x; vx = (double)x * rate / s->analysis_rdft_len; if (xlog) vx = log2(0.05*vx); ya = s->dump_buf[i]; - yb = s->min_phase && (i > 1) ? hypotf(s->analysis_buf[i], s->analysis_buf[i+1]) : s->analysis_buf[i]; + yb = s->min_phase ? hypotf(s->analysis_tbuf[i], s->analysis_tbuf[i+1]) : s->analysis_tbuf[i]; if (s->min_phase) yb = fabs(yb); if (ylog) { @@ -529,45 +542,40 @@ double minval = 1e-7 / rdft_len; memset(s->cepstrum_buf, 0, cepstrum_len * sizeof(*s->cepstrum_buf)); + memset(s->cepstrum_tbuf, 0, (cepstrum_len + 2) * sizeof(*s->cepstrum_tbuf)); memcpy(s->cepstrum_buf, rdft_buf, rdft_len/2 * sizeof(*rdft_buf)); memcpy(s->cepstrum_buf + cepstrum_len - rdft_len/2, rdft_buf + rdft_len/2, rdft_len/2 * sizeof(*rdft_buf)); - av_rdft_calc(s->cepstrum_rdft, s->cepstrum_buf); - - s->cepstrum_buf[0] = log(FFMAX(s->cepstrum_buf[0], minval)); - s->cepstrum_buf[1] = log(FFMAX(s->cepstrum_buf[1], minval)); + s->cepstrum_rdft_fn(s->cepstrum_rdft, s->cepstrum_tbuf, s->cepstrum_buf, sizeof(float)); - for (k = 2; k < cepstrum_len; k += 2) { - s->cepstrum_buf[k] = log(FFMAX(s->cepstrum_buf[k], minval)); - s->cepstrum_buf[k+1] = 0; + for (k = 0; k < cepstrum_len + 2; k += 2) { + s->cepstrum_tbuf[k] = log(FFMAX(s->cepstrum_tbuf[k], minval)); + s->cepstrum_tbuf[k+1] = 0; } - av_rdft_calc(s->cepstrum_irdft, s->cepstrum_buf); + s->cepstrum_irdft_fn(s->cepstrum_irdft, s->cepstrum_buf, s->cepstrum_tbuf, sizeof(AVComplexFloat)); memset(s->cepstrum_buf + cepstrum_len/2 + 1, 0, (cepstrum_len/2 - 1) * sizeof(*s->cepstrum_buf)); - for (k = 1; k < cepstrum_len/2; k++) + for (k = 1; k <= cepstrum_len/2; k++) s->cepstrum_buf[k] *= 2; - av_rdft_calc(s->cepstrum_rdft, s->cepstrum_buf); + s->cepstrum_rdft_fn(s->cepstrum_rdft, s->cepstrum_tbuf, s->cepstrum_buf, sizeof(float)); - s->cepstrum_buf[0] = exp(s->cepstrum_buf[0] * norm) * norm; - s->cepstrum_buf[1] = exp(s->cepstrum_buf[1] * norm) * norm; - for (k = 2; k < cepstrum_len; k += 2) { - double mag = exp(s->cepstrum_buf[k] * norm) * norm; - double ph = s->cepstrum_buf[k+1] * norm; - s->cepstrum_buf[k] = mag * cos(ph); - s->cepstrum_buf[k+1] = mag * sin(ph); + for (k = 0; k < cepstrum_len + 2; k += 2) { + double mag = exp(s->cepstrum_tbuf[k] * norm) * norm; + double ph = s->cepstrum_tbuf[k+1] * norm; + s->cepstrum_tbuf[k] = mag * cos(ph); + s->cepstrum_tbuf[k+1] = mag * sin(ph); } - av_rdft_calc(s->cepstrum_irdft, s->cepstrum_buf); + s->cepstrum_irdft_fn(s->cepstrum_irdft, s->cepstrum_buf, s->cepstrum_tbuf, sizeof(AVComplexFloat)); memset(rdft_buf, 0, s->rdft_len * sizeof(*rdft_buf)); memcpy(rdft_buf, s->cepstrum_buf, s->fir_len * sizeof(*rdft_buf)); if (s->dumpfile) { - memset(s->analysis_buf, 0, s->analysis_rdft_len * sizeof(*s->analysis_buf)); + memset(s->analysis_buf, 0, (s->analysis_rdft_len + 2) * sizeof(*s->analysis_buf)); memcpy(s->analysis_buf, s->cepstrum_buf, s->fir_len * sizeof(*s->analysis_buf)); } - } static int generate_kernel(AVFilterContext *ctx, const char *gain, const char *gain_entry) @@ -612,35 +620,25 @@ inlink->ch_layout.u.mask : 0; vars[VAR_SR] = inlink->sample_rate; for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { - float *rdft_buf = s->kernel_tmp_buf + ch * s->rdft_len; + float *rdft_buf = s->kernel_tmp_buf + ch * (s->rdft_len * 2); + float *rdft_tbuf = s->kernel_tmp_tbuf; double result; vars[VAR_CH] = ch; vars[VAR_CHID] = av_channel_layout_channel_from_index(&inlink->ch_layout, ch); - vars[VAR_F] = 0.0; - if (xlog) - vars[VAR_F] = log2(0.05 * vars[VAR_F]); - result = av_expr_eval(gain_expr, vars, ctx); - s->analysis_buf[0] = ylog ? pow(10.0, 0.05 * result) : result; - - vars[VAR_F] = 0.5 * inlink->sample_rate; - if (xlog) - vars[VAR_F] = log2(0.05 * vars[VAR_F]); - result = av_expr_eval(gain_expr, vars, ctx); - s->analysis_buf[1] = ylog ? pow(10.0, 0.05 * result) : result; - for (k = 1; k < s->analysis_rdft_len/2; k++) { + for (k = 0; k <= s->analysis_rdft_len/2; k++) { vars[VAR_F] = k * ((double)inlink->sample_rate /(double)s->analysis_rdft_len); if (xlog) vars[VAR_F] = log2(0.05 * vars[VAR_F]); result = av_expr_eval(gain_expr, vars, ctx); - s->analysis_buf[2*k] = ylog ? pow(10.0, 0.05 * result) : s->min_phase ? fabs(result) : result; - s->analysis_buf[2*k+1] = 0.0; + s->analysis_tbuf[2*k] = ylog ? pow(10.0, 0.05 * result) : s->min_phase ? fabs(result) : result; + s->analysis_tbuf[2*k+1] = 0.0; } if (s->dump_buf) - memcpy(s->dump_buf, s->analysis_buf, s->analysis_rdft_len * sizeof(*s->analysis_buf)); + memcpy(s->dump_buf, s->analysis_tbuf, (s->analysis_rdft_len + 2) * sizeof(*s->analysis_tbuf)); - av_rdft_calc(s->analysis_irdft, s->analysis_buf); + s->analysis_irdft_fn(s->analysis_irdft, s->analysis_buf, s->analysis_tbuf, sizeof(AVComplexFloat)); center = s->fir_len / 2; for (k = 0; k <= center; k++) { @@ -686,13 +684,13 @@ } memset(s->analysis_buf + center + 1, 0, (s->analysis_rdft_len - s->fir_len) * sizeof(*s->analysis_buf)); - memcpy(rdft_buf, s->analysis_buf, s->rdft_len/2 * sizeof(*s->analysis_buf)); - memcpy(rdft_buf + s->rdft_len/2, s->analysis_buf + s->analysis_rdft_len - s->rdft_len/2, s->rdft_len/2 * sizeof(*s->analysis_buf)); + memcpy(rdft_tbuf, s->analysis_buf, s->rdft_len/2 * sizeof(*s->analysis_buf)); + memcpy(rdft_tbuf + s->rdft_len/2, s->analysis_buf + s->analysis_rdft_len - s->rdft_len/2, s->rdft_len/2 * sizeof(*s->analysis_buf)); if (s->min_phase) - generate_min_phase_kernel(s, rdft_buf); - av_rdft_calc(s->rdft, rdft_buf); + generate_min_phase_kernel(s, rdft_tbuf); + s->rdft_fn(s->rdft, rdft_buf, rdft_tbuf, sizeof(float)); - for (k = 0; k < s->rdft_len; k++) { + for (k = 0; k < s->rdft_len + 2; k++) { if (isnan(rdft_buf[k]) || isinf(rdft_buf[k])) { av_log(ctx, AV_LOG_ERROR, "filter kernel contains nan or infinity.\n"); av_expr_free(gain_expr); @@ -703,10 +701,8 @@ } if (!s->min_phase) { - rdft_buf[s->rdft_len-1] = rdft_buf[1]; - for (k = 0; k < s->rdft_len/2; k++) + for (k = 0; k <= s->rdft_len/2; k++) rdft_buf[k] = rdft_buf[2*k]; - rdft_buf[s->rdft_len/2] = rdft_buf[s->rdft_len-1]; } if (dump_fp) @@ -716,7 +712,7 @@ break; } - memcpy(s->kernel_buf, s->kernel_tmp_buf, (s->multi ? inlink->ch_layout.nb_channels : 1) * s->rdft_len * sizeof(*s->kernel_buf)); + memcpy(s->kernel_buf, s->kernel_tmp_buf, (s->multi ? inlink->ch_layout.nb_channels : 1) * (s->rdft_len * 2) * sizeof(*s->kernel_buf)); av_expr_free(gain_expr); if (dump_fp) fclose(dump_fp); @@ -730,7 +726,8 @@ { AVFilterContext *ctx = inlink->dst; FIREqualizerContext *s = ctx->priv; - int rdft_bits; + float iscale, scale = 1.f; + int rdft_bits, ret; common_uninit(s); @@ -752,11 +749,15 @@ return AVERROR(EINVAL); } - if (!(s->rdft = av_rdft_init(rdft_bits, DFT_R2C)) || !(s->irdft = av_rdft_init(rdft_bits, IDFT_C2R))) - return AVERROR(ENOMEM); + iscale = 0.5f; + if (((ret = av_tx_init(&s->rdft, &s->rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << rdft_bits, &scale, 0)) < 0) || + ((ret = av_tx_init(&s->irdft, &s->irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << rdft_bits, &iscale, 0)) < 0)) + return ret; - if (s->fft2 && !s->multi && inlink->ch_layout.nb_channels > 1 && !(s->fft_ctx = av_fft_init(rdft_bits, 0))) - return AVERROR(ENOMEM); + scale = 1.f; + if (s->fft2 && !s->multi && inlink->ch_layout.nb_channels > 1 && + ((ret = av_tx_init(&s->fft_ctx, &s->fft_fn, AV_TX_FLOAT_FFT, 0, 1 << rdft_bits, &scale, 0)) < 0)) + return ret; if (s->min_phase) { int cepstrum_bits = rdft_bits + 2; @@ -766,15 +767,23 @@ } cepstrum_bits = FFMIN(RDFT_BITS_MAX, cepstrum_bits + 1); - s->cepstrum_rdft = av_rdft_init(cepstrum_bits, DFT_R2C); - s->cepstrum_irdft = av_rdft_init(cepstrum_bits, IDFT_C2R); - if (!s->cepstrum_rdft || !s->cepstrum_irdft) - return AVERROR(ENOMEM); + scale = 1.f; + ret = av_tx_init(&s->cepstrum_rdft, &s->cepstrum_rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << cepstrum_bits, &scale, 0); + if (ret < 0) + return ret; + + iscale = 0.5f; + ret = av_tx_init(&s->cepstrum_irdft, &s->cepstrum_irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << cepstrum_bits, &iscale, 0); + if (ret < 0) + return ret; s->cepstrum_len = 1 << cepstrum_bits; s->cepstrum_buf = av_malloc_array(s->cepstrum_len, sizeof(*s->cepstrum_buf)); if (!s->cepstrum_buf) return AVERROR(ENOMEM); + s->cepstrum_tbuf = av_malloc_array(s->cepstrum_len + 2, sizeof(*s->cepstrum_tbuf)); + if (!s->cepstrum_tbuf) + return AVERROR(ENOMEM); } for ( ; rdft_bits <= RDFT_BITS_MAX; rdft_bits++) { @@ -788,20 +797,26 @@ return AVERROR(EINVAL); } - if (!(s->analysis_irdft = av_rdft_init(rdft_bits, IDFT_C2R))) - return AVERROR(ENOMEM); + iscale = 0.5f; + if ((ret = av_tx_init(&s->analysis_irdft, &s->analysis_irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << rdft_bits, &iscale, 0)) < 0) + return ret; if (s->dumpfile) { - s->analysis_rdft = av_rdft_init(rdft_bits, DFT_R2C); - s->dump_buf = av_malloc_array(s->analysis_rdft_len, sizeof(*s->dump_buf)); + scale = 1.f; + if ((ret = av_tx_init(&s->analysis_rdft, &s->analysis_rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << rdft_bits, &scale, 0)) < 0) + return ret; + s->dump_buf = av_malloc_array(s->analysis_rdft_len + 2, sizeof(*s->dump_buf)); } - s->analysis_buf = av_malloc_array(s->analysis_rdft_len, sizeof(*s->analysis_buf)); - s->kernel_tmp_buf = av_malloc_array(s->rdft_len * (s->multi ? inlink->ch_layout.nb_channels : 1), sizeof(*s->kernel_tmp_buf)); - s->kernel_buf = av_malloc_array(s->rdft_len * (s->multi ? inlink->ch_layout.nb_channels : 1), sizeof(*s->kernel_buf)); + s->analysis_buf = av_malloc_array((s->analysis_rdft_len + 2), sizeof(*s->analysis_buf)); + s->analysis_tbuf = av_malloc_array(s->analysis_rdft_len + 2, sizeof(*s->analysis_tbuf)); + s->kernel_tmp_buf = av_malloc_array((s->rdft_len * 2) * (s->multi ? inlink->ch_layout.nb_channels : 1), sizeof(*s->kernel_tmp_buf)); + s->kernel_tmp_tbuf = av_malloc_array(s->rdft_len, sizeof(*s->kernel_tmp_tbuf)); + s->kernel_buf = av_malloc_array((s->rdft_len * 2) * (s->multi ? inlink->ch_layout.nb_channels : 1), sizeof(*s->kernel_buf)); + s->tx_buf = av_malloc_array(2 * (s->rdft_len + 2), sizeof(*s->kernel_buf)); s->conv_buf = av_calloc(2 * s->rdft_len * inlink->ch_layout.nb_channels, sizeof(*s->conv_buf)); s->conv_idx = av_calloc(inlink->ch_layout.nb_channels, sizeof(*s->conv_idx)); - if (!s->analysis_buf || !s->kernel_tmp_buf || !s->kernel_buf || !s->conv_buf || !s->conv_idx) + if (!s->analysis_buf || !s->analysis_tbuf || !s->kernel_tmp_buf || !s->kernel_buf || !s->conv_buf || !s->conv_idx || !s->kernel_tmp_tbuf || !s->tx_buf) return AVERROR(ENOMEM); av_log(ctx, AV_LOG_DEBUG, "sample_rate = %d, channels = %d, analysis_rdft_len = %d, rdft_len = %d, fir_len = %d, nsamples_max = %d.\n", @@ -821,19 +836,19 @@ if (!s->min_phase) { for (ch = 0; ch + 1 < inlink->ch_layout.nb_channels && s->fft_ctx; ch += 2) { - fast_convolute2(s, s->kernel_buf, (FFTComplex *)(s->conv_buf + 2 * ch * s->rdft_len), + fast_convolute2(s, s->kernel_buf, (AVComplexFloat *)(s->conv_buf + 2 * ch * s->rdft_len), s->conv_idx + ch, (float *) frame->extended_data[ch], (float *) frame->extended_data[ch+1], frame->nb_samples); } for ( ; ch < inlink->ch_layout.nb_channels; ch++) { - fast_convolute(s, s->kernel_buf + (s->multi ? ch * s->rdft_len : 0), + fast_convolute(s, s->kernel_buf + (s->multi ? ch * (s->rdft_len * 2) : 0), s->conv_buf + 2 * ch * s->rdft_len, s->conv_idx + ch, (float *) frame->extended_data[ch], frame->nb_samples); } } else { for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { - fast_convolute_nonlinear(s, s->kernel_buf + (s->multi ? ch * s->rdft_len : 0), + fast_convolute_nonlinear(s, s->kernel_buf + (s->multi ? ch * (s->rdft_len * 2) : 0), s->conv_buf + 2 * ch * s->rdft_len, s->conv_idx + ch, (float *) frame->extended_data[ch], frame->nb_samples); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_headphone.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_headphone.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_headphone.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_headphone.c 2023-03-03 13:29:59.000000000 +0000 @@ -273,7 +273,7 @@ fft_in[j].re = src[j * in_channels + i]; } - tx_fn(fft, fft_out, fft_in, sizeof(float)); + tx_fn(fft, fft_out, fft_in, sizeof(*fft_in)); for (j = 0; j < n_fft; j++) { const AVComplexFloat *hcomplex = hrtf_offset + j; @@ -285,7 +285,7 @@ } } - itx_fn(ifft, fft_out, fft_acc, sizeof(float)); + itx_fn(ifft, fft_out, fft_acc, sizeof(*fft_acc)); for (j = 0; j < in->nb_samples; j++) { dst[2 * j] += fft_out[j].re * fft_scale; @@ -379,7 +379,7 @@ s->n_fft = n_fft = 1 << (32 - ff_clz(ir_len + s->size)); if (s->type == FREQUENCY_DOMAIN) { - float scale; + float scale = 1.f; ret = av_tx_init(&s->fft[0], &s->tx_fn[0], AV_TX_FLOAT_FFT, 0, s->n_fft, &scale, 0); if (ret < 0) @@ -480,8 +480,8 @@ fft_in_r[j].re = ptr[j * 2 + 1] * gain_lin; } - s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(float)); - s->tx_fn[0](s->fft[0], fft_out_r, fft_in_r, sizeof(float)); + s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(*fft_in_l)); + s->tx_fn[0](s->fft[0], fft_out_r, fft_in_r, sizeof(*fft_in_r)); } } else { int I, N = ctx->inputs[1]->ch_layout.nb_channels; @@ -513,8 +513,8 @@ fft_in_r[j].re = ptr[j * N + I + 1] * gain_lin; } - s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(float)); - s->tx_fn[0](s->fft[0], fft_out_r, fft_in_r, sizeof(float)); + s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(*fft_in_l)); + s->tx_fn[0](s->fft[0], fft_out_r, fft_in_r, sizeof(*fft_in_r)); } } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/afir_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/afir_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/afir_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/afir_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/tx.h" #include "avfilter.h" #include "formats.h" #include "internal.h" @@ -26,17 +27,23 @@ #undef ctype #undef ftype #undef SQRT +#undef HYPOT #undef SAMPLE_FORMAT +#undef TX_TYPE #if DEPTH == 32 #define SAMPLE_FORMAT float #define SQRT sqrtf +#define HYPOT hypotf #define ctype AVComplexFloat #define ftype float +#define TX_TYPE AV_TX_FLOAT_RDFT #else #define SAMPLE_FORMAT double #define SQRT sqrt +#define HYPOT hypot #define ctype AVComplexDouble #define ftype double +#define TX_TYPE AV_TX_DOUBLE_RDFT #endif #define fn3(a,b) a##_##b @@ -52,7 +59,8 @@ char text[32]; int channel, i, x; - memset(out->data[0], 0, s->h * out->linesize[0]); + for (int y = 0; y < s->h; y++) + memset(out->data[0] + y * out->linesize[0], 0, s->w * 4); phase = av_malloc_array(s->w, sizeof(*phase)); mag = av_malloc_array(s->w, sizeof(*mag)); @@ -66,7 +74,7 @@ double w = i * M_PI / (s->w - 1); double div, real_num = 0., imag_num = 0., real = 0., imag = 0.; - for (x = 0; x < s->nb_taps; x++) { + for (x = 0; x < s->nb_taps[s->selir]; x++) { real += cos(-x * w) * src[x]; imag += sin(-x * w) * src[x]; real_num += cos(-x * w) * src[x] * x; @@ -132,129 +140,140 @@ av_free(mag); } -static void fn(convert_channels)(AVFilterContext *ctx, AudioFIRContext *s) +static int fn(get_power)(AVFilterContext *ctx, AudioFIRContext *s, + int cur_nb_taps, int ch, + ftype *time) { - for (int ch = 0; ch < ctx->inputs[1 + s->selir]->ch_layout.nb_channels; ch++) { - ftype *time = (ftype *)s->ir[s->selir]->extended_data[!s->one2many * ch]; - int toffset = 0; - - for (int i = FFMAX(1, s->length * s->nb_taps); i < s->nb_taps; i++) - time[i] = 0; - - av_log(ctx, AV_LOG_DEBUG, "channel: %d\n", ch); - - for (int segment = 0; segment < s->nb_segments; segment++) { - AudioFIRSegment *seg = &s->seg[segment]; - ftype *blockin = (ftype *)seg->blockin->extended_data[ch]; - ftype *blockout = (ftype *)seg->blockout->extended_data[ch]; - ctype *coeff = (ctype *)seg->coeff->extended_data[ch]; - - av_log(ctx, AV_LOG_DEBUG, "segment: %d\n", segment); - - for (int i = 0; i < seg->nb_partitions; i++) { - const int coffset = i * seg->coeff_size; - const int remaining = s->nb_taps - toffset; - const int size = remaining >= seg->part_size ? seg->part_size : remaining; - - if (size < 8) { - for (int n = 0; n < size; n++) - coeff[coffset + n].re = time[toffset + n]; - - toffset += size; - continue; - } - - memset(blockin, 0, sizeof(*blockin) * seg->fft_length); - memcpy(blockin, time + toffset, size * sizeof(*blockin)); - - seg->tx_fn(seg->tx[0], blockout, blockin, sizeof(ftype)); - - for (int n = 0; n < seg->part_size + 1; n++) { - coeff[coffset + n].re = blockout[2 * n]; - coeff[coffset + n].im = blockout[2 * n + 1]; - } - - toffset += size; - } - - av_log(ctx, AV_LOG_DEBUG, "nb_partitions: %d\n", seg->nb_partitions); - av_log(ctx, AV_LOG_DEBUG, "partition size: %d\n", seg->part_size); - av_log(ctx, AV_LOG_DEBUG, "block size: %d\n", seg->block_size); - av_log(ctx, AV_LOG_DEBUG, "fft_length: %d\n", seg->fft_length); - av_log(ctx, AV_LOG_DEBUG, "coeff_size: %d\n", seg->coeff_size); - av_log(ctx, AV_LOG_DEBUG, "input_size: %d\n", seg->input_size); - av_log(ctx, AV_LOG_DEBUG, "input_offset: %d\n", seg->input_offset); - } - } -} - -static int fn(get_power)(AVFilterContext *ctx, AudioFIRContext *s, int cur_nb_taps) -{ - ftype power = 0; - int ch; + ftype ch_gain = 1; switch (s->gtype) { case -1: - /* nothing to do */ + ch_gain = 1; break; case 0: - for (ch = 0; ch < ctx->inputs[1 + s->selir]->ch_layout.nb_channels; ch++) { - ftype *time = (ftype *)s->ir[s->selir]->extended_data[!s->one2many * ch]; + { + ftype sum = 0; for (int i = 0; i < cur_nb_taps; i++) - power += FFABS(time[i]); + sum += FFABS(time[i]); + ch_gain = 1. / sum; } - s->gain = ctx->inputs[1 + s->selir]->ch_layout.nb_channels / power; break; case 1: - for (ch = 0; ch < ctx->inputs[1 + s->selir]->ch_layout.nb_channels; ch++) { - ftype *time = (ftype *)s->ir[s->selir]->extended_data[!s->one2many * ch]; + { + ftype sum = 0; for (int i = 0; i < cur_nb_taps; i++) - power += time[i]; + sum += time[i]; + ch_gain = 1. / sum; } - s->gain = ctx->inputs[1 + s->selir]->ch_layout.nb_channels / power; break; case 2: - for (ch = 0; ch < ctx->inputs[1 + s->selir]->ch_layout.nb_channels; ch++) { - ftype *time = (ftype *)s->ir[s->selir]->extended_data[!s->one2many * ch]; + { + ftype sum = 0; for (int i = 0; i < cur_nb_taps; i++) - power += time[i] * time[i]; + sum += time[i] * time[i]; + ch_gain = 1. / SQRT(sum); + } + break; + case 3: + case 4: + { + ftype *inc, *outc, scale, power; + AVTXContext *tx; + av_tx_fn tx_fn; + int ret, size; + + size = 1 << av_ceil_log2_c(cur_nb_taps); + inc = av_calloc(size + 2, sizeof(SAMPLE_FORMAT)); + outc = av_calloc(size + 2, sizeof(SAMPLE_FORMAT)); + if (!inc || !outc) { + av_free(outc); + av_free(inc); + break; + } + + scale = 1.; + ret = av_tx_init(&tx, &tx_fn, TX_TYPE, 0, size, &scale, 0); + if (ret < 0) { + av_free(outc); + av_free(inc); + break; + } + + { + memcpy(inc, time, cur_nb_taps * sizeof(SAMPLE_FORMAT)); + tx_fn(tx, outc, inc, sizeof(SAMPLE_FORMAT)); + + power = 0; + if (s->gtype == 3) { + for (int i = 0; i < size / 2 + 1; i++) + power = FFMAX(power, HYPOT(outc[i * 2], outc[i * 2 + 1])); + } else { + ftype sum = 0; + for (int i = 0; i < size / 2 + 1; i++) + sum += HYPOT(outc[i * 2], outc[i * 2 + 1]); + power = SQRT(sum / (size / 2 + 1)); + } + + ch_gain = 1. / power; + } + + av_tx_uninit(&tx); + av_free(outc); + av_free(inc); } - s->gain = SQRT(ch / power); break; default: return AVERROR_BUG; } - s->gain = FFMIN(s->gain * s->ir_gain, 1.); - - av_log(ctx, AV_LOG_DEBUG, "power %f, gain %f\n", power, s->gain); - - for (int ch = 0; ch < ctx->inputs[1 + s->selir]->ch_layout.nb_channels; ch++) { - ftype *time = (ftype *)s->ir[s->selir]->extended_data[!s->one2many * ch]; + if (ch_gain != 1. || s->ir_gain != 1.) { + ftype gain = ch_gain * s->ir_gain; + av_log(ctx, AV_LOG_DEBUG, "ch%d gain %f\n", ch, gain); #if DEPTH == 32 - s->fdsp->vector_fmul_scalar(time, time, s->gain, FFALIGN(cur_nb_taps, 4)); + s->fdsp->vector_fmul_scalar(time, time, gain, FFALIGN(cur_nb_taps, 4)); #else - s->fdsp->vector_dmul_scalar(time, time, s->gain, FFALIGN(cur_nb_taps, 8)); + s->fdsp->vector_dmul_scalar(time, time, gain, FFALIGN(cur_nb_taps, 8)); #endif } return 0; } -static void fn(direct)(const ftype *in, const ctype *ir, int len, ftype *out) +static void fn(convert_channel)(AVFilterContext *ctx, AudioFIRContext *s, int ch, + AudioFIRSegment *seg, int coeff_partition, int selir) { - for (int n = 0; n < len; n++) - for (int m = 0; m <= n; m++) - out[n] += ir[m].re * in[n - m]; + const int coffset = coeff_partition * seg->coeff_size; + const int nb_taps = s->nb_taps[selir]; + ftype *time = (ftype *)s->norm_ir[selir]->extended_data[ch]; + ftype *tempin = (ftype *)seg->tempin->extended_data[ch]; + ftype *tempout = (ftype *)seg->tempout->extended_data[ch]; + ctype *coeff = (ctype *)seg->coeff[selir]->extended_data[ch]; + const int remaining = nb_taps - (seg->input_offset + coeff_partition * seg->part_size); + const int size = remaining >= seg->part_size ? seg->part_size : remaining; + + memset(tempin + size, 0, sizeof(*tempin) * (seg->block_size - size)); + memcpy(tempin, time + seg->input_offset + coeff_partition * seg->part_size, + size * sizeof(*tempin)); + seg->ctx_fn(seg->ctx[ch], tempout, tempin, sizeof(*tempin)); + memcpy(coeff + coffset, tempout, seg->coeff_size * sizeof(*coeff)); + + av_log(ctx, AV_LOG_DEBUG, "channel: %d\n", ch); + av_log(ctx, AV_LOG_DEBUG, "nb_partitions: %d\n", seg->nb_partitions); + av_log(ctx, AV_LOG_DEBUG, "partition size: %d\n", seg->part_size); + av_log(ctx, AV_LOG_DEBUG, "block size: %d\n", seg->block_size); + av_log(ctx, AV_LOG_DEBUG, "fft_length: %d\n", seg->fft_length); + av_log(ctx, AV_LOG_DEBUG, "coeff_size: %d\n", seg->coeff_size); + av_log(ctx, AV_LOG_DEBUG, "input_size: %d\n", seg->input_size); + av_log(ctx, AV_LOG_DEBUG, "input_offset: %d\n", seg->input_offset); } static void fn(fir_fadd)(AudioFIRContext *s, ftype *dst, const ftype *src, int nb_samples) { - if ((nb_samples & 15) == 0 && nb_samples >= 16) { + if ((nb_samples & 15) == 0 && nb_samples >= 8) { #if DEPTH == 32 s->fdsp->vector_fmac_scalar(dst, src, 1.f, nb_samples); #else @@ -270,111 +289,175 @@ { AudioFIRContext *s = ctx->priv; const ftype *in = (const ftype *)s->in->extended_data[ch] + offset; - ftype *blockin, *blockout, *buf, *ptr = (ftype *)out->extended_data[ch] + offset; - const int nb_samples = FFMIN(s->min_part_size, out->nb_samples - offset); - int n, i, j; + ftype *blockout, *ptr = (ftype *)out->extended_data[ch] + offset; + const int min_part_size = s->min_part_size; + const int nb_samples = FFMIN(min_part_size, out->nb_samples - offset); + const int nb_segments = s->nb_segments; + const float dry_gain = s->dry_gain; + const int selir = s->selir; - for (int segment = 0; segment < s->nb_segments; segment++) { + for (int segment = 0; segment < nb_segments; segment++) { AudioFIRSegment *seg = &s->seg[segment]; ftype *src = (ftype *)seg->input->extended_data[ch]; ftype *dst = (ftype *)seg->output->extended_data[ch]; ftype *sumin = (ftype *)seg->sumin->extended_data[ch]; ftype *sumout = (ftype *)seg->sumout->extended_data[ch]; + ftype *tempin = (ftype *)seg->tempin->extended_data[ch]; + ftype *buf = (ftype *)seg->buffer->extended_data[ch]; + int *output_offset = &seg->output_offset[ch]; + const int nb_partitions = seg->nb_partitions; + const int input_offset = seg->input_offset; + const int part_size = seg->part_size; + int j; - if (s->min_part_size >= 8) { + seg->part_index[ch] = seg->part_index[ch] % nb_partitions; + if (min_part_size >= 8) { #if DEPTH == 32 - s->fdsp->vector_fmul_scalar(src + seg->input_offset, in, s->dry_gain, FFALIGN(nb_samples, 4)); + s->fdsp->vector_fmul_scalar(src + input_offset, in, dry_gain, FFALIGN(nb_samples, 4)); #else - s->fdsp->vector_dmul_scalar(src + seg->input_offset, in, s->dry_gain, FFALIGN(nb_samples, 8)); + s->fdsp->vector_dmul_scalar(src + input_offset, in, dry_gain, FFALIGN(nb_samples, 8)); #endif emms_c(); } else { - for (n = 0; n < nb_samples; n++) - src[seg->input_offset + n] = in[n] * s->dry_gain; + ftype *src2 = src + input_offset; + for (int n = 0; n < nb_samples; n++) + src2[n] = in[n] * dry_gain; } - seg->output_offset[ch] += s->min_part_size; - if (seg->output_offset[ch] == seg->part_size) { - seg->output_offset[ch] = 0; + output_offset[0] += min_part_size; + if (output_offset[0] >= part_size) { + output_offset[0] = 0; } else { - memmove(src, src + s->min_part_size, (seg->input_size - s->min_part_size) * sizeof(*src)); + memmove(src, src + min_part_size, (seg->input_size - min_part_size) * sizeof(*src)); - dst += seg->output_offset[ch]; + dst += output_offset[0]; fn(fir_fadd)(s, ptr, dst, nb_samples); continue; } - if (seg->part_size < 8) { - memset(dst, 0, sizeof(*dst) * seg->part_size * seg->nb_partitions); - - j = seg->part_index[ch]; - - for (i = 0; i < seg->nb_partitions; i++) { - const int coffset = j * seg->coeff_size; - const ctype *coeff = (const ctype *)seg->coeff->extended_data[ch * !s->one2many] + coffset; + memset(sumin, 0, sizeof(*sumin) * seg->fft_length); - fn(direct)(src, coeff, nb_samples, dst); + if (seg->loading[ch] < nb_partitions) { + j = seg->part_index[ch] <= 0 ? nb_partitions - 1 : seg->part_index[ch] - 1; + for (int i = 0; i < nb_partitions; i++) { + const int input_partition = j; + const int coeff_partition = i; + const int coffset = coeff_partition * seg->coeff_size; + const ftype *blockout = (const ftype *)seg->blockout->extended_data[ch] + input_partition * seg->block_size; + const ctype *coeff = ((const ctype *)seg->coeff[selir]->extended_data[ch]) + coffset; if (j == 0) - j = seg->nb_partitions; + j = nb_partitions; j--; - } - - seg->part_index[ch] = (seg->part_index[ch] + 1) % seg->nb_partitions; - memmove(src, src + s->min_part_size, (seg->input_size - s->min_part_size) * sizeof(*src)); - - for (n = 0; n < nb_samples; n++) { - ptr[n] += dst[n]; +#if DEPTH == 32 + s->afirdsp.fcmul_add(sumin, blockout, (const ftype *)coeff, part_size); +#else + s->afirdsp.dcmul_add(sumin, blockout, (const ftype *)coeff, part_size); +#endif } - continue; + + seg->itx_fn(seg->itx[ch], sumout, sumin, sizeof(ctype)); + memcpy(dst + part_size, sumout + part_size, part_size * sizeof(*buf)); + memset(sumin, 0, sizeof(*sumin) * seg->fft_length); } - memset(sumin, 0, sizeof(*sumin) * seg->fft_length); - blockin = (ftype *)seg->blockin->extended_data[ch] + seg->part_index[ch] * seg->block_size; blockout = (ftype *)seg->blockout->extended_data[ch] + seg->part_index[ch] * seg->block_size; - memset(blockin + seg->part_size, 0, sizeof(*blockin) * (seg->fft_length - seg->part_size)); - - memcpy(blockin, src, sizeof(*src) * seg->part_size); + memset(tempin + part_size, 0, sizeof(*tempin) * (seg->block_size - part_size)); + memcpy(tempin, src, sizeof(*src) * part_size); + seg->tx_fn(seg->tx[ch], blockout, tempin, sizeof(ftype)); - seg->tx_fn(seg->tx[ch], blockout, blockin, sizeof(ftype)); + if (seg->loading[ch] < nb_partitions) { + const int selir = s->prev_selir; - j = seg->part_index[ch]; + j = seg->part_index[ch]; + for (int i = 0; i < nb_partitions; i++) { + const int input_partition = j; + const int coeff_partition = i; + const int coffset = coeff_partition * seg->coeff_size; + const ftype *blockout = (const ftype *)seg->blockout->extended_data[ch] + input_partition * seg->block_size; + const ctype *coeff = ((const ctype *)seg->coeff[selir]->extended_data[ch]) + coffset; - for (i = 0; i < seg->nb_partitions; i++) { - const int coffset = j * seg->coeff_size; - const ftype *blockout = (const ftype *)seg->blockout->extended_data[ch] + i * seg->block_size; - const ctype *coeff = (const ctype *)seg->coeff->extended_data[ch * !s->one2many] + coffset; + if (j == 0) + j = nb_partitions; + j--; #if DEPTH == 32 - s->afirdsp.fcmul_add(sumin, blockout, (const ftype *)coeff, seg->part_size); + s->afirdsp.fcmul_add(sumin, blockout, (const ftype *)coeff, part_size); #else - s->afirdsp.dcmul_add(sumin, blockout, (const ftype *)coeff, seg->part_size); + s->afirdsp.dcmul_add(sumin, blockout, (const ftype *)coeff, part_size); #endif + } - if (j == 0) - j = seg->nb_partitions; - j--; + seg->itx_fn(seg->itx[ch], sumout, sumin, sizeof(ctype)); + memcpy(dst + 2 * part_size, sumout, 2 * part_size * sizeof(*dst)); + memset(sumin, 0, sizeof(*sumin) * seg->fft_length); } - seg->itx_fn(seg->itx[ch], sumout, sumin, sizeof(ftype)); - - buf = (ftype *)seg->buffer->extended_data[ch]; - fn(fir_fadd)(s, buf, sumout, seg->part_size); + j = seg->part_index[ch]; + for (int i = 0; i < nb_partitions; i++) { + const int input_partition = j; + const int coeff_partition = i; + const int coffset = coeff_partition * seg->coeff_size; + const ftype *blockout = (const ftype *)seg->blockout->extended_data[ch] + input_partition * seg->block_size; + const ctype *coeff = ((const ctype *)seg->coeff[selir]->extended_data[ch]) + coffset; - memcpy(dst, buf, seg->part_size * sizeof(*dst)); + if (j == 0) + j = nb_partitions; + j--; - buf = (ftype *)seg->buffer->extended_data[ch]; - memcpy(buf, sumout + seg->part_size, seg->part_size * sizeof(*buf)); +#if DEPTH == 32 + s->afirdsp.fcmul_add(sumin, blockout, (const ftype *)coeff, part_size); +#else + s->afirdsp.dcmul_add(sumin, blockout, (const ftype *)coeff, part_size); +#endif + } - seg->part_index[ch] = (seg->part_index[ch] + 1) % seg->nb_partitions; + seg->itx_fn(seg->itx[ch], sumout, sumin, sizeof(ctype)); - memmove(src, src + s->min_part_size, (seg->input_size - s->min_part_size) * sizeof(*src)); + if (seg->loading[ch] < nb_partitions) { + ftype *ptr1 = dst + part_size; + ftype *ptr2 = dst + part_size * 2; + ftype *ptr3 = dst + part_size * 3; + ftype *ptr4 = dst + part_size * 4; + if (seg->loading[ch] == 0) + memcpy(ptr4, buf, sizeof(*ptr4) * part_size); + for (int n = 0; n < part_size; n++) + ptr2[n] += ptr4[n]; + + if (seg->loading[ch] < nb_partitions - 1) + memcpy(ptr4, ptr3, part_size * sizeof(*dst)); + for (int n = 0; n < part_size; n++) + ptr1[n] += sumout[n]; + + if (seg->loading[ch] == nb_partitions - 1) + memcpy(buf, sumout + part_size, part_size * sizeof(*buf)); + + for (int i = 0; i < part_size; i++) { + const ftype factor = (part_size * seg->loading[ch] + i) / (ftype)(part_size * nb_partitions); + const ftype ifactor = 1 - factor; + dst[i] = ptr1[i] * factor + ptr2[i] * ifactor; + } + } else { + fn(fir_fadd)(s, buf, sumout, part_size); + memcpy(dst, buf, part_size * sizeof(*dst)); + memcpy(buf, sumout + part_size, part_size * sizeof(*buf)); + } fn(fir_fadd)(s, ptr, dst, nb_samples); + + if (part_size != min_part_size) + memmove(src, src + min_part_size, (seg->input_size - min_part_size) * sizeof(*src)); + + seg->part_index[ch] = (seg->part_index[ch] + 1) % nb_partitions; + if (seg->loading[ch] < nb_partitions) + seg->loading[ch]++; } - if (s->min_part_size >= 8) { + if (s->wet_gain == 1.f) + return 0; + + if (min_part_size >= 8) { #if DEPTH == 32 s->fdsp->vector_fmul_scalar(ptr, ptr, s->wet_gain, FFALIGN(nb_samples, 4)); #else @@ -382,11 +465,9 @@ #endif emms_c(); } else { - for (n = 0; n < nb_samples; n++) + for (int n = 0; n < nb_samples; n++) ptr[n] *= s->wet_gain; } return 0; } - - diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_loudnorm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_loudnorm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_loudnorm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_loudnorm.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "libavutil/opt.h" #include "avfilter.h" +#include "filters.h" #include "internal.h" #include "audio.h" #include "ebur128.h" @@ -85,7 +86,7 @@ int attack_length; int release_length; - int64_t pts; + int64_t pts[30]; enum FrameType frame_type; int above_threshold; int prev_nb_samples; @@ -431,10 +432,9 @@ av_frame_copy_props(out, in); } - if (s->pts == AV_NOPTS_VALUE) - s->pts = in->pts; + out->pts = s->pts[0]; + memmove(s->pts, &s->pts[1], (FF_ARRAY_ELEMS(s->pts) - 1) * sizeof(s->pts[0])); - out->pts = s->pts; src = (const double *)in->data[0]; dst = (double *)out->data[0]; buf = s->buf; @@ -455,7 +455,7 @@ offset = pow(10., (s->target_i - global) / 20.); offset_tp = true_peak * offset; - s->offset = offset_tp < s->target_tp ? offset : s->target_tp - true_peak; + s->offset = offset_tp < s->target_tp ? offset : s->target_tp / true_peak; s->frame_type = LINEAR_MODE; } @@ -501,10 +501,7 @@ true_peak_limiter(s, dst, subframe_length, inlink->ch_layout.nb_channels); ff_ebur128_add_frames_double(s->r128_out, dst, subframe_length); - s->pts += - out->nb_samples = - inlink->min_samples = - inlink->max_samples = subframe_length; + out->nb_samples = subframe_length; s->frame_type = INNER_FRAME; break; @@ -568,7 +565,6 @@ if (s->index >= 30) s->index -= 30; s->prev_nb_samples = in->nb_samples; - s->pts += in->nb_samples; break; case FINAL_FRAME: @@ -626,25 +622,22 @@ dst = (double *)out->data[0]; ff_ebur128_add_frames_double(s->r128_out, dst, in->nb_samples); - s->pts += in->nb_samples; break; } if (in != out) av_frame_free(&in); - return ff_filter_frame(outlink, out); } -static int request_frame(AVFilterLink *outlink) +static int flush_frame(AVFilterLink *outlink) { - int ret; AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; LoudNormContext *s = ctx->priv; + int ret = 0; - ret = ff_request_frame(inlink); - if (ret == AVERROR_EOF && s->frame_type == INNER_FRAME) { + if (s->frame_type == INNER_FRAME) { double *src; double *buf; int nb_samples, n, c, offset; @@ -681,38 +674,82 @@ return ret; } -static int query_formats(AVFilterContext *ctx) +static int activate(AVFilterContext *ctx) { - LoudNormContext *s = ctx->priv; - AVFilterFormats *formats; AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; + LoudNormContext *s = ctx->priv; + AVFrame *in = NULL; + int ret = 0, status; + int64_t pts; + + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + + if (s->frame_type != LINEAR_MODE) { + int nb_samples; + + if (s->frame_type == FIRST_FRAME) { + nb_samples = frame_size(inlink->sample_rate, 3000); + } else { + nb_samples = frame_size(inlink->sample_rate, 100); + } + + ret = ff_inlink_consume_samples(inlink, nb_samples, nb_samples, &in); + } else { + ret = ff_inlink_consume_frame(inlink, &in); + } + + if (ret < 0) + return ret; + if (ret > 0) { + if (s->frame_type == FIRST_FRAME) { + const int nb_samples = frame_size(inlink->sample_rate, 100); + + for (int i = 0; i < FF_ARRAY_ELEMS(s->pts); i++) + s->pts[i] = in->pts + i * nb_samples; + } else if (s->frame_type == LINEAR_MODE) { + s->pts[0] = in->pts; + } else { + s->pts[FF_ARRAY_ELEMS(s->pts) - 1] = in->pts; + } + ret = filter_frame(inlink, in); + } + if (ret < 0) + return ret; + + if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { + ff_outlink_set_status(outlink, status, pts); + return flush_frame(outlink); + } + + FF_FILTER_FORWARD_WANTED(outlink, inlink); + + return FFERROR_NOT_READY; +} + +static int query_formats(AVFilterContext *ctx) +{ + LoudNormContext *s = ctx->priv; + AVFilterFormats *formats = NULL; static const int input_srate[] = {192000, -1}; - static const enum AVSampleFormat sample_fmts[] = { - AV_SAMPLE_FMT_DBL, - AV_SAMPLE_FMT_NONE - }; int ret = ff_set_common_all_channel_counts(ctx); if (ret < 0) return ret; - ret = ff_set_common_formats_from_list(ctx, sample_fmts); - if (ret < 0) + ret = ff_add_format(&formats, AV_SAMPLE_FMT_DBL); + if (ret) + return ret; + ret = ff_set_common_formats(ctx, formats); + if (ret) return ret; if (s->frame_type != LINEAR_MODE) { formats = ff_make_format_list(input_srate); - if (!formats) - return AVERROR(ENOMEM); - ret = ff_formats_ref(formats, &inlink->outcfg.samplerates); - if (ret < 0) - return ret; - ret = ff_formats_ref(formats, &outlink->incfg.samplerates); - if (ret < 0) - return ret; + } else { + formats = ff_all_samplerates(); } - return 0; + return ff_set_common_samplerates(ctx, formats); } static int config_input(AVFilterLink *inlink) @@ -749,12 +786,6 @@ init_gaussian_filter(s); - if (s->frame_type != LINEAR_MODE) { - inlink->min_samples = - inlink->max_samples = frame_size(inlink->sample_rate, 3000); - } - - s->pts = AV_NOPTS_VALUE; s->buf_index = s->prev_buf_index = s->limiter_buf_index = 0; @@ -894,14 +925,12 @@ .name = "default", .type = AVMEDIA_TYPE_AUDIO, .config_props = config_input, - .filter_frame = filter_frame, }, }; static const AVFilterPad avfilter_af_loudnorm_outputs[] = { { .name = "default", - .request_frame = request_frame, .type = AVMEDIA_TYPE_AUDIO, }, }; @@ -912,6 +941,7 @@ .priv_size = sizeof(LoudNormContext), .priv_class = &loudnorm_class, .init = init, + .activate = activate, .uninit = uninit, FILTER_INPUTS(avfilter_af_loudnorm_inputs), FILTER_OUTPUTS(avfilter_af_loudnorm_outputs), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_pan.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_pan.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_pan.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_pan.c 2023-03-03 13:29:59.000000000 +0000 @@ -313,7 +313,7 @@ pan->channel_map[i] = ch_id; } - av_opt_set_int(pan->swr, "uch", pan->nb_output_channels, 0); + av_opt_set_chlayout(pan->swr, "uchl", &pan->out_channel_layout, 0); swr_set_channel_mapping(pan->swr, pan->channel_map); } else { // renormalize diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_silenceremove.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_silenceremove.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_silenceremove.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_silenceremove.c 2023-03-03 13:29:59.000000000 +0000 @@ -481,10 +481,12 @@ s->stop_holdoff_end = 0; s->stop_found_periods = 0; - if (s->start_periods) + if (s->start_periods) { s->mode = SILENCE_TRIM; - else + s->one_period = 1; + } else { s->mode = SILENCE_COPY; + } switch (inlink->format) { case AV_SAMPLE_FMT_DBL: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_sofalizer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_sofalizer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_sofalizer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_sofalizer.c 2023-03-03 13:29:59.000000000 +0000 @@ -525,7 +525,7 @@ } /* transform input signal of current channel to frequency domain */ - tx_fn(fft, fft_out, fft_in, sizeof(float)); + tx_fn(fft, fft_out, fft_in, sizeof(*fft_in)); for (j = 0; j < n_fft; j++) { const AVComplexFloat *hcomplex = hrtf_offset + j; @@ -541,7 +541,7 @@ } /* transform output signal of current channel back to time domain */ - itx_fn(ifft, fft_out, fft_acc, sizeof(float)); + itx_fn(ifft, fft_out, fft_acc, sizeof(*fft_acc)); for (j = 0; j < in->nb_samples; j++) { /* write output signal of current channel to output buffer */ @@ -832,7 +832,7 @@ s->n_fft = n_fft = 1 << (32 - ff_clz(n_max + s->framesize)); if (s->type == FREQUENCY_DOMAIN) { - float scale; + float scale = 1.f; av_tx_uninit(&s->fft[0]); av_tx_uninit(&s->fft[1]); @@ -927,9 +927,9 @@ } /* actually transform to frequency domain (IRs -> HRTFs) */ - s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(float)); + s->tx_fn[0](s->fft[0], fft_out_l, fft_in_l, sizeof(*fft_in_l)); memcpy(data_hrtf_l + offset, fft_out_l, n_fft * sizeof(*fft_out_l)); - s->tx_fn[1](s->fft[1], fft_out_r, fft_in_r, sizeof(float)); + s->tx_fn[1](s->fft[1], fft_out_r, fft_in_r, sizeof(*fft_in_r)); memcpy(data_hrtf_r + offset, fft_out_r, n_fft * sizeof(*fft_out_r)); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_speechnorm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_speechnorm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_speechnorm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_speechnorm.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,6 +46,7 @@ int size; int type; double max_peak; + double rms_sum; } PeriodItem; typedef struct ChannelContext { @@ -54,6 +55,7 @@ PeriodItem pi[MAX_ITEMS]; double gain_state; double pi_max_peak; + double pi_rms_sum; int pi_start; int pi_end; int pi_size; @@ -62,6 +64,7 @@ typedef struct SpeechNormalizerContext { const AVClass *class; + double rms_value; double peak_value; double max_expansion; double max_compression; @@ -110,6 +113,8 @@ { "i", "set inverted filtering", OFFSET(invert), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { "link", "set linked channels filtering", OFFSET(link), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { "l", "set linked channels filtering", OFFSET(link), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, + { "rms", "set the RMS value", OFFSET(rms_value), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0.0, 1.0, FLAGS }, + { "m", "set the RMS value", OFFSET(rms_value), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0.0, 1.0, FLAGS }, { NULL } }; @@ -161,12 +166,16 @@ } } -static double next_gain(AVFilterContext *ctx, double pi_max_peak, int bypass, double state) +static double next_gain(AVFilterContext *ctx, double pi_max_peak, int bypass, double state, + double pi_rms_sum, int pi_size) { SpeechNormalizerContext *s = ctx->priv; - const double expansion = FFMIN(s->max_expansion, s->peak_value / pi_max_peak); const double compression = 1. / s->max_compression; const int type = s->invert ? pi_max_peak <= s->threshold_value : pi_max_peak >= s->threshold_value; + double expansion = FFMIN(s->max_expansion, s->peak_value / pi_max_peak); + + if (s->rms_value > DBL_EPSILON) + expansion = FFMIN(expansion, s->rms_value / sqrt(pi_rms_sum / pi_size)); if (bypass) { return 1.; @@ -187,13 +196,15 @@ av_assert1(cc->pi[start].size > 0); av_assert0(cc->pi[start].type > 0 || s->eof); cc->pi_size = cc->pi[start].size; + cc->pi_rms_sum = cc->pi[start].rms_sum; cc->pi_max_peak = cc->pi[start].max_peak; av_assert1(cc->pi_start != cc->pi_end || s->eof); start++; if (start >= MAX_ITEMS) start = 0; cc->pi_start = start; - cc->gain_state = next_gain(ctx, cc->pi_max_peak, bypass, cc->gain_state); + cc->gain_state = next_gain(ctx, cc->pi_max_peak, bypass, cc->gain_state, + cc->pi_rms_sum, cc->pi_size); } } @@ -209,7 +220,8 @@ while (size <= max_size) { if (idx == cc->pi_end) break; - gain_state = next_gain(ctx, cc->pi[idx].max_peak, 0, gain_state); + gain_state = next_gain(ctx, cc->pi[idx].max_peak, 0, gain_state, + cc->pi[idx].rms_sum, cc->pi[idx].size); min_gain = FFMIN(min_gain, gain_state); size += cc->pi[idx].size; idx++; @@ -236,11 +248,13 @@ \ while (n < nb_samples) { \ ptype new_max_peak; \ + ptype new_rms_sum; \ int new_size; \ \ if ((cc->state != (src[n] >= zero)) || \ (pi[pi_end].size > max_period)) { \ ptype max_peak = pi[pi_end].max_peak; \ + ptype rms_sum = pi[pi_end].rms_sum; \ int state = cc->state; \ \ cc->state = src[n] >= zero; \ @@ -251,10 +265,13 @@ pi_end++; \ if (pi_end >= MAX_ITEMS) \ pi_end = 0; \ - if (cc->state != state) \ + if (cc->state != state) { \ pi[pi_end].max_peak = DBL_MIN; \ - else \ + pi[pi_end].rms_sum = 0.0; \ + } else { \ pi[pi_end].max_peak = max_peak; \ + pi[pi_end].rms_sum = rms_sum; \ + } \ pi[pi_end].type = 0; \ pi[pi_end].size = 0; \ av_assert1(pi_end != cc->pi_start); \ @@ -262,10 +279,12 @@ } \ \ new_max_peak = pi[pi_end].max_peak; \ + new_rms_sum = pi[pi_end].rms_sum; \ new_size = pi[pi_end].size; \ if (cc->state) { \ while (src[n] >= zero) { \ new_max_peak = FFMAX(new_max_peak, src[n]); \ + new_rms_sum += src[n] * src[n]; \ new_size++; \ n++; \ if (n >= nb_samples) \ @@ -274,6 +293,7 @@ } else { \ while (src[n] < zero) { \ new_max_peak = FFMAX(new_max_peak, -src[n]); \ + new_rms_sum += src[n] * src[n]; \ new_size++; \ n++; \ if (n >= nb_samples) \ @@ -282,6 +302,7 @@ } \ \ pi[pi_end].max_peak = new_max_peak; \ + pi[pi_end].rms_sum = new_rms_sum; \ pi[pi_end].size = new_size; \ } \ cc->pi_end = pi_end; \ @@ -345,7 +366,6 @@ \ while (n < nb_samples) { \ int min_size = nb_samples - n; \ - int max_size = 1; \ ptype gain = s->max_expansion; \ \ for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { \ @@ -356,7 +376,6 @@ \ next_pi(ctx, cc, cc->bypass); \ min_size = FFMIN(min_size, cc->pi_size); \ - max_size = FFMAX(max_size, cc->pi_size); \ } \ \ av_assert1(min_size > 0); \ @@ -365,7 +384,7 @@ \ if (cc->bypass) \ continue; \ - gain = FFMIN(gain, min_gain(ctx, cc, max_size)); \ + gain = FFMIN(gain, min_gain(ctx, cc, min_size)); \ } \ \ for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { \ @@ -517,7 +536,7 @@ ChannelContext *cc = &s->cc[ch]; cc->state = -1; - cc->gain_state = 1.; + cc->gain_state = s->max_expansion; } switch (inlink->format) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_superequalizer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_superequalizer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_superequalizer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_superequalizer.c 2023-03-03 13:29:59.000000000 +0000 @@ -225,7 +225,7 @@ fsamples_out[i*2+1] = im; } - s->itx_fn(s->irdft, fsamples, fsamples_out, sizeof(float)); + s->itx_fn(s->irdft, fsamples, fsamples_out, sizeof(AVComplexFloat)); for (i = 0; i < s->winlen; i++) dst[i] += fsamples[i] / s->tabsize; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_surround.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_surround.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_surround.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_surround.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,35 @@ #include "formats.h" #include "window_func.h" +enum SurroundChannel { + SC_FL, SC_FR, SC_FC, SC_LF, SC_BL, SC_BR, SC_BC, SC_SL, SC_SR, + SC_NB, +}; + +static const int ch_map[SC_NB] = { + [SC_FL] = AV_CHAN_FRONT_LEFT, + [SC_FR] = AV_CHAN_FRONT_RIGHT, + [SC_FC] = AV_CHAN_FRONT_CENTER, + [SC_LF] = AV_CHAN_LOW_FREQUENCY, + [SC_BL] = AV_CHAN_BACK_LEFT, + [SC_BR] = AV_CHAN_BACK_RIGHT, + [SC_BC] = AV_CHAN_BACK_CENTER, + [SC_SL] = AV_CHAN_SIDE_LEFT, + [SC_SR] = AV_CHAN_SIDE_RIGHT, +}; + +static const int sc_map[16] = { + [AV_CHAN_FRONT_LEFT ] = SC_FL, + [AV_CHAN_FRONT_RIGHT ] = SC_FR, + [AV_CHAN_FRONT_CENTER ] = SC_FC, + [AV_CHAN_LOW_FREQUENCY] = SC_LF, + [AV_CHAN_BACK_LEFT ] = SC_BL, + [AV_CHAN_BACK_RIGHT ] = SC_BR, + [AV_CHAN_BACK_CENTER ] = SC_BC, + [AV_CHAN_SIDE_LEFT ] = SC_SL, + [AV_CHAN_SIDE_RIGHT ] = SC_SR, +}; + typedef struct AudioSurroundContext { const AVClass *class; @@ -37,26 +66,12 @@ float level_in; float level_out; - float fc_in; - float fc_out; - float fl_in; - float fl_out; - float fr_in; - float fr_out; - float sl_in; - float sl_out; - float sr_in; - float sr_out; - float bl_in; - float bl_out; - float br_in; - float br_out; - float bc_in; - float bc_out; - float lfe_in; - float lfe_out; + float f_i[SC_NB]; + float f_o[SC_NB]; int lfe_mode; + float smooth; float angle; + float focus; int win_size; int win_func; float overlap; @@ -64,76 +79,53 @@ float all_x; float all_y; - float fc_x; - float fl_x; - float fr_x; - float bl_x; - float br_x; - float sl_x; - float sr_x; - float bc_x; - - float fc_y; - float fl_y; - float fr_y; - float bl_y; - float br_y; - float sl_y; - float sr_y; - float bc_y; + float f_x[SC_NB]; + float f_y[SC_NB]; float *input_levels; float *output_levels; int output_lfe; + int create_lfe; int lowcutf; int highcutf; float lowcut; float highcut; - AVChannelLayout out_channel_layout; - AVChannelLayout in_channel_layout; + AVChannelLayout out_ch_layout; + AVChannelLayout in_ch_layout; int nb_in_channels; int nb_out_channels; + AVFrame *factors; + AVFrame *sfactors; AVFrame *input_in; AVFrame *input; AVFrame *output; + AVFrame *output_mag; + AVFrame *output_ph; AVFrame *output_out; AVFrame *overlap_buffer; AVFrame *window; - int buf_size; + float *x_pos; + float *y_pos; + float *l_phase; + float *r_phase; + float *c_phase; + float *c_mag; + float *lfe_mag; + float *lfe_phase; + float *mag_total; + + int rdft_size; int hop_size; AVTXContext **rdft, **irdft; av_tx_fn tx_fn, itx_fn; float *window_func_lut; void (*filter)(AVFilterContext *ctx); - void (*upmix_stereo)(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n); - void (*upmix_2_1)(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float lfe_im, - float lfe_re, - float x, float y, - int n); - void (*upmix_3_0)(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_mag, - float c_phase, - float mag_total, - float x, float y, - int n); + void (*upmix)(AVFilterContext *ctx, int ch); void (*upmix_5_0)(AVFilterContext *ctx, float c_re, float c_im, float mag_totall, float mag_totalr, @@ -170,7 +162,7 @@ return ret; layouts = NULL; - ret = ff_add_channel_layout(&layouts, &s->out_channel_layout); + ret = ff_add_channel_layout(&layouts, &s->out_ch_layout); if (ret) return ret; @@ -179,7 +171,7 @@ return ret; layouts = NULL; - ret = ff_add_channel_layout(&layouts, &s->in_channel_layout); + ret = ff_add_channel_layout(&layouts, &s->in_ch_layout); if (ret) return ret; @@ -190,71 +182,76 @@ return ff_set_common_all_samplerates(ctx); } +static void set_input_levels(AVFilterContext *ctx) +{ + AudioSurroundContext *s = ctx->priv; + + for (int ch = 0; ch < s->nb_in_channels && s->level_in >= 0.f; ch++) + s->input_levels[ch] = s->level_in; + s->level_in = -1.f; + + for (int n = 0; n < SC_NB; n++) { + const int ch = av_channel_layout_index_from_channel(&s->in_ch_layout, ch_map[n]); + if (ch >= 0) + s->input_levels[ch] = s->f_i[n]; + } +} + +static void set_output_levels(AVFilterContext *ctx) +{ + AudioSurroundContext *s = ctx->priv; + + for (int ch = 0; ch < s->nb_out_channels && s->level_out >= 0.f; ch++) + s->output_levels[ch] = s->level_out; + s->level_out = -1.f; + + for (int n = 0; n < SC_NB; n++) { + const int ch = av_channel_layout_index_from_channel(&s->out_ch_layout, ch_map[n]); + if (ch >= 0) + s->output_levels[ch] = s->f_o[n]; + } +} + static int config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; AudioSurroundContext *s = ctx->priv; - int ch; + int ret; s->rdft = av_calloc(inlink->ch_layout.nb_channels, sizeof(*s->rdft)); if (!s->rdft) return AVERROR(ENOMEM); s->nb_in_channels = inlink->ch_layout.nb_channels; - for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { + for (int ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { float scale = 1.f; - av_tx_init(&s->rdft[ch], &s->tx_fn, AV_TX_FLOAT_RDFT, 0, s->buf_size, &scale, 0); - if (!s->rdft[ch]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->rdft[ch], &s->tx_fn, AV_TX_FLOAT_RDFT, + 0, s->win_size, &scale, 0); + if (ret < 0) + return ret; } + s->input_levels = av_malloc_array(s->nb_in_channels, sizeof(*s->input_levels)); if (!s->input_levels) return AVERROR(ENOMEM); - for (ch = 0; ch < s->nb_in_channels; ch++) - s->input_levels[ch] = s->level_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_FRONT_CENTER); - if (ch >= 0) - s->input_levels[ch] *= s->fc_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_FRONT_LEFT); - if (ch >= 0) - s->input_levels[ch] *= s->fl_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_FRONT_RIGHT); - if (ch >= 0) - s->input_levels[ch] *= s->fr_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_SIDE_LEFT); - if (ch >= 0) - s->input_levels[ch] *= s->sl_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_SIDE_RIGHT); - if (ch >= 0) - s->input_levels[ch] *= s->sr_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_BACK_LEFT); - if (ch >= 0) - s->input_levels[ch] *= s->bl_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_BACK_RIGHT); - if (ch >= 0) - s->input_levels[ch] *= s->br_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_BACK_CENTER); - if (ch >= 0) - s->input_levels[ch] *= s->bc_in; - ch = av_channel_layout_index_from_channel(&inlink->ch_layout, AV_CHAN_LOW_FREQUENCY); - if (ch >= 0) - s->input_levels[ch] *= s->lfe_in; - s->window = ff_get_audio_buffer(inlink, s->buf_size * 2); + set_input_levels(ctx); + + s->window = ff_get_audio_buffer(inlink, s->win_size * 2); if (!s->window) return AVERROR(ENOMEM); - s->input_in = ff_get_audio_buffer(inlink, s->buf_size * 2); + s->input_in = ff_get_audio_buffer(inlink, s->win_size * 2); if (!s->input_in) return AVERROR(ENOMEM); - s->input = ff_get_audio_buffer(inlink, s->buf_size + 2); + s->input = ff_get_audio_buffer(inlink, s->win_size + 2); if (!s->input) return AVERROR(ENOMEM); - s->lowcut = 1.f * s->lowcutf / (inlink->sample_rate * 0.5) * (s->buf_size / 2); - s->highcut = 1.f * s->highcutf / (inlink->sample_rate * 0.5) * (s->buf_size / 2); + s->lowcut = 1.f * s->lowcutf / (inlink->sample_rate * 0.5) * (s->win_size / 2); + s->highcut = 1.f * s->highcutf / (inlink->sample_rate * 0.5) * (s->win_size / 2); return 0; } @@ -263,63 +260,70 @@ { AVFilterContext *ctx = outlink->src; AudioSurroundContext *s = ctx->priv; - int ch; + int ret; s->irdft = av_calloc(outlink->ch_layout.nb_channels, sizeof(*s->irdft)); if (!s->irdft) return AVERROR(ENOMEM); s->nb_out_channels = outlink->ch_layout.nb_channels; - for (ch = 0; ch < outlink->ch_layout.nb_channels; ch++) { + for (int ch = 0; ch < outlink->ch_layout.nb_channels; ch++) { float iscale = 1.f; - av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, 1, s->buf_size, &iscale, 0); - if (!s->irdft[ch]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->irdft[ch], &s->itx_fn, AV_TX_FLOAT_RDFT, + 1, s->win_size, &iscale, 0); + if (ret < 0) + return ret; } + s->output_levels = av_malloc_array(s->nb_out_channels, sizeof(*s->output_levels)); if (!s->output_levels) return AVERROR(ENOMEM); - for (ch = 0; ch < s->nb_out_channels; ch++) - s->output_levels[ch] = s->level_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_FRONT_CENTER); - if (ch >= 0) - s->output_levels[ch] *= s->fc_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_FRONT_LEFT); - if (ch >= 0) - s->output_levels[ch] *= s->fl_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_FRONT_RIGHT); - if (ch >= 0) - s->output_levels[ch] *= s->fr_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_SIDE_LEFT); - if (ch >= 0) - s->output_levels[ch] *= s->sl_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_SIDE_RIGHT); - if (ch >= 0) - s->output_levels[ch] *= s->sr_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_BACK_LEFT); - if (ch >= 0) - s->output_levels[ch] *= s->bl_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_BACK_RIGHT); - if (ch >= 0) - s->output_levels[ch] *= s->br_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_BACK_CENTER); - if (ch >= 0) - s->output_levels[ch] *= s->bc_out; - ch = av_channel_layout_index_from_channel(&outlink->ch_layout, AV_CHAN_LOW_FREQUENCY); - if (ch >= 0) - s->output_levels[ch] *= s->lfe_out; - - s->output_out = ff_get_audio_buffer(outlink, s->buf_size + 2); - s->output = ff_get_audio_buffer(outlink, s->buf_size + 2); - s->overlap_buffer = ff_get_audio_buffer(outlink, s->buf_size * 2); - if (!s->overlap_buffer || !s->output || !s->output_out) + + set_output_levels(ctx); + + s->factors = ff_get_audio_buffer(outlink, s->win_size + 2); + s->sfactors = ff_get_audio_buffer(outlink, s->win_size + 2); + s->output_ph = ff_get_audio_buffer(outlink, s->win_size + 2); + s->output_mag = ff_get_audio_buffer(outlink, s->win_size + 2); + s->output_out = ff_get_audio_buffer(outlink, s->win_size + 2); + s->output = ff_get_audio_buffer(outlink, s->win_size + 2); + s->overlap_buffer = ff_get_audio_buffer(outlink, s->win_size * 2); + if (!s->overlap_buffer || !s->output || !s->output_out || !s->output_mag || + !s->output_ph || !s->factors || !s->sfactors) + return AVERROR(ENOMEM); + + s->rdft_size = s->win_size / 2 + 1; + + s->x_pos = av_calloc(s->rdft_size, sizeof(*s->x_pos)); + s->y_pos = av_calloc(s->rdft_size, sizeof(*s->y_pos)); + s->l_phase = av_calloc(s->rdft_size, sizeof(*s->l_phase)); + s->r_phase = av_calloc(s->rdft_size, sizeof(*s->r_phase)); + s->c_mag = av_calloc(s->rdft_size, sizeof(*s->c_mag)); + s->c_phase = av_calloc(s->rdft_size, sizeof(*s->c_phase)); + s->mag_total = av_calloc(s->rdft_size, sizeof(*s->mag_total)); + s->lfe_mag = av_calloc(s->rdft_size, sizeof(*s->lfe_mag)); + s->lfe_phase = av_calloc(s->rdft_size, sizeof(*s->lfe_phase)); + if (!s->x_pos || !s->y_pos || !s->l_phase || !s->r_phase || !s->lfe_phase || + !s->c_phase || !s->mag_total || !s->lfe_mag || !s->c_mag) return AVERROR(ENOMEM); return 0; } -static void stereo_transform(float *x, float *y, float angle) +static float sqrf(float x) +{ + return x * x; +} + +static float r_distance(float a) +{ + return fminf(sqrtf(1.f + sqrf(tanf(a))), sqrtf(1.f + sqrf(1.f / tanf(a)))); +} + +#define MIN_MAG_SUM 0.00000001f + +static void angle_transform(float *x, float *y, float angle) { float reference, r, a; @@ -330,11 +334,31 @@ r = hypotf(*x, *y); a = atan2f(*x, *y); + r /= r_distance(a); + if (fabsf(a) <= M_PI_4) a *= reference / M_PI_2; else - a = M_PI + 2 * (-2 * M_PI + reference) * (M_PI - fabsf(a)) * FFDIFFSIGN(a, 0) / (3 * M_PI); + a = M_PI + (-2.f * M_PI + reference) * (M_PI - fabsf(a)) * FFDIFFSIGN(a, 0.f) / (3.f * M_PI_2); + + r *= r_distance(a); + + *x = av_clipf(sinf(a) * r, -1.f, 1.f); + *y = av_clipf(cosf(a) * r, -1.f, 1.f); +} +static void focus_transform(float *x, float *y, float focus) +{ + float a, r, ra; + + if (focus == 0.f) + return; + + a = atan2f(*x, *y); + ra = r_distance(a); + r = av_clipf(hypotf(*x, *y) / ra, 0.f, 1.f); + r = focus > 0.f ? 1.f - powf(1.f - r, 1.f + focus * 20.f) : powf(r, 1.f - focus * 20.f); + r *= ra; *x = av_clipf(sinf(a) * r, -1.f, 1.f); *y = av_clipf(cosf(a) * r, -1.f, 1.f); } @@ -343,16 +367,16 @@ { av_assert2(a >= -1.f && a <= 1.f); av_assert2(p >= 0.f && p <= M_PI); - *x = av_clipf(a+a*FFMAX(0, p*p-M_PI_2), -1.f, 1.f); - *y = av_clipf(cosf(a*M_PI_2+M_PI)*cosf(M_PI_2-p/M_PI)*M_LN10+1, -1.f, 1.f); + *x = av_clipf(a+a*fmaxf(0.f, p*p-M_PI_2), -1.f, 1.f); + *y = av_clipf(cosf(a*M_PI_2+M_PI)*cosf(M_PI_2-p/M_PI)*M_LN10+1.f, -1.f, 1.f); } static inline void get_lfe(int output_lfe, int n, float lowcut, float highcut, - float *lfe_mag, float *mag_total, int lfe_mode) + float *lfe_mag, float c_mag, float *mag_total, int lfe_mode) { if (output_lfe && n < highcut) { *lfe_mag = n < lowcut ? 1.f : .5f*(1.f+cosf(M_PI*(lowcut-n)/(lowcut-highcut))); - *lfe_mag *= *mag_total; + *lfe_mag *= c_mag; if (lfe_mode) *mag_total -= *lfe_mag; } else { @@ -360,626 +384,245 @@ } } -static void upmix_1_0(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float mag, *dst; - - dst = (float *)s->output->extended_data[0]; - - mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - - dst[2 * n ] = mag * cosf(c_phase); - dst[2 * n + 1] = mag * sinf(c_phase); -} - -static void upmix_stereo(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float l_mag, r_mag, *dstl, *dstr; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); -} - -static void upmix_2_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, *dstl, *dstr, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstlfe = (float *)s->output->extended_data[2]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); -} - -static void upmix_3_0(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float l_mag, r_mag, c_mag, *dstc, *dstl, *dstr; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); -} - -static void upmix_3_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); -} - -static void upmix_3_1_surround(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float c_mag, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &c_mag, s->lfe_mode); - - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); -} - -static void upmix_4_0(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float b_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstb; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstb = (float *)s->output->extended_data[3]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstb[2 * n ] = b_mag * cosf(c_phase); - dstb[2 * n + 1] = b_mag * sinf(c_phase); -} - -static void upmix_4_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float lfe_mag, b_mag, l_mag, r_mag, c_mag, *dstc, *dstl, *dstr, *dstb, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstb = (float *)s->output->extended_data[4]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstb[2 * n ] = b_mag * cosf(c_phase); - dstb[2 * n + 1] = b_mag * sinf(c_phase); -} - -static void upmix_5_0_back(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float l_mag, r_mag, ls_mag, rs_mag, c_mag, *dstc, *dstl, *dstr, *dstls, *dstrs; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstls = (float *)s->output->extended_data[3]; - dstrs = (float *)s->output->extended_data[4]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); - - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); -} - -static void upmix_5_1_back(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstls = (float *)s->output->extended_data[4]; - dstrs = (float *)s->output->extended_data[5]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); - - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); - - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); +#define TRANSFORM \ + dst[2 * n ] = mag * cosf(ph); \ + dst[2 * n + 1] = mag * sinf(ph); + +static void calculate_factors(AVFilterContext *ctx, int ch, int chan) +{ + AudioSurroundContext *s = ctx->priv; + float *factor = (float *)s->factors->extended_data[ch]; + const float f_x = s->f_x[sc_map[chan >= 0 ? chan : 0]]; + const float f_y = s->f_y[sc_map[chan >= 0 ? chan : 0]]; + const int rdft_size = s->rdft_size; + const float *x = s->x_pos; + const float *y = s->y_pos; + + switch (chan) { + case AV_CHAN_FRONT_CENTER: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(1.f - fabsf(x[n]), f_x) * powf((y[n] + 1.f) * .5f, f_y); + break; + case AV_CHAN_FRONT_LEFT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * ( x[n] + 1.f), f_x) * powf((y[n] + 1.f) * .5f, f_y); + break; + case AV_CHAN_FRONT_RIGHT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * (-x[n] + 1.f), f_x) * powf((y[n] + 1.f) * .5f, f_y); + break; + case AV_CHAN_LOW_FREQUENCY: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(1.f - fabsf(x[n]), f_x) * powf((1.f - fabs(y[n])), f_y); + break; + case AV_CHAN_BACK_CENTER: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(1.f - fabsf(x[n]), f_x) * powf((1.f - y[n]) * .5f, f_y); + break; + case AV_CHAN_BACK_LEFT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * ( x[n] + 1.f), f_x) * powf(1.f - ((y[n] + 1.f) * .5f), f_y); + break; + case AV_CHAN_BACK_RIGHT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * (-x[n] + 1.f), f_x) * powf(1.f - ((y[n] + 1.f) * .5f), f_y); + break; + case AV_CHAN_SIDE_LEFT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * ( x[n] + 1.f), f_x) * powf(1.f - fabsf(y[n]), f_y); + break; + case AV_CHAN_SIDE_RIGHT: + for (int n = 0; n < rdft_size; n++) + factor[n] = powf(.5f * (-x[n] + 1.f), f_x) * powf(1.f - fabsf(y[n]), f_y); + break; + default: + for (int n = 0; n < rdft_size; n++) + factor[n] = 1.f; + break; + } } -static void upmix_6_0(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) +static void do_transform(AVFilterContext *ctx, int ch) { AudioSurroundContext *s = ctx->priv; - float l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstb = (float *)s->output->extended_data[3]; - dstls = (float *)s->output->extended_data[4]; - dstrs = (float *)s->output->extended_data[5]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; + float *sfactor = (float *)s->sfactors->extended_data[ch]; + float *factor = (float *)s->factors->extended_data[ch]; + float *omag = (float *)s->output_mag->extended_data[ch]; + float *oph = (float *)s->output_ph->extended_data[ch]; + float *dst = (float *)s->output->extended_data[ch]; + const int rdft_size = s->rdft_size; + const float smooth = s->smooth; + + if (smooth > 0.f) { + for (int n = 0; n < rdft_size; n++) + sfactor[n] = smooth * factor[n] + (1.f - smooth) * sfactor[n]; - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); + factor = sfactor; + } - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); + for (int n = 0; n < rdft_size; n++) + omag[n] *= factor[n]; - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); + for (int n = 0; n < rdft_size; n++) { + const float mag = omag[n]; + const float ph = oph[n]; - dstb[2 * n ] = b_mag * cosf(c_phase); - dstb[2 * n + 1] = b_mag * sinf(c_phase); + TRANSFORM + } } -static void upmix_6_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) +static void stereo_copy(AVFilterContext *ctx, int ch, int chan) { AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs, *dstlfe; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstb = (float *)s->output->extended_data[4]; - dstls = (float *)s->output->extended_data[5]; - dstrs = (float *)s->output->extended_data[6]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); - - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); - - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); + float *omag = (float *)s->output_mag->extended_data[ch]; + float *oph = (float *)s->output_ph->extended_data[ch]; + const float *mag_total = s->mag_total; + const int rdft_size = s->rdft_size; + const float *c_phase = s->c_phase; + const float *l_phase = s->l_phase; + const float *r_phase = s->r_phase; + const float *lfe_mag = s->lfe_mag; + const float *c_mag = s->c_mag; + + switch (chan) { + case AV_CHAN_FRONT_CENTER: + memcpy(omag, c_mag, rdft_size * sizeof(*omag)); + break; + case AV_CHAN_LOW_FREQUENCY: + memcpy(omag, lfe_mag, rdft_size * sizeof(*omag)); + break; + case AV_CHAN_FRONT_LEFT: + case AV_CHAN_FRONT_RIGHT: + case AV_CHAN_BACK_CENTER: + case AV_CHAN_BACK_LEFT: + case AV_CHAN_BACK_RIGHT: + case AV_CHAN_SIDE_LEFT: + case AV_CHAN_SIDE_RIGHT: + memcpy(omag, mag_total, rdft_size * sizeof(*omag)); + break; + default: + break; + } - dstb[2 * n ] = b_mag * cosf(c_phase); - dstb[2 * n + 1] = b_mag * sinf(c_phase); + switch (chan) { + case AV_CHAN_FRONT_CENTER: + case AV_CHAN_LOW_FREQUENCY: + case AV_CHAN_BACK_CENTER: + memcpy(oph, c_phase, rdft_size * sizeof(*oph)); + break; + case AV_CHAN_FRONT_LEFT: + case AV_CHAN_BACK_LEFT: + case AV_CHAN_SIDE_LEFT: + memcpy(oph, l_phase, rdft_size * sizeof(*oph)); + break; + case AV_CHAN_FRONT_RIGHT: + case AV_CHAN_BACK_RIGHT: + case AV_CHAN_SIDE_RIGHT: + memcpy(oph, r_phase, rdft_size * sizeof(*oph)); + break; + default: + break; + } } -static void upmix_5_1_back_surround(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float c_mag, - float mag_total, - float x, float y, - int n) +static void stereo_upmix(AVFilterContext *ctx, int ch) { AudioSurroundContext *s = ctx->priv; - float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe; - float ls_mag, rs_mag, *dstls, *dstrs; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstls = (float *)s->output->extended_data[4]; - dstrs = (float *)s->output->extended_data[5]; + const int chan = av_channel_layout_channel_from_index(&s->out_ch_layout, ch); - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &c_mag, s->lfe_mode); + calculate_factors(ctx, ch, chan); - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; + stereo_copy(ctx, ch, chan); - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); - - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); - - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); + do_transform(ctx, ch); } -static void upmix_5_1_back_2_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float lfe_re, - float lfe_im, - float x, float y, - int n) +static void l2_1_upmix(AVFilterContext *ctx, int ch) { AudioSurroundContext *s = ctx->priv; - float c_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe; - float ls_mag, rs_mag, *dstls, *dstrs; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstls = (float *)s->output->extended_data[4]; - dstrs = (float *)s->output->extended_data[5]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); + const int chan = av_channel_layout_channel_from_index(&s->out_ch_layout, ch); + float *omag = (float *)s->output_mag->extended_data[ch]; + float *oph = (float *)s->output_ph->extended_data[ch]; + const float *mag_total = s->mag_total; + const float *lfe_phase = s->lfe_phase; + const int rdft_size = s->rdft_size; + const float *c_phase = s->c_phase; + const float *l_phase = s->l_phase; + const float *r_phase = s->r_phase; + const float *lfe_mag = s->lfe_mag; + const float *c_mag = s->c_mag; - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); + switch (chan) { + case AV_CHAN_LOW_FREQUENCY: + calculate_factors(ctx, ch, -1); + break; + default: + calculate_factors(ctx, ch, chan); + break; + } - dstlfe[2 * n ] = lfe_re; - dstlfe[2 * n + 1] = lfe_im; + switch (chan) { + case AV_CHAN_FRONT_CENTER: + memcpy(omag, c_mag, rdft_size * sizeof(*omag)); + break; + case AV_CHAN_LOW_FREQUENCY: + memcpy(omag, lfe_mag, rdft_size * sizeof(*omag)); + break; + case AV_CHAN_FRONT_LEFT: + case AV_CHAN_FRONT_RIGHT: + case AV_CHAN_BACK_CENTER: + case AV_CHAN_BACK_LEFT: + case AV_CHAN_BACK_RIGHT: + case AV_CHAN_SIDE_LEFT: + case AV_CHAN_SIDE_RIGHT: + memcpy(omag, mag_total, rdft_size * sizeof(*omag)); + break; + default: + break; + } - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); + switch (chan) { + case AV_CHAN_LOW_FREQUENCY: + memcpy(oph, lfe_phase, rdft_size * sizeof(*oph)); + break; + case AV_CHAN_FRONT_CENTER: + case AV_CHAN_BACK_CENTER: + memcpy(oph, c_phase, rdft_size * sizeof(*oph)); + break; + case AV_CHAN_FRONT_LEFT: + case AV_CHAN_BACK_LEFT: + case AV_CHAN_SIDE_LEFT: + memcpy(oph, l_phase, rdft_size * sizeof(*oph)); + break; + case AV_CHAN_FRONT_RIGHT: + case AV_CHAN_BACK_RIGHT: + case AV_CHAN_SIDE_RIGHT: + memcpy(oph, r_phase, rdft_size * sizeof(*oph)); + break; + default: + break; + } - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); + do_transform(ctx, ch); } -static void upmix_7_0(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) +static void surround_upmix(AVFilterContext *ctx, int ch) { - float l_mag, r_mag, ls_mag, rs_mag, c_mag, lb_mag, rb_mag; - float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb; AudioSurroundContext *s = ctx->priv; + const int chan = av_channel_layout_channel_from_index(&s->out_ch_layout, ch); - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlb = (float *)s->output->extended_data[3]; - dstrb = (float *)s->output->extended_data[4]; - dstls = (float *)s->output->extended_data[5]; - dstrs = (float *)s->output->extended_data[6]; - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - lb_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rb_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->sl_x) * powf(1.f - fabsf(y), s->sl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->sr_x) * powf(1.f - fabsf(y), s->sr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlb[2 * n ] = lb_mag * cosf(l_phase); - dstlb[2 * n + 1] = lb_mag * sinf(l_phase); - - dstrb[2 * n ] = rb_mag * cosf(r_phase); - dstrb[2 * n + 1] = rb_mag * sinf(r_phase); - - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); - - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); -} - -static void upmix_7_1(AVFilterContext *ctx, - float l_phase, - float r_phase, - float c_phase, - float mag_total, - float x, float y, - int n) -{ - float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, lb_mag, rb_mag; - float *dstc, *dstl, *dstr, *dstls, *dstrs, *dstlb, *dstrb, *dstlfe; - AudioSurroundContext *s = ctx->priv; - - dstl = (float *)s->output->extended_data[0]; - dstr = (float *)s->output->extended_data[1]; - dstc = (float *)s->output->extended_data[2]; - dstlfe = (float *)s->output->extended_data[3]; - dstlb = (float *)s->output->extended_data[4]; - dstrb = (float *)s->output->extended_data[5]; - dstls = (float *)s->output->extended_data[6]; - dstrs = (float *)s->output->extended_data[7]; - - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); - - c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total; - l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total; - r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total; - lb_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total; - rb_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total; - ls_mag = powf(.5f * ( x + 1.f), s->sl_x) * powf(1.f - fabsf(y), s->sl_y) * mag_total; - rs_mag = powf(.5f * (-x + 1.f), s->sr_x) * powf(1.f - fabsf(y), s->sr_y) * mag_total; - - dstl[2 * n ] = l_mag * cosf(l_phase); - dstl[2 * n + 1] = l_mag * sinf(l_phase); - - dstr[2 * n ] = r_mag * cosf(r_phase); - dstr[2 * n + 1] = r_mag * sinf(r_phase); - - dstc[2 * n ] = c_mag * cosf(c_phase); - dstc[2 * n + 1] = c_mag * sinf(c_phase); - - dstlfe[2 * n ] = lfe_mag * cosf(c_phase); - dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); - - dstlb[2 * n ] = lb_mag * cosf(l_phase); - dstlb[2 * n + 1] = lb_mag * sinf(l_phase); - - dstrb[2 * n ] = rb_mag * cosf(r_phase); - dstrb[2 * n + 1] = rb_mag * sinf(r_phase); + switch (chan) { + case AV_CHAN_FRONT_CENTER: + calculate_factors(ctx, ch, -1); + break; + default: + calculate_factors(ctx, ch, chan); + break; + } - dstls[2 * n ] = ls_mag * cosf(l_phase); - dstls[2 * n + 1] = ls_mag * sinf(l_phase); + stereo_copy(ctx, ch, chan); - dstrs[2 * n ] = rs_mag * cosf(r_phase); - dstrs[2 * n + 1] = rs_mag * sinf(r_phase); + do_transform(ctx, ch); } static void upmix_7_1_5_0_side(AVFilterContext *ctx, @@ -1008,14 +651,14 @@ c_phase = atan2f(c_im, c_re); - get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode); + get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, hypotf(c_re, c_im), &mag_total, s->lfe_mode); - fl_mag = powf(.5f * (xl + 1.f), s->fl_x) * powf((yl + 1.f) * .5f, s->fl_y) * mag_totall; - fr_mag = powf(.5f * (xr + 1.f), s->fr_x) * powf((yr + 1.f) * .5f, s->fr_y) * mag_totalr; - lb_mag = powf(.5f * (-xl + 1.f), s->bl_x) * powf((yl + 1.f) * .5f, s->bl_y) * mag_totall; - rb_mag = powf(.5f * (-xr + 1.f), s->br_x) * powf((yr + 1.f) * .5f, s->br_y) * mag_totalr; - ls_mag = powf(1.f - fabsf(xl), s->sl_x) * powf((yl + 1.f) * .5f, s->sl_y) * mag_totall; - rs_mag = powf(1.f - fabsf(xr), s->sr_x) * powf((yr + 1.f) * .5f, s->sr_y) * mag_totalr; + fl_mag = powf(.5f * (xl + 1.f), s->f_x[SC_FL]) * powf((yl + 1.f) * .5f, s->f_y[SC_FL]) * mag_totall; + fr_mag = powf(.5f * (xr + 1.f), s->f_x[SC_FR]) * powf((yr + 1.f) * .5f, s->f_y[SC_FR]) * mag_totalr; + lb_mag = powf(.5f * (-xl + 1.f), s->f_x[SC_BL]) * powf((yl + 1.f) * .5f, s->f_y[SC_BL]) * mag_totall; + rb_mag = powf(.5f * (-xr + 1.f), s->f_x[SC_BR]) * powf((yr + 1.f) * .5f, s->f_y[SC_BR]) * mag_totalr; + ls_mag = powf(1.f - fabsf(xl), s->f_x[SC_SL]) * powf((yl + 1.f) * .5f, s->f_y[SC_SL]) * mag_totall; + rs_mag = powf(1.f - fabsf(xr), s->f_x[SC_SR]) * powf((yr + 1.f) * .5f, s->f_y[SC_SR]) * mag_totalr; dstl[2 * n ] = fl_mag * cosf(fl_phase); dstl[2 * n + 1] = fl_mag * sinf(fl_phase); @@ -1066,12 +709,12 @@ dstls = (float *)s->output->extended_data[6]; dstrs = (float *)s->output->extended_data[7]; - fl_mag = powf(.5f * (xl + 1.f), s->fl_x) * powf((yl + 1.f) * .5f, s->fl_y) * mag_totall; - fr_mag = powf(.5f * (xr + 1.f), s->fr_x) * powf((yr + 1.f) * .5f, s->fr_y) * mag_totalr; - lb_mag = powf(.5f * (-xl + 1.f), s->bl_x) * powf((yl + 1.f) * .5f, s->bl_y) * mag_totall; - rb_mag = powf(.5f * (-xr + 1.f), s->br_x) * powf((yr + 1.f) * .5f, s->br_y) * mag_totalr; - ls_mag = powf(1.f - fabsf(xl), s->sl_x) * powf((yl + 1.f) * .5f, s->sl_y) * mag_totall; - rs_mag = powf(1.f - fabsf(xr), s->sr_x) * powf((yr + 1.f) * .5f, s->sr_y) * mag_totalr; + fl_mag = powf(.5f * (xl + 1.f), s->f_x[SC_FL]) * powf((yl + 1.f) * .5f, s->f_y[SC_FL]) * mag_totall; + fr_mag = powf(.5f * (xr + 1.f), s->f_x[SC_FR]) * powf((yr + 1.f) * .5f, s->f_y[SC_FR]) * mag_totalr; + lb_mag = powf(.5f * (-xl + 1.f), s->f_x[SC_BL]) * powf((yl + 1.f) * .5f, s->f_y[SC_BL]) * mag_totall; + rb_mag = powf(.5f * (-xr + 1.f), s->f_x[SC_BR]) * powf((yr + 1.f) * .5f, s->f_y[SC_BR]) * mag_totalr; + ls_mag = powf(1.f - fabsf(xl), s->f_x[SC_SL]) * powf((yl + 1.f) * .5f, s->f_y[SC_SL]) * mag_totall; + rs_mag = powf(1.f - fabsf(xr), s->f_x[SC_SR]) * powf((yr + 1.f) * .5f, s->f_y[SC_SR]) * mag_totalr; dstl[2 * n ] = fl_mag * cosf(fl_phase); dstl[2 * n + 1] = fl_mag * sinf(fl_phase); @@ -1101,104 +744,166 @@ static void filter_stereo(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; - float *srcl, *srcr; - int n; + const float *srcl = (const float *)s->input->extended_data[0]; + const float *srcr = (const float *)s->input->extended_data[1]; + const int output_lfe = s->output_lfe && s->create_lfe; + const int lfe_mode = s->lfe_mode; + const float highcut = s->highcut; + const float lowcut = s->lowcut; + const float angle = s->angle; + const float focus = s->focus; + float *magtotal = s->mag_total; + float *lfemag = s->lfe_mag; + float *lphase = s->l_phase; + float *rphase = s->r_phase; + float *cphase = s->c_phase; + float *cmag = s->c_mag; + float *xpos = s->x_pos; + float *ypos = s->y_pos; - srcl = (float *)s->input->extended_data[0]; - srcr = (float *)s->input->extended_data[1]; - - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (int n = 0; n < s->rdft_size; n++) { float l_re = srcl[2 * n], r_re = srcr[2 * n]; float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; float c_phase = atan2f(l_im + r_im, l_re + r_re); float l_mag = hypotf(l_re, l_im); float r_mag = hypotf(r_re, r_im); + float mag_total = hypotf(l_mag, r_mag); float l_phase = atan2f(l_im, l_re); float r_phase = atan2f(r_im, r_re); float phase_dif = fabsf(l_phase - r_phase); float mag_sum = l_mag + r_mag; - float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum; - float mag_total = hypotf(l_mag, r_mag); - float x, y; + float c_mag = mag_sum * 0.5f; + float mag_dif, x, y; + mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; + mag_dif = (l_mag - r_mag) / mag_sum; if (phase_dif > M_PI) - phase_dif = 2 * M_PI - phase_dif; + phase_dif = 2.f * M_PI - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); - stereo_transform(&x, &y, s->angle); - - s->upmix_stereo(ctx, l_phase, r_phase, c_phase, mag_total, x, y, n); + angle_transform(&x, &y, angle); + focus_transform(&x, &y, focus); + get_lfe(output_lfe, n, lowcut, highcut, &lfemag[n], c_mag, &mag_total, lfe_mode); + + xpos[n] = x; + ypos[n] = y; + lphase[n] = l_phase; + rphase[n] = r_phase; + cmag[n] = c_mag; + cphase[n] = c_phase; + magtotal[n] = mag_total; } } -static void filter_surround(AVFilterContext *ctx) +static void filter_2_1(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; - float *srcl, *srcr, *srcc; - int n; - - srcl = (float *)s->input->extended_data[0]; - srcr = (float *)s->input->extended_data[1]; - srcc = (float *)s->input->extended_data[2]; + const float *srcl = (const float *)s->input->extended_data[0]; + const float *srcr = (const float *)s->input->extended_data[1]; + const float *srclfe = (const float *)s->input->extended_data[2]; + const float angle = s->angle; + const float focus = s->focus; + float *magtotal = s->mag_total; + float *lfephase = s->lfe_phase; + float *lfemag = s->lfe_mag; + float *lphase = s->l_phase; + float *rphase = s->r_phase; + float *cphase = s->c_phase; + float *cmag = s->c_mag; + float *xpos = s->x_pos; + float *ypos = s->y_pos; - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (int n = 0; n < s->rdft_size; n++) { float l_re = srcl[2 * n], r_re = srcr[2 * n]; float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; - float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; - float c_mag = hypotf(c_re, c_im); - float c_phase = atan2f(c_im, c_re); + float lfe_re = srclfe[2 * n], lfe_im = srclfe[2 * n + 1]; + float c_phase = atan2f(l_im + r_im, l_re + r_re); float l_mag = hypotf(l_re, l_im); float r_mag = hypotf(r_re, r_im); + float lfe_mag = hypotf(lfe_re, lfe_im); + float lfe_phase = atan2f(lfe_im, lfe_re); + float mag_total = hypotf(l_mag, r_mag); float l_phase = atan2f(l_im, l_re); float r_phase = atan2f(r_im, r_re); float phase_dif = fabsf(l_phase - r_phase); float mag_sum = l_mag + r_mag; - float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum; - float mag_total = hypotf(l_mag, r_mag); - float x, y; + float c_mag = mag_sum * 0.5f; + float mag_dif, x, y; + mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; + mag_dif = (l_mag - r_mag) / mag_sum; if (phase_dif > M_PI) - phase_dif = 2 * M_PI - phase_dif; + phase_dif = 2.f * M_PI - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); - stereo_transform(&x, &y, s->angle); + angle_transform(&x, &y, angle); + focus_transform(&x, &y, focus); - s->upmix_3_0(ctx, l_phase, r_phase, c_phase, c_mag, mag_total, x, y, n); + xpos[n] = x; + ypos[n] = y; + lphase[n] = l_phase; + rphase[n] = r_phase; + cmag[n] = c_mag; + cphase[n] = c_phase; + lfemag[n] = lfe_mag; + lfephase[n] = lfe_phase; + magtotal[n] = mag_total; } } -static void filter_2_1(AVFilterContext *ctx) +static void filter_surround(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; - float *srcl, *srcr, *srclfe; - int n; - - srcl = (float *)s->input->extended_data[0]; - srcr = (float *)s->input->extended_data[1]; - srclfe = (float *)s->input->extended_data[2]; + const float *srcl = (const float *)s->input->extended_data[0]; + const float *srcr = (const float *)s->input->extended_data[1]; + const float *srcc = (const float *)s->input->extended_data[2]; + const int output_lfe = s->output_lfe && s->create_lfe; + const int lfe_mode = s->lfe_mode; + const float highcut = s->highcut; + const float lowcut = s->lowcut; + const float angle = s->angle; + const float focus = s->focus; + float *magtotal = s->mag_total; + float *lfemag = s->lfe_mag; + float *lphase = s->l_phase; + float *rphase = s->r_phase; + float *cphase = s->c_phase; + float *cmag = s->c_mag; + float *xpos = s->x_pos; + float *ypos = s->y_pos; - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (int n = 0; n < s->rdft_size; n++) { float l_re = srcl[2 * n], r_re = srcr[2 * n]; float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; - float lfe_re = srclfe[2 * n], lfe_im = srclfe[2 * n + 1]; - float c_phase = atan2f(l_im + r_im, l_re + r_re); + float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; + float c_phase = atan2f(c_im, c_re); + float c_mag = hypotf(c_re, c_im); float l_mag = hypotf(l_re, l_im); float r_mag = hypotf(r_re, r_im); + float mag_total = hypotf(l_mag, r_mag); float l_phase = atan2f(l_im, l_re); float r_phase = atan2f(r_im, r_re); float phase_dif = fabsf(l_phase - r_phase); float mag_sum = l_mag + r_mag; - float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum; - float mag_total = hypotf(l_mag, r_mag); - float x, y; + float mag_dif, x, y; + mag_sum = mag_sum < MIN_MAG_SUM ? 1.f : mag_sum; + mag_dif = (l_mag - r_mag) / mag_sum; if (phase_dif > M_PI) - phase_dif = 2 * M_PI - phase_dif; + phase_dif = 2.f * M_PI - phase_dif; stereo_position(mag_dif, phase_dif, &x, &y); - stereo_transform(&x, &y, s->angle); - - s->upmix_2_1(ctx, l_phase, r_phase, c_phase, mag_total, lfe_re, lfe_im, x, y, n); + angle_transform(&x, &y, angle); + focus_transform(&x, &y, focus); + get_lfe(output_lfe, n, lowcut, highcut, &lfemag[n], c_mag, &mag_total, lfe_mode); + + xpos[n] = x; + ypos[n] = y; + lphase[n] = l_phase; + rphase[n] = r_phase; + cmag[n] = c_mag; + cphase[n] = c_phase; + magtotal[n] = mag_total; } } @@ -1214,7 +919,7 @@ srcsl = (float *)s->input->extended_data[3]; srcsr = (float *)s->input->extended_data[4]; - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (n = 0; n < s->rdft_size; n++) { float fl_re = srcl[2 * n], fr_re = srcr[2 * n]; float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1]; float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; @@ -1232,8 +937,8 @@ float phase_difr = fabsf(fr_phase - sr_phase); float magl_sum = fl_mag + sl_mag; float magr_sum = fr_mag + sr_mag; - float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum; - float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum; + float mag_difl = magl_sum < MIN_MAG_SUM ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum; + float mag_difr = magr_sum < MIN_MAG_SUM ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum; float mag_totall = hypotf(fl_mag, sl_mag); float mag_totalr = hypotf(fr_mag, sr_mag); float bl_phase = atan2f(fl_im + sl_im, fl_re + sl_re); @@ -1242,10 +947,10 @@ float xr, yr; if (phase_difl > M_PI) - phase_difl = 2 * M_PI - phase_difl; + phase_difl = 2.f * M_PI - phase_difl; if (phase_difr > M_PI) - phase_difr = 2 * M_PI - phase_difr; + phase_difr = 2.f * M_PI - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr); @@ -1272,7 +977,7 @@ srcsl = (float *)s->input->extended_data[4]; srcsr = (float *)s->input->extended_data[5]; - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (n = 0; n < s->rdft_size; n++) { float fl_re = srcl[2 * n], fr_re = srcr[2 * n]; float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1]; float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; @@ -1291,8 +996,8 @@ float phase_difr = fabsf(fr_phase - sr_phase); float magl_sum = fl_mag + sl_mag; float magr_sum = fr_mag + sr_mag; - float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum; - float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum; + float mag_difl = magl_sum < MIN_MAG_SUM ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum; + float mag_difr = magr_sum < MIN_MAG_SUM ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum; float mag_totall = hypotf(fl_mag, sl_mag); float mag_totalr = hypotf(fr_mag, sr_mag); float bl_phase = atan2f(fl_im + sl_im, fl_re + sl_re); @@ -1301,10 +1006,10 @@ float xr, yr; if (phase_difl > M_PI) - phase_difl = 2 * M_PI - phase_difl; + phase_difl = 2.f * M_PI - phase_difl; if (phase_difr > M_PI) - phase_difr = 2 * M_PI - phase_difr; + phase_difr = 2.f * M_PI - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr); @@ -1331,7 +1036,7 @@ srcbl = (float *)s->input->extended_data[4]; srcbr = (float *)s->input->extended_data[5]; - for (n = 0; n < s->buf_size / 2 + 1; n++) { + for (n = 0; n < s->rdft_size; n++) { float fl_re = srcl[2 * n], fr_re = srcr[2 * n]; float fl_im = srcl[2 * n + 1], fr_im = srcr[2 * n + 1]; float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; @@ -1350,8 +1055,8 @@ float phase_difr = fabsf(fr_phase - br_phase); float magl_sum = fl_mag + bl_mag; float magr_sum = fr_mag + br_mag; - float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, bl_mag) : (fl_mag - bl_mag) / magl_sum; - float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, br_mag) : (fr_mag - br_mag) / magr_sum; + float mag_difl = magl_sum < MIN_MAG_SUM ? FFDIFFSIGN(fl_mag, bl_mag) : (fl_mag - bl_mag) / magl_sum; + float mag_difr = magr_sum < MIN_MAG_SUM ? FFDIFFSIGN(fr_mag, br_mag) : (fr_mag - br_mag) / magr_sum; float mag_totall = hypotf(fl_mag, bl_mag); float mag_totalr = hypotf(fr_mag, br_mag); float sl_phase = atan2f(fl_im + bl_im, fl_re + bl_re); @@ -1360,10 +1065,10 @@ float xr, yr; if (phase_difl > M_PI) - phase_difl = 2 * M_PI - phase_difl; + phase_difl = 2.f * M_PI - phase_difl; if (phase_difr > M_PI) - phase_difr = 2 * M_PI - phase_difr; + phase_difr = 2.f * M_PI - phase_difr; stereo_position(mag_difl, phase_difl, &xl, &yl); stereo_position(mag_difr, phase_difr, &xr, &yr); @@ -1377,20 +1082,34 @@ } } +static void allchannels_spread(AVFilterContext *ctx) +{ + AudioSurroundContext *s = ctx->priv; + + if (s->all_x >= 0.f) + for (int n = 0; n < SC_NB; n++) + s->f_x[n] = s->all_x; + s->all_x = -1.f; + if (s->all_y >= 0.f) + for (int n = 0; n < SC_NB; n++) + s->f_y[n] = s->all_y; + s->all_y = -1.f; +} + static av_cold int init(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; - float overlap; int64_t in_channel_layout, out_channel_layout; - int i, ret; + float overlap; + int ret; - if ((ret = av_channel_layout_from_string(&s->out_channel_layout, s->out_channel_layout_str)) < 0) { + if ((ret = av_channel_layout_from_string(&s->out_ch_layout, s->out_channel_layout_str)) < 0) { av_log(ctx, AV_LOG_ERROR, "Error parsing output channel layout '%s'.\n", s->out_channel_layout_str); return ret; } - if ((ret = av_channel_layout_from_string(&s->in_channel_layout, s->in_channel_layout_str)) < 0) { + if ((ret = av_channel_layout_from_string(&s->in_ch_layout, s->in_channel_layout_str)) < 0) { av_log(ctx, AV_LOG_ERROR, "Error parsing input channel layout '%s'.\n", s->in_channel_layout_str); return AVERROR(EINVAL); @@ -1402,80 +1121,26 @@ return AVERROR(EINVAL); } - in_channel_layout = s->in_channel_layout.order == AV_CHANNEL_ORDER_NATIVE ? - s->in_channel_layout.u.mask : 0; - out_channel_layout = s->out_channel_layout.order == AV_CHANNEL_ORDER_NATIVE ? - s->out_channel_layout.u.mask : 0; + in_channel_layout = s->in_ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? + s->in_ch_layout.u.mask : 0; + out_channel_layout = s->out_ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? + s->out_ch_layout.u.mask : 0; + + s->create_lfe = av_channel_layout_index_from_channel(&s->out_ch_layout, + AV_CHAN_LOW_FREQUENCY) >= 0; switch (in_channel_layout) { case AV_CH_LAYOUT_STEREO: s->filter = filter_stereo; - switch (out_channel_layout) { - case AV_CH_LAYOUT_MONO: - s->upmix_stereo = upmix_1_0; - break; - case AV_CH_LAYOUT_STEREO: - s->upmix_stereo = upmix_stereo; - break; - case AV_CH_LAYOUT_2POINT1: - s->upmix_stereo = upmix_2_1; - break; - case AV_CH_LAYOUT_SURROUND: - s->upmix_stereo = upmix_3_0; - break; - case AV_CH_LAYOUT_3POINT1: - s->upmix_stereo = upmix_3_1; - break; - case AV_CH_LAYOUT_4POINT0: - s->upmix_stereo = upmix_4_0; - break; - case AV_CH_LAYOUT_4POINT1: - s->upmix_stereo = upmix_4_1; - break; - case AV_CH_LAYOUT_5POINT0_BACK: - s->upmix_stereo = upmix_5_0_back; - break; - case AV_CH_LAYOUT_5POINT1_BACK: - s->upmix_stereo = upmix_5_1_back; - break; - case AV_CH_LAYOUT_6POINT0: - s->upmix_stereo = upmix_6_0; - break; - case AV_CH_LAYOUT_6POINT1: - s->upmix_stereo = upmix_6_1; - break; - case AV_CH_LAYOUT_7POINT0: - s->upmix_stereo = upmix_7_0; - break; - case AV_CH_LAYOUT_7POINT1: - s->upmix_stereo = upmix_7_1; - break; - default: - goto fail; - } + s->upmix = stereo_upmix; break; case AV_CH_LAYOUT_2POINT1: s->filter = filter_2_1; - switch (out_channel_layout) { - case AV_CH_LAYOUT_5POINT1_BACK: - s->upmix_2_1 = upmix_5_1_back_2_1; - break; - default: - goto fail; - } + s->upmix = l2_1_upmix; break; case AV_CH_LAYOUT_SURROUND: s->filter = filter_surround; - switch (out_channel_layout) { - case AV_CH_LAYOUT_3POINT1: - s->upmix_3_0 = upmix_3_1_surround; - break; - case AV_CH_LAYOUT_5POINT1_BACK: - s->upmix_3_0 = upmix_5_1_back_surround; - break; - default: - goto fail; - } + s->upmix = surround_upmix; break; case AV_CH_LAYOUT_5POINT0: s->filter = filter_5_0_side; @@ -1514,73 +1179,73 @@ return AVERROR(EINVAL); } - s->buf_size = 1 << av_log2(s->win_size); - - s->window_func_lut = av_calloc(s->buf_size, sizeof(*s->window_func_lut)); + s->window_func_lut = av_calloc(s->win_size, sizeof(*s->window_func_lut)); if (!s->window_func_lut) return AVERROR(ENOMEM); - generate_window_func(s->window_func_lut, s->buf_size, s->win_func, &overlap); + generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap); if (s->overlap == 1) s->overlap = overlap; - for (i = 0; i < s->buf_size; i++) - s->window_func_lut[i] = sqrtf(s->window_func_lut[i] / s->buf_size); - s->hop_size = s->buf_size * (1. - s->overlap); - if (s->hop_size <= 0) - return AVERROR(EINVAL); + for (int i = 0; i < s->win_size; i++) + s->window_func_lut[i] = sqrtf(s->window_func_lut[i] / s->win_size); + s->hop_size = FFMAX(1, s->win_size * (1. - s->overlap)); - if (s->all_x >= 0.f) - s->fc_x = s->fl_x = s->fr_x = s->bc_x = s->sl_x = s->sr_x = s->bl_x = s->br_x = s->all_x; - if (s->all_y >= 0.f) - s->fc_y = s->fl_y = s->fr_y = s->bc_y = s->sl_y = s->sr_y = s->bl_y = s->br_y = s->all_y; + allchannels_spread(ctx); return 0; } -static int fft_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) +static int fft_channel(AVFilterContext *ctx, AVFrame *in, int ch) { AudioSurroundContext *s = ctx->priv; float *src = (float *)s->input_in->extended_data[ch]; float *win = (float *)s->window->extended_data[ch]; - const int offset = s->buf_size - s->hop_size; + const int offset = s->win_size - s->hop_size; const float level_in = s->input_levels[ch]; - AVFrame *in = arg; memmove(src, &src[s->hop_size], offset * sizeof(float)); memcpy(&src[offset], in->extended_data[ch], in->nb_samples * sizeof(float)); memset(&src[offset + in->nb_samples], 0, (s->hop_size - in->nb_samples) * sizeof(float)); - for (int n = 0; n < s->buf_size; n++) { + for (int n = 0; n < s->win_size; n++) win[n] = src[n] * s->window_func_lut[n] * level_in; - } s->tx_fn(s->rdft[ch], (float *)s->input->extended_data[ch], win, sizeof(float)); return 0; } -static int ifft_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) +static int fft_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + AVFrame *in = arg; + const int start = (in->ch_layout.nb_channels * jobnr) / nb_jobs; + const int end = (in->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; + + for (int ch = start; ch < end; ch++) + fft_channel(ctx, in, ch); + + return 0; +} + +static int ifft_channel(AVFilterContext *ctx, AVFrame *out, int ch) { AudioSurroundContext *s = ctx->priv; const float level_out = s->output_levels[ch]; - AVFrame *out = arg; float *dst, *ptr; - int n; dst = (float *)s->output_out->extended_data[ch]; ptr = (float *)s->overlap_buffer->extended_data[ch]; - s->itx_fn(s->irdft[ch], dst, (float *)s->output->extended_data[ch], sizeof(float)); + s->itx_fn(s->irdft[ch], dst, (float *)s->output->extended_data[ch], sizeof(AVComplexFloat)); memmove(s->overlap_buffer->extended_data[ch], s->overlap_buffer->extended_data[ch] + s->hop_size * sizeof(float), - s->buf_size * sizeof(float)); - memset(s->overlap_buffer->extended_data[ch] + s->buf_size * sizeof(float), + s->win_size * sizeof(float)); + memset(s->overlap_buffer->extended_data[ch] + s->win_size * sizeof(float), 0, s->hop_size * sizeof(float)); - for (n = 0; n < s->buf_size; n++) { + for (int n = 0; n < s->win_size; n++) ptr[n] += dst[n] * s->window_func_lut[n] * level_out; - } ptr = (float *)s->overlap_buffer->extended_data[ch]; dst = (float *)out->extended_data[ch]; @@ -1589,6 +1254,22 @@ return 0; } +static int ifft_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + AudioSurroundContext *s = ctx->priv; + AVFrame *out = arg; + const int start = (out->ch_layout.nb_channels * jobnr) / nb_jobs; + const int end = (out->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; + + for (int ch = start; ch < end; ch++) { + if (s->upmix) + s->upmix(ctx, ch); + ifft_channel(ctx, out, ch); + } + + return 0; +} + static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; @@ -1596,7 +1277,9 @@ AudioSurroundContext *s = ctx->priv; AVFrame *out; - ff_filter_execute(ctx, fft_channel, in, NULL, inlink->ch_layout.nb_channels); + ff_filter_execute(ctx, fft_channels, in, NULL, + FFMIN(inlink->ch_layout.nb_channels, + ff_filter_get_nb_threads(ctx))); s->filter(ctx); @@ -1604,9 +1287,11 @@ if (!out) return AVERROR(ENOMEM); - ff_filter_execute(ctx, ifft_channel, out, NULL, outlink->ch_layout.nb_channels); + ff_filter_execute(ctx, ifft_channels, out, NULL, + FFMIN(outlink->ch_layout.nb_channels, + ff_filter_get_nb_threads(ctx))); - out->pts = in->pts; + av_frame_copy_props(out, in); out->nb_samples = in->nb_samples; av_frame_free(&in); @@ -1652,10 +1337,14 @@ { AudioSurroundContext *s = ctx->priv; + av_frame_free(&s->factors); + av_frame_free(&s->sfactors); av_frame_free(&s->window); av_frame_free(&s->input_in); av_frame_free(&s->input); av_frame_free(&s->output); + av_frame_free(&s->output_ph); + av_frame_free(&s->output_mag); av_frame_free(&s->output_out); av_frame_free(&s->overlap_buffer); @@ -1668,62 +1357,94 @@ av_freep(&s->rdft); av_freep(&s->irdft); av_freep(&s->window_func_lut); + + av_freep(&s->x_pos); + av_freep(&s->y_pos); + av_freep(&s->l_phase); + av_freep(&s->r_phase); + av_freep(&s->c_mag); + av_freep(&s->c_phase); + av_freep(&s->mag_total); + av_freep(&s->lfe_mag); + av_freep(&s->lfe_phase); +} + +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, + char *res, int res_len, int flags) +{ + AudioSurroundContext *s = ctx->priv; + int ret; + + ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); + if (ret < 0) + return ret; + + s->hop_size = FFMAX(1, s->win_size * (1. - s->overlap)); + + allchannels_spread(ctx); + set_input_levels(ctx); + set_output_levels(ctx); + + return 0; } #define OFFSET(x) offsetof(AudioSurroundContext, x) #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +#define TFLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM static const AVOption surround_options[] = { { "chl_out", "set output channel layout", OFFSET(out_channel_layout_str), AV_OPT_TYPE_STRING, {.str="5.1"}, 0, 0, FLAGS }, { "chl_in", "set input channel layout", OFFSET(in_channel_layout_str), AV_OPT_TYPE_STRING, {.str="stereo"},0, 0, FLAGS }, - { "level_in", "set input level", OFFSET(level_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "level_out", "set output level", OFFSET(level_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "lfe", "output LFE", OFFSET(output_lfe), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, + { "level_in", "set input level", OFFSET(level_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "level_out", "set output level", OFFSET(level_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "lfe", "output LFE", OFFSET(output_lfe), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, TFLAGS }, { "lfe_low", "LFE low cut off", OFFSET(lowcutf), AV_OPT_TYPE_INT, {.i64=128}, 0, 256, FLAGS }, { "lfe_high", "LFE high cut off", OFFSET(highcutf), AV_OPT_TYPE_INT, {.i64=256}, 0, 512, FLAGS }, - { "lfe_mode", "set LFE channel mode", OFFSET(lfe_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "lfe_mode" }, - { "add", "just add LFE channel", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 1, FLAGS, "lfe_mode" }, - { "sub", "substract LFE channel with others", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, FLAGS, "lfe_mode" }, - { "angle", "set soundfield transform angle", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl=90}, 0, 360, FLAGS }, - { "fc_in", "set front center channel input level", OFFSET(fc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "fc_out", "set front center channel output level", OFFSET(fc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "fl_in", "set front left channel input level", OFFSET(fl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "fl_out", "set front left channel output level", OFFSET(fl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "fr_in", "set front right channel input level", OFFSET(fr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "fr_out", "set front right channel output level", OFFSET(fr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "sl_in", "set side left channel input level", OFFSET(sl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "sl_out", "set side left channel output level", OFFSET(sl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "sr_in", "set side right channel input level", OFFSET(sr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "sr_out", "set side right channel output level", OFFSET(sr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "bl_in", "set back left channel input level", OFFSET(bl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "bl_out", "set back left channel output level", OFFSET(bl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "br_in", "set back right channel input level", OFFSET(br_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "br_out", "set back right channel output level", OFFSET(br_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "bc_in", "set back center channel input level", OFFSET(bc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "bc_out", "set back center channel output level", OFFSET(bc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "lfe_in", "set lfe channel input level", OFFSET(lfe_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "lfe_out", "set lfe channel output level", OFFSET(lfe_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, - { "allx", "set all channel's x spread", OFFSET(all_x), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, FLAGS }, - { "ally", "set all channel's y spread", OFFSET(all_y), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, FLAGS }, - { "fcx", "set front center channel x spread", OFFSET(fc_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "flx", "set front left channel x spread", OFFSET(fl_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "frx", "set front right channel x spread", OFFSET(fr_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "blx", "set back left channel x spread", OFFSET(bl_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "brx", "set back right channel x spread", OFFSET(br_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "slx", "set side left channel x spread", OFFSET(sl_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "srx", "set side right channel x spread", OFFSET(sr_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "bcx", "set back center channel x spread", OFFSET(bc_x), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "fcy", "set front center channel y spread", OFFSET(fc_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "fly", "set front left channel y spread", OFFSET(fl_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "fry", "set front right channel y spread", OFFSET(fr_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "bly", "set back left channel y spread", OFFSET(bl_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "bry", "set back right channel y spread", OFFSET(br_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "sly", "set side left channel y spread", OFFSET(sl_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "sry", "set side right channel y spread", OFFSET(sr_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "bcy", "set back center channel y spread", OFFSET(bc_y), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, FLAGS }, - { "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS }, + { "lfe_mode", "set LFE channel mode", OFFSET(lfe_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, TFLAGS, "lfe_mode" }, + { "add", "just add LFE channel", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 1, TFLAGS, "lfe_mode" }, + { "sub", "substract LFE channel with others", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, TFLAGS, "lfe_mode" }, + { "smooth", "set temporal smoothness strength", OFFSET(smooth), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 1, TFLAGS }, + { "angle", "set soundfield transform angle", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl=90}, 0, 360, TFLAGS }, + { "focus", "set soundfield transform focus", OFFSET(focus), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, TFLAGS }, + { "fc_in", "set front center channel input level", OFFSET(f_i[SC_FC]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "fc_out", "set front center channel output level", OFFSET(f_o[SC_FC]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "fl_in", "set front left channel input level", OFFSET(f_i[SC_FL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "fl_out", "set front left channel output level", OFFSET(f_o[SC_FL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "fr_in", "set front right channel input level", OFFSET(f_i[SC_FR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "fr_out", "set front right channel output level", OFFSET(f_o[SC_FR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "sl_in", "set side left channel input level", OFFSET(f_i[SC_SL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "sl_out", "set side left channel output level", OFFSET(f_o[SC_SL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "sr_in", "set side right channel input level", OFFSET(f_i[SC_SR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "sr_out", "set side right channel output level", OFFSET(f_o[SC_SR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "bl_in", "set back left channel input level", OFFSET(f_i[SC_BL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "bl_out", "set back left channel output level", OFFSET(f_o[SC_BL]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "br_in", "set back right channel input level", OFFSET(f_i[SC_BR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "br_out", "set back right channel output level", OFFSET(f_o[SC_BR]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "bc_in", "set back center channel input level", OFFSET(f_i[SC_BC]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "bc_out", "set back center channel output level", OFFSET(f_o[SC_BC]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "lfe_in", "set lfe channel input level", OFFSET(f_i[SC_LF]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "lfe_out", "set lfe channel output level", OFFSET(f_o[SC_LF]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, TFLAGS }, + { "allx", "set all channel's x spread", OFFSET(all_x), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, TFLAGS }, + { "ally", "set all channel's y spread", OFFSET(all_y), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, TFLAGS }, + { "fcx", "set front center channel x spread", OFFSET(f_x[SC_FC]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "flx", "set front left channel x spread", OFFSET(f_x[SC_FL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "frx", "set front right channel x spread", OFFSET(f_x[SC_FR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "blx", "set back left channel x spread", OFFSET(f_x[SC_BL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "brx", "set back right channel x spread", OFFSET(f_x[SC_BR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "slx", "set side left channel x spread", OFFSET(f_x[SC_SL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "srx", "set side right channel x spread", OFFSET(f_x[SC_SR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "bcx", "set back center channel x spread", OFFSET(f_x[SC_BC]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "fcy", "set front center channel y spread", OFFSET(f_y[SC_FC]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "fly", "set front left channel y spread", OFFSET(f_y[SC_FL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "fry", "set front right channel y spread", OFFSET(f_y[SC_FR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "bly", "set back left channel y spread", OFFSET(f_y[SC_BL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "bry", "set back right channel y spread", OFFSET(f_y[SC_BR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "sly", "set side left channel y spread", OFFSET(f_y[SC_SL]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "sry", "set side right channel y spread", OFFSET(f_y[SC_SR]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "bcy", "set back center channel y spread", OFFSET(f_y[SC_BC]), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, .06, 15, TFLAGS }, + { "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64=4096},1024,65536,FLAGS }, WIN_FUNC_OPTION("win_func", OFFSET(win_func), FLAGS, WFUNC_HANNING), - { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS }, + { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, TFLAGS }, { NULL } }; @@ -1757,4 +1478,5 @@ FILTER_OUTPUTS(outputs), FILTER_QUERY_FUNC(query_formats), .flags = AVFILTER_FLAG_SLICE_THREADS, + .process_command = process_command, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_virtualbass.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_virtualbass.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_virtualbass.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/af_virtualbass.c 2023-03-03 13:29:59.000000000 +0000 @@ -146,10 +146,10 @@ av_frame_free(&in); return AVERROR(ENOMEM); } + av_frame_copy_props(out, in); vb_stereo(ctx, out, in); - out->pts = in->pts; av_frame_free(&in); return ff_filter_frame(outlink, out); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/allfilters.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/allfilters.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/allfilters.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/allfilters.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,6 +35,7 @@ extern const AVFilter ff_af_adelay; extern const AVFilter ff_af_adenorm; extern const AVFilter ff_af_aderivative; +extern const AVFilter ff_af_adrc; extern const AVFilter ff_af_adynamicequalizer; extern const AVFilter ff_af_adynamicsmooth; extern const AVFilter ff_af_aecho; @@ -158,6 +159,7 @@ extern const AVFilter ff_af_volumedetect; extern const AVFilter ff_asrc_aevalsrc; +extern const AVFilter ff_asrc_afdelaysrc; extern const AVFilter ff_asrc_afirsrc; extern const AVFilter ff_asrc_anoisesrc; extern const AVFilter ff_asrc_anullsrc; @@ -177,9 +179,11 @@ extern const AVFilter ff_vf_avgblur; extern const AVFilter ff_vf_avgblur_opencl; extern const AVFilter ff_vf_avgblur_vulkan; +extern const AVFilter ff_vf_backgroundkey; extern const AVFilter ff_vf_bbox; extern const AVFilter ff_vf_bench; extern const AVFilter ff_vf_bilateral; +extern const AVFilter ff_vf_bilateral_cuda; extern const AVFilter ff_vf_bitplanenoise; extern const AVFilter ff_vf_blackdetect; extern const AVFilter ff_vf_blackframe; @@ -212,12 +216,14 @@ extern const AVFilter ff_vf_colormap; extern const AVFilter ff_vf_colormatrix; extern const AVFilter ff_vf_colorspace; +extern const AVFilter ff_vf_colorspace_cuda; extern const AVFilter ff_vf_colortemperature; extern const AVFilter ff_vf_convolution; extern const AVFilter ff_vf_convolution_opencl; extern const AVFilter ff_vf_convolve; extern const AVFilter ff_vf_copy; extern const AVFilter ff_vf_coreimage; +extern const AVFilter ff_vf_corr; extern const AVFilter ff_vf_cover_rect; extern const AVFilter ff_vf_crop; extern const AVFilter ff_vf_cropdetect; @@ -452,6 +458,7 @@ extern const AVFilter ff_vf_spp; extern const AVFilter ff_vf_sr; extern const AVFilter ff_vf_ssim; +extern const AVFilter ff_vf_ssim360; extern const AVFilter ff_vf_stereo3d; extern const AVFilter ff_vf_streamselect; extern const AVFilter ff_vf_subtitles; @@ -516,6 +523,12 @@ extern const AVFilter ff_vf_zmq; extern const AVFilter ff_vf_zoompan; extern const AVFilter ff_vf_zscale; +extern const AVFilter ff_vf_hstack_vaapi; +extern const AVFilter ff_vf_vstack_vaapi; +extern const AVFilter ff_vf_xstack_vaapi; +extern const AVFilter ff_vf_hstack_qsv; +extern const AVFilter ff_vf_vstack_qsv; +extern const AVFilter ff_vf_xstack_qsv; extern const AVFilter ff_vsrc_allrgb; extern const AVFilter ff_vsrc_allyuv; @@ -524,6 +537,7 @@ extern const AVFilter ff_vsrc_colorchart; extern const AVFilter ff_vsrc_colorspectrum; extern const AVFilter ff_vsrc_coreimagesrc; +extern const AVFilter ff_vsrc_ddagrab; extern const AVFilter ff_vsrc_frei0r_src; extern const AVFilter ff_vsrc_gradients; extern const AVFilter ff_vsrc_haldclutsrc; @@ -545,6 +559,7 @@ extern const AVFilter ff_vsink_nullsink; /* multimedia filters */ +extern const AVFilter ff_avf_a3dscope; extern const AVFilter ff_avf_abitscope; extern const AVFilter ff_avf_adrawgraph; extern const AVFilter ff_avf_agraphmonitor; @@ -553,6 +568,7 @@ extern const AVFilter ff_avf_avectorscope; extern const AVFilter ff_avf_concat; extern const AVFilter ff_avf_showcqt; +extern const AVFilter ff_avf_showcwt; extern const AVFilter ff_avf_showfreqs; extern const AVFilter ff_avf_showspatial; extern const AVFilter ff_avf_showspectrum; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afdelaysrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afdelaysrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afdelaysrc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afdelaysrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * 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/avassert.h" +#include "libavutil/channel_layout.h" +#include "libavutil/opt.h" + +#include "audio.h" +#include "avfilter.h" +#include "filters.h" +#include "internal.h" + +typedef struct AFDelaySrcContext { + const AVClass *class; + + double delay; + int sample_rate; + int nb_samples; + int nb_taps; + AVChannelLayout chlayout; + char *chlayout_str; + + int64_t pts; +} AFDelaySrcContext; + +static av_cold int init(AVFilterContext *ctx) +{ + AFDelaySrcContext *s = ctx->priv; + int ret; + + ret = ff_parse_channel_layout(&s->chlayout, NULL, s->chlayout_str, ctx); + if (ret < 0) + return ret; + + return 0; +} + +static float sincf(float x) +{ + if (x == 0.f) + return 1.f; + return sinf(M_PI * x) / (M_PI * x); +} + +static int activate(AVFilterContext *ctx) +{ + AVFilterLink *outlink = ctx->outputs[0]; + AFDelaySrcContext *s = ctx->priv; + AVFrame *frame = NULL; + int nb_samples; + float *dst; + + if (!ff_outlink_frame_wanted(outlink)) + return FFERROR_NOT_READY; + + nb_samples = FFMIN(s->nb_samples, s->nb_taps - s->pts); + if (nb_samples <= 0) { + ff_outlink_set_status(outlink, AVERROR_EOF, s->pts); + return 0; + } + + if (!(frame = ff_get_audio_buffer(outlink, nb_samples))) + return AVERROR(ENOMEM); + + dst = (float *)frame->extended_data[0]; + for (int n = 0; n < nb_samples; n++) { + float x = s->pts + n; + dst[n] = sincf(x - s->delay) * cosf(M_PI * (x - s->delay) / s->nb_taps) / sincf((x - s->delay) / s->nb_taps); + } + + for (int ch = 1; ch < frame->ch_layout.nb_channels; ch++) + memcpy(frame->extended_data[ch], dst, sizeof(*dst) * nb_samples); + + frame->pts = s->pts; + s->pts += nb_samples; + + return ff_filter_frame(outlink, frame); +} + +static int query_formats(AVFilterContext *ctx) +{ + AFDelaySrcContext *s = ctx->priv; + AVChannelLayout chlayouts[] = { s->chlayout, { 0 } }; + int sample_rates[] = { s->sample_rate, -1 }; + static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, + AV_SAMPLE_FMT_NONE }; + int ret = ff_set_common_formats_from_list(ctx, sample_fmts); + if (ret < 0) + return ret; + + ret = ff_set_common_channel_layouts_from_list(ctx, chlayouts); + if (ret < 0) + return ret; + + return ff_set_common_samplerates_from_list(ctx, sample_rates); +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + AFDelaySrcContext *s = ctx->priv; + + outlink->sample_rate = s->sample_rate; + s->pts = 0; + if (s->nb_taps <= 0) + s->nb_taps = s->delay * 8 + 1; + + return 0; +} + +static const AVFilterPad afdelaysrc_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .config_props = config_output, + }, +}; + +static av_cold void uninit(AVFilterContext *ctx) +{ + AFDelaySrcContext *s = ctx->priv; + + av_channel_layout_uninit(&s->chlayout); +} + +#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +#define OFFSET(x) offsetof(AFDelaySrcContext, x) + +static const AVOption afdelaysrc_options[] = { + { "delay", "set fractional delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE,{.dbl=0}, 0, INT16_MAX, AF }, + { "d", "set fractional delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE,{.dbl=0}, 0, INT16_MAX, AF }, + { "sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100}, 1, INT_MAX, AF }, + { "r", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100}, 1, INT_MAX, AF }, + { "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, AF }, + { "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, AF }, + { "taps", "set number of taps for delay filter", OFFSET(nb_taps), AV_OPT_TYPE_INT, {.i64=0}, 0, 32768, AF }, + { "t", "set number of taps for delay filter", OFFSET(nb_taps), AV_OPT_TYPE_INT, {.i64=0}, 0, 32768, AF }, + { "channel_layout", "set channel layout", OFFSET(chlayout_str),AV_OPT_TYPE_STRING,{.str="stereo"},0, 0, AF }, + { "c", "set channel layout", OFFSET(chlayout_str),AV_OPT_TYPE_STRING,{.str="stereo"},0, 0, AF }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(afdelaysrc); + +const AVFilter ff_asrc_afdelaysrc = { + .name = "afdelaysrc", + .description = NULL_IF_CONFIG_SMALL("Generate a Fractional delay FIR coefficients."), + .priv_size = sizeof(AFDelaySrcContext), + .priv_class = &afdelaysrc_class, + .init = init, + .activate = activate, + .uninit = uninit, + .inputs = NULL, + FILTER_OUTPUTS(afdelaysrc_outputs), + FILTER_QUERY_FUNC(query_formats), +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afirsrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afirsrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afirsrc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_afirsrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -239,7 +239,7 @@ lininterp(s->complexf, s->freq, s->magnitude, s->phase, s->nb_freq, fft_size / 2); - s->tx_fn(s->tx_ctx, s->complexf + fft_size, s->complexf, sizeof(float)); + s->tx_fn(s->tx_ctx, s->complexf + fft_size, s->complexf, sizeof(*s->complexf)); compensation = 2.f / fft_size; middle = s->nb_taps / 2; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_sinc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_sinc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_sinc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/asrc_sinc.c 2023-03-03 13:29:59.000000000 +0000 @@ -261,7 +261,7 @@ work[i + 1] = 0; } - s->itx_fn(s->itx, work, work, sizeof(float)); + s->itx_fn(s->itx, work, work, sizeof(AVComplexFloat)); for (i = 0; i < work_len; i++) work[i] *= 2.f / work_len; @@ -284,7 +284,7 @@ work[i + 1] = x * sinf(work[i + 1]); } - s->itx_fn(s->itx, work, work, sizeof(float)); + s->itx_fn(s->itx, work, work, sizeof(AVComplexFloat)); for (i = 0; i < work_len; i++) work[i] *= 2.f / work_len; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_a3dscope.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_a3dscope.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_a3dscope.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_a3dscope.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/avassert.h" +#include "libavutil/channel_layout.h" +#include "libavutil/opt.h" +#include "libavutil/parseutils.h" +#include "avfilter.h" +#include "filters.h" +#include "formats.h" +#include "audio.h" +#include "video.h" +#include "internal.h" + +typedef struct Audio3dScopeContext { + const AVClass *class; + int w, h; + int size; + float fov; + float roll; + float pitch; + float yaw; + float zoom[3]; + float eye[3]; + + AVRational frame_rate; + int nb_samples; + + float view_matrix[4][4]; + float projection_matrix[4][4]; + + AVFrame *frames[60]; +} Audio3dScopeContext; + +#define OFFSET(x) offsetof(Audio3dScopeContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM +#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM + +static const AVOption a3dscope_options[] = { + { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS }, + { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS }, + { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS }, + { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS }, + { "fov", "set camera FoV", OFFSET(fov), AV_OPT_TYPE_FLOAT, {.dbl=90.f}, 40, 150, TFLAGS }, + { "roll", "set camera roll",OFFSET(roll), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS }, + { "pitch","set camera pitch",OFFSET(pitch), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS }, + { "yaw", "set camera yaw", OFFSET(yaw), AV_OPT_TYPE_FLOAT, {.dbl=0.f}, -180, 180, TFLAGS }, + { "xzoom","set camera zoom", OFFSET(zoom[0]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS }, + { "yzoom","set camera zoom", OFFSET(zoom[1]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS }, + { "zzoom","set camera zoom", OFFSET(zoom[2]),AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0.01, 10, TFLAGS }, + { "xpos", "set camera position", OFFSET(eye[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS }, + { "ypos", "set camera position", OFFSET(eye[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS }, + { "zpos", "set camera position", OFFSET(eye[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.f},-60.f, 60.f, TFLAGS }, + { "length","set length", OFFSET(size), AV_OPT_TYPE_INT, {.i64=15}, 1, 60, FLAGS }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(a3dscope); + +static int query_formats(AVFilterContext *ctx) +{ + AVFilterFormats *formats = NULL; + AVFilterChannelLayouts *layouts = NULL; + AVFilterLink *inlink = ctx->inputs[0]; + AVFilterLink *outlink = ctx->outputs[0]; + static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE }; + int ret; + + formats = ff_make_format_list(sample_fmts); + if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0) + return ret; + + formats = ff_all_samplerates(); + if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + return ret; + + formats = ff_make_format_list(pix_fmts); + if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + return ret; + + layouts = ff_all_channel_counts(); + if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) + return ret; + + return 0; +} + +static int config_input(AVFilterLink *inlink) +{ + AVFilterContext *ctx = inlink->dst; + Audio3dScopeContext *s = ctx->priv; + + s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num)); + + return 0; +} + +static int config_output(AVFilterLink *outlink) +{ + Audio3dScopeContext *s = outlink->src->priv; + + outlink->w = s->w; + outlink->h = s->h; + outlink->sample_aspect_ratio = (AVRational){1,1}; + outlink->frame_rate = s->frame_rate; + outlink->time_base = av_inv_q(outlink->frame_rate); + + return 0; +} + +static void projection_matrix(float fov, float a, float near, float far, + float matrix[4][4]) +{ + float f; + + memset(matrix, 0, sizeof(*matrix)); + + f = 1.0f / tanf(fov * 0.5f * M_PI / 180.f); + matrix[0][0] = f * a; + matrix[1][1] = f; + matrix[2][2] = -(far + near) / (far - near); + matrix[2][3] = -1.f; + matrix[3][2] = -(near * far) / (far - near); +} + +static inline void vmultiply(const float v[4], const float m[4][4], float d[4]) +{ + d[0] = v[0] * m[0][0] + v[1] * m[1][0] + v[2] * m[2][0] + v[3] * m[3][0]; + d[1] = v[0] * m[0][1] + v[1] * m[1][1] + v[2] * m[2][1] + v[3] * m[3][1]; + d[2] = v[0] * m[0][2] + v[1] * m[1][2] + v[2] * m[2][2] + v[3] * m[3][2]; + d[3] = v[0] * m[0][3] + v[1] * m[1][3] + v[2] * m[2][3] + v[3] * m[3][3]; +} + +static void mmultiply(const float m2[4][4], const float m1[4][4], float m[4][4]) +{ + vmultiply(m2[0], m1, m[0]); + vmultiply(m2[1], m1, m[1]); + vmultiply(m2[2], m1, m[2]); + vmultiply(m2[3], m1, m[3]); +} + +static float vdot(const float x[3], const float y[3]) +{ + return x[0] * y[0] + x[1] * y[1] + x[2] * y[2]; +} + +static void view_matrix(const float eye[3], + const float z[3], + const float roll, + const float pitch, + const float yaw, float m[4][4]) +{ + float cr = cosf(roll * M_PI / 180.f); + float sr = sinf(roll * M_PI / 180.f); + float cp = cosf(pitch * M_PI / 180.f); + float sp = sinf(pitch * M_PI / 180.f); + float cy = cosf(yaw * M_PI / 180.f); + float sy = sinf(yaw * M_PI / 180.f); + float t[4][4]; + float rx[4][4] = { + {z[0], 0.f, 0.f, 0.f }, + { 0.f, cy, -sy, 0.f }, + { 0.f, sy, cy, 0.f }, + { 0.f, 0.f, 0.f, 1.f }, + }; + + float ry[4][4] = { + { cp, 0.f, sp, 0.f }, + { 0.f,z[1], 0.f, 0.f }, + {-sp, 0.f, cp, 0.f }, + { 0.f, 0.f, 0.f, 1.f }, + }; + + float rz[4][4] = { + { cr, -sr, 0.f, 0.f }, + { sr, cr, 0.f, 0.f }, + { 0.f, 0.f,z[2], 0.f }, + { 0.f, 0.f, 0.f, 1.f }, + }; + + memset(m, 0, sizeof(*m)); + + mmultiply(rx, ry, t); + mmultiply(rz, t, m); + + m[3][0] = -vdot(m[0], eye); + m[3][1] = -vdot(m[1], eye); + m[3][2] = -vdot(m[2], eye); +} + +static void draw_dot(AVFrame *out, unsigned x, unsigned y, float z, + int r, int g, int b) +{ + const ptrdiff_t linesize = out->linesize[0]; + uint8_t *dst; + + dst = out->data[0] + y * linesize + x * 4; + dst[0] = r * z; + dst[1] = g * z; + dst[2] = b * z; + dst[3] = 255 * z; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ + AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; + Audio3dScopeContext *s = ctx->priv; + const float half_height = (s->h - 1) * 0.5f; + const float half_width = (s->w - 1) * 0.5f; + float matrix[4][4]; + const int w = s->w; + const int h = s->h; + AVFrame *out; + + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + + s->frames[0] = in; + + out->sample_aspect_ratio = (AVRational){1,1}; + for (int y = 0; y < outlink->h; y++) + memset(out->data[0] + y * out->linesize[0], 0, outlink->w * 4); + out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base); + out->duration = 1; + + projection_matrix(s->fov, half_width / half_height, 0.1f, 1000000.f, s->projection_matrix); + view_matrix(s->eye, s->zoom, s->roll, s->pitch, s->yaw, s->view_matrix); + mmultiply(s->projection_matrix, s->view_matrix, matrix); + + for (int nb_frame = s->size - 1; nb_frame >= 0; nb_frame--) { + const float scale = 1.f / s->nb_samples; + AVFrame *frame = s->frames[nb_frame]; + float channels; + + if (!frame) + continue; + + channels = frame->ch_layout.nb_channels; + for (int ch = 0; ch < channels; ch++) { + const float *src = (float *)frame->extended_data[ch]; + const int r = 128.f + 127.f * sinf(ch / (channels - 1) * M_PI); + const int g = 128.f + 127.f * ch / (channels - 1); + const int b = 128.f + 127.f * cosf(ch / (channels - 1) * M_PI); + + for (int n = frame->nb_samples - 1, nn = s->nb_samples * nb_frame; n >= 0; n--, nn++) { + float v[4] = { src[n], ch - (channels - 1) * 0.5f, -0.1f + -nn * scale, 1.f }; + float d[4]; + int x, y; + + vmultiply(v, matrix, d); + + d[0] /= d[3]; + d[1] /= d[3]; + + x = d[0] * half_width + half_width; + y = d[1] * half_height + half_height; + + if (x >= w || y >= h || x < 0 || y < 0) + continue; + + draw_dot(out, x, y, av_clipf(1.f / d[3], 0.f, 1.f), + r, g, b); + } + } + } + + av_frame_free(&s->frames[59]); + memmove(&s->frames[1], &s->frames[0], 59 * sizeof(AVFrame *)); + s->frames[0] = NULL; + + return ff_filter_frame(outlink, out); +} + +static int activate(AVFilterContext *ctx) +{ + AVFilterLink *inlink = ctx->inputs[0]; + AVFilterLink *outlink = ctx->outputs[0]; + Audio3dScopeContext *s = ctx->priv; + AVFrame *in; + int ret; + + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + + ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in); + if (ret < 0) + return ret; + if (ret > 0) + return filter_frame(inlink, in); + + if (ff_inlink_queued_samples(inlink) >= s->nb_samples) { + ff_filter_set_ready(ctx, 10); + return 0; + } + + FF_FILTER_FORWARD_STATUS(inlink, outlink); + FF_FILTER_FORWARD_WANTED(outlink, inlink); + + return FFERROR_NOT_READY; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + Audio3dScopeContext *s = ctx->priv; + + for (int n = 0; n < 60; n++) + av_frame_free(&s->frames[n]); +} + +static const AVFilterPad audio3dscope_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .config_props = config_input, + }, +}; + +static const AVFilterPad audio3dscope_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +const AVFilter ff_avf_a3dscope = { + .name = "a3dscope", + .description = NULL_IF_CONFIG_SMALL("Convert input audio to 3d scope video output."), + .uninit = uninit, + .priv_size = sizeof(Audio3dScopeContext), + .activate = activate, + FILTER_INPUTS(audio3dscope_inputs), + FILTER_OUTPUTS(audio3dscope_outputs), + FILTER_QUERY_FUNC(query_formats), + .priv_class = &a3dscope_class, + .process_command = ff_filter_process_command, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_abitscope.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_abitscope.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_abitscope.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_abitscope.c 2023-03-03 13:29:59.000000000 +0000 @@ -143,6 +143,7 @@ outlink->h = s->h; outlink->sample_aspect_ratio = (AVRational){1,1}; outlink->frame_rate = s->frame_rate; + outlink->time_base = av_inv_q(outlink->frame_rate); return 0; } @@ -212,6 +213,7 @@ AVFilterLink *outlink = ctx->outputs[0]; AudioBitScopeContext *s = ctx->priv; AVFrame *outpicref; + int ret; if (s->mode == 0 || !s->outpicref) { outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h); @@ -227,13 +229,20 @@ } if (s->mode == 1) { - av_frame_make_writable(s->outpicref); + ret = ff_inlink_make_frame_writable(outlink, &s->outpicref); + if (ret < 0) { + av_frame_free(&insamples); + return ret; + } outpicref = av_frame_clone(s->outpicref); - if (!outpicref) + if (!outpicref) { + av_frame_free(&insamples); return AVERROR(ENOMEM); + } } - outpicref->pts = insamples->pts; + outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); + outpicref->duration = 1; outpicref->sample_aspect_ratio = (AVRational){1,1}; switch (insamples->format) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_ahistogram.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_ahistogram.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_ahistogram.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_ahistogram.c 2023-03-03 13:29:59.000000000 +0000 @@ -209,7 +209,7 @@ AudioHistogramContext *s = ctx->priv; const int H = s->histogram_h; const int w = s->w; - int c, y, n, p, bin; + int c, y, n, p, bin, ret; uint64_t acmax = 1; AVFrame *clone; @@ -229,7 +229,12 @@ } } - av_frame_make_writable(s->out); + ret = ff_inlink_make_frame_writable(outlink, &s->out); + if (ret < 0) { + av_frame_free(&in); + return ret; + } + if (s->dmode == SEPARATE) { for (y = 0; y < w; y++) { s->combine_buffer[3 * y ] = 0; @@ -245,6 +250,7 @@ memset(s->out->data[3] + n * s->out->linesize[0], 0, w); } s->out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base); + s->out->duration = 1; s->first = s->frame_count; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_aphasemeter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_aphasemeter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_aphasemeter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_aphasemeter.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "libavutil/parseutils.h" #include "libavutil/timestamp.h" #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "audio.h" #include "video.h" @@ -246,7 +247,7 @@ float fphase = 0; AVFrame *out; uint8_t *dst; - int i; + int i, ret; int mono_measurement; int out_phase_measurement; float tolerance = 1.0f - s->tolerance; @@ -265,8 +266,12 @@ for (i = 0; i < outlink->h; i++) memset(out->data[0] + i * out->linesize[0], 0, outlink->w * 4); } else if (s->do_video) { + ret = ff_inlink_make_frame_writable(outlink, &s->out); + if (ret < 0) { + av_frame_free(&in); + return ret; + } out = s->out; - av_frame_make_writable(s->out); for (i = outlink->h - 1; i >= 10; i--) memmove(out->data[0] + (i ) * out->linesize[0], out->data[0] + (i-1) * out->linesize[0], @@ -327,6 +332,8 @@ AVFrame *clone; s->out->pts = in->pts; + s->out->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + clone = av_frame_clone(s->out); if (!clone) return AVERROR(ENOMEM); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_avectorscope.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_avectorscope.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_avectorscope.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_avectorscope.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,6 +44,7 @@ enum VectorScopeDraw { DOT, LINE, + AALINE, DRAW_NB, }; @@ -97,8 +98,9 @@ { "af", "set alpha fade", OFFSET(fade[3]), AV_OPT_TYPE_INT, {.i64=5}, 0, 255, TFLAGS }, { "zoom", "set zoom factor", OFFSET(zoom), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 10, TFLAGS }, { "draw", "set draw mode", OFFSET(draw), AV_OPT_TYPE_INT, {.i64=DOT}, 0, DRAW_NB-1, TFLAGS, "draw" }, - { "dot", "", 0, AV_OPT_TYPE_CONST, {.i64=DOT} , 0, 0, TFLAGS, "draw" }, - { "line", "", 0, AV_OPT_TYPE_CONST, {.i64=LINE}, 0, 0, TFLAGS, "draw" }, + { "dot", "draw dots", 0, AV_OPT_TYPE_CONST, {.i64=DOT} , 0, 0, TFLAGS, "draw" }, + { "line", "draw lines", 0, AV_OPT_TYPE_CONST, {.i64=LINE}, 0, 0, TFLAGS, "draw" }, + { "aaline","draw anti-aliased lines", 0, AV_OPT_TYPE_CONST, {.i64=AALINE},0,0, TFLAGS, "draw" }, { "scale", "set amplitude scale mode", OFFSET(scale), AV_OPT_TYPE_INT, {.i64=LIN}, 0, SCALE_NB-1, TFLAGS, "scale" }, { "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=LIN}, 0, 0, TFLAGS, "scale" }, { "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=SQRT}, 0, 0, TFLAGS, "scale" }, @@ -115,9 +117,9 @@ AVFILTER_DEFINE_CLASS(avectorscope); -static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y) +static void draw_dot(AudioVectorScopeContext *s, unsigned x, unsigned y, int value) { - const int linesize = s->outpicref->linesize[0]; + const ptrdiff_t linesize = s->outpicref->linesize[0]; uint8_t *dst; if (s->zoom > 1) { @@ -128,11 +130,11 @@ x = FFMIN(x, s->w - 1); } - dst = &s->outpicref->data[0][y * linesize + x * 4]; - dst[0] = FFMIN(dst[0] + s->contrast[0], 255); - dst[1] = FFMIN(dst[1] + s->contrast[1], 255); - dst[2] = FFMIN(dst[2] + s->contrast[2], 255); - dst[3] = FFMIN(dst[3] + s->contrast[3], 255); + dst = s->outpicref->data[0] + y * linesize + x * 4; + dst[0] = FFMIN(dst[0] + s->contrast[0], value); + dst[1] = FFMIN(dst[1] + s->contrast[1], value); + dst[2] = FFMIN(dst[2] + s->contrast[2], value); + dst[3] = FFMIN(dst[3] + s->contrast[3], value); } static void draw_line(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1) @@ -142,7 +144,7 @@ int err = (dx>dy ? dx : -dy) / 2, e2; for (;;) { - draw_dot(s, x0, y0); + draw_dot(s, x0, y0, 255); if (x0 == x1 && y0 == y1) break; @@ -161,6 +163,40 @@ } } +static void draw_aaline(AudioVectorScopeContext *s, int x0, int y0, int x1, int y1) +{ + int sx = x0 < x1 ? 1 : -1, sy = y0 < y1 ? 1 : -1, x2; + int dx = FFABS(x1-x0), dy = FFABS(y1-y0), err = dx * dx + dy * dy; + int e2 = err == 0 ? 1 : 0xffffff / (dx + dy); + + dx *= e2; + dy *= e2; + err = dx - dy; + + for (;;) { + draw_dot(s, x0, y0, 255-(FFABS(err - dx + dy) >> 16)); + e2 = err; + x2 = x0; + if (2 * e2 >= -dx) { + if (x0 == x1) + break; + if (e2 + dy < 0xff0000) + draw_dot(s, x0, y0 + sy, 255-((e2 + dy) >> 16)); + err -= dy; + x0 += sx; + } + + if (2 * e2 <= dy) { + if (y0 == y1) + break; + if (dx - e2 < 0xff0000) + draw_dot(s, x2 + sx, y0, 255-((dx - e2) >> 16)); + err += dx; + y0 += sy; + } + } +} + static int fade(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { AudioVectorScopeContext *s = ctx->priv; @@ -252,6 +288,8 @@ { AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; + const int16_t *samples = (const int16_t *)insamples->data[0]; + const float *samplesf = (const float *)insamples->data[0]; AudioVectorScopeContext *s = ctx->priv; const int hw = s->hw; const int hh = s->hh; @@ -259,7 +297,7 @@ unsigned x, y; unsigned prev_x = s->prev_x, prev_y = s->prev_y; double zoom = s->zoom; - int i; + int ret; if (!s->outpicref || s->outpicref->width != outlink->w || s->outpicref->height != outlink->h) { @@ -271,34 +309,32 @@ } s->outpicref->sample_aspect_ratio = (AVRational){1,1}; - for (i = 0; i < outlink->h; i++) + for (int i = 0; i < outlink->h; i++) memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, outlink->w * 4); } s->outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); + s->outpicref->duration = 1; - av_frame_make_writable(s->outpicref); + ret = ff_inlink_make_frame_writable(outlink, &s->outpicref); + if (ret < 0) { + av_frame_free(&insamples); + return ret; + } ff_filter_execute(ctx, fade, NULL, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); if (zoom < 1) { float max = 0; switch (insamples->format) { - case AV_SAMPLE_FMT_S16: { - int16_t *samples = (int16_t *)insamples->data[0]; - - for (i = 0; i < insamples->nb_samples * 2; i++) { + case AV_SAMPLE_FMT_S16: + for (int i = 0; i < insamples->nb_samples * 2; i++) { float sample = samples[i] / (float)INT16_MAX; max = FFMAX(FFABS(sample), max); } - - } break; - case AV_SAMPLE_FMT_FLT: { - float *samples = (float *)insamples->data[0]; - - for (i = 0; i < insamples->nb_samples * 2; i++) { - max = FFMAX(FFABS(samples[i]), max); - } + case AV_SAMPLE_FMT_FLT: + for (int i = 0; i < insamples->nb_samples * 2; i++) { + max = FFMAX(FFABS(samplesf[i]), max); } break; default: @@ -317,22 +353,21 @@ break; } - zoom = 1. / max; + if (max > 0.f) + zoom = 1. / max; } - for (i = 0; i < insamples->nb_samples; i++) { - int16_t *samples = (int16_t *)insamples->data[0] + i * 2; - float *samplesf = (float *)insamples->data[0] + i * 2; + for (int i = 0; i < insamples->nb_samples; i++) { float src[2]; switch (insamples->format) { case AV_SAMPLE_FMT_S16: - src[0] = samples[0] / (float)INT16_MAX; - src[1] = samples[1] / (float)INT16_MAX; + src[0] = samples[i*2+0] / (float)INT16_MAX; + src[1] = samples[i*2+1] / (float)INT16_MAX; break; case AV_SAMPLE_FMT_FLT: - src[0] = samplesf[0]; - src[1] = samplesf[1]; + src[0] = samplesf[i*2+0]; + src[1] = samplesf[i*2+1]; break; default: av_assert2(0); @@ -380,9 +415,11 @@ } if (s->draw == DOT) { - draw_dot(s, x, y); - } else { + draw_dot(s, x, y, 255); + } else if (s->draw == LINE) { draw_line(s, x, y, prev_x, prev_y); + } else { + draw_aaline(s, x, y, prev_x, prev_y); } prev_x = x; prev_y = y; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "libavutil/avassert.h" #include "libavutil/avstring.h" +#include "libavutil/bprint.h" #include "libavutil/buffer.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" @@ -45,6 +46,7 @@ static void tlog_ref(void *ctx, AVFrame *ref, int end) { +#ifdef TRACE ff_tlog(ctx, "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64, ref, ref->buf, ref->data[0], @@ -61,16 +63,22 @@ av_get_picture_type_char(ref->pict_type)); } if (ref->nb_samples) { - ff_tlog(ctx, " cl:%"PRId64"d n:%d r:%d", - ref->channel_layout, + AVBPrint bprint; + + av_bprint_init(&bprint, 1, AV_BPRINT_SIZE_UNLIMITED); + av_channel_layout_describe_bprint(&ref->ch_layout, &bprint); + ff_tlog(ctx, " cl:%s n:%d r:%d", + bprint.str, ref->nb_samples, ref->sample_rate); + av_bprint_finalize(&bprint, NULL); } ff_tlog(ctx, "]%s", end ? "\n" : ""); +#endif } -void ff_command_queue_pop(AVFilterContext *filter) +static void command_queue_pop(AVFilterContext *filter) { AVFilterCommand *c= filter->command_queue; av_freep(&c->arg); @@ -150,6 +158,11 @@ src->outputs[srcpad] || dst->inputs[dstpad]) return AVERROR(EINVAL); + if (!src->internal->initialized || !dst->internal->initialized) { + av_log(src, AV_LOG_ERROR, "Filters must be initialized before linking.\n"); + return AVERROR(EINVAL); + } + if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) { av_log(src, AV_LOG_ERROR, "Media type mismatch between the '%s' filter output pad %d (%s) and the '%s' filter input pad %d (%s)\n", @@ -373,6 +386,7 @@ return 0; } +#ifdef TRACE void ff_tlog_link(void *ctx, AVFilterLink *link, int end) { if (link->type == AVMEDIA_TYPE_VIDEO) { @@ -396,6 +410,7 @@ end ? "\n" : ""); } } +#endif int ff_request_frame(AVFilterLink *link) { @@ -550,27 +565,6 @@ return AVERROR(ENOSYS); } -#if FF_API_PAD_COUNT -int avfilter_pad_count(const AVFilterPad *pads) -{ - const AVFilter *filter; - void *opaque = NULL; - - if (!pads) - return 0; - - while (filter = av_filter_iterate(&opaque)) { - if (pads == filter->inputs) - return filter->nb_inputs; - if (pads == filter->outputs) - return filter->nb_outputs; - } - - av_assert0(!"AVFilterPad list not from a filter"); - return AVERROR_BUG; -} -#endif - unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output) { return is_output ? filter->nb_outputs : filter->nb_inputs; @@ -770,7 +764,7 @@ av_freep(&filter->outputs); av_freep(&filter->priv); while(filter->command_queue){ - ff_command_queue_pop(filter); + command_queue_pop(filter); } av_opt_free(filter); av_expr_free(filter->enable); @@ -787,8 +781,8 @@ return ctx->graph->nb_threads; } -static int process_options(AVFilterContext *ctx, AVDictionary **options, - const char *args) +int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, + AVDictionary **options, const char *args) { const AVOption *o = NULL; int ret; @@ -802,7 +796,8 @@ while (*args) { const char *shorthand = NULL; - o = av_opt_next(ctx->priv, o); + if (priv_class) + o = av_opt_next(&priv_class, o); if (o) { if (o->type == AV_OPT_TYPE_CONST || o->offset == offset) continue; @@ -815,9 +810,9 @@ &parsed_key, &value); if (ret < 0) { if (ret == AVERROR(EINVAL)) - av_log(ctx, AV_LOG_ERROR, "No option name near '%s'\n", args); + av_log(logctx, AV_LOG_ERROR, "No option name near '%s'\n", args); else - av_log(ctx, AV_LOG_ERROR, "Unable to parse '%s': %s\n", args, + av_log(logctx, AV_LOG_ERROR, "Unable to parse '%s': %s\n", args, av_err2str(ret)); return ret; } @@ -825,33 +820,17 @@ args++; if (parsed_key) { key = parsed_key; - while ((o = av_opt_next(ctx->priv, o))); /* discard all remaining shorthand */ + + /* discard all remaining shorthand */ + if (priv_class) + while ((o = av_opt_next(&priv_class, o))); } else { key = shorthand; } - av_log(ctx, AV_LOG_DEBUG, "Setting '%s' to value '%s'\n", key, value); + av_log(logctx, AV_LOG_DEBUG, "Setting '%s' to value '%s'\n", key, value); - if (av_opt_find(ctx, key, NULL, 0, 0)) { - ret = av_opt_set(ctx, key, value, 0); - if (ret < 0) { - av_free(value); - av_free(parsed_key); - return ret; - } - } else { - o = av_opt_find(ctx->priv, key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - if (!o) { - av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key); - av_free(value); - av_free(parsed_key); - return AVERROR_OPTION_NOT_FOUND; - } - av_dict_set(options, key, value, - (o->type == AV_OPT_TYPE_FLAGS && - (value[0] == '-' || value[0] == '+')) ? AV_DICT_APPEND : 0); - } + av_dict_set(options, key, value, AV_DICT_MULTIKEY); av_free(value); av_free(parsed_key); @@ -877,7 +856,12 @@ { int ret = 0; - ret = av_opt_set_dict(ctx, options); + if (ctx->internal->initialized) { + av_log(ctx, AV_LOG_ERROR, "Filter already initialized\n"); + return AVERROR(EINVAL); + } + + ret = av_opt_set_dict2(ctx, options, AV_OPT_SEARCH_CHILDREN); if (ret < 0) { av_log(ctx, AV_LOG_ERROR, "Error applying generic filter options.\n"); return ret; @@ -892,18 +876,8 @@ ctx->thread_type = 0; } - if (ctx->filter->priv_class) { - ret = av_opt_set_dict2(ctx->priv, options, AV_OPT_SEARCH_CHILDREN); - if (ret < 0) { - av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n"); - return ret; - } - } - if (ctx->filter->init) ret = ctx->filter->init(ctx); - else if (ctx->filter->init_dict) - ret = ctx->filter->init_dict(ctx, options); if (ret < 0) return ret; @@ -913,6 +887,8 @@ return ret; } + ctx->internal->initialized = 1; + return 0; } @@ -923,13 +899,7 @@ int ret = 0; if (args && *args) { - if (!filter->filter->priv_class) { - av_log(filter, AV_LOG_ERROR, "This filter does not take any " - "options, but options were provided: %s.\n", args); - return AVERROR(EINVAL); - } - - ret = process_options(filter, &options, args); + ret = ff_filter_opt_parse(filter, filter->filter->priv_class, &options, args); if (ret < 0) goto fail; } @@ -1484,7 +1454,7 @@ "Processing command time:%f command:%s arg:%s\n", cmd->time, cmd->command, cmd->arg); avfilter_process_command(link->dst, cmd->command, cmd->arg, 0, 0, cmd->flags); - ff_command_queue_pop(link->dst); + command_queue_pop(link->dst); cmd= link->dst->command_queue; } return 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfiltergraph.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfiltergraph.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfiltergraph.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfiltergraph.c 2023-03-03 13:29:59.000000000 +0000 @@ -729,12 +729,12 @@ /* reduce channel layouts */ for (i = 0; i < filter->nb_inputs; i++) { AVFilterLink *inlink = filter->inputs[i]; - AVChannelLayout fmt = { 0 }; + const AVChannelLayout *fmt; if (!inlink->outcfg.channel_layouts || inlink->outcfg.channel_layouts->nb_channel_layouts != 1) continue; - av_channel_layout_copy(&fmt, &inlink->outcfg.channel_layouts->channel_layouts[0]); + fmt = &inlink->outcfg.channel_layouts->channel_layouts[0]; for (j = 0; j < filter->nb_outputs; j++) { AVFilterLink *outlink = filter->outputs[j]; @@ -745,24 +745,25 @@ continue; if (fmts->all_layouts && - (KNOWN(&fmt) || fmts->all_counts)) { + (KNOWN(fmt) || fmts->all_counts)) { /* Turn the infinite list into a singleton */ fmts->all_layouts = fmts->all_counts = 0; - if (ff_add_channel_layout(&outlink->incfg.channel_layouts, &fmt) < 0) + if (ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt) < 0) ret = 1; break; } for (k = 0; k < outlink->incfg.channel_layouts->nb_channel_layouts; k++) { - if (!av_channel_layout_compare(&fmts->channel_layouts[k], &fmt)) { - av_channel_layout_copy(&fmts->channel_layouts[0], &fmt); + if (!av_channel_layout_compare(&fmts->channel_layouts[k], fmt)) { + ret = av_channel_layout_copy(&fmts->channel_layouts[0], fmt); + if (ret < 0) + return ret; fmts->nb_channel_layouts = 1; ret = 1; break; } } } - av_channel_layout_uninit(&fmt); } return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avfilter.h 2023-03-03 13:29:59.000000000 +0000 @@ -76,16 +76,6 @@ typedef struct AVFilterFormats AVFilterFormats; typedef struct AVFilterChannelLayouts AVFilterChannelLayouts; -#if FF_API_PAD_COUNT -/** - * Get the number of elements in an AVFilter's inputs or outputs array. - * - * @deprecated Use avfilter_filter_pad_count() instead. - */ -attribute_deprecated -int avfilter_pad_count(const AVFilterPad *pads); -#endif - /** * Get the name of an AVFilterPad. * @@ -277,19 +267,6 @@ int (*init)(AVFilterContext *ctx); /** - * Should be set instead of @ref AVFilter.init "init" by the filters that - * want to pass a dictionary of AVOptions to nested contexts that are - * allocated during init. - * - * On return, the options dict should be freed and replaced with one that - * contains all the options which could not be processed by this filter (or - * with NULL if all the options were processed). - * - * Otherwise the semantics is the same as for @ref AVFilter.init "init". - */ - int (*init_dict)(AVFilterContext *ctx, AVDictionary **options); - - /** * Filter uninitialization function. * * Called only once right before the filter is freed. Should deallocate any @@ -313,13 +290,20 @@ * and outputs are fixed), shortly before the format negotiation. This * callback may be called more than once. * - * This callback must set AVFilterLink.outcfg.formats on every input link - * and AVFilterLink.incfg.formats on every output link to a list of - * pixel/sample formats that the filter supports on that link. For audio - * links, this filter must also set @ref AVFilterLink.incfg.samplerates - * "in_samplerates" / @ref AVFilterLink.outcfg.samplerates "out_samplerates" - * and @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" / - * @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously. + * This callback must set ::AVFilterLink's + * @ref AVFilterFormatsConfig.formats "outcfg.formats" + * on every input link and + * @ref AVFilterFormatsConfig.formats "incfg.formats" + * on every output link to a list of pixel/sample formats that the filter + * supports on that link. + * For audio links, this filter must also set + * @ref AVFilterFormatsConfig.samplerates "incfg.samplerates" + * / + * @ref AVFilterFormatsConfig.samplerates "outcfg.samplerates" + * and @ref AVFilterFormatsConfig.channel_layouts "incfg.channel_layouts" + * / + * @ref AVFilterFormatsConfig.channel_layouts "outcfg.channel_layouts" + * analogously. * * This callback must never be NULL if the union is in this state. * @@ -1125,6 +1109,317 @@ AVFilterInOut **outputs); /** + * Parameters of a filter's input or output pad. + * + * Created as a child of AVFilterParams by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterPadParams { + /** + * An av_malloc()'ed string containing the pad label. + * + * May be av_free()'d and set to NULL by the caller, in which case this pad + * will be treated as unlabeled for linking. + * May also be replaced by another av_malloc()'ed string. + */ + char *label; +} AVFilterPadParams; + +/** + * Parameters describing a filter to be created in a filtergraph. + * + * Created as a child of AVFilterGraphSegment by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterParams { + /** + * The filter context. + * + * Created by avfilter_graph_segment_create_filters() based on + * AVFilterParams.filter_name and instance_name. + * + * Callers may also create the filter context manually, then they should + * av_free() filter_name and set it to NULL. Such AVFilterParams instances + * are then skipped by avfilter_graph_segment_create_filters(). + */ + AVFilterContext *filter; + + /** + * Name of the AVFilter to be used. + * + * An av_malloc()'ed string, set by avfilter_graph_segment_parse(). Will be + * passed to avfilter_get_by_name() by + * avfilter_graph_segment_create_filters(). + * + * Callers may av_free() this string and replace it with another one or + * NULL. If the caller creates the filter instance manually, this string + * MUST be set to NULL. + * + * When both AVFilterParams.filter an AVFilterParams.filter_name are NULL, + * this AVFilterParams instance is skipped by avfilter_graph_segment_*() + * functions. + */ + char *filter_name; + /** + * Name to be used for this filter instance. + * + * An av_malloc()'ed string, may be set by avfilter_graph_segment_parse() or + * left NULL. The caller may av_free() this string and replace with another + * one or NULL. + * + * Will be used by avfilter_graph_segment_create_filters() - passed as the + * third argument to avfilter_graph_alloc_filter(), then freed and set to + * NULL. + */ + char *instance_name; + + /** + * Options to be apllied to the filter. + * + * Filled by avfilter_graph_segment_parse(). Afterwards may be freely + * modified by the caller. + * + * Will be applied to the filter by avfilter_graph_segment_apply_opts() + * with an equivalent of av_opt_set_dict2(filter, &opts, AV_OPT_SEARCH_CHILDREN), + * i.e. any unapplied options will be left in this dictionary. + */ + AVDictionary *opts; + + AVFilterPadParams **inputs; + unsigned nb_inputs; + + AVFilterPadParams **outputs; + unsigned nb_outputs; +} AVFilterParams; + +/** + * A filterchain is a list of filter specifications. + * + * Created as a child of AVFilterGraphSegment by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterChain { + AVFilterParams **filters; + size_t nb_filters; +} AVFilterChain; + +/** + * A parsed representation of a filtergraph segment. + * + * A filtergraph segment is conceptually a list of filterchains, with some + * supplementary information (e.g. format conversion flags). + * + * Created by avfilter_graph_segment_parse(). Must be freed with + * avfilter_graph_segment_free(). + */ +typedef struct AVFilterGraphSegment { + /** + * The filtergraph this segment is associated with. + * Set by avfilter_graph_segment_parse(). + */ + AVFilterGraph *graph; + + /** + * A list of filter chain contained in this segment. + * Set in avfilter_graph_segment_parse(). + */ + AVFilterChain **chains; + size_t nb_chains; + + /** + * A string containing a colon-separated list of key=value options applied + * to all scale filters in this segment. + * + * May be set by avfilter_graph_segment_parse(). + * The caller may free this string with av_free() and replace it with a + * different av_malloc()'ed string. + */ + char *scale_sws_opts; +} AVFilterGraphSegment; + +/** + * Parse a textual filtergraph description into an intermediate form. + * + * This intermediate representation is intended to be modified by the caller as + * described in the documentation of AVFilterGraphSegment and its children, and + * then applied to the graph either manually or with other + * avfilter_graph_segment_*() functions. See the documentation for + * avfilter_graph_segment_apply() for the canonical way to apply + * AVFilterGraphSegment. + * + * @param graph Filter graph the parsed segment is associated with. Will only be + * used for logging and similar auxiliary purposes. The graph will + * not be actually modified by this function - the parsing results + * are instead stored in seg for further processing. + * @param graph_str a string describing the filtergraph segment + * @param flags reserved for future use, caller must set to 0 for now + * @param seg A pointer to the newly-created AVFilterGraphSegment is written + * here on success. The graph segment is owned by the caller and must + * be freed with avfilter_graph_segment_free() before graph itself is + * freed. + * + * @retval "non-negative number" success + * @retval "negative error code" failure + */ +int avfilter_graph_segment_parse(AVFilterGraph *graph, const char *graph_str, + int flags, AVFilterGraphSegment **seg); + +/** + * Create filters specified in a graph segment. + * + * Walk through the creation-pending AVFilterParams in the segment and create + * new filter instances for them. + * Creation-pending params are those where AVFilterParams.filter_name is + * non-NULL (and hence AVFilterParams.filter is NULL). All other AVFilterParams + * instances are ignored. + * + * For any filter created by this function, the corresponding + * AVFilterParams.filter is set to the newly-created filter context, + * AVFilterParams.filter_name and AVFilterParams.instance_name are freed and set + * to NULL. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all creation-pending filters were + * successfully created + * @retval AVERROR_FILTER_NOT_FOUND some filter's name did not correspond to a + * known filter + * @retval "another negative error code" other failures + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_create_filters(AVFilterGraphSegment *seg, int flags); + +/** + * Apply parsed options to filter instances in a graph segment. + * + * Walk through all filter instances in the graph segment that have option + * dictionaries associated with them and apply those options with + * av_opt_set_dict2(..., AV_OPT_SEARCH_CHILDREN). AVFilterParams.opts is + * replaced by the dictionary output by av_opt_set_dict2(), which should be + * empty (NULL) if all options were successfully applied. + * + * If any options could not be found, this function will continue processing all + * other filters and finally return AVERROR_OPTION_NOT_FOUND (unless another + * error happens). The calling program may then deal with unapplied options as + * it wishes. + * + * Any creation-pending filters (see avfilter_graph_segment_create_filters()) + * present in the segment will cause this function to fail. AVFilterParams with + * no associated filter context are simply skipped. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all options were successfully applied. + * @retval AVERROR_OPTION_NOT_FOUND some options were not found in a filter + * @retval "another negative error code" other failures + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_apply_opts(AVFilterGraphSegment *seg, int flags); + +/** + * Initialize all filter instances in a graph segment. + * + * Walk through all filter instances in the graph segment and call + * avfilter_init_dict(..., NULL) on those that have not been initialized yet. + * + * Any creation-pending filters (see avfilter_graph_segment_create_filters()) + * present in the segment will cause this function to fail. AVFilterParams with + * no associated filter context or whose filter context is already initialized, + * are simply skipped. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all filter instances were successfully + * initialized + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_init(AVFilterGraphSegment *seg, int flags); + +/** + * Link filters in a graph segment. + * + * Walk through all filter instances in the graph segment and try to link all + * unlinked input and output pads. Any creation-pending filters (see + * avfilter_graph_segment_create_filters()) present in the segment will cause + * this function to fail. Disabled filters and already linked pads are skipped. + * + * Every filter output pad that has a corresponding AVFilterPadParams with a + * non-NULL label is + * - linked to the input with the matching label, if one exists; + * - exported in the outputs linked list otherwise, with the label preserved. + * Unlabeled outputs are + * - linked to the first unlinked unlabeled input in the next non-disabled + * filter in the chain, if one exists + * - exported in the ouputs linked list otherwise, with NULL label + * + * Similarly, unlinked input pads are exported in the inputs linked list. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * @param[out] inputs a linked list of all free (unlinked) inputs of the + * filters in this graph segment will be returned here. It + * is to be freed by the caller using avfilter_inout_free(). + * @param[out] outputs a linked list of all free (unlinked) outputs of the + * filters in this graph segment will be returned here. It + * is to be freed by the caller using avfilter_inout_free(). + * + * @retval "non-negative number" success + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_link(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs); + +/** + * Apply all filter/link descriptions from a graph segment to the associated filtergraph. + * + * This functions is currently equivalent to calling the following in sequence: + * - avfilter_graph_segment_create_filters(); + * - avfilter_graph_segment_apply_opts(); + * - avfilter_graph_segment_init(); + * - avfilter_graph_segment_link(); + * failing if any of them fails. This list may be extended in the future. + * + * Since the above functions are idempotent, the caller may call some of them + * manually, then do some custom processing on the filtergraph, then call this + * function to do the rest. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * @param[out] inputs passed to avfilter_graph_segment_link() + * @param[out] outputs passed to avfilter_graph_segment_link() + * + * @retval "non-negative number" success + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_apply(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs); + +/** + * Free the provided AVFilterGraphSegment and everything associated with it. + * + * @param seg double pointer to the AVFilterGraphSegment to be freed. NULL will + * be written to this pointer on exit from this function. + * + * @note + * The filter contexts (AVFilterParams.filter) are owned by AVFilterGraph rather + * than AVFilterGraphSegment, so they are not freed. + */ +void avfilter_graph_segment_free(AVFilterGraphSegment **seg); + +/** * Send a command to one or more filter instances. * * @param graph the filter graph diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcqt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcqt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcqt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcqt.c 2023-03-03 13:29:59.000000000 +0000 @@ -1031,16 +1031,17 @@ int nb_planes = (fmt == AV_PIX_FMT_RGB24) ? 1 : 3; int offh = (fmt == AV_PIX_FMT_YUV420P) ? off / 2 : off; int inc = (fmt == AV_PIX_FMT_YUV420P) ? 2 : 1; - int ls, i, y, yh; + ptrdiff_t ls; + int i, y, yh; - ls = FFMIN(out->linesize[0], sono->linesize[0]); + ls = FFABS(FFMIN(out->linesize[0], sono->linesize[0])); for (y = 0; y < h; y++) { memcpy(out->data[0] + (off + y) * out->linesize[0], sono->data[0] + (idx + y) % h * sono->linesize[0], ls); } for (i = 1; i < nb_planes; i++) { - ls = FFMIN(out->linesize[i], sono->linesize[i]); + ls = FFABS(FFMIN(out->linesize[i], sono->linesize[i])); for (y = 0; y < h; y += inc) { yh = (fmt == AV_PIX_FMT_YUV420P) ? y / 2 : y; memcpy(out->data[i] + (offh + yh) * out->linesize[i], @@ -1148,8 +1149,7 @@ } } - s->tx_fn(s->fft_ctx, s->fft_result, s->fft_input, sizeof(float)); - s->fft_result[s->fft_len] = s->fft_result[0]; + s->tx_fn(s->fft_ctx, s->fft_result, s->fft_input, sizeof(AVComplexFloat)); UPDATE_TIME(s->fft_time); s->cqt_calc(s->cqt_result, s->fft_result, s->coeffs, s->cqt_len, s->fft_len); @@ -1187,6 +1187,7 @@ UPDATE_TIME(s->sono_time); } out->pts = s->next_pts; + out->duration = PTS_STEP; s->next_pts += PTS_STEP; } s->sono_count = (s->sono_count + 1) % s->count; @@ -1355,7 +1356,7 @@ AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; ShowCQTContext *s = ctx->priv; - float scale; + float scale = 1.f; int ret; common_uninit(s); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcwt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcwt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcwt.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showcwt.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1028 @@ +/* + * Copyright (c) 2022 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 +#include + +#include "libavutil/tx.h" +#include "libavutil/avassert.h" +#include "libavutil/avstring.h" +#include "libavutil/channel_layout.h" +#include "libavutil/cpu.h" +#include "libavutil/opt.h" +#include "libavutil/parseutils.h" +#include "audio.h" +#include "video.h" +#include "avfilter.h" +#include "filters.h" +#include "internal.h" + +enum FrequencyScale { + FSCALE_LINEAR, + FSCALE_LOG2, + FSCALE_BARK, + FSCALE_MEL, + FSCALE_ERBS, + NB_FSCALE +}; + +enum DirectionMode { + DIRECTION_LR, + DIRECTION_RL, + DIRECTION_UD, + DIRECTION_DU, + NB_DIRECTION +}; + +enum SlideMode { + SLIDE_REPLACE, + SLIDE_SCROLL, + SLIDE_FRAME, + NB_SLIDE +}; + +typedef struct ShowCWTContext { + const AVClass *class; + int w, h; + int mode; + char *rate_str; + AVRational auto_frame_rate; + AVRational frame_rate; + AVTXContext **fft; + AVTXContext **ifft; + av_tx_fn tx_fn; + av_tx_fn itx_fn; + int fft_in_size; + int fft_out_size; + int ifft_in_size; + int ifft_out_size; + int pos; + int64_t in_pts; + int64_t old_pts; + int64_t eof_pts; + float *frequency_band; + AVFrame *kernel; + unsigned *index; + int *kernel_start; + int *kernel_stop; + AVFrame *cache[2]; + AVFrame *outpicref; + AVFrame *fft_in; + AVFrame *fft_out; + AVFrame *ifft_in; + AVFrame *ifft_out; + AVFrame *ch_out; + int nb_threads; + int nb_channels; + int nb_consumed_samples; + int pps; + int eof; + int slide; + int new_frame; + int direction; + int hop_size; + int hop_index; + int ihop_size; + int ihop_index; + int input_padding_size; + int input_sample_count; + int output_padding_size; + int output_sample_count; + int frequency_band_count; + float logarithmic_basis; + int frequency_scale; + float minimum_frequency; + float maximum_frequency; + float deviation; +} ShowCWTContext; + +#define OFFSET(x) offsetof(ShowCWTContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption showcwt_options[] = { + { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "640x512"}, 0, 0, FLAGS }, + { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "640x512"}, 0, 0, FLAGS }, + { "rate", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, + { "r", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, + { "scale", "set frequency scale", OFFSET(frequency_scale), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_FSCALE-1, FLAGS, "scale" }, + { "linear", "linear", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_LINEAR}, 0, 0, FLAGS, "scale" }, + { "log2", "logarithmic", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_LOG2}, 0, 0, FLAGS, "scale" }, + { "bark", "bark", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_BARK}, 0, 0, FLAGS, "scale" }, + { "mel", "mel", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_MEL}, 0, 0, FLAGS, "scale" }, + { "erbs", "erbs", 0, AV_OPT_TYPE_CONST,{.i64=FSCALE_ERBS}, 0, 0, FLAGS, "scale" }, + { "min", "set minimum frequency", OFFSET(minimum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20.}, 1, 2000, FLAGS }, + { "max", "set maximum frequency", OFFSET(maximum_frequency), AV_OPT_TYPE_FLOAT, {.dbl = 20000.}, 0, 192000, FLAGS }, + { "logb", "set logarithmic basis", OFFSET(logarithmic_basis), AV_OPT_TYPE_FLOAT, {.dbl = 0.0001}, 0, 1, FLAGS }, + { "deviation", "set frequency deviation", OFFSET(deviation), AV_OPT_TYPE_FLOAT, {.dbl = 1.}, 0, 10, FLAGS }, + { "pps", "set pixels per second", OFFSET(pps), AV_OPT_TYPE_INT, {.i64 = 64}, 1, 1024, FLAGS }, + { "mode", "set output mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, FLAGS, "mode" }, + { "magnitude", "magnitude", 0, AV_OPT_TYPE_CONST,{.i64=0}, 0, 0, FLAGS, "mode" }, + { "phase", "phase", 0, AV_OPT_TYPE_CONST,{.i64=1}, 0, 0, FLAGS, "mode" }, + { "magphase", "magnitude+phase", 0, AV_OPT_TYPE_CONST,{.i64=2}, 0, 0, FLAGS, "mode" }, + { "channel", "color per channel", 0, AV_OPT_TYPE_CONST,{.i64=3}, 0, 0, FLAGS, "mode" }, + { "stereo", "stereo difference", 0, AV_OPT_TYPE_CONST,{.i64=4}, 0, 0, FLAGS, "mode" }, + { "slide", "set slide mode", OFFSET(slide), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_SLIDE-1, FLAGS, "slide" }, + { "replace", "replace", 0, AV_OPT_TYPE_CONST,{.i64=SLIDE_REPLACE},0, 0, FLAGS, "slide" }, + { "scroll", "scroll", 0, AV_OPT_TYPE_CONST,{.i64=SLIDE_SCROLL}, 0, 0, FLAGS, "slide" }, + { "frame", "frame", 0, AV_OPT_TYPE_CONST,{.i64=SLIDE_FRAME}, 0, 0, FLAGS, "slide" }, + { "direction", "set direction mode", OFFSET(direction), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_DIRECTION-1, FLAGS, "direction" }, + { "lr", "left to right", 0, AV_OPT_TYPE_CONST,{.i64=DIRECTION_LR}, 0, 0, FLAGS, "direction" }, + { "rl", "right to left", 0, AV_OPT_TYPE_CONST,{.i64=DIRECTION_RL}, 0, 0, FLAGS, "direction" }, + { "ud", "up to down", 0, AV_OPT_TYPE_CONST,{.i64=DIRECTION_UD}, 0, 0, FLAGS, "direction" }, + { "du", "down to up", 0, AV_OPT_TYPE_CONST,{.i64=DIRECTION_DU}, 0, 0, FLAGS, "direction" }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(showcwt); + +static av_cold void uninit(AVFilterContext *ctx) +{ + ShowCWTContext *s = ctx->priv; + + av_freep(&s->frequency_band); + av_freep(&s->kernel_start); + av_freep(&s->kernel_stop); + av_freep(&s->index); + + av_frame_free(&s->kernel); + av_frame_free(&s->cache[0]); + av_frame_free(&s->cache[1]); + av_frame_free(&s->outpicref); + av_frame_free(&s->fft_in); + av_frame_free(&s->fft_out); + av_frame_free(&s->ifft_in); + av_frame_free(&s->ifft_out); + av_frame_free(&s->ch_out); + + if (s->fft) { + for (int n = 0; n < s->nb_threads; n++) + av_tx_uninit(&s->fft[n]); + av_freep(&s->fft); + } + + if (s->ifft) { + for (int n = 0; n < s->nb_threads; n++) + av_tx_uninit(&s->ifft[n]); + av_freep(&s->ifft); + } +} + +static int query_formats(AVFilterContext *ctx) +{ + AVFilterFormats *formats = NULL; + AVFilterChannelLayouts *layouts = NULL; + AVFilterLink *inlink = ctx->inputs[0]; + AVFilterLink *outlink = ctx->outputs[0]; + static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; + int ret; + + formats = ff_make_format_list(sample_fmts); + if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) + return ret; + + layouts = ff_all_channel_counts(); + if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) + return ret; + + formats = ff_all_samplerates(); + if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) + return ret; + + formats = ff_make_format_list(pix_fmts); + if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + return ret; + + return 0; +} + +static void frequency_band(float *frequency_band, + int frequency_band_count, + float frequency_range, + float frequency_offset, + int frequency_scale, float deviation) +{ + deviation *= sqrtf(1.f / (4.f * M_PI)); // Heisenberg Gabor Limit + for (int y = 0; y < frequency_band_count; y++) { + float frequency = frequency_range * (1.f - (float)y / frequency_band_count) + frequency_offset; + float frequency_derivative = frequency_range / frequency_band_count; + + switch (frequency_scale) { + case FSCALE_LOG2: + frequency = powf(2.f, frequency); + frequency_derivative *= logf(2.f) * frequency; + break; + case FSCALE_BARK: + frequency = 600.f * sinhf(frequency / 6.f); + frequency_derivative *= sqrtf(frequency * frequency + 360000.f) / 6.f; + break; + case FSCALE_MEL: + frequency = 700.f * (powf(10.f, frequency / 2595.f) - 1.f); + frequency_derivative *= (frequency + 700.f) * logf(10.f) / 2595.f; + break; + case FSCALE_ERBS: + frequency = 676170.4f / (47.06538f - expf(frequency * 0.08950404f)) - 14678.49f; + frequency_derivative *= (frequency * frequency + 14990.4 * frequency + 4577850.f) / 160514.f; + break; + } + + frequency_band[y*2 ] = frequency; + frequency_band[y*2+1] = frequency_derivative * deviation; + } +} + +static float remap_log(float value, float log_factor) +{ + float sign = (0 < value) - (value < 0); + + value = logf(value * sign) * log_factor; + + return 1.f - av_clipf(value, 0.f, 1.f); +} + +static int run_channel_cwt_prepare(AVFilterContext *ctx, void *arg, int jobnr, int ch) +{ + ShowCWTContext *s = ctx->priv; + const int hop_size = s->hop_size; + AVFrame *fin = arg; + float *cache0 = (float *)s->cache[0]->extended_data[ch]; + float *cache = (float *)s->cache[1]->extended_data[ch]; + AVComplexFloat *src = (AVComplexFloat *)s->fft_in->extended_data[ch]; + AVComplexFloat *dst = (AVComplexFloat *)s->fft_out->extended_data[ch]; + + if (fin) { + const int offset = s->hop_index; + const float *input = (const float *)fin->extended_data[ch]; + + memcpy(&cache[offset], input, + fin->nb_samples * sizeof(float)); + } + + if (fin == NULL) { + memset(&cache[s->hop_index], 0, + (hop_size - s->hop_index) * sizeof(float)); + } else if (s->hop_index + fin->nb_samples < hop_size) { + return 0; + } + + for (int n = 0; n < hop_size; n++) { + src[n].re = cache0[n]; + src[n].im = 0.f; + src[n + hop_size].re = cache[n]; + src[n + hop_size].im = 0.f; + } + + s->tx_fn(s->fft[jobnr], dst, src, sizeof(*src)); + + return 0; +} + +static int draw(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + ShowCWTContext *s = ctx->priv; + const ptrdiff_t ylinesize = s->outpicref->linesize[0]; + const ptrdiff_t ulinesize = s->outpicref->linesize[1]; + const ptrdiff_t vlinesize = s->outpicref->linesize[2]; + const ptrdiff_t alinesize = s->outpicref->linesize[3]; + const float log_factor = 1.f/logf(s->logarithmic_basis); + const int count = s->frequency_band_count; + const int start = (count * jobnr) / nb_jobs; + const int end = (count * (jobnr+1)) / nb_jobs; + const int ihop_index = s->ihop_index; + const int ihop_size = s->ihop_size; + const int direction = s->direction; + uint8_t *dstY, *dstU, *dstV, *dstA; + const int mode = s->mode; + const int w_1 = s->w - 1; + const int x = s->pos; + float Y, U, V; + + for (int y = start; y < end; y++) { + const AVComplexFloat *src = ((const AVComplexFloat *)s->ch_out->extended_data[0]) + + y * ihop_size + ihop_index; + + switch (direction) { + case DIRECTION_LR: + case DIRECTION_RL: + dstY = s->outpicref->data[0] + y * ylinesize; + dstU = s->outpicref->data[1] + y * ulinesize; + dstV = s->outpicref->data[2] + y * vlinesize; + dstA = s->outpicref->data[3] ? s->outpicref->data[3] + y * alinesize : NULL; + break; + case DIRECTION_UD: + case DIRECTION_DU: + dstY = s->outpicref->data[0] + x * ylinesize + w_1 - y; + dstU = s->outpicref->data[1] + x * ulinesize + w_1 - y; + dstV = s->outpicref->data[2] + x * vlinesize + w_1 - y; + dstA = s->outpicref->data[3] ? s->outpicref->data[3] + x * alinesize + w_1 - y : NULL; + break; + } + + switch (s->slide) { + case SLIDE_REPLACE: + case SLIDE_FRAME: + /* nothing to do here */ + break; + case SLIDE_SCROLL: + switch (s->direction) { + case DIRECTION_RL: + memmove(dstY, dstY + 1, w_1); + memmove(dstU, dstU + 1, w_1); + memmove(dstV, dstV + 1, w_1); + if (dstA != NULL) + memmove(dstA, dstA + 1, w_1); + break; + case DIRECTION_LR: + memmove(dstY + 1, dstY, w_1); + memmove(dstU + 1, dstU, w_1); + memmove(dstV + 1, dstV, w_1); + if (dstA != NULL) + memmove(dstA + 1, dstA, w_1); + break; + } + break; + } + + if (direction == DIRECTION_RL || + direction == DIRECTION_LR) { + dstY += x; + dstU += x; + dstV += x; + if (dstA != NULL) + dstA += x; + } + + switch (mode) { + case 4: + { + const AVComplexFloat *src2 = ((const AVComplexFloat *)s->ch_out->extended_data[FFMIN(1, s->nb_channels - 1)]) + + y * ihop_size + ihop_index; + float z, u, v; + + z = hypotf(src[0].re + src2[0].re, src[0].im + src2[0].im); + u = hypotf(src[0].re, src[0].im); + v = hypotf(src2[0].re, src2[0].im); + + z = remap_log(z, log_factor); + u = remap_log(u, log_factor); + v = remap_log(v, log_factor); + + Y = z; + U = 0.5f + z * sinf((v - u) * M_PI_2); + V = 0.5f + z * sinf((u - v) * M_PI_2); + + dstY[0] = av_clip_uint8(lrintf(Y * 255.f)); + dstU[0] = av_clip_uint8(lrintf(U * 255.f)); + dstV[0] = av_clip_uint8(lrintf(V * 255.f)); + if (dstA) + dstA[0] = dstY[0]; + } + break; + case 3: + { + const int nb_channels = s->nb_channels; + const float yf = 1.f / nb_channels; + + Y = 0.f; + U = V = 0.5f; + for (int ch = 0; ch < nb_channels; ch++) { + const AVComplexFloat *src = ((const AVComplexFloat *)s->ch_out->extended_data[ch]) + + y * ihop_size + ihop_index; + float z; + + z = hypotf(src[0].re, src[0].im); + z = remap_log(z, log_factor); + + Y += z * yf; + U += z * yf * sinf(2.f * M_PI * ch * yf); + V += z * yf * cosf(2.f * M_PI * ch * yf); + } + + dstY[0] = av_clip_uint8(lrintf(Y * 255.f)); + dstU[0] = av_clip_uint8(lrintf(U * 255.f)); + dstV[0] = av_clip_uint8(lrintf(V * 255.f)); + if (dstA) + dstA[0] = dstY[0]; + } + break; + case 2: + Y = hypotf(src[0].re, src[0].im); + Y = remap_log(Y, log_factor); + U = atan2f(src[0].im, src[0].re); + U = 0.5f + 0.5f * U * Y / M_PI; + V = 1.f - U; + + dstY[0] = av_clip_uint8(lrintf(Y * 255.f)); + dstU[0] = av_clip_uint8(lrintf(U * 255.f)); + dstV[0] = av_clip_uint8(lrintf(V * 255.f)); + if (dstA) + dstA[0] = dstY[0]; + break; + case 1: + Y = atan2f(src[0].im, src[0].re); + Y = 0.5f + 0.5f * Y / M_PI; + + dstY[0] = av_clip_uint8(lrintf(Y * 255.f)); + if (dstA) + dstA[0] = dstY[0]; + break; + case 0: + Y = hypotf(src[0].re, src[0].im); + Y = remap_log(Y, log_factor); + + dstY[0] = av_clip_uint8(lrintf(Y * 255.f)); + if (dstA) + dstA[0] = dstY[0]; + break; + } + } + + return 0; +} + +static int run_channel_cwt(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + ShowCWTContext *s = ctx->priv; + const int ch = *(int *)arg; + AVComplexFloat *dst = (AVComplexFloat *)s->fft_out->extended_data[ch]; + const int output_sample_count = s->output_sample_count; + const int ihop_size = s->ihop_size; + const int ioffset = (s->output_padding_size - ihop_size) >> 1; + const int count = s->frequency_band_count; + const int start = (count * jobnr) / nb_jobs; + const int end = (count * (jobnr+1)) / nb_jobs; + + for (int y = start; y < end; y++) { + AVComplexFloat *isrc = (AVComplexFloat *)s->ifft_in->extended_data[y]; + AVComplexFloat *idst = (AVComplexFloat *)s->ifft_out->extended_data[y]; + AVComplexFloat *chout = ((AVComplexFloat *)s->ch_out->extended_data[ch]) + y * ihop_size; + const float *kernel = (const float *)s->kernel->extended_data[y]; + const unsigned *index = (const unsigned *)s->index; + const int kernel_start = s->kernel_start[y]; + const int kernel_stop = s->kernel_stop[y]; + + memset(isrc, 0, sizeof(*isrc) * output_sample_count); + for (int i = kernel_start; i < kernel_stop; i++) { + const unsigned n = index[i]; + const float ff = kernel[i]; + + isrc[n].re += ff * dst[i].re; + isrc[n].im += ff * dst[i].im; + } + + s->itx_fn(s->ifft[jobnr], idst, isrc, sizeof(*isrc)); + + memcpy(chout, idst + ioffset, sizeof(*chout) * ihop_size); + } + + return 0; +} + +static void compute_kernel(AVFilterContext *ctx) +{ + ShowCWTContext *s = ctx->priv; + const int size = s->input_sample_count; + const float scale_factor = 1.f/(float)size; + const int output_sample_count = s->output_sample_count; + const int fsize = s->frequency_band_count; + unsigned *index = s->index; + + for (int y = 0; y < fsize; y++) { + float *kernel = (float *)s->kernel->extended_data[y]; + int *kernel_start = s->kernel_start; + int *kernel_stop = s->kernel_stop; + float frequency = s->frequency_band[y*2]; + float deviation = 1.f / (s->frequency_band[y*2+1] * + output_sample_count); + + for (int n = 0; n < size; n++) { + float ff, f = fabsf(n-frequency); + + f = size - fabsf(f - size); + ff = expf(-f*f*deviation) * scale_factor; + kernel[n] = ff; + } + + for (int n = 0; n < size; n++) { + if (kernel[n] != 0.f) { + kernel_start[y] = n; + break; + } + } + + for (int n = 0; n < size; n++) { + if (kernel[size - n - 1] != 0.f) { + kernel_stop[y] = size - n; + break; + } + } + } + + for (int n = 0; n < size; n++) + index[n] = n % output_sample_count; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + AVFilterLink *inlink = ctx->inputs[0]; + ShowCWTContext *s = ctx->priv; + float maximum_frequency = fminf(s->maximum_frequency, inlink->sample_rate * 0.5f); + float minimum_frequency = s->minimum_frequency; + float scale = 1.f, factor; + int ret; + + uninit(ctx); + + switch (s->direction) { + case DIRECTION_LR: + case DIRECTION_RL: + s->frequency_band_count = s->h; + break; + case DIRECTION_UD: + case DIRECTION_DU: + s->frequency_band_count = s->w; + break; + } + + s->new_frame = 1; + s->nb_threads = FFMIN(s->frequency_band_count, ff_filter_get_nb_threads(ctx)); + s->nb_channels = inlink->ch_layout.nb_channels; + s->old_pts = AV_NOPTS_VALUE; + s->eof_pts = AV_NOPTS_VALUE; + s->nb_consumed_samples = 65536; + + s->input_sample_count = s->nb_consumed_samples; + s->hop_size = s->nb_consumed_samples >> 1; + s->input_padding_size = 65536; + s->output_padding_size = FFMAX(16, s->input_padding_size * s->pps / inlink->sample_rate); + + outlink->w = s->w; + outlink->h = s->h; + outlink->sample_aspect_ratio = (AVRational){1,1}; + + s->fft_in_size = FFALIGN(s->input_padding_size, av_cpu_max_align()); + s->fft_out_size = FFALIGN(s->input_padding_size, av_cpu_max_align()); + + s->output_sample_count = s->output_padding_size; + + s->ifft_in_size = FFALIGN(s->output_padding_size, av_cpu_max_align()); + s->ifft_out_size = FFALIGN(s->output_padding_size, av_cpu_max_align()); + s->ihop_size = s->output_padding_size >> 1; + + s->fft = av_calloc(s->nb_threads, sizeof(*s->fft)); + if (!s->fft) + return AVERROR(ENOMEM); + + for (int n = 0; n < s->nb_threads; n++) { + ret = av_tx_init(&s->fft[n], &s->tx_fn, AV_TX_FLOAT_FFT, 0, s->input_padding_size, &scale, 0); + if (ret < 0) + return ret; + } + + s->ifft = av_calloc(s->nb_threads, sizeof(*s->ifft)); + if (!s->ifft) + return AVERROR(ENOMEM); + + for (int n = 0; n < s->nb_threads; n++) { + ret = av_tx_init(&s->ifft[n], &s->itx_fn, AV_TX_FLOAT_FFT, 1, s->output_padding_size, &scale, 0); + if (ret < 0) + return ret; + } + + s->frequency_band = av_calloc(s->frequency_band_count, + sizeof(*s->frequency_band) * 2); + s->outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h); + s->fft_in = ff_get_audio_buffer(inlink, s->fft_in_size * 2); + s->fft_out = ff_get_audio_buffer(inlink, s->fft_out_size * 2); + s->cache[0] = ff_get_audio_buffer(inlink, s->hop_size); + s->cache[1] = ff_get_audio_buffer(inlink, s->hop_size); + s->ch_out = ff_get_audio_buffer(inlink, s->frequency_band_count * 2 * s->ihop_size); + s->ifft_in = av_frame_alloc(); + s->ifft_out = av_frame_alloc(); + s->kernel = av_frame_alloc(); + s->index = av_calloc(s->input_padding_size, sizeof(*s->index)); + s->kernel_start = av_calloc(s->frequency_band_count, sizeof(*s->kernel_start)); + s->kernel_stop = av_calloc(s->frequency_band_count, sizeof(*s->kernel_stop)); + if (!s->outpicref || !s->fft_in || !s->fft_out || + !s->ifft_in || !s->ifft_out || !s->kernel_start || !s->kernel_stop || + !s->frequency_band || !s->kernel || !s->cache[0] || !s->cache[1] || !s->index) + return AVERROR(ENOMEM); + + s->ifft_in->format = inlink->format; + s->ifft_in->nb_samples = s->ifft_in_size * 2; + s->ifft_in->ch_layout.nb_channels = s->frequency_band_count; + ret = av_frame_get_buffer(s->ifft_in, 0); + if (ret < 0) + return ret; + + s->ifft_out->format = inlink->format; + s->ifft_out->nb_samples = s->ifft_out_size * 2; + s->ifft_out->ch_layout.nb_channels = s->frequency_band_count; + ret = av_frame_get_buffer(s->ifft_out, 0); + if (ret < 0) + return ret; + + s->kernel->format = inlink->format; + s->kernel->nb_samples = s->input_padding_size; + s->kernel->ch_layout.nb_channels = s->frequency_band_count; + ret = av_frame_get_buffer(s->kernel, 0); + if (ret < 0) + return ret; + + s->outpicref->sample_aspect_ratio = (AVRational){1,1}; + + for (int y = 0; y < outlink->h; y++) { + memset(s->outpicref->data[0] + y * s->outpicref->linesize[0], 0, outlink->w); + memset(s->outpicref->data[1] + y * s->outpicref->linesize[1], 128, outlink->w); + memset(s->outpicref->data[2] + y * s->outpicref->linesize[2], 128, outlink->w); + if (s->outpicref->data[3]) + memset(s->outpicref->data[3] + y * s->outpicref->linesize[3], 0, outlink->w); + } + + s->outpicref->color_range = AVCOL_RANGE_JPEG; + + factor = s->nb_consumed_samples / (float)inlink->sample_rate; + minimum_frequency *= factor; + maximum_frequency *= factor; + + switch (s->frequency_scale) { + case FSCALE_LOG2: + minimum_frequency = logf(minimum_frequency) / logf(2.f); + maximum_frequency = logf(maximum_frequency) / logf(2.f); + break; + case FSCALE_BARK: + minimum_frequency = 6.f * asinhf(minimum_frequency / 600.f); + maximum_frequency = 6.f * asinhf(maximum_frequency / 600.f); + break; + case FSCALE_MEL: + minimum_frequency = 2595.f * log10f(1.f + minimum_frequency / 700.f); + maximum_frequency = 2595.f * log10f(1.f + maximum_frequency / 700.f); + break; + case FSCALE_ERBS: + minimum_frequency = 11.17268f * log(1.f + (46.06538f * minimum_frequency) / (minimum_frequency + 14678.49f)); + maximum_frequency = 11.17268f * log(1.f + (46.06538f * maximum_frequency) / (maximum_frequency + 14678.49f)); + break; + } + + frequency_band(s->frequency_band, + s->frequency_band_count, maximum_frequency - minimum_frequency, + minimum_frequency, s->frequency_scale, s->deviation); + + av_log(ctx, AV_LOG_DEBUG, "input_sample_count: %d\n", s->input_sample_count); + av_log(ctx, AV_LOG_DEBUG, "output_sample_count: %d\n", s->output_sample_count); + + switch (s->direction) { + case DIRECTION_LR: + s->pos = 0; + break; + case DIRECTION_RL: + s->pos = s->w - 1; + break; + case DIRECTION_UD: + s->pos = 0; + break; + case DIRECTION_DU: + s->pos = s->h - 1; + break; + } + + s->auto_frame_rate = av_make_q(inlink->sample_rate, s->hop_size); + if (strcmp(s->rate_str, "auto")) { + ret = av_parse_video_rate(&s->frame_rate, s->rate_str); + } else { + s->frame_rate = s->auto_frame_rate; + } + outlink->frame_rate = s->frame_rate; + outlink->time_base = av_inv_q(outlink->frame_rate); + + compute_kernel(ctx); + + return 0; +} + +static int output_frame(AVFilterContext *ctx) +{ + AVFilterLink *outlink = ctx->outputs[0]; + AVFilterLink *inlink = ctx->inputs[0]; + ShowCWTContext *s = ctx->priv; + const int nb_planes = 3 + (s->outpicref->data[3] != NULL); + int ret; + + switch (s->slide) { + case SLIDE_SCROLL: + switch (s->direction) { + case DIRECTION_UD: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + + for (int y = s->h - 1; y > 0; y--) { + uint8_t *dst = s->outpicref->data[p] + y * linesize; + + memmove(dst, dst - linesize, s->w); + } + } + break; + case DIRECTION_DU: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + + for (int y = 0; y < s->h - 1; y++) { + uint8_t *dst = s->outpicref->data[p] + y * linesize; + + memmove(dst, dst + linesize, s->w); + } + } + break; + } + break; + } + + ff_filter_execute(ctx, draw, NULL, NULL, s->nb_threads); + + switch (s->slide) { + case SLIDE_REPLACE: + case SLIDE_FRAME: + switch (s->direction) { + case DIRECTION_LR: + s->pos++; + if (s->pos >= s->w) { + s->pos = 0; + s->new_frame = 1; + } + break; + case DIRECTION_RL: + s->pos--; + if (s->pos < 0) { + s->pos = s->w - 1; + s->new_frame = 1; + } + break; + case DIRECTION_UD: + s->pos++; + if (s->pos >= s->h) { + s->pos = 0; + s->new_frame = 1; + } + break; + case DIRECTION_DU: + s->pos--; + if (s->pos < 0) { + s->pos = s->h - 1; + s->new_frame = 1; + } + break; + } + break; + case SLIDE_SCROLL: + switch (s->direction) { + case DIRECTION_UD: + case DIRECTION_LR: + s->pos = 0; + break; + case DIRECTION_RL: + s->pos = s->w - 1; + break; + case DIRECTION_DU: + s->pos = s->h - 1; + break; + } + break; + } + + if (s->slide == SLIDE_FRAME && s->eof) { + switch (s->direction) { + case DIRECTION_LR: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + const int size = s->w - s->pos; + const int fill = p > 0 && p < 3 ? 128 : 0; + const int x = s->pos; + + for (int y = 0; y < s->h; y++) { + uint8_t *dst = s->outpicref->data[p] + y * linesize + x; + + memset(dst, fill, size); + } + } + break; + case DIRECTION_RL: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + const int size = s->w - s->pos; + const int fill = p > 0 && p < 3 ? 128 : 0; + + for (int y = 0; y < s->h; y++) { + uint8_t *dst = s->outpicref->data[p] + y * linesize; + + memset(dst, fill, size); + } + } + break; + case DIRECTION_UD: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + const int fill = p > 0 && p < 3 ? 128 : 0; + + for (int y = s->pos; y < s->h; y++) { + uint8_t *dst = s->outpicref->data[p] + y * linesize; + + memset(dst, fill, s->w); + } + } + break; + case DIRECTION_DU: + for (int p = 0; p < nb_planes; p++) { + ptrdiff_t linesize = s->outpicref->linesize[p]; + const int fill = p > 0 && p < 3 ? 128 : 0; + + for (int y = s->h - s->pos; y >= 0; y--) { + uint8_t *dst = s->outpicref->data[p] + y * linesize; + + memset(dst, fill, s->w); + } + } + break; + } + } + + s->new_frame = s->slide == SLIDE_FRAME && (s->new_frame || s->eof); + + if (s->slide != SLIDE_FRAME || s->new_frame == 1) { + int64_t pts_offset = s->new_frame ? 0LL : av_rescale(s->ihop_index, s->hop_size, s->ihop_size); + + s->outpicref->pts = av_rescale_q(s->in_pts + pts_offset, inlink->time_base, outlink->time_base); + s->outpicref->duration = 1; + } + + s->ihop_index++; + if (s->ihop_index >= s->ihop_size) + s->ihop_index = 0; + + if (s->slide == SLIDE_FRAME && s->new_frame == 0) + return 1; + + if (s->old_pts < s->outpicref->pts) { + AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) + return AVERROR(ENOMEM); + ret = av_frame_copy_props(out, s->outpicref); + if (ret < 0) + goto fail; + ret = av_frame_copy(out, s->outpicref); + if (ret < 0) + goto fail; + s->old_pts = s->outpicref->pts; + s->new_frame = 0; + ret = ff_filter_frame(outlink, out); + if (ret <= 0) + return ret; +fail: + av_frame_free(&out); + return ret; + } + + return 1; +} + +static int run_channels_cwt_prepare(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + ShowCWTContext *s = ctx->priv; + const int count = s->nb_channels; + const int start = (count * jobnr) / nb_jobs; + const int end = (count * (jobnr+1)) / nb_jobs; + + for (int ch = start; ch < end; ch++) + run_channel_cwt_prepare(ctx, arg, jobnr, ch); + + return 0; +} + +static int activate(AVFilterContext *ctx) +{ + AVFilterLink *inlink = ctx->inputs[0]; + AVFilterLink *outlink = ctx->outputs[0]; + ShowCWTContext *s = ctx->priv; + int ret = 0, status; + int64_t pts; + + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + + if (s->outpicref) { + AVFrame *fin = NULL; + + if (s->ihop_index == 0) { + if (!s->eof) { + ret = ff_inlink_consume_samples(inlink, 1, s->hop_size - s->hop_index, &fin); + if (ret < 0) + return ret; + } + + if (ret > 0 || s->eof) { + ff_filter_execute(ctx, run_channels_cwt_prepare, fin, NULL, + FFMIN(s->nb_threads, s->nb_channels)); + if (fin) { + if ((s->hop_index == 0 && s->slide != SLIDE_FRAME) || s->new_frame) { + s->in_pts = fin->pts; + s->new_frame = 0; + } + s->hop_index += fin->nb_samples; + av_frame_free(&fin); + } else { + s->hop_index = s->hop_size; + } + } + } + + if (s->hop_index >= s->hop_size || s->ihop_index > 0) { + if (s->hop_index) { + FFSWAP(AVFrame *, s->cache[0], s->cache[1]); + s->hop_index = 0; + } + + for (int ch = 0; ch < s->nb_channels && s->ihop_index == 0; ch++) { + ff_filter_execute(ctx, run_channel_cwt, (void *)&ch, NULL, + s->nb_threads); + } + + ret = output_frame(ctx); + if (ret != 1) + return ret; + } + } + + if (s->eof && s->eof_pts != AV_NOPTS_VALUE && + (s->old_pts + 1 >= s->eof_pts || (s->slide == SLIDE_FRAME))) { + if (s->slide == SLIDE_FRAME) + ret = output_frame(ctx); + ff_outlink_set_status(outlink, AVERROR_EOF, s->eof_pts); + return ret; + } + + if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) { + if (status == AVERROR_EOF) { + s->eof = 1; + ff_filter_set_ready(ctx, 10); + s->eof_pts = av_rescale_q(pts, inlink->time_base, outlink->time_base); + return 0; + } + } + + if (ff_inlink_queued_samples(inlink) > 0 || s->ihop_index || + s->hop_index >= s->hop_size || s->eof) { + ff_filter_set_ready(ctx, 10); + return 0; + } + + if (ff_outlink_frame_wanted(outlink)) { + ff_inlink_request_frame(inlink); + return 0; + } + + return FFERROR_NOT_READY; +} + +static const AVFilterPad showcwt_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + }, +}; + +static const AVFilterPad showcwt_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +const AVFilter ff_avf_showcwt = { + .name = "showcwt", + .description = NULL_IF_CONFIG_SMALL("Convert input audio to a CWT (Continuous Wavelet Transform) spectrum video output."), + .uninit = uninit, + .priv_size = sizeof(ShowCWTContext), + FILTER_INPUTS(showcwt_inputs), + FILTER_OUTPUTS(showcwt_outputs), + FILTER_QUERY_FUNC(query_formats), + .activate = activate, + .priv_class = &showcwt_class, + .flags = AVFILTER_FLAG_SLICE_THREADS, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showfreqs.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showfreqs.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showfreqs.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showfreqs.c 2023-03-03 13:29:59.000000000 +0000 @@ -151,7 +151,7 @@ AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; ShowFreqsContext *s = ctx->priv; - float overlap, scale; + float overlap, scale = 1.f; int i, ret; s->old_pts = AV_NOPTS_VALUE; @@ -403,7 +403,7 @@ if (s->bypass[ch]) continue; - s->tx_fn(s->fft, s->fft_data[ch], s->fft_input[ch], sizeof(float)); + s->tx_fn(s->fft, s->fft_data[ch], s->fft_input[ch], sizeof(AVComplexFloat)); } s->pts = av_rescale_q(pts, inlink->time_base, outlink->time_base); @@ -469,6 +469,7 @@ av_free(colors); out->pts = s->pts; + out->duration = 1; out->sample_aspect_ratio = (AVRational){1,1}; return ff_filter_frame(outlink, out); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspatial.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspatial.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspatial.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspatial.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,7 +21,7 @@ #include #include -#include "libavcodec/avfft.h" +#include "libavutil/tx.h" #include "libavutil/audio_fifo.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" @@ -38,15 +38,14 @@ const AVClass *class; int w, h; AVRational frame_rate; - FFTContext *fft[2]; ///< Fast Fourier Transform context - FFTContext *ifft[2]; ///< Inverse Fast Fourier Transform context - int fft_bits; ///< number of bits (FFT window size = 1<priv; - int i; - for (i = 0; i < 2; i++) - av_fft_end(s->fft[i]); - for (i = 0; i < 2; i++) - av_fft_end(s->ifft[i]); - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) + av_tx_uninit(&s->fft[i]); + for (int i = 0; i < 2; i++) { av_freep(&s->fft_data[i]); + av_freep(&s->fft_tdata[i]); + } av_freep(&s->window_func_lut); av_audio_fifo_free(s->fifo); } @@ -118,12 +117,11 @@ const float *p = (float *)fin->extended_data[ch]; for (int n = 0; n < fin->nb_samples; n++) { - s->fft_data[ch][n].re = p[n] * window_func_lut[n]; - s->fft_data[ch][n].im = 0; + s->fft_tdata[ch][n].re = p[n] * window_func_lut[n]; + s->fft_tdata[ch][n].im = 0.f; } - av_fft_permute(s->fft[ch], s->fft_data[ch]); - av_fft_calc(s->fft[ch], s->fft_data[ch]); + s->tx_fn[ch](s->fft[ch], s->fft_data[ch], s->fft_tdata[ch], sizeof(AVComplexFloat)); return 0; } @@ -133,38 +131,41 @@ AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; ShowSpatialContext *s = ctx->priv; - int i, fft_bits; float overlap; + int ret; outlink->w = s->w; outlink->h = s->h; outlink->sample_aspect_ratio = (AVRational){1,1}; - s->buf_size = 1 << av_log2(s->win_size); - s->win_size = s->buf_size; - fft_bits = av_log2(s->win_size); + outlink->frame_rate = s->frame_rate; + outlink->time_base = av_inv_q(outlink->frame_rate); /* (re-)configuration if the video output changed (or first init) */ - if (fft_bits != s->fft_bits) { - s->fft_bits = fft_bits; + if (s->win_size != s->buf_size) { + s->buf_size = s->win_size; /* FFT buffers: x2 for each channel buffer. * Note: we use free and malloc instead of a realloc-like function to * make sure the buffer is aligned in memory for the FFT functions. */ - for (i = 0; i < 2; i++) { - av_fft_end(s->fft[i]); + for (int i = 0; i < 2; i++) { + av_tx_uninit(&s->fft[i]); av_freep(&s->fft_data[i]); + av_freep(&s->fft_tdata[i]); } - for (i = 0; i < 2; i++) { - s->fft[i] = av_fft_init(fft_bits, 0); - if (!s->fft[i]) { - av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. " - "The window size might be too high.\n"); - return AVERROR(EINVAL); - } + for (int i = 0; i < 2; i++) { + float scale = 1.f; + ret = av_tx_init(&s->fft[i], &s->tx_fn[i], AV_TX_FLOAT_FFT, + 0, s->win_size, &scale, 0); + if (ret < 0) + return ret; } - for (i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) { + s->fft_tdata[i] = av_calloc(s->buf_size, sizeof(**s->fft_tdata)); + if (!s->fft_tdata[i]) + return AVERROR(ENOMEM); + s->fft_data[i] = av_calloc(s->buf_size, sizeof(**s->fft_data)); if (!s->fft_data[i]) return AVERROR(ENOMEM); @@ -177,18 +178,10 @@ if (!s->window_func_lut) return AVERROR(ENOMEM); generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap); - if (s->overlap == 1) - s->overlap = overlap; - s->hop_size = (1.f - s->overlap) * s->win_size; - if (s->hop_size < 1) { - av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap); - return AVERROR(EINVAL); - } + s->hop_size = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num)); } - outlink->time_base = av_inv_q(outlink->frame_rate); - av_audio_fifo_free(s->fifo); s->fifo = av_audio_fifo_alloc(inlink->format, inlink->ch_layout.nb_channels, s->win_size); if (!s->fifo) @@ -217,6 +210,7 @@ int h = s->h - 2; int w = s->w - 2; int z = s->win_size / 2; + int64_t pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!outpicref) @@ -252,7 +246,8 @@ draw_dot(outpicref->data[2] + outpicref->linesize[2] * y + x, outpicref->linesize[2], cr); } - outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); + outpicref->pts = pts; + outpicref->duration = 1; return ff_filter_frame(outlink, outpicref); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspectrum.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspectrum.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspectrum.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showspectrum.c 2023-03-03 13:29:59.000000000 +0000 @@ -454,10 +454,10 @@ } memcpy(f, h, s->buf_size * sizeof(*f)); - s->tx_fn(s->fft[ch], h, f, sizeof(float)); + s->tx_fn(s->fft[ch], h, f, sizeof(AVComplexFloat)); memcpy(f, g, s->buf_size * sizeof(*f)); - s->tx_fn(s->fft[ch], g, f, sizeof(float)); + s->tx_fn(s->fft[ch], g, f, sizeof(AVComplexFloat)); for (int n = 0; n < L; n++) { c = g[n].re; @@ -470,7 +470,7 @@ } memcpy(f, g, s->buf_size * sizeof(*f)); - s->itx_fn(s->ifft[ch], g, f, sizeof(float)); + s->itx_fn(s->ifft[ch], g, f, sizeof(AVComplexFloat)); for (int k = 0; k < M; k++) { psi = k * k / 2.f * phi; @@ -488,7 +488,7 @@ } /* run FFT on each samples set */ - s->tx_fn(s->fft[ch], s->fft_data[ch], s->fft_in[ch], sizeof(float)); + s->tx_fn(s->fft[ch], s->fft_data[ch], s->fft_in[ch], sizeof(AVComplexFloat)); } return 0; @@ -1146,7 +1146,7 @@ s->nb_display_channels = inlink->ch_layout.nb_channels; for (i = 0; i < s->nb_display_channels; i++) { - float scale; + float scale = 1.f; ret = av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, 0, fft_size << (!!s->stop), &scale, 0); if (s->stop) { @@ -1441,7 +1441,10 @@ } } - av_frame_make_writable(s->outpicref); + ret = ff_inlink_make_frame_writable(outlink, &s->outpicref); + if (ret < 0) + return ret; + outpicref = s->outpicref; /* copy to output */ if (s->orientation == VERTICAL) { if (s->sliding == SCROLL) { @@ -1537,7 +1540,9 @@ } if (!s->single_pic && (s->sliding != FULLFRAME || s->xpos == 0)) { - if (s->old_pts < outpicref->pts || s->sliding == FULLFRAME) { + if (s->old_pts < outpicref->pts || s->sliding == FULLFRAME || + (ff_outlink_get_status(inlink) == AVERROR_EOF && + ff_inlink_queued_samples(inlink) <= s->hop_size)) { AVFrame *clone; if (s->legend) { @@ -1768,6 +1773,7 @@ spf = s->win_size * (s->samples / ((s->win_size * sz) * ceil(s->samples / (float)(s->win_size * sz)))); spf = FFMAX(1, spf); + s->hop_size = spf; spb = (s->samples / (spf * sz)) * spf; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showvolume.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showvolume.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showvolume.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/avf_showvolume.c 2023-03-03 13:29:59.000000000 +0000 @@ -56,7 +56,6 @@ double *values; uint32_t *color_lut; float *max; - float rms_factor; int display_scale; double draw_persistent_duration; /* in second */ @@ -65,7 +64,7 @@ float *max_persistent; /* max value for draw_persistent_max for each channel */ int *nb_frames_max_display; /* number of frame for each channel, for displaying the max value */ - void (*meter)(float *src, int nb_samples, float *max, float factor); + void (*meter)(float *src, int nb_samples, float *max); } ShowVolumeContext; #define OFFSET(x) offsetof(ShowVolumeContext, x) @@ -143,21 +142,23 @@ return 0; } -static void find_peak(float *src, int nb_samples, float *peak, float factor) +static void find_peak(float *src, int nb_samples, float *peak) { - int i; + float max = 0.f; - *peak = 0; - for (i = 0; i < nb_samples; i++) - *peak = FFMAX(*peak, FFABS(src[i])); + max = 0; + for (int i = 0; i < nb_samples; i++) + max = fmaxf(max, fabsf(src[i])); + *peak = max; } -static void find_rms(float *src, int nb_samples, float *rms, float factor) +static void find_rms(float *src, int nb_samples, float *rms) { - int i; + float sum = 0.f; - for (i = 0; i < nb_samples; i++) - *rms += factor * (src[i] * src[i] - *rms); + for (int i = 0; i < nb_samples; i++) + sum += src[i] * src[i]; + *rms = sqrtf(sum / nb_samples); } static int config_input(AVFilterLink *inlink) @@ -178,8 +179,6 @@ if (!s->max) return AVERROR(ENOMEM); - s->rms_factor = 10000. / inlink->sample_rate; - switch (s->mode) { case 0: s->meter = find_peak; break; case 1: s->meter = find_rms; break; @@ -325,7 +324,7 @@ AVFilterLink *outlink = ctx->outputs[0]; ShowVolumeContext *s = ctx->priv; const int step = s->step; - int c, j, k, max_draw; + int c, j, k, max_draw, ret; char channel_name[64]; AVFrame *out; @@ -340,6 +339,7 @@ clear_picture(s, outlink); } s->out->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); + s->out->duration = 1; if ((s->f < 1.) && (s->f > 0.)) { for (j = 0; j < outlink->h; j++) { @@ -363,7 +363,7 @@ uint32_t *lut = s->color_lut + s->w * c; float max; - s->meter(src, insamples->nb_samples, &s->max[c], s->rms_factor); + s->meter(src, insamples->nb_samples, &s->max[c]); max = s->max[c]; s->values[c * VAR_VARS_NB + VAR_VOLUME] = 20.0 * log10(max); @@ -398,7 +398,7 @@ uint32_t *lut = s->color_lut + s->w * c; float max; - s->meter(src, insamples->nb_samples, &s->max[c], s->rms_factor); + s->meter(src, insamples->nb_samples, &s->max[c]); max = s->max[c]; s->values[c * VAR_VARS_NB + VAR_VOLUME] = 20.0 * log10(max); @@ -434,7 +434,11 @@ out = av_frame_clone(s->out); if (!out) return AVERROR(ENOMEM); - av_frame_make_writable(out); + ret = ff_inlink_make_frame_writable(outlink, &out); + if (ret < 0) { + av_frame_free(&out); + return ret; + } /* draw volume level */ for (c = 0; c < inlink->ch_layout.nb_channels && s->h >= 8 && s->draw_volume; c++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.c 2023-03-03 13:29:59.000000000 +0000 @@ -154,28 +154,6 @@ return get_frame_internal(ctx, frame, 0, nb_samples); } -#if FF_API_BUFFERSINK_ALLOC -AVBufferSinkParams *av_buffersink_params_alloc(void) -{ - static const int pixel_fmts[] = { AV_PIX_FMT_NONE }; - AVBufferSinkParams *params = av_malloc(sizeof(AVBufferSinkParams)); - if (!params) - return NULL; - - params->pixel_fmts = pixel_fmts; - return params; -} - -AVABufferSinkParams *av_abuffersink_params_alloc(void) -{ - AVABufferSinkParams *params = av_mallocz(sizeof(AVABufferSinkParams)); - - if (!params) - return NULL; - return params; -} -#endif - static av_cold int common_init(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersink.h 2023-03-03 13:29:59.000000000 +0000 @@ -94,42 +94,6 @@ */ #define AV_BUFFERSINK_FLAG_NO_REQUEST 2 -#if FF_API_BUFFERSINK_ALLOC -/** - * Deprecated and unused struct to use for initializing a buffersink context. - */ -typedef struct AVBufferSinkParams { - const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE -} AVBufferSinkParams; - -/** - * Create an AVBufferSinkParams structure. - * - * Must be freed with av_free(). - */ -attribute_deprecated -AVBufferSinkParams *av_buffersink_params_alloc(void); - -/** - * Deprecated and unused struct to use for initializing an abuffersink context. - */ -typedef struct AVABufferSinkParams { - const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE - const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1 - const int *channel_counts; ///< list of allowed channel counts, terminated by -1 - int all_channel_counts; ///< if not 0, accept any channel count or layout - int *sample_rates; ///< list of allowed sample rates, terminated by -1 -} AVABufferSinkParams; - -/** - * Create an AVABufferSinkParams structure. - * - * Must be freed with av_free(). - */ -attribute_deprecated -AVABufferSinkParams *av_abuffersink_params_alloc(void); -#endif - /** * Set the frame size for an audio buffer sink. * diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersrc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/buffersrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -50,9 +50,6 @@ int w, h; enum AVPixelFormat pix_fmt; AVRational pixel_aspect; -#if FF_API_SWS_PARAM_OPTION - char *sws_param; -#endif AVBufferRef *hw_frames_ctx; @@ -243,6 +240,13 @@ } } +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (copy->pkt_duration && copy->pkt_duration != copy->duration) + copy->duration = copy->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + ret = ff_filter_frame(ctx->outputs[0], copy); if (ret < 0) return ret; @@ -280,11 +284,6 @@ c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den, c->pixel_aspect.num, c->pixel_aspect.den); -#if FF_API_SWS_PARAM_OPTION - if (c->sws_param) - av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n"); -#endif - return 0; } @@ -306,9 +305,6 @@ { "pixel_aspect", "sample aspect ratio", OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, -#if FF_API_SWS_PARAM_OPTION - { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = V }, -#endif { NULL }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/convolution.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/convolution.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/convolution.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/convolution.h 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #ifndef AVFILTER_CONVOLUTION_H #define AVFILTER_CONVOLUTION_H #include "avfilter.h" +#include "libavutil/intreadwrite.h" enum MatrixMode { MATRIX_SQUARE, @@ -61,4 +62,77 @@ } ConvolutionContext; void ff_convolution_init_x86(ConvolutionContext *s); +void ff_sobel_init_x86(ConvolutionContext *s, int depth, int nb_planes); + +static void setup_3x3(int radius, const uint8_t *c[], const uint8_t *src, int stride, + int x, int w, int y, int h, int bpc) +{ + int i; + + for (i = 0; i < 9; i++) { + int xoff = FFABS(x + ((i % 3) - 1)); + int yoff = FFABS(y + (i / 3) - 1); + + xoff = xoff >= w ? 2 * w - 1 - xoff : xoff; + yoff = yoff >= h ? 2 * h - 1 - yoff : yoff; + + c[i] = src + xoff * bpc + yoff * stride; + } +} + +static void filter_sobel(uint8_t *dst, int width, + float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size) +{ + const uint8_t *c0 = c[0], *c1 = c[1], *c2 = c[2]; + const uint8_t *c3 = c[3], *c5 = c[5]; + const uint8_t *c6 = c[6], *c7 = c[7], *c8 = c[8]; + int x; + + for (x = 0; x < width; x++) { + float suma = c0[x] * -1 + c1[x] * -2 + c2[x] * -1 + + c6[x] * 1 + c7[x] * 2 + c8[x] * 1; + float sumb = c0[x] * -1 + c2[x] * 1 + c3[x] * -2 + + c5[x] * 2 + c6[x] * -1 + c8[x] * 1; + + dst[x] = av_clip_uint8(sqrtf(suma*suma + sumb*sumb) * scale + delta); + } +} + +static void filter16_sobel(uint8_t *dstp, int width, + float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size) +{ + uint16_t *dst = (uint16_t *)dstp; + int x; + + for (x = 0; x < width; x++) { + float suma = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[1][2 * x]) * -2 + AV_RN16A(&c[2][2 * x]) * -1 + + AV_RN16A(&c[6][2 * x]) * 1 + AV_RN16A(&c[7][2 * x]) * 2 + AV_RN16A(&c[8][2 * x]) * 1; + float sumb = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[2][2 * x]) * 1 + AV_RN16A(&c[3][2 * x]) * -2 + + AV_RN16A(&c[5][2 * x]) * 2 + AV_RN16A(&c[6][2 * x]) * -1 + AV_RN16A(&c[8][2 * x]) * 1; + + dst[x] = av_clip(sqrtf(suma*suma + sumb*sumb) * scale + delta, 0, peak); + } +} + +static av_unused void ff_sobel_init(ConvolutionContext *s, int depth, int nb_planes) +{ + for (int i = 0; i < 4; i++) { + s->filter[i] = filter_sobel; + s->copy[i] = !((1 << i) & s->planes); + s->size[i] = 3; + s->setup[i] = setup_3x3; + s->rdiv[i] = s->scale; + s->bias[i] = s->delta; + } + if (s->depth > 8) + for (int i = 0; i < 4; i++) + s->filter[i] = filter16_sobel; +#if ARCH_X86_64 + ff_sobel_init_x86(s, depth, nb_planes); +#endif +} #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/dnn/dnn_backend_openvino.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/dnn/dnn_backend_openvino.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/dnn/dnn_backend_openvino.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/dnn/dnn_backend_openvino.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,6 +58,8 @@ SafeQueue *request_queue; // holds OVRequestItem Queue *task_queue; // holds TaskItem Queue *lltask_queue; // holds LastLevelTaskItem + const char *all_input_names; + const char *all_output_names; } OVModel; // one request for one call to openvino @@ -211,19 +213,9 @@ status = ie_infer_request_get_blob(request->infer_request, task->output_names[0], &output_blob); if (status != OK) { - //incorrect output name - char *model_output_name = NULL; - char *all_output_names = NULL; - size_t model_output_count = 0; - av_log(ctx, AV_LOG_ERROR, "Failed to get model output data\n"); - status = ie_network_get_outputs_number(ov_model->network, &model_output_count); - for (size_t i = 0; i < model_output_count; i++) { - status = ie_network_get_output_name(ov_model->network, i, &model_output_name); - APPEND_STRING(all_output_names, model_output_name) - } av_log(ctx, AV_LOG_ERROR, "output \"%s\" may not correct, all output(s) are: \"%s\"\n", - task->output_names[0], all_output_names); + task->output_names[0], ov_model->all_output_names); return; } @@ -252,7 +244,6 @@ av_assert0(request->lltask_count >= 1); for (int i = 0; i < request->lltask_count; ++i) { task = request->lltasks[i]->task; - task->inference_done++; switch (ov_model->model->func_type) { case DFT_PROCESS_FRAME: @@ -286,6 +277,7 @@ break; } + task->inference_done++; av_freep(&request->lltasks[i]); output.data = (uint8_t *)output.data + output.width * output.height * output.channels * get_datatype_size(output.dt); @@ -336,13 +328,23 @@ // while we pass NHWC data from FFmpeg to openvino status = ie_network_set_input_layout(ov_model->network, input_name, NHWC); if (status != OK) { - av_log(ctx, AV_LOG_ERROR, "Failed to set layout as NHWC for input %s\n", input_name); + if (status == NOT_FOUND) { + av_log(ctx, AV_LOG_ERROR, "Could not find \"%s\" in model, failed to set input layout as NHWC, "\ + "all input(s) are: \"%s\"\n", input_name, ov_model->all_input_names); + } else{ + av_log(ctx, AV_LOG_ERROR, "Failed to set layout as NHWC for input %s\n", input_name); + } ret = DNN_GENERIC_ERROR; goto err; } status = ie_network_set_output_layout(ov_model->network, output_name, NHWC); if (status != OK) { - av_log(ctx, AV_LOG_ERROR, "Failed to set layout as NHWC for output %s\n", output_name); + if (status == NOT_FOUND) { + av_log(ctx, AV_LOG_ERROR, "Could not find \"%s\" in model, failed to set output layout as NHWC, "\ + "all output(s) are: \"%s\"\n", input_name, ov_model->all_output_names); + } else{ + av_log(ctx, AV_LOG_ERROR, "Failed to set layout as NHWC for output %s\n", output_name); + } ret = DNN_GENERIC_ERROR; goto err; } @@ -505,7 +507,6 @@ OVModel *ov_model = model; OVContext *ctx = &ov_model->ctx; char *model_input_name = NULL; - char *all_input_names = NULL; IEStatusCode status; size_t model_input_count = 0; dimensions_t dims; @@ -538,15 +539,12 @@ input->width = input_resizable ? -1 : dims.dims[3]; input->dt = precision_to_datatype(precision); return 0; - } else { - //incorrect input name - APPEND_STRING(all_input_names, model_input_name) } ie_network_name_free(&model_input_name); } - av_log(ctx, AV_LOG_ERROR, "Could not find \"%s\" in model, all input(s) are: \"%s\"\n", input_name, all_input_names); + av_log(ctx, AV_LOG_ERROR, "Could not find \"%s\" in model, all input(s) are: \"%s\"\n", input_name, ov_model->all_input_names); return AVERROR(EINVAL); } @@ -729,6 +727,8 @@ OVModel *ov_model = NULL; OVContext *ctx = NULL; IEStatusCode status; + size_t node_count = 0; + char *node_name = NULL; model = av_mallocz(sizeof(DNNModel)); if (!model){ @@ -744,6 +744,8 @@ ov_model->model = model; ov_model->ctx.class = &dnn_openvino_class; ctx = &ov_model->ctx; + ov_model->all_input_names = NULL; + ov_model->all_output_names = NULL; //parse options av_opt_set_defaults(ctx); @@ -767,6 +769,34 @@ goto err; } + //get all the input and output names + status = ie_network_get_inputs_number(ov_model->network, &node_count); + if (status != OK) { + av_log(ctx, AV_LOG_ERROR, "Failed to get input count\n"); + goto err; + } + for (size_t i = 0; i < node_count; i++) { + status = ie_network_get_input_name(ov_model->network, i, &node_name); + if (status != OK) { + av_log(ctx, AV_LOG_ERROR, "Failed to get No.%d input's name\n", (int)i); + goto err; + } + APPEND_STRING(ov_model->all_input_names, node_name) + } + status = ie_network_get_outputs_number(ov_model->network, &node_count); + if (status != OK) { + av_log(ctx, AV_LOG_ERROR, "Failed to get output count\n"); + goto err; + } + for (size_t i = 0; i < node_count; i++) { + status = ie_network_get_output_name(ov_model->network, i, &node_name); + if (status != OK) { + av_log(ctx, AV_LOG_ERROR, "Failed to get No.%d output's name\n", (int)i); + goto err; + } + APPEND_STRING(ov_model->all_output_names, node_name) + } + model->get_input = &get_input_ov; model->get_output = &get_output_ov; model->options = options; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/drawutils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/drawutils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/drawutils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/drawutils.c 2023-03-03 13:29:59.000000000 +0000 @@ -128,9 +128,6 @@ if (pixelstep[c->plane] != 0 && pixelstep[c->plane] != c->step) return AVERROR(ENOSYS); - if (pixelstep[c->plane] == 6 && - c->depth == 16) - return AVERROR(ENOSYS); pixelstep[c->plane] = c->step; if (pixelstep[c->plane] >= 8) return AVERROR(ENOSYS); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,33 +46,13 @@ return DIRECTION_VERTICAL; } -// Simple sobel operator to get rounded gradients -void ff_sobel(int w, int h, - uint16_t *dst, int dst_linesize, - int8_t *dir, int dir_linesize, - const uint8_t *src, int src_linesize) -{ - int i, j; - - for (j = 1; j < h - 1; j++) { - dst += dst_linesize; - dir += dir_linesize; - src += src_linesize; - for (i = 1; i < w - 1; i++) { - const int gx = - -1*src[-src_linesize + i-1] + 1*src[-src_linesize + i+1] - -2*src[ i-1] + 2*src[ i+1] - -1*src[ src_linesize + i-1] + 1*src[ src_linesize + i+1]; - const int gy = - -1*src[-src_linesize + i-1] + 1*src[ src_linesize + i-1] - -2*src[-src_linesize + i ] + 2*src[ src_linesize + i ] - -1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1]; - - dst[i] = FFABS(gx) + FFABS(gy); - dir[i] = get_rounded_direction(gx, gy); - } - } -} +#undef DEPTH +#define DEPTH 8 +#include "edge_template.c" + +#undef DEPTH +#define DEPTH 16 +#include "edge_template.c" // Filters rounded gradients to drop all non-maxima // Expects gradients generated by ff_sobel() @@ -137,45 +117,3 @@ src += src_linesize; } } - -// Applies gaussian blur, using 5x5 kernels, sigma = 1.4 -void ff_gaussian_blur(int w, int h, - uint8_t *dst, int dst_linesize, - const uint8_t *src, int src_linesize) -{ - int i, j; - - memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; - memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; - for (j = 2; j < h - 2; j++) { - dst[0] = src[0]; - dst[1] = src[1]; - for (i = 2; i < w - 2; i++) { - /* Gaussian mask of size 5x5 with sigma = 1.4 */ - dst[i] = ((src[-2*src_linesize + i-2] + src[2*src_linesize + i-2]) * 2 - + (src[-2*src_linesize + i-1] + src[2*src_linesize + i-1]) * 4 - + (src[-2*src_linesize + i ] + src[2*src_linesize + i ]) * 5 - + (src[-2*src_linesize + i+1] + src[2*src_linesize + i+1]) * 4 - + (src[-2*src_linesize + i+2] + src[2*src_linesize + i+2]) * 2 - - + (src[ -src_linesize + i-2] + src[ src_linesize + i-2]) * 4 - + (src[ -src_linesize + i-1] + src[ src_linesize + i-1]) * 9 - + (src[ -src_linesize + i ] + src[ src_linesize + i ]) * 12 - + (src[ -src_linesize + i+1] + src[ src_linesize + i+1]) * 9 - + (src[ -src_linesize + i+2] + src[ src_linesize + i+2]) * 4 - - + src[i-2] * 5 - + src[i-1] * 12 - + src[i ] * 15 - + src[i+1] * 12 - + src[i+2] * 5) / 159; - } - dst[i ] = src[i ]; - dst[i + 1] = src[i + 1]; - - dst += dst_linesize; - src += src_linesize; - } - memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; - memcpy(dst, src, w); -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_common.h 2023-03-03 13:29:59.000000000 +0000 @@ -48,10 +48,14 @@ * @param src data pointers to source image * @param src_linesize linesizes for the source image */ -void ff_sobel(int w, int h, - uint16_t *dst, int dst_linesize, - int8_t *dir, int dir_linesize, - const uint8_t *src, int src_linesize); +#define PROTO_SOBEL(depth) \ +void ff_sobel_##depth(int w, int h, \ + uint16_t *dst, int dst_linesize, \ + int8_t *dir, int dir_linesize, \ + const uint8_t *src, int src_linesize, int src_stride); + +PROTO_SOBEL(8) +PROTO_SOBEL(16) /** * Filters rounded gradients to drop all non-maxima pixels in the magnitude image @@ -100,8 +104,12 @@ * @param src data pointers to source image * @param src_linesize linesizes for the source image */ -void ff_gaussian_blur(int w, int h, - uint8_t *dst, int dst_linesize, - const uint8_t *src, int src_linesize); +#define PROTO_GAUSSIAN_BLUR(depth) \ +void ff_gaussian_blur_##depth(int w, int h, \ + uint8_t *dst, int dst_linesize, \ + const uint8_t *src, int src_linesize, int src_stride); + +PROTO_GAUSSIAN_BLUR(8) +PROTO_GAUSSIAN_BLUR(16) #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_template.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/edge_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022 Thilo Borgmann + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + */ + +#include "libavutil/avassert.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +#undef pixel +#if DEPTH == 8 +#define pixel uint8_t +#else +#define pixel uint16_t +#endif + +#undef fn +#undef fn2 +#undef fn3 +#define fn3(a,b) ff_##a##_##b +#define fn2(a,b) fn3(a,b) +#define fn(a) fn2(a, DEPTH) + +void fn(sobel)(int w, int h, + uint16_t *dst, int dst_linesize, + int8_t *dir, int dir_linesize, + const uint8_t *src, int src_linesize, int src_stride) +{ + pixel *srcp = (pixel *)src; + + src_stride /= sizeof(pixel); + src_linesize /= sizeof(pixel); + dst_linesize /= sizeof(pixel); + + for (int j = 1; j < h - 1; j++) { + dst += dst_linesize; + dir += dir_linesize; + srcp += src_linesize; + for (int i = 1; i < w - 1; i++) { + const int gx = + -1*srcp[-src_linesize + (i-1)*src_stride] + 1*srcp[-src_linesize + (i+1)*src_stride] + -2*srcp[ (i-1)*src_stride] + 2*srcp[ (i+1)*src_stride] + -1*srcp[ src_linesize + (i-1)*src_stride] + 1*srcp[ src_linesize + (i+1)*src_stride]; + const int gy = + -1*srcp[-src_linesize + (i-1)*src_stride] + 1*srcp[ src_linesize + (i-1)*src_stride] + -2*srcp[-src_linesize + (i )*src_stride] + 2*srcp[ src_linesize + (i )*src_stride] + -1*srcp[-src_linesize + (i+1)*src_stride] + 1*srcp[ src_linesize + (i+1)*src_stride]; + + dst[i] = FFABS(gx) + FFABS(gy); + dir[i] = get_rounded_direction(gx, gy); + } + } +} + +void fn(gaussian_blur)(int w, int h, + uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, int src_stride) +{ + pixel *srcp = (pixel *)src; + pixel *dstp = (pixel *)dst; + + src_stride /= sizeof(pixel); + src_linesize /= sizeof(pixel); + dst_linesize /= sizeof(pixel); + + memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize; + memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize; + for (int j = 2; j < h - 2; j++) { + dstp[0] = srcp[(0)*src_stride]; + dstp[1] = srcp[(1)*src_stride]; + for (int i = 2; i < w - 2; i++) { + /* Gaussian mask of size 5x5 with sigma = 1.4 */ + dstp[i] = ((srcp[-2*src_linesize + (i-2)*src_stride] + srcp[2*src_linesize + (i-2)*src_stride]) * 2 + + (srcp[-2*src_linesize + (i-1)*src_stride] + srcp[2*src_linesize + (i-1)*src_stride]) * 4 + + (srcp[-2*src_linesize + (i )*src_stride] + srcp[2*src_linesize + (i )*src_stride]) * 5 + + (srcp[-2*src_linesize + (i+1)*src_stride] + srcp[2*src_linesize + (i+1)*src_stride]) * 4 + + (srcp[-2*src_linesize + (i+2)*src_stride] + srcp[2*src_linesize + (i+2)*src_stride]) * 2 + + + (srcp[ -src_linesize + (i-2)*src_stride] + srcp[ src_linesize + (i-2)*src_stride]) * 4 + + (srcp[ -src_linesize + (i-1)*src_stride] + srcp[ src_linesize + (i-1)*src_stride]) * 9 + + (srcp[ -src_linesize + (i )*src_stride] + srcp[ src_linesize + (i )*src_stride]) * 12 + + (srcp[ -src_linesize + (i+1)*src_stride] + srcp[ src_linesize + (i+1)*src_stride]) * 9 + + (srcp[ -src_linesize + (i+2)*src_stride] + srcp[ src_linesize + (i+2)*src_stride]) * 4 + + + srcp[(i-2)*src_stride] * 5 + + srcp[(i-1)*src_stride] * 12 + + srcp[(i )*src_stride] * 15 + + srcp[(i+1)*src_stride] * 12 + + srcp[(i+2)*src_stride] * 5) / 159; + } + dstp[w - 2] = srcp[(w - 2)*src_stride]; + dstp[w - 1] = srcp[(w - 1)*src_stride]; + + dstp += dst_linesize; + srcp += src_linesize; + } + memcpy(dstp, srcp, w*sizeof(pixel)); dstp += dst_linesize; srcp += src_linesize; + memcpy(dstp, srcp, w*sizeof(pixel)); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_drawgraph.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_drawgraph.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_drawgraph.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_drawgraph.c 2023-03-03 13:29:59.000000000 +0000 @@ -168,7 +168,7 @@ AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; - int64_t in_pts, out_pts; + int64_t in_pts, out_pts, in_duration; int i; if (s->slide == 4 && s->nb_values >= s->values_size[0] / sizeof(float)) { @@ -320,6 +320,7 @@ s->x++; in_pts = in->pts; + in_duration = in->duration; av_frame_free(&in); @@ -336,6 +337,7 @@ return AVERROR(ENOMEM); clone->pts = s->prev_pts = out_pts; + clone->duration = av_rescale_q(in_duration, inlink->time_base, outlink->time_base); return ff_filter_frame(outlink, clone); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_ebur128.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_ebur128.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_ebur128.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_ebur128.c 2023-03-03 13:29:59.000000000 +0000 @@ -164,6 +164,7 @@ { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "640x480"}, 0, 0, V|F }, { "meter", "set scale meter (+9 to +18)", OFFSET(meter), AV_OPT_TYPE_INT, {.i64 = 9}, 9, 18, V|F }, { "framelog", "force frame logging level", OFFSET(loglevel), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, A|V|F, "level" }, + { "quiet", "logging disabled", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_QUIET}, INT_MIN, INT_MAX, A|V|F, "level" }, { "info", "information logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_INFO}, INT_MIN, INT_MAX, A|V|F, "level" }, { "verbose", "verbose logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_VERBOSE}, INT_MIN, INT_MAX, A|V|F, "level" }, { "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, A|V|F }, @@ -336,7 +337,8 @@ return AVERROR(ENOMEM); /* black background */ - memset(outpicref->data[0], 0, ebur128->h * outpicref->linesize[0]); + for (int y = 0; y < ebur128->h; y++) + memset(outpicref->data[0] + y * outpicref->linesize[0], 0, ebur128->w * 3); /* draw LU legends */ drawtext(outpicref, PAD, PAD+16, FONT8, font_colors+3, " LU"); @@ -535,6 +537,7 @@ int ret; if (ebur128->loglevel != AV_LOG_INFO && + ebur128->loglevel != AV_LOG_QUIET && ebur128->loglevel != AV_LOG_VERBOSE) { if (ebur128->do_video || ebur128->metadata) ebur128->loglevel = AV_LOG_VERBOSE; @@ -615,13 +618,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) { - int i, ch, idx_insample; + int i, ch, idx_insample, ret; AVFilterContext *ctx = inlink->dst; EBUR128Context *ebur128 = ctx->priv; const int nb_channels = ebur128->nb_channels; const int nb_samples = insamples->nb_samples; const double *samples = (double *)insamples->data[0]; - AVFrame *pic = ebur128->outpicref; + AVFrame *pic; #if CONFIG_SWRESAMPLE if (ebur128->peak_mode & PEAK_MODE_TRUE_PEAKS && ebur128->idx_insample == 0) { @@ -818,7 +821,13 @@ y_loudness_lu_graph = lu_to_y(ebur128, loudness_3000 - ebur128->target); y_loudness_lu_gauge = lu_to_y(ebur128, gauge_value); - av_frame_make_writable(pic); + ret = ff_inlink_make_frame_writable(outlink, &ebur128->outpicref); + if (ret < 0) { + av_frame_free(&insamples); + ebur128->insamples = NULL; + return ret; + } + pic = ebur128->outpicref; /* draw the graph using the short-term loudness */ p = pic->data[0] + ebur128->graph.y*pic->linesize[0] + ebur128->graph.x*3; for (y = 0; y < ebur128->graph.h; y++) { @@ -898,6 +907,7 @@ SET_META_PEAK(true, TRUE); } + if (ebur128->loglevel != AV_LOG_QUIET) { if (ebur128->scale == SCALE_TYPE_ABSOLUTE) { av_log(ctx, ebur128->loglevel, "t: %-10s " LOG_FMT, av_ts2timestr(pts, &outlink->time_base), @@ -923,7 +933,7 @@ PRINT_PEAKS("FTPK", ebur128->true_peaks_per_frame, TRUE); PRINT_PEAKS("TPK", ebur128->true_peaks, TRUE); av_log(ctx, ebur128->loglevel, "\n"); - + } } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,4 @@ /* - * Copyright (c) 2022 Niklas Haas * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -17,295 +16,4 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/color_utils.h" -#include "libavutil/csp.h" - -#include "fflcms2.h" - -static void log_cb(cmsContext ctx, cmsUInt32Number error, const char *str) -{ - FFIccContext *s = cmsGetContextUserData(ctx); - av_log(s->avctx, AV_LOG_ERROR, "lcms2: [%"PRIu32"] %s\n", error, str); -} - -int ff_icc_context_init(FFIccContext *s, void *avctx) -{ - memset(s, 0, sizeof(*s)); - s->avctx = avctx; - s->ctx = cmsCreateContext(NULL, s); - if (!s->ctx) - return AVERROR(ENOMEM); - - cmsSetLogErrorHandlerTHR(s->ctx, log_cb); - return 0; -} - -void ff_icc_context_uninit(FFIccContext *s) -{ - for (int i = 0; i < FF_ARRAY_ELEMS(s->curves); i++) - cmsFreeToneCurve(s->curves[i]); - cmsDeleteContext(s->ctx); - memset(s, 0, sizeof(*s)); -} - -static int get_curve(FFIccContext *s, enum AVColorTransferCharacteristic trc, - cmsToneCurve **out_curve) -{ - if (trc >= AVCOL_TRC_NB) - return AVERROR_INVALIDDATA; - - if (s->curves[trc]) - goto done; - - switch (trc) { - case AVCOL_TRC_LINEAR: - s->curves[trc] = cmsBuildGamma(s->ctx, 1.0); - break; - case AVCOL_TRC_GAMMA22: - s->curves[trc] = cmsBuildGamma(s->ctx, 2.2); - break; - case AVCOL_TRC_GAMMA28: - s->curves[trc] = cmsBuildGamma(s->ctx, 2.8); - break; - case AVCOL_TRC_BT709: - case AVCOL_TRC_SMPTE170M: - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { - /* γ = */ 1/0.45, - /* a = */ 1/1.099296826809442, - /* b = */ 1 - 1/1.099296826809442, - /* c = */ 1/4.5, - /* d = */ 4.5 * 0.018053968510807, - }); - break; - case AVCOL_TRC_SMPTE240M: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { - /* γ = */ 1/0.45, - /* a = */ 1/1.1115, - /* b = */ 1 - 1/1.1115, - /* c = */ 1/4.0, - /* d = */ 4.0 * 0.0228, - }); - break; - case AVCOL_TRC_LOG: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 8, (double[5]) { - /* a = */ 1.0, - /* b = */ 10.0, - /* c = */ 2.0, - /* d = */ -1.0, - /* e = */ 0.0 - }); - break; - case AVCOL_TRC_LOG_SQRT: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 8, (double[5]) { - /* a = */ 1.0, - /* b = */ 10.0, - /* c = */ 2.5, - /* d = */ -1.0, - /* e = */ 0.0 - }); - break; - case AVCOL_TRC_IEC61966_2_1: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 4, (double[5]) { - /* γ = */ 2.4, - /* a = */ 1/1.055, - /* b = */ 1 - 1/1.055, - /* c = */ 1/12.92, - /* d = */ 12.92 * 0.0031308, - }); - break; - case AVCOL_TRC_SMPTE428: - s->curves[trc] = cmsBuildParametricToneCurve(s->ctx, 2, (double[3]) { - /* γ = */ 2.6, - /* a = */ pow(52.37/48.0, 1/2.6), - /* b = */ 0.0 - }); - break; - - /* Can't be represented using the existing parametric tone curves. - * FIXME: use cmsBuildTabulatedToneCurveFloat instead */ - case AVCOL_TRC_IEC61966_2_4: - case AVCOL_TRC_BT1361_ECG: - case AVCOL_TRC_SMPTE2084: - case AVCOL_TRC_ARIB_STD_B67: - return AVERROR_PATCHWELCOME; - - default: - return AVERROR_INVALIDDATA; - } - - if (!s->curves[trc]) - return AVERROR(ENOMEM); - -done: - *out_curve = s->curves[trc]; - return 0; -} - -int ff_icc_profile_generate(FFIccContext *s, - enum AVColorPrimaries color_prim, - enum AVColorTransferCharacteristic color_trc, - cmsHPROFILE *out_profile) -{ - cmsToneCurve *tonecurve; - const AVColorPrimariesDesc *prim; - int ret; - - if (!(prim = av_csp_primaries_desc_from_id(color_prim))) - return AVERROR_INVALIDDATA; - if ((ret = get_curve(s, color_trc, &tonecurve)) < 0) - return ret; - - *out_profile = cmsCreateRGBProfileTHR(s->ctx, - &(cmsCIExyY) { av_q2d(prim->wp.x), av_q2d(prim->wp.y), 1.0 }, - &(cmsCIExyYTRIPLE) { - .Red = { av_q2d(prim->prim.r.x), av_q2d(prim->prim.r.y), 1.0 }, - .Green = { av_q2d(prim->prim.g.x), av_q2d(prim->prim.g.y), 1.0 }, - .Blue = { av_q2d(prim->prim.b.x), av_q2d(prim->prim.b.y), 1.0 }, - }, - (cmsToneCurve *[3]) { tonecurve, tonecurve, tonecurve } - ); - - return *out_profile == NULL ? AVERROR(ENOMEM) : 0; -} - -int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame) -{ - cmsUInt32Number size; - AVBufferRef *buf; - - if (!cmsSaveProfileToMem(profile, NULL, &size)) - return AVERROR_EXTERNAL; - - buf = av_buffer_alloc(size); - if (!buf) - return AVERROR(ENOMEM); - - if (!cmsSaveProfileToMem(profile, buf->data, &size) || size != buf->size) { - av_buffer_unref(&buf); - return AVERROR_EXTERNAL; - } - - if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, buf)) { - av_buffer_unref(&buf); - return AVERROR(ENOMEM); - } - - return 0; -} - -static av_always_inline void XYZ_xy(cmsCIEXYZ XYZ, AVCIExy *xy) -{ - double k = 1.0 / (XYZ.X + XYZ.Y + XYZ.Z); - xy->x = av_d2q(k * XYZ.X, 100000); - xy->y = av_d2q(k * XYZ.Y, 100000); -} - -int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, - AVColorPrimariesDesc *out_primaries) -{ - static const uint8_t testprimaries[4][3] = { - { 0xFF, 0, 0 }, /* red */ - { 0, 0xFF, 0 }, /* green */ - { 0, 0, 0xFF }, /* blue */ - { 0xFF, 0xFF, 0xFF }, /* white */ - }; - - AVWhitepointCoefficients *wp = &out_primaries->wp; - AVPrimaryCoefficients *prim = &out_primaries->prim; - cmsFloat64Number prev_adapt; - cmsHPROFILE xyz; - cmsHTRANSFORM tf; - cmsCIEXYZ dst[4]; - - xyz = cmsCreateXYZProfileTHR(s->ctx); - if (!xyz) - return AVERROR(ENOMEM); - - /* We need to use an unadapted observer to get the raw values */ - prev_adapt = cmsSetAdaptationStateTHR(s->ctx, 0.0); - tf = cmsCreateTransformTHR(s->ctx, profile, TYPE_RGB_8, xyz, TYPE_XYZ_DBL, - INTENT_ABSOLUTE_COLORIMETRIC, - /* Note: These flags mostly don't do anything - * anyway, but specify them regardless */ - cmsFLAGS_NOCACHE | - cmsFLAGS_NOOPTIMIZE | - cmsFLAGS_LOWRESPRECALC | - cmsFLAGS_GRIDPOINTS(2)); - cmsSetAdaptationStateTHR(s->ctx, prev_adapt); - cmsCloseProfile(xyz); - if (!tf) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid ICC profile (e.g. CMYK)\n"); - return AVERROR_INVALIDDATA; - } - - cmsDoTransform(tf, testprimaries, dst, 4); - cmsDeleteTransform(tf); - XYZ_xy(dst[0], &prim->r); - XYZ_xy(dst[1], &prim->g); - XYZ_xy(dst[2], &prim->b); - XYZ_xy(dst[3], wp); - return 0; -} - -int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, - enum AVColorTransferCharacteristic *out_trc) -{ - /* 8-bit linear grayscale ramp */ - static const uint8_t testramp[16][3] = { - { 1, 1, 1}, /* avoid exact zero due to log100 etc. */ - { 17, 17, 17}, - { 34, 34, 34}, - { 51, 51, 51}, - { 68, 68, 68}, - { 85, 85, 85}, - { 02, 02, 02}, - {119, 119, 119}, - {136, 136, 136}, - {153, 153, 153}, - {170, 170, 170}, - {187, 187, 187}, - {204, 204, 204}, - {221, 221, 221}, - {238, 238, 238}, - {255, 255, 255}, - }; - - double dst[FF_ARRAY_ELEMS(testramp)]; - - for (enum AVColorTransferCharacteristic trc = 0; trc < AVCOL_TRC_NB; trc++) { - cmsToneCurve *tonecurve; - cmsHPROFILE ref; - cmsHTRANSFORM tf; - double delta = 0.0; - if (get_curve(s, trc, &tonecurve) < 0) - continue; - - ref = cmsCreateGrayProfileTHR(s->ctx, cmsD50_xyY(), tonecurve); - if (!ref) - return AVERROR(ENOMEM); - - tf = cmsCreateTransformTHR(s->ctx, profile, TYPE_RGB_8, ref, TYPE_GRAY_DBL, - INTENT_RELATIVE_COLORIMETRIC, - cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE); - cmsCloseProfile(ref); - if (!tf) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid ICC profile (e.g. CMYK)\n"); - return AVERROR_INVALIDDATA; - } - - cmsDoTransform(tf, testramp, dst, FF_ARRAY_ELEMS(dst)); - cmsDeleteTransform(tf); - - for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) - delta += fabs(testramp[i][0] / 255.0 - dst[i]); - if (delta < 0.01) { - *out_trc = trc; - return 0; - } - } - - *out_trc = AVCOL_TRC_UNSPECIFIED; - return 0; -} +#include "libavcodec/fflcms2.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/fflcms2.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,4 @@ /* - * Copyright (c) 2022 Niklas Haas * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -17,71 +16,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * @file - * Various functions for dealing with ICC profiles - */ - #ifndef AVFILTER_FFLCMS2_H #define AVFILTER_FFLCMS2_H -#include "libavutil/csp.h" -#include "libavutil/frame.h" -#include "libavutil/pixfmt.h" - -#include - -typedef struct FFIccContext { - void *avctx; - cmsContext ctx; - cmsToneCurve *curves[AVCOL_TRC_NB]; /* tone curve cache */ -} FFIccContext; - -/** - * Initializes an FFIccContext. This must be done prior to using it. - * - * Returns 0 on success, or a negative error code. - */ -int ff_icc_context_init(FFIccContext *s, void *avctx); -void ff_icc_context_uninit(FFIccContext *s); - -/** - * Generate an ICC profile for a given combination of color primaries and - * transfer function. Both values must be set to valid entries (not - * "undefined") for this function to work. - * - * Returns 0 on success, or a negative error code. - */ -int ff_icc_profile_generate(FFIccContext *s, - enum AVColorPrimaries color_prim, - enum AVColorTransferCharacteristic color_trc, - cmsHPROFILE *out_profile); - -/** - * Attach an ICC profile to a frame. Helper wrapper around cmsSaveProfileToMem - * and av_frame_new_side_data_from_buf. - * - * Returns 0 on success, or a negative error code. - */ -int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); - -/** - * Read the color primaries and white point coefficients encoded by an ICC - * profile, and return the raw values in `out_primaries`. - * - * Returns 0 on success, or a negative error code. - */ -int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, - AVColorPrimariesDesc *out_primaries); - -/** - * Attempt detecting the transfer characteristic that best approximates the - * transfer function encoded by an ICC profile. Sets `out_trc` to - * AVCOL_TRC_UNSPECIFIED if no clear match can be identified. - * - * Returns 0 on success (including no match), or a negative error code. - */ -int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, - enum AVColorTransferCharacteristic *out_trc); +#include "libavcodec/fflcms2.h" #endif /* AVFILTER_FFLCMS2_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_loop.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_loop.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_loop.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_loop.c 2023-03-03 13:29:59.000000000 +0000 @@ -331,9 +331,16 @@ if (!out) return AVERROR(ENOMEM); out->pts += s->duration - s->start_pts; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (out->pkt_duration) duration = out->pkt_duration; else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (out->duration) + duration = out->duration; + else duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); pts = out->pts + duration; ret = ff_filter_frame(outlink, out); @@ -368,9 +375,16 @@ return AVERROR(ENOMEM); } s->nb_frames++; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (frame->pkt_duration) duration = frame->pkt_duration; else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (frame->duration) + duration = frame->duration; + else duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); s->duration = frame->pts + duration; ret = ff_filter_frame(outlink, frame); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_metadata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_metadata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_metadata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_metadata.c 2023-03-03 13:29:59.000000000 +0000 @@ -308,7 +308,7 @@ AVFilterLink *outlink = ctx->outputs[0]; MetadataContext *s = ctx->priv; AVDictionary **metadata = &frame->metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL, !s->key ? AV_DICT_IGNORE_SUFFIX: 0); @@ -339,7 +339,7 @@ s->print(ctx, "frame:%-4"PRId64" pts:%-7s pts_time:%s\n", inlink->frame_count_out, av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base)); s->print(ctx, "%s=%s\n", e->key, e->value); - while ((e = av_dict_get(*metadata, "", e, AV_DICT_IGNORE_SUFFIX)) != NULL) { + while ((e = av_dict_iterate(*metadata, e)) != NULL) { s->print(ctx, "%s=%s\n", e->key, e->value); } } else if (e && e->value && (!s->value || (e->value && s->compare(s, e->value, s->value)))) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_perms.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_perms.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_perms.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_perms.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/opt.h" #include "libavutil/random_seed.h" #include "audio.h" +#include "filters.h" #include "video.h" enum mode { @@ -96,8 +97,9 @@ in_perm == out_perm ? " (no-op)" : ""); if (in_perm == RO && out_perm == RW) { - if ((ret = av_frame_make_writable(frame)) < 0) + if ((ret = ff_inlink_make_frame_writable(inlink, &frame)) < 0) return ret; + out = frame; } else if (in_perm == RW && out_perm == RO) { out = av_frame_clone(frame); if (!out) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,13 @@ { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" }, { "shortest", "force termination when the shortest input terminates", OFFSET(opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { "repeatlast", "extend last frame of secondary streams beyond EOF", OFFSET(opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS }, + { "ts_sync_mode", "How strictly to sync streams based on secondary input timestamps", + OFFSET(opt_ts_sync_mode), AV_OPT_TYPE_INT, { .i64 = TS_DEFAULT }, + TS_DEFAULT, TS_NEAREST, .flags = FLAGS, "ts_sync_mode" }, + { "default", "Frame from secondary input with the nearest lower or equal timestamp to the primary input frame", + 0, AV_OPT_TYPE_CONST, { .i64 = TS_DEFAULT }, .flags = FLAGS, "ts_sync_mode" }, + { "nearest", "Frame from secondary input with the absolute nearest timestamp to the primary input frame", + 0, AV_OPT_TYPE_CONST, { .i64 = TS_NEAREST }, .flags = FLAGS, "ts_sync_mode" }, { NULL } }; static const AVClass framesync_class = { @@ -110,6 +117,14 @@ av_assert0(level <= fs->sync_level); if (level < fs->sync_level) av_log(fs, AV_LOG_VERBOSE, "Sync level %u\n", level); + if (fs->opt_ts_sync_mode > TS_DEFAULT) { + for (i = 0; i < fs->nb_in; i++) { + if (fs->in[i].sync < level) + fs->in[i].ts_mode = fs->opt_ts_sync_mode; + else + fs->in[i].ts_mode = TS_DEFAULT; + } + } if (level) fs->sync_level = level; else @@ -187,6 +202,10 @@ } for (i = 0; i < fs->nb_in; i++) { if (fs->in[i].pts_next == pts || + (fs->in[i].ts_mode == TS_NEAREST && + fs->in[i].have_next && + fs->in[i].pts_next != INT64_MAX && fs->in[i].pts != AV_NOPTS_VALUE && + fs->in[i].pts_next - pts < pts - fs->in[i].pts) || (fs->in[i].before == EXT_INFINITY && fs->in[i].state == STATE_BOF)) { av_frame_free(&fs->in[i].frame); @@ -269,7 +288,7 @@ if (need_copy) { if (!(frame = av_frame_clone(frame))) return AVERROR(ENOMEM); - if ((ret = av_frame_make_writable(frame)) < 0) { + if ((ret = ff_inlink_make_frame_writable(fs->parent->inputs[in], &frame) < 0)) { av_frame_free(&frame); return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/framesync.h 2023-03-03 13:29:59.000000000 +0000 @@ -76,6 +76,27 @@ }; /** + * Timestamp syncronization mode + * + * Describe how the frames of a stream are syncronized based on timestamp + * distance. + */ +enum FFFrameTSSyncMode { + + /** + * Sync to frames from secondary input with the nearest, lower or equal + * timestamp to the frame event one. + */ + TS_DEFAULT, + + /** + * Sync to frames from secondary input with the absolute nearest timestamp + * to the frame event one. + */ + TS_NEAREST, +}; + +/** * Input stream structure */ typedef struct FFFrameSyncIn { @@ -138,6 +159,7 @@ */ unsigned sync; + enum FFFrameTSSyncMode ts_mode; } FFFrameSyncIn; /** @@ -205,6 +227,7 @@ int opt_repeatlast; int opt_shortest; int opt_eof_action; + int opt_ts_sync_mode; } FFFrameSync; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_reverse.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_reverse.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_reverse.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/f_reverse.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,9 @@ AVFrame **frames; unsigned int frames_size; unsigned int pts_size; + unsigned int duration_size; int64_t *pts; + int64_t *duration; int flush_idx; int64_t nb_samples; } ReverseContext; @@ -47,12 +49,15 @@ if (!s->pts) return AVERROR(ENOMEM); + s->duration = av_fast_realloc(NULL, &s->duration_size, + DEFAULT_LENGTH * sizeof(*(s->duration))); + if (!s->duration) + return AVERROR(ENOMEM); + s->frames = av_fast_realloc(NULL, &s->frames_size, DEFAULT_LENGTH * sizeof(*(s->frames))); - if (!s->frames) { - av_freep(&s->pts); + if (!s->frames) return AVERROR(ENOMEM); - } return 0; } @@ -67,6 +72,7 @@ } av_freep(&s->pts); + av_freep(&s->duration); av_freep(&s->frames); } @@ -83,6 +89,13 @@ s->pts = ptr; } + if (s->nb_frames + 1 > s->duration_size / sizeof(*(s->duration))) { + ptr = av_fast_realloc(s->duration, &s->duration_size, s->duration_size * 2); + if (!ptr) + return AVERROR(ENOMEM); + s->duration = ptr; + } + if (s->nb_frames + 1 > s->frames_size / sizeof(*(s->frames))) { ptr = av_fast_realloc(s->frames, &s->frames_size, s->frames_size * 2); if (!ptr) @@ -92,6 +105,7 @@ s->frames[s->nb_frames] = in; s->pts[s->nb_frames] = in->pts; + s->duration[s->nb_frames] = in->duration; s->nb_frames++; return 0; @@ -109,6 +123,7 @@ if (ret == AVERROR_EOF && s->nb_frames > 0) { AVFrame *out = s->frames[s->nb_frames - 1]; + out->duration= s->duration[s->flush_idx]; out->pts = s->pts[s->flush_idx++]; ret = ff_filter_frame(outlink, out); s->frames[s->nb_frames - 1] = NULL; @@ -252,6 +267,7 @@ if (ret == AVERROR_EOF && s->nb_frames > 0) { AVFrame *out = s->frames[s->nb_frames - 1]; + out->duration = s->duration[s->flush_idx]; out->pts = s->pts[s->flush_idx++] - s->nb_samples; s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/graphparser.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/graphparser.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/graphparser.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/graphparser.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,32 +24,16 @@ #include #include "libavutil/avstring.h" +#include "libavutil/dict.h" #include "libavutil/mem.h" +#include "libavutil/opt.h" + #include "avfilter.h" +#include "internal.h" #define WHITESPACES " \n\t\r" /** - * Link two filters together. - * - * @see avfilter_link() - */ -static int link_filter(AVFilterContext *src, int srcpad, - AVFilterContext *dst, int dstpad, - void *log_ctx) -{ - int ret; - if ((ret = avfilter_link(src, srcpad, dst, dstpad))) { - av_log(log_ctx, AV_LOG_ERROR, - "Cannot create the link %s:%d -> %s:%d\n", - src->filter->name, srcpad, dst->filter->name, dstpad); - return ret; - } - - return 0; -} - -/** * Parse the name of a link, which has the format "[linkname]". * * @return a pointer (that need to be freed after use) to the name @@ -83,127 +67,6 @@ return name; } -/** - * Create an instance of a filter, initialize and insert it in the - * filtergraph in *ctx. - * - * @param filt_ctx put here a filter context in case of successful creation and configuration, NULL otherwise. - * @param ctx the filtergraph context - * @param index an index which is supposed to be unique for each filter instance added to the filtergraph - * @param name the name of the filter to create, can be filter name or filter_name\@id as instance name - * @param args the arguments provided to the filter during its initialization - * @param log_ctx the log context to use - * @return >= 0 in case of success, a negative AVERROR code otherwise - */ -static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index, - const char *name, const char *args, void *log_ctx) -{ - const AVFilter *filt; - char name2[30]; - const char *inst_name = NULL, *filt_name = NULL; - char *tmp_args = NULL; - int ret, k; - - av_strlcpy(name2, name, sizeof(name2)); - - for (k = 0; name2[k]; k++) { - if (name2[k] == '@' && name[k+1]) { - name2[k] = 0; - inst_name = name; - filt_name = name2; - break; - } - } - - if (!inst_name) { - snprintf(name2, sizeof(name2), "Parsed_%s_%d", name, index); - inst_name = name2; - filt_name = name; - } - - filt = avfilter_get_by_name(filt_name); - - if (!filt) { - av_log(log_ctx, AV_LOG_ERROR, - "No such filter: '%s'\n", filt_name); - return AVERROR(EINVAL); - } - - *filt_ctx = avfilter_graph_alloc_filter(ctx, filt, inst_name); - if (!*filt_ctx) { - av_log(log_ctx, AV_LOG_ERROR, - "Error creating filter '%s'\n", filt_name); - return AVERROR(ENOMEM); - } - - if (!strcmp(filt_name, "scale") && (!args || !strstr(args, "flags")) && - ctx->scale_sws_opts) { - if (args) { - tmp_args = av_asprintf("%s:%s", - args, ctx->scale_sws_opts); - if (!tmp_args) - return AVERROR(ENOMEM); - args = tmp_args; - } else - args = ctx->scale_sws_opts; - } - - ret = avfilter_init_str(*filt_ctx, args); - if (ret < 0) { - av_log(log_ctx, AV_LOG_ERROR, - "Error initializing filter '%s'", filt_name); - if (args) - av_log(log_ctx, AV_LOG_ERROR, " with args '%s'", args); - av_log(log_ctx, AV_LOG_ERROR, "\n"); - avfilter_free(*filt_ctx); - *filt_ctx = NULL; - } - - av_free(tmp_args); - return ret; -} - -/** - * Parse a string of the form FILTER_NAME[=PARAMS], and create a - * corresponding filter instance which is added to graph with - * create_filter(). - * - * @param filt_ctx Pointer that is set to the created and configured filter - * context on success, set to NULL on failure. - * @param filt_ctx put here a pointer to the created filter context on - * success, NULL otherwise - * @param buf pointer to the buffer to parse, *buf will be updated to - * point to the char next after the parsed string - * @param index an index which is assigned to the created filter - * instance, and which is supposed to be unique for each filter - * instance added to the filtergraph - * @return >= 0 in case of success, a negative AVERROR code otherwise - */ -static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph, - int index, void *log_ctx) -{ - char *opts = NULL; - char *name = av_get_token(buf, "=,;["); - int ret; - - if (!name) - return AVERROR(ENOMEM); - - if (**buf == '=') { - (*buf)++; - opts = av_get_token(buf, "[],;"); - if (!opts) { - av_free(name); - return AVERROR(ENOMEM); - } - } - - ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx); - av_free(name); - av_free(opts); - return ret; -} - AVFilterInOut *avfilter_inout_alloc(void) { return av_mallocz(sizeof(AVFilterInOut)); @@ -236,12 +99,6 @@ return ret; } -static void insert_inout(AVFilterInOut **inouts, AVFilterInOut *element) -{ - element->next = *inouts; - *inouts = element; -} - static void append_inout(AVFilterInOut **inouts, AVFilterInOut **element) { while (*inouts && (*inouts)->next) @@ -254,145 +111,7 @@ *element = NULL; } -static int link_filter_inouts(AVFilterContext *filt_ctx, - AVFilterInOut **curr_inputs, - AVFilterInOut **open_inputs, void *log_ctx) -{ - int pad, ret; - - for (pad = 0; pad < filt_ctx->nb_inputs; pad++) { - AVFilterInOut *p = *curr_inputs; - - if (p) { - *curr_inputs = (*curr_inputs)->next; - p->next = NULL; - } else if (!(p = av_mallocz(sizeof(*p)))) - return AVERROR(ENOMEM); - - if (p->filter_ctx) { - ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx); - av_freep(&p->name); - av_freep(&p); - if (ret < 0) - return ret; - } else { - p->filter_ctx = filt_ctx; - p->pad_idx = pad; - append_inout(open_inputs, &p); - } - } - - if (*curr_inputs) { - av_log(log_ctx, AV_LOG_ERROR, - "Too many inputs specified for the \"%s\" filter.\n", - filt_ctx->filter->name); - return AVERROR(EINVAL); - } - - pad = filt_ctx->nb_outputs; - while (pad--) { - AVFilterInOut *currlinkn = av_mallocz(sizeof(AVFilterInOut)); - if (!currlinkn) - return AVERROR(ENOMEM); - currlinkn->filter_ctx = filt_ctx; - currlinkn->pad_idx = pad; - insert_inout(curr_inputs, currlinkn); - } - - return 0; -} - -static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, - AVFilterInOut **open_outputs, void *log_ctx) -{ - AVFilterInOut *parsed_inputs = NULL; - int pad = 0; - - while (**buf == '[') { - char *name = parse_link_name(buf, log_ctx); - AVFilterInOut *match; - - if (!name) { - avfilter_inout_free(&parsed_inputs); - return AVERROR(EINVAL); - } - - /* First check if the label is not in the open_outputs list */ - match = extract_inout(name, open_outputs); - - if (match) { - av_free(name); - } else { - /* Not in the list, so add it as an input */ - if (!(match = av_mallocz(sizeof(AVFilterInOut)))) { - avfilter_inout_free(&parsed_inputs); - av_free(name); - return AVERROR(ENOMEM); - } - match->name = name; - match->pad_idx = pad; - } - - append_inout(&parsed_inputs, &match); - - *buf += strspn(*buf, WHITESPACES); - pad++; - } - - append_inout(&parsed_inputs, curr_inputs); - *curr_inputs = parsed_inputs; - - return pad; -} - -static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, - AVFilterInOut **open_inputs, - AVFilterInOut **open_outputs, void *log_ctx) -{ - int ret, pad = 0; - - while (**buf == '[') { - char *name = parse_link_name(buf, log_ctx); - AVFilterInOut *match; - - AVFilterInOut *input = *curr_inputs; - - if (!name) - return AVERROR(EINVAL); - - if (!input) { - av_log(log_ctx, AV_LOG_ERROR, - "No output pad can be associated to link label '%s'.\n", name); - av_free(name); - return AVERROR(EINVAL); - } - *curr_inputs = (*curr_inputs)->next; - - /* First check if the label is not in the open_inputs list */ - match = extract_inout(name, open_inputs); - - if (match) { - ret = link_filter(input->filter_ctx, input->pad_idx, - match->filter_ctx, match->pad_idx, log_ctx); - av_freep(&match->name); - av_freep(&name); - av_freep(&match); - av_freep(&input); - if (ret < 0) - return ret; - } else { - /* Not in the list, so add the first input as an open_output */ - input->name = name; - insert_inout(open_outputs, input); - } - *buf += strspn(*buf, WHITESPACES); - pad++; - } - - return pad; -} - -static int parse_sws_flags(const char **buf, AVFilterGraph *graph) +static int parse_sws_flags(const char **buf, char **dst, void *log_ctx) { char *p = strchr(*buf, ';'); @@ -400,16 +119,16 @@ return 0; if (!p) { - av_log(graph, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n"); + av_log(log_ctx, AV_LOG_ERROR, "sws_flags not terminated with ';'.\n"); return AVERROR(EINVAL); } *buf += 4; // keep the 'flags=' part - av_freep(&graph->scale_sws_opts); - if (!(graph->scale_sws_opts = av_mallocz(p - *buf + 1))) + av_freep(dst); + if (!(*dst = av_mallocz(p - *buf + 1))) return AVERROR(ENOMEM); - av_strlcpy(graph->scale_sws_opts, *buf, p - *buf + 1); + av_strlcpy(*dst, *buf, p - *buf + 1); *buf = p + 1; return 0; @@ -419,66 +138,24 @@ AVFilterInOut **inputs, AVFilterInOut **outputs) { - int index = 0, ret = 0; - char chr = 0; - - AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL; - - filters += strspn(filters, WHITESPACES); - - if ((ret = parse_sws_flags(&filters, graph)) < 0) - goto fail; - - do { - AVFilterContext *filter; - filters += strspn(filters, WHITESPACES); - - if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0) - goto end; - if ((ret = parse_filter(&filter, &filters, graph, index, graph)) < 0) - goto end; - - - if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, graph)) < 0) - goto end; - - if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs, - graph)) < 0) - goto end; + AVFilterGraphSegment *seg; + int ret; - filters += strspn(filters, WHITESPACES); - chr = *filters++; + ret = avfilter_graph_segment_parse(graph, filters, 0, &seg); + if (ret < 0) + return ret; - if (chr == ';' && curr_inputs) - append_inout(&open_outputs, &curr_inputs); - index++; - } while (chr == ',' || chr == ';'); - - if (chr) { - av_log(graph, AV_LOG_ERROR, - "Unable to parse graph description substring: \"%s\"\n", - filters - 1); - ret = AVERROR(EINVAL); + ret = avfilter_graph_segment_apply(seg, 0, inputs, outputs); + avfilter_graph_segment_free(&seg); + if (ret < 0) goto end; - } - - append_inout(&open_outputs, &curr_inputs); - - *inputs = open_inputs; - *outputs = open_outputs; return 0; - fail:end: +end: while (graph->nb_filters) avfilter_free(graph->filters[0]); av_freep(&graph->filters); - avfilter_inout_free(&open_inputs); - avfilter_inout_free(&open_outputs); - avfilter_inout_free(&curr_inputs); - - *inputs = NULL; - *outputs = NULL; return ret; } @@ -546,86 +223,783 @@ return ret; } -int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, - AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, - void *log_ctx) +static void pad_params_free(AVFilterPadParams **pfpp) { - int index = 0, ret = 0; - char chr = 0; + AVFilterPadParams *fpp = *pfpp; - AVFilterInOut *curr_inputs = NULL; - AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL; - AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL; + if (!fpp) + return; - if ((ret = parse_sws_flags(&filters, graph)) < 0) - goto end; + av_freep(&fpp->label); - do { - AVFilterContext *filter; - const char *filterchain = filters; - filters += strspn(filters, WHITESPACES); + av_freep(pfpp); +} - if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, log_ctx)) < 0) - goto end; +static void filter_params_free(AVFilterParams **pp) +{ + AVFilterParams *p = *pp; - if ((ret = parse_filter(&filter, &filters, graph, index, log_ctx)) < 0) - goto end; + if (!p) + return; - if (filter->nb_inputs == 1 && !curr_inputs && !index) { - /* First input pad, assume it is "[in]" if not specified */ - const char *tmp = "[in]"; - if ((ret = parse_inputs(&tmp, &curr_inputs, &open_outputs, log_ctx)) < 0) - goto end; + for (unsigned i = 0; i < p->nb_inputs; i++) + pad_params_free(&p->inputs[i]); + av_freep(&p->inputs); + + for (unsigned i = 0; i < p->nb_outputs; i++) + pad_params_free(&p->outputs[i]); + av_freep(&p->outputs); + + av_dict_free(&p->opts); + + av_freep(&p->filter_name); + av_freep(&p->instance_name); + + av_freep(pp); +} + +static void chain_free(AVFilterChain **pch) +{ + AVFilterChain *ch = *pch; + + if (!ch) + return; + + for (size_t i = 0; i < ch->nb_filters; i++) + filter_params_free(&ch->filters[i]); + av_freep(&ch->filters); + + av_freep(pch); +} + +void avfilter_graph_segment_free(AVFilterGraphSegment **pseg) +{ + AVFilterGraphSegment *seg = *pseg; + + if (!seg) + return; + + for (size_t i = 0; i < seg->nb_chains; i++) + chain_free(&seg->chains[i]); + av_freep(&seg->chains); + + av_freep(&seg->scale_sws_opts); + + av_freep(pseg); +} + +static int linklabels_parse(void *logctx, const char **linklabels, + AVFilterPadParams ***res, unsigned *nb_res) +{ + AVFilterPadParams **pp = NULL; + int nb = 0; + int ret; + + while (**linklabels == '[') { + char *label; + AVFilterPadParams *par; + + label = parse_link_name(linklabels, logctx); + if (!label) { + ret = AVERROR(EINVAL); + goto fail; } - if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, log_ctx)) < 0) - goto end; + par = av_mallocz(sizeof(*par)); + if (!par) { + av_freep(&label); + ret = AVERROR(ENOMEM); + goto fail; + } - if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs, - log_ctx)) < 0) - goto end; + par->label = label; - filters += strspn(filters, WHITESPACES); - chr = *filters++; + ret = av_dynarray_add_nofree(&pp, &nb, par); + if (ret < 0) { + pad_params_free(&par); + goto fail; + } - if (chr == ';' && curr_inputs) { - av_log(log_ctx, AV_LOG_ERROR, - "Invalid filterchain containing an unlabelled output pad: \"%s\"\n", - filterchain); + *linklabels += strspn(*linklabels, WHITESPACES); + } + + *res = pp; + *nb_res = nb; + + return 0; +fail: + for (unsigned i = 0; i < nb; i++) + pad_params_free(&pp[i]); + av_freep(&pp); + return ret; +} + +static int filter_parse(void *logctx, const char **filter, + AVFilterParams **pp) +{ + AVFilterParams *p; + char *inst_name; + int ret; + + p = av_mallocz(sizeof(*p)); + if (!p) + return AVERROR(ENOMEM); + + ret = linklabels_parse(logctx, filter, &p->inputs, &p->nb_inputs); + if (ret < 0) + goto fail; + + p->filter_name = av_get_token(filter, "=,;["); + if (!p->filter_name) { + ret = AVERROR(ENOMEM); + goto fail; + } + + inst_name = strchr(p->filter_name, '@'); + if (inst_name) { + *inst_name++ = 0; + p->instance_name = av_strdup(inst_name); + if (!p->instance_name) { + ret = AVERROR(ENOMEM); + goto fail; + } + } + + if (**filter == '=') { + const AVFilter *f = avfilter_get_by_name(p->filter_name); + char *opts; + + (*filter)++; + + opts = av_get_token(filter, "[],;"); + if (!opts) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ret = ff_filter_opt_parse(logctx, f ? f->priv_class : NULL, + &p->opts, opts); + av_freep(&opts); + if (ret < 0) + goto fail; + } + + ret = linklabels_parse(logctx, filter, &p->outputs, &p->nb_outputs); + if (ret < 0) + goto fail; + + *filter += strspn(*filter, WHITESPACES); + + *pp = p; + return 0; +fail: + av_log(logctx, AV_LOG_ERROR, + "Error parsing a filter description around: %s\n", *filter); + filter_params_free(&p); + return ret; +} + +static int chain_parse(void *logctx, const char **pchain, + AVFilterChain **pch) +{ + const char *chain = *pchain; + AVFilterChain *ch; + int ret, nb_filters = 0; + + *pch = NULL; + + ch = av_mallocz(sizeof(*ch)); + if (!ch) + return AVERROR(ENOMEM); + + while (*chain) { + AVFilterParams *p; + char chr; + + ret = filter_parse(logctx, &chain, &p); + if (ret < 0) + goto fail; + + ret = av_dynarray_add_nofree(&ch->filters, &nb_filters, p); + if (ret < 0) { + filter_params_free(&p); + goto fail; + } + ch->nb_filters = nb_filters; + + // a filter ends with one of: , ; end-of-string + chr = *chain; + if (chr && chr != ',' && chr != ';') { + av_log(logctx, AV_LOG_ERROR, + "Trailing garbage after a filter: %s\n", chain); ret = AVERROR(EINVAL); - goto end; + goto fail; } - index++; - } while (chr == ',' || chr == ';'); - if (chr) { - av_log(log_ctx, AV_LOG_ERROR, - "Unable to parse graph description substring: \"%s\"\n", - filters - 1); + if (chr) { + chain++; + chain += strspn(chain, WHITESPACES); + + if (chr == ';') + break; + } + } + + *pchain = chain; + *pch = ch; + + return 0; +fail: + av_log(logctx, AV_LOG_ERROR, + "Error parsing filterchain '%s' around: %s\n", *pchain, chain); + chain_free(&ch); + return ret; +} + +int avfilter_graph_segment_parse(AVFilterGraph *graph, const char *graph_str, + int flags, AVFilterGraphSegment **pseg) +{ + AVFilterGraphSegment *seg; + int ret, nb_chains = 0; + + *pseg = NULL; + + if (flags) + return AVERROR(ENOSYS); + + seg = av_mallocz(sizeof(*seg)); + if (!seg) + return AVERROR(ENOMEM); + + seg->graph = graph; + + graph_str += strspn(graph_str, WHITESPACES); + + ret = parse_sws_flags(&graph_str, &seg->scale_sws_opts, &graph); + if (ret < 0) + goto fail; + + graph_str += strspn(graph_str, WHITESPACES); + + while (*graph_str) { + AVFilterChain *ch; + + ret = chain_parse(graph, &graph_str, &ch); + if (ret < 0) + goto fail; + + ret = av_dynarray_add_nofree(&seg->chains, &nb_chains, ch); + if (ret < 0) { + chain_free(&ch); + goto fail; + } + seg->nb_chains = nb_chains; + + graph_str += strspn(graph_str, WHITESPACES); + } + + if (!seg->nb_chains) { + av_log(graph, AV_LOG_ERROR, "No filters specified in the graph description\n"); ret = AVERROR(EINVAL); + goto fail; + } + + *pseg = seg; + + return 0; +fail: + avfilter_graph_segment_free(&seg); + return ret; +} + +int avfilter_graph_segment_create_filters(AVFilterGraphSegment *seg, int flags) +{ + size_t idx = 0; + + if (flags) + return AVERROR(ENOSYS); + + if (seg->scale_sws_opts) { + av_freep(&seg->graph->scale_sws_opts); + seg->graph->scale_sws_opts = av_strdup(seg->scale_sws_opts); + if (!seg->graph->scale_sws_opts) + return AVERROR(ENOMEM); + } + + for (size_t i = 0; i < seg->nb_chains; i++) { + AVFilterChain *ch = seg->chains[i]; + + for (size_t j = 0; j < ch->nb_filters; j++) { + AVFilterParams *p = ch->filters[j]; + const AVFilter *f = avfilter_get_by_name(p->filter_name); + char inst_name[30], *name = p->instance_name ? p->instance_name : + inst_name; + + // skip already processed filters + if (p->filter || !p->filter_name) + continue; + + if (!f) { + av_log(seg->graph, AV_LOG_ERROR, + "No such filter: '%s'\n", p->filter_name); + return AVERROR_FILTER_NOT_FOUND; + } + + if (!p->instance_name) + snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%zu", f->name, idx); + + p->filter = avfilter_graph_alloc_filter(seg->graph, f, name); + if (!p->filter) + return AVERROR(ENOMEM); + + if (!strcmp(f->name, "scale") && seg->graph->scale_sws_opts) { + int ret = av_set_options_string(p->filter, seg->graph->scale_sws_opts, + "=", ":"); + if (ret < 0) { + avfilter_free(p->filter); + p->filter = NULL; + return ret; + } + } + + av_freep(&p->filter_name); + av_freep(&p->instance_name); + + idx++; + } + } + + return 0; +} + +static int fail_creation_pending(AVFilterGraphSegment *seg, const char *fn, + const char *func) +{ + av_log(seg->graph, AV_LOG_ERROR, + "A creation-pending filter '%s' present in the segment. All filters " + "must be created or disabled before calling %s().\n", fn, func); + return AVERROR(EINVAL); +} + +int avfilter_graph_segment_apply_opts(AVFilterGraphSegment *seg, int flags) +{ + int ret, leftover_opts = 0; + + if (flags) + return AVERROR(ENOSYS); + + for (size_t i = 0; i < seg->nb_chains; i++) { + AVFilterChain *ch = seg->chains[i]; + + for (size_t j = 0; j < ch->nb_filters; j++) { + AVFilterParams *p = ch->filters[j]; + + if (p->filter_name) + return fail_creation_pending(seg, p->filter_name, __func__); + if (!p->filter || !p->opts) + continue; + + ret = av_opt_set_dict2(p->filter, &p->opts, AV_OPT_SEARCH_CHILDREN); + if (ret < 0) + return ret; + + if (av_dict_count(p->opts)) + leftover_opts = 1; + } + } + + return leftover_opts ? AVERROR_OPTION_NOT_FOUND : 0; +} + +int avfilter_graph_segment_init(AVFilterGraphSegment *seg, int flags) +{ + if (flags) + return AVERROR(ENOSYS); + + for (size_t i = 0; i < seg->nb_chains; i++) { + AVFilterChain *ch = seg->chains[i]; + + for (size_t j = 0; j < ch->nb_filters; j++) { + AVFilterParams *p = ch->filters[j]; + int ret; + + if (p->filter_name) + return fail_creation_pending(seg, p->filter_name, __func__); + if (!p->filter || p->filter->internal->initialized) + continue; + + ret = avfilter_init_dict(p->filter, NULL); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static unsigned +find_linklabel(AVFilterGraphSegment *seg, const char *label, + int output, size_t idx_chain, size_t idx_filter, + AVFilterParams **pp) +{ + for (; idx_chain < seg->nb_chains; idx_chain++) { + AVFilterChain *ch = seg->chains[idx_chain]; + + for (; idx_filter < ch->nb_filters; idx_filter++) { + AVFilterParams *p = ch->filters[idx_filter]; + AVFilterPadParams **io = output ? p->outputs : p->inputs; + unsigned nb_io = output ? p->nb_outputs : p->nb_inputs; + AVFilterLink **l; + unsigned nb_l; + + if (!p->filter) + continue; + + l = output ? p->filter->outputs : p->filter->inputs; + nb_l = output ? p->filter->nb_outputs : p->filter->nb_inputs; + + for (unsigned i = 0; i < FFMIN(nb_io, nb_l); i++) + if (!l[i] && io[i]->label && !strcmp(io[i]->label, label)) { + *pp = p; + return i; + } + } + + idx_filter = 0; + } + + *pp = NULL; + return 0; +} + +static int inout_add(AVFilterInOut **inouts, AVFilterContext *f, unsigned pad_idx, + const char *label) +{ + AVFilterInOut *io = av_mallocz(sizeof(*io)); + + if (!io) + return AVERROR(ENOMEM); + + io->filter_ctx = f; + io->pad_idx = pad_idx; + + if (label) { + io->name = av_strdup(label); + if (!io->name) { + avfilter_inout_free(&io); + return AVERROR(ENOMEM); + } + } + + append_inout(inouts, &io); + + return 0; +} + +static int link_inputs(AVFilterGraphSegment *seg, size_t idx_chain, + size_t idx_filter, AVFilterInOut **inputs) +{ + AVFilterChain *ch = seg->chains[idx_chain]; + AVFilterParams *p = ch->filters[idx_filter]; + AVFilterContext *f = p->filter; + + int ret; + + if (f->nb_inputs < p->nb_inputs) { + av_log(seg->graph, AV_LOG_ERROR, + "More input link labels specified for filter '%s' than " + "it has inputs: %u > %d\n", f->filter->name, + p->nb_inputs, f->nb_inputs); + return AVERROR(EINVAL); + } + + for (unsigned in = 0; in < f->nb_inputs; in++) { + const char *label = (in < p->nb_inputs) ? p->inputs[in]->label : NULL; + + // skip already linked inputs + if (f->inputs[in]) + continue; + + if (label) { + AVFilterParams *po = NULL; + unsigned idx = find_linklabel(seg, label, 1, idx_chain, idx_filter, &po); + + if (po) { + ret = avfilter_link(po->filter, idx, f, in); + if (ret < 0) + return ret; + + continue; + } + } + + ret = inout_add(inputs, f, in, label); + if (ret < 0) + return ret; + } + + return 0; +} + +static int link_outputs(AVFilterGraphSegment *seg, size_t idx_chain, + size_t idx_filter, AVFilterInOut **outputs) +{ + AVFilterChain *ch = seg->chains[idx_chain]; + AVFilterParams *p = ch->filters[idx_filter]; + AVFilterContext *f = p->filter; + + int ret; + + if (f->nb_outputs < p->nb_outputs) { + av_log(seg->graph, AV_LOG_ERROR, + "More output link labels specified for filter '%s' than " + "it has outputs: %u > %d\n", f->filter->name, + p->nb_outputs, f->nb_outputs); + return AVERROR(EINVAL); + } + for (unsigned out = 0; out < f->nb_outputs; out++) { + char *label = (out < p->nb_outputs) ? p->outputs[out]->label : NULL; + + // skip already linked outputs + if (f->outputs[out]) + continue; + + if (label) { + AVFilterParams *po = NULL; + unsigned idx = find_linklabel(seg, label, 0, idx_chain, idx_filter, &po); + + if (po) { + ret = avfilter_link(f, out, po->filter, idx); + if (ret < 0) + return ret; + + continue; + } + } + + // if this output is unlabeled, try linking it to an unlabeled + // input in the next non-disabled filter in the chain + for (size_t i = idx_filter + 1; i < ch->nb_filters && !label; i++) { + AVFilterParams *p_next = ch->filters[i]; + + if (!p_next->filter) + continue; + + for (unsigned in = 0; in < p_next->filter->nb_inputs; in++) { + if (!p_next->filter->inputs[in] && + (in >= p_next->nb_inputs || !p_next->inputs[in]->label)) { + ret = avfilter_link(f, out, p_next->filter, in); + if (ret < 0) + return ret; + + goto cont; + } + } + break; + } + + ret = inout_add(outputs, f, out, label); + if (ret < 0) + return ret; + +cont:; + } + + return 0; +} + +int avfilter_graph_segment_link(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs) +{ + int ret; + + *inputs = NULL; + *outputs = NULL; + + if (flags) + return AVERROR(ENOSYS); + + for (size_t idx_chain = 0; idx_chain < seg->nb_chains; idx_chain++) { + AVFilterChain *ch = seg->chains[idx_chain]; + + for (size_t idx_filter = 0; idx_filter < ch->nb_filters; idx_filter++) { + AVFilterParams *p = ch->filters[idx_filter]; + + if (p->filter_name) { + ret = fail_creation_pending(seg, p->filter_name, __func__); + goto fail; + } + + if (!p->filter) + continue; + + ret = link_inputs(seg, idx_chain, idx_filter, inputs); + if (ret < 0) + goto fail; + + ret = link_outputs(seg, idx_chain, idx_filter, outputs); + if (ret < 0) + goto fail; + } + } + return 0; +fail: + avfilter_inout_free(inputs); + avfilter_inout_free(outputs); + return ret; +} + +int avfilter_graph_segment_apply(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs) +{ + int ret; + + if (flags) + return AVERROR(ENOSYS); + + ret = avfilter_graph_segment_create_filters(seg, 0); + if (ret < 0) { + av_log(seg->graph, AV_LOG_ERROR, "Error creating filters\n"); + return ret; + } + + ret = avfilter_graph_segment_apply_opts(seg, 0); + if (ret < 0) { + av_log(seg->graph, AV_LOG_ERROR, "Error applying filter options\n"); + return ret; + } + + ret = avfilter_graph_segment_init(seg, 0); + if (ret < 0) { + av_log(seg->graph, AV_LOG_ERROR, "Error initializing filters\n"); + return ret; + } + + ret = avfilter_graph_segment_link(seg, 0, inputs, outputs); + if (ret < 0) { + av_log(seg->graph, AV_LOG_ERROR, "Error linking filters\n"); + return ret; + } + + return 0; +} + +int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, + AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, + void *log_ctx) +{ + AVFilterInOut *user_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL; + AVFilterInOut *user_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL; + + AVFilterInOut *inputs = NULL, *outputs = NULL; + AVFilterGraphSegment *seg = NULL; + AVFilterChain *ch; + AVFilterParams *p; + int ret; + + ret = avfilter_graph_segment_parse(graph, filters, 0, &seg); + if (ret < 0) goto end; + + ret = avfilter_graph_segment_create_filters(seg, 0); + if (ret < 0) + goto end; + + ret = avfilter_graph_segment_apply_opts(seg, 0); + if (ret < 0) + goto end; + + ret = avfilter_graph_segment_init(seg, 0); + if (ret < 0) + goto end; + + /* First input pad, assume it is "[in]" if not specified */ + p = seg->chains[0]->filters[0]; + if (p->filter->nb_inputs == 1 && !p->inputs) { + const char *tmp = "[in]"; + + ret = linklabels_parse(graph, &tmp, &p->inputs, &p->nb_inputs); + if (ret < 0) + goto end; } - if (curr_inputs) { - /* Last output pad, assume it is "[out]" if not specified */ + /* Last output pad, assume it is "[out]" if not specified */ + ch = seg->chains[seg->nb_chains - 1]; + p = ch->filters[ch->nb_filters - 1]; + if (p->filter->nb_outputs == 1 && !p->outputs) { const char *tmp = "[out]"; - if ((ret = parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs, - log_ctx)) < 0) + + ret = linklabels_parse(graph, &tmp, &p->outputs, &p->nb_outputs); + if (ret < 0) goto end; } + ret = avfilter_graph_segment_apply(seg, 0, &inputs, &outputs); + avfilter_graph_segment_free(&seg); + if (ret < 0) + goto end; + + // process user-supplied inputs/outputs + while (inputs) { + AVFilterInOut *cur, *match = NULL; + + cur = inputs; + inputs = cur->next; + cur->next = NULL; + + if (cur->name) + match = extract_inout(cur->name, &user_outputs); + + if (match) { + ret = avfilter_link(match->filter_ctx, match->pad_idx, + cur->filter_ctx, cur->pad_idx); + avfilter_inout_free(&match); + avfilter_inout_free(&cur); + if (ret < 0) + goto end; + } else + append_inout(&user_inputs, &cur); + } + while (outputs) { + AVFilterInOut *cur, *match = NULL; + + cur = outputs; + outputs = cur->next; + cur->next = NULL; + + if (cur->name) + match = extract_inout(cur->name, &user_inputs); + + if (match) { + ret = avfilter_link(cur->filter_ctx, cur->pad_idx, + match->filter_ctx, match->pad_idx); + avfilter_inout_free(&match); + avfilter_inout_free(&cur); + if (ret < 0) + goto end; + } else + append_inout(&user_outputs, &cur); + } + end: - /* clear open_in/outputs only if not passed as parameters */ - if (open_inputs_ptr) *open_inputs_ptr = open_inputs; - else avfilter_inout_free(&open_inputs); - if (open_outputs_ptr) *open_outputs_ptr = open_outputs; - else avfilter_inout_free(&open_outputs); - avfilter_inout_free(&curr_inputs); + avfilter_graph_segment_free(&seg); if (ret < 0) { while (graph->nb_filters) avfilter_free(graph->filters[0]); av_freep(&graph->filters); } + + /* clear open_in/outputs only if not passed as parameters */ + if (open_inputs_ptr) *open_inputs_ptr = user_inputs; + else avfilter_inout_free(&user_inputs); + if (open_outputs_ptr) *open_outputs_ptr = user_outputs; + else avfilter_inout_free(&user_outputs); + + avfilter_inout_free(&inputs); + avfilter_inout_free(&outputs); + return ret; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -137,6 +137,10 @@ struct AVFilterInternal { avfilter_execute_func *execute; + + // 1 when avfilter_init_*() was successfully called on this filter + // 0 otherwise + int initialized; }; static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, @@ -256,8 +260,6 @@ */ void ff_avfilter_link_set_out_status(AVFilterLink *link, int status, int64_t pts); -void ff_command_queue_pop(AVFilterContext *filter); - #define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) @@ -266,9 +268,11 @@ #define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func) -char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms); - +#ifdef TRACE void ff_tlog_link(void *ctx, AVFilterLink *link, int end); +#else +#define ff_tlog_link(ctx, link, end) do { } while(0) +#endif /** * Append a new input/output pad to the filter's list of such pads. @@ -405,4 +409,17 @@ int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, int default_pool_size); +/** + * Parse filter options into a dictionary. + * + * @param logctx context for logging + * @param priv_class a filter's private class for shorthand options or NULL + * @param options dictionary to store parsed options in + * @param args options string to parse + * + * @return a non-negative number on success, a negative error code on failure + */ +int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, + AVDictionary **options, const char *args); + #endif /* AVFILTER_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -48,6 +48,7 @@ OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o OBJS-$(CONFIG_ADENORM_FILTER) += af_adenorm.o OBJS-$(CONFIG_ADERIVATIVE_FILTER) += af_aderivative.o +OBJS-$(CONFIG_ADRC_FILTER) += af_adrc.o OBJS-$(CONFIG_ADYNAMICEQUALIZER_FILTER) += af_adynamicequalizer.o OBJS-$(CONFIG_ADYNAMICSMOOTH_FILTER) += af_adynamicsmooth.o OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o @@ -170,6 +171,7 @@ OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o OBJS-$(CONFIG_AEVALSRC_FILTER) += aeval.o +OBJS-$(CONFIG_AFDELAYSRC_FILTER) += asrc_afdelaysrc.o OBJS-$(CONFIG_AFIRSRC_FILTER) += asrc_afirsrc.o OBJS-$(CONFIG_ANOISESRC_FILTER) += asrc_anoisesrc.o OBJS-$(CONFIG_ANULLSRC_FILTER) += asrc_anullsrc.o @@ -191,9 +193,11 @@ OBJS-$(CONFIG_AVGBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ opencl/avgblur.o boxblur.o OBJS-$(CONFIG_AVGBLUR_VULKAN_FILTER) += vf_avgblur_vulkan.o vulkan.o vulkan_filter.o +OBJS-$(CONFIG_BACKGROUNDKEY_FILTER) += vf_backgroundkey.o OBJS-$(CONFIG_BBOX_FILTER) += bbox.o vf_bbox.o OBJS-$(CONFIG_BENCH_FILTER) += f_bench.o OBJS-$(CONFIG_BILATERAL_FILTER) += vf_bilateral.o +OBJS-$(CONFIG_BILATERAL_CUDA_FILTER) += vf_bilateral_cuda.o vf_bilateral_cuda.ptx.o OBJS-$(CONFIG_BITPLANENOISE_FILTER) += vf_bitplanenoise.o OBJS-$(CONFIG_BLACKDETECT_FILTER) += vf_blackdetect.o OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o @@ -229,6 +233,9 @@ OBJS-$(CONFIG_COLORMAP_FILTER) += vf_colormap.o OBJS-$(CONFIG_COLORMATRIX_FILTER) += vf_colormatrix.o OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspacedsp.o +OBJS-$(CONFIG_COLORSPACE_CUDA_FILTER) += vf_colorspace_cuda.o \ + vf_colorspace_cuda.ptx.o \ + cuda/load_helper.o OBJS-$(CONFIG_COLORTEMPERATURE_FILTER) += vf_colortemperature.o OBJS-$(CONFIG_CONVOLUTION_FILTER) += vf_convolution.o OBJS-$(CONFIG_CONVOLUTION_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ @@ -236,6 +243,7 @@ OBJS-$(CONFIG_CONVOLVE_FILTER) += vf_convolve.o framesync.o OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o OBJS-$(CONFIG_COREIMAGE_FILTER) += vf_coreimage.o +OBJS-$(CONFIG_CORR_FILTER) += vf_corr.o framesync.o OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o @@ -252,7 +260,7 @@ OBJS-$(CONFIG_DEDOT_FILTER) += vf_dedot.o OBJS-$(CONFIG_DEFLATE_FILTER) += vf_neighbor.o OBJS-$(CONFIG_DEFLICKER_FILTER) += vf_deflicker.o -OBJS-$(CONFIG_DEINTERLACE_QSV_FILTER) += vf_deinterlace_qsv.o +OBJS-$(CONFIG_DEINTERLACE_QSV_FILTER) += vf_vpp_qsv.o OBJS-$(CONFIG_DEINTERLACE_VAAPI_FILTER) += vf_deinterlace_vaapi.o vaapi_vpp.o OBJS-$(CONFIG_DEJUDDER_FILTER) += vf_dejudder.o OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o @@ -396,8 +404,8 @@ OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o OBJS-$(CONFIG_PAD_FILTER) += vf_pad.o OBJS-$(CONFIG_PAD_OPENCL_FILTER) += vf_pad_opencl.o opencl.o opencl/pad.o -OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o -OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o +OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o palette.o +OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o palette.o OBJS-$(CONFIG_PERMS_FILTER) += f_perms.o OBJS-$(CONFIG_PERSPECTIVE_FILTER) += vf_perspective.o OBJS-$(CONFIG_PHASE_FILTER) += vf_phase.o @@ -438,7 +446,7 @@ OBJS-$(CONFIG_SCALE_CUDA_FILTER) += vf_scale_cuda.o scale_eval.o \ vf_scale_cuda.ptx.o cuda/load_helper.o OBJS-$(CONFIG_SCALE_NPP_FILTER) += vf_scale_npp.o scale_eval.o -OBJS-$(CONFIG_SCALE_QSV_FILTER) += vf_scale_qsv.o +OBJS-$(CONFIG_SCALE_QSV_FILTER) += vf_vpp_qsv.o OBJS-$(CONFIG_SCALE_VAAPI_FILTER) += vf_scale_vaapi.o scale_eval.o vaapi_vpp.o OBJS-$(CONFIG_SCALE_VULKAN_FILTER) += vf_scale_vulkan.o vulkan.o vulkan_filter.o OBJS-$(CONFIG_SCALE2REF_FILTER) += vf_scale.o scale_eval.o @@ -478,6 +486,7 @@ OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o qp_table.o OBJS-$(CONFIG_SR_FILTER) += vf_sr.o OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o +OBJS-$(CONFIG_SSIM360_FILTER) += vf_ssim360.o framesync.o OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o framesync.o OBJS-$(CONFIG_SUBTITLES_FILTER) += vf_subtitles.o @@ -549,6 +558,12 @@ OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o +OBJS-$(CONFIG_HSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o +OBJS-$(CONFIG_VSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o +OBJS-$(CONFIG_XSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o +OBJS-$(CONFIG_HSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o +OBJS-$(CONFIG_VSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o +OBJS-$(CONFIG_XSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o @@ -557,6 +572,7 @@ OBJS-$(CONFIG_COLORCHART_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_COLORSPECTRUM_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_COREIMAGESRC_FILTER) += vf_coreimage.o +OBJS-$(CONFIG_DDAGRAB_FILTER) += vsrc_ddagrab.o OBJS-$(CONFIG_FREI0R_SRC_FILTER) += vf_frei0r.o OBJS-$(CONFIG_GRADIENTS_FILTER) += vsrc_gradients.o OBJS-$(CONFIG_HALDCLUTSRC_FILTER) += vsrc_testsrc.o @@ -578,6 +594,7 @@ OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o # multimedia filters +OBJS-$(CONFIG_A3DSCOPE_FILTER) += avf_a3dscope.o OBJS-$(CONFIG_ABITSCOPE_FILTER) += avf_abitscope.o OBJS-$(CONFIG_ADRAWGRAPH_FILTER) += f_drawgraph.o OBJS-$(CONFIG_AGRAPHMONITOR_FILTER) += f_graphmonitor.o @@ -586,6 +603,7 @@ OBJS-$(CONFIG_AVECTORSCOPE_FILTER) += avf_avectorscope.o OBJS-$(CONFIG_CONCAT_FILTER) += avf_concat.o OBJS-$(CONFIG_SHOWCQT_FILTER) += avf_showcqt.o lswsutils.o lavfutils.o +OBJS-$(CONFIG_SHOWCWT_FILTER) += avf_showcwt.o OBJS-$(CONFIG_SHOWFREQS_FILTER) += avf_showfreqs.o OBJS-$(CONFIG_SHOWSPATIAL_FILTER) += avf_showspatial.o OBJS-$(CONFIG_SHOWSPECTRUM_FILTER) += avf_showspectrum.o @@ -604,7 +622,7 @@ SHLIBOBJS += log2_tab.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o SKIPHEADERS-$(CONFIG_LCMS2) += fflcms2.h SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/opencl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/opencl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/opencl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/opencl.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,6 +19,7 @@ #include #include +#include "libavutil/file_open.h" #include "libavutil/mem.h" #include "libavutil/pixdesc.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2020 Björn Ottosson + * Copyright (c) 2022 Clément Bœsch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/common.h" +#include "palette.h" + +#define K ((1 << 16) - 1) +#define K2 ((int64_t)K*K) +#define P ((1 << 9) - 1) + +/** + * Table mapping formula: + * f(x) = x < 0.04045 ? x/12.92 : ((x+0.055)/1.055)^2.4 (sRGB EOTF) + * Where x is the normalized index in the table and f(x) the value in the table. + * f(x) is remapped to [0;K] and rounded. + */ +static const uint16_t srgb2linear[256] = { + 0x0000, 0x0014, 0x0028, 0x003c, 0x0050, 0x0063, 0x0077, 0x008b, + 0x009f, 0x00b3, 0x00c7, 0x00db, 0x00f1, 0x0108, 0x0120, 0x0139, + 0x0154, 0x016f, 0x018c, 0x01ab, 0x01ca, 0x01eb, 0x020e, 0x0232, + 0x0257, 0x027d, 0x02a5, 0x02ce, 0x02f9, 0x0325, 0x0353, 0x0382, + 0x03b3, 0x03e5, 0x0418, 0x044d, 0x0484, 0x04bc, 0x04f6, 0x0532, + 0x056f, 0x05ad, 0x05ed, 0x062f, 0x0673, 0x06b8, 0x06fe, 0x0747, + 0x0791, 0x07dd, 0x082a, 0x087a, 0x08ca, 0x091d, 0x0972, 0x09c8, + 0x0a20, 0x0a79, 0x0ad5, 0x0b32, 0x0b91, 0x0bf2, 0x0c55, 0x0cba, + 0x0d20, 0x0d88, 0x0df2, 0x0e5e, 0x0ecc, 0x0f3c, 0x0fae, 0x1021, + 0x1097, 0x110e, 0x1188, 0x1203, 0x1280, 0x1300, 0x1381, 0x1404, + 0x1489, 0x1510, 0x159a, 0x1625, 0x16b2, 0x1741, 0x17d3, 0x1866, + 0x18fb, 0x1993, 0x1a2c, 0x1ac8, 0x1b66, 0x1c06, 0x1ca7, 0x1d4c, + 0x1df2, 0x1e9a, 0x1f44, 0x1ff1, 0x20a0, 0x2150, 0x2204, 0x22b9, + 0x2370, 0x242a, 0x24e5, 0x25a3, 0x2664, 0x2726, 0x27eb, 0x28b1, + 0x297b, 0x2a46, 0x2b14, 0x2be3, 0x2cb6, 0x2d8a, 0x2e61, 0x2f3a, + 0x3015, 0x30f2, 0x31d2, 0x32b4, 0x3399, 0x3480, 0x3569, 0x3655, + 0x3742, 0x3833, 0x3925, 0x3a1a, 0x3b12, 0x3c0b, 0x3d07, 0x3e06, + 0x3f07, 0x400a, 0x4110, 0x4218, 0x4323, 0x4430, 0x453f, 0x4651, + 0x4765, 0x487c, 0x4995, 0x4ab1, 0x4bcf, 0x4cf0, 0x4e13, 0x4f39, + 0x5061, 0x518c, 0x52b9, 0x53e9, 0x551b, 0x5650, 0x5787, 0x58c1, + 0x59fe, 0x5b3d, 0x5c7e, 0x5dc2, 0x5f09, 0x6052, 0x619e, 0x62ed, + 0x643e, 0x6591, 0x66e8, 0x6840, 0x699c, 0x6afa, 0x6c5b, 0x6dbe, + 0x6f24, 0x708d, 0x71f8, 0x7366, 0x74d7, 0x764a, 0x77c0, 0x7939, + 0x7ab4, 0x7c32, 0x7db3, 0x7f37, 0x80bd, 0x8246, 0x83d1, 0x855f, + 0x86f0, 0x8884, 0x8a1b, 0x8bb4, 0x8d50, 0x8eef, 0x9090, 0x9235, + 0x93dc, 0x9586, 0x9732, 0x98e2, 0x9a94, 0x9c49, 0x9e01, 0x9fbb, + 0xa179, 0xa339, 0xa4fc, 0xa6c2, 0xa88b, 0xaa56, 0xac25, 0xadf6, + 0xafca, 0xb1a1, 0xb37b, 0xb557, 0xb737, 0xb919, 0xbaff, 0xbce7, + 0xbed2, 0xc0c0, 0xc2b1, 0xc4a5, 0xc69c, 0xc895, 0xca92, 0xcc91, + 0xce94, 0xd099, 0xd2a1, 0xd4ad, 0xd6bb, 0xd8cc, 0xdae0, 0xdcf7, + 0xdf11, 0xe12e, 0xe34e, 0xe571, 0xe797, 0xe9c0, 0xebec, 0xee1b, + 0xf04d, 0xf282, 0xf4ba, 0xf6f5, 0xf933, 0xfb74, 0xfdb8, 0xffff, +}; + +/** + * Table mapping formula: + * f(x) = x < 0.0031308 ? x*12.92 : 1.055*x^(1/2.4)-0.055 (sRGB OETF) + * Where x is the normalized index in the table and f(x) the value in the table. + * f(x) is remapped to [0;0xff] and rounded. + * + * Since a 16-bit table is too large, we reduce its precision to 9-bit. + */ +static const uint8_t linear2srgb[P + 1] = { + 0x00, 0x06, 0x0d, 0x12, 0x16, 0x19, 0x1c, 0x1f, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, + 0x32, 0x33, 0x35, 0x36, 0x38, 0x39, 0x3b, 0x3c, 0x3d, 0x3e, 0x40, 0x41, 0x42, 0x43, 0x45, 0x46, + 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, + 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x5f, 0x60, 0x61, 0x62, 0x62, + 0x63, 0x64, 0x65, 0x65, 0x66, 0x67, 0x67, 0x68, 0x69, 0x6a, 0x6a, 0x6b, 0x6c, 0x6c, 0x6d, 0x6e, + 0x6e, 0x6f, 0x6f, 0x70, 0x71, 0x71, 0x72, 0x73, 0x73, 0x74, 0x74, 0x75, 0x76, 0x76, 0x77, 0x77, + 0x78, 0x79, 0x79, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7d, 0x7d, 0x7e, 0x7e, 0x7f, 0x7f, 0x80, 0x80, + 0x81, 0x81, 0x82, 0x82, 0x83, 0x84, 0x84, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x88, 0x88, 0x89, + 0x89, 0x8a, 0x8a, 0x8b, 0x8b, 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8e, 0x8e, 0x8f, 0x8f, 0x90, 0x90, + 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x93, 0x94, 0x94, 0x95, 0x95, 0x96, 0x96, 0x97, 0x97, 0x97, + 0x98, 0x98, 0x99, 0x99, 0x9a, 0x9a, 0x9a, 0x9b, 0x9b, 0x9c, 0x9c, 0x9c, 0x9d, 0x9d, 0x9e, 0x9e, + 0x9f, 0x9f, 0x9f, 0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, + 0xa5, 0xa5, 0xa6, 0xa6, 0xa6, 0xa7, 0xa7, 0xa8, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xab, + 0xab, 0xab, 0xac, 0xac, 0xac, 0xad, 0xad, 0xae, 0xae, 0xae, 0xaf, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, + 0xb1, 0xb1, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb6, 0xb6, + 0xb6, 0xb7, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xbb, 0xbb, 0xbb, + 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0, 0xc1, + 0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3, 0xc3, 0xc4, 0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9, 0xc9, 0xc9, 0xca, 0xca, 0xca, + 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc, 0xcc, 0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xce, 0xcf, 0xcf, + 0xcf, 0xd0, 0xd0, 0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, 0xd4, + 0xd4, 0xd4, 0xd4, 0xd5, 0xd5, 0xd5, 0xd6, 0xd6, 0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, + 0xd8, 0xd9, 0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xda, 0xdb, 0xdb, 0xdb, 0xdc, 0xdc, 0xdc, 0xdc, + 0xdd, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde, 0xde, 0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe0, 0xe1, + 0xe1, 0xe1, 0xe1, 0xe2, 0xe2, 0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4, 0xe4, 0xe5, + 0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7, 0xe7, 0xe7, 0xe8, 0xe8, 0xe8, 0xe8, 0xe9, + 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea, 0xea, 0xeb, 0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xec, 0xed, + 0xed, 0xed, 0xed, 0xee, 0xee, 0xee, 0xee, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf1, 0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf4, 0xf4, 0xf4, + 0xf4, 0xf5, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, 0xf7, 0xf8, 0xf8, + 0xf8, 0xf8, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, + 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, +}; + +int32_t ff_srgb_u8_to_linear_int(uint8_t x) +{ + return (int32_t)srgb2linear[x]; +} + +uint8_t ff_linear_int_to_srgb_u8(int32_t x) +{ + if (x <= 0) { + return 0; + } else if (x >= K) { + return 0xff; + } else { + const int32_t xP = x * P; + const int32_t i = xP / K; + const int32_t m = xP % K; + const int32_t y0 = linear2srgb[i]; + const int32_t y1 = linear2srgb[i + 1]; + return (m * (y1 - y0) + K/2) / K + y0; + } +} + +/* Integer cube root, working only within [0;1] */ +static int32_t cbrt01_int(int32_t x) +{ + int64_t u; + + /* Approximation curve is for the [0;1] range */ + if (x <= 0) return 0; + if (x >= K) return K; + + /* + * Initial approximation: x³ - 2.19893x² + 2.01593x + 0.219407 + * + * We are not using any rounding here since the precision is not important + * at this stage and it would require the more expensive rounding function + * that deals with negative numbers. + */ + u = x*(x*(x + -144107LL) / K + 132114LL) / K + 14379LL; + + /* + * Refine with 2 Halley iterations: + * uₙ₊₁ = uₙ-2f(uₙ)f'(uₙ)/(2f'(uₙ)²-f(uₙ)f"(uₙ)) + * = uₙ(2x+uₙ³)/(x+2uₙ³) + * + * Note: u is not expected to be < 0, so we can use the (a+b/2)/b rounding. + */ + for (int i = 0; i < 2; i++) { + const int64_t u3 = u*u*u; + const int64_t den = x + (2*u3 + K2/2) / K2; + u = (u * (2*x + (u3 + K2/2) / K2) + den/2) / den; + } + + return u; +} + +static int64_t div_round64(int64_t a, int64_t b) { return (a^b)<0 ? (a-b/2)/b : (a+b/2)/b; } + +struct Lab ff_srgb_u8_to_oklab_int(uint32_t srgb) +{ + const int32_t r = (int32_t)srgb2linear[srgb >> 16 & 0xff]; + const int32_t g = (int32_t)srgb2linear[srgb >> 8 & 0xff]; + const int32_t b = (int32_t)srgb2linear[srgb & 0xff]; + + // Note: lms can actually be slightly over K due to rounded coefficients + const int32_t l = (27015LL*r + 35149LL*g + 3372LL*b + K/2) / K; + const int32_t m = (13887LL*r + 44610LL*g + 7038LL*b + K/2) / K; + const int32_t s = ( 5787LL*r + 18462LL*g + 41286LL*b + K/2) / K; + + const int32_t l_ = cbrt01_int(l); + const int32_t m_ = cbrt01_int(m); + const int32_t s_ = cbrt01_int(s); + + const struct Lab ret = { + .L = div_round64( 13792LL*l_ + 52010LL*m_ - 267LL*s_, K), + .a = div_round64(129628LL*l_ - 159158LL*m_ + 29530LL*s_, K), + .b = div_round64( 1698LL*l_ + 51299LL*m_ - 52997LL*s_, K), + }; + + return ret; +} + +uint32_t ff_oklab_int_to_srgb_u8(struct Lab c) +{ + const int64_t l_ = c.L + div_round64(25974LL * c.a, K) + div_round64(14143LL * c.b, K); + const int64_t m_ = c.L + div_round64(-6918LL * c.a, K) + div_round64(-4185LL * c.b, K); + const int64_t s_ = c.L + div_round64(-5864LL * c.a, K) + div_round64(-84638LL * c.b, K); + + const int32_t l = l_*l_*l_ / K2; + const int32_t m = m_*m_*m_ / K2; + const int32_t s = s_*s_*s_ / K2; + + const uint8_t r = ff_linear_int_to_srgb_u8((267169LL * l + -216771LL * m + 15137LL * s + K/2) / K); + const uint8_t g = ff_linear_int_to_srgb_u8((-83127LL * l + 171030LL * m + -22368LL * s + K/2) / K); + const uint8_t b = ff_linear_int_to_srgb_u8((-275LL * l + -46099LL * m + 111909LL * s + K/2) / K); + + return r<<16 | g<<8 | b; +} + +uint32_t ff_lowbias32(uint32_t x) +{ + x ^= x >> 16; + x *= 0x7feb352d; + x ^= x >> 15; + x *= 0x846ca68b; + x ^= x >> 16; + return x; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/palette.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 Björn Ottosson + * Copyright (c) 2022 Clément Bœsch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_PALETTE_H +#define AVFILTER_PALETTE_H + +#include +#include + +#include "libavutil/attributes.h" + +struct Lab { + int32_t L, a, b; +}; + +/** + * Map sRGB 8-bit color component to a 16-bit linear value (gamma + * expand from electrical to optical value). + */ +int32_t ff_srgb_u8_to_linear_int(uint8_t x); + +/** + * Map a 16-bit linear value to a sRGB 8-bit color component (gamma + * compressed from optical to electrical value). + */ +uint8_t ff_linear_int_to_srgb_u8(int32_t x); + +/** + * sRGB (non-linear) to OkLab conversion + * @see https://bottosson.github.io/posts/oklab/ + */ +struct Lab ff_srgb_u8_to_oklab_int(uint32_t srgb); + +/** + * OkLab to sRGB (non-linear) conversion + * @see https://bottosson.github.io/posts/oklab/ + */ +uint32_t ff_oklab_int_to_srgb_u8(struct Lab c); + +/* + * lowbias32 hashing from https://nullprogram.com/blog/2018/07/31/ + */ +uint32_t ff_lowbias32(uint32_t x); + +#endif /* AVFILTER_PALETTE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/phase_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/phase_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/phase_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/phase_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,7 +46,7 @@ * * (The result is actually multiplied by 25) */ -#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) << 2) + (a)[(as) << 1] - (b)[-(bs)], (t) * (t)) +#define DIFF(a, as, b, bs) ((t) = ((*(a) - (b)[bs]) * 4) + (a)[(as) * 2] - (b)[-(bs)], (t) * (t)) /* * Find which field combination has the smallest average squared difference diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,8 +23,6 @@ #include "libavutil/common.h" #include "libavutil/mathematics.h" -#include "libavutil/hwcontext.h" -#include "libavutil/hwcontext_qsv.h" #include "libavutil/time.h" #include "libavutil/pixdesc.h" @@ -32,12 +30,22 @@ #include "qsvvpp.h" #include "video.h" +#if QSV_ONEVPL +#include +#else +#define MFXUnload(a) do { } while(0) +#endif + #define IS_VIDEO_MEMORY(mode) (mode & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | \ MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) +#if QSV_HAVE_OPAQUE #define IS_OPAQUE_MEMORY(mode) (mode & MFX_MEMTYPE_OPAQUE_FRAME) +#endif #define IS_SYSTEM_MEMORY(mode) (mode & MFX_MEMTYPE_SYSTEM_MEMORY) #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) +#define QSV_HAVE_AUDIO !QSV_ONEVPL + static const AVRational default_tb = { 1, 90000 }; typedef struct QSVAsyncFrame { @@ -51,10 +59,14 @@ } qsv_iopatterns[] = { {MFX_IOPATTERN_IN_VIDEO_MEMORY, "input is video memory surface" }, {MFX_IOPATTERN_IN_SYSTEM_MEMORY, "input is system memory surface" }, +#if QSV_HAVE_OPAQUE {MFX_IOPATTERN_IN_OPAQUE_MEMORY, "input is opaque memory surface" }, +#endif {MFX_IOPATTERN_OUT_VIDEO_MEMORY, "output is video memory surface" }, {MFX_IOPATTERN_OUT_SYSTEM_MEMORY, "output is system memory surface" }, +#if QSV_HAVE_OPAQUE {MFX_IOPATTERN_OUT_OPAQUE_MEMORY, "output is opaque memory surface" }, +#endif }; int ff_qsvvpp_print_iopattern(void *log_ctx, int mfx_iopattern, @@ -100,8 +112,12 @@ { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL), "invalid video parameters" }, { MFX_ERR_UNDEFINED_BEHAVIOR, AVERROR_BUG, "undefined behavior" }, { MFX_ERR_DEVICE_FAILED, AVERROR(EIO), "device failed" }, +#if QSV_HAVE_AUDIO { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters" }, { MFX_ERR_INVALID_AUDIO_PARAM, AVERROR(EINVAL), "invalid audio parameters" }, +#endif + { MFX_ERR_GPU_HANG, AVERROR(EIO), "GPU Hang" }, + { MFX_ERR_REALLOC_SURFACE, AVERROR_UNKNOWN, "need bigger surface for output" }, { MFX_WRN_IN_EXECUTION, 0, "operation in execution" }, { MFX_WRN_DEVICE_BUSY, 0, "device busy" }, @@ -111,7 +127,13 @@ { MFX_WRN_VALUE_NOT_CHANGED, 0, "value is saturated" }, { MFX_WRN_OUT_OF_RANGE, 0, "value out of range" }, { MFX_WRN_FILTER_SKIPPED, 0, "filter skipped" }, +#if QSV_HAVE_AUDIO { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0, "incompatible audio parameters" }, +#endif + +#if QSV_VERSION_ATLEAST(1, 31) + { MFX_ERR_NONE_PARTIAL_OUTPUT, 0, "partial output" }, +#endif }; static int qsv_map_error(mfxStatus mfx_err, const char **desc) @@ -223,6 +245,12 @@ return MFX_FOURCC_YUY2; case AV_PIX_FMT_BGRA: return MFX_FOURCC_RGB4; + case AV_PIX_FMT_P010: + return MFX_FOURCC_P010; +#if CONFIG_VAAPI + case AV_PIX_FMT_UYVY422: + return MFX_FOURCC_UYVY; +#endif } return MFX_FOURCC_NV12; @@ -252,6 +280,11 @@ surface->Data.R = frame->data[0] + 2; surface->Data.A = frame->data[0] + 3; break; + case AV_PIX_FMT_UYVY422: + surface->Data.Y = frame->data[0] + 1; + surface->Data.U = frame->data[0]; + surface->Data.V = frame->data[0] + 2; + break; default: return MFX_ERR_UNSUPPORTED; } @@ -302,6 +335,14 @@ frameinfo->CropH = link->h; frameinfo->FrameRateExtN = link->frame_rate.num; frameinfo->FrameRateExtD = link->frame_rate.den; + + /* Apparently VPP in the SDK requires the frame rate to be set to some value, otherwise + * init will fail */ + if (frameinfo->FrameRateExtD == 0 || frameinfo->FrameRateExtN == 0) { + frameinfo->FrameRateExtN = 25; + frameinfo->FrameRateExtD = 1; + } + frameinfo->AspectRatioW = link->sample_aspect_ratio.num ? link->sample_aspect_ratio.num : 1; frameinfo->AspectRatioH = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1; @@ -400,7 +441,10 @@ return NULL; } - av_frame_copy_props(qsv_frame->frame, picref); + if (av_frame_copy_props(qsv_frame->frame, picref) < 0) { + av_frame_free(&qsv_frame->frame); + return NULL; + } } else qsv_frame->frame = av_frame_clone(picref); @@ -465,15 +509,19 @@ if (!out_frame->frame) return NULL; - out_frame->frame->width = outlink->w; - out_frame->frame->height = outlink->h; - ret = map_frame_to_surface(out_frame->frame, &out_frame->surface); if (ret < 0) return NULL; } + if (outlink->frame_rate.num && outlink->frame_rate.den) + out_frame->frame->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + else + out_frame->frame->duration = 0; + + out_frame->frame->width = outlink->w; + out_frame->frame->height = outlink->h; out_frame->surface.Info = s->vpp_param.vpp.Out; return out_frame; @@ -530,9 +578,13 @@ if (!out_frames_ref) return AVERROR(ENOMEM); +#if QSV_HAVE_OPAQUE s->out_mem_mode = IS_OPAQUE_MEMORY(s->in_mem_mode) ? MFX_MEMTYPE_OPAQUE_FRAME : MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_FROM_VPPOUT; +#else + s->out_mem_mode = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_FROM_VPPOUT; +#endif out_frames_ctx = (AVHWFramesContext *)out_frames_ref->data; out_frames_hwctx = out_frames_ctx->hwctx; @@ -598,13 +650,10 @@ } /* create a "slave" session with those same properties, to be used for vpp */ - ret = MFXInit(impl, &ver, &s->session); - if (ret < 0) - return ff_qsvvpp_print_error(avctx, ret, "Error initializing a session"); - else if (ret > 0) { - ff_qsvvpp_print_warning(avctx, ret, "Warning in session initialization"); - return AVERROR_UNKNOWN; - } + ret = ff_qsvvpp_create_mfx_session(avctx, device_hwctx->loader, impl, &ver, + &s->session); + if (ret) + return ret; if (handle) { ret = MFXVideoCORE_SetHandle(s->session, handle_type, handle); @@ -618,6 +667,7 @@ return AVERROR_UNKNOWN; } +#if QSV_HAVE_OPAQUE if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode)) { s->opaque_alloc.In.Surfaces = s->surface_ptrs_in; s->opaque_alloc.In.NumSurface = s->nb_surface_ptrs_in; @@ -629,7 +679,9 @@ s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION; s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc); - } else if (IS_VIDEO_MEMORY(s->in_mem_mode) || IS_VIDEO_MEMORY(s->out_mem_mode)) { + } else +#endif + if (IS_VIDEO_MEMORY(s->in_mem_mode) || IS_VIDEO_MEMORY(s->out_mem_mode)) { mfxFrameAllocator frame_allocator = { .pthis = s, .Alloc = frame_alloc, @@ -647,15 +699,11 @@ return 0; } -int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *param) +int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param) { int i; int ret; - QSVVPPContext *s; - - s = av_mallocz(sizeof(*s)); - if (!s) - return AVERROR(ENOMEM); + QSVVPPContext *s = avctx->priv; s->filter_frame = param->filter_frame; if (!s->filter_frame) @@ -701,6 +749,7 @@ goto failed; } +#if QSV_HAVE_OPAQUE if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode)) { s->nb_ext_buffers = param->num_ext_buf + 1; s->ext_buffers = av_calloc(s->nb_ext_buffers, sizeof(*s->ext_buffers)); @@ -718,32 +767,39 @@ s->vpp_param.NumExtParam = param->num_ext_buf; s->vpp_param.ExtParam = param->ext_buf; } +#else + s->vpp_param.NumExtParam = param->num_ext_buf; + s->vpp_param.ExtParam = param->ext_buf; +#endif s->got_frame = 0; /** keep fifo size at least 1. Even when async_depth is 0, fifo is used. */ - s->async_fifo = av_fifo_alloc2(param->async_depth + 1, sizeof(QSVAsyncFrame), 0); - s->async_depth = param->async_depth; + s->async_fifo = av_fifo_alloc2(s->async_depth + 1, sizeof(QSVAsyncFrame), 0); if (!s->async_fifo) { ret = AVERROR(ENOMEM); goto failed; } - s->vpp_param.AsyncDepth = param->async_depth; + s->vpp_param.AsyncDepth = s->async_depth; if (IS_SYSTEM_MEMORY(s->in_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_IN_SYSTEM_MEMORY; else if (IS_VIDEO_MEMORY(s->in_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_IN_VIDEO_MEMORY; +#if QSV_HAVE_OPAQUE else if (IS_OPAQUE_MEMORY(s->in_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_IN_OPAQUE_MEMORY; +#endif if (IS_SYSTEM_MEMORY(s->out_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_OUT_SYSTEM_MEMORY; else if (IS_VIDEO_MEMORY(s->out_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_OUT_VIDEO_MEMORY; +#if QSV_HAVE_OPAQUE else if (IS_OPAQUE_MEMORY(s->out_mem_mode)) s->vpp_param.IOPattern |= MFX_IOPATTERN_OUT_OPAQUE_MEMORY; +#endif /* Print input memory mode */ ff_qsvvpp_print_iopattern(avctx, s->vpp_param.IOPattern & 0x0F, "VPP"); @@ -756,25 +812,22 @@ } else if (ret > 0) ff_qsvvpp_print_warning(avctx, ret, "Warning When creating qsvvpp"); - *vpp = s; return 0; failed: - ff_qsvvpp_free(&s); + ff_qsvvpp_close(avctx); return ret; } -int ff_qsvvpp_free(QSVVPPContext **vpp) +int ff_qsvvpp_close(AVFilterContext *avctx) { - QSVVPPContext *s = *vpp; - - if (!s) - return 0; + QSVVPPContext *s = avctx->priv; if (s->session) { MFXVideoVPP_Close(s->session); MFXClose(s->session); + s->session = NULL; } /* release all the resources */ @@ -782,10 +835,11 @@ clear_frame_list(&s->out_frame_list); av_freep(&s->surface_ptrs_in); av_freep(&s->surface_ptrs_out); +#if QSV_HAVE_OPAQUE av_freep(&s->ext_buffers); +#endif av_freep(&s->frame_infos); av_fifo_freep2(&s->async_fifo); - av_freep(vpp); return 0; } @@ -797,7 +851,7 @@ QSVAsyncFrame aframe; mfxSyncPoint sync; QSVFrame *in_frame, *out_frame; - int ret, filter_ret; + int ret, ret1, filter_ret; while (s->eof && av_fifo_read(s->async_fifo, &aframe, 1) >= 0) { if (MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000) < 0) @@ -854,8 +908,13 @@ av_fifo_read(s->async_fifo, &aframe, 1); do { - ret = MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000); - } while (ret == MFX_WRN_IN_EXECUTION); + ret1 = MFXVideoCORE_SyncOperation(s->session, aframe.sync, 1000); + } while (ret1 == MFX_WRN_IN_EXECUTION); + + if (ret1 < 0) { + ret = ret1; + break; + } filter_ret = s->filter_frame(outlink, aframe.frame->frame); if (filter_ret < 0) { @@ -876,3 +935,106 @@ return 0; } + +#if QSV_ONEVPL + +int ff_qsvvpp_create_mfx_session(void *ctx, + void *loader, + mfxIMPL implementation, + mfxVersion *pver, + mfxSession *psession) +{ + mfxStatus sts; + mfxSession session = NULL; + uint32_t impl_idx = 0; + + av_log(ctx, AV_LOG_VERBOSE, + "Use Intel(R) oneVPL to create MFX session with the specified MFX loader\n"); + + if (!loader) { + av_log(ctx, AV_LOG_ERROR, "Invalid MFX Loader handle\n"); + return AVERROR(EINVAL); + } + + while (1) { + /* Enumerate all implementations */ + mfxImplDescription *impl_desc; + + sts = MFXEnumImplementations(loader, impl_idx, + MFX_IMPLCAPS_IMPLDESCSTRUCTURE, + (mfxHDL *)&impl_desc); + /* Failed to find an available implementation */ + if (sts == MFX_ERR_NOT_FOUND) + break; + else if (sts != MFX_ERR_NONE) { + impl_idx++; + continue; + } + + sts = MFXCreateSession(loader, impl_idx, &session); + MFXDispReleaseImplDescription(loader, impl_desc); + if (sts == MFX_ERR_NONE) + break; + + impl_idx++; + } + + if (sts < 0) + return ff_qsvvpp_print_error(ctx, sts, + "Error creating a MFX session"); + else if (sts > 0) { + ff_qsvvpp_print_warning(ctx, sts, + "Warning in MFX session creation"); + return AVERROR_UNKNOWN; + } + + *psession = session; + + return 0; +} + +#else + +int ff_qsvvpp_create_mfx_session(void *ctx, + void *loader, + mfxIMPL implementation, + mfxVersion *pver, + mfxSession *psession) +{ + mfxSession session = NULL; + mfxStatus sts; + + av_log(ctx, AV_LOG_VERBOSE, + "Use Intel(R) Media SDK to create MFX session, API version is " + "%d.%d, the required implementation version is %d.%d\n", + MFX_VERSION_MAJOR, MFX_VERSION_MINOR, pver->Major, pver->Minor); + + *psession = NULL; + sts = MFXInit(implementation, pver, &session); + if (sts < 0) + return ff_qsvvpp_print_error(ctx, sts, + "Error initializing an MFX session"); + else if (sts > 0) { + ff_qsvvpp_print_warning(ctx, sts, "Warning in MFX session initialization"); + return AVERROR_UNKNOWN; + } + + *psession = session; + + return 0; +} + +#endif + +AVFrame *ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h) +{ + /* When process YUV420 frames, FFmpeg uses same alignment on Y/U/V + * planes. VPL and MSDK use Y plane's pitch / 2 as U/V planes's + * pitch, which makes U/V planes 16-bytes aligned. We need to set a + * separate alignment to meet runtime's behaviour. + */ + return ff_default_get_video_buffer2(inlink, + FFALIGN(inlink->w, 32), + FFALIGN(inlink->h, 32), + 16); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/qsvvpp.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,10 +24,12 @@ #ifndef AVFILTER_QSVVPP_H #define AVFILTER_QSVVPP_H -#include +#include #include "avfilter.h" #include "libavutil/fifo.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_qsv.h" #define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads)) #define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads)) @@ -40,6 +42,9 @@ ((MFX_VERSION.Major > (MAJOR)) || \ (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR))) +#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) +#define QSV_HAVE_OPAQUE !QSV_ONEVPL + typedef struct QSVFrame { AVFrame *frame; mfxFrameSurface1 surface; @@ -48,6 +53,8 @@ } QSVFrame; typedef struct QSVVPPContext { + const AVClass *class; + mfxSession session; int (*filter_frame) (AVFilterLink *outlink, AVFrame *frame); /**< callback */ enum AVPixelFormat out_sw_format; /**< Real output format */ @@ -64,10 +71,12 @@ mfxFrameSurface1 **surface_ptrs_in; mfxFrameSurface1 **surface_ptrs_out; +#if QSV_HAVE_OPAQUE /** MFXVPP extern parameters */ mfxExtOpaqueSurfaceAlloc opaque_alloc; mfxExtBuffer **ext_buffers; int nb_ext_buffers; +#endif int got_frame; int async_depth; @@ -95,15 +104,13 @@ /* Crop information for each input, if needed */ int num_crop; QSVVPPCrop *crop; - - int async_depth; } QSVVPPParam; /* create and initialize the QSV session */ -int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *param); +int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param); /* release the resources (eg.surfaces) */ -int ff_qsvvpp_free(QSVVPPContext **vpp); +int ff_qsvvpp_close(AVFilterContext *avctx); /* vpp filter frame and call the cb if needed */ int ff_qsvvpp_filter_frame(QSVVPPContext *vpp, AVFilterLink *inlink, AVFrame *frame); @@ -117,4 +124,8 @@ int ff_qsvvpp_print_warning(void *log_ctx, mfxStatus err, const char *warning_string); +int ff_qsvvpp_create_mfx_session(void *ctx, void *loader, mfxIMPL implementation, + mfxVersion *pver, mfxSession *psession); + +AVFrame *ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h); #endif /* AVFILTER_QSVVPP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.c 2023-03-03 13:29:59.000000000 +0000 @@ -148,14 +148,17 @@ * dimensions so that it is not divisible by the set factors anymore * unless force_divisible_by is defined as well */ if (force_original_aspect_ratio) { - int tmp_w = av_rescale(h, inlink->w, inlink->h); - int tmp_h = av_rescale(w, inlink->h, inlink->w); + // Including force_divisible_by here rounds to the nearest multiple of it. + int tmp_w = av_rescale(h, inlink->w, inlink->h * (int64_t)force_divisible_by) + * force_divisible_by; + int tmp_h = av_rescale(w, inlink->h, inlink->w * (int64_t)force_divisible_by) + * force_divisible_by; if (force_original_aspect_ratio == 1) { w = FFMIN(tmp_w, w); h = FFMIN(tmp_h, h); if (force_divisible_by > 1) { - // round down + // round down in case provided w or h is not divisible. w = w / force_divisible_by * force_divisible_by; h = h / force_divisible_by * force_divisible_by; } @@ -163,7 +166,7 @@ w = FFMAX(tmp_w, w); h = FFMAX(tmp_h, h); if (force_divisible_by > 1) { - // round up + // round up in case provided w or h is not divisible. w = (w + force_divisible_by - 1) / force_divisible_by * force_divisible_by; h = (h + force_divisible_by - 1) / force_divisible_by * force_divisible_by; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/scale_eval.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,8 @@ * Transform evaluated width and height obtained from ff_scale_eval_dimensions * into actual target width and height for scaling. Adjustment can occur if one * or both of the evaluated values are of the form '-n' or if - * force_original_aspect_ratio is set. + * force_original_aspect_ratio is set. force_divisible_by is used only when + * force_original_aspect_ratio is set and must be at least 1. * * Returns 0. */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/settb.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/settb.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/settb.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/settb.c 2023-03-03 13:29:59.000000000 +0000 @@ -128,6 +128,7 @@ AVFilterLink *outlink = ctx->outputs[0]; frame->pts = rescale_pts(inlink, outlink, frame->pts); + frame->duration = av_rescale_q(frame->duration, inlink->time_base, outlink->time_base); return ff_filter_frame(outlink, frame); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_avsynctest.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_avsynctest.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_avsynctest.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_avsynctest.c 2023-03-03 13:29:59.000000000 +0000 @@ -348,6 +348,7 @@ } out->pts = s->vpts++; + out->duration = 1; return ff_filter_frame(outlink, out); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_movie.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_movie.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_movie.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/src_movie.c 2023-03-03 13:29:59.000000000 +0000 @@ -196,11 +196,11 @@ av_channel_layout_default(&chl, dec_par->ch_layout.nb_channels); if (!KNOWN(&chl)) { - av_log(log_ctx, AV_LOG_ERROR, + av_log(log_ctx, AV_LOG_WARNING, "Channel layout is not set in stream %d, and could not " "be guessed from the number of channels (%d)\n", st_index, dec_par->ch_layout.nb_channels); - return AVERROR(EINVAL); + return av_channel_layout_copy(&dec_par->ch_layout, &chl); } av_channel_layout_describe(&chl, buf, sizeof(buf)); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,355 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define OFFSET(x) offsetof(StackHWContext, x) +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM) + +#define SET_OUTPUT_REGION(region, rx, ry, rw, rh) do { \ + region->x = rx; \ + region->y = ry; \ + region->width = rw; \ + region->height = rh; \ + } while (0) + +static int init_framesync(AVFilterContext *avctx) +{ + StackBaseContext *sctx = avctx->priv; + int ret; + + ret = ff_framesync_init(&sctx->fs, avctx, avctx->nb_inputs); + if (ret < 0) + return ret; + + sctx->fs.on_event = process_frame; + sctx->fs.opaque = sctx; + + for (int i = 0; i < sctx->nb_inputs; i++) { + FFFrameSyncIn *in = &sctx->fs.in[i]; + + in->before = EXT_STOP; + in->after = sctx->shortest ? EXT_STOP : EXT_INFINITY; + in->sync = 1; + in->time_base = avctx->inputs[i]->time_base; + } + + return ff_framesync_configure(&sctx->fs); +} + +static int config_comm_output(AVFilterLink *outlink) +{ + AVFilterContext *avctx = outlink->src; + StackBaseContext *sctx = avctx->priv; + AVFilterLink *inlink0 = avctx->inputs[0]; + int width, height, ret; + + if (sctx->mode == STACK_H) { + height = sctx->tile_height; + width = 0; + + if (!height) + height = inlink0->h; + + for (int i = 0; i < sctx->nb_inputs; i++) { + AVFilterLink *inlink = avctx->inputs[i]; + StackItemRegion *region = &sctx->regions[i]; + + SET_OUTPUT_REGION(region, width, 0, av_rescale(height, inlink->w, inlink->h), height); + width += av_rescale(height, inlink->w, inlink->h); + } + } else if (sctx->mode == STACK_V) { + height = 0; + width = sctx->tile_width; + + if (!width) + width = inlink0->w; + + for (int i = 0; i < sctx->nb_inputs; i++) { + AVFilterLink *inlink = avctx->inputs[i]; + StackItemRegion *region = &sctx->regions[i]; + + SET_OUTPUT_REGION(region, 0, height, width, av_rescale(width, inlink->h, inlink->w)); + height += av_rescale(width, inlink->h, inlink->w); + } + } else if (sctx->nb_grid_rows && sctx->nb_grid_columns) { + int xpos = 0, ypos = 0; + int ow, oh, k = 0; + + ow = sctx->tile_width; + oh = sctx->tile_height; + + if (!ow || !oh) { + ow = avctx->inputs[0]->w; + oh = avctx->inputs[0]->h; + } + + for (int i = 0; i < sctx->nb_grid_columns; i++) { + ypos = 0; + + for (int j = 0; j < sctx->nb_grid_rows; j++) { + StackItemRegion *region = &sctx->regions[k++]; + + SET_OUTPUT_REGION(region, xpos, ypos, ow, oh); + ypos += oh; + } + + xpos += ow; + } + + width = ow * sctx->nb_grid_columns; + height = oh * sctx->nb_grid_rows; + } else { + char *arg, *p = sctx->layout, *saveptr = NULL; + char *arg2, *p2, *saveptr2 = NULL; + char *arg3, *p3, *saveptr3 = NULL; + int xpos, ypos, size; + int ow, oh; + + width = 0; + height = 0; + + for (int i = 0; i < sctx->nb_inputs; i++) { + AVFilterLink *inlink = avctx->inputs[i]; + StackItemRegion *region = &sctx->regions[i]; + + ow = inlink->w; + oh = inlink->h; + + if (!(arg = av_strtok(p, "|", &saveptr))) + return AVERROR(EINVAL); + + p = NULL; + p2 = arg; + xpos = ypos = 0; + + for (int j = 0; j < 3; j++) { + if (!(arg2 = av_strtok(p2, "_", &saveptr2))) { + if (j == 2) + break; + else + return AVERROR(EINVAL); + } + + p2 = NULL; + p3 = arg2; + + if (j == 2) { + if ((ret = av_parse_video_size(&ow, &oh, p3)) < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid size '%s'\n", p3); + return ret; + } + + break; + } + + while ((arg3 = av_strtok(p3, "+", &saveptr3))) { + p3 = NULL; + if (sscanf(arg3, "w%d", &size) == 1) { + if (size == i || size < 0 || size >= sctx->nb_inputs) + return AVERROR(EINVAL); + + if (!j) + xpos += sctx->regions[size].width; + else + ypos += sctx->regions[size].width; + } else if (sscanf(arg3, "h%d", &size) == 1) { + if (size == i || size < 0 || size >= sctx->nb_inputs) + return AVERROR(EINVAL); + + if (!j) + xpos += sctx->regions[size].height; + else + ypos += sctx->regions[size].height; + } else if (sscanf(arg3, "%d", &size) == 1) { + if (size < 0) + return AVERROR(EINVAL); + + if (!j) + xpos += size; + else + ypos += size; + } else { + return AVERROR(EINVAL); + } + } + } + + SET_OUTPUT_REGION(region, xpos, ypos, ow, oh); + width = FFMAX(width, xpos + ow); + height = FFMAX(height, ypos + oh); + } + + } + + outlink->w = width; + outlink->h = height; + outlink->frame_rate = inlink0->frame_rate; + outlink->sample_aspect_ratio = inlink0->sample_aspect_ratio; + + for (int i = 1; i < sctx->nb_inputs; i++) { + AVFilterLink *inlink = avctx->inputs[i]; + if (outlink->frame_rate.num != inlink->frame_rate.num || + outlink->frame_rate.den != inlink->frame_rate.den) { + av_log(avctx, AV_LOG_VERBOSE, + "Video inputs have different frame rates, output will be VFR\n"); + outlink->frame_rate = av_make_q(1, 0); + break; + } + } + + ret = init_framesync(avctx); + if (ret < 0) + return ret; + + outlink->time_base = sctx->fs.time_base; + + return 0; +} + +static int stack_init(AVFilterContext *avctx) +{ + StackBaseContext *sctx = avctx->priv; + int ret; + + if (!strcmp(avctx->filter->name, HSTACK_NAME)) + sctx->mode = STACK_H; + else if (!strcmp(avctx->filter->name, VSTACK_NAME)) + sctx->mode = STACK_V; + else { + int is_grid; + + av_assert0(strcmp(avctx->filter->name, XSTACK_NAME) == 0); + sctx->mode = STACK_X; + is_grid = sctx->nb_grid_rows && sctx->nb_grid_columns; + + if (sctx->layout && is_grid) { + av_log(avctx, AV_LOG_ERROR, "Both layout and grid were specified. Only one is allowed.\n"); + return AVERROR(EINVAL); + } + + if (!sctx->layout && !is_grid) { + if (sctx->nb_inputs == 2) { + sctx->nb_grid_rows = 1; + sctx->nb_grid_columns = 2; + is_grid = 1; + } else { + av_log(avctx, AV_LOG_ERROR, "No layout or grid specified.\n"); + return AVERROR(EINVAL); + } + } + + if (is_grid) + sctx->nb_inputs = sctx->nb_grid_rows * sctx->nb_grid_columns; + + if (strcmp(sctx->fillcolor_str, "none") && + av_parse_color(sctx->fillcolor, sctx->fillcolor_str, -1, avctx) >= 0) { + sctx->fillcolor_enable = 1; + } else { + sctx->fillcolor_enable = 0; + } + } + + for (int i = 0; i < sctx->nb_inputs; i++) { + AVFilterPad pad = { 0 }; + + pad.type = AVMEDIA_TYPE_VIDEO; + pad.name = av_asprintf("input%d", i); + + if (!pad.name) + return AVERROR(ENOMEM); + + if ((ret = ff_append_inpad_free_name(avctx, &pad)) < 0) + return ret; + } + + sctx->regions = av_calloc(sctx->nb_inputs, sizeof(*sctx->regions)); + if (!sctx->regions) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold void stack_uninit(AVFilterContext *avctx) +{ + StackBaseContext *sctx = avctx->priv; + + av_freep(&sctx->regions); + ff_framesync_uninit(&sctx->fs); +} + +static int stack_activate(AVFilterContext *avctx) +{ + StackBaseContext *sctx = avctx->priv; + return ff_framesync_activate(&sctx->fs); +} + +static const AVFilterPad stack_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +#define STACK_COMMON_OPTS \ + { "inputs", "Set number of inputs", OFFSET(base.nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 2, UINT16_MAX, .flags = FLAGS }, \ + { "shortest", "Force termination when the shortest input terminates", OFFSET(base.shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + +#define DEFINE_HSTACK_OPTIONS(api) \ + static const AVOption hstack_##api##_options[] = { \ + STACK_COMMON_OPTS \ + { "height", "Set output height (0 to use the height of input 0)", OFFSET(base.tile_height), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, FLAGS }, \ + { NULL } \ + } + +#define DEFINE_VSTACK_OPTIONS(api) \ + static const AVOption vstack_##api##_options[] = { \ + STACK_COMMON_OPTS \ + { "width", "Set output width (0 to use the width of input 0)", OFFSET(base.tile_width), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, FLAGS }, \ + { NULL } \ + } + +#define DEFINE_XSTACK_OPTIONS(api) \ + static const AVOption xstack_##api##_options[] = { \ + STACK_COMMON_OPTS \ + { "layout", "Set custom layout", OFFSET(base.layout), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, .flags = FLAGS }, \ + { "grid", "set fixed size grid layout", OFFSET(base.nb_grid_columns), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, .flags = FLAGS }, \ + { "grid_tile_size", "set tile size in grid layout", OFFSET(base.tile_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, .flags = FLAGS }, \ + { "fill", "Set the color for unused pixels", OFFSET(base.fillcolor_str), AV_OPT_TYPE_STRING, {.str = "none"}, .flags = FLAGS }, \ + { NULL } \ + } + +#define DEFINE_STACK_FILTER(category, api, capi) \ + static const AVClass category##_##api##_class = { \ + .class_name = #category "_" #api, \ + .item_name = av_default_item_name, \ + .option = category##_##api##_options, \ + .version = LIBAVUTIL_VERSION_INT, \ + }; \ + const AVFilter ff_vf_##category##_##api = { \ + .name = #category "_" #api, \ + .description = NULL_IF_CONFIG_SMALL(#capi " " #category), \ + .priv_size = sizeof(StackHWContext), \ + .priv_class = &category##_##api##_class, \ + .init = api##_stack_init, \ + .uninit = api##_stack_uninit, \ + .activate = stack_activate, \ + FILTER_QUERY_FUNC(api##_stack_query_formats), \ + FILTER_OUTPUTS(stack_outputs), \ + .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, \ + .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, \ + } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/stack_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_STACK_INTERNAL_H +#define AVFILTER_STACK_INTERNAL_H + +enum { + STACK_H = 0, + STACK_V = 1, + STACK_X = 2 +}; + +typedef struct StackItemRegion { + int x; + int y; + int width; + int height; +} StackItemRegion; + +typedef struct StackBaseContext { + HWContext hwctx; /**< must be the first field */ + + FFFrameSync fs; + int mode; + uint8_t fillcolor[4]; + int fillcolor_enable; + StackItemRegion *regions; + + /* Options */ + int nb_inputs; + int shortest; + int tile_width; + int tile_height; + int nb_grid_columns; + int nb_grid_rows; + char *layout; + char *fillcolor_str; +} StackBaseContext; + +static int config_comm_output(AVFilterLink *outlink); +static int stack_init(AVFilterContext *avctx); +static av_cold void stack_uninit(AVFilterContext *avctx); +static int stack_activate(AVFilterContext *avctx); + +#endif /* AVFILTER_STACK_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/tinterlace.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/tinterlace.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/tinterlace.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/tinterlace.h 2023-03-03 13:29:59.000000000 +0000 @@ -70,7 +70,7 @@ int vsub; ///< chroma vertical subsampling AVFrame *cur; AVFrame *next; - uint8_t *black_data[4]; ///< buffer used to fill padded lines + uint8_t *black_data[2][4]; ///< buffer used to fill padded lines (limited/full) int black_linesize[4]; FFDrawContext draw; FFDrawColor color; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.c 2023-03-03 13:29:59.000000000 +0000 @@ -588,17 +588,53 @@ return 0; } +static int vaapi_vpp_render_single_pipeline_buffer(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params, + VABufferID *params_id) +{ + VAAPIVPPContext *ctx = avctx->priv; + VAStatus vas; -int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, - VAProcPipelineParameterBuffer *params, - AVFrame *output_frame) + vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, + VAProcPipelineParameterBufferType, + sizeof(*params), 1, params, params_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " + "%d (%s).\n", vas, vaErrorStr(vas)); + *params_id = VA_INVALID_ID; + + return AVERROR(EIO); + } + av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", *params_id); + + vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, params_id, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " + "%d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR(EIO); + } + + return 0; +} + +int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params_list, + int cout, + AVFrame *output_frame) { VAAPIVPPContext *ctx = avctx->priv; VASurfaceID output_surface; - VABufferID params_id; + VABufferID *params_ids; VAStatus vas; int err; + params_ids = (VABufferID *)av_malloc_array(cout, sizeof(VABufferID)); + if (!params_ids) + return AVERROR(ENOMEM); + + for (int i = 0; i < cout; i++) + params_ids[i] = VA_INVALID_ID; + output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; vas = vaBeginPicture(ctx->hwctx->display, @@ -610,25 +646,10 @@ goto fail; } - vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, - VAProcPipelineParameterBufferType, - sizeof(*params), 1, params, ¶ms_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", - params_id); - - vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, - ¶ms_id, 1); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; + for (int i = 0; i < cout; i++) { + err = vaapi_vpp_render_single_pipeline_buffer(avctx, ¶ms_list[i], ¶ms_ids[i]); + if (err) + goto fail_after_begin; } vas = vaEndPicture(ctx->hwctx->display, ctx->va_context); @@ -641,14 +662,17 @@ if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { - vas = vaDestroyBuffer(ctx->hwctx->display, params_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to free parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - // And ignore. + for (int i = 0; i < cout && params_ids[i] != VA_INVALID_ID; i++) { + vas = vaDestroyBuffer(ctx->hwctx->display, params_ids[i]); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to free parameter buffer: " + "%d (%s).\n", vas, vaErrorStr(vas)); + // And ignore. + } } } + av_freep(¶ms_ids); return 0; // We want to make sure that if vaBeginPicture has been called, we also @@ -656,13 +680,21 @@ // do something else nasty, but once we're in this failure case there // isn't much else we can do. fail_after_begin: - vaRenderPicture(ctx->hwctx->display, ctx->va_context, ¶ms_id, 1); + vaRenderPicture(ctx->hwctx->display, ctx->va_context, ¶ms_ids[0], 1); fail_after_render: vaEndPicture(ctx->hwctx->display, ctx->va_context); fail: + av_freep(¶ms_ids); return err; } +int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params, + AVFrame *output_frame) +{ + return ff_vaapi_vpp_render_pictures(avctx, params, 1, output_frame); +} + void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx) { int i; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaapi_vpp.h 2023-03-03 13:29:59.000000000 +0000 @@ -83,4 +83,9 @@ VAProcPipelineParameterBuffer *params, AVFrame *output_frame); +int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params_list, + int count, + AVFrame *output_frame); + #endif /* AVFILTER_VAAPI_VPP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaf_spectrumsynth.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaf_spectrumsynth.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaf_spectrumsynth.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vaf_spectrumsynth.c 2023-03-03 13:29:59.000000000 +0000 @@ -342,7 +342,7 @@ s->fft_in[ch][y].im = -s->fft_in[ch][f].im; } - s->tx_fn(s->fft, s->fft_out[ch], s->fft_in[ch], sizeof(float)); + s->tx_fn(s->fft, s->fft_out[ch], s->fft_in[ch], sizeof(AVComplexFloat)); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFILTER_VERSION_MINOR 44 +#define LIBAVFILTER_VERSION_MINOR 3 #define LIBAVFILTER_VERSION_MICRO 100 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ * Libavfilter version macros */ -#define LIBAVFILTER_VERSION_MAJOR 8 +#define LIBAVFILTER_VERSION_MAJOR 9 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -35,8 +35,4 @@ * the public API and may change, break or disappear at any time. */ -#define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 9) -#define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9) -#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9) - #endif /* AVFILTER_VERSION_MAJOR_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_backgroundkey.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_backgroundkey.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_backgroundkey.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_backgroundkey.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,255 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "libavutil/imgutils.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +typedef struct BackgroundkeyContext { + const AVClass *class; + + float threshold; + float similarity; + float blend; + int max; + + int nb_threads; + int hsub_log2; + int vsub_log2; + + int64_t max_sum; + int64_t *sums; + + AVFrame *background; + + int (*do_slice)(AVFilterContext *avctx, void *arg, + int jobnr, int nb_jobs); +} BackgroundkeyContext; + +static int do_backgroundkey_slice(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) +{ + BackgroundkeyContext *s = avctx->priv; + AVFrame *frame = arg; + const int slice_start = (frame->height * jobnr) / nb_jobs; + const int slice_end = (frame->height * (jobnr + 1)) / nb_jobs; + const int min_diff = (255 + 255 + 255) * s->similarity; + const float blend = s->blend; + const int hsub = s->hsub_log2; + const int vsub = s->vsub_log2; + int64_t sum = 0; + + for (int y = slice_start; y < slice_end; y++) { + const uint8_t *srcy = frame->data[0] + frame->linesize[0] * y; + const uint8_t *srcu = frame->data[1] + frame->linesize[1] * (y >> vsub); + const uint8_t *srcv = frame->data[2] + frame->linesize[2] * (y >> vsub); + const uint8_t *bsrcy = s->background->data[0] + s->background->linesize[0] * y; + const uint8_t *bsrcu = s->background->data[1] + s->background->linesize[1] * (y >> vsub); + const uint8_t *bsrcv = s->background->data[2] + s->background->linesize[2] * (y >> vsub); + uint8_t *dst = frame->data[3] + frame->linesize[3] * y; + for (int x = 0; x < frame->width; x++) { + const int xx = x >> hsub; + const int diff = FFABS(srcy[x] - bsrcy[x]) + + FFABS(srcu[xx] - bsrcu[xx]) + + FFABS(srcv[xx] - bsrcv[xx]); + int A; + + sum += diff; + if (blend > 0.f) { + A = 255 - av_clipf((min_diff - diff) / blend, 0.f, 255.f); + } else { + A = (diff > min_diff) ? 255 : 0; + } + + dst[x] = A; + } + } + + s->sums[jobnr] = sum; + + return 0; +} + +static int do_backgroundkey16_slice(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) +{ + BackgroundkeyContext *s = avctx->priv; + AVFrame *frame = arg; + const int slice_start = (frame->height * jobnr) / nb_jobs; + const int slice_end = (frame->height * (jobnr + 1)) / nb_jobs; + const int hsub = s->hsub_log2; + const int vsub = s->vsub_log2; + const int max = s->max; + const int min_diff = s->similarity * (s->max + s->max + s->max); + const float blend = s->blend; + int64_t sum = 0; + + for (int y = slice_start; y < slice_end; y++) { + const uint16_t *srcy = (const uint16_t *)(frame->data[0] + frame->linesize[0] * y); + const uint16_t *srcu = (const uint16_t *)(frame->data[1] + frame->linesize[1] * (y >> vsub)); + const uint16_t *srcv = (const uint16_t *)(frame->data[2] + frame->linesize[2] * (y >> vsub)); + const uint16_t *bsrcy = (const uint16_t *)(s->background->data[0] + s->background->linesize[0] * y); + const uint16_t *bsrcu = (const uint16_t *)(s->background->data[1] + s->background->linesize[1] * (y >> vsub)); + const uint16_t *bsrcv = (const uint16_t *)(s->background->data[2] + s->background->linesize[2] * (y >> vsub)); + uint16_t *dst = (uint16_t *)(frame->data[3] + frame->linesize[3] * y); + for (int x = 0; x < frame->width; x++) { + const int xx = x >> hsub; + const int diff = FFABS(srcy[x] - bsrcy[x] ) + + FFABS(srcu[xx] - bsrcu[xx]) + + FFABS(srcv[xx] - bsrcv[xx]); + int A; + + sum += diff; + if (blend > 0.f) { + A = max - av_clipf((min_diff - diff) / blend, 0.f, max); + } else { + A = (diff > min_diff) ? max : 0; + } + + dst[x] = A; + } + } + + s->sums[jobnr] = sum; + + return 0; +} + +static int filter_frame(AVFilterLink *link, AVFrame *frame) +{ + AVFilterContext *avctx = link->dst; + BackgroundkeyContext *s = avctx->priv; + int64_t sum = 0; + int ret = 0; + + if (!s->background) { + s->background = ff_get_video_buffer(link, frame->width, frame->height); + if (!s->background) { + ret = AVERROR(ENOMEM); + goto fail; + } + ret = av_frame_copy(s->background, frame); + if (ret < 0) + goto fail; + } + + if (ret = ff_filter_execute(avctx, s->do_slice, frame, NULL, + FFMIN(frame->height, s->nb_threads))) + goto fail; + + for (int n = 0; n < s->nb_threads; n++) + sum += s->sums[n]; + if (s->max_sum * s->threshold < sum) { + ret = av_frame_copy(s->background, frame); + if (ret < 0) + goto fail; + } + + return ff_filter_frame(avctx->outputs[0], frame); +fail: + av_frame_free(&frame); + return ret; +} + +static av_cold int config_output(AVFilterLink *outlink) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format); + AVFilterContext *avctx = outlink->src; + AVFilterLink *inlink = avctx->inputs[0]; + BackgroundkeyContext *s = avctx->priv; + int depth; + + s->nb_threads = ff_filter_get_nb_threads(avctx); + depth = desc->comp[0].depth; + s->do_slice = depth <= 8 ? do_backgroundkey_slice : do_backgroundkey16_slice; + s->max = (1 << depth) - 1; + s->hsub_log2 = desc->log2_chroma_w; + s->vsub_log2 = desc->log2_chroma_h; + s->max_sum = (int64_t)(inlink->w) * inlink->h * s->max; + s->max_sum += 2LL * (inlink->w >> s->hsub_log2) * (inlink->h >> s->vsub_log2) * s->max; + + s->sums = av_calloc(s->nb_threads, sizeof(*s->sums)); + if (!s->sums) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + BackgroundkeyContext *s = ctx->priv; + + av_frame_free(&s->background); + av_freep(&s->sums); +} + +static const AVFilterPad backgroundkey_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE, + .filter_frame = filter_frame, + }, +}; + +static const AVFilterPad backgroundkey_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +#define OFFSET(x) offsetof(BackgroundkeyContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM + +static const AVOption backgroundkey_options[] = { + { "threshold", "set the scene change threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, { .dbl = 0.08}, 0.0, 1.0, FLAGS }, + { "similarity", "set the similarity", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.1 }, 0.0, 1.0, FLAGS }, + { "blend", "set the blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, + { NULL } +}; + +static const enum AVPixelFormat backgroundkey_fmts[] = { + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUVA422P, + AV_PIX_FMT_YUVA444P, + AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9, + AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10, + AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA444P12, + AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16, + AV_PIX_FMT_GBRAP, + AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, + AV_PIX_FMT_NONE +}; + +AVFILTER_DEFINE_CLASS(backgroundkey); + +const AVFilter ff_vf_backgroundkey = { + .name = "backgroundkey", + .description = NULL_IF_CONFIG_SMALL("Turns a static background into transparency."), + .priv_size = sizeof(BackgroundkeyContext), + .priv_class = &backgroundkey_class, + .uninit = uninit, + FILTER_INPUTS(backgroundkey_inputs), + FILTER_OUTPUTS(backgroundkey_outputs), + FILTER_PIXFMTS_ARRAY(backgroundkey_fmts), + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, + .process_command = ff_filter_process_command, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,479 @@ +/* + * Copyright (c) 2022 Mohamed Khaled + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/avstring.h" +#include "libavutil/common.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_cuda_internal.h" +#include "libavutil/cuda_check.h" +#include "libavutil/internal.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +#include "cuda/load_helper.h" + +static const enum AVPixelFormat supported_formats[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NV12, + AV_PIX_FMT_YUV444P +}; + +#define DIV_UP(a, b) ( ((a) + (b) - 1) / (b) ) +#define BLOCKX 32 +#define BLOCKY 16 + +#define CHECK_CU(x) FF_CUDA_CHECK_DL(ctx, s->hwctx->internal->cuda_dl, x) + + +typedef struct CUDABilateralContext { + const AVClass *class; + AVCUDADeviceContext *hwctx; + + enum AVPixelFormat in_fmt, out_fmt; + const AVPixFmtDescriptor *in_desc, *out_desc; + int in_planes, out_planes; + int in_plane_depths[4]; + int in_plane_channels[4]; + + int window_size; + float sigmaS; + float sigmaR; + + AVBufferRef *frames_ctx; + AVFrame *frame; + AVFrame *tmp_frame; + + CUcontext cu_ctx; + CUmodule cu_module; + CUfunction cu_func; + CUfunction cu_func_uv; + CUstream cu_stream; +} CUDABilateralContext; + +static av_cold int cudabilateral_init(AVFilterContext *ctx) +{ + CUDABilateralContext *s = ctx->priv; + + s->frame = av_frame_alloc(); + if (!s->frame) + return AVERROR(ENOMEM); + + s->tmp_frame = av_frame_alloc(); + if (!s->tmp_frame) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold void cudabilateral_uninit(AVFilterContext *ctx) +{ + CUDABilateralContext *s = ctx->priv; + + if (s->hwctx && s->cu_module) { + CudaFunctions *cu = s->hwctx->internal->cuda_dl; + CUcontext bilateral; + + CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); + CHECK_CU(cu->cuModuleUnload(s->cu_module)); + s->cu_module = NULL; + CHECK_CU(cu->cuCtxPopCurrent(&bilateral)); + } + + av_frame_free(&s->frame); + av_buffer_unref(&s->frames_ctx); + av_frame_free(&s->tmp_frame); +} + +static av_cold int init_hwframe_ctx(CUDABilateralContext *s, AVBufferRef *device_ctx, int width, int height) +{ + AVBufferRef *out_ref = NULL; + AVHWFramesContext *out_ctx; + int ret; + + out_ref = av_hwframe_ctx_alloc(device_ctx); + if (!out_ref) + return AVERROR(ENOMEM); + out_ctx = (AVHWFramesContext*)out_ref->data; + + out_ctx->format = AV_PIX_FMT_CUDA; + out_ctx->sw_format = s->out_fmt; + out_ctx->width = width; + out_ctx->height = height; + + ret = av_hwframe_ctx_init(out_ref); + if (ret < 0) + goto fail; + + av_frame_unref(s->frame); + ret = av_hwframe_get_buffer(out_ref, s->frame, 0); + if (ret < 0) + goto fail; + + av_buffer_unref(&s->frames_ctx); + s->frames_ctx = out_ref; + + return 0; +fail: + av_buffer_unref(&out_ref); + return ret; +} + +static int format_is_supported(enum AVPixelFormat fmt) +{ + int i; + + for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) + if (supported_formats[i] == fmt) + return 1; + return 0; +} + +static av_cold void set_format_info(AVFilterContext *ctx, enum AVPixelFormat in_format, enum AVPixelFormat out_format) +{ + CUDABilateralContext *s = ctx->priv; + int i, p, d; + + s->in_fmt = in_format; + s->out_fmt = out_format; + + s->in_desc = av_pix_fmt_desc_get(s->in_fmt); + s->out_desc = av_pix_fmt_desc_get(s->out_fmt); + s->in_planes = av_pix_fmt_count_planes(s->in_fmt); + s->out_planes = av_pix_fmt_count_planes(s->out_fmt); + + // find maximum step of each component of each plane + // For our subset of formats, this should accurately tell us how many channels CUDA needs + // i.e. 1 for Y plane, 2 for UV plane of NV12, 4 for single plane of RGB0 formats + + for (i = 0; i < s->in_desc->nb_components; i++) { + d = (s->in_desc->comp[i].depth + 7) / 8; + p = s->in_desc->comp[i].plane; + s->in_plane_channels[p] = FFMAX(s->in_plane_channels[p], s->in_desc->comp[i].step / d); + + s->in_plane_depths[p] = s->in_desc->comp[i].depth; + } +} + +static av_cold int init_processing_chain(AVFilterContext *ctx, int width, int height) +{ + CUDABilateralContext *s = ctx->priv; + AVHWFramesContext *in_frames_ctx; + int ret; + + /* check that we have a hw context */ + if (!ctx->inputs[0]->hw_frames_ctx) { + av_log(ctx, AV_LOG_ERROR, "No hw context provided on input\n"); + return AVERROR(EINVAL); + } + in_frames_ctx = (AVHWFramesContext*)ctx->inputs[0]->hw_frames_ctx->data; + + if (!format_is_supported(in_frames_ctx->sw_format)) { + av_log(ctx, AV_LOG_ERROR, "Unsupported format: %s\n", av_get_pix_fmt_name(in_frames_ctx->sw_format)); + return AVERROR(ENOSYS); + } + + set_format_info(ctx, in_frames_ctx->sw_format, in_frames_ctx->sw_format); + + ret = init_hwframe_ctx(s, in_frames_ctx->device_ref, width, height); + if (ret < 0) + return ret; + + ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->frames_ctx); + if (!ctx->outputs[0]->hw_frames_ctx) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold int cuda_bilateral_load_functions(AVFilterContext *ctx) +{ + CUDABilateralContext *s = ctx->priv; + CUcontext bilateral, cuda_ctx = s->hwctx->cuda_ctx; + CudaFunctions *cu = s->hwctx->internal->cuda_dl; + int ret; + + extern const unsigned char ff_vf_bilateral_cuda_ptx_data[]; + extern const unsigned int ff_vf_bilateral_cuda_ptx_len; + + ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx)); + if (ret < 0) + return ret; + + ret = ff_cuda_load_module(ctx, s->hwctx, &s->cu_module, + ff_vf_bilateral_cuda_ptx_data, ff_vf_bilateral_cuda_ptx_len); + if (ret < 0) + goto fail; + + ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func, s->cu_module, "Process_uchar")); + if (ret < 0) { + av_log(ctx, AV_LOG_FATAL, "Failed loading Process_uchar\n"); + goto fail; + } + + ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_uv, s->cu_module, "Process_uchar2")); + if (ret < 0) { + av_log(ctx, AV_LOG_FATAL, "Failed loading Process_uchar2\n"); + goto fail; + } + +fail: + CHECK_CU(cu->cuCtxPopCurrent(&bilateral)); + + return ret; +} + +static av_cold int cuda_bilateral_config_props(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + AVFilterLink *inlink = outlink->src->inputs[0]; + CUDABilateralContext *s = ctx->priv; + AVHWFramesContext *frames_ctx = (AVHWFramesContext*)inlink->hw_frames_ctx->data; + AVCUDADeviceContext *device_hwctx = frames_ctx->device_ctx->hwctx; + int ret; + + s->hwctx = device_hwctx; + s->cu_stream = s->hwctx->stream; + + ret = init_processing_chain(ctx, inlink->w, inlink->h); + if (ret < 0) + return ret; + + outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; + + // the window_size makes more sense when it is odd, so add 1 if even + s->window_size= (s->window_size%2) ? s->window_size : s->window_size+1; + + ret = cuda_bilateral_load_functions(ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int call_cuda_kernel(AVFilterContext *ctx, CUfunction func, + CUtexObject src_tex[3], AVFrame *out_frame, + int width, int height, int pitch, + int width_uv, int height_uv, int pitch_uv, + int window_size, float sigmaS, float sigmaR) +{ + CUDABilateralContext *s = ctx->priv; + CudaFunctions *cu = s->hwctx->internal->cuda_dl; + int ret; + + CUdeviceptr dst_devptr[3] = { + (CUdeviceptr)out_frame->data[0], (CUdeviceptr)out_frame->data[1], (CUdeviceptr)out_frame->data[2] + }; + + void *args_uchar[] = { + &src_tex[0], &src_tex[1], &src_tex[2], + &dst_devptr[0], &dst_devptr[1], &dst_devptr[2], + &width, &height, &pitch, + &width_uv, &height_uv, &pitch_uv, + &window_size, &sigmaS, &sigmaR + }; + + ret = CHECK_CU(cu->cuLaunchKernel(func, + DIV_UP(width, BLOCKX), DIV_UP(height, BLOCKY), 1, + BLOCKX, BLOCKY, 1, 0, s->cu_stream, args_uchar, NULL)); + if (ret < 0) + return ret; + + return ret; +} + +static int cuda_bilateral_process_internal(AVFilterContext *ctx, + AVFrame *out, AVFrame *in) +{ + CUDABilateralContext *s = ctx->priv; + CudaFunctions *cu = s->hwctx->internal->cuda_dl; + CUcontext bilateral, cuda_ctx = s->hwctx->cuda_ctx; + int i, ret; + + CUtexObject tex[3] = { 0, 0, 0 }; + + ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx)); + if (ret < 0) + return ret; + + for (i = 0; i < s->in_planes; i++) { + CUDA_TEXTURE_DESC tex_desc = { + .filterMode = CU_TR_FILTER_MODE_LINEAR, + .flags = 0, // CU_TRSF_READ_AS_INTEGER to get raw ints instead of normalized floats from tex2D + }; + + CUDA_RESOURCE_DESC res_desc = { + .resType = CU_RESOURCE_TYPE_PITCH2D, + .res.pitch2D.format = CU_AD_FORMAT_UNSIGNED_INT8, + .res.pitch2D.numChannels = s->in_plane_channels[i], + .res.pitch2D.pitchInBytes = in->linesize[i], + .res.pitch2D.devPtr = (CUdeviceptr)in->data[i], + }; + + if (i == 1 || i == 2) { + res_desc.res.pitch2D.width = AV_CEIL_RSHIFT(in->width, s->in_desc->log2_chroma_w); + res_desc.res.pitch2D.height = AV_CEIL_RSHIFT(in->height, s->in_desc->log2_chroma_h); + } else { + res_desc.res.pitch2D.width = in->width; + res_desc.res.pitch2D.height = in->height; + } + + ret = CHECK_CU(cu->cuTexObjectCreate(&tex[i], &res_desc, &tex_desc, NULL)); + if (ret < 0) + goto exit; + } + + ret = call_cuda_kernel(ctx, (s->in_plane_channels[1] > 1) ? s->cu_func_uv : s->cu_func, + tex, out, + out->width, out->height, out->linesize[0], + AV_CEIL_RSHIFT(out->width, s->out_desc->log2_chroma_w), + AV_CEIL_RSHIFT(out->height, s->out_desc->log2_chroma_h), + out->linesize[1] >> ((s->in_plane_channels[1] > 1) ? 1 : 0), + s->window_size, s->sigmaS, s->sigmaR); + if (ret < 0) + goto exit; + +exit: + for (i = 0; i < s->in_planes; i++) + if (tex[i]) + CHECK_CU(cu->cuTexObjectDestroy(tex[i])); + + CHECK_CU(cu->cuCtxPopCurrent(&bilateral)); + + return ret; +} + +static int cuda_bilateral_process(AVFilterContext *ctx, AVFrame *out, AVFrame *in) +{ + CUDABilateralContext *s = ctx->priv; + AVFrame *src = in; + int ret; + + ret = cuda_bilateral_process_internal(ctx, s->frame, src); + if (ret < 0) + return ret; + + src = s->frame; + ret = av_hwframe_get_buffer(src->hw_frames_ctx, s->tmp_frame, 0); + if (ret < 0) + return ret; + + av_frame_move_ref(out, s->frame); + av_frame_move_ref(s->frame, s->tmp_frame); + + ret = av_frame_copy_props(out, in); + if (ret < 0) + return ret; + + return 0; +} + +static int cuda_bilateral_filter_frame(AVFilterLink *link, AVFrame *in) +{ + AVFilterContext *ctx = link->dst; + CUDABilateralContext *s = ctx->priv; + AVFilterLink *outlink = ctx->outputs[0]; + CudaFunctions *cu = s->hwctx->internal->cuda_dl; + + AVFrame *out = NULL; + CUcontext bilateral; + int ret = 0; + + out = av_frame_alloc(); + if (!out) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); + if (ret < 0) + goto fail; + + ret = cuda_bilateral_process(ctx, out, in); + + CHECK_CU(cu->cuCtxPopCurrent(&bilateral)); + if (ret < 0) + goto fail; + + av_frame_free(&in); + return ff_filter_frame(outlink, out); +fail: + av_frame_free(&in); + av_frame_free(&out); + return ret; +} + +#define OFFSET(x) offsetof(CUDABilateralContext, x) +#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM) +static const AVOption options[] = { + { "sigmaS", "set spatial sigma", OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.1, 512, FLAGS }, + { "sigmaR", "set range sigma", OFFSET(sigmaR), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.1, 512, FLAGS }, + { "window_size", "set neighbours window_size", OFFSET(window_size), AV_OPT_TYPE_INT, {.i64=1}, 1, 255, FLAGS }, + { NULL } +}; + +static const AVClass cuda_bilateral_class = { + .class_name = "cudabilateral", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +static const AVFilterPad cuda_bilateral_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = cuda_bilateral_filter_frame, + }, +}; + +static const AVFilterPad cuda_bilateral_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = cuda_bilateral_config_props, + }, +}; + +const AVFilter ff_vf_bilateral_cuda = { + .name = "bilateral_cuda", + .description = NULL_IF_CONFIG_SMALL("GPU accelerated bilateral filter"), + + .init = cudabilateral_init, + .uninit = cudabilateral_uninit, + + .priv_size = sizeof(CUDABilateralContext), + .priv_class = &cuda_bilateral_class, + + FILTER_INPUTS(cuda_bilateral_inputs), + FILTER_OUTPUTS(cuda_bilateral_outputs), + + FILTER_SINGLE_PIXFMT(AV_PIX_FMT_CUDA), + + .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.cu mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.cu --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.cu 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bilateral_cuda.cu 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2022 Mohamed Khaled + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "cuda/vector_helpers.cuh" + +extern "C" +{ + +/** + * @brief calculated squared norm difference between two 3-dimension vecors ||first_vector-second_vector||^2 + * used float4 for better performance + * + * @param first_yuv first color vector + * @param second_yuv second color vecotr + * @return answer of squared norm difference + */ +__device__ static inline float norm_squared(float4 first_yuv, float4 second_yuv) +{ + float x = first_yuv.x - second_yuv.x; + float y = first_yuv.y - second_yuv.y; + float z = first_yuv.z - second_yuv.z; + return (x*x) + (y*y) + (z*z); +} + +/** + * @brief calculate w as stated in bilateral filter research paper + * + * @param first_yuv first color vector + * @param second_yuv second color vecotr + * @return the calculated w + */ +__device__ static inline float calculate_w(int x, int y, int r, int c, + float4 pixel_value, float4 neighbor_value, + float sigma_space, float sigma_color) +{ + float first_term, second_term; + first_term = (((x - r) * (x - r)) + ((y - c) * (y - c))) / (2 * sigma_space * sigma_space); + second_term = norm_squared(pixel_value, neighbor_value) / (2 * sigma_color * sigma_color); + return __expf(-first_term - second_term); +} + +/** + * @brief apply the bilateral filter on the pixel sent + * + * @param src_tex_Y Y channel of source image + * @param src_tex U channel of source image if yuv, or UV channels if format is nv12 + * @param src_tex_V V channel of source image + * @param dst_Y Y channel of destination image + * @param dst_U U channel of destination image if format is in yuv + * @param dst_V V channel of destination image if format is in yuv + * @param dst_UV UV channels of destination image if format is in nv12 + * @param width width of Y channel + * @param height height of Y channel + * @param width_uv width of UV channels + * @param height_uv height of UV channels + * @param pitch pitch of Y channel + * @param pitch_uv pitch of UV channels + * @param x x coordinate of pixel to be filtered + * @param y y coordinate of pixel to be filtered + * @param sigma_space sigma space parameter + * @param sigma_color sigma color parameter + * @param window_size window size parameter + * @return void + */ +__device__ static inline void apply_biltaeral( + cudaTextureObject_t src_tex_Y, cudaTextureObject_t src_tex, cudaTextureObject_t src_tex_V, + uchar *dst_Y, uchar *dst_U, uchar *dst_V, uchar2 *dst_UV, + int width, int height, int width_uv, int height_uv, int pitch, int pitch_uv, + int x, int y, + float sigma_space, float sigma_color, int window_size) +{ + int start_r = x - window_size / 2; + int start_c = y - window_size / 2; + float4 neighbor_pixel = make_float4(0.f, 0.f, 0.f, 0.f); + float Wp = 0.f; + float4 new_pixel_value = make_float4(0.f, 0.f, 0.f, 0.f); + float w = 0.f; + + int channel_ratio = width / width_uv; // ratio between Y channel and UV channels + float4 currrent_pixel; + + if (!src_tex_V) { // format is in nv12 + float2 temp_uv = tex2D(src_tex, x/channel_ratio, y/channel_ratio) * 255.f; + currrent_pixel.x = tex2D(src_tex_Y, x, y) * 255.f; + currrent_pixel.y = temp_uv.x; + currrent_pixel.z = temp_uv.y; + currrent_pixel.w = 0.f; + } else { // format is fully planar + currrent_pixel = make_float4(tex2D(src_tex_Y, x, y) * 255.f, + tex2D(src_tex, x/channel_ratio, y/channel_ratio) * 255.f, + tex2D(src_tex_V, x/channel_ratio, y/channel_ratio) * 255.f, + 0.f); + } + + for (int i=0; i < window_size; i++) + { + for (int j=0; j < window_size; j++) + { + int r=start_r+i; + int c=start_c+j; + bool in_bounds=r>=0 && r=0 && c(src_tex, r/channel_ratio, c/channel_ratio); + neighbor_pixel=make_float4(tex2D(src_tex_Y, r, c) * 255.f, + temp_uv.x * 255.f, + temp_uv.y * 255.f, 0.f); + } else { + neighbor_pixel=make_float4(tex2D(src_tex_Y, r, c) * 255.f, + tex2D(src_tex, r/channel_ratio, c/channel_ratio) * 255.f, + tex2D(src_tex_V, r/channel_ratio, c/channel_ratio) * 255.f, 0.f); + } + w=calculate_w(x,y,r,c,currrent_pixel,neighbor_pixel,sigma_space,sigma_color); + Wp+=w; + new_pixel_value+= neighbor_pixel*w; + } + } + } + + new_pixel_value = new_pixel_value / Wp; + dst_Y[y*pitch + x] = new_pixel_value.x; + + if (!src_tex_V) { + dst_UV[(y/channel_ratio) * pitch_uv + (x/channel_ratio)] = make_uchar2(new_pixel_value.y, new_pixel_value.z); + } else { + dst_U[(y/channel_ratio) * pitch_uv + (x/channel_ratio)] = new_pixel_value.y; + dst_V[(y/channel_ratio) * pitch_uv + (x/channel_ratio)] = new_pixel_value.z; + } + + return; +} + + +__global__ void Process_uchar(cudaTextureObject_t src_tex_Y, cudaTextureObject_t src_tex_U, cudaTextureObject_t src_tex_V, + uchar *dst_Y, uchar *dst_U, uchar *dst_V, + int width, int height, int pitch, + int width_uv, int height_uv, int pitch_uv, + int window_size, float sigmaS, float sigmaR) +{ + + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + if (y >= height || x >= width) + return; + + apply_biltaeral(src_tex_Y, src_tex_U, src_tex_V, + dst_Y, dst_U, dst_V, (uchar2*)nullptr, + width, height, width_uv, height_uv, pitch, pitch_uv, + x, y, + sigmaS, sigmaR, window_size); +} + + +__global__ void Process_uchar2(cudaTextureObject_t src_tex_Y, cudaTextureObject_t src_tex_UV, cudaTextureObject_t unused1, + uchar *dst_Y, uchar2 *dst_UV, uchar *unused2, + int width, int height, int pitch, + int width_uv, int height_uv, int pitch_uv, + int window_size, float sigmaS, float sigmaR) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + if (y >= height || x >= width) + return; + + apply_biltaeral(src_tex_Y, src_tex_UV, (cudaTextureObject_t)nullptr, + dst_Y, (uchar*)nullptr, (uchar*)nullptr, dst_UV, + width, height, width_uv, height_uv, pitch, pitch_uv, + x, y, + sigmaS, sigmaR, window_size); +} + +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blackdetect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blackdetect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blackdetect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blackdetect.c 2023-03-03 13:29:59.000000000 +0000 @@ -102,8 +102,6 @@ BlackDetectContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); const int depth = desc->comp[0].depth; - const int max = (1 << depth) - 1; - const int factor = (1 << (depth - 8)); s->depth = depth; s->nb_threads = ff_filter_get_nb_threads(ctx); @@ -113,16 +111,10 @@ if (!s->counter) return AVERROR(ENOMEM); - s->pixel_black_th_i = ff_fmt_is_in(inlink->format, yuvj_formats) ? - // luminance_minimum_value + pixel_black_th * luminance_range_size - s->pixel_black_th * max : - 16 * factor + s->pixel_black_th * (235 - 16) * factor; - av_log(s, AV_LOG_VERBOSE, - "black_min_duration:%s pixel_black_th:%f pixel_black_th_i:%d picture_black_ratio_th:%f\n", + "black_min_duration:%s pixel_black_th:%f picture_black_ratio_th:%f\n", av_ts2timestr(s->black_min_duration, &s->time_base), - s->pixel_black_th, s->pixel_black_th_i, - s->picture_black_ratio_th); + s->pixel_black_th, s->picture_black_ratio_th); return 0; } @@ -182,6 +174,14 @@ AVFilterContext *ctx = inlink->dst; BlackDetectContext *s = ctx->priv; double picture_black_ratio = 0; + const int max = (1 << s->depth) - 1; + const int factor = (1 << (s->depth - 8)); + const int full = picref->color_range == AVCOL_RANGE_JPEG || + ff_fmt_is_in(picref->format, yuvj_formats); + + s->pixel_black_th_i = full ? s->pixel_black_th * max : + // luminance_minimum_value + pixel_black_th * luminance_range_size + 16 * factor + s->pixel_black_th * (235 - 16) * factor; ff_filter_execute(ctx, black_counter, picref, NULL, FFMIN(inlink->h, s->nb_threads)); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blurdetect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blurdetect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blurdetect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_blurdetect.c 2023-03-03 13:29:59.000000000 +0000 @@ -283,12 +283,12 @@ nplanes++; // gaussian filter to reduce noise - ff_gaussian_blur(w, h, - filterbuf, w, - in->data[plane], in->linesize[plane]); + ff_gaussian_blur_8(w, h, + filterbuf, w, + in->data[plane], in->linesize[plane], 1); // compute the 16-bits gradients and directions for the next step - ff_sobel(w, h, gradients, w, directions, w, filterbuf, w); + ff_sobel_8(w, h, gradients, w, directions, w, filterbuf, w, 1); // non_maximum_suppression() will actually keep & clip what's necessary and // ignore the rest, so we need a clean output buffer diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bm3d.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bm3d.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bm3d.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_bm3d.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,17 +25,17 @@ /** * @todo - * - non-power of 2 DCT * - opponent color space * - temporal support */ #include +#include "libavutil/cpu.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" -#include "libavcodec/avfft.h" +#include "libavutil/tx.h" #include "avfilter.h" #include "filters.h" #include "formats.h" @@ -69,16 +69,19 @@ } PosPairCode; typedef struct SliceContext { - DCTContext *gdctf, *gdcti; - DCTContext *dctf, *dcti; - FFTSample *bufferh; - FFTSample *bufferv; - FFTSample *bufferz; - FFTSample *buffer; - FFTSample *rbufferh; - FFTSample *rbufferv; - FFTSample *rbufferz; - FFTSample *rbuffer; + AVTXContext *gdctf, *gdcti; + av_tx_fn tx_fn_g, itx_fn_g; + AVTXContext *dctf, *dcti; + av_tx_fn tx_fn, itx_fn; + float *bufferh; + float *buffert; + float *bufferv; + float *bufferz; + float *buffer; + float *rbufferh; + float *rbufferv; + float *rbufferz; + float *rbuffer; float *num, *den; PosPairCode match_blocks[256]; int nb_match_blocks; @@ -105,7 +108,7 @@ int nb_planes; int planewidth[4]; int planeheight[4]; - int group_bits; + int pblock_size; int pgroup_size; SliceContext slices[MAX_NB_THREADS]; @@ -128,11 +131,12 @@ #define OFFSET(x) offsetof(BM3DContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + static const AVOption bm3d_options[] = { { "sigma", "set denoising strength", OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 99999.9, FLAGS }, - { "block", "set log2(size) of local patch", - OFFSET(block_size), AV_OPT_TYPE_INT, {.i64=4}, 4, 6, FLAGS }, + { "block", "set size of local patch", + OFFSET(block_size), AV_OPT_TYPE_INT, {.i64=16}, 8, 64, FLAGS }, { "bstep", "set sliding step for processing blocks", OFFSET(block_step), AV_OPT_TYPE_INT, {.i64=4}, 1, 64, FLAGS }, { "group", "set maximal number of similar blocks", @@ -273,9 +277,9 @@ double MSE2SSE = s->group_size * s->block_size * s->block_size * src_range * src_range / (s->max * s->max); double distMul = 1. / MSE2SSE; double th_sse = th_mse * MSE2SSE; - int i, index = sc->nb_match_blocks; + int index = sc->nb_match_blocks; - for (i = 0; i < search_size; i++) { + for (int i = 0; i < search_size; i++) { PosCode pos = search_pos[i]; double dist; @@ -316,10 +320,10 @@ int r = search_boundary(width - block_size, range, step, 0, y, x); int t = search_boundary(0, range, step, 1, y, x); int b = search_boundary(height - block_size, range, step, 1, y, x); - int j, i, index = 0; + int index = 0; - for (j = t; j <= b; j += step) { - for (i = l; i <= r; i += step) { + for (int j = t; j <= b; j += step) { + for (int i = l; i <= r; i += step) { PosCode pos; if (exclude_cur_pos > 0 && j == y && i == x) { @@ -364,22 +368,18 @@ int y, int x, int block_size, float *dst) { const uint8_t *src = srcp + y * src_linesize + x; - int j; - for (j = 0; j < block_size; j++) { + for (int j = 0; j < block_size; j++) dst[j] = src[j]; - } } static void get_block_row16(const uint8_t *srcp, int src_linesize, int y, int x, int block_size, float *dst) { const uint16_t *src = (uint16_t *)srcp + y * src_linesize / 2 + x; - int j; - for (j = 0; j < block_size; j++) { + for (int j = 0; j < block_size; j++) dst[j] = src[j]; - } } static void basic_block_filtering(BM3DContext *s, const uint8_t *src, int src_linesize, @@ -387,7 +387,8 @@ int y, int x, int plane, int jobnr) { SliceContext *sc = &s->slices[jobnr]; - const int buffer_linesize = s->block_size * s->block_size; + const int pblock_size = s->pblock_size; + const int buffer_linesize = s->pblock_size * s->pblock_size; const int nb_match_blocks = sc->nb_match_blocks; const int block_size = s->block_size; const int width = s->planewidth[plane]; @@ -395,54 +396,50 @@ const int group_size = s->group_size; float *buffer = sc->buffer; float *bufferh = sc->bufferh; + float *buffert = sc->buffert; float *bufferv = sc->bufferv; float *bufferz = sc->bufferz; float threshold[4]; float den_weight, num_weight; int retained = 0; - int i, j, k; - for (k = 0; k < nb_match_blocks; k++) { + for (int k = 0; k < nb_match_blocks; k++) { const int y = sc->match_blocks[k].y; const int x = sc->match_blocks[k].x; - for (i = 0; i < block_size; i++) { - s->get_block_row(src, src_linesize, y + i, x, block_size, bufferh + block_size * i); - av_dct_calc(sc->dctf, bufferh + block_size * i); + for (int i = 0; i < block_size; i++) { + s->get_block_row(src, src_linesize, y + i, x, block_size, bufferh + pblock_size * i); + sc->tx_fn(sc->dctf, buffert, bufferh + pblock_size * i, sizeof(float)); + for (int j = 0; j < block_size; j++) + bufferv[j * pblock_size + i] = buffert[j]; } - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - bufferv[i * block_size + j] = bufferh[j * block_size + i]; - } - av_dct_calc(sc->dctf, bufferv + i * block_size); - } - - for (i = 0; i < block_size; i++) { - memcpy(buffer + k * buffer_linesize + i * block_size, - bufferv + i * block_size, block_size * 4); + for (int i = 0; i < block_size; i++) { + sc->tx_fn(sc->dctf, buffert, bufferv + i * pblock_size, sizeof(float)); + memcpy(buffer + k * buffer_linesize + i * pblock_size, + buffert, block_size * sizeof(float)); } } - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - for (k = 0; k < nb_match_blocks; k++) - bufferz[k] = buffer[buffer_linesize * k + i * block_size + j]; + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { + for (int k = 0; k < nb_match_blocks; k++) + bufferz[k] = buffer[buffer_linesize * k + i * pblock_size + j]; if (group_size > 1) - av_dct_calc(sc->gdctf, bufferz); + sc->tx_fn_g(sc->gdctf, bufferz, bufferz, sizeof(float)); bufferz += pgroup_size; } } - threshold[0] = s->hard_threshold * s->sigma * M_SQRT2 * block_size * block_size * (1 << (s->depth - 8)) / 255.f; + threshold[0] = s->hard_threshold * s->sigma * M_SQRT2 * 4.f * block_size * block_size * (1 << (s->depth - 8)) / 255.f; threshold[1] = threshold[0] * sqrtf(2.f); threshold[2] = threshold[0] * 2.f; threshold[3] = threshold[0] * sqrtf(8.f); bufferz = sc->bufferz; - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - for (k = 0; k < nb_match_blocks; k++) { + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { + for (int k = 0; k < nb_match_blocks; k++) { const float thresh = threshold[(j == 0) + (i == 0) + (k == 0)]; if (bufferz[k] > thresh || bufferz[k] < -thresh) { @@ -457,13 +454,12 @@ bufferz = sc->bufferz; buffer = sc->buffer; - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { if (group_size > 1) - av_dct_calc(sc->gdcti, bufferz); - for (k = 0; k < nb_match_blocks; k++) { - buffer[buffer_linesize * k + i * block_size + j] = bufferz[k]; - } + sc->itx_fn_g(sc->gdcti, bufferz, bufferz, sizeof(float)); + for (int k = 0; k < nb_match_blocks; k++) + buffer[buffer_linesize * k + i * pblock_size + j] = bufferz[k]; bufferz += pgroup_size; } } @@ -472,27 +468,26 @@ num_weight = den_weight; buffer = sc->buffer; - for (k = 0; k < nb_match_blocks; k++) { + for (int k = 0; k < nb_match_blocks; k++) { float *num = sc->num + y * width + x; float *den = sc->den + y * width + x; - for (i = 0; i < block_size; i++) { - memcpy(bufferv + i * block_size, - buffer + k * buffer_linesize + i * block_size, - block_size * 4); - } - - for (i = 0; i < block_size; i++) { - av_dct_calc(sc->dcti, bufferv + block_size * i); - for (j = 0; j < block_size; j++) { - bufferh[j * block_size + i] = bufferv[i * block_size + j]; - } - } - - for (i = 0; i < block_size; i++) { - av_dct_calc(sc->dcti, bufferh + block_size * i); - for (j = 0; j < block_size; j++) { - num[j] += bufferh[i * block_size + j] * num_weight; + for (int i = 0; i < block_size; i++) { + memcpy(bufferv + i * pblock_size, + buffer + k * buffer_linesize + i * pblock_size, + block_size * sizeof(float)); + } + + for (int i = 0; i < block_size; i++) { + sc->itx_fn(sc->dcti, buffert, bufferv + i * pblock_size, sizeof(float)); + for (int j = 0; j < block_size; j++) + bufferh[j * pblock_size + i] = buffert[j]; + } + + for (int i = 0; i < block_size; i++) { + sc->itx_fn(sc->dcti, buffert, bufferh + pblock_size * i, sizeof(float)); + for (int j = 0; j < block_size; j++) { + num[j] += buffert[j] * num_weight; den[j] += den_weight; } num += width; @@ -506,7 +501,8 @@ int y, int x, int plane, int jobnr) { SliceContext *sc = &s->slices[jobnr]; - const int buffer_linesize = s->block_size * s->block_size; + const int pblock_size = s->pblock_size; + const int buffer_linesize = s->pblock_size * s->pblock_size; const int nb_match_blocks = sc->nb_match_blocks; const int block_size = s->block_size; const int width = s->planewidth[plane]; @@ -523,45 +519,44 @@ float *rbufferz = sc->rbufferz; float den_weight, num_weight; float l2_wiener = 0; - int i, j, k; - for (k = 0; k < nb_match_blocks; k++) { + for (int k = 0; k < nb_match_blocks; k++) { const int y = sc->match_blocks[k].y; const int x = sc->match_blocks[k].x; - for (i = 0; i < block_size; i++) { - s->get_block_row(src, src_linesize, y + i, x, block_size, bufferh + block_size * i); - s->get_block_row(ref, ref_linesize, y + i, x, block_size, rbufferh + block_size * i); - av_dct_calc(sc->dctf, bufferh + block_size * i); - av_dct_calc(sc->dctf, rbufferh + block_size * i); + for (int i = 0; i < block_size; i++) { + s->get_block_row(src, src_linesize, y + i, x, block_size, bufferh + pblock_size * i); + s->get_block_row(ref, ref_linesize, y + i, x, block_size, rbufferh + pblock_size * i); + sc->tx_fn(sc->dctf, bufferh + pblock_size * i, bufferh + pblock_size * i, sizeof(float)); + sc->tx_fn(sc->dctf, rbufferh + pblock_size * i, rbufferh + pblock_size * i, sizeof(float)); } - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - bufferv[i * block_size + j] = bufferh[j * block_size + i]; - rbufferv[i * block_size + j] = rbufferh[j * block_size + i]; + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { + bufferv[i * pblock_size + j] = bufferh[j * pblock_size + i]; + rbufferv[i * pblock_size + j] = rbufferh[j * pblock_size + i]; } - av_dct_calc(sc->dctf, bufferv + i * block_size); - av_dct_calc(sc->dctf, rbufferv + i * block_size); + sc->tx_fn(sc->dctf, bufferv + i * pblock_size, bufferv + i * pblock_size, sizeof(float)); + sc->tx_fn(sc->dctf, rbufferv + i * pblock_size, rbufferv + i * pblock_size, sizeof(float)); } - for (i = 0; i < block_size; i++) { - memcpy(buffer + k * buffer_linesize + i * block_size, - bufferv + i * block_size, block_size * 4); - memcpy(rbuffer + k * buffer_linesize + i * block_size, - rbufferv + i * block_size, block_size * 4); + for (int i = 0; i < block_size; i++) { + memcpy(buffer + k * buffer_linesize + i * pblock_size, + bufferv + i * pblock_size, block_size * sizeof(float)); + memcpy(rbuffer + k * buffer_linesize + i * pblock_size, + rbufferv + i * pblock_size, block_size * sizeof(float)); } } - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - for (k = 0; k < nb_match_blocks; k++) { - bufferz[k] = buffer[buffer_linesize * k + i * block_size + j]; - rbufferz[k] = rbuffer[buffer_linesize * k + i * block_size + j]; + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { + for (int k = 0; k < nb_match_blocks; k++) { + bufferz[k] = buffer[buffer_linesize * k + i * pblock_size + j]; + rbufferz[k] = rbuffer[buffer_linesize * k + i * pblock_size + j]; } if (group_size > 1) { - av_dct_calc(sc->gdctf, bufferz); - av_dct_calc(sc->gdctf, rbufferz); + sc->tx_fn_g(sc->gdctf, bufferz, bufferz, sizeof(float)); + sc->tx_fn_g(sc->gdctf, rbufferz, rbufferz, sizeof(float)); } bufferz += pgroup_size; rbufferz += pgroup_size; @@ -571,9 +566,9 @@ bufferz = sc->bufferz; rbufferz = sc->rbufferz; - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { - for (k = 0; k < nb_match_blocks; k++) { + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { + for (int k = 0; k < nb_match_blocks; k++) { const float ref_sqr = rbufferz[k] * rbufferz[k]; float wiener_coef = ref_sqr / (ref_sqr + sigma_sqr); @@ -589,12 +584,12 @@ bufferz = sc->bufferz; buffer = sc->buffer; - for (i = 0; i < block_size; i++) { - for (j = 0; j < block_size; j++) { + for (int i = 0; i < block_size; i++) { + for (int j = 0; j < block_size; j++) { if (group_size > 1) - av_dct_calc(sc->gdcti, bufferz); - for (k = 0; k < nb_match_blocks; k++) { - buffer[buffer_linesize * k + i * block_size + j] = bufferz[k]; + sc->itx_fn_g(sc->gdcti, bufferz, bufferz, sizeof(float)); + for (int k = 0; k < nb_match_blocks; k++) { + buffer[buffer_linesize * k + i * pblock_size + j] = bufferz[k]; } bufferz += pgroup_size; } @@ -604,27 +599,27 @@ den_weight = 1.f / l2_wiener; num_weight = den_weight; - for (k = 0; k < nb_match_blocks; k++) { + for (int k = 0; k < nb_match_blocks; k++) { float *num = sc->num + y * width + x; float *den = sc->den + y * width + x; - for (i = 0; i < block_size; i++) { - memcpy(bufferv + i * block_size, - buffer + k * buffer_linesize + i * block_size, - block_size * 4); + for (int i = 0; i < block_size; i++) { + memcpy(bufferv + i * pblock_size, + buffer + k * buffer_linesize + i * pblock_size, + block_size * sizeof(float)); } - for (i = 0; i < block_size; i++) { - av_dct_calc(sc->dcti, bufferv + block_size * i); - for (j = 0; j < block_size; j++) { - bufferh[j * block_size + i] = bufferv[i * block_size + j]; + for (int i = 0; i < block_size; i++) { + sc->itx_fn(sc->dcti, bufferv + pblock_size * i, bufferv + pblock_size * i, sizeof(float)); + for (int j = 0; j < block_size; j++) { + bufferh[j * pblock_size + i] = bufferv[i * pblock_size + j]; } } - for (i = 0; i < block_size; i++) { - av_dct_calc(sc->dcti, bufferh + block_size * i); - for (j = 0; j < block_size; j++) { - num[j] += bufferh[i * block_size + j] * num_weight; + for (int i = 0; i < block_size; i++) { + sc->itx_fn(sc->dcti, bufferh + pblock_size * i, bufferh + pblock_size * i, sizeof(float)); + for (int j = 0; j < block_size; j++) { + num[j] += bufferh[i * pblock_size + j] * num_weight; den[j] += den_weight; } num += width; @@ -638,15 +633,14 @@ { const int height = s->planeheight[plane]; const int width = s->planewidth[plane]; - int i, j, k; - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { uint8_t *dstp = dst + i * dst_linesize; float sum_den = 0.f; float sum_num = 0.f; - for (k = 0; k < nb_jobs; k++) { + for (int k = 0; k < nb_jobs; k++) { SliceContext *sc = &s->slices[k]; float num = sc->num[i * width + j]; float den = sc->den[i * width + j]; @@ -666,15 +660,14 @@ const int height = s->planeheight[plane]; const int width = s->planewidth[plane]; const int depth = s->depth; - int i, j, k; - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) { + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { uint16_t *dstp = (uint16_t *)dst + i * dst_linesize / 2; float sum_den = 0.f; float sum_num = 0.f; - for (k = 0; k < nb_jobs; k++) { + for (int k = 0; k < nb_jobs; k++) { SliceContext *sc = &s->slices[k]; float num = sc->num[i * width + j]; float den = sc->den[i * width + j]; @@ -706,17 +699,16 @@ const int slice_start = (((height + block_step - 1) / block_step) * jobnr / nb_jobs) * block_step; const int slice_end = (jobnr == nb_jobs - 1) ? block_pos_bottom + block_step : (((height + block_step - 1) / block_step) * (jobnr + 1) / nb_jobs) * block_step; - int i, j; - memset(sc->num, 0, width * height * sizeof(FFTSample)); - memset(sc->den, 0, width * height * sizeof(FFTSample)); + memset(sc->num, 0, width * height * sizeof(float)); + memset(sc->den, 0, width * height * sizeof(float)); - for (j = slice_start; j < slice_end; j += block_step) { + for (int j = slice_start; j < slice_end; j += block_step) { if (j > block_pos_bottom) { j = block_pos_bottom; } - for (i = 0; i < block_pos_right + block_step; i += block_step) { + for (int i = 0; i < block_pos_right + block_step; i += block_step) { if (i > block_pos_right) { i = block_pos_right; } @@ -749,7 +741,7 @@ if (!((1 << p) & s->planes) || ctx->is_disabled) { av_image_copy_plane((*out)->data[p], (*out)->linesize[p], in->data[p], in->linesize[p], - s->planewidth[p], s->planeheight[p]); + s->planewidth[p] * (1 + (s->depth > 8)), s->planeheight[p]); continue; } @@ -773,7 +765,6 @@ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFilterContext *ctx = inlink->dst; BM3DContext *s = ctx->priv; - int i, group_bits; s->nb_threads = FFMIN(ff_filter_get_nb_threads(ctx), MAX_NB_THREADS); s->nb_planes = av_pix_fmt_count_planes(inlink->format); @@ -783,43 +774,53 @@ s->planeheight[0] = s->planeheight[3] = inlink->h; s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); s->planewidth[0] = s->planewidth[3] = inlink->w; + s->pblock_size = FFALIGN(s->block_size * 2, av_cpu_max_align()); + s->pgroup_size = FFALIGN(s->group_size * 2, av_cpu_max_align()); - for (group_bits = 4; 1 << group_bits < s->group_size; group_bits++); - s->group_bits = group_bits; - s->pgroup_size = 1 << group_bits; - - for (i = 0; i < s->nb_threads; i++) { + for (int i = 0; i < s->nb_threads; i++) { SliceContext *sc = &s->slices[i]; + float iscale = 0.5f / s->block_size; + float scale = 1.f; + int ret; - sc->num = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(FFTSample)); - sc->den = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(FFTSample)); + sc->num = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(float)); + sc->den = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(float)); if (!sc->num || !sc->den) return AVERROR(ENOMEM); - sc->dctf = av_dct_init(av_log2(s->block_size), DCT_II); - sc->dcti = av_dct_init(av_log2(s->block_size), DCT_III); - if (!sc->dctf || !sc->dcti) - return AVERROR(ENOMEM); + ret = av_tx_init(&sc->dctf, &sc->tx_fn, AV_TX_FLOAT_DCT, 0, s->block_size >> 0, &scale, 0); + if (ret < 0) + return ret; - if (s->group_bits > 1) { - sc->gdctf = av_dct_init(s->group_bits, DCT_II); - sc->gdcti = av_dct_init(s->group_bits, DCT_III); - if (!sc->gdctf || !sc->gdcti) - return AVERROR(ENOMEM); + ret = av_tx_init(&sc->dcti, &sc->itx_fn, AV_TX_FLOAT_DCT, 1, s->block_size >> 1, &iscale, 0); + if (ret < 0) + return ret; + + if (s->group_size > 1) { + float iscale = 0.5f / s->group_size; + + ret = av_tx_init(&sc->gdctf, &sc->tx_fn_g, AV_TX_FLOAT_DCT, 0, s->group_size >> 0, &scale, 0); + if (ret < 0) + return ret; + + ret = av_tx_init(&sc->gdcti, &sc->itx_fn_g, AV_TX_FLOAT_DCT, 1, s->group_size >> 1, &iscale, 0); + if (ret < 0) + return ret; } - sc->buffer = av_calloc(s->block_size * s->block_size * s->pgroup_size, sizeof(*sc->buffer)); - sc->bufferz = av_calloc(s->block_size * s->block_size * s->pgroup_size, sizeof(*sc->bufferz)); - sc->bufferh = av_calloc(s->block_size * s->block_size, sizeof(*sc->bufferh)); - sc->bufferv = av_calloc(s->block_size * s->block_size, sizeof(*sc->bufferv)); - if (!sc->bufferh || !sc->bufferv || !sc->buffer || !sc->bufferz) + sc->buffer = av_calloc(s->pblock_size * s->pblock_size * s->pgroup_size, sizeof(*sc->buffer)); + sc->bufferz = av_calloc(s->pblock_size * s->pblock_size * s->pgroup_size, sizeof(*sc->bufferz)); + sc->bufferh = av_calloc(s->pblock_size * s->pblock_size, sizeof(*sc->bufferh)); + sc->bufferv = av_calloc(s->pblock_size * s->pblock_size, sizeof(*sc->bufferv)); + sc->buffert = av_calloc(s->pblock_size, sizeof(*sc->buffert)); + if (!sc->bufferh || !sc->bufferv || !sc->buffer || !sc->bufferz || !sc->buffert) return AVERROR(ENOMEM); if (s->mode == FINAL) { - sc->rbuffer = av_calloc(s->block_size * s->block_size * s->pgroup_size, sizeof(*sc->rbuffer)); - sc->rbufferz = av_calloc(s->block_size * s->block_size * s->pgroup_size, sizeof(*sc->rbufferz)); - sc->rbufferh = av_calloc(s->block_size * s->block_size, sizeof(*sc->rbufferh)); - sc->rbufferv = av_calloc(s->block_size * s->block_size, sizeof(*sc->rbufferv)); + sc->rbuffer = av_calloc(s->pblock_size * s->pblock_size * s->pgroup_size, sizeof(*sc->rbuffer)); + sc->rbufferz = av_calloc(s->pblock_size * s->pblock_size * s->pgroup_size, sizeof(*sc->rbufferz)); + sc->rbufferh = av_calloc(s->pblock_size * s->pblock_size, sizeof(*sc->rbufferh)); + sc->rbufferv = av_calloc(s->pblock_size * s->pblock_size, sizeof(*sc->rbufferv)); if (!sc->rbufferh || !sc->rbufferv || !sc->rbuffer || !sc->rbufferz) return AVERROR(ENOMEM); } @@ -919,13 +920,12 @@ return AVERROR_BUG; } - s->block_size = 1 << s->block_size; - if (s->block_step > s->block_size) { av_log(ctx, AV_LOG_WARNING, "bstep: %d can't be bigger than block size. Changing to %d.\n", s->block_step, s->block_size); s->block_step = s->block_size; } + if (s->bm_step > s->bm_range) { av_log(ctx, AV_LOG_WARNING, "mstep: %d can't be bigger than block matching range. Changing to %d.\n", s->bm_step, s->bm_range); @@ -1004,24 +1004,24 @@ static av_cold void uninit(AVFilterContext *ctx) { BM3DContext *s = ctx->priv; - int i; if (s->ref) ff_framesync_uninit(&s->fs); - for (i = 0; i < s->nb_threads; i++) { + for (int i = 0; i < s->nb_threads; i++) { SliceContext *sc = &s->slices[i]; av_freep(&sc->num); av_freep(&sc->den); - av_dct_end(sc->gdctf); - av_dct_end(sc->gdcti); - av_dct_end(sc->dctf); - av_dct_end(sc->dcti); + av_tx_uninit(&sc->gdctf); + av_tx_uninit(&sc->gdcti); + av_tx_uninit(&sc->dctf); + av_tx_uninit(&sc->dcti); av_freep(&sc->buffer); av_freep(&sc->bufferh); + av_freep(&sc->buffert); av_freep(&sc->bufferv); av_freep(&sc->bufferz); av_freep(&sc->rbuffer); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromakey.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromakey.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromakey.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromakey.c 2023-03-03 13:29:59.000000000 +0000 @@ -348,7 +348,7 @@ static const AVOption chromakey_options[] = { { "color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, - { "similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, + { "similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.00001, 1.0, FLAGS }, { "blend", "set the chromakey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { NULL } @@ -381,7 +381,7 @@ static const AVOption chromahold_options[] = { { "color", "set the chromahold key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, - { "similarity", "set the chromahold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, + { "similarity", "set the chromahold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.00001, 1.0, FLAGS }, { "blend", "set the chromahold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { NULL } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromanr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromanr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromanr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_chromanr.c 2023-03-03 13:29:59.000000000 +0000 @@ -75,7 +75,7 @@ #define MANHATTAN_DISTANCE(x, y, z) ((x) + (y) + (z)) #define EUCLIDEAN_DISTANCE(x, y, z) (sqrtf((x)*(x) + (y)*(y) + (z)*(z))) -#define FILTER_FUNC(distance, name, ctype, type, fun) \ +#define FILTER_FUNC(distance, name, ctype, type, fun, extra) \ static int distance ## _slice##name(AVFilterContext *ctx, void *arg, \ int jobnr, int nb_jobs) \ { \ @@ -128,8 +128,12 @@ const type *in_yptr = (const type *)(in->data[0] + y * chroma_h * in_ylinesize); \ const type *in_uptr = (const type *)(in->data[1] + y * in_ulinesize); \ const type *in_vptr = (const type *)(in->data[2] + y * in_vlinesize); \ + const int yystart = FFMAX(0, y - sizeh); \ + const int yystop = FFMIN(h - 1, y + sizeh); \ \ for (int x = 0; x < w; x++) { \ + const int xxstart = FFMAX(0, x - sizew); \ + const int xxstop = FFMIN(w - 1, x + sizew); \ const int cy = in_yptr[x * chroma_w]; \ const int cu = in_uptr[x]; \ const int cv = in_vptr[x]; \ @@ -137,12 +141,12 @@ int sv = cv; \ int cn = 1; \ \ - for (int yy = FFMAX(0, y - sizeh); yy <= FFMIN(y + sizeh, h - 1); yy += steph) { \ + for (int yy = yystart; yy <= yystop; yy += steph) { \ const type *in_yptr = (const type *)(in->data[0] + yy * chroma_h * in_ylinesize); \ const type *in_uptr = (const type *)(in->data[1] + yy * in_ulinesize); \ const type *in_vptr = (const type *)(in->data[2] + yy * in_vlinesize); \ \ - for (int xx = FFMAX(0, x - sizew); xx <= FFMIN(x + sizew, w - 1); xx += stepw) { \ + for (int xx = xxstart; xx <= xxstop; xx += stepw) { \ const ctype Y = in_yptr[xx * chroma_w]; \ const ctype U = in_uptr[xx]; \ const ctype V = in_vptr[xx]; \ @@ -150,10 +154,13 @@ const ctype cuU = FFABS(cu - U); \ const ctype cvV = FFABS(cv - V); \ \ - if (fun(cyY, cuU, cvV) < thres && \ + if (extra && fun(cyY, cuU, cvV) < thres && \ cuU < thres_u && cvV < thres_v && \ - cyY < thres_y && \ - xx != x && yy != y) { \ + cyY < thres_y) { \ + su += U; \ + sv += V; \ + cn++; \ + } else if (fun(cyY, cuU, cvV) < thres) { \ su += U; \ sv += V; \ cn++; \ @@ -172,11 +179,17 @@ return 0; \ } -FILTER_FUNC(manhattan, 8, int, uint8_t, MANHATTAN_DISTANCE) -FILTER_FUNC(manhattan, 16, int, uint16_t, MANHATTAN_DISTANCE) +FILTER_FUNC(manhattan, 8, int, uint8_t, MANHATTAN_DISTANCE, 0) +FILTER_FUNC(manhattan, 16, int, uint16_t, MANHATTAN_DISTANCE, 0) + +FILTER_FUNC(euclidean, 8, int, uint8_t, EUCLIDEAN_DISTANCE, 0) +FILTER_FUNC(euclidean, 16, int64_t, uint16_t, EUCLIDEAN_DISTANCE, 0) -FILTER_FUNC(euclidean, 8, int, uint8_t, EUCLIDEAN_DISTANCE) -FILTER_FUNC(euclidean, 16, int64_t, uint16_t, EUCLIDEAN_DISTANCE) +FILTER_FUNC(manhattan_e, 8, int, uint8_t, MANHATTAN_DISTANCE, 1) +FILTER_FUNC(manhattan_e, 16, int, uint16_t, MANHATTAN_DISTANCE, 1) + +FILTER_FUNC(euclidean_e, 8, int, uint8_t, EUCLIDEAN_DISTANCE, 1) +FILTER_FUNC(euclidean_e, 16, int64_t, uint16_t, EUCLIDEAN_DISTANCE, 1) static int filter_frame(AVFilterLink *inlink, AVFrame *in) { @@ -199,6 +212,17 @@ s->thres_u = s->threshold_u * (1 << (s->depth - 8)); s->thres_v = s->threshold_v * (1 << (s->depth - 8)); + if (s->thres_y < 200.f || s->thres_u < 200.f || s->thres_v < 200.f) { + switch (s->distance) { + case 0: + s->filter_slice = s->depth <= 8 ? manhattan_e_slice8 : manhattan_e_slice16; + break; + case 1: + s->filter_slice = s->depth <= 8 ? euclidean_e_slice8 : euclidean_e_slice16; + break; + } + } + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!out) { av_frame_free(&in); @@ -243,8 +267,8 @@ static const AVOption chromanr_options[] = { { "thres", "set y+u+v threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl=30}, 1, 200, VF }, - { "sizew", "set horizontal size", OFFSET(sizew), AV_OPT_TYPE_INT, {.i64=5}, 1, 100, VF }, - { "sizeh", "set vertical size", OFFSET(sizeh), AV_OPT_TYPE_INT, {.i64=5}, 1, 100, VF }, + { "sizew", "set horizontal patch size", OFFSET(sizew), AV_OPT_TYPE_INT, {.i64=5}, 1, 100, VF }, + { "sizeh", "set vertical patch size", OFFSET(sizeh), AV_OPT_TYPE_INT, {.i64=5}, 1, 100, VF }, { "stepw", "set horizontal step", OFFSET(stepw), AV_OPT_TYPE_INT, {.i64=1}, 1, 50, VF }, { "steph", "set vertical step", OFFSET(steph), AV_OPT_TYPE_INT, {.i64=1}, 1, 50, VF }, { "threy", "set y threshold", OFFSET(threshold_y), AV_OPT_TYPE_FLOAT, {.dbl=200},1, 200, VF }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ciescope.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ciescope.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ciescope.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ciescope.c 2023-03-03 13:29:59.000000000 +0000 @@ -855,8 +855,6 @@ *z = m[2][0] * rc + m[2][1] * gc + m[2][2] * bc; scale = *x + *y + *z; - if (scale == 0.f) - scale = 1.f; scale = 1.f / scale; *x = *x * scale; *y = *y * scale; @@ -1010,27 +1008,44 @@ int w, int h, const uint16_t *const rgbcolor) { - int dx = FFABS(x1 - x0), sx = x0 < x1 ? 1 : -1; - int dy = FFABS(y1 - y0), sy = y0 < y1 ? 1 : -1; - int err = (dx > dy ? dx : -dy) / 2, e2; + int sx = x0 < x1 ? 1 : -1, sy = y0 < y1 ? 1 : -1, x2; + int dx = FFABS(x1-x0), dy = FFABS(y1-y0), err = dx * dx + dy * dy; + int e2 = err == 0 ? 1 : 0xffffff / (dx + dy); + + dx *= e2; + dy *= e2; + err = dx - dy; for (;;) { - pixels[y0 * linesize + x0 * 4 + 0] = rgbcolor[0]; - pixels[y0 * linesize + x0 * 4 + 1] = rgbcolor[1]; - pixels[y0 * linesize + x0 * 4 + 2] = rgbcolor[2]; - pixels[y0 * linesize + x0 * 4 + 3] = rgbcolor[3]; - - if (x0 == x1 && y0 == y1) - break; + pixels[y0 * linesize + x0 * 4 + 0] = rgbcolor[0]-(FFABS(err - dx + dy) >> 8); + pixels[y0 * linesize + x0 * 4 + 1] = rgbcolor[1]-(FFABS(err - dx + dy) >> 8); + pixels[y0 * linesize + x0 * 4 + 2] = rgbcolor[2]-(FFABS(err - dx + dy) >> 8); + pixels[y0 * linesize + x0 * 4 + 3] = rgbcolor[3]-(FFABS(err - dx + dy) >> 8); e2 = err; - - if (e2 >-dx) { + x2 = x0; + if (2 * e2 >= -dx) { + if (x0 == x1) + break; + if (e2 + dy < 0xff0000) { + pixels[(y0 + sy) * linesize + x0 * 4 + 0] = rgbcolor[0]-(FFABS(e2 + dy) >> 8); + pixels[(y0 + sy) * linesize + x0 * 4 + 1] = rgbcolor[1]-(FFABS(e2 + dy) >> 8); + pixels[(y0 + sy) * linesize + x0 * 4 + 2] = rgbcolor[2]-(FFABS(e2 + dy) >> 8); + pixels[(y0 + sy) * linesize + x0 * 4 + 3] = rgbcolor[3]-(FFABS(e2 + dy) >> 8); + } err -= dy; x0 += sx; } - if (e2 < dy) { + if (2 * e2 <= dy) { + if (y0 == y1) + break; + if (dx - e2 < 0xff0000) { + pixels[y0 * linesize + (x2 + sx) * 4 + 0] = rgbcolor[0]-(FFABS(dx - e2) >> 8); + pixels[y0 * linesize + (x2 + sx) * 4 + 1] = rgbcolor[1]-(FFABS(dx - e2) >> 8); + pixels[y0 * linesize + (x2 + sx) * 4 + 2] = rgbcolor[2]-(FFABS(dx - e2) >> 8); + pixels[y0 * linesize + (x2 + sx) * 4 + 3] = rgbcolor[3]-(FFABS(dx - e2) >> 8); + } err += dx; y0 += sy; } @@ -1253,11 +1268,11 @@ float *cx, float *cy, int x, int y) { CiescopeContext *s = ctx->priv; - const float scale = 1. / 65535.; + const float scale = 1.f / 65535.f; const uint16_t *src = (const uint16_t*)(ptr + linesize * y + x * 6); - float r = src[0] * scale; - float g = src[1] * scale; - float b = src[2] * scale; + float r = (src[0] + 0.01f) * scale; + float g = (src[1] + 0.01f) * scale; + float b = (src[2] + 0.01f) * scale; float cz; rgb_to_xy(r, g, b, cx, cy, &cz, (const float (*)[3])s->m); @@ -1268,11 +1283,11 @@ float *cx, float *cy, int x, int y) { CiescopeContext *s = ctx->priv; - const float scale = 1. / 65535.; + const float scale = 1.f / 65535.f; const uint16_t *src = (const uint16_t*)(ptr + linesize * y + x * 8); - float r = src[0] * scale; - float g = src[1] * scale; - float b = src[2] * scale; + float r = (src[0] + 0.01f) * scale; + float g = (src[1] + 0.01f) * scale; + float b = (src[2] + 0.01f) * scale; float cz; rgb_to_xy(r, g, b, cx, cy, &cz, (const float (*)[3])s->m); @@ -1283,11 +1298,11 @@ float *cx, float *cy, int x, int y) { CiescopeContext *s = ctx->priv; - const float scale = 1. / 255.; + const float scale = 1.f / 255.f; const uint8_t *src = ptr + linesize * y + x * 3; - float r = src[0] * scale; - float g = src[1] * scale; - float b = src[2] * scale; + float r = (src[0] + 0.01f) * scale; + float g = (src[1] + 0.01f) * scale; + float b = (src[2] + 0.01f) * scale; float cz; rgb_to_xy(r, g, b, cx, cy, &cz, (const float (*)[3])s->m); @@ -1298,11 +1313,11 @@ float *cx, float *cy, int x, int y) { CiescopeContext *s = ctx->priv; - const float scale = 1. / 255.; + const float scale = 1.f / 255.f; const uint8_t *src = ptr + linesize * y + x * 4; - float r = src[0] * scale; - float g = src[1] * scale; - float b = src[2] * scale; + float r = (src[0] + 0.01f) * scale; + float g = (src[1] + 0.01f) * scale; + float b = (src[2] + 0.01f) * scale; float cz; rgb_to_xy(r, g, b, cx, cy, &cz, (const float (*)[3])s->m); @@ -1392,6 +1407,7 @@ return AVERROR(ENOMEM); } out->pts = in->pts; + out->duration = in->duration; if (!s->background) { ret = draw_background(ctx); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorkey.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorkey.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorkey.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorkey.c 2023-03-03 13:29:59.000000000 +0000 @@ -217,7 +217,7 @@ static const AVOption colorkey_options[] = { { "color", "set the colorkey key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, - { "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, + { "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.00001, 1.0, FLAGS }, { "blend", "set the colorkey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { NULL } }; @@ -241,7 +241,7 @@ static const AVOption colorhold_options[] = { { "color", "set the colorhold key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, - { "similarity", "set the colorhold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, + { "similarity", "set the colorhold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.00001, 1.0, FLAGS }, { "blend", "set the colorhold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { NULL } }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorlevels.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorlevels.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorlevels.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorlevels.c 2023-03-03 13:29:59.000000000 +0000 @@ -97,11 +97,13 @@ int h; + float fimin[4]; + float fomin[4]; int imin[4]; int omin[4]; } ThreadData; -#define DO_COMMON(type, clip, preserve, planar) \ +#define DO_COMMON(type, ptype, clip, preserve, planar) \ const ThreadData *td = arg; \ const int linesize = s->linesize; \ const int step = s->step; \ @@ -118,14 +120,14 @@ type *dst_g = (type *)(td->dstrow[G]) + src_linesize * slice_start; \ type *dst_b = (type *)(td->dstrow[B]) + src_linesize * slice_start; \ type *dst_a = (type *)(td->dstrow[A]) + src_linesize * slice_start; \ - const int imin_r = td->imin[R]; \ - const int imin_g = td->imin[G]; \ - const int imin_b = td->imin[B]; \ - const int imin_a = td->imin[A]; \ - const int omin_r = td->omin[R]; \ - const int omin_g = td->omin[G]; \ - const int omin_b = td->omin[B]; \ - const int omin_a = td->omin[A]; \ + const ptype imin_r = s->depth == 32 ? td->fimin[R] : td->imin[R]; \ + const ptype imin_g = s->depth == 32 ? td->fimin[G] : td->imin[G]; \ + const ptype imin_b = s->depth == 32 ? td->fimin[B] : td->imin[B]; \ + const ptype imin_a = s->depth == 32 ? td->fimin[A] : td->imin[A]; \ + const ptype omin_r = s->depth == 32 ? td->fomin[R] : td->omin[R]; \ + const ptype omin_g = s->depth == 32 ? td->fomin[G] : td->omin[G]; \ + const ptype omin_b = s->depth == 32 ? td->fomin[B] : td->omin[B]; \ + const ptype omin_a = s->depth == 32 ? td->fomin[A] : td->omin[A]; \ const float coeff_r = td->coeff[R]; \ const float coeff_g = td->coeff[G]; \ const float coeff_b = td->coeff[B]; \ @@ -133,12 +135,12 @@ \ for (int y = slice_start; y < slice_end; y++) { \ for (int x = 0; x < linesize; x += step) { \ - int ir, ig, ib, or, og, ob; \ + ptype ir, ig, ib, or, og, ob; \ ir = src_r[x]; \ ig = src_g[x]; \ ib = src_b[x]; \ if (preserve) { \ - float ratio, icolor, ocolor, max = s->max; \ + float ratio, icolor, ocolor, max = s->depth==32 ? 1.f : s->max; \ \ or = (ir - imin_r) * coeff_r + omin_r; \ og = (ig - imin_g) * coeff_g + omin_g; \ @@ -180,39 +182,40 @@ #define CLIP8(x, depth) av_clip_uint8(x) #define CLIP16(x, depth) av_clip_uint16(x) +#define NOCLIP(x, depth) (x) static int colorlevels_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint8_t, CLIP8, 0, 0) + DO_COMMON(uint8_t, int, CLIP8, 0, 0) return 0; } static int colorlevels_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv;\ - DO_COMMON(uint16_t, CLIP16, 0, 0) + DO_COMMON(uint16_t, int, CLIP16, 0, 0) return 0; } static int colorlevels_preserve_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint8_t, CLIP8, 1, 0) + DO_COMMON(uint8_t, int, CLIP8, 1, 0) return 0; } static int colorlevels_preserve_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint16_t, CLIP16, 1, 0) + DO_COMMON(uint16_t, int, CLIP16, 1, 0) return 0; } static int colorlevels_slice_8_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint8_t, CLIP8, 0, 1) + DO_COMMON(uint8_t, int, CLIP8, 0, 1) return 0; } @@ -220,7 +223,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 9; - DO_COMMON(uint16_t, av_clip_uintp2, 0, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 0, 1) return 0; } @@ -228,7 +231,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 10; - DO_COMMON(uint16_t, av_clip_uintp2, 0, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 0, 1) return 0; } @@ -236,7 +239,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 12; - DO_COMMON(uint16_t, av_clip_uintp2, 0, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 0, 1) return 0; } @@ -244,21 +247,28 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 14; - DO_COMMON(uint16_t, av_clip_uintp2, 0, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 0, 1) return 0; } static int colorlevels_slice_16_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint16_t, CLIP16, 0, 1) + DO_COMMON(uint16_t, int, CLIP16, 0, 1) + return 0; +} + +static int colorlevels_slice_32_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + ColorLevelsContext *s = ctx->priv; + DO_COMMON(float, float, NOCLIP, 0, 1) return 0; } static int colorlevels_preserve_slice_8_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint8_t, CLIP8, 1, 1) + DO_COMMON(uint8_t, int, CLIP8, 1, 1) return 0; } @@ -266,7 +276,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 9; - DO_COMMON(uint16_t, av_clip_uintp2, 1, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 1, 1) return 0; } @@ -274,7 +284,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 10; - DO_COMMON(uint16_t, av_clip_uintp2, 1, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 1, 1) return 0; } @@ -282,7 +292,7 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 12; - DO_COMMON(uint16_t, av_clip_uintp2, 1, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 1, 1) return 0; } @@ -290,14 +300,21 @@ { ColorLevelsContext *s = ctx->priv; const int depth = 14; - DO_COMMON(uint16_t, av_clip_uintp2, 1, 1) + DO_COMMON(uint16_t, int, av_clip_uintp2, 1, 1) return 0; } static int colorlevels_preserve_slice_16_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ColorLevelsContext *s = ctx->priv; - DO_COMMON(uint16_t, CLIP16, 1, 1) + DO_COMMON(uint16_t, int, CLIP16, 1, 1) + return 0; +} + +static int colorlevels_preserve_slice_32_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ + ColorLevelsContext *s = ctx->priv; + DO_COMMON(float, float, NOCLIP, 1, 1) return 0; } @@ -349,6 +366,10 @@ s->colorlevels_slice[0] = colorlevels_slice_16_planar; s->colorlevels_slice[1] = colorlevels_preserve_slice_16_planar; break; + case 32: + s->colorlevels_slice[0] = colorlevels_slice_32_planar; + s->colorlevels_slice[1] = colorlevels_preserve_slice_32_planar; + break; } } @@ -479,6 +500,46 @@ td.omin[i] = omin; } break; + case 4: + for (int i = 0; i < s->nb_comp; i++) { + Range *r = &s->range[i]; + const uint8_t offset = s->rgba_map[i]; + const uint8_t *srcrow = in->data[0]; + float imin = r->in_min; + float imax = r->in_max; + float omin = r->out_min; + float omax = r->out_max; + float coeff; + + if (imin < 0.f) { + imin = 1.f; + for (int y = 0; y < inlink->h; y++) { + const float *src = (const float *)srcrow; + + for (int x = 0; x < s->linesize; x += step) + imin = fminf(imin, src[x + offset]); + srcrow += in->linesize[0]; + } + } + if (imax < 0.f) { + srcrow = in->data[0]; + imax = 0.f; + for (int y = 0; y < inlink->h; y++) { + const float *src = (const float *)srcrow; + + for (int x = 0; x < s->linesize; x += step) + imax = fmaxf(imax, src[x + offset]); + srcrow += in->linesize[0]; + } + } + + coeff = (omax - omin) / (double)(imax - imin); + + td.coeff[i] = coeff; + td.fimin[i] = imin; + td.fomin[i] = omin; + } + break; } ff_filter_execute(ctx, s->colorlevels_slice[s->preserve_color > 0], &td, NULL, @@ -524,7 +585,8 @@ AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRP14, - AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16), + AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, + AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include + +#include "libavutil/avstring.h" +#include "libavutil/common.h" +#include "libavutil/cuda_check.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_cuda_internal.h" +#include "libavutil/internal.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "scale_eval.h" +#include "video.h" + +#include "cuda/load_helper.h" + +static const enum AVPixelFormat supported_formats[] = { + AV_PIX_FMT_NV12, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV444P, +}; + +#define DIV_UP(a, b) (((a) + (b)-1) / (b)) +#define BLOCKX 32 +#define BLOCKY 16 + +#define CHECK_CU(x) FF_CUDA_CHECK_DL(ctx, s->hwctx->internal->cuda_dl, x) + +typedef struct CUDAColorspaceContext { + const AVClass* class; + + AVCUDADeviceContext* hwctx; + AVBufferRef* frames_ctx; + AVFrame* own_frame; + AVFrame* tmp_frame; + + CUcontext cu_ctx; + CUstream cu_stream; + CUmodule cu_module; + CUfunction cu_convert[AVCOL_RANGE_NB]; + + enum AVPixelFormat pix_fmt; + enum AVColorRange range; + + int num_planes; +} CUDAColorspaceContext; + +static av_cold int cudacolorspace_init(AVFilterContext* ctx) +{ + CUDAColorspaceContext* s = ctx->priv; + + s->own_frame = av_frame_alloc(); + if (!s->own_frame) + return AVERROR(ENOMEM); + + s->tmp_frame = av_frame_alloc(); + if (!s->tmp_frame) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold void cudacolorspace_uninit(AVFilterContext* ctx) +{ + CUDAColorspaceContext* s = ctx->priv; + + if (s->hwctx && s->cu_module) { + CudaFunctions* cu = s->hwctx->internal->cuda_dl; + CUcontext dummy; + + CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); + CHECK_CU(cu->cuModuleUnload(s->cu_module)); + s->cu_module = NULL; + CHECK_CU(cu->cuCtxPopCurrent(&dummy)); + } + + av_frame_free(&s->own_frame); + av_buffer_unref(&s->frames_ctx); + av_frame_free(&s->tmp_frame); +} + +static av_cold int init_hwframe_ctx(CUDAColorspaceContext* s, AVBufferRef* device_ctx, + int width, int height) +{ + AVBufferRef* out_ref = NULL; + AVHWFramesContext* out_ctx; + int ret; + + out_ref = av_hwframe_ctx_alloc(device_ctx); + if (!out_ref) + return AVERROR(ENOMEM); + + out_ctx = (AVHWFramesContext*)out_ref->data; + + out_ctx->format = AV_PIX_FMT_CUDA; + out_ctx->sw_format = s->pix_fmt; + out_ctx->width = FFALIGN(width, 32); + out_ctx->height = FFALIGN(height, 32); + + ret = av_hwframe_ctx_init(out_ref); + if (ret < 0) + goto fail; + + av_frame_unref(s->own_frame); + ret = av_hwframe_get_buffer(out_ref, s->own_frame, 0); + if (ret < 0) + goto fail; + + s->own_frame->width = width; + s->own_frame->height = height; + + av_buffer_unref(&s->frames_ctx); + s->frames_ctx = out_ref; + + return 0; +fail: + av_buffer_unref(&out_ref); + return ret; +} + +static int format_is_supported(enum AVPixelFormat fmt) +{ + for (int i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) + if (fmt == supported_formats[i]) + return 1; + + return 0; +} + +static av_cold int init_processing_chain(AVFilterContext* ctx, int width, + int height) +{ + CUDAColorspaceContext* s = ctx->priv; + AVHWFramesContext* in_frames_ctx; + + int ret; + + if (!ctx->inputs[0]->hw_frames_ctx) { + av_log(ctx, AV_LOG_ERROR, "No hw context provided on input\n"); + return AVERROR(EINVAL); + } + + in_frames_ctx = (AVHWFramesContext*)ctx->inputs[0]->hw_frames_ctx->data; + s->pix_fmt = in_frames_ctx->sw_format; + + if (!format_is_supported(s->pix_fmt)) { + av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", + av_get_pix_fmt_name(s->pix_fmt)); + return AVERROR(EINVAL); + } + + if ((AVCOL_RANGE_MPEG != s->range) && (AVCOL_RANGE_JPEG != s->range)) { + av_log(ctx, AV_LOG_ERROR, "Unsupported color range\n"); + return AVERROR(EINVAL); + } + + s->num_planes = av_pix_fmt_count_planes(s->pix_fmt); + + ret = init_hwframe_ctx(s, in_frames_ctx->device_ref, width, height); + if (ret < 0) + return ret; + + ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->frames_ctx); + if (!ctx->outputs[0]->hw_frames_ctx) + return AVERROR(ENOMEM); + + return 0; +} + +static av_cold int cudacolorspace_load_functions(AVFilterContext* ctx) +{ + CUDAColorspaceContext* s = ctx->priv; + CUcontext dummy, cuda_ctx = s->hwctx->cuda_ctx; + CudaFunctions* cu = s->hwctx->internal->cuda_dl; + int ret; + + extern const unsigned char ff_vf_colorspace_cuda_ptx_data[]; + extern const unsigned int ff_vf_colorspace_cuda_ptx_len; + + ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx)); + if (ret < 0) + return ret; + + ret = ff_cuda_load_module(ctx, s->hwctx, &s->cu_module, + ff_vf_colorspace_cuda_ptx_data, + ff_vf_colorspace_cuda_ptx_len); + if (ret < 0) + goto fail; + + ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_convert[AVCOL_RANGE_MPEG], s->cu_module, "to_mpeg_cuda")); + if (ret < 0) + goto fail; + + ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_convert[AVCOL_RANGE_JPEG], s->cu_module, "to_jpeg_cuda")); + if (ret < 0) + goto fail; + +fail: + CHECK_CU(cu->cuCtxPopCurrent(&dummy)); + return ret; +} + +static av_cold int cudacolorspace_config_props(AVFilterLink* outlink) +{ + AVFilterContext* ctx = outlink->src; + AVFilterLink* inlink = outlink->src->inputs[0]; + CUDAColorspaceContext* s = ctx->priv; + AVHWFramesContext* frames_ctx = + (AVHWFramesContext*)inlink->hw_frames_ctx->data; + AVCUDADeviceContext* device_hwctx = frames_ctx->device_ctx->hwctx; + int ret; + + s->hwctx = device_hwctx; + s->cu_stream = s->hwctx->stream; + + outlink->w = inlink->w; + outlink->h = inlink->h; + + ret = init_processing_chain(ctx, inlink->w, inlink->h); + if (ret < 0) + return ret; + + if (inlink->sample_aspect_ratio.num) { + outlink->sample_aspect_ratio = av_mul_q( + (AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, + inlink->sample_aspect_ratio); + } else { + outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; + } + + ret = cudacolorspace_load_functions(ctx); + if (ret < 0) + return ret; + + return ret; +} + +static int conv_cuda_convert(AVFilterContext* ctx, AVFrame* out, AVFrame* in) +{ + CUDAColorspaceContext* s = ctx->priv; + CudaFunctions* cu = s->hwctx->internal->cuda_dl; + CUcontext dummy, cuda_ctx = s->hwctx->cuda_ctx; + int ret; + + ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx)); + if (ret < 0) + return ret; + + out->color_range = s->range; + + for (int i = 0; i < s->num_planes; i++) { + int width = in->width, height = in->height, comp_id = (i > 0); + + switch (s->pix_fmt) { + case AV_PIX_FMT_YUV444P: + break; + case AV_PIX_FMT_YUV420P: + width = comp_id ? in->width / 2 : in->width; + /* fall-through */ + case AV_PIX_FMT_NV12: + height = comp_id ? in->height / 2 : in->height; + break; + default: + av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", + av_get_pix_fmt_name(s->pix_fmt)); + return AVERROR(EINVAL); + } + + if (!s->cu_convert[out->color_range]) { + av_log(ctx, AV_LOG_ERROR, "Unsupported color range\n"); + return AVERROR(EINVAL); + } + + if (in->color_range != out->color_range) { + void* args[] = {&in->data[i], &out->data[i], &in->linesize[i], + &comp_id}; + ret = CHECK_CU(cu->cuLaunchKernel( + s->cu_convert[out->color_range], DIV_UP(width, BLOCKX), + DIV_UP(height, BLOCKY), 1, BLOCKX, BLOCKY, 1, 0, s->cu_stream, + args, NULL)); + } else { + ret = av_hwframe_transfer_data(out, in, 0); + if (ret < 0) + return ret; + } + } + + CHECK_CU(cu->cuCtxPopCurrent(&dummy)); + return ret; +} + +static int cudacolorspace_conv(AVFilterContext* ctx, AVFrame* out, AVFrame* in) +{ + CUDAColorspaceContext* s = ctx->priv; + AVFilterLink* outlink = ctx->outputs[0]; + AVFrame* src = in; + int ret; + + ret = conv_cuda_convert(ctx, s->own_frame, src); + if (ret < 0) + return ret; + + src = s->own_frame; + ret = av_hwframe_get_buffer(src->hw_frames_ctx, s->tmp_frame, 0); + if (ret < 0) + return ret; + + av_frame_move_ref(out, s->own_frame); + av_frame_move_ref(s->own_frame, s->tmp_frame); + + s->own_frame->width = outlink->w; + s->own_frame->height = outlink->h; + + ret = av_frame_copy_props(out, in); + if (ret < 0) + return ret; + + return 0; +} + +static int cudacolorspace_filter_frame(AVFilterLink* link, AVFrame* in) +{ + AVFilterContext* ctx = link->dst; + CUDAColorspaceContext* s = ctx->priv; + AVFilterLink* outlink = ctx->outputs[0]; + CudaFunctions* cu = s->hwctx->internal->cuda_dl; + + AVFrame* out = NULL; + CUcontext dummy; + int ret = 0; + + out = av_frame_alloc(); + if (!out) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); + if (ret < 0) + goto fail; + + ret = cudacolorspace_conv(ctx, out, in); + + CHECK_CU(cu->cuCtxPopCurrent(&dummy)); + if (ret < 0) + goto fail; + + av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den, + (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w, + (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h, + INT_MAX); + + av_frame_free(&in); + return ff_filter_frame(outlink, out); +fail: + av_frame_free(&in); + av_frame_free(&out); + return ret; +} + +#define OFFSET(x) offsetof(CUDAColorspaceContext, x) +#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM) +static const AVOption options[] = { + {"range", "Output video range", OFFSET(range), AV_OPT_TYPE_INT, { .i64 = AVCOL_RANGE_UNSPECIFIED }, AVCOL_RANGE_UNSPECIFIED, AVCOL_RANGE_NB - 1, FLAGS, "range"}, + {"tv", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, "range"}, + {"mpeg", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, "range"}, + {"pc", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, "range"}, + {"jpeg", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, "range"}, + {NULL}, +}; + +static const AVClass cudacolorspace_class = { + .class_name = "colorspace_cuda", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +static const AVFilterPad cudacolorspace_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = cudacolorspace_filter_frame, + }, +}; + +static const AVFilterPad cudacolorspace_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = cudacolorspace_config_props, + }, +}; + +const AVFilter ff_vf_colorspace_cuda = { + .name = "colorspace_cuda", + .description = NULL_IF_CONFIG_SMALL("CUDA accelerated video color converter"), + + .init = cudacolorspace_init, + .uninit = cudacolorspace_uninit, + + .priv_size = sizeof(CUDAColorspaceContext), + .priv_class = &cudacolorspace_class, + + FILTER_INPUTS(cudacolorspace_inputs), + FILTER_OUTPUTS(cudacolorspace_outputs), + + FILTER_SINGLE_PIXFMT(AV_PIX_FMT_CUDA), + + .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.cu mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.cu --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.cu 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_colorspace_cuda.cu 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +extern "C" { +#define MPEG_LUMA_MIN (16) +#define MPEG_CHROMA_MIN (16) +#define MPEG_LUMA_MAX (235) +#define MPEG_CHROMA_MAX (240) + +#define JPEG_LUMA_MIN (0) +#define JPEG_CHROMA_MIN (1) +#define JPEG_LUMA_MAX (255) +#define JPEG_CHROMA_MAX (255) + +__device__ int mpeg_min[] = {MPEG_LUMA_MIN, MPEG_CHROMA_MIN}; +__device__ int mpeg_max[] = {MPEG_LUMA_MAX, MPEG_CHROMA_MAX}; + +__device__ int jpeg_min[] = {JPEG_LUMA_MIN, JPEG_CHROMA_MIN}; +__device__ int jpeg_max[] = {JPEG_LUMA_MAX, JPEG_CHROMA_MAX}; + +__device__ int clamp(int val, int min, int max) +{ + if (val < min) + return min; + else if (val > max) + return max; + else + return val; +} + +__global__ void to_jpeg_cuda(const unsigned char* src, unsigned char* dst, + int pitch, int comp_id) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int src_, dst_; + + // 8 bit -> 15 bit for better precision + src_ = static_cast(src[x + y * pitch]) << 7; + + // Conversion + dst_ = comp_id ? (min(src_, 30775) * 4663 - 9289992) >> 12 // chroma + : (min(src_, 30189) * 19077 - 39057361) >> 14; // luma + + // Dither replacement + dst_ = dst_ + 64; + + // Back to 8 bit + dst_ = clamp(dst_ >> 7, jpeg_min[comp_id], jpeg_max[comp_id]); + dst[x + y * pitch] = static_cast(dst_); +} + +__global__ void to_mpeg_cuda(const unsigned char* src, unsigned char* dst, + int pitch, int comp_id) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int src_, dst_; + + // 8 bit -> 15 bit for better precision + src_ = static_cast(src[x + y * pitch]) << 7; + + // Conversion + dst_ = comp_id ? (src_ * 1799 + 4081085) >> 11 // chroma + : (src_ * 14071 + 33561947) >> 14; // luma + + // Dither replacement + dst_ = dst_ + 64; + + // Back to 8 bit + dst_ = clamp(dst_ >> 7, mpeg_min[comp_id], mpeg_max[comp_id]); + dst[x + y * pitch] = static_cast(dst_); +} + +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolution.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolution.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolution.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolution.c 2023-03-03 13:29:59.000000000 +0000 @@ -139,24 +139,6 @@ } } -static void filter16_sobel(uint8_t *dstp, int width, - float scale, float delta, const int *const matrix, - const uint8_t *c[], int peak, int radius, - int dstride, int stride, int size) -{ - uint16_t *dst = (uint16_t *)dstp; - int x; - - for (x = 0; x < width; x++) { - float suma = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[1][2 * x]) * -2 + AV_RN16A(&c[2][2 * x]) * -1 + - AV_RN16A(&c[6][2 * x]) * 1 + AV_RN16A(&c[7][2 * x]) * 2 + AV_RN16A(&c[8][2 * x]) * 1; - float sumb = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[2][2 * x]) * 1 + AV_RN16A(&c[3][2 * x]) * -2 + - AV_RN16A(&c[5][2 * x]) * 2 + AV_RN16A(&c[6][2 * x]) * -1 + AV_RN16A(&c[8][2 * x]) * 1; - - dst[x] = av_clip(sqrtf(suma*suma + sumb*sumb) * scale + delta, 0, peak); - } -} - static void filter16_scharr(uint8_t *dstp, int width, float scale, float delta, const int *const matrix, const uint8_t *c[], int peak, int radius, @@ -261,26 +243,6 @@ } } -static void filter_sobel(uint8_t *dst, int width, - float scale, float delta, const int *const matrix, - const uint8_t *c[], int peak, int radius, - int dstride, int stride, int size) -{ - const uint8_t *c0 = c[0], *c1 = c[1], *c2 = c[2]; - const uint8_t *c3 = c[3], *c5 = c[5]; - const uint8_t *c6 = c[6], *c7 = c[7], *c8 = c[8]; - int x; - - for (x = 0; x < width; x++) { - float suma = c0[x] * -1 + c1[x] * -2 + c2[x] * -1 + - c6[x] * 1 + c7[x] * 2 + c8[x] * 1; - float sumb = c0[x] * -1 + c2[x] * 1 + c3[x] * -2 + - c5[x] * 2 + c6[x] * -1 + c8[x] * 1; - - dst[x] = av_clip_uint8(sqrtf(suma*suma + sumb*sumb) * scale + delta); - } -} - static void filter_scharr(uint8_t *dst, int width, float scale, float delta, const int *const matrix, const uint8_t *c[], int peak, int radius, @@ -552,22 +514,6 @@ } } -static void setup_3x3(int radius, const uint8_t *c[], const uint8_t *src, int stride, - int x, int w, int y, int h, int bpc) -{ - int i; - - for (i = 0; i < 9; i++) { - int xoff = FFABS(x + ((i % 3) - 1)); - int yoff = FFABS(y + (i / 3) - 1); - - xoff = xoff >= w ? 2 * w - 1 - xoff : xoff; - yoff = yoff >= h ? 2 * h - 1 - yoff : yoff; - - c[i] = src + xoff * bpc + yoff * stride; - } -} - static void setup_5x5(int radius, const uint8_t *c[], const uint8_t *src, int stride, int x, int w, int y, int h, int bpc) { @@ -708,6 +654,18 @@ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); int p, i; + s->depth = desc->comp[0].depth; + s->max = (1 << s->depth) - 1; + + s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + s->planewidth[0] = s->planewidth[3] = inlink->w; + s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + s->planeheight[0] = s->planeheight[3] = inlink->h; + + s->nb_planes = av_pix_fmt_count_planes(inlink->format); + s->nb_threads = ff_filter_get_nb_threads(ctx); + s->bpc = (s->depth + 7) / 8; + if (!strcmp(ctx->filter->name, "convolution")) { for (i = 0; i < 4; i++) { int *matrix = (int *)s->matrix[i]; @@ -804,14 +762,7 @@ s->bias[i] = s->delta; } } else if (!strcmp(ctx->filter->name, "sobel")) { - for (i = 0; i < 4; i++) { - s->filter[i] = filter_sobel; - s->copy[i] = !((1 << i) & s->planes); - s->size[i] = 3; - s->setup[i] = setup_3x3; - s->rdiv[i] = s->scale; - s->bias[i] = s->delta; - } + ff_sobel_init(s, s->depth, s->nb_planes); } else if (!strcmp(ctx->filter->name, "kirsch")) { for (i = 0; i < 4; i++) { s->filter[i] = filter_kirsch; @@ -832,18 +783,6 @@ } } - s->depth = desc->comp[0].depth; - s->max = (1 << s->depth) - 1; - - s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); - s->planewidth[0] = s->planewidth[3] = inlink->w; - s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); - s->planeheight[0] = s->planeheight[3] = inlink->h; - - s->nb_planes = av_pix_fmt_count_planes(inlink->format); - s->nb_threads = ff_filter_get_nb_threads(ctx); - s->bpc = (s->depth + 7) / 8; - if (!strcmp(ctx->filter->name, "convolution")) { if (s->depth > 8) { for (p = 0; p < s->nb_planes; p++) { @@ -870,10 +809,6 @@ if (s->depth > 8) for (p = 0; p < s->nb_planes; p++) s->filter[p] = filter16_roberts; - } else if (!strcmp(ctx->filter->name, "sobel")) { - if (s->depth > 8) - for (p = 0; p < s->nb_planes; p++) - s->filter[p] = filter16_sobel; } else if (!strcmp(ctx->filter->name, "kirsch")) { if (s->depth > 8) for (p = 0; p < s->nb_planes; p++) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolve.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolve.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolve.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_convolve.c 2023-03-03 13:29:59.000000000 +0000 @@ -196,7 +196,7 @@ int y; for (y = start; y < end; y++) { - s->tx_fn[plane](s->fft[plane][jobnr], hdata_out + y * n, hdata_in + y * n, sizeof(float)); + s->tx_fn[plane](s->fft[plane][jobnr], hdata_out + y * n, hdata_in + y * n, sizeof(AVComplexFloat)); } return 0; @@ -388,7 +388,7 @@ vdata_in[y * n + x].im = hdata[x * n + y].im; } - s->tx_fn[plane](s->fft[plane][jobnr], vdata_out + y * n, vdata_in + y * n, sizeof(float)); + s->tx_fn[plane](s->fft[plane][jobnr], vdata_out + y * n, vdata_in + y * n, sizeof(AVComplexFloat)); } return 0; @@ -408,7 +408,7 @@ int y, x; for (y = start; y < end; y++) { - s->itx_fn[plane](s->ifft[plane][jobnr], vdata_out + y * n, vdata_in + y * n, sizeof(float)); + s->itx_fn[plane](s->ifft[plane][jobnr], vdata_out + y * n, vdata_in + y * n, sizeof(AVComplexFloat)); for (x = 0; x < n; x++) { hdata[x * n + y].re = vdata_out[y * n + x].re; @@ -432,7 +432,7 @@ int y; for (y = start; y < end; y++) { - s->itx_fn[plane](s->ifft[plane][jobnr], hdata_out + y * n, hdata_in + y * n, sizeof(float)); + s->itx_fn[plane](s->ifft[plane][jobnr], hdata_out + y * n, hdata_in + y * n, sizeof(AVComplexFloat)); } return 0; @@ -778,7 +778,7 @@ for (i = 0; i < s->nb_planes; i++) { for (j = 0; j < MAX_THREADS; j++) { - float scale; + float scale = 1.f; ret = av_tx_init(&s->fft[i][j], &s->tx_fn[i], AV_TX_FLOAT_FFT, 0, s->fft_len[i], &scale, 0); if (ret < 0) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_coreimage.m mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_coreimage.m --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_coreimage.m 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_coreimage.m 2023-03-03 13:29:59.000000000 +0000 @@ -300,6 +300,7 @@ } frame->pts = ctx->pts; + frame->duration = 1; frame->key_frame = 1; frame->interlaced_frame = 0; frame->pict_type = AV_PICTURE_TYPE_I; @@ -415,8 +416,8 @@ // set user options if (filter_options) { - AVDictionaryEntry *o = NULL; - while ((o = av_dict_get(filter_options, "", o, AV_DICT_IGNORE_SUFFIX))) { + const AVDictionaryEntry *o = NULL; + while ((o = av_dict_iterate(filter_options, o))) { set_option(ctx, filter, o->key, o->value); } } @@ -426,10 +427,10 @@ static av_cold int init(AVFilterContext *fctx) { - CoreImageContext *ctx = fctx->priv; - AVDictionary *filter_dict = NULL; - AVDictionaryEntry *f = NULL; - AVDictionaryEntry *o = NULL; + CoreImageContext *ctx = fctx->priv; + AVDictionary *filter_dict = NULL; + const AVDictionaryEntry *f = NULL; + const AVDictionaryEntry *o = NULL; int ret; int i; @@ -459,7 +460,7 @@ // parse filters for option key-value pairs (opt=val@opt2=val2) separated by @ i = 0; - while ((f = av_dict_get(filter_dict, "", f, AV_DICT_IGNORE_SUFFIX))) { + while ((f = av_dict_iterate(filter_dict, f))) { AVDictionary *filter_options = NULL; if (strncmp(f->value, "default", 7)) { // not default @@ -476,7 +477,7 @@ if (!filter_options) { av_log(ctx, AV_LOG_DEBUG, "\tusing default options\n"); } else { - while ((o = av_dict_get(filter_options, "", o, AV_DICT_IGNORE_SUFFIX))) { + while ((o = av_dict_iterate(filter_options, o))) { av_log(ctx, AV_LOG_DEBUG, "\t%s: %s\n", o->key, o->value); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_corr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_corr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_corr.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_corr.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,338 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Calculate the correlation between two input videos. + */ + +#include "libavutil/avstring.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "formats.h" +#include "framesync.h" +#include "internal.h" +#include "video.h" + +typedef struct CorrContext { + const AVClass *class; + FFFrameSync fs; + double score, min_score, max_score, score_comp[4]; + uint64_t nb_frames; + int is_rgb; + uint8_t rgba_map[4]; + int max[4]; + char comps[4]; + int nb_components; + int planewidth[4]; + int planeheight[4]; + int (*filter_slice)(AVFilterContext *ctx, void *arg, + int jobnr, int nb_jobs); +} CorrContext; + +#define OFFSET(x) offsetof(CorrContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static void set_meta(AVFilterContext *ctx, + AVDictionary **metadata, const char *key, char comp, float d) +{ + char value[128]; + snprintf(value, sizeof(value), "%f", d); + if (comp) { + char key2[128]; + snprintf(key2, sizeof(key2), "lavfi.%s.%s%s%c", + ctx->filter->name, ctx->filter->name, key, comp); + av_dict_set(metadata, key2, value, 0); + } else { + char key2[128]; + snprintf(key2, sizeof(key2), "lavfi.%s.%s%s", + ctx->filter->name, ctx->filter->name, key); + av_dict_set(metadata, key2, value, 0); + } +} + +#define CORR(type, name) \ +static void f##name(AVFilterContext *ctx, AVFrame *master, \ + AVFrame *ref, double *comp_score) \ +{ \ + CorrContext *s = ctx->priv; \ + \ + for (int c = 0; c < s->nb_components; c++) { \ + const ptrdiff_t linesize1 = master->linesize[c] / \ + sizeof(type); \ + const ptrdiff_t linesize2 = ref->linesize[c] / \ + sizeof(type); \ + const type *src1 = (const type *)master->data[c]; \ + const type *src2 = (const type *)ref->data[c]; \ + const int h = s->planeheight[c]; \ + const int w = s->planewidth[c]; \ + const float scale = 1.f / s->max[c]; \ + uint64_t sum1 = 0, sum2 = 0; \ + float sum12, sum1q, sum2q; \ + float sumq, mean1, mean2; \ + \ + for (int y = 0; y < h; y++) { \ + for (int x = 0; x < w; x++) { \ + sum1 += src1[x]; \ + sum2 += src2[x]; \ + } \ + \ + src1 += linesize1; \ + src2 += linesize2; \ + } \ + \ + mean1 = scale * (sum1 /(double)(w * h)); \ + mean2 = scale * (sum2 /(double)(w * h)); \ + \ + src1 = (const type *)master->data[c]; \ + src2 = (const type *)ref->data[c]; \ + \ + sum12 = 0.f; \ + sum1q = 0.f; \ + sum2q = 0.f; \ + \ + for (int y = 0; y < h; y++) { \ + for (int x = 0; x < w; x++) { \ + const float f1 = scale * src1[x] - mean1; \ + const float f2 = scale * src2[x] - mean2; \ + \ + sum12 += f1 * f2; \ + sum1q += f1 * f1; \ + sum2q += f2 * f2; \ + } \ + \ + src1 += linesize1; \ + src2 += linesize2; \ + } \ + \ + sumq = sqrtf(sum1q * sum2q); \ + if (sumq > 0.f) { \ + comp_score[c] = av_clipf(sum12 / sumq,-1.f,1.f); \ + } else { \ + comp_score[c] = sum1q == sum2q ? 1.f : 0.f; \ + } \ + } \ +} + +CORR(uint8_t, corr8) +CORR(uint16_t, corr16) + +static int do_corr(FFFrameSync *fs) +{ + AVFilterContext *ctx = fs->parent; + CorrContext *s = ctx->priv; + AVFrame *master, *ref; + double comp_score[4], score = 0.; + AVDictionary **metadata; + int ret; + + ret = ff_framesync_dualinput_get(fs, &master, &ref); + if (ret < 0) + return ret; + if (ctx->is_disabled || !ref) + return ff_filter_frame(ctx->outputs[0], master); + metadata = &master->metadata; + + if (s->max[0] > 255) { + fcorr16(ctx, master, ref, comp_score); + } else { + fcorr8(ctx, master, ref, comp_score); + } + + for (int c = 0; c < s->nb_components; c++) + score += comp_score[c]; + score /= s->nb_components; + s->score += score; + + s->min_score = fmin(s->min_score, score); + s->max_score = fmax(s->max_score, score); + + for (int c = 0; c < s->nb_components; c++) + s->score_comp[c] += comp_score[c]; + s->nb_frames++; + + for (int j = 0; j < s->nb_components; j++) { + int c = s->is_rgb ? s->rgba_map[j] : j; + set_meta(ctx, metadata, ".", s->comps[j], comp_score[c]); + } + set_meta(ctx, metadata, "_avg", 0, score); + + return ff_filter_frame(ctx->outputs[0], master); +} + +static av_cold int init(AVFilterContext *ctx) +{ + CorrContext *s = ctx->priv; + + s->fs.on_event = do_corr; + + return 0; +} + +static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16, +#define PF_NOALPHA(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf +#define PF_ALPHA(suf) AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf +#define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf) + PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16), + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, + AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, + AV_PIX_FMT_NONE +}; + +static int config_input_ref(AVFilterLink *inlink) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + AVFilterContext *ctx = inlink->dst; + CorrContext *s = ctx->priv; + + s->nb_components = desc->nb_components; + if (ctx->inputs[0]->w != ctx->inputs[1]->w || + ctx->inputs[0]->h != ctx->inputs[1]->h) { + av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n"); + return AVERROR(EINVAL); + } + + s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0; + s->comps[0] = s->is_rgb ? 'R' : 'Y' ; + s->comps[1] = s->is_rgb ? 'G' : 'U' ; + s->comps[2] = s->is_rgb ? 'B' : 'V' ; + s->comps[3] = 'A'; + + s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + s->planeheight[0] = s->planeheight[3] = inlink->h; + s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + s->planewidth[0] = s->planewidth[3] = inlink->w; + + s->min_score = +INFINITY; + s->max_score = -INFINITY; + + s->max[0] = (1 << desc->comp[0].depth) - 1; + s->max[1] = (1 << desc->comp[1].depth) - 1; + s->max[2] = (1 << desc->comp[2].depth) - 1; + s->max[3] = (1 << desc->comp[3].depth) - 1; + + return 0; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + CorrContext *s = ctx->priv; + AVFilterLink *mainlink = ctx->inputs[0]; + int ret; + + ret = ff_framesync_init_dualinput(&s->fs, ctx); + if (ret < 0) + return ret; + outlink->w = mainlink->w; + outlink->h = mainlink->h; + outlink->time_base = mainlink->time_base; + outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio; + outlink->frame_rate = mainlink->frame_rate; + if ((ret = ff_framesync_configure(&s->fs)) < 0) + return ret; + + outlink->time_base = s->fs.time_base; + + if (av_cmp_q(mainlink->time_base, outlink->time_base) || + av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base)) + av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n", + mainlink->time_base.num, mainlink->time_base.den, + ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den); + + return 0; +} + +static int activate(AVFilterContext *ctx) +{ + CorrContext *s = ctx->priv; + return ff_framesync_activate(&s->fs); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + CorrContext *s = ctx->priv; + + if (s->nb_frames > 0) { + char buf[256]; + + buf[0] = 0; + for (int j = 0; j < s->nb_components; j++) { + int c = s->is_rgb ? s->rgba_map[j] : j; + av_strlcatf(buf, sizeof(buf), " %c:%f", s->comps[j], s->score_comp[c] / s->nb_frames); + } + + av_log(ctx, AV_LOG_INFO, "%s%s average:%f min:%f max:%f\n", + ctx->filter->name, + buf, + s->score / s->nb_frames, + s->min_score, + s->max_score); + } + + ff_framesync_uninit(&s->fs); +} + +static const AVFilterPad corr_inputs[] = { + { + .name = "main", + .type = AVMEDIA_TYPE_VIDEO, + },{ + .name = "reference", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input_ref, + }, +}; + +static const AVFilterPad corr_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +static const AVOption options[] = { + { NULL } +}; + +#define corr_options options +FRAMESYNC_DEFINE_CLASS(corr, CorrContext, fs); + +const AVFilter ff_vf_corr = { + .name = "corr", + .description = NULL_IF_CONFIG_SMALL("Calculate the correlation between two video streams."), + .preinit = corr_framesync_preinit, + .init = init, + .uninit = uninit, + .activate = activate, + .priv_size = sizeof(CorrContext), + .priv_class = &corr_class, + FILTER_INPUTS(corr_inputs), + FILTER_OUTPUTS(corr_outputs), + FILTER_PIXFMTS_ARRAY(pix_fmts), + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | + AVFILTER_FLAG_METADATA_ONLY, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cover_rect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cover_rect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cover_rect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cover_rect.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/imgutils.h" #include "libavutil/opt.h" +#include "filters.h" #include "internal.h" #include "lavfutils.h" @@ -125,7 +126,7 @@ AVFilterContext *ctx = inlink->dst; CoverContext *cover = ctx->priv; AVDictionaryEntry *ex, *ey, *ew, *eh; - int x = -1, y = -1, w = -1, h = -1; + int ret, x = -1, y = -1, w = -1, h = -1; char *xendptr = NULL, *yendptr = NULL, *wendptr = NULL, *hendptr = NULL; ex = av_dict_get(in->metadata, "lavfi.rect.x", NULL, AV_DICT_MATCH_CASE); @@ -170,7 +171,11 @@ x = av_clip(x, 0, in->width - w); y = av_clip(y, 0, in->height - h); - av_frame_make_writable(in); + ret = ff_inlink_make_frame_writable(inlink, &in); + if (ret < 0) { + av_frame_free(&in); + return ret; + } if (cover->mode == MODE_BLUR) { blur (cover, in, x, y); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cropdetect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cropdetect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cropdetect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_cropdetect.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,22 +26,37 @@ #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/opt.h" +#include "libavutil/motion_vector.h" +#include "libavutil/qsort.h" #include "avfilter.h" #include "formats.h" #include "internal.h" #include "video.h" +#include "edge_common.h" typedef struct CropDetectContext { const AVClass *class; int x1, y1, x2, y2; float limit; + float limit_upscaled; int round; int skip; int reset_count; int frame_nb; int max_pixsteps[4]; int max_outliers; + int mode; + int window_size; + int mv_threshold; + int bitdepth; + float low, high; + uint8_t low_u8, high_u8; + uint8_t *filterbuf; + uint8_t *tmpbuf; + uint16_t *gradients; + char *directions; + int *bboxes[4]; } CropDetectContext; static const enum AVPixelFormat pix_fmts[] = { @@ -61,6 +76,17 @@ AV_PIX_FMT_NONE }; +enum CropMode { + MODE_BLACK, + MODE_MV_EDGES, + MODE_NB +}; + +static int comp(const int *a,const int *b) +{ + return FFDIFFSIGN(*a, *b); +} + static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp) { int total = 0; @@ -116,11 +142,43 @@ return total; } +static int checkline_edge(void *ctx, const unsigned char *src, int stride, int len, int bpp) +{ + const uint16_t *src16 = (const uint16_t *)src; + + switch (bpp) { + case 1: + while (--len >= 0) { + if (src[0]) return 0; + src += stride; + } + break; + case 2: + stride >>= 1; + while (--len >= 0) { + if (src16[0]) return 0; + src16 += stride; + } + break; + case 3: + case 4: + while (--len >= 0) { + if (src[0] || src[1] || src[2]) return 0; + src += stride; + } + break; + } + + return 1; +} + static av_cold int init(AVFilterContext *ctx) { CropDetectContext *s = ctx->priv; s->frame_nb = -1 * s->skip; + s->low_u8 = s->low * 255. + .5; + s->high_u8 = s->high * 255. + .5; av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d skip:%d reset_count:%d\n", s->limit, s->round, s->skip, s->reset_count); @@ -128,22 +186,55 @@ return 0; } +static av_cold void uninit(AVFilterContext *ctx) +{ + CropDetectContext *s = ctx->priv; + + av_freep(&s->tmpbuf); + av_freep(&s->filterbuf); + av_freep(&s->gradients); + av_freep(&s->directions); + av_freep(&s->bboxes[0]); + av_freep(&s->bboxes[1]); + av_freep(&s->bboxes[2]); + av_freep(&s->bboxes[3]); +} + static int config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; CropDetectContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + const int bufsize = inlink->w * inlink->h; av_image_fill_max_pixsteps(s->max_pixsteps, NULL, desc); + s->bitdepth = desc->comp[0].depth; + if (s->limit < 1.0) - s->limit *= (1 << desc->comp[0].depth) - 1; + s->limit_upscaled = s->limit * ((1 << s->bitdepth) - 1); + else + s->limit_upscaled = s->limit; s->x1 = inlink->w - 1; s->y1 = inlink->h - 1; s->x2 = 0; s->y2 = 0; + s->window_size = FFMAX(s->reset_count, 15); + s->tmpbuf = av_malloc(bufsize); + s->filterbuf = av_malloc(bufsize * s->max_pixsteps[0]); + s->gradients = av_calloc(bufsize, sizeof(*s->gradients)); + s->directions = av_malloc(bufsize); + s->bboxes[0] = av_malloc(s->window_size * sizeof(*s->bboxes[0])); + s->bboxes[1] = av_malloc(s->window_size * sizeof(*s->bboxes[1])); + s->bboxes[2] = av_malloc(s->window_size * sizeof(*s->bboxes[2])); + s->bboxes[3] = av_malloc(s->window_size * sizeof(*s->bboxes[3])); + + if (!s->tmpbuf || !s->filterbuf || !s->gradients || !s->directions || + !s->bboxes[0] || !s->bboxes[1] || !s->bboxes[2] || !s->bboxes[3]) + return AVERROR(ENOMEM); + return 0; } @@ -155,10 +246,28 @@ AVFilterContext *ctx = inlink->dst; CropDetectContext *s = ctx->priv; int bpp = s->max_pixsteps[0]; - int w, h, x, y, shrink_by; + int w, h, x, y, shrink_by, i; AVDictionary **metadata; int outliers, last_y; - int limit = lrint(s->limit); + int limit_upscaled = lrint(s->limit_upscaled); + char limit_str[22]; + + const int inw = inlink->w; + const int inh = inlink->h; + uint8_t *tmpbuf = s->tmpbuf; + uint8_t *filterbuf = s->filterbuf; + uint16_t *gradients = s->gradients; + int8_t *directions = s->directions; + const AVFrameSideData *sd = NULL; + int scan_w, scan_h, bboff; + + void (*sobel)(int w, int h, uint16_t *dst, int dst_linesize, + int8_t *dir, int dir_linesize, + const uint8_t *src, int src_linesize, int src_stride) = (bpp == 2) ? &ff_sobel_16 : &ff_sobel_8; + void (*gaussian_blur)(int w, int h, + uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, int src_stride) = (bpp == 2) ? &ff_gaussian_blur_16 : &ff_gaussian_blur_8; + // ignore first s->skip frames if (++s->frame_nb > 0) { @@ -176,7 +285,7 @@ #define FIND(DST, FROM, NOEND, INC, STEP0, STEP1, LEN) \ outliers = 0;\ for (last_y = y = FROM; NOEND; y = y INC) {\ - if (checkline(ctx, frame->data[0] + STEP0 * y, STEP1, LEN, bpp) > limit) {\ + if (checkline(ctx, frame->data[0] + STEP0 * y, STEP1, LEN, bpp) > limit_upscaled) {\ if (++outliers > s->max_outliers) { \ DST = last_y;\ break;\ @@ -185,11 +294,109 @@ last_y = y INC;\ } - FIND(s->y1, 0, y < s->y1, +1, frame->linesize[0], bpp, frame->width); - FIND(s->y2, frame->height - 1, y > FFMAX(s->y2, s->y1), -1, frame->linesize[0], bpp, frame->width); - FIND(s->x1, 0, y < s->x1, +1, bpp, frame->linesize[0], frame->height); - FIND(s->x2, frame->width - 1, y > FFMAX(s->x2, s->x1), -1, bpp, frame->linesize[0], frame->height); + if (s->mode == MODE_BLACK) { + FIND(s->y1, 0, y < s->y1, +1, frame->linesize[0], bpp, frame->width); + FIND(s->y2, frame->height - 1, y > FFMAX(s->y2, s->y1), -1, frame->linesize[0], bpp, frame->width); + FIND(s->x1, 0, y < s->x1, +1, bpp, frame->linesize[0], frame->height); + FIND(s->x2, frame->width - 1, y > FFMAX(s->x2, s->x1), -1, bpp, frame->linesize[0], frame->height); + } else { // MODE_MV_EDGES + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS); + s->x1 = 0; + s->y1 = 0; + s->x2 = inw - 1; + s->y2 = inh - 1; + + if (!sd) { + av_log(ctx, AV_LOG_WARNING, "Cannot detect: no motion vectors available"); + } else { + // gaussian filter to reduce noise + gaussian_blur(inw, inh, + filterbuf, inw*bpp, + frame->data[0], frame->linesize[0], bpp); + + // compute the 16-bits gradients and directions for the next step + sobel(inw, inh, gradients, inw, directions, inw, filterbuf, inw*bpp, bpp); + + // non_maximum_suppression() will actually keep & clip what's necessary and + // ignore the rest, so we need a clean output buffer + memset(tmpbuf, 0, inw * inh); + ff_non_maximum_suppression(inw, inh, tmpbuf, inw, directions, inw, gradients, inw); + + + // keep high values, or low values surrounded by high values + ff_double_threshold(s->low_u8, s->high_u8, inw, inh, + tmpbuf, inw, tmpbuf, inw); + + // scan all MVs and store bounding box + s->x1 = inw - 1; + s->y1 = inh - 1; + s->x2 = 0; + s->y2 = 0; + for (i = 0; i < sd->size / sizeof(AVMotionVector); i++) { + const AVMotionVector *mv = (const AVMotionVector*)sd->data + i; + const int mx = mv->dst_x - mv->src_x; + const int my = mv->dst_y - mv->src_y; + + if (mv->dst_x >= 0 && mv->dst_x < inw && + mv->dst_y >= 0 && mv->dst_y < inh && + mv->src_x >= 0 && mv->src_x < inw && + mv->src_y >= 0 && mv->src_y < inh && + mx * mx + my * my >= s->mv_threshold * s->mv_threshold) { + s->x1 = mv->dst_x < s->x1 ? mv->dst_x : s->x1; + s->y1 = mv->dst_y < s->y1 ? mv->dst_y : s->y1; + s->x2 = mv->dst_x > s->x2 ? mv->dst_x : s->x2; + s->y2 = mv->dst_y > s->y2 ? mv->dst_y : s->y2; + } + } + + // assert x1x1 > s->x2) FFSWAP(int, s->x1, s->x2); + if (s->y1 > s->y2) FFSWAP(int, s->y1, s->y2); + + // scan outward looking for 0-edge-lines in edge image + scan_w = s->x2 - s->x1; + scan_h = s->y2 - s->y1; + +#define FIND_EDGE(DST, FROM, NOEND, INC, STEP0, STEP1, LEN) \ + for (last_y = y = FROM; NOEND; y = y INC) { \ + if (checkline_edge(ctx, tmpbuf + STEP0 * y, STEP1, LEN, bpp)) { \ + if (last_y INC == y) { \ + DST = y; \ + break; \ + } else \ + last_y = y; \ + } \ + } \ + if (!(NOEND)) { \ + DST = y -(INC); \ + } + FIND_EDGE(s->y1, s->y1, y >= 0, -1, inw, bpp, scan_w); + FIND_EDGE(s->y2, s->y2, y < inh, +1, inw, bpp, scan_w); + FIND_EDGE(s->x1, s->x1, y >= 0, -1, bpp, inw, scan_h); + FIND_EDGE(s->x2, s->x2, y < inw, +1, bpp, inw, scan_h); + + // queue bboxes + bboff = (s->frame_nb - 1) % s->window_size; + s->bboxes[0][bboff] = s->x1; + s->bboxes[1][bboff] = s->x2; + s->bboxes[2][bboff] = s->y1; + s->bboxes[3][bboff] = s->y2; + + // sort queue + bboff = FFMIN(s->frame_nb, s->window_size); + AV_QSORT(s->bboxes[0], bboff, int, comp); + AV_QSORT(s->bboxes[1], bboff, int, comp); + AV_QSORT(s->bboxes[2], bboff, int, comp); + AV_QSORT(s->bboxes[3], bboff, int, comp); + + // return median of window_size elems + s->x1 = s->bboxes[0][bboff/2]; + s->x2 = s->bboxes[1][bboff/2]; + s->y1 = s->bboxes[2][bboff/2]; + s->y2 = s->bboxes[3][bboff/2]; + } + } // round x and y (up), important for yuv colorspaces // make sure they stay rounded! @@ -223,26 +430,57 @@ SET_META("lavfi.cropdetect.x", x); SET_META("lavfi.cropdetect.y", y); + snprintf(limit_str, sizeof(limit_str), "%f", s->limit); + av_dict_set(metadata, "lavfi.cropdetect.limit", limit_str, 0); + av_log(ctx, AV_LOG_INFO, - "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pts:%"PRId64" t:%f crop=%d:%d:%d:%d\n", + "x1:%d x2:%d y1:%d y2:%d w:%d h:%d x:%d y:%d pts:%"PRId64" t:%f limit:%f crop=%d:%d:%d:%d\n", s->x1, s->x2, s->y1, s->y2, w, h, x, y, frame->pts, frame->pts == AV_NOPTS_VALUE ? -1 : frame->pts * av_q2d(inlink->time_base), - w, h, x, y); + s->limit, w, h, x, y); } return ff_filter_frame(inlink->dst->outputs[0], frame); } +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, + char *res, int res_len, int flags) +{ + CropDetectContext *s = ctx->priv; + float old_limit = s->limit; + int ret; + + if ((ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags)) < 0) + return ret; + + if (old_limit != s->limit) { + if (s->limit < 1.0) + s->limit_upscaled = s->limit * ((1 << s->bitdepth) - 1); + else + s->limit_upscaled = s->limit; + s->frame_nb = s->reset_count; + } + + return 0; +} + #define OFFSET(x) offsetof(CropDetectContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM static const AVOption cropdetect_options[] = { - { "limit", "Threshold below which the pixel is considered black", OFFSET(limit), AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535, FLAGS }, + { "limit", "Threshold below which the pixel is considered black", OFFSET(limit), AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535, TFLAGS }, { "round", "Value by which the width/height should be divisible", OFFSET(round), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, FLAGS }, { "reset", "Recalculate the crop area after this many frames", OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, { "skip", "Number of initial frames to skip", OFFSET(skip), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, INT_MAX, FLAGS }, { "reset_count", "Recalculate the crop area after this many frames",OFFSET(reset_count),AV_OPT_TYPE_INT,{ .i64 = 0 }, 0, INT_MAX, FLAGS }, { "max_outliers", "Threshold count of outliers", OFFSET(max_outliers),AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, + { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_BLACK}, 0, MODE_NB-1, FLAGS, "mode" }, + { "black", "detect black pixels surrounding the video", 0, AV_OPT_TYPE_CONST, {.i64=MODE_BLACK}, INT_MIN, INT_MAX, FLAGS, "mode" }, + { "mvedges", "detect motion and edged surrounding the video", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MV_EDGES}, INT_MIN, INT_MAX, FLAGS, "mode" }, + { "high", "Set high threshold for edge detection", OFFSET(high), AV_OPT_TYPE_FLOAT, {.dbl=25/255.}, 0, 1, FLAGS }, + { "low", "Set low threshold for edge detection", OFFSET(low), AV_OPT_TYPE_FLOAT, {.dbl=15/255.}, 0, 1, FLAGS }, + { "mv_threshold", "motion vector threshold when estimating video window size", OFFSET(mv_threshold), AV_OPT_TYPE_INT, {.i64=8}, 0, 100, FLAGS}, { NULL } }; @@ -270,8 +508,10 @@ .priv_size = sizeof(CropDetectContext), .priv_class = &cropdetect_class, .init = init, + .uninit = uninit, FILTER_INPUTS(avfilter_vf_cropdetect_inputs), FILTER_OUTPUTS(avfilter_vf_cropdetect_outputs), FILTER_PIXFMTS_ARRAY(pix_fmts), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_METADATA_ONLY, + .process_command = process_command, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_curves.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_curves.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_curves.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_curves.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,12 @@ #include "libavutil/bprint.h" #include "libavutil/eval.h" #include "libavutil/file.h" +#include "libavutil/file_open.h" #include "libavutil/intreadwrite.h" #include "libavutil/avassert.h" #include "libavutil/pixdesc.h" #include "avfilter.h" #include "drawutils.h" -#include "formats.h" #include "internal.h" #include "video.h" @@ -58,6 +58,12 @@ NB_PRESETS, }; +enum interp { + INTERP_NATURAL, + INTERP_PCHIP, + NB_INTERPS, +}; + typedef struct CurvesContext { const AVClass *class; int preset; @@ -73,6 +79,7 @@ int is_16bit; int depth; int parsed_psfile; + int interp; int (*filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); } CurvesContext; @@ -107,6 +114,9 @@ { "all", "set points coordinates for all components", OFFSET(comp_points_str_all), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, { "psfile", "set Photoshop curves file name", OFFSET(psfile), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, { "plot", "save Gnuplot script of the curves in specified file", OFFSET(plot_filename), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, + { "interp", "specify the kind of interpolation", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=INTERP_NATURAL}, INTERP_NATURAL, NB_INTERPS-1, FLAGS, "interp_name" }, + { "natural", "natural cubic spline", 0, AV_OPT_TYPE_CONST, {.i64=INTERP_NATURAL}, 0, 0, FLAGS, "interp_name" }, + { "pchip", "monotonically cubic interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERP_PCHIP}, 0, 0, FLAGS, "interp_name" }, { NULL } }; @@ -336,21 +346,239 @@ av_free(h); av_free(r); return ret; + +} + +#define SIGN(x) (x > 0.0 ? 1 : x < 0.0 ? -1 : 0) + +/** + * Evalaute the derivative of an edge endpoint + * + * @param h0 input interval of the interval closest to the edge + * @param h1 input interval of the interval next to the closest + * @param m0 linear slope of the interval closest to the edge + * @param m1 linear slope of the intervalnext to the closest + * @return edge endpoint derivative + * + * Based on scipy.interpolate._edge_case() + * https://github.com/scipy/scipy/blob/2e5883ef7af4f5ed4a5b80a1759a45e43163bf3f/scipy/interpolate/_cubic.py#L239 + * which is a python implementation of the special case endpoints, as suggested in + * Cleve Moler, Numerical Computing with MATLAB, Chap 3.6 (pchiptx.m) +*/ +static double pchip_edge_case(double h0, double h1, double m0, double m1) +{ + int mask, mask2; + double d; + + d = ((2 * h0 + h1) * m0 - h0 * m1) / (h0 + h1); + + mask = SIGN(d) != SIGN(m0); + mask2 = (SIGN(m0) != SIGN(m1)) && (fabs(d) > 3. * fabs(m0)); + + if (mask) d = 0.0; + else if (mask2) d = 3.0 * m0; + + return d; +} + +/** + * Evalaute the piecewise polynomial derivatives at endpoints + * + * @param n input interval of the interval closest to the edge + * @param hk input intervals + * @param mk linear slopes over intervals + * @param dk endpoint derivatives (output) + * @return 0 success + * + * Based on scipy.interpolate._find_derivatives() + * https://github.com/scipy/scipy/blob/2e5883ef7af4f5ed4a5b80a1759a45e43163bf3f/scipy/interpolate/_cubic.py#L254 +*/ + +static int pchip_find_derivatives(const int n, const double *hk, const double *mk, double *dk) +{ + int ret = 0; + const int m = n - 1; + int8_t *smk; + + smk = av_malloc(n); + if (!smk) { + ret = AVERROR(ENOMEM); + goto end; + } + + /* smk = sgn(mk) */ + for (int i = 0; i < n; i++) smk[i] = SIGN(mk[i]); + + /* check the strict monotonicity */ + for (int i = 0; i < m; i++) { + int8_t condition = (smk[i + 1] != smk[i]) || (mk[i + 1] == 0) || (mk[i] == 0); + if (condition) { + dk[i + 1] = 0.0; + } else { + double w1 = 2 * hk[i + 1] + hk[i]; + double w2 = hk[i + 1] + 2 * hk[i]; + dk[i + 1] = (w1 + w2) / (w1 / mk[i] + w2 / mk[i + 1]); + } + } + + dk[0] = pchip_edge_case(hk[0], hk[1], mk[0], mk[1]); + dk[n] = pchip_edge_case(hk[n - 1], hk[n - 2], mk[n - 1], mk[n - 2]); + +end: + av_free(smk); + + return ret; } -#define DECLARE_INTERPOLATE_FUNC(nbits) \ -static int interpolate##nbits(void *log_ctx, uint16_t *y, \ - const struct keypoint *points) \ -{ \ - return interpolate(log_ctx, y, points, nbits); \ +/** + * Evalaute half of the cubic hermite interpolation expression, wrt one interval endpoint + * + * @param x normalized input value at the endpoint + * @param f output value at the endpoint + * @param d derivative at the endpoint: normalized to the interval, and properly sign adjusted + * @return half of the interpolated value +*/ +static inline double interp_cubic_hermite_half(const double x, const double f, + const double d) +{ + double x2 = x * x, x3 = x2 * x; + return f * (3.0 * x2 - 2.0 * x3) + d * (x3 - x2); +} + +/** + * Prepare the lookup table by piecewise monotonic cubic interpolation (PCHIP) + * + * @param log_ctx for logging + * @param y output lookup table (output) + * @param points user-defined control points/endpoints + * @param nbits bitdepth + * @return 0 success + * + * References: + * [1] F. N. Fritsch and J. Butland, A method for constructing local monotone piecewise + * cubic interpolants, SIAM J. Sci. Comput., 5(2), 300-304 (1984). DOI:10.1137/0905021. + * [2] scipy.interpolate: https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PchipInterpolator.html +*/ +static inline int interpolate_pchip(void *log_ctx, uint16_t *y, + const struct keypoint *points, int nbits) +{ + const struct keypoint *point = points; + const int lut_size = 1<y * scale); + for (int i = 0; i < lut_size; i++) y[i] = yval; + return 0; + } + + xi = av_calloc(3*n + 2*(n-1), sizeof(double)); /* output values at interval endpoints */ + if (!xi) { + ret = AVERROR(ENOMEM); + goto end; + } + + fi = xi + n; /* output values at inteval endpoints */ + di = fi + n; /* output slope wrt normalized input at interval endpoints */ + hi = di + n; /* interval widths */ + mi = hi + n - 1; /* linear slope over intervals */ + + /* scale endpoints and store them in a contiguous memory block */ + for (int i = 0; i < n; i++) { + xi[i] = point->x * scale; + fi[i] = point->y * scale; + point = point->next; + } + + /* h(i) = x(i+1) - x(i); mi(i) = (f(i+1)-f(i))/h(i) */ + for (int i = 0; i < n - 1; i++) { + const double val = (xi[i+1]-xi[i]); + hi[i] = val; + mi[i] = (fi[i+1]-fi[i]) / val; + } + + if (n == 2) { + /* edge case, use linear interpolation */ + const double m = mi[0], b = fi[0] - xi[0]*m; + for (int i = 0; i < lut_size; i++) y[i] = CLIP(i*m + b); + goto end; + } + + /* compute the derivatives at the endpoints*/ + ret = pchip_find_derivatives(n-1, hi, mi, di); + if (ret) + goto end; + + /* interpolate/extrapolate */ + x = 0; + if (xi[0] > 0) { + /* below first endpoint, use the first endpoint value*/ + const double xi0 = xi[0]; + const double yi0 = fi[0]; + const uint16_t yval = CLIP(yi0); + for (; x < xi0; x++) { + y[x] = yval; + av_log(log_ctx, AV_LOG_TRACE, "f(%f)=%f -> y[%d]=%d\n", xi0, yi0, x, y[x]); + } + av_log(log_ctx, AV_LOG_DEBUG, "Interval -1: [0, %d] -> %d\n", x - 1, yval); + } + + /* for each interval */ + for (int i = 0, x0 = x; i < n-1; i++, x0 = x) { + const double xi0 = xi[i]; /* start-of-interval input value */ + const double xi1 = xi[i + 1]; /* end-of-interval input value */ + const double h = hi[i]; /* interval width */ + const double f0 = fi[i]; /* start-of-interval output value */ + const double f1 = fi[i + 1]; /* end-of-interval output value */ + const double d0 = di[i]; /* start-of-interval derivative */ + const double d1 = di[i + 1]; /* end-of-interval derivative */ + + /* fill the lut over the interval */ + for (; x < xi1; x++) { /* safe not to check j < lut_size */ + const double xx = (x - xi0) / h; /* normalize input */ + const double yy = interp_cubic_hermite_half(1 - xx, f0, -h * d0) + + interp_cubic_hermite_half(xx, f1, h * d1); + y[x] = CLIP(yy); + av_log(log_ctx, AV_LOG_TRACE, "f(%f)=%f -> y[%d]=%d\n", xx, yy, x, y[x]); + } + + if (x > x0) + av_log(log_ctx, AV_LOG_DEBUG, "Interval %d: [%d, %d] -> [%d, %d]\n", + i, x0, x-1, y[x0], y[x-1]); + else + av_log(log_ctx, AV_LOG_DEBUG, "Interval %d: empty\n", i); + } + + if (x && x < lut_size) { + /* above the last endpoint, use the last endpoint value*/ + const double xi1 = xi[n - 1]; + const double yi1 = fi[n - 1]; + const uint16_t yval = CLIP(yi1); + av_log(log_ctx, AV_LOG_DEBUG, "Interval %d: [%d, %d] -> %d\n", + n-1, x, lut_size - 1, yval); + for (; x && x < lut_size; x++) { /* loop until int overflow */ + y[x] = yval; + av_log(log_ctx, AV_LOG_TRACE, "f(%f)=%f -> y[%d]=%d\n", xi1, yi1, x, yval); + } + } + +end: + av_free(xi); + return ret; } -DECLARE_INTERPOLATE_FUNC(8) -DECLARE_INTERPOLATE_FUNC(9) -DECLARE_INTERPOLATE_FUNC(10) -DECLARE_INTERPOLATE_FUNC(12) -DECLARE_INTERPOLATE_FUNC(14) -DECLARE_INTERPOLATE_FUNC(16) static int parse_psfile(AVFilterContext *ctx, const char *fname) { @@ -651,14 +879,10 @@ ret = parse_points_str(ctx, comp_points + i, curves->comp_points_str[i], curves->lut_size); if (ret < 0) return ret; - switch (curves->depth) { - case 8: ret = interpolate8 (ctx, curves->graph[i], comp_points[i]); break; - case 9: ret = interpolate9 (ctx, curves->graph[i], comp_points[i]); break; - case 10: ret = interpolate10(ctx, curves->graph[i], comp_points[i]); break; - case 12: ret = interpolate12(ctx, curves->graph[i], comp_points[i]); break; - case 14: ret = interpolate14(ctx, curves->graph[i], comp_points[i]); break; - case 16: ret = interpolate16(ctx, curves->graph[i], comp_points[i]); break; - } + if (curves->interp == INTERP_PCHIP) + ret = interpolate_pchip(ctx, curves->graph[i], comp_points[i], curves->depth); + else + ret = interpolate(ctx, curves->graph[i], comp_points[i], curves->depth); if (ret < 0) return ret; } @@ -735,7 +959,7 @@ if (!strcmp(cmd, "plot")) { curves->saved_plot = 0; - } else if (!strcmp(cmd, "all") || !strcmp(cmd, "preset") || !strcmp(cmd, "psfile")) { + } else if (!strcmp(cmd, "all") || !strcmp(cmd, "preset") || !strcmp(cmd, "psfile") || !strcmp(cmd, "interp")) { if (!strcmp(cmd, "psfile")) curves->parsed_psfile = 0; av_freep(&curves->comp_points_str_all); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_datascope.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_datascope.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_datascope.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_datascope.c 2023-03-03 13:29:59.000000000 +0000 @@ -322,7 +322,7 @@ av_frame_free(&in); return AVERROR(ENOMEM); } - out->pts = in->pts; + av_frame_copy_props(out, in); ff_fill_rectangle(&s->draw, &s->black, out->data, out->linesize, 0, 0, outlink->w, outlink->h); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dblur.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dblur.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dblur.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dblur.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,7 +47,7 @@ static const AVOption dblur_options[] = { { "angle", "set angle", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl=45}, 0.0, 360, FLAGS }, - { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_FLOAT, {.dbl=5}, 1, 8192, FLAGS }, + { "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_FLOAT, {.dbl=5}, 0, 8192, FLAGS }, { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, { NULL } }; @@ -67,7 +67,7 @@ float g; if (s->R3 > 0) { - for (int y = 1; y < height - 1; y++) { + for (int y = 1; y < height; y++) { g = q * f(y, 0) + c * f(y, 0); for (int x = 0; x < width; x++) { f(y, x) = b0 * f(y, x) + b1 * f(y - 1, x) + g; @@ -83,7 +83,7 @@ } } } else { - for (int y = 1; y < height - 1; y++) { + for (int y = 1; y < height; y++) { g = q * f(y, width - 1) + c * f(y, width - 1); for (int x = width - 1; x >= 0; x--) { f(y, x) = b0 * f(y, x) + b1 * f(y - 1, x) + g; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_decimate.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_decimate.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_decimate.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_decimate.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,8 +43,8 @@ AVFrame *last; ///< last frame from the previous queue AVFrame **clean_src; ///< frame queue for the clean source int got_frame[2]; ///< frame request flag for each input stream - AVRational ts_unit; ///< timestamp units for the output frames int64_t last_pts; ///< last output timestamp + int64_t last_duration; ///< last output duration int64_t start_pts; ///< base for output timestamps uint32_t eof; ///< bitmask for end of stream int hsub, vsub; ///< chroma subsampling values @@ -52,6 +52,9 @@ int nxblocks, nyblocks; int bdiffsize; int64_t *bdiffs; + AVRational in_tb; // input time-base + AVRational nondec_tb; // non-decimated time-base + AVRational dec_tb; // decimated time-base /* options */ int cycle; @@ -62,6 +65,7 @@ int blockx, blocky; int ppsrc; int chroma; + int mixed; } DecimateContext; #define OFFSET(x) offsetof(DecimateContext, x) @@ -75,6 +79,7 @@ { "blocky", "set the size of the y-axis blocks used during metric calculations", OFFSET(blocky), AV_OPT_TYPE_INT, {.i64 = 32}, 4, 1<<9, FLAGS }, { "ppsrc", "mark main input as a pre-processed input and activate clean source input stream", OFFSET(ppsrc), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { "chroma", "set whether or not chroma is considered in the metric calculations", OFFSET(chroma), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, + { "mixed", "set whether or not the input only partially contains content to be decimated", OFFSET(mixed), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { NULL } }; @@ -194,7 +199,12 @@ } if (dm->queue[lowest].maxbdiff < dm->dupthresh) duppos = lowest; - drop = scpos >= 0 && duppos < 0 ? scpos : lowest; + + if (dm->mixed && duppos < 0) { + drop = -1; // no drop if mixed content + no frame in cycle below threshold + } else { + drop = scpos >= 0 && duppos < 0 ? scpos : lowest; + } } /* metrics debug */ @@ -221,7 +231,8 @@ AVFrame *frame = dm->queue[i].frame; dm->queue[i].frame = NULL; if (frame->pts != AV_NOPTS_VALUE && dm->start_pts == AV_NOPTS_VALUE) - dm->start_pts = frame->pts; + dm->start_pts = av_rescale_q(frame->pts, dm->in_tb, outlink->time_base); + if (dm->ppsrc) { av_frame_free(&frame); frame = dm->clean_src[i]; @@ -229,8 +240,11 @@ continue; dm->clean_src[i] = NULL; } - frame->pts = av_rescale_q(outlink->frame_count_in, dm->ts_unit, (AVRational){1,1}) + + + frame->pts = dm->last_duration ? dm->last_pts + dm->last_duration : (dm->start_pts == AV_NOPTS_VALUE ? 0 : dm->start_pts); + frame->duration = dm->mixed ? av_div_q(drop < 0 ? dm->nondec_tb : dm->dec_tb, outlink->time_base).num : 1; + dm->last_duration = frame->duration; dm->last_pts = frame->pts; ret = ff_filter_frame(outlink, frame); if (ret < 0) @@ -327,6 +341,7 @@ } dm->start_pts = AV_NOPTS_VALUE; + dm->last_duration = 0; return 0; } @@ -386,6 +401,9 @@ dm->bdiffsize = dm->nxblocks * dm->nyblocks; dm->bdiffs = av_malloc_array(dm->bdiffsize, sizeof(*dm->bdiffs)); dm->queue = av_calloc(dm->cycle, sizeof(*dm->queue)); + dm->in_tb = inlink->time_base; + dm->nondec_tb = av_inv_q(fps); + dm->dec_tb = av_mul_q(dm->nondec_tb, (AVRational){dm->cycle, dm->cycle - 1}); if (!dm->bdiffs || !dm->queue) return AVERROR(ENOMEM); @@ -401,11 +419,17 @@ "current rate of %d/%d is invalid\n", fps.num, fps.den); return AVERROR(EINVAL); } - fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle}); - av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", - inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den); - outlink->time_base = inlink->time_base; - outlink->frame_rate = fps; + + if (dm->mixed) { + outlink->time_base = av_gcd_q(dm->nondec_tb, dm->dec_tb, AV_TIME_BASE / 2, AV_TIME_BASE_Q); + av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> VFR (use %d/%d if CFR required)\n", + fps.num, fps.den, outlink->time_base.den, outlink->time_base.num); + } else { + outlink->time_base = dm->dec_tb; + outlink->frame_rate = av_inv_q(outlink->time_base); + av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", + fps.num, fps.den, outlink->frame_rate.num, outlink->frame_rate.den); + } outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; if (dm->ppsrc) { outlink->w = ctx->inputs[INPUT_CLEANSRC]->w; @@ -414,7 +438,6 @@ outlink->w = inlink->w; outlink->h = inlink->h; } - dm->ts_unit = av_inv_q(av_mul_q(fps, outlink->time_base)); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dedot.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dedot.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dedot.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dedot.c 2023-03-03 13:29:59.000000000 +0000 @@ -289,7 +289,7 @@ s->frames[4]) { out = av_frame_clone(s->frames[2]); if (out && !ctx->is_disabled) { - ret = av_frame_make_writable(out); + ret = ff_inlink_make_frame_writable(inlink, &out); if (ret >= 0) { if (s->m & 1) ff_filter_execute(ctx, s->dedotcrawl, out, NULL, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deinterlace_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deinterlace_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deinterlace_qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deinterlace_qsv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,601 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * deinterlace video filter - QSV - */ - -#include - -#include -#include - -#include "libavutil/avstring.h" -#include "libavutil/common.h" -#include "libavutil/hwcontext.h" -#include "libavutil/hwcontext_qsv.h" -#include "libavutil/internal.h" -#include "libavutil/mathematics.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/time.h" -#include "libavfilter/qsvvpp.h" - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" - -#define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) - -enum { - QSVDEINT_MORE_OUTPUT = 1, - QSVDEINT_MORE_INPUT, -}; - -typedef struct QSVDeintContext { - const AVClass *class; - - AVBufferRef *hw_frames_ctx; - /* a clone of the main session, used internally for deinterlacing */ - mfxSession session; - - mfxMemId *mem_ids; - int nb_mem_ids; - - mfxFrameSurface1 **surface_ptrs; - int nb_surface_ptrs; - - mfxExtOpaqueSurfaceAlloc opaque_alloc; - mfxExtVPPDeinterlacing deint_conf; - mfxExtBuffer *ext_buffers[2]; - int num_ext_buffers; - - QSVFrame *work_frames; - - int64_t last_pts; - - int eof; - - /* option for Deinterlacing algorithm to be used */ - int mode; -} QSVDeintContext; - -static av_cold void qsvdeint_uninit(AVFilterContext *ctx) -{ - QSVDeintContext *s = ctx->priv; - QSVFrame *cur; - - if (s->session) { - MFXClose(s->session); - s->session = NULL; - } - av_buffer_unref(&s->hw_frames_ctx); - - cur = s->work_frames; - while (cur) { - s->work_frames = cur->next; - av_frame_free(&cur->frame); - av_freep(&cur); - cur = s->work_frames; - } - - av_freep(&s->mem_ids); - s->nb_mem_ids = 0; - - av_freep(&s->surface_ptrs); - s->nb_surface_ptrs = 0; -} - -static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, - mfxFrameAllocResponse *resp) -{ - AVFilterContext *ctx = pthis; - QSVDeintContext *s = ctx->priv; - - if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) || - !(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) || - !(req->Type & MFX_MEMTYPE_EXTERNAL_FRAME)) - return MFX_ERR_UNSUPPORTED; - - resp->mids = s->mem_ids; - resp->NumFrameActual = s->nb_mem_ids; - - return MFX_ERR_NONE; -} - -static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp) -{ - return MFX_ERR_NONE; -} - -static mfxStatus frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - return MFX_ERR_UNSUPPORTED; -} - -static mfxStatus frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - return MFX_ERR_UNSUPPORTED; -} - -static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl) -{ - mfxHDLPair *pair_dst = (mfxHDLPair*)hdl; - mfxHDLPair *pair_src = (mfxHDLPair*)mid; - - pair_dst->first = pair_src->first; - - if (pair_src->second != (mfxMemId)MFX_INFINITE) - pair_dst->second = pair_src->second; - return MFX_ERR_NONE; -} - -static int init_out_session(AVFilterContext *ctx) -{ - - QSVDeintContext *s = ctx->priv; - AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)s->hw_frames_ctx->data; - AVQSVFramesContext *hw_frames_hwctx = hw_frames_ctx->hwctx; - AVQSVDeviceContext *device_hwctx = hw_frames_ctx->device_ctx->hwctx; - - int opaque = !!(hw_frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); - - mfxHDL handle = NULL; - mfxHandleType handle_type; - mfxVersion ver; - mfxIMPL impl; - mfxVideoParam par; - mfxStatus err; - int i; - - /* extract the properties of the "master" session given to us */ - err = MFXQueryIMPL(device_hwctx->session, &impl); - if (err == MFX_ERR_NONE) - err = MFXQueryVersion(device_hwctx->session, &ver); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error querying the session attributes\n"); - return AVERROR_UNKNOWN; - } - - if (MFX_IMPL_VIA_VAAPI == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_VA_DISPLAY; - } else if (MFX_IMPL_VIA_D3D11 == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_D3D11_DEVICE; - } else if (MFX_IMPL_VIA_D3D9 == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_D3D9_DEVICE_MANAGER; - } else { - av_log(ctx, AV_LOG_ERROR, "Error unsupported handle type\n"); - return AVERROR_UNKNOWN; - } - - err = MFXVideoCORE_GetHandle(device_hwctx->session, handle_type, &handle); - if (err < 0) - return ff_qsvvpp_print_error(ctx, err, "Error getting the session handle"); - else if (err > 0) { - ff_qsvvpp_print_warning(ctx, err, "Warning in getting the session handle"); - return AVERROR_UNKNOWN; - } - - /* create a "slave" session with those same properties, to be used for - * actual deinterlacing */ - err = MFXInit(impl, &ver, &s->session); - if (err < 0) - return ff_qsvvpp_print_error(ctx, err, "Error initializing a session for deinterlacing"); - else if (err > 0) { - ff_qsvvpp_print_warning(ctx, err, "Warning in session initialization"); - return AVERROR_UNKNOWN; - } - - if (handle) { - err = MFXVideoCORE_SetHandle(s->session, handle_type, handle); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - } - - if (QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) { - err = MFXJoinSession(device_hwctx->session, s->session); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - } - - memset(&par, 0, sizeof(par)); - - s->deint_conf.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING; - s->deint_conf.Header.BufferSz = sizeof(s->deint_conf); - s->deint_conf.Mode = s->mode; - - s->ext_buffers[s->num_ext_buffers++] = (mfxExtBuffer *)&s->deint_conf; - - if (opaque) { - s->surface_ptrs = av_calloc(hw_frames_hwctx->nb_surfaces, - sizeof(*s->surface_ptrs)); - if (!s->surface_ptrs) - return AVERROR(ENOMEM); - for (i = 0; i < hw_frames_hwctx->nb_surfaces; i++) - s->surface_ptrs[i] = hw_frames_hwctx->surfaces + i; - s->nb_surface_ptrs = hw_frames_hwctx->nb_surfaces; - - s->opaque_alloc.In.Surfaces = s->surface_ptrs; - s->opaque_alloc.In.NumSurface = s->nb_surface_ptrs; - s->opaque_alloc.In.Type = hw_frames_hwctx->frame_type; - - s->opaque_alloc.Out = s->opaque_alloc.In; - - s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION; - s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc); - - s->ext_buffers[s->num_ext_buffers++] = (mfxExtBuffer *)&s->opaque_alloc; - - par.IOPattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY; - } else { - mfxFrameAllocator frame_allocator = { - .pthis = ctx, - .Alloc = frame_alloc, - .Lock = frame_lock, - .Unlock = frame_unlock, - .GetHDL = frame_get_hdl, - .Free = frame_free, - }; - - s->mem_ids = av_calloc(hw_frames_hwctx->nb_surfaces, - sizeof(*s->mem_ids)); - if (!s->mem_ids) - return AVERROR(ENOMEM); - for (i = 0; i < hw_frames_hwctx->nb_surfaces; i++) - s->mem_ids[i] = hw_frames_hwctx->surfaces[i].Data.MemId; - s->nb_mem_ids = hw_frames_hwctx->nb_surfaces; - - err = MFXVideoCORE_SetFrameAllocator(s->session, &frame_allocator); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - - par.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY; - } - - par.ExtParam = s->ext_buffers; - par.NumExtParam = s->num_ext_buffers; - - par.AsyncDepth = 1; // TODO async - - par.vpp.In = hw_frames_hwctx->surfaces[0].Info; - - par.vpp.In.CropW = ctx->inputs[0]->w; - par.vpp.In.CropH = ctx->inputs[0]->h; - - if (ctx->inputs[0]->frame_rate.num) { - par.vpp.In.FrameRateExtN = ctx->inputs[0]->frame_rate.num; - par.vpp.In.FrameRateExtD = ctx->inputs[0]->frame_rate.den; - } else { - par.vpp.In.FrameRateExtN = ctx->inputs[0]->time_base.num; - par.vpp.In.FrameRateExtD = ctx->inputs[0]->time_base.den; - } - - par.vpp.Out = par.vpp.In; - - if (ctx->outputs[0]->frame_rate.num) { - par.vpp.Out.FrameRateExtN = ctx->outputs[0]->frame_rate.num; - par.vpp.Out.FrameRateExtD = ctx->outputs[0]->frame_rate.den; - } else { - par.vpp.Out.FrameRateExtN = ctx->outputs[0]->time_base.num; - par.vpp.Out.FrameRateExtD = ctx->outputs[0]->time_base.den; - } - - /* Print input memory mode */ - ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0x0F, "VPP"); - /* Print output memory mode */ - ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0xF0, "VPP"); - err = MFXVideoVPP_Init(s->session, &par); - if (err < 0) - return ff_qsvvpp_print_error(ctx, err, - "Error opening the VPP for deinterlacing"); - else if (err > 0) { - ff_qsvvpp_print_warning(ctx, err, - "Warning in VPP initialization"); - return AVERROR_UNKNOWN; - } - - return 0; -} - -static int qsvdeint_config_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = ctx->inputs[0]; - QSVDeintContext *s = ctx->priv; - int ret; - - qsvdeint_uninit(ctx); - - s->last_pts = AV_NOPTS_VALUE; - outlink->frame_rate = av_mul_q(inlink->frame_rate, - (AVRational){ 2, 1 }); - outlink->time_base = av_mul_q(inlink->time_base, - (AVRational){ 1, 2 }); - - /* check that we have a hw context */ - if (!inlink->hw_frames_ctx) { - av_log(ctx, AV_LOG_ERROR, "No hw context provided on input\n"); - return AVERROR(EINVAL); - } - - s->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx); - if (!s->hw_frames_ctx) - return AVERROR(ENOMEM); - - av_buffer_unref(&outlink->hw_frames_ctx); - outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx); - if (!outlink->hw_frames_ctx) { - qsvdeint_uninit(ctx); - return AVERROR(ENOMEM); - } - - ret = init_out_session(ctx); - if (ret < 0) - return ret; - - - return 0; -} - -static void clear_unused_frames(QSVDeintContext *s) -{ - QSVFrame *cur = s->work_frames; - while (cur) { - if (!cur->surface.Data.Locked) { - av_frame_free(&cur->frame); - cur->queued = 0; - } - cur = cur->next; - } -} - -static int get_free_frame(QSVDeintContext *s, QSVFrame **f) -{ - QSVFrame *frame, **last; - - clear_unused_frames(s); - - frame = s->work_frames; - last = &s->work_frames; - while (frame) { - if (!frame->queued) { - *f = frame; - return 0; - } - - last = &frame->next; - frame = frame->next; - } - - frame = av_mallocz(sizeof(*frame)); - if (!frame) - return AVERROR(ENOMEM); - *last = frame; - *f = frame; - - return 0; -} - -static int submit_frame(AVFilterContext *ctx, AVFrame *frame, - mfxFrameSurface1 **surface) -{ - QSVDeintContext *s = ctx->priv; - QSVFrame *qf; - int ret; - - ret = get_free_frame(s, &qf); - if (ret < 0) - return ret; - - qf->frame = frame; - - qf->surface = *(mfxFrameSurface1*)qf->frame->data[3]; - - qf->surface.Data.Locked = 0; - qf->surface.Info.CropW = qf->frame->width; - qf->surface.Info.CropH = qf->frame->height; - - qf->surface.Info.PicStruct = !qf->frame->interlaced_frame ? MFX_PICSTRUCT_PROGRESSIVE : - (qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF : - MFX_PICSTRUCT_FIELD_BFF); - if (qf->frame->repeat_pict == 1) { - qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FIELD_REPEATED; - qf->surface.Info.PicStruct |= qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF : - MFX_PICSTRUCT_FIELD_BFF; - } else if (qf->frame->repeat_pict == 2) - qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_DOUBLING; - else if (qf->frame->repeat_pict == 4) - qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_TRIPLING; - - if (ctx->inputs[0]->frame_rate.num) { - qf->surface.Info.FrameRateExtN = ctx->inputs[0]->frame_rate.num; - qf->surface.Info.FrameRateExtD = ctx->inputs[0]->frame_rate.den; - } else { - qf->surface.Info.FrameRateExtN = ctx->inputs[0]->time_base.num; - qf->surface.Info.FrameRateExtD = ctx->inputs[0]->time_base.den; - } - - qf->surface.Data.TimeStamp = av_rescale_q(qf->frame->pts, - ctx->inputs[0]->time_base, - (AVRational){1, 90000}); - - *surface = &qf->surface; - qf->queued = 1; - - return 0; -} - -static int process_frame(AVFilterContext *ctx, const AVFrame *in, - mfxFrameSurface1 *surf_in) -{ - QSVDeintContext *s = ctx->priv; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; - - AVFrame *out; - mfxFrameSurface1 *surf_out; - mfxSyncPoint sync = NULL; - mfxStatus err; - int ret, again = 0; - - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) { - ret = AVERROR(ENOMEM); - goto fail; - } - - surf_out = (mfxFrameSurface1*)out->data[3]; - surf_out->Info.CropW = outlink->w; - surf_out->Info.CropH = outlink->h; - surf_out->Info.PicStruct = MFX_PICSTRUCT_PROGRESSIVE; - - do { - err = MFXVideoVPP_RunFrameVPPAsync(s->session, surf_in, surf_out, - NULL, &sync); - if (err == MFX_WRN_DEVICE_BUSY) - av_usleep(1); - } while (err == MFX_WRN_DEVICE_BUSY); - - if (err == MFX_ERR_MORE_DATA) { - av_frame_free(&out); - return QSVDEINT_MORE_INPUT; - } - - if (err < 0 && err != MFX_ERR_MORE_SURFACE) { - ret = ff_qsvvpp_print_error(ctx, err, "Error during deinterlacing"); - goto fail; - } - - if (!sync) { - av_log(ctx, AV_LOG_ERROR, "No sync during deinterlacing\n"); - ret = AVERROR_UNKNOWN; - goto fail; - } - if (err == MFX_ERR_MORE_SURFACE) - again = 1; - - do { - err = MFXVideoCORE_SyncOperation(s->session, sync, 1000); - } while (err == MFX_WRN_IN_EXECUTION); - if (err < 0) { - ret = ff_qsvvpp_print_error(ctx, err, "Error synchronizing the operation"); - goto fail; - } - - ret = av_frame_copy_props(out, in); - if (ret < 0) - goto fail; - - out->width = outlink->w; - out->height = outlink->h; - out->interlaced_frame = 0; - - out->pts = av_rescale_q(out->pts, inlink->time_base, outlink->time_base); - if (out->pts == s->last_pts) - out->pts++; - s->last_pts = out->pts; - - ret = ff_filter_frame(outlink, out); - if (ret < 0) - return ret; - - return again ? QSVDEINT_MORE_OUTPUT : 0; -fail: - av_frame_free(&out); - return ret; -} - -static int qsvdeint_filter_frame(AVFilterLink *link, AVFrame *in) -{ - AVFilterContext *ctx = link->dst; - - mfxFrameSurface1 *surf_in; - int ret; - - ret = submit_frame(ctx, in, &surf_in); - if (ret < 0) { - av_frame_free(&in); - return ret; - } - - do { - ret = process_frame(ctx, in, surf_in); - if (ret < 0) - return ret; - } while (ret == QSVDEINT_MORE_OUTPUT); - - return 0; -} - -static int qsvdeint_request_frame(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - - return ff_request_frame(ctx->inputs[0]); -} - -#define OFFSET(x) offsetof(QSVDeintContext, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM -static const AVOption options[] = { - { "mode", "set deinterlace mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, - { "bob", "bob algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_BOB}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, - { "advanced", "Motion adaptive algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, - { NULL }, -}; - -static const AVClass qsvdeint_class = { - .class_name = "deinterlace_qsv", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; - -static const AVFilterPad qsvdeint_inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = qsvdeint_filter_frame, - }, -}; - -static const AVFilterPad qsvdeint_outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = qsvdeint_config_props, - .request_frame = qsvdeint_request_frame, - }, -}; - -const AVFilter ff_vf_deinterlace_qsv = { - .name = "deinterlace_qsv", - .description = NULL_IF_CONFIG_SMALL("QuickSync video deinterlacing"), - - .uninit = qsvdeint_uninit, - - .priv_size = sizeof(QSVDeintContext), - .priv_class = &qsvdeint_class, - - FILTER_INPUTS(qsvdeint_inputs), - FILTER_OUTPUTS(qsvdeint_outputs), - FILTER_SINGLE_PIXFMT(AV_PIX_FMT_QSV), - - .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, -}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake.c 2023-03-03 13:29:59.000000000 +0000 @@ -50,10 +50,10 @@ */ #include "avfilter.h" -#include "formats.h" #include "internal.h" #include "video.h" #include "libavutil/common.h" +#include "libavutil/file_open.h" #include "libavutil/mem.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake_opencl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake_opencl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake_opencl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_deshake_opencl.c 2023-03-03 13:29:59.000000000 +0000 @@ -1413,8 +1413,15 @@ &debug_matches, 1); } +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS if (input_frame->pkt_duration) { duration = input_frame->pkt_duration; + } else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (input_frame->duration) { + duration = input_frame->duration; } else { duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_classify.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_classify.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_classify.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_classify.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,14 +21,10 @@ * implementing an classification filter using deep learning networks. */ -#include "libavformat/avio.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" #include "filters.h" #include "dnn_filter_common.h" -#include "formats.h" #include "internal.h" #include "libavutil/time.h" #include "libavutil/avstring.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_detect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_detect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_detect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_detect.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,14 +21,10 @@ * implementing an object detecting filter using deep learning networks. */ -#include "libavformat/avio.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" #include "filters.h" #include "dnn_filter_common.h" -#include "formats.h" #include "internal.h" #include "libavutil/time.h" #include "libavutil/avstring.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_processing.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_processing.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_processing.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_dnn_processing.c 2023-03-03 13:29:59.000000000 +0000 @@ -110,6 +110,7 @@ return AVERROR(EIO); } return 0; + case AV_PIX_FMT_GRAY8: case AV_PIX_FMT_GRAYF32: case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV422P: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawbox.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawbox.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawbox.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawbox.c 2023-03-03 13:29:59.000000000 +0000 @@ -162,7 +162,7 @@ row[2] = frame->data[0] + y * frame->linesize[0] + ctx->rgba_map[2]; #define ASSIGN_FOUR_CHANNELS_PACKED \ - ASSIGN_THREE_CHANNELS \ + ASSIGN_THREE_CHANNELS_PACKED \ row[3] = frame->data[0] + y * frame->linesize[0] + ctx->rgba_map[3]; static void draw_region_rgb_packed(AVFrame *frame, DrawBoxContext *ctx, int left, int top, int right, int down, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawtext.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawtext.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawtext.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_drawtext.c 2023-03-03 13:29:59.000000000 +0000 @@ -91,8 +91,11 @@ "y", "pict_type", "pkt_pos", +#if FF_API_PKT_DURATION "pkt_duration", +#endif "pkt_size", + "duration", NULL }; @@ -131,8 +134,11 @@ VAR_Y, VAR_PICT_TYPE, VAR_PKT_POS, +#if FF_API_PKT_DURATION VAR_PKT_DURATION, +#endif VAR_PKT_SIZE, + VAR_DURATION, VAR_VARS_NB }; @@ -1649,8 +1655,18 @@ s->var_values[VAR_PICT_TYPE] = frame->pict_type; s->var_values[VAR_PKT_POS] = frame->pkt_pos; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS s->var_values[VAR_PKT_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base); + + if (frame->pkt_duration) + s->var_values[VAR_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base); + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + s->var_values[VAR_DURATION] = frame->duration * av_q2d(inlink->time_base); s->var_values[VAR_PKT_SIZE] = frame->pkt_size; + s->metadata = frame->metadata; for (int i = 0; i < loop; i++) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_edgedetect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_edgedetect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_edgedetect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_edgedetect.c 2023-03-03 13:29:59.000000000 +0000 @@ -191,15 +191,15 @@ } /* gaussian filter to reduce noise */ - ff_gaussian_blur(width, height, - tmpbuf, width, - in->data[p], in->linesize[p]); + ff_gaussian_blur_8(width, height, + tmpbuf, width, + in->data[p], in->linesize[p], 1); /* compute the 16-bits gradients and directions for the next step */ - ff_sobel(width, height, - gradients, width, - directions,width, - tmpbuf, width); + ff_sobel_8(width, height, + gradients, width, + directions,width, + tmpbuf, width, 1); /* non_maximum_suppression() will actually keep & clip what's necessary and * ignore the rest, so we need a clean output buffer */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_elbg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_elbg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_elbg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_elbg.c 2023-03-03 13:29:59.000000000 +0000 @@ -187,7 +187,7 @@ av_frame_free(&frame); return AVERROR(ENOMEM); } - out->pts = frame->pts; + av_frame_copy_props(out, frame); av_frame_free(&frame); pal = (uint32_t *)out->data[1]; p0 = (uint8_t *)out->data[0]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_estdif.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_estdif.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_estdif.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_estdif.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,7 +48,6 @@ int max; int nb_planes; int nb_threads; - int64_t pts; AVFrame *prev; void (*interpolate)(struct ESTDIFContext *s, uint8_t *dst, @@ -433,7 +432,7 @@ return 0; } -static int filter(AVFilterContext *ctx, int is_second, AVFrame *in) +static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts, int64_t duration) { ESTDIFContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -445,7 +444,8 @@ return AVERROR(ENOMEM); av_frame_copy_props(out, in); out->interlaced_frame = 0; - out->pts = s->pts; + out->pts = pts; + out->duration = duration; td.out = out; td.in = in; ff_filter_execute(ctx, deinterlace_slice, &td, NULL, @@ -504,21 +504,21 @@ if ((s->deint && !s->prev->interlaced_frame) || ctx->is_disabled) { s->prev->pts *= 2; + s->prev->duration *= 2; ret = ff_filter_frame(ctx->outputs[0], s->prev); s->prev = in; return ret; } - s->pts = s->prev->pts * 2; - ret = filter(ctx, 0, s->prev); + ret = filter(ctx, s->prev, s->prev->pts * 2, + s->prev->duration * (s->mode ? 1 : 2)); if (ret < 0 || s->mode == 0) { av_frame_free(&s->prev); s->prev = in; return ret; } - s->pts = s->prev->pts + in->pts; - ret = filter(ctx, 1, s->prev); + ret = filter(ctx, s->prev, s->prev->pts + in->pts, in->duration); av_frame_free(&s->prev); s->prev = in; return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_exposure.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_exposure.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_exposure.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_exposure.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,41 +38,80 @@ int jobnr, int nb_jobs); } ExposureContext; +typedef struct ThreadData { + AVFrame *out, *in; +} ThreadData; + static int exposure_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ExposureContext *s = ctx->priv; - AVFrame *frame = arg; - const int width = frame->width; - const int height = frame->height; + ThreadData *td = arg; + const int width = td->out->width; + const int height = td->out->height; const int slice_start = (height * jobnr) / nb_jobs; const int slice_end = (height * (jobnr + 1)) / nb_jobs; const float black = s->black; const float scale = s->scale; for (int p = 0; p < 3; p++) { - const int linesize = frame->linesize[p] / 4; - float *ptr = (float *)frame->data[p] + slice_start * linesize; + const int slinesize = td->in->linesize[p] / 4; + const int dlinesize = td->out->linesize[p] / 4; + const float *src = (const float *)td->in->data[p] + slice_start * slinesize; + float *ptr = (float *)td->out->data[p] + slice_start * dlinesize; for (int y = slice_start; y < slice_end; y++) { for (int x = 0; x < width; x++) - ptr[x] = (ptr[x] - black) * scale; + ptr[x] = (src[x] - black) * scale; + + ptr += dlinesize; + src += slinesize; + } + } - ptr += linesize; + if (td->in->data[3] && td->in->linesize[3] && td->in != td->out) { + const int slinesize = td->in->linesize[3] / 4; + const int dlinesize = td->out->linesize[3] / 4; + const float *src = (const float *)td->in->data[3] + slice_start * slinesize; + float *ptr = (float *)td->out->data[3] + slice_start * dlinesize; + for (int y = slice_start; y < slice_end; y++) { + memcpy(ptr, src, width * sizeof(*ptr)); + ptr += dlinesize; + src += slinesize; } } return 0; } -static int filter_frame(AVFilterLink *inlink, AVFrame *frame) +static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; + AVFilterLink *outlink = ctx->outputs[0]; ExposureContext *s = ctx->priv; + float diff = fabsf(exp2f(-s->exposure) - s->black); + ThreadData td; + AVFrame *out; + + if (av_frame_is_writable(in)) { + out = in; + } else { + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + } - s->scale = 1.f / (exp2f(-s->exposure) - s->black); - ff_filter_execute(ctx, s->do_slice, frame, NULL, - FFMIN(frame->height, ff_filter_get_nb_threads(ctx))); - - return ff_filter_frame(ctx->outputs[0], frame); + diff = diff > 0.f ? diff : 1.f / 1024.f; + s->scale = 1.f / diff; + td.out = out; + td.in = in; + ff_filter_execute(ctx, s->do_slice, &td, NULL, + FFMIN(out->height, ff_filter_get_nb_threads(ctx))); + + if (out != in) + av_frame_free(&in); + return ff_filter_frame(outlink, out); } static av_cold int config_input(AVFilterLink *inlink) @@ -89,7 +128,6 @@ { .name = "default", .type = AVMEDIA_TYPE_VIDEO, - .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE, .filter_frame = filter_frame, .config_props = config_input, }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_extractplanes.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_extractplanes.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_extractplanes.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_extractplanes.c 2023-03-03 13:29:59.000000000 +0000 @@ -124,6 +124,7 @@ #define FLOAT_FORMATS(suf) \ AV_PIX_FMT_GRAYF32##suf, \ + AV_PIX_FMT_RGBF32##suf, AV_PIX_FMT_RGBAF32##suf, \ AV_PIX_FMT_GBRPF32##suf, AV_PIX_FMT_GBRAPF32##suf \ static int query_formats(AVFilterContext *ctx) @@ -284,6 +285,14 @@ dst[x * 2 + 1] = src[x * step + comp * 2 + 1]; } break; + case 4: + for (x = 0; x < width; x++) { + dst[x * 4 ] = src[x * step + comp * 4 ]; + dst[x * 4 + 1] = src[x * step + comp * 4 + 1]; + dst[x * 4 + 2] = src[x * step + comp * 4 + 2]; + dst[x * 4 + 3] = src[x * step + comp * 4 + 3]; + } + break; } dst += dst_linesize; src += src_linesize; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftdnoiz.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftdnoiz.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftdnoiz.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftdnoiz.c 2023-03-03 13:29:59.000000000 +0000 @@ -208,13 +208,17 @@ for (int i = 0; i < s->nb_threads; i++) { float scale = 1.f, iscale = 1.f; + int ret; - av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, 0, s->block_size, &scale, 0); - av_tx_init(&s->ifft[i], &s->itx_fn, AV_TX_FLOAT_FFT, 1, s->block_size, &iscale, 0); - av_tx_init(&s->fft_r[i], &s->tx_r_fn, AV_TX_FLOAT_FFT, 0, 1 + s->nb_prev + s->nb_next, &scale, 0); - av_tx_init(&s->ifft_r[i], &s->itx_r_fn, AV_TX_FLOAT_FFT, 1, 1 + s->nb_prev + s->nb_next, &iscale, 0); - if (!s->fft[i] || !s->ifft[i] || !s->fft_r[i] || !s->ifft_r[i]) - return AVERROR(ENOMEM); + if ((ret = av_tx_init(&s->fft[i], &s->tx_fn, AV_TX_FLOAT_FFT, + 0, s->block_size, &scale, 0)) < 0 || + (ret = av_tx_init(&s->ifft[i], &s->itx_fn, AV_TX_FLOAT_FFT, + 1, s->block_size, &iscale, 0)) < 0 || + (ret = av_tx_init(&s->fft_r[i], &s->tx_r_fn, AV_TX_FLOAT_FFT, + 0, 1 + s->nb_prev + s->nb_next, &scale, 0)) < 0 || + (ret = av_tx_init(&s->ifft_r[i], &s->itx_r_fn, AV_TX_FLOAT_FFT, + 1, 1 + s->nb_prev + s->nb_next, &iscale, 0)) < 0) + return ret; } for (i = 0; i < s->nb_planes; i++) { @@ -301,13 +305,14 @@ dst[j].re = dst[rw - 1].re; dst[j].im = 0.f; } - s->tx_fn(s->fft[jobnr], dst_out, dst, sizeof(float)); + s->tx_fn(s->fft[jobnr], dst_out, dst, sizeof(AVComplexFloat)); ddst = dst_out; dst += data_linesize; dst_out += data_linesize; } + dst = dst_out; for (int i = rh; i < block; i++) { for (int j = 0; j < block; j++) { dst[j].re = ddst[j].re; @@ -322,7 +327,7 @@ for (int i = 0; i < block; i++) { for (int j = 0; j < block; j++) dst[j] = ssrc[j * data_linesize + i]; - s->tx_fn(s->fft[jobnr], bdst, dst, sizeof(float)); + s->tx_fn(s->fft[jobnr], bdst, dst, sizeof(AVComplexFloat)); dst += data_linesize; bdst += buffer_linesize; @@ -347,8 +352,8 @@ AVComplexFloat *hdata = p->hdata[jobnr]; AVComplexFloat *hdata_out = p->hdata_out[jobnr]; AVComplexFloat *vdata_out = p->vdata_out[jobnr]; - const int rw = FFMIN(size, width - x * size + hoverlap); - const int rh = FFMIN(size, height - y * size + hoverlap); + const int rw = FFMIN(size, width - x * size); + const int rh = FFMIN(size, height - y * size); AVComplexFloat *hdst, *vdst = vdata_out, *hdst_out = hdata_out; float *bsrc = buffer; @@ -356,7 +361,7 @@ buffer_linesize /= sizeof(float); for (int i = 0; i < block; i++) { - s->itx_fn(s->ifft[jobnr], vdst, bsrc, sizeof(float)); + s->itx_fn(s->ifft[jobnr], vdst, bsrc, sizeof(AVComplexFloat)); for (int j = 0; j < block; j++) hdst[j * data_linesize + i] = vdst[j]; @@ -368,7 +373,7 @@ for (int i = 0; i < rh && (y * size + i) < height; i++) { uint8_t *dst = dstp + dst_linesize * (y * size + i) + x * size * bpp; - s->itx_fn(s->ifft[jobnr], hdst_out, hdst, sizeof(float)); + s->itx_fn(s->ifft[jobnr], hdst_out, hdst, sizeof(AVComplexFloat)); s->export_row(hdst_out + hoverlap, dst, rw, depth, s->win[i + hoverlap] + hoverlap); hdst += data_linesize; @@ -405,7 +410,7 @@ buffer[2].re = nbuff[2 * j ]; buffer[2].im = nbuff[2 * j + 1]; - s->tx_r_fn(s->fft_r[jobnr], outbuffer, buffer, sizeof(float)); + s->tx_r_fn(s->fft_r[jobnr], outbuffer, buffer, sizeof(AVComplexFloat)); for (int z = 0; z < 3; z++) { const float re = outbuffer[z].re; @@ -426,7 +431,7 @@ outbuffer[z].im *= factor; } - s->itx_r_fn(s->ifft_r[jobnr], buffer, outbuffer, sizeof(float)); + s->itx_r_fn(s->ifft_r[jobnr], buffer, outbuffer, sizeof(AVComplexFloat)); cbuff[2 * j + 0] = buffer[1].re; cbuff[2 * j + 1] = buffer[1].im; @@ -463,7 +468,7 @@ buffer[1].re = cbuff[2 * j ]; buffer[1].im = cbuff[2 * j + 1]; - s->tx_r_fn(s->fft_r[jobnr], outbuffer, buffer, sizeof(float)); + s->tx_r_fn(s->fft_r[jobnr], outbuffer, buffer, sizeof(AVComplexFloat)); for (int z = 0; z < 2; z++) { const float re = outbuffer[z].re; @@ -484,7 +489,7 @@ outbuffer[z].im *= factor; } - s->itx_r_fn(s->ifft_r[jobnr], buffer, outbuffer, sizeof(float)); + s->itx_r_fn(s->ifft_r[jobnr], buffer, outbuffer, sizeof(AVComplexFloat)); cbuff[2 * j + 0] = buffer[1].re; cbuff[2 * j + 1] = buffer[1].im; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftfilt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftfilt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftfilt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fftfilt.c 2023-03-03 13:29:59.000000000 +0000 @@ -201,7 +201,7 @@ s->ihtx_fn(s->ihrdft[jobnr][plane], s->rdft_hdata_out[plane] + i * s->rdft_hstride[plane], s->rdft_hdata_in[plane] + i * s->rdft_hstride[plane], - sizeof(float)); + sizeof(AVComplexFloat)); for (int i = slice_start; i < slice_end; i++) { const float scale = 1.f / (s->rdft_hlen[plane] * s->rdft_vlen[plane]); @@ -232,7 +232,7 @@ s->ihtx_fn(s->ihrdft[jobnr][plane], s->rdft_hdata_out[plane] + i * s->rdft_hstride[plane], s->rdft_hdata_in[plane] + i * s->rdft_hstride[plane], - sizeof(float)); + sizeof(AVComplexFloat)); for (int i = slice_start; i < slice_end; i++) { const float scale = 1.f / (s->rdft_hlen[plane] * s->rdft_vlen[plane]); @@ -306,7 +306,7 @@ { FFTFILTContext *s = inlink->dst->priv; const AVPixFmtDescriptor *desc; - int i, plane; + int ret, i, plane; desc = av_pix_fmt_desc_get(inlink->format); s->depth = desc->comp[0].depth; @@ -335,12 +335,14 @@ for (int j = 0; j < s->nb_threads; j++) { float scale = 1.f, iscale = 1.f; - av_tx_init(&s->hrdft[j][i], &s->htx_fn, AV_TX_FLOAT_RDFT, 0, 1 << s->rdft_hbits[i], &scale, 0); - if (!s->hrdft[j][i]) - return AVERROR(ENOMEM); - av_tx_init(&s->ihrdft[j][i], &s->ihtx_fn, AV_TX_FLOAT_RDFT, 1, 1 << s->rdft_hbits[i], &iscale, 0); - if (!s->ihrdft[j][i]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->hrdft[j][i], &s->htx_fn, AV_TX_FLOAT_RDFT, + 0, 1 << s->rdft_hbits[i], &scale, 0); + if (ret < 0) + return ret; + ret = av_tx_init(&s->ihrdft[j][i], &s->ihtx_fn, AV_TX_FLOAT_RDFT, + 1, 1 << s->rdft_hbits[i], &iscale, 0); + if (ret < 0) + return ret; } /* RDFT - Array initialization for Vertical pass*/ @@ -356,12 +358,14 @@ for (int j = 0; j < s->nb_threads; j++) { float scale = 1.f, iscale = 1.f; - av_tx_init(&s->vrdft[j][i], &s->vtx_fn, AV_TX_FLOAT_RDFT, 0, 1 << s->rdft_vbits[i], &scale, 0); - if (!s->vrdft[j][i]) - return AVERROR(ENOMEM); - av_tx_init(&s->ivrdft[j][i], &s->ivtx_fn, AV_TX_FLOAT_RDFT, 1, 1 << s->rdft_vbits[i], &iscale, 0); - if (!s->ivrdft[j][i]) - return AVERROR(ENOMEM); + ret = av_tx_init(&s->vrdft[j][i], &s->vtx_fn, AV_TX_FLOAT_RDFT, + 0, 1 << s->rdft_vbits[i], &scale, 0); + if (ret < 0) + return ret; + ret = av_tx_init(&s->ivrdft[j][i], &s->ivtx_fn, AV_TX_FLOAT_RDFT, + 1, 1 << s->rdft_vbits[i], &iscale, 0); + if (ret < 0) + return ret; } } @@ -464,7 +468,7 @@ s->ivtx_fn(s->ivrdft[jobnr][plane], s->rdft_vdata_in[plane] + i * s->rdft_vstride[plane], s->rdft_vdata_out[plane] + i * s->rdft_vstride[plane], - sizeof(float)); + sizeof(AVComplexFloat)); } return 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldhint.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldhint.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldhint.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldhint.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,6 +19,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/file_open.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/opt.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldmatch.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldmatch.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldmatch.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fieldmatch.c 2023-03-03 13:29:59.000000000 +0000 @@ -680,7 +680,7 @@ AVFilterLink *outlink = ctx->outputs[0]; FieldMatchContext *fm = ctx->priv; int combs[] = { -1, -1, -1, -1, -1 }; - int order, field, i, match, sc = 0, ret = 0; + int order, field, i, match, interlaced_frame, sc = 0, ret = 0; const int *fxo; AVFrame *gen_frames[] = { NULL, NULL, NULL, NULL, NULL }; AVFrame *dst = NULL; @@ -793,6 +793,12 @@ } } + /* keep fields as-is if not matched properly */ + interlaced_frame = combs[match] >= fm->combpel; + if (interlaced_frame && fm->combmatch == COMBMATCH_FULL) { + match = mC; + } + /* get output frame and drop the others */ if (fm->ppsrc) { /* field matching was based on a filtered/post-processed input, we now @@ -813,7 +819,7 @@ /* mark the frame we are unable to match properly as interlaced so a proper * de-interlacer can take the relay */ - dst->interlaced_frame = combs[match] >= fm->combpel; + dst->interlaced_frame = interlaced_frame; if (dst->interlaced_frame) { av_log(ctx, AV_LOG_WARNING, "Frame #%"PRId64" at %s is still interlaced\n", outlink->frame_count_in, av_ts2timestr(in->pts, &inlink->time_base)); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_floodfill.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_floodfill.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_floodfill.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_floodfill.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "video.h" @@ -315,8 +316,10 @@ s->front++; } - if (ret = av_frame_make_writable(frame)) + if (ret = ff_inlink_make_frame_writable(link, &frame)) { + av_frame_free(&frame); return ret; + } while (s->front > s->back) { int x, y; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fps.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fps.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fps.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_fps.c 2023-03-03 13:29:59.000000000 +0000 @@ -291,6 +291,7 @@ // Make sure Closed Captions will not be duplicated av_frame_remove_side_data(s->frames[0], AV_FRAME_DATA_A53_CC); frame->pts = s->next_pts++; + frame->duration = 1; av_log(ctx, AV_LOG_DEBUG, "Writing frame with pts %"PRId64" to pts %"PRId64"\n", s->frames[0]->pts, frame->pts); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_framepack.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_framepack.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_framepack.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_framepack.c 2023-03-03 13:29:59.000000000 +0000 @@ -329,8 +329,10 @@ for (i = 0; i < 2; i++) { // set correct timestamps - if (pts != AV_NOPTS_VALUE) + if (pts != AV_NOPTS_VALUE) { s->input_views[i]->pts = i == 0 ? pts * 2 : pts * 2 + av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + s->input_views[i]->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + } // set stereo3d side data stereo = av_stereo3d_create_side_data(s->input_views[i]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_frei0r.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_frei0r.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_frei0r.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_frei0r.c 2023-03-03 13:29:59.000000000 +0000 @@ -359,14 +359,17 @@ { Frei0rContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; - AVFrame *out = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + /* align parameter is the line alignment, not the buffer alignment. + * frei0r expects line size to be width*4 so we want an align of 1 + * to ensure lines aren't padded out. */ + AVFrame *out = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!out) goto fail; av_frame_copy_props(out, in); if (in->linesize[0] != out->linesize[0]) { - AVFrame *in2 = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + AVFrame *in2 = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!in2) goto fail; av_frame_copy(in2, in); @@ -481,13 +484,14 @@ static int source_request_frame(AVFilterLink *outlink) { Frei0rContext *s = outlink->src->priv; - AVFrame *frame = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 16); + AVFrame *frame = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1); if (!frame) return AVERROR(ENOMEM); frame->sample_aspect_ratio = (AVRational) {1, 1}; frame->pts = s->pts++; + frame->duration = 1; s->update(s->instance, av_rescale_q(frame->pts, s->time_base, (AVRational){1,1000}), NULL, (uint32_t *)frame->data[0]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_gblur.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_gblur.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_gblur.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_gblur.c 2023-03-03 13:29:59.000000000 +0000 @@ -125,7 +125,7 @@ const int nb_threads = ff_filter_get_nb_threads(ctx); ThreadData td; - if (s->sigma <= 0 || s->steps < 0) + if (s->sigma < 0 || s->steps < 0) return; td.width = width; @@ -207,6 +207,12 @@ *postscale = pow(dnu / lambda, steps); *boundaryscale = 1.0 / (1.0 - dnu); *nu = (float)dnu; + if (!isnormal(*postscale)) + *postscale = 1.f; + if (!isnormal(*boundaryscale)) + *boundaryscale = 1.f; + if (!isnormal(*nu)) + *nu = 0.f; } static int filter_frame(AVFilterLink *inlink, AVFrame *in) @@ -241,7 +247,7 @@ uint16_t *dst16 = (uint16_t *)out->data[plane]; int y, x; - if (!s->sigma || !(s->planes & (1 << plane))) { + if (!(s->planes & (1 << plane))) { if (out != in) av_image_copy_plane(out->data[plane], out->linesize[plane], in->data[plane], in->linesize[plane], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_histogram.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_histogram.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_histogram.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_histogram.c 2023-03-03 13:29:59.000000000 +0000 @@ -593,7 +593,7 @@ memset(s->histogram, 0, s->histogram_size * sizeof(unsigned)); } - out->pts = in->pts; + av_frame_copy_props(out, in); av_frame_free(&in); s->x_pos++; if (s->x_pos >= s->width) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_hqdn3d.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_hqdn3d.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_hqdn3d.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_hqdn3d.c 2023-03-03 13:29:59.000000000 +0000 @@ -180,7 +180,7 @@ gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001); for (i = -(256<pts = in->pts; + av_frame_copy_props(out, in); td.out = out; td.in = in; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lensfun.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lensfun.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lensfun.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lensfun.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "libavutil/opt.h" #include "libswscale/swscale.h" #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "video.h" @@ -443,9 +444,14 @@ AVFrame *out; VignettingThreadData vignetting_thread_data; DistortionCorrectionThreadData distortion_correction_thread_data; + int ret; if (lensfun->mode & VIGNETTING) { - av_frame_make_writable(in); + ret = ff_inlink_make_frame_writable(inlink, &in); + if (ret < 0) { + av_frame_free(&in); + return ret; + } vignetting_thread_data = (VignettingThreadData) { .width = inlink->w, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libplacebo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libplacebo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libplacebo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libplacebo.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,8 @@ enum { TONE_MAP_AUTO, TONE_MAP_CLIP, + TONE_MAP_ST2094_40, + TONE_MAP_ST2094_10, TONE_MAP_BT2390, TONE_MAP_BT2446A, TONE_MAP_SPLINE, @@ -41,31 +43,36 @@ }; static const struct pl_tone_map_function * const tonemapping_funcs[TONE_MAP_COUNT] = { - [TONE_MAP_AUTO] = &pl_tone_map_auto, - [TONE_MAP_CLIP] = &pl_tone_map_clip, - [TONE_MAP_BT2390] = &pl_tone_map_bt2390, - [TONE_MAP_BT2446A] = &pl_tone_map_bt2446a, - [TONE_MAP_SPLINE] = &pl_tone_map_spline, - [TONE_MAP_REINHARD] = &pl_tone_map_reinhard, - [TONE_MAP_MOBIUS] = &pl_tone_map_mobius, - [TONE_MAP_HABLE] = &pl_tone_map_hable, - [TONE_MAP_GAMMA] = &pl_tone_map_gamma, - [TONE_MAP_LINEAR] = &pl_tone_map_linear, + [TONE_MAP_AUTO] = &pl_tone_map_auto, + [TONE_MAP_CLIP] = &pl_tone_map_clip, +#if PL_API_VER >= 246 + [TONE_MAP_ST2094_40] = &pl_tone_map_st2094_40, + [TONE_MAP_ST2094_10] = &pl_tone_map_st2094_10, +#endif + [TONE_MAP_BT2390] = &pl_tone_map_bt2390, + [TONE_MAP_BT2446A] = &pl_tone_map_bt2446a, + [TONE_MAP_SPLINE] = &pl_tone_map_spline, + [TONE_MAP_REINHARD] = &pl_tone_map_reinhard, + [TONE_MAP_MOBIUS] = &pl_tone_map_mobius, + [TONE_MAP_HABLE] = &pl_tone_map_hable, + [TONE_MAP_GAMMA] = &pl_tone_map_gamma, + [TONE_MAP_LINEAR] = &pl_tone_map_linear, }; typedef struct LibplaceboContext { /* lavfi vulkan*/ FFVulkanContext vkctx; - int initialized; /* libplacebo */ pl_log log; pl_vulkan vulkan; pl_gpu gpu; pl_renderer renderer; + pl_tex tex[8]; /* settings */ char *out_format_string; + enum AVPixelFormat out_format; char *w_expr; char *h_expr; AVRational target_sar; @@ -215,6 +222,8 @@ return AVERROR(EINVAL); } +static void libplacebo_uninit(AVFilterContext *avctx); + static int libplacebo_init(AVFilterContext *avctx) { LibplaceboContext *s = avctx->priv; @@ -229,6 +238,18 @@ if (!s->log) return AVERROR(ENOMEM); + if (s->out_format_string) { + s->out_format = av_get_pix_fmt(s->out_format_string); + if (s->out_format == AV_PIX_FMT_NONE) { + av_log(avctx, AV_LOG_ERROR, "Invalid output format: %s\n", + s->out_format_string); + libplacebo_uninit(avctx); + return AVERROR(EINVAL); + } + } else { + s->out_format = AV_PIX_FMT_NONE; + } + /* Note: s->vulkan etc. are initialized later, when hwctx is available */ return 0; } @@ -237,10 +258,25 @@ { int err = 0; LibplaceboContext *s = avctx->priv; - const AVVulkanDeviceContext *hwctx = s->vkctx.hwctx; + const AVHWDeviceContext *avhwctx; + const AVVulkanDeviceContext *hwctx; uint8_t *buf = NULL; size_t buf_len; + if (!avctx->hw_device_ctx) { + av_log(s, AV_LOG_ERROR, "Missing vulkan hwdevice for vf_libplacebo.\n"); + return AVERROR(EINVAL); + } + + avhwctx = (AVHWDeviceContext *) avctx->hw_device_ctx->data; + if (avhwctx->type != AV_HWDEVICE_TYPE_VULKAN) { + av_log(s, AV_LOG_ERROR, "Expected vulkan hwdevice for vf_libplacebo, got %s.\n", + av_hwdevice_get_type_name(avhwctx->type)); + return AVERROR(EINVAL); + } + + hwctx = avhwctx->hwctx; + /* Import libavfilter vulkan context into libplacebo */ s->vulkan = pl_vulkan_import(s->log, pl_vulkan_import_params( .instance = hwctx->inst, @@ -289,7 +325,6 @@ fail: if (buf) av_file_unmap(buf, buf_len); - s->initialized = 1; return err; } @@ -297,13 +332,14 @@ { LibplaceboContext *s = avctx->priv; + for (int i = 0; i < FF_ARRAY_ELEMS(s->tex); i++) + pl_tex_destroy(s->gpu, &s->tex[i]); for (int i = 0; i < s->num_hooks; i++) pl_mpv_user_shader_destroy(&s->hooks[i]); pl_renderer_destroy(&s->renderer); pl_vulkan_destroy(&s->vulkan); pl_log_destroy(&s->log); ff_vk_uninit(&s->vkctx); - s->initialized = 0; s->gpu = NULL; } @@ -313,17 +349,23 @@ LibplaceboContext *s = avctx->priv; struct pl_render_params params; enum pl_tone_map_mode tonemapping_mode = s->tonemapping_mode; + const AVPixFmtDescriptor *outdesc = av_pix_fmt_desc_get(out->format); enum pl_gamut_mode gamut_mode = s->gamut_mode; struct pl_frame image, target; ok = pl_map_avframe_ex(s->gpu, &image, pl_avframe_params( .frame = in, + .tex = s->tex, .map_dovi = s->apply_dovi, )); - ok &= pl_map_avframe_ex(s->gpu, &target, pl_avframe_params( - .frame = out, - .map_dovi = false, - )); + if (outdesc->flags & AV_PIX_FMT_FLAG_HWACCEL) { + ok &= pl_map_avframe_ex(s->gpu, &target, pl_avframe_params( + .frame = out, + .map_dovi = false, + )); + } else { + ok &= pl_frame_recreate_from_avframe(s->gpu, &target, s->tex + 4, out); + } if (!ok) { err = AVERROR_EXTERNAL; @@ -426,7 +468,13 @@ pl_render_image(s->renderer, &image, &target, ¶ms); pl_unmap_avframe(s->gpu, &image); - pl_unmap_avframe(s->gpu, &target); + + if (outdesc->flags & AV_PIX_FMT_FLAG_HWACCEL) { + pl_unmap_avframe(s->gpu, &target); + } else if (!pl_download_avframe(s->gpu, &target, out)) { + err = AVERROR_EXTERNAL; + goto fail; + } /* Flush the command queues for performance */ pl_gpu_flush(s->gpu); @@ -452,8 +500,6 @@ } pl_log_level_update(s->log, get_log_level()); - if (!s->initialized) - RET(init_vulkan(ctx)); RET(av_frame_copy_props(out, in)); out->width = outlink->w; @@ -505,6 +551,83 @@ return err; } +static int libplacebo_query_format(AVFilterContext *ctx) +{ + int err; + LibplaceboContext *s = ctx->priv; + const AVPixFmtDescriptor *desc = NULL; + AVFilterFormats *infmts = NULL, *outfmts = NULL; + + RET(init_vulkan(ctx)); + + while ((desc = av_pix_fmt_desc_next(desc))) { + enum AVPixelFormat pixfmt = av_pix_fmt_desc_get_id(desc); + +#if PL_API_VER < 232 + // Older libplacebo can't handle >64-bit pixel formats, so safe-guard + // this to prevent triggering an assertion + if (av_get_bits_per_pixel(desc) > 64) + continue; +#endif + + if (!pl_test_pixfmt(s->gpu, pixfmt)) + continue; + + RET(ff_add_format(&infmts, pixfmt)); + + /* Filter for supported output pixel formats */ + if (desc->flags & AV_PIX_FMT_FLAG_BE) + continue; /* BE formats are not supported by pl_download_avframe */ + + /* Mask based on user specified format */ + if (s->out_format != AV_PIX_FMT_NONE) { + if (pixfmt == AV_PIX_FMT_VULKAN && av_vkfmt_from_pixfmt(s->out_format)) { + /* OK */ + } else if (pixfmt == s->out_format) { + /* OK */ + } else { + continue; /* Not OK */ + } + } + + RET(ff_add_format(&outfmts, pixfmt)); + } + + if (!infmts || !outfmts) { + if (s->out_format) { + av_log(s, AV_LOG_ERROR, "Invalid output format '%s'!\n", + av_get_pix_fmt_name(s->out_format)); + } + err = AVERROR(EINVAL); + goto fail; + } + + RET(ff_formats_ref(infmts, &ctx->inputs[0]->outcfg.formats)); + RET(ff_formats_ref(outfmts, &ctx->outputs[0]->incfg.formats)); + return 0; + +fail: + if (infmts && !infmts->refcount) + ff_formats_unref(&infmts); + if (outfmts && !outfmts->refcount) + ff_formats_unref(&outfmts); + return err; +} + +static int libplacebo_config_input(AVFilterLink *inlink) +{ + AVFilterContext *avctx = inlink->dst; + LibplaceboContext *s = avctx->priv; + + if (inlink->format == AV_PIX_FMT_VULKAN) + return ff_vk_filter_config_input(inlink); + + /* Forward this to the vkctx for format selection */ + s->vkctx.input_format = inlink->format; + + return 0; +} + static int libplacebo_config_output(AVFilterLink *outlink) { int err; @@ -514,22 +637,21 @@ AVHWFramesContext *hwfc; AVVulkanFramesContext *vkfc; AVRational scale_sar; - int *out_w = &s->vkctx.output_width; - int *out_h = &s->vkctx.output_height; RET(ff_scale_eval_dimensions(s, s->w_expr, s->h_expr, inlink, outlink, - out_w, out_h)); + &outlink->w, &outlink->h)); - ff_scale_adjust_dimensions(inlink, out_w, out_h, + ff_scale_adjust_dimensions(inlink, &outlink->w, &outlink->h, s->force_original_aspect_ratio, s->force_divisible_by); - scale_sar = (AVRational){outlink->h * inlink->w, *out_w * *out_h}; + scale_sar = (AVRational){outlink->h * inlink->w, outlink->w * inlink->h}; if (inlink->sample_aspect_ratio.num) scale_sar = av_mul_q(scale_sar, inlink->sample_aspect_ratio); if (s->normalize_sar) { /* Apply all SAR during scaling, so we don't need to set the out SAR */ + outlink->sample_aspect_ratio = (AVRational){ 1, 1 }; s->target_sar = scale_sar; } else { /* This is consistent with other scale_* filters, which only @@ -539,17 +661,17 @@ outlink->sample_aspect_ratio = scale_sar; } - if (s->out_format_string) { - s->vkctx.output_format = av_get_pix_fmt(s->out_format_string); - if (s->vkctx.output_format == AV_PIX_FMT_NONE) { - av_log(avctx, AV_LOG_ERROR, "Invalid output format.\n"); - return AVERROR(EINVAL); - } - } else { - /* Default to re-using the input format */ + if (outlink->format != AV_PIX_FMT_VULKAN) + return 0; + + s->vkctx.output_width = outlink->w; + s->vkctx.output_height = outlink->h; + /* Default to re-using the input format */ + if (s->out_format == AV_PIX_FMT_NONE || s->out_format == AV_PIX_FMT_VULKAN) { s->vkctx.output_format = s->vkctx.input_format; + } else { + s->vkctx.output_format = s->out_format; } - RET(ff_vk_filter_config_output(outlink)); hwfc = (AVHWFramesContext *) outlink->hw_frames_ctx->data; vkfc = hwfc->hwctx; @@ -574,7 +696,7 @@ { "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, STATIC, "force_oar" }, { "increase", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 0, STATIC, "force_oar" }, { "force_divisible_by", "enforce that the output resolution is divisible by a defined integer when force_original_aspect_ratio is used", OFFSET(force_divisible_by), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 256, STATIC }, - { "normalize_sar", "force SAR normalization to 1:1", OFFSET(normalize_sar), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, STATIC }, + { "normalize_sar", "force SAR normalization to 1:1", OFFSET(normalize_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, STATIC }, { "pad_crop_ratio", "ratio between padding and cropping when normalizing SAR (0=pad, 1=crop)", OFFSET(pad_crop_ratio), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, 1.0, DYNAMIC }, {"colorspace", "select colorspace", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_SPC_NB-1, DYNAMIC, "colorspace"}, @@ -674,6 +796,10 @@ { "tonemapping", "Tone-mapping algorithm", OFFSET(tonemapping), AV_OPT_TYPE_INT, {.i64 = TONE_MAP_AUTO}, 0, TONE_MAP_COUNT - 1, DYNAMIC, "tonemap" }, { "auto", "Automatic selection", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_AUTO}, 0, 0, STATIC, "tonemap" }, { "clip", "No tone mapping (clip", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_CLIP}, 0, 0, STATIC, "tonemap" }, +#if PL_API_VER >= 246 + { "st2094-40", "SMPTE ST 2094-40", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_ST2094_40}, 0, 0, STATIC, "tonemap" }, + { "st2094-10", "SMPTE ST 2094-10", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_ST2094_10}, 0, 0, STATIC, "tonemap" }, +#endif { "bt.2390", "ITU-R BT.2390 EETF", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_BT2390}, 0, 0, STATIC, "tonemap" }, { "bt.2446a", "ITU-R BT.2446 Method A", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_BT2446A}, 0, 0, STATIC, "tonemap" }, { "spline", "Single-pivot polynomial spline", 0, AV_OPT_TYPE_CONST, {.i64 = TONE_MAP_SPLINE}, 0, 0, STATIC, "tonemap" }, @@ -734,7 +860,7 @@ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .filter_frame = &filter_frame, - .config_props = &ff_vk_filter_config_input, + .config_props = &libplacebo_config_input, }, }; @@ -755,7 +881,7 @@ .process_command = &ff_filter_process_command, FILTER_INPUTS(libplacebo_inputs), FILTER_OUTPUTS(libplacebo_outputs), - FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN), + FILTER_QUERY_FUNC(libplacebo_query_format), .priv_class = &libplacebo_class, .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libvmaf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libvmaf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libvmaf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_libvmaf.c 2023-03-03 13:29:59.000000000 +0000 @@ -70,8 +70,8 @@ {"enable_transform", "use model='enable_transform=true'.", OFFSET(enable_transform), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"phone_model", "use model='enable_transform=true'.", OFFSET(phone_model), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"psnr", "use feature='name=psnr'.", OFFSET(psnr), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, - {"ssim", "use feature='name=ssim'.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, - {"ms_ssim", "use feature='name=ms_ssim'.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, + {"ssim", "use feature='name=float_ssim'.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, + {"ms_ssim", "use feature='name=float_ms_ssim'.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, {"pool", "Set the pool method to be used for computing vmaf.", OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, {"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, {"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, @@ -108,6 +108,7 @@ static int copy_picture_data(AVFrame *src, VmafPicture *dst, unsigned bpc) { + const int bytes_per_value = bpc > 8 ? 2 : 1; int err = vmaf_picture_alloc(dst, pix_fmt_map(src->format), bpc, src->width, src->height); if (err) @@ -117,7 +118,7 @@ uint8_t *src_data = src->data[i]; uint8_t *dst_data = dst->data[i]; for (unsigned j = 0; j < dst->h[i]; j++) { - memcpy(dst_data, src_data, sizeof(*dst_data) * dst->w[i]); + memcpy(dst_data, src_data, bytes_per_value * dst->w[i]); src_data += src->linesize[i]; dst_data += dst->stride[i]; } @@ -235,9 +236,9 @@ for (unsigned i = 0; i < dict_cnt; i++) { char *feature_name = NULL; VmafFeatureDictionary *feature_opts_dict = NULL; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; - while (e = av_dict_get(dict[i], "", e, AV_DICT_IGNORE_SUFFIX)) { + while (e = av_dict_iterate(dict[i], e)) { if (av_stristr(e->key, "name")) { feature_name = e->value; continue; @@ -294,11 +295,11 @@ for (unsigned i = 0; i < dict_cnt; i++) { VmafModelConfig model_cfg = { 0 }; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; char *version = NULL; char *path = NULL; - while (e = av_dict_get(dict[i], "", e, AV_DICT_IGNORE_SUFFIX)) { + while (e = av_dict_iterate(dict[i], e)) { if (av_stristr(e->key, "disable_clip")) { model_cfg.flags |= av_stristr(e->value, "true") ? VMAF_MODEL_FLAG_DISABLE_CLIP : 0; @@ -354,7 +355,7 @@ goto exit; } - while (e = av_dict_get(dict[i], "", e, AV_DICT_IGNORE_SUFFIX)) { + while (e = av_dict_iterate(dict[i], e)) { VmafFeatureDictionary *feature_opts_dict = NULL; char *feature_opt = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lut3d.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lut3d.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lut3d.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_lut3d.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,13 +29,11 @@ #include "float.h" #include "libavutil/opt.h" -#include "libavutil/file.h" -#include "libavutil/intreadwrite.h" +#include "libavutil/file_open.h" #include "libavutil/intfloat.h" #include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "drawutils.h" -#include "formats.h" #include "internal.h" #include "video.h" #include "lut3d.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_maskedthreshold.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_maskedthreshold.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_maskedthreshold.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_maskedthreshold.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ int threshold; int planes; + int mode; int linesize[4]; int planewidth[4], planeheight[4]; @@ -43,15 +44,19 @@ } MaskedThresholdContext; #define OFFSET(x) offsetof(MaskedThresholdContext, x) -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM +#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM typedef struct ThreadData { AVFrame *src, *ref, *dst; } ThreadData; static const AVOption maskedthreshold_options[] = { - { "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_INT, {.i64=1}, 0, UINT16_MAX, FLAGS }, - { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, + { "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_INT, {.i64=1}, 0, UINT16_MAX, TFLAGS }, + { "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, TFLAGS }, + { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "mode" }, + { "abs", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode" }, + { "diff", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode" }, { NULL } }; @@ -77,13 +82,29 @@ AV_PIX_FMT_NONE }; -static void threshold8(const uint8_t *src, const uint8_t *ref, uint8_t *dst, int threshold, int w) +static void threshold8_diff(const uint8_t *src, const uint8_t *ref, uint8_t *dst, int threshold, int w) +{ + for (int x = 0; x < w; x++) + dst[x] = (ref[x] - src[x] <= threshold) ? FFMAX(ref[x] - threshold, 0): src[x]; +} + +static void threshold8_abs(const uint8_t *src, const uint8_t *ref, uint8_t *dst, int threshold, int w) { for (int x = 0; x < w; x++) dst[x] = FFABS(src[x] - ref[x]) <= threshold ? src[x] : ref[x]; } -static void threshold16(const uint8_t *ssrc, const uint8_t *rref, uint8_t *ddst, int threshold, int w) +static void threshold16_diff(const uint8_t *ssrc, const uint8_t *rref, uint8_t *ddst, int threshold, int w) +{ + const uint16_t *src = (const uint16_t *)ssrc; + const uint16_t *ref = (const uint16_t *)rref; + uint16_t *dst = (uint16_t *)ddst; + + for (int x = 0; x < w; x++) + dst[x] = (ref[x] - src[x] <= threshold) ? FFMAX(ref[x] - threshold, 0): src[x]; +} + +static void threshold16_abs(const uint8_t *ssrc, const uint8_t *rref, uint8_t *ddst, int threshold, int w) { const uint16_t *src = (const uint16_t *)ssrc; const uint16_t *ref = (const uint16_t *)rref; @@ -115,9 +136,9 @@ s->depth = desc->comp[0].depth; if (desc->comp[0].depth == 8) - s->maskedthreshold = threshold8; + s->maskedthreshold = s->mode ? threshold8_diff : threshold8_abs; else - s->maskedthreshold = threshold16; + s->maskedthreshold = s->mode ? threshold16_diff : threshold16_abs; return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_minterpolate.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_minterpolate.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_minterpolate.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_minterpolate.c 2023-03-03 13:29:59.000000000 +0000 @@ -1189,6 +1189,7 @@ av_frame_copy_props(avf_out, mi_ctx->frames[NB_FRAMES - 1].avf); avf_out->pts = mi_ctx->out_pts++; + avf_out->duration = 1; interpolate(inlink, avf_out); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_nnedi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_nnedi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_nnedi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_nnedi.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,13 +22,13 @@ #include #include "libavutil/common.h" +#include "libavutil/file_open.h" #include "libavutil/float_dsp.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" -#include "formats.h" #include "internal.h" #include "video.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_cuda.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_cuda.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_cuda.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_cuda.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "libavutil/eval.h" #include "avfilter.h" +#include "filters.h" #include "framesync.h" #include "internal.h" @@ -252,7 +253,7 @@ if (!input_overlay) return ff_filter_frame(outlink, input_main); - ret = av_frame_make_writable(input_main); + ret = ff_inlink_make_frame_writable(inlink, &input_main); if (ret < 0) { av_frame_free(&input_main); return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_qsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -57,10 +57,9 @@ }; typedef struct QSVOverlayContext { - const AVClass *class; + QSVVPPContext qsv; FFFrameSync fs; - QSVVPPContext *qsv; QSVVPPParam qsv_param; mfxExtVPPComposite comp_conf; double var_values[VAR_VARS_NB]; @@ -230,14 +229,14 @@ static int process_frame(FFFrameSync *fs) { AVFilterContext *ctx = fs->parent; - QSVOverlayContext *s = fs->opaque; + QSVVPPContext *qsv = fs->opaque; AVFrame *frame = NULL; int ret = 0, i; for (i = 0; i < ctx->nb_inputs; i++) { ret = ff_framesync_get_frame(fs, i, &frame, 0); if (ret == 0) - ret = ff_qsvvpp_filter_frame(s->qsv, ctx->inputs[i], frame); + ret = ff_qsvvpp_filter_frame(qsv, ctx->inputs[i], frame); if (ret < 0 && ret != AVERROR(EAGAIN)) break; } @@ -276,6 +275,7 @@ int ret; av_log(ctx, AV_LOG_DEBUG, "Output is of %s.\n", av_get_pix_fmt_name(outlink->format)); + vpp->qsv_param.out_sw_format = in0->format; if ((in0->format == AV_PIX_FMT_QSV && in1->format != AV_PIX_FMT_QSV) || (in0->format != AV_PIX_FMT_QSV && in1->format == AV_PIX_FMT_QSV)) { av_log(ctx, AV_LOG_ERROR, "Mixing hardware and software pixel formats is not supported.\n"); @@ -288,6 +288,7 @@ av_log(ctx, AV_LOG_ERROR, "Inputs with different underlying QSV devices are forbidden.\n"); return AVERROR(EINVAL); } + vpp->qsv_param.out_sw_format = hw_frame0->sw_format; } outlink->w = vpp->var_values[VAR_MW]; @@ -299,7 +300,7 @@ if (ret < 0) return ret; - return ff_qsvvpp_create(ctx, &vpp->qsv, &vpp->qsv_param); + return ff_qsvvpp_init(ctx, &vpp->qsv_param); } /* @@ -348,7 +349,7 @@ { QSVOverlayContext *vpp = ctx->priv; - ff_qsvvpp_free(&vpp->qsv); + ff_qsvvpp_close(ctx); ff_framesync_uninit(&vpp->fs); av_freep(&vpp->comp_conf.InputStream); av_freep(&vpp->qsv_param.ext_buf); @@ -397,11 +398,13 @@ .name = "main", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_main_input, + .get_buffer.video = ff_qsvvpp_get_video_buffer, }, { .name = "overlay", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_overlay_input, + .get_buffer.video = ff_qsvvpp_get_video_buffer, }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_vaapi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_vaapi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_vaapi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_overlay_vaapi.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,43 +27,104 @@ #include "formats.h" #include "internal.h" #include "vaapi_vpp.h" +#include "libavutil/eval.h" + +enum var_name { + VAR_MAIN_IW, VAR_MW, + VAR_MAIN_IH, VAR_MH, + VAR_OVERLAY_IW, + VAR_OVERLAY_IH, + VAR_OVERLAY_X, VAR_OX, + VAR_OVERLAY_Y, VAR_OY, + VAR_OVERLAY_W, VAR_OW, + VAR_OVERLAY_H, VAR_OH, + VAR_VARS_NB +}; typedef struct OverlayVAAPIContext { VAAPIVPPContext vpp_ctx; /**< must be the first field */ FFFrameSync fs; - int overlay_ox; - int overlay_oy; - int overlay_ow; - int overlay_oh; + + double var_values[VAR_VARS_NB]; + char *overlay_ox; + char *overlay_oy; + char *overlay_ow; + char *overlay_oh; + int ox; + int oy; + int ow; + int oh; float alpha; + unsigned int blend_flags; + float blend_alpha; } OverlayVAAPIContext; -static int overlay_vaapi_query_formats(AVFilterContext *ctx) -{ - int ret; - enum { - MAIN = 0, - OVERLAY = 1, - }; - - static const enum AVPixelFormat pix_fmts[] = { - AV_PIX_FMT_VAAPI, - AV_PIX_FMT_NONE - }; - - ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]->outcfg.formats); - if (ret < 0) - return ret; - - ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[OVERLAY]->outcfg.formats); - if (ret < 0) - return ret; +static const char *const var_names[] = { + "main_w", "W", /* input width of the main layer */ + "main_h", "H", /* input height of the main layer */ + "overlay_iw", /* input width of the overlay layer */ + "overlay_ih", /* input height of the overlay layer */ + "overlay_x", "x", /* x position of the overlay layer inside of main */ + "overlay_y", "y", /* y position of the overlay layer inside of main */ + "overlay_w", "w", /* output width of overlay layer */ + "overlay_h", "h", /* output height of overlay layer */ + NULL +}; - ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->incfg.formats); - if (ret < 0) - return ret; +static int eval_expr(AVFilterContext *avctx) +{ + OverlayVAAPIContext *ctx = avctx->priv; + double *var_values = ctx->var_values; + int ret = 0; + AVExpr *ox_expr = NULL, *oy_expr = NULL; + AVExpr *ow_expr = NULL, *oh_expr = NULL; + +#define PARSE_EXPR(e, s) {\ + ret = av_expr_parse(&(e), s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \ + if (ret < 0) {\ + av_log(ctx, AV_LOG_ERROR, "Error when parsing '%s'.\n", s);\ + goto release;\ + }\ +} + PARSE_EXPR(ox_expr, ctx->overlay_ox) + PARSE_EXPR(oy_expr, ctx->overlay_oy) + PARSE_EXPR(ow_expr, ctx->overlay_ow) + PARSE_EXPR(oh_expr, ctx->overlay_oh) +#undef PASS_EXPR + + var_values[VAR_OVERLAY_W] = + var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL); + var_values[VAR_OVERLAY_H] = + var_values[VAR_OH] = av_expr_eval(oh_expr, var_values, NULL); + + /* calc again in case ow is relative to oh */ + var_values[VAR_OVERLAY_W] = + var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL); + + var_values[VAR_OVERLAY_X] = + var_values[VAR_OX] = av_expr_eval(ox_expr, var_values, NULL); + var_values[VAR_OVERLAY_Y] = + var_values[VAR_OY] = av_expr_eval(oy_expr, var_values, NULL); + + /* calc again in case ox is relative to oy */ + var_values[VAR_OVERLAY_X] = + var_values[VAR_OX] = av_expr_eval(ox_expr, var_values, NULL); + + /* calc overlay_w and overlay_h again incase relative to ox,oy */ + var_values[VAR_OVERLAY_W] = + var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL); + var_values[VAR_OVERLAY_H] = + var_values[VAR_OH] = av_expr_eval(oh_expr, var_values, NULL); + var_values[VAR_OVERLAY_W] = + var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL); + +release: + av_expr_free(ox_expr); + av_expr_free(oy_expr); + av_expr_free(ow_expr); + av_expr_free(oh_expr); - return 0; + return ret; } static int overlay_vaapi_build_filter_params(AVFilterContext *avctx) @@ -98,104 +159,6 @@ return 0; } -static int overlay_vaapi_render_picture(AVFilterContext *avctx, - VAProcPipelineParameterBuffer *params, - VAProcPipelineParameterBuffer *subpic_params, - AVFrame *output_frame) -{ - VAAPIVPPContext *ctx = avctx->priv; - VASurfaceID output_surface; - VABufferID params_id; - VABufferID subpic_params_id; - VAStatus vas; - int err = 0; - - output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; - - vas = vaBeginPicture(ctx->hwctx->display, - ctx->va_context, output_surface); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - - vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, - VAProcPipelineParameterBufferType, - sizeof(*params), 1, params, ¶ms_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", - params_id); - - - vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, - VAProcPipelineParameterBufferType, - sizeof(*subpic_params), 1, subpic_params, &subpic_params_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n", - subpic_params_id); - - vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, - ¶ms_id, 1); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - - vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, - &subpic_params_id, 1); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - - vas = vaEndPicture(ctx->hwctx->display, ctx->va_context); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to start picture processing: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_render; - } - - if (CONFIG_VAAPI_1 || ctx->hwctx->driver_quirks & - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { - vas = vaDestroyBuffer(ctx->hwctx->display, params_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to free parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - // And ignore. - } - } - - return 0; - - // We want to make sure that if vaBeginPicture has been called, we also - // call vaRenderPicture and vaEndPicture. These calls may well fail or - // do something else nasty, but once we're in this failure case there - // isn't much else we can do. -fail_after_begin: - vaRenderPicture(ctx->hwctx->display, ctx->va_context, ¶ms_id, 1); -fail_after_render: - vaEndPicture(ctx->hwctx->display, ctx->va_context); -fail: - return err; -} - static int overlay_vaapi_blend(FFFrameSync *fs) { AVFilterContext *avctx = fs->parent; @@ -204,15 +167,11 @@ VAAPIVPPContext *vpp_ctx = avctx->priv; AVFrame *input_main, *input_overlay; AVFrame *output; - VAProcPipelineParameterBuffer params, subpic_params; - VABlendState blend_state; /**< Blend State */ + VAProcPipelineParameterBuffer params[2]; + VABlendState blend_state = { 0 }; /**< Blend State */ VARectangle overlay_region, output_region; int err; - err = overlay_vaapi_build_filter_params(avctx); - if (err < 0) - return err; - err = ff_framesync_get_frame(fs, 0, &input_main, 0); if (err < 0) return err; @@ -224,10 +183,6 @@ av_get_pix_fmt_name(input_main->format), input_main->width, input_main->height, input_main->pts); - av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n", - av_get_pix_fmt_name(input_overlay->format), - input_overlay->width, input_overlay->height, input_overlay->pts); - if (vpp_ctx->va_context == VA_INVALID_ID) return AVERROR(EINVAL); @@ -241,18 +196,11 @@ if (err < 0) goto fail; - err = ff_vaapi_vpp_init_params(avctx, ¶ms, + err = ff_vaapi_vpp_init_params(avctx, ¶ms[0], input_main, output); if (err < 0) goto fail; - overlay_region = (VARectangle) { - .x = ctx->overlay_ox, - .y = ctx->overlay_oy, - .width = ctx->overlay_ow ? ctx->overlay_ow : input_overlay->width, - .height = ctx->overlay_oh ? ctx->overlay_oh : input_overlay->height, - }; - output_region = (VARectangle) { .x = 0, .y = 0, @@ -260,29 +208,39 @@ .height = output->height, }; - if (overlay_region.x + overlay_region.width > input_main->width || - overlay_region.y + overlay_region.height > input_main->height) { - av_log(ctx, AV_LOG_WARNING, - "The overlay image exceeds the scope of the main image, " - "will crop the overlay image according based on the main image.\n"); - } - - params.filters = &vpp_ctx->filter_buffers[0]; - params.num_filters = vpp_ctx->nb_filter_buffers; + params[0].output_region = &output_region; + params[0].output_background_color = VAAPI_VPP_BACKGROUND_BLACK; - params.output_region = &output_region; - params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK; + if (input_overlay) { + av_log(avctx, AV_LOG_DEBUG, "Filter overlay: %s, %ux%u (%"PRId64").\n", + av_get_pix_fmt_name(input_overlay->format), + input_overlay->width, input_overlay->height, input_overlay->pts); + + overlay_region = (VARectangle) { + .x = ctx->ox, + .y = ctx->oy, + .width = ctx->ow ? ctx->ow : input_overlay->width, + .height = ctx->oh ? ctx->oh : input_overlay->height, + }; + + if (overlay_region.x + overlay_region.width > input_main->width || + overlay_region.y + overlay_region.height > input_main->height) { + av_log(ctx, AV_LOG_WARNING, + "The overlay image exceeds the scope of the main image, " + "will crop the overlay image according based on the main image.\n"); + } - memcpy(&subpic_params, ¶ms, sizeof(subpic_params)); + memcpy(¶ms[1], ¶ms[0], sizeof(params[0])); - blend_state.flags = VA_BLEND_GLOBAL_ALPHA; - blend_state.global_alpha = ctx->alpha; - subpic_params.blend_state = &blend_state; + blend_state.flags = ctx->blend_flags; + blend_state.global_alpha = ctx->blend_alpha; + params[1].blend_state = &blend_state; - subpic_params.surface = (VASurfaceID)(uintptr_t)input_overlay->data[3]; - subpic_params.output_region = &overlay_region; + params[1].surface = (VASurfaceID)(uintptr_t)input_overlay->data[3]; + params[1].output_region = &overlay_region; + } - err = overlay_vaapi_render_picture(avctx, ¶ms, &subpic_params, output); + err = ff_vaapi_vpp_render_pictures(avctx, params, input_overlay ? 2 : 1, output); if (err < 0) goto fail; @@ -297,26 +255,67 @@ return err; } -static int overlay_vaapi_init_framesync(AVFilterContext *avctx) +static int have_alpha_planar(AVFilterLink *link) +{ + enum AVPixelFormat pix_fmt = link->format; + const AVPixFmtDescriptor *desc; + AVHWFramesContext *fctx; + + if (link->format == AV_PIX_FMT_VAAPI) { + fctx = (AVHWFramesContext *)link->hw_frames_ctx->data; + pix_fmt = fctx->sw_format; + } + + desc = av_pix_fmt_desc_get(pix_fmt); + if (!desc) + return 0; + + return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); +} + +static int overlay_vaapi_config_input_main(AVFilterLink *inlink) { + AVFilterContext *avctx = inlink->dst; OverlayVAAPIContext *ctx = avctx->priv; - int ret, i; - ctx->fs.on_event = overlay_vaapi_blend; - ctx->fs.opaque = ctx; - ret = ff_framesync_init(&ctx->fs, avctx, avctx->nb_inputs); + ctx->var_values[VAR_MAIN_IW] = + ctx->var_values[VAR_MW] = inlink->w; + ctx->var_values[VAR_MAIN_IH] = + ctx->var_values[VAR_MH] = inlink->h; + + return ff_vaapi_vpp_config_input(inlink); +} + +static int overlay_vaapi_config_input_overlay(AVFilterLink *inlink) +{ + AVFilterContext *avctx = inlink->dst; + OverlayVAAPIContext *ctx = avctx->priv; + int ret; + + ctx->var_values[VAR_OVERLAY_IW] = inlink->w; + ctx->var_values[VAR_OVERLAY_IH] = inlink->h; + + ret = eval_expr(avctx); if (ret < 0) return ret; - for (i = 0; i < avctx->nb_inputs; i++) { - FFFrameSyncIn *in = &ctx->fs.in[i]; - in->before = EXT_STOP; - in->after = EXT_INFINITY; - in->sync = i ? 1 : 2; - in->time_base = avctx->inputs[i]->time_base; + ctx->ox = (int)ctx->var_values[VAR_OX]; + ctx->oy = (int)ctx->var_values[VAR_OY]; + ctx->ow = (int)ctx->var_values[VAR_OW]; + ctx->oh = (int)ctx->var_values[VAR_OH]; + + ctx->blend_flags = 0; + ctx->blend_alpha = 1.0f; + + if (ctx->alpha < 1.0f) { + ctx->blend_flags |= VA_BLEND_GLOBAL_ALPHA; + ctx->blend_alpha = ctx->alpha; } - return ff_framesync_configure(&ctx->fs); + if (have_alpha_planar(inlink)) + ctx->blend_flags |= VA_BLEND_PREMULTIPLIED_ALPHA; + + return 0; } static int overlay_vaapi_config_output(AVFilterLink *outlink) @@ -326,10 +325,7 @@ VAAPIVPPContext *vpp_ctx = avctx->priv; int err; - err = overlay_vaapi_init_framesync(avctx); - if (err < 0) - return err; - + outlink->time_base = avctx->inputs[0]->time_base; vpp_ctx->output_width = avctx->inputs[0]->w; vpp_ctx->output_height = avctx->inputs[0]->h; @@ -337,10 +333,17 @@ if (err < 0) return err; + err = overlay_vaapi_build_filter_params(avctx); + if (err < 0) + return err; + err = ff_framesync_init_dualinput(&ctx->fs, avctx); if (err < 0) return err; + ctx->fs.on_event = overlay_vaapi_blend; + ctx->fs.time_base = outlink->time_base; + return ff_framesync_configure(&ctx->fs); } @@ -366,37 +369,40 @@ OverlayVAAPIContext *ctx = avctx->priv; ff_framesync_uninit(&ctx->fs); + ff_vaapi_vpp_ctx_uninit(avctx); } #define OFFSET(x) offsetof(OverlayVAAPIContext, x) #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM) static const AVOption overlay_vaapi_options[] = { - { "x", "Overlay x position", - OFFSET(overlay_ox), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, - { "y", "Overlay y position", - OFFSET(overlay_oy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, - { "w", "Overlay width", - OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, - { "h", "Overlay height", - OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, - { "alpha", "Overlay global alpha", - OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 0.0}, 0.0, 1.0, .flags = FLAGS}, + { "x", "Overlay x position", OFFSET(overlay_ox), AV_OPT_TYPE_STRING, { .str="0"}, 0, 255, .flags = FLAGS}, + { "y", "Overlay y position", OFFSET(overlay_oy), AV_OPT_TYPE_STRING, { .str="0"}, 0, 255, .flags = FLAGS}, + { "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_STRING, { .str="overlay_iw"}, 0, 255, .flags = FLAGS}, + { "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_STRING, { .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS}, + { "alpha", "Overlay global alpha", OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0, .flags = FLAGS }, + { "eof_action", "Action to take when encountering EOF from secondary input ", + OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT }, + EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" }, + { "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" }, + { "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" }, + { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" }, + { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS }, { NULL }, }; -AVFILTER_DEFINE_CLASS(overlay_vaapi); +FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs); static const AVFilterPad overlay_vaapi_inputs[] = { { .name = "main", .type = AVMEDIA_TYPE_VIDEO, - .get_buffer.video = ff_default_get_video_buffer, - .config_props = &ff_vaapi_vpp_config_input, + .config_props = overlay_vaapi_config_input_main, }, { .name = "overlay", .type = AVMEDIA_TYPE_VIDEO, - .get_buffer.video = ff_default_get_video_buffer, + .config_props = overlay_vaapi_config_input_overlay, }, }; @@ -416,8 +422,9 @@ .init = &overlay_vaapi_init, .uninit = &overlay_vaapi_uninit, .activate = &overlay_vaapi_activate, + .preinit = overlay_vaapi_framesync_preinit, FILTER_INPUTS(overlay_vaapi_inputs), FILTER_OUTPUTS(overlay_vaapi_outputs), - FILTER_QUERY_FUNC(overlay_vaapi_query_formats), + FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI), .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_palettegen.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_palettegen.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_palettegen.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_palettegen.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Stupeflix + * Copyright (c) 2022 Clément Bœsch * * This file is part of FFmpeg. * @@ -26,21 +27,25 @@ #include "libavutil/avassert.h" #include "libavutil/internal.h" #include "libavutil/opt.h" -#include "libavutil/qsort.h" #include "libavutil/intreadwrite.h" #include "avfilter.h" #include "internal.h" +#include "palette.h" /* Reference a color and how much it's used */ struct color_ref { uint32_t color; - uint64_t count; + struct Lab lab; + int64_t count; }; /* Store a range of colors */ struct range_box { uint32_t color; // average color - int64_t variance; // overall variance of the box (how much the colors are spread) + struct Lab avg; // average color in perceptual OkLab space + int major_axis; // best axis candidate for cutting the box + int64_t weight; // sum of all the weights of the colors + int64_t cut_score; // how likely the box is to be cut down (higher implying more likely) int start; // index in PaletteGenContext->refs int len; // number of referenced colors int sorted_by; // whether range of colors is sorted by red (0), green (1) or blue (2) @@ -58,8 +63,7 @@ NB_STATS_MODE }; -#define NBITS 5 -#define HIST_SIZE (1<<(4*NBITS)) +#define HIST_SIZE (1<<15) typedef struct PaletteGenContext { const AVClass *class; @@ -67,7 +71,6 @@ int max_colors; int reserve_transparent; int stats_mode; - int use_alpha; AVFrame *prev_frame; // previous frame used for the diff stats_mode struct hist_node histogram[HIST_SIZE]; // histogram/hashtable of the colors @@ -82,14 +85,13 @@ #define OFFSET(x) offsetof(PaletteGenContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption palettegen_options[] = { - { "max_colors", "set the maximum number of colors to use in the palette", OFFSET(max_colors), AV_OPT_TYPE_INT, {.i64=256}, 4, 256, FLAGS }, + { "max_colors", "set the maximum number of colors to use in the palette", OFFSET(max_colors), AV_OPT_TYPE_INT, {.i64=256}, 2, 256, FLAGS }, { "reserve_transparent", "reserve a palette entry for transparency", OFFSET(reserve_transparent), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, { "transparency_color", "set a background color for transparency", OFFSET(transparency_color), AV_OPT_TYPE_COLOR, {.str="lime"}, 0, 0, FLAGS }, { "stats_mode", "set statistics mode", OFFSET(stats_mode), AV_OPT_TYPE_INT, {.i64=STATS_MODE_ALL_FRAMES}, 0, NB_STATS_MODE-1, FLAGS, "mode" }, { "full", "compute full frame histograms", 0, AV_OPT_TYPE_CONST, {.i64=STATS_MODE_ALL_FRAMES}, INT_MIN, INT_MAX, FLAGS, "mode" }, { "diff", "compute histograms only for the part that differs from previous frame", 0, AV_OPT_TYPE_CONST, {.i64=STATS_MODE_DIFF_FRAMES}, INT_MIN, INT_MAX, FLAGS, "mode" }, { "single", "compute new histogram for each frame", 0, AV_OPT_TYPE_CONST, {.i64=STATS_MODE_SINGLE_FRAMES}, INT_MIN, INT_MAX, FLAGS, "mode" }, - { "use_alpha", "create a palette including alpha values", OFFSET(use_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS }, { NULL } }; @@ -110,21 +112,51 @@ typedef int (*cmp_func)(const void *, const void *); -#define DECLARE_CMP_FUNC(name, pos) \ -static int cmp_##name(const void *pa, const void *pb) \ -{ \ - const struct color_ref * const *a = pa; \ - const struct color_ref * const *b = pb; \ - return (int)((*a)->color >> (8 * (3 - (pos))) & 0xff) \ - - (int)((*b)->color >> (8 * (3 - (pos))) & 0xff); \ -} - -DECLARE_CMP_FUNC(a, 0) -DECLARE_CMP_FUNC(r, 1) -DECLARE_CMP_FUNC(g, 2) -DECLARE_CMP_FUNC(b, 3) +#define DECLARE_CMP_FUNC(k0, k1, k2) \ +static int cmp_##k0##k1##k2(const void *pa, const void *pb) \ +{ \ + const struct color_ref * const *a = pa; \ + const struct color_ref * const *b = pb; \ + const int c0 = FFDIFFSIGN((*a)->lab.k0, (*b)->lab.k0); \ + const int c1 = FFDIFFSIGN((*a)->lab.k1, (*b)->lab.k1); \ + const int c2 = FFDIFFSIGN((*a)->lab.k2, (*b)->lab.k2); \ + return c0 ? c0 : c1 ? c1 : c2; \ +} + +DECLARE_CMP_FUNC(L, a, b) +DECLARE_CMP_FUNC(L, b, a) +DECLARE_CMP_FUNC(a, L, b) +DECLARE_CMP_FUNC(a, b, L) +DECLARE_CMP_FUNC(b, L, a) +DECLARE_CMP_FUNC(b, a, L) + +enum { ID_XYZ, ID_XZY, ID_ZXY, ID_YXZ, ID_ZYX, ID_YZX }; +static const char * const sortstr[] = { "Lab", "Lba", "bLa", "aLb", "baL", "abL" }; + +static const cmp_func cmp_funcs[] = { + [ID_XYZ] = cmp_Lab, + [ID_XZY] = cmp_Lba, + [ID_ZXY] = cmp_bLa, + [ID_YXZ] = cmp_aLb, + [ID_ZYX] = cmp_baL, + [ID_YZX] = cmp_abL, +}; -static const cmp_func cmp_funcs[] = {cmp_a, cmp_r, cmp_g, cmp_b}; +/* + * Return an identifier for the order of x, y, z (from higher to lower), + * preferring x over y and y over z in case of equality. + */ +static int sort3id(int64_t x, int64_t y, int64_t z) +{ + if (x >= y) { + if (y >= z) return ID_XYZ; + if (x >= z) return ID_XZY; + return ID_ZXY; + } + if (x >= z) return ID_YXZ; + if (y >= z) return ID_YZX; + return ID_ZYX; +} /** * Simple color comparison for sorting the final palette @@ -133,103 +165,67 @@ { const struct range_box *box1 = a; const struct range_box *box2 = b; - return FFDIFFSIGN(box1->color , box2->color); + return FFDIFFSIGN(box1->color, box2->color); } -static av_always_inline int diff(const uint32_t a, const uint32_t b) +static void compute_box_stats(PaletteGenContext *s, struct range_box *box) { - const uint8_t c1[] = {a >> 16 & 0xff, a >> 8 & 0xff, a & 0xff}; - const uint8_t c2[] = {b >> 16 & 0xff, b >> 8 & 0xff, b & 0xff}; - const int dr = c1[0] - c2[0]; - const int dg = c1[1] - c2[1]; - const int db = c1[2] - c2[2]; - return dr*dr + dg*dg + db*db; -} + int64_t er2[3] = {0}; -static av_always_inline int diff_alpha(const uint32_t a, const uint32_t b) -{ - const uint8_t c1[] = {a >> 24 & 0xff, a >> 16 & 0xff, a >> 8 & 0xff, a & 0xff}; - const uint8_t c2[] = {b >> 24 & 0xff, b >> 16 & 0xff, b >> 8 & 0xff, b & 0xff}; - const int da = c1[0] - c2[0]; - const int dr = c1[1] - c2[1]; - const int dg = c1[2] - c2[2]; - const int db = c1[3] - c2[3]; - return da*da + dr*dr + dg*dg + db*db; + /* Compute average color */ + int64_t sL = 0, sa = 0, sb = 0; + box->weight = 0; + for (int i = box->start; i < box->start + box->len; i++) { + const struct color_ref *ref = s->refs[i]; + sL += ref->lab.L * ref->count; + sa += ref->lab.a * ref->count; + sb += ref->lab.b * ref->count; + box->weight += ref->count; + } + box->avg.L = sL / box->weight; + box->avg.a = sa / box->weight; + box->avg.b = sb / box->weight; + + /* Compute squared error of each color channel */ + for (int i = box->start; i < box->start + box->len; i++) { + const struct color_ref *ref = s->refs[i]; + const int64_t dL = ref->lab.L - box->avg.L; + const int64_t da = ref->lab.a - box->avg.a; + const int64_t db = ref->lab.b - box->avg.b; + er2[0] += dL * dL * ref->count; + er2[1] += da * da * ref->count; + er2[2] += db * db * ref->count; + } + + /* Define the best axis candidate for cutting the box */ + box->major_axis = sort3id(er2[0], er2[1], er2[2]); + + /* The box that has the axis with the biggest error amongst all boxes will but cut down */ + box->cut_score = FFMAX3(er2[0], er2[1], er2[2]); } /** - * Find the next box to split: pick the one with the highest variance + * Find the next box to split: pick the one with the highest cut score */ static int get_next_box_id_to_split(PaletteGenContext *s) { - int box_id, i, best_box_id = -1; - int64_t max_variance = -1; + int best_box_id = -1; + int64_t max_score = -1; if (s->nb_boxes == s->max_colors - s->reserve_transparent) return -1; - for (box_id = 0; box_id < s->nb_boxes; box_id++) { - struct range_box *box = &s->boxes[box_id]; - - if (s->boxes[box_id].len >= 2) { - - if (box->variance == -1) { - int64_t variance = 0; - - for (i = 0; i < box->len; i++) { - const struct color_ref *ref = s->refs[box->start + i]; - if (s->use_alpha) - variance += (int64_t)diff_alpha(ref->color, box->color) * ref->count; - else - variance += (int64_t)diff(ref->color, box->color) * ref->count; - } - box->variance = variance; - } - if (box->variance > max_variance) { - best_box_id = box_id; - max_variance = box->variance; - } - } else { - box->variance = -1; + for (int box_id = 0; box_id < s->nb_boxes; box_id++) { + const struct range_box *box = &s->boxes[box_id]; + if (s->boxes[box_id].len >= 2 && box->cut_score > max_score) { + best_box_id = box_id; + max_score = box->cut_score; } } return best_box_id; } /** - * Get the 32-bit average color for the range of RGB colors enclosed in the - * specified box. Takes into account the weight of each color. - */ -static uint32_t get_avg_color(struct color_ref * const *refs, - const struct range_box *box, int use_alpha) -{ - int i; - const int n = box->len; - uint64_t a = 0, r = 0, g = 0, b = 0, div = 0; - - for (i = 0; i < n; i++) { - const struct color_ref *ref = refs[box->start + i]; - if (use_alpha) - a += (ref->color >> 24 & 0xff) * ref->count; - r += (ref->color >> 16 & 0xff) * ref->count; - g += (ref->color >> 8 & 0xff) * ref->count; - b += (ref->color & 0xff) * ref->count; - div += ref->count; - } - - if (use_alpha) - a = a / div; - r = r / div; - g = g / div; - b = b / div; - - if (use_alpha) - return a<<24 | r<<16 | g<<8 | b; - - return 0xffU<<24 | r<<16 | g<<8 | b; -} - -/** * Split given box in two at position n. The original box becomes the left part * of the split, and the new index box is the right part. */ @@ -244,10 +240,8 @@ av_assert0(box->len >= 1); av_assert0(new_box->len >= 1); - box->color = get_avg_color(s->refs, box, s->use_alpha); - new_box->color = get_avg_color(s->refs, new_box, s->use_alpha); - box->variance = -1; - new_box->variance = -1; + compute_box_stats(s, box); + compute_box_stats(s, new_box); } /** @@ -256,13 +250,13 @@ static void write_palette(AVFilterContext *ctx, AVFrame *out) { const PaletteGenContext *s = ctx->priv; - int x, y, box_id = 0; + int box_id = 0; uint32_t *pal = (uint32_t *)out->data[0]; const int pal_linesize = out->linesize[0] >> 2; uint32_t last_color = 0; - for (y = 0; y < out->height; y++) { - for (x = 0; x < out->width; x++) { + for (int y = 0; y < out->height; y++) { + for (int x = 0; x < out->width; x++) { if (box_id < s->nb_boxes) { pal[x] = s->boxes[box_id++].color; if ((x || y) && pal[x] == last_color) @@ -275,7 +269,7 @@ pal += pal_linesize; } - if (s->reserve_transparent && !s->use_alpha) { + if (s->reserve_transparent) { av_assert0(s->nb_boxes < 256); pal[out->width - pal_linesize - 1] = AV_RB32(&s->transparency_color) >> 8; } @@ -288,16 +282,16 @@ */ static struct color_ref **load_color_refs(const struct hist_node *hist, int nb_refs) { - int i, j, k = 0; + int k = 0; struct color_ref **refs = av_malloc_array(nb_refs, sizeof(*refs)); if (!refs) return NULL; - for (j = 0; j < HIST_SIZE; j++) { + for (int j = 0; j < HIST_SIZE; j++) { const struct hist_node *node = &hist[j]; - for (i = 0; i < node->nb_entries; i++) + for (int i = 0; i < node->nb_entries; i++) refs[k++] = &node->entries[i]; } @@ -343,68 +337,35 @@ box = &s->boxes[box_id]; box->len = s->nb_refs; box->sorted_by = -1; - box->color = get_avg_color(s->refs, box, s->use_alpha); - box->variance = -1; + compute_box_stats(s, box); s->nb_boxes = 1; while (box && box->len > 1) { - int i, ar, rr, gr, br, longest; - uint64_t median, box_weight = 0; - - /* compute the box weight (sum all the weights of the colors in the - * range) and its boundings */ - uint8_t min[4] = {0xff, 0xff, 0xff, 0xff}; - uint8_t max[4] = {0x00, 0x00, 0x00, 0x00}; - for (i = box->start; i < box->start + box->len; i++) { - const struct color_ref *ref = s->refs[i]; - const uint32_t rgb = ref->color; - const uint8_t a = rgb >> 24 & 0xff, r = rgb >> 16 & 0xff, g = rgb >> 8 & 0xff, b = rgb & 0xff; - min[0] = FFMIN(a, min[0]); max[0] = FFMAX(a, max[0]); - min[1] = FFMIN(r, min[1]); max[1] = FFMAX(r, max[1]); - min[2] = FFMIN(g, min[2]); max[2] = FFMAX(g, max[2]); - min[3] = FFMIN(b, min[3]); max[3] = FFMAX(b, max[3]); - box_weight += ref->count; - } - - /* define the axis to sort by according to the widest range of colors */ - ar = max[0] - min[0]; - rr = max[1] - min[1]; - gr = max[2] - min[2]; - br = max[3] - min[3]; - longest = 2; // pick green by default (the color the eye is the most sensitive to) - if (s->use_alpha) { - if (ar >= rr && ar >= br && ar >= gr) longest = 0; - if (br >= rr && br >= gr && br >= ar) longest = 3; - if (rr >= gr && rr >= br && rr >= ar) longest = 1; - if (gr >= rr && gr >= br && gr >= ar) longest = 2; // prefer green again - } else { - if (br >= rr && br >= gr) longest = 3; - if (rr >= gr && rr >= br) longest = 1; - if (gr >= rr && gr >= br) longest = 2; // prefer green again - } + int i; + int64_t median, weight; - ff_dlog(ctx, "box #%02X [%6d..%-6d] (%6d) w:%-6"PRIu64" ranges:[%2x %2x %2x %2x] sort by %c (already sorted:%c) ", - box_id, box->start, box->start + box->len - 1, box->len, box_weight, - ar, rr, gr, br, "argb"[longest], box->sorted_by == longest ? 'y' : 'n'); - - /* sort the range by its longest axis if it's not already sorted */ - if (box->sorted_by != longest) { - cmp_func cmpf = cmp_funcs[longest]; - AV_QSORT(&s->refs[box->start], box->len, const struct color_ref *, cmpf); - box->sorted_by = longest; + ff_dlog(ctx, "box #%02X [%6d..%-6d] (%6d) w:%-6"PRIu64" sort by %s (already sorted:%c) ", + box_id, box->start, box->start + box->len - 1, box->len, box->weight, + sortstr[box->major_axis], box->sorted_by == box->major_axis ? 'y':'n'); + + /* sort the range by its major axis if it's not already sorted */ + if (box->sorted_by != box->major_axis) { + cmp_func cmpf = cmp_funcs[box->major_axis]; + qsort(&s->refs[box->start], box->len, sizeof(struct color_ref *), cmpf); + box->sorted_by = box->major_axis; } /* locate the median where to split */ - median = (box_weight + 1) >> 1; - box_weight = 0; + median = (box->weight + 1) >> 1; + weight = 0; /* if you have 2 boxes, the maximum is actually #0: you must have at * least 1 color on each side of the split, hence the -2 */ for (i = box->start; i < box->start + box->len - 2; i++) { - box_weight += s->refs[i]->count; - if (box_weight > median) + weight += s->refs[i]->count; + if (weight > median) break; } - ff_dlog(ctx, "split @ i=%-6d with w=%-6"PRIu64" (target=%6"PRIu64")\n", i, box_weight, median); + ff_dlog(ctx, "split @ i=%-6d with w=%-6"PRIu64" (target=%6"PRIu64")\n", i, weight, median); split_box(s, box, i); box_id = get_next_box_id_to_split(s); @@ -415,6 +376,9 @@ av_log(ctx, AV_LOG_INFO, "%d%s colors generated out of %d colors; ratio=%f\n", s->nb_boxes, s->reserve_transparent ? "(+1)" : "", s->nb_refs, ratio); + for (int i = 0; i < s->nb_boxes; i++) + s->boxes[i].color = 0xffU<<24 | ff_oklab_int_to_srgb_u8(s->boxes[i].avg); + qsort(s->boxes, s->nb_boxes, sizeof(*s->boxes), cmp_color); write_palette(ctx, out); @@ -423,35 +387,15 @@ } /** - * Hashing function for the color. - * It keeps the NBITS least significant bit of each component to make it - * "random" even if the scene doesn't have much different colors. - */ -static inline unsigned color_hash(uint32_t color, int use_alpha) -{ - const uint8_t r = color >> 16 & ((1<> 8 & ((1<> 24 & ((1 << NBITS) - 1); - return a << (NBITS * 3) | r << (NBITS * 2) | g << NBITS | b; - } - - return r << (NBITS * 2) | g << NBITS | b; -} - -/** * Locate the color in the hash table and increment its counter. */ -static int color_inc(struct hist_node *hist, uint32_t color, int use_alpha) +static int color_inc(struct hist_node *hist, uint32_t color) { - int i; - const unsigned hash = color_hash(color, use_alpha); + const uint32_t hash = ff_lowbias32(color) & (HIST_SIZE - 1); struct hist_node *node = &hist[hash]; struct color_ref *e; - for (i = 0; i < node->nb_entries; i++) { + for (int i = 0; i < node->nb_entries; i++) { e = &node->entries[i]; if (e->color == color) { e->count++; @@ -464,6 +408,7 @@ if (!e) return AVERROR(ENOMEM); e->color = color; + e->lab = ff_srgb_u8_to_oklab_int(color); e->count = 1; return 1; } @@ -472,7 +417,7 @@ * Update histogram when pixels differ from previous frame. */ static int update_histogram_diff(struct hist_node *hist, - const AVFrame *f1, const AVFrame *f2, int use_alpha) + const AVFrame *f1, const AVFrame *f2) { int x, y, ret, nb_diff_colors = 0; @@ -483,7 +428,7 @@ for (x = 0; x < f1->width; x++) { if (p[x] == q[x]) continue; - ret = color_inc(hist, p[x], use_alpha); + ret = color_inc(hist, p[x]); if (ret < 0) return ret; nb_diff_colors += ret; @@ -495,7 +440,7 @@ /** * Simple histogram of the frame. */ -static int update_histogram_frame(struct hist_node *hist, const AVFrame *f, int use_alpha) +static int update_histogram_frame(struct hist_node *hist, const AVFrame *f) { int x, y, ret, nb_diff_colors = 0; @@ -503,7 +448,7 @@ const uint32_t *p = (const uint32_t *)(f->data[0] + y*f->linesize[0]); for (x = 0; x < f->width; x++) { - ret = color_inc(hist, p[x], use_alpha); + ret = color_inc(hist, p[x]); if (ret < 0) return ret; nb_diff_colors += ret; @@ -519,9 +464,13 @@ { AVFilterContext *ctx = inlink->dst; PaletteGenContext *s = ctx->priv; - int ret = s->prev_frame ? update_histogram_diff(s->histogram, s->prev_frame, in, s->use_alpha) - : update_histogram_frame(s->histogram, in, s->use_alpha); + int ret; + if (in->color_trc != AVCOL_TRC_UNSPECIFIED && in->color_trc != AVCOL_TRC_IEC61966_2_1) + av_log(ctx, AV_LOG_WARNING, "The input frame is not in sRGB, colors may be off\n"); + + ret = s->prev_frame ? update_histogram_diff(s->histogram, s->prev_frame, in) + : update_histogram_frame(s->histogram, in); if (ret > 0) s->nb_refs += ret; @@ -583,8 +532,10 @@ { PaletteGenContext* s = ctx->priv; - if (s->use_alpha && s->reserve_transparent) - s->reserve_transparent = 0; + if (s->max_colors - s->reserve_transparent < 2) { + av_log(ctx, AV_LOG_ERROR, "max_colors=2 is only allowed without reserving a transparent color slot\n"); + return AVERROR(EINVAL); + } return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_paletteuse.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_paletteuse.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_paletteuse.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_paletteuse.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Stupeflix + * Copyright (c) 2022 Clément Bœsch * * This file is part of FFmpeg. * @@ -24,12 +25,15 @@ */ #include "libavutil/bprint.h" +#include "libavutil/file_open.h" #include "libavutil/internal.h" #include "libavutil/opt.h" #include "libavutil/qsort.h" #include "avfilter.h" +#include "filters.h" #include "framesync.h" #include "internal.h" +#include "palette.h" enum dithering_mode { DITHERING_NONE, @@ -38,31 +42,31 @@ DITHERING_FLOYD_STEINBERG, DITHERING_SIERRA2, DITHERING_SIERRA2_4A, + DITHERING_SIERRA3, + DITHERING_BURKES, + DITHERING_ATKINSON, NB_DITHERING }; -enum color_search_method { - COLOR_SEARCH_NNS_ITERATIVE, - COLOR_SEARCH_NNS_RECURSIVE, - COLOR_SEARCH_BRUTEFORCE, - NB_COLOR_SEARCHES -}; - enum diff_mode { DIFF_MODE_NONE, DIFF_MODE_RECTANGLE, NB_DIFF_MODE }; +struct color_info { + uint32_t srgb; + int32_t lab[3]; +}; + struct color_node { - uint8_t val[4]; + struct color_info c; uint8_t palette_id; int split; int left_id, right_id; }; -#define NBITS 5 -#define CACHE_SIZE (1<<(4*NBITS)) +#define CACHE_SIZE (1<<15) struct cached_color { uint32_t color; @@ -87,7 +91,6 @@ uint32_t palette[AVPALETTE_COUNT]; int transparency_index; /* index in the palette of transparency. -1 if there is no transparency in the palette. */ int trans_thresh; - int use_alpha; int palette_loaded; int dither; int new; @@ -100,14 +103,12 @@ /* debug options */ char *dot_filename; - int color_search_method; int calc_mean_err; uint64_t total_mean_err; - int debug_accuracy; } PaletteUseContext; #define OFFSET(x) offsetof(PaletteUseContext, x) -#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption paletteuse_options[] = { { "dither", "select dithering mode", OFFSET(dither), AV_OPT_TYPE_INT, {.i64=DITHERING_SIERRA2_4A}, 0, NB_DITHERING-1, FLAGS, "dithering_mode" }, { "bayer", "ordered 8x8 bayer dithering (deterministic)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_BAYER}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, @@ -115,21 +116,17 @@ { "floyd_steinberg", "Floyd and Steingberg dithering (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_FLOYD_STEINBERG}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, { "sierra2", "Frankie Sierra dithering v2 (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA2}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, { "sierra2_4a", "Frankie Sierra dithering v2 \"Lite\" (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA2_4A}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, + { "sierra3", "Frankie Sierra dithering v3 (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA3}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, + { "burkes", "Burkes dithering (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_BURKES}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, + { "atkinson", "Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)",0, AV_OPT_TYPE_CONST, {.i64=DITHERING_ATKINSON}, INT_MIN, INT_MAX, FLAGS, "dithering_mode" }, { "bayer_scale", "set scale for bayer dithering", OFFSET(bayer_scale), AV_OPT_TYPE_INT, {.i64=2}, 0, 5, FLAGS }, { "diff_mode", "set frame difference mode", OFFSET(diff_mode), AV_OPT_TYPE_INT, {.i64=DIFF_MODE_NONE}, 0, NB_DIFF_MODE-1, FLAGS, "diff_mode" }, { "rectangle", "process smallest different rectangle", 0, AV_OPT_TYPE_CONST, {.i64=DIFF_MODE_RECTANGLE}, INT_MIN, INT_MAX, FLAGS, "diff_mode" }, { "new", "take new palette for each output frame", OFFSET(new), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { "alpha_threshold", "set the alpha threshold for transparency", OFFSET(trans_thresh), AV_OPT_TYPE_INT, {.i64=128}, 0, 255, FLAGS }, - { "use_alpha", "use alpha channel for mapping", OFFSET(use_alpha), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, /* following are the debug options, not part of the official API */ { "debug_kdtree", "save Graphviz graph of the kdtree in specified file", OFFSET(dot_filename), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, - { "color_search", "set reverse colormap color search method", OFFSET(color_search_method), AV_OPT_TYPE_INT, {.i64=COLOR_SEARCH_NNS_ITERATIVE}, 0, NB_COLOR_SEARCHES-1, FLAGS, "search" }, - { "nns_iterative", "iterative search", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_NNS_ITERATIVE}, INT_MIN, INT_MAX, FLAGS, "search" }, - { "nns_recursive", "recursive search", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_NNS_RECURSIVE}, INT_MIN, INT_MAX, FLAGS, "search" }, - { "bruteforce", "brute-force into the palette", 0, AV_OPT_TYPE_CONST, {.i64=COLOR_SEARCH_BRUTEFORCE}, INT_MIN, INT_MAX, FLAGS, "search" }, - { "mean_err", "compute and print mean error", OFFSET(calc_mean_err), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, - { "debug_accuracy", "test color search accuracy", OFFSET(debug_accuracy), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { NULL } }; @@ -156,73 +153,52 @@ static av_always_inline uint32_t dither_color(uint32_t px, int er, int eg, int eb, int scale, int shift) { - return px >> 24 << 24 + return (px & 0xff000000) | av_clip_uint8((px >> 16 & 0xff) + ((er * scale) / (1<> 8 & 0xff) + ((eg * scale) / (1<use_alpha) - return da*da + dr*dr + dg*dg + db*db; + const uint8_t alpha_a = a->srgb >> 24; + const uint8_t alpha_b = b->srgb >> 24; - if (c1[0] < s->trans_thresh && c2[0] < s->trans_thresh) { + if (alpha_a < trans_thresh && alpha_b < trans_thresh) { return 0; - } else if (c1[0] >= s->trans_thresh && c2[0] >= s->trans_thresh) { - return dr*dr + dg*dg + db*db; + } else if (alpha_a >= trans_thresh && alpha_b >= trans_thresh) { + const int64_t dL = a->lab[0] - b->lab[0]; + const int64_t da = a->lab[1] - b->lab[1]; + const int64_t db = a->lab[2] - b->lab[2]; + const int64_t ret = dL*dL + da*da + db*db; + return FFMIN(ret, INT32_MAX - 1); } else { - return 255*255 + 255*255 + 255*255; + return INT32_MAX - 1; } } -static av_always_inline uint8_t colormap_nearest_bruteforce(const PaletteUseContext *s, const uint8_t *argb) +static struct color_info get_color_from_srgb(uint32_t srgb) { - int i, pal_id = -1, min_dist = INT_MAX; - - for (i = 0; i < AVPALETTE_COUNT; i++) { - const uint32_t c = s->palette[i]; - - if (s->use_alpha || c >> 24 >= s->trans_thresh) { // ignore transparent entry - const uint8_t palargb[] = { - s->palette[i]>>24 & 0xff, - s->palette[i]>>16 & 0xff, - s->palette[i]>> 8 & 0xff, - s->palette[i] & 0xff, - }; - const int d = diff(palargb, argb, s); - if (d < min_dist) { - pal_id = i; - min_dist = d; - } - } - } - return pal_id; + const struct Lab lab = ff_srgb_u8_to_oklab_int(srgb); + struct color_info ret = {.srgb=srgb, .lab={lab.L, lab.a, lab.b}}; + return ret; } -/* Recursive form, simpler but a bit slower. Kept for reference. */ struct nearest_color { int node_pos; - int dist_sqd; + int64_t dist_sqd; }; -static void colormap_nearest_node(const PaletteUseContext *s, - const struct color_node *map, +static void colormap_nearest_node(const struct color_node *map, const int node_pos, - const uint8_t *target, + const struct color_info *target, + const int trans_thresh, struct nearest_color *nearest) { const struct color_node *kd = map + node_pos; - const int split = kd->split; - int dx, nearer_kd_id, further_kd_id; - const uint8_t *current = kd->val; - const int current_to_target = diff(target, current, s); + int nearer_kd_id, further_kd_id; + const struct color_info *current = &kd->c; + const int64_t current_to_target = diff(target, current, trans_thresh); if (current_to_target < nearest->dist_sqd) { nearest->node_pos = node_pos; @@ -230,23 +206,23 @@ } if (kd->left_id != -1 || kd->right_id != -1) { - dx = target[split] - current[split]; + const int64_t dx = target->lab[kd->split] - current->lab[kd->split]; if (dx <= 0) nearer_kd_id = kd->left_id, further_kd_id = kd->right_id; else nearer_kd_id = kd->right_id, further_kd_id = kd->left_id; if (nearer_kd_id != -1) - colormap_nearest_node(s, map, nearer_kd_id, target, nearest); + colormap_nearest_node(map, nearer_kd_id, target, trans_thresh, nearest); if (further_kd_id != -1 && dx*dx < nearest->dist_sqd) - colormap_nearest_node(s, map, further_kd_id, target, nearest); + colormap_nearest_node(map, further_kd_id, target, trans_thresh, nearest); } } -static av_always_inline uint8_t colormap_nearest_recursive(const PaletteUseContext *s, const struct color_node *node, const uint8_t *rgb) +static av_always_inline uint8_t colormap_nearest(const struct color_node *node, const struct color_info *target, const int trans_thresh) { struct nearest_color res = {.dist_sqd = INT_MAX, .node_pos = -1}; - colormap_nearest_node(s, node, 0, rgb, &res); + colormap_nearest_node(node, 0, target, trans_thresh, &res); return node[res.node_pos].palette_id; } @@ -255,108 +231,23 @@ int dx2; }; -static av_always_inline uint8_t colormap_nearest_iterative(const PaletteUseContext *s, const struct color_node *root, const uint8_t *target) -{ - int pos = 0, best_node_id = -1, best_dist = INT_MAX, cur_color_id = 0; - struct stack_node nodes[16]; - struct stack_node *node = &nodes[0]; - - for (;;) { - - const struct color_node *kd = &root[cur_color_id]; - const uint8_t *current = kd->val; - const int current_to_target = diff(target, current, s); - - /* Compare current color node to the target and update our best node if - * it's actually better. */ - if (current_to_target < best_dist) { - best_node_id = cur_color_id; - if (!current_to_target) - goto end; // exact match, we can return immediately - best_dist = current_to_target; - } - - /* Check if it's not a leaf */ - if (kd->left_id != -1 || kd->right_id != -1) { - const int split = kd->split; - const int dx = target[split] - current[split]; - int nearer_kd_id, further_kd_id; - - /* Define which side is the most interesting. */ - if (dx <= 0) nearer_kd_id = kd->left_id, further_kd_id = kd->right_id; - else nearer_kd_id = kd->right_id, further_kd_id = kd->left_id; - - if (nearer_kd_id != -1) { - if (further_kd_id != -1) { - /* Here, both paths are defined, so we push a state for - * when we are going back. */ - node->color_id = further_kd_id; - node->dx2 = dx*dx; - pos++; - node++; - } - /* We can now update current color with the most probable path - * (no need to create a state since there is nothing to save - * anymore). */ - cur_color_id = nearer_kd_id; - continue; - } else if (dx*dx < best_dist) { - /* The nearest path isn't available, so there is only one path - * possible and it's the least probable. We enter it only if the - * distance from the current point to the hyper rectangle is - * less than our best distance. */ - cur_color_id = further_kd_id; - continue; - } - } - - /* Unstack as much as we can, typically as long as the least probable - * branch aren't actually probable. */ - do { - if (--pos < 0) - goto end; - node--; - } while (node->dx2 >= best_dist); - - /* We got a node where the least probable branch might actually contain - * a relevant color. */ - cur_color_id = node->color_id; - } - -end: - return root[best_node_id].palette_id; -} - -#define COLORMAP_NEAREST(s, search, root, target) \ - search == COLOR_SEARCH_NNS_ITERATIVE ? colormap_nearest_iterative(s, root, target) : \ - search == COLOR_SEARCH_NNS_RECURSIVE ? colormap_nearest_recursive(s, root, target) : \ - colormap_nearest_bruteforce(s, target) - /** * Check if the requested color is in the cache already. If not, find it in the * color tree and cache it. - * Note: a, r, g, and b are the components of color, but are passed as well to avoid - * recomputing them (they are generally computed by the caller for other uses). */ -static av_always_inline int color_get(PaletteUseContext *s, uint32_t color, - uint8_t a, uint8_t r, uint8_t g, uint8_t b, - const enum color_search_method search_method) -{ - int i; - const uint8_t argb_elts[] = {a, r, g, b}; - const uint8_t rhash = r & ((1<cache[hash]; struct cached_color *e; // first, check for transparency - if (a < s->trans_thresh && s->transparency_index >= 0) { + if (color>>24 < s->trans_thresh && s->transparency_index >= 0) { return s->transparency_index; } - for (i = 0; i < node->nb_entries; i++) { + for (int i = 0; i < node->nb_entries; i++) { e = &node->entries[i]; if (e->color == color) return e->pal_entry; @@ -367,28 +258,26 @@ if (!e) return AVERROR(ENOMEM); e->color = color; - e->pal_entry = COLORMAP_NEAREST(s, search_method, s->map, argb_elts); + clrinfo = get_color_from_srgb(color); + e->pal_entry = colormap_nearest(s->map, &clrinfo, s->trans_thresh); return e->pal_entry; } static av_always_inline int get_dst_color_err(PaletteUseContext *s, - uint32_t c, int *ea, int *er, int *eg, int *eb, - const enum color_search_method search_method) + uint32_t c, int *er, int *eg, int *eb) { - const uint8_t a = c >> 24 & 0xff; - const uint8_t r = c >> 16 & 0xff; - const uint8_t g = c >> 8 & 0xff; - const uint8_t b = c & 0xff; uint32_t dstc; - const int dstx = color_get(s, c, a, r, g, b, search_method); + const int dstx = color_get(s, c); if (dstx < 0) return dstx; dstc = s->palette[dstx]; if (dstx == s->transparency_index) { - *ea =*er = *eg = *eb = 0; + *er = *eg = *eb = 0; } else { - *ea = (int)a - (int)(dstc >> 24 & 0xff); + const uint8_t r = c >> 16 & 0xff; + const uint8_t g = c >> 8 & 0xff; + const uint8_t b = c & 0xff; *er = (int)r - (int)(dstc >> 16 & 0xff); *eg = (int)g - (int)(dstc >> 8 & 0xff); *eb = (int)b - (int)(dstc & 0xff); @@ -398,10 +287,8 @@ static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFrame *in, int x_start, int y_start, int w, int h, - enum dithering_mode dither, - const enum color_search_method search_method) + enum dithering_mode dither) { - int x, y; const int src_linesize = in ->linesize[0] >> 2; const int dst_linesize = out->linesize[0]; uint32_t *src = ((uint32_t *)in ->data[0]) + y_start*src_linesize; @@ -410,13 +297,13 @@ w += x_start; h += y_start; - for (y = y_start; y < h; y++) { - for (x = x_start; x < w; x++) { - int ea, er, eg, eb; + for (int y = y_start; y < h; y++) { + for (int x = x_start; x < w; x++) { + int er, eg, eb; if (dither == DITHERING_BAYER) { const int d = s->ordered_dither[(y & 7)<<3 | (x & 7)]; - const uint8_t a8 = src[x] >> 24 & 0xff; + const uint8_t a8 = src[x] >> 24; const uint8_t r8 = src[x] >> 16 & 0xff; const uint8_t g8 = src[x] >> 8 & 0xff; const uint8_t b8 = src[x] & 0xff; @@ -424,7 +311,7 @@ const uint8_t g = av_clip_uint8(g8 + d); const uint8_t b = av_clip_uint8(b8 + d); const uint32_t color_new = (unsigned)(a8) << 24 | r << 16 | g << 8 | b; - const int color = color_get(s, color_new, a8, r, g, b, search_method); + const int color = color_get(s, color_new); if (color < 0) return color; @@ -432,7 +319,7 @@ } else if (dither == DITHERING_HECKBERT) { const int right = x < w - 1, down = y < h - 1; - const int color = get_dst_color_err(s, src[x], &ea, &er, &eg, &eb, search_method); + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); if (color < 0) return color; @@ -444,7 +331,7 @@ } else if (dither == DITHERING_FLOYD_STEINBERG) { const int right = x < w - 1, down = y < h - 1, left = x > x_start; - const int color = get_dst_color_err(s, src[x], &ea, &er, &eg, &eb, search_method); + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); if (color < 0) return color; @@ -458,7 +345,7 @@ } else if (dither == DITHERING_SIERRA2) { const int right = x < w - 1, down = y < h - 1, left = x > x_start; const int right2 = x < w - 2, left2 = x > x_start + 1; - const int color = get_dst_color_err(s, src[x], &ea, &er, &eg, &eb, search_method); + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); if (color < 0) return color; @@ -477,7 +364,7 @@ } else if (dither == DITHERING_SIERRA2_4A) { const int right = x < w - 1, down = y < h - 1, left = x > x_start; - const int color = get_dst_color_err(s, src[x], &ea, &er, &eg, &eb, search_method); + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); if (color < 0) return color; @@ -487,12 +374,73 @@ if (left && down) src[src_linesize + x - 1] = dither_color(src[src_linesize + x - 1], er, eg, eb, 1, 2); if ( down) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 1, 2); + } else if (dither == DITHERING_SIERRA3) { + const int right = x < w - 1, down = y < h - 1, left = x > x_start; + const int right2 = x < w - 2, down2 = y < h - 2, left2 = x > x_start + 1; + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); + + if (color < 0) + return color; + dst[x] = color; + + if (right) src[ x + 1] = dither_color(src[ x + 1], er, eg, eb, 5, 5); + if (right2) src[ x + 2] = dither_color(src[ x + 2], er, eg, eb, 3, 5); + + if (down) { + if (left2) src[src_linesize + x - 2] = dither_color(src[src_linesize + x - 2], er, eg, eb, 2, 5); + if (left) src[src_linesize + x - 1] = dither_color(src[src_linesize + x - 1], er, eg, eb, 4, 5); + if (1) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 5, 5); + if (right) src[src_linesize + x + 1] = dither_color(src[src_linesize + x + 1], er, eg, eb, 4, 5); + if (right2) src[src_linesize + x + 2] = dither_color(src[src_linesize + x + 2], er, eg, eb, 2, 5); + + if (down2) { + if (left) src[src_linesize*2 + x - 1] = dither_color(src[src_linesize*2 + x - 1], er, eg, eb, 2, 5); + if (1) src[src_linesize*2 + x ] = dither_color(src[src_linesize*2 + x ], er, eg, eb, 3, 5); + if (right) src[src_linesize*2 + x + 1] = dither_color(src[src_linesize*2 + x + 1], er, eg, eb, 2, 5); + } + } + + } else if (dither == DITHERING_BURKES) { + const int right = x < w - 1, down = y < h - 1, left = x > x_start; + const int right2 = x < w - 2, left2 = x > x_start + 1; + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); + + if (color < 0) + return color; + dst[x] = color; + + if (right) src[ x + 1] = dither_color(src[ x + 1], er, eg, eb, 8, 5); + if (right2) src[ x + 2] = dither_color(src[ x + 2], er, eg, eb, 4, 5); + + if (down) { + if (left2) src[src_linesize + x - 2] = dither_color(src[src_linesize + x - 2], er, eg, eb, 2, 5); + if (left) src[src_linesize + x - 1] = dither_color(src[src_linesize + x - 1], er, eg, eb, 4, 5); + if (1) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 8, 5); + if (right) src[src_linesize + x + 1] = dither_color(src[src_linesize + x + 1], er, eg, eb, 4, 5); + if (right2) src[src_linesize + x + 2] = dither_color(src[src_linesize + x + 2], er, eg, eb, 2, 5); + } + + } else if (dither == DITHERING_ATKINSON) { + const int right = x < w - 1, down = y < h - 1, left = x > x_start; + const int right2 = x < w - 2, down2 = y < h - 2; + const int color = get_dst_color_err(s, src[x], &er, &eg, &eb); + + if (color < 0) + return color; + dst[x] = color; + + if (right) src[ x + 1] = dither_color(src[ x + 1], er, eg, eb, 1, 3); + if (right2) src[ x + 2] = dither_color(src[ x + 2], er, eg, eb, 1, 3); + + if (down) { + if (left) src[src_linesize + x - 1] = dither_color(src[src_linesize + x - 1], er, eg, eb, 1, 3); + if (1) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 1, 3); + if (right) src[src_linesize + x + 1] = dither_color(src[src_linesize + x + 1], er, eg, eb, 1, 3); + if (down2) src[src_linesize*2 + x ] = dither_color(src[src_linesize*2 + x ], er, eg, eb, 1, 3); + } + } else { - const uint8_t a = src[x] >> 24 & 0xff; - const uint8_t r = src[x] >> 16 & 0xff; - const uint8_t g = src[x] >> 8 & 0xff; - const uint8_t b = src[x] & 0xff; - const int color = color_get(s, src[x], a, r, g, b, search_method); + const int color = color_get(s, src[x]); if (color < 0) return color; @@ -512,20 +460,18 @@ int depth) { const struct color_node *node = &map[node_id]; - const uint32_t fontcolor = node->val[1] > 0x50 && - node->val[2] > 0x50 && - node->val[3] > 0x50 ? 0 : 0xffffff; - const int rgb_comp = node->split - 1; + const uint32_t fontcolor = node->c.lab[0] > 0x7fff ? 0 : 0xffffff; + const int lab_comp = node->split; av_bprintf(buf, "%*cnode%d [" - "label=\"%c%02X%c%02X%c%02X%c\" " - "fillcolor=\"#%02x%02x%02x\" " + "label=\"%c%d%c%d%c%d%c\" " + "fillcolor=\"#%06"PRIX32"\" " "fontcolor=\"#%06"PRIX32"\"]\n", depth*INDENT, ' ', node->palette_id, - "[ "[rgb_comp], node->val[1], - "][ "[rgb_comp], node->val[2], - " ]["[rgb_comp], node->val[3], - " ]"[rgb_comp], - node->val[1], node->val[2], node->val[3], + "[ "[lab_comp], node->c.lab[0], + "][ "[lab_comp], node->c.lab[1], + " ]["[lab_comp], node->c.lab[2], + " ]"[lab_comp], + node->c.srgb & 0xffffff, fontcolor); if (parent_id != -1) av_bprintf(buf, "%*cnode%d -> node%d\n", depth*INDENT, ' ', @@ -560,114 +506,64 @@ return 0; } -static int debug_accuracy(const PaletteUseContext *s) -{ - int r, g, b, ret = 0; - - for (r = 0; r < 256; r++) { - for (g = 0; g < 256; g++) { - for (b = 0; b < 256; b++) { - const uint8_t argb[] = {0xff, r, g, b}; - const int r1 = COLORMAP_NEAREST(s, s->color_search_method, s->map, argb); - const int r2 = colormap_nearest_bruteforce(s, argb); - if (r1 != r2) { - const uint32_t c1 = s->palette[r1]; - const uint32_t c2 = s->palette[r2]; - const uint8_t a1 = s->use_alpha ? c1>>24 & 0xff : 0xff; - const uint8_t a2 = s->use_alpha ? c2>>24 & 0xff : 0xff; - const uint8_t palargb1[] = { a1, c1>>16 & 0xff, c1>> 8 & 0xff, c1 & 0xff }; - const uint8_t palargb2[] = { a2, c2>>16 & 0xff, c2>> 8 & 0xff, c2 & 0xff }; - const int d1 = diff(palargb1, argb, s); - const int d2 = diff(palargb2, argb, s); - if (d1 != d2) { - if (s->use_alpha) - av_log(NULL, AV_LOG_ERROR, - "/!\\ %02X%02X%02X: %d ! %d (%08"PRIX32" ! %08"PRIX32") / dist: %d ! %d\n", - r, g, b, r1, r2, c1, c2, d1, d2); - else - av_log(NULL, AV_LOG_ERROR, - "/!\\ %02X%02X%02X: %d ! %d (%06"PRIX32" ! %06"PRIX32") / dist: %d ! %d\n", - r, g, b, r1, r2, c1 & 0xffffff, c2 & 0xffffff, d1, d2); - ret = 1; - } - } - } - } - } - return ret; -} - struct color { - uint32_t value; + struct Lab value; uint8_t pal_id; }; struct color_rect { - uint8_t min[4]; - uint8_t max[4]; + int32_t min[3]; + int32_t max[3]; }; typedef int (*cmp_func)(const void *, const void *); -#define DECLARE_CMP_FUNC(name, pos) \ +#define DECLARE_CMP_FUNC(name) \ static int cmp_##name(const void *pa, const void *pb) \ { \ const struct color *a = pa; \ const struct color *b = pb; \ - return (int)(a->value >> (8 * (3 - (pos))) & 0xff) \ - - (int)(b->value >> (8 * (3 - (pos))) & 0xff); \ + return FFDIFFSIGN(a->value.name, b->value.name); \ } -DECLARE_CMP_FUNC(a, 0) -DECLARE_CMP_FUNC(r, 1) -DECLARE_CMP_FUNC(g, 2) -DECLARE_CMP_FUNC(b, 3) +DECLARE_CMP_FUNC(L) +DECLARE_CMP_FUNC(a) +DECLARE_CMP_FUNC(b) -static const cmp_func cmp_funcs[] = {cmp_a, cmp_r, cmp_g, cmp_b}; +static const cmp_func cmp_funcs[] = {cmp_L, cmp_a, cmp_b}; -static int get_next_color(const uint8_t *color_used, const PaletteUseContext *s, +static int get_next_color(const uint8_t *color_used, const uint32_t *palette, int *component, const struct color_rect *box) { - int wa, wr, wg, wb; - int i, longest = 0; + int wL, wa, wb; + int longest = 0; unsigned nb_color = 0; struct color_rect ranges; struct color tmp_pal[256]; cmp_func cmpf; - ranges.min[0] = ranges.min[1] = ranges.min[2] = ranges.min[3]= 0xff; - ranges.max[0] = ranges.max[1] = ranges.max[2] = ranges.max[3]= 0x00; + ranges.min[0] = ranges.min[1] = ranges.min[2] = 0xffff; + ranges.max[0] = ranges.max[1] = ranges.max[2] = -0xffff; - for (i = 0; i < AVPALETTE_COUNT; i++) { - const uint32_t c = s->palette[i]; - const uint8_t a = c >> 24 & 0xff; - const uint8_t r = c >> 16 & 0xff; - const uint8_t g = c >> 8 & 0xff; - const uint8_t b = c & 0xff; - - if (!s->use_alpha && a < s->trans_thresh) { - continue; - } - - if (color_used[i] || (a != 0xff && !s->use_alpha) || - r < box->min[1] || g < box->min[2] || b < box->min[3] || - r > box->max[1] || g > box->max[2] || b > box->max[3]) + for (int i = 0; i < AVPALETTE_COUNT; i++) { + const uint32_t c = palette[i]; + const uint8_t a = c >> 24; + const struct Lab lab = ff_srgb_u8_to_oklab_int(c); + + if (color_used[i] || (a != 0xff) || + lab.L < box->min[0] || lab.a < box->min[1] || lab.b < box->min[2] || + lab.L > box->max[0] || lab.a > box->max[1] || lab.b > box->max[2]) continue; - if (s->use_alpha && (a < box->min[0] || a > box->max[0])) - continue; + if (lab.L < ranges.min[0]) ranges.min[0] = lab.L; + if (lab.a < ranges.min[1]) ranges.min[1] = lab.a; + if (lab.b < ranges.min[2]) ranges.min[2] = lab.b; + + if (lab.L > ranges.max[0]) ranges.max[0] = lab.L; + if (lab.a > ranges.max[1]) ranges.max[1] = lab.a; + if (lab.b > ranges.max[2]) ranges.max[2] = lab.b; - if (a < ranges.min[0]) ranges.min[0] = a; - if (r < ranges.min[1]) ranges.min[1] = r; - if (g < ranges.min[2]) ranges.min[2] = g; - if (b < ranges.min[3]) ranges.min[3] = b; - - if (a > ranges.max[0]) ranges.max[0] = a; - if (r > ranges.max[1]) ranges.max[1] = r; - if (g > ranges.max[2]) ranges.max[2] = g; - if (b > ranges.max[3]) ranges.max[3] = b; - - tmp_pal[nb_color].value = c; + tmp_pal[nb_color].value = lab; tmp_pal[nb_color].pal_id = i; nb_color++; @@ -677,22 +573,12 @@ return -1; /* define longest axis that will be the split component */ - wa = ranges.max[0] - ranges.min[0]; - wr = ranges.max[1] - ranges.min[1]; - wg = ranges.max[2] - ranges.min[2]; - wb = ranges.max[3] - ranges.min[3]; - - if (s->use_alpha) { - if (wa >= wr && wa >= wb && wa >= wg) longest = 0; - if (wr >= wg && wr >= wb && wr >= wa) longest = 1; - if (wg >= wr && wg >= wb && wg >= wa) longest = 2; - if (wb >= wr && wb >= wg && wb >= wa) longest = 3; - } else { - if (wr >= wg && wr >= wb) longest = 1; - if (wg >= wr && wg >= wb) longest = 2; - if (wb >= wr && wb >= wg) longest = 3; - } - + wL = ranges.max[0] - ranges.min[0]; + wa = ranges.max[1] - ranges.min[1]; + wb = ranges.max[2] - ranges.min[2]; + if (wb >= wL && wb >= wa) longest = 2; + if (wa >= wL && wa >= wb) longest = 1; + if (wL >= wa && wL >= wb) longest = 0; cmpf = cmp_funcs[longest]; *component = longest; @@ -705,41 +591,39 @@ static int colormap_insert(struct color_node *map, uint8_t *color_used, int *nb_used, - const PaletteUseContext *s, + const uint32_t *palette, + const int trans_thresh, const struct color_rect *box) { - uint32_t c; int component, cur_id; + int comp_value; int node_left_id = -1, node_right_id = -1; struct color_node *node; struct color_rect box1, box2; - const int pal_id = get_next_color(color_used, s, &component, box); + const int pal_id = get_next_color(color_used, palette, &component, box); if (pal_id < 0) return -1; /* create new node with that color */ cur_id = (*nb_used)++; - c = s->palette[pal_id]; node = &map[cur_id]; node->split = component; node->palette_id = pal_id; - node->val[0] = c>>24 & 0xff; - node->val[1] = c>>16 & 0xff; - node->val[2] = c>> 8 & 0xff; - node->val[3] = c & 0xff; + node->c = get_color_from_srgb(palette[pal_id]); color_used[pal_id] = 1; /* get the two boxes this node creates */ box1 = box2 = *box; - box1.max[component] = node->val[component]; - box2.min[component] = FFMIN(node->val[component] + 1, 255); + comp_value = node->c.lab[component]; + box1.max[component] = comp_value; + box2.min[component] = FFMIN(comp_value + 1, 0xffff); - node_left_id = colormap_insert(map, color_used, nb_used, s, &box1); + node_left_id = colormap_insert(map, color_used, nb_used, palette, trans_thresh, &box1); if (box2.min[component] <= box2.max[component]) - node_right_id = colormap_insert(map, color_used, nb_used, s, &box2); + node_right_id = colormap_insert(map, color_used, nb_used, palette, trans_thresh, &box2); node->left_id = node_left_id; node->right_id = node_right_id; @@ -754,85 +638,40 @@ return c1 - c2; } -static int cmp_pal_entry_alpha(const void *a, const void *b) -{ - const int c1 = *(const uint32_t *)a; - const int c2 = *(const uint32_t *)b; - return c1 - c2; -} - static void load_colormap(PaletteUseContext *s) { - int i, nb_used = 0; + int nb_used = 0; uint8_t color_used[AVPALETTE_COUNT] = {0}; uint32_t last_color = 0; struct color_rect box; - if (!s->use_alpha && s->transparency_index >= 0) { + if (s->transparency_index >= 0) { FFSWAP(uint32_t, s->palette[s->transparency_index], s->palette[255]); } /* disable transparent colors and dups */ - qsort(s->palette, AVPALETTE_COUNT-(s->transparency_index >= 0), sizeof(*s->palette), - s->use_alpha ? cmp_pal_entry_alpha : cmp_pal_entry); + qsort(s->palette, AVPALETTE_COUNT-(s->transparency_index >= 0), sizeof(*s->palette), cmp_pal_entry); - for (i = 0; i < AVPALETTE_COUNT; i++) { + for (int i = 0; i < AVPALETTE_COUNT; i++) { const uint32_t c = s->palette[i]; if (i != 0 && c == last_color) { color_used[i] = 1; continue; } last_color = c; - if (!s->use_alpha && c >> 24 < s->trans_thresh) { + if (c >> 24 < s->trans_thresh) { color_used[i] = 1; // ignore transparent color(s) continue; } } - box.min[0] = box.min[1] = box.min[2] = box.min[3] = 0x00; - box.max[0] = box.max[1] = box.max[2] = box.max[3] = 0xff; + box.min[0] = box.min[1] = box.min[2] = -0xffff; + box.max[0] = box.max[1] = box.max[2] = 0xffff; - colormap_insert(s->map, color_used, &nb_used, s, &box); + colormap_insert(s->map, color_used, &nb_used, s->palette, s->trans_thresh, &box); if (s->dot_filename) disp_tree(s->map, s->dot_filename); - - if (s->debug_accuracy) { - if (!debug_accuracy(s)) - av_log(NULL, AV_LOG_INFO, "Accuracy check passed\n"); - } -} - -static void debug_mean_error(PaletteUseContext *s, const AVFrame *in1, - const AVFrame *in2, int frame_count) -{ - int x, y; - const uint32_t *palette = s->palette; - uint32_t *src1 = (uint32_t *)in1->data[0]; - uint8_t *src2 = in2->data[0]; - const int src1_linesize = in1->linesize[0] >> 2; - const int src2_linesize = in2->linesize[0]; - const float div = in1->width * in1->height * (s->use_alpha ? 4 : 3); - unsigned mean_err = 0; - - for (y = 0; y < in1->height; y++) { - for (x = 0; x < in1->width; x++) { - const uint32_t c1 = src1[x]; - const uint32_t c2 = palette[src2[x]]; - const uint8_t a1 = s->use_alpha ? c1>>24 & 0xff : 0xff; - const uint8_t a2 = s->use_alpha ? c2>>24 & 0xff : 0xff; - const uint8_t argb1[] = {a1, c1 >> 16 & 0xff, c1 >> 8 & 0xff, c1 & 0xff}; - const uint8_t argb2[] = {a2, c2 >> 16 & 0xff, c2 >> 8 & 0xff, c2 & 0xff}; - mean_err += diff(argb1, argb2, s); - } - src1 += src1_linesize; - src2 += src2_linesize; - } - - s->total_mean_err += mean_err; - - av_log(NULL, AV_LOG_INFO, "MEP:%.3f TotalMEP:%.3f\n", - mean_err / div, s->total_mean_err / (div * frame_count)); } static void set_processing_window(enum diff_mode diff_mode, @@ -944,7 +783,7 @@ av_frame_unref(s->last_out); if ((ret = av_frame_ref(s->last_in, in)) < 0 || (ret = av_frame_ref(s->last_out, out)) < 0 || - (ret = av_frame_make_writable(s->last_in)) < 0) { + (ret = ff_inlink_make_frame_writable(inlink, &s->last_in)) < 0) { av_frame_free(&out); *outf = NULL; return ret; @@ -960,8 +799,6 @@ return ret; } memcpy(out->data[1], s->palette, AVPALETTE_SIZE); - if (s->calc_mean_err) - debug_mean_error(s, in, out, inlink->frame_count_out); *outf = out; return 0; } @@ -1023,7 +860,7 @@ for (y = 0; y < palette_frame->height; y++) { for (x = 0; x < palette_frame->width; x++) { s->palette[i] = p[x]; - if (!s->use_alpha && p[x]>>24 < s->trans_thresh) { + if (p[x]>>24 < s->trans_thresh) { s->transparency_index = i; // we are assuming at most one transparent color in palette } i++; @@ -1063,38 +900,33 @@ return ff_filter_frame(ctx->outputs[0], out); } -#define DEFINE_SET_FRAME(color_search, name, value) \ +#define DEFINE_SET_FRAME(name, value) \ static int set_frame_##name(PaletteUseContext *s, AVFrame *out, AVFrame *in, \ int x_start, int y_start, int w, int h) \ { \ - return set_frame(s, out, in, x_start, y_start, w, h, value, color_search); \ + return set_frame(s, out, in, x_start, y_start, w, h, value); \ } -#define DEFINE_SET_FRAME_COLOR_SEARCH(color_search, color_search_macro) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##none, DITHERING_NONE) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##bayer, DITHERING_BAYER) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##heckbert, DITHERING_HECKBERT) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##floyd_steinberg, DITHERING_FLOYD_STEINBERG) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##sierra2, DITHERING_SIERRA2) \ - DEFINE_SET_FRAME(color_search_macro, color_search##_##sierra2_4a, DITHERING_SIERRA2_4A) \ - -DEFINE_SET_FRAME_COLOR_SEARCH(nns_iterative, COLOR_SEARCH_NNS_ITERATIVE) -DEFINE_SET_FRAME_COLOR_SEARCH(nns_recursive, COLOR_SEARCH_NNS_RECURSIVE) -DEFINE_SET_FRAME_COLOR_SEARCH(bruteforce, COLOR_SEARCH_BRUTEFORCE) - -#define DITHERING_ENTRIES(color_search) { \ - set_frame_##color_search##_none, \ - set_frame_##color_search##_bayer, \ - set_frame_##color_search##_heckbert, \ - set_frame_##color_search##_floyd_steinberg, \ - set_frame_##color_search##_sierra2, \ - set_frame_##color_search##_sierra2_4a, \ -} - -static const set_frame_func set_frame_lut[NB_COLOR_SEARCHES][NB_DITHERING] = { - DITHERING_ENTRIES(nns_iterative), - DITHERING_ENTRIES(nns_recursive), - DITHERING_ENTRIES(bruteforce), +DEFINE_SET_FRAME(none, DITHERING_NONE) +DEFINE_SET_FRAME(bayer, DITHERING_BAYER) +DEFINE_SET_FRAME(heckbert, DITHERING_HECKBERT) +DEFINE_SET_FRAME(floyd_steinberg, DITHERING_FLOYD_STEINBERG) +DEFINE_SET_FRAME(sierra2, DITHERING_SIERRA2) +DEFINE_SET_FRAME(sierra2_4a, DITHERING_SIERRA2_4A) +DEFINE_SET_FRAME(sierra3, DITHERING_SIERRA3) +DEFINE_SET_FRAME(burkes, DITHERING_BURKES) +DEFINE_SET_FRAME(atkinson, DITHERING_ATKINSON) + +static const set_frame_func set_frame_lut[NB_DITHERING] = { + [DITHERING_NONE] = set_frame_none, + [DITHERING_BAYER] = set_frame_bayer, + [DITHERING_HECKBERT] = set_frame_heckbert, + [DITHERING_FLOYD_STEINBERG] = set_frame_floyd_steinberg, + [DITHERING_SIERRA2] = set_frame_sierra2, + [DITHERING_SIERRA2_4A] = set_frame_sierra2_4a, + [DITHERING_SIERRA3] = set_frame_sierra3, + [DITHERING_BURKES] = set_frame_burkes, + [DITHERING_ATKINSON] = set_frame_atkinson, }; static int dither_value(int p) @@ -1114,13 +946,12 @@ if (!s->last_in || !s->last_out) return AVERROR(ENOMEM); - s->set_frame = set_frame_lut[s->color_search_method][s->dither]; + s->set_frame = set_frame_lut[s->dither]; if (s->dither == DITHERING_BAYER) { - int i; const int delta = 1 << (5 - s->bayer_scale); // to avoid too much luma - for (i = 0; i < FF_ARRAY_ELEMS(s->ordered_dither); i++) + for (int i = 0; i < FF_ARRAY_ELEMS(s->ordered_dither); i++) s->ordered_dither[i] = (dither_value(i) >> s->bayer_scale) - delta; } @@ -1135,11 +966,10 @@ static av_cold void uninit(AVFilterContext *ctx) { - int i; PaletteUseContext *s = ctx->priv; ff_framesync_uninit(&s->fs); - for (i = 0; i < CACHE_SIZE; i++) + for (int i = 0; i < CACHE_SIZE; i++) av_freep(&s->cache[i].entries); av_frame_free(&s->last_in); av_frame_free(&s->last_out); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_photosensitivity.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_photosensitivity.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_photosensitivity.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_photosensitivity.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/pixdesc.h" #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "video.h" @@ -243,7 +244,7 @@ /* just duplicate the frame */ s->history[s->history_pos] = 0; /* frame was duplicated, thus, delta is zero */ } else { - res = av_frame_make_writable(s->last_frame_av); + res = ff_inlink_make_frame_writable(inlink, &s->last_frame_av); if (res) { av_frame_free(&in); return res; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_pseudocolor.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_pseudocolor.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_pseudocolor.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_pseudocolor.c 2023-03-03 13:29:59.000000000 +0000 @@ -67,6 +67,7 @@ TURBO, CIVIDIS, SOLAR, + SPECTRAL, NB_CURVES, }; @@ -85,6 +86,7 @@ PRESET_NOMINAL, PRESET_PREFERRED, PRESET_TOTAL, + PRESET_SPECTRAL, NB_PRESETS, }; @@ -174,6 +176,11 @@ }, .offset = { 0., -9., 9. }, .fun = { solarfun, solarfun, solarfun }, }, + [SPECTRAL] = {{ + { -1.6820e-15, 1.4982e-12, -5.0442e-10, 8.0490e-08, -6.1903e-06, 1.5821e-04, 6.4359e-03, 6.2887e-01 }, + { 1.2526e-15, -1.2203e-12, 4.7013e-10, -8.9360e-08, 8.3839e-06, -3.6642e-04, 1.4784e-02, -9.8075e-03 }, + { 1.4755e-15, -1.6765e-12, 7.3188e-10, -1.5522e-07, 1.6406e-05, -7.7883e-04, 1.4502e-02, 2.1597e-01 }, + }, .fun = { limit, limit, limit }, }, }; static const Preset presets[] = @@ -191,7 +198,8 @@ [PRESET_RANGE2] = { 5, spec2_range, NULL, spec2_fills }, [PRESET_SHADOWS] = { 2, shadows_range, NULL, shadows_fills }, [PRESET_HIGHLIGHTS] = { 3, highlights_range, NULL, highlights_fills }, - [PRESET_SOLAR] = { 1, &full_range, &curves[SOLAR], NULL }, + [PRESET_SOLAR] = { 1, &full_range, &curves[SOLAR], NULL }, + [PRESET_SPECTRAL]= { 1, &full_range, &curves[SPECTRAL],NULL }, }; typedef struct PseudoColorContext { @@ -246,6 +254,7 @@ { "nominal", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NOMINAL}, .flags=FLAGS, "preset" }, { "preferred", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_PREFERRED},.flags=FLAGS,"preset" }, { "total", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_TOTAL}, .flags=FLAGS, "preset" }, + { "spectral", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_SPECTRAL},.flags = FLAGS, "preset" }, { "opacity", "set pseudocolor opacity",OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, .flags = FLAGS }, { NULL } }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_psnr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_psnr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_psnr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_psnr.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,15 +26,14 @@ */ #include "libavutil/avstring.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" #include "drawutils.h" -#include "formats.h" #include "framesync.h" #include "internal.h" #include "psnr.h" -#include "video.h" typedef struct PSNRContext { const AVClass *class; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_qp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_qp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_qp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_qp.c 2023-03-03 13:29:59.000000000 +0000 @@ -143,7 +143,7 @@ for (x = 0; x < s->qstride; x++) { unsigned int block_idx = y * s->qstride + x; AVVideoBlockParams *b = av_video_enc_params_block(par_out, block_idx); - int qp = sd_in ? in_qp_global + BLOCK_QP_DELTA(block_idx) : NAN; + double qp = sd_in ? in_qp_global + BLOCK_QP_DELTA(block_idx) : NAN; double var_values[] = { !!sd_in, qp, x, y, s->qstride, s->h, 0}; double temp_val; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_random.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_random.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_random.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_random.c 2023-03-03 13:29:59.000000000 +0000 @@ -37,6 +37,7 @@ int nb_frames_filled; AVFrame *frames[MAX_FRAMES]; int64_t pts[MAX_FRAMES]; + int64_t duration[MAX_FRAMES]; int flush_idx; } RandomContext; @@ -74,6 +75,7 @@ if (s->nb_frames_filled < s->nb_frames) { s->frames[s->nb_frames_filled] = in; + s->duration[s->nb_frames_filled] = in->duration; s->pts[s->nb_frames_filled++] = in->pts; return 0; } @@ -82,9 +84,12 @@ out = s->frames[idx]; out->pts = s->pts[0]; + out->duration = s->duration[0]; memmove(&s->pts[0], &s->pts[1], (s->nb_frames - 1) * sizeof(s->pts[0])); + memmove(&s->duration[0], &s->duration[1], (s->nb_frames - 1) * sizeof(s->duration[0])); s->frames[idx] = in; s->pts[s->nb_frames - 1] = in->pts; + s->duration[s->nb_frames - 1] = in->duration; return ff_filter_frame(outlink, out); } @@ -104,6 +109,7 @@ s->nb_frames--; goto next; } + out->duration = s->duration[s->flush_idx]; out->pts = s->pts[s->flush_idx++]; ret = ff_filter_frame(outlink, out); s->frames[s->nb_frames - 1] = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_repeatfields.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_repeatfields.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_repeatfields.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_repeatfields.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ #include "libavutil/imgutils.h" #include "avfilter.h" +#include "filters.h" #include "internal.h" typedef struct RepeatFieldsContext { @@ -75,23 +76,23 @@ f->pts = AV_NOPTS_VALUE; } -static int filter_frame(AVFilterLink *inlink, AVFrame *in) { +static int filter_frame(AVFilterLink *inlink, AVFrame *in) +{ AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = inlink->dst->outputs[0]; RepeatFieldsContext *s = ctx->priv; - AVFrame *out; int ret, i; int state = s->state; if (!s->frame) { s->frame = av_frame_clone(in); - if (!s->frame) + if (!s->frame) { + av_frame_free(&in); return AVERROR(ENOMEM); + } s->frame->pts = AV_NOPTS_VALUE; } - out = s->frame; - if ((state == 0 && !in->top_field_first) || (state == 1 && in->top_field_first)) { av_log(ctx, AV_LOG_WARNING, "Unexpected field flags: " @@ -104,16 +105,22 @@ AVFrame *new; new = av_frame_clone(in); - if (!new) + if (!new) { + av_frame_free(&in); return AVERROR(ENOMEM); + } ret = ff_filter_frame(outlink, new); if (in->repeat_pict) { - av_frame_make_writable(out); - update_pts(outlink, out, in->pts, 2); + ret = ff_inlink_make_frame_writable(inlink, &s->frame); + if (ret < 0) { + av_frame_free(&in); + return ret; + } + update_pts(outlink, s->frame, in->pts, 2); for (i = 0; i < s->nb_planes; i++) { - av_image_copy_plane(out->data[i], out->linesize[i] * 2, + av_image_copy_plane(s->frame->data[i], s->frame->linesize[i] * 2, in->data[i], in->linesize[i] * 2, s->linesize[i], s->planeheight[i] / 2); } @@ -121,28 +128,38 @@ } } else { for (i = 0; i < s->nb_planes; i++) { - av_frame_make_writable(out); - av_image_copy_plane(out->data[i] + out->linesize[i], out->linesize[i] * 2, + ret = ff_inlink_make_frame_writable(inlink, &s->frame); + if (ret < 0) { + av_frame_free(&in); + return ret; + } + av_image_copy_plane(s->frame->data[i] + s->frame->linesize[i], s->frame->linesize[i] * 2, in->data[i] + in->linesize[i], in->linesize[i] * 2, s->linesize[i], s->planeheight[i] / 2); } - ret = ff_filter_frame(outlink, av_frame_clone(out)); + ret = ff_filter_frame(outlink, av_frame_clone(s->frame)); if (in->repeat_pict) { AVFrame *new; new = av_frame_clone(in); - if (!new) + if (!new) { + av_frame_free(&in); return AVERROR(ENOMEM); + } ret = ff_filter_frame(outlink, new); state = 0; } else { - av_frame_make_writable(out); - update_pts(outlink, out, in->pts, 1); + ret = ff_inlink_make_frame_writable(inlink, &s->frame); + if (ret < 0) { + av_frame_free(&in); + return ret; + } + update_pts(outlink, s->frame, in->pts, 1); for (i = 0; i < s->nb_planes; i++) { - av_image_copy_plane(out->data[i], out->linesize[i] * 2, + av_image_copy_plane(s->frame->data[i], s->frame->linesize[i] * 2, in->data[i], in->linesize[i] * 2, s->linesize[i], s->planeheight[i] / 2); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_rotate.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_rotate.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_rotate.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_rotate.c 2023-03-03 13:29:59.000000000 +0000 @@ -258,8 +258,8 @@ { int int_x = av_clip(x>>16, 0, max_x); int int_y = av_clip(y>>16, 0, max_y); - int frac_x = x&0xFFFF; - int frac_y = y&0xFFFF; + int64_t frac_x = x&0xFFFF; + int64_t frac_y = y&0xFFFF; int i; int int_x1 = FFMIN(int_x+1, max_x); int int_y1 = FFMIN(int_y+1, max_y); @@ -269,10 +269,10 @@ int s01 = AV_RL16(&src[src_linestep * int_x1 + i + src_linesize * int_y ]); int s10 = AV_RL16(&src[src_linestep * int_x + i + src_linesize * int_y1]); int s11 = AV_RL16(&src[src_linestep * int_x1 + i + src_linesize * int_y1]); - int s0 = (((1<<16) - frac_x)*s00 + frac_x*s01); - int s1 = (((1<<16) - frac_x)*s10 + frac_x*s11); + int64_t s0 = (((1<<16) - frac_x)*s00 + frac_x*s01); + int64_t s1 = (((1<<16) - frac_x)*s10 + frac_x*s11); - AV_WL16(&dst_color[i], ((int64_t)((1<<16) - frac_y)*s0 + (int64_t)frac_y*s1) >> 32); + AV_WL16(&dst_color[i], (((1<<16) - frac_y)*s0 + frac_y*s1) >> 32); } return dst_color; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ * scale video filter */ +#include #include #include @@ -107,7 +108,8 @@ const AVClass *class; struct SwsContext *sws; ///< software scaler context struct SwsContext *isws[2]; ///< software scaler context for interlaced material - AVDictionary *opts; + // context used for forwarding options to sws + struct SwsContext *sws_opts; /** * New dimensions. Special values are: @@ -117,7 +119,6 @@ */ int w, h; char *size_str; - unsigned int flags; ///sws flags double param[2]; // sws params int hsub, vsub; ///< chroma subsampling @@ -268,11 +269,29 @@ return ret; } -static av_cold int init_dict(AVFilterContext *ctx, AVDictionary **opts) +static av_cold int preinit(AVFilterContext *ctx) { ScaleContext *scale = ctx->priv; int ret; + scale->sws_opts = sws_alloc_context(); + if (!scale->sws_opts) + return AVERROR(ENOMEM); + + // set threads=0, so we can later check whether the user modified it + ret = av_opt_set_int(scale->sws_opts, "threads", 0, 0); + if (ret < 0) + return ret; + + return 0; +} + +static av_cold int init(AVFilterContext *ctx) +{ + ScaleContext *scale = ctx->priv; + int64_t threads; + int ret; + if (scale->size_str && (scale->w_expr || scale->h_expr)) { av_log(ctx, AV_LOG_ERROR, "Size and width/height expressions cannot be set at the same time.\n"); @@ -310,18 +329,26 @@ av_log(ctx, AV_LOG_VERBOSE, "w:%s h:%s flags:'%s' interl:%d\n", scale->w_expr, scale->h_expr, (char *)av_x_if_null(scale->flags_str, ""), scale->interlaced); - scale->flags = 0; - if (scale->flags_str && *scale->flags_str) { - const AVClass *class = sws_get_class(); - const AVOption *o = av_opt_find(&class, "sws_flags", NULL, 0, - AV_OPT_SEARCH_FAKE_OBJ); - int ret = av_opt_eval_flags(&class, o, scale->flags_str, &scale->flags); + ret = av_opt_set(scale->sws_opts, "sws_flags", scale->flags_str, 0); if (ret < 0) return ret; } - scale->opts = *opts; - *opts = NULL; + + for (int i = 0; i < FF_ARRAY_ELEMS(scale->param); i++) + if (scale->param[i] != DBL_MAX) { + ret = av_opt_set_double(scale->sws_opts, i ? "param1" : "param0", + scale->param[i], 0); + if (ret < 0) + return ret; + } + + // use generic thread-count if the user did not set it explicitly + ret = av_opt_get_int(scale->sws_opts, "threads", 0, &threads); + if (ret < 0) + return ret; + if (!threads) + av_opt_set_int(scale->sws_opts, "threads", ff_filter_get_nb_threads(ctx), 0); scale->in_frame_range = AVCOL_RANGE_UNSPECIFIED; @@ -334,11 +361,11 @@ av_expr_free(scale->w_pexpr); av_expr_free(scale->h_pexpr); scale->w_pexpr = scale->h_pexpr = NULL; + sws_freeContext(scale->sws_opts); sws_freeContext(scale->sws); sws_freeContext(scale->isws[0]); sws_freeContext(scale->isws[1]); scale->sws = NULL; - av_dict_free(&scale->opts); } static int query_formats(AVFilterContext *ctx) @@ -486,6 +513,7 @@ enum AVPixelFormat outfmt = outlink->format; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); ScaleContext *scale = ctx->priv; + uint8_t *flags_val = NULL; int ret; if ((ret = scale_eval_dimensions(ctx)) < 0) @@ -534,16 +562,16 @@ return AVERROR(ENOMEM); *swscs[i] = s; + ret = av_opt_copy(s, scale->sws_opts); + if (ret < 0) + return ret; + av_opt_set_int(s, "srcw", inlink0 ->w, 0); av_opt_set_int(s, "srch", inlink0 ->h >> !!i, 0); av_opt_set_int(s, "src_format", inlink0->format, 0); av_opt_set_int(s, "dstw", outlink->w, 0); av_opt_set_int(s, "dsth", outlink->h >> !!i, 0); av_opt_set_int(s, "dst_format", outfmt, 0); - av_opt_set_int(s, "sws_flags", scale->flags, 0); - av_opt_set_int(s, "param0", scale->param[0], 0); - av_opt_set_int(s, "param1", scale->param[1], 0); - av_opt_set_int(s, "threads", ff_filter_get_nb_threads(ctx), 0); if (scale->in_range != AVCOL_RANGE_UNSPECIFIED) av_opt_set_int(s, "src_range", scale->in_range == AVCOL_RANGE_JPEG, 0); @@ -554,13 +582,6 @@ av_opt_set_int(s, "dst_range", scale->out_range == AVCOL_RANGE_JPEG, 0); - if (scale->opts) { - AVDictionaryEntry *e = NULL; - while ((e = av_dict_get(scale->opts, "", e, AV_DICT_IGNORE_SUFFIX))) { - if ((ret = av_opt_set(s, e->key, e->value, 0)) < 0) - return ret; - } - } /* Override YUV420P default settings to have the correct (MPEG-2) chroma positions * MPEG-2 chroma positions are used by convention * XXX: support other 4:2:0 pixel formats */ @@ -589,12 +610,17 @@ } else outlink->sample_aspect_ratio = inlink0->sample_aspect_ratio; - av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s sar:%d/%d -> w:%d h:%d fmt:%s sar:%d/%d flags:0x%0x\n", + if (scale->sws) + av_opt_get(scale->sws, "sws_flags", 0, &flags_val); + + av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s sar:%d/%d -> w:%d h:%d fmt:%s sar:%d/%d flags:%s\n", inlink ->w, inlink ->h, av_get_pix_fmt_name( inlink->format), inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den, outlink->w, outlink->h, av_get_pix_fmt_name(outlink->format), outlink->sample_aspect_ratio.num, outlink->sample_aspect_ratio.den, - scale->flags); + flags_val); + av_freep(&flags_val); + return 0; fail: @@ -927,6 +953,14 @@ return c; } +static void *child_next(void *obj, void *prev) +{ + ScaleContext *s = obj; + if (!prev) + return s->sws_opts; + return NULL; +} + #define OFFSET(x) offsetof(ScaleContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM #define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM @@ -969,8 +1003,8 @@ { "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "force_oar" }, { "increase", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 0, FLAGS, "force_oar" }, { "force_divisible_by", "enforce that the output resolution is divisible by a defined integer when force_original_aspect_ratio is used", OFFSET(force_divisible_by), AV_OPT_TYPE_INT, { .i64 = 1}, 1, 256, FLAGS }, - { "param0", "Scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS }, - { "param1", "Scaler param 1", OFFSET(param[1]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, FLAGS }, + { "param0", "Scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, + { "param1", "Scaler param 1", OFFSET(param[1]), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, "eval" }, { "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" }, { "frame", "eval expressions during initialization and per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" }, @@ -984,6 +1018,7 @@ .version = LIBAVUTIL_VERSION_INT, .category = AV_CLASS_CATEGORY_FILTER, .child_class_iterate = child_class_iterate, + .child_next = child_next, }; static const AVFilterPad avfilter_vf_scale_inputs[] = { @@ -1005,7 +1040,8 @@ const AVFilter ff_vf_scale = { .name = "scale", .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format."), - .init_dict = init_dict, + .preinit = preinit, + .init = init, .uninit = uninit, .priv_size = sizeof(ScaleContext), .priv_class = &scale_class, @@ -1046,7 +1082,8 @@ const AVFilter ff_vf_scale2ref = { .name = "scale2ref", .description = NULL_IF_CONFIG_SMALL("Scale the input video size and/or convert the image format to the given reference."), - .init_dict = init_dict, + .preinit = preinit, + .init = init, .uninit = uninit, .priv_size = sizeof(ScaleContext), .priv_class = &scale_class, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale_qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scale_qsv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,664 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * scale video filter - QSV - */ - -#include - -#include -#include - -#include "libavutil/avstring.h" -#include "libavutil/common.h" -#include "libavutil/eval.h" -#include "libavutil/hwcontext.h" -#include "libavutil/hwcontext_qsv.h" -#include "libavutil/internal.h" -#include "libavutil/mathematics.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/time.h" -#include "libavfilter/qsvvpp.h" - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" - -static const char *const var_names[] = { - "PI", - "PHI", - "E", - "in_w", "iw", - "in_h", "ih", - "out_w", "ow", - "out_h", "oh", - "a", "dar", - "sar", - NULL -}; - -enum var_name { - VAR_PI, - VAR_PHI, - VAR_E, - VAR_IN_W, VAR_IW, - VAR_IN_H, VAR_IH, - VAR_OUT_W, VAR_OW, - VAR_OUT_H, VAR_OH, - VAR_A, VAR_DAR, - VAR_SAR, - VARS_NB -}; - -#define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) - -typedef struct QSVScaleContext { - const AVClass *class; - - /* a clone of the main session, used internally for scaling */ - mfxSession session; - - mfxMemId *mem_ids_in; - int nb_mem_ids_in; - - mfxMemId *mem_ids_out; - int nb_mem_ids_out; - - mfxFrameSurface1 **surface_ptrs_in; - int nb_surface_ptrs_in; - - mfxFrameSurface1 **surface_ptrs_out; - int nb_surface_ptrs_out; - - mfxExtOpaqueSurfaceAlloc opaque_alloc; - - mfxExtVPPScaling scale_conf; - int mode; - - mfxExtBuffer *ext_buffers[2]; - int num_ext_buf; - - int shift_width, shift_height; - - /** - * New dimensions. Special values are: - * 0 = original width/height - * -1 = keep original aspect - */ - int w, h; - - /** - * Output sw format. AV_PIX_FMT_NONE for no conversion. - */ - enum AVPixelFormat format; - - char *w_expr; ///< width expression string - char *h_expr; ///< height expression string - char *format_str; -} QSVScaleContext; - -static av_cold int qsvscale_init(AVFilterContext *ctx) -{ - QSVScaleContext *s = ctx->priv; - - if (!strcmp(s->format_str, "same")) { - s->format = AV_PIX_FMT_NONE; - } else { - s->format = av_get_pix_fmt(s->format_str); - if (s->format == AV_PIX_FMT_NONE) { - av_log(ctx, AV_LOG_ERROR, "Unrecognized pixel format: %s\n", s->format_str); - return AVERROR(EINVAL); - } - } - - return 0; -} - -static av_cold void qsvscale_uninit(AVFilterContext *ctx) -{ - QSVScaleContext *s = ctx->priv; - - if (s->session) { - MFXClose(s->session); - s->session = NULL; - } - - av_freep(&s->mem_ids_in); - av_freep(&s->mem_ids_out); - s->nb_mem_ids_in = 0; - s->nb_mem_ids_out = 0; - - av_freep(&s->surface_ptrs_in); - av_freep(&s->surface_ptrs_out); - s->nb_surface_ptrs_in = 0; - s->nb_surface_ptrs_out = 0; -} - -static int init_out_pool(AVFilterContext *ctx, - int out_width, int out_height) -{ - QSVScaleContext *s = ctx->priv; - AVFilterLink *outlink = ctx->outputs[0]; - - AVHWFramesContext *in_frames_ctx; - AVHWFramesContext *out_frames_ctx; - AVQSVFramesContext *in_frames_hwctx; - AVQSVFramesContext *out_frames_hwctx; - enum AVPixelFormat in_format; - enum AVPixelFormat out_format; - int i, ret; - - /* check that we have a hw context */ - if (!ctx->inputs[0]->hw_frames_ctx) { - av_log(ctx, AV_LOG_ERROR, "No hw context provided on input\n"); - return AVERROR(EINVAL); - } - in_frames_ctx = (AVHWFramesContext*)ctx->inputs[0]->hw_frames_ctx->data; - in_frames_hwctx = in_frames_ctx->hwctx; - - in_format = in_frames_ctx->sw_format; - out_format = (s->format == AV_PIX_FMT_NONE) ? in_format : s->format; - - outlink->hw_frames_ctx = av_hwframe_ctx_alloc(in_frames_ctx->device_ref); - if (!outlink->hw_frames_ctx) - return AVERROR(ENOMEM); - out_frames_ctx = (AVHWFramesContext*)outlink->hw_frames_ctx->data; - out_frames_hwctx = out_frames_ctx->hwctx; - - out_frames_ctx->format = AV_PIX_FMT_QSV; - out_frames_ctx->width = FFALIGN(out_width, 16); - out_frames_ctx->height = FFALIGN(out_height, 16); - out_frames_ctx->sw_format = out_format; - out_frames_ctx->initial_pool_size = 4; - - out_frames_hwctx->frame_type = in_frames_hwctx->frame_type | MFX_MEMTYPE_FROM_VPPOUT; - - ret = ff_filter_init_hw_frames(ctx, outlink, 32); - if (ret < 0) - return ret; - - ret = av_hwframe_ctx_init(outlink->hw_frames_ctx); - if (ret < 0) - return ret; - - for (i = 0; i < out_frames_hwctx->nb_surfaces; i++) { - mfxFrameInfo *info = &out_frames_hwctx->surfaces[i].Info; - info->CropW = out_width; - info->CropH = out_height; - } - - return 0; -} - -static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, - mfxFrameAllocResponse *resp) -{ - AVFilterContext *ctx = pthis; - QSVScaleContext *s = ctx->priv; - - if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) || - !(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) || - !(req->Type & MFX_MEMTYPE_EXTERNAL_FRAME)) - return MFX_ERR_UNSUPPORTED; - - if (req->Type & MFX_MEMTYPE_FROM_VPPIN) { - resp->mids = s->mem_ids_in; - resp->NumFrameActual = s->nb_mem_ids_in; - } else { - resp->mids = s->mem_ids_out; - resp->NumFrameActual = s->nb_mem_ids_out; - } - - return MFX_ERR_NONE; -} - -static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp) -{ - return MFX_ERR_NONE; -} - -static mfxStatus frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - return MFX_ERR_UNSUPPORTED; -} - -static mfxStatus frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) -{ - return MFX_ERR_UNSUPPORTED; -} - -static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl) -{ - mfxHDLPair *pair_dst = (mfxHDLPair*)hdl; - mfxHDLPair *pair_src = (mfxHDLPair*)mid; - - pair_dst->first = pair_src->first; - - if (pair_src->second != (mfxMemId)MFX_INFINITE) - pair_dst->second = pair_src->second; - return MFX_ERR_NONE; -} - -static int init_out_session(AVFilterContext *ctx) -{ - - QSVScaleContext *s = ctx->priv; - AVHWFramesContext *in_frames_ctx = (AVHWFramesContext*)ctx->inputs[0]->hw_frames_ctx->data; - AVHWFramesContext *out_frames_ctx = (AVHWFramesContext*)ctx->outputs[0]->hw_frames_ctx->data; - AVQSVFramesContext *in_frames_hwctx = in_frames_ctx->hwctx; - AVQSVFramesContext *out_frames_hwctx = out_frames_ctx->hwctx; - AVQSVDeviceContext *device_hwctx = in_frames_ctx->device_ctx->hwctx; - - int opaque = !!(in_frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); - - mfxHDL handle = NULL; - mfxHandleType handle_type; - mfxVersion ver; - mfxIMPL impl; - mfxVideoParam par; - mfxStatus err; - int i; - - s->num_ext_buf = 0; - - /* extract the properties of the "master" session given to us */ - err = MFXQueryIMPL(device_hwctx->session, &impl); - if (err == MFX_ERR_NONE) - err = MFXQueryVersion(device_hwctx->session, &ver); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error querying the session attributes\n"); - return AVERROR_UNKNOWN; - } - - if (MFX_IMPL_VIA_VAAPI == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_VA_DISPLAY; - } else if (MFX_IMPL_VIA_D3D11 == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_D3D11_DEVICE; - } else if (MFX_IMPL_VIA_D3D9 == MFX_IMPL_VIA_MASK(impl)) { - handle_type = MFX_HANDLE_D3D9_DEVICE_MANAGER; - } else { - av_log(ctx, AV_LOG_ERROR, "Error unsupported handle type\n"); - return AVERROR_UNKNOWN; - } - - err = MFXVideoCORE_GetHandle(device_hwctx->session, handle_type, &handle); - if (err < 0) - return ff_qsvvpp_print_error(ctx, err, "Error getting the session handle"); - else if (err > 0) { - ff_qsvvpp_print_warning(ctx, err, "Warning in getting the session handle"); - return AVERROR_UNKNOWN; - } - - /* create a "slave" session with those same properties, to be used for - * actual scaling */ - err = MFXInit(impl, &ver, &s->session); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error initializing a session for scaling\n"); - return AVERROR_UNKNOWN; - } - - if (handle) { - err = MFXVideoCORE_SetHandle(s->session, handle_type, handle); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - } - - if (QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) { - err = MFXJoinSession(device_hwctx->session, s->session); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - } - - memset(&par, 0, sizeof(par)); - - if (opaque) { - s->surface_ptrs_in = av_calloc(in_frames_hwctx->nb_surfaces, - sizeof(*s->surface_ptrs_in)); - if (!s->surface_ptrs_in) - return AVERROR(ENOMEM); - for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) - s->surface_ptrs_in[i] = in_frames_hwctx->surfaces + i; - s->nb_surface_ptrs_in = in_frames_hwctx->nb_surfaces; - - s->surface_ptrs_out = av_calloc(out_frames_hwctx->nb_surfaces, - sizeof(*s->surface_ptrs_out)); - if (!s->surface_ptrs_out) - return AVERROR(ENOMEM); - for (i = 0; i < out_frames_hwctx->nb_surfaces; i++) - s->surface_ptrs_out[i] = out_frames_hwctx->surfaces + i; - s->nb_surface_ptrs_out = out_frames_hwctx->nb_surfaces; - - s->opaque_alloc.In.Surfaces = s->surface_ptrs_in; - s->opaque_alloc.In.NumSurface = s->nb_surface_ptrs_in; - s->opaque_alloc.In.Type = in_frames_hwctx->frame_type; - - s->opaque_alloc.Out.Surfaces = s->surface_ptrs_out; - s->opaque_alloc.Out.NumSurface = s->nb_surface_ptrs_out; - s->opaque_alloc.Out.Type = out_frames_hwctx->frame_type; - - s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION; - s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc); - - s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->opaque_alloc; - - par.IOPattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY; - } else { - mfxFrameAllocator frame_allocator = { - .pthis = ctx, - .Alloc = frame_alloc, - .Lock = frame_lock, - .Unlock = frame_unlock, - .GetHDL = frame_get_hdl, - .Free = frame_free, - }; - - s->mem_ids_in = av_calloc(in_frames_hwctx->nb_surfaces, - sizeof(*s->mem_ids_in)); - if (!s->mem_ids_in) - return AVERROR(ENOMEM); - for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) - s->mem_ids_in[i] = in_frames_hwctx->surfaces[i].Data.MemId; - s->nb_mem_ids_in = in_frames_hwctx->nb_surfaces; - - s->mem_ids_out = av_calloc(out_frames_hwctx->nb_surfaces, - sizeof(*s->mem_ids_out)); - if (!s->mem_ids_out) - return AVERROR(ENOMEM); - for (i = 0; i < out_frames_hwctx->nb_surfaces; i++) - s->mem_ids_out[i] = out_frames_hwctx->surfaces[i].Data.MemId; - s->nb_mem_ids_out = out_frames_hwctx->nb_surfaces; - - err = MFXVideoCORE_SetFrameAllocator(s->session, &frame_allocator); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; - - par.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY; - } - - memset(&s->scale_conf, 0, sizeof(mfxExtVPPScaling)); - s->scale_conf.Header.BufferId = MFX_EXTBUFF_VPP_SCALING; - s->scale_conf.Header.BufferSz = sizeof(mfxExtVPPScaling); - s->scale_conf.ScalingMode = s->mode; - s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->scale_conf; - av_log(ctx, AV_LOG_VERBOSE, "Scaling mode: %d\n", s->mode); - - par.ExtParam = s->ext_buffers; - par.NumExtParam = s->num_ext_buf; - - par.AsyncDepth = 1; // TODO async - - par.vpp.In = in_frames_hwctx->surfaces[0].Info; - par.vpp.Out = out_frames_hwctx->surfaces[0].Info; - - /* Apparently VPP requires the frame rate to be set to some value, otherwise - * init will fail (probably for the framerate conversion filter). Since we - * are only doing scaling here, we just invent an arbitrary - * value */ - par.vpp.In.FrameRateExtN = 25; - par.vpp.In.FrameRateExtD = 1; - par.vpp.Out.FrameRateExtN = 25; - par.vpp.Out.FrameRateExtD = 1; - - /* Print input memory mode */ - ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0x0F, "VPP"); - /* Print output memory mode */ - ff_qsvvpp_print_iopattern(ctx, par.IOPattern & 0xF0, "VPP"); - err = MFXVideoVPP_Init(s->session, &par); - if (err < 0) - return ff_qsvvpp_print_error(ctx, err, - "Error opening the VPP for scaling"); - else if (err > 0) { - ff_qsvvpp_print_warning(ctx, err, - "Warning in VPP initialization"); - return AVERROR_UNKNOWN; - } - - return 0; -} - -static int init_scale_session(AVFilterContext *ctx, int in_width, int in_height, - int out_width, int out_height) -{ - int ret; - - qsvscale_uninit(ctx); - - ret = init_out_pool(ctx, out_width, out_height); - if (ret < 0) - return ret; - - ret = init_out_session(ctx); - if (ret < 0) - return ret; - - return 0; -} - -static int qsvscale_config_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = outlink->src->inputs[0]; - QSVScaleContext *s = ctx->priv; - int64_t w, h; - double var_values[VARS_NB], res; - char *expr; - int ret; - - var_values[VAR_PI] = M_PI; - var_values[VAR_PHI] = M_PHI; - var_values[VAR_E] = M_E; - var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w; - var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h; - var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN; - var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN; - var_values[VAR_A] = (double) inlink->w / inlink->h; - var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? - (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1; - var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR]; - - /* evaluate width and height */ - av_expr_parse_and_eval(&res, (expr = s->w_expr), - var_names, var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx); - s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res; - if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr), - var_names, var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) - goto fail; - s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res; - /* evaluate again the width, as it may depend on the output height */ - if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr), - var_names, var_values, - NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) - goto fail; - s->w = res; - - w = s->w; - h = s->h; - - /* sanity check params */ - if (w < -1 || h < -1) { - av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n"); - return AVERROR(EINVAL); - } - if (w == -1 && h == -1) - s->w = s->h = 0; - - if (!(w = s->w)) - w = inlink->w; - if (!(h = s->h)) - h = inlink->h; - if (w == -1) - w = av_rescale(h, inlink->w, inlink->h); - if (h == -1) - h = av_rescale(w, inlink->h, inlink->w); - - if (w > INT_MAX || h > INT_MAX || - (h * inlink->w) > INT_MAX || - (w * inlink->h) > INT_MAX) - av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n"); - - outlink->w = w; - outlink->h = h; - - ret = init_scale_session(ctx, inlink->w, inlink->h, w, h); - if (ret < 0) - return ret; - - av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d\n", - inlink->w, inlink->h, outlink->w, outlink->h); - - if (inlink->sample_aspect_ratio.num) - outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h*inlink->w, - outlink->w*inlink->h}, - inlink->sample_aspect_ratio); - else - outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; - - return 0; - -fail: - av_log(ctx, AV_LOG_ERROR, - "Error when evaluating the expression '%s'\n", expr); - return ret; -} - -static int qsvscale_filter_frame(AVFilterLink *link, AVFrame *in) -{ - AVFilterContext *ctx = link->dst; - QSVScaleContext *s = ctx->priv; - AVFilterLink *outlink = ctx->outputs[0]; - - mfxSyncPoint sync = NULL; - mfxStatus err; - - AVFrame *out = NULL; - int ret = 0; - - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) { - ret = AVERROR(ENOMEM); - goto fail; - } - - do { - err = MFXVideoVPP_RunFrameVPPAsync(s->session, - (mfxFrameSurface1*)in->data[3], - (mfxFrameSurface1*)out->data[3], - NULL, &sync); - if (err == MFX_WRN_DEVICE_BUSY) - av_usleep(1); - } while (err == MFX_WRN_DEVICE_BUSY); - - if (err < 0) { - ret = ff_qsvvpp_print_error(ctx, err, "Error during scaling"); - goto fail; - } - - if (!sync) { - av_log(ctx, AV_LOG_ERROR, "No sync during scaling\n"); - ret = AVERROR_UNKNOWN; - goto fail; - } - - do { - err = MFXVideoCORE_SyncOperation(s->session, sync, 1000); - } while (err == MFX_WRN_IN_EXECUTION); - if (err < 0) { - ret = ff_qsvvpp_print_error(ctx, err, "Error synchronizing the operation"); - goto fail; - } - - ret = av_frame_copy_props(out, in); - if (ret < 0) - goto fail; - - out->width = outlink->w; - out->height = outlink->h; - - av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den, - (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w, - (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h, - INT_MAX); - - av_frame_free(&in); - return ff_filter_frame(outlink, out); -fail: - av_frame_free(&in); - av_frame_free(&out); - return ret; -} - -#define OFFSET(x) offsetof(QSVScaleContext, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM -static const AVOption options[] = { - { "w", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, { .str = "iw" }, .flags = FLAGS }, - { "h", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str = "ih" }, .flags = FLAGS }, - { "format", "Output pixel format", OFFSET(format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS }, - - { "mode", "set scaling mode", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT}, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, FLAGS, "mode"}, - { "low_power", "low power mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "mode"}, - { "hq", "high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_QUALITY}, INT_MIN, INT_MAX, FLAGS, "mode"}, - - { NULL }, -}; - -static const AVClass qsvscale_class = { - .class_name = "scale_qsv", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; - -static const AVFilterPad qsvscale_inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = qsvscale_filter_frame, - }, -}; - -static const AVFilterPad qsvscale_outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = qsvscale_config_props, - }, -}; - -const AVFilter ff_vf_scale_qsv = { - .name = "scale_qsv", - .description = NULL_IF_CONFIG_SMALL("QuickSync video scaling and format conversion"), - - .init = qsvscale_init, - .uninit = qsvscale_uninit, - - .priv_size = sizeof(QSVScaleContext), - .priv_class = &qsvscale_class, - - FILTER_INPUTS(qsvscale_inputs), - FILTER_OUTPUTS(qsvscale_outputs), - - FILTER_SINGLE_PIXFMT(AV_PIX_FMT_QSV), - - .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, -}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scdet.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scdet.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scdet.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_scdet.c 2023-03-03 13:29:59.000000000 +0000 @@ -163,14 +163,14 @@ snprintf(buf, sizeof(buf), "%0.3f", s->scene_score); set_meta(s, frame, "lavfi.scd.score", buf); - if (s->scene_score > s->threshold) { + if (s->scene_score >= s->threshold) { av_log(s, AV_LOG_INFO, "lavfi.scd.score: %.3f, lavfi.scd.time: %s\n", s->scene_score, av_ts2timestr(frame->pts, &inlink->time_base)); set_meta(s, frame, "lavfi.scd.time", av_ts2timestr(frame->pts, &inlink->time_base)); } if (s->sc_pass) { - if (s->scene_score > s->threshold) + if (s->scene_score >= s->threshold) return ff_filter_frame(outlink, frame); else { av_frame_free(&frame); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_showinfo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_showinfo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_showinfo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_showinfo.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,7 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/video_enc_params.h" #include "libavutil/detection_bbox.h" +#include "libavutil/ambient_viewing_environment.h" #include "libavutil/uuid.h" #include "avfilter.h" @@ -68,7 +69,6 @@ const AVSphericalMapping *spherical = (const AVSphericalMapping *)sd->data; double yaw, pitch, roll; - av_log(ctx, AV_LOG_INFO, "spherical information: "); if (sd->size < sizeof(*spherical)) { av_log(ctx, AV_LOG_ERROR, "invalid data\n"); return; @@ -106,7 +106,6 @@ { const AVStereo3D *stereo; - av_log(ctx, AV_LOG_INFO, "stereoscopic information: "); if (sd->size < sizeof(*stereo)) { av_log(ctx, AV_LOG_ERROR, "invalid data\n"); return; @@ -150,7 +149,6 @@ } nb_rois = sd->size / roi_size; - av_log(ctx, AV_LOG_INFO, "Regions Of Interest(ROI) information:\n"); for (int i = 0; i < nb_rois; i++) { roi = (const AVRegionOfInterest *)(sd->data + roi_size * i); av_log(ctx, AV_LOG_INFO, "index: %d, region: (%d, %d) -> (%d, %d), qp offset: %d/%d.\n", @@ -166,7 +164,6 @@ header = (const AVDetectionBBoxHeader *)sd->data; nb_bboxes = header->nb_bboxes; - av_log(ctx, AV_LOG_INFO, "detection bounding boxes:\n"); av_log(ctx, AV_LOG_INFO, "source: %s\n", header->source); for (int i = 0; i < nb_bboxes; i++) { @@ -187,7 +184,6 @@ { const AVMasteringDisplayMetadata *mastering_display; - av_log(ctx, AV_LOG_INFO, "mastering display: "); if (sd->size < sizeof(*mastering_display)) { av_log(ctx, AV_LOG_ERROR, "invalid data\n"); return; @@ -213,7 +209,6 @@ { AVDynamicHDRPlus *hdr_plus; - av_log(ctx, AV_LOG_INFO, "HDR10+ metadata: "); if (sd->size < sizeof(*hdr_plus)) { av_log(ctx, AV_LOG_ERROR, "invalid data\n"); return; @@ -313,7 +308,6 @@ { AVDynamicHDRVivid *hdr_vivid; - av_log(ctx, AV_LOG_INFO, "HDR Vivid metadata: "); if (sd->size < sizeof(*hdr_vivid)) { av_log(ctx, AV_LOG_ERROR, "invalid hdr vivid data\n"); return; @@ -396,7 +390,7 @@ { const AVContentLightMetadata *metadata = (const AVContentLightMetadata *)sd->data; - av_log(ctx, AV_LOG_INFO, "Content Light Level information: " + av_log(ctx, AV_LOG_INFO, "MaxCLL=%d, MaxFALL=%d", metadata->MaxCLL, metadata->MaxFALL); } @@ -406,7 +400,7 @@ const AVVideoEncParams *par = (const AVVideoEncParams *)sd->data; int plane, acdc; - av_log(ctx, AV_LOG_INFO, "video encoding parameters: type %d; ", par->type); + av_log(ctx, AV_LOG_INFO, "type %d; ", par->type); if (par->qp) av_log(ctx, AV_LOG_INFO, "qp=%d; ", par->qp); for (plane = 0; plane < FF_ARRAY_ELEMS(par->delta_qp); plane++) @@ -430,7 +424,6 @@ return; } - av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); av_log(ctx, AV_LOG_INFO, "UUID=" AV_PRI_UUID "\n", AV_UUID_ARG(user_data)); av_log(ctx, AV_LOG_INFO, "User Data="); @@ -453,7 +446,7 @@ return; } - av_log(ctx, AV_LOG_INFO, "film grain parameters: type %s; ", film_grain_type_names[fgp->type]); + av_log(ctx, AV_LOG_INFO, "type %s; ", film_grain_type_names[fgp->type]); av_log(ctx, AV_LOG_INFO, "seed=%"PRIu64"; ", fgp->seed); switch (fgp->type) { @@ -513,7 +506,6 @@ const AVDOVIDataMapping *mapping = av_dovi_get_mapping(dovi); const AVDOVIColorMetadata *color = av_dovi_get_color(dovi); - av_log(ctx, AV_LOG_INFO, "Dolby Vision Metadata:\n"); av_log(ctx, AV_LOG_INFO, " rpu_type=%"PRIu8"; ", hdr->rpu_type); av_log(ctx, AV_LOG_INFO, "rpu_format=%"PRIu16"; ", hdr->rpu_format); av_log(ctx, AV_LOG_INFO, "vdr_rpu_profile=%"PRIu8"; ", hdr->vdr_rpu_profile); @@ -610,6 +602,17 @@ av_log(ctx, AV_LOG_INFO, "source_diagonal=%"PRIu16"; ", color->source_diagonal); } +static void dump_ambient_viewing_environment(AVFilterContext *ctx, const AVFrameSideData *sd) +{ + const AVAmbientViewingEnvironment *ambient_viewing_environment = + (const AVAmbientViewingEnvironment *)sd->data; + + av_log(ctx, AV_LOG_INFO, "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f", + av_q2d(ambient_viewing_environment->ambient_illuminance), + av_q2d(ambient_viewing_environment->ambient_light_x), + av_q2d(ambient_viewing_environment->ambient_light_y)); +} + static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) { const char *color_range_str = av_color_range_name(frame->color_range); @@ -709,10 +712,13 @@ } av_log(ctx, AV_LOG_INFO, - "n:%4"PRId64" pts:%7s pts_time:%-7s pos:%9"PRId64" " + "n:%4"PRId64" pts:%7s pts_time:%-7s duration:%7"PRId64 + " duration_time:%-7s pos:%9"PRId64" " "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c ", inlink->frame_count_out, - av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), frame->pkt_pos, + av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), + frame->duration, av_ts2timestr(frame->duration, &inlink->time_base), + frame->pkt_pos, desc->name, frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den, frame->width, frame->height, @@ -744,16 +750,12 @@ for (i = 0; i < frame->nb_side_data; i++) { AVFrameSideData *sd = frame->side_data[i]; + const char *name = av_frame_side_data_name(sd->type); av_log(ctx, AV_LOG_INFO, " side data - "); + if (name) + av_log(ctx, AV_LOG_INFO, "%s: ", name); switch (sd->type) { - case AV_FRAME_DATA_PANSCAN: - av_log(ctx, AV_LOG_INFO, "pan/scan"); - break; - case AV_FRAME_DATA_A53_CC: - av_log(ctx, AV_LOG_INFO, "A/53 closed captions " - "(%"SIZE_SPECIFIER" bytes)", sd->size); - break; case AV_FRAME_DATA_SPHERICAL: dump_spherical(ctx, frame, sd); break; @@ -765,11 +767,11 @@ break; } case AV_FRAME_DATA_DISPLAYMATRIX: - av_log(ctx, AV_LOG_INFO, "displaymatrix: rotation of %.2f degrees", + av_log(ctx, AV_LOG_INFO, "rotation of %.2f degrees", av_display_rotation_get((int32_t *)sd->data)); break; case AV_FRAME_DATA_AFD: - av_log(ctx, AV_LOG_INFO, "afd: value of %"PRIu8, sd->data[0]); + av_log(ctx, AV_LOG_INFO, "value of %"PRIu8, sd->data[0]); break; case AV_FRAME_DATA_REGIONS_OF_INTEREST: dump_roi(ctx, sd); @@ -792,7 +794,7 @@ case AV_FRAME_DATA_GOP_TIMECODE: { char tcbuf[AV_TIMECODE_STR_SIZE]; av_timecode_make_mpeg_tc_string(tcbuf, *(int64_t *)(sd->data)); - av_log(ctx, AV_LOG_INFO, "GOP timecode - %s", tcbuf); + av_log(ctx, AV_LOG_INFO, "%s", tcbuf); break; } case AV_FRAME_DATA_VIDEO_ENC_PARAMS: @@ -807,9 +809,16 @@ case AV_FRAME_DATA_DOVI_METADATA: dump_dovi_metadata(ctx, sd); break; + case AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT: + dump_ambient_viewing_environment(ctx, sd); + break; default: - av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " - "(%"SIZE_SPECIFIER" bytes)\n", sd->type, sd->size); + if (name) + av_log(ctx, AV_LOG_INFO, + "(%"SIZE_SPECIFIER" bytes)", sd->size); + else + av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " + "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size); break; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signalstats.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signalstats.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signalstats.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signalstats.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "filters.h" #include "internal.h" enum FilterMode { @@ -565,7 +566,7 @@ int tothue = 0; int dify = 0, difu = 0, difv = 0; uint16_t masky = 0, masku = 0, maskv = 0; - + int ret; int filtot[FILT_NUMB] = {0}; AVFrame *prev; @@ -588,7 +589,16 @@ if (s->outfilter != FILTER_NONE) { out = av_frame_clone(in); - av_frame_make_writable(out); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + ret = ff_inlink_make_frame_writable(link, &out); + if (ret < 0) { + av_frame_free(&out); + av_frame_free(&in); + return ret; + } } ff_filter_execute(ctx, compute_sat_hue_metrics8, &td_huesat, @@ -790,7 +800,7 @@ int filtot[FILT_NUMB] = {0}; AVFrame *prev; - + int ret; AVFrame *sat = s->frame_sat; AVFrame *hue = s->frame_hue; const uint16_t *p_sat = (uint16_t *)sat->data[0]; @@ -810,7 +820,16 @@ if (s->outfilter != FILTER_NONE) { out = av_frame_clone(in); - av_frame_make_writable(out); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + ret = ff_inlink_make_frame_writable(link, &out); + if (ret < 0) { + av_frame_free(&out); + av_frame_free(&in); + return ret; + } } ff_filter_execute(ctx, compute_sat_hue_metrics16, &td_huesat, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signature.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signature.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signature.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_signature.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,13 +24,11 @@ * @see http://epubs.surrey.ac.uk/531590/1/MPEG-7%20Video%20Signature%20Author%27s%20Copy.pdf */ -#include #include "libavcodec/put_bits.h" #include "libavformat/avformat.h" #include "libavutil/opt.h" #include "libavutil/avstring.h" -#include "libavutil/intreadwrite.h" -#include "libavutil/timestamp.h" +#include "libavutil/file_open.h" #include "avfilter.h" #include "internal.h" #include "signature.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_sr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_sr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_sr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_sr.c 2023-03-03 13:29:59.000000000 +0000 @@ -159,8 +159,9 @@ sws_scale(ctx->sws_uv_scale, (const uint8_t **)(in->data + 2), in->linesize + 2, 0, ctx->sws_uv_height, out->data + 2, out->linesize + 2); } - - av_frame_free(&in); + if (in != out) { + av_frame_free(&in); + } return ff_filter_frame(outlink, out); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim360.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim360.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim360.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim360.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1766 @@ +/** + * Copyright (c) 2015-2021, Facebook, Inc. + * All rights reserved. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* Computes the Structural Similarity Metric between two 360 video streams. + * original SSIM algorithm: + * Z. Wang, A. C. Bovik, H. R. Sheikh and E. P. Simoncelli, + * "Image quality assessment: From error visibility to structural similarity," + * IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004. + * + * To improve speed, this implementation uses the standard approximation of + * overlapped 8x8 block sums, rather than the original gaussian weights. + * + * To address warping from 360 projections for videos with same + * projection and resolution, the 8x8 blocks sampled are weighted by + * their location in the image. + * + * To apply SSIM across projections and video sizes, we render the video on to + * a flat "tape" from which the 8x8 are selected and compared. + */ + +/* + * @file + * Caculate the SSIM between two input 360 videos. + */ + +#include + +#include "libavutil/avstring.h" +#include "libavutil/file_open.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "avfilter.h" +#include "drawutils.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "framesync.h" + +#define RIGHT 0 +#define LEFT 1 +#define TOP 2 +#define BOTTOM 3 +#define FRONT 4 +#define BACK 5 + +#define DEFAULT_HEATMAP_W 32 +#define DEFAULT_HEATMAP_H 16 + +#define M_PI_F ((float)M_PI) +#define M_PI_2_F ((float)M_PI_2) +#define M_PI_4_F ((float)M_PI_4) +#define M_SQRT2_F ((float)M_SQRT2) + +#define DEFAULT_EXPANSION_COEF 1.01f + +#define BARREL_THETA_RANGE (DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F) +#define BARREL_PHI_RANGE (DEFAULT_EXPANSION_COEF * M_PI_2_F) + +// Use fixed-point with 16 bit precision for fast bilinear math +#define FIXED_POINT_PRECISION 16 + +// Use 1MB per channel for the histogram to get 5-digit precise SSIM value +#define SSIM360_HIST_SIZE 131072 + +// The last number is a marker < 0 to mark end of list +static const double PERCENTILE_LIST[] = { + 1.0, 0.9, 0.8, 0.7, 0.6, + 0.5, 0.4, 0.3, 0.2, 0.1, 0, -1 +}; + +typedef enum StereoFormat { + STEREO_FORMAT_TB, + STEREO_FORMAT_LR, + STEREO_FORMAT_MONO, + STEREO_FORMAT_N +} StereoFormat; + +typedef enum Projection { + PROJECTION_CUBEMAP32, + PROJECTION_CUBEMAP23, + PROJECTION_BARREL, + PROJECTION_BARREL_SPLIT, + PROJECTION_EQUIRECT, + PROJECTION_N +} Projection; + +typedef struct Map2D { + int w, h; + double *value; +} Map2D; + +typedef struct HeatmapList { + Map2D map; + struct HeatmapList *next; +} HeatmapList; + +typedef struct SampleParams { + int stride; + int planewidth; + int planeheight; + int x_image_offset; + int y_image_offset; + int x_image_range; + int y_image_range; + int projection; + float expand_coef; +} SampleParams; + +typedef struct BilinearMap { + // Indices to the 4 samples to compute bilinear + int tli; + int tri; + int bli; + int bri; + + // Fixed point factors with which the above 4 sample vector's + // dot product needs to be computed for the final bilinear value + int tlf; + int trf; + int blf; + int brf; +} BilinearMap; + +typedef struct SSIM360Context { + const AVClass *class; + + FFFrameSync fs; + // Stats file configuration + FILE *stats_file; + char *stats_file_str; + + // Component properties + int nb_components; + double coefs[4]; + char comps[4]; + int max; + + // Channel configuration & properties + int compute_chroma; + + int is_rgb; + uint8_t rgba_map[4]; + + // Standard SSIM computation configuration & workspace + uint64_t frame_skip_ratio; + + int *temp; + uint64_t nb_ssim_frames; + uint64_t nb_net_frames; + double ssim360[4], ssim360_total; + double *ssim360_hist[4]; + double ssim360_hist_net[4]; + double ssim360_percentile_sum[4][256]; + + // 360 projection configuration & workspace + int ref_projection; + int main_projection; + int ref_stereo_format; + int main_stereo_format; + float ref_pad; + float main_pad; + int use_tape; + char *heatmap_str; + int default_heatmap_w; + int default_heatmap_h; + + Map2D density; + HeatmapList *heatmaps; + int ref_planewidth[4]; + int ref_planeheight[4]; + int main_planewidth[4]; + int main_planeheight[4]; + int tape_length[4]; + BilinearMap *ref_tape_map[4][2]; + BilinearMap *main_tape_map[4][2]; + float angular_resolution[4][2]; + double (*ssim360_plane)( + uint8_t *main, int main_stride, + uint8_t *ref, int ref_stride, + int width, int height, void *temp, + int max, Map2D density); +} SSIM360Context; + +#define OFFSET(x) offsetof(SSIM360Context, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption ssim360_options[] = { + { "stats_file", "Set file where to store per-frame difference information", + OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, + { "f", "Set file where to store per-frame difference information", + OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, + + { "compute_chroma", + "Specifies if non-luma channels must be computed", + OFFSET(compute_chroma), AV_OPT_TYPE_INT, {.i64 = 1}, + 0, 1, .flags = FLAGS }, + + { "frame_skip_ratio", + "Specifies the number of frames to be skipped from evaluation, for every evaluated frame", + OFFSET(frame_skip_ratio), AV_OPT_TYPE_INT, {.i64 = 0}, + 0, 1000000, .flags = FLAGS }, + + { "ref_projection", "projection of the reference video", + OFFSET(ref_projection), AV_OPT_TYPE_INT, {.i64 = PROJECTION_EQUIRECT}, + 0, PROJECTION_N - 1, .flags = FLAGS, "projection" }, + + { "e", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_EQUIRECT}, 0, 0, FLAGS, "projection" }, + { "equirect", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_EQUIRECT}, 0, 0, FLAGS, "projection" }, + { "c3x2", "cubemap 3x2", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_CUBEMAP32}, 0, 0, FLAGS, "projection" }, + { "c2x3", "cubemap 2x3", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_CUBEMAP23}, 0, 0, FLAGS, "projection" }, + { "barrel", "barrel facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_BARREL}, 0, 0, FLAGS, "projection" }, + { "barrelsplit", "barrel split facebook's 360 format", 0, AV_OPT_TYPE_CONST, {.i64 = PROJECTION_BARREL_SPLIT}, 0, 0, FLAGS, "projection" }, + + { "main_projection", "projection of the main video", + OFFSET(main_projection), AV_OPT_TYPE_INT, {.i64 = PROJECTION_N}, + 0, PROJECTION_N, .flags = FLAGS, "projection" }, + + { "ref_stereo", "stereo format of the reference video", + OFFSET(ref_stereo_format), AV_OPT_TYPE_INT, {.i64 = STEREO_FORMAT_MONO}, + 0, STEREO_FORMAT_N - 1, .flags = FLAGS, "stereo_format" }, + + { "mono", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = STEREO_FORMAT_MONO }, 0, 0, FLAGS, "stereo_format" }, + { "tb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = STEREO_FORMAT_TB }, 0, 0, FLAGS, "stereo_format" }, + { "lr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = STEREO_FORMAT_LR }, 0, 0, FLAGS, "stereo_format" }, + + { "main_stereo", "stereo format of main video", + OFFSET(main_stereo_format), AV_OPT_TYPE_INT, {.i64 = STEREO_FORMAT_N}, + 0, STEREO_FORMAT_N, .flags = FLAGS, "stereo_format" }, + + { "ref_pad", + "Expansion (padding) coefficient for each cube face of the reference video", + OFFSET(ref_pad), AV_OPT_TYPE_FLOAT, {.dbl = .0f}, 0, 10, .flags = FLAGS }, + + { "main_pad", + "Expansion (padding) coeffiecient for each cube face of the main video", + OFFSET(main_pad), AV_OPT_TYPE_FLOAT, {.dbl = .0f}, 0, 10, .flags = FLAGS }, + + { "use_tape", + "Specifies if the tape based SSIM 360 algorithm must be used independent of the input video types", + OFFSET(use_tape), AV_OPT_TYPE_INT, {.i64 = 0}, + 0, 1, .flags = FLAGS }, + + { "heatmap_str", + "Heatmap data for view-based evaluation. For heatmap file format, please refer to EntSphericalVideoHeatmapData.", + OFFSET(heatmap_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, .flags = FLAGS }, + + { "default_heatmap_width", + "Default heatmap dimension. Will be used when dimension is not specified in heatmap data.", + OFFSET(default_heatmap_w), AV_OPT_TYPE_INT, {.i64 = 32}, 1, 4096, .flags = FLAGS }, + + { "default_heatmap_height", + "Default heatmap dimension. Will be used when dimension is not specified in heatmap data.", + OFFSET(default_heatmap_h), AV_OPT_TYPE_INT, {.i64 = 16}, 1, 4096, .flags = FLAGS }, + + { NULL } +}; + +FRAMESYNC_DEFINE_CLASS(ssim360, SSIM360Context, fs); + +static void set_meta(AVDictionary **metadata, const char *key, char comp, float d) +{ + char value[128]; + snprintf(value, sizeof(value), "%0.2f", d); + if (comp) { + char key2[128]; + snprintf(key2, sizeof(key2), "%s%c", key, comp); + av_dict_set(metadata, key2, value, 0); + } else { + av_dict_set(metadata, key, value, 0); + } +} + +static void map_uninit(Map2D *map) +{ + av_freep(&map->value); +} + +static int map_init(Map2D *map, int w, int h) +{ + map->value = av_calloc(h * w, sizeof(*map->value)); + if (!map->value) + return AVERROR(ENOMEM); + + map->h = h; + map->w = w; + + return 0; +} + +static void map_list_free(HeatmapList **pl) +{ + HeatmapList *l = *pl; + + while (l) { + HeatmapList *next = l->next; + map_uninit(&l->map); + av_freep(&l); + l = next; + } + + *pl = NULL; +} + +static int map_alloc(HeatmapList **pl, int w, int h) +{ + HeatmapList *l; + int ret; + + l = av_mallocz(sizeof(*l)); + if (!l) + return AVERROR(ENOMEM); + + ret = map_init(&l->map, w, h); + if (ret < 0) { + av_freep(&l); + return ret; + } + + *pl = l; + return 0; +} + +static void +ssim360_4x4xn_16bit(const uint8_t *main8, ptrdiff_t main_stride, + const uint8_t *ref8, ptrdiff_t ref_stride, + int64_t (*sums)[4], int width) +{ + const uint16_t *main16 = (const uint16_t *)main8; + const uint16_t *ref16 = (const uint16_t *)ref8; + + main_stride >>= 1; + ref_stride >>= 1; + + for (int z = 0; z < width; z++) { + uint64_t s1 = 0, s2 = 0, ss = 0, s12 = 0; + + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 4; x++) { + unsigned a = main16[x + y * main_stride]; + unsigned b = ref16[x + y * ref_stride]; + + s1 += a; + s2 += b; + ss += a*a; + ss += b*b; + s12 += a*b; + } + } + + sums[z][0] = s1; + sums[z][1] = s2; + sums[z][2] = ss; + sums[z][3] = s12; + main16 += 4; + ref16 += 4; + } +} + +static void +ssim360_4x4xn_8bit(const uint8_t *main, ptrdiff_t main_stride, + const uint8_t *ref, ptrdiff_t ref_stride, + int (*sums)[4], int width) +{ + for (int z = 0; z < width; z++) { + uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0; + + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 4; x++) { + int a = main[x + y * main_stride]; + int b = ref[x + y * ref_stride]; + + s1 += a; + s2 += b; + ss += a*a; + ss += b*b; + s12 += a*b; + } + } + + sums[z][0] = s1; + sums[z][1] = s2; + sums[z][2] = ss; + sums[z][3] = s12; + main += 4; + ref += 4; + } +} + +static float ssim360_end1x(int64_t s1, int64_t s2, int64_t ss, int64_t s12, int max) +{ + int64_t ssim_c1 = (int64_t)(.01 * .01 * max * max * 64 + .5); + int64_t ssim_c2 = (int64_t)(.03 * .03 * max * max * 64 * 63 + .5); + + int64_t fs1 = s1; + int64_t fs2 = s2; + int64_t fss = ss; + int64_t fs12 = s12; + int64_t vars = fss * 64 - fs1 * fs1 - fs2 * fs2; + int64_t covar = fs12 * 64 - fs1 * fs2; + + return (float)(2 * fs1 * fs2 + ssim_c1) * (float)(2 * covar + ssim_c2) + / ((float)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (float)(vars + ssim_c2)); +} + +static float ssim360_end1(int s1, int s2, int ss, int s12) +{ + static const int ssim_c1 = (int)(.01*.01*255*255*64 + .5); + static const int ssim_c2 = (int)(.03*.03*255*255*64*63 + .5); + + int fs1 = s1; + int fs2 = s2; + int fss = ss; + int fs12 = s12; + int vars = fss * 64 - fs1 * fs1 - fs2 * fs2; + int covar = fs12 * 64 - fs1 * fs2; + + return (float)(2 * fs1 * fs2 + ssim_c1) * (float)(2 * covar + ssim_c2) + / ((float)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (float)(vars + ssim_c2)); +} + +static double +ssim360_endn_16bit(const int64_t (*sum0)[4], const int64_t (*sum1)[4], + int width, int max, + double *density_map, int map_width, double *total_weight) +{ + double ssim360 = 0.0, weight; + + for (int i = 0; i < width; i++) { + weight = density_map ? density_map[(int) ((0.5 + i) / width * map_width)] : 1.0; + ssim360 += weight * ssim360_end1x( + sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0], + sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1], + sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2], + sum0[i][3] + sum0[i + 1][3] + sum1[i][3] + sum1[i + 1][3], + max); + *total_weight += weight; + } + return ssim360; +} + +static double +ssim360_endn_8bit(const int (*sum0)[4], const int (*sum1)[4], int width, + double *density_map, int map_width, double *total_weight) +{ + double ssim360 = 0.0, weight; + + for (int i = 0; i < width; i++) { + weight = density_map ? density_map[(int) ((0.5 + i) / width * map_width)] : 1.0; + ssim360 += weight * ssim360_end1( + sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0], + sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1], + sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2], + sum0[i][3] + sum0[i + 1][3] + sum1[i][3] + sum1[i + 1][3]); + *total_weight += weight; + } + return ssim360; +} + +static double +ssim360_plane_16bit(uint8_t *main, int main_stride, + uint8_t *ref, int ref_stride, + int width, int height, void *temp, + int max, Map2D density) +{ + int z = 0; + double ssim360 = 0.0; + int64_t (*sum0)[4] = temp; + int64_t (*sum1)[4] = sum0 + (width >> 2) + 3; + double total_weight = 0.0; + + width >>= 2; + height >>= 2; + + for (int y = 1; y < height; y++) { + for (; z <= y; z++) { + FFSWAP(void*, sum0, sum1); + ssim360_4x4xn_16bit(&main[4 * z * main_stride], main_stride, + &ref[4 * z * ref_stride], ref_stride, + sum0, width); + } + ssim360 += ssim360_endn_16bit( + (const int64_t (*)[4])sum0, (const int64_t (*)[4])sum1, + width - 1, max, + density.value ? density.value + density.w * ((int) ((z - 1.0) / height * density.h)) : NULL, + density.w, &total_weight); + } + + return (double) (ssim360 / total_weight); +} + +static double +ssim360_plane_8bit(uint8_t *main, int main_stride, + uint8_t *ref, int ref_stride, + int width, int height, void *temp, + int max, Map2D density) +{ + int z = 0; + double ssim360 = 0.0; + int (*sum0)[4] = temp; + int (*sum1)[4] = sum0 + (width >> 2) + 3; + double total_weight = 0.0; + + width >>= 2; + height >>= 2; + + for (int y = 1; y < height; y++) { + for (; z <= y; z++) { + FFSWAP(void*, sum0, sum1); + ssim360_4x4xn_8bit( + &main[4 * z * main_stride], main_stride, + &ref[4 * z * ref_stride], ref_stride, + sum0, width); + } + ssim360 += ssim360_endn_8bit( + (const int (*)[4])sum0, (const int (*)[4])sum1, width - 1, + density.value ? density.value + density.w * ((int) ((z - 1.0) / height * density.h)) : NULL, + density.w, &total_weight); + } + + return (double) (ssim360 / total_weight); +} + +static double ssim360_db(double ssim360, double weight) +{ + return 10 * log10(weight / (weight - ssim360)); +} + +static int get_bilinear_sample(const uint8_t *data, BilinearMap *m, int max_value) +{ + static const int fixed_point_half = 1 << (FIXED_POINT_PRECISION - 1); + static const int inv_byte_mask = UINT_MAX << 8; + + int tl, tr, bl, br, v; + + if (max_value & inv_byte_mask) { + uint16_t *data16 = (uint16_t *)data; + tl = data16[m->tli]; + tr = data16[m->tri]; + bl = data16[m->bli]; + br = data16[m->bri]; + } else { + tl = data[m->tli]; + tr = data[m->tri]; + bl = data[m->bli]; + br = data[m->bri]; + } + + v = m->tlf * tl + + m->trf * tr + + m->blf * bl + + m->brf * br; + + // Round by half, and revert the fixed-point offset + return ((v + fixed_point_half) >> FIXED_POINT_PRECISION) & max_value; +} + +static void +ssim360_4x4x2_tape(const uint8_t *main, BilinearMap *main_maps, + const uint8_t *ref, BilinearMap *ref_maps, + int offset_y, int max_value, int (*sums)[4]) +{ + int offset_x = 0; + + // Two blocks along the width + for (int z = 0; z < 2; z++) { + int s1 = 0, s2 = 0, ss = 0, s12 = 0; + + // 4 pixel block from (offset_x, offset_y) + for (int y = offset_y; y < offset_y + 4; y++) { + int y_stride = y << 3; + for (int x = offset_x; x < offset_x + 4; x++) { + int map_index = x + y_stride; + int a = get_bilinear_sample(main, main_maps + map_index, max_value); + int b = get_bilinear_sample(ref, ref_maps + map_index, max_value); + + s1 += a; + s2 += b; + ss += a*a; + ss += b*b; + s12 += a*b; + } + } + + sums[z][0] = s1; + sums[z][1] = s2; + sums[z][2] = ss; + sums[z][3] = s12; + + offset_x += 4; + } +} + +static float get_radius_between_negative_and_positive_pi(float theta) +{ + int floor_theta_by_2pi, floor_theta_by_pi; + + // Convert theta to range [0, 2*pi] + floor_theta_by_2pi = (int)(theta / (2.0f * M_PI_F)) - (theta < 0.0f); + theta -= 2.0f * M_PI_F * floor_theta_by_2pi; + + // Convert theta to range [-pi, pi] + floor_theta_by_pi = theta / M_PI_F; + theta -= 2.0f * M_PI_F * floor_theta_by_pi; + return FFMIN(M_PI_F, FFMAX(-M_PI_F, theta)); +} + +static float get_heat(HeatmapList *heatmaps, float angular_resoluation, float norm_tape_pos) +{ + float pitch, yaw, norm_pitch, norm_yaw; + int w, h; + + if (!heatmaps) + return 1.0f; + + pitch = asinf(norm_tape_pos*2); + yaw = M_PI_2_F * pitch / angular_resoluation; + yaw = get_radius_between_negative_and_positive_pi(yaw); + + // normalize into [0,1] + norm_pitch = 1.0f - (pitch / M_PI_F + 0.5f); + norm_yaw = yaw / 2.0f / M_PI_F + 0.5f; + + // get heat on map + w = FFMIN(heatmaps->map.w - 1, FFMAX(0, heatmaps->map.w * norm_yaw)); + h = FFMIN(heatmaps->map.h - 1, FFMAX(0, heatmaps->map.h * norm_pitch)); + return heatmaps->map.value[h * heatmaps->map.w + w]; +} + +static double +ssim360_tape(uint8_t *main, BilinearMap *main_maps, + uint8_t *ref, BilinearMap *ref_maps, + int tape_length, int max_value, void *temp, + double *ssim360_hist, double *ssim360_hist_net, + float angular_resolution, HeatmapList *heatmaps) +{ + int horizontal_block_count = 2; + int vertical_block_count = tape_length >> 2; + + int z = 0, y; + // Since the tape will be very long and we need to average over all 8x8 blocks, use double + double ssim360 = 0.0; + double sum_weight = 0.0; + + int (*sum0)[4] = temp; + int (*sum1)[4] = sum0 + horizontal_block_count + 3; + + for (y = 1; y < vertical_block_count; y++) { + int fs1, fs2, fss, fs12, hist_index; + float norm_tape_pos, weight; + double sample_ssim360; + + for (; z <= y; z++) { + FFSWAP(void*, sum0, sum1); + ssim360_4x4x2_tape(main, main_maps, ref, ref_maps, z*4, max_value, sum0); + } + + // Given we have only one 8x8 block, following sums fit within 26 bits even for 10bit videos + fs1 = sum0[0][0] + sum0[1][0] + sum1[0][0] + sum1[1][0]; + fs2 = sum0[0][1] + sum0[1][1] + sum1[0][1] + sum1[1][1]; + fss = sum0[0][2] + sum0[1][2] + sum1[0][2] + sum1[1][2]; + fs12 = sum0[0][3] + sum0[1][3] + sum1[0][3] + sum1[1][3]; + + if (max_value > 255) { + // Since we need high precision to multiply fss / fs12 by 64, use double + double ssim_c1_d = .01*.01*64*max_value*max_value; + double ssim_c2_d = .03*.03*64*63*max_value*max_value; + + double vars = 64. * fss - 1. * fs1 * fs1 - 1. * fs2 * fs2; + double covar = 64. * fs12 - 1.*fs1 * fs2; + sample_ssim360 = (2. * fs1 * fs2 + ssim_c1_d) * (2. * covar + ssim_c2_d) + / ((1. * fs1 * fs1 + 1. * fs2 * fs2 + ssim_c1_d) * (1. * vars + ssim_c2_d)); + } else { + static const int ssim_c1 = (int)(.01*.01*255*255*64 + .5); + static const int ssim_c2 = (int)(.03*.03*255*255*64*63 + .5); + + int vars = fss * 64 - fs1 * fs1 - fs2 * fs2; + int covar = fs12 * 64 - fs1 * fs2; + sample_ssim360 = (double)(2 * fs1 * fs2 + ssim_c1) * (double)(2 * covar + ssim_c2) + / ((double)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (double)(vars + ssim_c2)); + } + + hist_index = (int)(sample_ssim360 * ((double)SSIM360_HIST_SIZE - .5)); + hist_index = av_clip(hist_index, 0, SSIM360_HIST_SIZE - 1); + + norm_tape_pos = (y - 0.5f) / (vertical_block_count - 1.0f) - 0.5f; + // weight from an input heatmap if available, otherwise weight = 1.0 + weight = get_heat(heatmaps, angular_resolution, norm_tape_pos); + ssim360_hist[hist_index] += weight; + *ssim360_hist_net += weight; + + ssim360 += (sample_ssim360 * weight); + sum_weight += weight; + } + + return ssim360 / sum_weight; +} + +static void compute_bilinear_map(SampleParams *p, BilinearMap *m, float x, float y) +{ + float fixed_point_scale = (float)(1 << FIXED_POINT_PRECISION); + + // All operations in here will fit in the 22 bit mantissa of floating point, + // since the fixed point precision is well under 22 bits + float x_image = av_clipf(x * p->x_image_range, 0, p->x_image_range) + p->x_image_offset; + float y_image = av_clipf(y * p->y_image_range, 0, p->y_image_range) + p->y_image_offset; + + int x_floor = x_image; + int y_floor = y_image; + float x_diff = x_image - x_floor; + float y_diff = y_image - y_floor; + + int x_ceil = x_floor + (x_diff > 1e-6); + int y_ceil = y_floor + (y_diff > 1e-6); + float x_inv_diff = 1.0f - x_diff; + float y_inv_diff = 1.0f - y_diff; + + // Indices of the 4 samples from source frame + m->tli = x_floor + y_floor * p->stride; + m->tri = x_ceil + y_floor * p->stride; + m->bli = x_floor + y_ceil * p->stride; + m->bri = x_ceil + y_ceil * p->stride; + + // Scale to be applied to each of the 4 samples from source frame + m->tlf = x_inv_diff * y_inv_diff * fixed_point_scale; + m->trf = x_diff * y_inv_diff * fixed_point_scale; + m->blf = x_inv_diff * y_diff * fixed_point_scale; + m->brf = x_diff * y_diff * fixed_point_scale; +} + +static void get_equirect_map(float phi, float theta, float *x, float *y) +{ + *x = 0.5f + theta / (2.0f * M_PI_F); + // y increases downwards + *y = 0.5f - phi / M_PI_F; +} + +static void get_barrel_map(float phi, float theta, float *x, float *y) +{ + float abs_phi = FFABS(phi); + + if (abs_phi <= M_PI_4_F) { + // Equirect region + *x = 0.8f * (0.5f + theta / BARREL_THETA_RANGE); + // y increases downwards + *y = 0.5f - phi / BARREL_PHI_RANGE; + } else { + // Radial ratio on a unit circle = cot(abs_phi) / (expansion_cefficient). + // Using cos(abs_phi)/sin(abs_phi) explicitly to avoid division by zero + float radial_ratio = cosf(abs_phi) / (sinf(abs_phi) * DEFAULT_EXPANSION_COEF); + float circle_x = radial_ratio * sinf(theta); + float circle_y = radial_ratio * cosf(theta); + float offset_y = 0.25f; + if (phi < 0) { + // Bottom circle: theta increases clockwise, and front is upward + circle_y *= -1.0f; + offset_y += 0.5f; + } + + *x = 0.8f + 0.1f * (1.0f + circle_x); + *y = offset_y + 0.25f * circle_y; + } +} + +static void get_barrel_split_map(float phi, float theta, float expand_coef, float *x, float *y) +{ + float abs_phi = FFABS(phi); + + // Front Face [-PI/2, PI/2] -> [0,1]. + // Back Face [PI/2, PI] and [-PI, -PI/2] -> [1, 2] + float radian_pi_theta = theta / M_PI_F + 0.5f; + int vFace; + + if (radian_pi_theta < 0.0f) + radian_pi_theta += 2.0f; + + // Front face at top (= 0), back face at bottom (= 1). + vFace = radian_pi_theta >= 1.0f; + + if (abs_phi <= M_PI_4_F) { + // Equirect region + *x = 2.0f / 3.0f * (0.5f + (radian_pi_theta - vFace - 0.5f) / expand_coef); + // y increases downwards + *y = 0.25f + 0.5f * vFace - phi / (M_PI_F * expand_coef); + } else { + // Radial ratio on a unit circle = cot(abs_phi) / (expansion_cefficient). + // Using cos(abs_phi)/sin(abs_phi) explicitly to avoid division by zero + float radial_ratio = cosf(abs_phi) / (sinf(abs_phi) * expand_coef); + float circle_x = radial_ratio * sinf(theta); + float circle_y = radial_ratio * cosf(theta); + float offset_y = 0.25f; + + if (vFace == 1) { + // Back Face: Flip + circle_x *= -1.0f; + circle_y = (circle_y >= 0.0f) ? (1 - circle_y) : (-1 - circle_y); + offset_y += 0.5f; + + // Bottom circle: theta increases clockwise + if (phi < 0) + circle_y *= -1.0f; + } else { + // Front Face + // Bottom circle: theta increases clockwise + if (phi < 0) + circle_y *= -1.0f; + } + + *x = 2.0f / 3.0f + 0.5f / 3.0f * (1.0f + circle_x); + *y = offset_y + 0.25f * circle_y / expand_coef; // y direction of expand_coeff (margin) + } +} + +// Returns cube face, and provided face_x & face_y will range from [0, 1] +static int get_cubemap_face_map(float axis_vec_x, float axis_vec_y, float axis_vec_z, float *face_x, float *face_y) +{ + // To check if phi, theta hits the top / bottom faces, we check the hit point of + // the axis vector on planes y = 1 and y = -1, and see if x & z are within [-1, 1] + + // 0.577 < 1 / sqrt(3), which is less than the smallest sin(phi) falling on top/bottom faces + // This angle check will save computation from unnecessarily checking the top/bottom faces + if (FFABS(axis_vec_y) > 0.577f) { + float x_hit = axis_vec_x / FFABS(axis_vec_y); + float z_hit = axis_vec_z / axis_vec_y; + + if (FFABS(x_hit) <= 1.f && FFABS(z_hit) <= 1.f) { + *face_x = x_hit; + // y increases downwards + *face_y = z_hit; + return axis_vec_y > 0 ? TOP : BOTTOM; + } + } + + // Check for left / right faces + if (FFABS(axis_vec_x) > 0.577f) { + float z_hit = -axis_vec_z / axis_vec_x; + float y_hit = axis_vec_y / FFABS(axis_vec_x); + + if (FFABS(z_hit) <= 1.f && FFABS(y_hit) <= 1.f) { + *face_x = z_hit; + // y increases downwards + *face_y = -y_hit; + return axis_vec_x > 0 ? RIGHT : LEFT; + } + } + + // Front / back faces + *face_x = axis_vec_x / axis_vec_z; + // y increases downwards + *face_y = -axis_vec_y / FFABS(axis_vec_z); + + return axis_vec_z > 0 ? FRONT : BACK; +} + +static void get_cubemap32_map(float phi, float theta, float *x, float *y) +{ + // face_projection_map maps each cube face to an index representing the face on the projection + // The indices 0->5 for cubemap 32 goes as: + // [0, 1, 2] as row 1, left to right + // [3, 4, 5] as row 2, left to right + static const int face_projection_map[] = { + [RIGHT] = 0, [LEFT] = 1, [TOP] = 2, + [BOTTOM] = 3, [FRONT] = 4, [BACK] = 5, + }; + + float axis_vec_x = cosf(phi) * sinf(theta); + float axis_vec_y = sinf(phi); + float axis_vec_z = cosf(phi) * cosf(theta); + float face_x = 0, face_y = 0; + int face_index = get_cubemap_face_map(axis_vec_x, axis_vec_y, axis_vec_z, &face_x, &face_y); + + float x_offset = 1.f / 3.f * (face_projection_map[face_index] % 3); + float y_offset = .5f * (face_projection_map[face_index] / 3); + + *x = x_offset + (face_x / DEFAULT_EXPANSION_COEF + 1.f) / 6.f; + *y = y_offset + (face_y / DEFAULT_EXPANSION_COEF + 1.f) / 4.f; +} + +static void get_rotated_cubemap_map(float phi, float theta, float expand_coef, float *x, float *y) +{ + // face_projection_map maps each cube face to an index representing the face on the projection + // The indices 0->5 for rotated cubemap goes as: + // [0, 1] as row 1, left to right + // [2, 3] as row 2, left to right + // [4, 5] as row 3, left to right + static const int face_projection_map[] = { + [LEFT] = 0, [TOP] = 1, + [FRONT] = 2, [BACK] = 3, + [RIGHT] = 4, [BOTTOM] = 5, + }; + + float axis_yaw_vec_x, axis_yaw_vec_y, axis_yaw_vec_z; + float axis_pitch_vec_z, axis_pitch_vec_y; + float x_offset, y_offset; + float face_x = 0, face_y = 0; + int face_index; + + // Unrotate the cube and fix the face map: + // First undo the 45 degree yaw + theta += M_PI_4_F; + + // Now we are looking at the middle of an edge. So convert to axis vector & undo the pitch + axis_yaw_vec_x = cosf(phi) * sinf(theta); + axis_yaw_vec_y = sinf(phi); + axis_yaw_vec_z = cosf(phi) * cosf(theta); + + // The pitch axis is along +x, and has value of -45 degree. So, only y and z components change + axis_pitch_vec_z = (axis_yaw_vec_z - axis_yaw_vec_y) / M_SQRT2_F; + axis_pitch_vec_y = (axis_yaw_vec_y + axis_yaw_vec_z) / M_SQRT2_F; + + face_index = get_cubemap_face_map(axis_yaw_vec_x, axis_pitch_vec_y, axis_pitch_vec_z, &face_x, &face_y); + + // Correct for the orientation of the axes on the faces + if (face_index == LEFT || face_index == FRONT || face_index == RIGHT) { + // x increases downwards & y increases towards left + float upright_y = face_y; + face_y = face_x; + face_x = -upright_y; + } else if (face_index == TOP || face_index == BOTTOM) { + // turn the face upside-down for top and bottom + face_x *= -1.f; + face_y *= -1.f; + } + + x_offset = .5f * (face_projection_map[face_index] & 1); + y_offset = 1.f / 3.f * (face_projection_map[face_index] >> 1); + + *x = x_offset + (face_x / expand_coef + 1.f) / 4.f; + *y = y_offset + (face_y / expand_coef + 1.f) / 6.f; +} + +static void get_projected_map(float phi, float theta, SampleParams *p, BilinearMap *m) +{ + float x = 0, y = 0; + switch(p->projection) { +// TODO: Calculate for CDS + case PROJECTION_CUBEMAP23: + get_rotated_cubemap_map(phi, theta, p->expand_coef, &x, &y); + break; + case PROJECTION_CUBEMAP32: + get_cubemap32_map(phi, theta, &x, &y); + break; + case PROJECTION_BARREL: + get_barrel_map(phi, theta, &x, &y); + break; + case PROJECTION_BARREL_SPLIT: + get_barrel_split_map(phi, theta, p->expand_coef, &x, &y); + break; + // Assume PROJECTION_EQUIRECT as the default + case PROJECTION_EQUIRECT: + default: + get_equirect_map(phi, theta, &x, &y); + break; + } + compute_bilinear_map(p, m, x, y); +} + +static int tape_supports_projection(int projection) +{ + switch(projection) { + case PROJECTION_CUBEMAP23: + case PROJECTION_CUBEMAP32: + case PROJECTION_BARREL: + case PROJECTION_BARREL_SPLIT: + case PROJECTION_EQUIRECT: + return 1; + default: + return 0; + } +} + +static float get_tape_angular_resolution(int projection, float expand_coef, int image_width, int image_height) +{ + // NOTE: The angular resolution of a projected sphere is defined as + // the maximum possible horizontal angle of a pixel on the equator. + // We apply an intentional bias to the horizon as opposed to the meridian, + // since the view direction of most content is rarely closer to the poles + + switch(projection) { +// TODO: Calculate for CDS + case PROJECTION_CUBEMAP23: + // Approximating atanf(pixel_width / (half_edge_width * sqrt2)) = pixel_width / (half_face_width * sqrt2) + return expand_coef / (M_SQRT2_F * image_width / 4.f); + case PROJECTION_CUBEMAP32: + // Approximating atanf(pixel_width / half_face_width) = pixel_width / half_face_width + return DEFAULT_EXPANSION_COEF / (image_width / 6.f); + case PROJECTION_BARREL: + return FFMAX(BARREL_THETA_RANGE / (0.8f * image_width), BARREL_PHI_RANGE / image_height); + case PROJECTION_BARREL_SPLIT: + return FFMAX((expand_coef * M_PI_F) / (2.0f / 3.0f * image_width), + expand_coef * M_PI_2_F / (image_height / 2.0f)); + // Assume PROJECTION_EQUIRECT as the default + case PROJECTION_EQUIRECT: + default: + return FFMAX(2.0f * M_PI_F / image_width, M_PI_F / image_height); + } +} + +static int +generate_eye_tape_map(SSIM360Context *s, + int plane, int eye, + SampleParams *ref_sample_params, + SampleParams *main_sample_params) +{ + int ref_image_width = ref_sample_params->x_image_range + 1; + int ref_image_height = ref_sample_params->y_image_range + 1; + + float angular_resolution = + get_tape_angular_resolution(s->ref_projection, 1.f + s->ref_pad, + ref_image_width, ref_image_height); + + float conversion_factor = M_PI_2_F / (angular_resolution * angular_resolution); + float start_phi = -M_PI_2_F + 4.0f * angular_resolution; + float start_x = conversion_factor * sinf(start_phi); + float end_phi = M_PI_2_F - 3.0f * angular_resolution; + float end_x = conversion_factor * sinf(end_phi); + float x_range = end_x - start_x; + + // Ensure tape length is a multiple of 4, for full SSIM block coverage + int tape_length = s->tape_length[plane] = ((int)ROUNDED_DIV(x_range, 4)) << 2; + + s->ref_tape_map[plane][eye] = av_malloc_array(tape_length * 8, sizeof(BilinearMap)); + s->main_tape_map[plane][eye] = av_malloc_array(tape_length * 8, sizeof(BilinearMap)); + if (!s->ref_tape_map[plane][eye] || !s->main_tape_map[plane][eye]) + return AVERROR(ENOMEM); + + s->angular_resolution[plane][eye] = angular_resolution; + + // For easy memory access, we navigate the tape lengthwise on y + for (int y_index = 0; y_index < tape_length; y_index ++) { + int y_stride = y_index << 3; + + float x = start_x + x_range * (y_index / (tape_length - 1.0f)); + // phi will be in range [-pi/2, pi/2] + float mid_phi = asinf(x / conversion_factor); + + float theta = mid_phi * M_PI_2_F / angular_resolution; + theta = get_radius_between_negative_and_positive_pi(theta); + + for (int x_index = 0; x_index < 8; x_index ++) { + float phi = mid_phi + angular_resolution * (3.0f - x_index); + int tape_index = y_stride + x_index; + get_projected_map(phi, theta, ref_sample_params, &s->ref_tape_map [plane][eye][tape_index]); + get_projected_map(phi, theta, main_sample_params, &s->main_tape_map[plane][eye][tape_index]); + } + } + + return 0; +} + +static int generate_tape_maps(SSIM360Context *s, AVFrame *main, const AVFrame *ref) +{ + // A tape is a long segment with 8 pixels thickness, with the angular center at the middle (below 4th pixel). + // When it takes a full loop around a sphere, it will overlap the starting point at half the width from above. + int ref_stereo_format = s->ref_stereo_format; + int main_stereo_format = s->main_stereo_format; + int are_both_stereo = (main_stereo_format != STEREO_FORMAT_MONO) && (ref_stereo_format != STEREO_FORMAT_MONO); + int min_eye_count = 1 + are_both_stereo; + int ret; + + for (int i = 0; i < s->nb_components; i ++) { + int ref_width = s->ref_planewidth[i]; + int ref_height = s->ref_planeheight[i]; + int main_width = s->main_planewidth[i]; + int main_height = s->main_planeheight[i]; + + int is_ref_LR = (ref_stereo_format == STEREO_FORMAT_LR); + int is_ref_TB = (ref_stereo_format == STEREO_FORMAT_TB); + int is_main_LR = (main_stereo_format == STEREO_FORMAT_LR); + int is_main_TB = (main_stereo_format == STEREO_FORMAT_TB); + + int ref_image_width = is_ref_LR ? ref_width >> 1 : ref_width; + int ref_image_height = is_ref_TB ? ref_height >> 1 : ref_height; + int main_image_width = is_main_LR ? main_width >> 1 : main_width; + int main_image_height = is_main_TB ? main_height >> 1 : main_height; + + for (int eye = 0; eye < min_eye_count; eye ++) { + SampleParams ref_sample_params = { + .stride = ref->linesize[i], + .planewidth = ref_width, + .planeheight = ref_height, + .x_image_range = ref_image_width - 1, + .y_image_range = ref_image_height - 1, + .x_image_offset = is_ref_LR * eye * ref_image_width, + .y_image_offset = is_ref_TB * eye * ref_image_height, + .projection = s->ref_projection, + .expand_coef = 1.f + s->ref_pad, + }; + + SampleParams main_sample_params = { + .stride = main->linesize[i], + .planewidth = main_width, + .planeheight = main_height, + .x_image_range = main_image_width - 1, + .y_image_range = main_image_height - 1, + .x_image_offset = is_main_LR * eye * main_image_width, + .y_image_offset = is_main_TB * eye * main_image_height, + .projection = s->main_projection, + .expand_coef = 1.f + s->main_pad, + }; + + ret = generate_eye_tape_map(s, i, eye, &ref_sample_params, &main_sample_params); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int do_ssim360(FFFrameSync *fs) +{ + AVFilterContext *ctx = fs->parent; + SSIM360Context *s = ctx->priv; + AVFrame *master, *ref; + AVDictionary **metadata; + double c[4], ssim360v = 0.0, ssim360p50 = 0.0; + int i, ret; + int need_frame_skip = s->nb_net_frames % (s->frame_skip_ratio + 1); + HeatmapList* h_ptr = NULL; + + ret = ff_framesync_dualinput_get(fs, &master, &ref); + if (ret < 0) + return ret; + + s->nb_net_frames++; + + if (need_frame_skip) + return ff_filter_frame(ctx->outputs[0], master); + + metadata = &master->metadata; + + if (s->use_tape && !s->tape_length[0]) { + ret = generate_tape_maps(s, master, ref); + if (ret < 0) + return ret; + } + + for (i = 0; i < s->nb_components; i++) { + if (s->use_tape) { + c[i] = ssim360_tape(master->data[i], s->main_tape_map[i][0], + ref->data[i], s->ref_tape_map [i][0], + s->tape_length[i], s->max, s->temp, + s->ssim360_hist[i], &s->ssim360_hist_net[i], + s->angular_resolution[i][0], s->heatmaps); + + if (s->ref_tape_map[i][1]) { + c[i] += ssim360_tape(master->data[i], s->main_tape_map[i][1], + ref->data[i], s->ref_tape_map[i][1], + s->tape_length[i], s->max, s->temp, + s->ssim360_hist[i], &s->ssim360_hist_net[i], + s->angular_resolution[i][1], s->heatmaps); + c[i] /= 2.f; + } + } else { + c[i] = s->ssim360_plane(master->data[i], master->linesize[i], + ref->data[i], ref->linesize[i], + s->ref_planewidth[i], s->ref_planeheight[i], + s->temp, s->max, s->density); + } + + s->ssim360[i] += c[i]; + ssim360v += s->coefs[i] * c[i]; + } + + s->nb_ssim_frames++; + if (s->heatmaps) { + map_uninit(&s->heatmaps->map); + h_ptr = s->heatmaps; + s->heatmaps = s->heatmaps->next; + av_freep(&h_ptr); + } + s->ssim360_total += ssim360v; + + // Record percentiles from histogram and attach metadata when using tape + if (s->use_tape) { + int i, p, hist_indices[4]; + double hist_weight[4]; + + for (i = 0; i < s->nb_components; i++) { + hist_indices[i] = SSIM360_HIST_SIZE - 1; + hist_weight[i] = 0; + } + + for (p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) { + for (i = 0; i < s->nb_components; i++) { + double target_weight, ssim360p; + + // Target weight = total number of samples above the specified percentile + target_weight = (1. - PERCENTILE_LIST[p]) * s->ssim360_hist_net[i]; + target_weight = FFMAX(target_weight, 1); + while(hist_indices[i] >= 0 && hist_weight[i] < target_weight) { + hist_weight[i] += s->ssim360_hist[i][hist_indices[i]]; + hist_indices[i] --; + } + + ssim360p = (double)(hist_indices[i] + 1) / (double)(SSIM360_HIST_SIZE - 1); + if (PERCENTILE_LIST[p] == 0.5) + ssim360p50 += s->coefs[i] * ssim360p; + s->ssim360_percentile_sum[i][p] += ssim360p; + } + } + + for (i = 0; i < s->nb_components; i++) { + memset(s->ssim360_hist[i], 0, SSIM360_HIST_SIZE * sizeof(double)); + s->ssim360_hist_net[i] = 0; + } + + for (i = 0; i < s->nb_components; i++) { + int cidx = s->is_rgb ? s->rgba_map[i] : i; + set_meta(metadata, "lavfi.ssim360.", s->comps[i], c[cidx]); + } + + // Use p50 as the aggregated value + set_meta(metadata, "lavfi.ssim360.All", 0, ssim360p50); + set_meta(metadata, "lavfi.ssim360.dB", 0, ssim360_db(ssim360p50, 1.0)); + + if (s->stats_file) { + fprintf(s->stats_file, "n:%"PRId64" ", s->nb_ssim_frames); + + for (i = 0; i < s->nb_components; i++) { + int cidx = s->is_rgb ? s->rgba_map[i] : i; + fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]); + } + + fprintf(s->stats_file, "All:%f (%f)\n", ssim360p50, ssim360_db(ssim360p50, 1.0)); + } + } + + return ff_filter_frame(ctx->outputs[0], master); +} + +static int parse_heatmaps(void *logctx, HeatmapList **proot, + const char *data, int w, int h) +{ + HeatmapList *root = NULL; + HeatmapList **next = &root; + + int ret; + + // skip video id line + data = strchr(data, '\n'); + if (!data) { + av_log(logctx, AV_LOG_ERROR, "Invalid heatmap syntax\n"); + return AVERROR(EINVAL); + } + data++; + + while (*data) { + HeatmapList *cur; + char *line = av_get_token(&data, "\n"); + char *saveptr, *val; + int i; + + if (!line) { + ret = AVERROR(ENOMEM); + goto fail; + } + if (!line) { + av_freep(&line); + break; + } + + // first value is frame id + av_strtok(line, ",", &saveptr); + + ret = map_alloc(next, w, h); + if (ret < 0) + goto line_fail; + + cur = *next; + next = &cur->next; + + i = 0; + while ((val = av_strtok(NULL, ",", &saveptr))) { + if (i >= w * h) { + av_log(logctx, AV_LOG_ERROR, "Too many entries in a heat map\n"); + ret = AVERROR(EINVAL); + goto line_fail; + } + + cur->map.value[i++] = atof(val); + } + +line_fail: + av_freep(&line); + if (ret < 0) + goto fail; + } + + *proot = root; + + return 0; +fail: + map_list_free(&root); + return ret; +} + +static av_cold int init(AVFilterContext *ctx) +{ + SSIM360Context *s = ctx->priv; + int err; + + if (s->stats_file_str) { + if (!strcmp(s->stats_file_str, "-")) { + s->stats_file = stdout; + } else { + s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w"); + if (!s->stats_file) { + char buf[128]; + + err = AVERROR(errno); + av_strerror(err, buf, sizeof(buf)); + av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n", + s->stats_file_str, buf); + return err; + } + } + } + + if (s->use_tape && s->heatmap_str) { + err = parse_heatmaps(ctx, &s->heatmaps, s->heatmap_str, + s->default_heatmap_w, s->default_heatmap_h); + if (err < 0) + return err; + } + + s->fs.on_event = do_ssim360; + return 0; +} + +static int config_input_main(AVFilterLink *inlink) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + AVFilterContext *ctx = inlink->dst; + SSIM360Context *s = ctx->priv; + + s->main_planeheight[0] = inlink->h; + s->main_planeheight[3] = inlink->h; + s->main_planeheight[1] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + s->main_planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + + s->main_planewidth[0] = inlink->w; + s->main_planewidth[3] = inlink->w; + s->main_planewidth[1] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + s->main_planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + + // If main projection is unindentified, assume it is same as reference + if (s->main_projection == PROJECTION_N) + s->main_projection = s->ref_projection; + + // If main stereo format is unindentified, assume it is same as reference + if (s->main_stereo_format == STEREO_FORMAT_N) + s->main_stereo_format = s->ref_stereo_format; + + return 0; +} + +static int generate_density_map(SSIM360Context *s, int w, int h) +{ + double d, r_square, cos_square; + int ow, oh, ret; + + ret = map_init(&s->density, w, h); + if (ret < 0) + return ret; + + switch (s->ref_stereo_format) { + case STEREO_FORMAT_TB: + h >>= 1; + break; + case STEREO_FORMAT_LR: + w >>= 1; + break; + } + + switch (s->ref_projection) { + case PROJECTION_EQUIRECT: + for (int i = 0; i < h; i++) { + d = cos(((0.5 + i) / h - 0.5) * M_PI); + for (int j = 0; j < w; j++) + s->density.value[i * w + j] = d; + } + break; + case PROJECTION_CUBEMAP32: + // for one quater of a face + for (int i = 0; i < h / 4; i++) { + for (int j = 0; j < w / 6; j++) { + // r = normalized distance to the face center + r_square = + (0.5 + i) / (h / 2) * (0.5 + i) / (h / 2) + + (0.5 + j) / (w / 3) * (0.5 + j) / (w / 3); + r_square /= DEFAULT_EXPANSION_COEF * DEFAULT_EXPANSION_COEF; + cos_square = 0.25 / (r_square + 0.25); + d = pow(cos_square, 1.5); + + for (int face = 0; face < 6; face++) { + // center of a face + switch (face) { + case 0: + oh = h / 4; + ow = w / 6; + break; + case 1: + oh = h / 4; + ow = w / 6 + w / 3; + break; + case 2: + oh = h / 4; + ow = w / 6 + 2 * w / 3; + break; + case 3: + oh = h / 4 + h / 2; + ow = w / 6; + break; + case 4: + oh = h / 4 + h / 2; + ow = w / 6 + w / 3; + break; + case 5: + oh = h / 4 + h / 2; + ow = w / 6 + 2 * w / 3; + break; + } + s->density.value[(oh - 1 - i) * w + ow - 1 - j] = d; + s->density.value[(oh - 1 - i) * w + ow + j] = d; + s->density.value[(oh + i) * w + ow - 1 - j] = d; + s->density.value[(oh + i) * w + ow + j] = d; + } + } + } + break; + case PROJECTION_CUBEMAP23: + // for one quater of a face + for (int i = 0; i < h / 6; i++) { + for (int j = 0; j < w / 4; j++) { + // r = normalized distance to the face center + r_square = + (0.5 + i) / (h / 3) * (0.5 + i) / (h / 3) + + (0.5 + j) / (w / 2) * (0.5 + j) / (w / 2); + r_square /= (1.f + s->ref_pad) * (1.f + s->ref_pad); + cos_square = 0.25 / (r_square + 0.25); + d = pow(cos_square, 1.5); + + for (int face = 0; face < 6; face++) { + // center of a face + switch (face) { + case 0: + ow = w / 4; + oh = h / 6; + break; + case 1: + ow = w / 4; + oh = h / 6 + h / 3; + break; + case 2: + ow = w / 4; + oh = h / 6 + 2 * h / 3; + break; + case 3: + ow = w / 4 + w / 2; + oh = h / 6; + break; + case 4: + ow = w / 4 + w / 2; + oh = h / 6 + h / 3; + break; + case 5: + ow = w / 4 + w / 2; + oh = h / 6 + 2 * h / 3; + break; + } + s->density.value[(oh - 1 - i) * w + ow - 1 - j] = d; + s->density.value[(oh - 1 - i) * w + ow + j] = d; + s->density.value[(oh + i) * w + ow - 1 - j] = d; + s->density.value[(oh + i) * w + ow + j] = d; + } + } + } + break; + case PROJECTION_BARREL: + // side face + for (int i = 0; i < h; i++) { + for (int j = 0; j < w * 4 / 5; j++) { + d = cos(((0.5 + i) / h - 0.5) * DEFAULT_EXPANSION_COEF * M_PI_2); + s->density.value[i * w + j] = d * d * d; + } + } + // top and bottom + for (int i = 0; i < h; i++) { + for (int j = w * 4 / 5; j < w; j++) { + double dx = DEFAULT_EXPANSION_COEF * (0.5 + j - w * 0.90) / (w * 0.10); + double dx_squared = dx * dx; + + double top_dy = DEFAULT_EXPANSION_COEF * (0.5 + i - h * 0.25) / (h * 0.25); + double top_dy_squared = top_dy * top_dy; + + double bottom_dy = DEFAULT_EXPANSION_COEF * (0.5 + i - h * 0.75) / (h * 0.25); + double bottom_dy_squared = bottom_dy * bottom_dy; + + // normalized distance to the circle center + r_square = (i < h / 2 ? top_dy_squared : bottom_dy_squared) + dx_squared; + if (r_square > 1.0) + continue; + + cos_square = 1.0 / (r_square + 1.0); + d = pow(cos_square, 1.5); + s->density.value[i * w + j] = d; + } + } + break; + default: + // TODO: SSIM360_v1 + for (int i = 0; i < h; i++) { + for (int j = 0; j < w; j++) + s->density.value[i * w + j] = 0; + } + } + + switch (s->ref_stereo_format) { + case STEREO_FORMAT_TB: + for (int i = 0; i < h; i++) { + for (int j = 0; j < w; j++) + s->density.value[(i + h) * w + j] = s->density.value[i * w + j]; + } + break; + case STEREO_FORMAT_LR: + for (int i = 0; i < h; i++) { + for (int j = 0; j < w; j++) + s->density.value[i * w + j + w] = s->density.value[i * w + j]; + } + } + + return 0; +} + +static int config_input_ref(AVFilterLink *inlink) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + AVFilterContext *ctx = inlink->dst; + SSIM360Context *s = ctx->priv; + int sum = 0; + + s->nb_components = desc->nb_components; + + s->ref_planeheight[0] = inlink->h; + s->ref_planeheight[3] = inlink->h; + s->ref_planeheight[1] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + s->ref_planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); + + s->ref_planewidth[0] = inlink->w; + s->ref_planewidth[3] = inlink->w; + s->ref_planewidth[1] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + s->ref_planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); + + s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0; + s->comps[0] = s->is_rgb ? 'R' : 'Y'; + s->comps[1] = s->is_rgb ? 'G' : 'U'; + s->comps[2] = s->is_rgb ? 'B' : 'V'; + s->comps[3] = 'A'; + + // If chroma computation is disabled, and the format is YUV, skip U & V channels + if (!s->is_rgb && !s->compute_chroma) + s->nb_components = 1; + + s->max = (1 << desc->comp[0].depth) - 1; + + s->ssim360_plane = desc->comp[0].depth > 8 ? ssim360_plane_16bit : ssim360_plane_8bit; + + for (int i = 0; i < s->nb_components; i++) + sum += s->ref_planeheight[i] * s->ref_planewidth[i]; + for (int i = 0; i < s->nb_components; i++) + s->coefs[i] = (double) s->ref_planeheight[i] * s->ref_planewidth[i] / sum; + + return 0; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + SSIM360Context *s = ctx->priv; + AVFilterLink *mainlink = ctx->inputs[0]; + AVFilterLink *reflink = ctx->inputs[0]; + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format); + int ret; + + // Use tape algorithm if any of frame sizes, projections or stereo format are not equal + if (ctx->inputs[0]->w != ctx->inputs[1]->w || ctx->inputs[0]->h != ctx->inputs[1]->h || + s->ref_projection != s->main_projection || s->ref_stereo_format != s->main_stereo_format) + s->use_tape = 1; + + // Finally, if we have decided to / forced to use tape, check if tape supports both input and output projection + if (s->use_tape && + !(tape_supports_projection(s->main_projection) && + tape_supports_projection(s->ref_projection))) { + av_log(ctx, AV_LOG_ERROR, "Projection is unsupported for the tape based algorithm\n"); + return AVERROR(EINVAL); + } + + if (s->use_tape) { + // s->temp will be allocated for the tape width = 8. The tape is long downwards + s->temp = av_malloc_array((2 * 8 + 12), sizeof(*s->temp)); + if (!s->temp) + return AVERROR(ENOMEM); + + memset(s->ssim360_percentile_sum, 0, sizeof(s->ssim360_percentile_sum)); + + for (int i = 0; i < s->nb_components; i++) { + s->ssim360_hist[i] = av_calloc(SSIM360_HIST_SIZE, sizeof(*s->ssim360_hist)); + if (!s->ssim360_hist[i]) + return AVERROR(ENOMEM); + } + } else { + s->temp = av_malloc_array((2 * reflink->w + 12), sizeof(*s->temp) * (1 + (desc->comp[0].depth > 8))); + if (!s->temp) + return AVERROR(ENOMEM); + + if (!s->density.value) { + ret = generate_density_map(s, reflink->w, reflink->h); + if (ret < 0) + return ret; + } + } + + ret = ff_framesync_init_dualinput(&s->fs, ctx); + if (ret < 0) + return ret; + + outlink->w = mainlink->w; + outlink->h = mainlink->h; + outlink->time_base = mainlink->time_base; + outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio; + outlink->frame_rate = mainlink->frame_rate; + + s->fs.opt_shortest = 1; + s->fs.opt_repeatlast = 1; + + ret = ff_framesync_configure(&s->fs); + if (ret < 0) + return ret; + + return 0; +} + +static int activate(AVFilterContext *ctx) +{ + SSIM360Context *s = ctx->priv; + return ff_framesync_activate(&s->fs); +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + SSIM360Context *s = ctx->priv; + + if (s->nb_ssim_frames > 0) { + char buf[256]; + buf[0] = 0; + // Log average SSIM360 values + for (int i = 0; i < s->nb_components; i++) { + int c = s->is_rgb ? s->rgba_map[i] : i; + av_strlcatf(buf, sizeof(buf), " %c:%f (%f)", s->comps[i], s->ssim360[c] / s->nb_ssim_frames, + ssim360_db(s->ssim360[c], s->nb_ssim_frames)); + } + av_log(ctx, AV_LOG_INFO, "SSIM360%s All:%f (%f)\n", buf, + s->ssim360_total / s->nb_ssim_frames, ssim360_db(s->ssim360_total, s->nb_ssim_frames)); + + // Log percentiles from histogram when using tape + if (s->use_tape) { + for (int p = 0; PERCENTILE_LIST[p] >= 0.0; p++) { + buf[0] = 0; + for (int i = 0; i < s->nb_components; i++) { + int c = s->is_rgb ? s->rgba_map[i] : i; + double ssim360p = s->ssim360_percentile_sum[i][p] / (double)(s->nb_ssim_frames); + av_strlcatf(buf, sizeof(buf), " %c:%f (%f)", s->comps[c], ssim360p, ssim360_db(ssim360p, 1)); + } + av_log(ctx, AV_LOG_INFO, "SSIM360_p%d%s\n", (int)(PERCENTILE_LIST[p] * 100.), buf); + } + } + } + + // free density map + map_uninit(&s->density); + + map_list_free(&s->heatmaps); + + for (int i = 0; i < s->nb_components; i++) { + for (int eye = 0; eye < 2; eye++) { + av_freep(&s->ref_tape_map[i][eye]); + av_freep(&s->main_tape_map[i][eye]); + } + av_freep(&s->ssim360_hist[i]); + } + + ff_framesync_uninit(&s->fs); + + if (s->stats_file && s->stats_file != stdout) + fclose(s->stats_file); + + av_freep(&s->temp); +} + +#define PF(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf, AV_PIX_FMT_GBR##suf +static const enum AVPixelFormat ssim360_pixfmts[] = { + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_GBRP, + PF(P9), PF(P10), PF(P12), PF(P14), PF(P16), + AV_PIX_FMT_NONE +}; +#undef PF + +static const AVFilterPad ssim360_inputs[] = { + { + .name = "main", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input_main, + }, + { + .name = "reference", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input_ref, + }, +}; + +static const AVFilterPad ssim360_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +const AVFilter ff_vf_ssim360 = { + .name = "ssim360", + .description = NULL_IF_CONFIG_SMALL("Calculate the SSIM between two 360 video streams."), + .preinit = ssim360_framesync_preinit, + .init = init, + .uninit = uninit, + .activate = activate, + .priv_size = sizeof(SSIM360Context), + .priv_class = &ssim360_class, + FILTER_INPUTS(ssim360_inputs), + FILTER_OUTPUTS(ssim360_outputs), + FILTER_PIXFMTS_ARRAY(ssim360_pixfmts), +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_ssim.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,15 +35,14 @@ */ #include "libavutil/avstring.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" #include "drawutils.h" -#include "formats.h" #include "framesync.h" #include "internal.h" #include "ssim.h" -#include "video.h" typedef struct SSIMContext { const AVClass *class; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_qsv.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_qsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,254 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Hardware accelerated hstack, vstack and xstack filters based on Intel Quick Sync Video VPP + */ + +#include "config_components.h" + +#include "libavutil/opt.h" +#include "libavutil/common.h" +#include "libavutil/pixdesc.h" +#include "libavutil/eval.h" +#include "libavutil/hwcontext.h" +#include "libavutil/avstring.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/mathematics.h" +#include "libavutil/parseutils.h" + +#include "internal.h" +#include "filters.h" +#include "formats.h" +#include "video.h" + +#include "framesync.h" +#include "qsvvpp.h" + +#define HSTACK_NAME "hstack_qsv" +#define VSTACK_NAME "vstack_qsv" +#define XSTACK_NAME "xstack_qsv" +#define HWContext QSVVPPContext +#define StackHWContext StackQSVContext +#include "stack_internal.h" + +typedef struct StackQSVContext { + StackBaseContext base; + + QSVVPPParam qsv_param; + mfxExtVPPComposite comp_conf; +} StackQSVContext; + +static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth) +{ + *y = ((0.21260*219.0/255.0) * r + (0.71520*219.0/255.0) * g + + (0.07220*219.0/255.0) * b) * ((1 << depth) - 1); + *u = (-(0.11457*224.0/255.0) * r - (0.38543*224.0/255.0) * g + + (0.50000*224.0/255.0) * b + 0.5) * ((1 << depth) - 1); + *v = ((0.50000*224.0/255.0) * r - (0.45415*224.0/255.0) * g - + (0.04585*224.0/255.0) * b + 0.5) * ((1 << depth) - 1); +} + +static int process_frame(FFFrameSync *fs) +{ + AVFilterContext *ctx = fs->parent; + QSVVPPContext *qsv = fs->opaque; + AVFrame *frame = NULL; + int ret = 0; + + for (int i = 0; i < ctx->nb_inputs; i++) { + ret = ff_framesync_get_frame(fs, i, &frame, 0); + if (ret == 0) + ret = ff_qsvvpp_filter_frame(qsv, ctx->inputs[i], frame); + if (ret < 0 && ret != AVERROR(EAGAIN)) + break; + } + + if (ret == 0 && qsv->got_frame == 0) { + for (int i = 0; i < ctx->nb_inputs; i++) + FF_FILTER_FORWARD_WANTED(ctx->outputs[0], ctx->inputs[i]); + + ret = FFERROR_NOT_READY; + } + + return ret; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *ctx = outlink->src; + StackQSVContext *sctx = ctx->priv; + AVFilterLink *inlink0 = ctx->inputs[0]; + enum AVPixelFormat in_format; + int depth = 8, ret; + mfxVPPCompInputStream *is = sctx->comp_conf.InputStream; + + if (inlink0->format == AV_PIX_FMT_QSV) { + if (!inlink0->hw_frames_ctx || !inlink0->hw_frames_ctx->data) + return AVERROR(EINVAL); + + in_format = ((AVHWFramesContext*)inlink0->hw_frames_ctx->data)->sw_format; + } else + in_format = inlink0->format; + + sctx->qsv_param.out_sw_format = in_format; + + for (int i = 1; i < sctx->base.nb_inputs; i++) { + AVFilterLink *inlink = ctx->inputs[i]; + + if (inlink0->format == AV_PIX_FMT_QSV) { + AVHWFramesContext *hwfc0 = (AVHWFramesContext *)inlink0->hw_frames_ctx->data; + AVHWFramesContext *hwfc = (AVHWFramesContext *)inlink->hw_frames_ctx->data; + + if (inlink0->format != inlink->format) { + av_log(ctx, AV_LOG_ERROR, "Mixing hardware and software pixel formats is not supported.\n"); + + return AVERROR(EINVAL); + } else if (hwfc0->device_ctx != hwfc->device_ctx) { + av_log(ctx, AV_LOG_ERROR, "Inputs with different underlying QSV devices are forbidden.\n"); + + return AVERROR(EINVAL); + } + } + } + + if (in_format == AV_PIX_FMT_P010) + depth = 10; + + if (sctx->base.fillcolor_enable) { + int Y, U, V; + + rgb2yuv(sctx->base.fillcolor[0] / 255.0, sctx->base.fillcolor[1] / 255.0, + sctx->base.fillcolor[2] / 255.0, &Y, &U, &V, depth); + sctx->comp_conf.Y = Y; + sctx->comp_conf.U = U; + sctx->comp_conf.V = V; + } + + ret = config_comm_output(outlink); + if (ret < 0) + return ret; + + for (int i = 0; i < sctx->base.nb_inputs; i++) { + is[i].DstX = sctx->base.regions[i].x; + is[i].DstY = sctx->base.regions[i].y; + is[i].DstW = sctx->base.regions[i].width; + is[i].DstH = sctx->base.regions[i].height; + is[i].GlobalAlpha = 255; + is[i].GlobalAlphaEnable = 0; + is[i].PixelAlphaEnable = 0; + } + + return ff_qsvvpp_init(ctx, &sctx->qsv_param); +} + +/* + * Callback for qsvvpp + * @Note: qsvvpp composition does not generate PTS for result frame. + * so we assign the PTS from framesync to the output frame. + */ + +static int filter_callback(AVFilterLink *outlink, AVFrame *frame) +{ + StackQSVContext *sctx = outlink->src->priv; + + frame->pts = av_rescale_q(sctx->base.fs.pts, + sctx->base.fs.time_base, outlink->time_base); + return ff_filter_frame(outlink, frame); +} + + +static int qsv_stack_init(AVFilterContext *ctx) +{ + StackQSVContext *sctx = ctx->priv; + int ret; + + ret = stack_init(ctx); + if (ret) + return ret; + + /* fill composite config */ + sctx->comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE; + sctx->comp_conf.Header.BufferSz = sizeof(sctx->comp_conf); + sctx->comp_conf.NumInputStream = sctx->base.nb_inputs; + sctx->comp_conf.InputStream = av_calloc(sctx->base.nb_inputs, + sizeof(*sctx->comp_conf.InputStream)); + if (!sctx->comp_conf.InputStream) + return AVERROR(ENOMEM); + + /* initialize QSVVPP params */ + sctx->qsv_param.filter_frame = filter_callback; + sctx->qsv_param.ext_buf = av_mallocz(sizeof(*sctx->qsv_param.ext_buf)); + + if (!sctx->qsv_param.ext_buf) + return AVERROR(ENOMEM); + + sctx->qsv_param.ext_buf[0] = (mfxExtBuffer *)&sctx->comp_conf; + sctx->qsv_param.num_ext_buf = 1; + sctx->qsv_param.num_crop = 0; + + return 0; +} + +static av_cold void qsv_stack_uninit(AVFilterContext *ctx) +{ + StackQSVContext *sctx = ctx->priv; + + stack_uninit(ctx); + + ff_qsvvpp_close(ctx); + av_freep(&sctx->comp_conf.InputStream); + av_freep(&sctx->qsv_param.ext_buf); +} + +static int qsv_stack_query_formats(AVFilterContext *ctx) +{ + static const enum AVPixelFormat pixel_formats[] = { + AV_PIX_FMT_NV12, + AV_PIX_FMT_P010, + AV_PIX_FMT_QSV, + AV_PIX_FMT_NONE, + }; + + return ff_set_common_formats_from_list(ctx, pixel_formats); +} + +#include "stack_internal.c" + +#if CONFIG_HSTACK_QSV_FILTER + +DEFINE_HSTACK_OPTIONS(qsv); +DEFINE_STACK_FILTER(hstack, qsv, "Quick Sync Video"); + +#endif + +#if CONFIG_VSTACK_QSV_FILTER + +DEFINE_VSTACK_OPTIONS(qsv); +DEFINE_STACK_FILTER(vstack, qsv, "Quick Sync Video"); + +#endif + +#if CONFIG_XSTACK_QSV_FILTER + +DEFINE_XSTACK_OPTIONS(qsv); +DEFINE_STACK_FILTER(xstack, qsv, "Quick Sync Video"); + +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_vaapi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_vaapi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_vaapi.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_stack_vaapi.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,253 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Hardware accelerated hstack, vstack and xstack filters based on VA-API + */ + +#include "config_components.h" + +#include "libavutil/opt.h" +#include "libavutil/common.h" +#include "libavutil/pixdesc.h" +#include "libavutil/eval.h" +#include "libavutil/hwcontext.h" +#include "libavutil/avstring.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/mathematics.h" +#include "libavutil/parseutils.h" +#include "libavutil/mem.h" + +#include "internal.h" +#include "filters.h" +#include "formats.h" +#include "video.h" +#include "framesync.h" +#include "vaapi_vpp.h" + +#define HSTACK_NAME "hstack_vaapi" +#define VSTACK_NAME "vstack_vaapi" +#define XSTACK_NAME "xstack_vaapi" +#define HWContext VAAPIVPPContext +#define StackHWContext StackVAAPIContext +#include "stack_internal.h" + +typedef struct StackVAAPIContext { + StackBaseContext base; + + VARectangle *rects; +} StackVAAPIContext; + +static int process_frame(FFFrameSync *fs) +{ + AVFilterContext *avctx = fs->parent; + AVFilterLink *outlink = avctx->outputs[0]; + StackVAAPIContext *sctx = fs->opaque; + VAAPIVPPContext *vppctx = fs->opaque; + AVFrame *oframe, *iframe; + VAProcPipelineParameterBuffer *params = NULL; + VARectangle *irect = NULL; + int ret = 0; + + if (vppctx->va_context == VA_INVALID_ID) + return AVERROR(EINVAL); + + oframe = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!oframe) + return AVERROR(ENOMEM); + + irect = av_calloc(avctx->nb_inputs, sizeof(*irect)); + params = av_calloc(avctx->nb_inputs, sizeof(*params)); + if (!irect || !params) { + ret = AVERROR(ENOMEM); + goto fail; + } + + for (int i = 0; i < avctx->nb_inputs; i++) { + ret = ff_framesync_get_frame(fs, i, &iframe, 0); + if (ret) + goto fail; + + if (i == 0) { + ret = av_frame_copy_props(oframe, iframe); + if (ret < 0) + goto fail; + } + + ret = ff_vaapi_vpp_init_params(avctx, ¶ms[i], iframe, oframe); + if (ret) + goto fail; + + av_log(avctx, AV_LOG_DEBUG, "stack input %d: %s, %ux%u (%"PRId64").\n", + i, av_get_pix_fmt_name(iframe->format), + iframe->width, iframe->height, iframe->pts); + irect[i].x = 0; + irect[i].y = 0; + irect[i].width = iframe->width; + irect[i].height = iframe->height; + params[i].surface_region = &irect[i]; + params[i].surface = (VASurfaceID)(uintptr_t)iframe->data[3]; + params[i].output_region = &sctx->rects[i]; + + if (sctx->base.fillcolor_enable) + params[i].output_background_color = (sctx->base.fillcolor[3] << 24 | + sctx->base.fillcolor[0] << 16 | + sctx->base.fillcolor[1] << 8 | + sctx->base.fillcolor[2]); + } + + oframe->pts = av_rescale_q(sctx->base.fs.pts, sctx->base.fs.time_base, outlink->time_base); + oframe->sample_aspect_ratio = outlink->sample_aspect_ratio; + + ret = ff_vaapi_vpp_render_pictures(avctx, params, avctx->nb_inputs, oframe); + if (ret) + goto fail; + + av_freep(&irect); + av_freep(¶ms); + return ff_filter_frame(outlink, oframe); + +fail: + av_freep(&irect); + av_freep(¶ms); + av_frame_free(&oframe); + return ret; +} + +static int config_output(AVFilterLink *outlink) +{ + AVFilterContext *avctx = outlink->src; + StackVAAPIContext *sctx = avctx->priv; + VAAPIVPPContext *vppctx = avctx->priv; + AVFilterLink *inlink0 = avctx->inputs[0]; + AVHWFramesContext *hwfc0 = NULL; + int ret; + + if (inlink0->format != AV_PIX_FMT_VAAPI || !inlink0->hw_frames_ctx || !inlink0->hw_frames_ctx->data) { + av_log(avctx, AV_LOG_ERROR, "Software pixel format is not supported.\n"); + return AVERROR(EINVAL); + } + + hwfc0 = (AVHWFramesContext *)inlink0->hw_frames_ctx->data; + + for (int i = 1; i < sctx->base.nb_inputs; i++) { + AVFilterLink *inlink = avctx->inputs[i]; + AVHWFramesContext *hwfc = NULL; + + if (inlink->format != AV_PIX_FMT_VAAPI || !inlink->hw_frames_ctx || !inlink->hw_frames_ctx->data) { + av_log(avctx, AV_LOG_ERROR, "Software pixel format is not supported.\n"); + return AVERROR(EINVAL); + } + + hwfc = (AVHWFramesContext *)inlink->hw_frames_ctx->data; + + if (hwfc0->sw_format != hwfc->sw_format) { + av_log(avctx, AV_LOG_ERROR, "All inputs should have the same underlying software pixel format.\n"); + return AVERROR(EINVAL); + } + + if (hwfc0->device_ctx != hwfc->device_ctx) { + av_log(avctx, AV_LOG_ERROR, "All inputs should have the same underlying vaapi devices.\n"); + return AVERROR(EINVAL); + } + } + + ff_vaapi_vpp_config_input(inlink0); + vppctx->output_format = hwfc0->sw_format; + + ret = config_comm_output(outlink); + if (ret < 0) + return ret; + + for (int i = 0; i < sctx->base.nb_inputs; i++) { + sctx->rects[i].x = sctx->base.regions[i].x; + sctx->rects[i].y = sctx->base.regions[i].y; + sctx->rects[i].width = sctx->base.regions[i].width; + sctx->rects[i].height = sctx->base.regions[i].height; + } + + vppctx->output_width = outlink->w; + vppctx->output_height = outlink->h; + + return ff_vaapi_vpp_config_output(outlink); +} + +static int vaapi_stack_init(AVFilterContext *avctx) +{ + StackVAAPIContext *sctx = avctx->priv; + VAAPIVPPContext *vppctx = avctx->priv; + int ret; + + ret = stack_init(avctx); + if (ret) + return ret; + + /* stack region */ + sctx->rects = av_calloc(sctx->base.nb_inputs, sizeof(*sctx->rects)); + if (!sctx->rects) + return AVERROR(ENOMEM); + + ff_vaapi_vpp_ctx_init(avctx); + vppctx->output_format = AV_PIX_FMT_NONE; + + return 0; +} + +static av_cold void vaapi_stack_uninit(AVFilterContext *avctx) +{ + StackVAAPIContext *sctx = avctx->priv; + + stack_uninit(avctx); + + av_freep(&sctx->rects); +} + +static int vaapi_stack_query_formats(AVFilterContext *avctx) +{ + static const enum AVPixelFormat pixel_formats[] = { + AV_PIX_FMT_VAAPI, + AV_PIX_FMT_NONE, + }; + + return ff_set_common_formats_from_list(avctx, pixel_formats); +} + +#include "stack_internal.c" + +#if CONFIG_HSTACK_VAAPI_FILTER + +DEFINE_HSTACK_OPTIONS(vaapi); +DEFINE_STACK_FILTER(hstack, vaapi, "VA-API"); + +#endif + +#if CONFIG_VSTACK_VAAPI_FILTER + +DEFINE_VSTACK_OPTIONS(vaapi); +DEFINE_STACK_FILTER(vstack, vaapi, "VA-API"); + +#endif + +#if CONFIG_XSTACK_VAAPI_FILTER + +DEFINE_XSTACK_OPTIONS(vaapi); +DEFINE_STACK_FILTER(xstack, vaapi, "VA-API"); + +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_telecine.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_telecine.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_telecine.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_telecine.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "video.h" @@ -182,7 +183,11 @@ } if (s->occupied) { - av_frame_make_writable(s->frame[nout]); + ret = ff_inlink_make_frame_writable(inlink, &s->frame[nout]); + if (ret < 0) { + av_frame_free(&inpicref); + return ret; + } for (i = 0; i < s->nb_planes; i++) { // fill in the EARLIER field from the buffered pic av_image_copy_plane(s->frame[nout]->data[i] + s->frame[nout]->linesize[i] * s->first_field, @@ -208,7 +213,11 @@ while (len >= 2) { // output THIS image as-is - av_frame_make_writable(s->frame[nout]); + ret = ff_inlink_make_frame_writable(inlink, &s->frame[nout]); + if (ret < 0) { + av_frame_free(&inpicref); + return ret; + } for (i = 0; i < s->nb_planes; i++) av_image_copy_plane(s->frame[nout]->data[i], s->frame[nout]->linesize[i], inpicref->data[i], inpicref->linesize[i], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_threshold_init.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_threshold_init.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_threshold_init.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_threshold_init.h 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ { for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) - out[x] = in[x] < threshold[x] ? min[x] : max[x]; + out[x] = in[x] <= threshold[x] ? min[x] : max[x]; in += ilinesize; threshold += tlinesize; @@ -64,7 +64,7 @@ for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) - out[x] = in[x] < threshold[x] ? min[x] : max[x]; + out[x] = in[x] <= threshold[x] ? min[x] : max[x]; in += ilinesize / 2; threshold += tlinesize / 2; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_thumbnail.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_thumbnail.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_thumbnail.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_thumbnail.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,10 +42,14 @@ typedef struct ThumbContext { const AVClass *class; int n; ///< current frame + int loglevel; int n_frames; ///< number of frames for analysis struct thumb_frame *frames; ///< the n_frames frames AVRational tb; ///< copy of the input timebase to ease access + int nb_threads; + int *thread_histogram; + int planewidth[4]; int planeheight[4]; } ThumbContext; @@ -55,6 +59,10 @@ static const AVOption thumbnail_options[] = { { "n", "set the frames batch size", OFFSET(n_frames), AV_OPT_TYPE_INT, {.i64=100}, 2, INT_MAX, FLAGS }, + { "log", "force stats logging level", OFFSET(loglevel), AV_OPT_TYPE_INT, {.i64 = AV_LOG_INFO}, INT_MIN, INT_MAX, FLAGS, "level" }, + { "quiet", "logging disabled", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_QUIET}, 0, 0, FLAGS, "level" }, + { "info", "information logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_INFO}, 0, 0, FLAGS, "level" }, + { "verbose", "verbose logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_VERBOSE}, 0, 0, FLAGS, "level" }, { NULL } }; @@ -124,32 +132,33 @@ // raise the chosen one picref = s->frames[best_frame_idx].buf; - av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected " - "from a set of %d images\n", best_frame_idx, - picref->pts * av_q2d(s->tb), nb_frames); + if (s->loglevel != AV_LOG_QUIET) + av_log(ctx, s->loglevel, "frame id #%d (pts_time=%f) selected " + "from a set of %d images\n", best_frame_idx, + picref->pts * av_q2d(s->tb), nb_frames); s->frames[best_frame_idx].buf = NULL; return picref; } -static int filter_frame(AVFilterLink *inlink, AVFrame *frame) +static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { - int i, j; - AVFilterContext *ctx = inlink->dst; - ThumbContext *s = ctx->priv; - AVFilterLink *outlink = ctx->outputs[0]; - int *hist = s->frames[s->n].histogram; - const uint8_t *p = frame->data[0]; + ThumbContext *s = ctx->priv; + AVFrame *frame = arg; + int *hist = s->thread_histogram + HIST_SIZE * jobnr; + const int h = frame->height; + const int w = frame->width; + const int slice_start = (h * jobnr) / nb_jobs; + const int slice_end = (h * (jobnr+1)) / nb_jobs; + const uint8_t *p = frame->data[0] + slice_start * frame->linesize[0]; - // keep a reference of each frame - s->frames[s->n].buf = frame; + memset(hist, 0, sizeof(*hist) * HIST_SIZE); - // update current frame histogram - switch (inlink->format) { + switch (frame->format) { case AV_PIX_FMT_RGB24: case AV_PIX_FMT_BGR24: - for (j = 0; j < inlink->h; j++) { - for (i = 0; i < inlink->w; i++) { + for (int j = slice_start; j < slice_end; j++) { + for (int i = 0; i < w; i++) { hist[0*256 + p[i*3 ]]++; hist[1*256 + p[i*3 + 1]]++; hist[2*256 + p[i*3 + 2]]++; @@ -161,8 +170,8 @@ case AV_PIX_FMT_BGR0: case AV_PIX_FMT_RGBA: case AV_PIX_FMT_BGRA: - for (j = 0; j < inlink->h; j++) { - for (i = 0; i < inlink->w; i++) { + for (int j = slice_start; j < slice_end; j++) { + for (int i = 0; i < w; i++) { hist[0*256 + p[i*4 ]]++; hist[1*256 + p[i*4 + 1]]++; hist[2*256 + p[i*4 + 2]]++; @@ -174,8 +183,8 @@ case AV_PIX_FMT_0BGR: case AV_PIX_FMT_ARGB: case AV_PIX_FMT_ABGR: - for (j = 0; j < inlink->h; j++) { - for (i = 0; i < inlink->w; i++) { + for (int j = slice_start; j < slice_end; j++) { + for (int i = 0; i < w; i++) { hist[0*256 + p[i*4 + 1]]++; hist[1*256 + p[i*4 + 2]]++; hist[2*256 + p[i*4 + 3]]++; @@ -185,16 +194,46 @@ break; default: for (int plane = 0; plane < 3; plane++) { - const uint8_t *p = frame->data[plane]; - for (j = 0; j < s->planeheight[plane]; j++) { - for (i = 0; i < s->planewidth[plane]; i++) - hist[256*plane + p[i]]++; - p += frame->linesize[plane]; + const int slice_start = (s->planeheight[plane] * jobnr) / nb_jobs; + const int slice_end = (s->planeheight[plane] * (jobnr+1)) / nb_jobs; + const uint8_t *p = frame->data[plane] + slice_start * frame->linesize[plane]; + const ptrdiff_t linesize = frame->linesize[plane]; + const int planewidth = s->planewidth[plane]; + int *hhist = hist + 256 * plane; + + for (int j = slice_start; j < slice_end; j++) { + for (int i = 0; i < planewidth; i++) + hhist[p[i]]++; + p += linesize; } } break; } + return 0; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *frame) +{ + AVFilterContext *ctx = inlink->dst; + ThumbContext *s = ctx->priv; + AVFilterLink *outlink = ctx->outputs[0]; + int *hist = s->frames[s->n].histogram; + + // keep a reference of each frame + s->frames[s->n].buf = frame; + + ff_filter_execute(ctx, do_slice, frame, NULL, + FFMIN(frame->height, s->nb_threads)); + + // update current frame histogram + for (int j = 0; j < FFMIN(frame->height, s->nb_threads); j++) { + int *thread_histogram = s->thread_histogram + HIST_SIZE * j; + + for (int i = 0; i < HIST_SIZE; i++) + hist[i] += thread_histogram[i]; + } + // no selection until the buffer of N frames is filled up s->n++; if (s->n < s->n_frames) @@ -210,6 +249,7 @@ for (i = 0; i < s->n_frames && s->frames && s->frames[i].buf; i++) av_frame_free(&s->frames[i].buf); av_freep(&s->frames); + av_freep(&s->thread_histogram); } static int request_frame(AVFilterLink *link) @@ -235,6 +275,11 @@ ThumbContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + s->nb_threads = ff_filter_get_nb_threads(ctx); + s->thread_histogram = av_calloc(HIST_SIZE, s->nb_threads * sizeof(*s->thread_histogram)); + if (!s->thread_histogram) + return AVERROR(ENOMEM); + s->tb = inlink->time_base; s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); s->planewidth[0] = s->planewidth[3] = inlink->w; @@ -288,5 +333,6 @@ FILTER_OUTPUTS(thumbnail_outputs), FILTER_PIXFMTS_ARRAY(pix_fmts), .priv_class = &thumbnail_class, - .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | + AVFILTER_FLAG_SLICE_THREADS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tinterlace.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tinterlace.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tinterlace.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tinterlace.c 2023-03-03 13:29:59.000000000 +0000 @@ -201,7 +201,8 @@ av_frame_free(&tinterlace->cur ); av_frame_free(&tinterlace->next); - av_freep(&tinterlace->black_data[0]); + av_freep(&tinterlace->black_data[0][0]); + av_freep(&tinterlace->black_data[1][0]); } static int config_out_props(AVFilterLink *outlink) @@ -225,14 +226,22 @@ int ret; ff_draw_init(&tinterlace->draw, outlink->format, 0); ff_draw_color(&tinterlace->draw, &tinterlace->color, black); - if (ff_fmt_is_in(outlink->format, full_scale_yuvj_pix_fmts)) - tinterlace->color.comp[0].u8[0] = 0; - ret = av_image_alloc(tinterlace->black_data, tinterlace->black_linesize, + /* limited range */ + if (!ff_fmt_is_in(outlink->format, full_scale_yuvj_pix_fmts)) { + ret = av_image_alloc(tinterlace->black_data[0], tinterlace->black_linesize, + outlink->w, outlink->h, outlink->format, 16); + if (ret < 0) + return ret; + ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data[0], + tinterlace->black_linesize, 0, 0, outlink->w, outlink->h); + } + /* full range */ + tinterlace->color.comp[0].u8[0] = 0; + ret = av_image_alloc(tinterlace->black_data[1], tinterlace->black_linesize, outlink->w, outlink->h, outlink->format, 16); if (ret < 0) return ret; - - ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data, + ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data[1], tinterlace->black_linesize, 0, 0, outlink->w, outlink->h); } if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF) @@ -360,7 +369,7 @@ AVFilterLink *outlink = ctx->outputs[0]; TInterlaceContext *tinterlace = ctx->priv; AVFrame *cur, *next, *out; - int field, tff, ret; + int field, tff, full, ret; av_frame_free(&tinterlace->cur); tinterlace->cur = tinterlace->next; @@ -418,6 +427,7 @@ out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1)); field = (1 + outlink->frame_count_in) & 1 ? FIELD_UPPER : FIELD_LOWER; + full = out->color_range == AVCOL_RANGE_JPEG || ff_fmt_is_in(out->format, full_scale_yuvj_pix_fmts); /* copy upper and lower fields */ copy_picture_field(tinterlace, out->data, out->linesize, (const uint8_t **)cur->data, cur->linesize, @@ -425,7 +435,7 @@ FIELD_UPPER_AND_LOWER, 1, field, tinterlace->flags); /* pad with black the other field */ copy_picture_field(tinterlace, out->data, out->linesize, - (const uint8_t **)tinterlace->black_data, tinterlace->black_linesize, + (const uint8_t **)tinterlace->black_data[full], tinterlace->black_linesize, inlink->format, inlink->w, inlink->h, FIELD_UPPER_AND_LOWER, 1, !field, tinterlace->flags); break; @@ -510,6 +520,7 @@ } out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base); + out->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); ret = ff_filter_frame(outlink, out); return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tpad.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tpad.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tpad.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_tpad.c 2023-03-03 13:29:59.000000000 +0000 @@ -75,7 +75,7 @@ TPadContext *s = ctx->priv; AVFrame *frame = NULL; int ret, status; - int64_t pts; + int64_t duration, pts; FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); @@ -98,8 +98,10 @@ ff_fill_rectangle(&s->draw, &s->color, frame->data, frame->linesize, 0, 0, frame->width, frame->height); + duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); frame->pts = s->pts; - s->pts += av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + frame->duration = duration; + s->pts += duration; s->pad_start--; return ff_filter_frame(outlink, frame); } @@ -116,8 +118,10 @@ frame = av_frame_clone(s->cache_start); if (!frame) return AVERROR(ENOMEM); + duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); frame->pts = s->pts; - s->pts += av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + frame->duration = duration; + s->pts += duration; s->pad_start--; if (s->pad_start == 0) s->cache_start = NULL; @@ -160,8 +164,10 @@ if (!frame) return AVERROR(ENOMEM); } + duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); frame->pts = s->pts; - s->pts += av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); + frame->duration = duration; + s->pts += duration; if (s->pad_stop > 0) s->pad_stop--; return ff_filter_frame(outlink, frame); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vibrance.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vibrance.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vibrance.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vibrance.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,7 @@ #define R 0 #define G 1 #define B 2 +#define A 3 typedef struct VibranceContext { const AVClass *class; @@ -51,10 +52,16 @@ return v0 + (v1 - v0) * f; } +typedef struct ThreadData { + AVFrame *out, *in; +} ThreadData; + static int vibrance_slice8(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) { VibranceContext *s = avctx->priv; - AVFrame *frame = arg; + ThreadData *td = arg; + AVFrame *frame = td->out; + AVFrame *in = td->in; const int width = frame->width; const int height = frame->height; const float scale = 1.f / 255.f; @@ -74,15 +81,25 @@ const int glinesize = frame->linesize[0]; const int blinesize = frame->linesize[1]; const int rlinesize = frame->linesize[2]; + const int alinesize = frame->linesize[3]; + const int gslinesize = in->linesize[0]; + const int bslinesize = in->linesize[1]; + const int rslinesize = in->linesize[2]; + const int aslinesize = in->linesize[3]; + const uint8_t *gsrc = in->data[0] + slice_start * glinesize; + const uint8_t *bsrc = in->data[1] + slice_start * blinesize; + const uint8_t *rsrc = in->data[2] + slice_start * rlinesize; uint8_t *gptr = frame->data[0] + slice_start * glinesize; uint8_t *bptr = frame->data[1] + slice_start * blinesize; uint8_t *rptr = frame->data[2] + slice_start * rlinesize; + const uint8_t *asrc = in->data[3]; + uint8_t *aptr = frame->data[3]; for (int y = slice_start; y < slice_end; y++) { for (int x = 0; x < width; x++) { - float g = gptr[x] * scale; - float b = bptr[x] * scale; - float r = rptr[x] * scale; + float g = gsrc[x] * scale; + float b = bsrc[x] * scale; + float r = rsrc[x] * scale; float max_color = FFMAX3(r, g, b); float min_color = FFMIN3(r, g, b); float color_saturation = max_color - min_color; @@ -100,6 +117,12 @@ rptr[x] = av_clip_uint8(r * 255.f); } + if (aptr && alinesize && frame != in) + memcpy(aptr + alinesize * y, asrc + aslinesize * y, width); + + gsrc += gslinesize; + bsrc += bslinesize; + rsrc += rslinesize; gptr += glinesize; bptr += blinesize; rptr += rlinesize; @@ -111,7 +134,9 @@ static int vibrance_slice16(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) { VibranceContext *s = avctx->priv; - AVFrame *frame = arg; + ThreadData *td = arg; + AVFrame *frame = td->out; + AVFrame *in = td->in; const int depth = s->depth; const float max = (1 << depth) - 1; const float scale = 1.f / max; @@ -130,18 +155,28 @@ const float srintensity = alternate * FFSIGN(rintensity); const int slice_start = (height * jobnr) / nb_jobs; const int slice_end = (height * (jobnr + 1)) / nb_jobs; + const int gslinesize = in->linesize[0] / 2; + const int bslinesize = in->linesize[1] / 2; + const int rslinesize = in->linesize[2] / 2; + const int aslinesize = in->linesize[3] / 2; const int glinesize = frame->linesize[0] / 2; const int blinesize = frame->linesize[1] / 2; const int rlinesize = frame->linesize[2] / 2; + const int alinesize = frame->linesize[3] / 2; + const uint16_t *gsrc = (const uint16_t *)in->data[0] + slice_start * gslinesize; + const uint16_t *bsrc = (const uint16_t *)in->data[1] + slice_start * bslinesize; + const uint16_t *rsrc = (const uint16_t *)in->data[2] + slice_start * rslinesize; uint16_t *gptr = (uint16_t *)frame->data[0] + slice_start * glinesize; uint16_t *bptr = (uint16_t *)frame->data[1] + slice_start * blinesize; uint16_t *rptr = (uint16_t *)frame->data[2] + slice_start * rlinesize; + const uint16_t *asrc = (const uint16_t *)in->data[3]; + uint16_t *aptr = (uint16_t *)frame->data[3]; for (int y = slice_start; y < slice_end; y++) { for (int x = 0; x < width; x++) { - float g = gptr[x] * scale; - float b = bptr[x] * scale; - float r = rptr[x] * scale; + float g = gsrc[x] * scale; + float b = bsrc[x] * scale; + float r = rsrc[x] * scale; float max_color = FFMAX3(r, g, b); float min_color = FFMIN3(r, g, b); float color_saturation = max_color - min_color; @@ -159,6 +194,12 @@ rptr[x] = av_clip_uintp2_c(r * max, depth); } + if (aptr && alinesize && frame != in) + memcpy(aptr + alinesize * y, asrc + aslinesize * y, width * 2); + + gsrc += gslinesize; + bsrc += bslinesize; + rsrc += rslinesize; gptr += glinesize; bptr += blinesize; rptr += rlinesize; @@ -170,7 +211,9 @@ static int vibrance_slice8p(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) { VibranceContext *s = avctx->priv; - AVFrame *frame = arg; + ThreadData *td = arg; + AVFrame *frame = td->out; + AVFrame *in = td->in; const int step = s->step; const int width = frame->width; const int height = frame->height; @@ -181,6 +224,7 @@ const uint8_t roffset = s->rgba_map[R]; const uint8_t goffset = s->rgba_map[G]; const uint8_t boffset = s->rgba_map[B]; + const uint8_t aoffset = s->rgba_map[A]; const float intensity = s->intensity; const float alternate = s->alternate ? 1.f : -1.f; const float gintensity = intensity * s->balance[0]; @@ -192,13 +236,15 @@ const int slice_start = (height * jobnr) / nb_jobs; const int slice_end = (height * (jobnr + 1)) / nb_jobs; const int linesize = frame->linesize[0]; + const int slinesize = in->linesize[0]; + const uint8_t *src = in->data[0] + slice_start * slinesize; uint8_t *ptr = frame->data[0] + slice_start * linesize; for (int y = slice_start; y < slice_end; y++) { for (int x = 0; x < width; x++) { - float g = ptr[x * step + goffset] * scale; - float b = ptr[x * step + boffset] * scale; - float r = ptr[x * step + roffset] * scale; + float g = src[x * step + goffset] * scale; + float b = src[x * step + boffset] * scale; + float r = src[x * step + roffset] * scale; float max_color = FFMAX3(r, g, b); float min_color = FFMIN3(r, g, b); float color_saturation = max_color - min_color; @@ -214,9 +260,13 @@ ptr[x * step + goffset] = av_clip_uint8(g * 255.f); ptr[x * step + boffset] = av_clip_uint8(b * 255.f); ptr[x * step + roffset] = av_clip_uint8(r * 255.f); + + if (frame != in) + ptr[x * step + aoffset] = src[x * step + aoffset]; } ptr += linesize; + src += slinesize; } return 0; @@ -225,7 +275,9 @@ static int vibrance_slice16p(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) { VibranceContext *s = avctx->priv; - AVFrame *frame = arg; + ThreadData *td = arg; + AVFrame *frame = td->out; + AVFrame *in = td->in; const int step = s->step; const int depth = s->depth; const float max = (1 << depth) - 1; @@ -236,6 +288,7 @@ const uint8_t roffset = s->rgba_map[R]; const uint8_t goffset = s->rgba_map[G]; const uint8_t boffset = s->rgba_map[B]; + const uint8_t aoffset = s->rgba_map[A]; const int width = frame->width; const int height = frame->height; const float intensity = s->intensity; @@ -249,13 +302,15 @@ const int slice_start = (height * jobnr) / nb_jobs; const int slice_end = (height * (jobnr + 1)) / nb_jobs; const int linesize = frame->linesize[0] / 2; + const int slinesize = in->linesize[0] / 2; + const uint16_t *src = (const uint16_t *)in->data[0] + slice_start * slinesize; uint16_t *ptr = (uint16_t *)frame->data[0] + slice_start * linesize; for (int y = slice_start; y < slice_end; y++) { for (int x = 0; x < width; x++) { - float g = ptr[x * step + goffset] * scale; - float b = ptr[x * step + boffset] * scale; - float r = ptr[x * step + roffset] * scale; + float g = src[x * step + goffset] * scale; + float b = src[x * step + boffset] * scale; + float r = src[x * step + roffset] * scale; float max_color = FFMAX3(r, g, b); float min_color = FFMIN3(r, g, b); float color_saturation = max_color - min_color; @@ -271,25 +326,46 @@ ptr[x * step + goffset] = av_clip_uintp2_c(g * max, depth); ptr[x * step + boffset] = av_clip_uintp2_c(b * max, depth); ptr[x * step + roffset] = av_clip_uintp2_c(r * max, depth); + if (frame != in) + ptr[x * step + aoffset] = src[x * step + aoffset]; } ptr += linesize; + src += slinesize; } return 0; } -static int filter_frame(AVFilterLink *link, AVFrame *frame) +static int filter_frame(AVFilterLink *link, AVFrame *in) { AVFilterContext *avctx = link->dst; + AVFilterLink *outlink = avctx->outputs[0]; VibranceContext *s = avctx->priv; + ThreadData td; + AVFrame *out; int res; - if (res = ff_filter_execute(avctx, s->do_slice, frame, NULL, - FFMIN(frame->height, ff_filter_get_nb_threads(avctx)))) + if (av_frame_is_writable(in)) { + out = in; + } else { + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + if (!out) { + av_frame_free(&in); + return AVERROR(ENOMEM); + } + av_frame_copy_props(out, in); + } + + td.out = out; + td.in = in; + if (res = ff_filter_execute(avctx, s->do_slice, &td, NULL, + FFMIN(out->height, ff_filter_get_nb_threads(avctx)))) return res; - return ff_filter_frame(avctx->outputs[0], frame); + if (out != in) + av_frame_free(&in); + return ff_filter_frame(outlink, out); } static const enum AVPixelFormat pixel_fmts[] = { @@ -335,7 +411,6 @@ { .name = "default", .type = AVMEDIA_TYPE_VIDEO, - .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE, .filter_frame = filter_frame, .config_props = config_input, }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabdetect.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabdetect.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabdetect.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabdetect.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,9 +23,11 @@ #include #include "libavutil/common.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" -#include "libavutil/imgutils.h" +#include "libavutil/pixdesc.h" #include "avfilter.h" +#include "filters.h" #include "internal.h" #include "vidstabutils.h" @@ -148,10 +150,15 @@ AVFilterLink *outlink = inlink->dst->outputs[0]; VSFrame frame; - int plane; + int plane, ret; - if (s->conf.show > 0 && !av_frame_is_writable(in)) - av_frame_make_writable(in); + if (s->conf.show > 0 && !av_frame_is_writable(in)) { + ret = ff_inlink_make_frame_writable(inlink, &in); + if (ret < 0) { + av_frame_free(&in); + return ret; + } + } for (plane = 0; plane < md->fi.planes; plane++) { frame.data[plane] = in->data[plane]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabtransform.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabtransform.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabtransform.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vidstabtransform.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,8 +23,9 @@ #include #include "libavutil/common.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" -#include "libavutil/imgutils.h" +#include "libavutil/pixdesc.h" #include "avfilter.h" #include "internal.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vif.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vif.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vif.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vif.c 2023-03-03 13:29:59.000000000 +0000 @@ -63,7 +63,7 @@ { NULL } }; -AVFILTER_DEFINE_CLASS(vif); +FRAMESYNC_DEFINE_CLASS(vif, VIFContext, fs); static const uint8_t vif_filter1d_width1[4] = { 17, 9, 5, 3 }; @@ -631,6 +631,7 @@ const AVFilter ff_vf_vif = { .name = "vif", .description = NULL_IF_CONFIG_SMALL("Calculate the VIF between two video streams."), + .preinit = vif_framesync_preinit, .uninit = uninit, .priv_size = sizeof(VIFContext), .priv_class = &vif_class, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vmafmotion.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vmafmotion.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vmafmotion.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vmafmotion.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ * Calculate VMAF Motion score. */ +#include "libavutil/file_open.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avfilter.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vpp_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vpp_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vpp_qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_vpp_qsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,8 @@ #include +#include "config_components.h" + #include "libavutil/opt.h" #include "libavutil/eval.h" #include "libavutil/hwcontext.h" @@ -45,9 +47,7 @@ #define ENH_FILTERS_COUNT (8) typedef struct VPPContext{ - const AVClass *class; - - QSVVPPContext *qsv; + QSVVPPContext qsv; /* Video Enhancement Algorithms */ mfxExtVPPDeinterlacing deinterlace_conf; @@ -59,6 +59,11 @@ mfxExtVPPMirroring mirroring_conf; mfxExtVPPScaling scale_conf; + /** + * New dimensions. Special values are: + * 0 = original width/height + * -1 = keep original aspect + */ int out_width; int out_height; /** @@ -95,48 +100,10 @@ char *ow, *oh; char *output_format_str; - int async_depth; - int eof; + int has_passthrough; /* apply pass through mode if possible */ + int field_rate; /* Generate output at frame rate or field rate for deinterlace mode, 0: frame, 1: field */ } VPPContext; -static const AVOption options[] = { - { "deinterlace", "deinterlace mode: 0=off, 1=bob, 2=advanced", OFFSET(deinterlace), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MFX_DEINTERLACING_ADVANCED, .flags = FLAGS, "deinterlace" }, - { "bob", "Bob deinterlace mode.", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_DEINTERLACING_BOB }, .flags = FLAGS, "deinterlace" }, - { "advanced", "Advanced deinterlace mode. ", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_DEINTERLACING_ADVANCED }, .flags = FLAGS, "deinterlace" }, - - { "denoise", "denoise level [0, 100]", OFFSET(denoise), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, .flags = FLAGS }, - { "detail", "enhancement level [0, 100]", OFFSET(detail), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, .flags = FLAGS }, - { "framerate", "output framerate", OFFSET(framerate), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 },0, DBL_MAX, .flags = FLAGS }, - { "procamp", "Enable ProcAmp", OFFSET(procamp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS}, - { "hue", "ProcAmp hue", OFFSET(hue), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, -180.0, 180.0, .flags = FLAGS}, - { "saturation", "ProcAmp saturation", OFFSET(saturation), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 10.0, .flags = FLAGS}, - { "contrast", "ProcAmp contrast", OFFSET(contrast), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 10.0, .flags = FLAGS}, - { "brightness", "ProcAmp brightness", OFFSET(brightness), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, -100.0, 100.0, .flags = FLAGS}, - - { "transpose", "set transpose direction", OFFSET(transpose), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 6, FLAGS, "transpose"}, - { "cclock_hflip", "rotate counter-clockwise with horizontal flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK_FLIP }, .flags=FLAGS, .unit = "transpose" }, - { "clock", "rotate clockwise", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK }, .flags=FLAGS, .unit = "transpose" }, - { "cclock", "rotate counter-clockwise", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK }, .flags=FLAGS, .unit = "transpose" }, - { "clock_hflip", "rotate clockwise with horizontal flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK_FLIP }, .flags=FLAGS, .unit = "transpose" }, - { "reversal", "rotate by half-turn", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_REVERSAL }, .flags=FLAGS, .unit = "transpose" }, - { "hflip", "flip horizontally", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_HFLIP }, .flags=FLAGS, .unit = "transpose" }, - { "vflip", "flip vertically", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_VFLIP }, .flags=FLAGS, .unit = "transpose" }, - - { "cw", "set the width crop area expression", OFFSET(cw), AV_OPT_TYPE_STRING, { .str = "iw" }, 0, 0, FLAGS }, - { "ch", "set the height crop area expression", OFFSET(ch), AV_OPT_TYPE_STRING, { .str = "ih" }, 0, 0, FLAGS }, - { "cx", "set the x crop area expression", OFFSET(cx), AV_OPT_TYPE_STRING, { .str = "(in_w-out_w)/2" }, 0, 0, FLAGS }, - { "cy", "set the y crop area expression", OFFSET(cy), AV_OPT_TYPE_STRING, { .str = "(in_h-out_h)/2" }, 0, 0, FLAGS }, - - { "w", "Output video width", OFFSET(ow), AV_OPT_TYPE_STRING, { .str="cw" }, 0, 255, .flags = FLAGS }, - { "width", "Output video width", OFFSET(ow), AV_OPT_TYPE_STRING, { .str="cw" }, 0, 255, .flags = FLAGS }, - { "h", "Output video height", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS }, - { "height", "Output video height", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS }, - { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS }, - { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, - { "scale_mode", "scale mode: 0=auto, 1=low power, 2=high quality", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT }, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, .flags = FLAGS, "scale mode" }, - { NULL } -}; - static const char *const var_names[] = { "iw", "in_w", "ih", "in_h", @@ -146,32 +113,41 @@ "ch", "cx", "cy", + "a", "dar", + "sar", NULL }; enum var_name { - VAR_iW, VAR_IN_W, - VAR_iH, VAR_IN_H, - VAR_oW, VAR_OUT_W, VAR_W, - VAR_oH, VAR_OUT_H, VAR_H, - CW, - CH, - CX, - CY, + VAR_IW, VAR_IN_W, + VAR_IH, VAR_IN_H, + VAR_OW, VAR_OUT_W, VAR_W, + VAR_OH, VAR_OUT_H, VAR_H, + VAR_CW, + VAR_CH, + VAR_CX, + VAR_CY, + VAR_A, VAR_DAR, + VAR_SAR, VAR_VARS_NB }; static int eval_expr(AVFilterContext *ctx) { #define PASS_EXPR(e, s) {\ - ret = av_expr_parse(&e, s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \ - if (ret < 0) {\ - av_log(ctx, AV_LOG_ERROR, "Error when passing '%s'.\n", s);\ - goto release;\ + if (s) {\ + ret = av_expr_parse(&e, s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \ + if (ret < 0) { \ + av_log(ctx, AV_LOG_ERROR, "Error when passing '%s'.\n", s); \ + goto release; \ + } \ }\ } -#define CALC_EXPR(e, v, i) {\ - i = v = av_expr_eval(e, var_values, NULL); \ +#define CALC_EXPR(e, v, i, d) {\ + if (e)\ + i = v = av_expr_eval(e, var_values, NULL); \ + else\ + i = v = d;\ } VPPContext *vpp = ctx->priv; double var_values[VAR_VARS_NB] = { NAN }; @@ -189,39 +165,43 @@ PASS_EXPR(cx_expr, vpp->cx); PASS_EXPR(cy_expr, vpp->cy); - var_values[VAR_iW] = + var_values[VAR_IW] = var_values[VAR_IN_W] = ctx->inputs[0]->w; - var_values[VAR_iH] = + var_values[VAR_IH] = var_values[VAR_IN_H] = ctx->inputs[0]->h; + var_values[VAR_A] = (double)var_values[VAR_IN_W] / var_values[VAR_IN_H]; + var_values[VAR_SAR] = ctx->inputs[0]->sample_aspect_ratio.num ? + (double)ctx->inputs[0]->sample_aspect_ratio.num / ctx->inputs[0]->sample_aspect_ratio.den : 1; + var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR]; + /* crop params */ - CALC_EXPR(cw_expr, var_values[CW], vpp->crop_w); - CALC_EXPR(ch_expr, var_values[CH], vpp->crop_h); + CALC_EXPR(cw_expr, var_values[VAR_CW], vpp->crop_w, var_values[VAR_IW]); + CALC_EXPR(ch_expr, var_values[VAR_CH], vpp->crop_h, var_values[VAR_IH]); /* calc again in case cw is relative to ch */ - CALC_EXPR(cw_expr, var_values[CW], vpp->crop_w); + CALC_EXPR(cw_expr, var_values[VAR_CW], vpp->crop_w, var_values[VAR_IW]); CALC_EXPR(w_expr, - var_values[VAR_OUT_W] = var_values[VAR_oW] = var_values[VAR_W], - vpp->out_width); + var_values[VAR_OUT_W] = var_values[VAR_OW] = var_values[VAR_W], + vpp->out_width, var_values[VAR_CW]); CALC_EXPR(h_expr, - var_values[VAR_OUT_H] = var_values[VAR_oH] = var_values[VAR_H], - vpp->out_height); + var_values[VAR_OUT_H] = var_values[VAR_OH] = var_values[VAR_H], + vpp->out_height, var_values[VAR_CH]); /* calc again in case ow is relative to oh */ CALC_EXPR(w_expr, - var_values[VAR_OUT_W] = var_values[VAR_oW] = var_values[VAR_W], - vpp->out_width); - + var_values[VAR_OUT_W] = var_values[VAR_OW] = var_values[VAR_W], + vpp->out_width, var_values[VAR_CW]); - CALC_EXPR(cx_expr, var_values[CX], vpp->crop_x); - CALC_EXPR(cy_expr, var_values[CY], vpp->crop_y); + CALC_EXPR(cx_expr, var_values[VAR_CX], vpp->crop_x, (var_values[VAR_IW] - var_values[VAR_OW]) / 2); + CALC_EXPR(cy_expr, var_values[VAR_CY], vpp->crop_y, (var_values[VAR_IH] - var_values[VAR_OH]) / 2); /* calc again in case cx is relative to cy */ - CALC_EXPR(cx_expr, var_values[CX], vpp->crop_x); + CALC_EXPR(cx_expr, var_values[VAR_CX], vpp->crop_x, (var_values[VAR_IW] - var_values[VAR_OW]) / 2); - if ((vpp->crop_w != var_values[VAR_iW]) || (vpp->crop_h != var_values[VAR_iH])) + if ((vpp->crop_w != var_values[VAR_IW]) || (vpp->crop_h != var_values[VAR_IH])) vpp->use_crop = 1; release: @@ -237,11 +217,26 @@ return ret; } +static av_cold int vpp_preinit(AVFilterContext *ctx) +{ + VPPContext *vpp = ctx->priv; + /* For AV_OPT_TYPE_STRING options, NULL is handled in other way so + * we needn't set default value here + */ + vpp->saturation = 1.0; + vpp->contrast = 1.0; + vpp->transpose = -1; + + vpp->has_passthrough = 1; + + return 0; +} + static av_cold int vpp_init(AVFilterContext *ctx) { VPPContext *vpp = ctx->priv; - if (!strcmp(vpp->output_format_str, "same")) { + if (!vpp->output_format_str || !strcmp(vpp->output_format_str, "same")) { vpp->out_format = AV_PIX_FMT_NONE; } else { vpp->out_format = av_get_pix_fmt(vpp->output_format_str); @@ -259,10 +254,16 @@ AVFilterContext *ctx = inlink->dst; VPPContext *vpp = ctx->priv; int ret; + int64_t ow, oh; - if (vpp->framerate.den == 0 || vpp->framerate.num == 0) + if (vpp->framerate.den == 0 || vpp->framerate.num == 0) { vpp->framerate = inlink->frame_rate; + if (vpp->deinterlace && vpp->field_rate) + vpp->framerate = av_mul_q(inlink->frame_rate, + (AVRational){ 2, 1 }); + } + if (av_cmp_q(vpp->framerate, inlink->frame_rate)) vpp->use_frc = 1; @@ -272,11 +273,38 @@ return ret; } - if (vpp->out_height == 0 || vpp->out_width == 0) { - vpp->out_width = inlink->w; - vpp->out_height = inlink->h; + ow = vpp->out_width; + oh = vpp->out_height; + + /* sanity check params */ + if (ow < -1 || oh < -1) { + av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n"); + return AVERROR(EINVAL); } + if (ow == -1 && oh == -1) + vpp->out_width = vpp->out_height = 0; + + if (!(ow = vpp->out_width)) + ow = inlink->w; + + if (!(oh = vpp->out_height)) + oh = inlink->h; + + if (ow == -1) + ow = av_rescale(oh, inlink->w, inlink->h); + + if (oh == -1) + oh = av_rescale(ow, inlink->h, inlink->w); + + if (ow > INT_MAX || oh > INT_MAX || + (oh * inlink->w) > INT_MAX || + (ow * inlink->h) > INT_MAX) + av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n"); + + vpp->out_width = ow; + vpp->out_height = oh; + if (vpp->use_crop) { vpp->crop_x = FFMAX(vpp->crop_x, 0); vpp->crop_y = FFMAX(vpp->crop_y, 0); @@ -330,12 +358,11 @@ outlink->w = vpp->out_width; outlink->h = vpp->out_height; outlink->frame_rate = vpp->framerate; - outlink->time_base = inlink->time_base; + outlink->time_base = av_inv_q(vpp->framerate); param.filter_frame = NULL; param.num_ext_buf = 0; param.ext_buf = ext_buf; - param.async_depth = vpp->async_depth; if (get_mfx_version(ctx, &mfx_version) != MFX_ERR_NONE) { av_log(ctx, AV_LOG_ERROR, "Failed to query mfx version.\n"); @@ -365,53 +392,44 @@ param.crop = &crop; } - if (vpp->deinterlace) { - memset(&vpp->deinterlace_conf, 0, sizeof(mfxExtVPPDeinterlacing)); - vpp->deinterlace_conf.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING; - vpp->deinterlace_conf.Header.BufferSz = sizeof(mfxExtVPPDeinterlacing); - vpp->deinterlace_conf.Mode = vpp->deinterlace == 1 ? - MFX_DEINTERLACING_BOB : MFX_DEINTERLACING_ADVANCED; +#define INIT_MFX_EXTBUF(extbuf, id) do { \ + memset(&vpp->extbuf, 0, sizeof(vpp->extbuf)); \ + vpp->extbuf.Header.BufferId = id; \ + vpp->extbuf.Header.BufferSz = sizeof(vpp->extbuf); \ + param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->extbuf; \ + } while (0) + +#define SET_MFX_PARAM_FIELD(extbuf, field, value) do { \ + vpp->extbuf.field = value; \ + } while (0) - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->deinterlace_conf; + if (vpp->deinterlace) { + INIT_MFX_EXTBUF(deinterlace_conf, MFX_EXTBUFF_VPP_DEINTERLACING); + SET_MFX_PARAM_FIELD(deinterlace_conf, Mode, (vpp->deinterlace == 1 ? + MFX_DEINTERLACING_BOB : MFX_DEINTERLACING_ADVANCED)); } if (vpp->use_frc) { - memset(&vpp->frc_conf, 0, sizeof(mfxExtVPPFrameRateConversion)); - vpp->frc_conf.Header.BufferId = MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION; - vpp->frc_conf.Header.BufferSz = sizeof(mfxExtVPPFrameRateConversion); - vpp->frc_conf.Algorithm = MFX_FRCALGM_DISTRIBUTED_TIMESTAMP; - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->frc_conf; + INIT_MFX_EXTBUF(frc_conf, MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION); + SET_MFX_PARAM_FIELD(frc_conf, Algorithm, MFX_FRCALGM_DISTRIBUTED_TIMESTAMP); } if (vpp->denoise) { - memset(&vpp->denoise_conf, 0, sizeof(mfxExtVPPDenoise)); - vpp->denoise_conf.Header.BufferId = MFX_EXTBUFF_VPP_DENOISE; - vpp->denoise_conf.Header.BufferSz = sizeof(mfxExtVPPDenoise); - vpp->denoise_conf.DenoiseFactor = vpp->denoise; - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->denoise_conf; + INIT_MFX_EXTBUF(denoise_conf, MFX_EXTBUFF_VPP_DENOISE); + SET_MFX_PARAM_FIELD(denoise_conf, DenoiseFactor, vpp->denoise); } if (vpp->detail) { - memset(&vpp->detail_conf, 0, sizeof(mfxExtVPPDetail)); - vpp->detail_conf.Header.BufferId = MFX_EXTBUFF_VPP_DETAIL; - vpp->detail_conf.Header.BufferSz = sizeof(mfxExtVPPDetail); - vpp->detail_conf.DetailFactor = vpp->detail; - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->detail_conf; + INIT_MFX_EXTBUF(detail_conf, MFX_EXTBUFF_VPP_DETAIL); + SET_MFX_PARAM_FIELD(detail_conf, DetailFactor, vpp->detail); } if (vpp->procamp) { - memset(&vpp->procamp_conf, 0, sizeof(mfxExtVPPProcAmp)); - vpp->procamp_conf.Header.BufferId = MFX_EXTBUFF_VPP_PROCAMP; - vpp->procamp_conf.Header.BufferSz = sizeof(mfxExtVPPProcAmp); - vpp->procamp_conf.Hue = vpp->hue; - vpp->procamp_conf.Saturation = vpp->saturation; - vpp->procamp_conf.Contrast = vpp->contrast; - vpp->procamp_conf.Brightness = vpp->brightness; - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->procamp_conf; + INIT_MFX_EXTBUF(procamp_conf, MFX_EXTBUFF_VPP_PROCAMP); + SET_MFX_PARAM_FIELD(procamp_conf, Hue, vpp->hue); + SET_MFX_PARAM_FIELD(procamp_conf, Saturation, vpp->saturation); + SET_MFX_PARAM_FIELD(procamp_conf, Contrast, vpp->contrast); + SET_MFX_PARAM_FIELD(procamp_conf, Brightness, vpp->brightness); } if (vpp->transpose >= 0) { @@ -458,18 +476,14 @@ if (vpp->rotate) { if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 17)) { - memset(&vpp->rotation_conf, 0, sizeof(mfxExtVPPRotation)); - vpp->rotation_conf.Header.BufferId = MFX_EXTBUFF_VPP_ROTATION; - vpp->rotation_conf.Header.BufferSz = sizeof(mfxExtVPPRotation); - vpp->rotation_conf.Angle = vpp->rotate; + INIT_MFX_EXTBUF(rotation_conf, MFX_EXTBUFF_VPP_ROTATION); + SET_MFX_PARAM_FIELD(rotation_conf, Angle, vpp->rotate); if (MFX_ANGLE_90 == vpp->rotate || MFX_ANGLE_270 == vpp->rotate) { FFSWAP(int, vpp->out_width, vpp->out_height); FFSWAP(int, outlink->w, outlink->h); av_log(ctx, AV_LOG_DEBUG, "Swap width and height for clock/cclock rotation.\n"); } - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->rotation_conf; } else { av_log(ctx, AV_LOG_WARNING, "The QSV VPP rotate option is " "not supported with this MSDK version.\n"); @@ -479,12 +493,8 @@ if (vpp->hflip) { if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) { - memset(&vpp->mirroring_conf, 0, sizeof(mfxExtVPPMirroring)); - vpp->mirroring_conf.Header.BufferId = MFX_EXTBUFF_VPP_MIRRORING; - vpp->mirroring_conf.Header.BufferSz = sizeof(mfxExtVPPMirroring); - vpp->mirroring_conf.Type = vpp->hflip; - - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->mirroring_conf; + INIT_MFX_EXTBUF(mirroring_conf, MFX_EXTBUFF_VPP_MIRRORING); + SET_MFX_PARAM_FIELD(mirroring_conf, Type, vpp->hflip); } else { av_log(ctx, AV_LOG_WARNING, "The QSV VPP hflip option is " "not supported with this MSDK version.\n"); @@ -492,24 +502,32 @@ } } - if (inlink->w != outlink->w || inlink->h != outlink->h) { + if (inlink->w != outlink->w || inlink->h != outlink->h || in_format != vpp->out_format) { if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) { - memset(&vpp->scale_conf, 0, sizeof(mfxExtVPPScaling)); - vpp->scale_conf.Header.BufferId = MFX_EXTBUFF_VPP_SCALING; - vpp->scale_conf.Header.BufferSz = sizeof(mfxExtVPPScaling); - vpp->scale_conf.ScalingMode = vpp->scale_mode; + int mode = vpp->scale_mode; + +#if QSV_ONEVPL + if (mode > 2) + mode = MFX_SCALING_MODE_VENDOR + mode - 2; +#endif - param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->scale_conf; + INIT_MFX_EXTBUF(scale_conf, MFX_EXTBUFF_VPP_SCALING); + SET_MFX_PARAM_FIELD(scale_conf, ScalingMode, mode); } else - av_log(ctx, AV_LOG_WARNING, "The QSV VPP Scale option is " - "not supported with this MSDK version.\n"); + av_log(ctx, AV_LOG_WARNING, "The QSV VPP Scale & format conversion " + "option is not supported with this MSDK version.\n"); } +#undef INIT_MFX_EXTBUF +#undef SET_MFX_PARAM_FIELD + if (vpp->use_frc || vpp->use_crop || vpp->deinterlace || vpp->denoise || vpp->detail || vpp->procamp || vpp->rotate || vpp->hflip || - inlink->w != outlink->w || inlink->h != outlink->h || in_format != vpp->out_format) - return ff_qsvvpp_create(ctx, &vpp->qsv, ¶m); + inlink->w != outlink->w || inlink->h != outlink->h || in_format != vpp->out_format || + !vpp->has_passthrough) + return ff_qsvvpp_init(ctx, ¶m); else { + /* No MFX session is created in this case */ av_log(ctx, AV_LOG_VERBOSE, "qsv vpp pass through mode.\n"); if (inlink->hw_frames_ctx) outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx); @@ -522,29 +540,27 @@ { AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; - VPPContext *s =ctx->priv; - QSVVPPContext *qsv = s->qsv; + QSVVPPContext *qsv = ctx->priv; AVFrame *in = NULL; int ret, status = 0; int64_t pts = AV_NOPTS_VALUE; FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); - if (!s->eof) { + if (!qsv->eof) { ret = ff_inlink_consume_frame(inlink, &in); if (ret < 0) return ret; if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { if (status == AVERROR_EOF) { - s->eof = 1; + qsv->eof = 1; } } } - if (qsv) { - if (in || s->eof) { - qsv->eof = s->eof; + if (qsv->session) { + if (in || qsv->eof) { ret = ff_qsvvpp_filter_frame(qsv, inlink, in); av_frame_free(&in); if (ret == AVERROR(EAGAIN)) @@ -552,7 +568,7 @@ else if (ret < 0) return ret; - if (s->eof) + if (qsv->eof) goto eof; if (qsv->got_frame) { @@ -561,6 +577,7 @@ } } } else { + /* No MFX session is created in pass-through mode */ if (in) { if (in->pts != AV_NOPTS_VALUE) in->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base); @@ -569,7 +586,7 @@ if (ret < 0) return ret; - if (s->eof) + if (qsv->eof) goto eof; return 0; @@ -577,7 +594,7 @@ } not_ready: - if (s->eof) + if (qsv->eof) goto eof; FF_FILTER_FORWARD_WANTED(outlink, inlink); @@ -589,7 +606,111 @@ return 0; } -static int query_formats(AVFilterContext *ctx) +static av_cold void vpp_uninit(AVFilterContext *ctx) +{ + ff_qsvvpp_close(ctx); +} + +static const AVFilterPad vpp_inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_input, + .get_buffer.video = ff_qsvvpp_get_video_buffer, + }, +}; + +static const AVFilterPad vpp_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output, + }, +}; + +#define DEFINE_QSV_FILTER(x, sn, ln, fmts) \ +static const AVClass x##_class = { \ + .class_name = #sn "_qsv", \ + .item_name = av_default_item_name, \ + .option = x##_options, \ + .version = LIBAVUTIL_VERSION_INT, \ +}; \ +const AVFilter ff_vf_##sn##_qsv = { \ + .name = #sn "_qsv", \ + .description = NULL_IF_CONFIG_SMALL("Quick Sync Video " #ln), \ + .preinit = x##_preinit, \ + .init = vpp_init, \ + .uninit = vpp_uninit, \ + .priv_size = sizeof(VPPContext), \ + .priv_class = &x##_class, \ + FILTER_INPUTS(vpp_inputs), \ + FILTER_OUTPUTS(vpp_outputs), \ + fmts, \ + .activate = activate, \ + .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, \ +}; + +#if CONFIG_VPP_QSV_FILTER + +static const AVOption vpp_options[] = { + { "deinterlace", "deinterlace mode: 0=off, 1=bob, 2=advanced", OFFSET(deinterlace), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MFX_DEINTERLACING_ADVANCED, .flags = FLAGS, "deinterlace" }, + { "bob", "Bob deinterlace mode.", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_DEINTERLACING_BOB }, .flags = FLAGS, "deinterlace" }, + { "advanced", "Advanced deinterlace mode. ", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_DEINTERLACING_ADVANCED }, .flags = FLAGS, "deinterlace" }, + + { "denoise", "denoise level [0, 100]", OFFSET(denoise), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, .flags = FLAGS }, + { "detail", "enhancement level [0, 100]", OFFSET(detail), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 100, .flags = FLAGS }, + { "framerate", "output framerate", OFFSET(framerate), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 },0, DBL_MAX, .flags = FLAGS }, + { "procamp", "Enable ProcAmp", OFFSET(procamp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS}, + { "hue", "ProcAmp hue", OFFSET(hue), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, -180.0, 180.0, .flags = FLAGS}, + { "saturation", "ProcAmp saturation", OFFSET(saturation), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 10.0, .flags = FLAGS}, + { "contrast", "ProcAmp contrast", OFFSET(contrast), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 10.0, .flags = FLAGS}, + { "brightness", "ProcAmp brightness", OFFSET(brightness), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, -100.0, 100.0, .flags = FLAGS}, + + { "transpose", "set transpose direction", OFFSET(transpose), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 6, FLAGS, "transpose"}, + { "cclock_hflip", "rotate counter-clockwise with horizontal flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK_FLIP }, .flags=FLAGS, .unit = "transpose" }, + { "clock", "rotate clockwise", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK }, .flags=FLAGS, .unit = "transpose" }, + { "cclock", "rotate counter-clockwise", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CCLOCK }, .flags=FLAGS, .unit = "transpose" }, + { "clock_hflip", "rotate clockwise with horizontal flip", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_CLOCK_FLIP }, .flags=FLAGS, .unit = "transpose" }, + { "reversal", "rotate by half-turn", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_REVERSAL }, .flags=FLAGS, .unit = "transpose" }, + { "hflip", "flip horizontally", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_HFLIP }, .flags=FLAGS, .unit = "transpose" }, + { "vflip", "flip vertically", 0, AV_OPT_TYPE_CONST, { .i64 = TRANSPOSE_VFLIP }, .flags=FLAGS, .unit = "transpose" }, + + { "cw", "set the width crop area expression", OFFSET(cw), AV_OPT_TYPE_STRING, { .str = "iw" }, 0, 0, FLAGS }, + { "ch", "set the height crop area expression", OFFSET(ch), AV_OPT_TYPE_STRING, { .str = "ih" }, 0, 0, FLAGS }, + { "cx", "set the x crop area expression", OFFSET(cx), AV_OPT_TYPE_STRING, { .str = "(in_w-out_w)/2" }, 0, 0, FLAGS }, + { "cy", "set the y crop area expression", OFFSET(cy), AV_OPT_TYPE_STRING, { .str = "(in_h-out_h)/2" }, 0, 0, FLAGS }, + + { "w", "Output video width(0=input video width, -1=keep input video aspect)", OFFSET(ow), AV_OPT_TYPE_STRING, { .str="cw" }, 0, 255, .flags = FLAGS }, + { "width", "Output video width(0=input video width, -1=keep input video aspect)", OFFSET(ow), AV_OPT_TYPE_STRING, { .str="cw" }, 0, 255, .flags = FLAGS }, + { "h", "Output video height(0=input video height, -1=keep input video aspect)", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS }, + { "height", "Output video height(0=input video height, -1=keep input video aspect)", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS }, + { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS }, + { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS }, +#if QSV_ONEVPL + { "scale_mode", "scaling & format conversion mode (mode compute(3), vd(4) and ve(5) are only available on some platforms)", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 5, .flags = FLAGS, "scale mode" }, +#else + { "scale_mode", "scaling & format conversion mode", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT }, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, .flags = FLAGS, "scale mode" }, +#endif + { "auto", "auto mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_DEFAULT}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, + { "low_power", "low power mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, + { "hq", "high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_QUALITY}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, +#if QSV_ONEVPL + { "compute", "compute", 0, AV_OPT_TYPE_CONST, { .i64 = 3}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, + { "vd", "vd", 0, AV_OPT_TYPE_CONST, { .i64 = 4}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, + { "ve", "ve", 0, AV_OPT_TYPE_CONST, { .i64 = 5}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, +#endif + + { "rate", "Generate output at frame rate or field rate, available only for deinterlace mode", + OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "rate" }, + { "frame", "Output at frame rate (one frame of output for each field-pair)", + 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "rate" }, + { "field", "Output at field rate (one frame of output for each field)", + 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "rate" }, + + { NULL } +}; + +static int vpp_query_formats(AVFilterContext *ctx) { int ret; static const enum AVPixelFormat in_pix_fmts[] = { @@ -597,6 +718,10 @@ AV_PIX_FMT_NV12, AV_PIX_FMT_YUYV422, AV_PIX_FMT_RGB32, + AV_PIX_FMT_P010, +#if CONFIG_VAAPI + AV_PIX_FMT_UYVY422, +#endif AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }; @@ -615,46 +740,68 @@ &ctx->outputs[0]->incfg.formats); } -static av_cold void vpp_uninit(AVFilterContext *ctx) +DEFINE_QSV_FILTER(vpp, vpp, "VPP", FILTER_QUERY_FUNC(vpp_query_formats)); + +#endif + +#if CONFIG_SCALE_QSV_FILTER + +static const AVOption qsvscale_options[] = { + { "w", "Output video width(0=input video width, -1=keep input video aspect)", OFFSET(ow), AV_OPT_TYPE_STRING, { .str = "iw" }, .flags = FLAGS }, + { "h", "Output video height(0=input video height, -1=keep input video aspect)", OFFSET(oh), AV_OPT_TYPE_STRING, { .str = "ih" }, .flags = FLAGS }, + { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS }, + +#if QSV_ONEVPL + { "mode", "scaling & format conversion mode (mode compute(3), vd(4) and ve(5) are only available on some platforms)", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 5, FLAGS, "mode"}, +#else + { "mode", "scaling & format conversion mode", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT}, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, FLAGS, "mode"}, +#endif + { "low_power", "low power mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "mode"}, + { "hq", "high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_QUALITY}, INT_MIN, INT_MAX, FLAGS, "mode"}, +#if QSV_ONEVPL + { "compute", "compute", 0, AV_OPT_TYPE_CONST, { .i64 = 3}, INT_MIN, INT_MAX, FLAGS, "mode"}, + { "vd", "vd", 0, AV_OPT_TYPE_CONST, { .i64 = 4}, INT_MIN, INT_MAX, FLAGS, "mode"}, + { "ve", "ve", 0, AV_OPT_TYPE_CONST, { .i64 = 5}, INT_MIN, INT_MAX, FLAGS, "mode"}, +#endif + + { NULL }, +}; + +static av_cold int qsvscale_preinit(AVFilterContext *ctx) { - VPPContext *vpp = ctx->priv; + VPPContext *vpp = ctx->priv; - ff_qsvvpp_free(&vpp->qsv); + vpp_preinit(ctx); + vpp->has_passthrough = 0; + + return 0; } -static const AVClass vpp_class = { - .class_name = "vpp_qsv", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; +DEFINE_QSV_FILTER(qsvscale, scale, "scaling and format conversion", FILTER_SINGLE_PIXFMT(AV_PIX_FMT_QSV)); -static const AVFilterPad vpp_inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_input, - }, -}; +#endif -static const AVFilterPad vpp_outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_output, - }, -}; +#if CONFIG_DEINTERLACE_QSV_FILTER -const AVFilter ff_vf_vpp_qsv = { - .name = "vpp_qsv", - .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."), - .priv_size = sizeof(VPPContext), - .init = vpp_init, - .uninit = vpp_uninit, - FILTER_INPUTS(vpp_inputs), - FILTER_OUTPUTS(vpp_outputs), - FILTER_QUERY_FUNC(query_formats), - .activate = activate, - .priv_class = &vpp_class, - .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, +static const AVOption qsvdeint_options[] = { + { "mode", "set deinterlace mode", OFFSET(deinterlace), AV_OPT_TYPE_INT, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, + { "bob", "bob algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_BOB}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, + { "advanced", "Motion adaptive algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"}, + + { NULL }, }; + +static av_cold int qsvdeint_preinit(AVFilterContext *ctx) +{ + VPPContext *vpp = ctx->priv; + + vpp_preinit(ctx); + vpp->has_passthrough = 0; + vpp->field_rate = 1; + + return 0; +} + +DEFINE_QSV_FILTER(qsvdeint, deinterlace, "deinterlacing", FILTER_SINGLE_PIXFMT(AV_PIX_FMT_QSV)) + +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_yadif.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_yadif.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_yadif.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_yadif.c 2023-03-03 13:29:59.000000000 +0000 @@ -252,8 +252,6 @@ ff_filter_execute(ctx, filter_slice, &td, NULL, FFMIN(h, ff_filter_get_nb_threads(ctx))); } - - emms_c(); } static av_cold void uninit(AVFilterContext *ctx) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_zscale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_zscale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_zscale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vf_zscale.c 2023-03-03 13:29:59.000000000 +0000 @@ -1033,6 +1033,7 @@ { "bt470m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_470_M}, 0, 0, FLAGS, "transfer" }, { "bt470bg", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_470_BG}, 0, 0, FLAGS, "transfer" }, { "smpte170m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_601}, 0, 0, FLAGS, "transfer" }, + { "smpte240m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_240M}, 0, 0, FLAGS, "transfer" }, { "bt709", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_709}, 0, 0, FLAGS, "transfer" }, { "linear", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_LINEAR}, 0, 0, FLAGS, "transfer" }, { "log100", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_TRANSFER_LOG_100}, 0, 0, FLAGS, "transfer" }, @@ -1058,7 +1059,7 @@ { "fcc", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_FCC}, 0, 0, FLAGS, "matrix" }, { "bt470bg", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_470BG}, 0, 0, FLAGS, "matrix" }, { "smpte170m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_170M}, 0, 0, FLAGS, "matrix" }, - { "smpte2400m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_240M}, 0, 0, FLAGS, "matrix" }, + { "smpte240m", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_240M}, 0, 0, FLAGS, "matrix" }, { "ycgco", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_YCGCO}, 0, 0, FLAGS, "matrix" }, { "bt2020nc", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_2020_NCL}, 0, 0, FLAGS, "matrix" }, { "bt2020c", 0, 0, AV_OPT_TYPE_CONST, {.i64 = ZIMG_MATRIX_2020_CL}, 0, 0, FLAGS, "matrix" }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/video.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/video.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/video.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/video.c 2023-03-03 13:29:59.000000000 +0000 @@ -102,7 +102,7 @@ { AVFrame *ret = NULL; - FF_TPRINTF_START(NULL, get_video_buffer); ff_tlog_link(NULL, link, 0); + FF_TPRINTF_START(NULL, get_video_buffer); ff_tlog_link(NULL, link, 1); if (link->dstpad->get_buffer.video) ret = link->dstpad->get_buffer.video(link, w, h); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_cellauto.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_cellauto.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_cellauto.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_cellauto.c 2023-03-03 13:29:59.000000000 +0000 @@ -302,6 +302,7 @@ evolve(outlink->src); picref->pts = s->pts++; + picref->duration = 1; #ifdef DEBUG show_cellauto_row(outlink->src); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1059 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" + +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0A00 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0A00 +#endif +#define WIN32_LEAN_AND_MEAN + +#include + +#define COBJMACROS + +#include +#include +#include +#if HAVE_IDXGIOUTPUT5 +#include +#endif + +#include "libavutil/opt.h" +#include "libavutil/time.h" +#include "libavutil/avstring.h" +#include "libavutil/avassert.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_d3d11va.h" +#include "compat/w32dlfcn.h" +#include "avfilter.h" +#include "internal.h" +#include "formats.h" +#include "video.h" + +#include "vsrc_ddagrab_shaders.h" + +// avutil/time.h takes and returns time in microseconds +#define TIMER_RES 1000000 +#define TIMER_RES64 INT64_C(1000000) + +typedef struct DdagrabContext { + const AVClass *class; + + AVBufferRef *device_ref; + AVHWDeviceContext *device_ctx; + AVD3D11VADeviceContext *device_hwctx; + + AVBufferRef *frames_ref; + AVHWFramesContext *frames_ctx; + AVD3D11VAFramesContext *frames_hwctx; + + DXGI_OUTPUT_DESC output_desc; + IDXGIOutputDuplication *dxgi_outdupl; + AVFrame *last_frame; + + int mouse_x, mouse_y; + ID3D11Texture2D *mouse_texture; + ID3D11ShaderResourceView* mouse_resource_view ; + + AVRational time_base; + int64_t time_frame; + int64_t time_timeout; + int64_t first_pts; + + DXGI_FORMAT raw_format; + int raw_width; + int raw_height; + + ID3D11Texture2D *probed_texture; + + ID3D11VertexShader *vertex_shader; + ID3D11InputLayout *input_layout; + ID3D11PixelShader *pixel_shader; + ID3D11Buffer *const_buffer; + ID3D11SamplerState *sampler_state; + ID3D11BlendState *blend_state; + + int output_idx; + int draw_mouse; + AVRational framerate; + int width; + int height; + int offset_x; + int offset_y; + int out_fmt; + int allow_fallback; + int force_fmt; +} DdagrabContext; + +#define OFFSET(x) offsetof(DdagrabContext, x) +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +static const AVOption ddagrab_options[] = { + { "output_idx", "dda output index to capture", OFFSET(output_idx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, + { "draw_mouse", "draw the mouse pointer", OFFSET(draw_mouse), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS }, + { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "30" }, 0, INT_MAX, FLAGS }, + { "video_size", "set video frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, + { "offset_x", "capture area x offset", OFFSET(offset_x), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS }, + { "offset_y", "capture area y offset", OFFSET(offset_y), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS }, + { "output_fmt", "desired output format", OFFSET(out_fmt), AV_OPT_TYPE_INT, { .i64 = DXGI_FORMAT_B8G8R8A8_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "auto", "let dda pick its preferred format", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "8bit", "only output default 8 Bit format", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_B8G8R8A8_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "bgra", "only output 8 Bit BGRA", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_B8G8R8A8_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "10bit", "only output default 10 Bit format", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R10G10B10A2_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "x2bgr10", "only output 10 Bit X2BGR10", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R10G10B10A2_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" }, + { "16bit", "only output default 16 Bit format", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" }, + { "rgbaf16", "only output 16 Bit RGBAF16", 0, AV_OPT_TYPE_CONST, { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" }, + { "allow_fallback", "don't error on fallback to default 8 Bit format", + OFFSET(allow_fallback), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { "force_fmt", "exclude BGRA from format list (experimental, discouraged by Microsoft)", + OFFSET(force_fmt), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { NULL } +}; + +AVFILTER_DEFINE_CLASS(ddagrab); + +static inline void release_resource(void *resource) +{ + IUnknown **resp = (IUnknown**)resource; + if (*resp) { + IUnknown_Release(*resp); + *resp = NULL; + } +} + +static av_cold void ddagrab_uninit(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + + release_resource(&dda->blend_state); + release_resource(&dda->sampler_state); + release_resource(&dda->pixel_shader); + release_resource(&dda->input_layout); + release_resource(&dda->vertex_shader); + release_resource(&dda->const_buffer); + + release_resource(&dda->probed_texture); + + release_resource(&dda->dxgi_outdupl); + release_resource(&dda->mouse_resource_view); + release_resource(&dda->mouse_texture); + + av_frame_free(&dda->last_frame); + av_buffer_unref(&dda->frames_ref); + av_buffer_unref(&dda->device_ref); +} + +static av_cold int init_dxgi_dda(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + IDXGIDevice *dxgi_device = NULL; + IDXGIAdapter *dxgi_adapter = NULL; + IDXGIOutput *dxgi_output = NULL; + IDXGIOutput1 *dxgi_output1 = NULL; +#if HAVE_IDXGIOUTPUT5 && HAVE_DPI_AWARENESS_CONTEXT + IDXGIOutput5 *dxgi_output5 = NULL; + + typedef DPI_AWARENESS_CONTEXT (*set_thread_dpi_t)(DPI_AWARENESS_CONTEXT); + set_thread_dpi_t set_thread_dpi; + HMODULE user32_module; +#endif + int w, h; + HRESULT hr; + + hr = ID3D11Device_QueryInterface(dda->device_hwctx->device, &IID_IDXGIDevice, (void**)&dxgi_device); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed querying IDXGIDevice\n"); + return AVERROR_EXTERNAL; + } + + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter, (void**)&dxgi_adapter); + IDXGIDevice_Release(dxgi_device); + dxgi_device = NULL; + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed getting parent IDXGIAdapter\n"); + return AVERROR_EXTERNAL; + } + + hr = IDXGIAdapter_EnumOutputs(dxgi_adapter, dda->output_idx, &dxgi_output); + IDXGIAdapter_Release(dxgi_adapter); + dxgi_adapter = NULL; + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed to enumerate DXGI output %d\n", dda->output_idx); + return AVERROR_EXTERNAL; + } + + hr = IDXGIOutput_GetDesc(dxgi_output, &dda->output_desc); + if (FAILED(hr)) { + IDXGIOutput_Release(dxgi_output); + av_log(avctx, AV_LOG_ERROR, "Failed getting output description\n"); + return AVERROR_EXTERNAL; + } + +#if HAVE_IDXGIOUTPUT5 && HAVE_DPI_AWARENESS_CONTEXT + user32_module = dlopen("user32.dll", 0); + if (!user32_module) { + av_log(avctx, AV_LOG_ERROR, "Failed loading user32.dll\n"); + return AVERROR_EXTERNAL; + } + + set_thread_dpi = (set_thread_dpi_t)dlsym(user32_module, "SetThreadDpiAwarenessContext"); + + if (set_thread_dpi) + hr = IDXGIOutput_QueryInterface(dxgi_output, &IID_IDXGIOutput5, (void**)&dxgi_output5); + + if (set_thread_dpi && SUCCEEDED(hr)) { + DPI_AWARENESS_CONTEXT prev_dpi_ctx; + DXGI_FORMAT formats[] = { + DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R10G10B10A2_UNORM, + DXGI_FORMAT_B8G8R8A8_UNORM + }; + int nb_formats = FF_ARRAY_ELEMS(formats); + + if(dda->out_fmt == DXGI_FORMAT_B8G8R8A8_UNORM) { + formats[0] = DXGI_FORMAT_B8G8R8A8_UNORM; + nb_formats = 1; + } else if (dda->out_fmt) { + formats[0] = dda->out_fmt; + formats[1] = DXGI_FORMAT_B8G8R8A8_UNORM; + nb_formats = dda->force_fmt ? 1 : 2; + } + + IDXGIOutput_Release(dxgi_output); + dxgi_output = NULL; + + prev_dpi_ctx = set_thread_dpi(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + if (!prev_dpi_ctx) + av_log(avctx, AV_LOG_WARNING, "Failed enabling DPI awareness for DDA\n"); + + hr = IDXGIOutput5_DuplicateOutput1(dxgi_output5, + (IUnknown*)dda->device_hwctx->device, + 0, + nb_formats, + formats, + &dda->dxgi_outdupl); + IDXGIOutput5_Release(dxgi_output5); + dxgi_output5 = NULL; + + if (prev_dpi_ctx) + set_thread_dpi(prev_dpi_ctx); + + dlclose(user32_module); + user32_module = NULL; + set_thread_dpi = NULL; + + av_log(avctx, AV_LOG_DEBUG, "Using IDXGIOutput5 interface\n"); + } else { + dlclose(user32_module); + user32_module = NULL; + set_thread_dpi = NULL; + + av_log(avctx, AV_LOG_DEBUG, "Falling back to IDXGIOutput1\n"); +#else + { +#endif + if (dda->out_fmt && dda->out_fmt != DXGI_FORMAT_B8G8R8A8_UNORM && (!dda->allow_fallback || dda->force_fmt)) { + av_log(avctx, AV_LOG_ERROR, "Only 8 bit output supported with legacy API\n"); + return AVERROR(ENOTSUP); + } + + hr = IDXGIOutput_QueryInterface(dxgi_output, &IID_IDXGIOutput1, (void**)&dxgi_output1); + IDXGIOutput_Release(dxgi_output); + dxgi_output = NULL; + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed querying IDXGIOutput1\n"); + return AVERROR_EXTERNAL; + } + + hr = IDXGIOutput1_DuplicateOutput(dxgi_output1, + (IUnknown*)dda->device_hwctx->device, + &dda->dxgi_outdupl); + IDXGIOutput1_Release(dxgi_output1); + dxgi_output1 = NULL; + } + + if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { + av_log(avctx, AV_LOG_ERROR, "Too many open duplication sessions\n"); + return AVERROR(EBUSY); + } else if (hr == DXGI_ERROR_UNSUPPORTED) { + av_log(avctx, AV_LOG_ERROR, "Selected output not supported\n"); + return AVERROR_EXTERNAL; + } else if (hr == E_INVALIDARG) { + av_log(avctx, AV_LOG_ERROR, "Invalid output duplication argument\n"); + return AVERROR(EINVAL); + } else if (hr == E_ACCESSDENIED) { + av_log(avctx, AV_LOG_ERROR, "Desktop duplication access denied\n"); + return AVERROR(EPERM); + } else if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed duplicating output\n"); + return AVERROR_EXTERNAL; + } + + w = dda->output_desc.DesktopCoordinates.right - dda->output_desc.DesktopCoordinates.left; + h = dda->output_desc.DesktopCoordinates.bottom - dda->output_desc.DesktopCoordinates.top; + av_log(avctx, AV_LOG_VERBOSE, "Opened dxgi output %d with dimensions %dx%d\n", dda->output_idx, w, h); + + return 0; +} + +typedef struct ConstBufferData +{ + float width; + float height; + + uint64_t padding; +} ConstBufferData; + +static const D3D11_INPUT_ELEMENT_DESC vertex_shader_input_layout[] = +{ + { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 } +}; + +static av_cold int init_render_resources(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + ID3D11Device *dev = dda->device_hwctx->device; + D3D11_SAMPLER_DESC sampler_desc = { 0 }; + D3D11_BLEND_DESC blend_desc = { 0 }; + D3D11_BUFFER_DESC buffer_desc = { 0 }; + D3D11_SUBRESOURCE_DATA buffer_data = { 0 }; + ConstBufferData const_data = { 0 }; + HRESULT hr; + + hr = ID3D11Device_CreateVertexShader(dev, + vertex_shader_bytes, + FF_ARRAY_ELEMS(vertex_shader_bytes), + NULL, + &dda->vertex_shader); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateVertexShader failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + hr = ID3D11Device_CreateInputLayout(dev, + vertex_shader_input_layout, + FF_ARRAY_ELEMS(vertex_shader_input_layout), + vertex_shader_bytes, + FF_ARRAY_ELEMS(vertex_shader_bytes), + &dda->input_layout); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateInputLayout failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + hr = ID3D11Device_CreatePixelShader(dev, + pixel_shader_bytes, + FF_ARRAY_ELEMS(pixel_shader_bytes), + NULL, + &dda->pixel_shader); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreatePixelShader failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + const_data = (ConstBufferData){ dda->width, dda->height }; + + buffer_data.pSysMem = &const_data; + buffer_desc.ByteWidth = sizeof(const_data); + buffer_desc.Usage = D3D11_USAGE_IMMUTABLE; + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + hr = ID3D11Device_CreateBuffer(dev, + &buffer_desc, + &buffer_data, + &dda->const_buffer); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateBuffer const buffer failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; + sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + hr = ID3D11Device_CreateSamplerState(dev, + &sampler_desc, + &dda->sampler_state); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateSamplerState failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + blend_desc.AlphaToCoverageEnable = FALSE; + blend_desc.IndependentBlendEnable = FALSE; + blend_desc.RenderTarget[0].BlendEnable = TRUE; + blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; + blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; + blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; + blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + hr = ID3D11Device_CreateBlendState(dev, + &blend_desc, + &dda->blend_state); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateBlendState failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + return 0; +} + +static av_cold int ddagrab_init(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + + dda->last_frame = av_frame_alloc(); + if (!dda->last_frame) + return AVERROR(ENOMEM); + + dda->mouse_x = -1; + dda->mouse_y = -1; + + return 0; +} + +static int create_d3d11_pointer_tex(AVFilterContext *avctx, + uint8_t *buf, + DXGI_OUTDUPL_POINTER_SHAPE_INFO *shape_info, + ID3D11Texture2D **out_tex, + ID3D11ShaderResourceView **res_view) +{ + DdagrabContext *dda = avctx->priv; + D3D11_TEXTURE2D_DESC desc = { 0 }; + D3D11_SUBRESOURCE_DATA init_data = { 0 }; + D3D11_SHADER_RESOURCE_VIEW_DESC resource_desc = { 0 }; + HRESULT hr; + + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_IMMUTABLE; + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + + desc.Width = shape_info->Width; + desc.Height = shape_info->Height; + + init_data.pSysMem = buf; + init_data.SysMemPitch = shape_info->Pitch; + + resource_desc.Format = desc.Format; + resource_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; + resource_desc.Texture2D.MostDetailedMip = 0; + resource_desc.Texture2D.MipLevels = 1; + + hr = ID3D11Device_CreateTexture2D(dda->device_hwctx->device, + &desc, + &init_data, + out_tex); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "Failed creating pointer texture\n"); + return AVERROR_EXTERNAL; + } + + hr = ID3D11Device_CreateShaderResourceView(dda->device_hwctx->device, + (ID3D11Resource*)dda->mouse_texture, + &resource_desc, + res_view); + if (FAILED(hr)) { + release_resource(out_tex); + av_log(avctx, AV_LOG_ERROR, "CreateShaderResourceView for mouse failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + return 0; +} + +static uint8_t *convert_mono_buffer(uint8_t *input, int *_width, int *_height, int *_pitch) +{ + int width = *_width, height = *_height, pitch = *_pitch; + int real_height = height / 2; + uint8_t *output = av_malloc(real_height * width * 4); + int y, x; + + if (!output) + return NULL; + + // This simulates drawing the cursor on a full black surface + // i.e. ignore the AND mask, turn XOR mask into all 4 color channels + for (y = 0; y < real_height; y++) { + for (x = 0; x < width; x++) { + int v = input[(real_height + y) * pitch + (x / 8)]; + v = (v >> (7 - (x % 8))) & 1; + memset(&output[4 * ((y*width) + x)], v ? 0xFF : 0, 4); + } + } + + *_pitch = width * 4; + *_height = real_height; + + return output; +} + +static void fixup_color_mask(uint8_t *buf, int width, int height, int pitch) +{ + int x, y; + // There is no good way to replicate XOR'ig parts of the texture with the screen + // best effort is rendering the non-masked parts, and make the rest transparent + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + int pos = (y*pitch) + (4*x) + 3; + buf[pos] = buf[pos] ? 0 : 0xFF; + } + } +} + +static int update_mouse_pointer(AVFilterContext *avctx, DXGI_OUTDUPL_FRAME_INFO *frame_info) +{ + DdagrabContext *dda = avctx->priv; + HRESULT hr; + int ret; + + if (frame_info->LastMouseUpdateTime.QuadPart == 0) + return 0; + + if (frame_info->PointerPosition.Visible) { + dda->mouse_x = frame_info->PointerPosition.Position.x; + dda->mouse_y = frame_info->PointerPosition.Position.y; + } else { + dda->mouse_x = dda->mouse_y = -1; + } + + if (frame_info->PointerShapeBufferSize) { + UINT size = frame_info->PointerShapeBufferSize; + DXGI_OUTDUPL_POINTER_SHAPE_INFO shape_info; + uint8_t *buf = av_malloc(size); + if (!buf) + return AVERROR(ENOMEM); + + hr = IDXGIOutputDuplication_GetFramePointerShape(dda->dxgi_outdupl, + size, + buf, + &size, + &shape_info); + if (FAILED(hr)) { + av_free(buf); + av_log(avctx, AV_LOG_ERROR, "Failed getting pointer shape: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + if (shape_info.Type == DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME) { + uint8_t *new_buf = convert_mono_buffer(buf, &shape_info.Width, &shape_info.Height, &shape_info.Pitch); + av_free(buf); + if (!new_buf) + return AVERROR(ENOMEM); + buf = new_buf; + } else if (shape_info.Type == DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR) { + fixup_color_mask(buf, shape_info.Width, shape_info.Height, shape_info.Pitch); + } else if (shape_info.Type != DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR) { + av_log(avctx, AV_LOG_WARNING, "Unsupported pointer shape type: %d\n", (int)shape_info.Type); + av_free(buf); + return 0; + } + + release_resource(&dda->mouse_resource_view); + release_resource(&dda->mouse_texture); + + ret = create_d3d11_pointer_tex(avctx, buf, &shape_info, &dda->mouse_texture, &dda->mouse_resource_view); + av_freep(&buf); + if (ret < 0) + return ret; + + av_log(avctx, AV_LOG_VERBOSE, "Updated pointer shape texture\n"); + } + + return 0; +} + +static int next_frame_internal(AVFilterContext *avctx, ID3D11Texture2D **desktop_texture) +{ + DXGI_OUTDUPL_FRAME_INFO frame_info; + DdagrabContext *dda = avctx->priv; + IDXGIResource *desktop_resource = NULL; + HRESULT hr; + int ret; + + hr = IDXGIOutputDuplication_AcquireNextFrame( + dda->dxgi_outdupl, + dda->time_timeout, + &frame_info, + &desktop_resource); + if (hr == DXGI_ERROR_WAIT_TIMEOUT) { + return AVERROR(EAGAIN); + } else if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "AcquireNextFrame failed: %lx\n", hr); + return AVERROR_EXTERNAL; + } + + if (dda->draw_mouse) { + ret = update_mouse_pointer(avctx, &frame_info); + if (ret < 0) + return ret; + } + + hr = IDXGIResource_QueryInterface(desktop_resource, &IID_ID3D11Texture2D, (void**)desktop_texture); + IDXGIResource_Release(desktop_resource); + desktop_resource = NULL; + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "DXGIResource QueryInterface failed\n"); + return AVERROR_EXTERNAL; + } + + return 0; +} + +static int probe_output_format(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + D3D11_TEXTURE2D_DESC desc; + int ret; + + av_assert1(!dda->probed_texture); + + do { + ret = next_frame_internal(avctx, &dda->probed_texture); + } while(ret == AVERROR(EAGAIN)); + if (ret < 0) + return ret; + + ID3D11Texture2D_GetDesc(dda->probed_texture, &desc); + + dda->raw_format = desc.Format; + dda->raw_width = desc.Width; + dda->raw_height = desc.Height; + + if (dda->width <= 0) + dda->width = dda->raw_width; + if (dda->height <= 0) + dda->height = dda->raw_height; + + return 0; +} + +static av_cold int init_hwframes_ctx(AVFilterContext *avctx) +{ + DdagrabContext *dda = avctx->priv; + int ret = 0; + + dda->frames_ref = av_hwframe_ctx_alloc(dda->device_ref); + if (!dda->frames_ref) + return AVERROR(ENOMEM); + dda->frames_ctx = (AVHWFramesContext*)dda->frames_ref->data; + dda->frames_hwctx = (AVD3D11VAFramesContext*)dda->frames_ctx->hwctx; + + dda->frames_ctx->format = AV_PIX_FMT_D3D11; + dda->frames_ctx->width = dda->width; + dda->frames_ctx->height = dda->height; + + switch (dda->raw_format) { + case DXGI_FORMAT_B8G8R8A8_UNORM: + av_log(avctx, AV_LOG_VERBOSE, "Probed 8 bit RGB frame format\n"); + dda->frames_ctx->sw_format = AV_PIX_FMT_BGRA; + break; + case DXGI_FORMAT_R10G10B10A2_UNORM: + av_log(avctx, AV_LOG_VERBOSE, "Probed 10 bit RGB frame format\n"); + dda->frames_ctx->sw_format = AV_PIX_FMT_X2BGR10; + break; + case DXGI_FORMAT_R16G16B16A16_FLOAT: + av_log(avctx, AV_LOG_VERBOSE, "Probed 16 bit float RGB frame format\n"); + dda->frames_ctx->sw_format = AV_PIX_FMT_RGBAF16; + break; + default: + av_log(avctx, AV_LOG_ERROR, "Unexpected texture output format!\n"); + return AVERROR_BUG; + } + + if (dda->draw_mouse) + dda->frames_hwctx->BindFlags |= D3D11_BIND_RENDER_TARGET; + + ret = av_hwframe_ctx_init(dda->frames_ref); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to initialise hardware frames context: %d.\n", ret); + goto fail; + } + + return 0; +fail: + av_buffer_unref(&dda->frames_ref); + return ret; +} + +static int ddagrab_config_props(AVFilterLink *outlink) +{ + AVFilterContext *avctx = outlink->src; + DdagrabContext *dda = avctx->priv; + int ret; + + if (avctx->hw_device_ctx) { + dda->device_ctx = (AVHWDeviceContext*)avctx->hw_device_ctx->data; + + if (dda->device_ctx->type != AV_HWDEVICE_TYPE_D3D11VA) { + av_log(avctx, AV_LOG_ERROR, "Non-D3D11VA input hw_device_ctx\n"); + return AVERROR(EINVAL); + } + + dda->device_ref = av_buffer_ref(avctx->hw_device_ctx); + if (!dda->device_ref) + return AVERROR(ENOMEM); + + av_log(avctx, AV_LOG_VERBOSE, "Using provided hw_device_ctx\n"); + } else { + ret = av_hwdevice_ctx_create(&dda->device_ref, AV_HWDEVICE_TYPE_D3D11VA, NULL, NULL, 0); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to create D3D11VA device.\n"); + return ret; + } + + dda->device_ctx = (AVHWDeviceContext*)dda->device_ref->data; + + av_log(avctx, AV_LOG_VERBOSE, "Created internal hw_device_ctx\n"); + } + + dda->device_hwctx = (AVD3D11VADeviceContext*)dda->device_ctx->hwctx; + + ret = init_dxgi_dda(avctx); + if (ret < 0) + return ret; + + ret = probe_output_format(avctx); + if (ret < 0) + return ret; + + if (dda->out_fmt && dda->raw_format != dda->out_fmt && (!dda->allow_fallback || dda->force_fmt)) { + av_log(avctx, AV_LOG_ERROR, "Requested output format unavailable.\n"); + return AVERROR(ENOTSUP); + } + + dda->width -= FFMAX(dda->width - dda->raw_width + dda->offset_x, 0); + dda->height -= FFMAX(dda->height - dda->raw_height + dda->offset_y, 0); + + dda->time_base = av_inv_q(dda->framerate); + dda->time_frame = av_gettime_relative() / av_q2d(dda->time_base); + dda->time_timeout = av_rescale_q(1, dda->time_base, (AVRational) { 1, 1000 }) / 2; + + if (dda->draw_mouse) { + ret = init_render_resources(avctx); + if (ret < 0) + return ret; + } + + ret = init_hwframes_ctx(avctx); + if (ret < 0) + return ret; + + outlink->hw_frames_ctx = av_buffer_ref(dda->frames_ref); + if (!outlink->hw_frames_ctx) + return AVERROR(ENOMEM); + + outlink->w = dda->width; + outlink->h = dda->height; + outlink->time_base = (AVRational){1, TIMER_RES}; + outlink->frame_rate = dda->framerate; + + return 0; +} + +static int draw_mouse_pointer(AVFilterContext *avctx, AVFrame *frame) +{ + DdagrabContext *dda = avctx->priv; + ID3D11DeviceContext *devctx = dda->device_hwctx->device_context; + ID3D11Texture2D *frame_tex = (ID3D11Texture2D*)frame->data[0]; + D3D11_RENDER_TARGET_VIEW_DESC target_desc = { 0 }; + ID3D11RenderTargetView* target_view = NULL; + ID3D11Buffer *mouse_vertex_buffer = NULL; + D3D11_TEXTURE2D_DESC tex_desc; + int num_vertices = 0; + int x, y; + HRESULT hr; + int ret = 0; + + if (!dda->mouse_texture || dda->mouse_x < 0 || dda->mouse_y < 0) + return 0; + + ID3D11Texture2D_GetDesc(dda->mouse_texture, &tex_desc); + + x = dda->mouse_x - dda->offset_x; + y = dda->mouse_y - dda->offset_y; + + if (x >= dda->width || y >= dda->height || + -x >= (int)tex_desc.Width || -y >= (int)tex_desc.Height) + return 0; + + target_desc.Format = dda->raw_format; + target_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; + target_desc.Texture2D.MipSlice = 0; + + hr = ID3D11Device_CreateRenderTargetView(dda->device_hwctx->device, + (ID3D11Resource*)frame_tex, + &target_desc, + &target_view); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateRenderTargetView failed: %lx\n", hr); + ret = AVERROR_EXTERNAL; + goto end; + } + + ID3D11DeviceContext_ClearState(devctx); + + { + D3D11_VIEWPORT viewport = { 0 }; + viewport.Width = dda->width; + viewport.Height = dda->height; + viewport.MinDepth = 0.0f; + viewport.MaxDepth = 1.0f; + + ID3D11DeviceContext_RSSetViewports(devctx, 1, &viewport); + } + + { + FLOAT vertices[] = { + // x, y, z, u, v + x , y + tex_desc.Height, 0.0f, 0.0f, 1.0f, + x , y , 0.0f, 0.0f, 0.0f, + x + tex_desc.Width, y + tex_desc.Height, 0.0f, 1.0f, 1.0f, + x + tex_desc.Width, y , 0.0f, 1.0f, 0.0f, + }; + UINT stride = sizeof(FLOAT) * 5; + UINT offset = 0; + + D3D11_SUBRESOURCE_DATA init_data = { 0 }; + D3D11_BUFFER_DESC buf_desc = { 0 }; + + num_vertices = sizeof(vertices) / (sizeof(FLOAT) * 5); + + buf_desc.Usage = D3D11_USAGE_DEFAULT; + buf_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buf_desc.ByteWidth = sizeof(vertices); + init_data.pSysMem = vertices; + + hr = ID3D11Device_CreateBuffer(dda->device_hwctx->device, + &buf_desc, + &init_data, + &mouse_vertex_buffer); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "CreateBuffer failed: %lx\n", hr); + ret = AVERROR_EXTERNAL; + goto end; + } + + ID3D11DeviceContext_IASetVertexBuffers(devctx, 0, 1, &mouse_vertex_buffer, &stride, &offset); + ID3D11DeviceContext_IASetInputLayout(devctx, dda->input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(devctx, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + } + + ID3D11DeviceContext_VSSetShader(devctx, dda->vertex_shader, NULL, 0); + ID3D11DeviceContext_VSSetConstantBuffers(devctx, 0, 1, &dda->const_buffer); + ID3D11DeviceContext_PSSetSamplers(devctx, 0, 1, &dda->sampler_state); + ID3D11DeviceContext_PSSetShaderResources(devctx, 0, 1, &dda->mouse_resource_view); + ID3D11DeviceContext_PSSetShader(devctx, dda->pixel_shader, NULL, 0); + + ID3D11DeviceContext_OMSetBlendState(devctx, dda->blend_state, NULL, 0xFFFFFFFF); + ID3D11DeviceContext_OMSetRenderTargets(devctx, 1, &target_view, NULL); + + ID3D11DeviceContext_Draw(devctx, num_vertices, 0); + +end: + release_resource(&mouse_vertex_buffer); + release_resource(&target_view); + + return ret; +} + +static int ddagrab_request_frame(AVFilterLink *outlink) +{ + AVFilterContext *avctx = outlink->src; + DdagrabContext *dda = avctx->priv; + + ID3D11Texture2D *cur_texture = NULL; + D3D11_TEXTURE2D_DESC desc = { 0 }; + D3D11_BOX box = { 0 }; + + int64_t time_frame = dda->time_frame; + int64_t now, delay; + AVFrame *frame = NULL; + HRESULT hr; + int ret; + + /* time_frame is in units of microseconds divided by the time_base. + * This means that adding a clean 1M to it is the equivalent of adding + * 1M*time_base microseconds to it, except it avoids all rounding error. + * The only time rounding error occurs is when multiplying to calculate + * the delay. So any rounding error there corrects itself over time. + */ + time_frame += TIMER_RES64; + for (;;) { + now = av_gettime_relative(); + delay = time_frame * av_q2d(dda->time_base) - now; + if (delay <= 0) { + if (delay < -TIMER_RES64 * av_q2d(dda->time_base)) { + time_frame += TIMER_RES64; + } + break; + } + av_usleep(delay); + } + + if (!dda->first_pts) + dda->first_pts = now; + now -= dda->first_pts; + + if (!dda->probed_texture) { + ret = next_frame_internal(avctx, &cur_texture); + } else { + cur_texture = dda->probed_texture; + dda->probed_texture = NULL; + ret = 0; + } + + if (ret == AVERROR(EAGAIN) && dda->last_frame->buf[0]) { + frame = av_frame_alloc(); + if (!frame) + return AVERROR(ENOMEM); + + ret = av_frame_ref(frame, dda->last_frame); + if (ret < 0) { + av_frame_free(&frame); + return ret; + } + + av_log(avctx, AV_LOG_DEBUG, "Duplicated output frame\n"); + + goto frame_done; + } else if (ret == AVERROR(EAGAIN)) { + av_log(avctx, AV_LOG_VERBOSE, "Initial DDA AcquireNextFrame timeout!\n"); + return AVERROR(EAGAIN); + } else if (ret < 0) { + return ret; + } + + // AcquireNextFrame sometimes has bursts of delay. + // This increases accuracy of the timestamp, but might upset consumers due to more jittery framerate? + now = av_gettime_relative() - dda->first_pts; + + ID3D11Texture2D_GetDesc(cur_texture, &desc); + if (desc.Format != dda->raw_format || + (int)desc.Width != dda->raw_width || + (int)desc.Height != dda->raw_height) { + av_log(avctx, AV_LOG_ERROR, "Output parameters changed!"); + ret = AVERROR_OUTPUT_CHANGED; + goto fail; + } + + frame = ff_get_video_buffer(outlink, dda->width, dda->height); + if (!frame) { + ret = AVERROR(ENOMEM); + goto fail; + } + + box.left = dda->offset_x; + box.top = dda->offset_y; + box.right = box.left + dda->width; + box.bottom = box.top + dda->height; + box.front = 0; + box.back = 1; + + ID3D11DeviceContext_CopySubresourceRegion( + dda->device_hwctx->device_context, + (ID3D11Resource*)frame->data[0], (UINT)(intptr_t)frame->data[1], + 0, 0, 0, + (ID3D11Resource*)cur_texture, 0, + &box); + + release_resource(&cur_texture); + + hr = IDXGIOutputDuplication_ReleaseFrame(dda->dxgi_outdupl); + if (FAILED(hr)) { + av_log(avctx, AV_LOG_ERROR, "DDA ReleaseFrame failed!\n"); + ret = AVERROR_EXTERNAL; + goto fail; + } + + if (dda->draw_mouse) { + ret = draw_mouse_pointer(avctx, frame); + if (ret < 0) + goto fail; + } + + frame->sample_aspect_ratio = (AVRational){1, 1}; + + if (desc.Format == DXGI_FORMAT_B8G8R8A8_UNORM || + desc.Format == DXGI_FORMAT_R10G10B10A2_UNORM) { + // According to MSDN, all integer formats contain sRGB image data + frame->color_range = AVCOL_RANGE_JPEG; + frame->color_primaries = AVCOL_PRI_BT709; + frame->color_trc = AVCOL_TRC_IEC61966_2_1; + frame->colorspace = AVCOL_SPC_RGB; + } else if(desc.Format == DXGI_FORMAT_R16G16B16A16_FLOAT) { + // According to MSDN, all floating point formats contain sRGB image data with linear 1.0 gamma. + frame->color_range = AVCOL_RANGE_JPEG; + frame->color_primaries = AVCOL_PRI_BT709; + frame->color_trc = AVCOL_TRC_LINEAR; + frame->colorspace = AVCOL_SPC_RGB; + } else { + ret = AVERROR_BUG; + goto fail; + } + + av_frame_unref(dda->last_frame); + ret = av_frame_ref(dda->last_frame, frame); + if (ret < 0) + return ret; + +frame_done: + frame->pts = now; + dda->time_frame = time_frame; + + return ff_filter_frame(outlink, frame); + +fail: + if (frame) + av_frame_free(&frame); + + if (cur_texture) + IDXGIOutputDuplication_ReleaseFrame(dda->dxgi_outdupl); + + release_resource(&cur_texture); + return ret; +} + +static const AVFilterPad ddagrab_outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = ddagrab_request_frame, + .config_props = ddagrab_config_props, + }, +}; + +const AVFilter ff_vsrc_ddagrab = { + .name = "ddagrab", + .description = NULL_IF_CONFIG_SMALL("Grab Windows Desktop images using Desktop Duplication API"), + .priv_size = sizeof(DdagrabContext), + .priv_class = &ddagrab_class, + .init = ddagrab_init, + .uninit = ddagrab_uninit, + .inputs = NULL, + FILTER_OUTPUTS(ddagrab_outputs), + FILTER_SINGLE_PIXFMT(AV_PIX_FMT_D3D11), + .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab_shaders.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab_shaders.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab_shaders.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_ddagrab_shaders.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,122 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_VSRC_DDAGRAB_SHADERS_H +#define AVFILTER_VSRC_DDAGRAB_SHADERS_H + +#include + +#if 0 + +cbuffer PARAMS : register ( b0 ) +{ + float2 Dimensions; +}; + +struct VS_INPUT +{ + float3 Pos : POSITION; + float2 Tex : TEXCOORD; +}; + +struct VS_OUTPUT +{ + float4 Pos : SV_POSITION; + float2 Tex : TEXCOORD; +}; + +VS_OUTPUT VS(VS_INPUT input) +{ + VS_OUTPUT output; + float2 center = Dimensions / 2; + output.Pos = float4((input.Pos.xy - center) / center, input.Pos.z, 1.0f); + output.Pos.y *= -1; + output.Tex = input.Tex; + return output; +} + +Texture2D tx : register( t0 ); +SamplerState samLinear : register( s0 ); + +float4 PS(VS_OUTPUT input) : SV_Target +{ + return tx.Sample(samLinear, input.Tex); +} + +#endif + +static const uint8_t vertex_shader_bytes[] = +{ + 68, 88, 66, 67, 207, 194, 142, 193, 255, 85, 32, 72, 116, 77, 242, 140, 26, 229, 67, 69, 1, 0, 0, 0, + 40, 3, 0, 0, 4, 0, 0, 0, 48, 0, 0, 0, 56, 1, 0, 0, 124, 2, 0, 0, 208, 2, 0, 0, + 65, 111, 110, 57, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 254, 255, 204, 0, 0, 0, 52, 0, 0, 0, + 1, 0, 36, 0, 0, 0, 48, 0, 0, 0, 48, 0, 0, 0, 36, 0, 1, 0, 48, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 254, 255, 81, 0, 0, 5, 2, 0, 15, 160, + 0, 0, 0, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 2, 5, 0, 0, 128, + 0, 0, 15, 144, 31, 0, 0, 2, 5, 0, 1, 128, 1, 0, 15, 144, 1, 0, 0, 2, 0, 0, 1, 128, + 2, 0, 0, 160, 4, 0, 0, 4, 0, 0, 6, 128, 1, 0, 208, 160, 0, 0, 0, 129, 0, 0, 208, 144, + 5, 0, 0, 3, 0, 0, 9, 128, 0, 0, 0, 128, 1, 0, 100, 160, 6, 0, 0, 2, 1, 0, 1, 128, + 0, 0, 0, 128, 6, 0, 0, 2, 1, 0, 2, 128, 0, 0, 255, 128, 5, 0, 0, 3, 0, 0, 3, 128, + 0, 0, 233, 128, 1, 0, 228, 128, 1, 0, 0, 2, 0, 0, 4, 128, 0, 0, 85, 129, 2, 0, 0, 3, + 0, 0, 3, 192, 0, 0, 232, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0, 12, 192, 0, 0, 170, 144, + 2, 0, 148, 160, 2, 0, 100, 160, 1, 0, 0, 2, 0, 0, 3, 224, 1, 0, 228, 144, 255, 255, 0, 0, + 83, 72, 68, 82, 60, 1, 0, 0, 64, 0, 1, 0, 79, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 95, 0, 0, 3, 114, 16, 16, 0, 0, 0, 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 1, 0, 0, 0, 103, 0, 0, 4, 242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 50, 32, 16, 0, 1, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 56, 0, 0, 11, + 50, 0, 16, 0, 0, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 14, 194, 0, 16, 0, + 0, 0, 0, 0, 6, 132, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 6, 20, 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 50, 0, 16, 0, 0, 0, 0, 0, 230, 10, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 10, 50, 32, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, + 66, 32, 16, 0, 0, 0, 0, 0, 42, 16, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 54, 0, 0, 5, 50, 32, 16, 0, 1, 0, 0, 0, + 70, 16, 16, 0, 1, 0, 0, 0, 62, 0, 0, 1, 73, 83, 71, 78, 76, 0, 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 7, 7, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, + 79, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 12, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171 +}; + +static const uint8_t pixel_shader_bytes[] = +{ + 68, 88, 66, 67, 0, 95, 83, 169, 90, 60, 208, 75, 219, 179, 108, 203, 8, 232, 255, 27, 1, 0, 0, 0, + 148, 1, 0, 0, 4, 0, 0, 0, 48, 0, 0, 0, 156, 0, 0, 0, 8, 1, 0, 0, 96, 1, 0, 0, + 65, 111, 110, 57, 100, 0, 0, 0, 100, 0, 0, 0, 0, 2, 255, 255, 60, 0, 0, 0, 40, 0, 0, 0, + 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36, 0, 0, 0, 40, 0, 0, 0, 0, 0, + 0, 2, 255, 255, 31, 0, 0, 2, 0, 0, 0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, + 0, 8, 15, 160, 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 1, 0, 0, 2, + 0, 8, 15, 128, 0, 0, 228, 128, 255, 255, 0, 0, 83, 72, 68, 82, 100, 0, 0, 0, 64, 0, 0, 0, + 25, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, + 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 32, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, + 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171 +}; + +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_gradients.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_gradients.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_gradients.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_gradients.c 2023-03-03 13:29:59.000000000 +0000 @@ -402,6 +402,7 @@ frame->pict_type = AV_PICTURE_TYPE_I; frame->sample_aspect_ratio = (AVRational) {1, 1}; frame->pts = s->pts++; + frame->duration = 1; ff_filter_execute(ctx, s->draw_slice, frame, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_life.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_life.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_life.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_life.c 2023-03-03 13:29:59.000000000 +0000 @@ -404,6 +404,7 @@ return AVERROR(ENOMEM); picref->sample_aspect_ratio = (AVRational) {1, 1}; picref->pts = life->pts++; + picref->duration = 1; life->draw(outlink->src, picref); evolve(outlink->src); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mandelbrot.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mandelbrot.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mandelbrot.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mandelbrot.c 2023-03-03 13:29:59.000000000 +0000 @@ -395,6 +395,7 @@ picref->sample_aspect_ratio = (AVRational) {1, 1}; picref->pts = s->pts++; + picref->duration = 1; draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts); return ff_filter_frame(link, picref); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mptestsrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mptestsrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mptestsrc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_mptestsrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -308,6 +308,7 @@ if (!picref) return AVERROR(ENOMEM); picref->pts = test->pts++; + picref->duration = 1; // clean image for (i = 0; i < h; i++) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_sierpinski.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_sierpinski.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_sierpinski.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_sierpinski.c 2023-03-03 13:29:59.000000000 +0000 @@ -196,6 +196,7 @@ frame->sample_aspect_ratio = (AVRational) {1, 1}; frame->pts = s->pts++; + frame->duration = 1; draw_sierpinski(link->src, frame); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_testsrc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_testsrc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_testsrc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/vsrc_testsrc.c 2023-03-03 13:29:59.000000000 +0000 @@ -183,6 +183,7 @@ if (!frame) return AVERROR(ENOMEM); frame->pts = test->pts; + frame->duration = 1; frame->key_frame = 1; frame->interlaced_frame = 0; frame->pict_type = AV_PICTURE_TYPE_I; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/window_func.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/window_func.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/window_func.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/window_func.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ WFUNC_BHARRIS, WFUNC_BNUTTALL, WFUNC_SINE, WFUNC_NUTTALL, WFUNC_BHANN, WFUNC_LANCZOS, WFUNC_GAUSS, WFUNC_TUKEY, WFUNC_DOLPH, WFUNC_CAUCHY, WFUNC_PARZEN, WFUNC_POISSON, - WFUNC_BOHMAN, + WFUNC_BOHMAN, WFUNC_KAISER, NB_WFUNC }; #define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func) \ @@ -56,7 +56,22 @@ { "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, flag, "win_func" }, \ { "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, flag, "win_func" }, \ { "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, flag, "win_func" }, \ - { "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, flag, "win_func" } + { "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, flag, "win_func" }, \ + { "kaiser", "Kaiser", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_KAISER}, 0, 0, flag, "win_func" } + +static inline double get_i0(double x) +{ + double y = 1.0, prev = 1.0, i = 1.0; + + while (fabs(prev) > 1e-20) { + double summand = prev * x * x / (4 * i * i); + y += summand; + prev = summand; + i++; + } + + return y; +} static inline void generate_window_func(float *lut, int N, int win_func, float *overlap) @@ -216,6 +231,14 @@ } *overlap = 0.75; break; + case WFUNC_KAISER: + for (n = 0; n < N; n++) { + double x = 2.0 / (double)(N - 1); + + lut[n] = get_i0(12. * sqrt(1. - SQR(n * x - 1.))) / get_i0(12.); + } + *overlap = 0.75; + break; default: av_assert0(0); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/af_volume.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/af_volume.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/af_volume.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/af_volume.asm 2023-03-03 13:29:59.000000000 +0000 @@ -56,7 +56,7 @@ mova [dstq+lenq], m3 sub lenq, mmsize jge .loop - REP_RET + RET ;------------------------------------------------------------------------------ ; void ff_scale_samples_s32(uint8_t *dst, const uint8_t *src, int len, @@ -93,7 +93,7 @@ %endif sub lenq, mmsize jge .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -137,4 +137,4 @@ mova [dstq+lenq], m0 sub lenq, mmsize jge .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/avf_showcqt.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/avf_showcqt.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/avf_showcqt.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/avf_showcqt.asm 2023-03-03 13:29:59.000000000 +0000 @@ -127,7 +127,7 @@ lea dstq, [dstq + 16] lea coeffsq, [coeffsq + 2*Coeffs.sizeof] jnz .loop_k - REP_RET + RET align 16 .check_loop_a: cmp xd, [coeffsq + Coeffs.len] @@ -170,7 +170,7 @@ lea dstq, [dstq + 8] lea coeffsq, [coeffsq + Coeffs.sizeof] jnz .loop_k - REP_RET + RET %endif ; ARCH_X86_64 %endmacro ; DECLARE_CQT_CALC diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/scene_sad.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/scene_sad.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/scene_sad.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/scene_sad.asm 2023-03-03 13:29:59.000000000 +0000 @@ -53,7 +53,7 @@ mov r0q, r6mp movu [r0q], m1 ; sum -REP_RET +RET %endmacro diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_blend.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_blend.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_blend.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_blend.asm 2023-03-03 13:29:59.000000000 +0000 @@ -63,7 +63,7 @@ add dstq, dst_linesizeq sub endd, 1 jg .nextrow -REP_RET +RET %endmacro %macro BLEND_SIMPLE 2-3 0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution.asm 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,18 @@ SECTION_RODATA half: dd 0.5 +data_p1: dd 1 +data_n1: dd -1 +data_p2: dd 2 +data_n2: dd -2 + +ALIGN 64 +sobel_perm: db 0, 16, 32, 48, 1, 17, 33, 49, 2, 18, 34, 50, 3, 19, 35, 51 + db 4, 20, 36, 52, 5, 21, 37, 53, 6, 22, 38, 54, 7, 23, 39, 55 + db 8, 24, 40, 56, 9, 25, 41, 57, 10, 26, 42, 58, 11, 27, 43, 59 + db 12, 28, 44, 60, 13, 29, 45, 61, 14, 30, 46, 62, 15, 31, 47, 63 +sobel_mulA: db -1, 1, -2, 2 +sobel_mulB: db 1, -1, 2, -2 SECTION .text @@ -154,3 +166,139 @@ INIT_XMM sse4 FILTER_3X3 %endif + +%macro SOBEL_MUL 2 + movzx ptrd, byte [c%1q + xq] + imul ptrd, [%2] + add rd, ptrd +%endmacro + +%macro SOBEL_ADD 1 + movzx ptrd, byte [c%1q + xq] + add rd, ptrd +%endmacro + +; void filter_sobel_avx512(uint8_t *dst, int width, +; float scale, float delta, const int *const matrix, +; const uint8_t *c[], int peak, int radius, +; int dstride, int stride) +%macro FILTER_SOBEL 0 +%if UNIX64 +cglobal filter_sobel, 4, 15, 7, dst, width, matrix, ptr, c0, c1, c2, c3, c4, c5, c6, c7, c8, r, x +%else +cglobal filter_sobel, 4, 15, 7, dst, width, rdiv, bias, matrix, ptr, c0, c1, c2, c3, c4, c5, c6, c7, c8, r, x +%endif +%if WIN64 + VBROADCASTSS m0, xmm2 + VBROADCASTSS m1, xmm3 + mov r2q, matrixmp + mov r3q, ptrmp + DEFINE_ARGS dst, width, matrix, ptr, c0, c1, c2, c3, c4, c5, c6, c7, c8, r, x +%else + VBROADCASTSS m0, xmm0 + VBROADCASTSS m1, xmm1 +%endif + movsxdifnidn widthq, widthd + pxor m6, m6 + mov c0q, [ptrq + 0*gprsize] + mov c1q, [ptrq + 1*gprsize] + mov c2q, [ptrq + 2*gprsize] + mov c3q, [ptrq + 3*gprsize] + mov c4q, [ptrq + 4*gprsize] + mov c5q, [ptrq + 5*gprsize] + mov c6q, [ptrq + 6*gprsize] + mov c7q, [ptrq + 7*gprsize] + mov c8q, [ptrq + 8*gprsize] + + xor xq, xq + cmp widthq, mmsize/4 + jl .loop2 + + mov rq, widthq + and rq, mmsize/4-1 + sub widthq, rq + + mova m6, [sobel_perm] +.loop1: + movu xm3, [c2q + xq] + pmovzxbd m5, [c0q + xq] + vinserti32x4 ym3, [c6q + xq], 1 + pmovzxbd m4, [c8q + xq] + vinserti32x4 m2, m3, [c1q + xq], 2 + vinserti32x4 m3, [c5q + xq], 2 + vinserti32x4 m2, [c7q + xq], 3 + vinserti32x4 m3, [c3q + xq], 3 + vpermb m2, m6, m2 + psubd m4, m5 + vpermb m3, m6, m3 + mova m5, m4 + vpdpbusd m4, m2, [sobel_mulA] {1to16} + vpdpbusd m5, m3, [sobel_mulB] {1to16} + + cvtdq2ps m4, m4 + mulps m4, m4 + + cvtdq2ps m5, m5 + VFMADD231PS m4, m5, m5 + + sqrtps m4, m4 + fmaddps m4, m4, m0, m1 + cvttps2dq m4, m4 + vpmovusdb [dstq + xq], m4 + + add xq, mmsize/4 + cmp xq, widthq + jl .loop1 + + add widthq, rq + cmp xq, widthq + jge .end + +.loop2: + xor rd, rd + pxor m4, m4 + + ;Gx + SOBEL_MUL 0, data_n1 + SOBEL_MUL 1, data_n2 + SOBEL_MUL 2, data_n1 + SOBEL_ADD 6 + SOBEL_MUL 7, data_p2 + SOBEL_ADD 8 + + cvtsi2ss xmm4, rd + mulss xmm4, xmm4 + + xor rd, rd + ;Gy + SOBEL_MUL 0, data_n1 + SOBEL_ADD 2 + SOBEL_MUL 3, data_n2 + SOBEL_MUL 5, data_p2 + SOBEL_MUL 6, data_n1 + SOBEL_ADD 8 + + cvtsi2ss xmm5, rd + fmaddss xmm4, xmm5, xmm5, xmm4 + + sqrtps xmm4, xmm4 + fmaddss xmm4, xmm4, xm0, xm1 ;sum = sum * rdiv + bias + cvttps2dq xmm4, xmm4 ; trunc to integer + packssdw xmm4, xmm4 + packuswb xmm4, xmm4 + movd rd, xmm4 + mov [dstq + xq], rb + + add xq, 1 + cmp xq, widthq + jl .loop2 +.end: + RET +%endmacro + +%if ARCH_X86_64 +%if HAVE_AVX512ICL_EXTERNAL +INIT_ZMM avx512icl +FILTER_SOBEL +%endif +%endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_convolution_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,11 @@ const uint8_t *c[], int peak, int radius, int dstride, int stride, int size); +void ff_filter_sobel_avx512icl(uint8_t *dst, int width, + float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size); + av_cold void ff_convolution_init_x86(ConvolutionContext *s) { #if ARCH_X86_64 @@ -43,4 +48,17 @@ } } #endif +} + +av_cold void ff_sobel_init_x86(ConvolutionContext *s, int depth, int nb_planes) +{ +#if ARCH_X86_64 + int cpu_flags = av_get_cpu_flags(); + for (int i = 0; i < nb_planes; i++) { + if (depth == 8) { + if (EXTERNAL_AVX512ICL(cpu_flags)) + s->filter[i] = ff_filter_sobel_avx512icl; + } + } +#endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_framerate.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_framerate.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_framerate.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_framerate.asm 2023-03-03 13:29:59.000000000 +0000 @@ -84,7 +84,7 @@ add dstq, dst_linesizeq sub endd, 1 jg .nextrow -REP_RET +RET %endmacro diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_gradfun.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_gradfun.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_gradfun.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_gradfun.asm 2023-03-03 13:29:59.000000000 +0000 @@ -64,7 +64,7 @@ add r0, 4 jl .loop .end: - REP_RET + RET INIT_XMM ssse3 cglobal gradfun_filter_line, 6, 6, 8 @@ -78,7 +78,7 @@ FILTER_LINE m4 add r0, 8 jl .loop - REP_RET + RET %macro BLUR_LINE 1 cglobal gradfun_blur_line_%1, 6, 6, 8 @@ -102,7 +102,7 @@ mova [r3+r0], m0 add r0, 16 jl .loop - REP_RET + RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_hqdn3d.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_hqdn3d.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_hqdn3d.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_hqdn3d.asm 2023-03-03 13:29:59.000000000 +0000 @@ -97,7 +97,7 @@ inc xq jl .loop je .loop2 - REP_RET + RET %endmacro ; HQDN3D_ROW HQDN3D_ROW 8 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_interlace.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_interlace.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_interlace.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_interlace.asm 2023-03-03 13:29:59.000000000 +0000 @@ -73,7 +73,7 @@ jl .loop .end: - REP_RET + RET %endmacro %macro LOWPASS_LINE 0 @@ -146,7 +146,7 @@ add srcq, mmsize sub hd, mmsize jg .loop -REP_RET +RET cglobal lowpass_line_complex_12, 5, 5, 8, 16, dst, h, src, mref, pref, clip_max movd m7, DWORD clip_maxm @@ -208,7 +208,7 @@ add srcq, 2*mmsize sub hd, mmsize jg .loop -REP_RET +RET %endmacro INIT_XMM sse2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_maskedmerge.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_maskedmerge.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_maskedmerge.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_maskedmerge.asm 2023-03-03 13:29:59.000000000 +0000 @@ -81,4 +81,4 @@ add dstq, dlinesizeq sub hd, 1 jg .nextrow -REP_RET +RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_stereo3d.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_stereo3d.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_stereo3d.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_stereo3d.asm 2023-03-03 13:29:59.000000000 +0000 @@ -213,4 +213,4 @@ add rsrcq, r_linesizeq sub heightd, 1 jg .nextrow -REP_RET +RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_threshold.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_threshold.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_threshold.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_threshold.asm 2023-03-03 13:29:59.000000000 +0000 @@ -22,15 +22,10 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA - -pb_128: times 16 db 128 -pb_128_0 : times 8 db 0, 128 - SECTION .text -;%1 depth (8 or 16) ; %2 b or w ; %3 constant -%macro THRESHOLD 3 +;%1 depth (8 or 16) ; %2 b or w +%macro THRESHOLD 2 %if ARCH_X86_64 cglobal threshold%1, 10, 13, 5, in, threshold, min, max, out, ilinesize, tlinesize, flinesize, slinesize, olinesize, w, h, x mov wd, dword wm @@ -45,7 +40,6 @@ %define olinesizeq r9mp %define hd r11mp %endif - VBROADCASTI128 m4, [%3] %if %1 == 16 add wq, wq ; w *= 2 (16 bits instead of 8) %endif @@ -63,9 +57,8 @@ movu m0, [thresholdq + xq] movu m2, [minq + xq] movu m3, [maxq + xq] - pxor m0, m4 - pxor m1, m4 - pcmpgt%2 m0, m1 + pminu%2 m0, m1 + pcmpeq%2 m0, m1 PBLENDVB m3, m2, m0 movu [outq + xq], m3 add xq, mmsize @@ -82,11 +75,11 @@ %endmacro INIT_XMM sse4 -THRESHOLD 8, b, pb_128 -THRESHOLD 16, w, pb_128_0 +THRESHOLD 8, b +THRESHOLD 16, w %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 -THRESHOLD 8, b, pb_128 -THRESHOLD 16, w, pb_128_0 +THRESHOLD 8, b +THRESHOLD 16, w %endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_w3fdif.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_w3fdif.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_w3fdif.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavfilter/x86/vf_w3fdif.asm 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ add work_pixelq, mmsize*2 sub linesized, mmsize/2 jg .loop -REP_RET +RET cglobal w3fdif_simple_low, 4, 5, 6, 0, work_line, in_lines_cur0, coef, linesize, offset movd m1, [coefq] @@ -63,7 +63,7 @@ add offsetq, mmsize/2 sub linesized, mmsize/2 jg .loop -REP_RET +RET cglobal w3fdif_complex_low, 4, 7, 8, 0, work_line, in_lines_cur0, coef, linesize movq m0, [coefq] @@ -99,7 +99,7 @@ add offsetq, mmsize/2 sub linesized, mmsize/2 jg .loop -REP_RET +RET %if ARCH_X86_64 cglobal w3fdif_simple_high, 5, 9, 8, 0, work_line, in_lines_cur0, in_lines_adj0, coef, linesize @@ -179,7 +179,7 @@ add offsetq, mmsize/2 sub linesized, mmsize/2 jg .loop -REP_RET +RET %if ARCH_X86_64 @@ -254,6 +254,6 @@ add offsetq, mmsize/2 sub linesized, mmsize/2 jg .loop -REP_RET +RET %endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/a64.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/a64.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/a64.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/a64.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavcodec/codec_id.h" #include "libavcodec/codec_par.h" #include "avformat.h" +#include "mux.h" #include "rawenc.h" static int a64_write_header(AVFormatContext *s) @@ -59,11 +60,11 @@ return 0; } -const AVOutputFormat ff_a64_muxer = { - .name = "a64", - .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"), - .extensions = "a64, A64", - .video_codec = AV_CODEC_ID_A64_MULTI, +const FFOutputFormat ff_a64_muxer = { + .p.name = "a64", + .p.long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"), + .p.extensions = "a64, A64", + .p.video_codec = AV_CODEC_ID_A64_MULTI, .write_header = a64_write_header, .write_packet = ff_raw_write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ac3dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ac3dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ac3dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ac3dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -131,7 +131,7 @@ .read_header = ff_raw_audio_read_header, .read_packet = ff_raw_read_partial_packet, .flags = AVFMT_GENERIC_INDEX, - .extensions = "eac3", + .extensions = "eac3,ec3", .raw_codec_id = AV_CODEC_ID_EAC3, .priv_data_size = sizeof(FFRawDemuxerContext), .priv_class = &ff_raw_demuxer_class, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/adtsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/adtsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/adtsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/adtsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,10 +26,12 @@ #include "libavcodec/codec_par.h" #include "libavcodec/packet.h" #include "libavcodec/mpeg4audio.h" +#include "libavcodec/mpeg4audio_copy_pce.h" #include "libavutil/opt.h" #include "avformat.h" #include "apetag.h" #include "id3v2.h" +#include "mux.h" #define ADTS_HEADER_SIZE 7 @@ -231,18 +233,18 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_adts_muxer = { - .name = "adts", - .long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"), - .mime_type = "audio/aac", - .extensions = "aac,adts", +const FFOutputFormat ff_adts_muxer = { + .p.name = "adts", + .p.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"), + .p.mime_type = "audio/aac", + .p.extensions = "aac,adts", .priv_data_size = sizeof(ADTSContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_NONE, .init = adts_init, .write_header = adts_write_header, .write_packet = adts_write_packet, .write_trailer = adts_write_trailer, - .priv_class = &adts_muxer_class, - .flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &adts_muxer_class, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiff.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiff.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiff.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiff.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,6 +46,7 @@ { AV_CODEC_ID_QDMC, MKTAG('Q','D','M','C') }, { AV_CODEC_ID_QDM2, MKTAG('Q','D','M','2') }, { AV_CODEC_ID_QCELP, MKTAG('Q','c','l','p') }, + { AV_CODEC_ID_CBD2_DPCM, MKTAG('C','B','D','2') }, { AV_CODEC_ID_SDX2_DPCM, MKTAG('S','D','X','2') }, { AV_CODEC_ID_ADPCM_IMA_WS, MKTAG('A','D','P','4') }, { AV_CODEC_ID_NONE, 0 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -164,6 +164,7 @@ case AV_CODEC_ID_ADPCM_IMA_WS: case AV_CODEC_ID_ADPCM_G722: case AV_CODEC_ID_MACE6: + case AV_CODEC_ID_CBD2_DPCM: case AV_CODEC_ID_SDX2_DPCM: par->block_align = 1 * channels; break; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aiffenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "avio_internal.h" #include "isom.h" #include "id3v2.h" +#include "mux.h" typedef struct AIFFOutputContext { const AVClass *class; @@ -284,18 +285,18 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_aiff_muxer = { - .name = "aiff", - .long_name = NULL_IF_CONFIG_SMALL("Audio IFF"), - .mime_type = "audio/aiff", - .extensions = "aif,aiff,afc,aifc", +const FFOutputFormat ff_aiff_muxer = { + .p.name = "aiff", + .p.long_name = NULL_IF_CONFIG_SMALL("Audio IFF"), + .p.mime_type = "audio/aiff", + .p.extensions = "aif,aiff,afc,aifc", .priv_data_size = sizeof(AIFFOutputContext), - .audio_codec = AV_CODEC_ID_PCM_S16BE, - .video_codec = AV_CODEC_ID_PNG, + .p.audio_codec = AV_CODEC_ID_PCM_S16BE, + .p.video_codec = AV_CODEC_ID_PNG, .write_header = aiff_write_header, .write_packet = aiff_write_packet, .write_trailer = aiff_write_trailer, .deinit = aiff_deinit, - .codec_tag = ff_aiff_codec_tags_list, - .priv_class = &aiff_muxer_class, + .p.codec_tag = ff_aiff_codec_tags_list, + .p.priv_class = &aiff_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/allformats.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/allformats.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/allformats.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/allformats.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,273 +20,280 @@ */ #include +#include +#include + #include "libavformat/internal.h" #include "avformat.h" +#include "mux.h" /* (de)muxers */ -extern const AVOutputFormat ff_a64_muxer; +extern const FFOutputFormat ff_a64_muxer; extern const AVInputFormat ff_aa_demuxer; extern const AVInputFormat ff_aac_demuxer; extern const AVInputFormat ff_aax_demuxer; extern const AVInputFormat ff_ac3_demuxer; -extern const AVOutputFormat ff_ac3_muxer; +extern const FFOutputFormat ff_ac3_muxer; extern const AVInputFormat ff_ace_demuxer; extern const AVInputFormat ff_acm_demuxer; extern const AVInputFormat ff_act_demuxer; extern const AVInputFormat ff_adf_demuxer; extern const AVInputFormat ff_adp_demuxer; extern const AVInputFormat ff_ads_demuxer; -extern const AVOutputFormat ff_adts_muxer; +extern const FFOutputFormat ff_adts_muxer; extern const AVInputFormat ff_adx_demuxer; -extern const AVOutputFormat ff_adx_muxer; +extern const FFOutputFormat ff_adx_muxer; extern const AVInputFormat ff_aea_demuxer; extern const AVInputFormat ff_afc_demuxer; extern const AVInputFormat ff_aiff_demuxer; -extern const AVOutputFormat ff_aiff_muxer; +extern const FFOutputFormat ff_aiff_muxer; extern const AVInputFormat ff_aix_demuxer; extern const AVInputFormat ff_alp_demuxer; -extern const AVOutputFormat ff_alp_muxer; +extern const FFOutputFormat ff_alp_muxer; extern const AVInputFormat ff_amr_demuxer; -extern const AVOutputFormat ff_amr_muxer; +extern const FFOutputFormat ff_amr_muxer; extern const AVInputFormat ff_amrnb_demuxer; extern const AVInputFormat ff_amrwb_demuxer; -extern const AVOutputFormat ff_amv_muxer; +extern const FFOutputFormat ff_amv_muxer; extern const AVInputFormat ff_anm_demuxer; +extern const AVInputFormat ff_apac_demuxer; extern const AVInputFormat ff_apc_demuxer; extern const AVInputFormat ff_ape_demuxer; extern const AVInputFormat ff_apm_demuxer; -extern const AVOutputFormat ff_apm_muxer; +extern const FFOutputFormat ff_apm_muxer; extern const AVInputFormat ff_apng_demuxer; -extern const AVOutputFormat ff_apng_muxer; +extern const FFOutputFormat ff_apng_muxer; extern const AVInputFormat ff_aptx_demuxer; -extern const AVOutputFormat ff_aptx_muxer; +extern const FFOutputFormat ff_aptx_muxer; extern const AVInputFormat ff_aptx_hd_demuxer; -extern const AVOutputFormat ff_aptx_hd_muxer; +extern const FFOutputFormat ff_aptx_hd_muxer; extern const AVInputFormat ff_aqtitle_demuxer; extern const AVInputFormat ff_argo_asf_demuxer; -extern const AVOutputFormat ff_argo_asf_muxer; +extern const FFOutputFormat ff_argo_asf_muxer; extern const AVInputFormat ff_argo_brp_demuxer; extern const AVInputFormat ff_argo_cvg_demuxer; -extern const AVOutputFormat ff_argo_cvg_muxer; +extern const FFOutputFormat ff_argo_cvg_muxer; extern const AVInputFormat ff_asf_demuxer; -extern const AVOutputFormat ff_asf_muxer; +extern const FFOutputFormat ff_asf_muxer; extern const AVInputFormat ff_asf_o_demuxer; extern const AVInputFormat ff_ass_demuxer; -extern const AVOutputFormat ff_ass_muxer; +extern const FFOutputFormat ff_ass_muxer; extern const AVInputFormat ff_ast_demuxer; -extern const AVOutputFormat ff_ast_muxer; -extern const AVOutputFormat ff_asf_stream_muxer; +extern const FFOutputFormat ff_ast_muxer; +extern const FFOutputFormat ff_asf_stream_muxer; extern const AVInputFormat ff_au_demuxer; -extern const AVOutputFormat ff_au_muxer; +extern const FFOutputFormat ff_au_muxer; extern const AVInputFormat ff_av1_demuxer; extern const AVInputFormat ff_avi_demuxer; -extern const AVOutputFormat ff_avi_muxer; -extern const AVOutputFormat ff_avif_muxer; +extern const FFOutputFormat ff_avi_muxer; +extern const FFOutputFormat ff_avif_muxer; extern const AVInputFormat ff_avisynth_demuxer; -extern const AVOutputFormat ff_avm2_muxer; +extern const FFOutputFormat ff_avm2_muxer; extern const AVInputFormat ff_avr_demuxer; extern const AVInputFormat ff_avs_demuxer; extern const AVInputFormat ff_avs2_demuxer; -extern const AVOutputFormat ff_avs2_muxer; +extern const FFOutputFormat ff_avs2_muxer; extern const AVInputFormat ff_avs3_demuxer; -extern const AVOutputFormat ff_avs3_muxer; +extern const FFOutputFormat ff_avs3_muxer; extern const AVInputFormat ff_bethsoftvid_demuxer; extern const AVInputFormat ff_bfi_demuxer; extern const AVInputFormat ff_bintext_demuxer; extern const AVInputFormat ff_bink_demuxer; extern const AVInputFormat ff_binka_demuxer; extern const AVInputFormat ff_bit_demuxer; -extern const AVOutputFormat ff_bit_muxer; +extern const FFOutputFormat ff_bit_muxer; extern const AVInputFormat ff_bitpacked_demuxer; extern const AVInputFormat ff_bmv_demuxer; extern const AVInputFormat ff_bfstm_demuxer; extern const AVInputFormat ff_brstm_demuxer; extern const AVInputFormat ff_boa_demuxer; +extern const AVInputFormat ff_bonk_demuxer; extern const AVInputFormat ff_c93_demuxer; extern const AVInputFormat ff_caf_demuxer; -extern const AVOutputFormat ff_caf_muxer; +extern const FFOutputFormat ff_caf_muxer; extern const AVInputFormat ff_cavsvideo_demuxer; -extern const AVOutputFormat ff_cavsvideo_muxer; +extern const FFOutputFormat ff_cavsvideo_muxer; extern const AVInputFormat ff_cdg_demuxer; extern const AVInputFormat ff_cdxl_demuxer; extern const AVInputFormat ff_cine_demuxer; extern const AVInputFormat ff_codec2_demuxer; -extern const AVOutputFormat ff_codec2_muxer; +extern const FFOutputFormat ff_codec2_muxer; extern const AVInputFormat ff_codec2raw_demuxer; -extern const AVOutputFormat ff_codec2raw_muxer; +extern const FFOutputFormat ff_codec2raw_muxer; extern const AVInputFormat ff_concat_demuxer; -extern const AVOutputFormat ff_crc_muxer; +extern const FFOutputFormat ff_crc_muxer; extern const AVInputFormat ff_dash_demuxer; -extern const AVOutputFormat ff_dash_muxer; +extern const FFOutputFormat ff_dash_muxer; extern const AVInputFormat ff_data_demuxer; -extern const AVOutputFormat ff_data_muxer; +extern const FFOutputFormat ff_data_muxer; extern const AVInputFormat ff_daud_demuxer; -extern const AVOutputFormat ff_daud_muxer; +extern const FFOutputFormat ff_daud_muxer; extern const AVInputFormat ff_dcstr_demuxer; extern const AVInputFormat ff_derf_demuxer; extern const AVInputFormat ff_dfa_demuxer; extern const AVInputFormat ff_dfpwm_demuxer; -extern const AVOutputFormat ff_dfpwm_muxer; +extern const FFOutputFormat ff_dfpwm_muxer; extern const AVInputFormat ff_dhav_demuxer; extern const AVInputFormat ff_dirac_demuxer; -extern const AVOutputFormat ff_dirac_muxer; +extern const FFOutputFormat ff_dirac_muxer; extern const AVInputFormat ff_dnxhd_demuxer; -extern const AVOutputFormat ff_dnxhd_muxer; +extern const FFOutputFormat ff_dnxhd_muxer; extern const AVInputFormat ff_dsf_demuxer; extern const AVInputFormat ff_dsicin_demuxer; extern const AVInputFormat ff_dss_demuxer; extern const AVInputFormat ff_dts_demuxer; -extern const AVOutputFormat ff_dts_muxer; +extern const FFOutputFormat ff_dts_muxer; extern const AVInputFormat ff_dtshd_demuxer; extern const AVInputFormat ff_dv_demuxer; -extern const AVOutputFormat ff_dv_muxer; +extern const FFOutputFormat ff_dv_muxer; extern const AVInputFormat ff_dvbsub_demuxer; extern const AVInputFormat ff_dvbtxt_demuxer; extern const AVInputFormat ff_dxa_demuxer; extern const AVInputFormat ff_ea_demuxer; extern const AVInputFormat ff_ea_cdata_demuxer; extern const AVInputFormat ff_eac3_demuxer; -extern const AVOutputFormat ff_eac3_muxer; +extern const FFOutputFormat ff_eac3_muxer; extern const AVInputFormat ff_epaf_demuxer; -extern const AVOutputFormat ff_f4v_muxer; +extern const FFOutputFormat ff_f4v_muxer; extern const AVInputFormat ff_ffmetadata_demuxer; -extern const AVOutputFormat ff_ffmetadata_muxer; -extern const AVOutputFormat ff_fifo_muxer; -extern const AVOutputFormat ff_fifo_test_muxer; +extern const FFOutputFormat ff_ffmetadata_muxer; +extern const FFOutputFormat ff_fifo_muxer; +extern const FFOutputFormat ff_fifo_test_muxer; extern const AVInputFormat ff_filmstrip_demuxer; -extern const AVOutputFormat ff_filmstrip_muxer; +extern const FFOutputFormat ff_filmstrip_muxer; extern const AVInputFormat ff_fits_demuxer; -extern const AVOutputFormat ff_fits_muxer; +extern const FFOutputFormat ff_fits_muxer; extern const AVInputFormat ff_flac_demuxer; -extern const AVOutputFormat ff_flac_muxer; +extern const FFOutputFormat ff_flac_muxer; extern const AVInputFormat ff_flic_demuxer; extern const AVInputFormat ff_flv_demuxer; -extern const AVOutputFormat ff_flv_muxer; +extern const FFOutputFormat ff_flv_muxer; extern const AVInputFormat ff_live_flv_demuxer; extern const AVInputFormat ff_fourxm_demuxer; -extern const AVOutputFormat ff_framecrc_muxer; -extern const AVOutputFormat ff_framehash_muxer; -extern const AVOutputFormat ff_framemd5_muxer; +extern const FFOutputFormat ff_framecrc_muxer; +extern const FFOutputFormat ff_framehash_muxer; +extern const FFOutputFormat ff_framemd5_muxer; extern const AVInputFormat ff_frm_demuxer; extern const AVInputFormat ff_fsb_demuxer; extern const AVInputFormat ff_fwse_demuxer; extern const AVInputFormat ff_g722_demuxer; -extern const AVOutputFormat ff_g722_muxer; +extern const FFOutputFormat ff_g722_muxer; extern const AVInputFormat ff_g723_1_demuxer; -extern const AVOutputFormat ff_g723_1_muxer; +extern const FFOutputFormat ff_g723_1_muxer; extern const AVInputFormat ff_g726_demuxer; -extern const AVOutputFormat ff_g726_muxer; +extern const FFOutputFormat ff_g726_muxer; extern const AVInputFormat ff_g726le_demuxer; -extern const AVOutputFormat ff_g726le_muxer; +extern const FFOutputFormat ff_g726le_muxer; extern const AVInputFormat ff_g729_demuxer; extern const AVInputFormat ff_gdv_demuxer; extern const AVInputFormat ff_genh_demuxer; extern const AVInputFormat ff_gif_demuxer; -extern const AVOutputFormat ff_gif_muxer; +extern const FFOutputFormat ff_gif_muxer; extern const AVInputFormat ff_gsm_demuxer; -extern const AVOutputFormat ff_gsm_muxer; +extern const FFOutputFormat ff_gsm_muxer; extern const AVInputFormat ff_gxf_demuxer; -extern const AVOutputFormat ff_gxf_muxer; +extern const FFOutputFormat ff_gxf_muxer; extern const AVInputFormat ff_h261_demuxer; -extern const AVOutputFormat ff_h261_muxer; +extern const FFOutputFormat ff_h261_muxer; extern const AVInputFormat ff_h263_demuxer; -extern const AVOutputFormat ff_h263_muxer; +extern const FFOutputFormat ff_h263_muxer; extern const AVInputFormat ff_h264_demuxer; -extern const AVOutputFormat ff_h264_muxer; -extern const AVOutputFormat ff_hash_muxer; +extern const FFOutputFormat ff_h264_muxer; +extern const FFOutputFormat ff_hash_muxer; extern const AVInputFormat ff_hca_demuxer; extern const AVInputFormat ff_hcom_demuxer; -extern const AVOutputFormat ff_hds_muxer; +extern const FFOutputFormat ff_hds_muxer; extern const AVInputFormat ff_hevc_demuxer; -extern const AVOutputFormat ff_hevc_muxer; +extern const FFOutputFormat ff_hevc_muxer; extern const AVInputFormat ff_hls_demuxer; -extern const AVOutputFormat ff_hls_muxer; +extern const FFOutputFormat ff_hls_muxer; extern const AVInputFormat ff_hnm_demuxer; extern const AVInputFormat ff_ico_demuxer; -extern const AVOutputFormat ff_ico_muxer; +extern const FFOutputFormat ff_ico_muxer; extern const AVInputFormat ff_idcin_demuxer; extern const AVInputFormat ff_idf_demuxer; extern const AVInputFormat ff_iff_demuxer; extern const AVInputFormat ff_ifv_demuxer; extern const AVInputFormat ff_ilbc_demuxer; -extern const AVOutputFormat ff_ilbc_muxer; +extern const FFOutputFormat ff_ilbc_muxer; extern const AVInputFormat ff_image2_demuxer; -extern const AVOutputFormat ff_image2_muxer; +extern const FFOutputFormat ff_image2_muxer; extern const AVInputFormat ff_image2pipe_demuxer; -extern const AVOutputFormat ff_image2pipe_muxer; +extern const FFOutputFormat ff_image2pipe_muxer; extern const AVInputFormat ff_image2_alias_pix_demuxer; extern const AVInputFormat ff_image2_brender_pix_demuxer; extern const AVInputFormat ff_imf_demuxer; extern const AVInputFormat ff_ingenient_demuxer; extern const AVInputFormat ff_ipmovie_demuxer; -extern const AVOutputFormat ff_ipod_muxer; +extern const FFOutputFormat ff_ipod_muxer; extern const AVInputFormat ff_ipu_demuxer; extern const AVInputFormat ff_ircam_demuxer; -extern const AVOutputFormat ff_ircam_muxer; -extern const AVOutputFormat ff_ismv_muxer; +extern const FFOutputFormat ff_ircam_muxer; +extern const FFOutputFormat ff_ismv_muxer; extern const AVInputFormat ff_iss_demuxer; extern const AVInputFormat ff_iv8_demuxer; extern const AVInputFormat ff_ivf_demuxer; -extern const AVOutputFormat ff_ivf_muxer; +extern const FFOutputFormat ff_ivf_muxer; extern const AVInputFormat ff_ivr_demuxer; extern const AVInputFormat ff_jacosub_demuxer; -extern const AVOutputFormat ff_jacosub_muxer; +extern const FFOutputFormat ff_jacosub_muxer; extern const AVInputFormat ff_jv_demuxer; extern const AVInputFormat ff_kux_demuxer; extern const AVInputFormat ff_kvag_demuxer; -extern const AVOutputFormat ff_kvag_muxer; -extern const AVOutputFormat ff_latm_muxer; +extern const FFOutputFormat ff_kvag_muxer; +extern const AVInputFormat ff_laf_demuxer; +extern const FFOutputFormat ff_latm_muxer; extern const AVInputFormat ff_lmlm4_demuxer; extern const AVInputFormat ff_loas_demuxer; extern const AVInputFormat ff_luodat_demuxer; extern const AVInputFormat ff_lrc_demuxer; -extern const AVOutputFormat ff_lrc_muxer; +extern const FFOutputFormat ff_lrc_muxer; extern const AVInputFormat ff_lvf_demuxer; extern const AVInputFormat ff_lxf_demuxer; extern const AVInputFormat ff_m4v_demuxer; -extern const AVOutputFormat ff_m4v_muxer; +extern const FFOutputFormat ff_m4v_muxer; extern const AVInputFormat ff_mca_demuxer; extern const AVInputFormat ff_mcc_demuxer; -extern const AVOutputFormat ff_md5_muxer; +extern const FFOutputFormat ff_md5_muxer; extern const AVInputFormat ff_matroska_demuxer; -extern const AVOutputFormat ff_matroska_muxer; -extern const AVOutputFormat ff_matroska_audio_muxer; +extern const FFOutputFormat ff_matroska_muxer; +extern const FFOutputFormat ff_matroska_audio_muxer; extern const AVInputFormat ff_mgsts_demuxer; extern const AVInputFormat ff_microdvd_demuxer; -extern const AVOutputFormat ff_microdvd_muxer; +extern const FFOutputFormat ff_microdvd_muxer; extern const AVInputFormat ff_mjpeg_demuxer; -extern const AVOutputFormat ff_mjpeg_muxer; +extern const FFOutputFormat ff_mjpeg_muxer; extern const AVInputFormat ff_mjpeg_2000_demuxer; extern const AVInputFormat ff_mlp_demuxer; -extern const AVOutputFormat ff_mlp_muxer; +extern const FFOutputFormat ff_mlp_muxer; extern const AVInputFormat ff_mlv_demuxer; extern const AVInputFormat ff_mm_demuxer; extern const AVInputFormat ff_mmf_demuxer; -extern const AVOutputFormat ff_mmf_muxer; +extern const FFOutputFormat ff_mmf_muxer; extern const AVInputFormat ff_mods_demuxer; extern const AVInputFormat ff_moflex_demuxer; extern const AVInputFormat ff_mov_demuxer; -extern const AVOutputFormat ff_mov_muxer; -extern const AVOutputFormat ff_mp2_muxer; +extern const FFOutputFormat ff_mov_muxer; +extern const FFOutputFormat ff_mp2_muxer; extern const AVInputFormat ff_mp3_demuxer; -extern const AVOutputFormat ff_mp3_muxer; -extern const AVOutputFormat ff_mp4_muxer; +extern const FFOutputFormat ff_mp3_muxer; +extern const FFOutputFormat ff_mp4_muxer; extern const AVInputFormat ff_mpc_demuxer; extern const AVInputFormat ff_mpc8_demuxer; -extern const AVOutputFormat ff_mpeg1system_muxer; -extern const AVOutputFormat ff_mpeg1vcd_muxer; -extern const AVOutputFormat ff_mpeg1video_muxer; -extern const AVOutputFormat ff_mpeg2dvd_muxer; -extern const AVOutputFormat ff_mpeg2svcd_muxer; -extern const AVOutputFormat ff_mpeg2video_muxer; -extern const AVOutputFormat ff_mpeg2vob_muxer; +extern const FFOutputFormat ff_mpeg1system_muxer; +extern const FFOutputFormat ff_mpeg1vcd_muxer; +extern const FFOutputFormat ff_mpeg1video_muxer; +extern const FFOutputFormat ff_mpeg2dvd_muxer; +extern const FFOutputFormat ff_mpeg2svcd_muxer; +extern const FFOutputFormat ff_mpeg2video_muxer; +extern const FFOutputFormat ff_mpeg2vob_muxer; extern const AVInputFormat ff_mpegps_demuxer; extern const AVInputFormat ff_mpegts_demuxer; -extern const AVOutputFormat ff_mpegts_muxer; +extern const FFOutputFormat ff_mpegts_muxer; extern const AVInputFormat ff_mpegtsraw_demuxer; extern const AVInputFormat ff_mpegvideo_demuxer; extern const AVInputFormat ff_mpjpeg_demuxer; -extern const AVOutputFormat ff_mpjpeg_muxer; +extern const FFOutputFormat ff_mpjpeg_muxer; extern const AVInputFormat ff_mpl2_demuxer; extern const AVInputFormat ff_mpsub_demuxer; extern const AVInputFormat ff_msf_demuxer; @@ -298,114 +305,116 @@ extern const AVInputFormat ff_mv_demuxer; extern const AVInputFormat ff_mvi_demuxer; extern const AVInputFormat ff_mxf_demuxer; -extern const AVOutputFormat ff_mxf_muxer; -extern const AVOutputFormat ff_mxf_d10_muxer; -extern const AVOutputFormat ff_mxf_opatom_muxer; +extern const FFOutputFormat ff_mxf_muxer; +extern const FFOutputFormat ff_mxf_d10_muxer; +extern const FFOutputFormat ff_mxf_opatom_muxer; extern const AVInputFormat ff_mxg_demuxer; extern const AVInputFormat ff_nc_demuxer; extern const AVInputFormat ff_nistsphere_demuxer; extern const AVInputFormat ff_nsp_demuxer; extern const AVInputFormat ff_nsv_demuxer; -extern const AVOutputFormat ff_null_muxer; +extern const FFOutputFormat ff_null_muxer; extern const AVInputFormat ff_nut_demuxer; -extern const AVOutputFormat ff_nut_muxer; +extern const FFOutputFormat ff_nut_muxer; extern const AVInputFormat ff_nuv_demuxer; extern const AVInputFormat ff_obu_demuxer; -extern const AVOutputFormat ff_obu_muxer; -extern const AVOutputFormat ff_oga_muxer; +extern const FFOutputFormat ff_obu_muxer; +extern const FFOutputFormat ff_oga_muxer; extern const AVInputFormat ff_ogg_demuxer; -extern const AVOutputFormat ff_ogg_muxer; -extern const AVOutputFormat ff_ogv_muxer; +extern const FFOutputFormat ff_ogg_muxer; +extern const FFOutputFormat ff_ogv_muxer; extern const AVInputFormat ff_oma_demuxer; -extern const AVOutputFormat ff_oma_muxer; -extern const AVOutputFormat ff_opus_muxer; +extern const FFOutputFormat ff_oma_muxer; +extern const FFOutputFormat ff_opus_muxer; extern const AVInputFormat ff_paf_demuxer; extern const AVInputFormat ff_pcm_alaw_demuxer; -extern const AVOutputFormat ff_pcm_alaw_muxer; +extern const FFOutputFormat ff_pcm_alaw_muxer; extern const AVInputFormat ff_pcm_mulaw_demuxer; -extern const AVOutputFormat ff_pcm_mulaw_muxer; +extern const FFOutputFormat ff_pcm_mulaw_muxer; extern const AVInputFormat ff_pcm_vidc_demuxer; -extern const AVOutputFormat ff_pcm_vidc_muxer; +extern const FFOutputFormat ff_pcm_vidc_muxer; extern const AVInputFormat ff_pcm_f64be_demuxer; -extern const AVOutputFormat ff_pcm_f64be_muxer; +extern const FFOutputFormat ff_pcm_f64be_muxer; extern const AVInputFormat ff_pcm_f64le_demuxer; -extern const AVOutputFormat ff_pcm_f64le_muxer; +extern const FFOutputFormat ff_pcm_f64le_muxer; extern const AVInputFormat ff_pcm_f32be_demuxer; -extern const AVOutputFormat ff_pcm_f32be_muxer; +extern const FFOutputFormat ff_pcm_f32be_muxer; extern const AVInputFormat ff_pcm_f32le_demuxer; -extern const AVOutputFormat ff_pcm_f32le_muxer; +extern const FFOutputFormat ff_pcm_f32le_muxer; extern const AVInputFormat ff_pcm_s32be_demuxer; -extern const AVOutputFormat ff_pcm_s32be_muxer; +extern const FFOutputFormat ff_pcm_s32be_muxer; extern const AVInputFormat ff_pcm_s32le_demuxer; -extern const AVOutputFormat ff_pcm_s32le_muxer; +extern const FFOutputFormat ff_pcm_s32le_muxer; extern const AVInputFormat ff_pcm_s24be_demuxer; -extern const AVOutputFormat ff_pcm_s24be_muxer; +extern const FFOutputFormat ff_pcm_s24be_muxer; extern const AVInputFormat ff_pcm_s24le_demuxer; -extern const AVOutputFormat ff_pcm_s24le_muxer; +extern const FFOutputFormat ff_pcm_s24le_muxer; extern const AVInputFormat ff_pcm_s16be_demuxer; -extern const AVOutputFormat ff_pcm_s16be_muxer; +extern const FFOutputFormat ff_pcm_s16be_muxer; extern const AVInputFormat ff_pcm_s16le_demuxer; -extern const AVOutputFormat ff_pcm_s16le_muxer; +extern const FFOutputFormat ff_pcm_s16le_muxer; extern const AVInputFormat ff_pcm_s8_demuxer; -extern const AVOutputFormat ff_pcm_s8_muxer; +extern const FFOutputFormat ff_pcm_s8_muxer; extern const AVInputFormat ff_pcm_u32be_demuxer; -extern const AVOutputFormat ff_pcm_u32be_muxer; +extern const FFOutputFormat ff_pcm_u32be_muxer; extern const AVInputFormat ff_pcm_u32le_demuxer; -extern const AVOutputFormat ff_pcm_u32le_muxer; +extern const FFOutputFormat ff_pcm_u32le_muxer; extern const AVInputFormat ff_pcm_u24be_demuxer; -extern const AVOutputFormat ff_pcm_u24be_muxer; +extern const FFOutputFormat ff_pcm_u24be_muxer; extern const AVInputFormat ff_pcm_u24le_demuxer; -extern const AVOutputFormat ff_pcm_u24le_muxer; +extern const FFOutputFormat ff_pcm_u24le_muxer; extern const AVInputFormat ff_pcm_u16be_demuxer; -extern const AVOutputFormat ff_pcm_u16be_muxer; +extern const FFOutputFormat ff_pcm_u16be_muxer; extern const AVInputFormat ff_pcm_u16le_demuxer; -extern const AVOutputFormat ff_pcm_u16le_muxer; +extern const FFOutputFormat ff_pcm_u16le_muxer; extern const AVInputFormat ff_pcm_u8_demuxer; -extern const AVOutputFormat ff_pcm_u8_muxer; +extern const FFOutputFormat ff_pcm_u8_muxer; extern const AVInputFormat ff_pjs_demuxer; extern const AVInputFormat ff_pmp_demuxer; extern const AVInputFormat ff_pp_bnk_demuxer; -extern const AVOutputFormat ff_psp_muxer; +extern const FFOutputFormat ff_psp_muxer; extern const AVInputFormat ff_pva_demuxer; extern const AVInputFormat ff_pvf_demuxer; extern const AVInputFormat ff_qcp_demuxer; extern const AVInputFormat ff_r3d_demuxer; extern const AVInputFormat ff_rawvideo_demuxer; -extern const AVOutputFormat ff_rawvideo_muxer; +extern const FFOutputFormat ff_rawvideo_muxer; extern const AVInputFormat ff_realtext_demuxer; extern const AVInputFormat ff_redspark_demuxer; +extern const AVInputFormat ff_rka_demuxer; extern const AVInputFormat ff_rl2_demuxer; extern const AVInputFormat ff_rm_demuxer; -extern const AVOutputFormat ff_rm_muxer; +extern const FFOutputFormat ff_rm_muxer; extern const AVInputFormat ff_roq_demuxer; -extern const AVOutputFormat ff_roq_muxer; +extern const FFOutputFormat ff_roq_muxer; extern const AVInputFormat ff_rpl_demuxer; extern const AVInputFormat ff_rsd_demuxer; extern const AVInputFormat ff_rso_demuxer; -extern const AVOutputFormat ff_rso_muxer; +extern const FFOutputFormat ff_rso_muxer; extern const AVInputFormat ff_rtp_demuxer; -extern const AVOutputFormat ff_rtp_muxer; -extern const AVOutputFormat ff_rtp_mpegts_muxer; +extern const FFOutputFormat ff_rtp_muxer; +extern const FFOutputFormat ff_rtp_mpegts_muxer; extern const AVInputFormat ff_rtsp_demuxer; -extern const AVOutputFormat ff_rtsp_muxer; +extern const FFOutputFormat ff_rtsp_muxer; extern const AVInputFormat ff_s337m_demuxer; extern const AVInputFormat ff_sami_demuxer; extern const AVInputFormat ff_sap_demuxer; -extern const AVOutputFormat ff_sap_muxer; +extern const FFOutputFormat ff_sap_muxer; extern const AVInputFormat ff_sbc_demuxer; -extern const AVOutputFormat ff_sbc_muxer; +extern const FFOutputFormat ff_sbc_muxer; extern const AVInputFormat ff_sbg_demuxer; extern const AVInputFormat ff_scc_demuxer; -extern const AVOutputFormat ff_scc_muxer; +extern const FFOutputFormat ff_scc_muxer; extern const AVInputFormat ff_scd_demuxer; +extern const AVInputFormat ff_sdns_demuxer; extern const AVInputFormat ff_sdp_demuxer; extern const AVInputFormat ff_sdr2_demuxer; extern const AVInputFormat ff_sds_demuxer; extern const AVInputFormat ff_sdx_demuxer; extern const AVInputFormat ff_segafilm_demuxer; -extern const AVOutputFormat ff_segafilm_muxer; -extern const AVOutputFormat ff_segment_muxer; -extern const AVOutputFormat ff_stream_segment_muxer; +extern const FFOutputFormat ff_segafilm_muxer; +extern const FFOutputFormat ff_segment_muxer; +extern const FFOutputFormat ff_stream_segment_muxer; extern const AVInputFormat ff_ser_demuxer; extern const AVInputFormat ff_sga_demuxer; extern const AVInputFormat ff_shorten_demuxer; @@ -414,92 +423,95 @@ extern const AVInputFormat ff_sln_demuxer; extern const AVInputFormat ff_smacker_demuxer; extern const AVInputFormat ff_smjpeg_demuxer; -extern const AVOutputFormat ff_smjpeg_muxer; -extern const AVOutputFormat ff_smoothstreaming_muxer; +extern const FFOutputFormat ff_smjpeg_muxer; +extern const FFOutputFormat ff_smoothstreaming_muxer; extern const AVInputFormat ff_smush_demuxer; extern const AVInputFormat ff_sol_demuxer; extern const AVInputFormat ff_sox_demuxer; -extern const AVOutputFormat ff_sox_muxer; -extern const AVOutputFormat ff_spx_muxer; +extern const FFOutputFormat ff_sox_muxer; +extern const FFOutputFormat ff_spx_muxer; extern const AVInputFormat ff_spdif_demuxer; -extern const AVOutputFormat ff_spdif_muxer; +extern const FFOutputFormat ff_spdif_muxer; extern const AVInputFormat ff_srt_demuxer; -extern const AVOutputFormat ff_srt_muxer; +extern const FFOutputFormat ff_srt_muxer; extern const AVInputFormat ff_str_demuxer; extern const AVInputFormat ff_stl_demuxer; -extern const AVOutputFormat ff_streamhash_muxer; +extern const FFOutputFormat ff_streamhash_muxer; extern const AVInputFormat ff_subviewer1_demuxer; extern const AVInputFormat ff_subviewer_demuxer; extern const AVInputFormat ff_sup_demuxer; -extern const AVOutputFormat ff_sup_muxer; +extern const FFOutputFormat ff_sup_muxer; extern const AVInputFormat ff_svag_demuxer; extern const AVInputFormat ff_svs_demuxer; extern const AVInputFormat ff_swf_demuxer; -extern const AVOutputFormat ff_swf_muxer; +extern const FFOutputFormat ff_swf_muxer; extern const AVInputFormat ff_tak_demuxer; -extern const AVOutputFormat ff_tee_muxer; +extern const FFOutputFormat ff_tee_muxer; extern const AVInputFormat ff_tedcaptions_demuxer; -extern const AVOutputFormat ff_tg2_muxer; -extern const AVOutputFormat ff_tgp_muxer; +extern const FFOutputFormat ff_tg2_muxer; +extern const FFOutputFormat ff_tgp_muxer; extern const AVInputFormat ff_thp_demuxer; extern const AVInputFormat ff_threedostr_demuxer; extern const AVInputFormat ff_tiertexseq_demuxer; -extern const AVOutputFormat ff_mkvtimestamp_v2_muxer; +extern const FFOutputFormat ff_mkvtimestamp_v2_muxer; extern const AVInputFormat ff_tmv_demuxer; extern const AVInputFormat ff_truehd_demuxer; -extern const AVOutputFormat ff_truehd_muxer; +extern const FFOutputFormat ff_truehd_muxer; extern const AVInputFormat ff_tta_demuxer; -extern const AVOutputFormat ff_tta_muxer; -extern const AVOutputFormat ff_ttml_muxer; +extern const FFOutputFormat ff_tta_muxer; +extern const FFOutputFormat ff_ttml_muxer; extern const AVInputFormat ff_txd_demuxer; extern const AVInputFormat ff_tty_demuxer; extern const AVInputFormat ff_ty_demuxer; -extern const AVOutputFormat ff_uncodedframecrc_muxer; +extern const FFOutputFormat ff_uncodedframecrc_muxer; extern const AVInputFormat ff_v210_demuxer; extern const AVInputFormat ff_v210x_demuxer; extern const AVInputFormat ff_vag_demuxer; extern const AVInputFormat ff_vc1_demuxer; -extern const AVOutputFormat ff_vc1_muxer; +extern const FFOutputFormat ff_vc1_muxer; extern const AVInputFormat ff_vc1t_demuxer; -extern const AVOutputFormat ff_vc1t_muxer; +extern const FFOutputFormat ff_vc1t_muxer; extern const AVInputFormat ff_vividas_demuxer; extern const AVInputFormat ff_vivo_demuxer; extern const AVInputFormat ff_vmd_demuxer; extern const AVInputFormat ff_vobsub_demuxer; extern const AVInputFormat ff_voc_demuxer; -extern const AVOutputFormat ff_voc_muxer; +extern const FFOutputFormat ff_voc_muxer; extern const AVInputFormat ff_vpk_demuxer; extern const AVInputFormat ff_vplayer_demuxer; extern const AVInputFormat ff_vqf_demuxer; extern const AVInputFormat ff_w64_demuxer; -extern const AVOutputFormat ff_w64_muxer; +extern const FFOutputFormat ff_w64_muxer; +extern const AVInputFormat ff_wady_demuxer; +extern const AVInputFormat ff_wavarc_demuxer; extern const AVInputFormat ff_wav_demuxer; -extern const AVOutputFormat ff_wav_muxer; +extern const FFOutputFormat ff_wav_muxer; extern const AVInputFormat ff_wc3_demuxer; -extern const AVOutputFormat ff_webm_muxer; +extern const FFOutputFormat ff_webm_muxer; extern const AVInputFormat ff_webm_dash_manifest_demuxer; -extern const AVOutputFormat ff_webm_dash_manifest_muxer; -extern const AVOutputFormat ff_webm_chunk_muxer; -extern const AVOutputFormat ff_webp_muxer; +extern const FFOutputFormat ff_webm_dash_manifest_muxer; +extern const FFOutputFormat ff_webm_chunk_muxer; +extern const FFOutputFormat ff_webp_muxer; extern const AVInputFormat ff_webvtt_demuxer; -extern const AVOutputFormat ff_webvtt_muxer; +extern const FFOutputFormat ff_webvtt_muxer; extern const AVInputFormat ff_wsaud_demuxer; -extern const AVOutputFormat ff_wsaud_muxer; +extern const FFOutputFormat ff_wsaud_muxer; extern const AVInputFormat ff_wsd_demuxer; extern const AVInputFormat ff_wsvqa_demuxer; extern const AVInputFormat ff_wtv_demuxer; -extern const AVOutputFormat ff_wtv_muxer; +extern const FFOutputFormat ff_wtv_muxer; extern const AVInputFormat ff_wve_demuxer; extern const AVInputFormat ff_wv_demuxer; -extern const AVOutputFormat ff_wv_muxer; +extern const FFOutputFormat ff_wv_muxer; extern const AVInputFormat ff_xa_demuxer; extern const AVInputFormat ff_xbin_demuxer; +extern const AVInputFormat ff_xmd_demuxer; extern const AVInputFormat ff_xmv_demuxer; extern const AVInputFormat ff_xvag_demuxer; extern const AVInputFormat ff_xwma_demuxer; extern const AVInputFormat ff_yop_demuxer; extern const AVInputFormat ff_yuv4mpegpipe_demuxer; -extern const AVOutputFormat ff_yuv4mpegpipe_muxer; +extern const FFOutputFormat ff_yuv4mpegpipe_muxer; /* image demuxers */ extern const AVInputFormat ff_image_bmp_pipe_demuxer; extern const AVInputFormat ff_image_cri_pipe_demuxer; @@ -508,6 +520,7 @@ extern const AVInputFormat ff_image_exr_pipe_demuxer; extern const AVInputFormat ff_image_gem_pipe_demuxer; extern const AVInputFormat ff_image_gif_pipe_demuxer; +extern const AVInputFormat ff_image_hdr_pipe_demuxer; extern const AVInputFormat ff_image_j2k_pipe_demuxer; extern const AVInputFormat ff_image_jpeg_pipe_demuxer; extern const AVInputFormat ff_image_jpegls_pipe_demuxer; @@ -538,7 +551,7 @@ extern const AVInputFormat ff_image_xwd_pipe_demuxer; /* external libraries */ -extern const AVOutputFormat ff_chromaprint_muxer; +extern const FFOutputFormat ff_chromaprint_muxer; extern const AVInputFormat ff_libgme_demuxer; extern const AVInputFormat ff_libmodplug_demuxer; extern const AVInputFormat ff_libopenmpt_demuxer; @@ -554,19 +567,21 @@ { static const uintptr_t size = sizeof(muxer_list)/sizeof(muxer_list[0]) - 1; uintptr_t i = (uintptr_t)*opaque; - const AVOutputFormat *f = NULL; + const FFOutputFormat *f = NULL; uintptr_t tmp; if (i < size) { f = muxer_list[i]; } else if (tmp = atomic_load_explicit(&outdev_list_intptr, memory_order_relaxed)) { - const AVOutputFormat *const *outdev_list = (const AVOutputFormat *const *)tmp; + const FFOutputFormat *const *outdev_list = (const FFOutputFormat *const *)tmp; f = outdev_list[i - size]; } - if (f) + if (f) { *opaque = (void*)(i + 1); - return f; + return &f->p; + } + return NULL; } const AVInputFormat *av_demuxer_iterate(void **opaque) @@ -588,7 +603,7 @@ return f; } -void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]) +void avpriv_register_devices(const FFOutputFormat * const o[], const AVInputFormat * const i[]) { atomic_store_explicit(&outdev_list_intptr, (uintptr_t)o, memory_order_relaxed); atomic_store_explicit(&indev_list_intptr, (uintptr_t)i, memory_order_relaxed); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/alp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/alp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/alp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/alp.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "libavutil/intreadwrite.h" #include "libavutil/internal.h" @@ -290,16 +291,16 @@ .version = LIBAVUTIL_VERSION_INT }; -const AVOutputFormat ff_alp_muxer = { - .name = "alp", - .long_name = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"), - .extensions = "tun,pcm", - .audio_codec = AV_CODEC_ID_ADPCM_IMA_ALP, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_alp_muxer = { + .p.name = "alp", + .p.long_name = NULL_IF_CONFIG_SMALL("LEGO Racers ALP"), + .p.extensions = "tun,pcm", + .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_ALP, + .p.video_codec = AV_CODEC_ID_NONE, + .p.priv_class = &alp_muxer_class, .init = alp_write_init, .write_header = alp_write_header, .write_packet = ff_raw_write_packet, - .priv_class = &alp_muxer_class, .priv_data_size = sizeof(ALPMuxContext) }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amr.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amr.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amr.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amr.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "rawdec.h" #include "rawenc.h" @@ -266,15 +267,15 @@ #endif #if CONFIG_AMR_MUXER -const AVOutputFormat ff_amr_muxer = { - .name = "amr", - .long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"), - .mime_type = "audio/amr", - .extensions = "amr", - .audio_codec = AV_CODEC_ID_AMR_NB, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_amr_muxer = { + .p.name = "amr", + .p.long_name = NULL_IF_CONFIG_SMALL("3GPP AMR"), + .p.mime_type = "audio/amr", + .p.extensions = "amr", + .p.audio_codec = AV_CODEC_ID_AMR_NB, + .p.video_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS, .write_header = amr_write_header, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/amvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" +#include "mux.h" #include "riff.h" #include "internal.h" #include "avio_internal.h" @@ -401,14 +402,14 @@ return 0; } -const AVOutputFormat ff_amv_muxer = { - .name = "amv", - .long_name = NULL_IF_CONFIG_SMALL("AMV"), - .mime_type = "video/amv", - .extensions = "amv", +const FFOutputFormat ff_amv_muxer = { + .p.name = "amv", + .p.long_name = NULL_IF_CONFIG_SMALL("AMV"), + .p.mime_type = "video/amv", + .p.extensions = "amv", .priv_data_size = sizeof(AMVContext), - .audio_codec = AV_CODEC_ID_ADPCM_IMA_AMV, - .video_codec = AV_CODEC_ID_AMV, + .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_AMV, + .p.video_codec = AV_CODEC_ID_AMV, .init = amv_init, .deinit = amv_deinit, .write_header = amv_write_header, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apac.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apac.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * APAC demuxer + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "demux.h" +#include "internal.h" +#include "rawdec.h" + +static int apac_probe(const AVProbeData *p) +{ + if (AV_RB32(p->buf) == MKBETAG('A','P','A','C') && + AV_RB32(p->buf + 8) == MKBETAG('P','R','O','F') && + AV_RB32(p->buf + 12) == MKBETAG('N','A','D',' ')) + return AVPROBE_SCORE_MAX; + + return 0; +} + +static int apac_read_header(AVFormatContext *s) +{ + AVIOContext *pb = s->pb; + uint32_t chunk_size; + AVStream *st; + int64_t pos; + + avio_skip(pb, 16); + chunk_size = avio_rl32(pb); + avio_skip(pb, chunk_size); + if (avio_rb32(pb) != MKBETAG('P','F','M','T')) + return AVERROR_INVALIDDATA; + chunk_size = avio_rl32(pb); + pos = avio_tell(pb); + avio_skip(pb, 2); + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + st->codecpar->codec_id = AV_CODEC_ID_APAC; + st->codecpar->ch_layout.nb_channels = avio_rl16(pb); + st->codecpar->sample_rate = avio_rl32(pb); + if (st->codecpar->ch_layout.nb_channels <= 0 || + st->codecpar->ch_layout.nb_channels > 2 || + st->codecpar->sample_rate <= 0) + return AVERROR_INVALIDDATA; + avio_skip(pb, 2); + st->codecpar->bits_per_coded_sample = avio_rl16(pb); + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + avio_skip(pb, (chunk_size + pos) - avio_tell(pb) + (chunk_size & 1)); + if (avio_rb32(pb) != MKBETAG('P','A','D',' ')) + return AVERROR_INVALIDDATA; + avio_skip(pb, 4); + + return 0; +} + +const AVInputFormat ff_apac_demuxer = { + .name = "apac", + .long_name = NULL_IF_CONFIG_SMALL("raw APAC"), + .read_probe = apac_probe, + .read_header = apac_read_header, + .read_packet = ff_raw_read_partial_packet, + .extensions = "apc", + .flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS, + .raw_codec_id = AV_CODEC_ID_APAC, + .priv_data_size = sizeof(FFRawDemuxerContext), + .priv_class = &ff_raw_demuxer_class, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ape.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ape.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ape.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ape.c 2023-03-03 13:29:59.000000000 +0000 @@ -146,7 +146,7 @@ AVStream *st; uint32_t tag; int i, ret; - int total_blocks; + int64_t total_blocks; int64_t final_size = 0; int64_t pts, file_size; @@ -329,7 +329,7 @@ if (!st) return AVERROR(ENOMEM); - total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks; + total_blocks = (ape->totalframes == 0) ? 0 : ((int64_t)(ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_APE; @@ -413,6 +413,7 @@ /* note: we need to modify the packet size here to handle the last packet */ pkt->size = ret + extra_size; + pkt->duration = nblocks; ape->currentframe++; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apetag.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apetag.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apetag.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apetag.c 2023-03-03 13:29:59.000000000 +0000 @@ -175,7 +175,7 @@ int ff_ape_write_tag(AVFormatContext *s) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int size, ret, count = 0; AVIOContext *dyn_bc; uint8_t *dyn_buf; @@ -184,7 +184,7 @@ return ret; ff_standardize_creation_time(s); - while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) { + while ((e = av_dict_iterate(s->metadata, e))) { int val_len; if (!string_is_ascii(e->key)) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apm.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "libavutil/channel_layout.h" #include "libavutil/internal.h" @@ -303,12 +304,12 @@ return 0; } -const AVOutputFormat ff_apm_muxer = { - .name = "apm", - .long_name = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"), - .extensions = "apm", - .audio_codec = AV_CODEC_ID_ADPCM_IMA_APM, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_apm_muxer = { + .p.name = "apm", + .p.long_name = NULL_IF_CONFIG_SMALL("Ubisoft Rayman 2 APM"), + .p.extensions = "apm", + .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_APM, + .p.video_codec = AV_CODEC_ID_NONE, .init = apm_write_init, .write_header = apm_write_header, .write_packet = ff_raw_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apngenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apngenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apngenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/apngenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ */ #include "avformat.h" +#include "mux.h" #include "libavutil/avassert.h" #include "libavutil/crc.h" #include "libavutil/intreadwrite.h" @@ -306,18 +307,18 @@ .option = options, }; -const AVOutputFormat ff_apng_muxer = { - .name = "apng", - .long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"), - .mime_type = "image/png", - .extensions = "apng", +const FFOutputFormat ff_apng_muxer = { + .p.name = "apng", + .p.long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"), + .p.mime_type = "image/png", + .p.extensions = "apng", .priv_data_size = sizeof(APNGMuxContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_APNG, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_APNG, .write_header = apng_write_header, .write_packet = apng_write_packet, .write_trailer = apng_write_trailer, .deinit = apng_deinit, - .priv_class = &apng_muxer_class, - .flags = AVFMT_VARIABLE_FPS, + .p.priv_class = &apng_muxer_class, + .p.flags = AVFMT_VARIABLE_FPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aptxdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aptxdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aptxdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aptxdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -58,7 +58,6 @@ st->codecpar->codec_id = AV_CODEC_ID_APTX; st->codecpar->bits_per_coded_sample = 4; st->codecpar->block_align = APTX_BLOCK_SIZE; - st->codecpar->frame_size = APTX_PACKET_SIZE; return 0; } @@ -70,18 +69,23 @@ st->codecpar->codec_id = AV_CODEC_ID_APTX_HD; st->codecpar->bits_per_coded_sample = 6; st->codecpar->block_align = APTX_HD_BLOCK_SIZE; - st->codecpar->frame_size = APTX_HD_PACKET_SIZE; return 0; } static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt) { - return av_get_packet(s->pb, pkt, APTX_PACKET_SIZE); + int ret = av_get_packet(s->pb, pkt, APTX_PACKET_SIZE); + if (ret >= 0 && !(ret % APTX_BLOCK_SIZE)) + pkt->flags &= ~AV_PKT_FLAG_CORRUPT; + return ret >= 0 ? 0 : ret; } static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt) { - return av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE); + int ret = av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE); + if (ret >= 0 && !(ret % APTX_HD_BLOCK_SIZE)) + pkt->flags &= ~AV_PKT_FLAG_CORRUPT; + return ret >= 0 ? 0 : ret; } static const AVOption aptx_options[] = { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_asf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_asf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_asf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_asf.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/avstring.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/avassert.h" @@ -470,20 +471,20 @@ .version = LIBAVUTIL_VERSION_INT }; -const AVOutputFormat ff_argo_asf_muxer = { - .name = "argo_asf", - .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"), +const FFOutputFormat ff_argo_asf_muxer = { + .p.name = "argo_asf", + .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games ASF"), /* * NB: Can't do this as it conflicts with the actual ASF format. - * .extensions = "asf", + * .p.extensions = "asf", */ - .audio_codec = AV_CODEC_ID_ADPCM_ARGO, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_ADPCM_ARGO, + .p.video_codec = AV_CODEC_ID_NONE, + .p.priv_class = &argo_asf_muxer_class, .init = argo_asf_write_init, .write_header = argo_asf_write_header, .write_packet = argo_asf_write_packet, .write_trailer = argo_asf_write_trailer, - .priv_class = &argo_asf_muxer_class, .priv_data_size = sizeof(ArgoASFMuxContext) }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_cvg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_cvg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_cvg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/argo_cvg.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/opt.h" #include "libavutil/intreadwrite.h" @@ -40,9 +41,9 @@ #define ARGO_CVG_SAMPLES_PER_BLOCK 28 typedef struct ArgoCVGHeader { - uint32_t size; /*< File size -8 (this + trailing checksum) */ - uint32_t unk1; /*< Unknown. Always seems to be 0 or 1. */ - uint32_t unk2; /*< Unknown. Always seems to be 0 or 1. */ + uint32_t size; /*< File size -8 (this + trailing checksum) */ + uint32_t loop; /*< Loop flag. */ + uint32_t reverb; /*< Reverb flag. */ } ArgoCVGHeader; typedef struct ArgoCVGOverride { @@ -62,13 +63,15 @@ typedef struct ArgoCVGMuxContext { const AVClass *class; int skip_rate_check; + int loop; + int reverb; uint32_t checksum; size_t size; } ArgoCVGMuxContext; #if CONFIG_ARGO_CVG_DEMUXER /* "Special" files that are played at a different rate. */ -static ArgoCVGOverride overrides[] = { +static const ArgoCVGOverride overrides[] = { { "CRYS.CVG", { 23592, 0, 1 }, 2495499, 88200 }, /* Beta */ { "REDCRY88.CVG", { 38280, 0, 1 }, 4134848, 88200 }, /* Beta */ { "DANLOOP1.CVG", { 54744, 1, 0 }, 5684641, 37800 }, /* Beta */ @@ -91,17 +94,17 @@ if (p->buf_size < ARGO_CVG_HEADER_SIZE) return 0; - cvg.size = AV_RL32(p->buf + 0); - cvg.unk1 = AV_RL32(p->buf + 4); - cvg.unk2 = AV_RL32(p->buf + 8); + cvg.size = AV_RL32(p->buf + 0); + cvg.loop = AV_RL32(p->buf + 4); + cvg.reverb = AV_RL32(p->buf + 8); if (cvg.size < 8) return 0; - if (cvg.unk1 != 0 && cvg.unk1 != 1) + if (cvg.loop != 0 && cvg.loop != 1) return 0; - if (cvg.unk2 != 0 && cvg.unk2 != 1) + if (cvg.reverb != 0 && cvg.reverb != 1) return 0; return AVPROBE_SCORE_MAX / 4 + 1; @@ -150,20 +153,24 @@ else if (ret != ARGO_CVG_HEADER_SIZE) return AVERROR(EIO); - ctx->header.size = AV_RL32(buf + 0); - ctx->header.unk1 = AV_RL32(buf + 4); - ctx->header.unk2 = AV_RL32(buf + 8); + ctx->header.size = AV_RL32(buf + 0); + ctx->header.loop = AV_RL32(buf + 4); + ctx->header.reverb = AV_RL32(buf + 8); if (ctx->header.size < 8) return AVERROR_INVALIDDATA; - av_log(s, AV_LOG_TRACE, "size = %u\n", ctx->header.size); - av_log(s, AV_LOG_TRACE, "unk = %u, %u\n", ctx->header.unk1, ctx->header.unk2); - if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0) return ret; - av_log(s, AV_LOG_TRACE, "checksum = %u\n", ctx->checksum); + if ((ret = av_dict_set_int(&st->metadata, "loop", ctx->header.loop, 0)) < 0) + return ret; + + if ((ret = av_dict_set_int(&st->metadata, "reverb", ctx->header.reverb, 0)) < 0) + return ret; + + if ((ret = av_dict_set_int(&st->metadata, "checksum", ctx->checksum, 0)) < 0) + return ret; par = st->codecpar; par->codec_type = AVMEDIA_TYPE_AUDIO; @@ -172,10 +179,10 @@ for (size_t i = 0; i < FF_ARRAY_ELEMS(overrides); i++) { const ArgoCVGOverride *ovr = overrides + i; - if (ovr->header.size != ctx->header.size || - ovr->header.unk1 != ctx->header.unk1 || - ovr->header.unk2 != ctx->header.unk2 || - ovr->checksum != ctx->checksum || + if (ovr->header.size != ctx->header.size || + ovr->header.loop != ctx->header.loop || + ovr->header.reverb != ctx->header.reverb || + ovr->checksum != ctx->checksum || av_strcasecmp(filename, ovr->name) != 0) continue; @@ -302,10 +309,10 @@ ArgoCVGMuxContext *ctx = s->priv_data; avio_wl32(s->pb, 0); /* Size, fixed later. */ - avio_wl32(s->pb, 0); - avio_wl32(s->pb, 1); + avio_wl32(s->pb, !!ctx->loop); + avio_wl32(s->pb, !!ctx->reverb); - ctx->checksum = 1; + ctx->checksum = !!ctx->loop + !!ctx->reverb; ctx->size = 8; return 0; } @@ -364,6 +371,26 @@ .max = 1, .flags = AV_OPT_FLAG_ENCODING_PARAM }, + { + .name = "loop", + .help = "set loop flag", + .offset = offsetof(ArgoCVGMuxContext, loop), + .type = AV_OPT_TYPE_BOOL, + .default_val = {.i64 = 0}, + .min = 0, + .max = 1, + .flags = AV_OPT_FLAG_ENCODING_PARAM + }, + { + .name = "reverb", + .help = "set reverb flag", + .offset = offsetof(ArgoCVGMuxContext, reverb), + .type = AV_OPT_TYPE_BOOL, + .default_val = {.i64 = 1}, + .min = 0, + .max = 1, + .flags = AV_OPT_FLAG_ENCODING_PARAM + }, { NULL } }; @@ -374,17 +401,17 @@ .version = LIBAVUTIL_VERSION_INT }; -const AVOutputFormat ff_argo_cvg_muxer = { - .name = "argo_cvg", - .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"), - .extensions = "cvg", - .audio_codec = AV_CODEC_ID_ADPCM_PSX, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_argo_cvg_muxer = { + .p.name = "argo_cvg", + .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"), + .p.extensions = "cvg", + .p.audio_codec = AV_CODEC_ID_ADPCM_PSX, + .p.video_codec = AV_CODEC_ID_NONE, + .p.priv_class = &argo_cvg_muxer_class, .init = argo_cvg_write_init, .write_header = argo_cvg_write_header, .write_packet = argo_cvg_write_packet, .write_trailer = argo_cvg_write_trailer, - .priv_class = &argo_cvg_muxer_class, .priv_data_size = sizeof(ArgoCVGMuxContext), }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfcrypt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfcrypt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfcrypt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfcrypt.c 2023-03-03 13:29:59.000000000 +0000 @@ -73,7 +73,7 @@ keys[i] = inverse(keys[i]); } -static uint32_t multiswap_step(const uint32_t keys[12], uint32_t v) +static uint32_t multiswap_step(const uint32_t keys[6], uint32_t v) { int i; v *= keys[0]; @@ -85,7 +85,7 @@ return v; } -static uint32_t multiswap_inv_step(const uint32_t keys[12], uint32_t v) +static uint32_t multiswap_inv_step(const uint32_t keys[6], uint32_t v) { int i; v -= keys[5]; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfdec_o.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfdec_o.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfdec_o.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfdec_o.c 2023-03-03 13:29:59.000000000 +0000 @@ -888,6 +888,8 @@ av_log(s, AV_LOG_ERROR, "Skipping failed in asf_read_simple_index.\n"); return offset; } + if (asf->first_packet_offset > INT64_MAX - asf->packet_size * pkt_num) + return AVERROR_INVALIDDATA; if (prev_pkt_num != pkt_num) { av_add_index_entry(st, asf->first_packet_offset + asf->packet_size * pkt_num, av_rescale(interval, i, 10000), diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/asfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/dict.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" +#include "libavcodec/codec_desc.h" #include "avformat.h" #include "avlanguage.h" #include "avio_internal.h" @@ -569,10 +570,10 @@ end_header(pb, hpos); } if (metadata_count) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; hpos = put_header(pb, &ff_asf_extended_content_header); avio_wl16(pb, metadata_count); - while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(s->metadata, tag))) { put_str16(pb, dyn_buf, tag->key); avio_wl16(pb, 0); put_str16(pb, dyn_buf, tag->value); @@ -1128,39 +1129,39 @@ }; #if CONFIG_ASF_MUXER -const AVOutputFormat ff_asf_muxer = { - .name = "asf", - .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), - .mime_type = "video/x-ms-asf", - .extensions = "asf,wmv,wma", +const FFOutputFormat ff_asf_muxer = { + .p.name = "asf", + .p.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), + .p.mime_type = "video/x-ms-asf", + .p.extensions = "asf,wmv,wma", + .p.audio_codec = AV_CODEC_ID_WMAV2, + .p.video_codec = AV_CODEC_ID_MSMPEG4V3, + .p.flags = AVFMT_GLOBALHEADER, + .p.codec_tag = asf_codec_tags, + .p.priv_class = &asf_muxer_class, .priv_data_size = sizeof(ASFContext), - .audio_codec = AV_CODEC_ID_WMAV2, - .video_codec = AV_CODEC_ID_MSMPEG4V3, .write_header = asf_write_header, .write_packet = asf_write_packet, .write_trailer = asf_write_trailer, - .flags = AVFMT_GLOBALHEADER, - .codec_tag = asf_codec_tags, - .priv_class = &asf_muxer_class, .deinit = asf_deinit, }; #endif /* CONFIG_ASF_MUXER */ #if CONFIG_ASF_STREAM_MUXER -const AVOutputFormat ff_asf_stream_muxer = { - .name = "asf_stream", - .long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), - .mime_type = "video/x-ms-asf", - .extensions = "asf,wmv,wma", +const FFOutputFormat ff_asf_stream_muxer = { + .p.name = "asf_stream", + .p.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"), + .p.mime_type = "video/x-ms-asf", + .p.extensions = "asf,wmv,wma", .priv_data_size = sizeof(ASFContext), - .audio_codec = AV_CODEC_ID_WMAV2, - .video_codec = AV_CODEC_ID_MSMPEG4V3, + .p.audio_codec = AV_CODEC_ID_WMAV2, + .p.video_codec = AV_CODEC_ID_MSMPEG4V3, .write_header = asf_write_stream_header, .write_packet = asf_write_packet, .write_trailer = asf_write_trailer, - .flags = AVFMT_GLOBALHEADER, - .codec_tag = asf_codec_tags, - .priv_class = &asf_muxer_class, + .p.flags = AVFMT_GLOBALHEADER, + .p.codec_tag = asf_codec_tags, + .p.priv_class = &asf_muxer_class, .deinit = asf_deinit, }; #endif /* CONFIG_ASF_STREAM_MUXER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/assenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/assenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/assenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/assenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "libavutil/avstring.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/opt.h" @@ -226,16 +227,16 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_ass_muxer = { - .name = "ass", - .long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"), - .mime_type = "text/x-ass", - .extensions = "ass,ssa", +const FFOutputFormat ff_ass_muxer = { + .p.name = "ass", + .p.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"), + .p.mime_type = "text/x-ass", + .p.extensions = "ass,ssa", + .p.subtitle_codec = AV_CODEC_ID_ASS, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT, + .p.priv_class = &ass_class, .priv_data_size = sizeof(ASSContext), - .subtitle_codec = AV_CODEC_ID_ASS, .write_header = write_header, .write_packet = write_packet, .write_trailer = write_trailer, - .flags = AVFMT_GLOBALHEADER | AVFMT_NOTIMESTAMPS | AVFMT_TS_NONSTRICT, - .priv_class = &ass_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/astenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/astenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/astenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/astenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avio_internal.h" #include "internal.h" #include "ast.h" +#include "mux.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" @@ -194,16 +195,16 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_ast_muxer = { - .name = "ast", - .long_name = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"), - .extensions = "ast", +const FFOutputFormat ff_ast_muxer = { + .p.name = "ast", + .p.long_name = NULL_IF_CONFIG_SMALL("AST (Audio Stream)"), + .p.extensions = "ast", .priv_data_size = sizeof(ASTMuxContext), - .audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = ast_write_header, .write_packet = ast_write_packet, .write_trailer = ast_write_trailer, - .priv_class = &ast_muxer_class, - .codec_tag = ff_ast_codec_tags_list, + .p.priv_class = &ast_muxer_class, + .p.codec_tag = ff_ast_codec_tags_list, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/async.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/async.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/async.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/async.c 2023-03-03 13:29:59.000000000 +0000 @@ -189,6 +189,8 @@ int ret = 0; int64_t seek_ret; + ff_thread_setname("async"); + while (1) { int fifo_space, to_copy; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/au.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/au.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/au.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/au.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "avformat.h" #include "internal.h" #include "avio_internal.h" +#include "mux.h" #include "pcm.h" #include "libavutil/avassert.h" @@ -331,19 +332,19 @@ return 0; } -const AVOutputFormat ff_au_muxer = { - .name = "au", - .long_name = NULL_IF_CONFIG_SMALL("Sun AU"), - .mime_type = "audio/basic", - .extensions = "au", +const FFOutputFormat ff_au_muxer = { + .p.name = "au", + .p.long_name = NULL_IF_CONFIG_SMALL("Sun AU"), + .p.mime_type = "audio/basic", + .p.extensions = "au", + .p.codec_tag = au_codec_tags, + .p.audio_codec = AV_CODEC_ID_PCM_S16BE, + .p.video_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS, .priv_data_size = sizeof(AUContext), - .audio_codec = AV_CODEC_ID_PCM_S16BE, - .video_codec = AV_CODEC_ID_NONE, .write_header = au_write_header, .write_packet = ff_raw_write_packet, .write_trailer = au_write_trailer, - .codec_tag = au_codec_tags, - .flags = AVFMT_NOTIMESTAMPS, }; #endif /* CONFIG_AU_MUXER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/av1dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/av1dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/av1dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/av1dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,11 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config.h" #include "config_components.h" #include "libavutil/common.h" #include "libavutil/opt.h" +#include "libavcodec/avcodec.h" #include "libavcodec/av1_parse.h" #include "libavcodec/bsf.h" #include "avformat.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,6 +35,7 @@ #include "avformat.h" #include "avio.h" #include "demux.h" +#include "mux.h" #include "internal.h" void ff_free_stream(AVStream **pst) @@ -100,8 +101,8 @@ return; si = ffformatcontext(s); - if (s->oformat && s->oformat->deinit && si->initialized) - s->oformat->deinit(s); + if (s->oformat && ffofmt(s->oformat)->deinit && si->initialized) + ffofmt(s->oformat)->deinit(s); av_opt_free(s); if (s->iformat && s->iformat->priv_class && s->priv_data) @@ -235,6 +236,72 @@ return 0; } +/** + * Copy all stream parameters from source to destination stream, with the + * exception of the index field, which is usually set by avformat_new_stream(). + * + * @param dst pointer to destination AVStream + * @param src pointer to source AVStream + * @return >=0 on success, AVERROR code on error + */ +static int stream_params_copy(AVStream *dst, const AVStream *src) +{ + int ret; + + dst->id = src->id; + dst->time_base = src->time_base; + dst->start_time = src->start_time; + dst->duration = src->duration; + dst->nb_frames = src->nb_frames; + dst->disposition = src->disposition; + dst->discard = src->discard; + dst->sample_aspect_ratio = src->sample_aspect_ratio; + dst->avg_frame_rate = src->avg_frame_rate; + dst->event_flags = src->event_flags; + dst->r_frame_rate = src->r_frame_rate; + dst->pts_wrap_bits = src->pts_wrap_bits; + + av_dict_free(&dst->metadata); + ret = av_dict_copy(&dst->metadata, src->metadata, 0); + if (ret < 0) + return ret; + + ret = avcodec_parameters_copy(dst->codecpar, src->codecpar); + if (ret < 0) + return ret; + + ret = ff_stream_side_data_copy(dst, src); + if (ret < 0) + return ret; + + av_packet_unref(&dst->attached_pic); + if (src->attached_pic.data) { + ret = av_packet_ref(&dst->attached_pic, &src->attached_pic); + if (ret < 0) + return ret; + } + + return 0; +} + +AVStream *ff_stream_clone(AVFormatContext *dst_ctx, const AVStream *src) +{ + AVStream *st; + int ret; + + st = avformat_new_stream(dst_ctx, NULL); + if (!st) + return NULL; + + ret = stream_params_copy(st, src); + if (ret < 0) { + ff_remove_stream(dst_ctx, st); + return NULL; + } + + return st; +} + AVProgram *av_new_program(AVFormatContext *ac, int id) { AVProgram *program = NULL; @@ -636,6 +703,10 @@ { const AVCodecContext *const dec_ctx = cffstream(ist)->avctx; AVCodecContext *const enc_ctx = ffstream(ost)->avctx; + AVRational dec_ctx_tb = dec_ctx->framerate.num ? av_inv_q(av_mul_q(dec_ctx->framerate, + (AVRational){dec_ctx->ticks_per_frame, 1})) + : (ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO ? (AVRational){0, 1} + : ist->time_base); enc_ctx->time_base = ist->time_base; /* @@ -648,38 +719,41 @@ if (copy_tb == AVFMT_TBCF_AUTO && ist->r_frame_rate.num && av_q2d(ist->r_frame_rate) >= av_q2d(ist->avg_frame_rate) && 0.5/av_q2d(ist->r_frame_rate) > av_q2d(ist->time_base) - && 0.5/av_q2d(ist->r_frame_rate) > av_q2d(dec_ctx->time_base) - && av_q2d(ist->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500 + && 0.5/av_q2d(ist->r_frame_rate) > av_q2d(dec_ctx_tb) + && av_q2d(ist->time_base) < 1.0/500 && av_q2d(dec_ctx_tb) < 1.0/500 || copy_tb == AVFMT_TBCF_R_FRAMERATE) { enc_ctx->time_base.num = ist->r_frame_rate.den; enc_ctx->time_base.den = 2*ist->r_frame_rate.num; enc_ctx->ticks_per_frame = 2; } else #endif - if (copy_tb == AVFMT_TBCF_AUTO && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 2*av_q2d(ist->time_base) + if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->framerate.num && + av_q2d(av_inv_q(dec_ctx->framerate)) > 2*av_q2d(ist->time_base) && av_q2d(ist->time_base) < 1.0/500 - || copy_tb == AVFMT_TBCF_DECODER) { - enc_ctx->time_base = dec_ctx->time_base; + || (copy_tb == AVFMT_TBCF_DECODER && + (dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) { + enc_ctx->time_base = dec_ctx_tb; enc_ctx->time_base.num *= dec_ctx->ticks_per_frame; enc_ctx->time_base.den *= 2; enc_ctx->ticks_per_frame = 2; } } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS) && !av_match_name(ofmt->name, "mov,mp4,3gp,3g2,psp,ipod,ismv,f4v")) { - if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->time_base.den - && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > av_q2d(ist->time_base) + if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->framerate.num + && av_q2d(av_inv_q(dec_ctx->framerate)) > av_q2d(ist->time_base) && av_q2d(ist->time_base) < 1.0/500 - || copy_tb == AVFMT_TBCF_DECODER) { - enc_ctx->time_base = dec_ctx->time_base; + || (copy_tb == AVFMT_TBCF_DECODER && + (dec_ctx->framerate.num || ist->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) { + enc_ctx->time_base = dec_ctx_tb; enc_ctx->time_base.num *= dec_ctx->ticks_per_frame; } } if ((enc_ctx->codec_tag == AV_RL32("tmcd") || ost->codecpar->codec_tag == AV_RL32("tmcd")) - && dec_ctx->time_base.num < dec_ctx->time_base.den - && dec_ctx->time_base.num > 0 - && 121LL*dec_ctx->time_base.num > dec_ctx->time_base.den) { - enc_ctx->time_base = dec_ctx->time_base; + && dec_ctx_tb.num < dec_ctx_tb.den + && dec_ctx_tb.num > 0 + && 121LL*dec_ctx_tb.num > dec_ctx_tb.den) { + enc_ctx->time_base = dec_ctx_tb; } av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den, @@ -780,10 +854,16 @@ { int ret = 0; if (*pb) { +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS if (s->io_close == ff_format_io_close_default || s->io_close == NULL) +#endif ret = s->io_close2(s, *pb); +#if FF_API_AVFORMAT_IO_CLOSE else s->io_close(s, *pb); +FF_ENABLE_DEPRECATION_WARNINGS +#endif } *pb = NULL; return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avformat.h 2023-03-03 13:29:59.000000000 +0000 @@ -328,10 +328,8 @@ #endif struct AVFormatContext; -struct AVStream; struct AVDeviceInfoList; -struct AVDeviceCapabilitiesQuery; /** * @defgroup metadata_api Public Metadata API @@ -536,114 +534,6 @@ const AVClass *priv_class; ///< AVClass for the private context - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - /** - * size of private data so that it can be allocated in the wrapper - */ - int priv_data_size; - - /** - * Internal flags. See FF_FMT_FLAG_* in internal.h. - */ - int flags_internal; - - int (*write_header)(struct AVFormatContext *); - /** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - */ - int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); - int (*write_trailer)(struct AVFormatContext *); - /** - * A format-specific function for interleavement. - * If unset, packets will be interleaved by dts. - * - * @param s An AVFormatContext for output. pkt will be added to - * resp. taken from its packet buffer. - * @param[in,out] pkt A packet to be interleaved if has_packet is set; - * also used to return packets. If no packet is returned - * (e.g. on error), pkt is blank on return. - * @param flush 1 if no further packets are available as input and - * all remaining packets should be output. - * @param has_packet If set, pkt contains a packet to be interleaved - * on input; otherwise pkt is blank on input. - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - */ - int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt, - int flush, int has_packet); - /** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - */ - int (*query_codec)(enum AVCodecID id, int std_compliance); - - void (*get_output_timestamp)(struct AVFormatContext *s, int stream, - int64_t *dts, int64_t *wall); - /** - * Allows sending messages from application to device. - */ - int (*control_message)(struct AVFormatContext *s, int type, - void *data, size_t data_size); - - /** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - */ - int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index, - AVFrame **frame, unsigned flags); - /** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - */ - int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); - enum AVCodecID data_codec; /**< default data codec */ - /** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure - * - * Any allocations made here must be freed in deinit(). - */ - int (*init)(struct AVFormatContext *); - /** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - */ - void (*deinit)(struct AVFormatContext *); - /** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * - * @note pkt might have been directly forwarded by a meta-muxer; therefore - * pkt->stream_index as well as the pkt's timebase might be invalid. - * Return 0 if more packets from this stream must be checked; 1 if not. - */ - int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st, - const AVPacket *pkt); } AVOutputFormat; /** * @} @@ -948,12 +838,10 @@ * sizeof(AVStream) must not be used outside libav*. */ typedef struct AVStream { -#if FF_API_AVSTREAM_CLASS /** * A class for @ref avoptions. Set on stream creation. */ const AVClass *av_class; -#endif int index; /**< stream index in AVFormatContext */ /** @@ -963,6 +851,17 @@ */ int id; + /** + * Codec parameters associated with this stream. Allocated and freed by + * libavformat in avformat_new_stream() and avformat_free_context() + * respectively. + * + * - demuxing: filled by libavformat on stream creation or in + * avformat_find_stream_info() + * - muxing: filled by the caller before avformat_write_header() + */ + AVCodecParameters *codecpar; + void *priv_data; /** @@ -1099,17 +998,6 @@ AVRational r_frame_rate; /** - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - */ - AVCodecParameters *codecpar; - - /** * Number of bits in timestamps. Used for wrapping control. * * - demuxing: set by libavformat @@ -1121,12 +1009,15 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +#if FF_API_GET_END_PTS /** * Returns the pts of the last muxed packet + its duration * * the retuned value is undefined when used with a demuxer. */ +attribute_deprecated int64_t av_stream_get_end_pts(const AVStream *st); +#endif #define AV_PROGRAM_RUNNING 1 @@ -1349,9 +1240,6 @@ */ #define AVFMT_FLAG_BITEXACT 0x0400 #define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) -#if FF_API_LAVF_PRIV_OPT -#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (deprecated, does nothing) -#endif #define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats #define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops. #define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer @@ -1775,10 +1663,15 @@ int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options); +#if FF_API_AVFORMAT_IO_CLOSE /** * A callback for closing the streams opened with AVFormatContext.io_open(). + * + * @deprecated use io_close2 */ + attribute_deprecated void (*io_close)(struct AVFormatContext *s, AVIOContext *pb); +#endif /** * ',' separated list of disallowed protocols. @@ -1895,8 +1788,8 @@ /** * Iterate over all registered demuxers. * - * @param opaque a pointer where libavformat will store the iteration state. Must - * point to NULL to start the iteration. + * @param opaque a pointer where libavformat will store the iteration state. + * Must point to NULL to start the iteration. * * @return the next registered demuxer or NULL when the iteration is * finished @@ -1954,12 +1847,13 @@ /** * Wrap an existing array as stream side data. * - * @param st stream + * @param st stream * @param type side information type * @param data the side data array. It must be allocated with the av_malloc() * family of functions. The ownership of the data is transferred to * st. * @param size side information size + * * @return zero on success, a negative AVERROR code on failure. On failure, * the stream is unchanged and the data remains owned by the caller. */ @@ -1970,8 +1864,9 @@ * Allocate new information from stream. * * @param stream stream - * @param type desired side information type - * @param size side information size + * @param type desired side information type + * @param size side information size + * * @return pointer to fresh allocated data or NULL otherwise */ uint8_t *av_stream_new_side_data(AVStream *stream, @@ -1980,9 +1875,10 @@ * Get side information from stream. * * @param stream stream - * @param type desired side information type - * @param size If supplied, *size will be set to the size of the side data - * or to zero if the desired side data is not present. + * @param type desired side information type + * @param size If supplied, *size will be set to the size of the side data + * or to zero if the desired side data is not present. + * * @return pointer to data if present or NULL otherwise */ uint8_t *av_stream_get_side_data(const AVStream *stream, @@ -2000,16 +1896,17 @@ * avformat_free_context() can be used to free the context and * everything allocated by the framework within it. * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure + * @param ctx pointee is set to the created format context, + * or to NULL in case of failure + * @param oformat format to use for allocating the context, if NULL + * format_name and filename are used instead + * @param format_name the name of output format to use for allocating the + * context, if NULL filename is used instead + * @param filename the name of the filename to use for allocating the + * context, may be NULL + * + * @return >= 0 in case of success, a negative AVERROR code in case of + * failure */ int avformat_alloc_output_context2(AVFormatContext **ctx, const AVOutputFormat *oformat, const char *format_name, const char *filename); @@ -2064,15 +1961,16 @@ * attempt is made. When the maximum probe size is reached, the input format * with the highest score is returned. * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from + * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param url the url of the stream + * @param logctx the log context + * @param offset the offset within the bytestream to probe from * @param max_probe_size the maximum probe buffer size (zero for default) + * * @return the score in case of success, a negative value corresponding to an * the maximal score is AVPROBE_SCORE_MAX - * AVERROR code otherwise + * AVERROR code otherwise */ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, const char *url, void *logctx, @@ -2089,16 +1987,19 @@ * Open an input stream and read the header. The codecs are not opened. * The stream must be closed with avformat_close_input(). * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. + * @param ps Pointer to user-supplied AVFormatContext (allocated by + * avformat_alloc_context). May be a pointer to NULL, in + * which case an AVFormatContext is allocated by this + * function and written into ps. + * Note that a user-supplied AVFormatContext will be freed + * on failure. + * @param url URL of the stream to open. + * @param fmt If non-NULL, this parameter forces a specific input format. + * Otherwise the format is autodetected. + * @param options A dictionary filled with AVFormatContext and demuxer-private + * options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. * * @return 0 on success, a negative AVERROR on failure. * @@ -2137,6 +2038,7 @@ * @param last the last found program, the search will start after this * program, or from the beginning if it is NULL * @param s stream index + * * @return the next program which belongs to s, NULL if no program is found or * the last program is not among the programs of ic. */ @@ -2161,10 +2063,12 @@ * @param decoder_ret if non-NULL, returns the decoder for the * selected stream * @param flags flags; none are currently defined + * * @return the non-negative stream number in case of success, * AVERROR_STREAM_NOT_FOUND if no stream with the requested type * could be found, * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + * * @note If av_find_best_stream returns successfully and decoder_ret is not * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. */ @@ -2208,13 +2112,14 @@ * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode + * @param s media file handle + * @param stream_index If stream_index is (-1), a default stream is selected, + * and timestamp is automatically converted from + * AV_TIME_BASE units to the stream specific time_base. + * @param timestamp Timestamp in AVStream.time_base units or, if no stream + * is specified, in AV_TIME_BASE units. + * @param flags flags which select direction and seeking mode + * * @return >= 0 on success */ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, @@ -2236,12 +2141,12 @@ * keyframes (this may not be supported by all demuxers). * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. * - * @param s media file handle + * @param s media file handle * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags + * @param min_ts smallest acceptable timestamp + * @param ts target timestamp + * @param max_ts largest acceptable timestamp + * @param flags flags * @return >=0 on success, error code otherwise * * @note This is part of the new seek API which is still under construction. @@ -2305,16 +2210,22 @@ * Allocate the stream private data and write the stream header to * an output media file. * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init, - * negative AVERROR on failure. + * @param s Media file handle, must be allocated with + * avformat_alloc_context(). + * Its \ref AVFormatContext.oformat "oformat" field must be set + * to the desired output format; + * Its \ref AVFormatContext.pb "pb" field must be set to an + * already opened ::AVIOContext. + * @param options An ::AVDictionary filled with AVFormatContext and + * muxer-private options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. + * + * @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec had not already been + * fully initialized in avformat_init_output(). + * @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec had already been fully + * initialized in avformat_init_output(). + * @retval AVERROR A negative AVERROR on failure. * * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output. */ @@ -2323,20 +2234,26 @@ /** * Allocate the stream private data and initialize the codec, but do not write the header. - * May optionally be used before avformat_write_header to initialize stream parameters + * May optionally be used before avformat_write_header() to initialize stream parameters * before actually writing the header. - * If using this function, do not pass the same options to avformat_write_header. + * If using this function, do not pass the same options to avformat_write_header(). * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. - * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized, - * negative AVERROR on failure. + * @param s Media file handle, must be allocated with + * avformat_alloc_context(). + * Its \ref AVFormatContext.oformat "oformat" field must be set + * to the desired output format; + * Its \ref AVFormatContext.pb "pb" field must be set to an + * already opened ::AVIOContext. + * @param options An ::AVDictionary filled with AVFormatContext and + * muxer-private options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. + * + * @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec requires + * avformat_write_header to fully initialize. + * @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec has been fully + * initialized. + * @retval AVERROR Anegative AVERROR on failure. * * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header. */ @@ -2481,11 +2398,11 @@ * there is no match. * * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats + * names of the registered formats + * @param filename if non-NULL checks if filename terminates with the + * extensions of the registered formats + * @param mime_type if non-NULL checks if mime_type matches with the + * MIME type of the registered formats */ const AVOutputFormat *av_guess_format(const char *short_name, const char *filename, @@ -2509,9 +2426,11 @@ * time_base units * @param[out] wall absolute time when that packet whas output, * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. + * @retval 0 Success + * @retval AVERROR(ENOSYS) The format does not support it + * + * @note Some formats or devices may not allow to measure dts and wall + * atomically. */ int av_get_output_timestamp(struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall); @@ -2653,7 +2572,7 @@ * Get the AVIndexEntry corresponding to the given timestamp. * * @param st Stream containing the requested AVIndexEntry. - * @param timestamp Timestamp to retrieve the index entry for. + * @param wanted_timestamp Timestamp to retrieve the index entry for. * @param flags If AVSEEK_FLAG_BACKWARD then the returned entry will correspond * to the timestamp which is <= the requested one, if backward * is 0, then it will be >= diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avidec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avidec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avidec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avidec.c 2023-03-03 13:29:59.000000000 +0000 @@ -923,6 +923,7 @@ ast->dshow_block_align = 0; } if ((st->codecpar->codec_id == AV_CODEC_ID_AAC || + st->codecpar->codec_id == AV_CODEC_ID_FTR || st->codecpar->codec_id == AV_CODEC_ID_FLAC || st->codecpar->codec_id == AV_CODEC_ID_MP2 ) && ast->dshow_block_align <= 4 && ast->dshow_block_align) { av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avienc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avienc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avienc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avienc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include "config_components.h" #include "riff.h" #include "mpegts.h" +#include "mux.h" #include "rawutils.h" #include "libavformat/avlanguage.h" #include "libavutil/avstring.h" @@ -1003,19 +1004,19 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_avi_muxer = { - .name = "avi", - .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"), - .mime_type = "video/x-msvideo", - .extensions = "avi", +const FFOutputFormat ff_avi_muxer = { + .p.name = "avi", + .p.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"), + .p.mime_type = "video/x-msvideo", + .p.extensions = "avi", .priv_data_size = sizeof(AVIContext), - .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_MPEG4, + .p.audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_AC3, + .p.video_codec = AV_CODEC_ID_MPEG4, .init = avi_init, .deinit = avi_deinit, .write_header = avi_write_header, .write_packet = avi_write_packet, .write_trailer = avi_write_trailer, - .codec_tag = ff_riff_codec_tags_list, - .priv_class = &avi_muxer_class, + .p.codec_tag = ff_riff_codec_tags_list, + .p.priv_class = &avi_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aviobuf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aviobuf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aviobuf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/aviobuf.c 2023-03-03 13:29:59.000000000 +0000 @@ -125,11 +125,6 @@ ctx->current_type = AVIO_DATA_MARKER_UNKNOWN; ctx->last_time = AV_NOPTS_VALUE; ctx->short_seek_get = NULL; -#if FF_API_AVIOCONTEXT_WRITTEN -FF_DISABLE_DEPRECATION_WARNINGS - s->written = 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif } AVIOContext *avio_alloc_context( @@ -174,11 +169,6 @@ if (s->pos + len > ctx->written_output_size) { ctx->written_output_size = s->pos + len; -#if FF_API_AVIOCONTEXT_WRITTEN -FF_DISABLE_DEPRECATION_WARNINGS - s->written = ctx->written_output_size; -FF_ENABLE_DEPRECATION_WARNINGS -#endif } } } @@ -231,12 +221,14 @@ void avio_write(AVIOContext *s, const unsigned char *buf, int size) { + if (size <= 0) + return; if (s->direct && !s->update_checksum) { avio_flush(s); writeout(s, buf, size); return; } - while (size > 0) { + do { int len = FFMIN(s->buf_end - s->buf_ptr, size); memcpy(s->buf_ptr, buf, len); s->buf_ptr += len; @@ -246,7 +238,7 @@ buf += len; size -= len; - } + } while (size > 0); } void avio_flush(AVIOContext *s) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.c 2023-03-03 13:29:59.000000000 +0000 @@ -528,6 +528,12 @@ return ret; } +#if !FF_API_AVIODIRCONTEXT +struct AVIODirContext { + struct URLContext *url_context; +}; +#endif + int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options) { URLContext *h = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avio.h 2023-03-03 13:29:59.000000000 +0000 @@ -101,9 +101,13 @@ int64_t filemode; /**< Unix file mode, -1 if unknown. */ } AVIODirEntry; +#if FF_API_AVIODIRCONTEXT typedef struct AVIODirContext { struct URLContext *url_context; } AVIODirContext; +#else +typedef struct AVIODirContext AVIODirContext; +#endif /** * Different data types that can be returned via the AVIO @@ -291,16 +295,6 @@ */ int ignore_boundary_point; -#if FF_API_AVIOCONTEXT_WRITTEN - /** - * @deprecated field utilized privately by libavformat. For a public - * statistic of how many bytes were written out, see - * AVIOContext::bytes_written. - */ - attribute_deprecated - int64_t written; -#endif - /** * Maximum reached position before a backward seek in the write buffer, * used keeping track of already written data for a later flush. @@ -464,6 +458,7 @@ * * Zero-length ranges are omitted from the output. * + * @param s the AVIOContext * @param time the stream time the current bytestream pos corresponds to * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not * applicable diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avisynth.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avisynth.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avisynth.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/avisynth.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/internal.h" +#include "libavutil/opt.h" #include "libavcodec/internal.h" @@ -85,7 +86,18 @@ #undef AVSC_DECLARE_FUNC } AviSynthLibrary; +typedef enum AviSynthFlags { + AVISYNTH_FRAMEPROP_FIELD_ORDER = (1 << 0), + AVISYNTH_FRAMEPROP_RANGE = (1 << 1), + AVISYNTH_FRAMEPROP_PRIMARIES = (1 << 2), + AVISYNTH_FRAMEPROP_TRANSFER = (1 << 3), + AVISYNTH_FRAMEPROP_MATRIX = (1 << 4), + AVISYNTH_FRAMEPROP_CHROMA_LOCATION = (1 << 5), + AVISYNTH_FRAMEPROP_SAR = (1 << 6), +} AviSynthFlags; + typedef struct AviSynthContext { + const AVClass *class; AVS_ScriptEnvironment *env; AVS_Clip *clip; const AVS_VideoInfo *vi; @@ -100,6 +112,8 @@ int error; + uint32_t flags; + /* Linked list pointers. */ struct AviSynthContext *next; } AviSynthContext; @@ -251,6 +265,8 @@ AVS_VideoFrame *frame; int error; int planar = 0; // 0: packed, 1: YUV, 2: Y8, 3: Planar RGB, 4: YUVA, 5: Planar RGBA + int sar_num = 1; + int sar_den = 1; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; @@ -516,218 +532,239 @@ avsmap = avs_library.avs_get_frame_props_ro(avs->env, frame); /* Field order */ - if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) { - st->codecpar->field_order = AV_FIELD_UNKNOWN; - } else { - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) { - case 0: - st->codecpar->field_order = AV_FIELD_PROGRESSIVE; - break; - case 1: - st->codecpar->field_order = AV_FIELD_BB; - break; - case 2: - st->codecpar->field_order = AV_FIELD_TT; - break; - default: + if(avs->flags & AVISYNTH_FRAMEPROP_FIELD_ORDER) { + if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) { st->codecpar->field_order = AV_FIELD_UNKNOWN; + } else { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) { + case 0: + st->codecpar->field_order = AV_FIELD_PROGRESSIVE; + break; + case 1: + st->codecpar->field_order = AV_FIELD_BB; + break; + case 2: + st->codecpar->field_order = AV_FIELD_TT; + break; + default: + st->codecpar->field_order = AV_FIELD_UNKNOWN; + } } } /* Color Range */ - if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) { - st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED; - } else { - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) { - case 0: - st->codecpar->color_range = AVCOL_RANGE_JPEG; - break; - case 1: - st->codecpar->color_range = AVCOL_RANGE_MPEG; - break; - default: + if(avs->flags & AVISYNTH_FRAMEPROP_RANGE) { + if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) { st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED; + } else { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) { + case 0: + st->codecpar->color_range = AVCOL_RANGE_JPEG; + break; + case 1: + st->codecpar->color_range = AVCOL_RANGE_MPEG; + break; + default: + st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED; + } } } /* Color Primaries */ - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) { - case 1: - st->codecpar->color_primaries = AVCOL_PRI_BT709; - break; - case 2: - st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED; - break; - case 4: - st->codecpar->color_primaries = AVCOL_PRI_BT470M; - break; - case 5: - st->codecpar->color_primaries = AVCOL_PRI_BT470BG; - break; - case 6: - st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M; - break; - case 7: - st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M; - break; - case 8: - st->codecpar->color_primaries = AVCOL_PRI_FILM; - break; - case 9: - st->codecpar->color_primaries = AVCOL_PRI_BT2020; - break; - case 10: - st->codecpar->color_primaries = AVCOL_PRI_SMPTE428; - break; - case 11: - st->codecpar->color_primaries = AVCOL_PRI_SMPTE431; - break; - case 12: - st->codecpar->color_primaries = AVCOL_PRI_SMPTE432; - break; - case 22: - st->codecpar->color_primaries = AVCOL_PRI_EBU3213; - break; - default: - st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED; - } - - /* Color Transfer Characteristics */ - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) { - case 1: - st->codecpar->color_trc = AVCOL_TRC_BT709; - break; - case 2: - st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; - break; - case 4: - st->codecpar->color_trc = AVCOL_TRC_GAMMA22; - break; - case 5: - st->codecpar->color_trc = AVCOL_TRC_GAMMA28; - break; - case 6: - st->codecpar->color_trc = AVCOL_TRC_SMPTE170M; - break; - case 7: - st->codecpar->color_trc = AVCOL_TRC_SMPTE240M; - break; - case 8: - st->codecpar->color_trc = AVCOL_TRC_LINEAR; - break; - case 9: - st->codecpar->color_trc = AVCOL_TRC_LOG; - break; - case 10: - st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT; - break; - case 11: - st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4; - break; - case 12: - st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG; - break; - case 13: - st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1; - break; - case 14: - st->codecpar->color_trc = AVCOL_TRC_BT2020_10; - break; - case 15: - st->codecpar->color_trc = AVCOL_TRC_BT2020_12; - break; - case 16: - st->codecpar->color_trc = AVCOL_TRC_SMPTE2084; - break; - case 17: - st->codecpar->color_trc = AVCOL_TRC_SMPTE428; - break; - case 18: - st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67; - break; - default: - st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; - } - - /* Matrix coefficients */ - if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) { - st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; - } else { - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) { - case 0: - st->codecpar->color_space = AVCOL_SPC_RGB; - break; + if(avs->flags & AVISYNTH_FRAMEPROP_PRIMARIES) { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) { case 1: - st->codecpar->color_space = AVCOL_SPC_BT709; + st->codecpar->color_primaries = AVCOL_PRI_BT709; break; case 2: - st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; + st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED; break; case 4: - st->codecpar->color_space = AVCOL_SPC_FCC; + st->codecpar->color_primaries = AVCOL_PRI_BT470M; break; case 5: - st->codecpar->color_space = AVCOL_SPC_BT470BG; + st->codecpar->color_primaries = AVCOL_PRI_BT470BG; break; case 6: - st->codecpar->color_space = AVCOL_SPC_SMPTE170M; + st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M; break; case 7: - st->codecpar->color_space = AVCOL_SPC_SMPTE240M; + st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M; break; case 8: - st->codecpar->color_space = AVCOL_SPC_YCGCO; + st->codecpar->color_primaries = AVCOL_PRI_FILM; break; case 9: - st->codecpar->color_space = AVCOL_SPC_BT2020_NCL; + st->codecpar->color_primaries = AVCOL_PRI_BT2020; break; case 10: - st->codecpar->color_space = AVCOL_SPC_BT2020_CL; + st->codecpar->color_primaries = AVCOL_PRI_SMPTE428; break; case 11: - st->codecpar->color_space = AVCOL_SPC_SMPTE2085; + st->codecpar->color_primaries = AVCOL_PRI_SMPTE431; break; case 12: - st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL; - break; - case 13: - st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL; + st->codecpar->color_primaries = AVCOL_PRI_SMPTE432; break; - case 14: - st->codecpar->color_space = AVCOL_SPC_ICTCP; + case 22: + st->codecpar->color_primaries = AVCOL_PRI_EBU3213; break; default: - st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; + st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED; } } - /* Chroma Location */ - if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) { - st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED; - } else { - switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) { - case 0: - st->codecpar->chroma_location = AVCHROMA_LOC_LEFT; - break; + /* Color Transfer Characteristics */ + if(avs->flags & AVISYNTH_FRAMEPROP_TRANSFER) { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) { case 1: - st->codecpar->chroma_location = AVCHROMA_LOC_CENTER; + st->codecpar->color_trc = AVCOL_TRC_BT709; break; case 2: - st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT; - break; - case 3: - st->codecpar->chroma_location = AVCHROMA_LOC_TOP; + st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; break; case 4: - st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT; + st->codecpar->color_trc = AVCOL_TRC_GAMMA22; break; case 5: - st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM; + st->codecpar->color_trc = AVCOL_TRC_GAMMA28; + break; + case 6: + st->codecpar->color_trc = AVCOL_TRC_SMPTE170M; + break; + case 7: + st->codecpar->color_trc = AVCOL_TRC_SMPTE240M; + break; + case 8: + st->codecpar->color_trc = AVCOL_TRC_LINEAR; + break; + case 9: + st->codecpar->color_trc = AVCOL_TRC_LOG; + break; + case 10: + st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT; + break; + case 11: + st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4; + break; + case 12: + st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG; + break; + case 13: + st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1; + break; + case 14: + st->codecpar->color_trc = AVCOL_TRC_BT2020_10; + break; + case 15: + st->codecpar->color_trc = AVCOL_TRC_BT2020_12; + break; + case 16: + st->codecpar->color_trc = AVCOL_TRC_SMPTE2084; + break; + case 17: + st->codecpar->color_trc = AVCOL_TRC_SMPTE428; + break; + case 18: + st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67; break; default: + st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; + } + } + + /* Matrix coefficients */ + if(avs->flags & AVISYNTH_FRAMEPROP_MATRIX) { + if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) { + st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; + } else { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) { + case 0: + st->codecpar->color_space = AVCOL_SPC_RGB; + break; + case 1: + st->codecpar->color_space = AVCOL_SPC_BT709; + break; + case 2: + st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; + break; + case 4: + st->codecpar->color_space = AVCOL_SPC_FCC; + break; + case 5: + st->codecpar->color_space = AVCOL_SPC_BT470BG; + break; + case 6: + st->codecpar->color_space = AVCOL_SPC_SMPTE170M; + break; + case 7: + st->codecpar->color_space = AVCOL_SPC_SMPTE240M; + break; + case 8: + st->codecpar->color_space = AVCOL_SPC_YCGCO; + break; + case 9: + st->codecpar->color_space = AVCOL_SPC_BT2020_NCL; + break; + case 10: + st->codecpar->color_space = AVCOL_SPC_BT2020_CL; + break; + case 11: + st->codecpar->color_space = AVCOL_SPC_SMPTE2085; + break; + case 12: + st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL; + break; + case 13: + st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL; + break; + case 14: + st->codecpar->color_space = AVCOL_SPC_ICTCP; + break; + default: + st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED; + } + } + } + + /* Chroma Location */ + if(avs->flags & AVISYNTH_FRAMEPROP_CHROMA_LOCATION) { + if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) { st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED; + } else { + switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) { + case 0: + st->codecpar->chroma_location = AVCHROMA_LOC_LEFT; + break; + case 1: + st->codecpar->chroma_location = AVCHROMA_LOC_CENTER; + break; + case 2: + st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT; + break; + case 3: + st->codecpar->chroma_location = AVCHROMA_LOC_TOP; + break; + case 4: + st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT; + break; + case 5: + st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM; + break; + default: + st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED; + } } } + + /* Sample aspect ratio */ + if(avs->flags & AVISYNTH_FRAMEPROP_SAR) { + sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error); + sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error); + st->sample_aspect_ratio = (AVRational){ sar_num, sar_den }; + } + + avs_library.avs_release_video_frame(frame); } else { st->codecpar->field_order = AV_FIELD_UNKNOWN; /* AviSynth works with frame-based video, detecting field order can @@ -750,10 +787,10 @@ { AviSynthContext *avs = s->priv_data; - st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; - st->codecpar->sample_rate = avs->vi->audio_samples_per_second; - st->codecpar->ch_layout.nb_channels = avs->vi->nchannels; - st->duration = avs->vi->num_audio_samples; + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + st->codecpar->sample_rate = avs->vi->audio_samples_per_second; + st->codecpar->ch_layout.nb_channels = avs->vi->nchannels; + st->duration = avs->vi->num_audio_samples; avpriv_set_pts_info(st, 64, 1, avs->vi->audio_samples_per_second); switch (avs->vi->sample_type) { @@ -1131,6 +1168,29 @@ return 0; } +#define AVISYNTH_FRAMEPROP_DEFAULT AVISYNTH_FRAMEPROP_FIELD_ORDER | AVISYNTH_FRAMEPROP_RANGE | \ + AVISYNTH_FRAMEPROP_PRIMARIES | AVISYNTH_FRAMEPROP_TRANSFER | \ + AVISYNTH_FRAMEPROP_MATRIX | AVISYNTH_FRAMEPROP_CHROMA_LOCATION +#define OFFSET(x) offsetof(AviSynthContext, x) +static const AVOption avisynth_options[] = { + { "avisynth_flags", "set flags related to reading frame properties from script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVISYNTH_FRAMEPROP_DEFAULT}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "field_order", "read field order", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_FIELD_ORDER}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "range", "read color range", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_RANGE}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "primaries", "read color primaries", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_PRIMARIES}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "transfer", "read color transfer characteristics", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_TRANSFER}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "matrix", "read matrix coefficients", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_MATRIX}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "chroma_location", "read chroma location", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_CHROMA_LOCATION}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { "sar", "read sample aspect ratio", 0, AV_OPT_TYPE_CONST, {.i64 = AVISYNTH_FRAMEPROP_SAR}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, + { NULL }, +}; + +static const AVClass avisynth_demuxer_class = { + .class_name = "AviSynth demuxer", + .item_name = av_default_item_name, + .option = avisynth_options, + .version = LIBAVUTIL_VERSION_INT, +}; + const AVInputFormat ff_avisynth_demuxer = { .name = "avisynth", .long_name = NULL_IF_CONFIG_SMALL("AviSynth script"), @@ -1140,4 +1200,5 @@ .read_close = avisynth_read_close, .read_seek = avisynth_read_seek, .extensions = "avs", + .priv_class = &avisynth_demuxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bit.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bit.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bit.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bit.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavcodec/get_bits.h" #include "libavcodec/put_bits.h" @@ -158,13 +159,13 @@ return 0; } -const AVOutputFormat ff_bit_muxer = { - .name = "bit", - .long_name = NULL_IF_CONFIG_SMALL("G.729 BIT file format"), - .mime_type = "audio/bit", - .extensions = "bit", - .audio_codec = AV_CODEC_ID_G729, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_bit_muxer = { + .p.name = "bit", + .p.long_name = NULL_IF_CONFIG_SMALL("G.729 BIT file format"), + .p.mime_type = "audio/bit", + .p.extensions = "bit", + .p.audio_codec = AV_CODEC_ID_G729, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = write_header, .write_packet = write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bonk.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bonk.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bonk.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/bonk.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * Bonk demuxer + * Copyright (c) 2016 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/intreadwrite.h" +#include "avio_internal.h" +#include "avformat.h" +#include "demux.h" +#include "internal.h" +#include "id3v2.h" +#include "rawdec.h" + +static int bonk_probe(const AVProbeData *p) +{ + for (int i = 0; i < p->buf_size - 22; i++) { + if (!p->buf[i] && AV_RL32(p->buf + i + 1) == MKTAG('B','O','N','K')) { + if (p->buf[i + 5]) + return 0; + if (AV_RL32(p->buf + i + 6) == 0) + return 0; + if (AV_RL32(p->buf + i + 10) == 0) + return 0; + if (p->buf[i + 14] == 0) + return 0; + if (AV_RL16(p->buf + i + 17) == 0 || + AV_RL16(p->buf + i + 17) > 2048) + return 0; + if (p->buf[i + 19] == 0) + return 0; + if (AV_RL16(p->buf + i + 20) == 0) + return 0; + return AVPROBE_SCORE_MAX; + } + } + + return 0; +} + +static int bonk_read_header(AVFormatContext *s) +{ + ID3v2ExtraMeta *extra_meta; + AVStream *st; + int ret; + + while (!avio_feof(s->pb)) { + const int b = avio_r8(s->pb); + if (!b) { + uint32_t t; + int ret = ffio_ensure_seekback(s->pb, 3); + + if (ret < 0) + return ret; + + t = avio_rl32(s->pb); + if (t == MKTAG('B','O','N','K')) { + break; + } else if (t == MKTAG(' ','I','D','3')) { + avio_seek(s->pb, -3, SEEK_CUR); + ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &extra_meta, 0); + if (extra_meta) { + ff_id3v2_parse_apic(s, extra_meta); + ff_id3v2_parse_priv(s, extra_meta); + ff_id3v2_free_extra_meta(&extra_meta); + } + avio_skip(s->pb, 8); + } else { + return AVERROR_INVALIDDATA; + } + } + } + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + if ((ret = ff_get_extradata(s, st->codecpar, s->pb, 17)) < 0) + return ret; + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + st->codecpar->codec_id = AV_CODEC_ID_BONK; + st->codecpar->sample_rate = AV_RL32(st->codecpar->extradata + 5); + st->codecpar->ch_layout.nb_channels = st->codecpar->extradata[9]; + if (st->codecpar->ch_layout.nb_channels == 0) + return AVERROR_INVALIDDATA; + st->duration = AV_RL32(st->codecpar->extradata + 1) / st->codecpar->ch_layout.nb_channels; + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + + return 0; +} + +const AVInputFormat ff_bonk_demuxer = { + .name = "bonk", + .long_name = NULL_IF_CONFIG_SMALL("raw Bonk"), + .read_probe = bonk_probe, + .read_header = bonk_read_header, + .read_packet = ff_raw_read_partial_packet, + .extensions = "bonk", + .flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS, + .raw_codec_id = AV_CODEC_ID_BONK, + .priv_data_size = sizeof(FFRawDemuxerContext), + .priv_class = &ff_raw_demuxer_class, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cache.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cache.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cache.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cache.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,10 +29,10 @@ #include "libavutil/avassert.h" #include "libavutil/avstring.h" -#include "libavutil/internal.h" +#include "libavutil/file_open.h" #include "libavutil/opt.h" #include "libavutil/tree.h" -#include "avformat.h" +#include "avio.h" #include #if HAVE_IO_H #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cafenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cafenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cafenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cafenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -113,7 +113,7 @@ AVIOContext *pb = s->pb; AVCodecParameters *par = s->streams[0]->codecpar; CAFContext *caf = s->priv_data; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; unsigned int codec_tag = ff_codec_get_tag(ff_codec_caf_tags, par->codec_id); int64_t chunk_size = 0; int frame_size = par->frame_size, sample_rate = par->sample_rate; @@ -195,13 +195,13 @@ ff_standardize_creation_time(s); if (av_dict_count(s->metadata)) { ffio_wfourcc(pb, "info"); //< Information chunk - while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(s->metadata, t))) { chunk_size += strlen(t->key) + strlen(t->value) + 2; } avio_wb64(pb, chunk_size + 4); avio_wb32(pb, av_dict_count(s->metadata)); t = NULL; - while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(s->metadata, t))) { avio_put_str(pb, t->key); avio_put_str(pb, t->value); } @@ -276,16 +276,16 @@ return 0; } -const AVOutputFormat ff_caf_muxer = { - .name = "caf", - .long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"), - .mime_type = "audio/x-caf", - .extensions = "caf", +const FFOutputFormat ff_caf_muxer = { + .p.name = "caf", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"), + .p.mime_type = "audio/x-caf", + .p.extensions = "caf", .priv_data_size = sizeof(CAFContext), - .audio_codec = AV_CODEC_ID_PCM_S16BE, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S16BE, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = caf_write_header, .write_packet = caf_write_packet, .write_trailer = caf_write_trailer, - .codec_tag = ff_caf_codec_tags_list, + .p.codec_tag = ff_caf_codec_tags_list, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cdg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cdg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cdg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/cdg.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,22 @@ #define CDG_COMMAND 0x09 #define CDG_MASK 0x3F +static int read_probe(const AVProbeData *p) +{ + const int cnt = p->buf_size / CDG_PACKET_SIZE; + int score = 0; + + for (int i = 0; i < cnt; i++) { + const int x = p->buf[i * CDG_PACKET_SIZE] & CDG_MASK; + + score += x == CDG_COMMAND; + if (x != CDG_COMMAND && x != 0) + return 0; + } + + return FFMIN(score, AVPROBE_SCORE_MAX); +} + static int read_header(AVFormatContext *s) { AVStream *vst; @@ -70,6 +86,7 @@ const AVInputFormat ff_cdg_demuxer = { .name = "cdg", .long_name = NULL_IF_CONFIG_SMALL("CD Graphics"), + .read_probe = read_probe, .read_header = read_header, .read_packet = read_packet, .flags = AVFMT_GENERIC_INDEX, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/chromaprint.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/chromaprint.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/chromaprint.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/chromaprint.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/opt.h" #include @@ -176,15 +177,15 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_chromaprint_muxer = { - .name = "chromaprint", - .long_name = NULL_IF_CONFIG_SMALL("Chromaprint"), +const FFOutputFormat ff_chromaprint_muxer = { + .p.name = "chromaprint", + .p.long_name = NULL_IF_CONFIG_SMALL("Chromaprint"), .priv_data_size = sizeof(ChromaprintMuxContext), - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), .write_header = write_header, .write_packet = write_packet, .write_trailer = write_trailer, .deinit = deinit, - .flags = AVFMT_NOTIMESTAMPS, - .priv_class = &chromaprint_class, + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &chromaprint_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/codec2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/codec2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/codec2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/codec2.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include "avio_internal.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "pcm.h" @@ -309,16 +310,16 @@ #endif #if CONFIG_CODEC2_MUXER -const AVOutputFormat ff_codec2_muxer = { - .name = "codec2", - .long_name = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"), +const FFOutputFormat ff_codec2_muxer = { + .p.name = "codec2", + .p.long_name = NULL_IF_CONFIG_SMALL("codec2 .c2 muxer"), + .p.extensions = "c2", + .p.audio_codec = AV_CODEC_ID_CODEC2, + .p.video_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS, .priv_data_size = sizeof(Codec2Context), - .extensions = "c2", - .audio_codec = AV_CODEC_ID_CODEC2, - .video_codec = AV_CODEC_ID_NONE, .write_header = codec2_write_header, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/concatdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/concatdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/concatdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/concatdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/opt.h" #include "libavutil/parseutils.h" #include "libavutil/timestamp.h" +#include "libavcodec/codec_desc.h" #include "libavcodec/bsf.h" #include "avformat.h" #include "avio_internal.h" @@ -180,8 +181,9 @@ if (ret < 0) return ret; } - memcpy(st->codecpar->extradata, source_st->codecpar->extradata, - source_st->codecpar->extradata_size); + if (source_st->codecpar->extradata_size) + memcpy(st->codecpar->extradata, source_st->codecpar->extradata, + source_st->codecpar->extradata_size); return 0; } if ((ret = avcodec_parameters_copy(st->codecpar, source_st->codecpar)) < 0) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/crcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/crcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/crcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/crcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavutil/adler32.h" #include "avformat.h" +#include "mux.h" typedef struct CRCState { uint32_t crcval; @@ -54,14 +55,14 @@ return 0; } -const AVOutputFormat ff_crc_muxer = { - .name = "crc", - .long_name = NULL_IF_CONFIG_SMALL("CRC testing"), +const FFOutputFormat ff_crc_muxer = { + .p.name = "crc", + .p.long_name = NULL_IF_CONFIG_SMALL("CRC testing"), .priv_data_size = sizeof(CRCState), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = crc_init, .write_packet = crc_write_packet, .write_trailer = crc_write_trailer, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -961,15 +961,15 @@ int is_last_segment_number = !av_strcasecmp(scheme_id_uri, "http://dashif.org/guidelines/last-segment-number"); xmlFree(scheme_id_uri); if (is_last_segment_number) { - val = xmlGetProp(adaptionset_supplementalproperty_node,"value"); - if (!val) { - av_log(s, AV_LOG_ERROR, "Missing value attribute in adaptionset_supplementalproperty_node\n"); - } else { - rep->last_seq_no =(int64_t) strtoll(val, NULL, 10) - 1; - xmlFree(val); + val = xmlGetProp(adaptionset_supplementalproperty_node, "value"); + if (!val) { + av_log(s, AV_LOG_ERROR, "Missing value attribute in adaptionset_supplementalproperty_node\n"); + } else { + rep->last_seq_no = (int64_t)strtoll(val, NULL, 10) - 1; + xmlFree(val); + } } } - } } fragment_timeline_node = find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dashenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,6 +38,8 @@ #include "libavutil/time.h" #include "libavutil/time_internal.h" +#include "libavcodec/avcodec.h" + #include "av1.h" #include "avc.h" #include "avformat.h" @@ -177,6 +179,7 @@ int master_playlist_created; AVIOContext *mpd_out; AVIOContext *m3u8_out; + AVIOContext *http_delete; int streaming; int64_t timeout; int index_correction; @@ -336,7 +339,7 @@ static void set_vp9_codec_str(AVFormatContext *s, AVCodecParameters *par, AVRational *frame_rate, char *str, int size) { VPCC vpcc; - int ret = ff_isom_get_vpcc_features(s, par, frame_rate, &vpcc); + int ret = ff_isom_get_vpcc_features(s, par, NULL, 0, frame_rate, &vpcc); if (ret == 0) { av_strlcatf(str, size, "vp09.%02d.%02d.%02d", vpcc.profile, vpcc.level, vpcc.bitdepth); @@ -640,6 +643,7 @@ ff_format_io_close(s, &c->mpd_out); ff_format_io_close(s, &c->m3u8_out); + ff_format_io_close(s, &c->http_delete); } static void output_segment_list(OutputStream *os, AVIOContext *out, AVFormatContext *s, @@ -1547,7 +1551,11 @@ return AVERROR_MUXER_NOT_FOUND; ctx->interrupt_callback = s->interrupt_callback; ctx->opaque = s->opaque; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS ctx->io_close = s->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif ctx->io_close2 = s->io_close2; ctx->io_open = s->io_open; ctx->strict_std_compliance = s->strict_std_compliance; @@ -1853,18 +1861,18 @@ int http_base_proto = ff_is_http_proto(filename); if (http_base_proto) { - AVIOContext *out = NULL; AVDictionary *http_opts = NULL; set_http_options(&http_opts, c); av_dict_set(&http_opts, "method", "DELETE", 0); - if (dashenc_io_open(s, &out, filename, &http_opts) < 0) { + if (dashenc_io_open(s, &c->http_delete, filename, &http_opts) < 0) { av_log(s, AV_LOG_ERROR, "failed to delete %s\n", filename); } - av_dict_free(&http_opts); - ff_format_io_close(s, &out); + + //Nothing to write + dashenc_io_close(s, &c->http_delete, filename); } else { int res = ffurl_delete(filename); if (res < 0) { @@ -2342,10 +2350,10 @@ DASHContext *c = s->priv_data; OutputStream *os = &c->streams[st->index]; AVFormatContext *oc = os->ctx; - if (oc->oformat->check_bitstream) { + if (ffofmt(oc->oformat)->check_bitstream) { AVStream *const ost = oc->streams[0]; int ret; - ret = oc->oformat->check_bitstream(oc, ost, avpkt); + ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, avpkt); if (ret == 1) { FFStream *const sti = ffstream(st); FFStream *const osti = ffstream(ost); @@ -2415,19 +2423,19 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_dash_muxer = { - .name = "dash", - .long_name = NULL_IF_CONFIG_SMALL("DASH Muxer"), - .extensions = "mpd", +const FFOutputFormat ff_dash_muxer = { + .p.name = "dash", + .p.long_name = NULL_IF_CONFIG_SMALL("DASH Muxer"), + .p.extensions = "mpd", + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE, + .p.priv_class = &dash_class, .priv_data_size = sizeof(DASHContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, - .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE, .init = dash_init, .write_header = dash_write_header, .write_packet = dash_write_packet, .write_trailer = dash_write_trailer, .deinit = dash_free, .check_bitstream = dash_check_bitstream, - .priv_class = &dash_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/daudenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/daudenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/daudenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/daudenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "avformat.h" +#include "mux.h" static int daud_init(struct AVFormatContext *s) { @@ -42,13 +43,13 @@ return 0; } -const AVOutputFormat ff_daud_muxer = { - .name = "daud", - .long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio"), - .extensions = "302", - .audio_codec = AV_CODEC_ID_PCM_S24DAUD, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_daud_muxer = { + .p.name = "daud", + .p.long_name = NULL_IF_CONFIG_SMALL("D-Cinema audio"), + .p.extensions = "302", + .p.audio_codec = AV_CODEC_ID_PCM_S24DAUD, + .p.video_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS, .init = daud_init, .write_packet = daud_write_packet, - .flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/demux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/demux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/demux.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/demux.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,6 +34,7 @@ #include "libavutil/time.h" #include "libavutil/timestamp.h" +#include "libavcodec/avcodec.h" #include "libavcodec/bsf.h" #include "libavcodec/internal.h" #include "libavcodec/packet_internal.h" @@ -1983,7 +1984,7 @@ /* returns 1 or 0 if or if not decoded data was returned, or a negative error */ static int try_decode_frame(AVFormatContext *s, AVStream *st, - const AVPacket *avpkt, AVDictionary **options) + const AVPacket *pkt, AVDictionary **options) { FFStream *const sti = ffstream(st); AVCodecContext *const avctx = sti->avctx; @@ -1991,9 +1992,9 @@ int got_picture = 1, ret = 0; AVFrame *frame = av_frame_alloc(); AVSubtitle subtitle; - AVPacket pkt = *avpkt; int do_skip_frame = 0; enum AVDiscard skip_frame; + int pkt_to_send = pkt->size > 0; if (!frame) return AVERROR(ENOMEM); @@ -2042,7 +2043,7 @@ avctx->skip_frame = AVDISCARD_ALL; } - while ((pkt.size > 0 || (!pkt.data && got_picture)) && + while ((pkt_to_send || (!pkt->data && got_picture)) && ret >= 0 && (!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) || (!sti->codec_info_nb_frames && @@ -2050,11 +2051,11 @@ got_picture = 0; if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) { - ret = avcodec_send_packet(avctx, &pkt); + ret = avcodec_send_packet(avctx, pkt); if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) break; if (ret >= 0) - pkt.size = 0; + pkt_to_send = 0; ret = avcodec_receive_frame(avctx, frame); if (ret >= 0) got_picture = 1; @@ -2062,11 +2063,11 @@ ret = 0; } else if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { ret = avcodec_decode_subtitle2(avctx, &subtitle, - &got_picture, &pkt); + &got_picture, pkt); if (got_picture) avsubtitle_free(&subtitle); if (ret >= 0) - pkt.size = 0; + pkt_to_send = 0; } if (ret >= 0) { if (got_picture) @@ -2155,10 +2156,19 @@ * Old DivX and Xvid often have nonsense timebases like 1fps or 2fps. * MPEG-2 commonly misuses field repeat flags to store different framerates. * And there are "variable" fps files this needs to detect as well. */ -static int tb_unreliable(AVCodecContext *c) +static int tb_unreliable(AVFormatContext *ic, AVStream *st) { - if (c->time_base.den >= 101LL * c->time_base.num || - c->time_base.den < 5LL * c->time_base.num || + FFStream *const sti = ffstream(st); + AVCodecContext *c = sti->avctx; + AVRational time_base = c->framerate.num ? av_inv_q(av_mul_q(c->framerate, + (AVRational){c->ticks_per_frame, 1})) + /* NOHEADER check added to not break existing behavior */ + : (((ic->ctx_flags & AVFMTCTX_NOHEADER) || + st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) ? (AVRational){0, 1} + : st->time_base); + + if (time_base.den >= 101LL * time_base.num || + time_base.den < 5LL * time_base.num || // c->codec_tag == AV_RL32("DIVX") || // c->codec_tag == AV_RL32("XVID") || c->codec_tag == AV_RL32("mp4v") || @@ -2242,11 +2252,11 @@ // the check for tb_unreliable() is not completely correct, since this is not about handling // an unreliable/inexact time base, but a time base that is finer than necessary, as e.g. // ipmovie.c produces. - if (tb_unreliable(sti->avctx) && sti->info->duration_count > 15 && sti->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num && + if (tb_unreliable(ic, st) && sti->info->duration_count > 15 && sti->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num && sti->info->duration_gcd < INT64_MAX / st->time_base.num) av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->time_base.den, st->time_base.num * sti->info->duration_gcd, INT_MAX); if (sti->info->duration_count > 1 && !st->r_frame_rate.num - && tb_unreliable(sti->avctx)) { + && tb_unreliable(ic, st)) { int num = 0; double best_error = 0.01; AVRational ref_rate = st->r_frame_rate.num ? st->r_frame_rate : av_inv_q(st->time_base); @@ -2458,14 +2468,6 @@ FFStream *const sti = ffstream(st); AVCodecContext *const avctx = sti->avctx; - if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || - st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) { -/* if (!st->time_base.num) - st->time_base = */ - if (!avctx->time_base.num) - avctx->time_base = st->time_base; - } - /* check if the caller has overridden the codec id */ // only for the split stuff if (!sti->parser && !(ic->flags & AVFMT_FLAG_NOPARSE) && sti->request_probe <= 0) { @@ -2543,7 +2545,7 @@ * the correct fps. */ if (av_q2d(st->time_base) > 0.0005) fps_analyze_framecount *= 2; - if (!tb_unreliable(sti->avctx)) + if (!tb_unreliable(ic, st)) fps_analyze_framecount = 0; if (ic->fps_probe_size >= 0) fps_analyze_framecount = ic->fps_probe_size; @@ -2856,12 +2858,16 @@ av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, best_fps, 12 * 1001, INT_MAX); } - if (!st->r_frame_rate.num) { - if ( avctx->time_base.den * (int64_t) st->time_base.num - <= avctx->time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) { + AVRational time_base = avctx->framerate.num ? av_inv_q(av_mul_q(avctx->framerate, + (AVRational){avctx->ticks_per_frame, 1})) + /* NOHEADER check added to not break existing behavior */ + : ((ic->ctx_flags & AVFMTCTX_NOHEADER) ? (AVRational){0, 1} + : st->time_base); + if ( time_base.den * (int64_t) st->time_base.num + <= time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) { av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, - avctx->time_base.den, (int64_t)avctx->time_base.num * avctx->ticks_per_frame, INT_MAX); + time_base.den, (int64_t)time_base.num * avctx->ticks_per_frame, INT_MAX); } else { st->r_frame_rate.num = st->time_base.den; st->r_frame_rate.den = st->time_base.num; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dtshddec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dtshddec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dtshddec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dtshddec.c 2023-03-03 13:29:59.000000000 +0000 @@ -55,7 +55,7 @@ DTSHDDemuxContext *dtshd = s->priv_data; AVIOContext *pb = s->pb; uint64_t chunk_type, chunk_size; - int64_t duration, data_start; + int64_t duration, orig_nb_samples, data_start; AVStream *st; int ret; char *value; @@ -103,9 +103,12 @@ duration = avio_rb32(pb); // num_frames duration *= avio_rb16(pb); // samples_per_frames st->duration = duration; - avio_skip(pb, 5); + orig_nb_samples = avio_rb32(pb); + orig_nb_samples <<= 8; + orig_nb_samples |= avio_r8(pb); st->codecpar->ch_layout.nb_channels = ff_dca_count_chs_for_mask(avio_rb16(pb)); st->codecpar->initial_padding = avio_rb16(pb); + st->codecpar->trailing_padding = FFMAX(st->duration - orig_nb_samples - st->codecpar->initial_padding, 0); avio_skip(pb, chunk_size - 21); break; case FILEINFO: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dump.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dump.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dump.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dump.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,12 +30,13 @@ #include "libavutil/dovi_meta.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" -#include "libavutil/avstring.h" #include "libavutil/replaygain.h" #include "libavutil/spherical.h" #include "libavutil/stereo3d.h" #include "libavutil/timecode.h" +#include "libavcodec/avcodec.h" + #include "avformat.h" #include "internal.h" @@ -139,16 +140,14 @@ const AVDictionaryEntry *tag = NULL; av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent); - while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) + while ((tag = av_dict_iterate(m, tag))) if (strcmp("language", tag->key)) { const char *p = tag->value; av_log(ctx, AV_LOG_INFO, "%s %-16s: ", indent, tag->key); while (*p) { - char tmp[256]; size_t len = strcspn(p, "\x8\xa\xb\xc\xd"); - av_strlcpy(tmp, p, FFMIN(sizeof(tmp), len+1)); - av_log(ctx, AV_LOG_INFO, "%s", tmp); + av_log(ctx, AV_LOG_INFO, "%.*s", (int)(FFMIN(255, len)), p); p += len; if (*p == 0xd) av_log(ctx, AV_LOG_INFO, " "); if (*p == 0xa) av_log(ctx, AV_LOG_INFO, "\n%s %-16s: ", indent, ""); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,12 @@ * 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_components.h" + #include #include "avformat.h" +#include "demux.h" #include "internal.h" #include "libavcodec/dv_profile.h" #include "libavcodec/dv.h" @@ -40,8 +44,10 @@ #include "dv.h" #include "libavutil/avassert.h" +#if CONFIG_DV_DEMUXER + // Must be kept in sync with AVPacket -struct DVPacket { +typedef struct DVPacket { int64_t pts; uint8_t *data; int size; @@ -49,7 +55,10 @@ int flags; int64_t pos; int64_t duration; -}; + + int sample_rate; + int last_sample_rate; +} DVPacket; struct DVDemuxContext { const AVDVProfile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */ @@ -82,26 +91,26 @@ return result; } -static const uint8_t *dv_extract_pack(const uint8_t *frame, enum dv_pack_type t) +static const uint8_t *dv_extract_pack(const uint8_t *frame, enum DVPackType t) { int offs; int c; for (c = 0; c < 10; c++) { switch (t) { - case dv_audio_source: + case DV_AUDIO_SOURCE: if (c&1) offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000); else offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000); break; - case dv_audio_control: + case DV_AUDIO_CONTROL: if (c&1) offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000); else offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000); break; - case dv_video_control: + case DV_VIDEO_CONTROL: if (c&1) offs = (80 * 3 + 8 + c*12000); else offs = (80 * 5 + 48 + 5 + c*12000); break; - case dv_timecode: + case DV_TIMECODE: offs = (80*1 + 3 + 3); break; default: @@ -134,7 +143,7 @@ const uint8_t *as_pack; uint8_t *pcm, ipcm; - as_pack = dv_extract_pack(frame, dv_audio_source); + as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE); if (!as_pack) /* No audio ? */ return 0; @@ -232,9 +241,9 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) { const uint8_t *as_pack; - int freq, stype, smpls, quant, i, ach; + int freq, stype, smpls, quant, i, ach, sr; - as_pack = dv_extract_pack(frame, dv_audio_source); + as_pack = dv_extract_pack(frame, DV_AUDIO_SOURCE); if (!as_pack || !c->sys) { /* No audio ? */ c->ach = 0; return 0; @@ -250,6 +259,7 @@ "Unrecognized audio sample rate index (%d)\n", freq); return 0; } + sr = dv_audio_frequency[freq]; if (stype > 3) { av_log(c->fctx, AV_LOG_ERROR, "stype %d is invalid\n", stype); @@ -263,14 +273,22 @@ ach = 2; /* Dynamic handling of the audio streams in DV */ + c->ach = 0; for (i = 0; i < ach; i++) { if (!c->ast[i]) { c->ast[i] = avformat_new_stream(c->fctx, NULL); if (!c->ast[i]) - break; + return AVERROR(ENOMEM); + avpriv_set_pts_info(c->ast[i], 64, c->sys->time_base.num, c->sys->time_base.den); c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; c->ast[i]->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; + c->ast[i]->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + c->ast[i]->start_time = 0; + c->ast[i]->codecpar->bit_rate = 2 * sr * 16; + + c->ast[i]->codecpar->sample_rate = sr; + c->audio_pkt[i].last_sample_rate = sr; c->audio_pkt[i].size = 0; c->audio_pkt[i].data = c->audio_buf[i]; @@ -280,12 +298,10 @@ c->audio_pkt[i].duration = 0; c->audio_pkt[i].pos = -1; } - c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq]; - c->ast[i]->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; - c->ast[i]->codecpar->bit_rate = 2 * dv_audio_frequency[freq] * 16; - c->ast[i]->start_time = 0; + + c->audio_pkt[i].sample_rate = sr; } - c->ach = i; + c->ach = ach; return (c->sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */ } @@ -303,7 +319,7 @@ c->vst->avg_frame_rate = av_inv_q(c->vst->time_base); /* finding out SAR is a little bit messy */ - vsc_pack = dv_extract_pack(frame, dv_video_control); + vsc_pack = dv_extract_pack(frame, DV_VIDEO_CONTROL); apt = frame[4] & 0x07; is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07))); @@ -323,7 +339,7 @@ // is only relevant for NTSC systems. int prevent_df = c->sys->ltc_divisor == 25 || c->sys->ltc_divisor == 50; - tc_pack = dv_extract_pack(frame, dv_timecode); + tc_pack = dv_extract_pack(frame, DV_TIMECODE); if (!tc_pack) return 0; av_timecode_make_smpte_tc_string2(tc, av_inv_q(c->sys->time_base), AV_RB32(tc_pack + 1), prevent_df, 1); @@ -373,16 +389,26 @@ for (i = 0; i < c->ach; i++) { if (c->ast[i] && c->audio_pkt[i].size) { - pkt->size = c->audio_pkt[i].size; - pkt->data = c->audio_pkt[i].data; - pkt->stream_index = c->audio_pkt[i].stream_index; - pkt->flags = c->audio_pkt[i].flags; - pkt->pts = c->audio_pkt[i].pts; - pkt->duration = c->audio_pkt[i].duration; - pkt->pos = c->audio_pkt[i].pos; + DVPacket *dpkt = &c->audio_pkt[i]; + + pkt->size = dpkt->size; + pkt->data = dpkt->data; + pkt->stream_index = dpkt->stream_index; + pkt->flags = dpkt->flags; + pkt->pts = dpkt->pts; + pkt->duration = dpkt->duration; + pkt->pos = dpkt->pos; + + dpkt->size = 0; + size = pkt->size; + + if (dpkt->last_sample_rate != dpkt->sample_rate) { + int ret = ff_add_param_change(pkt, 0, 0, dpkt->sample_rate, 0, 0); + if (ret < 0) + return ret; + dpkt->last_sample_rate = dpkt->sample_rate; + } - c->audio_pkt[i].size = 0; - size = pkt->size; break; } } @@ -399,12 +425,15 @@ if (buf_size < DV_PROFILE_BYTES || !(c->sys = av_dv_frame_profile(c->sys, buf, buf_size)) || buf_size < c->sys->frame_size) { - return -1; /* Broken frame, or not enough data */ + return AVERROR_INVALIDDATA; } /* Queueing audio packet */ /* FIXME: in case of no audio/bad audio we have to do something */ size = dv_extract_audio_info(c, buf); + if (size < 0) + return size; + for (i = 0; i < c->ach; i++) { c->audio_pkt[i].pos = pos; c->audio_pkt[i].size = size; @@ -425,14 +454,17 @@ } } - /* Now it's time to return video packet */ - size = dv_extract_video_info(c, buf); - pkt->data = buf; - pkt->pos = pos; - pkt->size = size; - pkt->flags |= AV_PKT_FLAG_KEY; - pkt->stream_index = c->vst->index; - pkt->pts = c->frames; + /* return the video packet, if the caller wants it */ + if (pkt) { + size = dv_extract_video_info(c, buf); + + pkt->data = buf; + pkt->pos = pos; + pkt->size = size; + pkt->flags |= AV_PKT_FLAG_KEY; + pkt->stream_index = c->vst->index; + pkt->pts = c->frames; + } c->frames++; @@ -647,3 +679,21 @@ .read_seek = dv_read_seek, .extensions = "dv,dif", }; + +#else // CONFIG_DV_DEMUXER +DVDemuxContext *avpriv_dv_init_demux(AVFormatContext *s) +{ + return NULL; +} + +int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt) +{ + return AVERROR(ENOSYS); +} + +int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, + uint8_t *buf, int buf_size, int64_t pos) +{ + return AVERROR(ENOSYS); +} +#endif // CONFIG_DV_DEMUXER diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,7 +43,7 @@ #define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32-bit audio -struct DVMuxContext { +typedef struct DVMuxContext { AVClass *av_class; const AVDVProfile* sys; /* current DV profile, e.g.: 525/60, 625/50 */ int n_ast; /* number of stereo audio streams (up to 2) */ @@ -55,7 +55,7 @@ int has_video; /* frame under construction has video */ uint8_t frame_buf[DV_MAX_FRAME_SIZE]; /* frame under construction */ AVTimecode tc; /* timecode context */ -}; +} DVMuxContext; static const int dv_aaux_packs_dist[12][9] = { { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff }, @@ -94,7 +94,7 @@ sizeof(sys->audio_samples_dist[0]))]; } -static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq) +static int dv_write_pack(enum DVPackType pack_id, DVMuxContext *c, uint8_t* buf, int channel, int seq) { struct tm tc; time_t ct; @@ -103,12 +103,12 @@ buf[0] = (uint8_t)pack_id; switch (pack_id) { - case dv_timecode: + case DV_TIMECODE: timecode = av_timecode_get_smpte_from_framenum(&c->tc, c->frames); timecode |= 1<<23 | 1<<15 | 1<<7 | 1<<6; // biphase and binary group flags AV_WB32(buf + 1, timecode); break; - case dv_audio_source: /* AAUX source pack */ + case DV_AUDIO_SOURCE: /* AAUX source pack */ if (c->ast[channel]->codecpar->sample_rate == 44100) { audio_type = 1; } else if (c->ast[channel]->codecpar->sample_rate == 32000) @@ -132,7 +132,7 @@ 0; /* quantization: 0 -- 16-bit linear, 1 -- 12-bit nonlinear */ break; - case dv_audio_control: + case DV_AUDIO_CONTROL: buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */ (1 << 4) | /* input source: 1 -- digital input */ (3 << 2) | /* compression: 3 -- no information */ @@ -147,8 +147,8 @@ buf[4] = (1 << 7) | /* reserved -- always 1 */ 0x7f; /* genre category */ break; - case dv_audio_recdate: - case dv_video_recdate: /* VAUX recording date */ + case DV_AUDIO_RECDATE: + case DV_VIDEO_RECDATE: /* VAUX recording date */ ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num, c->sys->time_base.den, AV_ROUND_DOWN); brktimegm(ct, &tc); @@ -163,8 +163,8 @@ buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */ (tc.tm_year % 10); /* Units of year */ break; - case dv_audio_rectime: /* AAUX recording time */ - case dv_video_rectime: /* VAUX recording time */ + case DV_AUDIO_RECTIME: /* AAUX recording time */ + case DV_VIDEO_RECTIME: /* VAUX recording time */ ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num, c->sys->time_base.den, AV_ROUND_DOWN); brktimegm(ct, &tc); @@ -219,22 +219,22 @@ /* DV subcode: 2nd and 3d DIFs */ for (j = 80; j < 80 * 3; j += 80) { for (k = 6; k < 6 * 8; k += 8) - dv_write_pack(dv_timecode, c, &buf[j+k], 0, seq); + dv_write_pack(DV_TIMECODE, c, &buf[j+k], 0, seq); if (((long)(buf-frame)/(c->sys->frame_size/(c->sys->difseg_size*c->sys->n_difchan))%c->sys->difseg_size) > 5) { /* FIXME: is this really needed ? */ - dv_write_pack(dv_video_recdate, c, &buf[j+14], 0, seq); - dv_write_pack(dv_video_rectime, c, &buf[j+22], 0, seq); - dv_write_pack(dv_video_recdate, c, &buf[j+38], 0, seq); - dv_write_pack(dv_video_rectime, c, &buf[j+46], 0, seq); + dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+14], 0, seq); + dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+22], 0, seq); + dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+38], 0, seq); + dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+46], 0, seq); } } /* DV VAUX: 4th, 5th and 6th 3DIFs */ for (j = 80*3 + 3; j < 80*6; j += 80) { - dv_write_pack(dv_video_recdate, c, &buf[j+5* 2], 0, seq); - dv_write_pack(dv_video_rectime, c, &buf[j+5* 3], 0, seq); - dv_write_pack(dv_video_recdate, c, &buf[j+5*11], 0, seq); - dv_write_pack(dv_video_rectime, c, &buf[j+5*12], 0, seq); + dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5* 2], 0, seq); + dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5* 3], 0, seq); + dv_write_pack(DV_VIDEO_RECDATE, c, &buf[j+5*11], 0, seq); + dv_write_pack(DV_VIDEO_RECTIME, c, &buf[j+5*12], 0, seq); } } } @@ -442,13 +442,13 @@ av_fifo_freep2(&c->audio_data[i]); } -const AVOutputFormat ff_dv_muxer = { - .name = "dv", - .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), - .extensions = "dv", +const FFOutputFormat ff_dv_muxer = { + .p.name = "dv", + .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + .p.extensions = "dv", .priv_data_size = sizeof(DVMuxContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_DVVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_DVVIDEO, .write_header = dv_write_header, .write_packet = dv_write_packet, .deinit = dv_deinit, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/dv.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * General DV muxer/demuxer + * General DV demuxer * Copyright (c) 2003 Roman Shaposhnik * * Many thanks to Dan Dennedy for providing wealth @@ -36,6 +36,4 @@ int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int, int64_t); void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset); -typedef struct DVMuxContext DVMuxContext; - #endif /* AVFORMAT_DV_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/electronicarts.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/electronicarts.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/electronicarts.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/electronicarts.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include #include "libavutil/intreadwrite.h" +#include "libavutil/opt.h" #include "avformat.h" #include "internal.h" @@ -75,6 +76,8 @@ } VideoProperties; typedef struct EaDemuxContext { + const AVClass *class; + int big_endian; VideoProperties video, alpha; @@ -88,6 +91,7 @@ int num_samples; int platform; + int merge_alpha; } EaDemuxContext; static uint32_t read_arbitrary(AVIOContext *pb) @@ -442,6 +446,10 @@ case AVhd_TAG: err = process_video_header_vp6(s, &ea->alpha); + if (err >= 0 && ea->video.codec == AV_CODEC_ID_VP6 && ea->merge_alpha) { + ea->alpha.codec = 0; + ea->video.codec = AV_CODEC_ID_VP6A; + } break; } @@ -578,13 +586,13 @@ int partial_packet = 0; int hit_end = 0; unsigned int chunk_type, chunk_size; - int ret = 0, packet_read = 0, key = 0; + int ret = 0, packet_read = 0, key = 0, vp6a; int av_uninit(num_samples); while ((!packet_read && !hit_end) || partial_packet) { + chunk_type = avio_rl32(pb); if (avio_feof(pb)) return AVERROR_EOF; - chunk_type = avio_rl32(pb); chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb); if (chunk_size < 8) return AVERROR_INVALIDDATA; @@ -721,23 +729,32 @@ get_video_packet: if (!chunk_size) continue; + if (chunk_size > INT_MAX - 3) + return AVERROR_INVALIDDATA; + + vp6a = (ea->video.codec == AV_CODEC_ID_VP6A && (chunk_type == MV0F_TAG || chunk_type == MV0K_TAG)); if (partial_packet) { ret = av_append_packet(pb, pkt, chunk_size); - } else - ret = av_get_packet(pb, pkt, chunk_size); + } else { + if (vp6a) + avio_seek(pb, -3, SEEK_CUR); + ret = av_get_packet(pb, pkt, chunk_size + (vp6a ? 3 : 0)); + if (ret >= 0 && vp6a) + AV_WB24(pkt->data, chunk_size); + } + packet_read = 1; + if (ret < 0) { - packet_read = 1; partial_packet = 0; break; } - partial_packet = chunk_type == MVIh_TAG; - if (chunk_type == AV0K_TAG || chunk_type == AV0F_TAG) + partial_packet = vp6a || chunk_type == MVIh_TAG; + if (ea->alpha.codec && (chunk_type == AV0K_TAG || chunk_type == AV0F_TAG)) pkt->stream_index = ea->alpha.stream_index; else pkt->stream_index = ea->video.stream_index; pkt->flags |= key; - packet_read = 1; break; default: @@ -752,6 +769,20 @@ return ret; } +#define OFFSET(x) offsetof(EaDemuxContext, x) +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption options[] = { + {"merge_alpha", "return VP6 alpha in the main video stream", OFFSET(merge_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS }, + {NULL} +}; + +static const AVClass ea_class = { + .class_name = "ea demuxer", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + const AVInputFormat ff_ea_demuxer = { .name = "ea", .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia"), @@ -759,4 +790,5 @@ .read_probe = ea_probe, .read_header = ea_read_header, .read_packet = ea_read_packet, + .priv_class = &ea_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ffmetaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ffmetaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ffmetaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ffmetaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avformat.h" #include "ffmeta.h" +#include "mux.h" #include "libavutil/dict.h" @@ -40,8 +41,8 @@ static void write_tags(AVIOContext *s, AVDictionary *m) { - AVDictionaryEntry *t = NULL; - while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) { + const AVDictionaryEntry *t = NULL; + while ((t = av_dict_iterate(m, t))) { write_escape_str(s, t->key); avio_w8(s, '='); write_escape_str(s, t->value); @@ -87,12 +88,12 @@ return 0; } -const AVOutputFormat ff_ffmetadata_muxer = { - .name = "ffmetadata", - .long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"), - .extensions = "ffmeta", +const FFOutputFormat ff_ffmetadata_muxer = { + .p.name = "ffmetadata", + .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg metadata in text"), + .p.extensions = "ffmeta", .write_header = write_header, .write_packet = write_packet, .write_trailer = write_trailer, - .flags = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS, + .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NOSTREAMS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo.c 2023-03-03 13:29:59.000000000 +0000 @@ -148,8 +148,8 @@ // Check for options unrecognized by underlying muxer if (format_options) { - AVDictionaryEntry *entry = NULL; - while ((entry = av_dict_get(format_options, "", entry, AV_DICT_IGNORE_SUFFIX))) + const AVDictionaryEntry *entry = NULL; + while ((entry = av_dict_iterate(format_options, entry))) av_log(avf2, AV_LOG_ERROR, "Unknown option '%s'\n", entry->key); ret = AVERROR(EINVAL); } @@ -432,6 +432,8 @@ fifo_thread_ctx.avf = avf; fifo_thread_ctx.last_received_dts = AV_NOPTS_VALUE; + ff_thread_setname("fifo-consumer"); + while (1) { uint8_t just_flushed = 0; @@ -499,19 +501,19 @@ if (ret < 0) return ret; avf2->opaque = avf->opaque; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS avf2->io_close = avf->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif avf2->io_close2 = avf->io_close2; avf2->io_open = avf->io_open; avf2->flags = avf->flags; for (i = 0; i < avf->nb_streams; ++i) { - AVStream *st = avformat_new_stream(avf2, NULL); + AVStream *st = ff_stream_clone(avf2, avf->streams[i]); if (!st) return AVERROR(ENOMEM); - - ret = ff_stream_encode_params_copy(st, avf->streams[i]); - if (ret < 0) - return ret; } return 0; @@ -709,15 +711,15 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_fifo_muxer = { - .name = "fifo", - .long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"), +const FFOutputFormat ff_fifo_muxer = { + .p.name = "fifo", + .p.long_name = NULL_IF_CONFIG_SMALL("FIFO queue pseudo-muxer"), + .p.priv_class = &fifo_muxer_class, + .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .priv_data_size = sizeof(FifoContext), .init = fifo_init, .write_header = fifo_write_header, .write_packet = fifo_write_packet, .write_trailer = fifo_write_trailer, .deinit = fifo_deinit, - .priv_class = &fifo_muxer_class, - .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo_test.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo_test.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo_test.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fifo_test.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavutil/time.h" #include "avformat.h" +#include "mux.h" #include "url.h" /* Implementation of mock muxer to simulate real muxer failures */ @@ -137,15 +138,15 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_fifo_test_muxer = { - .name = "fifo_test", - .long_name = NULL_IF_CONFIG_SMALL("Fifo test muxer"), +const FFOutputFormat ff_fifo_test_muxer = { + .p.name = "fifo_test", + .p.long_name = NULL_IF_CONFIG_SMALL("Fifo test muxer"), .priv_data_size = sizeof(FailingMuxerContext), .write_header = failing_write_header, .write_packet = failing_write_packet, .write_trailer = failing_write_trailer, .deinit = failing_deinit, - .priv_class = &failing_muxer_class, - .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH, + .p.priv_class = &failing_muxer_class, + .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/file.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/file.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/file.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/file.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,9 +22,10 @@ #include "config_components.h" #include "libavutil/avstring.h" +#include "libavutil/file_open.h" #include "libavutil/internal.h" #include "libavutil/opt.h" -#include "avformat.h" +#include "avio.h" #if HAVE_DIRENT_H #include #endif @@ -67,6 +68,24 @@ # endif #endif +/* S_ISREG not available on Windows */ +#ifndef S_ISREG +# ifdef S_IFREG +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# else +# define S_ISREG(m) 0 +# endif +#endif + +/* S_ISBLK not available on Windows */ +#ifndef S_ISBLK +# ifdef S_IFBLK +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(m) 0 +# endif +#endif + /* standard file protocol */ typedef struct FileContext { @@ -91,6 +110,7 @@ static const AVOption pipe_options[] = { { "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, + { "fd", "set file descriptor", offsetof(FileContext, fd), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { NULL } }; @@ -108,6 +128,13 @@ .version = LIBAVUTIL_VERSION_INT, }; +static const AVClass fd_class = { + .class_name = "fd", + .item_name = av_default_item_name, + .option = pipe_options, + .version = LIBAVUTIL_VERSION_INT, +}; + static int file_read(URLContext *h, unsigned char *buf, int size) { FileContext *c = h->priv_data; @@ -165,6 +192,53 @@ return ret; } +static int fd_dup(URLContext *h, int oldfd) +{ + int newfd; + +#ifdef F_DUPFD_CLOEXEC + newfd = fcntl(oldfd, F_DUPFD_CLOEXEC, 0); +#else + newfd = dup(oldfd); +#endif + if (newfd == -1) + return newfd; + +#if HAVE_FCNTL + if (fcntl(newfd, F_SETFD, FD_CLOEXEC) == -1) + av_log(h, AV_LOG_DEBUG, "Failed to set close on exec\n"); +#endif + +#if HAVE_SETMODE + setmode(newfd, O_BINARY); +#endif + return newfd; +} + +static int file_close(URLContext *h) +{ + FileContext *c = h->priv_data; + int ret = close(c->fd); + return (ret == -1) ? AVERROR(errno) : 0; +} + +/* XXX: use llseek */ +static int64_t file_seek(URLContext *h, int64_t pos, int whence) +{ + FileContext *c = h->priv_data; + int64_t ret; + + if (whence == AVSEEK_SIZE) { + struct stat st; + ret = fstat(c->fd, &st); + return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : st.st_size); + } + + ret = lseek(c->fd, pos, whence); + + return ret < 0 ? AVERROR(errno) : ret; +} + #if CONFIG_FILE_PROTOCOL static int file_delete(URLContext *h) @@ -244,30 +318,6 @@ return 0; } -/* XXX: use llseek */ -static int64_t file_seek(URLContext *h, int64_t pos, int whence) -{ - FileContext *c = h->priv_data; - int64_t ret; - - if (whence == AVSEEK_SIZE) { - struct stat st; - ret = fstat(c->fd, &st); - return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : st.st_size); - } - - ret = lseek(c->fd, pos, whence); - - return ret < 0 ? AVERROR(errno) : ret; -} - -static int file_close(URLContext *h) -{ - FileContext *c = h->priv_data; - int ret = close(c->fd); - return (ret == -1) ? AVERROR(errno) : 0; -} - static int file_open_dir(URLContext *h) { #if HAVE_LSTAT @@ -380,20 +430,24 @@ FileContext *c = h->priv_data; int fd; char *final; - av_strstart(filename, "pipe:", &filename); - fd = strtol(filename, &final, 10); - if((filename == final) || *final ) {/* No digits found, or something like 10ab */ - if (flags & AVIO_FLAG_WRITE) { - fd = 1; - } else { - fd = 0; + if (c->fd < 0) { + av_strstart(filename, "pipe:", &filename); + + fd = strtol(filename, &final, 10); + if((filename == final) || *final ) {/* No digits found, or something like 10ab */ + if (flags & AVIO_FLAG_WRITE) { + fd = 1; + } else { + fd = 0; + } } + c->fd = fd; } -#if HAVE_SETMODE - setmode(fd, O_BINARY); -#endif - c->fd = fd; + + c->fd = fd_dup(h, c->fd); + if (c->fd == -1) + return AVERROR(errno); h->is_streamed = 1; return 0; } @@ -403,6 +457,7 @@ .url_open = pipe_open, .url_read = file_read, .url_write = file_write, + .url_close = file_close, .url_get_file_handle = file_get_handle, .url_check = file_check, .priv_data_size = sizeof(FileContext), @@ -411,3 +466,49 @@ }; #endif /* CONFIG_PIPE_PROTOCOL */ + +#if CONFIG_FD_PROTOCOL + +static int fd_open(URLContext *h, const char *filename, int flags) +{ + FileContext *c = h->priv_data; + struct stat st; + + if (strcmp(filename, "fd:") != 0) { + av_log(h, AV_LOG_ERROR, "Doesn't support pass file descriptor via URL," + " please set it via -fd {num}\n"); + return AVERROR(EINVAL); + } + + if (c->fd < 0) { + if (flags & AVIO_FLAG_WRITE) { + c->fd = 1; + } else { + c->fd = 0; + } + } + if (fstat(c->fd, &st) < 0) + return AVERROR(errno); + h->is_streamed = !(S_ISREG(st.st_mode) || S_ISBLK(st.st_mode)); + c->fd = fd_dup(h, c->fd); + if (c->fd == -1) + return AVERROR(errno); + + return 0; +} + +const URLProtocol ff_fd_protocol = { + .name = "fd", + .url_open = fd_open, + .url_read = file_read, + .url_write = file_write, + .url_seek = file_seek, + .url_close = file_close, + .url_get_file_handle = file_get_handle, + .url_check = file_check, + .priv_data_size = sizeof(FileContext), + .priv_data_class = &fd_class, + .default_whitelist = "crypto,data" +}; + +#endif /* CONFIG_FD_PROTOCOL */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/filmstripenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/filmstripenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/filmstripenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/filmstripenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "avio_internal.h" +#include "mux.h" #include "rawenc.h" #define RAND_TAG MKBETAG('R','a','n','d') @@ -59,12 +60,12 @@ return 0; } -const AVOutputFormat ff_filmstrip_muxer = { - .name = "filmstrip", - .long_name = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"), - .extensions = "flm", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, +const FFOutputFormat ff_filmstrip_muxer = { + .p.name = "filmstrip", + .p.long_name = NULL_IF_CONFIG_SMALL("Adobe Filmstrip"), + .p.extensions = "flm", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = write_header, .write_packet = ff_raw_write_packet, .write_trailer = write_trailer, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fitsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fitsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fitsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/fitsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "avio_internal.h" #include "internal.h" +#include "mux.h" typedef struct FITSContext { int first_image; @@ -191,13 +192,13 @@ return 0; } -const AVOutputFormat ff_fits_muxer = { - .name = "fits", - .long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), - .extensions = "fits", +const FFOutputFormat ff_fits_muxer = { + .p.name = "fits", + .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), + .p.extensions = "fits", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_FITS, .priv_data_size = sizeof(FITSContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_FITS, .write_header = fits_write_header, .write_packet = fits_write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,8 @@ */ #include "libavutil/channel_layout.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/bytestream.h" #include "libavcodec/flac.h" #include "avformat.h" #include "demux.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flacenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "flacenc.h" #include "id3v2.h" #include "internal.h" +#include "mux.h" #include "version.h" #include "vorbiscomment.h" @@ -413,19 +414,19 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_flac_muxer = { - .name = "flac", - .long_name = NULL_IF_CONFIG_SMALL("raw FLAC"), +const FFOutputFormat ff_flac_muxer = { + .p.name = "flac", + .p.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"), .priv_data_size = sizeof(FlacMuxerContext), - .mime_type = "audio/x-flac", - .extensions = "flac", - .audio_codec = AV_CODEC_ID_FLAC, - .video_codec = AV_CODEC_ID_PNG, + .p.mime_type = "audio/x-flac", + .p.extensions = "flac", + .p.audio_codec = AV_CODEC_ID_FLAC, + .p.video_codec = AV_CODEC_ID_PNG, .init = flac_init, .write_header = flac_write_header, .write_packet = flac_write_packet, .write_trailer = flac_write_trailer, .deinit = flac_deinit, - .flags = AVFMT_NOTIMESTAMPS, - .priv_class = &flac_muxer_class, + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &flac_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/dict.h" +#include "libavutil/dict_internal.h" #include "libavutil/opt.h" #include "libavutil/internal.h" #include "libavutil/intfloat.h" @@ -146,9 +147,9 @@ if (ffstream(stream)->nb_index_entries == 0) { for (i = 0; i < flv->keyframe_count; i++) { av_log(s, AV_LOG_TRACE, "keyframe filepositions = %"PRId64" times = %"PRId64"\n", - flv->keyframe_filepositions[i], flv->keyframe_times[i] * 1000); + flv->keyframe_filepositions[i], flv->keyframe_times[i]); av_add_index_entry(stream, flv->keyframe_filepositions[i], - flv->keyframe_times[i] * 1000, 0, 0, AVINDEX_KEYFRAME); + flv->keyframe_times[i], 0, 0, AVINDEX_KEYFRAME); } } else av_log(s, AV_LOG_WARNING, "Skipping duplicate index\n"); @@ -428,6 +429,7 @@ amf_get_string(ioc, str_val, sizeof(str_val)) > 0) { int64_t **current_array; unsigned int arraylen; + int factor; // Expect array object in context if (avio_r8(ioc) != AMF_DATA_TYPE_ARRAY) @@ -440,10 +442,12 @@ if (!strcmp(KEYFRAMES_TIMESTAMP_TAG , str_val) && !times) { current_array = × timeslen = arraylen; + factor = 1000; } else if (!strcmp(KEYFRAMES_BYTEOFFSET_TAG, str_val) && !filepositions) { current_array = &filepositions; fileposlen = arraylen; + factor = 1; } else // unexpected metatag inside keyframes, will not use such // metadata for indexing @@ -458,11 +462,9 @@ double d; if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER) goto invalid; - d = av_int2double(avio_rb64(ioc)); + d = av_int2double(avio_rb64(ioc)) * factor; if (isnan(d) || d < INT64_MIN || d > INT64_MAX) goto invalid; - if (current_array == × && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000)) - goto invalid; if (avio_feof(ioc)) goto invalid; current_array[0][i] = d; @@ -478,7 +480,7 @@ if (timeslen == fileposlen && fileposlen>1 && max_pos <= filepositions[0]) { for (i = 0; i < FFMIN(2,fileposlen); i++) { flv->validate_index[i].pos = filepositions[i]; - flv->validate_index[i].dts = times[i] * 1000; + flv->validate_index[i].dts = times[i]; flv->validate_count = i + 1; } flv->keyframe_times = times; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/flvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "libavutil/intfloat.h" #include "libavutil/avassert.h" #include "libavutil/mathematics.h" +#include "libavcodec/codec_desc.h" #include "libavcodec/mpeg4audio.h" #include "avio.h" #include "avc.h" @@ -104,7 +105,6 @@ int64_t lastkeyframelocation_offset; int64_t lastkeyframelocation; - int acurframeindex; int64_t keyframes_info_offset; int64_t filepositions_count; @@ -235,13 +235,16 @@ avio_w8(pb, (ts >> 24) & 0x7F); } -static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) +static void put_eos_tag(AVIOContext *pb, unsigned ts, enum AVCodecID codec_id) { + uint32_t tag = ff_codec_get_tag(flv_video_codec_ids, codec_id); + /* ub[4] FrameType = 1, ub[4] CodecId */ + tag |= 1 << 4; avio_w8(pb, FLV_TAG_TYPE_VIDEO); avio_wb24(pb, 5); /* Tag Data Size */ put_timestamp(pb, ts); avio_wb24(pb, 0); /* StreamId = 0 */ - avio_w8(pb, 23); /* ub[4] FrameType = 1, ub[4] CodecId = 7 */ + avio_w8(pb, tag); avio_w8(pb, 2); /* AVC end of sequence */ avio_wb24(pb, 0); /* Always 0 for AVC EOS. */ avio_wb32(pb, 16); /* Size of FLV tag */ @@ -277,7 +280,7 @@ int write_duration_filesize = !(flv->flags & FLV_NO_DURATION_FILESIZE); int metadata_count = 0; int64_t metadata_count_pos; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; /* write meta_tag */ avio_w8(pb, FLV_TAG_TYPE_META); // tag type META @@ -353,7 +356,7 @@ } ff_standardize_creation_time(s); - while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(s->metadata, tag))) { if( !strcmp(tag->key, "width") ||!strcmp(tag->key, "height") ||!strcmp(tag->key, "videodatarate") @@ -391,7 +394,6 @@ } if (flv->flags & FLV_ADD_KEYFRAME_INDEX) { - flv->acurframeindex = 0; flv->keyframe_index_size = 0; put_amf_string(pb, "hasVideo"); @@ -784,7 +786,7 @@ FLVStreamContext *sc = s->streams[i]->priv_data; if (par->codec_type == AVMEDIA_TYPE_VIDEO && (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4)) - put_avc_eos_tag(pb, sc->last_ts); + put_eos_tag(pb, sc->last_ts, par->codec_id); } } @@ -993,15 +995,11 @@ switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: flv->videosize += (avio_tell(pb) - cur_offset); - flv->lasttimestamp = flv->acurframeindex / flv->framerate; - flv->acurframeindex++; + flv->lasttimestamp = pkt->dts / 1000.0; if (pkt->flags & AV_PKT_FLAG_KEY) { - double ts = flv->lasttimestamp; - int64_t pos = cur_offset; - - flv->lastkeyframetimestamp = ts; - flv->lastkeyframelocation = pos; - ret = flv_append_keyframe_info(s, flv, ts, pos); + flv->lastkeyframetimestamp = flv->lasttimestamp; + flv->lastkeyframelocation = cur_offset; + ret = flv_append_keyframe_info(s, flv, flv->lasttimestamp, cur_offset); if (ret < 0) goto fail; } @@ -1065,24 +1063,24 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_flv_muxer = { - .name = "flv", - .long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"), - .mime_type = "video/x-flv", - .extensions = "flv", +const FFOutputFormat ff_flv_muxer = { + .p.name = "flv", + .p.long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"), + .p.mime_type = "video/x-flv", + .p.extensions = "flv", .priv_data_size = sizeof(FLVContext), - .audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF, - .video_codec = AV_CODEC_ID_FLV1, + .p.audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF, + .p.video_codec = AV_CODEC_ID_FLV1, .init = flv_init, .write_header = flv_write_header, .write_packet = flv_write_packet, .write_trailer = flv_write_trailer, .deinit = flv_deinit, .check_bitstream= flv_check_bitstream, - .codec_tag = (const AVCodecTag* const []) { + .p.codec_tag = (const AVCodecTag* const []) { flv_video_codec_ids, flv_audio_codec_ids, 0 }, - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, - .priv_class = &flv_muxer_class, + .p.priv_class = &flv_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/format.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/format.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/format.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/format.c 2023-03-03 13:29:59.000000000 +0000 @@ -111,8 +111,6 @@ return fmt->audio_codec; else if (type == AVMEDIA_TYPE_SUBTITLE) return fmt->subtitle_codec; - else if (type == AVMEDIA_TYPE_DATA) - return fmt->data_codec; else return AV_CODEC_ID_NONE; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/framecrcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/framecrcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/framecrcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/framecrcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" static int framecrc_write_header(struct AVFormatContext *s) { @@ -69,13 +70,13 @@ return 0; } -const AVOutputFormat ff_framecrc_muxer = { - .name = "framecrc", - .long_name = NULL_IF_CONFIG_SMALL("framecrc testing"), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, +const FFOutputFormat ff_framecrc_muxer = { + .p.name = "framecrc", + .p.long_name = NULL_IF_CONFIG_SMALL("framecrc testing"), + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = framecrc_write_header, .write_packet = framecrc_write_packet, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gif.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gif.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gif.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gif.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/imgutils.h" #include "libavutil/log.h" #include "libavutil/opt.h" @@ -202,17 +203,17 @@ .option = options, }; -const AVOutputFormat ff_gif_muxer = { - .name = "gif", - .long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"), - .mime_type = "image/gif", - .extensions = "gif", +const FFOutputFormat ff_gif_muxer = { + .p.name = "gif", + .p.long_name = NULL_IF_CONFIG_SMALL("CompuServe Graphics Interchange Format (GIF)"), + .p.mime_type = "image/gif", + .p.extensions = "gif", .priv_data_size = sizeof(GIFContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_GIF, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_GIF, .write_header = gif_write_header, .write_packet = gif_write_packet, .write_trailer = gif_write_trailer, - .priv_class = &gif_muxer_class, - .flags = AVFMT_VARIABLE_FPS, + .p.priv_class = &gif_muxer_class, + .p.flags = AVFMT_VARIABLE_FPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gxfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gxfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gxfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/gxfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -1009,13 +1009,13 @@ return ff_interleave_packet_per_dts(s, pkt, flush, 0); } -const AVOutputFormat ff_gxf_muxer = { - .name = "gxf", - .long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"), - .extensions = "gxf", +const FFOutputFormat ff_gxf_muxer = { + .p.name = "gxf", + .p.long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"), + .p.extensions = "gxf", .priv_data_size = sizeof(GXFContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .write_header = gxf_write_header, .write_packet = gxf_write_packet, .write_trailer = gxf_write_trailer, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hashenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hashenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hashenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hashenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "libavutil/opt.h" #include "avformat.h" #include "internal.h" +#include "mux.h" struct HashContext { const AVClass *avclass; @@ -172,19 +173,19 @@ } #if CONFIG_HASH_MUXER -const AVOutputFormat ff_hash_muxer = { - .name = "hash", - .long_name = NULL_IF_CONFIG_SMALL("Hash testing"), +const FFOutputFormat ff_hash_muxer = { + .p.name = "hash", + .p.long_name = NULL_IF_CONFIG_SMALL("Hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = hash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &hash_streamhashenc_class, + .p.priv_class = &hash_streamhashenc_class, }; #endif @@ -196,36 +197,36 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_md5_muxer = { - .name = "md5", - .long_name = NULL_IF_CONFIG_SMALL("MD5 testing"), +const FFOutputFormat ff_md5_muxer = { + .p.name = "md5", + .p.long_name = NULL_IF_CONFIG_SMALL("MD5 testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = hash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &md5enc_class, + .p.priv_class = &md5enc_class, }; #endif #if CONFIG_STREAMHASH_MUXER -const AVOutputFormat ff_streamhash_muxer = { - .name = "streamhash", - .long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"), +const FFOutputFormat ff_streamhash_muxer = { + .p.name = "streamhash", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-stream hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = streamhash_init, .write_packet = hash_write_packet, .write_trailer = hash_write_trailer, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &hash_streamhashenc_class, + .p.priv_class = &hash_streamhashenc_class, }; #endif @@ -324,19 +325,19 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_framehash_muxer = { - .name = "framehash", - .long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"), +const FFOutputFormat ff_framehash_muxer = { + .p.name = "framehash", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame hash testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = framehash_init, .write_header = framehash_write_header, .write_packet = framehash_write_packet, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &framehash_class, + .p.priv_class = &framehash_class, }; #endif @@ -348,18 +349,18 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_framemd5_muxer = { - .name = "framemd5", - .long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"), +const FFOutputFormat ff_framemd5_muxer = { + .p.name = "framemd5", + .p.long_name = NULL_IF_CONFIG_SMALL("Per-frame MD5 testing"), .priv_data_size = sizeof(struct HashContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .init = framehash_init, .write_header = framehash_write_header, .write_packet = framehash_write_packet, .deinit = hash_free, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_TS_NEGATIVE, - .priv_class = &framemd5_class, + .p.priv_class = &framemd5_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hdsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hdsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hdsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hdsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -564,16 +564,16 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_hds_muxer = { - .name = "hds", - .long_name = NULL_IF_CONFIG_SMALL("HDS Muxer"), +const FFOutputFormat ff_hds_muxer = { + .p.name = "hds", + .p.long_name = NULL_IF_CONFIG_SMALL("HDS Muxer"), + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE, + .p.priv_class = &hds_class, .priv_data_size = sizeof(HDSContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, - .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE, .write_header = hds_write_header, .write_packet = hds_write_packet, .write_trailer = hds_write_trailer, .deinit = hds_free, - .priv_class = &hds_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hevc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hevc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hevc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hevc.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,15 @@ #define MAX_SPATIAL_SEGMENTATION 4096 // max. value of u(12) field +enum { + VPS_INDEX, + SPS_INDEX, + PPS_INDEX, + SEI_PREFIX_INDEX, + SEI_SUFFIX_INDEX, + NB_ARRAYS +}; + typedef struct HVCCNALUnitArray { uint8_t array_completeness; uint8_t NAL_unit_type; @@ -56,7 +65,7 @@ uint8_t temporalIdNested; uint8_t lengthSizeMinusOne; uint8_t numOfArrays; - HVCCNALUnitArray *array; + HVCCNALUnitArray arrays[NB_ARRAYS]; } HEVCDecoderConfigurationRecord; typedef struct HVCCProfileTierLevel { @@ -658,31 +667,10 @@ static int hvcc_array_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size, uint8_t nal_type, int ps_array_completeness, - HEVCDecoderConfigurationRecord *hvcc) + HVCCNALUnitArray *array) { int ret; - uint8_t index; - uint16_t numNalus; - HVCCNALUnitArray *array; - - for (index = 0; index < hvcc->numOfArrays; index++) - if (hvcc->array[index].NAL_unit_type == nal_type) - break; - - if (index >= hvcc->numOfArrays) { - uint8_t i; - - ret = av_reallocp_array(&hvcc->array, index + 1, sizeof(HVCCNALUnitArray)); - if (ret < 0) - return ret; - - for (i = hvcc->numOfArrays; i <= index; i++) - memset(&hvcc->array[i], 0, sizeof(HVCCNALUnitArray)); - hvcc->numOfArrays = index + 1; - } - - array = &hvcc->array[index]; - numNalus = array->numNalus; + uint16_t numNalus = array->numNalus; ret = av_reallocp_array(&array->nalUnit, numNalus + 1, sizeof(uint8_t*)); if (ret < 0) @@ -711,7 +699,8 @@ static int hvcc_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size, int ps_array_completeness, - HEVCDecoderConfigurationRecord *hvcc) + HEVCDecoderConfigurationRecord *hvcc, + unsigned array_idx) { int ret = 0; GetBitContext gbc; @@ -736,29 +725,21 @@ * hvcC. Perhaps the SEI playload type should be checked * and non-declarative SEI messages discarded? */ - switch (nal_type) { - case HEVC_NAL_VPS: - case HEVC_NAL_SPS: - case HEVC_NAL_PPS: - case HEVC_NAL_SEI_PREFIX: - case HEVC_NAL_SEI_SUFFIX: - ret = hvcc_array_add_nal_unit(nal_buf, nal_size, nal_type, - ps_array_completeness, hvcc); - if (ret < 0) - goto end; - else if (nal_type == HEVC_NAL_VPS) - ret = hvcc_parse_vps(&gbc, hvcc); - else if (nal_type == HEVC_NAL_SPS) - ret = hvcc_parse_sps(&gbc, hvcc); - else if (nal_type == HEVC_NAL_PPS) - ret = hvcc_parse_pps(&gbc, hvcc); - if (ret < 0) - goto end; - break; - default: - ret = AVERROR_INVALIDDATA; + ret = hvcc_array_add_nal_unit(nal_buf, nal_size, nal_type, + ps_array_completeness, + &hvcc->arrays[array_idx]); + if (ret < 0) + goto end; + if (hvcc->arrays[array_idx].numNalus == 1) + hvcc->numOfArrays++; + if (nal_type == HEVC_NAL_VPS) + ret = hvcc_parse_vps(&gbc, hvcc); + else if (nal_type == HEVC_NAL_SPS) + ret = hvcc_parse_sps(&gbc, hvcc); + else if (nal_type == HEVC_NAL_PPS) + ret = hvcc_parse_pps(&gbc, hvcc); + if (ret < 0) goto end; - } end: av_free(rbsp_buf); @@ -787,22 +768,17 @@ static void hvcc_close(HEVCDecoderConfigurationRecord *hvcc) { - uint8_t i; - - for (i = 0; i < hvcc->numOfArrays; i++) { - hvcc->array[i].numNalus = 0; - av_freep(&hvcc->array[i].nalUnit); - av_freep(&hvcc->array[i].nalUnitLength); + for (unsigned i = 0; i < FF_ARRAY_ELEMS(hvcc->arrays); i++) { + HVCCNALUnitArray *const array = &hvcc->arrays[i]; + array->numNalus = 0; + av_freep(&array->nalUnit); + av_freep(&array->nalUnitLength); } - - hvcc->numOfArrays = 0; - av_freep(&hvcc->array); } static int hvcc_write(AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc) { - uint8_t i; - uint16_t j, vps_count = 0, sps_count = 0, pps_count = 0; + uint16_t vps_count, sps_count, pps_count; /* * We only support writing HEVCDecoderConfigurationRecord version 1. @@ -866,36 +842,31 @@ hvcc->lengthSizeMinusOne); av_log(NULL, AV_LOG_TRACE, "numOfArrays: %"PRIu8"\n", hvcc->numOfArrays); - for (i = 0; i < hvcc->numOfArrays; i++) { - av_log(NULL, AV_LOG_TRACE, "array_completeness[%"PRIu8"]: %"PRIu8"\n", - i, hvcc->array[i].array_completeness); - av_log(NULL, AV_LOG_TRACE, "NAL_unit_type[%"PRIu8"]: %"PRIu8"\n", - i, hvcc->array[i].NAL_unit_type); - av_log(NULL, AV_LOG_TRACE, "numNalus[%"PRIu8"]: %"PRIu16"\n", - i, hvcc->array[i].numNalus); - for (j = 0; j < hvcc->array[i].numNalus; j++) + for (unsigned i = 0, j = 0; i < FF_ARRAY_ELEMS(hvcc->arrays); i++) { + const HVCCNALUnitArray *const array = &hvcc->arrays[i]; + + if (array->numNalus == 0) + continue; + + av_log(NULL, AV_LOG_TRACE, "array_completeness[%u]: %"PRIu8"\n", + j, array->array_completeness); + av_log(NULL, AV_LOG_TRACE, "NAL_unit_type[%u]: %"PRIu8"\n", + j, array->NAL_unit_type); + av_log(NULL, AV_LOG_TRACE, "numNalus[%u]: %"PRIu16"\n", + j, array->numNalus); + for (unsigned k = 0; k < array->numNalus; k++) av_log(NULL, AV_LOG_TRACE, - "nalUnitLength[%"PRIu8"][%"PRIu16"]: %"PRIu16"\n", - i, j, hvcc->array[i].nalUnitLength[j]); + "nalUnitLength[%u][%u]: %"PRIu16"\n", + j, k, array->nalUnitLength[k]); + j++; } /* * We need at least one of each: VPS, SPS and PPS. */ - for (i = 0; i < hvcc->numOfArrays; i++) - switch (hvcc->array[i].NAL_unit_type) { - case HEVC_NAL_VPS: - vps_count += hvcc->array[i].numNalus; - break; - case HEVC_NAL_SPS: - sps_count += hvcc->array[i].numNalus; - break; - case HEVC_NAL_PPS: - pps_count += hvcc->array[i].numNalus; - break; - default: - break; - } + vps_count = hvcc->arrays[VPS_INDEX].numNalus; + sps_count = hvcc->arrays[SPS_INDEX].numNalus; + pps_count = hvcc->arrays[PPS_INDEX].numNalus; if (!vps_count || vps_count > HEVC_MAX_VPS_COUNT || !sps_count || sps_count > HEVC_MAX_SPS_COUNT || !pps_count || pps_count > HEVC_MAX_PPS_COUNT) @@ -924,31 +895,31 @@ avio_w8(pb, hvcc->general_level_idc); /* - * bit(4) reserved = ‘1111’b; + * bit(4) reserved = '1111'b; * unsigned int(12) min_spatial_segmentation_idc; */ avio_wb16(pb, hvcc->min_spatial_segmentation_idc | 0xf000); /* - * bit(6) reserved = ‘111111’b; + * bit(6) reserved = '111111'b; * unsigned int(2) parallelismType; */ avio_w8(pb, hvcc->parallelismType | 0xfc); /* - * bit(6) reserved = ‘111111’b; + * bit(6) reserved = '111111'b; * unsigned int(2) chromaFormat; */ avio_w8(pb, hvcc->chromaFormat | 0xfc); /* - * bit(5) reserved = ‘11111’b; + * bit(5) reserved = '11111'b; * unsigned int(3) bitDepthLumaMinus8; */ avio_w8(pb, hvcc->bitDepthLumaMinus8 | 0xf8); /* - * bit(5) reserved = ‘11111’b; + * bit(5) reserved = '11111'b; * unsigned int(3) bitDepthChromaMinus8; */ avio_w8(pb, hvcc->bitDepthChromaMinus8 | 0xf8); @@ -970,25 +941,29 @@ /* unsigned int(8) numOfArrays; */ avio_w8(pb, hvcc->numOfArrays); - for (i = 0; i < hvcc->numOfArrays; i++) { + for (unsigned i = 0; i < FF_ARRAY_ELEMS(hvcc->arrays); i++) { + const HVCCNALUnitArray *const array = &hvcc->arrays[i]; + + if (!array->numNalus) + continue; /* * bit(1) array_completeness; * unsigned int(1) reserved = 0; * unsigned int(6) NAL_unit_type; */ - avio_w8(pb, hvcc->array[i].array_completeness << 7 | - hvcc->array[i].NAL_unit_type & 0x3f); + avio_w8(pb, array->array_completeness << 7 | + array->NAL_unit_type & 0x3f); /* unsigned int(16) numNalus; */ - avio_wb16(pb, hvcc->array[i].numNalus); + avio_wb16(pb, array->numNalus); - for (j = 0; j < hvcc->array[i].numNalus; j++) { + for (unsigned j = 0; j < array->numNalus; j++) { /* unsigned int(16) nalUnitLength; */ - avio_wb16(pb, hvcc->array[i].nalUnitLength[j]); + avio_wb16(pb, array->nalUnitLength[j]); /* bit(8*nalUnitLength) nalUnit; */ - avio_write(pb, hvcc->array[i].nalUnit[j], - hvcc->array[i].nalUnitLength[j]); + avio_write(pb, array->nalUnit[j], + array->nalUnitLength[j]); } } @@ -1098,18 +1073,18 @@ buf += 4; - switch (type) { - case HEVC_NAL_VPS: - case HEVC_NAL_SPS: - case HEVC_NAL_PPS: - case HEVC_NAL_SEI_PREFIX: - case HEVC_NAL_SEI_SUFFIX: - ret = hvcc_add_nal_unit(buf, len, ps_array_completeness, &hvcc); - if (ret < 0) - goto end; - break; - default: - break; + for (unsigned i = 0; i < FF_ARRAY_ELEMS(hvcc.arrays); i++) { + static const uint8_t array_idx_to_type[] = + { HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS, + HEVC_NAL_SEI_PREFIX, HEVC_NAL_SEI_SUFFIX }; + + if (type == array_idx_to_type[i]) { + ret = hvcc_add_nal_unit(buf, len, ps_array_completeness, + &hvcc, i); + if (ret < 0) + goto end; + break; + } } buf += len; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hls.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hls.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hls.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hls.c 2023-03-03 13:29:59.000000000 +0000 @@ -225,6 +225,7 @@ int http_persistent; int http_multiple; int http_seekable; + int seg_max_retry; AVIOContext *playlist_pb; HLSCryptoContext crypto_ctx; } HLSContext; @@ -1104,10 +1105,10 @@ static int id3_has_changed_values(struct playlist *pls, AVDictionary *metadata, ID3v2ExtraMetaAPIC *apic) { - AVDictionaryEntry *entry = NULL; - AVDictionaryEntry *oldentry; + const AVDictionaryEntry *entry = NULL; + const AVDictionaryEntry *oldentry; /* check that no keys have changed values */ - while ((entry = av_dict_get(metadata, "", entry, AV_DICT_IGNORE_SUFFIX))) { + while ((entry = av_dict_iterate(metadata, entry))) { oldentry = av_dict_get(pls->id3_initial, entry->key, NULL, AV_DICT_MATCH_CASE); if (!oldentry || strcmp(oldentry->value, entry->value) != 0) return 1; @@ -1472,6 +1473,7 @@ int ret; int just_opened = 0; int reload_count = 0; + int segment_retries = 0; struct segment *seg; restart: @@ -1527,7 +1529,7 @@ return AVERROR_EOF; } } else { - av_log(v->parent, AV_LOG_WARNING, "maybe the m3u8 list sequence have been wraped.\n"); + av_log(v->parent, AV_LOG_WARNING, "The m3u8 list sequence may have been wrapped.\n"); } if (v->cur_seq_no >= v->start_seq_no + v->n_segments) { if (v->finished) @@ -1563,9 +1565,18 @@ av_log(v->parent, AV_LOG_WARNING, "Failed to open segment %"PRId64" of playlist %d\n", v->cur_seq_no, v->index); - v->cur_seq_no += 1; + if (segment_retries >= c->seg_max_retry) { + av_log(v->parent, AV_LOG_WARNING, "Segment %"PRId64" of playlist %d failed too many times, skipping\n", + v->cur_seq_no, + v->index); + v->cur_seq_no++; + segment_retries = 0; + } else { + segment_retries++; + } goto reload; } + segment_retries = 0; just_opened = 1; } @@ -2549,6 +2560,8 @@ OFFSET(http_seekable), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, FLAGS}, {"seg_format_options", "Set options for segment demuxer", OFFSET(seg_format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS}, + {"seg_max_retry", "Maximum number of times to reload a segment on error.", + OFFSET(seg_max_retry), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS}, {NULL} }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hlsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hlsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hlsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/hlsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -43,6 +43,8 @@ #include "libavutil/time.h" #include "libavutil/time_internal.h" +#include "libavcodec/avcodec.h" + #include "avformat.h" #include "avio_internal.h" #include "avc.h" @@ -250,6 +252,7 @@ int http_persistent; AVIOContext *m3u8_out; AVIOContext *sub_m3u8_out; + AVIOContext *http_delete; int64_t timeout; int ignore_io_errors; char *headers; @@ -563,19 +566,22 @@ #endif static int hls_delete_file(HLSContext *hls, AVFormatContext *avf, - const char *path, const char *proto) + char *path, const char *proto) { if (hls->method || (proto && !av_strcasecmp(proto, "http"))) { AVDictionary *opt = NULL; - AVIOContext *out = NULL; int ret; + set_http_options(avf, &opt, hls); av_dict_set(&opt, "method", "DELETE", 0); - ret = avf->io_open(avf, &out, path, AVIO_FLAG_WRITE, &opt); + + ret = hlsenc_io_open(avf, &hls->http_delete, path, &opt); av_dict_free(&opt); if (ret < 0) return hls->ignore_io_errors ? 1 : ret; - ff_format_io_close(avf, &out); + + //Nothing to write + hlsenc_io_close(avf, &hls->http_delete, path); } else if (unlink(path) < 0) { av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", path, strerror(errno)); @@ -660,7 +666,7 @@ } proto = avio_find_protocol_name(s->url); - if (ret = hls_delete_file(hls, vs->avf, path.str, proto)) + if (ret = hls_delete_file(hls, s, path.str, proto)) goto fail; if ((segment->sub_filename[0] != '\0')) { @@ -677,7 +683,7 @@ goto fail; } - if (ret = hls_delete_file(hls, vs->vtt_avf, path.str, proto)) + if (ret = hls_delete_file(hls, s, path.str, proto)) goto fail; } av_bprint_clear(&path); @@ -863,7 +869,11 @@ oc->max_delay = s->max_delay; oc->opaque = s->opaque; oc->io_open = s->io_open; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS oc->io_close = s->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif oc->io_close2 = s->io_close2; oc->strict_std_compliance = s->strict_std_compliance; av_dict_copy(&oc->metadata, s->metadata, 0); @@ -2705,6 +2715,7 @@ ff_format_io_close(s, &hls->m3u8_out); ff_format_io_close(s, &hls->sub_m3u8_out); + ff_format_io_close(s, &hls->http_delete); av_freep(&hls->key_basename); av_freep(&hls->var_streams); av_freep(&hls->cc_streams); @@ -3109,9 +3120,6 @@ {"hls_init_time", "set segment length at init list", OFFSET(init_time), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, E}, {"hls_list_size", "set maximum number of playlist entries", OFFSET(max_nb_segments), AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX, E}, {"hls_delete_threshold", "set number of unreferenced segments to keep before deleting", OFFSET(hls_delete_threshold), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, E}, -#if FF_HLS_TS_OPTIONS - {"hls_ts_options","set hls mpegts list of options for the container format used for hls (deprecated, use hls_segment_options instead of it.)", OFFSET(format_options), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, E | AV_OPT_FLAG_DEPRECATED}, -#endif {"hls_vtt_options","set hls vtt list of options for the container format used for hls", OFFSET(vtt_format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, {"hls_allow_cache", "explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments", OFFSET(allowcache), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, E}, {"hls_base_url", "url to prepend to each playlist entry", OFFSET(baseurl), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, @@ -3176,19 +3184,19 @@ }; -const AVOutputFormat ff_hls_muxer = { - .name = "hls", - .long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"), - .extensions = "m3u8", +const FFOutputFormat ff_hls_muxer = { + .p.name = "hls", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"), + .p.extensions = "m3u8", + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, + .p.subtitle_codec = AV_CODEC_ID_WEBVTT, + .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS, + .p.priv_class = &hls_class, .priv_data_size = sizeof(HLSContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, - .subtitle_codec = AV_CODEC_ID_WEBVTT, - .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_NODIMENSIONS, .init = hls_init, .write_header = hls_write_header, .write_packet = hls_write_packet, .write_trailer = hls_write_trailer, .deinit = hls_deinit, - .priv_class = &hls_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/http.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/http.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/http.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/http.c 2023-03-03 13:29:59.000000000 +0000 @@ -1021,11 +1021,11 @@ static int cookie_string(AVDictionary *dict, char **cookies) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int len = 1; // determine how much memory is needed for the cookies string - while (e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX)) + while ((e = av_dict_iterate(dict, e))) len += strlen(e->key) + strlen(e->value) + 1; // reallocate the cookies @@ -1036,7 +1036,7 @@ *cookies[0] = '\0'; // write out the cookies - while (e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX)) + while ((e = av_dict_iterate(dict, e))) av_strlcatf(*cookies, len, "%s%s\n", e->key, e->value); return 0; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/icoenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/icoenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/icoenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/icoenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,7 @@ #include "avformat.h" #include "avio_internal.h" +#include "mux.h" typedef struct { int offset; @@ -193,17 +194,17 @@ av_freep(&ico->images); } -const AVOutputFormat ff_ico_muxer = { - .name = "ico", - .long_name = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"), +const FFOutputFormat ff_ico_muxer = { + .p.name = "ico", + .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"), .priv_data_size = sizeof(IcoMuxContext), - .mime_type = "image/vnd.microsoft.icon", - .extensions = "ico", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_BMP, + .p.mime_type = "image/vnd.microsoft.icon", + .p.extensions = "ico", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_BMP, .write_header = ico_write_header, .write_packet = ico_write_packet, .write_trailer = ico_write_trailer, .deinit = ico_deinit, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2.c 2023-03-03 13:29:59.000000000 +0000 @@ -377,10 +377,10 @@ lang[3] = '\0'; taglen -= 3; - if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0) + if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0 || taglen < 0) goto error; - if (decode_str(s, pb, encoding, &text, &taglen) < 0) + if (decode_str(s, pb, encoding, &text, &taglen) < 0 || taglen < 0) goto error; // FFmpeg does not support hierarchical metadata, so concatenate the keys. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/id3v2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -150,7 +150,7 @@ return len + ID3v2_HEADER_SIZE; } -static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t, +static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, const AVDictionaryEntry *t, const char table[][4], enum ID3v2Encoding enc) { uint32_t tag; @@ -167,13 +167,13 @@ static void id3v2_3_metadata_split_date(AVDictionary **pm) { - AVDictionaryEntry *mtag = NULL; + const AVDictionaryEntry *mtag = NULL; AVDictionary *dst = NULL; const char *key, *value; char year[5] = {0}, day_month[5] = {0}; int i; - while ((mtag = av_dict_get(*pm, "", mtag, AV_DICT_IGNORE_SUFFIX))) { + while ((mtag = av_dict_iterate(*pm, mtag))) { key = mtag->key; if (!av_strcasecmp(key, "date")) { /* split date tag using "YYYY-MM-DD" format into year and month/day segments */ @@ -220,7 +220,7 @@ static int write_metadata(AVIOContext *pb, AVDictionary **metadata, ID3v2EncContext *id3, int enc) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int ret; ff_metadata_conv(metadata, ff_id3v2_34_metadata_conv, NULL); @@ -229,7 +229,7 @@ else if (id3->version == 4) ff_metadata_conv(metadata, ff_id3v2_4_metadata_conv, NULL); - while ((t = av_dict_get(*metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(*metadata, t))) { if ((ret = id3v2_check_write_tag(id3, pb, t, ff_id3v2_tags, enc)) > 0) { id3->len += ret; continue; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/idroqenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/idroqenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/idroqenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/idroqenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "avformat.h" +#include "mux.h" #include "rawenc.h" @@ -59,12 +60,12 @@ return 0; } -const AVOutputFormat ff_roq_muxer = { - .name = "roq", - .long_name = NULL_IF_CONFIG_SMALL("raw id RoQ"), - .extensions = "roq", - .audio_codec = AV_CODEC_ID_ROQ_DPCM, - .video_codec = AV_CODEC_ID_ROQ, +const FFOutputFormat ff_roq_muxer = { + .p.name = "roq", + .p.long_name = NULL_IF_CONFIG_SMALL("raw id RoQ"), + .p.extensions = "roq", + .p.audio_codec = AV_CODEC_ID_ROQ_DPCM, + .p.video_codec = AV_CODEC_ID_ROQ, .write_header = roq_write_header, .write_packet = ff_raw_write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ifv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ifv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ifv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ifv.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/dict_internal.h" #include "avformat.h" #include "internal.h" #include "avio_internal.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ilbc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ilbc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ilbc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ilbc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" static const char mode20_header[] = "#!iLBC20\n"; @@ -120,14 +121,14 @@ }; #if CONFIG_ILBC_MUXER -const AVOutputFormat ff_ilbc_muxer = { - .name = "ilbc", - .long_name = NULL_IF_CONFIG_SMALL("iLBC storage"), - .mime_type = "audio/iLBC", - .extensions = "lbc", - .audio_codec = AV_CODEC_ID_ILBC, +const FFOutputFormat ff_ilbc_muxer = { + .p.name = "ilbc", + .p.long_name = NULL_IF_CONFIG_SMALL("iLBC storage"), + .p.mime_type = "audio/iLBC", + .p.extensions = "lbc", + .p.audio_codec = AV_CODEC_ID_ILBC, + .p.flags = AVFMT_NOTIMESTAMPS, .write_header = ilbc_write_header, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf_cpl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf_cpl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf_cpl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf_cpl.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,10 +72,9 @@ int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid) { - xmlChar *element_text = NULL; int ret = 0; - element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); + xmlChar *element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); ret = av_uuid_urn_parse(element_text, uuid); if (ret) { av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n"); @@ -88,10 +87,9 @@ int ff_imf_xml_read_rational(xmlNodePtr element, AVRational *rational) { - xmlChar *element_text = NULL; int ret = 0; - element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); + xmlChar *element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); if (sscanf(element_text, "%i %i", &rational->num, &rational->den) != 2) { av_log(NULL, AV_LOG_ERROR, "Invalid rational number\n"); ret = AVERROR_INVALIDDATA; @@ -103,10 +101,9 @@ int ff_imf_xml_read_uint32(xmlNodePtr element, uint32_t *number) { - xmlChar *element_text = NULL; int ret = 0; - element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); + xmlChar *element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); if (sscanf(element_text, "%" PRIu32, number) != 1) { av_log(NULL, AV_LOG_ERROR, "Invalid unsigned 32-bit integer"); ret = AVERROR_INVALIDDATA; @@ -116,6 +113,22 @@ return ret; } +static int ff_imf_xml_read_boolean(xmlNodePtr element, int *value) +{ + int ret = 0; + + xmlChar *element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); + if (xmlStrcmp(element_text, "true") == 0 || xmlStrcmp(element_text, "1") == 0) + *value = 1; + else if (xmlStrcmp(element_text, "false") == 0 || xmlStrcmp(element_text, "0") == 0) + *value = 0; + else + ret = 1; + xmlFree(element_text); + + return ret; +} + static void imf_base_virtual_track_init(FFIMFBaseVirtualTrack *track) { memset(track->id_uuid, 0, sizeof(track->id_uuid)); @@ -179,6 +192,90 @@ return 0; } +static int digit_to_int(char digit) +{ + if (digit >= '0' && digit <= '9') + return digit - '0'; + return -1; +} + +/** + * Parses a string that conform to the TimecodeType used in IMF CPL and defined + * in SMPTE ST 2067-3. + * @param[in] s string to parse + * @param[out] tc_comps pointer to an array of 4 integers where the parsed HH, + * MM, SS and FF fields of the timecode are returned. + * @return 0 on success, < 0 AVERROR code on error. + */ +static int parse_cpl_tc_type(const char *s, int *tc_comps) +{ + if (av_strnlen(s, 11) != 11) + return AVERROR(EINVAL); + + for (int i = 0; i < 4; i++) { + int hi; + int lo; + + hi = digit_to_int(s[i * 3]); + lo = digit_to_int(s[i * 3 + 1]); + + if (hi == -1 || lo == -1) + return AVERROR(EINVAL); + + tc_comps[i] = 10 * hi + lo; + } + + return 0; +} + +static int fill_timecode(xmlNodePtr cpl_element, FFIMFCPL *cpl) +{ + xmlNodePtr tc_element = NULL; + xmlNodePtr element = NULL; + xmlChar *tc_str = NULL; + int df = 0; + int comps[4]; + int ret = 0; + + tc_element = ff_imf_xml_get_child_element_by_name(cpl_element, "CompositionTimecode"); + if (!tc_element) + return 0; + + element = ff_imf_xml_get_child_element_by_name(tc_element, "TimecodeDropFrame"); + if (!element) { + av_log(NULL, AV_LOG_ERROR, "CompositionTimecode element is missing\ + a TimecodeDropFrame child element\n"); + return AVERROR_INVALIDDATA; + } + + if (ff_imf_xml_read_boolean(element, &df)) { + av_log(NULL, AV_LOG_ERROR, "TimecodeDropFrame element is invalid\n"); + return AVERROR_INVALIDDATA; + } + element = ff_imf_xml_get_child_element_by_name(tc_element, "TimecodeStartAddress"); + if (!element) { + av_log(NULL, AV_LOG_ERROR, "CompositionTimecode element is missing\ + a TimecodeStartAddress child element\n"); + return AVERROR_INVALIDDATA; + } + + tc_str = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); + ret = parse_cpl_tc_type(tc_str, comps); + xmlFree(tc_str); + if (ret) + return ret; + + cpl->tc = av_malloc(sizeof(AVTimecode)); + if (!cpl->tc) + return AVERROR(ENOMEM); + ret = av_timecode_init_from_components(cpl->tc, cpl->edit_rate, + df ? AV_TIMECODE_FLAG_DROPFRAME : 0, + comps[0], comps[1], comps[2], comps[3], + NULL); + + return ret; +} + static int fill_edit_rate(xmlNodePtr cpl_element, FFIMFCPL *cpl) { xmlNodePtr element = NULL; @@ -625,7 +722,7 @@ av_log(NULL, AV_LOG_DEBUG, "Processing IMF CPL Segment\n"); sequence_list_elem = ff_imf_xml_get_child_element_by_name(segment_elem, "SequenceList"); - if (!segment_list_elem) + if (!sequence_list_elem) continue; sequence_elem = xmlFirstElementChild(sequence_list_elem); @@ -682,6 +779,8 @@ goto cleanup; if ((ret = fill_edit_rate(cpl_element, *cpl))) goto cleanup; + if ((ret = fill_timecode(cpl_element, *cpl))) + goto cleanup; if ((ret = fill_virtual_tracks(cpl_element, *cpl))) goto cleanup; @@ -731,6 +830,7 @@ av_uuid_nil(cpl->id_uuid); cpl->content_title_utf8 = NULL; cpl->edit_rate = av_make_q(0, 1); + cpl->tc = NULL; cpl->main_markers_track = NULL; cpl->main_image_2d_track = NULL; cpl->main_audio_track_count = 0; @@ -753,6 +853,9 @@ if (!cpl) return; + if (cpl->tc) + av_freep(&cpl->tc); + xmlFree(cpl->content_title_utf8); imf_marker_virtual_track_free(cpl->main_markers_track); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imfdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imfdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imfdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imfdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -233,7 +233,12 @@ asset = &(asset_map->assets[asset_map->asset_count]); - if (ff_imf_xml_read_uuid(ff_imf_xml_get_child_element_by_name(asset_element, "Id"), asset->uuid)) { + if (!(node = ff_imf_xml_get_child_element_by_name(asset_element, "Id"))) { + av_log(s, AV_LOG_ERROR, "Unable to parse asset map XML - missing Id node\n"); + return AVERROR_INVALIDDATA; + } + + if (ff_imf_xml_read_uuid(node, asset->uuid)) { av_log(s, AV_LOG_ERROR, "Could not parse UUID from asset in asset map.\n"); return AVERROR_INVALIDDATA; } @@ -374,7 +379,11 @@ return AVERROR(ENOMEM); track_resource->ctx->io_open = s->io_open; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS track_resource->ctx->io_close = s->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif track_resource->ctx->io_close2 = s->io_close2; track_resource->ctx->flags |= s->flags & ~AVFMT_FLAG_CUSTOM_IO; @@ -573,18 +582,14 @@ first_resource_stream = c->tracks[i]->resources[0].ctx->streams[0]; av_log(s, AV_LOG_DEBUG, "Open the first resource of track %d\n", c->tracks[i]->index); - /* Copy stream information */ - asset_stream = avformat_new_stream(s, NULL); + asset_stream = ff_stream_clone(s, first_resource_stream); if (!asset_stream) { - av_log(s, AV_LOG_ERROR, "Could not create stream\n"); + av_log(s, AV_LOG_ERROR, "Could not clone stream\n"); return AVERROR(ENOMEM); } + asset_stream->id = i; - ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar); - if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n"); - return ret; - } + asset_stream->nb_frames = 0; avpriv_set_pts_info(asset_stream, first_resource_stream->pts_wrap_bits, first_resource_stream->time_base.num, @@ -626,6 +631,8 @@ IMFContext *c = s->priv_data; char *asset_map_path; char *tmp_str; + AVDictionaryEntry* tcr; + char tc_buf[AV_TIMECODE_STR_SIZE]; int ret = 0; c->interrupt_callback = &s->interrupt_callback; @@ -645,6 +652,15 @@ if ((ret = ff_imf_parse_cpl(s->pb, &c->cpl)) < 0) return ret; + tcr = av_dict_get(s->metadata, "timecode", NULL, 0); + if (!tcr && c->cpl->tc) { + ret = av_dict_set(&s->metadata, "timecode", + av_timecode_make_string(c->cpl->tc, tc_buf, 0), 0); + if (ret) + return ret; + av_log(s, AV_LOG_INFO, "Setting timecode to IMF CPL timecode %s\n", tc_buf); + } + av_log(s, AV_LOG_DEBUG, "parsed IMF CPL: " AV_PRI_URN_UUID "\n", @@ -685,8 +701,11 @@ { IMFContext *c = s->priv_data; IMFVirtualTrackPlaybackCtx *track; - AVRational minimum_timestamp = av_make_q(INT32_MAX, 1); + + if (!c->track_count) + return NULL; + for (uint32_t i = c->track_count; i > 0; i--) { av_log(s, AV_LOG_TRACE, "Compare track %d timestamp " AVRATIONAL_FORMAT " to minimum " AVRATIONAL_FORMAT @@ -701,8 +720,6 @@ } } - av_log(s, AV_LOG_DEBUG, "Found next track to read: %d (timestamp: %lf / %lf)\n", - track->index, av_q2d(track->current_timestamp), av_q2d(minimum_timestamp)); return track; } @@ -765,6 +782,14 @@ track = get_next_track_with_minimum_timestamp(s); + if (!track) { + av_log(s, AV_LOG_ERROR, "No track found for playback\n"); + return AVERROR_INVALIDDATA; + } + + av_log(s, AV_LOG_DEBUG, "Found track %d to read at timestamp %lf\n", + track->index, av_q2d(track->current_timestamp)); + ret = get_resource_context_for_timestamp(s, track, &resource); if (ret) return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/imf.h 2023-03-03 13:29:59.000000000 +0000 @@ -59,6 +59,7 @@ #include "libavformat/avio.h" #include "libavutil/rational.h" #include "libavutil/uuid.h" +#include "libavutil/timecode.h" #include /** @@ -130,6 +131,7 @@ AVUUID id_uuid; /**< CompositionPlaylist/Id element */ xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */ AVRational edit_rate; /**< CompositionPlaylist/EditRate element */ + AVTimecode *tc; /**< CompositionPlaylist/CompositionTimecode element */ FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */ FFIMFTrackFileVirtualTrack *main_image_2d_track; /**< Main Image Virtual Track */ uint32_t main_audio_track_count; /**< Number of Main Audio Virtual Tracks */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2.c 2023-03-03 13:29:59.000000000 +0000 @@ -91,6 +91,8 @@ { AV_CODEC_ID_VBN, "vbn" }, { AV_CODEC_ID_JPEGXL, "jxl" }, { AV_CODEC_ID_QOI, "qoi" }, + { AV_CODEC_ID_RADIANCE_HDR, "hdr" }, + { AV_CODEC_ID_WBMP, "wbmp" }, { AV_CODEC_ID_NONE, NULL } }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -1070,6 +1070,13 @@ return pnm_magic_check(p, 7) ? pnm_probe(p) : 0; } +static int hdr_probe(const AVProbeData *p) +{ + if (!memcmp(p->buf, "#?RADIANCE\n", 11)) + return AVPROBE_SCORE_MAX; + return 0; +} + static int xbm_probe(const AVProbeData *p) { if (!memcmp(p->buf, "/* XBM X10 format */", 20)) @@ -1221,6 +1228,7 @@ IMAGEAUTO_DEMUXER(exr, EXR) IMAGEAUTO_DEMUXER(gem, GEM) IMAGEAUTO_DEMUXER(gif, GIF) +IMAGEAUTO_DEMUXER_EXT(hdr, RADIANCE_HDR, HDR) IMAGEAUTO_DEMUXER_EXT(j2k, JPEG2000, J2K) IMAGEAUTO_DEMUXER_EXT(jpeg, MJPEG, JPEG) IMAGEAUTO_DEMUXER(jpegls, JPEGLS) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/img2enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "avio_internal.h" #include "internal.h" #include "img2.h" +#include "mux.h" typedef struct VideoMuxData { const AVClass *class; /**< Class for private options. */ @@ -268,30 +269,30 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_image2_muxer = { - .name = "image2", - .long_name = NULL_IF_CONFIG_SMALL("image2 sequence"), - .extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm," +const FFOutputFormat ff_image2_muxer = { + .p.name = "image2", + .p.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"), + .p.extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,phm," "png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8," - "im24,sunras,vbn,xbm,xface,pix,y,avif,qoi", + "im24,sunras,vbn,xbm,xface,pix,y,avif,qoi,hdr,wbmp", .priv_data_size = sizeof(VideoMuxData), - .video_codec = AV_CODEC_ID_MJPEG, + .p.video_codec = AV_CODEC_ID_MJPEG, .write_header = write_header, .write_packet = write_packet, .query_codec = query_codec, - .flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE, - .priv_class = &img2mux_class, + .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE, + .p.priv_class = &img2mux_class, }; #endif #if CONFIG_IMAGE2PIPE_MUXER -const AVOutputFormat ff_image2pipe_muxer = { - .name = "image2pipe", - .long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"), +const FFOutputFormat ff_image2pipe_muxer = { + .p.name = "image2pipe", + .p.long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"), .priv_data_size = sizeof(VideoMuxData), - .video_codec = AV_CODEC_ID_MJPEG, + .p.video_codec = AV_CODEC_ID_MJPEG, .write_header = write_header, .write_packet = write_packet_pipe, .query_codec = query_codec, - .flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS + .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include -#include "libavcodec/avcodec.h" #include "libavcodec/packet_internal.h" #include "avformat.h" @@ -221,7 +220,7 @@ /** * The codec context used by avformat_find_stream_info, the parser, etc. */ - AVCodecContext *avctx; + struct AVCodecContext *avctx; /** * 1 if avctx has been initialized with the values from the codec parameters */ @@ -311,6 +310,13 @@ int64_t mux_ts_offset; /** + * This is the lowest ts allowed in this track; it may be set by the muxer + * during init or write_header and influences the automatic timestamp + * shifting code. + */ + int64_t lowest_ts_allowed; + + /** * Internal data to check for wrapping of the time stamp */ int64_t pts_wrap_reference; @@ -626,6 +632,17 @@ int ff_stream_side_data_copy(AVStream *dst, const AVStream *src); /** + * Create a new stream and copy to it all parameters from a source stream, with + * the exception of the index field, which is set when the new stream is + * created. + * + * @param dst_ctx pointer to the context in which the new stream is created + * @param src pointer to source AVStream + * @return pointer to the new stream or NULL on error + */ +AVStream *ff_stream_clone(AVFormatContext *dst_ctx, const AVStream *src); + +/** * Wrap ffurl_move() and log if error happens. * * @param url_src source path @@ -688,6 +705,7 @@ */ void ff_format_set_url(AVFormatContext *s, char *url); -void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]); +struct FFOutputFormat; +void avpriv_register_devices(const struct FFOutputFormat * const o[], const AVInputFormat * const i[]); #endif /* AVFORMAT_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ipfsgateway.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ipfsgateway.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ipfsgateway.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ipfsgateway.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "libavutil/avstring.h" +#include "libavutil/file_open.h" #include "libavutil/getenv_utf8.h" #include "libavutil/opt.h" #include @@ -328,29 +329,29 @@ {NULL}, }; -static const AVClass ipfs_context_class = { - .class_name = "IPFS", +static const AVClass ipfs_gateway_context_class = { + .class_name = "IPFS Gateway", .item_name = av_default_item_name, .option = options, .version = LIBAVUTIL_VERSION_INT, }; -const URLProtocol ff_ipfs_protocol = { +const URLProtocol ff_ipfs_gateway_protocol = { .name = "ipfs", .url_open2 = translate_ipfs_to_http, .url_read = ipfs_read, .url_seek = ipfs_seek, .url_close = ipfs_close, .priv_data_size = sizeof(IPFSGatewayContext), - .priv_data_class = &ipfs_context_class, + .priv_data_class = &ipfs_gateway_context_class, }; -const URLProtocol ff_ipns_protocol = { +const URLProtocol ff_ipns_gateway_protocol = { .name = "ipns", .url_open2 = translate_ipfs_to_http, .url_read = ipfs_read, .url_seek = ipfs_seek, .url_close = ipfs_close, .priv_data_size = sizeof(IPFSGatewayContext), - .priv_data_class = &ipfs_context_class, + .priv_data_class = &ipfs_gateway_context_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ircamenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ircamenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ircamenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ircamenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "ircam.h" @@ -50,13 +51,13 @@ return 0; } -const AVOutputFormat ff_ircam_muxer = { - .name = "ircam", - .extensions = "sf,ircam", - .long_name = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_ircam_muxer = { + .p.name = "ircam", + .p.extensions = "sf,ircam", + .p.long_name = NULL_IF_CONFIG_SMALL("Berkeley/IRCAM/CARL Sound Format"), + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = ircam_write_header, .write_packet = ff_raw_write_packet, - .codec_tag = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 }, + .p.codec_tag = (const AVCodecTag *const []){ ff_codec_ircam_le_tags, 0 }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.c 2023-03-03 13:29:59.000000000 +0000 @@ -61,7 +61,6 @@ { AV_CODEC_ID_DTS , 0xA9 }, /* mp4ra.org */ { AV_CODEC_ID_OPUS , 0xAD }, /* mp4ra.org */ { AV_CODEC_ID_VP9 , 0xB1 }, /* mp4ra.org */ - { AV_CODEC_ID_FLAC , 0xC1 }, /* nonstandard, update when there is a standard value */ { AV_CODEC_ID_TSCC2 , 0xD0 }, /* nonstandard, camtasia uses it */ { AV_CODEC_ID_EVRC , 0xD1 }, /* nonstandard, pvAuthor uses it */ { AV_CODEC_ID_VORBIS , 0xDD }, /* nonstandard, gpac uses it */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom.h 2023-03-03 13:29:59.000000000 +0000 @@ -135,8 +135,11 @@ int64_t first_tfra_pts; int64_t tfdt_dts; int64_t next_trun_dts; + // Index of the first sample/trun in the fragment. + int index_base; int index_entry; MOVEncryptionIndex *encryption_index; + int stsd_id; // current fragment stsd_id } MOVFragmentStreamInfo; typedef struct MOVFragmentIndexItem { @@ -253,7 +256,6 @@ struct { struct AVAESCTR* aes_ctr; struct AVAES *aes_ctx; - unsigned int frag_index_entry_base; unsigned int per_sample_iv_size; // Either 0, 8, or 16. AVEncryptionInfo *default_encrypted_sample; MOVEncryptionIndex *encryption_index; @@ -284,6 +286,7 @@ int use_absolute_path; int ignore_editlist; int advanced_editlist; + int advanced_editlist_autodisabled; int ignore_chapters; int seek_individually; int64_t next_root_atom; ///< offset of the next root atom @@ -318,6 +321,12 @@ uint32_t max_stts_delta; int is_still_picture_avif; int primary_item_id; + struct { + int item_id; + int extent_length; + int64_t extent_offset; + } *avif_info; + int avif_info_size; } MOVContext; int ff_mp4_read_descr_len(AVIOContext *pb); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom_tags.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom_tags.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom_tags.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/isom_tags.c 2023-03-03 13:29:59.000000000 +0000 @@ -274,6 +274,13 @@ { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'G', 'R') }, /* ASC Bayer BGGR */ + { AV_CODEC_ID_MEDIA100, MKTAG('6', '0', '1', 'N') }, + { AV_CODEC_ID_MEDIA100, MKTAG('6', '0', '1', 'P') }, + { AV_CODEC_ID_MEDIA100, MKTAG('d', 't', 'n', 't') }, + { AV_CODEC_ID_MEDIA100, MKTAG('d', 't', 'N', 'T') }, + { AV_CODEC_ID_MEDIA100, MKTAG('d', 't', 'p', 'a') }, + { AV_CODEC_ID_MEDIA100, MKTAG('d', 't', 'P', 'A') }, + { AV_CODEC_ID_NONE, 0 }, }; @@ -332,7 +339,7 @@ { AV_CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', 'N') }, /* ZygoAudio (quality 10 mode) */ { AV_CODEC_ID_EVRC, MKTAG('s', 'e', 'v', 'c') }, /* 3GPP2 */ { AV_CODEC_ID_SMV, MKTAG('s', 's', 'm', 'v') }, /* 3GPP2 */ - { AV_CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') }, /* nonstandard */ + { AV_CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') }, { AV_CODEC_ID_TRUEHD, MKTAG('m', 'l', 'p', 'a') }, /* mp4ra.org */ { AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') }, /* mp4ra.org */ { AV_CODEC_ID_MPEGH_3D_AUDIO, MKTAG('m', 'h', 'm', '1') }, /* MPEG-H 3D Audio bitstream */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ivfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ivfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ivfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ivfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -122,16 +122,16 @@ { AV_CODEC_ID_NONE, 0 } }; -const AVOutputFormat ff_ivf_muxer = { +const FFOutputFormat ff_ivf_muxer = { + .p.name = "ivf", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 IVF"), + .p.extensions = "ivf", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_VP8, + .p.codec_tag = (const AVCodecTag* const []){ codec_ivf_tags, 0 }, .priv_data_size = sizeof(IVFEncContext), - .name = "ivf", - .long_name = NULL_IF_CONFIG_SMALL("On2 IVF"), - .extensions = "ivf", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_VP8, .init = ivf_init, .write_header = ivf_write_header, .write_packet = ivf_write_packet, .write_trailer = ivf_write_trailer, - .codec_tag = (const AVCodecTag* const []){ codec_ivf_tags, 0 }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/jacosubenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/jacosubenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/jacosubenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/jacosubenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -17,6 +17,7 @@ */ #include "avformat.h" +#include "mux.h" #include "rawenc.h" static int jacosub_write_header(AVFormatContext *s) @@ -29,13 +30,13 @@ return 0; } -const AVOutputFormat ff_jacosub_muxer = { - .name = "jacosub", - .long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"), - .mime_type = "text/x-jacosub", - .extensions = "jss,js", +const FFOutputFormat ff_jacosub_muxer = { + .p.name = "jacosub", + .p.long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"), + .p.mime_type = "text/x-jacosub", + .p.extensions = "jss,js", + .p.flags = AVFMT_TS_NONSTRICT, + .p.subtitle_codec = AV_CODEC_ID_JACOSUB, .write_header = jacosub_write_header, .write_packet = ff_raw_write_packet, - .flags = AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_JACOSUB, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/kvag.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/kvag.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/kvag.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/kvag.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "libavutil/intreadwrite.h" @@ -188,12 +189,12 @@ return 0; } -const AVOutputFormat ff_kvag_muxer = { - .name = "kvag", - .long_name = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"), - .extensions = "vag", - .audio_codec = AV_CODEC_ID_ADPCM_IMA_SSI, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_kvag_muxer = { + .p.name = "kvag", + .p.long_name = NULL_IF_CONFIG_SMALL("Simon & Schuster Interactive VAG"), + .p.extensions = "vag", + .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_SSI, + .p.video_codec = AV_CODEC_ID_NONE, .init = kvag_write_init, .write_header = kvag_write_header, .write_packet = ff_raw_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lafdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lafdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lafdec.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lafdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,290 @@ +/* + * Limitless Audio Format demuxer + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "avio_internal.h" +#include "internal.h" + +#define MAX_STREAMS 4096 + +typedef struct StreamParams { + AVChannelLayout layout; + float horizontal; + float vertical; + int lfe; + int stored; +} StreamParams; + +typedef struct LAFContext { + uint8_t *data; + unsigned nb_stored; + unsigned stored_index; + unsigned index; + unsigned bpp; + + StreamParams p[MAX_STREAMS]; + + int header_len; + uint8_t header[(MAX_STREAMS + 7) / 8]; +} LAFContext; + +static int laf_probe(const AVProbeData *p) +{ + if (memcmp(p->buf, "LIMITLESS", 9)) + return 0; + if (memcmp(p->buf + 9, "HEAD", 4)) + return 0; + return AVPROBE_SCORE_MAX; +} + +static int laf_read_header(AVFormatContext *ctx) +{ + LAFContext *s = ctx->priv_data; + AVIOContext *pb = ctx->pb; + unsigned st_count, mode; + unsigned sample_rate; + int64_t duration; + int codec_id; + int quality; + int bpp; + + avio_skip(pb, 9); + if (avio_rb32(pb) != MKBETAG('H','E','A','D')) + return AVERROR_INVALIDDATA; + + quality = avio_r8(pb); + if (quality > 3) + return AVERROR_INVALIDDATA; + mode = avio_r8(pb); + if (mode > 1) + return AVERROR_INVALIDDATA; + st_count = avio_rl32(pb); + if (st_count == 0 || st_count > MAX_STREAMS) + return AVERROR_INVALIDDATA; + + for (int i = 0; i < st_count; i++) { + StreamParams *stp = &s->p[i]; + + stp->vertical = av_int2float(avio_rl32(pb)); + stp->horizontal = av_int2float(avio_rl32(pb)); + stp->lfe = avio_r8(pb); + if (stp->lfe) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_LOW_FREQUENCY)); + } else if (stp->vertical == 0.f && + stp->horizontal == 0.f) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_FRONT_CENTER)); + } else if (stp->vertical == 0.f && + stp->horizontal == -30.f) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_FRONT_LEFT)); + } else if (stp->vertical == 0.f && + stp->horizontal == 30.f) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_FRONT_RIGHT)); + } else if (stp->vertical == 0.f && + stp->horizontal == -110.f) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_SIDE_LEFT)); + } else if (stp->vertical == 0.f && + stp->horizontal == 110.f) { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MASK(1, (AV_CH_SIDE_RIGHT)); + } else { + stp->layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; + } + } + + sample_rate = avio_rl32(pb); + duration = avio_rl64(pb) / st_count; + + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; + + switch (quality) { + case 0: + codec_id = AV_CODEC_ID_PCM_U8; + bpp = 1; + break; + case 1: + codec_id = AV_CODEC_ID_PCM_S16LE; + bpp = 2; + break; + case 2: + codec_id = AV_CODEC_ID_PCM_F32LE; + bpp = 4; + break; + case 3: + codec_id = AV_CODEC_ID_PCM_S24LE; + bpp = 3; + break; + default: + return AVERROR_INVALIDDATA; + } + + s->index = 0; + s->stored_index = 0; + s->bpp = bpp; + if ((int64_t)bpp * st_count * (int64_t)sample_rate >= INT32_MAX) + return AVERROR_INVALIDDATA; + s->data = av_calloc(st_count * sample_rate, bpp); + if (!s->data) + return AVERROR(ENOMEM); + + for (int st = 0; st < st_count; st++) { + StreamParams *stp = &s->p[st]; + AVCodecParameters *par; + AVStream *st = avformat_new_stream(ctx, NULL); + if (!st) + return AVERROR(ENOMEM); + + par = st->codecpar; + par->codec_id = codec_id; + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->ch_layout.nb_channels = 1; + par->ch_layout = stp->layout; + par->sample_rate = sample_rate; + st->duration = duration; + + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + } + + s->header_len = (ctx->nb_streams + 7) / 8; + + return 0; +} + +static int laf_read_packet(AVFormatContext *ctx, AVPacket *pkt) +{ + AVIOContext *pb = ctx->pb; + LAFContext *s = ctx->priv_data; + AVStream *st = ctx->streams[0]; + const int bpp = s->bpp; + StreamParams *stp; + int64_t pos; + int ret; + + pos = avio_tell(pb); + +again: + if (avio_feof(pb)) + return AVERROR_EOF; + + if (s->index >= ctx->nb_streams) { + int cur_st = 0, st_count = 0, st_index = 0; + + ret = ffio_read_size(pb, s->header, s->header_len); + if (ret < 0) + return ret; + for (int i = 0; i < s->header_len; i++) { + uint8_t val = s->header[i]; + + for (int j = 0; j < 8 && cur_st < ctx->nb_streams; j++, cur_st++) { + StreamParams *stp = &s->p[st_index]; + + stp->stored = 0; + if (val & 1) { + stp->stored = 1; + st_count++; + } + val >>= 1; + st_index++; + } + } + + s->index = s->stored_index = 0; + s->nb_stored = st_count; + if (!st_count) + return AVERROR_INVALIDDATA; + ret = ffio_read_size(pb, s->data, st_count * st->codecpar->sample_rate * bpp); + if (ret < 0) + return ret; + } + + st = ctx->streams[s->index]; + stp = &s->p[s->index]; + while (!stp->stored) { + s->index++; + if (s->index >= ctx->nb_streams) + goto again; + stp = &s->p[s->index]; + } + st = ctx->streams[s->index]; + + ret = av_new_packet(pkt, st->codecpar->sample_rate * bpp); + if (ret < 0) + return ret; + + switch (bpp) { + case 1: + for (int n = 0; n < st->codecpar->sample_rate; n++) + pkt->data[n] = s->data[n * s->nb_stored + s->stored_index]; + break; + case 2: + for (int n = 0; n < st->codecpar->sample_rate; n++) + AV_WN16(pkt->data + n * 2, AV_RN16(s->data + n * s->nb_stored * 2 + s->stored_index * 2)); + break; + case 3: + for (int n = 0; n < st->codecpar->sample_rate; n++) + AV_WL24(pkt->data + n * 3, AV_RL24(s->data + n * s->nb_stored * 3 + s->stored_index * 3)); + break; + case 4: + for (int n = 0; n < st->codecpar->sample_rate; n++) + AV_WN32(pkt->data + n * 4, AV_RN32(s->data + n * s->nb_stored * 4 + s->stored_index * 4)); + break; + } + + pkt->stream_index = s->index; + pkt->pos = pos; + s->index++; + s->stored_index++; + + return 0; +} + +static int laf_read_close(AVFormatContext *ctx) +{ + LAFContext *s = ctx->priv_data; + + av_freep(&s->data); + + return 0; +} + +static int laf_read_seek(AVFormatContext *ctx, int stream_index, + int64_t timestamp, int flags) +{ + LAFContext *s = ctx->priv_data; + + s->stored_index = s->index = s->nb_stored = 0; + + return -1; +} + +const AVInputFormat ff_laf_demuxer = { + .name = "laf", + .long_name = NULL_IF_CONFIG_SMALL("LAF (Limitless Audio Format)"), + .priv_data_size = sizeof(LAFContext), + .read_probe = laf_probe, + .read_header = laf_read_header, + .read_packet = laf_read_packet, + .read_close = laf_read_close, + .read_seek = laf_read_seek, + .extensions = "laf", + .flags = AVFMT_GENERIC_INDEX, + .flags_internal = FF_FMT_INIT_CLEANUP, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/latmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/latmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/latmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/latmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "libavcodec/codec_par.h" #include "libavcodec/packet.h" #include "libavcodec/mpeg4audio.h" +#include "libavcodec/mpeg4audio_copy_pce.h" #include "libavutil/opt.h" #include "avformat.h" #include "internal.h" @@ -259,17 +260,17 @@ return ret; } -const AVOutputFormat ff_latm_muxer = { - .name = "latm", - .long_name = NULL_IF_CONFIG_SMALL("LOAS/LATM"), - .mime_type = "audio/MP4A-LATM", - .extensions = "latm,loas", +const FFOutputFormat ff_latm_muxer = { + .p.name = "latm", + .p.long_name = NULL_IF_CONFIG_SMALL("LOAS/LATM"), + .p.mime_type = "audio/MP4A-LATM", + .p.extensions = "latm,loas", .priv_data_size = sizeof(LATMContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = latm_write_header, .write_packet = latm_write_packet, - .priv_class = &latm_muxer_class, + .p.priv_class = &latm_muxer_class, .check_bitstream= latm_check_bitstream, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lrcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lrcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lrcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/lrcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -63,8 +63,7 @@ av_dict_set(&s->metadata, "ve", NULL, 0); } for(metadata_item = NULL; - (metadata_item = av_dict_get(s->metadata, "", metadata_item, - AV_DICT_IGNORE_SUFFIX));) { + (metadata_item = av_dict_iterate(s->metadata, metadata_item));) { char *delim; if(!metadata_item->value[0]) { continue; @@ -105,7 +104,7 @@ size--; next_line++; } - if(line[0] == '[') { + if (size && line[0] == '[') { av_log(s, AV_LOG_WARNING, "Subtitle starts with '[', may cause problems with LRC format.\n"); } @@ -126,14 +125,14 @@ return 0; } -const AVOutputFormat ff_lrc_muxer = { - .name = "lrc", - .long_name = NULL_IF_CONFIG_SMALL("LRC lyrics"), - .extensions = "lrc", +const FFOutputFormat ff_lrc_muxer = { + .p.name = "lrc", + .p.long_name = NULL_IF_CONFIG_SMALL("LRC lyrics"), + .p.extensions = "lrc", + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER | + AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT, + .p.subtitle_codec = AV_CODEC_ID_SUBRIP, .priv_data_size = 0, .write_header = lrc_write_header, .write_packet = lrc_write_packet, - .flags = AVFMT_VARIABLE_FPS | AVFMT_GLOBALHEADER | - AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_SUBRIP }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -13,6 +13,7 @@ demux.o \ demux_utils.o \ dump.o \ + dv.o \ format.o \ id3v1.o \ id3v2.o \ @@ -100,6 +101,7 @@ OBJS-$(CONFIG_AMRWB_DEMUXER) += amr.o rawdec.o OBJS-$(CONFIG_AMV_MUXER) += amvenc.o OBJS-$(CONFIG_ANM_DEMUXER) += anm.o +OBJS-$(CONFIG_APAC_DEMUXER) += apac.o rawdec.o OBJS-$(CONFIG_APC_DEMUXER) += apc.o OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o img2.o OBJS-$(CONFIG_APM_DEMUXER) += apm.o @@ -146,6 +148,7 @@ OBJS-$(CONFIG_BITPACKED_DEMUXER) += rawvideodec.o OBJS-$(CONFIG_BMV_DEMUXER) += bmv.o OBJS-$(CONFIG_BOA_DEMUXER) += boadec.o +OBJS-$(CONFIG_BONK_DEMUXER) += bonk.o rawdec.o OBJS-$(CONFIG_BFSTM_DEMUXER) += brstm.o OBJS-$(CONFIG_BRSTM_DEMUXER) += brstm.o OBJS-$(CONFIG_C93_DEMUXER) += c93.o voc_packet.o voc.o @@ -184,7 +187,6 @@ OBJS-$(CONFIG_DTSHD_DEMUXER) += dtshddec.o OBJS-$(CONFIG_DTS_DEMUXER) += dtsdec.o rawdec.o OBJS-$(CONFIG_DTS_MUXER) += rawenc.o -OBJS-$(CONFIG_DV_DEMUXER) += dv.o OBJS-$(CONFIG_DV_MUXER) += dvenc.o OBJS-$(CONFIG_DVBSUB_DEMUXER) += dvbsub.o rawdec.o OBJS-$(CONFIG_DVBTXT_DEMUXER) += dvbtxt.o rawdec.o @@ -273,6 +275,7 @@ OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_GEM_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_GIF_PIPE_DEMUXER) += img2dec.o img2.o +OBJS-$(CONFIG_IMAGE_HDR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER) += img2dec.o img2.o @@ -317,6 +320,7 @@ OBJS-$(CONFIG_KUX_DEMUXER) += flvdec.o OBJS-$(CONFIG_KVAG_DEMUXER) += kvag.o OBJS-$(CONFIG_KVAG_MUXER) += kvag.o rawenc.o +OBJS-$(CONFIG_LAF_DEMUXER) += lafdec.o OBJS-$(CONFIG_LATM_MUXER) += latmenc.o rawenc.o OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o OBJS-$(CONFIG_LOAS_DEMUXER) += loasdec.o rawdec.o @@ -478,6 +482,7 @@ OBJS-$(CONFIG_RAWVIDEO_MUXER) += rawenc.o OBJS-$(CONFIG_REALTEXT_DEMUXER) += realtextdec.o subtitles.o OBJS-$(CONFIG_REDSPARK_DEMUXER) += redspark.o +OBJS-$(CONFIG_RKA_DEMUXER) += rka.o apetag.o img2.o OBJS-$(CONFIG_RL2_DEMUXER) += rl2.o OBJS-$(CONFIG_RM_DEMUXER) += rmdec.o rm.o rmsipr.o OBJS-$(CONFIG_RM_MUXER) += rmenc.o rm.o @@ -519,6 +524,7 @@ OBJS-$(CONFIG_SCC_DEMUXER) += sccdec.o subtitles.o OBJS-$(CONFIG_SCC_MUXER) += sccenc.o OBJS-$(CONFIG_SCD_DEMUXER) += scd.o +OBJS-$(CONFIG_SDNS_DEMUXER) += sdns.o OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o OBJS-$(CONFIG_SDR2_DEMUXER) += sdr2.o OBJS-$(CONFIG_SDS_DEMUXER) += sdsdec.o @@ -593,6 +599,8 @@ OBJS-$(CONFIG_VQF_DEMUXER) += vqf.o OBJS-$(CONFIG_W64_DEMUXER) += wavdec.o w64.o pcm.o OBJS-$(CONFIG_W64_MUXER) += wavenc.o w64.o +OBJS-$(CONFIG_WADY_DEMUXER) += wady.o pcm.o +OBJS-$(CONFIG_WAVARC_DEMUXER) += wavarc.o OBJS-$(CONFIG_WAV_DEMUXER) += wavdec.o pcm.o OBJS-$(CONFIG_WAV_MUXER) += wavenc.o OBJS-$(CONFIG_WC3_DEMUXER) += wc3movie.o @@ -616,6 +624,7 @@ OBJS-$(CONFIG_WV_MUXER) += wvenc.o wv.o apetag.o img2.o OBJS-$(CONFIG_XA_DEMUXER) += xa.o OBJS-$(CONFIG_XBIN_DEMUXER) += bintext.o sauce.o +OBJS-$(CONFIG_XMD_DEMUXER) += xmd.o pcm.o OBJS-$(CONFIG_XMV_DEMUXER) += xmv.o OBJS-$(CONFIG_XVAG_DEMUXER) += xvag.o OBJS-$(CONFIG_XWMA_DEMUXER) += xwma.o @@ -643,6 +652,7 @@ OBJS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpcrypt.o rtmpdigest.o rtmpdh.o OBJS-$(CONFIG_FFRTMPHTTP_PROTOCOL) += rtmphttp.o OBJS-$(CONFIG_FILE_PROTOCOL) += file.o +OBJS-$(CONFIG_FD_PROTOCOL) += file.o OBJS-$(CONFIG_FTP_PROTOCOL) += ftp.o urldecode.o OBJS-$(CONFIG_GOPHER_PROTOCOL) += gopher.o OBJS-$(CONFIG_GOPHERS_PROTOCOL) += gopher.o @@ -668,8 +678,8 @@ OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o -OBJS-$(CONFIG_IPFS_PROTOCOL) += ipfsgateway.o -OBJS-$(CONFIG_IPNS_PROTOCOL) += ipfsgateway.o +OBJS-$(CONFIG_IPFS_GATEWAY_PROTOCOL) += ipfsgateway.o +OBJS-$(CONFIG_IPNS_GATEWAY_PROTOCOL) += ipfsgateway.o TLS-OBJS-$(CONFIG_GNUTLS) += tls_gnutls.o TLS-OBJS-$(CONFIG_LIBTLS) += tls_libtls.o TLS-OBJS-$(CONFIG_MBEDTLS) += tls_mbedtls.o @@ -710,10 +720,9 @@ SHLIBOBJS-$(CONFIG_SPDIF_MUXER) += dca_sample_rate_tab.o # libavdevice dependencies -OBJS-$(CONFIG_IEC61883_INDEV) += dv.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o SKIPHEADERS-$(CONFIG_IMF_DEMUXER) += imf.h SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskadec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskadec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskadec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskadec.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,6 +38,7 @@ #include "libavutil/base64.h" #include "libavutil/bprint.h" #include "libavutil/dict.h" +#include "libavutil/dict_internal.h" #include "libavutil/display.h" #include "libavutil/intfloat.h" #include "libavutil/intreadwrite.h" @@ -45,6 +46,7 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" +#include "libavutil/pixdesc.h" #include "libavutil/time_internal.h" #include "libavutil/spherical.h" @@ -2183,8 +2185,8 @@ color->chroma_siting_horz < MATROSKA_COLOUR_CHROMASITINGHORZ_NB && color->chroma_siting_vert < MATROSKA_COLOUR_CHROMASITINGVERT_NB) { st->codecpar->chroma_location = - avcodec_chroma_pos_to_enum((color->chroma_siting_horz - 1) << 7, - (color->chroma_siting_vert - 1) << 7); + av_chroma_location_pos_to_enum((color->chroma_siting_horz - 1) << 7, + (color->chroma_siting_vert - 1) << 7); } if (color->max_cll && color->max_fall) { size_t size = 0; @@ -4008,7 +4010,8 @@ /* This function searches all the Cues and returns the CueDesc corresponding to * the timestamp ts. Returned CueDesc will be such that start_time_ns <= ts < - * end_time_ns. All 4 fields will be set to -1 if ts >= file's duration. + * end_time_ns. All 4 fields will be set to -1 if ts >= file's duration or + * if an error occurred. */ static CueDesc get_cue_desc(AVFormatContext *s, int64_t ts, int64_t cues_start) { MatroskaDemuxContext *matroska = s->priv_data; @@ -4027,6 +4030,8 @@ } } --i; + if (index_entries[i].timestamp > matroska->duration) + return (CueDesc) {-1, -1, -1, -1}; cue_desc.start_time_ns = index_entries[i].timestamp * matroska->time_scale; cue_desc.start_offset = index_entries[i].pos - matroska->segment_start; if (i != nb_index_entries - 1) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/matroskaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -51,12 +51,14 @@ #include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" #include "libavutil/random_seed.h" #include "libavutil/rational.h" #include "libavutil/samplefmt.h" #include "libavutil/stereo3d.h" #include "libavcodec/av1.h" +#include "libavcodec/codec_desc.h" #include "libavcodec/xiph.h" #include "libavcodec/mpeg4audio.h" @@ -1322,7 +1324,7 @@ par->chroma_location <= AVCHROMA_LOC_TOP) { int xpos, ypos; - avcodec_enum_to_chroma_pos(&xpos, &ypos, par->chroma_location); + av_chroma_location_enum_to_pos(&xpos, &ypos, par->chroma_location); ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, (xpos >> 7) + 1); ebml_writer_add_uint(writer, MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, @@ -1828,19 +1830,20 @@ break; case AVMEDIA_TYPE_AUDIO: - if (par->initial_padding && par->codec_id == AV_CODEC_ID_OPUS) { + if (par->initial_padding) { int64_t codecdelay = av_rescale_q(par->initial_padding, - (AVRational){ 1, 48000 }, + (AVRational){ 1, par->sample_rate }, (AVRational){ 1, 1000000000 }); if (codecdelay < 0) { av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n"); return AVERROR(EINVAL); } -// track->ts_offset = av_rescale_q(par->initial_padding, -// (AVRational){ 1, par->sample_rate }, -// st->time_base); - put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay); + + track->ts_offset = av_rescale_q(par->initial_padding, + (AVRational){ 1, par->sample_rate }, + st->time_base); + ffstream(st)->lowest_ts_allowed = -track->ts_offset; } if (par->codec_id == AV_CODEC_ID_OPUS) put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL); @@ -2045,7 +2048,7 @@ mkv_write_tag_targets(mkv, tmp_bc, elementid, uid); - while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(m, t))) { if (mkv_check_tag_name(t->key, elementid)) { ret = mkv_write_simpletag(tmp_bc, t); if (ret < 0) @@ -2591,7 +2594,6 @@ uint8_t *side_data; size_t side_data_size; uint64_t additional_id; - int64_t discard_padding = 0; unsigned track_number = track->track_num; EBML_WRITER(9); @@ -2619,10 +2621,13 @@ AV_PKT_DATA_SKIP_SAMPLES, &side_data_size); if (side_data && side_data_size >= 10) { - discard_padding = av_rescale_q(AV_RL32(side_data + 4), - (AVRational){1, par->sample_rate}, - (AVRational){1, 1000000000}); - ebml_writer_add_sint(&writer, MATROSKA_ID_DISCARDPADDING, discard_padding); + int64_t discard_padding = AV_RL32(side_data + 4); + if (discard_padding) { + discard_padding = av_rescale_q(discard_padding, + (AVRational){1, par->sample_rate}, + (AVRational){1, 1000000000}); + ebml_writer_add_sint(&writer, MATROSKA_ID_DISCARDPADDING, discard_padding); + } } side_data = av_packet_get_side_data(pkt, @@ -3316,31 +3321,31 @@ return 0; } -const AVOutputFormat ff_matroska_muxer = { - .name = "matroska", - .long_name = NULL_IF_CONFIG_SMALL("Matroska"), - .mime_type = "video/x-matroska", - .extensions = "mkv", +const FFOutputFormat ff_matroska_muxer = { + .p.name = "matroska", + .p.long_name = NULL_IF_CONFIG_SMALL("Matroska"), + .p.mime_type = "video/x-matroska", + .p.extensions = "mkv", .priv_data_size = sizeof(MatroskaMuxContext), - .audio_codec = CONFIG_LIBVORBIS_ENCODER ? + .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3, - .video_codec = CONFIG_LIBX264_ENCODER ? + .p.video_codec = CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, .init = mkv_init, .deinit = mkv_deinit, .write_header = mkv_write_header, .write_packet = mkv_write_flush_packet, .write_trailer = mkv_write_trailer, - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, - .codec_tag = (const AVCodecTag* const []){ + .p.codec_tag = (const AVCodecTag* const []){ ff_codec_bmp_tags, ff_codec_wav_tags, additional_audio_tags, additional_video_tags, additional_subtitle_tags, 0 }, - .subtitle_codec = AV_CODEC_ID_ASS, + .p.subtitle_codec = AV_CODEC_ID_ASS, .query_codec = mkv_query_codec, .check_bitstream = mkv_check_bitstream, - .priv_class = &matroska_webm_class, + .p.priv_class = &matroska_webm_class, }; #endif @@ -3354,15 +3359,15 @@ return 0; } -const AVOutputFormat ff_webm_muxer = { - .name = "webm", - .long_name = NULL_IF_CONFIG_SMALL("WebM"), - .mime_type = "video/webm", - .extensions = "webm", +const FFOutputFormat ff_webm_muxer = { + .p.name = "webm", + .p.long_name = NULL_IF_CONFIG_SMALL("WebM"), + .p.mime_type = "video/webm", + .p.extensions = "webm", .priv_data_size = sizeof(MatroskaMuxContext), - .audio_codec = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS, - .video_codec = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8, - .subtitle_codec = AV_CODEC_ID_WEBVTT, + .p.audio_codec = CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : AV_CODEC_ID_VORBIS, + .p.video_codec = CONFIG_LIBVPX_VP9_ENCODER? AV_CODEC_ID_VP9 : AV_CODEC_ID_VP8, + .p.subtitle_codec = AV_CODEC_ID_WEBVTT, .init = mkv_init, .deinit = mkv_deinit, .write_header = mkv_write_header, @@ -3370,33 +3375,33 @@ .write_trailer = mkv_write_trailer, .query_codec = webm_query_codec, .check_bitstream = mkv_check_bitstream, - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, - .priv_class = &matroska_webm_class, + .p.priv_class = &matroska_webm_class, }; #endif #if CONFIG_MATROSKA_AUDIO_MUXER -const AVOutputFormat ff_matroska_audio_muxer = { - .name = "matroska", - .long_name = NULL_IF_CONFIG_SMALL("Matroska Audio"), - .mime_type = "audio/x-matroska", - .extensions = "mka", +const FFOutputFormat ff_matroska_audio_muxer = { + .p.name = "matroska", + .p.long_name = NULL_IF_CONFIG_SMALL("Matroska Audio"), + .p.mime_type = "audio/x-matroska", + .p.extensions = "mka", .priv_data_size = sizeof(MatroskaMuxContext), - .audio_codec = CONFIG_LIBVORBIS_ENCODER ? + .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? AV_CODEC_ID_VORBIS : AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_NONE, .init = mkv_init, .deinit = mkv_deinit, .write_header = mkv_write_header, .write_packet = mkv_write_flush_packet, .write_trailer = mkv_write_trailer, .check_bitstream = mkv_check_bitstream, - .flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT | + .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, - .codec_tag = (const AVCodecTag* const []){ + .p.codec_tag = (const AVCodecTag* const []){ ff_codec_wav_tags, additional_audio_tags, 0 }, - .priv_class = &matroska_webm_class, + .p.priv_class = &matroska_webm_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/metadata.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/metadata.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/metadata.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/metadata.c 2023-03-03 13:29:59.000000000 +0000 @@ -29,14 +29,14 @@ /* TODO: use binary search to look up the two conversion tables if the tables are getting big enough that it would matter speed wise */ const AVMetadataConv *sc, *dc; - AVDictionaryEntry *mtag = NULL; + const AVDictionaryEntry *mtag = NULL; AVDictionary *dst = NULL; const char *key; if (d_conv == s_conv || !pm) return; - while ((mtag = av_dict_get(*pm, "", mtag, AV_DICT_IGNORE_SUFFIX))) { + while ((mtag = av_dict_iterate(*pm, mtag))) { key = mtag->key; if (s_conv) for (sc=s_conv; sc->native; sc++) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/microdvdenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/microdvdenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/microdvdenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/microdvdenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include #include "avformat.h" #include "internal.h" +#include "mux.h" static int microdvd_write_header(struct AVFormatContext *s) { @@ -55,13 +56,13 @@ return 0; } -const AVOutputFormat ff_microdvd_muxer = { - .name = "microdvd", - .long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"), - .mime_type = "text/x-microdvd", - .extensions = "sub", +const FFOutputFormat ff_microdvd_muxer = { + .p.name = "microdvd", + .p.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"), + .p.mime_type = "text/x-microdvd", + .p.extensions = "sub", + .p.flags = AVFMT_NOTIMESTAMPS, + .p.subtitle_codec = AV_CODEC_ID_MICRODVD, .write_header = microdvd_write_header, .write_packet = microdvd_write_packet, - .flags = AVFMT_NOTIMESTAMPS, - .subtitle_codec = AV_CODEC_ID_MICRODVD, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mj2kdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mj2kdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mj2kdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mj2kdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,13 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include "libavutil/intreadwrite.h" #include "avformat.h" #include "rawdec.h" -#if CONFIG_MJPEG_2000_DEMUXER static int mjpeg2000_probe(const AVProbeData *p) { const uint8_t *b = p->buf; @@ -53,4 +50,3 @@ return 0; } FF_DEF_RAWVIDEO_DEMUXER2(mjpeg_2000, "raw MJPEG 2000 video", mjpeg2000_probe, "j2k", AV_CODEC_ID_JPEG2000, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS) -#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mkvtimestamp_v2.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mkvtimestamp_v2.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mkvtimestamp_v2.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mkvtimestamp_v2.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" static int write_header(AVFormatContext *s) { @@ -40,11 +41,11 @@ return 0; } -const AVOutputFormat ff_mkvtimestamp_v2_muxer = { - .name = "mkvtimestamp_v2", - .long_name = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, +const FFOutputFormat ff_mkvtimestamp_v2_muxer = { + .p.name = "mkvtimestamp_v2", + .p.long_name = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"), + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = write_header, .write_packet = write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mmf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mmf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mmf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mmf.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "pcm.h" #include "rawenc.h" #include "riff.h" @@ -309,14 +310,14 @@ #endif #if CONFIG_MMF_MUXER -const AVOutputFormat ff_mmf_muxer = { - .name = "mmf", - .long_name = NULL_IF_CONFIG_SMALL("Yamaha SMAF"), - .mime_type = "application/vnd.smaf", - .extensions = "mmf", +const FFOutputFormat ff_mmf_muxer = { + .p.name = "mmf", + .p.long_name = NULL_IF_CONFIG_SMALL("Yamaha SMAF"), + .p.mime_type = "application/vnd.smaf", + .p.extensions = "mmf", .priv_data_size = sizeof(MMFContext), - .audio_codec = AV_CODEC_ID_ADPCM_YAMAHA, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_ADPCM_YAMAHA, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = mmf_write_header, .write_packet = ff_raw_write_packet, .write_trailer = mmf_write_trailer, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "libavutil/attributes.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/dict_internal.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" @@ -1271,15 +1272,18 @@ return frag_stream_info->tfdt_dts; } -static int64_t get_frag_time(MOVFragmentIndex *frag_index, - int index, int track_id) +static int64_t get_frag_time(AVFormatContext *s, AVStream *dst_st, + MOVFragmentIndex *frag_index, int index) { MOVFragmentStreamInfo * frag_stream_info; + MOVStreamContext *sc = dst_st->priv_data; int64_t timestamp; - int i; + int i, j; - if (track_id >= 0) { - frag_stream_info = get_frag_stream_info(frag_index, index, track_id); + // If the stream is referenced by any sidx, limit the search + // to fragments that referenced this stream in the sidx + if (sc->has_sidx) { + frag_stream_info = get_frag_stream_info(frag_index, index, dst_st->id); if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE) return frag_stream_info->sidx_pts; if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE) @@ -1288,28 +1292,27 @@ } for (i = 0; i < frag_index->item[index].nb_stream_info; i++) { + AVStream *frag_stream = NULL; frag_stream_info = &frag_index->item[index].stream_info[i]; + for (j = 0; j < s->nb_streams; j++) + if (s->streams[j]->id == frag_stream_info->id) + frag_stream = s->streams[j]; + if (!frag_stream) { + av_log(s, AV_LOG_WARNING, "No stream matching sidx ID found.\n"); + continue; + } timestamp = get_stream_info_time(frag_stream_info); if (timestamp != AV_NOPTS_VALUE) - return timestamp; + return av_rescale_q(timestamp, frag_stream->time_base, dst_st->time_base); } return AV_NOPTS_VALUE; } -static int search_frag_timestamp(MOVFragmentIndex *frag_index, +static int search_frag_timestamp(AVFormatContext *s, MOVFragmentIndex *frag_index, AVStream *st, int64_t timestamp) { int a, b, m, m0; int64_t frag_time; - int id = -1; - - if (st) { - // If the stream is referenced by any sidx, limit the search - // to fragments that referenced this stream in the sidx - MOVStreamContext *sc = st->priv_data; - if (sc->has_sidx) - id = st->id; - } a = -1; b = frag_index->nb_items; @@ -1318,7 +1321,7 @@ m0 = m = (a + b) >> 1; while (m < b && - (frag_time = get_frag_time(frag_index, m, id)) == AV_NOPTS_VALUE) + (frag_time = get_frag_time(s, st, frag_index, m)) == AV_NOPTS_VALUE) m++; if (m < b && frag_time <= timestamp) @@ -1369,6 +1372,7 @@ frag_stream_info[i].tfdt_dts = AV_NOPTS_VALUE; frag_stream_info[i].next_trun_dts = AV_NOPTS_VALUE; frag_stream_info[i].first_tfra_pts = AV_NOPTS_VALUE; + frag_stream_info[i].index_base = -1; frag_stream_info[i].index_entry = -1; frag_stream_info[i].encryption_index = NULL; } @@ -1485,6 +1489,11 @@ } st->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */ + if ((version == 1 && st->duration == UINT64_MAX) || + (version != 1 && st->duration == UINT32_MAX)) { + st->duration = 0; + } + lang = avio_rb16(pb); /* language */ if (ff_mov_lang_to_iso639(lang, language)) av_dict_set(&st->metadata, "language", language, 0); @@ -1516,10 +1525,6 @@ av_log(c->fc, AV_LOG_TRACE, "time scale = %i\n", c->time_scale); c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */ - // set the AVFormatContext duration because the duration of individual tracks - // may be inaccurate - if (!c->trex_data) - c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale); avio_rb32(pb); /* preferred scale */ avio_rb16(pb); /* preferred volume */ @@ -2427,6 +2432,11 @@ switch (st->codecpar->codec_id) { #if CONFIG_DV_DEMUXER case AV_CODEC_ID_DVAUDIO: + if (c->dv_fctx) { + avpriv_request_sample(c->fc, "multiple DV audio streams"); + return AVERROR(ENOSYS); + } + c->dv_fctx = avformat_alloc_context(); if (!c->dv_fctx) { av_log(c->fc, AV_LOG_ERROR, "dv demux context alloc error\n"); @@ -3062,6 +3072,21 @@ st->nb_frames= total_sample_count; if (duration) st->duration= FFMIN(st->duration, duration); + + // All samples have zero duration. They have higher chance be chose by + // mov_find_next_sample, which leads to seek again and again. + // + // It's AVERROR_INVALIDDATA actually, but such files exist in the wild. + // So only mark data stream as discarded for safety. + if (!duration && sc->stts_count && + st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { + av_log(c->fc, AV_LOG_WARNING, + "All samples in data stream index:id [%d:%d] have zero " + "duration, stream set to be discarded by default. Override " + "using AVStream->discard or -discard for ffmpeg command.\n", + st->index, st->id); + st->discard = AVDISCARD_ALL; + } sc->track_end = duration; return 0; } @@ -4038,10 +4063,15 @@ } } - if (multiple_edits && !mov->advanced_editlist) - av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " - "Use -advanced_editlist to correctly decode otherwise " - "a/v desync might occur\n"); + if (multiple_edits && !mov->advanced_editlist) { + if (mov->advanced_editlist_autodisabled) + av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " + "not supported in fragmented MP4 files\n"); + else + av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " + "Use -advanced_editlist to correctly decode otherwise " + "a/v desync might occur\n"); + } /* adjust first dts according to edit list */ if ((empty_duration || start_time) && mov->time_scale > 0) { @@ -4162,6 +4192,13 @@ if (keyframe) distance = 0; sample_size = sc->stsz_sample_size > 0 ? sc->stsz_sample_size : sc->sample_sizes[current_sample]; + if (current_offset > INT64_MAX - sample_size) { + av_log(mov->fc, AV_LOG_ERROR, "Current offset %"PRId64" or sample size %u is too large\n", + current_offset, + sample_size); + return; + } + if (sc->pseudo_stream_id == -1 || sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) { AVIndexEntry *e; @@ -4474,6 +4511,23 @@ avpriv_set_pts_info(st, 64, 1, sc->time_scale); + /* + * Advanced edit list support does not work with fragemented MP4s, which + * have stsc, stsz, stco, and stts with zero entries in the moov atom. + * In these files, trun atoms may be streamed in. + * + * It cannot be used with use_mfra_for = {pts,dts} either, as the index + * is not complete, but filled in as more trun atoms are read, as well. + */ + if (!sc->stts_count || c->use_mfra_for != FF_MOV_FLAG_MFRA_AUTO && + c->advanced_editlist) { + + av_log(c->fc, AV_LOG_VERBOSE, "advanced_editlist does not work with fragmented " + "MP4. disabling.\n"); + c->advanced_editlist = 0; + c->advanced_editlist_autodisabled = 1; + } + mov_build_index(c, st); if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) { @@ -4691,6 +4745,69 @@ return ret; } +static int avif_add_stream(MOVContext *c, int item_id) +{ + MOVStreamContext *sc; + AVStream *st; + int item_index = -1; + for (int i = 0; i < c->avif_info_size; i++) + if (c->avif_info[i].item_id == item_id) { + item_index = i; + break; + } + if (item_index < 0) + return AVERROR_INVALIDDATA; + st = avformat_new_stream(c->fc, NULL); + if (!st) + return AVERROR(ENOMEM); + st->id = c->fc->nb_streams; + sc = av_mallocz(sizeof(MOVStreamContext)); + if (!sc) + return AVERROR(ENOMEM); + + st->priv_data = sc; + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + st->codecpar->codec_id = AV_CODEC_ID_AV1; + sc->ffindex = st->index; + c->trak_index = st->index; + st->avg_frame_rate.num = st->avg_frame_rate.den = 1; + st->time_base.num = st->time_base.den = 1; + st->nb_frames = 1; + sc->time_scale = 1; + sc = st->priv_data; + sc->pb = c->fc->pb; + sc->pb_is_copied = 1; + + // Populate the necessary fields used by mov_build_index. + sc->stsc_count = 1; + sc->stsc_data = av_malloc_array(1, sizeof(*sc->stsc_data)); + if (!sc->stsc_data) + return AVERROR(ENOMEM); + sc->stsc_data[0].first = 1; + sc->stsc_data[0].count = 1; + sc->stsc_data[0].id = 1; + sc->chunk_count = 1; + sc->chunk_offsets = av_malloc_array(1, sizeof(*sc->chunk_offsets)); + if (!sc->chunk_offsets) + return AVERROR(ENOMEM); + sc->sample_count = 1; + sc->sample_sizes = av_malloc_array(1, sizeof(*sc->sample_sizes)); + if (!sc->sample_sizes) + return AVERROR(ENOMEM); + sc->stts_count = 1; + sc->stts_data = av_malloc_array(1, sizeof(*sc->stts_data)); + if (!sc->stts_data) + return AVERROR(ENOMEM); + sc->stts_data[0].count = 1; + // Not used for still images. But needed by mov_build_index. + sc->stts_data[0].duration = 0; + sc->sample_sizes[0] = c->avif_info[item_index].extent_length; + sc->chunk_offsets[0] = c->avif_info[item_index].extent_offset; + + mov_build_index(c, st); + return 0; +} + static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) { while (atom.size > 8) { @@ -4700,9 +4817,23 @@ tag = avio_rl32(pb); atom.size -= 4; if (tag == MKTAG('h','d','l','r')) { + int ret; avio_seek(pb, -8, SEEK_CUR); atom.size += 8; - return mov_read_default(c, pb, atom); + if ((ret = mov_read_default(c, pb, atom)) < 0) + return ret; + if (c->is_still_picture_avif) { + int ret; + // Add a stream for the YUV planes (primary item). + if ((ret = avif_add_stream(c, c->primary_item_id)) < 0) + return ret; + // For still AVIF images, the meta box contains all the + // necessary information that would generally be provided by the + // moov box. So simply mark that we have found the moov box so + // that parsing can continue. + c->found_moov = 1; + } + return ret; } } return 0; @@ -4861,9 +4992,10 @@ av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags); frag_stream_info = get_current_frag_stream_info(&c->frag_index); - if (frag_stream_info) + if (frag_stream_info) { frag_stream_info->next_trun_dts = AV_NOPTS_VALUE; - + frag_stream_info->stsd_id = frag->stsd_id; + } return 0; } @@ -5118,8 +5250,11 @@ sc->ctts_count = sti->nb_index_entries; // Record the index_entry position in frag_index of this fragment - if (frag_stream_info) + if (frag_stream_info) { frag_stream_info->index_entry = index_entry_pos; + if (frag_stream_info->index_base < 0) + frag_stream_info->index_base = index_entry_pos; + } if (index_entry_pos > 0) prev_dts = sti->index_entries[index_entry_pos-1].timestamp; @@ -7088,6 +7223,31 @@ } } +static MOVFragmentStreamInfo *get_frag_stream_info_from_pkt(MOVFragmentIndex *frag_index, AVPacket *pkt, int id) +{ + int current = frag_index->current; + + if (!frag_index->nb_items) + return NULL; + + // Check frag_index->current is the right one for pkt. It can out of sync. + if (current >= 0 && current < frag_index->nb_items) { + if (frag_index->item[current].moof_offset < pkt->pos && + (current + 1 == frag_index->nb_items || + frag_index->item[current + 1].moof_offset > pkt->pos)) + return get_frag_stream_info(frag_index, current, id); + } + + + for (int i = 0; i < frag_index->nb_items; i++) { + if (frag_index->item[i].moof_offset > pkt->pos) + break; + current = i; + } + frag_index->current = current; + return get_frag_stream_info(frag_index, current, id); +} + static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPacket *pkt, int current_index) { MOVFragmentStreamInfo *frag_stream_info; @@ -7095,16 +7255,14 @@ AVEncryptionInfo *encrypted_sample; int encrypted_index, ret; - frag_stream_info = get_frag_stream_info(&mov->frag_index, mov->frag_index.current, st->id); + frag_stream_info = get_frag_stream_info_from_pkt(&mov->frag_index, pkt, st->id); encrypted_index = current_index; encryption_index = NULL; if (frag_stream_info) { // Note this only supports encryption info in the first sample descriptor. - if (mov->fragment.stsd_id == 1) { + if (frag_stream_info->stsd_id == 1) { if (frag_stream_info->encryption_index) { - if (!current_index && frag_stream_info->index_entry) - sc->cenc.frag_index_entry_base = frag_stream_info->index_entry; - encrypted_index = current_index - (frag_stream_info->index_entry - sc->cenc.frag_index_entry_base); + encrypted_index = current_index - frag_stream_info->index_base; encryption_index = frag_stream_info->encryption_index; } else { encryption_index = sc->cenc.encryption_index; @@ -7471,8 +7629,6 @@ int item_count, extent_count; uint64_t base_offset, extent_offset, extent_length; uint8_t value; - AVStream *st; - MOVStreamContext *sc; if (!c->is_still_picture_avif) { // * For non-avif, we simply ignore the iloc box. @@ -7486,27 +7642,6 @@ return 0; } - st = avformat_new_stream(c->fc, NULL); - if (!st) - return AVERROR(ENOMEM); - st->id = c->fc->nb_streams; - sc = av_mallocz(sizeof(MOVStreamContext)); - if (!sc) - return AVERROR(ENOMEM); - - st->priv_data = sc; - st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; - st->codecpar->codec_id = AV_CODEC_ID_AV1; - sc->ffindex = st->index; - c->trak_index = st->index; - st->avg_frame_rate.num = st->avg_frame_rate.den = 1; - st->time_base.num = st->time_base.den = 1; - st->nb_frames = 1; - sc->time_scale = 1; - sc = st->priv_data; - sc->pb = c->fc->pb; - sc->pb_is_copied = 1; - version = avio_r8(pb); avio_rb24(pb); // flags. @@ -7522,34 +7657,17 @@ } item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); - // Populate the necessary fields used by mov_build_index. - sc->stsc_count = 1; - sc->stsc_data = av_malloc_array(1, sizeof(*sc->stsc_data)); - if (!sc->stsc_data) - return AVERROR(ENOMEM); - sc->stsc_data[0].first = 1; - sc->stsc_data[0].count = 1; - sc->stsc_data[0].id = 1; - sc->chunk_count = 1; - sc->chunk_offsets = av_malloc_array(1, sizeof(*sc->chunk_offsets)); - if (!sc->chunk_offsets) - return AVERROR(ENOMEM); - sc->sample_count = 1; - sc->sample_sizes = av_malloc_array(1, sizeof(*sc->sample_sizes)); - if (!sc->sample_sizes) + c->avif_info = av_malloc_array(item_count, sizeof(*c->avif_info)); + if (!c->avif_info) return AVERROR(ENOMEM); - sc->stts_count = 1; - sc->stts_data = av_malloc_array(1, sizeof(*sc->stts_data)); - if (!sc->stts_data) - return AVERROR(ENOMEM); - sc->stts_data[0].count = 1; - // Not used for still images. But needed by mov_build_index. - sc->stts_data[0].duration = 0; + c->avif_info_size = item_count; for (int i = 0; i < item_count; i++) { int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); if (avio_feof(pb)) return AVERROR_INVALIDDATA; + c->avif_info[i].item_id = item_id; + if (version > 0) avio_rb16(pb); // construction_method. avio_rb16(pb); // data_reference_index. @@ -7565,20 +7683,11 @@ if (rb_size(pb, &extent_offset, offset_size) < 0 || rb_size(pb, &extent_length, length_size) < 0) return AVERROR_INVALIDDATA; - if (item_id == c->primary_item_id) { - sc->sample_sizes[0] = extent_length; - sc->chunk_offsets[0] = base_offset + extent_offset; - } + c->avif_info[i].extent_length = extent_length; + c->avif_info[i].extent_offset = base_offset + extent_offset; } } - mov_build_index(c, st); - - // For still AVIF images, the iloc box contains all the necessary - // information that would generally be provided by the moov box. So simply - // mark that we have found the moov box so that parsing can continue. - c->found_moov = 1; - return atom.size; } @@ -8182,6 +8291,7 @@ av_freep(&mov->aes_decrypt); av_freep(&mov->chapter_tracks); + av_freep(&mov->avif_info); return 0; } @@ -8703,7 +8813,7 @@ } #if CONFIG_DV_DEMUXER if (mov->dv_demux && sc->dv_audio_container) { - ret = avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos); + ret = avpriv_dv_produce_packet(mov->dv_demux, NULL, pkt->data, pkt->size, pkt->pos); av_packet_unref(pkt); if (ret < 0) return ret; @@ -8799,7 +8909,7 @@ if (!mov->frag_index.complete) return 0; - index = search_frag_timestamp(&mov->frag_index, st, timestamp); + index = search_frag_timestamp(s, &mov->frag_index, st, timestamp); if (index < 0) index = 0; if (!mov->frag_index.item[index].headers_read) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov_chan.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov_chan.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov_chan.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mov_chan.c 2023-03-03 13:29:59.000000000 +0000 @@ -172,11 +172,7 @@ { MOV_CH_LAYOUT_OCTAGONAL, AV_CH_LAYOUT_OCTAGONAL }, // L, R, Rls, Rrs, C, Cs, Ls, Rs { MOV_CH_LAYOUT_AAC_OCTAGONAL, AV_CH_LAYOUT_OCTAGONAL }, // C, L, R, Ls, Rs, Rls, Rrs, Cs - { MOV_CH_LAYOUT_CUBE, AV_CH_LAYOUT_QUAD | // L, R, Rls, Rrs, Vhl, Vhr, Rlt, Rrt - AV_CH_TOP_FRONT_LEFT | - AV_CH_TOP_FRONT_RIGHT | - AV_CH_TOP_BACK_LEFT | - AV_CH_TOP_BACK_RIGHT }, + { MOV_CH_LAYOUT_CUBE, AV_CH_LAYOUT_CUBE }, // L, R, Rls, Rrs, Vhl, Vhr, Rlt, Rrt { MOV_CH_LAYOUT_MPEG_7_1_A, AV_CH_LAYOUT_7POINT1_WIDE }, // L, R, C, LFE, Ls, Rs, Lc, Rc { MOV_CH_LAYOUT_MPEG_7_1_B, AV_CH_LAYOUT_7POINT1_WIDE }, // C, Lc, Rc, L, R, Ls, Rs, LFE diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,6 +47,7 @@ #include "internal.h" #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" +#include "libavutil/csp.h" #include "libavutil/intfloat.h" #include "libavutil/mathematics.h" #include "libavutil/libm.h" @@ -56,7 +57,6 @@ #include "libavutil/stereo3d.h" #include "libavutil/timecode.h" #include "libavutil/dovi_meta.h" -#include "libavutil/color_utils.h" #include "libavutil/uuid.h" #include "hevc.h" #include "rtpenc.h" @@ -1241,13 +1241,7 @@ avio_wb16(pb, 16); avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */ } else { /* reserved for mp4/3gp */ - if (track->par->codec_id == AV_CODEC_ID_FLAC || - track->par->codec_id == AV_CODEC_ID_ALAC || - track->par->codec_id == AV_CODEC_ID_OPUS) { - avio_wb16(pb, track->par->ch_layout.nb_channels); - } else { - avio_wb16(pb, 2); - } + avio_wb16(pb, track->par->ch_layout.nb_channels); if (track->par->codec_id == AV_CODEC_ID_FLAC || track->par->codec_id == AV_CODEC_ID_ALAC) { avio_wb16(pb, track->par->bits_per_raw_sample); @@ -1375,7 +1369,8 @@ ffio_wfourcc(pb, "vpcC"); avio_w8(pb, 1); /* version */ avio_wb24(pb, 0); /* flags */ - ff_isom_write_vpcc(s, pb, track->par); + ff_isom_write_vpcc(s, pb, track->vos_data, track->vos_len, track->par); + return update_size(pb, pos); } @@ -2010,9 +2005,8 @@ static int mov_write_gama_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track, double gamma) { uint32_t gama = 0; - if (gamma <= 0.0) { - gamma = avpriv_get_gamma_from_trc(track->par->color_trc); - } + if (gamma <= 0.0) + gamma = av_csp_approximate_trc_gamma(track->par->color_trc); av_log(s, AV_LOG_DEBUG, "gamma value %g\n", gamma); if (gamma > 1e-6) { @@ -2179,6 +2173,16 @@ return update_size(pb, pos); } +static int mov_write_aux_tag(AVIOContext *pb, const char *aux_type) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, aux_type); + avio_wb32(pb, 0); /* Version & flags */ + avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); + return update_size(pb, pos); +} + static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int ret = AVERROR_BUG; @@ -2319,10 +2323,11 @@ av_stream_get_side_data(track->st, AV_PKT_DATA_ICC_PROFILE, NULL)) { int prefer_icc = mov->flags & FF_MOV_FLAG_PREFER_ICC || !has_color_info; mov_write_colr_tag(pb, track, prefer_icc); - } else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) { - av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format is not MOV or MP4.\n"); } + } else if (mov->flags & FF_MOV_FLAG_WRITE_COLR) { + av_log(mov->fc, AV_LOG_WARNING, "Not writing 'colr' atom. Format is not MOV or MP4 or AVIF.\n"); } + if (track->mode == MODE_MOV || track->mode == MODE_MP4) { mov_write_clli_tag(pb, track); mov_write_mdcv_tag(pb, track); @@ -2363,8 +2368,11 @@ if (avid) avio_wb32(pb, 0); - if (track->mode == MODE_AVIF) + if (track->mode == MODE_AVIF) { mov_write_ccst_tag(pb); + if (s->nb_streams > 0 && track == &mov->tracks[1]) + mov_write_aux_tag(pb, "auxi"); + } return update_size(pb, pos); } @@ -3044,16 +3052,6 @@ return update_size(pb, pos); } -static int mov_write_auxC_tag(AVIOContext *pb) -{ - int64_t pos = avio_tell(pb); - avio_wb32(pb, 0); /* size */ - ffio_wfourcc(pb, "auxC"); - avio_wb32(pb, 0); /* Version & flags */ - avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); - return update_size(pb, pos); -} - static int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { int64_t pos = avio_tell(pb); @@ -3066,7 +3064,7 @@ if (!i) mov_write_colr_tag(pb, &mov->tracks[0], 0); else - mov_write_auxC_tag(pb); + mov_write_aux_tag(pb, "auxC"); } return update_size(pb, pos); } @@ -3282,7 +3280,7 @@ int64_t duration = av_rescale_rnd(calc_pts_duration(mov, track), mov->movie_timescale, track->timescale, AV_ROUND_UP); - int version = duration < INT32_MAX ? 0 : 1; + int version; int flags = MOV_TKHD_FLAG_IN_MOVIE; int group = 0; @@ -3290,6 +3288,14 @@ size_t display_matrix_size; int i; + if (mov->mode == MODE_AVIF) + if (!mov->avif_loop_count) + duration = INT64_MAX; + else + duration *= mov->avif_loop_count; + + version = duration < INT32_MAX ? 0 : 1; + if (st) { if (mov->per_stream_grouping) group = st->index; @@ -3409,7 +3415,10 @@ return update_size(pb, pos); } -// This box seems important for the psp playback ... without it the movie seems to hang +// This box is written in the following cases: +// * Seems important for the psp playback. Without it the movie seems to hang. +// * Used for specifying the looping behavior of animated AVIF (as specified +// in Section 9.6 of the HEIF specification ISO/IEC 23008-12). static int mov_write_edts_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { @@ -3420,6 +3429,7 @@ int entry_size, entry_count, size; int64_t delay, start_ct = track->start_cts; int64_t start_dts = track->start_dts; + int flags = 0; if (track->entry) { if (start_dts != track->cluster[0].dts || start_ct != track->cluster[0].cts) { @@ -3435,6 +3445,17 @@ delay = av_rescale_rnd(start_dts + start_ct, mov->movie_timescale, track->timescale, AV_ROUND_DOWN); + + if (mov->mode == MODE_AVIF) { + delay = 0; + // Section 9.6.3 of ISO/IEC 23008-12: flags specifies repetition of the + // edit list as follows: (flags & 1) equal to 0 specifies that the edit + // list is not repeated, while (flags & 1) equal to 1 specifies that the + // edit list is repeated. + flags = mov->avif_loop_count != 1; + start_ct = 0; + } + version |= delay < INT32_MAX ? 0 : 1; entry_size = (version == 1) ? 20 : 12; @@ -3447,7 +3468,7 @@ avio_wb32(pb, size - 8); ffio_wfourcc(pb, "elst"); avio_w8(pb, version); - avio_wb24(pb, 0); /* flags */ + avio_wb24(pb, flags); /* flags */ avio_wb32(pb, entry_count); if (delay > 0) { /* add an empty edit to delay presentation */ @@ -3464,7 +3485,7 @@ avio_wb32(pb, -1); } avio_wb32(pb, 0x00010000); - } else { + } else if (mov->mode != MODE_AVIF) { /* Avoid accidentally ending up with start_ct = -1 which has got a * special meaning. Normally start_ct should end up positive or zero * here, but use FFMIN in case dts is a small positive integer @@ -3665,6 +3686,9 @@ "Not writing any edit list even though one would have been required\n"); } + if (mov->is_animated_avif) + mov_write_edts_tag(pb, mov, track); + if (track->tref_tag) mov_write_tref_tag(pb, track); @@ -4106,7 +4130,7 @@ static int mov_write_mdta_keys_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int64_t pos = avio_tell(pb); int64_t curpos, entry_pos; int count = 0; @@ -4117,7 +4141,7 @@ entry_pos = avio_tell(pb); avio_wb32(pb, 0); /* entry count */ - while (t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)) { + while (t = av_dict_iterate(s->metadata, t)) { size_t key_len = strlen(t->key); avio_wb32(pb, key_len + 8); ffio_wfourcc(pb, "mdta"); @@ -4135,14 +4159,14 @@ static int mov_write_mdta_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int64_t pos = avio_tell(pb); int count = 1; /* keys are 1-index based */ avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "ilst"); - while (t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)) { + while (t = av_dict_iterate(s->metadata, t)) { int64_t entry_pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ avio_wb32(pb, count); /* key */ @@ -6030,6 +6054,7 @@ if ((par->codec_id == AV_CODEC_ID_DNXHD || par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_HEVC || + par->codec_id == AV_CODEC_ID_VP9 || par->codec_id == AV_CODEC_ID_TRUEHD) && !trk->vos_len && !TAG_IS_AVCI(trk->tag)) { /* copy frame to create needed atoms */ @@ -7160,7 +7185,7 @@ av_log(s, AV_LOG_ERROR, "%s only supported in MP4.\n", avcodec_get_name(track->par->codec_id)); return AVERROR(EINVAL); } - if (track->par->codec_id != AV_CODEC_ID_OPUS && + if (track->par->codec_id == AV_CODEC_ID_TRUEHD && s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(s, AV_LOG_ERROR, "%s in MP4 support is experimental, add " @@ -7752,6 +7777,12 @@ }; #if CONFIG_AVIF_MUXER + +static const AVOption avif_options[] = { + { "movie_timescale", "set movie timescale", offsetof(MOVMuxContext, movie_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + { "loop", "Number of times to loop animated AVIF: 0 - infinite loop", offsetof(MOVMuxContext, avif_loop_count), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 0 }, + { NULL }, +}; static const AVCodecTag codec_avif_tags[] = { { AV_CODEC_ID_AV1, MKTAG('a','v','0','1') }, { AV_CODEC_ID_NONE, 0 }, @@ -7761,187 +7792,188 @@ static const AVClass mov_avif_muxer_class = { .class_name = "avif muxer", .item_name = av_default_item_name, + .option = avif_options, .version = LIBAVUTIL_VERSION_INT, }; #endif #if CONFIG_MOV_MUXER -const AVOutputFormat ff_mov_muxer = { - .name = "mov", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), - .extensions = "mov", +const FFOutputFormat ff_mov_muxer = { + .p.name = "mov", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), + .p.extensions = "mov", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = CONFIG_LIBX264_ENCODER ? + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = (const AVCodecTag* const []){ ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_TGP_MUXER -const AVOutputFormat ff_tgp_muxer = { - .name = "3gp", - .long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"), - .extensions = "3gp", +const FFOutputFormat ff_tgp_muxer = { + .p.name = "3gp", + .p.long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"), + .p.extensions = "3gp", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AMR_NB, - .video_codec = AV_CODEC_ID_H263, + .p.audio_codec = AV_CODEC_ID_AMR_NB, + .p.video_codec = AV_CODEC_ID_H263, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = codec_3gp_tags_list, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_MP4_MUXER -const AVOutputFormat ff_mp4_muxer = { - .name = "mp4", - .long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"), - .mime_type = "video/mp4", - .extensions = "mp4", +const FFOutputFormat ff_mp4_muxer = { + .p.name = "mp4", + .p.long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"), + .p.mime_type = "video/mp4", + .p.extensions = "mp4", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = CONFIG_LIBX264_ENCODER ? + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = mp4_codec_tags_list, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_PSP_MUXER -const AVOutputFormat ff_psp_muxer = { - .name = "psp", - .long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"), - .extensions = "mp4,psp", +const FFOutputFormat ff_psp_muxer = { + .p.name = "psp", + .p.long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"), + .p.extensions = "mp4,psp", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = CONFIG_LIBX264_ENCODER ? + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = mp4_codec_tags_list, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_TG2_MUXER -const AVOutputFormat ff_tg2_muxer = { - .name = "3g2", - .long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"), - .extensions = "3g2", +const FFOutputFormat ff_tg2_muxer = { + .p.name = "3g2", + .p.long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"), + .p.extensions = "3g2", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AMR_NB, - .video_codec = AV_CODEC_ID_H263, + .p.audio_codec = AV_CODEC_ID_AMR_NB, + .p.video_codec = AV_CODEC_ID_H263, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = codec_3gp_tags_list, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_IPOD_MUXER -const AVOutputFormat ff_ipod_muxer = { - .name = "ipod", - .long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"), - .mime_type = "video/mp4", - .extensions = "m4v,m4a,m4b", +const FFOutputFormat ff_ipod_muxer = { + .p.name = "ipod", + .p.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"), + .p.mime_type = "video/mp4", + .p.extensions = "m4v,m4a,m4b", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 }, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_ISMV_MUXER -const AVOutputFormat ff_ismv_muxer = { - .name = "ismv", - .long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"), - .mime_type = "video/mp4", - .extensions = "ismv,isma", +const FFOutputFormat ff_ismv_muxer = { + .p.name = "ismv", + .p.long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"), + .p.mime_type = "video/mp4", + .p.extensions = "ismv,isma", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, codec_ism_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_F4V_MUXER -const AVOutputFormat ff_f4v_muxer = { - .name = "f4v", - .long_name = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"), - .mime_type = "application/f4v", - .extensions = "f4v", +const FFOutputFormat ff_f4v_muxer = { + .p.name = "f4v", + .p.long_name = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"), + .p.mime_type = "application/f4v", + .p.extensions = "f4v", .priv_data_size = sizeof(MOVMuxContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = mov_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH, - .codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 }, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH, + .p.codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_isobmff_muxer_class, + .p.priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_AVIF_MUXER -const AVOutputFormat ff_avif_muxer = { - .name = "avif", - .long_name = NULL_IF_CONFIG_SMALL("AVIF"), - .mime_type = "image/avif", - .extensions = "avif", +const FFOutputFormat ff_avif_muxer = { + .p.name = "avif", + .p.long_name = NULL_IF_CONFIG_SMALL("AVIF"), + .p.mime_type = "image/avif", + .p.extensions = "avif", .priv_data_size = sizeof(MOVMuxContext), - .video_codec = AV_CODEC_ID_AV1, + .p.video_codec = AV_CODEC_ID_AV1, .init = mov_init, .write_header = mov_write_header, .write_packet = mov_write_packet, .write_trailer = avif_write_trailer, .deinit = mov_free, - .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH, - .codec_tag = codec_avif_tags_list, - .priv_class = &mov_avif_muxer_class, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH, + .p.codec_tag = codec_avif_tags_list, + .p.priv_class = &mov_avif_muxer_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/movenc.h 2023-03-03 13:29:59.000000000 +0000 @@ -249,6 +249,7 @@ int64_t avif_extent_pos[2]; // index 0 is YUV and 1 is Alpha. int avif_extent_length[2]; // index 0 is YUV and 1 is Alpha. int is_animated_avif; + int avif_loop_count; } MOVMuxContext; #define FF_MOV_FLAG_RTP_HINT (1 << 0) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -408,18 +408,11 @@ ffio_ensure_seekback(s->pb, i + 1024 + 4); frame_size = check(s->pb, off + i, &header); if (frame_size > 0) { - ret = avio_seek(s->pb, off, SEEK_SET); - if (ret < 0) - return ret; ffio_ensure_seekback(s->pb, i + 1024 + frame_size + 4); ret = check(s->pb, off + i + frame_size, &header2); if (ret >= 0 && (header & MP3_MASK) == (header2 & MP3_MASK)) { - av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_VERBOSE, "Skipping %d bytes of junk at %"PRId64".\n", i, off); - ret = avio_seek(s->pb, off + i, SEEK_SET); - if (ret < 0) - return ret; break; } else if (ret == CHECK_SEEK_FAILED) { av_log(s, AV_LOG_ERROR, "Invalid frame size (%d): Could not seek to %"PRId64".\n", frame_size, off + i + frame_size); @@ -429,12 +422,16 @@ av_log(s, AV_LOG_ERROR, "Failed to read frame size: Could not seek to %"PRId64".\n", (int64_t) (i + 1024 + frame_size + 4)); return AVERROR(EINVAL); } - ret = avio_seek(s->pb, off, SEEK_SET); - if (ret < 0) - return ret; } + if (i == 64 * 1024) { + off = avio_seek(s->pb, off, SEEK_SET); + } else { + av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_VERBOSE, "Skipping %d bytes of junk at %"PRId64".\n", i, off); + off = avio_seek(s->pb, off + i, SEEK_SET); + } + if (off < 0) + return off; - off = avio_tell(s->pb); // the seek index is relative to the end of the xing vbr headers for (int i = 0; i < sti->nb_index_entries; i++) sti->index_entries[i].pos += off; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mp3enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "avio_internal.h" #include "id3v1.h" #include "id3v2.h" +#include "mux.h" #include "rawenc.h" #include "libavutil/avstring.h" #include "libavcodec/mpegaudio.h" @@ -636,20 +637,20 @@ av_freep(&mp3->xing_frame); } -const AVOutputFormat ff_mp3_muxer = { - .name = "mp3", - .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), - .mime_type = "audio/mpeg", - .extensions = "mp3", +const FFOutputFormat ff_mp3_muxer = { + .p.name = "mp3", + .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), + .p.mime_type = "audio/mpeg", + .p.extensions = "mp3", .priv_data_size = sizeof(MP3Context), - .audio_codec = AV_CODEC_ID_MP3, - .video_codec = AV_CODEC_ID_PNG, + .p.audio_codec = AV_CODEC_ID_MP3, + .p.video_codec = AV_CODEC_ID_PNG, .init = mp3_init, .write_header = mp3_write_header, .write_packet = mp3_write_packet, .write_trailer = mp3_write_trailer, .deinit = mp3_deinit, .query_codec = query_codec, - .flags = AVFMT_NOTIMESTAMPS, - .priv_class = &mp3_muxer_class, + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &mp3_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpc8.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpc8.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpc8.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpc8.c 2023-03-03 13:29:59.000000000 +0000 @@ -135,37 +135,40 @@ *size += pos; } -static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) +static int mpc8_parse_seektable(AVFormatContext *s, int64_t off) { MPCContext *c = s->priv_data; int tag; int64_t size, pos, ppos[2]; uint8_t *buf; int i, t, seekd, ret; + int64_t ret64; GetBitContext gb; if (s->nb_streams == 0) { av_log(s, AV_LOG_ERROR, "No stream added before parsing seek table\n"); - return; + return AVERROR_INVALIDDATA; } - avio_seek(s->pb, off, SEEK_SET); + ret64 = avio_seek(s->pb, off, SEEK_SET); + if (ret64 < 0) + return AVERROR_INVALIDDATA; mpc8_get_chunk_header(s->pb, &tag, &size); - if(tag != TAG_SEEKTABLE){ + if(tag != TAG_SEEKTABLE || avio_feof(s->pb)){ av_log(s, AV_LOG_ERROR, "No seek table at given position\n"); - return; + return AVERROR_INVALIDDATA; } if (size > INT_MAX/10 || size<=0) { av_log(s, AV_LOG_ERROR, "Bad seek table size\n"); - return; + return AVERROR_INVALIDDATA; } if(!(buf = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE))) - return; + return AVERROR(ENOMEM); ret = avio_read(s->pb, buf, size); if (ret != size) { av_log(s, AV_LOG_ERROR, "seek table truncated\n"); av_free(buf); - return; + return AVERROR_INVALIDDATA; } memset(buf+size, 0, AV_INPUT_BUFFER_PADDING_SIZE); @@ -174,14 +177,14 @@ if(size > UINT_MAX/4 || size > c->samples/1152){ av_log(s, AV_LOG_ERROR, "Seek table is too big\n"); av_free(buf); - return; + return AVERROR_INVALIDDATA; } seekd = get_bits(&gb, 4); for(i = 0; i < 2; i++){ pos = gb_get_v(&gb); if (av_sat_add64(pos, c->header_pos) != pos + (uint64_t)c->header_pos) { av_free(buf); - return; + return AVERROR_INVALIDDATA; } pos += c->header_pos; @@ -191,7 +194,7 @@ for(; i < size; i++){ if (get_bits_left(&gb) < 13) { av_free(buf); - return; + return AVERROR_INVALIDDATA; } t = get_unary(&gb, 1, 33) << 12; t += get_bits(&gb, 12); @@ -203,26 +206,31 @@ ppos[0] = pos; } av_free(buf); + return 0; } -static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, int64_t size) +static int mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, int64_t size) { AVIOContext *pb = s->pb; int64_t pos, off; + int ret; switch(tag){ case TAG_SEEKTBLOFF: pos = avio_tell(pb); off = ffio_read_varlen(pb); if (pos > INT64_MAX - size || off < 0 || off > INT64_MAX - chunk_pos) - return; + return AVERROR_INVALIDDATA; pos += size; - mpc8_parse_seektable(s, chunk_pos + off); + ret = mpc8_parse_seektable(s, chunk_pos + off); + if (ret < 0) + return AVERROR_INVALIDDATA; avio_seek(pb, pos, SEEK_SET); break; default: avio_skip(pb, size); } + return 0; } static int mpc8_read_header(AVFormatContext *s) @@ -249,7 +257,9 @@ } if(tag == TAG_STREAMHDR) break; - mpc8_handle_chunk(s, tag, pos, size); + ret = mpc8_handle_chunk(s, tag, pos, size); + if (ret < 0) + return ret; } if(tag != TAG_STREAMHDR){ av_log(s, AV_LOG_ERROR, "Stream header not found\n"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,6 +35,7 @@ #include "avio_internal.h" #include "internal.h" #include "mpeg.h" +#include "mux.h" #define MAX_PAYLOAD_SIZE 4096 @@ -86,10 +87,10 @@ int preload; } MpegMuxContext; -extern const AVOutputFormat ff_mpeg1vcd_muxer; -extern const AVOutputFormat ff_mpeg2dvd_muxer; -extern const AVOutputFormat ff_mpeg2svcd_muxer; -extern const AVOutputFormat ff_mpeg2vob_muxer; +extern const FFOutputFormat ff_mpeg1vcd_muxer; +extern const FFOutputFormat ff_mpeg2dvd_muxer; +extern const FFOutputFormat ff_mpeg2svcd_muxer; +extern const FFOutputFormat ff_mpeg2vob_muxer; static int put_pack_header(AVFormatContext *ctx, uint8_t *buf, int64_t timestamp) @@ -307,12 +308,12 @@ int video_bitrate; s->packet_number = 0; - s->is_vcd = (CONFIG_MPEG1VCD_MUXER && ctx->oformat == &ff_mpeg1vcd_muxer); - s->is_svcd = (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer); - s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER && ctx->oformat == &ff_mpeg2vob_muxer) || - (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer) || - (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer)); - s->is_dvd = (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer); + s->is_vcd = (CONFIG_MPEG1VCD_MUXER && ctx->oformat == &ff_mpeg1vcd_muxer.p); + s->is_svcd = (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p); + s->is_mpeg2 = ((CONFIG_MPEG2VOB_MUXER && ctx->oformat == &ff_mpeg2vob_muxer.p) || + (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer.p) || + (CONFIG_MPEG2SVCD_MUXER && ctx->oformat == &ff_mpeg2svcd_muxer.p)); + s->is_dvd = (CONFIG_MPEG2DVD_MUXER && ctx->oformat == &ff_mpeg2dvd_muxer.p); if (ctx->packet_size) { if (ctx->packet_size < 20 || ctx->packet_size > (1 << 23) + 10) { @@ -1293,87 +1294,87 @@ }; #if CONFIG_MPEG1SYSTEM_MUXER -const AVOutputFormat ff_mpeg1system_muxer = { - .name = "mpeg", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"), - .mime_type = "video/mpeg", - .extensions = "mpg,mpeg", +const FFOutputFormat ff_mpeg1system_muxer = { + .p.name = "mpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"), + .p.mime_type = "video/mpeg", + .p.extensions = "mpg,mpeg", .priv_data_size = sizeof(MpegMuxContext), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG1VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG1VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .deinit = mpeg_mux_deinit, - .priv_class = &mpeg_class, + .p.priv_class = &mpeg_class, }; #endif #if CONFIG_MPEG1VCD_MUXER -const AVOutputFormat ff_mpeg1vcd_muxer = { - .name = "vcd", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"), - .mime_type = "video/mpeg", +const FFOutputFormat ff_mpeg1vcd_muxer = { + .p.name = "vcd", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"), + .p.mime_type = "video/mpeg", .priv_data_size = sizeof(MpegMuxContext), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG1VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG1VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .deinit = mpeg_mux_deinit, - .priv_class = &mpeg_class, + .p.priv_class = &mpeg_class, }; #endif #if CONFIG_MPEG2VOB_MUXER -const AVOutputFormat ff_mpeg2vob_muxer = { - .name = "vob", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"), - .mime_type = "video/mpeg", - .extensions = "vob", +const FFOutputFormat ff_mpeg2vob_muxer = { + .p.name = "vob", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (VOB)"), + .p.mime_type = "video/mpeg", + .p.extensions = "vob", .priv_data_size = sizeof(MpegMuxContext), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .deinit = mpeg_mux_deinit, - .priv_class = &mpeg_class, + .p.priv_class = &mpeg_class, }; #endif /* Same as mpeg2vob_mux except that the pack size is 2324 */ #if CONFIG_MPEG2SVCD_MUXER -const AVOutputFormat ff_mpeg2svcd_muxer = { - .name = "svcd", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"), - .mime_type = "video/mpeg", - .extensions = "vob", +const FFOutputFormat ff_mpeg2svcd_muxer = { + .p.name = "svcd", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"), + .p.mime_type = "video/mpeg", + .p.extensions = "vob", .priv_data_size = sizeof(MpegMuxContext), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .deinit = mpeg_mux_deinit, - .priv_class = &mpeg_class, + .p.priv_class = &mpeg_class, }; #endif /* Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */ #if CONFIG_MPEG2DVD_MUXER -const AVOutputFormat ff_mpeg2dvd_muxer = { - .name = "dvd", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"), - .mime_type = "video/mpeg", - .extensions = "dvd", +const FFOutputFormat ff_mpeg2dvd_muxer = { + .p.name = "dvd", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (DVD VOB)"), + .p.mime_type = "video/mpeg", + .p.extensions = "dvd", .priv_data_size = sizeof(MpegMuxContext), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .write_header = mpeg_mux_init, .write_packet = mpeg_mux_write_packet, .write_trailer = mpeg_mux_end, .deinit = mpeg_mux_deinit, - .priv_class = &mpeg_class, + .p.priv_class = &mpeg_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegts.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegts.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegts.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegts.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "libavutil/opt.h" #include "libavutil/avassert.h" #include "libavutil/dovi_meta.h" +#include "libavcodec/avcodec.h" #include "libavcodec/bytestream.h" #include "libavcodec/get_bits.h" #include "libavcodec/opus.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegtsenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegtsenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegtsenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpegtsenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,6 +28,9 @@ #include "libavutil/opt.h" #include "libavcodec/ac3_parser_internal.h" +#include "libavcodec/avcodec.h" +#include "libavcodec/bytestream.h" +#include "libavcodec/h264.h" #include "libavcodec/startcode.h" #include "avformat.h" @@ -111,6 +114,7 @@ #define MPEGTS_FLAG_SYSTEM_B 0x08 #define MPEGTS_FLAG_DISCONT 0x10 #define MPEGTS_FLAG_NIT 0x20 +#define MPEGTS_FLAG_OMIT_RAI 0x40 int flags; int copyts; int tables_version; @@ -1565,7 +1569,8 @@ q = get_ts_payload_start(buf); ts_st->discontinuity = 0; } - if (key && is_start && pts != AV_NOPTS_VALUE && + if (!(ts->flags & MPEGTS_FLAG_OMIT_RAI) && + key && is_start && pts != AV_NOPTS_VALUE && !is_dvb_teletext /* adaptation+payload forbidden for teletext (ETSI EN 300 472 V1.3.1 4.1) */) { // set Random Access for key frames if (ts_st->pcr_period) @@ -1874,6 +1879,7 @@ if (st->codecpar->codec_id == AV_CODEC_ID_H264) { const uint8_t *p = buf, *buf_end = p + size; + const uint8_t *found_aud = NULL, *found_aud_end = NULL; uint32_t state = -1; int extradd = (pkt->flags & AV_PKT_FLAG_KEY) ? st->codecpar->extradata_size : 0; int ret = ff_check_h264_startcode(s, st, pkt); @@ -1883,27 +1889,58 @@ if (extradd && AV_RB24(st->codecpar->extradata) > 1) extradd = 0; + /* Ensure that all pictures are prefixed with an AUD, and that + * IDR pictures are also prefixed with SPS and PPS. SPS and PPS + * are assumed to be available in 'extradata' if not found in-band. */ do { p = avpriv_find_start_code(p, buf_end, &state); av_log(s, AV_LOG_TRACE, "nal %"PRId32"\n", state & 0x1f); - if ((state & 0x1f) == 7) + if ((state & 0x1f) == H264_NAL_SPS) extradd = 0; - } while (p < buf_end && (state & 0x1f) != 9 && - (state & 0x1f) != 5 && (state & 0x1f) != 1); - - if ((state & 0x1f) != 5) + if ((state & 0x1f) == H264_NAL_AUD) { + found_aud = p - 4; // start of the 0x000001 start code. + found_aud_end = p + 1; // first byte past the AUD. + if (found_aud < buf) + found_aud = buf; + if (buf_end < found_aud_end) + found_aud_end = buf_end; + } + } while (p < buf_end + && (state & 0x1f) != H264_NAL_IDR_SLICE + && (state & 0x1f) != H264_NAL_SLICE + && (extradd > 0 || !found_aud)); + if ((state & 0x1f) != H264_NAL_IDR_SLICE) extradd = 0; - if ((state & 0x1f) != 9) { // AUD NAL + + if (!found_aud) { + /* Prefix 'buf' with the missing AUD, and extradata if needed. */ data = av_malloc(pkt->size + 6 + extradd); if (!data) return AVERROR(ENOMEM); memcpy(data + 6, st->codecpar->extradata, extradd); memcpy(data + 6 + extradd, pkt->data, pkt->size); AV_WB32(data, 0x00000001); - data[4] = 0x09; + data[4] = H264_NAL_AUD; data[5] = 0xf0; // any slice type (0xe) + rbsp stop one bit buf = data; size = pkt->size + 6 + extradd; + } else if (extradd != 0) { + /* Move the AUD up to the beginning of the frame, where the H.264 + * spec requires it to appear. Emit the extradata after it. */ + PutByteContext pb; + const int new_pkt_size = pkt->size + 1 + extradd; + data = av_malloc(new_pkt_size); + if (!data) + return AVERROR(ENOMEM); + bytestream2_init_writer(&pb, data, new_pkt_size); + bytestream2_put_byte(&pb, 0x00); + bytestream2_put_buffer(&pb, found_aud, found_aud_end - found_aud); + bytestream2_put_buffer(&pb, st->codecpar->extradata, extradd); + bytestream2_put_buffer(&pb, pkt->data, found_aud - pkt->data); + bytestream2_put_buffer(&pb, found_aud_end, buf_end - found_aud_end); + av_assert0(new_pkt_size == bytestream2_tell_p(&pb)); + buf = data; + size = new_pkt_size; } } else if (st->codecpar->codec_id == AV_CODEC_ID_AAC) { if (pkt->size < 2) { @@ -2281,6 +2318,8 @@ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_DISCONT }, 0, INT_MAX, ENC, "mpegts_flags" }, { "nit", "Enable NIT transmission", 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_NIT}, 0, INT_MAX, ENC, "mpegts_flags" }, + { "omit_rai", "Disable writing of random access indicator", + 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_OMIT_RAI }, 0, INT_MAX, ENC, "mpegts_flags" }, { "mpegts_copyts", "don't offset dts/pts", OFFSET(copyts), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, { "tables_version", "set PAT, PMT, SDT and NIT version", OFFSET(tables_version), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 31, ENC }, { "omit_video_pes_length", "Omit the PES packet length for video packets", @@ -2303,19 +2342,19 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_mpegts_muxer = { - .name = "mpegts", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"), - .mime_type = "video/MP2T", - .extensions = "ts,m2t,m2ts,mts", +const FFOutputFormat ff_mpegts_muxer = { + .p.name = "mpegts", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"), + .p.mime_type = "video/MP2T", + .p.extensions = "ts,m2t,m2ts,mts", .priv_data_size = sizeof(MpegTSWrite), - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .init = mpegts_init, .write_packet = mpegts_write_packet, .write_trailer = mpegts_write_end, .deinit = mpegts_deinit, .check_bitstream = mpegts_check_bitstream, - .flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS, - .priv_class = &mpegts_muxer_class, + .p.flags = AVFMT_ALLOW_FLUSH | AVFMT_VARIABLE_FPS | AVFMT_NODIMENSIONS, + .p.priv_class = &mpegts_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpjpeg.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpjpeg.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpjpeg.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mpjpeg.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "libavutil/opt.h" #include "avformat.h" +#include "mux.h" /* Multipart JPEG */ @@ -61,16 +62,16 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_mpjpeg_muxer = { - .name = "mpjpeg", - .long_name = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"), - .mime_type = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG, - .extensions = "mjpg", +const FFOutputFormat ff_mpjpeg_muxer = { + .p.name = "mpjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"), + .p.mime_type = "multipart/x-mixed-replace;boundary=" BOUNDARY_TAG, + .p.extensions = "mjpg", .priv_data_size = sizeof(MPJPEGContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_MJPEG, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_MJPEG, .write_header = mpjpeg_write_header, .write_packet = mpjpeg_write_packet, - .flags = AVFMT_NOTIMESTAMPS, - .priv_class = &mpjpeg_muxer_class, + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &mpjpeg_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.c 2023-03-03 13:29:59.000000000 +0000 @@ -118,8 +118,8 @@ } s->oformat = oformat; - if (s->oformat->priv_data_size > 0) { - s->priv_data = av_mallocz(s->oformat->priv_data_size); + if (ffofmt(s->oformat)->priv_data_size > 0) { + s->priv_data = av_mallocz(ffofmt(s->oformat)->priv_data_size); if (!s->priv_data) goto nomem; if (s->oformat->priv_class) { @@ -144,10 +144,11 @@ return ret; } -static int validate_codec_tag(AVFormatContext *s, AVStream *st) +static int validate_codec_tag(const AVFormatContext *s, const AVStream *st) { const AVCodecTag *avctag; enum AVCodecID id = AV_CODEC_ID_NONE; + unsigned uppercase_tag = ff_toupper4(st->codecpar->codec_tag); int64_t tag = -1; /** @@ -159,7 +160,7 @@ for (int n = 0; s->oformat->codec_tag[n]; n++) { avctag = s->oformat->codec_tag[n]; while (avctag->id != AV_CODEC_ID_NONE) { - if (ff_toupper4(avctag->tag) == ff_toupper4(st->codecpar->codec_tag)) { + if (ff_toupper4(avctag->tag) == uppercase_tag) { id = avctag->id; if (id == st->codecpar->codec_id) return 1; @@ -181,7 +182,7 @@ { FFFormatContext *const si = ffformatcontext(s); AVDictionary *tmp = NULL; - const AVOutputFormat *of = s->oformat; + const FFOutputFormat *of = ffofmt(s->oformat); AVDictionaryEntry *e; int ret = 0; @@ -200,7 +201,7 @@ } // some sanity checks - if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) { + if (s->nb_streams == 0 && !(of->p.flags & AVFMT_NOSTREAMS)) { av_log(s, AV_LOG_ERROR, "No streams to mux were specified\n"); ret = AVERROR(EINVAL); goto fail; @@ -250,7 +251,7 @@ break; case AVMEDIA_TYPE_VIDEO: if ((par->width <= 0 || par->height <= 0) && - !(of->flags & AVFMT_NODIMENSIONS)) { + !(of->p.flags & AVFMT_NODIMENSIONS)) { av_log(s, AV_LOG_ERROR, "dimensions not set\n"); ret = AVERROR(EINVAL); goto fail; @@ -280,11 +281,11 @@ sti->is_intra_only = ff_is_intra_only(par->codec_id); - if (of->codec_tag) { + if (of->p.codec_tag) { if ( par->codec_tag && par->codec_id == AV_CODEC_ID_RAWVIDEO - && ( av_codec_get_tag(of->codec_tag, par->codec_id) == 0 - || av_codec_get_tag(of->codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' ')) + && ( av_codec_get_tag(of->p.codec_tag, par->codec_id) == 0 + || av_codec_get_tag(of->p.codec_tag, par->codec_id) == MKTAG('r', 'a', 'w', ' ')) && !validate_codec_tag(s, st)) { // the current rawvideo encoding system ends up setting // the wrong codec_tag for avi/mov, we override it here @@ -300,7 +301,7 @@ goto fail; } } else - par->codec_tag = av_codec_get_tag(of->codec_tag, par->codec_id); + par->codec_tag = av_codec_get_tag(of->p.codec_tag, par->codec_id); } if (par->codec_type != AVMEDIA_TYPE_ATTACHMENT) @@ -318,8 +319,8 @@ ret = AVERROR(ENOMEM); goto fail; } - if (of->priv_class) { - *(const AVClass **)s->priv_data = of->priv_class; + if (of->p.priv_class) { + *(const AVClass **)s->priv_data = of->p.priv_class; av_opt_set_defaults(s->priv_data); if ((ret = av_opt_set_dict2(s->priv_data, &tmp, AV_OPT_SEARCH_CHILDREN)) < 0) goto fail; @@ -342,10 +343,10 @@ *options = tmp; } - if (s->oformat->init) { - if ((ret = s->oformat->init(s)) < 0) { - if (s->oformat->deinit) - s->oformat->deinit(s); + if (of->init) { + if ((ret = of->init(s)) < 0) { + if (of->deinit) + of->deinit(s); return ret; } return ret == 0; @@ -419,8 +420,9 @@ static void deinit_muxer(AVFormatContext *s) { FFFormatContext *const si = ffformatcontext(s); - if (s->oformat && s->oformat->deinit && si->initialized) - s->oformat->deinit(s); + const FFOutputFormat *const of = ffofmt(s->oformat); + if (of && of->deinit && si->initialized) + of->deinit(s); si->initialized = si->streams_initialized = 0; } @@ -436,7 +438,7 @@ si->initialized = 1; si->streams_initialized = ret; - if (s->oformat->init && ret) { + if (ffofmt(s->oformat)->init && ret) { if ((ret = init_pts(s)) < 0) return ret; @@ -459,8 +461,8 @@ if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER); - if (s->oformat->write_header) { - ret = s->oformat->write_header(s); + if (ffofmt(s->oformat)->write_header) { + ret = ffofmt(s->oformat)->write_header(s); if (ret >= 0 && s->pb && s->pb->error < 0) ret = s->pb->error; if (ret < 0) @@ -632,6 +634,8 @@ if (ts == AV_NOPTS_VALUE) return; + ts -= sti->lowest_ts_allowed; + /* Peek into the muxing queue to improve our estimate * of the lowest timestamp if av_interleaved_write_frame() is used. */ for (const PacketListEntry *pktl = si->packet_buffer.head; @@ -640,6 +644,7 @@ int64_t cmp_ts = use_pts ? pktl->pkt.pts : pktl->pkt.dts; if (cmp_ts == AV_NOPTS_VALUE) continue; + cmp_ts -= ffstream(s->streams[pktl->pkt.stream_index])->lowest_ts_allowed; if (s->output_ts_offset) cmp_ts += av_rescale_q(s->output_ts_offset, AV_TIME_BASE_Q, cmp_tb); if (av_compare_ts(cmp_ts, cmp_tb, ts, tb) < 0) { @@ -669,7 +674,7 @@ pkt->pts += offset; if (si->avoid_negative_ts_use_pts) { - if (pkt->pts != AV_NOPTS_VALUE && pkt->pts < 0) { + if (pkt->pts != AV_NOPTS_VALUE && pkt->pts < sti->lowest_ts_allowed) { av_log(s, AV_LOG_WARNING, "failed to avoid negative " "pts %s in stream %d.\n" "Try -avoid_negative_ts 1 as a possible workaround.\n", @@ -678,7 +683,7 @@ ); } } else { - if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) { + if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < sti->lowest_ts_allowed) { av_log(s, AV_LOG_WARNING, "Packets poorly interleaved, failed to avoid negative " "timestamp %s in stream %d.\n" @@ -720,9 +725,9 @@ if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) { AVFrame **frame = (AVFrame **)pkt->data; av_assert0(pkt->size == sizeof(*frame)); - ret = s->oformat->write_uncoded_frame(s, pkt->stream_index, frame, 0); + ret = ffofmt(s->oformat)->write_uncoded_frame(s, pkt->stream_index, frame, 0); } else { - ret = s->oformat->write_packet(s, pkt); + ret = ffofmt(s->oformat)->write_packet(s, pkt); } if (s->pb && ret >= 0) { @@ -947,6 +952,7 @@ if (s->max_interleave_delta > 0 && si->packet_buffer.head && + si->packet_buffer.head->pkt.dts != AV_NOPTS_VALUE && !flush && si->nb_interleaved_streams == stream_count+noninterleaved_count ) { @@ -1073,9 +1079,9 @@ if (!(s->flags & AVFMT_FLAG_AUTO_BSF)) return 1; - if (s->oformat->check_bitstream) { + if (ffofmt(s->oformat)->check_bitstream) { if (!sti->bitstream_checked) { - if ((ret = s->oformat->check_bitstream(s, &sti->pub, pkt)) < 0) + if ((ret = ffofmt(s->oformat)->check_bitstream(s, &sti->pub, pkt)) < 0) return ret; else if (ret == 1) sti->bitstream_checked = 1; @@ -1193,7 +1199,7 @@ if (!in) { if (s->oformat->flags & AVFMT_ALLOW_FLUSH) { - ret = s->oformat->write_packet(s, NULL); + ret = ffofmt(s->oformat)->write_packet(s, NULL); flush_if_needed(s); if (ret >= 0 && s->pb && s->pb->error < 0) ret = s->pb->error; @@ -1268,14 +1274,12 @@ if (ret >= 0) ret = ret1; - if (s->oformat->write_trailer) { + if (ffofmt(s->oformat)->write_trailer) { if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_TRAILER); - if (ret >= 0) { - ret = s->oformat->write_trailer(s); - } else { - s->oformat->write_trailer(s); - } + ret1 = ffofmt(s->oformat)->write_trailer(s); + if (ret >= 0) + ret = ret1; } deinit_muxer(s); @@ -1298,9 +1302,10 @@ int av_get_output_timestamp(struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall) { - if (!s->oformat || !s->oformat->get_output_timestamp) + const FFOutputFormat *const of = ffofmt(s->oformat); + if (!of || !of->get_output_timestamp) return AVERROR(ENOSYS); - s->oformat->get_output_timestamp(s, stream, dts, wall); + of->get_output_timestamp(s, stream, dts, wall); return 0; } @@ -1390,7 +1395,7 @@ AVPacket *pkt = si->parse_pkt; av_assert0(s->oformat); - if (!s->oformat->write_uncoded_frame) { + if (!ffofmt(s->oformat)->write_uncoded_frame) { av_frame_free(&frame); return AVERROR(ENOSYS); } @@ -1417,7 +1422,14 @@ pkt->size = sizeof(frame); pkt->pts = pkt->dts = frame->pts; - pkt->duration = frame->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (frame->pkt_duration) + pkt->duration = frame->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = frame->duration; pkt->stream_index = stream_index; pkt->flags |= AV_PKT_FLAG_UNCODED_FRAME; } @@ -1440,9 +1452,10 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index) { - av_assert0(s->oformat); - if (!s->oformat->write_uncoded_frame) + const FFOutputFormat *const of = ffofmt(s->oformat); + av_assert0(of); + if (!of->write_uncoded_frame) return AVERROR(ENOSYS); - return s->oformat->write_uncoded_frame(s, stream_index, NULL, - AV_WRITE_UNCODED_FRAME_QUERY); + return of->write_uncoded_frame(s, stream_index, NULL, + AV_WRITE_UNCODED_FRAME_QUERY); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,119 @@ #include "libavcodec/packet.h" #include "avformat.h" +struct AVDeviceInfoList; + +typedef struct FFOutputFormat { + /** + * The public AVOutputFormat. See avformat.h for it. + */ + AVOutputFormat p; + /** + * size of private data so that it can be allocated in the wrapper + */ + int priv_data_size; + + /** + * Internal flags. See FF_FMT_FLAG_* in internal.h. + */ + int flags_internal; + + int (*write_header)(AVFormatContext *); + /** + * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, + * pkt can be NULL in order to flush data buffered in the muxer. + * When flushing, return 0 if there still is more data to flush, + * or 1 if everything was flushed and there is no more buffered + * data. + */ + int (*write_packet)(AVFormatContext *, AVPacket *pkt); + int (*write_trailer)(AVFormatContext *); + /** + * A format-specific function for interleavement. + * If unset, packets will be interleaved by dts. + * + * @param s An AVFormatContext for output. pkt will be added to + * resp. taken from its packet buffer. + * @param[in,out] pkt A packet to be interleaved if has_packet is set; + * also used to return packets. If no packet is returned + * (e.g. on error), pkt is blank on return. + * @param flush 1 if no further packets are available as input and + * all remaining packets should be output. + * @param has_packet If set, pkt contains a packet to be interleaved + * on input; otherwise pkt is blank on input. + * @return 1 if a packet was output, 0 if no packet could be output, + * < 0 if an error occurred + */ + int (*interleave_packet)(AVFormatContext *s, AVPacket *pkt, + int flush, int has_packet); + /** + * Test if the given codec can be stored in this container. + * + * @return 1 if the codec is supported, 0 if it is not. + * A negative number if unknown. + * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC + */ + int (*query_codec)(enum AVCodecID id, int std_compliance); + + void (*get_output_timestamp)(AVFormatContext *s, int stream, + int64_t *dts, int64_t *wall); + /** + * Allows sending messages from application to device. + */ + int (*control_message)(AVFormatContext *s, int type, + void *data, size_t data_size); + + /** + * Write an uncoded AVFrame. + * + * See av_write_uncoded_frame() for details. + * + * The library will free *frame afterwards, but the muxer can prevent it + * by setting the pointer to NULL. + */ + int (*write_uncoded_frame)(AVFormatContext *, int stream_index, + AVFrame **frame, unsigned flags); + /** + * Returns device list with it properties. + * @see avdevice_list_devices() for more details. + */ + int (*get_device_list)(AVFormatContext *s, struct AVDeviceInfoList *device_list); + /** + * Initialize format. May allocate data here, and set any AVFormatContext or + * AVStream parameters that need to be set before packets are sent. + * This method must not write output. + * + * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure + * + * Any allocations made here must be freed in deinit(). + */ + int (*init)(AVFormatContext *); + /** + * Deinitialize format. If present, this is called whenever the muxer is being + * destroyed, regardless of whether or not the header has been written. + * + * If a trailer is being written, this is called after write_trailer(). + * + * This is called if init() fails as well. + */ + void (*deinit)(AVFormatContext *); + /** + * Set up any necessary bitstream filtering and extract any extra data needed + * for the global header. + * + * @note pkt might have been directly forwarded by a meta-muxer; therefore + * pkt->stream_index as well as the pkt's timebase might be invalid. + * Return 0 if more packets from this stream must be checked; 1 if not. + */ + int (*check_bitstream)(AVFormatContext *s, AVStream *st, + const AVPacket *pkt); +} FFOutputFormat; + +static inline const FFOutputFormat *ffofmt(const AVOutputFormat *fmt) +{ + return (const FFOutputFormat*)fmt; +} + /** * Add packet to an AVFormatContext's packet_buffer list, determining its * interleaved position using compare() function argument. @@ -114,15 +227,6 @@ int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options); /** - * Copy encoding parameters from source to destination stream - * - * @param dst pointer to destination AVStream - * @param src pointer to source AVStream - * @return >=0 on success, AVERROR code on error - */ -int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src); - -/** * Parse creation_time in AVFormatContext metadata if exists and warn if the * parsing fails. * diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux_utils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux_utils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux_utils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mux_utils.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "libavutil/dict.h" +#include "libavutil/dict_internal.h" #include "libavutil/internal.h" #include "libavutil/log.h" #include "libavutil/mem.h" @@ -29,6 +30,7 @@ #include "internal.h" #include "mux.h" +#if FF_API_GET_END_PTS int64_t av_stream_get_end_pts(const AVStream *st) { if (cffstream(st)->priv_pts) { @@ -36,20 +38,20 @@ } else return AV_NOPTS_VALUE; } +#endif int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance) { if (ofmt) { unsigned int codec_tag; - if (ofmt->query_codec) - return ofmt->query_codec(codec_id, std_compliance); + if (ffofmt(ofmt)->query_codec) + return ffofmt(ofmt)->query_codec(codec_id, std_compliance); else if (ofmt->codec_tag) return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag); else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec || - codec_id == ofmt->subtitle_codec || - codec_id == ofmt->data_codec) + codec_id == ofmt->subtitle_codec) return 1; } return AVERROR_PATCHWELCOME; @@ -121,34 +123,6 @@ return 0; } -int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src) -{ - int ret; - - dst->id = src->id; - dst->time_base = src->time_base; - dst->nb_frames = src->nb_frames; - dst->disposition = src->disposition; - dst->sample_aspect_ratio = src->sample_aspect_ratio; - dst->avg_frame_rate = src->avg_frame_rate; - dst->r_frame_rate = src->r_frame_rate; - - av_dict_free(&dst->metadata); - ret = av_dict_copy(&dst->metadata, src->metadata, 0); - if (ret < 0) - return ret; - - ret = avcodec_parameters_copy(dst->codecpar, src->codecpar); - if (ret < 0) - return ret; - - ret = ff_stream_side_data_copy(dst, src); - if (ret < 0) - return ret; - - return 0; -} - int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds) { AVDictionaryEntry *entry; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.c 2023-03-03 13:29:59.000000000 +0000 @@ -66,6 +66,9 @@ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, 16, AV_CODEC_ID_V210 }, /* V210 */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x02,0x01,0x02,0x11,0x00,0x00 }, 14, AV_CODEC_ID_PRORES }, /* Avid MC7 ProRes */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x06,0x00,0x00 }, 14, AV_CODEC_ID_PRORES }, /* Apple ProRes */ + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x01,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V0 */ + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x02,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V1 */ + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x04,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V3 */ /* SoundEssenceCompression */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x03,0x04,0x02,0x02,0x02,0x03,0x03,0x01,0x00 }, 14, AV_CODEC_ID_AAC }, /* MPEG-2 AAC ADTS (legacy) */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13, AV_CODEC_ID_PCM_S16LE }, /* uncompressed */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -53,6 +53,7 @@ #include "libavcodec/bytestream.h" #include "libavcodec/internal.h" #include "libavutil/channel_layout.h" +#include "libavutil/dict_internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/parseutils.h" #include "libavutil/timecode.h" @@ -238,6 +239,12 @@ char *language; } MXFMCASubDescriptor; +typedef struct MXFFFV1SubDescriptor { + MXFMetadataSet meta; + uint8_t *extradata; + int extradata_size; +} MXFFFV1SubDescriptor; + typedef struct MXFIndexTableSegment { MXFMetadataSet meta; int edit_unit_byte_count; @@ -338,6 +345,7 @@ static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 }; static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 }; +static const uint8_t mxf_ffv1_extradata[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x04,0x01,0x06,0x0c,0x01,0x00,0x00,0x00 }; // FFV1InitializationMetadata static const uint8_t mxf_avid_project_name[] = { 0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf }; static const uint8_t mxf_jp2k_rsiz[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0a,0x04,0x01,0x06,0x03,0x01,0x00,0x00,0x00 }; static const uint8_t mxf_indirect_value_utf16le[] = { 0x4c,0x00,0x02,0x10,0x01,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01 }; @@ -378,6 +386,9 @@ av_freep(&((MXFDescriptor *)*ctx)->file_descriptors_refs); av_freep(&((MXFDescriptor *)*ctx)->sub_descriptors_refs); break; + case FFV1SubDescriptor: + av_freep(&((MXFFFV1SubDescriptor *)*ctx)->extradata); + break; case AudioChannelLabelSubDescriptor: case SoundfieldGroupLabelSubDescriptor: case GroupOfSoundfieldGroupsLabelSubDescriptor: @@ -510,7 +521,7 @@ int did, sdid, data_length; int i, ret; - if (count != 1) + if (count > 1) av_log(s, AV_LOG_WARNING, "unsupported multiple ANC packets (%d) per KLV packet\n", count); for (i = 0; i < count; i++) { @@ -1187,11 +1198,15 @@ static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment) { int i, length; + uint32_t nb_index_entries; if (segment->temporal_offset_entries) return AVERROR_INVALIDDATA; - segment->nb_index_entries = avio_rb32(pb); + nb_index_entries = avio_rb32(pb); + if (nb_index_entries > INT_MAX) + return AVERROR_INVALIDDATA; + segment->nb_index_entries = nb_index_entries; length = avio_rb32(pb); if(segment->nb_index_entries && length < 11) @@ -1474,6 +1489,25 @@ return 0; } +static int mxf_read_ffv1_sub_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) +{ + MXFFFV1SubDescriptor *ffv1_sub_descriptor = arg; + + if (IS_KLV_KEY(uid, mxf_ffv1_extradata) && size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE ) { + if (ffv1_sub_descriptor->extradata) + av_log(NULL, AV_LOG_WARNING, "Duplicate ffv1_extradata\n"); + av_free(ffv1_sub_descriptor->extradata); + ffv1_sub_descriptor->extradata_size = 0; + ffv1_sub_descriptor->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); + if (!ffv1_sub_descriptor->extradata) + return AVERROR(ENOMEM); + ffv1_sub_descriptor->extradata_size = size; + avio_read(pb, ffv1_sub_descriptor->extradata, size); + } + + return 0; +} + static int mxf_read_indirect_value(void *arg, AVIOContext *pb, int size) { MXFTaggedValue *tagged_value = arg; @@ -1555,6 +1589,7 @@ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x1c,0x01,0x00 }, 14, AV_CODEC_ID_PRORES, NULL, 14 }, /* ProRes */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO, NULL, 15 }, /* MPEG-ES */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x04,0x01 }, 14, AV_CODEC_ID_MPEG2VIDEO, NULL, 15, D10D11Wrap }, /* SMPTE D-10 mapping */ + { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0d,0x0d,0x01,0x03,0x01,0x02,0x23,0x01,0x00 }, 14, AV_CODEC_ID_FFV1, NULL, 14 }, { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14, AV_CODEC_ID_DVVIDEO, NULL, 15 }, /* DV 625 25mbps */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14, AV_CODEC_ID_RAWVIDEO, NULL, 15, RawVWrap }, /* uncompressed picture */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0a,0x0e,0x0f,0x03,0x01,0x02,0x20,0x01,0x01 }, 15, AV_CODEC_ID_HQ_HQA }, @@ -1902,6 +1937,14 @@ return 0; } + if (s->nb_index_entries != s->index_duration && + s->nb_index_entries != s->index_duration + 1 && /* Avid index */ + s->nb_index_entries != s->index_duration * 2 + 1) { + index_table->nb_ptses = 0; + av_log(mxf->fc, AV_LOG_ERROR, "ignoring IndexSID %d, duration does not match nb_index_entries\n", s->index_sid); + return 0; + } + index_table->nb_ptses += s->index_duration; } @@ -1909,10 +1952,10 @@ if (index_table->nb_ptses <= 0) return 0; - if (!(index_table->ptses = av_calloc(index_table->nb_ptses, sizeof(int64_t))) || + if (!(index_table->ptses = av_malloc_array(index_table->nb_ptses, sizeof(int64_t))) || !(index_table->fake_index = av_calloc(index_table->nb_ptses, sizeof(AVIndexEntry))) || - !(index_table->offsets = av_calloc(index_table->nb_ptses, sizeof(int8_t))) || - !(flags = av_calloc(index_table->nb_ptses, sizeof(uint8_t)))) { + !(index_table->offsets = av_malloc_array(index_table->nb_ptses, sizeof(int8_t))) || + !(flags = av_malloc_array(index_table->nb_ptses, sizeof(uint8_t)))) { av_freep(&index_table->ptses); av_freep(&index_table->fake_index); av_freep(&index_table->offsets); @@ -1956,11 +1999,11 @@ int index_delta = 1; int n = s->nb_index_entries; - if (s->nb_index_entries == 2 * s->index_duration + 1) { + if (s->nb_index_entries == 2 * s->index_duration + 1) index_delta = 2; /* Avid index */ - /* ignore the last entry - it's the size of the essence container */ + if (s->nb_index_entries == index_delta * s->index_duration + 1) + /* ignore the last entry - it's the size of the essence container in Avid */ n--; - } for (j = 0; j < n; j += index_delta, x++) { int offset = s->temporal_offset_entries[j] / index_delta; @@ -2111,6 +2154,13 @@ return ret; } +static int mxf_is_st_422(const UID *essence_container_ul) { + static const uint8_t st_422_essence_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0c }; + + return essence_container_ul && mxf_match_uid(*essence_container_ul, st_422_essence_container_ul, + sizeof(st_422_essence_container_ul)); +} + static int mxf_is_intra_only(MXFDescriptor *descriptor) { return mxf_get_codec_ul(mxf_intra_only_essence_container_uls, @@ -2445,6 +2495,21 @@ return NULL; } +static void parse_ffv1_sub_descriptor(MXFContext *mxf, MXFTrack *source_track, MXFDescriptor *descriptor, AVStream *st) +{ + for (int i = 0; i < descriptor->sub_descriptors_count; i++) { + MXFFFV1SubDescriptor *ffv1_sub_descriptor = mxf_resolve_strong_ref(mxf, &descriptor->sub_descriptors_refs[i], FFV1SubDescriptor); + if (ffv1_sub_descriptor == NULL) + continue; + + descriptor->extradata = ffv1_sub_descriptor->extradata; + descriptor->extradata_size = ffv1_sub_descriptor->extradata_size; + ffv1_sub_descriptor->extradata = NULL; + ffv1_sub_descriptor->extradata_size = 0; + break; + } +} + static int parse_mca_labels(MXFContext *mxf, MXFTrack *source_track, MXFDescriptor *descriptor, AVStream *st) { uint64_t routing[FF_SANE_NB_CHANNELS] = {0}; @@ -2848,6 +2913,24 @@ av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout); } + if (mxf_is_st_422(essence_container_ul)) { + switch ((*essence_container_ul)[14]) { + case 2: /* Cn: Clip- wrapped Picture Element */ + case 3: /* I1: Interlaced Frame, 1 field/KLV */ + case 4: /* I2: Interlaced Frame, 2 fields/KLV */ + case 6: /* P1: Frame- wrapped Picture Element */ + st->avg_frame_rate = source_track->edit_rate; + st->r_frame_rate = st->avg_frame_rate; + break; + case 5: /* F1: Field-wrapped Picture Element */ + st->avg_frame_rate = av_mul_q(av_make_q(2, 1), source_track->edit_rate); + st->r_frame_rate = st->avg_frame_rate; + break; + default: + break; + } + } + if (st->codecpar->codec_id == AV_CODEC_ID_PRORES) { switch (descriptor->essence_codec_ul[14]) { case 1: st->codecpar->codec_tag = MKTAG('a','p','c','o'); break; @@ -2973,6 +3056,8 @@ st->codecpar->codec_id = AV_CODEC_ID_EIA_608; } } + if (!descriptor->extradata) + parse_ffv1_sub_descriptor(mxf, source_track, descriptor, st); if (descriptor->extradata) { if (!ff_alloc_extradata(st->codecpar, descriptor->extradata_size)) { memcpy(st->codecpar->extradata, descriptor->extradata, descriptor->extradata_size); @@ -3160,6 +3245,7 @@ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x6b,0x00 }, mxf_read_mca_sub_descriptor, sizeof(MXFMCASubDescriptor), AudioChannelLabelSubDescriptor }, { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x6c,0x00 }, mxf_read_mca_sub_descriptor, sizeof(MXFMCASubDescriptor), SoundfieldGroupLabelSubDescriptor }, { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x6d,0x00 }, mxf_read_mca_sub_descriptor, sizeof(MXFMCASubDescriptor), GroupOfSoundfieldGroupsLabelSubDescriptor }, + { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x81,0x03 }, mxf_read_ffv1_sub_descriptor, sizeof(MXFFFV1SubDescriptor), FFV1SubDescriptor }, { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */ { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 }, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent }, @@ -3663,7 +3749,7 @@ PRINT_KEY(s, "read header", klv.key); av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); - if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) || + if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key, sizeof(mxf_encrypted_triplet_key)) || IS_KLV_KEY(klv.key, mxf_essence_element_key) || IS_KLV_KEY(klv.key, mxf_canopus_essence_element_key) || IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) || @@ -3783,8 +3869,8 @@ if ((sample_rate.num / sample_rate.den) == 48000) { return av_rescale_q(edit_unit, sample_rate, track->edit_rate); } else { - int remainder = (sample_rate.num * time_base.num) % - (time_base.den * sample_rate.den); + int64_t remainder = (sample_rate.num * (int64_t) time_base.num) % + ( time_base.den * (int64_t)sample_rate.den); if (remainder) av_log(mxf->fc, AV_LOG_WARNING, "seeking detected on stream #%d with time base (%d/%d) and " @@ -3909,7 +3995,7 @@ pos = klv.next_klv - klv.length; PRINT_KEY(s, "read packet", klv.key); av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); - if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) { + if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key, sizeof(mxf_encrypted_triplet_key))) { ret = mxf_decrypt_triplet(s, pkt, &klv); if (ret < 0) { av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n"); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,6 +47,7 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/pixdesc.h" #include "libavutil/time_internal.h" +#include "libavcodec/avcodec.h" #include "libavcodec/golomb.h" #include "libavcodec/h264.h" #include "libavcodec/packet_internal.h" @@ -60,8 +61,11 @@ #include "config.h" #include "version.h" -extern const AVOutputFormat ff_mxf_d10_muxer; -extern const AVOutputFormat ff_mxf_opatom_muxer; +extern const FFOutputFormat ff_mxf_d10_muxer; +extern const FFOutputFormat ff_mxf_opatom_muxer; + +#define IS_D10(s) ((s)->oformat == &ff_mxf_d10_muxer.p) +#define IS_OPATOM(s) ((s)->oformat == &ff_mxf_opatom_muxer.p) #define EDIT_UNITS_PER_BODY 250 #define KAG_SIZE 512 @@ -666,7 +670,7 @@ // operational pattern mxf_write_local_tag(s, 16, 0x3B09); - if (s->oformat == &ff_mxf_opatom_muxer) + if (IS_OPATOM(s)) avio_write(pb, opatom_ul, 16); else avio_write(pb, op1a_ul, 16); @@ -764,7 +768,7 @@ AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); const char *company = com_entry ? com_entry->value : "FFmpeg"; - const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; + const char *product = product_entry ? product_entry->value : !IS_OPATOM(s) ? "OP1a Muxer" : "OPAtom Muxer"; const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFORM_IDENT; const char *version = version_entry ? version_entry->value : s->flags & AVFMT_FLAG_BITEXACT ? "0.0.0" : @@ -865,7 +869,7 @@ // write edit rate mxf_write_local_tag(s, 8, 0x4B01); - if (st == mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer) { + if (st == mxf->timecode_track && IS_OPATOM(s)) { avio_wb32(pb, mxf->tc.rate.num); avio_wb32(pb, mxf->tc.rate.den); } else { @@ -901,7 +905,7 @@ // write duration mxf_write_local_tag(s, 8, 0x0202); - if (st != mxf->timecode_track && s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + if (st != mxf->timecode_track && IS_OPATOM(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count); } else { avio_wb64(pb, mxf->duration); @@ -1065,7 +1069,7 @@ avio_wb32(pb, st->index+2); mxf_write_local_tag(s, 8, 0x3001); - if (s->oformat == &ff_mxf_d10_muxer) { + if (IS_D10(s)) { avio_wb32(pb, mxf->time_base.den); avio_wb32(pb, mxf->time_base.num); } else { @@ -1137,7 +1141,7 @@ mxf_write_local_tag(s, 4, 0x3202); avio_wb32(pb, stored_height>>sc->interlaced); - if (s->oformat == &ff_mxf_d10_muxer) { + if (IS_D10(s)) { //Stored F2 Offset mxf_write_local_tag(s, 4, 0x3216); avio_wb32(pb, 0); @@ -1434,7 +1438,7 @@ int show_warnings = !mxf->footer_partition_offset; int64_t pos = mxf_write_generic_desc(s, st, key); - if (s->oformat == &ff_mxf_opatom_muxer) { + if (IS_OPATOM(s)) { mxf_write_local_tag(s, 8, 0x3002); avio_wb64(pb, mxf->body_offset / mxf->edit_unit_byte_count); } @@ -1448,19 +1452,19 @@ avio_wb32(pb, st->codecpar->sample_rate); avio_wb32(pb, 1); - if (s->oformat == &ff_mxf_d10_muxer) { + if (IS_D10(s)) { mxf_write_local_tag(s, 1, 0x3D04); avio_w8(pb, 0); } mxf_write_local_tag(s, 4, 0x3D07); if (mxf->channel_count == -1) { - if (show_warnings && (s->oformat == &ff_mxf_d10_muxer) && + if (show_warnings && IS_D10(s) && (st->codecpar->ch_layout.nb_channels != 4) && (st->codecpar->ch_layout.nb_channels != 8)) av_log(s, AV_LOG_WARNING, "the number of audio channels shall be 4 or 8 : the output will not comply to MXF D-10 specs, use -d10_channelcount to fix this\n"); avio_wb32(pb, st->codecpar->ch_layout.nb_channels); - } else if (s->oformat == &ff_mxf_d10_muxer) { + } else if (IS_D10(s)) { if (show_warnings && (mxf->channel_count < st->codecpar->ch_layout.nb_channels)) av_log(s, AV_LOG_WARNING, "d10_channelcount < actual number of audio channels : some channels will be discarded\n"); if (show_warnings && (mxf->channel_count != 4) && (mxf->channel_count != 8)) @@ -1960,7 +1964,7 @@ avio_wb32(pb, index_byte_count ? indexsid : 0); // indexSID // BodyOffset - if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && s->oformat != &ff_mxf_opatom_muxer) + if (bodysid && mxf->edit_units_count && mxf->body_partitions_count && !IS_OPATOM(s)) avio_wb64(pb, mxf->body_offset); else avio_wb64(pb, 0); @@ -1968,7 +1972,7 @@ avio_wb32(pb, bodysid); // bodySID // operational pattern - if (s->oformat == &ff_mxf_opatom_muxer) + if (IS_OPATOM(s)) avio_write(pb, opatom_ul, 16); else avio_write(pb, op1a_ul, 16); @@ -2435,7 +2439,7 @@ } } } - if (s->oformat != &ff_mxf_d10_muxer) { + if (!IS_D10(s)) { const UID *codec_ul = mxf_get_mpeg2_codec_ul(st->codecpar); if (!codec_ul) return 0; @@ -2532,7 +2536,7 @@ uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0}; int64_t timestamp = 0; - if (s->oformat == &ff_mxf_opatom_muxer && s->nb_streams !=1) { + if (IS_OPATOM(s) && s->nb_streams != 1) { av_log(s, AV_LOG_ERROR, "there must be exactly one stream for mxf opatom\n"); return -1; } @@ -2548,7 +2552,7 @@ st->priv_data = sc; sc->index = -1; - if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && s->oformat != &ff_mxf_opatom_muxer) { + if (((i == 0) ^ (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) && !IS_OPATOM(s)) { av_log(s, AV_LOG_ERROR, "there must be exactly one video stream and it must be the first one\n"); return -1; } @@ -2592,12 +2596,12 @@ sc->video_bit_rate = st->codecpar->bit_rate; - if (s->oformat == &ff_mxf_d10_muxer || + if (IS_D10(s) || st->codecpar->codec_id == AV_CODEC_ID_DNXHD || st->codecpar->codec_id == AV_CODEC_ID_DVVIDEO) mxf->cbr_index = 1; - if (s->oformat == &ff_mxf_d10_muxer) { + if (IS_D10(s)) { int ntsc = mxf->time_base.den != 25; int ul_index; @@ -2635,7 +2639,7 @@ return -1; } avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); - if (s->oformat == &ff_mxf_d10_muxer) { + if (IS_D10(s)) { if (st->index != 1) { av_log(s, AV_LOG_ERROR, "MXF D-10 only support one audio track\n"); return -1; @@ -2647,7 +2651,7 @@ sc->index = INDEX_D10_AUDIO; sc->container_ul = ((MXFStreamContext*)s->streams[0]->priv_data)->container_ul; sc->frame_size = 4 + 8 * av_rescale_rnd(st->codecpar->sample_rate, mxf->time_base.num, mxf->time_base.den, AV_ROUND_UP) * 4; - } else if (s->oformat == &ff_mxf_opatom_muxer) { + } else if (IS_OPATOM(s)) { AVRational tbc = av_inv_q(mxf->audio_edit_rate); if (st->codecpar->codec_id != AV_CODEC_ID_PCM_S16LE && @@ -2706,7 +2710,7 @@ memcpy(sc->track_essence_element_key, mxf_essence_container_uls[sc->index].element_ul, 15); sc->track_essence_element_key[15] = present[sc->index]; - if (s->oformat == &ff_mxf_opatom_muxer && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) { + if (IS_OPATOM(s) && st->codecpar->codec_id == AV_CODEC_ID_DNXHD) { // clip-wrapping requires 0x0D per ST2019-4:2009 or 0x06 per previous version ST2019-4:2008 // we choose to use 0x06 instead 0x0D to be compatible with AVID systems // and produce mxf files with the most relevant flavour for opatom @@ -2719,7 +2723,7 @@ present[sc->index]++; } - if (s->oformat == &ff_mxf_d10_muxer || s->oformat == &ff_mxf_opatom_muxer) { + if (IS_D10(s) || IS_OPATOM(s)) { mxf->essence_container_count = 1; } @@ -2888,7 +2892,7 @@ MXFContext *mxf = s->priv_data; int i; - if (s->oformat == &ff_mxf_opatom_muxer) { + if (IS_OPATOM(s)) { MXFStreamContext *sc = s->streams[0]->priv_data; mxf->edit_unit_byte_count = sc->frame_size; return; @@ -2914,7 +2918,7 @@ int err; if (!mxf->header_written && pkt->stream_index != 0 && - s->oformat != &ff_mxf_opatom_muxer) { + !IS_OPATOM(s)) { av_log(s, AV_LOG_ERROR, "Received non-video packet before " "header has been written\n"); return AVERROR_INVALIDDATA; @@ -2966,7 +2970,7 @@ mxf_compute_edit_unit_byte_count(s); } - if (s->oformat == &ff_mxf_opatom_muxer) + if (IS_OPATOM(s)) return mxf_write_opatom_packet(s, pkt, &ie); if (!mxf->header_written) { @@ -3014,8 +3018,7 @@ mxf_write_klv_fill(s); avio_write(pb, sc->track_essence_element_key, 16); // write key - if (s->oformat == &ff_mxf_d10_muxer && - st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { + if (IS_D10(s) && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { mxf_write_d10_audio_packet(s, st, pkt); } else { klv_encode_ber4_length(pb, pkt->size); // write length @@ -3036,7 +3039,7 @@ avio_write(pb, ff_mxf_random_index_pack_key, 16); klv_encode_ber_length(pb, 28 + 12LL*mxf->body_partitions_count); - if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) + if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) avio_wb32(pb, 1); // BodySID of header partition else avio_wb32(pb, 0); @@ -3060,7 +3063,7 @@ int i, err; if (!mxf->header_written || - (s->oformat == &ff_mxf_opatom_muxer && !mxf->body_partition_offset)) { + (IS_OPATOM(s) && !mxf->body_partition_offset)) { /* reason could be invalid options/not supported codec/out of memory */ return AVERROR_UNKNOWN; } @@ -3069,7 +3072,7 @@ mxf_write_klv_fill(s); mxf->footer_partition_offset = avio_tell(pb); - if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { // no need to repeat index + if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) { // no need to repeat index if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) < 0) return err; } else { @@ -3083,7 +3086,7 @@ mxf_write_random_index_pack(s); if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { - if (s->oformat == &ff_mxf_opatom_muxer) { + if (IS_OPATOM(s)) { /* rewrite body partition to update lengths */ avio_seek(pb, mxf->body_partition_offset[0], SEEK_SET); if ((err = mxf_write_opatom_body_partition(s)) < 0) @@ -3091,7 +3094,7 @@ } avio_seek(pb, 0, SEEK_SET); - if (mxf->edit_unit_byte_count && s->oformat != &ff_mxf_opatom_muxer) { + if (mxf->edit_unit_byte_count && !IS_OPATOM(s)) { if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) < 0) return err; mxf_write_klv_fill(s); @@ -3259,52 +3262,52 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_mxf_muxer = { - .name = "mxf", - .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"), - .mime_type = "application/mxf", - .extensions = "mxf", +const FFOutputFormat ff_mxf_muxer = { + .p.name = "mxf", + .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"), + .p.mime_type = "application/mxf", + .p.extensions = "mxf", .priv_data_size = sizeof(MXFContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .init = mxf_init, .write_packet = mxf_write_packet, .write_trailer = mxf_write_footer, .deinit = mxf_deinit, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, .interleave_packet = mxf_interleave, - .priv_class = &mxf_muxer_class, + .p.priv_class = &mxf_muxer_class, }; -const AVOutputFormat ff_mxf_d10_muxer = { - .name = "mxf_d10", - .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"), - .mime_type = "application/mxf", +const FFOutputFormat ff_mxf_d10_muxer = { + .p.name = "mxf_d10", + .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"), + .p.mime_type = "application/mxf", .priv_data_size = sizeof(MXFContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .init = mxf_init, .write_packet = mxf_write_packet, .write_trailer = mxf_write_footer, .deinit = mxf_deinit, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, .interleave_packet = mxf_interleave, - .priv_class = &mxf_d10_muxer_class, + .p.priv_class = &mxf_d10_muxer_class, }; -const AVOutputFormat ff_mxf_opatom_muxer = { - .name = "mxf_opatom", - .long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"), - .mime_type = "application/mxf", - .extensions = "mxf", +const FFOutputFormat ff_mxf_opatom_muxer = { + .p.name = "mxf_opatom", + .p.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) Operational Pattern Atom"), + .p.mime_type = "application/mxf", + .p.extensions = "mxf", .priv_data_size = sizeof(MXFContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_DNXHD, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_DNXHD, .init = mxf_init, .write_packet = mxf_write_packet, .write_trailer = mxf_write_footer, .deinit = mxf_deinit, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, .interleave_packet = mxf_interleave, - .priv_class = &mxf_opatom_muxer_class, + .p.priv_class = &mxf_opatom_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/mxf.h 2023-03-03 13:29:59.000000000 +0000 @@ -54,6 +54,7 @@ AudioChannelLabelSubDescriptor, SoundfieldGroupLabelSubDescriptor, GroupOfSoundfieldGroupsLabelSubDescriptor, + FFV1SubDescriptor, }; enum MXFFrameLayout { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nsvdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nsvdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nsvdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nsvdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -195,6 +195,7 @@ { AV_CODEC_ID_VP4, MKTAG('V', 'P', '4', '0') }, */ { AV_CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') }, /* cf sample xvid decoder from nsv_codec_sdk.zip */ + { AV_CODEC_ID_H264, MKTAG('H', '2', '6', '4') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', '3') }, { AV_CODEC_ID_NONE, 0 }, }; @@ -203,6 +204,7 @@ { AV_CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') }, { AV_CODEC_ID_AAC, MKTAG('A', 'A', 'C', ' ') }, { AV_CODEC_ID_AAC, MKTAG('A', 'A', 'C', 'P') }, + { AV_CODEC_ID_AAC, MKTAG('A', 'A', 'V', ' ') }, { AV_CODEC_ID_AAC, MKTAG('V', 'L', 'B', ' ') }, { AV_CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', ' ') }, { AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') }, @@ -461,6 +463,22 @@ st->codecpar->codec_tag = atag; st->codecpar->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag); + if (atag == MKTAG('A', 'A', 'V', ' ')) { + static const uint8_t aav_pce[] = { + 0x12, 0x00, 0x05, 0x08, 0x48, 0x00, + 0x20, 0x00, 0xC6, 0x40, 0x04, 0x4C, + 0x61, 0x76, 0x63, 0x56, 0xE5, 0x00, + 0x00, 0x00, + }; + int ret; + + if ((ret = ff_alloc_extradata(st->codecpar, sizeof(aav_pce))) < 0) + return ret; + + st->codecpar->sample_rate = 44100; + memcpy(st->codecpar->extradata, aav_pce, sizeof(aav_pce)); + } + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */ /* set timebase to common denominator of ms and framerate */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nullenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nullenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nullenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nullenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,12 +27,12 @@ return 0; } -const AVOutputFormat ff_null_muxer = { - .name = "null", - .long_name = NULL_IF_CONFIG_SMALL("raw null video"), - .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), - .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, +const FFOutputFormat ff_null_muxer = { + .p.name = "null", + .p.long_name = NULL_IF_CONFIG_SMALL("raw null video"), + .p.audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, .write_packet = null_write_packet, - .flags = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_NOFILE | AVFMT_NOTIMESTAMPS, .interleave_packet = ff_interleave_packet_passthrough, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -1132,7 +1132,6 @@ } sm_size = avio_tell(bc) - pkt->pos; size -= sm_size; - pkt->size -= sm_size; } ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/nutenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -516,7 +516,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc) { AVFormatContext *s = nut->avf; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; int count = 0, dyn_size; @@ -525,7 +525,7 @@ return ret; ff_standardize_creation_time(s); - while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) + while ((t = av_dict_iterate(s->metadata, t))) count += add_info(dyn_bc, t->key, t->value); put_v(bc, 0); //stream_if_plus1 @@ -544,7 +544,7 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) { AVFormatContext *s= nut->avf; AVStream* st = s->streams[stream_id]; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf=NULL; int count=0, dyn_size, i; @@ -552,7 +552,7 @@ if (ret < 0) return ret; - while ((t = av_dict_get(st->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) + while ((t = av_dict_iterate(st->metadata, t))) count += add_info(dyn_bc, t->key, t->value); for (i=0; ff_nut_dispositions[i].flag; ++i) { if (st->disposition & ff_nut_dispositions[i].flag) @@ -587,7 +587,7 @@ { AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVChapter *ch = nut->avf->chapters[id]; int ret, dyn_size, count = 0; @@ -600,7 +600,7 @@ put_tt(nut, nut->chapter[id].time_base, bc, ch->start); // chapter_start put_v(bc, ch->end - ch->start); // chapter_len - while ((t = av_dict_get(ch->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) + while ((t = av_dict_iterate(ch->metadata, t))) count += add_info(dyn_bc, t->key, t->value); put_v(bc, count); @@ -1253,20 +1253,20 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_nut_muxer = { - .name = "nut", - .long_name = NULL_IF_CONFIG_SMALL("NUT"), - .mime_type = "video/x-nut", - .extensions = "nut", +const FFOutputFormat ff_nut_muxer = { + .p.name = "nut", + .p.long_name = NULL_IF_CONFIG_SMALL("NUT"), + .p.mime_type = "video/x-nut", + .p.extensions = "nut", .priv_data_size = sizeof(NUTContext), - .audio_codec = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS : + .p.audio_codec = CONFIG_LIBVORBIS ? AV_CODEC_ID_VORBIS : CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_MPEG4, + .p.video_codec = AV_CODEC_ID_MPEG4, .write_header = nut_write_header, .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .deinit = nut_write_deinit, - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, - .codec_tag = ff_nut_codec_tags, - .priv_class = &class, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, + .p.codec_tag = ff_nut_codec_tags, + .p.priv_class = &class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "version.h" #include "vorbiscomment.h" @@ -688,7 +689,7 @@ int i; if (pkt) - return ogg_write_packet_internal(s, pkt); + return pkt->size ? ogg_write_packet_internal(s, pkt) : 0; for (i = 0; i < s->nb_streams; i++) { OGGStreamContext *oggstream = s->streams[i]->priv_data; @@ -746,11 +747,11 @@ } #if CONFIG_OGG_MUXER -const AVOutputFormat ff_ogg_muxer = { - .name = "ogg", - .long_name = NULL_IF_CONFIG_SMALL("Ogg"), - .mime_type = "application/ogg", - .extensions = "ogg" +const FFOutputFormat ff_ogg_muxer = { + .p.name = "ogg", + .p.long_name = NULL_IF_CONFIG_SMALL("Ogg"), + .p.mime_type = "application/ogg", + .p.extensions = "ogg" #if !CONFIG_OGV_MUXER ",ogv" #endif @@ -762,90 +763,90 @@ #endif , .priv_data_size = sizeof(OGGContext), - .audio_codec = CONFIG_LIBVORBIS_ENCODER ? + .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC, - .video_codec = AV_CODEC_ID_THEORA, + .p.video_codec = AV_CODEC_ID_THEORA, .init = ogg_init, .write_header = ogg_write_header, .write_packet = ogg_write_packet, .write_trailer = ogg_write_trailer, .deinit = ogg_free, - .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, - .priv_class = &ogg_muxer_class, + .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, + .p.priv_class = &ogg_muxer_class, }; #endif #if CONFIG_OGA_MUXER -const AVOutputFormat ff_oga_muxer = { - .name = "oga", - .long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"), - .mime_type = "audio/ogg", - .extensions = "oga", +const FFOutputFormat ff_oga_muxer = { + .p.name = "oga", + .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Audio"), + .p.mime_type = "audio/ogg", + .p.extensions = "oga", .priv_data_size = sizeof(OGGContext), - .audio_codec = AV_CODEC_ID_FLAC, + .p.audio_codec = AV_CODEC_ID_FLAC, .init = ogg_init, .write_header = ogg_write_header, .write_packet = ogg_write_packet, .write_trailer = ogg_write_trailer, .deinit = ogg_free, - .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, - .priv_class = &ogg_muxer_class, + .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, + .p.priv_class = &ogg_muxer_class, }; #endif #if CONFIG_OGV_MUXER -const AVOutputFormat ff_ogv_muxer = { - .name = "ogv", - .long_name = NULL_IF_CONFIG_SMALL("Ogg Video"), - .mime_type = "video/ogg", - .extensions = "ogv", +const FFOutputFormat ff_ogv_muxer = { + .p.name = "ogv", + .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Video"), + .p.mime_type = "video/ogg", + .p.extensions = "ogv", .priv_data_size = sizeof(OGGContext), - .audio_codec = CONFIG_LIBVORBIS_ENCODER ? + .p.audio_codec = CONFIG_LIBVORBIS_ENCODER ? AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC, - .video_codec = CONFIG_LIBTHEORA_ENCODER ? + .p.video_codec = CONFIG_LIBTHEORA_ENCODER ? AV_CODEC_ID_THEORA : AV_CODEC_ID_VP8, .init = ogg_init, .write_header = ogg_write_header, .write_packet = ogg_write_packet, .write_trailer = ogg_write_trailer, .deinit = ogg_free, - .flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, - .priv_class = &ogg_muxer_class, + .p.flags = AVFMT_TS_NEGATIVE | AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH, + .p.priv_class = &ogg_muxer_class, }; #endif #if CONFIG_SPX_MUXER -const AVOutputFormat ff_spx_muxer = { - .name = "spx", - .long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"), - .mime_type = "audio/ogg", - .extensions = "spx", +const FFOutputFormat ff_spx_muxer = { + .p.name = "spx", + .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Speex"), + .p.mime_type = "audio/ogg", + .p.extensions = "spx", .priv_data_size = sizeof(OGGContext), - .audio_codec = AV_CODEC_ID_SPEEX, + .p.audio_codec = AV_CODEC_ID_SPEEX, .init = ogg_init, .write_header = ogg_write_header, .write_packet = ogg_write_packet, .write_trailer = ogg_write_trailer, .deinit = ogg_free, - .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, - .priv_class = &ogg_muxer_class, + .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, + .p.priv_class = &ogg_muxer_class, }; #endif #if CONFIG_OPUS_MUXER -const AVOutputFormat ff_opus_muxer = { - .name = "opus", - .long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"), - .mime_type = "audio/ogg", - .extensions = "opus", +const FFOutputFormat ff_opus_muxer = { + .p.name = "opus", + .p.long_name = NULL_IF_CONFIG_SMALL("Ogg Opus"), + .p.mime_type = "audio/ogg", + .p.extensions = "opus", .priv_data_size = sizeof(OGGContext), - .audio_codec = AV_CODEC_ID_OPUS, + .p.audio_codec = AV_CODEC_ID_OPUS, .init = ogg_init, .write_header = ogg_write_header, .write_packet = ogg_write_packet, .write_trailer = ogg_write_trailer, .deinit = ogg_free, - .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, - .priv_class = &ogg_muxer_class, + .p.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH, + .p.priv_class = &ogg_muxer_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggparseflac.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggparseflac.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggparseflac.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/oggparseflac.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,6 +19,7 @@ */ #include +#include "libavcodec/avcodec.h" #include "libavcodec/get_bits.h" #include "libavcodec/flac.h" #include "avformat.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/omaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/omaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/omaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/omaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "avio_internal.h" #include "id3v2.h" #include "internal.h" +#include "mux.h" #include "oma.h" #include "rawenc.h" @@ -91,14 +92,14 @@ return 0; } -const AVOutputFormat ff_oma_muxer = { - .name = "oma", - .long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"), - .mime_type = "audio/x-oma", - .extensions = "oma", - .audio_codec = AV_CODEC_ID_ATRAC3, +const FFOutputFormat ff_oma_muxer = { + .p.name = "oma", + .p.long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"), + .p.mime_type = "audio/x-oma", + .p.extensions = "oma", + .p.audio_codec = AV_CODEC_ID_ATRAC3, .write_header = oma_write_header, .write_packet = ff_raw_write_packet, - .codec_tag = ff_oma_codec_tags_list, - .flags = AVFMT_NOTIMESTAMPS, + .p.codec_tag = ff_oma_codec_tags_list, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/options.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/options.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/options.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/options.c 2023-03-03 13:29:59.000000000 +0000 @@ -151,10 +151,12 @@ return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist); } +#if FF_API_AVFORMAT_IO_CLOSE void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb) { avio_close(pb); } +#endif static int io_close2_default(AVFormatContext *s, AVIOContext *pb) { @@ -172,7 +174,11 @@ s = &si->pub; s->av_class = &av_format_context_class; s->io_open = io_open_default; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS s->io_close = ff_format_io_close_default; +FF_ENABLE_DEPRECATION_WARNINGS +#endif s->io_close2= io_close2_default; av_opt_set_defaults(s); @@ -257,10 +263,7 @@ return NULL; st = &sti->pub; -#if FF_API_AVSTREAM_CLASS st->av_class = &stream_class; -#endif - st->codecpar = avcodec_parameters_alloc(); if (!st->codecpar) goto fail; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/os_support.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/os_support.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/os_support.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/os_support.h 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,7 @@ #ifdef _WIN32 # include +# include # ifdef lseek # undef lseek # endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/pcmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/pcmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/pcmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/pcmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,18 +22,19 @@ #include "config_components.h" #include "avformat.h" +#include "mux.h" #include "rawenc.h" #define PCMDEF_0(name_, long_name_, ext, codec) #define PCMDEF_1(name_, long_name_, ext, codec) \ -const AVOutputFormat ff_pcm_ ## name_ ## _muxer = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .extensions = ext, \ - .audio_codec = codec, \ - .video_codec = AV_CODEC_ID_NONE, \ +const FFOutputFormat ff_pcm_ ## name_ ## _muxer = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.extensions = ext, \ + .p.audio_codec = codec, \ + .p.video_codec = AV_CODEC_ID_NONE, \ + .p.flags = AVFMT_NOTIMESTAMPS, \ .write_packet = ff_raw_write_packet, \ - .flags = AVFMT_NOTIMESTAMPS, \ }; #define PCMDEF_2(name, long_name, ext, codec, enabled) \ PCMDEF_ ## enabled(name, long_name, ext, codec) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/protocols.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/protocols.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/protocols.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/protocols.c 2023-03-03 13:29:59.000000000 +0000 @@ -17,6 +17,7 @@ */ #include "libavutil/avstring.h" +#include "libavutil/log.h" #include "libavutil/mem.h" #include "url.h" @@ -28,6 +29,7 @@ extern const URLProtocol ff_concatf_protocol; extern const URLProtocol ff_crypto_protocol; extern const URLProtocol ff_data_protocol; +extern const URLProtocol ff_fd_protocol; extern const URLProtocol ff_ffrtmpcrypt_protocol; extern const URLProtocol ff_ffrtmphttp_protocol; extern const URLProtocol ff_file_protocol; @@ -71,8 +73,8 @@ extern const URLProtocol ff_libssh_protocol; extern const URLProtocol ff_libsmbclient_protocol; extern const URLProtocol ff_libzmq_protocol; -extern const URLProtocol ff_ipfs_protocol; -extern const URLProtocol ff_ipns_protocol; +extern const URLProtocol ff_ipfs_gateway_protocol; +extern const URLProtocol ff_ipns_gateway_protocol; #include "libavformat/protocol_list.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,12 +24,10 @@ #include "avformat.h" #include "internal.h" -#include "avio_internal.h" #include "rawdec.h" #include "libavutil/opt.h" -#include "libavutil/parseutils.h" -#include "libavutil/pixdesc.h" -#include "libavutil/intreadwrite.h" + +#include "libavcodec/avcodec.h" #define RAW_PACKET_SIZE 1024 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rawenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -59,16 +59,16 @@ /* Note: Do not forget to add new entries to the Makefile as well. */ #if CONFIG_AC3_MUXER -const AVOutputFormat ff_ac3_muxer = { - .name = "ac3", - .long_name = NULL_IF_CONFIG_SMALL("raw AC-3"), - .mime_type = "audio/x-ac3", - .extensions = "ac3", - .audio_codec = AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_ac3_muxer = { + .p.name = "ac3", + .p.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"), + .p.mime_type = "audio/x-ac3", + .p.extensions = "ac3", + .p.audio_codec = AV_CODEC_ID_AC3, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif @@ -92,266 +92,266 @@ return 0; } -const AVOutputFormat ff_adx_muxer = { - .name = "adx", - .long_name = NULL_IF_CONFIG_SMALL("CRI ADX"), - .extensions = "adx", - .audio_codec = AV_CODEC_ID_ADPCM_ADX, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_adx_muxer = { + .p.name = "adx", + .p.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"), + .p.extensions = "adx", + .p.audio_codec = AV_CODEC_ID_ADPCM_ADX, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, .write_trailer = adx_write_trailer, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_APTX_MUXER -const AVOutputFormat ff_aptx_muxer = { - .name = "aptx", - .long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"), - .extensions = "aptx", - .audio_codec = AV_CODEC_ID_APTX, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_aptx_muxer = { + .p.name = "aptx", + .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"), + .p.extensions = "aptx", + .p.audio_codec = AV_CODEC_ID_APTX, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_APTX_HD_MUXER -const AVOutputFormat ff_aptx_hd_muxer = { - .name = "aptx_hd", - .long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"), - .extensions = "aptxhd", - .audio_codec = AV_CODEC_ID_APTX_HD, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_aptx_hd_muxer = { + .p.name = "aptx_hd", + .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"), + .p.extensions = "aptxhd", + .p.audio_codec = AV_CODEC_ID_APTX_HD, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_AVS2_MUXER -const AVOutputFormat ff_avs2_muxer = { - .name = "avs2", - .long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"), - .extensions = "avs,avs2", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_AVS2, +const FFOutputFormat ff_avs2_muxer = { + .p.name = "avs2", + .p.long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"), + .p.extensions = "avs,avs2", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_AVS2, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_AVS3_MUXER -const AVOutputFormat ff_avs3_muxer = { - .name = "avs3", - .long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"), - .extensions = "avs3", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_AVS3, +const FFOutputFormat ff_avs3_muxer = { + .p.name = "avs3", + .p.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"), + .p.extensions = "avs3", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_AVS3, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_CAVSVIDEO_MUXER -const AVOutputFormat ff_cavsvideo_muxer = { - .name = "cavsvideo", - .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"), - .extensions = "cavs", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_CAVS, +const FFOutputFormat ff_cavsvideo_muxer = { + .p.name = "cavsvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"), + .p.extensions = "cavs", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_CAVS, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_CODEC2RAW_MUXER -const AVOutputFormat ff_codec2raw_muxer = { - .name = "codec2raw", - .long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"), - .audio_codec = AV_CODEC_ID_CODEC2, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_codec2raw_muxer = { + .p.name = "codec2raw", + .p.long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"), + .p.audio_codec = AV_CODEC_ID_CODEC2, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_DATA_MUXER -const AVOutputFormat ff_data_muxer = { - .name = "data", - .long_name = NULL_IF_CONFIG_SMALL("raw data"), +const FFOutputFormat ff_data_muxer = { + .p.name = "data", + .p.long_name = NULL_IF_CONFIG_SMALL("raw data"), .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_DFPWM_MUXER -const AVOutputFormat ff_dfpwm_muxer = { - .name = "dfpwm", - .long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"), - .extensions = "dfpwm", - .audio_codec = AV_CODEC_ID_DFPWM, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_dfpwm_muxer = { + .p.name = "dfpwm", + .p.long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"), + .p.extensions = "dfpwm", + .p.audio_codec = AV_CODEC_ID_DFPWM, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_DIRAC_MUXER -const AVOutputFormat ff_dirac_muxer = { - .name = "dirac", - .long_name = NULL_IF_CONFIG_SMALL("raw Dirac"), - .extensions = "drc,vc2", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_DIRAC, +const FFOutputFormat ff_dirac_muxer = { + .p.name = "dirac", + .p.long_name = NULL_IF_CONFIG_SMALL("raw Dirac"), + .p.extensions = "drc,vc2", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_DIRAC, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_DNXHD_MUXER -const AVOutputFormat ff_dnxhd_muxer = { - .name = "dnxhd", - .long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), - .extensions = "dnxhd,dnxhr", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_DNXHD, +const FFOutputFormat ff_dnxhd_muxer = { + .p.name = "dnxhd", + .p.long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"), + .p.extensions = "dnxhd,dnxhr", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_DNXHD, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_DTS_MUXER -const AVOutputFormat ff_dts_muxer = { - .name = "dts", - .long_name = NULL_IF_CONFIG_SMALL("raw DTS"), - .mime_type = "audio/x-dca", - .extensions = "dts", - .audio_codec = AV_CODEC_ID_DTS, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_dts_muxer = { + .p.name = "dts", + .p.long_name = NULL_IF_CONFIG_SMALL("raw DTS"), + .p.mime_type = "audio/x-dca", + .p.extensions = "dts", + .p.audio_codec = AV_CODEC_ID_DTS, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_EAC3_MUXER -const AVOutputFormat ff_eac3_muxer = { - .name = "eac3", - .long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"), - .mime_type = "audio/x-eac3", - .extensions = "eac3", - .audio_codec = AV_CODEC_ID_EAC3, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_eac3_muxer = { + .p.name = "eac3", + .p.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"), + .p.mime_type = "audio/x-eac3", + .p.extensions = "eac3,ec3", + .p.audio_codec = AV_CODEC_ID_EAC3, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_G722_MUXER -const AVOutputFormat ff_g722_muxer = { - .name = "g722", - .long_name = NULL_IF_CONFIG_SMALL("raw G.722"), - .mime_type = "audio/G722", - .extensions = "g722", - .audio_codec = AV_CODEC_ID_ADPCM_G722, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_g722_muxer = { + .p.name = "g722", + .p.long_name = NULL_IF_CONFIG_SMALL("raw G.722"), + .p.mime_type = "audio/G722", + .p.extensions = "g722", + .p.audio_codec = AV_CODEC_ID_ADPCM_G722, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_G723_1_MUXER -const AVOutputFormat ff_g723_1_muxer = { - .name = "g723_1", - .long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"), - .mime_type = "audio/g723", - .extensions = "tco,rco", - .audio_codec = AV_CODEC_ID_G723_1, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_g723_1_muxer = { + .p.name = "g723_1", + .p.long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"), + .p.mime_type = "audio/g723", + .p.extensions = "tco,rco", + .p.audio_codec = AV_CODEC_ID_G723_1, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_G726_MUXER -const AVOutputFormat ff_g726_muxer = { - .name = "g726", - .long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"), - .audio_codec = AV_CODEC_ID_ADPCM_G726, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_g726_muxer = { + .p.name = "g726", + .p.long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"), + .p.audio_codec = AV_CODEC_ID_ADPCM_G726, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_G726LE_MUXER -const AVOutputFormat ff_g726le_muxer = { - .name = "g726le", - .long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"), - .audio_codec = AV_CODEC_ID_ADPCM_G726LE, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_g726le_muxer = { + .p.name = "g726le", + .p.long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"), + .p.audio_codec = AV_CODEC_ID_ADPCM_G726LE, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_GSM_MUXER -const AVOutputFormat ff_gsm_muxer = { - .name = "gsm", - .long_name = NULL_IF_CONFIG_SMALL("raw GSM"), - .mime_type = "audio/x-gsm", - .extensions = "gsm", - .audio_codec = AV_CODEC_ID_GSM, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_gsm_muxer = { + .p.name = "gsm", + .p.long_name = NULL_IF_CONFIG_SMALL("raw GSM"), + .p.mime_type = "audio/x-gsm", + .p.extensions = "gsm", + .p.audio_codec = AV_CODEC_ID_GSM, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_H261_MUXER -const AVOutputFormat ff_h261_muxer = { - .name = "h261", - .long_name = NULL_IF_CONFIG_SMALL("raw H.261"), - .mime_type = "video/x-h261", - .extensions = "h261", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_H261, +const FFOutputFormat ff_h261_muxer = { + .p.name = "h261", + .p.long_name = NULL_IF_CONFIG_SMALL("raw H.261"), + .p.mime_type = "video/x-h261", + .p.extensions = "h261", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_H261, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_H263_MUXER -const AVOutputFormat ff_h263_muxer = { - .name = "h263", - .long_name = NULL_IF_CONFIG_SMALL("raw H.263"), - .mime_type = "video/x-h263", - .extensions = "h263", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_H263, +const FFOutputFormat ff_h263_muxer = { + .p.name = "h263", + .p.long_name = NULL_IF_CONFIG_SMALL("raw H.263"), + .p.mime_type = "video/x-h263", + .p.extensions = "h263", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_H263, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif @@ -365,16 +365,16 @@ return 1; } -const AVOutputFormat ff_h264_muxer = { - .name = "h264", - .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"), - .extensions = "h264,264", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_H264, +const FFOutputFormat ff_h264_muxer = { + .p.name = "h264", + .p.long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"), + .p.extensions = "h264,264", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_H264, .init = force_one_stream, .write_packet = ff_raw_write_packet, .check_bitstream = h264_check_bitstream, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif @@ -388,97 +388,97 @@ return 1; } -const AVOutputFormat ff_hevc_muxer = { - .name = "hevc", - .long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"), - .extensions = "hevc,h265,265", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_HEVC, +const FFOutputFormat ff_hevc_muxer = { + .p.name = "hevc", + .p.long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"), + .p.extensions = "hevc,h265,265", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_HEVC, .init = force_one_stream, .write_packet = ff_raw_write_packet, .check_bitstream = hevc_check_bitstream, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_M4V_MUXER -const AVOutputFormat ff_m4v_muxer = { - .name = "m4v", - .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"), - .extensions = "m4v", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_MPEG4, +const FFOutputFormat ff_m4v_muxer = { + .p.name = "m4v", + .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"), + .p.extensions = "m4v", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_MPEG4, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_MJPEG_MUXER -const AVOutputFormat ff_mjpeg_muxer = { - .name = "mjpeg", - .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"), - .mime_type = "video/x-mjpeg", - .extensions = "mjpg,mjpeg", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_MJPEG, +const FFOutputFormat ff_mjpeg_muxer = { + .p.name = "mjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"), + .p.mime_type = "video/x-mjpeg", + .p.extensions = "mjpg,mjpeg", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_MJPEG, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_MLP_MUXER -const AVOutputFormat ff_mlp_muxer = { - .name = "mlp", - .long_name = NULL_IF_CONFIG_SMALL("raw MLP"), - .extensions = "mlp", - .audio_codec = AV_CODEC_ID_MLP, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_mlp_muxer = { + .p.name = "mlp", + .p.long_name = NULL_IF_CONFIG_SMALL("raw MLP"), + .p.extensions = "mlp", + .p.audio_codec = AV_CODEC_ID_MLP, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_MP2_MUXER -const AVOutputFormat ff_mp2_muxer = { - .name = "mp2", - .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), - .mime_type = "audio/mpeg", - .extensions = "mp2,m2a,mpa", - .audio_codec = AV_CODEC_ID_MP2, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_mp2_muxer = { + .p.name = "mp2", + .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + .p.mime_type = "audio/mpeg", + .p.extensions = "mp2,m2a,mpa", + .p.audio_codec = AV_CODEC_ID_MP2, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_MPEG1VIDEO_MUXER -const AVOutputFormat ff_mpeg1video_muxer = { - .name = "mpeg1video", - .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"), - .mime_type = "video/mpeg", - .extensions = "mpg,mpeg,m1v", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_MPEG1VIDEO, +const FFOutputFormat ff_mpeg1video_muxer = { + .p.name = "mpeg1video", + .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"), + .p.mime_type = "video/mpeg", + .p.extensions = "mpg,mpeg,m1v", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_MPEG1VIDEO, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_MPEG2VIDEO_MUXER -const AVOutputFormat ff_mpeg2video_muxer = { - .name = "mpeg2video", - .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"), - .extensions = "m2v", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, +const FFOutputFormat ff_mpeg2video_muxer = { + .p.name = "mpeg2video", + .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"), + .p.extensions = "m2v", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif @@ -489,66 +489,66 @@ return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert"); } -const AVOutputFormat ff_obu_muxer = { - .name = "obu", - .long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"), - .extensions = "obu", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_AV1, +const FFOutputFormat ff_obu_muxer = { + .p.name = "obu", + .p.long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"), + .p.extensions = "obu", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_AV1, .init = force_one_stream, .write_packet = ff_raw_write_packet, .check_bitstream = obu_check_bitstream, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_RAWVIDEO_MUXER -const AVOutputFormat ff_rawvideo_muxer = { - .name = "rawvideo", - .long_name = NULL_IF_CONFIG_SMALL("raw video"), - .extensions = "yuv,rgb", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_RAWVIDEO, +const FFOutputFormat ff_rawvideo_muxer = { + .p.name = "rawvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("raw video"), + .p.extensions = "yuv,rgb", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_SBC_MUXER -const AVOutputFormat ff_sbc_muxer = { - .name = "sbc", - .long_name = NULL_IF_CONFIG_SMALL("raw SBC"), - .mime_type = "audio/x-sbc", - .extensions = "sbc,msbc", - .audio_codec = AV_CODEC_ID_SBC, +const FFOutputFormat ff_sbc_muxer = { + .p.name = "sbc", + .p.long_name = NULL_IF_CONFIG_SMALL("raw SBC"), + .p.mime_type = "audio/x-sbc", + .p.extensions = "sbc,msbc", + .p.audio_codec = AV_CODEC_ID_SBC, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_TRUEHD_MUXER -const AVOutputFormat ff_truehd_muxer = { - .name = "truehd", - .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"), - .extensions = "thd", - .audio_codec = AV_CODEC_ID_TRUEHD, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_truehd_muxer = { + .p.name = "truehd", + .p.long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"), + .p.extensions = "thd", + .p.audio_codec = AV_CODEC_ID_TRUEHD, + .p.video_codec = AV_CODEC_ID_NONE, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif #if CONFIG_VC1_MUXER -const AVOutputFormat ff_vc1_muxer = { - .name = "vc1", - .long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"), - .extensions = "vc1", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_VC1, +const FFOutputFormat ff_vc1_muxer = { + .p.name = "vc1", + .p.long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"), + .p.extensions = "vc1", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_VC1, .init = force_one_stream, .write_packet = ff_raw_write_packet, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/replaygain.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/replaygain.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/replaygain.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/replaygain.c 2023-03-03 13:29:59.000000000 +0000 @@ -60,7 +60,7 @@ } } - if (abs(db) > (INT32_MAX - mb) / 100000) + if (llabs(db) > (INT32_MAX - mb) / 100000) return min; return db * 100000 + sign * mb; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riff.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riff.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riff.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riff.c 2023-03-03 13:29:59.000000000 +0000 @@ -237,6 +237,7 @@ { AV_CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('V', 'Y', 'U', 'Y') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') }, + { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'Y', 'U', 'V') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '8', ' ', ' ') }, { AV_CODEC_ID_RAWVIDEO, MKTAG('H', 'D', 'Y', 'C') }, @@ -302,7 +303,6 @@ { AV_CODEC_ID_V210, MKTAG('C', '2', '1', '0') }, { AV_CODEC_ID_V308, MKTAG('v', '3', '0', '8') }, { AV_CODEC_ID_V408, MKTAG('v', '4', '0', '8') }, - { AV_CODEC_ID_AYUV, MKTAG('A', 'Y', 'U', 'V') }, { AV_CODEC_ID_V410, MKTAG('v', '4', '1', '0') }, { AV_CODEC_ID_YUV4, MKTAG('y', 'u', 'v', '4') }, { AV_CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, @@ -499,6 +499,8 @@ { AV_CODEC_ID_MVHA, MKTAG('M', 'V', 'H', 'A') }, { AV_CODEC_ID_MV30, MKTAG('M', 'V', '3', '0') }, { AV_CODEC_ID_NOTCHLC, MKTAG('n', 'l', 'c', '1') }, + { AV_CODEC_ID_VQC, MKTAG('V', 'Q', 'C', '1') }, + { AV_CODEC_ID_VQC, MKTAG('V', 'Q', 'C', '2') }, { AV_CODEC_ID_NONE, 0 } }; @@ -558,12 +560,14 @@ { AV_CODEC_ID_WMALOSSLESS, 0x0163 }, { AV_CODEC_ID_XMA1, 0x0165 }, { AV_CODEC_ID_XMA2, 0x0166 }, + { AV_CODEC_ID_FTR, 0x0180 }, { AV_CODEC_ID_ADPCM_CT, 0x0200 }, { AV_CODEC_ID_DVAUDIO, 0x0215 }, { AV_CODEC_ID_DVAUDIO, 0x0216 }, { AV_CODEC_ID_ATRAC3, 0x0270 }, { AV_CODEC_ID_MSNSIREN, 0x028E }, { AV_CODEC_ID_ADPCM_G722, 0x028F }, + { AV_CODEC_ID_MISC4, 0x0350 }, { AV_CODEC_ID_IMC, 0x0401 }, { AV_CODEC_ID_IAC, 0x0402 }, { AV_CODEC_ID_ON2AVC, 0x0500 }, @@ -579,11 +583,14 @@ { AV_CODEC_ID_DTS, 0x2001 }, { AV_CODEC_ID_SONIC, 0x2048 }, { AV_CODEC_ID_SONIC_LS, 0x2048 }, + { AV_CODEC_ID_G729, 0x2222 }, { AV_CODEC_ID_PCM_MULAW, 0x6c75 }, { AV_CODEC_ID_AAC, 0x706d }, { AV_CODEC_ID_AAC, 0x4143 }, + { AV_CODEC_ID_FTR, 0x4180 }, { AV_CODEC_ID_XAN_DPCM, 0x594a }, { AV_CODEC_ID_G729, 0x729A }, + { AV_CODEC_ID_FTR, 0x8180 }, { AV_CODEC_ID_G723_1, 0xA100 }, /* Comverse Infosys Ltd. G723 1 */ { AV_CODEC_ID_AAC, 0xA106 }, { AV_CODEC_ID_SPEEX, 0xA109 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -94,7 +94,7 @@ int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian) { - int id, channels; + int id, channels = 0; uint64_t bitrate = 0; if (size < 14) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/riffenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,6 @@ #include "libavutil/dict.h" #include "libavutil/log.h" #include "libavutil/mathematics.h" -#include "libavcodec/avcodec.h" #include "libavcodec/bytestream.h" #include "avformat.h" #include "avio_internal.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rka.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rka.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rka.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rka.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * RKA demuxer + * 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/dict.h" +#include "libavutil/intreadwrite.h" + +#include "apetag.h" +#include "avformat.h" +#include "avio_internal.h" +#include "demux.h" +#include "internal.h" + +typedef struct RKAContext { + int total_frames, currentframe; + int frame_size; + int last_frame_size; +} RKAContext; + +static int rka_probe(const AVProbeData *p) +{ + if (AV_RL32(&p->buf[0]) == MKTAG('R', 'K', 'A', '7') && + AV_RL32(&p->buf[4]) > 0 && + AV_RL32(&p->buf[8]) > 0 && + p->buf[12] > 0 && + p->buf[12] <= 2 && + (p->buf[13] == 8 || p->buf[13] == 16) && + (p->buf[15] & 2) != 0) + return AVPROBE_SCORE_EXTENSION + 30; + return 0; +} + +static int rka_read_header(AVFormatContext *s) +{ + int64_t nb_samples, size_offset; + RKAContext *c = s->priv_data; + int channels, bps, samplerate; + AVCodecParameters *par; + int64_t framepos; + AVStream *st; + int ret; + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + + par = st->codecpar; + ret = ff_get_extradata(s, par, s->pb, 16); + if (ret < 0) + return ret; + + nb_samples = AV_RL32(par->extradata + 4); + samplerate = AV_RL32(par->extradata + 8); + channels = par->extradata[12]; + if (channels == 0) + return AVERROR_INVALIDDATA; + bps = par->extradata[13]; + if (bps == 0) + return AVERROR_INVALIDDATA; + size_offset = avio_rl32(s->pb); + framepos = avio_tell(s->pb); + c->frame_size = 131072; + + avpriv_set_pts_info(st, 64, 1, samplerate); + st->start_time = 0; + + avio_seek(s->pb, size_offset, SEEK_SET); + c->total_frames = (nb_samples + c->frame_size - 1) / c->frame_size; + c->last_frame_size = nb_samples % c->frame_size; + + for (int i = 0; i < c->total_frames; i++) { + int r, end = 0; + int64_t size; + + if (avio_feof(s->pb)) + break; + + size = avio_rl24(s->pb); + if (size == 0) { + end = 1; + size = size_offset - framepos; + if (size <= 0) + break; + } + + if ((r = av_add_index_entry(st, framepos, (i * 131072LL) / (channels * (bps >> 3)), + size, 0, AVINDEX_KEYFRAME)) < 0) + return r; + framepos += size; + + if (end) + break; + } + + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->codec_id = AV_CODEC_ID_RKA; + par->ch_layout.nb_channels = channels; + par->sample_rate = samplerate; + par->bits_per_raw_sample = bps; + st->duration = 8LL*nb_samples / (channels * bps); + + if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) + ff_ape_parse_tag(s); + + avio_seek(s->pb, 20, SEEK_SET); + + return 0; +} + +static int rka_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + RKAContext *c = s->priv_data; + AVStream *st = s->streams[0]; + FFStream *const sti = ffstream(st); + int size, ret; + + if (avio_feof(s->pb)) + return AVERROR_EOF; + + if (c->currentframe >= sti->nb_index_entries) + return AVERROR_EOF; + + size = sti->index_entries[c->currentframe].size; + + ret = av_get_packet(s->pb, pkt, size); + pkt->dts = sti->index_entries[c->currentframe++].timestamp; + pkt->duration = c->currentframe == c->total_frames ? c->last_frame_size : + 131072; + return ret; +} + +static int rka_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) +{ + RKAContext *c = s->priv_data; + AVStream *st = s->streams[stream_index]; + int index = av_index_search_timestamp(st, timestamp, flags); + if (index < 0) + return -1; + if (avio_seek(s->pb, ffstream(st)->index_entries[index].pos, SEEK_SET) < 0) + return -1; + + c->currentframe = index; + + return 0; +} + +const AVInputFormat ff_rka_demuxer = { + .name = "rka", + .long_name = NULL_IF_CONFIG_SMALL("RKA (RK Audio)"), + .priv_data_size = sizeof(RKAContext), + .read_probe = rka_probe, + .read_header = rka_read_header, + .read_packet = rka_read_packet, + .read_seek = rka_read_seek, + .extensions = "rka", +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "avformat.h" #include "avio_internal.h" +#include "mux.h" #include "rm.h" #include "libavutil/dict.h" @@ -465,16 +466,16 @@ } -const AVOutputFormat ff_rm_muxer = { - .name = "rm", - .long_name = NULL_IF_CONFIG_SMALL("RealMedia"), - .mime_type = "application/vnd.rn-realmedia", - .extensions = "rm,ra", +const FFOutputFormat ff_rm_muxer = { + .p.name = "rm", + .p.long_name = NULL_IF_CONFIG_SMALL("RealMedia"), + .p.mime_type = "application/vnd.rn-realmedia", + .p.extensions = "rm,ra", .priv_data_size = sizeof(RMMuxContext), - .audio_codec = AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_RV10, + .p.audio_codec = AV_CODEC_ID_AC3, + .p.video_codec = AV_CODEC_ID_RV10, .write_header = rm_write_header, .write_packet = rm_write_packet, .write_trailer = rm_write_trailer, - .codec_tag = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 }, + .p.codec_tag = (const AVCodecTag* const []){ ff_rm_codec_tags, 0 }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rsoenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rsoenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rsoenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rsoenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "rawenc.h" #include "riff.h" #include "rso.h" @@ -91,15 +92,15 @@ return 0; } -const AVOutputFormat ff_rso_muxer = { - .name = "rso", - .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"), - .extensions = "rso", - .audio_codec = AV_CODEC_ID_PCM_U8, - .video_codec = AV_CODEC_ID_NONE, +const FFOutputFormat ff_rso_muxer = { + .p.name = "rso", + .p.long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO"), + .p.extensions = "rso", + .p.audio_codec = AV_CODEC_ID_PCM_U8, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = rso_write_header, .write_packet = ff_raw_write_packet, .write_trailer = rso_write_trailer, - .codec_tag = ff_rso_codec_tags_list, - .flags = AVFMT_NOTIMESTAMPS, + .p.codec_tag = ff_rso_codec_tags_list, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "avformat.h" #include "mpegts.h" #include "internal.h" +#include "mux.h" #include "libavutil/mathematics.h" #include "libavutil/random_seed.h" #include "libavutil/opt.h" @@ -659,15 +660,15 @@ return 0; } -const AVOutputFormat ff_rtp_muxer = { - .name = "rtp", - .long_name = NULL_IF_CONFIG_SMALL("RTP output"), +const FFOutputFormat ff_rtp_muxer = { + .p.name = "rtp", + .p.long_name = NULL_IF_CONFIG_SMALL("RTP output"), .priv_data_size = sizeof(RTPMuxContext), - .audio_codec = AV_CODEC_ID_PCM_MULAW, - .video_codec = AV_CODEC_ID_MPEG4, + .p.audio_codec = AV_CODEC_ID_PCM_MULAW, + .p.video_codec = AV_CODEC_ID_MPEG4, .write_header = rtp_write_header, .write_packet = rtp_write_packet, .write_trailer = rtp_write_trailer, - .priv_class = &rtp_muxer_class, - .flags = AVFMT_TS_NONSTRICT, + .p.priv_class = &rtp_muxer_class, + .p.flags = AVFMT_TS_NONSTRICT, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc_mpegts.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc_mpegts.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc_mpegts.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtpenc_mpegts.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavutil/opt.h" #include "avformat.h" #include "avio_internal.h" +#include "mux.h" typedef struct MuxChain { const AVClass *class; @@ -187,14 +188,14 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_rtp_mpegts_muxer = { - .name = "rtp_mpegts", - .long_name = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"), +const FFOutputFormat ff_rtp_mpegts_muxer = { + .p.name = "rtp_mpegts", + .p.long_name = NULL_IF_CONFIG_SMALL("RTP/mpegts output format"), .priv_data_size = sizeof(MuxChain), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_MPEG4, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_MPEG4, .write_header = rtp_mpegts_write_header, .write_packet = rtp_mpegts_write_packet, .write_trailer = rtp_mpegts_write_close, - .priv_class = &rtp_mpegts_class, + .p.priv_class = &rtp_mpegts_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "libavutil/dict.h" #include "libavutil/opt.h" #include "libavutil/time.h" +#include "libavcodec/codec_desc.h" #include "avformat.h" #include "avio_internal.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtspenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtspenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtspenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/rtspenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -244,15 +244,15 @@ return 0; } -const AVOutputFormat ff_rtsp_muxer = { - .name = "rtsp", - .long_name = NULL_IF_CONFIG_SMALL("RTSP output"), +const FFOutputFormat ff_rtsp_muxer = { + .p.name = "rtsp", + .p.long_name = NULL_IF_CONFIG_SMALL("RTSP output"), .priv_data_size = sizeof(RTSPState), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_MPEG4, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_MPEG4, .write_header = rtsp_write_header, .write_packet = rtsp_write_packet, .write_trailer = rtsp_write_close, - .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, - .priv_class = &rtsp_muxer_class, + .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, + .p.priv_class = &rtsp_muxer_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sapenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sapenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sapenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sapenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -268,14 +268,14 @@ return ff_write_chained(rtpctx, 0, pkt, s, 0); } -const AVOutputFormat ff_sap_muxer = { - .name = "sap", - .long_name = NULL_IF_CONFIG_SMALL("SAP output"), +const FFOutputFormat ff_sap_muxer = { + .p.name = "sap", + .p.long_name = NULL_IF_CONFIG_SMALL("SAP output"), .priv_data_size = sizeof(struct SAPState), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_MPEG4, + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_MPEG4, .write_header = sap_write_header, .write_packet = sap_write_packet, .write_trailer = sap_write_close, - .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, + .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sccenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sccenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sccenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sccenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/log.h" #include "libavutil/intreadwrite.h" @@ -111,13 +112,13 @@ return 0; } -const AVOutputFormat ff_scc_muxer = { - .name = "scc", - .long_name = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"), - .extensions = "scc", +const FFOutputFormat ff_scc_muxer = { + .p.name = "scc", + .p.long_name = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"), + .p.extensions = "scc", + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, + .p.subtitle_codec = AV_CODEC_ID_EIA_608, .priv_data_size = sizeof(SCCContext), .write_header = scc_write_header, .write_packet = scc_write_packet, - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_EIA_608, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdns.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdns.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdns.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdns.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * SDNS demuxer + * 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/channel_layout.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "demux.h" +#include "internal.h" + +static int sdns_probe(const AVProbeData *p) +{ + if (AV_RL32(p->buf) != MKTAG('S','D','N','S')) + return 0; + if (AV_RB32(p->buf + 8) <= 0) + return 0; + if (AV_RB32(p->buf + 12) <= 0 || + AV_RB32(p->buf + 12) > 128) + return 0; + return AVPROBE_SCORE_MAX / 3; +} + +static int sdns_read_header(AVFormatContext *s) +{ + AVIOContext *pb = s->pb; + AVCodecParameters *par; + int channels, ret; + AVStream *st; + + avio_skip(pb, 8); + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + + par = st->codecpar; + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->codec_id = AV_CODEC_ID_XMA1; + par->sample_rate = avio_rb32(pb); + channels = avio_rb32(pb); + if (channels <= 0 || channels > 128) + return AVERROR_INVALIDDATA; + av_channel_layout_default(&par->ch_layout, channels); + if (par->sample_rate <= 0) + return AVERROR_INVALIDDATA; + par->block_align = 2048; + if ((ret = ff_alloc_extradata(par, 8 + 20 * ((channels + 1) / 2))) < 0) + return ret; + memset(par->extradata, 0, 28); + par->extradata[4] = (channels + 1) / 2; + for (int i = 0; i < par->extradata[4]; i++) + par->extradata[8 + 20 * i + 17] = FFMIN(2, channels - i * 2); + avpriv_set_pts_info(st, 64, 1, par->sample_rate); + avio_seek(pb, 0x1000, SEEK_SET); + + return 0; +} + +static int sdns_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret; + + if (avio_feof(s->pb)) + return AVERROR_EOF; + ret = av_get_packet(s->pb, pkt, 2048); + pkt->stream_index = 0; + + return ret; +} + +const AVInputFormat ff_sdns_demuxer = { + .name = "sdns", + .long_name = NULL_IF_CONFIG_SMALL("Xbox SDNS"), + .read_probe = sdns_probe, + .read_header = sdns_read_header, + .read_packet = sdns_read_packet, + .flags = AVFMT_GENERIC_INDEX, + .extensions = "sdns", +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/sdp.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,6 +33,7 @@ #include "avc.h" #include "hevc.h" #include "rtp.h" +#include "version.h" #if CONFIG_NETWORK #include "network.h" #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/seek.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/seek.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/seek.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/seek.c 2023-03-03 13:29:59.000000000 +0000 @@ -25,6 +25,8 @@ #include "libavutil/mathematics.h" #include "libavutil/timestamp.h" +#include "libavcodec/avcodec.h" + #include "avformat.h" #include "avio_internal.h" #include "demux.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segafilmenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segafilmenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segafilmenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segafilmenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -280,13 +280,13 @@ ffio_free_dyn_buf(&film->header); } -const AVOutputFormat ff_segafilm_muxer = { - .name = "film_cpk", - .long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"), - .extensions = "cpk", +const FFOutputFormat ff_segafilm_muxer = { + .p.name = "film_cpk", + .p.long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"), + .p.extensions = "cpk", .priv_data_size = sizeof(FILMOutputContext), - .audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR, - .video_codec = AV_CODEC_ID_CINEPAK, + .p.audio_codec = AV_CODEC_ID_PCM_S16BE_PLANAR, + .p.video_codec = AV_CODEC_ID_CINEPAK, .init = film_init, .write_trailer = film_write_header, .write_packet = film_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segment.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segment.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segment.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/segment.c 2023-03-03 13:29:59.000000000 +0000 @@ -93,6 +93,7 @@ int list_type; ///< set the list type AVIOContext *list_pb; ///< list file put-byte context int64_t time; ///< segment duration + int64_t min_seg_duration; ///< minimum segment duration int use_strftime; ///< flag to expand filename with strftime int increment_tc; ///< flag to increment timecode if found @@ -115,6 +116,7 @@ int64_t initial_offset; ///< initial timestamps offset, expressed in microseconds char *reference_stream_specifier; ///< reference stream specifier int reference_stream_index; + int64_t reference_stream_first_pts; ///< initial timestamp, expressed in microseconds int break_non_keyframes; int write_empty; @@ -158,7 +160,11 @@ oc->max_delay = s->max_delay; av_dict_copy(&oc->metadata, s->metadata, 0); oc->opaque = s->opaque; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS oc->io_close = s->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif oc->io_close2 = s->io_close2; oc->io_open = s->io_open; oc->flags = s->flags; @@ -167,11 +173,9 @@ AVStream *st, *ist = s->streams[i]; AVCodecParameters *ipar = ist->codecpar, *opar; - if (!(st = avformat_new_stream(oc, NULL))) + st = ff_stream_clone(oc, ist); + if (!st) return AVERROR(ENOMEM); - ret = ff_stream_encode_params_copy(st, ist); - if (ret < 0) - return ret; opar = st->codecpar; if (!oc->oformat->codec_tag || av_codec_get_id (oc->oformat->codec_tag, ipar->codec_tag) == opar->codec_id || @@ -698,6 +702,9 @@ return AVERROR(EINVAL); } + if (seg->times_str || seg->frames_str) + seg->min_seg_duration = 0; + if (seg->times_str) { if ((ret = parse_times(s, &seg->times, &seg->nb_times, seg->times_str)) < 0) return ret; @@ -712,6 +719,10 @@ } seg->clocktime_offset = seg->time - (seg->clocktime_offset % seg->time); } + if (seg->min_seg_duration > seg->time) { + av_log(s, AV_LOG_ERROR, "min_seg_duration cannot be greater than segment_time\n"); + return AVERROR(EINVAL); + } } if (seg->list) { @@ -740,6 +751,8 @@ seg->reference_stream_index, av_get_media_type_string(s->streams[seg->reference_stream_index]->codecpar->codec_type)); + seg->reference_stream_first_pts = AV_NOPTS_VALUE; + seg->oformat = av_guess_format(seg->format, s->url, NULL); if (!seg->oformat) @@ -841,7 +854,7 @@ { SegmentContext *seg = s->priv_data; AVStream *st = s->streams[pkt->stream_index]; - int64_t end_pts = INT64_MAX, offset; + int64_t end_pts = INT64_MAX, offset, pkt_pts_avtb; int start_frame = INT_MAX; int ret; struct tm ti; @@ -892,11 +905,27 @@ pkt->flags & AV_PKT_FLAG_KEY, pkt->stream_index == seg->reference_stream_index ? seg->frame_count : -1); + if (seg->reference_stream_first_pts == AV_NOPTS_VALUE && + pkt->stream_index == seg->reference_stream_index && + pkt->pts != AV_NOPTS_VALUE) { + seg->reference_stream_first_pts = av_rescale_q(pkt->pts, st->time_base, AV_TIME_BASE_Q); + } + + if (seg->reference_stream_first_pts != AV_NOPTS_VALUE) { + end_pts += (INT64_MAX - end_pts >= seg->reference_stream_first_pts) ? + seg->reference_stream_first_pts : + INT64_MAX - end_pts; + } + + if (pkt->pts != AV_NOPTS_VALUE) + pkt_pts_avtb = av_rescale_q(pkt->pts, st->time_base, AV_TIME_BASE_Q); + if (pkt->stream_index == seg->reference_stream_index && (pkt->flags & AV_PKT_FLAG_KEY || seg->break_non_keyframes) && (seg->segment_frame_count > 0 || seg->write_empty) && (seg->cut_pending || seg->frame_count >= start_frame || (pkt->pts != AV_NOPTS_VALUE && + pkt_pts_avtb - seg->cur_entry.start_pts >= seg->min_seg_duration && av_compare_ts(pkt->pts, st->time_base, end_pts - seg->time_delta, AV_TIME_BASE_Q) >= 0))) { /* sanitize end time in case last packet didn't have a defined duration */ @@ -951,7 +980,8 @@ av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &st->time_base)); ret = ff_write_chained(seg->avf, pkt->stream_index, pkt, s, - seg->initial_offset || seg->reset_timestamps || seg->avf->oformat->interleave_packet); + seg->initial_offset || seg->reset_timestamps || + ffofmt(seg->avf->oformat)->interleave_packet); fail: /* Use st->index here as the packet returned from ff_write_chained() @@ -991,9 +1021,9 @@ { SegmentContext *seg = s->priv_data; AVFormatContext *oc = seg->avf; - if (oc->oformat->check_bitstream) { + if (ffofmt(oc->oformat)->check_bitstream) { AVStream *const ost = oc->streams[st->index]; - int ret = oc->oformat->check_bitstream(oc, ost, pkt); + int ret = ffofmt(oc->oformat)->check_bitstream(oc, ost, pkt); if (ret == 1) { FFStream *const sti = ffstream(st); FFStream *const osti = ffstream(ost); @@ -1033,6 +1063,7 @@ { "segment_clocktime_wrap_duration", "set segment clocktime wrapping duration", OFFSET(clocktime_wrap_duration), AV_OPT_TYPE_DURATION, {.i64 = INT64_MAX}, 0, INT64_MAX, E}, { "segment_time", "set segment duration", OFFSET(time),AV_OPT_TYPE_DURATION, {.i64 = 2000000}, INT64_MIN, INT64_MAX, E }, { "segment_time_delta","set approximation value used for the segment times", OFFSET(time_delta), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, E }, + { "min_seg_duration", "set minimum segment duration", OFFSET(min_seg_duration), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, E }, { "segment_times", "set segment split time points", OFFSET(times_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E }, { "segment_frames", "set segment split frame numbers", OFFSET(frames_str),AV_OPT_TYPE_STRING,{.str = NULL}, 0, 0, E }, { "segment_wrap", "set number after which the index wraps", OFFSET(segment_idx_wrap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E }, @@ -1059,33 +1090,33 @@ }; #if CONFIG_SEGMENT_MUXER -const AVOutputFormat ff_segment_muxer = { - .name = "segment", - .long_name = NULL_IF_CONFIG_SMALL("segment"), +const FFOutputFormat ff_segment_muxer = { + .p.name = "segment", + .p.long_name = NULL_IF_CONFIG_SMALL("segment"), + .p.flags = AVFMT_NOFILE|AVFMT_GLOBALHEADER, + .p.priv_class = &seg_class, .priv_data_size = sizeof(SegmentContext), - .flags = AVFMT_NOFILE|AVFMT_GLOBALHEADER, .init = seg_init, .write_header = seg_write_header, .write_packet = seg_write_packet, .write_trailer = seg_write_trailer, .deinit = seg_free, .check_bitstream = seg_check_bitstream, - .priv_class = &seg_class, }; #endif #if CONFIG_STREAM_SEGMENT_MUXER -const AVOutputFormat ff_stream_segment_muxer = { - .name = "stream_segment,ssegment", - .long_name = NULL_IF_CONFIG_SMALL("streaming segment muxer"), - .priv_data_size = sizeof(SegmentContext), - .flags = AVFMT_NOFILE, +const FFOutputFormat ff_stream_segment_muxer = { + .p.name = "stream_segment,ssegment", + .p.long_name = NULL_IF_CONFIG_SMALL("streaming segment muxer"), + .p.flags = AVFMT_NOFILE, + .p.priv_class = &seg_class, + .priv_data_size = sizeof(SegmentContext), .init = seg_init, .write_header = seg_write_header, .write_packet = seg_write_packet, .write_trailer = seg_write_trailer, .deinit = seg_free, .check_bitstream = seg_check_bitstream, - .priv_class = &seg_class, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/serdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/serdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/serdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/serdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -68,13 +68,13 @@ avio_skip(s->pb, 8); switch (color_id) { - case 0: pix_fmt = depth <= 8 ? AV_PIX_FMT_GRAY8 : endian ? AV_PIX_FMT_GRAY16LE : AV_PIX_FMT_GRAY16BE; break; - case 8: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_RGGB8 : endian ? AV_PIX_FMT_BAYER_RGGB16LE : AV_PIX_FMT_BAYER_RGGB16BE; break; - case 9: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GRBG8 : endian ? AV_PIX_FMT_BAYER_GRBG16LE : AV_PIX_FMT_BAYER_GRBG16BE; break; - case 10: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GBRG8 : endian ? AV_PIX_FMT_BAYER_GBRG16LE : AV_PIX_FMT_BAYER_GBRG16BE; break; - case 11: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_BGGR8 : endian ? AV_PIX_FMT_BAYER_BGGR16LE : AV_PIX_FMT_BAYER_BGGR16BE; break; - case 100: pix_fmt = depth <= 8 ? AV_PIX_FMT_RGB24 : endian ? AV_PIX_FMT_RGB48LE : AV_PIX_FMT_RGB48BE; break; - case 101: pix_fmt = depth <= 8 ? AV_PIX_FMT_BGR24 : endian ? AV_PIX_FMT_BGR48LE : AV_PIX_FMT_BGR48BE; break; + case 0: pix_fmt = depth <= 8 ? AV_PIX_FMT_GRAY8 : endian ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY16LE; break; + case 8: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_RGGB8 : endian ? AV_PIX_FMT_BAYER_RGGB16BE : AV_PIX_FMT_BAYER_RGGB16LE; break; + case 9: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GRBG8 : endian ? AV_PIX_FMT_BAYER_GRBG16BE : AV_PIX_FMT_BAYER_GRBG16LE; break; + case 10: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_GBRG8 : endian ? AV_PIX_FMT_BAYER_GBRG16BE : AV_PIX_FMT_BAYER_GBRG16LE; break; + case 11: pix_fmt = depth <= 8 ? AV_PIX_FMT_BAYER_BGGR8 : endian ? AV_PIX_FMT_BAYER_BGGR16BE : AV_PIX_FMT_BAYER_BGGR16LE; break; + case 100: pix_fmt = depth <= 8 ? AV_PIX_FMT_RGB24 : endian ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB48LE; break; + case 101: pix_fmt = depth <= 8 ? AV_PIX_FMT_BGR24 : endian ? AV_PIX_FMT_BGR48BE : AV_PIX_FMT_BGR48LE; break; default: return AVERROR_PATCHWELCOME; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smjpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smjpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smjpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smjpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,7 +35,7 @@ static int smjpeg_write_header(AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *pb = s->pb; int n, tag; @@ -48,7 +48,7 @@ avio_wb32(pb, 0); ff_standardize_creation_time(s); - while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(s->metadata, t))) { avio_wl32(pb, SMJPEG_TXT); avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3); avio_write(pb, t->key, strlen(t->key)); @@ -133,15 +133,15 @@ return 0; } -const AVOutputFormat ff_smjpeg_muxer = { - .name = "smjpeg", - .long_name = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"), +const FFOutputFormat ff_smjpeg_muxer = { + .p.name = "smjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("Loki SDL MJPEG"), .priv_data_size = sizeof(SMJPEGMuxContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_MJPEG, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_MJPEG, .write_header = smjpeg_write_header, .write_packet = smjpeg_write_packet, .write_trailer = smjpeg_write_trailer, - .flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT, - .codec_tag = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 }, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT, + .p.codec_tag = (const AVCodecTag *const []){ ff_codec_smjpeg_video_tags, ff_codec_smjpeg_audio_tags, 0 }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smoothstreamingenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smoothstreamingenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smoothstreamingenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/smoothstreamingenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -637,16 +637,16 @@ }; -const AVOutputFormat ff_smoothstreaming_muxer = { - .name = "smoothstreaming", - .long_name = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"), +const FFOutputFormat ff_smoothstreaming_muxer = { + .p.name = "smoothstreaming", + .p.long_name = NULL_IF_CONFIG_SMALL("Smooth Streaming Muxer"), + .p.audio_codec = AV_CODEC_ID_AAC, + .p.video_codec = AV_CODEC_ID_H264, + .p.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE, + .p.priv_class = &ism_class, .priv_data_size = sizeof(SmoothStreamingContext), - .audio_codec = AV_CODEC_ID_AAC, - .video_codec = AV_CODEC_ID_H264, - .flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE, .write_header = ism_write_header, .write_packet = ism_write_packet, .write_trailer = ism_write_trailer, .deinit = ism_free, - .priv_class = &ism_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/soxenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/soxenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/soxenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/soxenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -34,6 +34,7 @@ #include "libavutil/dict.h" #include "avformat.h" #include "avio_internal.h" +#include "mux.h" #include "rawenc.h" #include "sox.h" @@ -104,15 +105,15 @@ return 0; } -const AVOutputFormat ff_sox_muxer = { - .name = "sox", - .long_name = NULL_IF_CONFIG_SMALL("SoX native"), - .extensions = "sox", +const FFOutputFormat ff_sox_muxer = { + .p.name = "sox", + .p.long_name = NULL_IF_CONFIG_SMALL("SoX native"), + .p.extensions = "sox", .priv_data_size = sizeof(SoXContext), - .audio_codec = AV_CODEC_ID_PCM_S32LE, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S32LE, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = sox_write_header, .write_packet = ff_raw_write_packet, .write_trailer = sox_write_trailer, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,7 @@ #include "libavcodec/adts_parser.h" #include "avformat.h" +#include "internal.h" #include "spdif.h" static int spdif_get_offset_and_codec(AVFormatContext *s, @@ -93,6 +94,10 @@ *offset = 8192; *codec = AV_CODEC_ID_DTS; break; + case IEC61937_EAC3: + *offset = 24576; + *codec = AV_CODEC_ID_EAC3; + break; default: if (s) { /* be silent during a probe */ avpriv_request_sample(s, "Data type 0x%04x in IEC 61937", @@ -170,6 +175,16 @@ return 0; } +static int spdif_get_pkt_size_bits(int type, int code) +{ + switch (type & 0xff) { + case IEC61937_EAC3: + return code << 3; + default: + return code; + } +} + int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt) { AVIOContext *pb = s->pb; @@ -185,7 +200,7 @@ } data_type = avio_rl16(pb); - pkt_size_bits = avio_rl16(pb); + pkt_size_bits = spdif_get_pkt_size_bits(data_type, avio_rl16(pb)); if (pkt_size_bits % 16) avpriv_request_sample(s, "Packet not ending at a 16-bit boundary"); @@ -218,6 +233,8 @@ } st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = codec_id; + if (codec_id == AV_CODEC_ID_EAC3) + ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL; } else if (codec_id != s->streams[0]->codecpar->codec_id) { avpriv_report_missing_feature(s, "Codec change in IEC 61937"); return AVERROR_PATCHWELCOME; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/spdifenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,6 +48,7 @@ #include "avformat.h" #include "avio_internal.h" +#include "mux.h" #include "spdif.h" #include "libavcodec/ac3defs.h" #include "libavcodec/adts_parser.h" @@ -410,8 +411,8 @@ static const struct { unsigned int pos; - const uint8_t *code; unsigned int len; + const uint8_t *code; } mat_codes[] = { MAT_CODE(0, mat_start_code), MAT_CODE(30708, mat_middle_code), @@ -673,16 +674,16 @@ return 0; } -const AVOutputFormat ff_spdif_muxer = { - .name = "spdif", - .long_name = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"), - .extensions = "spdif", +const FFOutputFormat ff_spdif_muxer = { + .p.name = "spdif", + .p.long_name = NULL_IF_CONFIG_SMALL("IEC 61937 (used on S/PDIF - IEC958)"), + .p.extensions = "spdif", .priv_data_size = sizeof(IEC61937Context), - .audio_codec = AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_AC3, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = spdif_write_header, .write_packet = spdif_write_packet, .deinit = spdif_deinit, - .flags = AVFMT_NOTIMESTAMPS, - .priv_class = &spdif_class, + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &spdif_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/srtenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/srtenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/srtenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/srtenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/log.h" #include "libavutil/intreadwrite.h" @@ -96,14 +97,14 @@ return 0; } -const AVOutputFormat ff_srt_muxer = { - .name = "srt", - .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), - .mime_type = "application/x-subrip", - .extensions = "srt", +const FFOutputFormat ff_srt_muxer = { + .p.name = "srt", + .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .p.mime_type = "application/x-subrip", + .p.extensions = "srt", + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, + .p.subtitle_codec = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .write_header = srt_write_header, .write_packet = srt_write_packet, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_SUBRIP, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/supenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/supenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/supenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/supenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" #include "libavutil/intreadwrite.h" #define SUP_PGS_MAGIC 0x5047 /* "PG", big endian */ @@ -84,13 +85,13 @@ return 0; } -const AVOutputFormat ff_sup_muxer = { - .name = "sup", - .long_name = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"), - .extensions = "sup", - .mime_type = "application/x-pgs", - .subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE, +const FFOutputFormat ff_sup_muxer = { + .p.name = "sup", + .p.long_name = NULL_IF_CONFIG_SMALL("raw HDMV Presentation Graphic Stream subtitles"), + .p.extensions = "sup", + .p.mime_type = "application/x-pgs", + .p.subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE, + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, .write_header = sup_write_header, .write_packet = sup_write_packet, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/swfenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/swfenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/swfenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/swfenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "libavutil/fifo.h" #include "avformat.h" #include "flv.h" +#include "mux.h" #include "swf.h" #define AUDIO_FIFO_SIZE 65536 @@ -547,33 +548,33 @@ } #if CONFIG_SWF_MUXER -const AVOutputFormat ff_swf_muxer = { - .name = "swf", - .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"), - .mime_type = "application/x-shockwave-flash", - .extensions = "swf", +const FFOutputFormat ff_swf_muxer = { + .p.name = "swf", + .p.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"), + .p.mime_type = "application/x-shockwave-flash", + .p.extensions = "swf", .priv_data_size = sizeof(SWFEncContext), - .audio_codec = AV_CODEC_ID_MP3, - .video_codec = AV_CODEC_ID_FLV1, + .p.audio_codec = AV_CODEC_ID_MP3, + .p.video_codec = AV_CODEC_ID_FLV1, .write_header = swf_write_header, .write_packet = swf_write_packet, .write_trailer = swf_write_trailer, .deinit = swf_deinit, - .flags = AVFMT_TS_NONSTRICT, + .p.flags = AVFMT_TS_NONSTRICT, }; #endif #if CONFIG_AVM2_MUXER -const AVOutputFormat ff_avm2_muxer = { - .name = "avm2", - .long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"), - .mime_type = "application/x-shockwave-flash", +const FFOutputFormat ff_avm2_muxer = { + .p.name = "avm2", + .p.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"), + .p.mime_type = "application/x-shockwave-flash", .priv_data_size = sizeof(SWFEncContext), - .audio_codec = AV_CODEC_ID_MP3, - .video_codec = AV_CODEC_ID_FLV1, + .p.audio_codec = AV_CODEC_ID_MP3, + .p.video_codec = AV_CODEC_ID_FLV1, .write_header = swf_write_header, .write_packet = swf_write_packet, .write_trailer = swf_write_trailer, .deinit = swf_deinit, - .flags = AVFMT_TS_NONSTRICT, + .p.flags = AVFMT_TS_NONSTRICT, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tee.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tee.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tee.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tee.c 2023-03-03 13:29:59.000000000 +0000 @@ -236,7 +236,11 @@ av_dict_copy(&avf2->metadata, avf->metadata, 0); avf2->opaque = avf->opaque; avf2->io_open = avf->io_open; +#if FF_API_AVFORMAT_IO_CLOSE +FF_DISABLE_DEPRECATION_WARNINGS avf2->io_close = avf->io_close; +FF_ENABLE_DEPRECATION_WARNINGS +#endif avf2->io_close2 = avf->io_close2; avf2->interrupt_callback = avf->interrupt_callback; avf2->flags = avf->flags; @@ -284,14 +288,11 @@ } tee_slave->stream_map[i] = stream_count++; - if (!(st2 = avformat_new_stream(avf2, NULL))) { + st2 = ff_stream_clone(avf2, st); + if (!st2) { ret = AVERROR(ENOMEM); goto end; } - - ret = ff_stream_encode_params_copy(st2, st); - if (ret < 0) - goto end; } ret = ff_format_output_open(avf2, filename, &options); @@ -605,13 +606,13 @@ return ret_all; } -const AVOutputFormat ff_tee_muxer = { - .name = "tee", - .long_name = NULL_IF_CONFIG_SMALL("Multiple muxer tee"), +const FFOutputFormat ff_tee_muxer = { + .p.name = "tee", + .p.long_name = NULL_IF_CONFIG_SMALL("Multiple muxer tee"), .priv_data_size = sizeof(TeeContext), .write_header = tee_write_header, .write_trailer = tee_write_trailer, .write_packet = tee_write_packet, - .priv_class = &tee_muxer_class, - .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, + .p.priv_class = &tee_muxer_class, + .p.flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/teeproto.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/teeproto.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/teeproto.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/teeproto.c 2023-03-03 13:29:59.000000000 +0000 @@ -131,6 +131,18 @@ h->is_streamed |= c->child[i].url_context->is_streamed; } + h->max_packet_size = 0; + for (i = 0; i < c->child_count; i++) { + int max = c->child[i].url_context->max_packet_size; + if (!max) + continue; + + if (!h->max_packet_size) + h->max_packet_size = max; + else if (h->max_packet_size > max) + h->max_packet_size = max; + } + return 0; fail: tee_close(h); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tests/imf.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tests/imf.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tests/imf.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/tests/imf.c 2023-03-03 13:29:59.000000000 +0000 @@ -70,6 +70,11 @@ " urn:uuid:8e097bb0-cff7-4969-a692-bad47bfb528f" " " "" + "" + "false" + "24" + "02:10:01.23" + "" "24000 1001" "" "" @@ -288,6 +293,7 @@ { xmlDocPtr doc; FFIMFCPL *cpl; + char tc_buf[AV_TIMECODE_STR_SIZE]; int ret; doc = xmlReadMemory(cpl_doc, strlen(cpl_doc), NULL, NULL, 0); @@ -306,6 +312,7 @@ printf("%s\n", cpl->content_title_utf8); printf(AV_PRI_URN_UUID "\n", AV_UUID_ARG(cpl->id_uuid)); printf("%i %i\n", cpl->edit_rate.num, cpl->edit_rate.den); + printf("%s\n", av_timecode_make_string(cpl->tc, tc_buf, 0)); printf("Marker resource count: %" PRIu32 "\n", cpl->main_markers_track->resource_count); for (uint32_t i = 0; i < cpl->main_markers_track->resource_count; i++) { @@ -338,10 +345,9 @@ return 0; } -static int test_bad_cpl_parsing(void) +static int test_bad_cpl_parsing(FFIMFCPL **cpl) { xmlDocPtr doc; - FFIMFCPL *cpl; int ret; doc = xmlReadMemory(cpl_bad_doc, strlen(cpl_bad_doc), NULL, NULL, 0); @@ -350,7 +356,7 @@ return 1; } - ret = ff_imf_parse_cpl_from_xml_dom(doc, &cpl); + ret = ff_imf_parse_cpl_from_xml_dom(doc, cpl); xmlFreeDoc(doc); if (ret) { printf("CPL parsing failed.\n"); @@ -506,6 +512,7 @@ int main(int argc, char *argv[]) { + FFIMFCPL *cpl; int ret = 0; if (test_cpl_parsing() != 0) @@ -518,8 +525,12 @@ ret = 1; printf("#### The following should fail ####\n"); - if (test_bad_cpl_parsing() == 0) + if (test_bad_cpl_parsing(&cpl) == 0) { ret = 1; + } else if (cpl) { + printf("Improper cleanup after failed CPL parsing\n"); + ret = 1; + } printf("#### End failing test ####\n"); return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttaenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttaenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttaenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttaenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,6 +27,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" typedef struct TTAMuxContext { AVIOContext *seek_table; @@ -165,14 +166,14 @@ avpriv_packet_list_free(&tta->queue); } -const AVOutputFormat ff_tta_muxer = { - .name = "tta", - .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), - .mime_type = "audio/x-tta", - .extensions = "tta", +const FFOutputFormat ff_tta_muxer = { + .p.name = "tta", + .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), + .p.mime_type = "audio/x-tta", + .p.extensions = "tta", .priv_data_size = sizeof(TTAMuxContext), - .audio_codec = AV_CODEC_ID_TTA, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_TTA, + .p.video_codec = AV_CODEC_ID_NONE, .init = tta_init, .deinit = tta_deinit, .write_header = tta_write_header, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttmlenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttmlenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttmlenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/ttmlenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,7 @@ #include "libavutil/avstring.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "ttmlenc.h" #include "libavcodec/ttmlenc.h" #include "libavutil/internal.h" @@ -91,7 +92,7 @@ if (!additional_data_size) { // simple case, we don't have to go through local_params and just // set default fall-back values (for old extradata format). - header_params->tt_element_params = ttml_default_namespacing; + header_params->tt_element_params = TTML_DEFAULT_NAMESPACING; header_params->pre_body_elements = ""; return 0; @@ -215,15 +216,15 @@ return 0; } -const AVOutputFormat ff_ttml_muxer = { - .name = "ttml", - .long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"), - .extensions = "ttml", - .mime_type = "text/ttml", +const FFOutputFormat ff_ttml_muxer = { + .p.name = "ttml", + .p.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"), + .p.extensions = "ttml", + .p.mime_type = "text/ttml", .priv_data_size = sizeof(TTMLMuxContext), - .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | + .p.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_TTML, + .p.subtitle_codec = AV_CODEC_ID_TTML, .write_header = ttml_write_header, .write_packet = ttml_write_packet, .write_trailer = ttml_write_trailer, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/udp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/udp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/udp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/udp.c 2023-03-03 13:29:59.000000000 +0000 @@ -487,6 +487,8 @@ UDPContext *s = h->priv_data; int old_cancelstate; + ff_thread_setname("udp-rx"); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate); pthread_mutex_lock(&s->mutex); if (ff_socket_nonblock(s->udp_fd, 0) < 0) { @@ -552,6 +554,8 @@ int64_t burst_interval = s->bitrate ? (s->burst_bits * 1000000 / s->bitrate) : 0; int64_t max_delay = s->bitrate ? ((int64_t)h->max_packet_size * 8 * 1000000 / s->bitrate + 1) : 0; + ff_thread_setname("udp-tx"); + pthread_mutex_lock(&s->mutex); if (ff_socket_nonblock(s->udp_fd, 0) < 0) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/uncodedframecrcenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/uncodedframecrcenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/uncodedframecrcenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/uncodedframecrcenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -165,14 +165,14 @@ return AVERROR(ENOSYS); } -const AVOutputFormat ff_uncodedframecrc_muxer = { - .name = "uncodedframecrc", - .long_name = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_RAWVIDEO, +const FFOutputFormat ff_uncodedframecrc_muxer = { + .p.name = "uncodedframecrc", + .p.long_name = NULL_IF_CONFIG_SMALL("uncoded framecrc testing"), + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_RAWVIDEO, + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | + AVFMT_TS_NEGATIVE, .write_header = write_header, .write_packet = write_packet, .write_uncoded_frame = write_frame, - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT | - AVFMT_TS_NEGATIVE, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vc1testenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vc1testenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vc1testenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vc1testenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "avformat.h" #include "internal.h" +#include "mux.h" typedef struct RCVContext { int frames; @@ -80,13 +81,13 @@ return 0; } -const AVOutputFormat ff_vc1t_muxer = { - .name = "vc1test", - .long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"), - .extensions = "rcv", +const FFOutputFormat ff_vc1t_muxer = { + .p.name = "vc1test", + .p.long_name = NULL_IF_CONFIG_SMALL("VC-1 test bitstream"), + .p.extensions = "rcv", .priv_data_size = sizeof(RCVContext), - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_WMV3, + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_WMV3, .write_header = vc1test_write_header, .write_packet = vc1test_write_packet, .write_trailer = vc1test_write_trailer, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 27 +#define LIBAVFORMAT_VERSION_MINOR 3 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,7 +29,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here -#define LIBAVFORMAT_VERSION_MAJOR 59 +#define LIBAVFORMAT_VERSION_MAJOR 60 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -41,11 +41,10 @@ * at once through the bump. This improves the git bisect-ability of the change. * */ -#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59) +#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61) #define FF_API_R_FRAME_RATE 1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vividas.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vividas.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vividas.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vividas.c 2023-03-03 13:29:59.000000000 +0000 @@ -683,6 +683,7 @@ if (viv->sb_entries[viv->current_sb_entry].flag == 0) { uint64_t v_size = ffio_read_varlen(pb); + int last = 0, last_start; if (!viv->num_audio) return AVERROR_INVALIDDATA; @@ -706,12 +707,18 @@ if (i > 0 && start == 0) break; + if (start < last) + return AVERROR_INVALIDDATA; viv->n_audio_subpackets = i + 1; + last = viv->audio_subpackets[i].start = start; viv->audio_subpackets[i].pcm_bytes = pcm_bytes; } + last_start = viv->audio_subpackets[viv->n_audio_subpackets].start = (int)(off - avio_tell(pb)); + if (last_start < last) + return AVERROR_INVALIDDATA; viv->current_audio_subpacket = 0; } else { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vocenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vocenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vocenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vocenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ #include "voc.h" #include "internal.h" +#include "mux.h" typedef struct voc_enc_context { @@ -96,17 +97,17 @@ return 0; } -const AVOutputFormat ff_voc_muxer = { - .name = "voc", - .long_name = NULL_IF_CONFIG_SMALL("Creative Voice"), - .mime_type = "audio/x-voc", - .extensions = "voc", +const FFOutputFormat ff_voc_muxer = { + .p.name = "voc", + .p.long_name = NULL_IF_CONFIG_SMALL("Creative Voice"), + .p.mime_type = "audio/x-voc", + .p.extensions = "voc", .priv_data_size = sizeof(VocEncContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = voc_write_header, .write_packet = voc_write_packet, .write_trailer = voc_write_trailer, - .codec_tag = ff_voc_codec_tags_list, - .flags = AVFMT_NOTIMESTAMPS, + .p.codec_tag = ff_voc_codec_tags_list, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vorbiscomment.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vorbiscomment.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vorbiscomment.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vorbiscomment.c 2023-03-03 13:29:59.000000000 +0000 @@ -45,17 +45,17 @@ len += strlen(vendor_string); if (chapters && nb_chapters) { for (int i = 0; i < nb_chapters; i++) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; len += 4 + 12 + 1 + 10; - while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(chapters[i]->metadata, tag))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); len += 4 + 10 + len1 + 1 + strlen(tag->value); } } } if (m) { - AVDictionaryEntry *tag = NULL; - while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { + const AVDictionaryEntry *tag = NULL; + while ((tag = av_dict_iterate(m, tag))) { len += 4 +strlen(tag->key) + 1 + strlen(tag->value); } } @@ -77,9 +77,9 @@ } if (m) { int count = av_dict_count(m) + cm_count; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; avio_wl32(pb, count); - while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(m, tag))) { int64_t len1 = strlen(tag->key); int64_t len2 = strlen(tag->value); if (len1+1+len2 > UINT32_MAX) @@ -109,7 +109,7 @@ avio_write(pb, chapter_time, 12); tag = NULL; - while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(chapters[i]->metadata, tag))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); int64_t len2 = strlen(tag->value); if (len1+1+len2+10 > UINT32_MAX) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,8 +22,11 @@ #include "libavutil/pixdesc.h" #include "libavutil/pixfmt.h" #include "libavcodec/avcodec.h" +#include "libavcodec/get_bits.h" #include "vpcc.h" +#define VP9_SYNCCODE 0x498342 + enum VPX_CHROMA_SUBSAMPLING { VPX_SUBSAMPLING_420_VERTICAL = 0, @@ -114,7 +117,41 @@ } } +static void parse_bitstream(GetBitContext *gb, int *profile, int *bit_depth) { + int keyframe, invisible; + + if (get_bits(gb, 2) != 0x2) // frame marker + return; + *profile = get_bits1(gb); + *profile |= get_bits1(gb) << 1; + if (*profile == 3) + *profile += get_bits1(gb); + + if (get_bits1(gb)) + return; + + keyframe = !get_bits1(gb); + invisible = !get_bits1(gb); + get_bits1(gb); + + if (keyframe) { + if (get_bits(gb, 24) != VP9_SYNCCODE) + return; + } else { + int intraonly = invisible ? get_bits1(gb) : 0; + if (!intraonly || get_bits(gb, 24) != VP9_SYNCCODE) + return; + if (*profile < 1) { + *bit_depth = 8; + return; + } + } + + *bit_depth = *profile <= 1 ? 8 : 10 + get_bits1(gb) * 2; +} + int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par, + const uint8_t *data, int len, AVRational *frame_rate, VPCC *vpcc) { int profile = par->profile; @@ -129,7 +166,17 @@ if (bit_depth < 0 || vpx_chroma_subsampling < 0) return AVERROR_INVALIDDATA; - if (profile == FF_PROFILE_UNKNOWN) { + if (len && (profile == FF_PROFILE_UNKNOWN || !bit_depth)) { + GetBitContext gb; + + int ret = init_get_bits8(&gb, data, len); + if (ret < 0) + return ret; + + parse_bitstream(&gb, &profile, &bit_depth); + } + + if (profile == FF_PROFILE_UNKNOWN && bit_depth) { if (vpx_chroma_subsampling == VPX_SUBSAMPLING_420_VERTICAL || vpx_chroma_subsampling == VPX_SUBSAMPLING_420_COLLOCATED_WITH_LUMA) { profile = (bit_depth == 8) ? FF_PROFILE_VP9_0 : FF_PROFILE_VP9_2; @@ -138,6 +185,9 @@ } } + if (profile == FF_PROFILE_UNKNOWN || !bit_depth) + av_log(s, AV_LOG_WARNING, "VP9 profile and/or bit depth not set or could not be derived\n"); + vpcc->profile = profile; vpcc->level = level; vpcc->bitdepth = bit_depth; @@ -148,12 +198,13 @@ } int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb, + const uint8_t *data, int len, AVCodecParameters *par) { VPCC vpcc; int ret; - ret = ff_isom_get_vpcc_features(s, par, NULL, &vpcc); + ret = ff_isom_get_vpcc_features(s, par, data, len, NULL, &vpcc); if (ret < 0) return ret; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/vpcc.h 2023-03-03 13:29:59.000000000 +0000 @@ -45,14 +45,19 @@ * * @param s address of the AVFormatContext for the logging context. * @param pb address of the AVIOContext where the vpcC shall be written. + * @param data address of a data array which contains coded bitstream data from + * which codec information can be extracted. May be NULL. + * @param len length of the data array. * @param par address of the AVCodecParameters which contains codec information. * @return >=0 in case of success, a negative value corresponding to an AVERROR * code in case of failure */ int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb, + const uint8_t *data, int len, AVCodecParameters *par); int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par, + const uint8_t *data, int len, AVRational *frame_rate, VPCC *vpcc); #endif /* AVFORMAT_VPCC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wady.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wady.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wady.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wady.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * WADY demuxer + * 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/channel_layout.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "demux.h" +#include "internal.h" +#include "pcm.h" + +static int wady_probe(const AVProbeData *p) +{ + if (AV_RL32(p->buf) != MKTAG('W','A','D','Y')) + return 0; + if (p->buf[4] != 0 || p->buf[5] == 0 || + AV_RL16(p->buf+6) == 0 || + AV_RL32(p->buf+8) == 0) + return 0; + + return AVPROBE_SCORE_MAX / 3 * 2; +} + +static int wady_read_header(AVFormatContext *s) +{ + AVIOContext *pb = s->pb; + AVCodecParameters *par; + int channels, ret; + AVStream *st; + + avio_skip(pb, 4); + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + + avio_skip(pb, 1); + par = st->codecpar; + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->codec_id = AV_CODEC_ID_WADY_DPCM; + par->format = AV_SAMPLE_FMT_S16; + if ((ret = ff_get_extradata(s, par, pb, 1)) < 0) + return ret; + channels = avio_rl16(pb); + if (channels == 0) + return AVERROR_INVALIDDATA; + av_channel_layout_default(&par->ch_layout, channels); + par->sample_rate = avio_rl32(pb); + if (par->sample_rate <= 0) + return AVERROR_INVALIDDATA; + avio_skip(pb, 4); + st->duration = avio_rl32(pb); + par->block_align = channels; + avpriv_set_pts_info(st, 64, 1, par->sample_rate); + + avio_seek(pb, 0x30, SEEK_SET); + + return 0; +} + +const AVInputFormat ff_wady_demuxer = { + .name = "wady", + .long_name = NULL_IF_CONFIG_SMALL("Marble WADY"), + .read_probe = wady_probe, + .read_header = wady_read_header, + .read_packet = ff_pcm_read_packet, + .read_seek = ff_pcm_read_seek, + .flags = AVFMT_GENERIC_INDEX, + .extensions = "way", +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavarc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavarc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavarc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavarc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * WavArc demuxer + * 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/channel_layout.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "avio_internal.h" +#include "demux.h" +#include "internal.h" + +typedef struct WavArcContext { + int64_t data_end; +} WavArcContext; + +static int wavarc_probe(const AVProbeData *p) +{ + int len = p->buf[0]; + uint32_t id; + + if (len == 0 || len + 6 >= p->buf_size) + return 0; + + if (p->buf[len + 1] != 0) + return 0; + + id = AV_RL32(p->buf + len + 2); + if (id != MKTAG('0','C','P','Y') && + id != MKTAG('1','D','I','F') && + id != MKTAG('2','S','L','P') && + id != MKTAG('3','N','L','P') && + id != MKTAG('4','A','L','P') && + id != MKTAG('5','E','L','P')) + return 0; + + return AVPROBE_SCORE_MAX / 3 * 2; +} + +static int wavarc_read_header(AVFormatContext *s) +{ + WavArcContext *w = s->priv_data; + AVIOContext *pb = s->pb; + AVCodecParameters *par; + int filename_len, fmt_len, ret; + uint8_t data[36]; + AVStream *st; + uint32_t id; + + filename_len = avio_r8(pb); + if (filename_len == 0) + return AVERROR_INVALIDDATA; + avio_skip(pb, filename_len); + if (avio_r8(pb)) + return AVERROR_INVALIDDATA; + id = avio_rl32(pb); + if (avio_read(pb, data, sizeof(data)) != sizeof(data)) + return AVERROR(EIO); + fmt_len = AV_RL32(data + 32); + if (fmt_len < 12) + return AVERROR_INVALIDDATA; + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + par = st->codecpar; + + ret = ff_alloc_extradata(par, fmt_len + sizeof(data)); + if (ret < 0) + return ret; + memcpy(par->extradata, data, sizeof(data)); + ret = ffio_read_size(pb, par->extradata + sizeof(data), fmt_len); + if (ret < 0) + return ret; + + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->codec_id = AV_CODEC_ID_WAVARC; + par->codec_tag = id; + + do { + id = avio_rl32(pb); + if (id != MKTAG('d','a','t','a')) + avio_skip(pb, avio_rl32(pb)); + } while (id != MKTAG('d','a','t','a') && !avio_feof(pb)); + w->data_end = avio_rl32(pb); + w->data_end += avio_tell(pb); + + if (AV_RL32(par->extradata + 16) != MKTAG('R','I','F','F')) + return AVERROR_INVALIDDATA; + if (AV_RL32(par->extradata + 24) != MKTAG('W','A','V','E')) + return AVERROR_INVALIDDATA; + if (AV_RL32(par->extradata + 28) != MKTAG('f','m','t',' ')) + return AVERROR_INVALIDDATA; + + av_channel_layout_default(&par->ch_layout, AV_RL16(par->extradata + 38)); + par->sample_rate = AV_RL32(par->extradata + 40); + avpriv_set_pts_info(st, 64, 1, par->sample_rate); + st->start_time = 0; + + return 0; +} + +static int wavarc_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + WavArcContext *w = s->priv_data; + AVIOContext *pb = s->pb; + int64_t size, left = w->data_end - avio_tell(pb); + int ret; + + size = FFMIN(left, 1024); + if (size <= 0) + return AVERROR_EOF; + + ret = av_get_packet(pb, pkt, size); + pkt->stream_index = 0; + return ret; +} + +const AVInputFormat ff_wavarc_demuxer = { + .name = "wavarc", + .long_name = NULL_IF_CONFIG_SMALL("Waveform Archiver"), + .priv_data_size = sizeof(WavArcContext), + .read_probe = wavarc_probe, + .read_packet = wavarc_read_packet, + .flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS, + .read_header = wavarc_read_header, + .extensions = "wa", + .raw_codec_id = AV_CODEC_ID_WAVARC, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -555,7 +555,7 @@ case MKTAG('I', 'D', '3', ' '): case MKTAG('i', 'd', '3', ' '): { ID3v2ExtraMeta *id3v2_extra_meta; - ff_id3v2_read_dict(pb, &ffformatcontext(s)->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta); + ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0); if (id3v2_extra_meta) { ff_id3v2_parse_apic(s, id3v2_extra_meta); ff_id3v2_parse_chapters(s, id3v2_extra_meta); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wavenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,6 +46,7 @@ #include "avio.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include "riff.h" #define RF64_AUTO (-1) @@ -506,27 +507,37 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_wav_muxer = { - .name = "wav", - .long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"), - .mime_type = "audio/x-wav", - .extensions = "wav", +const FFOutputFormat ff_wav_muxer = { + .p.name = "wav", + .p.long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"), + .p.mime_type = "audio/x-wav", + .p.extensions = "wav", .priv_data_size = sizeof(WAVMuxContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_NONE, .write_header = wav_write_header, .write_packet = wav_write_packet, .write_trailer = wav_write_trailer, .deinit = wav_deinit, - .flags = AVFMT_TS_NONSTRICT, - .codec_tag = ff_wav_codec_tags_list, - .priv_class = &wav_muxer_class, + .p.flags = AVFMT_TS_NONSTRICT, + .p.codec_tag = ff_wav_codec_tags_list, + .p.priv_class = &wav_muxer_class, }; #endif /* CONFIG_WAV_MUXER */ #if CONFIG_W64_MUXER #include "w64.h" +static av_cold int w64_init(AVFormatContext *ctx) +{ + if (ctx->nb_streams != 1) { + av_log(ctx, AV_LOG_ERROR, "This muxer only supports a single stream.\n"); + return AVERROR(EINVAL); + } + + return 0; +} + static void start_guid(AVIOContext *pb, const uint8_t *guid, int64_t *pos) { *pos = avio_tell(pb); @@ -605,17 +616,18 @@ return 0; } -const AVOutputFormat ff_w64_muxer = { - .name = "w64", - .long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"), - .extensions = "w64", +const FFOutputFormat ff_w64_muxer = { + .p.name = "w64", + .p.long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"), + .p.extensions = "w64", .priv_data_size = sizeof(WAVMuxContext), - .audio_codec = AV_CODEC_ID_PCM_S16LE, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_PCM_S16LE, + .p.video_codec = AV_CODEC_ID_NONE, + .init = w64_init, .write_header = w64_write_header, .write_packet = wav_write_packet, .write_trailer = w64_write_trailer, - .flags = AVFMT_TS_NONSTRICT, - .codec_tag = ff_wav_codec_tags_list, + .p.flags = AVFMT_TS_NONSTRICT, + .p.codec_tag = ff_wav_codec_tags_list, }; #endif /* CONFIG_W64_MUXER */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webm_chunk.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webm_chunk.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webm_chunk.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webm_chunk.c 2023-03-03 13:29:59.000000000 +0000 @@ -91,12 +91,10 @@ if ((ret = av_dict_copy(&oc->metadata, s->metadata, 0)) < 0) return ret; - if (!(st = avformat_new_stream(oc, NULL))) + st = ff_stream_clone(oc, ost); + if (!st) return AVERROR(ENOMEM); - if ((ret = ff_stream_encode_params_copy(st, ost)) < 0) - return ret; - if (wc->http_method) if ((ret = av_dict_set(&dict, "method", wc->http_method, 0)) < 0) return ret; @@ -129,6 +127,7 @@ ffformatcontext(s)->avoid_negative_ts_use_pts = ffformatcontext(oc)->avoid_negative_ts_use_pts; oc->avoid_negative_ts = AVFMT_AVOID_NEG_TS_DISABLED; + ffformatcontext(oc)->avoid_negative_ts_status = AVOID_NEGATIVE_TS_DISABLED; return 0; } @@ -151,10 +150,13 @@ { WebMChunkContext *wc = s->priv_data; AVFormatContext *oc = wc->avf; + AVStream *st = s->streams[0], *ost = oc->streams[0]; int ret; ret = avformat_write_header(oc, NULL); ff_format_io_close(s, &oc->pb); + ffstream(st)->lowest_ts_allowed = ffstream(ost)->lowest_ts_allowed; + ffstream(ost)->lowest_ts_allowed = 0; wc->header_written = 1; if (ret < 0) return ret; @@ -290,18 +292,18 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_webm_chunk_muxer = { - .name = "webm_chunk", - .long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"), - .mime_type = "video/webm", - .extensions = "chk", - .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER | +const FFOutputFormat ff_webm_chunk_muxer = { + .p.name = "webm_chunk", + .p.long_name = NULL_IF_CONFIG_SMALL("WebM Chunk Muxer"), + .p.mime_type = "video/webm", + .p.extensions = "chk", + .p.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER | AVFMT_NEEDNUMBER | AVFMT_TS_NONSTRICT, + .p.priv_class = &webm_chunk_class, .priv_data_size = sizeof(WebMChunkContext), .init = webm_chunk_init, .write_header = webm_chunk_write_header, .write_packet = webm_chunk_write_packet, .write_trailer = webm_chunk_write_trailer, .deinit = webm_chunk_deinit, - .priv_class = &webm_chunk_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webmdashenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webmdashenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webmdashenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webmdashenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,6 +32,7 @@ #include "avformat.h" #include "matroska.h" +#include "mux.h" #include "libavutil/avstring.h" #include "libavutil/dict.h" @@ -540,13 +541,13 @@ .version = LIBAVUTIL_VERSION_INT, }; -const AVOutputFormat ff_webm_dash_manifest_muxer = { - .name = "webm_dash_manifest", - .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), - .mime_type = "application/xml", - .extensions = "xml", +const FFOutputFormat ff_webm_dash_manifest_muxer = { + .p.name = "webm_dash_manifest", + .p.long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), + .p.mime_type = "application/xml", + .p.extensions = "xml", .priv_data_size = sizeof(WebMDashMuxContext), .write_header = webm_dash_manifest_write_header, .write_packet = webm_dash_manifest_write_packet, - .priv_class = &webm_dash_class, + .p.priv_class = &webm_dash_class, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webpenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webpenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webpenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webpenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include "libavutil/opt.h" #include "avformat.h" #include "internal.h" +#include "mux.h" typedef struct WebpContext{ AVClass *class; @@ -208,15 +209,15 @@ .version = LIBAVUTIL_VERSION_INT, .option = options, }; -const AVOutputFormat ff_webp_muxer = { - .name = "webp", - .long_name = NULL_IF_CONFIG_SMALL("WebP"), - .extensions = "webp", +const FFOutputFormat ff_webp_muxer = { + .p.name = "webp", + .p.long_name = NULL_IF_CONFIG_SMALL("WebP"), + .p.extensions = "webp", .priv_data_size = sizeof(WebpContext), - .video_codec = AV_CODEC_ID_WEBP, + .p.video_codec = AV_CODEC_ID_WEBP, .init = webp_init, .write_packet = webp_write_packet, .write_trailer = webp_write_trailer, - .priv_class = &webp_muxer_class, - .flags = AVFMT_VARIABLE_FPS, + .p.priv_class = &webp_muxer_class, + .p.flags = AVFMT_VARIABLE_FPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webvttenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webvttenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webvttenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/webvttenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "avformat.h" #include "internal.h" +#include "mux.h" static void webvtt_write_time(AVIOContext *pb, int64_t millisec) { @@ -102,13 +103,13 @@ return 0; } -const AVOutputFormat ff_webvtt_muxer = { - .name = "webvtt", - .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), - .extensions = "vtt", - .mime_type = "text/vtt", - .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, - .subtitle_codec = AV_CODEC_ID_WEBVTT, +const FFOutputFormat ff_webvtt_muxer = { + .p.name = "webvtt", + .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), + .p.extensions = "vtt", + .p.mime_type = "text/vtt", + .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, + .p.subtitle_codec = AV_CODEC_ID_WEBVTT, .write_header = webvtt_write_header, .write_packet = webvtt_write_packet, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/westwood_audenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/westwood_audenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/westwood_audenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/westwood_audenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mux.h" #include #define AUD_CHUNK_SIGNATURE 0x0000DEAF @@ -125,13 +126,13 @@ return 0; } -const AVOutputFormat ff_wsaud_muxer = { - .name = "wsaud", - .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios audio"), - .extensions = "aud", +const FFOutputFormat ff_wsaud_muxer = { + .p.name = "wsaud", + .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Studios audio"), + .p.extensions = "aud", .priv_data_size = sizeof(AUDMuxContext), - .audio_codec = AV_CODEC_ID_ADPCM_IMA_WS, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_ADPCM_IMA_WS, + .p.video_codec = AV_CODEC_ID_NONE, .init = wsaud_write_init, .write_header = wsaud_write_header, .write_packet = wsaud_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wtvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wtvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wtvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wtvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -670,12 +670,12 @@ { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = NULL; ff_standardize_creation_time(s); //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL); - while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) + while ((tag = av_dict_iterate(s->metadata, tag))) write_tag(pb, tag->key, tag->value); if (wctx->thumbnail.size) { @@ -698,11 +698,11 @@ { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = NULL; int64_t pos = 0; //FIXME: translate special tags to binary representation - while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(s->metadata, tag))) { avio_wl64(pb, pos); pos += metadata_header_size(tag->key) + strlen(tag->value)*2 + 2; } @@ -829,15 +829,15 @@ return 0; } -const AVOutputFormat ff_wtv_muxer = { - .name = "wtv", - .long_name = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"), - .extensions = "wtv", +const FFOutputFormat ff_wtv_muxer = { + .p.name = "wtv", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Television (WTV)"), + .p.extensions = "wtv", .priv_data_size = sizeof(WtvContext), - .audio_codec = AV_CODEC_ID_AC3, - .video_codec = AV_CODEC_ID_MPEG2VIDEO, + .p.audio_codec = AV_CODEC_ID_AC3, + .p.video_codec = AV_CODEC_ID_MPEG2VIDEO, .write_header = write_header, .write_packet = write_packet, .write_trailer = write_trailer, - .codec_tag = ff_riff_codec_tags_list, + .p.codec_tag = ff_riff_codec_tags_list, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wvenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wvenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wvenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/wvenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,7 @@ #include "apetag.h" #include "avformat.h" +#include "mux.h" #include "wv.h" typedef struct WvMuxContext { @@ -76,16 +77,16 @@ return 0; } -const AVOutputFormat ff_wv_muxer = { - .name = "wv", - .long_name = NULL_IF_CONFIG_SMALL("raw WavPack"), - .mime_type = "audio/x-wavpack", - .extensions = "wv", +const FFOutputFormat ff_wv_muxer = { + .p.name = "wv", + .p.long_name = NULL_IF_CONFIG_SMALL("raw WavPack"), + .p.mime_type = "audio/x-wavpack", + .p.extensions = "wv", .priv_data_size = sizeof(WvMuxContext), - .audio_codec = AV_CODEC_ID_WAVPACK, - .video_codec = AV_CODEC_ID_NONE, + .p.audio_codec = AV_CODEC_ID_WAVPACK, + .p.video_codec = AV_CODEC_ID_NONE, .init = wv_init, .write_packet = wv_write_packet, .write_trailer = wv_write_trailer, - .flags = AVFMT_NOTIMESTAMPS, + .p.flags = AVFMT_NOTIMESTAMPS, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/xmd.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/xmd.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/xmd.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/xmd.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * XMD demuxer + * 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/channel_layout.h" +#include "libavutil/intreadwrite.h" +#include "avformat.h" +#include "demux.h" +#include "internal.h" +#include "pcm.h" + +static int xmd_probe(const AVProbeData *p) +{ + if ((AV_RL32(p->buf) & 0xFFFFFF) != MKTAG('x','m','d',0)) + return 0; + if (p->buf[3] == 0 || p->buf[3] > 2 || + AV_RL16(p->buf+4) == 0 || + AV_RL32(p->buf+6) == 0) + return 0; + + return AVPROBE_SCORE_MAX / 3; +} + +static int xmd_read_header(AVFormatContext *s) +{ + AVIOContext *pb = s->pb; + AVCodecParameters *par; + int channels; + AVStream *st; + + avio_skip(pb, 3); + + st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + + par = st->codecpar; + par->codec_type = AVMEDIA_TYPE_AUDIO; + par->codec_id = AV_CODEC_ID_ADPCM_XMD; + channels = avio_r8(pb); + if (channels == 0) + return AVERROR_INVALIDDATA; + av_channel_layout_default(&par->ch_layout, channels); + par->sample_rate = avio_rl16(pb); + if (par->sample_rate <= 0) + return AVERROR_INVALIDDATA; + par->block_align = 21 * channels; + st->duration = (avio_rl32(pb) / par->block_align) * 32LL; + avpriv_set_pts_info(st, 64, 1, par->sample_rate); + avio_skip(pb, 7); + + return 0; +} + +const AVInputFormat ff_xmd_demuxer = { + .name = "xmd", + .long_name = NULL_IF_CONFIG_SMALL("Konami XMD"), + .read_probe = xmd_probe, + .read_header = xmd_read_header, + .read_packet = ff_pcm_read_packet, + .flags = AVFMT_GENERIC_INDEX, + .extensions = "xmd", +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegdec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegdec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegdec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegdec.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ #include "yuv4mpeg.h" /* Header size increased to allow room for optional flags */ -#define MAX_YUV4_HEADER 96 +#define MAX_YUV4_HEADER 128 #define MAX_FRAME_HEADER 80 static int yuv4_read_header(AVFormatContext *s) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavformat/yuv4mpegenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include "libavutil/pixdesc.h" #include "avformat.h" #include "internal.h" +#include "mux.h" #include "yuv4mpeg.h" static int yuv4_write_header(AVFormatContext *s) @@ -282,12 +283,12 @@ return 0; } -const AVOutputFormat ff_yuv4mpegpipe_muxer = { - .name = "yuv4mpegpipe", - .long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"), - .extensions = "y4m", - .audio_codec = AV_CODEC_ID_NONE, - .video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, +const FFOutputFormat ff_yuv4mpegpipe_muxer = { + .p.name = "yuv4mpegpipe", + .p.long_name = NULL_IF_CONFIG_SMALL("YUV4MPEG pipe"), + .p.extensions = "y4m", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, .init = yuv4_init, .write_header = yuv4_write_header, .write_packet = yuv4_write_packet, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/bswap.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/bswap.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/bswap.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/bswap.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,22 +28,28 @@ #define av_bswap16 av_bswap16 static av_always_inline av_const unsigned av_bswap16(unsigned x) { - __asm__("rev16 %w0, %w0" : "+r"(x)); - return x; + unsigned y; + + __asm__("rev16 %w0, %w1" : "=r"(y) : "r"(x)); + return y; } #define av_bswap32 av_bswap32 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) { - __asm__("rev %w0, %w0" : "+r"(x)); - return x; + uint32_t y; + + __asm__("rev %w0, %w1" : "=r"(y) : "r"(x)); + return y; } #define av_bswap64 av_bswap64 static av_always_inline av_const uint64_t av_bswap64(uint64_t x) { - __asm__("rev %0, %0" : "+r"(x)); - return x; + uint64_t y; + + __asm__("rev %0, %1" : "=r"(y) : "r"(x)); + return y; } #endif /* HAVE_INLINE_ASM */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,6 @@ OBJS += aarch64/cpu.o \ aarch64/float_dsp_init.o \ + aarch64/tx_float_init.o \ -NEON-OBJS += aarch64/float_dsp_neon.o +NEON-OBJS += aarch64/float_dsp_neon.o \ + aarch64/tx_float_neon.o \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define TX_FLOAT +#include "libavutil/tx_priv.h" +#include "libavutil/attributes.h" +#include "libavutil/aarch64/cpu.h" + +TX_DECL_FN(fft2, neon) +TX_DECL_FN(fft4_fwd, neon) +TX_DECL_FN(fft4_inv, neon) +TX_DECL_FN(fft8, neon) +TX_DECL_FN(fft8_ns, neon) +TX_DECL_FN(fft16, neon) +TX_DECL_FN(fft16_ns, neon) +TX_DECL_FN(fft32, neon) +TX_DECL_FN(fft32_ns, neon) +TX_DECL_FN(fft_sr, neon) +TX_DECL_FN(fft_sr_ns, neon) + +static av_cold int neon_init(AVTXContext *s, const FFTXCodelet *cd, + uint64_t flags, FFTXCodeletOptions *opts, + int len, int inv, const void *scale) +{ + ff_tx_init_tabs_float(len); + if (cd->max_len == 2) + return ff_tx_gen_ptwo_revtab(s, opts); + else + return ff_tx_gen_split_radix_parity_revtab(s, len, inv, opts, 8, 0); +} + +const FFTXCodelet * const ff_tx_codelet_list_float_aarch64[] = { + TX_DEF(fft2, FFT, 2, 2, 2, 0, 128, NULL, neon, NEON, AV_TX_INPLACE, 0), + TX_DEF(fft2, FFT, 2, 2, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + TX_DEF(fft4_fwd, FFT, 4, 4, 2, 0, 128, NULL, neon, NEON, AV_TX_INPLACE | FF_TX_FORWARD_ONLY, 0), + TX_DEF(fft4_fwd, FFT, 4, 4, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + TX_DEF(fft4_inv, FFT, 4, 4, 2, 0, 128, NULL, neon, NEON, AV_TX_INPLACE | FF_TX_INVERSE_ONLY, 0), + TX_DEF(fft8, FFT, 8, 8, 2, 0, 128, neon_init, neon, NEON, AV_TX_INPLACE, 0), + TX_DEF(fft8_ns, FFT, 8, 8, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + TX_DEF(fft16, FFT, 16, 16, 2, 0, 128, neon_init, neon, NEON, AV_TX_INPLACE, 0), + TX_DEF(fft16_ns, FFT, 16, 16, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + TX_DEF(fft32, FFT, 32, 32, 2, 0, 128, neon_init, neon, NEON, AV_TX_INPLACE, 0), + TX_DEF(fft32_ns, FFT, 32, 32, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + + TX_DEF(fft_sr, FFT, 64, 131072, 2, 0, 128, neon_init, neon, NEON, 0, 0), + TX_DEF(fft_sr_ns, FFT, 64, 131072, 2, 0, 192, neon_init, neon, NEON, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), + + NULL, +}; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_neon.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_neon.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_neon.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aarch64/tx_float_neon.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1294 @@ +/* + * Copyright (c) Lynne + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/aarch64/asm.S" + +/* Open `doc/transforms.md` to see the code upon which the transforms here were + * based upon. + * + * File conventions: + * GPRs: x0-x3 - arguments, untouched + * x4 - Lookup table base pointer + * x5-x6 - macro ld1 temps/function scratch + * x7-x9 - FFT table state + * x10-x17 - lookup table/macro scratch + * w19-w20 - current/target length when needed + * x21-x22 - len*2, len*6 + * + * Vectors: v0-v7 - coefficients + * v8-v15 - coefficients when needed, otherwise untouched + * v16-v30 - used as needed + * v31 - -1.0, +1.0, -1.0, +1.0. Never touched after loading. + * + * Stack: backup for v8-v15 and x19-x22 when needed, and transform lengths + */ + +#define M_SQRT1_2 0.707106781186547524401 +#define COS16_1 0.92387950420379638671875 +#define COS16_3 0.3826834261417388916015625 + +/* We only ever load this once at the start, and then live with losing an + * entire register as we need to lug this all the time everywhere. + * Clearly should be integrated into an fsadd and fmlsa, but "muh RISC!". */ +const subadd, align=4 + .float -1.0, 1.0, -1.0, 1.0 +endconst + +.macro LOAD_SUBADD + movrel x5, subadd + ld1 { v31.4s }, [x5] +.endm + +.macro SETUP_LUT no_lut=0 +.if \no_lut == 0 + ldr x4, [x0, #8] +.endif +.endm + +.macro LOAD_INPUT dst1, dst2, dst3, dst4, src, no_lut=0, discont=0 +.if \no_lut == 1 +.if \discont == 1 + ldp q\dst1\(), q\dst2\(), [\src\()] + ldp q\dst3\(), q\dst4\(), [\src\(), #32] + add \src\(), \src\(), #64 +.else + ld1 { v\dst1\().4s, v\dst2\().4s, v\dst3\().4s, v\dst4\().4s }, [\src], #64 +.endif +.else + ldp w10, w11, [x4, #0 ] + ldp w12, w13, [x4, #8 ] + ldp w14, w15, [x4, #16] + ldp w16, w17, [x4, #24] + + add x4, x4, #32 + + ldr d\dst1, [\src, x10, lsl #3] + add x11, \src, x11, lsl #3 + ldr d\dst2, [\src, x12, lsl #3] + add x13, \src, x13, lsl #3 + ldr d\dst3, [\src, x14, lsl #3] + add x15, \src, x15, lsl #3 + ldr d\dst4, [\src, x16, lsl #3] + add x17, \src, x17, lsl #3 + + ld1 { v\dst1\().d }[1], [x11] + ld1 { v\dst2\().d }[1], [x13] + ld1 { v\dst3\().d }[1], [x15] + ld1 { v\dst4\().d }[1], [x17] +.endif +.endm + +.macro FFT4 e0, o0, standalone + fadd v16.4s, \e0\().4s, \o0\().4s // r1..4 + fsub \e0\().4s, \e0\().4s, \o0\().4s // t1..4 + + rev64 v18.4s, \e0\().4s + + zip2 \o0\().2d, v16.2d, \e0\().2d + zip1 v17.2d, v16.2d, \e0\().2d + + mov \o0\().d[1], v18.d[1] + + fadd \e0\().4s, v17.4s, \o0\().4s // a1,2 b1,4 + fsub v16.4s, v17.4s, \o0\().4s // a3,4 b3,2 + + mov \o0\().16b, v16.16b // Swap once again... + mov \o0\().s[3], \e0\().s[3] + mov \e0\().s[3], v16.s[3] + +.if \standalone == 0 + uzp2 \o0\().2d, \e0\().2d, \o0\().2d + uzp1 \e0\().2d, \e0\().2d, v16.2d +.endif +.endm + +const shuf_4pt_x2, align=4 + .byte 24, 25, 26, 27 // reg2, 3 + .byte 12, 13, 14, 15 // reg1, 4 + .byte 8, 9, 10, 11 // reg1, 3 + .byte 28, 29, 30, 31 // reg2, 4 +endconst + +// Identical to FFT4, but does 2 transforms in parallel, with no deinterleaving +.macro FFT4_X2 e0, o0, e1, o1, \ + t0=v16, t1=v17, t2=v18, t3=v19, t4=v20, t5=v21, t6=v22 + + fadd \t0\().4s, \e0\().4s, \o0\().4s // r1234 + fadd \t2\().4s, \e1\().4s, \o1\().4s // r1234 + fsub \e0\().4s, \e0\().4s, \o0\().4s // t1234 + fsub \e1\().4s, \e1\().4s, \o1\().4s // t1234 + + movrel x5, shuf_4pt_x2 + + rev64 \t4\().4s, \e0\().4s + rev64 \t5\().4s, \e1\().4s + + zip2 \o0\().2d, \t0\().2d, \e0\().2d // t3,4 r3,4 + zip2 \o1\().2d, \t2\().2d, \e1\().2d // t3,4 r3,4 + + ld1 { \t6\().16b }, [x5] + + mov \o0\().d[1], \t4\().d[1] + mov \o1\().d[1], \t5\().d[1] + + zip1 \t1\().2d, \t0\().2d, \e0\().2d // t1,2 r1,2 + zip1 \t3\().2d, \t2\().2d, \e1\().2d // t1,2 r1,2 + + fsub \t4\().4s, \t1\().4s, \o0\().4s // a34 b32 + fadd \t5\().4s, \t1\().4s, \o0\().4s // a12 b14 + fsub \t2\().4s, \t3\().4s, \o1\().4s // a34 b32 + fadd \t3\().4s, \t3\().4s, \o1\().4s // a12 b14 + + // TODO: experiment with movs instead of tables here + tbl \o0\().16b, { \t4\().16b, \t5\().16b }, \t6\().16b // b1234 + tbl \o1\().16b, { \t2\().16b, \t3\().16b }, \t6\().16b // b1234 + + zip1 \e0\().2d, \t5\().2d, \t4\().2d // a1234 +// zip2 \o0\().2d, \t5\().2d, \t4\().2d // b1432 + zip1 \e1\().2d, \t3\().2d, \t2\().2d // a1234 +// zip2 \o1\().2d, \t3\().2d, \t2\().2d // b1432 +// rev64 \o0\().4s, \o0\().4s // b4123 +// rev64 \o1\().4s, \o1\().4s // b4123 +// ext \o0\().16b, \o0\().16b, \o0\().16b, #4 // b1234 +// ext \o1\().16b, \o1\().16b, \o1\().16b, #4 // b1234 +.endm + +const tab_8pt, align=4 + .float M_SQRT1_2, -M_SQRT1_2, -M_SQRT1_2, M_SQRT1_2 +endconst + +.macro FFT8 e0, e1, o0, o1, \ + t0=v16, t1=v17, t2=v18, t3=v19, t4=v20, t5=v21, t6=v22 + + movrel x5, tab_8pt + + fsub \t1\().4s, \e1\().4s, \o1\().4s // j1234 + fadd \o1\().4s, \e1\().4s, \o1\().4s // k1234 + fsub \t0\().4s, \e0\().4s, \o0\().4s // r1234 + fadd \o0\().4s, \e0\().4s, \o0\().4s // q1234 + + ld1 { \t5\().4s }, [x5] + + ext \t4\().16b, \o1\().16b, \o1\().16b, #12 + rev64 \t4\().4s, \t4\().4s + + ext \t2\().16b, \o0\().16b, \t4\().16b, #8 // o0[0,1], o1[3,2] + mov \o0\().d[1], \t4\().d[1] // o0[3, 4]; o1[1, 4] + + fsub \e1\().4s, \o0\().4s, \t2\().4s // s34, g43 + fadd \t2\().4s, \o0\().4s, \t2\().4s // s12, g12 + + rev64 \t6\().4s, v31.4s // 1, -1, 1, -1 + dup \o0\().2d, \t0\().d[0] // r1212 + dup \o1\().2d, \t0\().d[1] // r3434 + + rev64 \t4\().4s, \e1\().4s // xxg34 + rev64 \o1\().4s, \o1\().4s // r4343 + + ext \t6\().16b, v31.16b, \t6\().16b, #8 // -1, 1, 1, -1 + zip1 \t3\().2d, \t2\().2d, \e1\().2d // s1234 + zip2 \t2\().2d, \t2\().2d, \t4\().2d // g1234 + + fadd \e0\().4s, \t3\().4s, \t2\().4s // out_e1 + fsub \e1\().4s, \t3\().4s, \t2\().4s // out_e2 + + fmul \t1\().4s, \t1\().4s, \t5\().4s // j * +--+M_SQRT1_2 + fmls \o0\().4s, \o1\().4s, \t6\().4s // z1234 + + rev64 \t4\().4s, \t1\().4s // j2143 + fmla \t1\().4s, \t4\().4s, v31.4s // l2143 + + rev64 \t4\().4s, \t1\().4s // l1234 + ext \t4\().16b, \t4\().16b, \t4\().16b, #8 // l3412 + + fmla \t4\().4s, \t1\().4s, v31.4s // t1234 + + fadd \o1\().4s, \o0\().4s, \t4\().4s // out_o2 + fsub \o0\().4s, \o0\().4s, \t4\().4s // out_o1 +.endm + +// Identical as FFT8, but does 2 transforms in parallel +.macro FFT8_X2 e0, e1, o0, o1, e2, e3, o2, o3 + + movrel x5, tab_8pt + + fadd v19.4s, \e3\().4s, \o3\().4s // k1234 + fadd v17.4s, \e1\().4s, \o1\().4s // k1234 + fadd v18.4s, \e2\().4s, \o2\().4s // q1234 + fadd v16.4s, \e0\().4s, \o0\().4s // q1234 + + ld1 { v23.4s }, [x5] + + ext v22.16b, v19.16b, v19.16b, #12 + ext v21.16b, v17.16b, v17.16b, #12 + + rev64 v22.4s, v22.4s + rev64 v21.4s, v21.4s + + ext v19.16b, v18.16b, v22.16b, #8 + ext v17.16b, v16.16b, v21.16b, #8 + + mov v18.d[1], v22.d[1] + mov v21.d[0], v16.d[0] + + fadd v22.4s, v18.4s, v19.4s // s12, g12 + fsub v19.4s, v18.4s, v19.4s // s34, g43 + fsub v18.4s, v21.4s, v17.4s // s34, g43 + fadd v16.4s, v21.4s, v17.4s // s12, g12 + + fsub \e0\().4s, \e0\().4s, \o0\().4s // r1234 + fsub v20.4s, \e1\().4s, \o1\().4s // j1234 + fsub \e2\().4s, \e2\().4s, \o2\().4s // r1234 + fsub v21.4s, \e3\().4s, \o3\().4s // j1234 + + rev64 v24.4s, v31.4s // 1, -1, 1, -1 + zip1 v17.2d, v16.2d, v18.2d // s1234 + zip1 \e1\().2d, v22.2d, v19.2d // s1234 + + rev64 v18.4s, v18.4s // xxg34 + rev64 v19.4s, v19.4s // xxg34 + + zip2 v16.2d, v16.2d, v18.2d // g1234 + zip2 \e3\().2d, v22.2d, v19.2d // g1234 + + dup \o0\().2d, \e0\().d[0] // r1212 + dup \o1\().2d, \e0\().d[1] // r3434 + dup \o2\().2d, \e2\().d[0] // r1212 + dup \o3\().2d, \e2\().d[1] // r3434 + + fadd \e2\().4s, \e1\().4s, \e3\().4s // out_e1 + fsub \e3\().4s, \e1\().4s, \e3\().4s // out_e2 + fadd \e0\().4s, v17.4s, v16.4s // out_e1 + fsub \e1\().4s, v17.4s, v16.4s // out_e2 + + ext v24.16b, v31.16b, v24.16b, #8 // -1, 1, 1, -1 + rev64 \o1\().4s, \o1\().4s // r4343 + rev64 \o3\().4s, \o3\().4s // r4343 + + fmul v19.4s, v20.4s, v23.4s // j * +--+M_SQRT1_2 + fmul v21.4s, v21.4s, v23.4s // j * +--+M_SQRT1_2 + + rev64 v20.4s, v19.4s // j2143 + rev64 v18.4s, v21.4s // j2143 + + fmls \o0\().4s, \o1\().4s, v24.4s // z1234 + fmls \o2\().4s, \o3\().4s, v24.4s // z1234 + + fmla v19.4s, v20.4s, v31.4s // l2143 + fmla v21.4s, v18.4s, v31.4s // l2143 + + rev64 v20.4s, v19.4s // l1234 + rev64 v18.4s, v21.4s // l1234 + ext v20.16b, v20.16b, v20.16b, #8 // l3412 + ext v18.16b, v18.16b, v18.16b, #8 // l3412 + + fmla v20.4s, v19.4s, v31.4s // t1234 + fmla v18.4s, v21.4s, v31.4s // t1234 + + fadd \o1\().4s, \o0\().4s, v20.4s // out_o2 + fadd \o3\().4s, \o2\().4s, v18.4s // out_o2 + fsub \o0\().4s, \o0\().4s, v20.4s // out_o1 + fsub \o2\().4s, \o2\().4s, v18.4s // out_o1 +.endm + +const tab_16pt, align=4 + .float -COS16_1, COS16_1, -COS16_3, COS16_3 // Could be +-+- too + .float COS16_3, COS16_3, COS16_1, COS16_1 + .float 1.0, 1.0, M_SQRT1_2, M_SQRT1_2 +endconst + +// 16-point FFT +// t3, t4, t5, t6 must be sequential +.macro FFT16 e0, e1, e2, e3, o0, o1, o2, o3, \ + t0=v16, t1=v17, t2=v18, t3=v19, t4=v20, t5=v21, t6=v22 + + FFT8 \e0, \e1, \e2, \e3, \t0, \t1, \t2, \t3, \t4, \t5, \t6 + FFT4_X2 \o0, \o1, \o2, \o3, \t0, \t1, \t2, \t3, \t4, \t5, \t6 + + movrel x5, tab_16pt + + rev64 \t0\().4s, \o0\().4s // z[ 8, 9].imre + rev64 \t1\().4s, \o2\().4s // z[10,11].imre + + ins \t0\().d[0], xzr + ins \t1\().d[0], xzr + + ld1 { \t4\().4s, \t5\().4s, \t6\().4s }, [x5] + // TODO: We could derive \t4\() or \t5\() from either, but it seems cheaper to load + + fmla \o2\().4s, \t1\().4s, v31.4s // s[4567] + fmls \o0\().4s, \t0\().4s, v31.4s // s[0123] + + fmul \t2\().4s, \o1\().4s, \t4\().4s + fmul \t3\().4s, \o3\().4s, \t4\().4s + + rev64 \o3\().4s, \o3\().4s + rev64 \o1\().4s, \o1\().4s + + fmla \t3\().4s, \o3\().4s, \t5\().4s // s[12, 13, 14, 15] + fmls \t2\().4s, \o1\().4s, \t5\().4s // s[ 8, 9, 10, 11] + + fmul \t1\().4s, \o2\().4s, \t6\().4s // s[4567] * mult + fmul \t0\().4s, \o0\().4s, \t6\().4s // s[0123] * mult + + mov \o1\().16b, \t3\().16b + mov \o2\().16b, \t1\().16b + + fsub \t3\().4s, \t3\().4s, \t2\().4s // y34, u34 + fsub \t1\().4s, \t1\().4s, \t0\().4s // w34, x34 + + fadd \t2\().4s, \t2\().4s, \o1\().4s // y56, u56 + rev64 \t3\().4s, \t3\().4s + fadd \t0\().4s, \t0\().4s, \o2\().4s // w56, x56 + rev64 \t1\().4s, \t1\().4s + + fmul \t2\().4s, \t2\().4s, v31.4s + fmul \t1\().4s, \t1\().4s, v31.4s + + fadd \o3\().4s, \e3\().4s, \t3\().4s + fsub \o2\().4s, \e3\().4s, \t3\().4s + fsub \o1\().4s, \e2\().4s, \t2\().4s + fadd \o0\().4s, \e2\().4s, \t2\().4s + + fsub \e2\().4s, \e0\().4s, \t0\().4s + fadd \e0\().4s, \e0\().4s, \t0\().4s + fsub \e3\().4s, \e1\().4s, \t1\().4s + fadd \e1\().4s, \e1\().4s, \t1\().4s +.endm + +function ff_tx_fft2_float_neon, export=1 + ld2r { v0.2d, v1.2d }, [x2] + + fneg v2.2s, v1.2s + mov v2.d[1], v1.d[0] + + fsub v2.4s, v0.4s, v2.4s + + st1 { v2.4s }, [x1] + ret +endfunc + +.macro FFT4_FN name, inv +function ff_tx_fft4_\name\()_float_neon, export=1 + ld1 {v0.4s, v1.4s}, [x2] + +.if \inv == 1 + mov v2.d[0], v0.d[1] + mov v0.d[1], v1.d[1] + mov v1.d[1], v2.d[0] +.endif + + FFT4 v0, v1, 1 + + st1 { v0.4s, v1.4s }, [x1] + ret +endfunc +.endm + +FFT4_FN fwd, 0 +FFT4_FN inv, 1 + +.macro FFT8_FN name, no_perm +function ff_tx_fft8_\name\()_neon, export=1 + SETUP_LUT \no_perm + LOAD_INPUT 0, 1, 2, 3, x2, \no_perm + + LOAD_SUBADD + FFT8 v0, v1, v2, v3 + + zip1 v16.2d, v0.2d, v2.2d + zip2 v17.2d, v0.2d, v2.2d + zip1 v18.2d, v1.2d, v3.2d + zip2 v19.2d, v1.2d, v3.2d + st1 { v16.4s, v17.4s, v18.4s, v19.4s }, [x1] + + ret +endfunc +.endm + +FFT8_FN float, 0 +FFT8_FN ns_float, 1 + +.macro FFT16_FN name, no_perm +function ff_tx_fft16_\name\()_neon, export=1 + SETUP_LUT \no_perm + LOAD_INPUT 0, 1, 2, 3, x2, \no_perm + LOAD_INPUT 4, 5, 6, 7, x2, \no_perm + + LOAD_SUBADD + FFT16 v0, v1, v2, v3, v4, v5, v6, v7 + + zip1 v20.2d, v0.2d, v4.2d + zip2 v21.2d, v0.2d, v4.2d + zip1 v22.2d, v1.2d, v6.2d + zip2 v23.2d, v1.2d, v6.2d + st1 { v20.4s, v21.4s, v22.4s, v23.4s }, [x1], #64 + + zip1 v24.2d, v2.2d, v5.2d + zip2 v25.2d, v2.2d, v5.2d + zip1 v26.2d, v3.2d, v7.2d + zip2 v27.2d, v3.2d, v7.2d + st1 { v24.4s, v25.4s, v26.4s, v27.4s }, [x1] + + ret +endfunc +.endm + +FFT16_FN float, 0 +FFT16_FN ns_float, 1 + +.macro SETUP_SR_RECOMB len, re, im, dec + ldr w5, =(\len - 4*7) + movrel \re, X(ff_tx_tab_\len\()_float) + add \im, \re, x5 + mov \dec, #-32 + +.if \len > 32 + mov x21, #2*\len + add x22, x21, x21, lsl #1 +.endif +.endm + +.macro SR_COMBINE e0, e1, e2, e3, e4, e5, e6, e7, \ + o0, o1, o2, o3, o4, o5, o6, o7, \ + re, im, dec, swap_im, \ + t0=v16, t1=v17, t2=v18, t3=v19, t4=v20, t5=v21, \ + t6=v22, t7=v23, t8=v24, t9=v25, ta=v26, tb=v27 + + ld1 { \t8\().4s, \t9\().4s }, [\im], \dec + ld1 { \t0\().4s, \t1\().4s }, [\re], #32 + +.if \swap_im == 1 + ext \t2\().16b, \t9\().16b, \t9\().16b, #8 + ext \t3\().16b, \t8\().16b, \t8\().16b, #8 +.else + ext \t2\().16b, \t8\().16b, \t8\().16b, #8 + ext \t3\().16b, \t9\().16b, \t9\().16b, #8 +.endif + + trn1 \t4\().4s, \t0\().4s, \t0\().4s // cos0022 + trn2 \t0\().4s, \t0\().4s, \t0\().4s // cos4466 + trn1 \t5\().4s, \t1\().4s, \t1\().4s // cos1133 + trn2 \t1\().4s, \t1\().4s, \t1\().4s // cos5577 + + rev64 \t6\().4s, \o0\().4s // E m2[0,1].imre + rev64 \t7\().4s, \o2\().4s // O m2[0,1].imre + rev64 \t8\().4s, \o4\().4s // E m2[2,3].imre + rev64 \t9\().4s, \o6\().4s // O m2[2,3].imre + + fmul \t6\().4s, \t6\().4s, \t4\().4s // E m2[0,1].imre*t1[0,2] + fmul \t7\().4s, \t7\().4s, \t0\().4s // O m2[0,1].imre*t1[0,2] + fmul \t8\().4s, \t8\().4s, \t4\().4s // E m2[2,3].imre*t1[0,2] + fmul \t9\().4s, \t9\().4s, \t0\().4s // O m2[2,3].imre*t1[0,2] + + rev64 \ta\().4s, \o1\().4s // E m3[0,1].imre + rev64 \tb\().4s, \o3\().4s // O m3[0,1].imre + rev64 \t4\().4s, \o5\().4s // E m3[2,3].imre + rev64 \t0\().4s, \o7\().4s // O m3[2,3].imre + + fmul \ta\().4s, \ta\().4s, \t5\().4s // E m3[0,1].imre*t1[4,6] + fmul \tb\().4s, \tb\().4s, \t1\().4s // O m3[0,1].imre*t1[4,6] + fmul \t4\().4s, \t4\().4s, \t5\().4s // E m3[2,3].imre*t1[4,6] + fmul \t0\().4s, \t0\().4s, \t1\().4s // O m3[2,3].imre*t1[4,6] + + trn1 \t5\().4s, \t3\().4s, \t3\().4s // wim2200 + trn2 \t3\().4s, \t3\().4s, \t3\().4s // wim3311 + trn1 \t1\().4s, \t2\().4s, \t2\().4s // wim6644 + trn2 \t2\().4s, \t2\().4s, \t2\().4s // wim7755 + + fmul \t5\().4s, \t5\().4s, v31.4s + fmul \t3\().4s, \t3\().4s, v31.4s + fmul \t1\().4s, \t1\().4s, v31.4s + fmul \t2\().4s, \t2\().4s, v31.4s + + fmla \t7\().4s, \o2\().4s, \t5\().4s // O w0123 + fmls \t9\().4s, \o6\().4s, \t5\().4s // O j0123 + fmla \t6\().4s, \o0\().4s, \t3\().4s // E w0123 + fmls \t8\().4s, \o4\().4s, \t3\().4s // E j0123 + + fmla \ta\().4s, \o1\().4s, \t2\().4s // E w4567 + fmla \tb\().4s, \o3\().4s, \t1\().4s // O w4567 + fmls \t4\().4s, \o5\().4s, \t2\().4s // E j4567 + fmls \t0\().4s, \o7\().4s, \t1\().4s // O j4567 + + fsub \t2\().4s, \t7\().4s, \t9\().4s + fsub \t1\().4s, \t8\().4s, \t6\().4s + fsub \t3\().4s, \t4\().4s, \ta\().4s + fsub \t5\().4s, \t0\().4s, \tb\().4s + + fadd \t6\().4s, \t8\().4s, \t6\().4s + fadd \t7\().4s, \t9\().4s, \t7\().4s + fadd \t8\().4s, \t4\().4s, \ta\().4s + fadd \t9\().4s, \t0\().4s, \tb\().4s + + fmul \t1\().4s, \t1\().4s, v31.4s + fmul \t2\().4s, \t2\().4s, v31.4s + fmul \t3\().4s, \t3\().4s, v31.4s + fmul \t5\().4s, \t5\().4s, v31.4s + + rev64 \t6\().4s, \t6\().4s + rev64 \t8\().4s, \t8\().4s + rev64 \t7\().4s, \t7\().4s + rev64 \t9\().4s, \t9\().4s + + fsub \o0\().4s, \e0\().4s, \t6\().4s + fsub \o1\().4s, \e1\().4s, \t8\().4s + fsub \o2\().4s, \e2\().4s, \t1\().4s + fsub \o3\().4s, \e3\().4s, \t3\().4s + + fsub \o4\().4s, \e4\().4s, \t7\().4s + fsub \o5\().4s, \e6\().4s, \t9\().4s + fadd \o6\().4s, \e5\().4s, \t2\().4s + fsub \o7\().4s, \e7\().4s, \t5\().4s + + fadd \e0\().4s, \e0\().4s, \t6\().4s + fadd \e1\().4s, \e1\().4s, \t8\().4s + fadd \e2\().4s, \e2\().4s, \t1\().4s + fadd \e3\().4s, \e3\().4s, \t3\().4s + + fadd \e4\().4s, \e4\().4s, \t7\().4s + fsub \e5\().4s, \e5\().4s, \t2\().4s // swapped + fadd \e6\().4s, \e6\().4s, \t9\().4s // swapped + fadd \e7\().4s, \e7\().4s, \t5\().4s +.endm + +.macro SR_COMBINE_HALF e0, e1, e2, e3, \ + o0, o1, o2, o3, \ + c0, c1, c2, c3, \ + t0, t1, t2, t3, t4, t5, part + +.if \part == 0 + trn1 \t4\().4s, \c0\().4s, \c0\().4s // cos0022 + trn1 \c1\().4s, \c1\().4s, \c1\().4s // cos1133 +.else + trn2 \t4\().4s, \c0\().4s, \c0\().4s // cos0022 + trn2 \c1\().4s, \c1\().4s, \c1\().4s // cos1133 +.endif +.if \part == 0 + trn2 \t5\().4s, \c2\().4s, \c2\().4s // wim7755 + trn2 \c3\().4s, \c3\().4s, \c3\().4s // wim3311 +.else + trn1 \t5\().4s, \c2\().4s, \c2\().4s // wim7755 + trn1 \c3\().4s, \c3\().4s, \c3\().4s // wim3311 +.endif + + fmul \t5\().4s, \t5\().4s, v31.4s + fmul \c3\().4s, \c3\().4s, v31.4s + + rev64 \t0\().4s, \o0\().4s // E m2[0,1].imre + rev64 \t1\().4s, \o2\().4s // E m2[2,3].imre + rev64 \t2\().4s, \o1\().4s // E m3[0,1].imre + rev64 \t3\().4s, \o3\().4s // E m3[2,3].imre + + fmul \o0\().4s, \o0\().4s, \c3\().4s // E m2[0,1].imre*t1[0,2] + fmul \o1\().4s, \o1\().4s, \t5\().4s // E m3[0,1].imre*t1[4,6] + fmla \o0\().4s, \t0\().4s, \t4\().4s // E w0123 + fmla \o1\().4s, \t2\().4s, \c1\().4s // E w4567 + + fmul \t1\().4s, \t1\().4s, \t4\().4s // E m2[2,3].imre*t1[0,2] + fmul \t3\().4s, \t3\().4s, \c1\().4s // E m3[2,3].imre*t1[4,6] + fmls \t1\().4s, \o2\().4s, \c3\().4s // E j0123 + fmls \t3\().4s, \o3\().4s, \t5\().4s // E j4567 + + fsub \t0\().4s, \t1\().4s, \o0\().4s + fadd \t1\().4s, \t1\().4s, \o0\().4s + fadd \t2\().4s, \t3\().4s, \o1\().4s + fsub \t3\().4s, \t3\().4s, \o1\().4s + + fmul \t0\().4s, \t0\().4s, v31.4s + fmul \t3\().4s, \t3\().4s, v31.4s + + rev64 \t1\().4s, \t1\().4s + rev64 \t2\().4s, \t2\().4s + +.if \part == 0 + fsub \o0\().4s, \e0\().4s, \t1\().4s + fsub \o1\().4s, \e1\().4s, \t2\().4s + fsub \o2\().4s, \e2\().4s, \t0\().4s + fsub \o3\().4s, \e3\().4s, \t3\().4s +.else + fsub \o0\().4s, \e0\().4s, \t1\().4s + fadd \o2\().4s, \e1\().4s, \t2\().4s + fsub \o1\().4s, \e2\().4s, \t0\().4s + fadd \o3\().4s, \e3\().4s, \t3\().4s +.endif + +.if \part == 0 + fadd \e0\().4s, \e0\().4s, \t1\().4s + fadd \e1\().4s, \e1\().4s, \t2\().4s + fadd \e2\().4s, \e2\().4s, \t0\().4s + fadd \e3\().4s, \e3\().4s, \t3\().4s +.else + fadd \e0\().4s, \e0\().4s, \t1\().4s + fsub \e1\().4s, \e1\().4s, \t2\().4s // swapped + fadd \e2\().4s, \e2\().4s, \t0\().4s // swapped + fsub \e3\().4s, \e3\().4s, \t3\().4s +.endif +.endm + +/* Same as SR_COMBINE_HALF, but heroically tries to use 3 temporary registers + * without touching the tables. */ +.macro SR_COMBINE_LITE e0, e1, e2, e3, \ + o0, o1, o2, o3, \ + c0, c1, c2, c3, \ + t0, t1, t2, part + + rev64 \t0\().4s, \o0\().4s // E m2[0,1].imre + rev64 \t1\().4s, \o2\().4s // E m2[2,3].imre +.if \part == 0 + trn2 \t2\().4s, \c3\().4s, \c3\().4s // wim3311 +.else + trn1 \t2\().4s, \c3\().4s, \c3\().4s // wim3311 +.endif + fmul \t2\().4s, \t2\().4s, v31.4s + fmul \o2\().4s, \o2\().4s, \t2\().4s + fmul \o0\().4s, \o0\().4s, \t2\().4s // E m2[0,1].imre*t1[0,2] +.if \part == 0 + trn1 \t2\().4s, \c0\().4s, \c0\().4s // cos0022 +.else + trn2 \t2\().4s, \c0\().4s, \c0\().4s // cos0022 +.endif + fmul \t1\().4s, \t1\().4s, \t2\().4s // E m2[2,3].imre*t1[0,2] + fmla \o0\().4s, \t0\().4s, \t2\().4s // E w0123 + fsub \t1\().4s, \t1\().4s, \o2\().4s // E j0123 + + rev64 \t2\().4s, \o1\().4s // E m3[0,1].imre + rev64 \o2\().4s, \o3\().4s // E m3[2,3].imre + +.if \part == 0 + trn2 \t0\().4s, \c2\().4s, \c2\().4s // wim7755 +.else + trn1 \t0\().4s, \c2\().4s, \c2\().4s // wim7755 +.endif + fmul \t0\().4s, \t0\().4s, v31.4s + + fmul \o1\().4s, \o1\().4s, \t0\().4s // E m3[0,1].imre*t1[4,6] + fmul \o3\().4s, \o3\().4s, \t0\().4s + +.if \part == 0 + trn1 \t0\().4s, \c1\().4s, \c1\().4s // cos1133 +.else + trn2 \t0\().4s, \c1\().4s, \c1\().4s // cos1133 +.endif + fmul \o2\().4s, \o2\().4s, \t0\().4s // E m3[2,3].imre*t1[4,6] + fmla \o1\().4s, \t2\().4s, \t0\().4s // E w4567 + fsub \o2\().4s, \o2\().4s, \o3\().4s // E j4567 + + fsub \t0\().4s, \t1\().4s, \o0\().4s + fadd \o0\().4s, \t1\().4s, \o0\().4s + fadd \t2\().4s, \o2\().4s, \o1\().4s + fsub \t1\().4s, \o2\().4s, \o1\().4s + + fmul \t0\().4s, \t0\().4s, v31.4s + fmul \t1\().4s, \t1\().4s, v31.4s + + rev64 \t2\().4s, \t2\().4s + rev64 \o0\().4s, \o0\().4s + +.if \part == 0 + fsub \o1\().4s, \e1\().4s, \t2\().4s + fsub \o2\().4s, \e2\().4s, \t0\().4s + fsub \o3\().4s, \e3\().4s, \t1\().4s +.else + fadd \o2\().4s, \e1\().4s, \t0\().4s + fsub \o1\().4s, \e2\().4s, \t2\().4s + fadd \o3\().4s, \e3\().4s, \t1\().4s +.endif + +.if \part == 0 + fadd \e1\().4s, \e1\().4s, \t2\().4s + fadd \e2\().4s, \e2\().4s, \t0\().4s + fadd \e3\().4s, \e3\().4s, \t1\().4s +.else + fsub \e1\().4s, \e1\().4s, \t0\().4s // swapped + fadd \e2\().4s, \e2\().4s, \t2\().4s // swapped + fsub \e3\().4s, \e3\().4s, \t1\().4s +.endif + + mov \t1\().16b, \o0\().16b + + fsub \o0\().4s, \e0\().4s, \t1\().4s + fadd \e0\().4s, \e0\().4s, \t1\().4s +.endm + +.macro SR_COMBINE_4 len, part, off + add x10, x1, x21 + add x11, x1, x21, lsl #1 + add x12, x1, x22 + + ldp q0, q1, [x1, #((0 + \part)*32 + \off)] + ldp q4, q5, [x1, #((2 + \part)*32 + \off)] + ldp q2, q3, [x10, #((0 + \part)*32 + \off)] + ldp q6, q7, [x10, #((2 + \part)*32 + \off)] + + ldp q8, q9, [x11, #((0 + \part)*32 + \off)] + ldp q10, q11, [x11, #((2 + \part)*32 + \off)] + ldp q12, q13, [x12, #((0 + \part)*32 + \off)] + ldp q14, q15, [x12, #((2 + \part)*32 + \off)] + + SR_COMBINE v0, v1, v2, v3, v4, v6, v5, v7, \ + v8, v9, v10, v11, v12, v13, v14, v15, \ + x7, x8, x9, 0 + + stp q0, q1, [x1, #((0 + \part)*32 + \off)] + stp q4, q5, [x1, #((2 + \part)*32 + \off)] + stp q2, q3, [x10, #((0 + \part)*32 + \off)] + stp q6, q7, [x10, #((2 + \part)*32 + \off)] + + stp q8, q9, [x11, #((0 + \part)*32 + \off)] + stp q12, q13, [x11, #((2 + \part)*32 + \off)] + stp q10, q11, [x12, #((0 + \part)*32 + \off)] + stp q14, q15, [x12, #((2 + \part)*32 + \off)] +.endm + +.macro SR_COMBINE_FULL len, off=0 + add x10, x1, x21 + add x11, x1, x21, lsl #1 + add x12, x1, x22 + + SR_COMBINE_4 \len, 0, \off + SR_COMBINE_4 \len, 1, \off + SR_COMBINE_4 \len, 4, \off + SR_COMBINE_4 \len, 5, \off +.endm + +.macro SR_COMBINE_D2 part, off + add x10, x1, #((\part)*32 + \off) + add x11, x14, #((\part)*32 + \off) + add x12, x15, #((\part)*32 + \off) + add x13, x16, #((\part)*32 + \off) + + ldp q0, q1, [x10] + ldp q4, q5, [x10, #(2*32)] + ldp q2, q3, [x11] + ldp q6, q7, [x11, #(2*32)] + + ldp q8, q9, [x12] + ldp q10, q11, [x12, #(2*32)] + ldp q12, q13, [x13] + ldp q14, q15, [x13, #(2*32)] + + SR_COMBINE v0, v1, v2, v3, v4, v6, v5, v7, \ + v8, v9, v10, v11, v12, v13, v14, v15, \ + x7, x8, x9, 0, \ + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + + zip1 v16.2d, v0.2d, v4.2d + zip2 v17.2d, v0.2d, v4.2d + zip1 v18.2d, v1.2d, v5.2d + zip2 v19.2d, v1.2d, v5.2d + + zip1 v20.2d, v2.2d, v6.2d + zip2 v21.2d, v2.2d, v6.2d + zip1 v22.2d, v3.2d, v7.2d + zip2 v23.2d, v3.2d, v7.2d + + ldp q0, q1, [x10, #(1*32)] + ldp q4, q5, [x10, #(3*32)] + ldp q2, q3, [x11, #(1*32)] + ldp q6, q7, [x11, #(3*32)] + + st1 { v16.4s, v17.4s, v18.4s, v19.4s }, [x10], #64 + st1 { v20.4s, v21.4s, v22.4s, v23.4s }, [x11], #64 + + zip1 v20.2d, v8.2d, v12.2d + zip2 v21.2d, v8.2d, v12.2d + zip1 v22.2d, v9.2d, v13.2d + zip2 v23.2d, v9.2d, v13.2d + zip1 v24.2d, v10.2d, v14.2d + zip2 v25.2d, v10.2d, v14.2d + zip1 v26.2d, v11.2d, v15.2d + zip2 v27.2d, v11.2d, v15.2d + + ldp q8, q9, [x12, #(1*32)] + ldp q10, q11, [x12, #(3*32)] + ldp q12, q13, [x13, #(1*32)] + ldp q14, q15, [x13, #(3*32)] + + st1 { v20.4s, v21.4s, v22.4s, v23.4s }, [x12], #64 + st1 { v24.4s, v25.4s, v26.4s, v27.4s }, [x13], #64 + + SR_COMBINE v0, v1, v2, v3, v4, v6, v5, v7, \ + v8, v9, v10, v11, v12, v13, v14, v15, \ + x7, x8, x9, 0, \ + v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + + zip1 v16.2d, v0.2d, v4.2d + zip2 v17.2d, v0.2d, v4.2d + zip1 v18.2d, v1.2d, v5.2d + zip2 v19.2d, v1.2d, v5.2d + st1 { v16.4s, v17.4s, v18.4s, v19.4s }, [x10] + + zip1 v16.2d, v2.2d, v6.2d + zip2 v17.2d, v2.2d, v6.2d + zip1 v18.2d, v3.2d, v7.2d + zip2 v19.2d, v3.2d, v7.2d + st1 { v16.4s, v17.4s, v18.4s, v19.4s }, [x11] + + zip1 v20.2d, v8.2d, v12.2d + zip2 v21.2d, v8.2d, v12.2d + zip1 v22.2d, v9.2d, v13.2d + zip2 v23.2d, v9.2d, v13.2d + st1 { v20.4s, v21.4s, v22.4s, v23.4s }, [x12] + + zip1 v24.2d, v10.2d, v14.2d + zip2 v25.2d, v10.2d, v14.2d + zip1 v26.2d, v11.2d, v15.2d + zip2 v27.2d, v11.2d, v15.2d + st1 { v24.4s, v25.4s, v26.4s, v27.4s }, [x13] +.endm + +.macro SR_COMBINE_DINT off=0 + add x14, x1, x21 + add x15, x1, x21, lsl #1 + add x16, x1, x22 + + SR_COMBINE_D2 0, \off + SR_COMBINE_D2 4, \off +.endm + +.macro FFT32_FN name, no_perm +function ff_tx_fft32_\name\()_neon, export=1 + stp d14, d15, [sp, #-16*4]! + stp d8, d9, [sp, #16*3] + stp d10, d11, [sp, #16*2] + stp d12, d13, [sp, #16] + + LOAD_SUBADD + SETUP_SR_RECOMB 32, x7, x8, x9 + + SETUP_LUT \no_perm + LOAD_INPUT 0, 1, 2, 3, x2, \no_perm + LOAD_INPUT 4, 5, 6, 7, x2, \no_perm + LOAD_INPUT 8, 9, 10, 11, x2, \no_perm + LOAD_INPUT 12, 13, 14, 15, x2, \no_perm + + FFT8_X2 v8, v9, v10, v11, v12, v13, v14, v15 + FFT16 v0, v1, v2, v3, v4, v5, v6, v7 + + SR_COMBINE v0, v1, v2, v3, v4, v5, v6, v7, \ + v8, v9, v10, v11, v12, v13, v14, v15, \ + x7, x8, x9, 0 + + zip1 v16.2d, v0.2d, v4.2d + zip2 v17.2d, v0.2d, v4.2d + zip1 v18.2d, v1.2d, v6.2d + zip2 v19.2d, v1.2d, v6.2d + st1 { v16.4s, v17.4s, v18.4s, v19.4s }, [x1], #64 + + zip1 v20.2d, v2.2d, v5.2d + zip2 v21.2d, v2.2d, v5.2d + zip1 v22.2d, v3.2d, v7.2d + zip2 v23.2d, v3.2d, v7.2d + st1 { v20.4s, v21.4s, v22.4s, v23.4s }, [x1], #64 + + zip1 v24.2d, v8.2d, v12.2d + zip2 v25.2d, v8.2d, v12.2d + zip1 v26.2d, v9.2d, v13.2d + zip2 v27.2d, v9.2d, v13.2d + st1 { v24.4s, v25.4s, v26.4s, v27.4s }, [x1], #64 + + zip1 v28.2d, v10.2d, v14.2d + zip2 v29.2d, v10.2d, v14.2d + zip1 v30.2d, v11.2d, v15.2d + zip2 v31.2d, v11.2d, v15.2d + st1 { v28.4s, v29.4s, v30.4s, v31.4s }, [x1] + + ldp d12, d13, [sp, #16] + ldp d10, d11, [sp, #16*2] + ldp d8, d9, [sp, #16*3] + ldp d14, d15, [sp], #16*4 + + ret +endfunc +.endm + +FFT32_FN float, 0 +FFT32_FN ns_float, 1 + +.macro cmp_imm reg, imm +.if \imm >= 4096 + cmp \reg, #((\imm)/4096), lsl #12 +.else + cmp \reg, #(\imm) +.endif +.endm + +.macro SR_TRANSFORM_DEF len, next=0 +\len: + stp x20, x30, [sp, #-16]! + mov w20, #(\len/4) + mov x5, #((\len*4) - (\len/1)) + add x1, x1, x5 + bl 32b + mov x5, #((\len*2) - (\len/2)) + add x1, x1, x5 + bl 32b + ldp x20, x30, [sp], #16 + ldr w5, =(\len*6 + \len/2) + sub x1, x1, x5 + + SETUP_SR_RECOMB \len, x7, x8, x9 + +.if \next\() != 0 + cmp_imm w19, \len + b.eq 0f + + mov w5, #(\len/128) +\len\()5: + SR_COMBINE_FULL \len + add x1, x1, 8*32 + subs w5, w5, 1 + b.gt \len\()5b + + cmp_imm w20, \len + b.gt \next\()f + ret +.endif +.endm + +.macro FFT_SPLIT_RADIX_FN name, no_perm +function ff_tx_fft_sr_\name\()_neon, export=1 + stp x21, x22, [sp, #-16*6]! + stp d8, d9, [sp, #16*5] + stp d10, d11, [sp, #16*4] + stp d12, d13, [sp, #16*3] + stp d14, d15, [sp, #16*2] + stp x19, x20, [sp, #16] + + ldr w19, [x0, #0] // global target + mov w20, w19 // local length + + LOAD_SUBADD + SETUP_LUT \no_perm + +32: + SETUP_SR_RECOMB 32, x7, x8, x9 + + LOAD_INPUT 0, 1, 2, 3, x2, \no_perm + LOAD_INPUT 4, 6, 5, 7, x2, \no_perm, 1 + LOAD_INPUT 8, 9, 10, 11, x2, \no_perm + LOAD_INPUT 12, 13, 14, 15, x2, \no_perm + + FFT8_X2 v8, v9, v10, v11, v12, v13, v14, v15 + FFT16 v0, v1, v2, v3, v4, v6, v5, v7 + + SR_COMBINE v0, v1, v2, v3, v4, v6, v5, v7, \ + v8, v9, v10, v11, v12, v13, v14, v15, \ + x7, x8, x9, 0 + + stp q2, q3, [x1, #32*1] + stp q6, q7, [x1, #32*3] + stp q10, q11, [x1, #32*5] + stp q14, q15, [x1, #32*7] + + cmp w20, #32 + b.gt 64f + + stp q0, q1, [x1, #32*0] + stp q4, q5, [x1, #32*2] + stp q8, q9, [x1, #32*4] + stp q12, q13, [x1, #32*6] + + ret +64: + SETUP_SR_RECOMB 64, x7, x8, x9 + + LOAD_INPUT 2, 3, 10, 11, x2, \no_perm, 1 + LOAD_INPUT 6, 14, 7, 15, x2, \no_perm, 1 + + FFT16 v2, v3, v10, v11, v6, v14, v7, v15 + + LOAD_INPUT 16, 17, 18, 19, x2, \no_perm + LOAD_INPUT 20, 22, 21, 23, x2, \no_perm, 1 + + FFT16 v16, v17, v18, v19, v20, v22, v21, v23, \ + v24, v25, v26, v27, v28, v29, v30 + + ld1 { v26.4s, v27.4s }, [x8], x9 + ldp q24, q25, [x7], #32 + + ext v26.16b, v26.16b, v26.16b, #8 + ext v27.16b, v27.16b, v27.16b, #8 + + cmp w19, #64 + b.eq 2f // custom deinterleave + + // TODO: investigate doing the 2 combines like in deinterleave + // TODO: experiment with spilling to gprs and converting to HALF or full + SR_COMBINE_LITE v0, v1, v8, v9, \ + v2, v3, v16, v17, \ + v24, v25, v26, v27, \ + v28, v29, v30, 0 + + stp q0, q1, [x1, #32* 0] + stp q8, q9, [x1, #32* 4] + stp q2, q3, [x1, #32* 8] + stp q16, q17, [x1, #32*12] + + SR_COMBINE_HALF v4, v5, v12, v13, \ + v6, v7, v20, v21, \ + v24, v25, v26, v27, \ + v28, v29, v30, v0, v1, v8, 1 + + stp q4, q20, [x1, #32* 2] + stp q12, q21, [x1, #32* 6] + stp q6, q5, [x1, #32*10] + stp q7, q13, [x1, #32*14] + + ldp q2, q3, [x1, #32*1] + ldp q6, q7, [x1, #32*3] + ldp q12, q13, [x1, #32*5] + ldp q16, q17, [x1, #32*7] + + SR_COMBINE v2, v3, v12, v13, v6, v16, v7, v17, \ + v10, v11, v14, v15, v18, v19, v22, v23, \ + x7, x8, x9, 0, \ + v24, v25, v26, v27, v28, v29, v30, v8, v0, v1, v4, v5 + + stp q2, q3, [x1, #32* 1] + stp q6, q7, [x1, #32* 3] + stp q12, q13, [x1, #32* 5] + stp q16, q17, [x1, #32* 7] + + stp q10, q11, [x1, #32* 9] + stp q18, q19, [x1, #32*11] + stp q14, q15, [x1, #32*13] + stp q22, q23, [x1, #32*15] + + cmp w20, #64 + b.gt 128f + ret +128: + stp x20, x30, [sp, #-16]! + mov w20, #32 + add x1, x1, #16*32 + bl 32b + add x1, x1, #8*32 + bl 32b + ldp x20, x30, [sp], #16 + sub x1, x1, #24*32 + + SETUP_SR_RECOMB 128, x7, x8, x9 + + cmp w19, #128 + b.eq 0f + + SR_COMBINE_FULL 128 + + cmp w20, #128 + b.gt 256f + ret +256: + stp x20, x30, [sp, #-16]! + mov w20, #64 + add x1, x1, #32*32 + bl 32b + add x1, x1, #16*32 + bl 32b + ldp x20, x30, [sp], #16 + sub x1, x1, #48*32 + + SETUP_SR_RECOMB 256, x7, x8, x9 + + cmp w19, #256 + b.eq 0f + + SR_COMBINE_FULL 256 + SR_COMBINE_FULL 256, 8*32 + + cmp w20, #256 + b.gt 512f + ret +512: + stp x20, x30, [sp, #-16]! + mov w20, #128 + add x1, x1, #64*32 + bl 32b + add x1, x1, #32*32 + bl 32b + ldp x20, x30, [sp], #16 + sub x1, x1, #96*32 + + SETUP_SR_RECOMB 512, x7, x8, x9 + + cmp w19, #512 + b.eq 0f + + mov x5, 4 +5125: + SR_COMBINE_FULL 512 + add x1, x1, 8*32 + subs w5, w5, 1 + b.gt 5125b + + cmp w20, #512 + b.gt 1024f + + ret +1024: + stp x20, x30, [sp, #-16]! + mov w20, #256 + add x1, x1, #96*32 + bl 32b + add x1, x1, #64*32 + bl 32b + ldp x20, x30, [sp], #16 + mov x5, #192*32 + sub x1, x1, x5 + + SETUP_SR_RECOMB 1024, x7, x8, x9 + + cmp w19, #1024 + b.eq 0f + + mov w5, 8 +10245: + SR_COMBINE_FULL 1024 + add x1, x1, 8*32 + subs w5, w5, 1 + b.gt 10245b + + cmp w20, #1024 + b.gt 2048f + + ret + +SR_TRANSFORM_DEF 2048, 4096 +SR_TRANSFORM_DEF 4096, 8192 +SR_TRANSFORM_DEF 8192, 16384 +SR_TRANSFORM_DEF 16384, 32768 +SR_TRANSFORM_DEF 32768, 65536 +SR_TRANSFORM_DEF 65536, 131072 +SR_TRANSFORM_DEF 131072 + +0: // general deinterleave loop + SR_COMBINE_DINT + add x1, x1, #32*8 + subs w19, w19, #32*4 + b.gt 0b + + ldp x19, x20, [sp, #16] + ldp d14, d15, [sp, #16*2] + ldp d12, d13, [sp, #16*3] + ldp d10, d11, [sp, #16*4] + ldp d8, d9, [sp, #16*5] + ldp x21, x22, [sp], #16*6 + + ret + +2: // special case for 64 point deinterleave + mov x10, v23.d[0] + mov x11, v23.d[1] + + SR_COMBINE_LITE v0, v1, v8, v9, \ + v2, v3, v16, v17, \ + v24, v25, v26, v27, \ + v28, v29, v30, 0 + + SR_COMBINE_HALF v4, v5, v12, v13, \ + v6, v7, v20, v21, \ + v24, v25, v26, v27, \ + v28, v29, v30, v23, v24, v26, 1 + + zip1 v23.2d, v0.2d, v4.2d + zip2 v24.2d, v0.2d, v4.2d + zip1 v25.2d, v1.2d, v20.2d + zip2 v26.2d, v1.2d, v20.2d + + zip1 v27.2d, v8.2d, v12.2d + zip2 v28.2d, v8.2d, v12.2d + zip1 v29.2d, v9.2d, v21.2d + zip2 v30.2d, v9.2d, v21.2d + + mov v20.16b, v5.16b + mov v21.16b, v7.16b + mov x12, x1 + add x13, x1, #32* 4 + add x14, x1, #32* 8 + add x15, x1, #32*12 + + zip1 v4.2d, v2.2d, v6.2d + zip2 v5.2d, v2.2d, v6.2d + zip1 v6.2d, v3.2d, v20.2d + zip2 v7.2d, v3.2d, v20.2d + + zip1 v0.2d, v16.2d, v21.2d + zip2 v1.2d, v16.2d, v21.2d + zip1 v2.2d, v17.2d, v13.2d + zip2 v3.2d, v17.2d, v13.2d + + // stp is faster by a little on A53, but this is faster on M1s (theory) + ldp q8, q9, [x1, #32*1] + ldp q12, q13, [x1, #32*5] + + st1 { v23.4s, v24.4s, v25.4s, v26.4s }, [x12], #64 // 32* 0...1 + st1 { v27.4s, v28.4s, v29.4s, v30.4s }, [x13], #64 // 32* 4...5 + st1 { v4.4s, v5.4s, v6.4s, v7.4s }, [x14], #64 // 32* 8...9 + st1 { v0.4s, v1.4s, v2.4s, v3.4s }, [x15], #64 // 32*12..13 + + mov v23.d[0], x10 + mov v23.d[1], x11 + + ldp q6, q7, [x1, #32*3] + ldp q16, q17, [x1, #32*7] + + SR_COMBINE v8, v9, v12, v13, v6, v16, v7, v17, \ + v10, v11, v14, v15, v18, v19, v22, v23, \ + x7, x8, x9, 0, \ + v24, v25, v26, v27, v28, v29, v30, v4, v0, v1, v5, v20 + + zip1 v0.2d, v8.2d, v6.2d + zip2 v1.2d, v8.2d, v6.2d + zip1 v2.2d, v9.2d, v7.2d + zip2 v3.2d, v9.2d, v7.2d + st1 { v0.4s, v1.4s, v2.4s, v3.4s }, [x12] + + zip1 v4.2d, v12.2d, v16.2d + zip2 v5.2d, v12.2d, v16.2d + zip1 v6.2d, v13.2d, v17.2d + zip2 v7.2d, v13.2d, v17.2d + st1 { v4.4s, v5.4s, v6.4s, v7.4s }, [x13] + + zip1 v0.2d, v10.2d, v18.2d + zip2 v1.2d, v10.2d, v18.2d + zip1 v2.2d, v11.2d, v19.2d + zip2 v3.2d, v11.2d, v19.2d + st1 { v0.4s, v1.4s, v2.4s, v3.4s }, [x14] + + zip1 v4.2d, v14.2d, v22.2d + zip2 v5.2d, v14.2d, v22.2d + zip1 v6.2d, v15.2d, v23.2d + zip2 v7.2d, v15.2d, v23.2d + st1 { v4.4s, v5.4s, v6.4s, v7.4s }, [x15] + + ldp x19, x20, [sp, #16] + ldp d14, d15, [sp, #16*2] + ldp d12, d13, [sp, #16*3] + ldp d10, d11, [sp, #16*4] + ldp d8, d9, [sp, #16*5] + ldp x21, x22, [sp], #16*6 + + ret +endfunc +.endm + +FFT_SPLIT_RADIX_FN float, 0 +FFT_SPLIT_RADIX_FN ns_float, 1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.c 2023-03-03 13:29:59.000000000 +0000 @@ -80,25 +80,27 @@ static void subshift(av_aes_block s0[2], int s, const uint8_t *box) { - av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s); - av_aes_block *s3 = (av_aes_block *) (s0[0].u8 + s); + unsigned char *s1_dst = (unsigned char*)s0[0].u8 + 3 - s; + const unsigned char *s1_src = s1_dst + sizeof(*s0); + unsigned char *s3_dst = (unsigned char*)s0[0].u8 + s + 1; + const unsigned char *s3_src = s3_dst + sizeof(*s0); s0[0].u8[ 0] = box[s0[1].u8[ 0]]; s0[0].u8[ 4] = box[s0[1].u8[ 4]]; s0[0].u8[ 8] = box[s0[1].u8[ 8]]; s0[0].u8[12] = box[s0[1].u8[12]]; - s1[0].u8[ 3] = box[s1[1].u8[ 7]]; - s1[0].u8[ 7] = box[s1[1].u8[11]]; - s1[0].u8[11] = box[s1[1].u8[15]]; - s1[0].u8[15] = box[s1[1].u8[ 3]]; + s1_dst[ 0] = box[s1_src[ 4]]; + s1_dst[ 4] = box[s1_src[ 8]]; + s1_dst[ 8] = box[s1_src[12]]; + s1_dst[12] = box[s1_src[ 0]]; s0[0].u8[ 2] = box[s0[1].u8[10]]; s0[0].u8[10] = box[s0[1].u8[ 2]]; s0[0].u8[ 6] = box[s0[1].u8[14]]; s0[0].u8[14] = box[s0[1].u8[ 6]]; - s3[0].u8[ 1] = box[s3[1].u8[13]]; - s3[0].u8[13] = box[s3[1].u8[ 9]]; - s3[0].u8[ 9] = box[s3[1].u8[ 5]]; - s3[0].u8[ 5] = box[s3[1].u8[ 1]]; + s3_dst[ 0] = box[s3_src[12]]; + s3_dst[12] = box[s3_src[ 8]]; + s3_dst[ 8] = box[s3_src[ 4]]; + s3_dst[ 4] = box[s3_src[ 0]]; } static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d) @@ -251,7 +253,7 @@ tk[j][i] ^= sbox[tk[j - 1][i]]; } - memcpy(a->round_key[0].u8 + t, tk, KC * 4); + memcpy((unsigned char*)a->round_key + t, tk, KC * 4); } if (decrypt) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes_ctr.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes_ctr.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes_ctr.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes_ctr.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,12 @@ #ifndef AVUTIL_AES_CTR_H #define AVUTIL_AES_CTR_H +/** + * @defgroup lavu_aes_ctr AES-CTR + * @ingroup lavu_crypto + * @{ + */ + #include #include "attributes.h" @@ -38,17 +44,23 @@ /** * Initialize an AVAESCTR context. + * + * @param a The AVAESCTR context to initialize * @param key encryption key, must have a length of AES_CTR_KEY_SIZE */ int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); /** * Release an AVAESCTR context. + * + * @param a The AVAESCTR context */ void av_aes_ctr_free(struct AVAESCTR *a); /** * Process a buffer using a previously initialized context. + * + * @param a The AVAESCTR context * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param size the size of src and dst diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/aes.h 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,9 @@ /** * Initialize an AVAES context. + * + * @param a The AVAES context + * @param key Pointer to the key * @param key_bits 128, 192 or 256 * @param decrypt 0 for encryption, 1 for decryption */ @@ -49,9 +52,11 @@ /** * Encrypt or decrypt a buffer using a previously initialized context. - * @param count number of 16 byte blocks + * + * @param a The AVAES context * @param dst destination array, can be equal to src * @param src source array, can be equal to dst + * @param count number of 16 byte blocks * @param iv initialization vector for CBC mode, if NULL then ECB will be used * @param decrypt 0 for encryption, 1 for decryption */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Jan Ekström + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "ambient_viewing_environment.h" +#include "mem.h" + +AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size) +{ + AVAmbientViewingEnvironment *env = + av_mallocz(sizeof(AVAmbientViewingEnvironment)); + if (!env) + return NULL; + + if (size) + *size = sizeof(*env); + + return env; +} + +AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame) +{ + AVFrameSideData *side_data = + av_frame_new_side_data(frame, + AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + sizeof(AVAmbientViewingEnvironment)); + if (!side_data) + return NULL; + + memset(side_data->data, 0, side_data->size); + + return (AVAmbientViewingEnvironment *)side_data->data; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/ambient_viewing_environment.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Jan Ekström + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_AMBIENT_VIEWING_ENVIRONMENT_H +#define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H + +#include +#include "frame.h" +#include "rational.h" + +/** + * Ambient viewing environment metadata as defined by H.274. The values are + * saved in AVRationals so that they keep their exactness, while allowing for + * easy access to a double value with f.ex. av_q2d. + * + * @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and + * it must be allocated using av_ambient_viewing_environment_alloc. + */ +typedef struct AVAmbientViewingEnvironment { + /** + * Environmental illuminance of the ambient viewing environment in lux. + */ + AVRational ambient_illuminance; + + /** + * Normalized x chromaticity coordinate of the environmental ambient light + * in the nominal viewing environment according to the CIE 1931 definition + * of x and y as specified in ISO/CIE 11664-1. + */ + AVRational ambient_light_x; + + /** + * Normalized y chromaticity coordinate of the environmental ambient light + * in the nominal viewing environment according to the CIE 1931 definition + * of x and y as specified in ISO/CIE 11664-1. + */ + AVRational ambient_light_y; +} AVAmbientViewingEnvironment; + +/** + * Allocate an AVAmbientViewingEnvironment structure. + * + * @return the newly allocated struct or NULL on failure + */ +AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size); + +/** + * Allocate and add an AVAmbientViewingEnvironment structure to an existing + * AVFrame as side data. + * + * @return the newly allocated struct, or NULL on failure + */ +AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame); + +#endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/bswap.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/bswap.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/bswap.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/bswap.h 2023-03-03 13:29:59.000000000 +0000 @@ -39,8 +39,10 @@ #define av_bswap16 av_bswap16 static av_always_inline av_const unsigned av_bswap16(unsigned x) { - __asm__("rev16 %0, %0" : "+r"(x)); - return x; + unsigned y; + + __asm__("rev16 %0, %1" : "=r"(y) : "r"(x)); + return y; } #endif @@ -48,17 +50,18 @@ #define av_bswap32 av_bswap32 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) { + uint32_t y; #if HAVE_ARMV6_INLINE - __asm__("rev %0, %0" : "+r"(x)); + __asm__("rev %0, %1" : "=r"(y) : "r"(x)); #else uint32_t t; - __asm__ ("eor %1, %0, %0, ror #16 \n\t" + __asm__ ("eor %1, %2, %2, ror #16 \n\t" "bic %1, %1, #0xFF0000 \n\t" - "mov %0, %0, ror #8 \n\t" + "mov %0, %2, ror #8 \n\t" "eor %0, %0, %1, lsr #8 \n\t" - : "+r"(x), "=&r"(t)); + : "=r"(y), "=&r"(t) : "r"(x)); #endif /* HAVE_ARMV6_INLINE */ - return x; + return y; } #endif /* AV_GCC_VERSION_AT_MOST(4,4) */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/intmath.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/intmath.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/intmath.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/arm/intmath.h 2023-03-03 13:29:59.000000000 +0000 @@ -65,17 +65,29 @@ #define av_clip_intp2 av_clip_intp2_arm static av_always_inline av_const int av_clip_intp2_arm(int a, int p) { - unsigned x; - __asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1)); - return x; + if (av_builtin_constant_p(p)) { + unsigned x; + __asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1)); + return x; + } else { + if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) + return (a >> 31) ^ ((1 << p) - 1); + else + return a; + } } #define av_clip_uintp2 av_clip_uintp2_arm static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p) { - unsigned x; - __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p)); - return x; + if (av_builtin_constant_p(p)) { + unsigned x; + __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p)); + return x; + } else { + if (a & ~((1<> 31 & ((1<len can be greater than buf->size and records the - * total length of what would have been to the buffer if there had been + * In other words, AVBPrint.len can be greater than AVBPrint.size and records + * the total length of what would have been to the buffer if there had been * enough memory. * * Append operations do not need to be tested for failure: if a memory @@ -63,20 +77,17 @@ * is still updated. This situation can be tested with * av_bprint_is_complete(). * - * The size_max field determines several possible behaviours: - * - * size_max = -1 (= UINT_MAX) or any large value will let the buffer be - * reallocated as necessary, with an amortized linear cost. - * - * size_max = 0 prevents writing anything to the buffer: only the total - * length is computed. The write operations can then possibly be repeated in - * a buffer with exactly the necessary size - * (using size_init = size_max = len + 1). - * - * size_max = 1 is automatically replaced by the exact size available in the - * structure itself, thus ensuring no dynamic memory allocation. The - * internal buffer is large enough to hold a reasonable paragraph of text, - * such as the current paragraph. + * The AVBPrint.size_max field determines several possible behaviours: + * - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be + * reallocated as necessary, with an amortized linear cost. + * - `size_max = 0` prevents writing anything to the buffer: only the total + * length is computed. The write operations can then possibly be repeated in + * a buffer with exactly the necessary size + * (using `size_init = size_max = len + 1`). + * - `size_max = 1` is automatically replaced by the exact size available in the + * structure itself, thus ensuring no dynamic memory allocation. The + * internal buffer is large enough to hold a reasonable paragraph of text, + * such as the current paragraph. */ FF_PAD_STRUCTURE(AVBPrint, 1024, @@ -88,12 +99,31 @@ ) /** + * @name Max size special values * Convenience macros for special values for av_bprint_init() size_max * parameter. + * @{ + */ + +/** + * Buffer will be reallocated as necessary, with an amortized linear cost. */ #define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1) +/** + * Use the exact size available in the AVBPrint structure itself. + * + * Thus ensuring no dynamic memory allocation. The internal buffer is large + * enough to hold a reasonable paragraph of text, such as the current paragraph. + */ #define AV_BPRINT_SIZE_AUTOMATIC 1 +/** + * Do not write anything to the buffer, only calculate the total length. + * + * The write operations can then possibly be repeated in a buffer with + * exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`). + */ #define AV_BPRINT_SIZE_COUNT_ONLY 0 +/** @} */ /** * Init a print buffer. @@ -101,12 +131,12 @@ * @param buf buffer to init * @param size_init initial size (including the final 0) * @param size_max maximum size; - * 0 means do not write anything, just count the length; - * 1 is replaced by the maximum value for automatic storage; - * any large value means that the internal buffer will be - * reallocated as needed up to that limit; -1 is converted to - * UINT_MAX, the largest limit possible. - * Check also AV_BPRINT_SIZE_* macros. + * - `0` means do not write anything, just count the length + * - `1` is replaced by the maximum value for automatic storage + * any large value means that the internal buffer will be + * reallocated as needed up to that limit + * - `-1` is converted to `UINT_MAX`, the largest limit possible. + * Check also `AV_BPRINT_SIZE_*` macros. */ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); @@ -216,4 +246,6 @@ void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags); +/** @} */ + #endif /* AVUTIL_BPRINT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/bswap.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/bswap.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/bswap.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/bswap.h 2023-03-03 13:29:59.000000000 +0000 @@ -40,6 +40,8 @@ # include "arm/bswap.h" #elif ARCH_AVR32 # include "avr32/bswap.h" +#elif ARCH_RISCV +# include "riscv/bswap.h" #elif ARCH_SH4 # include "sh4/bswap.h" #elif ARCH_X86 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/buffer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/buffer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/buffer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/buffer.c 2023-03-03 13:29:59.000000000 +0000 @@ -341,9 +341,6 @@ BufferPoolEntry *buf = opaque; AVBufferPool *pool = buf->pool; - if(CONFIG_MEMORY_POISONING) - memset(buf->data, FF_MEMORY_POISON, pool->size); - ff_mutex_lock(&pool->mutex); buf->next = pool->pool; pool->pool = buf; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/camellia.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/camellia.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/camellia.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/camellia.h 2023-03-03 13:29:59.000000000 +0000 @@ -59,7 +59,7 @@ * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param count number of 16 byte blocks - * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param iv initialization vector for CBC mode, NULL for ECB mode * @param decrypt 0 for encryption, 1 for decryption */ void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cast5.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cast5.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cast5.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cast5.c 2023-03-03 13:29:59.000000000 +0000 @@ -32,7 +32,7 @@ #define IC(x) (((x) >> 8) & 0xff) #define ID(x) ((x) & 0xff) -#define LR(x, c) (((x) << (c)) | ((x) >> (32 - (c)))) +#define LR(x, c) (((x) << (c)) | ((x) >> ((32 - (c)) & 31))) #define F3(l, r, i) \ do { \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.c 2023-03-03 13:29:59.000000000 +0000 @@ -196,7 +196,9 @@ { "7.1", AV_CHANNEL_LAYOUT_7POINT1 }, { "7.1(wide)", AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK }, { "7.1(wide-side)", AV_CHANNEL_LAYOUT_7POINT1_WIDE }, + { "7.1(top)", AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK }, { "octagonal", AV_CHANNEL_LAYOUT_OCTAGONAL }, + { "cube", AV_CHANNEL_LAYOUT_CUBE }, { "hexadecagonal", AV_CHANNEL_LAYOUT_HEXADECAGONAL }, { "downmix", AV_CHANNEL_LAYOUT_STEREO_DOWNMIX, }, { "22.2", AV_CHANNEL_LAYOUT_22POINT2, }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/channel_layout.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,11 +30,17 @@ /** * @file - * audio channel layout utility functions + * @ingroup lavu_audio_channels + * Public libavutil channel layout APIs header. */ + /** - * @addtogroup lavu_audio + * @defgroup lavu_audio_channels Audio channels + * @ingroup lavu_audio + * + * Audio channel layout utility functions + * * @{ */ @@ -84,9 +90,9 @@ * Range of channels between AV_CHAN_AMBISONIC_BASE and * AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system. * - * Given a channel id between AV_CHAN_AMBISONIC_BASE and - * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel is - * = - AV_CHAN_AMBISONIC_BASE. + * Given a channel id `` between AV_CHAN_AMBISONIC_BASE and + * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `` is + * ` = - AV_CHAN_AMBISONIC_BASE`. * * @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel * orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels @@ -226,7 +232,9 @@ #define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) #define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_7POINT1_TOP_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) #define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) #define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) @@ -266,8 +274,11 @@ * A channel layout here is defined as a set of channels ordered in a specific * way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an * AVChannelLayout carries only the channel count). + * All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by + * ignoring everything but the channel count, as long as av_channel_layout_check() + * considers they are valid. * - * Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the + * Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the * public ABI and may be used by the caller. E.g. it may be allocated on stack * or embedded in caller-defined structs. * @@ -350,6 +361,10 @@ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} +/** + * @name Common pre-defined channel layouts + * @{ + */ #define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO) #define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO) #define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1) @@ -375,17 +390,25 @@ #define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK) +#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_TOP_BACK) #define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL) +#define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE) #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 }} +/** @} */ struct AVBPrint; #if FF_API_OLD_CHANNEL_LAYOUT /** + * @name Deprecated Functions + * @{ + */ + +/** * Return a channel layout id that matches name, or 0 if no match is found. * * name can be one or several of the following notations, @@ -429,6 +452,8 @@ * * @param buf put here the string containing the channel layout * @param buf_size size in bytes of the buffer + * @param nb_channels number of channels + * @param channel_layout channel layout bitset * @deprecated use av_channel_layout_describe() */ attribute_deprecated @@ -459,6 +484,7 @@ /** * Get the index of a channel in channel_layout. * + * @param channel_layout channel layout bitset * @param channel a channel layout describing exactly one channel which must be * present in channel_layout. * @@ -511,6 +537,9 @@ attribute_deprecated int av_get_standard_channel_layout(unsigned index, uint64_t *layout, const char **name); +/** + * @} + */ #endif /** @@ -519,6 +548,7 @@ * * @param buf pre-allocated buffer where to put the generated string * @param buf_size size in bytes of the buffer. + * @param channel the AVChannel whose name to get * @return amount of bytes needed to hold the output string, or a negative AVERROR * on failure. If the returned value is bigger than buf_size, then the * string was truncated. @@ -537,6 +567,7 @@ * * @param buf pre-allocated buffer where to put the generated string * @param buf_size size in bytes of the buffer. + * @param channel the AVChannel whose description to get * @return amount of bytes needed to hold the output string, or a negative AVERROR * on failure. If the returned value is bigger than buf_size, then the * string was truncated. @@ -593,7 +624,7 @@ /** * Get the default channel layout for a given number of channels. * - * @param channel_layout the layout structure to be initialized + * @param ch_layout the layout structure to be initialized * @param nb_channels number of channels */ void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels); @@ -658,6 +689,7 @@ * Get the channel with the given index in a channel layout. * * @param channel_layout input channel layout + * @param idx index of the channel * @return channel with the index idx in channel_layout on success or * AV_CHAN_NONE on failure (if idx is not valid or the channel order is * unspecified) @@ -670,6 +702,7 @@ * channels are found, only the first match will be returned. * * @param channel_layout input channel layout + * @param channel the channel whose index to obtain * @return index of channel in channel_layout on success or a negative number if * channel is not present in channel_layout. */ @@ -684,6 +717,7 @@ * @ref av_channel_from_string(). * * @param channel_layout input channel layout + * @param name string describing the channel whose index to obtain * @return a channel index described by the given string, or a negative AVERROR * value. */ @@ -697,6 +731,7 @@ * @ref av_channel_from_string(). * * @param channel_layout input channel layout + * @param name string describing the channel to obtain * @return a channel described by the given string in channel_layout on success * or AV_CHAN_NONE on failure (if the string is not valid or the channel * order is unspecified) @@ -743,7 +778,6 @@ /** * @} - * @} */ #endif /* AVUTIL_CHANNEL_LAYOUT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2015 Kevin Wheatley - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * 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/color_utils.h" -#include "libavutil/pixfmt.h" - -double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc) -{ - double gamma; - switch (trc) { - case AVCOL_TRC_BT709: - case AVCOL_TRC_SMPTE170M: - case AVCOL_TRC_SMPTE240M: - case AVCOL_TRC_BT1361_ECG: - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - /* these share a segmented TRC, but gamma 1.961 is a close - approximation, and also more correct for decoding content */ - gamma = 1.961; - break; - case AVCOL_TRC_GAMMA22: - case AVCOL_TRC_IEC61966_2_1: - gamma = 2.2; - break; - case AVCOL_TRC_GAMMA28: - gamma = 2.8; - break; - case AVCOL_TRC_LINEAR: - gamma = 1.0; - break; - default: - gamma = 0.0; // Unknown value representation - } - return gamma; -} - -#define BT709_alpha 1.099296826809442 -#define BT709_beta 0.018053968510807 - -static double avpriv_trc_bt709(double Lc) -{ - const double a = BT709_alpha; - const double b = BT709_beta; - - return (0.0 > Lc) ? 0.0 - : ( b > Lc) ? 4.500 * Lc - : a * pow(Lc, 0.45) - (a - 1.0); -} - -static double avpriv_trc_gamma22(double Lc) -{ - return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2); -} - -static double avpriv_trc_gamma28(double Lc) -{ - return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8); -} - -static double avpriv_trc_smpte240M(double Lc) -{ - const double a = 1.1115; - const double b = 0.0228; - - return (0.0 > Lc) ? 0.0 - : ( b > Lc) ? 4.000 * Lc - : a * pow(Lc, 0.45) - (a - 1.0); -} - -static double avpriv_trc_linear(double Lc) -{ - return Lc; -} - -static double avpriv_trc_log(double Lc) -{ - return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0; -} - -static double avpriv_trc_log_sqrt(double Lc) -{ - // sqrt(10) / 1000 - return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5; -} - -static double avpriv_trc_iec61966_2_4(double Lc) -{ - const double a = BT709_alpha; - const double b = BT709_beta; - - return (-b >= Lc) ? -a * pow(-Lc, 0.45) + (a - 1.0) - : ( b > Lc) ? 4.500 * Lc - : a * pow( Lc, 0.45) - (a - 1.0); -} - -static double avpriv_trc_bt1361(double Lc) -{ - const double a = BT709_alpha; - const double b = BT709_beta; - - return (-0.0045 >= Lc) ? -(a * pow(-4.0 * Lc, 0.45) + (a - 1.0)) / 4.0 - : ( b > Lc) ? 4.500 * Lc - : a * pow( Lc, 0.45) - (a - 1.0); -} - -static double avpriv_trc_iec61966_2_1(double Lc) -{ - const double a = 1.055; - const double b = 0.0031308; - - return (0.0 > Lc) ? 0.0 - : ( b > Lc) ? 12.92 * Lc - : a * pow(Lc, 1.0 / 2.4) - (a - 1.0); -} - -static double avpriv_trc_smpte_st2084(double Lc) -{ - const double c1 = 3424.0 / 4096.0; // c3-c2 + 1 - const double c2 = 32.0 * 2413.0 / 4096.0; - const double c3 = 32.0 * 2392.0 / 4096.0; - const double m = 128.0 * 2523.0 / 4096.0; - const double n = 0.25 * 2610.0 / 4096.0; - const double L = Lc / 10000.0; - const double Ln = pow(L, n); - - return (0.0 > Lc) ? 0.0 - : pow((c1 + c2 * Ln) / (1.0 + c3 * Ln), m); - -} - -static double avpriv_trc_smpte_st428_1(double Lc) -{ - return (0.0 > Lc) ? 0.0 - : pow(48.0 * Lc / 52.37, 1.0 / 2.6); -} - - -static double avpriv_trc_arib_std_b67(double Lc) { - // The function uses the definition from HEVC, which assumes that the peak - // white is input level = 1. (this is equivalent to scaling E = Lc * 12 and - // using the definition from the ARIB STD-B67 spec) - const double a = 0.17883277; - const double b = 0.28466892; - const double c = 0.55991073; - return (0.0 > Lc) ? 0.0 : - (Lc <= 1.0 / 12.0 ? sqrt(3.0 * Lc) : a * log(12.0 * Lc - b) + c); -} - -avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc) -{ - avpriv_trc_function func = NULL; - switch (trc) { - case AVCOL_TRC_BT709: - case AVCOL_TRC_SMPTE170M: - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - func = avpriv_trc_bt709; - break; - - case AVCOL_TRC_GAMMA22: - func = avpriv_trc_gamma22; - break; - case AVCOL_TRC_GAMMA28: - func = avpriv_trc_gamma28; - break; - - case AVCOL_TRC_SMPTE240M: - func = avpriv_trc_smpte240M; - break; - - case AVCOL_TRC_LINEAR: - func = avpriv_trc_linear; - break; - - case AVCOL_TRC_LOG: - func = avpriv_trc_log; - break; - - case AVCOL_TRC_LOG_SQRT: - func = avpriv_trc_log_sqrt; - break; - - case AVCOL_TRC_IEC61966_2_4: - func = avpriv_trc_iec61966_2_4; - break; - - case AVCOL_TRC_BT1361_ECG: - func = avpriv_trc_bt1361; - break; - - case AVCOL_TRC_IEC61966_2_1: - func = avpriv_trc_iec61966_2_1; - break; - - case AVCOL_TRC_SMPTEST2084: - func = avpriv_trc_smpte_st2084; - break; - - case AVCOL_TRC_SMPTEST428_1: - func = avpriv_trc_smpte_st428_1; - break; - - case AVCOL_TRC_ARIB_STD_B67: - func = avpriv_trc_arib_std_b67; - break; - - case AVCOL_TRC_RESERVED0: - case AVCOL_TRC_UNSPECIFIED: - case AVCOL_TRC_RESERVED: - default: - break; - } - return func; -} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/color_utils.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2015 Kevin Wheatley - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General 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_COLOR_UTILS_H -#define AVUTIL_COLOR_UTILS_H - - -#include "libavutil/pixfmt.h" - -/** - * Determine a suitable 'gamma' value to match the supplied - * AVColorTransferCharacteristic. - * - * See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html) - * - * @return Will return an approximation to the simple gamma function matching - * the supplied Transfer Characteristic, Will return 0.0 for any - * we cannot reasonably match against. - */ -double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc); - - -typedef double (*avpriv_trc_function)(double); - -/** - * Determine the function needed to apply the given - * AVColorTransferCharacteristic to linear input. - * - * The function returned should expect a nominal domain and range of [0.0-1.0] - * values outside of this range maybe valid depending on the chosen - * characteristic function. - * - * @return Will return pointer to the function matching the - * supplied Transfer Characteristic. If unspecified will - * return NULL: - */ -avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc); - -#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.c 2023-03-03 13:29:59.000000000 +0000 @@ -62,6 +62,8 @@ return ff_get_cpu_flags_arm(); #elif ARCH_PPC return ff_get_cpu_flags_ppc(); +#elif ARCH_RISCV + return ff_get_cpu_flags_riscv(); #elif ARCH_X86 return ff_get_cpu_flags_x86(); #elif ARCH_LOONGARCH @@ -178,6 +180,15 @@ #elif ARCH_LOONGARCH { "lsx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_LSX }, .unit = "flags" }, { "lasx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_LASX }, .unit = "flags" }, +#elif ARCH_RISCV + { "rvi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVI }, .unit = "flags" }, + { "rvf", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVF }, .unit = "flags" }, + { "rvd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVD }, .unit = "flags" }, + { "rvv-i32", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I32 }, .unit = "flags" }, + { "rvv-f32", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" }, + { "rvv-i64", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I64 }, .unit = "flags" }, + { "rvv", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F64 }, .unit = "flags" }, + { "rvb-basic",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_BASIC }, .unit = "flags" }, #endif { NULL }, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu.h 2023-03-03 13:29:59.000000000 +0000 @@ -78,6 +78,16 @@ #define AV_CPU_FLAG_LSX (1 << 0) #define AV_CPU_FLAG_LASX (1 << 1) +// RISC-V extensions +#define AV_CPU_FLAG_RVI (1 << 0) ///< I (full GPR bank) +#define AV_CPU_FLAG_RVF (1 << 1) ///< F (single precision FP) +#define AV_CPU_FLAG_RVD (1 << 2) ///< D (double precision FP) +#define AV_CPU_FLAG_RVV_I32 (1 << 3) ///< Vectors of 8/16/32-bit int's */ +#define AV_CPU_FLAG_RVV_F32 (1 << 4) ///< Vectors of float's */ +#define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */ +#define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's +#define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations + /** * Return the flags which specify extensions supported by the CPU. * The returned value is affected by av_force_cpu_flags() if that was used diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/cpu_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -48,6 +48,7 @@ int ff_get_cpu_flags_aarch64(void); int ff_get_cpu_flags_arm(void); int ff_get_cpu_flags_ppc(void); +int ff_get_cpu_flags_riscv(void); int ff_get_cpu_flags_x86(void); int ff_get_cpu_flags_loongarch(void); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/crc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/crc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/crc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/crc.h 2023-03-03 13:29:59.000000000 +0000 @@ -84,7 +84,10 @@ /** * Calculate the CRC of a block. + * @param ctx initialized AVCRC array (see av_crc_init()) * @param crc CRC of previous blocks if any or initial value for CRC + * @param buffer buffer whose CRC to calculate + * @param length length of the buffer * @return CRC updated with the data from the given block * * @see av_crc_init() "le" parameter diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.c 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,8 @@ /* + * Copyright (c) 2015 Kevin Wheatley * Copyright (c) 2016 Ronald S. Bultje + * Copyright (c) 2023 Leo Izen + * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -21,9 +24,11 @@ * @file Colorspace functions for libavutil * @author Ronald S. Bultje * @author Leo Izen + * @author Kevin Wheatley */ #include +#include #include "attributes.h" #include "csp.h" @@ -126,3 +131,170 @@ return AVCOL_PRI_UNSPECIFIED; } + +static const double approximate_gamma[AVCOL_TRC_NB] = { + [AVCOL_TRC_BT709] = 1.961, + [AVCOL_TRC_SMPTE170M] = 1.961, + [AVCOL_TRC_SMPTE240M] = 1.961, + [AVCOL_TRC_BT1361_ECG] = 1.961, + [AVCOL_TRC_BT2020_10] = 1.961, + [AVCOL_TRC_BT2020_12] = 1.961, + [AVCOL_TRC_GAMMA22] = 2.2, + [AVCOL_TRC_IEC61966_2_1] = 2.2, + [AVCOL_TRC_GAMMA28] = 2.8, + [AVCOL_TRC_LINEAR] = 1.0, + [AVCOL_TRC_SMPTE428] = 2.6, +}; + +double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc) +{ + double gamma; + if (trc >= AVCOL_TRC_NB) + return 0.0; + gamma = approximate_gamma[trc]; + if (gamma > 0) + return gamma; + return 0.0; +} + +#define BT709_alpha 1.099296826809442 +#define BT709_beta 0.018053968510807 + +static double trc_bt709(double Lc) +{ + const double a = BT709_alpha; + const double b = BT709_beta; + + return (0.0 > Lc) ? 0.0 + : ( b > Lc) ? 4.500 * Lc + : a * pow(Lc, 0.45) - (a - 1.0); +} + +static double trc_gamma22(double Lc) +{ + return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2); +} + +static double trc_gamma28(double Lc) +{ + return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8); +} + +static double trc_smpte240M(double Lc) +{ + const double a = 1.1115; + const double b = 0.0228; + + return (0.0 > Lc) ? 0.0 + : ( b > Lc) ? 4.000 * Lc + : a * pow(Lc, 0.45) - (a - 1.0); +} + +static double trc_linear(double Lc) +{ + return Lc; +} + +static double trc_log(double Lc) +{ + return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0; +} + +static double trc_log_sqrt(double Lc) +{ + // sqrt(10) / 1000 + return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5; +} + +static double trc_iec61966_2_4(double Lc) +{ + const double a = BT709_alpha; + const double b = BT709_beta; + + return (-b >= Lc) ? -a * pow(-Lc, 0.45) + (a - 1.0) + : ( b > Lc) ? 4.500 * Lc + : a * pow( Lc, 0.45) - (a - 1.0); +} + +static double trc_bt1361(double Lc) +{ + const double a = BT709_alpha; + const double b = BT709_beta; + + return (-0.0045 >= Lc) ? -(a * pow(-4.0 * Lc, 0.45) + (a - 1.0)) / 4.0 + : ( b > Lc) ? 4.500 * Lc + : a * pow( Lc, 0.45) - (a - 1.0); +} + +static double trc_iec61966_2_1(double Lc) +{ + const double a = 1.055; + const double b = 0.0031308; + + return (0.0 > Lc) ? 0.0 + : ( b > Lc) ? 12.92 * Lc + : a * pow(Lc, 1.0 / 2.4) - (a - 1.0); +} + +static double trc_smpte_st2084(double Lc) +{ + const double c1 = 3424.0 / 4096.0; // c3-c2 + 1 + const double c2 = 32.0 * 2413.0 / 4096.0; + const double c3 = 32.0 * 2392.0 / 4096.0; + const double m = 128.0 * 2523.0 / 4096.0; + const double n = 0.25 * 2610.0 / 4096.0; + const double L = Lc / 10000.0; + const double Ln = pow(L, n); + + return (0.0 > Lc) ? 0.0 + : pow((c1 + c2 * Ln) / (1.0 + c3 * Ln), m); + +} + +static double trc_smpte_st428_1(double Lc) +{ + return (0.0 > Lc) ? 0.0 + : pow(48.0 * Lc / 52.37, 1.0 / 2.6); +} + + +static double trc_arib_std_b67(double Lc) { + // The function uses the definition from HEVC, which assumes that the peak + // white is input level = 1. (this is equivalent to scaling E = Lc * 12 and + // using the definition from the ARIB STD-B67 spec) + const double a = 0.17883277; + const double b = 0.28466892; + const double c = 0.55991073; + return (0.0 > Lc) ? 0.0 : + (Lc <= 1.0 / 12.0 ? sqrt(3.0 * Lc) : a * log(12.0 * Lc - b) + c); +} + +static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] = { + [AVCOL_TRC_BT709] = trc_bt709, + [AVCOL_TRC_GAMMA22] = trc_gamma22, + [AVCOL_TRC_GAMMA28] = trc_gamma28, + [AVCOL_TRC_SMPTE170M] = trc_bt709, + [AVCOL_TRC_SMPTE240M] = trc_smpte240M, + [AVCOL_TRC_LINEAR] = trc_linear, + [AVCOL_TRC_LOG] = trc_log, + [AVCOL_TRC_LOG_SQRT] = trc_log_sqrt, + [AVCOL_TRC_IEC61966_2_4] = trc_iec61966_2_4, + [AVCOL_TRC_BT1361_ECG] = trc_bt1361, + [AVCOL_TRC_IEC61966_2_1] = trc_iec61966_2_1, + [AVCOL_TRC_BT2020_10] = trc_bt709, + [AVCOL_TRC_BT2020_12] = trc_bt709, + [AVCOL_TRC_SMPTE2084] = trc_smpte_st2084, + [AVCOL_TRC_SMPTE428] = trc_smpte_st428_1, + [AVCOL_TRC_ARIB_STD_B67] = trc_arib_std_b67, +}; + +av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc) +{ + av_csp_trc_function func; + if (trc >= AVCOL_TRC_NB) + return NULL; + func = trc_funcs[trc]; + if (!func) + return NULL; + return func; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/csp.h 2023-03-03 13:29:59.000000000 +0000 @@ -1,5 +1,8 @@ /* + * Copyright (c) 2015 Kevin Wheatley * Copyright (c) 2016 Ronald S. Bultje + * Copyright (c) 2023 Leo Izen + * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -24,9 +27,15 @@ #include "rational.h" /** - * @file Colorspace value utility functions for libavutil. + * @file + * Colorspace value utility functions for libavutil. + * @ingroup lavu_math_csp * @author Ronald S. Bultje * @author Leo Izen + * @author Kevin Wheatley + */ + +/** * @defgroup lavu_math_csp Colorspace Utility * @ingroup lavu_math * @{ @@ -72,6 +81,12 @@ } AVColorPrimariesDesc; /** + * Function pointer representing a double -> double transfer function that performs + * an EOTF transfer inversion. This function outputs linear light. + */ +typedef double (*av_csp_trc_function)(double); + +/** * Retrieves the Luma coefficients necessary to construct a conversion matrix * from an enum constant describing the colorspace. * @param csp An enum constant indicating YUV or similar colorspace. @@ -100,6 +115,35 @@ enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm); /** + * Determine a suitable 'gamma' value to match the supplied + * AVColorTransferCharacteristic. + * + * See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html) + * + * This function returns the gamma exponent for the OETF. For example, sRGB is approximated + * by gamma 2.2, not by gamma 0.45455. + * + * @return Will return an approximation to the simple gamma function matching + * the supplied Transfer Characteristic, Will return 0.0 for any + * we cannot reasonably match against. + */ +double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc); + +/** + * Determine the function needed to apply the given + * AVColorTransferCharacteristic to linear input. + * + * The function returned should expect a nominal domain and range of [0.0-1.0] + * values outside of this range maybe valid depending on the chosen + * characteristic function. + * + * @return Will return pointer to the function matching the + * supplied Transfer Characteristic. If unspecified will + * return NULL: + */ +av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc); + +/** * @} */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/des.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/des.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/des.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/des.h 2023-03-03 13:29:59.000000000 +0000 @@ -43,6 +43,8 @@ /** * @brief Initializes an AVDES context. * + * @param d pointer to a AVDES structure to initialize + * @param key pointer to the key to use * @param key_bits must be 64 or 192 * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption * @return zero on success, negative value otherwise @@ -52,9 +54,10 @@ /** * @brief Encrypts / decrypts using the DES algorithm. * - * @param count number of 8 byte blocks + * @param d pointer to the AVDES structure * @param dst destination array, can be equal to src, must be 8-byte aligned * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + * @param count number of 8 byte blocks * @param iv initialization vector for CBC mode, if NULL then ECB will be used, * must be 8-byte aligned * @param decrypt 0 for encryption, 1 for decryption @@ -64,9 +67,10 @@ /** * @brief Calculates CBC-MAC using the DES algorithm. * - * @param count number of 8 byte blocks + * @param d pointer to the AVDES structure * @param dst destination array, can be equal to src, must be 8-byte aligned * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + * @param count number of 8 byte blocks */ void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/detection_bbox.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/detection_bbox.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/detection_bbox.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/detection_bbox.h 2023-03-03 13:29:59.000000000 +0000 @@ -93,6 +93,7 @@ * AVDetectionBBox, and initializes the variables. * Can be freed with a normal av_free() call. * + * @param nb_bboxes number of AVDetectionBBox structures to allocate * @param out_size if non-NULL, the size in bytes of the resulting data array is * written here. */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,8 +20,10 @@ #include +#include "avassert.h" #include "avstring.h" #include "dict.h" +#include "dict_internal.h" #include "internal.h" #include "mem.h" #include "time_internal.h" @@ -37,21 +39,35 @@ return m ? m->count : 0; } -AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, - const AVDictionaryEntry *prev, int flags) +const AVDictionaryEntry *av_dict_iterate(const AVDictionary *m, + const AVDictionaryEntry *prev) { - unsigned int i, j; + int i = 0; if (!m) return NULL; if (prev) i = prev - m->elems + 1; - else - i = 0; - for (; i < m->count; i++) { - const char *s = m->elems[i].key; + av_assert2(i >= 0); + if (i >= m->count) + return NULL; + + return &m->elems[i]; +} + +AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, + const AVDictionaryEntry *prev, int flags) +{ + const AVDictionaryEntry *entry = prev; + unsigned int j; + + if (!key) + return NULL; + + while ((entry = av_dict_iterate(m, entry))) { + const char *s = entry->key; if (flags & AV_DICT_MATCH_CASE) for (j = 0; s[j] == key[j] && key[j]; j++) ; @@ -62,7 +78,7 @@ continue; if (s[j] && !(flags & AV_DICT_IGNORE_SUFFIX)) continue; - return &m->elems[i]; + return (AVDictionaryEntry *)entry; } return NULL; } @@ -72,8 +88,17 @@ { AVDictionary *m = *pm; AVDictionaryEntry *tag = NULL; - char *oldval = NULL, *copy_key = NULL, *copy_value = NULL; + char *copy_key = NULL, *copy_value = NULL; + int err; + if (flags & AV_DICT_DONT_STRDUP_VAL) + copy_value = (void *)value; + else if (value) + copy_value = av_strdup(value); + if (!key) { + err = AVERROR(EINVAL); + goto err_out; + } if (!(flags & AV_DICT_MULTIKEY)) { tag = av_dict_get(m, key, NULL, flags); } @@ -81,14 +106,10 @@ copy_key = (void *)key; else copy_key = av_strdup(key); - if (flags & AV_DICT_DONT_STRDUP_VAL) - copy_value = (void *)value; - else if (copy_key) - copy_value = av_strdup(value); if (!m) m = *pm = av_mallocz(sizeof(*m)); - if (!m || (key && !copy_key) || (value && !copy_value)) - goto err_out; + if (!m || !copy_key || (value && !copy_value)) + goto enomem; if (tag) { if (flags & AV_DICT_DONT_OVERWRITE) { @@ -96,9 +117,17 @@ av_free(copy_value); return 0; } - if (flags & AV_DICT_APPEND) - oldval = tag->value; - else + if (copy_value && flags & AV_DICT_APPEND) { + size_t oldlen = strlen(tag->value); + size_t new_part_len = strlen(copy_value); + size_t len = oldlen + new_part_len + 1; + char *newval = av_realloc(tag->value, len); + if (!newval) + goto enomem; + memcpy(newval + oldlen, copy_value, new_part_len + 1); + av_freep(©_value); + copy_value = newval; + } else av_free(tag->value); av_free(tag->key); *tag = m->elems[--m->count]; @@ -106,34 +135,25 @@ AVDictionaryEntry *tmp = av_realloc_array(m->elems, m->count + 1, sizeof(*m->elems)); if (!tmp) - goto err_out; + goto enomem; m->elems = tmp; } if (copy_value) { m->elems[m->count].key = copy_key; m->elems[m->count].value = copy_value; - if (oldval && flags & AV_DICT_APPEND) { - size_t len = strlen(oldval) + strlen(copy_value) + 1; - char *newval = av_mallocz(len); - if (!newval) - goto err_out; - av_strlcat(newval, oldval, len); - av_freep(&oldval); - av_strlcat(newval, copy_value, len); - m->elems[m->count].value = newval; - av_freep(©_value); - } m->count++; } else { + if (!m->count) { + av_freep(&m->elems); + av_freep(pm); + } av_freep(©_key); } - if (!m->count) { - av_freep(&m->elems); - av_freep(pm); - } return 0; +enomem: + err = AVERROR(ENOMEM); err_out: if (m && !m->count) { av_freep(&m->elems); @@ -141,7 +161,7 @@ } av_free(copy_key); av_free(copy_value); - return AVERROR(ENOMEM); + return err; } int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, @@ -216,9 +236,9 @@ int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; - while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(src, t))) { int ret = av_dict_set(dst, t->key, t->value, flags); if (ret < 0) return ret; @@ -230,7 +250,7 @@ int av_dict_get_string(const AVDictionary *m, char **buffer, const char key_val_sep, const char pairs_sep) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVBPrint bprint; int cnt = 0; char special_chars[] = {pairs_sep, key_val_sep, '\0'}; @@ -245,7 +265,7 @@ } av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED); - while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(m, t))) { if (cnt++) av_bprint_append_data(&bprint, &pairs_sep, 1); av_bprint_escape(&bprint, t->key, special_chars, AV_ESCAPE_MODE_BACKSLASH, 0); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict.h 2023-03-03 13:29:59.000000000 +0000 @@ -39,13 +39,15 @@ * @brief Simple key:value store * * @{ - * Dictionaries are used for storing key:value pairs. To create - * an AVDictionary, simply pass an address of a NULL pointer to - * av_dict_set(). NULL can be used as an empty dictionary wherever - * a pointer to an AVDictionary is required. - * Use av_dict_get() to retrieve an entry or iterate over all - * entries and finally av_dict_free() to free the dictionary - * and all its contents. + * Dictionaries are used for storing key-value pairs. + * + * - To **create an AVDictionary**, simply pass an address of a NULL + * pointer to av_dict_set(). NULL can be used as an empty dictionary + * wherever a pointer to an AVDictionary is required. + * - To **insert an entry**, use av_dict_set(). + * - Use av_dict_get() to **retrieve an entry**. + * - To **iterate over all entries**, use av_dict_iterate(). + * - In order to **free the dictionary and all its contents**, use av_dict_free(). * @code AVDictionary *d = NULL; // "create" an empty dictionary @@ -57,13 +59,18 @@ char *v = av_strdup("value"); // you can avoid copying them like this av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); - while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { - <....> // iterate over all entries in d + while ((t = av_dict_iterate(d, t))) { + <....> // iterate over all entries in d } av_dict_free(&d); @endcode */ +/** + * @name AVDictionary Flags + * Flags that influence behavior of the matching of keys or insertion to the dictionary. + * @{ + */ #define AV_DICT_MATCH_CASE 1 /**< Only get an entry with exact-case key match. Only relevant in av_dict_get(). */ #define AV_DICT_IGNORE_SUFFIX 2 /**< Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string. Only relevant in av_dict_get(). */ @@ -71,10 +78,13 @@ allocated with av_malloc() or another memory allocation function. */ #define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been allocated with av_malloc() or another memory allocation function. */ -#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. +#define AV_DICT_DONT_OVERWRITE 16 /**< Don't overwrite existing entries. */ #define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. */ + delimiter is added, the strings are simply concatenated. */ #define AV_DICT_MULTIKEY 64 /**< Allow to store several equal keys in the dictionary */ +/** + * @} + */ typedef struct AVDictionaryEntry { char *key; @@ -89,19 +99,45 @@ * The returned entry key or value must not be changed, or it will * cause undefined behavior. * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. + * @param prev Set to the previous matching element to find the next. + * If set to NULL the first matching element is returned. + * @param key Matching key + * @param flags A collection of AV_DICT_* flags controlling how the + * entry is retrieved * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param key matching key - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary + * @return Found entry or NULL in case no matching entry was found in the dictionary */ AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); /** + * Iterate over a dictionary + * + * Iterates through all entries in the dictionary. + * + * @warning The returned AVDictionaryEntry key/value must not be changed. + * + * @warning As av_dict_set() invalidates all previous entries returned + * by this function, it must not be called while iterating over the dict. + * + * Typical usage: + * @code + * const AVDictionaryEntry *e = NULL; + * while ((e = av_dict_iterate(m, e))) { + * // ... + * } + * @endcode + * + * @param m The dictionary to iterate over + * @param prev Pointer to the previous AVDictionaryEntry, NULL initially + * + * @retval AVDictionaryEntry* The next element in the dictionary + * @retval NULL No more elements in the dictionary + */ +const AVDictionaryEntry *av_dict_iterate(const AVDictionary *m, + const AVDictionaryEntry *prev); + +/** * Get number of entries in dictionary. * * @param m dictionary @@ -115,23 +151,24 @@ * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, * these arguments will be freed on error. * - * Warning: Adding a new entry to a dictionary invalidates all existing entries - * previously returned with av_dict_get. + * @warning Adding a new entry to a dictionary invalidates all existing entries + * previously returned with av_dict_get() or av_dict_iterate(). * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) - * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 + * @param pm Pointer to a pointer to a dictionary struct. If *pm is NULL + * a dictionary struct is allocated and put in *pm. + * @param key Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) + * @param value Entry value to add to *pm (will be av_strduped or added as a new key depending on flags). + * Passing a NULL value will cause an existing entry to be deleted. + * + * @return >= 0 on success otherwise an error code <0 */ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); /** - * Convenience wrapper for av_dict_set that converts the value to a string + * Convenience wrapper for av_dict_set() that converts the value to a string * and stores it. * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. + * Note: If ::AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. */ int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags); @@ -141,14 +178,15 @@ * In case of failure, all the successfully set entries are stored in * *pm. You may need to manually free the created dictionary. * - * @param key_val_sep a 0-terminated list of characters used to separate + * @param key_val_sep A 0-terminated list of characters used to separate * key from value - * @param pairs_sep a 0-terminated list of characters used to separate + * @param pairs_sep A 0-terminated list of characters used to separate * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL + * @param flags Flags to use when adding to the dictionary. + * ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL * are ignored since the key/value tokens will always * be duplicated. + * * @return 0 on success, negative AVERROR code on failure */ int av_dict_parse_string(AVDictionary **pm, const char *str, @@ -157,11 +195,14 @@ /** * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag + * + * @note Metadata is read using the ::AV_DICT_IGNORE_SUFFIX flag + * + * @param dst Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL, + * this function will allocate a struct for you and put it in *dst + * @param src Pointer to the source AVDictionary struct to copy items from. + * @param flags Flags to use when setting entries in *dst + * * @return 0 on success, negative AVERROR code on failure. If dst was allocated * by this function, callers should free the associated memory. */ @@ -180,13 +221,15 @@ * Such string may be passed back to av_dict_parse_string(). * @note String is escaped with backslashes ('\'). * - * @param[in] m dictionary + * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. + * + * @param[in] m The dictionary * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other + * @param[in] key_val_sep Character used to separate key from value + * @param[in] pairs_sep Character used to separate two pairs from each other + * * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. */ int av_dict_get_string(const AVDictionary *m, char **buffer, const char key_val_sep, const char pairs_sep); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict_internal.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/dict_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_DICT_INTERNAL_H +#define AVUTIL_DICT_INTERNAL_H + +#include + +#include "dict.h" + +/** + * Set a dictionary value to an ISO-8601 compliant timestamp string. + * + * @param dict pointer to a pointer to a dictionary struct. If *dict is NULL + * a dictionary struct is allocated and put in *dict. + * @param key metadata key + * @param timestamp unix timestamp in microseconds + * @return <0 on error + */ +int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp); + +#endif /* AVUTIL_DICT_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/display.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/display.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/display.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/display.h 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_display * Display matrix */ @@ -29,15 +30,9 @@ #include /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_display Display transformation matrix functions - * @{ - */ - -/** - * @addtogroup lavu_video_display + * @ingroup lavu_video + * * The display transformation matrix specifies an affine transformation that * should be applied to video frames for correct presentation. It is compatible * with the matrices stored in the ISO/IEC 14496-12 container format. @@ -71,6 +66,8 @@ * q' = (b * p + d * q + y) / z; * z = u * p + v * q + w * @endcode + * + * @{ */ /** @@ -90,8 +87,8 @@ * Initialize a transformation matrix describing a pure clockwise * rotation by the specified angle (in degrees). * - * @param matrix an allocated transformation matrix (will be fully overwritten - * by this function) + * @param[out] matrix a transformation matrix (will be fully overwritten + * by this function) * @param angle rotation angle in degrees. */ void av_display_rotation_set(int32_t matrix[9], double angle); @@ -99,7 +96,7 @@ /** * Flip the input matrix horizontally and/or vertically. * - * @param matrix an allocated transformation matrix + * @param[in,out] matrix a transformation matrix * @param hflip whether the matrix should be flipped horizontally * @param vflip whether the matrix should be flipped vertically */ @@ -107,7 +104,6 @@ /** * @} - * @} */ #endif /* AVUTIL_DISPLAY_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/eval.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/eval.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/eval.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/eval.h 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,7 @@ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @param log_offset log level offset, can be used to silence error messages * @param log_ctx parent logging context * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code otherwise @@ -65,6 +66,7 @@ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param log_offset log level offset, can be used to silence error messages * @param log_ctx parent logging context * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code otherwise @@ -78,6 +80,7 @@ /** * Evaluate a previously parsed expression. * + * @param e the AVExpr to evaluate * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 * @return the value of the expression @@ -87,6 +90,7 @@ /** * Track the presence of variables and their number of occurrences in a parsed expression * + * @param e the AVExpr to track variables in * @param counter a zero-initialized array where the count of each variable will be stored * @param size size of array * @return 0 on success, a negative value indicates that no expression or array was passed @@ -98,6 +102,7 @@ * Track the presence of user provided functions and their number of occurrences * in a parsed expression. * + * @param e the AVExpr to track user provided functions in * @param counter a zero-initialized array where the count of each function will be stored * if you passed 5 functions with 2 arguments to av_expr_parse() * then for arg=2 this will use upto 5 entries. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fifo.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fifo.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fifo.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fifo.h 2023-03-03 13:29:59.000000000 +0000 @@ -18,7 +18,8 @@ /** * @file - * a very simple circular buffer FIFO implementation + * @ingroup lavu_fifo + * A generic FIFO API */ #ifndef AVUTIL_FIFO_H @@ -30,6 +31,14 @@ #include "attributes.h" #include "version.h" +/** + * @defgroup lavu_fifo AVFifo + * @ingroup lavu_data + * + * @{ + * A generic FIFO API + */ + typedef struct AVFifo AVFifo; /** @@ -88,7 +97,13 @@ size_t av_fifo_can_read(const AVFifo *f); /** - * @return number of elements that can be written into the given FIFO. + * @return Number of elements that can be written into the given FIFO without + * growing it. + * + * In other words, this number of elements or less is guaranteed to fit + * into the FIFO. More data may be written when the + * AV_FIFO_FLAG_AUTO_GROW flag was specified at FIFO creation, but this + * may involve memory allocation, which can fail. */ size_t av_fifo_can_write(const AVFifo *f); @@ -109,9 +124,12 @@ /** * Write data into a FIFO. * - * In case nb_elems > av_fifo_can_write(f), nothing is written and an error + * In case nb_elems > av_fifo_can_write(f) and the AV_FIFO_FLAG_AUTO_GROW flag + * was not specified at FIFO creation, nothing is written and an error * is returned. * + * Calling function is guaranteed to succeed if nb_elems <= av_fifo_can_write(f). + * * @param f the FIFO buffer * @param buf Data to be written. nb_elems * av_fifo_elem_size(f) bytes will be * read from buf on success. @@ -423,4 +441,8 @@ #endif #endif +/** + * @} + */ + #endif /* AVUTIL_FIFO_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,6 +18,7 @@ #include "config.h" #include "file.h" +#include "file_open.h" #include "internal.h" #include "log.h" #include "mem.h" @@ -154,6 +155,8 @@ #endif } +#if FF_API_AV_FOPEN_UTF8 int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx) { return avpriv_tempfile(prefix, filename, log_offset, log_ctx); } +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file.h 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,7 @@ #include #include +#include "version.h" #include "attributes.h" /** @@ -38,6 +39,9 @@ * case *bufptr will be set to NULL and *size will be set to 0. * The returned buffer must be released with av_file_unmap(). * + * @param filename path to the file + * @param[out] bufptr pointee is set to the mapped or allocated buffer + * @param[out] size pointee is set to the size in bytes of the buffer * @param log_offset loglevel offset used for logging * @param log_ctx context used for logging * @return a non negative number in case of success, a negative value @@ -50,11 +54,13 @@ /** * Unmap or free the buffer bufptr created by av_file_map(). * + * @param bufptr the buffer previously created with av_file_map() * @param size size in bytes of bufptr, must be the same as returned * by av_file_map() */ void av_file_unmap(uint8_t *bufptr, size_t size); +#if FF_API_AV_FOPEN_UTF8 /** * Wrapper to work around the lack of mkstemp() on mingw. * Also, tries to create file in /tmp first, if possible. @@ -67,6 +73,8 @@ * libraries and could interfere with the calling application. * @deprecated as fd numbers cannot be passed saftely between libs on some platforms */ +attribute_deprecated int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); +#endif #endif /* AVUTIL_FILE_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.c 2023-03-03 13:29:59.000000000 +0000 @@ -17,7 +17,8 @@ */ #include "config.h" -#include "internal.h" +#include "avutil.h" +#include "file_open.h" #include "mem.h" #include #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/file_open.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_FILE_OPEN_H +#define AVUTIL_FILE_OPEN_H + +#include + +#include "config.h" +#include "attributes.h" + +#if HAVE_LIBC_MSVCRT +#define avpriv_fopen_utf8 ff_fopen_utf8 +#define avpriv_open ff_open +#define avpriv_tempfile ff_tempfile +#endif + + /** + * A wrapper for open() setting O_CLOEXEC. + */ +av_warn_unused_result +int avpriv_open(const char *filename, int flags, ...); + +/** + * Open a file using a UTF-8 filename. + */ +FILE *avpriv_fopen_utf8(const char *path, const char *mode); + +/** + * Wrapper to work around the lack of mkstemp() on mingw. + * Also, tries to create file in /tmp first, if possible. + * *prefix can be a character constant; *filename will be allocated internally. + * @return file descriptor of opened file (or negative value corresponding to an + * AVERROR code on error) + * and opened file name in **filename. + * @note On very old libcs it is necessary to set a secure umask before + * calling this, av_tempfile() can't call umask itself as it is used in + * libraries and could interfere with the calling application. + */ +int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); + +#endif /* AVUTIL_FILE_OPEN_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -135,7 +135,7 @@ return (int)(p >> 31); } -static void butterflies_fixed_c(int *v1s, int *v2, int len) +static void butterflies_fixed_c(int *av_restrict v1s, int *av_restrict v2, int len) { int i; unsigned int *v1 = v1s; @@ -162,7 +162,9 @@ fdsp->butterflies_fixed = butterflies_fixed_c; fdsp->scalarproduct_fixed = scalarproduct_fixed_c; -#if ARCH_X86 +#if ARCH_RISCV + ff_fixed_dsp_init_riscv(fdsp); +#elif ARCH_X86 ff_fixed_dsp_init_x86(fdsp); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/fixed_dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -161,6 +161,7 @@ */ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int strict); +void ff_fixed_dsp_init_riscv(AVFixedDSPContext *fdsp); void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp); /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/float2half.h" + +void ff_init_float2half_tables(Float2HalfTables *t) +{ +#if !HAVE_FAST_FLOAT16 + for (int i = 0; i < 256; i++) { + int e = i - 127; + + if (e < -24) { // Very small numbers map to zero + t->basetable[i|0x000] = 0x0000; + t->basetable[i|0x100] = 0x8000; + t->shifttable[i|0x000] = 24; + t->shifttable[i|0x100] = 24; + } else if (e < -14) { // Small numbers map to denorms + t->basetable[i|0x000] = (0x0400>>(-e-14)); + t->basetable[i|0x100] = (0x0400>>(-e-14)) | 0x8000; + t->shifttable[i|0x000] = -e-1; + t->shifttable[i|0x100] = -e-1; + } else if (e <= 15) { // Normal numbers just lose precision + t->basetable[i|0x000] = ((e + 15) << 10); + t->basetable[i|0x100] = ((e + 15) << 10) | 0x8000; + t->shifttable[i|0x000] = 13; + t->shifttable[i|0x100] = 13; + } else if (e < 128) { // Large numbers map to Infinity + t->basetable[i|0x000] = 0x7C00; + t->basetable[i|0x100] = 0xFC00; + t->shifttable[i|0x000] = 24; + t->shifttable[i|0x100] = 24; + } else { // Infinity and NaN's stay Infinity and NaN's + t->basetable[i|0x000] = 0x7C00; + t->basetable[i|0x100] = 0xFC00; + t->shifttable[i|0x000] = 13; + t->shifttable[i|0x100] = 13; + } + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float2half.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_FLOAT2HALF_H +#define AVUTIL_FLOAT2HALF_H + +#include +#include "intfloat.h" + +#include "config.h" + +typedef struct Float2HalfTables { +#if HAVE_FAST_FLOAT16 + uint8_t dummy; +#else + uint16_t basetable[512]; + uint8_t shifttable[512]; +#endif +} Float2HalfTables; + +void ff_init_float2half_tables(Float2HalfTables *t); + +static inline uint16_t float2half(uint32_t f, const Float2HalfTables *t) +{ +#if HAVE_FAST_FLOAT16 + union { + _Float16 f; + uint16_t i; + } u; + u.f = av_int2float(f); + return u.i; +#else + uint16_t h; + + h = t->basetable[(f >> 23) & 0x1ff] + ((f & 0x007fffff) >> t->shifttable[(f >> 23) & 0x1ff]); + + return h; +#endif +} + +#endif /* AVUTIL_FLOAT2HALF_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -156,6 +156,8 @@ ff_float_dsp_init_arm(fdsp); #elif ARCH_PPC ff_float_dsp_init_ppc(fdsp, bit_exact); +#elif ARCH_RISCV + ff_float_dsp_init_riscv(fdsp); #elif ARCH_X86 ff_float_dsp_init_x86(fdsp); #elif ARCH_MIPS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/float_dsp.h 2023-03-03 13:29:59.000000000 +0000 @@ -205,6 +205,7 @@ void ff_float_dsp_init_aarch64(AVFloatDSPContext *fdsp); void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp); void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict); +void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp); void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp); void ff_float_dsp_init_mips(AVFloatDSPContext *fdsp); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,23 +35,6 @@ av_get_channel_layout_nb_channels((frame)->channel_layout)) #endif -#if FF_API_COLORSPACE_NAME -const char *av_get_colorspace_name(enum AVColorSpace val) -{ - static const char * const name[] = { - [AVCOL_SPC_RGB] = "GBR", - [AVCOL_SPC_BT709] = "bt709", - [AVCOL_SPC_FCC] = "fcc", - [AVCOL_SPC_BT470BG] = "bt470bg", - [AVCOL_SPC_SMPTE170M] = "smpte170m", - [AVCOL_SPC_SMPTE240M] = "smpte240m", - [AVCOL_SPC_YCOCG] = "YCgCo", - }; - if ((unsigned)val >= FF_ARRAY_ELEMS(name)) - return NULL; - return name[val]; -} -#endif static void get_frame_defaults(AVFrame *frame) { memset(frame, 0, sizeof(*frame)); @@ -59,7 +42,12 @@ frame->pts = frame->pkt_dts = AV_NOPTS_VALUE; frame->best_effort_timestamp = AV_NOPTS_VALUE; + frame->duration = 0; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_duration = 0; +FF_ENABLE_DEPRECATION_WARNINGS +#endif frame->pkt_pos = -1; frame->pkt_size = -1; frame->time_base = (AVRational){ 0, 1 }; @@ -283,6 +271,7 @@ dst->crop_left = src->crop_left; dst->crop_right = src->crop_right; dst->pts = src->pts; + dst->duration = src->duration; dst->repeat_pict = src->repeat_pict; dst->interlaced_frame = src->interlaced_frame; dst->top_field_first = src->top_field_first; @@ -292,13 +281,25 @@ dst->pkt_dts = src->pkt_dts; dst->pkt_pos = src->pkt_pos; dst->pkt_size = src->pkt_size; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS dst->pkt_duration = src->pkt_duration; +FF_ENABLE_DEPRECATION_WARNINGS +#endif dst->time_base = src->time_base; +#if FF_API_REORDERED_OPAQUE +FF_DISABLE_DEPRECATION_WARNINGS dst->reordered_opaque = src->reordered_opaque; +FF_ENABLE_DEPRECATION_WARNINGS +#endif dst->quality = src->quality; dst->best_effort_timestamp = src->best_effort_timestamp; +#if FF_API_FRAME_PICTURE_NUMBER +FF_DISABLE_DEPRECATION_WARNINGS dst->coded_picture_number = src->coded_picture_number; dst->display_picture_number = src->display_picture_number; +FF_ENABLE_DEPRECATION_WARNINGS +#endif dst->flags = src->flags; dst->decode_error_flags = src->decode_error_flags; dst->color_primaries = src->color_primaries; @@ -542,9 +543,6 @@ AVFrame tmp; int ret; - if (!frame->buf[0]) - return AVERROR(EINVAL); - if (av_frame_is_writable(frame)) return 0; @@ -824,6 +822,7 @@ case AV_FRAME_DATA_DETECTION_BBOXES: return "Bounding boxes for object detection and classification"; case AV_FRAME_DATA_DOVI_RPU_BUFFER: return "Dolby Vision RPU Data"; case AV_FRAME_DATA_DOVI_METADATA: return "Dolby Vision Metadata"; + case AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT: return "Ambient viewing environment"; } return NULL; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/frame.h 2023-03-03 13:29:59.000000000 +0000 @@ -209,6 +209,11 @@ * volume transform - CUVA 005.1-2021. */ AV_FRAME_DATA_DYNAMIC_HDR_VIVID, + + /** + * Ambient viewing environment metadata, as defined by H.274. + */ + AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, }; enum AVActiveFormatDescription { @@ -446,14 +451,18 @@ */ AVRational time_base; +#if FF_API_FRAME_PICTURE_NUMBER /** * picture number in bitstream order */ + attribute_deprecated int coded_picture_number; /** * picture number in display order */ + attribute_deprecated int display_picture_number; +#endif /** * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) @@ -486,6 +495,7 @@ */ int palette_has_changed; +#if FF_API_REORDERED_OPAQUE /** * reordered opaque 64 bits (generally an integer or a double precision float * PTS but can be anything). @@ -493,8 +503,12 @@ * that time, * the decoder reorders values as needed and sets AVFrame.reordered_opaque * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque + * + * @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead */ + attribute_deprecated int64_t reordered_opaque; +#endif /** * Sample rate of the audio data. @@ -604,13 +618,18 @@ */ int64_t pkt_pos; +#if FF_API_PKT_DURATION /** * duration of the corresponding packet, expressed in * AVStream->time_base units, 0 if unknown. * - encoding: unused * - decoding: Read by user. + * + * @deprecated use duration instead */ + attribute_deprecated int64_t pkt_duration; +#endif /** * metadata. @@ -702,18 +721,14 @@ * Channel layout of the audio data. */ AVChannelLayout ch_layout; + + /** + * Duration of the frame, in the same units as pts. 0 if unknown. + */ + int64_t duration; } AVFrame; -#if FF_API_COLORSPACE_NAME -/** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - * @deprecated use av_color_space_name() - */ -attribute_deprecated -const char *av_get_colorspace_name(enum AVColorSpace val); -#endif /** * Allocate an AVFrame and set its fields to default values. The resulting * struct must be freed using av_frame_free(). @@ -818,7 +833,8 @@ * Ensure that the frame data is writable, avoiding data copy if possible. * * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. + * if it is not. Non-refcounted frames behave as non-writable, i.e. a copy + * is always made. * * @return 0 on success, a negative AVERROR on error. * @@ -853,6 +869,7 @@ /** * Get the buffer reference a given data plane is stored in. * + * @param frame the frame to get the plane's buffer from * @param plane index of the data plane of interest in frame->extended_data. * * @return the buffer reference that contains the plane or NULL if the input diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/half2float.h" + +#if !HAVE_FAST_FLOAT16 +static uint32_t convertmantissa(uint32_t i) +{ + int32_t m = i << 13; // Zero pad mantissa bits + int32_t e = 0; // Zero exponent + + while (!(m & 0x00800000)) { // While not normalized + e -= 0x00800000; // Decrement exponent (1<<23) + m <<= 1; // Shift mantissa + } + + m &= ~0x00800000; // Clear leading 1 bit + e += 0x38800000; // Adjust bias ((127-14)<<23) + + return m | e; // Return combined number +} +#endif + +void ff_init_half2float_tables(Half2FloatTables *t) +{ +#if !HAVE_FAST_FLOAT16 + t->mantissatable[0] = 0; + for (int i = 1; i < 1024; i++) + t->mantissatable[i] = convertmantissa(i); + for (int i = 1024; i < 2048; i++) + t->mantissatable[i] = 0x38000000UL + ((i - 1024) << 13UL); + for (int i = 2048; i < 3072; i++) + t->mantissatable[i] = t->mantissatable[i - 1024] | 0x400000UL; + t->mantissatable[2048] = t->mantissatable[1024]; + + t->exponenttable[0] = 0; + for (int i = 1; i < 31; i++) + t->exponenttable[i] = i << 23; + for (int i = 33; i < 63; i++) + t->exponenttable[i] = 0x80000000UL + ((i - 32) << 23UL); + t->exponenttable[31]= 0x47800000UL; + t->exponenttable[32]= 0x80000000UL; + t->exponenttable[63]= 0xC7800000UL; + + t->offsettable[0] = 0; + for (int i = 1; i < 64; i++) + t->offsettable[i] = 1024; + t->offsettable[31] = 2048; + t->offsettable[32] = 0; + t->offsettable[63] = 2048; +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/half2float.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HALF2FLOAT_H +#define AVUTIL_HALF2FLOAT_H + +#include +#include "intfloat.h" + +#include "config.h" + +typedef struct Half2FloatTables { +#if HAVE_FAST_FLOAT16 + uint8_t dummy; +#else + uint32_t mantissatable[3072]; + uint32_t exponenttable[64]; + uint16_t offsettable[64]; +#endif +} Half2FloatTables; + +void ff_init_half2float_tables(Half2FloatTables *t); + +static inline uint32_t half2float(uint16_t h, const Half2FloatTables *t) +{ +#if HAVE_FAST_FLOAT16 + union { + _Float16 f; + uint16_t i; + } u; + u.i = h; + return av_float2int(u.f); +#else + uint32_t f; + + f = t->mantissatable[t->offsettable[h >> 10] + (h & 0x3ff)] + t->exponenttable[h >> 10]; + + return f; +#endif +} + +#endif /* AVUTIL_HALF2FLOAT_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.c 2023-03-03 13:29:59.000000000 +0000 @@ -397,10 +397,14 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags) { - AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data; + AVHWFramesContext *ctx; AVFrame *frame_tmp; int ret = 0; + if (!src->hw_frames_ctx) + return AVERROR(EINVAL); + ctx = (AVHWFramesContext*)src->hw_frames_ctx->data; + frame_tmp = av_frame_alloc(); if (!frame_tmp) return AVERROR(ENOMEM); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_cuda.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_cuda.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_cuda.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_cuda.c 2023-03-03 13:29:59.000000000 +0000 @@ -438,6 +438,9 @@ AVCUDADeviceContext *hwctx = device_ctx->hwctx; CudaFunctions *cu; const char *src_uuid = NULL; +#if CONFIG_VULKAN + VkPhysicalDeviceIDProperties vk_idp; +#endif int ret, i, device_count; ret = cuda_flags_from_opts(device_ctx, opts, &flags); @@ -445,7 +448,7 @@ goto error; #if CONFIG_VULKAN - VkPhysicalDeviceIDProperties vk_idp = { + vk_idp = (VkPhysicalDeviceIDProperties) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, }; #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_d3d11va.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_d3d11va.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_d3d11va.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_d3d11va.c 2023-03-03 13:29:59.000000000 +0000 @@ -86,6 +86,9 @@ } supported_formats[] = { { DXGI_FORMAT_NV12, AV_PIX_FMT_NV12 }, { DXGI_FORMAT_P010, AV_PIX_FMT_P010 }, + { DXGI_FORMAT_B8G8R8A8_UNORM, AV_PIX_FMT_BGRA }, + { DXGI_FORMAT_R10G10B10A2_UNORM, AV_PIX_FMT_X2BGR10 }, + { DXGI_FORMAT_R16G16B16A16_FLOAT, AV_PIX_FMT_RGBAF16 }, // Special opaque formats. The pix_fmt is merely a place holder, as the // opaque format cannot be accessed directly. { DXGI_FORMAT_420_OPAQUE, AV_PIX_FMT_YUV420P }, @@ -287,6 +290,10 @@ av_log(ctx, AV_LOG_ERROR, "User-provided texture has mismatching parameters\n"); return AVERROR(EINVAL); } + + ctx->initial_pool_size = texDesc2.ArraySize; + hwctx->BindFlags = texDesc2.BindFlags; + hwctx->MiscFlags = texDesc2.MiscFlags; } else if (!(texDesc.BindFlags & D3D11_BIND_RENDER_TARGET) && texDesc.ArraySize > 0) { hr = ID3D11Device_CreateTexture2D(device_hwctx->device, &texDesc, NULL, &hwctx->texture); if (FAILED(hr)) { @@ -408,6 +415,7 @@ D3D11_TEXTURE2D_DESC desc; D3D11_MAPPED_SUBRESOURCE map; HRESULT hr; + int res; if (frame->hw_frames_ctx->data != (uint8_t *)ctx || other->format != ctx->sw_format) return AVERROR(EINVAL); @@ -416,7 +424,7 @@ if (!s->staging_texture) { ID3D11Texture2D_GetDesc((ID3D11Texture2D *)texture, &desc); - int res = d3d11va_create_staging_texture(ctx, desc.Format); + res = d3d11va_create_staging_texture(ctx, desc.Format); if (res < 0) return res; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext.h 2023-03-03 13:29:59.000000000 +0000 @@ -249,7 +249,7 @@ /** * Iterate over supported device types. * - * @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type + * @param prev AV_HWDEVICE_TYPE_NONE initially, then the previous type * returned by this function in subsequent iterations. * @return The next usable device type from enum AVHWDeviceType, or * AV_HWDEVICE_TYPE_NONE if there are no more. @@ -591,6 +591,7 @@ * * @param derived_frame_ctx On success, a reference to the newly created * AVHWFramesContext. + * @param format The AVPixelFormat for the derived context. * @param derived_device_ctx A reference to the device to create the new * AVHWFramesContext on. * @param source_frame_ctx A reference to an existing AVHWFramesContext diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,30 +18,101 @@ #include "config.h" +#include +#include +#include + #include "buffer.h" #include "common.h" #include "hwcontext.h" #include "hwcontext_internal.h" #include "hwcontext_mediacodec.h" +typedef struct MediaCodecDeviceContext { + AVMediaCodecDeviceContext ctx; + + void *libmedia; + media_status_t (*create_surface)(ANativeWindow **surface); +} MediaCodecDeviceContext; + + static int mc_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) { + const AVDictionaryEntry *entry = NULL; + MediaCodecDeviceContext *s = ctx->hwctx; + AVMediaCodecDeviceContext *dev = &s->ctx; + if (device && device[0]) { av_log(ctx, AV_LOG_ERROR, "Device selection unsupported.\n"); return AVERROR_UNKNOWN; } + while ((entry = av_dict_iterate(opts, entry))) { + if (!strcmp(entry->key, "create_window")) + dev->create_window = atoi(entry->value); + } + + av_log(ctx, AV_LOG_DEBUG, "%s createPersistentInputSurface\n", + dev->create_window ? "Enable" : "Disable"); + return 0; } +static int mc_device_init(AVHWDeviceContext *ctx) +{ + MediaCodecDeviceContext *s = ctx->hwctx; + AVMediaCodecDeviceContext *dev = (AVMediaCodecDeviceContext *)s; + ANativeWindow *native_window = NULL; + + if (dev->surface) + return 0; + + if (dev->native_window) + return 0; + + // For backward compatibility, don't return error for a dummy + // AVHWDeviceContext without surface or native_window. + if (!dev->create_window) + return 0; + + s->libmedia = dlopen("libmediandk.so", RTLD_NOW); + if (!s->libmedia) + return AVERROR_UNKNOWN; + + s->create_surface = dlsym(s->libmedia, "AMediaCodec_createPersistentInputSurface"); + if (!s->create_surface) + return AVERROR_UNKNOWN; + + s->create_surface(&native_window); + dev->native_window = native_window; + return 0; +} + +static void mc_device_uninit(AVHWDeviceContext *ctx) +{ + MediaCodecDeviceContext *s = ctx->hwctx; + AVMediaCodecDeviceContext *dev = ctx->hwctx; + if (!s->libmedia) + return; + + if (dev->native_window) { + ANativeWindow_release(dev->native_window); + dev->native_window = NULL; + } + dlclose(s->libmedia); + s->libmedia = NULL; +} + const HWContextType ff_hwcontext_type_mediacodec = { .type = AV_HWDEVICE_TYPE_MEDIACODEC, .name = "mediacodec", - .device_hwctx_size = sizeof(AVMediaCodecDeviceContext), + .device_hwctx_size = sizeof(MediaCodecDeviceContext), .device_create = mc_device_create, + .device_init = mc_device_init, + .device_uninit = mc_device_uninit, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MEDIACODEC, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_mediacodec.h 2023-03-03 13:29:59.000000000 +0000 @@ -31,6 +31,31 @@ * This is the default surface used by decoders on this device. */ void *surface; + + /** + * Pointer to ANativeWindow. + * + * It both surface and native_window is NULL, try to create it + * automatically if create_window is true and OS support + * createPersistentInputSurface. + * + * It can be used as output surface for decoder and input surface for + * encoder. + */ + void *native_window; + + /** + * Enable createPersistentInputSurface automatically. + * + * Disabled by default. + * + * It can be enabled by setting this flag directly, or by setting + * AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key. + * The second method is useful for ffmpeg cmdline, e.g., we can enable it + * via: + * -init_hw_device mediacodec=mediacodec,create_window=1 + */ + int create_window; } AVMediaCodecDeviceContext; #endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_opencl.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_opencl.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_opencl.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_opencl.c 2023-03-03 13:29:59.000000000 +0000 @@ -47,7 +47,7 @@ #if HAVE_OPENCL_VAAPI_INTEL_MEDIA #if CONFIG_LIBMFX -#include +#include #endif #include #include diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,7 @@ #include #include -#include +#include #include "config.h" @@ -49,12 +49,21 @@ #include "pixdesc.h" #include "time.h" #include "imgutils.h" +#include "avassert.h" #define QSV_VERSION_ATLEAST(MAJOR, MINOR) \ (MFX_VERSION_MAJOR > (MAJOR) || \ MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR)) #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) +#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) +#define QSV_HAVE_OPAQUE !QSV_ONEVPL + +#if QSV_ONEVPL +#include +#else +#define MFXUnload(a) do { } while(0) +#endif typedef struct QSVDevicePriv { AVBufferRef *child_device_ctx; @@ -86,11 +95,13 @@ // used in the frame allocator for non-opaque surfaces mfxMemId *mem_ids; +#if QSV_HAVE_OPAQUE // used in the opaque alloc request for opaque surfaces mfxFrameSurface1 **surface_ptrs; mfxExtOpaqueSurfaceAlloc opaque_alloc; mfxExtBuffer *ext_buffers[1]; +#endif AVFrame realigned_upload_frame; AVFrame realigned_download_frame; } QSVFramesContext; @@ -98,16 +109,41 @@ static const struct { enum AVPixelFormat pix_fmt; uint32_t fourcc; + uint16_t mfx_shift; } supported_pixel_formats[] = { - { AV_PIX_FMT_NV12, MFX_FOURCC_NV12 }, - { AV_PIX_FMT_BGRA, MFX_FOURCC_RGB4 }, - { AV_PIX_FMT_P010, MFX_FOURCC_P010 }, - { AV_PIX_FMT_PAL8, MFX_FOURCC_P8 }, + { AV_PIX_FMT_NV12, MFX_FOURCC_NV12, 0 }, + { AV_PIX_FMT_BGRA, MFX_FOURCC_RGB4, 0 }, + { AV_PIX_FMT_P010, MFX_FOURCC_P010, 1 }, + { AV_PIX_FMT_PAL8, MFX_FOURCC_P8, 0 }, #if CONFIG_VAAPI { AV_PIX_FMT_YUYV422, - MFX_FOURCC_YUY2 }, + MFX_FOURCC_YUY2, 0 }, + { AV_PIX_FMT_UYVY422, + MFX_FOURCC_UYVY, 0 }, { AV_PIX_FMT_Y210, - MFX_FOURCC_Y210 }, + MFX_FOURCC_Y210, 1 }, + // VUYX is used for VAAPI child device, + // the SDK only delares support for AYUV + { AV_PIX_FMT_VUYX, + MFX_FOURCC_AYUV, 0 }, + // XV30 is used for VAAPI child device, + // the SDK only delares support for Y410 + { AV_PIX_FMT_XV30, + MFX_FOURCC_Y410, 0 }, +#if QSV_VERSION_ATLEAST(1, 31) + // P012 is used for VAAPI child device, + // the SDK only delares support for P016 + { AV_PIX_FMT_P012, + MFX_FOURCC_P016, 1 }, + // Y212 is used for VAAPI child device, + // the SDK only delares support for Y216 + { AV_PIX_FMT_Y212, + MFX_FOURCC_Y216, 1 }, + // XV36 is used for VAAPI child device, + // the SDK only delares support for Y416 + { AV_PIX_FMT_XV36, + MFX_FOURCC_Y416, 1 }, +#endif #endif }; @@ -155,6 +191,16 @@ return 0; } +static uint16_t qsv_shift_from_pix_fmt(enum AVPixelFormat pix_fmt) +{ + for (int i = 0; i < FF_ARRAY_ELEMS(supported_pixel_formats); i++) { + if (supported_pixel_formats[i].pix_fmt == pix_fmt) + return supported_pixel_formats[i].mfx_shift; + } + + return 0; +} + #if CONFIG_D3D11VA static uint32_t qsv_get_d3d11va_bind_flags(int mem_type) { @@ -299,7 +345,9 @@ #endif av_freep(&s->mem_ids); +#if QSV_HAVE_OPAQUE av_freep(&s->surface_ptrs); +#endif av_freep(&s->surfaces_internal); av_freep(&s->handle_pairs_internal); av_frame_unref(&s->realigned_upload_frame); @@ -486,7 +534,7 @@ surf->Info.BitDepthLuma = desc->comp[0].depth; surf->Info.BitDepthChroma = desc->comp[0].depth; - surf->Info.Shift = desc->comp[0].depth > 8; + surf->Info.Shift = qsv_shift_from_pix_fmt(ctx->sw_format); if (desc->log2_chroma_w && desc->log2_chroma_h) surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420; @@ -535,11 +583,17 @@ return ret; } +#if QSV_HAVE_OPAQUE if (!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME)) { ret = qsv_init_child_ctx(ctx); if (ret < 0) return ret; } +#else + ret = qsv_init_child_ctx(ctx); + if (ret < 0) + return ret; +#endif ctx->internal->pool_internal = av_buffer_pool_init2(sizeof(mfxFrameSurface1), ctx, qsv_pool_alloc, NULL); @@ -607,13 +661,443 @@ return MFX_ERR_NONE; } +#if QSV_ONEVPL + +static int qsv_d3d11_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) +{ +#if CONFIG_D3D11VA + mfxStatus sts; + IDXGIAdapter *pDXGIAdapter; + DXGI_ADAPTER_DESC adapterDesc; + IDXGIDevice *pDXGIDevice = NULL; + HRESULT hr; + ID3D11Device *device = handle; + mfxVariant impl_value; + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void**)&pDXGIDevice); + if (SUCCEEDED(hr)) { + hr = IDXGIDevice_GetAdapter(pDXGIDevice, &pDXGIAdapter); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error IDXGIDevice_GetAdapter %d\n", hr); + goto fail; + } + + hr = IDXGIAdapter_GetDesc(pDXGIAdapter, &adapterDesc); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error IDXGIAdapter_GetDesc %d\n", hr); + goto fail; + } + } else { + av_log(ctx, AV_LOG_ERROR, "Error ID3D11Device_QueryInterface %d\n", hr); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U16; + impl_value.Data.U16 = adapterDesc.DeviceId; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.DeviceID", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "DeviceID property: %d.\n", sts); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_PTR; + impl_value.Data.Ptr = &adapterDesc.AdapterLuid; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.DeviceLUID", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "DeviceLUID property: %d.\n", sts); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + impl_value.Data.U32 = 0x0001; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.LUIDDeviceNodeMask", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "LUIDDeviceNodeMask property: %d.\n", sts); + goto fail; + } + + return 0; + +fail: +#endif + return AVERROR_UNKNOWN; +} + +static int qsv_d3d9_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) +{ + int ret = AVERROR_UNKNOWN; +#if CONFIG_DXVA2 + mfxStatus sts; + IDirect3DDeviceManager9* devmgr = handle; + IDirect3DDevice9Ex *device = NULL; + HANDLE device_handle = 0; + IDirect3D9Ex *d3d9ex = NULL; + LUID luid; + D3DDEVICE_CREATION_PARAMETERS params; + HRESULT hr; + mfxVariant impl_value; + + hr = IDirect3DDeviceManager9_OpenDeviceHandle(devmgr, &device_handle); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error OpenDeviceHandle %d\n", hr); + goto fail; + } + + hr = IDirect3DDeviceManager9_LockDevice(devmgr, device_handle, &device, TRUE); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error LockDevice %d\n", hr); + goto fail; + } + + hr = IDirect3DDevice9Ex_GetCreationParameters(device, ¶ms); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9_GetCreationParameters %d\n", hr); + goto unlock; + } + + hr = IDirect3DDevice9Ex_GetDirect3D(device, &d3d9ex); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetAdapterLUID %d\n", hr); + goto unlock; + } + + hr = IDirect3D9Ex_GetAdapterLUID(d3d9ex, params.AdapterOrdinal, &luid); + if (FAILED(hr)) { + av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetAdapterLUID %d\n", hr); + goto unlock; + } + + impl_value.Type = MFX_VARIANT_TYPE_PTR; + impl_value.Data.Ptr = &luid; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.DeviceLUID", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "DeviceLUID property: %d.\n", sts); + goto unlock; + } + + ret = 0; + +unlock: + IDirect3DDeviceManager9_UnlockDevice(devmgr, device_handle, FALSE); +fail: +#endif + return ret; +} + +static int qsv_va_update_config(void *ctx, mfxHDL handle, mfxConfig cfg) +{ +#if CONFIG_VAAPI +#if VA_CHECK_VERSION(1, 15, 0) + mfxStatus sts; + VADisplay dpy = handle; + VAStatus vas; + VADisplayAttribute attr = { + .type = VADisplayPCIID, + }; + mfxVariant impl_value; + + vas = vaGetDisplayAttributes(dpy, &attr, 1); + if (vas == VA_STATUS_SUCCESS && attr.flags != VA_DISPLAY_ATTRIB_NOT_SUPPORTED) { + impl_value.Type = MFX_VARIANT_TYPE_U16; + impl_value.Data.U16 = (attr.value & 0xFFFF); + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.DeviceID", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "DeviceID property: %d.\n", sts); + goto fail; + } + } else { + av_log(ctx, AV_LOG_ERROR, "libva: Failed to get device id from the driver. Please " + "consider to upgrade the driver to support VA-API 1.15.0\n"); + goto fail; + } + + return 0; + +fail: +#else + av_log(ctx, AV_LOG_ERROR, "libva: This version of libva doesn't support retrieving " + "the device information from the driver. Please consider to upgrade libva to " + "support VA-API 1.15.0\n"); +#endif +#endif + return AVERROR_UNKNOWN; +} + +static int qsv_new_mfx_loader(void *ctx, + mfxHDL handle, + mfxHandleType handle_type, + mfxIMPL implementation, + mfxVersion *pver, + void **ploader) +{ + mfxStatus sts; + mfxLoader loader = NULL; + mfxConfig cfg; + mfxVariant impl_value; + + *ploader = NULL; + loader = MFXLoad(); + if (!loader) { + av_log(ctx, AV_LOG_ERROR, "Error creating a MFX loader\n"); + goto fail; + } + + /* Create configurations for implementation */ + cfg = MFXCreateConfig(loader); + if (!cfg) { + av_log(ctx, AV_LOG_ERROR, "Error creating a MFX configuration\n"); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + impl_value.Data.U32 = (implementation == MFX_IMPL_SOFTWARE) ? + MFX_IMPL_TYPE_SOFTWARE : MFX_IMPL_TYPE_HARDWARE; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxImplDescription.Impl", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration " + "property: %d.\n", sts); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + impl_value.Data.U32 = pver->Version; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxImplDescription.ApiVersion.Version", + impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration " + "property: %d.\n", sts); + goto fail; + } + + impl_value.Type = MFX_VARIANT_TYPE_U16; + impl_value.Data.U16 = 0x8086; // Intel device only + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxExtendedDeviceId.VendorID", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "VendorID property: %d.\n", sts); + goto fail; + } + + if (MFX_HANDLE_VA_DISPLAY == handle_type) { + if (handle && qsv_va_update_config(ctx, handle, cfg)) + goto fail; + + impl_value.Data.U32 = MFX_ACCEL_MODE_VIA_VAAPI; + } else if (MFX_HANDLE_D3D9_DEVICE_MANAGER == handle_type) { + if (handle && qsv_d3d9_update_config(ctx, handle, cfg)) + goto fail; + + impl_value.Data.U32 = MFX_ACCEL_MODE_VIA_D3D9; + } else { + if (handle && qsv_d3d11_update_config(ctx, handle, cfg)) + goto fail; + + impl_value.Data.U32 = MFX_ACCEL_MODE_VIA_D3D11; + } + + impl_value.Type = MFX_VARIANT_TYPE_U32; + sts = MFXSetConfigFilterProperty(cfg, + (const mfxU8 *)"mfxImplDescription.AccelerationMode", impl_value); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration" + "AccelerationMode property: %d.\n", sts); + goto fail; + } + + *ploader = loader; + + return 0; + +fail: + if (loader) + MFXUnload(loader); + + return AVERROR_UNKNOWN; +} + +static int qsv_create_mfx_session_from_loader(void *ctx, mfxLoader loader, mfxSession *psession) +{ + mfxStatus sts; + mfxSession session = NULL; + uint32_t impl_idx = 0; + mfxVersion ver; + + while (1) { + /* Enumerate all implementations */ + mfxImplDescription *impl_desc; + + sts = MFXEnumImplementations(loader, impl_idx, + MFX_IMPLCAPS_IMPLDESCSTRUCTURE, + (mfxHDL *)&impl_desc); + /* Failed to find an available implementation */ + if (sts == MFX_ERR_NOT_FOUND) + break; + else if (sts != MFX_ERR_NONE) { + impl_idx++; + continue; + } + + sts = MFXCreateSession(loader, impl_idx, &session); + MFXDispReleaseImplDescription(loader, impl_desc); + if (sts == MFX_ERR_NONE) + break; + + impl_idx++; + } + + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error creating a MFX session: %d.\n", sts); + goto fail; + } + + sts = MFXQueryVersion(session, &ver); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error querying a MFX session: %d.\n", sts); + goto fail; + } + + av_log(ctx, AV_LOG_VERBOSE, "Initialize MFX session: implementation " + "version is %d.%d\n", ver.Major, ver.Minor); + + *psession = session; + + return 0; + +fail: + if (session) + MFXClose(session); + + return AVERROR_UNKNOWN; +} + +static int qsv_create_mfx_session(void *ctx, + mfxHDL handle, + mfxHandleType handle_type, + mfxIMPL implementation, + mfxVersion *pver, + mfxSession *psession, + void **ploader) +{ + mfxLoader loader = NULL; + + av_log(ctx, AV_LOG_VERBOSE, + "Use Intel(R) oneVPL to create MFX session, API version is " + "%d.%d, the required implementation version is %d.%d\n", + MFX_VERSION_MAJOR, MFX_VERSION_MINOR, pver->Major, pver->Minor); + + if (handle_type != MFX_HANDLE_VA_DISPLAY && + handle_type != MFX_HANDLE_D3D9_DEVICE_MANAGER && + handle_type != MFX_HANDLE_D3D11_DEVICE) { + av_log(ctx, AV_LOG_ERROR, + "Invalid MFX device handle type\n"); + return AVERROR(EXDEV); + } + + *psession = NULL; + + if (!*ploader) { + if (qsv_new_mfx_loader(ctx, handle, handle_type, implementation, pver, (void **)&loader)) + goto fail; + + av_assert0(loader); + } else + loader = *ploader; // Use the input mfxLoader to create mfx session + + if (qsv_create_mfx_session_from_loader(ctx, loader, psession)) + goto fail; + + if (!*ploader) + *ploader = loader; + + return 0; + +fail: + if (!*ploader && loader) + MFXUnload(loader); + + return AVERROR_UNKNOWN; +} + +#else + +static int qsv_create_mfx_session(void *ctx, + mfxHDL handle, + mfxHandleType handle_type, + mfxIMPL implementation, + mfxVersion *pver, + mfxSession *psession, + void **ploader) +{ + mfxVersion ver; + mfxStatus sts; + mfxSession session = NULL; + + av_log(ctx, AV_LOG_VERBOSE, + "Use Intel(R) Media SDK to create MFX session, API version is " + "%d.%d, the required implementation version is %d.%d\n", + MFX_VERSION_MAJOR, MFX_VERSION_MINOR, pver->Major, pver->Minor); + + *ploader = NULL; + *psession = NULL; + ver = *pver; + sts = MFXInit(implementation, &ver, &session); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error initializing an MFX session: " + "%d.\n", sts); + goto fail; + } + + sts = MFXQueryVersion(session, &ver); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error querying an MFX session: " + "%d.\n", sts); + goto fail; + } + + av_log(ctx, AV_LOG_VERBOSE, "Initialize MFX session: implementation " + "version is %d.%d\n", ver.Major, ver.Minor); + + MFXClose(session); + + sts = MFXInit(implementation, &ver, &session); + if (sts != MFX_ERR_NONE) { + av_log(ctx, AV_LOG_ERROR, "Error initializing an MFX session: " + "%d.\n", sts); + goto fail; + } + + *psession = session; + + return 0; + +fail: + if (session) + MFXClose(session); + + return AVERROR_UNKNOWN; +} + +#endif + static int qsv_init_internal_session(AVHWFramesContext *ctx, mfxSession *session, int upload) { - QSVFramesContext *s = ctx->internal->priv; AVQSVFramesContext *frames_hwctx = ctx->hwctx; QSVDeviceContext *device_priv = ctx->device_ctx->internal->priv; - int opaque = !!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); + int opaque = 0; mfxFrameAllocator frame_allocator = { .pthis = ctx, @@ -626,37 +1110,52 @@ mfxVideoParam par; mfxStatus err; + int ret = AVERROR_UNKNOWN; + AVQSVDeviceContext *hwctx = ctx->device_ctx->hwctx; + /* hwctx->loader is non-NULL for oneVPL user and NULL for non-oneVPL user */ + void **loader = &hwctx->loader; - err = MFXInit(device_priv->impl, &device_priv->ver, session); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error initializing an internal session\n"); - return AVERROR_UNKNOWN; - } +#if QSV_HAVE_OPAQUE + QSVFramesContext *s = ctx->internal->priv; + opaque = !!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); +#endif + + ret = qsv_create_mfx_session(ctx, device_priv->handle, device_priv->handle_type, + device_priv->impl, &device_priv->ver, session, loader); + if (ret) + goto fail; if (device_priv->handle) { err = MFXVideoCORE_SetHandle(*session, device_priv->handle_type, device_priv->handle); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; + if (err != MFX_ERR_NONE) { + ret = AVERROR_UNKNOWN; + goto fail; + } } if (!opaque) { err = MFXVideoCORE_SetFrameAllocator(*session, &frame_allocator); - if (err != MFX_ERR_NONE) - return AVERROR_UNKNOWN; + if (err != MFX_ERR_NONE) { + ret = AVERROR_UNKNOWN; + goto fail; + } } memset(&par, 0, sizeof(par)); - if (opaque) { + if (!opaque) { + par.IOPattern = upload ? MFX_IOPATTERN_OUT_VIDEO_MEMORY : + MFX_IOPATTERN_IN_VIDEO_MEMORY; + } +#if QSV_HAVE_OPAQUE + else { par.ExtParam = s->ext_buffers; par.NumExtParam = FF_ARRAY_ELEMS(s->ext_buffers); par.IOPattern = upload ? MFX_IOPATTERN_OUT_OPAQUE_MEMORY : MFX_IOPATTERN_IN_OPAQUE_MEMORY; - } else { - par.IOPattern = upload ? MFX_IOPATTERN_OUT_VIDEO_MEMORY : - MFX_IOPATTERN_IN_VIDEO_MEMORY; } +#endif par.IOPattern |= upload ? MFX_IOPATTERN_IN_SYSTEM_MEMORY : MFX_IOPATTERN_OUT_SYSTEM_MEMORY; @@ -676,11 +1175,20 @@ if (err != MFX_ERR_NONE) { av_log(ctx, AV_LOG_VERBOSE, "Error opening the internal VPP session." "Surface upload/download will not be possible\n"); - MFXClose(*session); - *session = NULL; + + ret = AVERROR_UNKNOWN; + goto fail; } return 0; + +fail: + if (*session) + MFXClose(*session); + + *session = NULL; + + return ret; } static int qsv_frames_init(AVHWFramesContext *ctx) @@ -688,11 +1196,15 @@ QSVFramesContext *s = ctx->internal->priv; AVQSVFramesContext *frames_hwctx = ctx->hwctx; - int opaque = !!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); + int opaque = 0; uint32_t fourcc; int i, ret; +#if QSV_HAVE_OPAQUE + opaque = !!(frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME); +#endif + fourcc = qsv_fourcc_from_pix_fmt(ctx->sw_format); if (!fourcc) { av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format\n"); @@ -707,7 +1219,16 @@ } } - if (opaque) { + if (!opaque) { + s->mem_ids = av_calloc(frames_hwctx->nb_surfaces, sizeof(*s->mem_ids)); + if (!s->mem_ids) + return AVERROR(ENOMEM); + + for (i = 0; i < frames_hwctx->nb_surfaces; i++) + s->mem_ids[i] = frames_hwctx->surfaces[i].Data.MemId; + } +#if QSV_HAVE_OPAQUE + else { s->surface_ptrs = av_calloc(frames_hwctx->nb_surfaces, sizeof(*s->surface_ptrs)); if (!s->surface_ptrs) @@ -726,14 +1247,8 @@ s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc); s->ext_buffers[0] = (mfxExtBuffer*)&s->opaque_alloc; - } else { - s->mem_ids = av_calloc(frames_hwctx->nb_surfaces, sizeof(*s->mem_ids)); - if (!s->mem_ids) - return AVERROR(ENOMEM); - - for (i = 0; i < frames_hwctx->nb_surfaces; i++) - s->mem_ids[i] = frames_hwctx->surfaces[i].Data.MemId; } +#endif s->session_download = NULL; s->session_upload = NULL; @@ -994,6 +1509,7 @@ switch (frame->format) { case AV_PIX_FMT_NV12: case AV_PIX_FMT_P010: + case AV_PIX_FMT_P012: surface->Data.Y = frame->data[0]; surface->Data.UV = frame->data[1]; break; @@ -1018,10 +1534,35 @@ break; case AV_PIX_FMT_Y210: + case AV_PIX_FMT_Y212: surface->Data.Y16 = (mfxU16 *)frame->data[0]; surface->Data.U16 = (mfxU16 *)frame->data[0] + 1; surface->Data.V16 = (mfxU16 *)frame->data[0] + 3; break; + case AV_PIX_FMT_VUYX: + surface->Data.V = frame->data[0]; + surface->Data.U = frame->data[0] + 1; + surface->Data.Y = frame->data[0] + 2; + // Only set Data.A to a valid address, the SDK doesn't + // use the value from the frame. + surface->Data.A = frame->data[0] + 3; + break; + case AV_PIX_FMT_XV30: + surface->Data.U = frame->data[0]; + break; + case AV_PIX_FMT_XV36: + surface->Data.U = frame->data[0]; + surface->Data.Y = frame->data[0] + 2; + surface->Data.V = frame->data[0] + 4; + // Only set Data.A to a valid address, the SDK doesn't + // use the value from the frame. + surface->Data.A = frame->data[0] + 6; + break; + case AV_PIX_FMT_UYVY422: + surface->Data.Y = frame->data[0] + 1; + surface->Data.U = frame->data[0]; + surface->Data.V = frame->data[0] + 2; + break; #endif default: return MFX_ERR_UNSUPPORTED; @@ -1430,6 +1971,8 @@ if (hwctx->session) MFXClose(hwctx->session); + if (hwctx->loader) + MFXUnload(hwctx->loader); av_buffer_unref(&priv->child_device_ctx); av_freep(&priv); } @@ -1519,34 +2062,10 @@ goto fail; } - err = MFXInit(implementation, &ver, &hwctx->session); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error initializing an MFX session: " - "%d.\n", err); - ret = AVERROR_UNKNOWN; - goto fail; - } - - err = MFXQueryVersion(hwctx->session, &ver); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error querying an MFX session: %d.\n", err); - ret = AVERROR_UNKNOWN; - goto fail; - } - - av_log(ctx, AV_LOG_VERBOSE, - "Initialize MFX session: API version is %d.%d, implementation version is %d.%d\n", - MFX_VERSION_MAJOR, MFX_VERSION_MINOR, ver.Major, ver.Minor); - - MFXClose(hwctx->session); - - err = MFXInit(implementation, &ver, &hwctx->session); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, - "Error initializing an MFX session: %d.\n", err); - ret = AVERROR_UNKNOWN; + ret = qsv_create_mfx_session(ctx, handle, handle_type, implementation, &ver, + &hwctx->session, &hwctx->loader); + if (ret) goto fail; - } err = MFXVideoCORE_SetHandle(hwctx->session, handle_type, handle); if (err != MFX_ERR_NONE) { @@ -1561,6 +2080,12 @@ fail: if (hwctx->session) MFXClose(hwctx->session); + + if (hwctx->loader) + MFXUnload(hwctx->loader); + + hwctx->session = NULL; + hwctx->loader = NULL; return ret; } @@ -1603,6 +2128,16 @@ } } else if (CONFIG_VAAPI) { child_device_type = AV_HWDEVICE_TYPE_VAAPI; +#if QSV_ONEVPL + } else if (CONFIG_D3D11VA) { // Use D3D11 by default if d3d11va is enabled + av_log(ctx, AV_LOG_VERBOSE, + "Defaulting child_device_type to AV_HWDEVICE_TYPE_D3D11VA for oneVPL." + "Please explicitly set child device type via \"-init_hw_device\" " + "option if needed.\n"); + child_device_type = AV_HWDEVICE_TYPE_D3D11VA; + } else if (CONFIG_DXVA2) { + child_device_type = AV_HWDEVICE_TYPE_DXVA2; +#else } else if (CONFIG_DXVA2) { av_log(NULL, AV_LOG_WARNING, "WARNING: defaulting child_device_type to AV_HWDEVICE_TYPE_DXVA2 for compatibility " @@ -1611,6 +2146,7 @@ child_device_type = AV_HWDEVICE_TYPE_DXVA2; } else if (CONFIG_D3D11VA) { child_device_type = AV_HWDEVICE_TYPE_D3D11VA; +#endif } else { av_log(ctx, AV_LOG_ERROR, "No supported child device type is enabled\n"); return AVERROR(ENOSYS); @@ -1637,6 +2173,13 @@ #endif #if CONFIG_DXVA2 case AV_HWDEVICE_TYPE_DXVA2: +#if QSV_ONEVPL + { + av_log(ctx, AV_LOG_VERBOSE, + "d3d11va is not available or child device type is set to dxva2 " + "explicitly for oneVPL.\n"); + } +#endif break; #endif default: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_qsv.h 2023-03-03 13:29:59.000000000 +0000 @@ -19,7 +19,7 @@ #ifndef AVUTIL_HWCONTEXT_QSV_H #define AVUTIL_HWCONTEXT_QSV_H -#include +#include /** * @file @@ -34,6 +34,17 @@ */ typedef struct AVQSVDeviceContext { mfxSession session; + /** + * The mfxLoader handle used for mfxSession creation + * + * This field is only available for oneVPL user. For non-oneVPL user, this + * field must be set to NULL. + * + * Filled by the user before calling av_hwdevice_ctx_init() and should be + * cast to mfxLoader handle. Deallocating the AVHWDeviceContext will always + * release this interface. + */ + void *loader; } AVQSVDeviceContext; /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vaapi.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vaapi.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vaapi.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vaapi.c 2023-03-03 13:29:59.000000000 +0000 @@ -122,13 +122,22 @@ #ifdef VA_FOURCC_Y210 MAP(Y210, YUV422_10, Y210, 0), #endif +#ifdef VA_FOURCC_Y212 + MAP(Y212, YUV422_12, Y212, 0), +#endif MAP(411P, YUV411, YUV411P, 0), MAP(422V, YUV422, YUV440P, 0), MAP(444P, YUV444, YUV444P, 0), +#ifdef VA_FOURCC_XYUV + MAP(XYUV, YUV444, VUYX, 0), +#endif MAP(Y800, YUV400, GRAY8, 0), #ifdef VA_FOURCC_P010 MAP(P010, YUV420_10BPP, P010, 0), #endif +#ifdef VA_FOURCC_P012 + MAP(P012, YUV420_12, P012, 0), +#endif MAP(BGRA, RGB32, BGRA, 0), MAP(BGRX, RGB32, BGR0, 0), MAP(RGBA, RGB32, RGBA, 0), @@ -142,6 +151,16 @@ #ifdef VA_FOURCC_X2R10G10B10 MAP(X2R10G10B10, RGB32_10, X2RGB10, 0), #endif +#ifdef VA_FOURCC_Y410 + // libva doesn't include a fourcc for XV30 and the driver only declares + // support for Y410, so we must fudge the mapping here. + MAP(Y410, YUV444_10, XV30, 0), +#endif +#ifdef VA_FOURCC_Y412 + // libva doesn't include a fourcc for XV36 and the driver only declares + // support for Y412, so we must fudge the mapping here. + MAP(Y412, YUV444_12, XV36, 0), +#endif }; #undef MAP @@ -998,6 +1017,9 @@ #if defined(VA_FOURCC_P010) && defined(DRM_FORMAT_R16) DRM_MAP(P010, 2, DRM_FORMAT_R16, DRM_FORMAT_RG1616), #endif +#if defined(VA_FOURCC_P012) && defined(DRM_FORMAT_R16) + DRM_MAP(P012, 2, DRM_FORMAT_R16, DRM_FORMAT_RG1616), +#endif DRM_MAP(BGRA, 1, DRM_FORMAT_ARGB8888), DRM_MAP(BGRX, 1, DRM_FORMAT_XRGB8888), DRM_MAP(RGBA, 1, DRM_FORMAT_ABGR8888), @@ -1008,6 +1030,15 @@ #endif DRM_MAP(ARGB, 1, DRM_FORMAT_BGRA8888), DRM_MAP(XRGB, 1, DRM_FORMAT_BGRX8888), +#if defined(VA_FOURCC_XYUV) && defined(DRM_FORMAT_XYUV8888) + DRM_MAP(XYUV, 1, DRM_FORMAT_XYUV8888), +#endif +#if defined(VA_FOURCC_Y412) && defined(DRM_FORMAT_XVYU2101010) + DRM_MAP(Y410, 1, DRM_FORMAT_XVYU2101010), +#endif +#if defined(VA_FOURCC_Y412) && defined(DRM_FORMAT_XVYU12_16161616) + DRM_MAP(Y412, 1, DRM_FORMAT_XVYU12_16161616), +#endif }; #undef DRM_MAP @@ -1480,7 +1511,7 @@ goto fail_derived; } - av_log(hwfc, AV_LOG_DEBUG, "DRM PRIME fd is %ld.\n", + av_log(hwfc, AV_LOG_DEBUG, "DRM PRIME fd is %"PRIdPTR".\n", mapping->buffer_info.handle); mapping->drm_desc.nb_objects = 1; @@ -1669,6 +1700,7 @@ char path[64]; int n, max_devices = 8; #if CONFIG_LIBDRM + drmVersion *info; const AVDictionaryEntry *kernel_driver; kernel_driver = av_dict_get(opts, "kernel_driver", NULL, 0); #endif @@ -1682,9 +1714,15 @@ break; } #if CONFIG_LIBDRM + info = drmGetVersion(priv->drm_fd); + if (!info) { + av_log(ctx, AV_LOG_VERBOSE, + "Failed to get DRM version for device %d.\n", n); + close(priv->drm_fd); + priv->drm_fd = -1; + continue; + } if (kernel_driver) { - drmVersion *info; - info = drmGetVersion(priv->drm_fd); if (strcmp(kernel_driver->value, info->name)) { av_log(ctx, AV_LOG_VERBOSE, "Ignoring device %d " "with non-matching kernel driver (%s).\n", @@ -1699,12 +1737,20 @@ "with matching kernel driver (%s).\n", n, info->name); drmFreeVersion(info); - } else -#endif - { - av_log(ctx, AV_LOG_VERBOSE, "Trying to use " - "DRM render node for device %d.\n", n); + break; + // drmGetVersion() ensures |info->name| is 0-terminated. + } else if (!strcmp(info->name, "vgem")) { + av_log(ctx, AV_LOG_VERBOSE, + "Skipping vgem node for device %d.\n", n); + drmFreeVersion(info); + close(priv->drm_fd); + priv->drm_fd = -1; + continue; } + drmFreeVersion(info); +#endif + av_log(ctx, AV_LOG_VERBOSE, "Trying to use " + "DRM render node for device %d.\n", n); break; } if (n >= max_devices) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.c 2023-03-03 13:29:59.000000000 +0000 @@ -44,7 +44,7 @@ } cv_pix_fmts[] = { { kCVPixelFormatType_420YpCbCr8Planar, false, AV_PIX_FMT_YUV420P }, { kCVPixelFormatType_422YpCbCr8, false, AV_PIX_FMT_UYVY422 }, - { kCVPixelFormatType_32BGRA, false, AV_PIX_FMT_BGRA }, + { kCVPixelFormatType_32BGRA, true, AV_PIX_FMT_BGRA }, #ifdef kCFCoreFoundationVersionNumber10_7 { kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, false, AV_PIX_FMT_NV12 }, { kCVPixelFormatType_420YpCbCr8BiPlanarFullRange, true, AV_PIX_FMT_NV12 }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_videotoolbox.h 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ #include +#include "frame.h" #include "pixfmt.h" /** diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vulkan.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vulkan.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vulkan.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/hwcontext_vulkan.c 2023-03-03 13:29:59.000000000 +0000 @@ -173,6 +173,7 @@ { AV_PIX_FMT_NV12, { VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM } }, { AV_PIX_FMT_NV21, { VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM } }, { AV_PIX_FMT_P010, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM } }, + { AV_PIX_FMT_P012, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM } }, { AV_PIX_FMT_P016, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16G16_UNORM } }, { AV_PIX_FMT_NV16, { VK_FORMAT_R8_UNORM, VK_FORMAT_R8G8_UNORM } }, @@ -210,6 +211,9 @@ { AV_PIX_FMT_YUVA444P12, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM } }, { AV_PIX_FMT_YUVA444P16, { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM } }, + { AV_PIX_FMT_VUYX, { VK_FORMAT_R8G8B8A8_UNORM } }, + { AV_PIX_FMT_XV36, { VK_FORMAT_R16G16B16A16_UNORM } }, + { AV_PIX_FMT_BGRA, { VK_FORMAT_B8G8R8A8_UNORM } }, { AV_PIX_FMT_RGBA, { VK_FORMAT_R8G8B8A8_UNORM } }, { AV_PIX_FMT_RGB24, { VK_FORMAT_R8G8B8_UNORM } }, @@ -354,14 +358,6 @@ { 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 }, #endif - - /* Video encoding/decoding */ - { VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, - { VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, - { VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, - { VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, - { VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, - { VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, }; /* Converts return values to strings */ @@ -2629,6 +2625,15 @@ { DRM_FORMAT_XRGB8888, VK_FORMAT_B8G8R8A8_UNORM }, { DRM_FORMAT_ABGR8888, VK_FORMAT_R8G8B8A8_UNORM }, { DRM_FORMAT_XBGR8888, VK_FORMAT_R8G8B8A8_UNORM }, + + // All these DRM_FORMATs were added in the same libdrm commit. +#ifdef DRM_FORMAT_XYUV8888 + { DRM_FORMAT_XYUV8888, VK_FORMAT_R8G8B8A8_UNORM }, + { DRM_FORMAT_XVYU12_16161616, VK_FORMAT_R16G16B16A16_UNORM} , + // As we had to map XV36 to a 16bit Vulkan format, reverse mapping will + // end up yielding Y416 as the DRM format, so we need to recognise it. + { DRM_FORMAT_Y416, VK_FORMAT_R16G16B16A16_UNORM }, +#endif }; static inline VkFormat drm_to_vulkan_fmt(uint32_t drm_fourcc) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/imgutils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/imgutils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/imgutils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/imgutils.h 2023-03-03 13:29:59.000000000 +0000 @@ -48,6 +48,7 @@ * component in the plane with the max pixel step. * @param max_pixstep_comps an array which is filled with the component * for each plane which has the max pixel step. May be NULL. + * @param pixdesc the AVPixFmtDescriptor for the image, describing its format */ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc); @@ -65,6 +66,8 @@ * width width. * * @param linesizes array to be filled with the linesize for each plane + * @param pix_fmt the AVPixelFormat of the image + * @param width width of the image in pixels * @return >= 0 in case of success, a negative error code otherwise */ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width); @@ -73,6 +76,8 @@ * Fill plane sizes for an image with pixel format pix_fmt and height height. * * @param size the array to be filled with the size of each image plane + * @param pix_fmt the AVPixelFormat of the image + * @param height height of the image in pixels * @param linesizes the array containing the linesize for each * plane, should be filled by av_image_fill_linesizes() * @return >= 0 in case of success, a negative error code otherwise @@ -88,6 +93,8 @@ * height height. * * @param data pointers array to be filled with the pointer for each image plane + * @param pix_fmt the AVPixelFormat of the image + * @param height height of the image in pixels * @param ptr the pointer to a buffer which will contain the image * @param linesizes the array containing the linesize for each * plane, should be filled by av_image_fill_linesizes() @@ -103,6 +110,11 @@ * The allocated image buffer has to be freed by using * av_freep(&pointers[0]). * + * @param pointers array to be filled with the pointer for each image plane + * @param linesizes the array filled with the linesize for each plane + * @param w width of the image in pixels + * @param h height of the image in pixels + * @param pix_fmt the AVPixelFormat of the image * @param align the value to use for buffer size alignment * @return the size in bytes required for the image buffer, a negative * error code in case of failure @@ -119,8 +131,11 @@ * bytewidth must be contained by both absolute values of dst_linesize * and src_linesize, otherwise the function behavior is undefined. * + * @param dst destination plane to copy to * @param dst_linesize linesize for the image plane in dst + * @param src source plane to copy from * @param src_linesize linesize for the image plane in src + * @param height height (number of lines) of the plane */ void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, @@ -147,8 +162,13 @@ /** * Copy image in src_data to dst_data. * + * @param dst_data destination image data buffer to copy to * @param dst_linesizes linesizes for the image in dst_data + * @param src_data source image data buffer to copy from * @param src_linesizes linesizes for the image in src_data + * @param pix_fmt the AVPixelFormat of the image + * @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], diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/integer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/integer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/integer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/integer.c 2023-03-03 13:29:59.000000000 +0000 @@ -103,8 +103,8 @@ for(i=0; i>4); unsigned int v=0; - if(index+1> (s&15); } return out; @@ -158,11 +158,9 @@ } int64_t av_i2int(AVInteger a){ - int i; - int64_t out=(int8_t)a.v[AV_INTEGER_SIZE-1]; + uint64_t out = a.v[3]; - for(i= AV_INTEGER_SIZE-2; i>=0; i--){ - out = (out<<16) + a.v[i]; - } + for (int i = 2; i >= 0; i--) + out = (out << 16) | a.v[i]; return out; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -41,7 +41,6 @@ #include "config.h" #include "attributes.h" #include "timer.h" -#include "dict.h" #include "macros.h" #include "pixfmt.h" @@ -108,8 +107,7 @@ /** * Return NULL if CONFIG_SMALL is true, otherwise the argument - * without modification. Used to disable the definition of strings - * (for example AVCodec long_names). + * without modification. Used to disable the definition of strings. */ #if CONFIG_SMALL # define NULL_IF_CONFIG_SMALL(x) NULL @@ -118,45 +116,6 @@ #endif /** - * Define a function with only the non-default version specified. - * - * On systems with ELF shared libraries, all symbols exported from - * FFmpeg libraries are tagged with the name and major version of the - * library to which they belong. If a function is moved from one - * library to another, a wrapper must be retained in the original - * location to preserve binary compatibility. - * - * Functions defined with this macro will never be used to resolve - * symbols by the build-time linker. - * - * @param type return type of function - * @param name name of function - * @param args argument list of function - * @param ver version tag to assign function - */ -#if HAVE_SYMVER_ASM_LABEL -# define FF_SYMVER(type, name, args, ver) \ - type ff_##name args __asm__ (EXTERN_PREFIX #name "@" ver); \ - type ff_##name args -#elif HAVE_SYMVER_GNU_ASM -# define FF_SYMVER(type, name, args, ver) \ - __asm__ (".symver ff_" #name "," EXTERN_PREFIX #name "@" ver); \ - type ff_##name args; \ - type ff_##name args -#endif - -/** - * Return NULL if a threading library has not been enabled. - * Used to disable threading functions in AVCodec definitions - * when not needed. - */ -#if HAVE_THREADS -# define ONLY_IF_THREADS_ENABLED(x) x -#else -# define ONLY_IF_THREADS_ENABLED(x) NULL -#endif - -/** * Log a generic warning message about a missing feature. * * @param[in] avc a pointer to an arbitrary struct of which the first @@ -184,10 +143,6 @@ #pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_snprintf") #endif -#define avpriv_fopen_utf8 ff_fopen_utf8 -#define avpriv_open ff_open -#define avpriv_tempfile ff_tempfile - #define PTRDIFF_SPECIFIER "Id" #define SIZE_SPECIFIER "Iu" #else @@ -217,66 +172,6 @@ #define SUINT32 uint32_t #endif -/** - * Clip and convert a double value into the long long amin-amax range. - * This function is needed because conversion of floating point to integers when - * it does not fit in the integer's representation does not necessarily saturate - * correctly (usually converted to a cvttsd2si on x86) which saturates numbers - * > INT64_MAX to INT64_MIN. The standard marks such conversions as undefined - * behavior, allowing this sort of mathematically bogus conversions. This provides - * a safe alternative that is slower obviously but assures safety and better - * mathematical behavior. - * @param a value to clip - * @param amin minimum value of the clip range - * @param amax maximum value of the clip range - * @return clipped value - */ -static av_always_inline av_const int64_t ff_rint64_clip(double a, int64_t amin, int64_t amax) -{ - int64_t res; -#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 - if (amin > amax) abort(); -#endif - // INT64_MAX+1,INT64_MIN are exactly representable as IEEE doubles - // do range checks first - if (a >= 9223372036854775808.0) - return amax; - if (a <= -9223372036854775808.0) - return amin; - - // safe to call llrint and clip accordingly - res = llrint(a); - if (res > amax) - return amax; - if (res < amin) - return amin; - return res; -} - -/** - * A wrapper for open() setting O_CLOEXEC. - */ -av_warn_unused_result -int avpriv_open(const char *filename, int flags, ...); - -/** - * Open a file using a UTF-8 filename. - */ -FILE *avpriv_fopen_utf8(const char *path, const char *mode); - -/** - * Wrapper to work around the lack of mkstemp() on mingw. - * Also, tries to create file in /tmp first, if possible. - * *prefix can be a character constant; *filename will be allocated internally. - * @return file descriptor of opened file (or negative value corresponding to an - * AVERROR code on error) - * and opened file name in **filename. - * @note On very old libcs it is necessary to set a secure umask before - * calling this, av_tempfile() can't call umask itself as it is used in - * libraries and could interfere with the calling application. - */ -int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); - int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); static av_always_inline av_const int avpriv_mirror(int x, int w) @@ -292,17 +187,4 @@ return x; } -void ff_check_pixfmt_descriptors(void); - -/** - * Set a dictionary value to an ISO-8601 compliant timestamp string. - * - * @param dict pointer to a pointer to a dictionary struct. If *dict is NULL - * a dictionary struct is allocated and put in *dict. - * @param key metadata key - * @param timestamp unix timestamp in microseconds - * @return <0 on error - */ -int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp); - #endif /* AVUTIL_INTERNAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/intmath.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/intmath.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/intmath.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/intmath.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,8 +28,9 @@ #if ARCH_ARM # include "arm/intmath.h" -#endif -#if ARCH_X86 +#elif ARCH_RISCV +# include "riscv/intmath.h" +#elif ARCH_X86 # include "x86/intmath.h" #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/lfg.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/lfg.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/lfg.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/lfg.h 2023-03-03 13:29:59.000000000 +0000 @@ -27,7 +27,7 @@ /** * Context structure for the Lagged Fibonacci PRNG. * The exact layout, types and content of this struct may change and should - * not be accessed directly. Only its sizeof() is guranteed to stay the same + * not be accessed directly. Only its `sizeof()` is guaranteed to stay the same * to allow easy instanciation. */ typedef struct AVLFG { @@ -40,7 +40,7 @@ /** * Seed the state of the ALFG using binary data. * - * Return value: 0 on success, negative value (AVERROR) on failure. + * @return 0 on success, negative value (AVERROR) on failure. */ int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); @@ -73,6 +73,7 @@ * Get the next two numbers generated by a Box-Muller Gaussian * generator using the random numbers issued by lfg. * + * @param lfg pointer to the contex structure * @param out array where the two generated numbers are placed */ void av_bmg_get(AVLFG *lfg, double out[2]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -4,6 +4,7 @@ HEADERS = adler32.h \ aes.h \ aes_ctr.h \ + ambient_viewing_environment.h \ attributes.h \ audio_fifo.h \ avassert.h \ @@ -102,6 +103,7 @@ OBJS = adler32.o \ aes.o \ aes_ctr.o \ + ambient_viewing_environment.o \ audio_fifo.o \ avstring.o \ avsscanf.o \ @@ -112,7 +114,6 @@ cast5.o \ camellia.o \ channel_layout.o \ - color_utils.o \ cpu.o \ crc.o \ csp.o \ @@ -201,7 +202,7 @@ OBJS += $(COMPAT_OBJS:%=../compat/%) # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o SKIPHEADERS += objc.h SKIPHEADERS-$(HAVE_CUDA_H) += hwcontext_cuda.h diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mathematics.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mathematics.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mathematics.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mathematics.h 2023-03-03 13:29:59.000000000 +0000 @@ -111,7 +111,8 @@ /** * Compute the greatest common divisor of two integer operands. * - * @param a,b Operands + * @param a Operand + * @param b Operand * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; * if a == 0 and b == 0, returns 0. */ @@ -186,7 +187,8 @@ * av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02) * @endcode * - * @param a,b Operands + * @param a Operand + * @param b Operand * @param mod Divisor; must be a power of 2 * @return * - a negative value if `a % mod < b % mod` diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.c 2023-03-03 13:29:59.000000000 +0000 @@ -212,16 +212,6 @@ return av_malloc(result); } -#if FF_API_AV_MALLOCZ_ARRAY -void *av_mallocz_array(size_t nmemb, size_t size) -{ - size_t result; - if (size_mult(nmemb, size, &result) < 0) - return NULL; - return av_mallocz(result); -} -#endif - void *av_realloc_array(void *ptr, size_t nmemb, size_t size) { size_t result; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem.h 2023-03-03 13:29:59.000000000 +0000 @@ -51,86 +51,6 @@ * @{ */ -#if FF_API_DECLARE_ALIGNED -/** - * - * @defgroup lavu_mem_macros Alignment Macros - * Helper macros for declaring aligned variables. - * @{ - */ - -/** - * @def DECLARE_ALIGNED(n,t,v) - * Declare a variable that is aligned in memory. - * - * @code{.c} - * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; - * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; - * - * // The default-alignment equivalent would be - * uint16_t aligned_int = 42; - * uint8_t aligned_array[128]; - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_ALIGNED(n,t,v) - * Declare an aligned variable appropriate for use in inline assembly code. - * - * @code{.c} - * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_CONST(n,t,v) - * Declare a static constant aligned variable appropriate for use in inline - * assembly code. - * - * @code{.c} - * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v -#elif defined(__DJGPP__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v -#elif defined(__GNUC__) || defined(__clang__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v -#elif defined(_MSC_VER) - #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v -#else - #define DECLARE_ALIGNED(n,t,v) t v - #define DECLARE_ASM_ALIGNED(n,t,v) t v - #define DECLARE_ASM_CONST(n,t,v) static const t v -#endif - -/** - * @} - */ -#endif - /** * @defgroup lavu_mem_attrs Function Attributes * Function attributes applicable to memory handling functions. @@ -239,14 +159,6 @@ */ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); -#if FF_API_AV_MALLOCZ_ARRAY -/** - * @deprecated use av_calloc() - */ -attribute_deprecated -void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); -#endif - /** * Allocate, reallocate, or free a block of memory. * @@ -667,7 +579,8 @@ /** * Multiply two `size_t` values checking for overflow. * - * @param[in] a,b Operands of multiplication + * @param[in] a Operand of multiplication + * @param[in] b Operand of multiplication * @param[out] r Pointer to the result of the operation * @return 0 on success, AVERROR(EINVAL) on overflow */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/mem_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -25,11 +25,11 @@ #include -#include "avassert.h" +#include "attributes.h" +#include "macros.h" #include "mem.h" #include "version.h" -#if !FF_API_DECLARE_ALIGNED /** * @def DECLARE_ALIGNED(n,t,v) * Declare a variable that is aligned in memory. @@ -96,7 +96,6 @@ #define DECLARE_ASM_ALIGNED(n,t,v) t v #define DECLARE_ASM_CONST(n,t,v) static const t v #endif -#endif // Some broken preprocessors need a second expansion // to be forced to tokenize __VA_ARGS__ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/opt.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/opt.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/opt.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/opt.c 2023-03-03 13:29:59.000000000 +0000 @@ -1329,17 +1329,18 @@ av_log(av_log_obj, AV_LOG_INFO, "%-12s ", ""); break; } - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_FILTERING_PARAM)? 'F' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM ) ? 'V' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM ) ? 'A' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_EXPORT) ? 'X' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_READONLY) ? 'R' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_BSF_PARAM) ? 'B' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_RUNTIME_PARAM) ? 'T' : '.'); - av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DEPRECATED) ? 'P' : '.'); + av_log(av_log_obj, AV_LOG_INFO, "%c%c%c%c%c%c%c%c%c%c%c", + (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.', + (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.', + (opt->flags & AV_OPT_FLAG_FILTERING_PARAM) ? 'F' : '.', + (opt->flags & AV_OPT_FLAG_VIDEO_PARAM) ? 'V' : '.', + (opt->flags & AV_OPT_FLAG_AUDIO_PARAM) ? 'A' : '.', + (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.', + (opt->flags & AV_OPT_FLAG_EXPORT) ? 'X' : '.', + (opt->flags & AV_OPT_FLAG_READONLY) ? 'R' : '.', + (opt->flags & AV_OPT_FLAG_BSF_PARAM) ? 'B' : '.', + (opt->flags & AV_OPT_FLAG_RUNTIME_PARAM) ? 'T' : '.', + (opt->flags & AV_OPT_FLAG_DEPRECATED) ? 'P' : '.'); if (opt->help) av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help); @@ -1741,17 +1742,17 @@ int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVDictionary *tmp = NULL; int ret; if (!options) return 0; - while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(*options, t))) { ret = av_opt_set(obj, t->key, t->value, search_flags); if (ret == AVERROR_OPTION_NOT_FOUND) - ret = av_dict_set(&tmp, t->key, t->value, 0); + ret = av_dict_set(&tmp, t->key, t->value, AV_DICT_MULTIKEY); if (ret < 0) { av_log(obj, AV_LOG_ERROR, "Error setting option %s to value %s.\n", t->key, t->value); av_dict_free(&tmp); @@ -2136,16 +2137,16 @@ case AV_OPT_TYPE_DICT: { AVDictionary *dict1 = NULL; AVDictionary *dict2 = *(AVDictionary **)dst; - AVDictionaryEntry *en1 = NULL; - AVDictionaryEntry *en2 = NULL; + const AVDictionaryEntry *en1 = NULL; + const AVDictionaryEntry *en2 = NULL; ret = av_dict_parse_string(&dict1, o->default_val.str, "=", ":", 0); if (ret < 0) { av_dict_free(&dict1); return ret; } do { - en1 = av_dict_get(dict1, "", en1, AV_DICT_IGNORE_SUFFIX); - en2 = av_dict_get(dict2, "", en2, AV_DICT_IGNORE_SUFFIX); + en1 = av_dict_iterate(dict1, en1); + en2 = av_dict_iterate(dict2, en2); } while (en1 && en2 && !strcmp(en1->key, en2->key) && !strcmp(en1->value, en2->value)); av_dict_free(&dict1); return (!en1 && !en2); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/parseutils.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/parseutils.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/parseutils.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/parseutils.h 2023-03-03 13:29:59.000000000 +0000 @@ -79,6 +79,8 @@ /** * Put the RGBA values that correspond to color_string in rgba_color. * + * @param rgba_color 4-elements array of uint8_t values, where the respective + * red, green, blue and alpha component values are written. * @param color_string a string specifying a color. It can be the name of * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, * possibly followed by "@" and a string representing the alpha @@ -92,6 +94,8 @@ * @param slen length of the initial part of color_string containing the * color. It can be set to -1 if color_string is a null terminated string * containing nothing else than the color. + * @param log_ctx a pointer to an arbitrary struct of which the first field + * is a pointer to an AVClass struct (used for av_log()). Can be NULL. * @return >= 0 in case of success, a negative value in case of * failure (for example if color_string cannot be parsed). */ @@ -106,7 +110,7 @@ * av_parse_color(). * * @param color_idx index of the requested color, starting from 0 - * @param rgbp if not NULL, will point to a 3-elements array with the color value in RGB + * @param rgb if not NULL, will point to a 3-elements array with the color value in RGB * @return the color name string or NULL if color_idx is not in the array */ const char *av_get_known_color_name(int color_idx, const uint8_t **rgb); @@ -162,19 +166,19 @@ * by the standard strptime(). * * The supported input field descriptors are listed below. - * - %H: the hour as a decimal number, using a 24-hour clock, in the + * - `%%H`: the hour as a decimal number, using a 24-hour clock, in the * range '00' through '23' - * - %J: hours as a decimal number, in the range '0' through INT_MAX - * - %M: the minute as a decimal number, using a 24-hour clock, in the + * - `%%J`: hours as a decimal number, in the range '0' through INT_MAX + * - `%%M`: the minute as a decimal number, using a 24-hour clock, in the * range '00' through '59' - * - %S: the second as a decimal number, using a 24-hour clock, in the + * - `%%S`: the second as a decimal number, using a 24-hour clock, in the * range '00' through '59' - * - %Y: the year as a decimal number, using the Gregorian calendar - * - %m: the month as a decimal number, in the range '1' through '12' - * - %d: the day of the month as a decimal number, in the range '1' + * - `%%Y`: the year as a decimal number, using the Gregorian calendar + * - `%%m`: the month as a decimal number, in the range '1' through '12' + * - `%%d`: the day of the month as a decimal number, in the range '1' * through '31' - * - %T: alias for '%H:%M:%S' - * - %%: a literal '%' + * - `%%T`: alias for `%%H:%%M:%%S` + * - `%%`: a literal `%` * * @return a pointer to the first character not processed in this function * call. In case the input string contains more characters than diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,12 +22,10 @@ #include #include -#include "avassert.h" #include "avstring.h" #include "common.h" #include "pixfmt.h" #include "pixdesc.h" -#include "internal.h" #include "intreadwrite.h" void av_read_image_line2(void *dst, @@ -48,19 +46,35 @@ uint32_t *dst32 = dst; if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { - int skip = x * step + comp.offset; - const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); - int shift = 8 - depth - (skip & 7); + if (depth == 10) { + // Assume all channels are packed into a 32bit value + const uint8_t *byte_p = data[plane] + y * linesize[plane]; + const uint32_t *p = (uint32_t *)byte_p; - while (w--) { - int val = (*p >> shift) & mask; - if (read_pal_component) - val = data[1][4*val + c]; - shift -= step; - p -= shift >> 3; - shift &= 7; - if (dst_element_size == 4) *dst32++ = val; - else *dst16++ = val; + while (w--) { + int val = AV_RB32(p); + val = (val >> comp.offset) & mask; + if (read_pal_component) + val = data[1][4*val + c]; + if (dst_element_size == 4) *dst32++ = val; + else *dst16++ = val; + p++; + } + } else { + int skip = x * step + comp.offset; + const uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); + int shift = 8 - depth - (skip & 7); + + while (w--) { + int val = (*p >> shift) & mask; + if (read_pal_component) + val = data[1][4*val + c]; + shift -= step; + p -= shift >> 3; + shift &= 7; + if (dst_element_size == 4) *dst32++ = val; + else *dst16++ = val; + } } } else { const uint8_t *p = data[plane] + y * linesize[plane] + @@ -111,15 +125,29 @@ const uint16_t *src16 = src; if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { - int skip = x * step + comp.offset; - uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); - int shift = 8 - depth - (skip & 7); + if (depth == 10) { + // Assume all channels are packed into a 32bit value + const uint8_t *byte_p = data[plane] + y * linesize[plane]; + uint32_t *p = (uint32_t *)byte_p; + int offset = comp.offset; + uint32_t mask = ((1ULL << depth) - 1) << offset; - while (w--) { - *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift; - shift -= step; - p -= shift >> 3; - shift &= 7; + while (w--) { + uint16_t val = src_element_size == 4 ? *src32++ : *src16++; + AV_WB32(p, (AV_RB32(p) & ~mask) | (val << offset)); + p++; + } + } else { + int skip = x * step + comp.offset; + uint8_t *p = data[plane] + y * linesize[plane] + (skip >> 3); + int shift = 8 - depth - (skip & 7); + + while (w--) { + *p |= (src_element_size == 4 ? *src32++ : *src16++) << shift; + shift -= step; + p -= shift >> 3; + shift &= 7; + } } } else { int shift = comp.shift; @@ -2147,6 +2175,30 @@ }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, + [AV_PIX_FMT_P012LE] = { + .name = "p012le", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 4, 12 }, /* Y */ + { 1, 4, 0, 4, 12 }, /* U */ + { 1, 4, 2, 4, 12 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR, + }, + [AV_PIX_FMT_P012BE] = { + .name = "p012be", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 1, + .comp = { + { 0, 2, 0, 4, 12 }, /* Y */ + { 1, 4, 0, 4, 12 }, /* U */ + { 1, 4, 2, 4, 12 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, + }, [AV_PIX_FMT_P016LE] = { .name = "p016le", .nb_components = 3, @@ -2491,6 +2543,180 @@ }, .flags = AV_PIX_FMT_FLAG_PLANAR, }, + [AV_PIX_FMT_VUYA] = { + .name = "vuya", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 2, 0, 8 }, /* Y */ + { 0, 4, 1, 0, 8 }, /* U */ + { 0, 4, 0, 0, 8 }, /* V */ + { 0, 4, 3, 0, 8 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_VUYX] = { + .name = "vuyx", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 2, 0, 8 }, /* Y */ + { 0, 4, 1, 0, 8 }, /* U */ + { 0, 4, 0, 0, 8 }, /* V */ + }, + }, + [AV_PIX_FMT_RGBAF16BE] = { + .name = "rgbaf16be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 8, 0, 0, 16 }, /* R */ + { 0, 8, 2, 0, 16 }, /* G */ + { 0, 8, 4, 0, 16 }, /* B */ + { 0, 8, 6, 0, 16 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA | AV_PIX_FMT_FLAG_FLOAT, + }, + [AV_PIX_FMT_RGBAF16LE] = { + .name = "rgbaf16le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 8, 0, 0, 16 }, /* R */ + { 0, 8, 2, 0, 16 }, /* G */ + { 0, 8, 4, 0, 16 }, /* B */ + { 0, 8, 6, 0, 16 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA | + AV_PIX_FMT_FLAG_FLOAT, + }, + [AV_PIX_FMT_Y212LE] = { + .name = "y212le", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 0, 4, 12 }, /* Y */ + { 0, 8, 2, 4, 12 }, /* U */ + { 0, 8, 6, 4, 12 }, /* V */ + }, + }, + [AV_PIX_FMT_Y212BE] = { + .name = "y212be", + .nb_components = 3, + .log2_chroma_w = 1, + .log2_chroma_h = 0, + .comp = { + { 0, 4, 0, 4, 12 }, /* Y */ + { 0, 8, 2, 4, 12 }, /* U */ + { 0, 8, 6, 4, 12 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + }, + [AV_PIX_FMT_XV30LE] = { + .name = "xv30le", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 4, 1, 2, 10 }, /* Y */ + { 0, 4, 0, 0, 10 }, /* U */ + { 0, 4, 2, 4, 10 }, /* V */ + }, + }, + [AV_PIX_FMT_XV30BE] = { + .name = "xv30be", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 32, 10, 0, 10 }, /* Y */ + { 0, 32, 0, 0, 10 }, /* U */ + { 0, 32, 20, 0, 10 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM, + }, + [AV_PIX_FMT_XV36LE] = { + .name = "xv36le", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 8, 2, 4, 12 }, /* Y */ + { 0, 8, 0, 4, 12 }, /* U */ + { 0, 8, 4, 4, 12 }, /* V */ + }, + }, + [AV_PIX_FMT_XV36BE] = { + .name = "xv36be", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 8, 2, 4, 12 }, /* Y */ + { 0, 8, 0, 4, 12 }, /* U */ + { 0, 8, 4, 4, 12 }, /* V */ + }, + .flags = AV_PIX_FMT_FLAG_BE, + }, + [AV_PIX_FMT_RGBF32BE] = { + .name = "rgbf32be", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 12, 0, 0, 32 }, /* R */ + { 0, 12, 4, 0, 32 }, /* G */ + { 0, 12, 8, 0, 32 }, /* B */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_FLOAT, + }, + [AV_PIX_FMT_RGBF32LE] = { + .name = "rgbf32le", + .nb_components = 3, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 12, 0, 0, 32 }, /* R */ + { 0, 12, 4, 0, 32 }, /* G */ + { 0, 12, 8, 0, 32 }, /* B */ + }, + .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT, + }, + [AV_PIX_FMT_RGBAF32BE] = { + .name = "rgbaf32be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 16, 0, 0, 32 }, /* R */ + { 0, 16, 4, 0, 32 }, /* G */ + { 0, 16, 8, 0, 32 }, /* B */ + { 0, 16, 12, 0, 32 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_RGBAF32LE] = { + .name = "rgbaf32le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 16, 0, 0, 32 }, /* R */ + { 0, 16, 4, 0, 32 }, /* G */ + { 0, 16, 8, 0, 32 }, /* B */ + { 0, 16, 12, 0, 32 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT | + AV_PIX_FMT_FLAG_ALPHA, + }, }; static const char * const color_range_names[] = { @@ -2714,47 +2940,6 @@ return ret; } -void ff_check_pixfmt_descriptors(void){ - int i, j; - - for (i=0; iname && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags) - continue; -// av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name); - av_assert0(d->log2_chroma_w <= 3); - av_assert0(d->log2_chroma_h <= 3); - av_assert0(d->nb_components <= 4); - av_assert0(d->name && d->name[0]); - av_assert2(av_get_pix_fmt(d->name) == i); - - for (j=0; jcomp); j++) { - const AVComponentDescriptor *c = &d->comp[j]; - if(j>=d->nb_components) { - av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth); - continue; - } - if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) { - av_assert0(c->step >= c->depth); - } else { - av_assert0(8*c->step >= c->depth); - } - if (d->flags & AV_PIX_FMT_FLAG_BAYER) - continue; - av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0); - av_assert0(tmp[0] == 0 && tmp[1] == 0); - tmp[0] = tmp[1] = (1ULL << c->depth) - 1; - av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2); - } - } -} - - enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); @@ -2868,9 +3053,16 @@ for (i = 0; i < nb_components; i++) { int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : (dst_desc->comp[i].depth - 1); - if (src_desc->comp[i].depth - 1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) { + int depth_delta = src_desc->comp[i].depth - 1 - depth_minus1; + if (depth_delta > 0 && (consider & FF_LOSS_DEPTH)) { loss |= FF_LOSS_DEPTH; score -= 65536 >> depth_minus1; + } else if (depth_delta < 0 && (consider & FF_LOSS_EXCESS_DEPTH)) { + // Favour formats where bit depth exactly matches. If all other + // scoring is equal, we'd rather use the bit depth that most closely + // matches the source. + loss |= FF_LOSS_EXCESS_DEPTH; + score += depth_delta; } } @@ -2890,6 +3082,28 @@ } } + if (consider & FF_LOSS_EXCESS_RESOLUTION) { + // Favour formats where chroma subsampling exactly matches. If all other + // scoring is equal, we'd rather use the subsampling that most closely + // matches the source. + if (dst_desc->log2_chroma_w < src_desc->log2_chroma_w) { + loss |= FF_LOSS_EXCESS_RESOLUTION; + score -= 1 << (src_desc->log2_chroma_w - dst_desc->log2_chroma_w); + } + + if (dst_desc->log2_chroma_h < src_desc->log2_chroma_h) { + loss |= FF_LOSS_EXCESS_RESOLUTION; + score -= 1 << (src_desc->log2_chroma_h - dst_desc->log2_chroma_h); + } + + // don't favour 411 over 420, because 420 has much better support on the + // decoder side. + if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 2 && + dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 2) { + score += 4; + } + } + if(consider & FF_LOSS_COLORSPACE) switch(dst_color) { case FF_COLOR_RGB: @@ -3088,3 +3302,26 @@ return AVERROR(EINVAL); } + +int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos) +{ + if (pos <= AVCHROMA_LOC_UNSPECIFIED || pos >= AVCHROMA_LOC_NB) + return AVERROR(EINVAL); + pos--; + + *xpos = (pos&1) * 128; + *ypos = ((pos>>1)^(pos<4)) * 128; + + return 0; +} + +enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos) +{ + int pos, xout, yout; + + for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) { + if (av_chroma_location_enum_to_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos) + return pos; + } + return AVCHROMA_LOC_UNSPECIFIED; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixdesc.h 2023-03-03 13:29:59.000000000 +0000 @@ -265,6 +265,28 @@ int av_chroma_location_from_name(const char *name); /** + * Converts AVChromaLocation to swscale x/y chroma position. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos); + +/** + * Converts swscale x/y chroma position to AVChromaLocation. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos); + +/** * Return the pixel format corresponding to name. * * If there is no pixel format with name name, then looks for a @@ -357,12 +379,15 @@ */ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt); -#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ -#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ -#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ -#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ -#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ -#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ +#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ +#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ +#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ +#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ +#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ +#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ +#define FF_LOSS_EXCESS_RESOLUTION 0x0040 /**< loss due to unneeded extra resolution */ +#define FF_LOSS_EXCESS_DEPTH 0x0080 /**< loss due to unneeded extra color depth */ + /** * Compute what kind of losses will occur when converting from one specific diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixfmt.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixfmt.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixfmt.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/pixfmt.h 2023-03-03 13:29:59.000000000 +0000 @@ -206,8 +206,36 @@ AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian /** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. + * HW acceleration through QSV, data[3] contains a pointer to the + * mfxFrameSurface1 structure. + * + * Before FFmpeg 5.0: + * mfxFrameSurface1.Data.MemId contains a pointer when importing + * the following frames as QSV frames: + * + * VAAPI: + * mfxFrameSurface1.Data.MemId contains a pointer to VASurfaceID + * + * DXVA2: + * mfxFrameSurface1.Data.MemId contains a pointer to IDirect3DSurface9 + * + * FFmpeg 5.0 and above: + * mfxFrameSurface1.Data.MemId contains a pointer to the mfxHDLPair + * structure when importing the following frames as QSV frames: + * + * VAAPI: + * mfxHDLPair.first contains a VASurfaceID pointer. + * mfxHDLPair.second is always MFX_INFINITE. + * + * DXVA2: + * mfxHDLPair.first contains IDirect3DSurface9 pointer. + * mfxHDLPair.second is always MFX_INFINITE. + * + * D3D11: + * mfxHDLPair.first contains a ID3D11Texture2D pointer. + * mfxHDLPair.second contains the texture array index of the frame if the + * ID3D11Texture2D is an array texture, or always MFX_INFINITE if it is a + * normal texture. */ AV_PIX_FMT_QSV, /** @@ -367,6 +395,31 @@ AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian + AV_PIX_FMT_VUYA, ///< packed VUYA 4:4:4, 32bpp, VUYAVUYA... + + AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian + AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian + + AV_PIX_FMT_VUYX, ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined + + AV_PIX_FMT_P012LE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, little-endian + AV_PIX_FMT_P012BE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, big-endian + + AV_PIX_FMT_Y212BE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, big-endian + AV_PIX_FMT_Y212LE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, little-endian + + AV_PIX_FMT_XV30BE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel is left undefined + AV_PIX_FMT_XV30LE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channel is left undefined + + AV_PIX_FMT_XV36BE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian, variant of Y412 where alpha channel is left undefined + AV_PIX_FMT_XV36LE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian, variant of Y412 where alpha channel is left undefined + + AV_PIX_FMT_RGBF32BE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian + AV_PIX_FMT_RGBF32LE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian + + AV_PIX_FMT_RGBAF32BE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian + AV_PIX_FMT_RGBAF32LE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., 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 }; @@ -453,9 +506,13 @@ #define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) #define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) #define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) +#define AV_PIX_FMT_P012 AV_PIX_FMT_NE(P012BE, P012LE) #define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) #define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE) +#define AV_PIX_FMT_Y212 AV_PIX_FMT_NE(Y212BE, Y212LE) +#define AV_PIX_FMT_XV30 AV_PIX_FMT_NE(XV30BE, XV30LE) +#define AV_PIX_FMT_XV36 AV_PIX_FMT_NE(XV36BE, XV36LE) #define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE) #define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE) @@ -464,6 +521,11 @@ #define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE) #define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE) +#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE) + +#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE) +#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE) + /** * Chromaticity coordinates of the source primaries. * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/random_seed.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/random_seed.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/random_seed.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/random_seed.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,6 +35,7 @@ #include #include #include "avassert.h" +#include "file_open.h" #include "internal.h" #include "intreadwrite.h" #include "timer.h" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rational.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rational.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rational.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rational.h 2023-03-03 13:29:59.000000000 +0000 @@ -179,7 +179,8 @@ * Find which of the two rationals is closer to another rational. * * @param q Rational to be compared against - * @param q1,q2 Rationals to be tested + * @param q1 Rational to be tested + * @param q2 Rational to be tested * @return One of the following values: * - 1 if `q1` is nearer to `q` than `q2` * - -1 if `q2` is nearer to `q` than `q1` diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rc4.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rc4.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rc4.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/rc4.h 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,8 @@ /** * @brief Initializes an AVRC4 context. * + * @param d pointer to the AVRC4 context + * @param key buffer containig the key * @param key_bits must be a multiple of 8 * @param decrypt 0 for encryption, 1 for decryption, currently has no effect * @return zero on success, negative value otherwise @@ -51,6 +53,7 @@ /** * @brief Encrypts / decrypts using the RC4 algorithm. * + * @param d pointer to the AVRC4 context * @param count number of bytes * @param dst destination array, can be equal to src * @param src source array, can be equal to dst, may be NULL diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/asm.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/asm.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/asm.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/asm.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * Loosely based on earlier work copyrighted by Måns Rullgård, 2008. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if defined (__riscv_float_abi_soft) +#define NOHWF +#define NOHWD +#define HWF # +#define HWD # +#elif defined (__riscv_float_abi_single) +#define NOHWF # +#define NOHWD +#define HWF +#define HWD # +#else +#define NOHWF # +#define NOHWD # +#define HWF +#define HWD +#endif + + .macro func sym, ext= + .text + .align 2 + + .option push + .ifnb \ext + .option arch, +\ext + .endif + + .global \sym + .hidden \sym + .type \sym, %function + \sym: + + .macro endfunc + .size \sym, . - \sym + .option pop + .previous + .purgem endfunc + .endm + .endm + + .macro const sym, align=3, relocate=0 + .if \relocate + .pushsection .data.rel.ro + .else + .pushsection .rodata + .endif + .align \align + \sym: + + .macro endconst + .size \sym, . - \sym + .popsection + .purgem endconst + .endm + .endm + +#if !defined (__riscv_zba) + /* SH{1,2,3}ADD definitions for pre-Zba assemblers */ + .macro shnadd n, rd, rs1, rs2 + .insn r OP, 2 * \n, 16, \rd, \rs1, \rs2 + .endm + + .macro sh1add rd, rs1, rs2 + shnadd 1, \rd, \rs1, \rs2 + .endm + + .macro sh2add rd, rs1, rs2 + shnadd 2, \rd, \rs1, \rs2 + .endm + + .macro sh3add rd, rs1, rs2 + shnadd 3, \rd, \rs1, \rs2 + .endm +#endif + + /* Convenience macro to load a Vector type (vtype) as immediate */ + .macro lvtypei rd, e, m=m1, tp=tu, mp=mu + + .ifc \e,e8 + .equ ei, 0 + .else + .ifc \e,e16 + .equ ei, 8 + .else + .ifc \e,e32 + .equ ei, 16 + .else + .ifc \e,e64 + .equ ei, 24 + .else + .error "Unknown element type" + .endif + .endif + .endif + .endif + + .ifc \m,m1 + .equ mi, 0 + .else + .ifc \m,m2 + .equ mi, 1 + .else + .ifc \m,m4 + .equ mi, 2 + .else + .ifc \m,m8 + .equ mi, 3 + .else + .ifc \m,mf8 + .equ mi, 5 + .else + .ifc \m,mf4 + .equ mi, 6 + .else + .ifc \m,mf2 + .equ mi, 7 + .else + .error "Unknown multiplier" + .equ mi, 3 + .endif + .endif + .endif + .endif + .endif + .endif + .endif + + .ifc \tp,tu + .equ tpi, 0 + .else + .ifc \tp,ta + .equ tpi, 64 + .else + .error "Unknown tail policy" + .endif + .endif + + .ifc \mp,mu + .equ mpi, 0 + .else + .ifc \mp,ma + .equ mpi, 128 + .else + .error "Unknown mask policy" + .endif + .endif + + li \rd, (ei | mi | tpi | mpi) + .endm diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/bswap.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/bswap.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/bswap.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/bswap.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_RISCV_BSWAP_H +#define AVUTIL_RISCV_BSWAP_H + +#include +#include "config.h" +#include "libavutil/attributes.h" + +#if defined (__riscv_zbb) && (__riscv_zbb > 0) && HAVE_INLINE_ASM + +static av_always_inline av_const uintptr_t av_bswap_xlen(uintptr_t x) +{ + uintptr_t y; + + __asm__("rev8 %0, %1" : "=r" (y) : "r" (x)); + return y; +} + +#define av_bswap16 av_bswap16 + +static av_always_inline av_const uint_fast16_t av_bswap16(uint_fast16_t x) +{ + return av_bswap_xlen(x) >> (__riscv_xlen - 16); +} + +#if (__riscv_xlen == 32) +#define av_bswap32 av_bswap_xlen +#define av_bswap64 av_bswap64 + +static av_always_inline av_const uint64_t av_bswap64(uint64_t x) +{ + return (((uint64_t)av_bswap32(x)) << 32) | av_bswap32(x >> 32); +} + +#else +#define av_bswap32 av_bswap32 + +static av_always_inline av_const uint_fast32_t av_bswap32(uint_fast32_t x) +{ + return av_bswap_xlen(x) >> (__riscv_xlen - 32); +} + +#if (__riscv_xlen == 64) +#define av_bswap64 av_bswap_xlen + +#else +#define av_bswap64 av_bswap64 + +static av_always_inline av_const uint_fast64_t av_bswap64(uint_fast64_t x) +{ + return av_bswap_xlen(x) >> (__riscv_xlen - 64); +} + +#endif /* __riscv_xlen > 64 */ +#endif /* __riscv_xlen > 32 */ +#endif /* __riscv_zbb */ +#endif /* AVUTIL_RISCV_BSWAP_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * 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 + */ + +#include "libavutil/cpu.h" +#include "libavutil/cpu_internal.h" +#include "libavutil/log.h" +#include "config.h" + +#if HAVE_GETAUXVAL +#include +#define HWCAP_RV(letter) (1ul << ((letter) - 'A')) +#endif + +int ff_get_cpu_flags_riscv(void) +{ + int ret = 0; +#if HAVE_GETAUXVAL + const unsigned long hwcap = getauxval(AT_HWCAP); + + if (hwcap & HWCAP_RV('I')) + ret |= AV_CPU_FLAG_RVI; + if (hwcap & HWCAP_RV('F')) + ret |= AV_CPU_FLAG_RVF; + if (hwcap & HWCAP_RV('D')) + ret |= AV_CPU_FLAG_RVD; + if (hwcap & HWCAP_RV('B')) + ret |= AV_CPU_FLAG_RVB_BASIC; + + /* The V extension implies all Zve* functional subsets */ + if (hwcap & HWCAP_RV('V')) + ret |= AV_CPU_FLAG_RVV_I32 | AV_CPU_FLAG_RVV_I64 + | AV_CPU_FLAG_RVV_F32 | AV_CPU_FLAG_RVV_F64; +#endif + +#ifdef __riscv_i + ret |= AV_CPU_FLAG_RVI; +#endif +#if defined (__riscv_flen) && (__riscv_flen >= 32) + ret |= AV_CPU_FLAG_RVF; +#if (__riscv_flen >= 64) + ret |= AV_CPU_FLAG_RVD; +#endif +#endif + +#ifdef __riscv_zbb + ret |= AV_CPU_FLAG_RVB_BASIC; +#endif + + /* If RV-V is enabled statically at compile-time, check the details. */ +#ifdef __riscv_vectors + ret |= AV_CPU_FLAG_RVV_I32; +#if __riscv_v_elen >= 64 + ret |= AV_CPU_FLAG_RVV_I64; +#endif +#if __riscv_v_elen_fp >= 32 + ret |= AV_CPU_FLAG_RVV_F32; +#if __riscv_v_elen_fp >= 64 + ret |= AV_CPU_FLAG_RVV_F64; +#endif +#endif +#endif + + return ret; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/cpu.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * 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 + */ + +#ifndef AVUTIL_RISCV_CPU_H +#define AVUTIL_RISCV_CPU_H + +#include "config.h" +#include +#include "libavutil/cpu.h" + +#if HAVE_RVV +/** + * Returns the vector size in bytes (always a power of two and at least 4). + * This is undefined behaviour if vectors are not implemented. + */ +static inline size_t ff_get_rv_vlenb(void) +{ + size_t vlenb; + + __asm__ ( + ".option push\n" + ".option arch, +v\n" + " csrr %0, vlenb\n" + ".option pop\n" : "=r" (vlenb)); + return vlenb; +} +#endif +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * 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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/fixed_dsp.h" + +void ff_butterflies_fixed_rvv(int *v1, int *v2, int len); + +av_cold void ff_fixed_dsp_init_riscv(AVFixedDSPContext *fdsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_I32) + fdsp->butterflies_fixed = ff_butterflies_fixed_rvv; +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/fixed_dsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * 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 + */ + +#include "asm.S" + +// (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1] +func ff_butterflies_fixed_rvv, zve32x +1: + vsetvli t0, a2, e32, m1, ta, ma + vle32.v v16, (a0) + sub a2, a2, t0 + vle32.v v24, (a1) + vadd.vv v0, v16, v24 + vsub.vv v8, v16, v24 + vse32.v v0, (a0) + sh2add a0, t0, a0 + vse32.v v8, (a1) + sh2add a1, t0, a1 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_init.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * 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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/float_dsp.h" + +void ff_vector_fmul_rvv(float *dst, const float *src0, const float *src1, + int len); +void ff_vector_fmac_scalar_rvv(float *dst, const float *src, float mul, + int len); +void ff_vector_fmul_scalar_rvv(float *dst, const float *src, float mul, + int len); +void ff_vector_fmul_window_rvv(float *dst, const float *src0, + const float *src1, const float *win, int len); +void ff_vector_fmul_add_rvv(float *dst, const float *src0, const float *src1, + const float *src2, int len); +void ff_vector_fmul_reverse_rvv(float *dst, const float *src0, + const float *src1, int len); +void ff_butterflies_float_rvv(float *v1, float *v2, int len); +float ff_scalarproduct_float_rvv(const float *v1, const float *v2, int len); + +void ff_vector_dmul_rvv(double *dst, const double *src0, const double *src1, + int len); +void ff_vector_dmac_scalar_rvv(double *dst, const double *src, double mul, + int len); +void ff_vector_dmul_scalar_rvv(double *dst, const double *src, double mul, + int len); + +av_cold void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_F32) { + fdsp->vector_fmul = ff_vector_fmul_rvv; + fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_rvv; + fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_rvv; + fdsp->vector_fmul_window = ff_vector_fmul_window_rvv; + fdsp->vector_fmul_add = ff_vector_fmul_add_rvv; + fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_rvv; + fdsp->butterflies_float = ff_butterflies_float_rvv; + fdsp->scalarproduct_float = ff_scalarproduct_float_rvv; + } + + if (flags & AV_CPU_FLAG_RVV_F64) { + fdsp->vector_dmul = ff_vector_dmul_rvv; + fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_rvv; + fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_rvv; + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/float_dsp_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,237 @@ +/* + * 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 + */ + +#include "asm.S" + +// (a0) = (a1) * (a2) [0..a3-1] +func ff_vector_fmul_rvv, zve32f +1: + vsetvli t0, a3, e32, m1, ta, ma + vle32.v v16, (a1) + sub a3, a3, t0 + vle32.v v24, (a2) + sh2add a1, t0, a1 + vfmul.vv v16, v16, v24 + sh2add a2, t0, a2 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a3, 1b + + ret +endfunc + +// (a0) += (a1) * fa0 [0..a2-1] +func ff_vector_fmac_scalar_rvv, zve32f +NOHWF fmv.w.x fa0, a2 +NOHWF mv a2, a3 +1: + vsetvli t0, a2, e32, m1, ta, ma + slli t1, t0, 2 + vle32.v v24, (a1) + sub a2, a2, t0 + vle32.v v16, (a0) + sh2add a1, t0, a1 + vfmacc.vf v16, fa0, v24 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +endfunc + +// (a0) = (a1) * fa0 [0..a2-1] +func ff_vector_fmul_scalar_rvv, zve32f +NOHWF fmv.w.x fa0, a2 +NOHWF mv a2, a3 +1: + vsetvli t0, a2, e32, m1, ta, ma + vle32.v v16, (a1) + sub a2, a2, t0 + vfmul.vf v16, v16, fa0 + sh2add a1, t0, a1 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + + ret +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 +1: + vsetvli t2, a4, e32, m1, ta, ma + vle32.v v16, (a1) + 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 + 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 + sub t0, t0, t4 + bnez a4, 1b + + ret +endfunc + +// (a0) = (a1) * (a2) + (a3) [0..a4-1] +func ff_vector_fmul_add_rvv, zve32f +1: + vsetvli t0, a4, e32, m1, ta, ma + vle32.v v8, (a1) + sub a4, a4, t0 + vle32.v v16, (a2) + sh2add a1, t0, a1 + vle32.v v24, (a3) + sh2add a2, t0, a2 + vfmadd.vv v8, v16, v24 + sh2add a3, t0, a3 + vse32.v v8, (a0) + sh2add a0, t0, a0 + bnez a4, 1b + + ret +endfunc + +// (a0) = (a1) * reverse(a2) [0..a3-1] +func ff_vector_fmul_reverse_rvv, zve32f + sh2add a2, a3, a2 + li t2, -4 // byte stride + addi a2, a2, -4 +1: + vsetvli t0, a3, e32, m1, 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 + sub a2, a2, t1 + vse32.v v16, (a0) + add a0, a0, t1 + bnez a3, 1b + + ret +endfunc + +// (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1] +func ff_butterflies_float_rvv, zve32f +1: + vsetvli t0, a2, e32, m1, ta, ma + vle32.v v16, (a0) + sub a2, a2, t0 + vle32.v v24, (a1) + vfadd.vv v0, v16, v24 + vfsub.vv v8, v16, v24 + vse32.v v0, (a0) + sh2add a0, t0, a0 + vse32.v v8, (a1) + sh2add a1, t0, a1 + bnez a2, 1b + + ret +endfunc + +// a0 = (a0).(a1) [0..a2-1] +func ff_scalarproduct_float_rvv, zve32f + vsetivli zero, 1, e32, m1, ta, ma + vmv.s.x v8, zero +1: + vsetvli t0, a2, e32, m1, ta, ma + vle32.v v16, (a0) + sub a2, a2, t0 + vle32.v v24, (a1) + sh2add a0, t0, a0 + vfmul.vv v16, v16, v24 + sh2add a1, t0, a1 + vfredusum.vs v8, v16, v8 + bnez a2, 1b + + vfmv.f.s fa0, v8 +NOHWF fmv.x.w a0, fa0 + ret +endfunc + +// (a0) = (a1) * (a2) [0..a3-1] +func ff_vector_dmul_rvv, zve64d +1: + vsetvli t0, a3, e64, m1, ta, ma + vle64.v v16, (a1) + sub a3, a3, t0 + vle64.v v24, (a2) + sh3add a1, t0, a1 + vfmul.vv v16, v16, v24 + sh3add a2, t0, a2 + vse64.v v16, (a0) + sh3add a0, t0, a0 + bnez a3, 1b + + ret +endfunc + +// (a0) += (a1) * fa0 [0..a2-1] +func ff_vector_dmac_scalar_rvv, zve64d +NOHWD fmv.d.x fa0, a2 +NOHWD mv a2, a3 +1: + vsetvli t0, a2, e64, m1, ta, ma + vle64.v v24, (a1) + sub a2, a2, t0 + vle64.v v16, (a0) + sh3add a1, t0, a1 + vfmacc.vf v16, fa0, v24 + vse64.v v16, (a0) + sh3add a0, t0, a0 + bnez a2, 1b + + ret +endfunc + +// (a0) = (a1) * fa0 [0..a2-1] +func ff_vector_dmul_scalar_rvv, zve64d +NOHWD fmv.d.x fa0, a2 +NOHWD mv a2, a3 +1: + vsetvli t0, a2, e64, m1, ta, ma + vle64.v v16, (a1) + sub a2, a2, t0 + vfmul.vf v16, v16, fa0 + sh3add a1, t0, a1 + vse64.v v16, (a0) + sh3add a0, t0, a0 + bnez a2, 1b + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/intmath.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/intmath.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/intmath.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/intmath.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_RISCV_INTMATH_H +#define AVUTIL_RISCV_INTMATH_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" + +/* + * The compiler is forced to sign-extend the result anyhow, so it is faster to + * compute it explicitly and use it. + */ +#define av_clip_int8 av_clip_int8_rvi +static av_always_inline av_const int8_t av_clip_int8_rvi(int a) +{ + union { uint8_t u; int8_t s; } u = { .u = a }; + + if (a != u.s) + a = ((a >> 31) ^ 0x7F); + return a; +} + +#define av_clip_int16 av_clip_int16_rvi +static av_always_inline av_const int16_t av_clip_int16_rvi(int a) +{ + union { uint16_t u; int16_t s; } u = { .u = a }; + + if (a != u.s) + a = ((a >> 31) ^ 0x7FFF); + return a; +} + +#define av_clipl_int32 av_clipl_int32_rvi +static av_always_inline av_const int32_t av_clipl_int32_rvi(int64_t a) +{ + union { uint32_t u; int32_t s; } u = { .u = a }; + + if (a != u.s) + a = ((a >> 63) ^ 0x7FFFFFFF); + return a; +} + +#define av_clip_intp2 av_clip_intp2_rvi +static av_always_inline av_const int av_clip_intp2_rvi(int a, int p) +{ + const int shift = 31 - p; + int b = ((int)(((unsigned)a) << shift)) >> shift; + + if (a != b) + b = (a >> 31) ^ ((1 << p) - 1); + return b; +} + +#if defined (__riscv_zbb) && (__riscv_zbb > 0) && HAVE_INLINE_ASM + +#define av_popcount av_popcount_rvb +static av_always_inline av_const int av_popcount_rvb(uint32_t x) +{ + int ret; + +#if (__riscv_xlen >= 64) + __asm__ ("cpopw %0, %1\n" : "=r" (ret) : "r" (x)); +#else + __asm__ ("cpop %0, %1\n" : "=r" (ret) : "r" (x)); +#endif + return ret; +} + +#if (__riscv_xlen >= 64) +#define av_popcount64 av_popcount64_rvb +static av_always_inline av_const int av_popcount64_rvb(uint64_t x) +{ + int ret; + +#if (__riscv_xlen >= 128) + __asm__ ("cpopd %0, %1\n" : "=r" (ret) : "r" (x)); +#else + __asm__ ("cpop %0, %1\n" : "=r" (ret) : "r" (x)); +#endif + return ret; +} +#endif /* __riscv_xlen >= 64 */ +#endif /* __riscv_zbb */ + +#endif /* AVUTIL_RISCV_INTMATH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,5 @@ +OBJS += riscv/float_dsp_init.o \ + riscv/fixed_dsp_init.o \ + riscv/cpu.o +RVV-OBJS += riscv/float_dsp_rvv.o \ + riscv/fixed_dsp_rvv.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/timer.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/timer.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/timer.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/riscv/timer.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_RISCV_TIMER_H +#define AVUTIL_RISCV_TIMER_H + +#include "config.h" + +#if HAVE_INLINE_ASM +#include + +static inline uint64_t rdcycle64(void) +{ +#if (__riscv_xlen >= 64) + uintptr_t cycles; + + __asm__ volatile ("rdcycle %0" : "=r"(cycles)); + +#else + uint64_t cycles; + uint32_t hi, lo, check; + + __asm__ volatile ( + "1: rdcycleh %0\n" + " rdcycle %1\n" + " rdcycleh %2\n" + " bne %0, %2, 1b\n" : "=r" (hi), "=r" (lo), "=r" (check)); + + cycles = (((uint64_t)hi) << 32) | lo; + +#endif + return cycles; +} + +#define AV_READ_TIME rdcycle64 + +#endif +#endif /* AVUTIL_RISCV_TIMER_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/samplefmt.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/samplefmt.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/samplefmt.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/samplefmt.h 2023-03-03 13:29:59.000000000 +0000 @@ -213,6 +213,7 @@ * @param[out] linesize aligned size for audio buffer(s), may be NULL * @param nb_channels number of audio channels * @param nb_samples number of samples per channel + * @param sample_fmt the sample format * @param align buffer size alignment (0 = default, 1 = no alignment) * @return >=0 on success or a negative error code on failure * @todo return the size of the allocated buffer in case of success at the next bump diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/slicethread.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/slicethread.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/slicethread.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/slicethread.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,8 @@ #include "thread.h" #include "avassert.h" +#define MAX_AUTO_THREADS 16 + #if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS typedef struct WorkerContext { @@ -105,7 +107,7 @@ if (!nb_threads) { int nb_cpus = av_cpu_count(); if (nb_cpus > 1) - nb_threads = nb_cpus + 1; + nb_threads = FFMIN(nb_cpus + 1, MAX_AUTO_THREADS); else nb_threads = 1; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/spherical.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/spherical.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/spherical.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/spherical.h 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_spherical * Spherical video */ @@ -30,19 +31,14 @@ #include /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_spherical Spherical video mapping - * @{ - */ - -/** - * @addtogroup lavu_video_spherical + * @ingroup lavu_video + * * A spherical video file contains surfaces that need to be mapped onto a * sphere. Depending on how the frame was converted, a different distortion * transformation or surface recomposition function needs to be applied before * the video should be mapped and displayed. + * @{ */ /** @@ -226,7 +222,6 @@ int av_spherical_from_name(const char *name); /** * @} - * @} */ #endif /* AVUTIL_SPHERICAL_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/stereo3d.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/stereo3d.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/stereo3d.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/stereo3d.h 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_stereo3d * Stereoscopic video */ @@ -31,19 +32,15 @@ #include "frame.h" /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_stereo3d Stereo3D types and functions - * @{ - */ - -/** - * @addtogroup lavu_video_stereo3d + * @ingroup lavu_video + * * A stereoscopic video file consists in multiple views embedded in a single * frame, usually describing two views of a scene. This file describes all * possible codec-independent view arrangements. - * */ + * + * @{ + */ /** * List of possible 3D Types @@ -227,7 +224,6 @@ /** * @} - * @} */ #endif /* AVUTIL_STEREO3D_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/avstring.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/avstring.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/avstring.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/avstring.c 2023-03-03 13:29:59.000000000 +0000 @@ -109,21 +109,5 @@ TEST_STRIREPLACE(haystack, needle [2], "Education consists mainly in what we have instead."); TEST_STRIREPLACE(haystack, needle [1], "Education consists mainly in what we have instead"); -#if FF_API_D2STR -FF_DISABLE_DEPRECATION_WARNINGS - /*Testing av_d2str()*/ - #define TEST_D2STR(value, expected) \ - if((ptr = av_d2str(value)) == NULL){ \ - printf("error, received null pointer!\n"); \ - } else { \ - if(strcmp(ptr, expected) != 0) \ - printf( "expected: %s, received: %s\n", expected, ptr); \ - av_free(ptr); \ - } - TEST_D2STR(0 , "0.000000"); - TEST_D2STR(-1.2333234, "-1.233323"); - TEST_D2STR(-1.2333237, "-1.233324"); -FF_ENABLE_DEPRECATION_WARNINGS -#endif return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/color_utils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/color_utils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/color_utils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/color_utils.c 2023-03-03 13:29:59.000000000 +0000 @@ -19,7 +19,7 @@ */ #include -#include "libavutil/color_utils.c" +#include "libavutil/csp.h" #include "libavutil/macros.h" int main(int argc, char *argv[]) @@ -32,7 +32,7 @@ }; for(i = 0; i < AVCOL_TRC_NB; i++) { - avpriv_trc_function func = avpriv_get_trc_function_from_trc(i); + av_csp_trc_function func = av_csp_trc_func_from_id(i); for(j = 0; j < FF_ARRAY_ELEMS(test_data); j++) { if(func != NULL) { double result = func(test_data[j]); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/cpu.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/cpu.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/cpu.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/cpu.c 2023-03-03 13:29:59.000000000 +0000 @@ -77,6 +77,7 @@ { AV_CPU_FLAG_BMI2, "bmi2" }, { AV_CPU_FLAG_AESNI, "aesni" }, { AV_CPU_FLAG_AVX512, "avx512" }, + { AV_CPU_FLAG_AVX512ICL, "avx512icl" }, { AV_CPU_FLAG_SLOW_GATHER, "slowgather" }, #elif ARCH_LOONGARCH { AV_CPU_FLAG_LSX, "lsx" }, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/dict.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/dict.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/dict.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/dict.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,10 +20,30 @@ #include "libavutil/dict.c" +static const AVDictionaryEntry *dict_iterate(const AVDictionary *m, + const AVDictionaryEntry *prev) +{ + const AVDictionaryEntry *dict_get = av_dict_get(m, "", prev, AV_DICT_IGNORE_SUFFIX); + const AVDictionaryEntry *dict_iterate = av_dict_iterate(m, prev); + + if (dict_get != dict_iterate) { +#define GET(entry, mem) ((entry) ? (entry)->mem : "N/A") + printf("Iterating with av_dict_iterate() yields a different result " + "than iterating with av_dict_get() and AV_DICT_IGNORE_SUFFIX " + "(prev: %p, key %s; av_dict_iterate() %p, key %s, value %s; " + "av_dict_get() %p, key %s, value %s)\n", + prev, GET(prev, key), + dict_iterate, GET(dict_iterate, key), GET(dict_iterate, value), + dict_get, GET(dict_get, key), GET(dict_get, value)); +#undef GET + } + return dict_iterate; +} + static void print_dict(const AVDictionary *m) { - AVDictionaryEntry *t = NULL; - while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) + const AVDictionaryEntry *t = NULL; + while ((t = dict_iterate(m, t))) printf("%s %s ", t->key, t->value); printf("\n"); } @@ -52,7 +72,7 @@ int main(void) { AVDictionary *dict = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; char *buffer = NULL; printf("Testing av_dict_get_string() and av_dict_parse_string()\n"); @@ -91,16 +111,22 @@ av_dict_set(&dict, "f", NULL, 0); av_dict_set(&dict, "ff", "f", 0); av_dict_set(&dict, "ff", "f", AV_DICT_APPEND); + if (av_dict_get(dict, NULL, NULL, 0)) + printf("av_dict_get() does not correctly handle NULL key.\n"); e = NULL; - while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) + while ((e = dict_iterate(dict, e))) printf("%s %s\n", e->key, e->value); av_dict_free(&dict); - av_dict_set(&dict, NULL, "a", 0); - av_dict_set(&dict, NULL, "b", 0); - av_dict_get(dict, NULL, NULL, 0); + if (av_dict_set(&dict, NULL, "a", 0) >= 0 || + av_dict_set(&dict, NULL, "b", 0) >= 0 || + av_dict_set(&dict, NULL, NULL, AV_DICT_DONT_STRDUP_KEY) >= 0 || + av_dict_set(&dict, NULL, av_strdup("b"), AV_DICT_DONT_STRDUP_VAL) >= 0 || + av_dict_count(dict)) + printf("av_dict_set does not correctly handle NULL key\n"); + e = NULL; - while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) + while ((e = dict_iterate(dict, e))) printf("'%s' '%s'\n", e->key, e->value); av_dict_free(&dict); @@ -116,7 +142,7 @@ av_dict_set_int(&dict, "12", 1, 0); av_dict_set_int(&dict, "12", 2, AV_DICT_APPEND); e = NULL; - while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) + while ((e = dict_iterate(dict, e))) printf("%s %s\n", e->key, e->value); av_dict_free(&dict); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixelutils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixelutils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixelutils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixelutils.c 2023-03-03 13:29:59.000000000 +0000 @@ -18,15 +18,67 @@ #include +#include "libavutil/avassert.h" #include "libavutil/internal.h" +#include "libavutil/log.h" #include "libavutil/mem.h" +#include "libavutil/pixdesc.h" #include "libavutil/pixelutils.c" +#include "libavutil/pixfmt.h" #define W1 320 #define H1 240 #define W2 640 #define H2 480 +static void check_pixfmt_descriptors(void) +{ + const AVPixFmtDescriptor *d, *last = NULL; + int i; + + for (i = AV_PIX_FMT_NONE, d = NULL; i++, d = av_pix_fmt_desc_next(d);) { + uint8_t fill[4][8 + 6 + 3] = {{ 0 }}; + uint8_t *data[4] = { fill[0], fill[1], fill[2], fill[3] }; + int linesize[4] = { 0, 0, 0, 0 }; + uint16_t tmp[2]; + + av_assert0(d->name && d->name[0]); + av_log(NULL, AV_LOG_INFO, "Checking: %s\n", d->name); + av_assert0(d->log2_chroma_w <= 3); + av_assert0(d->log2_chroma_h <= 3); + av_assert0(d->nb_components <= 4); + av_assert0(d->nb_components || (d->flags & AV_PIX_FMT_FLAG_HWACCEL)); + av_assert0(av_get_pix_fmt(d->name) == av_pix_fmt_desc_get_id(d)); + + /* The following two checks as well as the one after the loop + * would need to be changed if we changed the way the descriptors + * are stored. */ + av_assert0(i == av_pix_fmt_desc_get_id(d)); + av_assert0(!last || last + 1 == d); + + for (int j = 0; j < FF_ARRAY_ELEMS(d->comp); j++) { + const AVComponentDescriptor *c = &d->comp[j]; + if (j >= d->nb_components) { + av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth); + continue; + } + if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) { + av_assert0(c->step >= c->depth); + } else { + av_assert0(8*c->step >= c->depth); + } + if (d->flags & AV_PIX_FMT_FLAG_BAYER) + continue; + av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0); + av_assert0(tmp[0] == 0 && tmp[1] == 0); + tmp[0] = tmp[1] = (1ULL << c->depth) - 1; + av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2); + } + last = d; + } + av_assert0(i == AV_PIX_FMT_NB); +} + static int run_single_test(const char *test, const uint8_t *block1, ptrdiff_t stride1, const uint8_t *block2, ptrdiff_t stride2, @@ -87,7 +139,7 @@ goto end; } - ff_check_pixfmt_descriptors(); + check_pixfmt_descriptors(); #define RANDOM_INIT(buf, size) do { \ int k; \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixfmt_best.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixfmt_best.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixfmt_best.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tests/pixfmt_best.c 2023-03-03 13:29:59.000000000 +0000 @@ -39,32 +39,74 @@ AV_PIX_FMT_VAAPI, }; -static enum AVPixelFormat find_best(enum AVPixelFormat pixfmt) +static const enum AVPixelFormat semiplanar_list[] = { + AV_PIX_FMT_P016, + AV_PIX_FMT_P012, + AV_PIX_FMT_P010, + AV_PIX_FMT_NV12, +}; + +static const enum AVPixelFormat packed_list[] = { + AV_PIX_FMT_XV36, + AV_PIX_FMT_XV30, + AV_PIX_FMT_VUYX, + AV_PIX_FMT_Y212, + AV_PIX_FMT_Y210, + AV_PIX_FMT_YUYV422, +}; + +static const enum AVPixelFormat subsampled_list[] = { + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, +}; + +static const enum AVPixelFormat depthchroma_list[] = { + AV_PIX_FMT_YUV420P14, + AV_PIX_FMT_YUV422P14, + AV_PIX_FMT_YUV444P16, +}; + +typedef enum AVPixelFormat (*find_best_t)(enum AVPixelFormat pixfmt); + +#define find_best_wrapper(name, list) \ +static enum AVPixelFormat find_best_ ## name (enum AVPixelFormat pixfmt) \ +{ \ + enum AVPixelFormat best = AV_PIX_FMT_NONE; \ + int i; \ + for (i = 0; i < FF_ARRAY_ELEMS(list); i++) \ + best = av_find_best_pix_fmt_of_2(best, list[i], \ + pixfmt, 0, NULL); \ + return best; \ +} + +find_best_wrapper(base, pixfmt_list) +find_best_wrapper(seminplanar, semiplanar_list) +find_best_wrapper(packed, packed_list) +find_best_wrapper(subsampled, subsampled_list) +find_best_wrapper(depthchroma, depthchroma_list) + +static void test(enum AVPixelFormat input, enum AVPixelFormat expected, + int *pass, int *fail, find_best_t find_best_fn) { - enum AVPixelFormat best = AV_PIX_FMT_NONE; - int i; - for (i = 0; i < FF_ARRAY_ELEMS(pixfmt_list); i++) - best = av_find_best_pix_fmt_of_2(best, pixfmt_list[i], - pixfmt, 0, NULL); - return best; + enum AVPixelFormat output = find_best_fn(input); + if (output != expected) { + printf("Matching %s: got %s, expected %s\n", + av_get_pix_fmt_name(input), + av_get_pix_fmt_name(output), + av_get_pix_fmt_name(expected)); + ++(*fail); + } else + ++(*pass); } int main(void) { - enum AVPixelFormat output; int i, pass = 0, fail = 0; -#define TEST(input, expected) do { \ - output = find_best(input); \ - if (output != expected) { \ - printf("Matching %s: got %s, expected %s\n", \ - av_get_pix_fmt_name(input), \ - av_get_pix_fmt_name(output), \ - av_get_pix_fmt_name(expected)); \ - ++fail; \ - } else \ - ++pass; \ - } while (0) +#define TEST(input, expected) \ + test(input, expected, &pass, &fail, find_best_base) // Same formats. for (i = 0; i < FF_ARRAY_ELEMS(pixfmt_list); i++) @@ -84,6 +126,7 @@ TEST(AV_PIX_FMT_GBRP, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_0RGB, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48); + TEST(AV_PIX_FMT_VUYX, AV_PIX_FMT_YUV444P); // Formats additionally containing alpha (here ignored). TEST(AV_PIX_FMT_YA8, AV_PIX_FMT_GRAY8); @@ -91,6 +134,7 @@ TEST(AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P); TEST(AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P); TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P); + TEST(AV_PIX_FMT_VUYA, AV_PIX_FMT_YUV444P); TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16); TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24); TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24); @@ -135,6 +179,55 @@ // Opaque formats are least unlike each other. TEST(AV_PIX_FMT_DXVA2_VLD, AV_PIX_FMT_VDPAU); +#define TEST_SEMIPLANAR(input, expected) \ + test(input, expected, &pass, &fail, find_best_seminplanar) + + // Same formats. + for (i = 0; i < FF_ARRAY_ELEMS(semiplanar_list); i++) + TEST_SEMIPLANAR(semiplanar_list[i], semiplanar_list[i]); + + // Formats containing the same data in different layouts. + TEST_SEMIPLANAR(AV_PIX_FMT_YUV420P, AV_PIX_FMT_NV12); + TEST_SEMIPLANAR(AV_PIX_FMT_YUV420P10, AV_PIX_FMT_P010); + TEST_SEMIPLANAR(AV_PIX_FMT_YUV420P12, AV_PIX_FMT_P012); + TEST_SEMIPLANAR(AV_PIX_FMT_YUV420P16, AV_PIX_FMT_P016); + TEST_SEMIPLANAR(AV_PIX_FMT_YUV420P9, AV_PIX_FMT_P010); + +#define TEST_PACKED(input, expected) \ + test(input, expected, &pass, &fail, find_best_packed) + + // Same formats. + for (i = 0; i < FF_ARRAY_ELEMS(packed_list); i++) + TEST_PACKED(packed_list[i], packed_list[i]); + + // Formats containing the same data in different layouts. + TEST_PACKED(AV_PIX_FMT_YUV444P, AV_PIX_FMT_VUYX); + TEST_PACKED(AV_PIX_FMT_YUV444P10, AV_PIX_FMT_XV30); + TEST_PACKED(AV_PIX_FMT_YUV444P12, AV_PIX_FMT_XV36); + TEST_PACKED(AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUYV422); + TEST_PACKED(AV_PIX_FMT_YUV422P10, AV_PIX_FMT_Y210); + TEST_PACKED(AV_PIX_FMT_YUV422P12, AV_PIX_FMT_Y212); + +#define TEST_SUBSAMPLED(input, expected) \ + test(input, expected, &pass, &fail, find_best_subsampled) + + // Same formats. + for (i = 0; i < FF_ARRAY_ELEMS(subsampled_list); i++) + TEST_SUBSAMPLED(subsampled_list[i], subsampled_list[i]); + + TEST_SUBSAMPLED(AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P); + +#define TEST_DEPTH_CHROMA(input, expected) \ + test(input, expected, &pass, &fail, find_best_depthchroma) + + // Same formats. + for (i = 0; i < FF_ARRAY_ELEMS(depthchroma_list); i++) + TEST_DEPTH_CHROMA(depthchroma_list[i], depthchroma_list[i]); + + TEST_DEPTH_CHROMA(AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV444P16); + TEST_DEPTH_CHROMA(AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16); + + printf("%d tests passed, %d tests failed.\n", pass, fail); return !!fail; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/thread.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/thread.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/thread.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/thread.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,6 +24,12 @@ #include "config.h" +#if HAVE_PRCTL +#include +#endif + +#include "error.h" + #if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS #if HAVE_PTHREADS @@ -33,7 +39,6 @@ #include -#include "error.h" #include "log.h" #include "macros.h" @@ -187,4 +192,13 @@ #endif +static inline int ff_thread_setname(const char *name) +{ +#if HAVE_PRCTL + return AVERROR(prctl(PR_SET_NAME, name)); +#endif + + return AVERROR(ENOSYS); +} + #endif /* AVUTIL_THREAD_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/timer.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/timer.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/timer.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/timer.h 2023-03-03 13:29:59.000000000 +0000 @@ -57,6 +57,8 @@ # include "arm/timer.h" #elif ARCH_PPC # include "ppc/timer.h" +#elif ARCH_RISCV +# include "riscv/timer.h" #elif ARCH_X86 # include "x86/timer.h" #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/twofish.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/twofish.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/twofish.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/twofish.h 2023-03-03 13:29:59.000000000 +0000 @@ -59,7 +59,7 @@ * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param count number of 16 byte blocks - * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param iv initialization vector for CBC mode, NULL for ECB mode * @param decrypt 0 for encryption, 1 for decryption */ void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.c 2023-03-03 13:29:59.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "avassert.h" +#include "intmath.h" #include "cpu.h" #include "qsort.h" #include "bprint.h" @@ -38,13 +40,42 @@ return 0; } +int ff_tx_gen_pfa_input_map(AVTXContext *s, FFTXCodeletOptions *opts, + int d1, int d2) +{ + const int sl = d1*d2; + + s->map = av_malloc(s->len*sizeof(*s->map)); + if (!s->map) + return AVERROR(ENOMEM); + + for (int k = 0; k < s->len; k += sl) { + if (s->inv || (opts && opts->map_dir == FF_TX_MAP_SCATTER)) { + for (int m = 0; m < d2; m++) + for (int n = 0; n < d1; n++) + s->map[k + ((m*d1 + n*d2) % (sl))] = m*d1 + n; + } else { + for (int m = 0; m < d2; m++) + for (int n = 0; n < d1; n++) + s->map[k + m*d1 + n] = (m*d1 + n*d2) % (sl); + } + + if (s->inv) + for (int w = 1; w <= ((sl) >> 1); w++) + FFSWAP(int, s->map[k + w], s->map[k + sl - w]); + } + + s->map_dir = opts ? opts->map_dir : FF_TX_MAP_GATHER; + + return 0; +} + /* Guaranteed to work for any n, m where gcd(n, m) == 1 */ -int ff_tx_gen_compound_mapping(AVTXContext *s, int n, int m) +int ff_tx_gen_compound_mapping(AVTXContext *s, FFTXCodeletOptions *opts, + int inv, int n, int m) { int *in_map, *out_map; - const int inv = s->inv; const int len = n*m; /* Will not be equal to s->len for MDCTs */ - const int mdct = TYPE_IS(MDCT, s->type); int m_inv, n_inv; /* Make sure the numbers are coprime */ @@ -61,15 +92,22 @@ out_map = s->map + len; /* Ruritanian map for input, CRT map for output, can be swapped */ - for (int j = 0; j < m; j++) { - for (int i = 0; i < n; i++) { - /* Shifted by 1 to simplify MDCTs */ - in_map[j*n + i] = ((i*m + j*n) % len) << mdct; - out_map[(i*m*m_inv + j*n*n_inv) % len] = i*m + j; + if (opts && opts->map_dir == FF_TX_MAP_SCATTER) { + for (int j = 0; j < m; j++) { + for (int i = 0; i < n; i++) { + in_map[(i*m + j*n) % len] = j*n + i; + out_map[(i*m*m_inv + j*n*n_inv) % len] = i*m + j; + } + } + } else { + for (int j = 0; j < m; j++) { + for (int i = 0; i < n; i++) { + in_map[j*n + i] = (i*m + j*n) % len; + out_map[(i*m*m_inv + j*n*n_inv) % len] = i*m + j; + } } } - /* Change transform direction by reversing all ACs */ if (inv) { for (int i = 0; i < m; i++) { int *in = &in_map[i*n + 1]; /* Skip the DC */ @@ -78,17 +116,7 @@ } } - /* Our 15-point transform is also a compound one, so embed its input map */ - if (n == 15) { - for (int k = 0; k < m; k++) { - int tmp[15]; - memcpy(tmp, &in_map[k*15], 15*sizeof(*tmp)); - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 3; j++) - in_map[k*15 + i*3 + j] = tmp[(i*3 + j*5) % 15]; - } - } - } + s->map_dir = opts ? opts->map_dir : FF_TX_MAP_GATHER; return 0; } @@ -104,27 +132,29 @@ return split_radix_permutation(i, len, inv) * 4 + 1 - 2*(!(i & len) ^ inv); } -int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup) +int ff_tx_gen_ptwo_revtab(AVTXContext *s, FFTXCodeletOptions *opts) { int len = s->len; if (!(s->map = av_malloc(len*sizeof(*s->map)))) return AVERROR(ENOMEM); - if (invert_lookup) { + if (opts && opts->map_dir == FF_TX_MAP_SCATTER) { for (int i = 0; i < s->len; i++) - s->map[i] = -split_radix_permutation(i, len, s->inv) & (len - 1); + s->map[-split_radix_permutation(i, len, s->inv) & (len - 1)] = i; } else { for (int i = 0; i < s->len; i++) - s->map[-split_radix_permutation(i, len, s->inv) & (len - 1)] = i; + s->map[i] = -split_radix_permutation(i, len, s->inv) & (len - 1); } + s->map_dir = opts ? opts->map_dir : FF_TX_MAP_GATHER; + return 0; } -int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s) +int ff_tx_gen_inplace_map(AVTXContext *s, int len) { - int *src_map, out_map_idx = 0, len = s->len; + int *src_map, out_map_idx = 0; if (!s->sub || !s->sub->map) return AVERROR(EINVAL); @@ -207,45 +237,58 @@ 1, 1, len >> 1, basis, dual_stride, inv_lookup); } -int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int invert_lookup, +int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int len, int inv, + FFTXCodeletOptions *opts, int basis, int dual_stride) { - int len = s->len; - int inv = s->inv; - - if (!(s->map = av_mallocz(len*sizeof(*s->map)))) - return AVERROR(ENOMEM); - basis >>= 1; if (len < basis) return AVERROR(EINVAL); + if (!(s->map = av_mallocz(len*sizeof(*s->map)))) + return AVERROR(ENOMEM); + av_assert0(!dual_stride || !(dual_stride & (dual_stride - 1))); av_assert0(dual_stride <= basis); + parity_revtab_generator(s->map, len, inv, 0, 0, 0, len, - basis, dual_stride, invert_lookup); + basis, dual_stride, + opts ? opts->map_dir == FF_TX_MAP_GATHER : FF_TX_MAP_GATHER); + + s->map_dir = opts ? opts->map_dir : FF_TX_MAP_GATHER; return 0; } -static void reset_ctx(AVTXContext *s) +static void reset_ctx(AVTXContext *s, int free_sub) { if (!s) return; if (s->sub) - for (int i = 0; i < s->nb_sub; i++) - reset_ctx(&s->sub[i]); + for (int i = 0; i < TX_MAX_SUB; i++) + reset_ctx(&s->sub[i], free_sub + 1); - if (s->cd_self->uninit) + if (s->cd_self && s->cd_self->uninit) s->cd_self->uninit(s); - av_freep(&s->sub); + if (free_sub) + av_freep(&s->sub); + av_freep(&s->map); av_freep(&s->exp); av_freep(&s->tmp); - memset(s, 0, sizeof(*s)); + /* Nothing else needs to be reset, it gets overwritten if another + * ff_tx_init_subtx() call is made. */ + s->nb_sub = 0; + s->opaque = NULL; + memset(s->fn, 0, sizeof(*s->fn)); +} + +void ff_tx_clear_ctx(AVTXContext *s) +{ + reset_ctx(s, 0); } av_cold void av_tx_uninit(AVTXContext **ctx) @@ -253,7 +296,7 @@ if (!(*ctx)) return; - reset_ctx(*ctx); + reset_ctx(*ctx, 1); av_freep(ctx); } @@ -292,6 +335,209 @@ NULL, }; +/* Array of all compiled codelet lists. Order is irrelevant. */ +static const FFTXCodelet * const * const codelet_list[] = { + ff_tx_codelet_list_float_c, + ff_tx_codelet_list_double_c, + ff_tx_codelet_list_int32_c, + ff_tx_null_list, +#if HAVE_X86ASM + ff_tx_codelet_list_float_x86, +#endif +#if ARCH_AARCH64 + ff_tx_codelet_list_float_aarch64, +#endif +}; +static const int codelet_list_num = FF_ARRAY_ELEMS(codelet_list); + +static const int cpu_slow_mask = AV_CPU_FLAG_SSE2SLOW | AV_CPU_FLAG_SSE3SLOW | + AV_CPU_FLAG_ATOM | AV_CPU_FLAG_SSSE3SLOW | + AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER; + +static const int cpu_slow_penalties[][2] = { + { AV_CPU_FLAG_SSE2SLOW, 1 + 64 }, + { AV_CPU_FLAG_SSE3SLOW, 1 + 64 }, + { AV_CPU_FLAG_SSSE3SLOW, 1 + 64 }, + { AV_CPU_FLAG_ATOM, 1 + 128 }, + { AV_CPU_FLAG_AVXSLOW, 1 + 128 }, + { AV_CPU_FLAG_SLOW_GATHER, 1 + 32 }, +}; + +static int get_codelet_prio(const FFTXCodelet *cd, int cpu_flags, int len) +{ + int prio = cd->prio; + int max_factor = 0; + + /* If the CPU has a SLOW flag, and the instruction is also flagged + * as being slow for such, reduce its priority */ + for (int i = 0; i < FF_ARRAY_ELEMS(cpu_slow_penalties); i++) { + if ((cpu_flags & cd->cpu_flags) & cpu_slow_penalties[i][0]) + prio -= cpu_slow_penalties[i][1]; + } + + /* Prioritize aligned-only codelets */ + if ((cd->flags & FF_TX_ALIGNED) && !(cd->flags & AV_TX_UNALIGNED)) + prio += 64; + + /* Codelets for specific lengths are generally faster */ + if ((len == cd->min_len) && (len == cd->max_len)) + prio += 64; + + /* Forward-only or inverse-only transforms are generally better */ + if ((cd->flags & (FF_TX_FORWARD_ONLY | FF_TX_INVERSE_ONLY))) + prio += 64; + + /* Larger factors are generally better */ + for (int i = 0; i < TX_MAX_SUB; i++) + max_factor = FFMAX(cd->factors[i], max_factor); + if (max_factor) + prio += 16*max_factor; + + return prio; +} + +typedef struct FFTXLenDecomp { + int len; + int len2; + int prio; + const FFTXCodelet *cd; +} FFTXLenDecomp; + +static int cmp_decomp(FFTXLenDecomp *a, FFTXLenDecomp *b) +{ + return FFDIFFSIGN(b->prio, a->prio); +} + +int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, + int len, int inv) +{ + int nb_decomp = 0; + FFTXLenDecomp ld[TX_MAX_DECOMPOSITIONS]; + int codelet_list_idx = codelet_list_num; + + const int cpu_flags = av_get_cpu_flags(); + + /* Loop through all codelets in all codelet lists to find matches + * to the requirements */ + while (codelet_list_idx--) { + const FFTXCodelet * const * list = codelet_list[codelet_list_idx]; + const FFTXCodelet *cd = NULL; + + while ((cd = *list++)) { + int fl = len; + int skip = 0, prio; + int factors_product = 1, factors_mod = 0; + + if (nb_decomp >= TX_MAX_DECOMPOSITIONS) + goto sort; + + /* Check if the type matches */ + if (cd->type != TX_TYPE_ANY && type != cd->type) + continue; + + /* 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)) + continue; + + /* Check if the CPU supports the required ISA */ + if (cd->cpu_flags != FF_TX_CPU_FLAGS_ALL && + !(cpu_flags & (cd->cpu_flags & ~cpu_slow_mask))) + continue; + + for (int i = 0; i < TX_MAX_FACTORS; i++) { + if (!cd->factors[i] || (fl == 1)) + break; + + if (cd->factors[i] == TX_FACTOR_ANY) { + factors_mod++; + factors_product *= fl; + } else if (!(fl % cd->factors[i])) { + factors_mod++; + if (cd->factors[i] == 2) { + int b = ff_ctz(fl); + fl >>= b; + factors_product <<= b; + } else { + do { + fl /= cd->factors[i]; + factors_product *= cd->factors[i]; + } while (!(fl % cd->factors[i])); + } + } + } + + /* Disqualify if factor requirements are not satisfied or if trivial */ + if ((factors_mod < cd->nb_factors) || (len == factors_product)) + continue; + + if (av_gcd(factors_product, fl) != 1) + continue; + + /* Check if length is supported and factorization was successful */ + if ((factors_product < cd->min_len) || + (cd->max_len != TX_LEN_UNLIMITED && (factors_product > cd->max_len))) + continue; + + prio = get_codelet_prio(cd, cpu_flags, factors_product) * factors_product; + + /* Check for duplicates */ + for (int i = 0; i < nb_decomp; i++) { + if (factors_product == ld[i].len) { + /* Update priority if new one is higher */ + if (prio > ld[i].prio) + ld[i].prio = prio; + skip = 1; + break; + } + } + + /* Add decomposition if unique */ + if (!skip) { + ld[nb_decomp].cd = cd; + ld[nb_decomp].len = factors_product; + ld[nb_decomp].len2 = fl; + ld[nb_decomp].prio = prio; + nb_decomp++; + } + } + } + + if (!nb_decomp) + return AVERROR(EINVAL); + +sort: + AV_QSORT(ld, nb_decomp, FFTXLenDecomp, cmp_decomp); + + for (int i = 0; i < nb_decomp; i++) { + if (ld[i].cd->nb_factors > 1) + dst[i] = ld[i].len2; + else + dst[i] = ld[i].len; + } + + return nb_decomp; +} + +int ff_tx_gen_default_map(AVTXContext *s, FFTXCodeletOptions *opts) +{ + s->map = av_malloc(s->len*sizeof(*s->map)); + if (!s->map) + return AVERROR(ENOMEM); + + s->map[0] = 0; /* DC is always at the start */ + if (s->inv) /* Reversing the ACs flips the transform direction */ + for (int i = 1; i < s->len; i++) + s->map[i] = s->len - i; + else + for (int i = 1; i < s->len; i++) + s->map[i] = i; + + s->map_dir = FF_TX_MAP_GATHER; + + return 0; +} + #if !CONFIG_SMALL static void print_flags(AVBPrint *bp, uint64_t f) { @@ -314,6 +560,8 @@ av_bprintf(bp, "%spreshuf", prev > 1 ? sep : ""); if ((f & AV_TX_FULL_IMDCT) && ++prev) av_bprintf(bp, "%simdct_full", prev > 1 ? sep : ""); + if ((f & FF_TX_ASM_CALL) && ++prev) + av_bprintf(bp, "%sasm_call", prev > 1 ? sep : ""); av_bprintf(bp, "]"); } @@ -333,7 +581,7 @@ "unknown"); } -static void print_cd_info(const FFTXCodelet *cd, int prio, int print_prio) +static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio) { AVBPrint bp = { 0 }; av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); @@ -343,33 +591,47 @@ print_type(&bp, cd->type); av_bprintf(&bp, ", len: "); - if (cd->min_len != cd->max_len) - av_bprintf(&bp, "[%i, ", cd->min_len); + if (!len) { + if (cd->min_len != cd->max_len) + av_bprintf(&bp, "[%i, ", cd->min_len); - if (cd->max_len == TX_LEN_UNLIMITED) - av_bprintf(&bp, "∞"); - else - av_bprintf(&bp, "%i", cd->max_len); - - av_bprintf(&bp, "%s, factors: [", cd->min_len != cd->max_len ? "]" : ""); - for (int i = 0; i < TX_MAX_SUB; i++) { - if (i && cd->factors[i]) - av_bprintf(&bp, ", "); - if (cd->factors[i] == TX_FACTOR_ANY) - av_bprintf(&bp, "any"); - else if (cd->factors[i]) - av_bprintf(&bp, "%i", cd->factors[i]); + if (cd->max_len == TX_LEN_UNLIMITED) + av_bprintf(&bp, "∞"); else - break; + av_bprintf(&bp, "%i", cd->max_len); + } else { + av_bprintf(&bp, "%i", len); } - av_bprintf(&bp, "], "); + if (cd->factors[1]) { + av_bprintf(&bp, "%s, factors", !len && cd->min_len != cd->max_len ? "]" : ""); + if (!cd->nb_factors) + av_bprintf(&bp, ": ["); + else + av_bprintf(&bp, "[%i]: [", cd->nb_factors); + + for (int i = 0; i < TX_MAX_FACTORS; i++) { + if (i && cd->factors[i]) + av_bprintf(&bp, ", "); + if (cd->factors[i] == TX_FACTOR_ANY) + av_bprintf(&bp, "any"); + else if (cd->factors[i]) + av_bprintf(&bp, "%i", cd->factors[i]); + else + break; + } + + av_bprintf(&bp, "], "); + } else { + av_bprintf(&bp, "%s, factor: %i, ", + !len && cd->min_len != cd->max_len ? "]" : "", cd->factors[0]); + } print_flags(&bp, cd->flags); if (print_prio) av_bprintf(&bp, ", prio: %i", prio); - av_log(NULL, AV_LOG_VERBOSE, "%s\n", bp.str); + av_log(NULL, AV_LOG_DEBUG, "%s\n", bp.str); } static void print_tx_structure(AVTXContext *s, int depth) @@ -377,9 +639,9 @@ const FFTXCodelet *cd = s->cd_self; for (int i = 0; i <= depth; i++) - av_log(NULL, AV_LOG_VERBOSE, " "); + av_log(NULL, AV_LOG_DEBUG, " "); - print_cd_info(cd, cd->prio, 0); + print_cd_info(cd, cd->prio, s->len, 0); for (int i = 0; i < s->nb_sub; i++) print_tx_structure(&s->sub[i], depth + 1); @@ -399,42 +661,38 @@ /* We want all factors to completely cover the length */ static inline int check_cd_factors(const FFTXCodelet *cd, int len) { - int all_flag = 0; + int matches = 0, any_flag = 0; - for (int i = 0; i < TX_MAX_SUB; i++) { + for (int i = 0; i < TX_MAX_FACTORS; i++) { int factor = cd->factors[i]; - /* Conditions satisfied */ - if (len == 1) - return 1; - - /* No more factors */ - if (!factor) { - break; - } else if (factor == TX_FACTOR_ANY) { - all_flag = 1; + if (factor == TX_FACTOR_ANY) { + any_flag = 1; + matches++; continue; - } - - if (factor == 2) { /* Fast path */ + } else if (len <= 1 || !factor) { + break; + } else if (factor == 2) { /* Fast path */ int bits_2 = ff_ctz(len); if (!bits_2) - return 0; /* Factor not supported */ + continue; /* Factor not supported */ len >>= bits_2; + matches++; } else { int res = len % factor; if (res) - return 0; /* Factor not supported */ + continue; /* Factor not supported */ while (!res) { len /= factor; res = len % factor; } + matches++; } } - return all_flag || (len == 1); + return (cd->nb_factors <= matches) && (any_flag || len == 1); } av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, @@ -445,44 +703,21 @@ AVTXContext *sub = NULL; TXCodeletMatch *cd_tmp, *cd_matches = NULL; unsigned int cd_matches_size = 0; + int codelet_list_idx = codelet_list_num; int nb_cd_matches = 0; #if !CONFIG_SMALL AVBPrint bp = { 0 }; #endif - /* Array of all compiled codelet lists. Order is irrelevant. */ - const FFTXCodelet * const * const codelet_list[] = { - ff_tx_codelet_list_float_c, - ff_tx_codelet_list_double_c, - ff_tx_codelet_list_int32_c, - ff_tx_null_list, -#if HAVE_X86ASM - ff_tx_codelet_list_float_x86, -#endif - }; - int codelet_list_num = FF_ARRAY_ELEMS(codelet_list); - /* We still accept functions marked with SLOW, even if the CPU is * marked with the same flag, but we give them lower priority. */ const int cpu_flags = av_get_cpu_flags(); - const int slow_mask = AV_CPU_FLAG_SSE2SLOW | AV_CPU_FLAG_SSE3SLOW | - AV_CPU_FLAG_ATOM | AV_CPU_FLAG_SSSE3SLOW | - AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER; - - static const int slow_penalties[][2] = { - { AV_CPU_FLAG_SSE2SLOW, 1 + 64 }, - { AV_CPU_FLAG_SSE3SLOW, 1 + 64 }, - { AV_CPU_FLAG_SSSE3SLOW, 1 + 64 }, - { AV_CPU_FLAG_ATOM, 1 + 128 }, - { AV_CPU_FLAG_AVXSLOW, 1 + 128 }, - { AV_CPU_FLAG_SLOW_GATHER, 1 + 32 }, - }; /* Flags the transform wants */ 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; + uint64_t inv_req_mask = AV_TX_FULL_IMDCT | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL; /* Unaligned codelets are compatible with the aligned flag */ if (req_flags & FF_TX_ALIGNED) @@ -496,13 +731,11 @@ /* Loop through all codelets in all codelet lists to find matches * to the requirements */ - while (codelet_list_num--) { - const FFTXCodelet * const * list = codelet_list[codelet_list_num]; + while (codelet_list_idx--) { + const FFTXCodelet * const * list = codelet_list[codelet_list_idx]; const FFTXCodelet *cd = NULL; while ((cd = *list++)) { - int max_factor = 0; - /* Check if the type matches */ if (cd->type != TX_TYPE_ANY && type != cd->type) continue; @@ -523,7 +756,7 @@ /* Check if the CPU supports the required ISA */ if (cd->cpu_flags != FF_TX_CPU_FLAGS_ALL && - !(cpu_flags & (cd->cpu_flags & ~slow_mask))) + !(cpu_flags & (cd->cpu_flags & ~cpu_slow_mask))) continue; /* Check for factors */ @@ -540,33 +773,7 @@ cd_matches = cd_tmp; cd_matches[nb_cd_matches].cd = cd; - cd_matches[nb_cd_matches].prio = cd->prio; - - /* If the CPU has a SLOW flag, and the instruction is also flagged - * as being slow for such, reduce its priority */ - for (int i = 0; i < FF_ARRAY_ELEMS(slow_penalties); i++) { - if ((cpu_flags & cd->cpu_flags) & slow_penalties[i][0]) - cd_matches[nb_cd_matches].prio -= slow_penalties[i][1]; - } - - /* Prioritize aligned-only codelets */ - if ((cd->flags & FF_TX_ALIGNED) && !(cd->flags & AV_TX_UNALIGNED)) - cd_matches[nb_cd_matches].prio += 64; - - /* Codelets for specific lengths are generally faster */ - if ((len == cd->min_len) && (len == cd->max_len)) - cd_matches[nb_cd_matches].prio += 64; - - /* Forward-only or inverse-only transforms are generally better */ - if ((cd->flags & (FF_TX_FORWARD_ONLY | FF_TX_INVERSE_ONLY))) - cd_matches[nb_cd_matches].prio += 64; - - /* Larger factors are generally better */ - for (int i = 0; i < TX_MAX_SUB; i++) - max_factor = FFMAX(cd->factors[i], max_factor); - if (max_factor) - cd_matches[nb_cd_matches].prio += 16*max_factor; - + cd_matches[nb_cd_matches].prio = get_codelet_prio(cd, cpu_flags, len); nb_cd_matches++; } } @@ -591,11 +798,11 @@ AV_QSORT(cd_matches, nb_cd_matches, TXCodeletMatch, cmp_matches); #if !CONFIG_SMALL - av_log(NULL, AV_LOG_VERBOSE, "%s\n", bp.str); + av_log(NULL, AV_LOG_DEBUG, "%s\n", bp.str); for (int i = 0; i < nb_cd_matches; i++) { - av_log(NULL, AV_LOG_VERBOSE, " %i: ", i + 1); - print_cd_info(cd_matches[i].cd, cd_matches[i].prio, 1); + av_log(NULL, AV_LOG_DEBUG, " %i: ", i + 1); + print_cd_info(cd_matches[i].cd, cd_matches[i].prio, 0, 1); } #endif @@ -615,7 +822,7 @@ sctx->len = len; sctx->inv = inv; sctx->type = type; - sctx->flags = flags; + sctx->flags = cd->flags | flags; sctx->cd_self = cd; s->fn[s->nb_sub] = cd->function; @@ -626,6 +833,33 @@ ret = cd->init(sctx, cd, flags, opts, len, inv, scale); if (ret >= 0) { + if (opts && opts->map_dir != FF_TX_MAP_NONE && + sctx->map_dir == FF_TX_MAP_NONE) { + /* If a specific map direction was requested, and it doesn't + * exist, create one.*/ + sctx->map = av_malloc(len*sizeof(*sctx->map)); + if (!sctx->map) { + ret = AVERROR(ENOMEM); + goto end; + } + + for (int i = 0; i < len; i++) + sctx->map[i] = i; + } else if (opts && (opts->map_dir != sctx->map_dir)) { + int *tmp = av_malloc(len*sizeof(*sctx->map)); + if (!tmp) { + ret = AVERROR(ENOMEM); + goto end; + } + + memcpy(tmp, sctx->map, len*sizeof(*sctx->map)); + + for (int i = 0; i < len; i++) + sctx->map[tmp[i]] = i; + + av_free(tmp); + } + s->nb_sub++; goto end; } @@ -633,7 +867,7 @@ s->fn[s->nb_sub] = NULL; s->cd[s->nb_sub] = NULL; - reset_ctx(sctx); + reset_ctx(sctx, 0); if (ret == AVERROR(ENOMEM)) break; } @@ -675,7 +909,7 @@ *tx = tmp.fn[0]; #if !CONFIG_SMALL - av_log(NULL, AV_LOG_VERBOSE, "Transform tree:\n"); + av_log(NULL, AV_LOG_DEBUG, "Transform tree:\n"); print_tx_structure(*ctx, 0); #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx.h 2023-03-03 13:29:59.000000000 +0000 @@ -75,7 +75,9 @@ * the double variant, it's a 'double'. If scale is NULL, 1.0 will be used * as a default. * - * The stride parameter must be set to the size of a single sample in bytes. + * For forward transforms (R2C), stride must be the spacing between two + * samples in bytes. For inverse transforms, the stride must be set + * to the spacing between two complex values in bytes. * * The forward transform performs a real-to-complex DFT of N samples to * N/2+1 complex values. @@ -89,6 +91,20 @@ AV_TX_DOUBLE_RDFT = 7, AV_TX_INT32_RDFT = 8, + /** + * Real to real (DCT) transforms. + * + * The forward transform is a DCT-II. + * The inverse transform is a DCT-III. + * + * The input array is always overwritten. DCT-III requires that the + * input be padded with 2 extra samples. Stride must be set to the + * spacing between two samples in bytes. + */ + AV_TX_FLOAT_DCT = 9, + AV_TX_DOUBLE_DCT = 10, + AV_TX_INT32_DCT = 11, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -115,9 +131,8 @@ */ enum AVTXFlags { /** - * Performs an in-place transformation on the input. The output argument - * of av_tn_fn() MUST match the input. May be unsupported or slower for some - * transform types. + * Allows for in-place transformations, where input == output. + * May be unsupported or slower for some transform types. */ AV_TX_INPLACE = 1ULL << 0, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_priv.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_priv.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_priv.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_priv.h 2023-03-03 13:29:59.000000000 +0000 @@ -34,6 +34,7 @@ #define MULT(x, m) ((x) * (m)) #define SCALE_TYPE float typedef float TXSample; +typedef float TXUSample; typedef AVComplexFloat TXComplex; #elif defined(TX_DOUBLE) #define TX_TAB(x) x ## _double @@ -45,6 +46,7 @@ #define MULT(x, m) ((x) * (m)) #define SCALE_TYPE double typedef double TXSample; +typedef double TXUSample; typedef AVComplexDouble TXComplex; #elif defined(TX_INT32) #define TX_TAB(x) x ## _int32 @@ -56,6 +58,7 @@ #define MULT(x, m) (((((int64_t)(x)) * (int64_t)(m)) + 0x40000000) >> 31) #define SCALE_TYPE float typedef int32_t TXSample; +typedef uint32_t TXUSample; typedef AVComplexInt32 TXComplex; #else typedef void TXComplex; @@ -71,7 +74,8 @@ .function = TX_FN_NAME(fn, suffix), \ .type = TX_TYPE(tx_type), \ .flags = FF_TX_ALIGNED | FF_TX_OUT_OF_PLACE | cd_flags, \ - .factors = { f1, f2 }, \ + .factors = { (f1), (f2) }, \ + .nb_factors = !!(f1) + !!(f2), \ .min_len = len_min, \ .max_len = len_max, \ .init = init_fn, \ @@ -124,7 +128,7 @@ } while (0) #define UNSCALE(x) ((double)(x)/2147483648.0) -#define RESCALE(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX)) +#define RESCALE(x) (av_clip64(llrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX)) #define FOLD(x, y) ((int32_t)((x) + (unsigned)(y) + 32) >> 6) @@ -145,6 +149,7 @@ #define FF_TX_PRESHUFFLE (1ULL << 61) /* Codelet expects permuted coeffs */ #define FF_TX_INVERSE_ONLY (1ULL << 60) /* For non-orthogonal inverse-only transforms */ #define FF_TX_FORWARD_ONLY (1ULL << 59) /* For non-orthogonal forward-only transforms */ +#define FF_TX_ASM_CALL (1ULL << 58) /* For asm->asm functions only */ typedef enum FFTXCodeletPriority { FF_TX_PRIO_BASE = 0, /* Baseline priority */ @@ -156,15 +161,34 @@ FF_TX_PRIO_MAX = 32768, /* For custom implementations/ASICs */ } FFTXCodeletPriority; +typedef enum FFTXMapDirection { + /* No map. Make a map up. */ + FF_TX_MAP_NONE = 0, + + /* Lookup table must be applied via dst[i] = src[lut[i]]; */ + FF_TX_MAP_GATHER, + + /* Lookup table must be applied via dst[lut[i]] = src[i]; */ + FF_TX_MAP_SCATTER, +} FFTXMapDirection; + /* Codelet options */ typedef struct FFTXCodeletOptions { - int invert_lookup; /* If codelet is flagged as FF_TX_CODELET_PRESHUFFLE, - invert the lookup direction for the map generated */ + /* Request a specific lookup table direction. Codelets MUST put the + * direction in AVTXContext. If the codelet does not respect this, a + * conversion will be performed. */ + FFTXMapDirection map_dir; } FFTXCodeletOptions; +/* Maximum number of factors a codelet may have. Arbitrary. */ +#define TX_MAX_FACTORS 16 + /* Maximum amount of subtransform functions, subtransforms and factors. Arbitrary. */ #define TX_MAX_SUB 4 +/* Maximum number of returned results for ff_tx_decompose_length. Arbitrary. */ +#define TX_MAX_DECOMPOSITIONS 512 + typedef struct FFTXCodelet { const char *name; /* Codelet name, for debugging */ av_tx_fn function; /* Codelet function, != NULL */ @@ -174,13 +198,16 @@ uint64_t flags; /* A combination of AVTXFlags and codelet * flags that describe its properties. */ - int factors[TX_MAX_SUB]; /* Length factors */ + int factors[TX_MAX_FACTORS]; /* Length factors. MUST be coprime. */ #define TX_FACTOR_ANY -1 /* When used alone, signals that the codelet * supports all factors. Otherwise, if other * factors are present, it signals that whatever * remains will be supported, as long as the * other factors are a component of the length */ + int nb_factors; /* Minimum number of factors that have to + * be a modulo of the length. Must not be 0. */ + int min_len; /* Minimum length of transform, must be >= 1 */ int max_len; /* Maximum length of transform */ #define TX_LEN_UNLIMITED -1 /* Special length value to permit all lengths */ @@ -208,7 +235,8 @@ int len; /* Length of the transform */ int inv; /* If transform is inverse */ int *map; /* Lookup table(s) */ - TXComplex *exp; /* Any non-pre-baked multiplication factors needed */ + TXComplex *exp; /* Any non-pre-baked multiplication factors, + * or extra temporary buffer */ TXComplex *tmp; /* Temporary buffer, if needed */ AVTXContext *sub; /* Subtransform context(s), if needed */ @@ -226,11 +254,32 @@ enum AVTXType type; /* Type of transform */ uint64_t flags; /* A combination of AVTXFlags and * codelet flags used when creating */ + FFTXMapDirection map_dir; /* Direction of AVTXContext->map */ float scale_f; double scale_d; void *opaque; /* Free to use by implementations */ }; +/* This function embeds a Ruritanian PFA input map into an existing lookup table + * to avoid double permutation. This allows for compound factors to be + * synthesized as fast PFA FFTs and embedded into either other or standalone + * transforms. + * The output CRT map must still be pre-baked into the transform. */ +#define TX_EMBED_INPUT_PFA_MAP(map, tot_len, d1, d2) \ + do { \ + int mtmp[(d1)*(d2)]; \ + for (int k = 0; k < tot_len; k += (d1)*(d2)) { \ + memcpy(mtmp, &map[k], (d1)*(d2)*sizeof(*mtmp)); \ + for (int m = 0; m < (d2); m++) \ + for (int n = 0; n < (d1); n++) \ + map[k + m*(d1) + n] = mtmp[(m*(d1) + n*(d2)) % ((d1)*(d2))]; \ + } \ + } while (0) + +/* This function generates a Ruritanian PFA input map into s->map. */ +int ff_tx_gen_pfa_input_map(AVTXContext *s, FFTXCodeletOptions *opts, + int d1, int d2); + /* Create a subtransform in the current context with the given parameters. * The flags parameter from FFTXCodelet.init() should be preserved as much * as that's possible. @@ -239,11 +288,26 @@ uint64_t flags, FFTXCodeletOptions *opts, int len, int inv, const void *scale); +/* Clear the context by freeing all tables, maps and subtransforms. */ +void ff_tx_clear_ctx(AVTXContext *s); + +/* Attempt to factorize a length into 2 integers such that + * len / dst1 == dst2, where dst1 and dst2 are coprime. */ +int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, + int len, int inv); + +/* Generate a default map (0->len or 0, (len-1)->1 for inverse transforms) + * for a context. */ +int ff_tx_gen_default_map(AVTXContext *s, FFTXCodeletOptions *opts); + /* * Generates the PFA permutation table into AVTXContext->pfatab. The end table * is appended to the start table. + * The `inv` flag should only be enabled if the lookup tables of subtransforms + * won't get flattened. */ -int ff_tx_gen_compound_mapping(AVTXContext *s, int n, int m); +int ff_tx_gen_compound_mapping(AVTXContext *s, FFTXCodeletOptions *opts, + int inv, int n, int m); /* * Generates a standard-ish (slightly modified) Split-Radix revtab into @@ -251,14 +315,14 @@ * If it's set to 0, it has to be applied like out[map[i]] = in[i], otherwise * if it's set to 1, has to be applied as out[i] = in[map[i]] */ -int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup); +int ff_tx_gen_ptwo_revtab(AVTXContext *s, FFTXCodeletOptions *opts); /* * Generates an index into AVTXContext->inplace_idx that if followed in the * specific order, allows the revtab to be done in-place. The sub-transform * and its map should already be initialized. */ -int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s); +int ff_tx_gen_inplace_map(AVTXContext *s, int len); /* * This generates a parity-based revtab of length len and direction inv. @@ -287,8 +351,12 @@ * functions in AVX mode. * * If length is smaller than basis/2 this function will not do anything. + * + * If inv_lookup is set to 1, it will flip the lookup from out[map[i]] = src[i] + * to out[i] = src[map[i]]. */ -int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int invert_lookup, +int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int len, int inv, + FFTXCodeletOptions *opts, int basis, int dual_stride); /* Typed init function to initialize shared tables. Will initialize all tables @@ -297,14 +365,18 @@ void ff_tx_init_tabs_double(int len); void ff_tx_init_tabs_int32 (int len); -/* Typed init function to initialize an MDCT exptab in a context. */ -int ff_tx_mdct_gen_exp_float (AVTXContext *s); -int ff_tx_mdct_gen_exp_double(AVTXContext *s); -int ff_tx_mdct_gen_exp_int32 (AVTXContext *s); +/* Typed init function to initialize an MDCT exptab in a context. + * If pre_tab is set, duplicates the entire table, with the first + * copy being shuffled according to pre_tab, and the second copy + * being the original. */ +int ff_tx_mdct_gen_exp_float (AVTXContext *s, int *pre_tab); +int ff_tx_mdct_gen_exp_double(AVTXContext *s, int *pre_tab); +int ff_tx_mdct_gen_exp_int32 (AVTXContext *s, int *pre_tab); /* Lists of codelets */ extern const FFTXCodelet * const ff_tx_codelet_list_float_c []; extern const FFTXCodelet * const ff_tx_codelet_list_float_x86 []; +extern const FFTXCodelet * const ff_tx_codelet_list_float_aarch64 []; extern const FFTXCodelet * const ff_tx_codelet_list_double_c []; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/tx_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,38 +27,40 @@ #define TABLE_DEF(name, size) \ DECLARE_ALIGNED(32, TXSample, TX_TAB(ff_tx_tab_ ##name))[size] -#define SR_TABLE(len) \ - TABLE_DEF(len, len/4 + 1) +#define SR_POW2_TABLES \ + SR_TABLE(8) \ + SR_TABLE(16) \ + SR_TABLE(32) \ + SR_TABLE(64) \ + SR_TABLE(128) \ + SR_TABLE(256) \ + SR_TABLE(512) \ + SR_TABLE(1024) \ + SR_TABLE(2048) \ + SR_TABLE(4096) \ + SR_TABLE(8192) \ + SR_TABLE(16384) \ + SR_TABLE(32768) \ + SR_TABLE(65536) \ + SR_TABLE(131072) \ +#define SR_TABLE(len) \ + TABLE_DEF(len, len/4 + 1); /* Power of two tables */ -SR_TABLE(8); -SR_TABLE(16); -SR_TABLE(32); -SR_TABLE(64); -SR_TABLE(128); -SR_TABLE(256); -SR_TABLE(512); -SR_TABLE(1024); -SR_TABLE(2048); -SR_TABLE(4096); -SR_TABLE(8192); -SR_TABLE(16384); -SR_TABLE(32768); -SR_TABLE(65536); -SR_TABLE(131072); +SR_POW2_TABLES +#undef SR_TABLE /* Other factors' tables */ -TABLE_DEF(53, 8); -TABLE_DEF( 7, 6); -TABLE_DEF( 9, 8); +TABLE_DEF(53, 12); +TABLE_DEF( 7, 6); +TABLE_DEF( 9, 8); -typedef struct FFSRTabsInitOnce { +typedef struct FFTabInitData { void (*func)(void); - AVOnce control; int factors[TX_MAX_SUB]; /* Must be sorted high -> low */ -} FFSRTabsInitOnce; +} FFTabInitData; -#define INIT_FF_SR_TAB(len) \ +#define SR_TABLE(len) \ static av_cold void TX_TAB(ff_tx_init_tab_ ##len)(void) \ { \ double freq = 2*M_PI/len; \ @@ -69,51 +71,38 @@ \ *tab = 0; \ } +SR_POW2_TABLES +#undef SR_TABLE -INIT_FF_SR_TAB(8) -INIT_FF_SR_TAB(16) -INIT_FF_SR_TAB(32) -INIT_FF_SR_TAB(64) -INIT_FF_SR_TAB(128) -INIT_FF_SR_TAB(256) -INIT_FF_SR_TAB(512) -INIT_FF_SR_TAB(1024) -INIT_FF_SR_TAB(2048) -INIT_FF_SR_TAB(4096) -INIT_FF_SR_TAB(8192) -INIT_FF_SR_TAB(16384) -INIT_FF_SR_TAB(32768) -INIT_FF_SR_TAB(65536) -INIT_FF_SR_TAB(131072) - -static FFSRTabsInitOnce sr_tabs_init_once[] = { - { TX_TAB(ff_tx_init_tab_8), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_16), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_32), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_64), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_128), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_256), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_512), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_1024), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_2048), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_4096), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_8192), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_16384), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_32768), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_65536), AV_ONCE_INIT }, - { TX_TAB(ff_tx_init_tab_131072), AV_ONCE_INIT }, +static void (*const sr_tabs_init_funcs[])(void) = { +#define SR_TABLE(len) TX_TAB(ff_tx_init_tab_ ##len), + SR_POW2_TABLES +#undef SR_TABLE +}; + +static AVOnce sr_tabs_init_once[] = { +#define SR_TABLE(len) AV_ONCE_INIT, + SR_POW2_TABLES +#undef SR_TABLE }; static av_cold void TX_TAB(ff_tx_init_tab_53)(void) { - TX_TAB(ff_tx_tab_53)[0] = RESCALE(cos(2 * M_PI / 12)); - TX_TAB(ff_tx_tab_53)[1] = RESCALE(cos(2 * M_PI / 12)); - TX_TAB(ff_tx_tab_53)[2] = RESCALE(cos(2 * M_PI / 6)); - TX_TAB(ff_tx_tab_53)[3] = RESCALE(cos(2 * M_PI / 6)); - TX_TAB(ff_tx_tab_53)[4] = RESCALE(cos(2 * M_PI / 5)); + /* 5pt, doubled to eliminate AVX lane shuffles */ + TX_TAB(ff_tx_tab_53)[0] = RESCALE(cos(2 * M_PI / 5)); + TX_TAB(ff_tx_tab_53)[1] = RESCALE(cos(2 * M_PI / 5)); + TX_TAB(ff_tx_tab_53)[2] = RESCALE(cos(2 * M_PI / 10)); + TX_TAB(ff_tx_tab_53)[3] = RESCALE(cos(2 * M_PI / 10)); + TX_TAB(ff_tx_tab_53)[4] = RESCALE(sin(2 * M_PI / 5)); TX_TAB(ff_tx_tab_53)[5] = RESCALE(sin(2 * M_PI / 5)); - TX_TAB(ff_tx_tab_53)[6] = RESCALE(cos(2 * M_PI / 10)); + TX_TAB(ff_tx_tab_53)[6] = RESCALE(sin(2 * M_PI / 10)); TX_TAB(ff_tx_tab_53)[7] = RESCALE(sin(2 * M_PI / 10)); + + /* 3pt */ + TX_TAB(ff_tx_tab_53)[ 8] = RESCALE(cos(2 * M_PI / 12)); + TX_TAB(ff_tx_tab_53)[ 9] = RESCALE(cos(2 * M_PI / 12)); + TX_TAB(ff_tx_tab_53)[10] = RESCALE(cos(2 * M_PI / 6)); + TX_TAB(ff_tx_tab_53)[11] = RESCALE(cos(8 * M_PI / 6)); } static av_cold void TX_TAB(ff_tx_init_tab_7)(void) @@ -138,10 +127,16 @@ TX_TAB(ff_tx_tab_9)[7] = TX_TAB(ff_tx_tab_9)[3] - TX_TAB(ff_tx_tab_9)[4]; } -static FFSRTabsInitOnce nptwo_tabs_init_once[] = { - { TX_TAB(ff_tx_init_tab_53), AV_ONCE_INIT, { 15, 5, 3 } }, - { TX_TAB(ff_tx_init_tab_9), AV_ONCE_INIT, { 9 } }, - { TX_TAB(ff_tx_init_tab_7), AV_ONCE_INIT, { 7 } }, +static const FFTabInitData nptwo_tabs_init_data[] = { + { TX_TAB(ff_tx_init_tab_53), { 15, 5, 3 } }, + { TX_TAB(ff_tx_init_tab_9), { 9 } }, + { TX_TAB(ff_tx_init_tab_7), { 7 } }, +}; + +static AVOnce nptwo_tabs_init_once[] = { + AV_ONCE_INIT, + AV_ONCE_INIT, + AV_ONCE_INIT, }; av_cold void TX_TAB(ff_tx_init_tabs)(int len) @@ -150,23 +145,23 @@ if (factor_2) { int idx = factor_2 - 3; for (int i = 0; i <= idx; i++) - ff_thread_once(&sr_tabs_init_once[i].control, - sr_tabs_init_once[i].func); + ff_thread_once(&sr_tabs_init_once[i], + sr_tabs_init_funcs[i]); len >>= factor_2; } - for (int i = 0; i < FF_ARRAY_ELEMS(nptwo_tabs_init_once); i++) { + for (int i = 0; i < FF_ARRAY_ELEMS(nptwo_tabs_init_data); i++) { int f, f_idx = 0; if (len <= 1) return; - while ((f = nptwo_tabs_init_once[i].factors[f_idx++])) { + while ((f = nptwo_tabs_init_data[i].factors[f_idx++])) { if (f % len) continue; - ff_thread_once(&nptwo_tabs_init_once[i].control, - nptwo_tabs_init_once[i].func); + ff_thread_once(&nptwo_tabs_init_once[i], + nptwo_tabs_init_data[i].func); len /= f; break; } @@ -176,36 +171,37 @@ static av_always_inline void fft3(TXComplex *out, TXComplex *in, ptrdiff_t stride) { - TXComplex tmp[2]; + TXComplex tmp[3]; const TXSample *tab = TX_TAB(ff_tx_tab_53); #ifdef TX_INT32 int64_t mtmp[4]; #endif - BF(tmp[0].re, tmp[1].im, in[1].im, in[2].im); - BF(tmp[0].im, tmp[1].re, in[1].re, in[2].re); + tmp[0] = in[0]; + BF(tmp[1].re, tmp[2].im, in[1].im, in[2].im); + BF(tmp[1].im, tmp[2].re, in[1].re, in[2].re); - out[0*stride].re = in[0].re + tmp[1].re; - out[0*stride].im = in[0].im + tmp[1].im; + out[0*stride].re = tmp[0].re + tmp[2].re; + out[0*stride].im = tmp[0].im + tmp[2].im; #ifdef TX_INT32 - mtmp[0] = (int64_t)tab[0] * tmp[0].re; - mtmp[1] = (int64_t)tab[1] * tmp[0].im; - mtmp[2] = (int64_t)tab[2] * tmp[1].re; - mtmp[3] = (int64_t)tab[2] * tmp[1].im; - out[1*stride].re = in[0].re - (mtmp[2] + mtmp[0] + 0x40000000 >> 31); - out[1*stride].im = in[0].im - (mtmp[3] - mtmp[1] + 0x40000000 >> 31); - out[2*stride].re = in[0].re - (mtmp[2] - mtmp[0] + 0x40000000 >> 31); - out[2*stride].im = in[0].im - (mtmp[3] + mtmp[1] + 0x40000000 >> 31); + mtmp[0] = (int64_t)tab[ 8] * tmp[1].re; + mtmp[1] = (int64_t)tab[ 9] * tmp[1].im; + mtmp[2] = (int64_t)tab[10] * tmp[2].re; + mtmp[3] = (int64_t)tab[10] * tmp[2].im; + out[1*stride].re = tmp[0].re - (mtmp[2] + mtmp[0] + 0x40000000 >> 31); + out[1*stride].im = tmp[0].im - (mtmp[3] - mtmp[1] + 0x40000000 >> 31); + out[2*stride].re = tmp[0].re - (mtmp[2] - mtmp[0] + 0x40000000 >> 31); + out[2*stride].im = tmp[0].im - (mtmp[3] + mtmp[1] + 0x40000000 >> 31); #else - tmp[0].re = tab[0] * tmp[0].re; - tmp[0].im = tab[1] * tmp[0].im; - tmp[1].re = tab[2] * tmp[1].re; - tmp[1].im = tab[2] * tmp[1].im; - out[1*stride].re = in[0].re - tmp[1].re + tmp[0].re; - out[1*stride].im = in[0].im - tmp[1].im - tmp[0].im; - out[2*stride].re = in[0].re - tmp[1].re - tmp[0].re; - out[2*stride].im = in[0].im - tmp[1].im + tmp[0].im; + tmp[1].re = tab[ 8] * tmp[1].re; + tmp[1].im = tab[ 9] * tmp[1].im; + tmp[2].re = tab[10] * tmp[2].re; + tmp[2].im = tab[10] * tmp[2].im; + out[1*stride].re = tmp[0].re - tmp[2].re + tmp[1].re; + out[1*stride].im = tmp[0].im - tmp[2].im - tmp[1].im; + out[2*stride].re = tmp[0].re - tmp[2].re - tmp[1].re; + out[2*stride].im = tmp[0].im - tmp[2].im + tmp[1].im; #endif } @@ -213,35 +209,36 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ ptrdiff_t stride) \ { \ - TXComplex z0[4], t[6]; \ + TXComplex dc, z0[4], t[6]; \ const TXSample *tab = TX_TAB(ff_tx_tab_53); \ \ + dc = in[0]; \ BF(t[1].im, t[0].re, in[1].re, in[4].re); \ BF(t[1].re, t[0].im, in[1].im, in[4].im); \ 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 = in[0].re + t[0].re + t[2].re; \ - out[D0*stride].im = in[0].im + t[0].im + t[2].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; \ \ - SMUL(t[4].re, t[0].re, tab[4], tab[6], t[2].re, t[0].re); \ - SMUL(t[4].im, t[0].im, tab[4], tab[6], t[2].im, t[0].im); \ - CMUL(t[5].re, t[1].re, tab[5], tab[7], t[3].re, t[1].re); \ - CMUL(t[5].im, t[1].im, tab[5], tab[7], t[3].im, t[1].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); \ + CMUL(t[5].re, t[1].re, tab[4], tab[6], t[3].re, t[1].re); \ + CMUL(t[5].im, t[1].im, tab[4], tab[6], t[3].im, t[1].im); \ \ BF(z0[0].re, z0[3].re, t[0].re, t[1].re); \ BF(z0[0].im, z0[3].im, t[0].im, t[1].im); \ 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 = in[0].re + z0[3].re; \ - out[D1*stride].im = in[0].im + z0[0].im; \ - out[D2*stride].re = in[0].re + z0[2].re; \ - out[D2*stride].im = in[0].im + z0[1].im; \ - out[D3*stride].re = in[0].re + z0[1].re; \ - out[D3*stride].im = in[0].im + z0[2].im; \ - out[D4*stride].re = in[0].re + z0[0].re; \ - out[D4*stride].im = in[0].im + z0[3].im; \ + 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; \ } DECL_FFT5(fft5, 0, 1, 2, 3, 4) @@ -252,12 +249,13 @@ static av_always_inline void fft7(TXComplex *out, TXComplex *in, ptrdiff_t stride) { - TXComplex t[6], z[3]; + TXComplex dc, t[6], z[3]; const TXComplex *tab = (const TXComplex *)TX_TAB(ff_tx_tab_7); #ifdef TX_INT32 int64_t mtmp[12]; #endif + dc = in[0]; BF(t[1].re, t[0].re, in[1].re, in[6].re); BF(t[1].im, t[0].im, in[1].im, in[6].im); BF(t[3].re, t[2].re, in[2].re, in[5].re); @@ -265,8 +263,8 @@ BF(t[5].re, t[4].re, in[3].re, in[4].re); BF(t[5].im, t[4].im, in[3].im, in[4].im); - out[0*stride].re = in[0].re + t[0].re + t[2].re + t[4].re; - out[0*stride].im = in[0].im + t[0].im + t[2].im + t[4].im; + out[0*stride].re = dc.re + t[0].re + t[2].re + t[4].re; + out[0*stride].im = dc.im + t[0].im + t[2].im + t[4].im; #ifdef TX_INT32 /* NOTE: it's possible to do this with 16 mults but 72 adds */ mtmp[ 0] = ((int64_t)tab[0].re)*t[0].re - ((int64_t)tab[2].re)*t[4].re; @@ -322,29 +320,30 @@ BF(t[3].im, z[1].im, z[1].im, t[2].im); BF(t[5].im, z[2].im, z[2].im, t[4].im); - out[1*stride].re = in[0].re + z[0].re; - out[1*stride].im = in[0].im + t[1].im; - out[2*stride].re = in[0].re + t[3].re; - out[2*stride].im = in[0].im + z[1].im; - out[3*stride].re = in[0].re + z[2].re; - out[3*stride].im = in[0].im + t[5].im; - out[4*stride].re = in[0].re + t[5].re; - out[4*stride].im = in[0].im + z[2].im; - out[5*stride].re = in[0].re + z[1].re; - out[5*stride].im = in[0].im + t[3].im; - out[6*stride].re = in[0].re + t[1].re; - out[6*stride].im = in[0].im + z[0].im; + out[1*stride].re = dc.re + z[0].re; + out[1*stride].im = dc.im + t[1].im; + out[2*stride].re = dc.re + t[3].re; + out[2*stride].im = dc.im + z[1].im; + out[3*stride].re = dc.re + z[2].re; + out[3*stride].im = dc.im + t[5].im; + out[4*stride].re = dc.re + t[5].re; + out[4*stride].im = dc.im + z[2].im; + out[5*stride].re = dc.re + z[1].re; + out[5*stride].im = dc.im + t[3].im; + out[6*stride].re = dc.re + t[1].re; + out[6*stride].im = dc.im + z[0].im; } static av_always_inline void fft9(TXComplex *out, TXComplex *in, ptrdiff_t stride) { const TXComplex *tab = (const TXComplex *)TX_TAB(ff_tx_tab_9); - TXComplex t[16], w[4], x[5], y[5], z[2]; + TXComplex dc, t[16], w[4], x[5], y[5], z[2]; #ifdef TX_INT32 int64_t mtmp[12]; #endif + dc = in[0]; BF(t[1].re, t[0].re, in[1].re, in[8].re); BF(t[1].im, t[0].im, in[1].im, in[8].im); BF(t[3].re, t[2].re, in[2].re, in[7].re); @@ -363,8 +362,8 @@ w[3].re = t[3].re + t[7].re; w[3].im = t[3].im + t[7].im; - z[0].re = in[0].re + t[4].re; - z[0].im = in[0].im + t[4].im; + z[0].re = dc.re + t[4].re; + z[0].im = dc.im + t[4].im; z[1].re = t[0].re + t[2].re + t[6].re; z[1].im = t[0].im + t[2].im + t[6].im; @@ -416,8 +415,8 @@ x[3].re = z[0].re + tab[0].re*z[1].re; x[3].im = z[0].im + tab[0].re*z[1].im; - z[0].re = in[0].re + tab[0].re*t[4].re; - z[0].im = in[0].im + tab[0].re*t[4].im; + z[0].re = dc.re + tab[0].re*t[4].re; + z[0].im = dc.im + tab[0].re*t[4].im; x[1].re = tab[1].re*w[0].re + tab[2].im*w[1].re; x[1].im = tab[1].re*w[0].im + tab[2].im*w[1].im; @@ -473,6 +472,68 @@ fft5_m3(out, tmp + 10, stride); } +static av_cold int TX_NAME(ff_tx_fft_factor_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret = 0; + TX_TAB(ff_tx_init_tabs)(len); + + if (len == 15) + ret = ff_tx_gen_pfa_input_map(s, opts, 3, 5); + else if (flags & FF_TX_PRESHUFFLE) + ret = ff_tx_gen_default_map(s, opts); + + return ret; +} + +#define DECL_FACTOR_S(n) \ +static void TX_NAME(ff_tx_fft##n)(AVTXContext *s, void *dst, \ + void *src, ptrdiff_t stride) \ +{ \ + fft##n((TXComplex *)dst, (TXComplex *)src, stride / sizeof(TXComplex)); \ +} \ +static const FFTXCodelet TX_NAME(ff_tx_fft##n##_ns_def) = { \ + .name = TX_NAME_STR("fft" #n "_ns"), \ + .function = TX_NAME(ff_tx_fft##n), \ + .type = TX_TYPE(FFT), \ + .flags = AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | \ + AV_TX_UNALIGNED | FF_TX_PRESHUFFLE, \ + .factors[0] = n, \ + .nb_factors = 1, \ + .min_len = n, \ + .max_len = n, \ + .init = TX_NAME(ff_tx_fft_factor_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ +}; + +#define DECL_FACTOR_F(n) \ +DECL_FACTOR_S(n) \ +static const FFTXCodelet TX_NAME(ff_tx_fft##n##_fwd_def) = { \ + .name = TX_NAME_STR("fft" #n "_fwd"), \ + .function = TX_NAME(ff_tx_fft##n), \ + .type = TX_TYPE(FFT), \ + .flags = AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | \ + AV_TX_UNALIGNED | FF_TX_FORWARD_ONLY, \ + .factors[0] = n, \ + .nb_factors = 1, \ + .min_len = n, \ + .max_len = n, \ + .init = TX_NAME(ff_tx_fft_factor_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ +}; + +DECL_FACTOR_F(3) +DECL_FACTOR_F(5) +DECL_FACTOR_F(7) +DECL_FACTOR_F(9) +DECL_FACTOR_S(15) + #define BUTTERFLIES(a0, a1, a2, a3) \ do { \ r0=a0.re; \ @@ -502,7 +563,7 @@ int o2 = 4*len; int o3 = 6*len; const TXSample *wim = cos + o1 - 7; - TXSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; + TXUSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; for (int i = 0; i < len; i += 4) { TRANSFORM(z[0], z[o1 + 0], z[o2 + 0], z[o3 + 0], cos[0], wim[7]); @@ -529,7 +590,7 @@ const void *scale) { TX_TAB(ff_tx_init_tabs)(len); - return ff_tx_gen_ptwo_revtab(s, opts ? opts->invert_lookup : 1); + return ff_tx_gen_ptwo_revtab(s, opts); } #define DECL_SR_CODELET_DEF(n) \ @@ -537,9 +598,10 @@ .name = TX_NAME_STR("fft" #n "_ns"), \ .function = TX_NAME(ff_tx_fft##n##_ns), \ .type = TX_TYPE(FFT), \ - .flags = AV_TX_INPLACE | AV_TX_UNALIGNED | \ - FF_TX_PRESHUFFLE, \ + .flags = FF_TX_OUT_OF_PLACE | AV_TX_INPLACE | \ + AV_TX_UNALIGNED | FF_TX_PRESHUFFLE, \ .factors[0] = 2, \ + .nb_factors = 1, \ .min_len = n, \ .max_len = n, \ .init = TX_NAME(ff_tx_fft_sr_codelet_init), \ @@ -547,90 +609,95 @@ .prio = FF_TX_PRIO_BASE, \ }; -#define DECL_SR_CODELET(n, n2, n4) \ -static void TX_NAME(ff_tx_fft##n##_ns)(AVTXContext *s, void *dst, \ - void *src, ptrdiff_t stride) \ -{ \ - TXComplex *z = dst; \ - const TXSample *cos = TX_TAB(ff_tx_tab_##n); \ - \ - TX_NAME(ff_tx_fft##n2##_ns)(s, z, z, stride); \ - TX_NAME(ff_tx_fft##n4##_ns)(s, z + n4*2, z + n4*2, stride); \ - TX_NAME(ff_tx_fft##n4##_ns)(s, z + n4*3, z + n4*3, stride); \ - TX_NAME(ff_tx_fft_sr_combine)(z, cos, n4 >> 1); \ -} \ - \ +#define DECL_SR_CODELET(n, n2, n4) \ +static void TX_NAME(ff_tx_fft##n##_ns)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ +{ \ + TXComplex *src = _src; \ + TXComplex *dst = _dst; \ + const TXSample *cos = TX_TAB(ff_tx_tab_##n); \ + \ + TX_NAME(ff_tx_fft##n2##_ns)(s, dst, src, stride); \ + TX_NAME(ff_tx_fft##n4##_ns)(s, dst + n4*2, src + n4*2, stride); \ + TX_NAME(ff_tx_fft##n4##_ns)(s, dst + n4*3, src + n4*3, stride); \ + TX_NAME(ff_tx_fft_sr_combine)(dst, cos, n4 >> 1); \ +} \ + \ DECL_SR_CODELET_DEF(n) -static void TX_NAME(ff_tx_fft2_ns)(AVTXContext *s, void *dst, - void *src, ptrdiff_t stride) +static void TX_NAME(ff_tx_fft2_ns)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { - TXComplex *z = dst; + TXComplex *src = _src; + TXComplex *dst = _dst; TXComplex tmp; - BF(tmp.re, z[0].re, z[0].re, z[1].re); - BF(tmp.im, z[0].im, z[0].im, z[1].im); - z[1] = tmp; + BF(tmp.re, dst[0].re, src[0].re, src[1].re); + BF(tmp.im, dst[0].im, src[0].im, src[1].im); + dst[1] = tmp; } -static void TX_NAME(ff_tx_fft4_ns)(AVTXContext *s, void *dst, - void *src, ptrdiff_t stride) +static void TX_NAME(ff_tx_fft4_ns)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { - TXComplex *z = dst; + TXComplex *src = _src; + TXComplex *dst = _dst; TXSample t1, t2, t3, t4, t5, t6, t7, t8; - BF(t3, t1, z[0].re, z[1].re); - BF(t8, t6, z[3].re, z[2].re); - BF(z[2].re, z[0].re, t1, t6); - BF(t4, t2, z[0].im, z[1].im); - BF(t7, t5, z[2].im, z[3].im); - BF(z[3].im, z[1].im, t4, t8); - BF(z[3].re, z[1].re, t3, t7); - BF(z[2].im, z[0].im, t2, t5); + BF(t3, t1, src[0].re, src[1].re); + BF(t8, t6, src[3].re, src[2].re); + BF(dst[2].re, dst[0].re, t1, t6); + BF(t4, t2, src[0].im, src[1].im); + BF(t7, t5, src[2].im, src[3].im); + BF(dst[3].im, dst[1].im, t4, t8); + BF(dst[3].re, dst[1].re, t3, t7); + BF(dst[2].im, dst[0].im, t2, t5); } -static void TX_NAME(ff_tx_fft8_ns)(AVTXContext *s, void *dst, - void *src, ptrdiff_t stride) +static void TX_NAME(ff_tx_fft8_ns)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { - TXComplex *z = dst; - TXSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; + TXComplex *src = _src; + TXComplex *dst = _dst; + TXUSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; const TXSample cos = TX_TAB(ff_tx_tab_8)[1]; - TX_NAME(ff_tx_fft4_ns)(s, z, z, stride); + TX_NAME(ff_tx_fft4_ns)(s, dst, src, stride); - BF(t1, z[5].re, z[4].re, -z[5].re); - BF(t2, z[5].im, z[4].im, -z[5].im); - BF(t5, z[7].re, z[6].re, -z[7].re); - BF(t6, z[7].im, z[6].im, -z[7].im); + BF(t1, dst[5].re, src[4].re, -src[5].re); + BF(t2, dst[5].im, src[4].im, -src[5].im); + BF(t5, dst[7].re, src[6].re, -src[7].re); + BF(t6, dst[7].im, src[6].im, -src[7].im); - BUTTERFLIES(z[0], z[2], z[4], z[6]); - TRANSFORM(z[1], z[3], z[5], z[7], cos, cos); + BUTTERFLIES(dst[0], dst[2], dst[4], dst[6]); + TRANSFORM(dst[1], dst[3], dst[5], dst[7], cos, cos); } -static void TX_NAME(ff_tx_fft16_ns)(AVTXContext *s, void *dst, - void *src, ptrdiff_t stride) +static void TX_NAME(ff_tx_fft16_ns)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { - TXComplex *z = dst; + TXComplex *src = _src; + TXComplex *dst = _dst; const TXSample *cos = TX_TAB(ff_tx_tab_16); - TXSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; + TXUSample t1, t2, t3, t4, t5, t6, r0, i0, r1, i1; TXSample cos_16_1 = cos[1]; TXSample cos_16_2 = cos[2]; TXSample cos_16_3 = cos[3]; - TX_NAME(ff_tx_fft8_ns)(s, z + 0, z + 0, stride); - TX_NAME(ff_tx_fft4_ns)(s, z + 8, z + 8, stride); - TX_NAME(ff_tx_fft4_ns)(s, z + 12, z + 12, stride); - - t1 = z[ 8].re; - t2 = z[ 8].im; - t5 = z[12].re; - t6 = z[12].im; - BUTTERFLIES(z[0], z[4], z[8], z[12]); - - TRANSFORM(z[ 2], z[ 6], z[10], z[14], cos_16_2, cos_16_2); - TRANSFORM(z[ 1], z[ 5], z[ 9], z[13], cos_16_1, cos_16_3); - TRANSFORM(z[ 3], z[ 7], z[11], z[15], cos_16_3, cos_16_1); + TX_NAME(ff_tx_fft8_ns)(s, dst + 0, src + 0, stride); + TX_NAME(ff_tx_fft4_ns)(s, dst + 8, src + 8, stride); + TX_NAME(ff_tx_fft4_ns)(s, dst + 12, src + 12, stride); + + t1 = dst[ 8].re; + t2 = dst[ 8].im; + t5 = dst[12].re; + t6 = dst[12].im; + BUTTERFLIES(dst[0], dst[4], dst[8], dst[12]); + + TRANSFORM(dst[ 2], dst[ 6], dst[10], dst[14], cos_16_2, cos_16_2); + TRANSFORM(dst[ 1], dst[ 5], dst[ 9], dst[13], cos_16_1, cos_16_3); + TRANSFORM(dst[ 3], dst[ 7], dst[11], dst[15], cos_16_3, cos_16_1); } DECL_SR_CODELET_DEF(2) @@ -651,16 +718,18 @@ DECL_SR_CODELET(65536,32768,16384) DECL_SR_CODELET(131072,65536,32768) -static av_cold int TX_NAME(ff_tx_fft_sr_init)(AVTXContext *s, - const FFTXCodelet *cd, - uint64_t flags, - FFTXCodeletOptions *opts, - int len, int inv, - const void *scale) +static av_cold int TX_NAME(ff_tx_fft_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) { int ret; int is_inplace = !!(flags & AV_TX_INPLACE); - FFTXCodeletOptions sub_opts = { .invert_lookup = !is_inplace }; + FFTXCodeletOptions sub_opts = { + .map_dir = is_inplace ? FF_TX_MAP_SCATTER : FF_TX_MAP_GATHER, + }; flags &= ~FF_TX_OUT_OF_PLACE; /* We want the subtransform to be */ flags |= AV_TX_INPLACE; /* in-place */ @@ -669,31 +738,46 @@ if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, len, inv, scale))) return ret; - if (is_inplace && (ret = ff_tx_gen_ptwo_inplace_revtab_idx(s))) + if (is_inplace && (ret = ff_tx_gen_inplace_map(s, len))) return ret; return 0; } -static void TX_NAME(ff_tx_fft_sr)(AVTXContext *s, void *_dst, - void *_src, ptrdiff_t stride) +static av_cold int TX_NAME(ff_tx_fft_inplace_small_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + if (!(s->tmp = av_malloc(len*sizeof(*s->tmp)))) + return AVERROR(ENOMEM); + flags &= ~AV_TX_INPLACE; + return TX_NAME(ff_tx_fft_init)(s, cd, flags, opts, len, inv, scale); +} + +static void TX_NAME(ff_tx_fft)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { TXComplex *src = _src; - TXComplex *dst = _dst; + TXComplex *dst1 = s->flags & AV_TX_INPLACE ? s->tmp : _dst; + TXComplex *dst2 = _dst; int *map = s->sub[0].map; int len = s->len; /* Compilers can't vectorize this anyway without assuming AVX2, which they * generally don't, at least without -march=native -mtune=native */ for (int i = 0; i < len; i++) - dst[i] = src[map[i]]; + dst1[i] = src[map[i]]; - s->fn[0](&s->sub[0], dst, dst, stride); + s->fn[0](&s->sub[0], dst2, dst1, stride); } -static void TX_NAME(ff_tx_fft_sr_inplace)(AVTXContext *s, void *_dst, - void *_src, ptrdiff_t stride) +static void TX_NAME(ff_tx_fft_inplace)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { + TXComplex *src = _src; TXComplex *dst = _dst; TXComplex tmp; const int *map = s->sub->map; @@ -702,44 +786,85 @@ src_idx = *inplace_idx++; do { - tmp = dst[src_idx]; + tmp = src[src_idx]; dst_idx = map[src_idx]; do { - FFSWAP(TXComplex, tmp, dst[dst_idx]); + FFSWAP(TXComplex, tmp, src[dst_idx]); dst_idx = map[dst_idx]; } while (dst_idx != src_idx); /* Can be > as well, but was less predictable */ - dst[dst_idx] = tmp; + src[dst_idx] = tmp; } while ((src_idx = *inplace_idx++)); - s->fn[0](&s->sub[0], dst, dst, stride); + s->fn[0](&s->sub[0], dst, src, stride); } -static const FFTXCodelet TX_NAME(ff_tx_fft_sr_def) = { - .name = TX_NAME_STR("fft_sr"), - .function = TX_NAME(ff_tx_fft_sr), +static const FFTXCodelet TX_NAME(ff_tx_fft_def) = { + .name = TX_NAME_STR("fft"), + .function = TX_NAME(ff_tx_fft), .type = TX_TYPE(FFT), .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE, - .factors[0] = 2, + .factors[0] = TX_FACTOR_ANY, + .nb_factors = 1, .min_len = 2, .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_fft_sr_init), + .init = TX_NAME(ff_tx_fft_init), .cpu_flags = FF_TX_CPU_FLAGS_ALL, .prio = FF_TX_PRIO_BASE, }; -static const FFTXCodelet TX_NAME(ff_tx_fft_sr_inplace_def) = { - .name = TX_NAME_STR("fft_sr_inplace"), - .function = TX_NAME(ff_tx_fft_sr_inplace), +static const FFTXCodelet TX_NAME(ff_tx_fft_inplace_small_def) = { + .name = TX_NAME_STR("fft_inplace_small"), + .function = TX_NAME(ff_tx_fft), + .type = TX_TYPE(FFT), + .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | AV_TX_INPLACE, + .factors[0] = TX_FACTOR_ANY, + .nb_factors = 1, + .min_len = 2, + .max_len = 65536, + .init = TX_NAME(ff_tx_fft_inplace_small_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE - 256, +}; + +static const FFTXCodelet TX_NAME(ff_tx_fft_inplace_def) = { + .name = TX_NAME_STR("fft_inplace"), + .function = TX_NAME(ff_tx_fft_inplace), .type = TX_TYPE(FFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE, - .factors[0] = 2, + .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | AV_TX_INPLACE, + .factors[0] = TX_FACTOR_ANY, + .nb_factors = 1, .min_len = 2, .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_fft_sr_init), + .init = TX_NAME(ff_tx_fft_init), .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, + .prio = FF_TX_PRIO_BASE - 512, }; +static av_cold int TX_NAME(ff_tx_fft_init_naive_small)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + const double phase = s->inv ? 2.0*M_PI/len : -2.0*M_PI/len; + + if (!(s->exp = av_malloc(len*len*sizeof(*s->exp)))) + return AVERROR(ENOMEM); + + for (int i = 0; i < len; i++) { + for (int j = 0; j < len; j++) { + const double factor = phase*i*j; + s->exp[i*j] = (TXComplex){ + RESCALE(cos(factor)), + RESCALE(sin(factor)), + }; + } + } + + return 0; +} + static void TX_NAME(ff_tx_fft_naive)(AVTXContext *s, void *_dst, void *_src, ptrdiff_t stride) { @@ -748,9 +873,11 @@ const int n = s->len; double phase = s->inv ? 2.0*M_PI/n : -2.0*M_PI/n; - for(int i = 0; i < n; i++) { + stride /= sizeof(*dst); + + for (int i = 0; i < n; i++) { TXComplex tmp = { 0 }; - for(int j = 0; j < n; j++) { + for (int j = 0; j < n; j++) { const double factor = phase*i*j; const TXComplex mult = { RESCALE(cos(factor)), @@ -761,16 +888,53 @@ tmp.re += res.re; tmp.im += res.im; } - dst[i] = tmp; + dst[i*stride] = tmp; + } +} + +static void TX_NAME(ff_tx_fft_naive_small)(AVTXContext *s, void *_dst, void *_src, + ptrdiff_t stride) +{ + TXComplex *src = _src; + TXComplex *dst = _dst; + const int n = s->len; + + stride /= sizeof(*dst); + + for (int i = 0; i < n; i++) { + TXComplex tmp = { 0 }; + for (int j = 0; j < n; j++) { + TXComplex res; + const TXComplex mult = s->exp[i*j]; + CMUL3(res, src[j], mult); + tmp.re += res.re; + tmp.im += res.im; + } + dst[i*stride] = tmp; } } +static const FFTXCodelet TX_NAME(ff_tx_fft_naive_small_def) = { + .name = TX_NAME_STR("fft_naive_small"), + .function = TX_NAME(ff_tx_fft_naive_small), + .type = TX_TYPE(FFT), + .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE, + .factors[0] = TX_FACTOR_ANY, + .nb_factors = 1, + .min_len = 2, + .max_len = 1024, + .init = TX_NAME(ff_tx_fft_init_naive_small), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_MIN/2, +}; + static const FFTXCodelet TX_NAME(ff_tx_fft_naive_def) = { .name = TX_NAME_STR("fft_naive"), .function = TX_NAME(ff_tx_fft_naive), .type = TX_TYPE(FFT), .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE, .factors[0] = TX_FACTOR_ANY, + .nb_factors = 1, .min_len = 2, .max_len = TX_LEN_UNLIMITED, .init = NULL, @@ -785,71 +949,182 @@ int len, int inv, const void *scale) { - int ret; - int sub_len = len / cd->factors[0]; - FFTXCodeletOptions sub_opts = { .invert_lookup = 0 }; + int ret, *tmp, ps = flags & FF_TX_PRESHUFFLE; + FFTXCodeletOptions sub_opts = { .map_dir = FF_TX_MAP_GATHER }; + size_t extra_tmp_len = 0; + int len_list[TX_MAX_DECOMPOSITIONS]; - flags &= ~FF_TX_OUT_OF_PLACE; /* We want the subtransform to be */ - flags |= AV_TX_INPLACE; /* in-place */ - flags |= FF_TX_PRESHUFFLE; /* This function handles the permute step */ + if ((ret = ff_tx_decompose_length(len_list, TX_TYPE(FFT), len, inv)) < 0) + return ret; - if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, - sub_len, inv, scale))) + /* Two iterations to test both orderings. */ + for (int i = 0; i < ret; i++) { + int len1 = len_list[i]; + int len2 = len / len1; + + /* Our ptwo transforms don't support striding the output. */ + if (len2 & (len2 - 1)) + FFSWAP(int, len1, len2); + + ff_tx_clear_ctx(s); + + /* First transform */ + sub_opts.map_dir = FF_TX_MAP_GATHER; + flags &= ~AV_TX_INPLACE; + flags |= FF_TX_OUT_OF_PLACE; + flags |= FF_TX_PRESHUFFLE; /* This function handles the permute step */ + ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, + len1, inv, scale); + + if (ret == AVERROR(ENOMEM)) { + return ret; + } else if (ret < 0) { /* Try again without a preshuffle flag */ + flags &= ~FF_TX_PRESHUFFLE; + ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, + len1, inv, scale); + if (ret == AVERROR(ENOMEM)) + return ret; + else if (ret < 0) + continue; + } + + /* Second transform. */ + sub_opts.map_dir = FF_TX_MAP_SCATTER; + flags |= FF_TX_PRESHUFFLE; +retry: + flags &= ~FF_TX_OUT_OF_PLACE; + flags |= AV_TX_INPLACE; + ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, + len2, inv, scale); + + if (ret == AVERROR(ENOMEM)) { + return ret; + } else if (ret < 0) { /* Try again with an out-of-place transform */ + flags |= FF_TX_OUT_OF_PLACE; + flags &= ~AV_TX_INPLACE; + ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, + len2, inv, scale); + if (ret == AVERROR(ENOMEM)) { + return ret; + } else if (ret < 0) { + if (flags & FF_TX_PRESHUFFLE) { /* Retry again without a preshuf flag */ + flags &= ~FF_TX_PRESHUFFLE; + goto retry; + } else { + continue; + } + } + } + + /* Success */ + break; + } + + /* If nothing was sucessful, error out */ + if (ret < 0) return ret; - if ((ret = ff_tx_gen_compound_mapping(s, cd->factors[0], sub_len))) + /* Generate PFA map */ + if ((ret = ff_tx_gen_compound_mapping(s, opts, 0, + s->sub[0].len, s->sub[1].len))) return ret; if (!(s->tmp = av_malloc(len*sizeof(*s->tmp)))) return AVERROR(ENOMEM); - TX_TAB(ff_tx_init_tabs)(len / sub_len); + /* Flatten input map */ + tmp = (int *)s->tmp; + for (int k = 0; k < len; k += s->sub[0].len) { + memcpy(tmp, &s->map[k], s->sub[0].len*sizeof(*tmp)); + for (int i = 0; i < s->sub[0].len; i++) + s->map[k + i] = tmp[s->sub[0].map[i]]; + } + + /* Only allocate extra temporary memory if we need it */ + if (!(s->sub[1].flags & AV_TX_INPLACE)) + extra_tmp_len = len; + else if (!ps) + extra_tmp_len = s->sub[0].len; + + if (extra_tmp_len && !(s->exp = av_malloc(extra_tmp_len*sizeof(*s->exp)))) + return AVERROR(ENOMEM); return 0; } -#define DECL_COMP_FFT(N) \ -static void TX_NAME(ff_tx_fft_pfa_##N##xM)(AVTXContext *s, void *_out, \ - void *_in, ptrdiff_t stride) \ -{ \ - const int m = s->sub->len; \ - const int *in_map = s->map, *out_map = in_map + s->len; \ - const int *sub_map = s->sub->map; \ - TXComplex *in = _in; \ - TXComplex *out = _out; \ - TXComplex fft##N##in[N]; \ - \ - for (int i = 0; i < m; i++) { \ - for (int j = 0; j < N; j++) \ - fft##N##in[j] = in[in_map[i*N + j]]; \ - fft##N(s->tmp + sub_map[i], fft##N##in, m); \ - } \ - \ - for (int i = 0; i < N; i++) \ - s->fn[0](&s->sub[0], s->tmp + m*i, s->tmp + m*i, sizeof(TXComplex)); \ - \ - for (int i = 0; i < N*m; i++) \ - out[i] = s->tmp[out_map[i]]; \ -} \ - \ -static const FFTXCodelet TX_NAME(ff_tx_fft_pfa_##N##xM_def) = { \ - .name = TX_NAME_STR("fft_pfa_" #N "xM"), \ - .function = TX_NAME(ff_tx_fft_pfa_##N##xM), \ - .type = TX_TYPE(FFT), \ - .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE, \ - .factors = { N, TX_FACTOR_ANY }, \ - .min_len = N*2, \ - .max_len = TX_LEN_UNLIMITED, \ - .init = TX_NAME(ff_tx_fft_pfa_init), \ - .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ - .prio = FF_TX_PRIO_BASE, \ +static void TX_NAME(ff_tx_fft_pfa)(AVTXContext *s, void *_out, + void *_in, ptrdiff_t stride) +{ + const int n = s->sub[0].len, m = s->sub[1].len, l = s->len; + const int *in_map = s->map, *out_map = in_map + l; + const int *sub_map = s->sub[1].map; + TXComplex *tmp1 = s->sub[1].flags & AV_TX_INPLACE ? s->tmp : s->exp; + TXComplex *in = _in, *out = _out; + + stride /= sizeof(*out); + + for (int i = 0; i < m; i++) { + for (int j = 0; j < n; j++) + s->exp[j] = in[in_map[i*n + j]]; + s->fn[0](&s->sub[0], &s->tmp[sub_map[i]], s->exp, m*sizeof(TXComplex)); + } + + for (int i = 0; i < n; i++) + s->fn[1](&s->sub[1], &tmp1[m*i], &s->tmp[m*i], sizeof(TXComplex)); + + for (int i = 0; i < l; i++) + out[i*stride] = tmp1[out_map[i]]; +} + +static void TX_NAME(ff_tx_fft_pfa_ns)(AVTXContext *s, void *_out, + void *_in, ptrdiff_t stride) +{ + const int n = s->sub[0].len, m = s->sub[1].len, l = s->len; + const int *in_map = s->map, *out_map = in_map + l; + const int *sub_map = s->sub[1].map; + TXComplex *tmp1 = s->sub[1].flags & AV_TX_INPLACE ? s->tmp : s->exp; + TXComplex *in = _in, *out = _out; + + stride /= sizeof(*out); + + for (int i = 0; i < m; i++) + s->fn[0](&s->sub[0], &s->tmp[sub_map[i]], &in[i*n], m*sizeof(TXComplex)); + + for (int i = 0; i < n; i++) + s->fn[1](&s->sub[1], &tmp1[m*i], &s->tmp[m*i], sizeof(TXComplex)); + + for (int i = 0; i < l; i++) + out[i*stride] = tmp1[out_map[i]]; +} + +static const FFTXCodelet TX_NAME(ff_tx_fft_pfa_def) = { + .name = TX_NAME_STR("fft_pfa"), + .function = TX_NAME(ff_tx_fft_pfa), + .type = TX_TYPE(FFT), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 7, 5, 3, 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2*3, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_fft_pfa_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, }; -DECL_COMP_FFT(3) -DECL_COMP_FFT(5) -DECL_COMP_FFT(7) -DECL_COMP_FFT(9) -DECL_COMP_FFT(15) +static const FFTXCodelet TX_NAME(ff_tx_fft_pfa_ns_def) = { + .name = TX_NAME_STR("fft_pfa_ns"), + .function = TX_NAME(ff_tx_fft_pfa_ns), + .type = TX_TYPE(FFT), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | + FF_TX_PRESHUFFLE, + .factors = { 7, 5, 3, 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2*3, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_fft_pfa_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; static av_cold int TX_NAME(ff_tx_mdct_naive_init)(AVTXContext *s, const FFTXCodelet *cd, @@ -920,6 +1195,7 @@ .type = TX_TYPE(MDCT), .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, .factors = { 2, TX_FACTOR_ANY }, /* MDCTs need an even length */ + .nb_factors = 2, .min_len = 2, .max_len = TX_LEN_UNLIMITED, .init = TX_NAME(ff_tx_mdct_naive_init), @@ -933,6 +1209,7 @@ .type = TX_TYPE(MDCT), .flags = AV_TX_UNALIGNED | 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_mdct_naive_init), @@ -940,42 +1217,65 @@ .prio = FF_TX_PRIO_MIN, }; -static av_cold int TX_NAME(ff_tx_mdct_sr_init)(AVTXContext *s, - const FFTXCodelet *cd, - uint64_t flags, - FFTXCodeletOptions *opts, - int len, int inv, - const void *scale) +static av_cold int TX_NAME(ff_tx_mdct_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) { int ret; - FFTXCodeletOptions sub_opts = { .invert_lookup = 0 }; + FFTXCodeletOptions sub_opts = { + .map_dir = !inv ? FF_TX_MAP_SCATTER : FF_TX_MAP_GATHER, + }; s->scale_d = *((SCALE_TYPE *)scale); s->scale_f = s->scale_d; flags &= ~FF_TX_OUT_OF_PLACE; /* We want the subtransform to be */ flags |= AV_TX_INPLACE; /* in-place */ - flags |= FF_TX_PRESHUFFLE; /* This function handles the permute step */ + flags |= FF_TX_PRESHUFFLE; /* First try with an in-place transform */ if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, len >> 1, - inv, scale))) - return ret; + inv, scale))) { + flags &= ~FF_TX_PRESHUFFLE; /* Now try with a generic FFT */ + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, len >> 1, + inv, scale))) + return ret; + } + + s->map = av_malloc((len >> 1)*sizeof(*s->map)); + if (!s->map) + return AVERROR(ENOMEM); - if ((ret = TX_TAB(ff_tx_mdct_gen_exp)(s))) + /* If we need to preshuffle copy the map from the subcontext */ + if (s->sub[0].flags & FF_TX_PRESHUFFLE) { + memcpy(s->map, s->sub->map, (len >> 1)*sizeof(*s->map)); + } else { + for (int i = 0; i < len >> 1; i++) + s->map[i] = i; + } + + if ((ret = TX_TAB(ff_tx_mdct_gen_exp)(s, inv ? s->map : NULL))) return ret; + /* Saves a multiply in a hot path. */ + if (inv) + for (int i = 0; i < (s->len >> 1); i++) + s->map[i] <<= 1; + return 0; } -static void TX_NAME(ff_tx_mdct_sr_fwd)(AVTXContext *s, void *_dst, void *_src, - ptrdiff_t stride) +static void TX_NAME(ff_tx_mdct_fwd)(AVTXContext *s, void *_dst, void *_src, + ptrdiff_t stride) { TXSample *src = _src, *dst = _dst; TXComplex *exp = s->exp, tmp, *z = _dst; const int len2 = s->len >> 1; const int len4 = s->len >> 2; const int len3 = len2 * 3; - const int *sub_map = s->sub->map; + const int *sub_map = s->map; stride /= sizeof(*dst); @@ -1006,26 +1306,28 @@ } } -static void TX_NAME(ff_tx_mdct_sr_inv)(AVTXContext *s, void *_dst, void *_src, - ptrdiff_t stride) +static void TX_NAME(ff_tx_mdct_inv)(AVTXContext *s, void *_dst, void *_src, + ptrdiff_t stride) { TXComplex *z = _dst, *exp = s->exp; const TXSample *src = _src, *in1, *in2; const int len2 = s->len >> 1; const int len4 = s->len >> 2; - const int *sub_map = s->sub->map; + const int *sub_map = s->map; stride /= sizeof(*src); in1 = src; in2 = src + ((len2*2) - 1) * stride; for (int i = 0; i < len2; i++) { - TXComplex tmp = { in2[-2*i*stride], in1[2*i*stride] }; - CMUL3(z[sub_map[i]], tmp, exp[i]); + int k = sub_map[i]; + TXComplex tmp = { in2[-k*stride], in1[k*stride] }; + CMUL3(z[i], tmp, exp[i]); } s->fn[0](&s->sub[0], z, z, sizeof(TXComplex)); + exp += len2; for (int i = 0; i < len4; i++) { const int i0 = len4 + i, i1 = len4 - i - 1; TXComplex src1 = { z[i1].im, z[i1].re }; @@ -1036,28 +1338,30 @@ } } -static const FFTXCodelet TX_NAME(ff_tx_mdct_sr_fwd_def) = { - .name = TX_NAME_STR("mdct_sr_fwd"), - .function = TX_NAME(ff_tx_mdct_sr_fwd), +static const FFTXCodelet TX_NAME(ff_tx_mdct_fwd_def) = { + .name = TX_NAME_STR("mdct_fwd"), + .function = TX_NAME(ff_tx_mdct_fwd), .type = TX_TYPE(MDCT), .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, - .factors[0] = 2, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, .min_len = 2, .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_mdct_sr_init), + .init = TX_NAME(ff_tx_mdct_init), .cpu_flags = FF_TX_CPU_FLAGS_ALL, .prio = FF_TX_PRIO_BASE, }; -static const FFTXCodelet TX_NAME(ff_tx_mdct_sr_inv_def) = { - .name = TX_NAME_STR("mdct_sr_inv"), - .function = TX_NAME(ff_tx_mdct_sr_inv), +static const FFTXCodelet TX_NAME(ff_tx_mdct_inv_def) = { + .name = TX_NAME_STR("mdct_inv"), + .function = TX_NAME(ff_tx_mdct_inv), .type = TX_TYPE(MDCT), .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, - .factors[0] = 2, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, .min_len = 2, .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_mdct_sr_init), + .init = TX_NAME(ff_tx_mdct_init), .cpu_flags = FF_TX_CPU_FLAGS_ALL, .prio = FF_TX_PRIO_BASE, }; @@ -1107,6 +1411,7 @@ .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | AV_TX_FULL_IMDCT, .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, .min_len = 2, .max_len = TX_LEN_UNLIMITED, .init = TX_NAME(ff_tx_mdct_inv_full_init), @@ -1122,7 +1427,7 @@ const void *scale) { int ret, sub_len; - FFTXCodeletOptions sub_opts = { .invert_lookup = 0 }; + FFTXCodeletOptions sub_opts = { .map_dir = FF_TX_MAP_SCATTER }; len >>= 1; sub_len = len / cd->factors[0]; @@ -1138,12 +1443,20 @@ sub_len, inv, scale))) return ret; - if ((ret = ff_tx_gen_compound_mapping(s, cd->factors[0], sub_len))) + if ((ret = ff_tx_gen_compound_mapping(s, opts, s->inv, cd->factors[0], sub_len))) return ret; - if ((ret = TX_TAB(ff_tx_mdct_gen_exp)(s))) + /* Our 15-point transform is also a compound one, so embed its input map */ + if (cd->factors[0] == 15) + TX_EMBED_INPUT_PFA_MAP(s->map, len, 3, 5); + + if ((ret = TX_TAB(ff_tx_mdct_gen_exp)(s, inv ? s->map : NULL))) return ret; + /* Saves multiplies in loops. */ + for (int i = 0; i < len; i++) + s->map[i] <<= 1; + if (!(s->tmp = av_malloc(len*sizeof(*s->tmp)))) return AVERROR(ENOMEM); @@ -1160,6 +1473,7 @@ TXComplex *z = _dst, *exp = s->exp; \ const TXSample *src = _src, *in1, *in2; \ const int len4 = s->len >> 2; \ + const int len2 = s->len >> 1; \ const int m = s->sub->len; \ const int *in_map = s->map, *out_map = in_map + N*m; \ const int *sub_map = s->sub->map; \ @@ -1168,13 +1482,15 @@ in1 = src; \ in2 = src + ((N*m*2) - 1) * stride; \ \ - for (int i = 0; i < m; i++) { \ + for (int i = 0; i < len2; i += N) { \ for (int j = 0; j < N; j++) { \ - const int k = in_map[i*N + j]; \ + const int k = in_map[j]; \ TXComplex tmp = { in2[-k*stride], in1[k*stride] }; \ - CMUL3(fft##N##in[j], tmp, exp[k >> 1]); \ + CMUL3(fft##N##in[j], tmp, exp[j]); \ } \ - fft##N(s->tmp + sub_map[i], fft##N##in, m); \ + fft##N(s->tmp + *(sub_map++), fft##N##in, m); \ + exp += N; \ + in_map += N; \ } \ \ for (int i = 0; i < N; i++) \ @@ -1197,6 +1513,7 @@ .type = TX_TYPE(MDCT), \ .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, \ .factors = { N, TX_FACTOR_ANY }, \ + .nb_factors = 2, \ .min_len = N*2, \ .max_len = TX_LEN_UNLIMITED, \ .init = TX_NAME(ff_tx_mdct_pfa_init), \ @@ -1264,6 +1581,7 @@ .type = TX_TYPE(MDCT), \ .flags = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, \ .factors = { N, TX_FACTOR_ANY }, \ + .nb_factors = 2, \ .min_len = N*2, \ .max_len = TX_LEN_UNLIMITED, \ .init = TX_NAME(ff_tx_mdct_pfa_init), \ @@ -1304,7 +1622,7 @@ m = (inv ? 2*s->scale_d : s->scale_d); *tab++ = RESCALE((inv ? 0.5 : 1.0) * m); - *tab++ = RESCALE(inv ? 0.5*m : 1.0); + *tab++ = RESCALE(inv ? 0.5*m : 1.0*m); *tab++ = RESCALE( m); *tab++ = RESCALE(-m); @@ -1370,7 +1688,7 @@ } else { \ /* Move [0].im to the last position, as convention requires */ \ data[len2].re = data[0].im; \ - data[ 0].im = 0; \ + data[ 0].im = data[len2].im = 0; \ } \ } @@ -1384,6 +1702,7 @@ .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), @@ -1398,6 +1717,7 @@ .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), @@ -1405,22 +1725,206 @@ .prio = FF_TX_PRIO_BASE, }; -int TX_TAB(ff_tx_mdct_gen_exp)(AVTXContext *s) +static av_cold int TX_NAME(ff_tx_dct_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret; + double freq; + TXSample *tab; + SCALE_TYPE rsc = *((SCALE_TYPE *)scale); + + if (inv) { + len *= 2; + s->len *= 2; + rsc *= 0.5; + } + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(RDFT), flags, NULL, len, inv, &rsc))) + return ret; + + s->exp = av_malloc((len/2)*3*sizeof(TXSample)); + if (!s->exp) + return AVERROR(ENOMEM); + + tab = (TXSample *)s->exp; + + freq = M_PI/(len*2); + + for (int i = 0; i < len; i++) + tab[i] = RESCALE(cos(i*freq)*(!inv + 1)); + + if (inv) { + for (int i = 0; i < len/2; i++) + tab[len + i] = RESCALE(0.5 / sin((2*i + 1)*freq)); + } else { + for (int i = 0; i < len/2; i++) + tab[len + i] = RESCALE(cos((len - 2*i - 1)*freq)); + } + + return 0; +} + +static void TX_NAME(ff_tx_dctII)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) { + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len; + const int len2 = len >> 1; + const TXSample *exp = (void *)s->exp; + TXSample next; +#ifdef TX_INT32 + int64_t tmp1, tmp2; +#else + TXSample tmp1, tmp2; +#endif + + for (int i = 0; i < len2; i++) { + TXSample in1 = src[i]; + TXSample in2 = src[len - i - 1]; + TXSample s = exp[len + i]; + +#ifdef TX_INT32 + tmp1 = in1 + in2; + tmp2 = in1 - in2; + + tmp1 >>= 1; + tmp2 *= s; + + tmp2 = (tmp2 + 0x40000000) >> 31; +#else + tmp1 = (in1 + in2)*0.5; + tmp2 = (in1 - in2)*s; +#endif + + src[i] = tmp1 + tmp2; + src[len - i - 1] = tmp1 - tmp2; + } + + s->fn[0](&s->sub[0], dst, src, sizeof(TXComplex)); + + next = dst[len]; + + for (int i = len - 2; i > 0; i -= 2) { + TXSample tmp; + + CMUL(tmp, dst[i], exp[len - i], exp[i], dst[i + 0], dst[i + 1]); + + dst[i + 1] = next; + + next += tmp; + } + +#ifdef TX_INT32 + tmp1 = ((int64_t)exp[0]) * ((int64_t)dst[0]); + dst[0] = (tmp1 + 0x40000000) >> 31; +#else + dst[0] = exp[0] * dst[0]; +#endif + dst[1] = next; +} + +static void TX_NAME(ff_tx_dctIII)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len; + const int len2 = len >> 1; + const TXSample *exp = (void *)s->exp; +#ifdef TX_INT32 + int64_t tmp1, tmp2 = src[len - 1]; + tmp2 = (2*tmp2 + 0x40000000) >> 31; +#else + TXSample tmp1, tmp2 = 2*src[len - 1]; +#endif + + src[len] = tmp2; + + for (int i = len - 2; i >= 2; i -= 2) { + TXSample val1 = src[i - 0]; + TXSample val2 = src[i - 1] - src[i + 1]; + + CMUL(src[i + 1], src[i], exp[len - i], exp[i], val1, val2); + } + + s->fn[0](&s->sub[0], dst, src, sizeof(float)); + + for (int i = 0; i < len2; i++) { + TXSample in1 = dst[i]; + TXSample in2 = dst[len - i - 1]; + TXSample c = exp[len + i]; + + tmp1 = in1 + in2; + tmp2 = in1 - in2; + tmp2 *= c; +#ifdef TX_INT32 + tmp2 = (tmp2 + 0x40000000) >> 31; +#endif + + dst[i] = tmp1 + tmp2; + dst[len - i - 1] = tmp1 - tmp2; + } +} + +static const FFTXCodelet TX_NAME(ff_tx_dctII_def) = { + .name = TX_NAME_STR("dctII"), + .function = TX_NAME(ff_tx_dctII), + .type = TX_TYPE(DCT), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | + FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, + .factors = { 2, TX_FACTOR_ANY }, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dct_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + +static const FFTXCodelet TX_NAME(ff_tx_dctIII_def) = { + .name = TX_NAME_STR("dctIII"), + .function = TX_NAME(ff_tx_dctIII), + .type = TX_TYPE(DCT), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | + FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, + .factors = { 2, TX_FACTOR_ANY }, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dct_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; int len4 = s->len >> 1; double scale = s->scale_d; const double theta = (scale < 0 ? len4 : 0) + 1.0/8.0; + size_t alloc = pre_tab ? 2*len4 : len4; - if (!(s->exp = av_malloc_array(len4, sizeof(*s->exp)))) + if (!(s->exp = av_malloc_array(alloc, sizeof(*s->exp)))) return AVERROR(ENOMEM); scale = sqrt(fabs(scale)); + + if (pre_tab) + off = len4; + for (int i = 0; i < len4; i++) { const double alpha = M_PI_2 * (i + theta) / len4; - s->exp[i].re = RESCALE(cos(alpha) * scale); - s->exp[i].im = RESCALE(sin(alpha) * scale); + s->exp[off + i] = (TXComplex){ RESCALE(cos(alpha) * scale), + RESCALE(sin(alpha) * scale) }; } + if (pre_tab) + for (int i = 0; i < len4; i++) + s->exp[i] = s->exp[len4 + pre_tab[i]]; + return 0; } @@ -1444,17 +1948,29 @@ &TX_NAME(ff_tx_fft65536_ns_def), &TX_NAME(ff_tx_fft131072_ns_def), + /* Prime factor codelets */ + &TX_NAME(ff_tx_fft3_ns_def), + &TX_NAME(ff_tx_fft5_ns_def), + &TX_NAME(ff_tx_fft7_ns_def), + &TX_NAME(ff_tx_fft9_ns_def), + &TX_NAME(ff_tx_fft15_ns_def), + + /* We get these for free */ + &TX_NAME(ff_tx_fft3_fwd_def), + &TX_NAME(ff_tx_fft5_fwd_def), + &TX_NAME(ff_tx_fft7_fwd_def), + &TX_NAME(ff_tx_fft9_fwd_def), + /* Standalone transforms */ - &TX_NAME(ff_tx_fft_sr_def), - &TX_NAME(ff_tx_fft_sr_inplace_def), - &TX_NAME(ff_tx_fft_pfa_3xM_def), - &TX_NAME(ff_tx_fft_pfa_5xM_def), - &TX_NAME(ff_tx_fft_pfa_7xM_def), - &TX_NAME(ff_tx_fft_pfa_9xM_def), - &TX_NAME(ff_tx_fft_pfa_15xM_def), + &TX_NAME(ff_tx_fft_def), + &TX_NAME(ff_tx_fft_inplace_def), + &TX_NAME(ff_tx_fft_inplace_small_def), + &TX_NAME(ff_tx_fft_pfa_def), + &TX_NAME(ff_tx_fft_pfa_ns_def), &TX_NAME(ff_tx_fft_naive_def), - &TX_NAME(ff_tx_mdct_sr_fwd_def), - &TX_NAME(ff_tx_mdct_sr_inv_def), + &TX_NAME(ff_tx_fft_naive_small_def), + &TX_NAME(ff_tx_mdct_fwd_def), + &TX_NAME(ff_tx_mdct_inv_def), &TX_NAME(ff_tx_mdct_pfa_3xM_fwd_def), &TX_NAME(ff_tx_mdct_pfa_5xM_fwd_def), &TX_NAME(ff_tx_mdct_pfa_7xM_fwd_def), @@ -1470,6 +1986,8 @@ &TX_NAME(ff_tx_mdct_inv_full_def), &TX_NAME(ff_tx_rdft_r2c_def), &TX_NAME(ff_tx_rdft_c2r_def), + &TX_NAME(ff_tx_dctII_def), + &TX_NAME(ff_tx_dctIII_def), NULL, }; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/uuid.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/uuid.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/uuid.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/uuid.h 2023-03-03 13:29:59.000000000 +0000 @@ -106,7 +106,6 @@ * * @param[in] uu AVUUID * @param[out] out Pointer to an array of no less than 37 characters. - * @return A non-zero value in case of an error. */ void av_uuid_unparse(const AVUUID uu, char *out); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -78,8 +78,8 @@ * @{ */ -#define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 28 +#define LIBAVUTIL_VERSION_MAJOR 58 +#define LIBAVUTIL_VERSION_MINOR 2 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -105,15 +105,14 @@ * @{ */ -#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_REORDERED_OPAQUE (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_FRAME_PICTURE_NUMBER (LIBAVUTIL_VERSION_MAJOR < 59) /** * @} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/video_enc_params.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/video_enc_params.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/video_enc_params.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/video_enc_params.c 2023-03-03 13:29:59.000000000 +0000 @@ -27,11 +27,11 @@ AVVideoEncParams *av_video_enc_params_alloc(enum AVVideoEncParamsType type, unsigned int nb_blocks, size_t *out_size) { - const size_t blocks_offset = offsetof( - struct { - AVVideoEncParams p; - AVVideoBlockParams b; - }, b); + struct TestStruct { + AVVideoEncParams p; + AVVideoBlockParams b; + }; + const size_t blocks_offset = offsetof(struct TestStruct, b); size_t size = blocks_offset; AVVideoEncParams *par; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/fixed_dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/fixed_dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/fixed_dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/fixed_dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ #include "libavutil/fixed_dsp.h" #include "cpu.h" -void ff_butterflies_fixed_sse2(int *src0, int *src1, int len); +void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int len); av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp.asm 2023-03-03 13:29:59.000000000 +0000 @@ -48,7 +48,7 @@ sub lenq, 64 jge .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -141,7 +141,7 @@ %endif ; mmsize sub lenq, 64 jge .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -178,7 +178,7 @@ mova [dstq+lenq], m1 sub lenq, mmsize jge .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -233,7 +233,7 @@ movaps [dstq+lenq+3*mmsize], m4 sub lenq, mmsize*4 jge .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -280,7 +280,7 @@ movaps [dstq+lenq+mmsize], m2 sub lenq, 2*mmsize jge .loop - REP_RET + RET %endmacro INIT_XMM sse2 @@ -323,7 +323,7 @@ sub len1q, mmsize add lenq, mmsize jl .loop - REP_RET + RET ;----------------------------------------------------------------------------- ; vector_fmul_add(float *dst, const float *src0, const float *src1, @@ -352,7 +352,7 @@ sub lenq, 2*mmsize jge .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -401,7 +401,7 @@ add src1q, 2*mmsize sub lenq, 2*mmsize jge .loop - REP_RET + RET %endmacro INIT_XMM sse @@ -440,6 +440,133 @@ %endif RET +INIT_YMM fma3 +cglobal scalarproduct_float, 3,5,8, v1, v2, size, len, offset + xor offsetq, offsetq + xorps m0, m0, m0 + shl sized, 2 + mov lenq, sizeq + cmp lenq, 32 + jl .l16 + cmp lenq, 64 + jl .l32 + xorps m1, m1, m1 + cmp lenq, 128 + jl .l64 + and lenq, ~127 + xorps m2, m2, m2 + xorps m3, m3, m3 +.loop128: + movups m4, [v1q+offsetq] + movups m5, [v1q+offsetq + 32] + movups m6, [v1q+offsetq + 64] + movups m7, [v1q+offsetq + 96] + fmaddps m0, m4, [v2q+offsetq ], m0 + fmaddps m1, m5, [v2q+offsetq + 32], m1 + fmaddps m2, m6, [v2q+offsetq + 64], m2 + fmaddps m3, m7, [v2q+offsetq + 96], m3 + add offsetq, 128 + cmp offsetq, lenq + jl .loop128 + addps m0, m0, m2 + addps m1, m1, m3 + mov lenq, sizeq + and lenq, 127 + cmp lenq, 64 + jge .l64 + addps m0, m0, m1 + cmp lenq, 32 + jge .l32 + vextractf128 xmm2, m0, 1 + addps xmm0, xmm2 + cmp lenq, 16 + jge .l16 + movhlps xmm1, xmm0 + addps xmm0, xmm1 + movss xmm1, xmm0 + shufps xmm0, xmm0, 1 + addss xmm0, xmm1 +%if ARCH_X86_64 == 0 + movss r0m, xm0 + fld dword r0m +%endif + RET +.l64: + and lenq, ~63 + add lenq, offsetq +.loop64: + movups m4, [v1q+offsetq] + movups m5, [v1q+offsetq + 32] + fmaddps m0, m4, [v2q+offsetq], m0 + fmaddps m1, m5, [v2q+offsetq + 32], m1 + add offsetq, 64 + cmp offsetq, lenq + jl .loop64 + addps m0, m0, m1 + mov lenq, sizeq + and lenq, 63 + cmp lenq, 32 + jge .l32 + vextractf128 xmm2, m0, 1 + addps xmm0, xmm2 + cmp lenq, 16 + jge .l16 + movhlps xmm1, xmm0 + addps xmm0, xmm1 + movss xmm1, xmm0 + shufps xmm0, xmm0, 1 + addss xmm0, xmm1 +%if ARCH_X86_64 == 0 + movss r0m, xm0 + fld dword r0m +%endif + RET +.l32: + and lenq, ~31 + add lenq, offsetq +.loop32: + movups m4, [v1q+offsetq] + fmaddps m0, m4, [v2q+offsetq], m0 + add offsetq, 32 + cmp offsetq, lenq + jl .loop32 + vextractf128 xmm2, m0, 1 + addps xmm0, xmm2 + mov lenq, sizeq + and lenq, 31 + cmp lenq, 16 + jge .l16 + movhlps xmm1, xmm0 + addps xmm0, xmm1 + movss xmm1, xmm0 + shufps xmm0, xmm0, 1 + addss xmm0, xmm1 +%if ARCH_X86_64 == 0 + movss r0m, xm0 + fld dword r0m +%endif + RET +.l16: + and lenq, ~15 + add lenq, offsetq +.loop16: + movaps xmm1, [v1q+offsetq] + mulps xmm1, [v2q+offsetq] + addps xmm0, xmm1 + add offsetq, 16 + cmp offsetq, lenq + jl .loop16 + movhlps xmm1, xmm0 + addps xmm0, xmm1 + movss xmm1, xmm0 + shufps xmm0, xmm0, 1 + addss xmm0, xmm1 +%if ARCH_X86_64 == 0 + movss r0m, xm0 + fld dword r0m +%endif + RET + ;----------------------------------------------------------------------------- ; void ff_butterflies_float(float *src0, float *src1, int len); ;----------------------------------------------------------------------------- @@ -458,4 +585,4 @@ mova [src0q + lenq], m0 add lenq, mmsize jl .loop - REP_RET + RET diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/float_dsp_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -74,6 +74,7 @@ const float *src1, int len); float ff_scalarproduct_float_sse(const float *v1, const float *v2, int order); +float ff_scalarproduct_float_fma3(const float *v1, const float *v2, int order); void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, int len); @@ -112,5 +113,6 @@ fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_fma3; fdsp->vector_fmul_add = ff_vector_fmul_add_fma3; fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3; + fdsp->scalarproduct_float = ff_scalarproduct_float_fma3; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/intreadwrite.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/intreadwrite.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/intreadwrite.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/intreadwrite.h 2023-03-03 13:29:59.000000000 +0000 @@ -29,6 +29,8 @@ #if !HAVE_FAST_64BIT && defined(__MMX__) +#define FF_COPY_SWAP_ZERO_USES_MMX + #define AV_COPY64 AV_COPY64 static av_always_inline void AV_COPY64(void *d, const void *s) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/lls.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/lls.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/lls.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/lls.asm 2023-03-03 13:29:59.000000000 +0000 @@ -123,7 +123,7 @@ test id, id jle .loop2x1 .ret: - REP_RET + RET %macro UPDATE_LLS 0 cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2 @@ -240,7 +240,7 @@ cmp id, countd jle .loop2x1 .ret: - REP_RET + RET %endmacro ; UPDATE_LLS %if HAVE_AVX_EXTERNAL diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float.asm 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,12 @@ ; Open `doc/transforms.md` to see the code upon which the transforms here were ; based upon and compare. +; Intra-asm call convention: +; 320 bytes of stack available +; 14 GPRs available (last 4 must not be clobbered) +; Additionally, don't clobber ctx, in, out, stride, len, lut +; All vector regs available + ; TODO: ; carry over registers from smaller transforms to save on ~8 loads/stores ; check if vinsertf could be faster than verpm2f128 for duplication @@ -45,6 +51,8 @@ %assign i (i << 1) %endrep +cextern tab_53_float + struc AVTXContext .len: resd 1 ; Length .inv resd 1 ; Inverse flag @@ -81,6 +89,9 @@ s16_mult_odd2: dd COS16_3, -COS16_3, COS16_1, -COS16_1, -COS16_3, -COS16_3, -COS16_1, -COS16_1 s16_perm: dd 0, 1, 2, 3, 1, 0, 3, 2 +s15_perm: dd 0, 6, 5, 3, 2, 4, 7, 1 + +mask_mmppmmmm: dd NEG, NEG, POS, POS, NEG, NEG, NEG, NEG mask_mmmmpppm: dd NEG, NEG, NEG, NEG, POS, POS, POS, NEG mask_ppmpmmpm: dd POS, POS, NEG, POS, NEG, NEG, POS, NEG mask_mppmmpmp: dd NEG, POS, POS, NEG, NEG, POS, NEG, POS @@ -100,19 +111,19 @@ ; %7 - temporary register (for avx only, enables vgatherdpd (AVX2) if FMA3 is set) %macro LOAD64_LUT 5-7 %if %0 > 6 && cpuflag(avx2) - pcmpeqd %6, %6 ; pcmpeqq has a 0.5 throughput on Zen 3, this has 0.25 - movapd xmm%7, [%3 + %4] ; float mov since vgatherdpd is a float instruction - vgatherdpd %1, [%2 + xmm%7*8], %6 ; must use separate registers for args + pcmpeqd %7, %7 ; pcmpeqq has a 0.5 throughput on Zen 3, this has 0.25 + movupd xmm%6, [%3 + %4] ; float mov since vgatherdpd is a float instruction + vgatherdpd %1, [%2 + xmm%6*8], %7 ; must use separate registers for args %else mov %5d, [%3 + %4 + 0] movsd xmm%1, [%2 + %5q*8] -%if mmsize == 32 +%if sizeof%1 > 16 && %0 > 5 mov %5d, [%3 + %4 + 8] movsd xmm%6, [%2 + %5q*8] %endif mov %5d, [%3 + %4 + 4] movhps xmm%1, [%2 + %5q*8] -%if mmsize == 32 +%if sizeof%1 > 16 && %0 > 5 mov %5d, [%3 + %4 + 12] movhps xmm%6, [%2 + %5q*8] vinsertf128 %1, %1, xmm%6, 1 @@ -296,6 +307,132 @@ %undef perm %endmacro +; Single 15-point complex FFT +; Input: +; xm0 must contain in[0,1].reim +; m2 - in[3-6].reim +; m3 - in[7-11].reim +; m4 - in[12-15].reim +; xm5 must contain in[2].reimreim +; +; Output: +; m0, m1, m2 - ACs +; xm14 - out[0] +; xm15 - out[10, 5] +%macro FFT15 0 + shufps xm1, xm0, xm0, q3223 ; in[1].imrereim + shufps xm0, xm0, xm0, q1001 ; in[0].imrereim + + xorps xm1, xm11 + addps xm1, xm0 ; pc[0,1].imre + + shufps xm0, xm1, xm1, q3232 ; pc[1].reimreim + addps xm0, xm5 ; dc[0].reimreim + + mulps xm1, xm9 ; tab[0123]*pc[01] + + shufpd xm6, xm1, xm1, 01b ; pc[1,0].reim + xorps xm1, xm11 + addps xm1, xm1, xm6 + addsubps xm1, xm5, xm1 ; dc[1,2].reim + + subps m7, m2, m3 ; q[0-3].imre + addps m6, m2, m3 ; q[4-7] + shufps m7, m7, m7, q2301 ; q[0-3].reim + + addps m5, m4, m6 ; y[0-3] + + vperm2f128 m14, m9, m9, 0x11 ; tab[23232323] + vbroadcastsd m15, xm9 ; tab[01010101] + + mulps m6, m14 + mulps m7, m15 + + subps m2, m6, m7 ; k[0-3] + addps m3, m6, m7 ; k[4-7] + + shufps m12, m11, m11, q3232 ; ppppmmmm + + addsubps m6, m4, m2 ; k[0-3] + addsubps m7, m4, m3 ; k[4-7] + + ; 15pt from here on + vpermpd m2, m5, q0123 ; y[3-0] + vpermpd m3, m6, q0123 ; k[3-0] + vpermpd m4, m7, q0123 ; k[7-4] + + xorps m5, m12 + xorps m6, m12 + xorps m7, m12 + + addps m2, m5 ; t[0-3] + addps m3, m6 ; t[4-7] + addps m4, m7 ; t[8-11] + + movlhps xm14, xm2 ; out[0] + unpcklpd xm15, xm3, xm4 ; out[10,5] + unpckhpd xm5, xm3, xm4 ; out[10,5] + + addps xm14, xm2 ; out[0] + addps xm15, xm5 ; out[10,5] + addps xm14, xm0 ; out[0] + addps xm15, xm1 ; out[10,5] + + shufps m12, m10, m10, q3232 ; tab5 4 5 4 5 8 9 8 9 + shufps m13, m10, m10, q1010 ; tab5 6 7 6 7 10 11 10 11 + + mulps m5, m2, m12 ; t[0-3] + mulps m6, m3, m12 ; t[4-7] + mulps m7, m4, m12 ; t[8-11] + + mulps m2, m13 ; r[0-3] + mulps m3, m13 ; r[4-7] + mulps m4, m13 ; r[8-11] + + shufps m5, m5, m5, q1032 ; t[1,0,3,2].reim + shufps m6, m6, m6, q1032 ; t[5,4,7,6].reim + shufps m7, m7, m7, q1032 ; t[9,8,11,10].reim + + vperm2f128 m13, m11, m11, 0x01 ; mmmmmmpp + shufps m12, m11, m11, q3232 ; ppppmmmm + + xorps m5, m13 + xorps m6, m13 + xorps m7, m13 + + addps m2, m5 ; r[0,1,2,3] + addps m3, m6 ; r[4,5,6,7] + addps m4, m7 ; r[8,9,10,11] + + shufps m5, m2, m2, q2301 + shufps m6, m3, m3, q2301 + shufps m7, m4, m4, q2301 + + xorps m2, m12 + xorps m3, m12 + xorps m4, m12 + + vpermpd m5, m5, q0123 + vpermpd m6, m6, q0123 + vpermpd m7, m7, q0123 + + addps m5, m2 + addps m6, m3 + addps m7, m4 + + vpermps m5, m8, m5 + vpermps m6, m8, m6 + vpermps m7, m8, m7 + + vbroadcastsd m0, xm0 ; dc[0] + vpermpd m2, m1, q1111 ; dc[2] + vbroadcastsd m1, xm1 ; dc[1] + + addps m0, m5 + addps m1, m6 + addps m2, m7 +%endmacro + ; Cobmines m0...m8 (tx1[even, even, odd, odd], tx2,3[even], tx2,3[odd]) coeffs ; Uses all 16 of registers. ; Output is slightly permuted such that tx2,3's coefficients are interleaved @@ -675,15 +812,25 @@ %endmacro INIT_XMM sse3 +cglobal fft2_asm_float, 0, 0, 0, ctx, out, in, stride + movaps m0, [inq] + FFT2 m0, m1 + movaps [outq], m0 + ret + cglobal fft2_float, 4, 4, 2, ctx, out, in, stride movaps m0, [inq] FFT2 m0, m1 movaps [outq], m0 RET -%macro FFT4 2 +%macro FFT4_FN 3 INIT_XMM sse2 +%if %3 +cglobal fft4_ %+ %1 %+ _asm_float, 0, 0, 0, ctx, out, in, stride +%else cglobal fft4_ %+ %1 %+ _float, 4, 4, 3, ctx, out, in, stride +%endif movaps m0, [inq + 0*mmsize] movaps m1, [inq + 1*mmsize] @@ -701,26 +848,33 @@ movaps [outq + 0*mmsize], m2 movaps [outq + 1*mmsize], m0 +%if %3 + ret +%else RET +%endif %endmacro -FFT4 fwd, 0 -FFT4 inv, 1 +FFT4_FN fwd, 0, 0 +FFT4_FN fwd, 0, 1 +FFT4_FN inv, 1, 0 +FFT4_FN inv, 1, 1 -%macro FFT8_SSE_FN 2 +%macro FFT8_SSE_FN 1 INIT_XMM sse3 -cglobal fft8_ %+ %1, 4, 4, 6, ctx, out, in, tmp -%if %2 +%if %1 +cglobal fft8_asm_float, 0, 0, 0, ctx, out, in, stride, tmp + movaps m0, [inq + 0*mmsize] + movaps m1, [inq + 1*mmsize] + movaps m2, [inq + 2*mmsize] + movaps m3, [inq + 3*mmsize] +%else +cglobal fft8_float, 4, 4, 6, ctx, out, in, tmp mov ctxq, [ctxq + AVTXContext.map] LOAD64_LUT m0, inq, ctxq, (mmsize/2)*0, tmpq LOAD64_LUT m1, inq, ctxq, (mmsize/2)*1, tmpq LOAD64_LUT m2, inq, ctxq, (mmsize/2)*2, tmpq LOAD64_LUT m3, inq, ctxq, (mmsize/2)*3, tmpq -%else - movaps m0, [inq + 0*mmsize] - movaps m1, [inq + 1*mmsize] - movaps m2, [inq + 2*mmsize] - movaps m3, [inq + 3*mmsize] %endif FFT8 m0, m1, m2, m3, m4, m5 @@ -735,22 +889,33 @@ movups [outq + 2*mmsize], m5 movups [outq + 3*mmsize], m1 +%if %1 + ret +%else + RET +%endif + +%if %1 +cglobal fft8_ns_float, 4, 5, 6, ctx, out, in, stride, tmp + call mangle(ff_tx_fft8_asm_float_sse3) RET +%endif %endmacro -FFT8_SSE_FN float, 1 -FFT8_SSE_FN ns_float, 0 +FFT8_SSE_FN 0 +FFT8_SSE_FN 1 -%macro FFT8_AVX_FN 2 +%macro FFT8_AVX_FN 1 INIT_YMM avx -cglobal fft8_ %+ %1, 4, 4, 4, ctx, out, in, tmp -%if %2 +%if %1 +cglobal fft8_asm_float, 0, 0, 0, ctx, out, in, stride, tmp + movaps m0, [inq + 0*mmsize] + movaps m1, [inq + 1*mmsize] +%else +cglobal fft8_float, 4, 4, 4, ctx, out, in, tmp mov ctxq, [ctxq + AVTXContext.map] LOAD64_LUT m0, inq, ctxq, (mmsize/2)*0, tmpq, m2 LOAD64_LUT m1, inq, ctxq, (mmsize/2)*1, tmpq, m3 -%else - movaps m0, [inq + 0*mmsize] - movaps m1, [inq + 1*mmsize] %endif FFT8_AVX m0, m1, m2, m3 @@ -764,21 +929,32 @@ vextractf128 [outq + 16*2], m2, 1 vextractf128 [outq + 16*3], m0, 1 +%if %1 + ret +%else + RET +%endif + +%if %1 +cglobal fft8_ns_float, 4, 5, 4, ctx, out, in, stride, tmp + call mangle(ff_tx_fft8_asm_float_avx) RET +%endif %endmacro -FFT8_AVX_FN float, 1 -FFT8_AVX_FN ns_float, 0 +FFT8_AVX_FN 0 +FFT8_AVX_FN 1 -%macro FFT16_FN 3 +%macro FFT16_FN 2 INIT_YMM %1 -cglobal fft16_ %+ %2, 4, 4, 8, ctx, out, in, tmp -%if %3 +%if %2 +cglobal fft16_asm_float, 0, 0, 0, ctx, out, in, stride, tmp movaps m0, [inq + 0*mmsize] movaps m1, [inq + 1*mmsize] movaps m2, [inq + 2*mmsize] movaps m3, [inq + 3*mmsize] %else +cglobal fft16_float, 4, 4, 8, ctx, out, in, tmp mov ctxq, [ctxq + AVTXContext.map] LOAD64_LUT m0, inq, ctxq, (mmsize/2)*0, tmpq, m4 LOAD64_LUT m1, inq, ctxq, (mmsize/2)*1, tmpq, m5 @@ -802,23 +978,34 @@ vextractf128 [outq + 16*6], m5, 1 vextractf128 [outq + 16*7], m1, 1 +%if %2 + ret +%else + RET +%endif + +%if %2 +cglobal fft16_ns_float, 4, 5, 8, ctx, out, in, stride, tmp + call mangle(ff_tx_fft16_asm_float_ %+ %1) RET +%endif %endmacro -FFT16_FN avx, float, 0 -FFT16_FN avx, ns_float, 1 -FFT16_FN fma3, float, 0 -FFT16_FN fma3, ns_float, 1 +FFT16_FN avx, 0 +FFT16_FN avx, 1 +FFT16_FN fma3, 0 +FFT16_FN fma3, 1 -%macro FFT32_FN 3 +%macro FFT32_FN 2 INIT_YMM %1 -cglobal fft32_ %+ %2, 4, 4, 16, ctx, out, in, tmp -%if %3 +%if %2 +cglobal fft32_asm_float, 0, 0, 0, ctx, out, in, stride, tmp movaps m4, [inq + 4*mmsize] movaps m5, [inq + 5*mmsize] movaps m6, [inq + 6*mmsize] movaps m7, [inq + 7*mmsize] %else +cglobal fft32_float, 4, 4, 16, ctx, out, in, tmp mov ctxq, [ctxq + AVTXContext.map] LOAD64_LUT m4, inq, ctxq, (mmsize/2)*4, tmpq, m8, m12 LOAD64_LUT m5, inq, ctxq, (mmsize/2)*5, tmpq, m9, m13 @@ -828,7 +1015,7 @@ FFT8 m4, m5, m6, m7, m8, m9 -%if %3 +%if %2 movaps m0, [inq + 0*mmsize] movaps m1, [inq + 1*mmsize] movaps m2, [inq + 2*mmsize] @@ -875,14 +1062,24 @@ vextractf128 [outq + 16*14], m10, 1 vextractf128 [outq + 16*15], m5, 1 +%if %2 + ret +%else + RET +%endif + +%if %2 +cglobal fft32_ns_float, 4, 5, 16, ctx, out, in, stride, tmp + call mangle(ff_tx_fft32_asm_float_ %+ %1) RET +%endif %endmacro %if ARCH_X86_64 -FFT32_FN avx, float, 0 -FFT32_FN avx, ns_float, 1 -FFT32_FN fma3, float, 0 -FFT32_FN fma3, ns_float, 1 +FFT32_FN avx, 0 +FFT32_FN avx, 1 +FFT32_FN fma3, 0 +FFT32_FN fma3, 1 %endif %macro FFT_SPLIT_RADIX_DEF 1-2 @@ -923,17 +1120,21 @@ %endif %endmacro -%macro FFT_SPLIT_RADIX_FN 3 +%macro FFT_SPLIT_RADIX_FN 2 INIT_YMM %1 -cglobal fft_sr_ %+ %2, 4, 8, 16, 272, lut, out, in, len, tmp, itab, rtab, tgt - movsxd lenq, dword [lutq + AVTXContext.len] - mov lutq, [lutq + AVTXContext.map] +%if %2 +cglobal fft_sr_asm_float, 0, 0, 0, ctx, out, in, stride, len, lut, itab, rtab, tgt, tmp +%else +cglobal fft_sr_float, 4, 10, 16, 272, ctx, out, in, stride, len, lut, itab, rtab, tgt, tmp + movsxd lenq, dword [ctxq + AVTXContext.len] + mov lutq, [ctxq + AVTXContext.map] +%endif mov tgtq, lenq ; Bottom-most/32-point transform =============================================== ALIGN 16 .32pt: -%if %3 +%if %2 movaps m4, [inq + 4*mmsize] movaps m5, [inq + 5*mmsize] movaps m6, [inq + 6*mmsize] @@ -947,7 +1148,7 @@ FFT8 m4, m5, m6, m7, m8, m9 -%if %3 +%if %2 movaps m0, [inq + 0*mmsize] movaps m1, [inq + 1*mmsize] movaps m2, [inq + 2*mmsize] @@ -972,7 +1173,7 @@ movaps [outq + 5*mmsize], m5 movaps [outq + 7*mmsize], m7 -%if %3 +%if %2 add inq, 8*mmsize %else add lutq, (mmsize/2)*8 @@ -1007,7 +1208,7 @@ SWAP m4, m1 SWAP m6, m3 -%if %3 +%if %2 movaps tx1_e0, [inq + 0*mmsize] movaps tx1_e1, [inq + 1*mmsize] movaps tx1_o0, [inq + 2*mmsize] @@ -1021,7 +1222,7 @@ FFT16 tx1_e0, tx1_e1, tx1_o0, tx1_o1, tw_e, tw_o, tx2_o0, tx2_o1 -%if %3 +%if %2 movaps tx2_e0, [inq + 4*mmsize] movaps tx2_e1, [inq + 5*mmsize] movaps tx2_o0, [inq + 6*mmsize] @@ -1038,13 +1239,13 @@ movaps tw_e, [tab_64_float] vperm2f128 tw_o, tw_o, [tab_64_float + 64 - 4*7], 0x23 -%if %3 +%if %2 add inq, 8*mmsize %else add lutq, (mmsize/2)*8 %endif cmp tgtq, 64 - je .deinterleave + je .64pt_deint SPLIT_RADIX_COMBINE_64 @@ -1190,21 +1391,30 @@ ; Final synthesis + deinterleaving code ;=============================================================================== .deinterleave: - cmp lenq, 64 - je .64pt_deint - +%if %2 + PUSH strideq +%endif + mov tgtq, lenq imul tmpq, lenq, 2 - lea lutq, [4*lenq + tmpq] + lea strideq, [4*lenq + tmpq] .synth_deinterleave: - SPLIT_RADIX_COMBINE_DEINTERLEAVE_FULL tmpq, lutq + SPLIT_RADIX_COMBINE_DEINTERLEAVE_FULL tmpq, strideq add outq, 8*mmsize add rtabq, 4*mmsize sub itabq, 4*mmsize - sub lenq, 4*mmsize + sub tgtq, 4*mmsize jg .synth_deinterleave +%if %2 + POP strideq + sub outq, tmpq + neg tmpq + lea inq, [inq + tmpq*4] + ret +%else RET +%endif ; 64-point deinterleave which only has to load 4 registers ===================== .64pt_deint: @@ -1281,14 +1491,446 @@ vextractf128 [outq + 15*mmsize + 0], tw_o, 1 vextractf128 [outq + 15*mmsize + 16], tx2_e1, 1 +%if %2 + sub inq, 16*mmsize + ret +%else + RET +%endif + +%if %2 +cglobal fft_sr_ns_float, 4, 10, 16, 272, ctx, out, in, tmp, len, lut, itab, rtab, tgt, off + movsxd lenq, dword [ctxq + AVTXContext.len] + mov lutq, [ctxq + AVTXContext.map] + + call mangle(ff_tx_fft_sr_asm_float_ %+ %1) RET +%endif %endmacro %if ARCH_X86_64 -FFT_SPLIT_RADIX_FN fma3, float, 0 -FFT_SPLIT_RADIX_FN fma3, ns_float, 1 +FFT_SPLIT_RADIX_FN avx, 0 +FFT_SPLIT_RADIX_FN avx, 1 +FFT_SPLIT_RADIX_FN fma3, 0 +FFT_SPLIT_RADIX_FN fma3, 1 %if HAVE_AVX2_EXTERNAL -FFT_SPLIT_RADIX_FN avx2, float, 0 -FFT_SPLIT_RADIX_FN avx2, ns_float, 1 +FFT_SPLIT_RADIX_FN avx2, 0 +FFT_SPLIT_RADIX_FN avx2, 1 +%endif +%endif + +%macro FFT15_FN 2 +INIT_YMM avx2 +cglobal fft15_ %+ %2, 4, 10, 16, ctx, out, in, stride, len, lut, tmp, tgt5, stride3, stride5 + mov lutq, [ctxq + AVTXContext.map] + + imul stride3q, strideq, 3 + imul stride5q, strideq, 5 + + movaps m11, [mask_mmppmmmm] ; mmppmmmm + movaps m10, [tab_53_float] ; tab5 + movaps xm9, [tab_53_float + 32] ; tab3 + vpermpd m9, m9, q1110 ; tab[23232323] + movaps m8, [s15_perm] + +%if %1 + movups xm0, [inq] + movddup xm5, [inq + 16] + movups m2, [inq + mmsize*0 + 24] + movups m3, [inq + mmsize*1 + 24] + movups m4, [inq + mmsize*2 + 24] +%else + LOAD64_LUT xm0, inq, lutq, 0, tmpq, m14, xm15 + LOAD64_LUT m2, inq, lutq, (mmsize/2)*0 + 12, tmpq, m6, m7 + LOAD64_LUT m3, inq, lutq, (mmsize/2)*1 + 12, tmpq, m14, m15 + LOAD64_LUT m4, inq, lutq, (mmsize/2)*2 + 12, tmpq, m6, m7 + mov tmpd, [lutq + 8] + movddup xm5, [inq + tmpq*8] +%endif + + FFT15 + + lea tgt5q, [outq + stride5q] + lea tmpq, [outq + stride5q*2] + + movhps [outq], xm14 ; out[0] + movhps [outq + stride5q*1], xm15 ; out[5] + movlps [outq + stride5q*2], xm15 ; out[10] + + vextractf128 xm3, m0, 1 + vextractf128 xm4, m1, 1 + vextractf128 xm5, m2, 1 + + movlps [outq + strideq*1], xm1 + movhps [outq + strideq*2], xm2 + movlps [outq + stride3q*1], xm3 + movhps [outq + strideq*4], xm4 + movlps [outq + stride3q*2], xm0 + movlps [outq + strideq*8], xm5 + movhps [outq + stride3q*4], xm0 + movhps [tgt5q + strideq*2], xm1 + movhps [tgt5q + strideq*4], xm3 + movlps [tmpq + strideq*1], xm2 + movlps [tmpq + stride3q*1], xm4 + movhps [tmpq + strideq*4], xm5 + + RET +%endmacro + +%if ARCH_X86_64 && HAVE_AVX2_EXTERNAL +FFT15_FN 0, float +FFT15_FN 1, ns_float +%endif + +%macro IMDCT_FN 1 +INIT_YMM %1 +cglobal mdct_inv_float, 4, 14, 16, 320, ctx, out, in, stride, len, lut, exp, t1, t2, t3, \ + t4, t5, btmp + movsxd lenq, dword [ctxq + AVTXContext.len] + mov expq, [ctxq + AVTXContext.exp] + + lea t1d, [lend - 1] + imul t1d, strided + + mov btmpq, ctxq ; backup original context + mov lutq, [ctxq + AVTXContext.map] ; load map + + cmp strideq, 4 + je .stride4 + + shl strideq, 1 + movd xm4, strided + vpbroadcastd m4, xm4 ; stride splatted + movd xm5, t1d + vpbroadcastd m5, xm5 ; offset splatted + + mov t2q, outq ; don't modify the original output + pcmpeqd m15, m15 ; set all bits to 1 + +.stridex_pre: + pmulld m2, m4, [lutq] ; multiply by stride + movaps m0, m15 + psubd m3, m5, m2 ; subtract from offset + movaps m1, m15 + vgatherdps m6, [inq + m2], m0 ; im + vgatherdps m7, [inq + m3], m1 ; re + + movaps m8, [expq + 0*mmsize] ; tab 1 + movaps m9, [expq + 1*mmsize] ; tab 2 + + unpcklps m0, m7, m6 ; re, im, re, im + unpckhps m1, m7, m6 ; re, im, re, im + + vperm2f128 m2, m1, m0, 0x02 ; output order + vperm2f128 m3, m1, m0, 0x13 ; output order + + movshdup m10, m8 ; tab 1 imim + movshdup m11, m9 ; tab 2 imim + movsldup m12, m8 ; tab 1 rere + movsldup m13, m9 ; tab 2 rere + + mulps m10, m2 ; 1 reim * imim + mulps m11, m3 ; 2 reim * imim + + shufps m10, m10, m10, q2301 + shufps m11, m11, m11, q2301 + + fmaddsubps m10, m12, m2, m10 + fmaddsubps m11, m13, m3, m11 + + movups [t2q + 0*mmsize], m10 + movups [t2q + 1*mmsize], m11 + + add expq, mmsize*2 + add lutq, mmsize + add t2q, mmsize*2 + sub lenq, mmsize/2 + jg .stridex_pre + jmp .transform + +.stride4: + lea expq, [expq + lenq*4] + lea lutq, [lutq + lenq*2] + lea t1q, [inq + t1q] + lea t1q, [t1q + strideq - mmsize] + lea t2q, [lenq*2 - mmsize/2] + +.stride4_pre: + movups m4, [inq] + movups m3, [t1q] + + movsldup m1, m4 ; im im, im im + movshdup m0, m3 ; re re, re re + movshdup m4, m4 ; re re, re re (2) + movsldup m3, m3 ; im im, im im (2) + + movups m2, [expq] ; tab + movups m5, [expq + 2*t2q] ; tab (2) + + vpermpd m0, m0, q0123 ; flip + shufps m7, m2, m2, q2301 + vpermpd m4, m4, q0123 ; flip (2) + shufps m8, m5, m5, q2301 + + mulps m1, m7 ; im im * tab.reim + mulps m3, m8 ; im im * tab.reim (2) + + fmaddsubps m0, m0, m2, m1 + fmaddsubps m4, m4, m5, m3 + + vextractf128 xm3, m0, 1 + vextractf128 xm6, m4, 1 + + ; scatter + movsxd strideq, dword [lutq + 0*4] + movsxd lenq, dword [lutq + 1*4] + movsxd t3q, dword [lutq + 2*4] + movsxd t4q, dword [lutq + 3*4] + + movlps [outq + strideq*8], xm0 + movhps [outq + lenq*8], xm0 + movlps [outq + t3q*8], xm3 + movhps [outq + t4q*8], xm3 + + movsxd strideq, dword [lutq + 0*4 + t2q] + movsxd lenq, dword [lutq + 1*4 + t2q] + movsxd t3q, dword [lutq + 2*4 + t2q] + movsxd t4q, dword [lutq + 3*4 + t2q] + + movlps [outq + strideq*8], xm4 + movhps [outq + lenq*8], xm4 + movlps [outq + t3q*8], xm6 + movhps [outq + t4q*8], xm6 + + add lutq, mmsize/2 + add expq, mmsize + add inq, mmsize + sub t1q, mmsize + sub t2q, mmsize + jge .stride4_pre + +.transform: + mov strideq, 2*4 + mov t4q, ctxq ; backup original context + mov t5q, [ctxq + AVTXContext.fn] ; subtransform's jump point + mov ctxq, [ctxq + AVTXContext.sub] + mov lutq, [ctxq + AVTXContext.map] + movsxd lenq, dword [ctxq + AVTXContext.len] + + mov inq, outq ; in-place transform + call t5q ; call the FFT + + mov ctxq, t4q ; restore original context + movsxd lenq, dword [ctxq + AVTXContext.len] + mov expq, [ctxq + AVTXContext.exp] + lea expq, [expq + lenq*4] + + xor t1q, t1q ; low + lea t2q, [lenq*4 - mmsize] ; high + +.post: + movaps m2, [expq + t2q] ; tab h + movaps m3, [expq + t1q] ; tab l + movups m0, [outq + t2q] ; in h + movups m1, [outq + t1q] ; in l + + movshdup m4, m2 ; tab h imim + movshdup m5, m3 ; tab l imim + movsldup m6, m2 ; tab h rere + movsldup m7, m3 ; tab l rere + + shufps m2, m0, m0, q2301 ; in h imre + shufps m3, m1, m1, q2301 ; in l imre + + mulps m6, m0 + mulps m7, m1 + + fmaddsubps m4, m4, m2, m6 + fmaddsubps m5, m5, m3, m7 + + vpermpd m3, m5, q0123 ; flip + vpermpd m2, m4, q0123 ; flip + + blendps m1, m2, m5, 01010101b + blendps m0, m3, m4, 01010101b + + movups [outq + t2q], m0 + movups [outq + t1q], m1 + + add t1q, mmsize + sub t2q, mmsize + sub lenq, mmsize/2 + jg .post + + RET +%endmacro + +%if ARCH_X86_64 && HAVE_AVX2_EXTERNAL +IMDCT_FN avx2 +%endif + +%macro PFA_15_FN 2 +INIT_YMM %1 +%if %2 +cglobal fft_pfa_15xM_asm_float, 0, 0, 0, ctx, out, in, stride, len, lut, buf, map, tgt, tmp, \ + tgt5, stride3, stride5, btmp +%else +cglobal fft_pfa_15xM_float, 4, 14, 16, 320, ctx, out, in, stride, len, lut, buf, map, tgt, tmp, \ + tgt5, stride3, stride5, btmp %endif + +%if %2 + PUSH inq + PUSH tgt5q + PUSH stride3q + PUSH stride5q + PUSH btmpq +%endif + + PUSH strideq + + mov btmpq, outq + + mov outq, [ctxq + AVTXContext.tmp] +%if %2 == 0 + movsxd lenq, dword [ctxq + AVTXContext.len] + mov lutq, [ctxq + AVTXContext.map] +%endif + + ; Load stride (second transform's length) and second transform's LUT + mov tmpq, [ctxq + AVTXContext.sub] + movsxd strideq, dword [tmpq + AVTXContext.len] + mov mapq, [tmpq + AVTXContext.map] + + shl strideq, 3 + imul stride3q, strideq, 3 + imul stride5q, strideq, 5 + + movaps m11, [mask_mmppmmmm] ; mmppmmmm + movaps m10, [tab_53_float] ; tab5 + movaps xm9, [tab_53_float + 32] ; tab3 + vpermpd m9, m9, q1110 ; tab[23232323] + movaps m8, [s15_perm] + +.dim1: + mov tmpd, [mapq] + lea tgtq, [outq + tmpq*8] + +%if %2 + movups xm0, [inq] ; in[0,1].reim + movddup xm5, [inq + 16] ; in[2].reimreim + movups m2, [inq + mmsize*0 + 24] ; in[3-6].reim + movups m3, [inq + mmsize*1 + 24] ; in[7-11].reim + movups m4, [inq + mmsize*2 + 24] ; in[12-15].reim +%else + LOAD64_LUT xm0, inq, lutq, 0, tmpq, m14, xm15 ; in[0,1].reim + LOAD64_LUT m2, inq, lutq, (mmsize/2)*0 + 12, tmpq, m6, m7 + LOAD64_LUT m3, inq, lutq, (mmsize/2)*1 + 12, tmpq, m14, m15 + LOAD64_LUT m4, inq, lutq, (mmsize/2)*2 + 12, tmpq, m6, m7 + mov tmpd, [lutq + 8] + movddup xm5, [inq + tmpq*8] ; in[2].reimreim +%endif + + FFT15 + + lea tgt5q, [tgtq + stride5q] + lea tmpq, [tgtq + stride5q*2] + + movhps [tgtq], xm14 ; out[0] + movhps [tgtq + stride5q*1], xm15 ; out[5] + movlps [tgtq + stride5q*2], xm15 ; out[10] + + vextractf128 xm3, m0, 1 + vextractf128 xm4, m1, 1 + vextractf128 xm5, m2, 1 + + movlps [tgtq + strideq*1], xm1 + movhps [tgtq + strideq*2], xm2 + movlps [tgtq + stride3q*1], xm3 + movhps [tgtq + strideq*4], xm4 + movlps [tgtq + stride3q*2], xm0 + movlps [tgtq + strideq*8], xm5 + movhps [tgtq + stride3q*4], xm0 + movhps [tgt5q + strideq*2], xm1 + movhps [tgt5q + strideq*4], xm3 + movlps [tmpq + strideq*1], xm2 + movlps [tmpq + stride3q*1], xm4 + movhps [tmpq + strideq*4], xm5 + +%if %2 + add inq, mmsize*3 + 24 +%else + add lutq, (mmsize/2)*3 + 12 +%endif + add mapq, 4 + sub lenq, 15 + jg .dim1 + + ; Second transform setup + mov stride5q, ctxq ; backup original context + movsxd stride3q, dword [ctxq + AVTXContext.len] ; full length + mov tgt5q, [ctxq + AVTXContext.fn] ; subtransform's jump point + + mov inq, outq ; in-place transform + mov ctxq, [ctxq + AVTXContext.sub] ; load subtransform's context + mov lutq, [ctxq + AVTXContext.map] ; load subtransform's map + movsxd lenq, dword [ctxq + AVTXContext.len] ; load subtransform's length + +.dim2: + call tgt5q ; call the FFT + lea inq, [inq + lenq*8] + lea outq, [outq + lenq*8] + sub stride3q, lenq + jg .dim2 + + mov ctxq, stride5q ; restore original context + mov lutq, [ctxq + AVTXContext.map] + mov inq, [ctxq + AVTXContext.tmp] + movsxd lenq, dword [ctxq + AVTXContext.len] ; full length + + lea stride3q, [lutq + lenq*4] ; second part of the LUT + mov stride5q, lenq + mov tgt5q, btmpq + POP strideq + lea tmpq, [strideq + 2*strideq] + +.post: + LOAD64_LUT m0, inq, stride3q, 0, tmpq, m8, m9 + vextractf128 xm1, m0, 1 + movlps [tgt5q], xm0 + movhps [tgt5q + strideq], xm0 + movlps [tgt5q + strideq*2], xm1 + movhps [tgt5q + tmpq], xm1 + + lea tgt5q, [tgt5q + 4*strideq] + add stride3q, mmsize/2 + sub stride5q, mmsize/8 + jg .post + +%if %2 + mov outq, btmpq + POP btmpq + POP stride5q + POP stride3q + POP tgt5q + POP inq + ret +%else + RET +%endif + +%if %2 +cglobal fft_pfa_15xM_ns_float, 4, 14, 16, 320, ctx, out, in, stride, len, lut, buf, map, tgt, tmp, \ + tgt5, stride3, stride5, btmp + movsxd lenq, dword [ctxq + AVTXContext.len] + mov lutq, [ctxq + AVTXContext.map] + + call mangle(ff_tx_fft_pfa_15xM_asm_float) + RET +%endif +%endmacro + +%if ARCH_X86_64 && HAVE_AVX2_EXTERNAL +PFA_15_FN avx2, 0 +PFA_15_FN avx2, 1 %endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libavutil/x86/tx_float_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -30,6 +30,8 @@ TX_DECL_FN(fft8_ns, sse3) TX_DECL_FN(fft8, avx) TX_DECL_FN(fft8_ns, avx) +TX_DECL_FN(fft15, avx2) +TX_DECL_FN(fft15_ns, avx2) TX_DECL_FN(fft16, avx) TX_DECL_FN(fft16_ns, avx) TX_DECL_FN(fft16, fma3) @@ -38,11 +40,33 @@ TX_DECL_FN(fft32_ns, avx) TX_DECL_FN(fft32, fma3) TX_DECL_FN(fft32_ns, fma3) +TX_DECL_FN(fft_sr, avx) +TX_DECL_FN(fft_sr_ns, avx) TX_DECL_FN(fft_sr, fma3) TX_DECL_FN(fft_sr_ns, fma3) TX_DECL_FN(fft_sr, avx2) TX_DECL_FN(fft_sr_ns, avx2) +TX_DECL_FN(fft_pfa_15xM, avx2) +TX_DECL_FN(fft_pfa_15xM_ns, avx2) + +TX_DECL_FN(mdct_inv, avx2) + +TX_DECL_FN(fft2_asm, sse3) +TX_DECL_FN(fft4_fwd_asm, sse2) +TX_DECL_FN(fft4_inv_asm, sse2) +TX_DECL_FN(fft8_asm, sse3) +TX_DECL_FN(fft8_asm, avx) +TX_DECL_FN(fft16_asm, avx) +TX_DECL_FN(fft16_asm, fma3) +TX_DECL_FN(fft32_asm, avx) +TX_DECL_FN(fft32_asm, fma3) +TX_DECL_FN(fft_sr_asm, avx) +TX_DECL_FN(fft_sr_asm, fma3) +TX_DECL_FN(fft_sr_asm, avx2) + +TX_DECL_FN(fft_pfa_15xM_asm, avx2) + #define DECL_INIT_FN(basis, interleave) \ static av_cold int b ##basis## _i ##interleave(AVTXContext *s, \ const FFTXCodelet *cd, \ @@ -51,51 +75,234 @@ int len, int inv, \ const void *scale) \ { \ - const int inv_lookup = opts ? opts->invert_lookup : 1; \ ff_tx_init_tabs_float(len); \ if (cd->max_len == 2) \ - return ff_tx_gen_ptwo_revtab(s, inv_lookup); \ + return ff_tx_gen_ptwo_revtab(s, opts); \ else \ - return ff_tx_gen_split_radix_parity_revtab(s, inv_lookup, \ + return ff_tx_gen_split_radix_parity_revtab(s, len, inv, opts, \ basis, interleave); \ } DECL_INIT_FN(8, 0) DECL_INIT_FN(8, 2) +static av_cold int factor_init(AVTXContext *s, const FFTXCodelet *cd, + uint64_t flags, FFTXCodeletOptions *opts, + int len, int inv, const void *scale) +{ + int ret; + + /* The transformations below are performed in the gather domain, + * so override the option and let the infrastructure convert the map + * to SCATTER if needed. */ + FFTXCodeletOptions sub_opts = { .map_dir = FF_TX_MAP_GATHER }; + + TX_TAB(ff_tx_init_tabs)(len); + + if (len == 15) + ret = ff_tx_gen_pfa_input_map(s, &sub_opts, 3, 5); + else + ret = ff_tx_gen_default_map(s, &sub_opts); + + if (ret < 0) + return ret; + + if (len == 15) { + int cnt = 0, tmp[15]; + + /* Special permutation to simplify loads in the pre-permuted version */ + memcpy(tmp, s->map, 15*sizeof(*tmp)); + for (int i = 1; i < 15; i += 3) { + s->map[cnt] = tmp[i]; + cnt++; + } + for (int i = 2; i < 15; i += 3) { + s->map[cnt] = tmp[i]; + cnt++; + } + for (int i = 0; i < 15; i += 3) { + s->map[cnt] = tmp[i]; + cnt++; + } + memmove(&s->map[7], &s->map[6], 4*sizeof(int)); + memmove(&s->map[3], &s->map[1], 4*sizeof(int)); + s->map[1] = tmp[2]; + s->map[2] = tmp[0]; + } + + return 0; +} + +static av_cold int m_inv_init(AVTXContext *s, const FFTXCodelet *cd, + uint64_t flags, FFTXCodeletOptions *opts, + int len, int inv, const void *scale) +{ + int ret; + FFTXCodeletOptions sub_opts = { .map_dir = FF_TX_MAP_GATHER }; + + s->scale_d = *((SCALE_TYPE *)scale); + s->scale_f = s->scale_d; + + flags &= ~FF_TX_OUT_OF_PLACE; /* We want the subtransform to be */ + flags |= AV_TX_INPLACE; /* in-place */ + flags |= FF_TX_PRESHUFFLE; /* This function handles the permute step */ + flags |= FF_TX_ASM_CALL; /* We want an assembly function, not C */ + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, len >> 1, + inv, scale))) + return ret; + + s->map = av_malloc(len*sizeof(*s->map)); + if (!s->map) + return AVERROR(ENOMEM); + + memcpy(s->map, s->sub->map, (len >> 1)*sizeof(*s->map)); + /* Invert lookup table for unstrided path */ + for (int i = 0; i < (len >> 1); i++) + s->map[(len >> 1) + s->map[i]] = i; + + if ((ret = ff_tx_mdct_gen_exp_float(s, s->map))) + return ret; + + return 0; +} + +static av_cold int fft_pfa_init(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret; + int sub_len = len / cd->factors[0]; + FFTXCodeletOptions sub_opts = { .map_dir = FF_TX_MAP_SCATTER }; + + flags &= ~FF_TX_OUT_OF_PLACE; /* We want the subtransform to be */ + flags |= AV_TX_INPLACE; /* in-place */ + flags |= FF_TX_PRESHUFFLE; /* This function handles the permute step */ + flags |= FF_TX_ASM_CALL; /* We want an assembly function, not C */ + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, &sub_opts, + sub_len, inv, scale))) + return ret; + + if ((ret = ff_tx_gen_compound_mapping(s, opts, s->inv, cd->factors[0], sub_len))) + return ret; + + if (cd->factors[0] == 15) { + int tmp[15]; + + /* Our 15-point transform is also a compound one, so embed its input map */ + TX_EMBED_INPUT_PFA_MAP(s->map, len, 3, 5); + + /* Special permutation to simplify loads in the pre-permuted version */ + for (int k = 0; k < s->sub[0].len; k++) { + int cnt = 0; + memcpy(tmp, &s->map[k*15], 15*sizeof(*tmp)); + for (int i = 1; i < 15; i += 3) { + s->map[k*15 + cnt] = tmp[i]; + cnt++; + } + for (int i = 2; i < 15; i += 3) { + s->map[k*15 + cnt] = tmp[i]; + cnt++; + } + for (int i = 0; i < 15; i += 3) { + s->map[k*15 + cnt] = tmp[i]; + cnt++; + } + memmove(&s->map[k*15 + 7], &s->map[k*15 + 6], 4*sizeof(int)); + memmove(&s->map[k*15 + 3], &s->map[k*15 + 1], 4*sizeof(int)); + s->map[k*15 + 1] = tmp[2]; + s->map[k*15 + 2] = tmp[0]; + } + } + + if (!(s->tmp = av_malloc(len*sizeof(*s->tmp)))) + return AVERROR(ENOMEM); + + TX_TAB(ff_tx_init_tabs)(len / sub_len); + + return 0; +} + const FFTXCodelet * const ff_tx_codelet_list_float_x86[] = { TX_DEF(fft2, FFT, 2, 2, 2, 0, 128, NULL, sse3, SSE3, AV_TX_INPLACE, 0), + TX_DEF(fft2_asm, FFT, 2, 2, 2, 0, 192, b8_i0, sse3, SSE3, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, 0), TX_DEF(fft2, FFT, 2, 2, 2, 0, 192, b8_i0, sse3, SSE3, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), TX_DEF(fft4_fwd, FFT, 4, 4, 2, 0, 128, NULL, sse2, SSE2, AV_TX_INPLACE | FF_TX_FORWARD_ONLY, 0), + TX_DEF(fft4_fwd_asm, FFT, 4, 4, 2, 0, 192, b8_i0, sse2, SSE2, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, 0), + TX_DEF(fft4_inv_asm, FFT, 4, 4, 2, 0, 128, NULL, sse2, SSE2, + AV_TX_INPLACE | FF_TX_INVERSE_ONLY | FF_TX_ASM_CALL, 0), TX_DEF(fft4_fwd, FFT, 4, 4, 2, 0, 192, b8_i0, sse2, SSE2, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), TX_DEF(fft4_inv, FFT, 4, 4, 2, 0, 128, NULL, sse2, SSE2, AV_TX_INPLACE | FF_TX_INVERSE_ONLY, 0), TX_DEF(fft8, FFT, 8, 8, 2, 0, 128, b8_i0, sse3, SSE3, AV_TX_INPLACE, 0), + TX_DEF(fft8_asm, FFT, 8, 8, 2, 0, 192, b8_i0, sse3, SSE3, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, 0), TX_DEF(fft8_ns, FFT, 8, 8, 2, 0, 192, b8_i0, sse3, SSE3, AV_TX_INPLACE | FF_TX_PRESHUFFLE, 0), TX_DEF(fft8, FFT, 8, 8, 2, 0, 256, b8_i0, avx, AVX, AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft8_asm, FFT, 8, 8, 2, 0, 320, b8_i0, avx, AVX, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft8_ns, FFT, 8, 8, 2, 0, 320, b8_i0, avx, AVX, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft16, FFT, 16, 16, 2, 0, 256, b8_i2, avx, AVX, AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft16_asm, FFT, 16, 16, 2, 0, 320, b8_i2, avx, AVX, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft16_ns, FFT, 16, 16, 2, 0, 320, b8_i2, avx, AVX, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft16, FFT, 16, 16, 2, 0, 288, b8_i2, fma3, FMA3, AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft16_asm, FFT, 16, 16, 2, 0, 352, b8_i2, fma3, FMA3, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft16_ns, FFT, 16, 16, 2, 0, 352, b8_i2, fma3, FMA3, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), #if ARCH_X86_64 TX_DEF(fft32, FFT, 32, 32, 2, 0, 256, b8_i2, avx, AVX, AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft32_asm, FFT, 32, 32, 2, 0, 320, b8_i2, avx, AVX, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft32_ns, FFT, 32, 32, 2, 0, 320, b8_i2, avx, AVX, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft32, FFT, 32, 32, 2, 0, 288, b8_i2, fma3, FMA3, AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft32_asm, FFT, 32, 32, 2, 0, 352, b8_i2, fma3, FMA3, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft32_ns, FFT, 32, 32, 2, 0, 352, b8_i2, fma3, FMA3, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft_sr, FFT, 64, 131072, 2, 0, 256, b8_i2, avx, AVX, 0, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft_sr_asm, FFT, 64, 131072, 2, 0, 320, b8_i2, avx, AVX, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft_sr_ns, FFT, 64, 131072, 2, 0, 320, b8_i2, avx, AVX, AV_TX_INPLACE | FF_TX_PRESHUFFLE, + AV_CPU_FLAG_AVXSLOW), TX_DEF(fft_sr, FFT, 64, 131072, 2, 0, 288, b8_i2, fma3, FMA3, 0, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft_sr_asm, FFT, 64, 131072, 2, 0, 352, b8_i2, fma3, FMA3, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW), TX_DEF(fft_sr_ns, FFT, 64, 131072, 2, 0, 352, b8_i2, fma3, FMA3, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), + #if HAVE_AVX2_EXTERNAL + TX_DEF(fft15, FFT, 15, 15, 15, 0, 320, factor_init, avx2, AVX2, + AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft15_ns, FFT, 15, 15, 15, 0, 384, factor_init, avx2, AVX2, + AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW), + TX_DEF(fft_sr, FFT, 64, 131072, 2, 0, 320, b8_i2, avx2, AVX2, 0, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), + TX_DEF(fft_sr_asm, FFT, 64, 131072, 2, 0, 384, b8_i2, avx2, AVX2, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), TX_DEF(fft_sr_ns, FFT, 64, 131072, 2, 0, 384, b8_i2, avx2, AVX2, AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), + + TX_DEF(fft_pfa_15xM, FFT, 60, TX_LEN_UNLIMITED, 15, 2, 320, fft_pfa_init, avx2, AVX2, + AV_TX_INPLACE, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), + TX_DEF(fft_pfa_15xM_asm, FFT, 60, TX_LEN_UNLIMITED, 15, 2, 384, fft_pfa_init, avx2, AVX2, + AV_TX_INPLACE | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), + TX_DEF(fft_pfa_15xM_ns, FFT, 60, TX_LEN_UNLIMITED, 15, 2, 384, fft_pfa_init, avx2, AVX2, + AV_TX_INPLACE | FF_TX_PRESHUFFLE, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), + + TX_DEF(mdct_inv, MDCT, 16, TX_LEN_UNLIMITED, 2, TX_FACTOR_ANY, 384, m_inv_init, avx2, AVX2, + FF_TX_INVERSE_ONLY, AV_CPU_FLAG_AVXSLOW | AV_CPU_FLAG_SLOW_GATHER), #endif #endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -10,4 +10,4 @@ version.o \ # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += postprocres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += postprocres.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,28 +26,27 @@ */ /* - C MMX MMX2 3DNow AltiVec -isVertDC Ec Ec Ec -isVertMinMaxOk Ec Ec Ec -doVertLowPass E e e Ec -doVertDefFilter Ec Ec e e Ec -isHorizDC Ec Ec Ec -isHorizMinMaxOk a E Ec -doHorizLowPass E e e Ec -doHorizDefFilter Ec Ec e e Ec -do_a_deblock Ec E Ec E -deRing E e e* Ecp -Vertical RKAlgo1 E a a -Horizontal RKAlgo1 a a -Vertical X1# a E E -Horizontal X1# a E E -LinIpolDeinterlace e E E* -CubicIpolDeinterlace a e e* -LinBlendDeinterlace e E E* + C MMX MMX2 AltiVec +isVertDC Ec Ec Ec +isVertMinMaxOk Ec Ec Ec +doVertLowPass E e Ec +doVertDefFilter Ec Ec e Ec +isHorizDC Ec Ec Ec +isHorizMinMaxOk a E Ec +doHorizLowPass E e Ec +doHorizDefFilter Ec Ec e Ec +do_a_deblock Ec E Ec +deRing E e Ecp +Vertical RKAlgo1 E a +Horizontal RKAlgo1 a +Vertical X1# a E +Horizontal X1# a E +LinIpolDeinterlace e E +CubicIpolDeinterlace a e +LinBlendDeinterlace e E MedianDeinterlace# E Ec Ec -TempDeNoiser# E e e Ec +TempDeNoiser# E e Ec -* I do not have a 3DNow! CPU -> it is untested, but no one said it does not work so it seems to work # more or less selfinvented filters so the exactness is not too meaningful E = Exact implementation e = almost exact implementation (slightly different rounding,...) @@ -83,7 +82,6 @@ #include #include //#undef HAVE_MMXEXT_INLINE -//#define HAVE_AMD3DNOW_INLINE //#undef HAVE_MMX_INLINE //#undef ARCH_X86 //#define DEBUG_BRIGHTNESS @@ -494,7 +492,7 @@ } } -//Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one +//Note: we have C and SSE2 version (which uses MMX(EXT) when advantageous) //Plain C versions //we always compile C for testing which needs bitexactness #define TEMPLATE_PP_C 1 @@ -508,27 +506,12 @@ #if ARCH_X86 && HAVE_INLINE_ASM # if CONFIG_RUNTIME_CPUDETECT -# define TEMPLATE_PP_MMX 1 -# include "postprocess_template.c" -# define TEMPLATE_PP_MMXEXT 1 -# include "postprocess_template.c" -# define TEMPLATE_PP_3DNOW 1 -# include "postprocess_template.c" # define TEMPLATE_PP_SSE2 1 # include "postprocess_template.c" # else # if HAVE_SSE2_INLINE # define TEMPLATE_PP_SSE2 1 # include "postprocess_template.c" -# elif HAVE_MMXEXT_INLINE -# define TEMPLATE_PP_MMXEXT 1 -# include "postprocess_template.c" -# elif HAVE_AMD3DNOW_INLINE -# define TEMPLATE_PP_3DNOW 1 -# include "postprocess_template.c" -# elif HAVE_MMX_INLINE -# define TEMPLATE_PP_MMX 1 -# include "postprocess_template.c" # endif # endif #endif @@ -549,21 +532,12 @@ #if ARCH_X86 && HAVE_INLINE_ASM // ordered per speed fastest first if (c->cpuCaps & AV_CPU_FLAG_SSE2) pp = postProcess_SSE2; - else if (c->cpuCaps & AV_CPU_FLAG_MMXEXT) pp = postProcess_MMX2; - else if (c->cpuCaps & AV_CPU_FLAG_3DNOW) pp = postProcess_3DNow; - else if (c->cpuCaps & AV_CPU_FLAG_MMX) pp = postProcess_MMX; #elif HAVE_ALTIVEC if (c->cpuCaps & AV_CPU_FLAG_ALTIVEC) pp = postProcess_altivec; #endif #else /* CONFIG_RUNTIME_CPUDETECT */ #if HAVE_SSE2_INLINE pp = postProcess_SSE2; -#elif HAVE_MMXEXT_INLINE - pp = postProcess_MMX2; -#elif HAVE_AMD3DNOW_INLINE - pp = postProcess_3DNow; -#elif HAVE_MMX_INLINE - pp = postProcess_MMX; #elif HAVE_ALTIVEC pp = postProcess_altivec; #endif @@ -877,9 +851,6 @@ c->cpuCaps = av_get_cpu_flags(); } else { c->cpuCaps = 0; - if (cpuCaps & PP_CPU_CAPS_MMX) c->cpuCaps |= AV_CPU_FLAG_MMX; - if (cpuCaps & PP_CPU_CAPS_MMX2) c->cpuCaps |= AV_CPU_FLAG_MMXEXT; - if (cpuCaps & PP_CPU_CAPS_3DNOW) c->cpuCaps |= AV_CPU_FLAG_3DNOW; if (cpuCaps & PP_CPU_CAPS_ALTIVEC) c->cpuCaps |= AV_CPU_FLAG_ALTIVEC; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess_template.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess_template.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess_template.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/postprocess_template.c 2023-03-03 13:29:59.000000000 +0000 @@ -20,7 +20,7 @@ /** * @file - * mmx/mmx2/3dnow postprocess code. + * mmx/mmx2/sse2 postprocess code. */ #include "libavutil/mem_internal.h" @@ -57,14 +57,6 @@ # define TEMPLATE_PP_MMXEXT 0 #endif -#ifdef TEMPLATE_PP_3DNOW -# undef TEMPLATE_PP_MMX -# define TEMPLATE_PP_MMX 1 -# define RENAME(a) a ## _3DNow -#else -# define TEMPLATE_PP_3DNOW 0 -#endif - #ifdef TEMPLATE_PP_SSE2 # undef TEMPLATE_PP_MMX # define TEMPLATE_PP_MMX 1 @@ -82,30 +74,19 @@ #if TEMPLATE_PP_MMXEXT #define REAL_PAVGB(a,b) "pavgb " #a ", " #b " \n\t" -#elif TEMPLATE_PP_3DNOW -#define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" #endif #define PAVGB(a,b) REAL_PAVGB(a,b) #if TEMPLATE_PP_MMXEXT #define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t" -#elif TEMPLATE_PP_MMX -#define PMINUB(b,a,t) \ - "movq " #a ", " #t " \n\t"\ - "psubusb " #b ", " #t " \n\t"\ - "psubb " #t ", " #a " \n\t" #endif #if TEMPLATE_PP_MMXEXT #define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t" -#elif TEMPLATE_PP_MMX -#define PMAXUB(a,b) \ - "psubusb " #a ", " #b " \n\t"\ - "paddb " #a ", " #b " \n\t" #endif //FIXME? |255-0| = 1 (should not be a problem ...) -#if TEMPLATE_PP_MMX +#if TEMPLATE_PP_MMXEXT /** * Check if the middle 8x8 Block in the given 8x16 block is flat */ @@ -185,20 +166,8 @@ "psubusb %%mm3, %%mm4 \n\t" " \n\t" -#if TEMPLATE_PP_MMXEXT "pxor %%mm7, %%mm7 \n\t" "psadbw %%mm7, %%mm0 \n\t" -#else - "movq %%mm0, %%mm1 \n\t" - "psrlw $8, %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" - "movq %%mm0, %%mm1 \n\t" - "psrlq $16, %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" - "movq %%mm0, %%mm1 \n\t" - "psrlq $32, %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" -#endif "movq %4, %%mm7 \n\t" // QP,..., QP "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP "psubusb %%mm7, %%mm4 \n\t" // Diff <= 2QP -> 0 @@ -219,7 +188,7 @@ return 2; } } -#endif //TEMPLATE_PP_MMX +#endif //TEMPLATE_PP_MMXEXT /** * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle) @@ -228,7 +197,7 @@ #if !TEMPLATE_PP_ALTIVEC static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT src+= stride*3; __asm__ volatile( //"movv %0 %1 %2\n\t" "movq %2, %%mm0 \n\t" // QP,..., QP @@ -355,7 +324,7 @@ : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) : "%"FF_REG_a, "%"FF_REG_c ); -#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_MMXEXT const int l1= stride; const int l2= stride + l1; const int l3= stride + l2; @@ -394,7 +363,7 @@ src++; } -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } #endif //TEMPLATE_PP_ALTIVEC @@ -407,7 +376,7 @@ */ static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT src+= stride*3; __asm__ volatile( @@ -494,7 +463,7 @@ NAMED_CONSTRAINTS_ADD(b01) : "%"FF_REG_a, "%"FF_REG_c ); -#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_MMXEXT const int l1= stride; const int l2= stride + l1; @@ -528,13 +497,13 @@ } src++; } -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } #if !TEMPLATE_PP_ALTIVEC static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT /* uint8_t tmp[16]; const int l1= stride; @@ -816,239 +785,7 @@ } } */ -#elif TEMPLATE_PP_MMX - DECLARE_ALIGNED(8, uint64_t, tmp)[4]; // make space for 4 8-byte vars - src+= stride*4; - __asm__ volatile( - "pxor %%mm7, %%mm7 \n\t" -// 0 1 2 3 4 5 6 7 -// %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 edx+%1 edx+2%1 -// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 - - "movq (%0), %%mm0 \n\t" - "movq %%mm0, %%mm1 \n\t" - "punpcklbw %%mm7, %%mm0 \n\t" // low part of line 0 - "punpckhbw %%mm7, %%mm1 \n\t" // high part of line 0 - - "movq (%0, %1), %%mm2 \n\t" - "lea (%0, %1, 2), %%"FF_REG_a" \n\t" - "movq %%mm2, %%mm3 \n\t" - "punpcklbw %%mm7, %%mm2 \n\t" // low part of line 1 - "punpckhbw %%mm7, %%mm3 \n\t" // high part of line 1 - - "movq (%%"FF_REG_a"), %%mm4 \n\t" - "movq %%mm4, %%mm5 \n\t" - "punpcklbw %%mm7, %%mm4 \n\t" // low part of line 2 - "punpckhbw %%mm7, %%mm5 \n\t" // high part of line 2 - - "paddw %%mm0, %%mm0 \n\t" // 2L0 - "paddw %%mm1, %%mm1 \n\t" // 2H0 - "psubw %%mm4, %%mm2 \n\t" // L1 - L2 - "psubw %%mm5, %%mm3 \n\t" // H1 - H2 - "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2 - "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2 - - "psllw $2, %%mm2 \n\t" // 4L1 - 4L2 - "psllw $2, %%mm3 \n\t" // 4H1 - 4H2 - "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - - "movq (%%"FF_REG_a", %1), %%mm2 \n\t" - "movq %%mm2, %%mm3 \n\t" - "punpcklbw %%mm7, %%mm2 \n\t" // L3 - "punpckhbw %%mm7, %%mm3 \n\t" // H3 - - "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - L3 - "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - H3 - "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 - "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 - "movq %%mm0, (%3) \n\t" // 2L0 - 5L1 + 5L2 - 2L3 - "movq %%mm1, 8(%3) \n\t" // 2H0 - 5H1 + 5H2 - 2H3 - - "movq (%%"FF_REG_a", %1, 2), %%mm0 \n\t" - "movq %%mm0, %%mm1 \n\t" - "punpcklbw %%mm7, %%mm0 \n\t" // L4 - "punpckhbw %%mm7, %%mm1 \n\t" // H4 - - "psubw %%mm0, %%mm2 \n\t" // L3 - L4 - "psubw %%mm1, %%mm3 \n\t" // H3 - H4 - "movq %%mm2, 16(%3) \n\t" // L3 - L4 - "movq %%mm3, 24(%3) \n\t" // H3 - H4 - "paddw %%mm4, %%mm4 \n\t" // 2L2 - "paddw %%mm5, %%mm5 \n\t" // 2H2 - "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4 - "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4 - - "lea (%%"FF_REG_a", %1), %0 \n\t" - "psllw $2, %%mm2 \n\t" // 4L3 - 4L4 - "psllw $2, %%mm3 \n\t" // 4H3 - 4H4 - "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 -//50 opcodes so far - "movq (%0, %1, 2), %%mm2 \n\t" - "movq %%mm2, %%mm3 \n\t" - "punpcklbw %%mm7, %%mm2 \n\t" // L5 - "punpckhbw %%mm7, %%mm3 \n\t" // H5 - "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - L5 - "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - H5 - "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - 2L5 - "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - 2H5 - - "movq (%%"FF_REG_a", %1, 4), %%mm6 \n\t" - "punpcklbw %%mm7, %%mm6 \n\t" // L6 - "psubw %%mm6, %%mm2 \n\t" // L5 - L6 - "movq (%%"FF_REG_a", %1, 4), %%mm6 \n\t" - "punpckhbw %%mm7, %%mm6 \n\t" // H6 - "psubw %%mm6, %%mm3 \n\t" // H5 - H6 - - "paddw %%mm0, %%mm0 \n\t" // 2L4 - "paddw %%mm1, %%mm1 \n\t" // 2H4 - "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6 - "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6 - - "psllw $2, %%mm2 \n\t" // 4L5 - 4L6 - "psllw $2, %%mm3 \n\t" // 4H5 - 4H6 - "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - - "movq (%0, %1, 4), %%mm2 \n\t" - "movq %%mm2, %%mm3 \n\t" - "punpcklbw %%mm7, %%mm2 \n\t" // L7 - "punpckhbw %%mm7, %%mm3 \n\t" // H7 - - "paddw %%mm2, %%mm2 \n\t" // 2L7 - "paddw %%mm3, %%mm3 \n\t" // 2H7 - "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - 2L7 - "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - 2H7 - - "movq (%3), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 - "movq 8(%3), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 - -#if TEMPLATE_PP_MMXEXT - "movq %%mm7, %%mm6 \n\t" // 0 - "psubw %%mm0, %%mm6 \n\t" - "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| - "movq %%mm7, %%mm6 \n\t" // 0 - "psubw %%mm1, %%mm6 \n\t" - "pmaxsw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| - "movq %%mm7, %%mm6 \n\t" // 0 - "psubw %%mm2, %%mm6 \n\t" - "pmaxsw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| - "movq %%mm7, %%mm6 \n\t" // 0 - "psubw %%mm3, %%mm6 \n\t" - "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| -#else - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm0, %%mm6 \n\t" - "pxor %%mm6, %%mm0 \n\t" - "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm1, %%mm6 \n\t" - "pxor %%mm6, %%mm1 \n\t" - "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm2, %%mm6 \n\t" - "pxor %%mm6, %%mm2 \n\t" - "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm3, %%mm6 \n\t" - "pxor %%mm6, %%mm3 \n\t" - "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| -#endif - -#if TEMPLATE_PP_MMXEXT - "pminsw %%mm2, %%mm0 \n\t" - "pminsw %%mm3, %%mm1 \n\t" -#else - "movq %%mm0, %%mm6 \n\t" - "psubusw %%mm2, %%mm6 \n\t" - "psubw %%mm6, %%mm0 \n\t" - "movq %%mm1, %%mm6 \n\t" - "psubusw %%mm3, %%mm6 \n\t" - "psubw %%mm6, %%mm1 \n\t" -#endif - - "movd %2, %%mm2 \n\t" // QP - "punpcklbw %%mm7, %%mm2 \n\t" - - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm4, %%mm6 \n\t" // sign(2L2 - 5L3 + 5L4 - 2L5) - "pxor %%mm6, %%mm4 \n\t" - "psubw %%mm6, %%mm4 \n\t" // |2L2 - 5L3 + 5L4 - 2L5| - "pcmpgtw %%mm5, %%mm7 \n\t" // sign(2H2 - 5H3 + 5H4 - 2H5) - "pxor %%mm7, %%mm5 \n\t" - "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5| -// 100 opcodes - "psllw $3, %%mm2 \n\t" // 8QP - "movq %%mm2, %%mm3 \n\t" // 8QP - "pcmpgtw %%mm4, %%mm2 \n\t" - "pcmpgtw %%mm5, %%mm3 \n\t" - "pand %%mm2, %%mm4 \n\t" - "pand %%mm3, %%mm5 \n\t" - - - "psubusw %%mm0, %%mm4 \n\t" // hd - "psubusw %%mm1, %%mm5 \n\t" // ld - - - "movq "MANGLE(w05)", %%mm2 \n\t" // 5 - "pmullw %%mm2, %%mm4 \n\t" - "pmullw %%mm2, %%mm5 \n\t" - "movq "MANGLE(w20)", %%mm2 \n\t" // 32 - "paddw %%mm2, %%mm4 \n\t" - "paddw %%mm2, %%mm5 \n\t" - "psrlw $6, %%mm4 \n\t" - "psrlw $6, %%mm5 \n\t" - - "movq 16(%3), %%mm0 \n\t" // L3 - L4 - "movq 24(%3), %%mm1 \n\t" // H3 - H4 - - "pxor %%mm2, %%mm2 \n\t" - "pxor %%mm3, %%mm3 \n\t" - - "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4) - "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4) - "pxor %%mm2, %%mm0 \n\t" - "pxor %%mm3, %%mm1 \n\t" - "psubw %%mm2, %%mm0 \n\t" // |L3-L4| - "psubw %%mm3, %%mm1 \n\t" // |H3-H4| - "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2 - "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2 - - "pxor %%mm6, %%mm2 \n\t" - "pxor %%mm7, %%mm3 \n\t" - "pand %%mm2, %%mm4 \n\t" - "pand %%mm3, %%mm5 \n\t" - -#if TEMPLATE_PP_MMXEXT - "pminsw %%mm0, %%mm4 \n\t" - "pminsw %%mm1, %%mm5 \n\t" -#else - "movq %%mm4, %%mm2 \n\t" - "psubusw %%mm0, %%mm2 \n\t" - "psubw %%mm2, %%mm4 \n\t" - "movq %%mm5, %%mm2 \n\t" - "psubusw %%mm1, %%mm2 \n\t" - "psubw %%mm2, %%mm5 \n\t" -#endif - "pxor %%mm6, %%mm4 \n\t" - "pxor %%mm7, %%mm5 \n\t" - "psubw %%mm6, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "packsswb %%mm5, %%mm4 \n\t" - "movq (%0), %%mm0 \n\t" - "paddb %%mm4, %%mm0 \n\t" - "movq %%mm0, (%0) \n\t" - "movq (%0, %1), %%mm0 \n\t" - "psubb %%mm4, %%mm0 \n\t" - "movq %%mm0, (%0, %1) \n\t" - - : "+r" (src) - : "r" ((x86_reg)stride), "m" (c->pQPb), "r"(tmp) - NAMED_CONSTRAINTS_ADD(w05,w20) - : "%"FF_REG_a - ); -#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_MMXEXT const int l1= stride; const int l2= stride + l1; const int l3= stride + l2; @@ -1086,14 +823,14 @@ } src++; } -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } #endif //TEMPLATE_PP_ALTIVEC #if !TEMPLATE_PP_ALTIVEC static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) { -#if HAVE_7REGS && (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) +#if HAVE_7REGS && TEMPLATE_PP_MMXEXT DECLARE_ALIGNED(8, uint64_t, tmp)[3]; __asm__ volatile( "pxor %%mm6, %%mm6 \n\t" @@ -1113,20 +850,10 @@ #undef REAL_FIND_MIN_MAX #undef FIND_MIN_MAX -#if TEMPLATE_PP_MMXEXT #define REAL_FIND_MIN_MAX(addr)\ "movq " #addr ", %%mm0 \n\t"\ "pminub %%mm0, %%mm7 \n\t"\ "pmaxub %%mm0, %%mm6 \n\t" -#else -#define REAL_FIND_MIN_MAX(addr)\ - "movq " #addr ", %%mm0 \n\t"\ - "movq %%mm7, %%mm1 \n\t"\ - "psubusb %%mm0, %%mm6 \n\t"\ - "paddb %%mm0, %%mm6 \n\t"\ - "psubusb %%mm0, %%mm1 \n\t"\ - "psubb %%mm1, %%mm7 \n\t" -#endif #define FIND_MIN_MAX(addr) REAL_FIND_MIN_MAX(addr) FIND_MIN_MAX((%%FF_REGa)) @@ -1140,49 +867,20 @@ "movq %%mm7, %%mm4 \n\t" "psrlq $8, %%mm7 \n\t" -#if TEMPLATE_PP_MMXEXT "pminub %%mm4, %%mm7 \n\t" // min of pixels "pshufw $0xF9, %%mm7, %%mm4 \n\t" "pminub %%mm4, %%mm7 \n\t" // min of pixels "pshufw $0xFE, %%mm7, %%mm4 \n\t" "pminub %%mm4, %%mm7 \n\t" -#else - "movq %%mm7, %%mm1 \n\t" - "psubusb %%mm4, %%mm1 \n\t" - "psubb %%mm1, %%mm7 \n\t" - "movq %%mm7, %%mm4 \n\t" - "psrlq $16, %%mm7 \n\t" - "movq %%mm7, %%mm1 \n\t" - "psubusb %%mm4, %%mm1 \n\t" - "psubb %%mm1, %%mm7 \n\t" - "movq %%mm7, %%mm4 \n\t" - "psrlq $32, %%mm7 \n\t" - "movq %%mm7, %%mm1 \n\t" - "psubusb %%mm4, %%mm1 \n\t" - "psubb %%mm1, %%mm7 \n\t" -#endif "movq %%mm6, %%mm4 \n\t" "psrlq $8, %%mm6 \n\t" -#if TEMPLATE_PP_MMXEXT "pmaxub %%mm4, %%mm6 \n\t" // max of pixels "pshufw $0xF9, %%mm6, %%mm4 \n\t" "pmaxub %%mm4, %%mm6 \n\t" "pshufw $0xFE, %%mm6, %%mm4 \n\t" "pmaxub %%mm4, %%mm6 \n\t" -#else - "psubusb %%mm4, %%mm6 \n\t" - "paddb %%mm4, %%mm6 \n\t" - "movq %%mm6, %%mm4 \n\t" - "psrlq $16, %%mm6 \n\t" - "psubusb %%mm4, %%mm6 \n\t" - "paddb %%mm4, %%mm6 \n\t" - "movq %%mm6, %%mm4 \n\t" - "psrlq $32, %%mm6 \n\t" - "psubusb %%mm4, %%mm6 \n\t" - "paddb %%mm4, %%mm6 \n\t" -#endif "movq %%mm6, %%mm0 \n\t" // max "psubb %%mm7, %%mm6 \n\t" // max - min "push %%"FF_REG_a" \n\t" @@ -1320,7 +1018,7 @@ NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b02,b08) : "%"FF_REG_a, "%"FF_REG_d ); -#else // HAVE_7REGS && (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) +#else // HAVE_7REGS && TEMPLATE_PP_MMXEXT int y; int min=255; int max=0; @@ -1438,7 +1136,7 @@ // src[0] = src[7]=src[stride*7]=src[stride*7 + 7]=255; } #endif -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } #endif //TEMPLATE_PP_ALTIVEC @@ -1450,7 +1148,7 @@ */ static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT src+= 4*stride; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" @@ -1503,14 +1201,13 @@ */ static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride) { -#if TEMPLATE_PP_SSE2 || TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_SSE2 src+= stride*3; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" "lea (%%"FF_REG_a", %1, 4), %%"FF_REG_d"\n\t" "lea (%%"FF_REG_d", %1, 4), %%"FF_REG_c"\n\t" "add %1, %%"FF_REG_c" \n\t" -#if TEMPLATE_PP_SSE2 "pxor %%xmm7, %%xmm7 \n\t" #define REAL_DEINT_CUBIC(a,b,c,d,e)\ "movq " #a ", %%xmm0 \n\t"\ @@ -1526,33 +1223,6 @@ "psubw %%xmm0, %%xmm1 \n\t"\ "packuswb %%xmm1, %%xmm1 \n\t"\ "movlps %%xmm1, " #c " \n\t" -#else //TEMPLATE_PP_SSE2 - "pxor %%mm7, %%mm7 \n\t" -// 0 1 2 3 4 5 6 7 8 9 10 -// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx - -#define REAL_DEINT_CUBIC(a,b,c,d,e)\ - "movq " #a ", %%mm0 \n\t"\ - "movq " #b ", %%mm1 \n\t"\ - "movq " #d ", %%mm2 \n\t"\ - "movq " #e ", %%mm3 \n\t"\ - PAVGB(%%mm2, %%mm1) /* (b+d) /2 */\ - PAVGB(%%mm3, %%mm0) /* (a+e) /2 */\ - "movq %%mm0, %%mm2 \n\t"\ - "punpcklbw %%mm7, %%mm0 \n\t"\ - "punpckhbw %%mm7, %%mm2 \n\t"\ - "movq %%mm1, %%mm3 \n\t"\ - "punpcklbw %%mm7, %%mm1 \n\t"\ - "punpckhbw %%mm7, %%mm3 \n\t"\ - "psubw %%mm1, %%mm0 \n\t" /* L(a+e - (b+d))/2 */\ - "psubw %%mm3, %%mm2 \n\t" /* H(a+e - (b+d))/2 */\ - "psraw $3, %%mm0 \n\t" /* L(a+e - (b+d))/16 */\ - "psraw $3, %%mm2 \n\t" /* H(a+e - (b+d))/16 */\ - "psubw %%mm0, %%mm1 \n\t" /* L(9b + 9d - a - e)/16 */\ - "psubw %%mm2, %%mm3 \n\t" /* H(9b + 9d - a - e)/16 */\ - "packuswb %%mm3, %%mm1 \n\t"\ - "movq %%mm1, " #c " \n\t" -#endif //TEMPLATE_PP_SSE2 #define DEINT_CUBIC(a,b,c,d,e) REAL_DEINT_CUBIC(a,b,c,d,e) DEINT_CUBIC((%0) , (%%FF_REGa, %1), (%%FF_REGa, %1, 2), (%0, %1, 4) , (%%FF_REGd, %1)) @@ -1562,13 +1232,11 @@ : : "r" (src), "r" ((x86_reg)stride) : -#if TEMPLATE_PP_SSE2 XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm7",) -#endif "%"FF_REG_a, "%"FF_REG_d, "%"FF_REG_c ); #undef REAL_DEINT_CUBIC -#else //TEMPLATE_PP_SSE2 || TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_SSE2 int x; src+= stride*3; for(x=0; x<8; x++){ @@ -1578,7 +1246,7 @@ src[stride*9] = av_clip_uint8((-src[stride*6] + 9*src[stride*8] + 9*src[stride*10] - src[stride*12])>>4); src++; } -#endif //TEMPLATE_PP_SSE2 || TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_SSE2 } /** @@ -1590,7 +1258,7 @@ */ static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT src+= stride*4; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" @@ -1639,7 +1307,7 @@ : : "r" (src), "r" ((x86_reg)stride), "r"(tmp) : "%"FF_REG_a, "%"FF_REG_d ); -#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_MMXEXT int x; src+= stride*4; for(x=0; x<8; x++){ @@ -1657,7 +1325,7 @@ src++; } -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } /** @@ -1669,7 +1337,7 @@ */ static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2) { -#if (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#if TEMPLATE_PP_MMXEXT && HAVE_6REGS src+= stride*4; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" @@ -1729,7 +1397,7 @@ : : "r" (src), "r" ((x86_reg)stride), "r"(tmp), "r"(tmp2) : "%"FF_REG_a, "%"FF_REG_d ); -#else //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#else //TEMPLATE_PP_MMXEXT && HAVE_6REGS int x; src+= stride*4; for(x=0; x<8; x++){ @@ -1758,7 +1426,7 @@ src++; } -#endif //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#endif // TEMPLATE_PP_MMXEXT && HAVE_6REGS } /** @@ -1770,7 +1438,7 @@ */ static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp) { -#if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#if TEMPLATE_PP_MMXEXT src+= 4*stride; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" @@ -1817,7 +1485,7 @@ : : "r" (src), "r" ((x86_reg)stride), "r" (tmp) : "%"FF_REG_a, "%"FF_REG_d ); -#else //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#else //TEMPLATE_PP_MMXEXT int a, b, c, x; src+= 4*stride; @@ -1860,7 +1528,7 @@ src += 4; tmp += 4; } -#endif //TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW +#endif //TEMPLATE_PP_MMXEXT } /** @@ -1871,9 +1539,8 @@ */ static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride) { -#if TEMPLATE_PP_MMX - src+= 4*stride; #if TEMPLATE_PP_MMXEXT + src+= 4*stride; __asm__ volatile( "lea (%0, %1), %%"FF_REG_a" \n\t" "lea (%%"FF_REG_a", %1, 4), %%"FF_REG_d"\n\t" @@ -1922,48 +1589,6 @@ : "%"FF_REG_a, "%"FF_REG_d ); -#else // MMX without MMX2 - __asm__ volatile( - "lea (%0, %1), %%"FF_REG_a" \n\t" - "lea (%%"FF_REG_a", %1, 4), %%"FF_REG_d"\n\t" -// 0 1 2 3 4 5 6 7 8 9 -// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 - "pxor %%mm7, %%mm7 \n\t" - -#define REAL_MEDIAN(a,b,c)\ - "movq " #a ", %%mm0 \n\t"\ - "movq " #b ", %%mm2 \n\t"\ - "movq " #c ", %%mm1 \n\t"\ - "movq %%mm0, %%mm3 \n\t"\ - "movq %%mm1, %%mm4 \n\t"\ - "movq %%mm2, %%mm5 \n\t"\ - "psubusb %%mm1, %%mm3 \n\t"\ - "psubusb %%mm2, %%mm4 \n\t"\ - "psubusb %%mm0, %%mm5 \n\t"\ - "pcmpeqb %%mm7, %%mm3 \n\t"\ - "pcmpeqb %%mm7, %%mm4 \n\t"\ - "pcmpeqb %%mm7, %%mm5 \n\t"\ - "movq %%mm3, %%mm6 \n\t"\ - "pxor %%mm4, %%mm3 \n\t"\ - "pxor %%mm5, %%mm4 \n\t"\ - "pxor %%mm6, %%mm5 \n\t"\ - "por %%mm3, %%mm1 \n\t"\ - "por %%mm4, %%mm2 \n\t"\ - "por %%mm5, %%mm0 \n\t"\ - "pand %%mm2, %%mm0 \n\t"\ - "pand %%mm1, %%mm0 \n\t"\ - "movq %%mm0, " #b " \n\t" -#define MEDIAN(a,b,c) REAL_MEDIAN(a,b,c) - -MEDIAN((%0) , (%%FF_REGa) , (%%FF_REGa, %1)) -MEDIAN((%%FF_REGa, %1), (%%FF_REGa, %1, 2), (%0, %1, 4)) -MEDIAN((%0, %1, 4) , (%%FF_REGd) , (%%FF_REGd, %1)) -MEDIAN((%%FF_REGd, %1), (%%FF_REGd, %1, 2), (%0, %1, 8)) - - : : "r" (src), "r" ((x86_reg)stride) - : "%"FF_REG_a, "%"FF_REG_d - ); -#endif //TEMPLATE_PP_MMXEXT #else //TEMPLATE_PP_MMX int x, y; src+= 4*stride; @@ -2165,7 +1790,7 @@ #define FAST_L2_DIFF //#define L1_DIFF //u should change the thresholds too if u try that one -#if (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#if TEMPLATE_PP_MMXEXT && HAVE_6REGS __asm__ volatile( "lea (%2, %2, 2), %%"FF_REG_a" \n\t" // 3*stride "lea (%2, %2, 4), %%"FF_REG_d" \n\t" // 5*stride @@ -2454,7 +2079,7 @@ NAMED_CONSTRAINTS_ADD(b80) : "%"FF_REG_a, "%"FF_REG_d, "%"FF_REG_c, "memory" ); -#else //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#else //TEMPLATE_PP_MMXEXT && HAVE_6REGS { int y; int d=0; @@ -2537,11 +2162,11 @@ } } } -#endif //(TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) && HAVE_6REGS +#endif //TEMPLATE_PP_MMXEXT && HAVE_6REGS } #endif //TEMPLATE_PP_ALTIVEC -#if TEMPLATE_PP_MMX +#if TEMPLATE_PP_MMXEXT /** * accurate deblock filter */ @@ -2945,7 +2570,6 @@ "movq (%4), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3 "movq 8(%4), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3 -#if TEMPLATE_PP_MMXEXT "movq %%mm7, %%mm6 \n\t" // 0 "psubw %%mm0, %%mm6 \n\t" "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| @@ -2958,36 +2582,9 @@ "movq %%mm7, %%mm6 \n\t" // 0 "psubw %%mm3, %%mm6 \n\t" "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| -#else - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm0, %%mm6 \n\t" - "pxor %%mm6, %%mm0 \n\t" - "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm1, %%mm6 \n\t" - "pxor %%mm6, %%mm1 \n\t" - "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm2, %%mm6 \n\t" - "pxor %%mm6, %%mm2 \n\t" - "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3| - "movq %%mm7, %%mm6 \n\t" // 0 - "pcmpgtw %%mm3, %%mm6 \n\t" - "pxor %%mm6, %%mm3 \n\t" - "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3| -#endif -#if TEMPLATE_PP_MMXEXT "pminsw %%mm2, %%mm0 \n\t" "pminsw %%mm3, %%mm1 \n\t" -#else - "movq %%mm0, %%mm6 \n\t" - "psubusw %%mm2, %%mm6 \n\t" - "psubw %%mm6, %%mm0 \n\t" - "movq %%mm1, %%mm6 \n\t" - "psubusw %%mm3, %%mm6 \n\t" - "psubw %%mm6, %%mm1 \n\t" -#endif "movd %2, %%mm2 \n\t" // QP "punpcklbw %%mm7, %%mm2 \n\t" @@ -3041,17 +2638,8 @@ "pand %%mm2, %%mm4 \n\t" "pand %%mm3, %%mm5 \n\t" -#if TEMPLATE_PP_MMXEXT "pminsw %%mm0, %%mm4 \n\t" "pminsw %%mm1, %%mm5 \n\t" -#else - "movq %%mm4, %%mm2 \n\t" - "psubusw %%mm0, %%mm2 \n\t" - "psubw %%mm2, %%mm4 \n\t" - "movq %%mm5, %%mm2 \n\t" - "psubusw %%mm1, %%mm2 \n\t" - "psubw %%mm2, %%mm5 \n\t" -#endif "pxor %%mm6, %%mm4 \n\t" "pxor %%mm7, %%mm5 \n\t" "psubw %%mm6, %%mm4 \n\t" @@ -3088,18 +2676,14 @@ static inline void RENAME(blockCopy)(uint8_t dst[], int dstStride, const uint8_t src[], int srcStride, int levelFix, int64_t *packedOffsetAndScale) { -#if !TEMPLATE_PP_MMX || !HAVE_6REGS - int i; -#endif if(levelFix){ -#if TEMPLATE_PP_MMX && HAVE_6REGS +#if TEMPLATE_PP_MMXEXT && HAVE_6REGS __asm__ volatile( "movq (%%"FF_REG_a"), %%mm2 \n\t" // packedYOffset "movq 8(%%"FF_REG_a"), %%mm3 \n\t" // packedYScale "lea (%2,%4), %%"FF_REG_a" \n\t" "lea (%3,%5), %%"FF_REG_d" \n\t" "pxor %%mm4, %%mm4 \n\t" -#if TEMPLATE_PP_MMXEXT #define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ "movq " #src1 ", %%mm0 \n\t"\ "movq " #src1 ", %%mm5 \n\t"\ @@ -3122,34 +2706,6 @@ "movq %%mm0, " #dst1 " \n\t"\ "movq %%mm1, " #dst2 " \n\t"\ -#else //TEMPLATE_PP_MMXEXT -#define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ - "movq " #src1 ", %%mm0 \n\t"\ - "movq " #src1 ", %%mm5 \n\t"\ - "punpcklbw %%mm4, %%mm0 \n\t"\ - "punpckhbw %%mm4, %%mm5 \n\t"\ - "psubw %%mm2, %%mm0 \n\t"\ - "psubw %%mm2, %%mm5 \n\t"\ - "movq " #src2 ", %%mm1 \n\t"\ - "psllw $6, %%mm0 \n\t"\ - "psllw $6, %%mm5 \n\t"\ - "pmulhw %%mm3, %%mm0 \n\t"\ - "movq " #src2 ", %%mm6 \n\t"\ - "pmulhw %%mm3, %%mm5 \n\t"\ - "punpcklbw %%mm4, %%mm1 \n\t"\ - "punpckhbw %%mm4, %%mm6 \n\t"\ - "psubw %%mm2, %%mm1 \n\t"\ - "psubw %%mm2, %%mm6 \n\t"\ - "psllw $6, %%mm1 \n\t"\ - "psllw $6, %%mm6 \n\t"\ - "pmulhw %%mm3, %%mm1 \n\t"\ - "pmulhw %%mm3, %%mm6 \n\t"\ - "packuswb %%mm5, %%mm0 \n\t"\ - "packuswb %%mm6, %%mm1 \n\t"\ - "movq %%mm0, " #dst1 " \n\t"\ - "movq %%mm1, " #dst2 " \n\t"\ - -#endif //TEMPLATE_PP_MMXEXT #define SCALED_CPY(src1, src2, dst1, dst2)\ REAL_SCALED_CPY(src1, src2, dst1, dst2) @@ -3170,7 +2726,7 @@ : "%"FF_REG_d ); #else //TEMPLATE_PP_MMX && HAVE_6REGS - for(i=0; i<8; i++) + for (int i = 0; i < 8; i++) memcpy( &(dst[dstStride*i]), &(src[srcStride*i]), BLOCK_SIZE); #endif //TEMPLATE_PP_MMX && HAVE_6REGS @@ -3203,7 +2759,7 @@ : "%"FF_REG_a, "%"FF_REG_d ); #else //TEMPLATE_PP_MMX && HAVE_6REGS - for(i=0; i<8; i++) + for (int i = 0; i < 8; i++) memcpy( &(dst[dstStride*i]), &(src[srcStride*i]), BLOCK_SIZE); #endif //TEMPLATE_PP_MMX && HAVE_6REGS @@ -3304,14 +2860,13 @@ * Filter array of bytes (Y or U or V values) */ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, - const int8_t QPs[], int QPStride, int isColor, PPContext *c2) + const int8_t QPs[], int QPStride, int isColor, PPContext *c) { - DECLARE_ALIGNED(8, PPContext, c)= *c2; //copy to stack for faster access int x,y; #ifdef TEMPLATE_PP_TIME_MODE const int mode= TEMPLATE_PP_TIME_MODE; #else - const int mode= isColor ? c.ppMode.chromMode : c.ppMode.lumMode; + const int mode = isColor ? c->ppMode.chromMode : c->ppMode.lumMode; #endif int black=0, white=255; // blackest black and whitest white in the picture int QPCorrecture= 256*256; @@ -3321,29 +2876,29 @@ int i; #endif - const int qpHShift= isColor ? 4-c.hChromaSubSample : 4; - const int qpVShift= isColor ? 4-c.vChromaSubSample : 4; + const int qpHShift = isColor ? 4 - c->hChromaSubSample : 4; + const int qpVShift = isColor ? 4 - c->vChromaSubSample : 4; //FIXME remove - uint64_t * const yHistogram= c.yHistogram; - uint8_t * const tempSrc= srcStride > 0 ? c.tempSrc : c.tempSrc - 23*srcStride; - uint8_t * const tempDst= (dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride) + 32; + uint64_t * const yHistogram= c->yHistogram; + uint8_t * const tempSrc = srcStride > 0 ? c->tempSrc : c->tempSrc - 23*srcStride; + uint8_t * const tempDst = (dstStride > 0 ? c->tempDst : c->tempDst - 23*dstStride) + 32; //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; if (mode & VISUALIZE){ if(!(mode & (V_A_DEBLOCK | H_A_DEBLOCK)) || TEMPLATE_PP_MMX) { - av_log(c2, AV_LOG_WARNING, "Visualization is currently only supported with the accurate deblock filter without SIMD\n"); + av_log(c, AV_LOG_WARNING, "Visualization is currently only supported with the accurate deblock filter without SIMD\n"); } } #if TEMPLATE_PP_MMX for(i=0; i<57; i++){ - int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1; + int offset = ((i * c->ppMode.baseDcDiff) >> 8) + 1; int threshold= offset*2 + 1; - c.mmxDcOffset[i]= 0x7F - offset; - c.mmxDcThreshold[i]= 0x7F - threshold; - c.mmxDcOffset[i]*= 0x0101010101010101LL; - c.mmxDcThreshold[i]*= 0x0101010101010101LL; + c->mmxDcOffset[i] = 0x7F - offset; + c->mmxDcThreshold[i] = 0x7F - threshold; + c->mmxDcOffset[i] *= 0x0101010101010101LL; + c->mmxDcThreshold[i] *= 0x0101010101010101LL; } #endif @@ -3369,16 +2924,18 @@ uint64_t clipped; AVRational scale; - c.frameNum++; + c->frameNum++; // first frame is fscked so we ignore it - if(c.frameNum == 1) yHistogram[0]= width*(uint64_t)height/64*15/256; + if (c->frameNum == 1) + yHistogram[0] = width * (uint64_t)height/64*15/256; for(i=0; i<256; i++){ sum+= yHistogram[i]; } /* We always get a completely black picture first. */ - maxClipped= av_rescale(sum, c.ppMode.maxClippedThreshold.num, c.ppMode.maxClippedThreshold.den); + maxClipped = av_rescale(sum, c->ppMode.maxClippedThreshold.num, + c->ppMode.maxClippedThreshold.den); clipped= sum; for(black=255; black>0; black--){ @@ -3392,27 +2949,27 @@ clipped-= yHistogram[white]; } - scale = (AVRational){c.ppMode.maxAllowedY - c.ppMode.minAllowedY, white - black}; + scale = (AVRational){c->ppMode.maxAllowedY - c->ppMode.minAllowedY, white - black}; #if TEMPLATE_PP_MMXEXT - c.packedYScale = (uint16_t)av_rescale(scale.num, 256, scale.den); - c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF; + c->packedYScale = (uint16_t)av_rescale(scale.num, 256, scale.den); + c->packedYOffset = (((black*c->packedYScale)>>8) - c->ppMode.minAllowedY) & 0xFFFF; #else - c.packedYScale = (uint16_t)av_rescale(scale.num, 1024, scale.den); - c.packedYOffset= (black - c.ppMode.minAllowedY) & 0xFFFF; + c->packedYScale = (uint16_t)av_rescale(scale.num, 1024, scale.den); + c->packedYOffset = (black - c->ppMode.minAllowedY) & 0xFFFF; #endif - c.packedYOffset|= c.packedYOffset<<32; - c.packedYOffset|= c.packedYOffset<<16; + c->packedYOffset |= c->packedYOffset<<32; + c->packedYOffset |= c->packedYOffset<<16; - c.packedYScale|= c.packedYScale<<32; - c.packedYScale|= c.packedYScale<<16; + c->packedYScale |= c->packedYScale<<32; + c->packedYScale |= c->packedYScale<<16; if(mode & LEVEL_FIX) QPCorrecture= (int)av_rescale(scale.num, 256*256, scale.den); else QPCorrecture= 256*256; }else{ - c.packedYScale= 0x0100010001000100LL; - c.packedYOffset= 0; + c->packedYScale = 0x0100010001000100LL; + c->packedYOffset = 0; QPCorrecture= 256*256; } @@ -3432,22 +2989,22 @@ RENAME(prefetcht0)(dstBlock + (((x>>2)&6) + copyAhead+1)*dstStride + 32); RENAME(blockCopy)(dstBlock + dstStride*8, dstStride, - srcBlock + srcStride*8, srcStride, mode & LEVEL_FIX, &c.packedYOffset); + srcBlock + srcStride*8, srcStride, mode & LEVEL_FIX, &c->packedYOffset); RENAME(duplicate)(dstBlock + dstStride*8, dstStride); if(mode & LINEAR_IPOL_DEINT_FILTER) RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); else if(mode & LINEAR_BLEND_DEINT_FILTER) - RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); + RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c->deintTemp + x); else if(mode & MEDIAN_DEINT_FILTER) RENAME(deInterlaceMedian)(dstBlock, dstStride); else if(mode & CUBIC_IPOL_DEINT_FILTER) RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); else if(mode & FFMPEG_DEINT_FILTER) - RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); + RENAME(deInterlaceFF)(dstBlock, dstStride, c->deintTemp + x); else if(mode & LOWPASS5_DEINT_FILTER) - RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x); + RENAME(deInterlaceL5)(dstBlock, dstStride, c->deintTemp + x, c->deintTemp + width + x); /* else if(mode & CUBIC_BLEND_DEINT_FILTER) RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); */ @@ -3469,11 +3026,11 @@ const uint8_t *srcBlock= &(src[y*srcStride]); uint8_t *dstBlock= &(dst[y*dstStride]); #if TEMPLATE_PP_MMX - uint8_t *tempBlock1= c.tempBlocks; - uint8_t *tempBlock2= c.tempBlocks + 8; + uint8_t *tempBlock1 = c->tempBlocks; + uint8_t *tempBlock2 = c->tempBlocks + 8; #endif const int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride]; - int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*FFABS(QPStride)]; + int8_t *nonBQPptr = &c->nonBQPTable[(y>>qpVShift)*FFABS(QPStride)]; int QP=0, nonBQP=0; /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards if not than use a temporary buffer */ @@ -3516,8 +3073,8 @@ nonBQP= (nonBQP* QPCorrecture + 256*128)>>16; yHistogram[(srcBlock+qp_index*8)[srcStride*12 + 4]]++; } - c.QP_block[qp_index] = QP; - c.nonBQP_block[qp_index] = nonBQP; + c->QP_block[qp_index] = QP; + c->nonBQP_block[qp_index] = nonBQP; #if TEMPLATE_PP_MMX __asm__ volatile( "movd %1, %%mm7 \n\t" @@ -3525,7 +3082,7 @@ "packuswb %%mm7, %%mm7 \n\t" // 0,QP, 0, QP, 0,QP, 0, QP "packuswb %%mm7, %%mm7 \n\t" // QP,..., QP "movq %%mm7, %0 \n\t" - : "=m" (c.pQPb_block[qp_index]) + : "=m" (c->pQPb_block[qp_index]) : "r" (QP) ); #endif @@ -3537,20 +3094,20 @@ RENAME(prefetcht0)(dstBlock + (((x>>2)&6) + copyAhead+1)*dstStride + 32); RENAME(blockCopy)(dstBlock + dstStride*copyAhead, dstStride, - srcBlock + srcStride*copyAhead, srcStride, mode & LEVEL_FIX, &c.packedYOffset); + srcBlock + srcStride*copyAhead, srcStride, mode & LEVEL_FIX, &c->packedYOffset); if(mode & LINEAR_IPOL_DEINT_FILTER) RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride); else if(mode & LINEAR_BLEND_DEINT_FILTER) - RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x); + RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c->deintTemp + x); else if(mode & MEDIAN_DEINT_FILTER) RENAME(deInterlaceMedian)(dstBlock, dstStride); else if(mode & CUBIC_IPOL_DEINT_FILTER) RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride); else if(mode & FFMPEG_DEINT_FILTER) - RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x); + RENAME(deInterlaceFF)(dstBlock, dstStride, c->deintTemp + x); else if(mode & LOWPASS5_DEINT_FILTER) - RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x); + RENAME(deInterlaceL5)(dstBlock, dstStride, c->deintTemp + x, c->deintTemp + width + x); /* else if(mode & CUBIC_BLEND_DEINT_FILTER) RENAME(deInterlaceBlendCubic)(dstBlock, dstStride); */ @@ -3565,24 +3122,24 @@ const int stride= dstStride; //temporary while changing QP stuff to make things continue to work //eventually QP,nonBQP,etc will be arrays and this will be unnecessary - c.QP = c.QP_block[qp_index]; - c.nonBQP = c.nonBQP_block[qp_index]; - c.pQPb = c.pQPb_block[qp_index]; - c.pQPb2 = c.pQPb2_block[qp_index]; + c->QP = c->QP_block[qp_index]; + c->nonBQP = c->nonBQP_block[qp_index]; + c->pQPb = c->pQPb_block[qp_index]; + c->pQPb2 = c->pQPb2_block[qp_index]; /* only deblock if we have 2 blocks */ if(y + 8 < height){ if(mode & V_X1_FILTER) - RENAME(vertX1Filter)(dstBlock, stride, &c); + RENAME(vertX1Filter)(dstBlock, stride, c); else if(mode & V_DEBLOCK){ - const int t= RENAME(vertClassify)(dstBlock, stride, &c); + const int t = RENAME(vertClassify)(dstBlock, stride, c); if(t==1) - RENAME(doVertLowPass)(dstBlock, stride, &c); + RENAME(doVertLowPass)(dstBlock, stride, c); else if(t==2) - RENAME(doVertDefFilter)(dstBlock, stride, &c); + RENAME(doVertDefFilter)(dstBlock, stride, c); }else if(mode & V_A_DEBLOCK){ - RENAME(do_a_deblock)(dstBlock, stride, 1, &c, mode); + RENAME(do_a_deblock)(dstBlock, stride, 1, c, mode); } } @@ -3595,10 +3152,10 @@ for(x = startx, qp_index=0; x < endx; x+=BLOCK_SIZE, qp_index++){ const int stride= dstStride; - c.QP = c.QP_block[qp_index]; - c.nonBQP = c.nonBQP_block[qp_index]; - c.pQPb = c.pQPb_block[qp_index]; - c.pQPb2 = c.pQPb2_block[qp_index]; + c->QP = c->QP_block[qp_index]; + c->nonBQP = c->nonBQP_block[qp_index]; + c->pQPb = c->pQPb_block[qp_index]; + c->pQPb2 = c->pQPb2_block[qp_index]; #if TEMPLATE_PP_MMX RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride); #endif @@ -3606,60 +3163,60 @@ if(x - 8 >= 0){ #if TEMPLATE_PP_MMX if(mode & H_X1_FILTER) - RENAME(vertX1Filter)(tempBlock1, 16, &c); + RENAME(vertX1Filter)(tempBlock1, 16, c); else if(mode & H_DEBLOCK){ - const int t= RENAME(vertClassify)(tempBlock1, 16, &c); + const int t= RENAME(vertClassify)(tempBlock1, 16, c); if(t==1) - RENAME(doVertLowPass)(tempBlock1, 16, &c); + RENAME(doVertLowPass)(tempBlock1, 16, c); else if(t==2) - RENAME(doVertDefFilter)(tempBlock1, 16, &c); + RENAME(doVertDefFilter)(tempBlock1, 16, c); }else if(mode & H_A_DEBLOCK){ - RENAME(do_a_deblock)(tempBlock1, 16, 1, &c, mode); + RENAME(do_a_deblock)(tempBlock1, 16, 1, c, mode); } RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16); #else if(mode & H_X1_FILTER) - horizX1Filter(dstBlock-4, stride, c.QP); + horizX1Filter(dstBlock-4, stride, c->QP); else if(mode & H_DEBLOCK){ #if TEMPLATE_PP_ALTIVEC DECLARE_ALIGNED(16, unsigned char, tempBlock)[272]; int t; transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride); - t = vertClassify_altivec(tempBlock-48, 16, &c); + t = vertClassify_altivec(tempBlock-48, 16, c); if(t==1) { - doVertLowPass_altivec(tempBlock-48, 16, &c); + doVertLowPass_altivec(tempBlock-48, 16, c); transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); } else if(t==2) { - doVertDefFilter_altivec(tempBlock-48, 16, &c); + doVertDefFilter_altivec(tempBlock-48, 16, c); transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride); } #else - const int t= RENAME(horizClassify)(dstBlock-4, stride, &c); + const int t= RENAME(horizClassify)(dstBlock-4, stride, c); if(t==1) - RENAME(doHorizLowPass)(dstBlock-4, stride, &c); + RENAME(doHorizLowPass)(dstBlock-4, stride, c); else if(t==2) - RENAME(doHorizDefFilter)(dstBlock-4, stride, &c); + RENAME(doHorizDefFilter)(dstBlock-4, stride, c); #endif }else if(mode & H_A_DEBLOCK){ - RENAME(do_a_deblock)(dstBlock-8, 1, stride, &c, mode); + RENAME(do_a_deblock)(dstBlock-8, 1, stride, c, mode); } #endif //TEMPLATE_PP_MMX if(mode & DERING){ //FIXME filter first line - if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c); + if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, c); } if(mode & TEMP_NOISE_FILTER) { RENAME(tempNoiseReducer)(dstBlock-8, stride, - c.tempBlurred[isColor] + y*dstStride + x, - c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, - c.ppMode.maxTmpNoise); + c->tempBlurred[isColor] + y*dstStride + x, + c->tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, + c->ppMode.maxTmpNoise); } } @@ -3673,14 +3230,14 @@ } if(mode & DERING){ - if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, &c); + if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, c); } if((mode & TEMP_NOISE_FILTER)){ RENAME(tempNoiseReducer)(dstBlock-8, dstStride, - c.tempBlurred[isColor] + y*dstStride + x, - c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, - c.ppMode.maxTmpNoise); + c->tempBlurred[isColor] + y*dstStride + x, + c->tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256, + c->ppMode.maxTmpNoise); } /* did we use a tmp buffer for the last lines*/ @@ -3696,9 +3253,7 @@ } } } -#if TEMPLATE_PP_3DNOW - __asm__ volatile("femms"); -#elif TEMPLATE_PP_MMX +#if TEMPLATE_PP_MMX __asm__ volatile("emms"); #endif @@ -3724,9 +3279,6 @@ } } #endif - - *c2= c; //copy local context back - } #undef RENAME @@ -3734,5 +3286,4 @@ #undef TEMPLATE_PP_ALTIVEC #undef TEMPLATE_PP_MMX #undef TEMPLATE_PP_MMXEXT -#undef TEMPLATE_PP_3DNOW #undef TEMPLATE_PP_SSE2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "version_major.h" -#define LIBPOSTPROC_VERSION_MINOR 6 +#define LIBPOSTPROC_VERSION_MINOR 1 #define LIBPOSTPROC_VERSION_MICRO 100 #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libpostproc/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,6 @@ * Libpostproc version macros */ -#define LIBPOSTPROC_VERSION_MAJOR 56 +#define LIBPOSTPROC_VERSION_MAJOR 57 #endif /* POSTPROC_VERSION_MAJOR_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,6 @@ SHLIBOBJS += log2_tab.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o TESTPROGS = swresample diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/options.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/options.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/options.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/options.c 2023-03-03 13:29:59.000000000 +0000 @@ -46,9 +46,9 @@ OFFSET(user_out_ch_count ), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM|DEPREC}, {"out_channel_count" , "set output channel count (Deprecated, use out_chlayout)", OFFSET(user_out_ch_count ), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM|DEPREC}, +{"uch" , "set used channel count" , OFFSET(user_used_ch_count), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM|DEPREC}, +{"used_channel_count" , "set used channel count" , OFFSET(user_used_ch_count), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM|DEPREC}, #endif -{"uch" , "set used channel count" , OFFSET(user_used_ch_count), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM}, -{"used_channel_count" , "set used channel count" , OFFSET(user_used_ch_count), AV_OPT_TYPE_INT, {.i64=0 }, 0 , SWR_CH_MAX, PARAM}, {"isr" , "set input sample rate" , OFFSET( in_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM}, {"in_sample_rate" , "set input sample rate" , OFFSET( in_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM}, {"osr" , "set output sample rate" , OFFSET(out_sample_rate), AV_OPT_TYPE_INT , {.i64=0 }, 0 , INT_MAX , PARAM}, @@ -73,6 +73,8 @@ {"in_chlayout" , "set input channel layout" , OFFSET(user_in_chlayout ), AV_OPT_TYPE_CHLAYOUT, {.str=NULL }, 0, 0 , PARAM, "chlayout"}, {"ochl" , "set output channel layout" , OFFSET(user_out_chlayout), AV_OPT_TYPE_CHLAYOUT, {.str=NULL }, 0, 0 , PARAM, "chlayout"}, {"out_chlayout" , "set output channel layout" , OFFSET(user_out_chlayout), AV_OPT_TYPE_CHLAYOUT, {.str=NULL }, 0, 0 , PARAM, "chlayout"}, +{"uchl" , "set used channel layout" , OFFSET(user_used_chlayout), AV_OPT_TYPE_CHLAYOUT, {.str=NULL }, 0, 0 , PARAM, "chlayout"}, +{"used_chlayout" , "set used channel layout" , OFFSET(user_used_chlayout), AV_OPT_TYPE_CHLAYOUT, {.str=NULL }, 0, 0 , PARAM, "chlayout"}, {"clev" , "set center mix level" , OFFSET(clev ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB }, -32 , 32 , PARAM}, {"center_mix_level" , "set center mix level" , OFFSET(clev ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB }, -32 , 32 , PARAM}, {"slev" , "set surround mix level" , OFFSET(slev ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB }, -32 , 32 , PARAM}, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/rematrix.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/rematrix.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/rematrix.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/rematrix.c 2023-03-03 13:29:59.000000000 +0000 @@ -138,6 +138,8 @@ return 0; if(!even(av_channel_layout_subset(ch_layout, (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER)))) return 0; + if(!even(av_channel_layout_subset(ch_layout, (AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT)))) + return 0; if(ch_layout->nb_channels >= SWR_CH_MAX) return 0; @@ -369,6 +371,28 @@ }else av_assert0(0); } + + if (unaccounted & AV_CH_TOP_FRONT_LEFT) { + if (av_channel_layout_index_from_channel(&out_ch_layout, AV_CHAN_TOP_FRONT_CENTER) >= 0) { + matrix[TOP_FRONT_CENTER][TOP_FRONT_LEFT ] += M_SQRT1_2; + matrix[TOP_FRONT_CENTER][TOP_FRONT_RIGHT] += M_SQRT1_2; + if (av_channel_layout_index_from_channel(&in_ch_layout, AV_CHAN_TOP_FRONT_CENTER) >= 0) + matrix[TOP_FRONT_CENTER][TOP_FRONT_CENTER] = center_mix_level * sqrt(2); + } else if (av_channel_layout_index_from_channel(&out_ch_layout, AV_CHAN_FRONT_LEFT) >= 0) { + if (av_channel_layout_index_from_channel(&in_ch_layout, AV_CHAN_FRONT_LEFT) >= 0) { + matrix[FRONT_LEFT ][TOP_FRONT_LEFT ] += M_SQRT1_2; + matrix[FRONT_RIGHT][TOP_FRONT_RIGHT] += M_SQRT1_2; + } else { + matrix[FRONT_LEFT ][TOP_FRONT_LEFT ] += 1.0; + matrix[FRONT_RIGHT][TOP_FRONT_RIGHT] += 1.0; + } + } else if (av_channel_layout_index_from_channel(&out_ch_layout, AV_CHAN_FRONT_CENTER) >= 0) { + matrix[FRONT_CENTER][TOP_FRONT_LEFT ] += M_SQRT1_2; + matrix[FRONT_CENTER][TOP_FRONT_RIGHT] += M_SQRT1_2; + } else + av_assert0(0); + } + /* mix LFE into front left/right or center */ if (unaccounted & AV_CH_LOW_FREQUENCY) { if (av_channel_layout_index_from_channel(&out_ch_layout, AV_CHAN_FRONT_CENTER) >= 0) { @@ -468,7 +492,7 @@ av_cold int swri_rematrix_init(SwrContext *s){ int i, j; - int nb_in = s->used_ch_count; + int nb_in = s->used_ch_layout.nb_channels; int nb_out = s->out.ch_count; s->mix_any_f = NULL; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.c 2023-03-03 13:29:59.000000000 +0000 @@ -83,8 +83,8 @@ #endif int swr_alloc_set_opts2(struct SwrContext **ps, - AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, - AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, + const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, + const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx) { struct SwrContext *s = *ps; int ret; @@ -161,6 +161,7 @@ free_temp(&s->dither.temp); av_channel_layout_uninit(&s->in_ch_layout); av_channel_layout_uninit(&s->out_ch_layout); + av_channel_layout_uninit(&s->used_ch_layout); swri_audio_convert_free(&s-> in_convert); swri_audio_convert_free(&s->out_convert); swri_audio_convert_free(&s->full_convert); @@ -176,6 +177,7 @@ clear_context(s); av_channel_layout_uninit(&s->user_in_chlayout); av_channel_layout_uninit(&s->user_out_chlayout); + av_channel_layout_uninit(&s->user_used_chlayout); if (s->resampler) s->resampler->free(&s->resample); @@ -211,12 +213,20 @@ av_log(s, AV_LOG_ERROR, "Requested output sample rate %d is invalid\n", s->out_sample_rate); return AVERROR(EINVAL); } - s->used_ch_count = s->user_used_ch_count; #if FF_API_OLD_CHANNEL_LAYOUT s->out.ch_count = s-> user_out_ch_count; s-> in.ch_count = s-> user_in_ch_count; // if the old/new fields are set inconsistently, prefer the old ones + if (s->user_used_ch_count && s->user_used_ch_count != s->user_used_chlayout.nb_channels) { + av_channel_layout_uninit(&s->used_ch_layout); + s->used_ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + s->used_ch_layout.nb_channels = s->user_used_ch_count; + } else if (av_channel_layout_check(&s->user_used_chlayout)) { + ret = av_channel_layout_copy(&s->used_ch_layout, &s->user_used_chlayout); + if (ret < 0) + return ret; + } if ((s->user_in_ch_count && s->user_in_ch_count != s->user_in_chlayout.nb_channels) || (s->user_in_ch_layout && (s->user_in_chlayout.order != AV_CHANNEL_ORDER_NATIVE || s->user_in_chlayout.u.mask != s->user_in_ch_layout))) { @@ -227,7 +237,7 @@ s->in_ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; s->in_ch_layout.nb_channels = s->user_in_ch_count; } - } else + } else if (av_channel_layout_check(&s->user_in_chlayout)) av_channel_layout_copy(&s->in_ch_layout, &s->user_in_chlayout); if ((s->user_out_ch_count && s->user_out_ch_count != s->user_out_chlayout.nb_channels) || @@ -240,19 +250,48 @@ s->out_ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; s->out_ch_layout.nb_channels = s->user_out_ch_count; } - } else + } else if (av_channel_layout_check(&s->user_out_chlayout)) av_channel_layout_copy(&s->out_ch_layout, &s->user_out_chlayout); - if (!s->out.ch_count && !s->user_out_ch_layout) + if (!s->out.ch_count) s->out.ch_count = s->out_ch_layout.nb_channels; - if (!s-> in.ch_count && !s-> user_in_ch_layout) + if (!s-> in.ch_count) s-> in.ch_count = s->in_ch_layout.nb_channels; + + if (!(ret = av_channel_layout_check(&s->in_ch_layout)) || s->in_ch_layout.nb_channels > SWR_CH_MAX) { + if (ret) + av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1)); + av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : ""); + return AVERROR(EINVAL); + } + + if (!(ret = av_channel_layout_check(&s->out_ch_layout)) || s->out_ch_layout.nb_channels > SWR_CH_MAX) { + if (ret) + av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2)); + av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : ""); + return AVERROR(EINVAL); + } #else s->out.ch_count = s-> user_out_chlayout.nb_channels; s-> in.ch_count = s-> user_in_chlayout.nb_channels; + if (!(ret = av_channel_layout_check(&s->user_in_chlayout)) || s->user_in_chlayout.nb_channels > SWR_CH_MAX) { + if (ret) + av_channel_layout_describe(&s->user_in_chlayout, l1, sizeof(l1)); + av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", ret ? l1 : ""); + return AVERROR(EINVAL); + } + + if (!(ret = av_channel_layout_check(&s->user_out_chlayout)) || s->user_out_chlayout.nb_channels > SWR_CH_MAX) { + if (ret) + av_channel_layout_describe(&s->user_out_chlayout, l2, sizeof(l2)); + av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", ret ? l2 : ""); + return AVERROR(EINVAL); + } + ret = av_channel_layout_copy(&s->in_ch_layout, &s->user_in_chlayout); ret |= av_channel_layout_copy(&s->out_ch_layout, &s->user_out_chlayout); + ret |= av_channel_layout_copy(&s->used_ch_layout, &s->user_used_chlayout); if (ret < 0) return ret; #endif @@ -261,18 +300,6 @@ s->dither.method = s->user_dither_method; - if (!av_channel_layout_check(&s->in_ch_layout) || s->in_ch_layout.nb_channels > SWR_CH_MAX) { - av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1)); - av_log(s, AV_LOG_WARNING, "Input channel layout \"%s\" is invalid or unsupported.\n", l1); - av_channel_layout_uninit(&s->in_ch_layout); - } - - if (!av_channel_layout_check(&s->out_ch_layout) || s->out_ch_layout.nb_channels > SWR_CH_MAX) { - av_channel_layout_describe(&s->out_ch_layout, l2, sizeof(l2)); - av_log(s, AV_LOG_WARNING, "Output channel layout \"%s\" is invalid or unsupported.\n", l2); - av_channel_layout_uninit(&s->out_ch_layout); - } - switch(s->engine){ #if CONFIG_LIBSOXR case SWR_ENGINE_SOXR: s->resampler = &swri_soxr_resampler; break; @@ -283,17 +310,20 @@ return AVERROR(EINVAL); } - if(!s->used_ch_count) - s->used_ch_count= s->in.ch_count; + if (!av_channel_layout_check(&s->used_ch_layout)) + av_channel_layout_default(&s->used_ch_layout, s->in.ch_count); - if (s->used_ch_count && s->in_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->used_ch_count != s->in_ch_layout.nb_channels) { - av_log(s, AV_LOG_WARNING, "Input channel layout has a different number of channels than the number of used channels, ignoring layout\n"); + if (s->used_ch_layout.nb_channels != s->in_ch_layout.nb_channels) av_channel_layout_uninit(&s->in_ch_layout); - } - if (!s->in_ch_layout.nb_channels || s->in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) - av_channel_layout_default(&s->in_ch_layout, s->used_ch_count); - if (!s->out_ch_layout.nb_channels || s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + if (s->used_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + av_channel_layout_default(&s->used_ch_layout, s->used_ch_layout.nb_channels); + if (s->in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + ret = av_channel_layout_copy(&s->in_ch_layout, &s->used_ch_layout); + if (ret < 0) + return ret; + } + if (s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) av_channel_layout_default(&s->out_ch_layout, s->out.ch_count); s->rematrix = av_channel_layout_compare(&s->out_ch_layout, &s->in_ch_layout) || @@ -373,8 +403,8 @@ #define RSC 1 //FIXME finetune if(!s-> in.ch_count) s-> in.ch_count = s->in_ch_layout.nb_channels; - if(!s->used_ch_count) - s->used_ch_count= s->in.ch_count; + if (!av_channel_layout_check(&s->used_ch_layout)) + av_channel_layout_default(&s->used_ch_layout, s->in.ch_count); if(!s->out.ch_count) s->out.ch_count = s->out_ch_layout.nb_channels; @@ -394,23 +424,23 @@ } #endif av_channel_layout_describe(&s->in_ch_layout, l1, sizeof(l1)); - if (s->in_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->used_ch_count != s->in_ch_layout.nb_channels) { - av_log(s, AV_LOG_ERROR, "Input channel layout %s mismatches specified channel count %d\n", l1, s->used_ch_count); + if (s->in_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC && s->used_ch_layout.nb_channels != s->in_ch_layout.nb_channels) { + av_log(s, AV_LOG_ERROR, "Input channel layout %s mismatches specified channel count %d\n", l1, s->used_ch_layout.nb_channels); ret = AVERROR(EINVAL); goto fail; } if (( s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC - || s-> in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) && s->used_ch_count != s->out.ch_count && !s->rematrix_custom) { + || s-> in_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) && s->used_ch_layout.nb_channels != s->out.ch_count && !s->rematrix_custom) { av_log(s, AV_LOG_ERROR, "Rematrix is needed between %s and %s " "but there is not enough information to do it\n", l1, l2); ret = AVERROR(EINVAL); goto fail; } -av_assert0(s->used_ch_count); +av_assert0(s->used_ch_layout.nb_channels); av_assert0(s->out.ch_count); - s->resample_first= RSC*s->out.ch_count/s->used_ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; + s->resample_first= RSC*s->out.ch_count/s->used_ch_layout.nb_channels - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; s->in_buffer= s->in; s->silence = s->in; @@ -426,7 +456,7 @@ } s->in_convert = swri_audio_convert_alloc(s->int_sample_fmt, - s-> in_sample_fmt, s->used_ch_count, s->channel_map, 0); + s-> in_sample_fmt, s->used_ch_layout.nb_channels, s->channel_map, 0); s->out_convert= swri_audio_convert_alloc(s->out_sample_fmt, s->int_sample_fmt, s->out.ch_count, NULL, 0); @@ -441,9 +471,9 @@ if(s->channel_map){ s->postin.ch_count= - s->midbuf.ch_count= s->used_ch_count; + s->midbuf.ch_count= s->used_ch_layout.nb_channels; if(s->resample) - s->in_buffer.ch_count= s->used_ch_count; + s->in_buffer.ch_count= s->used_ch_layout.nb_channels; } if(!s->resample_first){ s->midbuf.ch_count= s->out.ch_count; @@ -681,7 +711,7 @@ if((ret=swri_realloc_audio(&s->postin, in_count))<0) return ret; if(s->resample_first){ - av_assert0(s->midbuf.ch_count == s->used_ch_count); + av_assert0(s->midbuf.ch_count == s->used_ch_layout.nb_channels); if((ret=swri_realloc_audio(&s->midbuf, out_count))<0) return ret; }else{ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_frame.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_frame.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_frame.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_frame.c 2023-03-03 13:29:59.000000000 +0000 @@ -84,7 +84,7 @@ const AVFrame *out, const AVFrame *in) { AVChannelLayout ch_layout = { 0 }; - int ret = 0; + int ret = 0, err; if (in) { #if FF_API_OLD_CHANNEL_LAYOUT @@ -96,8 +96,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } else #endif - if ((ret = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0) - return ret; + if ((err = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0) + return err; if (av_channel_layout_compare(&s->in_ch_layout, &ch_layout) || s->in_sample_rate != in->sample_rate || s->in_sample_fmt != in->format) { @@ -116,8 +116,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } else #endif - if ((ret = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0) - return ret; + if ((err = av_channel_layout_copy(&ch_layout, &out->ch_layout)) < 0) + return err; if (av_channel_layout_compare(&s->out_ch_layout, &ch_layout) || s->out_sample_rate != out->sample_rate || s->out_sample_fmt != out->format) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample.h 2023-03-03 13:29:59.000000000 +0000 @@ -73,7 +73,7 @@ * * Once all values have been set, it must be initialized with swr_init(). If * you need to change the conversion parameters, you can change the parameters - * using @ref AVOptions, as described above in the first example; or by using + * using @ref avoptions, as described above in the first example; or by using * swr_alloc_set_opts2(), but with the first argument the allocated context. * You must then call swr_init() again. * @@ -286,8 +286,8 @@ * On error, the Swr context is freed and *ps set to NULL. */ int swr_alloc_set_opts2(struct SwrContext **ps, - AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, - AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, + const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, + const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx); /** * @} @@ -354,8 +354,8 @@ * in this case the output timestamps will match output sample numbers. * See ffmpeg-resampler(1) for the two modes of compensation. * - * @param s[in] initialized Swr context - * @param pts[in] timestamp for the next input sample, INT64_MIN if unknown + * @param[in] s initialized Swr context + * @param[in] pts timestamp for the next input sample, INT64_MIN if unknown * @see swr_set_compensation(), swr_drop_output(), and swr_inject_silence() are * function used internally for timestamp compensation. * @return the output timestamp for the next output sample @@ -636,8 +636,8 @@ * @see swr_close(); * * @param swr audio resample context - * @param output output AVFrame - * @param input input AVFrame + * @param out output AVFrame + * @param in input AVFrame * @return 0 on success, AVERROR on failure. */ int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/swresample_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -99,6 +99,7 @@ enum AVSampleFormat in_sample_fmt; ///< input sample format enum AVSampleFormat int_sample_fmt; ///< internal sample format (AV_SAMPLE_FMT_FLTP or AV_SAMPLE_FMT_S16P) enum AVSampleFormat out_sample_fmt; ///< output sample format + AVChannelLayout used_ch_layout; ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count) AVChannelLayout in_ch_layout; ///< input channel layout AVChannelLayout out_ch_layout; ///< output channel layout int in_sample_rate; ///< input sample rate @@ -111,16 +112,16 @@ float rematrix_maxval; ///< maximum value for rematrixing output int matrix_encoding; /**< matrixed stereo encoding */ const int *channel_map; ///< channel index (or -1 if muted channel) map - int used_ch_count; ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count) int engine; - int user_used_ch_count; ///< User set used channel count #if FF_API_OLD_CHANNEL_LAYOUT + int user_used_ch_count; ///< User set used channel count int user_in_ch_count; ///< User set input channel count int user_out_ch_count; ///< User set output channel count int64_t user_in_ch_layout; ///< User set input channel layout int64_t user_out_ch_layout; ///< User set output channel layout #endif + AVChannelLayout user_used_chlayout; ///< User set used channel layout AVChannelLayout user_in_chlayout; ///< User set input channel layout AVChannelLayout user_out_chlayout; ///< User set output channel layout enum AVSampleFormat user_int_sample_fmt; ///< User set internal sample format diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -30,7 +30,7 @@ #include "version_major.h" -#define LIBSWRESAMPLE_VERSION_MINOR 7 +#define LIBSWRESAMPLE_VERSION_MINOR 10 #define LIBSWRESAMPLE_VERSION_MICRO 100 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/audio_convert.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/audio_convert.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/audio_convert.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/audio_convert.asm 2023-03-03 13:29:59.000000000 +0000 @@ -85,7 +85,7 @@ add lenq, 2*mmsize/(2<<%4) %endif jl .next - REP_RET + RET %endmacro %macro UNPACK_2CH 5-7 @@ -157,7 +157,7 @@ add lenq, mmsize/(1<<%4) %endif jl .next - REP_RET + RET %endmacro %macro CONV 5-7 @@ -198,7 +198,7 @@ emms RET %else - REP_RET + RET %endif %endmacro @@ -301,7 +301,7 @@ emms RET %else - REP_RET + RET %endif %endmacro @@ -375,7 +375,7 @@ add dstq, mmsize sub lend, mmsize/4 jg .loop - REP_RET + RET %endmacro %define PACK_8CH_GPRS (10 * ARCH_X86_64) + ((6 + HAVE_ALIGNED_STACK) * ARCH_X86_32) @@ -525,7 +525,7 @@ %endif sub lend, mmsize/4 jg .loop - REP_RET + RET %endmacro %macro INT16_TO_INT32_N 6 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix.asm 2023-03-03 13:29:59.000000000 +0000 @@ -68,7 +68,7 @@ mov%1 [outq + lenq + mmsize], m2 add lenq, mmsize*2 jl .next - REP_RET + RET %endmacro %macro MIX1_FLT 1 @@ -100,7 +100,7 @@ mov%1 [outq + lenq + mmsize], m1 add lenq, mmsize*2 jl .next - REP_RET + RET %endmacro %macro MIX1_INT16 1 @@ -152,7 +152,7 @@ emms RET %else - REP_RET + RET %endif %endmacro @@ -218,7 +218,7 @@ emms RET %else - REP_RET + RET %endif %endmacro diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix_init.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix_init.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix_init.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswresample/x86/rematrix_init.c 2023-03-03 13:29:59.000000000 +0000 @@ -33,7 +33,7 @@ av_cold int swri_rematrix_init_x86(struct SwrContext *s){ #if HAVE_X86ASM int mm_flags = av_get_cpu_flags(); - int nb_in = s->used_ch_count; + int nb_in = s->used_ch_layout.nb_channels; int nb_out = s->out.ch_count; int num = nb_in * nb_out; int i,j; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/hscale.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/hscale.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/hscale.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/hscale.S 2023-03-03 13:29:59.000000000 +0000 @@ -91,6 +91,113 @@ ret endfunc +function ff_hscale8to15_X4_neon, export=1 +// x0 SwsContext *c (not used) +// x1 int16_t *dst +// w2 int dstW +// x3 const uint8_t *src +// x4 const int16_t *filter +// x5 const int32_t *filterPos +// w6 int filterSize + +// This function for filter sizes that are 4 mod 8. In other words, anything that's 0 mod 4 but not +// 0 mod 8. It also assumes that dstW is 0 mod 4. + + lsl w7, w6, #1 // w7 = filterSize * 2 +1: + ldp w8, w9, [x5] // filterPos[idx + 0], [idx + 1] + ldp w10, w11, [x5, #8] // filterPos[idx + 2], [idx + 3] + + movi v16.2d, #0 // initialize accumulator for idx + 0 + movi v17.2d, #0 // initialize accumulator for idx + 1 + movi v18.2d, #0 // initialize accumulator for idx + 2 + movi v19.2d, #0 // initialize accumulator for idx + 3 + + mov x12, x4 // filter pointer for idx + 0 + add x13, x4, x7 // filter pointer for idx + 1 + add x8, x3, w8, uxtw // srcp + filterPos[idx + 0] + add x9, x3, w9, uxtw // srcp + filterPos[idx + 1] + + add x14, x13, x7 // filter pointer for idx + 2 + add x10, x3, w10, uxtw // srcp + filterPos[idx + 2] + add x11, x3, w11, uxtw // srcp + filterPos[idx + 3] + + mov w0, w6 // copy filterSize to a temp register, w0 + add x5, x5, #16 // advance the filterPos pointer + add x15, x14, x7 // filter pointer for idx + 3 + mov x16, xzr // temp register for offsetting filter pointers + +2: + // This section loops over 8-wide chunks of filter size + ldr d4, [x8], #8 // load 8 bytes from srcp for idx + 0 + ldr q0, [x12, x16] // load 8 values, 16 bytes from filter for idx + 0 + + ldr d5, [x9], #8 // load 8 bytes from srcp for idx + 1 + ldr q1, [x13, x16] // load 8 values, 16 bytes from filter for idx + 1 + + uxtl v4.8h, v4.8b // unsigned extend long for idx + 0 + uxtl v5.8h, v5.8b // unsigned extend long for idx + 1 + + ldr d6, [x10], #8 // load 8 bytes from srcp for idx + 2 + ldr q2, [x14, x16] // load 8 values, 16 bytes from filter for idx + 2 + + smlal v16.4s, v0.4h, v4.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 0 + smlal v17.4s, v1.4h, v5.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 1 + + ldr d7, [x11], #8 // load 8 bytes from srcp for idx + 3 + ldr q3, [x15, x16] // load 8 values, 16 bytes from filter for idx + 3 + + sub w0, w0, #8 // decrement the remaining filterSize counter + smlal2 v16.4s, v0.8h, v4.8h // val += src[srcPos + j + 4..7] * filter[fs * i + j + 4..7], idx + 0 + smlal2 v17.4s, v1.8h, v5.8h // val += src[srcPos + j + 4..7] * filter[fs * i + j + 4..7], idx + 1 + uxtl v6.8h, v6.8b // unsigned extend long for idx + 2 + uxtl v7.8h, v7.8b // unsigned extend long for idx + 3 + smlal v18.4s, v2.4h, v6.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 2 + smlal v19.4s, v3.4h, v7.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 3 + + cmp w0, #8 // are there at least 8 more elements in filter to consume? + add x16, x16, #16 // advance the offsetting register for filter values + + smlal2 v18.4s, v2.8h, v6.8h // val += src[srcPos + j + 4..7] * filter[fs * i + j + 4..7], idx + 2 + smlal2 v19.4s, v3.8h, v7.8h // val += src[srcPos + j + 4..7] * filter[fs * i + j + 4..7], idx + 3 + + b.ge 2b // branch back to inner loop + + // complete the remaining 4 filter elements + sub x17, x7, #8 // calculate the offset of the filter pointer for the remaining 4 elements + + ldr s4, [x8] // load 4 bytes from srcp for idx + 0 + ldr d0, [x12, x17] // load 4 values, 8 bytes from filter for idx + 0 + ldr s5, [x9] // load 4 bytes from srcp for idx + 1 + ldr d1, [x13, x17] // load 4 values, 8 bytes from filter for idx + 1 + + uxtl v4.8h, v4.8b // unsigned extend long for idx + 0 + uxtl v5.8h, v5.8b // unsigned extend long for idx + 1 + + ldr s6, [x10] // load 4 bytes from srcp for idx + 2 + ldr d2, [x14, x17] // load 4 values, 8 bytes from filter for idx + 2 + smlal v16.4s, v0.4h, v4.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 0 + smlal v17.4s, v1.4h, v5.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 1 + ldr s7, [x11] // load 4 bytes from srcp for idx + 3 + ldr d3, [x15, x17] // load 4 values, 8 bytes from filter for idx + 3 + + uxtl v6.8h, v6.8b // unsigned extend long for idx + 2 + uxtl v7.8h, v7.8b // unsigned extend long for idx + 3 + addp v16.4s, v16.4s, v17.4s // horizontal pair adding for idx 0,1 + smlal v18.4s, v2.4h, v6.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 2 + smlal v19.4s, v3.4h, v7.4h // val += src[srcPos + j + 0..3] * filter[fs * i + j + 0..3], idx + 3 + + addp v18.4s, v18.4s, v19.4s // horizontal pair adding for idx 2,3 + addp v16.4s, v16.4s, v18.4s // final horizontal pair adding producing one vector with results for idx = 0..3 + + subs w2, w2, #4 // dstW -= 4 + sqshrn v0.4h, v16.4s, #7 // shift and clip the 2x16-bit final values + st1 {v0.4h}, [x1], #8 // write to destination idx 0..3 + add x4, x4, x7, lsl #2 // filter += (filterSize*2) * 4 + b.gt 1b // loop until end of line + ret +endfunc + function ff_hscale8to15_4_neon, export=1 // x0 SwsContext *c (not used) // x1 int16_t *dst @@ -240,3 +347,1103 @@ add sp, sp, #32 // clean up stack ret endfunc + +function ff_hscale8to19_4_neon, export=1 + // x0 SwsContext *c (unused) + // x1 int32_t *dst + // w2 int dstW + // x3 const uint8_t *src // treat it as uint16_t *src + // x4 const uint16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v18.4s, #1 + movi v17.4s, #1 + shl v18.4s, v18.4s, #19 + sub v18.4s, v18.4s, v17.4s // max allowed value + + cmp w2, #16 + b.lt 2f // move to last block + + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + + // load data from + ldr w8, [x3, w8, UXTW] + ldr w9, [x3, w9, UXTW] + ldr w10, [x3, w10, UXTW] + ldr w11, [x3, w11, UXTW] + ldr w12, [x3, w12, UXTW] + ldr w13, [x3, w13, UXTW] + ldr w14, [x3, w14, UXTW] + ldr w15, [x3, w15, UXTW] + + sub sp, sp, #32 + + stp w8, w9, [sp] + stp w10, w11, [sp, #8] + stp w12, w13, [sp, #16] + stp w14, w15, [sp, #24] + +1: + ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 // filter[0..7] + // load filterPositions into registers for next iteration + + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + uxtl v0.8h, v0.8b + ldr w8, [x3, w8, UXTW] + smull v5.4s, v0.4h, v28.4h // multiply first column of src + ldr w9, [x3, w9, UXTW] + smull2 v6.4s, v0.8h, v28.8h + stp w8, w9, [sp] + + uxtl v1.8h, v1.8b + ldr w10, [x3, w10, UXTW] + smlal v5.4s, v1.4h, v29.4h // multiply second column of src + ldr w11, [x3, w11, UXTW] + smlal2 v6.4s, v1.8h, v29.8h + stp w10, w11, [sp, #8] + + uxtl v2.8h, v2.8b + ldr w12, [x3, w12, UXTW] + smlal v5.4s, v2.4h, v30.4h // multiply third column of src + ldr w13, [x3, w13, UXTW] + smlal2 v6.4s, v2.8h, v30.8h + stp w12, w13, [sp, #16] + + uxtl v3.8h, v3.8b + ldr w14, [x3, w14, UXTW] + smlal v5.4s, v3.4h, v31.4h // multiply fourth column of src + ldr w15, [x3, w15, UXTW] + smlal2 v6.4s, v3.8h, v31.8h + stp w14, w15, [sp, #24] + + sub w2, w2, #8 + sshr v5.4s, v5.4s, #3 + sshr v6.4s, v6.4s, #3 + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + + st1 {v5.4s, v6.4s}, [x1], #32 + cmp w2, #16 + b.ge 1b + + // here we make last iteration, without updating the registers + ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 // filter[0..7] + + uxtl v0.8h, v0.8b + uxtl v1.8h, v1.8b + smull v5.4s, v0.4h, v28.4h + smull2 v6.4s, v0.8h, v28.8h + uxtl v2.8h, v2.8b + smlal v5.4s, v1.4h, v29.4H + smlal2 v6.4s, v1.8h, v29.8H + uxtl v3.8h, v3.8b + smlal v5.4s, v2.4h, v30.4H + smlal2 v6.4s, v2.8h, v30.8H + smlal v5.4s, v3.4h, v31.4H + smlal2 v6.4s, v3.8h, v31.8h + + sshr v5.4s, v5.4s, #3 + sshr v6.4s, v6.4s, #3 + + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + + sub w2, w2, #8 + st1 {v5.4s, v6.4s}, [x1], #32 + add sp, sp, #32 // restore stack + cbnz w2, 2f + + ret + +2: + ldr w8, [x5], #4 // load filterPos + add x9, x3, w8, UXTW // src + filterPos + ld1 {v0.s}[0], [x9] // load 4 * uint8_t* into one single + ld1 {v31.4h}, [x4], #8 + uxtl v0.8h, v0.8b + smull v5.4s, v0.4h, v31.4H + saddlv d0, v5.4S + sqshrn s0, d0, #3 + smin v0.4s, v0.4s, v18.4s + st1 {v0.s}[0], [x1], #4 + sub w2, w2, #1 + cbnz w2, 2b // if iterations remain jump to beginning + + ret +endfunc + +function ff_hscale8to19_X8_neon, export=1 + movi v20.4s, #1 + movi v17.4s, #1 + shl v20.4s, v20.4s, #19 + sub v20.4s, v20.4s, v17.4s + + sbfiz x7, x6, #1, #32 // filterSize*2 (*2 because int16) +1: + mov x16, x4 // filter0 = filter + ldr w8, [x5], #4 // filterPos[idx] + add x12, x16, x7 // filter1 = filter0 + filterSize*2 + ldr w0, [x5], #4 // filterPos[idx + 1] + add x13, x12, x7 // filter2 = filter1 + filterSize*2 + ldr w11, [x5], #4 // filterPos[idx + 2] + add x4, x13, x7 // filter3 = filter2 + filterSize*2 + ldr w9, [x5], #4 // filterPos[idx + 3] + movi v0.2D, #0 // val sum part 1 (for dst[0]) + movi v1.2D, #0 // val sum part 2 (for dst[1]) + movi v2.2D, #0 // val sum part 3 (for dst[2]) + movi v3.2D, #0 // val sum part 4 (for dst[3]) + add x17, x3, w8, UXTW // srcp + filterPos[0] + add x8, x3, w0, UXTW // srcp + filterPos[1] + add x0, x3, w11, UXTW // srcp + filterPos[2] + add x11, x3, w9, UXTW // srcp + filterPos[3] + mov w15, w6 // filterSize counter +2: ld1 {v4.8B}, [x17], #8 // srcp[filterPos[0] + {0..7}] + ld1 {v5.8H}, [x16], #16 // load 8x16-bit filter values, part 1 + uxtl v4.8H, v4.8B // unpack part 1 to 16-bit + smlal v0.4S, v4.4H, v5.4H // v0 accumulates srcp[filterPos[0] + {0..3}] * filter[{0..3}] + ld1 {v6.8B}, [x8], #8 // srcp[filterPos[1] + {0..7}] + smlal2 v0.4S, v4.8H, v5.8H // v0 accumulates srcp[filterPos[0] + {4..7}] * filter[{4..7}] + ld1 {v7.8H}, [x12], #16 // load 8x16-bit at filter+filterSize + ld1 {v16.8B}, [x0], #8 // srcp[filterPos[2] + {0..7}] + uxtl v6.8H, v6.8B // unpack part 2 to 16-bit + ld1 {v17.8H}, [x13], #16 // load 8x16-bit at filter+2*filterSize + uxtl v16.8H, v16.8B // unpack part 3 to 16-bit + smlal v1.4S, v6.4H, v7.4H // v1 accumulates srcp[filterPos[1] + {0..3}] * filter[{0..3}] + ld1 {v18.8B}, [x11], #8 // srcp[filterPos[3] + {0..7}] + smlal v2.4S, v16.4H, v17.4H // v2 accumulates srcp[filterPos[2] + {0..3}] * filter[{0..3}] + ld1 {v19.8H}, [x4], #16 // load 8x16-bit at filter+3*filterSize + smlal2 v2.4S, v16.8H, v17.8H // v2 accumulates srcp[filterPos[2] + {4..7}] * filter[{4..7}] + uxtl v18.8H, v18.8B // unpack part 4 to 16-bit + smlal2 v1.4S, v6.8H, v7.8H // v1 accumulates srcp[filterPos[1] + {4..7}] * filter[{4..7}] + smlal v3.4S, v18.4H, v19.4H // v3 accumulates srcp[filterPos[3] + {0..3}] * filter[{0..3}] + subs w15, w15, #8 // j -= 8: processed 8/filterSize + smlal2 v3.4S, v18.8H, v19.8H // v3 accumulates srcp[filterPos[3] + {4..7}] * filter[{4..7}] + b.gt 2b // inner loop if filterSize not consumed completely + addp v0.4S, v0.4S, v1.4S // part01 horizontal pair adding + addp v2.4S, v2.4S, v3.4S // part23 horizontal pair adding + addp v0.4S, v0.4S, v2.4S // part0123 horizontal pair adding + subs w2, w2, #4 // dstW -= 4 + sshr v0.4s, v0.4S, #3 // shift and clip the 2x16-bit final values + smin v0.4s, v0.4s, v20.4s + st1 {v0.4s}, [x1], #16 // write to destination part0123 + b.gt 1b // loop until end of line + ret +endfunc + +function ff_hscale8to19_X4_neon, export=1 + // x0 SwsContext *c (not used) + // x1 int16_t *dst + // w2 int dstW + // x3 const uint8_t *src + // x4 const int16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v20.4s, #1 + movi v17.4s, #1 + shl v20.4s, v20.4s, #19 + sub v20.4s, v20.4s, v17.4s + + lsl w7, w6, #1 +1: + ldp w8, w9, [x5] + ldp w10, w11, [x5, #8] + + movi v16.2d, #0 // initialize accumulator for idx + 0 + movi v17.2d, #0 // initialize accumulator for idx + 1 + movi v18.2d, #0 // initialize accumulator for idx + 2 + movi v19.2d, #0 // initialize accumulator for idx + 3 + + mov x12, x4 // filter + 0 + add x13, x4, x7 // filter + 1 + add x8, x3, w8, UXTW // srcp + filterPos 0 + add x14, x13, x7 // filter + 2 + add x9, x3, w9, UXTW // srcp + filterPos 1 + add x15, x14, x7 // filter + 3 + add x10, x3, w10, UXTW // srcp + filterPos 2 + mov w0, w6 // save the filterSize to temporary variable + add x11, x3, w11, UXTW // srcp + filterPos 3 + add x5, x5, #16 // advance filter position + mov x16, xzr // clear the register x16 used for offsetting the filter values + +2: + ldr d4, [x8], #8 // load src values for idx 0 + ldr q31, [x12, x16] // load filter values for idx 0 + uxtl v4.8h, v4.8b // extend type to match the filter' size + ldr d5, [x9], #8 // load src values for idx 1 + smlal v16.4s, v4.4h, v31.4h // multiplication of lower half for idx 0 + uxtl v5.8h, v5.8b // extend type to match the filter' size + ldr q30, [x13, x16] // load filter values for idx 1 + smlal2 v16.4s, v4.8h, v31.8h // multiplication of upper half for idx 0 + ldr d6, [x10], #8 // load src values for idx 2 + ldr q29, [x14, x16] // load filter values for idx 2 + smlal v17.4s, v5.4h, v30.4H // multiplication of lower half for idx 1 + ldr d7, [x11], #8 // load src values for idx 3 + smlal2 v17.4s, v5.8h, v30.8H // multiplication of upper half for idx 1 + uxtl v6.8h, v6.8B // extend tpye to matchi the filter's size + ldr q28, [x15, x16] // load filter values for idx 3 + smlal v18.4s, v6.4h, v29.4h // multiplication of lower half for idx 2 + uxtl v7.8h, v7.8B + smlal2 v18.4s, v6.8h, v29.8H // multiplication of upper half for idx 2 + sub w0, w0, #8 + smlal v19.4s, v7.4h, v28.4H // multiplication of lower half for idx 3 + cmp w0, #8 + smlal2 v19.4s, v7.8h, v28.8h // multiplication of upper half for idx 3 + add x16, x16, #16 // advance filter values indexing + + b.ge 2b + + + // 4 iterations left + + sub x17, x7, #8 // step back to wrap up the filter pos for last 4 elements + + ldr s4, [x8] // load src values for idx 0 + ldr d31, [x12, x17] // load filter values for idx 0 + uxtl v4.8h, v4.8b // extend type to match the filter' size + ldr s5, [x9] // load src values for idx 1 + smlal v16.4s, v4.4h, v31.4h + ldr d30, [x13, x17] // load filter values for idx 1 + uxtl v5.8h, v5.8b // extend type to match the filter' size + ldr s6, [x10] // load src values for idx 2 + smlal v17.4s, v5.4h, v30.4h + uxtl v6.8h, v6.8B // extend type to match the filter's size + ldr d29, [x14, x17] // load filter values for idx 2 + ldr s7, [x11] // load src values for idx 3 + addp v16.4s, v16.4s, v17.4s + uxtl v7.8h, v7.8B + ldr d28, [x15, x17] // load filter values for idx 3 + smlal v18.4s, v6.4h, v29.4h + smlal v19.4s, v7.4h, v28.4h + subs w2, w2, #4 + addp v18.4s, v18.4s, v19.4s + addp v16.4s, v16.4s, v18.4s + sshr v16.4s, v16.4s, #3 + smin v16.4s, v16.4s, v20.4s + + st1 {v16.4s}, [x1], #16 + add x4, x4, x7, lsl #2 + b.gt 1b + ret +endfunc + +function ff_hscale16to15_4_neon_asm, export=1 + // w0 int shift + // x1 int32_t *dst + // w2 int dstW + // x3 const uint8_t *src // treat it as uint16_t *src + // x4 const uint16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v18.4s, #1 + movi v17.4s, #1 + shl v18.4s, v18.4s, #15 + sub v18.4s, v18.4s, v17.4s // max allowed value + dup v17.4s, w0 // read shift + neg v17.4s, v17.4s // negate it, so it can be used in sshl (effectively shift right) + + cmp w2, #16 + b.lt 2f // move to last block + + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + + // shift all filterPos left by one, as uint16_t will be read + lsl x8, x8, #1 + lsl x9, x9, #1 + lsl x10, x10, #1 + lsl x11, x11, #1 + lsl x12, x12, #1 + lsl x13, x13, #1 + lsl x14, x14, #1 + lsl x15, x15, #1 + + // load src with given offset + ldr x8, [x3, w8, UXTW] + ldr x9, [x3, w9, UXTW] + ldr x10, [x3, w10, UXTW] + ldr x11, [x3, w11, UXTW] + ldr x12, [x3, w12, UXTW] + ldr x13, [x3, w13, UXTW] + ldr x14, [x3, w14, UXTW] + ldr x15, [x3, w15, UXTW] + + sub sp, sp, #64 + // push src on stack so it can be loaded into vectors later + stp x8, x9, [sp] + stp x10, x11, [sp, #16] + stp x12, x13, [sp, #32] + stp x14, x15, [sp, #48] + +1: + ld4 {v0.8h, v1.8h, v2.8h, v3.8h}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 // filter[0..7] + + // Each of blocks does the following: + // Extend src and filter to 32 bits with uxtl and sxtl + // multiply or multiply and accumulate results + // Extending to 32 bits is necessary, as unit16_t values can't + // be represented as int16_t without type promotion. + uxtl v26.4s, v0.4h + sxtl v27.4s, v28.4H + uxtl2 v0.4s, v0.8h + mul v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v28.8H + uxtl v26.4s, v1.4h + mul v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v29.4H + uxtl2 v0.4s, v1.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v29.8H + uxtl v26.4s, v2.4h + mla v6.4s, v28.4s, v0.4s + + sxtl v27.4s, v30.4H + uxtl2 v0.4s, v2.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v30.8H + uxtl v26.4s, v3.4h + mla v6.4s, v28.4s, v0.4s + + sxtl v27.4s, v31.4H + uxtl2 v0.4s, v3.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v31.8H + sub w2, w2, #8 + mla v6.4s, v28.4s, v0.4s + + sshl v5.4s, v5.4s, v17.4s + sshl v6.4s, v6.4s, v17.4s + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + xtn v5.4h, v5.4s + xtn2 v5.8h, v6.4s + + st1 {v5.8h}, [x1], #16 + cmp w2, #16 + + // load filterPositions into registers for next iteration + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + + lsl x8, x8, #1 + lsl x9, x9, #1 + lsl x10, x10, #1 + lsl x11, x11, #1 + lsl x12, x12, #1 + lsl x13, x13, #1 + lsl x14, x14, #1 + lsl x15, x15, #1 + + ldr x8, [x3, w8, UXTW] + ldr x9, [x3, w9, UXTW] + ldr x10, [x3, w10, UXTW] + ldr x11, [x3, w11, UXTW] + ldr x12, [x3, w12, UXTW] + ldr x13, [x3, w13, UXTW] + ldr x14, [x3, w14, UXTW] + ldr x15, [x3, w15, UXTW] + + stp x8, x9, [sp] + stp x10, x11, [sp, #16] + stp x12, x13, [sp, #32] + stp x14, x15, [sp, #48] + + b.ge 1b + + // here we make last iteration, without updating the registers + ld4 {v0.8h, v1.8h, v2.8h, v3.8h}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 + + uxtl v26.4s, v0.4h + sxtl v27.4s, v28.4H + uxtl2 v0.4s, v0.8h + mul v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v28.8H + uxtl v26.4s, v1.4h + mul v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v29.4H + uxtl2 v0.4s, v1.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v29.8H + uxtl v26.4s, v2.4h + mla v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v30.4H + uxtl2 v0.4s, v2.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v30.8H + uxtl v26.4s, v3.4h + mla v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v31.4H + uxtl2 v0.4s, v3.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v31.8H + subs w2, w2, #8 + mla v6.4s, v0.4s, v28.4s + + sshl v5.4s, v5.4s, v17.4s + sshl v6.4s, v6.4s, v17.4s + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + xtn v5.4h, v5.4S + xtn2 v5.8h, v6.4s + + st1 {v5.8h}, [x1], #16 + add sp, sp, #64 // restore stack + cbnz w2, 2f + + ret + +2: + ldr w8, [x5], #4 // load filterPos + lsl w8, w8, #1 + add x9, x3, w8, UXTW // src + filterPos + ld1 {v0.4h}, [x9] // load 4 * uint16_t + ld1 {v31.4h}, [x4], #8 + + uxtl v0.4s, v0.4h + sxtl v31.4s, v31.4h + mul v5.4s, v0.4s, v31.4s + addv s0, v5.4S + sshl v0.4s, v0.4s, v17.4s + smin v0.4s, v0.4s, v18.4s + st1 {v0.h}[0], [x1], #2 + sub w2, w2, #1 + cbnz w2, 2b // if iterations remain jump to beginning + + ret +endfunc + +function ff_hscale16to15_X8_neon_asm, export=1 + // w0 int shift + // x1 int32_t *dst + // w2 int dstW + // x3 const uint8_t *src // treat it as uint16_t *src + // x4 const uint16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v20.4s, #1 + movi v21.4s, #1 + shl v20.4s, v20.4s, #15 + sub v20.4s, v20.4s, v21.4s + dup v21.4s, w0 + neg v21.4s, v21.4s + + sbfiz x7, x6, #1, #32 // filterSize*2 (*2 because int16) +1: ldr w8, [x5], #4 // filterPos[idx] + lsl w8, w8, #1 + ldr w10, [x5], #4 // filterPos[idx + 1] + lsl w10, w10, #1 + ldr w11, [x5], #4 // filterPos[idx + 2] + lsl w11, w11, #1 + ldr w9, [x5], #4 // filterPos[idx + 3] + lsl w9, w9, #1 + mov x16, x4 // filter0 = filter + add x12, x16, x7 // filter1 = filter0 + filterSize*2 + add x13, x12, x7 // filter2 = filter1 + filterSize*2 + add x4, x13, x7 // filter3 = filter2 + filterSize*2 + movi v0.2D, #0 // val sum part 1 (for dst[0]) + movi v1.2D, #0 // val sum part 2 (for dst[1]) + movi v2.2D, #0 // val sum part 3 (for dst[2]) + movi v3.2D, #0 // val sum part 4 (for dst[3]) + add x17, x3, w8, UXTW // srcp + filterPos[0] + add x8, x3, w10, UXTW // srcp + filterPos[1] + add x10, x3, w11, UXTW // srcp + filterPos[2] + add x11, x3, w9, UXTW // srcp + filterPos[3] + mov w15, w6 // filterSize counter +2: ld1 {v4.8H}, [x17], #16 // srcp[filterPos[0] + {0..7}] + ld1 {v5.8H}, [x16], #16 // load 8x16-bit filter values, part 1 + ld1 {v6.8H}, [x8], #16 // srcp[filterPos[1] + {0..7}] + ld1 {v7.8H}, [x12], #16 // load 8x16-bit at filter+filterSize + uxtl v24.4s, v4.4H // extend srcp lower half to 32 bits to preserve sign + sxtl v25.4s, v5.4H // extend filter lower half to 32 bits to match srcp size + uxtl2 v4.4s, v4.8h // extend srcp upper half to 32 bits + mla v0.4s, v24.4s, v25.4s // multiply accumulate lower half of v4 * v5 + sxtl2 v5.4s, v5.8h // extend filter upper half to 32 bits + uxtl v26.4s, v6.4h // extend srcp lower half to 32 bits + mla v0.4S, v4.4s, v5.4s // multiply accumulate upper half of v4 * v5 + sxtl v27.4s, v7.4H // exted filter lower half + uxtl2 v6.4s, v6.8H // extend srcp upper half + sxtl2 v7.4s, v7.8h // extend filter upper half + ld1 {v16.8H}, [x10], #16 // srcp[filterPos[2] + {0..7}] + mla v1.4S, v26.4s, v27.4s // v1 accumulates srcp[filterPos[1] + {0..3}] * filter[{0..3}] + ld1 {v17.8H}, [x13], #16 // load 8x16-bit at filter+2*filterSize + uxtl v22.4s, v16.4H // extend srcp lower half + sxtl v23.4s, v17.4H // extend filter lower half + uxtl2 v16.4s, v16.8H // extend srcp upper half + sxtl2 v17.4s, v17.8h // extend filter upper half + mla v2.4S, v22.4s, v23.4s // v2 accumulates srcp[filterPos[2] + {0..3}] * filter[{0..3}] + mla v2.4S, v16.4s, v17.4s // v2 accumulates srcp[filterPos[2] + {4..7}] * filter[{4..7}] + ld1 {v18.8H}, [x11], #16 // srcp[filterPos[3] + {0..7}] + mla v1.4S, v6.4s, v7.4s // v1 accumulates srcp[filterPos[1] + {4..7}] * filter[{4..7}] + ld1 {v19.8H}, [x4], #16 // load 8x16-bit at filter+3*filterSize + subs w15, w15, #8 // j -= 8: processed 8/filterSize + uxtl v28.4s, v18.4H // extend srcp lower half + sxtl v29.4s, v19.4H // extend filter lower half + uxtl2 v18.4s, v18.8H // extend srcp upper half + sxtl2 v19.4s, v19.8h // extend filter upper half + mla v3.4S, v28.4s, v29.4s // v3 accumulates srcp[filterPos[3] + {0..3}] * filter[{0..3}] + mla v3.4S, v18.4s, v19.4s // v3 accumulates srcp[filterPos[3] + {4..7}] * filter[{4..7}] + b.gt 2b // inner loop if filterSize not consumed completely + addp v0.4S, v0.4S, v1.4S // part01 horizontal pair adding + addp v2.4S, v2.4S, v3.4S // part23 horizontal pair adding + addp v0.4S, v0.4S, v2.4S // part0123 horizontal pair adding + subs w2, w2, #4 // dstW -= 4 + sshl v0.4s, v0.4s, v21.4s // shift right (effectively rigth, as shift is negative); overflow expected + smin v0.4s, v0.4s, v20.4s // apply min (do not use sqshl) + xtn v0.4h, v0.4s // narrow down to 16 bits + + st1 {v0.4H}, [x1], #8 // write to destination part0123 + b.gt 1b // loop until end of line + ret +endfunc + +function ff_hscale16to15_X4_neon_asm, export=1 + // w0 int shift + // x1 int16_t *dst + // w2 int dstW + // x3 const uint8_t *src + // x4 const int16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + stp d8, d9, [sp, #-0x20]! + stp d10, d11, [sp, #0x10] + + movi v18.4s, #1 + movi v17.4s, #1 + shl v18.4s, v18.4s, #15 + sub v21.4s, v18.4s, v17.4s // max allowed value + dup v17.4s, w0 // read shift + neg v20.4s, v17.4s // negate it, so it can be used in sshl (effectively shift right) + + lsl w7, w6, #1 +1: + ldp w8, w9, [x5] + ldp w10, w11, [x5, #8] + + movi v16.2d, #0 // initialize accumulator for idx + 0 + movi v17.2d, #0 // initialize accumulator for idx + 1 + movi v18.2d, #0 // initialize accumulator for idx + 2 + movi v19.2d, #0 // initialize accumulator for idx + 3 + + mov x12, x4 // filter + 0 + add x13, x4, x7 // filter + 1 + add x8, x3, x8, lsl #1 // srcp + filterPos 0 + add x14, x13, x7 // filter + 2 + add x9, x3, x9, lsl #1 // srcp + filterPos 1 + add x15, x14, x7 // filter + 3 + add x10, x3, x10, lsl #1 // srcp + filterPos 2 + mov w0, w6 // save the filterSize to temporary variable + add x11, x3, x11, lsl #1 // srcp + filterPos 3 + add x5, x5, #16 // advance filter position + mov x16, xzr // clear the register x16 used for offsetting the filter values + +2: + ldr q4, [x8], #16 // load src values for idx 0 + ldr q5, [x9], #16 // load src values for idx 1 + uxtl v26.4s, v4.4h + uxtl2 v4.4s, v4.8h + ldr q31, [x12, x16] // load filter values for idx 0 + ldr q6, [x10], #16 // load src values for idx 2 + sxtl v22.4s, v31.4h + sxtl2 v31.4s, v31.8h + mla v16.4s, v26.4s, v22.4s // multiplication of lower half for idx 0 + uxtl v25.4s, v5.4h + uxtl2 v5.4s, v5.8h + ldr q30, [x13, x16] // load filter values for idx 1 + ldr q7, [x11], #16 // load src values for idx 3 + mla v16.4s, v4.4s, v31.4s // multiplication of upper half for idx 0 + uxtl v24.4s, v6.4h + sxtl v8.4s, v30.4h + sxtl2 v30.4s, v30.8h + mla v17.4s, v25.4s, v8.4s // multiplication of lower half for idx 1 + ldr q29, [x14, x16] // load filter values for idx 2 + uxtl2 v6.4s, v6.8h + sxtl v9.4s, v29.4h + sxtl2 v29.4s, v29.8h + mla v17.4s, v5.4s, v30.4s // multiplication of upper half for idx 1 + mla v18.4s, v24.4s, v9.4s // multiplication of lower half for idx 2 + ldr q28, [x15, x16] // load filter values for idx 3 + uxtl v23.4s, v7.4h + sxtl v10.4s, v28.4h + mla v18.4s, v6.4s, v29.4s // multiplication of upper half for idx 2 + uxtl2 v7.4s, v7.8h + sxtl2 v28.4s, v28.8h + mla v19.4s, v23.4s, v10.4s // multiplication of lower half for idx 3 + sub w0, w0, #8 + cmp w0, #8 + mla v19.4s, v7.4s, v28.4s // multiplication of upper half for idx 3 + + add x16, x16, #16 // advance filter values indexing + + b.ge 2b + + // 4 iterations left + + sub x17, x7, #8 // step back to wrap up the filter pos for last 4 elements + + ldr d4, [x8] // load src values for idx 0 + ldr d31, [x12, x17] // load filter values for idx 0 + uxtl v4.4s, v4.4h + sxtl v31.4s, v31.4h + ldr d5, [x9] // load src values for idx 1 + mla v16.4s, v4.4s, v31.4s // multiplication of upper half for idx 0 + ldr d30, [x13, x17] // load filter values for idx 1 + uxtl v5.4s, v5.4h + sxtl v30.4s, v30.4h + ldr d6, [x10] // load src values for idx 2 + mla v17.4s, v5.4s, v30.4s // multiplication of upper half for idx 1 + ldr d29, [x14, x17] // load filter values for idx 2 + uxtl v6.4s, v6.4h + sxtl v29.4s, v29.4h + ldr d7, [x11] // load src values for idx 3 + ldr d28, [x15, x17] // load filter values for idx 3 + mla v18.4s, v6.4s, v29.4s // multiplication of upper half for idx 2 + uxtl v7.4s, v7.4h + sxtl v28.4s, v28.4h + addp v16.4s, v16.4s, v17.4s + mla v19.4s, v7.4s, v28.4s // multiplication of upper half for idx 3 + subs w2, w2, #4 + addp v18.4s, v18.4s, v19.4s + addp v16.4s, v16.4s, v18.4s + sshl v16.4s, v16.4s, v20.4s + smin v16.4s, v16.4s, v21.4s + xtn v16.4h, v16.4s + + st1 {v16.4h}, [x1], #8 + add x4, x4, x7, lsl #2 + b.gt 1b + + ldp d8, d9, [sp] + ldp d10, d11, [sp, #0x10] + + add sp, sp, #0x20 + + ret +endfunc + +function ff_hscale16to19_4_neon_asm, export=1 + // w0 int shift + // x1 int32_t *dst + // w2 int dstW + // x3 const uint8_t *src // treat it as uint16_t *src + // x4 const uint16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v18.4s, #1 + movi v17.4s, #1 + shl v18.4s, v18.4s, #19 + sub v18.4s, v18.4s, v17.4s // max allowed value + dup v17.4s, w0 // read shift + neg v17.4s, v17.4s // negate it, so it can be used in sshl (effectively shift right) + + cmp w2, #16 + b.lt 2f // move to last block + + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + + // shift all filterPos left by one, as uint16_t will be read + lsl x8, x8, #1 + lsl x9, x9, #1 + lsl x10, x10, #1 + lsl x11, x11, #1 + lsl x12, x12, #1 + lsl x13, x13, #1 + lsl x14, x14, #1 + lsl x15, x15, #1 + + // load src with given offset + ldr x8, [x3, w8, UXTW] + ldr x9, [x3, w9, UXTW] + ldr x10, [x3, w10, UXTW] + ldr x11, [x3, w11, UXTW] + ldr x12, [x3, w12, UXTW] + ldr x13, [x3, w13, UXTW] + ldr x14, [x3, w14, UXTW] + ldr x15, [x3, w15, UXTW] + + sub sp, sp, #64 + // push src on stack so it can be loaded into vectors later + stp x8, x9, [sp] + stp x10, x11, [sp, #16] + stp x12, x13, [sp, #32] + stp x14, x15, [sp, #48] + +1: + ld4 {v0.8h, v1.8h, v2.8h, v3.8h}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 // filter[0..7] + + // Each of blocks does the following: + // Extend src and filter to 32 bits with uxtl and sxtl + // multiply or multiply and accumulate results + // Extending to 32 bits is necessary, as unit16_t values can't + // be represented as int16_t without type promotion. + uxtl v26.4s, v0.4h + sxtl v27.4s, v28.4H + uxtl2 v0.4s, v0.8h + mul v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v28.8H + uxtl v26.4s, v1.4h + mul v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v29.4H + uxtl2 v0.4s, v1.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v29.8H + uxtl v26.4s, v2.4h + mla v6.4s, v28.4s, v0.4s + + sxtl v27.4s, v30.4H + uxtl2 v0.4s, v2.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v30.8H + uxtl v26.4s, v3.4h + mla v6.4s, v28.4s, v0.4s + + sxtl v27.4s, v31.4H + uxtl2 v0.4s, v3.8h + mla v5.4s, v27.4s, v26.4s + sxtl2 v28.4s, v31.8H + sub w2, w2, #8 + mla v6.4s, v28.4s, v0.4s + + sshl v5.4s, v5.4s, v17.4s + sshl v6.4s, v6.4s, v17.4s + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + + st1 {v5.4s, v6.4s}, [x1], #32 + cmp w2, #16 + + // load filterPositions into registers for next iteration + ldp w8, w9, [x5] // filterPos[0], filterPos[1] + ldp w10, w11, [x5, #8] // filterPos[2], filterPos[3] + ldp w12, w13, [x5, #16] // filterPos[4], filterPos[5] + ldp w14, w15, [x5, #24] // filterPos[6], filterPos[7] + add x5, x5, #32 + + lsl x8, x8, #1 + lsl x9, x9, #1 + lsl x10, x10, #1 + lsl x11, x11, #1 + lsl x12, x12, #1 + lsl x13, x13, #1 + lsl x14, x14, #1 + lsl x15, x15, #1 + + ldr x8, [x3, w8, UXTW] + ldr x9, [x3, w9, UXTW] + ldr x10, [x3, w10, UXTW] + ldr x11, [x3, w11, UXTW] + ldr x12, [x3, w12, UXTW] + ldr x13, [x3, w13, UXTW] + ldr x14, [x3, w14, UXTW] + ldr x15, [x3, w15, UXTW] + + stp x8, x9, [sp] + stp x10, x11, [sp, #16] + stp x12, x13, [sp, #32] + stp x14, x15, [sp, #48] + + b.ge 1b + + // here we make last iteration, without updating the registers + ld4 {v0.8h, v1.8h, v2.8h, v3.8h}, [sp] + ld4 {v28.8h, v29.8h, v30.8h, v31.8h}, [x4], #64 + + uxtl v26.4s, v0.4h + sxtl v27.4s, v28.4H + uxtl2 v0.4s, v0.8h + mul v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v28.8H + uxtl v26.4s, v1.4h + mul v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v29.4H + uxtl2 v0.4s, v1.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v29.8H + uxtl v26.4s, v2.4h + mla v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v30.4H + uxtl2 v0.4s, v2.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v30.8H + uxtl v26.4s, v3.4h + mla v6.4s, v0.4s, v28.4s + + sxtl v27.4s, v31.4H + uxtl2 v0.4s, v3.8h + mla v5.4s, v26.4s, v27.4s + sxtl2 v28.4s, v31.8H + subs w2, w2, #8 + mla v6.4s, v0.4s, v28.4s + + sshl v5.4s, v5.4s, v17.4s + sshl v6.4s, v6.4s, v17.4s + + smin v5.4s, v5.4s, v18.4s + smin v6.4s, v6.4s, v18.4s + + st1 {v5.4s, v6.4s}, [x1], #32 + add sp, sp, #64 // restore stack + cbnz w2, 2f + + ret + +2: + ldr w8, [x5], #4 // load filterPos + lsl w8, w8, #1 + add x9, x3, w8, UXTW // src + filterPos + ld1 {v0.4h}, [x9] // load 4 * uint16_t + ld1 {v31.4h}, [x4], #8 + + uxtl v0.4s, v0.4h + sxtl v31.4s, v31.4h + subs w2, w2, #1 + mul v5.4s, v0.4s, v31.4s + addv s0, v5.4S + sshl v0.4s, v0.4s, v17.4s + smin v0.4s, v0.4s, v18.4s + st1 {v0.s}[0], [x1], #4 + cbnz w2, 2b // if iterations remain jump to beginning + + ret +endfunc + +function ff_hscale16to19_X8_neon_asm, export=1 + // w0 int shift + // x1 int32_t *dst + // w2 int dstW + // x3 const uint8_t *src // treat it as uint16_t *src + // x4 const uint16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + movi v20.4s, #1 + movi v21.4s, #1 + shl v20.4s, v20.4s, #19 + sub v20.4s, v20.4s, v21.4s + dup v21.4s, w0 + neg v21.4s, v21.4s + + sbfiz x7, x6, #1, #32 // filterSize*2 (*2 because int16) +1: ldr w8, [x5], #4 // filterPos[idx] + ldr w10, [x5], #4 // filterPos[idx + 1] + lsl w8, w8, #1 + ldr w11, [x5], #4 // filterPos[idx + 2] + ldr w9, [x5], #4 // filterPos[idx + 3] + mov x16, x4 // filter0 = filter + lsl w11, w11, #1 + add x12, x16, x7 // filter1 = filter0 + filterSize*2 + lsl w9, w9, #1 + add x13, x12, x7 // filter2 = filter1 + filterSize*2 + lsl w10, w10, #1 + add x4, x13, x7 // filter3 = filter2 + filterSize*2 + movi v0.2D, #0 // val sum part 1 (for dst[0]) + movi v1.2D, #0 // val sum part 2 (for dst[1]) + movi v2.2D, #0 // val sum part 3 (for dst[2]) + movi v3.2D, #0 // val sum part 4 (for dst[3]) + add x17, x3, w8, UXTW // srcp + filterPos[0] + add x8, x3, w10, UXTW // srcp + filterPos[1] + add x10, x3, w11, UXTW // srcp + filterPos[2] + add x11, x3, w9, UXTW // srcp + filterPos[3] + mov w15, w6 // filterSize counter +2: ld1 {v4.8H}, [x17], #16 // srcp[filterPos[0] + {0..7}] + ld1 {v5.8H}, [x16], #16 // load 8x16-bit filter values, part 1 + ld1 {v6.8H}, [x8], #16 // srcp[filterPos[1] + {0..7}] + ld1 {v7.8H}, [x12], #16 // load 8x16-bit at filter+filterSize + uxtl v24.4s, v4.4H // extend srcp lower half to 32 bits to preserve sign + sxtl v25.4s, v5.4H // extend filter lower half to 32 bits to match srcp size + uxtl2 v4.4s, v4.8h // extend srcp upper half to 32 bits + mla v0.4s, v24.4s, v25.4s // multiply accumulate lower half of v4 * v5 + sxtl2 v5.4s, v5.8h // extend filter upper half to 32 bits + uxtl v26.4s, v6.4h // extend srcp lower half to 32 bits + mla v0.4S, v4.4s, v5.4s // multiply accumulate upper half of v4 * v5 + sxtl v27.4s, v7.4H // exted filter lower half + uxtl2 v6.4s, v6.8H // extend srcp upper half + sxtl2 v7.4s, v7.8h // extend filter upper half + ld1 {v16.8H}, [x10], #16 // srcp[filterPos[2] + {0..7}] + mla v1.4S, v26.4s, v27.4s // v1 accumulates srcp[filterPos[1] + {0..3}] * filter[{0..3}] + ld1 {v17.8H}, [x13], #16 // load 8x16-bit at filter+2*filterSize + uxtl v22.4s, v16.4H // extend srcp lower half + sxtl v23.4s, v17.4H // extend filter lower half + uxtl2 v16.4s, v16.8H // extend srcp upper half + sxtl2 v17.4s, v17.8h // extend filter upper half + mla v2.4S, v22.4s, v23.4s // v2 accumulates srcp[filterPos[2] + {0..3}] * filter[{0..3}] + mla v2.4S, v16.4s, v17.4s // v2 accumulates srcp[filterPos[2] + {4..7}] * filter[{4..7}] + ld1 {v18.8H}, [x11], #16 // srcp[filterPos[3] + {0..7}] + mla v1.4S, v6.4s, v7.4s // v1 accumulates srcp[filterPos[1] + {4..7}] * filter[{4..7}] + ld1 {v19.8H}, [x4], #16 // load 8x16-bit at filter+3*filterSize + subs w15, w15, #8 // j -= 8: processed 8/filterSize + uxtl v28.4s, v18.4H // extend srcp lower half + sxtl v29.4s, v19.4H // extend filter lower half + uxtl2 v18.4s, v18.8H // extend srcp upper half + sxtl2 v19.4s, v19.8h // extend filter upper half + mla v3.4S, v28.4s, v29.4s // v3 accumulates srcp[filterPos[3] + {0..3}] * filter[{0..3}] + mla v3.4S, v18.4s, v19.4s // v3 accumulates srcp[filterPos[3] + {4..7}] * filter[{4..7}] + b.gt 2b // inner loop if filterSize not consumed completely + addp v0.4S, v0.4S, v1.4S // part01 horizontal pair adding + addp v2.4S, v2.4S, v3.4S // part23 horizontal pair adding + addp v0.4S, v0.4S, v2.4S // part0123 horizontal pair adding + subs w2, w2, #4 // dstW -= 4 + sshl v0.4s, v0.4s, v21.4s // shift right (effectively rigth, as shift is negative); overflow expected + smin v0.4s, v0.4s, v20.4s // apply min (do not use sqshl) + st1 {v0.4s}, [x1], #16 // write to destination part0123 + b.gt 1b // loop until end of line + ret +endfunc + +function ff_hscale16to19_X4_neon_asm, export=1 + // w0 int shift + // x1 int16_t *dst + // w2 int dstW + // x3 const uint8_t *src + // x4 const int16_t *filter + // x5 const int32_t *filterPos + // w6 int filterSize + + stp d8, d9, [sp, #-0x20]! + stp d10, d11, [sp, #0x10] + + movi v18.4s, #1 + movi v17.4s, #1 + shl v18.4s, v18.4s, #19 + sub v21.4s, v18.4s, v17.4s // max allowed value + dup v17.4s, w0 // read shift + neg v20.4s, v17.4s // negate it, so it can be used in sshl (effectively shift right) + + lsl w7, w6, #1 +1: + ldp w8, w9, [x5] + ldp w10, w11, [x5, #8] + + movi v16.2d, #0 // initialize accumulator for idx + 0 + movi v17.2d, #0 // initialize accumulator for idx + 1 + movi v18.2d, #0 // initialize accumulator for idx + 2 + movi v19.2d, #0 // initialize accumulator for idx + 3 + + mov x12, x4 // filter + 0 + add x13, x4, x7 // filter + 1 + add x8, x3, x8, lsl #1 // srcp + filterPos 0 + add x14, x13, x7 // filter + 2 + add x9, x3, x9, lsl #1 // srcp + filterPos 1 + add x15, x14, x7 // filter + 3 + add x10, x3, x10, lsl #1 // srcp + filterPos 2 + mov w0, w6 // save the filterSize to temporary variable + add x11, x3, x11, lsl #1 // srcp + filterPos 3 + add x5, x5, #16 // advance filter position + mov x16, xzr // clear the register x16 used for offsetting the filter values + +2: + ldr q4, [x8], #16 // load src values for idx 0 + ldr q5, [x9], #16 // load src values for idx 1 + uxtl v26.4s, v4.4h + uxtl2 v4.4s, v4.8h + ldr q31, [x12, x16] // load filter values for idx 0 + ldr q6, [x10], #16 // load src values for idx 2 + sxtl v22.4s, v31.4h + sxtl2 v31.4s, v31.8h + mla v16.4s, v26.4s, v22.4s // multiplication of lower half for idx 0 + uxtl v25.4s, v5.4h + uxtl2 v5.4s, v5.8h + ldr q30, [x13, x16] // load filter values for idx 1 + ldr q7, [x11], #16 // load src values for idx 3 + mla v16.4s, v4.4s, v31.4s // multiplication of upper half for idx 0 + uxtl v24.4s, v6.4h + sxtl v8.4s, v30.4h + sxtl2 v30.4s, v30.8h + mla v17.4s, v25.4s, v8.4s // multiplication of lower half for idx 1 + ldr q29, [x14, x16] // load filter values for idx 2 + uxtl2 v6.4s, v6.8h + sxtl v9.4s, v29.4h + sxtl2 v29.4s, v29.8h + mla v17.4s, v5.4s, v30.4s // multiplication of upper half for idx 1 + ldr q28, [x15, x16] // load filter values for idx 3 + mla v18.4s, v24.4s, v9.4s // multiplication of lower half for idx 2 + uxtl v23.4s, v7.4h + sxtl v10.4s, v28.4h + mla v18.4s, v6.4s, v29.4s // multiplication of upper half for idx 2 + uxtl2 v7.4s, v7.8h + sxtl2 v28.4s, v28.8h + mla v19.4s, v23.4s, v10.4s // multiplication of lower half for idx 3 + sub w0, w0, #8 + cmp w0, #8 + mla v19.4s, v7.4s, v28.4s // multiplication of upper half for idx 3 + + add x16, x16, #16 // advance filter values indexing + + b.ge 2b + + // 4 iterations left + + sub x17, x7, #8 // step back to wrap up the filter pos for last 4 elements + + ldr d4, [x8] // load src values for idx 0 + ldr d31, [x12, x17] // load filter values for idx 0 + uxtl v4.4s, v4.4h + sxtl v31.4s, v31.4h + ldr d5, [x9] // load src values for idx 1 + mla v16.4s, v4.4s, v31.4s // multiplication of upper half for idx 0 + ldr d30, [x13, x17] // load filter values for idx 1 + uxtl v5.4s, v5.4h + sxtl v30.4s, v30.4h + ldr d6, [x10] // load src values for idx 2 + mla v17.4s, v5.4s, v30.4s // multiplication of upper half for idx 1 + ldr d29, [x14, x17] // load filter values for idx 2 + uxtl v6.4s, v6.4h + sxtl v29.4s, v29.4h + ldr d7, [x11] // load src values for idx 3 + ldr d28, [x15, x17] // load filter values for idx 3 + mla v18.4s, v6.4s, v29.4s // multiplication of upper half for idx 2 + uxtl v7.4s, v7.4h + sxtl v28.4s, v28.4h + addp v16.4s, v16.4s, v17.4s + mla v19.4s, v7.4s, v28.4s // multiplication of upper half for idx 3 + subs w2, w2, #4 + addp v18.4s, v18.4s, v19.4s + addp v16.4s, v16.4s, v18.4s + sshl v16.4s, v16.4s, v20.4s + smin v16.4s, v16.4s, v21.4s + + st1 {v16.4s}, [x1], #16 + add x4, x4, x7, lsl #2 + b.gt 1b + + ldp d8, d9, [sp] + ldp d10, d11, [sp, #0x10] + + add sp, sp, #0x20 + + ret +endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/output.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/output.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/output.S 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/output.S 2023-03-03 13:29:59.000000000 +0000 @@ -21,29 +21,48 @@ #include "libavutil/aarch64/asm.S" function ff_yuv2planeX_8_neon, export=1 +// x0 - const int16_t *filter, +// x1 - int filterSize, +// x2 - const int16_t **src, +// x3 - uint8_t *dest, +// w4 - int dstW, +// x5 - const uint8_t *dither, +// w6 - int offset + ld1 {v0.8B}, [x5] // load 8x8-bit dither + and w6, w6, #7 cbz w6, 1f // check if offsetting present ext v0.8B, v0.8B, v0.8B, #3 // honor offsetting which can be 0 or 3 only 1: uxtl v0.8H, v0.8B // extend dither to 16-bit ushll v1.4S, v0.4H, #12 // extend dither to 32-bit with left shift by 12 (part 1) ushll2 v2.4S, v0.8H, #12 // extend dither to 32-bit with left shift by 12 (part 2) + cmp w1, #8 // if filterSize == 8, branch to specialized version + b.eq 6f + cmp w1, #4 // if filterSize == 4, branch to specialized version + b.eq 8f + cmp w1, #2 // if filterSize == 2, branch to specialized version + b.eq 10f + +// The filter size does not match of the of specialized implementations. It is either even or odd. If it is even +// then use the first section below. mov x7, #0 // i = 0 + tbnz w1, #0, 4f // if filterSize % 2 != 0 branch to specialized version +// fs % 2 == 0 2: mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value mov w8, w1 // tmpfilterSize = filterSize mov x9, x2 // srcp = src mov x10, x0 // filterp = filter 3: ldp x11, x12, [x9], #16 // get 2 pointers: src[j] and src[j+1] + ldr s7, [x10], #4 // read 2x16-bit coeff X and Y at filter[j] and filter[j+1] add x11, x11, x7, lsl #1 // &src[j ][i] add x12, x12, x7, lsl #1 // &src[j+1][i] ld1 {v5.8H}, [x11] // read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H ld1 {v6.8H}, [x12] // read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P - ld1r {v7.8H}, [x10], #2 // read 1x16-bit coeff X at filter[j ] and duplicate across lanes - ld1r {v16.8H}, [x10], #2 // read 1x16-bit coeff Y at filter[j+1] and duplicate across lanes - smlal v3.4S, v5.4H, v7.4H // val0 += {A,B,C,D} * X - smlal2 v4.4S, v5.8H, v7.8H // val1 += {E,F,G,H} * X - smlal v3.4S, v6.4H, v16.4H // val0 += {I,J,K,L} * Y - smlal2 v4.4S, v6.8H, v16.8H // val1 += {M,N,O,P} * Y + smlal v3.4S, v5.4H, v7.H[0] // val0 += {A,B,C,D} * X + smlal2 v4.4S, v5.8H, v7.H[0] // val1 += {E,F,G,H} * X + smlal v3.4S, v6.4H, v7.H[1] // val0 += {I,J,K,L} * Y + smlal2 v4.4S, v6.8H, v7.H[1] // val1 += {M,N,O,P} * Y subs w8, w8, #2 // tmpfilterSize -= 2 b.gt 3b // loop until filterSize consumed @@ -55,4 +74,161 @@ add x7, x7, #8 // i += 8 b.gt 2b // loop until width consumed ret + +// If filter size is odd (most likely == 1), then use this section. +// fs % 2 != 0 +4: mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value + mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value + mov w8, w1 // tmpfilterSize = filterSize + mov x9, x2 // srcp = src + mov x10, x0 // filterp = filter +5: ldr x11, [x9], #8 // get 1 pointer: src[j] + ldr h6, [x10], #2 // read 1 16 bit coeff X at filter[j] + add x11, x11, x7, lsl #1 // &src[j ][i] + ld1 {v5.8H}, [x11] // read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H + smlal v3.4S, v5.4H, v6.H[0] // val0 += {A,B,C,D} * X + smlal2 v4.4S, v5.8H, v6.H[0] // val1 += {E,F,G,H} * X + subs w8, w8, #1 // tmpfilterSize -= 2 + b.gt 5b // loop until filterSize consumed + + sqshrun v3.4h, v3.4s, #16 // clip16(val0>>16) + sqshrun2 v3.8h, v4.4s, #16 // clip16(val1>>16) + uqshrn v3.8b, v3.8h, #3 // clip8(val>>19) + st1 {v3.8b}, [x3], #8 // write to destination + subs w4, w4, #8 // dstW -= 8 + add x7, x7, #8 // i += 8 + b.gt 4b // loop until width consumed + ret + +6: // fs=8 + ldp x5, x6, [x2] // load 2 pointers: src[j ] and src[j+1] + ldp x7, x9, [x2, #16] // load 2 pointers: src[j+2] and src[j+3] + ldp x10, x11, [x2, #32] // load 2 pointers: src[j+4] and src[j+5] + ldp x12, x13, [x2, #48] // load 2 pointers: src[j+6] and src[j+7] + + // load 8x16-bit values for filter[j], where j=0..7 + ld1 {v6.8H}, [x0] +7: + mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value + mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value + + ld1 {v24.8H}, [x5], #16 // load 8x16-bit values for src[j + 0][i + {0..7}] + ld1 {v25.8H}, [x6], #16 // load 8x16-bit values for src[j + 1][i + {0..7}] + ld1 {v26.8H}, [x7], #16 // load 8x16-bit values for src[j + 2][i + {0..7}] + ld1 {v27.8H}, [x9], #16 // load 8x16-bit values for src[j + 3][i + {0..7}] + ld1 {v28.8H}, [x10], #16 // load 8x16-bit values for src[j + 4][i + {0..7}] + ld1 {v29.8H}, [x11], #16 // load 8x16-bit values for src[j + 5][i + {0..7}] + ld1 {v30.8H}, [x12], #16 // load 8x16-bit values for src[j + 6][i + {0..7}] + ld1 {v31.8H}, [x13], #16 // load 8x16-bit values for src[j + 7][i + {0..7}] + + smlal v3.4S, v24.4H, v6.H[0] // val0 += src[0][i + {0..3}] * filter[0] + smlal2 v4.4S, v24.8H, v6.H[0] // val1 += src[0][i + {4..7}] * filter[0] + smlal v3.4S, v25.4H, v6.H[1] // val0 += src[1][i + {0..3}] * filter[1] + smlal2 v4.4S, v25.8H, v6.H[1] // val1 += src[1][i + {4..7}] * filter[1] + smlal v3.4S, v26.4H, v6.H[2] // val0 += src[2][i + {0..3}] * filter[2] + smlal2 v4.4S, v26.8H, v6.H[2] // val1 += src[2][i + {4..7}] * filter[2] + smlal v3.4S, v27.4H, v6.H[3] // val0 += src[3][i + {0..3}] * filter[3] + smlal2 v4.4S, v27.8H, v6.H[3] // val1 += src[3][i + {4..7}] * filter[3] + smlal v3.4S, v28.4H, v6.H[4] // val0 += src[4][i + {0..3}] * filter[4] + smlal2 v4.4S, v28.8H, v6.H[4] // val1 += src[4][i + {4..7}] * filter[4] + smlal v3.4S, v29.4H, v6.H[5] // val0 += src[5][i + {0..3}] * filter[5] + smlal2 v4.4S, v29.8H, v6.H[5] // val1 += src[5][i + {4..7}] * filter[5] + smlal v3.4S, v30.4H, v6.H[6] // val0 += src[6][i + {0..3}] * filter[6] + smlal2 v4.4S, v30.8H, v6.H[6] // val1 += src[6][i + {4..7}] * filter[6] + smlal v3.4S, v31.4H, v6.H[7] // val0 += src[7][i + {0..3}] * filter[7] + smlal2 v4.4S, v31.8H, v6.H[7] // val1 += src[7][i + {4..7}] * filter[7] + + sqshrun v3.4h, v3.4s, #16 // clip16(val0>>16) + sqshrun2 v3.8h, v4.4s, #16 // clip16(val1>>16) + uqshrn v3.8b, v3.8h, #3 // clip8(val>>19) + subs w4, w4, #8 // dstW -= 8 + st1 {v3.8b}, [x3], #8 // write to destination + b.gt 7b // loop until width consumed + ret + +8: // fs=4 + ldp x5, x6, [x2] // load 2 pointers: src[j ] and src[j+1] + ldp x7, x9, [x2, #16] // load 2 pointers: src[j+2] and src[j+3] + + // load 4x16-bit values for filter[j], where j=0..3 and replicated across lanes + ld1 {v6.4H}, [x0] +9: + mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value + mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value + + ld1 {v24.8H}, [x5], #16 // load 8x16-bit values for src[j + 0][i + {0..7}] + ld1 {v25.8H}, [x6], #16 // load 8x16-bit values for src[j + 1][i + {0..7}] + ld1 {v26.8H}, [x7], #16 // load 8x16-bit values for src[j + 2][i + {0..7}] + ld1 {v27.8H}, [x9], #16 // load 8x16-bit values for src[j + 3][i + {0..7}] + + smlal v3.4S, v24.4H, v6.H[0] // val0 += src[0][i + {0..3}] * filter[0] + smlal2 v4.4S, v24.8H, v6.H[0] // val1 += src[0][i + {4..7}] * filter[0] + smlal v3.4S, v25.4H, v6.H[1] // val0 += src[1][i + {0..3}] * filter[1] + smlal2 v4.4S, v25.8H, v6.H[1] // val1 += src[1][i + {4..7}] * filter[1] + smlal v3.4S, v26.4H, v6.H[2] // val0 += src[2][i + {0..3}] * filter[2] + smlal2 v4.4S, v26.8H, v6.H[2] // val1 += src[2][i + {4..7}] * filter[2] + smlal v3.4S, v27.4H, v6.H[3] // val0 += src[3][i + {0..3}] * filter[3] + smlal2 v4.4S, v27.8H, v6.H[3] // val1 += src[3][i + {4..7}] * filter[3] + + sqshrun v3.4h, v3.4s, #16 // clip16(val0>>16) + sqshrun2 v3.8h, v4.4s, #16 // clip16(val1>>16) + uqshrn v3.8b, v3.8h, #3 // clip8(val>>19) + st1 {v3.8b}, [x3], #8 // write to destination + subs w4, w4, #8 // dstW -= 8 + b.gt 9b // loop until width consumed + ret + +10: // fs=2 + ldp x5, x6, [x2] // load 2 pointers: src[j ] and src[j+1] + + // load 2x16-bit values for filter[j], where j=0..1 and replicated across lanes + ldr s6, [x0] +11: + mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value + mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value + + ld1 {v24.8H}, [x5], #16 // load 8x16-bit values for src[j + 0][i + {0..7}] + ld1 {v25.8H}, [x6], #16 // load 8x16-bit values for src[j + 1][i + {0..7}] + + smlal v3.4S, v24.4H, v6.H[0] // val0 += src[0][i + {0..3}] * filter[0] + smlal2 v4.4S, v24.8H, v6.H[0] // val1 += src[0][i + {4..7}] * filter[0] + smlal v3.4S, v25.4H, v6.H[1] // val0 += src[1][i + {0..3}] * filter[1] + smlal2 v4.4S, v25.8H, v6.H[1] // val1 += src[1][i + {4..7}] * filter[1] + + sqshrun v3.4h, v3.4s, #16 // clip16(val0>>16) + sqshrun2 v3.8h, v4.4s, #16 // clip16(val1>>16) + uqshrn v3.8b, v3.8h, #3 // clip8(val>>19) + st1 {v3.8b}, [x3], #8 // write to destination + subs w4, w4, #8 // dstW -= 8 + b.gt 11b // loop until width consumed + ret +endfunc + +function ff_yuv2plane1_8_neon, export=1 +// x0 - const int16_t *src, +// x1 - uint8_t *dest, +// w2 - int dstW, +// x3 - const uint8_t *dither, +// w4 - int offset + ld1 {v0.8B}, [x3] // load 8x8-bit dither + and w4, w4, #7 + cbz w4, 1f // check if offsetting present + ext v0.8B, v0.8B, v0.8B, #3 // honor offsetting which can be 0 or 3 only +1: uxtl v0.8H, v0.8B // extend dither to 32-bit + uxtl v1.4s, v0.4h + uxtl2 v2.4s, v0.8h +2: + ld1 {v3.8h}, [x0], #16 // read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H + sxtl v4.4s, v3.4h + sxtl2 v5.4s, v3.8h + add v4.4s, v4.4s, v1.4s + add v5.4s, v5.4s, v2.4s + sqshrun v4.4h, v4.4s, #6 + sqshrun2 v4.8h, v5.4s, #6 + + uqshrn v3.8b, v4.8h, #1 // clip8(val>>7) + subs w2, w2, #8 // dstW -= 8 + st1 {v3.8b}, [x1], #8 // write to destination + b.gt 2b // loop until width consumed + ret endfunc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/swscale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/swscale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/swscale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/aarch64/swscale.c 2023-03-03 13:29:59.000000000 +0000 @@ -22,6 +22,126 @@ #include "libswscale/swscale_internal.h" #include "libavutil/aarch64/cpu.h" +void ff_hscale16to15_4_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); +void ff_hscale16to15_X8_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); +void ff_hscale16to15_X4_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); +void ff_hscale16to19_4_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); +void ff_hscale16to19_X8_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); +void ff_hscale16to19_X4_neon_asm(int shift, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + +static void ff_hscale16to15_4_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int sh = desc->comp[0].depth - 1; + + if (sh<15) { + sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1); + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1; + } + ff_hscale16to15_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); + +} + +static void ff_hscale16to15_X8_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int sh = desc->comp[0].depth - 1; + + if (sh<15) { + sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1); + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1; + } + ff_hscale16to15_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); + +} + +static void ff_hscale16to15_X4_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int sh = desc->comp[0].depth - 1; + + if (sh<15) { + sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1); + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1; + } + ff_hscale16to15_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); +} + +static void ff_hscale16to19_4_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int bits = desc->comp[0].depth - 1; + int sh = bits - 4; + + if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) { + sh = 9; + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1 - 4; + } + + ff_hscale16to19_4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); + +} + +static void ff_hscale16to19_X8_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int bits = desc->comp[0].depth - 1; + int sh = bits - 4; + + if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) { + sh = 9; + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1 - 4; + } + + ff_hscale16to19_X8_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); + +} + +static void ff_hscale16to19_X4_neon(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int bits = desc->comp[0].depth - 1; + int sh = bits - 4; + + if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) { + sh = 9; + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */ + sh = 16 - 1 - 4; + } + + ff_hscale16to19_X4_neon_asm(sh, _dst, dstW, _src, filter, filterPos, filterSize); + +} + #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \ void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \ SwsContext *c, int16_t *data, \ @@ -29,31 +149,57 @@ const int16_t *filter, \ const int32_t *filterPos, int filterSize) #define SCALE_FUNCS(filter_n, opt) \ - SCALE_FUNC(filter_n, 8, 15, opt); + SCALE_FUNC(filter_n, 8, 15, opt); \ + SCALE_FUNC(filter_n, 8, 19, opt); #define ALL_SCALE_FUNCS(opt) \ SCALE_FUNCS(4, opt); \ - SCALE_FUNCS(X8, opt) + SCALE_FUNCS(X8, opt); \ + SCALE_FUNCS(X4, opt) ALL_SCALE_FUNCS(neon); void ff_yuv2planeX_8_neon(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset); +void ff_yuv2plane1_8_neon( + const int16_t *src, + uint8_t *dest, + int dstW, + const uint8_t *dither, + int offset); #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt) do { \ - if (c->srcBpc == 8 && c->dstBpc <= 14) { \ - hscalefn = \ - ff_hscale8to15_ ## filtersize ## _ ## opt; \ + if (c->srcBpc == 8) { \ + if(c->dstBpc <= 14) { \ + hscalefn = \ + ff_hscale8to15_ ## filtersize ## _ ## opt; \ + } else \ + hscalefn = \ + ff_hscale8to19_ ## filtersize ## _ ## opt; \ + } else { \ + if (c->dstBpc <= 14) \ + hscalefn = \ + ff_hscale16to15_ ## filtersize ## _ ## opt; \ + else \ + hscalefn = \ + ff_hscale16to19_ ## filtersize ## _ ## opt; \ } \ } while (0) -#define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt) \ - switch (filtersize) { \ - case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt); break; \ - default: if (filtersize % 8 == 0) \ - ASSIGN_SCALE_FUNC2(hscalefn, X8, opt); \ - break; \ - } +#define ASSIGN_SCALE_FUNC(hscalefn, filtersize, opt) do { \ + if (filtersize == 4) \ + ASSIGN_SCALE_FUNC2(hscalefn, 4, opt); \ + else if (filtersize % 8 == 0) \ + ASSIGN_SCALE_FUNC2(hscalefn, X8, opt); \ + else if (filtersize % 4 == 0 && filtersize % 8 != 0) \ + ASSIGN_SCALE_FUNC2(hscalefn, X4, opt); \ +} while (0) + +#define ASSIGN_VSCALE_FUNC(vscalefn, opt) \ + switch (c->dstBpc) { \ + case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \ + default: break; \ + } av_cold void ff_sws_init_swscale_aarch64(SwsContext *c) { @@ -62,6 +208,7 @@ if (have_neon(cpu_flags)) { ASSIGN_SCALE_FUNC(c->hyScale, c->hLumFilterSize, neon); ASSIGN_SCALE_FUNC(c->hcScale, c->hChrFilterSize, neon); + ASSIGN_VSCALE_FUNC(c->yuv2plane1, neon); if (c->dstBpc == 8) { c->yuv2planeX = ff_yuv2planeX_8_neon; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/half2float.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/half2float.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/half2float.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/half2float.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * 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/half2float.c" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/hscale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/hscale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/hscale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/hscale.c 2023-03-03 13:29:59.000000000 +0000 @@ -105,18 +105,18 @@ uint8_t * dst = desc->dst->plane[0].line[i]; if (c->lumToYV12) { - c->lumToYV12(dst, src[0], src[1], src[2], srcW, pal); + c->lumToYV12(dst, src[0], src[1], src[2], srcW, pal, c->input_opaque); } else if (c->readLumPlanar) { - c->readLumPlanar(dst, src, srcW, c->input_rgb2yuv_table); + c->readLumPlanar(dst, src, srcW, c->input_rgb2yuv_table, c->input_opaque); } if (desc->alpha) { dst = desc->dst->plane[3].line[i]; if (c->alpToYV12) { - c->alpToYV12(dst, src[3], src[1], src[2], srcW, pal); + c->alpToYV12(dst, src[3], src[1], src[2], srcW, pal, c->input_opaque); } else if (c->readAlpPlanar) { - c->readAlpPlanar(dst, src, srcW, NULL); + c->readAlpPlanar(dst, src, srcW, NULL, c->input_opaque); } } } @@ -224,9 +224,9 @@ uint8_t * dst1 = desc->dst->plane[1].line[i]; uint8_t * dst2 = desc->dst->plane[2].line[i]; if (c->chrToYV12) { - c->chrToYV12(dst1, dst2, src[0], src[1], src[2], srcW, pal); + c->chrToYV12(dst1, dst2, src[0], src[1], src[2], srcW, pal, c->input_opaque); } else if (c->readChrPlanar) { - c->readChrPlanar(dst1, dst2, src, srcW, c->input_rgb2yuv_table); + c->readChrPlanar(dst1, dst2, src, srcW, c->input_rgb2yuv_table, c->input_opaque); } } return sliceH; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/input.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/input.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/input.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/input.c 2023-03-03 13:29:59.000000000 +0000 @@ -28,14 +28,21 @@ #include "config.h" #include "swscale_internal.h" -#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) +#define input_pixel(pos) (is_be ? AV_RB16(pos) : AV_RL16(pos)) + +#define IS_BE_LE 0 +#define IS_BE_BE 1 +#define IS_BE_ 0 +/* ENDIAN_IDENTIFIER needs to be "BE", "LE" or "". The latter is intended + * for single-byte cases where the concept of endianness does not apply. */ +#define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER #define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b) #define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r) static av_always_inline void rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width, - enum AVPixelFormat origin, int32_t *rgb2yuv) + enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be) { int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; int i; @@ -51,16 +58,16 @@ static av_always_inline void rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, - int width, enum AVPixelFormat origin, int32_t *rgb2yuv) + int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be) { int i; int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; av_assert1(src1==src2); for (i = 0; i < width; i++) { - int r_b = input_pixel(&src1[i*4+0]); - int g = input_pixel(&src1[i*4+1]); - int b_r = input_pixel(&src1[i*4+2]); + unsigned int r_b = input_pixel(&src1[i*4+0]); + unsigned int g = input_pixel(&src1[i*4+1]); + unsigned int b_r = input_pixel(&src1[i*4+2]); dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; @@ -70,60 +77,62 @@ static av_always_inline void rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, - int width, enum AVPixelFormat origin, int32_t *rgb2yuv) + int width, enum AVPixelFormat origin, int32_t *rgb2yuv, int is_be) { int i; int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; av_assert1(src1==src2); for (i = 0; i < width; i++) { - int r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1; - int g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1; - int b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1; + unsigned r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1; + unsigned g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1; + unsigned b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1; dstU[i]= (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; dstV[i]= (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; } } -#define rgb64funcs(pattern, BE_LE, origin) \ +#define RGB64FUNCS_EXT(pattern, BE_LE, origin, is_be) \ static void pattern ## 64 ## BE_LE ## ToY_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused0, const uint8_t *unused1,\ - int width, uint32_t *rgb2yuv) \ + int width, uint32_t *rgb2yuv, void *opq) \ { \ const uint16_t *src = (const uint16_t *) _src; \ uint16_t *dst = (uint16_t *) _dst; \ - rgb64ToY_c_template(dst, src, width, origin, rgb2yuv); \ + rgb64ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \ } \ \ static void pattern ## 64 ## BE_LE ## ToUV_c(uint8_t *_dstU, uint8_t *_dstV, \ const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \ - int width, uint32_t *rgb2yuv) \ + int width, uint32_t *rgb2yuv, void *opq) \ { \ const uint16_t *src1 = (const uint16_t *) _src1, \ *src2 = (const uint16_t *) _src2; \ uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \ - rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ + rgb64ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \ } \ \ static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, \ const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, \ - int width, uint32_t *rgb2yuv) \ + int width, uint32_t *rgb2yuv, void *opq) \ { \ const uint16_t *src1 = (const uint16_t *) _src1, \ *src2 = (const uint16_t *) _src2; \ uint16_t *dstU = (uint16_t *) _dstU, *dstV = (uint16_t *) _dstV; \ - rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ + rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \ } +#define RGB64FUNCS(pattern, endianness, base_fmt) \ + RGB64FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness)) -rgb64funcs(rgb, LE, AV_PIX_FMT_RGBA64LE) -rgb64funcs(rgb, BE, AV_PIX_FMT_RGBA64BE) -rgb64funcs(bgr, LE, AV_PIX_FMT_BGRA64LE) -rgb64funcs(bgr, BE, AV_PIX_FMT_BGRA64BE) +RGB64FUNCS(rgb, LE, AV_PIX_FMT_RGBA64) +RGB64FUNCS(rgb, BE, AV_PIX_FMT_RGBA64) +RGB64FUNCS(bgr, LE, AV_PIX_FMT_BGRA64) +RGB64FUNCS(bgr, BE, AV_PIX_FMT_BGRA64) static av_always_inline void rgb48ToY_c_template(uint16_t *dst, const uint16_t *src, int width, enum AVPixelFormat origin, - int32_t *rgb2yuv) + int32_t *rgb2yuv, int is_be) { int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; int i; @@ -142,16 +151,16 @@ const uint16_t *src2, int width, enum AVPixelFormat origin, - int32_t *rgb2yuv) + int32_t *rgb2yuv, int is_be) { int i; int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; av_assert1(src1 == src2); for (i = 0; i < width; i++) { - int r_b = input_pixel(&src1[i * 3 + 0]); - int g = input_pixel(&src1[i * 3 + 1]); - int b_r = input_pixel(&src1[i * 3 + 2]); + unsigned r_b = input_pixel(&src1[i * 3 + 0]); + unsigned g = input_pixel(&src1[i * 3 + 1]); + unsigned b_r = input_pixel(&src1[i * 3 + 2]); dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT; dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT; @@ -164,19 +173,19 @@ const uint16_t *src2, int width, enum AVPixelFormat origin, - int32_t *rgb2yuv) + int32_t *rgb2yuv, int is_be) { int i; int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; av_assert1(src1 == src2); for (i = 0; i < width; i++) { - int r_b = (input_pixel(&src1[6 * i + 0]) + - input_pixel(&src1[6 * i + 3]) + 1) >> 1; - int g = (input_pixel(&src1[6 * i + 1]) + - input_pixel(&src1[6 * i + 4]) + 1) >> 1; - int b_r = (input_pixel(&src1[6 * i + 2]) + - input_pixel(&src1[6 * i + 5]) + 1) >> 1; + unsigned r_b = (input_pixel(&src1[6 * i + 0]) + + input_pixel(&src1[6 * i + 3]) + 1) >> 1; + unsigned g = (input_pixel(&src1[6 * i + 1]) + + input_pixel(&src1[6 * i + 4]) + 1) >> 1; + unsigned b_r = (input_pixel(&src1[6 * i + 2]) + + input_pixel(&src1[6 * i + 5]) + 1) >> 1; dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT; dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT; @@ -187,16 +196,17 @@ #undef b #undef input_pixel -#define rgb48funcs(pattern, BE_LE, origin) \ +#define RGB48FUNCS_EXT(pattern, BE_LE, origin, is_be) \ static void pattern ## 48 ## BE_LE ## ToY_c(uint8_t *_dst, \ const uint8_t *_src, \ const uint8_t *unused0, const uint8_t *unused1,\ int width, \ - uint32_t *rgb2yuv) \ + uint32_t *rgb2yuv, \ + void *opq) \ { \ const uint16_t *src = (const uint16_t *)_src; \ uint16_t *dst = (uint16_t *)_dst; \ - rgb48ToY_c_template(dst, src, width, origin, rgb2yuv); \ + rgb48ToY_c_template(dst, src, width, origin, rgb2yuv, is_be); \ } \ \ static void pattern ## 48 ## BE_LE ## ToUV_c(uint8_t *_dstU, \ @@ -205,13 +215,14 @@ const uint8_t *_src1, \ const uint8_t *_src2, \ int width, \ - uint32_t *rgb2yuv) \ + uint32_t *rgb2yuv, \ + void *opq) \ { \ const uint16_t *src1 = (const uint16_t *)_src1, \ *src2 = (const uint16_t *)_src2; \ uint16_t *dstU = (uint16_t *)_dstU, \ *dstV = (uint16_t *)_dstV; \ - rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ + rgb48ToUV_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \ } \ \ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \ @@ -220,19 +231,22 @@ const uint8_t *_src1, \ const uint8_t *_src2, \ int width, \ - uint32_t *rgb2yuv) \ + uint32_t *rgb2yuv, \ + void *opq) \ { \ const uint16_t *src1 = (const uint16_t *)_src1, \ *src2 = (const uint16_t *)_src2; \ uint16_t *dstU = (uint16_t *)_dstU, \ *dstV = (uint16_t *)_dstV; \ - rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv); \ + rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin, rgb2yuv, is_be); \ } +#define RGB48FUNCS(pattern, endianness, base_fmt) \ + RGB48FUNCS_EXT(pattern, endianness, base_fmt ## endianness, IS_BE(endianness)) -rgb48funcs(rgb, LE, AV_PIX_FMT_RGB48LE) -rgb48funcs(rgb, BE, AV_PIX_FMT_RGB48BE) -rgb48funcs(bgr, LE, AV_PIX_FMT_BGR48LE) -rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE) +RGB48FUNCS(rgb, LE, AV_PIX_FMT_RGB48) +RGB48FUNCS(rgb, BE, AV_PIX_FMT_RGB48) +RGB48FUNCS(bgr, LE, AV_PIX_FMT_BGR48) +RGB48FUNCS(bgr, BE, AV_PIX_FMT_BGR48) #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \ origin == AV_PIX_FMT_BGRA || \ @@ -242,7 +256,7 @@ : ((origin == AV_PIX_FMT_X2RGB10LE || \ origin == AV_PIX_FMT_X2BGR10LE) \ ? AV_RL32(&src[(i) * 4]) \ - : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \ + : (is_be ? AV_RB16(&src[(i) * 2]) \ : AV_RL16(&src[(i) * 2])))) static av_always_inline void rgb16_32ToY_c_template(int16_t *dst, @@ -254,7 +268,7 @@ int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, - int32_t *rgb2yuv) + int32_t *rgb2yuv, int is_be) { const int ry = rgb2yuv[RY_IDX]<> 6); - AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> 6); +#define y21xle_wrapper(bits, shift) \ + static void y2 ## bits ## le_UV_c(uint8_t *dstU, uint8_t *dstV, \ + const uint8_t *unused0, \ + const uint8_t *src, \ + const uint8_t *unused1, int width, \ + uint32_t *unused2, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) { \ + AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 2) >> shift); \ + AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 6) >> shift); \ + } \ + } \ + \ + static void y2 ## bits ## le_Y_c(uint8_t *dst, const uint8_t *src, \ + const uint8_t *unused0, \ + const uint8_t *unused1, int width, \ + uint32_t *unused2, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) \ + AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> shift); \ } -} -static void y210le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, - const uint8_t *unused1, int width, uint32_t *unused2) -{ - int i; - for (i = 0; i < width; i++) - AV_WN16(dst + i * 2, AV_RL16(src + i * 4) >> 6); -} +y21xle_wrapper(10, 6) +y21xle_wrapper(12, 4) static void bswap16Y_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) + uint32_t *unused, void *opq) { int i; const uint16_t *src = (const uint16_t *)_src; @@ -579,7 +613,7 @@ } static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *_src1, - const uint8_t *_src2, int width, uint32_t *unused) + const uint8_t *_src2, int width, uint32_t *unused, void *opq) { int i; const uint16_t *src1 = (const uint16_t *)_src1, @@ -592,7 +626,7 @@ } static void read_ya16le_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) + uint32_t *unused, void *opq) { int i; for (i = 0; i < width; i++) @@ -600,7 +634,7 @@ } static void read_ya16le_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) + uint32_t *unused, void *opq) { int i; for (i = 0; i < width; i++) @@ -608,7 +642,7 @@ } static void read_ya16be_gray_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) + uint32_t *unused, void *opq) { int i; for (i = 0; i < width; i++) @@ -616,7 +650,7 @@ } static void read_ya16be_alpha_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) + uint32_t *unused, void *opq) { int i; for (i = 0; i < width; i++) @@ -624,7 +658,7 @@ } static void read_ayuv64le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, - uint32_t *unused2) + uint32_t *unused2, void *opq) { int i; for (i = 0; i < width; i++) @@ -633,7 +667,7 @@ static void read_ayuv64le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, - const uint8_t *unused1, int width, uint32_t *unused2) + const uint8_t *unused1, int width, uint32_t *unused2, void *opq) { int i; for (i = 0; i < width; i++) { @@ -643,124 +677,179 @@ } static void read_ayuv64le_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, - uint32_t *unused2) + uint32_t *unused2, void *opq) { int i; for (i = 0; i < width; i++) AV_WN16(dst + i * 2, AV_RL16(src + i * 8)); } -/* This is almost identical to the previous, end exists only because - * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */ -static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *unused) +static void read_vuyx_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2, void *opq) +{ + int i; + for (i = 0; i < width; i++) { + dstU[i] = src[i * 4 + 1]; + dstV[i] = src[i * 4]; + } +} + +static void read_vuyx_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2, void *opq) { int i; for (i = 0; i < width; i++) - dst[i] = src[2 * i + 1]; + dst[i] = src[i * 4 + 2]; } -static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, - const uint8_t *src2, int width, uint32_t *unused) +static void read_vuya_A_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2, void *opq) { int i; - for (i = 0; i < width; i++) { - dstU[i] = src1[4 * i + 0]; - dstV[i] = src1[4 * i + 2]; - } - av_assert1(src1 == src2); + for (i = 0; i < width; i++) + dst[i] = src[i * 4 + 3]; } -static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2, - const uint8_t *src, int width) +static void read_xv30le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2, void *opq) { int i; - for (i = 0; i < width; i++) { - dst1[i] = src[2 * i + 0]; - dst2[i] = src[2 * i + 1]; - } + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2, (AV_RL32(src + i * 4) >> 10) & 0x3FFu); } -static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV, - const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) + +static void read_xv30le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2, void *opq) { - nvXXtoUV_c(dstU, dstV, src1, width); + int i; + for (i = 0; i < width; i++) { + AV_WN16(dstU + i * 2, AV_RL32(src + i * 4) & 0x3FFu); + AV_WN16(dstV + i * 2, (AV_RL32(src + i * 4) >> 20) & 0x3FFu); + } } -static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV, - const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) +static void read_xv36le_Y_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused0, const uint8_t *unused1, int width, + uint32_t *unused2, void *opq) { - nvXXtoUV_c(dstV, dstU, src1, width); + int i; + for (i = 0; i < width; i++) + AV_WN16(dst + i * 2, AV_RL16(src + i * 8 + 2) >> 4); } -static void p010LEToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, - const uint8_t *unused2, int width, uint32_t *unused) + +static void read_xv36le_UV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src, + const uint8_t *unused1, int width, uint32_t *unused2, void *opq) { int i; for (i = 0; i < width; i++) { - AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> 6); + AV_WN16(dstU + i * 2, AV_RL16(src + i * 8 + 0) >> 4); + AV_WN16(dstV + i * 2, AV_RL16(src + i * 8 + 4) >> 4); } } -static void p010BEToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, - const uint8_t *unused2, int width, uint32_t *unused) +/* This is almost identical to the previous, end exists only because + * yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */ +static void uyvyToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, + uint32_t *unused, void *opq) { int i; - for (i = 0; i < width; i++) { - AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> 6); - } + for (i = 0; i < width; i++) + dst[i] = src[2 * i + 1]; } -static void p010LEToUV_c(uint8_t *dstU, uint8_t *dstV, - const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) +static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, + const uint8_t *src2, int width, uint32_t *unused, void *opq) { int i; for (i = 0; i < width; i++) { - AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> 6); - AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> 6); + dstU[i] = src1[4 * i + 0]; + dstV[i] = src1[4 * i + 2]; } + av_assert1(src1 == src2); } -static void p010BEToUV_c(uint8_t *dstU, uint8_t *dstV, - const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) +static av_always_inline void nvXXtoUV_c(uint8_t *dst1, uint8_t *dst2, + const uint8_t *src, int width) { int i; for (i = 0; i < width; i++) { - AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> 6); - AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> 6); + dst1[i] = src[2 * i + 0]; + dst2[i] = src[2 * i + 1]; } } -static void p016LEToUV_c(uint8_t *dstU, uint8_t *dstV, +static void nv12ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) + int width, uint32_t *unused, void *opq) { - int i; - for (i = 0; i < width; i++) { - AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0)); - AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2)); - } + nvXXtoUV_c(dstU, dstV, src1, width); } -static void p016BEToUV_c(uint8_t *dstU, uint8_t *dstV, +static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) + int width, uint32_t *unused, void *opq) { - int i; - for (i = 0; i < width; i++) { - AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0)); - AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2)); - } + nvXXtoUV_c(dstV, dstU, src1, width); } -#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) +#define p01x_uv_wrapper(bits, shift) \ + static void p0 ## bits ## LEToUV_c(uint8_t *dstU, uint8_t *dstV, \ + const uint8_t *unused0, \ + const uint8_t *src1, \ + const uint8_t *src2, int width, \ + uint32_t *unused, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) { \ + AV_WN16(dstU + i * 2, AV_RL16(src1 + i * 4 + 0) >> shift); \ + AV_WN16(dstV + i * 2, AV_RL16(src1 + i * 4 + 2) >> shift); \ + } \ + } \ + \ + static void p0 ## bits ## BEToUV_c(uint8_t *dstU, uint8_t *dstV, \ + const uint8_t *unused0, \ + const uint8_t *src1, \ + const uint8_t *src2, int width, \ + uint32_t *unused, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) { \ + AV_WN16(dstU + i * 2, AV_RB16(src1 + i * 4 + 0) >> shift); \ + AV_WN16(dstV + i * 2, AV_RB16(src1 + i * 4 + 2) >> shift); \ + } \ + } + +#define p01x_wrapper(bits, shift) \ + static void p0 ## bits ## LEToY_c(uint8_t *dst, const uint8_t *src, \ + const uint8_t *unused1, \ + const uint8_t *unused2, int width, \ + uint32_t *unused, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) { \ + AV_WN16(dst + i * 2, AV_RL16(src + i * 2) >> shift); \ + } \ + } \ + \ + static void p0 ## bits ## BEToY_c(uint8_t *dst, const uint8_t *src, \ + const uint8_t *unused1, \ + const uint8_t *unused2, int width, \ + uint32_t *unused, void *opq) \ + { \ + int i; \ + for (i = 0; i < width; i++) { \ + AV_WN16(dst + i * 2, AV_RB16(src + i * 2) >> shift); \ + } \ + } \ + p01x_uv_wrapper(bits, shift) + +p01x_wrapper(10, 6) +p01x_wrapper(12, 4) +p01x_uv_wrapper(16, 0) static void bgr24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, - int width, uint32_t *rgb2yuv) + int width, uint32_t *rgb2yuv, void *opq) { int16_t *dst = (int16_t *)_dst; int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; @@ -775,7 +864,7 @@ } static void bgr24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, - const uint8_t *src2, int width, uint32_t *rgb2yuv) + const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq) { int16_t *dstU = (int16_t *)_dstU; int16_t *dstV = (int16_t *)_dstV; @@ -794,7 +883,7 @@ } static void bgr24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, - const uint8_t *src2, int width, uint32_t *rgb2yuv) + const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq) { int16_t *dstU = (int16_t *)_dstU; int16_t *dstV = (int16_t *)_dstV; @@ -813,7 +902,7 @@ } static void rgb24ToY_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, - uint32_t *rgb2yuv) + uint32_t *rgb2yuv, void *opq) { int16_t *dst = (int16_t *)_dst; int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; @@ -828,7 +917,7 @@ } static void rgb24ToUV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, - const uint8_t *src2, int width, uint32_t *rgb2yuv) + const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq) { int16_t *dstU = (int16_t *)_dstU; int16_t *dstV = (int16_t *)_dstV; @@ -847,7 +936,7 @@ } static void rgb24ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, - const uint8_t *src2, int width, uint32_t *rgb2yuv) + const uint8_t *src2, int width, uint32_t *rgb2yuv, void *opq) { int16_t *dstU = (int16_t *)_dstU; int16_t *dstV = (int16_t *)_dstV; @@ -865,7 +954,7 @@ } } -static void planar_rgb_to_y(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv) +static void planar_rgb_to_y(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq) { uint16_t *dst = (uint16_t *)_dst; int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; @@ -879,7 +968,7 @@ } } -static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused) +static void planar_rgb_to_a(uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused, void *opq) { uint16_t *dst = (uint16_t *)_dst; int i; @@ -887,7 +976,7 @@ dst[i] = src[3][i] << 6; } -static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv) +static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv, void *opq) { uint16_t *dstU = (uint16_t *)_dstU; uint16_t *dstV = (uint16_t *)_dstV; @@ -1023,24 +1112,27 @@ #define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \ static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \ - int w, int32_t *rgb2yuv) \ + int w, int32_t *rgb2yuv, void *opq) \ { \ planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \ } \ static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \ - const uint8_t *src[4], int w, int32_t *rgb2yuv) \ + const uint8_t *src[4], int w, int32_t *rgb2yuv, \ + void *opq) \ { \ planar_rgb16_to_uv(dstU, dstV, src, w, nbits, endian, rgb2yuv); \ } \ #define rgb9plus_planar_transparency_funcs(nbits) \ static void planar_rgb##nbits##le_to_a(uint8_t *dst, const uint8_t *src[4], \ - int w, int32_t *rgb2yuv) \ + int w, int32_t *rgb2yuv, \ + void *opq) \ { \ planar_rgb16_to_a(dst, src, w, nbits, 0, rgb2yuv); \ } \ static void planar_rgb##nbits##be_to_a(uint8_t *dst, const uint8_t *src[4], \ - int w, int32_t *rgb2yuv) \ + int w, int32_t *rgb2yuv, \ + void *opq) \ { \ planar_rgb16_to_a(dst, src, w, nbits, 1, rgb2yuv); \ } @@ -1061,23 +1153,24 @@ #define rgbf32_planar_funcs_endian(endian_name, endian) \ static void planar_rgbf32##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \ - int w, int32_t *rgb2yuv) \ + int w, int32_t *rgb2yuv, void *opq) \ { \ planar_rgbf32_to_y(dst, src, w, endian, rgb2yuv); \ } \ static void planar_rgbf32##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \ - const uint8_t *src[4], int w, int32_t *rgb2yuv) \ + const uint8_t *src[4], int w, int32_t *rgb2yuv, \ + void *opq) \ { \ planar_rgbf32_to_uv(dstU, dstV, src, w, endian, rgb2yuv); \ } \ static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \ - int w, int32_t *rgb2yuv) \ + int w, int32_t *rgb2yuv, void *opq) \ { \ planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \ } \ static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \ const uint8_t *unused1, const uint8_t *unused2, \ - int width, uint32_t *unused) \ + int width, uint32_t *unused, void *opq) \ { \ grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \ } @@ -1085,6 +1178,112 @@ rgbf32_planar_funcs_endian(le, 0) rgbf32_planar_funcs_endian(be, 1) +#define rdpx(src) av_int2float(half2float(is_be ? AV_RB16(&src) : AV_RL16(&src), h2f_tbl)) + +static av_always_inline void rgbaf16ToUV_half_endian(uint16_t *dstU, uint16_t *dstV, int is_be, + const uint16_t *src, int width, + int32_t *rgb2yuv, Half2FloatTables *h2f_tbl) +{ + int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; + int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; + int i; + for (i = 0; i < width; i++) { + int r = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+0]), 0.0f, 65535.0f)) + + lrintf(av_clipf(65535.0f * rdpx(src[i*8+4]), 0.0f, 65535.0f))) >> 1; + int g = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+1]), 0.0f, 65535.0f)) + + lrintf(av_clipf(65535.0f * rdpx(src[i*8+5]), 0.0f, 65535.0f))) >> 1; + int b = (lrintf(av_clipf(65535.0f * rdpx(src[i*8+2]), 0.0f, 65535.0f)) + + lrintf(av_clipf(65535.0f * rdpx(src[i*8+6]), 0.0f, 65535.0f))) >> 1; + + dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + } +} + +static av_always_inline void rgbaf16ToUV_endian(uint16_t *dstU, uint16_t *dstV, int is_be, + const uint16_t *src, int width, + int32_t *rgb2yuv, Half2FloatTables *h2f_tbl) +{ + int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX]; + int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX]; + int i; + for (i = 0; i < width; i++) { + int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f)); + int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f)); + int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f)); + + dstU[i] = (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + dstV[i] = (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + } +} + +static av_always_inline void rgbaf16ToY_endian(uint16_t *dst, const uint16_t *src, int is_be, + int width, int32_t *rgb2yuv, Half2FloatTables *h2f_tbl) +{ + int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX]; + int i; + for (i = 0; i < width; i++) { + int r = lrintf(av_clipf(65535.0f * rdpx(src[i*4+0]), 0.0f, 65535.0f)); + int g = lrintf(av_clipf(65535.0f * rdpx(src[i*4+1]), 0.0f, 65535.0f)); + int b = lrintf(av_clipf(65535.0f * rdpx(src[i*4+2]), 0.0f, 65535.0f)); + + dst[i] = (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + } +} + +static av_always_inline void rgbaf16ToA_endian(uint16_t *dst, const uint16_t *src, int is_be, + int width, Half2FloatTables *h2f_tbl) +{ + int i; + for (i=0; isrcFormat; @@ -1101,6 +1300,7 @@ c->chrToYV12 = uyvyToUV_c; break; case AV_PIX_FMT_NV12: + case AV_PIX_FMT_NV16: case AV_PIX_FMT_NV24: c->chrToYV12 = nv12ToUV_c; break; @@ -1228,9 +1428,19 @@ c->chrToYV12 = bswap16UV_c; break; #endif + case AV_PIX_FMT_VUYA: + case AV_PIX_FMT_VUYX: + c->chrToYV12 = read_vuyx_UV_c; + break; + case AV_PIX_FMT_XV30LE: + c->chrToYV12 = read_xv30le_UV_c; + break; case AV_PIX_FMT_AYUV64LE: c->chrToYV12 = read_ayuv64le_UV_c; break; + case AV_PIX_FMT_XV36LE: + c->chrToYV12 = read_xv36le_UV_c; + break; case AV_PIX_FMT_P010LE: case AV_PIX_FMT_P210LE: case AV_PIX_FMT_P410LE: @@ -1241,6 +1451,12 @@ case AV_PIX_FMT_P410BE: c->chrToYV12 = p010BEToUV_c; break; + case AV_PIX_FMT_P012LE: + c->chrToYV12 = p012LEToUV_c; + break; + case AV_PIX_FMT_P012BE: + c->chrToYV12 = p012BEToUV_c; + break; case AV_PIX_FMT_P016LE: case AV_PIX_FMT_P216LE: case AV_PIX_FMT_P416LE: @@ -1254,6 +1470,9 @@ case AV_PIX_FMT_Y210LE: c->chrToYV12 = y210le_UV_c; break; + case AV_PIX_FMT_Y212LE: + c->chrToYV12 = y212le_UV_c; + break; } if (c->chrSrcHSubSample) { switch (srcFormat) { @@ -1345,6 +1564,12 @@ case AV_PIX_FMT_X2BGR10LE: c->chrToYV12 = bgr30leToUV_half_c; break; + case AV_PIX_FMT_RGBAF16BE: + c->chrToYV12 = rgbaf16beToUV_half_c; + break; + case AV_PIX_FMT_RGBAF16LE: + c->chrToYV12 = rgbaf16leToUV_half_c; + break; } } else { switch (srcFormat) { @@ -1432,6 +1657,12 @@ case AV_PIX_FMT_X2BGR10LE: c->chrToYV12 = bgr30leToUV_c; break; + case AV_PIX_FMT_RGBAF16BE: + c->chrToYV12 = rgbaf16beToUV_c; + break; + case AV_PIX_FMT_RGBAF16LE: + c->chrToYV12 = rgbaf16leToUV_c; + break; } } @@ -1590,9 +1821,19 @@ case AV_PIX_FMT_YA16BE: c->lumToYV12 = read_ya16be_gray_c; break; + case AV_PIX_FMT_VUYA: + case AV_PIX_FMT_VUYX: + c->lumToYV12 = read_vuyx_Y_c; + break; + case AV_PIX_FMT_XV30LE: + c->lumToYV12 = read_xv30le_Y_c; + break; case AV_PIX_FMT_AYUV64LE: c->lumToYV12 = read_ayuv64le_Y_c; break; + case AV_PIX_FMT_XV36LE: + c->lumToYV12 = read_xv36le_Y_c; + break; case AV_PIX_FMT_YUYV422: case AV_PIX_FMT_YVYU422: case AV_PIX_FMT_YA8: @@ -1702,6 +1943,12 @@ case AV_PIX_FMT_P410BE: c->lumToYV12 = p010BEToY_c; break; + case AV_PIX_FMT_P012LE: + c->lumToYV12 = p012LEToY_c; + break; + case AV_PIX_FMT_P012BE: + c->lumToYV12 = p012BEToY_c; + break; case AV_PIX_FMT_GRAYF32LE: c->lumToYV12 = grayf32leToY16_c; break; @@ -1711,12 +1958,21 @@ case AV_PIX_FMT_Y210LE: c->lumToYV12 = y210le_Y_c; break; + case AV_PIX_FMT_Y212LE: + c->lumToYV12 = y212le_Y_c; + break; case AV_PIX_FMT_X2RGB10LE: c->lumToYV12 = rgb30leToY_c; break; case AV_PIX_FMT_X2BGR10LE: c->lumToYV12 = bgr30leToY_c; break; + case AV_PIX_FMT_RGBAF16BE: + c->lumToYV12 = rgbaf16beToY_c; + break; + case AV_PIX_FMT_RGBAF16LE: + c->lumToYV12 = rgbaf16leToY_c; + break; } if (c->needAlpha) { if (is16BPS(srcFormat) || isNBPS(srcFormat)) { @@ -1736,6 +1992,12 @@ case AV_PIX_FMT_ARGB: c->alpToYV12 = abgrToA_c; break; + case AV_PIX_FMT_RGBAF16BE: + c->alpToYV12 = rgbaf16beToA_c; + break; + case AV_PIX_FMT_RGBAF16LE: + c->alpToYV12 = rgbaf16leToA_c; + break; case AV_PIX_FMT_YA8: c->alpToYV12 = uyvyToY_c; break; @@ -1745,6 +2007,9 @@ case AV_PIX_FMT_YA16BE: c->alpToYV12 = read_ya16be_alpha_c; break; + case AV_PIX_FMT_VUYA: + c->alpToYV12 = read_vuya_A_c; + break; case AV_PIX_FMT_AYUV64LE: c->alpToYV12 = read_ayuv64le_A_c; break; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/input_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/input_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/input_lasx.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/input_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libavutil/loongarch/loongson_intrinsics.h" + +void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], + int width, int32_t *rgb2yuv, void *opq) +{ + int i; + uint16_t *dstU = (uint16_t *)_dstU; + uint16_t *dstV = (uint16_t *)_dstV; + int set = 0x4001 << (RGB2YUV_SHIFT - 7); + int len = width - 15; + int32_t tem_ru = rgb2yuv[RU_IDX], tem_gu = rgb2yuv[GU_IDX]; + int32_t tem_bu = rgb2yuv[BU_IDX], tem_rv = rgb2yuv[RV_IDX]; + int32_t tem_gv = rgb2yuv[GV_IDX], tem_bv = rgb2yuv[BV_IDX]; + int shift = RGB2YUV_SHIFT - 6; + const uint8_t *src0 = src[0], *src1 = src[1], *src2 = src[2]; + __m256i ru, gu, bu, rv, gv, bv; + __m256i mask = {0x0D0C090805040100, 0x1D1C191815141110, + 0x0D0C090805040100, 0x1D1C191815141110}; + __m256i temp = __lasx_xvreplgr2vr_w(set); + __m256i sra = __lasx_xvreplgr2vr_w(shift); + + ru = __lasx_xvreplgr2vr_w(tem_ru); + gu = __lasx_xvreplgr2vr_w(tem_gu); + bu = __lasx_xvreplgr2vr_w(tem_bu); + rv = __lasx_xvreplgr2vr_w(tem_rv); + gv = __lasx_xvreplgr2vr_w(tem_gv); + bv = __lasx_xvreplgr2vr_w(tem_bv); + for (i = 0; i < len; i += 16) { + __m256i _g, _b, _r; + __m256i g_l, g_h, b_l, b_h, r_l, r_h; + __m256i v_l, v_h, u_l, u_h, u_lh, v_lh; + + _g = __lasx_xvldx(src0, i); + _b = __lasx_xvldx(src1, i); + _r = __lasx_xvldx(src2, i); + g_l = __lasx_vext2xv_wu_bu(_g); + b_l = __lasx_vext2xv_wu_bu(_b); + r_l = __lasx_vext2xv_wu_bu(_r); + _g = __lasx_xvpermi_d(_g, 0x01); + _b = __lasx_xvpermi_d(_b, 0x01); + _r = __lasx_xvpermi_d(_r, 0x01); + g_h = __lasx_vext2xv_wu_bu(_g); + b_h = __lasx_vext2xv_wu_bu(_b); + r_h = __lasx_vext2xv_wu_bu(_r); + u_l = __lasx_xvmadd_w(temp, ru, r_l); + u_h = __lasx_xvmadd_w(temp, ru, r_h); + v_l = __lasx_xvmadd_w(temp, rv, r_l); + v_h = __lasx_xvmadd_w(temp, rv, r_h); + u_l = __lasx_xvmadd_w(u_l, gu, g_l); + u_l = __lasx_xvmadd_w(u_l, bu, b_l); + u_h = __lasx_xvmadd_w(u_h, gu, g_h); + u_h = __lasx_xvmadd_w(u_h, bu, b_h); + v_l = __lasx_xvmadd_w(v_l, gv, g_l); + v_l = __lasx_xvmadd_w(v_l, bv, b_l); + v_h = __lasx_xvmadd_w(v_h, gv, g_h); + v_h = __lasx_xvmadd_w(v_h, bv, b_h); + u_l = __lasx_xvsra_w(u_l, sra); + u_h = __lasx_xvsra_w(u_h, sra); + v_l = __lasx_xvsra_w(v_l, sra); + v_h = __lasx_xvsra_w(v_h, sra); + u_lh = __lasx_xvshuf_b(u_h, u_l, mask); + v_lh = __lasx_xvshuf_b(v_h, v_l, mask); + u_lh = __lasx_xvpermi_d(u_lh, 0xD8); + v_lh = __lasx_xvpermi_d(v_lh, 0xD8); + __lasx_xvst(u_lh, (dstU + i), 0); + __lasx_xvst(v_lh, (dstV + i), 0); + } + if (width - i >= 8) { + __m256i _g, _b, _r; + __m256i g_l, b_l, r_l; + __m256i v_l, u_l, u, v; + + _g = __lasx_xvldrepl_d((src0 + i), 0); + _b = __lasx_xvldrepl_d((src1 + i), 0); + _r = __lasx_xvldrepl_d((src2 + i), 0); + g_l = __lasx_vext2xv_wu_bu(_g); + b_l = __lasx_vext2xv_wu_bu(_b); + r_l = __lasx_vext2xv_wu_bu(_r); + u_l = __lasx_xvmadd_w(temp, ru, r_l); + v_l = __lasx_xvmadd_w(temp, rv, r_l); + u_l = __lasx_xvmadd_w(u_l, gu, g_l); + u_l = __lasx_xvmadd_w(u_l, bu, b_l); + v_l = __lasx_xvmadd_w(v_l, gv, g_l); + v_l = __lasx_xvmadd_w(v_l, bv, b_l); + u_l = __lasx_xvsra_w(u_l, sra); + v_l = __lasx_xvsra_w(v_l, sra); + u = __lasx_xvshuf_b(u_l, u_l, mask); + v = __lasx_xvshuf_b(v_l, v_l, mask); + __lasx_xvstelm_d(u, (dstU + i), 0, 0); + __lasx_xvstelm_d(u, (dstU + i), 8, 2); + __lasx_xvstelm_d(v, (dstV + i), 0, 0); + __lasx_xvstelm_d(v, (dstV + i), 8, 2); + i += 8; + } + for (; i < width; i++) { + int g = src[0][i]; + int b = src[1][i]; + int r = src[2][i]; + + dstU[i] = (tem_ru * r + tem_gu * g + tem_bu * b + set) >> shift; + dstV[i] = (tem_rv * r + tem_gv * g + tem_bv * b + set) >> shift; + } +} + +void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opq) +{ + int i; + int shift = (RGB2YUV_SHIFT - 6); + int set = 0x801 << (RGB2YUV_SHIFT - 7); + int len = width - 15; + uint16_t *dst = (uint16_t *)_dst; + int32_t tem_ry = rgb2yuv[RY_IDX], tem_gy = rgb2yuv[GY_IDX]; + int32_t tem_by = rgb2yuv[BY_IDX]; + const uint8_t *src0 = src[0], *src1 = src[1], *src2 = src[2]; + __m256i mask = {0x0D0C090805040100, 0x1D1C191815141110, + 0x0D0C090805040100, 0x1D1C191815141110}; + __m256i temp = __lasx_xvreplgr2vr_w(set); + __m256i sra = __lasx_xvreplgr2vr_w(shift); + __m256i ry = __lasx_xvreplgr2vr_w(tem_ry); + __m256i gy = __lasx_xvreplgr2vr_w(tem_gy); + __m256i by = __lasx_xvreplgr2vr_w(tem_by); + + for (i = 0; i < len; i += 16) { + __m256i _g, _b, _r; + __m256i g_l, g_h, b_l, b_h, r_l, r_h; + __m256i y_l, y_h, y_lh; + + _g = __lasx_xvldx(src0, i); + _b = __lasx_xvldx(src1, i); + _r = __lasx_xvldx(src2, i); + g_l = __lasx_vext2xv_wu_bu(_g); + b_l = __lasx_vext2xv_wu_bu(_b); + r_l = __lasx_vext2xv_wu_bu(_r); + _g = __lasx_xvpermi_d(_g, 0x01); + _b = __lasx_xvpermi_d(_b, 0x01); + _r = __lasx_xvpermi_d(_r, 0x01); + g_h = __lasx_vext2xv_wu_bu(_g); + b_h = __lasx_vext2xv_wu_bu(_b); + r_h = __lasx_vext2xv_wu_bu(_r); + y_l = __lasx_xvmadd_w(temp, ry, r_l); + y_h = __lasx_xvmadd_w(temp, ry, r_h); + y_l = __lasx_xvmadd_w(y_l, gy, g_l); + y_l = __lasx_xvmadd_w(y_l, by, b_l); + y_h = __lasx_xvmadd_w(y_h, gy, g_h); + y_h = __lasx_xvmadd_w(y_h, by, b_h); + y_l = __lasx_xvsra_w(y_l, sra); + y_h = __lasx_xvsra_w(y_h, sra); + y_lh = __lasx_xvshuf_b(y_h, y_l, mask); + y_lh = __lasx_xvpermi_d(y_lh, 0xD8); + __lasx_xvst(y_lh, (dst + i), 0); + } + if (width - i >= 8) { + __m256i _g, _b, _r; + __m256i g_l, b_l, r_l; + __m256i y_l, y; + + _g = __lasx_xvldrepl_d((src0 + i), 0); + _b = __lasx_xvldrepl_d((src1 + i), 0); + _r = __lasx_xvldrepl_d((src2 + i), 0); + g_l = __lasx_vext2xv_wu_bu(_g); + b_l = __lasx_vext2xv_wu_bu(_b); + r_l = __lasx_vext2xv_wu_bu(_r); + y_l = __lasx_xvmadd_w(temp, ry, r_l); + y_l = __lasx_xvmadd_w(y_l, gy, g_l); + y_l = __lasx_xvmadd_w(y_l, by, b_l); + y_l = __lasx_xvsra_w(y_l, sra); + y = __lasx_xvshuf_b(y_l, y_l, mask); + __lasx_xvstelm_d(y, (dst + i), 0, 0); + __lasx_xvstelm_d(y, (dst + i), 8, 2); + i += 8; + } + for (; i < width; i++) { + int g = src[0][i]; + int b = src[1][i]; + int r = src[2][i]; + + dst[i] = (tem_ry * r + tem_gy * g + tem_by * b + set) >> shift; + } +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_init_loongarch.o +LASX-OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_lasx.o \ + loongarch/input_lasx.o \ + loongarch/yuv2rgb_lasx.o \ + loongarch/rgb2rgb_lasx.o \ + loongarch/output_lasx.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/output_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/output_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/output_lasx.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/output_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1982 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libavutil/loongarch/loongson_intrinsics.h" + +void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize, + const int16_t **src, uint8_t *dest, int dstW, + const uint8_t *dither, int offset) +{ + int i; + int len = dstW - 15; + __m256i mask = {0x1C0C180814041000, 0x1C1814100C080400, + 0x1C0C180814041000, 0x1C1814100C080400}; + __m256i val1, val2, val3; + uint8_t dither0 = dither[offset & 7]; + uint8_t dither1 = dither[(offset + 1) & 7]; + uint8_t dither2 = dither[(offset + 2) & 7]; + uint8_t dither3 = dither[(offset + 3) & 7]; + uint8_t dither4 = dither[(offset + 4) & 7]; + uint8_t dither5 = dither[(offset + 5) & 7]; + uint8_t dither6 = dither[(offset + 6) & 7]; + uint8_t dither7 = dither[(offset + 7) & 7]; + int val_1[8] = {dither0, dither2, dither4, dither6, + dither0, dither2, dither4, dither6}; + int val_2[8] = {dither1, dither3, dither5, dither7, + dither1, dither3, dither5, dither7}; + int val_3[8] = {dither0, dither1, dither2, dither3, + dither4, dither5, dither6, dither7}; + + DUP2_ARG2(__lasx_xvld, val_1, 0, val_2, 0, val1, val2); + val3 = __lasx_xvld(val_3, 0); + + for (i = 0; i < len; i += 16) { + int j; + __m256i src0, filter0, val; + __m256i val_ev, val_od; + + val_ev = __lasx_xvslli_w(val1, 12); + val_od = __lasx_xvslli_w(val2, 12); + + for (j = 0; j < filterSize; j++) { + src0 = __lasx_xvld(src[j]+ i, 0); + filter0 = __lasx_xvldrepl_h((filter + j), 0); + val_ev = __lasx_xvmaddwev_w_h(val_ev, src0, filter0); + val_od = __lasx_xvmaddwod_w_h(val_od, src0, filter0); + } + val_ev = __lasx_xvsrai_w(val_ev, 19); + val_od = __lasx_xvsrai_w(val_od, 19); + val_ev = __lasx_xvclip255_w(val_ev); + val_od = __lasx_xvclip255_w(val_od); + val = __lasx_xvshuf_b(val_od, val_ev, mask); + __lasx_xvstelm_d(val, (dest + i), 0, 0); + __lasx_xvstelm_d(val, (dest + i), 8, 2); + } + if (dstW - i >= 8){ + int j; + __m256i src0, filter0, val_h; + __m256i val_l; + + val_l = __lasx_xvslli_w(val3, 12); + + for (j = 0; j < filterSize; j++) { + src0 = __lasx_xvld(src[j] + i, 0); + src0 = __lasx_vext2xv_w_h(src0); + filter0 = __lasx_xvldrepl_h((filter + j), 0); + filter0 = __lasx_vext2xv_w_h(filter0); + val_l = __lasx_xvmadd_w(val_l, src0, filter0); + } + val_l = __lasx_xvsrai_w(val_l, 19); + val_l = __lasx_xvclip255_w(val_l); + val_h = __lasx_xvpermi_d(val_l, 0x4E); + val_l = __lasx_xvshuf_b(val_h, val_l, mask); + __lasx_xvstelm_d(val_l, (dest + i), 0, 1); + i += 8; + } + for (; i < dstW; i++) { + int val = dither[(i + offset) & 7] << 12; + int j; + for (j = 0; j< filterSize; j++) + val += src[j][i] * filter[j]; + + dest[i] = av_clip_uint8(val >> 19); + } +} + +/*Copy from libswscale/output.c*/ +static av_always_inline void +yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, + unsigned A1, unsigned A2, + const void *_r, const void *_g, const void *_b, int y, + enum AVPixelFormat target, int hasAlpha) +{ + if (target == AV_PIX_FMT_ARGB || target == AV_PIX_FMT_RGBA || + target == AV_PIX_FMT_ABGR || target == AV_PIX_FMT_BGRA) { + uint32_t *dest = (uint32_t *) _dest; + const uint32_t *r = (const uint32_t *) _r; + const uint32_t *g = (const uint32_t *) _g; + const uint32_t *b = (const uint32_t *) _b; + +#if CONFIG_SMALL + dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1]; + dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2]; +#else +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 + int sh = (target == AV_PIX_FMT_RGB32_1 || + target == AV_PIX_FMT_BGR32_1) ? 0 : 24; + av_assert2((((r[Y1] + g[Y1] + b[Y1]) >> sh) & 0xFF) == 0xFF); +#endif + dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1]; + dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2]; +#endif + } else if (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) { + uint8_t *dest = (uint8_t *) _dest; + const uint8_t *r = (const uint8_t *) _r; + const uint8_t *g = (const uint8_t *) _g; + const uint8_t *b = (const uint8_t *) _b; + +#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b) +#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r) + + dest[i * 6 + 0] = r_b[Y1]; + dest[i * 6 + 1] = g[Y1]; + dest[i * 6 + 2] = b_r[Y1]; + dest[i * 6 + 3] = r_b[Y2]; + dest[i * 6 + 4] = g[Y2]; + dest[i * 6 + 5] = b_r[Y2]; +#undef r_b +#undef b_r + } else if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565 || + target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555 || + target == AV_PIX_FMT_RGB444 || target == AV_PIX_FMT_BGR444) { + uint16_t *dest = (uint16_t *) _dest; + const uint16_t *r = (const uint16_t *) _r; + const uint16_t *g = (const uint16_t *) _g; + const uint16_t *b = (const uint16_t *) _b; + int dr1, dg1, db1, dr2, dg2, db2; + + if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565) { + dr1 = ff_dither_2x2_8[ y & 1 ][0]; + dg1 = ff_dither_2x2_4[ y & 1 ][0]; + db1 = ff_dither_2x2_8[(y & 1) ^ 1][0]; + dr2 = ff_dither_2x2_8[ y & 1 ][1]; + dg2 = ff_dither_2x2_4[ y & 1 ][1]; + db2 = ff_dither_2x2_8[(y & 1) ^ 1][1]; + } else if (target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555) { + dr1 = ff_dither_2x2_8[ y & 1 ][0]; + dg1 = ff_dither_2x2_8[ y & 1 ][1]; + db1 = ff_dither_2x2_8[(y & 1) ^ 1][0]; + dr2 = ff_dither_2x2_8[ y & 1 ][1]; + dg2 = ff_dither_2x2_8[ y & 1 ][0]; + db2 = ff_dither_2x2_8[(y & 1) ^ 1][1]; + } else { + dr1 = ff_dither_4x4_16[ y & 3 ][0]; + dg1 = ff_dither_4x4_16[ y & 3 ][1]; + db1 = ff_dither_4x4_16[(y & 3) ^ 3][0]; + dr2 = ff_dither_4x4_16[ y & 3 ][1]; + dg2 = ff_dither_4x4_16[ y & 3 ][0]; + db2 = ff_dither_4x4_16[(y & 3) ^ 3][1]; + } + + dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1]; + dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]; + } else /* 8/4 bits */ { + uint8_t *dest = (uint8_t *) _dest; + const uint8_t *r = (const uint8_t *) _r; + const uint8_t *g = (const uint8_t *) _g; + const uint8_t *b = (const uint8_t *) _b; + int dr1, dg1, db1, dr2, dg2, db2; + + if (target == AV_PIX_FMT_RGB8 || target == AV_PIX_FMT_BGR8) { + const uint8_t * const d64 = ff_dither_8x8_73[y & 7]; + const uint8_t * const d32 = ff_dither_8x8_32[y & 7]; + dr1 = dg1 = d32[(i * 2 + 0) & 7]; + db1 = d64[(i * 2 + 0) & 7]; + dr2 = dg2 = d32[(i * 2 + 1) & 7]; + db2 = d64[(i * 2 + 1) & 7]; + } else { + const uint8_t * const d64 = ff_dither_8x8_73 [y & 7]; + const uint8_t * const d128 = ff_dither_8x8_220[y & 7]; + dr1 = db1 = d128[(i * 2 + 0) & 7]; + dg1 = d64[(i * 2 + 0) & 7]; + dr2 = db2 = d128[(i * 2 + 1) & 7]; + dg2 = d64[(i * 2 + 1) & 7]; + } + + if (target == AV_PIX_FMT_RGB4 || target == AV_PIX_FMT_BGR4) { + dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] + + ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4); + } else { + dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1]; + dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]; + } + } +} + +#define WRITE_YUV2RGB(vec_y1, vec_y2, vec_u, vec_v, t1, t2, t3, t4) \ +{ \ + Y1 = __lasx_xvpickve2gr_w(vec_y1, t1); \ + Y2 = __lasx_xvpickve2gr_w(vec_y2, t2); \ + U = __lasx_xvpickve2gr_w(vec_u, t3); \ + V = __lasx_xvpickve2gr_w(vec_v, t4); \ + r = c->table_rV[V]; \ + g = (c->table_gU[U] + c->table_gV[V]); \ + b = c->table_bU[U]; \ + yuv2rgb_write(dest, count, Y1, Y2, 0, 0, \ + r, g, b, y, target, 0); \ + count++; \ +} + +static void +yuv2rgb_X_template_lasx(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, + int y, enum AVPixelFormat target, int hasAlpha) +{ + int i, j; + int count = 0; + int t = 1 << 18; + int len = dstW >> 6; + int res = dstW & 63; + int len_count = (dstW + 1) >> 1; + const void *r, *g, *b; + int head = YUVRGB_TABLE_HEADROOM; + __m256i headroom = __lasx_xvreplgr2vr_w(head); + + for (i = 0; i < len; i++) { + int Y1, Y2, U, V, count_lum = count << 1; + __m256i l_src1, l_src2, l_src3, l_src4, u_src1, u_src2, v_src1, v_src2; + __m256i yl1_ev, yl1_od, yh1_ev, yh1_od, yl2_ev, yl2_od, yh2_ev, yh2_od; + __m256i u1_ev, u1_od, v1_ev, v1_od, u2_ev, u2_od, v2_ev, v2_od, temp; + + yl1_ev = __lasx_xvldrepl_w(&t, 0); + yl1_od = yl1_ev; + yh1_ev = yl1_ev; + yh1_od = yl1_ev; + u1_ev = yl1_ev; + v1_ev = yl1_ev; + u1_od = yl1_ev; + v1_od = yl1_ev; + yl2_ev = yl1_ev; + yl2_od = yl1_ev; + yh2_ev = yl1_ev; + yh2_od = yl1_ev; + u2_ev = yl1_ev; + v2_ev = yl1_ev; + u2_od = yl1_ev; + v2_od = yl1_ev; + for (j = 0; j < lumFilterSize; j++) { + const int16_t *src_lum = lumSrc[j] + count_lum; + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + DUP4_ARG2(__lasx_xvld, src_lum, 0, src_lum, 32, src_lum, 64, + src_lum, 96, l_src1, l_src2, l_src3, l_src4); + + yl1_ev = __lasx_xvmaddwev_w_h(yl1_ev, temp, l_src1); + yl1_od = __lasx_xvmaddwod_w_h(yl1_od, temp, l_src1); + yh1_ev = __lasx_xvmaddwev_w_h(yh1_ev, temp, l_src2); + yh1_od = __lasx_xvmaddwod_w_h(yh1_od, temp, l_src2); + yl2_ev = __lasx_xvmaddwev_w_h(yl2_ev, temp, l_src3); + yl2_od = __lasx_xvmaddwod_w_h(yl2_od, temp, l_src3); + yh2_ev = __lasx_xvmaddwev_w_h(yh2_ev, temp, l_src4); + yh2_od = __lasx_xvmaddwod_w_h(yh2_od, temp, l_src4); + } + for (j = 0; j < chrFilterSize; j++) { + DUP2_ARG2(__lasx_xvld, chrUSrc[j] + count, 0, chrUSrc[j] + count, 32, + u_src1, u_src2); + DUP2_ARG2(__lasx_xvld, chrVSrc[j] + count, 0, chrVSrc[j] + count, 32, + v_src1, v_src2); + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + u1_ev = __lasx_xvmaddwev_w_h(u1_ev, temp, u_src1); + u1_od = __lasx_xvmaddwod_w_h(u1_od, temp, u_src1); + v1_ev = __lasx_xvmaddwev_w_h(v1_ev, temp, v_src1); + v1_od = __lasx_xvmaddwod_w_h(v1_od, temp, v_src1); + u2_ev = __lasx_xvmaddwev_w_h(u2_ev, temp, u_src2); + u2_od = __lasx_xvmaddwod_w_h(u2_od, temp, u_src2); + v2_ev = __lasx_xvmaddwev_w_h(v2_ev, temp, v_src2); + v2_od = __lasx_xvmaddwod_w_h(v2_od, temp, v_src2); + } + yl1_ev = __lasx_xvsrai_w(yl1_ev, 19); + yh1_ev = __lasx_xvsrai_w(yh1_ev, 19); + yl1_od = __lasx_xvsrai_w(yl1_od, 19); + yh1_od = __lasx_xvsrai_w(yh1_od, 19); + u1_ev = __lasx_xvsrai_w(u1_ev, 19); + v1_ev = __lasx_xvsrai_w(v1_ev, 19); + u1_od = __lasx_xvsrai_w(u1_od, 19); + v1_od = __lasx_xvsrai_w(v1_od, 19); + yl2_ev = __lasx_xvsrai_w(yl2_ev, 19); + yh2_ev = __lasx_xvsrai_w(yh2_ev, 19); + yl2_od = __lasx_xvsrai_w(yl2_od, 19); + yh2_od = __lasx_xvsrai_w(yh2_od, 19); + u2_ev = __lasx_xvsrai_w(u2_ev, 19); + v2_ev = __lasx_xvsrai_w(v2_ev, 19); + u2_od = __lasx_xvsrai_w(u2_od, 19); + v2_od = __lasx_xvsrai_w(v2_od, 19); + u1_ev = __lasx_xvadd_w(u1_ev, headroom); + v1_ev = __lasx_xvadd_w(v1_ev, headroom); + u1_od = __lasx_xvadd_w(u1_od, headroom); + v1_od = __lasx_xvadd_w(v1_od, headroom); + u2_ev = __lasx_xvadd_w(u2_ev, headroom); + v2_ev = __lasx_xvadd_w(v2_ev, headroom); + u2_od = __lasx_xvadd_w(u2_od, headroom); + v2_od = __lasx_xvadd_w(v2_od, headroom); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_ev, v1_ev, 0, 0, 0, 0); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_od, v1_od, 1, 1, 0, 0); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_ev, v1_ev, 2, 2, 1, 1); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_od, v1_od, 3, 3, 1, 1); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_ev, v1_ev, 4, 4, 2, 2); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_od, v1_od, 5, 5, 2, 2); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_ev, v1_ev, 6, 6, 3, 3); + WRITE_YUV2RGB(yl1_ev, yl1_od, u1_od, v1_od, 7, 7, 3, 3); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_ev, v1_ev, 0, 0, 4, 4); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_od, v1_od, 1, 1, 4, 4); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_ev, v1_ev, 2, 2, 5, 5); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_od, v1_od, 3, 3, 5, 5); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_ev, v1_ev, 4, 4, 6, 6); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_od, v1_od, 5, 5, 6, 6); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_ev, v1_ev, 6, 6, 7, 7); + WRITE_YUV2RGB(yh1_ev, yh1_od, u1_od, v1_od, 7, 7, 7, 7); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_ev, v2_ev, 0, 0, 0, 0); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_od, v2_od, 1, 1, 0, 0); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_ev, v2_ev, 2, 2, 1, 1); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_od, v2_od, 3, 3, 1, 1); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_ev, v2_ev, 4, 4, 2, 2); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_od, v2_od, 5, 5, 2, 2); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_ev, v2_ev, 6, 6, 3, 3); + WRITE_YUV2RGB(yl2_ev, yl2_od, u2_od, v2_od, 7, 7, 3, 3); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_ev, v2_ev, 0, 0, 4, 4); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_od, v2_od, 1, 1, 4, 4); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_ev, v2_ev, 2, 2, 5, 5); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_od, v2_od, 3, 3, 5, 5); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_ev, v2_ev, 4, 4, 6, 6); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_od, v2_od, 5, 5, 6, 6); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_ev, v2_ev, 6, 6, 7, 7); + WRITE_YUV2RGB(yh2_ev, yh2_od, u2_od, v2_od, 7, 7, 7, 7); + } + if (res >= 32) { + int Y1, Y2, U, V, count_lum = count << 1; + __m256i l_src1, l_src2, u_src, v_src; + __m256i yl_ev, yl_od, yh_ev, yh_od; + __m256i u_ev, u_od, v_ev, v_od, temp; + + yl_ev = __lasx_xvldrepl_w(&t, 0); + yl_od = yl_ev; + yh_ev = yl_ev; + yh_od = yl_ev; + u_ev = yl_ev; + v_ev = yl_ev; + u_od = yl_ev; + v_od = yl_ev; + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + DUP2_ARG2(__lasx_xvld, lumSrc[j] + count_lum, 0, lumSrc[j] + count_lum, + 32, l_src1, l_src2); + yl_ev = __lasx_xvmaddwev_w_h(yl_ev, temp, l_src1); + yl_od = __lasx_xvmaddwod_w_h(yl_od, temp, l_src1); + yh_ev = __lasx_xvmaddwev_w_h(yh_ev, temp, l_src2); + yh_od = __lasx_xvmaddwod_w_h(yh_od, temp, l_src2); + } + for (j = 0; j < chrFilterSize; j++) { + DUP2_ARG2(__lasx_xvld, chrUSrc[j] + count, 0, chrVSrc[j] + count, 0, + u_src, v_src); + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + u_ev = __lasx_xvmaddwev_w_h(u_ev, temp, u_src); + u_od = __lasx_xvmaddwod_w_h(u_od, temp, u_src); + v_ev = __lasx_xvmaddwev_w_h(v_ev, temp, v_src); + v_od = __lasx_xvmaddwod_w_h(v_od, temp, v_src); + } + yl_ev = __lasx_xvsrai_w(yl_ev, 19); + yh_ev = __lasx_xvsrai_w(yh_ev, 19); + yl_od = __lasx_xvsrai_w(yl_od, 19); + yh_od = __lasx_xvsrai_w(yh_od, 19); + u_ev = __lasx_xvsrai_w(u_ev, 19); + v_ev = __lasx_xvsrai_w(v_ev, 19); + u_od = __lasx_xvsrai_w(u_od, 19); + v_od = __lasx_xvsrai_w(v_od, 19); + u_ev = __lasx_xvadd_w(u_ev, headroom); + v_ev = __lasx_xvadd_w(v_ev, headroom); + u_od = __lasx_xvadd_w(u_od, headroom); + v_od = __lasx_xvadd_w(v_od, headroom); + WRITE_YUV2RGB(yl_ev, yl_od, u_ev, v_ev, 0, 0, 0, 0); + WRITE_YUV2RGB(yl_ev, yl_od, u_od, v_od, 1, 1, 0, 0); + WRITE_YUV2RGB(yl_ev, yl_od, u_ev, v_ev, 2, 2, 1, 1); + WRITE_YUV2RGB(yl_ev, yl_od, u_od, v_od, 3, 3, 1, 1); + WRITE_YUV2RGB(yl_ev, yl_od, u_ev, v_ev, 4, 4, 2, 2); + WRITE_YUV2RGB(yl_ev, yl_od, u_od, v_od, 5, 5, 2, 2); + WRITE_YUV2RGB(yl_ev, yl_od, u_ev, v_ev, 6, 6, 3, 3); + WRITE_YUV2RGB(yl_ev, yl_od, u_od, v_od, 7, 7, 3, 3); + WRITE_YUV2RGB(yh_ev, yh_od, u_ev, v_ev, 0, 0, 4, 4); + WRITE_YUV2RGB(yh_ev, yh_od, u_od, v_od, 1, 1, 4, 4); + WRITE_YUV2RGB(yh_ev, yh_od, u_ev, v_ev, 2, 2, 5, 5); + WRITE_YUV2RGB(yh_ev, yh_od, u_od, v_od, 3, 3, 5, 5); + WRITE_YUV2RGB(yh_ev, yh_od, u_ev, v_ev, 4, 4, 6, 6); + WRITE_YUV2RGB(yh_ev, yh_od, u_od, v_od, 5, 5, 6, 6); + WRITE_YUV2RGB(yh_ev, yh_od, u_ev, v_ev, 6, 6, 7, 7); + WRITE_YUV2RGB(yh_ev, yh_od, u_od, v_od, 7, 7, 7, 7); + res -= 32; + } + if (res >= 16) { + int Y1, Y2, U, V; + int count_lum = count << 1; + __m256i l_src, u_src, v_src; + __m256i y_ev, y_od, u, v, temp; + + y_ev = __lasx_xvldrepl_w(&t, 0); + y_od = y_ev; + u = y_ev; + v = y_ev; + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + l_src = __lasx_xvld(lumSrc[j] + count_lum, 0); + y_ev = __lasx_xvmaddwev_w_h(y_ev, temp, l_src); + y_od = __lasx_xvmaddwod_w_h(y_od, temp, l_src); + } + for (j = 0; j < chrFilterSize; j++) { + DUP2_ARG2(__lasx_xvld, chrUSrc[j] + count, 0, chrVSrc[j] + count, + 0, u_src, v_src); + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + u_src = __lasx_vext2xv_w_h(u_src); + v_src = __lasx_vext2xv_w_h(v_src); + u = __lasx_xvmaddwev_w_h(u, temp, u_src); + v = __lasx_xvmaddwev_w_h(v, temp, v_src); + } + y_ev = __lasx_xvsrai_w(y_ev, 19); + y_od = __lasx_xvsrai_w(y_od, 19); + u = __lasx_xvsrai_w(u, 19); + v = __lasx_xvsrai_w(v, 19); + u = __lasx_xvadd_w(u, headroom); + v = __lasx_xvadd_w(v, headroom); + WRITE_YUV2RGB(y_ev, y_od, u, v, 0, 0, 0, 0); + WRITE_YUV2RGB(y_ev, y_od, u, v, 1, 1, 1, 1); + WRITE_YUV2RGB(y_ev, y_od, u, v, 2, 2, 2, 2); + WRITE_YUV2RGB(y_ev, y_od, u, v, 3, 3, 3, 3); + WRITE_YUV2RGB(y_ev, y_od, u, v, 4, 4, 4, 4); + WRITE_YUV2RGB(y_ev, y_od, u, v, 5, 5, 5, 5); + WRITE_YUV2RGB(y_ev, y_od, u, v, 6, 6, 6, 6); + WRITE_YUV2RGB(y_ev, y_od, u, v, 7, 7, 7, 7); + res -= 16; + } + if (res >= 8) { + int Y1, Y2, U, V; + int count_lum = count << 1; + __m256i l_src, u_src, v_src; + __m256i y_ev, uv, temp; + + y_ev = __lasx_xvldrepl_w(&t, 0); + uv = y_ev; + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + l_src = __lasx_xvld(lumSrc[j] + count_lum, 0); + l_src = __lasx_vext2xv_w_h(l_src); + y_ev = __lasx_xvmaddwev_w_h(y_ev, temp, l_src); + } + for (j = 0; j < chrFilterSize; j++) { + u_src = __lasx_xvldrepl_d((chrUSrc[j] + count), 0); + v_src = __lasx_xvldrepl_d((chrVSrc[j] + count), 0); + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + u_src = __lasx_xvilvl_d(v_src, u_src); + u_src = __lasx_vext2xv_w_h(u_src); + uv = __lasx_xvmaddwev_w_h(uv, temp, u_src); + } + y_ev = __lasx_xvsrai_w(y_ev, 19); + uv = __lasx_xvsrai_w(uv, 19); + uv = __lasx_xvadd_w(uv, headroom); + WRITE_YUV2RGB(y_ev, y_ev, uv, uv, 0, 1, 0, 4); + WRITE_YUV2RGB(y_ev, y_ev, uv, uv, 2, 3, 1, 5); + WRITE_YUV2RGB(y_ev, y_ev, uv, uv, 4, 5, 2, 6); + WRITE_YUV2RGB(y_ev, y_ev, uv, uv, 6, 7, 3, 7); + } + for (; count < len_count; count++) { + int Y1 = 1 << 18; + int Y2 = Y1; + int U = Y1; + int V = Y1; + + for (j = 0; j < lumFilterSize; j++) { + Y1 += lumSrc[j][count * 2] * lumFilter[j]; + Y2 += lumSrc[j][count * 2 + 1] * lumFilter[j]; + } + for (j = 0; j < chrFilterSize; j++) { + U += chrUSrc[j][count] * chrFilter[j]; + V += chrVSrc[j][count] * chrFilter[j]; + } + Y1 >>= 19; + Y2 >>= 19; + U >>= 19; + V >>= 19; + r = c->table_rV[V + YUVRGB_TABLE_HEADROOM]; + g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + + c->table_gV[V + YUVRGB_TABLE_HEADROOM]); + b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; + + yuv2rgb_write(dest, count, Y1, Y2, 0, 0, + r, g, b, y, target, 0); + } +} + +static void +yuv2rgb_2_template_lasx(SwsContext *c, const int16_t *buf[2], + const int16_t *ubuf[2], const int16_t *vbuf[2], + const int16_t *abuf[2], uint8_t *dest, int dstW, + int yalpha, int uvalpha, int y, + enum AVPixelFormat target, int hasAlpha) +{ + const int16_t *buf0 = buf[0], *buf1 = buf[1], + *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], + *vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; + int yalpha1 = 4096 - yalpha; + int uvalpha1 = 4096 - uvalpha; + int i, count = 0; + int len = dstW - 15; + int len_count = (dstW + 1) >> 1; + const void *r, *g, *b; + int head = YUVRGB_TABLE_HEADROOM; + __m256i v_yalpha1 = __lasx_xvreplgr2vr_w(yalpha1); + __m256i v_uvalpha1 = __lasx_xvreplgr2vr_w(uvalpha1); + __m256i v_yalpha = __lasx_xvreplgr2vr_w(yalpha); + __m256i v_uvalpha = __lasx_xvreplgr2vr_w(uvalpha); + __m256i headroom = __lasx_xvreplgr2vr_w(head); + + for (i = 0; i < len; i += 16) { + int Y1, Y2, U, V; + int i_dex = i << 1; + int c_dex = count << 1; + __m256i y0_h, y0_l, y0, u0, v0; + __m256i y1_h, y1_l, y1, u1, v1; + __m256i y_l, y_h, u, v; + + DUP4_ARG2(__lasx_xvldx, buf0, i_dex, ubuf0, c_dex, vbuf0, c_dex, + buf1, i_dex, y0, u0, v0, y1); + DUP2_ARG2(__lasx_xvldx, ubuf1, c_dex, vbuf1, c_dex, u1, v1); + DUP2_ARG2(__lasx_xvsllwil_w_h, y0, 0, y1, 0, y0_l, y1_l); + DUP2_ARG1(__lasx_xvexth_w_h, y0, y1, y0_h, y1_h); + DUP4_ARG1(__lasx_vext2xv_w_h, u0, u1, v0, v1, u0, u1, v0, v1); + y0_l = __lasx_xvmul_w(y0_l, v_yalpha1); + y0_h = __lasx_xvmul_w(y0_h, v_yalpha1); + u0 = __lasx_xvmul_w(u0, v_uvalpha1); + v0 = __lasx_xvmul_w(v0, v_uvalpha1); + y_l = __lasx_xvmadd_w(y0_l, v_yalpha, y1_l); + y_h = __lasx_xvmadd_w(y0_h, v_yalpha, y1_h); + u = __lasx_xvmadd_w(u0, v_uvalpha, u1); + v = __lasx_xvmadd_w(v0, v_uvalpha, v1); + y_l = __lasx_xvsrai_w(y_l, 19); + y_h = __lasx_xvsrai_w(y_h, 19); + u = __lasx_xvsrai_w(u, 19); + v = __lasx_xvsrai_w(v, 19); + u = __lasx_xvadd_w(u, headroom); + v = __lasx_xvadd_w(v, headroom); + WRITE_YUV2RGB(y_l, y_l, u, v, 0, 1, 0, 0); + WRITE_YUV2RGB(y_l, y_l, u, v, 2, 3, 1, 1); + WRITE_YUV2RGB(y_h, y_h, u, v, 0, 1, 2, 2); + WRITE_YUV2RGB(y_h, y_h, u, v, 2, 3, 3, 3); + WRITE_YUV2RGB(y_l, y_l, u, v, 4, 5, 4, 4); + WRITE_YUV2RGB(y_l, y_l, u, v, 6, 7, 5, 5); + WRITE_YUV2RGB(y_h, y_h, u, v, 4, 5, 6, 6); + WRITE_YUV2RGB(y_h, y_h, u, v, 6, 7, 7, 7); + } + if (dstW - i >= 8) { + int Y1, Y2, U, V; + int i_dex = i << 1; + __m256i y0_l, y0, u0, v0; + __m256i y1_l, y1, u1, v1; + __m256i y_l, u, v; + + y0 = __lasx_xvldx(buf0, i_dex); + u0 = __lasx_xvldrepl_d((ubuf0 + count), 0); + v0 = __lasx_xvldrepl_d((vbuf0 + count), 0); + y1 = __lasx_xvldx(buf1, i_dex); + u1 = __lasx_xvldrepl_d((ubuf1 + count), 0); + v1 = __lasx_xvldrepl_d((vbuf1 + count), 0); + DUP2_ARG1(__lasx_vext2xv_w_h, y0, y1, y0_l, y1_l); + DUP4_ARG1(__lasx_vext2xv_w_h, u0, u1, v0, v1, u0, u1, v0, v1); + y0_l = __lasx_xvmul_w(y0_l, v_yalpha1); + u0 = __lasx_xvmul_w(u0, v_uvalpha1); + v0 = __lasx_xvmul_w(v0, v_uvalpha1); + y_l = __lasx_xvmadd_w(y0_l, v_yalpha, y1_l); + u = __lasx_xvmadd_w(u0, v_uvalpha, u1); + v = __lasx_xvmadd_w(v0, v_uvalpha, v1); + y_l = __lasx_xvsrai_w(y_l, 19); + u = __lasx_xvsrai_w(u, 19); + v = __lasx_xvsrai_w(v, 19); + u = __lasx_xvadd_w(u, headroom); + v = __lasx_xvadd_w(v, headroom); + WRITE_YUV2RGB(y_l, y_l, u, v, 0, 1, 0, 0); + WRITE_YUV2RGB(y_l, y_l, u, v, 2, 3, 1, 1); + WRITE_YUV2RGB(y_l, y_l, u, v, 4, 5, 2, 2); + WRITE_YUV2RGB(y_l, y_l, u, v, 6, 7, 3, 3); + i += 8; + } + for (; count < len_count; count++) { + int Y1 = (buf0[count * 2] * yalpha1 + + buf1[count * 2] * yalpha) >> 19; + int Y2 = (buf0[count * 2 + 1] * yalpha1 + + buf1[count * 2 + 1] * yalpha) >> 19; + int U = (ubuf0[count] * uvalpha1 + ubuf1[count] * uvalpha) >> 19; + int V = (vbuf0[count] * uvalpha1 + vbuf1[count] * uvalpha) >> 19; + + r = c->table_rV[V + YUVRGB_TABLE_HEADROOM], + g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), + b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; + + yuv2rgb_write(dest, count, Y1, Y2, 0, 0, + r, g, b, y, target, 0); + } +} + +static void +yuv2rgb_1_template_lasx(SwsContext *c, const int16_t *buf0, + const int16_t *ubuf[2], const int16_t *vbuf[2], + const int16_t *abuf0, uint8_t *dest, int dstW, + int uvalpha, int y, enum AVPixelFormat target, + int hasAlpha) +{ + const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; + int i; + int len = (dstW - 15); + int len_count = (dstW + 1) >> 1; + const void *r, *g, *b; + + if (uvalpha < 2048) { + int count = 0; + int head = YUVRGB_TABLE_HEADROOM; + __m256i headroom = __lasx_xvreplgr2vr_h(head); + + for (i = 0; i < len; i += 16) { + int Y1, Y2, U, V; + int i_dex = i << 1; + int c_dex = count << 1; + __m256i src_y, src_u, src_v; + __m256i u, v, y_l, y_h; + + DUP2_ARG2(__lasx_xvldx, buf0, i_dex, ubuf0, c_dex, src_y, src_u); + src_v = __lasx_xvldx(vbuf0, c_dex); + src_u = __lasx_xvpermi_q(src_u, src_v, 0x02); + src_y = __lasx_xvsrari_h(src_y, 7); + src_u = __lasx_xvsrari_h(src_u, 7); + y_l = __lasx_xvsllwil_w_h(src_y, 0); + y_h = __lasx_xvexth_w_h(src_y); + u = __lasx_xvaddwev_w_h(src_u, headroom); + v = __lasx_xvaddwod_w_h(src_u, headroom); + WRITE_YUV2RGB(y_l, y_l, u, u, 0, 1, 0, 4); + WRITE_YUV2RGB(y_l, y_l, v, v, 2, 3, 0, 4); + WRITE_YUV2RGB(y_h, y_h, u, u, 0, 1, 1, 5); + WRITE_YUV2RGB(y_h, y_h, v, v, 2, 3, 1, 5); + WRITE_YUV2RGB(y_l, y_l, u, u, 4, 5, 2, 6); + WRITE_YUV2RGB(y_l, y_l, v, v, 6, 7, 2, 6); + WRITE_YUV2RGB(y_h, y_h, u, u, 4, 5, 3, 7); + WRITE_YUV2RGB(y_h, y_h, v, v, 6, 7, 3, 7); + } + if (dstW - i >= 8){ + int Y1, Y2, U, V; + int i_dex = i << 1; + __m256i src_y, src_u, src_v; + __m256i y_l, uv; + + src_y = __lasx_xvldx(buf0, i_dex); + src_u = __lasx_xvldrepl_d((ubuf0 + count), 0); + src_v = __lasx_xvldrepl_d((vbuf0 + count), 0); + src_u = __lasx_xvilvl_d(src_v, src_u); + y_l = __lasx_xvsrari_h(src_y, 7); + uv = __lasx_xvsrari_h(src_u, 7); + y_l = __lasx_vext2xv_w_h(y_l); + uv = __lasx_vext2xv_w_h(uv); + uv = __lasx_xvaddwev_w_h(uv, headroom); + WRITE_YUV2RGB(y_l, y_l, uv, uv, 0, 1, 0, 4); + WRITE_YUV2RGB(y_l, y_l, uv, uv, 2, 3, 1, 5); + WRITE_YUV2RGB(y_l, y_l, uv, uv, 4, 5, 2, 6); + WRITE_YUV2RGB(y_l, y_l, uv, uv, 6, 7, 3, 7); + i += 8; + } + for (; count < len_count; count++) { + int Y1 = (buf0[count * 2 ] + 64) >> 7; + int Y2 = (buf0[count * 2 + 1] + 64) >> 7; + int U = (ubuf0[count] + 64) >> 7; + int V = (vbuf0[count] + 64) >> 7; + + r = c->table_rV[V + YUVRGB_TABLE_HEADROOM], + g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), + b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; + + yuv2rgb_write(dest, count, Y1, Y2, 0, 0, + r, g, b, y, target, 0); + } + } else { + const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; + int count = 0; + int HEADROOM = YUVRGB_TABLE_HEADROOM; + __m256i headroom = __lasx_xvreplgr2vr_w(HEADROOM); + + for (i = 0; i < len; i += 16) { + int Y1, Y2, U, V; + int i_dex = i << 1; + int c_dex = count << 1; + __m256i src_y, src_u0, src_v0, src_u1, src_v1; + __m256i y_l, y_h, u, v; + + DUP4_ARG2(__lasx_xvldx, buf0, i_dex, ubuf0, c_dex, vbuf0, c_dex, + ubuf1, c_dex, src_y, src_u0, src_v0, src_u1); + src_v1 = __lasx_xvldx(vbuf1, c_dex); + src_u0 = __lasx_xvpermi_q(src_u0, src_v0, 0x02); + src_u1 = __lasx_xvpermi_q(src_u1, src_v1, 0x02); + src_y = __lasx_xvsrari_h(src_y, 7); + u = __lasx_xvaddwev_w_h(src_u0, src_u1); + v = __lasx_xvaddwod_w_h(src_u0, src_u1); + y_l = __lasx_xvsllwil_w_h(src_y, 0); + y_h = __lasx_xvexth_w_h(src_y); + u = __lasx_xvsrari_w(u, 8); + v = __lasx_xvsrari_w(v, 8); + u = __lasx_xvadd_w(u, headroom); + v = __lasx_xvadd_w(v, headroom); + WRITE_YUV2RGB(y_l, y_l, u, u, 0, 1, 0, 4); + WRITE_YUV2RGB(y_l, y_l, v, v, 2, 3, 0, 4); + WRITE_YUV2RGB(y_h, y_h, u, u, 0, 1, 1, 5); + WRITE_YUV2RGB(y_h, y_h, v, v, 2, 3, 1, 5); + WRITE_YUV2RGB(y_l, y_l, u, u, 4, 5, 2, 6); + WRITE_YUV2RGB(y_l, y_l, v, v, 6, 7, 2, 6); + WRITE_YUV2RGB(y_h, y_h, u, u, 4, 5, 3, 7); + WRITE_YUV2RGB(y_h, y_h, v, v, 6, 7, 3, 7); + } + if (dstW - i >= 8) { + int Y1, Y2, U, V; + int i_dex = i << 1; + __m256i src_y, src_u0, src_v0, src_u1, src_v1; + __m256i uv; + + src_y = __lasx_xvldx(buf0, i_dex); + src_u0 = __lasx_xvldrepl_d((ubuf0 + count), 0); + src_v0 = __lasx_xvldrepl_d((vbuf0 + count), 0); + src_u1 = __lasx_xvldrepl_d((ubuf1 + count), 0); + src_v1 = __lasx_xvldrepl_d((vbuf1 + count), 0); + + src_u0 = __lasx_xvilvl_h(src_u1, src_u0); + src_v0 = __lasx_xvilvl_h(src_v1, src_v0); + src_u0 = __lasx_xvpermi_q(src_u0, src_v0, 0x02); + src_y = __lasx_xvsrari_h(src_y, 7); + uv = __lasx_xvhaddw_w_h(src_u0, src_u0); + src_y = __lasx_vext2xv_w_h(src_y); + uv = __lasx_xvsrari_w(uv, 8); + uv = __lasx_xvadd_w(uv, headroom); + WRITE_YUV2RGB(src_y, src_y, uv, uv, 0, 1, 0, 4); + WRITE_YUV2RGB(src_y, src_y, uv, uv, 2, 3, 1, 5); + WRITE_YUV2RGB(src_y, src_y, uv, uv, 4, 5, 2, 6); + WRITE_YUV2RGB(src_y, src_y, uv, uv, 6, 7, 3, 7); + i += 8; + } + for (; count < len_count; count++) { + int Y1 = (buf0[count * 2 ] + 64) >> 7; + int Y2 = (buf0[count * 2 + 1] + 64) >> 7; + int U = (ubuf0[count] + ubuf1[count] + 128) >> 8; + int V = (vbuf0[count] + vbuf1[count] + 128) >> 8; + + r = c->table_rV[V + YUVRGB_TABLE_HEADROOM], + g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), + b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; + + yuv2rgb_write(dest, count, Y1, Y2, 0, 0, + r, g, b, y, target, 0); + } + } +} + +#define YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \ +static void name ## ext ## _X_lasx(SwsContext *c, const int16_t *lumFilter, \ + const int16_t **lumSrc, int lumFilterSize, \ + const int16_t *chrFilter, const int16_t **chrUSrc, \ + const int16_t **chrVSrc, int chrFilterSize, \ + const int16_t **alpSrc, uint8_t *dest, int dstW, \ + int y) \ +{ \ + name ## base ## _X_template_lasx(c, lumFilter, lumSrc, lumFilterSize, \ + chrFilter, chrUSrc, chrVSrc, chrFilterSize, \ + alpSrc, dest, dstW, y, fmt, hasAlpha); \ +} + +#define YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \ +YUV2RGBWRAPPERX(name, base, ext, fmt, hasAlpha) \ +static void name ## ext ## _2_lasx(SwsContext *c, const int16_t *buf[2], \ + const int16_t *ubuf[2], const int16_t *vbuf[2], \ + const int16_t *abuf[2], uint8_t *dest, int dstW, \ + int yalpha, int uvalpha, int y) \ +{ \ + name ## base ## _2_template_lasx(c, buf, ubuf, vbuf, abuf, dest, \ + dstW, yalpha, uvalpha, y, fmt, hasAlpha); \ +} + +#define YUV2RGBWRAPPER(name, base, ext, fmt, hasAlpha) \ +YUV2RGBWRAPPERX2(name, base, ext, fmt, hasAlpha) \ +static void name ## ext ## _1_lasx(SwsContext *c, const int16_t *buf0, \ + const int16_t *ubuf[2], const int16_t *vbuf[2], \ + const int16_t *abuf0, uint8_t *dest, int dstW, \ + int uvalpha, int y) \ +{ \ + name ## base ## _1_template_lasx(c, buf0, ubuf, vbuf, abuf0, dest, \ + dstW, uvalpha, y, fmt, hasAlpha); \ +} + + +#if CONFIG_SMALL +#else +#if CONFIG_SWSCALE_ALPHA +#endif +YUV2RGBWRAPPER(yuv2rgb,, x32_1, AV_PIX_FMT_RGB32_1, 0) +YUV2RGBWRAPPER(yuv2rgb,, x32, AV_PIX_FMT_RGB32, 0) +#endif +YUV2RGBWRAPPER(yuv2, rgb, rgb24, AV_PIX_FMT_RGB24, 0) +YUV2RGBWRAPPER(yuv2, rgb, bgr24, AV_PIX_FMT_BGR24, 0) +YUV2RGBWRAPPER(yuv2rgb,, 16, AV_PIX_FMT_RGB565, 0) +YUV2RGBWRAPPER(yuv2rgb,, 15, AV_PIX_FMT_RGB555, 0) +YUV2RGBWRAPPER(yuv2rgb,, 12, AV_PIX_FMT_RGB444, 0) +YUV2RGBWRAPPER(yuv2rgb,, 8, AV_PIX_FMT_RGB8, 0) +YUV2RGBWRAPPER(yuv2rgb,, 4, AV_PIX_FMT_RGB4, 0) +YUV2RGBWRAPPER(yuv2rgb,, 4b, AV_PIX_FMT_RGB4_BYTE, 0) + +// This function is copied from libswscale/output.c +static av_always_inline void yuv2rgb_write_full(SwsContext *c, + uint8_t *dest, int i, int R, int A, int G, int B, + int y, enum AVPixelFormat target, int hasAlpha, int err[4]) +{ + int isrgb8 = target == AV_PIX_FMT_BGR8 || target == AV_PIX_FMT_RGB8; + + if ((R | G | B) & 0xC0000000) { + R = av_clip_uintp2(R, 30); + G = av_clip_uintp2(G, 30); + B = av_clip_uintp2(B, 30); + } + + switch(target) { + case AV_PIX_FMT_ARGB: + dest[0] = hasAlpha ? A : 255; + dest[1] = R >> 22; + dest[2] = G >> 22; + dest[3] = B >> 22; + break; + case AV_PIX_FMT_RGB24: + dest[0] = R >> 22; + dest[1] = G >> 22; + dest[2] = B >> 22; + break; + case AV_PIX_FMT_RGBA: + dest[0] = R >> 22; + dest[1] = G >> 22; + dest[2] = B >> 22; + dest[3] = hasAlpha ? A : 255; + break; + case AV_PIX_FMT_ABGR: + dest[0] = hasAlpha ? A : 255; + dest[1] = B >> 22; + dest[2] = G >> 22; + dest[3] = R >> 22; + break; + case AV_PIX_FMT_BGR24: + dest[0] = B >> 22; + dest[1] = G >> 22; + dest[2] = R >> 22; + break; + case AV_PIX_FMT_BGRA: + dest[0] = B >> 22; + dest[1] = G >> 22; + dest[2] = R >> 22; + dest[3] = hasAlpha ? A : 255; + break; + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB8: + { + int r,g,b; + + switch (c->dither) { + default: + case SWS_DITHER_AUTO: + case SWS_DITHER_ED: + R >>= 22; + G >>= 22; + B >>= 22; + R += (7*err[0] + 1*c->dither_error[0][i] + 5*c->dither_error[0][i+1] + 3*c->dither_error[0][i+2])>>4; + G += (7*err[1] + 1*c->dither_error[1][i] + 5*c->dither_error[1][i+1] + 3*c->dither_error[1][i+2])>>4; + B += (7*err[2] + 1*c->dither_error[2][i] + 5*c->dither_error[2][i+1] + 3*c->dither_error[2][i+2])>>4; + c->dither_error[0][i] = err[0]; + c->dither_error[1][i] = err[1]; + c->dither_error[2][i] = err[2]; + r = R >> (isrgb8 ? 5 : 7); + g = G >> (isrgb8 ? 5 : 6); + b = B >> (isrgb8 ? 6 : 7); + r = av_clip(r, 0, isrgb8 ? 7 : 1); + g = av_clip(g, 0, isrgb8 ? 7 : 3); + b = av_clip(b, 0, isrgb8 ? 3 : 1); + err[0] = R - r*(isrgb8 ? 36 : 255); + err[1] = G - g*(isrgb8 ? 36 : 85); + err[2] = B - b*(isrgb8 ? 85 : 255); + break; + case SWS_DITHER_A_DITHER: + if (isrgb8) { + /* see http://pippin.gimp.org/a_dither/ for details/origin */ +#define A_DITHER(u,v) (((((u)+((v)*236))*119)&0xff)) + r = (((R >> 19) + A_DITHER(i,y) -96)>>8); + g = (((G >> 19) + A_DITHER(i + 17,y) - 96)>>8); + b = (((B >> 20) + A_DITHER(i + 17*2,y) -96)>>8); + r = av_clip_uintp2(r, 3); + g = av_clip_uintp2(g, 3); + b = av_clip_uintp2(b, 2); + } else { + r = (((R >> 21) + A_DITHER(i,y)-256)>>8); + g = (((G >> 19) + A_DITHER(i + 17,y)-256)>>8); + b = (((B >> 21) + A_DITHER(i + 17*2,y)-256)>>8); + r = av_clip_uintp2(r, 1); + g = av_clip_uintp2(g, 2); + b = av_clip_uintp2(b, 1); + } + break; + case SWS_DITHER_X_DITHER: + if (isrgb8) { + /* see http://pippin.gimp.org/a_dither/ for details/origin */ +#define X_DITHER(u,v) (((((u)^((v)*237))*181)&0x1ff)/2) + r = (((R >> 19) + X_DITHER(i,y) - 96)>>8); + g = (((G >> 19) + X_DITHER(i + 17,y) - 96)>>8); + b = (((B >> 20) + X_DITHER(i + 17*2,y) - 96)>>8); + r = av_clip_uintp2(r, 3); + g = av_clip_uintp2(g, 3); + b = av_clip_uintp2(b, 2); + } else { + r = (((R >> 21) + X_DITHER(i,y)-256)>>8); + g = (((G >> 19) + X_DITHER(i + 17,y)-256)>>8); + b = (((B >> 21) + X_DITHER(i + 17*2,y)-256)>>8); + r = av_clip_uintp2(r, 1); + g = av_clip_uintp2(g, 2); + b = av_clip_uintp2(b, 1); + } + + break; + } + + if(target == AV_PIX_FMT_BGR4_BYTE) { + dest[0] = r + 2*g + 8*b; + } else if(target == AV_PIX_FMT_RGB4_BYTE) { + dest[0] = b + 2*g + 8*r; + } else if(target == AV_PIX_FMT_BGR8) { + dest[0] = r + 8*g + 64*b; + } else if(target == AV_PIX_FMT_RGB8) { + dest[0] = b + 4*g + 32*r; + } else + av_assert2(0); + break; } + } +} + +#define YUV2RGB_SETUP \ + int y_offset = c->yuv2rgb_y_offset; \ + int y_coeff = c->yuv2rgb_y_coeff; \ + int v2r_coe = c->yuv2rgb_v2r_coeff; \ + int v2g_coe = c->yuv2rgb_v2g_coeff; \ + int u2g_coe = c->yuv2rgb_u2g_coeff; \ + int u2b_coe = c->yuv2rgb_u2b_coeff; \ + __m256i offset = __lasx_xvreplgr2vr_w(y_offset); \ + __m256i coeff = __lasx_xvreplgr2vr_w(y_coeff); \ + __m256i v2r = __lasx_xvreplgr2vr_w(v2r_coe); \ + __m256i v2g = __lasx_xvreplgr2vr_w(v2g_coe); \ + __m256i u2g = __lasx_xvreplgr2vr_w(u2g_coe); \ + __m256i u2b = __lasx_xvreplgr2vr_w(u2b_coe); \ + + +#define YUV2RGB(y, u, v, R, G, B, offset, coeff, \ + y_temp, v2r, v2g, u2g, u2b) \ +{ \ + y = __lasx_xvsub_w(y, offset); \ + y = __lasx_xvmul_w(y, coeff); \ + y = __lasx_xvadd_w(y, y_temp); \ + R = __lasx_xvmadd_w(y, v, v2r); \ + v = __lasx_xvmadd_w(y, v, v2g); \ + G = __lasx_xvmadd_w(v, u, u2g); \ + B = __lasx_xvmadd_w(y, u, u2b); \ +} + +#define WRITE_FULL_A(r, g, b, a, t1, s) \ +{ \ + R = __lasx_xvpickve2gr_w(r, t1); \ + G = __lasx_xvpickve2gr_w(g, t1); \ + B = __lasx_xvpickve2gr_w(b, t1); \ + A = __lasx_xvpickve2gr_w(a, t1); \ + if (A & 0x100) \ + A = av_clip_uint8(A); \ + yuv2rgb_write_full(c, dest, i + s, R, A, G, B, y, target, hasAlpha, err);\ + dest += step; \ +} + +#define WRITE_FULL(r, g, b, t1, s) \ +{ \ + R = __lasx_xvpickve2gr_w(r, t1); \ + G = __lasx_xvpickve2gr_w(g, t1); \ + B = __lasx_xvpickve2gr_w(b, t1); \ + yuv2rgb_write_full(c, dest, i + s, R, 0, G, B, y, target, hasAlpha, err); \ + dest += step; \ +} + +static void +yuv2rgb_full_X_template_lasx(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, + int dstW, int y, enum AVPixelFormat target, + int hasAlpha) +{ + int i, j, B, G, R, A; + int step = (target == AV_PIX_FMT_RGB24 || + target == AV_PIX_FMT_BGR24) ? 3 : 4; + int err[4] = {0}; + int a_temp = 1 << 18; + int templ = 1 << 9; + int tempc = templ - (128 << 19); + int ytemp = 1 << 21; + int len = dstW - 15; + __m256i y_temp = __lasx_xvreplgr2vr_w(ytemp); + YUV2RGB_SETUP + + if( target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE + || target == AV_PIX_FMT_BGR8 || target == AV_PIX_FMT_RGB8) + step = 1; + + for (i = 0; i < len; i += 16) { + __m256i l_src, u_src, v_src; + __m256i y_ev, y_od, u_ev, u_od, v_ev, v_od, temp; + __m256i R_ev, R_od, G_ev, G_od, B_ev, B_od; + int n = i << 1; + + y_ev = y_od = __lasx_xvreplgr2vr_w(templ); + u_ev = u_od = v_ev = v_od = __lasx_xvreplgr2vr_w(tempc); + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + l_src = __lasx_xvldx(lumSrc[j], n); + y_ev = __lasx_xvmaddwev_w_h(y_ev, l_src, temp); + y_od = __lasx_xvmaddwod_w_h(y_od, l_src, temp); + } + for (j = 0; j < chrFilterSize; j++) { + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + DUP2_ARG2(__lasx_xvldx, chrUSrc[j], n, chrVSrc[j], n, + u_src, v_src); + DUP2_ARG3(__lasx_xvmaddwev_w_h, u_ev, u_src, temp, v_ev, + v_src, temp, u_ev, v_ev); + DUP2_ARG3(__lasx_xvmaddwod_w_h, u_od, u_src, temp, v_od, + v_src, temp, u_od, v_od); + } + y_ev = __lasx_xvsrai_w(y_ev, 10); + y_od = __lasx_xvsrai_w(y_od, 10); + u_ev = __lasx_xvsrai_w(u_ev, 10); + u_od = __lasx_xvsrai_w(u_od, 10); + v_ev = __lasx_xvsrai_w(v_ev, 10); + v_od = __lasx_xvsrai_w(v_od, 10); + YUV2RGB(y_ev, u_ev, v_ev, R_ev, G_ev, B_ev, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + YUV2RGB(y_od, u_od, v_od, R_od, G_od, B_od, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if (hasAlpha) { + __m256i a_src, a_ev, a_od; + + a_ev = a_od = __lasx_xvreplgr2vr_w(a_temp); + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h(lumFilter + j, 0); + a_src = __lasx_xvldx(alpSrc[j], n); + a_ev = __lasx_xvmaddwev_w_h(a_ev, a_src, temp); + a_od = __lasx_xvmaddwod_w_h(a_od, a_src, temp); + } + a_ev = __lasx_xvsrai_w(a_ev, 19); + a_od = __lasx_xvsrai_w(a_od, 19); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 0, 0); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 0, 1); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 1, 2); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 1, 3); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 2, 4); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 2, 5); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 3, 6); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 3, 7); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 4, 8); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 4, 9); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 5, 10); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 5, 11); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 6, 12); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 6, 13); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 7, 14); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 7, 15); + } else { + WRITE_FULL(R_ev, G_ev, B_ev, 0, 0); + WRITE_FULL(R_od, G_od, B_od, 0, 1); + WRITE_FULL(R_ev, G_ev, B_ev, 1, 2); + WRITE_FULL(R_od, G_od, B_od, 1, 3); + WRITE_FULL(R_ev, G_ev, B_ev, 2, 4); + WRITE_FULL(R_od, G_od, B_od, 2, 5); + WRITE_FULL(R_ev, G_ev, B_ev, 3, 6); + WRITE_FULL(R_od, G_od, B_od, 3, 7); + WRITE_FULL(R_ev, G_ev, B_ev, 4, 8); + WRITE_FULL(R_od, G_od, B_od, 4, 9); + WRITE_FULL(R_ev, G_ev, B_ev, 5, 10); + WRITE_FULL(R_od, G_od, B_od, 5, 11); + WRITE_FULL(R_ev, G_ev, B_ev, 6, 12); + WRITE_FULL(R_od, G_od, B_od, 6, 13); + WRITE_FULL(R_ev, G_ev, B_ev, 7, 14); + WRITE_FULL(R_od, G_od, B_od, 7, 15); + } + } + if (dstW - i >= 8) { + __m256i l_src, u_src, v_src; + __m256i y_ev, u_ev, v_ev, uv, temp; + __m256i R_ev, G_ev, B_ev; + int n = i << 1; + + y_ev = __lasx_xvreplgr2vr_w(templ); + u_ev = v_ev = __lasx_xvreplgr2vr_w(tempc); + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h((lumFilter + j), 0); + l_src = __lasx_xvldx(lumSrc[j], n); + l_src = __lasx_xvpermi_d(l_src, 0xD8); + l_src = __lasx_xvilvl_h(l_src, l_src); + y_ev = __lasx_xvmaddwev_w_h(y_ev, l_src, temp); + } + for (j = 0; j < chrFilterSize; j++) { + temp = __lasx_xvldrepl_h((chrFilter + j), 0); + DUP2_ARG2(__lasx_xvldx, chrUSrc[j], n, chrVSrc[j], n, u_src, v_src); + u_src = __lasx_xvpermi_d(u_src, 0xD8); + v_src = __lasx_xvpermi_d(v_src, 0xD8); + uv = __lasx_xvilvl_h(v_src, u_src); + u_ev = __lasx_xvmaddwev_w_h(u_ev, uv, temp); + v_ev = __lasx_xvmaddwod_w_h(v_ev, uv, temp); + } + y_ev = __lasx_xvsrai_w(y_ev, 10); + u_ev = __lasx_xvsrai_w(u_ev, 10); + v_ev = __lasx_xvsrai_w(v_ev, 10); + YUV2RGB(y_ev, u_ev, v_ev, R_ev, G_ev, B_ev, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if (hasAlpha) { + __m256i a_src, a_ev; + + a_ev = __lasx_xvreplgr2vr_w(a_temp); + for (j = 0; j < lumFilterSize; j++) { + temp = __lasx_xvldrepl_h(lumFilter + j, 0); + a_src = __lasx_xvldx(alpSrc[j], n); + a_src = __lasx_xvpermi_d(a_src, 0xD8); + a_src = __lasx_xvilvl_h(a_src, a_src); + a_ev = __lasx_xvmaddwev_w_h(a_ev, a_src, temp); + } + a_ev = __lasx_xvsrai_w(a_ev, 19); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 0, 0); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 1, 1); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 2, 2); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 3, 3); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 4, 4); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 5, 5); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 6, 6); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 7, 7); + } else { + WRITE_FULL(R_ev, G_ev, B_ev, 0, 0); + WRITE_FULL(R_ev, G_ev, B_ev, 1, 1); + WRITE_FULL(R_ev, G_ev, B_ev, 2, 2); + WRITE_FULL(R_ev, G_ev, B_ev, 3, 3); + WRITE_FULL(R_ev, G_ev, B_ev, 4, 4); + WRITE_FULL(R_ev, G_ev, B_ev, 5, 5); + WRITE_FULL(R_ev, G_ev, B_ev, 6, 6); + WRITE_FULL(R_ev, G_ev, B_ev, 7, 7); + } + i += 8; + } + for (; i < dstW; i++) { + int Y = templ; + int V, U = V = tempc; + + A = 0; + for (j = 0; j < lumFilterSize; j++) { + Y += lumSrc[j][i] * lumFilter[j]; + } + for (j = 0; j < chrFilterSize; j++) { + U += chrUSrc[j][i] * chrFilter[j]; + V += chrVSrc[j][i] * chrFilter[j]; + + } + Y >>= 10; + U >>= 10; + V >>= 10; + if (hasAlpha) { + A = 1 << 18; + for (j = 0; j < lumFilterSize; j++) { + A += alpSrc[j][i] * lumFilter[j]; + } + A >>= 19; + if (A & 0x100) + A = av_clip_uint8(A); + } + Y -= y_offset; + Y *= y_coeff; + Y += ytemp; + R = (unsigned)Y + V * v2r_coe; + G = (unsigned)Y + V * v2g_coe + U * u2g_coe; + B = (unsigned)Y + U * u2b_coe; + yuv2rgb_write_full(c, dest, i, R, A, G, B, y, target, hasAlpha, err); + dest += step; + } + c->dither_error[0][i] = err[0]; + c->dither_error[1][i] = err[1]; + c->dither_error[2][i] = err[2]; +} + +static void +yuv2rgb_full_2_template_lasx(SwsContext *c, const int16_t *buf[2], + const int16_t *ubuf[2], const int16_t *vbuf[2], + const int16_t *abuf[2], uint8_t *dest, int dstW, + int yalpha, int uvalpha, int y, + enum AVPixelFormat target, int hasAlpha) +{ + const int16_t *buf0 = buf[0], *buf1 = buf[1], + *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], + *vbuf0 = vbuf[0], *vbuf1 = vbuf[1], + *abuf0 = hasAlpha ? abuf[0] : NULL, + *abuf1 = hasAlpha ? abuf[1] : NULL; + int yalpha1 = 4096 - yalpha; + int uvalpha1 = 4096 - uvalpha; + int uvtemp = 128 << 19; + int atemp = 1 << 18; + int err[4] = {0}; + int ytemp = 1 << 21; + int len = dstW - 15; + int i, R, G, B, A; + int step = (target == AV_PIX_FMT_RGB24 || + target == AV_PIX_FMT_BGR24) ? 3 : 4; + __m256i v_uvalpha1 = __lasx_xvreplgr2vr_w(uvalpha1); + __m256i v_yalpha1 = __lasx_xvreplgr2vr_w(yalpha1); + __m256i v_uvalpha = __lasx_xvreplgr2vr_w(uvalpha); + __m256i v_yalpha = __lasx_xvreplgr2vr_w(yalpha); + __m256i uv = __lasx_xvreplgr2vr_w(uvtemp); + __m256i a_bias = __lasx_xvreplgr2vr_w(atemp); + __m256i y_temp = __lasx_xvreplgr2vr_w(ytemp); + YUV2RGB_SETUP + + av_assert2(yalpha <= 4096U); + av_assert2(uvalpha <= 4096U); + + if( target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE + || target == AV_PIX_FMT_BGR8 || target == AV_PIX_FMT_RGB8) + step = 1; + + for (i = 0; i < len; i += 16) { + __m256i b0, b1, ub0, ub1, vb0, vb1; + __m256i y0_l, y0_h, y1_l, y1_h, u0_l, u0_h; + __m256i v0_l, v0_h, u1_l, u1_h, v1_l, v1_h; + __m256i y_l, y_h, v_l, v_h, u_l, u_h; + __m256i R_l, R_h, G_l, G_h, B_l, B_h; + int n = i << 1; + + DUP4_ARG2(__lasx_xvldx, buf0, n, buf1, n, ubuf0, + n, ubuf1, n, b0, b1, ub0, ub1); + DUP2_ARG2(__lasx_xvldx, vbuf0, n, vbuf1, n, vb0 , vb1); + DUP2_ARG2(__lasx_xvsllwil_w_h, b0, 0, b1, 0, y0_l, y1_l); + DUP4_ARG2(__lasx_xvsllwil_w_h, ub0, 0, ub1, 0, vb0, 0, vb1, 0, + u0_l, u1_l, v0_l, v1_l); + DUP2_ARG1(__lasx_xvexth_w_h, b0, b1, y0_h, y1_h); + DUP4_ARG1(__lasx_xvexth_w_h, ub0, ub1, vb0, vb1, + u0_h, u1_h, v0_h, v1_h); + y0_l = __lasx_xvmul_w(y0_l, v_yalpha1); + y0_h = __lasx_xvmul_w(y0_h, v_yalpha1); + u0_l = __lasx_xvmul_w(u0_l, v_uvalpha1); + u0_h = __lasx_xvmul_w(u0_h, v_uvalpha1); + v0_l = __lasx_xvmul_w(v0_l, v_uvalpha1); + v0_h = __lasx_xvmul_w(v0_h, v_uvalpha1); + y_l = __lasx_xvmadd_w(y0_l, v_yalpha, y1_l); + y_h = __lasx_xvmadd_w(y0_h, v_yalpha, y1_h); + u_l = __lasx_xvmadd_w(u0_l, v_uvalpha, u1_l); + u_h = __lasx_xvmadd_w(u0_h, v_uvalpha, u1_h); + v_l = __lasx_xvmadd_w(v0_l, v_uvalpha, v1_l); + v_h = __lasx_xvmadd_w(v0_h, v_uvalpha, v1_h); + u_l = __lasx_xvsub_w(u_l, uv); + u_h = __lasx_xvsub_w(u_h, uv); + v_l = __lasx_xvsub_w(v_l, uv); + v_h = __lasx_xvsub_w(v_h, uv); + y_l = __lasx_xvsrai_w(y_l, 10); + y_h = __lasx_xvsrai_w(y_h, 10); + u_l = __lasx_xvsrai_w(u_l, 10); + u_h = __lasx_xvsrai_w(u_h, 10); + v_l = __lasx_xvsrai_w(v_l, 10); + v_h = __lasx_xvsrai_w(v_h, 10); + YUV2RGB(y_l, u_l, v_l, R_l, G_l, B_l, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + YUV2RGB(y_h, u_h, v_h, R_h, G_h, B_h, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if (hasAlpha) { + __m256i a0, a1, a0_l, a0_h; + __m256i a_l, a_h, a1_l, a1_h; + + DUP2_ARG2(__lasx_xvldx, abuf0, n, abuf1, n, a0, a1); + DUP2_ARG2(__lasx_xvsllwil_w_h, a0, 0, a1, 0, a0_l, a1_l); + DUP2_ARG1(__lasx_xvexth_w_h, a0, a1, a0_h, a1_h); + a_l = __lasx_xvmadd_w(a_bias, a0_l, v_yalpha1); + a_h = __lasx_xvmadd_w(a_bias, a0_h, v_yalpha1); + a_l = __lasx_xvmadd_w(a_l, v_yalpha, a1_l); + a_h = __lasx_xvmadd_w(a_h, v_yalpha, a1_h); + a_l = __lasx_xvsrai_w(a_l, 19); + a_h = __lasx_xvsrai_w(a_h, 19); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 0, 0); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 1, 1); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 2, 2); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 3, 3); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 0, 4); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 1, 5); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 2, 6); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 3, 7); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 4, 8); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 5, 9); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 6, 10); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 7, 11); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 4, 12); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 5, 13); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 6, 14); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 7, 15); + } else { + WRITE_FULL(R_l, G_l, B_l, 0, 0); + WRITE_FULL(R_l, G_l, B_l, 1, 1); + WRITE_FULL(R_l, G_l, B_l, 2, 2); + WRITE_FULL(R_l, G_l, B_l, 3, 3); + WRITE_FULL(R_h, G_h, B_h, 0, 4); + WRITE_FULL(R_h, G_h, B_h, 1, 5); + WRITE_FULL(R_h, G_h, B_h, 2, 6); + WRITE_FULL(R_h, G_h, B_h, 3, 7); + WRITE_FULL(R_l, G_l, B_l, 4, 8); + WRITE_FULL(R_l, G_l, B_l, 5, 9); + WRITE_FULL(R_l, G_l, B_l, 6, 10); + WRITE_FULL(R_l, G_l, B_l, 7, 11); + WRITE_FULL(R_h, G_h, B_h, 4, 12); + WRITE_FULL(R_h, G_h, B_h, 5, 13); + WRITE_FULL(R_h, G_h, B_h, 6, 14); + WRITE_FULL(R_h, G_h, B_h, 7, 15); + } + } + if (dstW - i >= 8) { + __m256i b0, b1, ub0, ub1, vb0, vb1; + __m256i y0_l, y1_l, u0_l; + __m256i v0_l, u1_l, v1_l; + __m256i y_l, u_l, v_l; + __m256i R_l, G_l, B_l; + int n = i << 1; + + DUP4_ARG2(__lasx_xvldx, buf0, n, buf1, n, ubuf0, n, + ubuf1, n, b0, b1, ub0, ub1); + DUP2_ARG2(__lasx_xvldx, vbuf0, n, vbuf1, n, vb0, vb1); + DUP2_ARG1(__lasx_vext2xv_w_h, b0, b1, y0_l, y1_l); + DUP4_ARG1(__lasx_vext2xv_w_h, ub0, ub1, vb0, vb1, + u0_l, u1_l, v0_l, v1_l); + y0_l = __lasx_xvmul_w(y0_l, v_yalpha1); + u0_l = __lasx_xvmul_w(u0_l, v_uvalpha1); + v0_l = __lasx_xvmul_w(v0_l, v_uvalpha1); + y_l = __lasx_xvmadd_w(y0_l, v_yalpha, y1_l); + u_l = __lasx_xvmadd_w(u0_l, v_uvalpha, u1_l); + v_l = __lasx_xvmadd_w(v0_l, v_uvalpha, v1_l); + u_l = __lasx_xvsub_w(u_l, uv); + v_l = __lasx_xvsub_w(v_l, uv); + y_l = __lasx_xvsrai_w(y_l, 10); + u_l = __lasx_xvsrai_w(u_l, 10); + v_l = __lasx_xvsrai_w(v_l, 10); + YUV2RGB(y_l, u_l, v_l, R_l, G_l, B_l, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if (hasAlpha) { + __m256i a0, a1, a0_l; + __m256i a_l, a1_l; + + DUP2_ARG2(__lasx_xvldx, abuf0, n, abuf1, n, a0, a1); + DUP2_ARG1(__lasx_vext2xv_w_h, a0, a1, a0_l, a1_l); + a_l = __lasx_xvmadd_w(a_bias, a0_l, v_yalpha1); + a_l = __lasx_xvmadd_w(a_l, v_yalpha, a1_l); + a_l = __lasx_xvsrai_w(a_l, 19); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 0, 0); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 1, 1); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 2, 2); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 3, 3); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 4, 4); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 5, 5); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 6, 6); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 7, 7); + } else { + WRITE_FULL(R_l, G_l, B_l, 0, 0); + WRITE_FULL(R_l, G_l, B_l, 1, 1); + WRITE_FULL(R_l, G_l, B_l, 2, 2); + WRITE_FULL(R_l, G_l, B_l, 3, 3); + WRITE_FULL(R_l, G_l, B_l, 4, 4); + WRITE_FULL(R_l, G_l, B_l, 5, 5); + WRITE_FULL(R_l, G_l, B_l, 6, 6); + WRITE_FULL(R_l, G_l, B_l, 7, 7); + } + i += 8; + } + for (; i < dstW; i++){ + int Y = ( buf0[i] * yalpha1 + buf1[i] * yalpha ) >> 10; + int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha- uvtemp) >> 10; + int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha- uvtemp) >> 10; + + A = 0; + if (hasAlpha){ + A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha + atemp) >> 19; + if (A & 0x100) + A = av_clip_uint8(A); + } + + Y -= y_offset; + Y *= y_coeff; + Y += ytemp; + R = (unsigned)Y + V * v2r_coe; + G = (unsigned)Y + V * v2g_coe + U * u2g_coe; + B = (unsigned)Y + U * u2b_coe; + yuv2rgb_write_full(c, dest, i, R, A, G, B, y, target, hasAlpha, err); + dest += step; + } + c->dither_error[0][i] = err[0]; + c->dither_error[1][i] = err[1]; + c->dither_error[2][i] = err[2]; +} + +static void +yuv2rgb_full_1_template_lasx(SwsContext *c, const int16_t *buf0, + const int16_t *ubuf[2], const int16_t *vbuf[2], + const int16_t *abuf0, uint8_t *dest, int dstW, + int uvalpha, int y, enum AVPixelFormat target, + int hasAlpha) +{ + const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; + int i, B, G, R, A; + int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4; + int err[4] = {0}; + int ytemp = 1 << 21; + int bias_int = 64; + int len = dstW - 15; + __m256i y_temp = __lasx_xvreplgr2vr_w(ytemp); + YUV2RGB_SETUP + + if( target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE + || target == AV_PIX_FMT_BGR8 || target == AV_PIX_FMT_RGB8) + step = 1; + if (uvalpha < 2048) { + int uvtemp = 128 << 7; + __m256i uv = __lasx_xvreplgr2vr_w(uvtemp); + __m256i bias = __lasx_xvreplgr2vr_w(bias_int); + + for (i = 0; i < len; i += 16) { + __m256i b, ub, vb, ub_l, ub_h, vb_l, vb_h; + __m256i y_l, y_h, u_l, u_h, v_l, v_h; + __m256i R_l, R_h, G_l, G_h, B_l, B_h; + int n = i << 1; + + DUP2_ARG2(__lasx_xvldx, buf0, n, ubuf0, n, b, ub); + vb = __lasx_xvldx(vbuf0, n); + y_l = __lasx_xvsllwil_w_h(b, 2); + y_h = __lasx_xvexth_w_h(b); + DUP2_ARG2(__lasx_xvsllwil_w_h, ub, 0, vb, 0, ub_l, vb_l); + DUP2_ARG1(__lasx_xvexth_w_h, ub, vb, ub_h, vb_h); + y_h = __lasx_xvslli_w(y_h, 2); + u_l = __lasx_xvsub_w(ub_l, uv); + u_h = __lasx_xvsub_w(ub_h, uv); + v_l = __lasx_xvsub_w(vb_l, uv); + v_h = __lasx_xvsub_w(vb_h, uv); + u_l = __lasx_xvslli_w(u_l, 2); + u_h = __lasx_xvslli_w(u_h, 2); + v_l = __lasx_xvslli_w(v_l, 2); + v_h = __lasx_xvslli_w(v_h, 2); + YUV2RGB(y_l, u_l, v_l, R_l, G_l, B_l, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + YUV2RGB(y_h, u_h, v_h, R_h, G_h, B_h, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if(hasAlpha) { + __m256i a_src; + __m256i a_l, a_h; + + a_src = __lasx_xvld(abuf0 + i, 0); + a_l = __lasx_xvsllwil_w_h(a_src, 0); + a_h = __lasx_xvexth_w_h(a_src); + a_l = __lasx_xvadd_w(a_l, bias); + a_h = __lasx_xvadd_w(a_h, bias); + a_l = __lasx_xvsrai_w(a_l, 7); + a_h = __lasx_xvsrai_w(a_h, 7); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 0, 0); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 1, 1); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 2, 2); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 3, 3); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 0, 4); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 1, 5); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 2, 6); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 3, 7); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 4, 8); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 5, 9); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 6, 10); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 7, 11); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 4, 12); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 5, 13); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 6, 14); + WRITE_FULL_A(R_h, G_h, B_h, a_h, 7, 15); + } else { + WRITE_FULL(R_l, G_l, B_l, 0, 0); + WRITE_FULL(R_l, G_l, B_l, 1, 1); + WRITE_FULL(R_l, G_l, B_l, 2, 2); + WRITE_FULL(R_l, G_l, B_l, 3, 3); + WRITE_FULL(R_h, G_h, B_h, 0, 4); + WRITE_FULL(R_h, G_h, B_h, 1, 5); + WRITE_FULL(R_h, G_h, B_h, 2, 6); + WRITE_FULL(R_h, G_h, B_h, 3, 7); + WRITE_FULL(R_l, G_l, B_l, 4, 8); + WRITE_FULL(R_l, G_l, B_l, 5, 9); + WRITE_FULL(R_l, G_l, B_l, 6, 10); + WRITE_FULL(R_l, G_l, B_l, 7, 11); + WRITE_FULL(R_h, G_h, B_h, 4, 12); + WRITE_FULL(R_h, G_h, B_h, 5, 13); + WRITE_FULL(R_h, G_h, B_h, 6, 14); + WRITE_FULL(R_h, G_h, B_h, 7, 15); + } + } + if (dstW - i >= 8) { + __m256i b, ub, vb, ub_l, vb_l; + __m256i y_l, u_l, v_l; + __m256i R_l, G_l, B_l; + int n = i << 1; + + DUP2_ARG2(__lasx_xvldx, buf0, n, ubuf0, n, b, ub); + vb = __lasx_xvldx(vbuf0, n); + y_l = __lasx_vext2xv_w_h(b); + DUP2_ARG1(__lasx_vext2xv_w_h, ub, vb, ub_l, vb_l); + y_l = __lasx_xvslli_w(y_l, 2); + u_l = __lasx_xvsub_w(ub_l, uv); + v_l = __lasx_xvsub_w(vb_l, uv); + u_l = __lasx_xvslli_w(u_l, 2); + v_l = __lasx_xvslli_w(v_l, 2); + YUV2RGB(y_l, u_l, v_l, R_l, G_l, B_l, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if(hasAlpha) { + __m256i a_src, a_l; + + a_src = __lasx_xvldx(abuf0, n); + a_src = __lasx_vext2xv_w_h(a_src); + a_l = __lasx_xvadd_w(bias, a_src); + a_l = __lasx_xvsrai_w(a_l, 7); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 0, 0); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 1, 1); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 2, 2); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 3, 3); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 4, 4); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 5, 5); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 6, 6); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 7, 7); + } else { + WRITE_FULL(R_l, G_l, B_l, 0, 0); + WRITE_FULL(R_l, G_l, B_l, 1, 1); + WRITE_FULL(R_l, G_l, B_l, 2, 2); + WRITE_FULL(R_l, G_l, B_l, 3, 3); + WRITE_FULL(R_l, G_l, B_l, 4, 4); + WRITE_FULL(R_l, G_l, B_l, 5, 5); + WRITE_FULL(R_l, G_l, B_l, 6, 6); + WRITE_FULL(R_l, G_l, B_l, 7, 7); + } + i += 8; + } + for (; i < dstW; i++) { + int Y = buf0[i] << 2; + int U = (ubuf0[i] - uvtemp) << 2; + int V = (vbuf0[i] - uvtemp) << 2; + + A = 0; + if(hasAlpha) { + A = (abuf0[i] + 64) >> 7; + if (A & 0x100) + A = av_clip_uint8(A); + } + Y -= y_offset; + Y *= y_coeff; + Y += ytemp; + R = (unsigned)Y + V * v2r_coe; + G = (unsigned)Y + V * v2g_coe + U * u2g_coe; + B = (unsigned)Y + U * u2b_coe; + yuv2rgb_write_full(c, dest, i, R, A, G, B, y, target, hasAlpha, err); + dest += step; + } + } else { + const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; + int uvtemp = 128 << 8; + __m256i uv = __lasx_xvreplgr2vr_w(uvtemp); + __m256i zero = __lasx_xvldi(0); + __m256i bias = __lasx_xvreplgr2vr_h(bias_int); + + for (i = 0; i < len; i += 16) { + __m256i b, ub0, ub1, vb0, vb1; + __m256i y_ev, y_od, u_ev, u_od, v_ev, v_od; + __m256i R_ev, R_od, G_ev, G_od, B_ev, B_od; + int n = i << 1; + + DUP4_ARG2(__lasx_xvldx, buf0, n, ubuf0, n, vbuf0, n, + ubuf1, n, b, ub0, vb0, ub1); + vb1 = __lasx_xvldx(vbuf, n); + y_ev = __lasx_xvaddwev_w_h(b, zero); + y_od = __lasx_xvaddwod_w_h(b, zero); + DUP2_ARG2(__lasx_xvaddwev_w_h, ub0, vb0, ub1, vb1, u_ev, v_ev); + DUP2_ARG2(__lasx_xvaddwod_w_h, ub0, vb0, ub1, vb1, u_od, v_od); + DUP2_ARG2(__lasx_xvslli_w, y_ev, 2, y_od, 2, y_ev, y_od); + DUP4_ARG2(__lasx_xvsub_w, u_ev, uv, u_od, uv, v_ev, uv, v_od, uv, + u_ev, u_od, v_ev, v_od); + DUP4_ARG2(__lasx_xvslli_w, u_ev, 1, u_od, 1, v_ev, 1, v_od, 1, + u_ev, u_od, v_ev, v_od); + YUV2RGB(y_ev, u_ev, v_ev, R_ev, G_ev, B_ev, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + YUV2RGB(y_od, u_od, v_od, R_od, G_od, B_od, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if(hasAlpha) { + __m256i a_src; + __m256i a_ev, a_od; + + a_src = __lasx_xvld(abuf0 + i, 0); + a_ev = __lasx_xvaddwev_w_h(bias, a_src); + a_od = __lasx_xvaddwod_w_h(bias, a_src); + a_ev = __lasx_xvsrai_w(a_ev, 7); + a_od = __lasx_xvsrai_w(a_od, 7); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 0, 0); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 0, 1); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 1, 2); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 1, 3); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 2, 4); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 2, 5); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 3, 6); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 3, 7); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 4, 8); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 4, 9); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 5, 10); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 5, 11); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 6, 12); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 6, 13); + WRITE_FULL_A(R_ev, G_ev, B_ev, a_ev, 7, 14); + WRITE_FULL_A(R_od, G_od, B_od, a_od, 7, 15); + } else { + WRITE_FULL(R_ev, G_ev, B_ev, 0, 0); + WRITE_FULL(R_od, G_od, B_od, 0, 1); + WRITE_FULL(R_ev, G_ev, B_ev, 1, 2); + WRITE_FULL(R_od, G_od, B_od, 1, 3); + WRITE_FULL(R_ev, G_ev, B_ev, 2, 4); + WRITE_FULL(R_od, G_od, B_od, 2, 5); + WRITE_FULL(R_ev, G_ev, B_ev, 3, 6); + WRITE_FULL(R_od, G_od, B_od, 3, 7); + WRITE_FULL(R_ev, G_ev, B_ev, 4, 8); + WRITE_FULL(R_od, G_od, B_od, 4, 9); + WRITE_FULL(R_ev, G_ev, B_ev, 5, 10); + WRITE_FULL(R_od, G_od, B_od, 5, 11); + WRITE_FULL(R_ev, G_ev, B_ev, 6, 12); + WRITE_FULL(R_od, G_od, B_od, 6, 13); + WRITE_FULL(R_ev, G_ev, B_ev, 7, 14); + WRITE_FULL(R_od, G_od, B_od, 7, 15); + } + } + if (dstW - i >= 8) { + __m256i b, ub0, ub1, vb0, vb1; + __m256i y_l, u_l, v_l; + __m256i R_l, G_l, B_l; + int n = i << 1; + + DUP4_ARG2(__lasx_xvldx, buf0, n, ubuf0, n, vbuf0, n, + ubuf1, n, b, ub0, vb0, ub1); + vb1 = __lasx_xvldx(vbuf1, n); + y_l = __lasx_vext2xv_w_h(b); + y_l = __lasx_xvslli_w(y_l, 2); + DUP4_ARG1(__lasx_vext2xv_w_h, ub0, vb0, ub1, vb1, + ub0, vb0, ub1, vb1); + DUP2_ARG2(__lasx_xvadd_w, ub0, ub1, vb0, vb1, u_l, v_l); + u_l = __lasx_xvsub_w(u_l, uv); + v_l = __lasx_xvsub_w(v_l, uv); + u_l = __lasx_xvslli_w(u_l, 1); + v_l = __lasx_xvslli_w(v_l, 1); + YUV2RGB(y_l, u_l, v_l, R_l, G_l, B_l, offset, coeff, + y_temp, v2r, v2g, u2g, u2b); + + if(hasAlpha) { + __m256i a_src; + __m256i a_l; + + a_src = __lasx_xvld(abuf0 + i, 0); + a_src = __lasx_xvpermi_d(a_src, 0xD8); + a_src = __lasx_xvilvl_h(a_src, a_src); + a_l = __lasx_xvaddwev_w_h(bias, a_src); + a_l = __lasx_xvsrai_w(a_l, 7); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 0, 0); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 1, 1); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 2, 2); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 3, 3); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 4, 4); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 5, 5); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 6, 6); + WRITE_FULL_A(R_l, G_l, B_l, a_l, 7, 7); + } else { + WRITE_FULL(R_l, G_l, B_l, 0, 0); + WRITE_FULL(R_l, G_l, B_l, 1, 1); + WRITE_FULL(R_l, G_l, B_l, 2, 2); + WRITE_FULL(R_l, G_l, B_l, 3, 3); + WRITE_FULL(R_l, G_l, B_l, 4, 4); + WRITE_FULL(R_l, G_l, B_l, 5, 5); + WRITE_FULL(R_l, G_l, B_l, 6, 6); + WRITE_FULL(R_l, G_l, B_l, 7, 7); + } + i += 8; + } + for (; i < dstW; i++) { + int Y = buf0[i] << 2; + int U = (ubuf0[i] + ubuf1[i] - uvtemp) << 1; + int V = (vbuf0[i] + vbuf1[i] - uvtemp) << 1; + + A = 0; + if(hasAlpha) { + A = (abuf0[i] + 64) >> 7; + if (A & 0x100) + A = av_clip_uint8(A); + } + Y -= y_offset; + Y *= y_coeff; + Y += ytemp; + R = (unsigned)Y + V * v2r_coe; + G = (unsigned)Y + V * v2g_coe + U * u2g_coe; + B = (unsigned)Y + U * u2b_coe; + yuv2rgb_write_full(c, dest, i, R, A, G, B, y, target, hasAlpha, err); + dest += step; + } + } + c->dither_error[0][i] = err[0]; + c->dither_error[1][i] = err[1]; + c->dither_error[2][i] = err[2]; +} +#if CONFIG_SMALL +YUV2RGBWRAPPER(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, + CONFIG_SWSCALE_ALPHA && c->needAlpha) +YUV2RGBWRAPPER(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, + CONFIG_SWSCALE_ALPHA && c->needAlpha) +YUV2RGBWRAPPER(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, + CONFIG_SWSCALE_ALPHA && c->needAlpha) +YUV2RGBWRAPPER(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, + CONFIG_SWSCALE_ALPHA && c->needAlpha) +#else +#if CONFIG_SWSCALE_ALPHA +YUV2RGBWRAPPER(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, 1) +YUV2RGBWRAPPER(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, 1) +YUV2RGBWRAPPER(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, 1) +YUV2RGBWRAPPER(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, 1) +#endif +YUV2RGBWRAPPER(yuv2, rgb_full, bgrx32_full, AV_PIX_FMT_BGRA, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, xbgr32_full, AV_PIX_FMT_ABGR, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, rgbx32_full, AV_PIX_FMT_RGBA, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, xrgb32_full, AV_PIX_FMT_ARGB, 0) +#endif +YUV2RGBWRAPPER(yuv2, rgb_full, bgr24_full, AV_PIX_FMT_BGR24, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, rgb24_full, AV_PIX_FMT_RGB24, 0) + +YUV2RGBWRAPPER(yuv2, rgb_full, bgr4_byte_full, AV_PIX_FMT_BGR4_BYTE, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, rgb4_byte_full, AV_PIX_FMT_RGB4_BYTE, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, bgr8_full, AV_PIX_FMT_BGR8, 0) +YUV2RGBWRAPPER(yuv2, rgb_full, rgb8_full, AV_PIX_FMT_RGB8, 0) +#undef yuvTorgb +#undef yuvTorgb_setup + + +av_cold void ff_sws_init_output_loongarch(SwsContext *c) +{ + + if(c->flags & SWS_FULL_CHR_H_INT) { + switch (c->dstFormat) { + case AV_PIX_FMT_RGBA: +#if CONFIG_SMALL + c->yuv2packedX = yuv2rgba32_full_X_lasx; + c->yuv2packed2 = yuv2rgba32_full_2_lasx; + c->yuv2packed1 = yuv2rgba32_full_1_lasx; +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + c->yuv2packedX = yuv2rgba32_full_X_lasx; + c->yuv2packed2 = yuv2rgba32_full_2_lasx; + c->yuv2packed1 = yuv2rgba32_full_1_lasx; + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packedX = yuv2rgbx32_full_X_lasx; + c->yuv2packed2 = yuv2rgbx32_full_2_lasx; + c->yuv2packed1 = yuv2rgbx32_full_1_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_ARGB: +#if CONFIG_SMALL + c->yuv2packedX = yuv2argb32_full_X_lasx; + c->yuv2packed2 = yuv2argb32_full_2_lasx; + c->yuv2packed1 = yuv2argb32_full_1_lasx; +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + c->yuv2packedX = yuv2argb32_full_X_lasx; + c->yuv2packed2 = yuv2argb32_full_2_lasx; + c->yuv2packed1 = yuv2argb32_full_1_lasx; + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packedX = yuv2xrgb32_full_X_lasx; + c->yuv2packed2 = yuv2xrgb32_full_2_lasx; + c->yuv2packed1 = yuv2xrgb32_full_1_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_BGRA: +#if CONFIG_SMALL + c->yuv2packedX = yuv2bgra32_full_X_lasx; + c->yuv2packed2 = yuv2bgra32_full_2_lasx; + c->yuv2packed1 = yuv2bgra32_full_1_lasx; +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + c->yuv2packedX = yuv2bgra32_full_X_lasx; + c->yuv2packed2 = yuv2bgra32_full_2_lasx; + c->yuv2packed1 = yuv2bgra32_full_1_lasx; + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packedX = yuv2bgrx32_full_X_lasx; + c->yuv2packed2 = yuv2bgrx32_full_2_lasx; + c->yuv2packed1 = yuv2bgrx32_full_1_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_ABGR: +#if CONFIG_SMALL + c->yuv2packedX = yuv2abgr32_full_X_lasx; + c->yuv2packed2 = yuv2abgr32_full_2_lasx; + c->yuv2packed1 = yuv2abgr32_full_1_lasx; +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + c->yuv2packedX = yuv2abgr32_full_X_lasx; + c->yuv2packed2 = yuv2abgr32_full_2_lasx; + c->yuv2packed1 = yuv2abgr32_full_1_lasx; + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packedX = yuv2xbgr32_full_X_lasx; + c->yuv2packed2 = yuv2xbgr32_full_2_lasx; + c->yuv2packed1 = yuv2xbgr32_full_1_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_RGB24: + c->yuv2packedX = yuv2rgb24_full_X_lasx; + c->yuv2packed2 = yuv2rgb24_full_2_lasx; + c->yuv2packed1 = yuv2rgb24_full_1_lasx; + break; + case AV_PIX_FMT_BGR24: + c->yuv2packedX = yuv2bgr24_full_X_lasx; + c->yuv2packed2 = yuv2bgr24_full_2_lasx; + c->yuv2packed1 = yuv2bgr24_full_1_lasx; + break; + case AV_PIX_FMT_BGR4_BYTE: + c->yuv2packedX = yuv2bgr4_byte_full_X_lasx; + c->yuv2packed2 = yuv2bgr4_byte_full_2_lasx; + c->yuv2packed1 = yuv2bgr4_byte_full_1_lasx; + break; + case AV_PIX_FMT_RGB4_BYTE: + c->yuv2packedX = yuv2rgb4_byte_full_X_lasx; + c->yuv2packed2 = yuv2rgb4_byte_full_2_lasx; + c->yuv2packed1 = yuv2rgb4_byte_full_1_lasx; + break; + case AV_PIX_FMT_BGR8: + c->yuv2packedX = yuv2bgr8_full_X_lasx; + c->yuv2packed2 = yuv2bgr8_full_2_lasx; + c->yuv2packed1 = yuv2bgr8_full_1_lasx; + break; + case AV_PIX_FMT_RGB8: + c->yuv2packedX = yuv2rgb8_full_X_lasx; + c->yuv2packed2 = yuv2rgb8_full_2_lasx; + c->yuv2packed1 = yuv2rgb8_full_1_lasx; + break; + } + } else { + switch (c->dstFormat) { + case AV_PIX_FMT_RGB32: + case AV_PIX_FMT_BGR32: +#if CONFIG_SMALL +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packed1 = yuv2rgbx32_1_lasx; + c->yuv2packed2 = yuv2rgbx32_2_lasx; + c->yuv2packedX = yuv2rgbx32_X_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_RGB32_1: + case AV_PIX_FMT_BGR32_1: +#if CONFIG_SMALL +#else +#if CONFIG_SWSCALE_ALPHA + if (c->needAlpha) { + } else +#endif /* CONFIG_SWSCALE_ALPHA */ + { + c->yuv2packed1 = yuv2rgbx32_1_1_lasx; + c->yuv2packed2 = yuv2rgbx32_1_2_lasx; + c->yuv2packedX = yuv2rgbx32_1_X_lasx; + } +#endif /* !CONFIG_SMALL */ + break; + case AV_PIX_FMT_RGB24: + c->yuv2packed1 = yuv2rgb24_1_lasx; + c->yuv2packed2 = yuv2rgb24_2_lasx; + c->yuv2packedX = yuv2rgb24_X_lasx; + break; + case AV_PIX_FMT_BGR24: + c->yuv2packed1 = yuv2bgr24_1_lasx; + c->yuv2packed2 = yuv2bgr24_2_lasx; + c->yuv2packedX = yuv2bgr24_X_lasx; + break; + case AV_PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565BE: + case AV_PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565BE: + c->yuv2packed1 = yuv2rgb16_1_lasx; + c->yuv2packed2 = yuv2rgb16_2_lasx; + c->yuv2packedX = yuv2rgb16_X_lasx; + break; + case AV_PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555BE: + case AV_PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555BE: + c->yuv2packed1 = yuv2rgb15_1_lasx; + c->yuv2packed2 = yuv2rgb15_2_lasx; + c->yuv2packedX = yuv2rgb15_X_lasx; + break; + case AV_PIX_FMT_RGB444LE: + case AV_PIX_FMT_RGB444BE: + case AV_PIX_FMT_BGR444LE: + case AV_PIX_FMT_BGR444BE: + c->yuv2packed1 = yuv2rgb12_1_lasx; + c->yuv2packed2 = yuv2rgb12_2_lasx; + c->yuv2packedX = yuv2rgb12_X_lasx; + break; + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + c->yuv2packed1 = yuv2rgb8_1_lasx; + c->yuv2packed2 = yuv2rgb8_2_lasx; + c->yuv2packedX = yuv2rgb8_X_lasx; + break; + case AV_PIX_FMT_RGB4: + case AV_PIX_FMT_BGR4: + c->yuv2packed1 = yuv2rgb4_1_lasx; + c->yuv2packed2 = yuv2rgb4_2_lasx; + c->yuv2packedX = yuv2rgb4_X_lasx; + break; + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + c->yuv2packed1 = yuv2rgb4b_1_lasx; + c->yuv2packed2 = yuv2rgb4b_2_lasx; + c->yuv2packedX = yuv2rgb4b_X_lasx; + break; + } + } +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/rgb2rgb_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/rgb2rgb_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/rgb2rgb_lasx.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/rgb2rgb_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libavutil/loongarch/loongson_intrinsics.h" + +void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2, + uint8_t *dest, int width, int height, + int src1Stride, int src2Stride, int dstStride) +{ + int h; + int len = width & (0xFFFFFFF0); + + for (h = 0; h < height; h++) { + int w, index = 0; + __m256i src_1, src_2, dst; + + for (w = 0; w < len; w += 16) { + DUP2_ARG2(__lasx_xvld, src1 + w, 0, src2 + w, 0, src_1, src_2); + src_1 = __lasx_xvpermi_d(src_1, 0xD8); + src_2 = __lasx_xvpermi_d(src_2, 0xD8); + dst = __lasx_xvilvl_b(src_2, src_1); + __lasx_xvst(dst, dest + index, 0); + index += 32; + } + for (; w < width; w++) { + dest[(w << 1) + 0] = src1[w]; + dest[(w << 1) + 1] = src2[w]; + } + dest += dstStride; + src1 += src1Stride; + src2 += src2Stride; + } +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_init_loongarch.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_init_loongarch.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_init_loongarch.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_init_loongarch.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libswscale/swscale_internal.h" +#include "libswscale/rgb2rgb.h" +#include "libavutil/loongarch/cpu.h" + +av_cold void ff_sws_init_swscale_loongarch(SwsContext *c) +{ + int cpu_flags = av_get_cpu_flags(); + if (have_lasx(cpu_flags)) { + ff_sws_init_output_loongarch(c); + if (c->srcBpc == 8) { + if (c->dstBpc <= 14) { + c->hyScale = c->hcScale = ff_hscale_8_to_15_lasx; + } else { + c->hyScale = c->hcScale = ff_hscale_8_to_19_lasx; + } + } else { + c->hyScale = c->hcScale = c->dstBpc > 14 ? ff_hscale_16_to_19_lasx + : ff_hscale_16_to_15_lasx; + } + switch (c->srcFormat) { + case AV_PIX_FMT_GBRAP: + case AV_PIX_FMT_GBRP: + { + c->readChrPlanar = planar_rgb_to_uv_lasx; + c->readLumPlanar = planar_rgb_to_y_lasx; + } + break; + } + if (c->dstBpc == 8) + c->yuv2planeX = ff_yuv2planeX_8_lasx; + } +} + +av_cold void rgb2rgb_init_loongarch(void) +{ + int cpu_flags = av_get_cpu_flags(); + if (have_lasx(cpu_flags)) + interleaveBytes = ff_interleave_bytes_lasx; +} + +av_cold SwsFunc ff_yuv2rgb_init_loongarch(SwsContext *c) +{ + int cpu_flags = av_get_cpu_flags(); + if (have_lasx(cpu_flags)) { + switch (c->dstFormat) { + case AV_PIX_FMT_RGB24: + return yuv420_rgb24_lasx; + case AV_PIX_FMT_BGR24: + return yuv420_bgr24_lasx; + case AV_PIX_FMT_RGBA: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) { + break; + } else + return yuv420_rgba32_lasx; + case AV_PIX_FMT_ARGB: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) { + break; + } else + return yuv420_argb32_lasx; + case AV_PIX_FMT_BGRA: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) { + break; + } else + return yuv420_bgra32_lasx; + case AV_PIX_FMT_ABGR: + if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) { + break; + } else + return yuv420_abgr32_lasx; + } + } + return NULL; +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_lasx.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,972 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libavutil/loongarch/loongson_intrinsics.h" +#include "libavutil/intreadwrite.h" + +#define SCALE_8_16(_sh) \ +{ \ + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_d(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_d(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_d(src + filterPos[3], 0); \ + src4 = __lasx_xvldrepl_d(src + filterPos[4], 0); \ + src5 = __lasx_xvldrepl_d(src + filterPos[5], 0); \ + src6 = __lasx_xvldrepl_d(src + filterPos[6], 0); \ + src7 = __lasx_xvldrepl_d(src + filterPos[7], 0); \ + src8 = __lasx_xvldrepl_d(src + filterPos[8], 0); \ + src9 = __lasx_xvldrepl_d(src + filterPos[9], 0); \ + src10 = __lasx_xvldrepl_d(src + filterPos[10], 0); \ + src11 = __lasx_xvldrepl_d(src + filterPos[11], 0); \ + src12 = __lasx_xvldrepl_d(src + filterPos[12], 0); \ + src13 = __lasx_xvldrepl_d(src + filterPos[13], 0); \ + src14 = __lasx_xvldrepl_d(src + filterPos[14], 0); \ + src15 = __lasx_xvldrepl_d(src + filterPos[15], 0); \ + DUP4_ARG2(__lasx_xvld, filter, 0, filter, 32, filter, 64, \ + filter, 96, filter0, filter1, filter2, filter3); \ + DUP4_ARG2(__lasx_xvld, filter, 128, filter, 160, \ + filter, 192, filter, 224, filter4, \ + filter5, filter6, filter7); \ + DUP4_ARG2(__lasx_xvilvl_d, src1, src0, src3, src2, \ + src5, src4, src7, src6, src0, src2, src4, src6); \ + DUP4_ARG2(__lasx_xvilvl_d, src9, src8, src11, src10, \ + src13, src12, src15, src14, src8, src10, src12, src14); \ + DUP4_ARG1(__lasx_vext2xv_hu_bu, src0, src2, src4, src6, \ + src0, src2, src4, src6); \ + DUP4_ARG1(__lasx_vext2xv_hu_bu, src8, src10, src12, \ + src14, src8, src10, src12, src14); \ + DUP4_ARG2(__lasx_xvdp2_w_h, filter0, src0, filter1, src2, \ + filter2, src4, filter3, src6, src0, src1, src2, src3); \ + DUP4_ARG2(__lasx_xvdp2_w_h, filter4, src8, filter5, src10, \ + filter6, src12, filter7, src14, src4, src5, src6, src7);\ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src2 = __lasx_xvhaddw_d_w(src2, src2); \ + src3 = __lasx_xvhaddw_d_w(src3, src3); \ + src4 = __lasx_xvhaddw_d_w(src4, src4); \ + src5 = __lasx_xvhaddw_d_w(src5, src5); \ + src6 = __lasx_xvhaddw_d_w(src6, src6); \ + src7 = __lasx_xvhaddw_d_w(src7, src7); \ + DUP4_ARG2(__lasx_xvpickev_w, src1, src0, src3, src2, \ + src5, src4, src7, src6, src0, src1, src2, src3); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src2 = __lasx_xvhaddw_d_w(src2, src2); \ + src3 = __lasx_xvhaddw_d_w(src3, src3); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src1 = __lasx_xvpickev_w(src3, src2); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src1 = __lasx_xvsrai_w(src1, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + src1 = __lasx_xvmin_w(src1, vmax); \ + src0 = __lasx_xvperm_w(src0, shuf); \ + src1 = __lasx_xvperm_w(src1, shuf); \ + src0 = __lasx_xvpickev_h(src1, src0); \ + src0 = __lasx_xvpermi_d(src0, 0xd8); \ + __lasx_xvst(src0, dst, 0); \ + filterPos += 16; \ + filter += 128; \ + dst += 16; \ +} + +#define SCALE_8_8(_sh) \ +{ \ + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_d(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_d(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_d(src + filterPos[3], 0); \ + src4 = __lasx_xvldrepl_d(src + filterPos[4], 0); \ + src5 = __lasx_xvldrepl_d(src + filterPos[5], 0); \ + src6 = __lasx_xvldrepl_d(src + filterPos[6], 0); \ + src7 = __lasx_xvldrepl_d(src + filterPos[7], 0); \ + DUP4_ARG2(__lasx_xvld, filter, 0, filter, 32, filter, 64, \ + filter, 96, filter0, filter1, filter2, filter3); \ + filterPos += 8; \ + filter += 64; \ + DUP4_ARG2(__lasx_xvilvl_d, src1, src0, src3, src2, \ + src5, src4, src7, src6, src0, src2, src4, src6); \ + DUP4_ARG1(__lasx_vext2xv_hu_bu, src0, src2, src4, src6, \ + src0, src2, src4, src6); \ + DUP4_ARG2(__lasx_xvdp2_w_h, filter0, src0, filter1, src2, \ + filter2, src4, filter3, src6, src0, src1, src2,src3); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src2 = __lasx_xvhaddw_d_w(src2, src2); \ + src3 = __lasx_xvhaddw_d_w(src3, src3); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src1 = __lasx_xvpickev_w(src3, src2); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + src0 = __lasx_xvperm_w(src0, shuf); \ +} + +#define SCALE_8_4(_sh) \ +{ \ + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_d(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_d(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_d(src + filterPos[3], 0); \ + filter0 = __lasx_xvld(filter, 0); \ + filter1 = __lasx_xvld(filter, 32); \ + filterPos += 4; \ + filter += 32; \ + src0 = __lasx_xvilvl_d(src1, src0); \ + src2 = __lasx_xvilvl_d(src3, src2); \ + src0 = __lasx_vext2xv_hu_bu(src0); \ + src2 = __lasx_vext2xv_hu_bu(src2); \ + src0 = __lasx_xvdp2_w_h(src0, filter0); \ + src1 = __lasx_xvdp2_w_h(src2, filter1); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src0 = __lasx_xvpickev_w(src0, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + src0 = __lasx_xvperm_w(src0, shuf); \ +} + +#define SCALE_8_2(_sh) \ +{ \ + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_d(src + filterPos[1], 0); \ + filter0 = __lasx_xvld(filter, 0); \ + src0 = __lasx_xvilvl_d(src1, src0); \ + src0 = __lasx_vext2xv_hu_bu(src0); \ + src0 = __lasx_xvdp2_w_h(filter0, src0); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src0 = __lasx_xvhaddw_q_d(src0, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + dst[0] = __lasx_xvpickve2gr_w(src0, 0); \ + dst[1] = __lasx_xvpickve2gr_w(src0, 4); \ + filterPos += 2; \ + filter += 16; \ + dst += 2; \ +} + +#define SCALE_4_16(_sh) \ +{ \ + src0 = __lasx_xvldrepl_w(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_w(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_w(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_w(src + filterPos[3], 0); \ + src4 = __lasx_xvldrepl_w(src + filterPos[4], 0); \ + src5 = __lasx_xvldrepl_w(src + filterPos[5], 0); \ + src6 = __lasx_xvldrepl_w(src + filterPos[6], 0); \ + src7 = __lasx_xvldrepl_w(src + filterPos[7], 0); \ + src8 = __lasx_xvldrepl_w(src + filterPos[8], 0); \ + src9 = __lasx_xvldrepl_w(src + filterPos[9], 0); \ + src10 = __lasx_xvldrepl_w(src + filterPos[10], 0); \ + src11 = __lasx_xvldrepl_w(src + filterPos[11], 0); \ + src12 = __lasx_xvldrepl_w(src + filterPos[12], 0); \ + src13 = __lasx_xvldrepl_w(src + filterPos[13], 0); \ + src14 = __lasx_xvldrepl_w(src + filterPos[14], 0); \ + src15 = __lasx_xvldrepl_w(src + filterPos[15], 0); \ + DUP4_ARG2(__lasx_xvld, filter, 0, filter, 32, filter, 64, \ + filter, 96, filter0, filter1, filter2, filter3); \ + DUP4_ARG2(__lasx_xvilvl_w, src1, src0, src3, src2, src5, \ + src4, src7, src6, src0, src2, src4, src6); \ + DUP4_ARG2(__lasx_xvilvl_w, src9, src8, src11, src10, src13, \ + src12, src15, src14, src8, src10, src12, src14); \ + DUP4_ARG2(__lasx_xvilvl_d, src2, src0, src6, src4, src10, \ + src8, src14, src12, src0, src1, src2, src3); \ + DUP4_ARG1(__lasx_vext2xv_hu_bu, src0, src1, src2, src3, \ + src0, src1, src2, src3); \ + DUP4_ARG2(__lasx_xvdp2_w_h, filter0, src0, filter1, src1, \ + filter2, src2, filter3, src3, src0, src1, src2, src3); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src2 = __lasx_xvhaddw_d_w(src2, src2); \ + src3 = __lasx_xvhaddw_d_w(src3, src3); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src1 = __lasx_xvpickev_w(src3, src2); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src1 = __lasx_xvsrai_w(src1, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + src1 = __lasx_xvmin_w(src1, vmax); \ + src0 = __lasx_xvpickev_h(src1, src0); \ + src0 = __lasx_xvperm_w(src0, shuf); \ + __lasx_xvst(src0, dst, 0); \ + filterPos += 16; \ + filter += 64; \ + dst += 16; \ +} + +#define SCALE_4_8(_sh) \ +{ \ + src0 = __lasx_xvldrepl_w(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_w(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_w(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_w(src + filterPos[3], 0); \ + src4 = __lasx_xvldrepl_w(src + filterPos[4], 0); \ + src5 = __lasx_xvldrepl_w(src + filterPos[5], 0); \ + src6 = __lasx_xvldrepl_w(src + filterPos[6], 0); \ + src7 = __lasx_xvldrepl_w(src + filterPos[7], 0); \ + filter0 = __lasx_xvld(filter, 0); \ + filter1 = __lasx_xvld(filter, 32); \ + filterPos += 8; \ + filter += 32; \ + DUP4_ARG2(__lasx_xvilvl_w, src1, src0, src3, src2, src5, \ + src4, src7, src6, src0, src2, src4, src6); \ + src0 = __lasx_xvilvl_d(src2, src0); \ + src1 = __lasx_xvilvl_d(src6, src4); \ + \ + src0 = __lasx_vext2xv_hu_bu(src0); \ + src1 = __lasx_vext2xv_hu_bu(src1); \ + src0 = __lasx_xvdp2_w_h(filter0, src0); \ + src1 = __lasx_xvdp2_w_h(filter1, src1); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src1 = __lasx_xvhaddw_d_w(src1, src1); \ + src0 = __lasx_xvpickev_w(src1, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ +} + +#define SCALE_4_4(_sh) \ +{ \ + src0 = __lasx_xvldrepl_w(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_w(src + filterPos[1], 0); \ + src2 = __lasx_xvldrepl_w(src + filterPos[2], 0); \ + src3 = __lasx_xvldrepl_w(src + filterPos[3], 0); \ + filter0 = __lasx_xvld(filter, 0); \ + filterPos += 4; \ + filter += 16; \ + src0 = __lasx_xvilvl_w(src1, src0); \ + src1 = __lasx_xvilvl_w(src3, src2); \ + \ + src0 = __lasx_xvilvl_d(src1, src0); \ + src0 = __lasx_vext2xv_hu_bu(src0); \ + src0 = __lasx_xvdp2_w_h(filter0, src0); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + src0 = __lasx_xvpickev_w(src0, src0); \ + src0 = __lasx_xvpermi_d(src0, 0xd8); \ +} + +#define SCALE_4_2(_sh) \ +{ \ + src0 = __lasx_xvldrepl_w(src + filterPos[0], 0); \ + src1 = __lasx_xvldrepl_w(src + filterPos[1], 0); \ + filter0 = __lasx_xvld(filter, 0); \ + src0 = __lasx_xvilvl_w(src1, src0); \ + src0 = __lasx_vext2xv_hu_bu(src0); \ + src0 = __lasx_xvdp2_w_h(filter0, src0); \ + src0 = __lasx_xvhaddw_d_w(src0, src0); \ + src0 = __lasx_xvsrai_w(src0, _sh); \ + src0 = __lasx_xvmin_w(src0, vmax); \ + dst[0] = __lasx_xvpickve2gr_w(src0, 0); \ + dst[1] = __lasx_xvpickve2gr_w(src0, 2); \ + filterPos += 2; \ + filter += 8; \ + dst += 2; \ +} + +#define SCALE_16 \ +{ \ + int dex = j << 1; \ + src0 = __lasx_xvldrepl_d((srcPos1 + j), 0); \ + src1 = __lasx_xvldrepl_d((srcPos2 + j), 0); \ + src2 = __lasx_xvldrepl_d((srcPos3 + j), 0); \ + src3 = __lasx_xvldrepl_d((srcPos4 + j), 0); \ + DUP4_ARG2(__lasx_xvldx, filterStart1, dex, filterStart2, dex, \ + filterStart3, dex, filterStart4, dex, filter0, \ + filter1, filter2, filter3); \ + src0 = __lasx_xvpermi_q(src0, src1, 0x02); \ + src1 = __lasx_xvpermi_q(src2, src3, 0x02); \ + filter0 = __lasx_xvpermi_q(filter0, filter1, 0x02); \ + filter1 = __lasx_xvpermi_q(filter2, filter3, 0x02); \ + src0 = __lasx_xvilvl_b(zero, src0); \ + src1 = __lasx_xvilvl_b(zero, src1); \ + out0 = __lasx_xvdp2_w_h(filter0, src0); \ + out1 = __lasx_xvdp2_w_h(filter1, src1); \ + src0 = __lasx_xvhaddw_d_w(out0, out0); \ + src1 = __lasx_xvhaddw_d_w(out1, out1); \ + out0 = __lasx_xvpackev_d(src1, src0); \ + out1 = __lasx_xvpackod_d(src1, src0); \ + out0 = __lasx_xvadd_w(out0, out1); \ + out = __lasx_xvadd_w(out, out0); \ +} + +void ff_hscale_8_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + int i; + int max = (1 << 15) - 1; + + if (filterSize == 8) { + __m256i src0, src1, src2, src3, src4, src5, src6, src7; + __m256i src8, src9, src10, src11, src12, src13, src14, src15; + __m256i filter0, filter1, filter2, filter3; + __m256i filter4, filter5, filter6, filter7; + __m256i vmax = __lasx_xvreplgr2vr_w(max); + __m256i shuf = {0x0000000400000000, 0x0000000500000001, + 0x0000000600000002, 0x0000000700000003}; + int len = dstW >> 4; + int res = dstW & 15; + while (len--) { + SCALE_8_16(7); + } + if (res & 8) { + SCALE_8_8(7); + src0 = __lasx_xvpickev_h(src0, src0); + __lasx_xvstelm_d(src0, dst, 0, 0); + __lasx_xvstelm_d(src0, dst, 8, 2); + dst += 8; + } + if (res & 4) { + SCALE_8_4(7); + src0 = __lasx_xvpickev_h(src0, src0); + __lasx_xvstelm_d(src0, dst, 0, 0); + dst += 4; + } + if (res & 2) { + SCALE_8_2(7); + } + if (res & 1) { + int val = 0; + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); + filter0 = __lasx_xvld(filter, 0); + src0 = __lasx_vext2xv_hu_bu(src0); + src0 = __lasx_xvdp2_w_h(filter0, src0); + src0 = __lasx_xvhaddw_d_w(src0, src0); + src0 = __lasx_xvhaddw_q_d(src0, src0); + val = __lasx_xvpickve2gr_w(src0, 0); + dst[0] = FFMIN(val >> 7, max); + } + } else if (filterSize == 4) { + __m256i src0, src1, src2, src3, src4, src5, src6, src7; + __m256i src8, src9, src10, src11, src12, src13, src14, src15; + __m256i filter0, filter1, filter2, filter3; + __m256i vmax = __lasx_xvreplgr2vr_w(max); + __m256i shuf = {0x0000000400000000, 0x0000000500000001, + 0x0000000600000002, 0x0000000700000003}; + int len = dstW >> 4; + int res = dstW & 15; + while (len--) { + SCALE_4_16(7); + } + if (res & 8) { + SCALE_4_8(7); + src0 = __lasx_xvpickev_h(src1, src0); + src0 = __lasx_xvperm_w(src0, shuf); + __lasx_xvstelm_d(src0, dst, 0, 0); + __lasx_xvstelm_d(src0, dst, 8, 1); + dst += 8; + } + if (res & 4) { + SCALE_4_4(7); + src0 = __lasx_xvpickev_h(src0, src0); + __lasx_xvstelm_d(src0, dst, 0, 0); + dst += 4; + } + if (res & 2) { + SCALE_4_2(7); + } + if (res & 1) { + int val = 0; + const uint8_t *srcPos = src + filterPos[0]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[0] = FFMIN(val >> 7, max); + } + } else if (filterSize > 8) { + int filterlen = filterSize - 7; + int len = dstW >> 2; + int res = dstW & 3; + __m256i zero = __lasx_xvldi(0); + + while (len--) { + __m256i src0, src1, src2, src3; + __m256i filter0, filter1, filter2, filter3, out0, out1; + __m256i out = zero; + const uint8_t *srcPos1 = src + filterPos[0]; + const uint8_t *srcPos2 = src + filterPos[1]; + const uint8_t *srcPos3 = src + filterPos[2]; + const uint8_t *srcPos4 = src + filterPos[3]; + const int16_t *filterStart1 = filter; + const int16_t *filterStart2 = filterStart1 + filterSize; + const int16_t *filterStart3 = filterStart2 + filterSize; + const int16_t *filterStart4 = filterStart3 + filterSize; + int j, val1 = 0, val2 = 0, val3 = 0, val4 = 0; + + for (j = 0; j < filterlen; j += 8) { + SCALE_16 + } + val1 = __lasx_xvpickve2gr_w(out, 0); + val2 = __lasx_xvpickve2gr_w(out, 4); + val3 = __lasx_xvpickve2gr_w(out, 2); + val4 = __lasx_xvpickve2gr_w(out, 6); + for (; j < filterSize; j++) { + val1 += ((int)srcPos1[j]) * filterStart1[j]; + val2 += ((int)srcPos2[j]) * filterStart2[j]; + val3 += ((int)srcPos3[j]) * filterStart3[j]; + val4 += ((int)srcPos4[j]) * filterStart4[j]; + } + dst[0] = FFMIN(val1 >> 7, max); + dst[1] = FFMIN(val2 >> 7, max); + dst[2] = FFMIN(val3 >> 7, max); + dst[3] = FFMIN(val4 >> 7, max); + dst += 4; + filterPos += 4; + filter = filterStart4 + filterSize; + } + for(i = 0; i < res; i++) { + int j, val = 0; + const uint8_t *srcPos = src + filterPos[i]; + __m256i src1, filter0, out0; + + for (j = 0; j < filterlen; j += 8) { + src1 = __lasx_xvldrepl_d((srcPos + j), 0); + filter0 = __lasx_xvld(filter + j, 0); + src1 = __lasx_xvilvl_b(zero, src1); + out0 = __lasx_xvdp2_w_h(filter0, src1); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val += __lasx_xvpickve2gr_w(out0, 0); + } + for (; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> 7, max); + filter += filterSize; + } + } else { + for (i = 0; i < dstW; i++) { + int val = 0; + const uint8_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> 7, max); + filter += filterSize; + } + } +} + +void ff_hscale_8_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + int i; + int max = (1 << 19) - 1; + int32_t *dst = (int32_t *) _dst; + + if (filterSize == 8) { + __m256i src0, src1, src2, src3, src4, src5, src6, src7; + __m256i filter0, filter1, filter2, filter3; + __m256i vmax = __lasx_xvreplgr2vr_w(max); + __m256i shuf = {0x0000000400000000, 0x0000000500000001, + 0x0000000600000002, 0x0000000700000003}; + int len = dstW >> 3; + int res = dstW & 7; + while (len--) { + SCALE_8_8(3); + __lasx_xvst(src0, dst, 0); + dst += 8; + } + if (res & 4) { + SCALE_8_4(3); + __lasx_xvstelm_d(src0, dst, 0, 0); + __lasx_xvstelm_d(src0, dst, 8, 1); + dst += 4; + } + if (res & 2) { + SCALE_8_2(3); + } + if (res & 1) { + int val = 0; + __m256i src0, filter0, out0; + + src0 = __lasx_xvldrepl_d(src + filterPos[0], 0); + filter0 = __lasx_xvld(filter, 0); + src0 = __lasx_vext2xv_hu_bu(src0); + out0 = __lasx_xvdp2_w_h(filter0, src0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val = __lasx_xvpickve2gr_w(out0, 0); + dst[0] = FFMIN(val >> 3, max); + } + } else if (filterSize == 4) { + __m256i src0, src1, src2, src3, src4, src5, src6, src7; + __m256i filter0, filter1; + __m256i vmax = __lasx_xvreplgr2vr_w(max); + __m256i shuf = {0x0000000100000000, 0x0000000500000004, + 0x0000000300000002, 0x0000000700000006}; + int len = dstW >> 3; + int res = dstW & 7; + while (len--) { + SCALE_4_8(3); + src0 = __lasx_xvperm_w(src0, shuf); + __lasx_xvst(src0, dst, 0); + dst += 8; + } + if (res & 4) { + SCALE_4_4(3); + __lasx_xvstelm_d(src0, dst, 0, 0); + __lasx_xvstelm_d(src0, dst, 8, 1); + dst += 4; + } + if (res & 2) { + SCALE_4_2(3); + } + if (res & 1) { + int val = 0; + const uint8_t *srcPos = src + filterPos[0]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[0] = FFMIN(val >> 3, max); + } + } else if (filterSize > 8) { + int len = dstW >> 2; + int res = dstW & 3; + int filterlen = filterSize - 7; + __m256i zero = __lasx_xvldi(0); + + while (len--) { + __m256i src0, src1, src2, src3; + __m256i filter0, filter1, filter2, filter3, out0, out1; + __m256i out = zero; + const uint8_t *srcPos1 = src + filterPos[0]; + const uint8_t *srcPos2 = src + filterPos[1]; + const uint8_t *srcPos3 = src + filterPos[2]; + const uint8_t *srcPos4 = src + filterPos[3]; + const int16_t *filterStart1 = filter; + const int16_t *filterStart2 = filterStart1 + filterSize; + const int16_t *filterStart3 = filterStart2 + filterSize; + const int16_t *filterStart4 = filterStart3 + filterSize; + int j, val1 = 0, val2 = 0, val3 = 0, val4 = 0; + + for (j = 0; j < filterlen; j += 8) { + SCALE_16 + } + val1 = __lasx_xvpickve2gr_w(out, 0); + val2 = __lasx_xvpickve2gr_w(out, 4); + val3 = __lasx_xvpickve2gr_w(out, 2); + val4 = __lasx_xvpickve2gr_w(out, 6); + for (; j < filterSize; j++) { + val1 += ((int)srcPos1[j]) * filterStart1[j]; + val2 += ((int)srcPos2[j]) * filterStart2[j]; + val3 += ((int)srcPos3[j]) * filterStart3[j]; + val4 += ((int)srcPos4[j]) * filterStart4[j]; + } + dst[0] = FFMIN(val1 >> 3, max); + dst[1] = FFMIN(val2 >> 3, max); + dst[2] = FFMIN(val3 >> 3, max); + dst[3] = FFMIN(val4 >> 3, max); + dst += 4; + filterPos += 4; + filter = filterStart4 + filterSize; + } + for (i = 0; i < res; i++) { + int j, val = 0; + const uint8_t *srcPos = src + filterPos[i]; + __m256i src1, filter0, out0; + + for (j = 0; j < filterlen; j += 8) { + src1 = __lasx_xvldrepl_d((srcPos + j), 0); + filter0 = __lasx_xvld(filter + j, 0); + src1 = __lasx_xvilvl_b(zero, src1); + out0 = __lasx_xvdp2_w_h(filter0, src1); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val += __lasx_xvpickve2gr_w(out0, 0); + } + for (; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> 3, max); + filter += filterSize; + } + } else { + for (i = 0; i < dstW; i++) { + int val = 0; + const uint8_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> 3, max); + filter += filterSize; + } + } +} + +#undef SCALE_16 + +#define SCALE_8 \ +{ \ + __m256i src0, src1, src2, src3, filter0, filter1, out0, out1; \ + DUP4_ARG2(__lasx_xvld, src + filterPos[0], 0, src + filterPos[1], 0, \ + src + filterPos[2], 0, src + filterPos[3], 0, src0, src1, src2,\ + src3); \ + filter0 = __lasx_xvld(filter, 0); \ + filter1 = __lasx_xvld(filter, 32); \ + src0 = __lasx_xvpermi_q(src0, src1, 0x02); \ + src2 = __lasx_xvpermi_q(src2, src3, 0x02); \ + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); \ + out1 = __lasx_xvdp2_w_hu_h(src2, filter1); \ + src0 = __lasx_xvhaddw_d_w(out0, out0); \ + src1 = __lasx_xvhaddw_d_w(out1, out1); \ + out0 = __lasx_xvpackev_d(src1, src0); \ + out1 = __lasx_xvpackod_d(src1, src0); \ + out0 = __lasx_xvadd_w(out0, out1); \ + out0 = __lasx_xvsra_w(out0, shift); \ + out0 = __lasx_xvmin_w(out0, v_max); \ + dst[0] = __lasx_xvpickve2gr_w(out0, 0); \ + dst[1] = __lasx_xvpickve2gr_w(out0, 4); \ + dst[2] = __lasx_xvpickve2gr_w(out0, 2); \ + dst[3] = __lasx_xvpickve2gr_w(out0, 6); \ + filterPos += 4; \ + filter += 32; \ + dst += 4; \ +} + +#define SCALE_16 \ +{ \ + int dex = j << 1; \ + DUP4_ARG2(__lasx_xvldx, srcPos1, dex, srcPos2, dex, srcPos3, dex, \ + srcPos4, dex, src0, src1, src2, src3); \ + DUP4_ARG2(__lasx_xvldx, filterStart1, dex, filterStart2, dex, \ + filterStart3, dex, filterStart4, dex, filter0, \ + filter1, filter2, filter3); \ + src0 = __lasx_xvpermi_q(src0, src1, 0x02); \ + src1 = __lasx_xvpermi_q(src2, src3, 0x02); \ + filter0 = __lasx_xvpermi_q(filter0, filter1, 0x02); \ + filter1 = __lasx_xvpermi_q(filter2, filter3, 0x02); \ + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); \ + out1 = __lasx_xvdp2_w_hu_h(src1, filter1); \ + src0 = __lasx_xvhaddw_d_w(out0, out0); \ + src1 = __lasx_xvhaddw_d_w(out1, out1); \ + out0 = __lasx_xvpackev_d(src1, src0); \ + out1 = __lasx_xvpackod_d(src1, src0); \ + out0 = __lasx_xvadd_w(out0, out1); \ + out = __lasx_xvadd_w(out, out0); \ +} + +void ff_hscale_16_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int i; + const uint16_t *src = (const uint16_t *) _src; + int sh = desc->comp[0].depth - 1; + int max = (1 << 15) - 1; + int len = dstW >> 2; + int res = dstW & 3; + __m256i shift; + __m256i zero = __lasx_xvldi(0); + + if (sh < 15) { + sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : + (desc->comp[0].depth - 1); + } else if (desc->flags && AV_PIX_FMT_FLAG_FLOAT) { + sh = 15; + } + shift = __lasx_xvreplgr2vr_w(sh); + + if (filterSize == 8) { + __m256i v_max = __lasx_xvreplgr2vr_w(max); + for (i = 0; i < len; i++) { + SCALE_8 + } + for (i = 0; i < res; i++) { + int val = 0; + __m256i src0, filter0, out0; + + src0 = __lasx_xvld(src + filterPos[i], 0); + filter0 = __lasx_xvld(filter, 0); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val = __lasx_xvpickve2gr_w(out0, 0); + dst[i] = FFMIN(val >> sh, max); + filter += 8; + } + } else if (filterSize == 4) { + __m256i v_max = __lasx_xvreplgr2vr_w(max); + for (i = 0; i < len; i++) { + __m256i src1, src2, src3, src4, src0, filter0, out0; + + src1 = __lasx_xvldrepl_d(src + filterPos[0], 0); + src2 = __lasx_xvldrepl_d(src + filterPos[1], 0); + src3 = __lasx_xvldrepl_d(src + filterPos[2], 0); + src4 = __lasx_xvldrepl_d(src + filterPos[3], 0); + filter0 = __lasx_xvld(filter, 0); + src1 = __lasx_xvextrins_d(src1, src2, 0x10); + src3 = __lasx_xvextrins_d(src3, src4, 0x10); + src0 = __lasx_xvpermi_q(src1, src3, 0x02); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvsra_w(out0, shift); + out0 = __lasx_xvmin_w(out0, v_max); + dst[0] = __lasx_xvpickve2gr_w(out0, 0); + dst[1] = __lasx_xvpickve2gr_w(out0, 2); + dst[2] = __lasx_xvpickve2gr_w(out0, 4); + dst[3] = __lasx_xvpickve2gr_w(out0, 6); + dst += 4; + filterPos += 4; + filter += 16; + } + for (i = 0; i < res; i++) { + int val = 0; + const uint16_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += 4; + } + } else if (filterSize > 8) { + int filterlen = filterSize - 7; + + for (i = 0; i < len; i++) { + __m256i src0, src1, src2, src3; + __m256i filter0, filter1, filter2, filter3, out0, out1; + __m256i out = zero; + const uint16_t *srcPos1 = src + filterPos[0]; + const uint16_t *srcPos2 = src + filterPos[1]; + const uint16_t *srcPos3 = src + filterPos[2]; + const uint16_t *srcPos4 = src + filterPos[3]; + const int16_t *filterStart1 = filter; + const int16_t *filterStart2 = filterStart1 + filterSize; + const int16_t *filterStart3 = filterStart2 + filterSize; + const int16_t *filterStart4 = filterStart3 + filterSize; + int j, val1 = 0, val2 = 0, val3 = 0, val4 = 0; + + for (j = 0; j < filterlen; j += 8) { + SCALE_16 + } + val1 = __lasx_xvpickve2gr_w(out, 0); + val2 = __lasx_xvpickve2gr_w(out, 4); + val3 = __lasx_xvpickve2gr_w(out, 2); + val4 = __lasx_xvpickve2gr_w(out, 6); + for (; j < filterSize; j++) { + val1 += ((int)srcPos1[j]) * filterStart1[j]; + val2 += ((int)srcPos2[j]) * filterStart2[j]; + val3 += ((int)srcPos3[j]) * filterStart3[j]; + val4 += ((int)srcPos4[j]) * filterStart4[j]; + } + dst[0] = FFMIN(val1 >> sh, max); + dst[1] = FFMIN(val2 >> sh, max); + dst[2] = FFMIN(val3 >> sh, max); + dst[3] = FFMIN(val4 >> sh, max); + dst += 4; + filterPos += 4; + filter = filterStart4 + filterSize; + } + for (i = 0; i < res; i++) { + int j, val = 0; + const uint16_t *srcPos = src + filterPos[i]; + __m256i src0, filter0, out0; + + for (j = 0; j < filterlen; j += 8) { + int dex = j << 1; + src0 = __lasx_xvldx(srcPos, dex); + filter0 = __lasx_xvldx(filter, dex); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val += __lasx_xvpickve2gr_w(out0, 0); + } + for (; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += filterSize; + } + } else { + for (i = 0; i < dstW; i++) { + int val = 0; + const uint16_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += filterSize; + } + } +} + +void ff_hscale_16_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); + int i; + int32_t *dst = (int32_t *) _dst; + const uint16_t *src = (const uint16_t *) _src; + int sh = desc->comp[0].depth - 5; + int max = (1 << 19) - 1; + int len = dstW >> 2; + int res = dstW & 3; + __m256i shift; + __m256i zero = __lasx_xvldi(0); + + if ((isAnyRGB(c->srcFormat) || c->srcFormat == AV_PIX_FMT_PAL8) + && desc->comp[0].depth<16) { + sh = 9; + } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { + sh = 11; + } + shift = __lasx_xvreplgr2vr_w(sh); + + if (filterSize == 8) { + __m256i v_max = __lasx_xvreplgr2vr_w(max); + for (i = 0; i < len; i++) { + SCALE_8 + } + for (i = 0; i < res; i++) { + int val = 0; + __m256i src0, filter0, out0; + + src0 = __lasx_xvld(src + filterPos[i], 0); + filter0 = __lasx_xvld(filter, 0); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val = __lasx_xvpickve2gr_w(out0, 0); + dst[i] = FFMIN(val >> sh, max); + filter += 8; + } + } else if (filterSize == 4) { + __m256i v_max = __lasx_xvreplgr2vr_w(max); + for (i = 0; i < len; i++) { + __m256i src1, src2, src3, src4, src0, filter0, out0; + + src1 = __lasx_xvldrepl_d(src + filterPos[0], 0); + src2 = __lasx_xvldrepl_d(src + filterPos[1], 0); + src3 = __lasx_xvldrepl_d(src + filterPos[2], 0); + src4 = __lasx_xvldrepl_d(src + filterPos[3], 0); + filter0 = __lasx_xvld(filter, 0); + src1 = __lasx_xvextrins_d(src1, src2, 0x10); + src3 = __lasx_xvextrins_d(src3, src4, 0x10); + src0 = __lasx_xvpermi_q(src1, src3, 0x02); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvsra_w(out0, shift); + out0 = __lasx_xvmin_w(out0, v_max); + dst[0] = __lasx_xvpickve2gr_w(out0, 0); + dst[1] = __lasx_xvpickve2gr_w(out0, 2); + dst[2] = __lasx_xvpickve2gr_w(out0, 4); + dst[3] = __lasx_xvpickve2gr_w(out0, 6); + dst += 4; + filterPos += 4; + filter += 16; + } + for (i = 0; i < res; i++) { + int val = 0; + const uint16_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += 4; + } + } else if (filterSize > 8) { + int filterlen = filterSize - 7; + + for (i = 0; i < len; i ++) { + __m256i src0, src1, src2, src3; + __m256i filter0, filter1, filter2, filter3, out0, out1; + __m256i out = zero; + const uint16_t *srcPos1 = src + filterPos[0]; + const uint16_t *srcPos2 = src + filterPos[1]; + const uint16_t *srcPos3 = src + filterPos[2]; + const uint16_t *srcPos4 = src + filterPos[3]; + const int16_t *filterStart1 = filter; + const int16_t *filterStart2 = filterStart1 + filterSize; + const int16_t *filterStart3 = filterStart2 + filterSize; + const int16_t *filterStart4 = filterStart3 + filterSize; + int j, val1 = 0, val2 = 0, val3 = 0, val4 = 0; + + for (j = 0; j < filterlen; j += 8) { + SCALE_16 + } + val1 = __lasx_xvpickve2gr_w(out, 0); + val2 = __lasx_xvpickve2gr_w(out, 4); + val3 = __lasx_xvpickve2gr_w(out, 2); + val4 = __lasx_xvpickve2gr_w(out, 6); + for (; j < filterSize; j++) { + val1 += ((int)srcPos1[j]) * filterStart1[j]; + val2 += ((int)srcPos2[j]) * filterStart2[j]; + val3 += ((int)srcPos3[j]) * filterStart3[j]; + val4 += ((int)srcPos4[j]) * filterStart4[j]; + } + dst[0] = FFMIN(val1 >> sh, max); + dst[1] = FFMIN(val2 >> sh, max); + dst[2] = FFMIN(val3 >> sh, max); + dst[3] = FFMIN(val4 >> sh, max); + dst += 4; + filterPos += 4; + filter = filterStart4 + filterSize; + } + for (i = 0; i < res; i++) { + int j, val = 0; + const uint16_t *srcPos = src + filterPos[i]; + __m256i src0, filter0, out0; + + for (j = 0; j < filterlen; j += 8) { + int dex = j << 1; + src0 = __lasx_xvldx(srcPos, dex); + filter0 = __lasx_xvldx(filter, dex); + out0 = __lasx_xvdp2_w_hu_h(src0, filter0); + out0 = __lasx_xvhaddw_d_w(out0, out0); + out0 = __lasx_xvhaddw_q_d(out0, out0); + val += __lasx_xvpickve2gr_w(out0, 0); + } + for (; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += filterSize; + } + } else { + for (i = 0; i < dstW; i++) { + int val = 0; + const uint16_t *srcPos = src + filterPos[i]; + + for (int j = 0; j < filterSize; j++) { + val += ((int)srcPos[j]) * filter[j]; + } + dst[i] = FFMIN(val >> sh, max); + filter += filterSize; + } + } +} + +#undef SCALE_8 +#undef SCALE_16 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_loongarch.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_loongarch.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_loongarch.h 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/swscale_loongarch.h 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H +#define SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H + +#include "libswscale/swscale.h" +#include "libswscale/swscale_internal.h" + +void ff_hscale_8_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + +void ff_hscale_8_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + +void ff_hscale_16_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + +void ff_hscale_16_to_15_lasx(SwsContext *c, int16_t *dst, int dstW, + const uint8_t *_src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + +void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], + int width, int32_t *rgb2yuv, void *opq); + +void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opq); + +int yuv420_rgb24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +int yuv420_bgr24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +int yuv420_rgba32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +int yuv420_bgra32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +int yuv420_argb32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +int yuv420_abgr32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[], + int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]); + +void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2, + uint8_t *dest, int width, int height, + int src1Stride, int src2Stride, int dstStride); + +av_cold void ff_sws_init_output_loongarch(SwsContext *c); + +void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize, + const int16_t **src, uint8_t *dest, int dstW, + const uint8_t *dither, int offset); + +#endif /* SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/yuv2rgb_lasx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/yuv2rgb_lasx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/yuv2rgb_lasx.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/loongarch/yuv2rgb_lasx.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,321 @@ +/* + * Copyright (C) 2022 Loongson Technology Corporation Limited + * Contributed by Hao Chen(chenhao@loongson.cn) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "swscale_loongarch.h" +#include "libavutil/loongarch/loongson_intrinsics.h" + +#define YUV2RGB_LOAD_COE \ + /* Load x_offset */ \ + __m256i y_offset = __lasx_xvreplgr2vr_d(c->yOffset); \ + __m256i u_offset = __lasx_xvreplgr2vr_d(c->uOffset); \ + __m256i v_offset = __lasx_xvreplgr2vr_d(c->vOffset); \ + /* Load x_coeff */ \ + __m256i ug_coeff = __lasx_xvreplgr2vr_d(c->ugCoeff); \ + __m256i vg_coeff = __lasx_xvreplgr2vr_d(c->vgCoeff); \ + __m256i y_coeff = __lasx_xvreplgr2vr_d(c->yCoeff); \ + __m256i ub_coeff = __lasx_xvreplgr2vr_d(c->ubCoeff); \ + __m256i vr_coeff = __lasx_xvreplgr2vr_d(c->vrCoeff); \ + +#define LOAD_YUV_16 \ + m_y1 = __lasx_xvld(py_1, 0); \ + m_y2 = __lasx_xvld(py_2, 0); \ + m_u = __lasx_xvldrepl_d(pu, 0); \ + m_v = __lasx_xvldrepl_d(pv, 0); \ + m_u = __lasx_xvilvl_b(m_u, m_u); \ + m_v = __lasx_xvilvl_b(m_v, m_v); \ + DUP4_ARG1(__lasx_vext2xv_hu_bu, m_y1, m_y2, m_u, m_v, \ + m_y1, m_y2, m_u, m_v); \ + +/* YUV2RGB method + * The conversion method is as follows: + * R = Y' * y_coeff + V' * vr_coeff + * G = Y' * y_coeff + V' * vg_coeff + U' * ug_coeff + * B = Y' * y_coeff + U' * ub_coeff + * + * where X' = X * 8 - x_offset + * + */ + +#define YUV2RGB \ + m_y1 = __lasx_xvslli_h(m_y1, 3); \ + m_y2 = __lasx_xvslli_h(m_y2, 3); \ + m_u = __lasx_xvslli_h(m_u, 3); \ + m_v = __lasx_xvslli_h(m_v, 3); \ + m_y1 = __lasx_xvsub_h(m_y1, y_offset); \ + m_y2 = __lasx_xvsub_h(m_y2, y_offset); \ + m_u = __lasx_xvsub_h(m_u, u_offset); \ + m_v = __lasx_xvsub_h(m_v, v_offset); \ + y_1 = __lasx_xvmuh_h(m_y1, y_coeff); \ + y_2 = __lasx_xvmuh_h(m_y2, y_coeff); \ + u2g = __lasx_xvmuh_h(m_u, ug_coeff); \ + u2b = __lasx_xvmuh_h(m_u, ub_coeff); \ + v2r = __lasx_xvmuh_h(m_v, vr_coeff); \ + v2g = __lasx_xvmuh_h(m_v, vg_coeff); \ + r1 = __lasx_xvsadd_h(y_1, v2r); \ + v2g = __lasx_xvsadd_h(v2g, u2g); \ + g1 = __lasx_xvsadd_h(y_1, v2g); \ + b1 = __lasx_xvsadd_h(y_1, u2b); \ + r2 = __lasx_xvsadd_h(y_2, v2r); \ + g2 = __lasx_xvsadd_h(y_2, v2g); \ + b2 = __lasx_xvsadd_h(y_2, u2b); \ + DUP4_ARG1(__lasx_xvclip255_h, r1, g1, b1, r2, r1, g1, b1, r2); \ + DUP2_ARG1(__lasx_xvclip255_h, g2, b2, g2, b2); \ + +#define YUV2RGB_RES \ + m_y1 = __lasx_xvldrepl_d(py_1, 0); \ + m_y2 = __lasx_xvldrepl_d(py_2, 0); \ + m_u = __lasx_xvldrepl_d(pu, 0); \ + m_v = __lasx_xvldrepl_d(pv, 0); \ + m_y1 = __lasx_xvilvl_d(m_y2, m_y1); \ + m_u = __lasx_xvilvl_b(m_u, m_u); \ + m_v = __lasx_xvilvl_b(m_v, m_v); \ + m_y1 = __lasx_vext2xv_hu_bu(m_y1); \ + m_u = __lasx_vext2xv_hu_bu(m_u); \ + m_v = __lasx_vext2xv_hu_bu(m_v); \ + m_y1 = __lasx_xvslli_h(m_y1, 3); \ + m_u = __lasx_xvslli_h(m_u, 3); \ + m_v = __lasx_xvslli_h(m_v, 3); \ + m_y1 = __lasx_xvsub_h(m_y1, y_offset); \ + m_u = __lasx_xvsub_h(m_u, u_offset); \ + m_v = __lasx_xvsub_h(m_v, v_offset); \ + y_1 = __lasx_xvmuh_h(m_y1, y_coeff); \ + u2g = __lasx_xvmuh_h(m_u, ug_coeff); \ + u2b = __lasx_xvmuh_h(m_u, ub_coeff); \ + v2r = __lasx_xvmuh_h(m_v, vr_coeff); \ + v2g = __lasx_xvmuh_h(m_v, vg_coeff); \ + r1 = __lasx_xvsadd_h(y_1, v2r); \ + v2g = __lasx_xvsadd_h(v2g, u2g); \ + g1 = __lasx_xvsadd_h(y_1, v2g); \ + b1 = __lasx_xvsadd_h(y_1, u2b); \ + r1 = __lasx_xvclip255_h(r1); \ + g1 = __lasx_xvclip255_h(g1); \ + b1 = __lasx_xvclip255_h(b1); \ + +#define RGB_PACK(r, g, b, rgb_l, rgb_h) \ +{ \ + __m256i rg; \ + rg = __lasx_xvpackev_b(g, r); \ + DUP2_ARG3(__lasx_xvshuf_b, b, rg, shuf2, b, rg, shuf3, rgb_l, rgb_h); \ +} + +#define RGB32_PACK(a, r, g, b, rgb_l, rgb_h) \ +{ \ + __m256i ra, bg, tmp0, tmp1; \ + ra = __lasx_xvpackev_b(r, a); \ + bg = __lasx_xvpackev_b(b, g); \ + tmp0 = __lasx_xvilvl_h(bg, ra); \ + tmp1 = __lasx_xvilvh_h(bg, ra); \ + rgb_l = __lasx_xvpermi_q(tmp1, tmp0, 0x20); \ + rgb_h = __lasx_xvpermi_q(tmp1, tmp0, 0x31); \ +} + +#define RGB_STORE_RES(rgb_l, rgb_h, image_1, image_2) \ +{ \ + __lasx_xvstelm_d(rgb_l, image_1, 0, 0); \ + __lasx_xvstelm_d(rgb_l, image_1, 8, 1); \ + __lasx_xvstelm_d(rgb_h, image_1, 16, 0); \ + __lasx_xvstelm_d(rgb_l, image_2, 0, 2); \ + __lasx_xvstelm_d(rgb_l, image_2, 8, 3); \ + __lasx_xvstelm_d(rgb_h, image_2, 16, 2); \ +} + +#define RGB_STORE(rgb_l, rgb_h, image) \ +{ \ + __lasx_xvstelm_d(rgb_l, image, 0, 0); \ + __lasx_xvstelm_d(rgb_l, image, 8, 1); \ + __lasx_xvstelm_d(rgb_h, image, 16, 0); \ + __lasx_xvstelm_d(rgb_l, image, 24, 2); \ + __lasx_xvstelm_d(rgb_l, image, 32, 3); \ + __lasx_xvstelm_d(rgb_h, image, 40, 2); \ +} + +#define RGB32_STORE(rgb_l, rgb_h, image) \ +{ \ + __lasx_xvst(rgb_l, image, 0); \ + __lasx_xvst(rgb_h, image, 32); \ +} + +#define RGB32_STORE_RES(rgb_l, rgb_h, image_1, image_2) \ +{ \ + __lasx_xvst(rgb_l, image_1, 0); \ + __lasx_xvst(rgb_h, image_2, 0); \ +} + +#define YUV2RGBFUNC(func_name, dst_type, alpha) \ + int func_name(SwsContext *c, const uint8_t *src[], \ + int srcStride[], int srcSliceY, int srcSliceH, \ + uint8_t *dst[], int dstStride[]) \ +{ \ + int x, y, h_size, vshift, res; \ + __m256i m_y1, m_y2, m_u, m_v; \ + __m256i y_1, y_2, u2g, v2g, u2b, v2r, rgb1_l, rgb1_h; \ + __m256i rgb2_l, rgb2_h, r1, g1, b1, r2, g2, b2; \ + __m256i shuf2 = {0x0504120302100100, 0x0A18090816070614, \ + 0x0504120302100100, 0x0A18090816070614}; \ + __m256i shuf3 = {0x1E0F0E1C0D0C1A0B, 0x0101010101010101, \ + 0x1E0F0E1C0D0C1A0B, 0x0101010101010101}; \ + YUV2RGB_LOAD_COE \ + y = (c->dstW + 7) & ~7; \ + h_size = y >> 4; \ + res = y & 15; \ + \ + vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + for (y = 0; y < srcSliceH; y += 2) { \ + dst_type *image1 = (dst_type *)(dst[0] + (y + srcSliceY) * dstStride[0]);\ + dst_type *image2 = (dst_type *)(image1 + dstStride[0]);\ + const uint8_t *py_1 = src[0] + y * srcStride[0]; \ + const uint8_t *py_2 = py_1 + srcStride[0]; \ + const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ + const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ + for(x = 0; x < h_size; x++) { \ + +#define YUV2RGBFUNC32(func_name, dst_type, alpha) \ + int func_name(SwsContext *c, const uint8_t *src[], \ + int srcStride[], int srcSliceY, int srcSliceH, \ + uint8_t *dst[], int dstStride[]) \ +{ \ + int x, y, h_size, vshift, res; \ + __m256i m_y1, m_y2, m_u, m_v; \ + __m256i y_1, y_2, u2g, v2g, u2b, v2r, rgb1_l, rgb1_h; \ + __m256i rgb2_l, rgb2_h, r1, g1, b1, r2, g2, b2; \ + __m256i a = __lasx_xvldi(0xFF); \ + \ + YUV2RGB_LOAD_COE \ + y = (c->dstW + 7) & ~7; \ + h_size = y >> 4; \ + res = y & 15; \ + \ + vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + for (y = 0; y < srcSliceH; y += 2) { \ + int yd = y + srcSliceY; \ + dst_type av_unused *r, *g, *b; \ + dst_type *image1 = (dst_type *)(dst[0] + (yd) * dstStride[0]); \ + dst_type *image2 = (dst_type *)(dst[0] + (yd + 1) * dstStride[0]); \ + const uint8_t *py_1 = src[0] + y * srcStride[0]; \ + const uint8_t *py_2 = py_1 + srcStride[0]; \ + const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ + const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ + for(x = 0; x < h_size; x++) { \ + +#define DEALYUV2RGBREMAIN \ + py_1 += 16; \ + py_2 += 16; \ + pu += 8; \ + pv += 8; \ + image1 += 48; \ + image2 += 48; \ + } \ + if (res) { \ + +#define DEALYUV2RGBREMAIN32 \ + py_1 += 16; \ + py_2 += 16; \ + pu += 8; \ + pv += 8; \ + image1 += 16; \ + image2 += 16; \ + } \ + if (res) { \ + + +#define END_FUNC() \ + } \ + } \ + return srcSliceH; \ +} + +YUV2RGBFUNC(yuv420_rgb24_lasx, uint8_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB_PACK(r1, g1, b1, rgb1_l, rgb1_h); + RGB_PACK(r2, g2, b2, rgb2_l, rgb2_h); + RGB_STORE(rgb1_l, rgb1_h, image1); + RGB_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN + YUV2RGB_RES + RGB_PACK(r1, g1, b1, rgb1_l, rgb1_h); + RGB_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() + +YUV2RGBFUNC(yuv420_bgr24_lasx, uint8_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB_PACK(b1, g1, r1, rgb1_l, rgb1_h); + RGB_PACK(b2, g2, r2, rgb2_l, rgb2_h); + RGB_STORE(rgb1_l, rgb1_h, image1); + RGB_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN + YUV2RGB_RES + RGB_PACK(b1, g1, r1, rgb1_l, rgb1_h); + RGB_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() + +YUV2RGBFUNC32(yuv420_rgba32_lasx, uint32_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB32_PACK(r1, g1, b1, a, rgb1_l, rgb1_h); + RGB32_PACK(r2, g2, b2, a, rgb2_l, rgb2_h); + RGB32_STORE(rgb1_l, rgb1_h, image1); + RGB32_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN32 + YUV2RGB_RES + RGB32_PACK(r1, g1, b1, a, rgb1_l, rgb1_h); + RGB32_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() + +YUV2RGBFUNC32(yuv420_bgra32_lasx, uint32_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB32_PACK(b1, g1, r1, a, rgb1_l, rgb1_h); + RGB32_PACK(b2, g2, r2, a, rgb2_l, rgb2_h); + RGB32_STORE(rgb1_l, rgb1_h, image1); + RGB32_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN32 + YUV2RGB_RES + RGB32_PACK(b1, g1, r1, a, rgb1_l, rgb1_h); + RGB32_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() + +YUV2RGBFUNC32(yuv420_argb32_lasx, uint32_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB32_PACK(a, r1, g1, b1, rgb1_l, rgb1_h); + RGB32_PACK(a, r2, g2, b2, rgb2_l, rgb2_h); + RGB32_STORE(rgb1_l, rgb1_h, image1); + RGB32_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN32 + YUV2RGB_RES + RGB32_PACK(a, r1, g1, b1, rgb1_l, rgb1_h); + RGB32_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() + +YUV2RGBFUNC32(yuv420_abgr32_lasx, uint32_t, 0) + LOAD_YUV_16 + YUV2RGB + RGB32_PACK(a, b1, g1, r1, rgb1_l, rgb1_h); + RGB32_PACK(a, b2, g2, r2, rgb2_l, rgb2_h); + RGB32_STORE(rgb1_l, rgb1_h, image1); + RGB32_STORE(rgb2_l, rgb2_h, image2); + DEALYUV2RGBREMAIN32 + YUV2RGB_RES + RGB32_PACK(a, b1, g1, r1, rgb1_l, rgb1_h); + RGB32_STORE_RES(rgb1_l, rgb1_h, image1, image2); + END_FUNC() diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -9,6 +9,7 @@ hscale.o \ hscale_fast_bilinear.o \ gamma.o \ + half2float.o \ input.o \ options.o \ output.o \ @@ -25,7 +26,7 @@ SHLIBOBJS += log2_tab.o # Windows resource file -SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o +SHLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o TESTPROGS = colorspace \ floatimg_cmp \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/output.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/output.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/output.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/output.c 2023-03-03 13:29:59.000000000 +0000 @@ -133,6 +133,11 @@ }; #endif +#define IS_BE_LE 0 +#define IS_BE_BE 1 +/* ENDIAN_IDENTIFIER needs to be "BE" or "LE". */ +#define IS_BE(ENDIAN_IDENTIFIER) IS_BE_ ## ENDIAN_IDENTIFIER + #define output_pixel(pos, val, bias, signedness) \ if (big_endian) { \ AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \ @@ -460,17 +465,18 @@ #define output_pixel(pos, val) \ if (big_endian) { \ - AV_WB16(pos, av_clip_uintp2(val >> shift, 10) << 6); \ + AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \ } else { \ - AV_WL16(pos, av_clip_uintp2(val >> shift, 10) << 6); \ + AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits) << output_shift); \ } -static void yuv2p010l1_c(const int16_t *src, +static void yuv2p01xl1_c(const int16_t *src, uint16_t *dest, int dstW, - int big_endian) + int big_endian, int output_bits) { int i; - int shift = 5; + int shift = 15 - output_bits; + int output_shift = 16 - output_bits; for (i = 0; i < dstW; i++) { int val = src[i] + (1 << (shift - 1)); @@ -478,12 +484,13 @@ } } -static void yuv2p010lX_c(const int16_t *filter, int filterSize, +static void yuv2p01xlX_c(const int16_t *filter, int filterSize, const int16_t **src, uint16_t *dest, int dstW, - int big_endian) + int big_endian, int output_bits) { int i, j; - int shift = 17; + int shift = 11 + 16 - output_bits; + int output_shift = 16 - output_bits; for (i = 0; i < dstW; i++) { int val = 1 << (shift - 1); @@ -495,14 +502,15 @@ } } -static void yuv2p010cX_c(int big_endian, const uint8_t *chrDither, +static void yuv2p01xcX_c(int big_endian, const uint8_t *chrDither, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, - uint8_t *dest8, int chrDstW) + uint8_t *dest8, int chrDstW, int output_bits) { uint16_t *dest = (uint16_t*)dest8; - int shift = 17; int i, j; + int shift = 11 + 16 - output_bits; + int output_shift = 16 - output_bits; for (i = 0; i < chrDstW; i++) { int u = 1 << (shift - 1); @@ -518,52 +526,65 @@ } } -static void yuv2p010l1_LE_c(const int16_t *src, - uint8_t *dest, int dstW, - const uint8_t *dither, int offset) -{ - yuv2p010l1_c(src, (uint16_t*)dest, dstW, 0); -} - -static void yuv2p010l1_BE_c(const int16_t *src, - uint8_t *dest, int dstW, - const uint8_t *dither, int offset) -{ - yuv2p010l1_c(src, (uint16_t*)dest, dstW, 1); -} - -static void yuv2p010lX_LE_c(const int16_t *filter, int filterSize, - const int16_t **src, uint8_t *dest, int dstW, - const uint8_t *dither, int offset) -{ - yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0); -} - -static void yuv2p010lX_BE_c(const int16_t *filter, int filterSize, - const int16_t **src, uint8_t *dest, int dstW, - const uint8_t *dither, int offset) -{ - yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1); -} - -static void yuv2p010cX_LE_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither, - const int16_t *chrFilter, int chrFilterSize, - const int16_t **chrUSrc, const int16_t **chrVSrc, - uint8_t *dest8, int chrDstW) -{ - yuv2p010cX_c(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW); -} - -static void yuv2p010cX_BE_c(enum AVPixelFormat dstFormat, const uint8_t *chrDither, - const int16_t *chrFilter, int chrFilterSize, - const int16_t **chrUSrc, const int16_t **chrVSrc, - uint8_t *dest8, int chrDstW) -{ - yuv2p010cX_c(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, dest8, chrDstW); -} - #undef output_pixel +#define yuv2p01x_wrapper(bits) \ + static void yuv2p0 ## bits ## l1_LE_c(const int16_t *src, \ + uint8_t *dest, int dstW, \ + const uint8_t *dither, int offset) \ + { \ + yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 0, bits); \ + } \ + \ + static void yuv2p0 ## bits ## l1_BE_c(const int16_t *src, \ + uint8_t *dest, int dstW, \ + const uint8_t *dither, int offset) \ + { \ + yuv2p01xl1_c(src, (uint16_t*)dest, dstW, 1, bits); \ + } \ + \ + static void yuv2p0 ## bits ## lX_LE_c(const int16_t *filter, \ + int filterSize, const int16_t **src, \ + uint8_t *dest, int dstW, \ + const uint8_t *dither, int offset) \ + { \ + yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0, bits); \ + } \ + \ + static void yuv2p0 ## bits ## lX_BE_c(const int16_t *filter, \ + int filterSize, const int16_t **src, \ + uint8_t *dest, int dstW, \ + const uint8_t *dither, int offset) \ + { \ + yuv2p01xlX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1, bits); \ + } \ + \ + static void yuv2p0 ## bits ## cX_LE_c(enum AVPixelFormat dstFormat, \ + const uint8_t *chrDither, \ + const int16_t *chrFilter, \ + int chrFilterSize, \ + const int16_t **chrUSrc, \ + const int16_t **chrVSrc, \ + uint8_t *dest8, int chrDstW) \ + { \ + yuv2p01xcX_c(0, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \ + dest8, chrDstW, bits); \ + } \ + \ + static void yuv2p0 ## bits ## cX_BE_c(enum AVPixelFormat dstFormat, \ + const uint8_t *chrDither, \ + const int16_t *chrFilter, \ + int chrFilterSize, \ + const int16_t **chrUSrc, \ + const int16_t **chrVSrc, \ + uint8_t *dest8, int chrDstW) \ + { \ + yuv2p01xcX_c(1, chrDither, chrFilter, chrFilterSize, chrUSrc, chrVSrc, \ + dest8, chrDstW, bits); \ + } + +yuv2p01x_wrapper(10) +yuv2p01x_wrapper(12) #define accumulate_bit(acc, val) \ acc <<= 1; \ @@ -919,7 +940,7 @@ #define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? R : B) #define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE || target == AV_PIX_FMT_RGBA64LE || target == AV_PIX_FMT_RGBA64BE) ? B : R) #define output_pixel(pos, val) \ - if (isBE(target)) { \ + if (is_be) { \ AV_WB16(pos, val); \ } else { \ AV_WL16(pos, val); \ @@ -931,7 +952,8 @@ const int16_t *chrFilter, const int32_t **unused_chrUSrc, const int32_t **unused_chrVSrc, int unused_chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, - int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes) + int y, enum AVPixelFormat target, + int unused_hasAlpha, int unused_eightbytes, int is_be) { int hasAlpha = !!alpSrc; int i; @@ -968,7 +990,8 @@ const int32_t *unused_ubuf[2], const int32_t *unused_vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int unused_uvalpha, int y, - enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes) + enum AVPixelFormat target, int unused_hasAlpha, + int unused_eightbytes, int is_be) { int hasAlpha = abuf && abuf[0] && abuf[1]; const int32_t *buf0 = buf[0], *buf1 = buf[1], @@ -999,7 +1022,8 @@ yuv2ya16_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *unused_ubuf[2], const int32_t *unused_vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, - int unused_uvalpha, int y, enum AVPixelFormat target, int unused_hasAlpha, int unused_eightbytes) + int unused_uvalpha, int y, enum AVPixelFormat target, + int unused_hasAlpha, int unused_eightbytes, int is_be) { int hasAlpha = !!abuf0; int i; @@ -1027,7 +1051,8 @@ const int16_t *chrFilter, const int32_t **chrUSrc, const int32_t **chrVSrc, int chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, - int y, enum AVPixelFormat target, int hasAlpha, int eightbytes) + int y, enum AVPixelFormat target, int hasAlpha, int eightbytes, + int is_be) { int i; int A1 = 0xffff<<14, A2 = 0xffff<<14; @@ -1075,8 +1100,8 @@ Y2 -= c->yuv2rgb_y_offset; Y1 *= c->yuv2rgb_y_coeff; Y2 *= c->yuv2rgb_y_coeff; - Y1 += 1 << 13; // 21 - Y2 += 1 << 13; + Y1 += (1 << 13) - (1 << 29); // 21 + Y2 += (1 << 13) - (1 << 29); // 8 bits: 17 + 13 bits = 30 bits, 16 bits: 17 + 13 bits = 30 bits R = V * c->yuv2rgb_v2r_coeff; @@ -1084,20 +1109,20 @@ B = U * c->yuv2rgb_u2b_coeff; // 8 bits: 30 - 22 = 8 bits, 16 bits: 30 bits - 14 = 16 bits - output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14); dest += 8; } else { - output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); dest += 6; } } @@ -1108,7 +1133,8 @@ const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum AVPixelFormat target, int hasAlpha, int eightbytes) + enum AVPixelFormat target, int hasAlpha, int eightbytes, + int is_be) { const int32_t *buf0 = buf[0], *buf1 = buf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], @@ -1134,8 +1160,8 @@ Y2 -= c->yuv2rgb_y_offset; Y1 *= c->yuv2rgb_y_coeff; Y2 *= c->yuv2rgb_y_coeff; - Y1 += 1 << 13; - Y2 += 1 << 13; + Y1 += (1 << 13) - (1 << 29); + Y2 += (1 << 13) - (1 << 29); R = V * c->yuv2rgb_v2r_coeff; G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; @@ -1149,20 +1175,20 @@ A2 += 1 << 13; } - output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14); dest += 8; } else { - output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); dest += 6; } } @@ -1172,7 +1198,8 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, - int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes) + int uvalpha, int y, enum AVPixelFormat target, + int hasAlpha, int eightbytes, int is_be) { const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; @@ -1190,8 +1217,8 @@ Y2 -= c->yuv2rgb_y_offset; Y1 *= c->yuv2rgb_y_coeff; Y2 *= c->yuv2rgb_y_coeff; - Y1 += 1 << 13; - Y2 += 1 << 13; + Y1 += (1 << 13) - (1 << 29); + Y2 += (1 << 13) - (1 << 29); if (hasAlpha) { A1 = abuf0[i * 2 ] << 11; @@ -1205,20 +1232,20 @@ G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14); dest += 8; } else { - output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); dest += 6; } } @@ -1236,8 +1263,8 @@ Y2 -= c->yuv2rgb_y_offset; Y1 *= c->yuv2rgb_y_coeff; Y2 *= c->yuv2rgb_y_coeff; - Y1 += 1 << 13; - Y2 += 1 << 13; + Y1 += (1 << 13) - (1 << 29); + Y2 += (1 << 13) - (1 << 29); if (hasAlpha) { A1 = abuf0[i * 2 ] << 11; @@ -1251,20 +1278,20 @@ G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14); dest += 8; } else { - output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14); - output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14); - output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14); + output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16)); + output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16)); dest += 6; } } @@ -1277,7 +1304,8 @@ const int16_t *chrFilter, const int32_t **chrUSrc, const int32_t **chrVSrc, int chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, - int y, enum AVPixelFormat target, int hasAlpha, int eightbytes) + int y, enum AVPixelFormat target, int hasAlpha, + int eightbytes, int is_be) { int i; int A = 0xffff<<14; @@ -1315,7 +1343,7 @@ // 8bit: 27 -> 17bit, 16bit: 31 - 14 = 17bit Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; // 21 + Y += (1 << 13) - (1<<29); // 21 // 8bit: 17 + 13bit = 30bit, 16bit: 17 + 13bit = 30bit R = V * c->yuv2rgb_v2r_coeff; @@ -1323,9 +1351,9 @@ B = U * c->yuv2rgb_u2b_coeff; // 8bit: 30 - 22 = 8bit, 16bit: 30bit - 14 = 16bit - output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y)>>14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y)>>14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y)>>14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14); dest += 4; @@ -1340,7 +1368,8 @@ const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum AVPixelFormat target, int hasAlpha, int eightbytes) + enum AVPixelFormat target, int hasAlpha, int eightbytes, + int is_be) { const int32_t *buf0 = buf[0], *buf1 = buf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], @@ -1363,7 +1392,7 @@ Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; + Y += (1 << 13) - (1 << 29); R = V * c->yuv2rgb_v2r_coeff; G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; @@ -1375,9 +1404,9 @@ A += 1 << 13; } - output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14); dest += 4; @@ -1391,7 +1420,8 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, - int uvalpha, int y, enum AVPixelFormat target, int hasAlpha, int eightbytes) + int uvalpha, int y, enum AVPixelFormat target, + int hasAlpha, int eightbytes, int is_be) { const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; @@ -1406,7 +1436,7 @@ Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; + Y += (1 << 13) - (1 << 29); if (hasAlpha) { A = abuf0[i] << 11; @@ -1418,9 +1448,9 @@ G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14); dest += 4; @@ -1439,7 +1469,7 @@ Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; + Y += (1 << 13) - (1 << 29); if (hasAlpha) { A = abuf0[i] << 11; @@ -1451,9 +1481,9 @@ G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14); - output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14); - output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14); + output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16)); + output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16)); if (eightbytes) { output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14); dest += 4; @@ -1468,7 +1498,7 @@ #undef r_b #undef b_r -#define YUV2PACKED16WRAPPER(name, base, ext, fmt, hasAlpha, eightbytes) \ +#define YUV2PACKED16WRAPPER_EXT(name, base, ext, fmt, is_be, hasAlpha, eightbytes) \ static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \ const int16_t **_lumSrc, int lumFilterSize, \ const int16_t *chrFilter, const int16_t **_chrUSrc, \ @@ -1483,7 +1513,7 @@ uint16_t *dest = (uint16_t *) _dest; \ name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \ chrFilter, chrUSrc, chrVSrc, chrFilterSize, \ - alpSrc, dest, dstW, y, fmt, hasAlpha, eightbytes); \ + alpSrc, dest, dstW, y, fmt, hasAlpha, eightbytes, is_be); \ } \ \ static void name ## ext ## _2_c(SwsContext *c, const int16_t *_buf[2], \ @@ -1497,7 +1527,7 @@ **abuf = (const int32_t **) _abuf; \ uint16_t *dest = (uint16_t *) _dest; \ name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \ - dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha, eightbytes); \ + dest, dstW, yalpha, uvalpha, y, fmt, hasAlpha, eightbytes, is_be); \ } \ \ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ @@ -1511,36 +1541,38 @@ *abuf0 = (const int32_t *) _abuf0; \ uint16_t *dest = (uint16_t *) _dest; \ name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \ - dstW, uvalpha, y, fmt, hasAlpha, eightbytes); \ + dstW, uvalpha, y, fmt, hasAlpha, eightbytes, is_be); \ } +#define YUV2PACKED16WRAPPER(name, base, ext, base_fmt, endianness, hasAlpha, eightbytes) \ + YUV2PACKED16WRAPPER_EXT(name, base, ext, base_fmt ## endianness, IS_BE(endianness), hasAlpha, eightbytes) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgb48be, AV_PIX_FMT_RGB48BE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgb48le, AV_PIX_FMT_RGB48LE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgr48be, AV_PIX_FMT_BGR48BE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgr48le, AV_PIX_FMT_BGR48LE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64be, AV_PIX_FMT_RGBA64BE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64le, AV_PIX_FMT_RGBA64LE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64be, AV_PIX_FMT_RGBA64BE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64le, AV_PIX_FMT_RGBA64LE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64be, AV_PIX_FMT_BGRA64BE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64le, AV_PIX_FMT_BGRA64LE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64be, AV_PIX_FMT_BGRA64BE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64le, AV_PIX_FMT_BGRA64LE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, ya16, ya16be, AV_PIX_FMT_YA16BE, 1, 0) -YUV2PACKED16WRAPPER(yuv2, ya16, ya16le, AV_PIX_FMT_YA16LE, 1, 0) - -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgb48be_full, AV_PIX_FMT_RGB48BE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgb48le_full, AV_PIX_FMT_RGB48LE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgr48be_full, AV_PIX_FMT_BGR48BE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgr48le_full, AV_PIX_FMT_BGR48LE, 0, 0) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgba64be_full, AV_PIX_FMT_RGBA64BE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgba64le_full, AV_PIX_FMT_RGBA64LE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgbx64be_full, AV_PIX_FMT_RGBA64BE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgbx64le_full, AV_PIX_FMT_RGBA64LE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgra64be_full, AV_PIX_FMT_BGRA64BE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgra64le_full, AV_PIX_FMT_BGRA64LE, 1, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgrx64be_full, AV_PIX_FMT_BGRA64BE, 0, 1) -YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgrx64le_full, AV_PIX_FMT_BGRA64LE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgb48be, AV_PIX_FMT_RGB48, BE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgb48le, AV_PIX_FMT_RGB48, LE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgr48be, AV_PIX_FMT_BGR48, BE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgr48le, AV_PIX_FMT_BGR48, LE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64be, AV_PIX_FMT_RGBA64, BE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgba64le, AV_PIX_FMT_RGBA64, LE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64be, AV_PIX_FMT_RGBA64, BE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, rgbx64le, AV_PIX_FMT_RGBA64, LE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64be, AV_PIX_FMT_BGRA64, BE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgra64le, AV_PIX_FMT_BGRA64, LE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64be, AV_PIX_FMT_BGRA64, BE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64, bgrx64le, AV_PIX_FMT_BGRA64, LE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, ya16, ya16be, AV_PIX_FMT_YA16, BE, 1, 0) +YUV2PACKED16WRAPPER(yuv2, ya16, ya16le, AV_PIX_FMT_YA16, LE, 1, 0) + +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgb48be_full, AV_PIX_FMT_RGB48, BE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgb48le_full, AV_PIX_FMT_RGB48, LE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgr48be_full, AV_PIX_FMT_BGR48, BE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgr48le_full, AV_PIX_FMT_BGR48, LE, 0, 0) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgba64be_full, AV_PIX_FMT_RGBA64, BE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgba64le_full, AV_PIX_FMT_RGBA64, LE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgbx64be_full, AV_PIX_FMT_RGBA64, BE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, rgbx64le_full, AV_PIX_FMT_RGBA64, LE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgra64be_full, AV_PIX_FMT_BGRA64, BE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgra64le_full, AV_PIX_FMT_BGRA64, LE, 1, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgrx64be_full, AV_PIX_FMT_BGRA64, BE, 0, 1) +YUV2PACKED16WRAPPER(yuv2, rgba64_full, bgrx64le_full, AV_PIX_FMT_BGRA64, LE, 0, 1) /* * Write out 2 RGB pixels in the target pixel format. This function takes a @@ -2340,18 +2372,15 @@ Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; + Y += (1 << 13) - (1 << 29); R = V * c->yuv2rgb_v2r_coeff; G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - R = av_clip_uintp2(Y + R, 30); - G = av_clip_uintp2(Y + G, 30); - B = av_clip_uintp2(Y + B, 30); - - dest16[0][i] = G >> 14; - dest16[1][i] = B >> 14; - dest16[2][i] = R >> 14; + dest16[2][i] = av_clip_uintp2(((Y + R) >> 14) + (1<<15), 16); + dest16[0][i] = av_clip_uintp2(((Y + G) >> 14) + (1<<15), 16); + dest16[1][i] = av_clip_uintp2(((Y + B) >> 14) + (1<<15), 16); + if (hasAlpha) dest16[3][i] = av_clip_uintp2(A, 30) >> 14; } @@ -2416,18 +2445,18 @@ Y -= c->yuv2rgb_y_offset; Y *= c->yuv2rgb_y_coeff; - Y += 1 << 13; + Y += (1 << 13) - (1 << 29); R = V * c->yuv2rgb_v2r_coeff; G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff; B = U * c->yuv2rgb_u2b_coeff; - R = av_clip_uintp2(Y + R, 30); - G = av_clip_uintp2(Y + G, 30); - B = av_clip_uintp2(Y + B, 30); - - dest32[0][i] = av_float2int(float_mult * (float)(G >> 14)); - dest32[1][i] = av_float2int(float_mult * (float)(B >> 14)); - dest32[2][i] = av_float2int(float_mult * (float)(R >> 14)); + R = av_clip_uintp2(((Y + R) >> 14) + (1<<15), 16); + G = av_clip_uintp2(((Y + G) >> 14) + (1<<15), 16); + B = av_clip_uintp2(((Y + B) >> 14) + (1<<15), 16); + + dest32[0][i] = av_float2int(float_mult * (float)G); + dest32[1][i] = av_float2int(float_mult * (float)B); + dest32[2][i] = av_float2int(float_mult * (float)R); if (hasAlpha) dest32[3][i] = av_float2int(float_mult * (float)(av_clip_uintp2(A, 30) >> 14)); } @@ -2584,6 +2613,180 @@ } } +static void +yuv2xv30le_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y) +{ + int i; + for (i = 0; i < dstW; i++) { + int Y = 1 << 16, U = 1 << 16, V = 1 << 16; + int j; + + for (j = 0; j < lumFilterSize; j++) + Y += lumSrc[j][i] * lumFilter[j]; + + for (j = 0; j < chrFilterSize; j++) { + U += chrUSrc[j][i] * chrFilter[j]; + V += chrVSrc[j][i] * chrFilter[j]; + } + + Y = av_clip_uintp2(Y >> 17, 10); + U = av_clip_uintp2(U >> 17, 10); + V = av_clip_uintp2(V >> 17, 10); + + AV_WL32(dest + 4 * i, U | Y << 10 | V << 20); + } +} + +static void +yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y) +{ + int i; + for (i = 0; i < dstW; i++) { + int Y = 1 << 14, U = 1 << 14, V = 1 << 14; + int j; + + for (j = 0; j < lumFilterSize; j++) + Y += lumSrc[j][i] * lumFilter[j]; + + for (j = 0; j < chrFilterSize; j++) { + U += chrUSrc[j][i] * chrFilter[j]; + V += chrVSrc[j][i] * chrFilter[j]; + } + + AV_WL16(dest + 8 * i + 2, av_clip_uintp2(Y >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 0, av_clip_uintp2(U >> 15, 12) << 4); + AV_WL16(dest + 8 * i + 4, av_clip_uintp2(V >> 15, 12) << 4); + } +} + +static void +yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y, + int destHasAlpha) +{ + int hasAlpha = destHasAlpha && (!!alpSrc); + int i; + + for (i = 0; i < dstW; i++) { + int j; + int Y = 1 << 18, U = 1 << 18; + int V = 1 << 18, A = 255; + + for (j = 0; j < lumFilterSize; j++) + Y += lumSrc[j][i] * lumFilter[j]; + + for (j = 0; j < chrFilterSize; j++) + U += chrUSrc[j][i] * chrFilter[j]; + + for (j = 0; j < chrFilterSize; j++) + V += chrVSrc[j][i] * chrFilter[j]; + + Y >>= 19; + U >>= 19; + V >>= 19; + + if (Y & 0x100) + Y = av_clip_uint8(Y); + if (U & 0x100) + U = av_clip_uint8(U); + if (V & 0x100) + V = av_clip_uint8(V); + + if (hasAlpha) { + A = 1 << 18; + + for (j = 0; j < lumFilterSize; j++) + A += alpSrc[j][i] * lumFilter[j]; + + A >>= 19; + + if (A & 0x100) + A = av_clip_uint8(A); + } + + dest[4 * i ] = V; + dest[4 * i + 1] = U; + dest[4 * i + 2] = Y; + if (destHasAlpha) + dest[4 * i + 3] = A; + } +} + +static void +yuv2vuya_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y) +{ + yuv2vuyX_X_c(c, lumFilter, lumSrc, lumFilterSize, chrFilter, + chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 1); +} + +static void +yuv2vuyx_X_c(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, int dstW, int y) +{ + yuv2vuyX_X_c(c, lumFilter, lumSrc, lumFilterSize, chrFilter, + chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 0); +} + +#define output_pixel(pos, val, bits) \ + AV_WL16(pos, av_clip_uintp2(val >> shift, bits) << output_shift); + +#define yuv2y2xx_wrapper(bits) \ + static void \ + yuv2y2 ## bits ## le_X_c(SwsContext *c, const int16_t *lumFilter, \ + const int16_t **lumSrc, int lumFilterSize, \ + const int16_t *chrFilter, \ + const int16_t **chrUSrc, \ + const int16_t **chrVSrc, int chrFilterSize, \ + const int16_t **alpSrc, \ + uint8_t *dest, int dstW, int y) \ + { \ + int i, j; \ + int shift = 11 + 16 - bits; \ + int output_shift = 16 - bits; \ + for (i = 0; i < ((dstW + 1) >> 1); i++) { \ + int Y1 = 1 << (shift - 1), Y2 = 1 << (shift - 1); \ + int U = 1 << (shift - 1), V = 1 << (shift - 1); \ + \ + for (j = 0; j < lumFilterSize; j++) { \ + Y1 += lumSrc[j][i * 2] * lumFilter[j]; \ + Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j]; \ + } \ + \ + for (j = 0; j < chrFilterSize; j++) { \ + U += chrUSrc[j][i] * chrFilter[j]; \ + V += chrVSrc[j][i] * chrFilter[j]; \ + } \ + \ + output_pixel(dest + 8 * i + 0, Y1, bits); \ + output_pixel(dest + 8 * i + 2, U, bits); \ + output_pixel(dest + 8 * i + 4, Y2, bits); \ + output_pixel(dest + 8 * i + 6, V, bits); \ + } \ + } + +yuv2y2xx_wrapper(10) +yuv2y2xx_wrapper(12) + +#undef output_pixel + av_cold void ff_sws_init_output_funcs(SwsContext *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, @@ -2597,10 +2800,16 @@ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat); if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) { - av_assert0(desc->comp[0].depth == 10); - *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c; - *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c; - *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c; + if (desc->comp[0].depth == 10) { + *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c; + *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c; + *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c; + } else if (desc->comp[0].depth == 12) { + *yuv2plane1 = isBE(dstFormat) ? yuv2p012l1_BE_c : yuv2p012l1_LE_c; + *yuv2planeX = isBE(dstFormat) ? yuv2p012lX_BE_c : yuv2p012lX_LE_c; + *yuv2nv12cX = isBE(dstFormat) ? yuv2p012cX_BE_c : yuv2p012cX_LE_c; + } else + av_assert0(0); } else if (is16BPS(dstFormat)) { *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c; *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c; @@ -3086,5 +3295,23 @@ case AV_PIX_FMT_AYUV64LE: *yuv2packedX = yuv2ayuv64le_X_c; break; + case AV_PIX_FMT_VUYA: + *yuv2packedX = yuv2vuya_X_c; + break; + case AV_PIX_FMT_VUYX: + *yuv2packedX = yuv2vuyx_X_c; + break; + case AV_PIX_FMT_XV30LE: + *yuv2packedX = yuv2xv30le_X_c; + break; + case AV_PIX_FMT_XV36LE: + *yuv2packedX = yuv2xv36le_X_c; + break; + case AV_PIX_FMT_Y210LE: + *yuv2packedX = yuv2y210le_X_c; + break; + case AV_PIX_FMT_Y212LE: + *yuv2packedX = yuv2y212le_X_c; + break; } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.c 2023-03-03 13:29:59.000000000 +0000 @@ -139,8 +139,12 @@ rgb2rgb_init_c(); #if ARCH_AARCH64 rgb2rgb_init_aarch64(); +#elif ARCH_RISCV + rgb2rgb_init_riscv(); #elif ARCH_X86 rgb2rgb_init_x86(); +#elif ARCH_LOONGARCH64 + rgb2rgb_init_loongarch(); #endif } @@ -317,7 +321,7 @@ void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size) { uint16_t *d = (uint16_t *)dst; - uint16_t *s = (uint16_t *)src; + const uint16_t *s = (const uint16_t *)src; int i, num_pixels = src_size >> 1; for (i = 0; i < num_pixels; i++) { @@ -331,7 +335,7 @@ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ - uint16_t *s = (uint16_t *)src; \ + const uint16_t *s = (const uint16_t *)src; \ int i, num_pixels = src_size >> 1; \ \ for (i = 0; i < num_pixels; i += 3) { \ @@ -349,7 +353,7 @@ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ - uint16_t *s = (uint16_t *)src; \ + const uint16_t *s = (const uint16_t *)src; \ int i, num_pixels = src_size >> 3; \ \ for (i = 0; i < num_pixels; i++) { \ @@ -367,7 +371,7 @@ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ - uint16_t *s = (uint16_t *)src; \ + const uint16_t *s = (const uint16_t *)src; \ int i, num_pixels = src_size >> 3; \ \ for (i = 0; i < num_pixels; i++) { \ @@ -385,7 +389,7 @@ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ - uint16_t *s = (uint16_t *)src; \ + const uint16_t *s = (const uint16_t *)src; \ int i, num_pixels = src_size / 6; \ \ for (i = 0; i < num_pixels; i++) { \ @@ -404,7 +408,7 @@ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ - uint16_t *s = (uint16_t *)src; \ + const uint16_t *s = (const uint16_t *)src; \ int i, num_pixels = src_size / 6; \ \ for (i = 0; i < num_pixels; i++) { \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/rgb2rgb.h 2023-03-03 13:29:59.000000000 +0000 @@ -167,6 +167,8 @@ void ff_sws_rgb2rgb_init(void); void rgb2rgb_init_aarch64(void); +void rgb2rgb_init_riscv(void); void rgb2rgb_init_x86(void); +void rgb2rgb_init_loongarch(void); #endif /* SWSCALE_RGB2RGB_H */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,2 @@ +OBJS += riscv/rgb2rgb.o +RVV-OBJS += riscv/rgb2rgb_rvv.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * 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 + */ + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libswscale/rgb2rgb.h" + +void ff_shuffle_bytes_0321_rvv(const uint8_t *src, uint8_t *dst, int src_len); +void ff_shuffle_bytes_2103_rvv(const uint8_t *src, uint8_t *dst, int src_len); +void ff_shuffle_bytes_1230_rvv(const uint8_t *src, uint8_t *dst, int src_len); +void ff_shuffle_bytes_3012_rvv(const uint8_t *src, uint8_t *dst, int src_len); +void ff_shuffle_bytes_3210_rvv(const uint8_t *src, uint8_t *dst, int src_len); +void ff_interleave_bytes_rvv(const uint8_t *src1, const uint8_t *src2, + uint8_t *dst, int width, int height, int s1stride, + int s2stride, int dstride); +void ff_uyvytoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int ystride, int uvstride, int src_stride); +void ff_yuyvtoyuv422_rvv(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int ystride, int uvstride, int src_stride); + +av_cold void rgb2rgb_init_riscv(void) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if (flags & AV_CPU_FLAG_RVV_I32) { + shuffle_bytes_0321 = ff_shuffle_bytes_0321_rvv; + shuffle_bytes_2103 = ff_shuffle_bytes_2103_rvv; + shuffle_bytes_1230 = ff_shuffle_bytes_1230_rvv; + shuffle_bytes_3012 = ff_shuffle_bytes_3012_rvv; + shuffle_bytes_3210 = ff_shuffle_bytes_3210_rvv; + interleaveBytes = ff_interleave_bytes_rvv; +#if (__riscv_xlen == 64) + uyvytoyuv422 = ff_uyvytoyuv422_rvv; + yuyvtoyuv422 = ff_yuyvtoyuv422_rvv; +#endif + } +#endif +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb_rvv.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb_rvv.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb_rvv.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/riscv/rgb2rgb_rvv.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,157 @@ +/* + * 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 + */ + +#include "libavutil/riscv/asm.S" + +func ff_shuffle_bytes_0321_rvv, zve32x + addi t1, a0, 3 + addi t2, a0, 2 + addi t3, a0, 1 +1: + srai a2, a2, 2 + li t4, 4 +2: + vsetvli t0, a2, e8, m1, ta, ma + sub a2, a2, t0 + vlse8.v v8, (a0), t4 + sh2add a0, t0, a0 + vlse8.v v9, (t1), t4 + sh2add t1, t0, t1 + vlse8.v v10, (t2), t4 + sh2add t2, t0, t2 + vlse8.v v11, (t3), t4 + sh2add t3, t0, t3 + vsseg4e8.v v8, (a1) + sh2add a1, t0, a1 + bnez a2, 2b + + ret +endfunc + +func ff_shuffle_bytes_2103_rvv, zve32x + addi t1, a0, 1 + addi t2, a0, 0 + addi t3, a0, 3 + addi a0, a0, 2 + j 1b +endfunc + +func ff_shuffle_bytes_1230_rvv, zve32x + addi t1, a0, 2 + addi t2, a0, 3 + addi t3, a0, 0 + addi a0, a0, 1 + j 1b +endfunc + +func ff_shuffle_bytes_3012_rvv, zve32x + addi t1, a0, 0 + addi t2, a0, 1 + addi t3, a0, 2 + addi a0, a0, 3 + j 1b +endfunc + +func ff_shuffle_bytes_3210_rvv, zve32x + addi t1, a0, 2 + addi t2, a0, 1 + addi t3, a0, 0 + addi a0, a0, 3 + j 1b +endfunc + +func ff_interleave_bytes_rvv, zve32x +1: + mv t0, a0 + mv t1, a1 + mv t2, a2 + mv t3, a3 + addi a4, a4, -1 +2: + vsetvli t4, t3, e8, ta, ma + sub t3, t3, t4 + vle8.v v8, (t0) + add t0, t4, t0 + vle8.v v9, (t1) + add t1, t4, t1 + vsseg2e8.v v8, (t2) + sh1add t2, t4, t2 + bnez t4, 2b + + add a0, a0, a5 + add a1, a1, a6 + add a2, a2, a7 + bnez a4, 1b + + ret +endfunc + +#if (__riscv_xlen == 64) +.macro yuy2_to_i422p v_y0, v_y1, v_u, v_v + addi sp, sp, -16 + sd s0, (sp) + sd s1, 8(sp) + addi a4, a4, 1 + lw s0, 16(sp) + srai a4, a4, 1 // pixel width -> chroma width + li s1, 2 +1: + mv t4, a4 + mv t3, a3 + mv t0, a0 + addi t6, a0, 1 + mv t1, a1 + mv t2, a2 + addi a5, a5, -1 +2: + vsetvli t5, t4, e8, m1, ta, ma + sub t4, t4, t5 + vlseg4e8.v v8, (t3) + sh2add t3, t5, t3 + vsse8.v \v_y0, (t0), s1 + sh1add t0, t5, t0 + vsse8.v \v_y1, (t6), s1 + sh1add t6, t5, t6 + vse8.v \v_u, (t1) + add t1, t5, t1 + vse8.v \v_v, (t2) + add t2, t5, t2 + bnez t4, 2b + + add a3, a3, s0 + add a0, a0, a6 + add a1, a1, a7 + add a2, a2, a7 + bnez a5, 1b + + ld s1, 8(sp) + ld s0, (sp) + addi sp, sp, 16 + ret +.endm + +func ff_uyvytoyuv422_rvv, zve32x + yuy2_to_i422p v9, v11, v8, v10 +endfunc + +func ff_yuyvtoyuv422_rvv, zve32x + yuy2_to_i422p v8, v10, v9, v11 +endfunc +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/slice.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/slice.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/slice.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/slice.c 2023-03-03 13:29:59.000000000 +0000 @@ -282,7 +282,13 @@ c->descIndex[0] = num_ydesc + (need_gamma ? 1 : 0); c->descIndex[1] = num_ydesc + num_cdesc + (need_gamma ? 1 : 0); - + if (isFloat16(c->srcFormat)) { + c->h2f_tables = av_malloc(sizeof(*c->h2f_tables)); + if (!c->h2f_tables) + return AVERROR(ENOMEM); + ff_init_half2float_tables(c->h2f_tables); + c->input_opaque = c->h2f_tables; + } c->desc = av_calloc(c->numDesc, sizeof(*c->desc)); if (!c->desc) @@ -393,5 +399,6 @@ free_slice(&c->slice[i]); av_freep(&c->slice); } + av_freep(&c->h2f_tables); return 0; } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.c 2023-03-03 13:29:59.000000000 +0000 @@ -598,6 +598,8 @@ ff_sws_init_swscale_aarch64(c); #elif ARCH_ARM ff_sws_init_swscale_arm(c); +#elif ARCH_LOONGARCH64 + ff_sws_init_swscale_loongarch(c); #endif } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale.h 2023-03-03 13:29:59.000000000 +0000 @@ -234,6 +234,7 @@ * - sws_receive_slice(0, dst->height) * - sws_frame_end() * + * @param c The scaling context * @param dst The destination frame. See documentation for sws_frame_start() for * more details. * @param src The source frame. @@ -249,6 +250,7 @@ * This function will retain references to src and dst, so they must both use * refcounted buffers (if allocated by the caller, in case of dst). * + * @param c The scaling context * @param dst The destination frame. * * The data buffers may either be already allocated by the caller or @@ -273,6 +275,8 @@ * submitted with sws_frame_start(). Must be called after all sws_send_slice() * and sws_receive_slice() calls are done, before any new sws_frame_start() * calls. + * + * @param c The scaling context */ void sws_frame_end(struct SwsContext *c); @@ -282,6 +286,7 @@ * any order, but may not overlap. For vertically subsampled pixel formats, the * slices must be aligned according to subsampling. * + * @param c The scaling context * @param slice_start first row of the slice * @param slice_height number of rows in the slice * @@ -294,6 +299,7 @@ * Request a horizontal slice of the output data to be written into the frame * previously provided to sws_frame_start(). * + * @param c The scaling context * @param slice_start first row of the slice; must be a multiple of * sws_receive_slice_alignment() * @param slice_height number of rows in the slice; must be a multiple of @@ -310,6 +316,9 @@ unsigned int slice_height); /** + * Get the alignment required for slices + * + * @param c The scaling context * @return alignment required for output slices requested with sws_receive_slice(). * Slice offsets and sizes passed to sws_receive_slice() must be * multiples of the value returned from this function. @@ -317,6 +326,7 @@ unsigned int sws_receive_slice_alignment(const struct SwsContext *c); /** + * @param c the scaling context * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] @@ -324,22 +334,17 @@ * @param brightness 16.16 fixed point brightness correction * @param contrast 16.16 fixed point contrast correction * @param saturation 16.16 fixed point saturation correction -#if LIBSWSCALE_VERSION_MAJOR > 6 - * @return negative error code on error, non negative otherwise -#else - * @return -1 if not supported -#endif + * + * @return A negative error code on error, non negative otherwise. + * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. */ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation); /** -#if LIBSWSCALE_VERSION_MAJOR > 6 - * @return negative error code on error, non negative otherwise -#else - * @return -1 if not supported -#endif + * @return A negative error code on error, non negative otherwise. + * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. */ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale_internal.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale_internal.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale_internal.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/swscale_internal.h 2023-03-03 13:29:59.000000000 +0000 @@ -35,6 +35,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/slicethread.h" #include "libavutil/ppc/util_altivec.h" +#include "libavutil/half2float.h" #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long @@ -559,26 +560,31 @@ yuv2packedX_fn yuv2packedX; yuv2anyX_fn yuv2anyX; + /// Opaque data pointer passed to all input functions. + void *input_opaque; + /// Unscaled conversion of luma plane to YV12 for horizontal scaler. void (*lumToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal); + int width, uint32_t *pal, void *opq); /// Unscaled conversion of alpha plane to YV12 for horizontal scaler. void (*alpToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal); + int width, uint32_t *pal, void *opq); /// Unscaled conversion of chroma planes to YV12 for horizontal scaler. void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal); + int width, uint32_t *pal, void *opq); /** * Functions to read planar input, such as planar RGB, and convert * internally to Y/UV/A. */ /** @{ */ - void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv); + void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, + void *opq); void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], - int width, int32_t *rgb2yuv); - void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv); + int width, int32_t *rgb2yuv, void *opq); + void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, + void *opq); /** @} */ /** @@ -674,6 +680,8 @@ unsigned int dst_slice_align; atomic_int stride_unaligned_warned; atomic_int data_unaligned_warned; + + Half2FloatTables *h2f_tables; } SwsContext; //FIXME check init (where 0) @@ -690,6 +698,7 @@ SwsFunc ff_yuv2rgb_init_x86(SwsContext *c); SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c); +SwsFunc ff_yuv2rgb_init_loongarch(SwsContext *c); static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt) { @@ -835,6 +844,13 @@ return desc->flags & AV_PIX_FMT_FLAG_FLOAT; } +static av_always_inline int isFloat16(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_FLOAT) && desc->comp[0].depth == 16; +} + static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); @@ -968,6 +984,7 @@ void ff_sws_init_swscale_x86(SwsContext *c); void ff_sws_init_swscale_aarch64(SwsContext *c); void ff_sws_init_swscale_arm(SwsContext *c); +void ff_sws_init_swscale_loongarch(SwsContext *c); void ff_hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/utils.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/utils.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/utils.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/utils.c 2023-03-03 13:29:59.000000000 +0000 @@ -53,18 +53,12 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" +#include "libavutil/loongarch/cpu.h" #include "rgb2rgb.h" #include "swscale.h" #include "swscale_internal.h" -static SwsVector *sws_getIdentityVec(void); -static void sws_addVec(SwsVector *a, SwsVector *b); -static void sws_shiftVec(SwsVector *a, int shift); -static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); - -static void handle_formats(SwsContext *c); - typedef struct FormatEntry { uint8_t is_supported_in :1; uint8_t is_supported_out :1; @@ -236,6 +230,8 @@ [AV_PIX_FMT_AYUV64LE] = { 1, 1}, [AV_PIX_FMT_P010LE] = { 1, 1 }, [AV_PIX_FMT_P010BE] = { 1, 1 }, + [AV_PIX_FMT_P012LE] = { 1, 1 }, + [AV_PIX_FMT_P012BE] = { 1, 1 }, [AV_PIX_FMT_P016LE] = { 1, 1 }, [AV_PIX_FMT_P016BE] = { 1, 1 }, [AV_PIX_FMT_GRAYF32LE] = { 1, 1 }, @@ -246,7 +242,8 @@ [AV_PIX_FMT_YUVA444P12LE] = { 1, 1 }, [AV_PIX_FMT_NV24] = { 1, 1 }, [AV_PIX_FMT_NV42] = { 1, 1 }, - [AV_PIX_FMT_Y210LE] = { 1, 0 }, + [AV_PIX_FMT_Y210LE] = { 1, 1 }, + [AV_PIX_FMT_Y212LE] = { 1, 1 }, [AV_PIX_FMT_X2RGB10LE] = { 1, 1 }, [AV_PIX_FMT_X2BGR10LE] = { 1, 1 }, [AV_PIX_FMT_P210BE] = { 1, 1 }, @@ -257,6 +254,13 @@ [AV_PIX_FMT_P216LE] = { 1, 1 }, [AV_PIX_FMT_P416BE] = { 1, 1 }, [AV_PIX_FMT_P416LE] = { 1, 1 }, + [AV_PIX_FMT_NV16] = { 1, 1 }, + [AV_PIX_FMT_VUYA] = { 1, 1 }, + [AV_PIX_FMT_VUYX] = { 1, 1 }, + [AV_PIX_FMT_RGBAF16BE] = { 1, 0 }, + [AV_PIX_FMT_RGBAF16LE] = { 1, 0 }, + [AV_PIX_FMT_XV30LE] = { 1, 1 }, + [AV_PIX_FMT_XV36LE] = { 1, 1 }, }; int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, @@ -266,8 +270,7 @@ #if ARCH_X86_64 int i, j, k; int cpu_flags = av_get_cpu_flags(); - // avx2 hscale filter processes 16 pixel blocks. - if (!filter || dstW % 16 != 0) + if (!filter) return 0; if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) { if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { @@ -279,9 +282,11 @@ } // Do not swap filterPos for pixels which won't be processed by // the main loop. - for (i = 0; i + 8 <= dstW; i += 8) { + for (i = 0; i + 16 <= dstW; i += 16) { FFSWAP(int, filterPos[i + 2], filterPos[i + 4]); FFSWAP(int, filterPos[i + 3], filterPos[i + 5]); + FFSWAP(int, filterPos[i + 10], filterPos[i + 12]); + FFSWAP(int, filterPos[i + 11], filterPos[i + 13]); } if (filterSize > 4) { // 16 pixels are processed at a time. @@ -295,6 +300,18 @@ } } } + // 4 pixels are processed at a time in the tail. + for (; i < dstW; i += 4) { + // 4 filter coeffs are processed at a time. + int rem = dstW - i >= 4 ? 4 : dstW - i; + for (k = 0; k + 4 <= filterSize; k += 4) { + for (j = 0; j < rem; ++j) { + int from = (i + j) * filterSize + k; + int to = i * filterSize + j * 4 + k * 4; + memcpy(&filter[to], &filterCopy[from], 4 * sizeof(int16_t)); + } + } + } } av_free(filterCopy); } @@ -636,6 +653,15 @@ filterAlign = 1; } + if (have_lasx(cpu_flags)) { + int reNum = minFilterSize & (0x07); + + if (minFilterSize < 5) + filterAlign = 4; + if (reNum < 3) + filterAlign = 1; + } + av_assert0(minFilterSize > 0); filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1)); av_assert0(filterSize > 0); @@ -893,6 +919,74 @@ } } +static int handle_jpeg(enum AVPixelFormat *format) +{ + switch (*format) { + case AV_PIX_FMT_YUVJ420P: + *format = AV_PIX_FMT_YUV420P; + return 1; + case AV_PIX_FMT_YUVJ411P: + *format = AV_PIX_FMT_YUV411P; + return 1; + case AV_PIX_FMT_YUVJ422P: + *format = AV_PIX_FMT_YUV422P; + return 1; + case AV_PIX_FMT_YUVJ444P: + *format = AV_PIX_FMT_YUV444P; + return 1; + case AV_PIX_FMT_YUVJ440P: + *format = AV_PIX_FMT_YUV440P; + return 1; + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_YA8: + case AV_PIX_FMT_GRAY9LE: + case AV_PIX_FMT_GRAY9BE: + case AV_PIX_FMT_GRAY10LE: + case AV_PIX_FMT_GRAY10BE: + case AV_PIX_FMT_GRAY12LE: + case AV_PIX_FMT_GRAY12BE: + case AV_PIX_FMT_GRAY14LE: + case AV_PIX_FMT_GRAY14BE: + case AV_PIX_FMT_GRAY16LE: + case AV_PIX_FMT_GRAY16BE: + case AV_PIX_FMT_YA16BE: + case AV_PIX_FMT_YA16LE: + return 1; + default: + return 0; + } +} + +static int handle_0alpha(enum AVPixelFormat *format) +{ + switch (*format) { + case AV_PIX_FMT_0BGR : *format = AV_PIX_FMT_ABGR ; return 1; + case AV_PIX_FMT_BGR0 : *format = AV_PIX_FMT_BGRA ; return 4; + case AV_PIX_FMT_0RGB : *format = AV_PIX_FMT_ARGB ; return 1; + case AV_PIX_FMT_RGB0 : *format = AV_PIX_FMT_RGBA ; return 4; + default: return 0; + } +} + +static int handle_xyz(enum AVPixelFormat *format) +{ + switch (*format) { + case AV_PIX_FMT_XYZ12BE : *format = AV_PIX_FMT_RGB48BE; return 1; + case AV_PIX_FMT_XYZ12LE : *format = AV_PIX_FMT_RGB48LE; return 1; + default: return 0; + } +} + +static void handle_formats(SwsContext *c) +{ + c->src0Alpha |= handle_0alpha(&c->srcFormat); + c->dst0Alpha |= handle_0alpha(&c->dstFormat); + c->srcXYZ |= handle_xyz(&c->srcFormat); + c->dstXYZ |= handle_xyz(&c->dstFormat); + if (c->srcXYZ || c->dstXYZ) + fill_xyztables(c); +} + static int range_override_needed(enum AVPixelFormat format) { return !isYUV(format) && !isGray(format); @@ -1079,74 +1173,6 @@ return 0; } -static int handle_jpeg(enum AVPixelFormat *format) -{ - switch (*format) { - case AV_PIX_FMT_YUVJ420P: - *format = AV_PIX_FMT_YUV420P; - return 1; - case AV_PIX_FMT_YUVJ411P: - *format = AV_PIX_FMT_YUV411P; - return 1; - case AV_PIX_FMT_YUVJ422P: - *format = AV_PIX_FMT_YUV422P; - return 1; - case AV_PIX_FMT_YUVJ444P: - *format = AV_PIX_FMT_YUV444P; - return 1; - case AV_PIX_FMT_YUVJ440P: - *format = AV_PIX_FMT_YUV440P; - return 1; - case AV_PIX_FMT_GRAY8: - case AV_PIX_FMT_YA8: - case AV_PIX_FMT_GRAY9LE: - case AV_PIX_FMT_GRAY9BE: - case AV_PIX_FMT_GRAY10LE: - case AV_PIX_FMT_GRAY10BE: - case AV_PIX_FMT_GRAY12LE: - case AV_PIX_FMT_GRAY12BE: - case AV_PIX_FMT_GRAY14LE: - case AV_PIX_FMT_GRAY14BE: - case AV_PIX_FMT_GRAY16LE: - case AV_PIX_FMT_GRAY16BE: - case AV_PIX_FMT_YA16BE: - case AV_PIX_FMT_YA16LE: - return 1; - default: - return 0; - } -} - -static int handle_0alpha(enum AVPixelFormat *format) -{ - switch (*format) { - case AV_PIX_FMT_0BGR : *format = AV_PIX_FMT_ABGR ; return 1; - case AV_PIX_FMT_BGR0 : *format = AV_PIX_FMT_BGRA ; return 4; - case AV_PIX_FMT_0RGB : *format = AV_PIX_FMT_ARGB ; return 1; - case AV_PIX_FMT_RGB0 : *format = AV_PIX_FMT_RGBA ; return 4; - default: return 0; - } -} - -static int handle_xyz(enum AVPixelFormat *format) -{ - switch (*format) { - case AV_PIX_FMT_XYZ12BE : *format = AV_PIX_FMT_RGB48BE; return 1; - case AV_PIX_FMT_XYZ12LE : *format = AV_PIX_FMT_RGB48LE; return 1; - default: return 0; - } -} - -static void handle_formats(SwsContext *c) -{ - c->src0Alpha |= handle_0alpha(&c->srcFormat); - c->dst0Alpha |= handle_0alpha(&c->dstFormat); - c->srcXYZ |= handle_xyz(&c->srcFormat); - c->dstXYZ |= handle_xyz(&c->dstFormat); - if (c->srcXYZ || c->dstXYZ) - fill_xyztables(c); -} - SwsContext *sws_alloc_context(void) { SwsContext *c = av_mallocz(sizeof(SwsContext)); @@ -1235,62 +1261,11 @@ } } -static int context_init_threaded(SwsContext *c, - SwsFilter *src_filter, SwsFilter *dst_filter) -{ - int ret; - - ret = avpriv_slicethread_create(&c->slicethread, (void*)c, - ff_sws_slice_worker, NULL, c->nb_threads); - if (ret == AVERROR(ENOSYS)) { - c->nb_threads = 1; - return 0; - } else if (ret < 0) - return ret; - - c->nb_threads = ret; - - c->slice_ctx = av_calloc(c->nb_threads, sizeof(*c->slice_ctx)); - c->slice_err = av_calloc(c->nb_threads, sizeof(*c->slice_err)); - if (!c->slice_ctx || !c->slice_err) - return AVERROR(ENOMEM); - - for (int i = 0; i < c->nb_threads; i++) { - c->slice_ctx[i] = sws_alloc_context(); - if (!c->slice_ctx[i]) - return AVERROR(ENOMEM); - - c->slice_ctx[i]->parent = c; - - ret = av_opt_copy((void*)c->slice_ctx[i], (void*)c); - if (ret < 0) - return ret; - - c->slice_ctx[i]->nb_threads = 1; - - ret = sws_init_context(c->slice_ctx[i], src_filter, dst_filter); - if (ret < 0) - return ret; - - c->nb_slice_ctx++; - - if (c->slice_ctx[i]->dither == SWS_DITHER_ED) { - av_log(c, AV_LOG_VERBOSE, - "Error-diffusion dither is in use, scaling will be single-threaded."); - break; - } - } - - c->frame_src = av_frame_alloc(); - c->frame_dst = av_frame_alloc(); - if (!c->frame_src || !c->frame_dst) - return AVERROR(ENOMEM); - - return 0; -} +static int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, + SwsFilter *dstFilter); -av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, - SwsFilter *dstFilter) +static av_cold int sws_init_single_context(SwsContext *c, SwsFilter *srcFilter, + SwsFilter *dstFilter) { int i; int usesVFilter, usesHFilter; @@ -1302,36 +1277,19 @@ int dstH = c->dstH; int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 66, 16); int flags, cpu_flags; - enum AVPixelFormat srcFormat = c->srcFormat; - enum AVPixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat srcFormat, dstFormat; const AVPixFmtDescriptor *desc_src; const AVPixFmtDescriptor *desc_dst; int ret = 0; enum AVPixelFormat tmpFmt; static const float float_mult = 1.0f / 255.0f; - static AVOnce rgb2rgb_once = AV_ONCE_INIT; - - if (c->nb_threads != 1) { - ret = context_init_threaded(c, srcFilter, dstFilter); - if (ret < 0 || c->nb_threads > 1) - return ret; - // threading disabled in this build, init as single-threaded - } cpu_flags = av_get_cpu_flags(); flags = c->flags; emms_c(); - if (ff_thread_once(&rgb2rgb_once, ff_sws_rgb2rgb_init) != 0) - return AVERROR_UNKNOWN; unscaled = (srcW == dstW && srcH == dstH); - c->srcRange |= handle_jpeg(&c->srcFormat); - c->dstRange |= handle_jpeg(&c->dstFormat); - - if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat) - av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n"); - if (!c->contrast && !c->saturation && !c->dstFormatBpp) sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], @@ -1349,16 +1307,16 @@ if (!(unscaled && sws_isSupportedEndiannessConversion(srcFormat) && av_pix_fmt_swap_endianness(srcFormat) == dstFormat)) { - if (!sws_isSupportedInput(srcFormat)) { - av_log(c, AV_LOG_ERROR, "%s is not supported as input pixel format\n", - av_get_pix_fmt_name(srcFormat)); - return AVERROR(EINVAL); - } - if (!sws_isSupportedOutput(dstFormat)) { - av_log(c, AV_LOG_ERROR, "%s is not supported as output pixel format\n", - av_get_pix_fmt_name(dstFormat)); - return AVERROR(EINVAL); - } + if (!sws_isSupportedInput(srcFormat)) { + av_log(c, AV_LOG_ERROR, "%s is not supported as input pixel format\n", + av_get_pix_fmt_name(srcFormat)); + return AVERROR(EINVAL); + } + if (!sws_isSupportedOutput(dstFormat)) { + av_log(c, AV_LOG_ERROR, "%s is not supported as output pixel format\n", + av_get_pix_fmt_name(dstFormat)); + return AVERROR(EINVAL); + } } av_assert2(desc_src && desc_dst); @@ -1552,11 +1510,6 @@ if (!FF_ALLOCZ_TYPED_ARRAY(c->formatConvBuffer, FFALIGN(srcW * 2 + 78, 16) * 2)) goto nomem; - c->frame_src = av_frame_alloc(); - c->frame_dst = av_frame_alloc(); - if (!c->frame_src || !c->frame_dst) - goto nomem; - c->srcBpc = desc_src->comp[0].depth; if (c->srcBpc < 8) c->srcBpc = 8; @@ -1748,19 +1701,50 @@ } } -#if HAVE_MMAP && HAVE_MPROTECT && defined(MAP_ANONYMOUS) -#define USE_MMAP 1 -#else -#define USE_MMAP 0 -#endif + /* alpha blend special case, note this has been split via cascaded contexts if its scaled */ + if (unscaled && !usesHFilter && !usesVFilter && + c->alphablend != SWS_ALPHA_BLEND_NONE && + isALPHA(srcFormat) && + (c->srcRange == c->dstRange || isAnyRGB(dstFormat)) && + alphaless_fmt(srcFormat) == dstFormat + ) { + c->convert_unscaled = ff_sws_alphablendaway; - /* precalculate horizontal scaler filter coefficients */ - { -#if HAVE_MMXEXT_INLINE -// can't downscale !!! - if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) { - c->lumMmxextFilterCodeSize = ff_init_hscaler_mmxext(dstW, c->lumXInc, NULL, - NULL, NULL, 8); + if (flags & SWS_PRINT_INFO) + av_log(c, AV_LOG_INFO, + "using alpha blendaway %s -> %s special converter\n", + av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat)); + return 0; + } + + /* unscaled special cases */ + if (unscaled && !usesHFilter && !usesVFilter && + (c->srcRange == c->dstRange || isAnyRGB(dstFormat) || + isFloat(srcFormat) || isFloat(dstFormat))){ + ff_get_unscaled_swscale(c); + + if (c->convert_unscaled) { + if (flags & SWS_PRINT_INFO) + av_log(c, AV_LOG_INFO, + "using unscaled %s -> %s special converter\n", + av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat)); + return 0; + } + } + +#if HAVE_MMAP && HAVE_MPROTECT && defined(MAP_ANONYMOUS) +#define USE_MMAP 1 +#else +#define USE_MMAP 0 +#endif + + /* precalculate horizontal scaler filter coefficients */ + { +#if HAVE_MMXEXT_INLINE +// can't downscale !!! + if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) { + c->lumMmxextFilterCodeSize = ff_init_hscaler_mmxext(dstW, c->lumXInc, NULL, + NULL, NULL, 8); c->chrMmxextFilterCodeSize = ff_init_hscaler_mmxext(c->chrDstW, c->chrXInc, NULL, NULL, NULL, 4); @@ -1821,7 +1805,8 @@ { const int filterAlign = X86_MMX(cpu_flags) ? 4 : PPC_ALTIVEC(cpu_flags) ? 8 : - have_neon(cpu_flags) ? 4 : 1; + have_neon(cpu_flags) ? 4 : + have_lasx(cpu_flags) ? 8 : 1; if ((ret = initFilter(&c->hLumFilter, &c->hLumFilterPos, &c->hLumFilterSize, c->lumXInc, @@ -1932,8 +1917,6 @@ if (INLINE_MMXEXT(cpu_flags)) cpucaps = "MMXEXT"; - else if (INLINE_AMD3DNOW(cpu_flags)) - cpucaps = "3DNOW"; else if (INLINE_MMX(cpu_flags)) cpucaps = "MMX"; else if (PPC_ALTIVEC(cpu_flags)) @@ -1953,37 +1936,6 @@ c->chrXInc, c->chrYInc); } - /* alpha blend special case, note this has been split via cascaded contexts if its scaled */ - if (unscaled && !usesHFilter && !usesVFilter && - c->alphablend != SWS_ALPHA_BLEND_NONE && - isALPHA(srcFormat) && - (c->srcRange == c->dstRange || isAnyRGB(dstFormat)) && - alphaless_fmt(srcFormat) == dstFormat - ) { - c->convert_unscaled = ff_sws_alphablendaway; - - if (flags & SWS_PRINT_INFO) - av_log(c, AV_LOG_INFO, - "using alpha blendaway %s -> %s special converter\n", - av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat)); - return 0; - } - - /* unscaled special cases */ - if (unscaled && !usesHFilter && !usesVFilter && - (c->srcRange == c->dstRange || isAnyRGB(dstFormat) || - isFloat(srcFormat) || isFloat(dstFormat))){ - ff_get_unscaled_swscale(c); - - if (c->convert_unscaled) { - if (flags & SWS_PRINT_INFO) - av_log(c, AV_LOG_INFO, - "using unscaled %s -> %s special converter\n", - av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat)); - return 0; - } - } - ff_sws_init_scale(c); return ff_init_filters(c); @@ -2022,6 +1974,88 @@ return ret; } +static int context_init_threaded(SwsContext *c, + SwsFilter *src_filter, SwsFilter *dst_filter) +{ + int ret; + + ret = avpriv_slicethread_create(&c->slicethread, (void*)c, + ff_sws_slice_worker, NULL, c->nb_threads); + if (ret == AVERROR(ENOSYS)) { + c->nb_threads = 1; + return 0; + } else if (ret < 0) + return ret; + + c->nb_threads = ret; + + c->slice_ctx = av_calloc(c->nb_threads, sizeof(*c->slice_ctx)); + c->slice_err = av_calloc(c->nb_threads, sizeof(*c->slice_err)); + if (!c->slice_ctx || !c->slice_err) + return AVERROR(ENOMEM); + + for (int i = 0; i < c->nb_threads; i++) { + c->slice_ctx[i] = sws_alloc_context(); + if (!c->slice_ctx[i]) + return AVERROR(ENOMEM); + + c->slice_ctx[i]->parent = c; + + ret = av_opt_copy((void*)c->slice_ctx[i], (void*)c); + if (ret < 0) + return ret; + + c->slice_ctx[i]->nb_threads = 1; + + ret = sws_init_single_context(c->slice_ctx[i], src_filter, dst_filter); + if (ret < 0) + return ret; + + c->nb_slice_ctx++; + + if (c->slice_ctx[i]->dither == SWS_DITHER_ED) { + av_log(c, AV_LOG_VERBOSE, + "Error-diffusion dither is in use, scaling will be single-threaded."); + break; + } + } + + return 0; +} + +av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, + SwsFilter *dstFilter) +{ + static AVOnce rgb2rgb_once = AV_ONCE_INIT; + enum AVPixelFormat src_format, dst_format; + int ret; + + c->frame_src = av_frame_alloc(); + c->frame_dst = av_frame_alloc(); + if (!c->frame_src || !c->frame_dst) + return AVERROR(ENOMEM); + + if (ff_thread_once(&rgb2rgb_once, ff_sws_rgb2rgb_init) != 0) + return AVERROR_UNKNOWN; + + src_format = c->srcFormat; + dst_format = c->dstFormat; + c->srcRange |= handle_jpeg(&c->srcFormat); + c->dstRange |= handle_jpeg(&c->dstFormat); + + if (src_format != c->srcFormat || dst_format != c->dstFormat) + av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n"); + + if (c->nb_threads != 1) { + ret = context_init_threaded(c, srcFilter, dstFilter); + if (ret < 0 || c->nb_threads > 1) + return ret; + // threading disabled in this build, init as single-threaded + } + + return sws_init_single_context(c, srcFilter, dstFilter); +} + SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, const double *param) @@ -2084,89 +2118,6 @@ a->coeff[i] = NAN; } -SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, - float lumaSharpen, float chromaSharpen, - float chromaHShift, float chromaVShift, - int verbose) -{ - SwsFilter *filter = av_malloc(sizeof(SwsFilter)); - if (!filter) - return NULL; - - if (lumaGBlur != 0.0) { - filter->lumH = sws_getGaussianVec(lumaGBlur, 3.0); - filter->lumV = sws_getGaussianVec(lumaGBlur, 3.0); - } else { - filter->lumH = sws_getIdentityVec(); - filter->lumV = sws_getIdentityVec(); - } - - if (chromaGBlur != 0.0) { - filter->chrH = sws_getGaussianVec(chromaGBlur, 3.0); - filter->chrV = sws_getGaussianVec(chromaGBlur, 3.0); - } else { - filter->chrH = sws_getIdentityVec(); - filter->chrV = sws_getIdentityVec(); - } - - if (!filter->lumH || !filter->lumV || !filter->chrH || !filter->chrV) - goto fail; - - if (chromaSharpen != 0.0) { - SwsVector *id = sws_getIdentityVec(); - if (!id) - goto fail; - sws_scaleVec(filter->chrH, -chromaSharpen); - sws_scaleVec(filter->chrV, -chromaSharpen); - sws_addVec(filter->chrH, id); - sws_addVec(filter->chrV, id); - sws_freeVec(id); - } - - if (lumaSharpen != 0.0) { - SwsVector *id = sws_getIdentityVec(); - if (!id) - goto fail; - sws_scaleVec(filter->lumH, -lumaSharpen); - sws_scaleVec(filter->lumV, -lumaSharpen); - sws_addVec(filter->lumH, id); - sws_addVec(filter->lumV, id); - sws_freeVec(id); - } - - if (chromaHShift != 0.0) - sws_shiftVec(filter->chrH, (int)(chromaHShift + 0.5)); - - if (chromaVShift != 0.0) - sws_shiftVec(filter->chrV, (int)(chromaVShift + 0.5)); - - sws_normalizeVec(filter->chrH, 1.0); - sws_normalizeVec(filter->chrV, 1.0); - sws_normalizeVec(filter->lumH, 1.0); - sws_normalizeVec(filter->lumV, 1.0); - - if (isnan_vec(filter->chrH) || - isnan_vec(filter->chrV) || - isnan_vec(filter->lumH) || - isnan_vec(filter->lumV)) - goto fail; - - if (verbose) - sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG); - if (verbose) - sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG); - - return filter; - -fail: - sws_freeVec(filter->lumH); - sws_freeVec(filter->lumV); - sws_freeVec(filter->chrH); - sws_freeVec(filter->chrV); - av_freep(&filter); - return NULL; -} - SwsVector *sws_allocVec(int length) { SwsVector *vec; @@ -2378,6 +2329,89 @@ av_free(filter); } +SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, + float lumaSharpen, float chromaSharpen, + float chromaHShift, float chromaVShift, + int verbose) +{ + SwsFilter *filter = av_malloc(sizeof(SwsFilter)); + if (!filter) + return NULL; + + if (lumaGBlur != 0.0) { + filter->lumH = sws_getGaussianVec(lumaGBlur, 3.0); + filter->lumV = sws_getGaussianVec(lumaGBlur, 3.0); + } else { + filter->lumH = sws_getIdentityVec(); + filter->lumV = sws_getIdentityVec(); + } + + if (chromaGBlur != 0.0) { + filter->chrH = sws_getGaussianVec(chromaGBlur, 3.0); + filter->chrV = sws_getGaussianVec(chromaGBlur, 3.0); + } else { + filter->chrH = sws_getIdentityVec(); + filter->chrV = sws_getIdentityVec(); + } + + if (!filter->lumH || !filter->lumV || !filter->chrH || !filter->chrV) + goto fail; + + if (chromaSharpen != 0.0) { + SwsVector *id = sws_getIdentityVec(); + if (!id) + goto fail; + sws_scaleVec(filter->chrH, -chromaSharpen); + sws_scaleVec(filter->chrV, -chromaSharpen); + sws_addVec(filter->chrH, id); + sws_addVec(filter->chrV, id); + sws_freeVec(id); + } + + if (lumaSharpen != 0.0) { + SwsVector *id = sws_getIdentityVec(); + if (!id) + goto fail; + sws_scaleVec(filter->lumH, -lumaSharpen); + sws_scaleVec(filter->lumV, -lumaSharpen); + sws_addVec(filter->lumH, id); + sws_addVec(filter->lumV, id); + sws_freeVec(id); + } + + if (chromaHShift != 0.0) + sws_shiftVec(filter->chrH, (int)(chromaHShift + 0.5)); + + if (chromaVShift != 0.0) + sws_shiftVec(filter->chrV, (int)(chromaVShift + 0.5)); + + sws_normalizeVec(filter->chrH, 1.0); + sws_normalizeVec(filter->chrV, 1.0); + sws_normalizeVec(filter->lumH, 1.0); + sws_normalizeVec(filter->lumV, 1.0); + + if (isnan_vec(filter->chrH) || + isnan_vec(filter->chrV) || + isnan_vec(filter->lumH) || + isnan_vec(filter->lumV)) + goto fail; + + if (verbose) + sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG); + if (verbose) + sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG); + + return filter; + +fail: + sws_freeVec(filter->lumH); + sws_freeVec(filter->lumV); + sws_freeVec(filter->chrH); + sws_freeVec(filter->chrV); + av_freep(&filter); + return NULL; +} + void sws_freeContext(SwsContext *c) { int i; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version.h 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ #include "version_major.h" -#define LIBSWSCALE_VERSION_MINOR 7 +#define LIBSWSCALE_VERSION_MINOR 1 #define LIBSWSCALE_VERSION_MICRO 100 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version_major.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version_major.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version_major.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/version_major.h 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ * swscale version macros */ -#define LIBSWSCALE_VERSION_MAJOR 6 +#define LIBSWSCALE_VERSION_MAJOR 7 /** * FF_API_* defines may be placed below to indicate public API that will be diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/input.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/input.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/input.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/input.asm 2023-03-03 13:29:59.000000000 +0000 @@ -207,7 +207,7 @@ mova [dstq+wq], m0 add wq, mmsize jl .loop - REP_RET + RET %endif ; ARCH_X86_64 && %0 == 3 %endmacro @@ -313,7 +313,7 @@ mova [dstVq+wq], m2 add wq, mmsize jl .loop - REP_RET + RET %endif ; ARCH_X86_64 && %0 == 3 %endmacro @@ -394,7 +394,7 @@ add wq, 2 jl .loop2 .end: - REP_RET + RET %endif ; %0 == 3 %endmacro @@ -491,7 +491,7 @@ add wq, 2 jl .loop2 .end: - REP_RET + RET %endif ; ARCH_X86_64 && %0 == 3 %endmacro @@ -543,7 +543,7 @@ mova [dstq+wq], m0 add wq, mmsize jl .loop_%1 - REP_RET + RET %endmacro ; %1 = nr. of XMM registers @@ -599,7 +599,7 @@ movhps [dstVq+wq], m1 add wq, mmsize / 2 jl .loop_%1 - REP_RET + RET %endmacro ; %1 = nr. of XMM registers @@ -657,7 +657,7 @@ %endif ; nv12/21 add wq, mmsize jl .loop_%1 - REP_RET + RET %endmacro ; %1 = nr. of XMM registers diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/output.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/output.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/output.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/output.asm 2023-03-03 13:29:59.000000000 +0000 @@ -44,11 +44,13 @@ pd_yuv2gbrp_uv_start: times 8 dd ((1 << 9) - (128 << 19)) pd_yuv2gbrp_a_start: times 8 dd (1 << 18) pd_yuv2gbrp16_offset: times 8 dd 0x10000 ;(1 << 16) -pd_yuv2gbrp16_round13: times 8 dd 0x02000 ;(1 << 13) +pd_yuv2gbrp16_round13: times 8 dd 0xE0002000 ;(1 << 13) - (1 << 29) pd_yuv2gbrp16_a_offset: times 8 dd 0x20002000 pd_yuv2gbrp16_upper30: times 8 dd 0x3FFFFFFF ;(1<<30) - 1 pd_yuv2gbrp16_upper27: times 8 dd 0x07FFFFFF ;(1<<27) - 1 +pd_yuv2gbrp16_upper16: times 8 dd 0x0000FFFF ;(1<<16) - 1 pd_yuv2gbrp16_upperC: times 8 dd 0xC0000000 +pd_yuv2gbrp_debias: times 8 dd 0x00008000 ;(1 << 29 - 14) pb_pack_shuffle8: db 0, 4, 8, 12, \ -1, -1, -1, -1, \ -1, -1, -1, -1, \ @@ -295,7 +297,7 @@ test dstq, 15 jnz .unaligned yuv2planeX_mainloop %1, a - REP_RET + RET .unaligned: yuv2planeX_mainloop %1, u %endif ; mmsize == 8/16 @@ -305,10 +307,10 @@ ADD rsp, pad RET %else ; x86-64 - REP_RET + RET %endif ; x86-32/64 %else ; %1 == 9/10/16 - REP_RET + RET %endif ; %1 == 8/9/10/16 %endmacro @@ -431,10 +433,10 @@ test dstq, 15 jnz .unaligned yuv2plane1_mainloop %1, a - REP_RET + RET .unaligned: yuv2plane1_mainloop %1, u - REP_RET + RET %endmacro INIT_XMM sse2 @@ -883,14 +885,26 @@ paddd G, Y paddd B, Y +%if DEPTH < 16 CLIPP2 R, 30 CLIPP2 G, 30 CLIPP2 B, 30 +%endif psrad R, RGB_SHIFT psrad G, RGB_SHIFT psrad B, RGB_SHIFT +%if DEPTH >= 16 + paddd R, [pd_yuv2gbrp_debias] + paddd G, [pd_yuv2gbrp_debias] + paddd B, [pd_yuv2gbrp_debias] + + CLIPP2 R, 16 + CLIPP2 G, 16 + CLIPP2 B, 16 +%endif + %if FLOAT cvtdq2ps R, R cvtdq2ps G, G diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/rgb_2_rgb.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/rgb_2_rgb.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/rgb_2_rgb.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/rgb_2_rgb.asm 2023-03-03 13:29:59.000000000 +0000 @@ -104,6 +104,7 @@ jl .loop_simd .end: + emms RET ;------------------------------------------------------------------------------ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale.asm 2023-03-03 13:29:59.000000000 +0000 @@ -357,7 +357,7 @@ add wq, 2 %endif ; %3 ==/!= X jl .loop - REP_RET + RET %endmacro ; SCALE_FUNCS source_width, intermediate_nbits, n_xmm diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale_avx2.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale_avx2.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale_avx2.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/scale_avx2.asm 2023-03-03 13:29:59.000000000 +0000 @@ -53,6 +53,9 @@ mova m14, [four] shr fltsized, 2 %endif + cmp wq, 0x10 + jl .tail_loop + sub wq, 0x10 .loop: movu m1, [fltposq] movu m2, [fltposq+32] @@ -101,8 +104,47 @@ add fltposq, 0x40 add countq, 0x10 cmp countq, wq - jl .loop -REP_RET + jle .loop + + add wq, 0x10 + cmp countq, wq + jge .end + +.tail_loop: + movu xm1, [fltposq] +%ifidn %1, X4 + pxor xm9, xm9 + pxor xm10, xm10 + xor innerq, innerq +.tail_innerloop: +%endif + vpcmpeqd xm13, xm13 + vpgatherdd xm3,[srcmemq + xm1], xm13 + vpunpcklbw xm5, xm3, xm0 + vpunpckhbw xm6, xm3, xm0 + vpmaddwd xm5, xm5, [filterq] + vpmaddwd xm6, xm6, [filterq + 0x10] + add filterq, 0x20 +%ifidn %1, X4 + paddd xm9, xm5 + paddd xm10, xm6 + paddd xm1, xm14 + add innerq, 1 + cmp innerq, fltsizeq + jl .tail_innerloop + vphaddd xm5, xm9, xm10 +%else + vphaddd xm5, xm5, xm6 +%endif + vpsrad xm5, 7 + vpackssdw xm5, xm5, xm5 + vmovq [dstq + countq * 2], xm5 + add fltposq, 0x10 + add countq, 0x4 + cmp countq, wq + jl .tail_loop +.end: +RET %endmacro %if ARCH_X86_64 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/swscale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/swscale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/swscale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/swscale.c 2023-03-03 13:29:59.000000000 +0000 @@ -205,20 +205,17 @@ int remainder = (dstW % step); \ int pixelsProcessed = dstW - remainder; \ if(((uintptr_t)dest) & 15){ \ - yuv2yuvX_mmx(filter, filterSize, src, dest, dstW, dither, offset); \ + yuv2yuvX_mmxext(filter, filterSize, src, dest, dstW, dither, offset); \ return; \ } \ if(pixelsProcessed > 0) \ ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \ if(remainder > 0){ \ - ff_yuv2yuvX_mmx(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \ + ff_yuv2yuvX_mmxext(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \ } \ return; \ } -#if HAVE_MMX_EXTERNAL -YUV2YUVX_FUNC_MMX(mmx, 16) -#endif #if HAVE_MMXEXT_EXTERNAL YUV2YUVX_FUNC_MMX(mmxext, 16) #endif @@ -299,13 +296,13 @@ #define INPUT_Y_FUNC(fmt, opt) \ void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \ const uint8_t *unused1, const uint8_t *unused2, \ - int w, uint32_t *unused) + int w, uint32_t *unused, void *opq) #define INPUT_UV_FUNC(fmt, opt) \ void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \ const uint8_t *unused0, \ const uint8_t *src1, \ const uint8_t *src2, \ - int w, uint32_t *unused) + int w, uint32_t *unused, void *opq) #define INPUT_FUNC(fmt, opt) \ INPUT_Y_FUNC(fmt, opt); \ INPUT_UV_FUNC(fmt, opt) @@ -373,15 +370,18 @@ #define INPUT_PLANAR_RGB_Y_FN_DECL(fmt, opt) \ void ff_planar_##fmt##_to_y_##opt(uint8_t *dst, \ - const uint8_t *src[4], int w, int32_t *rgb2yuv) + const uint8_t *src[4], int w, int32_t *rgb2yuv, \ + void *opq) #define INPUT_PLANAR_RGB_UV_FN_DECL(fmt, opt) \ void ff_planar_##fmt##_to_uv_##opt(uint8_t *dstU, uint8_t *dstV, \ - const uint8_t *src[4], int w, int32_t *rgb2yuv) + const uint8_t *src[4], int w, int32_t *rgb2yuv, \ + void *opq) #define INPUT_PLANAR_RGB_A_FN_DECL(fmt, opt) \ void ff_planar_##fmt##_to_a_##opt(uint8_t *dst, \ - const uint8_t *src[4], int w, int32_t *rgb2yuv) + const uint8_t *src[4], int w, int32_t *rgb2yuv, \ + void *opq) #define INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) \ @@ -534,7 +534,8 @@ ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2); ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse2, , HAVE_ALIGNED_STACK || ARCH_X86_64); - ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2); + if (!(c->flags & SWS_ACCURATE_RND)) + ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2); switch (c->srcFormat) { case AV_PIX_FMT_YA8: @@ -583,14 +584,15 @@ ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse4, if (!isBE(c->dstFormat)) c->yuv2planeX = ff_yuv2planeX_16_sse4, HAVE_ALIGNED_STACK || ARCH_X86_64); - if (c->dstBpc == 16 && !isBE(c->dstFormat)) + if (c->dstBpc == 16 && !isBE(c->dstFormat) && !(c->flags & SWS_ACCURATE_RND)) c->yuv2plane1 = ff_yuv2plane1_16_sse4; } if (EXTERNAL_AVX(cpu_flags)) { ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx, , HAVE_ALIGNED_STACK || ARCH_X86_64); - ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx); + if (!(c->flags & SWS_ACCURATE_RND)) + ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx); switch (c->srcFormat) { case AV_PIX_FMT_YUYV422: @@ -626,10 +628,8 @@ if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) { if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { - if (c->chrDstW % 16 == 0) - ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize); - if (c->dstW % 16 == 0) - ASSIGN_AVX2_SCALE_FUNC(c->hyScale, c->hLumFilterSize); + ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize); + ASSIGN_AVX2_SCALE_FUNC(c->hyScale, c->hLumFilterSize); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv_2_rgb.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv_2_rgb.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv_2_rgb.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv_2_rgb.asm 2023-03-03 13:29:59.000000000 +0000 @@ -354,7 +354,7 @@ add indexq, 4 * time_num js .loop0 -REP_RET +RET %endmacro diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv2yuvX.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv2yuvX.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv2yuvX.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/x86/yuv2yuvX.asm 2023-03-03 13:29:59.000000000 +0000 @@ -121,11 +121,9 @@ mov filterSizeq, filterq cmp offsetq, dstWq jb .outerloop - REP_RET + RET %endmacro -INIT_MMX mmx -YUV2YUVX_FUNC INIT_MMX mmxext YUV2YUVX_FUNC INIT_XMM sse3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/yuv2rgb.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/yuv2rgb.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/libswscale/yuv2rgb.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/libswscale/yuv2rgb.c 2023-03-03 13:29:59.000000000 +0000 @@ -683,6 +683,8 @@ t = ff_yuv2rgb_init_ppc(c); #elif ARCH_X86 t = ff_yuv2rgb_init_x86(c); +#elif ARCH_LOONGARCH64 + t = ff_yuv2rgb_init_loongarch(c); #endif if (t) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/MAINTAINERS mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/MAINTAINERS --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/MAINTAINERS 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/MAINTAINERS 2023-03-03 13:29:59.000000000 +0000 @@ -11,17 +11,11 @@ patches and related discussions. -Project Leader -============== - - final design decisions - - Applications ============ ffmpeg: - ffmpeg.c Michael Niedermayer + ffmpeg.c Michael Niedermayer, Anton Khirnov ffplay: ffplay.c Marton Balint @@ -40,7 +34,8 @@ =================== documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Gyan Doshi -project server Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov +project server day to day operations Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov +project server emergencies Árpád Gereöffy, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov presets Robert Swain metadata subsystem Aurelien Jacobs release management Michael Niedermayer @@ -115,8 +110,6 @@ lzw.* Michael Niedermayer floating point AAN DCT: faandct.c, faandct.h Michael Niedermayer - Non-power-of-two MDCT: - mdct15.c, mdct15.h Rostislav Pehlivanov Golomb coding: golomb.c, golomb.h Michael Niedermayer motion estimation: @@ -141,6 +134,7 @@ adpcm.c Zane van Iperen alacenc.c Jaikrishnan Menon alsdec.c Thilo Borgmann, Umair Khan + amfenc* Dmitrii Ovchinnikov aptx.c Aurelien Jacobs ass* Aurelien Jacobs asv* Michael Niedermayer @@ -157,7 +151,6 @@ ccaption_dec.c Anshul Maheshwari, Aman Gupta cljr Alex Beregszaszi cpia.c Stephan Hilb - crystalhd.c Philip Langdale cscd.c Reimar Doeffinger cuviddec.c Timo Rothenpieler dca* foo86 @@ -271,7 +264,6 @@ xwd* Paul B Mahol Hardware acceleration: - crystalhd.c Philip Langdale dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme d3d11va* Steve Lhomme mediacodec* Matthieu Bouron, Aman Gupta @@ -435,6 +427,7 @@ idcin.c Mike Melanson idroqdec.c Mike Melanson iff.c Jaikrishnan Menon + imf* Pierre-Anthony Lemieux img2*.c Michael Niedermayer ipmovie.c Mike Melanson ircam* Paul B Mahol @@ -632,6 +625,7 @@ Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029 Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E +Pierre-Anthony Lemieux (pal) F4B3 9492 E6F2 E4AF AEC8 46CB 698F A1F0 F8D4 EED4 Ramiro Polla 7859 C65B 751B 1179 792E DAE8 8E95 8B2F 9B6C 5700 Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -91,7 +91,7 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ - ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \ + ALTIVEC-OBJS VSX-OBJS RVV-OBJS MMX-OBJS X86ASM-OBJS \ MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ MMI-OBJS LSX-OBJS LASX-OBJS OBJS SLIBOBJS SHLIBOBJS \ STLIBOBJS HOSTOBJS TESTOBJS diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/RELEASE mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/RELEASE --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/RELEASE 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/RELEASE 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -5.1.2 +6.0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/RELEASE_NOTES mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/RELEASE_NOTES --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/RELEASE_NOTES 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/RELEASE_NOTES 2023-03-03 13:29:59.000000000 +0000 @@ -1,13 +1,10 @@ ┌────────────────────────────────────────────┐ - │ RELEASE NOTES for FFmpeg 5.1 "Riemann" LTS │ + │ RELEASE NOTES for FFmpeg 6.0 "Von Neumann" │ └────────────────────────────────────────────┘ - The FFmpeg Project proudly presents FFmpeg 5.1 "Riemann" LTS, about 6 - months after the release of FFmpeg 5.0, our first Long Term Support - release. While several past FFmpeg releases have enjoyed long term - support, this is the first release where such an intention is made - clear at release. + The FFmpeg Project proudly presents FFmpeg 6.0 "Von Neumann", about 6 + months after the release of FFmpeg 5.1. A complete Changelog is available at the root of the project, and the complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-h264-test.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-h264-test.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-h264-test.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-h264-test.c 2023-03-03 13:29:59.000000000 +0000 @@ -154,7 +154,7 @@ return number_of_written_bytes; } printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n", video_stream, - av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->pkt_duration, + av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->duration, number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes)); av_frame_unref(fr); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-seek-test.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-seek-test.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-seek-test.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/api/api-seek-test.c 2023-03-03 13:29:59.000000000 +0000 @@ -156,7 +156,7 @@ } av_frame_unref(fr); } - } while (result >= 0 && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end))); + } while (result >= 0 && (no_seeking || (fr->pts + fr->duration <= ts_end))); finish: av_freep(&byte_buffer); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/audiodsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/audiodsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/audiodsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/audiodsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -61,7 +61,7 @@ unsigned int len_bits_minus4, v1_bits, v2_bits, len; int32_t res0, res1; - declare_func_emms(AV_CPU_FLAG_MMX, int32_t, const int16_t *v1, const int16_t *v2, int len); + declare_func(int32_t, const int16_t *v1, const int16_t *v2, int len); // generate random 5-12bit vector length len_bits_minus4 = rnd() % 8; @@ -90,8 +90,8 @@ int32_t val1, val2, min, max; int len; - declare_func_emms(AV_CPU_FLAG_MMX, void, int32_t *dst, const int32_t *src, - int32_t min, int32_t max, unsigned int len); + declare_func(void, int32_t *dst, const int32_t *src, + int32_t min, int32_t max, unsigned int len); val1 = ((int32_t)rnd()); val1 = FFSIGN(val1) * (val1 & ((1 << 24) - 1)); @@ -120,8 +120,8 @@ float val1, val2, min, max; int i, len; - declare_func_emms(AV_CPU_FLAG_MMX, void, float *dst, const float *src, - int len, float min, float max); + declare_func(void, float *dst, const float *src, + int len, float min, float max); val1 = (float)rnd() / (UINT_MAX >> 1) - 1.0f; val2 = (float)rnd() / (UINT_MAX >> 1) - 1.0f; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/av_tx.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/av_tx.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/av_tx.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/av_tx.c 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,7 @@ #include -#define EPS 0.00005 +#define EPS 0.0005 #define SCALE_NOOP(x) (x) #define SCALE_INT20(x) (av_clip64(lrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX) >> 12) @@ -40,38 +40,39 @@ } while (0) static const int check_lens[] = { - 2, 4, 8, 16, 32, 64, 1024, 16384, + 2, 4, 8, 16, 32, 64, 120, 960, 1024, 1920, 16384, }; -static AVTXContext *tx_refs[6 /*AVTXType*/][FF_ARRAY_ELEMS(check_lens)]; +static AVTXContext *tx_refs[AV_TX_NB][2 /* Direction */][FF_ARRAY_ELEMS(check_lens)] = { 0 }; static int init = 0; static void free_tx_refs(void) { for (int i = 0; i < FF_ARRAY_ELEMS(tx_refs); i++) for (int j = 0; j < FF_ARRAY_ELEMS(*tx_refs); j++) - av_tx_uninit(&tx_refs[i][j]); + for (int k = 0; k < FF_ARRAY_ELEMS(**tx_refs); k++) + av_tx_uninit(&tx_refs[i][j][k]); } -#define CHECK_TEMPLATE(PREFIX, TYPE, DATA_TYPE, SCALE, LENGTHS, CHECK_EXPRESSION) \ +#define CHECK_TEMPLATE(PREFIX, TYPE, DIR, DATA_TYPE, SCALE_TYPE, LENGTHS, CHECK_EXPRESSION) \ do { \ int err; \ AVTXContext *tx; \ av_tx_fn fn; \ int num_checks = 0; \ int last_check = 0; \ - const void *scale = &SCALE; \ \ for (int i = 0; i < FF_ARRAY_ELEMS(LENGTHS); i++) { \ int len = LENGTHS[i]; \ + const SCALE_TYPE scale = 1.0 / len; \ \ - if ((err = av_tx_init(&tx, &fn, TYPE, 0, len, &scale, 0x0)) < 0) { \ + if ((err = av_tx_init(&tx, &fn, TYPE, DIR, len, &scale, 0x0)) < 0) { \ fprintf(stderr, "av_tx: %s\n", av_err2str(err)); \ return; \ } \ \ if (check_func(fn, PREFIX "_%i", len)) { \ - AVTXContext *tx_ref = tx_refs[TYPE][i]; \ + AVTXContext *tx_ref = tx_refs[TYPE][DIR][i]; \ if (!tx_ref) \ tx_ref = tx; \ num_checks++; \ @@ -84,8 +85,8 @@ break; \ } \ bench_new(tx, out_new, in, sizeof(DATA_TYPE)); \ - av_tx_uninit(&tx_refs[TYPE][i]); \ - tx_refs[TYPE][i] = tx; \ + av_tx_uninit(&tx_refs[TYPE][DIR][i]); \ + tx_refs[TYPE][DIR][i] = tx; \ } else { \ av_tx_uninit(&tx); \ } \ @@ -99,9 +100,6 @@ void checkasm_check_av_tx(void) { - const float scale_float = 1.0f; - const double scale_double = 1.0f; - declare_func(void, AVTXContext *tx, void *out, void *in, ptrdiff_t stride); void *in = av_malloc(16384*2*8); @@ -109,11 +107,14 @@ void *out_new = av_malloc(16384*2*8); randomize_complex(in, 16384, AVComplexFloat, SCALE_NOOP); - CHECK_TEMPLATE("float_fft", AV_TX_FLOAT_FFT, AVComplexFloat, scale_float, check_lens, + CHECK_TEMPLATE("float_fft", AV_TX_FLOAT_FFT, 0, AVComplexFloat, float, check_lens, !float_near_abs_eps_array(out_ref, out_new, EPS, len*2)); + CHECK_TEMPLATE("float_imdct", AV_TX_FLOAT_MDCT, 1, float, float, check_lens, + !float_near_abs_eps_array(out_ref, out_new, EPS, len)); + randomize_complex(in, 16384, AVComplexDouble, SCALE_NOOP); - CHECK_TEMPLATE("double_fft", AV_TX_DOUBLE_FFT, AVComplexDouble, scale_double, check_lens, + CHECK_TEMPLATE("double_fft", AV_TX_DOUBLE_FFT, 0, AVComplexDouble, double, check_lens, !double_near_abs_eps_array(out_ref, out_new, EPS, len*2)); av_free(in); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/blockdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/blockdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/blockdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/blockdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ #define check_clear(func, size) \ do { \ if (check_func(h.func, "blockdsp." #func)) { \ - declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block); \ + declare_func(void, int16_t *block); \ randomize_buffers(size); \ call_ref(buf0); \ call_new(buf1); \ @@ -57,10 +57,9 @@ LOCAL_ALIGNED_32(uint16_t, buf0, [6 * 8 * 8]); LOCAL_ALIGNED_32(uint16_t, buf1, [6 * 8 * 8]); - AVCodecContext avctx = { 0 }; BlockDSPContext h; - ff_blockdsp_init(&h, &avctx); + ff_blockdsp_init(&h); check_clear(clear_block, 8 * 8); check_clear(clear_blocks, 8 * 8 * 6); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.c 2023-03-03 13:29:59.000000000 +0000 @@ -96,7 +96,7 @@ #if CONFIG_EXR_DECODER { "exrdsp", checkasm_check_exrdsp }, #endif - #if CONFIG_FLACDSP + #if CONFIG_FLAC_DECODER { "flacdsp", checkasm_check_flacdsp }, #endif #if CONFIG_FMTCONVERT @@ -135,6 +135,9 @@ #if CONFIG_LLVIDENCDSP { "llviddspenc", checkasm_check_llviddspenc }, #endif + #if CONFIG_LPC + { "lpc", checkasm_check_lpc }, + #endif #if CONFIG_ME_CMP { "motion", checkasm_check_motion }, #endif @@ -165,6 +168,9 @@ #if CONFIG_VIDEODSP { "videodsp", checkasm_check_videodsp }, #endif + #if CONFIG_VORBIS_DECODER + { "vorbisdsp", checkasm_check_vorbisdsp }, + #endif #endif #if CONFIG_AVFILTER #if CONFIG_AFIR_FILTER @@ -191,6 +197,9 @@ #if CONFIG_THRESHOLD_FILTER { "vf_threshold", checkasm_check_vf_threshold }, #endif + #if CONFIG_SOBEL_FILTER + { "vf_sobel", checkasm_check_vf_sobel }, + #endif #endif #if CONFIG_SWSCALE { "sw_gbrp", checkasm_check_sw_gbrp }, @@ -226,6 +235,15 @@ { "ALTIVEC", "altivec", AV_CPU_FLAG_ALTIVEC }, { "VSX", "vsx", AV_CPU_FLAG_VSX }, { "POWER8", "power8", AV_CPU_FLAG_POWER8 }, +#elif ARCH_RISCV + { "RVI", "rvi", AV_CPU_FLAG_RVI }, + { "RVF", "rvf", AV_CPU_FLAG_RVF }, + { "RVD", "rvd", AV_CPU_FLAG_RVD }, + { "RVVi32", "rvv_i32", AV_CPU_FLAG_RVV_I32 }, + { "RVVf32", "rvv_f32", AV_CPU_FLAG_RVV_F32 }, + { "RVVi64", "rvv_i64", AV_CPU_FLAG_RVV_I64 }, + { "RVVf64", "rvv_f64", AV_CPU_FLAG_RVV_F64 }, + { "RVBbasic", "rvb_b", AV_CPU_FLAG_RVB_BASIC }, #elif ARCH_MIPS { "MMI", "mmi", AV_CPU_FLAG_MMI }, { "MSA", "msa", AV_CPU_FLAG_MSA }, @@ -903,5 +921,6 @@ DEF_CHECKASM_CHECK_FUNC(uint8_t, "%02x") DEF_CHECKASM_CHECK_FUNC(uint16_t, "%04x") +DEF_CHECKASM_CHECK_FUNC(uint32_t, "%08x") DEF_CHECKASM_CHECK_FUNC(int16_t, "%6d") DEF_CHECKASM_CHECK_FUNC(int32_t, "%9d") diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.h mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.h --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.h 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/checkasm.h 2023-03-03 13:29:59.000000000 +0000 @@ -68,6 +68,7 @@ void checkasm_check_jpeg2000dsp(void); void checkasm_check_llviddsp(void); void checkasm_check_llviddspenc(void); +void checkasm_check_lpc(void); void checkasm_check_motion(void); void checkasm_check_nlmeans(void); void checkasm_check_opusdsp(void); @@ -85,9 +86,11 @@ void checkasm_check_vf_gblur(void); void checkasm_check_vf_hflip(void); void checkasm_check_vf_threshold(void); +void checkasm_check_vf_sobel(void); void checkasm_check_vp8dsp(void); void checkasm_check_vp9dsp(void); void checkasm_check_videodsp(void); +void checkasm_check_vorbisdsp(void); struct CheckasmPerf; @@ -201,6 +204,16 @@ CLOB,CLOB,CLOB,CLOB,CLOB,CLOB,CLOB,CLOB,CLOB,CLOB,CLOB),\ checked_call(func_new, 0, 0, 0, 0, 0, 0, 0, __VA_ARGS__,\ 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0)) +#elif ARCH_RISCV +void checkasm_set_function(void *); +void *checkasm_get_wrapper(void); + +#if (__riscv_xlen == 64) && defined (__riscv_d) +#define declare_new(ret, ...) \ + ret (*checked_call)(__VA_ARGS__) = checkasm_get_wrapper(); +#define call_new(...) \ + (checkasm_set_function(func_new), checked_call(__VA_ARGS__)) +#endif #else #define declare_new(ret, ...) #define declare_new_float(ret, ...) @@ -230,8 +243,10 @@ ioctl(sysfd, PERF_EVENT_IOC_ENABLE, 0); \ } while (0) #define PERF_STOP(t) do { \ + int ret; \ ioctl(sysfd, PERF_EVENT_IOC_DISABLE, 0); \ - read(sysfd, &t, sizeof(t)); \ + ret = read(sysfd, &t, sizeof(t)); \ + (void)ret; \ } while (0) #elif CONFIG_MACOS_KPERF #define PERF_START(t) t = ff_kperf_cycles() @@ -282,6 +297,7 @@ DECL_CHECKASM_CHECK_FUNC(uint8_t); DECL_CHECKASM_CHECK_FUNC(uint16_t); +DECL_CHECKASM_CHECK_FUNC(uint32_t); DECL_CHECKASM_CHECK_FUNC(int16_t); DECL_CHECKASM_CHECK_FUNC(int32_t); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/flacdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/flacdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/flacdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/flacdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -76,12 +76,12 @@ int i, j; for (i = 0; i < 2; i++) { - ff_flacdsp_init(&h, fmts[i].fmt, 2, 0); + ff_flacdsp_init(&h, fmts[i].fmt, 2); for (j = 0; j < 3; j++) if (check_func(h.decorrelate[j], "flac_decorrelate_%s_%d", names[j], fmts[i].bits)) check_decorrelate(&ref_dst, ref_src, &new_dst, new_src, 2, fmts[i].bits); for (j = 2; j <= MAX_CHANNELS; j += 2) { - ff_flacdsp_init(&h, fmts[i].fmt, j, 0); + ff_flacdsp_init(&h, fmts[i].fmt, j); if (check_func(h.decorrelate[0], "flac_decorrelate_indep%d_%d", j, fmts[i].bits)) check_decorrelate(&ref_dst, ref_src, &new_dst, new_src, j, fmts[i].bits); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/fmtconvert.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/fmtconvert.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/fmtconvert.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/fmtconvert.c 2023-03-03 13:29:59.000000000 +0000 @@ -56,7 +56,7 @@ for (i = 0; i < FF_ARRAY_ELEMS(scale_arr); i++) scale_arr[i] = (FF_ARRAY_ELEMS(scale_arr) - FF_ARRAY_ELEMS(scale_arr) / 2) / 13; - ff_fmt_convert_init(&c, NULL); + ff_fmt_convert_init(&c); memset(dst0, 0, sizeof(*dst0) * BUF_SIZE); memset(dst1, 0, sizeof(*dst1) * BUF_SIZE); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/hevc_add_res.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/hevc_add_res.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/hevc_add_res.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/hevc_add_res.c 2023-03-03 13:29:59.000000000 +0000 @@ -36,14 +36,14 @@ } \ } while (0) -#define randomize_buffers2(buf, size) \ +#define randomize_buffers2(buf, size, mask) \ do { \ int j; \ for (j = 0; j < size; j++) \ - AV_WN16A(buf + j * 2, rnd() & 0x3FF); \ + AV_WN16A(buf + j * 2, rnd() & mask); \ } while (0) -static void compare_add_res(int size, ptrdiff_t stride, int overflow_test) +static void compare_add_res(int size, ptrdiff_t stride, int overflow_test, int mask) { LOCAL_ALIGNED_32(int16_t, res0, [32 * 32]); LOCAL_ALIGNED_32(int16_t, res1, [32 * 32]); @@ -53,7 +53,7 @@ declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, int16_t *res, ptrdiff_t stride); randomize_buffers(res0, size); - randomize_buffers2(dst0, size); + randomize_buffers2(dst0, size, mask); if (overflow_test) res0[0] = 0x8000; memcpy(res1, res0, sizeof(*res0) * size); @@ -69,6 +69,7 @@ static void check_add_res(HEVCDSPContext h, int bit_depth) { int i; + int mask = bit_depth == 8 ? 0xFFFF : bit_depth == 10 ? 0x03FF : 0x07FF; for (i = 2; i <= 5; i++) { int block_size = 1 << i; @@ -76,9 +77,9 @@ ptrdiff_t stride = block_size << (bit_depth > 8); if (check_func(h.add_residual[i - 2], "hevc_add_res_%dx%d_%d", block_size, block_size, bit_depth)) { - compare_add_res(size, stride, 0); + compare_add_res(size, stride, 0, mask); // overflow test for res = -32768 - compare_add_res(size, stride, 1); + compare_add_res(size, stride, 1, mask); } } } @@ -87,7 +88,7 @@ { int bit_depth; - for (bit_depth = 8; bit_depth <= 10; bit_depth++) { + for (bit_depth = 8; bit_depth <= 12; bit_depth++) { HEVCDSPContext h; ff_hevc_dsp_init(&h, bit_depth); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/huffyuvdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/huffyuvdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/huffyuvdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/huffyuvdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -42,7 +42,7 @@ uint16_t *dst0 = av_mallocz(width * sizeof(uint16_t)); uint16_t *dst1 = av_mallocz(width * sizeof(uint16_t)); - declare_func_emms(AV_CPU_FLAG_MMX, void, uint16_t *dst, uint16_t *src, unsigned mask, int w); + declare_func(void, uint16_t *dst, uint16_t *src, unsigned mask, int w); if (!src0 || !src1 || !dst0 || !dst1) fail(); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/idctdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/idctdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/idctdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/idctdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -79,7 +79,7 @@ for (size_t t = 0; t < FF_ARRAY_ELEMS(tests); ++t) { void (*func)(const int16_t *, uint8_t * ptrdiff_t) = *(void **)((intptr_t) &h + tests[t].offset); if (check_func(func, "idctdsp.%s", tests[t].name)) { - declare_func_emms(AV_CPU_FLAG_MMX, void, const int16_t *, uint8_t *, ptrdiff_t); + declare_func(void, const int16_t *, uint8_t *, ptrdiff_t); RANDOMIZE_BUFFER16(src, 64); RANDOMIZE_BUFFER8(dst, 10 * 24); call_ref(src0, dst0 + 24 + 8, 24); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,7 +48,7 @@ uint8_t *dst1 = av_mallocz(width); uint8_t *src0 = av_calloc(width, sizeof(*src0)); uint8_t *src1 = av_calloc(width, sizeof(*src1)); - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t w); + declare_func(void, uint8_t *dst, uint8_t *src, ptrdiff_t w); init_buffer(src0, src1, uint8_t, width); @@ -78,9 +78,9 @@ uint8_t *src1 = av_calloc(width, sizeof(*src1)); uint8_t *diff0 = av_calloc(width, sizeof(*diff0)); uint8_t *diff1 = av_calloc(width, sizeof(*diff1)); - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const uint8_t *src1, - const uint8_t *diff, ptrdiff_t w, - int *left, int *left_top); + declare_func(void, uint8_t *dst, const uint8_t *src1, + const uint8_t *diff, ptrdiff_t w, + int *left, int *left_top); init_buffer(src0, src1, uint8_t, width); init_buffer(diff0, diff1, uint8_t, width); @@ -114,7 +114,7 @@ uint8_t *dst1 = av_mallocz(width); uint8_t *src0 = av_calloc(width, sizeof(*src0)); uint8_t *src1 = av_calloc(width, sizeof(*src1)); - declare_func_emms(AV_CPU_FLAG_MMX, int, uint8_t *dst, uint8_t *src, ptrdiff_t w, int acc); + declare_func(int, uint8_t *dst, uint8_t *src, ptrdiff_t w, int acc); init_buffer(src0, src1, uint8_t, width); @@ -143,7 +143,7 @@ uint16_t *dst1 = av_calloc(width, sizeof(*dst1)); uint16_t *src0 = av_calloc(width, sizeof(*src0)); uint16_t *src1 = av_calloc(width, sizeof(*src1)); - declare_func_emms(AV_CPU_FLAG_MMX, int, uint16_t *dst, uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc); + declare_func(int, uint16_t *dst, uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc); init_buffer(src0, src1, uint16_t, width); @@ -168,8 +168,8 @@ static void check_add_gradient_pred(LLVidDSPContext c, int w) { int src_size, stride; uint8_t *src0, *src1; - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *src, const ptrdiff_t stride, - const ptrdiff_t width); + declare_func(void, uint8_t *src, const ptrdiff_t stride, + const ptrdiff_t width); stride = w + 32; src_size = (stride + 32) * 2; /* dsp need previous line, and ignore the start of the line */ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddspenc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddspenc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddspenc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/llviddspenc.c 2023-03-03 13:29:59.000000000 +0000 @@ -52,8 +52,8 @@ LOCAL_ALIGNED_32(uint8_t, src2, [MAX_STRIDE]); LOCAL_ALIGNED_32(uint8_t, src3, [MAX_STRIDE]); - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const uint8_t *src1, - const uint8_t *src2, intptr_t w); + declare_func(void, uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, intptr_t w); memset(dst0, 0, MAX_STRIDE); memset(dst1, 0, MAX_STRIDE); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/lpc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/lpc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/lpc.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/lpc.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "libavutil/mem_internal.h" + +#include "libavcodec/lpc.h" + +#include "checkasm.h" + +#define randomize_int32(buf, len) \ + do { \ + for (int i = 0; i < len; i++) { \ + int32_t f = ((int)(UINT32_MAX >> 17)) - ((int)(rnd() >> 16)); \ + buf[i] = f; \ + } \ + } while (0) + +#define EPS 0.005 + +static void test_window(int len) +{ + LOCAL_ALIGNED(16, int32_t, src, [5000]); + LOCAL_ALIGNED(16, double, dst0, [5000]); + LOCAL_ALIGNED(16, double, dst1, [5000]); + + declare_func(void, const int32_t *in, ptrdiff_t len, double *out); + + randomize_int32(src, len); + + call_ref(src, len, dst0); + call_new(src, len, dst1); + + for (int i = 0; i < len; i++) { + if (!double_near_abs_eps(dst0[i], dst1[i], EPS)) { + fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", + i, dst0[i], dst1[i], dst0[i] - dst1[i]); + fail(); + break; + } + } + + bench_new(src, len, dst1); +} + +void checkasm_check_lpc(void) +{ + LPCContext ctx; + int len = rnd() % 5000; + ff_lpc_init(&ctx, 32, 16, FF_LPC_TYPE_DEFAULT); + + if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_even")) { + test_window(len & ~1); + } + report("apply_welch_window_even"); + + if (check_func(ctx.lpc_apply_welch_window, "apply_welch_window_odd")) { + test_window(len | 1); + } + report("apply_welch_window_odd"); + + ff_lpc_end(&ctx); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -3,7 +3,6 @@ AVCODECOBJS-$(CONFIG_AUDIODSP) += audiodsp.o AVCODECOBJS-$(CONFIG_BLOCKDSP) += blockdsp.o AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o -AVCODECOBJS-$(CONFIG_FLACDSP) += flacdsp.o AVCODECOBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o AVCODECOBJS-$(CONFIG_G722DSP) += g722dsp.o AVCODECOBJS-$(CONFIG_H264DSP) += h264dsp.o @@ -12,6 +11,7 @@ AVCODECOBJS-$(CONFIG_IDCTDSP) += idctdsp.o AVCODECOBJS-$(CONFIG_LLVIDDSP) += llviddsp.o AVCODECOBJS-$(CONFIG_LLVIDENCDSP) += llviddspenc.o +AVCODECOBJS-$(CONFIG_LPC) += lpc.o AVCODECOBJS-$(CONFIG_ME_CMP) += motion.o AVCODECOBJS-$(CONFIG_VC1DSP) += vc1dsp.o AVCODECOBJS-$(CONFIG_VP8DSP) += vp8dsp.o @@ -23,6 +23,7 @@ AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o AVCODECOBJS-$(CONFIG_EXR_DECODER) += exrdsp.o +AVCODECOBJS-$(CONFIG_FLAC_DECODER) += flacdsp.o AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuvdsp.o AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o AVCODECOBJS-$(CONFIG_OPUS_DECODER) += opusdsp.o @@ -31,6 +32,7 @@ AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodsp.o AVCODECOBJS-$(CONFIG_V210_DECODER) += v210dec.o AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o +AVCODECOBJS-$(CONFIG_VORBIS_DECODER) += vorbisdsp.o AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes) @@ -44,6 +46,7 @@ AVFILTEROBJS-$(CONFIG_HFLIP_FILTER) += vf_hflip.o AVFILTEROBJS-$(CONFIG_THRESHOLD_FILTER) += vf_threshold.o AVFILTEROBJS-$(CONFIG_NLMEANS_FILTER) += vf_nlmeans.o +AVFILTEROBJS-$(CONFIG_SOBEL_FILTER) += vf_convolution.o CHECKASMOBJS-$(CONFIG_AVFILTER) += $(AVFILTEROBJS-yes) @@ -61,6 +64,7 @@ CHECKASMOBJS-$(ARCH_AARCH64) += aarch64/checkasm.o CHECKASMOBJS-$(HAVE_ARMV5TE_EXTERNAL) += arm/checkasm.o +CHECKASMOBJS-$(ARCH_RISCV) += riscv/checkasm.o CHECKASMOBJS-$(HAVE_X86ASM) += x86/checkasm.o CHECKASMOBJS += $(CHECKASMOBJS-yes) checkasm.o diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/motion.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/motion.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/motion.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/motion.c 2023-03-03 13:29:59.000000000 +0000 @@ -45,7 +45,7 @@ /* motion estimation can look up to 17 bytes ahead */ static const int look_ahead = 17; - int i, x, y, d1, d2; + int i, x, y, h, d1, d2; uint8_t *ptr; LOCAL_ALIGNED_16(uint8_t, img1, [WIDTH * HEIGHT]); @@ -68,18 +68,21 @@ for (i = 0; i < ITERATIONS; i++) { x = rnd() % (WIDTH - look_ahead); y = rnd() % (HEIGHT - look_ahead); + // Pick a random h between 4 and 16; pick an even value. + h = 4 + ((rnd() % (16 + 1 - 4)) & ~1); ptr = img2 + y * WIDTH + x; - d2 = call_ref(NULL, img1, ptr, WIDTH, 8); - d1 = call_new(NULL, img1, ptr, WIDTH, 8); + d2 = call_ref(NULL, img1, ptr, WIDTH, h); + d1 = call_new(NULL, img1, ptr, WIDTH, h); if (d1 != d2) { fail(); - printf("func: %s, x=%d y=%d, error: asm=%d c=%d\n", name, x, y, d1, d2); + printf("func: %s, x=%d y=%d h=%d, error: asm=%d c=%d\n", name, x, y, h, d1, d2); break; } } - // benchmark with the final value of ptr + // Test with a fixed offset, for benchmark stability + ptr = img2 + 3 * WIDTH + 3; bench_new(NULL, img1, ptr, WIDTH, 8); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/pixblockdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/pixblockdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/pixblockdsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/pixblockdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -48,7 +48,7 @@ #define check_get_pixels(type, aligned) \ do { \ int i; \ - declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size); \ + declare_func(void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size); \ \ for (i = 0; i < BUF_UNITS; i++) { \ int src_offset = i * 64 * sizeof(type) + (aligned ? 8 : 1) * i; \ @@ -65,7 +65,7 @@ #define check_diff_pixels(type, aligned) \ do { \ int i; \ - declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride); \ + declare_func(void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride); \ \ for (i = 0; i < BUF_UNITS; i++) { \ int src_offset = i * 64 * sizeof(type) + (aligned ? 8 : 1) * i; \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/riscv/checkasm.S mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/riscv/checkasm.S --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/riscv/checkasm.S 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/riscv/checkasm.S 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,178 @@ +/**************************************************************************** + * 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 General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. + *****************************************************************************/ + +#include "libavutil/riscv/asm.S" + +#if (__riscv_xlen == 64) + +const fail_s_reg + .asciz "callee-saved integer register clobbered" +endconst + +const fail_fs_reg + .asciz "callee-saved floating-point register clobbered" +endconst + +const fail_rsvd_reg + .asciz "unallocatable register clobbered" +endconst + + .section .tbss, "waT" + .align 3 + .hidden checked_func + .hidden saved_regs + +checked_func: + .quad 0 + +saved_regs: + /* Space to spill RA, SP, GP, TP, S0-S11 and FS0-FS11 */ + .rept 4 + 12 + 12 + .quad 0 + .endr + +func checkasm_set_function + la.tls.ie t0, checked_func + add t0, tp, t0 + sd a0, (t0) + ret +endfunc + +func checkasm_get_wrapper, v + addi sp, sp, -16 + sd fp, (sp) + sd ra, 8(sp) + addi fp, sp, 16 + + call av_get_cpu_flags + andi t0, a0, 8 /* AV_CPU_FLAG_RVV_I32 */ + + lla a0, 3f + beqz t0, 1f + lla a0, 2f +1: + ld ra, 8(sp) + ld fp, (sp) + addi sp, sp, 16 + ret + +2: /* <-- Entry point with the Vector extension --> */ + /* Clobber the vectors */ + vsetvli t0, zero, e32, m8, ta, ma + li t0, 0xdeadbeef + vmv.v.x v0, t0 + vmv.v.x v8, t0 + vmv.v.x v16, t0 + vmv.v.x v24, t0 + + /* Clobber the vector configuration */ + li t0, 0 /* Vector length: zero */ + li t1, -1 << 31 /* Vector type: illegal */ + vsetvl zero, t0, t1 + csrwi vxrm, 3 /* Rounding mode: round-to-odd */ + csrwi vxsat, 1 /* Saturation: encountered */ + +3: /* <-- Entry point without the Vector extension --> */ + /* Save RA, unallocatable and callee-saved registers */ + la.tls.ie t0, saved_regs + add t0, tp, t0 + sd ra, (t0) + sd sp, 8(t0) + sd gp, 16(t0) + sd tp, 24(t0) + .irp n, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + sd s\n, (32 + (16 * \n))(t0) + fsd fs\n, (40 + (16 * \n))(t0) + .endr + + /* Clobber the stack space right below SP */ + li t0, 0xdeadbeef1badf00d + .rept 16 + addi sp, sp, -16 + sd t0, (sp) + sd t0, 8(sp) + .endr + addi sp, sp, 256 + + /* Clobber the saved and temporary registers */ + .irp n, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + .if (\n > 0 && \n < 7) + mv t\n, t0 + .endif + fmv.d.x ft\n, t0 + mv s\n, t0 + fmv.d.x fs\n, t0 + .endr + + /* Call the tested function */ + la.tls.ie t0, checked_func + add t0, tp, t0 + ld t1, (t0) + sd zero, (t0) + jalr t1 + + /* Check special register values */ + la.tls.ie t0, saved_regs + add t0, tp, t0 + ld t1, 8(t0) + bne t1, sp, 5f + ld t1, 16(t0) + bne t1, gp, 5f + ld t1, 24(t0) // If TP was corrupted, we probably will have... + bne t1, tp, 5f // ...already crashed before we even get here. + + /* Check value of saved registers */ + li t0, 0xdeadbeef1badf00d + .irp n, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + bne t0, s\n, 6f +#ifdef __riscv_float_abi_double + /* TODO: check float ABI single too */ + fmv.x.d t1, fs\n + bne t0, t1, 7f +#endif + .endr + +4: + /* Restore RA and saved registers */ + la.tls.ie t0, saved_regs + add t0, tp, t0 + ld ra, (t0) + .irp n, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + ld s\n, (32 + (16 * \n))(t0) + fld fs\n, (40 + (16 * \n))(t0) + .endr + ret + +5: + lla a0, fail_rsvd_reg + call checkasm_fail_func + tail abort /* The test harness would probably crash anyway */ + +6: + lla a0, fail_s_reg + call checkasm_fail_func + j 4b + +7: + lla a0, fail_fs_reg + call checkasm_fail_func + j 4b +endfunc +#endif diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/sw_scale.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/sw_scale.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/sw_scale.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/sw_scale.c 2023-03-03 13:29:59.000000000 +0000 @@ -35,40 +35,140 @@ AV_WN32(buf + j, rnd()); \ } while (0) -// This reference function is the same approximate algorithm employed by the -// SIMD functions -static void ref_function(const int16_t *filter, int filterSize, - const int16_t **src, uint8_t *dest, int dstW, - const uint8_t *dither, int offset) -{ - int i, d; - d = ((filterSize - 1) * 8 + dither[0]) >> 4; - for ( i = 0; i < dstW; i++) { - int16_t val = d; +static void yuv2planeX_8_ref(const int16_t *filter, int filterSize, + const int16_t **src, uint8_t *dest, int dstW, + const uint8_t *dither, int offset) +{ + // This corresponds to the yuv2planeX_8_c function + int i; + for (i = 0; i < dstW; i++) { + int val = dither[(i + offset) & 7] << 12; int j; - union { - int val; - int16_t v[2]; - } t; - for (j = 0; j < filterSize; j++){ - t.val = (int)src[j][i + offset] * (int)filter[j]; - val += t.v[1]; + for (j = 0; j < filterSize; j++) + val += src[j][i] * filter[j]; + + dest[i]= av_clip_uint8(val >> 19); + } +} + +static int cmp_off_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy) +{ + for (size_t i = 0; i < n; i++) { + if (abs(ref[i] - test[i]) > accuracy) + return 1; + } + return 0; +} + +static void print_data(uint8_t *p, size_t len, size_t offset) +{ + size_t i = 0; + for (; i < len; i++) { + if (i % 8 == 0) { + printf("0x%04zx: ", i+offset); + } + printf("0x%02x ", (uint32_t) p[i]); + if (i % 8 == 7) { + printf("\n"); } - dest[i]= av_clip_uint8(val>>3); + } + if (i % 8 != 0) { + printf("\n"); } } -static void check_yuv2yuvX(void) +static size_t show_differences(uint8_t *a, uint8_t *b, size_t len) +{ + for (size_t i = 0; i < len; i++) { + if (a[i] != b[i]) { + size_t offset_of_mismatch = i; + size_t offset; + if (i >= 8) i-=8; + offset = i & (~7); + printf("test a:\n"); + print_data(&a[offset], 32, offset); + printf("\ntest b:\n"); + print_data(&b[offset], 32, offset); + printf("\n"); + return offset_of_mismatch; + } + } + return len; +} + +static void check_yuv2yuv1(int accurate) +{ + struct SwsContext *ctx; + int osi, isi; + int dstW, offset; + size_t fail_offset; + const int input_sizes[] = {8, 24, 128, 144, 256, 512}; + const int INPUT_SIZES = sizeof(input_sizes)/sizeof(input_sizes[0]); + #define LARGEST_INPUT_SIZE 512 + + const int offsets[] = {0, 3, 8, 11, 16, 19}; + const int OFFSET_SIZES = sizeof(offsets)/sizeof(offsets[0]); + const char *accurate_str = (accurate) ? "accurate" : "approximate"; + + declare_func_emms(AV_CPU_FLAG_MMX, void, + const int16_t *src, uint8_t *dest, + int dstW, const uint8_t *dither, int offset); + + LOCAL_ALIGNED_16(int16_t, src_pixels, [LARGEST_INPUT_SIZE]); + LOCAL_ALIGNED_16(uint8_t, dst0, [LARGEST_INPUT_SIZE]); + LOCAL_ALIGNED_16(uint8_t, dst1, [LARGEST_INPUT_SIZE]); + LOCAL_ALIGNED_8(uint8_t, dither, [8]); + + randomize_buffers((uint8_t*)dither, 8); + randomize_buffers((uint8_t*)src_pixels, LARGEST_INPUT_SIZE * sizeof(int16_t)); + ctx = sws_alloc_context(); + if (accurate) + ctx->flags |= SWS_ACCURATE_RND; + if (sws_init_context(ctx, NULL, NULL) < 0) + fail(); + + ff_sws_init_scale(ctx); + for (isi = 0; isi < INPUT_SIZES; ++isi) { + dstW = input_sizes[isi]; + for (osi = 0; osi < OFFSET_SIZES; osi++) { + offset = offsets[osi]; + if (check_func(ctx->yuv2plane1, "yuv2yuv1_%d_%d_%s", offset, dstW, accurate_str)){ + memset(dst0, 0, LARGEST_INPUT_SIZE * sizeof(dst0[0])); + memset(dst1, 0, LARGEST_INPUT_SIZE * sizeof(dst1[0])); + + call_ref(src_pixels, dst0, dstW, dither, offset); + call_new(src_pixels, dst1, dstW, dither, offset); + if (cmp_off_by_n(dst0, dst1, dstW * sizeof(dst0[0]), accurate ? 0 : 2)) { + fail(); + printf("failed: yuv2yuv1_%d_%di_%s\n", offset, dstW, accurate_str); + fail_offset = show_differences(dst0, dst1, LARGEST_INPUT_SIZE * sizeof(dst0[0])); + printf("failing values: src: 0x%04x dither: 0x%02x dst-c: %02x dst-asm: %02x\n", + (int) src_pixels[fail_offset], + (int) dither[(fail_offset + fail_offset) & 7], + (int) dst0[fail_offset], + (int) dst1[fail_offset]); + } + if(dstW == LARGEST_INPUT_SIZE) + bench_new(src_pixels, dst1, dstW, dither, offset); + } + } + } + sws_freeContext(ctx); +} + +static void check_yuv2yuvX(int accurate) { struct SwsContext *ctx; int fsi, osi, isi, i, j; int dstW; #define LARGEST_FILTER 16 -#define FILTER_SIZES 4 - static const int filter_sizes[FILTER_SIZES] = {1, 4, 8, 16}; + // ff_yuv2planeX_8_sse2 can't handle odd filter sizes + const int filter_sizes[] = {2, 4, 8, 16}; + const int FILTER_SIZES = sizeof(filter_sizes)/sizeof(filter_sizes[0]); #define LARGEST_INPUT_SIZE 512 -#define INPUT_SIZES 6 - static const int input_sizes[INPUT_SIZES] = {8, 24, 128, 144, 256, 512}; + static const int input_sizes[] = {8, 24, 128, 144, 256, 512}; + const int INPUT_SIZES = sizeof(input_sizes)/sizeof(input_sizes[0]); + const char *accurate_str = (accurate) ? "accurate" : "approximate"; declare_func_emms(AV_CPU_FLAG_MMX, void, const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, @@ -87,8 +187,9 @@ uint8_t d_val = rnd(); memset(dither, d_val, LARGEST_INPUT_SIZE); randomize_buffers((uint8_t*)src_pixels, LARGEST_FILTER * LARGEST_INPUT_SIZE * sizeof(int16_t)); - randomize_buffers((uint8_t*)filter_coeff, LARGEST_FILTER * sizeof(int16_t)); ctx = sws_alloc_context(); + if (accurate) + ctx->flags |= SWS_ACCURATE_RND; if (sws_init_context(ctx, NULL, NULL) < 0) fail(); @@ -96,33 +197,52 @@ for(isi = 0; isi < INPUT_SIZES; ++isi){ dstW = input_sizes[isi]; for(osi = 0; osi < 64; osi += 16){ - for(fsi = 0; fsi < FILTER_SIZES; ++fsi){ + if (dstW <= osi) + continue; + for (fsi = 0; fsi < FILTER_SIZES; ++fsi) { + // Generate filter coefficients for the given filter size, + // with some properties: + // - The coefficients add up to the intended sum (4096, 1<<12) + // - The coefficients contain negative values + // - The filter intermediates don't overflow for worst case + // inputs (all positive coefficients are coupled with + // input_max and all negative coefficients with input_min, + // or vice versa). + // Produce a filter with all coefficients set to + // -((1<<12)/(filter_size-1)) except for one (randomly chosen) + // which is set to ((1<<13)-1). + for (i = 0; i < filter_sizes[fsi]; ++i) + filter_coeff[i] = -((1 << 12) / (filter_sizes[fsi] - 1)); + filter_coeff[rnd() % filter_sizes[fsi]] = (1 << 13) - 1; + src = av_malloc(sizeof(int16_t*) * filter_sizes[fsi]); vFilterData = av_malloc((filter_sizes[fsi] + 2) * sizeof(union VFilterData)); memset(vFilterData, 0, (filter_sizes[fsi] + 2) * sizeof(union VFilterData)); - for(i = 0; i < filter_sizes[fsi]; ++i){ + for (i = 0; i < filter_sizes[fsi]; ++i) { src[i] = &src_pixels[i * LARGEST_INPUT_SIZE]; - vFilterData[i].src = src[i]; + vFilterData[i].src = src[i] - osi; for(j = 0; j < 4; ++j) vFilterData[i].coeff[j + 4] = filter_coeff[i]; } - if (check_func(ctx->yuv2planeX, "yuv2yuvX_%d_%d_%d", filter_sizes[fsi], osi, dstW)){ + if (check_func(ctx->yuv2planeX, "yuv2yuvX_%d_%d_%d_%s", filter_sizes[fsi], osi, dstW, accurate_str)){ + // use vFilterData for the mmx function + const int16_t *filter = ctx->use_mmx_vfilter ? (const int16_t*)vFilterData : &filter_coeff[0]; memset(dst0, 0, LARGEST_INPUT_SIZE * sizeof(dst0[0])); memset(dst1, 0, LARGEST_INPUT_SIZE * sizeof(dst1[0])); - // The reference function is not the scalar function selected when mmx - // is deactivated as the SIMD functions do not give the same result as - // the scalar ones due to rounding. The SIMD functions are activated by - // the flag SWS_ACCURATE_RND - ref_function(&filter_coeff[0], filter_sizes[fsi], src, dst0, dstW - osi, dither, osi); - // There's no point in calling new for the reference function - if(ctx->use_mmx_vfilter){ - call_new((const int16_t*)vFilterData, filter_sizes[fsi], src, dst1, dstW - osi, dither, osi); - if (memcmp(dst0, dst1, LARGEST_INPUT_SIZE * sizeof(dst0[0]))) - fail(); - if(dstW == LARGEST_INPUT_SIZE) - bench_new((const int16_t*)vFilterData, filter_sizes[fsi], src, dst1, dstW - osi, dither, osi); + // We can't use call_ref here, because we don't know if use_mmx_vfilter was set for that + // function or not, so we can't pass it the parameters correctly. + yuv2planeX_8_ref(&filter_coeff[0], filter_sizes[fsi], src, dst0, dstW - osi, dither, osi); + + call_new(filter, filter_sizes[fsi], src, dst1, dstW - osi, dither, osi); + if (cmp_off_by_n(dst0, dst1, LARGEST_INPUT_SIZE * sizeof(dst0[0]), accurate ? 0 : 2)) { + fail(); + printf("failed: yuv2yuvX_%d_%d_%d_%s\n", filter_sizes[fsi], osi, dstW, accurate_str); + show_differences(dst0, dst1, LARGEST_INPUT_SIZE * sizeof(dst0[0])); } + if(dstW == LARGEST_INPUT_SIZE) + bench_new((const int16_t*)vFilterData, filter_sizes[fsi], src, dst1, dstW - osi, dither, osi); + } av_freep(&src); av_freep(&vFilterData); @@ -172,8 +292,6 @@ const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize); - int cpu_flags = av_get_cpu_flags(); - ctx = sws_alloc_context(); if (sws_init_context(ctx, NULL, NULL) < 0) fail(); @@ -222,8 +340,7 @@ ctx->dstW = ctx->chrDstW = input_sizes[dstWi]; ff_sws_init_scale(ctx); memcpy(filterAvx2, filter, sizeof(uint16_t) * (SRC_PIXELS * MAX_FILTER_WIDTH + MAX_FILTER_WIDTH)); - if ((cpu_flags & AV_CPU_FLAG_AVX2) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) - ff_shuffle_filter_coefficients(ctx, filterPosAvx, width, filterAvx2, SRC_PIXELS); + ff_shuffle_filter_coefficients(ctx, filterPosAvx, width, filterAvx2, ctx->dstW); if (check_func(ctx->hcScale, "hscale_%d_to_%d__fs_%d_dstW_%d", ctx->srcBpc, ctx->dstBpc + 1, width, ctx->dstW)) { memset(dst0, 0, SRC_PIXELS * sizeof(dst0[0])); @@ -245,6 +362,10 @@ { check_hscale(); report("hscale"); - check_yuv2yuvX(); + check_yuv2yuv1(0); + check_yuv2yuv1(1); + report("yuv2yuv1"); + check_yuv2yuvX(0); + check_yuv2yuvX(1); report("yuv2yuvX"); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/synth_filter.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/synth_filter.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/synth_filter.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/synth_filter.c 2023-03-03 13:29:59.000000000 +0000 @@ -26,6 +26,7 @@ #include "libavutil/internal.h" #include "libavutil/intfloat.h" #include "libavutil/mem_internal.h" +#include "libavutil/tx.h" #include "libavcodec/dcadata.h" #include "libavcodec/synth_filter.h" @@ -45,10 +46,12 @@ void checkasm_check_synth_filter(void) { - FFTContext imdct; + float scale = 1.0; + AVTXContext *imdct; + av_tx_fn imdct_fn; SynthFilterContext synth; - ff_mdct_init(&imdct, 6, 1, 1.0); + av_tx_init(&imdct, &imdct_fn, AV_TX_FLOAT_MDCT, 0, 16, &scale, 0); ff_synth_filter_init(&synth); if (check_func(synth.synth_filter_float, "synth_filter_float")) { @@ -65,8 +68,8 @@ float scale = 1.0f; int i, offset0 = 0, offset1 = 0, offset_b = 0; - declare_func(void, FFTContext *, float *, int *, float[32], const float[512], - float[32], float[32], float); + declare_func(void, AVTXContext *, float *, int *, + float[32], const float[512], float[32], float[32], float, av_tx_fn); memset(buf2_0, 0, sizeof(*buf2_0) * BUF_SIZE); memset(buf2_1, 0, sizeof(*buf2_1) * BUF_SIZE); @@ -86,10 +89,10 @@ randomize_input(); - call_ref(&imdct, buf0, &offset0, buf2_0, window, - out0, in, scale); - call_new(&imdct, buf1, &offset1, buf2_1, window, - out1, in, scale); + call_ref(imdct, buf0, &offset0, buf2_0, window, + out0, in, scale, imdct_fn); + call_new(imdct, buf1, &offset1, buf2_1, window, + out1, in, scale, imdct_fn); if (offset0 != offset1) { fail(); @@ -113,11 +116,11 @@ } } - bench_new(&imdct, buf_b, &offset_b, buf2_b, window, - out_b, in, scale); + bench_new(imdct, buf_b, &offset_b, buf2_b, window, + out_b, in, scale, imdct_fn); } } - ff_mdct_end(&imdct); + av_tx_uninit(&imdct); report("synth_filter"); } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210dec.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210dec.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210dec.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210dec.c 2023-03-03 13:29:59.000000000 +0000 @@ -54,12 +54,12 @@ if (check_func(h.unpack_frame, "v210_unpack")) { uint32_t src0[NUM_SAMPLES/3]; uint32_t src1[NUM_SAMPLES/3]; - uint16_t y0[NUM_SAMPLES/2]; - uint16_t y1[NUM_SAMPLES/2]; - uint16_t u0[NUM_SAMPLES/4]; - uint16_t u1[NUM_SAMPLES/4]; - uint16_t v0[NUM_SAMPLES/4]; - uint16_t v1[NUM_SAMPLES/4]; + uint16_t y0[NUM_SAMPLES/2 + 26]; + uint16_t y1[NUM_SAMPLES/2 + 26]; + uint16_t u0[NUM_SAMPLES/4 + 13]; + uint16_t u1[NUM_SAMPLES/4 + 13]; + uint16_t v0[NUM_SAMPLES/4 + 13]; + uint16_t v1[NUM_SAMPLES/4 + 13]; declare_func(void, const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); const int pixels = NUM_SAMPLES / 2 / 6 * 6; diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210enc.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210enc.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210enc.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/v210enc.c 2023-03-03 13:29:59.000000000 +0000 @@ -72,8 +72,10 @@ randomize_buffers(mask); \ call_ref(y0 + y_offset, u0 + uv_offset, v0 + uv_offset, dst0, width); \ call_new(y1 + y_offset, u1 + uv_offset, v1 + uv_offset, dst1, width); \ - if (memcmp(y0, y1, BUF_SIZE) || memcmp(u0, u1, BUF_SIZE / 2) || \ - memcmp(v0, v1, BUF_SIZE / 2) || memcmp(dst0, dst1, width * 8 / 3)) \ + if (memcmp(y0, y1, BUF_SIZE * sizeof(type)) \ + || memcmp(u0, u1, BUF_SIZE * sizeof(type) / 2) \ + || memcmp(v0, v1, BUF_SIZE * sizeof(type) / 2) \ + || memcmp(dst0, dst1, width * 8 / 3)) \ fail(); \ bench_new(y1 + y_offset, u1 + uv_offset, v1 + uv_offset, dst1, width); \ } \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vc1dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vc1dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vc1dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vc1dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -261,7 +261,7 @@ if (check_func(h.vc1_inv_trans_8x8, "vc1dsp.vc1_inv_trans_8x8")) { matrix *coeffs; - declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *); + declare_func(void, int16_t *); RANDOMIZE_BUFFER16(inv_trans_in, 10 * 8); coeffs = generate_inverse_quantized_transform_coefficients(8, 8); for (int j = 0; j < 8; ++j) @@ -404,7 +404,7 @@ if (check_func(h.vc1_unescape_buffer, "vc1dsp.vc1_unescape_buffer")) { int len0, len1, escaped_offset, unescaped_offset, escaped_len; - declare_func_emms(AV_CPU_FLAG_MMX, int, const uint8_t *, int, uint8_t *); + declare_func(int, const uint8_t *, int, uint8_t *); /* Test data which consists of escapes sequences packed as tightly as possible */ for (int x = 0; x < UNESCAPE_BUF_SIZE; ++x) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vf_convolution.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vf_convolution.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vf_convolution.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vf_convolution.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,104 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include "checkasm.h" +#include "libavfilter/avfilter.h" +#include "libavfilter/convolution.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/mem_internal.h" + +#define WIDTH 512 +#define HEIGHT 512 +#define SRC_STRIDE 512 +#define PIXELS (WIDTH * HEIGHT) + +#define randomize_buffers(buf, size) \ + do { \ + int j; \ + uint8_t *tmp_buf = (uint8_t *)buf;\ + for (j = 0; j< size; j++) \ + tmp_buf[j] = rnd() & 0xFF; \ + } while (0) + +static void check_sobel(const char * report_name) +{ + LOCAL_ALIGNED_32(uint8_t, src, [PIXELS]); + LOCAL_ALIGNED_32(uint8_t, dst_ref, [PIXELS]); + LOCAL_ALIGNED_32(uint8_t, dst_new, [PIXELS]); + const int height = WIDTH; + const int width = HEIGHT; + const int stride = SRC_STRIDE; + const int dstride = SRC_STRIDE; + int mode = 0; + const uint8_t *c[49]; + const int radius = 1; + const int bpc = 1; + const int step = mode == MATRIX_COLUMN ? 16 : 1; + const int slice_start = 0; + const int slice_end = height; + int y; + const int sizew = mode == MATRIX_COLUMN ? height : width; + float scale = 2; + float delta = 10; + + ConvolutionContext s; + + declare_func(void, uint8_t *dst, int width, float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, int dstride, int stride, int size); + + s.scale = scale; + s.delta = delta; + s.depth = 8; + s.nb_planes = 3; + s.planes = 15; + ff_sobel_init(&s, s.depth, s.nb_planes); + + memset(dst_ref, 0, PIXELS); + memset(dst_new, 0, PIXELS); + randomize_buffers(src, PIXELS); + + if (check_func(s.filter[0], "%s", report_name)) { + for (y = slice_start; y < slice_end; y += step) { + const int xoff = mode == MATRIX_COLUMN ? (y - slice_start) * bpc : radius * bpc; + const int yoff = mode == MATRIX_COLUMN ? radius * dstride : 0; + + s.setup[0](radius, c, src, stride, radius, width, y, height, bpc); + call_ref(dst_ref + yoff + xoff, sizew - 2 * radius, + scale, delta, NULL, c, 0, radius, + dstride, stride, slice_end - step); + call_new(dst_new + yoff + xoff, sizew - 2 * radius, + scale, delta, NULL, c, 0, radius, + dstride, stride, slice_end - step); + if (memcmp(dst_ref + yoff + xoff, dst_new + yoff + xoff, slice_end - step)) + fail(); + bench_new(dst_new + yoff + xoff, sizew - 2 * radius, + scale, delta, NULL, c, 0, radius, + dstride, stride, slice_end - step); + if (mode != MATRIX_COLUMN) + dst_ref += dstride; + } + } + +} + +void checkasm_check_vf_sobel(void) +{ + check_sobel("sobel"); + report("convolution:sobel"); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vorbisdsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vorbisdsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vorbisdsp.c 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vorbisdsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" + +#include + +#include "libavutil/mem_internal.h" + +#include "libavcodec/vorbisdsp.h" + +#include "checkasm.h" + +#define LEN 512 + +#define randomize_buffer(buf) \ +do { \ + double bmg[2], stddev = 10.0, mean = 0.0; \ + \ + for (int i = 0; i < LEN; i += 2) { \ + av_bmg_get(&checkasm_lfg, bmg); \ + buf[i] = bmg[0] * stddev + mean; \ + buf[i + 1] = bmg[1] * stddev + mean; \ + } \ +} while(0); + +static void test_inverse_coupling(void) +{ + LOCAL_ALIGNED_16(float, src0, [LEN]); + LOCAL_ALIGNED_16(float, src1, [LEN]); + LOCAL_ALIGNED_16(float, cdst, [LEN]); + LOCAL_ALIGNED_16(float, odst, [LEN]); + LOCAL_ALIGNED_16(float, cdst1, [LEN]); + LOCAL_ALIGNED_16(float, odst1, [LEN]); + + declare_func(void, float *av_restrict mag, float *av_restrict ang, + ptrdiff_t blocksize); + + randomize_buffer(src0); + randomize_buffer(src1); + + memcpy(cdst, src0, LEN * sizeof(*src0)); + memcpy(cdst1, src1, LEN * sizeof(*src1)); + memcpy(odst, src0, LEN * sizeof(*src0)); + memcpy(odst1, src1, LEN * sizeof(*src1)); + + call_ref(cdst, cdst1, LEN); + call_new(odst, odst1, LEN); + for (int i = 0; i < LEN; i++) { + if (!float_near_abs_eps(cdst[i], odst[i], FLT_EPSILON) || + !float_near_abs_eps(cdst1[i], odst1[i], FLT_EPSILON)) { + fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", + i, cdst[i], odst[i], cdst[i] - odst[i]); + fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", + i, cdst1[i], odst1[i], cdst1[i] - odst1[i]); + fail(); + break; + } + } + bench_new(src0, src1, LEN); +} + +void checkasm_check_vorbisdsp(void) +{ + VorbisDSPContext dsp; + + ff_vorbisdsp_init(&dsp); + + if (check_func(dsp.vorbis_inverse_coupling, "inverse_coupling")) + test_inverse_coupling(); + report("inverse_coupling"); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vp8dsp.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vp8dsp.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vp8dsp.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/vp8dsp.c 2023-03-03 13:29:59.000000000 +0000 @@ -384,7 +384,7 @@ VP8DSPContext d; int dir, edge, force_hev; int flim_E = 20, flim_I = 10, hev_thresh = 7; - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *, ptrdiff_t, int, int, int); + declare_func(void, uint8_t *, ptrdiff_t, int, int, int); ff_vp8dsp_init(&d); @@ -430,7 +430,7 @@ VP8DSPContext d; int dir, edge, force_hev; int flim_E = 20, flim_I = 10, hev_thresh = 7; - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *, uint8_t *, ptrdiff_t, int, int, int); + declare_func(void, uint8_t *, uint8_t *, ptrdiff_t, int, int, int); ff_vp8dsp_init(&d); @@ -481,7 +481,7 @@ VP8DSPContext d; int dir; int flim_E = 20, flim_I = 30, hev_thresh = 0; - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *, ptrdiff_t, int); + declare_func(void, uint8_t *, ptrdiff_t, int); ff_vp8dsp_init(&d); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/x86/checkasm.asm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/x86/checkasm.asm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/x86/checkasm.asm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/checkasm/x86/checkasm.asm 2023-03-03 13:29:59.000000000 +0000 @@ -234,7 +234,7 @@ .emms_ok: %endif add esp, max_args*4 - REP_RET + RET %endmacro %endif ; ARCH_X86_64 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/aac.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/aac.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/aac.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/aac.mak 2023-03-03 13:29:59.000000000 +0000 @@ -174,7 +174,7 @@ fate-aac-ln-encode-128k: CMP_SHIFT = -4096 fate-aac-ln-encode-128k: CMP_TARGET = 622 fate-aac-ln-encode-128k: SIZE_TOLERANCE = 3560 -fate-aac-ln-encode-128k: FUZZ = 5 +fate-aac-ln-encode-128k: FUZZ = 10 FATE_AAC_ENCODE += fate-aac-pns-encode fate-aac-pns-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -c:a aac -aac_coder fast -aac_pns 1 -aac_is 0 -aac_ms 0 -aac_tns 0 -b:a 128k -cutoff 22050 -fflags +bitexact -flags +bitexact diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ac3.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ac3.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ac3.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ac3.mak 2023-03-03 13:29:59.000000000 +0000 @@ -89,7 +89,7 @@ fate-ac3-fixed-encode: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav fate-ac3-fixed-encode: CMD = md5 -i $(SRC) -c ac3_fixed -ab 128k -f ac3 -flags +bitexact -af aresample fate-ac3-fixed-encode: CMP = oneline -fate-ac3-fixed-encode: REF = 1f548175e11a95e62ce20e442fcc8d08 +fate-ac3-fixed-encode: REF = e9d78bca187b4bbafc4512bcea8efd3e FATE_EAC3-$(call ALLYES, EAC3_DEMUXER EAC3_MUXER EAC3_CORE_BSF) += fate-eac3-core-bsf fate-eac3-core-bsf: CMD = md5pipe -i $(TARGET_SAMPLES)/eac3/the_great_wall_7.1.eac3 -c:a copy -bsf:a eac3_core -fflags +bitexact -f eac3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/acodec.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/acodec.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/acodec.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/acodec.mak 2023-03-03 13:29:59.000000000 +0000 @@ -126,7 +126,7 @@ fate-acodec-dca2: REF = $(SRC) fate-acodec-dca2: CMP = stddev fate-acodec-dca2: CMP_SHIFT = -2048 -fate-acodec-dca2: CMP_TARGET = 535 +fate-acodec-dca2: CMP_TARGET = 534 fate-acodec-dca2: SIZE_TOLERANCE = 1632 FATE_ACODEC-$(call ENCDEC, FLAC, FLAC) += fate-acodec-flac fate-acodec-flac-exact-rice diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/audio.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/audio.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/audio.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/audio.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,10 @@ +FATE_SAMPLES_AUDIO-$(call TRANSCODE, APTX, APTX, WAV_DEMUXER PCM_S16LE_DECODER ARESAMPLE_FILTER) += fate-aptx +fate-aptx: CMD = transcode wav $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav aptx "-af aresample -c aptx" "-af aresample -c:a pcm_s16le -t 0.25" "" "" "-f aptx -sample_rate 44100" + +FATE_SAMPLES_AUDIO-$(call TRANSCODE, APTX_HD, APTX_HD, WAV_DEMUXER PCM_S16LE_DECODER \ + ARESAMPLE_FILTER PCM_S32LE_ENCODER) += fate-aptx-hd +fate-aptx-hd: CMD = transcode wav $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav aptx_hd "-af aresample -c aptx_hd" "-af aresample -c:a pcm_s32le -t 0.25" "" "" "-f aptx_hd -sample_rate 44100" + FATE_BINKAUDIO-$(call DEMDEC, BINK, BINKAUDIO_DCT) += fate-binkaudio-dct fate-binkaudio-dct: CMD = pcm -i $(TARGET_SAMPLES)/bink/binkaudio_dct.bik fate-binkaudio-dct: REF = $(SAMPLES)/bink/binkaudio_dct.pcm @@ -36,8 +43,14 @@ FATE_SAMPLES_AUDIO-$(call DEMDEC, AVI, IMC) += fate-imc fate-imc: CMD = pcm -i $(TARGET_SAMPLES)/imc/imc.avi fate-imc: CMP = oneoff +fate-imc: CMP_TARGET = 59416 fate-imc: REF = $(SAMPLES)/imc/imc-201706.pcm +FATE_SAMPLES_AUDIO-$(call DEMDEC, WAV, MSNSIREN) += fate-msnsiren +fate-msnsiren: CMD = pcm -i $(TARGET_SAMPLES)/msnsiren/msnsiren2.wav +fate-msnsiren: CMP = oneoff +fate-msnsiren: REF = $(SAMPLES)/msnsiren/msnsiren2.pcm + FATE_SAMPLES_AUDIO-$(call DEMDEC, FLV, NELLYMOSER) += fate-nellymoser fate-nellymoser: CMD = pcm -i $(TARGET_SAMPLES)/nellymoser/nellymoser.flv fate-nellymoser: CMP = oneoff diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/cbs.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/cbs.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/cbs.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/cbs.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -# Read/write tests: this uses the codec metadata filter - with no +# Read/write tests: By default, this uses the codec metadata filters - with no # arguments, it decomposes the stream fully and then recomposes it # without making any changes. @@ -66,8 +66,45 @@ $(foreach N,$(FATE_CBS_H264_SAMPLES),$(eval $(call FATE_CBS_TEST,h264,$(basename $(N)),h264,h264/$(N),h264))) FATE_CBS_H264-$(call FATE_CBS_DEPS, H264, H264, H264, H264, H264) = $(FATE_CBS_h264) -FATE_SAMPLES_AVCONV += $(FATE_CBS_H264-yes) -fate-cbs-h264: $(FATE_CBS_H264-yes) + + +FATE_H264_REDUNDANT_PPS-$(call REMUX, H264, MOV_DEMUXER H264_REDUNDANT_PPS_BSF \ + H264_DECODER H264_PARSER RAWVIDEO_ENCODER) \ + += fate-h264_redundant_pps-mov +fate-h264_redundant_pps-mov: CMD = transcode \ + mov $(TARGET_SAMPLES)/mov/frag_overlap.mp4 h264 \ + "-map 0:v -c copy -bsf h264_redundant_pps" + +# This file has changing pic_init_qp_minus26. +FATE_H264_REDUNDANT_PPS-$(call REMUX, H264, H264_PARSER H264_REDUNDANT_PPS_BSF \ + H264_DECODER RAWVIDEO_ENCODER) \ + += fate-h264_redundant_pps-annexb +fate-h264_redundant_pps-annexb: CMD = transcode \ + h264 $(TARGET_SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264 \ + h264 "-map 0:v -c copy -bsf h264_redundant_pps" + +# These two tests test that new extradata in packet side data is properly +# modified by h264_redundant_pps. nut is used as destination container +# because it can store extradata updates (in its experimental mode); +# setting -syncpoints none is a hack to use nut version 4. +FATE_H264_REDUNDANT_PPS-$(call REMUX, NUT, MOV_DEMUXER H264_REDUNDANT_PPS_BSF H264_DECODER) \ + += fate-h264_redundant_pps-side_data +fate-h264_redundant_pps-side_data: CMD = transcode \ + mov $(TARGET_SAMPLES)/h264/thezerotheorem-cut.mp4 nut \ + "-map 0:v -c copy -bsf h264_redundant_pps -syncpoints none -strict experimental" "-c copy" + +FATE_H264_REDUNDANT_PPS-$(call REMUX, NUT, MOV_DEMUXER H264_REDUNDANT_PPS_BSF \ + H264_DECODER SCALE_FILTER RAWVIDEO_ENCODER) \ + += fate-h264_redundant_pps-side_data2 +fate-h264_redundant_pps-side_data2: CMD = transcode \ + mov $(TARGET_SAMPLES)/h264/extradata-reload-multi-stsd.mov nut \ + "-map 0:v -c copy -bsf h264_redundant_pps -syncpoints none -strict experimental" + +fate-h264_redundant_pps: $(FATE_H264_REDUNDANT_PPS-yes) + + +FATE_SAMPLES_FFMPEG += $(FATE_CBS_H264-yes) $(FATE_H264_REDUNDANT_PPS-yes) +fate-cbs-h264: $(FATE_CBS_H264-yes) $(FATE_H264_REDUNDANT_PPS-yes) # H.265 read/write diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/checkasm.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/checkasm.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/checkasm.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/checkasm.mak 2023-03-03 13:29:59.000000000 +0000 @@ -23,6 +23,7 @@ fate-checkasm-jpeg2000dsp \ fate-checkasm-llviddsp \ fate-checkasm-llviddspenc \ + fate-checkasm-lpc \ fate-checkasm-motion \ fate-checkasm-opusdsp \ fate-checkasm-pixblockdsp \ @@ -42,7 +43,9 @@ fate-checkasm-vf_hflip \ fate-checkasm-vf_nlmeans \ fate-checkasm-vf_threshold \ + fate-checkasm-vf_sobel \ fate-checkasm-videodsp \ + fate-checkasm-vorbisdsp \ fate-checkasm-vp8dsp \ fate-checkasm-vp9dsp \ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ffmpeg.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ffmpeg.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ffmpeg.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/ffmpeg.mak 2023-03-03 13:29:59.000000000 +0000 @@ -99,6 +99,14 @@ fate-shortest: tests/data/vsynth_lena.yuv fate-shortest: CMD = framecrc -auto_conversion_filters -f lavfi -i "sine=3000:d=10" -f lavfi -i "sine=1000:d=1" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -f rawvideo -s 352x288 -pix_fmt yuv420p -i $(TARGET_PATH)/tests/data/vsynth_lena.yuv -filter_complex "[0:a:0][1:a:0]amix=inputs=2[audio]" -map 2:v:0 -map "[audio]" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -dct fastint -qscale 10 -threads 1 -c:v mpeg4 -c:a ac3_fixed -shortest +# test interleaving video with a sparse subtitle stream +FATE_SAMPLES_FFMPEG-$(call ALLYES, COLOR_FILTER, VOBSUB_DEMUXER, MATROSKA_DEMUXER,, \ + RAWVIDEO_ENCODER, MATROSKA_MUXER, FRAMECRC_MUXER) += fate-shortest-sub +fate-shortest-sub: CMD = transcode \ + vobsub $(TARGET_SAMPLES)/sub/vobsub.idx matroska \ + "-filter_complex 'color=s=1x1:rate=1:duration=400' -pix_fmt rgb24 -allow_raw_vfw 1 -c:s copy -c:v rawvideo" \ + "-map 0 -c copy -shortest -shortest_buf_duration 40 -max_delay 1" + # Basic test for fix_sub_duration, which calculates duration based on the # following subtitle's pts. FATE_SAMPLES_FFMPEG-$(call FILTERDEMDECENCMUX, MOVIE, MPEGVIDEO, \ @@ -109,6 +117,21 @@ -real_time 1 -f lavfi \ -i "movie=$(TARGET_SAMPLES)/sub/Closedcaption_rollup.m2v[out0+subcc]" +# Basic test for fix_sub_duration_heartbeat, which causes a buffered subtitle +# to be pushed out when a video keyframe is received from an encoder. +FATE_SAMPLES_FFMPEG-$(call FILTERDEMDECENCMUX, MOVIE, MPEGVIDEO, \ + MPEG2VIDEO, SUBRIP, SRT, LAVFI_INDEV \ + MPEGVIDEO_PARSER CCAPTION_DECODER \ + MPEG2VIDEO_ENCODER NULL_MUXER PIPE_PROTOCOL) \ + += fate-ffmpeg-fix_sub_duration_heartbeat +fate-ffmpeg-fix_sub_duration_heartbeat: CMD = fmtstdout srt -fix_sub_duration \ + -real_time 1 -f lavfi \ + -i "movie=$(TARGET_SAMPLES)/sub/Closedcaption_rollup.m2v[out0+subcc]" \ + -map 0:v -map 0:s -fix_sub_duration_heartbeat:v:0 \ + -c:v mpeg2video -b:v 2M -g 30 -sc_threshold 1000000000 \ + -c:s srt \ + -f null - + FATE_STREAMCOPY-$(call REMUX, MP4 MOV, EAC3_DEMUXER) += fate-copy-trac3074 fate-copy-trac3074: CMD = transcode eac3 $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3\ mp4 "-codec copy -map 0" "-codec copy" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/filter-video.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/filter-video.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/filter-video.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/filter-video.mak 2023-03-03 13:29:59.000000000 +0000 @@ -365,7 +365,7 @@ fate-filter-decimate: CMD = framecrc -lavfi testsrc2=r=24:d=10,fps=60,decimate=5,decimate=4,decimate=3 -pix_fmt yuv420p FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC2 FPS MPDECIMATE) += fate-filter-mpdecimate -fate-filter-mpdecimate: CMD = framecrc -lavfi testsrc2=r=2:d=10,fps=3,mpdecimate -r 3 -pix_fmt yuv420p +fate-filter-mpdecimate: CMD = framecrc -lavfi testsrc2=r=2:d=10,fps=3,mpdecimate -pix_fmt yuv420p FATE_FILTER-$(call FILTERFRAMECRC, FPS TESTSRC2) += $(addprefix fate-filter-fps-, up up-round-down up-round-up down down-round-down down-round-up down-eof-pass start-drop start-fill) fate-filter-fps-up: CMD = framecrc -lavfi testsrc2=r=3:d=2,fps=7 @@ -378,9 +378,8 @@ fate-filter-fps-start-drop: CMD = framecrc -lavfi testsrc2=r=7:d=3.5,fps=3:start_time=1.5 fate-filter-fps-start-fill: CMD = framecrc -lavfi testsrc2=r=7:d=1.5,setpts=PTS+14,fps=3:start_time=1.5 -FATE_FILTER_SAMPLES-$(call FILTERDEMDEC, FPS SCALE, MOV, QTRLE) += fate-filter-fps-cfr fate-filter-fps fate-filter-fps-r +FATE_FILTER_SAMPLES-$(call FILTERDEMDEC, FPS SCALE, MOV, QTRLE) += fate-filter-fps-cfr fate-filter-fps fate-filter-fps-cfr: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -r 30 -vsync cfr -pix_fmt yuv420p -fate-filter-fps-r: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -r 30 -vf fps -pix_fmt yuv420p fate-filter-fps: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -vf fps=30 -pix_fmt yuv420p FATE_FILTER_ALPHAEXTRACT_ALPHAMERGE := $(addprefix fate-filter-alphaextract_alphamerge_, rgb yuv) @@ -641,11 +640,17 @@ fate-filter-metadata-scdet: SRC = $(TARGET_SAMPLES)/svq3/Vertical400kbit.sorenson3.mov fate-filter-metadata-scdet: CMD = run $(FILTER_METADATA_COMMAND) "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',scdet=s=1" -CROPDETECT_DEPS = LAVFI_INDEV FILE_PROTOCOL MOVIE_FILTER CROPDETECT_FILTER \ +CROPDETECT_DEPS = LAVFI_INDEV FILE_PROTOCOL MOVIE_FILTER MOVIE_FILTER MESTIMATE_FILTER CROPDETECT_FILTER \ SCALE_FILTER MOV_DEMUXER H264_DECODER FATE_METADATA_FILTER-$(call ALLYES, $(CROPDETECT_DEPS)) += fate-filter-metadata-cropdetect fate-filter-metadata-cropdetect: SRC = $(TARGET_SAMPLES)/filter/cropdetect.mp4 fate-filter-metadata-cropdetect: CMD = run $(FILTER_METADATA_COMMAND) "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',cropdetect=max_outliers=3" +FATE_METADATA_FILTER-$(call ALLYES, $(CROPDETECT_DEPS)) += fate-filter-metadata-cropdetect1 +fate-filter-metadata-cropdetect1: SRC = $(TARGET_SAMPLES)/filter/cropdetect1.mp4 +fate-filter-metadata-cropdetect1: CMD = run $(FILTER_METADATA_COMMAND) "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',mestimate,cropdetect=mode=mvedges,metadata=mode=print" +FATE_METADATA_FILTER-$(call ALLYES, $(CROPDETECT_DEPS)) += fate-filter-metadata-cropdetect2 +fate-filter-metadata-cropdetect2: SRC = $(TARGET_SAMPLES)/filter/cropdetect2.mp4 +fate-filter-metadata-cropdetect2: CMD = run $(FILTER_METADATA_COMMAND) "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',mestimate,cropdetect=mode=mvedges,metadata=mode=print" FREEZEDETECT_DEPS = LAVFI_INDEV MPTESTSRC_FILTER SCALE_FILTER FREEZEDETECT_FILTER FATE_METADATA_FILTER-$(call ALLYES, $(FREEZEDETECT_DEPS)) += fate-filter-metadata-freezedetect @@ -685,7 +690,7 @@ fate-filter-metadata-avf-aphase-meter-out-of-phase: CMD = run $(FILTER_METADATA_COMMAND) "amovie='$(SRC)',aphasemeter=video=0" FATE_FILTER_SAMPLES-$(call TRANSCODE, RAWVIDEO H264, MOV, ARESAMPLE_FILTER AAC_FIXED_DECODER) += fate-filter-meta-4560-rotate0 -fate-filter-meta-4560-rotate0: CMD = transcode mov $(TARGET_SAMPLES)/filter/sample-in-issue-505.mov mov "-c copy -metadata:s:v:0 rotate=0" "-af aresample" "" "" "-flags +bitexact -c:a aac_fixed" +fate-filter-meta-4560-rotate0: CMD = transcode "mov -display_rotation:v:0 0" $(TARGET_SAMPLES)/filter/sample-in-issue-505.mov mov "-c copy" "-af aresample" "" "" "-flags +bitexact -c:a aac_fixed" FATE_FILTER_CMP_METADATA-$(CONFIG_BLOCKDETECT_FILTER) += fate-filter-refcmp-blockdetect-yuv fate-filter-refcmp-blockdetect-yuv: CMD = cmp_metadata blockdetect yuv420p 0.015 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/flac.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/flac.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/flac.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/flac.mak 2023-03-03 13:29:59.000000000 +0000 @@ -6,6 +6,7 @@ fate-flac-16-lpc-cholesky \ fate-flac-16-lpc-levinson \ fate-flac-24-comp-8 \ + fate-flac-32-wasted-bits \ fate-flac-rice-params \ fate-flac-16-chmode-%: OPTS = -ch_mode $(@:fate-flac-16-chmode-%=%) @@ -20,6 +21,9 @@ fate-flac-24-%: REF = $(SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav fate-flac-24-%: CMD = enc_dec_pcm flac wav s24le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac $(OPTS) +fate-flac-32-wasted-bits: REF = $(SAMPLES)/audio-reference/drums_2ch_44kHz_s32_wastedbits.wav +fate-flac-32-wasted-bits: CMD = enc_dec_pcm flac wav s32le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac -strict experimental + fate-flac-rice-params: REF = $(SAMPLES)/audio-reference/chorusnoise_2ch_44kHz_s16.wav fate-flac-rice-params: CMD = enc_dec_pcm flac wav s16le $(subst $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/hevc.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/hevc.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/hevc.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/hevc.mak 2023-03-03 13:29:59.000000000 +0000 @@ -141,6 +141,7 @@ WPP_D_ericsson_MAIN_2 \ WPP_E_ericsson_MAIN_2 \ WPP_F_ericsson_MAIN_2 \ + WPP_HIGH_TP_444_8BIT_RExt_Apple_2 \ HEVC_SAMPLES_10BIT = \ DBLK_A_MAIN10_VIXS_3 \ @@ -236,6 +237,9 @@ fate-hevc-monochrome-crop: CMD = probeframes -show_entries frame=width,height:stream=width,height $(TARGET_SAMPLES)/hevc/hevc-monochrome.hevc FATE_HEVC_FFPROBE-$(call PARSERDEMDEC, HEVC, HEVC, HEVC) += fate-hevc-monochrome-crop +fate-hevc-afd-tc-sei: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -bitexact -show_entries frame_side_data_list -select_streams v $(TARGET_SAMPLES)/mpegts/loewe.ts +FATE_HEVC_FFPROBE-$(call PARSERDEMDEC, HEVC, HEVC, HEVC) += fate-hevc-afd-tc-sei + fate-hevc-hdr10-plus-metadata: CMD = probeframes -show_entries frame=side_data_list $(TARGET_SAMPLES)/hevc/hdr10_plus_h265_sample.hevc FATE_HEVC_FFPROBE-$(call DEMDEC, HEVC, HEVC) += fate-hevc-hdr10-plus-metadata diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/id3v2.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/id3v2.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/id3v2.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/id3v2.mak 2023-03-03 13:29:59.000000000 +0000 @@ -7,6 +7,11 @@ FATE_ID3V2_FFMPEG_FFPROBE-$(call REMUX, AIFF, WAV_DEMUXER) += fate-id3v2-chapters fate-id3v2-chapters: CMD = transcode wav $(TARGET_SAMPLES)/wav/200828-005.wav aiff "-c copy -metadata:c:0 description=foo -metadata:c:0 date=2021 -metadata:c copyright=none -metadata:c:1 genre=nonsense -write_id3v2 1" "-c copy -t 0.05" "-show_entries format_tags:chapters" +# Tests reading and writing UTF-16 BOM strings; also tests +# the AIFF muxer's and demuxer's ability to preserve channel layouts. +FATE_ID3V2_FFMPEG_FFPROBE-$(call REMUX, AIFF, WAV_DEMUXER FLAC_DEMUXER PCM_S16LE_DECODER MJPEG_DECODER ARESAMPLE_FILTER CHANNELMAP_FILTER PCM_S24BE_ENCODER) += fate-id3v2-utf16-bom +fate-id3v2-utf16-bom: CMD = transcode wav $(TARGET_SAMPLES)/audio-reference/yo.raw-short.wav aiff "-map 0:a -map 1:v -af aresample,channelmap=channel_layout=hexagonal,aresample -c:a pcm_s24be -c:v copy -write_id3v2 1 -id3v2_version 3 -map_metadata:g:0 1:g -map_metadata:s:v 1:g" "-c copy -t 0.05" "-show_entries stream=channel_layout:stream_tags:format_tags" "-i $(TARGET_SAMPLES)/cover_art/cover_art.flac" + FATE_SAMPLES_FFPROBE += $(FATE_ID3V2_FFPROBE-yes) FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_ID3V2_FFMPEG_FFPROBE-yes) fate-id3v2: $(FATE_ID3V2_FFPROBE-yes) $(FATE_ID3V2_FFMPEG_FFPROBE-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/image.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/image.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/image.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/image.mak 2023-03-03 13:29:59.000000000 +0000 @@ -392,6 +392,10 @@ FATE_PNG_TRANSCODE-$(call TRANSCODE, PNG, IMAGE2 IMAGE_PNG_PIPE) += fate-png-icc fate-png-icc: CMD = transcode png_pipe $(TARGET_SAMPLES)/png1/lena-int_rgb24.png image2 "-c png" "" "-show_frames" +FATE_PNG_PROBE-$(call ALLYES, LCMS2) += fate-png-icc-parse +fate-png-icc-parse: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_frames \ + -flags2 icc_profiles $(TARGET_SAMPLES)/png1/lena-int_rgb24.png + FATE_PNG-$(call DEMDEC, IMAGE2, PNG) += $(FATE_PNG) FATE_PNG_PROBE-$(call DEMDEC, IMAGE2, PNG) += $(FATE_PNG_PROBE) FATE_IMAGE_FRAMECRC += $(FATE_PNG-yes) @@ -497,7 +501,26 @@ FATE_TIFF += fate-tiff-fax-g3s fate-tiff-fax-g3s: CMD = framecrc -i $(TARGET_SAMPLES)/CCITT_fax/G31DS.TIF -FATE_TIFF-$(call DEMDEC, IMAGE2, TIFF) += $(FATE_TIFF) +FATE_TIFF += fate-tiff-uncompressed-rgbf32le +fate-tiff-uncompressed-rgbf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/uncompressed_rgbf32le.tif + +FATE_TIFF += fate-tiff-uncompressed-rgbaf32le +fate-tiff-uncompressed-rgbaf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/uncompressed_rgbaf32le.tif + +FATE_TIFF += fate-tiff-lzw-rgbf32le +fate-tiff-lzw-rgbf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/lzw_rgbf32le.tif + +FATE_TIFF += fate-tiff-lzw-rgbaf32le +fate-tiff-lzw-rgbaf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/lzw_rgbaf32le.tif + +FATE_TIFF_ZIP += fate-tiff-zip-rgbf32le +fate-tiff-zip-rgbf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/zip_rgbf32le.tif + +FATE_TIFF_ZIP += fate-tiff-zip-rgbaf32le +fate-tiff-zip-rgbaf32le: CMD = framecrc -i $(TARGET_SAMPLES)/tiff/zip_rgbaf32le.tif + +FATE_TIFF-$(call FRAMECRC, IMAGE2, TIFF, ZLIB) += $(FATE_TIFF_ZIP) +FATE_TIFF-$(call FRAMECRC, IMAGE2, TIFF) += $(FATE_TIFF) FATE_IMAGE_FRAMECRC += $(FATE_TIFF-yes) fate-tiff: $(FATE_TIFF-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/imf.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/imf.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/imf.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/imf.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,9 @@ FATE_IMF += fate-imf-cpl-with-repeat fate-imf-cpl-with-repeat: CMD = framecrc -f imf -i $(TARGET_SAMPLES)/imf/countdown/CPL_bb2ce11c-1bb6-4781-8e69-967183d02b9b.xml -c:v copy +FATE_IMF += fate-imf-cpl-with-audio +fate-imf-cpl-with-audio: CMD = framecrc -f imf -i $(TARGET_SAMPLES)/imf/countdown-audio/CPL_688f4f63-a317-4271-99bf-51444ff39c5b.xml -c:a copy + FATE_SAMPLES_FFMPEG-$(CONFIG_IMF_DEMUXER) += $(FATE_IMF) fate-imfdec: $(FATE_IMF) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-audio.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-audio.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-audio.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-audio.mak 2023-03-03 13:29:59.000000000 +0000 @@ -14,6 +14,7 @@ FATE_LAVF_AUDIO-$(call ENCDEC, TTA, TTA) += tta FATE_LAVF_AUDIO-$(call ENCMUX, TTA, MATROSKA_AUDIO) += mka FATE_LAVF_AUDIO_RESAMPLE-$(call ENCDEC, PCM_S16BE_PLANAR, AST) += ast +FATE_LAVF_AUDIO_RESAMPLE-$(call ENCDEC, DFPWM, DFPWM) += dfpwm FATE_LAVF_AUDIO_RESAMPLE-$(call ENCDEC, PCM_U8, RSO) += rso FATE_LAVF_AUDIO_RESAMPLE-$(call ENCDEC, PCM_S16LE, SOX) += sox FATE_LAVF_AUDIO_RESAMPLE-$(call ENCDEC, PCM_U8, VOC) += voc @@ -21,13 +22,14 @@ FATE_LAVF_AUDIO-$(CONFIG_ARESAMPLE_FILTER) += $(FATE_LAVF_AUDIO_RESAMPLE-yes) FATE_LAVF_AUDIO = $(FATE_LAVF_AUDIO-yes:%=fate-lavf-%) -FATE_LAVF_AUDIO := $(if $(call ENCDEC, PCM_S16LE, CRC PCM_S16LE), $(FATE_LAVF_AUDIO)) +FATE_LAVF_AUDIO := $(if $(call ENCDEC, PCM_S16LE, CRC PCM_S16LE, PIPE_PROTOCOL), $(FATE_LAVF_AUDIO)) $(FATE_LAVF_AUDIO): CMD = lavf_audio $(FATE_LAVF_AUDIO): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%) $(FATE_LAVF_AUDIO): $(AREF) fate-lavf-al fate-lavf-ul: CMD = lavf_audio "" "" "-ar 44100" +fate-lavf-dfpwm: CMD = lavf_audio "" "" "-sample_rate 44100" fate-lavf-ogg: CMD = lavf_audio "" "-c:a flac" fate-lavf-s16.voc: CMD = lavf_audio "-ac 2" "-c:a pcm_s16le" fate-lavf-ast: CMD = lavf_audio "-ac 2" "-loopstart 1 -loopend 10" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-container.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-container.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-container.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-container.mak 2023-03-03 13:29:59.000000000 +0000 @@ -28,7 +28,7 @@ FATE_LAVF_CONTAINER-$(!CONFIG_SCALE_FILTER) := $(filter-out $(FATE_LAVF_CONTAINER_SCALE),$(FATE_LAVF_CONTAINER-yes)) FATE_LAVF_CONTAINER = $(FATE_LAVF_CONTAINER-yes:%=fate-lavf-%) -FATE_LAVF_CONTAINER := $(if $(call ENCDEC2, RAWVIDEO PGMYUV, PCM_S16LE, CRC IMAGE2, PCM_S16LE_DEMUXER), $(FATE_LAVF_CONTAINER)) +FATE_LAVF_CONTAINER := $(if $(call ENCDEC2, RAWVIDEO PGMYUV, PCM_S16LE, CRC IMAGE2, PCM_S16LE_DEMUXER PIPE_PROTOCOL), $(FATE_LAVF_CONTAINER)) $(FATE_LAVF_CONTAINER): CMD = lavf_container $(FATE_LAVF_CONTAINER): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image2pipe.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image2pipe.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image2pipe.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image2pipe.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,11 +1,15 @@ LAVF_IMAGE2PIPE = $(call ALLYES, $(1)_DECODER $(1)_ENCODER $(2) \ IMAGE2_DEMUXER PGMYUV_DECODER \ IMAGE2PIPE_MUXER IMAGE2PIPE_DEMUXER \ - RAWVIDEO_ENCODER CRC_MUXER FILE_PROTOCOL) + RAWVIDEO_ENCODER CRC_MUXER \ + FILE_PROTOCOL PIPE_PROTOCOL) FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, PBM, PNM_PARSER SCALE_FILTER) += pbmpipe FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, PGM, PNM_PARSER SCALE_FILTER) += pgmpipe FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, PPM, PNM_PARSER SCALE_FILTER) += ppmpipe +FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, QOI, QOI_PARSER SCALE_FILTER) += qoipipe +FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, XBM, XBM_PARSER SCALE_FILTER) += xbmpipe +FATE_LAVF_IMAGE2PIPE-$(call LAVF_IMAGE2PIPE, XWD, XWD_PARSER SCALE_FILTER) += xwdpipe FATE_LAVF_IMAGE2PIPE = $(FATE_LAVF_IMAGE2PIPE-yes:%=fate-lavf-%) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-image.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,6 @@ LAVF_IMAGES = $(call ALLYES, FILE_PROTOCOL IMAGE2_DEMUXER PGMYUV_DECODER \ SCALE_FILTER $(1)_ENCODER IMAGE2_MUXER \ - $(1)_DECODER RAWVIDEO_ENCODER CRC_MUXER) + $(1)_DECODER RAWVIDEO_ENCODER CRC_MUXER PIPE_PROTOCOL) FATE_LAVF_IMAGES-$(call LAVF_IMAGES, BMP) += bmp FATE_LAVF_IMAGES-$(call LAVF_IMAGES, DPX) += dpx @@ -43,6 +43,7 @@ FATE_LAVF_IMAGES-$(call LAVF_IMAGES, TARGA) += tga FATE_LAVF_IMAGES-$(call LAVF_IMAGES, TIFF) += tiff FATE_LAVF_IMAGES-$(call LAVF_IMAGES, QOI) += qoi +FATE_LAVF_IMAGES-$(call LAVF_IMAGES, WBMP) += wbmp FATE_LAVF_IMAGES-$(call LAVF_IMAGES, XBM) += xbm FATE_LAVF_IMAGES-$(call LAVF_IMAGES, XWD) += xwd FATE_LAVF_IMAGES-$(call LAVF_IMAGES, XWD) += rgba.xwd diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-video.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-video.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-video.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/lavf-video.mak 2023-03-03 13:29:59.000000000 +0000 @@ -12,7 +12,7 @@ FATE_LAVF_VIDEO-$(CONFIG_SCALE_FILTER) += $(FATE_LAVF_VIDEO_SCALE-yes) FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%) FATE_LAVF_VIDEO := $(if $(call ALLYES, IMAGE2_DEMUXER PGMYUV_DECODER \ - RAWVIDEO_ENCODER CRC_MUXER), \ + RAWVIDEO_ENCODER CRC_MUXER, PIPE_PROTOCOL), \ $(FATE_LAVF_VIDEO)) $(FATE_LAVF_VIDEO): CMD = lavf_video diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/libavcodec.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/libavcodec.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/libavcodec.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/libavcodec.mak 2023-03-03 13:29:59.000000000 +0000 @@ -3,6 +3,16 @@ fate-avpacket: CMD = run libavcodec/tests/avpacket$(EXESUF) fate-avpacket: CMP = null +FATE_LIBAVCODEC-yes += fate-bitstream-be +fate-bitstream-be: libavcodec/tests/bitstream_be$(EXESUF) +fate-bitstream-be: CMD = run libavcodec/tests/bitstream_be$(EXESUF) +fate-bitstream-be: CMP = null + +FATE_LIBAVCODEC-yes += fate-bitstream-le +fate-bitstream-le: libavcodec/tests/bitstream_le$(EXESUF) +fate-bitstream-le: CMD = run libavcodec/tests/bitstream_le$(EXESUF) +fate-bitstream-le: CMP = null + FATE_LIBAVCODEC-$(CONFIG_CABAC) += fate-cabac fate-cabac: libavcodec/tests/cabac$(EXESUF) fate-cabac: CMD = run libavcodec/tests/cabac$(EXESUF) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/matroska.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/matroska.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/matroska.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/matroska.mak 2023-03-03 13:29:59.000000000 +0000 @@ -49,6 +49,12 @@ fate-matroska-flac-extradata-update: CMD = transcode matroska $(TARGET_SAMPLES)/mkv/flac_channel_layouts.mka \ matroska "-map 0 -map 0:0 -c flac -frames:a:2 8" "-map 0 -c copy" +# This tests that the Matroska/WebM muxer writes the AV1 CodecPrivate +# via extradata obtained from packet side data. It also tests that +# the aspect ratio is only written with pixels as DisplayUnit for WebM. +FATE_MATROSKA-$(call REMUX, WEBM MATROSKA, IVF_DEMUXER AV1_PARSER EXTRACT_EXTRADATA_BSF) += fate-webm-av1-extradata-update +fate-webm-av1-extradata-update: CMD = transcode ivf $(TARGET_SAMPLES)/av1/decode_model.ivf webm "-c copy -bsf extract_extradata -sar 3:1" "-c copy" "" "" "-nofind_stream_info" "-nofind_stream_info" + # This test tests demuxing Vorbis and chapters from ogg and muxing it in and # demuxing it from Matroska/WebM. It furthermore tests the WebM muxer, in # particular its DASH mode. Finally, it tests writing the Cues at the front. @@ -163,6 +169,25 @@ += fate-matroska-mpegts-remux fate-matroska-mpegts-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/mpegts/pmtchange.ts matroska "-map 0:2 -map 0:2 -c copy -disposition:a:1 -visual_impaired+hearing_impaired -default_mode infer" "-map 0 -c copy" "-show_entries stream_disposition:stream=index" +# Tests maintaining codec delay while remuxing from Matroska. +# For some reason, ffmpeg shifts the timestamps of the input file +# to make them zero before reaching the muxer while it does not +# for the ogg-opus-remux test. -avoid_negative_ts make_zero counters this. +FATE_MATROSKA_FFMPEG_FFPROBE-$(call REMUX, MATROSKA, OPUS_PARSER OPUS_DECODER) += fate-matroska-opus-remux +fate-matroska-opus-remux: CMD = transcode matroska $(TARGET_SAMPLES)/mkv/codec_delay_opus.mkv matroska "-avoid_negative_ts make_zero -c copy" "-copyts -c copy" "-show_packets -show_entries stream=codec_name,initial_padding -read_intervals %0.05" + +# Tests maintaining codec delay while remuxing from ogg. +FATE_MATROSKA_FFMPEG_FFPROBE-$(call REMUX, MATROSKA, OGG_DEMUXER OPUS_PARSER OPUS_DECODER) += fate-matroska-ogg-opus-remux +fate-matroska-ogg-opus-remux: CMD = transcode ogg $(TARGET_SAMPLES)/ogg/intro-partial.opus matroska "-c copy" "-copyts -c copy" "-show_packets -show_entries stream=codec_name,initial_padding -read_intervals %0.05" + +# This tests reencoding with an audio encoder that adds initial padding. +# The initial padding is currently not maintained. +FATE_MATROSKA_FFMPEG_FFPROBE-$(call REMUX, MATROSKA, MXF_DEMUXER PCM_S16LE_DECODER \ + MP2FIXED_ENCODER ARESAMPLE_FILTER \ + MPEG2VIDEO_DECODER MPEGVIDEO_PARSER \ + EXTRACT_EXTRADATA_BSF) += fate-matroska-encoding-delay +fate-matroska-encoding-delay: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Sony-00001.mxf matroska "-c:v copy -af aresample -c:a mp2fixed" "-copyts -c copy" "-show_packets -show_entries stream=codec_name,initial_padding -read_intervals %0.05" + FATE_MATROSKA-$(call REMUX, MATROSKA, SUP_DEMUXER) += fate-matroska-pgs-remux fate-matroska-pgs-remux: CMD = transcode sup $(TARGET_SAMPLES)/sub/pgs_sub.sup matroska "-copyts -c:s copy" "-copyts -c:s copy" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/microsoft.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/microsoft.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/microsoft.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/microsoft.mak 2023-03-03 13:29:59.000000000 +0000 @@ -14,8 +14,9 @@ fate-mss2-rgb555: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rle555.wmv -pix_fmt rgb555le -vf scale fate-mss2-rgb555s: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/rle555s.wmv -pix_fmt rgb555le -vf scale -FATE_MSS2 += fate-mss2-wmv +FATE_MSS2 += fate-mss2-wmv fate-mss2-region fate-mss2-wmv: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/msscreencodec.wmv -an -frames 100 +fate-mss2-region: CMD = framecrc -i $(TARGET_SAMPLES)/mss2/mss2_2.wmv -an FATE_MSS2-$(call FRAMECRC, ASF, MSS2) += $(FATE_MSS2) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/mxf.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/mxf.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/mxf.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/mxf.mak 2023-03-03 13:29:59.000000000 +0000 @@ -1,17 +1,15 @@ -FATE_MXF += fate-mxf-missing-index-demux +FATE_MXF-$(call DEMMUX, MXF, CRC, PIPE_PROTOCOL) += fate-mxf-missing-index-demux fate-mxf-missing-index-demux: CMD = crc -i $(TARGET_SAMPLES)/mxf/opatom_missing_index.mxf -c:a copy -FATE_MXF += fate-mxf-essencegroup-demux +FATE_MXF-$(call FRAMECRC, MXF,) += fate-mxf-essencegroup-demux fate-mxf-essencegroup-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mxf/opatom_essencegroup_alpha_raw.mxf -c:v copy -FATE_MXF += fate-mxf-multiple-components-demux +FATE_MXF-$(call FRAMECRC, MXF,) += fate-mxf-multiple-components-demux fate-mxf-multiple-components-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mxf/multiple_components.mxf -c:v copy -FATE_MXF += fate-mxf-metadata-source-ref1 +FATE_MXF-$(call DEMMUX, MXF, FFMETADATA, PIPE_PROTOCOL) += fate-mxf-metadata-source-ref1 fate-mxf-metadata-source-ref2 fate-mxf-metadata-source-ref1: CMD = fmtstdout ffmetadata -i $(TARGET_SAMPLES)/mxf/track_01_v02.mxf -fflags +bitexact -flags +bitexact -map 0:0 -map 0:2 -map 0:3 -map_metadata:g -1 - -FATE_MXF += fate-mxf-metadata-source-ref2 fate-mxf-metadata-source-ref2: CMD = fmtstdout ffmetadata -i $(TARGET_SAMPLES)/mxf/track_02_a01.mxf -fflags +bitexact -flags +bitexact -map 0:0 -map 0:1 -map 0:3 -map_metadata:g -1 # @@ -21,42 +19,42 @@ ffprobe$(PROGSSUF)$(EXESUF) -show_entries format=format_name,duration,bit_rate:format_tags:streams:stream_tags \ -print_format default -bitexact -v 0 -FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-probe-d10 +FATE_MXF_PROBE-$(call DEMDEC, MXF, MPEG2VIDEO PCM_S16LE, MPEGVIDEO_PARSER EXTRACT_EXTRADATA_BSF) += fate-mxf-probe-d10 fate-mxf-probe-d10: SRC = $(TARGET_SAMPLES)/mxf/Sony-00001.mxf fate-mxf-probe-d10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" -FATE_MXF_PROBE-$(call ENCDEC, DNXHD, MXF) += fate-mxf-probe-dnxhd +FATE_MXF_PROBE-$(call DEMDEC, MXF, DNXHD) += fate-mxf-probe-dnxhd fate-mxf-probe-dnxhd: SRC = $(TARGET_SAMPLES)/mxf/multiple_components.mxf fate-mxf-probe-dnxhd: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" -FATE_MXF_PROBE-$(call ENCDEC2, DVVIDEO, PCM_S16LE, MXF) += fate-mxf-probe-dv25 +FATE_MXF_PROBE-$(call DEMDEC, MXF, JPEG2000) += fate-mxf-probe-j2k +fate-mxf-probe-j2k: SRC = $(TARGET_SAMPLES)/imf/countdown/countdown-small.mxf +fate-mxf-probe-j2k: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" + +FATE_MXF_PROBE-$(call DEMDEC, MXF, DVVIDEO PCM_S16LE) += fate-mxf-probe-dv25 fate-mxf-probe-dv25: SRC = $(TARGET_SAMPLES)/mxf/Avid-00005.mxf fate-mxf-probe-dv25: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" -FATE_MXF_PROBE-$(call ENCDEC2, PRORES, PCM_S24LE, MXF) += fate-mxf-probe-applehdr10 +FATE_MXF_PROBE-$(call DEMDEC, MXF, PRORES PCM_S24LE) += fate-mxf-probe-applehdr10 fate-mxf-probe-applehdr10: SRC = $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf fate-mxf-probe-applehdr10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" | sed -e "s/yuv422p10../yuv422p10/" -FATE_MXF_REEL_NAME-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-reel_name -fate-mxf-reel_name: $(SAMPLES)/mxf/Sony-00001.mxf -fate-mxf-reel_name: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf -c copy -timecode 00:00:00:00 -metadata "reel_name=test_reel" -fflags +bitexact -f mxf +# Tests remuxing ProRes as well as writing mastering display metadata. +FATE_MXF_FFMPEG_FFPROBE-$(call REMUX, MXF, PRORES_DECODER) += fate-mxf-remux-applehdr10 +fate-mxf-remux-applehdr10: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf mxf "-map 0 -c copy" "-c copy -t 0.3" "-show_entries format_tags:stream_side_data_list:stream=index,codec_name,codec_tag:stream_tags" -FATE_MXF_USER_COMMENTS-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-user-comments -fate-mxf-user-comments: $(SAMPLES)/mxf/Sony-00001.mxf +FATE_MXF-$(call DEMMUX, MXF, MXF, MPEGVIDEO_PARSER MPEG2VIDEO_DECODER) += fate-mxf-reel_name fate-mxf-user-comments +fate-mxf-reel_name: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf -c copy -timecode 00:00:00:00 -metadata "reel_name=test_reel" -fflags +bitexact -f mxf fate-mxf-user-comments: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf -c copy -metadata "comment_test=value" -fflags +bitexact -f mxf -FATE_MXF_D10_USER_COMMENTS-$(call ALLYES, FILE_PROTOCOL MXF_DEMUXER DVVIDEO_DECODER SCALE_FILTER MPEG2VIDEO_ENCODER MXF_D10_MUXER EXTRACT_EXTRADATA_BSF MPEGVIDEO_PARSER PIPE_PROTOCOL FRAMECRC_MUXER) += fate-mxf-d10-user-comments +FATE_MXF_FFMPEG_FFPROBE-$(call REMUX, MXF_D10 MXF, DVVIDEO_DECODER SCALE_FILTER MPEG2VIDEO_ENCODER EXTRACT_EXTRADATA_BSF MPEGVIDEO_PARSER) += fate-mxf-d10-user-comments fate-mxf-d10-user-comments: CMD = transcode mxf $(TARGET_SAMPLES)/mxf/Avid-00005.mxf mxf_d10 "-c:v mpeg2video -b:v 30000k -minrate:v 30000k -maxrate:v 30000k -bufsize:v 30000k -rc_init_occupancy 30000k -vf scale=w=1280:h=720 -an -metadata comment_test=value -metadata company_name=FATE-company -metadata product_name=FATE-test -metadata product_version=3.14159 -store_user_comments 1" "-c copy -frames:v 5" "-show_entries format_tags" -FATE_MXF_OPATOM_USER_COMMENTS-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-opatom-user-comments -fate-mxf-opatom-user-comments: $(SAMPLES)/mxf/Sony-00001.mxf +FATE_MXF-$(call DEMMUX, MXF, MXF_OPATOM, MPEGVIDEO_PARSER MPEG2VIDEO_DECODER) += fate-mxf-opatom-user-comments fate-mxf-opatom-user-comments: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf -an -vcodec copy -metadata "comment_test=value" -fflags +bitexact -f mxf_opatom -FATE_MXF-$(CONFIG_MXF_DEMUXER) += $(FATE_MXF) - -FATE_SAMPLES_AVCONV += $(FATE_MXF-yes) $(FATE_MXF_REEL_NAME-yes) -FATE_SAMPLES_AVCONV += $(FATE_MXF_USER_COMMENTS-yes) $(FATE_MXF_OPATOM_USER_COMMENTS-yes) -FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_MXF_D10_USER_COMMENTS-yes) +FATE_SAMPLES_FFMPEG += $(FATE_MXF-yes) +FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_MXF_FFMPEG_FFPROBE-yes) FATE_SAMPLES_FFPROBE += $(FATE_MXF_PROBE-yes) -fate-mxf: $(FATE_MXF-yes) $(FATE_MXF_PROBE-yes) $(FATE_MXF_REEL_NAME-yes) $(FATE_MXF_USER_COMMENTS-yes) $(FATE_MXF_D10_USER_COMMENTS-yes) $(FATE_MXF_OPATOM_USER_COMMENTS-yes) +fate-mxf: $(FATE_MXF-yes) $(FATE_MXF_PROBE-yes) $(FATE_MXF_FFMPEG_FFPROBE-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/opus.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/opus.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/opus.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/opus.mak 2023-03-03 13:29:59.000000000 +0000 @@ -4,7 +4,7 @@ OPUS_CELT_SAMPLES = $(addprefix testvector, 01 11) tron.6ch.tinypkts OPUS_HYBRID_SAMPLES = $(addprefix testvector, 05 06) -OPUS_SILK_SAMPLES = $(addprefix testvector, 02 03 04) +OPUS_SILK_SAMPLES = $(addprefix testvector, 02 03 04) silk-lbrr OPUS_OTHER_SAMPLES = $(addprefix testvector, 07 08 09 10 12) define FATE_OPUS_TEST @@ -33,6 +33,7 @@ fate-opus-testvector10: CMP_TARGET = 38 fate-opus-testvector11: CMP_TARGET = 0 fate-opus-testvector12: CMP_TARGET = 160 +fate-opus-silk-lbrr: CMP_TARGET = 0 fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440 fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/segafilm.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/segafilm.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/segafilm.mak 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/segafilm.mak 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,15 @@ +FATE_SEGAFILM-$(call REMUX, SEGAFILM, CINEPAK_DECODER ADX_PARSER) += fate-segafilm-adx-remux +fate-segafilm-adx-remux: CMD = transcode film_cpk $(TARGET_SAMPLES)/film/op-partial.cak film_cpk "-c copy" "-c copy" + +FATE_SEGAFILM-$(call REMUX, SEGAFILM, CINEPAK_DECODER) += fate-segafilm-s8-remux +fate-segafilm-s8-remux: CMD = transcode film_cpk $(TARGET_SAMPLES)/film/logo-capcom.cpk film_cpk "-c copy" "-c copy" + +# This tests muxing non-segafilm cinepak into segafilm. +FATE_SEGAFILM-$(call REMUX, SEGAFILM, AVI_DEMUXER CINEPAK_DECODER) += fate-segafilm-cinepak-mux +fate-segafilm-cinepak-mux: CMD = transcode avi $(TARGET_SAMPLES)/cvid/pcitva15.avi film_cpk "-map 0:v -c copy" "-c copy" + +FATE_SEGAFILM-$(call TRANSCODE, RAWVIDEO CINEPAK, SEGAFILM, AVI_DEMUXER PCM_U8_DECODER ARESAMPLE_FILTER PCM_S16BE_PLANAR_ENCODER) += fate-segafilm-rawvideo-mux +fate-segafilm-rawvideo-mux: CMD = transcode avi $(TARGET_SAMPLES)/cvid/laracroft-cinepak-partial.avi film_cpk "-c:v rawvideo -pix_fmt rgb24 -af aresample -c:a pcm_s16be_planar" "-c copy" + +FATE_SAMPLES_FFMPEG += $(FATE_SEGAFILM-yes) +fate-segafilm: $(FATE_SEGAFILM-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/spdif.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/spdif.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/spdif.mak 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/spdif.mak 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,47 @@ +# This padds the AAC frames to 16 bit words (the actual size is +# still available in the ADTS headers). +FATE_SPDIF_REMUX-$(call ALLYES, AAC_DEMUXER AAC_DECODER) += fate-spdif-aac-remux +fate-spdif-aac-remux: CMD = transcode aac $(TARGET_SAMPLES)/aac/foo.aac spdif "-c copy" "-c copy" + +FATE_SPDIF_REMUX-$(call ALLYES, AC3_DEMUXER AC3_DECODER) += fate-spdif-ac3-remux +fate-spdif-ac3-remux: CMD = transcode ac3 $(TARGET_SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3 spdif "-c copy" "-c copy" + +FATE_SPDIF_REMUX-$(call ALLYES, DTS_DEMUXER DCA_DECODER) += fate-spdif-dca-core-remux +fate-spdif-dca-core-remux: CMD = transcode dts $(TARGET_SAMPLES)/dts/dcadec-suite/core_51_24_48_768_0.dtshd spdif "-c copy" "-c copy" + +FATE_SPDIF-$(call DEMMUX, DTSHD, SPDIF) += fate-spdif-dca-core-bswap +fate-spdif-dca-core-bswap: CMD = md5 -i $(TARGET_SAMPLES)/dts/dcadec-suite/core_51_24_48_768_0.dtshd -c copy -spdif_flags +be -f spdif + +# Only the core will be transferred, extensions are discarded. +FATE_SPDIF_REMUX-$(call ALLYES, DTS_DEMUXER DCA_DECODER) += fate-spdif-dca-master-core-remux +fate-spdif-dca-master-core-remux: CMD = transcode dts $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts spdif "-c copy" "-c copy" + +FATE_SPDIF-$(call DEMMUX, DTS, SPDIF) += fate-spdif-dca-master fate-spdif-dca-master-core +fate-spdif-dca-master: CMD = md5 -i $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts -c copy -dtshd_rate 192000 -f spdif +# This test uses a too low bitrate and therefore switches to only transmit the core. +fate-spdif-dca-master-core: CMD = md5 -i $(TARGET_SAMPLES)/dts/master_audio_7.1_24bit.dts -c copy -dtshd_rate 96000 -f spdif + +FATE_SPDIF-$(call DEMMUX, EAC3, SPDIF) += fate-spdif-eac3 +fate-spdif-eac3: CMD = md5 -i $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3 -c copy -f spdif + +FATE_SPDIF_REMUX-$(call ALLYES, EAC3_DEMUXER EAC3_DECODER SPDIF_MUXER SPDIF_DEMUXER) += fate-spdif-eac3-remux +fate-spdif-eac3-remux: CMD = transcode eac3 $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3 spdif "-c copy" "-c copy" + +FATE_SPDIF-$(call DEMMUX, MLP, SPDIF) += fate-spdif-mlp +fate-spdif-mlp: CMD = md5 -i $(TARGET_SAMPLES)/lossless-audio/luckynight-partial.mlp -c copy -f spdif + +# Note: The spdif demuxer marks the generated file as containing MP3. +FATE_SPDIF_REMUX-$(call ALLYES, MPEGTS_DEMUXER MPEGAUDIO_PARSER MP3_DECODER) += fate-spdif-mp2-remux +fate-spdif-mp2-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts spdif "-map 0:a -c copy" "-c copy" + +FATE_SPDIF_REMUX-$(call ALLYES, MP3_DEMUXER MP3_DECODER) += fate-spdif-mp3-remux +fate-spdif-mp3-remux: CMD = transcode mp3 $(TARGET_SAMPLES)/audiomatch/square3.mp3 spdif "-c copy" "-c copy" + +FATE_SPDIF-$(call DEMMUX, TRUEHD, SPDIF) += fate-spdif-truehd +fate-spdif-truehd: CMD = md5 -i $(TARGET_SAMPLES)/truehd/atmos.thd -c copy -f spdif + +# Make the demuxer support all the formats supported by the muxer +# and switch the md5 tests to remux tests? +FATE_SPDIF-$(call REMUX, SPDIF) += $(FATE_SPDIF_REMUX-yes) +FATE_SAMPLES_FFMPEG += $(FATE_SPDIF-yes) +fate-spdif: $(FATE_SPDIF-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/subtitles.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/subtitles.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/subtitles.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/subtitles.mak 2023-03-03 13:29:59.000000000 +0000 @@ -50,6 +50,11 @@ FATE_SUBTITLES_ASS-$(call DEMDEC, MPSUB, TEXT) += fate-sub-mpsub-frames fate-sub-mpsub-frames: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/MPSub_capability_tester_frames.sub +# FIXME?: The dts in the input file are not monotonous and so the +# timestamps of the remuxed file have been fixed up. +FATE_SUBTITLES-$(call REMUX, SUP) += fate-sub-pgs-remux +fate-sub-pgs-remux: CMD = transcode sup $(TARGET_SAMPLES)/sub/pgs_sub.sup sup "-copyts -c:s copy" "-copyts -c:s copy" + FATE_SUBTITLES_ASS-$(call DEMDEC, PJS, PJS) += fate-sub-pjs fate-sub-pjs: CMD = fmtstdout ass -i $(TARGET_SAMPLES)/sub/PJS_capability_tester.pjs diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/truehd.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/truehd.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/truehd.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/truehd.mak 2023-03-03 13:29:59.000000000 +0000 @@ -13,5 +13,10 @@ fate-truehd-core-bsf: CMP = oneline fate-truehd-core-bsf: REF = 3aa5d0c7825051f3657b71fd6135183b +FATE_TRUEHD-$(call DEMDEC, TRUEHD, TRUEHD) += fate-truehd-mono1726 +fate-truehd-mono1726: CMD = md5pipe -f truehd -i $(TARGET_SAMPLES)/truehd/ticket-1726-monocut.thd -f s32le +fate-truehd-mono1726: CMP = oneline +fate-truehd-mono1726: REF = 9be9551fac418440bb02101bfdb11df9 + FATE_SAMPLES_AUDIO += $(FATE_TRUEHD-yes) fate-truehd: $(FATE_TRUEHD-yes) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/vcodec.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/vcodec.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/vcodec.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/vcodec.mak 2023-03-03 13:29:59.000000000 +0000 @@ -413,6 +413,12 @@ fate-vsynth%-snow-ll: ENCOPTS = -qscale .001 -pred 1 \ -flags +mv4+qpel +FATE_VCODEC-$(call ENCDEC, SPEEDHQ, AVI) += speedhq-420p +FATE_VCODEC_SCALE-$(call ENCDEC, SPEEDHQ, AVI) += speedhq-422p speedhq-444p +fate-vsynth%-speedhq-420p: ENCOPTS = -pix_fmt yuv420p -b 600k +fate-vsynth%-speedhq-422p: ENCOPTS = -pix_fmt yuv422p -noise_reduction 1000 +fate-vsynth%-speedhq-444p: ENCOPTS = -pix_fmt yuv444p + FATE_VCODEC_SCALE-$(call ENCDEC, SVQ1, MOV) += svq1 fate-vsynth%-svq1: ENCOPTS = -qscale 3 -pix_fmt yuv410p fate-vsynth%-svq1: FMT = mov @@ -466,7 +472,8 @@ vc2-444p vc2-444p10 vc2-444p12 vc2-thaar vc2-t5_3 # Incorrect parameters - usually size or color format restrictions INC_PAR_OFF = cinepak h261 h261-trellis h263 h263p h263-obmc msvideo1 \ - roqvideo rv10 rv20 y41p qtrlegray + roqvideo rv10 rv20 speedhq-420p speedhq-422p speedhq-444p \ + y41p qtrlegray VSYNTH3_OFF = $(RESIZE_OFF) $(INC_PAR_OFF) FATE_VCODEC3 = $(filter-out $(VSYNTH3_OFF),$(FATE_VCODEC)) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/video.mak mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/video.mak --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/video.mak 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate/video.mak 2023-03-03 13:29:59.000000000 +0000 @@ -269,9 +269,8 @@ FATE_VIDEO-$(call FRAMECRC, MXG, MXPEG) += fate-mxpeg fate-mxpeg: CMD = framecrc -idct simple -flags +bitexact -i $(TARGET_SAMPLES)/mxpeg/m1.mxg -an -# FIXME dropped frames in this test because of coarse timebase FATE_NUV += fate-nuv-rtjpeg -fate-nuv-rtjpeg: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/nuv/Today.nuv -an -r 1000 +fate-nuv-rtjpeg: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/nuv/Today.nuv -an -enc_time_base -1 FATE_NUV += fate-nuv-rtjpeg-fh fate-nuv-rtjpeg-fh: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/nuv/rtjpeg_frameheader.nuv -an @@ -374,6 +373,9 @@ FATE_VIDEO-$(call FRAMECRC, WAV, SMVJPEG) += fate-smvjpeg fate-smvjpeg: CMD = framecrc -idct simple -flags +bitexact -i $(TARGET_SAMPLES)/smv/clock.smv -an +FATE_VIDEO-$(call FRAMECRC, AVI, VQC) += fate-vqc +fate-vqc: CMD = framecrc -i $(TARGET_SAMPLES)/vqc/samp1.avi + FATE_VIDEO += $(FATE_VIDEO-yes) FATE_SAMPLES_FFMPEG += $(FATE_VIDEO) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate-run.sh mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate-run.sh --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/fate-run.sh 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/fate-run.sh 2023-03-03 13:29:59.000000000 +0000 @@ -247,12 +247,13 @@ ffprobe_opts=$6 additional_input=$7 final_decode=$8 + enc_opt_in=$9 test -z "$additional_input" || additional_input="$DEC_OPTS $additional_input" encfile="${outdir}/${test}.${enc_fmt}" test $keep -ge 1 || cleanfiles="$cleanfiles $encfile" tsrcfile=$(target_path $srcfile) tencfile=$(target_path $encfile) - ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $additional_input \ + ffmpeg -f $src_fmt $DEC_OPTS $enc_opt_in -i $tsrcfile $additional_input \ $ENC_OPTS $enc_opt $FLAGS -f $enc_fmt -y $tencfile || return do_md5sum $encfile echo $(wc -c $encfile) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -229,8 +229,10 @@ include $(SRC_PATH)/tests/fate/qtrle.mak include $(SRC_PATH)/tests/fate/real.mak include $(SRC_PATH)/tests/fate/screen.mak +include $(SRC_PATH)/tests/fate/segafilm.mak include $(SRC_PATH)/tests/fate/segment.mak include $(SRC_PATH)/tests/fate/source.mak +include $(SRC_PATH)/tests/fate/spdif.mak include $(SRC_PATH)/tests/fate/speedhq.mak include $(SRC_PATH)/tests/fate/subtitles.mak include $(SRC_PATH)/tests/fate/truehd.mak diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,18 @@ +97dfd7f32d34fb74337c0f6c66e26e2d *tests/data/fate/aptx.aptx +418952 tests/data/fate/aptx.aptx +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s16le +#sample_rate 0: 44100 +#channel_layout_name 0: 2 channels +0, 0, 0, 1024, 4096, 0xcbb4ceff +0, 1024, 1024, 1024, 4096, 0xa66533e7 +0, 2048, 2048, 1024, 4096, 0x4f22ec39 +0, 3072, 3072, 1024, 4096, 0x45f117f9 +0, 4096, 4096, 1024, 4096, 0xad6c0b7a +0, 5120, 5120, 1024, 4096, 0x611618fd +0, 6144, 6144, 1024, 4096, 0x0ec02f2b +0, 7168, 7168, 1024, 4096, 0x2cf9ae5c +0, 8192, 8192, 1024, 4096, 0xfb008ac0 +0, 9216, 9216, 1024, 4096, 0x25068495 +0, 10240, 10240, 785, 3140, 0x5a260589 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx-hd mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx-hd --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx-hd 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/aptx-hd 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,18 @@ +6126e414af1acb193e24fdf33c7cac2e *tests/data/fate/aptx-hd.aptx_hd +628428 tests/data/fate/aptx-hd.aptx_hd +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s32le +#sample_rate 0: 44100 +#channel_layout_name 0: 2 channels +0, 0, 0, 1024, 8192, 0xa99888c6 +0, 1024, 1024, 1024, 8192, 0xc3e03a3c +0, 2048, 2048, 1024, 8192, 0x3f06e090 +0, 3072, 3072, 1024, 8192, 0x92fb18f3 +0, 4096, 4096, 1024, 8192, 0x3d5603a2 +0, 5120, 5120, 1024, 8192, 0xcc3d3101 +0, 6144, 6144, 1024, 8192, 0xbcc022ef +0, 7168, 7168, 1024, 8192, 0x600cbb73 +0, 8192, 8192, 1024, 8192, 0xdc938cbb +0, 9216, 9216, 1024, 8192, 0x37d968bc +0, 10240, 10240, 785, 6280, 0x48243144 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-mono-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 481 postsig:223 c: 0.9835 lenerr:704 +presig: 1537 postsig:223 c: 0.9835 lenerr:1760 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he2-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 962 postsig:446 c: 0.9839 lenerr:1408 +presig: 3074 postsig:446 c: 0.9839 lenerr:3520 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-16000-stereo-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 962 postsig:446 c: 0.9895 lenerr:1408 +presig: 3074 postsig:446 c: 0.9895 lenerr:3520 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-mono-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 962 postsig:822 c: 0.9911 lenerr:1784 +presig: 3074 postsig:822 c: 0.9911 lenerr:3896 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he2-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 1924 postsig:1644 c: 0.9909 lenerr:3568 +presig: 6148 postsig:1644 c: 0.9909 lenerr:7792 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-afconvert-44100-stereo-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 1924 postsig:1644 c: 0.9890 lenerr:3568 +presig: 6148 postsig:1644 c: 0.9890 lenerr:7792 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-mono-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: -4 postsig:196 c: 0.9736 lenerr:192 +presig: 2332 postsig:196 c: 0.9736 lenerr:2528 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he2-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 2 postsig:2590 c: 0.9934 lenerr:2592 +presig: 5618 postsig:2590 c: 0.9934 lenerr:8208 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: -8 postsig:392 c: 0.9777 lenerr:384 +presig: 4664 postsig:392 c: 0.9777 lenerr:5056 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-mono-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 0 postsig:1336 c: 0.9973 lenerr:1336 +presig: 2336 postsig:1336 c: 0.9973 lenerr:3672 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he2-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: 2 postsig:782 c: 0.9980 lenerr:784 +presig: 5618 postsig:782 c: 0.9980 lenerr:6400 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -presig: -2 postsig:2674 c: 0.9986 lenerr:2672 +presig: 4670 postsig:2674 c: 0.9986 lenerr:7344 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/autorotate mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/autorotate --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/autorotate 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/autorotate 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -eaeb2b429cadcfd3d0984e2270126564 *tests/data/fate/autorotate.mov +e432aa783e79208a61052f6ced525fff *tests/data/fate/autorotate.mov 197358 tests/data/fate/autorotate.mov #extradata 0: 34, 0x9d7d073f #tb 0: 1/15360 @@ -14,34 +14,34 @@ 0, -512, 0, 512, 6997, 0x55c700f6, S=1, 40 1, -256, -256, 1536, 416, 0x92ddc529, S=2, 10, 4 0, 0, 512, 512, 4847, 0xe74f522e, F=0x0 -1, 1280, 1280, 1536, 418, 0xc96bce7b +1, 1280, 1280, 1536, 418, 0x0a7fcd2d 0, 512, 1024, 512, 5281, 0xbd4a5dac, F=0x0 -1, 2816, 2816, 1536, 418, 0xaeffcf21 +1, 2816, 2816, 1536, 418, 0x6a76ce8f 0, 1024, 1536, 512, 3521, 0x0c07249d, F=0x0 -1, 4352, 4352, 1536, 418, 0xcd37cd04 +1, 4352, 4352, 1536, 418, 0x39e1cb90 0, 1536, 2048, 512, 5128, 0xce8bfa02, F=0x0 0, 2048, 2560, 512, 2759, 0x2369d21d, F=0x0 -1, 5888, 5888, 1536, 418, 0x2f80bc7d +1, 5888, 5888, 1536, 418, 0xa1d4bcc7 0, 2560, 3072, 512, 2057, 0x5d7ea97b, F=0x0 -1, 7424, 7424, 1536, 418, 0xb290c6ea +1, 7424, 7424, 1536, 418, 0x8248c89a 0, 3072, 3584, 512, 2114, 0x91d1f369, F=0x0 -1, 8960, 8960, 1536, 418, 0xa862cc5b +1, 8960, 8960, 1536, 418, 0x1ed9cce9 0, 3584, 4096, 512, 1883, 0x3dd68028, F=0x0 -1, 10496, 10496, 1536, 418, 0xb148cc5e +1, 10496, 10496, 1536, 418, 0xd317ca7d 0, 4096, 4608, 512, 2025, 0xcf3dc34f, F=0x0 -1, 12032, 12032, 1536, 418, 0xcf34cb00 +1, 12032, 12032, 1536, 418, 0xf324ca4a 0, 4608, 5120, 512, 1586, 0x3977edf0, F=0x0 -1, 13568, 13568, 1536, 418, 0x4665c882 +1, 13568, 13568, 1536, 418, 0x6064c948 0, 5120, 5632, 512, 1633, 0x64c5e315, F=0x0 -1, 15104, 15104, 1536, 418, 0x8e4fc865 +1, 15104, 15104, 1536, 418, 0xef7bca02 0, 5632, 6144, 512, 3894, 0x32306d8d -1, 16640, 16640, 1536, 418, 0x80bccbc8 +1, 16640, 16640, 1536, 418, 0x7db4cb0e 0, 6144, 6656, 512, 1490, 0xa541a35a, F=0x0 -1, 18176, 18176, 1536, 418, 0x84eaca12 +1, 18176, 18176, 1536, 418, 0x4e45ccfa 0, 6656, 7168, 512, 1253, 0x7e93302b, F=0x0 -1, 19712, 19712, 1536, 418, 0xc3b6cbd8 +1, 19712, 19712, 1536, 418, 0xc53dca9d 0, 7168, 7680, 512, 1573, 0x58fcd6b2, F=0x0 -1, 21248, 21248, 1536, 418, 0xa345cb53 +1, 21248, 21248, 1536, 418, 0x81eacb49 [STREAM] [SIDE_DATA] side_data_type=CPB properties diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/channel_layout mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/channel_layout --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/channel_layout 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/channel_layout 2023-03-03 13:29:59.000000000 +0000 @@ -24,7 +24,9 @@ 7.1 FL+FR+FC+LFE+BL+BR+SL+SR 7.1(wide) FL+FR+FC+LFE+BL+BR+FLC+FRC 7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR +7.1(top) FL+FR+FC+LFE+BL+BR+TFL+TFR octagonal FL+FR+FC+BL+BR+BC+SL+SR +cube FL+FR+BL+BR+TFL+TFR+TBL+TBR hexadecagonal FL+FR+FC+BL+BR+BC+SL+SR+TFL+TFC+TFR+TBL+TBC+TBR+WL+WR downmix DL+DR 22.2 FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -d367d7f6df7292cbf454c6d07fca9b04 *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe +239286d6a802d8629bec9ab0d2b37d41 *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -1fac6962d4c5f1070d0d2db5ab7d86aa *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe +9583eaa1d52e977c75da2ab3f14225c8 *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf 2023-03-03 13:29:59.000000000 +0000 @@ -1,103 +1,103 @@ -video|0|0|0.000000|-1|-0.040000|1|0.040000|24801|7168|K_ -audio|1|0|0.000000|0|0.000000|1920|0.040000|3840|32256|K_ -video|0|3|0.120000|0|0.000000|1|0.040000|16743|36864|__ -audio|1|1920|0.040000|1920|0.040000|1920|0.040000|3840|53760|K_ -video|0|1|0.040000|1|0.040000|1|0.040000|13812|58368|__ -audio|1|3840|0.080000|3840|0.080000|1920|0.040000|3840|72704|K_ -video|0|2|0.080000|2|0.080000|1|0.040000|13607|77312|__ -audio|1|5760|0.120000|5760|0.120000|1920|0.040000|3840|91136|K_ -video|0|6|0.240000|3|0.120000|1|0.040000|16158|95744|__ -audio|1|7680|0.160000|7680|0.160000|1920|0.040000|3840|112128|K_ -video|0|4|0.160000|4|0.160000|1|0.040000|13943|116736|__ -audio|1|9600|0.200000|9600|0.200000|1920|0.040000|3840|131072|K_ -video|0|5|0.200000|5|0.200000|1|0.040000|11223|135680|__ -audio|1|11520|0.240000|11520|0.240000|1920|0.040000|3840|146944|K_ -video|0|9|0.360000|6|0.240000|1|0.040000|20298|151552|__ -audio|1|13440|0.280000|13440|0.280000|1920|0.040000|3840|172032|K_ -video|0|7|0.280000|7|0.280000|1|0.040000|13341|176640|__ -audio|1|15360|0.320000|15360|0.320000|1920|0.040000|3840|190464|K_ -video|0|8|0.320000|8|0.320000|1|0.040000|12362|195072|__ -audio|1|17280|0.360000|17280|0.360000|1920|0.040000|3840|207872|K_ -video|0|12|0.480000|9|0.360000|1|0.040000|24786|212480|K_ -audio|1|19200|0.400000|19200|0.400000|1920|0.040000|3840|237568|K_ -video|0|10|0.400000|10|0.400000|1|0.040000|13377|242176|__ -audio|1|21120|0.440000|21120|0.440000|1920|0.040000|3840|256000|K_ -video|0|11|0.440000|11|0.440000|1|0.040000|15624|260608|__ -audio|1|23040|0.480000|23040|0.480000|1920|0.040000|3840|276480|K_ -video|0|15|0.600000|12|0.480000|1|0.040000|22597|281088|__ -audio|1|24960|0.520000|24960|0.520000|1920|0.040000|3840|304128|K_ -video|0|13|0.520000|13|0.520000|1|0.040000|15028|308736|__ -audio|1|26880|0.560000|26880|0.560000|1920|0.040000|3840|324096|K_ -video|0|14|0.560000|14|0.560000|1|0.040000|14014|328704|__ -audio|1|28800|0.600000|28800|0.600000|1920|0.040000|3840|343040|K_ -video|0|18|0.720000|15|0.600000|1|0.040000|20731|347648|__ -audio|1|30720|0.640000|30720|0.640000|1920|0.040000|3840|368640|K_ -video|0|16|0.640000|16|0.640000|1|0.040000|11946|373248|__ -audio|1|32640|0.680000|32640|0.680000|1920|0.040000|3840|385536|K_ -video|0|17|0.680000|17|0.680000|1|0.040000|14464|390144|__ -audio|1|34560|0.720000|34560|0.720000|1920|0.040000|3840|404992|K_ -video|0|21|0.840000|18|0.720000|1|0.040000|16189|409600|__ -audio|1|36480|0.760000|36480|0.760000|1920|0.040000|3840|425984|K_ -video|0|19|0.760000|19|0.760000|1|0.040000|10524|430592|__ -audio|1|38400|0.800000|38400|0.800000|1920|0.040000|3840|441344|K_ -video|0|20|0.800000|20|0.800000|1|0.040000|10599|445952|__ -audio|1|40320|0.840000|40320|0.840000|1920|0.040000|3840|456704|K_ -video|0|24|0.960000|21|0.840000|1|0.040000|24711|461312|K_ -audio|1|42240|0.880000|42240|0.880000|1920|0.040000|3840|486400|K_ -video|0|22|0.880000|22|0.880000|1|0.040000|10840|491008|__ -audio|1|44160|0.920000|44160|0.920000|1920|0.040000|3840|502272|K_ -video|0|23|0.920000|23|0.920000|1|0.040000|13350|506880|__ -audio|1|46080|0.960000|46080|0.960000|1920|0.040000|3840|520704|K_ -video|0|17|0.680000|14|0.560000|1|0.040000|24786|212480|K_ -audio|1|28800|0.600000|28800|0.600000|1920|0.040000|3840|237568|K_ -video|0|15|0.600000|15|0.600000|1|0.040000|13377|242176|__ -audio|1|30720|0.640000|30720|0.640000|1920|0.040000|3840|256000|K_ -video|0|16|0.640000|16|0.640000|1|0.040000|15624|260608|__ -audio|1|32640|0.680000|32640|0.680000|1920|0.040000|3840|276480|K_ -video|0|20|0.800000|17|0.680000|1|0.040000|22597|281088|__ -audio|1|34560|0.720000|34560|0.720000|1920|0.040000|3840|304128|K_ -video|0|18|0.720000|18|0.720000|1|0.040000|15028|308736|__ -audio|1|36480|0.760000|36480|0.760000|1920|0.040000|3840|324096|K_ -video|0|19|0.760000|19|0.760000|1|0.040000|14014|328704|__ -audio|1|38400|0.800000|38400|0.800000|1920|0.040000|3840|343040|K_ -video|0|23|0.920000|20|0.800000|1|0.040000|20731|347648|__ -audio|1|40320|0.840000|40320|0.840000|1920|0.040000|3840|368640|K_ -video|0|21|0.840000|21|0.840000|1|0.040000|11946|373248|__ -audio|1|42240|0.880000|42240|0.880000|1920|0.040000|3840|385536|K_ -video|0|22|0.880000|22|0.880000|1|0.040000|14464|390144|__ -audio|1|44160|0.920000|44160|0.920000|1920|0.040000|3840|404992|K_ -video|0|26|1.040000|23|0.920000|1|0.040000|16189|409600|__ -audio|1|46080|0.960000|46080|0.960000|1920|0.040000|3840|425984|K_ -video|0|24|0.960000|24|0.960000|1|0.040000|10524|430592|__ -audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|441344|K_ -video|0|25|1.000000|25|1.000000|1|0.040000|10599|445952|__ -audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|456704|K_ -video|0|29|1.160000|26|1.040000|1|0.040000|24711|461312|K_ -audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|486400|K_ -video|0|27|1.080000|27|1.080000|1|0.040000|10840|491008|__ -audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|502272|K_ -video|0|28|1.120000|28|1.120000|1|0.040000|13350|506880|__ -audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|520704|K_ -video|0|25|1.000000|24|0.960000|1|0.040000|24801|7168|K_|1|Strings Metadata -audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|32256|K_|1|Strings Metadata -video|0|28|1.120000|25|1.000000|1|0.040000|16743|36864|__|1|Strings Metadata -audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|53760|K_|1|Strings Metadata -video|0|26|1.040000|26|1.040000|1|0.040000|13812|58368|__|1|Strings Metadata -audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|72704|K_|1|Strings Metadata -video|0|27|1.080000|27|1.080000|1|0.040000|13607|77312|__|1|Strings Metadata -audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|91136|K_|1|Strings Metadata -video|0|31|1.240000|28|1.120000|1|0.040000|16158|95744|__|1|Strings Metadata -audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|112128|K_|1|Strings Metadata -video|0|29|1.160000|29|1.160000|1|0.040000|13943|116736|__|1|Strings Metadata -audio|1|57600|1.200000|57600|1.200000|1920|0.040000|3840|131072|K_|1|Strings Metadata -video|0|30|1.200000|30|1.200000|1|0.040000|11223|135680|__|1|Strings Metadata -audio|1|59520|1.240000|59520|1.240000|1920|0.040000|3840|146944|K_|1|Strings Metadata -video|0|34|1.360000|31|1.240000|1|0.040000|20298|151552|__|1|Strings Metadata -audio|1|61440|1.280000|61440|1.280000|1920|0.040000|3840|172032|K_|1|Strings Metadata -video|0|32|1.280000|32|1.280000|1|0.040000|13341|176640|__|1|Strings Metadata -audio|1|63360|1.320000|63360|1.320000|1920|0.040000|3840|190464|K_|1|Strings Metadata -video|0|33|1.320000|33|1.320000|1|0.040000|12362|195072|__|1|Strings Metadata -audio|1|65280|1.360000|65280|1.360000|1920|0.040000|3840|207872|K_|1|Strings Metadata -video|0|37|1.480000|34|1.360000|1|0.040000|24786|212480|K_|1|Strings Metadata +video|0|0|0.000000|-1|-0.040000|1|0.040000|24801|7168|K__ +audio|1|0|0.000000|0|0.000000|1920|0.040000|3840|32256|K__ +video|0|3|0.120000|0|0.000000|1|0.040000|16743|36864|___ +audio|1|1920|0.040000|1920|0.040000|1920|0.040000|3840|53760|K__ +video|0|1|0.040000|1|0.040000|1|0.040000|13812|58368|___ +audio|1|3840|0.080000|3840|0.080000|1920|0.040000|3840|72704|K__ +video|0|2|0.080000|2|0.080000|1|0.040000|13607|77312|___ +audio|1|5760|0.120000|5760|0.120000|1920|0.040000|3840|91136|K__ +video|0|6|0.240000|3|0.120000|1|0.040000|16158|95744|___ +audio|1|7680|0.160000|7680|0.160000|1920|0.040000|3840|112128|K__ +video|0|4|0.160000|4|0.160000|1|0.040000|13943|116736|___ +audio|1|9600|0.200000|9600|0.200000|1920|0.040000|3840|131072|K__ +video|0|5|0.200000|5|0.200000|1|0.040000|11223|135680|___ +audio|1|11520|0.240000|11520|0.240000|1920|0.040000|3840|146944|K__ +video|0|9|0.360000|6|0.240000|1|0.040000|20298|151552|___ +audio|1|13440|0.280000|13440|0.280000|1920|0.040000|3840|172032|K__ +video|0|7|0.280000|7|0.280000|1|0.040000|13341|176640|___ +audio|1|15360|0.320000|15360|0.320000|1920|0.040000|3840|190464|K__ +video|0|8|0.320000|8|0.320000|1|0.040000|12362|195072|___ +audio|1|17280|0.360000|17280|0.360000|1920|0.040000|3840|207872|K__ +video|0|12|0.480000|9|0.360000|1|0.040000|24786|212480|K__ +audio|1|19200|0.400000|19200|0.400000|1920|0.040000|3840|237568|K__ +video|0|10|0.400000|10|0.400000|1|0.040000|13377|242176|___ +audio|1|21120|0.440000|21120|0.440000|1920|0.040000|3840|256000|K__ +video|0|11|0.440000|11|0.440000|1|0.040000|15624|260608|___ +audio|1|23040|0.480000|23040|0.480000|1920|0.040000|3840|276480|K__ +video|0|15|0.600000|12|0.480000|1|0.040000|22597|281088|___ +audio|1|24960|0.520000|24960|0.520000|1920|0.040000|3840|304128|K__ +video|0|13|0.520000|13|0.520000|1|0.040000|15028|308736|___ +audio|1|26880|0.560000|26880|0.560000|1920|0.040000|3840|324096|K__ +video|0|14|0.560000|14|0.560000|1|0.040000|14014|328704|___ +audio|1|28800|0.600000|28800|0.600000|1920|0.040000|3840|343040|K__ +video|0|18|0.720000|15|0.600000|1|0.040000|20731|347648|___ +audio|1|30720|0.640000|30720|0.640000|1920|0.040000|3840|368640|K__ +video|0|16|0.640000|16|0.640000|1|0.040000|11946|373248|___ +audio|1|32640|0.680000|32640|0.680000|1920|0.040000|3840|385536|K__ +video|0|17|0.680000|17|0.680000|1|0.040000|14464|390144|___ +audio|1|34560|0.720000|34560|0.720000|1920|0.040000|3840|404992|K__ +video|0|21|0.840000|18|0.720000|1|0.040000|16189|409600|___ +audio|1|36480|0.760000|36480|0.760000|1920|0.040000|3840|425984|K__ +video|0|19|0.760000|19|0.760000|1|0.040000|10524|430592|___ +audio|1|38400|0.800000|38400|0.800000|1920|0.040000|3840|441344|K__ +video|0|20|0.800000|20|0.800000|1|0.040000|10599|445952|___ +audio|1|40320|0.840000|40320|0.840000|1920|0.040000|3840|456704|K__ +video|0|24|0.960000|21|0.840000|1|0.040000|24711|461312|K__ +audio|1|42240|0.880000|42240|0.880000|1920|0.040000|3840|486400|K__ +video|0|22|0.880000|22|0.880000|1|0.040000|10840|491008|___ +audio|1|44160|0.920000|44160|0.920000|1920|0.040000|3840|502272|K__ +video|0|23|0.920000|23|0.920000|1|0.040000|13350|506880|___ +audio|1|46080|0.960000|46080|0.960000|1920|0.040000|3840|520704|K__ +video|0|17|0.680000|14|0.560000|1|0.040000|24786|212480|K__ +audio|1|28800|0.600000|28800|0.600000|1920|0.040000|3840|237568|K__ +video|0|15|0.600000|15|0.600000|1|0.040000|13377|242176|___ +audio|1|30720|0.640000|30720|0.640000|1920|0.040000|3840|256000|K__ +video|0|16|0.640000|16|0.640000|1|0.040000|15624|260608|___ +audio|1|32640|0.680000|32640|0.680000|1920|0.040000|3840|276480|K__ +video|0|20|0.800000|17|0.680000|1|0.040000|22597|281088|___ +audio|1|34560|0.720000|34560|0.720000|1920|0.040000|3840|304128|K__ +video|0|18|0.720000|18|0.720000|1|0.040000|15028|308736|___ +audio|1|36480|0.760000|36480|0.760000|1920|0.040000|3840|324096|K__ +video|0|19|0.760000|19|0.760000|1|0.040000|14014|328704|___ +audio|1|38400|0.800000|38400|0.800000|1920|0.040000|3840|343040|K__ +video|0|23|0.920000|20|0.800000|1|0.040000|20731|347648|___ +audio|1|40320|0.840000|40320|0.840000|1920|0.040000|3840|368640|K__ +video|0|21|0.840000|21|0.840000|1|0.040000|11946|373248|___ +audio|1|42240|0.880000|42240|0.880000|1920|0.040000|3840|385536|K__ +video|0|22|0.880000|22|0.880000|1|0.040000|14464|390144|___ +audio|1|44160|0.920000|44160|0.920000|1920|0.040000|3840|404992|K__ +video|0|26|1.040000|23|0.920000|1|0.040000|16189|409600|___ +audio|1|46080|0.960000|46080|0.960000|1920|0.040000|3840|425984|K__ +video|0|24|0.960000|24|0.960000|1|0.040000|10524|430592|___ +audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|441344|K__ +video|0|25|1.000000|25|1.000000|1|0.040000|10599|445952|___ +audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|456704|K__ +video|0|29|1.160000|26|1.040000|1|0.040000|24711|461312|K__ +audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|486400|K__ +video|0|27|1.080000|27|1.080000|1|0.040000|10840|491008|___ +audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|502272|K__ +video|0|28|1.120000|28|1.120000|1|0.040000|13350|506880|___ +audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|520704|K__ +video|0|25|1.000000|24|0.960000|1|0.040000|24801|7168|K__|1|Strings Metadata +audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|32256|K__|1|Strings Metadata +video|0|28|1.120000|25|1.000000|1|0.040000|16743|36864|___|1|Strings Metadata +audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|53760|K__|1|Strings Metadata +video|0|26|1.040000|26|1.040000|1|0.040000|13812|58368|___|1|Strings Metadata +audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|72704|K__|1|Strings Metadata +video|0|27|1.080000|27|1.080000|1|0.040000|13607|77312|___|1|Strings Metadata +audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|91136|K__|1|Strings Metadata +video|0|31|1.240000|28|1.120000|1|0.040000|16158|95744|___|1|Strings Metadata +audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|112128|K__|1|Strings Metadata +video|0|29|1.160000|29|1.160000|1|0.040000|13943|116736|___|1|Strings Metadata +audio|1|57600|1.200000|57600|1.200000|1920|0.040000|3840|131072|K__|1|Strings Metadata +video|0|30|1.200000|30|1.200000|1|0.040000|11223|135680|___|1|Strings Metadata +audio|1|59520|1.240000|59520|1.240000|1920|0.040000|3840|146944|K__|1|Strings Metadata +video|0|34|1.360000|31|1.240000|1|0.040000|20298|151552|___|1|Strings Metadata +audio|1|61440|1.280000|61440|1.280000|1920|0.040000|3840|172032|K__|1|Strings Metadata +video|0|32|1.280000|32|1.280000|1|0.040000|13341|176640|___|1|Strings Metadata +audio|1|63360|1.320000|63360|1.320000|1920|0.040000|3840|190464|K__|1|Strings Metadata +video|0|33|1.320000|33|1.320000|1|0.040000|12362|195072|___|1|Strings Metadata +audio|1|65280|1.360000|65280|1.360000|1920|0.040000|3840|207872|K__|1|Strings Metadata +video|0|37|1.480000|34|1.360000|1|0.040000|24786|212480|K__|1|Strings Metadata 0|mpeg2video|4|video|[0][0][0][0]|0x0000|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/25|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|51|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|0|0|0|49152|-1 -1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|1|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|768000|N/A|N/A|N/A|N/A|50|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 +1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|1|unknown|16|0|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|768000|N/A|N/A|N/A|N/A|50|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 2023-03-03 13:29:59.000000000 +0000 @@ -1,72 +1,72 @@ -video|0|0|0.000000|0|0.000000|1|0.040000|150000|7168|K_ -audio|1|0|0.000000|0|0.000000|1920|0.040000|7680|157696|K_ -video|0|1|0.040000|1|0.040000|1|0.040000|150000|220160|K_ -audio|1|1920|0.040000|1920|0.040000|1920|0.040000|7680|370688|K_ -video|0|2|0.080000|2|0.080000|1|0.040000|150000|433152|K_ -audio|1|3840|0.080000|3840|0.080000|1920|0.040000|7680|583680|K_ -video|0|3|0.120000|3|0.120000|1|0.040000|150000|646144|K_ -audio|1|5760|0.120000|5760|0.120000|1920|0.040000|7680|796672|K_ -video|0|4|0.160000|4|0.160000|1|0.040000|150000|859136|K_ -audio|1|7680|0.160000|7680|0.160000|1920|0.040000|7680|1009664|K_ -video|0|5|0.200000|5|0.200000|1|0.040000|150000|1072128|K_ -audio|1|9600|0.200000|9600|0.200000|1920|0.040000|7680|1222656|K_ -video|0|6|0.240000|6|0.240000|1|0.040000|150000|1285120|K_ -audio|1|11520|0.240000|11520|0.240000|1920|0.040000|7680|1435648|K_ -video|0|7|0.280000|7|0.280000|1|0.040000|150000|1498112|K_ -audio|1|13440|0.280000|13440|0.280000|1920|0.040000|7680|1648640|K_ -video|0|8|0.320000|8|0.320000|1|0.040000|150000|1711104|K_ -audio|1|15360|0.320000|15360|0.320000|1920|0.040000|7680|1861632|K_ -video|0|9|0.360000|9|0.360000|1|0.040000|150000|1924096|K_ -audio|1|17280|0.360000|17280|0.360000|1920|0.040000|7680|2074624|K_ -video|0|10|0.400000|10|0.400000|1|0.040000|150000|2137088|K_ -audio|1|19200|0.400000|19200|0.400000|1920|0.040000|7680|2287616|K_ -video|0|11|0.440000|11|0.440000|1|0.040000|150000|2350080|K_ -audio|1|21120|0.440000|21120|0.440000|1920|0.040000|7680|2500608|K_ -video|0|12|0.480000|12|0.480000|1|0.040000|150000|2563072|K_ -audio|1|23040|0.480000|23040|0.480000|1920|0.040000|7680|2713600|K_ -video|0|13|0.520000|13|0.520000|1|0.040000|150000|2776064|K_ -audio|1|24960|0.520000|24960|0.520000|1920|0.040000|7680|2926592|K_ -video|0|14|0.560000|14|0.560000|1|0.040000|150000|2989056|K_ -audio|1|26880|0.560000|26880|0.560000|1920|0.040000|7680|3139584|K_ -video|0|15|0.600000|15|0.600000|1|0.040000|150000|3202048|K_ -audio|1|28800|0.600000|28800|0.600000|1920|0.040000|7680|3352576|K_ -video|0|16|0.640000|16|0.640000|1|0.040000|150000|3415040|K_ -audio|1|30720|0.640000|30720|0.640000|1920|0.040000|7680|3565568|K_ -video|0|17|0.680000|17|0.680000|1|0.040000|150000|3628032|K_ -audio|1|32640|0.680000|32640|0.680000|1920|0.040000|7680|3778560|K_ -video|0|18|0.720000|18|0.720000|1|0.040000|150000|3841024|K_ -audio|1|34560|0.720000|34560|0.720000|1920|0.040000|7680|3991552|K_ -video|0|19|0.760000|19|0.760000|1|0.040000|150000|4054016|K_ -audio|1|36480|0.760000|36480|0.760000|1920|0.040000|7680|4204544|K_ -video|0|20|0.800000|20|0.800000|1|0.040000|150000|4267008|K_ -audio|1|38400|0.800000|38400|0.800000|1920|0.040000|7680|4417536|K_ -video|0|21|0.840000|21|0.840000|1|0.040000|150000|4480000|K_ -audio|1|40320|0.840000|40320|0.840000|1920|0.040000|7680|4630528|K_ -video|0|22|0.880000|22|0.880000|1|0.040000|150000|4692992|K_ -audio|1|42240|0.880000|42240|0.880000|1920|0.040000|7680|4843520|K_ -video|0|23|0.920000|23|0.920000|1|0.040000|150000|4905984|K_ -audio|1|44160|0.920000|44160|0.920000|1920|0.040000|7680|5056512|K_ -video|0|24|0.960000|24|0.960000|1|0.040000|150000|5118976|K_ -audio|1|46080|0.960000|46080|0.960000|1920|0.040000|7680|5269504|K_ -video|0|25|1.000000|25|1.000000|1|0.040000|150000|4267008|K_ -audio|1|48000|1.000000|48000|1.000000|1920|0.040000|7680|4417536|K_ -video|0|26|1.040000|26|1.040000|1|0.040000|150000|4480000|K_ -audio|1|49920|1.040000|49920|1.040000|1920|0.040000|7680|4630528|K_ -video|0|27|1.080000|27|1.080000|1|0.040000|150000|4692992|K_ -audio|1|51840|1.080000|51840|1.080000|1920|0.040000|7680|4843520|K_ -video|0|28|1.120000|28|1.120000|1|0.040000|150000|4905984|K_ -audio|1|53760|1.120000|53760|1.120000|1920|0.040000|7680|5056512|K_ -video|0|29|1.160000|29|1.160000|1|0.040000|150000|5118976|K_ -audio|1|55680|1.160000|55680|1.160000|1920|0.040000|7680|5269504|K_ -video|0|30|1.200000|30|1.200000|1|0.040000|150000|1072128|K_|1|Strings Metadata -audio|1|57600|1.200000|57600|1.200000|1920|0.040000|7680|1222656|K_|1|Strings Metadata -video|0|31|1.240000|31|1.240000|1|0.040000|150000|1285120|K_|1|Strings Metadata -audio|1|59520|1.240000|59520|1.240000|1920|0.040000|7680|1435648|K_|1|Strings Metadata -video|0|32|1.280000|32|1.280000|1|0.040000|150000|1498112|K_|1|Strings Metadata -audio|1|61440|1.280000|61440|1.280000|1920|0.040000|7680|1648640|K_|1|Strings Metadata -video|0|33|1.320000|33|1.320000|1|0.040000|150000|1711104|K_|1|Strings Metadata -audio|1|63360|1.320000|63360|1.320000|1920|0.040000|7680|1861632|K_|1|Strings Metadata -video|0|34|1.360000|34|1.360000|1|0.040000|150000|1924096|K_|1|Strings Metadata -audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K_|1|Strings Metadata +video|0|0|0.000000|0|0.000000|1|0.040000|150000|7168|K__ +audio|1|0|0.000000|0|0.000000|1920|0.040000|7680|157696|K__ +video|0|1|0.040000|1|0.040000|1|0.040000|150000|220160|K__ +audio|1|1920|0.040000|1920|0.040000|1920|0.040000|7680|370688|K__ +video|0|2|0.080000|2|0.080000|1|0.040000|150000|433152|K__ +audio|1|3840|0.080000|3840|0.080000|1920|0.040000|7680|583680|K__ +video|0|3|0.120000|3|0.120000|1|0.040000|150000|646144|K__ +audio|1|5760|0.120000|5760|0.120000|1920|0.040000|7680|796672|K__ +video|0|4|0.160000|4|0.160000|1|0.040000|150000|859136|K__ +audio|1|7680|0.160000|7680|0.160000|1920|0.040000|7680|1009664|K__ +video|0|5|0.200000|5|0.200000|1|0.040000|150000|1072128|K__ +audio|1|9600|0.200000|9600|0.200000|1920|0.040000|7680|1222656|K__ +video|0|6|0.240000|6|0.240000|1|0.040000|150000|1285120|K__ +audio|1|11520|0.240000|11520|0.240000|1920|0.040000|7680|1435648|K__ +video|0|7|0.280000|7|0.280000|1|0.040000|150000|1498112|K__ +audio|1|13440|0.280000|13440|0.280000|1920|0.040000|7680|1648640|K__ +video|0|8|0.320000|8|0.320000|1|0.040000|150000|1711104|K__ +audio|1|15360|0.320000|15360|0.320000|1920|0.040000|7680|1861632|K__ +video|0|9|0.360000|9|0.360000|1|0.040000|150000|1924096|K__ +audio|1|17280|0.360000|17280|0.360000|1920|0.040000|7680|2074624|K__ +video|0|10|0.400000|10|0.400000|1|0.040000|150000|2137088|K__ +audio|1|19200|0.400000|19200|0.400000|1920|0.040000|7680|2287616|K__ +video|0|11|0.440000|11|0.440000|1|0.040000|150000|2350080|K__ +audio|1|21120|0.440000|21120|0.440000|1920|0.040000|7680|2500608|K__ +video|0|12|0.480000|12|0.480000|1|0.040000|150000|2563072|K__ +audio|1|23040|0.480000|23040|0.480000|1920|0.040000|7680|2713600|K__ +video|0|13|0.520000|13|0.520000|1|0.040000|150000|2776064|K__ +audio|1|24960|0.520000|24960|0.520000|1920|0.040000|7680|2926592|K__ +video|0|14|0.560000|14|0.560000|1|0.040000|150000|2989056|K__ +audio|1|26880|0.560000|26880|0.560000|1920|0.040000|7680|3139584|K__ +video|0|15|0.600000|15|0.600000|1|0.040000|150000|3202048|K__ +audio|1|28800|0.600000|28800|0.600000|1920|0.040000|7680|3352576|K__ +video|0|16|0.640000|16|0.640000|1|0.040000|150000|3415040|K__ +audio|1|30720|0.640000|30720|0.640000|1920|0.040000|7680|3565568|K__ +video|0|17|0.680000|17|0.680000|1|0.040000|150000|3628032|K__ +audio|1|32640|0.680000|32640|0.680000|1920|0.040000|7680|3778560|K__ +video|0|18|0.720000|18|0.720000|1|0.040000|150000|3841024|K__ +audio|1|34560|0.720000|34560|0.720000|1920|0.040000|7680|3991552|K__ +video|0|19|0.760000|19|0.760000|1|0.040000|150000|4054016|K__ +audio|1|36480|0.760000|36480|0.760000|1920|0.040000|7680|4204544|K__ +video|0|20|0.800000|20|0.800000|1|0.040000|150000|4267008|K__ +audio|1|38400|0.800000|38400|0.800000|1920|0.040000|7680|4417536|K__ +video|0|21|0.840000|21|0.840000|1|0.040000|150000|4480000|K__ +audio|1|40320|0.840000|40320|0.840000|1920|0.040000|7680|4630528|K__ +video|0|22|0.880000|22|0.880000|1|0.040000|150000|4692992|K__ +audio|1|42240|0.880000|42240|0.880000|1920|0.040000|7680|4843520|K__ +video|0|23|0.920000|23|0.920000|1|0.040000|150000|4905984|K__ +audio|1|44160|0.920000|44160|0.920000|1920|0.040000|7680|5056512|K__ +video|0|24|0.960000|24|0.960000|1|0.040000|150000|5118976|K__ +audio|1|46080|0.960000|46080|0.960000|1920|0.040000|7680|5269504|K__ +video|0|25|1.000000|25|1.000000|1|0.040000|150000|4267008|K__ +audio|1|48000|1.000000|48000|1.000000|1920|0.040000|7680|4417536|K__ +video|0|26|1.040000|26|1.040000|1|0.040000|150000|4480000|K__ +audio|1|49920|1.040000|49920|1.040000|1920|0.040000|7680|4630528|K__ +video|0|27|1.080000|27|1.080000|1|0.040000|150000|4692992|K__ +audio|1|51840|1.080000|51840|1.080000|1920|0.040000|7680|4843520|K__ +video|0|28|1.120000|28|1.120000|1|0.040000|150000|4905984|K__ +audio|1|53760|1.120000|53760|1.120000|1920|0.040000|7680|5056512|K__ +video|0|29|1.160000|29|1.160000|1|0.040000|150000|5118976|K__ +audio|1|55680|1.160000|55680|1.160000|1920|0.040000|7680|5269504|K__ +video|0|30|1.200000|30|1.200000|1|0.040000|150000|1072128|K__|1|Strings Metadata +audio|1|57600|1.200000|57600|1.200000|1920|0.040000|7680|1222656|K__|1|Strings Metadata +video|0|31|1.240000|31|1.240000|1|0.040000|150000|1285120|K__|1|Strings Metadata +audio|1|59520|1.240000|59520|1.240000|1920|0.040000|7680|1435648|K__|1|Strings Metadata +video|0|32|1.280000|32|1.280000|1|0.040000|150000|1498112|K__|1|Strings Metadata +audio|1|61440|1.280000|61440|1.280000|1920|0.040000|7680|1648640|K__|1|Strings Metadata +video|0|33|1.320000|33|1.320000|1|0.040000|150000|1711104|K__|1|Strings Metadata +audio|1|63360|1.320000|63360|1.320000|1920|0.040000|7680|1861632|K__|1|Strings Metadata +video|0|34|1.360000|34|1.360000|1|0.040000|150000|1924096|K__|1|Strings Metadata +audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K__|1|Strings Metadata 0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tb|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|30000000|0|0|1212416|-1 -1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|2|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|1536000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 +1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|2|unknown|16|0|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|1536000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple2-lavf-ts mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple2-lavf-ts --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple2-lavf-ts 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/concat-demuxer-simple2-lavf-ts 2023-03-03 13:29:59.000000000 +0000 @@ -1,215 +1,215 @@ -video|1|982|0.010911|-2618|-0.029089|3600|0.040000|24801|564|K_|MPEGTS Stream ID|224 +video|1|982|0.010911|-2618|-0.029089|3600|0.040000|24801|564|K__|MPEGTS Stream ID|224 -video|1|4582|0.050911|982|0.010911|3600|0.040000|16429|25944|__|MPEGTS Stream ID|224 +video|1|4582|0.050911|982|0.010911|3600|0.040000|16429|25944|___|MPEGTS Stream ID|224 -video|1|8182|0.090911|4582|0.050911|3600|0.040000|14508|42864|__|MPEGTS Stream ID|224 +video|1|8182|0.090911|4582|0.050911|3600|0.040000|14508|42864|___|MPEGTS Stream ID|224 -video|1|11782|0.130911|8182|0.090911|3600|0.040000|12622|58092|__|MPEGTS Stream ID|224 +video|1|11782|0.130911|8182|0.090911|3600|0.040000|12622|58092|___|MPEGTS Stream ID|224 -video|1|15382|0.170911|11782|0.130911|3600|0.040000|13393|71064|__|MPEGTS Stream ID|224 +video|1|15382|0.170911|11782|0.130911|3600|0.040000|13393|71064|___|MPEGTS Stream ID|224 -video|1|18982|0.210911|15382|0.170911|3600|0.040000|13092|84788|__|MPEGTS Stream ID|224 +video|1|18982|0.210911|15382|0.170911|3600|0.040000|13092|84788|___|MPEGTS Stream ID|224 -video|1|22582|0.250911|18982|0.210911|3600|0.040000|12755|98700|__|MPEGTS Stream ID|224 +video|1|22582|0.250911|18982|0.210911|3600|0.040000|12755|98700|___|MPEGTS Stream ID|224 -video|1|26182|0.290911|22582|0.250911|3600|0.040000|12023|111860|__|MPEGTS Stream ID|224 +video|1|26182|0.290911|22582|0.250911|3600|0.040000|12023|111860|___|MPEGTS Stream ID|224 -audio|0|0|0.000000|0|0.000000|2351|0.026122|208|152844|K_|MPEGTS Stream ID|192 +audio|0|0|0.000000|0|0.000000|2351|0.026122|208|152844|K__|MPEGTS Stream ID|192 -audio|0|2351|0.026122|2351|0.026122|2351|0.026122|209|N/A|K_ -audio|0|4702|0.052244|4702|0.052244|2351|0.026122|209|N/A|K_ -audio|0|7053|0.078367|7053|0.078367|2351|0.026122|209|N/A|K_ -audio|0|9404|0.104489|9404|0.104489|2351|0.026122|209|N/A|K_ -audio|0|11755|0.130611|11755|0.130611|2351|0.026122|209|N/A|K_ -audio|0|14106|0.156733|14106|0.156733|2351|0.026122|209|N/A|K_ -audio|0|16457|0.182856|16457|0.182856|2351|0.026122|209|N/A|K_ -audio|0|18808|0.208978|18808|0.208978|2351|0.026122|209|N/A|K_ -audio|0|21159|0.235100|21159|0.235100|2351|0.026122|209|N/A|K_ -audio|0|23510|0.261222|23510|0.261222|2351|0.026122|209|N/A|K_ -audio|0|25861|0.287344|25861|0.287344|2351|0.026122|209|N/A|K_ -audio|0|28212|0.313467|28212|0.313467|2351|0.026122|209|N/A|K_ -audio|0|30563|0.339589|30563|0.339589|2351|0.026122|209|N/A|K_ -video|1|29782|0.330911|26182|0.290911|3600|0.040000|14098|124268|__|MPEGTS Stream ID|224 +audio|0|2351|0.026122|2351|0.026122|2351|0.026122|209|N/A|K__ +audio|0|4702|0.052244|4702|0.052244|2351|0.026122|209|N/A|K__ +audio|0|7053|0.078367|7053|0.078367|2351|0.026122|209|N/A|K__ +audio|0|9404|0.104489|9404|0.104489|2351|0.026122|209|N/A|K__ +audio|0|11755|0.130611|11755|0.130611|2351|0.026122|209|N/A|K__ +audio|0|14106|0.156733|14106|0.156733|2351|0.026122|209|N/A|K__ +audio|0|16457|0.182856|16457|0.182856|2351|0.026122|209|N/A|K__ +audio|0|18808|0.208978|18808|0.208978|2351|0.026122|209|N/A|K__ +audio|0|21159|0.235100|21159|0.235100|2351|0.026122|209|N/A|K__ +audio|0|23510|0.261222|23510|0.261222|2351|0.026122|209|N/A|K__ +audio|0|25861|0.287344|25861|0.287344|2351|0.026122|209|N/A|K__ +audio|0|28212|0.313467|28212|0.313467|2351|0.026122|209|N/A|K__ +audio|0|30563|0.339589|30563|0.339589|2351|0.026122|209|N/A|K__ +video|1|29782|0.330911|26182|0.290911|3600|0.040000|14098|124268|___|MPEGTS Stream ID|224 -video|1|33382|0.370911|29782|0.330911|3600|0.040000|13329|139120|__|MPEGTS Stream ID|224 +video|1|33382|0.370911|29782|0.330911|3600|0.040000|13329|139120|___|MPEGTS Stream ID|224 -video|1|36982|0.410911|33382|0.370911|3600|0.040000|12135|155852|__|MPEGTS Stream ID|224 +video|1|36982|0.410911|33382|0.370911|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224 -video|1|40582|0.450911|36982|0.410911|3600|0.040000|12282|168448|__|MPEGTS Stream ID|224 +video|1|40582|0.450911|36982|0.410911|3600|0.040000|12282|168448|___|MPEGTS Stream ID|224 -video|1|44182|0.490911|40582|0.450911|3600|0.040000|24786|181420|K_|MPEGTS Stream ID|224 +video|1|44182|0.490911|40582|0.450911|3600|0.040000|24786|181420|K__|MPEGTS Stream ID|224 -video|1|47782|0.530911|44182|0.490911|3600|0.040000|17440|206988|__|MPEGTS Stream ID|224 +video|1|47782|0.530911|44182|0.490911|3600|0.040000|17440|206988|___|MPEGTS Stream ID|224 -video|1|51382|0.570911|47782|0.530911|3600|0.040000|15019|224848|__|MPEGTS Stream ID|224 +video|1|51382|0.570911|47782|0.530911|3600|0.040000|15019|224848|___|MPEGTS Stream ID|224 -video|1|54982|0.610911|51382|0.570911|3600|0.040000|13449|240640|__|MPEGTS Stream ID|224 +video|1|54982|0.610911|51382|0.570911|3600|0.040000|13449|240640|___|MPEGTS Stream ID|224 -video|1|58582|0.650911|54982|0.610911|3600|0.040000|12398|254552|__|MPEGTS Stream ID|224 +video|1|58582|0.650911|54982|0.610911|3600|0.040000|12398|254552|___|MPEGTS Stream ID|224 -video|1|62182|0.690911|58582|0.650911|3600|0.040000|13455|267336|__|MPEGTS Stream ID|224 +video|1|62182|0.690911|58582|0.650911|3600|0.040000|13455|267336|___|MPEGTS Stream ID|224 -audio|0|32915|0.365722|32915|0.365722|2351|0.026122|209|308508|K_|MPEGTS Stream ID|192 +audio|0|32915|0.365722|32915|0.365722|2351|0.026122|209|308508|K__|MPEGTS Stream ID|192 -audio|0|35266|0.391844|35266|0.391844|2351|0.026122|209|N/A|K_ -audio|0|37617|0.417967|37617|0.417967|2351|0.026122|209|N/A|K_ -audio|0|39968|0.444089|39968|0.444089|2351|0.026122|209|N/A|K_ -audio|0|42319|0.470211|42319|0.470211|2351|0.026122|209|N/A|K_ -audio|0|44670|0.496333|44670|0.496333|2351|0.026122|209|N/A|K_ -audio|0|47021|0.522456|47021|0.522456|2351|0.026122|209|N/A|K_ -audio|0|49372|0.548578|49372|0.548578|2351|0.026122|209|N/A|K_ -audio|0|51723|0.574700|51723|0.574700|2351|0.026122|209|N/A|K_ -audio|0|54074|0.600822|54074|0.600822|2351|0.026122|209|N/A|K_ -audio|0|56425|0.626944|56425|0.626944|2351|0.026122|209|N/A|K_ -audio|0|58776|0.653067|58776|0.653067|2351|0.026122|209|N/A|K_ -audio|0|61127|0.679189|61127|0.679189|2351|0.026122|209|N/A|K_ -audio|0|63478|0.705311|63478|0.705311|2351|0.026122|209|N/A|K_ -video|1|65782|0.730911|62182|0.690911|3600|0.040000|13836|281624|__|MPEGTS Stream ID|224 +audio|0|35266|0.391844|35266|0.391844|2351|0.026122|209|N/A|K__ +audio|0|37617|0.417967|37617|0.417967|2351|0.026122|209|N/A|K__ +audio|0|39968|0.444089|39968|0.444089|2351|0.026122|209|N/A|K__ +audio|0|42319|0.470211|42319|0.470211|2351|0.026122|209|N/A|K__ +audio|0|44670|0.496333|44670|0.496333|2351|0.026122|209|N/A|K__ +audio|0|47021|0.522456|47021|0.522456|2351|0.026122|209|N/A|K__ +audio|0|49372|0.548578|49372|0.548578|2351|0.026122|209|N/A|K__ +audio|0|51723|0.574700|51723|0.574700|2351|0.026122|209|N/A|K__ +audio|0|54074|0.600822|54074|0.600822|2351|0.026122|209|N/A|K__ +audio|0|56425|0.626944|56425|0.626944|2351|0.026122|209|N/A|K__ +audio|0|58776|0.653067|58776|0.653067|2351|0.026122|209|N/A|K__ +audio|0|61127|0.679189|61127|0.679189|2351|0.026122|209|N/A|K__ +audio|0|63478|0.705311|63478|0.705311|2351|0.026122|209|N/A|K__ +video|1|65782|0.730911|62182|0.690911|3600|0.040000|13836|281624|___|MPEGTS Stream ID|224 -video|1|69382|0.770911|65782|0.730911|3600|0.040000|12163|295912|__|MPEGTS Stream ID|224 +video|1|69382|0.770911|65782|0.730911|3600|0.040000|12163|295912|___|MPEGTS Stream ID|224 -video|1|72982|0.810911|69382|0.770911|3600|0.040000|12692|311516|__|MPEGTS Stream ID|224 +video|1|72982|0.810911|69382|0.770911|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224 -video|1|76582|0.850911|72982|0.810911|3600|0.040000|10824|325052|__|MPEGTS Stream ID|224 +video|1|76582|0.850911|72982|0.810911|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224 -video|1|80182|0.890911|76582|0.850911|3600|0.040000|11286|336144|__|MPEGTS Stream ID|224 +video|1|80182|0.890911|76582|0.850911|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224 -audio|0|65829|0.731433|65829|0.731433|2351|0.026122|209|386716|K_|MPEGTS Stream ID|192 +audio|0|65829|0.731433|65829|0.731433|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192 -audio|0|68180|0.757556|68180|0.757556|2351|0.026122|209|N/A|K_ -audio|0|70531|0.783678|70531|0.783678|2351|0.026122|209|N/A|K_ -audio|0|72882|0.809800|72882|0.809800|2351|0.026122|209|N/A|K_ -audio|0|75233|0.835922|75233|0.835922|2351|0.026122|209|N/A|K_ -audio|0|77584|0.862044|77584|0.862044|2351|0.026122|209|N/A|K_ -audio|0|79935|0.888167|79935|0.888167|2351|0.026122|209|N/A|K_ -audio|0|82286|0.914289|82286|0.914289|2351|0.026122|209|N/A|K_ -audio|0|84637|0.940411|84637|0.940411|2351|0.026122|209|N/A|K_ -audio|0|86988|0.966533|86988|0.966533|2351|0.026122|209|N/A|K_ -audio|0|89339|0.992656|89339|0.992656|2351|0.026122|209|N/A|K_ -video|1|83782|0.930911|80182|0.890911|3600|0.040000|12678|347800|__|MPEGTS Stream ID|224 +audio|0|68180|0.757556|68180|0.757556|2351|0.026122|209|N/A|K__ +audio|0|70531|0.783678|70531|0.783678|2351|0.026122|209|N/A|K__ +audio|0|72882|0.809800|72882|0.809800|2351|0.026122|209|N/A|K__ +audio|0|75233|0.835922|75233|0.835922|2351|0.026122|209|N/A|K__ +audio|0|77584|0.862044|77584|0.862044|2351|0.026122|209|N/A|K__ +audio|0|79935|0.888167|79935|0.888167|2351|0.026122|209|N/A|K__ +audio|0|82286|0.914289|82286|0.914289|2351|0.026122|209|N/A|K__ +audio|0|84637|0.940411|84637|0.940411|2351|0.026122|209|N/A|K__ +audio|0|86988|0.966533|86988|0.966533|2351|0.026122|209|N/A|K__ +audio|0|89339|0.992656|89339|0.992656|2351|0.026122|209|N/A|K__ +video|1|83782|0.930911|80182|0.890911|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224 -video|1|87382|0.970911|83782|0.930911|3600|0.040000|24711|361336|K_ -video|1|91964|1.021822|88364|0.981822|3600|0.040000|24801|564|K_|MPEGTS Stream ID|224 +video|1|87382|0.970911|83782|0.930911|3600|0.040000|24711|361336|K__ +video|1|91964|1.021822|88364|0.981822|3600|0.040000|24801|564|K__|MPEGTS Stream ID|224 -video|1|95564|1.061822|91964|1.021822|3600|0.040000|16429|25944|__|MPEGTS Stream ID|224 +video|1|95564|1.061822|91964|1.021822|3600|0.040000|16429|25944|___|MPEGTS Stream ID|224 -video|1|99164|1.101822|95564|1.061822|3600|0.040000|14508|42864|__|MPEGTS Stream ID|224 +video|1|99164|1.101822|95564|1.061822|3600|0.040000|14508|42864|___|MPEGTS Stream ID|224 -video|1|102764|1.141822|99164|1.101822|3600|0.040000|12622|58092|__|MPEGTS Stream ID|224 +video|1|102764|1.141822|99164|1.101822|3600|0.040000|12622|58092|___|MPEGTS Stream ID|224 -video|1|106364|1.181822|102764|1.141822|3600|0.040000|13393|71064|__|MPEGTS Stream ID|224 +video|1|106364|1.181822|102764|1.141822|3600|0.040000|13393|71064|___|MPEGTS Stream ID|224 -video|1|109964|1.221822|106364|1.181822|3600|0.040000|13092|84788|__|MPEGTS Stream ID|224 +video|1|109964|1.221822|106364|1.181822|3600|0.040000|13092|84788|___|MPEGTS Stream ID|224 -video|1|113564|1.261822|109964|1.221822|3600|0.040000|12755|98700|__|MPEGTS Stream ID|224 +video|1|113564|1.261822|109964|1.221822|3600|0.040000|12755|98700|___|MPEGTS Stream ID|224 -video|1|117164|1.301822|113564|1.261822|3600|0.040000|12023|111860|__|MPEGTS Stream ID|224 +video|1|117164|1.301822|113564|1.261822|3600|0.040000|12023|111860|___|MPEGTS Stream ID|224 -audio|0|90982|1.010911|90982|1.010911|2351|0.026122|208|152844|K_|MPEGTS Stream ID|192 +audio|0|90982|1.010911|90982|1.010911|2351|0.026122|208|152844|K__|MPEGTS Stream ID|192 -audio|0|93333|1.037033|93333|1.037033|2351|0.026122|209|N/A|K_ -audio|0|95684|1.063156|95684|1.063156|2351|0.026122|209|N/A|K_ -audio|0|98035|1.089278|98035|1.089278|2351|0.026122|209|N/A|K_ -audio|0|100386|1.115400|100386|1.115400|2351|0.026122|209|N/A|K_ -audio|0|102737|1.141522|102737|1.141522|2351|0.026122|209|N/A|K_ -audio|0|105088|1.167644|105088|1.167644|2351|0.026122|209|N/A|K_ -audio|0|107439|1.193767|107439|1.193767|2351|0.026122|209|N/A|K_ -audio|0|109790|1.219889|109790|1.219889|2351|0.026122|209|N/A|K_ -audio|0|112141|1.246011|112141|1.246011|2351|0.026122|209|N/A|K_ -audio|0|114492|1.272133|114492|1.272133|2351|0.026122|209|N/A|K_ -audio|0|116843|1.298256|116843|1.298256|2351|0.026122|209|N/A|K_ -audio|0|119194|1.324378|119194|1.324378|2351|0.026122|209|N/A|K_ -audio|0|121545|1.350500|121545|1.350500|2351|0.026122|209|N/A|K_ -video|1|120764|1.341822|117164|1.301822|3600|0.040000|14098|124268|__|MPEGTS Stream ID|224 +audio|0|93333|1.037033|93333|1.037033|2351|0.026122|209|N/A|K__ +audio|0|95684|1.063156|95684|1.063156|2351|0.026122|209|N/A|K__ +audio|0|98035|1.089278|98035|1.089278|2351|0.026122|209|N/A|K__ +audio|0|100386|1.115400|100386|1.115400|2351|0.026122|209|N/A|K__ +audio|0|102737|1.141522|102737|1.141522|2351|0.026122|209|N/A|K__ +audio|0|105088|1.167644|105088|1.167644|2351|0.026122|209|N/A|K__ +audio|0|107439|1.193767|107439|1.193767|2351|0.026122|209|N/A|K__ +audio|0|109790|1.219889|109790|1.219889|2351|0.026122|209|N/A|K__ +audio|0|112141|1.246011|112141|1.246011|2351|0.026122|209|N/A|K__ +audio|0|114492|1.272133|114492|1.272133|2351|0.026122|209|N/A|K__ +audio|0|116843|1.298256|116843|1.298256|2351|0.026122|209|N/A|K__ +audio|0|119194|1.324378|119194|1.324378|2351|0.026122|209|N/A|K__ +audio|0|121545|1.350500|121545|1.350500|2351|0.026122|209|N/A|K__ +video|1|120764|1.341822|117164|1.301822|3600|0.040000|14098|124268|___|MPEGTS Stream ID|224 -video|1|124364|1.381822|120764|1.341822|3600|0.040000|13329|139120|__|MPEGTS Stream ID|224 +video|1|124364|1.381822|120764|1.341822|3600|0.040000|13329|139120|___|MPEGTS Stream ID|224 -video|1|127964|1.421822|124364|1.381822|3600|0.040000|12135|155852|__|MPEGTS Stream ID|224 +video|1|127964|1.421822|124364|1.381822|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224 -video|1|131564|1.461822|127964|1.421822|3600|0.040000|12282|168448|__|MPEGTS Stream ID|224 +video|1|131564|1.461822|127964|1.421822|3600|0.040000|12282|168448|___|MPEGTS Stream ID|224 -video|1|135164|1.501822|131564|1.461822|3600|0.040000|24786|181420|K_|MPEGTS Stream ID|224 +video|1|135164|1.501822|131564|1.461822|3600|0.040000|24786|181420|K__|MPEGTS Stream ID|224 -video|1|138764|1.541822|135164|1.501822|3600|0.040000|17440|206988|__|MPEGTS Stream ID|224 +video|1|138764|1.541822|135164|1.501822|3600|0.040000|17440|206988|___|MPEGTS Stream ID|224 -video|1|142364|1.581822|138764|1.541822|3600|0.040000|15019|224848|__|MPEGTS Stream ID|224 +video|1|142364|1.581822|138764|1.541822|3600|0.040000|15019|224848|___|MPEGTS Stream ID|224 -video|1|145964|1.621822|142364|1.581822|3600|0.040000|13449|240640|__|MPEGTS Stream ID|224 +video|1|145964|1.621822|142364|1.581822|3600|0.040000|13449|240640|___|MPEGTS Stream ID|224 -video|1|149564|1.661822|145964|1.621822|3600|0.040000|12398|254552|__|MPEGTS Stream ID|224 +video|1|149564|1.661822|145964|1.621822|3600|0.040000|12398|254552|___|MPEGTS Stream ID|224 -video|1|153164|1.701822|149564|1.661822|3600|0.040000|13455|267336|__|MPEGTS Stream ID|224 +video|1|153164|1.701822|149564|1.661822|3600|0.040000|13455|267336|___|MPEGTS Stream ID|224 -audio|0|123897|1.376633|123897|1.376633|2351|0.026122|209|308508|K_|MPEGTS Stream ID|192 +audio|0|123897|1.376633|123897|1.376633|2351|0.026122|209|308508|K__|MPEGTS Stream ID|192 -audio|0|126248|1.402756|126248|1.402756|2351|0.026122|209|N/A|K_ -audio|0|128599|1.428878|128599|1.428878|2351|0.026122|209|N/A|K_ -audio|0|130950|1.455000|130950|1.455000|2351|0.026122|209|N/A|K_ -audio|0|133301|1.481122|133301|1.481122|2351|0.026122|209|N/A|K_ -audio|0|135652|1.507244|135652|1.507244|2351|0.026122|209|N/A|K_ -audio|0|138003|1.533367|138003|1.533367|2351|0.026122|209|N/A|K_ -audio|0|140354|1.559489|140354|1.559489|2351|0.026122|209|N/A|K_ -audio|0|142705|1.585611|142705|1.585611|2351|0.026122|209|N/A|K_ -audio|0|145056|1.611733|145056|1.611733|2351|0.026122|209|N/A|K_ -audio|0|147407|1.637856|147407|1.637856|2351|0.026122|209|N/A|K_ -audio|0|149758|1.663978|149758|1.663978|2351|0.026122|209|N/A|K_ -audio|0|152109|1.690100|152109|1.690100|2351|0.026122|209|N/A|K_ -audio|0|154460|1.716222|154460|1.716222|2351|0.026122|209|N/A|K_ -video|1|156764|1.741822|153164|1.701822|3600|0.040000|13836|281624|__|MPEGTS Stream ID|224 +audio|0|126248|1.402756|126248|1.402756|2351|0.026122|209|N/A|K__ +audio|0|128599|1.428878|128599|1.428878|2351|0.026122|209|N/A|K__ +audio|0|130950|1.455000|130950|1.455000|2351|0.026122|209|N/A|K__ +audio|0|133301|1.481122|133301|1.481122|2351|0.026122|209|N/A|K__ +audio|0|135652|1.507244|135652|1.507244|2351|0.026122|209|N/A|K__ +audio|0|138003|1.533367|138003|1.533367|2351|0.026122|209|N/A|K__ +audio|0|140354|1.559489|140354|1.559489|2351|0.026122|209|N/A|K__ +audio|0|142705|1.585611|142705|1.585611|2351|0.026122|209|N/A|K__ +audio|0|145056|1.611733|145056|1.611733|2351|0.026122|209|N/A|K__ +audio|0|147407|1.637856|147407|1.637856|2351|0.026122|209|N/A|K__ +audio|0|149758|1.663978|149758|1.663978|2351|0.026122|209|N/A|K__ +audio|0|152109|1.690100|152109|1.690100|2351|0.026122|209|N/A|K__ +audio|0|154460|1.716222|154460|1.716222|2351|0.026122|209|N/A|K__ +video|1|156764|1.741822|153164|1.701822|3600|0.040000|13836|281624|___|MPEGTS Stream ID|224 -video|1|160364|1.781822|156764|1.741822|3600|0.040000|12163|295912|__|MPEGTS Stream ID|224 +video|1|160364|1.781822|156764|1.741822|3600|0.040000|12163|295912|___|MPEGTS Stream ID|224 -video|1|163964|1.821822|160364|1.781822|3600|0.040000|12692|311516|__|MPEGTS Stream ID|224 +video|1|163964|1.821822|160364|1.781822|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224 -video|1|167564|1.861822|163964|1.821822|3600|0.040000|10824|325052|__|MPEGTS Stream ID|224 +video|1|167564|1.861822|163964|1.821822|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224 -video|1|171164|1.901822|167564|1.861822|3600|0.040000|11286|336144|__|MPEGTS Stream ID|224 +video|1|171164|1.901822|167564|1.861822|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224 -audio|0|156811|1.742344|156811|1.742344|2351|0.026122|209|386716|K_|MPEGTS Stream ID|192 +audio|0|156811|1.742344|156811|1.742344|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192 -audio|0|159162|1.768467|159162|1.768467|2351|0.026122|209|N/A|K_ -audio|0|161513|1.794589|161513|1.794589|2351|0.026122|209|N/A|K_ -audio|0|163864|1.820711|163864|1.820711|2351|0.026122|209|N/A|K_ -audio|0|166215|1.846833|166215|1.846833|2351|0.026122|209|N/A|K_ -audio|0|168566|1.872956|168566|1.872956|2351|0.026122|209|N/A|K_ -audio|0|170917|1.899078|170917|1.899078|2351|0.026122|209|N/A|K_ -audio|0|173268|1.925200|173268|1.925200|2351|0.026122|209|N/A|K_ -audio|0|175619|1.951322|175619|1.951322|2351|0.026122|209|N/A|K_ -audio|0|177970|1.977444|177970|1.977444|2351|0.026122|209|N/A|K_ -audio|0|180321|2.003567|180321|2.003567|2351|0.026122|209|N/A|K_ -video|1|174764|1.941822|171164|1.901822|3600|0.040000|12678|347800|__|MPEGTS Stream ID|224 +audio|0|159162|1.768467|159162|1.768467|2351|0.026122|209|N/A|K__ +audio|0|161513|1.794589|161513|1.794589|2351|0.026122|209|N/A|K__ +audio|0|163864|1.820711|163864|1.820711|2351|0.026122|209|N/A|K__ +audio|0|166215|1.846833|166215|1.846833|2351|0.026122|209|N/A|K__ +audio|0|168566|1.872956|168566|1.872956|2351|0.026122|209|N/A|K__ +audio|0|170917|1.899078|170917|1.899078|2351|0.026122|209|N/A|K__ +audio|0|173268|1.925200|173268|1.925200|2351|0.026122|209|N/A|K__ +audio|0|175619|1.951322|175619|1.951322|2351|0.026122|209|N/A|K__ +audio|0|177970|1.977444|177970|1.977444|2351|0.026122|209|N/A|K__ +audio|0|180321|2.003567|180321|2.003567|2351|0.026122|209|N/A|K__ +video|1|174764|1.941822|171164|1.901822|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224 -video|1|178364|1.981822|174764|1.941822|3600|0.040000|24711|361336|K_ -video|1|139582|1.550911|135982|1.510911|3600|0.040000|12692|311516|__|MPEGTS Stream ID|224 +video|1|178364|1.981822|174764|1.941822|3600|0.040000|24711|361336|K__ +video|1|139582|1.550911|135982|1.510911|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224 -video|1|143182|1.590911|139582|1.550911|3600|0.040000|10824|325052|__|MPEGTS Stream ID|224 +video|1|143182|1.590911|139582|1.550911|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224 -video|1|146782|1.630911|143182|1.590911|3600|0.040000|11286|336144|__|MPEGTS Stream ID|224 +video|1|146782|1.630911|143182|1.590911|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224 -audio|0|132429|1.471433|132429|1.471433|2351|0.026122|209|386716|K_|MPEGTS Stream ID|192 +audio|0|132429|1.471433|132429|1.471433|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192 -audio|0|134780|1.497556|134780|1.497556|2351|0.026122|209|N/A|K_ -audio|0|137131|1.523678|137131|1.523678|2351|0.026122|209|N/A|K_ -audio|0|139482|1.549800|139482|1.549800|2351|0.026122|209|N/A|K_ -audio|0|141833|1.575922|141833|1.575922|2351|0.026122|209|N/A|K_ -audio|0|144184|1.602044|144184|1.602044|2351|0.026122|209|N/A|K_ -audio|0|146535|1.628167|146535|1.628167|2351|0.026122|209|N/A|K_ -audio|0|148886|1.654289|148886|1.654289|2351|0.026122|209|N/A|K_ -audio|0|151237|1.680411|151237|1.680411|2351|0.026122|209|N/A|K_ -audio|0|153588|1.706533|153588|1.706533|2351|0.026122|209|N/A|K_ -audio|0|155939|1.732656|155939|1.732656|2351|0.026122|209|N/A|K_ -video|1|150382|1.670911|146782|1.630911|3600|0.040000|12678|347800|__|MPEGTS Stream ID|224 +audio|0|134780|1.497556|134780|1.497556|2351|0.026122|209|N/A|K__ +audio|0|137131|1.523678|137131|1.523678|2351|0.026122|209|N/A|K__ +audio|0|139482|1.549800|139482|1.549800|2351|0.026122|209|N/A|K__ +audio|0|141833|1.575922|141833|1.575922|2351|0.026122|209|N/A|K__ +audio|0|144184|1.602044|144184|1.602044|2351|0.026122|209|N/A|K__ +audio|0|146535|1.628167|146535|1.628167|2351|0.026122|209|N/A|K__ +audio|0|148886|1.654289|148886|1.654289|2351|0.026122|209|N/A|K__ +audio|0|151237|1.680411|151237|1.680411|2351|0.026122|209|N/A|K__ +audio|0|153588|1.706533|153588|1.706533|2351|0.026122|209|N/A|K__ +audio|0|155939|1.732656|155939|1.732656|2351|0.026122|209|N/A|K__ +video|1|150382|1.670911|146782|1.630911|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224 -video|1|153982|1.710911|150382|1.670911|3600|0.040000|24711|361336|K_ -video|1|161182|1.790911|157582|1.750911|3600|0.040000|12135|155852|__|MPEGTS Stream ID|224 +video|1|153982|1.710911|150382|1.670911|3600|0.040000|24711|361336|K__ +video|1|161182|1.790911|157582|1.750911|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224 -video|1|164782|1.830911|161182|1.790911|3600|0.040000|12282|168448|__|MPEGTS Stream ID|224 +video|1|164782|1.830911|161182|1.790911|3600|0.040000|12282|168448|___|MPEGTS Stream ID|224 -video|1|168382|1.870911|164782|1.830911|3600|0.040000|24786|181420|K_|MPEGTS Stream ID|224 +video|1|168382|1.870911|164782|1.830911|3600|0.040000|24786|181420|K__|MPEGTS Stream ID|224 -video|1|171982|1.910911|168382|1.870911|3600|0.040000|17440|206988|__|MPEGTS Stream ID|224 +video|1|171982|1.910911|168382|1.870911|3600|0.040000|17440|206988|___|MPEGTS Stream ID|224 -video|1|175582|1.950911|171982|1.910911|3600|0.040000|15019|224848|__|MPEGTS Stream ID|224 +video|1|175582|1.950911|171982|1.910911|3600|0.040000|15019|224848|___|MPEGTS Stream ID|224 -0|mp2|unknown|audio|[3][0][0][0]|0x0003|s16p|44100|1|mono|0|N/A|0/0|0/0|1/90000|0|0.000000|N/A|N/A|64000|N/A|N/A|N/A|N/A|89|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|this is stream 0 +0|mp2|unknown|audio|[3][0][0][0]|0x0003|s16p|44100|1|mono|0|0|N/A|0/0|0/0|1/90000|0|0.000000|N/A|N/A|64000|N/A|N/A|N/A|N/A|89|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|this is stream 0 1|mpeg2video|4|video|[2][0][0][0]|0x0002|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/90000|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|60|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|this is stream 1|CPB properties|0|0|0|49152|-1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest1 2023-03-03 13:29:59.000000000 +0000 @@ -13,7 +13,7 @@ #sample_rate 1: 44100 #channel_layout_name 1: mono #stream#, dts, pts, duration, size, hash -1, -256, -256, 1536, 416, e3bd415f62aa927e9273151fdf21ebce +1, -256, -256, 1536, 416, 91b0c4b4dff3de421544d4a3926616e6 0, 0, 0, 2048, 8719, bbea2a7487d61d39a0b2f2fe62a4df4a 1, 1280, 1280, 1536, 418, 6e79527e2af3448d7a0e4a8e29cd9722 0, 2048, 2048, 2048, 975, 94f30e410595452ee981d96224516504 @@ -32,20 +32,20 @@ 0, 14336, 14336, 2048, 1474, a9c493c020d710af7f2c98b9aae846ff 1, 13568, 13568, 1536, 418, ef7bd3e9c13f03aa6676629101a9a8a0 0, 16384, 16384, 2048, 1467, b801d1a76c84923ab813e9a5d9ebdb78 -1, 15104, 15104, 1536, 418, c5dda974df7e418d9036dff134aad2ae +1, 15104, 15104, 1536, 418, f7ef9460b971b5b8b61e91c489d1dd4e 0, 18432, 18432, 2048, 1469, 22f7fcd055bf124436de9a9432f7c9d2 1, 16640, 16640, 1536, 418, 48e7a9f574654dd95a325cfec5072254 0, 20480, 20480, 2048, 1506, da18f30d7008f2307ec51863a9873afd 1, 18176, 18176, 1536, 418, 737d867e328377a3e6623f77f646ea61 0, 22528, 22528, 2048, 1520, 2c7d44ca3485373af6cfb3e44e495bf7 -1, 19712, 19712, 1536, 418, 5e2a004ad90ba069cecd9fdc1652388c +1, 19712, 19712, 1536, 418, ed9eb5db5c03725564239eb25d28c137 0, 24576, 24576, 2048, 8524, 0634c69955cbffe94f4e15b288557cac -1, 21248, 21248, 1536, 418, c694e51e609bdd00749a04294cbd60fb -1, 22784, 22784, 1536, 418, 6b787ffae0063d9910deebc8b3e98fd4 +1, 21248, 21248, 1536, 418, 3aa5eac505cb898030c705bcfe5ee850 +1, 22784, 22784, 1536, 418, 08ee7262d55437ba687e4f887249d92a 0, 26624, 26624, 2048, 1079, f081cbd559dab2b579f40d2fa988a959 1, 24320, 24320, 1536, 418, eb6d62198a5472a1c179d42cde60b869 0, 28672, 28672, 2048, 1343, fdf8069cd511f4fa185748118acfb72e -1, 25856, 25856, 1536, 418, 70a6c8e61e8d75f7a310bc7294ad38f6 +1, 25856, 25856, 1536, 418, 53e2ab46c2d6e7c6da1416e2dd581136 0, 30720, 30720, 2048, 1486, e72dfcd069f5be3a30310002b1b5e252 1, 27392, 27392, 1536, 418, 6847924a11575b3628ccdfd81a2fb1dc 0, 32768, 32768, 2048, 1491, 710c5421d44a8c9356c1477cbcd27c0e @@ -55,8 +55,8 @@ 0, 36864, 36864, 2048, 1481, 8696aa412629328687bda5e88dd40b81 1, 32000, 32000, 1536, 418, 3add3833b86a38c229faf8e602f83dcb 0, 38912, 38912, 2048, 1521, 3c974bf799b8e35d295c6567ffeb7276 -1, 33536, 33536, 1536, 418, cb51e6a41f5c4a5f01dd94f58210112b -1, 35072, 35072, 1536, 418, 66c3570cb8c11386b0601fe4a6eb7ee0 +1, 33536, 33536, 1536, 418, 303adaf2b35e2b8742d0553d21ddb00f +1, 35072, 35072, 1536, 418, f12224af46440d663ea238c313afd664 0, 40960, 40960, 2048, 1514, 1a54ec5296f1551a7f67c515e40ca646 1, 36608, 36608, 1536, 418, 8b986c15b9ab86432c43cedd1a182e8d 0, 43008, 43008, 2048, 1562, d285916a1c7a2fb9f37d18bfa977e075 @@ -75,18 +75,18 @@ 0, 55296, 55296, 2048, 1641, f79725e348ed7796f2be7c153ce32580 1, 48896, 48896, 1536, 418, 85378fd6c8b49a1f4c5490ab1e4013ca 0, 57344, 57344, 2048, 1735, ae14fbdbf8777d88077818db0ae346b3 -1, 50432, 50432, 1536, 418, 528e28031145f07336cd2a1b9b324ca6 +1, 50432, 50432, 1536, 418, 77be16e32de134a835b98e1e72f9252a 0, 59392, 59392, 2048, 1760, e943dc0f9ed56fbca1af43c3c3c6dea1 1, 51968, 51968, 1536, 418, cc9b907fc92fffc61f7e41cdb863d586 0, 61440, 61440, 2048, 1798, efb1c91f9aee5c84c92e8cd5a5b58783 1, 53504, 53504, 1536, 418, fe2f2ca279b14d7053349111578b48c0 0, 63488, 63488, 2048, 1830, 7aa74080b344e63280854570f701e2b8 -1, 55040, 55040, 1536, 418, 5f2c6037aa4b89572a4ed712082ae2ab +1, 55040, 55040, 1536, 418, 9131805eaad3bdd768bbc0f2c8d13a0f 0, 65536, 65536, 2048, 1835, 566fa13f73b9aa63eed50511b112b191 1, 56576, 56576, 1536, 418, 17a096694df972c2ef3a9abbe0a9cd6a 1, 58112, 58112, 1536, 418, c96a64bbfd1aae269e44bfdaea7c8a9c 0, 67584, 67584, 2048, 1902, 95933f1710291419d0febd37d5878362 -1, 59648, 59648, 1536, 418, 5f9297244e107134c49fc4982f5a7c1f +1, 59648, 59648, 1536, 418, 8ea07d1983245453368667ee84bd6ee4 0, 69632, 69632, 2048, 1886, 5a8e4c7557ec0d09d40fbfabc5b92e63 1, 61184, 61184, 1536, 418, da740d2d75b51d6e28bcb068f6a90d41 0, 71680, 71680, 2048, 1949, 3f81e2b8821c22f89501feafebb9d618 @@ -103,21 +103,20 @@ 0, 81920, 81920, 2048, 1989, f3bf07391ef46cba98eb78fdc3707fa3 1, 71936, 71936, 1536, 418, 5e60f266106b86f19749b64d86b11f43 0, 83968, 83968, 2048, 1949, 0650751332acc5d5f96f292ffc4add21 -1, 73472, 73472, 1536, 418, cedea148c5f7ddba6f0fbcbe17e6bfbb +1, 73472, 73472, 1536, 418, 62e0ed387d5a37ba78ca99bbd656b124 0, 86016, 86016, 2048, 1956, d52d57b697f4ec90bb1f69fd7ece1952 1, 75008, 75008, 1536, 416, 97655498b413a59b3f0f6bdc25f69084 0, 88064, 88064, 2048, 2012, e25c0bb0ec726fe5c9ade88cf7ae9a19 -1, 76544, 76544, 1536, 418, 0bea3f23db7aafefe50710310af25a9b +1, 76544, 76544, 1536, 418, d87c94a232b967004c3644c6b8513ba5 0, 90112, 90112, 2048, 1995, eb0377542bc15580ef8f772ce6f506bd 1, 78080, 78080, 1536, 418, e763b383810d9a4645901c0d93f98a32 0, 92160, 92160, 2048, 2078, 7aa93cd366118984932da377f4743de6 1, 79616, 79616, 1536, 418, f090bb15688066a9c5129348f86245e7 0, 94208, 94208, 2048, 2116, 9d8c672e97c27ed4e3281bb10481914a -1, 81152, 81152, 1536, 418, beb8658ede31b44326de936b28a2d740 +1, 81152, 81152, 1536, 418, 2a434a6dca73f03947310d4c25d7470f 1, 82688, 82688, 1536, 418, 53987c0214550f387ce03093b83f4225 0, 96256, 96256, 2048, 2024, 18d42dbec2fa24fd30374d79a054cd4f -1, 84224, 84224, 1536, 418, d3c37c202144070892528cc0a0ff3112 +1, 84224, 84224, 1536, 418, f5548bc014dd98d7d61df1d542d3a176 0, 98304, 98304, 2048, 11182, e35a2ab846029effdbca0e43639717f2 1, 85760, 85760, 1536, 418, cf52ea7fc69e4c5bc8f75b354dfe60af 0, 100352, 100352, 2048, 1423, f480272c7d0b97834bc8ea36cceca61d -1, 87296, 87296, 1536, 418, 78ab22657a1b6c8a0e5b8612ceb8081d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/copy-shortest2 2023-03-03 13:29:59.000000000 +0000 @@ -13,7 +13,7 @@ #sample_rate 1: 44100 #channel_layout_name 1: mono #stream#, dts, pts, duration, size, hash -1, -256, -256, 1536, 416, e3bd415f62aa927e9273151fdf21ebce +1, -256, -256, 1536, 416, 91b0c4b4dff3de421544d4a3926616e6 0, 0, 0, 2048, 8719, bbea2a7487d61d39a0b2f2fe62a4df4a 1, 1280, 1280, 1536, 418, 6e79527e2af3448d7a0e4a8e29cd9722 0, 2048, 2048, 2048, 975, 94f30e410595452ee981d96224516504 @@ -32,20 +32,20 @@ 0, 14336, 14336, 2048, 1474, a9c493c020d710af7f2c98b9aae846ff 1, 13568, 13568, 1536, 418, ef7bd3e9c13f03aa6676629101a9a8a0 0, 16384, 16384, 2048, 1467, b801d1a76c84923ab813e9a5d9ebdb78 -1, 15104, 15104, 1536, 418, c5dda974df7e418d9036dff134aad2ae +1, 15104, 15104, 1536, 418, f7ef9460b971b5b8b61e91c489d1dd4e 0, 18432, 18432, 2048, 1469, 22f7fcd055bf124436de9a9432f7c9d2 1, 16640, 16640, 1536, 418, 48e7a9f574654dd95a325cfec5072254 0, 20480, 20480, 2048, 1506, da18f30d7008f2307ec51863a9873afd 1, 18176, 18176, 1536, 418, 737d867e328377a3e6623f77f646ea61 0, 22528, 22528, 2048, 1520, 2c7d44ca3485373af6cfb3e44e495bf7 -1, 19712, 19712, 1536, 418, 5e2a004ad90ba069cecd9fdc1652388c +1, 19712, 19712, 1536, 418, ed9eb5db5c03725564239eb25d28c137 0, 24576, 24576, 2048, 8524, 0634c69955cbffe94f4e15b288557cac -1, 21248, 21248, 1536, 418, c694e51e609bdd00749a04294cbd60fb -1, 22784, 22784, 1536, 418, 6b787ffae0063d9910deebc8b3e98fd4 +1, 21248, 21248, 1536, 418, 3aa5eac505cb898030c705bcfe5ee850 +1, 22784, 22784, 1536, 418, 08ee7262d55437ba687e4f887249d92a 0, 26624, 26624, 2048, 1079, f081cbd559dab2b579f40d2fa988a959 1, 24320, 24320, 1536, 418, eb6d62198a5472a1c179d42cde60b869 0, 28672, 28672, 2048, 1343, fdf8069cd511f4fa185748118acfb72e -1, 25856, 25856, 1536, 418, 70a6c8e61e8d75f7a310bc7294ad38f6 +1, 25856, 25856, 1536, 418, 53e2ab46c2d6e7c6da1416e2dd581136 0, 30720, 30720, 2048, 1486, e72dfcd069f5be3a30310002b1b5e252 1, 27392, 27392, 1536, 418, 6847924a11575b3628ccdfd81a2fb1dc 0, 32768, 32768, 2048, 1491, 710c5421d44a8c9356c1477cbcd27c0e @@ -55,8 +55,8 @@ 0, 36864, 36864, 2048, 1481, 8696aa412629328687bda5e88dd40b81 1, 32000, 32000, 1536, 418, 3add3833b86a38c229faf8e602f83dcb 0, 38912, 38912, 2048, 1521, 3c974bf799b8e35d295c6567ffeb7276 -1, 33536, 33536, 1536, 418, cb51e6a41f5c4a5f01dd94f58210112b -1, 35072, 35072, 1536, 418, 66c3570cb8c11386b0601fe4a6eb7ee0 +1, 33536, 33536, 1536, 418, 303adaf2b35e2b8742d0553d21ddb00f +1, 35072, 35072, 1536, 418, f12224af46440d663ea238c313afd664 0, 40960, 40960, 2048, 1514, 1a54ec5296f1551a7f67c515e40ca646 1, 36608, 36608, 1536, 418, 8b986c15b9ab86432c43cedd1a182e8d 0, 43008, 43008, 2048, 1562, d285916a1c7a2fb9f37d18bfa977e075 @@ -75,18 +75,18 @@ 0, 55296, 55296, 2048, 1641, f79725e348ed7796f2be7c153ce32580 1, 48896, 48896, 1536, 418, 85378fd6c8b49a1f4c5490ab1e4013ca 0, 57344, 57344, 2048, 1735, ae14fbdbf8777d88077818db0ae346b3 -1, 50432, 50432, 1536, 418, 528e28031145f07336cd2a1b9b324ca6 +1, 50432, 50432, 1536, 418, 77be16e32de134a835b98e1e72f9252a 0, 59392, 59392, 2048, 1760, e943dc0f9ed56fbca1af43c3c3c6dea1 1, 51968, 51968, 1536, 418, cc9b907fc92fffc61f7e41cdb863d586 0, 61440, 61440, 2048, 1798, efb1c91f9aee5c84c92e8cd5a5b58783 1, 53504, 53504, 1536, 418, fe2f2ca279b14d7053349111578b48c0 0, 63488, 63488, 2048, 1830, 7aa74080b344e63280854570f701e2b8 -1, 55040, 55040, 1536, 418, 5f2c6037aa4b89572a4ed712082ae2ab +1, 55040, 55040, 1536, 418, 9131805eaad3bdd768bbc0f2c8d13a0f 0, 65536, 65536, 2048, 1835, 566fa13f73b9aa63eed50511b112b191 1, 56576, 56576, 1536, 418, 17a096694df972c2ef3a9abbe0a9cd6a 1, 58112, 58112, 1536, 418, c96a64bbfd1aae269e44bfdaea7c8a9c 0, 67584, 67584, 2048, 1902, 95933f1710291419d0febd37d5878362 -1, 59648, 59648, 1536, 418, 5f9297244e107134c49fc4982f5a7c1f +1, 59648, 59648, 1536, 418, 8ea07d1983245453368667ee84bd6ee4 0, 69632, 69632, 2048, 1886, 5a8e4c7557ec0d09d40fbfabc5b92e63 1, 61184, 61184, 1536, 418, da740d2d75b51d6e28bcb068f6a90d41 0, 71680, 71680, 2048, 1949, 3f81e2b8821c22f89501feafebb9d618 @@ -103,21 +103,20 @@ 0, 81920, 81920, 2048, 1989, f3bf07391ef46cba98eb78fdc3707fa3 1, 71936, 71936, 1536, 418, 5e60f266106b86f19749b64d86b11f43 0, 83968, 83968, 2048, 1949, 0650751332acc5d5f96f292ffc4add21 -1, 73472, 73472, 1536, 418, cedea148c5f7ddba6f0fbcbe17e6bfbb +1, 73472, 73472, 1536, 418, 62e0ed387d5a37ba78ca99bbd656b124 0, 86016, 86016, 2048, 1956, d52d57b697f4ec90bb1f69fd7ece1952 1, 75008, 75008, 1536, 416, 97655498b413a59b3f0f6bdc25f69084 0, 88064, 88064, 2048, 2012, e25c0bb0ec726fe5c9ade88cf7ae9a19 -1, 76544, 76544, 1536, 418, 0bea3f23db7aafefe50710310af25a9b +1, 76544, 76544, 1536, 418, d87c94a232b967004c3644c6b8513ba5 0, 90112, 90112, 2048, 1995, eb0377542bc15580ef8f772ce6f506bd 1, 78080, 78080, 1536, 418, e763b383810d9a4645901c0d93f98a32 0, 92160, 92160, 2048, 2078, 7aa93cd366118984932da377f4743de6 1, 79616, 79616, 1536, 418, f090bb15688066a9c5129348f86245e7 0, 94208, 94208, 2048, 2116, 9d8c672e97c27ed4e3281bb10481914a -1, 81152, 81152, 1536, 418, beb8658ede31b44326de936b28a2d740 +1, 81152, 81152, 1536, 418, 2a434a6dca73f03947310d4c25d7470f 1, 82688, 82688, 1536, 418, 53987c0214550f387ce03093b83f4225 0, 96256, 96256, 2048, 2024, 18d42dbec2fa24fd30374d79a054cd4f -1, 84224, 84224, 1536, 418, d3c37c202144070892528cc0a0ff3112 +1, 84224, 84224, 1536, 418, f5548bc014dd98d7d61df1d542d3a176 0, 98304, 98304, 2048, 11182, e35a2ab846029effdbca0e43639717f2 1, 85760, 85760, 1536, 418, cf52ea7fc69e4c5bc8f75b354dfe60af 0, 100352, 100352, 2048, 1423, f480272c7d0b97834bc8ea36cceca61d -1, 87296, 87296, 1536, 418, 78ab22657a1b6c8a0e5b8612ceb8081d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-embedded mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-embedded --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-embedded 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-embedded 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=N/A pkt_duration=N/A pkt_duration_time=N/A +duration=N/A +duration_time=N/A pkt_pos=N/A pkt_size=15760 width=263 @@ -42,6 +44,8 @@ best_effort_timestamp_time=0.025057 pkt_duration=15040 pkt_duration_time=0.001066 +duration=15040 +duration_time=0.001066 pkt_pos=16292 pkt_size=417 sample_fmt=fltp @@ -61,6 +65,8 @@ best_effort_timestamp_time=0.026122 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=16709 pkt_size=418 sample_fmt=fltp @@ -80,6 +86,8 @@ best_effort_timestamp_time=0.052245 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=17127 pkt_size=418 sample_fmt=fltp @@ -99,6 +107,8 @@ best_effort_timestamp_time=0.078367 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=17545 pkt_size=418 sample_fmt=fltp @@ -118,6 +128,8 @@ best_effort_timestamp_time=0.104490 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=17963 pkt_size=418 sample_fmt=fltp @@ -137,6 +149,8 @@ best_effort_timestamp_time=0.130612 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=18381 pkt_size=418 sample_fmt=fltp @@ -156,6 +170,8 @@ best_effort_timestamp_time=0.156735 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=18799 pkt_size=418 sample_fmt=fltp @@ -175,6 +191,8 @@ best_effort_timestamp_time=0.182857 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=19217 pkt_size=418 sample_fmt=fltp @@ -194,6 +212,8 @@ best_effort_timestamp_time=0.208980 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=19635 pkt_size=418 sample_fmt=fltp @@ -213,6 +233,8 @@ best_effort_timestamp_time=0.235102 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=20053 pkt_size=418 sample_fmt=fltp @@ -232,6 +254,8 @@ best_effort_timestamp_time=0.261224 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=20471 pkt_size=418 sample_fmt=fltp @@ -251,6 +275,8 @@ best_effort_timestamp_time=0.287347 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=20889 pkt_size=418 sample_fmt=fltp @@ -270,6 +296,8 @@ best_effort_timestamp_time=0.313469 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=21307 pkt_size=418 sample_fmt=fltp @@ -289,6 +317,8 @@ best_effort_timestamp_time=0.339592 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=21725 pkt_size=418 sample_fmt=fltp @@ -308,6 +338,8 @@ best_effort_timestamp_time=0.365714 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=22143 pkt_size=418 sample_fmt=fltp @@ -327,6 +359,8 @@ best_effort_timestamp_time=0.391837 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=22561 pkt_size=418 sample_fmt=fltp @@ -346,6 +380,8 @@ best_effort_timestamp_time=0.417959 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=22979 pkt_size=418 sample_fmt=fltp @@ -365,6 +401,8 @@ best_effort_timestamp_time=0.444082 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=23397 pkt_size=418 sample_fmt=fltp @@ -384,6 +422,8 @@ best_effort_timestamp_time=0.470204 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=23815 pkt_size=418 sample_fmt=fltp @@ -403,6 +443,8 @@ best_effort_timestamp_time=0.496327 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=24233 pkt_size=418 sample_fmt=fltp @@ -422,6 +464,8 @@ best_effort_timestamp_time=0.522449 pkt_duration=368640 pkt_duration_time=0.026122 +duration=368640 +duration_time=0.026122 pkt_pos=24651 pkt_size=418 sample_fmt=fltp diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-jpg mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-jpg --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-jpg 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-jpg 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=N/A pkt_size=46095 width=400 @@ -27,30 +29,30 @@ color_primaries=unknown color_transfer=unknown chroma_location=center -TAG:ImageDescription= +TAG:ImageDescription= TAG:Make=Canon TAG:Model=Canon PowerShot SX200 IS TAG:Orientation= 1 -TAG:XResolution= 180:1 -TAG:YResolution= 180:1 +TAG:XResolution= 180:1 +TAG:YResolution= 180:1 TAG:ResolutionUnit= 2 TAG:DateTime=2013:07:18 13:12:03 TAG:YCbCrPositioning= 2 -TAG:ExposureTime= 1:1250 -TAG:FNumber= 40:10 +TAG:ExposureTime= 1:1250 +TAG:FNumber= 40:10 TAG:ISOSpeedRatings= 160 TAG:ExifVersion= 48, 50, 50, 49 TAG:DateTimeOriginal=2013:07:18 13:12:03 TAG:DateTimeDigitized=2013:07:18 13:12:03 TAG:ComponentsConfiguration= 1, 2, 3, 0 -TAG:CompressedBitsPerPixel= 3:1 -TAG:ShutterSpeedValue= 329:32 -TAG:ApertureValue= 128:32 -TAG:ExposureBiasValue= 0:3 -TAG:MaxApertureValue= 113:32 +TAG:CompressedBitsPerPixel= 3:1 +TAG:ShutterSpeedValue= 329:32 +TAG:ApertureValue= 128:32 +TAG:ExposureBiasValue= 0:3 +TAG:MaxApertureValue= 113:32 TAG:MeteringMode= 5 TAG:Flash= 16 -TAG:FocalLength= 5000:1000 +TAG:FocalLength= 5000:1000 TAG:MakerNote= 25, 0, 1, 0, 3, 0, 48, 0, 0, 0, 28, 4, 0, 0, 2, 0 3, 0, 4, 0, 0, 0, 124, 4, 0, 0, 3, 0, 3, 0, 4, 0 @@ -219,14 +221,14 @@ TAG:GPSLatitude= 48, 49, 48, 48 TAG:0x1001= 4000 TAG:0x1002= 2248 -TAG:FocalPlaneXResolution=4000000:244 -TAG:FocalPlaneYResolution=2248000:183 +TAG:FocalPlaneXResolution=4000000:244 +TAG:FocalPlaneYResolution=2248000:183 TAG:FocalPlaneResolutionUnit= 2 TAG:SensingMethod= 2 TAG:FileSource= 3 TAG:CustomRendered= 0 TAG:ExposureMode= 0 TAG:WhiteBalance= 0 -TAG:DigitalZoomRatio= 4000:4000 +TAG:DigitalZoomRatio= 4000:4000 TAG:SceneCaptureType= 0 [/FRAME] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-tiff mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-tiff --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-tiff 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-tiff 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=0 pkt_size=67604 width=200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-webp mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-webp --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-webp 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exif-image-webp 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=0 pkt_size=39276 width=400 @@ -27,30 +29,30 @@ color_primaries=unknown color_transfer=unknown chroma_location=unspecified -TAG:ImageDescription= +TAG:ImageDescription= TAG:Make=Canon TAG:Model=Canon PowerShot SX200 IS TAG:Orientation= 1 -TAG:XResolution= 180:1 -TAG:YResolution= 180:1 +TAG:XResolution= 180:1 +TAG:YResolution= 180:1 TAG:ResolutionUnit= 2 TAG:DateTime=2013:07:18 13:12:03 TAG:YCbCrPositioning= 2 -TAG:ExposureTime= 1:1250 -TAG:FNumber= 40:10 +TAG:ExposureTime= 1:1250 +TAG:FNumber= 40:10 TAG:ISOSpeedRatings= 160 TAG:ExifVersion= 48, 50, 50, 49 TAG:DateTimeOriginal=2013:07:18 13:12:03 TAG:DateTimeDigitized=2013:07:18 13:12:03 TAG:ComponentsConfiguration= 1, 2, 3, 0 -TAG:CompressedBitsPerPixel= 3:1 -TAG:ShutterSpeedValue= 329:32 -TAG:ApertureValue= 128:32 -TAG:ExposureBiasValue= 0:3 -TAG:MaxApertureValue= 113:32 +TAG:CompressedBitsPerPixel= 3:1 +TAG:ShutterSpeedValue= 329:32 +TAG:ApertureValue= 128:32 +TAG:ExposureBiasValue= 0:3 +TAG:MaxApertureValue= 113:32 TAG:MeteringMode= 5 TAG:Flash= 16 -TAG:FocalLength= 5000:1000 +TAG:FocalLength= 5000:1000 TAG:MakerNote= 25, 0, 1, 0, 3, 0, 48, 0, 0, 0, 28, 4, 0, 0, 2, 0 3, 0, 4, 0, 0, 0, 124, 4, 0, 0, 3, 0, 3, 0, 4, 0 @@ -219,14 +221,14 @@ TAG:GPSLatitude= 48, 49, 48, 48 TAG:0x1001= 4000 TAG:0x1002= 2248 -TAG:FocalPlaneXResolution=4000000:244 -TAG:FocalPlaneYResolution=2248000:183 +TAG:FocalPlaneXResolution=4000000:244 +TAG:FocalPlaneYResolution=2248000:183 TAG:FocalPlaneResolutionUnit= 2 TAG:SensingMethod= 2 TAG:FileSource= 3 TAG:CustomRendered= 0 TAG:ExposureMode= 0 TAG:WhiteBalance= 0 -TAG:DigitalZoomRatio= 4000:4000 +TAG:DigitalZoomRatio= 4000:4000 TAG:SceneCaptureType= 0 [/FRAME] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/exr-rgb-scanline-zip-half-0x0-0xFFFF 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 256x256 #sar 0: 1/1 -0, 0, 0, 1, 786432, 0x1445e411 +0, 0, 0, 1, 786432, 0xce9be2be diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffmpeg-fix_sub_duration_heartbeat mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffmpeg-fix_sub_duration_heartbeat --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffmpeg-fix_sub_duration_heartbeat 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffmpeg-fix_sub_duration_heartbeat 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,48 @@ +1 +00:00:00,968 --> 00:00:01,001 +{\an7}( + +2 +00:00:01,001 --> 00:00:01,168 +{\an7}( + +3 +00:00:01,168 --> 00:00:01,368 +{\an7}( inaudibl + +4 +00:00:01,368 --> 00:00:01,568 +{\an7}( inaudible radio chat + +5 +00:00:01,568 --> 00:00:02,002 +{\an7}( inaudible radio chatter ) + +6 +00:00:02,002 --> 00:00:03,003 +{\an7}( inaudible radio chatter ) + +7 +00:00:03,003 --> 00:00:03,103 +{\an7}( inaudible radio chatter ) + +8 +00:00:03,103 --> 00:00:03,303 +{\an7}( inaudible radio chatter ) +>> + +9 +00:00:03,303 --> 00:00:03,503 +{\an7}( inaudible radio chatter ) +>> Safety rema + +10 +00:00:03,504 --> 00:00:03,704 +{\an7}( inaudible radio chatter ) +>> Safety remains our numb + +11 +00:00:03,704 --> 00:00:04,004 +{\an7}( inaudible radio chatter ) +>> Safety remains our number one + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_compact mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_compact --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_compact 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_compact 2023-03-03 13:29:59.000000000 +0000 @@ -1,32 +1,32 @@ -packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|size=2048|pos=669|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=669|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown -packet|codec_type=video|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=2048|duration_time=0.040000|size=230400|pos=2744|flags=K_ -frame|media_type=video|stream_index=1|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=2744|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=video|stream_index=2|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=2048|duration_time=0.040000|size=30000|pos=233165|flags=K_ -frame|media_type=video|stream_index=2|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=233165|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|size=2048|pos=263170|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=1024|pts_time=0.023220|pkt_dts=1024|pkt_dts_time=0.023220|best_effort_timestamp=1024|best_effort_timestamp_time=0.023220|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=263170|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown -packet|codec_type=video|stream_index=1|pts=2048|pts_time=0.040000|dts=2048|dts_time=0.040000|duration=2048|duration_time=0.040000|size=230400|pos=265248|flags=K_ -frame|media_type=video|stream_index=1|key_frame=1|pts=2048|pts_time=0.040000|pkt_dts=2048|pkt_dts_time=0.040000|best_effort_timestamp=2048|best_effort_timestamp_time=0.040000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=265248|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=video|stream_index=2|pts=2048|pts_time=0.040000|dts=2048|dts_time=0.040000|duration=2048|duration_time=0.040000|size=30000|pos=495672|flags=K_ -frame|media_type=video|stream_index=2|key_frame=1|pts=2048|pts_time=0.040000|pkt_dts=2048|pkt_dts_time=0.040000|best_effort_timestamp=2048|best_effort_timestamp_time=0.040000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=495672|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|size=2048|pos=525677|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=2048|pts_time=0.046440|pkt_dts=2048|pkt_dts_time=0.046440|best_effort_timestamp=2048|best_effort_timestamp_time=0.046440|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=525677|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|size=2048|pos=527748|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=3072|pts_time=0.069660|pkt_dts=3072|pkt_dts_time=0.069660|best_effort_timestamp=3072|best_effort_timestamp_time=0.069660|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=527748|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown -packet|codec_type=video|stream_index=1|pts=4096|pts_time=0.080000|dts=4096|dts_time=0.080000|duration=2048|duration_time=0.040000|size=230400|pos=529826|flags=K_ -frame|media_type=video|stream_index=1|key_frame=1|pts=4096|pts_time=0.080000|pkt_dts=4096|pkt_dts_time=0.080000|best_effort_timestamp=4096|best_effort_timestamp_time=0.080000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=529826|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=video|stream_index=2|pts=4096|pts_time=0.080000|dts=4096|dts_time=0.080000|duration=2048|duration_time=0.040000|size=30000|pos=760250|flags=K_ -frame|media_type=video|stream_index=2|key_frame=1|pts=4096|pts_time=0.080000|pkt_dts=4096|pkt_dts_time=0.080000|best_effort_timestamp=4096|best_effort_timestamp_time=0.080000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=760250|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|size=2048|pos=790255|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=4096|pts_time=0.092880|pkt_dts=4096|pkt_dts_time=0.092880|best_effort_timestamp=4096|best_effort_timestamp_time=0.092880|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=790255|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=393|duration_time=0.008912|size=786|pos=792326|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=5120|pts_time=0.116100|pkt_dts=5120|pkt_dts_time=0.116100|best_effort_timestamp=5120|best_effort_timestamp_time=0.116100|pkt_duration=393|pkt_duration_time=0.008912|pkt_pos=792326|pkt_size=786|sample_fmt=s16|nb_samples=393|channels=1|channel_layout=unknown -packet|codec_type=video|stream_index=1|pts=6144|pts_time=0.120000|dts=6144|dts_time=0.120000|duration=2048|duration_time=0.040000|size=230400|pos=793142|flags=K_ -frame|media_type=video|stream_index=1|key_frame=1|pts=6144|pts_time=0.120000|pkt_dts=6144|pkt_dts_time=0.120000|best_effort_timestamp=6144|best_effort_timestamp_time=0.120000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=793142|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -packet|codec_type=video|stream_index=2|pts=6144|pts_time=0.120000|dts=6144|dts_time=0.120000|duration=2048|duration_time=0.040000|size=30000|pos=1023566|flags=K_ -frame|media_type=video|stream_index=2|key_frame=1|pts=6144|pts_time=0.120000|pkt_dts=6144|pkt_dts_time=0.120000|best_effort_timestamp=6144|best_effort_timestamp_time=0.120000|pkt_duration=2048|pkt_duration_time=0.040000|pkt_pos=1023566|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified -stream|index=0|codec_name=pcm_s16le|profile=unknown|codec_type=audio|codec_tag_string=PSD[16]|codec_tag=0x10445350|sample_fmt=s16|sample_rate=44100|channels=1|channel_layout=unknown|bits_per_sample=16|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/44100|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=705600|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=6|nb_read_packets=6|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:E=mc²|tag:encoder=Lavc pcm_s16le +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|size=2048|pos=669|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=1024|pkt_duration_time=0.023220|duration=1024|duration_time=0.023220|pkt_pos=669|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown +packet|codec_type=video|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=2048|duration_time=0.040000|size=230400|pos=2744|flags=K__ +frame|media_type=video|stream_index=1|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=2744|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=video|stream_index=2|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=2048|duration_time=0.040000|size=30000|pos=233165|flags=K__ +frame|media_type=video|stream_index=2|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=233165|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|size=2048|pos=263170|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=1024|pts_time=0.023220|pkt_dts=1024|pkt_dts_time=0.023220|best_effort_timestamp=1024|best_effort_timestamp_time=0.023220|pkt_duration=1024|pkt_duration_time=0.023220|duration=1024|duration_time=0.023220|pkt_pos=263170|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown +packet|codec_type=video|stream_index=1|pts=2048|pts_time=0.040000|dts=2048|dts_time=0.040000|duration=2048|duration_time=0.040000|size=230400|pos=265248|flags=K__ +frame|media_type=video|stream_index=1|key_frame=1|pts=2048|pts_time=0.040000|pkt_dts=2048|pkt_dts_time=0.040000|best_effort_timestamp=2048|best_effort_timestamp_time=0.040000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=265248|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=video|stream_index=2|pts=2048|pts_time=0.040000|dts=2048|dts_time=0.040000|duration=2048|duration_time=0.040000|size=30000|pos=495672|flags=K__ +frame|media_type=video|stream_index=2|key_frame=1|pts=2048|pts_time=0.040000|pkt_dts=2048|pkt_dts_time=0.040000|best_effort_timestamp=2048|best_effort_timestamp_time=0.040000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=495672|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|size=2048|pos=525677|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=2048|pts_time=0.046440|pkt_dts=2048|pkt_dts_time=0.046440|best_effort_timestamp=2048|best_effort_timestamp_time=0.046440|pkt_duration=1024|pkt_duration_time=0.023220|duration=1024|duration_time=0.023220|pkt_pos=525677|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|size=2048|pos=527748|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=3072|pts_time=0.069660|pkt_dts=3072|pkt_dts_time=0.069660|best_effort_timestamp=3072|best_effort_timestamp_time=0.069660|pkt_duration=1024|pkt_duration_time=0.023220|duration=1024|duration_time=0.023220|pkt_pos=527748|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown +packet|codec_type=video|stream_index=1|pts=4096|pts_time=0.080000|dts=4096|dts_time=0.080000|duration=2048|duration_time=0.040000|size=230400|pos=529826|flags=K__ +frame|media_type=video|stream_index=1|key_frame=1|pts=4096|pts_time=0.080000|pkt_dts=4096|pkt_dts_time=0.080000|best_effort_timestamp=4096|best_effort_timestamp_time=0.080000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=529826|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=video|stream_index=2|pts=4096|pts_time=0.080000|dts=4096|dts_time=0.080000|duration=2048|duration_time=0.040000|size=30000|pos=760250|flags=K__ +frame|media_type=video|stream_index=2|key_frame=1|pts=4096|pts_time=0.080000|pkt_dts=4096|pkt_dts_time=0.080000|best_effort_timestamp=4096|best_effort_timestamp_time=0.080000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=760250|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|size=2048|pos=790255|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=4096|pts_time=0.092880|pkt_dts=4096|pkt_dts_time=0.092880|best_effort_timestamp=4096|best_effort_timestamp_time=0.092880|pkt_duration=1024|pkt_duration_time=0.023220|duration=1024|duration_time=0.023220|pkt_pos=790255|pkt_size=2048|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=393|duration_time=0.008912|size=786|pos=792326|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=5120|pts_time=0.116100|pkt_dts=5120|pkt_dts_time=0.116100|best_effort_timestamp=5120|best_effort_timestamp_time=0.116100|pkt_duration=393|pkt_duration_time=0.008912|duration=393|duration_time=0.008912|pkt_pos=792326|pkt_size=786|sample_fmt=s16|nb_samples=393|channels=1|channel_layout=unknown +packet|codec_type=video|stream_index=1|pts=6144|pts_time=0.120000|dts=6144|dts_time=0.120000|duration=2048|duration_time=0.040000|size=230400|pos=793142|flags=K__ +frame|media_type=video|stream_index=1|key_frame=1|pts=6144|pts_time=0.120000|pkt_dts=6144|pkt_dts_time=0.120000|best_effort_timestamp=6144|best_effort_timestamp_time=0.120000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=793142|pkt_size=230400|width=320|height=240|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +packet|codec_type=video|stream_index=2|pts=6144|pts_time=0.120000|dts=6144|dts_time=0.120000|duration=2048|duration_time=0.040000|size=30000|pos=1023566|flags=K__ +frame|media_type=video|stream_index=2|key_frame=1|pts=6144|pts_time=0.120000|pkt_dts=6144|pkt_dts_time=0.120000|best_effort_timestamp=6144|best_effort_timestamp_time=0.120000|pkt_duration=2048|pkt_duration_time=0.040000|duration=2048|duration_time=0.040000|pkt_pos=1023566|pkt_size=30000|width=100|height=100|pix_fmt=rgb24|sample_aspect_ratio=1:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=unknown|color_space=unknown|color_primaries=unknown|color_transfer=unknown|chroma_location=unspecified +stream|index=0|codec_name=pcm_s16le|profile=unknown|codec_type=audio|codec_tag_string=PSD[16]|codec_tag=0x10445350|sample_fmt=s16|sample_rate=44100|channels=1|channel_layout=unknown|bits_per_sample=16|initial_padding=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/44100|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=705600|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=6|nb_read_packets=6|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:E=mc²|tag:encoder=Lavc pcm_s16le stream|index=1|codec_name=rawvideo|profile=unknown|codec_type=video|codec_tag_string=RGB[24]|codec_tag=0x18424752|width=320|height=240|coded_width=320|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=4:3|pix_fmt=rgb24|level=-99|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=unspecified|field_order=unknown|refs=1|id=N/A|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/51200|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=4|nb_read_packets=4|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:title=foobar|tag:duration_ts=field-and-tags-conflict-attempt|tag:encoder=Lavc rawvideo stream|index=2|codec_name=rawvideo|profile=unknown|codec_type=video|codec_tag_string=RGB[24]|codec_tag=0x18424752|width=100|height=100|coded_width=100|coded_height=100|closed_captions=0|film_grain=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=1:1|pix_fmt=rgb24|level=-99|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=unspecified|field_order=unknown|refs=1|id=N/A|r_frame_rate=25/1|avg_frame_rate=25/1|time_base=1/51200|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=4|nb_read_packets=4|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:encoder=Lavc rawvideo format|filename=tests/data/ffprobe-test.nut|nb_streams=3|nb_programs=0|format_name=nut|start_time=0.000000|duration=0.120000|size=1053646|bit_rate=70243066|probe_score=100|tag:title=ffprobe test file|tag:comment='A comment with CSV, XML & JSON special chars': |tag:comment2=I ♥ Üñîçød€ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_csv mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_csv --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_csv 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_csv 2023-03-03 13:29:59.000000000 +0000 @@ -1,32 +1,32 @@ -packet,audio,0,0,0.000000,0,0.000000,1024,0.023220,2048,669,K_ -frame,audio,0,1,0,0.000000,0,0.000000,0,0.000000,1024,0.023220,669,2048,s16,1024,1,unknown -packet,video,1,0,0.000000,0,0.000000,2048,0.040000,230400,2744,K_ -frame,video,1,1,0,0.000000,0,0.000000,0,0.000000,2048,0.040000,2744,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,video,2,0,0.000000,0,0.000000,2048,0.040000,30000,233165,K_ -frame,video,2,1,0,0.000000,0,0.000000,0,0.000000,2048,0.040000,233165,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,audio,0,1024,0.023220,1024,0.023220,1024,0.023220,2048,263170,K_ -frame,audio,0,1,1024,0.023220,1024,0.023220,1024,0.023220,1024,0.023220,263170,2048,s16,1024,1,unknown -packet,video,1,2048,0.040000,2048,0.040000,2048,0.040000,230400,265248,K_ -frame,video,1,1,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,265248,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,video,2,2048,0.040000,2048,0.040000,2048,0.040000,30000,495672,K_ -frame,video,2,1,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,495672,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,audio,0,2048,0.046440,2048,0.046440,1024,0.023220,2048,525677,K_ -frame,audio,0,1,2048,0.046440,2048,0.046440,2048,0.046440,1024,0.023220,525677,2048,s16,1024,1,unknown -packet,audio,0,3072,0.069660,3072,0.069660,1024,0.023220,2048,527748,K_ -frame,audio,0,1,3072,0.069660,3072,0.069660,3072,0.069660,1024,0.023220,527748,2048,s16,1024,1,unknown -packet,video,1,4096,0.080000,4096,0.080000,2048,0.040000,230400,529826,K_ -frame,video,1,1,4096,0.080000,4096,0.080000,4096,0.080000,2048,0.040000,529826,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,video,2,4096,0.080000,4096,0.080000,2048,0.040000,30000,760250,K_ -frame,video,2,1,4096,0.080000,4096,0.080000,4096,0.080000,2048,0.040000,760250,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,audio,0,4096,0.092880,4096,0.092880,1024,0.023220,2048,790255,K_ -frame,audio,0,1,4096,0.092880,4096,0.092880,4096,0.092880,1024,0.023220,790255,2048,s16,1024,1,unknown -packet,audio,0,5120,0.116100,5120,0.116100,393,0.008912,786,792326,K_ -frame,audio,0,1,5120,0.116100,5120,0.116100,5120,0.116100,393,0.008912,792326,786,s16,393,1,unknown -packet,video,1,6144,0.120000,6144,0.120000,2048,0.040000,230400,793142,K_ -frame,video,1,1,6144,0.120000,6144,0.120000,6144,0.120000,2048,0.040000,793142,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -packet,video,2,6144,0.120000,6144,0.120000,2048,0.040000,30000,1023566,K_ -frame,video,2,1,6144,0.120000,6144,0.120000,6144,0.120000,2048,0.040000,1023566,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified -stream,0,pcm_s16le,unknown,audio,PSD[16],0x10445350,s16,44100,1,unknown,16,N/A,0/0,0/0,1/44100,0,0.000000,N/A,N/A,705600,N/A,N/A,N/A,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,mc²,Lavc pcm_s16le +packet,audio,0,0,0.000000,0,0.000000,1024,0.023220,2048,669,K__ +frame,audio,0,1,0,0.000000,0,0.000000,0,0.000000,1024,0.023220,1024,0.023220,669,2048,s16,1024,1,unknown +packet,video,1,0,0.000000,0,0.000000,2048,0.040000,230400,2744,K__ +frame,video,1,1,0,0.000000,0,0.000000,0,0.000000,2048,0.040000,2048,0.040000,2744,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,video,2,0,0.000000,0,0.000000,2048,0.040000,30000,233165,K__ +frame,video,2,1,0,0.000000,0,0.000000,0,0.000000,2048,0.040000,2048,0.040000,233165,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,audio,0,1024,0.023220,1024,0.023220,1024,0.023220,2048,263170,K__ +frame,audio,0,1,1024,0.023220,1024,0.023220,1024,0.023220,1024,0.023220,1024,0.023220,263170,2048,s16,1024,1,unknown +packet,video,1,2048,0.040000,2048,0.040000,2048,0.040000,230400,265248,K__ +frame,video,1,1,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,265248,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,video,2,2048,0.040000,2048,0.040000,2048,0.040000,30000,495672,K__ +frame,video,2,1,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,2048,0.040000,495672,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,audio,0,2048,0.046440,2048,0.046440,1024,0.023220,2048,525677,K__ +frame,audio,0,1,2048,0.046440,2048,0.046440,2048,0.046440,1024,0.023220,1024,0.023220,525677,2048,s16,1024,1,unknown +packet,audio,0,3072,0.069660,3072,0.069660,1024,0.023220,2048,527748,K__ +frame,audio,0,1,3072,0.069660,3072,0.069660,3072,0.069660,1024,0.023220,1024,0.023220,527748,2048,s16,1024,1,unknown +packet,video,1,4096,0.080000,4096,0.080000,2048,0.040000,230400,529826,K__ +frame,video,1,1,4096,0.080000,4096,0.080000,4096,0.080000,2048,0.040000,2048,0.040000,529826,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,video,2,4096,0.080000,4096,0.080000,2048,0.040000,30000,760250,K__ +frame,video,2,1,4096,0.080000,4096,0.080000,4096,0.080000,2048,0.040000,2048,0.040000,760250,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,audio,0,4096,0.092880,4096,0.092880,1024,0.023220,2048,790255,K__ +frame,audio,0,1,4096,0.092880,4096,0.092880,4096,0.092880,1024,0.023220,1024,0.023220,790255,2048,s16,1024,1,unknown +packet,audio,0,5120,0.116100,5120,0.116100,393,0.008912,786,792326,K__ +frame,audio,0,1,5120,0.116100,5120,0.116100,5120,0.116100,393,0.008912,393,0.008912,792326,786,s16,393,1,unknown +packet,video,1,6144,0.120000,6144,0.120000,2048,0.040000,230400,793142,K__ +frame,video,1,1,6144,0.120000,6144,0.120000,6144,0.120000,2048,0.040000,2048,0.040000,793142,230400,320,240,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +packet,video,2,6144,0.120000,6144,0.120000,2048,0.040000,30000,1023566,K__ +frame,video,2,1,6144,0.120000,6144,0.120000,6144,0.120000,2048,0.040000,2048,0.040000,1023566,30000,100,100,rgb24,1:1,I,0,0,0,0,0,unknown,unknown,unknown,unknown,unspecified +stream,0,pcm_s16le,unknown,audio,PSD[16],0x10445350,s16,44100,1,unknown,16,0,N/A,0/0,0/0,1/44100,0,0.000000,N/A,N/A,705600,N/A,N/A,N/A,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,mc²,Lavc pcm_s16le stream,1,rawvideo,unknown,video,RGB[24],0x18424752,320,240,320,240,0,0,0,1:1,4:3,rgb24,-99,unknown,unknown,unknown,unknown,unspecified,unknown,1,N/A,25/1,25/1,1/51200,0,0.000000,N/A,N/A,N/A,N/A,N/A,N/A,4,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,foobar,field-and-tags-conflict-attempt,Lavc rawvideo stream,2,rawvideo,unknown,video,RGB[24],0x18424752,100,100,100,100,0,0,0,1:1,1:1,rgb24,-99,unknown,unknown,unknown,unknown,unspecified,unknown,1,N/A,25/1,25/1,1/51200,0,0.000000,N/A,N/A,N/A,N/A,N/A,N/A,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Lavc rawvideo format,tests/data/ffprobe-test.nut,3,0,nut,0.000000,0.120000,1053646,70243066,100,ffprobe test file,"'A comment with CSV, XML & JSON special chars': ",I ♥ Üñîçød€ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_default mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_default --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_default 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_default 2023-03-03 13:29:59.000000000 +0000 @@ -9,7 +9,7 @@ duration_time=0.023220 size=2048 pos=669 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -23,6 +23,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=669 pkt_size=2048 sample_fmt=s16 @@ -41,7 +43,7 @@ duration_time=0.040000 size=230400 pos=2744 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -55,6 +57,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=2744 pkt_size=230400 width=320 @@ -84,7 +88,7 @@ duration_time=0.040000 size=30000 pos=233165 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -98,6 +102,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=233165 pkt_size=30000 width=100 @@ -127,7 +133,7 @@ duration_time=0.023220 size=2048 pos=263170 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -141,6 +147,8 @@ best_effort_timestamp_time=0.023220 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=263170 pkt_size=2048 sample_fmt=s16 @@ -159,7 +167,7 @@ duration_time=0.040000 size=230400 pos=265248 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -173,6 +181,8 @@ best_effort_timestamp_time=0.040000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=265248 pkt_size=230400 width=320 @@ -202,7 +212,7 @@ duration_time=0.040000 size=30000 pos=495672 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -216,6 +226,8 @@ best_effort_timestamp_time=0.040000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=495672 pkt_size=30000 width=100 @@ -245,7 +257,7 @@ duration_time=0.023220 size=2048 pos=525677 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -259,6 +271,8 @@ best_effort_timestamp_time=0.046440 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=525677 pkt_size=2048 sample_fmt=s16 @@ -277,7 +291,7 @@ duration_time=0.023220 size=2048 pos=527748 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -291,6 +305,8 @@ best_effort_timestamp_time=0.069660 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=527748 pkt_size=2048 sample_fmt=s16 @@ -309,7 +325,7 @@ duration_time=0.040000 size=230400 pos=529826 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -323,6 +339,8 @@ best_effort_timestamp_time=0.080000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=529826 pkt_size=230400 width=320 @@ -352,7 +370,7 @@ duration_time=0.040000 size=30000 pos=760250 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -366,6 +384,8 @@ best_effort_timestamp_time=0.080000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=760250 pkt_size=30000 width=100 @@ -395,7 +415,7 @@ duration_time=0.023220 size=2048 pos=790255 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -409,6 +429,8 @@ best_effort_timestamp_time=0.092880 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=790255 pkt_size=2048 sample_fmt=s16 @@ -427,7 +449,7 @@ duration_time=0.008912 size=786 pos=792326 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=audio @@ -441,6 +463,8 @@ best_effort_timestamp_time=0.116100 pkt_duration=393 pkt_duration_time=0.008912 +duration=393 +duration_time=0.008912 pkt_pos=792326 pkt_size=786 sample_fmt=s16 @@ -459,7 +483,7 @@ duration_time=0.040000 size=230400 pos=793142 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -473,6 +497,8 @@ best_effort_timestamp_time=0.120000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=793142 pkt_size=230400 width=320 @@ -502,7 +528,7 @@ duration_time=0.040000 size=30000 pos=1023566 -flags=K_ +flags=K__ [/PACKET] [FRAME] media_type=video @@ -516,6 +542,8 @@ best_effort_timestamp_time=0.120000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=1023566 pkt_size=30000 width=100 @@ -546,6 +574,7 @@ channels=1 channel_layout=unknown bits_per_sample=16 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_flat mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_flat --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_flat 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_flat 2023-03-03 13:29:59.000000000 +0000 @@ -8,7 +8,7 @@ packets_and_frames.packet.0.duration_time="0.023220" packets_and_frames.packet.0.size="2048" packets_and_frames.packet.0.pos="669" -packets_and_frames.packet.0.flags="K_" +packets_and_frames.packet.0.flags="K__" packets_and_frames.frame.0.media_type="audio" packets_and_frames.frame.0.stream_index=0 packets_and_frames.frame.0.key_frame=1 @@ -20,6 +20,8 @@ packets_and_frames.frame.0.best_effort_timestamp_time="0.000000" packets_and_frames.frame.0.pkt_duration=1024 packets_and_frames.frame.0.pkt_duration_time="0.023220" +packets_and_frames.frame.0.duration=1024 +packets_and_frames.frame.0.duration_time="0.023220" packets_and_frames.frame.0.pkt_pos="669" packets_and_frames.frame.0.pkt_size="2048" packets_and_frames.frame.0.sample_fmt="s16" @@ -36,7 +38,7 @@ packets_and_frames.packet.1.duration_time="0.040000" packets_and_frames.packet.1.size="230400" packets_and_frames.packet.1.pos="2744" -packets_and_frames.packet.1.flags="K_" +packets_and_frames.packet.1.flags="K__" packets_and_frames.frame.1.media_type="video" packets_and_frames.frame.1.stream_index=1 packets_and_frames.frame.1.key_frame=1 @@ -48,6 +50,8 @@ packets_and_frames.frame.1.best_effort_timestamp_time="0.000000" packets_and_frames.frame.1.pkt_duration=2048 packets_and_frames.frame.1.pkt_duration_time="0.040000" +packets_and_frames.frame.1.duration=2048 +packets_and_frames.frame.1.duration_time="0.040000" packets_and_frames.frame.1.pkt_pos="2744" packets_and_frames.frame.1.pkt_size="230400" packets_and_frames.frame.1.width=320 @@ -75,7 +79,7 @@ packets_and_frames.packet.2.duration_time="0.040000" packets_and_frames.packet.2.size="30000" packets_and_frames.packet.2.pos="233165" -packets_and_frames.packet.2.flags="K_" +packets_and_frames.packet.2.flags="K__" packets_and_frames.frame.2.media_type="video" packets_and_frames.frame.2.stream_index=2 packets_and_frames.frame.2.key_frame=1 @@ -87,6 +91,8 @@ packets_and_frames.frame.2.best_effort_timestamp_time="0.000000" packets_and_frames.frame.2.pkt_duration=2048 packets_and_frames.frame.2.pkt_duration_time="0.040000" +packets_and_frames.frame.2.duration=2048 +packets_and_frames.frame.2.duration_time="0.040000" packets_and_frames.frame.2.pkt_pos="233165" packets_and_frames.frame.2.pkt_size="30000" packets_and_frames.frame.2.width=100 @@ -114,7 +120,7 @@ packets_and_frames.packet.3.duration_time="0.023220" packets_and_frames.packet.3.size="2048" packets_and_frames.packet.3.pos="263170" -packets_and_frames.packet.3.flags="K_" +packets_and_frames.packet.3.flags="K__" packets_and_frames.frame.3.media_type="audio" packets_and_frames.frame.3.stream_index=0 packets_and_frames.frame.3.key_frame=1 @@ -126,6 +132,8 @@ packets_and_frames.frame.3.best_effort_timestamp_time="0.023220" packets_and_frames.frame.3.pkt_duration=1024 packets_and_frames.frame.3.pkt_duration_time="0.023220" +packets_and_frames.frame.3.duration=1024 +packets_and_frames.frame.3.duration_time="0.023220" packets_and_frames.frame.3.pkt_pos="263170" packets_and_frames.frame.3.pkt_size="2048" packets_and_frames.frame.3.sample_fmt="s16" @@ -142,7 +150,7 @@ packets_and_frames.packet.4.duration_time="0.040000" packets_and_frames.packet.4.size="230400" packets_and_frames.packet.4.pos="265248" -packets_and_frames.packet.4.flags="K_" +packets_and_frames.packet.4.flags="K__" packets_and_frames.frame.4.media_type="video" packets_and_frames.frame.4.stream_index=1 packets_and_frames.frame.4.key_frame=1 @@ -154,6 +162,8 @@ packets_and_frames.frame.4.best_effort_timestamp_time="0.040000" packets_and_frames.frame.4.pkt_duration=2048 packets_and_frames.frame.4.pkt_duration_time="0.040000" +packets_and_frames.frame.4.duration=2048 +packets_and_frames.frame.4.duration_time="0.040000" packets_and_frames.frame.4.pkt_pos="265248" packets_and_frames.frame.4.pkt_size="230400" packets_and_frames.frame.4.width=320 @@ -181,7 +191,7 @@ packets_and_frames.packet.5.duration_time="0.040000" packets_and_frames.packet.5.size="30000" packets_and_frames.packet.5.pos="495672" -packets_and_frames.packet.5.flags="K_" +packets_and_frames.packet.5.flags="K__" packets_and_frames.frame.5.media_type="video" packets_and_frames.frame.5.stream_index=2 packets_and_frames.frame.5.key_frame=1 @@ -193,6 +203,8 @@ packets_and_frames.frame.5.best_effort_timestamp_time="0.040000" packets_and_frames.frame.5.pkt_duration=2048 packets_and_frames.frame.5.pkt_duration_time="0.040000" +packets_and_frames.frame.5.duration=2048 +packets_and_frames.frame.5.duration_time="0.040000" packets_and_frames.frame.5.pkt_pos="495672" packets_and_frames.frame.5.pkt_size="30000" packets_and_frames.frame.5.width=100 @@ -220,7 +232,7 @@ packets_and_frames.packet.6.duration_time="0.023220" packets_and_frames.packet.6.size="2048" packets_and_frames.packet.6.pos="525677" -packets_and_frames.packet.6.flags="K_" +packets_and_frames.packet.6.flags="K__" packets_and_frames.frame.6.media_type="audio" packets_and_frames.frame.6.stream_index=0 packets_and_frames.frame.6.key_frame=1 @@ -232,6 +244,8 @@ packets_and_frames.frame.6.best_effort_timestamp_time="0.046440" packets_and_frames.frame.6.pkt_duration=1024 packets_and_frames.frame.6.pkt_duration_time="0.023220" +packets_and_frames.frame.6.duration=1024 +packets_and_frames.frame.6.duration_time="0.023220" packets_and_frames.frame.6.pkt_pos="525677" packets_and_frames.frame.6.pkt_size="2048" packets_and_frames.frame.6.sample_fmt="s16" @@ -248,7 +262,7 @@ packets_and_frames.packet.7.duration_time="0.023220" packets_and_frames.packet.7.size="2048" packets_and_frames.packet.7.pos="527748" -packets_and_frames.packet.7.flags="K_" +packets_and_frames.packet.7.flags="K__" packets_and_frames.frame.7.media_type="audio" packets_and_frames.frame.7.stream_index=0 packets_and_frames.frame.7.key_frame=1 @@ -260,6 +274,8 @@ packets_and_frames.frame.7.best_effort_timestamp_time="0.069660" packets_and_frames.frame.7.pkt_duration=1024 packets_and_frames.frame.7.pkt_duration_time="0.023220" +packets_and_frames.frame.7.duration=1024 +packets_and_frames.frame.7.duration_time="0.023220" packets_and_frames.frame.7.pkt_pos="527748" packets_and_frames.frame.7.pkt_size="2048" packets_and_frames.frame.7.sample_fmt="s16" @@ -276,7 +292,7 @@ packets_and_frames.packet.8.duration_time="0.040000" packets_and_frames.packet.8.size="230400" packets_and_frames.packet.8.pos="529826" -packets_and_frames.packet.8.flags="K_" +packets_and_frames.packet.8.flags="K__" packets_and_frames.frame.8.media_type="video" packets_and_frames.frame.8.stream_index=1 packets_and_frames.frame.8.key_frame=1 @@ -288,6 +304,8 @@ packets_and_frames.frame.8.best_effort_timestamp_time="0.080000" packets_and_frames.frame.8.pkt_duration=2048 packets_and_frames.frame.8.pkt_duration_time="0.040000" +packets_and_frames.frame.8.duration=2048 +packets_and_frames.frame.8.duration_time="0.040000" packets_and_frames.frame.8.pkt_pos="529826" packets_and_frames.frame.8.pkt_size="230400" packets_and_frames.frame.8.width=320 @@ -315,7 +333,7 @@ packets_and_frames.packet.9.duration_time="0.040000" packets_and_frames.packet.9.size="30000" packets_and_frames.packet.9.pos="760250" -packets_and_frames.packet.9.flags="K_" +packets_and_frames.packet.9.flags="K__" packets_and_frames.frame.9.media_type="video" packets_and_frames.frame.9.stream_index=2 packets_and_frames.frame.9.key_frame=1 @@ -327,6 +345,8 @@ packets_and_frames.frame.9.best_effort_timestamp_time="0.080000" packets_and_frames.frame.9.pkt_duration=2048 packets_and_frames.frame.9.pkt_duration_time="0.040000" +packets_and_frames.frame.9.duration=2048 +packets_and_frames.frame.9.duration_time="0.040000" packets_and_frames.frame.9.pkt_pos="760250" packets_and_frames.frame.9.pkt_size="30000" packets_and_frames.frame.9.width=100 @@ -354,7 +374,7 @@ packets_and_frames.packet.10.duration_time="0.023220" packets_and_frames.packet.10.size="2048" packets_and_frames.packet.10.pos="790255" -packets_and_frames.packet.10.flags="K_" +packets_and_frames.packet.10.flags="K__" packets_and_frames.frame.10.media_type="audio" packets_and_frames.frame.10.stream_index=0 packets_and_frames.frame.10.key_frame=1 @@ -366,6 +386,8 @@ packets_and_frames.frame.10.best_effort_timestamp_time="0.092880" packets_and_frames.frame.10.pkt_duration=1024 packets_and_frames.frame.10.pkt_duration_time="0.023220" +packets_and_frames.frame.10.duration=1024 +packets_and_frames.frame.10.duration_time="0.023220" packets_and_frames.frame.10.pkt_pos="790255" packets_and_frames.frame.10.pkt_size="2048" packets_and_frames.frame.10.sample_fmt="s16" @@ -382,7 +404,7 @@ packets_and_frames.packet.11.duration_time="0.008912" packets_and_frames.packet.11.size="786" packets_and_frames.packet.11.pos="792326" -packets_and_frames.packet.11.flags="K_" +packets_and_frames.packet.11.flags="K__" packets_and_frames.frame.11.media_type="audio" packets_and_frames.frame.11.stream_index=0 packets_and_frames.frame.11.key_frame=1 @@ -394,6 +416,8 @@ packets_and_frames.frame.11.best_effort_timestamp_time="0.116100" packets_and_frames.frame.11.pkt_duration=393 packets_and_frames.frame.11.pkt_duration_time="0.008912" +packets_and_frames.frame.11.duration=393 +packets_and_frames.frame.11.duration_time="0.008912" packets_and_frames.frame.11.pkt_pos="792326" packets_and_frames.frame.11.pkt_size="786" packets_and_frames.frame.11.sample_fmt="s16" @@ -410,7 +434,7 @@ packets_and_frames.packet.12.duration_time="0.040000" packets_and_frames.packet.12.size="230400" packets_and_frames.packet.12.pos="793142" -packets_and_frames.packet.12.flags="K_" +packets_and_frames.packet.12.flags="K__" packets_and_frames.frame.12.media_type="video" packets_and_frames.frame.12.stream_index=1 packets_and_frames.frame.12.key_frame=1 @@ -422,6 +446,8 @@ packets_and_frames.frame.12.best_effort_timestamp_time="0.120000" packets_and_frames.frame.12.pkt_duration=2048 packets_and_frames.frame.12.pkt_duration_time="0.040000" +packets_and_frames.frame.12.duration=2048 +packets_and_frames.frame.12.duration_time="0.040000" packets_and_frames.frame.12.pkt_pos="793142" packets_and_frames.frame.12.pkt_size="230400" packets_and_frames.frame.12.width=320 @@ -449,7 +475,7 @@ packets_and_frames.packet.13.duration_time="0.040000" packets_and_frames.packet.13.size="30000" packets_and_frames.packet.13.pos="1023566" -packets_and_frames.packet.13.flags="K_" +packets_and_frames.packet.13.flags="K__" packets_and_frames.frame.13.media_type="video" packets_and_frames.frame.13.stream_index=2 packets_and_frames.frame.13.key_frame=1 @@ -461,6 +487,8 @@ packets_and_frames.frame.13.best_effort_timestamp_time="0.120000" packets_and_frames.frame.13.pkt_duration=2048 packets_and_frames.frame.13.pkt_duration_time="0.040000" +packets_and_frames.frame.13.duration=2048 +packets_and_frames.frame.13.duration_time="0.040000" packets_and_frames.frame.13.pkt_pos="1023566" packets_and_frames.frame.13.pkt_size="30000" packets_and_frames.frame.13.width=100 @@ -489,6 +517,7 @@ streams.stream.0.channels=1 streams.stream.0.channel_layout="unknown" streams.stream.0.bits_per_sample=16 +streams.stream.0.initial_padding=0 streams.stream.0.id="N/A" streams.stream.0.r_frame_rate="0/0" streams.stream.0.avg_frame_rate="0/0" diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_ini mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_ini --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_ini 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_ini 2023-03-03 13:29:59.000000000 +0000 @@ -11,7 +11,7 @@ duration_time=0.023220 size=2048 pos=669 -flags=K_ +flags=K__ [packets_and_frames.frame.0] media_type=audio @@ -25,6 +25,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=669 pkt_size=2048 sample_fmt=s16 @@ -43,7 +45,7 @@ duration_time=0.040000 size=230400 pos=2744 -flags=K_ +flags=K__ [packets_and_frames.frame.1] media_type=video @@ -57,6 +59,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=2744 pkt_size=230400 width=320 @@ -86,7 +90,7 @@ duration_time=0.040000 size=30000 pos=233165 -flags=K_ +flags=K__ [packets_and_frames.frame.2] media_type=video @@ -100,6 +104,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=233165 pkt_size=30000 width=100 @@ -129,7 +135,7 @@ duration_time=0.023220 size=2048 pos=263170 -flags=K_ +flags=K__ [packets_and_frames.frame.3] media_type=audio @@ -143,6 +149,8 @@ best_effort_timestamp_time=0.023220 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=263170 pkt_size=2048 sample_fmt=s16 @@ -161,7 +169,7 @@ duration_time=0.040000 size=230400 pos=265248 -flags=K_ +flags=K__ [packets_and_frames.frame.4] media_type=video @@ -175,6 +183,8 @@ best_effort_timestamp_time=0.040000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=265248 pkt_size=230400 width=320 @@ -204,7 +214,7 @@ duration_time=0.040000 size=30000 pos=495672 -flags=K_ +flags=K__ [packets_and_frames.frame.5] media_type=video @@ -218,6 +228,8 @@ best_effort_timestamp_time=0.040000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=495672 pkt_size=30000 width=100 @@ -247,7 +259,7 @@ duration_time=0.023220 size=2048 pos=525677 -flags=K_ +flags=K__ [packets_and_frames.frame.6] media_type=audio @@ -261,6 +273,8 @@ best_effort_timestamp_time=0.046440 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=525677 pkt_size=2048 sample_fmt=s16 @@ -279,7 +293,7 @@ duration_time=0.023220 size=2048 pos=527748 -flags=K_ +flags=K__ [packets_and_frames.frame.7] media_type=audio @@ -293,6 +307,8 @@ best_effort_timestamp_time=0.069660 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=527748 pkt_size=2048 sample_fmt=s16 @@ -311,7 +327,7 @@ duration_time=0.040000 size=230400 pos=529826 -flags=K_ +flags=K__ [packets_and_frames.frame.8] media_type=video @@ -325,6 +341,8 @@ best_effort_timestamp_time=0.080000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=529826 pkt_size=230400 width=320 @@ -354,7 +372,7 @@ duration_time=0.040000 size=30000 pos=760250 -flags=K_ +flags=K__ [packets_and_frames.frame.9] media_type=video @@ -368,6 +386,8 @@ best_effort_timestamp_time=0.080000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=760250 pkt_size=30000 width=100 @@ -397,7 +417,7 @@ duration_time=0.023220 size=2048 pos=790255 -flags=K_ +flags=K__ [packets_and_frames.frame.10] media_type=audio @@ -411,6 +431,8 @@ best_effort_timestamp_time=0.092880 pkt_duration=1024 pkt_duration_time=0.023220 +duration=1024 +duration_time=0.023220 pkt_pos=790255 pkt_size=2048 sample_fmt=s16 @@ -429,7 +451,7 @@ duration_time=0.008912 size=786 pos=792326 -flags=K_ +flags=K__ [packets_and_frames.frame.11] media_type=audio @@ -443,6 +465,8 @@ best_effort_timestamp_time=0.116100 pkt_duration=393 pkt_duration_time=0.008912 +duration=393 +duration_time=0.008912 pkt_pos=792326 pkt_size=786 sample_fmt=s16 @@ -461,7 +485,7 @@ duration_time=0.040000 size=230400 pos=793142 -flags=K_ +flags=K__ [packets_and_frames.frame.12] media_type=video @@ -475,6 +499,8 @@ best_effort_timestamp_time=0.120000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=793142 pkt_size=230400 width=320 @@ -504,7 +530,7 @@ duration_time=0.040000 size=30000 pos=1023566 -flags=K_ +flags=K__ [packets_and_frames.frame.13] media_type=video @@ -518,6 +544,8 @@ best_effort_timestamp_time=0.120000 pkt_duration=2048 pkt_duration_time=0.040000 +duration=2048 +duration_time=0.040000 pkt_pos=1023566 pkt_size=30000 width=100 @@ -548,6 +576,7 @@ channels=1 channel_layout=unknown bits_per_sample=16 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_json mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_json --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_json 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_json 2023-03-03 13:29:59.000000000 +0000 @@ -12,7 +12,7 @@ "duration_time": "0.023220", "size": "2048", "pos": "669", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -27,6 +27,8 @@ "best_effort_timestamp_time": "0.000000", "pkt_duration": 1024, "pkt_duration_time": "0.023220", + "duration": 1024, + "duration_time": "0.023220", "pkt_pos": "669", "pkt_size": "2048", "sample_fmt": "s16", @@ -45,7 +47,7 @@ "duration_time": "0.040000", "size": "230400", "pos": "2744", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -60,6 +62,8 @@ "best_effort_timestamp_time": "0.000000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "2744", "pkt_size": "230400", "width": 320, @@ -85,7 +89,7 @@ "duration_time": "0.040000", "size": "30000", "pos": "233165", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -100,6 +104,8 @@ "best_effort_timestamp_time": "0.000000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "233165", "pkt_size": "30000", "width": 100, @@ -125,7 +131,7 @@ "duration_time": "0.023220", "size": "2048", "pos": "263170", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -140,6 +146,8 @@ "best_effort_timestamp_time": "0.023220", "pkt_duration": 1024, "pkt_duration_time": "0.023220", + "duration": 1024, + "duration_time": "0.023220", "pkt_pos": "263170", "pkt_size": "2048", "sample_fmt": "s16", @@ -158,7 +166,7 @@ "duration_time": "0.040000", "size": "230400", "pos": "265248", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -173,6 +181,8 @@ "best_effort_timestamp_time": "0.040000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "265248", "pkt_size": "230400", "width": 320, @@ -198,7 +208,7 @@ "duration_time": "0.040000", "size": "30000", "pos": "495672", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -213,6 +223,8 @@ "best_effort_timestamp_time": "0.040000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "495672", "pkt_size": "30000", "width": 100, @@ -238,7 +250,7 @@ "duration_time": "0.023220", "size": "2048", "pos": "525677", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -253,6 +265,8 @@ "best_effort_timestamp_time": "0.046440", "pkt_duration": 1024, "pkt_duration_time": "0.023220", + "duration": 1024, + "duration_time": "0.023220", "pkt_pos": "525677", "pkt_size": "2048", "sample_fmt": "s16", @@ -271,7 +285,7 @@ "duration_time": "0.023220", "size": "2048", "pos": "527748", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -286,6 +300,8 @@ "best_effort_timestamp_time": "0.069660", "pkt_duration": 1024, "pkt_duration_time": "0.023220", + "duration": 1024, + "duration_time": "0.023220", "pkt_pos": "527748", "pkt_size": "2048", "sample_fmt": "s16", @@ -304,7 +320,7 @@ "duration_time": "0.040000", "size": "230400", "pos": "529826", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -319,6 +335,8 @@ "best_effort_timestamp_time": "0.080000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "529826", "pkt_size": "230400", "width": 320, @@ -344,7 +362,7 @@ "duration_time": "0.040000", "size": "30000", "pos": "760250", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -359,6 +377,8 @@ "best_effort_timestamp_time": "0.080000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "760250", "pkt_size": "30000", "width": 100, @@ -384,7 +404,7 @@ "duration_time": "0.023220", "size": "2048", "pos": "790255", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -399,6 +419,8 @@ "best_effort_timestamp_time": "0.092880", "pkt_duration": 1024, "pkt_duration_time": "0.023220", + "duration": 1024, + "duration_time": "0.023220", "pkt_pos": "790255", "pkt_size": "2048", "sample_fmt": "s16", @@ -417,7 +439,7 @@ "duration_time": "0.008912", "size": "786", "pos": "792326", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -432,6 +454,8 @@ "best_effort_timestamp_time": "0.116100", "pkt_duration": 393, "pkt_duration_time": "0.008912", + "duration": 393, + "duration_time": "0.008912", "pkt_pos": "792326", "pkt_size": "786", "sample_fmt": "s16", @@ -450,7 +474,7 @@ "duration_time": "0.040000", "size": "230400", "pos": "793142", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -465,6 +489,8 @@ "best_effort_timestamp_time": "0.120000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "793142", "pkt_size": "230400", "width": 320, @@ -490,7 +516,7 @@ "duration_time": "0.040000", "size": "30000", "pos": "1023566", - "flags": "K_" + "flags": "K__" }, { "type": "frame", @@ -505,6 +531,8 @@ "best_effort_timestamp_time": "0.120000", "pkt_duration": 2048, "pkt_duration_time": "0.040000", + "duration": 2048, + "duration_time": "0.040000", "pkt_pos": "1023566", "pkt_size": "30000", "width": 100, @@ -530,6 +558,7 @@ "sample_rate": "44100", "channels": 1, "bits_per_sample": 16, + "initial_padding": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/44100", diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xml mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xml --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xml 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xml 2023-03-03 13:29:59.000000000 +0000 @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xsd mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xsd --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xsd 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ffprobe_xsd 2023-03-03 13:29:59.000000000 +0000 @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-fps-r mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-fps-r --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-fps-r 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-fps-r 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -#tb 0: 1/30 -#media_type 0: video -#codec_id 0: rawvideo -#dimensions 0: 112x182 -#sar 0: 0/1 -0, 0, 0, 1, 30576, 0xcdc29b3d -0, 1, 1, 1, 30576, 0xcdc29b3d -0, 2, 2, 1, 30576, 0xcdc29b3d -0, 4, 4, 1, 30576, 0xcdc29b3d -0, 5, 5, 1, 30576, 0xcdc29b3d -0, 6, 6, 1, 30576, 0x5c83656c -0, 7, 7, 1, 30576, 0x5c83656c -0, 8, 8, 1, 30576, 0x5c83656c -0, 10, 10, 1, 30576, 0x5c83656c -0, 11, 11, 1, 30576, 0x5c83656c -0, 12, 12, 1, 30576, 0x5c83656c -0, 13, 13, 1, 30576, 0x26b67f83 -0, 14, 14, 1, 30576, 0x26b67f83 -0, 16, 16, 1, 30576, 0x26b67f83 -0, 17, 17, 1, 30576, 0x26b67f83 -0, 18, 18, 1, 30576, 0x26b67f83 -0, 19, 19, 1, 30576, 0x26b67f83 -0, 20, 20, 1, 30576, 0x26b67f83 -0, 22, 22, 1, 30576, 0x26b67f83 -0, 23, 23, 1, 30576, 0x26b67f83 -0, 24, 24, 1, 30576, 0x26b67f83 -0, 25, 25, 1, 30576, 0x26b67f83 -0, 26, 26, 1, 30576, 0x26b67f83 -0, 28, 28, 1, 30576, 0x26b67f83 -0, 29, 29, 1, 30576, 0x26b67f83 -0, 30, 30, 1, 30576, 0x26b67f83 -0, 31, 31, 1, 30576, 0x26b67f83 -0, 32, 32, 1, 30576, 0x26b67f83 -0, 34, 34, 1, 30576, 0x26b67f83 -0, 35, 35, 1, 30576, 0x26b67f83 -0, 36, 36, 1, 30576, 0x26b67f83 -0, 37, 37, 1, 30576, 0x26b67f83 -0, 38, 38, 1, 30576, 0x26b67f83 -0, 40, 40, 1, 30576, 0x26b67f83 -0, 41, 41, 1, 30576, 0x26b67f83 -0, 42, 42, 1, 30576, 0x26b67f83 -0, 43, 43, 1, 30576, 0x26b67f83 -0, 44, 44, 1, 30576, 0x26b67f83 -0, 46, 46, 1, 30576, 0x26b67f83 -0, 47, 47, 1, 30576, 0x26b67f83 -0, 48, 48, 1, 30576, 0x26b67f83 -0, 49, 49, 1, 30576, 0x26b67f83 -0, 50, 50, 1, 30576, 0x26b67f83 -0, 52, 52, 1, 30576, 0x26b67f83 -0, 53, 53, 1, 30576, 0x26b67f83 -0, 54, 54, 1, 30576, 0x26b67f83 -0, 55, 55, 1, 30576, 0x26b67f83 -0, 56, 56, 1, 30576, 0x26b67f83 -0, 58, 58, 1, 30576, 0x26b67f83 -0, 59, 59, 1, 30576, 0x26b67f83 -0, 60, 60, 1, 30576, 0x26b67f83 -0, 61, 61, 1, 30576, 0x26b67f83 -0, 62, 62, 1, 30576, 0x26b67f83 -0, 64, 64, 1, 30576, 0x26b67f83 -0, 65, 65, 1, 30576, 0x26b67f83 -0, 66, 66, 1, 30576, 0x26b67f83 -0, 67, 67, 1, 30576, 0x26b67f83 -0, 68, 68, 1, 30576, 0x26b67f83 -0, 70, 70, 1, 30576, 0x26b67f83 -0, 71, 71, 1, 30576, 0x26b67f83 -0, 72, 72, 1, 30576, 0x26b67f83 -0, 73, 73, 1, 30576, 0xa2fcd06f -0, 74, 74, 1, 30576, 0xa2fcd06f -0, 76, 76, 1, 30576, 0xa2fcd06f -0, 77, 77, 1, 30576, 0xa2fcd06f -0, 78, 78, 1, 30576, 0xa2fcd06f -0, 79, 79, 1, 30576, 0xa2fcd06f -0, 80, 80, 1, 30576, 0xa2fcd06f -0, 82, 82, 1, 30576, 0xd4150aad -0, 83, 83, 1, 30576, 0xd4150aad -0, 84, 84, 1, 30576, 0xd4150aad -0, 85, 85, 1, 30576, 0xd4150aad -0, 86, 86, 1, 30576, 0xd4150aad diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-meta-4560-rotate0 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-meta-4560-rotate0 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-meta-4560-rotate0 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-meta-4560-rotate0 2023-03-03 13:29:59.000000000 +0000 @@ -16,254 +16,254 @@ 0, 1, 1, 1, 195840, 0xcad55625 1, 2048, 2048, 1024, 2048, 0x9275068a 0, 2, 2, 1, 195840, 0x1a47a5ca -1, 3072, 3072, 1024, 2048, 0xcd35a7ce -1, 4096, 4096, 1024, 2048, 0x3f846a1e +1, 3072, 3072, 1024, 2048, 0xcecba7cf +1, 4096, 4096, 1024, 2048, 0x39006a1d 0, 3, 3, 1, 195840, 0x5cd02d7c -1, 5120, 5120, 1024, 2048, 0x60ff5fd1 +1, 5120, 5120, 1024, 2048, 0x59795fd0 0, 4, 4, 1, 195840, 0x07d08f16 -1, 6144, 6144, 1024, 2048, 0x9e9d96ee -1, 7168, 7168, 1024, 2048, 0xb2622c29 +1, 6144, 6144, 1024, 2048, 0x9a7796ec +1, 7168, 7168, 1024, 2048, 0xb7da2c2b 0, 5, 5, 1, 195840, 0xe8abf6dd -1, 8192, 8192, 1024, 2048, 0xdeddcd6a +1, 8192, 8192, 1024, 2048, 0xe4efcd6a 0, 6, 6, 1, 195840, 0x096a5c58 -1, 9216, 9216, 1024, 2048, 0xc8798b23 -1, 10240, 10240, 1024, 2048, 0xea1dac49 +1, 9216, 9216, 1024, 2048, 0xbfa78b21 +1, 10240, 10240, 1024, 2048, 0xeeddac49 0, 7, 7, 1, 195840, 0x4e1a17bd -1, 11264, 11264, 1024, 2048, 0x6b50813e +1, 11264, 11264, 1024, 2048, 0x72d28140 0, 8, 8, 1, 195840, 0x96349c20 -1, 12288, 12288, 1024, 2048, 0x89698347 +1, 12288, 12288, 1024, 2048, 0xa03f834c 0, 9, 9, 1, 195840, 0x6bb16907 -1, 13312, 13312, 1024, 2048, 0xaa608a47 -1, 14336, 14336, 1024, 2048, 0x169b8cf7 +1, 13312, 13312, 1024, 2048, 0xb1168a48 +1, 14336, 14336, 1024, 2048, 0x1b258cf9 0, 10, 10, 1, 195840, 0x7e44e4dd -1, 15360, 15360, 1024, 2048, 0x2f127455 +1, 15360, 15360, 1024, 2048, 0x35e07458 0, 11, 11, 1, 195840, 0x4c3c0cf1 -1, 16384, 16384, 1024, 2048, 0x269c7583 -1, 17408, 17408, 1024, 2048, 0x917f7279 +1, 16384, 16384, 1024, 2048, 0x21d07582 +1, 17408, 17408, 1024, 2048, 0x847f7276 0, 12, 12, 1, 195840, 0x4f2e3f2d -1, 18432, 18432, 1024, 2048, 0x27055ffb +1, 18432, 18432, 1024, 2048, 0x080f5ff4 0, 13, 13, 1, 195840, 0xcba539cd -1, 19456, 19456, 1024, 2048, 0x7eca49e4 -1, 20480, 20480, 1024, 2048, 0xad067184 +1, 19456, 19456, 1024, 2048, 0x714049e3 +1, 20480, 20480, 1024, 2048, 0xaf8c7186 0, 14, 14, 1, 195840, 0xf2811c9b -1, 21504, 21504, 1024, 2048, 0xca406454 +1, 21504, 21504, 1024, 2048, 0xc3666452 0, 15, 15, 1, 195840, 0x8357eab2 -1, 22528, 22528, 1024, 2048, 0x69d48a55 +1, 22528, 22528, 1024, 2048, 0x5b088a52 0, 16, 16, 1, 195840, 0xdba9c438 -1, 23552, 23552, 1024, 2048, 0x0a836c14 -1, 24576, 24576, 1024, 2048, 0xa9e967f9 +1, 23552, 23552, 1024, 2048, 0x0bab6c14 +1, 24576, 24576, 1024, 2048, 0xaaa967f8 0, 17, 17, 1, 195840, 0x58bcb594 -1, 25600, 25600, 1024, 2048, 0xd7f73f35 +1, 25600, 25600, 1024, 2048, 0xcc3d3f34 0, 18, 18, 1, 195840, 0x3edc5a1c -1, 26624, 26624, 1024, 2048, 0x70ed8364 -1, 27648, 27648, 1024, 2048, 0x913f9b73 +1, 26624, 26624, 1024, 2048, 0x6bdd8363 +1, 27648, 27648, 1024, 2048, 0xdc6a9d71 0, 19, 19, 1, 195840, 0x94e4c186 -1, 28672, 28672, 1024, 2048, 0x7db083eb +1, 28672, 28672, 1024, 2048, 0x751883ea 0, 20, 20, 1, 195840, 0xffad5f59 -1, 29696, 29696, 1024, 2048, 0x951b97a9 -1, 30720, 30720, 1024, 2048, 0x072ea78e +1, 29696, 29696, 1024, 2048, 0x922997a8 +1, 30720, 30720, 1024, 2048, 0x0626a78f 0, 21, 21, 1, 195840, 0x84d1b114 -1, 31744, 31744, 1024, 2048, 0x9b127ba5 +1, 31744, 31744, 1024, 2048, 0x9c347ba6 0, 22, 22, 1, 195840, 0x358c1d0a -1, 32768, 32768, 1024, 2048, 0x051c90c0 -1, 33792, 33792, 1024, 2048, 0x232d93b5 +1, 32768, 32768, 1024, 2048, 0x020e90bf +1, 33792, 33792, 1024, 2048, 0x2c4993b6 0, 23, 23, 1, 195840, 0x3ed1ffc8 -1, 34816, 34816, 1024, 2048, 0x76b89477 +1, 34816, 34816, 1024, 2048, 0x7a989478 0, 24, 24, 1, 195840, 0xf048f47c -1, 35840, 35840, 1024, 2048, 0x50b2568d +1, 35840, 35840, 1024, 2048, 0x3e7c568a 0, 25, 25, 1, 195840, 0x3c2a3de6 -1, 36864, 36864, 1024, 2048, 0x97947e5e -1, 37888, 37888, 1024, 2048, 0x21569819 +1, 36864, 36864, 1024, 2048, 0x8e5e7e5d +1, 37888, 37888, 1024, 2048, 0x16349816 0, 26, 26, 1, 195840, 0x7ca208b1 -1, 38912, 38912, 1024, 2048, 0xc4358de4 +1, 38912, 38912, 1024, 2048, 0xccef8de5 0, 27, 27, 1, 195840, 0x105cf9fc -1, 39936, 39936, 1024, 2048, 0x69964977 -1, 40960, 40960, 1024, 2048, 0xef81892e +1, 39936, 39936, 1024, 2048, 0x6e904977 +1, 40960, 40960, 1024, 2048, 0xa69f872d 0, 28, 28, 1, 195840, 0x9fe50c29 -1, 41984, 41984, 1024, 2048, 0x6f7084e7 +1, 41984, 41984, 1024, 2048, 0x7dc788e5 0, 29, 29, 1, 195840, 0xb459720f -1, 43008, 43008, 1024, 2048, 0x7be080f7 -1, 44032, 44032, 1024, 2048, 0xadb18939 +1, 43008, 43008, 1024, 2048, 0x7b7c80f7 +1, 44032, 44032, 1024, 2048, 0xa9ef8939 0, 30, 30, 1, 195840, 0x6eda17b0 -1, 45056, 45056, 1024, 2048, 0x6cd9506d +1, 45056, 45056, 1024, 2048, 0x6b9b506d 0, 31, 31, 1, 195840, 0x098871b0 -1, 46080, 46080, 1024, 2048, 0xba88ab8b +1, 46080, 46080, 1024, 2048, 0xb55cab8a 0, 32, 32, 1, 195840, 0xc664cc79 -1, 47104, 47104, 1024, 2048, 0xe0bd726b -1, 48128, 48128, 1024, 2048, 0x15604a65 +1, 47104, 47104, 1024, 2048, 0xd1eb7268 +1, 48128, 48128, 1024, 2048, 0x104e4a65 0, 33, 33, 1, 195840, 0x8d02708d -1, 49152, 49152, 1024, 2048, 0x2a89f85b +1, 49152, 49152, 1024, 2048, 0x28f1f85a 0, 34, 34, 1, 195840, 0xe90a8705 -1, 50176, 50176, 1024, 2048, 0xd71857dd -1, 51200, 51200, 1024, 2048, 0x93d98aee +1, 50176, 50176, 1024, 2048, 0x841a55de +1, 51200, 51200, 1024, 2048, 0x90f58aed 0, 35, 35, 1, 195840, 0x55f6c5b6 -1, 52224, 52224, 1024, 2048, 0xcc537c08 +1, 52224, 52224, 1024, 2048, 0xbeb17c04 0, 36, 36, 1, 195840, 0xe4ad145d -1, 53248, 53248, 1024, 2048, 0xe0ea7c21 -1, 54272, 54272, 1024, 2048, 0x883ba380 +1, 53248, 53248, 1024, 2048, 0xe9247c23 +1, 54272, 54272, 1024, 2048, 0x8995a383 0, 37, 37, 1, 195840, 0x9e766d50 -1, 55296, 55296, 1024, 2048, 0xaaf65ca7 +1, 55296, 55296, 1024, 2048, 0xa4805ca7 0, 38, 38, 1, 195840, 0xc2eac289 -1, 56320, 56320, 1024, 2048, 0xe01e98ca +1, 56320, 56320, 1024, 2048, 0xedec98ca 0, 39, 39, 1, 195840, 0x0baf5871 -1, 57344, 57344, 1024, 2048, 0xca85a551 -1, 58368, 58368, 1024, 2048, 0x6fea7f82 +1, 57344, 57344, 1024, 2048, 0xc495a551 +1, 58368, 58368, 1024, 2048, 0x76d07f84 0, 40, 40, 1, 195840, 0x15f85f38 -1, 59392, 59392, 1024, 2048, 0x9fd59843 +1, 59392, 59392, 1024, 2048, 0x9a159842 0, 41, 41, 1, 195840, 0x77b03072 -1, 60416, 60416, 1024, 2048, 0xd7419d35 -1, 61440, 61440, 1024, 2048, 0xc285bc0e +1, 60416, 60416, 1024, 2048, 0xddcb9d36 +1, 61440, 61440, 1024, 2048, 0xc1abbc0d 0, 42, 42, 1, 195840, 0x0abb7abf -1, 62464, 62464, 1024, 2048, 0x5180419c +1, 62464, 62464, 1024, 2048, 0x5754419e 0, 43, 43, 1, 195840, 0x05076724 -1, 63488, 63488, 1024, 2048, 0xac9fd91b +1, 63488, 63488, 1024, 2048, 0xabd3d91a 1, 64512, 64512, 1024, 2048, 0x6de689b3 0, 44, 44, 1, 195840, 0x2e8c6163 -1, 65536, 65536, 1024, 2048, 0x655bb415 +1, 65536, 65536, 1024, 2048, 0x6c67b415 0, 45, 45, 1, 195840, 0x4f350cde -1, 66560, 66560, 1024, 2048, 0xe59d7404 -1, 67584, 67584, 1024, 2048, 0xaa9356b9 +1, 66560, 66560, 1024, 2048, 0xdb637402 +1, 67584, 67584, 1024, 2048, 0xb56156bb 0, 46, 46, 1, 195840, 0xefc6bda1 -1, 68608, 68608, 1024, 2048, 0xe193549d +1, 68608, 68608, 1024, 2048, 0xebf5549e 0, 47, 47, 1, 195840, 0xe2cdee68 -1, 69632, 69632, 1024, 2048, 0xd05c9736 +1, 69632, 69632, 1024, 2048, 0xccda9735 0, 48, 48, 1, 195840, 0xcc62401e -1, 70656, 70656, 1024, 2048, 0x086f6829 -1, 71680, 71680, 1024, 2048, 0x79624f93 +1, 70656, 70656, 1024, 2048, 0xff4e6828 +1, 71680, 71680, 1024, 2048, 0x77d84f92 0, 49, 49, 1, 195840, 0x4ed76e1b -1, 72704, 72704, 1024, 2048, 0xf70a2f21 +1, 72704, 72704, 1024, 2048, 0xf28a2f20 0, 50, 50, 1, 195840, 0xf4f8599a -1, 73728, 73728, 1024, 2048, 0xd32c643c +1, 73728, 73728, 1024, 2048, 0xda70643c 1, 74752, 74752, 1024, 2048, 0xd6f07035 0, 51, 51, 1, 195840, 0xb05edf96 -1, 75776, 75776, 1024, 2048, 0x137c6ca0 +1, 75776, 75776, 1024, 2048, 0x23e66ca2 0, 52, 52, 1, 195840, 0xfb1a1e15 -1, 76800, 76800, 1024, 2048, 0x916242de -1, 77824, 77824, 1024, 2048, 0x0d910367 +1, 76800, 76800, 1024, 2048, 0x8f5842dd +1, 77824, 77824, 1024, 2048, 0xfd580364 0, 53, 53, 1, 195840, 0x970ebb58 -1, 78848, 78848, 1024, 2048, 0x460b8f1e +1, 78848, 78848, 1024, 2048, 0x441d8f1e 0, 54, 54, 1, 195840, 0xf4046957 -1, 79872, 79872, 1024, 2048, 0x616a6102 +1, 79872, 79872, 1024, 2048, 0x5fcc6101 0, 55, 55, 1, 195840, 0xd5eca339 -1, 80896, 80896, 1024, 2048, 0xfc507e1d -1, 81920, 81920, 1024, 2048, 0x34accc94 +1, 80896, 80896, 1024, 2048, 0x05097c1f +1, 81920, 81920, 1024, 2048, 0x3226cc96 0, 56, 56, 1, 195840, 0x52d3cb24 -1, 82944, 82944, 1024, 2048, 0xcf679f1a +1, 82944, 82944, 1024, 2048, 0xa981a118 0, 57, 57, 1, 195840, 0x259cac47 -1, 83968, 83968, 1024, 2048, 0x72c45d8a -1, 84992, 84992, 1024, 2048, 0xfd21264a +1, 83968, 83968, 1024, 2048, 0x7d705d8e +1, 84992, 84992, 1024, 2048, 0xfd8d264a 0, 58, 58, 1, 195840, 0x9190a95b -1, 86016, 86016, 1024, 2048, 0x02895c31 +1, 86016, 86016, 1024, 2048, 0x01875c2f 0, 59, 59, 1, 195840, 0x5baccfb5 -1, 87040, 87040, 1024, 2048, 0xdc041e9c +1, 87040, 87040, 1024, 2048, 0xdaf01e9d 1, 88064, 88064, 1024, 2048, 0x266407a5 0, 60, 60, 1, 195840, 0x80d19a09 -1, 89088, 89088, 1024, 2048, 0x8f111c49 +1, 89088, 89088, 1024, 2048, 0x92951c49 0, 61, 61, 1, 195840, 0x5ad44ce3 -1, 90112, 90112, 1024, 2048, 0xead031dd -1, 91136, 91136, 1024, 2048, 0x238325d4 +1, 90112, 90112, 1024, 2048, 0xec2031dd +1, 91136, 91136, 1024, 2048, 0x18bf25d2 0, 62, 62, 1, 195840, 0x7b1ad12b -1, 92160, 92160, 1024, 2048, 0x24171913 +1, 92160, 92160, 1024, 2048, 0x21a71912 0, 63, 63, 1, 195840, 0x57e1a5e5 -1, 93184, 93184, 1024, 2048, 0xbcda41c5 +1, 93184, 93184, 1024, 2048, 0xc25841c7 0, 64, 64, 1, 195840, 0x70cb6d38 -1, 94208, 94208, 1024, 2048, 0x124f5eed -1, 95232, 95232, 1024, 2048, 0x4cadc088 +1, 94208, 94208, 1024, 2048, 0x05955eeb +1, 95232, 95232, 1024, 2048, 0x490dc087 0, 65, 65, 1, 195840, 0x39dac35a -1, 96256, 96256, 1024, 2048, 0x062cd95a +1, 96256, 96256, 1024, 2048, 0x055ed95a 0, 66, 66, 1, 195840, 0x4f9fccca -1, 97280, 97280, 1024, 2048, 0xc26a888d -1, 98304, 98304, 1024, 2048, 0x864f1a68 +1, 97280, 97280, 1024, 2048, 0xc356888f +1, 98304, 98304, 1024, 2048, 0x93bf1a6c 0, 67, 67, 1, 195840, 0xadcb5585 -1, 99328, 99328, 1024, 2048, 0x4bb1ecf4 +1, 99328, 99328, 1024, 2048, 0x4a5decf6 0, 68, 68, 1, 195840, 0xe596c1b4 -1, 100352, 100352, 1024, 2048, 0xb4ddc0a7 -1, 101376, 101376, 1024, 2048, 0x665badb3 +1, 100352, 100352, 1024, 2048, 0xfcf1c2a5 +1, 101376, 101376, 1024, 2048, 0x5ba9adaf 0, 69, 69, 1, 195840, 0x64a05339 -1, 102400, 102400, 1024, 2048, 0x70beaa68 +1, 102400, 102400, 1024, 2048, 0x4da1a86b 0, 70, 70, 1, 195840, 0xaefa0990 -1, 103424, 103424, 1024, 2048, 0x8ac7c7de +1, 103424, 103424, 1024, 2048, 0x7bcfc7da 0, 71, 71, 1, 195840, 0x9c0b5c3d -1, 104448, 104448, 1024, 2048, 0x158cad8e -1, 105472, 105472, 1024, 2048, 0x0ab8faf2 +1, 104448, 104448, 1024, 2048, 0x2274ad91 +1, 105472, 105472, 1024, 2048, 0x0484faf2 0, 72, 72, 1, 195840, 0xbae8bd6b -1, 106496, 106496, 1024, 2048, 0x994e79f1 +1, 106496, 106496, 1024, 2048, 0x994479f0 0, 73, 73, 1, 195840, 0xb2ac7857 -1, 107520, 107520, 1024, 2048, 0xc727104e -1, 108544, 108544, 1024, 2048, 0x1e1f720a +1, 107520, 107520, 1024, 2048, 0xcfff104f +1, 108544, 108544, 1024, 2048, 0x17877208 0, 74, 74, 1, 195840, 0xcf2865e3 -1, 109568, 109568, 1024, 2048, 0x7232bede +1, 109568, 109568, 1024, 2048, 0x79eabedf 0, 75, 75, 1, 195840, 0x4e8589af -1, 110592, 110592, 1024, 2048, 0x015fd697 -1, 111616, 111616, 1024, 2048, 0x4b33ebc9 +1, 110592, 110592, 1024, 2048, 0xfe84d697 +1, 111616, 111616, 1024, 2048, 0x5751ebcc 0, 76, 76, 1, 195840, 0x31c21938 -1, 112640, 112640, 1024, 2048, 0x8e61948a +1, 112640, 112640, 1024, 2048, 0x8ae59488 0, 77, 77, 1, 195840, 0xe6163c50 -1, 113664, 113664, 1024, 2048, 0x83fab6ac +1, 113664, 113664, 1024, 2048, 0x8870b6ae 0, 78, 78, 1, 195840, 0x888ef74f -1, 114688, 114688, 1024, 2048, 0x8d55d683 +1, 114688, 114688, 1024, 2048, 0x9255d684 1, 115712, 115712, 1024, 2048, 0x4e91a2c7 0, 79, 79, 1, 195840, 0x00d822f7 -1, 116736, 116736, 1024, 2048, 0x8c79c692 +1, 116736, 116736, 1024, 2048, 0x9895c693 0, 80, 80, 1, 195840, 0xcbe77d2b -1, 117760, 117760, 1024, 2048, 0xe744d102 -1, 118784, 118784, 1024, 2048, 0x2bf4e6b1 +1, 117760, 117760, 1024, 2048, 0xee96d102 +1, 118784, 118784, 1024, 2048, 0x3508e6b3 0, 81, 81, 1, 195840, 0x9f2ff6e5 -1, 119808, 119808, 1024, 2048, 0xd6fd9b91 +1, 119808, 119808, 1024, 2048, 0xd7a79b90 0, 82, 82, 1, 195840, 0x08f65f5f -1, 120832, 120832, 1024, 2048, 0xedcd8e8a -1, 121856, 121856, 1024, 2048, 0x67b422bd +1, 120832, 120832, 1024, 2048, 0xe77f8e88 +1, 121856, 121856, 1024, 2048, 0x623c22bd 0, 83, 83, 1, 195840, 0xd3950469 -1, 122880, 122880, 1024, 2048, 0xa0329606 +1, 122880, 122880, 1024, 2048, 0x9f989605 0, 84, 84, 1, 195840, 0xb8e014b8 -1, 123904, 123904, 1024, 2048, 0xae47c015 +1, 123904, 123904, 1024, 2048, 0xbbe1c017 1, 124928, 124928, 1024, 2048, 0xaec1dfb2 0, 85, 85, 1, 195840, 0xa4399742 -1, 125952, 125952, 1024, 2048, 0x719e9bac +1, 125952, 125952, 1024, 2048, 0x7c709bae 0, 86, 86, 1, 195840, 0x84b5a8ec -1, 126976, 126976, 1024, 2048, 0x5d99a16c +1, 126976, 126976, 1024, 2048, 0x55a1a16b 0, 87, 87, 1, 195840, 0x1bfaa027 -1, 128000, 128000, 1024, 2048, 0x87aacd09 -1, 129024, 129024, 1024, 2048, 0x1473be08 +1, 128000, 128000, 1024, 2048, 0x9a9ccd0e +1, 129024, 129024, 1024, 2048, 0x1087be07 0, 88, 88, 1, 195840, 0x7bdbb172 -1, 130048, 130048, 1024, 2048, 0xdee3d975 +1, 130048, 130048, 1024, 2048, 0xcd3bd974 0, 89, 89, 1, 195840, 0x00f2b3f7 -1, 131072, 131072, 1024, 2048, 0x0180b050 -1, 132096, 132096, 1024, 2048, 0xb035d915 +1, 131072, 131072, 1024, 2048, 0xfd43b04e +1, 132096, 132096, 1024, 2048, 0xb2add916 0, 90, 90, 1, 195840, 0x86503bc7 -1, 133120, 133120, 1024, 2048, 0x1b77a3fd +1, 133120, 133120, 1024, 2048, 0x156da3fc 0, 91, 91, 1, 195840, 0xc4ab358e -1, 134144, 134144, 1024, 2048, 0xf233b7bc -1, 135168, 135168, 1024, 2048, 0xf1fad173 +1, 134144, 134144, 1024, 2048, 0xf29fb7bb +1, 135168, 135168, 1024, 2048, 0xf19ed172 0, 92, 92, 1, 195840, 0x1b330ba0 -1, 136192, 136192, 1024, 2048, 0x8b6ac5b9 +1, 136192, 136192, 1024, 2048, 0x8094c5b7 0, 93, 93, 1, 195840, 0xccc9822f -1, 137216, 137216, 1024, 2048, 0x1228c03f +1, 137216, 137216, 1024, 2048, 0x16d0c040 0, 94, 94, 1, 195840, 0xffe3486d -1, 138240, 138240, 1024, 2048, 0xbe99cc61 -1, 139264, 139264, 1024, 2048, 0x8486bad7 +1, 138240, 138240, 1024, 2048, 0xc895cc63 +1, 139264, 139264, 1024, 2048, 0xd260b8d9 0, 95, 95, 1, 195840, 0x30dc0efe -1, 140288, 140288, 1024, 2048, 0x423ca644 +1, 140288, 140288, 1024, 2048, 0x3dcca644 0, 96, 96, 1, 195840, 0x6bfae71e -1, 141312, 141312, 1024, 2048, 0x33afb5a3 -1, 142336, 142336, 1024, 2048, 0x90c33f49 +1, 141312, 141312, 1024, 2048, 0x241bb5a1 +1, 142336, 142336, 1024, 2048, 0x980b3f4a 0, 97, 97, 1, 195840, 0x0fa017b8 -1, 143360, 143360, 1024, 2048, 0x0e59f9d7 +1, 143360, 143360, 1024, 2048, 0x05edf9d5 0, 98, 98, 1, 195840, 0x1d0c9810 -1, 144384, 144384, 1024, 2048, 0x4f513d3d -1, 145408, 145408, 1024, 2048, 0xe2f1406b +1, 144384, 144384, 1024, 2048, 0x4f8b3d3d +1, 145408, 145408, 1024, 2048, 0xe6b5406c 0, 99, 99, 1, 195840, 0x775778f0 -1, 146432, 146432, 1024, 2048, 0xe55d2a99 +1, 146432, 146432, 1024, 2048, 0xe9792a9a 0, 100, 100, 1, 195840, 0xdcb0ede5 -1, 147456, 147456, 1024, 2048, 0xb0e236c2 +1, 147456, 147456, 1024, 2048, 0xb54e36c3 0, 101, 101, 1, 195840, 0x67624270 -1, 148480, 148480, 1024, 2048, 0xdc80c8fb -1, 149504, 149504, 1024, 2048, 0x97c30778 +1, 148480, 148480, 1024, 2048, 0xd8ecc8f8 +1, 149504, 149504, 1024, 2048, 0x9f150779 0, 102, 102, 1, 195840, 0xce86f6a3 1, 150528, 150528, 1024, 2048, 0x6e403113 0, 103, 103, 1, 195840, 0xa4b3e032 -1, 151552, 151552, 1024, 2048, 0x429605a1 -1, 152576, 152576, 1024, 2048, 0x25d61b75 +1, 151552, 151552, 1024, 2048, 0x473a05a3 +1, 152576, 152576, 1024, 2048, 0x26721b75 0, 104, 104, 1, 195840, 0x46851b87 -1, 153600, 153600, 1024, 2048, 0xa32cf42d +1, 153600, 153600, 1024, 2048, 0x97a2f42c 0, 105, 105, 1, 195840, 0x02d97dc4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect 2023-03-03 13:29:59.000000000 +0000 @@ -1,32 +1,33 @@ -pts=0 +pts=0| + pts=400 -pts=800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=1200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=1600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=2000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=2400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=2800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=3200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=3600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=4000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=4400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=4800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=5200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=5600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=6000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=6400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=6800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=7200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=7600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=8000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=8400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=8800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=9200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=9600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=10000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=10400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=10800|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=11200|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=11600|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=12000|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 -pts=12400|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.y=68 +pts=800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=1200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=1600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=2000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=2400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=2800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=3200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=3600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=4000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=4400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=4800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=5200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=5600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=6000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=6400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=6800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=7200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=7600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=8000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=8400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=8800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=9200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=9600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=10000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=10400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=10800|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=11200|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=11600|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=12000|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 +pts=12400|tag:lavfi.cropdetect.y=68|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=719|tag:lavfi.cropdetect.y1=61|tag:lavfi.cropdetect.y2=424|tag:lavfi.cropdetect.w=720|tag:lavfi.cropdetect.h=352|tag:lavfi.cropdetect.x=0|tag:lavfi.cropdetect.limit=0.094118 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect1 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect1 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,11 @@ +pts=0| + +pts=1001| + +pts=2002|tag:lavfi.cropdetect.y=314|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=851|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=601|tag:lavfi.cropdetect.w=832|tag:lavfi.cropdetect.h=288|tag:lavfi.cropdetect.x=20|tag:lavfi.cropdetect.limit=0.094118| +pts=3003|tag:lavfi.cropdetect.y=316|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.limit=0.094118| +pts=4004|tag:lavfi.cropdetect.y=122|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.limit=0.094118| +pts=5005|tag:lavfi.cropdetect.y=316|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.limit=0.094118| +pts=6006|tag:lavfi.cropdetect.y=122|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.limit=0.094118| +pts=7007|tag:lavfi.cropdetect.y=122|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.limit=0.094118| +pts=8008|tag:lavfi.cropdetect.y=122|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.limit=0.094118| diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect2 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-cropdetect2 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,12 @@ +pts=0| + + +pts=512| + +pts=1024|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1200|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.limit=0.094118| +pts=1536|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1257|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1232|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=24|tag:lavfi.cropdetect.limit=0.094118| +pts=2048|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1200|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.limit=0.094118| +pts=2560|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1200|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.limit=0.094118| +pts=3072|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=817|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=937|tag:lavfi.cropdetect.w=784|tag:lavfi.cropdetect.h=912|tag:lavfi.cropdetect.x=28|tag:lavfi.cropdetect.limit=0.094118| +pts=3584|tag:lavfi.cropdetect.y=40|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=817|tag:lavfi.cropdetect.y1=38|tag:lavfi.cropdetect.y2=937|tag:lavfi.cropdetect.w=784|tag:lavfi.cropdetect.h=896|tag:lavfi.cropdetect.x=28|tag:lavfi.cropdetect.limit=0.094118| +pts=4096|tag:lavfi.cropdetect.y=22|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=817|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=937|tag:lavfi.cropdetect.w=784|tag:lavfi.cropdetect.h=912|tag:lavfi.cropdetect.x=28|tag:lavfi.cropdetect.limit=0.094118| diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-freezedetect mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-freezedetect --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-freezedetect 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-freezedetect 2023-03-03 13:29:59.000000000 +0000 @@ -151,7 +151,7 @@ pts=150 pts=151 pts=152 -pts=153|tag:lavfi.freezedetect.freeze_start=4.12|tag:lavfi.freezedetect.freeze_duration=2|tag:lavfi.freezedetect.freeze_end=6.12 +pts=153|tag:lavfi.freezedetect.freeze_duration=2|tag:lavfi.freezedetect.freeze_start=4.12|tag:lavfi.freezedetect.freeze_end=6.12 pts=154 pts=155 pts=156 @@ -202,7 +202,7 @@ pts=201 pts=202 pts=203 -pts=204|tag:lavfi.freezedetect.freeze_start=6.16|tag:lavfi.freezedetect.freeze_duration=2|tag:lavfi.freezedetect.freeze_end=8.16 +pts=204|tag:lavfi.freezedetect.freeze_duration=2|tag:lavfi.freezedetect.freeze_start=6.16|tag:lavfi.freezedetect.freeze_end=8.16 pts=205 pts=206 pts=207 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-scdet mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-scdet --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-scdet 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-scdet 2023-03-03 13:29:59.000000000 +0000 @@ -1,11 +1,11 @@ -pts=1620|tag:lavfi.scd.mafd=60.175|tag:lavfi.scd.score=59.252|tag:lavfi.scd.time=2.7 -pts=4140|tag:lavfi.scd.mafd=44.209|tag:lavfi.scd.score=36.070|tag:lavfi.scd.time=6.9 -pts=5800|tag:lavfi.scd.mafd=55.819|tag:lavfi.scd.score=55.819|tag:lavfi.scd.time=9.66667 -pts=6720|tag:lavfi.scd.mafd=22.505|tag:lavfi.scd.score=18.580|tag:lavfi.scd.time=11.2 -pts=8160|tag:lavfi.scd.mafd=49.444|tag:lavfi.scd.score=49.240|tag:lavfi.scd.time=13.6 -pts=9760|tag:lavfi.scd.mafd=51.801|tag:lavfi.scd.score=51.497|tag:lavfi.scd.time=16.2667 -pts=14080|tag:lavfi.scd.mafd=34.337|tag:lavfi.scd.score=34.165|tag:lavfi.scd.time=23.4667 -pts=15700|tag:lavfi.scd.mafd=58.315|tag:lavfi.scd.score=58.310|tag:lavfi.scd.time=26.1667 -pts=18500|tag:lavfi.scd.mafd=19.603|tag:lavfi.scd.score=16.504|tag:lavfi.scd.time=30.8333 -pts=20040|tag:lavfi.scd.mafd=19.060|tag:lavfi.scd.score=13.764|tag:lavfi.scd.time=33.4 -pts=21760|tag:lavfi.scd.mafd=64.551|tag:lavfi.scd.score=64.451|tag:lavfi.scd.time=36.2667 +pts=1620|tag:lavfi.scd.score=59.252|tag:lavfi.scd.mafd=60.175|tag:lavfi.scd.time=2.7 +pts=4140|tag:lavfi.scd.score=36.070|tag:lavfi.scd.mafd=44.209|tag:lavfi.scd.time=6.9 +pts=5800|tag:lavfi.scd.score=55.819|tag:lavfi.scd.mafd=55.819|tag:lavfi.scd.time=9.66667 +pts=6720|tag:lavfi.scd.score=18.580|tag:lavfi.scd.mafd=22.505|tag:lavfi.scd.time=11.2 +pts=8160|tag:lavfi.scd.score=49.240|tag:lavfi.scd.mafd=49.444|tag:lavfi.scd.time=13.6 +pts=9760|tag:lavfi.scd.score=51.497|tag:lavfi.scd.mafd=51.801|tag:lavfi.scd.time=16.2667 +pts=14080|tag:lavfi.scd.score=34.165|tag:lavfi.scd.mafd=34.337|tag:lavfi.scd.time=23.4667 +pts=15700|tag:lavfi.scd.score=58.310|tag:lavfi.scd.mafd=58.315|tag:lavfi.scd.time=26.1667 +pts=18500|tag:lavfi.scd.score=16.504|tag:lavfi.scd.mafd=19.603|tag:lavfi.scd.time=30.8333 +pts=20040|tag:lavfi.scd.score=13.764|tag:lavfi.scd.mafd=19.060|tag:lavfi.scd.time=33.4 +pts=21760|tag:lavfi.scd.score=64.451|tag:lavfi.scd.mafd=64.551|tag:lavfi.scd.time=36.2667 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -pts=0|tag:lavfi.signalstats.YMIN=235|tag:lavfi.signalstats.YLOW=235|tag:lavfi.signalstats.YAVG=235|tag:lavfi.signalstats.YHIGH=235|tag:lavfi.signalstats.YMAX=235|tag:lavfi.signalstats.UMIN=128|tag:lavfi.signalstats.ULOW=128|tag:lavfi.signalstats.UAVG=128|tag:lavfi.signalstats.UHIGH=128|tag:lavfi.signalstats.UMAX=128|tag:lavfi.signalstats.VMIN=128|tag:lavfi.signalstats.VLOW=128|tag:lavfi.signalstats.VAVG=128|tag:lavfi.signalstats.VHIGH=128|tag:lavfi.signalstats.VMAX=128|tag:lavfi.signalstats.SATMIN=0|tag:lavfi.signalstats.SATLOW=0|tag:lavfi.signalstats.SATAVG=0|tag:lavfi.signalstats.SATHIGH=0|tag:lavfi.signalstats.SATMAX=0|tag:lavfi.signalstats.HUEMED=180|tag:lavfi.signalstats.HUEAVG=180|tag:lavfi.signalstats.YDIF=0|tag:lavfi.signalstats.UDIF=0|tag:lavfi.signalstats.VDIF=0|tag:lavfi.signalstats.YBITDEPTH=6|tag:lavfi.signalstats.UBITDEPTH=1|tag:lavfi.signalstats.VBITDEPTH=1 +pts=0|tag:lavfi.signalstats.UBITDEPTH=1|tag:lavfi.signalstats.YMIN=235|tag:lavfi.signalstats.YLOW=235|tag:lavfi.signalstats.YAVG=235|tag:lavfi.signalstats.YHIGH=235|tag:lavfi.signalstats.YMAX=235|tag:lavfi.signalstats.UMIN=128|tag:lavfi.signalstats.ULOW=128|tag:lavfi.signalstats.UAVG=128|tag:lavfi.signalstats.UHIGH=128|tag:lavfi.signalstats.UMAX=128|tag:lavfi.signalstats.VMIN=128|tag:lavfi.signalstats.VLOW=128|tag:lavfi.signalstats.VAVG=128|tag:lavfi.signalstats.VHIGH=128|tag:lavfi.signalstats.VMAX=128|tag:lavfi.signalstats.SATMIN=0|tag:lavfi.signalstats.SATLOW=0|tag:lavfi.signalstats.SATAVG=0|tag:lavfi.signalstats.SATHIGH=0|tag:lavfi.signalstats.SATMAX=0|tag:lavfi.signalstats.HUEMED=180|tag:lavfi.signalstats.HUEAVG=180|tag:lavfi.signalstats.YDIF=0|tag:lavfi.signalstats.UDIF=0|tag:lavfi.signalstats.VDIF=0|tag:lavfi.signalstats.YBITDEPTH=6|tag:lavfi.signalstats.VBITDEPTH=1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p10 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-metadata-signalstats-yuv420p10 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -pts=0|tag:lavfi.signalstats.YMIN=943|tag:lavfi.signalstats.YLOW=943|tag:lavfi.signalstats.YAVG=943|tag:lavfi.signalstats.YHIGH=943|tag:lavfi.signalstats.YMAX=943|tag:lavfi.signalstats.UMIN=514|tag:lavfi.signalstats.ULOW=514|tag:lavfi.signalstats.UAVG=514|tag:lavfi.signalstats.UHIGH=514|tag:lavfi.signalstats.UMAX=514|tag:lavfi.signalstats.VMIN=514|tag:lavfi.signalstats.VLOW=514|tag:lavfi.signalstats.VAVG=514|tag:lavfi.signalstats.VHIGH=514|tag:lavfi.signalstats.VMAX=514|tag:lavfi.signalstats.SATMIN=2|tag:lavfi.signalstats.SATLOW=2|tag:lavfi.signalstats.SATAVG=2|tag:lavfi.signalstats.SATHIGH=2|tag:lavfi.signalstats.SATMAX=2|tag:lavfi.signalstats.HUEMED=225|tag:lavfi.signalstats.HUEAVG=225|tag:lavfi.signalstats.YDIF=0|tag:lavfi.signalstats.UDIF=0|tag:lavfi.signalstats.VDIF=0|tag:lavfi.signalstats.YBITDEPTH=8|tag:lavfi.signalstats.UBITDEPTH=2|tag:lavfi.signalstats.VBITDEPTH=2 +pts=0|tag:lavfi.signalstats.UBITDEPTH=2|tag:lavfi.signalstats.YMIN=943|tag:lavfi.signalstats.YLOW=943|tag:lavfi.signalstats.YAVG=943|tag:lavfi.signalstats.YHIGH=943|tag:lavfi.signalstats.YMAX=943|tag:lavfi.signalstats.UMIN=514|tag:lavfi.signalstats.ULOW=514|tag:lavfi.signalstats.UAVG=514|tag:lavfi.signalstats.UHIGH=514|tag:lavfi.signalstats.UMAX=514|tag:lavfi.signalstats.VMIN=514|tag:lavfi.signalstats.VLOW=514|tag:lavfi.signalstats.VAVG=514|tag:lavfi.signalstats.VHIGH=514|tag:lavfi.signalstats.VMAX=514|tag:lavfi.signalstats.SATMIN=2|tag:lavfi.signalstats.SATLOW=2|tag:lavfi.signalstats.SATAVG=2|tag:lavfi.signalstats.SATHIGH=2|tag:lavfi.signalstats.SATMAX=2|tag:lavfi.signalstats.HUEMED=225|tag:lavfi.signalstats.HUEAVG=225|tag:lavfi.signalstats.YDIF=0|tag:lavfi.signalstats.UDIF=0|tag:lavfi.signalstats.VDIF=0|tag:lavfi.signalstats.YBITDEPTH=8|tag:lavfi.signalstats.VBITDEPTH=2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-1 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 16x16 #sar 0: 1/1 -0, 0, 0, 1, 1024, 0x3395ef5a +0, 0, 0, 1, 1024, 0xa285dd77 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-palettegen-2 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 16x16 #sar 0: 1/1 -0, 0, 0, 1, 1024, 0x23e072c8 +0, 0, 0, 1, 1024, 0xf2286e18 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer 2023-03-03 13:29:59.000000000 +0000 @@ -3,74 +3,74 @@ #codec_id 0: rawvideo #dimensions 0: 320x180 #sar 0: 1/1 -0, 0, 0, 1, 230400, 0x7b259d08 -0, 1, 1, 1, 230400, 0xf04095e0 -0, 2, 2, 1, 230400, 0x84d49cd5 -0, 3, 3, 1, 230400, 0xd7a29aaf -0, 4, 4, 1, 230400, 0x9047947c -0, 5, 5, 1, 230400, 0xfeb990e7 -0, 6, 6, 1, 230400, 0x51ee9295 -0, 7, 7, 1, 230400, 0x66fd4833 -0, 8, 8, 1, 230400, 0x4c0948f0 -0, 9, 9, 1, 230400, 0x632b4776 -0, 10, 10, 1, 230400, 0x7a3c87e2 -0, 11, 11, 1, 230400, 0x4a9286ba -0, 12, 12, 1, 230400, 0x54dc8649 -0, 13, 13, 1, 230400, 0x92628944 -0, 14, 14, 1, 230400, 0x80f9899f -0, 15, 15, 1, 230400, 0x5cd78bd8 -0, 16, 16, 1, 230400, 0x4b4ca390 -0, 17, 17, 1, 230400, 0x82cca153 -0, 18, 18, 1, 230400, 0x65f1a2d0 -0, 19, 19, 1, 230400, 0x7df6ae4c -0, 20, 20, 1, 230400, 0x909baccc -0, 21, 21, 1, 230400, 0x1892ac65 -0, 22, 22, 1, 230400, 0x3247bb32 -0, 23, 23, 1, 230400, 0x592fbbe5 -0, 24, 24, 1, 230400, 0x189db9d5 -0, 25, 25, 1, 230400, 0x1a38b8da -0, 26, 26, 1, 230400, 0xccd6bd07 -0, 27, 27, 1, 230400, 0xd4a2bc53 -0, 28, 28, 1, 230400, 0x9ce3bb4e -0, 29, 29, 1, 230400, 0x5ffdc4db -0, 30, 30, 1, 230400, 0xc885c7c9 -0, 31, 31, 1, 230400, 0xe27b9d33 -0, 32, 32, 1, 230400, 0xac03a256 -0, 33, 33, 1, 230400, 0xa2c73929 -0, 34, 34, 1, 230400, 0x33793b73 -0, 35, 35, 1, 230400, 0x1e400add -0, 36, 36, 1, 230400, 0x98e50c6e -0, 37, 37, 1, 230400, 0x68ed226d -0, 38, 38, 1, 230400, 0x569e23cb -0, 39, 39, 1, 230400, 0x82bf3fc0 -0, 40, 40, 1, 230400, 0x2b202e86 -0, 41, 41, 1, 230400, 0x7acd2dee -0, 42, 42, 1, 230400, 0xfe872e42 -0, 43, 43, 1, 230400, 0x026c12e5 -0, 44, 44, 1, 230400, 0x81561399 -0, 45, 45, 1, 230400, 0xa08c13b6 -0, 46, 46, 1, 230400, 0x89e712f5 -0, 47, 47, 1, 230400, 0x569011ac -0, 48, 48, 1, 230400, 0xd4691112 -0, 49, 49, 1, 230400, 0x2e50165a -0, 50, 50, 1, 230400, 0x0a1215b6 -0, 51, 51, 1, 230400, 0x3c5316e3 -0, 52, 52, 1, 230400, 0x079c1393 -0, 53, 53, 1, 230400, 0x39ca1c48 -0, 54, 54, 1, 230400, 0xe27f199c -0, 55, 55, 1, 230400, 0x10ab1bab -0, 56, 56, 1, 230400, 0xeab017c3 -0, 57, 57, 1, 230400, 0x5f701f77 -0, 58, 58, 1, 230400, 0x01371d7d -0, 59, 59, 1, 230400, 0x22751e99 -0, 60, 60, 1, 230400, 0xaee91a97 -0, 61, 61, 1, 230400, 0x27b41f32 -0, 62, 62, 1, 230400, 0x4ff32bb1 -0, 63, 63, 1, 230400, 0x86e02864 -0, 64, 64, 1, 230400, 0x5eb52b3e -0, 65, 65, 1, 230400, 0xd9252ba8 -0, 66, 66, 1, 230400, 0x72232d9b -0, 67, 67, 1, 230400, 0x599a206f -0, 68, 68, 1, 230400, 0x4d2c1ca5 -0, 69, 69, 1, 230400, 0x9166293b -0, 70, 70, 1, 230400, 0x00992453 +0, 0, 0, 1, 230400, 0x10a99774 +0, 1, 1, 1, 230400, 0xa18b90f8 +0, 2, 2, 1, 230400, 0x837a95f9 +0, 3, 3, 1, 230400, 0xc50d948b +0, 4, 4, 1, 230400, 0xdefc8eca +0, 5, 5, 1, 230400, 0x00498bdb +0, 6, 6, 1, 230400, 0x22458cdc +0, 7, 7, 1, 230400, 0xfad1418c +0, 8, 8, 1, 230400, 0xf09341dd +0, 9, 9, 1, 230400, 0x5ef141ac +0, 10, 10, 1, 230400, 0x6f2d815f +0, 11, 11, 1, 230400, 0x960880c2 +0, 12, 12, 1, 230400, 0x4ba37f8f +0, 13, 13, 1, 230400, 0x3e678082 +0, 14, 14, 1, 230400, 0x4f1c80da +0, 15, 15, 1, 230400, 0x69be82fd +0, 16, 16, 1, 230400, 0x81d29b80 +0, 17, 17, 1, 230400, 0x5fdc9af7 +0, 18, 18, 1, 230400, 0xb8969c2b +0, 19, 19, 1, 230400, 0xdb37a691 +0, 20, 20, 1, 230400, 0xdeb6a645 +0, 21, 21, 1, 230400, 0xf5c6a606 +0, 22, 22, 1, 230400, 0x110ab482 +0, 23, 23, 1, 230400, 0x5bddb45b +0, 24, 24, 1, 230400, 0xc18ab32a +0, 25, 25, 1, 230400, 0x22c1b2be +0, 26, 26, 1, 230400, 0xaa7cb5c3 +0, 27, 27, 1, 230400, 0x5e8fb50f +0, 28, 28, 1, 230400, 0x20e1b42a +0, 29, 29, 1, 230400, 0x0c94c158 +0, 30, 30, 1, 230400, 0x41adc2a3 +0, 31, 31, 1, 230400, 0xbc359983 +0, 32, 32, 1, 230400, 0x19bb9eea +0, 33, 33, 1, 230400, 0xfecd2f06 +0, 34, 34, 1, 230400, 0x26ba3110 +0, 35, 35, 1, 230400, 0xfdbcff0f +0, 36, 36, 1, 230400, 0x1f030028 +0, 37, 37, 1, 230400, 0xccca1b0b +0, 38, 38, 1, 230400, 0x66f91b1f +0, 39, 39, 1, 230400, 0x0ef4366b +0, 40, 40, 1, 230400, 0x2fac271c +0, 41, 41, 1, 230400, 0xbef026a9 +0, 42, 42, 1, 230400, 0x775726f5 +0, 43, 43, 1, 230400, 0x35210966 +0, 44, 44, 1, 230400, 0x0c36099a +0, 45, 45, 1, 230400, 0xc4f00a24 +0, 46, 46, 1, 230400, 0xa7c409b9 +0, 47, 47, 1, 230400, 0xa92d082b +0, 48, 48, 1, 230400, 0xfc49442e +0, 49, 49, 1, 230400, 0xb7de4997 +0, 50, 50, 1, 230400, 0x16d24877 +0, 51, 51, 1, 230400, 0xb0954a17 +0, 52, 52, 1, 230400, 0x709f4766 +0, 53, 53, 1, 230400, 0xe0dc4e4f +0, 54, 54, 1, 230400, 0xfa844b09 +0, 55, 55, 1, 230400, 0xa62a4cf2 +0, 56, 56, 1, 230400, 0x078d4a76 +0, 57, 57, 1, 230400, 0x64c4505c +0, 58, 58, 1, 230400, 0xe8604f13 +0, 59, 59, 1, 230400, 0x39a3503c +0, 60, 60, 1, 230400, 0x915a4cf1 +0, 61, 61, 1, 230400, 0x495a5176 +0, 62, 62, 1, 230400, 0xc0a75b2b +0, 63, 63, 1, 230400, 0x1a385761 +0, 64, 64, 1, 230400, 0x9a245984 +0, 65, 65, 1, 230400, 0xbe475ad9 +0, 66, 66, 1, 230400, 0x8e275c85 +0, 67, 67, 1, 230400, 0x5ba45436 +0, 68, 68, 1, 230400, 0x80285097 +0, 69, 69, 1, 230400, 0xbb1c5bfd +0, 70, 70, 1, 230400, 0x273a5890 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer0 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer0 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer0 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-bayer0 2023-03-03 13:29:59.000000000 +0000 @@ -3,74 +3,74 @@ #codec_id 0: rawvideo #dimensions 0: 320x180 #sar 0: 1/1 -0, 0, 0, 1, 230400, 0xfb6042d2 -0, 1, 1, 1, 230400, 0x1c193c09 -0, 2, 2, 1, 230400, 0x183442f8 -0, 3, 3, 1, 230400, 0xa9634084 -0, 4, 4, 1, 230400, 0x90df3d2f -0, 5, 5, 1, 230400, 0x59d7389f -0, 6, 6, 1, 230400, 0xb9bd3a30 -0, 7, 7, 1, 230400, 0x9874ee38 -0, 8, 8, 1, 230400, 0xf661f01f -0, 9, 9, 1, 230400, 0xacbcedbd -0, 10, 10, 1, 230400, 0x05f02d59 -0, 11, 11, 1, 230400, 0xc54c2cc8 -0, 12, 12, 1, 230400, 0x19c92d61 -0, 13, 13, 1, 230400, 0x14902fb2 -0, 14, 14, 1, 230400, 0x99b62fb6 -0, 15, 15, 1, 230400, 0x3fc63293 -0, 16, 16, 1, 230400, 0x1eed4b38 -0, 17, 17, 1, 230400, 0xe9d747e0 -0, 18, 18, 1, 230400, 0x9825496f -0, 19, 19, 1, 230400, 0x94625411 -0, 20, 20, 1, 230400, 0xed7052a3 -0, 21, 21, 1, 230400, 0x80d552dc -0, 22, 22, 1, 230400, 0x89b360bb -0, 23, 23, 1, 230400, 0xee9a616a -0, 24, 24, 1, 230400, 0x30bb5f86 -0, 25, 25, 1, 230400, 0x5ec15eae -0, 26, 26, 1, 230400, 0x0956633e -0, 27, 27, 1, 230400, 0x72df62fa -0, 28, 28, 1, 230400, 0xbafd61d0 -0, 29, 29, 1, 230400, 0x393f81f3 -0, 30, 30, 1, 230400, 0xba6a848c -0, 31, 31, 1, 230400, 0x502ba0d9 -0, 32, 32, 1, 230400, 0xc81ba71d -0, 33, 33, 1, 230400, 0x54cdf270 -0, 34, 34, 1, 230400, 0xe951f3e2 -0, 35, 35, 1, 230400, 0xbf15baa1 -0, 36, 36, 1, 230400, 0xbf96bb12 -0, 37, 37, 1, 230400, 0xcdd5cafe -0, 38, 38, 1, 230400, 0x97b1cbb4 -0, 39, 39, 1, 230400, 0x955ae28f -0, 40, 40, 1, 230400, 0x6a8dd28f -0, 41, 41, 1, 230400, 0x8f02d268 -0, 42, 42, 1, 230400, 0x3075d269 -0, 43, 43, 1, 230400, 0x29e8b910 -0, 44, 44, 1, 230400, 0xb35ab888 -0, 45, 45, 1, 230400, 0xc3afb942 -0, 46, 46, 1, 230400, 0xeba8b860 -0, 47, 47, 1, 230400, 0x5de8b7ab -0, 48, 48, 1, 230400, 0x90233679 -0, 49, 49, 1, 230400, 0x5fbc3abb -0, 50, 50, 1, 230400, 0xeaa73b87 -0, 51, 51, 1, 230400, 0xbd0a3c4b -0, 52, 52, 1, 230400, 0xeddb39ba -0, 53, 53, 1, 230400, 0x269d4131 -0, 54, 54, 1, 230400, 0xae3e3e8c -0, 55, 55, 1, 230400, 0x65f54056 -0, 56, 56, 1, 230400, 0xf2173c5b -0, 57, 57, 1, 230400, 0xbd714477 -0, 58, 58, 1, 230400, 0xb60c42ed -0, 59, 59, 1, 230400, 0x8def43a5 -0, 60, 60, 1, 230400, 0xe6a73f05 -0, 61, 61, 1, 230400, 0xedfe4430 -0, 62, 62, 1, 230400, 0x76c5505a -0, 63, 63, 1, 230400, 0xf48d4d04 -0, 64, 64, 1, 230400, 0xa49950b5 -0, 65, 65, 1, 230400, 0xc64d51d8 -0, 66, 66, 1, 230400, 0xa08253ec -0, 67, 67, 1, 230400, 0xd6ef4609 -0, 68, 68, 1, 230400, 0x27a241e7 -0, 69, 69, 1, 230400, 0xe5f74b4a -0, 70, 70, 1, 230400, 0xb0194751 +0, 0, 0, 1, 230400, 0x9f192d87 +0, 1, 1, 1, 230400, 0x49db27f5 +0, 2, 2, 1, 230400, 0x8f8f2cb0 +0, 3, 3, 1, 230400, 0x33a82b14 +0, 4, 4, 1, 230400, 0x6f03275f +0, 5, 5, 1, 230400, 0x1fce2453 +0, 6, 6, 1, 230400, 0x932925b3 +0, 7, 7, 1, 230400, 0x9987dba9 +0, 8, 8, 1, 230400, 0x9ba2dd04 +0, 9, 9, 1, 230400, 0x37eadc31 +0, 10, 10, 1, 230400, 0xda0518e2 +0, 11, 11, 1, 230400, 0xb96718b5 +0, 12, 12, 1, 230400, 0x0d63191e +0, 13, 13, 1, 230400, 0xfc561af0 +0, 14, 14, 1, 230400, 0x22fd1b68 +0, 15, 15, 1, 230400, 0xef631dc5 +0, 16, 16, 1, 230400, 0xc0673745 +0, 17, 17, 1, 230400, 0x56c933f6 +0, 18, 18, 1, 230400, 0x3790359a +0, 19, 19, 1, 230400, 0xd3293d02 +0, 20, 20, 1, 230400, 0xee513caa +0, 21, 21, 1, 230400, 0x0fc33c17 +0, 22, 22, 1, 230400, 0x00c74991 +0, 23, 23, 1, 230400, 0xa7de49f5 +0, 24, 24, 1, 230400, 0xd99b485a +0, 25, 25, 1, 230400, 0x6aab47d2 +0, 26, 26, 1, 230400, 0x2e434bf7 +0, 27, 27, 1, 230400, 0x46a04b1d +0, 28, 28, 1, 230400, 0x135f49f8 +0, 29, 29, 1, 230400, 0x50566b86 +0, 30, 30, 1, 230400, 0xb0416d84 +0, 31, 31, 1, 230400, 0x8f20840c +0, 32, 32, 1, 230400, 0xedbf8857 +0, 33, 33, 1, 230400, 0x30d6d698 +0, 34, 34, 1, 230400, 0xbc88d7a7 +0, 35, 35, 1, 230400, 0xce869fa3 +0, 36, 36, 1, 230400, 0xa973a0b1 +0, 37, 37, 1, 230400, 0x4c93b3a5 +0, 38, 38, 1, 230400, 0x3574b473 +0, 39, 39, 1, 230400, 0xa96bc936 +0, 40, 40, 1, 230400, 0x4a83b86d +0, 41, 41, 1, 230400, 0x3b68b7cb +0, 42, 42, 1, 230400, 0xc0feb869 +0, 43, 43, 1, 230400, 0x1a7d9ed8 +0, 44, 44, 1, 230400, 0xc32e9f12 +0, 45, 45, 1, 230400, 0x30f29fa4 +0, 46, 46, 1, 230400, 0x7b369f80 +0, 47, 47, 1, 230400, 0x28249e03 +0, 48, 48, 1, 230400, 0xf5c67eee +0, 49, 49, 1, 230400, 0x40728404 +0, 50, 50, 1, 230400, 0xbf7383b0 +0, 51, 51, 1, 230400, 0x446d84c9 +0, 52, 52, 1, 230400, 0x5f678279 +0, 53, 53, 1, 230400, 0x4d1d891d +0, 54, 54, 1, 230400, 0x173c866c +0, 55, 55, 1, 230400, 0x045988a6 +0, 56, 56, 1, 230400, 0xf25f848f +0, 57, 57, 1, 230400, 0xd61c8d71 +0, 58, 58, 1, 230400, 0x86428b1e +0, 59, 59, 1, 230400, 0xc6268c08 +0, 60, 60, 1, 230400, 0xed9787e3 +0, 61, 61, 1, 230400, 0xe7ef8a27 +0, 62, 62, 1, 230400, 0x5dc09497 +0, 63, 63, 1, 230400, 0x8ec490b6 +0, 64, 64, 1, 230400, 0xc01d92e4 +0, 65, 65, 1, 230400, 0xbf6a941d +0, 66, 66, 1, 230400, 0x53fd966a +0, 67, 67, 1, 230400, 0xa2138be9 +0, 68, 68, 1, 230400, 0x2b868967 +0, 69, 69, 1, 230400, 0x4c889564 +0, 70, 70, 1, 230400, 0x6d8491ed diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-nodither mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-nodither --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-nodither 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-nodither 2023-03-03 13:29:59.000000000 +0000 @@ -3,74 +3,74 @@ #codec_id 0: rawvideo #dimensions 0: 320x180 #sar 0: 1/1 -0, 0, 0, 1, 230400, 0x690560cb -0, 1, 1, 1, 230400, 0x197a5a54 -0, 2, 2, 1, 230400, 0x665961db -0, 3, 3, 1, 230400, 0xce0b5fa8 -0, 4, 4, 1, 230400, 0xa40e5cb0 -0, 5, 5, 1, 230400, 0xa5aa58da -0, 6, 6, 1, 230400, 0x8e0259bb -0, 7, 7, 1, 230400, 0x476d0dba -0, 8, 8, 1, 230400, 0xfb1b0e8c -0, 9, 9, 1, 230400, 0x50f60d3b -0, 10, 10, 1, 230400, 0x12cd4bab -0, 11, 11, 1, 230400, 0x4c274b13 -0, 12, 12, 1, 230400, 0xea494b0a -0, 13, 13, 1, 230400, 0x118c4cc1 -0, 14, 14, 1, 230400, 0xd4224db7 -0, 15, 15, 1, 230400, 0xc3014f88 -0, 16, 16, 1, 230400, 0xe07a6838 -0, 17, 17, 1, 230400, 0x1b97659a -0, 18, 18, 1, 230400, 0xf104670c -0, 19, 19, 1, 230400, 0x7b63733d -0, 20, 20, 1, 230400, 0x2c237200 -0, 21, 21, 1, 230400, 0x775d7248 -0, 22, 22, 1, 230400, 0xcaee7f9e -0, 23, 23, 1, 230400, 0x4e4680a1 -0, 24, 24, 1, 230400, 0x21fb7e53 -0, 25, 25, 1, 230400, 0xf0297db6 -0, 26, 26, 1, 230400, 0x79a9829d -0, 27, 27, 1, 230400, 0x8ccb80f7 -0, 28, 28, 1, 230400, 0xf4dd807f -0, 29, 29, 1, 230400, 0xb6cc8696 -0, 30, 30, 1, 230400, 0x6c8a8917 -0, 31, 31, 1, 230400, 0x9e08615a -0, 32, 32, 1, 230400, 0xc098685b -0, 33, 33, 1, 230400, 0x5c09e710 -0, 34, 34, 1, 230400, 0xe4c4e9be -0, 35, 35, 1, 230400, 0xac59c150 -0, 36, 36, 1, 230400, 0x6045c272 -0, 37, 37, 1, 230400, 0xf71ee6dc -0, 38, 38, 1, 230400, 0xc82ce6f6 -0, 39, 39, 1, 230400, 0xb7ed039a -0, 40, 40, 1, 230400, 0xda93f241 -0, 41, 41, 1, 230400, 0x194bf23b -0, 42, 42, 1, 230400, 0xe7e6f2e2 -0, 43, 43, 1, 230400, 0xe479d834 -0, 44, 44, 1, 230400, 0xefdfd87e -0, 45, 45, 1, 230400, 0xec66d8c0 -0, 46, 46, 1, 230400, 0x3a6bd81b -0, 47, 47, 1, 230400, 0xb5d1d700 -0, 48, 48, 1, 230400, 0x3bc69e8b -0, 49, 49, 1, 230400, 0x723fa455 -0, 50, 50, 1, 230400, 0x7c49a392 -0, 51, 51, 1, 230400, 0x272ea4b7 -0, 52, 52, 1, 230400, 0xebdda081 -0, 53, 53, 1, 230400, 0xfd26ab99 -0, 54, 54, 1, 230400, 0xfa02a891 -0, 55, 55, 1, 230400, 0xda2caa7f -0, 56, 56, 1, 230400, 0x2360a611 -0, 57, 57, 1, 230400, 0xaa3baefd -0, 58, 58, 1, 230400, 0x0961ad5c -0, 59, 59, 1, 230400, 0x48d2ae47 -0, 60, 60, 1, 230400, 0x20eda81b -0, 61, 61, 1, 230400, 0x8821adbb -0, 62, 62, 1, 230400, 0x1150b810 -0, 63, 63, 1, 230400, 0x08dab596 -0, 64, 64, 1, 230400, 0x4731b7a5 -0, 65, 65, 1, 230400, 0xf382b87e -0, 66, 66, 1, 230400, 0xdba7bac2 -0, 67, 67, 1, 230400, 0xf569acf9 -0, 68, 68, 1, 230400, 0x22d8a95d -0, 69, 69, 1, 230400, 0xed0bb4fb -0, 70, 70, 1, 230400, 0x2dccb218 +0, 0, 0, 1, 230400, 0xf7976830 +0, 1, 1, 1, 230400, 0xfb756340 +0, 2, 2, 1, 230400, 0x2199687e +0, 3, 3, 1, 230400, 0xd8186657 +0, 4, 4, 1, 230400, 0xd33a6319 +0, 5, 5, 1, 230400, 0x704c603b +0, 6, 6, 1, 230400, 0x9e6c6146 +0, 7, 7, 1, 230400, 0x63ee15f1 +0, 8, 8, 1, 230400, 0x8b201716 +0, 9, 9, 1, 230400, 0xac8e1602 +0, 10, 10, 1, 230400, 0xd97e53b6 +0, 11, 11, 1, 230400, 0x8ecc5304 +0, 12, 12, 1, 230400, 0x0ea25368 +0, 13, 13, 1, 230400, 0x78c7555e +0, 14, 14, 1, 230400, 0x96e3562d +0, 15, 15, 1, 230400, 0xecc75867 +0, 16, 16, 1, 230400, 0x56e26feb +0, 17, 17, 1, 230400, 0xf65d6fac +0, 18, 18, 1, 230400, 0x5597709e +0, 19, 19, 1, 230400, 0xeb077c34 +0, 20, 20, 1, 230400, 0xce997afa +0, 21, 21, 1, 230400, 0xbec37abd +0, 22, 22, 1, 230400, 0xb01688c4 +0, 23, 23, 1, 230400, 0x0c828927 +0, 24, 24, 1, 230400, 0xa6308757 +0, 25, 25, 1, 230400, 0x90e68727 +0, 26, 26, 1, 230400, 0xe3258ae5 +0, 27, 27, 1, 230400, 0x988e8993 +0, 28, 28, 1, 230400, 0xc13688b0 +0, 29, 29, 1, 230400, 0xcc528fa1 +0, 30, 30, 1, 230400, 0x28c691a9 +0, 31, 31, 1, 230400, 0x7de96ae9 +0, 32, 32, 1, 230400, 0x47946fa5 +0, 33, 33, 1, 230400, 0x1c3efa7c +0, 34, 34, 1, 230400, 0x7fc6fc80 +0, 35, 35, 1, 230400, 0x0509c853 +0, 36, 36, 1, 230400, 0x691bca43 +0, 37, 37, 1, 230400, 0xadb5eafd +0, 38, 38, 1, 230400, 0x559feafa +0, 39, 39, 1, 230400, 0xa17906da +0, 40, 40, 1, 230400, 0x6091f838 +0, 41, 41, 1, 230400, 0x9640f6fa +0, 42, 42, 1, 230400, 0xa73af817 +0, 43, 43, 1, 230400, 0x255fde90 +0, 44, 44, 1, 230400, 0x7284deac +0, 45, 45, 1, 230400, 0xf603df3f +0, 46, 46, 1, 230400, 0x435cde3a +0, 47, 47, 1, 230400, 0x825add61 +0, 48, 48, 1, 230400, 0x13b6bc0e +0, 49, 49, 1, 230400, 0x72e7c13d +0, 50, 50, 1, 230400, 0x2bcdc061 +0, 51, 51, 1, 230400, 0xb2e7c189 +0, 52, 52, 1, 230400, 0xb4eabe46 +0, 53, 53, 1, 230400, 0x0108c777 +0, 54, 54, 1, 230400, 0xae5cc3b3 +0, 55, 55, 1, 230400, 0xdd8ec4da +0, 56, 56, 1, 230400, 0x0ec5c1d0 +0, 57, 57, 1, 230400, 0x3ad7cab8 +0, 58, 58, 1, 230400, 0xa9b0c95b +0, 59, 59, 1, 230400, 0xe98ec9a0 +0, 60, 60, 1, 230400, 0x07d9c42e +0, 61, 61, 1, 230400, 0x23b8c94e +0, 62, 62, 1, 230400, 0xd3a9d25d +0, 63, 63, 1, 230400, 0x3154cf78 +0, 64, 64, 1, 230400, 0x163ad234 +0, 65, 65, 1, 230400, 0x3ce2d276 +0, 66, 66, 1, 230400, 0x6f0bd556 +0, 67, 67, 1, 230400, 0xd982cb24 +0, 68, 68, 1, 230400, 0xd04ac7ab +0, 69, 69, 1, 230400, 0x5302d29a +0, 70, 70, 1, 230400, 0xd989d0dc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-sierra2_4a mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-sierra2_4a --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-sierra2_4a 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-paletteuse-sierra2_4a 2023-03-03 13:29:59.000000000 +0000 @@ -3,74 +3,74 @@ #codec_id 0: rawvideo #dimensions 0: 320x180 #sar 0: 1/1 -0, 0, 0, 1, 230400, 0xa4f85758 -0, 1, 1, 1, 230400, 0xbe83505c -0, 2, 2, 1, 230400, 0x0a09584e -0, 3, 3, 1, 230400, 0xd2065629 -0, 4, 4, 1, 230400, 0x11eb5319 -0, 5, 5, 1, 230400, 0x61024f4c -0, 6, 6, 1, 230400, 0xd5384faa -0, 7, 7, 1, 230400, 0xdeae0343 -0, 8, 8, 1, 230400, 0xcb640541 -0, 9, 9, 1, 230400, 0xea2602c3 -0, 10, 10, 1, 230400, 0xa7974293 -0, 11, 11, 1, 230400, 0x67cd4287 -0, 12, 12, 1, 230400, 0x83fa437a -0, 13, 13, 1, 230400, 0x852b42bf -0, 14, 14, 1, 230400, 0x6d2d434c -0, 15, 15, 1, 230400, 0x20c44629 -0, 16, 16, 1, 230400, 0xf2a35f57 -0, 17, 17, 1, 230400, 0x232959ec -0, 18, 18, 1, 230400, 0x1f8e5c48 -0, 19, 19, 1, 230400, 0x88dc69bd -0, 20, 20, 1, 230400, 0x4b6866f3 -0, 21, 21, 1, 230400, 0xe8f966dc -0, 22, 22, 1, 230400, 0xe0877466 -0, 23, 23, 1, 230400, 0x8799748c -0, 24, 24, 1, 230400, 0xcab871bc -0, 25, 25, 1, 230400, 0x2e0372b4 -0, 26, 26, 1, 230400, 0x15fb77d5 -0, 27, 27, 1, 230400, 0xbadf75fc -0, 28, 28, 1, 230400, 0xa4977626 -0, 29, 29, 1, 230400, 0x5b987943 -0, 30, 30, 1, 230400, 0x9ed57c09 -0, 31, 31, 1, 230400, 0x565d5105 -0, 32, 32, 1, 230400, 0x901b5a07 -0, 33, 33, 1, 230400, 0x8dc4e9a8 -0, 34, 34, 1, 230400, 0x0b9cee1c -0, 35, 35, 1, 230400, 0x2bcdbe37 -0, 36, 36, 1, 230400, 0xf3e2bf71 -0, 37, 37, 1, 230400, 0xb718da67 -0, 38, 38, 1, 230400, 0x8f59da64 -0, 39, 39, 1, 230400, 0x8812f9aa -0, 40, 40, 1, 230400, 0xe0dae6a3 -0, 41, 41, 1, 230400, 0xd2c7e5b7 -0, 42, 42, 1, 230400, 0xea2ae5d2 -0, 43, 43, 1, 230400, 0x2d66ca25 -0, 44, 44, 1, 230400, 0xf0d3cac6 -0, 45, 45, 1, 230400, 0xb9acccac -0, 46, 46, 1, 230400, 0x8523ca4a -0, 47, 47, 1, 230400, 0x92b9c9ef -0, 48, 48, 1, 230400, 0x0a88946e -0, 49, 49, 1, 230400, 0xe33699b8 -0, 50, 50, 1, 230400, 0x5e7b9917 -0, 51, 51, 1, 230400, 0xdac99998 -0, 52, 52, 1, 230400, 0xb5c995fc -0, 53, 53, 1, 230400, 0x908b9f50 -0, 54, 54, 1, 230400, 0x60d59ced -0, 55, 55, 1, 230400, 0x212e9f55 -0, 56, 56, 1, 230400, 0x95e69b2a -0, 57, 57, 1, 230400, 0x6c38a34a -0, 58, 58, 1, 230400, 0xeb32a103 -0, 59, 59, 1, 230400, 0x0131a1b7 -0, 60, 60, 1, 230400, 0xd59b9c4e -0, 61, 61, 1, 230400, 0x2fc0a13f -0, 62, 62, 1, 230400, 0x7a40adf9 -0, 63, 63, 1, 230400, 0x5cdbab2f -0, 64, 64, 1, 230400, 0xcdc0ada8 -0, 65, 65, 1, 230400, 0x2f5faf32 -0, 66, 66, 1, 230400, 0xd463b224 -0, 67, 67, 1, 230400, 0xe337a2d5 -0, 68, 68, 1, 230400, 0xe775a0c1 -0, 69, 69, 1, 230400, 0x726aab49 -0, 70, 70, 1, 230400, 0x74dda81e +0, 0, 0, 1, 230400, 0xa40645e7 +0, 1, 1, 1, 230400, 0x72b63e5e +0, 2, 2, 1, 230400, 0x030344b2 +0, 3, 3, 1, 230400, 0xab8c42b8 +0, 4, 4, 1, 230400, 0x1fcd3f00 +0, 5, 5, 1, 230400, 0x371f3c27 +0, 6, 6, 1, 230400, 0x0cfe3dff +0, 7, 7, 1, 230400, 0x0c64f102 +0, 8, 8, 1, 230400, 0xbca2f2f7 +0, 9, 9, 1, 230400, 0x5198f134 +0, 10, 10, 1, 230400, 0xee02305e +0, 11, 11, 1, 230400, 0x22592ff1 +0, 12, 12, 1, 230400, 0xa230311d +0, 13, 13, 1, 230400, 0x66453278 +0, 14, 14, 1, 230400, 0x68c63165 +0, 15, 15, 1, 230400, 0xded434ae +0, 16, 16, 1, 230400, 0xff1a4e51 +0, 17, 17, 1, 230400, 0x31064c7b +0, 18, 18, 1, 230400, 0x3d374e74 +0, 19, 19, 1, 230400, 0x58ec59d5 +0, 20, 20, 1, 230400, 0x8c02570f +0, 21, 21, 1, 230400, 0x5f6b56ac +0, 22, 22, 1, 230400, 0x781f6408 +0, 23, 23, 1, 230400, 0x1c0165d2 +0, 24, 24, 1, 230400, 0xc6e66311 +0, 25, 25, 1, 230400, 0x0375635d +0, 26, 26, 1, 230400, 0x00756822 +0, 27, 27, 1, 230400, 0xb4276753 +0, 28, 28, 1, 230400, 0x8b826638 +0, 29, 29, 1, 230400, 0x201066e2 +0, 30, 30, 1, 230400, 0x4acc6ab8 +0, 31, 31, 1, 230400, 0xa78741fe +0, 32, 32, 1, 230400, 0xfe85481e +0, 33, 33, 1, 230400, 0x7153dae0 +0, 34, 34, 1, 230400, 0x9b7ede62 +0, 35, 35, 1, 230400, 0x785cad21 +0, 36, 36, 1, 230400, 0x4c81ac20 +0, 37, 37, 1, 230400, 0x2e9cc57c +0, 38, 38, 1, 230400, 0x0043c629 +0, 39, 39, 1, 230400, 0xccb1e72d +0, 40, 40, 1, 230400, 0xf800d4d9 +0, 41, 41, 1, 230400, 0xb40ad374 +0, 42, 42, 1, 230400, 0xa94bd3eb +0, 43, 43, 1, 230400, 0xefa8b85f +0, 44, 44, 1, 230400, 0xa32ab85d +0, 45, 45, 1, 230400, 0xbb89b941 +0, 46, 46, 1, 230400, 0x6556b8f0 +0, 47, 47, 1, 230400, 0x3d5ab7ab +0, 48, 48, 1, 230400, 0x7b68afd9 +0, 49, 49, 1, 230400, 0x7518b560 +0, 50, 50, 1, 230400, 0x4d6bb43f +0, 51, 51, 1, 230400, 0xafe7b5a0 +0, 52, 52, 1, 230400, 0x5211b1c0 +0, 53, 53, 1, 230400, 0x4ababa33 +0, 54, 54, 1, 230400, 0x90f7b7fc +0, 55, 55, 1, 230400, 0x0b0dba13 +0, 56, 56, 1, 230400, 0xc9b6b5b4 +0, 57, 57, 1, 230400, 0xa1c5bfcd +0, 58, 58, 1, 230400, 0xde30bdaf +0, 59, 59, 1, 230400, 0x6ae5bc07 +0, 60, 60, 1, 230400, 0x9845b936 +0, 61, 61, 1, 230400, 0xcad4bf41 +0, 62, 62, 1, 230400, 0x90abca33 +0, 63, 63, 1, 230400, 0x2c12c614 +0, 64, 64, 1, 230400, 0x2d65c7ea +0, 65, 65, 1, 230400, 0x1949c8f3 +0, 66, 66, 1, 230400, 0xe5adcb22 +0, 67, 67, 1, 230400, 0xa87bc06c +0, 68, 68, 1, 230400, 0x4c43baeb +0, 69, 69, 1, 230400, 0xbf66c7f9 +0, 70, 70, 1, 230400, 0x9883c62d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-nv16 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-nv16 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-nv16 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-nv16 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-nv16 cbbc5d904b8eebad3705a325c3ec5734 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012be mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012be --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012be 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012be 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-p012be 784a49bf554861da9d0809a615bcf813 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-p012le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-p012le 0268fd44f63022e21ada69704534fc85 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuya mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuya --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuya 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuya 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-vuya acf482aa1a27ed6166a3673cc5920a22 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuyx mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuyx --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuyx 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-vuyx 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-vuyx ebc83f9793eb4eddbb0a37fdcb67a33d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv30le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv30le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv30le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv30le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-xv30le fb76a14d6d5cf3a0b48f30b2fb59becd diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv36le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv36le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv36le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-xv36le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-xv36le 9d00bb58092f8b6d5d6fd71a8aec719a diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y210le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y210le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y210le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y210le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-y210le 7b0ba4b531e7dccca7f2a49102b23991 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y212le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y212le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y212le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixdesc-y212le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +pixdesc-y212le d481592126b10ef2d5f71a2ccac0ebe5 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-copy mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-copy --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-copy 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-copy 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob 8b04f859fee6a0be856be184acd7a0b5 monow 54d16d2c01abfd72ecdb5e51e283937c nv12 8e24feb2c544dc26a20047a71e4c27aa +nv16 22b1916c0694c4e2979bab8eb71f3d6b nv21 335d85c9af6110f26ae9e187a82ed2cf nv24 f30fc8d0ac40af69e119ea919a314572 nv42 29a212f70f8780fe0eb99abcae81894d p010be 7f9842d6015026136bad60d03c035cc3 p010le c453421b9f726bdaf2bacf59a492c43b +p012be 7f9842d6015026136bad60d03c035cc3 +p012le 1929db89609c4b8c6d9c9030a9e7843d p016be 7f9842d6015026136bad60d03c035cc3 p016le c453421b9f726bdaf2bacf59a492c43b p210be 847e9c6e292b17349e69570829252b3e @@ -88,10 +91,16 @@ rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea rgba64le b91e1d77f799eb92241a2d2d28437b15 uyvy422 3bcf3c80047592f2211fae3260b1b65d +vuya 3d5e934651cae1ce334001cb1829ad22 +vuyx 3f68ea6ec492b30d867cb5401562264e x2bgr10le 550c0d190cf695afa4eaacb644db6b75 x2rgb10le c1e3ac21be04a16bb157b22784524520 +xv30le c14b5a953bf3be56346f66ca174a5b1b +xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c +y210le 0736b017e0814daf38d3350c42796f7a +y212le 825768be8fe92708ae80be84855066ed ya16be 37c07787e544f900c87b853253bfc8dd ya16le e8cab8fad88cba6d285b224d8bf0d4df ya8 dbb99fbcdc204aaa1a7397ff561f1a67 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-crop mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-crop --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-crop 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-crop 2023-03-03 13:29:59.000000000 +0000 @@ -54,11 +54,14 @@ grayf32be cf40ec06a8abe54852b7f85a00549eec grayf32le b672526c9da9c8959ab881f242f6890a nv12 92cda427f794374731ec0321ee00caac +nv16 3264b16aaae554c21f052102b491c13b nv21 1bcfc197f4fb95de85ba58182d8d2f69 nv24 514c8f12082f0737e558778cbe7de258 nv42 ece9baae1c5de579dac2c66a89e08ef3 p010be 8b2de2eb6b099bbf355bfc55a0694ddc p010le 373b50c766dfd0a8e79c9a73246d803a +p012be 8b2de2eb6b099bbf355bfc55a0694ddc +p012le a1e4f713e145dfc465bfe0cc77096a03 p016be 8b2de2eb6b099bbf355bfc55a0694ddc p016le 373b50c766dfd0a8e79c9a73246d803a p210be 2947f43774352ef61f9e83777548c7c5 @@ -85,8 +88,12 @@ rgba 9488ac85abceaf99a9309eac5a87697e rgba64be 89910046972ab3c68e2a348302cc8ca9 rgba64le fea8ebfc869b52adf353778f29eac7a7 +vuya 76578a705ff3a37559653c1289bd03dd +vuyx 5d2bae51a2f4892bd5f177f190cc323b x2bgr10le 84de725b85662c362862820dc4a309aa x2rgb10le f4265aca7a67dbfa9354370098ca6f33 +xv30le a9edb820819b900a4a897fee4562a4fb +xv36le 90a187adf00a1b15c33d064ae2582804 xyz12be cb4571f9aaa7b59f999ef327276104b7 xyz12le cd6aae8d26b18bdb4b9d068586276d91 ya16be a3d18014454942a96f15a49947c0c55d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-field mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-field --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-field 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-field 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob 2129cc72a484d7e10a44de9117aa9f80 monow 03d783611d265cae78293f88ea126ea1 nv12 16f7a46708ef25ebd0b72e47920cc11e +nv16 34f36b03f5fccf4eac147b26bbc0a5e5 nv21 7294574037cc7f9373ef5695d8ebe809 nv24 3b100fb527b64ee2b2d7120da573faf5 nv42 1841ce853152d86b27c130f319ea0db2 p010be a0311a09bba7383553267d2b3b9c075e p010le ee09a18aefa3ebe97715b3a7312cb8ff +p012be a0311a09bba7383553267d2b3b9c075e +p012le f1cc90d292046109a626db2da9f0f9b6 p016be a0311a09bba7383553267d2b3b9c075e p016le ee09a18aefa3ebe97715b3a7312cb8ff p210be 58d46f566ab28e3bcfb715c7aa53cf58 @@ -88,10 +91,16 @@ rgba64be 23c8c0edaabe3eaec89ce69633fb0048 rgba64le dfdba4de4a7cac9abf08852666c341d3 uyvy422 1c49e44ab3f060e85fc4a3a9464f045e +vuya f72bcf29d75cd143d0c565f7cc49119a +vuyx 6257cd1ce11330660e9fa9c675acbdcc x2bgr10le dbe21538d7cb1744914f6bd46ec09b55 x2rgb10le a18bc4ae5274e0a8cca9137ecd50c677 +xv30le e940366c78efc9e292e9de28cf04dba9 +xv36le aa5a867879a70e1040dfafe3e03167d5 xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437 xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5 +y210le 025beb25f047a762e3788dbea4b60864 +y212le ac2a47c45187dd54d0f55293cbffd954 ya16be 40403b5277364777e0671da4d38e01ac ya16le 54f3295f5326a13d456ac53e973ba398 ya8 28cea4f98ed452bd3da9c752e5e3399c diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-fieldorder mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-fieldorder --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-fieldorder 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-fieldorder 2023-03-03 13:29:59.000000000 +0000 @@ -53,6 +53,7 @@ gray9le fba944fde7923d5089f4f52d12988b9e grayf32be 1aa7960131f880c54fe3c77f13448674 grayf32le 4029ac9d197f255794c1b9e416520fc7 +nv16 085deb984ab986eb5cc961fe265e30c0 nv24 4fdbef26042c77f012df114e666efdb2 nv42 59608290fece913e6b7d61edf581a529 p210be ca2ce2c25db43dcd14729b2a72a7c604 @@ -79,10 +80,16 @@ rgba64be 5598f44514d122b9a57c5c92c20bbc61 rgba64le b34e6e30621ae579519a2d91a96a0acf uyvy422 75de70e31c435dde878002d3f22b238a +vuya a3891d4168ff208948fd0b3ba0910495 +vuyx d7a900e970c9a69ed41f8b220114b9fa x2bgr10le 86474d84f26c5c51d6f75bf7e1de8da8 x2rgb10le cdf6a9e8a8d081aa768c6ae2e6221676 +xv30le 25aac48128d94010a3660839500caee5 +xv36le 1bde4bee8b938d7bf20e75bc848e4765 xyz12be 15f5cda71de5fef9cec5e75e3833b6bc xyz12le 7be6c8781f38c21a6b8f602f62ca31e6 +y210le ee45acfb1386288af98af5313162ff3e +y212le 2f08fb195b948056c844acb1eee8d649 ya16be 0f13e0f52586d172aaa07710fa3e8f31 ya16le d481d93ea1a1a04d759d9994958983de ya8 055ac5ab5ff8533dd319edc17a398af1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-hflip mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-hflip --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-hflip 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-hflip 2023-03-03 13:29:59.000000000 +0000 @@ -54,11 +54,14 @@ grayf32be a69add7bbf892a71fe81b3b75982dbe2 grayf32le 4563e176a35dc8a8a07e0829fad5eb88 nv12 801e58f1be5fd0b5bc4bf007c604b0b4 +nv16 06ba714cb8b220c203f5898ef39abf93 nv21 9f10dfff8963dc327d3395af21f0554f nv24 f0c5b2f42970f8d4003621d8857a872f nv42 4dcf9aec82b110712b396a8b365dcb13 p010be 744b13e44d39e1ff7588983fa03e0101 p010le a50b160346ab94f55a425065b57006f0 +p012be 744b13e44d39e1ff7588983fa03e0101 +p012le aeb31f50c66f376b0530c7bb6287212b p016be 744b13e44d39e1ff7588983fa03e0101 p016le a50b160346ab94f55a425065b57006f0 p210be 6f5a76d6467b86d55fe5589d3af8a7ea @@ -85,8 +88,12 @@ rgba 51961c723ea6707e0a410cd3f21f15d3 rgba64be c910444019f4cfbf4d995227af55da8d rgba64le 0c810d8b3a6bca10321788e1cb145340 +vuya 7e530261e7ac4eae4fd616fd7572d0b8 +vuyx 3ce9890363cad3984521293be1eb679c x2bgr10le 827cc659f29378e00c5a7d2c0ada8f9a x2rgb10le d4a8189b65395a88d0a38a7053f3359f +xv30le 072aa2b61ce1e764f9d1957e8abee9a9 +xv36le cc569285784e38a489f4a286598f05da xyz12be 25f90259ff8a226befdaec3dfe82996e xyz12le 926c0791d59aaff61b2778e8ada3316d ya16be d5b342355bdd9e3197e01b13b7c6301e diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-il mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-il --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-il 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-il 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob faba75df28033ba7ce3d82ff2a99ee68 monow 6e9cfb8d3a344c5f0c3e1d5e1297e580 nv12 3c3ba9b1b4c4dfff09c26f71b51dd146 +nv16 355d055f91793a171302021b3fc486b0 nv21 ab586d8781246b5a32d8760a61db9797 nv24 554153c71d142e3fd8e40b7dcaaec229 nv42 d699724c8deaeb4f87faf2766512eec3 p010be 3df51286ef66b53e3e283dbbab582263 p010le eadcd8241e97e35b2b47d5eb2eaea6cd +p012be 3df51286ef66b53e3e283dbbab582263 +p012le 38945445b360fa737e9e37257393e823 p016be 3df51286ef66b53e3e283dbbab582263 p016le eadcd8241e97e35b2b47d5eb2eaea6cd p210be 29ec4e8912d456cd15203a96487c42e8 @@ -87,10 +90,16 @@ rgba64be db70d33aa6c06f3e0a1c77bd11284261 rgba64le a8a2daae04374a27219bc1c890204007 uyvy422 d6ee3ca43356d08c392382b24b22cda5 +vuya b9deab5ba249dd608b709c09255a4932 +vuyx 49cc92fcc002ec0f312017014dd68c0c x2bgr10le 135acaff8318cf9861bb0f7849a9e5e9 x2rgb10le 517fb186f523dc7cdc5c5c6967cfbe94 +xv30le 7f6414a3fc700380025c29812e8376a9 +xv36le 066378fad80e34bc3edd22f657be6ff8 xyz12be 7c7d54c55f136cbbc50b18029f3be0b3 xyz12le 090ba6b1170baf2b1358b43b971d33b0 +y210le 306ec4238b49dbc8625a97b678ea1c5f +y212le d5a2b4677ddb4a3bc3e5cd5cbb20f426 ya16be 7bc720918bc0132e9717acbde89874e0 ya16le 61203295a8d39601b841de90f2c9797b ya8 a38d6e288f582f1a04310232ed764afc diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-null mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-null --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-null 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-null 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob 8b04f859fee6a0be856be184acd7a0b5 monow 54d16d2c01abfd72ecdb5e51e283937c nv12 8e24feb2c544dc26a20047a71e4c27aa +nv16 22b1916c0694c4e2979bab8eb71f3d6b nv21 335d85c9af6110f26ae9e187a82ed2cf nv24 f30fc8d0ac40af69e119ea919a314572 nv42 29a212f70f8780fe0eb99abcae81894d p010be 7f9842d6015026136bad60d03c035cc3 p010le c453421b9f726bdaf2bacf59a492c43b +p012be 7f9842d6015026136bad60d03c035cc3 +p012le 1929db89609c4b8c6d9c9030a9e7843d p016be 7f9842d6015026136bad60d03c035cc3 p016le c453421b9f726bdaf2bacf59a492c43b p210be 847e9c6e292b17349e69570829252b3e @@ -88,10 +91,16 @@ rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea rgba64le b91e1d77f799eb92241a2d2d28437b15 uyvy422 3bcf3c80047592f2211fae3260b1b65d +vuya 3d5e934651cae1ce334001cb1829ad22 +vuyx 3f68ea6ec492b30d867cb5401562264e x2bgr10le 550c0d190cf695afa4eaacb644db6b75 x2rgb10le c1e3ac21be04a16bb157b22784524520 +xv30le c14b5a953bf3be56346f66ca174a5b1b +xv36le 3f8ced42a081639a39ec5929dd77b017 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c +y210le 0736b017e0814daf38d3350c42796f7a +y212le 825768be8fe92708ae80be84855066ed ya16be 37c07787e544f900c87b853253bfc8dd ya16le e8cab8fad88cba6d285b224d8bf0d4df ya8 dbb99fbcdc204aaa1a7397ff561f1a67 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-pad mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-pad --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-pad 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-pad 2023-03-03 13:29:59.000000000 +0000 @@ -4,6 +4,7 @@ argb 2a10108ac524b422b8a2393c064b3eab bgr0 025d4d5e5691801ba39bc9de70e39df0 bgr24 f8b65ad845905c7d0c93ca28dfbb826f +bgr48le 4564b56dd1f2a9761b8a7a5244ac4c49 bgra 929aac15e848038e367c250037575f9f gbrap 5f16cccab5a17cb766c882e865995167 gbrap10le e63e0a1ae9afd7e6a732f18be194e761 @@ -22,10 +23,12 @@ gray16le 2734ce1793a2216c5be30816689cd2fe gray9le f8f3dfe31ca5fcba828285bceefdab9a nv12 381574979cb04be10c9168540310afad +nv16 d3a50501d2ea8535489fd5ec49e7866d nv21 0fdeb2cdd56cf5a7147dc273456fa217 nv24 193b9eadcc06ad5081609f76249b3e47 nv42 1738ad3c31c6c16e17679f5b09ce4677 p010le fbbc23cc1d764a5e6fb71883d985f3ed +p012le 3a92c1bd3e9de050bf6abcc3fd911ab7 p016le fbbc23cc1d764a5e6fb71883d985f3ed p210le 680912c059de39c3401cac856bd1b0c1 p216le 8718662e226a4581561e7bb532af2d83 @@ -33,7 +36,10 @@ p416le fa4e023d0bf4b03b0ffef3d4d35abf7e rgb0 0984eb985dabbe757ed6beb53db84eff rgb24 17f9e2e0c609009acaf2175c42d4a2a5 +rgb48le ed08db9b1aa50d69b8c3d73db93e390e rgba b157c90191463d34fb3ce77b36c96386 +vuya 44368c0a758ee68e24ce976e3b1b8535 +vuyx bc7c4f693a22cd1ac95e33d473086474 xyz12le 23dadbbba70b2925ce75fb8ba8080ba3 ya16le 8dbfcb586abf626da7d1aca887a581b9 ya8 495daaca2dcb4f7aeba7652768b41ced diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-scale mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-scale --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-scale 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-scale 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob f01cb0b623357387827902d9d0963435 monow 35c68b86c226d6990b2dcb573a05ff6b nv12 b118d24a3653fe66e5d9e079033aef79 +nv16 68e757396b62b84aad657274b8f6ce15 nv21 c74bb1c10dbbdee8a1f682b194486c4d nv24 2aa6e805bf6d4179ed8d7dea37d75db3 nv42 80714d1eb2d8bcaeab3abc3124df1abd p010be 1d6726d94bf1385996a9a9840dd0e878 p010le 4b316f2b9e18972299beb73511278fa8 +p012be e4dc7ccd654c2d74fde9c7b2711d960b +p012le cd4b6bdcd8967fc0e869ce3b8a014133 p016be 31e204018cbb53f8988c4e1174ea8ce9 p016le d5afe557f492a09317e525d7cb782f5b p210be 2cc6dfcf5e006c8ed5238988a06fd45e @@ -88,10 +91,16 @@ rgba64be ee73e57923af984b31cc7795d13929da rgba64le 783d2779adfafe3548bdb671ec0de69e uyvy422 aeb4ba4f9f003ae21f6d18089198244f +vuya ffa817e283bf6a0b6fba21b07523ccaa +vuyx ba182200e20e0c82765eba15217848d3 x2bgr10le d57b9a99033cc7b65ddd111578f2d385 x2rgb10le d56bdb23fa6a8e12a0b4394987f89935 +xv30le afe68d8a47e8460e0164970b1da0c5be +xv36le eaf5fbd9d5ea04aeefb40f3d7c2ea289 xyz12be c7ba8345998c0141ddc079cdd29b1a40 xyz12le 95f5d3a0de834cc495c9032a14987cde +y210le 1c2708a520477f955d1fedf6ca7a41bd +y212le 39a3c0c843041ad4501b3107dd91ef17 ya16be 20d4842899d61068f5fb6af478bf26a6 ya16le 6a05895adce85143ae1c1b3470cb4070 ya8 0a9db5bb4b009de9197eede5e9d19e16 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-tinterlace_pad mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-tinterlace_pad --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-tinterlace_pad 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-tinterlace_pad 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -gray 7ef396fecd8d1c9fe32173e4415ba671 +gray 227a6fe36a31fbef80210823454131ea yuv410p 35bc11d0d32efc9e9a969be7d720f4e6 yuv411p 17ef3cd22a74f7368b5e02f68779f294 yuv420p 93d5b6a4c44d67e4d4447e8dd0bf3d33 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-transpose mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-transpose --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-transpose 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-transpose 2023-03-03 13:29:59.000000000 +0000 @@ -59,6 +59,8 @@ nv42 636af6cd6a4f3ac5edc0fc3ce3c56d63 p010be ad0de2cc9bff81688b182a870fcf7000 p010le e7ff5143595021246733ce6bd0a769e8 +p012be ad0de2cc9bff81688b182a870fcf7000 +p012le 024ef1cf56a4872f202b96a6a4bbf10a p016be ad0de2cc9bff81688b182a870fcf7000 p016le e7ff5143595021246733ce6bd0a769e8 p410be 8b3e0ccb31b6a20ff00a29253fb2dec3 @@ -80,8 +82,12 @@ rgba 4d76a9542143752a4ac30f82f88f68f1 rgba64be a60041217f4c0cd796d19d3940a12a41 rgba64le ad47197774858858ae7b0c177dffa459 +vuya 9ece18a345beb17cd19e09e443eca4bf +vuyx 4c2929cd1c6e5512f62e802f482f0ef2 x2bgr10le 4aa774b6d8f6d446a64f1f288e5c97eb x2rgb10le 09cb1d98fe17ad8a6d9d3bec97ddc845 +xv30le b1ac5a12f46d32c70acb63f89838ab76 +xv36le f15a1d1af2a2967ec6a5efebc87e1ef1 xyz12be 68e5cba640f6e4ef72dff950e88b5342 xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9 ya16be 3e161cb5f225922a80fefdc9cc02a4f9 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-vflip mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-vflip --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-vflip 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/filter-pixfmts-vflip 2023-03-03 13:29:59.000000000 +0000 @@ -56,11 +56,14 @@ monob 7810c4857822ccfc844d78f5e803269a monow 90a947bfcd5f2261e83b577f48ec57b1 nv12 261ebe585ae2aa4e70d39a10c1679294 +nv16 f20f3448c900847aaff74429196f5a00 nv21 2909feacd27bebb080c8e0fa41795269 nv24 334420b9d3df84499d2ca16bb66eed2b nv42 ba4063e2795c17fea3c8a646b01fd1f5 p010be 06e9354b6e0e38ba41736352cedc0bd5 p010le fd18d322bffbf5816902c13102872e22 +p012be 06e9354b6e0e38ba41736352cedc0bd5 +p012le cdf6a3c38d9d4e3f079fa369e1dda662 p016be 06e9354b6e0e38ba41736352cedc0bd5 p016le fd18d322bffbf5816902c13102872e22 p210be ca886ab2b3ea5c153f1954b3709f7249 @@ -88,10 +91,16 @@ rgba64be 17e6273323b5779b5f3f775f150c1011 rgba64le 48f45b10503b7dd140329c3dd0d54c98 uyvy422 3a237e8376264e0cfa78f8a3fdadec8a +vuya fb849f76e56181e005c31fce75d7038c +vuyx 7a8079a97610e2c1c97aa8832b58a102 x2bgr10le 795b66a5fc83cd2cf300aae51c230f80 x2rgb10le 262c502230cf3724f8e2cf4737f18a42 +xv30le 7e29ee107a1fabf3c7251f337d4b9fe5 +xv36le aad3c6b5799b4e46a9c9ac27ee7db9bd xyz12be 810644e008deb231850d779aaa27cc7e xyz12le 829701db461b43533cf9241e0743bc61 +y210le 9544c81f8e1fc95e9fa4009dbecfea25 +y212le c801725ae31e3b8f5be269359d49f191 ya16be 55b1dbbe4d56ed0d22461685ce85520d ya16le d5bf02471823a16dc523a46cace0101a ya8 4299c6ca3b470a7d8a420e26eb485b1d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flcl1905 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flcl1905 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flcl1905 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flcl1905 2023-03-03 13:29:59.000000000 +0000 @@ -1,192 +1,192 @@ -packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=22528|duration_time=0.510839|size=4092|pos=56|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=56|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=22528|pts_time=0.510839|dts=22528|dts_time=0.510839|duration=22528|duration_time=0.510839|size=4092|pos=4148|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=22528|pts_time=0.510839|pkt_dts=22528|pkt_dts_time=0.510839|best_effort_timestamp=22528|best_effort_timestamp_time=0.510839|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=4148|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=45056|pts_time=1.021678|dts=45056|dts_time=1.021678|duration=22528|duration_time=0.510839|size=4092|pos=8240|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=45056|pts_time=1.021678|pkt_dts=45056|pkt_dts_time=1.021678|best_effort_timestamp=45056|best_effort_timestamp_time=1.021678|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=8240|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=67584|pts_time=1.532517|dts=67584|dts_time=1.532517|duration=22528|duration_time=0.510839|size=4092|pos=12332|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=67584|pts_time=1.532517|pkt_dts=67584|pkt_dts_time=1.532517|best_effort_timestamp=67584|best_effort_timestamp_time=1.532517|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=12332|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=90112|pts_time=2.043356|dts=90112|dts_time=2.043356|duration=22528|duration_time=0.510839|size=4092|pos=16424|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=90112|pts_time=2.043356|pkt_dts=90112|pkt_dts_time=2.043356|best_effort_timestamp=90112|best_effort_timestamp_time=2.043356|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=16424|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=112640|pts_time=2.554195|dts=112640|dts_time=2.554195|duration=22528|duration_time=0.510839|size=4092|pos=20516|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=112640|pts_time=2.554195|pkt_dts=112640|pkt_dts_time=2.554195|best_effort_timestamp=112640|best_effort_timestamp_time=2.554195|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=20516|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=135168|pts_time=3.065034|dts=135168|dts_time=3.065034|duration=22528|duration_time=0.510839|size=4092|pos=24608|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=135168|pts_time=3.065034|pkt_dts=135168|pkt_dts_time=3.065034|best_effort_timestamp=135168|best_effort_timestamp_time=3.065034|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=24608|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=157696|pts_time=3.575873|dts=157696|dts_time=3.575873|duration=22528|duration_time=0.510839|size=4092|pos=28700|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=157696|pts_time=3.575873|pkt_dts=157696|pkt_dts_time=3.575873|best_effort_timestamp=157696|best_effort_timestamp_time=3.575873|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=28700|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=180224|pts_time=4.086712|dts=180224|dts_time=4.086712|duration=22528|duration_time=0.510839|size=4092|pos=32792|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=180224|pts_time=4.086712|pkt_dts=180224|pkt_dts_time=4.086712|best_effort_timestamp=180224|best_effort_timestamp_time=4.086712|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=32792|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=202752|pts_time=4.597551|dts=202752|dts_time=4.597551|duration=22528|duration_time=0.510839|size=4092|pos=36884|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=202752|pts_time=4.597551|pkt_dts=202752|pkt_dts_time=4.597551|best_effort_timestamp=202752|best_effort_timestamp_time=4.597551|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=36884|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=225280|pts_time=5.108390|dts=225280|dts_time=5.108390|duration=22528|duration_time=0.510839|size=4092|pos=40976|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=225280|pts_time=5.108390|pkt_dts=225280|pkt_dts_time=5.108390|best_effort_timestamp=225280|best_effort_timestamp_time=5.108390|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=40976|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=247808|pts_time=5.619229|dts=247808|dts_time=5.619229|duration=22528|duration_time=0.510839|size=4092|pos=45068|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=247808|pts_time=5.619229|pkt_dts=247808|pkt_dts_time=5.619229|best_effort_timestamp=247808|best_effort_timestamp_time=5.619229|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=45068|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=270336|pts_time=6.130068|dts=270336|dts_time=6.130068|duration=22528|duration_time=0.510839|size=4092|pos=49160|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=270336|pts_time=6.130068|pkt_dts=270336|pkt_dts_time=6.130068|best_effort_timestamp=270336|best_effort_timestamp_time=6.130068|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=49160|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=292864|pts_time=6.640907|dts=292864|dts_time=6.640907|duration=22528|duration_time=0.510839|size=4092|pos=53252|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=292864|pts_time=6.640907|pkt_dts=292864|pkt_dts_time=6.640907|best_effort_timestamp=292864|best_effort_timestamp_time=6.640907|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=53252|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=315392|pts_time=7.151746|dts=315392|dts_time=7.151746|duration=22528|duration_time=0.510839|size=4092|pos=57344|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=315392|pts_time=7.151746|pkt_dts=315392|pkt_dts_time=7.151746|best_effort_timestamp=315392|best_effort_timestamp_time=7.151746|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=57344|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=337920|pts_time=7.662585|dts=337920|dts_time=7.662585|duration=22528|duration_time=0.510839|size=4092|pos=61436|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=337920|pts_time=7.662585|pkt_dts=337920|pkt_dts_time=7.662585|best_effort_timestamp=337920|best_effort_timestamp_time=7.662585|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|pkt_pos=61436|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown -packet|codec_type=audio|stream_index=0|pts=360448|pts_time=8.173424|dts=360448|dts_time=8.173424|duration=44|duration_time=0.000998|size=8|pos=65528|flags=K_ -frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=N/A|pkt_duration_time=N/A|pkt_pos=N/A|pkt_size=0|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=22528|duration_time=0.510839|size=4092|pos=56|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=56|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=22528|pts_time=0.510839|dts=22528|dts_time=0.510839|duration=22528|duration_time=0.510839|size=4092|pos=4148|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=22528|pts_time=0.510839|pkt_dts=22528|pkt_dts_time=0.510839|best_effort_timestamp=22528|best_effort_timestamp_time=0.510839|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=4148|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=45056|pts_time=1.021678|dts=45056|dts_time=1.021678|duration=22528|duration_time=0.510839|size=4092|pos=8240|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=45056|pts_time=1.021678|pkt_dts=45056|pkt_dts_time=1.021678|best_effort_timestamp=45056|best_effort_timestamp_time=1.021678|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=8240|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=67584|pts_time=1.532517|dts=67584|dts_time=1.532517|duration=22528|duration_time=0.510839|size=4092|pos=12332|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=67584|pts_time=1.532517|pkt_dts=67584|pkt_dts_time=1.532517|best_effort_timestamp=67584|best_effort_timestamp_time=1.532517|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=12332|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=90112|pts_time=2.043356|dts=90112|dts_time=2.043356|duration=22528|duration_time=0.510839|size=4092|pos=16424|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=90112|pts_time=2.043356|pkt_dts=90112|pkt_dts_time=2.043356|best_effort_timestamp=90112|best_effort_timestamp_time=2.043356|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=16424|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=112640|pts_time=2.554195|dts=112640|dts_time=2.554195|duration=22528|duration_time=0.510839|size=4092|pos=20516|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=112640|pts_time=2.554195|pkt_dts=112640|pkt_dts_time=2.554195|best_effort_timestamp=112640|best_effort_timestamp_time=2.554195|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=20516|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=135168|pts_time=3.065034|dts=135168|dts_time=3.065034|duration=22528|duration_time=0.510839|size=4092|pos=24608|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=135168|pts_time=3.065034|pkt_dts=135168|pkt_dts_time=3.065034|best_effort_timestamp=135168|best_effort_timestamp_time=3.065034|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=24608|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=157696|pts_time=3.575873|dts=157696|dts_time=3.575873|duration=22528|duration_time=0.510839|size=4092|pos=28700|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=157696|pts_time=3.575873|pkt_dts=157696|pkt_dts_time=3.575873|best_effort_timestamp=157696|best_effort_timestamp_time=3.575873|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=28700|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=180224|pts_time=4.086712|dts=180224|dts_time=4.086712|duration=22528|duration_time=0.510839|size=4092|pos=32792|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=180224|pts_time=4.086712|pkt_dts=180224|pkt_dts_time=4.086712|best_effort_timestamp=180224|best_effort_timestamp_time=4.086712|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=32792|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=202752|pts_time=4.597551|dts=202752|dts_time=4.597551|duration=22528|duration_time=0.510839|size=4092|pos=36884|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=202752|pts_time=4.597551|pkt_dts=202752|pkt_dts_time=4.597551|best_effort_timestamp=202752|best_effort_timestamp_time=4.597551|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=36884|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=225280|pts_time=5.108390|dts=225280|dts_time=5.108390|duration=22528|duration_time=0.510839|size=4092|pos=40976|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=225280|pts_time=5.108390|pkt_dts=225280|pkt_dts_time=5.108390|best_effort_timestamp=225280|best_effort_timestamp_time=5.108390|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=40976|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=247808|pts_time=5.619229|dts=247808|dts_time=5.619229|duration=22528|duration_time=0.510839|size=4092|pos=45068|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=247808|pts_time=5.619229|pkt_dts=247808|pkt_dts_time=5.619229|best_effort_timestamp=247808|best_effort_timestamp_time=5.619229|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=45068|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=270336|pts_time=6.130068|dts=270336|dts_time=6.130068|duration=22528|duration_time=0.510839|size=4092|pos=49160|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=270336|pts_time=6.130068|pkt_dts=270336|pkt_dts_time=6.130068|best_effort_timestamp=270336|best_effort_timestamp_time=6.130068|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=49160|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=292864|pts_time=6.640907|dts=292864|dts_time=6.640907|duration=22528|duration_time=0.510839|size=4092|pos=53252|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=292864|pts_time=6.640907|pkt_dts=292864|pkt_dts_time=6.640907|best_effort_timestamp=292864|best_effort_timestamp_time=6.640907|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=53252|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=315392|pts_time=7.151746|dts=315392|dts_time=7.151746|duration=22528|duration_time=0.510839|size=4092|pos=57344|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=315392|pts_time=7.151746|pkt_dts=315392|pkt_dts_time=7.151746|best_effort_timestamp=315392|best_effort_timestamp_time=7.151746|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=57344|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=337920|pts_time=7.662585|dts=337920|dts_time=7.662585|duration=22528|duration_time=0.510839|size=4092|pos=61436|flags=K__ +frame|media_type=audio|stream_index=0|key_frame=1|pts=337920|pts_time=7.662585|pkt_dts=337920|pkt_dts_time=7.662585|best_effort_timestamp=337920|best_effort_timestamp_time=7.662585|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=4092|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=3720|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=3348|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=2976|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=2604|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=2232|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=1860|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=1488|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=1116|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=744|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=22528|pkt_duration_time=0.510839|duration=22528|duration_time=0.510839|pkt_pos=61436|pkt_size=372|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown +packet|codec_type=audio|stream_index=0|pts=360448|pts_time=8.173424|dts=360448|dts_time=8.173424|duration=44|duration_time=0.000998|size=8|pos=65528|flags=K_C +frame|media_type=audio|stream_index=0|key_frame=1|pts=N/A|pts_time=N/A|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=N/A|best_effort_timestamp_time=N/A|pkt_duration=44|pkt_duration_time=0.000998|duration=44|duration_time=0.000998|pkt_pos=65528|pkt_size=8|sample_fmt=fltp|nb_samples=2048|channels=2|channel_layout=unknown diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-add_keyframe_index mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-add_keyframe_index --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-add_keyframe_index 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-add_keyframe_index 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -5f38d76da3ed4a5be06ca604c53666f2 *tests/data/fate/flv-add_keyframe_index.flv +9f3d6de74f3329651a4c515c20cea00f *tests/data/fate/flv-add_keyframe_index.flv 630192 tests/data/fate/flv-add_keyframe_index.flv #tb 0: 1/1000 #media_type 0: video diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-demux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-demux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-demux 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/flv-demux 2023-03-03 13:29:59.000000000 +0000 @@ -1,608 +1,608 @@ -packet|codec_type=audio|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=46|duration_time=0.046000|size=9|pos=3241|flags=K_|side_data|side_data_type=New Extradata -|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=33|duration_time=0.033000|size=135|pos=3267|flags=K_|side_data|side_data_type=New Extradata -|data_hash=CRC32:3f2ccc9e -packet|codec_type=video|stream_index=0|pts=33|pts_time=0.033000|dts=33|dts_time=0.033000|duration=33|duration_time=0.033000|size=92|pos=3422|flags=__|data_hash=CRC32:c14e72b2 -packet|codec_type=audio|stream_index=1|pts=46|pts_time=0.046000|dts=46|dts_time=0.046000|duration=46|duration_time=0.046000|size=9|pos=3534|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=67|pts_time=0.067000|dts=67|dts_time=0.067000|duration=33|duration_time=0.033000|size=14|pos=3560|flags=__|data_hash=CRC32:0b3c3ab4 -packet|codec_type=audio|stream_index=1|pts=93|pts_time=0.093000|dts=93|dts_time=0.093000|duration=46|duration_time=0.046000|size=9|pos=3594|flags=K_|data_hash=CRC32:42c079c5 -packet|codec_type=video|stream_index=0|pts=100|pts_time=0.100000|dts=100|dts_time=0.100000|duration=33|duration_time=0.033000|size=14|pos=3620|flags=__|data_hash=CRC32:280ad88b -packet|codec_type=video|stream_index=0|pts=133|pts_time=0.133000|dts=133|dts_time=0.133000|duration=33|duration_time=0.033000|size=117|pos=3654|flags=__|data_hash=CRC32:376f2497 -packet|codec_type=audio|stream_index=1|pts=139|pts_time=0.139000|dts=139|dts_time=0.139000|duration=46|duration_time=0.046000|size=89|pos=3791|flags=K_|data_hash=CRC32:548db44a -packet|codec_type=video|stream_index=0|pts=167|pts_time=0.167000|dts=167|dts_time=0.167000|duration=33|duration_time=0.033000|size=14|pos=3897|flags=__|data_hash=CRC32:0811a146 -packet|codec_type=audio|stream_index=1|pts=186|pts_time=0.186000|dts=186|dts_time=0.186000|duration=46|duration_time=0.046000|size=155|pos=3931|flags=K_|data_hash=CRC32:a7111723 -packet|codec_type=video|stream_index=0|pts=200|pts_time=0.200000|dts=200|dts_time=0.200000|duration=33|duration_time=0.033000|size=14|pos=4103|flags=__|data_hash=CRC32:3bfeef21 -packet|codec_type=audio|stream_index=1|pts=232|pts_time=0.232000|dts=232|dts_time=0.232000|duration=46|duration_time=0.046000|size=281|pos=4137|flags=K_|data_hash=CRC32:27f537aa -packet|codec_type=video|stream_index=0|pts=234|pts_time=0.234000|dts=234|dts_time=0.234000|duration=33|duration_time=0.033000|size=117|pos=4435|flags=__|data_hash=CRC32:2bc5eba8 -packet|codec_type=video|stream_index=0|pts=267|pts_time=0.267000|dts=267|dts_time=0.267000|duration=33|duration_time=0.033000|size=14|pos=4572|flags=__|data_hash=CRC32:0033671d -packet|codec_type=audio|stream_index=1|pts=279|pts_time=0.279000|dts=279|dts_time=0.279000|duration=46|duration_time=0.046000|size=548|pos=4606|flags=K_|data_hash=CRC32:7ab3c7cb -packet|codec_type=video|stream_index=0|pts=300|pts_time=0.300000|dts=300|dts_time=0.300000|duration=33|duration_time=0.033000|size=14|pos=5171|flags=__|data_hash=CRC32:dfb4f951 -packet|codec_type=audio|stream_index=1|pts=325|pts_time=0.325000|dts=325|dts_time=0.325000|duration=46|duration_time=0.046000|size=472|pos=5205|flags=K_|data_hash=CRC32:d10a7849 -packet|codec_type=video|stream_index=0|pts=334|pts_time=0.334000|dts=334|dts_time=0.334000|duration=33|duration_time=0.033000|size=117|pos=5694|flags=__|data_hash=CRC32:97814fc1 -packet|codec_type=video|stream_index=0|pts=367|pts_time=0.367000|dts=367|dts_time=0.367000|duration=33|duration_time=0.033000|size=14|pos=5831|flags=__|data_hash=CRC32:3c206b65 -packet|codec_type=audio|stream_index=1|pts=372|pts_time=0.372000|dts=372|dts_time=0.372000|duration=46|duration_time=0.046000|size=489|pos=5865|flags=K_|data_hash=CRC32:4d3f1f03 -packet|codec_type=video|stream_index=0|pts=400|pts_time=0.400000|dts=400|dts_time=0.400000|duration=33|duration_time=0.033000|size=14|pos=6371|flags=__|data_hash=CRC32:0fcf2502 -packet|codec_type=audio|stream_index=1|pts=418|pts_time=0.418000|dts=418|dts_time=0.418000|duration=46|duration_time=0.046000|size=357|pos=6405|flags=K_|data_hash=CRC32:eccea9c1 -packet|codec_type=video|stream_index=0|pts=434|pts_time=0.434000|dts=434|dts_time=0.434000|duration=33|duration_time=0.033000|size=207|pos=6779|flags=__|data_hash=CRC32:86bab8df -packet|codec_type=audio|stream_index=1|pts=464|pts_time=0.464000|dts=464|dts_time=0.464000|duration=46|duration_time=0.046000|size=262|pos=7006|flags=K_|data_hash=CRC32:50b0e3b7 -packet|codec_type=video|stream_index=0|pts=467|pts_time=0.467000|dts=467|dts_time=0.467000|duration=33|duration_time=0.033000|size=14|pos=7285|flags=__|data_hash=CRC32:8704a589 -packet|codec_type=video|stream_index=0|pts=501|pts_time=0.501000|dts=501|dts_time=0.501000|duration=33|duration_time=0.033000|size=14|pos=7319|flags=__|data_hash=CRC32:d3357720 -packet|codec_type=audio|stream_index=1|pts=511|pts_time=0.511000|dts=511|dts_time=0.511000|duration=46|duration_time=0.046000|size=294|pos=7353|flags=K_|data_hash=CRC32:805a1f22 -packet|codec_type=video|stream_index=0|pts=534|pts_time=0.534000|dts=534|dts_time=0.534000|duration=33|duration_time=0.033000|size=179|pos=7664|flags=__|data_hash=CRC32:5b61c9b6 -packet|codec_type=audio|stream_index=1|pts=557|pts_time=0.557000|dts=557|dts_time=0.557000|duration=46|duration_time=0.046000|size=204|pos=7863|flags=K_|data_hash=CRC32:7f4a9c90 -packet|codec_type=video|stream_index=0|pts=567|pts_time=0.567000|dts=567|dts_time=0.567000|duration=33|duration_time=0.033000|size=14|pos=8084|flags=__|data_hash=CRC32:44067395 -packet|codec_type=video|stream_index=0|pts=601|pts_time=0.601000|dts=601|dts_time=0.601000|duration=33|duration_time=0.033000|size=14|pos=8118|flags=__|data_hash=CRC32:00ee0d64 -packet|codec_type=audio|stream_index=1|pts=604|pts_time=0.604000|dts=604|dts_time=0.604000|duration=46|duration_time=0.046000|size=275|pos=8152|flags=K_|data_hash=CRC32:d04e94cd -packet|codec_type=video|stream_index=0|pts=634|pts_time=0.634000|dts=634|dts_time=0.634000|duration=33|duration_time=0.033000|size=32|pos=8444|flags=__|data_hash=CRC32:41c4e3cb -packet|codec_type=audio|stream_index=1|pts=650|pts_time=0.650000|dts=650|dts_time=0.650000|duration=46|duration_time=0.046000|size=309|pos=8496|flags=K_|data_hash=CRC32:c3b4718d -packet|codec_type=video|stream_index=0|pts=667|pts_time=0.667000|dts=667|dts_time=0.667000|duration=33|duration_time=0.033000|size=30|pos=8822|flags=__|data_hash=CRC32:9894f2b3 -packet|codec_type=audio|stream_index=1|pts=697|pts_time=0.697000|dts=697|dts_time=0.697000|duration=46|duration_time=0.046000|size=280|pos=8872|flags=K_|data_hash=CRC32:683aa168 -packet|codec_type=video|stream_index=0|pts=701|pts_time=0.701000|dts=701|dts_time=0.701000|duration=33|duration_time=0.033000|size=16|pos=9169|flags=__|data_hash=CRC32:33031360 -packet|codec_type=video|stream_index=0|pts=734|pts_time=0.734000|dts=734|dts_time=0.734000|duration=33|duration_time=0.033000|size=33|pos=9205|flags=__|data_hash=CRC32:4cb9408b -packet|codec_type=audio|stream_index=1|pts=743|pts_time=0.743000|dts=743|dts_time=0.743000|duration=46|duration_time=0.046000|size=106|pos=9258|flags=K_|data_hash=CRC32:d3693544 -packet|codec_type=video|stream_index=0|pts=767|pts_time=0.767000|dts=767|dts_time=0.767000|duration=33|duration_time=0.033000|size=16|pos=9381|flags=__|data_hash=CRC32:ebca8d2b -packet|codec_type=audio|stream_index=1|pts=789|pts_time=0.789000|dts=789|dts_time=0.789000|duration=46|duration_time=0.046000|size=133|pos=9417|flags=K_|data_hash=CRC32:848dc228 -packet|codec_type=video|stream_index=0|pts=801|pts_time=0.801000|dts=801|dts_time=0.801000|duration=33|duration_time=0.033000|size=16|pos=9567|flags=__|data_hash=CRC32:9d238d80 -packet|codec_type=video|stream_index=0|pts=834|pts_time=0.834000|dts=834|dts_time=0.834000|duration=33|duration_time=0.033000|size=22|pos=9603|flags=__|data_hash=CRC32:d606882e -packet|codec_type=audio|stream_index=1|pts=836|pts_time=0.836000|dts=836|dts_time=0.836000|duration=46|duration_time=0.046000|size=380|pos=9645|flags=K_|data_hash=CRC32:70b58912 -packet|codec_type=video|stream_index=0|pts=868|pts_time=0.868000|dts=868|dts_time=0.868000|duration=33|duration_time=0.033000|size=14|pos=10042|flags=__|data_hash=CRC32:39d914b1 -packet|codec_type=audio|stream_index=1|pts=882|pts_time=0.882000|dts=882|dts_time=0.882000|duration=46|duration_time=0.046000|size=378|pos=10076|flags=K_|data_hash=CRC32:7eaf35cb -packet|codec_type=video|stream_index=0|pts=901|pts_time=0.901000|dts=901|dts_time=0.901000|duration=33|duration_time=0.033000|size=14|pos=10471|flags=__|data_hash=CRC32:1aeff68e -packet|codec_type=audio|stream_index=1|pts=929|pts_time=0.929000|dts=929|dts_time=0.929000|duration=46|duration_time=0.046000|size=108|pos=10505|flags=K_|data_hash=CRC32:8bf2b703 -packet|codec_type=video|stream_index=0|pts=934|pts_time=0.934000|dts=934|dts_time=0.934000|duration=33|duration_time=0.033000|size=55|pos=10630|flags=__|data_hash=CRC32:26064135 -packet|codec_type=video|stream_index=0|pts=968|pts_time=0.968000|dts=968|dts_time=0.968000|duration=33|duration_time=0.033000|size=14|pos=10705|flags=__|data_hash=CRC32:abb369c4 -packet|codec_type=audio|stream_index=1|pts=975|pts_time=0.975000|dts=975|dts_time=0.975000|duration=46|duration_time=0.046000|size=279|pos=10739|flags=K_|data_hash=CRC32:6bff85a8 -packet|codec_type=video|stream_index=0|pts=1001|pts_time=1.001000|dts=1001|dts_time=1.001000|duration=33|duration_time=0.033000|size=14|pos=11035|flags=__|data_hash=CRC32:1af77344 -packet|codec_type=audio|stream_index=1|pts=1022|pts_time=1.022000|dts=1022|dts_time=1.022000|duration=46|duration_time=0.046000|size=134|pos=11069|flags=K_|data_hash=CRC32:349e2a8c -packet|codec_type=video|stream_index=0|pts=1034|pts_time=1.034000|dts=1034|dts_time=1.034000|duration=33|duration_time=0.033000|size=58|pos=11220|flags=__|data_hash=CRC32:8b2e7991 -packet|codec_type=audio|stream_index=1|pts=1068|pts_time=1.068000|dts=1068|dts_time=1.068000|duration=46|duration_time=0.046000|size=162|pos=11298|flags=K_|data_hash=CRC32:f64effd2 -packet|codec_type=video|stream_index=0|pts=1068|pts_time=1.068000|dts=1068|dts_time=1.068000|duration=33|duration_time=0.033000|size=39|pos=11477|flags=__|data_hash=CRC32:0ae377c8 -packet|codec_type=video|stream_index=0|pts=1101|pts_time=1.101000|dts=1101|dts_time=1.101000|duration=33|duration_time=0.033000|size=48|pos=11536|flags=__|data_hash=CRC32:1bc6d22d -packet|codec_type=audio|stream_index=1|pts=1115|pts_time=1.115000|dts=1115|dts_time=1.115000|duration=46|duration_time=0.046000|size=46|pos=11604|flags=K_|data_hash=CRC32:3dfbc696 -packet|codec_type=video|stream_index=0|pts=1134|pts_time=1.134000|dts=1134|dts_time=1.134000|duration=33|duration_time=0.033000|size=319|pos=11667|flags=__|data_hash=CRC32:39d9a172 -packet|codec_type=audio|stream_index=1|pts=1161|pts_time=1.161000|dts=1161|dts_time=1.161000|duration=46|duration_time=0.046000|size=150|pos=12006|flags=K_|data_hash=CRC32:eec82a0f -packet|codec_type=video|stream_index=0|pts=1168|pts_time=1.168000|dts=1168|dts_time=1.168000|duration=33|duration_time=0.033000|size=204|pos=12173|flags=__|data_hash=CRC32:96683004 -packet|codec_type=video|stream_index=0|pts=1201|pts_time=1.201000|dts=1201|dts_time=1.201000|duration=33|duration_time=0.033000|size=240|pos=12397|flags=__|data_hash=CRC32:65f1defa -packet|codec_type=audio|stream_index=1|pts=1207|pts_time=1.207000|dts=1207|dts_time=1.207000|duration=46|duration_time=0.046000|size=427|pos=12657|flags=K_|data_hash=CRC32:e8361847 -packet|codec_type=video|stream_index=0|pts=1235|pts_time=1.235000|dts=1235|dts_time=1.235000|duration=33|duration_time=0.033000|size=305|pos=13101|flags=__|data_hash=CRC32:12e13d9c -packet|codec_type=audio|stream_index=1|pts=1254|pts_time=1.254000|dts=1254|dts_time=1.254000|duration=46|duration_time=0.046000|size=616|pos=13426|flags=K_|data_hash=CRC32:65e6a966 -packet|codec_type=video|stream_index=0|pts=1268|pts_time=1.268000|dts=1268|dts_time=1.268000|duration=33|duration_time=0.033000|size=217|pos=14059|flags=__|data_hash=CRC32:741596bf -packet|codec_type=audio|stream_index=1|pts=1300|pts_time=1.300000|dts=1300|dts_time=1.300000|duration=46|duration_time=0.046000|size=736|pos=14296|flags=K_|data_hash=CRC32:bf178137 -packet|codec_type=video|stream_index=0|pts=1301|pts_time=1.301000|dts=1301|dts_time=1.301000|duration=33|duration_time=0.033000|size=236|pos=15049|flags=__|data_hash=CRC32:e857a41f -packet|codec_type=video|stream_index=0|pts=1335|pts_time=1.335000|dts=1335|dts_time=1.335000|duration=33|duration_time=0.033000|size=222|pos=15305|flags=__|data_hash=CRC32:02e5c508 -packet|codec_type=audio|stream_index=1|pts=1347|pts_time=1.347000|dts=1347|dts_time=1.347000|duration=46|duration_time=0.046000|size=708|pos=15547|flags=K_|data_hash=CRC32:cd4df572 -packet|codec_type=video|stream_index=0|pts=1368|pts_time=1.368000|dts=1368|dts_time=1.368000|duration=33|duration_time=0.033000|size=1295|pos=16272|flags=K_|data_hash=CRC32:65d347c4 -packet|codec_type=audio|stream_index=1|pts=1393|pts_time=1.393000|dts=1393|dts_time=1.393000|duration=46|duration_time=0.046000|size=717|pos=17587|flags=K_|data_hash=CRC32:72de4551 -packet|codec_type=video|stream_index=0|pts=1401|pts_time=1.401000|dts=1401|dts_time=1.401000|duration=33|duration_time=0.033000|size=653|pos=18321|flags=__|data_hash=CRC32:b9f01826 -packet|codec_type=video|stream_index=0|pts=1435|pts_time=1.435000|dts=1435|dts_time=1.435000|duration=33|duration_time=0.033000|size=335|pos=18994|flags=__|data_hash=CRC32:9e2e9463 -packet|codec_type=audio|stream_index=1|pts=1440|pts_time=1.440000|dts=1440|dts_time=1.440000|duration=46|duration_time=0.046000|size=730|pos=19349|flags=K_|data_hash=CRC32:8f424fb7 -packet|codec_type=video|stream_index=0|pts=1468|pts_time=1.468000|dts=1468|dts_time=1.468000|duration=33|duration_time=0.033000|size=765|pos=20096|flags=__|data_hash=CRC32:09b3b571 -packet|codec_type=audio|stream_index=1|pts=1486|pts_time=1.486000|dts=1486|dts_time=1.486000|duration=46|duration_time=0.046000|size=756|pos=20881|flags=K_|data_hash=CRC32:4921e8da -packet|codec_type=video|stream_index=0|pts=1502|pts_time=1.502000|dts=1502|dts_time=1.502000|duration=33|duration_time=0.033000|size=213|pos=21654|flags=__|data_hash=CRC32:c7c9280a -packet|codec_type=audio|stream_index=1|pts=1533|pts_time=1.533000|dts=1533|dts_time=1.533000|duration=46|duration_time=0.046000|size=664|pos=21887|flags=K_|data_hash=CRC32:e093637e -packet|codec_type=video|stream_index=0|pts=1535|pts_time=1.535000|dts=1535|dts_time=1.535000|duration=33|duration_time=0.033000|size=464|pos=22568|flags=__|data_hash=CRC32:e555cff4 -packet|codec_type=video|stream_index=0|pts=1568|pts_time=1.568000|dts=1568|dts_time=1.568000|duration=33|duration_time=0.033000|size=561|pos=23052|flags=__|data_hash=CRC32:5e5d560b -packet|codec_type=audio|stream_index=1|pts=1579|pts_time=1.579000|dts=1579|dts_time=1.579000|duration=46|duration_time=0.046000|size=751|pos=23633|flags=K_|data_hash=CRC32:7d228f8d -packet|codec_type=video|stream_index=0|pts=1602|pts_time=1.602000|dts=1602|dts_time=1.602000|duration=33|duration_time=0.033000|size=876|pos=24401|flags=__|data_hash=CRC32:e92ee634 -packet|codec_type=audio|stream_index=1|pts=1625|pts_time=1.625000|dts=1625|dts_time=1.625000|duration=46|duration_time=0.046000|size=780|pos=25297|flags=K_|data_hash=CRC32:9b9cba9e -packet|codec_type=video|stream_index=0|pts=1635|pts_time=1.635000|dts=1635|dts_time=1.635000|duration=33|duration_time=0.033000|size=473|pos=26094|flags=__|data_hash=CRC32:4797e66e -packet|codec_type=video|stream_index=0|pts=1668|pts_time=1.668000|dts=1668|dts_time=1.668000|duration=33|duration_time=0.033000|size=272|pos=26587|flags=__|data_hash=CRC32:86c1281c -packet|codec_type=audio|stream_index=1|pts=1672|pts_time=1.672000|dts=1672|dts_time=1.672000|duration=46|duration_time=0.046000|size=404|pos=26879|flags=K_|data_hash=CRC32:89d51769 -packet|codec_type=video|stream_index=0|pts=1702|pts_time=1.702000|dts=1702|dts_time=1.702000|duration=33|duration_time=0.033000|size=281|pos=27300|flags=__|data_hash=CRC32:b5f22b1a -packet|codec_type=audio|stream_index=1|pts=1718|pts_time=1.718000|dts=1718|dts_time=1.718000|duration=46|duration_time=0.046000|size=326|pos=27601|flags=K_|data_hash=CRC32:3723e2b7 -packet|codec_type=video|stream_index=0|pts=1735|pts_time=1.735000|dts=1735|dts_time=1.735000|duration=33|duration_time=0.033000|size=315|pos=27944|flags=__|data_hash=CRC32:322931af -packet|codec_type=audio|stream_index=1|pts=1765|pts_time=1.765000|dts=1765|dts_time=1.765000|duration=46|duration_time=0.046000|size=77|pos=28279|flags=K_|data_hash=CRC32:181325ba -packet|codec_type=video|stream_index=0|pts=1768|pts_time=1.768000|dts=1768|dts_time=1.768000|duration=33|duration_time=0.033000|size=653|pos=28373|flags=__|data_hash=CRC32:53cc49de -packet|codec_type=video|stream_index=0|pts=1802|pts_time=1.802000|dts=1802|dts_time=1.802000|duration=33|duration_time=0.033000|size=228|pos=29046|flags=__|data_hash=CRC32:bb222de5 -packet|codec_type=audio|stream_index=1|pts=1811|pts_time=1.811000|dts=1811|dts_time=1.811000|duration=46|duration_time=0.046000|size=132|pos=29294|flags=K_|data_hash=CRC32:1bef55db -packet|codec_type=video|stream_index=0|pts=1835|pts_time=1.835000|dts=1835|dts_time=1.835000|duration=33|duration_time=0.033000|size=265|pos=29443|flags=__|data_hash=CRC32:d4f0d444 -packet|codec_type=audio|stream_index=1|pts=1858|pts_time=1.858000|dts=1858|dts_time=1.858000|duration=46|duration_time=0.046000|size=266|pos=29728|flags=K_|data_hash=CRC32:126ec6c3 -packet|codec_type=video|stream_index=0|pts=1869|pts_time=1.869000|dts=1869|dts_time=1.869000|duration=33|duration_time=0.033000|size=362|pos=30011|flags=__|data_hash=CRC32:a3399859 -packet|codec_type=video|stream_index=0|pts=1902|pts_time=1.902000|dts=1902|dts_time=1.902000|duration=33|duration_time=0.033000|size=362|pos=30393|flags=__|data_hash=CRC32:b4462dfc -packet|codec_type=audio|stream_index=1|pts=1904|pts_time=1.904000|dts=1904|dts_time=1.904000|duration=46|duration_time=0.046000|size=297|pos=30775|flags=K_|data_hash=CRC32:8a286293 -packet|codec_type=video|stream_index=0|pts=1935|pts_time=1.935000|dts=1935|dts_time=1.935000|duration=33|duration_time=0.033000|size=297|pos=31089|flags=__|data_hash=CRC32:ead314f3 -packet|codec_type=audio|stream_index=1|pts=1950|pts_time=1.950000|dts=1950|dts_time=1.950000|duration=46|duration_time=0.046000|size=9|pos=31406|flags=K_|data_hash=CRC32:3395d413 -packet|codec_type=video|stream_index=0|pts=1969|pts_time=1.969000|dts=1969|dts_time=1.969000|duration=33|duration_time=0.033000|size=395|pos=31432|flags=__|data_hash=CRC32:2d27c345 -packet|codec_type=audio|stream_index=1|pts=1997|pts_time=1.997000|dts=1997|dts_time=1.997000|duration=46|duration_time=0.046000|size=9|pos=31847|flags=K_|data_hash=CRC32:6b5dbb28 -packet|codec_type=video|stream_index=0|pts=2002|pts_time=2.002000|dts=2002|dts_time=2.002000|duration=33|duration_time=0.033000|size=149|pos=31873|flags=__|data_hash=CRC32:cbf3938c -packet|codec_type=video|stream_index=0|pts=2035|pts_time=2.035000|dts=2035|dts_time=2.035000|duration=33|duration_time=0.033000|size=141|pos=32042|flags=__|data_hash=CRC32:8b92a9de -packet|codec_type=audio|stream_index=1|pts=2043|pts_time=2.043000|dts=2043|dts_time=2.043000|duration=46|duration_time=0.046000|size=9|pos=32203|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2069|pts_time=2.069000|dts=2069|dts_time=2.069000|duration=33|duration_time=0.033000|size=317|pos=32229|flags=__|data_hash=CRC32:5362eed3 -packet|codec_type=audio|stream_index=1|pts=2090|pts_time=2.090000|dts=2090|dts_time=2.090000|duration=46|duration_time=0.046000|size=9|pos=32566|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2102|pts_time=2.102000|dts=2102|dts_time=2.102000|duration=33|duration_time=0.033000|size=170|pos=32592|flags=__|data_hash=CRC32:867c837a -packet|codec_type=video|stream_index=0|pts=2135|pts_time=2.135000|dts=2135|dts_time=2.135000|duration=33|duration_time=0.033000|size=443|pos=32782|flags=__|data_hash=CRC32:5bc93901 -packet|codec_type=audio|stream_index=1|pts=2136|pts_time=2.136000|dts=2136|dts_time=2.136000|duration=46|duration_time=0.046000|size=9|pos=33245|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2169|pts_time=2.169000|dts=2169|dts_time=2.169000|duration=33|duration_time=0.033000|size=224|pos=33271|flags=__|data_hash=CRC32:8eddf111 -packet|codec_type=audio|stream_index=1|pts=2183|pts_time=2.183000|dts=2183|dts_time=2.183000|duration=46|duration_time=0.046000|size=9|pos=33515|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2202|pts_time=2.202000|dts=2202|dts_time=2.202000|duration=33|duration_time=0.033000|size=472|pos=33541|flags=__|data_hash=CRC32:abe7ea6c -packet|codec_type=audio|stream_index=1|pts=2229|pts_time=2.229000|dts=2229|dts_time=2.229000|duration=46|duration_time=0.046000|size=9|pos=34033|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2236|pts_time=2.236000|dts=2236|dts_time=2.236000|duration=33|duration_time=0.033000|size=188|pos=34059|flags=__|data_hash=CRC32:73b69b1a -packet|codec_type=video|stream_index=0|pts=2269|pts_time=2.269000|dts=2269|dts_time=2.269000|duration=33|duration_time=0.033000|size=302|pos=34267|flags=__|data_hash=CRC32:81ba5025 -packet|codec_type=audio|stream_index=1|pts=2276|pts_time=2.276000|dts=2276|dts_time=2.276000|duration=46|duration_time=0.046000|size=9|pos=34589|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2302|pts_time=2.302000|dts=2302|dts_time=2.302000|duration=33|duration_time=0.033000|size=125|pos=34615|flags=__|data_hash=CRC32:16e31418 -packet|codec_type=audio|stream_index=1|pts=2322|pts_time=2.322000|dts=2322|dts_time=2.322000|duration=46|duration_time=0.046000|size=9|pos=34760|flags=K_|data_hash=CRC32:bbb61b93 -packet|codec_type=video|stream_index=0|pts=2336|pts_time=2.336000|dts=2336|dts_time=2.336000|duration=33|duration_time=0.033000|size=810|pos=34786|flags=__|data_hash=CRC32:409d7bc5 -packet|codec_type=audio|stream_index=1|pts=2368|pts_time=2.368000|dts=2368|dts_time=2.368000|duration=46|duration_time=0.046000|size=304|pos=35616|flags=K_|data_hash=CRC32:d7355e6f -packet|codec_type=video|stream_index=0|pts=2369|pts_time=2.369000|dts=2369|dts_time=2.369000|duration=33|duration_time=0.033000|size=158|pos=35937|flags=__|data_hash=CRC32:bb167cd2 -packet|codec_type=video|stream_index=0|pts=2402|pts_time=2.402000|dts=2402|dts_time=2.402000|duration=33|duration_time=0.033000|size=561|pos=36115|flags=__|data_hash=CRC32:582133cb -packet|codec_type=audio|stream_index=1|pts=2415|pts_time=2.415000|dts=2415|dts_time=2.415000|duration=46|duration_time=0.046000|size=683|pos=36696|flags=K_|data_hash=CRC32:0e95a3a0 -packet|codec_type=video|stream_index=0|pts=2436|pts_time=2.436000|dts=2436|dts_time=2.436000|duration=33|duration_time=0.033000|size=383|pos=37396|flags=__|data_hash=CRC32:a2c19b0b -packet|codec_type=audio|stream_index=1|pts=2461|pts_time=2.461000|dts=2461|dts_time=2.461000|duration=46|duration_time=0.046000|size=681|pos=37799|flags=K_|data_hash=CRC32:326a32e5 -packet|codec_type=video|stream_index=0|pts=2469|pts_time=2.469000|dts=2469|dts_time=2.469000|duration=33|duration_time=0.033000|size=218|pos=38497|flags=__|data_hash=CRC32:bda38cdd -packet|codec_type=video|stream_index=0|pts=2503|pts_time=2.503000|dts=2503|dts_time=2.503000|duration=33|duration_time=0.033000|size=270|pos=38735|flags=__|data_hash=CRC32:18a59365 -packet|codec_type=audio|stream_index=1|pts=2508|pts_time=2.508000|dts=2508|dts_time=2.508000|duration=46|duration_time=0.046000|size=663|pos=39025|flags=K_|data_hash=CRC32:04b4fe14 -packet|codec_type=video|stream_index=0|pts=2536|pts_time=2.536000|dts=2536|dts_time=2.536000|duration=33|duration_time=0.033000|size=182|pos=39705|flags=__|data_hash=CRC32:3f9da83b -packet|codec_type=audio|stream_index=1|pts=2554|pts_time=2.554000|dts=2554|dts_time=2.554000|duration=46|duration_time=0.046000|size=671|pos=39907|flags=K_|data_hash=CRC32:b8c62ab4 -packet|codec_type=video|stream_index=0|pts=2569|pts_time=2.569000|dts=2569|dts_time=2.569000|duration=33|duration_time=0.033000|size=1063|pos=40595|flags=K_|data_hash=CRC32:89a9f14f -packet|codec_type=audio|stream_index=1|pts=2601|pts_time=2.601000|dts=2601|dts_time=2.601000|duration=46|duration_time=0.046000|size=682|pos=41678|flags=K_|data_hash=CRC32:e95e8d23 -packet|codec_type=video|stream_index=0|pts=2603|pts_time=2.603000|dts=2603|dts_time=2.603000|duration=33|duration_time=0.033000|size=3687|pos=42377|flags=__|data_hash=CRC32:e9d6144b -packet|codec_type=video|stream_index=0|pts=2636|pts_time=2.636000|dts=2636|dts_time=2.636000|duration=33|duration_time=0.033000|size=280|pos=46084|flags=__|data_hash=CRC32:520c7765 -packet|codec_type=audio|stream_index=1|pts=2647|pts_time=2.647000|dts=2647|dts_time=2.647000|duration=46|duration_time=0.046000|size=698|pos=46384|flags=K_|data_hash=CRC32:0631a240 -packet|codec_type=video|stream_index=0|pts=2669|pts_time=2.669000|dts=2669|dts_time=2.669000|duration=33|duration_time=0.033000|size=475|pos=47099|flags=__|data_hash=CRC32:e1a7746b -packet|codec_type=audio|stream_index=1|pts=2694|pts_time=2.694000|dts=2694|dts_time=2.694000|duration=46|duration_time=0.046000|size=697|pos=47594|flags=K_|data_hash=CRC32:0e9feb04 -packet|codec_type=video|stream_index=0|pts=2703|pts_time=2.703000|dts=2703|dts_time=2.703000|duration=33|duration_time=0.033000|size=488|pos=48308|flags=__|data_hash=CRC32:ba916d5f -packet|codec_type=video|stream_index=0|pts=2736|pts_time=2.736000|dts=2736|dts_time=2.736000|duration=33|duration_time=0.033000|size=532|pos=48816|flags=__|data_hash=CRC32:bb384278 -packet|codec_type=audio|stream_index=1|pts=2740|pts_time=2.740000|dts=2740|dts_time=2.740000|duration=46|duration_time=0.046000|size=674|pos=49368|flags=K_|data_hash=CRC32:9859c9fe -packet|codec_type=video|stream_index=0|pts=2769|pts_time=2.769000|dts=2769|dts_time=2.769000|duration=33|duration_time=0.033000|size=590|pos=50059|flags=__|data_hash=CRC32:55a84515 -packet|codec_type=audio|stream_index=1|pts=2786|pts_time=2.786000|dts=2786|dts_time=2.786000|duration=46|duration_time=0.046000|size=651|pos=50669|flags=K_|data_hash=CRC32:642d943c -packet|codec_type=video|stream_index=0|pts=2803|pts_time=2.803000|dts=2803|dts_time=2.803000|duration=33|duration_time=0.033000|size=683|pos=51337|flags=__|data_hash=CRC32:ed48440d -packet|codec_type=audio|stream_index=1|pts=2833|pts_time=2.833000|dts=2833|dts_time=2.833000|duration=46|duration_time=0.046000|size=672|pos=52040|flags=K_|data_hash=CRC32:f2af0db0 -packet|codec_type=video|stream_index=0|pts=2836|pts_time=2.836000|dts=2836|dts_time=2.836000|duration=33|duration_time=0.033000|size=836|pos=52729|flags=__|data_hash=CRC32:d99a6f79 -packet|codec_type=video|stream_index=0|pts=2870|pts_time=2.870000|dts=2870|dts_time=2.870000|duration=33|duration_time=0.033000|size=676|pos=53585|flags=__|data_hash=CRC32:ed426283 -packet|codec_type=audio|stream_index=1|pts=2879|pts_time=2.879000|dts=2879|dts_time=2.879000|duration=46|duration_time=0.046000|size=665|pos=54281|flags=K_|data_hash=CRC32:d6e66995 -packet|codec_type=video|stream_index=0|pts=2903|pts_time=2.903000|dts=2903|dts_time=2.903000|duration=33|duration_time=0.033000|size=731|pos=54963|flags=__|data_hash=CRC32:9df509dc -packet|codec_type=audio|stream_index=1|pts=2926|pts_time=2.926000|dts=2926|dts_time=2.926000|duration=46|duration_time=0.046000|size=734|pos=55714|flags=K_|data_hash=CRC32:2e13e9fe -packet|codec_type=video|stream_index=0|pts=2936|pts_time=2.936000|dts=2936|dts_time=2.936000|duration=33|duration_time=0.033000|size=839|pos=56465|flags=__|data_hash=CRC32:dc12a67f -packet|codec_type=video|stream_index=0|pts=2970|pts_time=2.970000|dts=2970|dts_time=2.970000|duration=33|duration_time=0.033000|size=787|pos=57324|flags=__|data_hash=CRC32:db72a014 -packet|codec_type=audio|stream_index=1|pts=2972|pts_time=2.972000|dts=2972|dts_time=2.972000|duration=46|duration_time=0.046000|size=732|pos=58131|flags=K_|data_hash=CRC32:9cfb9b77 -packet|codec_type=video|stream_index=0|pts=3003|pts_time=3.003000|dts=3003|dts_time=3.003000|duration=33|duration_time=0.033000|size=1039|pos=58880|flags=__|data_hash=CRC32:bf96f792 -packet|codec_type=audio|stream_index=1|pts=3019|pts_time=3.019000|dts=3019|dts_time=3.019000|duration=46|duration_time=0.046000|size=742|pos=59939|flags=K_|data_hash=CRC32:51cb6568 -packet|codec_type=video|stream_index=0|pts=3036|pts_time=3.036000|dts=3036|dts_time=3.036000|duration=33|duration_time=0.033000|size=851|pos=60698|flags=__|data_hash=CRC32:45237f01 -packet|codec_type=audio|stream_index=1|pts=3065|pts_time=3.065000|dts=3065|dts_time=3.065000|duration=46|duration_time=0.046000|size=748|pos=61569|flags=K_|data_hash=CRC32:5c676c58 -packet|codec_type=video|stream_index=0|pts=3070|pts_time=3.070000|dts=3070|dts_time=3.070000|duration=33|duration_time=0.033000|size=928|pos=62334|flags=__|data_hash=CRC32:cef81f2c -packet|codec_type=video|stream_index=0|pts=3103|pts_time=3.103000|dts=3103|dts_time=3.103000|duration=33|duration_time=0.033000|size=840|pos=63282|flags=__|data_hash=CRC32:7ae6a4a0 -packet|codec_type=audio|stream_index=1|pts=3111|pts_time=3.111000|dts=3111|dts_time=3.111000|duration=46|duration_time=0.046000|size=671|pos=64142|flags=K_|data_hash=CRC32:c4c27684 -packet|codec_type=video|stream_index=0|pts=3136|pts_time=3.136000|dts=3136|dts_time=3.136000|duration=33|duration_time=0.033000|size=889|pos=64830|flags=__|data_hash=CRC32:70b13ba7 -packet|codec_type=audio|stream_index=1|pts=3158|pts_time=3.158000|dts=3158|dts_time=3.158000|duration=46|duration_time=0.046000|size=645|pos=65739|flags=K_|data_hash=CRC32:1b7b9a99 -packet|codec_type=video|stream_index=0|pts=3170|pts_time=3.170000|dts=3170|dts_time=3.170000|duration=33|duration_time=0.033000|size=789|pos=66401|flags=__|data_hash=CRC32:6ffae70e -packet|codec_type=video|stream_index=0|pts=3203|pts_time=3.203000|dts=3203|dts_time=3.203000|duration=33|duration_time=0.033000|size=1037|pos=67210|flags=__|data_hash=CRC32:acb72f8a -packet|codec_type=audio|stream_index=1|pts=3204|pts_time=3.204000|dts=3204|dts_time=3.204000|duration=46|duration_time=0.046000|size=724|pos=68267|flags=K_|data_hash=CRC32:feb7c4f3 -packet|codec_type=video|stream_index=0|pts=3237|pts_time=3.237000|dts=3237|dts_time=3.237000|duration=33|duration_time=0.033000|size=1201|pos=69008|flags=__|data_hash=CRC32:0ac77ab1 -packet|codec_type=audio|stream_index=1|pts=3251|pts_time=3.251000|dts=3251|dts_time=3.251000|duration=46|duration_time=0.046000|size=757|pos=70229|flags=K_|data_hash=CRC32:28d27dd5 -packet|codec_type=video|stream_index=0|pts=3270|pts_time=3.270000|dts=3270|dts_time=3.270000|duration=33|duration_time=0.033000|size=934|pos=71003|flags=__|data_hash=CRC32:dd16f432 -packet|codec_type=audio|stream_index=1|pts=3297|pts_time=3.297000|dts=3297|dts_time=3.297000|duration=46|duration_time=0.046000|size=710|pos=71957|flags=K_|data_hash=CRC32:fb16456d -packet|codec_type=video|stream_index=0|pts=3303|pts_time=3.303000|dts=3303|dts_time=3.303000|duration=33|duration_time=0.033000|size=1028|pos=72684|flags=__|data_hash=CRC32:d4cf8920 -packet|codec_type=video|stream_index=0|pts=3337|pts_time=3.337000|dts=3337|dts_time=3.337000|duration=33|duration_time=0.033000|size=1007|pos=73732|flags=__|data_hash=CRC32:4dfc2133 -packet|codec_type=audio|stream_index=1|pts=3344|pts_time=3.344000|dts=3344|dts_time=3.344000|duration=46|duration_time=0.046000|size=705|pos=74759|flags=K_|data_hash=CRC32:249bd165 -packet|codec_type=video|stream_index=0|pts=3370|pts_time=3.370000|dts=3370|dts_time=3.370000|duration=33|duration_time=0.033000|size=944|pos=75481|flags=__|data_hash=CRC32:cf0ee6e5 -packet|codec_type=audio|stream_index=1|pts=3390|pts_time=3.390000|dts=3390|dts_time=3.390000|duration=46|duration_time=0.046000|size=693|pos=76445|flags=K_|data_hash=CRC32:907c82d7 -packet|codec_type=video|stream_index=0|pts=3403|pts_time=3.403000|dts=3403|dts_time=3.403000|duration=33|duration_time=0.033000|size=1121|pos=77155|flags=__|data_hash=CRC32:f4a2ef4d -packet|codec_type=audio|stream_index=1|pts=3437|pts_time=3.437000|dts=3437|dts_time=3.437000|duration=46|duration_time=0.046000|size=683|pos=78296|flags=K_|data_hash=CRC32:25f0e52b -packet|codec_type=video|stream_index=0|pts=3437|pts_time=3.437000|dts=3437|dts_time=3.437000|duration=33|duration_time=0.033000|size=1321|pos=78996|flags=__|data_hash=CRC32:890f59cd -packet|codec_type=video|stream_index=0|pts=3470|pts_time=3.470000|dts=3470|dts_time=3.470000|duration=33|duration_time=0.033000|size=1229|pos=80337|flags=__|data_hash=CRC32:7c53b1c5 -packet|codec_type=audio|stream_index=1|pts=3483|pts_time=3.483000|dts=3483|dts_time=3.483000|duration=46|duration_time=0.046000|size=668|pos=81586|flags=K_|data_hash=CRC32:c848f398 -packet|codec_type=video|stream_index=0|pts=3504|pts_time=3.504000|dts=3504|dts_time=3.504000|duration=33|duration_time=0.033000|size=1166|pos=82271|flags=__|data_hash=CRC32:237539fc -packet|codec_type=audio|stream_index=1|pts=3529|pts_time=3.529000|dts=3529|dts_time=3.529000|duration=46|duration_time=0.046000|size=624|pos=83457|flags=K_|data_hash=CRC32:5d81d294 -packet|codec_type=video|stream_index=0|pts=3537|pts_time=3.537000|dts=3537|dts_time=3.537000|duration=33|duration_time=0.033000|size=1055|pos=84098|flags=__|data_hash=CRC32:2d22b0e9 -packet|codec_type=video|stream_index=0|pts=3570|pts_time=3.570000|dts=3570|dts_time=3.570000|duration=33|duration_time=0.033000|size=947|pos=85173|flags=__|data_hash=CRC32:1003bc18 -packet|codec_type=audio|stream_index=1|pts=3576|pts_time=3.576000|dts=3576|dts_time=3.576000|duration=46|duration_time=0.046000|size=570|pos=86140|flags=K_|data_hash=CRC32:41da9b98 -packet|codec_type=video|stream_index=0|pts=3604|pts_time=3.604000|dts=3604|dts_time=3.604000|duration=33|duration_time=0.033000|size=1117|pos=86727|flags=__|data_hash=CRC32:ea91a8bf -packet|codec_type=audio|stream_index=1|pts=3622|pts_time=3.622000|dts=3622|dts_time=3.622000|duration=46|duration_time=0.046000|size=579|pos=87864|flags=K_|data_hash=CRC32:b1e12639 -packet|codec_type=video|stream_index=0|pts=3637|pts_time=3.637000|dts=3637|dts_time=3.637000|duration=33|duration_time=0.033000|size=1397|pos=88460|flags=__|data_hash=CRC32:f2bdfea7 -packet|codec_type=audio|stream_index=1|pts=3669|pts_time=3.669000|dts=3669|dts_time=3.669000|duration=46|duration_time=0.046000|size=558|pos=89877|flags=K_|data_hash=CRC32:095b218c -packet|codec_type=video|stream_index=0|pts=3670|pts_time=3.670000|dts=3670|dts_time=3.670000|duration=33|duration_time=0.033000|size=1097|pos=90452|flags=__|data_hash=CRC32:be8cf516 -packet|codec_type=video|stream_index=0|pts=3704|pts_time=3.704000|dts=3704|dts_time=3.704000|duration=33|duration_time=0.033000|size=1207|pos=91569|flags=__|data_hash=CRC32:176a8fe9 -packet|codec_type=audio|stream_index=1|pts=3715|pts_time=3.715000|dts=3715|dts_time=3.715000|duration=46|duration_time=0.046000|size=510|pos=92796|flags=K_|data_hash=CRC32:8cea9dca -packet|codec_type=video|stream_index=0|pts=3737|pts_time=3.737000|dts=3737|dts_time=3.737000|duration=33|duration_time=0.033000|size=1109|pos=93323|flags=__|data_hash=CRC32:615bab01 -packet|codec_type=audio|stream_index=1|pts=3762|pts_time=3.762000|dts=3762|dts_time=3.762000|duration=46|duration_time=0.046000|size=518|pos=94452|flags=K_|data_hash=CRC32:600293cc -packet|codec_type=video|stream_index=0|pts=3770|pts_time=3.770000|dts=3770|dts_time=3.770000|duration=33|duration_time=0.033000|size=994|pos=94987|flags=__|data_hash=CRC32:db090b40 -packet|codec_type=video|stream_index=0|pts=3804|pts_time=3.804000|dts=3804|dts_time=3.804000|duration=33|duration_time=0.033000|size=1144|pos=96001|flags=__|data_hash=CRC32:4966c524 -packet|codec_type=audio|stream_index=1|pts=3808|pts_time=3.808000|dts=3808|dts_time=3.808000|duration=46|duration_time=0.046000|size=481|pos=97165|flags=K_|data_hash=CRC32:e53ca4a3 -packet|codec_type=video|stream_index=0|pts=3837|pts_time=3.837000|dts=3837|dts_time=3.837000|duration=33|duration_time=0.033000|size=1409|pos=97663|flags=__|data_hash=CRC32:5561cdad -packet|codec_type=audio|stream_index=1|pts=3855|pts_time=3.855000|dts=3855|dts_time=3.855000|duration=46|duration_time=0.046000|size=443|pos=99092|flags=K_|data_hash=CRC32:14937ac1 -packet|codec_type=video|stream_index=0|pts=3871|pts_time=3.871000|dts=3871|dts_time=3.871000|duration=33|duration_time=0.033000|size=1205|pos=99552|flags=__|data_hash=CRC32:93f9dbe0 -packet|codec_type=audio|stream_index=1|pts=3901|pts_time=3.901000|dts=3901|dts_time=3.901000|duration=46|duration_time=0.046000|size=413|pos=100777|flags=K_|data_hash=CRC32:4fea79a1 -packet|codec_type=video|stream_index=0|pts=3904|pts_time=3.904000|dts=3904|dts_time=3.904000|duration=33|duration_time=0.033000|size=1159|pos=101207|flags=__|data_hash=CRC32:8a7dd1ca -packet|codec_type=video|stream_index=0|pts=3937|pts_time=3.937000|dts=3937|dts_time=3.937000|duration=33|duration_time=0.033000|size=1207|pos=102386|flags=__|data_hash=CRC32:9c351265 -packet|codec_type=audio|stream_index=1|pts=3947|pts_time=3.947000|dts=3947|dts_time=3.947000|duration=46|duration_time=0.046000|size=398|pos=103613|flags=K_|data_hash=CRC32:0777a82b -packet|codec_type=video|stream_index=0|pts=3971|pts_time=3.971000|dts=3971|dts_time=3.971000|duration=33|duration_time=0.033000|size=1084|pos=104028|flags=__|data_hash=CRC32:3b4222c7 -packet|codec_type=audio|stream_index=1|pts=3994|pts_time=3.994000|dts=3994|dts_time=3.994000|duration=46|duration_time=0.046000|size=377|pos=105132|flags=K_|data_hash=CRC32:8662b58a -packet|codec_type=video|stream_index=0|pts=4004|pts_time=4.004000|dts=4004|dts_time=4.004000|duration=33|duration_time=0.033000|size=1539|pos=105526|flags=__|data_hash=CRC32:cf253620 -packet|codec_type=video|stream_index=0|pts=4037|pts_time=4.037000|dts=4037|dts_time=4.037000|duration=33|duration_time=0.033000|size=1409|pos=107085|flags=__|data_hash=CRC32:01f30787 -packet|codec_type=audio|stream_index=1|pts=4040|pts_time=4.040000|dts=4040|dts_time=4.040000|duration=46|duration_time=0.046000|size=364|pos=108514|flags=K_|data_hash=CRC32:f73e6c88 -packet|codec_type=video|stream_index=0|pts=4071|pts_time=4.071000|dts=4071|dts_time=4.071000|duration=33|duration_time=0.033000|size=1275|pos=108895|flags=__|data_hash=CRC32:d7c1cfe1 -packet|codec_type=audio|stream_index=1|pts=4087|pts_time=4.087000|dts=4087|dts_time=4.087000|duration=46|duration_time=0.046000|size=374|pos=110190|flags=K_|data_hash=CRC32:c41f57c7 -packet|codec_type=video|stream_index=0|pts=4104|pts_time=4.104000|dts=4104|dts_time=4.104000|duration=33|duration_time=0.033000|size=1317|pos=110581|flags=__|data_hash=CRC32:685138ef -packet|codec_type=audio|stream_index=1|pts=4133|pts_time=4.133000|dts=4133|dts_time=4.133000|duration=46|duration_time=0.046000|size=355|pos=111918|flags=K_|data_hash=CRC32:7a5e82a8 -packet|codec_type=video|stream_index=0|pts=4137|pts_time=4.137000|dts=4137|dts_time=4.137000|duration=33|duration_time=0.033000|size=1146|pos=112290|flags=__|data_hash=CRC32:48ce008d -packet|codec_type=video|stream_index=0|pts=4171|pts_time=4.171000|dts=4171|dts_time=4.171000|duration=33|duration_time=0.033000|size=1166|pos=113456|flags=__|data_hash=CRC32:f12da76b -packet|codec_type=audio|stream_index=1|pts=4180|pts_time=4.180000|dts=4180|dts_time=4.180000|duration=46|duration_time=0.046000|size=341|pos=114642|flags=K_|data_hash=CRC32:ea126e98 -packet|codec_type=video|stream_index=0|pts=4204|pts_time=4.204000|dts=4204|dts_time=4.204000|duration=33|duration_time=0.033000|size=1272|pos=115000|flags=__|data_hash=CRC32:31e617c7 -packet|codec_type=audio|stream_index=1|pts=4226|pts_time=4.226000|dts=4226|dts_time=4.226000|duration=46|duration_time=0.046000|size=364|pos=116292|flags=K_|data_hash=CRC32:6d84c4a8 -packet|codec_type=video|stream_index=0|pts=4238|pts_time=4.238000|dts=4238|dts_time=4.238000|duration=33|duration_time=0.033000|size=1550|pos=116673|flags=__|data_hash=CRC32:50d17465 -packet|codec_type=video|stream_index=0|pts=4271|pts_time=4.271000|dts=4271|dts_time=4.271000|duration=33|duration_time=0.033000|size=1353|pos=118243|flags=__|data_hash=CRC32:af8d072c -packet|codec_type=audio|stream_index=1|pts=4272|pts_time=4.272000|dts=4272|dts_time=4.272000|duration=46|duration_time=0.046000|size=350|pos=119616|flags=K_|data_hash=CRC32:c27e7ecc -packet|codec_type=video|stream_index=0|pts=4304|pts_time=4.304000|dts=4304|dts_time=4.304000|duration=33|duration_time=0.033000|size=1251|pos=119983|flags=__|data_hash=CRC32:271dcd86 -packet|codec_type=audio|stream_index=1|pts=4319|pts_time=4.319000|dts=4319|dts_time=4.319000|duration=46|duration_time=0.046000|size=356|pos=121254|flags=K_|data_hash=CRC32:6d111a73 -packet|codec_type=video|stream_index=0|pts=4338|pts_time=4.338000|dts=4338|dts_time=4.338000|duration=33|duration_time=0.033000|size=1339|pos=121627|flags=__|data_hash=CRC32:01aa658e -packet|codec_type=audio|stream_index=1|pts=4365|pts_time=4.365000|dts=4365|dts_time=4.365000|duration=46|duration_time=0.046000|size=365|pos=122986|flags=K_|data_hash=CRC32:e24aa34c -packet|codec_type=video|stream_index=0|pts=4371|pts_time=4.371000|dts=4371|dts_time=4.371000|duration=33|duration_time=0.033000|size=1216|pos=123368|flags=__|data_hash=CRC32:bee7821f -packet|codec_type=video|stream_index=0|pts=4404|pts_time=4.404000|dts=4404|dts_time=4.404000|duration=33|duration_time=0.033000|size=1222|pos=124604|flags=__|data_hash=CRC32:2bd2754e -packet|codec_type=audio|stream_index=1|pts=4412|pts_time=4.412000|dts=4412|dts_time=4.412000|duration=46|duration_time=0.046000|size=352|pos=125846|flags=K_|data_hash=CRC32:fc970370 -packet|codec_type=video|stream_index=0|pts=4438|pts_time=4.438000|dts=4438|dts_time=4.438000|duration=33|duration_time=0.033000|size=1665|pos=126215|flags=__|data_hash=CRC32:a08b2e57 -packet|codec_type=audio|stream_index=1|pts=4458|pts_time=4.458000|dts=4458|dts_time=4.458000|duration=46|duration_time=0.046000|size=374|pos=127900|flags=K_|data_hash=CRC32:fa07f96b -packet|codec_type=video|stream_index=0|pts=4471|pts_time=4.471000|dts=4471|dts_time=4.471000|duration=33|duration_time=0.033000|size=1372|pos=128291|flags=__|data_hash=CRC32:7ba310fc -packet|codec_type=audio|stream_index=1|pts=4505|pts_time=4.505000|dts=4505|dts_time=4.505000|duration=46|duration_time=0.046000|size=375|pos=129683|flags=K_|data_hash=CRC32:912ec2a1 -packet|codec_type=video|stream_index=0|pts=4505|pts_time=4.505000|dts=4505|dts_time=4.505000|duration=33|duration_time=0.033000|size=1611|pos=130075|flags=__|data_hash=CRC32:894697a0 -packet|codec_type=video|stream_index=0|pts=4538|pts_time=4.538000|dts=4538|dts_time=4.538000|duration=33|duration_time=0.033000|size=7010|pos=131706|flags=K_|data_hash=CRC32:e74f1b93 -packet|codec_type=audio|stream_index=1|pts=4551|pts_time=4.551000|dts=4551|dts_time=4.551000|duration=46|duration_time=0.046000|size=375|pos=138736|flags=K_|data_hash=CRC32:9049bbe0 -packet|codec_type=video|stream_index=0|pts=4571|pts_time=4.571000|dts=4571|dts_time=4.571000|duration=33|duration_time=0.033000|size=549|pos=139128|flags=__|data_hash=CRC32:bea67fa5 -packet|codec_type=audio|stream_index=1|pts=4598|pts_time=4.598000|dts=4598|dts_time=4.598000|duration=46|duration_time=0.046000|size=376|pos=139697|flags=K_|data_hash=CRC32:cf9362b3 -packet|codec_type=video|stream_index=0|pts=4605|pts_time=4.605000|dts=4605|dts_time=4.605000|duration=33|duration_time=0.033000|size=1021|pos=140090|flags=__|data_hash=CRC32:93ace02c -packet|codec_type=video|stream_index=0|pts=4638|pts_time=4.638000|dts=4638|dts_time=4.638000|duration=33|duration_time=0.033000|size=1281|pos=141131|flags=__|data_hash=CRC32:24070179 -packet|codec_type=audio|stream_index=1|pts=4644|pts_time=4.644000|dts=4644|dts_time=4.644000|duration=46|duration_time=0.046000|size=372|pos=142432|flags=K_|data_hash=CRC32:f7372f4c -packet|codec_type=video|stream_index=0|pts=4671|pts_time=4.671000|dts=4671|dts_time=4.671000|duration=33|duration_time=0.033000|size=1267|pos=142821|flags=__|data_hash=CRC32:7cfd6aa6 -packet|codec_type=audio|stream_index=1|pts=4690|pts_time=4.690000|dts=4690|dts_time=4.690000|duration=46|duration_time=0.046000|size=371|pos=144108|flags=K_|data_hash=CRC32:b244704d -packet|codec_type=video|stream_index=0|pts=4705|pts_time=4.705000|dts=4705|dts_time=4.705000|duration=33|duration_time=0.033000|size=1140|pos=144496|flags=__|data_hash=CRC32:eccfa0f7 -packet|codec_type=audio|stream_index=1|pts=4737|pts_time=4.737000|dts=4737|dts_time=4.737000|duration=46|duration_time=0.046000|size=365|pos=145656|flags=K_|data_hash=CRC32:834bb209 -packet|codec_type=video|stream_index=0|pts=4738|pts_time=4.738000|dts=4738|dts_time=4.738000|duration=33|duration_time=0.033000|size=1289|pos=146038|flags=__|data_hash=CRC32:4669d638 -packet|codec_type=video|stream_index=0|pts=4771|pts_time=4.771000|dts=4771|dts_time=4.771000|duration=33|duration_time=0.033000|size=1127|pos=147347|flags=__|data_hash=CRC32:e52c7abd -packet|codec_type=audio|stream_index=1|pts=4783|pts_time=4.783000|dts=4783|dts_time=4.783000|duration=46|duration_time=0.046000|size=385|pos=148494|flags=K_|data_hash=CRC32:e61dc477 -packet|codec_type=video|stream_index=0|pts=4805|pts_time=4.805000|dts=4805|dts_time=4.805000|duration=33|duration_time=0.033000|size=1196|pos=148896|flags=__|data_hash=CRC32:5a318942 -packet|codec_type=audio|stream_index=1|pts=4830|pts_time=4.830000|dts=4830|dts_time=4.830000|duration=46|duration_time=0.046000|size=362|pos=150112|flags=K_|data_hash=CRC32:8fee051a -packet|codec_type=video|stream_index=0|pts=4838|pts_time=4.838000|dts=4838|dts_time=4.838000|duration=33|duration_time=0.033000|size=1520|pos=150491|flags=__|data_hash=CRC32:2418eb0f -packet|codec_type=video|stream_index=0|pts=4872|pts_time=4.872000|dts=4872|dts_time=4.872000|duration=33|duration_time=0.033000|size=1370|pos=152031|flags=__|data_hash=CRC32:79ca0732 -packet|codec_type=audio|stream_index=1|pts=4876|pts_time=4.876000|dts=4876|dts_time=4.876000|duration=46|duration_time=0.046000|size=370|pos=153421|flags=K_|data_hash=CRC32:1720582c -packet|codec_type=video|stream_index=0|pts=4905|pts_time=4.905000|dts=4905|dts_time=4.905000|duration=33|duration_time=0.033000|size=1232|pos=153808|flags=__|data_hash=CRC32:32295018 -packet|codec_type=audio|stream_index=1|pts=4923|pts_time=4.923000|dts=4923|dts_time=4.923000|duration=46|duration_time=0.046000|size=369|pos=155060|flags=K_|data_hash=CRC32:6b668e5b -packet|codec_type=video|stream_index=0|pts=4938|pts_time=4.938000|dts=4938|dts_time=4.938000|duration=33|duration_time=0.033000|size=1159|pos=155446|flags=__|data_hash=CRC32:45fc12f2 -packet|codec_type=audio|stream_index=1|pts=4969|pts_time=4.969000|dts=4969|dts_time=4.969000|duration=46|duration_time=0.046000|size=341|pos=156625|flags=K_|data_hash=CRC32:4d4741d6 -packet|codec_type=video|stream_index=0|pts=4972|pts_time=4.972000|dts=4972|dts_time=4.972000|duration=33|duration_time=0.033000|size=1183|pos=156983|flags=__|data_hash=CRC32:10f40093 -packet|codec_type=video|stream_index=0|pts=5005|pts_time=5.005000|dts=5005|dts_time=5.005000|duration=33|duration_time=0.033000|size=1469|pos=158186|flags=__|data_hash=CRC32:43a4815e -packet|codec_type=audio|stream_index=1|pts=5016|pts_time=5.016000|dts=5016|dts_time=5.016000|duration=46|duration_time=0.046000|size=351|pos=159675|flags=K_|data_hash=CRC32:82bf6546 -packet|codec_type=video|stream_index=0|pts=5038|pts_time=5.038000|dts=5038|dts_time=5.038000|duration=33|duration_time=0.033000|size=1468|pos=160043|flags=__|data_hash=CRC32:e8c78f03 -packet|codec_type=audio|stream_index=1|pts=5062|pts_time=5.062000|dts=5062|dts_time=5.062000|duration=46|duration_time=0.046000|size=365|pos=161531|flags=K_|data_hash=CRC32:1299be30 -packet|codec_type=video|stream_index=0|pts=5072|pts_time=5.072000|dts=5072|dts_time=5.072000|duration=33|duration_time=0.033000|size=1355|pos=161913|flags=__|data_hash=CRC32:044621ed -packet|codec_type=video|stream_index=0|pts=5105|pts_time=5.105000|dts=5105|dts_time=5.105000|duration=33|duration_time=0.033000|size=1303|pos=163288|flags=__|data_hash=CRC32:3403397b -packet|codec_type=audio|stream_index=1|pts=5108|pts_time=5.108000|dts=5108|dts_time=5.108000|duration=46|duration_time=0.046000|size=358|pos=164611|flags=K_|data_hash=CRC32:ee1a432d -packet|codec_type=video|stream_index=0|pts=5138|pts_time=5.138000|dts=5138|dts_time=5.138000|duration=33|duration_time=0.033000|size=1316|pos=164986|flags=__|data_hash=CRC32:7021310e -packet|codec_type=audio|stream_index=1|pts=5155|pts_time=5.155000|dts=5155|dts_time=5.155000|duration=46|duration_time=0.046000|size=373|pos=166322|flags=K_|data_hash=CRC32:f25887f4 -packet|codec_type=video|stream_index=0|pts=5172|pts_time=5.172000|dts=5172|dts_time=5.172000|duration=33|duration_time=0.033000|size=1196|pos=166712|flags=__|data_hash=CRC32:d8492897 -packet|codec_type=audio|stream_index=1|pts=5201|pts_time=5.201000|dts=5201|dts_time=5.201000|duration=46|duration_time=0.046000|size=367|pos=167928|flags=K_|data_hash=CRC32:c30e6c9f -packet|codec_type=video|stream_index=0|pts=5205|pts_time=5.205000|dts=5205|dts_time=5.205000|duration=33|duration_time=0.033000|size=1283|pos=168312|flags=__|data_hash=CRC32:c9058bba -packet|codec_type=video|stream_index=0|pts=5239|pts_time=5.239000|dts=5239|dts_time=5.239000|duration=33|duration_time=0.033000|size=1489|pos=169615|flags=__|data_hash=CRC32:0e5dadc6 -packet|codec_type=audio|stream_index=1|pts=5248|pts_time=5.248000|dts=5248|dts_time=5.248000|duration=46|duration_time=0.046000|size=364|pos=171124|flags=K_|data_hash=CRC32:74db7811 -packet|codec_type=video|stream_index=0|pts=5272|pts_time=5.272000|dts=5272|dts_time=5.272000|duration=33|duration_time=0.033000|size=1507|pos=171505|flags=__|data_hash=CRC32:1e37a39f -packet|codec_type=audio|stream_index=1|pts=5294|pts_time=5.294000|dts=5294|dts_time=5.294000|duration=46|duration_time=0.046000|size=346|pos=173032|flags=K_|data_hash=CRC32:3386dd10 -packet|codec_type=video|stream_index=0|pts=5305|pts_time=5.305000|dts=5305|dts_time=5.305000|duration=33|duration_time=0.033000|size=1237|pos=173395|flags=__|data_hash=CRC32:d8f772ae -packet|codec_type=video|stream_index=0|pts=5339|pts_time=5.339000|dts=5339|dts_time=5.339000|duration=33|duration_time=0.033000|size=1217|pos=174652|flags=__|data_hash=CRC32:7caabc71 -packet|codec_type=audio|stream_index=1|pts=5341|pts_time=5.341000|dts=5341|dts_time=5.341000|duration=46|duration_time=0.046000|size=362|pos=175889|flags=K_|data_hash=CRC32:b4975396 -packet|codec_type=video|stream_index=0|pts=5372|pts_time=5.372000|dts=5372|dts_time=5.372000|duration=33|duration_time=0.033000|size=1224|pos=176268|flags=__|data_hash=CRC32:fbca6068 -packet|codec_type=audio|stream_index=1|pts=5387|pts_time=5.387000|dts=5387|dts_time=5.387000|duration=46|duration_time=0.046000|size=360|pos=177512|flags=K_|data_hash=CRC32:f639adaf -packet|codec_type=video|stream_index=0|pts=5405|pts_time=5.405000|dts=5405|dts_time=5.405000|duration=33|duration_time=0.033000|size=1554|pos=177889|flags=__|data_hash=CRC32:f9e211de -packet|codec_type=audio|stream_index=1|pts=5433|pts_time=5.433000|dts=5433|dts_time=5.433000|duration=46|duration_time=0.046000|size=356|pos=179463|flags=K_|data_hash=CRC32:ef458996 -packet|codec_type=video|stream_index=0|pts=5439|pts_time=5.439000|dts=5439|dts_time=5.439000|duration=33|duration_time=0.033000|size=1465|pos=179836|flags=__|data_hash=CRC32:cb5d725a -packet|codec_type=video|stream_index=0|pts=5472|pts_time=5.472000|dts=5472|dts_time=5.472000|duration=33|duration_time=0.033000|size=1862|pos=181321|flags=__|data_hash=CRC32:a9acf274 -packet|codec_type=audio|stream_index=1|pts=5480|pts_time=5.480000|dts=5480|dts_time=5.480000|duration=46|duration_time=0.046000|size=364|pos=183203|flags=K_|data_hash=CRC32:6d92ed19 -packet|codec_type=video|stream_index=0|pts=5506|pts_time=5.506000|dts=5506|dts_time=5.506000|duration=33|duration_time=0.033000|size=1604|pos=183584|flags=__|data_hash=CRC32:19bfeabc -packet|codec_type=audio|stream_index=1|pts=5526|pts_time=5.526000|dts=5526|dts_time=5.526000|duration=46|duration_time=0.046000|size=365|pos=185208|flags=K_|data_hash=CRC32:f257469d -packet|codec_type=video|stream_index=0|pts=5539|pts_time=5.539000|dts=5539|dts_time=5.539000|duration=33|duration_time=0.033000|size=1541|pos=185590|flags=__|data_hash=CRC32:642b27dd -packet|codec_type=video|stream_index=0|pts=5572|pts_time=5.572000|dts=5572|dts_time=5.572000|duration=33|duration_time=0.033000|size=1534|pos=187151|flags=__|data_hash=CRC32:67693383 -packet|codec_type=audio|stream_index=1|pts=5573|pts_time=5.573000|dts=5573|dts_time=5.573000|duration=46|duration_time=0.046000|size=357|pos=188705|flags=K_|data_hash=CRC32:52e0f7ac -packet|codec_type=video|stream_index=0|pts=5606|pts_time=5.606000|dts=5606|dts_time=5.606000|duration=33|duration_time=0.033000|size=1336|pos=189079|flags=__|data_hash=CRC32:904a4734 -packet|codec_type=audio|stream_index=1|pts=5619|pts_time=5.619000|dts=5619|dts_time=5.619000|duration=46|duration_time=0.046000|size=367|pos=190435|flags=K_|data_hash=CRC32:dae9d0bd -packet|codec_type=video|stream_index=0|pts=5639|pts_time=5.639000|dts=5639|dts_time=5.639000|duration=33|duration_time=0.033000|size=1761|pos=190819|flags=__|data_hash=CRC32:93496a5c -packet|codec_type=audio|stream_index=1|pts=5666|pts_time=5.666000|dts=5666|dts_time=5.666000|duration=46|duration_time=0.046000|size=361|pos=192600|flags=K_|data_hash=CRC32:86968dd2 -packet|codec_type=video|stream_index=0|pts=5672|pts_time=5.672000|dts=5672|dts_time=5.672000|duration=33|duration_time=0.033000|size=1722|pos=192978|flags=__|data_hash=CRC32:feec28c7 -packet|codec_type=video|stream_index=0|pts=5706|pts_time=5.706000|dts=5706|dts_time=5.706000|duration=33|duration_time=0.033000|size=1442|pos=194720|flags=__|data_hash=CRC32:620e5c0e -packet|codec_type=audio|stream_index=1|pts=5712|pts_time=5.712000|dts=5712|dts_time=5.712000|duration=46|duration_time=0.046000|size=367|pos=196182|flags=K_|data_hash=CRC32:17f30b04 -packet|codec_type=video|stream_index=0|pts=5739|pts_time=5.739000|dts=5739|dts_time=5.739000|duration=33|duration_time=0.033000|size=1313|pos=196566|flags=__|data_hash=CRC32:6bee8c20 -packet|codec_type=audio|stream_index=1|pts=5759|pts_time=5.759000|dts=5759|dts_time=5.759000|duration=46|duration_time=0.046000|size=375|pos=197899|flags=K_|data_hash=CRC32:4eda4c7c -packet|codec_type=video|stream_index=0|pts=5772|pts_time=5.772000|dts=5772|dts_time=5.772000|duration=33|duration_time=0.033000|size=1436|pos=198291|flags=__|data_hash=CRC32:fd8ac68a -packet|codec_type=audio|stream_index=1|pts=5805|pts_time=5.805000|dts=5805|dts_time=5.805000|duration=46|duration_time=0.046000|size=357|pos=199747|flags=K_|data_hash=CRC32:3551e83a -packet|codec_type=video|stream_index=0|pts=5806|pts_time=5.806000|dts=5806|dts_time=5.806000|duration=33|duration_time=0.033000|size=1689|pos=200121|flags=__|data_hash=CRC32:e09613d4 -packet|codec_type=video|stream_index=0|pts=5839|pts_time=5.839000|dts=5839|dts_time=5.839000|duration=33|duration_time=0.033000|size=1472|pos=201830|flags=__|data_hash=CRC32:9467baaf -packet|codec_type=audio|stream_index=1|pts=5851|pts_time=5.851000|dts=5851|dts_time=5.851000|duration=46|duration_time=0.046000|size=379|pos=203322|flags=K_|data_hash=CRC32:de123d0a -packet|codec_type=video|stream_index=0|pts=5873|pts_time=5.873000|dts=5873|dts_time=5.873000|duration=33|duration_time=0.033000|size=1730|pos=203718|flags=__|data_hash=CRC32:2b6400ba -packet|codec_type=audio|stream_index=1|pts=5898|pts_time=5.898000|dts=5898|dts_time=5.898000|duration=46|duration_time=0.046000|size=361|pos=205468|flags=K_|data_hash=CRC32:02a5f979 -packet|codec_type=video|stream_index=0|pts=5906|pts_time=5.906000|dts=5906|dts_time=5.906000|duration=33|duration_time=0.033000|size=1555|pos=205846|flags=__|data_hash=CRC32:31d5ba1a -packet|codec_type=video|stream_index=0|pts=5939|pts_time=5.939000|dts=5939|dts_time=5.939000|duration=33|duration_time=0.033000|size=1486|pos=207421|flags=__|data_hash=CRC32:8d0829d2 -packet|codec_type=audio|stream_index=1|pts=5944|pts_time=5.944000|dts=5944|dts_time=5.944000|duration=46|duration_time=0.046000|size=350|pos=208927|flags=K_|data_hash=CRC32:8759b7f4 -packet|codec_type=video|stream_index=0|pts=5973|pts_time=5.973000|dts=5973|dts_time=5.973000|duration=33|duration_time=0.033000|size=1311|pos=209294|flags=__|data_hash=CRC32:bc92ded4 -packet|codec_type=audio|stream_index=1|pts=5991|pts_time=5.991000|dts=5991|dts_time=5.991000|duration=46|duration_time=0.046000|size=339|pos=210625|flags=K_|data_hash=CRC32:1aeda6e0 -packet|codec_type=video|stream_index=0|pts=6006|pts_time=6.006000|dts=6006|dts_time=6.006000|duration=33|duration_time=0.033000|size=1700|pos=210981|flags=__|data_hash=CRC32:6352f8f3 -packet|codec_type=audio|stream_index=1|pts=6037|pts_time=6.037000|dts=6037|dts_time=6.037000|duration=46|duration_time=0.046000|size=336|pos=212701|flags=K_|data_hash=CRC32:2df5ef30 -packet|codec_type=video|stream_index=0|pts=6039|pts_time=6.039000|dts=6039|dts_time=6.039000|duration=33|duration_time=0.033000|size=1647|pos=213054|flags=__|data_hash=CRC32:931d3120 -packet|codec_type=video|stream_index=0|pts=6073|pts_time=6.073000|dts=6073|dts_time=6.073000|duration=33|duration_time=0.033000|size=1663|pos=214721|flags=__|data_hash=CRC32:3191d8b9 -packet|codec_type=audio|stream_index=1|pts=6084|pts_time=6.084000|dts=6084|dts_time=6.084000|duration=46|duration_time=0.046000|size=331|pos=216404|flags=K_|data_hash=CRC32:81610328 -packet|codec_type=video|stream_index=0|pts=6106|pts_time=6.106000|dts=6106|dts_time=6.106000|duration=33|duration_time=0.033000|size=1512|pos=216752|flags=__|data_hash=CRC32:975cd742 -packet|codec_type=audio|stream_index=1|pts=6130|pts_time=6.130000|dts=6130|dts_time=6.130000|duration=46|duration_time=0.046000|size=335|pos=218284|flags=K_|data_hash=CRC32:7a0eaa18 -packet|codec_type=video|stream_index=0|pts=6139|pts_time=6.139000|dts=6139|dts_time=6.139000|duration=33|duration_time=0.033000|size=1370|pos=218636|flags=__|data_hash=CRC32:66567f2e -packet|codec_type=video|stream_index=0|pts=6173|pts_time=6.173000|dts=6173|dts_time=6.173000|duration=33|duration_time=0.033000|size=1440|pos=220026|flags=__|data_hash=CRC32:4bfade47 -packet|codec_type=audio|stream_index=1|pts=6177|pts_time=6.177000|dts=6177|dts_time=6.177000|duration=46|duration_time=0.046000|size=323|pos=221486|flags=K_|data_hash=CRC32:3799307f -packet|codec_type=video|stream_index=0|pts=6206|pts_time=6.206000|dts=6206|dts_time=6.206000|duration=33|duration_time=0.033000|size=1574|pos=221826|flags=__|data_hash=CRC32:a489fa6f -packet|codec_type=audio|stream_index=1|pts=6223|pts_time=6.223000|dts=6223|dts_time=6.223000|duration=46|duration_time=0.046000|size=333|pos=223420|flags=K_|data_hash=CRC32:c8363968 -packet|codec_type=video|stream_index=0|pts=6240|pts_time=6.240000|dts=6240|dts_time=6.240000|duration=33|duration_time=0.033000|size=1328|pos=223770|flags=__|data_hash=CRC32:1fea5aac -packet|codec_type=audio|stream_index=1|pts=6269|pts_time=6.269000|dts=6269|dts_time=6.269000|duration=46|duration_time=0.046000|size=335|pos=225118|flags=K_|data_hash=CRC32:b9425c66 -packet|codec_type=video|stream_index=0|pts=6273|pts_time=6.273000|dts=6273|dts_time=6.273000|duration=33|duration_time=0.033000|size=1802|pos=225470|flags=__|data_hash=CRC32:dcf03b48 -packet|codec_type=video|stream_index=0|pts=6306|pts_time=6.306000|dts=6306|dts_time=6.306000|duration=33|duration_time=0.033000|size=1619|pos=227292|flags=__|data_hash=CRC32:fe0b0001 -packet|codec_type=audio|stream_index=1|pts=6316|pts_time=6.316000|dts=6316|dts_time=6.316000|duration=46|duration_time=0.046000|size=334|pos=228931|flags=K_|data_hash=CRC32:ec0fe921 -packet|codec_type=video|stream_index=0|pts=6340|pts_time=6.340000|dts=6340|dts_time=6.340000|duration=33|duration_time=0.033000|size=1471|pos=229282|flags=__|data_hash=CRC32:d30c0223 -packet|codec_type=audio|stream_index=1|pts=6362|pts_time=6.362000|dts=6362|dts_time=6.362000|duration=46|duration_time=0.046000|size=342|pos=230773|flags=K_|data_hash=CRC32:f18fb26f -packet|codec_type=video|stream_index=0|pts=6373|pts_time=6.373000|dts=6373|dts_time=6.373000|duration=33|duration_time=0.033000|size=1226|pos=231132|flags=__|data_hash=CRC32:7336c586 -packet|codec_type=video|stream_index=0|pts=6406|pts_time=6.406000|dts=6406|dts_time=6.406000|duration=33|duration_time=0.033000|size=1485|pos=232378|flags=__|data_hash=CRC32:6f6eae16 -packet|codec_type=audio|stream_index=1|pts=6409|pts_time=6.409000|dts=6409|dts_time=6.409000|duration=46|duration_time=0.046000|size=358|pos=233883|flags=K_|data_hash=CRC32:ef6dc063 -packet|codec_type=video|stream_index=0|pts=6440|pts_time=6.440000|dts=6440|dts_time=6.440000|duration=33|duration_time=0.033000|size=1786|pos=234258|flags=__|data_hash=CRC32:0d06af0a -packet|codec_type=audio|stream_index=1|pts=6455|pts_time=6.455000|dts=6455|dts_time=6.455000|duration=46|duration_time=0.046000|size=360|pos=236064|flags=K_|data_hash=CRC32:21588c84 -packet|codec_type=video|stream_index=0|pts=6473|pts_time=6.473000|dts=6473|dts_time=6.473000|duration=33|duration_time=0.033000|size=1345|pos=236441|flags=__|data_hash=CRC32:be3a88c3 -packet|codec_type=audio|stream_index=1|pts=6502|pts_time=6.502000|dts=6502|dts_time=6.502000|duration=46|duration_time=0.046000|size=357|pos=237806|flags=K_|data_hash=CRC32:2b9aa0fa -packet|codec_type=video|stream_index=0|pts=6507|pts_time=6.507000|dts=6507|dts_time=6.507000|duration=33|duration_time=0.033000|size=8275|pos=238180|flags=K_|data_hash=CRC32:a7db122a -packet|codec_type=video|stream_index=0|pts=6540|pts_time=6.540000|dts=6540|dts_time=6.540000|duration=33|duration_time=0.033000|size=698|pos=246475|flags=__|data_hash=CRC32:333944af -packet|codec_type=audio|stream_index=1|pts=6548|pts_time=6.548000|dts=6548|dts_time=6.548000|duration=46|duration_time=0.046000|size=336|pos=247193|flags=K_|data_hash=CRC32:57dbe1a1 -packet|codec_type=video|stream_index=0|pts=6573|pts_time=6.573000|dts=6573|dts_time=6.573000|duration=33|duration_time=0.033000|size=1298|pos=247546|flags=__|data_hash=CRC32:e4a95b13 -packet|codec_type=audio|stream_index=1|pts=6594|pts_time=6.594000|dts=6594|dts_time=6.594000|duration=46|duration_time=0.046000|size=343|pos=248864|flags=K_|data_hash=CRC32:ed44ae94 -packet|codec_type=video|stream_index=0|pts=6607|pts_time=6.607000|dts=6607|dts_time=6.607000|duration=33|duration_time=0.033000|size=1454|pos=249224|flags=__|data_hash=CRC32:40218f22 -packet|codec_type=video|stream_index=0|pts=6640|pts_time=6.640000|dts=6640|dts_time=6.640000|duration=33|duration_time=0.033000|size=1352|pos=250698|flags=__|data_hash=CRC32:06fd2643 -packet|codec_type=audio|stream_index=1|pts=6641|pts_time=6.641000|dts=6641|dts_time=6.641000|duration=46|duration_time=0.046000|size=324|pos=252070|flags=K_|data_hash=CRC32:0a20b257 -packet|codec_type=video|stream_index=0|pts=6673|pts_time=6.673000|dts=6673|dts_time=6.673000|duration=33|duration_time=0.033000|size=1609|pos=252411|flags=__|data_hash=CRC32:73d71cca -packet|codec_type=audio|stream_index=1|pts=6687|pts_time=6.687000|dts=6687|dts_time=6.687000|duration=46|duration_time=0.046000|size=322|pos=254040|flags=K_|data_hash=CRC32:32957adb -packet|codec_type=video|stream_index=0|pts=6707|pts_time=6.707000|dts=6707|dts_time=6.707000|duration=33|duration_time=0.033000|size=1476|pos=254379|flags=__|data_hash=CRC32:226c92f5 -packet|codec_type=audio|stream_index=1|pts=6734|pts_time=6.734000|dts=6734|dts_time=6.734000|duration=46|duration_time=0.046000|size=328|pos=255875|flags=K_|data_hash=CRC32:f2deeca5 -packet|codec_type=video|stream_index=0|pts=6740|pts_time=6.740000|dts=6740|dts_time=6.740000|duration=33|duration_time=0.033000|size=1391|pos=256220|flags=__|data_hash=CRC32:9a20a6cc -packet|codec_type=video|stream_index=0|pts=6773|pts_time=6.773000|dts=6773|dts_time=6.773000|duration=33|duration_time=0.033000|size=1203|pos=257631|flags=__|data_hash=CRC32:694b79e2 -packet|codec_type=audio|stream_index=1|pts=6780|pts_time=6.780000|dts=6780|dts_time=6.780000|duration=46|duration_time=0.046000|size=332|pos=258854|flags=K_|data_hash=CRC32:69c10e24 -packet|codec_type=video|stream_index=0|pts=6807|pts_time=6.807000|dts=6807|dts_time=6.807000|duration=33|duration_time=0.033000|size=1489|pos=259203|flags=__|data_hash=CRC32:72a4b942 -packet|codec_type=audio|stream_index=1|pts=6827|pts_time=6.827000|dts=6827|dts_time=6.827000|duration=46|duration_time=0.046000|size=343|pos=260712|flags=K_|data_hash=CRC32:59e5debb -packet|codec_type=video|stream_index=0|pts=6840|pts_time=6.840000|dts=6840|dts_time=6.840000|duration=33|duration_time=0.033000|size=1655|pos=261072|flags=__|data_hash=CRC32:d23af0f0 -packet|codec_type=audio|stream_index=1|pts=6873|pts_time=6.873000|dts=6873|dts_time=6.873000|duration=46|duration_time=0.046000|size=343|pos=262747|flags=K_|data_hash=CRC32:3a753534 -packet|codec_type=video|stream_index=0|pts=6874|pts_time=6.874000|dts=6874|dts_time=6.874000|duration=33|duration_time=0.033000|size=1363|pos=263107|flags=__|data_hash=CRC32:a3c3183f -packet|codec_type=video|stream_index=0|pts=6907|pts_time=6.907000|dts=6907|dts_time=6.907000|duration=33|duration_time=0.033000|size=1492|pos=264490|flags=__|data_hash=CRC32:2efa7752 -packet|codec_type=audio|stream_index=1|pts=6920|pts_time=6.920000|dts=6920|dts_time=6.920000|duration=46|duration_time=0.046000|size=327|pos=266002|flags=K_|data_hash=CRC32:0c6cfc20 -packet|codec_type=video|stream_index=0|pts=6940|pts_time=6.940000|dts=6940|dts_time=6.940000|duration=33|duration_time=0.033000|size=1397|pos=266346|flags=__|data_hash=CRC32:f4cff2aa -packet|codec_type=audio|stream_index=1|pts=6966|pts_time=6.966000|dts=6966|dts_time=6.966000|duration=46|duration_time=0.046000|size=326|pos=267763|flags=K_|data_hash=CRC32:0287694a -packet|codec_type=video|stream_index=0|pts=6974|pts_time=6.974000|dts=6974|dts_time=6.974000|duration=33|duration_time=0.033000|size=1251|pos=268106|flags=__|data_hash=CRC32:24f376e2 -packet|codec_type=video|stream_index=0|pts=7007|pts_time=7.007000|dts=7007|dts_time=7.007000|duration=33|duration_time=0.033000|size=1586|pos=269377|flags=__|data_hash=CRC32:6894eed6 -packet|codec_type=audio|stream_index=1|pts=7012|pts_time=7.012000|dts=7012|dts_time=7.012000|duration=46|duration_time=0.046000|size=324|pos=270983|flags=K_|data_hash=CRC32:7131ae4e -packet|codec_type=video|stream_index=0|pts=7040|pts_time=7.040000|dts=7040|dts_time=7.040000|duration=33|duration_time=0.033000|size=1333|pos=271324|flags=__|data_hash=CRC32:c70a7aad -packet|codec_type=audio|stream_index=1|pts=7059|pts_time=7.059000|dts=7059|dts_time=7.059000|duration=46|duration_time=0.046000|size=312|pos=272677|flags=K_|data_hash=CRC32:19e4ee3f -packet|codec_type=video|stream_index=0|pts=7074|pts_time=7.074000|dts=7074|dts_time=7.074000|duration=33|duration_time=0.033000|size=2723|pos=273006|flags=__|data_hash=CRC32:a6013df5 -packet|codec_type=audio|stream_index=1|pts=7105|pts_time=7.105000|dts=7105|dts_time=7.105000|duration=46|duration_time=0.046000|size=308|pos=275749|flags=K_|data_hash=CRC32:c90c6296 -packet|codec_type=video|stream_index=0|pts=7107|pts_time=7.107000|dts=7107|dts_time=7.107000|duration=33|duration_time=0.033000|size=632|pos=276074|flags=__|data_hash=CRC32:24dd0b1b -packet|codec_type=video|stream_index=0|pts=7140|pts_time=7.140000|dts=7140|dts_time=7.140000|duration=33|duration_time=0.033000|size=444|pos=276726|flags=__|data_hash=CRC32:f0104674 -packet|codec_type=audio|stream_index=1|pts=7152|pts_time=7.152000|dts=7152|dts_time=7.152000|duration=46|duration_time=0.046000|size=308|pos=277190|flags=K_|data_hash=CRC32:801d3efb -packet|codec_type=video|stream_index=0|pts=7174|pts_time=7.174000|dts=7174|dts_time=7.174000|duration=33|duration_time=0.033000|size=1013|pos=277515|flags=__|data_hash=CRC32:50fd7439 -packet|codec_type=audio|stream_index=1|pts=7198|pts_time=7.198000|dts=7198|dts_time=7.198000|duration=46|duration_time=0.046000|size=318|pos=278548|flags=K_|data_hash=CRC32:da27ff29 -packet|codec_type=video|stream_index=0|pts=7207|pts_time=7.207000|dts=7207|dts_time=7.207000|duration=33|duration_time=0.033000|size=1357|pos=278883|flags=__|data_hash=CRC32:147764fe -packet|codec_type=video|stream_index=0|pts=7241|pts_time=7.241000|dts=7241|dts_time=7.241000|duration=33|duration_time=0.033000|size=1586|pos=280260|flags=__|data_hash=CRC32:6ba61f38 -packet|codec_type=audio|stream_index=1|pts=7245|pts_time=7.245000|dts=7245|dts_time=7.245000|duration=46|duration_time=0.046000|size=331|pos=281866|flags=K_|data_hash=CRC32:ff54d1a1 -packet|codec_type=video|stream_index=0|pts=7274|pts_time=7.274000|dts=7274|dts_time=7.274000|duration=33|duration_time=0.033000|size=2514|pos=282214|flags=__|data_hash=CRC32:ee50c38f -packet|codec_type=audio|stream_index=1|pts=7291|pts_time=7.291000|dts=7291|dts_time=7.291000|duration=46|duration_time=0.046000|size=329|pos=284748|flags=K_|data_hash=CRC32:af348626 -packet|codec_type=video|stream_index=0|pts=7307|pts_time=7.307000|dts=7307|dts_time=7.307000|duration=33|duration_time=0.033000|size=450|pos=285094|flags=__|data_hash=CRC32:4c566b91 -packet|codec_type=audio|stream_index=1|pts=7338|pts_time=7.338000|dts=7338|dts_time=7.338000|duration=46|duration_time=0.046000|size=333|pos=285564|flags=K_|data_hash=CRC32:561118f2 -packet|codec_type=video|stream_index=0|pts=7341|pts_time=7.341000|dts=7341|dts_time=7.341000|duration=33|duration_time=0.033000|size=423|pos=285914|flags=__|data_hash=CRC32:799d9d42 -packet|codec_type=video|stream_index=0|pts=7374|pts_time=7.374000|dts=7374|dts_time=7.374000|duration=33|duration_time=0.033000|size=1161|pos=286357|flags=__|data_hash=CRC32:f37f1ffc -packet|codec_type=audio|stream_index=1|pts=7384|pts_time=7.384000|dts=7384|dts_time=7.384000|duration=46|duration_time=0.046000|size=314|pos=287538|flags=K_|data_hash=CRC32:ab18160b -packet|codec_type=video|stream_index=0|pts=7407|pts_time=7.407000|dts=7407|dts_time=7.407000|duration=33|duration_time=0.033000|size=1366|pos=287869|flags=__|data_hash=CRC32:6484b277 -packet|codec_type=audio|stream_index=1|pts=7430|pts_time=7.430000|dts=7430|dts_time=7.430000|duration=46|duration_time=0.046000|size=304|pos=289255|flags=K_|data_hash=CRC32:823aa6c6 -packet|codec_type=video|stream_index=0|pts=7441|pts_time=7.441000|dts=7441|dts_time=7.441000|duration=33|duration_time=0.033000|size=1325|pos=289576|flags=__|data_hash=CRC32:6eb411da -packet|codec_type=video|stream_index=0|pts=7474|pts_time=7.474000|dts=7474|dts_time=7.474000|duration=33|duration_time=0.033000|size=2687|pos=290921|flags=__|data_hash=CRC32:dc8f2e68 -packet|codec_type=audio|stream_index=1|pts=7477|pts_time=7.477000|dts=7477|dts_time=7.477000|duration=46|duration_time=0.046000|size=299|pos=293628|flags=K_|data_hash=CRC32:92c86961 -packet|codec_type=video|stream_index=0|pts=7508|pts_time=7.508000|dts=7508|dts_time=7.508000|duration=33|duration_time=0.033000|size=678|pos=293944|flags=__|data_hash=CRC32:bbd3fb62 -packet|codec_type=audio|stream_index=1|pts=7523|pts_time=7.523000|dts=7523|dts_time=7.523000|duration=46|duration_time=0.046000|size=311|pos=294642|flags=K_|data_hash=CRC32:8f7e6535 -packet|codec_type=video|stream_index=0|pts=7541|pts_time=7.541000|dts=7541|dts_time=7.541000|duration=33|duration_time=0.033000|size=491|pos=294970|flags=__|data_hash=CRC32:44e5e238 -packet|codec_type=audio|stream_index=1|pts=7570|pts_time=7.570000|dts=7570|dts_time=7.570000|duration=46|duration_time=0.046000|size=323|pos=295481|flags=K_|data_hash=CRC32:4572a6b6 -packet|codec_type=video|stream_index=0|pts=7574|pts_time=7.574000|dts=7574|dts_time=7.574000|duration=33|duration_time=0.033000|size=1056|pos=295821|flags=__|data_hash=CRC32:59790f4a -packet|codec_type=video|stream_index=0|pts=7608|pts_time=7.608000|dts=7608|dts_time=7.608000|duration=33|duration_time=0.033000|size=1549|pos=296897|flags=__|data_hash=CRC32:ede372d1 -packet|codec_type=audio|stream_index=1|pts=7616|pts_time=7.616000|dts=7616|dts_time=7.616000|duration=46|duration_time=0.046000|size=317|pos=298466|flags=K_|data_hash=CRC32:217926a5 -packet|codec_type=video|stream_index=0|pts=7641|pts_time=7.641000|dts=7641|dts_time=7.641000|duration=33|duration_time=0.033000|size=2502|pos=298800|flags=__|data_hash=CRC32:b4c753cb -packet|codec_type=audio|stream_index=1|pts=7663|pts_time=7.663000|dts=7663|dts_time=7.663000|duration=46|duration_time=0.046000|size=322|pos=301322|flags=K_|data_hash=CRC32:66da2414 -packet|codec_type=video|stream_index=0|pts=7674|pts_time=7.674000|dts=7674|dts_time=7.674000|duration=33|duration_time=0.033000|size=539|pos=301661|flags=__|data_hash=CRC32:957ce92c -packet|codec_type=video|stream_index=0|pts=7708|pts_time=7.708000|dts=7708|dts_time=7.708000|duration=33|duration_time=0.033000|size=594|pos=302220|flags=__|data_hash=CRC32:01178bad -packet|codec_type=audio|stream_index=1|pts=7709|pts_time=7.709000|dts=7709|dts_time=7.709000|duration=46|duration_time=0.046000|size=329|pos=302834|flags=K_|data_hash=CRC32:8570ef58 -packet|codec_type=video|stream_index=0|pts=7741|pts_time=7.741000|dts=7741|dts_time=7.741000|duration=33|duration_time=0.033000|size=1254|pos=303180|flags=__|data_hash=CRC32:7b42fdb2 -packet|codec_type=audio|stream_index=1|pts=7755|pts_time=7.755000|dts=7755|dts_time=7.755000|duration=46|duration_time=0.046000|size=342|pos=304454|flags=K_|data_hash=CRC32:866b46d1 -packet|codec_type=video|stream_index=0|pts=7774|pts_time=7.774000|dts=7774|dts_time=7.774000|duration=33|duration_time=0.033000|size=1341|pos=304813|flags=__|data_hash=CRC32:76ee5810 -packet|codec_type=audio|stream_index=1|pts=7802|pts_time=7.802000|dts=7802|dts_time=7.802000|duration=46|duration_time=0.046000|size=331|pos=306174|flags=K_|data_hash=CRC32:e836a9c7 -packet|codec_type=video|stream_index=0|pts=7808|pts_time=7.808000|dts=7808|dts_time=7.808000|duration=33|duration_time=0.033000|size=1358|pos=306522|flags=__|data_hash=CRC32:935430a2 -packet|codec_type=video|stream_index=0|pts=7841|pts_time=7.841000|dts=7841|dts_time=7.841000|duration=33|duration_time=0.033000|size=2336|pos=307900|flags=__|data_hash=CRC32:3ed5a208 -packet|codec_type=audio|stream_index=1|pts=7848|pts_time=7.848000|dts=7848|dts_time=7.848000|duration=46|duration_time=0.046000|size=343|pos=310256|flags=K_|data_hash=CRC32:eb15e72d -packet|codec_type=video|stream_index=0|pts=7875|pts_time=7.875000|dts=7875|dts_time=7.875000|duration=33|duration_time=0.033000|size=339|pos=310616|flags=__|data_hash=CRC32:10d2e236 -packet|codec_type=audio|stream_index=1|pts=7895|pts_time=7.895000|dts=7895|dts_time=7.895000|duration=46|duration_time=0.046000|size=327|pos=310975|flags=K_|data_hash=CRC32:fa82f874 -packet|codec_type=video|stream_index=0|pts=7908|pts_time=7.908000|dts=7908|dts_time=7.908000|duration=33|duration_time=0.033000|size=2159|pos=311319|flags=__|data_hash=CRC32:d84ad78a -packet|codec_type=audio|stream_index=1|pts=7941|pts_time=7.941000|dts=7941|dts_time=7.941000|duration=46|duration_time=0.046000|size=317|pos=313498|flags=K_|data_hash=CRC32:2f9ae86b -packet|codec_type=video|stream_index=0|pts=7941|pts_time=7.941000|dts=7941|dts_time=7.941000|duration=33|duration_time=0.033000|size=390|pos=313832|flags=__|data_hash=CRC32:d5f6e16d -packet|codec_type=video|stream_index=0|pts=7975|pts_time=7.975000|dts=7975|dts_time=7.975000|duration=33|duration_time=0.033000|size=479|pos=314242|flags=__|data_hash=CRC32:62ef0b83 -packet|codec_type=audio|stream_index=1|pts=7988|pts_time=7.988000|dts=7988|dts_time=7.988000|duration=46|duration_time=0.046000|size=313|pos=314741|flags=K_|data_hash=CRC32:de3136c8 -packet|codec_type=video|stream_index=0|pts=8008|pts_time=8.008000|dts=8008|dts_time=8.008000|duration=33|duration_time=0.033000|size=2157|pos=315071|flags=__|data_hash=CRC32:0cef0137 -packet|codec_type=audio|stream_index=1|pts=8034|pts_time=8.034000|dts=8034|dts_time=8.034000|duration=46|duration_time=0.046000|size=312|pos=317248|flags=K_|data_hash=CRC32:4abd9c07 -packet|codec_type=video|stream_index=0|pts=8041|pts_time=8.041000|dts=8041|dts_time=8.041000|duration=33|duration_time=0.033000|size=429|pos=317577|flags=__|data_hash=CRC32:87ebdeb2 -packet|codec_type=video|stream_index=0|pts=8075|pts_time=8.075000|dts=8075|dts_time=8.075000|duration=33|duration_time=0.033000|size=1953|pos=318026|flags=__|data_hash=CRC32:02a64621 -packet|codec_type=audio|stream_index=1|pts=8081|pts_time=8.081000|dts=8081|dts_time=8.081000|duration=46|duration_time=0.046000|size=318|pos=319999|flags=K_|data_hash=CRC32:f22024a9 -packet|codec_type=video|stream_index=0|pts=8108|pts_time=8.108000|dts=8108|dts_time=8.108000|duration=33|duration_time=0.033000|size=379|pos=320334|flags=__|data_hash=CRC32:b62cddd2 -packet|codec_type=audio|stream_index=1|pts=8127|pts_time=8.127000|dts=8127|dts_time=8.127000|duration=46|duration_time=0.046000|size=325|pos=320733|flags=K_|data_hash=CRC32:64fd8299 -packet|codec_type=video|stream_index=0|pts=8141|pts_time=8.141000|dts=8141|dts_time=8.141000|duration=33|duration_time=0.033000|size=1817|pos=321075|flags=__|data_hash=CRC32:c8592216 -packet|codec_type=audio|stream_index=1|pts=8173|pts_time=8.173000|dts=8173|dts_time=8.173000|duration=46|duration_time=0.046000|size=317|pos=322912|flags=K_|data_hash=CRC32:4691c3cf -packet|codec_type=video|stream_index=0|pts=8175|pts_time=8.175000|dts=8175|dts_time=8.175000|duration=33|duration_time=0.033000|size=372|pos=323246|flags=__|data_hash=CRC32:97c375b0 -packet|codec_type=video|stream_index=0|pts=8208|pts_time=8.208000|dts=8208|dts_time=8.208000|duration=33|duration_time=0.033000|size=1664|pos=323638|flags=__|data_hash=CRC32:ca3e11a7 -packet|codec_type=audio|stream_index=1|pts=8220|pts_time=8.220000|dts=8220|dts_time=8.220000|duration=46|duration_time=0.046000|size=308|pos=325322|flags=K_|data_hash=CRC32:09626471 -packet|codec_type=video|stream_index=0|pts=8242|pts_time=8.242000|dts=8242|dts_time=8.242000|duration=33|duration_time=0.033000|size=340|pos=325647|flags=__|data_hash=CRC32:a779f4f7 -packet|codec_type=audio|stream_index=1|pts=8266|pts_time=8.266000|dts=8266|dts_time=8.266000|duration=46|duration_time=0.046000|size=309|pos=326007|flags=K_|data_hash=CRC32:728889b5 -packet|codec_type=video|stream_index=0|pts=8275|pts_time=8.275000|dts=8275|dts_time=8.275000|duration=33|duration_time=0.033000|size=1955|pos=326333|flags=__|data_hash=CRC32:695aa624 -packet|codec_type=video|stream_index=0|pts=8308|pts_time=8.308000|dts=8308|dts_time=8.308000|duration=33|duration_time=0.033000|size=485|pos=328308|flags=__|data_hash=CRC32:51973647 -packet|codec_type=audio|stream_index=1|pts=8313|pts_time=8.313000|dts=8313|dts_time=8.313000|duration=46|duration_time=0.046000|size=315|pos=328813|flags=K_|data_hash=CRC32:c3488703 -packet|codec_type=video|stream_index=0|pts=8342|pts_time=8.342000|dts=8342|dts_time=8.342000|duration=33|duration_time=0.033000|size=1705|pos=329145|flags=__|data_hash=CRC32:5837d8d2 -packet|codec_type=audio|stream_index=1|pts=8359|pts_time=8.359000|dts=8359|dts_time=8.359000|duration=46|duration_time=0.046000|size=340|pos=330870|flags=K_|data_hash=CRC32:9e35fdd6 -packet|codec_type=video|stream_index=0|pts=8375|pts_time=8.375000|dts=8375|dts_time=8.375000|duration=33|duration_time=0.033000|size=411|pos=331227|flags=__|data_hash=CRC32:0f50eec7 -packet|codec_type=audio|stream_index=1|pts=8406|pts_time=8.406000|dts=8406|dts_time=8.406000|duration=46|duration_time=0.046000|size=326|pos=331658|flags=K_|data_hash=CRC32:719bf8ae -packet|codec_type=video|stream_index=0|pts=8408|pts_time=8.408000|dts=8408|dts_time=8.408000|duration=33|duration_time=0.033000|size=1818|pos=332001|flags=__|data_hash=CRC32:a33c3a86 -packet|codec_type=video|stream_index=0|pts=8442|pts_time=8.442000|dts=8442|dts_time=8.442000|duration=33|duration_time=0.033000|size=304|pos=333839|flags=__|data_hash=CRC32:e192b5c4 -packet|codec_type=audio|stream_index=1|pts=8452|pts_time=8.452000|dts=8452|dts_time=8.452000|duration=46|duration_time=0.046000|size=333|pos=334163|flags=K_|data_hash=CRC32:e927cbe1 -packet|codec_type=video|stream_index=0|pts=8475|pts_time=8.475000|dts=8475|dts_time=8.475000|duration=33|duration_time=0.033000|size=6302|pos=334513|flags=K_|data_hash=CRC32:2290178c -packet|codec_type=audio|stream_index=1|pts=8499|pts_time=8.499000|dts=8499|dts_time=8.499000|duration=46|duration_time=0.046000|size=340|pos=340835|flags=K_|data_hash=CRC32:2dfd7ad8 -packet|codec_type=video|stream_index=0|pts=8509|pts_time=8.509000|dts=8509|dts_time=8.509000|duration=33|duration_time=0.033000|size=1498|pos=341192|flags=__|data_hash=CRC32:e0611ee8 -packet|codec_type=video|stream_index=0|pts=8542|pts_time=8.542000|dts=8542|dts_time=8.542000|duration=33|duration_time=0.033000|size=434|pos=342710|flags=__|data_hash=CRC32:ffb5d9c5 -packet|codec_type=audio|stream_index=1|pts=8545|pts_time=8.545000|dts=8545|dts_time=8.545000|duration=46|duration_time=0.046000|size=338|pos=343164|flags=K_|data_hash=CRC32:954e8263 -packet|codec_type=video|stream_index=0|pts=8575|pts_time=8.575000|dts=8575|dts_time=8.575000|duration=33|duration_time=0.033000|size=1643|pos=343519|flags=__|data_hash=CRC32:c4e8ba5f -packet|codec_type=audio|stream_index=1|pts=8591|pts_time=8.591000|dts=8591|dts_time=8.591000|duration=46|duration_time=0.046000|size=357|pos=345182|flags=K_|data_hash=CRC32:944e4fde -packet|codec_type=video|stream_index=0|pts=8609|pts_time=8.609000|dts=8609|dts_time=8.609000|duration=33|duration_time=0.033000|size=213|pos=345556|flags=__|data_hash=CRC32:6b32090f -packet|codec_type=audio|stream_index=1|pts=8638|pts_time=8.638000|dts=8638|dts_time=8.638000|duration=46|duration_time=0.046000|size=340|pos=345789|flags=K_|data_hash=CRC32:edd08354 -packet|codec_type=video|stream_index=0|pts=8642|pts_time=8.642000|dts=8642|dts_time=8.642000|duration=33|duration_time=0.033000|size=1820|pos=346146|flags=__|data_hash=CRC32:e814434f -packet|codec_type=video|stream_index=0|pts=8675|pts_time=8.675000|dts=8675|dts_time=8.675000|duration=33|duration_time=0.033000|size=264|pos=347986|flags=__|data_hash=CRC32:c47e7364 -packet|codec_type=audio|stream_index=1|pts=8684|pts_time=8.684000|dts=8684|dts_time=8.684000|duration=46|duration_time=0.046000|size=335|pos=348270|flags=K_|data_hash=CRC32:6a3050c7 -packet|codec_type=video|stream_index=0|pts=8709|pts_time=8.709000|dts=8709|dts_time=8.709000|duration=33|duration_time=0.033000|size=1461|pos=348622|flags=__|data_hash=CRC32:9bf7c586 -packet|codec_type=audio|stream_index=1|pts=8731|pts_time=8.731000|dts=8731|dts_time=8.731000|duration=46|duration_time=0.046000|size=322|pos=350103|flags=K_|data_hash=CRC32:f8744c32 -packet|codec_type=video|stream_index=0|pts=8742|pts_time=8.742000|dts=8742|dts_time=8.742000|duration=33|duration_time=0.033000|size=239|pos=350442|flags=__|data_hash=CRC32:7549da5a -packet|codec_type=video|stream_index=0|pts=8775|pts_time=8.775000|dts=8775|dts_time=8.775000|duration=33|duration_time=0.033000|size=1581|pos=350701|flags=__|data_hash=CRC32:2d4be1b6 -packet|codec_type=audio|stream_index=1|pts=8777|pts_time=8.777000|dts=8777|dts_time=8.777000|duration=46|duration_time=0.046000|size=318|pos=352302|flags=K_|data_hash=CRC32:e85d4c2c -packet|codec_type=video|stream_index=0|pts=8809|pts_time=8.809000|dts=8809|dts_time=8.809000|duration=33|duration_time=0.033000|size=212|pos=352637|flags=__|data_hash=CRC32:5b804b23 -packet|codec_type=audio|stream_index=1|pts=8824|pts_time=8.824000|dts=8824|dts_time=8.824000|duration=46|duration_time=0.046000|size=326|pos=352869|flags=K_|data_hash=CRC32:a2b69ebf -packet|codec_type=video|stream_index=0|pts=8842|pts_time=8.842000|dts=8842|dts_time=8.842000|duration=33|duration_time=0.033000|size=1351|pos=353212|flags=__|data_hash=CRC32:5f901255 -packet|codec_type=audio|stream_index=1|pts=8870|pts_time=8.870000|dts=8870|dts_time=8.870000|duration=46|duration_time=0.046000|size=341|pos=354583|flags=K_|data_hash=CRC32:f928467f -packet|codec_type=video|stream_index=0|pts=8876|pts_time=8.876000|dts=8876|dts_time=8.876000|duration=33|duration_time=0.033000|size=448|pos=354941|flags=__|data_hash=CRC32:ab757d3b -packet|codec_type=video|stream_index=0|pts=8909|pts_time=8.909000|dts=8909|dts_time=8.909000|duration=33|duration_time=0.033000|size=1403|pos=355409|flags=__|data_hash=CRC32:b01c66f4 -packet|codec_type=audio|stream_index=1|pts=8916|pts_time=8.916000|dts=8916|dts_time=8.916000|duration=46|duration_time=0.046000|size=319|pos=356832|flags=K_|data_hash=CRC32:0926072d -packet|codec_type=video|stream_index=0|pts=8942|pts_time=8.942000|dts=8942|dts_time=8.942000|duration=33|duration_time=0.033000|size=491|pos=357168|flags=__|data_hash=CRC32:0367ac76 -packet|codec_type=audio|stream_index=1|pts=8963|pts_time=8.963000|dts=8963|dts_time=8.963000|duration=46|duration_time=0.046000|size=303|pos=357679|flags=K_|data_hash=CRC32:d41fe125 -packet|codec_type=video|stream_index=0|pts=8976|pts_time=8.976000|dts=8976|dts_time=8.976000|duration=33|duration_time=0.033000|size=1606|pos=357999|flags=__|data_hash=CRC32:662f0120 -packet|codec_type=audio|stream_index=1|pts=9009|pts_time=9.009000|dts=9009|dts_time=9.009000|duration=46|duration_time=0.046000|size=291|pos=359625|flags=K_|data_hash=CRC32:f90846c9 -packet|codec_type=video|stream_index=0|pts=9009|pts_time=9.009000|dts=9009|dts_time=9.009000|duration=33|duration_time=0.033000|size=304|pos=359933|flags=__|data_hash=CRC32:18968792 -packet|codec_type=video|stream_index=0|pts=9042|pts_time=9.042000|dts=9042|dts_time=9.042000|duration=33|duration_time=0.033000|size=1537|pos=360257|flags=__|data_hash=CRC32:5469d062 -packet|codec_type=audio|stream_index=1|pts=9056|pts_time=9.056000|dts=9056|dts_time=9.056000|duration=46|duration_time=0.046000|size=307|pos=361814|flags=K_|data_hash=CRC32:ef8ffe20 -packet|codec_type=video|stream_index=0|pts=9076|pts_time=9.076000|dts=9076|dts_time=9.076000|duration=33|duration_time=0.033000|size=342|pos=362138|flags=__|data_hash=CRC32:dd1d6dbb -packet|codec_type=audio|stream_index=1|pts=9102|pts_time=9.102000|dts=9102|dts_time=9.102000|duration=46|duration_time=0.046000|size=335|pos=362500|flags=K_|data_hash=CRC32:ccc6f929 -packet|codec_type=video|stream_index=0|pts=9109|pts_time=9.109000|dts=9109|dts_time=9.109000|duration=33|duration_time=0.033000|size=1405|pos=362852|flags=__|data_hash=CRC32:6558f9bb -packet|codec_type=video|stream_index=0|pts=9142|pts_time=9.142000|dts=9142|dts_time=9.142000|duration=33|duration_time=0.033000|size=351|pos=364277|flags=__|data_hash=CRC32:867aaa58 -packet|codec_type=audio|stream_index=1|pts=9149|pts_time=9.149000|dts=9149|dts_time=9.149000|duration=46|duration_time=0.046000|size=348|pos=364648|flags=K_|data_hash=CRC32:d0911535 -packet|codec_type=video|stream_index=0|pts=9176|pts_time=9.176000|dts=9176|dts_time=9.176000|duration=33|duration_time=0.033000|size=1451|pos=365013|flags=__|data_hash=CRC32:8c786cd9 -packet|codec_type=audio|stream_index=1|pts=9195|pts_time=9.195000|dts=9195|dts_time=9.195000|duration=46|duration_time=0.046000|size=346|pos=366484|flags=K_|data_hash=CRC32:4d6976df -packet|codec_type=video|stream_index=0|pts=9209|pts_time=9.209000|dts=9209|dts_time=9.209000|duration=33|duration_time=0.033000|size=490|pos=366847|flags=__|data_hash=CRC32:d80d8605 -packet|codec_type=audio|stream_index=1|pts=9242|pts_time=9.242000|dts=9242|dts_time=9.242000|duration=46|duration_time=0.046000|size=333|pos=367357|flags=K_|data_hash=CRC32:dac6e6f2 -packet|codec_type=video|stream_index=0|pts=9243|pts_time=9.243000|dts=9243|dts_time=9.243000|duration=33|duration_time=0.033000|size=1524|pos=367707|flags=__|data_hash=CRC32:c3d07b7a -packet|codec_type=video|stream_index=0|pts=9276|pts_time=9.276000|dts=9276|dts_time=9.276000|duration=33|duration_time=0.033000|size=556|pos=369251|flags=__|data_hash=CRC32:3cb8f0fa -packet|codec_type=audio|stream_index=1|pts=9288|pts_time=9.288000|dts=9288|dts_time=9.288000|duration=46|duration_time=0.046000|size=338|pos=369827|flags=K_|data_hash=CRC32:2eade044 -packet|codec_type=video|stream_index=0|pts=9309|pts_time=9.309000|dts=9309|dts_time=9.309000|duration=33|duration_time=0.033000|size=1414|pos=370182|flags=__|data_hash=CRC32:e4c49a5e -packet|codec_type=audio|stream_index=1|pts=9334|pts_time=9.334000|dts=9334|dts_time=9.334000|duration=46|duration_time=0.046000|size=328|pos=371616|flags=K_|data_hash=CRC32:2a757134 -packet|codec_type=video|stream_index=0|pts=9343|pts_time=9.343000|dts=9343|dts_time=9.343000|duration=33|duration_time=0.033000|size=808|pos=371961|flags=__|data_hash=CRC32:9ec00704 -packet|codec_type=video|stream_index=0|pts=9376|pts_time=9.376000|dts=9376|dts_time=9.376000|duration=33|duration_time=0.033000|size=871|pos=372789|flags=__|data_hash=CRC32:67e02ddd -packet|codec_type=audio|stream_index=1|pts=9381|pts_time=9.381000|dts=9381|dts_time=9.381000|duration=46|duration_time=0.046000|size=334|pos=373680|flags=K_|data_hash=CRC32:3d50fa76 -packet|codec_type=video|stream_index=0|pts=9409|pts_time=9.409000|dts=9409|dts_time=9.409000|duration=33|duration_time=0.033000|size=562|pos=374031|flags=__|data_hash=CRC32:b4925536 -packet|codec_type=audio|stream_index=1|pts=9427|pts_time=9.427000|dts=9427|dts_time=9.427000|duration=46|duration_time=0.046000|size=364|pos=374613|flags=K_|data_hash=CRC32:d936a611 -packet|codec_type=video|stream_index=0|pts=9443|pts_time=9.443000|dts=9443|dts_time=9.443000|duration=33|duration_time=0.033000|size=711|pos=374994|flags=__|data_hash=CRC32:8842cf6e -packet|codec_type=audio|stream_index=1|pts=9474|pts_time=9.474000|dts=9474|dts_time=9.474000|duration=46|duration_time=0.046000|size=350|pos=375725|flags=K_|data_hash=CRC32:004fc6a5 -packet|codec_type=video|stream_index=0|pts=9476|pts_time=9.476000|dts=9476|dts_time=9.476000|duration=33|duration_time=0.033000|size=1209|pos=376092|flags=__|data_hash=CRC32:89e0866a -packet|codec_type=video|stream_index=0|pts=9510|pts_time=9.510000|dts=9510|dts_time=9.510000|duration=33|duration_time=0.033000|size=483|pos=377321|flags=__|data_hash=CRC32:952b1a6f -packet|codec_type=audio|stream_index=1|pts=9520|pts_time=9.520000|dts=9520|dts_time=9.520000|duration=46|duration_time=0.046000|size=348|pos=377824|flags=K_|data_hash=CRC32:314e7eb1 -packet|codec_type=video|stream_index=0|pts=9543|pts_time=9.543000|dts=9543|dts_time=9.543000|duration=33|duration_time=0.033000|size=422|pos=378189|flags=__|data_hash=CRC32:97ea1adf -packet|codec_type=audio|stream_index=1|pts=9567|pts_time=9.567000|dts=9567|dts_time=9.567000|duration=46|duration_time=0.046000|size=354|pos=378631|flags=K_|data_hash=CRC32:4eb4dd74 -packet|codec_type=video|stream_index=0|pts=9576|pts_time=9.576000|dts=9576|dts_time=9.576000|duration=33|duration_time=0.033000|size=533|pos=379002|flags=__|data_hash=CRC32:32282d12 -packet|codec_type=video|stream_index=0|pts=9610|pts_time=9.610000|dts=9610|dts_time=9.610000|duration=33|duration_time=0.033000|size=490|pos=379555|flags=__|data_hash=CRC32:df09aad5 -packet|codec_type=audio|stream_index=1|pts=9613|pts_time=9.613000|dts=9613|dts_time=9.613000|duration=46|duration_time=0.046000|size=358|pos=380065|flags=K_|data_hash=CRC32:032aac0d -packet|codec_type=video|stream_index=0|pts=9643|pts_time=9.643000|dts=9643|dts_time=9.643000|duration=33|duration_time=0.033000|size=972|pos=380440|flags=__|data_hash=CRC32:dfe239a5 -packet|codec_type=audio|stream_index=1|pts=9660|pts_time=9.660000|dts=9660|dts_time=9.660000|duration=46|duration_time=0.046000|size=361|pos=381432|flags=K_|data_hash=CRC32:c758edef -packet|codec_type=video|stream_index=0|pts=9676|pts_time=9.676000|dts=9676|dts_time=9.676000|duration=33|duration_time=0.033000|size=370|pos=381810|flags=__|data_hash=CRC32:18bf63af -packet|codec_type=audio|stream_index=1|pts=9706|pts_time=9.706000|dts=9706|dts_time=9.706000|duration=46|duration_time=0.046000|size=354|pos=382200|flags=K_|data_hash=CRC32:1b23fac4 -packet|codec_type=video|stream_index=0|pts=9710|pts_time=9.710000|dts=9710|dts_time=9.710000|duration=33|duration_time=0.033000|size=348|pos=382571|flags=__|data_hash=CRC32:b6ecb8fe -packet|codec_type=video|stream_index=0|pts=9743|pts_time=9.743000|dts=9743|dts_time=9.743000|duration=33|duration_time=0.033000|size=449|pos=382939|flags=__|data_hash=CRC32:99ec4250 -packet|codec_type=audio|stream_index=1|pts=9752|pts_time=9.752000|dts=9752|dts_time=9.752000|duration=46|duration_time=0.046000|size=369|pos=383408|flags=K_|data_hash=CRC32:25045152 -packet|codec_type=video|stream_index=0|pts=9776|pts_time=9.776000|dts=9776|dts_time=9.776000|duration=33|duration_time=0.033000|size=447|pos=383794|flags=__|data_hash=CRC32:53378d54 -packet|codec_type=audio|stream_index=1|pts=9799|pts_time=9.799000|dts=9799|dts_time=9.799000|duration=46|duration_time=0.046000|size=359|pos=384261|flags=K_|data_hash=CRC32:387d406d -packet|codec_type=video|stream_index=0|pts=9810|pts_time=9.810000|dts=9810|dts_time=9.810000|duration=33|duration_time=0.033000|size=414|pos=384637|flags=__|data_hash=CRC32:ab76fa07 -packet|codec_type=video|stream_index=0|pts=9843|pts_time=9.843000|dts=9843|dts_time=9.843000|duration=33|duration_time=0.033000|size=467|pos=385071|flags=__|data_hash=CRC32:e0d0f23c -packet|codec_type=audio|stream_index=1|pts=9845|pts_time=9.845000|dts=9845|dts_time=9.845000|duration=46|duration_time=0.046000|size=348|pos=385558|flags=K_|data_hash=CRC32:13f83e98 -packet|codec_type=video|stream_index=0|pts=9877|pts_time=9.877000|dts=9877|dts_time=9.877000|duration=33|duration_time=0.033000|size=890|pos=385923|flags=__|data_hash=CRC32:ef8759d9 -packet|codec_type=audio|stream_index=1|pts=9892|pts_time=9.892000|dts=9892|dts_time=9.892000|duration=46|duration_time=0.046000|size=346|pos=386833|flags=K_|data_hash=CRC32:4c0da0e0 -packet|codec_type=video|stream_index=0|pts=9910|pts_time=9.910000|dts=9910|dts_time=9.910000|duration=33|duration_time=0.033000|size=387|pos=387196|flags=__|data_hash=CRC32:9e2b0fa2 -packet|codec_type=audio|stream_index=1|pts=9938|pts_time=9.938000|dts=9938|dts_time=9.938000|duration=46|duration_time=0.046000|size=350|pos=387603|flags=K_|data_hash=CRC32:7b52e49d -packet|codec_type=video|stream_index=0|pts=9943|pts_time=9.943000|dts=9943|dts_time=9.943000|duration=33|duration_time=0.033000|size=351|pos=387970|flags=__|data_hash=CRC32:d1874a20 -packet|codec_type=video|stream_index=0|pts=9977|pts_time=9.977000|dts=9977|dts_time=9.977000|duration=33|duration_time=0.033000|size=720|pos=388341|flags=__|data_hash=CRC32:1dbb852e -packet|codec_type=audio|stream_index=1|pts=9985|pts_time=9.985000|dts=9985|dts_time=9.985000|duration=46|duration_time=0.046000|size=359|pos=389081|flags=K_|data_hash=CRC32:6efd45ba -packet|codec_type=video|stream_index=0|pts=10010|pts_time=10.010000|dts=10010|dts_time=10.010000|duration=33|duration_time=0.033000|size=855|pos=389457|flags=__|data_hash=CRC32:9266ff7a -packet|codec_type=audio|stream_index=1|pts=10031|pts_time=10.031000|dts=10031|dts_time=10.031000|duration=46|duration_time=0.046000|size=355|pos=390332|flags=K_|data_hash=CRC32:58c387cc -packet|codec_type=video|stream_index=0|pts=10043|pts_time=10.043000|dts=10043|dts_time=10.043000|duration=33|duration_time=0.033000|size=742|pos=390704|flags=__|data_hash=CRC32:b48053b8 -packet|codec_type=audio|stream_index=1|pts=10077|pts_time=10.077000|dts=10077|dts_time=10.077000|duration=46|duration_time=0.046000|size=320|pos=391466|flags=K_|data_hash=CRC32:115fa28d -packet|codec_type=video|stream_index=0|pts=10077|pts_time=10.077000|dts=10077|dts_time=10.077000|duration=33|duration_time=0.033000|size=835|pos=391803|flags=__|data_hash=CRC32:5e06bb03 -packet|codec_type=video|stream_index=0|pts=10110|pts_time=10.110000|dts=10110|dts_time=10.110000|duration=33|duration_time=0.033000|size=1610|pos=392658|flags=__|data_hash=CRC32:fafab2d1 -packet|codec_type=audio|stream_index=1|pts=10124|pts_time=10.124000|dts=10124|dts_time=10.124000|duration=46|duration_time=0.046000|size=348|pos=394288|flags=K_|data_hash=CRC32:92d59397 -packet|codec_type=video|stream_index=0|pts=10143|pts_time=10.143000|dts=10143|dts_time=10.143000|duration=33|duration_time=0.033000|size=637|pos=394653|flags=__|data_hash=CRC32:6e59b37f -packet|codec_type=audio|stream_index=1|pts=10170|pts_time=10.170000|dts=10170|dts_time=10.170000|duration=46|duration_time=0.046000|size=370|pos=395310|flags=K_|data_hash=CRC32:3ea66fa9 -packet|codec_type=video|stream_index=0|pts=10177|pts_time=10.177000|dts=10177|dts_time=10.177000|duration=33|duration_time=0.033000|size=614|pos=395697|flags=__|data_hash=CRC32:4f7f5e8e -packet|codec_type=video|stream_index=0|pts=10210|pts_time=10.210000|dts=10210|dts_time=10.210000|duration=33|duration_time=0.033000|size=1143|pos=396331|flags=__|data_hash=CRC32:d877789c -packet|codec_type=audio|stream_index=1|pts=10217|pts_time=10.217000|dts=10217|dts_time=10.217000|duration=46|duration_time=0.046000|size=353|pos=397494|flags=K_|data_hash=CRC32:22050bd1 -packet|codec_type=video|stream_index=0|pts=10244|pts_time=10.244000|dts=10244|dts_time=10.244000|duration=33|duration_time=0.033000|size=1262|pos=397864|flags=__|data_hash=CRC32:6d88aa4f -packet|codec_type=audio|stream_index=1|pts=10263|pts_time=10.263000|dts=10263|dts_time=10.263000|duration=46|duration_time=0.046000|size=367|pos=399146|flags=K_|data_hash=CRC32:077e57a2 -packet|codec_type=video|stream_index=0|pts=10277|pts_time=10.277000|dts=10277|dts_time=10.277000|duration=33|duration_time=0.033000|size=1618|pos=399530|flags=__|data_hash=CRC32:175e29a2 -packet|codec_type=audio|stream_index=1|pts=10310|pts_time=10.310000|dts=10310|dts_time=10.310000|duration=46|duration_time=0.046000|size=350|pos=401168|flags=K_|data_hash=CRC32:346c722e -packet|codec_type=video|stream_index=0|pts=10310|pts_time=10.310000|dts=10310|dts_time=10.310000|duration=33|duration_time=0.033000|size=2345|pos=401535|flags=__|data_hash=CRC32:ccf488bd -packet|codec_type=video|stream_index=0|pts=10344|pts_time=10.344000|dts=10344|dts_time=10.344000|duration=33|duration_time=0.033000|size=1029|pos=403900|flags=__|data_hash=CRC32:4b3a69da -packet|codec_type=audio|stream_index=1|pts=10356|pts_time=10.356000|dts=10356|dts_time=10.356000|duration=46|duration_time=0.046000|size=353|pos=404949|flags=K_|data_hash=CRC32:de07f5ea -packet|codec_type=video|stream_index=0|pts=10377|pts_time=10.377000|dts=10377|dts_time=10.377000|duration=33|duration_time=0.033000|size=932|pos=405319|flags=__|data_hash=CRC32:dfb7b52c -packet|codec_type=audio|stream_index=1|pts=10403|pts_time=10.403000|dts=10403|dts_time=10.403000|duration=46|duration_time=0.046000|size=336|pos=406271|flags=K_|data_hash=CRC32:2dbed9ee -packet|codec_type=video|stream_index=0|pts=10410|pts_time=10.410000|dts=10410|dts_time=10.410000|duration=33|duration_time=0.033000|size=1688|pos=406624|flags=__|data_hash=CRC32:6fc6be0f -packet|codec_type=video|stream_index=0|pts=10444|pts_time=10.444000|dts=10444|dts_time=10.444000|duration=33|duration_time=0.033000|size=4159|pos=408332|flags=K_|data_hash=CRC32:6988ae22 -packet|codec_type=audio|stream_index=1|pts=10449|pts_time=10.449000|dts=10449|dts_time=10.449000|duration=46|duration_time=0.046000|size=334|pos=412511|flags=K_|data_hash=CRC32:7b903b6f -packet|codec_type=video|stream_index=0|pts=10477|pts_time=10.477000|dts=10477|dts_time=10.477000|duration=33|duration_time=0.033000|size=2039|pos=412862|flags=__|data_hash=CRC32:c0cf0abd -packet|codec_type=audio|stream_index=1|pts=10495|pts_time=10.495000|dts=10495|dts_time=10.495000|duration=46|duration_time=0.046000|size=358|pos=414921|flags=K_|data_hash=CRC32:2e46c79f -packet|codec_type=video|stream_index=0|pts=10511|pts_time=10.511000|dts=10511|dts_time=10.511000|duration=33|duration_time=0.033000|size=614|pos=415296|flags=__|data_hash=CRC32:682066fb -packet|codec_type=audio|stream_index=1|pts=10542|pts_time=10.542000|dts=10542|dts_time=10.542000|duration=46|duration_time=0.046000|size=344|pos=415930|flags=K_|data_hash=CRC32:037d4b43 -packet|codec_type=video|stream_index=0|pts=10544|pts_time=10.544000|dts=10544|dts_time=10.544000|duration=33|duration_time=0.033000|size=1749|pos=416291|flags=__|data_hash=CRC32:09ab2b77 -packet|codec_type=video|stream_index=0|pts=10577|pts_time=10.577000|dts=10577|dts_time=10.577000|duration=33|duration_time=0.033000|size=2609|pos=418060|flags=__|data_hash=CRC32:3630dc54 -packet|codec_type=audio|stream_index=1|pts=10588|pts_time=10.588000|dts=10588|dts_time=10.588000|duration=46|duration_time=0.046000|size=344|pos=420689|flags=K_|data_hash=CRC32:73dfce6a -packet|codec_type=video|stream_index=0|pts=10611|pts_time=10.611000|dts=10611|dts_time=10.611000|duration=33|duration_time=0.033000|size=689|pos=421050|flags=__|data_hash=CRC32:6700928b -packet|codec_type=audio|stream_index=1|pts=10635|pts_time=10.635000|dts=10635|dts_time=10.635000|duration=46|duration_time=0.046000|size=356|pos=421759|flags=K_|data_hash=CRC32:5596b779 -packet|codec_type=video|stream_index=0|pts=10644|pts_time=10.644000|dts=10644|dts_time=10.644000|duration=33|duration_time=0.033000|size=2259|pos=422132|flags=__|data_hash=CRC32:264fcb3f -packet|codec_type=video|stream_index=0|pts=10677|pts_time=10.677000|dts=10677|dts_time=10.677000|duration=33|duration_time=0.033000|size=2494|pos=424411|flags=__|data_hash=CRC32:67753c81 -packet|codec_type=audio|stream_index=1|pts=10681|pts_time=10.681000|dts=10681|dts_time=10.681000|duration=46|duration_time=0.046000|size=354|pos=426925|flags=K_|data_hash=CRC32:3d7b1c0d -packet|codec_type=video|stream_index=0|pts=10711|pts_time=10.711000|dts=10711|dts_time=10.711000|duration=33|duration_time=0.033000|size=2457|pos=427296|flags=__|data_hash=CRC32:f02a3205 -packet|codec_type=audio|stream_index=1|pts=10728|pts_time=10.728000|dts=10728|dts_time=10.728000|duration=46|duration_time=0.046000|size=330|pos=429773|flags=K_|data_hash=CRC32:f9310cfe -packet|codec_type=video|stream_index=0|pts=10744|pts_time=10.744000|dts=10744|dts_time=10.744000|duration=33|duration_time=0.033000|size=2476|pos=430120|flags=__|data_hash=CRC32:eac06b3e -packet|codec_type=audio|stream_index=1|pts=10774|pts_time=10.774000|dts=10774|dts_time=10.774000|duration=46|duration_time=0.046000|size=328|pos=432616|flags=K_|data_hash=CRC32:9618f3ab -packet|codec_type=video|stream_index=0|pts=10777|pts_time=10.777000|dts=10777|dts_time=10.777000|duration=33|duration_time=0.033000|size=2560|pos=432961|flags=__|data_hash=CRC32:4c277ba1 -packet|codec_type=video|stream_index=0|pts=10811|pts_time=10.811000|dts=10811|dts_time=10.811000|duration=33|duration_time=0.033000|size=2679|pos=435541|flags=__|data_hash=CRC32:e070caf2 -packet|codec_type=audio|stream_index=1|pts=10820|pts_time=10.820000|dts=10820|dts_time=10.820000|duration=46|duration_time=0.046000|size=351|pos=438240|flags=K_|data_hash=CRC32:19bb5b6c -packet|codec_type=video|stream_index=0|pts=10844|pts_time=10.844000|dts=10844|dts_time=10.844000|duration=33|duration_time=0.033000|size=2795|pos=438608|flags=__|data_hash=CRC32:6642234c -packet|codec_type=audio|stream_index=1|pts=10867|pts_time=10.867000|dts=10867|dts_time=10.867000|duration=46|duration_time=0.046000|size=364|pos=441423|flags=K_|data_hash=CRC32:4dbd8e39 -packet|codec_type=video|stream_index=0|pts=10878|pts_time=10.878000|dts=10878|dts_time=10.878000|duration=33|duration_time=0.033000|size=2927|pos=441804|flags=__|data_hash=CRC32:0c7d6e1b -packet|codec_type=video|stream_index=0|pts=10911|pts_time=10.911000|dts=10911|dts_time=10.911000|duration=33|duration_time=0.033000|size=2437|pos=444751|flags=__|data_hash=CRC32:29100f02 -packet|codec_type=audio|stream_index=1|pts=10913|pts_time=10.913000|dts=10913|dts_time=10.913000|duration=46|duration_time=0.046000|size=365|pos=447208|flags=K_|data_hash=CRC32:f4732e1d -packet|codec_type=video|stream_index=0|pts=10944|pts_time=10.944000|dts=10944|dts_time=10.944000|duration=33|duration_time=0.033000|size=2663|pos=447590|flags=__|data_hash=CRC32:42a7b089 -packet|codec_type=audio|stream_index=1|pts=10960|pts_time=10.960000|dts=10960|dts_time=10.960000|duration=46|duration_time=0.046000|size=341|pos=450273|flags=K_|data_hash=CRC32:270d8e2f -packet|codec_type=video|stream_index=0|pts=10978|pts_time=10.978000|dts=10978|dts_time=10.978000|duration=33|duration_time=0.033000|size=2688|pos=450631|flags=__|data_hash=CRC32:e6b1e69d -packet|codec_type=audio|stream_index=1|pts=11006|pts_time=11.006000|dts=11006|dts_time=11.006000|duration=46|duration_time=0.046000|size=330|pos=453339|flags=K_|data_hash=CRC32:ffedf602 -packet|codec_type=video|stream_index=0|pts=11011|pts_time=11.011000|dts=11011|dts_time=11.011000|duration=33|duration_time=0.033000|size=2727|pos=453686|flags=__|data_hash=CRC32:0e15158e -packet|codec_type=video|stream_index=0|pts=11044|pts_time=11.044000|dts=11044|dts_time=11.044000|duration=33|duration_time=0.033000|size=2747|pos=456433|flags=__|data_hash=CRC32:5456aa57 -packet|codec_type=audio|stream_index=1|pts=11053|pts_time=11.053000|dts=11053|dts_time=11.053000|duration=46|duration_time=0.046000|size=358|pos=459200|flags=K_|data_hash=CRC32:cac56902 -packet|codec_type=video|stream_index=0|pts=11078|pts_time=11.078000|dts=11078|dts_time=11.078000|duration=33|duration_time=0.033000|size=3602|pos=459575|flags=__|data_hash=CRC32:a332e21c -packet|codec_type=audio|stream_index=1|pts=11099|pts_time=11.099000|dts=11099|dts_time=11.099000|duration=46|duration_time=0.046000|size=367|pos=463197|flags=K_|data_hash=CRC32:6e7f4f1d -packet|codec_type=video|stream_index=0|pts=11111|pts_time=11.111000|dts=11111|dts_time=11.111000|duration=33|duration_time=0.033000|size=1334|pos=463581|flags=__|data_hash=CRC32:5c4e2f6d -packet|codec_type=video|stream_index=0|pts=11144|pts_time=11.144000|dts=11144|dts_time=11.144000|duration=33|duration_time=0.033000|size=2562|pos=464935|flags=__|data_hash=CRC32:ebc7e2ca -packet|codec_type=audio|stream_index=1|pts=11146|pts_time=11.146000|dts=11146|dts_time=11.146000|duration=46|duration_time=0.046000|size=353|pos=467517|flags=K_|data_hash=CRC32:cfe498a5 -packet|codec_type=video|stream_index=0|pts=11178|pts_time=11.178000|dts=11178|dts_time=11.178000|duration=33|duration_time=0.033000|size=2917|pos=467887|flags=__|data_hash=CRC32:77f836e3 -packet|codec_type=audio|stream_index=1|pts=11192|pts_time=11.192000|dts=11192|dts_time=11.192000|duration=46|duration_time=0.046000|size=336|pos=470824|flags=K_|data_hash=CRC32:9ee13031 -packet|codec_type=video|stream_index=0|pts=11211|pts_time=11.211000|dts=11211|dts_time=11.211000|duration=33|duration_time=0.033000|size=2788|pos=471177|flags=__|data_hash=CRC32:79aa2cce -packet|codec_type=audio|stream_index=1|pts=11238|pts_time=11.238000|dts=11238|dts_time=11.238000|duration=46|duration_time=0.046000|size=329|pos=473985|flags=K_|data_hash=CRC32:86c3f096 -packet|codec_type=video|stream_index=0|pts=11245|pts_time=11.245000|dts=11245|dts_time=11.245000|duration=33|duration_time=0.033000|size=2876|pos=474331|flags=__|data_hash=CRC32:f71a01f7 -packet|codec_type=video|stream_index=0|pts=11278|pts_time=11.278000|dts=11278|dts_time=11.278000|duration=33|duration_time=0.033000|size=2782|pos=477227|flags=__|data_hash=CRC32:66c68a76 -packet|codec_type=audio|stream_index=1|pts=11285|pts_time=11.285000|dts=11285|dts_time=11.285000|duration=46|duration_time=0.046000|size=323|pos=480029|flags=K_|data_hash=CRC32:1e715e07 -packet|codec_type=video|stream_index=0|pts=11311|pts_time=11.311000|dts=11311|dts_time=11.311000|duration=33|duration_time=0.033000|size=2393|pos=480369|flags=__|data_hash=CRC32:ca824913 -packet|codec_type=audio|stream_index=1|pts=11331|pts_time=11.331000|dts=11331|dts_time=11.331000|duration=46|duration_time=0.046000|size=328|pos=482782|flags=K_|data_hash=CRC32:57b8fe27 -packet|codec_type=video|stream_index=0|pts=11345|pts_time=11.345000|dts=11345|dts_time=11.345000|duration=33|duration_time=0.033000|size=2773|pos=483127|flags=__|data_hash=CRC32:6bc9c9d7 -packet|codec_type=audio|stream_index=1|pts=11378|pts_time=11.378000|dts=11378|dts_time=11.378000|duration=46|duration_time=0.046000|size=345|pos=485920|flags=K_|data_hash=CRC32:95f244d4 -packet|codec_type=video|stream_index=0|pts=11378|pts_time=11.378000|dts=11378|dts_time=11.378000|duration=33|duration_time=0.033000|size=2972|pos=486282|flags=__|data_hash=CRC32:9fdef1d9 -packet|codec_type=video|stream_index=0|pts=11411|pts_time=11.411000|dts=11411|dts_time=11.411000|duration=33|duration_time=0.033000|size=3480|pos=489274|flags=__|data_hash=CRC32:977f9784 -packet|codec_type=audio|stream_index=1|pts=11424|pts_time=11.424000|dts=11424|dts_time=11.424000|duration=46|duration_time=0.046000|size=345|pos=492774|flags=K_|data_hash=CRC32:9c69a0dc -packet|codec_type=video|stream_index=0|pts=11445|pts_time=11.445000|dts=11445|dts_time=11.445000|duration=33|duration_time=0.033000|size=1078|pos=493136|flags=__|data_hash=CRC32:4a479a66 -packet|codec_type=audio|stream_index=1|pts=11471|pts_time=11.471000|dts=11471|dts_time=11.471000|duration=46|duration_time=0.046000|size=349|pos=494234|flags=K_|data_hash=CRC32:0fcb70ef -packet|codec_type=video|stream_index=0|pts=11478|pts_time=11.478000|dts=11478|dts_time=11.478000|duration=33|duration_time=0.033000|size=3385|pos=494600|flags=__|data_hash=CRC32:f1d76112 -packet|codec_type=video|stream_index=0|pts=11512|pts_time=11.512000|dts=11512|dts_time=11.512000|duration=33|duration_time=0.033000|size=1408|pos=498005|flags=__|data_hash=CRC32:12165420 -packet|codec_type=audio|stream_index=1|pts=11517|pts_time=11.517000|dts=11517|dts_time=11.517000|duration=46|duration_time=0.046000|size=340|pos=499433|flags=K_|data_hash=CRC32:e867c459 -packet|codec_type=video|stream_index=0|pts=11545|pts_time=11.545000|dts=11545|dts_time=11.545000|duration=33|duration_time=0.033000|size=2543|pos=499790|flags=__|data_hash=CRC32:d3803831 -packet|codec_type=audio|stream_index=1|pts=11564|pts_time=11.564000|dts=11564|dts_time=11.564000|duration=46|duration_time=0.046000|size=352|pos=502353|flags=K_|data_hash=CRC32:029632be -packet|codec_type=video|stream_index=0|pts=11578|pts_time=11.578000|dts=11578|dts_time=11.578000|duration=33|duration_time=0.033000|size=3609|pos=502722|flags=__|data_hash=CRC32:ebd09926 -packet|codec_type=audio|stream_index=1|pts=11610|pts_time=11.610000|dts=11610|dts_time=11.610000|duration=46|duration_time=0.046000|size=345|pos=506351|flags=K_|data_hash=CRC32:8374b7c9 -packet|codec_type=video|stream_index=0|pts=11612|pts_time=11.612000|dts=11612|dts_time=11.612000|duration=33|duration_time=0.033000|size=1078|pos=506713|flags=__|data_hash=CRC32:96db1ff7 -packet|codec_type=video|stream_index=0|pts=11645|pts_time=11.645000|dts=11645|dts_time=11.645000|duration=33|duration_time=0.033000|size=2600|pos=507811|flags=__|data_hash=CRC32:d35f9e6f -packet|codec_type=audio|stream_index=1|pts=11656|pts_time=11.656000|dts=11656|dts_time=11.656000|duration=46|duration_time=0.046000|size=346|pos=510431|flags=K_|data_hash=CRC32:4e6b44cb -packet|codec_type=video|stream_index=0|pts=11678|pts_time=11.678000|dts=11678|dts_time=11.678000|duration=33|duration_time=0.033000|size=1190|pos=510794|flags=__|data_hash=CRC32:a0206c90 +packet|codec_type=audio|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=46|duration_time=0.046000|size=9|pos=3241|flags=K__|data_hash=CRC32:bbb61b93|side_data|side_data_type=New Extradata + +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=33|duration_time=0.033000|size=135|pos=3267|flags=K__|data_hash=CRC32:3f2ccc9e|side_data|side_data_type=New Extradata + +packet|codec_type=video|stream_index=0|pts=33|pts_time=0.033000|dts=33|dts_time=0.033000|duration=33|duration_time=0.033000|size=92|pos=3422|flags=___|data_hash=CRC32:c14e72b2 +packet|codec_type=audio|stream_index=1|pts=46|pts_time=0.046000|dts=46|dts_time=0.046000|duration=46|duration_time=0.046000|size=9|pos=3534|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=67|pts_time=0.067000|dts=67|dts_time=0.067000|duration=33|duration_time=0.033000|size=14|pos=3560|flags=___|data_hash=CRC32:0b3c3ab4 +packet|codec_type=audio|stream_index=1|pts=93|pts_time=0.093000|dts=93|dts_time=0.093000|duration=46|duration_time=0.046000|size=9|pos=3594|flags=K__|data_hash=CRC32:42c079c5 +packet|codec_type=video|stream_index=0|pts=100|pts_time=0.100000|dts=100|dts_time=0.100000|duration=33|duration_time=0.033000|size=14|pos=3620|flags=___|data_hash=CRC32:280ad88b +packet|codec_type=video|stream_index=0|pts=133|pts_time=0.133000|dts=133|dts_time=0.133000|duration=33|duration_time=0.033000|size=117|pos=3654|flags=___|data_hash=CRC32:376f2497 +packet|codec_type=audio|stream_index=1|pts=139|pts_time=0.139000|dts=139|dts_time=0.139000|duration=46|duration_time=0.046000|size=89|pos=3791|flags=K__|data_hash=CRC32:548db44a +packet|codec_type=video|stream_index=0|pts=167|pts_time=0.167000|dts=167|dts_time=0.167000|duration=33|duration_time=0.033000|size=14|pos=3897|flags=___|data_hash=CRC32:0811a146 +packet|codec_type=audio|stream_index=1|pts=186|pts_time=0.186000|dts=186|dts_time=0.186000|duration=46|duration_time=0.046000|size=155|pos=3931|flags=K__|data_hash=CRC32:a7111723 +packet|codec_type=video|stream_index=0|pts=200|pts_time=0.200000|dts=200|dts_time=0.200000|duration=33|duration_time=0.033000|size=14|pos=4103|flags=___|data_hash=CRC32:3bfeef21 +packet|codec_type=audio|stream_index=1|pts=232|pts_time=0.232000|dts=232|dts_time=0.232000|duration=46|duration_time=0.046000|size=281|pos=4137|flags=K__|data_hash=CRC32:27f537aa +packet|codec_type=video|stream_index=0|pts=234|pts_time=0.234000|dts=234|dts_time=0.234000|duration=33|duration_time=0.033000|size=117|pos=4435|flags=___|data_hash=CRC32:2bc5eba8 +packet|codec_type=video|stream_index=0|pts=267|pts_time=0.267000|dts=267|dts_time=0.267000|duration=33|duration_time=0.033000|size=14|pos=4572|flags=___|data_hash=CRC32:0033671d +packet|codec_type=audio|stream_index=1|pts=279|pts_time=0.279000|dts=279|dts_time=0.279000|duration=46|duration_time=0.046000|size=548|pos=4606|flags=K__|data_hash=CRC32:7ab3c7cb +packet|codec_type=video|stream_index=0|pts=300|pts_time=0.300000|dts=300|dts_time=0.300000|duration=33|duration_time=0.033000|size=14|pos=5171|flags=___|data_hash=CRC32:dfb4f951 +packet|codec_type=audio|stream_index=1|pts=325|pts_time=0.325000|dts=325|dts_time=0.325000|duration=46|duration_time=0.046000|size=472|pos=5205|flags=K__|data_hash=CRC32:d10a7849 +packet|codec_type=video|stream_index=0|pts=334|pts_time=0.334000|dts=334|dts_time=0.334000|duration=33|duration_time=0.033000|size=117|pos=5694|flags=___|data_hash=CRC32:97814fc1 +packet|codec_type=video|stream_index=0|pts=367|pts_time=0.367000|dts=367|dts_time=0.367000|duration=33|duration_time=0.033000|size=14|pos=5831|flags=___|data_hash=CRC32:3c206b65 +packet|codec_type=audio|stream_index=1|pts=372|pts_time=0.372000|dts=372|dts_time=0.372000|duration=46|duration_time=0.046000|size=489|pos=5865|flags=K__|data_hash=CRC32:4d3f1f03 +packet|codec_type=video|stream_index=0|pts=400|pts_time=0.400000|dts=400|dts_time=0.400000|duration=33|duration_time=0.033000|size=14|pos=6371|flags=___|data_hash=CRC32:0fcf2502 +packet|codec_type=audio|stream_index=1|pts=418|pts_time=0.418000|dts=418|dts_time=0.418000|duration=46|duration_time=0.046000|size=357|pos=6405|flags=K__|data_hash=CRC32:eccea9c1 +packet|codec_type=video|stream_index=0|pts=434|pts_time=0.434000|dts=434|dts_time=0.434000|duration=33|duration_time=0.033000|size=207|pos=6779|flags=___|data_hash=CRC32:86bab8df +packet|codec_type=audio|stream_index=1|pts=464|pts_time=0.464000|dts=464|dts_time=0.464000|duration=46|duration_time=0.046000|size=262|pos=7006|flags=K__|data_hash=CRC32:50b0e3b7 +packet|codec_type=video|stream_index=0|pts=467|pts_time=0.467000|dts=467|dts_time=0.467000|duration=33|duration_time=0.033000|size=14|pos=7285|flags=___|data_hash=CRC32:8704a589 +packet|codec_type=video|stream_index=0|pts=501|pts_time=0.501000|dts=501|dts_time=0.501000|duration=33|duration_time=0.033000|size=14|pos=7319|flags=___|data_hash=CRC32:d3357720 +packet|codec_type=audio|stream_index=1|pts=511|pts_time=0.511000|dts=511|dts_time=0.511000|duration=46|duration_time=0.046000|size=294|pos=7353|flags=K__|data_hash=CRC32:805a1f22 +packet|codec_type=video|stream_index=0|pts=534|pts_time=0.534000|dts=534|dts_time=0.534000|duration=33|duration_time=0.033000|size=179|pos=7664|flags=___|data_hash=CRC32:5b61c9b6 +packet|codec_type=audio|stream_index=1|pts=557|pts_time=0.557000|dts=557|dts_time=0.557000|duration=46|duration_time=0.046000|size=204|pos=7863|flags=K__|data_hash=CRC32:7f4a9c90 +packet|codec_type=video|stream_index=0|pts=567|pts_time=0.567000|dts=567|dts_time=0.567000|duration=33|duration_time=0.033000|size=14|pos=8084|flags=___|data_hash=CRC32:44067395 +packet|codec_type=video|stream_index=0|pts=601|pts_time=0.601000|dts=601|dts_time=0.601000|duration=33|duration_time=0.033000|size=14|pos=8118|flags=___|data_hash=CRC32:00ee0d64 +packet|codec_type=audio|stream_index=1|pts=604|pts_time=0.604000|dts=604|dts_time=0.604000|duration=46|duration_time=0.046000|size=275|pos=8152|flags=K__|data_hash=CRC32:d04e94cd +packet|codec_type=video|stream_index=0|pts=634|pts_time=0.634000|dts=634|dts_time=0.634000|duration=33|duration_time=0.033000|size=32|pos=8444|flags=___|data_hash=CRC32:41c4e3cb +packet|codec_type=audio|stream_index=1|pts=650|pts_time=0.650000|dts=650|dts_time=0.650000|duration=46|duration_time=0.046000|size=309|pos=8496|flags=K__|data_hash=CRC32:c3b4718d +packet|codec_type=video|stream_index=0|pts=667|pts_time=0.667000|dts=667|dts_time=0.667000|duration=33|duration_time=0.033000|size=30|pos=8822|flags=___|data_hash=CRC32:9894f2b3 +packet|codec_type=audio|stream_index=1|pts=697|pts_time=0.697000|dts=697|dts_time=0.697000|duration=46|duration_time=0.046000|size=280|pos=8872|flags=K__|data_hash=CRC32:683aa168 +packet|codec_type=video|stream_index=0|pts=701|pts_time=0.701000|dts=701|dts_time=0.701000|duration=33|duration_time=0.033000|size=16|pos=9169|flags=___|data_hash=CRC32:33031360 +packet|codec_type=video|stream_index=0|pts=734|pts_time=0.734000|dts=734|dts_time=0.734000|duration=33|duration_time=0.033000|size=33|pos=9205|flags=___|data_hash=CRC32:4cb9408b +packet|codec_type=audio|stream_index=1|pts=743|pts_time=0.743000|dts=743|dts_time=0.743000|duration=46|duration_time=0.046000|size=106|pos=9258|flags=K__|data_hash=CRC32:d3693544 +packet|codec_type=video|stream_index=0|pts=767|pts_time=0.767000|dts=767|dts_time=0.767000|duration=33|duration_time=0.033000|size=16|pos=9381|flags=___|data_hash=CRC32:ebca8d2b +packet|codec_type=audio|stream_index=1|pts=789|pts_time=0.789000|dts=789|dts_time=0.789000|duration=46|duration_time=0.046000|size=133|pos=9417|flags=K__|data_hash=CRC32:848dc228 +packet|codec_type=video|stream_index=0|pts=801|pts_time=0.801000|dts=801|dts_time=0.801000|duration=33|duration_time=0.033000|size=16|pos=9567|flags=___|data_hash=CRC32:9d238d80 +packet|codec_type=video|stream_index=0|pts=834|pts_time=0.834000|dts=834|dts_time=0.834000|duration=33|duration_time=0.033000|size=22|pos=9603|flags=___|data_hash=CRC32:d606882e +packet|codec_type=audio|stream_index=1|pts=836|pts_time=0.836000|dts=836|dts_time=0.836000|duration=46|duration_time=0.046000|size=380|pos=9645|flags=K__|data_hash=CRC32:70b58912 +packet|codec_type=video|stream_index=0|pts=868|pts_time=0.868000|dts=868|dts_time=0.868000|duration=33|duration_time=0.033000|size=14|pos=10042|flags=___|data_hash=CRC32:39d914b1 +packet|codec_type=audio|stream_index=1|pts=882|pts_time=0.882000|dts=882|dts_time=0.882000|duration=46|duration_time=0.046000|size=378|pos=10076|flags=K__|data_hash=CRC32:7eaf35cb +packet|codec_type=video|stream_index=0|pts=901|pts_time=0.901000|dts=901|dts_time=0.901000|duration=33|duration_time=0.033000|size=14|pos=10471|flags=___|data_hash=CRC32:1aeff68e +packet|codec_type=audio|stream_index=1|pts=929|pts_time=0.929000|dts=929|dts_time=0.929000|duration=46|duration_time=0.046000|size=108|pos=10505|flags=K__|data_hash=CRC32:8bf2b703 +packet|codec_type=video|stream_index=0|pts=934|pts_time=0.934000|dts=934|dts_time=0.934000|duration=33|duration_time=0.033000|size=55|pos=10630|flags=___|data_hash=CRC32:26064135 +packet|codec_type=video|stream_index=0|pts=968|pts_time=0.968000|dts=968|dts_time=0.968000|duration=33|duration_time=0.033000|size=14|pos=10705|flags=___|data_hash=CRC32:abb369c4 +packet|codec_type=audio|stream_index=1|pts=975|pts_time=0.975000|dts=975|dts_time=0.975000|duration=46|duration_time=0.046000|size=279|pos=10739|flags=K__|data_hash=CRC32:6bff85a8 +packet|codec_type=video|stream_index=0|pts=1001|pts_time=1.001000|dts=1001|dts_time=1.001000|duration=33|duration_time=0.033000|size=14|pos=11035|flags=___|data_hash=CRC32:1af77344 +packet|codec_type=audio|stream_index=1|pts=1022|pts_time=1.022000|dts=1022|dts_time=1.022000|duration=46|duration_time=0.046000|size=134|pos=11069|flags=K__|data_hash=CRC32:349e2a8c +packet|codec_type=video|stream_index=0|pts=1034|pts_time=1.034000|dts=1034|dts_time=1.034000|duration=33|duration_time=0.033000|size=58|pos=11220|flags=___|data_hash=CRC32:8b2e7991 +packet|codec_type=audio|stream_index=1|pts=1068|pts_time=1.068000|dts=1068|dts_time=1.068000|duration=46|duration_time=0.046000|size=162|pos=11298|flags=K__|data_hash=CRC32:f64effd2 +packet|codec_type=video|stream_index=0|pts=1068|pts_time=1.068000|dts=1068|dts_time=1.068000|duration=33|duration_time=0.033000|size=39|pos=11477|flags=___|data_hash=CRC32:0ae377c8 +packet|codec_type=video|stream_index=0|pts=1101|pts_time=1.101000|dts=1101|dts_time=1.101000|duration=33|duration_time=0.033000|size=48|pos=11536|flags=___|data_hash=CRC32:1bc6d22d +packet|codec_type=audio|stream_index=1|pts=1115|pts_time=1.115000|dts=1115|dts_time=1.115000|duration=46|duration_time=0.046000|size=46|pos=11604|flags=K__|data_hash=CRC32:3dfbc696 +packet|codec_type=video|stream_index=0|pts=1134|pts_time=1.134000|dts=1134|dts_time=1.134000|duration=33|duration_time=0.033000|size=319|pos=11667|flags=___|data_hash=CRC32:39d9a172 +packet|codec_type=audio|stream_index=1|pts=1161|pts_time=1.161000|dts=1161|dts_time=1.161000|duration=46|duration_time=0.046000|size=150|pos=12006|flags=K__|data_hash=CRC32:eec82a0f +packet|codec_type=video|stream_index=0|pts=1168|pts_time=1.168000|dts=1168|dts_time=1.168000|duration=33|duration_time=0.033000|size=204|pos=12173|flags=___|data_hash=CRC32:96683004 +packet|codec_type=video|stream_index=0|pts=1201|pts_time=1.201000|dts=1201|dts_time=1.201000|duration=33|duration_time=0.033000|size=240|pos=12397|flags=___|data_hash=CRC32:65f1defa +packet|codec_type=audio|stream_index=1|pts=1207|pts_time=1.207000|dts=1207|dts_time=1.207000|duration=46|duration_time=0.046000|size=427|pos=12657|flags=K__|data_hash=CRC32:e8361847 +packet|codec_type=video|stream_index=0|pts=1235|pts_time=1.235000|dts=1235|dts_time=1.235000|duration=33|duration_time=0.033000|size=305|pos=13101|flags=___|data_hash=CRC32:12e13d9c +packet|codec_type=audio|stream_index=1|pts=1254|pts_time=1.254000|dts=1254|dts_time=1.254000|duration=46|duration_time=0.046000|size=616|pos=13426|flags=K__|data_hash=CRC32:65e6a966 +packet|codec_type=video|stream_index=0|pts=1268|pts_time=1.268000|dts=1268|dts_time=1.268000|duration=33|duration_time=0.033000|size=217|pos=14059|flags=___|data_hash=CRC32:741596bf +packet|codec_type=audio|stream_index=1|pts=1300|pts_time=1.300000|dts=1300|dts_time=1.300000|duration=46|duration_time=0.046000|size=736|pos=14296|flags=K__|data_hash=CRC32:bf178137 +packet|codec_type=video|stream_index=0|pts=1301|pts_time=1.301000|dts=1301|dts_time=1.301000|duration=33|duration_time=0.033000|size=236|pos=15049|flags=___|data_hash=CRC32:e857a41f +packet|codec_type=video|stream_index=0|pts=1335|pts_time=1.335000|dts=1335|dts_time=1.335000|duration=33|duration_time=0.033000|size=222|pos=15305|flags=___|data_hash=CRC32:02e5c508 +packet|codec_type=audio|stream_index=1|pts=1347|pts_time=1.347000|dts=1347|dts_time=1.347000|duration=46|duration_time=0.046000|size=708|pos=15547|flags=K__|data_hash=CRC32:cd4df572 +packet|codec_type=video|stream_index=0|pts=1368|pts_time=1.368000|dts=1368|dts_time=1.368000|duration=33|duration_time=0.033000|size=1295|pos=16272|flags=K__|data_hash=CRC32:65d347c4 +packet|codec_type=audio|stream_index=1|pts=1393|pts_time=1.393000|dts=1393|dts_time=1.393000|duration=46|duration_time=0.046000|size=717|pos=17587|flags=K__|data_hash=CRC32:72de4551 +packet|codec_type=video|stream_index=0|pts=1401|pts_time=1.401000|dts=1401|dts_time=1.401000|duration=33|duration_time=0.033000|size=653|pos=18321|flags=___|data_hash=CRC32:b9f01826 +packet|codec_type=video|stream_index=0|pts=1435|pts_time=1.435000|dts=1435|dts_time=1.435000|duration=33|duration_time=0.033000|size=335|pos=18994|flags=___|data_hash=CRC32:9e2e9463 +packet|codec_type=audio|stream_index=1|pts=1440|pts_time=1.440000|dts=1440|dts_time=1.440000|duration=46|duration_time=0.046000|size=730|pos=19349|flags=K__|data_hash=CRC32:8f424fb7 +packet|codec_type=video|stream_index=0|pts=1468|pts_time=1.468000|dts=1468|dts_time=1.468000|duration=33|duration_time=0.033000|size=765|pos=20096|flags=___|data_hash=CRC32:09b3b571 +packet|codec_type=audio|stream_index=1|pts=1486|pts_time=1.486000|dts=1486|dts_time=1.486000|duration=46|duration_time=0.046000|size=756|pos=20881|flags=K__|data_hash=CRC32:4921e8da +packet|codec_type=video|stream_index=0|pts=1502|pts_time=1.502000|dts=1502|dts_time=1.502000|duration=33|duration_time=0.033000|size=213|pos=21654|flags=___|data_hash=CRC32:c7c9280a +packet|codec_type=audio|stream_index=1|pts=1533|pts_time=1.533000|dts=1533|dts_time=1.533000|duration=46|duration_time=0.046000|size=664|pos=21887|flags=K__|data_hash=CRC32:e093637e +packet|codec_type=video|stream_index=0|pts=1535|pts_time=1.535000|dts=1535|dts_time=1.535000|duration=33|duration_time=0.033000|size=464|pos=22568|flags=___|data_hash=CRC32:e555cff4 +packet|codec_type=video|stream_index=0|pts=1568|pts_time=1.568000|dts=1568|dts_time=1.568000|duration=33|duration_time=0.033000|size=561|pos=23052|flags=___|data_hash=CRC32:5e5d560b +packet|codec_type=audio|stream_index=1|pts=1579|pts_time=1.579000|dts=1579|dts_time=1.579000|duration=46|duration_time=0.046000|size=751|pos=23633|flags=K__|data_hash=CRC32:7d228f8d +packet|codec_type=video|stream_index=0|pts=1602|pts_time=1.602000|dts=1602|dts_time=1.602000|duration=33|duration_time=0.033000|size=876|pos=24401|flags=___|data_hash=CRC32:e92ee634 +packet|codec_type=audio|stream_index=1|pts=1625|pts_time=1.625000|dts=1625|dts_time=1.625000|duration=46|duration_time=0.046000|size=780|pos=25297|flags=K__|data_hash=CRC32:9b9cba9e +packet|codec_type=video|stream_index=0|pts=1635|pts_time=1.635000|dts=1635|dts_time=1.635000|duration=33|duration_time=0.033000|size=473|pos=26094|flags=___|data_hash=CRC32:4797e66e +packet|codec_type=video|stream_index=0|pts=1668|pts_time=1.668000|dts=1668|dts_time=1.668000|duration=33|duration_time=0.033000|size=272|pos=26587|flags=___|data_hash=CRC32:86c1281c +packet|codec_type=audio|stream_index=1|pts=1672|pts_time=1.672000|dts=1672|dts_time=1.672000|duration=46|duration_time=0.046000|size=404|pos=26879|flags=K__|data_hash=CRC32:89d51769 +packet|codec_type=video|stream_index=0|pts=1702|pts_time=1.702000|dts=1702|dts_time=1.702000|duration=33|duration_time=0.033000|size=281|pos=27300|flags=___|data_hash=CRC32:b5f22b1a +packet|codec_type=audio|stream_index=1|pts=1718|pts_time=1.718000|dts=1718|dts_time=1.718000|duration=46|duration_time=0.046000|size=326|pos=27601|flags=K__|data_hash=CRC32:3723e2b7 +packet|codec_type=video|stream_index=0|pts=1735|pts_time=1.735000|dts=1735|dts_time=1.735000|duration=33|duration_time=0.033000|size=315|pos=27944|flags=___|data_hash=CRC32:322931af +packet|codec_type=audio|stream_index=1|pts=1765|pts_time=1.765000|dts=1765|dts_time=1.765000|duration=46|duration_time=0.046000|size=77|pos=28279|flags=K__|data_hash=CRC32:181325ba +packet|codec_type=video|stream_index=0|pts=1768|pts_time=1.768000|dts=1768|dts_time=1.768000|duration=33|duration_time=0.033000|size=653|pos=28373|flags=___|data_hash=CRC32:53cc49de +packet|codec_type=video|stream_index=0|pts=1802|pts_time=1.802000|dts=1802|dts_time=1.802000|duration=33|duration_time=0.033000|size=228|pos=29046|flags=___|data_hash=CRC32:bb222de5 +packet|codec_type=audio|stream_index=1|pts=1811|pts_time=1.811000|dts=1811|dts_time=1.811000|duration=46|duration_time=0.046000|size=132|pos=29294|flags=K__|data_hash=CRC32:1bef55db +packet|codec_type=video|stream_index=0|pts=1835|pts_time=1.835000|dts=1835|dts_time=1.835000|duration=33|duration_time=0.033000|size=265|pos=29443|flags=___|data_hash=CRC32:d4f0d444 +packet|codec_type=audio|stream_index=1|pts=1858|pts_time=1.858000|dts=1858|dts_time=1.858000|duration=46|duration_time=0.046000|size=266|pos=29728|flags=K__|data_hash=CRC32:126ec6c3 +packet|codec_type=video|stream_index=0|pts=1869|pts_time=1.869000|dts=1869|dts_time=1.869000|duration=33|duration_time=0.033000|size=362|pos=30011|flags=___|data_hash=CRC32:a3399859 +packet|codec_type=video|stream_index=0|pts=1902|pts_time=1.902000|dts=1902|dts_time=1.902000|duration=33|duration_time=0.033000|size=362|pos=30393|flags=___|data_hash=CRC32:b4462dfc +packet|codec_type=audio|stream_index=1|pts=1904|pts_time=1.904000|dts=1904|dts_time=1.904000|duration=46|duration_time=0.046000|size=297|pos=30775|flags=K__|data_hash=CRC32:8a286293 +packet|codec_type=video|stream_index=0|pts=1935|pts_time=1.935000|dts=1935|dts_time=1.935000|duration=33|duration_time=0.033000|size=297|pos=31089|flags=___|data_hash=CRC32:ead314f3 +packet|codec_type=audio|stream_index=1|pts=1950|pts_time=1.950000|dts=1950|dts_time=1.950000|duration=46|duration_time=0.046000|size=9|pos=31406|flags=K__|data_hash=CRC32:3395d413 +packet|codec_type=video|stream_index=0|pts=1969|pts_time=1.969000|dts=1969|dts_time=1.969000|duration=33|duration_time=0.033000|size=395|pos=31432|flags=___|data_hash=CRC32:2d27c345 +packet|codec_type=audio|stream_index=1|pts=1997|pts_time=1.997000|dts=1997|dts_time=1.997000|duration=46|duration_time=0.046000|size=9|pos=31847|flags=K__|data_hash=CRC32:6b5dbb28 +packet|codec_type=video|stream_index=0|pts=2002|pts_time=2.002000|dts=2002|dts_time=2.002000|duration=33|duration_time=0.033000|size=149|pos=31873|flags=___|data_hash=CRC32:cbf3938c +packet|codec_type=video|stream_index=0|pts=2035|pts_time=2.035000|dts=2035|dts_time=2.035000|duration=33|duration_time=0.033000|size=141|pos=32042|flags=___|data_hash=CRC32:8b92a9de +packet|codec_type=audio|stream_index=1|pts=2043|pts_time=2.043000|dts=2043|dts_time=2.043000|duration=46|duration_time=0.046000|size=9|pos=32203|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2069|pts_time=2.069000|dts=2069|dts_time=2.069000|duration=33|duration_time=0.033000|size=317|pos=32229|flags=___|data_hash=CRC32:5362eed3 +packet|codec_type=audio|stream_index=1|pts=2090|pts_time=2.090000|dts=2090|dts_time=2.090000|duration=46|duration_time=0.046000|size=9|pos=32566|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2102|pts_time=2.102000|dts=2102|dts_time=2.102000|duration=33|duration_time=0.033000|size=170|pos=32592|flags=___|data_hash=CRC32:867c837a +packet|codec_type=video|stream_index=0|pts=2135|pts_time=2.135000|dts=2135|dts_time=2.135000|duration=33|duration_time=0.033000|size=443|pos=32782|flags=___|data_hash=CRC32:5bc93901 +packet|codec_type=audio|stream_index=1|pts=2136|pts_time=2.136000|dts=2136|dts_time=2.136000|duration=46|duration_time=0.046000|size=9|pos=33245|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2169|pts_time=2.169000|dts=2169|dts_time=2.169000|duration=33|duration_time=0.033000|size=224|pos=33271|flags=___|data_hash=CRC32:8eddf111 +packet|codec_type=audio|stream_index=1|pts=2183|pts_time=2.183000|dts=2183|dts_time=2.183000|duration=46|duration_time=0.046000|size=9|pos=33515|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2202|pts_time=2.202000|dts=2202|dts_time=2.202000|duration=33|duration_time=0.033000|size=472|pos=33541|flags=___|data_hash=CRC32:abe7ea6c +packet|codec_type=audio|stream_index=1|pts=2229|pts_time=2.229000|dts=2229|dts_time=2.229000|duration=46|duration_time=0.046000|size=9|pos=34033|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2236|pts_time=2.236000|dts=2236|dts_time=2.236000|duration=33|duration_time=0.033000|size=188|pos=34059|flags=___|data_hash=CRC32:73b69b1a +packet|codec_type=video|stream_index=0|pts=2269|pts_time=2.269000|dts=2269|dts_time=2.269000|duration=33|duration_time=0.033000|size=302|pos=34267|flags=___|data_hash=CRC32:81ba5025 +packet|codec_type=audio|stream_index=1|pts=2276|pts_time=2.276000|dts=2276|dts_time=2.276000|duration=46|duration_time=0.046000|size=9|pos=34589|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2302|pts_time=2.302000|dts=2302|dts_time=2.302000|duration=33|duration_time=0.033000|size=125|pos=34615|flags=___|data_hash=CRC32:16e31418 +packet|codec_type=audio|stream_index=1|pts=2322|pts_time=2.322000|dts=2322|dts_time=2.322000|duration=46|duration_time=0.046000|size=9|pos=34760|flags=K__|data_hash=CRC32:bbb61b93 +packet|codec_type=video|stream_index=0|pts=2336|pts_time=2.336000|dts=2336|dts_time=2.336000|duration=33|duration_time=0.033000|size=810|pos=34786|flags=___|data_hash=CRC32:409d7bc5 +packet|codec_type=audio|stream_index=1|pts=2368|pts_time=2.368000|dts=2368|dts_time=2.368000|duration=46|duration_time=0.046000|size=304|pos=35616|flags=K__|data_hash=CRC32:d7355e6f +packet|codec_type=video|stream_index=0|pts=2369|pts_time=2.369000|dts=2369|dts_time=2.369000|duration=33|duration_time=0.033000|size=158|pos=35937|flags=___|data_hash=CRC32:bb167cd2 +packet|codec_type=video|stream_index=0|pts=2402|pts_time=2.402000|dts=2402|dts_time=2.402000|duration=33|duration_time=0.033000|size=561|pos=36115|flags=___|data_hash=CRC32:582133cb +packet|codec_type=audio|stream_index=1|pts=2415|pts_time=2.415000|dts=2415|dts_time=2.415000|duration=46|duration_time=0.046000|size=683|pos=36696|flags=K__|data_hash=CRC32:0e95a3a0 +packet|codec_type=video|stream_index=0|pts=2436|pts_time=2.436000|dts=2436|dts_time=2.436000|duration=33|duration_time=0.033000|size=383|pos=37396|flags=___|data_hash=CRC32:a2c19b0b +packet|codec_type=audio|stream_index=1|pts=2461|pts_time=2.461000|dts=2461|dts_time=2.461000|duration=46|duration_time=0.046000|size=681|pos=37799|flags=K__|data_hash=CRC32:326a32e5 +packet|codec_type=video|stream_index=0|pts=2469|pts_time=2.469000|dts=2469|dts_time=2.469000|duration=33|duration_time=0.033000|size=218|pos=38497|flags=___|data_hash=CRC32:bda38cdd +packet|codec_type=video|stream_index=0|pts=2503|pts_time=2.503000|dts=2503|dts_time=2.503000|duration=33|duration_time=0.033000|size=270|pos=38735|flags=___|data_hash=CRC32:18a59365 +packet|codec_type=audio|stream_index=1|pts=2508|pts_time=2.508000|dts=2508|dts_time=2.508000|duration=46|duration_time=0.046000|size=663|pos=39025|flags=K__|data_hash=CRC32:04b4fe14 +packet|codec_type=video|stream_index=0|pts=2536|pts_time=2.536000|dts=2536|dts_time=2.536000|duration=33|duration_time=0.033000|size=182|pos=39705|flags=___|data_hash=CRC32:3f9da83b +packet|codec_type=audio|stream_index=1|pts=2554|pts_time=2.554000|dts=2554|dts_time=2.554000|duration=46|duration_time=0.046000|size=671|pos=39907|flags=K__|data_hash=CRC32:b8c62ab4 +packet|codec_type=video|stream_index=0|pts=2569|pts_time=2.569000|dts=2569|dts_time=2.569000|duration=33|duration_time=0.033000|size=1063|pos=40595|flags=K__|data_hash=CRC32:89a9f14f +packet|codec_type=audio|stream_index=1|pts=2601|pts_time=2.601000|dts=2601|dts_time=2.601000|duration=46|duration_time=0.046000|size=682|pos=41678|flags=K__|data_hash=CRC32:e95e8d23 +packet|codec_type=video|stream_index=0|pts=2603|pts_time=2.603000|dts=2603|dts_time=2.603000|duration=33|duration_time=0.033000|size=3687|pos=42377|flags=___|data_hash=CRC32:e9d6144b +packet|codec_type=video|stream_index=0|pts=2636|pts_time=2.636000|dts=2636|dts_time=2.636000|duration=33|duration_time=0.033000|size=280|pos=46084|flags=___|data_hash=CRC32:520c7765 +packet|codec_type=audio|stream_index=1|pts=2647|pts_time=2.647000|dts=2647|dts_time=2.647000|duration=46|duration_time=0.046000|size=698|pos=46384|flags=K__|data_hash=CRC32:0631a240 +packet|codec_type=video|stream_index=0|pts=2669|pts_time=2.669000|dts=2669|dts_time=2.669000|duration=33|duration_time=0.033000|size=475|pos=47099|flags=___|data_hash=CRC32:e1a7746b +packet|codec_type=audio|stream_index=1|pts=2694|pts_time=2.694000|dts=2694|dts_time=2.694000|duration=46|duration_time=0.046000|size=697|pos=47594|flags=K__|data_hash=CRC32:0e9feb04 +packet|codec_type=video|stream_index=0|pts=2703|pts_time=2.703000|dts=2703|dts_time=2.703000|duration=33|duration_time=0.033000|size=488|pos=48308|flags=___|data_hash=CRC32:ba916d5f +packet|codec_type=video|stream_index=0|pts=2736|pts_time=2.736000|dts=2736|dts_time=2.736000|duration=33|duration_time=0.033000|size=532|pos=48816|flags=___|data_hash=CRC32:bb384278 +packet|codec_type=audio|stream_index=1|pts=2740|pts_time=2.740000|dts=2740|dts_time=2.740000|duration=46|duration_time=0.046000|size=674|pos=49368|flags=K__|data_hash=CRC32:9859c9fe +packet|codec_type=video|stream_index=0|pts=2769|pts_time=2.769000|dts=2769|dts_time=2.769000|duration=33|duration_time=0.033000|size=590|pos=50059|flags=___|data_hash=CRC32:55a84515 +packet|codec_type=audio|stream_index=1|pts=2786|pts_time=2.786000|dts=2786|dts_time=2.786000|duration=46|duration_time=0.046000|size=651|pos=50669|flags=K__|data_hash=CRC32:642d943c +packet|codec_type=video|stream_index=0|pts=2803|pts_time=2.803000|dts=2803|dts_time=2.803000|duration=33|duration_time=0.033000|size=683|pos=51337|flags=___|data_hash=CRC32:ed48440d +packet|codec_type=audio|stream_index=1|pts=2833|pts_time=2.833000|dts=2833|dts_time=2.833000|duration=46|duration_time=0.046000|size=672|pos=52040|flags=K__|data_hash=CRC32:f2af0db0 +packet|codec_type=video|stream_index=0|pts=2836|pts_time=2.836000|dts=2836|dts_time=2.836000|duration=33|duration_time=0.033000|size=836|pos=52729|flags=___|data_hash=CRC32:d99a6f79 +packet|codec_type=video|stream_index=0|pts=2870|pts_time=2.870000|dts=2870|dts_time=2.870000|duration=33|duration_time=0.033000|size=676|pos=53585|flags=___|data_hash=CRC32:ed426283 +packet|codec_type=audio|stream_index=1|pts=2879|pts_time=2.879000|dts=2879|dts_time=2.879000|duration=46|duration_time=0.046000|size=665|pos=54281|flags=K__|data_hash=CRC32:d6e66995 +packet|codec_type=video|stream_index=0|pts=2903|pts_time=2.903000|dts=2903|dts_time=2.903000|duration=33|duration_time=0.033000|size=731|pos=54963|flags=___|data_hash=CRC32:9df509dc +packet|codec_type=audio|stream_index=1|pts=2926|pts_time=2.926000|dts=2926|dts_time=2.926000|duration=46|duration_time=0.046000|size=734|pos=55714|flags=K__|data_hash=CRC32:2e13e9fe +packet|codec_type=video|stream_index=0|pts=2936|pts_time=2.936000|dts=2936|dts_time=2.936000|duration=33|duration_time=0.033000|size=839|pos=56465|flags=___|data_hash=CRC32:dc12a67f +packet|codec_type=video|stream_index=0|pts=2970|pts_time=2.970000|dts=2970|dts_time=2.970000|duration=33|duration_time=0.033000|size=787|pos=57324|flags=___|data_hash=CRC32:db72a014 +packet|codec_type=audio|stream_index=1|pts=2972|pts_time=2.972000|dts=2972|dts_time=2.972000|duration=46|duration_time=0.046000|size=732|pos=58131|flags=K__|data_hash=CRC32:9cfb9b77 +packet|codec_type=video|stream_index=0|pts=3003|pts_time=3.003000|dts=3003|dts_time=3.003000|duration=33|duration_time=0.033000|size=1039|pos=58880|flags=___|data_hash=CRC32:bf96f792 +packet|codec_type=audio|stream_index=1|pts=3019|pts_time=3.019000|dts=3019|dts_time=3.019000|duration=46|duration_time=0.046000|size=742|pos=59939|flags=K__|data_hash=CRC32:51cb6568 +packet|codec_type=video|stream_index=0|pts=3036|pts_time=3.036000|dts=3036|dts_time=3.036000|duration=33|duration_time=0.033000|size=851|pos=60698|flags=___|data_hash=CRC32:45237f01 +packet|codec_type=audio|stream_index=1|pts=3065|pts_time=3.065000|dts=3065|dts_time=3.065000|duration=46|duration_time=0.046000|size=748|pos=61569|flags=K__|data_hash=CRC32:5c676c58 +packet|codec_type=video|stream_index=0|pts=3070|pts_time=3.070000|dts=3070|dts_time=3.070000|duration=33|duration_time=0.033000|size=928|pos=62334|flags=___|data_hash=CRC32:cef81f2c +packet|codec_type=video|stream_index=0|pts=3103|pts_time=3.103000|dts=3103|dts_time=3.103000|duration=33|duration_time=0.033000|size=840|pos=63282|flags=___|data_hash=CRC32:7ae6a4a0 +packet|codec_type=audio|stream_index=1|pts=3111|pts_time=3.111000|dts=3111|dts_time=3.111000|duration=46|duration_time=0.046000|size=671|pos=64142|flags=K__|data_hash=CRC32:c4c27684 +packet|codec_type=video|stream_index=0|pts=3136|pts_time=3.136000|dts=3136|dts_time=3.136000|duration=33|duration_time=0.033000|size=889|pos=64830|flags=___|data_hash=CRC32:70b13ba7 +packet|codec_type=audio|stream_index=1|pts=3158|pts_time=3.158000|dts=3158|dts_time=3.158000|duration=46|duration_time=0.046000|size=645|pos=65739|flags=K__|data_hash=CRC32:1b7b9a99 +packet|codec_type=video|stream_index=0|pts=3170|pts_time=3.170000|dts=3170|dts_time=3.170000|duration=33|duration_time=0.033000|size=789|pos=66401|flags=___|data_hash=CRC32:6ffae70e +packet|codec_type=video|stream_index=0|pts=3203|pts_time=3.203000|dts=3203|dts_time=3.203000|duration=33|duration_time=0.033000|size=1037|pos=67210|flags=___|data_hash=CRC32:acb72f8a +packet|codec_type=audio|stream_index=1|pts=3204|pts_time=3.204000|dts=3204|dts_time=3.204000|duration=46|duration_time=0.046000|size=724|pos=68267|flags=K__|data_hash=CRC32:feb7c4f3 +packet|codec_type=video|stream_index=0|pts=3237|pts_time=3.237000|dts=3237|dts_time=3.237000|duration=33|duration_time=0.033000|size=1201|pos=69008|flags=___|data_hash=CRC32:0ac77ab1 +packet|codec_type=audio|stream_index=1|pts=3251|pts_time=3.251000|dts=3251|dts_time=3.251000|duration=46|duration_time=0.046000|size=757|pos=70229|flags=K__|data_hash=CRC32:28d27dd5 +packet|codec_type=video|stream_index=0|pts=3270|pts_time=3.270000|dts=3270|dts_time=3.270000|duration=33|duration_time=0.033000|size=934|pos=71003|flags=___|data_hash=CRC32:dd16f432 +packet|codec_type=audio|stream_index=1|pts=3297|pts_time=3.297000|dts=3297|dts_time=3.297000|duration=46|duration_time=0.046000|size=710|pos=71957|flags=K__|data_hash=CRC32:fb16456d +packet|codec_type=video|stream_index=0|pts=3303|pts_time=3.303000|dts=3303|dts_time=3.303000|duration=33|duration_time=0.033000|size=1028|pos=72684|flags=___|data_hash=CRC32:d4cf8920 +packet|codec_type=video|stream_index=0|pts=3337|pts_time=3.337000|dts=3337|dts_time=3.337000|duration=33|duration_time=0.033000|size=1007|pos=73732|flags=___|data_hash=CRC32:4dfc2133 +packet|codec_type=audio|stream_index=1|pts=3344|pts_time=3.344000|dts=3344|dts_time=3.344000|duration=46|duration_time=0.046000|size=705|pos=74759|flags=K__|data_hash=CRC32:249bd165 +packet|codec_type=video|stream_index=0|pts=3370|pts_time=3.370000|dts=3370|dts_time=3.370000|duration=33|duration_time=0.033000|size=944|pos=75481|flags=___|data_hash=CRC32:cf0ee6e5 +packet|codec_type=audio|stream_index=1|pts=3390|pts_time=3.390000|dts=3390|dts_time=3.390000|duration=46|duration_time=0.046000|size=693|pos=76445|flags=K__|data_hash=CRC32:907c82d7 +packet|codec_type=video|stream_index=0|pts=3403|pts_time=3.403000|dts=3403|dts_time=3.403000|duration=33|duration_time=0.033000|size=1121|pos=77155|flags=___|data_hash=CRC32:f4a2ef4d +packet|codec_type=audio|stream_index=1|pts=3437|pts_time=3.437000|dts=3437|dts_time=3.437000|duration=46|duration_time=0.046000|size=683|pos=78296|flags=K__|data_hash=CRC32:25f0e52b +packet|codec_type=video|stream_index=0|pts=3437|pts_time=3.437000|dts=3437|dts_time=3.437000|duration=33|duration_time=0.033000|size=1321|pos=78996|flags=___|data_hash=CRC32:890f59cd +packet|codec_type=video|stream_index=0|pts=3470|pts_time=3.470000|dts=3470|dts_time=3.470000|duration=33|duration_time=0.033000|size=1229|pos=80337|flags=___|data_hash=CRC32:7c53b1c5 +packet|codec_type=audio|stream_index=1|pts=3483|pts_time=3.483000|dts=3483|dts_time=3.483000|duration=46|duration_time=0.046000|size=668|pos=81586|flags=K__|data_hash=CRC32:c848f398 +packet|codec_type=video|stream_index=0|pts=3504|pts_time=3.504000|dts=3504|dts_time=3.504000|duration=33|duration_time=0.033000|size=1166|pos=82271|flags=___|data_hash=CRC32:237539fc +packet|codec_type=audio|stream_index=1|pts=3529|pts_time=3.529000|dts=3529|dts_time=3.529000|duration=46|duration_time=0.046000|size=624|pos=83457|flags=K__|data_hash=CRC32:5d81d294 +packet|codec_type=video|stream_index=0|pts=3537|pts_time=3.537000|dts=3537|dts_time=3.537000|duration=33|duration_time=0.033000|size=1055|pos=84098|flags=___|data_hash=CRC32:2d22b0e9 +packet|codec_type=video|stream_index=0|pts=3570|pts_time=3.570000|dts=3570|dts_time=3.570000|duration=33|duration_time=0.033000|size=947|pos=85173|flags=___|data_hash=CRC32:1003bc18 +packet|codec_type=audio|stream_index=1|pts=3576|pts_time=3.576000|dts=3576|dts_time=3.576000|duration=46|duration_time=0.046000|size=570|pos=86140|flags=K__|data_hash=CRC32:41da9b98 +packet|codec_type=video|stream_index=0|pts=3604|pts_time=3.604000|dts=3604|dts_time=3.604000|duration=33|duration_time=0.033000|size=1117|pos=86727|flags=___|data_hash=CRC32:ea91a8bf +packet|codec_type=audio|stream_index=1|pts=3622|pts_time=3.622000|dts=3622|dts_time=3.622000|duration=46|duration_time=0.046000|size=579|pos=87864|flags=K__|data_hash=CRC32:b1e12639 +packet|codec_type=video|stream_index=0|pts=3637|pts_time=3.637000|dts=3637|dts_time=3.637000|duration=33|duration_time=0.033000|size=1397|pos=88460|flags=___|data_hash=CRC32:f2bdfea7 +packet|codec_type=audio|stream_index=1|pts=3669|pts_time=3.669000|dts=3669|dts_time=3.669000|duration=46|duration_time=0.046000|size=558|pos=89877|flags=K__|data_hash=CRC32:095b218c +packet|codec_type=video|stream_index=0|pts=3670|pts_time=3.670000|dts=3670|dts_time=3.670000|duration=33|duration_time=0.033000|size=1097|pos=90452|flags=___|data_hash=CRC32:be8cf516 +packet|codec_type=video|stream_index=0|pts=3704|pts_time=3.704000|dts=3704|dts_time=3.704000|duration=33|duration_time=0.033000|size=1207|pos=91569|flags=___|data_hash=CRC32:176a8fe9 +packet|codec_type=audio|stream_index=1|pts=3715|pts_time=3.715000|dts=3715|dts_time=3.715000|duration=46|duration_time=0.046000|size=510|pos=92796|flags=K__|data_hash=CRC32:8cea9dca +packet|codec_type=video|stream_index=0|pts=3737|pts_time=3.737000|dts=3737|dts_time=3.737000|duration=33|duration_time=0.033000|size=1109|pos=93323|flags=___|data_hash=CRC32:615bab01 +packet|codec_type=audio|stream_index=1|pts=3762|pts_time=3.762000|dts=3762|dts_time=3.762000|duration=46|duration_time=0.046000|size=518|pos=94452|flags=K__|data_hash=CRC32:600293cc +packet|codec_type=video|stream_index=0|pts=3770|pts_time=3.770000|dts=3770|dts_time=3.770000|duration=33|duration_time=0.033000|size=994|pos=94987|flags=___|data_hash=CRC32:db090b40 +packet|codec_type=video|stream_index=0|pts=3804|pts_time=3.804000|dts=3804|dts_time=3.804000|duration=33|duration_time=0.033000|size=1144|pos=96001|flags=___|data_hash=CRC32:4966c524 +packet|codec_type=audio|stream_index=1|pts=3808|pts_time=3.808000|dts=3808|dts_time=3.808000|duration=46|duration_time=0.046000|size=481|pos=97165|flags=K__|data_hash=CRC32:e53ca4a3 +packet|codec_type=video|stream_index=0|pts=3837|pts_time=3.837000|dts=3837|dts_time=3.837000|duration=33|duration_time=0.033000|size=1409|pos=97663|flags=___|data_hash=CRC32:5561cdad +packet|codec_type=audio|stream_index=1|pts=3855|pts_time=3.855000|dts=3855|dts_time=3.855000|duration=46|duration_time=0.046000|size=443|pos=99092|flags=K__|data_hash=CRC32:14937ac1 +packet|codec_type=video|stream_index=0|pts=3871|pts_time=3.871000|dts=3871|dts_time=3.871000|duration=33|duration_time=0.033000|size=1205|pos=99552|flags=___|data_hash=CRC32:93f9dbe0 +packet|codec_type=audio|stream_index=1|pts=3901|pts_time=3.901000|dts=3901|dts_time=3.901000|duration=46|duration_time=0.046000|size=413|pos=100777|flags=K__|data_hash=CRC32:4fea79a1 +packet|codec_type=video|stream_index=0|pts=3904|pts_time=3.904000|dts=3904|dts_time=3.904000|duration=33|duration_time=0.033000|size=1159|pos=101207|flags=___|data_hash=CRC32:8a7dd1ca +packet|codec_type=video|stream_index=0|pts=3937|pts_time=3.937000|dts=3937|dts_time=3.937000|duration=33|duration_time=0.033000|size=1207|pos=102386|flags=___|data_hash=CRC32:9c351265 +packet|codec_type=audio|stream_index=1|pts=3947|pts_time=3.947000|dts=3947|dts_time=3.947000|duration=46|duration_time=0.046000|size=398|pos=103613|flags=K__|data_hash=CRC32:0777a82b +packet|codec_type=video|stream_index=0|pts=3971|pts_time=3.971000|dts=3971|dts_time=3.971000|duration=33|duration_time=0.033000|size=1084|pos=104028|flags=___|data_hash=CRC32:3b4222c7 +packet|codec_type=audio|stream_index=1|pts=3994|pts_time=3.994000|dts=3994|dts_time=3.994000|duration=46|duration_time=0.046000|size=377|pos=105132|flags=K__|data_hash=CRC32:8662b58a +packet|codec_type=video|stream_index=0|pts=4004|pts_time=4.004000|dts=4004|dts_time=4.004000|duration=33|duration_time=0.033000|size=1539|pos=105526|flags=___|data_hash=CRC32:cf253620 +packet|codec_type=video|stream_index=0|pts=4037|pts_time=4.037000|dts=4037|dts_time=4.037000|duration=33|duration_time=0.033000|size=1409|pos=107085|flags=___|data_hash=CRC32:01f30787 +packet|codec_type=audio|stream_index=1|pts=4040|pts_time=4.040000|dts=4040|dts_time=4.040000|duration=46|duration_time=0.046000|size=364|pos=108514|flags=K__|data_hash=CRC32:f73e6c88 +packet|codec_type=video|stream_index=0|pts=4071|pts_time=4.071000|dts=4071|dts_time=4.071000|duration=33|duration_time=0.033000|size=1275|pos=108895|flags=___|data_hash=CRC32:d7c1cfe1 +packet|codec_type=audio|stream_index=1|pts=4087|pts_time=4.087000|dts=4087|dts_time=4.087000|duration=46|duration_time=0.046000|size=374|pos=110190|flags=K__|data_hash=CRC32:c41f57c7 +packet|codec_type=video|stream_index=0|pts=4104|pts_time=4.104000|dts=4104|dts_time=4.104000|duration=33|duration_time=0.033000|size=1317|pos=110581|flags=___|data_hash=CRC32:685138ef +packet|codec_type=audio|stream_index=1|pts=4133|pts_time=4.133000|dts=4133|dts_time=4.133000|duration=46|duration_time=0.046000|size=355|pos=111918|flags=K__|data_hash=CRC32:7a5e82a8 +packet|codec_type=video|stream_index=0|pts=4137|pts_time=4.137000|dts=4137|dts_time=4.137000|duration=33|duration_time=0.033000|size=1146|pos=112290|flags=___|data_hash=CRC32:48ce008d +packet|codec_type=video|stream_index=0|pts=4171|pts_time=4.171000|dts=4171|dts_time=4.171000|duration=33|duration_time=0.033000|size=1166|pos=113456|flags=___|data_hash=CRC32:f12da76b +packet|codec_type=audio|stream_index=1|pts=4180|pts_time=4.180000|dts=4180|dts_time=4.180000|duration=46|duration_time=0.046000|size=341|pos=114642|flags=K__|data_hash=CRC32:ea126e98 +packet|codec_type=video|stream_index=0|pts=4204|pts_time=4.204000|dts=4204|dts_time=4.204000|duration=33|duration_time=0.033000|size=1272|pos=115000|flags=___|data_hash=CRC32:31e617c7 +packet|codec_type=audio|stream_index=1|pts=4226|pts_time=4.226000|dts=4226|dts_time=4.226000|duration=46|duration_time=0.046000|size=364|pos=116292|flags=K__|data_hash=CRC32:6d84c4a8 +packet|codec_type=video|stream_index=0|pts=4238|pts_time=4.238000|dts=4238|dts_time=4.238000|duration=33|duration_time=0.033000|size=1550|pos=116673|flags=___|data_hash=CRC32:50d17465 +packet|codec_type=video|stream_index=0|pts=4271|pts_time=4.271000|dts=4271|dts_time=4.271000|duration=33|duration_time=0.033000|size=1353|pos=118243|flags=___|data_hash=CRC32:af8d072c +packet|codec_type=audio|stream_index=1|pts=4272|pts_time=4.272000|dts=4272|dts_time=4.272000|duration=46|duration_time=0.046000|size=350|pos=119616|flags=K__|data_hash=CRC32:c27e7ecc +packet|codec_type=video|stream_index=0|pts=4304|pts_time=4.304000|dts=4304|dts_time=4.304000|duration=33|duration_time=0.033000|size=1251|pos=119983|flags=___|data_hash=CRC32:271dcd86 +packet|codec_type=audio|stream_index=1|pts=4319|pts_time=4.319000|dts=4319|dts_time=4.319000|duration=46|duration_time=0.046000|size=356|pos=121254|flags=K__|data_hash=CRC32:6d111a73 +packet|codec_type=video|stream_index=0|pts=4338|pts_time=4.338000|dts=4338|dts_time=4.338000|duration=33|duration_time=0.033000|size=1339|pos=121627|flags=___|data_hash=CRC32:01aa658e +packet|codec_type=audio|stream_index=1|pts=4365|pts_time=4.365000|dts=4365|dts_time=4.365000|duration=46|duration_time=0.046000|size=365|pos=122986|flags=K__|data_hash=CRC32:e24aa34c +packet|codec_type=video|stream_index=0|pts=4371|pts_time=4.371000|dts=4371|dts_time=4.371000|duration=33|duration_time=0.033000|size=1216|pos=123368|flags=___|data_hash=CRC32:bee7821f +packet|codec_type=video|stream_index=0|pts=4404|pts_time=4.404000|dts=4404|dts_time=4.404000|duration=33|duration_time=0.033000|size=1222|pos=124604|flags=___|data_hash=CRC32:2bd2754e +packet|codec_type=audio|stream_index=1|pts=4412|pts_time=4.412000|dts=4412|dts_time=4.412000|duration=46|duration_time=0.046000|size=352|pos=125846|flags=K__|data_hash=CRC32:fc970370 +packet|codec_type=video|stream_index=0|pts=4438|pts_time=4.438000|dts=4438|dts_time=4.438000|duration=33|duration_time=0.033000|size=1665|pos=126215|flags=___|data_hash=CRC32:a08b2e57 +packet|codec_type=audio|stream_index=1|pts=4458|pts_time=4.458000|dts=4458|dts_time=4.458000|duration=46|duration_time=0.046000|size=374|pos=127900|flags=K__|data_hash=CRC32:fa07f96b +packet|codec_type=video|stream_index=0|pts=4471|pts_time=4.471000|dts=4471|dts_time=4.471000|duration=33|duration_time=0.033000|size=1372|pos=128291|flags=___|data_hash=CRC32:7ba310fc +packet|codec_type=audio|stream_index=1|pts=4505|pts_time=4.505000|dts=4505|dts_time=4.505000|duration=46|duration_time=0.046000|size=375|pos=129683|flags=K__|data_hash=CRC32:912ec2a1 +packet|codec_type=video|stream_index=0|pts=4505|pts_time=4.505000|dts=4505|dts_time=4.505000|duration=33|duration_time=0.033000|size=1611|pos=130075|flags=___|data_hash=CRC32:894697a0 +packet|codec_type=video|stream_index=0|pts=4538|pts_time=4.538000|dts=4538|dts_time=4.538000|duration=33|duration_time=0.033000|size=7010|pos=131706|flags=K__|data_hash=CRC32:e74f1b93 +packet|codec_type=audio|stream_index=1|pts=4551|pts_time=4.551000|dts=4551|dts_time=4.551000|duration=46|duration_time=0.046000|size=375|pos=138736|flags=K__|data_hash=CRC32:9049bbe0 +packet|codec_type=video|stream_index=0|pts=4571|pts_time=4.571000|dts=4571|dts_time=4.571000|duration=33|duration_time=0.033000|size=549|pos=139128|flags=___|data_hash=CRC32:bea67fa5 +packet|codec_type=audio|stream_index=1|pts=4598|pts_time=4.598000|dts=4598|dts_time=4.598000|duration=46|duration_time=0.046000|size=376|pos=139697|flags=K__|data_hash=CRC32:cf9362b3 +packet|codec_type=video|stream_index=0|pts=4605|pts_time=4.605000|dts=4605|dts_time=4.605000|duration=33|duration_time=0.033000|size=1021|pos=140090|flags=___|data_hash=CRC32:93ace02c +packet|codec_type=video|stream_index=0|pts=4638|pts_time=4.638000|dts=4638|dts_time=4.638000|duration=33|duration_time=0.033000|size=1281|pos=141131|flags=___|data_hash=CRC32:24070179 +packet|codec_type=audio|stream_index=1|pts=4644|pts_time=4.644000|dts=4644|dts_time=4.644000|duration=46|duration_time=0.046000|size=372|pos=142432|flags=K__|data_hash=CRC32:f7372f4c +packet|codec_type=video|stream_index=0|pts=4671|pts_time=4.671000|dts=4671|dts_time=4.671000|duration=33|duration_time=0.033000|size=1267|pos=142821|flags=___|data_hash=CRC32:7cfd6aa6 +packet|codec_type=audio|stream_index=1|pts=4690|pts_time=4.690000|dts=4690|dts_time=4.690000|duration=46|duration_time=0.046000|size=371|pos=144108|flags=K__|data_hash=CRC32:b244704d +packet|codec_type=video|stream_index=0|pts=4705|pts_time=4.705000|dts=4705|dts_time=4.705000|duration=33|duration_time=0.033000|size=1140|pos=144496|flags=___|data_hash=CRC32:eccfa0f7 +packet|codec_type=audio|stream_index=1|pts=4737|pts_time=4.737000|dts=4737|dts_time=4.737000|duration=46|duration_time=0.046000|size=365|pos=145656|flags=K__|data_hash=CRC32:834bb209 +packet|codec_type=video|stream_index=0|pts=4738|pts_time=4.738000|dts=4738|dts_time=4.738000|duration=33|duration_time=0.033000|size=1289|pos=146038|flags=___|data_hash=CRC32:4669d638 +packet|codec_type=video|stream_index=0|pts=4771|pts_time=4.771000|dts=4771|dts_time=4.771000|duration=33|duration_time=0.033000|size=1127|pos=147347|flags=___|data_hash=CRC32:e52c7abd +packet|codec_type=audio|stream_index=1|pts=4783|pts_time=4.783000|dts=4783|dts_time=4.783000|duration=46|duration_time=0.046000|size=385|pos=148494|flags=K__|data_hash=CRC32:e61dc477 +packet|codec_type=video|stream_index=0|pts=4805|pts_time=4.805000|dts=4805|dts_time=4.805000|duration=33|duration_time=0.033000|size=1196|pos=148896|flags=___|data_hash=CRC32:5a318942 +packet|codec_type=audio|stream_index=1|pts=4830|pts_time=4.830000|dts=4830|dts_time=4.830000|duration=46|duration_time=0.046000|size=362|pos=150112|flags=K__|data_hash=CRC32:8fee051a +packet|codec_type=video|stream_index=0|pts=4838|pts_time=4.838000|dts=4838|dts_time=4.838000|duration=33|duration_time=0.033000|size=1520|pos=150491|flags=___|data_hash=CRC32:2418eb0f +packet|codec_type=video|stream_index=0|pts=4872|pts_time=4.872000|dts=4872|dts_time=4.872000|duration=33|duration_time=0.033000|size=1370|pos=152031|flags=___|data_hash=CRC32:79ca0732 +packet|codec_type=audio|stream_index=1|pts=4876|pts_time=4.876000|dts=4876|dts_time=4.876000|duration=46|duration_time=0.046000|size=370|pos=153421|flags=K__|data_hash=CRC32:1720582c +packet|codec_type=video|stream_index=0|pts=4905|pts_time=4.905000|dts=4905|dts_time=4.905000|duration=33|duration_time=0.033000|size=1232|pos=153808|flags=___|data_hash=CRC32:32295018 +packet|codec_type=audio|stream_index=1|pts=4923|pts_time=4.923000|dts=4923|dts_time=4.923000|duration=46|duration_time=0.046000|size=369|pos=155060|flags=K__|data_hash=CRC32:6b668e5b +packet|codec_type=video|stream_index=0|pts=4938|pts_time=4.938000|dts=4938|dts_time=4.938000|duration=33|duration_time=0.033000|size=1159|pos=155446|flags=___|data_hash=CRC32:45fc12f2 +packet|codec_type=audio|stream_index=1|pts=4969|pts_time=4.969000|dts=4969|dts_time=4.969000|duration=46|duration_time=0.046000|size=341|pos=156625|flags=K__|data_hash=CRC32:4d4741d6 +packet|codec_type=video|stream_index=0|pts=4972|pts_time=4.972000|dts=4972|dts_time=4.972000|duration=33|duration_time=0.033000|size=1183|pos=156983|flags=___|data_hash=CRC32:10f40093 +packet|codec_type=video|stream_index=0|pts=5005|pts_time=5.005000|dts=5005|dts_time=5.005000|duration=33|duration_time=0.033000|size=1469|pos=158186|flags=___|data_hash=CRC32:43a4815e +packet|codec_type=audio|stream_index=1|pts=5016|pts_time=5.016000|dts=5016|dts_time=5.016000|duration=46|duration_time=0.046000|size=351|pos=159675|flags=K__|data_hash=CRC32:82bf6546 +packet|codec_type=video|stream_index=0|pts=5038|pts_time=5.038000|dts=5038|dts_time=5.038000|duration=33|duration_time=0.033000|size=1468|pos=160043|flags=___|data_hash=CRC32:e8c78f03 +packet|codec_type=audio|stream_index=1|pts=5062|pts_time=5.062000|dts=5062|dts_time=5.062000|duration=46|duration_time=0.046000|size=365|pos=161531|flags=K__|data_hash=CRC32:1299be30 +packet|codec_type=video|stream_index=0|pts=5072|pts_time=5.072000|dts=5072|dts_time=5.072000|duration=33|duration_time=0.033000|size=1355|pos=161913|flags=___|data_hash=CRC32:044621ed +packet|codec_type=video|stream_index=0|pts=5105|pts_time=5.105000|dts=5105|dts_time=5.105000|duration=33|duration_time=0.033000|size=1303|pos=163288|flags=___|data_hash=CRC32:3403397b +packet|codec_type=audio|stream_index=1|pts=5108|pts_time=5.108000|dts=5108|dts_time=5.108000|duration=46|duration_time=0.046000|size=358|pos=164611|flags=K__|data_hash=CRC32:ee1a432d +packet|codec_type=video|stream_index=0|pts=5138|pts_time=5.138000|dts=5138|dts_time=5.138000|duration=33|duration_time=0.033000|size=1316|pos=164986|flags=___|data_hash=CRC32:7021310e +packet|codec_type=audio|stream_index=1|pts=5155|pts_time=5.155000|dts=5155|dts_time=5.155000|duration=46|duration_time=0.046000|size=373|pos=166322|flags=K__|data_hash=CRC32:f25887f4 +packet|codec_type=video|stream_index=0|pts=5172|pts_time=5.172000|dts=5172|dts_time=5.172000|duration=33|duration_time=0.033000|size=1196|pos=166712|flags=___|data_hash=CRC32:d8492897 +packet|codec_type=audio|stream_index=1|pts=5201|pts_time=5.201000|dts=5201|dts_time=5.201000|duration=46|duration_time=0.046000|size=367|pos=167928|flags=K__|data_hash=CRC32:c30e6c9f +packet|codec_type=video|stream_index=0|pts=5205|pts_time=5.205000|dts=5205|dts_time=5.205000|duration=33|duration_time=0.033000|size=1283|pos=168312|flags=___|data_hash=CRC32:c9058bba +packet|codec_type=video|stream_index=0|pts=5239|pts_time=5.239000|dts=5239|dts_time=5.239000|duration=33|duration_time=0.033000|size=1489|pos=169615|flags=___|data_hash=CRC32:0e5dadc6 +packet|codec_type=audio|stream_index=1|pts=5248|pts_time=5.248000|dts=5248|dts_time=5.248000|duration=46|duration_time=0.046000|size=364|pos=171124|flags=K__|data_hash=CRC32:74db7811 +packet|codec_type=video|stream_index=0|pts=5272|pts_time=5.272000|dts=5272|dts_time=5.272000|duration=33|duration_time=0.033000|size=1507|pos=171505|flags=___|data_hash=CRC32:1e37a39f +packet|codec_type=audio|stream_index=1|pts=5294|pts_time=5.294000|dts=5294|dts_time=5.294000|duration=46|duration_time=0.046000|size=346|pos=173032|flags=K__|data_hash=CRC32:3386dd10 +packet|codec_type=video|stream_index=0|pts=5305|pts_time=5.305000|dts=5305|dts_time=5.305000|duration=33|duration_time=0.033000|size=1237|pos=173395|flags=___|data_hash=CRC32:d8f772ae +packet|codec_type=video|stream_index=0|pts=5339|pts_time=5.339000|dts=5339|dts_time=5.339000|duration=33|duration_time=0.033000|size=1217|pos=174652|flags=___|data_hash=CRC32:7caabc71 +packet|codec_type=audio|stream_index=1|pts=5341|pts_time=5.341000|dts=5341|dts_time=5.341000|duration=46|duration_time=0.046000|size=362|pos=175889|flags=K__|data_hash=CRC32:b4975396 +packet|codec_type=video|stream_index=0|pts=5372|pts_time=5.372000|dts=5372|dts_time=5.372000|duration=33|duration_time=0.033000|size=1224|pos=176268|flags=___|data_hash=CRC32:fbca6068 +packet|codec_type=audio|stream_index=1|pts=5387|pts_time=5.387000|dts=5387|dts_time=5.387000|duration=46|duration_time=0.046000|size=360|pos=177512|flags=K__|data_hash=CRC32:f639adaf +packet|codec_type=video|stream_index=0|pts=5405|pts_time=5.405000|dts=5405|dts_time=5.405000|duration=33|duration_time=0.033000|size=1554|pos=177889|flags=___|data_hash=CRC32:f9e211de +packet|codec_type=audio|stream_index=1|pts=5433|pts_time=5.433000|dts=5433|dts_time=5.433000|duration=46|duration_time=0.046000|size=356|pos=179463|flags=K__|data_hash=CRC32:ef458996 +packet|codec_type=video|stream_index=0|pts=5439|pts_time=5.439000|dts=5439|dts_time=5.439000|duration=33|duration_time=0.033000|size=1465|pos=179836|flags=___|data_hash=CRC32:cb5d725a +packet|codec_type=video|stream_index=0|pts=5472|pts_time=5.472000|dts=5472|dts_time=5.472000|duration=33|duration_time=0.033000|size=1862|pos=181321|flags=___|data_hash=CRC32:a9acf274 +packet|codec_type=audio|stream_index=1|pts=5480|pts_time=5.480000|dts=5480|dts_time=5.480000|duration=46|duration_time=0.046000|size=364|pos=183203|flags=K__|data_hash=CRC32:6d92ed19 +packet|codec_type=video|stream_index=0|pts=5506|pts_time=5.506000|dts=5506|dts_time=5.506000|duration=33|duration_time=0.033000|size=1604|pos=183584|flags=___|data_hash=CRC32:19bfeabc +packet|codec_type=audio|stream_index=1|pts=5526|pts_time=5.526000|dts=5526|dts_time=5.526000|duration=46|duration_time=0.046000|size=365|pos=185208|flags=K__|data_hash=CRC32:f257469d +packet|codec_type=video|stream_index=0|pts=5539|pts_time=5.539000|dts=5539|dts_time=5.539000|duration=33|duration_time=0.033000|size=1541|pos=185590|flags=___|data_hash=CRC32:642b27dd +packet|codec_type=video|stream_index=0|pts=5572|pts_time=5.572000|dts=5572|dts_time=5.572000|duration=33|duration_time=0.033000|size=1534|pos=187151|flags=___|data_hash=CRC32:67693383 +packet|codec_type=audio|stream_index=1|pts=5573|pts_time=5.573000|dts=5573|dts_time=5.573000|duration=46|duration_time=0.046000|size=357|pos=188705|flags=K__|data_hash=CRC32:52e0f7ac +packet|codec_type=video|stream_index=0|pts=5606|pts_time=5.606000|dts=5606|dts_time=5.606000|duration=33|duration_time=0.033000|size=1336|pos=189079|flags=___|data_hash=CRC32:904a4734 +packet|codec_type=audio|stream_index=1|pts=5619|pts_time=5.619000|dts=5619|dts_time=5.619000|duration=46|duration_time=0.046000|size=367|pos=190435|flags=K__|data_hash=CRC32:dae9d0bd +packet|codec_type=video|stream_index=0|pts=5639|pts_time=5.639000|dts=5639|dts_time=5.639000|duration=33|duration_time=0.033000|size=1761|pos=190819|flags=___|data_hash=CRC32:93496a5c +packet|codec_type=audio|stream_index=1|pts=5666|pts_time=5.666000|dts=5666|dts_time=5.666000|duration=46|duration_time=0.046000|size=361|pos=192600|flags=K__|data_hash=CRC32:86968dd2 +packet|codec_type=video|stream_index=0|pts=5672|pts_time=5.672000|dts=5672|dts_time=5.672000|duration=33|duration_time=0.033000|size=1722|pos=192978|flags=___|data_hash=CRC32:feec28c7 +packet|codec_type=video|stream_index=0|pts=5706|pts_time=5.706000|dts=5706|dts_time=5.706000|duration=33|duration_time=0.033000|size=1442|pos=194720|flags=___|data_hash=CRC32:620e5c0e +packet|codec_type=audio|stream_index=1|pts=5712|pts_time=5.712000|dts=5712|dts_time=5.712000|duration=46|duration_time=0.046000|size=367|pos=196182|flags=K__|data_hash=CRC32:17f30b04 +packet|codec_type=video|stream_index=0|pts=5739|pts_time=5.739000|dts=5739|dts_time=5.739000|duration=33|duration_time=0.033000|size=1313|pos=196566|flags=___|data_hash=CRC32:6bee8c20 +packet|codec_type=audio|stream_index=1|pts=5759|pts_time=5.759000|dts=5759|dts_time=5.759000|duration=46|duration_time=0.046000|size=375|pos=197899|flags=K__|data_hash=CRC32:4eda4c7c +packet|codec_type=video|stream_index=0|pts=5772|pts_time=5.772000|dts=5772|dts_time=5.772000|duration=33|duration_time=0.033000|size=1436|pos=198291|flags=___|data_hash=CRC32:fd8ac68a +packet|codec_type=audio|stream_index=1|pts=5805|pts_time=5.805000|dts=5805|dts_time=5.805000|duration=46|duration_time=0.046000|size=357|pos=199747|flags=K__|data_hash=CRC32:3551e83a +packet|codec_type=video|stream_index=0|pts=5806|pts_time=5.806000|dts=5806|dts_time=5.806000|duration=33|duration_time=0.033000|size=1689|pos=200121|flags=___|data_hash=CRC32:e09613d4 +packet|codec_type=video|stream_index=0|pts=5839|pts_time=5.839000|dts=5839|dts_time=5.839000|duration=33|duration_time=0.033000|size=1472|pos=201830|flags=___|data_hash=CRC32:9467baaf +packet|codec_type=audio|stream_index=1|pts=5851|pts_time=5.851000|dts=5851|dts_time=5.851000|duration=46|duration_time=0.046000|size=379|pos=203322|flags=K__|data_hash=CRC32:de123d0a +packet|codec_type=video|stream_index=0|pts=5873|pts_time=5.873000|dts=5873|dts_time=5.873000|duration=33|duration_time=0.033000|size=1730|pos=203718|flags=___|data_hash=CRC32:2b6400ba +packet|codec_type=audio|stream_index=1|pts=5898|pts_time=5.898000|dts=5898|dts_time=5.898000|duration=46|duration_time=0.046000|size=361|pos=205468|flags=K__|data_hash=CRC32:02a5f979 +packet|codec_type=video|stream_index=0|pts=5906|pts_time=5.906000|dts=5906|dts_time=5.906000|duration=33|duration_time=0.033000|size=1555|pos=205846|flags=___|data_hash=CRC32:31d5ba1a +packet|codec_type=video|stream_index=0|pts=5939|pts_time=5.939000|dts=5939|dts_time=5.939000|duration=33|duration_time=0.033000|size=1486|pos=207421|flags=___|data_hash=CRC32:8d0829d2 +packet|codec_type=audio|stream_index=1|pts=5944|pts_time=5.944000|dts=5944|dts_time=5.944000|duration=46|duration_time=0.046000|size=350|pos=208927|flags=K__|data_hash=CRC32:8759b7f4 +packet|codec_type=video|stream_index=0|pts=5973|pts_time=5.973000|dts=5973|dts_time=5.973000|duration=33|duration_time=0.033000|size=1311|pos=209294|flags=___|data_hash=CRC32:bc92ded4 +packet|codec_type=audio|stream_index=1|pts=5991|pts_time=5.991000|dts=5991|dts_time=5.991000|duration=46|duration_time=0.046000|size=339|pos=210625|flags=K__|data_hash=CRC32:1aeda6e0 +packet|codec_type=video|stream_index=0|pts=6006|pts_time=6.006000|dts=6006|dts_time=6.006000|duration=33|duration_time=0.033000|size=1700|pos=210981|flags=___|data_hash=CRC32:6352f8f3 +packet|codec_type=audio|stream_index=1|pts=6037|pts_time=6.037000|dts=6037|dts_time=6.037000|duration=46|duration_time=0.046000|size=336|pos=212701|flags=K__|data_hash=CRC32:2df5ef30 +packet|codec_type=video|stream_index=0|pts=6039|pts_time=6.039000|dts=6039|dts_time=6.039000|duration=33|duration_time=0.033000|size=1647|pos=213054|flags=___|data_hash=CRC32:931d3120 +packet|codec_type=video|stream_index=0|pts=6073|pts_time=6.073000|dts=6073|dts_time=6.073000|duration=33|duration_time=0.033000|size=1663|pos=214721|flags=___|data_hash=CRC32:3191d8b9 +packet|codec_type=audio|stream_index=1|pts=6084|pts_time=6.084000|dts=6084|dts_time=6.084000|duration=46|duration_time=0.046000|size=331|pos=216404|flags=K__|data_hash=CRC32:81610328 +packet|codec_type=video|stream_index=0|pts=6106|pts_time=6.106000|dts=6106|dts_time=6.106000|duration=33|duration_time=0.033000|size=1512|pos=216752|flags=___|data_hash=CRC32:975cd742 +packet|codec_type=audio|stream_index=1|pts=6130|pts_time=6.130000|dts=6130|dts_time=6.130000|duration=46|duration_time=0.046000|size=335|pos=218284|flags=K__|data_hash=CRC32:7a0eaa18 +packet|codec_type=video|stream_index=0|pts=6139|pts_time=6.139000|dts=6139|dts_time=6.139000|duration=33|duration_time=0.033000|size=1370|pos=218636|flags=___|data_hash=CRC32:66567f2e +packet|codec_type=video|stream_index=0|pts=6173|pts_time=6.173000|dts=6173|dts_time=6.173000|duration=33|duration_time=0.033000|size=1440|pos=220026|flags=___|data_hash=CRC32:4bfade47 +packet|codec_type=audio|stream_index=1|pts=6177|pts_time=6.177000|dts=6177|dts_time=6.177000|duration=46|duration_time=0.046000|size=323|pos=221486|flags=K__|data_hash=CRC32:3799307f +packet|codec_type=video|stream_index=0|pts=6206|pts_time=6.206000|dts=6206|dts_time=6.206000|duration=33|duration_time=0.033000|size=1574|pos=221826|flags=___|data_hash=CRC32:a489fa6f +packet|codec_type=audio|stream_index=1|pts=6223|pts_time=6.223000|dts=6223|dts_time=6.223000|duration=46|duration_time=0.046000|size=333|pos=223420|flags=K__|data_hash=CRC32:c8363968 +packet|codec_type=video|stream_index=0|pts=6240|pts_time=6.240000|dts=6240|dts_time=6.240000|duration=33|duration_time=0.033000|size=1328|pos=223770|flags=___|data_hash=CRC32:1fea5aac +packet|codec_type=audio|stream_index=1|pts=6269|pts_time=6.269000|dts=6269|dts_time=6.269000|duration=46|duration_time=0.046000|size=335|pos=225118|flags=K__|data_hash=CRC32:b9425c66 +packet|codec_type=video|stream_index=0|pts=6273|pts_time=6.273000|dts=6273|dts_time=6.273000|duration=33|duration_time=0.033000|size=1802|pos=225470|flags=___|data_hash=CRC32:dcf03b48 +packet|codec_type=video|stream_index=0|pts=6306|pts_time=6.306000|dts=6306|dts_time=6.306000|duration=33|duration_time=0.033000|size=1619|pos=227292|flags=___|data_hash=CRC32:fe0b0001 +packet|codec_type=audio|stream_index=1|pts=6316|pts_time=6.316000|dts=6316|dts_time=6.316000|duration=46|duration_time=0.046000|size=334|pos=228931|flags=K__|data_hash=CRC32:ec0fe921 +packet|codec_type=video|stream_index=0|pts=6340|pts_time=6.340000|dts=6340|dts_time=6.340000|duration=33|duration_time=0.033000|size=1471|pos=229282|flags=___|data_hash=CRC32:d30c0223 +packet|codec_type=audio|stream_index=1|pts=6362|pts_time=6.362000|dts=6362|dts_time=6.362000|duration=46|duration_time=0.046000|size=342|pos=230773|flags=K__|data_hash=CRC32:f18fb26f +packet|codec_type=video|stream_index=0|pts=6373|pts_time=6.373000|dts=6373|dts_time=6.373000|duration=33|duration_time=0.033000|size=1226|pos=231132|flags=___|data_hash=CRC32:7336c586 +packet|codec_type=video|stream_index=0|pts=6406|pts_time=6.406000|dts=6406|dts_time=6.406000|duration=33|duration_time=0.033000|size=1485|pos=232378|flags=___|data_hash=CRC32:6f6eae16 +packet|codec_type=audio|stream_index=1|pts=6409|pts_time=6.409000|dts=6409|dts_time=6.409000|duration=46|duration_time=0.046000|size=358|pos=233883|flags=K__|data_hash=CRC32:ef6dc063 +packet|codec_type=video|stream_index=0|pts=6440|pts_time=6.440000|dts=6440|dts_time=6.440000|duration=33|duration_time=0.033000|size=1786|pos=234258|flags=___|data_hash=CRC32:0d06af0a +packet|codec_type=audio|stream_index=1|pts=6455|pts_time=6.455000|dts=6455|dts_time=6.455000|duration=46|duration_time=0.046000|size=360|pos=236064|flags=K__|data_hash=CRC32:21588c84 +packet|codec_type=video|stream_index=0|pts=6473|pts_time=6.473000|dts=6473|dts_time=6.473000|duration=33|duration_time=0.033000|size=1345|pos=236441|flags=___|data_hash=CRC32:be3a88c3 +packet|codec_type=audio|stream_index=1|pts=6502|pts_time=6.502000|dts=6502|dts_time=6.502000|duration=46|duration_time=0.046000|size=357|pos=237806|flags=K__|data_hash=CRC32:2b9aa0fa +packet|codec_type=video|stream_index=0|pts=6507|pts_time=6.507000|dts=6507|dts_time=6.507000|duration=33|duration_time=0.033000|size=8275|pos=238180|flags=K__|data_hash=CRC32:a7db122a +packet|codec_type=video|stream_index=0|pts=6540|pts_time=6.540000|dts=6540|dts_time=6.540000|duration=33|duration_time=0.033000|size=698|pos=246475|flags=___|data_hash=CRC32:333944af +packet|codec_type=audio|stream_index=1|pts=6548|pts_time=6.548000|dts=6548|dts_time=6.548000|duration=46|duration_time=0.046000|size=336|pos=247193|flags=K__|data_hash=CRC32:57dbe1a1 +packet|codec_type=video|stream_index=0|pts=6573|pts_time=6.573000|dts=6573|dts_time=6.573000|duration=33|duration_time=0.033000|size=1298|pos=247546|flags=___|data_hash=CRC32:e4a95b13 +packet|codec_type=audio|stream_index=1|pts=6594|pts_time=6.594000|dts=6594|dts_time=6.594000|duration=46|duration_time=0.046000|size=343|pos=248864|flags=K__|data_hash=CRC32:ed44ae94 +packet|codec_type=video|stream_index=0|pts=6607|pts_time=6.607000|dts=6607|dts_time=6.607000|duration=33|duration_time=0.033000|size=1454|pos=249224|flags=___|data_hash=CRC32:40218f22 +packet|codec_type=video|stream_index=0|pts=6640|pts_time=6.640000|dts=6640|dts_time=6.640000|duration=33|duration_time=0.033000|size=1352|pos=250698|flags=___|data_hash=CRC32:06fd2643 +packet|codec_type=audio|stream_index=1|pts=6641|pts_time=6.641000|dts=6641|dts_time=6.641000|duration=46|duration_time=0.046000|size=324|pos=252070|flags=K__|data_hash=CRC32:0a20b257 +packet|codec_type=video|stream_index=0|pts=6673|pts_time=6.673000|dts=6673|dts_time=6.673000|duration=33|duration_time=0.033000|size=1609|pos=252411|flags=___|data_hash=CRC32:73d71cca +packet|codec_type=audio|stream_index=1|pts=6687|pts_time=6.687000|dts=6687|dts_time=6.687000|duration=46|duration_time=0.046000|size=322|pos=254040|flags=K__|data_hash=CRC32:32957adb +packet|codec_type=video|stream_index=0|pts=6707|pts_time=6.707000|dts=6707|dts_time=6.707000|duration=33|duration_time=0.033000|size=1476|pos=254379|flags=___|data_hash=CRC32:226c92f5 +packet|codec_type=audio|stream_index=1|pts=6734|pts_time=6.734000|dts=6734|dts_time=6.734000|duration=46|duration_time=0.046000|size=328|pos=255875|flags=K__|data_hash=CRC32:f2deeca5 +packet|codec_type=video|stream_index=0|pts=6740|pts_time=6.740000|dts=6740|dts_time=6.740000|duration=33|duration_time=0.033000|size=1391|pos=256220|flags=___|data_hash=CRC32:9a20a6cc +packet|codec_type=video|stream_index=0|pts=6773|pts_time=6.773000|dts=6773|dts_time=6.773000|duration=33|duration_time=0.033000|size=1203|pos=257631|flags=___|data_hash=CRC32:694b79e2 +packet|codec_type=audio|stream_index=1|pts=6780|pts_time=6.780000|dts=6780|dts_time=6.780000|duration=46|duration_time=0.046000|size=332|pos=258854|flags=K__|data_hash=CRC32:69c10e24 +packet|codec_type=video|stream_index=0|pts=6807|pts_time=6.807000|dts=6807|dts_time=6.807000|duration=33|duration_time=0.033000|size=1489|pos=259203|flags=___|data_hash=CRC32:72a4b942 +packet|codec_type=audio|stream_index=1|pts=6827|pts_time=6.827000|dts=6827|dts_time=6.827000|duration=46|duration_time=0.046000|size=343|pos=260712|flags=K__|data_hash=CRC32:59e5debb +packet|codec_type=video|stream_index=0|pts=6840|pts_time=6.840000|dts=6840|dts_time=6.840000|duration=33|duration_time=0.033000|size=1655|pos=261072|flags=___|data_hash=CRC32:d23af0f0 +packet|codec_type=audio|stream_index=1|pts=6873|pts_time=6.873000|dts=6873|dts_time=6.873000|duration=46|duration_time=0.046000|size=343|pos=262747|flags=K__|data_hash=CRC32:3a753534 +packet|codec_type=video|stream_index=0|pts=6874|pts_time=6.874000|dts=6874|dts_time=6.874000|duration=33|duration_time=0.033000|size=1363|pos=263107|flags=___|data_hash=CRC32:a3c3183f +packet|codec_type=video|stream_index=0|pts=6907|pts_time=6.907000|dts=6907|dts_time=6.907000|duration=33|duration_time=0.033000|size=1492|pos=264490|flags=___|data_hash=CRC32:2efa7752 +packet|codec_type=audio|stream_index=1|pts=6920|pts_time=6.920000|dts=6920|dts_time=6.920000|duration=46|duration_time=0.046000|size=327|pos=266002|flags=K__|data_hash=CRC32:0c6cfc20 +packet|codec_type=video|stream_index=0|pts=6940|pts_time=6.940000|dts=6940|dts_time=6.940000|duration=33|duration_time=0.033000|size=1397|pos=266346|flags=___|data_hash=CRC32:f4cff2aa +packet|codec_type=audio|stream_index=1|pts=6966|pts_time=6.966000|dts=6966|dts_time=6.966000|duration=46|duration_time=0.046000|size=326|pos=267763|flags=K__|data_hash=CRC32:0287694a +packet|codec_type=video|stream_index=0|pts=6974|pts_time=6.974000|dts=6974|dts_time=6.974000|duration=33|duration_time=0.033000|size=1251|pos=268106|flags=___|data_hash=CRC32:24f376e2 +packet|codec_type=video|stream_index=0|pts=7007|pts_time=7.007000|dts=7007|dts_time=7.007000|duration=33|duration_time=0.033000|size=1586|pos=269377|flags=___|data_hash=CRC32:6894eed6 +packet|codec_type=audio|stream_index=1|pts=7012|pts_time=7.012000|dts=7012|dts_time=7.012000|duration=46|duration_time=0.046000|size=324|pos=270983|flags=K__|data_hash=CRC32:7131ae4e +packet|codec_type=video|stream_index=0|pts=7040|pts_time=7.040000|dts=7040|dts_time=7.040000|duration=33|duration_time=0.033000|size=1333|pos=271324|flags=___|data_hash=CRC32:c70a7aad +packet|codec_type=audio|stream_index=1|pts=7059|pts_time=7.059000|dts=7059|dts_time=7.059000|duration=46|duration_time=0.046000|size=312|pos=272677|flags=K__|data_hash=CRC32:19e4ee3f +packet|codec_type=video|stream_index=0|pts=7074|pts_time=7.074000|dts=7074|dts_time=7.074000|duration=33|duration_time=0.033000|size=2723|pos=273006|flags=___|data_hash=CRC32:a6013df5 +packet|codec_type=audio|stream_index=1|pts=7105|pts_time=7.105000|dts=7105|dts_time=7.105000|duration=46|duration_time=0.046000|size=308|pos=275749|flags=K__|data_hash=CRC32:c90c6296 +packet|codec_type=video|stream_index=0|pts=7107|pts_time=7.107000|dts=7107|dts_time=7.107000|duration=33|duration_time=0.033000|size=632|pos=276074|flags=___|data_hash=CRC32:24dd0b1b +packet|codec_type=video|stream_index=0|pts=7140|pts_time=7.140000|dts=7140|dts_time=7.140000|duration=33|duration_time=0.033000|size=444|pos=276726|flags=___|data_hash=CRC32:f0104674 +packet|codec_type=audio|stream_index=1|pts=7152|pts_time=7.152000|dts=7152|dts_time=7.152000|duration=46|duration_time=0.046000|size=308|pos=277190|flags=K__|data_hash=CRC32:801d3efb +packet|codec_type=video|stream_index=0|pts=7174|pts_time=7.174000|dts=7174|dts_time=7.174000|duration=33|duration_time=0.033000|size=1013|pos=277515|flags=___|data_hash=CRC32:50fd7439 +packet|codec_type=audio|stream_index=1|pts=7198|pts_time=7.198000|dts=7198|dts_time=7.198000|duration=46|duration_time=0.046000|size=318|pos=278548|flags=K__|data_hash=CRC32:da27ff29 +packet|codec_type=video|stream_index=0|pts=7207|pts_time=7.207000|dts=7207|dts_time=7.207000|duration=33|duration_time=0.033000|size=1357|pos=278883|flags=___|data_hash=CRC32:147764fe +packet|codec_type=video|stream_index=0|pts=7241|pts_time=7.241000|dts=7241|dts_time=7.241000|duration=33|duration_time=0.033000|size=1586|pos=280260|flags=___|data_hash=CRC32:6ba61f38 +packet|codec_type=audio|stream_index=1|pts=7245|pts_time=7.245000|dts=7245|dts_time=7.245000|duration=46|duration_time=0.046000|size=331|pos=281866|flags=K__|data_hash=CRC32:ff54d1a1 +packet|codec_type=video|stream_index=0|pts=7274|pts_time=7.274000|dts=7274|dts_time=7.274000|duration=33|duration_time=0.033000|size=2514|pos=282214|flags=___|data_hash=CRC32:ee50c38f +packet|codec_type=audio|stream_index=1|pts=7291|pts_time=7.291000|dts=7291|dts_time=7.291000|duration=46|duration_time=0.046000|size=329|pos=284748|flags=K__|data_hash=CRC32:af348626 +packet|codec_type=video|stream_index=0|pts=7307|pts_time=7.307000|dts=7307|dts_time=7.307000|duration=33|duration_time=0.033000|size=450|pos=285094|flags=___|data_hash=CRC32:4c566b91 +packet|codec_type=audio|stream_index=1|pts=7338|pts_time=7.338000|dts=7338|dts_time=7.338000|duration=46|duration_time=0.046000|size=333|pos=285564|flags=K__|data_hash=CRC32:561118f2 +packet|codec_type=video|stream_index=0|pts=7341|pts_time=7.341000|dts=7341|dts_time=7.341000|duration=33|duration_time=0.033000|size=423|pos=285914|flags=___|data_hash=CRC32:799d9d42 +packet|codec_type=video|stream_index=0|pts=7374|pts_time=7.374000|dts=7374|dts_time=7.374000|duration=33|duration_time=0.033000|size=1161|pos=286357|flags=___|data_hash=CRC32:f37f1ffc +packet|codec_type=audio|stream_index=1|pts=7384|pts_time=7.384000|dts=7384|dts_time=7.384000|duration=46|duration_time=0.046000|size=314|pos=287538|flags=K__|data_hash=CRC32:ab18160b +packet|codec_type=video|stream_index=0|pts=7407|pts_time=7.407000|dts=7407|dts_time=7.407000|duration=33|duration_time=0.033000|size=1366|pos=287869|flags=___|data_hash=CRC32:6484b277 +packet|codec_type=audio|stream_index=1|pts=7430|pts_time=7.430000|dts=7430|dts_time=7.430000|duration=46|duration_time=0.046000|size=304|pos=289255|flags=K__|data_hash=CRC32:823aa6c6 +packet|codec_type=video|stream_index=0|pts=7441|pts_time=7.441000|dts=7441|dts_time=7.441000|duration=33|duration_time=0.033000|size=1325|pos=289576|flags=___|data_hash=CRC32:6eb411da +packet|codec_type=video|stream_index=0|pts=7474|pts_time=7.474000|dts=7474|dts_time=7.474000|duration=33|duration_time=0.033000|size=2687|pos=290921|flags=___|data_hash=CRC32:dc8f2e68 +packet|codec_type=audio|stream_index=1|pts=7477|pts_time=7.477000|dts=7477|dts_time=7.477000|duration=46|duration_time=0.046000|size=299|pos=293628|flags=K__|data_hash=CRC32:92c86961 +packet|codec_type=video|stream_index=0|pts=7508|pts_time=7.508000|dts=7508|dts_time=7.508000|duration=33|duration_time=0.033000|size=678|pos=293944|flags=___|data_hash=CRC32:bbd3fb62 +packet|codec_type=audio|stream_index=1|pts=7523|pts_time=7.523000|dts=7523|dts_time=7.523000|duration=46|duration_time=0.046000|size=311|pos=294642|flags=K__|data_hash=CRC32:8f7e6535 +packet|codec_type=video|stream_index=0|pts=7541|pts_time=7.541000|dts=7541|dts_time=7.541000|duration=33|duration_time=0.033000|size=491|pos=294970|flags=___|data_hash=CRC32:44e5e238 +packet|codec_type=audio|stream_index=1|pts=7570|pts_time=7.570000|dts=7570|dts_time=7.570000|duration=46|duration_time=0.046000|size=323|pos=295481|flags=K__|data_hash=CRC32:4572a6b6 +packet|codec_type=video|stream_index=0|pts=7574|pts_time=7.574000|dts=7574|dts_time=7.574000|duration=33|duration_time=0.033000|size=1056|pos=295821|flags=___|data_hash=CRC32:59790f4a +packet|codec_type=video|stream_index=0|pts=7608|pts_time=7.608000|dts=7608|dts_time=7.608000|duration=33|duration_time=0.033000|size=1549|pos=296897|flags=___|data_hash=CRC32:ede372d1 +packet|codec_type=audio|stream_index=1|pts=7616|pts_time=7.616000|dts=7616|dts_time=7.616000|duration=46|duration_time=0.046000|size=317|pos=298466|flags=K__|data_hash=CRC32:217926a5 +packet|codec_type=video|stream_index=0|pts=7641|pts_time=7.641000|dts=7641|dts_time=7.641000|duration=33|duration_time=0.033000|size=2502|pos=298800|flags=___|data_hash=CRC32:b4c753cb +packet|codec_type=audio|stream_index=1|pts=7663|pts_time=7.663000|dts=7663|dts_time=7.663000|duration=46|duration_time=0.046000|size=322|pos=301322|flags=K__|data_hash=CRC32:66da2414 +packet|codec_type=video|stream_index=0|pts=7674|pts_time=7.674000|dts=7674|dts_time=7.674000|duration=33|duration_time=0.033000|size=539|pos=301661|flags=___|data_hash=CRC32:957ce92c +packet|codec_type=video|stream_index=0|pts=7708|pts_time=7.708000|dts=7708|dts_time=7.708000|duration=33|duration_time=0.033000|size=594|pos=302220|flags=___|data_hash=CRC32:01178bad +packet|codec_type=audio|stream_index=1|pts=7709|pts_time=7.709000|dts=7709|dts_time=7.709000|duration=46|duration_time=0.046000|size=329|pos=302834|flags=K__|data_hash=CRC32:8570ef58 +packet|codec_type=video|stream_index=0|pts=7741|pts_time=7.741000|dts=7741|dts_time=7.741000|duration=33|duration_time=0.033000|size=1254|pos=303180|flags=___|data_hash=CRC32:7b42fdb2 +packet|codec_type=audio|stream_index=1|pts=7755|pts_time=7.755000|dts=7755|dts_time=7.755000|duration=46|duration_time=0.046000|size=342|pos=304454|flags=K__|data_hash=CRC32:866b46d1 +packet|codec_type=video|stream_index=0|pts=7774|pts_time=7.774000|dts=7774|dts_time=7.774000|duration=33|duration_time=0.033000|size=1341|pos=304813|flags=___|data_hash=CRC32:76ee5810 +packet|codec_type=audio|stream_index=1|pts=7802|pts_time=7.802000|dts=7802|dts_time=7.802000|duration=46|duration_time=0.046000|size=331|pos=306174|flags=K__|data_hash=CRC32:e836a9c7 +packet|codec_type=video|stream_index=0|pts=7808|pts_time=7.808000|dts=7808|dts_time=7.808000|duration=33|duration_time=0.033000|size=1358|pos=306522|flags=___|data_hash=CRC32:935430a2 +packet|codec_type=video|stream_index=0|pts=7841|pts_time=7.841000|dts=7841|dts_time=7.841000|duration=33|duration_time=0.033000|size=2336|pos=307900|flags=___|data_hash=CRC32:3ed5a208 +packet|codec_type=audio|stream_index=1|pts=7848|pts_time=7.848000|dts=7848|dts_time=7.848000|duration=46|duration_time=0.046000|size=343|pos=310256|flags=K__|data_hash=CRC32:eb15e72d +packet|codec_type=video|stream_index=0|pts=7875|pts_time=7.875000|dts=7875|dts_time=7.875000|duration=33|duration_time=0.033000|size=339|pos=310616|flags=___|data_hash=CRC32:10d2e236 +packet|codec_type=audio|stream_index=1|pts=7895|pts_time=7.895000|dts=7895|dts_time=7.895000|duration=46|duration_time=0.046000|size=327|pos=310975|flags=K__|data_hash=CRC32:fa82f874 +packet|codec_type=video|stream_index=0|pts=7908|pts_time=7.908000|dts=7908|dts_time=7.908000|duration=33|duration_time=0.033000|size=2159|pos=311319|flags=___|data_hash=CRC32:d84ad78a +packet|codec_type=audio|stream_index=1|pts=7941|pts_time=7.941000|dts=7941|dts_time=7.941000|duration=46|duration_time=0.046000|size=317|pos=313498|flags=K__|data_hash=CRC32:2f9ae86b +packet|codec_type=video|stream_index=0|pts=7941|pts_time=7.941000|dts=7941|dts_time=7.941000|duration=33|duration_time=0.033000|size=390|pos=313832|flags=___|data_hash=CRC32:d5f6e16d +packet|codec_type=video|stream_index=0|pts=7975|pts_time=7.975000|dts=7975|dts_time=7.975000|duration=33|duration_time=0.033000|size=479|pos=314242|flags=___|data_hash=CRC32:62ef0b83 +packet|codec_type=audio|stream_index=1|pts=7988|pts_time=7.988000|dts=7988|dts_time=7.988000|duration=46|duration_time=0.046000|size=313|pos=314741|flags=K__|data_hash=CRC32:de3136c8 +packet|codec_type=video|stream_index=0|pts=8008|pts_time=8.008000|dts=8008|dts_time=8.008000|duration=33|duration_time=0.033000|size=2157|pos=315071|flags=___|data_hash=CRC32:0cef0137 +packet|codec_type=audio|stream_index=1|pts=8034|pts_time=8.034000|dts=8034|dts_time=8.034000|duration=46|duration_time=0.046000|size=312|pos=317248|flags=K__|data_hash=CRC32:4abd9c07 +packet|codec_type=video|stream_index=0|pts=8041|pts_time=8.041000|dts=8041|dts_time=8.041000|duration=33|duration_time=0.033000|size=429|pos=317577|flags=___|data_hash=CRC32:87ebdeb2 +packet|codec_type=video|stream_index=0|pts=8075|pts_time=8.075000|dts=8075|dts_time=8.075000|duration=33|duration_time=0.033000|size=1953|pos=318026|flags=___|data_hash=CRC32:02a64621 +packet|codec_type=audio|stream_index=1|pts=8081|pts_time=8.081000|dts=8081|dts_time=8.081000|duration=46|duration_time=0.046000|size=318|pos=319999|flags=K__|data_hash=CRC32:f22024a9 +packet|codec_type=video|stream_index=0|pts=8108|pts_time=8.108000|dts=8108|dts_time=8.108000|duration=33|duration_time=0.033000|size=379|pos=320334|flags=___|data_hash=CRC32:b62cddd2 +packet|codec_type=audio|stream_index=1|pts=8127|pts_time=8.127000|dts=8127|dts_time=8.127000|duration=46|duration_time=0.046000|size=325|pos=320733|flags=K__|data_hash=CRC32:64fd8299 +packet|codec_type=video|stream_index=0|pts=8141|pts_time=8.141000|dts=8141|dts_time=8.141000|duration=33|duration_time=0.033000|size=1817|pos=321075|flags=___|data_hash=CRC32:c8592216 +packet|codec_type=audio|stream_index=1|pts=8173|pts_time=8.173000|dts=8173|dts_time=8.173000|duration=46|duration_time=0.046000|size=317|pos=322912|flags=K__|data_hash=CRC32:4691c3cf +packet|codec_type=video|stream_index=0|pts=8175|pts_time=8.175000|dts=8175|dts_time=8.175000|duration=33|duration_time=0.033000|size=372|pos=323246|flags=___|data_hash=CRC32:97c375b0 +packet|codec_type=video|stream_index=0|pts=8208|pts_time=8.208000|dts=8208|dts_time=8.208000|duration=33|duration_time=0.033000|size=1664|pos=323638|flags=___|data_hash=CRC32:ca3e11a7 +packet|codec_type=audio|stream_index=1|pts=8220|pts_time=8.220000|dts=8220|dts_time=8.220000|duration=46|duration_time=0.046000|size=308|pos=325322|flags=K__|data_hash=CRC32:09626471 +packet|codec_type=video|stream_index=0|pts=8242|pts_time=8.242000|dts=8242|dts_time=8.242000|duration=33|duration_time=0.033000|size=340|pos=325647|flags=___|data_hash=CRC32:a779f4f7 +packet|codec_type=audio|stream_index=1|pts=8266|pts_time=8.266000|dts=8266|dts_time=8.266000|duration=46|duration_time=0.046000|size=309|pos=326007|flags=K__|data_hash=CRC32:728889b5 +packet|codec_type=video|stream_index=0|pts=8275|pts_time=8.275000|dts=8275|dts_time=8.275000|duration=33|duration_time=0.033000|size=1955|pos=326333|flags=___|data_hash=CRC32:695aa624 +packet|codec_type=video|stream_index=0|pts=8308|pts_time=8.308000|dts=8308|dts_time=8.308000|duration=33|duration_time=0.033000|size=485|pos=328308|flags=___|data_hash=CRC32:51973647 +packet|codec_type=audio|stream_index=1|pts=8313|pts_time=8.313000|dts=8313|dts_time=8.313000|duration=46|duration_time=0.046000|size=315|pos=328813|flags=K__|data_hash=CRC32:c3488703 +packet|codec_type=video|stream_index=0|pts=8342|pts_time=8.342000|dts=8342|dts_time=8.342000|duration=33|duration_time=0.033000|size=1705|pos=329145|flags=___|data_hash=CRC32:5837d8d2 +packet|codec_type=audio|stream_index=1|pts=8359|pts_time=8.359000|dts=8359|dts_time=8.359000|duration=46|duration_time=0.046000|size=340|pos=330870|flags=K__|data_hash=CRC32:9e35fdd6 +packet|codec_type=video|stream_index=0|pts=8375|pts_time=8.375000|dts=8375|dts_time=8.375000|duration=33|duration_time=0.033000|size=411|pos=331227|flags=___|data_hash=CRC32:0f50eec7 +packet|codec_type=audio|stream_index=1|pts=8406|pts_time=8.406000|dts=8406|dts_time=8.406000|duration=46|duration_time=0.046000|size=326|pos=331658|flags=K__|data_hash=CRC32:719bf8ae +packet|codec_type=video|stream_index=0|pts=8408|pts_time=8.408000|dts=8408|dts_time=8.408000|duration=33|duration_time=0.033000|size=1818|pos=332001|flags=___|data_hash=CRC32:a33c3a86 +packet|codec_type=video|stream_index=0|pts=8442|pts_time=8.442000|dts=8442|dts_time=8.442000|duration=33|duration_time=0.033000|size=304|pos=333839|flags=___|data_hash=CRC32:e192b5c4 +packet|codec_type=audio|stream_index=1|pts=8452|pts_time=8.452000|dts=8452|dts_time=8.452000|duration=46|duration_time=0.046000|size=333|pos=334163|flags=K__|data_hash=CRC32:e927cbe1 +packet|codec_type=video|stream_index=0|pts=8475|pts_time=8.475000|dts=8475|dts_time=8.475000|duration=33|duration_time=0.033000|size=6302|pos=334513|flags=K__|data_hash=CRC32:2290178c +packet|codec_type=audio|stream_index=1|pts=8499|pts_time=8.499000|dts=8499|dts_time=8.499000|duration=46|duration_time=0.046000|size=340|pos=340835|flags=K__|data_hash=CRC32:2dfd7ad8 +packet|codec_type=video|stream_index=0|pts=8509|pts_time=8.509000|dts=8509|dts_time=8.509000|duration=33|duration_time=0.033000|size=1498|pos=341192|flags=___|data_hash=CRC32:e0611ee8 +packet|codec_type=video|stream_index=0|pts=8542|pts_time=8.542000|dts=8542|dts_time=8.542000|duration=33|duration_time=0.033000|size=434|pos=342710|flags=___|data_hash=CRC32:ffb5d9c5 +packet|codec_type=audio|stream_index=1|pts=8545|pts_time=8.545000|dts=8545|dts_time=8.545000|duration=46|duration_time=0.046000|size=338|pos=343164|flags=K__|data_hash=CRC32:954e8263 +packet|codec_type=video|stream_index=0|pts=8575|pts_time=8.575000|dts=8575|dts_time=8.575000|duration=33|duration_time=0.033000|size=1643|pos=343519|flags=___|data_hash=CRC32:c4e8ba5f +packet|codec_type=audio|stream_index=1|pts=8591|pts_time=8.591000|dts=8591|dts_time=8.591000|duration=46|duration_time=0.046000|size=357|pos=345182|flags=K__|data_hash=CRC32:944e4fde +packet|codec_type=video|stream_index=0|pts=8609|pts_time=8.609000|dts=8609|dts_time=8.609000|duration=33|duration_time=0.033000|size=213|pos=345556|flags=___|data_hash=CRC32:6b32090f +packet|codec_type=audio|stream_index=1|pts=8638|pts_time=8.638000|dts=8638|dts_time=8.638000|duration=46|duration_time=0.046000|size=340|pos=345789|flags=K__|data_hash=CRC32:edd08354 +packet|codec_type=video|stream_index=0|pts=8642|pts_time=8.642000|dts=8642|dts_time=8.642000|duration=33|duration_time=0.033000|size=1820|pos=346146|flags=___|data_hash=CRC32:e814434f +packet|codec_type=video|stream_index=0|pts=8675|pts_time=8.675000|dts=8675|dts_time=8.675000|duration=33|duration_time=0.033000|size=264|pos=347986|flags=___|data_hash=CRC32:c47e7364 +packet|codec_type=audio|stream_index=1|pts=8684|pts_time=8.684000|dts=8684|dts_time=8.684000|duration=46|duration_time=0.046000|size=335|pos=348270|flags=K__|data_hash=CRC32:6a3050c7 +packet|codec_type=video|stream_index=0|pts=8709|pts_time=8.709000|dts=8709|dts_time=8.709000|duration=33|duration_time=0.033000|size=1461|pos=348622|flags=___|data_hash=CRC32:9bf7c586 +packet|codec_type=audio|stream_index=1|pts=8731|pts_time=8.731000|dts=8731|dts_time=8.731000|duration=46|duration_time=0.046000|size=322|pos=350103|flags=K__|data_hash=CRC32:f8744c32 +packet|codec_type=video|stream_index=0|pts=8742|pts_time=8.742000|dts=8742|dts_time=8.742000|duration=33|duration_time=0.033000|size=239|pos=350442|flags=___|data_hash=CRC32:7549da5a +packet|codec_type=video|stream_index=0|pts=8775|pts_time=8.775000|dts=8775|dts_time=8.775000|duration=33|duration_time=0.033000|size=1581|pos=350701|flags=___|data_hash=CRC32:2d4be1b6 +packet|codec_type=audio|stream_index=1|pts=8777|pts_time=8.777000|dts=8777|dts_time=8.777000|duration=46|duration_time=0.046000|size=318|pos=352302|flags=K__|data_hash=CRC32:e85d4c2c +packet|codec_type=video|stream_index=0|pts=8809|pts_time=8.809000|dts=8809|dts_time=8.809000|duration=33|duration_time=0.033000|size=212|pos=352637|flags=___|data_hash=CRC32:5b804b23 +packet|codec_type=audio|stream_index=1|pts=8824|pts_time=8.824000|dts=8824|dts_time=8.824000|duration=46|duration_time=0.046000|size=326|pos=352869|flags=K__|data_hash=CRC32:a2b69ebf +packet|codec_type=video|stream_index=0|pts=8842|pts_time=8.842000|dts=8842|dts_time=8.842000|duration=33|duration_time=0.033000|size=1351|pos=353212|flags=___|data_hash=CRC32:5f901255 +packet|codec_type=audio|stream_index=1|pts=8870|pts_time=8.870000|dts=8870|dts_time=8.870000|duration=46|duration_time=0.046000|size=341|pos=354583|flags=K__|data_hash=CRC32:f928467f +packet|codec_type=video|stream_index=0|pts=8876|pts_time=8.876000|dts=8876|dts_time=8.876000|duration=33|duration_time=0.033000|size=448|pos=354941|flags=___|data_hash=CRC32:ab757d3b +packet|codec_type=video|stream_index=0|pts=8909|pts_time=8.909000|dts=8909|dts_time=8.909000|duration=33|duration_time=0.033000|size=1403|pos=355409|flags=___|data_hash=CRC32:b01c66f4 +packet|codec_type=audio|stream_index=1|pts=8916|pts_time=8.916000|dts=8916|dts_time=8.916000|duration=46|duration_time=0.046000|size=319|pos=356832|flags=K__|data_hash=CRC32:0926072d +packet|codec_type=video|stream_index=0|pts=8942|pts_time=8.942000|dts=8942|dts_time=8.942000|duration=33|duration_time=0.033000|size=491|pos=357168|flags=___|data_hash=CRC32:0367ac76 +packet|codec_type=audio|stream_index=1|pts=8963|pts_time=8.963000|dts=8963|dts_time=8.963000|duration=46|duration_time=0.046000|size=303|pos=357679|flags=K__|data_hash=CRC32:d41fe125 +packet|codec_type=video|stream_index=0|pts=8976|pts_time=8.976000|dts=8976|dts_time=8.976000|duration=33|duration_time=0.033000|size=1606|pos=357999|flags=___|data_hash=CRC32:662f0120 +packet|codec_type=audio|stream_index=1|pts=9009|pts_time=9.009000|dts=9009|dts_time=9.009000|duration=46|duration_time=0.046000|size=291|pos=359625|flags=K__|data_hash=CRC32:f90846c9 +packet|codec_type=video|stream_index=0|pts=9009|pts_time=9.009000|dts=9009|dts_time=9.009000|duration=33|duration_time=0.033000|size=304|pos=359933|flags=___|data_hash=CRC32:18968792 +packet|codec_type=video|stream_index=0|pts=9042|pts_time=9.042000|dts=9042|dts_time=9.042000|duration=33|duration_time=0.033000|size=1537|pos=360257|flags=___|data_hash=CRC32:5469d062 +packet|codec_type=audio|stream_index=1|pts=9056|pts_time=9.056000|dts=9056|dts_time=9.056000|duration=46|duration_time=0.046000|size=307|pos=361814|flags=K__|data_hash=CRC32:ef8ffe20 +packet|codec_type=video|stream_index=0|pts=9076|pts_time=9.076000|dts=9076|dts_time=9.076000|duration=33|duration_time=0.033000|size=342|pos=362138|flags=___|data_hash=CRC32:dd1d6dbb +packet|codec_type=audio|stream_index=1|pts=9102|pts_time=9.102000|dts=9102|dts_time=9.102000|duration=46|duration_time=0.046000|size=335|pos=362500|flags=K__|data_hash=CRC32:ccc6f929 +packet|codec_type=video|stream_index=0|pts=9109|pts_time=9.109000|dts=9109|dts_time=9.109000|duration=33|duration_time=0.033000|size=1405|pos=362852|flags=___|data_hash=CRC32:6558f9bb +packet|codec_type=video|stream_index=0|pts=9142|pts_time=9.142000|dts=9142|dts_time=9.142000|duration=33|duration_time=0.033000|size=351|pos=364277|flags=___|data_hash=CRC32:867aaa58 +packet|codec_type=audio|stream_index=1|pts=9149|pts_time=9.149000|dts=9149|dts_time=9.149000|duration=46|duration_time=0.046000|size=348|pos=364648|flags=K__|data_hash=CRC32:d0911535 +packet|codec_type=video|stream_index=0|pts=9176|pts_time=9.176000|dts=9176|dts_time=9.176000|duration=33|duration_time=0.033000|size=1451|pos=365013|flags=___|data_hash=CRC32:8c786cd9 +packet|codec_type=audio|stream_index=1|pts=9195|pts_time=9.195000|dts=9195|dts_time=9.195000|duration=46|duration_time=0.046000|size=346|pos=366484|flags=K__|data_hash=CRC32:4d6976df +packet|codec_type=video|stream_index=0|pts=9209|pts_time=9.209000|dts=9209|dts_time=9.209000|duration=33|duration_time=0.033000|size=490|pos=366847|flags=___|data_hash=CRC32:d80d8605 +packet|codec_type=audio|stream_index=1|pts=9242|pts_time=9.242000|dts=9242|dts_time=9.242000|duration=46|duration_time=0.046000|size=333|pos=367357|flags=K__|data_hash=CRC32:dac6e6f2 +packet|codec_type=video|stream_index=0|pts=9243|pts_time=9.243000|dts=9243|dts_time=9.243000|duration=33|duration_time=0.033000|size=1524|pos=367707|flags=___|data_hash=CRC32:c3d07b7a +packet|codec_type=video|stream_index=0|pts=9276|pts_time=9.276000|dts=9276|dts_time=9.276000|duration=33|duration_time=0.033000|size=556|pos=369251|flags=___|data_hash=CRC32:3cb8f0fa +packet|codec_type=audio|stream_index=1|pts=9288|pts_time=9.288000|dts=9288|dts_time=9.288000|duration=46|duration_time=0.046000|size=338|pos=369827|flags=K__|data_hash=CRC32:2eade044 +packet|codec_type=video|stream_index=0|pts=9309|pts_time=9.309000|dts=9309|dts_time=9.309000|duration=33|duration_time=0.033000|size=1414|pos=370182|flags=___|data_hash=CRC32:e4c49a5e +packet|codec_type=audio|stream_index=1|pts=9334|pts_time=9.334000|dts=9334|dts_time=9.334000|duration=46|duration_time=0.046000|size=328|pos=371616|flags=K__|data_hash=CRC32:2a757134 +packet|codec_type=video|stream_index=0|pts=9343|pts_time=9.343000|dts=9343|dts_time=9.343000|duration=33|duration_time=0.033000|size=808|pos=371961|flags=___|data_hash=CRC32:9ec00704 +packet|codec_type=video|stream_index=0|pts=9376|pts_time=9.376000|dts=9376|dts_time=9.376000|duration=33|duration_time=0.033000|size=871|pos=372789|flags=___|data_hash=CRC32:67e02ddd +packet|codec_type=audio|stream_index=1|pts=9381|pts_time=9.381000|dts=9381|dts_time=9.381000|duration=46|duration_time=0.046000|size=334|pos=373680|flags=K__|data_hash=CRC32:3d50fa76 +packet|codec_type=video|stream_index=0|pts=9409|pts_time=9.409000|dts=9409|dts_time=9.409000|duration=33|duration_time=0.033000|size=562|pos=374031|flags=___|data_hash=CRC32:b4925536 +packet|codec_type=audio|stream_index=1|pts=9427|pts_time=9.427000|dts=9427|dts_time=9.427000|duration=46|duration_time=0.046000|size=364|pos=374613|flags=K__|data_hash=CRC32:d936a611 +packet|codec_type=video|stream_index=0|pts=9443|pts_time=9.443000|dts=9443|dts_time=9.443000|duration=33|duration_time=0.033000|size=711|pos=374994|flags=___|data_hash=CRC32:8842cf6e +packet|codec_type=audio|stream_index=1|pts=9474|pts_time=9.474000|dts=9474|dts_time=9.474000|duration=46|duration_time=0.046000|size=350|pos=375725|flags=K__|data_hash=CRC32:004fc6a5 +packet|codec_type=video|stream_index=0|pts=9476|pts_time=9.476000|dts=9476|dts_time=9.476000|duration=33|duration_time=0.033000|size=1209|pos=376092|flags=___|data_hash=CRC32:89e0866a +packet|codec_type=video|stream_index=0|pts=9510|pts_time=9.510000|dts=9510|dts_time=9.510000|duration=33|duration_time=0.033000|size=483|pos=377321|flags=___|data_hash=CRC32:952b1a6f +packet|codec_type=audio|stream_index=1|pts=9520|pts_time=9.520000|dts=9520|dts_time=9.520000|duration=46|duration_time=0.046000|size=348|pos=377824|flags=K__|data_hash=CRC32:314e7eb1 +packet|codec_type=video|stream_index=0|pts=9543|pts_time=9.543000|dts=9543|dts_time=9.543000|duration=33|duration_time=0.033000|size=422|pos=378189|flags=___|data_hash=CRC32:97ea1adf +packet|codec_type=audio|stream_index=1|pts=9567|pts_time=9.567000|dts=9567|dts_time=9.567000|duration=46|duration_time=0.046000|size=354|pos=378631|flags=K__|data_hash=CRC32:4eb4dd74 +packet|codec_type=video|stream_index=0|pts=9576|pts_time=9.576000|dts=9576|dts_time=9.576000|duration=33|duration_time=0.033000|size=533|pos=379002|flags=___|data_hash=CRC32:32282d12 +packet|codec_type=video|stream_index=0|pts=9610|pts_time=9.610000|dts=9610|dts_time=9.610000|duration=33|duration_time=0.033000|size=490|pos=379555|flags=___|data_hash=CRC32:df09aad5 +packet|codec_type=audio|stream_index=1|pts=9613|pts_time=9.613000|dts=9613|dts_time=9.613000|duration=46|duration_time=0.046000|size=358|pos=380065|flags=K__|data_hash=CRC32:032aac0d +packet|codec_type=video|stream_index=0|pts=9643|pts_time=9.643000|dts=9643|dts_time=9.643000|duration=33|duration_time=0.033000|size=972|pos=380440|flags=___|data_hash=CRC32:dfe239a5 +packet|codec_type=audio|stream_index=1|pts=9660|pts_time=9.660000|dts=9660|dts_time=9.660000|duration=46|duration_time=0.046000|size=361|pos=381432|flags=K__|data_hash=CRC32:c758edef +packet|codec_type=video|stream_index=0|pts=9676|pts_time=9.676000|dts=9676|dts_time=9.676000|duration=33|duration_time=0.033000|size=370|pos=381810|flags=___|data_hash=CRC32:18bf63af +packet|codec_type=audio|stream_index=1|pts=9706|pts_time=9.706000|dts=9706|dts_time=9.706000|duration=46|duration_time=0.046000|size=354|pos=382200|flags=K__|data_hash=CRC32:1b23fac4 +packet|codec_type=video|stream_index=0|pts=9710|pts_time=9.710000|dts=9710|dts_time=9.710000|duration=33|duration_time=0.033000|size=348|pos=382571|flags=___|data_hash=CRC32:b6ecb8fe +packet|codec_type=video|stream_index=0|pts=9743|pts_time=9.743000|dts=9743|dts_time=9.743000|duration=33|duration_time=0.033000|size=449|pos=382939|flags=___|data_hash=CRC32:99ec4250 +packet|codec_type=audio|stream_index=1|pts=9752|pts_time=9.752000|dts=9752|dts_time=9.752000|duration=46|duration_time=0.046000|size=369|pos=383408|flags=K__|data_hash=CRC32:25045152 +packet|codec_type=video|stream_index=0|pts=9776|pts_time=9.776000|dts=9776|dts_time=9.776000|duration=33|duration_time=0.033000|size=447|pos=383794|flags=___|data_hash=CRC32:53378d54 +packet|codec_type=audio|stream_index=1|pts=9799|pts_time=9.799000|dts=9799|dts_time=9.799000|duration=46|duration_time=0.046000|size=359|pos=384261|flags=K__|data_hash=CRC32:387d406d +packet|codec_type=video|stream_index=0|pts=9810|pts_time=9.810000|dts=9810|dts_time=9.810000|duration=33|duration_time=0.033000|size=414|pos=384637|flags=___|data_hash=CRC32:ab76fa07 +packet|codec_type=video|stream_index=0|pts=9843|pts_time=9.843000|dts=9843|dts_time=9.843000|duration=33|duration_time=0.033000|size=467|pos=385071|flags=___|data_hash=CRC32:e0d0f23c +packet|codec_type=audio|stream_index=1|pts=9845|pts_time=9.845000|dts=9845|dts_time=9.845000|duration=46|duration_time=0.046000|size=348|pos=385558|flags=K__|data_hash=CRC32:13f83e98 +packet|codec_type=video|stream_index=0|pts=9877|pts_time=9.877000|dts=9877|dts_time=9.877000|duration=33|duration_time=0.033000|size=890|pos=385923|flags=___|data_hash=CRC32:ef8759d9 +packet|codec_type=audio|stream_index=1|pts=9892|pts_time=9.892000|dts=9892|dts_time=9.892000|duration=46|duration_time=0.046000|size=346|pos=386833|flags=K__|data_hash=CRC32:4c0da0e0 +packet|codec_type=video|stream_index=0|pts=9910|pts_time=9.910000|dts=9910|dts_time=9.910000|duration=33|duration_time=0.033000|size=387|pos=387196|flags=___|data_hash=CRC32:9e2b0fa2 +packet|codec_type=audio|stream_index=1|pts=9938|pts_time=9.938000|dts=9938|dts_time=9.938000|duration=46|duration_time=0.046000|size=350|pos=387603|flags=K__|data_hash=CRC32:7b52e49d +packet|codec_type=video|stream_index=0|pts=9943|pts_time=9.943000|dts=9943|dts_time=9.943000|duration=33|duration_time=0.033000|size=351|pos=387970|flags=___|data_hash=CRC32:d1874a20 +packet|codec_type=video|stream_index=0|pts=9977|pts_time=9.977000|dts=9977|dts_time=9.977000|duration=33|duration_time=0.033000|size=720|pos=388341|flags=___|data_hash=CRC32:1dbb852e +packet|codec_type=audio|stream_index=1|pts=9985|pts_time=9.985000|dts=9985|dts_time=9.985000|duration=46|duration_time=0.046000|size=359|pos=389081|flags=K__|data_hash=CRC32:6efd45ba +packet|codec_type=video|stream_index=0|pts=10010|pts_time=10.010000|dts=10010|dts_time=10.010000|duration=33|duration_time=0.033000|size=855|pos=389457|flags=___|data_hash=CRC32:9266ff7a +packet|codec_type=audio|stream_index=1|pts=10031|pts_time=10.031000|dts=10031|dts_time=10.031000|duration=46|duration_time=0.046000|size=355|pos=390332|flags=K__|data_hash=CRC32:58c387cc +packet|codec_type=video|stream_index=0|pts=10043|pts_time=10.043000|dts=10043|dts_time=10.043000|duration=33|duration_time=0.033000|size=742|pos=390704|flags=___|data_hash=CRC32:b48053b8 +packet|codec_type=audio|stream_index=1|pts=10077|pts_time=10.077000|dts=10077|dts_time=10.077000|duration=46|duration_time=0.046000|size=320|pos=391466|flags=K__|data_hash=CRC32:115fa28d +packet|codec_type=video|stream_index=0|pts=10077|pts_time=10.077000|dts=10077|dts_time=10.077000|duration=33|duration_time=0.033000|size=835|pos=391803|flags=___|data_hash=CRC32:5e06bb03 +packet|codec_type=video|stream_index=0|pts=10110|pts_time=10.110000|dts=10110|dts_time=10.110000|duration=33|duration_time=0.033000|size=1610|pos=392658|flags=___|data_hash=CRC32:fafab2d1 +packet|codec_type=audio|stream_index=1|pts=10124|pts_time=10.124000|dts=10124|dts_time=10.124000|duration=46|duration_time=0.046000|size=348|pos=394288|flags=K__|data_hash=CRC32:92d59397 +packet|codec_type=video|stream_index=0|pts=10143|pts_time=10.143000|dts=10143|dts_time=10.143000|duration=33|duration_time=0.033000|size=637|pos=394653|flags=___|data_hash=CRC32:6e59b37f +packet|codec_type=audio|stream_index=1|pts=10170|pts_time=10.170000|dts=10170|dts_time=10.170000|duration=46|duration_time=0.046000|size=370|pos=395310|flags=K__|data_hash=CRC32:3ea66fa9 +packet|codec_type=video|stream_index=0|pts=10177|pts_time=10.177000|dts=10177|dts_time=10.177000|duration=33|duration_time=0.033000|size=614|pos=395697|flags=___|data_hash=CRC32:4f7f5e8e +packet|codec_type=video|stream_index=0|pts=10210|pts_time=10.210000|dts=10210|dts_time=10.210000|duration=33|duration_time=0.033000|size=1143|pos=396331|flags=___|data_hash=CRC32:d877789c +packet|codec_type=audio|stream_index=1|pts=10217|pts_time=10.217000|dts=10217|dts_time=10.217000|duration=46|duration_time=0.046000|size=353|pos=397494|flags=K__|data_hash=CRC32:22050bd1 +packet|codec_type=video|stream_index=0|pts=10244|pts_time=10.244000|dts=10244|dts_time=10.244000|duration=33|duration_time=0.033000|size=1262|pos=397864|flags=___|data_hash=CRC32:6d88aa4f +packet|codec_type=audio|stream_index=1|pts=10263|pts_time=10.263000|dts=10263|dts_time=10.263000|duration=46|duration_time=0.046000|size=367|pos=399146|flags=K__|data_hash=CRC32:077e57a2 +packet|codec_type=video|stream_index=0|pts=10277|pts_time=10.277000|dts=10277|dts_time=10.277000|duration=33|duration_time=0.033000|size=1618|pos=399530|flags=___|data_hash=CRC32:175e29a2 +packet|codec_type=audio|stream_index=1|pts=10310|pts_time=10.310000|dts=10310|dts_time=10.310000|duration=46|duration_time=0.046000|size=350|pos=401168|flags=K__|data_hash=CRC32:346c722e +packet|codec_type=video|stream_index=0|pts=10310|pts_time=10.310000|dts=10310|dts_time=10.310000|duration=33|duration_time=0.033000|size=2345|pos=401535|flags=___|data_hash=CRC32:ccf488bd +packet|codec_type=video|stream_index=0|pts=10344|pts_time=10.344000|dts=10344|dts_time=10.344000|duration=33|duration_time=0.033000|size=1029|pos=403900|flags=___|data_hash=CRC32:4b3a69da +packet|codec_type=audio|stream_index=1|pts=10356|pts_time=10.356000|dts=10356|dts_time=10.356000|duration=46|duration_time=0.046000|size=353|pos=404949|flags=K__|data_hash=CRC32:de07f5ea +packet|codec_type=video|stream_index=0|pts=10377|pts_time=10.377000|dts=10377|dts_time=10.377000|duration=33|duration_time=0.033000|size=932|pos=405319|flags=___|data_hash=CRC32:dfb7b52c +packet|codec_type=audio|stream_index=1|pts=10403|pts_time=10.403000|dts=10403|dts_time=10.403000|duration=46|duration_time=0.046000|size=336|pos=406271|flags=K__|data_hash=CRC32:2dbed9ee +packet|codec_type=video|stream_index=0|pts=10410|pts_time=10.410000|dts=10410|dts_time=10.410000|duration=33|duration_time=0.033000|size=1688|pos=406624|flags=___|data_hash=CRC32:6fc6be0f +packet|codec_type=video|stream_index=0|pts=10444|pts_time=10.444000|dts=10444|dts_time=10.444000|duration=33|duration_time=0.033000|size=4159|pos=408332|flags=K__|data_hash=CRC32:6988ae22 +packet|codec_type=audio|stream_index=1|pts=10449|pts_time=10.449000|dts=10449|dts_time=10.449000|duration=46|duration_time=0.046000|size=334|pos=412511|flags=K__|data_hash=CRC32:7b903b6f +packet|codec_type=video|stream_index=0|pts=10477|pts_time=10.477000|dts=10477|dts_time=10.477000|duration=33|duration_time=0.033000|size=2039|pos=412862|flags=___|data_hash=CRC32:c0cf0abd +packet|codec_type=audio|stream_index=1|pts=10495|pts_time=10.495000|dts=10495|dts_time=10.495000|duration=46|duration_time=0.046000|size=358|pos=414921|flags=K__|data_hash=CRC32:2e46c79f +packet|codec_type=video|stream_index=0|pts=10511|pts_time=10.511000|dts=10511|dts_time=10.511000|duration=33|duration_time=0.033000|size=614|pos=415296|flags=___|data_hash=CRC32:682066fb +packet|codec_type=audio|stream_index=1|pts=10542|pts_time=10.542000|dts=10542|dts_time=10.542000|duration=46|duration_time=0.046000|size=344|pos=415930|flags=K__|data_hash=CRC32:037d4b43 +packet|codec_type=video|stream_index=0|pts=10544|pts_time=10.544000|dts=10544|dts_time=10.544000|duration=33|duration_time=0.033000|size=1749|pos=416291|flags=___|data_hash=CRC32:09ab2b77 +packet|codec_type=video|stream_index=0|pts=10577|pts_time=10.577000|dts=10577|dts_time=10.577000|duration=33|duration_time=0.033000|size=2609|pos=418060|flags=___|data_hash=CRC32:3630dc54 +packet|codec_type=audio|stream_index=1|pts=10588|pts_time=10.588000|dts=10588|dts_time=10.588000|duration=46|duration_time=0.046000|size=344|pos=420689|flags=K__|data_hash=CRC32:73dfce6a +packet|codec_type=video|stream_index=0|pts=10611|pts_time=10.611000|dts=10611|dts_time=10.611000|duration=33|duration_time=0.033000|size=689|pos=421050|flags=___|data_hash=CRC32:6700928b +packet|codec_type=audio|stream_index=1|pts=10635|pts_time=10.635000|dts=10635|dts_time=10.635000|duration=46|duration_time=0.046000|size=356|pos=421759|flags=K__|data_hash=CRC32:5596b779 +packet|codec_type=video|stream_index=0|pts=10644|pts_time=10.644000|dts=10644|dts_time=10.644000|duration=33|duration_time=0.033000|size=2259|pos=422132|flags=___|data_hash=CRC32:264fcb3f +packet|codec_type=video|stream_index=0|pts=10677|pts_time=10.677000|dts=10677|dts_time=10.677000|duration=33|duration_time=0.033000|size=2494|pos=424411|flags=___|data_hash=CRC32:67753c81 +packet|codec_type=audio|stream_index=1|pts=10681|pts_time=10.681000|dts=10681|dts_time=10.681000|duration=46|duration_time=0.046000|size=354|pos=426925|flags=K__|data_hash=CRC32:3d7b1c0d +packet|codec_type=video|stream_index=0|pts=10711|pts_time=10.711000|dts=10711|dts_time=10.711000|duration=33|duration_time=0.033000|size=2457|pos=427296|flags=___|data_hash=CRC32:f02a3205 +packet|codec_type=audio|stream_index=1|pts=10728|pts_time=10.728000|dts=10728|dts_time=10.728000|duration=46|duration_time=0.046000|size=330|pos=429773|flags=K__|data_hash=CRC32:f9310cfe +packet|codec_type=video|stream_index=0|pts=10744|pts_time=10.744000|dts=10744|dts_time=10.744000|duration=33|duration_time=0.033000|size=2476|pos=430120|flags=___|data_hash=CRC32:eac06b3e +packet|codec_type=audio|stream_index=1|pts=10774|pts_time=10.774000|dts=10774|dts_time=10.774000|duration=46|duration_time=0.046000|size=328|pos=432616|flags=K__|data_hash=CRC32:9618f3ab +packet|codec_type=video|stream_index=0|pts=10777|pts_time=10.777000|dts=10777|dts_time=10.777000|duration=33|duration_time=0.033000|size=2560|pos=432961|flags=___|data_hash=CRC32:4c277ba1 +packet|codec_type=video|stream_index=0|pts=10811|pts_time=10.811000|dts=10811|dts_time=10.811000|duration=33|duration_time=0.033000|size=2679|pos=435541|flags=___|data_hash=CRC32:e070caf2 +packet|codec_type=audio|stream_index=1|pts=10820|pts_time=10.820000|dts=10820|dts_time=10.820000|duration=46|duration_time=0.046000|size=351|pos=438240|flags=K__|data_hash=CRC32:19bb5b6c +packet|codec_type=video|stream_index=0|pts=10844|pts_time=10.844000|dts=10844|dts_time=10.844000|duration=33|duration_time=0.033000|size=2795|pos=438608|flags=___|data_hash=CRC32:6642234c +packet|codec_type=audio|stream_index=1|pts=10867|pts_time=10.867000|dts=10867|dts_time=10.867000|duration=46|duration_time=0.046000|size=364|pos=441423|flags=K__|data_hash=CRC32:4dbd8e39 +packet|codec_type=video|stream_index=0|pts=10878|pts_time=10.878000|dts=10878|dts_time=10.878000|duration=33|duration_time=0.033000|size=2927|pos=441804|flags=___|data_hash=CRC32:0c7d6e1b +packet|codec_type=video|stream_index=0|pts=10911|pts_time=10.911000|dts=10911|dts_time=10.911000|duration=33|duration_time=0.033000|size=2437|pos=444751|flags=___|data_hash=CRC32:29100f02 +packet|codec_type=audio|stream_index=1|pts=10913|pts_time=10.913000|dts=10913|dts_time=10.913000|duration=46|duration_time=0.046000|size=365|pos=447208|flags=K__|data_hash=CRC32:f4732e1d +packet|codec_type=video|stream_index=0|pts=10944|pts_time=10.944000|dts=10944|dts_time=10.944000|duration=33|duration_time=0.033000|size=2663|pos=447590|flags=___|data_hash=CRC32:42a7b089 +packet|codec_type=audio|stream_index=1|pts=10960|pts_time=10.960000|dts=10960|dts_time=10.960000|duration=46|duration_time=0.046000|size=341|pos=450273|flags=K__|data_hash=CRC32:270d8e2f +packet|codec_type=video|stream_index=0|pts=10978|pts_time=10.978000|dts=10978|dts_time=10.978000|duration=33|duration_time=0.033000|size=2688|pos=450631|flags=___|data_hash=CRC32:e6b1e69d +packet|codec_type=audio|stream_index=1|pts=11006|pts_time=11.006000|dts=11006|dts_time=11.006000|duration=46|duration_time=0.046000|size=330|pos=453339|flags=K__|data_hash=CRC32:ffedf602 +packet|codec_type=video|stream_index=0|pts=11011|pts_time=11.011000|dts=11011|dts_time=11.011000|duration=33|duration_time=0.033000|size=2727|pos=453686|flags=___|data_hash=CRC32:0e15158e +packet|codec_type=video|stream_index=0|pts=11044|pts_time=11.044000|dts=11044|dts_time=11.044000|duration=33|duration_time=0.033000|size=2747|pos=456433|flags=___|data_hash=CRC32:5456aa57 +packet|codec_type=audio|stream_index=1|pts=11053|pts_time=11.053000|dts=11053|dts_time=11.053000|duration=46|duration_time=0.046000|size=358|pos=459200|flags=K__|data_hash=CRC32:cac56902 +packet|codec_type=video|stream_index=0|pts=11078|pts_time=11.078000|dts=11078|dts_time=11.078000|duration=33|duration_time=0.033000|size=3602|pos=459575|flags=___|data_hash=CRC32:a332e21c +packet|codec_type=audio|stream_index=1|pts=11099|pts_time=11.099000|dts=11099|dts_time=11.099000|duration=46|duration_time=0.046000|size=367|pos=463197|flags=K__|data_hash=CRC32:6e7f4f1d +packet|codec_type=video|stream_index=0|pts=11111|pts_time=11.111000|dts=11111|dts_time=11.111000|duration=33|duration_time=0.033000|size=1334|pos=463581|flags=___|data_hash=CRC32:5c4e2f6d +packet|codec_type=video|stream_index=0|pts=11144|pts_time=11.144000|dts=11144|dts_time=11.144000|duration=33|duration_time=0.033000|size=2562|pos=464935|flags=___|data_hash=CRC32:ebc7e2ca +packet|codec_type=audio|stream_index=1|pts=11146|pts_time=11.146000|dts=11146|dts_time=11.146000|duration=46|duration_time=0.046000|size=353|pos=467517|flags=K__|data_hash=CRC32:cfe498a5 +packet|codec_type=video|stream_index=0|pts=11178|pts_time=11.178000|dts=11178|dts_time=11.178000|duration=33|duration_time=0.033000|size=2917|pos=467887|flags=___|data_hash=CRC32:77f836e3 +packet|codec_type=audio|stream_index=1|pts=11192|pts_time=11.192000|dts=11192|dts_time=11.192000|duration=46|duration_time=0.046000|size=336|pos=470824|flags=K__|data_hash=CRC32:9ee13031 +packet|codec_type=video|stream_index=0|pts=11211|pts_time=11.211000|dts=11211|dts_time=11.211000|duration=33|duration_time=0.033000|size=2788|pos=471177|flags=___|data_hash=CRC32:79aa2cce +packet|codec_type=audio|stream_index=1|pts=11238|pts_time=11.238000|dts=11238|dts_time=11.238000|duration=46|duration_time=0.046000|size=329|pos=473985|flags=K__|data_hash=CRC32:86c3f096 +packet|codec_type=video|stream_index=0|pts=11245|pts_time=11.245000|dts=11245|dts_time=11.245000|duration=33|duration_time=0.033000|size=2876|pos=474331|flags=___|data_hash=CRC32:f71a01f7 +packet|codec_type=video|stream_index=0|pts=11278|pts_time=11.278000|dts=11278|dts_time=11.278000|duration=33|duration_time=0.033000|size=2782|pos=477227|flags=___|data_hash=CRC32:66c68a76 +packet|codec_type=audio|stream_index=1|pts=11285|pts_time=11.285000|dts=11285|dts_time=11.285000|duration=46|duration_time=0.046000|size=323|pos=480029|flags=K__|data_hash=CRC32:1e715e07 +packet|codec_type=video|stream_index=0|pts=11311|pts_time=11.311000|dts=11311|dts_time=11.311000|duration=33|duration_time=0.033000|size=2393|pos=480369|flags=___|data_hash=CRC32:ca824913 +packet|codec_type=audio|stream_index=1|pts=11331|pts_time=11.331000|dts=11331|dts_time=11.331000|duration=46|duration_time=0.046000|size=328|pos=482782|flags=K__|data_hash=CRC32:57b8fe27 +packet|codec_type=video|stream_index=0|pts=11345|pts_time=11.345000|dts=11345|dts_time=11.345000|duration=33|duration_time=0.033000|size=2773|pos=483127|flags=___|data_hash=CRC32:6bc9c9d7 +packet|codec_type=audio|stream_index=1|pts=11378|pts_time=11.378000|dts=11378|dts_time=11.378000|duration=46|duration_time=0.046000|size=345|pos=485920|flags=K__|data_hash=CRC32:95f244d4 +packet|codec_type=video|stream_index=0|pts=11378|pts_time=11.378000|dts=11378|dts_time=11.378000|duration=33|duration_time=0.033000|size=2972|pos=486282|flags=___|data_hash=CRC32:9fdef1d9 +packet|codec_type=video|stream_index=0|pts=11411|pts_time=11.411000|dts=11411|dts_time=11.411000|duration=33|duration_time=0.033000|size=3480|pos=489274|flags=___|data_hash=CRC32:977f9784 +packet|codec_type=audio|stream_index=1|pts=11424|pts_time=11.424000|dts=11424|dts_time=11.424000|duration=46|duration_time=0.046000|size=345|pos=492774|flags=K__|data_hash=CRC32:9c69a0dc +packet|codec_type=video|stream_index=0|pts=11445|pts_time=11.445000|dts=11445|dts_time=11.445000|duration=33|duration_time=0.033000|size=1078|pos=493136|flags=___|data_hash=CRC32:4a479a66 +packet|codec_type=audio|stream_index=1|pts=11471|pts_time=11.471000|dts=11471|dts_time=11.471000|duration=46|duration_time=0.046000|size=349|pos=494234|flags=K__|data_hash=CRC32:0fcb70ef +packet|codec_type=video|stream_index=0|pts=11478|pts_time=11.478000|dts=11478|dts_time=11.478000|duration=33|duration_time=0.033000|size=3385|pos=494600|flags=___|data_hash=CRC32:f1d76112 +packet|codec_type=video|stream_index=0|pts=11512|pts_time=11.512000|dts=11512|dts_time=11.512000|duration=33|duration_time=0.033000|size=1408|pos=498005|flags=___|data_hash=CRC32:12165420 +packet|codec_type=audio|stream_index=1|pts=11517|pts_time=11.517000|dts=11517|dts_time=11.517000|duration=46|duration_time=0.046000|size=340|pos=499433|flags=K__|data_hash=CRC32:e867c459 +packet|codec_type=video|stream_index=0|pts=11545|pts_time=11.545000|dts=11545|dts_time=11.545000|duration=33|duration_time=0.033000|size=2543|pos=499790|flags=___|data_hash=CRC32:d3803831 +packet|codec_type=audio|stream_index=1|pts=11564|pts_time=11.564000|dts=11564|dts_time=11.564000|duration=46|duration_time=0.046000|size=352|pos=502353|flags=K__|data_hash=CRC32:029632be +packet|codec_type=video|stream_index=0|pts=11578|pts_time=11.578000|dts=11578|dts_time=11.578000|duration=33|duration_time=0.033000|size=3609|pos=502722|flags=___|data_hash=CRC32:ebd09926 +packet|codec_type=audio|stream_index=1|pts=11610|pts_time=11.610000|dts=11610|dts_time=11.610000|duration=46|duration_time=0.046000|size=345|pos=506351|flags=K__|data_hash=CRC32:8374b7c9 +packet|codec_type=video|stream_index=0|pts=11612|pts_time=11.612000|dts=11612|dts_time=11.612000|duration=33|duration_time=0.033000|size=1078|pos=506713|flags=___|data_hash=CRC32:96db1ff7 +packet|codec_type=video|stream_index=0|pts=11645|pts_time=11.645000|dts=11645|dts_time=11.645000|duration=33|duration_time=0.033000|size=2600|pos=507811|flags=___|data_hash=CRC32:d35f9e6f +packet|codec_type=audio|stream_index=1|pts=11656|pts_time=11.656000|dts=11656|dts_time=11.656000|duration=46|duration_time=0.046000|size=346|pos=510431|flags=K__|data_hash=CRC32:4e6b44cb +packet|codec_type=video|stream_index=0|pts=11678|pts_time=11.678000|dts=11678|dts_time=11.678000|duration=33|duration_time=0.033000|size=1190|pos=510794|flags=__C|data_hash=CRC32:a0206c90 stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|width=426|height=240|coded_width=426|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=1|sample_aspect_ratio=1:1|display_aspect_ratio=71:40|pix_fmt=yuv420p|level=21|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=true|nal_length_size=4|id=N/A|r_frame_rate=30000/1001|avg_frame_rate=30/1|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=393929|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=351|extradata_size=39|extradata_hash=CRC32:07b85ca9|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 -stream|index=1|codec_name=aac|profile=1|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=22050|channels=2|channel_layout=stereo|bits_per_sample=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=67874|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=252|extradata_size=2|extradata_hash=CRC32:d039c029|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 +stream|index=1|codec_name=aac|profile=1|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=22050|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=67874|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=252|extradata_size=2|extradata_hash=CRC32:d039c029|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 format|filename=Enigma_Principles_of_Lust-part.flv|nb_streams=2|nb_programs=0|format_name=flv|start_time=0.000000|duration=210.209999|size=512000|bit_rate=19485|probe_score=100|tag:hasKeyframes=true|tag:hasMetadata=true|tag:datasize=11970544|tag:hasVideo=true|tag:canSeekToEnd=false|tag:lasttimestamp=210|tag:lastkeyframetimestamp=210|tag:audiosize=1791332|tag:hasAudio=true|tag:audiodelay=0|tag:videosize=10176110|tag:metadatadate=2011-02-27T11:00:33.125000Z|tag:metadatacreator=inlet media FLVTool2 v1.0.6 - http://www.inlet-media.de/flvtool2|tag:hasCuePoints=false diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-itunes-to-ipod-aac mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-itunes-to-ipod-aac --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-itunes-to-ipod-aac 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-itunes-to-ipod-aac 2023-03-03 13:29:59.000000000 +0000 @@ -5,24 +5,24 @@ [/STREAM] [FORMAT] start_time=0.000000 -duration=2.344000 +duration=2.342993 [/FORMAT] -packet|pts=-1024|dts=-1024|duration=1024|flags=KD|side_data| +packet|pts=-1024|dts=-1024|duration=1024|flags=KD_|side_data| -packet|pts=0|dts=0|duration=1024|flags=K_ -packet|pts=1024|dts=1024|duration=1024|flags=K_ -packet|pts=2048|dts=2048|duration=1024|flags=K_ -packet|pts=3072|dts=3072|duration=1024|flags=K_ -packet|pts=4096|dts=4096|duration=1024|flags=K_ -packet|pts=5120|dts=5120|duration=1024|flags=K_ -packet|pts=95232|dts=95232|duration=1024|flags=K_ -packet|pts=96256|dts=96256|duration=1024|flags=K_ -packet|pts=97280|dts=97280|duration=1024|flags=K_ -packet|pts=98304|dts=98304|duration=1024|flags=K_ -packet|pts=99328|dts=99328|duration=1024|flags=K_ -packet|pts=100352|dts=100352|duration=1024|flags=K_ -packet|pts=101376|dts=101376|duration=1024|flags=K_ -packet|pts=102400|dts=102400|duration=926|flags=K_ +packet|pts=0|dts=0|duration=1024|flags=K__ +packet|pts=1024|dts=1024|duration=1024|flags=K__ +packet|pts=2048|dts=2048|duration=1024|flags=K__ +packet|pts=3072|dts=3072|duration=1024|flags=K__ +packet|pts=4096|dts=4096|duration=1024|flags=K__ +packet|pts=5120|dts=5120|duration=1024|flags=K__ +packet|pts=95232|dts=95232|duration=1024|flags=K__ +packet|pts=96256|dts=96256|duration=1024|flags=K__ +packet|pts=97280|dts=97280|duration=1024|flags=K__ +packet|pts=98304|dts=98304|duration=1024|flags=K__ +packet|pts=99328|dts=99328|duration=1024|flags=K__ +packet|pts=100352|dts=100352|duration=1024|flags=K__ +packet|pts=101376|dts=101376|duration=1024|flags=K__ +packet|pts=102400|dts=102400|duration=926|flags=K__ stream|nb_read_packets=102 frame|pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024 frame|pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-pcm-to-mov-aac mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-pcm-to-mov-aac --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-pcm-to-mov-aac 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessenc-pcm-to-mov-aac 2023-03-03 13:29:59.000000000 +0000 @@ -7,22 +7,22 @@ start_time=0.000000 duration=12.000000 [/FORMAT] -packet|pts=-1024|dts=-1024|duration=1024|flags=KD|side_data| +packet|pts=-1024|dts=-1024|duration=1024|flags=KD_|side_data| -packet|pts=0|dts=0|duration=1024|flags=K_ -packet|pts=1024|dts=1024|duration=1024|flags=K_ -packet|pts=2048|dts=2048|duration=1024|flags=K_ -packet|pts=3072|dts=3072|duration=1024|flags=K_ -packet|pts=4096|dts=4096|duration=1024|flags=K_ -packet|pts=5120|dts=5120|duration=1024|flags=K_ -packet|pts=521216|dts=521216|duration=1024|flags=K_ -packet|pts=522240|dts=522240|duration=1024|flags=K_ -packet|pts=523264|dts=523264|duration=1024|flags=K_ -packet|pts=524288|dts=524288|duration=1024|flags=K_ -packet|pts=525312|dts=525312|duration=1024|flags=K_ -packet|pts=526336|dts=526336|duration=1024|flags=K_ -packet|pts=527360|dts=527360|duration=1024|flags=K_ -packet|pts=528384|dts=528384|duration=816|flags=K_ +packet|pts=0|dts=0|duration=1024|flags=K__ +packet|pts=1024|dts=1024|duration=1024|flags=K__ +packet|pts=2048|dts=2048|duration=1024|flags=K__ +packet|pts=3072|dts=3072|duration=1024|flags=K__ +packet|pts=4096|dts=4096|duration=1024|flags=K__ +packet|pts=5120|dts=5120|duration=1024|flags=K__ +packet|pts=521216|dts=521216|duration=1024|flags=K__ +packet|pts=522240|dts=522240|duration=1024|flags=K__ +packet|pts=523264|dts=523264|duration=1024|flags=K__ +packet|pts=524288|dts=524288|duration=1024|flags=K__ +packet|pts=525312|dts=525312|duration=1024|flags=K__ +packet|pts=526336|dts=526336|duration=1024|flags=K__ +packet|pts=527360|dts=527360|duration=1024|flags=K__ +packet|pts=528384|dts=528384|duration=816|flags=K__ stream|nb_read_packets=518 frame|pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024 frame|pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes1 2023-03-03 13:29:59.000000000 +0000 @@ -7,22 +7,22 @@ start_time=0.047889 duration=29.350023 [/FORMAT] -packet|pts=0|dts=0|duration=1024|flags=K_|side_data| +packet|pts=0|dts=0|duration=1024|flags=K__|side_data| -packet|pts=1024|dts=1024|duration=1024|flags=K_ -packet|pts=2048|dts=2048|duration=1024|flags=K_ -packet|pts=3072|dts=3072|duration=1024|flags=K_ -packet|pts=4096|dts=4096|duration=1024|flags=K_ -packet|pts=5120|dts=5120|duration=1024|flags=K_ -packet|pts=6144|dts=6144|duration=1024|flags=K_ -packet|pts=1286144|dts=1286144|duration=1024|flags=K_ -packet|pts=1287168|dts=1287168|duration=1024|flags=K_ -packet|pts=1288192|dts=1288192|duration=1024|flags=K_ -packet|pts=1289216|dts=1289216|duration=1024|flags=K_ -packet|pts=1290240|dts=1290240|duration=1024|flags=K_ -packet|pts=1291264|dts=1291264|duration=1024|flags=K_ -packet|pts=1292288|dts=1292288|duration=1024|flags=K_ -packet|pts=1293312|dts=1293312|duration=1024|flags=K_ +packet|pts=1024|dts=1024|duration=1024|flags=K__ +packet|pts=2048|dts=2048|duration=1024|flags=K__ +packet|pts=3072|dts=3072|duration=1024|flags=K__ +packet|pts=4096|dts=4096|duration=1024|flags=K__ +packet|pts=5120|dts=5120|duration=1024|flags=K__ +packet|pts=6144|dts=6144|duration=1024|flags=K__ +packet|pts=1286144|dts=1286144|duration=1024|flags=K__ +packet|pts=1287168|dts=1287168|duration=1024|flags=K__ +packet|pts=1288192|dts=1288192|duration=1024|flags=K__ +packet|pts=1289216|dts=1289216|duration=1024|flags=K__ +packet|pts=1290240|dts=1290240|duration=1024|flags=K__ +packet|pts=1291264|dts=1291264|duration=1024|flags=K__ +packet|pts=1292288|dts=1292288|duration=1024|flags=K__ +packet|pts=1293312|dts=1293312|duration=1024|flags=K__ stream|nb_read_packets=1264 frame|pts=2112|pkt_dts=2112|best_effort_timestamp=2112|pkt_duration=960|nb_samples=960 frame|pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_samples=1024 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gaplessinfo-itunes2 2023-03-03 13:29:59.000000000 +0000 @@ -7,22 +7,22 @@ start_time=0.047891 duration=2.391655 [/FORMAT] -packet|pts=0|dts=0|duration=1024|flags=K_|side_data| +packet|pts=0|dts=0|duration=1024|flags=K__|side_data| -packet|pts=1024|dts=1024|duration=1024|flags=K_ -packet|pts=2048|dts=2048|duration=1024|flags=K_ -packet|pts=3072|dts=3072|duration=1024|flags=K_ -packet|pts=4096|dts=4096|duration=1024|flags=K_ -packet|pts=5120|dts=5120|duration=1024|flags=K_ -packet|pts=6144|dts=6144|duration=1024|flags=K_ -packet|pts=97280|dts=97280|duration=1024|flags=K_ -packet|pts=98304|dts=98304|duration=1024|flags=K_ -packet|pts=99328|dts=99328|duration=1024|flags=K_ -packet|pts=100352|dts=100352|duration=1024|flags=K_ -packet|pts=101376|dts=101376|duration=1024|flags=K_ -packet|pts=102400|dts=102400|duration=1024|flags=K_ -packet|pts=103424|dts=103424|duration=1024|flags=K_ -packet|pts=104448|dts=104448|duration=1024|flags=K_ +packet|pts=1024|dts=1024|duration=1024|flags=K__ +packet|pts=2048|dts=2048|duration=1024|flags=K__ +packet|pts=3072|dts=3072|duration=1024|flags=K__ +packet|pts=4096|dts=4096|duration=1024|flags=K__ +packet|pts=5120|dts=5120|duration=1024|flags=K__ +packet|pts=6144|dts=6144|duration=1024|flags=K__ +packet|pts=97280|dts=97280|duration=1024|flags=K__ +packet|pts=98304|dts=98304|duration=1024|flags=K__ +packet|pts=99328|dts=99328|duration=1024|flags=K__ +packet|pts=100352|dts=100352|duration=1024|flags=K__ +packet|pts=101376|dts=101376|duration=1024|flags=K__ +packet|pts=102400|dts=102400|duration=1024|flags=K__ +packet|pts=103424|dts=103424|duration=1024|flags=K__ +packet|pts=104448|dts=104448|duration=1024|flags=K__ stream|nb_read_packets=103 frame|pts=2112|pkt_dts=2112|best_effort_timestamp=2112|pkt_duration=960|nb_samples=960 frame|pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_samples=1024 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gapless-mp3-side-data mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gapless-mp3-side-data --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gapless-mp3-side-data 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/gapless-mp3-side-data 2023-03-03 13:29:59.000000000 +0000 @@ -1,600 +1,600 @@ -packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=368640|duration_time=0.026122|size=417|pos=1451|flags=K_|side_data|side_data_type=Skip Samples|skip_samples=1105|discard_padding=0|skip_reason=0|discard_reason=0 -|data_hash=CRC32:ae0a5066 -packet|codec_type=audio|stream_index=0|pts=368640|pts_time=0.026122|dts=368640|dts_time=0.026122|duration=368640|duration_time=0.026122|size=418|pos=1868|flags=K_|data_hash=CRC32:dbb7aa6c -packet|codec_type=audio|stream_index=0|pts=737280|pts_time=0.052245|dts=737280|dts_time=0.052245|duration=368640|duration_time=0.026122|size=418|pos=2286|flags=K_|data_hash=CRC32:5fe9fd6b -packet|codec_type=audio|stream_index=0|pts=1105920|pts_time=0.078367|dts=1105920|dts_time=0.078367|duration=368640|duration_time=0.026122|size=418|pos=2704|flags=K_|data_hash=CRC32:baec14f8 -packet|codec_type=audio|stream_index=0|pts=1474560|pts_time=0.104490|dts=1474560|dts_time=0.104490|duration=368640|duration_time=0.026122|size=418|pos=3122|flags=K_|data_hash=CRC32:9916a4cf -packet|codec_type=audio|stream_index=0|pts=1843200|pts_time=0.130612|dts=1843200|dts_time=0.130612|duration=368640|duration_time=0.026122|size=418|pos=3540|flags=K_|data_hash=CRC32:a5897354 -packet|codec_type=audio|stream_index=0|pts=2211840|pts_time=0.156735|dts=2211840|dts_time=0.156735|duration=368640|duration_time=0.026122|size=418|pos=3958|flags=K_|data_hash=CRC32:3b3bd4e1 -packet|codec_type=audio|stream_index=0|pts=2580480|pts_time=0.182857|dts=2580480|dts_time=0.182857|duration=368640|duration_time=0.026122|size=418|pos=4376|flags=K_|data_hash=CRC32:5a319d96 -packet|codec_type=audio|stream_index=0|pts=2949120|pts_time=0.208980|dts=2949120|dts_time=0.208980|duration=368640|duration_time=0.026122|size=418|pos=4794|flags=K_|data_hash=CRC32:c62a20be -packet|codec_type=audio|stream_index=0|pts=3317760|pts_time=0.235102|dts=3317760|dts_time=0.235102|duration=368640|duration_time=0.026122|size=418|pos=5212|flags=K_|data_hash=CRC32:233edc53 -packet|codec_type=audio|stream_index=0|pts=3686400|pts_time=0.261224|dts=3686400|dts_time=0.261224|duration=368640|duration_time=0.026122|size=418|pos=5630|flags=K_|data_hash=CRC32:62ff9ae2 -packet|codec_type=audio|stream_index=0|pts=4055040|pts_time=0.287347|dts=4055040|dts_time=0.287347|duration=368640|duration_time=0.026122|size=418|pos=6048|flags=K_|data_hash=CRC32:de77ed5e -packet|codec_type=audio|stream_index=0|pts=4423680|pts_time=0.313469|dts=4423680|dts_time=0.313469|duration=368640|duration_time=0.026122|size=418|pos=6466|flags=K_|data_hash=CRC32:1ea533a1 -packet|codec_type=audio|stream_index=0|pts=4792320|pts_time=0.339592|dts=4792320|dts_time=0.339592|duration=368640|duration_time=0.026122|size=418|pos=6884|flags=K_|data_hash=CRC32:b5b48e4b -packet|codec_type=audio|stream_index=0|pts=5160960|pts_time=0.365714|dts=5160960|dts_time=0.365714|duration=368640|duration_time=0.026122|size=418|pos=7302|flags=K_|data_hash=CRC32:afdcd44b -packet|codec_type=audio|stream_index=0|pts=5529600|pts_time=0.391837|dts=5529600|dts_time=0.391837|duration=368640|duration_time=0.026122|size=418|pos=7720|flags=K_|data_hash=CRC32:10038cf1 -packet|codec_type=audio|stream_index=0|pts=5898240|pts_time=0.417959|dts=5898240|dts_time=0.417959|duration=368640|duration_time=0.026122|size=418|pos=8138|flags=K_|data_hash=CRC32:0d72e0e3 -packet|codec_type=audio|stream_index=0|pts=6266880|pts_time=0.444082|dts=6266880|dts_time=0.444082|duration=368640|duration_time=0.026122|size=418|pos=8556|flags=K_|data_hash=CRC32:7919c1eb -packet|codec_type=audio|stream_index=0|pts=6635520|pts_time=0.470204|dts=6635520|dts_time=0.470204|duration=368640|duration_time=0.026122|size=418|pos=8974|flags=K_|data_hash=CRC32:95549eee -packet|codec_type=audio|stream_index=0|pts=7004160|pts_time=0.496327|dts=7004160|dts_time=0.496327|duration=368640|duration_time=0.026122|size=418|pos=9392|flags=K_|data_hash=CRC32:d8d5c005 -packet|codec_type=audio|stream_index=0|pts=7372800|pts_time=0.522449|dts=7372800|dts_time=0.522449|duration=368640|duration_time=0.026122|size=418|pos=9810|flags=K_|data_hash=CRC32:09a9254b -packet|codec_type=audio|stream_index=0|pts=7741440|pts_time=0.548571|dts=7741440|dts_time=0.548571|duration=368640|duration_time=0.026122|size=418|pos=10228|flags=K_|data_hash=CRC32:29cc7956 -packet|codec_type=audio|stream_index=0|pts=8110080|pts_time=0.574694|dts=8110080|dts_time=0.574694|duration=368640|duration_time=0.026122|size=418|pos=10646|flags=K_|data_hash=CRC32:cb439791 -packet|codec_type=audio|stream_index=0|pts=8478720|pts_time=0.600816|dts=8478720|dts_time=0.600816|duration=368640|duration_time=0.026122|size=418|pos=11064|flags=K_|data_hash=CRC32:7784025b -packet|codec_type=audio|stream_index=0|pts=8847360|pts_time=0.626939|dts=8847360|dts_time=0.626939|duration=368640|duration_time=0.026122|size=418|pos=11482|flags=K_|data_hash=CRC32:ad6d75d3 -packet|codec_type=audio|stream_index=0|pts=9216000|pts_time=0.653061|dts=9216000|dts_time=0.653061|duration=368640|duration_time=0.026122|size=417|pos=11900|flags=K_|data_hash=CRC32:081e0b41 -packet|codec_type=audio|stream_index=0|pts=9584640|pts_time=0.679184|dts=9584640|dts_time=0.679184|duration=368640|duration_time=0.026122|size=418|pos=12317|flags=K_|data_hash=CRC32:3c8c1e54 -packet|codec_type=audio|stream_index=0|pts=9953280|pts_time=0.705306|dts=9953280|dts_time=0.705306|duration=368640|duration_time=0.026122|size=418|pos=12735|flags=K_|data_hash=CRC32:58dea5a2 -packet|codec_type=audio|stream_index=0|pts=10321920|pts_time=0.731429|dts=10321920|dts_time=0.731429|duration=368640|duration_time=0.026122|size=418|pos=13153|flags=K_|data_hash=CRC32:d56daa18 -packet|codec_type=audio|stream_index=0|pts=10690560|pts_time=0.757551|dts=10690560|dts_time=0.757551|duration=368640|duration_time=0.026122|size=418|pos=13571|flags=K_|data_hash=CRC32:ab2b2c48 -packet|codec_type=audio|stream_index=0|pts=11059200|pts_time=0.783673|dts=11059200|dts_time=0.783673|duration=368640|duration_time=0.026122|size=418|pos=13989|flags=K_|data_hash=CRC32:52467934 -packet|codec_type=audio|stream_index=0|pts=11427840|pts_time=0.809796|dts=11427840|dts_time=0.809796|duration=368640|duration_time=0.026122|size=418|pos=14407|flags=K_|data_hash=CRC32:2e8e22fc -packet|codec_type=audio|stream_index=0|pts=11796480|pts_time=0.835918|dts=11796480|dts_time=0.835918|duration=368640|duration_time=0.026122|size=418|pos=14825|flags=K_|data_hash=CRC32:2432d9df -packet|codec_type=audio|stream_index=0|pts=12165120|pts_time=0.862041|dts=12165120|dts_time=0.862041|duration=368640|duration_time=0.026122|size=418|pos=15243|flags=K_|data_hash=CRC32:623666e1 -packet|codec_type=audio|stream_index=0|pts=12533760|pts_time=0.888163|dts=12533760|dts_time=0.888163|duration=368640|duration_time=0.026122|size=418|pos=15661|flags=K_|data_hash=CRC32:7efdc60c -packet|codec_type=audio|stream_index=0|pts=12902400|pts_time=0.914286|dts=12902400|dts_time=0.914286|duration=368640|duration_time=0.026122|size=418|pos=16079|flags=K_|data_hash=CRC32:22e96068 -packet|codec_type=audio|stream_index=0|pts=13271040|pts_time=0.940408|dts=13271040|dts_time=0.940408|duration=368640|duration_time=0.026122|size=418|pos=16497|flags=K_|data_hash=CRC32:544c1b78 -packet|codec_type=audio|stream_index=0|pts=13639680|pts_time=0.966531|dts=13639680|dts_time=0.966531|duration=368640|duration_time=0.026122|size=418|pos=16915|flags=K_|data_hash=CRC32:e9413152 -packet|codec_type=audio|stream_index=0|pts=14008320|pts_time=0.992653|dts=14008320|dts_time=0.992653|duration=368640|duration_time=0.026122|size=418|pos=17333|flags=K_|data_hash=CRC32:f1737ca4 -packet|codec_type=audio|stream_index=0|pts=14376960|pts_time=1.018776|dts=14376960|dts_time=1.018776|duration=368640|duration_time=0.026122|size=418|pos=17751|flags=K_|data_hash=CRC32:31f7139f -packet|codec_type=audio|stream_index=0|pts=14745600|pts_time=1.044898|dts=14745600|dts_time=1.044898|duration=368640|duration_time=0.026122|size=418|pos=18169|flags=K_|data_hash=CRC32:f330de95 -packet|codec_type=audio|stream_index=0|pts=15114240|pts_time=1.071020|dts=15114240|dts_time=1.071020|duration=368640|duration_time=0.026122|size=418|pos=18587|flags=K_|data_hash=CRC32:6ea0d79f -packet|codec_type=audio|stream_index=0|pts=15482880|pts_time=1.097143|dts=15482880|dts_time=1.097143|duration=368640|duration_time=0.026122|size=418|pos=19005|flags=K_|data_hash=CRC32:cd141c49 -packet|codec_type=audio|stream_index=0|pts=15851520|pts_time=1.123265|dts=15851520|dts_time=1.123265|duration=368640|duration_time=0.026122|size=418|pos=19423|flags=K_|data_hash=CRC32:45c367a6 -packet|codec_type=audio|stream_index=0|pts=16220160|pts_time=1.149388|dts=16220160|dts_time=1.149388|duration=368640|duration_time=0.026122|size=418|pos=19841|flags=K_|data_hash=CRC32:cd89cd56 -packet|codec_type=audio|stream_index=0|pts=16588800|pts_time=1.175510|dts=16588800|dts_time=1.175510|duration=368640|duration_time=0.026122|size=418|pos=20259|flags=K_|data_hash=CRC32:a293ff84 -packet|codec_type=audio|stream_index=0|pts=16957440|pts_time=1.201633|dts=16957440|dts_time=1.201633|duration=368640|duration_time=0.026122|size=418|pos=20677|flags=K_|data_hash=CRC32:a3c6725e -packet|codec_type=audio|stream_index=0|pts=17326080|pts_time=1.227755|dts=17326080|dts_time=1.227755|duration=368640|duration_time=0.026122|size=418|pos=21095|flags=K_|data_hash=CRC32:be091252 -packet|codec_type=audio|stream_index=0|pts=17694720|pts_time=1.253878|dts=17694720|dts_time=1.253878|duration=368640|duration_time=0.026122|size=418|pos=21513|flags=K_|data_hash=CRC32:a5135f75 -packet|codec_type=audio|stream_index=0|pts=18063360|pts_time=1.280000|dts=18063360|dts_time=1.280000|duration=368640|duration_time=0.026122|size=417|pos=21931|flags=K_|data_hash=CRC32:8225dd66 -packet|codec_type=audio|stream_index=0|pts=18432000|pts_time=1.306122|dts=18432000|dts_time=1.306122|duration=368640|duration_time=0.026122|size=418|pos=22348|flags=K_|data_hash=CRC32:7b1db59c -packet|codec_type=audio|stream_index=0|pts=18800640|pts_time=1.332245|dts=18800640|dts_time=1.332245|duration=368640|duration_time=0.026122|size=418|pos=22766|flags=K_|data_hash=CRC32:e5897689 -packet|codec_type=audio|stream_index=0|pts=19169280|pts_time=1.358367|dts=19169280|dts_time=1.358367|duration=368640|duration_time=0.026122|size=418|pos=23184|flags=K_|data_hash=CRC32:94929aa7 -packet|codec_type=audio|stream_index=0|pts=19537920|pts_time=1.384490|dts=19537920|dts_time=1.384490|duration=368640|duration_time=0.026122|size=418|pos=23602|flags=K_|data_hash=CRC32:65697a12 -packet|codec_type=audio|stream_index=0|pts=19906560|pts_time=1.410612|dts=19906560|dts_time=1.410612|duration=368640|duration_time=0.026122|size=418|pos=24020|flags=K_|data_hash=CRC32:18f69ad3 -packet|codec_type=audio|stream_index=0|pts=20275200|pts_time=1.436735|dts=20275200|dts_time=1.436735|duration=368640|duration_time=0.026122|size=418|pos=24438|flags=K_|data_hash=CRC32:47ab41f0 -packet|codec_type=audio|stream_index=0|pts=20643840|pts_time=1.462857|dts=20643840|dts_time=1.462857|duration=368640|duration_time=0.026122|size=418|pos=24856|flags=K_|data_hash=CRC32:75879cf2 -packet|codec_type=audio|stream_index=0|pts=21012480|pts_time=1.488980|dts=21012480|dts_time=1.488980|duration=368640|duration_time=0.026122|size=418|pos=25274|flags=K_|data_hash=CRC32:d43c0882 -packet|codec_type=audio|stream_index=0|pts=21381120|pts_time=1.515102|dts=21381120|dts_time=1.515102|duration=368640|duration_time=0.026122|size=418|pos=25692|flags=K_|data_hash=CRC32:3b9a22da -packet|codec_type=audio|stream_index=0|pts=21749760|pts_time=1.541224|dts=21749760|dts_time=1.541224|duration=368640|duration_time=0.026122|size=418|pos=26110|flags=K_|data_hash=CRC32:ec698fec -packet|codec_type=audio|stream_index=0|pts=22118400|pts_time=1.567347|dts=22118400|dts_time=1.567347|duration=368640|duration_time=0.026122|size=418|pos=26528|flags=K_|data_hash=CRC32:ca99d2c0 -packet|codec_type=audio|stream_index=0|pts=22487040|pts_time=1.593469|dts=22487040|dts_time=1.593469|duration=368640|duration_time=0.026122|size=418|pos=26946|flags=K_|data_hash=CRC32:fa370e06 -packet|codec_type=audio|stream_index=0|pts=22855680|pts_time=1.619592|dts=22855680|dts_time=1.619592|duration=368640|duration_time=0.026122|size=418|pos=27364|flags=K_|data_hash=CRC32:9522fdd4 -packet|codec_type=audio|stream_index=0|pts=23224320|pts_time=1.645714|dts=23224320|dts_time=1.645714|duration=368640|duration_time=0.026122|size=418|pos=27782|flags=K_|data_hash=CRC32:d6bd9ba4 -packet|codec_type=audio|stream_index=0|pts=23592960|pts_time=1.671837|dts=23592960|dts_time=1.671837|duration=368640|duration_time=0.026122|size=418|pos=28200|flags=K_|data_hash=CRC32:f4689266 -packet|codec_type=audio|stream_index=0|pts=23961600|pts_time=1.697959|dts=23961600|dts_time=1.697959|duration=368640|duration_time=0.026122|size=418|pos=28618|flags=K_|data_hash=CRC32:ea1aaa66 -packet|codec_type=audio|stream_index=0|pts=24330240|pts_time=1.724082|dts=24330240|dts_time=1.724082|duration=368640|duration_time=0.026122|size=418|pos=29036|flags=K_|data_hash=CRC32:fb547f37 -packet|codec_type=audio|stream_index=0|pts=24698880|pts_time=1.750204|dts=24698880|dts_time=1.750204|duration=368640|duration_time=0.026122|size=418|pos=29454|flags=K_|data_hash=CRC32:78f84f3f -packet|codec_type=audio|stream_index=0|pts=25067520|pts_time=1.776327|dts=25067520|dts_time=1.776327|duration=368640|duration_time=0.026122|size=418|pos=29872|flags=K_|data_hash=CRC32:db07bf11 -packet|codec_type=audio|stream_index=0|pts=25436160|pts_time=1.802449|dts=25436160|dts_time=1.802449|duration=368640|duration_time=0.026122|size=418|pos=30290|flags=K_|data_hash=CRC32:77bb035b -packet|codec_type=audio|stream_index=0|pts=25804800|pts_time=1.828571|dts=25804800|dts_time=1.828571|duration=368640|duration_time=0.026122|size=418|pos=30708|flags=K_|data_hash=CRC32:23378de7 -packet|codec_type=audio|stream_index=0|pts=26173440|pts_time=1.854694|dts=26173440|dts_time=1.854694|duration=368640|duration_time=0.026122|size=418|pos=31126|flags=K_|data_hash=CRC32:17e3e719 -packet|codec_type=audio|stream_index=0|pts=26542080|pts_time=1.880816|dts=26542080|dts_time=1.880816|duration=368640|duration_time=0.026122|size=418|pos=31544|flags=K_|data_hash=CRC32:b33797de -packet|codec_type=audio|stream_index=0|pts=26910720|pts_time=1.906939|dts=26910720|dts_time=1.906939|duration=368640|duration_time=0.026122|size=418|pos=31962|flags=K_|data_hash=CRC32:d585f179 -packet|codec_type=audio|stream_index=0|pts=27279360|pts_time=1.933061|dts=27279360|dts_time=1.933061|duration=368640|duration_time=0.026122|size=417|pos=32380|flags=K_|data_hash=CRC32:469f8f74 -packet|codec_type=audio|stream_index=0|pts=27648000|pts_time=1.959184|dts=27648000|dts_time=1.959184|duration=368640|duration_time=0.026122|size=418|pos=32797|flags=K_|data_hash=CRC32:fd53cf2f -packet|codec_type=audio|stream_index=0|pts=28016640|pts_time=1.985306|dts=28016640|dts_time=1.985306|duration=368640|duration_time=0.026122|size=418|pos=33215|flags=K_|data_hash=CRC32:5a37e9ae -packet|codec_type=audio|stream_index=0|pts=28385280|pts_time=2.011429|dts=28385280|dts_time=2.011429|duration=368640|duration_time=0.026122|size=418|pos=33633|flags=K_|data_hash=CRC32:123bf9d4 -packet|codec_type=audio|stream_index=0|pts=28753920|pts_time=2.037551|dts=28753920|dts_time=2.037551|duration=368640|duration_time=0.026122|size=418|pos=34051|flags=K_|data_hash=CRC32:a3d4074d -packet|codec_type=audio|stream_index=0|pts=29122560|pts_time=2.063673|dts=29122560|dts_time=2.063673|duration=368640|duration_time=0.026122|size=418|pos=34469|flags=K_|data_hash=CRC32:d79d5351 -packet|codec_type=audio|stream_index=0|pts=29491200|pts_time=2.089796|dts=29491200|dts_time=2.089796|duration=368640|duration_time=0.026122|size=418|pos=34887|flags=K_|data_hash=CRC32:d9a54e49 -packet|codec_type=audio|stream_index=0|pts=29859840|pts_time=2.115918|dts=29859840|dts_time=2.115918|duration=368640|duration_time=0.026122|size=418|pos=35305|flags=K_|data_hash=CRC32:e3f6826f -packet|codec_type=audio|stream_index=0|pts=30228480|pts_time=2.142041|dts=30228480|dts_time=2.142041|duration=368640|duration_time=0.026122|size=418|pos=35723|flags=K_|data_hash=CRC32:2ab209b1 -packet|codec_type=audio|stream_index=0|pts=30597120|pts_time=2.168163|dts=30597120|dts_time=2.168163|duration=368640|duration_time=0.026122|size=418|pos=36141|flags=K_|data_hash=CRC32:bec119c0 -packet|codec_type=audio|stream_index=0|pts=30965760|pts_time=2.194286|dts=30965760|dts_time=2.194286|duration=368640|duration_time=0.026122|size=418|pos=36559|flags=K_|data_hash=CRC32:5e3e13bf -packet|codec_type=audio|stream_index=0|pts=31334400|pts_time=2.220408|dts=31334400|dts_time=2.220408|duration=368640|duration_time=0.026122|size=418|pos=36977|flags=K_|data_hash=CRC32:b725b85c -packet|codec_type=audio|stream_index=0|pts=31703040|pts_time=2.246531|dts=31703040|dts_time=2.246531|duration=368640|duration_time=0.026122|size=418|pos=37395|flags=K_|data_hash=CRC32:e650f974 -packet|codec_type=audio|stream_index=0|pts=32071680|pts_time=2.272653|dts=32071680|dts_time=2.272653|duration=368640|duration_time=0.026122|size=418|pos=37813|flags=K_|data_hash=CRC32:6edc5628 -packet|codec_type=audio|stream_index=0|pts=32440320|pts_time=2.298776|dts=32440320|dts_time=2.298776|duration=368640|duration_time=0.026122|size=418|pos=38231|flags=K_|data_hash=CRC32:37adc162 -packet|codec_type=audio|stream_index=0|pts=32808960|pts_time=2.324898|dts=32808960|dts_time=2.324898|duration=368640|duration_time=0.026122|size=418|pos=38649|flags=K_|data_hash=CRC32:a4b7042e -packet|codec_type=audio|stream_index=0|pts=33177600|pts_time=2.351020|dts=33177600|dts_time=2.351020|duration=368640|duration_time=0.026122|size=418|pos=39067|flags=K_|data_hash=CRC32:c0e98589 -packet|codec_type=audio|stream_index=0|pts=33546240|pts_time=2.377143|dts=33546240|dts_time=2.377143|duration=368640|duration_time=0.026122|size=418|pos=39485|flags=K_|data_hash=CRC32:480fd334 -packet|codec_type=audio|stream_index=0|pts=33914880|pts_time=2.403265|dts=33914880|dts_time=2.403265|duration=368640|duration_time=0.026122|size=418|pos=39903|flags=K_|data_hash=CRC32:4e5d606f -packet|codec_type=audio|stream_index=0|pts=34283520|pts_time=2.429388|dts=34283520|dts_time=2.429388|duration=368640|duration_time=0.026122|size=418|pos=40321|flags=K_|data_hash=CRC32:2d18c337 -packet|codec_type=audio|stream_index=0|pts=34652160|pts_time=2.455510|dts=34652160|dts_time=2.455510|duration=368640|duration_time=0.026122|size=418|pos=40739|flags=K_|data_hash=CRC32:288170f4 -packet|codec_type=audio|stream_index=0|pts=35020800|pts_time=2.481633|dts=35020800|dts_time=2.481633|duration=368640|duration_time=0.026122|size=418|pos=41157|flags=K_|data_hash=CRC32:ce5f7aa9 -packet|codec_type=audio|stream_index=0|pts=35389440|pts_time=2.507755|dts=35389440|dts_time=2.507755|duration=368640|duration_time=0.026122|size=418|pos=41575|flags=K_|data_hash=CRC32:1f0a8297 -packet|codec_type=audio|stream_index=0|pts=35758080|pts_time=2.533878|dts=35758080|dts_time=2.533878|duration=368640|duration_time=0.026122|size=418|pos=41993|flags=K_|data_hash=CRC32:4a8b9b61 -packet|codec_type=audio|stream_index=0|pts=36126720|pts_time=2.560000|dts=36126720|dts_time=2.560000|duration=368640|duration_time=0.026122|size=417|pos=42411|flags=K_|data_hash=CRC32:e3a90971 -packet|codec_type=audio|stream_index=0|pts=36495360|pts_time=2.586122|dts=36495360|dts_time=2.586122|duration=368640|duration_time=0.026122|size=418|pos=42828|flags=K_|data_hash=CRC32:f254c3ce -packet|codec_type=audio|stream_index=0|pts=36864000|pts_time=2.612245|dts=36864000|dts_time=2.612245|duration=368640|duration_time=0.026122|size=418|pos=43246|flags=K_|data_hash=CRC32:1867a5a7 -packet|codec_type=audio|stream_index=0|pts=37232640|pts_time=2.638367|dts=37232640|dts_time=2.638367|duration=368640|duration_time=0.026122|size=418|pos=43664|flags=K_|data_hash=CRC32:0d4fd9de -packet|codec_type=audio|stream_index=0|pts=37601280|pts_time=2.664490|dts=37601280|dts_time=2.664490|duration=368640|duration_time=0.026122|size=418|pos=44082|flags=K_|data_hash=CRC32:878c4022 -packet|codec_type=audio|stream_index=0|pts=37969920|pts_time=2.690612|dts=37969920|dts_time=2.690612|duration=368640|duration_time=0.026122|size=418|pos=44500|flags=K_|data_hash=CRC32:d0b5ed85 -packet|codec_type=audio|stream_index=0|pts=38338560|pts_time=2.716735|dts=38338560|dts_time=2.716735|duration=368640|duration_time=0.026122|size=418|pos=44918|flags=K_|data_hash=CRC32:d93b8cae -packet|codec_type=audio|stream_index=0|pts=38707200|pts_time=2.742857|dts=38707200|dts_time=2.742857|duration=368640|duration_time=0.026122|size=418|pos=45336|flags=K_|data_hash=CRC32:33070649 -packet|codec_type=audio|stream_index=0|pts=39075840|pts_time=2.768980|dts=39075840|dts_time=2.768980|duration=368640|duration_time=0.026122|size=418|pos=45754|flags=K_|data_hash=CRC32:2f74cc7e -packet|codec_type=audio|stream_index=0|pts=39444480|pts_time=2.795102|dts=39444480|dts_time=2.795102|duration=368640|duration_time=0.026122|size=418|pos=46172|flags=K_|data_hash=CRC32:3c7146bc -packet|codec_type=audio|stream_index=0|pts=39813120|pts_time=2.821224|dts=39813120|dts_time=2.821224|duration=368640|duration_time=0.026122|size=418|pos=46590|flags=K_|data_hash=CRC32:62967471 -packet|codec_type=audio|stream_index=0|pts=40181760|pts_time=2.847347|dts=40181760|dts_time=2.847347|duration=368640|duration_time=0.026122|size=418|pos=47008|flags=K_|data_hash=CRC32:efd4b940 -packet|codec_type=audio|stream_index=0|pts=40550400|pts_time=2.873469|dts=40550400|dts_time=2.873469|duration=368640|duration_time=0.026122|size=418|pos=47426|flags=K_|data_hash=CRC32:45338c17 -packet|codec_type=audio|stream_index=0|pts=40919040|pts_time=2.899592|dts=40919040|dts_time=2.899592|duration=368640|duration_time=0.026122|size=418|pos=47844|flags=K_|data_hash=CRC32:0806e97f -packet|codec_type=audio|stream_index=0|pts=41287680|pts_time=2.925714|dts=41287680|dts_time=2.925714|duration=368640|duration_time=0.026122|size=418|pos=48262|flags=K_|data_hash=CRC32:7fa8c136 -packet|codec_type=audio|stream_index=0|pts=41656320|pts_time=2.951837|dts=41656320|dts_time=2.951837|duration=368640|duration_time=0.026122|size=418|pos=48680|flags=K_|data_hash=CRC32:78d7f3e3 -packet|codec_type=audio|stream_index=0|pts=42024960|pts_time=2.977959|dts=42024960|dts_time=2.977959|duration=368640|duration_time=0.026122|size=418|pos=49098|flags=K_|data_hash=CRC32:eb7f4484 -packet|codec_type=audio|stream_index=0|pts=42393600|pts_time=3.004082|dts=42393600|dts_time=3.004082|duration=368640|duration_time=0.026122|size=418|pos=49516|flags=K_|data_hash=CRC32:a2a3f48d -packet|codec_type=audio|stream_index=0|pts=42762240|pts_time=3.030204|dts=42762240|dts_time=3.030204|duration=368640|duration_time=0.026122|size=418|pos=49934|flags=K_|data_hash=CRC32:c478db4a -packet|codec_type=audio|stream_index=0|pts=43130880|pts_time=3.056327|dts=43130880|dts_time=3.056327|duration=368640|duration_time=0.026122|size=418|pos=50352|flags=K_|data_hash=CRC32:e40731af -packet|codec_type=audio|stream_index=0|pts=43499520|pts_time=3.082449|dts=43499520|dts_time=3.082449|duration=368640|duration_time=0.026122|size=418|pos=50770|flags=K_|data_hash=CRC32:74603e95 -packet|codec_type=audio|stream_index=0|pts=43868160|pts_time=3.108571|dts=43868160|dts_time=3.108571|duration=368640|duration_time=0.026122|size=418|pos=51188|flags=K_|data_hash=CRC32:6486340f -packet|codec_type=audio|stream_index=0|pts=44236800|pts_time=3.134694|dts=44236800|dts_time=3.134694|duration=368640|duration_time=0.026122|size=418|pos=51606|flags=K_|data_hash=CRC32:8cda2b23 -packet|codec_type=audio|stream_index=0|pts=44605440|pts_time=3.160816|dts=44605440|dts_time=3.160816|duration=368640|duration_time=0.026122|size=418|pos=52024|flags=K_|data_hash=CRC32:b0bd790d -packet|codec_type=audio|stream_index=0|pts=44974080|pts_time=3.186939|dts=44974080|dts_time=3.186939|duration=368640|duration_time=0.026122|size=418|pos=52442|flags=K_|data_hash=CRC32:5ae7824d -packet|codec_type=audio|stream_index=0|pts=45342720|pts_time=3.213061|dts=45342720|dts_time=3.213061|duration=368640|duration_time=0.026122|size=417|pos=52860|flags=K_|data_hash=CRC32:8ef12cf9 -packet|codec_type=audio|stream_index=0|pts=45711360|pts_time=3.239184|dts=45711360|dts_time=3.239184|duration=368640|duration_time=0.026122|size=418|pos=53277|flags=K_|data_hash=CRC32:7426d3d8 -packet|codec_type=audio|stream_index=0|pts=46080000|pts_time=3.265306|dts=46080000|dts_time=3.265306|duration=368640|duration_time=0.026122|size=418|pos=53695|flags=K_|data_hash=CRC32:87ddbc34 -packet|codec_type=audio|stream_index=0|pts=46448640|pts_time=3.291429|dts=46448640|dts_time=3.291429|duration=368640|duration_time=0.026122|size=418|pos=54113|flags=K_|data_hash=CRC32:18375ee3 -packet|codec_type=audio|stream_index=0|pts=46817280|pts_time=3.317551|dts=46817280|dts_time=3.317551|duration=368640|duration_time=0.026122|size=418|pos=54531|flags=K_|data_hash=CRC32:1b28b358 -packet|codec_type=audio|stream_index=0|pts=47185920|pts_time=3.343673|dts=47185920|dts_time=3.343673|duration=368640|duration_time=0.026122|size=418|pos=54949|flags=K_|data_hash=CRC32:576d401d -packet|codec_type=audio|stream_index=0|pts=47554560|pts_time=3.369796|dts=47554560|dts_time=3.369796|duration=368640|duration_time=0.026122|size=418|pos=55367|flags=K_|data_hash=CRC32:db2ab4fc -packet|codec_type=audio|stream_index=0|pts=47923200|pts_time=3.395918|dts=47923200|dts_time=3.395918|duration=368640|duration_time=0.026122|size=418|pos=55785|flags=K_|data_hash=CRC32:78ca7f79 -packet|codec_type=audio|stream_index=0|pts=48291840|pts_time=3.422041|dts=48291840|dts_time=3.422041|duration=368640|duration_time=0.026122|size=418|pos=56203|flags=K_|data_hash=CRC32:a35e5abd -packet|codec_type=audio|stream_index=0|pts=48660480|pts_time=3.448163|dts=48660480|dts_time=3.448163|duration=368640|duration_time=0.026122|size=418|pos=56621|flags=K_|data_hash=CRC32:682643d6 -packet|codec_type=audio|stream_index=0|pts=49029120|pts_time=3.474286|dts=49029120|dts_time=3.474286|duration=368640|duration_time=0.026122|size=418|pos=57039|flags=K_|data_hash=CRC32:e676c49e -packet|codec_type=audio|stream_index=0|pts=49397760|pts_time=3.500408|dts=49397760|dts_time=3.500408|duration=368640|duration_time=0.026122|size=418|pos=57457|flags=K_|data_hash=CRC32:b41299c0 -packet|codec_type=audio|stream_index=0|pts=49766400|pts_time=3.526531|dts=49766400|dts_time=3.526531|duration=368640|duration_time=0.026122|size=418|pos=57875|flags=K_|data_hash=CRC32:19a7a028 -packet|codec_type=audio|stream_index=0|pts=50135040|pts_time=3.552653|dts=50135040|dts_time=3.552653|duration=368640|duration_time=0.026122|size=418|pos=58293|flags=K_|data_hash=CRC32:e1d92031 -packet|codec_type=audio|stream_index=0|pts=50503680|pts_time=3.578776|dts=50503680|dts_time=3.578776|duration=368640|duration_time=0.026122|size=418|pos=58711|flags=K_|data_hash=CRC32:6fb22e33 -packet|codec_type=audio|stream_index=0|pts=50872320|pts_time=3.604898|dts=50872320|dts_time=3.604898|duration=368640|duration_time=0.026122|size=418|pos=59129|flags=K_|data_hash=CRC32:10096a70 -packet|codec_type=audio|stream_index=0|pts=51240960|pts_time=3.631020|dts=51240960|dts_time=3.631020|duration=368640|duration_time=0.026122|size=418|pos=59547|flags=K_|data_hash=CRC32:57c4a982 -packet|codec_type=audio|stream_index=0|pts=51609600|pts_time=3.657143|dts=51609600|dts_time=3.657143|duration=368640|duration_time=0.026122|size=418|pos=59965|flags=K_|data_hash=CRC32:a705d327 -packet|codec_type=audio|stream_index=0|pts=51978240|pts_time=3.683265|dts=51978240|dts_time=3.683265|duration=368640|duration_time=0.026122|size=418|pos=60383|flags=K_|data_hash=CRC32:7c2beb09 -packet|codec_type=audio|stream_index=0|pts=52346880|pts_time=3.709388|dts=52346880|dts_time=3.709388|duration=368640|duration_time=0.026122|size=418|pos=60801|flags=K_|data_hash=CRC32:7b3d1a15 -packet|codec_type=audio|stream_index=0|pts=52715520|pts_time=3.735510|dts=52715520|dts_time=3.735510|duration=368640|duration_time=0.026122|size=418|pos=61219|flags=K_|data_hash=CRC32:f99045c1 -packet|codec_type=audio|stream_index=0|pts=53084160|pts_time=3.761633|dts=53084160|dts_time=3.761633|duration=368640|duration_time=0.026122|size=418|pos=61637|flags=K_|data_hash=CRC32:dd02d72d -packet|codec_type=audio|stream_index=0|pts=53452800|pts_time=3.787755|dts=53452800|dts_time=3.787755|duration=368640|duration_time=0.026122|size=418|pos=62055|flags=K_|data_hash=CRC32:0606b50a -packet|codec_type=audio|stream_index=0|pts=53821440|pts_time=3.813878|dts=53821440|dts_time=3.813878|duration=368640|duration_time=0.026122|size=418|pos=62473|flags=K_|data_hash=CRC32:bd5ce543 -packet|codec_type=audio|stream_index=0|pts=54190080|pts_time=3.840000|dts=54190080|dts_time=3.840000|duration=368640|duration_time=0.026122|size=417|pos=62891|flags=K_|data_hash=CRC32:feabd4b3 -packet|codec_type=audio|stream_index=0|pts=54558720|pts_time=3.866122|dts=54558720|dts_time=3.866122|duration=368640|duration_time=0.026122|size=418|pos=63308|flags=K_|data_hash=CRC32:0d89c582 -packet|codec_type=audio|stream_index=0|pts=54927360|pts_time=3.892245|dts=54927360|dts_time=3.892245|duration=368640|duration_time=0.026122|size=418|pos=63726|flags=K_|data_hash=CRC32:88664f54 -packet|codec_type=audio|stream_index=0|pts=55296000|pts_time=3.918367|dts=55296000|dts_time=3.918367|duration=368640|duration_time=0.026122|size=418|pos=64144|flags=K_|data_hash=CRC32:f94cac9a -packet|codec_type=audio|stream_index=0|pts=55664640|pts_time=3.944490|dts=55664640|dts_time=3.944490|duration=368640|duration_time=0.026122|size=418|pos=64562|flags=K_|data_hash=CRC32:317dc642 -packet|codec_type=audio|stream_index=0|pts=56033280|pts_time=3.970612|dts=56033280|dts_time=3.970612|duration=368640|duration_time=0.026122|size=418|pos=64980|flags=K_|data_hash=CRC32:478887cd -packet|codec_type=audio|stream_index=0|pts=56401920|pts_time=3.996735|dts=56401920|dts_time=3.996735|duration=368640|duration_time=0.026122|size=418|pos=65398|flags=K_|data_hash=CRC32:4f8ce9d9 -packet|codec_type=audio|stream_index=0|pts=56770560|pts_time=4.022857|dts=56770560|dts_time=4.022857|duration=368640|duration_time=0.026122|size=418|pos=65816|flags=K_|data_hash=CRC32:a2af903e -packet|codec_type=audio|stream_index=0|pts=57139200|pts_time=4.048980|dts=57139200|dts_time=4.048980|duration=368640|duration_time=0.026122|size=418|pos=66234|flags=K_|data_hash=CRC32:43fd701a -packet|codec_type=audio|stream_index=0|pts=57507840|pts_time=4.075102|dts=57507840|dts_time=4.075102|duration=368640|duration_time=0.026122|size=418|pos=66652|flags=K_|data_hash=CRC32:1b823ca6 -packet|codec_type=audio|stream_index=0|pts=57876480|pts_time=4.101224|dts=57876480|dts_time=4.101224|duration=368640|duration_time=0.026122|size=418|pos=67070|flags=K_|data_hash=CRC32:bb5fc2a0 -packet|codec_type=audio|stream_index=0|pts=58245120|pts_time=4.127347|dts=58245120|dts_time=4.127347|duration=368640|duration_time=0.026122|size=418|pos=67488|flags=K_|data_hash=CRC32:9597c685 -packet|codec_type=audio|stream_index=0|pts=58613760|pts_time=4.153469|dts=58613760|dts_time=4.153469|duration=368640|duration_time=0.026122|size=418|pos=67906|flags=K_|data_hash=CRC32:1800cbc7 -packet|codec_type=audio|stream_index=0|pts=58982400|pts_time=4.179592|dts=58982400|dts_time=4.179592|duration=368640|duration_time=0.026122|size=418|pos=68324|flags=K_|data_hash=CRC32:93d29987 -packet|codec_type=audio|stream_index=0|pts=59351040|pts_time=4.205714|dts=59351040|dts_time=4.205714|duration=368640|duration_time=0.026122|size=418|pos=68742|flags=K_|data_hash=CRC32:101eaf05 -packet|codec_type=audio|stream_index=0|pts=59719680|pts_time=4.231837|dts=59719680|dts_time=4.231837|duration=368640|duration_time=0.026122|size=418|pos=69160|flags=K_|data_hash=CRC32:3098d5d0 -packet|codec_type=audio|stream_index=0|pts=60088320|pts_time=4.257959|dts=60088320|dts_time=4.257959|duration=368640|duration_time=0.026122|size=418|pos=69578|flags=K_|data_hash=CRC32:a0435280 -packet|codec_type=audio|stream_index=0|pts=60456960|pts_time=4.284082|dts=60456960|dts_time=4.284082|duration=368640|duration_time=0.026122|size=418|pos=69996|flags=K_|data_hash=CRC32:a583c03b -packet|codec_type=audio|stream_index=0|pts=60825600|pts_time=4.310204|dts=60825600|dts_time=4.310204|duration=368640|duration_time=0.026122|size=418|pos=70414|flags=K_|data_hash=CRC32:11122d17 -packet|codec_type=audio|stream_index=0|pts=61194240|pts_time=4.336327|dts=61194240|dts_time=4.336327|duration=368640|duration_time=0.026122|size=418|pos=70832|flags=K_|data_hash=CRC32:3f3070b1 -packet|codec_type=audio|stream_index=0|pts=61562880|pts_time=4.362449|dts=61562880|dts_time=4.362449|duration=368640|duration_time=0.026122|size=418|pos=71250|flags=K_|data_hash=CRC32:7fcf2489 -packet|codec_type=audio|stream_index=0|pts=61931520|pts_time=4.388571|dts=61931520|dts_time=4.388571|duration=368640|duration_time=0.026122|size=418|pos=71668|flags=K_|data_hash=CRC32:112b3e44 -packet|codec_type=audio|stream_index=0|pts=62300160|pts_time=4.414694|dts=62300160|dts_time=4.414694|duration=368640|duration_time=0.026122|size=418|pos=72086|flags=K_|data_hash=CRC32:5033b587 -packet|codec_type=audio|stream_index=0|pts=62668800|pts_time=4.440816|dts=62668800|dts_time=4.440816|duration=368640|duration_time=0.026122|size=418|pos=72504|flags=K_|data_hash=CRC32:9cb52ea5 -packet|codec_type=audio|stream_index=0|pts=63037440|pts_time=4.466939|dts=63037440|dts_time=4.466939|duration=368640|duration_time=0.026122|size=418|pos=72922|flags=K_|data_hash=CRC32:5630d818 -packet|codec_type=audio|stream_index=0|pts=63406080|pts_time=4.493061|dts=63406080|dts_time=4.493061|duration=368640|duration_time=0.026122|size=417|pos=73340|flags=K_|data_hash=CRC32:328534f2 -packet|codec_type=audio|stream_index=0|pts=63774720|pts_time=4.519184|dts=63774720|dts_time=4.519184|duration=368640|duration_time=0.026122|size=418|pos=73757|flags=K_|data_hash=CRC32:6d57605f -packet|codec_type=audio|stream_index=0|pts=64143360|pts_time=4.545306|dts=64143360|dts_time=4.545306|duration=368640|duration_time=0.026122|size=418|pos=74175|flags=K_|data_hash=CRC32:e79fd1bb -packet|codec_type=audio|stream_index=0|pts=64512000|pts_time=4.571429|dts=64512000|dts_time=4.571429|duration=368640|duration_time=0.026122|size=418|pos=74593|flags=K_|data_hash=CRC32:b61e5e9a -packet|codec_type=audio|stream_index=0|pts=64880640|pts_time=4.597551|dts=64880640|dts_time=4.597551|duration=368640|duration_time=0.026122|size=418|pos=75011|flags=K_|data_hash=CRC32:71bc8fe3 -packet|codec_type=audio|stream_index=0|pts=65249280|pts_time=4.623673|dts=65249280|dts_time=4.623673|duration=368640|duration_time=0.026122|size=418|pos=75429|flags=K_|data_hash=CRC32:72e21ec5 -packet|codec_type=audio|stream_index=0|pts=65617920|pts_time=4.649796|dts=65617920|dts_time=4.649796|duration=368640|duration_time=0.026122|size=418|pos=75847|flags=K_|data_hash=CRC32:f93673ad -packet|codec_type=audio|stream_index=0|pts=65986560|pts_time=4.675918|dts=65986560|dts_time=4.675918|duration=368640|duration_time=0.026122|size=418|pos=76265|flags=K_|data_hash=CRC32:93dffd2d -packet|codec_type=audio|stream_index=0|pts=66355200|pts_time=4.702041|dts=66355200|dts_time=4.702041|duration=368640|duration_time=0.026122|size=418|pos=76683|flags=K_|data_hash=CRC32:b4160eef -packet|codec_type=audio|stream_index=0|pts=66723840|pts_time=4.728163|dts=66723840|dts_time=4.728163|duration=368640|duration_time=0.026122|size=418|pos=77101|flags=K_|data_hash=CRC32:4685fb67 -packet|codec_type=audio|stream_index=0|pts=67092480|pts_time=4.754286|dts=67092480|dts_time=4.754286|duration=368640|duration_time=0.026122|size=418|pos=77519|flags=K_|data_hash=CRC32:b9c9f49c -packet|codec_type=audio|stream_index=0|pts=67461120|pts_time=4.780408|dts=67461120|dts_time=4.780408|duration=368640|duration_time=0.026122|size=418|pos=77937|flags=K_|data_hash=CRC32:97eecd83 -packet|codec_type=audio|stream_index=0|pts=67829760|pts_time=4.806531|dts=67829760|dts_time=4.806531|duration=368640|duration_time=0.026122|size=418|pos=78355|flags=K_|data_hash=CRC32:c5a4d76c -packet|codec_type=audio|stream_index=0|pts=68198400|pts_time=4.832653|dts=68198400|dts_time=4.832653|duration=368640|duration_time=0.026122|size=418|pos=78773|flags=K_|data_hash=CRC32:e693a3e4 -packet|codec_type=audio|stream_index=0|pts=68567040|pts_time=4.858776|dts=68567040|dts_time=4.858776|duration=368640|duration_time=0.026122|size=418|pos=79191|flags=K_|data_hash=CRC32:0596d099 -packet|codec_type=audio|stream_index=0|pts=68935680|pts_time=4.884898|dts=68935680|dts_time=4.884898|duration=368640|duration_time=0.026122|size=418|pos=79609|flags=K_|data_hash=CRC32:cb1ece5e -packet|codec_type=audio|stream_index=0|pts=69304320|pts_time=4.911020|dts=69304320|dts_time=4.911020|duration=368640|duration_time=0.026122|size=418|pos=80027|flags=K_|data_hash=CRC32:04f13287 -packet|codec_type=audio|stream_index=0|pts=69672960|pts_time=4.937143|dts=69672960|dts_time=4.937143|duration=368640|duration_time=0.026122|size=418|pos=80445|flags=K_|data_hash=CRC32:b7288a06 -packet|codec_type=audio|stream_index=0|pts=70041600|pts_time=4.963265|dts=70041600|dts_time=4.963265|duration=368640|duration_time=0.026122|size=418|pos=80863|flags=K_|data_hash=CRC32:da40d80d -packet|codec_type=audio|stream_index=0|pts=70410240|pts_time=4.989388|dts=70410240|dts_time=4.989388|duration=368640|duration_time=0.026122|size=418|pos=81281|flags=K_|data_hash=CRC32:248c54a6 -packet|codec_type=audio|stream_index=0|pts=70778880|pts_time=5.015510|dts=70778880|dts_time=5.015510|duration=368640|duration_time=0.026122|size=418|pos=81699|flags=K_|data_hash=CRC32:c8a6a9a2 -packet|codec_type=audio|stream_index=0|pts=71147520|pts_time=5.041633|dts=71147520|dts_time=5.041633|duration=368640|duration_time=0.026122|size=418|pos=82117|flags=K_|data_hash=CRC32:f2e498bb -packet|codec_type=audio|stream_index=0|pts=71516160|pts_time=5.067755|dts=71516160|dts_time=5.067755|duration=368640|duration_time=0.026122|size=418|pos=82535|flags=K_|data_hash=CRC32:88ae4f13 -packet|codec_type=audio|stream_index=0|pts=71884800|pts_time=5.093878|dts=71884800|dts_time=5.093878|duration=368640|duration_time=0.026122|size=418|pos=82953|flags=K_|data_hash=CRC32:671833ea -packet|codec_type=audio|stream_index=0|pts=72253440|pts_time=5.120000|dts=72253440|dts_time=5.120000|duration=368640|duration_time=0.026122|size=417|pos=83371|flags=K_|data_hash=CRC32:e9300bb8 -packet|codec_type=audio|stream_index=0|pts=72622080|pts_time=5.146122|dts=72622080|dts_time=5.146122|duration=368640|duration_time=0.026122|size=418|pos=83788|flags=K_|data_hash=CRC32:f24ddb8f -packet|codec_type=audio|stream_index=0|pts=72990720|pts_time=5.172245|dts=72990720|dts_time=5.172245|duration=368640|duration_time=0.026122|size=418|pos=84206|flags=K_|data_hash=CRC32:70f61a2c -packet|codec_type=audio|stream_index=0|pts=73359360|pts_time=5.198367|dts=73359360|dts_time=5.198367|duration=368640|duration_time=0.026122|size=418|pos=84624|flags=K_|data_hash=CRC32:73dd76f4 -packet|codec_type=audio|stream_index=0|pts=73728000|pts_time=5.224490|dts=73728000|dts_time=5.224490|duration=368640|duration_time=0.026122|size=418|pos=85042|flags=K_|data_hash=CRC32:0e0502bc -packet|codec_type=audio|stream_index=0|pts=74096640|pts_time=5.250612|dts=74096640|dts_time=5.250612|duration=368640|duration_time=0.026122|size=418|pos=85460|flags=K_|data_hash=CRC32:f014154f -packet|codec_type=audio|stream_index=0|pts=74465280|pts_time=5.276735|dts=74465280|dts_time=5.276735|duration=368640|duration_time=0.026122|size=418|pos=85878|flags=K_|data_hash=CRC32:c937e40d -packet|codec_type=audio|stream_index=0|pts=74833920|pts_time=5.302857|dts=74833920|dts_time=5.302857|duration=368640|duration_time=0.026122|size=418|pos=86296|flags=K_|data_hash=CRC32:4803689b -packet|codec_type=audio|stream_index=0|pts=75202560|pts_time=5.328980|dts=75202560|dts_time=5.328980|duration=368640|duration_time=0.026122|size=418|pos=86714|flags=K_|data_hash=CRC32:22fa34c9 -packet|codec_type=audio|stream_index=0|pts=75571200|pts_time=5.355102|dts=75571200|dts_time=5.355102|duration=368640|duration_time=0.026122|size=418|pos=87132|flags=K_|data_hash=CRC32:178ca70b -packet|codec_type=audio|stream_index=0|pts=75939840|pts_time=5.381224|dts=75939840|dts_time=5.381224|duration=368640|duration_time=0.026122|size=418|pos=87550|flags=K_|data_hash=CRC32:608d220e -packet|codec_type=audio|stream_index=0|pts=76308480|pts_time=5.407347|dts=76308480|dts_time=5.407347|duration=368640|duration_time=0.026122|size=418|pos=87968|flags=K_|data_hash=CRC32:6156090c -packet|codec_type=audio|stream_index=0|pts=76677120|pts_time=5.433469|dts=76677120|dts_time=5.433469|duration=368640|duration_time=0.026122|size=418|pos=88386|flags=K_|data_hash=CRC32:0e137f5c -packet|codec_type=audio|stream_index=0|pts=77045760|pts_time=5.459592|dts=77045760|dts_time=5.459592|duration=368640|duration_time=0.026122|size=418|pos=88804|flags=K_|data_hash=CRC32:1a82efb3 -packet|codec_type=audio|stream_index=0|pts=77414400|pts_time=5.485714|dts=77414400|dts_time=5.485714|duration=368640|duration_time=0.026122|size=418|pos=89222|flags=K_|data_hash=CRC32:6dfaa92a -packet|codec_type=audio|stream_index=0|pts=77783040|pts_time=5.511837|dts=77783040|dts_time=5.511837|duration=368640|duration_time=0.026122|size=418|pos=89640|flags=K_|data_hash=CRC32:0ff57235 -packet|codec_type=audio|stream_index=0|pts=78151680|pts_time=5.537959|dts=78151680|dts_time=5.537959|duration=368640|duration_time=0.026122|size=418|pos=90058|flags=K_|data_hash=CRC32:af6aad5b -packet|codec_type=audio|stream_index=0|pts=78520320|pts_time=5.564082|dts=78520320|dts_time=5.564082|duration=368640|duration_time=0.026122|size=418|pos=90476|flags=K_|data_hash=CRC32:3edc87af -packet|codec_type=audio|stream_index=0|pts=78888960|pts_time=5.590204|dts=78888960|dts_time=5.590204|duration=368640|duration_time=0.026122|size=418|pos=90894|flags=K_|data_hash=CRC32:4e45d2f9 -packet|codec_type=audio|stream_index=0|pts=79257600|pts_time=5.616327|dts=79257600|dts_time=5.616327|duration=368640|duration_time=0.026122|size=418|pos=91312|flags=K_|data_hash=CRC32:3e3d4490 -packet|codec_type=audio|stream_index=0|pts=79626240|pts_time=5.642449|dts=79626240|dts_time=5.642449|duration=368640|duration_time=0.026122|size=418|pos=91730|flags=K_|data_hash=CRC32:ce361a9e -packet|codec_type=audio|stream_index=0|pts=79994880|pts_time=5.668571|dts=79994880|dts_time=5.668571|duration=368640|duration_time=0.026122|size=418|pos=92148|flags=K_|data_hash=CRC32:4b4b5560 -packet|codec_type=audio|stream_index=0|pts=80363520|pts_time=5.694694|dts=80363520|dts_time=5.694694|duration=368640|duration_time=0.026122|size=418|pos=92566|flags=K_|data_hash=CRC32:15778e7b -packet|codec_type=audio|stream_index=0|pts=80732160|pts_time=5.720816|dts=80732160|dts_time=5.720816|duration=368640|duration_time=0.026122|size=418|pos=92984|flags=K_|data_hash=CRC32:6ada6d94 -packet|codec_type=audio|stream_index=0|pts=81100800|pts_time=5.746939|dts=81100800|dts_time=5.746939|duration=368640|duration_time=0.026122|size=418|pos=93402|flags=K_|data_hash=CRC32:3a8d9e78 -packet|codec_type=audio|stream_index=0|pts=81469440|pts_time=5.773061|dts=81469440|dts_time=5.773061|duration=368640|duration_time=0.026122|size=417|pos=93820|flags=K_|data_hash=CRC32:71ba89fd -packet|codec_type=audio|stream_index=0|pts=81838080|pts_time=5.799184|dts=81838080|dts_time=5.799184|duration=368640|duration_time=0.026122|size=418|pos=94237|flags=K_|data_hash=CRC32:16867b8c -packet|codec_type=audio|stream_index=0|pts=82206720|pts_time=5.825306|dts=82206720|dts_time=5.825306|duration=368640|duration_time=0.026122|size=418|pos=94655|flags=K_|data_hash=CRC32:cd7e042c -packet|codec_type=audio|stream_index=0|pts=82575360|pts_time=5.851429|dts=82575360|dts_time=5.851429|duration=368640|duration_time=0.026122|size=418|pos=95073|flags=K_|data_hash=CRC32:d9777ff5 -packet|codec_type=audio|stream_index=0|pts=82944000|pts_time=5.877551|dts=82944000|dts_time=5.877551|duration=368640|duration_time=0.026122|size=418|pos=95491|flags=K_|data_hash=CRC32:015776b6 -packet|codec_type=audio|stream_index=0|pts=83312640|pts_time=5.903673|dts=83312640|dts_time=5.903673|duration=368640|duration_time=0.026122|size=418|pos=95909|flags=K_|data_hash=CRC32:16dbd1ba -packet|codec_type=audio|stream_index=0|pts=83681280|pts_time=5.929796|dts=83681280|dts_time=5.929796|duration=368640|duration_time=0.026122|size=418|pos=96327|flags=K_|data_hash=CRC32:34156e2e -packet|codec_type=audio|stream_index=0|pts=84049920|pts_time=5.955918|dts=84049920|dts_time=5.955918|duration=368640|duration_time=0.026122|size=418|pos=96745|flags=K_|data_hash=CRC32:7ba39adb -packet|codec_type=audio|stream_index=0|pts=84418560|pts_time=5.982041|dts=84418560|dts_time=5.982041|duration=368640|duration_time=0.026122|size=418|pos=97163|flags=K_|data_hash=CRC32:315662c5 -packet|codec_type=audio|stream_index=0|pts=84787200|pts_time=6.008163|dts=84787200|dts_time=6.008163|duration=368640|duration_time=0.026122|size=418|pos=97581|flags=K_|data_hash=CRC32:1d6c6500 -packet|codec_type=audio|stream_index=0|pts=85155840|pts_time=6.034286|dts=85155840|dts_time=6.034286|duration=368640|duration_time=0.026122|size=418|pos=97999|flags=K_|data_hash=CRC32:bc14dad3 -packet|codec_type=audio|stream_index=0|pts=85524480|pts_time=6.060408|dts=85524480|dts_time=6.060408|duration=368640|duration_time=0.026122|size=418|pos=98417|flags=K_|data_hash=CRC32:7719dddd -packet|codec_type=audio|stream_index=0|pts=85893120|pts_time=6.086531|dts=85893120|dts_time=6.086531|duration=368640|duration_time=0.026122|size=418|pos=98835|flags=K_|data_hash=CRC32:132ad1b8 -packet|codec_type=audio|stream_index=0|pts=86261760|pts_time=6.112653|dts=86261760|dts_time=6.112653|duration=368640|duration_time=0.026122|size=418|pos=99253|flags=K_|data_hash=CRC32:2867c127 -packet|codec_type=audio|stream_index=0|pts=86630400|pts_time=6.138776|dts=86630400|dts_time=6.138776|duration=368640|duration_time=0.026122|size=418|pos=99671|flags=K_|data_hash=CRC32:5af3ae3d -packet|codec_type=audio|stream_index=0|pts=86999040|pts_time=6.164898|dts=86999040|dts_time=6.164898|duration=368640|duration_time=0.026122|size=418|pos=100089|flags=K_|data_hash=CRC32:16d31800 -packet|codec_type=audio|stream_index=0|pts=87367680|pts_time=6.191020|dts=87367680|dts_time=6.191020|duration=368640|duration_time=0.026122|size=418|pos=100507|flags=K_|data_hash=CRC32:93a607e1 -packet|codec_type=audio|stream_index=0|pts=87736320|pts_time=6.217143|dts=87736320|dts_time=6.217143|duration=368640|duration_time=0.026122|size=418|pos=100925|flags=K_|data_hash=CRC32:db20f488 -packet|codec_type=audio|stream_index=0|pts=88104960|pts_time=6.243265|dts=88104960|dts_time=6.243265|duration=368640|duration_time=0.026122|size=418|pos=101343|flags=K_|data_hash=CRC32:8f3d4379 -packet|codec_type=audio|stream_index=0|pts=88473600|pts_time=6.269388|dts=88473600|dts_time=6.269388|duration=368640|duration_time=0.026122|size=418|pos=101761|flags=K_|data_hash=CRC32:837d0ec9 -packet|codec_type=audio|stream_index=0|pts=88842240|pts_time=6.295510|dts=88842240|dts_time=6.295510|duration=368640|duration_time=0.026122|size=418|pos=102179|flags=K_|data_hash=CRC32:22a48a51 -packet|codec_type=audio|stream_index=0|pts=89210880|pts_time=6.321633|dts=89210880|dts_time=6.321633|duration=368640|duration_time=0.026122|size=418|pos=102597|flags=K_|data_hash=CRC32:bca25918 -packet|codec_type=audio|stream_index=0|pts=89579520|pts_time=6.347755|dts=89579520|dts_time=6.347755|duration=368640|duration_time=0.026122|size=418|pos=103015|flags=K_|data_hash=CRC32:3db99977 -packet|codec_type=audio|stream_index=0|pts=89948160|pts_time=6.373878|dts=89948160|dts_time=6.373878|duration=368640|duration_time=0.026122|size=418|pos=103433|flags=K_|data_hash=CRC32:faa243b6 -packet|codec_type=audio|stream_index=0|pts=90316800|pts_time=6.400000|dts=90316800|dts_time=6.400000|duration=368640|duration_time=0.026122|size=417|pos=103851|flags=K_|data_hash=CRC32:f725a63e -packet|codec_type=audio|stream_index=0|pts=90685440|pts_time=6.426122|dts=90685440|dts_time=6.426122|duration=368640|duration_time=0.026122|size=418|pos=104268|flags=K_|data_hash=CRC32:76cf3f35 -packet|codec_type=audio|stream_index=0|pts=91054080|pts_time=6.452245|dts=91054080|dts_time=6.452245|duration=368640|duration_time=0.026122|size=418|pos=104686|flags=K_|data_hash=CRC32:2fa3029d -packet|codec_type=audio|stream_index=0|pts=91422720|pts_time=6.478367|dts=91422720|dts_time=6.478367|duration=368640|duration_time=0.026122|size=418|pos=105104|flags=K_|data_hash=CRC32:4a8deeec -packet|codec_type=audio|stream_index=0|pts=91791360|pts_time=6.504490|dts=91791360|dts_time=6.504490|duration=368640|duration_time=0.026122|size=418|pos=105522|flags=K_|data_hash=CRC32:6bb7f1f6 -packet|codec_type=audio|stream_index=0|pts=92160000|pts_time=6.530612|dts=92160000|dts_time=6.530612|duration=368640|duration_time=0.026122|size=418|pos=105940|flags=K_|data_hash=CRC32:e16d50d2 -packet|codec_type=audio|stream_index=0|pts=92528640|pts_time=6.556735|dts=92528640|dts_time=6.556735|duration=368640|duration_time=0.026122|size=418|pos=106358|flags=K_|data_hash=CRC32:b5347035 -packet|codec_type=audio|stream_index=0|pts=92897280|pts_time=6.582857|dts=92897280|dts_time=6.582857|duration=368640|duration_time=0.026122|size=418|pos=106776|flags=K_|data_hash=CRC32:7854e0d2 -packet|codec_type=audio|stream_index=0|pts=93265920|pts_time=6.608980|dts=93265920|dts_time=6.608980|duration=368640|duration_time=0.026122|size=418|pos=107194|flags=K_|data_hash=CRC32:695b58a9 -packet|codec_type=audio|stream_index=0|pts=93634560|pts_time=6.635102|dts=93634560|dts_time=6.635102|duration=368640|duration_time=0.026122|size=418|pos=107612|flags=K_|data_hash=CRC32:edf1b673 -packet|codec_type=audio|stream_index=0|pts=94003200|pts_time=6.661224|dts=94003200|dts_time=6.661224|duration=368640|duration_time=0.026122|size=418|pos=108030|flags=K_|data_hash=CRC32:46324bbb -packet|codec_type=audio|stream_index=0|pts=94371840|pts_time=6.687347|dts=94371840|dts_time=6.687347|duration=368640|duration_time=0.026122|size=418|pos=108448|flags=K_|data_hash=CRC32:e4f2bb26 -packet|codec_type=audio|stream_index=0|pts=94740480|pts_time=6.713469|dts=94740480|dts_time=6.713469|duration=368640|duration_time=0.026122|size=418|pos=108866|flags=K_|data_hash=CRC32:5db12b9c -packet|codec_type=audio|stream_index=0|pts=95109120|pts_time=6.739592|dts=95109120|dts_time=6.739592|duration=368640|duration_time=0.026122|size=418|pos=109284|flags=K_|data_hash=CRC32:36183b69 -packet|codec_type=audio|stream_index=0|pts=95477760|pts_time=6.765714|dts=95477760|dts_time=6.765714|duration=368640|duration_time=0.026122|size=418|pos=109702|flags=K_|data_hash=CRC32:baa2604d -packet|codec_type=audio|stream_index=0|pts=95846400|pts_time=6.791837|dts=95846400|dts_time=6.791837|duration=368640|duration_time=0.026122|size=418|pos=110120|flags=K_|data_hash=CRC32:5ed1c59a -packet|codec_type=audio|stream_index=0|pts=96215040|pts_time=6.817959|dts=96215040|dts_time=6.817959|duration=368640|duration_time=0.026122|size=418|pos=110538|flags=K_|data_hash=CRC32:dc54d5cd -packet|codec_type=audio|stream_index=0|pts=96583680|pts_time=6.844082|dts=96583680|dts_time=6.844082|duration=368640|duration_time=0.026122|size=418|pos=110956|flags=K_|data_hash=CRC32:0fbfd9a0 -packet|codec_type=audio|stream_index=0|pts=96952320|pts_time=6.870204|dts=96952320|dts_time=6.870204|duration=368640|duration_time=0.026122|size=418|pos=111374|flags=K_|data_hash=CRC32:bf3e1f53 -packet|codec_type=audio|stream_index=0|pts=97320960|pts_time=6.896327|dts=97320960|dts_time=6.896327|duration=368640|duration_time=0.026122|size=418|pos=111792|flags=K_|data_hash=CRC32:4ef81515 -packet|codec_type=audio|stream_index=0|pts=97689600|pts_time=6.922449|dts=97689600|dts_time=6.922449|duration=368640|duration_time=0.026122|size=418|pos=112210|flags=K_|data_hash=CRC32:576a9545 -packet|codec_type=audio|stream_index=0|pts=98058240|pts_time=6.948571|dts=98058240|dts_time=6.948571|duration=368640|duration_time=0.026122|size=418|pos=112628|flags=K_|data_hash=CRC32:522a71d5 -packet|codec_type=audio|stream_index=0|pts=98426880|pts_time=6.974694|dts=98426880|dts_time=6.974694|duration=368640|duration_time=0.026122|size=418|pos=113046|flags=K_|data_hash=CRC32:b15d9d3b -packet|codec_type=audio|stream_index=0|pts=98795520|pts_time=7.000816|dts=98795520|dts_time=7.000816|duration=368640|duration_time=0.026122|size=418|pos=113464|flags=K_|data_hash=CRC32:fd9937b8 -packet|codec_type=audio|stream_index=0|pts=99164160|pts_time=7.026939|dts=99164160|dts_time=7.026939|duration=368640|duration_time=0.026122|size=418|pos=113882|flags=K_|data_hash=CRC32:b9331702 -packet|codec_type=audio|stream_index=0|pts=99532800|pts_time=7.053061|dts=99532800|dts_time=7.053061|duration=368640|duration_time=0.026122|size=417|pos=114300|flags=K_|data_hash=CRC32:0e805c6d -packet|codec_type=audio|stream_index=0|pts=99901440|pts_time=7.079184|dts=99901440|dts_time=7.079184|duration=368640|duration_time=0.026122|size=418|pos=114717|flags=K_|data_hash=CRC32:b6f589c8 -packet|codec_type=audio|stream_index=0|pts=100270080|pts_time=7.105306|dts=100270080|dts_time=7.105306|duration=368640|duration_time=0.026122|size=418|pos=115135|flags=K_|data_hash=CRC32:87cfee38 -packet|codec_type=audio|stream_index=0|pts=100638720|pts_time=7.131429|dts=100638720|dts_time=7.131429|duration=368640|duration_time=0.026122|size=418|pos=115553|flags=K_|data_hash=CRC32:d90d4ebe -packet|codec_type=audio|stream_index=0|pts=101007360|pts_time=7.157551|dts=101007360|dts_time=7.157551|duration=368640|duration_time=0.026122|size=418|pos=115971|flags=K_|data_hash=CRC32:cf571193 -packet|codec_type=audio|stream_index=0|pts=101376000|pts_time=7.183673|dts=101376000|dts_time=7.183673|duration=368640|duration_time=0.026122|size=418|pos=116389|flags=K_|data_hash=CRC32:30d3b2d7 -packet|codec_type=audio|stream_index=0|pts=101744640|pts_time=7.209796|dts=101744640|dts_time=7.209796|duration=368640|duration_time=0.026122|size=418|pos=116807|flags=K_|data_hash=CRC32:94eff902 -packet|codec_type=audio|stream_index=0|pts=102113280|pts_time=7.235918|dts=102113280|dts_time=7.235918|duration=368640|duration_time=0.026122|size=418|pos=117225|flags=K_|data_hash=CRC32:6ed46b0c -packet|codec_type=audio|stream_index=0|pts=102481920|pts_time=7.262041|dts=102481920|dts_time=7.262041|duration=368640|duration_time=0.026122|size=418|pos=117643|flags=K_|data_hash=CRC32:ae9574bf -packet|codec_type=audio|stream_index=0|pts=102850560|pts_time=7.288163|dts=102850560|dts_time=7.288163|duration=368640|duration_time=0.026122|size=418|pos=118061|flags=K_|data_hash=CRC32:216621bb -packet|codec_type=audio|stream_index=0|pts=103219200|pts_time=7.314286|dts=103219200|dts_time=7.314286|duration=368640|duration_time=0.026122|size=418|pos=118479|flags=K_|data_hash=CRC32:be692b5a -packet|codec_type=audio|stream_index=0|pts=103587840|pts_time=7.340408|dts=103587840|dts_time=7.340408|duration=368640|duration_time=0.026122|size=418|pos=118897|flags=K_|data_hash=CRC32:76b6814a -packet|codec_type=audio|stream_index=0|pts=103956480|pts_time=7.366531|dts=103956480|dts_time=7.366531|duration=368640|duration_time=0.026122|size=418|pos=119315|flags=K_|data_hash=CRC32:60ac1531 -packet|codec_type=audio|stream_index=0|pts=104325120|pts_time=7.392653|dts=104325120|dts_time=7.392653|duration=368640|duration_time=0.026122|size=418|pos=119733|flags=K_|data_hash=CRC32:d9ac3b87 -packet|codec_type=audio|stream_index=0|pts=104693760|pts_time=7.418776|dts=104693760|dts_time=7.418776|duration=368640|duration_time=0.026122|size=418|pos=120151|flags=K_|data_hash=CRC32:6187bef7 -packet|codec_type=audio|stream_index=0|pts=105062400|pts_time=7.444898|dts=105062400|dts_time=7.444898|duration=368640|duration_time=0.026122|size=418|pos=120569|flags=K_|data_hash=CRC32:abb11d4e -packet|codec_type=audio|stream_index=0|pts=105431040|pts_time=7.471020|dts=105431040|dts_time=7.471020|duration=368640|duration_time=0.026122|size=418|pos=120987|flags=K_|data_hash=CRC32:21ff16ed -packet|codec_type=audio|stream_index=0|pts=105799680|pts_time=7.497143|dts=105799680|dts_time=7.497143|duration=368640|duration_time=0.026122|size=418|pos=121405|flags=K_|data_hash=CRC32:8b9d33e3 -packet|codec_type=audio|stream_index=0|pts=106168320|pts_time=7.523265|dts=106168320|dts_time=7.523265|duration=368640|duration_time=0.026122|size=418|pos=121823|flags=K_|data_hash=CRC32:9fdfecc3 -packet|codec_type=audio|stream_index=0|pts=106536960|pts_time=7.549388|dts=106536960|dts_time=7.549388|duration=368640|duration_time=0.026122|size=418|pos=122241|flags=K_|data_hash=CRC32:09b2eb8c -packet|codec_type=audio|stream_index=0|pts=106905600|pts_time=7.575510|dts=106905600|dts_time=7.575510|duration=368640|duration_time=0.026122|size=418|pos=122659|flags=K_|data_hash=CRC32:1157b18a -packet|codec_type=audio|stream_index=0|pts=107274240|pts_time=7.601633|dts=107274240|dts_time=7.601633|duration=368640|duration_time=0.026122|size=418|pos=123077|flags=K_|data_hash=CRC32:16d63271 -packet|codec_type=audio|stream_index=0|pts=107642880|pts_time=7.627755|dts=107642880|dts_time=7.627755|duration=368640|duration_time=0.026122|size=418|pos=123495|flags=K_|data_hash=CRC32:ff8cd868 -packet|codec_type=audio|stream_index=0|pts=108011520|pts_time=7.653878|dts=108011520|dts_time=7.653878|duration=368640|duration_time=0.026122|size=418|pos=123913|flags=K_|data_hash=CRC32:dcd4b34b -packet|codec_type=audio|stream_index=0|pts=108380160|pts_time=7.680000|dts=108380160|dts_time=7.680000|duration=368640|duration_time=0.026122|size=417|pos=124331|flags=K_|data_hash=CRC32:511a97cc -packet|codec_type=audio|stream_index=0|pts=108748800|pts_time=7.706122|dts=108748800|dts_time=7.706122|duration=368640|duration_time=0.026122|size=418|pos=124748|flags=K_|data_hash=CRC32:12f0449c -packet|codec_type=audio|stream_index=0|pts=109117440|pts_time=7.732245|dts=109117440|dts_time=7.732245|duration=368640|duration_time=0.026122|size=418|pos=125166|flags=K_|data_hash=CRC32:5af6bfcc -packet|codec_type=audio|stream_index=0|pts=109486080|pts_time=7.758367|dts=109486080|dts_time=7.758367|duration=368640|duration_time=0.026122|size=418|pos=125584|flags=K_|data_hash=CRC32:1cfa7e91 -packet|codec_type=audio|stream_index=0|pts=109854720|pts_time=7.784490|dts=109854720|dts_time=7.784490|duration=368640|duration_time=0.026122|size=418|pos=126002|flags=K_|data_hash=CRC32:d87857f2 -packet|codec_type=audio|stream_index=0|pts=110223360|pts_time=7.810612|dts=110223360|dts_time=7.810612|duration=368640|duration_time=0.026122|size=418|pos=126420|flags=K_|data_hash=CRC32:37cd9f06 -packet|codec_type=audio|stream_index=0|pts=110592000|pts_time=7.836735|dts=110592000|dts_time=7.836735|duration=368640|duration_time=0.026122|size=418|pos=126838|flags=K_|data_hash=CRC32:a3df2bf0 -packet|codec_type=audio|stream_index=0|pts=110960640|pts_time=7.862857|dts=110960640|dts_time=7.862857|duration=368640|duration_time=0.026122|size=418|pos=127256|flags=K_|data_hash=CRC32:814fa056 -packet|codec_type=audio|stream_index=0|pts=111329280|pts_time=7.888980|dts=111329280|dts_time=7.888980|duration=368640|duration_time=0.026122|size=418|pos=127674|flags=K_|data_hash=CRC32:6c87eadd -packet|codec_type=audio|stream_index=0|pts=111697920|pts_time=7.915102|dts=111697920|dts_time=7.915102|duration=368640|duration_time=0.026122|size=418|pos=128092|flags=K_|data_hash=CRC32:3b1623b4 -packet|codec_type=audio|stream_index=0|pts=112066560|pts_time=7.941224|dts=112066560|dts_time=7.941224|duration=368640|duration_time=0.026122|size=418|pos=128510|flags=K_|data_hash=CRC32:2282971a -packet|codec_type=audio|stream_index=0|pts=112435200|pts_time=7.967347|dts=112435200|dts_time=7.967347|duration=368640|duration_time=0.026122|size=418|pos=128928|flags=K_|data_hash=CRC32:e4c2f907 -packet|codec_type=audio|stream_index=0|pts=112803840|pts_time=7.993469|dts=112803840|dts_time=7.993469|duration=368640|duration_time=0.026122|size=418|pos=129346|flags=K_|data_hash=CRC32:0d494e7c -packet|codec_type=audio|stream_index=0|pts=113172480|pts_time=8.019592|dts=113172480|dts_time=8.019592|duration=368640|duration_time=0.026122|size=418|pos=129764|flags=K_|data_hash=CRC32:73683d3b -packet|codec_type=audio|stream_index=0|pts=113541120|pts_time=8.045714|dts=113541120|dts_time=8.045714|duration=368640|duration_time=0.026122|size=418|pos=130182|flags=K_|data_hash=CRC32:6a80ad3a -packet|codec_type=audio|stream_index=0|pts=113909760|pts_time=8.071837|dts=113909760|dts_time=8.071837|duration=368640|duration_time=0.026122|size=418|pos=130600|flags=K_|data_hash=CRC32:6d1ad253 -packet|codec_type=audio|stream_index=0|pts=114278400|pts_time=8.097959|dts=114278400|dts_time=8.097959|duration=368640|duration_time=0.026122|size=418|pos=131018|flags=K_|data_hash=CRC32:08fbdf2b -packet|codec_type=audio|stream_index=0|pts=114647040|pts_time=8.124082|dts=114647040|dts_time=8.124082|duration=368640|duration_time=0.026122|size=418|pos=131436|flags=K_|data_hash=CRC32:53280306 -packet|codec_type=audio|stream_index=0|pts=115015680|pts_time=8.150204|dts=115015680|dts_time=8.150204|duration=368640|duration_time=0.026122|size=418|pos=131854|flags=K_|data_hash=CRC32:0c8ac4d8 -packet|codec_type=audio|stream_index=0|pts=115384320|pts_time=8.176327|dts=115384320|dts_time=8.176327|duration=368640|duration_time=0.026122|size=418|pos=132272|flags=K_|data_hash=CRC32:b1d42b95 -packet|codec_type=audio|stream_index=0|pts=115752960|pts_time=8.202449|dts=115752960|dts_time=8.202449|duration=368640|duration_time=0.026122|size=418|pos=132690|flags=K_|data_hash=CRC32:e79c13f3 -packet|codec_type=audio|stream_index=0|pts=116121600|pts_time=8.228571|dts=116121600|dts_time=8.228571|duration=368640|duration_time=0.026122|size=418|pos=133108|flags=K_|data_hash=CRC32:b7a6b904 -packet|codec_type=audio|stream_index=0|pts=116490240|pts_time=8.254694|dts=116490240|dts_time=8.254694|duration=368640|duration_time=0.026122|size=418|pos=133526|flags=K_|data_hash=CRC32:e7437fe1 -packet|codec_type=audio|stream_index=0|pts=116858880|pts_time=8.280816|dts=116858880|dts_time=8.280816|duration=368640|duration_time=0.026122|size=418|pos=133944|flags=K_|data_hash=CRC32:ec10c2f1 -packet|codec_type=audio|stream_index=0|pts=117227520|pts_time=8.306939|dts=117227520|dts_time=8.306939|duration=368640|duration_time=0.026122|size=418|pos=134362|flags=K_|data_hash=CRC32:c85afe11 -packet|codec_type=audio|stream_index=0|pts=117596160|pts_time=8.333061|dts=117596160|dts_time=8.333061|duration=368640|duration_time=0.026122|size=417|pos=134780|flags=K_|data_hash=CRC32:86d78485 -packet|codec_type=audio|stream_index=0|pts=117964800|pts_time=8.359184|dts=117964800|dts_time=8.359184|duration=368640|duration_time=0.026122|size=418|pos=135197|flags=K_|data_hash=CRC32:38a01640 -packet|codec_type=audio|stream_index=0|pts=118333440|pts_time=8.385306|dts=118333440|dts_time=8.385306|duration=368640|duration_time=0.026122|size=418|pos=135615|flags=K_|data_hash=CRC32:fa047a2a -packet|codec_type=audio|stream_index=0|pts=118702080|pts_time=8.411429|dts=118702080|dts_time=8.411429|duration=368640|duration_time=0.026122|size=418|pos=136033|flags=K_|data_hash=CRC32:be363336 -packet|codec_type=audio|stream_index=0|pts=119070720|pts_time=8.437551|dts=119070720|dts_time=8.437551|duration=368640|duration_time=0.026122|size=418|pos=136451|flags=K_|data_hash=CRC32:107b9a48 -packet|codec_type=audio|stream_index=0|pts=119439360|pts_time=8.463673|dts=119439360|dts_time=8.463673|duration=368640|duration_time=0.026122|size=418|pos=136869|flags=K_|data_hash=CRC32:ec2d29b4 -packet|codec_type=audio|stream_index=0|pts=119808000|pts_time=8.489796|dts=119808000|dts_time=8.489796|duration=368640|duration_time=0.026122|size=418|pos=137287|flags=K_|data_hash=CRC32:5b4e1cd2 -packet|codec_type=audio|stream_index=0|pts=120176640|pts_time=8.515918|dts=120176640|dts_time=8.515918|duration=368640|duration_time=0.026122|size=418|pos=137705|flags=K_|data_hash=CRC32:3fdd2053 -packet|codec_type=audio|stream_index=0|pts=120545280|pts_time=8.542041|dts=120545280|dts_time=8.542041|duration=368640|duration_time=0.026122|size=418|pos=138123|flags=K_|data_hash=CRC32:a6205b07 -packet|codec_type=audio|stream_index=0|pts=120913920|pts_time=8.568163|dts=120913920|dts_time=8.568163|duration=368640|duration_time=0.026122|size=418|pos=138541|flags=K_|data_hash=CRC32:25820a59 -packet|codec_type=audio|stream_index=0|pts=121282560|pts_time=8.594286|dts=121282560|dts_time=8.594286|duration=368640|duration_time=0.026122|size=418|pos=138959|flags=K_|data_hash=CRC32:d7e4d24a -packet|codec_type=audio|stream_index=0|pts=121651200|pts_time=8.620408|dts=121651200|dts_time=8.620408|duration=368640|duration_time=0.026122|size=418|pos=139377|flags=K_|data_hash=CRC32:372d6c45 -packet|codec_type=audio|stream_index=0|pts=122019840|pts_time=8.646531|dts=122019840|dts_time=8.646531|duration=368640|duration_time=0.026122|size=418|pos=139795|flags=K_|data_hash=CRC32:b3d2534b -packet|codec_type=audio|stream_index=0|pts=122388480|pts_time=8.672653|dts=122388480|dts_time=8.672653|duration=368640|duration_time=0.026122|size=418|pos=140213|flags=K_|data_hash=CRC32:ec06331a -packet|codec_type=audio|stream_index=0|pts=122757120|pts_time=8.698776|dts=122757120|dts_time=8.698776|duration=368640|duration_time=0.026122|size=418|pos=140631|flags=K_|data_hash=CRC32:c1d73495 -packet|codec_type=audio|stream_index=0|pts=123125760|pts_time=8.724898|dts=123125760|dts_time=8.724898|duration=368640|duration_time=0.026122|size=418|pos=141049|flags=K_|data_hash=CRC32:cd3b07b4 -packet|codec_type=audio|stream_index=0|pts=123494400|pts_time=8.751020|dts=123494400|dts_time=8.751020|duration=368640|duration_time=0.026122|size=418|pos=141467|flags=K_|data_hash=CRC32:89d52d58 -packet|codec_type=audio|stream_index=0|pts=123863040|pts_time=8.777143|dts=123863040|dts_time=8.777143|duration=368640|duration_time=0.026122|size=418|pos=141885|flags=K_|data_hash=CRC32:4f6f794b -packet|codec_type=audio|stream_index=0|pts=124231680|pts_time=8.803265|dts=124231680|dts_time=8.803265|duration=368640|duration_time=0.026122|size=418|pos=142303|flags=K_|data_hash=CRC32:fffede19 -packet|codec_type=audio|stream_index=0|pts=124600320|pts_time=8.829388|dts=124600320|dts_time=8.829388|duration=368640|duration_time=0.026122|size=418|pos=142721|flags=K_|data_hash=CRC32:2567e5ee -packet|codec_type=audio|stream_index=0|pts=124968960|pts_time=8.855510|dts=124968960|dts_time=8.855510|duration=368640|duration_time=0.026122|size=418|pos=143139|flags=K_|data_hash=CRC32:e5a1e8c9 -packet|codec_type=audio|stream_index=0|pts=125337600|pts_time=8.881633|dts=125337600|dts_time=8.881633|duration=368640|duration_time=0.026122|size=418|pos=143557|flags=K_|data_hash=CRC32:90a53524 -packet|codec_type=audio|stream_index=0|pts=125706240|pts_time=8.907755|dts=125706240|dts_time=8.907755|duration=368640|duration_time=0.026122|size=418|pos=143975|flags=K_|data_hash=CRC32:dab534ad -packet|codec_type=audio|stream_index=0|pts=126074880|pts_time=8.933878|dts=126074880|dts_time=8.933878|duration=368640|duration_time=0.026122|size=418|pos=144393|flags=K_|data_hash=CRC32:80e2d601 -packet|codec_type=audio|stream_index=0|pts=126443520|pts_time=8.960000|dts=126443520|dts_time=8.960000|duration=368640|duration_time=0.026122|size=417|pos=144811|flags=K_|data_hash=CRC32:9e58315a -packet|codec_type=audio|stream_index=0|pts=126812160|pts_time=8.986122|dts=126812160|dts_time=8.986122|duration=368640|duration_time=0.026122|size=418|pos=145228|flags=K_|data_hash=CRC32:caf2a992 -packet|codec_type=audio|stream_index=0|pts=127180800|pts_time=9.012245|dts=127180800|dts_time=9.012245|duration=368640|duration_time=0.026122|size=418|pos=145646|flags=K_|data_hash=CRC32:b4416c55 -packet|codec_type=audio|stream_index=0|pts=127549440|pts_time=9.038367|dts=127549440|dts_time=9.038367|duration=368640|duration_time=0.026122|size=418|pos=146064|flags=K_|data_hash=CRC32:cf540122 -packet|codec_type=audio|stream_index=0|pts=127918080|pts_time=9.064490|dts=127918080|dts_time=9.064490|duration=368640|duration_time=0.026122|size=418|pos=146482|flags=K_|data_hash=CRC32:d2271324 -packet|codec_type=audio|stream_index=0|pts=128286720|pts_time=9.090612|dts=128286720|dts_time=9.090612|duration=368640|duration_time=0.026122|size=418|pos=146900|flags=K_|data_hash=CRC32:8d46cedb -packet|codec_type=audio|stream_index=0|pts=128655360|pts_time=9.116735|dts=128655360|dts_time=9.116735|duration=368640|duration_time=0.026122|size=418|pos=147318|flags=K_|data_hash=CRC32:98360373 -packet|codec_type=audio|stream_index=0|pts=129024000|pts_time=9.142857|dts=129024000|dts_time=9.142857|duration=368640|duration_time=0.026122|size=418|pos=147736|flags=K_|data_hash=CRC32:16a4d10e -packet|codec_type=audio|stream_index=0|pts=129392640|pts_time=9.168980|dts=129392640|dts_time=9.168980|duration=368640|duration_time=0.026122|size=418|pos=148154|flags=K_|data_hash=CRC32:96039cf1 -packet|codec_type=audio|stream_index=0|pts=129761280|pts_time=9.195102|dts=129761280|dts_time=9.195102|duration=368640|duration_time=0.026122|size=418|pos=148572|flags=K_|data_hash=CRC32:810c60a7 -packet|codec_type=audio|stream_index=0|pts=130129920|pts_time=9.221224|dts=130129920|dts_time=9.221224|duration=368640|duration_time=0.026122|size=418|pos=148990|flags=K_|data_hash=CRC32:965ad421 -packet|codec_type=audio|stream_index=0|pts=130498560|pts_time=9.247347|dts=130498560|dts_time=9.247347|duration=368640|duration_time=0.026122|size=418|pos=149408|flags=K_|data_hash=CRC32:ee0de130 -packet|codec_type=audio|stream_index=0|pts=130867200|pts_time=9.273469|dts=130867200|dts_time=9.273469|duration=368640|duration_time=0.026122|size=418|pos=149826|flags=K_|data_hash=CRC32:0b2e2883 -packet|codec_type=audio|stream_index=0|pts=131235840|pts_time=9.299592|dts=131235840|dts_time=9.299592|duration=368640|duration_time=0.026122|size=418|pos=150244|flags=K_|data_hash=CRC32:3f610265 -packet|codec_type=audio|stream_index=0|pts=131604480|pts_time=9.325714|dts=131604480|dts_time=9.325714|duration=368640|duration_time=0.026122|size=418|pos=150662|flags=K_|data_hash=CRC32:26cf9721 -packet|codec_type=audio|stream_index=0|pts=131973120|pts_time=9.351837|dts=131973120|dts_time=9.351837|duration=368640|duration_time=0.026122|size=418|pos=151080|flags=K_|data_hash=CRC32:eab74fb9 -packet|codec_type=audio|stream_index=0|pts=132341760|pts_time=9.377959|dts=132341760|dts_time=9.377959|duration=368640|duration_time=0.026122|size=418|pos=151498|flags=K_|data_hash=CRC32:60dea12f -packet|codec_type=audio|stream_index=0|pts=132710400|pts_time=9.404082|dts=132710400|dts_time=9.404082|duration=368640|duration_time=0.026122|size=418|pos=151916|flags=K_|data_hash=CRC32:54d23243 -packet|codec_type=audio|stream_index=0|pts=133079040|pts_time=9.430204|dts=133079040|dts_time=9.430204|duration=368640|duration_time=0.026122|size=418|pos=152334|flags=K_|data_hash=CRC32:6d507594 -packet|codec_type=audio|stream_index=0|pts=133447680|pts_time=9.456327|dts=133447680|dts_time=9.456327|duration=368640|duration_time=0.026122|size=418|pos=152752|flags=K_|data_hash=CRC32:a31b92c2 -packet|codec_type=audio|stream_index=0|pts=133816320|pts_time=9.482449|dts=133816320|dts_time=9.482449|duration=368640|duration_time=0.026122|size=418|pos=153170|flags=K_|data_hash=CRC32:04f064bd -packet|codec_type=audio|stream_index=0|pts=134184960|pts_time=9.508571|dts=134184960|dts_time=9.508571|duration=368640|duration_time=0.026122|size=418|pos=153588|flags=K_|data_hash=CRC32:234c71a8 -packet|codec_type=audio|stream_index=0|pts=134553600|pts_time=9.534694|dts=134553600|dts_time=9.534694|duration=368640|duration_time=0.026122|size=418|pos=154006|flags=K_|data_hash=CRC32:18fabbb7 -packet|codec_type=audio|stream_index=0|pts=134922240|pts_time=9.560816|dts=134922240|dts_time=9.560816|duration=368640|duration_time=0.026122|size=418|pos=154424|flags=K_|data_hash=CRC32:e372f113 -packet|codec_type=audio|stream_index=0|pts=135290880|pts_time=9.586939|dts=135290880|dts_time=9.586939|duration=368640|duration_time=0.026122|size=418|pos=154842|flags=K_|data_hash=CRC32:10352242 -packet|codec_type=audio|stream_index=0|pts=135659520|pts_time=9.613061|dts=135659520|dts_time=9.613061|duration=368640|duration_time=0.026122|size=417|pos=155260|flags=K_|data_hash=CRC32:571e601d -packet|codec_type=audio|stream_index=0|pts=136028160|pts_time=9.639184|dts=136028160|dts_time=9.639184|duration=368640|duration_time=0.026122|size=418|pos=155677|flags=K_|data_hash=CRC32:974376f0 -packet|codec_type=audio|stream_index=0|pts=136396800|pts_time=9.665306|dts=136396800|dts_time=9.665306|duration=368640|duration_time=0.026122|size=418|pos=156095|flags=K_|data_hash=CRC32:9893202f -packet|codec_type=audio|stream_index=0|pts=136765440|pts_time=9.691429|dts=136765440|dts_time=9.691429|duration=368640|duration_time=0.026122|size=418|pos=156513|flags=K_|data_hash=CRC32:57c930c0 -packet|codec_type=audio|stream_index=0|pts=137134080|pts_time=9.717551|dts=137134080|dts_time=9.717551|duration=368640|duration_time=0.026122|size=418|pos=156931|flags=K_|data_hash=CRC32:a8fc9e47 -packet|codec_type=audio|stream_index=0|pts=137502720|pts_time=9.743673|dts=137502720|dts_time=9.743673|duration=368640|duration_time=0.026122|size=418|pos=157349|flags=K_|data_hash=CRC32:a06f74d4 -packet|codec_type=audio|stream_index=0|pts=137871360|pts_time=9.769796|dts=137871360|dts_time=9.769796|duration=368640|duration_time=0.026122|size=418|pos=157767|flags=K_|data_hash=CRC32:adf88905 -packet|codec_type=audio|stream_index=0|pts=138240000|pts_time=9.795918|dts=138240000|dts_time=9.795918|duration=368640|duration_time=0.026122|size=418|pos=158185|flags=K_|data_hash=CRC32:8d415d99 -packet|codec_type=audio|stream_index=0|pts=138608640|pts_time=9.822041|dts=138608640|dts_time=9.822041|duration=368640|duration_time=0.026122|size=418|pos=158603|flags=K_|data_hash=CRC32:5df4c659 -packet|codec_type=audio|stream_index=0|pts=138977280|pts_time=9.848163|dts=138977280|dts_time=9.848163|duration=368640|duration_time=0.026122|size=418|pos=159021|flags=K_|data_hash=CRC32:c0aba593 -packet|codec_type=audio|stream_index=0|pts=139345920|pts_time=9.874286|dts=139345920|dts_time=9.874286|duration=368640|duration_time=0.026122|size=418|pos=159439|flags=K_|data_hash=CRC32:3d5f2342 -packet|codec_type=audio|stream_index=0|pts=139714560|pts_time=9.900408|dts=139714560|dts_time=9.900408|duration=368640|duration_time=0.026122|size=418|pos=159857|flags=K_|data_hash=CRC32:6835ff9d -packet|codec_type=audio|stream_index=0|pts=140083200|pts_time=9.926531|dts=140083200|dts_time=9.926531|duration=368640|duration_time=0.026122|size=418|pos=160275|flags=K_|data_hash=CRC32:de3061f3 -packet|codec_type=audio|stream_index=0|pts=140451840|pts_time=9.952653|dts=140451840|dts_time=9.952653|duration=368640|duration_time=0.026122|size=418|pos=160693|flags=K_|data_hash=CRC32:e28378d6 -packet|codec_type=audio|stream_index=0|pts=140820480|pts_time=9.978776|dts=140820480|dts_time=9.978776|duration=368640|duration_time=0.026122|size=418|pos=161111|flags=K_|data_hash=CRC32:1eabe555 -packet|codec_type=audio|stream_index=0|pts=141189120|pts_time=10.004898|dts=141189120|dts_time=10.004898|duration=368640|duration_time=0.026122|size=418|pos=161529|flags=K_|data_hash=CRC32:2bad508d -packet|codec_type=audio|stream_index=0|pts=141557760|pts_time=10.031020|dts=141557760|dts_time=10.031020|duration=368640|duration_time=0.026122|size=418|pos=161947|flags=K_|data_hash=CRC32:37fba9de -packet|codec_type=audio|stream_index=0|pts=141926400|pts_time=10.057143|dts=141926400|dts_time=10.057143|duration=368640|duration_time=0.026122|size=418|pos=162365|flags=K_|data_hash=CRC32:3244ecea -packet|codec_type=audio|stream_index=0|pts=142295040|pts_time=10.083265|dts=142295040|dts_time=10.083265|duration=368640|duration_time=0.026122|size=418|pos=162783|flags=K_|data_hash=CRC32:685781af -packet|codec_type=audio|stream_index=0|pts=142663680|pts_time=10.109388|dts=142663680|dts_time=10.109388|duration=368640|duration_time=0.026122|size=418|pos=163201|flags=K_|data_hash=CRC32:12d9eb56 -packet|codec_type=audio|stream_index=0|pts=143032320|pts_time=10.135510|dts=143032320|dts_time=10.135510|duration=368640|duration_time=0.026122|size=418|pos=163619|flags=K_|data_hash=CRC32:40f01793 -packet|codec_type=audio|stream_index=0|pts=143400960|pts_time=10.161633|dts=143400960|dts_time=10.161633|duration=368640|duration_time=0.026122|size=418|pos=164037|flags=K_|data_hash=CRC32:46a6b913 -packet|codec_type=audio|stream_index=0|pts=143769600|pts_time=10.187755|dts=143769600|dts_time=10.187755|duration=368640|duration_time=0.026122|size=418|pos=164455|flags=K_|data_hash=CRC32:a0923bf5 -packet|codec_type=audio|stream_index=0|pts=144138240|pts_time=10.213878|dts=144138240|dts_time=10.213878|duration=368640|duration_time=0.026122|size=418|pos=164873|flags=K_|data_hash=CRC32:85b32138 -packet|codec_type=audio|stream_index=0|pts=144506880|pts_time=10.240000|dts=144506880|dts_time=10.240000|duration=368640|duration_time=0.026122|size=417|pos=165291|flags=K_|data_hash=CRC32:6b70633a -packet|codec_type=audio|stream_index=0|pts=144875520|pts_time=10.266122|dts=144875520|dts_time=10.266122|duration=368640|duration_time=0.026122|size=418|pos=165708|flags=K_|data_hash=CRC32:bb86f9a2 -packet|codec_type=audio|stream_index=0|pts=145244160|pts_time=10.292245|dts=145244160|dts_time=10.292245|duration=368640|duration_time=0.026122|size=418|pos=166126|flags=K_|data_hash=CRC32:cae5a723 -packet|codec_type=audio|stream_index=0|pts=145612800|pts_time=10.318367|dts=145612800|dts_time=10.318367|duration=368640|duration_time=0.026122|size=418|pos=166544|flags=K_|data_hash=CRC32:86376f16 -packet|codec_type=audio|stream_index=0|pts=145981440|pts_time=10.344490|dts=145981440|dts_time=10.344490|duration=368640|duration_time=0.026122|size=418|pos=166962|flags=K_|data_hash=CRC32:02a40485 -packet|codec_type=audio|stream_index=0|pts=146350080|pts_time=10.370612|dts=146350080|dts_time=10.370612|duration=368640|duration_time=0.026122|size=418|pos=167380|flags=K_|data_hash=CRC32:36b3012d -packet|codec_type=audio|stream_index=0|pts=146718720|pts_time=10.396735|dts=146718720|dts_time=10.396735|duration=368640|duration_time=0.026122|size=418|pos=167798|flags=K_|data_hash=CRC32:5ee19ccd -packet|codec_type=audio|stream_index=0|pts=147087360|pts_time=10.422857|dts=147087360|dts_time=10.422857|duration=368640|duration_time=0.026122|size=418|pos=168216|flags=K_|data_hash=CRC32:c0152565 -packet|codec_type=audio|stream_index=0|pts=147456000|pts_time=10.448980|dts=147456000|dts_time=10.448980|duration=368640|duration_time=0.026122|size=418|pos=168634|flags=K_|data_hash=CRC32:19e503a0 -packet|codec_type=audio|stream_index=0|pts=147824640|pts_time=10.475102|dts=147824640|dts_time=10.475102|duration=368640|duration_time=0.026122|size=418|pos=169052|flags=K_|data_hash=CRC32:61cec178 -packet|codec_type=audio|stream_index=0|pts=148193280|pts_time=10.501224|dts=148193280|dts_time=10.501224|duration=368640|duration_time=0.026122|size=418|pos=169470|flags=K_|data_hash=CRC32:14781bf1 -packet|codec_type=audio|stream_index=0|pts=148561920|pts_time=10.527347|dts=148561920|dts_time=10.527347|duration=368640|duration_time=0.026122|size=418|pos=169888|flags=K_|data_hash=CRC32:a981e92c -packet|codec_type=audio|stream_index=0|pts=148930560|pts_time=10.553469|dts=148930560|dts_time=10.553469|duration=368640|duration_time=0.026122|size=418|pos=170306|flags=K_|data_hash=CRC32:771754a1 -packet|codec_type=audio|stream_index=0|pts=149299200|pts_time=10.579592|dts=149299200|dts_time=10.579592|duration=368640|duration_time=0.026122|size=418|pos=170724|flags=K_|data_hash=CRC32:d553fa66 -packet|codec_type=audio|stream_index=0|pts=149667840|pts_time=10.605714|dts=149667840|dts_time=10.605714|duration=368640|duration_time=0.026122|size=418|pos=171142|flags=K_|data_hash=CRC32:92289185 -packet|codec_type=audio|stream_index=0|pts=150036480|pts_time=10.631837|dts=150036480|dts_time=10.631837|duration=368640|duration_time=0.026122|size=418|pos=171560|flags=K_|data_hash=CRC32:f9c61381 -packet|codec_type=audio|stream_index=0|pts=150405120|pts_time=10.657959|dts=150405120|dts_time=10.657959|duration=368640|duration_time=0.026122|size=418|pos=171978|flags=K_|data_hash=CRC32:d68bf882 -packet|codec_type=audio|stream_index=0|pts=150773760|pts_time=10.684082|dts=150773760|dts_time=10.684082|duration=368640|duration_time=0.026122|size=418|pos=172396|flags=K_|data_hash=CRC32:a5155dee -packet|codec_type=audio|stream_index=0|pts=151142400|pts_time=10.710204|dts=151142400|dts_time=10.710204|duration=368640|duration_time=0.026122|size=418|pos=172814|flags=K_|data_hash=CRC32:98527928 -packet|codec_type=audio|stream_index=0|pts=151511040|pts_time=10.736327|dts=151511040|dts_time=10.736327|duration=368640|duration_time=0.026122|size=418|pos=173232|flags=K_|data_hash=CRC32:b4540586 -packet|codec_type=audio|stream_index=0|pts=151879680|pts_time=10.762449|dts=151879680|dts_time=10.762449|duration=368640|duration_time=0.026122|size=418|pos=173650|flags=K_|data_hash=CRC32:8ca5872b -packet|codec_type=audio|stream_index=0|pts=152248320|pts_time=10.788571|dts=152248320|dts_time=10.788571|duration=368640|duration_time=0.026122|size=418|pos=174068|flags=K_|data_hash=CRC32:b48241ad -packet|codec_type=audio|stream_index=0|pts=152616960|pts_time=10.814694|dts=152616960|dts_time=10.814694|duration=368640|duration_time=0.026122|size=418|pos=174486|flags=K_|data_hash=CRC32:87b45640 -packet|codec_type=audio|stream_index=0|pts=152985600|pts_time=10.840816|dts=152985600|dts_time=10.840816|duration=368640|duration_time=0.026122|size=418|pos=174904|flags=K_|data_hash=CRC32:7e4a7a0c -packet|codec_type=audio|stream_index=0|pts=153354240|pts_time=10.866939|dts=153354240|dts_time=10.866939|duration=368640|duration_time=0.026122|size=418|pos=175322|flags=K_|data_hash=CRC32:6027ce87 -packet|codec_type=audio|stream_index=0|pts=153722880|pts_time=10.893061|dts=153722880|dts_time=10.893061|duration=368640|duration_time=0.026122|size=417|pos=175740|flags=K_|data_hash=CRC32:0d68984f -packet|codec_type=audio|stream_index=0|pts=154091520|pts_time=10.919184|dts=154091520|dts_time=10.919184|duration=368640|duration_time=0.026122|size=418|pos=176157|flags=K_|data_hash=CRC32:614d8028 -packet|codec_type=audio|stream_index=0|pts=154460160|pts_time=10.945306|dts=154460160|dts_time=10.945306|duration=368640|duration_time=0.026122|size=418|pos=176575|flags=K_|data_hash=CRC32:14d0b66c -packet|codec_type=audio|stream_index=0|pts=154828800|pts_time=10.971429|dts=154828800|dts_time=10.971429|duration=368640|duration_time=0.026122|size=418|pos=176993|flags=K_|data_hash=CRC32:6a25430d -packet|codec_type=audio|stream_index=0|pts=155197440|pts_time=10.997551|dts=155197440|dts_time=10.997551|duration=368640|duration_time=0.026122|size=418|pos=177411|flags=K_|data_hash=CRC32:cb4a5803 -packet|codec_type=audio|stream_index=0|pts=155566080|pts_time=11.023673|dts=155566080|dts_time=11.023673|duration=368640|duration_time=0.026122|size=418|pos=177829|flags=K_|data_hash=CRC32:04d55594 -packet|codec_type=audio|stream_index=0|pts=155934720|pts_time=11.049796|dts=155934720|dts_time=11.049796|duration=368640|duration_time=0.026122|size=418|pos=178247|flags=K_|data_hash=CRC32:8c6be356 -packet|codec_type=audio|stream_index=0|pts=156303360|pts_time=11.075918|dts=156303360|dts_time=11.075918|duration=368640|duration_time=0.026122|size=418|pos=178665|flags=K_|data_hash=CRC32:cb291119 -packet|codec_type=audio|stream_index=0|pts=156672000|pts_time=11.102041|dts=156672000|dts_time=11.102041|duration=368640|duration_time=0.026122|size=418|pos=179083|flags=K_|data_hash=CRC32:eb228350 -packet|codec_type=audio|stream_index=0|pts=157040640|pts_time=11.128163|dts=157040640|dts_time=11.128163|duration=368640|duration_time=0.026122|size=418|pos=179501|flags=K_|data_hash=CRC32:c5337a0b -packet|codec_type=audio|stream_index=0|pts=157409280|pts_time=11.154286|dts=157409280|dts_time=11.154286|duration=368640|duration_time=0.026122|size=418|pos=179919|flags=K_|data_hash=CRC32:4cba189e -packet|codec_type=audio|stream_index=0|pts=157777920|pts_time=11.180408|dts=157777920|dts_time=11.180408|duration=368640|duration_time=0.026122|size=418|pos=180337|flags=K_|data_hash=CRC32:0418a931 -packet|codec_type=audio|stream_index=0|pts=158146560|pts_time=11.206531|dts=158146560|dts_time=11.206531|duration=368640|duration_time=0.026122|size=418|pos=180755|flags=K_|data_hash=CRC32:3d44908c -packet|codec_type=audio|stream_index=0|pts=158515200|pts_time=11.232653|dts=158515200|dts_time=11.232653|duration=368640|duration_time=0.026122|size=418|pos=181173|flags=K_|data_hash=CRC32:ed6d7efb -packet|codec_type=audio|stream_index=0|pts=158883840|pts_time=11.258776|dts=158883840|dts_time=11.258776|duration=368640|duration_time=0.026122|size=418|pos=181591|flags=K_|data_hash=CRC32:18ca7c0c -packet|codec_type=audio|stream_index=0|pts=159252480|pts_time=11.284898|dts=159252480|dts_time=11.284898|duration=368640|duration_time=0.026122|size=418|pos=182009|flags=K_|data_hash=CRC32:af52b87e -packet|codec_type=audio|stream_index=0|pts=159621120|pts_time=11.311020|dts=159621120|dts_time=11.311020|duration=368640|duration_time=0.026122|size=418|pos=182427|flags=K_|data_hash=CRC32:bc425aed -packet|codec_type=audio|stream_index=0|pts=159989760|pts_time=11.337143|dts=159989760|dts_time=11.337143|duration=368640|duration_time=0.026122|size=418|pos=182845|flags=K_|data_hash=CRC32:c3d28318 -packet|codec_type=audio|stream_index=0|pts=160358400|pts_time=11.363265|dts=160358400|dts_time=11.363265|duration=368640|duration_time=0.026122|size=418|pos=183263|flags=K_|data_hash=CRC32:e58a6767 -packet|codec_type=audio|stream_index=0|pts=160727040|pts_time=11.389388|dts=160727040|dts_time=11.389388|duration=368640|duration_time=0.026122|size=418|pos=183681|flags=K_|data_hash=CRC32:1ec96cd7 -packet|codec_type=audio|stream_index=0|pts=161095680|pts_time=11.415510|dts=161095680|dts_time=11.415510|duration=368640|duration_time=0.026122|size=418|pos=184099|flags=K_|data_hash=CRC32:f06e5745 -packet|codec_type=audio|stream_index=0|pts=161464320|pts_time=11.441633|dts=161464320|dts_time=11.441633|duration=368640|duration_time=0.026122|size=418|pos=184517|flags=K_|data_hash=CRC32:64601c5b -packet|codec_type=audio|stream_index=0|pts=161832960|pts_time=11.467755|dts=161832960|dts_time=11.467755|duration=368640|duration_time=0.026122|size=418|pos=184935|flags=K_|data_hash=CRC32:d9c27a78 -packet|codec_type=audio|stream_index=0|pts=162201600|pts_time=11.493878|dts=162201600|dts_time=11.493878|duration=368640|duration_time=0.026122|size=418|pos=185353|flags=K_|data_hash=CRC32:dbbff040 -packet|codec_type=audio|stream_index=0|pts=162570240|pts_time=11.520000|dts=162570240|dts_time=11.520000|duration=368640|duration_time=0.026122|size=417|pos=185771|flags=K_|data_hash=CRC32:c9f6c5a9 -packet|codec_type=audio|stream_index=0|pts=162938880|pts_time=11.546122|dts=162938880|dts_time=11.546122|duration=368640|duration_time=0.026122|size=418|pos=186188|flags=K_|data_hash=CRC32:ca280dd5 -packet|codec_type=audio|stream_index=0|pts=163307520|pts_time=11.572245|dts=163307520|dts_time=11.572245|duration=368640|duration_time=0.026122|size=418|pos=186606|flags=K_|data_hash=CRC32:3388d5a6 -packet|codec_type=audio|stream_index=0|pts=163676160|pts_time=11.598367|dts=163676160|dts_time=11.598367|duration=368640|duration_time=0.026122|size=418|pos=187024|flags=K_|data_hash=CRC32:3605bd56 -packet|codec_type=audio|stream_index=0|pts=164044800|pts_time=11.624490|dts=164044800|dts_time=11.624490|duration=368640|duration_time=0.026122|size=418|pos=187442|flags=K_|data_hash=CRC32:4a62eb9d -packet|codec_type=audio|stream_index=0|pts=164413440|pts_time=11.650612|dts=164413440|dts_time=11.650612|duration=368640|duration_time=0.026122|size=418|pos=187860|flags=K_|data_hash=CRC32:17d2c66e -packet|codec_type=audio|stream_index=0|pts=164782080|pts_time=11.676735|dts=164782080|dts_time=11.676735|duration=368640|duration_time=0.026122|size=418|pos=188278|flags=K_|data_hash=CRC32:ef7e72b5 -packet|codec_type=audio|stream_index=0|pts=165150720|pts_time=11.702857|dts=165150720|dts_time=11.702857|duration=368640|duration_time=0.026122|size=418|pos=188696|flags=K_|data_hash=CRC32:f7422408 -packet|codec_type=audio|stream_index=0|pts=165519360|pts_time=11.728980|dts=165519360|dts_time=11.728980|duration=368640|duration_time=0.026122|size=418|pos=189114|flags=K_|data_hash=CRC32:01512d42 -packet|codec_type=audio|stream_index=0|pts=165888000|pts_time=11.755102|dts=165888000|dts_time=11.755102|duration=368640|duration_time=0.026122|size=418|pos=189532|flags=K_|data_hash=CRC32:ec4ae9e0 -packet|codec_type=audio|stream_index=0|pts=166256640|pts_time=11.781224|dts=166256640|dts_time=11.781224|duration=368640|duration_time=0.026122|size=418|pos=189950|flags=K_|data_hash=CRC32:7f2ce39f -packet|codec_type=audio|stream_index=0|pts=166625280|pts_time=11.807347|dts=166625280|dts_time=11.807347|duration=368640|duration_time=0.026122|size=418|pos=190368|flags=K_|data_hash=CRC32:3abb4dc0 -packet|codec_type=audio|stream_index=0|pts=166993920|pts_time=11.833469|dts=166993920|dts_time=11.833469|duration=368640|duration_time=0.026122|size=418|pos=190786|flags=K_|data_hash=CRC32:06fdee7a -packet|codec_type=audio|stream_index=0|pts=167362560|pts_time=11.859592|dts=167362560|dts_time=11.859592|duration=368640|duration_time=0.026122|size=418|pos=191204|flags=K_|data_hash=CRC32:bfaed869 -packet|codec_type=audio|stream_index=0|pts=167731200|pts_time=11.885714|dts=167731200|dts_time=11.885714|duration=368640|duration_time=0.026122|size=418|pos=191622|flags=K_|data_hash=CRC32:a6762b1a -packet|codec_type=audio|stream_index=0|pts=168099840|pts_time=11.911837|dts=168099840|dts_time=11.911837|duration=368640|duration_time=0.026122|size=418|pos=192040|flags=K_|data_hash=CRC32:156bf7e4 -packet|codec_type=audio|stream_index=0|pts=168468480|pts_time=11.937959|dts=168468480|dts_time=11.937959|duration=368640|duration_time=0.026122|size=418|pos=192458|flags=K_|data_hash=CRC32:4cfaf03d -packet|codec_type=audio|stream_index=0|pts=168837120|pts_time=11.964082|dts=168837120|dts_time=11.964082|duration=368640|duration_time=0.026122|size=418|pos=192876|flags=K_|data_hash=CRC32:24cadb2b -packet|codec_type=audio|stream_index=0|pts=169205760|pts_time=11.990204|dts=169205760|dts_time=11.990204|duration=368640|duration_time=0.026122|size=418|pos=193294|flags=K_|data_hash=CRC32:9bba25cb -packet|codec_type=audio|stream_index=0|pts=169574400|pts_time=12.016327|dts=169574400|dts_time=12.016327|duration=368640|duration_time=0.026122|size=418|pos=193712|flags=K_|data_hash=CRC32:a6192bb5 -packet|codec_type=audio|stream_index=0|pts=169943040|pts_time=12.042449|dts=169943040|dts_time=12.042449|duration=368640|duration_time=0.026122|size=418|pos=194130|flags=K_|data_hash=CRC32:c06a11b2 -packet|codec_type=audio|stream_index=0|pts=170311680|pts_time=12.068571|dts=170311680|dts_time=12.068571|duration=368640|duration_time=0.026122|size=418|pos=194548|flags=K_|data_hash=CRC32:cd083930 -packet|codec_type=audio|stream_index=0|pts=170680320|pts_time=12.094694|dts=170680320|dts_time=12.094694|duration=368640|duration_time=0.026122|size=418|pos=194966|flags=K_|data_hash=CRC32:02e92b19 -packet|codec_type=audio|stream_index=0|pts=171048960|pts_time=12.120816|dts=171048960|dts_time=12.120816|duration=368640|duration_time=0.026122|size=418|pos=195384|flags=K_|data_hash=CRC32:4c63b84e -packet|codec_type=audio|stream_index=0|pts=171417600|pts_time=12.146939|dts=171417600|dts_time=12.146939|duration=368640|duration_time=0.026122|size=418|pos=195802|flags=K_|data_hash=CRC32:8e93e537 -packet|codec_type=audio|stream_index=0|pts=171786240|pts_time=12.173061|dts=171786240|dts_time=12.173061|duration=368640|duration_time=0.026122|size=417|pos=196220|flags=K_|data_hash=CRC32:9a9da365 -packet|codec_type=audio|stream_index=0|pts=172154880|pts_time=12.199184|dts=172154880|dts_time=12.199184|duration=368640|duration_time=0.026122|size=418|pos=196637|flags=K_|data_hash=CRC32:3d6cfb68 -packet|codec_type=audio|stream_index=0|pts=172523520|pts_time=12.225306|dts=172523520|dts_time=12.225306|duration=368640|duration_time=0.026122|size=418|pos=197055|flags=K_|data_hash=CRC32:82a3d445 -packet|codec_type=audio|stream_index=0|pts=172892160|pts_time=12.251429|dts=172892160|dts_time=12.251429|duration=368640|duration_time=0.026122|size=418|pos=197473|flags=K_|data_hash=CRC32:186d2c93 -packet|codec_type=audio|stream_index=0|pts=173260800|pts_time=12.277551|dts=173260800|dts_time=12.277551|duration=368640|duration_time=0.026122|size=418|pos=197891|flags=K_|data_hash=CRC32:d7836980 -packet|codec_type=audio|stream_index=0|pts=173629440|pts_time=12.303673|dts=173629440|dts_time=12.303673|duration=368640|duration_time=0.026122|size=418|pos=198309|flags=K_|data_hash=CRC32:7660396f -packet|codec_type=audio|stream_index=0|pts=173998080|pts_time=12.329796|dts=173998080|dts_time=12.329796|duration=368640|duration_time=0.026122|size=418|pos=198727|flags=K_|data_hash=CRC32:382b6366 -packet|codec_type=audio|stream_index=0|pts=174366720|pts_time=12.355918|dts=174366720|dts_time=12.355918|duration=368640|duration_time=0.026122|size=418|pos=199145|flags=K_|data_hash=CRC32:e85af773 -packet|codec_type=audio|stream_index=0|pts=174735360|pts_time=12.382041|dts=174735360|dts_time=12.382041|duration=368640|duration_time=0.026122|size=418|pos=199563|flags=K_|data_hash=CRC32:90dce600 -packet|codec_type=audio|stream_index=0|pts=175104000|pts_time=12.408163|dts=175104000|dts_time=12.408163|duration=368640|duration_time=0.026122|size=418|pos=199981|flags=K_|data_hash=CRC32:51048306 -packet|codec_type=audio|stream_index=0|pts=175472640|pts_time=12.434286|dts=175472640|dts_time=12.434286|duration=368640|duration_time=0.026122|size=418|pos=200399|flags=K_|data_hash=CRC32:8fc72574 -packet|codec_type=audio|stream_index=0|pts=175841280|pts_time=12.460408|dts=175841280|dts_time=12.460408|duration=368640|duration_time=0.026122|size=418|pos=200817|flags=K_|data_hash=CRC32:0c2fdbc9 -packet|codec_type=audio|stream_index=0|pts=176209920|pts_time=12.486531|dts=176209920|dts_time=12.486531|duration=368640|duration_time=0.026122|size=418|pos=201235|flags=K_|data_hash=CRC32:c624821f -packet|codec_type=audio|stream_index=0|pts=176578560|pts_time=12.512653|dts=176578560|dts_time=12.512653|duration=368640|duration_time=0.026122|size=418|pos=201653|flags=K_|data_hash=CRC32:122a97b1 -packet|codec_type=audio|stream_index=0|pts=176947200|pts_time=12.538776|dts=176947200|dts_time=12.538776|duration=368640|duration_time=0.026122|size=418|pos=202071|flags=K_|data_hash=CRC32:70034867 -packet|codec_type=audio|stream_index=0|pts=177315840|pts_time=12.564898|dts=177315840|dts_time=12.564898|duration=368640|duration_time=0.026122|size=418|pos=202489|flags=K_|data_hash=CRC32:23f7ff55 -packet|codec_type=audio|stream_index=0|pts=177684480|pts_time=12.591020|dts=177684480|dts_time=12.591020|duration=368640|duration_time=0.026122|size=418|pos=202907|flags=K_|data_hash=CRC32:30502042 -packet|codec_type=audio|stream_index=0|pts=178053120|pts_time=12.617143|dts=178053120|dts_time=12.617143|duration=368640|duration_time=0.026122|size=418|pos=203325|flags=K_|data_hash=CRC32:c4fc3556 -packet|codec_type=audio|stream_index=0|pts=178421760|pts_time=12.643265|dts=178421760|dts_time=12.643265|duration=368640|duration_time=0.026122|size=418|pos=203743|flags=K_|data_hash=CRC32:93e85444 -packet|codec_type=audio|stream_index=0|pts=178790400|pts_time=12.669388|dts=178790400|dts_time=12.669388|duration=368640|duration_time=0.026122|size=418|pos=204161|flags=K_|data_hash=CRC32:7cd8422c -packet|codec_type=audio|stream_index=0|pts=179159040|pts_time=12.695510|dts=179159040|dts_time=12.695510|duration=368640|duration_time=0.026122|size=418|pos=204579|flags=K_|data_hash=CRC32:b4f0ac22 -packet|codec_type=audio|stream_index=0|pts=179527680|pts_time=12.721633|dts=179527680|dts_time=12.721633|duration=368640|duration_time=0.026122|size=418|pos=204997|flags=K_|data_hash=CRC32:767c9538 -packet|codec_type=audio|stream_index=0|pts=179896320|pts_time=12.747755|dts=179896320|dts_time=12.747755|duration=368640|duration_time=0.026122|size=418|pos=205415|flags=K_|data_hash=CRC32:dc526929 -packet|codec_type=audio|stream_index=0|pts=180264960|pts_time=12.773878|dts=180264960|dts_time=12.773878|duration=368640|duration_time=0.026122|size=418|pos=205833|flags=K_|data_hash=CRC32:8b581282 -packet|codec_type=audio|stream_index=0|pts=180633600|pts_time=12.800000|dts=180633600|dts_time=12.800000|duration=368640|duration_time=0.026122|size=417|pos=206251|flags=K_|data_hash=CRC32:3c289703 -packet|codec_type=audio|stream_index=0|pts=181002240|pts_time=12.826122|dts=181002240|dts_time=12.826122|duration=368640|duration_time=0.026122|size=418|pos=206668|flags=K_|data_hash=CRC32:97ad0eb3 -packet|codec_type=audio|stream_index=0|pts=181370880|pts_time=12.852245|dts=181370880|dts_time=12.852245|duration=368640|duration_time=0.026122|size=418|pos=207086|flags=K_|data_hash=CRC32:faf9c1b5 -packet|codec_type=audio|stream_index=0|pts=181739520|pts_time=12.878367|dts=181739520|dts_time=12.878367|duration=368640|duration_time=0.026122|size=418|pos=207504|flags=K_|data_hash=CRC32:8f7c216a -packet|codec_type=audio|stream_index=0|pts=182108160|pts_time=12.904490|dts=182108160|dts_time=12.904490|duration=368640|duration_time=0.026122|size=418|pos=207922|flags=K_|data_hash=CRC32:2cb8f508 -packet|codec_type=audio|stream_index=0|pts=182476800|pts_time=12.930612|dts=182476800|dts_time=12.930612|duration=368640|duration_time=0.026122|size=418|pos=208340|flags=K_|data_hash=CRC32:0e9ca434 -packet|codec_type=audio|stream_index=0|pts=182845440|pts_time=12.956735|dts=182845440|dts_time=12.956735|duration=368640|duration_time=0.026122|size=418|pos=208758|flags=K_|data_hash=CRC32:ce807881 -packet|codec_type=audio|stream_index=0|pts=183214080|pts_time=12.982857|dts=183214080|dts_time=12.982857|duration=368640|duration_time=0.026122|size=418|pos=209176|flags=K_|data_hash=CRC32:0f2d056d -packet|codec_type=audio|stream_index=0|pts=183582720|pts_time=13.008980|dts=183582720|dts_time=13.008980|duration=368640|duration_time=0.026122|size=418|pos=209594|flags=K_|data_hash=CRC32:34f82e70 -packet|codec_type=audio|stream_index=0|pts=183951360|pts_time=13.035102|dts=183951360|dts_time=13.035102|duration=368640|duration_time=0.026122|size=418|pos=210012|flags=K_|data_hash=CRC32:93986f39 -packet|codec_type=audio|stream_index=0|pts=184320000|pts_time=13.061224|dts=184320000|dts_time=13.061224|duration=368640|duration_time=0.026122|size=418|pos=210430|flags=K_|data_hash=CRC32:057d018c -packet|codec_type=audio|stream_index=0|pts=184688640|pts_time=13.087347|dts=184688640|dts_time=13.087347|duration=368640|duration_time=0.026122|size=418|pos=210848|flags=K_|data_hash=CRC32:20288d86 -packet|codec_type=audio|stream_index=0|pts=185057280|pts_time=13.113469|dts=185057280|dts_time=13.113469|duration=368640|duration_time=0.026122|size=418|pos=211266|flags=K_|data_hash=CRC32:2054d963 -packet|codec_type=audio|stream_index=0|pts=185425920|pts_time=13.139592|dts=185425920|dts_time=13.139592|duration=368640|duration_time=0.026122|size=418|pos=211684|flags=K_|data_hash=CRC32:51451bd5 -packet|codec_type=audio|stream_index=0|pts=185794560|pts_time=13.165714|dts=185794560|dts_time=13.165714|duration=368640|duration_time=0.026122|size=418|pos=212102|flags=K_|data_hash=CRC32:40180197 -packet|codec_type=audio|stream_index=0|pts=186163200|pts_time=13.191837|dts=186163200|dts_time=13.191837|duration=368640|duration_time=0.026122|size=418|pos=212520|flags=K_|data_hash=CRC32:66cdd080 -packet|codec_type=audio|stream_index=0|pts=186531840|pts_time=13.217959|dts=186531840|dts_time=13.217959|duration=368640|duration_time=0.026122|size=418|pos=212938|flags=K_|data_hash=CRC32:03eb571f -packet|codec_type=audio|stream_index=0|pts=186900480|pts_time=13.244082|dts=186900480|dts_time=13.244082|duration=368640|duration_time=0.026122|size=418|pos=213356|flags=K_|data_hash=CRC32:88515140 -packet|codec_type=audio|stream_index=0|pts=187269120|pts_time=13.270204|dts=187269120|dts_time=13.270204|duration=368640|duration_time=0.026122|size=418|pos=213774|flags=K_|data_hash=CRC32:b82428b6 -packet|codec_type=audio|stream_index=0|pts=187637760|pts_time=13.296327|dts=187637760|dts_time=13.296327|duration=368640|duration_time=0.026122|size=418|pos=214192|flags=K_|data_hash=CRC32:43d07d2b -packet|codec_type=audio|stream_index=0|pts=188006400|pts_time=13.322449|dts=188006400|dts_time=13.322449|duration=368640|duration_time=0.026122|size=418|pos=214610|flags=K_|data_hash=CRC32:458c2504 -packet|codec_type=audio|stream_index=0|pts=188375040|pts_time=13.348571|dts=188375040|dts_time=13.348571|duration=368640|duration_time=0.026122|size=418|pos=215028|flags=K_|data_hash=CRC32:efa75088 -packet|codec_type=audio|stream_index=0|pts=188743680|pts_time=13.374694|dts=188743680|dts_time=13.374694|duration=368640|duration_time=0.026122|size=418|pos=215446|flags=K_|data_hash=CRC32:781209a4 -packet|codec_type=audio|stream_index=0|pts=189112320|pts_time=13.400816|dts=189112320|dts_time=13.400816|duration=368640|duration_time=0.026122|size=418|pos=215864|flags=K_|data_hash=CRC32:c09324be -packet|codec_type=audio|stream_index=0|pts=189480960|pts_time=13.426939|dts=189480960|dts_time=13.426939|duration=368640|duration_time=0.026122|size=418|pos=216282|flags=K_|data_hash=CRC32:b4b9932d -packet|codec_type=audio|stream_index=0|pts=189849600|pts_time=13.453061|dts=189849600|dts_time=13.453061|duration=368640|duration_time=0.026122|size=417|pos=216700|flags=K_|data_hash=CRC32:da830315 -packet|codec_type=audio|stream_index=0|pts=190218240|pts_time=13.479184|dts=190218240|dts_time=13.479184|duration=368640|duration_time=0.026122|size=418|pos=217117|flags=K_|data_hash=CRC32:66202e4f -packet|codec_type=audio|stream_index=0|pts=190586880|pts_time=13.505306|dts=190586880|dts_time=13.505306|duration=368640|duration_time=0.026122|size=418|pos=217535|flags=K_|data_hash=CRC32:2e237c5c -packet|codec_type=audio|stream_index=0|pts=190955520|pts_time=13.531429|dts=190955520|dts_time=13.531429|duration=368640|duration_time=0.026122|size=418|pos=217953|flags=K_|data_hash=CRC32:5764d408 -packet|codec_type=audio|stream_index=0|pts=191324160|pts_time=13.557551|dts=191324160|dts_time=13.557551|duration=368640|duration_time=0.026122|size=418|pos=218371|flags=K_|data_hash=CRC32:35c3a585 -packet|codec_type=audio|stream_index=0|pts=191692800|pts_time=13.583673|dts=191692800|dts_time=13.583673|duration=368640|duration_time=0.026122|size=418|pos=218789|flags=K_|data_hash=CRC32:78fe7986 -packet|codec_type=audio|stream_index=0|pts=192061440|pts_time=13.609796|dts=192061440|dts_time=13.609796|duration=368640|duration_time=0.026122|size=418|pos=219207|flags=K_|data_hash=CRC32:9f375cbe -packet|codec_type=audio|stream_index=0|pts=192430080|pts_time=13.635918|dts=192430080|dts_time=13.635918|duration=368640|duration_time=0.026122|size=418|pos=219625|flags=K_|data_hash=CRC32:491852fd -packet|codec_type=audio|stream_index=0|pts=192798720|pts_time=13.662041|dts=192798720|dts_time=13.662041|duration=368640|duration_time=0.026122|size=418|pos=220043|flags=K_|data_hash=CRC32:4f831db2 -packet|codec_type=audio|stream_index=0|pts=193167360|pts_time=13.688163|dts=193167360|dts_time=13.688163|duration=368640|duration_time=0.026122|size=418|pos=220461|flags=K_|data_hash=CRC32:030e4b07 -packet|codec_type=audio|stream_index=0|pts=193536000|pts_time=13.714286|dts=193536000|dts_time=13.714286|duration=368640|duration_time=0.026122|size=418|pos=220879|flags=K_|data_hash=CRC32:098ea741 -packet|codec_type=audio|stream_index=0|pts=193904640|pts_time=13.740408|dts=193904640|dts_time=13.740408|duration=368640|duration_time=0.026122|size=418|pos=221297|flags=K_|data_hash=CRC32:7ad88654 -packet|codec_type=audio|stream_index=0|pts=194273280|pts_time=13.766531|dts=194273280|dts_time=13.766531|duration=368640|duration_time=0.026122|size=418|pos=221715|flags=K_|data_hash=CRC32:d88ccfac -packet|codec_type=audio|stream_index=0|pts=194641920|pts_time=13.792653|dts=194641920|dts_time=13.792653|duration=368640|duration_time=0.026122|size=418|pos=222133|flags=K_|data_hash=CRC32:f22666d1 -packet|codec_type=audio|stream_index=0|pts=195010560|pts_time=13.818776|dts=195010560|dts_time=13.818776|duration=368640|duration_time=0.026122|size=418|pos=222551|flags=K_|data_hash=CRC32:d249bf1c -packet|codec_type=audio|stream_index=0|pts=195379200|pts_time=13.844898|dts=195379200|dts_time=13.844898|duration=368640|duration_time=0.026122|size=418|pos=222969|flags=K_|data_hash=CRC32:98e88198 -packet|codec_type=audio|stream_index=0|pts=195747840|pts_time=13.871020|dts=195747840|dts_time=13.871020|duration=368640|duration_time=0.026122|size=418|pos=223387|flags=K_|data_hash=CRC32:8a9fc4b4 -packet|codec_type=audio|stream_index=0|pts=196116480|pts_time=13.897143|dts=196116480|dts_time=13.897143|duration=368640|duration_time=0.026122|size=418|pos=223805|flags=K_|data_hash=CRC32:e0835e74 -packet|codec_type=audio|stream_index=0|pts=196485120|pts_time=13.923265|dts=196485120|dts_time=13.923265|duration=368640|duration_time=0.026122|size=418|pos=224223|flags=K_|data_hash=CRC32:08c1071f -packet|codec_type=audio|stream_index=0|pts=196853760|pts_time=13.949388|dts=196853760|dts_time=13.949388|duration=368640|duration_time=0.026122|size=418|pos=224641|flags=K_|data_hash=CRC32:ca5a3aaa -packet|codec_type=audio|stream_index=0|pts=197222400|pts_time=13.975510|dts=197222400|dts_time=13.975510|duration=368640|duration_time=0.026122|size=418|pos=225059|flags=K_|data_hash=CRC32:f789d2b3 -packet|codec_type=audio|stream_index=0|pts=197591040|pts_time=14.001633|dts=197591040|dts_time=14.001633|duration=368640|duration_time=0.026122|size=418|pos=225477|flags=K_|data_hash=CRC32:7bc285ed -packet|codec_type=audio|stream_index=0|pts=197959680|pts_time=14.027755|dts=197959680|dts_time=14.027755|duration=368640|duration_time=0.026122|size=418|pos=225895|flags=K_|data_hash=CRC32:6061a821 -packet|codec_type=audio|stream_index=0|pts=198328320|pts_time=14.053878|dts=198328320|dts_time=14.053878|duration=368640|duration_time=0.026122|size=418|pos=226313|flags=K_|data_hash=CRC32:14367df4 -packet|codec_type=audio|stream_index=0|pts=198696960|pts_time=14.080000|dts=198696960|dts_time=14.080000|duration=368640|duration_time=0.026122|size=417|pos=226731|flags=K_|data_hash=CRC32:f3140a6b -packet|codec_type=audio|stream_index=0|pts=199065600|pts_time=14.106122|dts=199065600|dts_time=14.106122|duration=368640|duration_time=0.026122|size=418|pos=227148|flags=K_|data_hash=CRC32:ebf07925 -packet|codec_type=audio|stream_index=0|pts=199434240|pts_time=14.132245|dts=199434240|dts_time=14.132245|duration=368640|duration_time=0.026122|size=418|pos=227566|flags=K_|data_hash=CRC32:4f8cde59 -packet|codec_type=audio|stream_index=0|pts=199802880|pts_time=14.158367|dts=199802880|dts_time=14.158367|duration=368640|duration_time=0.026122|size=418|pos=227984|flags=K_|data_hash=CRC32:4467b601 -packet|codec_type=audio|stream_index=0|pts=200171520|pts_time=14.184490|dts=200171520|dts_time=14.184490|duration=368640|duration_time=0.026122|size=418|pos=228402|flags=K_|data_hash=CRC32:f6ae7ed4 -packet|codec_type=audio|stream_index=0|pts=200540160|pts_time=14.210612|dts=200540160|dts_time=14.210612|duration=368640|duration_time=0.026122|size=418|pos=228820|flags=K_|data_hash=CRC32:5cb30836 -packet|codec_type=audio|stream_index=0|pts=200908800|pts_time=14.236735|dts=200908800|dts_time=14.236735|duration=368640|duration_time=0.026122|size=418|pos=229238|flags=K_|data_hash=CRC32:21b70421 -packet|codec_type=audio|stream_index=0|pts=201277440|pts_time=14.262857|dts=201277440|dts_time=14.262857|duration=368640|duration_time=0.026122|size=418|pos=229656|flags=K_|data_hash=CRC32:3bcafdd7 -packet|codec_type=audio|stream_index=0|pts=201646080|pts_time=14.288980|dts=201646080|dts_time=14.288980|duration=368640|duration_time=0.026122|size=418|pos=230074|flags=K_|data_hash=CRC32:76edd678 -packet|codec_type=audio|stream_index=0|pts=202014720|pts_time=14.315102|dts=202014720|dts_time=14.315102|duration=368640|duration_time=0.026122|size=418|pos=230492|flags=K_|data_hash=CRC32:0999fa0b -packet|codec_type=audio|stream_index=0|pts=202383360|pts_time=14.341224|dts=202383360|dts_time=14.341224|duration=368640|duration_time=0.026122|size=418|pos=230910|flags=K_|data_hash=CRC32:227a3da5 -packet|codec_type=audio|stream_index=0|pts=202752000|pts_time=14.367347|dts=202752000|dts_time=14.367347|duration=368640|duration_time=0.026122|size=418|pos=231328|flags=K_|data_hash=CRC32:0068cd57 -packet|codec_type=audio|stream_index=0|pts=203120640|pts_time=14.393469|dts=203120640|dts_time=14.393469|duration=368640|duration_time=0.026122|size=418|pos=231746|flags=K_|data_hash=CRC32:70f8a1dc -packet|codec_type=audio|stream_index=0|pts=203489280|pts_time=14.419592|dts=203489280|dts_time=14.419592|duration=368640|duration_time=0.026122|size=418|pos=232164|flags=K_|data_hash=CRC32:c19072eb -packet|codec_type=audio|stream_index=0|pts=203857920|pts_time=14.445714|dts=203857920|dts_time=14.445714|duration=368640|duration_time=0.026122|size=418|pos=232582|flags=K_|data_hash=CRC32:f0461d09 -packet|codec_type=audio|stream_index=0|pts=204226560|pts_time=14.471837|dts=204226560|dts_time=14.471837|duration=368640|duration_time=0.026122|size=418|pos=233000|flags=K_|data_hash=CRC32:c8fa8555 -packet|codec_type=audio|stream_index=0|pts=204595200|pts_time=14.497959|dts=204595200|dts_time=14.497959|duration=368640|duration_time=0.026122|size=418|pos=233418|flags=K_|data_hash=CRC32:901f5bfb -packet|codec_type=audio|stream_index=0|pts=204963840|pts_time=14.524082|dts=204963840|dts_time=14.524082|duration=368640|duration_time=0.026122|size=418|pos=233836|flags=K_|data_hash=CRC32:91d0ab8c -packet|codec_type=audio|stream_index=0|pts=205332480|pts_time=14.550204|dts=205332480|dts_time=14.550204|duration=368640|duration_time=0.026122|size=418|pos=234254|flags=K_|data_hash=CRC32:3516c575 -packet|codec_type=audio|stream_index=0|pts=205701120|pts_time=14.576327|dts=205701120|dts_time=14.576327|duration=368640|duration_time=0.026122|size=418|pos=234672|flags=K_|data_hash=CRC32:b32cd4ed -packet|codec_type=audio|stream_index=0|pts=206069760|pts_time=14.602449|dts=206069760|dts_time=14.602449|duration=368640|duration_time=0.026122|size=418|pos=235090|flags=K_|data_hash=CRC32:bcd22861 -packet|codec_type=audio|stream_index=0|pts=206438400|pts_time=14.628571|dts=206438400|dts_time=14.628571|duration=368640|duration_time=0.026122|size=418|pos=235508|flags=K_|data_hash=CRC32:a7d0b124 -packet|codec_type=audio|stream_index=0|pts=206807040|pts_time=14.654694|dts=206807040|dts_time=14.654694|duration=368640|duration_time=0.026122|size=418|pos=235926|flags=K_|data_hash=CRC32:3fed01ec -packet|codec_type=audio|stream_index=0|pts=207175680|pts_time=14.680816|dts=207175680|dts_time=14.680816|duration=368640|duration_time=0.026122|size=418|pos=236344|flags=K_|data_hash=CRC32:ff85606f -packet|codec_type=audio|stream_index=0|pts=207544320|pts_time=14.706939|dts=207544320|dts_time=14.706939|duration=368640|duration_time=0.026122|size=418|pos=236762|flags=K_|data_hash=CRC32:a62312cb -packet|codec_type=audio|stream_index=0|pts=207912960|pts_time=14.733061|dts=207912960|dts_time=14.733061|duration=368640|duration_time=0.026122|size=417|pos=237180|flags=K_|data_hash=CRC32:4b910380 -packet|codec_type=audio|stream_index=0|pts=208281600|pts_time=14.759184|dts=208281600|dts_time=14.759184|duration=368640|duration_time=0.026122|size=418|pos=237597|flags=K_|data_hash=CRC32:4f97177f -packet|codec_type=audio|stream_index=0|pts=208650240|pts_time=14.785306|dts=208650240|dts_time=14.785306|duration=368640|duration_time=0.026122|size=418|pos=238015|flags=K_|data_hash=CRC32:f919570c -packet|codec_type=audio|stream_index=0|pts=209018880|pts_time=14.811429|dts=209018880|dts_time=14.811429|duration=368640|duration_time=0.026122|size=418|pos=238433|flags=K_|data_hash=CRC32:74ca87ce -packet|codec_type=audio|stream_index=0|pts=209387520|pts_time=14.837551|dts=209387520|dts_time=14.837551|duration=368640|duration_time=0.026122|size=418|pos=238851|flags=K_|data_hash=CRC32:5fb510e2 -packet|codec_type=audio|stream_index=0|pts=209756160|pts_time=14.863673|dts=209756160|dts_time=14.863673|duration=368640|duration_time=0.026122|size=418|pos=239269|flags=K_|data_hash=CRC32:c01c76b9 -packet|codec_type=audio|stream_index=0|pts=210124800|pts_time=14.889796|dts=210124800|dts_time=14.889796|duration=368640|duration_time=0.026122|size=418|pos=239687|flags=K_|data_hash=CRC32:fb39fca0 -packet|codec_type=audio|stream_index=0|pts=210493440|pts_time=14.915918|dts=210493440|dts_time=14.915918|duration=368640|duration_time=0.026122|size=418|pos=240105|flags=K_|data_hash=CRC32:9b334424 -packet|codec_type=audio|stream_index=0|pts=210862080|pts_time=14.942041|dts=210862080|dts_time=14.942041|duration=368640|duration_time=0.026122|size=418|pos=240523|flags=K_|data_hash=CRC32:8b9fd924 -packet|codec_type=audio|stream_index=0|pts=211230720|pts_time=14.968163|dts=211230720|dts_time=14.968163|duration=368640|duration_time=0.026122|size=418|pos=240941|flags=K_|data_hash=CRC32:e81832b1 -packet|codec_type=audio|stream_index=0|pts=211599360|pts_time=14.994286|dts=211599360|dts_time=14.994286|duration=368640|duration_time=0.026122|size=418|pos=241359|flags=K_|data_hash=CRC32:cef4dc50 -packet|codec_type=audio|stream_index=0|pts=211968000|pts_time=15.020408|dts=211968000|dts_time=15.020408|duration=368640|duration_time=0.026122|size=418|pos=241777|flags=K_|data_hash=CRC32:4948aebf -packet|codec_type=audio|stream_index=0|pts=212336640|pts_time=15.046531|dts=212336640|dts_time=15.046531|duration=368640|duration_time=0.026122|size=418|pos=242195|flags=K_|data_hash=CRC32:eb2c924e -packet|codec_type=audio|stream_index=0|pts=212705280|pts_time=15.072653|dts=212705280|dts_time=15.072653|duration=368640|duration_time=0.026122|size=418|pos=242613|flags=K_|data_hash=CRC32:851f8690 -packet|codec_type=audio|stream_index=0|pts=213073920|pts_time=15.098776|dts=213073920|dts_time=15.098776|duration=368640|duration_time=0.026122|size=418|pos=243031|flags=K_|data_hash=CRC32:4c0e608d -packet|codec_type=audio|stream_index=0|pts=213442560|pts_time=15.124898|dts=213442560|dts_time=15.124898|duration=368640|duration_time=0.026122|size=418|pos=243449|flags=K_|data_hash=CRC32:37f43818 -packet|codec_type=audio|stream_index=0|pts=213811200|pts_time=15.151020|dts=213811200|dts_time=15.151020|duration=368640|duration_time=0.026122|size=418|pos=243867|flags=K_|data_hash=CRC32:8f88252e -packet|codec_type=audio|stream_index=0|pts=214179840|pts_time=15.177143|dts=214179840|dts_time=15.177143|duration=368640|duration_time=0.026122|size=418|pos=244285|flags=K_|data_hash=CRC32:95f6b13d -packet|codec_type=audio|stream_index=0|pts=214548480|pts_time=15.203265|dts=214548480|dts_time=15.203265|duration=368640|duration_time=0.026122|size=418|pos=244703|flags=K_|data_hash=CRC32:32dde92f -packet|codec_type=audio|stream_index=0|pts=214917120|pts_time=15.229388|dts=214917120|dts_time=15.229388|duration=368640|duration_time=0.026122|size=418|pos=245121|flags=K_|data_hash=CRC32:0d034c77 -packet|codec_type=audio|stream_index=0|pts=215285760|pts_time=15.255510|dts=215285760|dts_time=15.255510|duration=368640|duration_time=0.026122|size=418|pos=245539|flags=K_|data_hash=CRC32:4cbf0548 -packet|codec_type=audio|stream_index=0|pts=215654400|pts_time=15.281633|dts=215654400|dts_time=15.281633|duration=368640|duration_time=0.026122|size=418|pos=245957|flags=K_|data_hash=CRC32:599d8f8f -packet|codec_type=audio|stream_index=0|pts=216023040|pts_time=15.307755|dts=216023040|dts_time=15.307755|duration=368640|duration_time=0.026122|size=418|pos=246375|flags=K_|data_hash=CRC32:da07f929 -packet|codec_type=audio|stream_index=0|pts=216391680|pts_time=15.333878|dts=216391680|dts_time=15.333878|duration=368640|duration_time=0.026122|size=418|pos=246793|flags=K_|data_hash=CRC32:294af00d -packet|codec_type=audio|stream_index=0|pts=216760320|pts_time=15.360000|dts=216760320|dts_time=15.360000|duration=368640|duration_time=0.026122|size=417|pos=247211|flags=K_|data_hash=CRC32:14a8bd71 -packet|codec_type=audio|stream_index=0|pts=217128960|pts_time=15.386122|dts=217128960|dts_time=15.386122|duration=368640|duration_time=0.026122|size=418|pos=247628|flags=K_|data_hash=CRC32:10afdcd0 -packet|codec_type=audio|stream_index=0|pts=217497600|pts_time=15.412245|dts=217497600|dts_time=15.412245|duration=368640|duration_time=0.026122|size=418|pos=248046|flags=K_|data_hash=CRC32:dc78174d -packet|codec_type=audio|stream_index=0|pts=217866240|pts_time=15.438367|dts=217866240|dts_time=15.438367|duration=368640|duration_time=0.026122|size=418|pos=248464|flags=K_|data_hash=CRC32:0b948a05 -packet|codec_type=audio|stream_index=0|pts=218234880|pts_time=15.464490|dts=218234880|dts_time=15.464490|duration=368640|duration_time=0.026122|size=418|pos=248882|flags=K_|data_hash=CRC32:fbc83c3c -packet|codec_type=audio|stream_index=0|pts=218603520|pts_time=15.490612|dts=218603520|dts_time=15.490612|duration=368640|duration_time=0.026122|size=418|pos=249300|flags=K_|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=303|skip_reason=0|discard_reason=0 -|data_hash=CRC32:d5fb5f9c -packet|codec_type=audio|stream_index=0|pts=218972160|pts_time=15.516735|dts=218972160|dts_time=15.516735|duration=368640|duration_time=0.026122|size=418|pos=249718|flags=K_|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=1152|skip_reason=0|discard_reason=0 -|data_hash=CRC32:3789f3cf -stream|index=0|codec_name=mp3|profile=unknown|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=44100|channels=2|channel_layout=stereo|bits_per_sample=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/14112000|start_pts=353600|start_time=0.025057|duration_ts=219340800|duration=15.542857|bit_rate=128000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=595|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:encoder=LAME3.93 +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=368640|duration_time=0.026122|size=417|pos=1451|flags=K__|data_hash=CRC32:ae0a5066|side_data|side_data_type=Skip Samples|skip_samples=1105|discard_padding=0|skip_reason=0|discard_reason=0 + +packet|codec_type=audio|stream_index=0|pts=368640|pts_time=0.026122|dts=368640|dts_time=0.026122|duration=368640|duration_time=0.026122|size=418|pos=1868|flags=K__|data_hash=CRC32:dbb7aa6c +packet|codec_type=audio|stream_index=0|pts=737280|pts_time=0.052245|dts=737280|dts_time=0.052245|duration=368640|duration_time=0.026122|size=418|pos=2286|flags=K__|data_hash=CRC32:5fe9fd6b +packet|codec_type=audio|stream_index=0|pts=1105920|pts_time=0.078367|dts=1105920|dts_time=0.078367|duration=368640|duration_time=0.026122|size=418|pos=2704|flags=K__|data_hash=CRC32:baec14f8 +packet|codec_type=audio|stream_index=0|pts=1474560|pts_time=0.104490|dts=1474560|dts_time=0.104490|duration=368640|duration_time=0.026122|size=418|pos=3122|flags=K__|data_hash=CRC32:9916a4cf +packet|codec_type=audio|stream_index=0|pts=1843200|pts_time=0.130612|dts=1843200|dts_time=0.130612|duration=368640|duration_time=0.026122|size=418|pos=3540|flags=K__|data_hash=CRC32:a5897354 +packet|codec_type=audio|stream_index=0|pts=2211840|pts_time=0.156735|dts=2211840|dts_time=0.156735|duration=368640|duration_time=0.026122|size=418|pos=3958|flags=K__|data_hash=CRC32:3b3bd4e1 +packet|codec_type=audio|stream_index=0|pts=2580480|pts_time=0.182857|dts=2580480|dts_time=0.182857|duration=368640|duration_time=0.026122|size=418|pos=4376|flags=K__|data_hash=CRC32:5a319d96 +packet|codec_type=audio|stream_index=0|pts=2949120|pts_time=0.208980|dts=2949120|dts_time=0.208980|duration=368640|duration_time=0.026122|size=418|pos=4794|flags=K__|data_hash=CRC32:c62a20be +packet|codec_type=audio|stream_index=0|pts=3317760|pts_time=0.235102|dts=3317760|dts_time=0.235102|duration=368640|duration_time=0.026122|size=418|pos=5212|flags=K__|data_hash=CRC32:233edc53 +packet|codec_type=audio|stream_index=0|pts=3686400|pts_time=0.261224|dts=3686400|dts_time=0.261224|duration=368640|duration_time=0.026122|size=418|pos=5630|flags=K__|data_hash=CRC32:62ff9ae2 +packet|codec_type=audio|stream_index=0|pts=4055040|pts_time=0.287347|dts=4055040|dts_time=0.287347|duration=368640|duration_time=0.026122|size=418|pos=6048|flags=K__|data_hash=CRC32:de77ed5e +packet|codec_type=audio|stream_index=0|pts=4423680|pts_time=0.313469|dts=4423680|dts_time=0.313469|duration=368640|duration_time=0.026122|size=418|pos=6466|flags=K__|data_hash=CRC32:1ea533a1 +packet|codec_type=audio|stream_index=0|pts=4792320|pts_time=0.339592|dts=4792320|dts_time=0.339592|duration=368640|duration_time=0.026122|size=418|pos=6884|flags=K__|data_hash=CRC32:b5b48e4b +packet|codec_type=audio|stream_index=0|pts=5160960|pts_time=0.365714|dts=5160960|dts_time=0.365714|duration=368640|duration_time=0.026122|size=418|pos=7302|flags=K__|data_hash=CRC32:afdcd44b +packet|codec_type=audio|stream_index=0|pts=5529600|pts_time=0.391837|dts=5529600|dts_time=0.391837|duration=368640|duration_time=0.026122|size=418|pos=7720|flags=K__|data_hash=CRC32:10038cf1 +packet|codec_type=audio|stream_index=0|pts=5898240|pts_time=0.417959|dts=5898240|dts_time=0.417959|duration=368640|duration_time=0.026122|size=418|pos=8138|flags=K__|data_hash=CRC32:0d72e0e3 +packet|codec_type=audio|stream_index=0|pts=6266880|pts_time=0.444082|dts=6266880|dts_time=0.444082|duration=368640|duration_time=0.026122|size=418|pos=8556|flags=K__|data_hash=CRC32:7919c1eb +packet|codec_type=audio|stream_index=0|pts=6635520|pts_time=0.470204|dts=6635520|dts_time=0.470204|duration=368640|duration_time=0.026122|size=418|pos=8974|flags=K__|data_hash=CRC32:95549eee +packet|codec_type=audio|stream_index=0|pts=7004160|pts_time=0.496327|dts=7004160|dts_time=0.496327|duration=368640|duration_time=0.026122|size=418|pos=9392|flags=K__|data_hash=CRC32:d8d5c005 +packet|codec_type=audio|stream_index=0|pts=7372800|pts_time=0.522449|dts=7372800|dts_time=0.522449|duration=368640|duration_time=0.026122|size=418|pos=9810|flags=K__|data_hash=CRC32:09a9254b +packet|codec_type=audio|stream_index=0|pts=7741440|pts_time=0.548571|dts=7741440|dts_time=0.548571|duration=368640|duration_time=0.026122|size=418|pos=10228|flags=K__|data_hash=CRC32:29cc7956 +packet|codec_type=audio|stream_index=0|pts=8110080|pts_time=0.574694|dts=8110080|dts_time=0.574694|duration=368640|duration_time=0.026122|size=418|pos=10646|flags=K__|data_hash=CRC32:cb439791 +packet|codec_type=audio|stream_index=0|pts=8478720|pts_time=0.600816|dts=8478720|dts_time=0.600816|duration=368640|duration_time=0.026122|size=418|pos=11064|flags=K__|data_hash=CRC32:7784025b +packet|codec_type=audio|stream_index=0|pts=8847360|pts_time=0.626939|dts=8847360|dts_time=0.626939|duration=368640|duration_time=0.026122|size=418|pos=11482|flags=K__|data_hash=CRC32:ad6d75d3 +packet|codec_type=audio|stream_index=0|pts=9216000|pts_time=0.653061|dts=9216000|dts_time=0.653061|duration=368640|duration_time=0.026122|size=417|pos=11900|flags=K__|data_hash=CRC32:081e0b41 +packet|codec_type=audio|stream_index=0|pts=9584640|pts_time=0.679184|dts=9584640|dts_time=0.679184|duration=368640|duration_time=0.026122|size=418|pos=12317|flags=K__|data_hash=CRC32:3c8c1e54 +packet|codec_type=audio|stream_index=0|pts=9953280|pts_time=0.705306|dts=9953280|dts_time=0.705306|duration=368640|duration_time=0.026122|size=418|pos=12735|flags=K__|data_hash=CRC32:58dea5a2 +packet|codec_type=audio|stream_index=0|pts=10321920|pts_time=0.731429|dts=10321920|dts_time=0.731429|duration=368640|duration_time=0.026122|size=418|pos=13153|flags=K__|data_hash=CRC32:d56daa18 +packet|codec_type=audio|stream_index=0|pts=10690560|pts_time=0.757551|dts=10690560|dts_time=0.757551|duration=368640|duration_time=0.026122|size=418|pos=13571|flags=K__|data_hash=CRC32:ab2b2c48 +packet|codec_type=audio|stream_index=0|pts=11059200|pts_time=0.783673|dts=11059200|dts_time=0.783673|duration=368640|duration_time=0.026122|size=418|pos=13989|flags=K__|data_hash=CRC32:52467934 +packet|codec_type=audio|stream_index=0|pts=11427840|pts_time=0.809796|dts=11427840|dts_time=0.809796|duration=368640|duration_time=0.026122|size=418|pos=14407|flags=K__|data_hash=CRC32:2e8e22fc +packet|codec_type=audio|stream_index=0|pts=11796480|pts_time=0.835918|dts=11796480|dts_time=0.835918|duration=368640|duration_time=0.026122|size=418|pos=14825|flags=K__|data_hash=CRC32:2432d9df +packet|codec_type=audio|stream_index=0|pts=12165120|pts_time=0.862041|dts=12165120|dts_time=0.862041|duration=368640|duration_time=0.026122|size=418|pos=15243|flags=K__|data_hash=CRC32:623666e1 +packet|codec_type=audio|stream_index=0|pts=12533760|pts_time=0.888163|dts=12533760|dts_time=0.888163|duration=368640|duration_time=0.026122|size=418|pos=15661|flags=K__|data_hash=CRC32:7efdc60c +packet|codec_type=audio|stream_index=0|pts=12902400|pts_time=0.914286|dts=12902400|dts_time=0.914286|duration=368640|duration_time=0.026122|size=418|pos=16079|flags=K__|data_hash=CRC32:22e96068 +packet|codec_type=audio|stream_index=0|pts=13271040|pts_time=0.940408|dts=13271040|dts_time=0.940408|duration=368640|duration_time=0.026122|size=418|pos=16497|flags=K__|data_hash=CRC32:544c1b78 +packet|codec_type=audio|stream_index=0|pts=13639680|pts_time=0.966531|dts=13639680|dts_time=0.966531|duration=368640|duration_time=0.026122|size=418|pos=16915|flags=K__|data_hash=CRC32:e9413152 +packet|codec_type=audio|stream_index=0|pts=14008320|pts_time=0.992653|dts=14008320|dts_time=0.992653|duration=368640|duration_time=0.026122|size=418|pos=17333|flags=K__|data_hash=CRC32:f1737ca4 +packet|codec_type=audio|stream_index=0|pts=14376960|pts_time=1.018776|dts=14376960|dts_time=1.018776|duration=368640|duration_time=0.026122|size=418|pos=17751|flags=K__|data_hash=CRC32:31f7139f +packet|codec_type=audio|stream_index=0|pts=14745600|pts_time=1.044898|dts=14745600|dts_time=1.044898|duration=368640|duration_time=0.026122|size=418|pos=18169|flags=K__|data_hash=CRC32:f330de95 +packet|codec_type=audio|stream_index=0|pts=15114240|pts_time=1.071020|dts=15114240|dts_time=1.071020|duration=368640|duration_time=0.026122|size=418|pos=18587|flags=K__|data_hash=CRC32:6ea0d79f +packet|codec_type=audio|stream_index=0|pts=15482880|pts_time=1.097143|dts=15482880|dts_time=1.097143|duration=368640|duration_time=0.026122|size=418|pos=19005|flags=K__|data_hash=CRC32:cd141c49 +packet|codec_type=audio|stream_index=0|pts=15851520|pts_time=1.123265|dts=15851520|dts_time=1.123265|duration=368640|duration_time=0.026122|size=418|pos=19423|flags=K__|data_hash=CRC32:45c367a6 +packet|codec_type=audio|stream_index=0|pts=16220160|pts_time=1.149388|dts=16220160|dts_time=1.149388|duration=368640|duration_time=0.026122|size=418|pos=19841|flags=K__|data_hash=CRC32:cd89cd56 +packet|codec_type=audio|stream_index=0|pts=16588800|pts_time=1.175510|dts=16588800|dts_time=1.175510|duration=368640|duration_time=0.026122|size=418|pos=20259|flags=K__|data_hash=CRC32:a293ff84 +packet|codec_type=audio|stream_index=0|pts=16957440|pts_time=1.201633|dts=16957440|dts_time=1.201633|duration=368640|duration_time=0.026122|size=418|pos=20677|flags=K__|data_hash=CRC32:a3c6725e +packet|codec_type=audio|stream_index=0|pts=17326080|pts_time=1.227755|dts=17326080|dts_time=1.227755|duration=368640|duration_time=0.026122|size=418|pos=21095|flags=K__|data_hash=CRC32:be091252 +packet|codec_type=audio|stream_index=0|pts=17694720|pts_time=1.253878|dts=17694720|dts_time=1.253878|duration=368640|duration_time=0.026122|size=418|pos=21513|flags=K__|data_hash=CRC32:a5135f75 +packet|codec_type=audio|stream_index=0|pts=18063360|pts_time=1.280000|dts=18063360|dts_time=1.280000|duration=368640|duration_time=0.026122|size=417|pos=21931|flags=K__|data_hash=CRC32:8225dd66 +packet|codec_type=audio|stream_index=0|pts=18432000|pts_time=1.306122|dts=18432000|dts_time=1.306122|duration=368640|duration_time=0.026122|size=418|pos=22348|flags=K__|data_hash=CRC32:7b1db59c +packet|codec_type=audio|stream_index=0|pts=18800640|pts_time=1.332245|dts=18800640|dts_time=1.332245|duration=368640|duration_time=0.026122|size=418|pos=22766|flags=K__|data_hash=CRC32:e5897689 +packet|codec_type=audio|stream_index=0|pts=19169280|pts_time=1.358367|dts=19169280|dts_time=1.358367|duration=368640|duration_time=0.026122|size=418|pos=23184|flags=K__|data_hash=CRC32:94929aa7 +packet|codec_type=audio|stream_index=0|pts=19537920|pts_time=1.384490|dts=19537920|dts_time=1.384490|duration=368640|duration_time=0.026122|size=418|pos=23602|flags=K__|data_hash=CRC32:65697a12 +packet|codec_type=audio|stream_index=0|pts=19906560|pts_time=1.410612|dts=19906560|dts_time=1.410612|duration=368640|duration_time=0.026122|size=418|pos=24020|flags=K__|data_hash=CRC32:18f69ad3 +packet|codec_type=audio|stream_index=0|pts=20275200|pts_time=1.436735|dts=20275200|dts_time=1.436735|duration=368640|duration_time=0.026122|size=418|pos=24438|flags=K__|data_hash=CRC32:47ab41f0 +packet|codec_type=audio|stream_index=0|pts=20643840|pts_time=1.462857|dts=20643840|dts_time=1.462857|duration=368640|duration_time=0.026122|size=418|pos=24856|flags=K__|data_hash=CRC32:75879cf2 +packet|codec_type=audio|stream_index=0|pts=21012480|pts_time=1.488980|dts=21012480|dts_time=1.488980|duration=368640|duration_time=0.026122|size=418|pos=25274|flags=K__|data_hash=CRC32:d43c0882 +packet|codec_type=audio|stream_index=0|pts=21381120|pts_time=1.515102|dts=21381120|dts_time=1.515102|duration=368640|duration_time=0.026122|size=418|pos=25692|flags=K__|data_hash=CRC32:3b9a22da +packet|codec_type=audio|stream_index=0|pts=21749760|pts_time=1.541224|dts=21749760|dts_time=1.541224|duration=368640|duration_time=0.026122|size=418|pos=26110|flags=K__|data_hash=CRC32:ec698fec +packet|codec_type=audio|stream_index=0|pts=22118400|pts_time=1.567347|dts=22118400|dts_time=1.567347|duration=368640|duration_time=0.026122|size=418|pos=26528|flags=K__|data_hash=CRC32:ca99d2c0 +packet|codec_type=audio|stream_index=0|pts=22487040|pts_time=1.593469|dts=22487040|dts_time=1.593469|duration=368640|duration_time=0.026122|size=418|pos=26946|flags=K__|data_hash=CRC32:fa370e06 +packet|codec_type=audio|stream_index=0|pts=22855680|pts_time=1.619592|dts=22855680|dts_time=1.619592|duration=368640|duration_time=0.026122|size=418|pos=27364|flags=K__|data_hash=CRC32:9522fdd4 +packet|codec_type=audio|stream_index=0|pts=23224320|pts_time=1.645714|dts=23224320|dts_time=1.645714|duration=368640|duration_time=0.026122|size=418|pos=27782|flags=K__|data_hash=CRC32:d6bd9ba4 +packet|codec_type=audio|stream_index=0|pts=23592960|pts_time=1.671837|dts=23592960|dts_time=1.671837|duration=368640|duration_time=0.026122|size=418|pos=28200|flags=K__|data_hash=CRC32:f4689266 +packet|codec_type=audio|stream_index=0|pts=23961600|pts_time=1.697959|dts=23961600|dts_time=1.697959|duration=368640|duration_time=0.026122|size=418|pos=28618|flags=K__|data_hash=CRC32:ea1aaa66 +packet|codec_type=audio|stream_index=0|pts=24330240|pts_time=1.724082|dts=24330240|dts_time=1.724082|duration=368640|duration_time=0.026122|size=418|pos=29036|flags=K__|data_hash=CRC32:fb547f37 +packet|codec_type=audio|stream_index=0|pts=24698880|pts_time=1.750204|dts=24698880|dts_time=1.750204|duration=368640|duration_time=0.026122|size=418|pos=29454|flags=K__|data_hash=CRC32:78f84f3f +packet|codec_type=audio|stream_index=0|pts=25067520|pts_time=1.776327|dts=25067520|dts_time=1.776327|duration=368640|duration_time=0.026122|size=418|pos=29872|flags=K__|data_hash=CRC32:db07bf11 +packet|codec_type=audio|stream_index=0|pts=25436160|pts_time=1.802449|dts=25436160|dts_time=1.802449|duration=368640|duration_time=0.026122|size=418|pos=30290|flags=K__|data_hash=CRC32:77bb035b +packet|codec_type=audio|stream_index=0|pts=25804800|pts_time=1.828571|dts=25804800|dts_time=1.828571|duration=368640|duration_time=0.026122|size=418|pos=30708|flags=K__|data_hash=CRC32:23378de7 +packet|codec_type=audio|stream_index=0|pts=26173440|pts_time=1.854694|dts=26173440|dts_time=1.854694|duration=368640|duration_time=0.026122|size=418|pos=31126|flags=K__|data_hash=CRC32:17e3e719 +packet|codec_type=audio|stream_index=0|pts=26542080|pts_time=1.880816|dts=26542080|dts_time=1.880816|duration=368640|duration_time=0.026122|size=418|pos=31544|flags=K__|data_hash=CRC32:b33797de +packet|codec_type=audio|stream_index=0|pts=26910720|pts_time=1.906939|dts=26910720|dts_time=1.906939|duration=368640|duration_time=0.026122|size=418|pos=31962|flags=K__|data_hash=CRC32:d585f179 +packet|codec_type=audio|stream_index=0|pts=27279360|pts_time=1.933061|dts=27279360|dts_time=1.933061|duration=368640|duration_time=0.026122|size=417|pos=32380|flags=K__|data_hash=CRC32:469f8f74 +packet|codec_type=audio|stream_index=0|pts=27648000|pts_time=1.959184|dts=27648000|dts_time=1.959184|duration=368640|duration_time=0.026122|size=418|pos=32797|flags=K__|data_hash=CRC32:fd53cf2f +packet|codec_type=audio|stream_index=0|pts=28016640|pts_time=1.985306|dts=28016640|dts_time=1.985306|duration=368640|duration_time=0.026122|size=418|pos=33215|flags=K__|data_hash=CRC32:5a37e9ae +packet|codec_type=audio|stream_index=0|pts=28385280|pts_time=2.011429|dts=28385280|dts_time=2.011429|duration=368640|duration_time=0.026122|size=418|pos=33633|flags=K__|data_hash=CRC32:123bf9d4 +packet|codec_type=audio|stream_index=0|pts=28753920|pts_time=2.037551|dts=28753920|dts_time=2.037551|duration=368640|duration_time=0.026122|size=418|pos=34051|flags=K__|data_hash=CRC32:a3d4074d +packet|codec_type=audio|stream_index=0|pts=29122560|pts_time=2.063673|dts=29122560|dts_time=2.063673|duration=368640|duration_time=0.026122|size=418|pos=34469|flags=K__|data_hash=CRC32:d79d5351 +packet|codec_type=audio|stream_index=0|pts=29491200|pts_time=2.089796|dts=29491200|dts_time=2.089796|duration=368640|duration_time=0.026122|size=418|pos=34887|flags=K__|data_hash=CRC32:d9a54e49 +packet|codec_type=audio|stream_index=0|pts=29859840|pts_time=2.115918|dts=29859840|dts_time=2.115918|duration=368640|duration_time=0.026122|size=418|pos=35305|flags=K__|data_hash=CRC32:e3f6826f +packet|codec_type=audio|stream_index=0|pts=30228480|pts_time=2.142041|dts=30228480|dts_time=2.142041|duration=368640|duration_time=0.026122|size=418|pos=35723|flags=K__|data_hash=CRC32:2ab209b1 +packet|codec_type=audio|stream_index=0|pts=30597120|pts_time=2.168163|dts=30597120|dts_time=2.168163|duration=368640|duration_time=0.026122|size=418|pos=36141|flags=K__|data_hash=CRC32:bec119c0 +packet|codec_type=audio|stream_index=0|pts=30965760|pts_time=2.194286|dts=30965760|dts_time=2.194286|duration=368640|duration_time=0.026122|size=418|pos=36559|flags=K__|data_hash=CRC32:5e3e13bf +packet|codec_type=audio|stream_index=0|pts=31334400|pts_time=2.220408|dts=31334400|dts_time=2.220408|duration=368640|duration_time=0.026122|size=418|pos=36977|flags=K__|data_hash=CRC32:b725b85c +packet|codec_type=audio|stream_index=0|pts=31703040|pts_time=2.246531|dts=31703040|dts_time=2.246531|duration=368640|duration_time=0.026122|size=418|pos=37395|flags=K__|data_hash=CRC32:e650f974 +packet|codec_type=audio|stream_index=0|pts=32071680|pts_time=2.272653|dts=32071680|dts_time=2.272653|duration=368640|duration_time=0.026122|size=418|pos=37813|flags=K__|data_hash=CRC32:6edc5628 +packet|codec_type=audio|stream_index=0|pts=32440320|pts_time=2.298776|dts=32440320|dts_time=2.298776|duration=368640|duration_time=0.026122|size=418|pos=38231|flags=K__|data_hash=CRC32:37adc162 +packet|codec_type=audio|stream_index=0|pts=32808960|pts_time=2.324898|dts=32808960|dts_time=2.324898|duration=368640|duration_time=0.026122|size=418|pos=38649|flags=K__|data_hash=CRC32:a4b7042e +packet|codec_type=audio|stream_index=0|pts=33177600|pts_time=2.351020|dts=33177600|dts_time=2.351020|duration=368640|duration_time=0.026122|size=418|pos=39067|flags=K__|data_hash=CRC32:c0e98589 +packet|codec_type=audio|stream_index=0|pts=33546240|pts_time=2.377143|dts=33546240|dts_time=2.377143|duration=368640|duration_time=0.026122|size=418|pos=39485|flags=K__|data_hash=CRC32:480fd334 +packet|codec_type=audio|stream_index=0|pts=33914880|pts_time=2.403265|dts=33914880|dts_time=2.403265|duration=368640|duration_time=0.026122|size=418|pos=39903|flags=K__|data_hash=CRC32:4e5d606f +packet|codec_type=audio|stream_index=0|pts=34283520|pts_time=2.429388|dts=34283520|dts_time=2.429388|duration=368640|duration_time=0.026122|size=418|pos=40321|flags=K__|data_hash=CRC32:2d18c337 +packet|codec_type=audio|stream_index=0|pts=34652160|pts_time=2.455510|dts=34652160|dts_time=2.455510|duration=368640|duration_time=0.026122|size=418|pos=40739|flags=K__|data_hash=CRC32:288170f4 +packet|codec_type=audio|stream_index=0|pts=35020800|pts_time=2.481633|dts=35020800|dts_time=2.481633|duration=368640|duration_time=0.026122|size=418|pos=41157|flags=K__|data_hash=CRC32:ce5f7aa9 +packet|codec_type=audio|stream_index=0|pts=35389440|pts_time=2.507755|dts=35389440|dts_time=2.507755|duration=368640|duration_time=0.026122|size=418|pos=41575|flags=K__|data_hash=CRC32:1f0a8297 +packet|codec_type=audio|stream_index=0|pts=35758080|pts_time=2.533878|dts=35758080|dts_time=2.533878|duration=368640|duration_time=0.026122|size=418|pos=41993|flags=K__|data_hash=CRC32:4a8b9b61 +packet|codec_type=audio|stream_index=0|pts=36126720|pts_time=2.560000|dts=36126720|dts_time=2.560000|duration=368640|duration_time=0.026122|size=417|pos=42411|flags=K__|data_hash=CRC32:e3a90971 +packet|codec_type=audio|stream_index=0|pts=36495360|pts_time=2.586122|dts=36495360|dts_time=2.586122|duration=368640|duration_time=0.026122|size=418|pos=42828|flags=K__|data_hash=CRC32:f254c3ce +packet|codec_type=audio|stream_index=0|pts=36864000|pts_time=2.612245|dts=36864000|dts_time=2.612245|duration=368640|duration_time=0.026122|size=418|pos=43246|flags=K__|data_hash=CRC32:1867a5a7 +packet|codec_type=audio|stream_index=0|pts=37232640|pts_time=2.638367|dts=37232640|dts_time=2.638367|duration=368640|duration_time=0.026122|size=418|pos=43664|flags=K__|data_hash=CRC32:0d4fd9de +packet|codec_type=audio|stream_index=0|pts=37601280|pts_time=2.664490|dts=37601280|dts_time=2.664490|duration=368640|duration_time=0.026122|size=418|pos=44082|flags=K__|data_hash=CRC32:878c4022 +packet|codec_type=audio|stream_index=0|pts=37969920|pts_time=2.690612|dts=37969920|dts_time=2.690612|duration=368640|duration_time=0.026122|size=418|pos=44500|flags=K__|data_hash=CRC32:d0b5ed85 +packet|codec_type=audio|stream_index=0|pts=38338560|pts_time=2.716735|dts=38338560|dts_time=2.716735|duration=368640|duration_time=0.026122|size=418|pos=44918|flags=K__|data_hash=CRC32:d93b8cae +packet|codec_type=audio|stream_index=0|pts=38707200|pts_time=2.742857|dts=38707200|dts_time=2.742857|duration=368640|duration_time=0.026122|size=418|pos=45336|flags=K__|data_hash=CRC32:33070649 +packet|codec_type=audio|stream_index=0|pts=39075840|pts_time=2.768980|dts=39075840|dts_time=2.768980|duration=368640|duration_time=0.026122|size=418|pos=45754|flags=K__|data_hash=CRC32:2f74cc7e +packet|codec_type=audio|stream_index=0|pts=39444480|pts_time=2.795102|dts=39444480|dts_time=2.795102|duration=368640|duration_time=0.026122|size=418|pos=46172|flags=K__|data_hash=CRC32:3c7146bc +packet|codec_type=audio|stream_index=0|pts=39813120|pts_time=2.821224|dts=39813120|dts_time=2.821224|duration=368640|duration_time=0.026122|size=418|pos=46590|flags=K__|data_hash=CRC32:62967471 +packet|codec_type=audio|stream_index=0|pts=40181760|pts_time=2.847347|dts=40181760|dts_time=2.847347|duration=368640|duration_time=0.026122|size=418|pos=47008|flags=K__|data_hash=CRC32:efd4b940 +packet|codec_type=audio|stream_index=0|pts=40550400|pts_time=2.873469|dts=40550400|dts_time=2.873469|duration=368640|duration_time=0.026122|size=418|pos=47426|flags=K__|data_hash=CRC32:45338c17 +packet|codec_type=audio|stream_index=0|pts=40919040|pts_time=2.899592|dts=40919040|dts_time=2.899592|duration=368640|duration_time=0.026122|size=418|pos=47844|flags=K__|data_hash=CRC32:0806e97f +packet|codec_type=audio|stream_index=0|pts=41287680|pts_time=2.925714|dts=41287680|dts_time=2.925714|duration=368640|duration_time=0.026122|size=418|pos=48262|flags=K__|data_hash=CRC32:7fa8c136 +packet|codec_type=audio|stream_index=0|pts=41656320|pts_time=2.951837|dts=41656320|dts_time=2.951837|duration=368640|duration_time=0.026122|size=418|pos=48680|flags=K__|data_hash=CRC32:78d7f3e3 +packet|codec_type=audio|stream_index=0|pts=42024960|pts_time=2.977959|dts=42024960|dts_time=2.977959|duration=368640|duration_time=0.026122|size=418|pos=49098|flags=K__|data_hash=CRC32:eb7f4484 +packet|codec_type=audio|stream_index=0|pts=42393600|pts_time=3.004082|dts=42393600|dts_time=3.004082|duration=368640|duration_time=0.026122|size=418|pos=49516|flags=K__|data_hash=CRC32:a2a3f48d +packet|codec_type=audio|stream_index=0|pts=42762240|pts_time=3.030204|dts=42762240|dts_time=3.030204|duration=368640|duration_time=0.026122|size=418|pos=49934|flags=K__|data_hash=CRC32:c478db4a +packet|codec_type=audio|stream_index=0|pts=43130880|pts_time=3.056327|dts=43130880|dts_time=3.056327|duration=368640|duration_time=0.026122|size=418|pos=50352|flags=K__|data_hash=CRC32:e40731af +packet|codec_type=audio|stream_index=0|pts=43499520|pts_time=3.082449|dts=43499520|dts_time=3.082449|duration=368640|duration_time=0.026122|size=418|pos=50770|flags=K__|data_hash=CRC32:74603e95 +packet|codec_type=audio|stream_index=0|pts=43868160|pts_time=3.108571|dts=43868160|dts_time=3.108571|duration=368640|duration_time=0.026122|size=418|pos=51188|flags=K__|data_hash=CRC32:6486340f +packet|codec_type=audio|stream_index=0|pts=44236800|pts_time=3.134694|dts=44236800|dts_time=3.134694|duration=368640|duration_time=0.026122|size=418|pos=51606|flags=K__|data_hash=CRC32:8cda2b23 +packet|codec_type=audio|stream_index=0|pts=44605440|pts_time=3.160816|dts=44605440|dts_time=3.160816|duration=368640|duration_time=0.026122|size=418|pos=52024|flags=K__|data_hash=CRC32:b0bd790d +packet|codec_type=audio|stream_index=0|pts=44974080|pts_time=3.186939|dts=44974080|dts_time=3.186939|duration=368640|duration_time=0.026122|size=418|pos=52442|flags=K__|data_hash=CRC32:5ae7824d +packet|codec_type=audio|stream_index=0|pts=45342720|pts_time=3.213061|dts=45342720|dts_time=3.213061|duration=368640|duration_time=0.026122|size=417|pos=52860|flags=K__|data_hash=CRC32:8ef12cf9 +packet|codec_type=audio|stream_index=0|pts=45711360|pts_time=3.239184|dts=45711360|dts_time=3.239184|duration=368640|duration_time=0.026122|size=418|pos=53277|flags=K__|data_hash=CRC32:7426d3d8 +packet|codec_type=audio|stream_index=0|pts=46080000|pts_time=3.265306|dts=46080000|dts_time=3.265306|duration=368640|duration_time=0.026122|size=418|pos=53695|flags=K__|data_hash=CRC32:87ddbc34 +packet|codec_type=audio|stream_index=0|pts=46448640|pts_time=3.291429|dts=46448640|dts_time=3.291429|duration=368640|duration_time=0.026122|size=418|pos=54113|flags=K__|data_hash=CRC32:18375ee3 +packet|codec_type=audio|stream_index=0|pts=46817280|pts_time=3.317551|dts=46817280|dts_time=3.317551|duration=368640|duration_time=0.026122|size=418|pos=54531|flags=K__|data_hash=CRC32:1b28b358 +packet|codec_type=audio|stream_index=0|pts=47185920|pts_time=3.343673|dts=47185920|dts_time=3.343673|duration=368640|duration_time=0.026122|size=418|pos=54949|flags=K__|data_hash=CRC32:576d401d +packet|codec_type=audio|stream_index=0|pts=47554560|pts_time=3.369796|dts=47554560|dts_time=3.369796|duration=368640|duration_time=0.026122|size=418|pos=55367|flags=K__|data_hash=CRC32:db2ab4fc +packet|codec_type=audio|stream_index=0|pts=47923200|pts_time=3.395918|dts=47923200|dts_time=3.395918|duration=368640|duration_time=0.026122|size=418|pos=55785|flags=K__|data_hash=CRC32:78ca7f79 +packet|codec_type=audio|stream_index=0|pts=48291840|pts_time=3.422041|dts=48291840|dts_time=3.422041|duration=368640|duration_time=0.026122|size=418|pos=56203|flags=K__|data_hash=CRC32:a35e5abd +packet|codec_type=audio|stream_index=0|pts=48660480|pts_time=3.448163|dts=48660480|dts_time=3.448163|duration=368640|duration_time=0.026122|size=418|pos=56621|flags=K__|data_hash=CRC32:682643d6 +packet|codec_type=audio|stream_index=0|pts=49029120|pts_time=3.474286|dts=49029120|dts_time=3.474286|duration=368640|duration_time=0.026122|size=418|pos=57039|flags=K__|data_hash=CRC32:e676c49e +packet|codec_type=audio|stream_index=0|pts=49397760|pts_time=3.500408|dts=49397760|dts_time=3.500408|duration=368640|duration_time=0.026122|size=418|pos=57457|flags=K__|data_hash=CRC32:b41299c0 +packet|codec_type=audio|stream_index=0|pts=49766400|pts_time=3.526531|dts=49766400|dts_time=3.526531|duration=368640|duration_time=0.026122|size=418|pos=57875|flags=K__|data_hash=CRC32:19a7a028 +packet|codec_type=audio|stream_index=0|pts=50135040|pts_time=3.552653|dts=50135040|dts_time=3.552653|duration=368640|duration_time=0.026122|size=418|pos=58293|flags=K__|data_hash=CRC32:e1d92031 +packet|codec_type=audio|stream_index=0|pts=50503680|pts_time=3.578776|dts=50503680|dts_time=3.578776|duration=368640|duration_time=0.026122|size=418|pos=58711|flags=K__|data_hash=CRC32:6fb22e33 +packet|codec_type=audio|stream_index=0|pts=50872320|pts_time=3.604898|dts=50872320|dts_time=3.604898|duration=368640|duration_time=0.026122|size=418|pos=59129|flags=K__|data_hash=CRC32:10096a70 +packet|codec_type=audio|stream_index=0|pts=51240960|pts_time=3.631020|dts=51240960|dts_time=3.631020|duration=368640|duration_time=0.026122|size=418|pos=59547|flags=K__|data_hash=CRC32:57c4a982 +packet|codec_type=audio|stream_index=0|pts=51609600|pts_time=3.657143|dts=51609600|dts_time=3.657143|duration=368640|duration_time=0.026122|size=418|pos=59965|flags=K__|data_hash=CRC32:a705d327 +packet|codec_type=audio|stream_index=0|pts=51978240|pts_time=3.683265|dts=51978240|dts_time=3.683265|duration=368640|duration_time=0.026122|size=418|pos=60383|flags=K__|data_hash=CRC32:7c2beb09 +packet|codec_type=audio|stream_index=0|pts=52346880|pts_time=3.709388|dts=52346880|dts_time=3.709388|duration=368640|duration_time=0.026122|size=418|pos=60801|flags=K__|data_hash=CRC32:7b3d1a15 +packet|codec_type=audio|stream_index=0|pts=52715520|pts_time=3.735510|dts=52715520|dts_time=3.735510|duration=368640|duration_time=0.026122|size=418|pos=61219|flags=K__|data_hash=CRC32:f99045c1 +packet|codec_type=audio|stream_index=0|pts=53084160|pts_time=3.761633|dts=53084160|dts_time=3.761633|duration=368640|duration_time=0.026122|size=418|pos=61637|flags=K__|data_hash=CRC32:dd02d72d +packet|codec_type=audio|stream_index=0|pts=53452800|pts_time=3.787755|dts=53452800|dts_time=3.787755|duration=368640|duration_time=0.026122|size=418|pos=62055|flags=K__|data_hash=CRC32:0606b50a +packet|codec_type=audio|stream_index=0|pts=53821440|pts_time=3.813878|dts=53821440|dts_time=3.813878|duration=368640|duration_time=0.026122|size=418|pos=62473|flags=K__|data_hash=CRC32:bd5ce543 +packet|codec_type=audio|stream_index=0|pts=54190080|pts_time=3.840000|dts=54190080|dts_time=3.840000|duration=368640|duration_time=0.026122|size=417|pos=62891|flags=K__|data_hash=CRC32:feabd4b3 +packet|codec_type=audio|stream_index=0|pts=54558720|pts_time=3.866122|dts=54558720|dts_time=3.866122|duration=368640|duration_time=0.026122|size=418|pos=63308|flags=K__|data_hash=CRC32:0d89c582 +packet|codec_type=audio|stream_index=0|pts=54927360|pts_time=3.892245|dts=54927360|dts_time=3.892245|duration=368640|duration_time=0.026122|size=418|pos=63726|flags=K__|data_hash=CRC32:88664f54 +packet|codec_type=audio|stream_index=0|pts=55296000|pts_time=3.918367|dts=55296000|dts_time=3.918367|duration=368640|duration_time=0.026122|size=418|pos=64144|flags=K__|data_hash=CRC32:f94cac9a +packet|codec_type=audio|stream_index=0|pts=55664640|pts_time=3.944490|dts=55664640|dts_time=3.944490|duration=368640|duration_time=0.026122|size=418|pos=64562|flags=K__|data_hash=CRC32:317dc642 +packet|codec_type=audio|stream_index=0|pts=56033280|pts_time=3.970612|dts=56033280|dts_time=3.970612|duration=368640|duration_time=0.026122|size=418|pos=64980|flags=K__|data_hash=CRC32:478887cd +packet|codec_type=audio|stream_index=0|pts=56401920|pts_time=3.996735|dts=56401920|dts_time=3.996735|duration=368640|duration_time=0.026122|size=418|pos=65398|flags=K__|data_hash=CRC32:4f8ce9d9 +packet|codec_type=audio|stream_index=0|pts=56770560|pts_time=4.022857|dts=56770560|dts_time=4.022857|duration=368640|duration_time=0.026122|size=418|pos=65816|flags=K__|data_hash=CRC32:a2af903e +packet|codec_type=audio|stream_index=0|pts=57139200|pts_time=4.048980|dts=57139200|dts_time=4.048980|duration=368640|duration_time=0.026122|size=418|pos=66234|flags=K__|data_hash=CRC32:43fd701a +packet|codec_type=audio|stream_index=0|pts=57507840|pts_time=4.075102|dts=57507840|dts_time=4.075102|duration=368640|duration_time=0.026122|size=418|pos=66652|flags=K__|data_hash=CRC32:1b823ca6 +packet|codec_type=audio|stream_index=0|pts=57876480|pts_time=4.101224|dts=57876480|dts_time=4.101224|duration=368640|duration_time=0.026122|size=418|pos=67070|flags=K__|data_hash=CRC32:bb5fc2a0 +packet|codec_type=audio|stream_index=0|pts=58245120|pts_time=4.127347|dts=58245120|dts_time=4.127347|duration=368640|duration_time=0.026122|size=418|pos=67488|flags=K__|data_hash=CRC32:9597c685 +packet|codec_type=audio|stream_index=0|pts=58613760|pts_time=4.153469|dts=58613760|dts_time=4.153469|duration=368640|duration_time=0.026122|size=418|pos=67906|flags=K__|data_hash=CRC32:1800cbc7 +packet|codec_type=audio|stream_index=0|pts=58982400|pts_time=4.179592|dts=58982400|dts_time=4.179592|duration=368640|duration_time=0.026122|size=418|pos=68324|flags=K__|data_hash=CRC32:93d29987 +packet|codec_type=audio|stream_index=0|pts=59351040|pts_time=4.205714|dts=59351040|dts_time=4.205714|duration=368640|duration_time=0.026122|size=418|pos=68742|flags=K__|data_hash=CRC32:101eaf05 +packet|codec_type=audio|stream_index=0|pts=59719680|pts_time=4.231837|dts=59719680|dts_time=4.231837|duration=368640|duration_time=0.026122|size=418|pos=69160|flags=K__|data_hash=CRC32:3098d5d0 +packet|codec_type=audio|stream_index=0|pts=60088320|pts_time=4.257959|dts=60088320|dts_time=4.257959|duration=368640|duration_time=0.026122|size=418|pos=69578|flags=K__|data_hash=CRC32:a0435280 +packet|codec_type=audio|stream_index=0|pts=60456960|pts_time=4.284082|dts=60456960|dts_time=4.284082|duration=368640|duration_time=0.026122|size=418|pos=69996|flags=K__|data_hash=CRC32:a583c03b +packet|codec_type=audio|stream_index=0|pts=60825600|pts_time=4.310204|dts=60825600|dts_time=4.310204|duration=368640|duration_time=0.026122|size=418|pos=70414|flags=K__|data_hash=CRC32:11122d17 +packet|codec_type=audio|stream_index=0|pts=61194240|pts_time=4.336327|dts=61194240|dts_time=4.336327|duration=368640|duration_time=0.026122|size=418|pos=70832|flags=K__|data_hash=CRC32:3f3070b1 +packet|codec_type=audio|stream_index=0|pts=61562880|pts_time=4.362449|dts=61562880|dts_time=4.362449|duration=368640|duration_time=0.026122|size=418|pos=71250|flags=K__|data_hash=CRC32:7fcf2489 +packet|codec_type=audio|stream_index=0|pts=61931520|pts_time=4.388571|dts=61931520|dts_time=4.388571|duration=368640|duration_time=0.026122|size=418|pos=71668|flags=K__|data_hash=CRC32:112b3e44 +packet|codec_type=audio|stream_index=0|pts=62300160|pts_time=4.414694|dts=62300160|dts_time=4.414694|duration=368640|duration_time=0.026122|size=418|pos=72086|flags=K__|data_hash=CRC32:5033b587 +packet|codec_type=audio|stream_index=0|pts=62668800|pts_time=4.440816|dts=62668800|dts_time=4.440816|duration=368640|duration_time=0.026122|size=418|pos=72504|flags=K__|data_hash=CRC32:9cb52ea5 +packet|codec_type=audio|stream_index=0|pts=63037440|pts_time=4.466939|dts=63037440|dts_time=4.466939|duration=368640|duration_time=0.026122|size=418|pos=72922|flags=K__|data_hash=CRC32:5630d818 +packet|codec_type=audio|stream_index=0|pts=63406080|pts_time=4.493061|dts=63406080|dts_time=4.493061|duration=368640|duration_time=0.026122|size=417|pos=73340|flags=K__|data_hash=CRC32:328534f2 +packet|codec_type=audio|stream_index=0|pts=63774720|pts_time=4.519184|dts=63774720|dts_time=4.519184|duration=368640|duration_time=0.026122|size=418|pos=73757|flags=K__|data_hash=CRC32:6d57605f +packet|codec_type=audio|stream_index=0|pts=64143360|pts_time=4.545306|dts=64143360|dts_time=4.545306|duration=368640|duration_time=0.026122|size=418|pos=74175|flags=K__|data_hash=CRC32:e79fd1bb +packet|codec_type=audio|stream_index=0|pts=64512000|pts_time=4.571429|dts=64512000|dts_time=4.571429|duration=368640|duration_time=0.026122|size=418|pos=74593|flags=K__|data_hash=CRC32:b61e5e9a +packet|codec_type=audio|stream_index=0|pts=64880640|pts_time=4.597551|dts=64880640|dts_time=4.597551|duration=368640|duration_time=0.026122|size=418|pos=75011|flags=K__|data_hash=CRC32:71bc8fe3 +packet|codec_type=audio|stream_index=0|pts=65249280|pts_time=4.623673|dts=65249280|dts_time=4.623673|duration=368640|duration_time=0.026122|size=418|pos=75429|flags=K__|data_hash=CRC32:72e21ec5 +packet|codec_type=audio|stream_index=0|pts=65617920|pts_time=4.649796|dts=65617920|dts_time=4.649796|duration=368640|duration_time=0.026122|size=418|pos=75847|flags=K__|data_hash=CRC32:f93673ad +packet|codec_type=audio|stream_index=0|pts=65986560|pts_time=4.675918|dts=65986560|dts_time=4.675918|duration=368640|duration_time=0.026122|size=418|pos=76265|flags=K__|data_hash=CRC32:93dffd2d +packet|codec_type=audio|stream_index=0|pts=66355200|pts_time=4.702041|dts=66355200|dts_time=4.702041|duration=368640|duration_time=0.026122|size=418|pos=76683|flags=K__|data_hash=CRC32:b4160eef +packet|codec_type=audio|stream_index=0|pts=66723840|pts_time=4.728163|dts=66723840|dts_time=4.728163|duration=368640|duration_time=0.026122|size=418|pos=77101|flags=K__|data_hash=CRC32:4685fb67 +packet|codec_type=audio|stream_index=0|pts=67092480|pts_time=4.754286|dts=67092480|dts_time=4.754286|duration=368640|duration_time=0.026122|size=418|pos=77519|flags=K__|data_hash=CRC32:b9c9f49c +packet|codec_type=audio|stream_index=0|pts=67461120|pts_time=4.780408|dts=67461120|dts_time=4.780408|duration=368640|duration_time=0.026122|size=418|pos=77937|flags=K__|data_hash=CRC32:97eecd83 +packet|codec_type=audio|stream_index=0|pts=67829760|pts_time=4.806531|dts=67829760|dts_time=4.806531|duration=368640|duration_time=0.026122|size=418|pos=78355|flags=K__|data_hash=CRC32:c5a4d76c +packet|codec_type=audio|stream_index=0|pts=68198400|pts_time=4.832653|dts=68198400|dts_time=4.832653|duration=368640|duration_time=0.026122|size=418|pos=78773|flags=K__|data_hash=CRC32:e693a3e4 +packet|codec_type=audio|stream_index=0|pts=68567040|pts_time=4.858776|dts=68567040|dts_time=4.858776|duration=368640|duration_time=0.026122|size=418|pos=79191|flags=K__|data_hash=CRC32:0596d099 +packet|codec_type=audio|stream_index=0|pts=68935680|pts_time=4.884898|dts=68935680|dts_time=4.884898|duration=368640|duration_time=0.026122|size=418|pos=79609|flags=K__|data_hash=CRC32:cb1ece5e +packet|codec_type=audio|stream_index=0|pts=69304320|pts_time=4.911020|dts=69304320|dts_time=4.911020|duration=368640|duration_time=0.026122|size=418|pos=80027|flags=K__|data_hash=CRC32:04f13287 +packet|codec_type=audio|stream_index=0|pts=69672960|pts_time=4.937143|dts=69672960|dts_time=4.937143|duration=368640|duration_time=0.026122|size=418|pos=80445|flags=K__|data_hash=CRC32:b7288a06 +packet|codec_type=audio|stream_index=0|pts=70041600|pts_time=4.963265|dts=70041600|dts_time=4.963265|duration=368640|duration_time=0.026122|size=418|pos=80863|flags=K__|data_hash=CRC32:da40d80d +packet|codec_type=audio|stream_index=0|pts=70410240|pts_time=4.989388|dts=70410240|dts_time=4.989388|duration=368640|duration_time=0.026122|size=418|pos=81281|flags=K__|data_hash=CRC32:248c54a6 +packet|codec_type=audio|stream_index=0|pts=70778880|pts_time=5.015510|dts=70778880|dts_time=5.015510|duration=368640|duration_time=0.026122|size=418|pos=81699|flags=K__|data_hash=CRC32:c8a6a9a2 +packet|codec_type=audio|stream_index=0|pts=71147520|pts_time=5.041633|dts=71147520|dts_time=5.041633|duration=368640|duration_time=0.026122|size=418|pos=82117|flags=K__|data_hash=CRC32:f2e498bb +packet|codec_type=audio|stream_index=0|pts=71516160|pts_time=5.067755|dts=71516160|dts_time=5.067755|duration=368640|duration_time=0.026122|size=418|pos=82535|flags=K__|data_hash=CRC32:88ae4f13 +packet|codec_type=audio|stream_index=0|pts=71884800|pts_time=5.093878|dts=71884800|dts_time=5.093878|duration=368640|duration_time=0.026122|size=418|pos=82953|flags=K__|data_hash=CRC32:671833ea +packet|codec_type=audio|stream_index=0|pts=72253440|pts_time=5.120000|dts=72253440|dts_time=5.120000|duration=368640|duration_time=0.026122|size=417|pos=83371|flags=K__|data_hash=CRC32:e9300bb8 +packet|codec_type=audio|stream_index=0|pts=72622080|pts_time=5.146122|dts=72622080|dts_time=5.146122|duration=368640|duration_time=0.026122|size=418|pos=83788|flags=K__|data_hash=CRC32:f24ddb8f +packet|codec_type=audio|stream_index=0|pts=72990720|pts_time=5.172245|dts=72990720|dts_time=5.172245|duration=368640|duration_time=0.026122|size=418|pos=84206|flags=K__|data_hash=CRC32:70f61a2c +packet|codec_type=audio|stream_index=0|pts=73359360|pts_time=5.198367|dts=73359360|dts_time=5.198367|duration=368640|duration_time=0.026122|size=418|pos=84624|flags=K__|data_hash=CRC32:73dd76f4 +packet|codec_type=audio|stream_index=0|pts=73728000|pts_time=5.224490|dts=73728000|dts_time=5.224490|duration=368640|duration_time=0.026122|size=418|pos=85042|flags=K__|data_hash=CRC32:0e0502bc +packet|codec_type=audio|stream_index=0|pts=74096640|pts_time=5.250612|dts=74096640|dts_time=5.250612|duration=368640|duration_time=0.026122|size=418|pos=85460|flags=K__|data_hash=CRC32:f014154f +packet|codec_type=audio|stream_index=0|pts=74465280|pts_time=5.276735|dts=74465280|dts_time=5.276735|duration=368640|duration_time=0.026122|size=418|pos=85878|flags=K__|data_hash=CRC32:c937e40d +packet|codec_type=audio|stream_index=0|pts=74833920|pts_time=5.302857|dts=74833920|dts_time=5.302857|duration=368640|duration_time=0.026122|size=418|pos=86296|flags=K__|data_hash=CRC32:4803689b +packet|codec_type=audio|stream_index=0|pts=75202560|pts_time=5.328980|dts=75202560|dts_time=5.328980|duration=368640|duration_time=0.026122|size=418|pos=86714|flags=K__|data_hash=CRC32:22fa34c9 +packet|codec_type=audio|stream_index=0|pts=75571200|pts_time=5.355102|dts=75571200|dts_time=5.355102|duration=368640|duration_time=0.026122|size=418|pos=87132|flags=K__|data_hash=CRC32:178ca70b +packet|codec_type=audio|stream_index=0|pts=75939840|pts_time=5.381224|dts=75939840|dts_time=5.381224|duration=368640|duration_time=0.026122|size=418|pos=87550|flags=K__|data_hash=CRC32:608d220e +packet|codec_type=audio|stream_index=0|pts=76308480|pts_time=5.407347|dts=76308480|dts_time=5.407347|duration=368640|duration_time=0.026122|size=418|pos=87968|flags=K__|data_hash=CRC32:6156090c +packet|codec_type=audio|stream_index=0|pts=76677120|pts_time=5.433469|dts=76677120|dts_time=5.433469|duration=368640|duration_time=0.026122|size=418|pos=88386|flags=K__|data_hash=CRC32:0e137f5c +packet|codec_type=audio|stream_index=0|pts=77045760|pts_time=5.459592|dts=77045760|dts_time=5.459592|duration=368640|duration_time=0.026122|size=418|pos=88804|flags=K__|data_hash=CRC32:1a82efb3 +packet|codec_type=audio|stream_index=0|pts=77414400|pts_time=5.485714|dts=77414400|dts_time=5.485714|duration=368640|duration_time=0.026122|size=418|pos=89222|flags=K__|data_hash=CRC32:6dfaa92a +packet|codec_type=audio|stream_index=0|pts=77783040|pts_time=5.511837|dts=77783040|dts_time=5.511837|duration=368640|duration_time=0.026122|size=418|pos=89640|flags=K__|data_hash=CRC32:0ff57235 +packet|codec_type=audio|stream_index=0|pts=78151680|pts_time=5.537959|dts=78151680|dts_time=5.537959|duration=368640|duration_time=0.026122|size=418|pos=90058|flags=K__|data_hash=CRC32:af6aad5b +packet|codec_type=audio|stream_index=0|pts=78520320|pts_time=5.564082|dts=78520320|dts_time=5.564082|duration=368640|duration_time=0.026122|size=418|pos=90476|flags=K__|data_hash=CRC32:3edc87af +packet|codec_type=audio|stream_index=0|pts=78888960|pts_time=5.590204|dts=78888960|dts_time=5.590204|duration=368640|duration_time=0.026122|size=418|pos=90894|flags=K__|data_hash=CRC32:4e45d2f9 +packet|codec_type=audio|stream_index=0|pts=79257600|pts_time=5.616327|dts=79257600|dts_time=5.616327|duration=368640|duration_time=0.026122|size=418|pos=91312|flags=K__|data_hash=CRC32:3e3d4490 +packet|codec_type=audio|stream_index=0|pts=79626240|pts_time=5.642449|dts=79626240|dts_time=5.642449|duration=368640|duration_time=0.026122|size=418|pos=91730|flags=K__|data_hash=CRC32:ce361a9e +packet|codec_type=audio|stream_index=0|pts=79994880|pts_time=5.668571|dts=79994880|dts_time=5.668571|duration=368640|duration_time=0.026122|size=418|pos=92148|flags=K__|data_hash=CRC32:4b4b5560 +packet|codec_type=audio|stream_index=0|pts=80363520|pts_time=5.694694|dts=80363520|dts_time=5.694694|duration=368640|duration_time=0.026122|size=418|pos=92566|flags=K__|data_hash=CRC32:15778e7b +packet|codec_type=audio|stream_index=0|pts=80732160|pts_time=5.720816|dts=80732160|dts_time=5.720816|duration=368640|duration_time=0.026122|size=418|pos=92984|flags=K__|data_hash=CRC32:6ada6d94 +packet|codec_type=audio|stream_index=0|pts=81100800|pts_time=5.746939|dts=81100800|dts_time=5.746939|duration=368640|duration_time=0.026122|size=418|pos=93402|flags=K__|data_hash=CRC32:3a8d9e78 +packet|codec_type=audio|stream_index=0|pts=81469440|pts_time=5.773061|dts=81469440|dts_time=5.773061|duration=368640|duration_time=0.026122|size=417|pos=93820|flags=K__|data_hash=CRC32:71ba89fd +packet|codec_type=audio|stream_index=0|pts=81838080|pts_time=5.799184|dts=81838080|dts_time=5.799184|duration=368640|duration_time=0.026122|size=418|pos=94237|flags=K__|data_hash=CRC32:16867b8c +packet|codec_type=audio|stream_index=0|pts=82206720|pts_time=5.825306|dts=82206720|dts_time=5.825306|duration=368640|duration_time=0.026122|size=418|pos=94655|flags=K__|data_hash=CRC32:cd7e042c +packet|codec_type=audio|stream_index=0|pts=82575360|pts_time=5.851429|dts=82575360|dts_time=5.851429|duration=368640|duration_time=0.026122|size=418|pos=95073|flags=K__|data_hash=CRC32:d9777ff5 +packet|codec_type=audio|stream_index=0|pts=82944000|pts_time=5.877551|dts=82944000|dts_time=5.877551|duration=368640|duration_time=0.026122|size=418|pos=95491|flags=K__|data_hash=CRC32:015776b6 +packet|codec_type=audio|stream_index=0|pts=83312640|pts_time=5.903673|dts=83312640|dts_time=5.903673|duration=368640|duration_time=0.026122|size=418|pos=95909|flags=K__|data_hash=CRC32:16dbd1ba +packet|codec_type=audio|stream_index=0|pts=83681280|pts_time=5.929796|dts=83681280|dts_time=5.929796|duration=368640|duration_time=0.026122|size=418|pos=96327|flags=K__|data_hash=CRC32:34156e2e +packet|codec_type=audio|stream_index=0|pts=84049920|pts_time=5.955918|dts=84049920|dts_time=5.955918|duration=368640|duration_time=0.026122|size=418|pos=96745|flags=K__|data_hash=CRC32:7ba39adb +packet|codec_type=audio|stream_index=0|pts=84418560|pts_time=5.982041|dts=84418560|dts_time=5.982041|duration=368640|duration_time=0.026122|size=418|pos=97163|flags=K__|data_hash=CRC32:315662c5 +packet|codec_type=audio|stream_index=0|pts=84787200|pts_time=6.008163|dts=84787200|dts_time=6.008163|duration=368640|duration_time=0.026122|size=418|pos=97581|flags=K__|data_hash=CRC32:1d6c6500 +packet|codec_type=audio|stream_index=0|pts=85155840|pts_time=6.034286|dts=85155840|dts_time=6.034286|duration=368640|duration_time=0.026122|size=418|pos=97999|flags=K__|data_hash=CRC32:bc14dad3 +packet|codec_type=audio|stream_index=0|pts=85524480|pts_time=6.060408|dts=85524480|dts_time=6.060408|duration=368640|duration_time=0.026122|size=418|pos=98417|flags=K__|data_hash=CRC32:7719dddd +packet|codec_type=audio|stream_index=0|pts=85893120|pts_time=6.086531|dts=85893120|dts_time=6.086531|duration=368640|duration_time=0.026122|size=418|pos=98835|flags=K__|data_hash=CRC32:132ad1b8 +packet|codec_type=audio|stream_index=0|pts=86261760|pts_time=6.112653|dts=86261760|dts_time=6.112653|duration=368640|duration_time=0.026122|size=418|pos=99253|flags=K__|data_hash=CRC32:2867c127 +packet|codec_type=audio|stream_index=0|pts=86630400|pts_time=6.138776|dts=86630400|dts_time=6.138776|duration=368640|duration_time=0.026122|size=418|pos=99671|flags=K__|data_hash=CRC32:5af3ae3d +packet|codec_type=audio|stream_index=0|pts=86999040|pts_time=6.164898|dts=86999040|dts_time=6.164898|duration=368640|duration_time=0.026122|size=418|pos=100089|flags=K__|data_hash=CRC32:16d31800 +packet|codec_type=audio|stream_index=0|pts=87367680|pts_time=6.191020|dts=87367680|dts_time=6.191020|duration=368640|duration_time=0.026122|size=418|pos=100507|flags=K__|data_hash=CRC32:93a607e1 +packet|codec_type=audio|stream_index=0|pts=87736320|pts_time=6.217143|dts=87736320|dts_time=6.217143|duration=368640|duration_time=0.026122|size=418|pos=100925|flags=K__|data_hash=CRC32:db20f488 +packet|codec_type=audio|stream_index=0|pts=88104960|pts_time=6.243265|dts=88104960|dts_time=6.243265|duration=368640|duration_time=0.026122|size=418|pos=101343|flags=K__|data_hash=CRC32:8f3d4379 +packet|codec_type=audio|stream_index=0|pts=88473600|pts_time=6.269388|dts=88473600|dts_time=6.269388|duration=368640|duration_time=0.026122|size=418|pos=101761|flags=K__|data_hash=CRC32:837d0ec9 +packet|codec_type=audio|stream_index=0|pts=88842240|pts_time=6.295510|dts=88842240|dts_time=6.295510|duration=368640|duration_time=0.026122|size=418|pos=102179|flags=K__|data_hash=CRC32:22a48a51 +packet|codec_type=audio|stream_index=0|pts=89210880|pts_time=6.321633|dts=89210880|dts_time=6.321633|duration=368640|duration_time=0.026122|size=418|pos=102597|flags=K__|data_hash=CRC32:bca25918 +packet|codec_type=audio|stream_index=0|pts=89579520|pts_time=6.347755|dts=89579520|dts_time=6.347755|duration=368640|duration_time=0.026122|size=418|pos=103015|flags=K__|data_hash=CRC32:3db99977 +packet|codec_type=audio|stream_index=0|pts=89948160|pts_time=6.373878|dts=89948160|dts_time=6.373878|duration=368640|duration_time=0.026122|size=418|pos=103433|flags=K__|data_hash=CRC32:faa243b6 +packet|codec_type=audio|stream_index=0|pts=90316800|pts_time=6.400000|dts=90316800|dts_time=6.400000|duration=368640|duration_time=0.026122|size=417|pos=103851|flags=K__|data_hash=CRC32:f725a63e +packet|codec_type=audio|stream_index=0|pts=90685440|pts_time=6.426122|dts=90685440|dts_time=6.426122|duration=368640|duration_time=0.026122|size=418|pos=104268|flags=K__|data_hash=CRC32:76cf3f35 +packet|codec_type=audio|stream_index=0|pts=91054080|pts_time=6.452245|dts=91054080|dts_time=6.452245|duration=368640|duration_time=0.026122|size=418|pos=104686|flags=K__|data_hash=CRC32:2fa3029d +packet|codec_type=audio|stream_index=0|pts=91422720|pts_time=6.478367|dts=91422720|dts_time=6.478367|duration=368640|duration_time=0.026122|size=418|pos=105104|flags=K__|data_hash=CRC32:4a8deeec +packet|codec_type=audio|stream_index=0|pts=91791360|pts_time=6.504490|dts=91791360|dts_time=6.504490|duration=368640|duration_time=0.026122|size=418|pos=105522|flags=K__|data_hash=CRC32:6bb7f1f6 +packet|codec_type=audio|stream_index=0|pts=92160000|pts_time=6.530612|dts=92160000|dts_time=6.530612|duration=368640|duration_time=0.026122|size=418|pos=105940|flags=K__|data_hash=CRC32:e16d50d2 +packet|codec_type=audio|stream_index=0|pts=92528640|pts_time=6.556735|dts=92528640|dts_time=6.556735|duration=368640|duration_time=0.026122|size=418|pos=106358|flags=K__|data_hash=CRC32:b5347035 +packet|codec_type=audio|stream_index=0|pts=92897280|pts_time=6.582857|dts=92897280|dts_time=6.582857|duration=368640|duration_time=0.026122|size=418|pos=106776|flags=K__|data_hash=CRC32:7854e0d2 +packet|codec_type=audio|stream_index=0|pts=93265920|pts_time=6.608980|dts=93265920|dts_time=6.608980|duration=368640|duration_time=0.026122|size=418|pos=107194|flags=K__|data_hash=CRC32:695b58a9 +packet|codec_type=audio|stream_index=0|pts=93634560|pts_time=6.635102|dts=93634560|dts_time=6.635102|duration=368640|duration_time=0.026122|size=418|pos=107612|flags=K__|data_hash=CRC32:edf1b673 +packet|codec_type=audio|stream_index=0|pts=94003200|pts_time=6.661224|dts=94003200|dts_time=6.661224|duration=368640|duration_time=0.026122|size=418|pos=108030|flags=K__|data_hash=CRC32:46324bbb +packet|codec_type=audio|stream_index=0|pts=94371840|pts_time=6.687347|dts=94371840|dts_time=6.687347|duration=368640|duration_time=0.026122|size=418|pos=108448|flags=K__|data_hash=CRC32:e4f2bb26 +packet|codec_type=audio|stream_index=0|pts=94740480|pts_time=6.713469|dts=94740480|dts_time=6.713469|duration=368640|duration_time=0.026122|size=418|pos=108866|flags=K__|data_hash=CRC32:5db12b9c +packet|codec_type=audio|stream_index=0|pts=95109120|pts_time=6.739592|dts=95109120|dts_time=6.739592|duration=368640|duration_time=0.026122|size=418|pos=109284|flags=K__|data_hash=CRC32:36183b69 +packet|codec_type=audio|stream_index=0|pts=95477760|pts_time=6.765714|dts=95477760|dts_time=6.765714|duration=368640|duration_time=0.026122|size=418|pos=109702|flags=K__|data_hash=CRC32:baa2604d +packet|codec_type=audio|stream_index=0|pts=95846400|pts_time=6.791837|dts=95846400|dts_time=6.791837|duration=368640|duration_time=0.026122|size=418|pos=110120|flags=K__|data_hash=CRC32:5ed1c59a +packet|codec_type=audio|stream_index=0|pts=96215040|pts_time=6.817959|dts=96215040|dts_time=6.817959|duration=368640|duration_time=0.026122|size=418|pos=110538|flags=K__|data_hash=CRC32:dc54d5cd +packet|codec_type=audio|stream_index=0|pts=96583680|pts_time=6.844082|dts=96583680|dts_time=6.844082|duration=368640|duration_time=0.026122|size=418|pos=110956|flags=K__|data_hash=CRC32:0fbfd9a0 +packet|codec_type=audio|stream_index=0|pts=96952320|pts_time=6.870204|dts=96952320|dts_time=6.870204|duration=368640|duration_time=0.026122|size=418|pos=111374|flags=K__|data_hash=CRC32:bf3e1f53 +packet|codec_type=audio|stream_index=0|pts=97320960|pts_time=6.896327|dts=97320960|dts_time=6.896327|duration=368640|duration_time=0.026122|size=418|pos=111792|flags=K__|data_hash=CRC32:4ef81515 +packet|codec_type=audio|stream_index=0|pts=97689600|pts_time=6.922449|dts=97689600|dts_time=6.922449|duration=368640|duration_time=0.026122|size=418|pos=112210|flags=K__|data_hash=CRC32:576a9545 +packet|codec_type=audio|stream_index=0|pts=98058240|pts_time=6.948571|dts=98058240|dts_time=6.948571|duration=368640|duration_time=0.026122|size=418|pos=112628|flags=K__|data_hash=CRC32:522a71d5 +packet|codec_type=audio|stream_index=0|pts=98426880|pts_time=6.974694|dts=98426880|dts_time=6.974694|duration=368640|duration_time=0.026122|size=418|pos=113046|flags=K__|data_hash=CRC32:b15d9d3b +packet|codec_type=audio|stream_index=0|pts=98795520|pts_time=7.000816|dts=98795520|dts_time=7.000816|duration=368640|duration_time=0.026122|size=418|pos=113464|flags=K__|data_hash=CRC32:fd9937b8 +packet|codec_type=audio|stream_index=0|pts=99164160|pts_time=7.026939|dts=99164160|dts_time=7.026939|duration=368640|duration_time=0.026122|size=418|pos=113882|flags=K__|data_hash=CRC32:b9331702 +packet|codec_type=audio|stream_index=0|pts=99532800|pts_time=7.053061|dts=99532800|dts_time=7.053061|duration=368640|duration_time=0.026122|size=417|pos=114300|flags=K__|data_hash=CRC32:0e805c6d +packet|codec_type=audio|stream_index=0|pts=99901440|pts_time=7.079184|dts=99901440|dts_time=7.079184|duration=368640|duration_time=0.026122|size=418|pos=114717|flags=K__|data_hash=CRC32:b6f589c8 +packet|codec_type=audio|stream_index=0|pts=100270080|pts_time=7.105306|dts=100270080|dts_time=7.105306|duration=368640|duration_time=0.026122|size=418|pos=115135|flags=K__|data_hash=CRC32:87cfee38 +packet|codec_type=audio|stream_index=0|pts=100638720|pts_time=7.131429|dts=100638720|dts_time=7.131429|duration=368640|duration_time=0.026122|size=418|pos=115553|flags=K__|data_hash=CRC32:d90d4ebe +packet|codec_type=audio|stream_index=0|pts=101007360|pts_time=7.157551|dts=101007360|dts_time=7.157551|duration=368640|duration_time=0.026122|size=418|pos=115971|flags=K__|data_hash=CRC32:cf571193 +packet|codec_type=audio|stream_index=0|pts=101376000|pts_time=7.183673|dts=101376000|dts_time=7.183673|duration=368640|duration_time=0.026122|size=418|pos=116389|flags=K__|data_hash=CRC32:30d3b2d7 +packet|codec_type=audio|stream_index=0|pts=101744640|pts_time=7.209796|dts=101744640|dts_time=7.209796|duration=368640|duration_time=0.026122|size=418|pos=116807|flags=K__|data_hash=CRC32:94eff902 +packet|codec_type=audio|stream_index=0|pts=102113280|pts_time=7.235918|dts=102113280|dts_time=7.235918|duration=368640|duration_time=0.026122|size=418|pos=117225|flags=K__|data_hash=CRC32:6ed46b0c +packet|codec_type=audio|stream_index=0|pts=102481920|pts_time=7.262041|dts=102481920|dts_time=7.262041|duration=368640|duration_time=0.026122|size=418|pos=117643|flags=K__|data_hash=CRC32:ae9574bf +packet|codec_type=audio|stream_index=0|pts=102850560|pts_time=7.288163|dts=102850560|dts_time=7.288163|duration=368640|duration_time=0.026122|size=418|pos=118061|flags=K__|data_hash=CRC32:216621bb +packet|codec_type=audio|stream_index=0|pts=103219200|pts_time=7.314286|dts=103219200|dts_time=7.314286|duration=368640|duration_time=0.026122|size=418|pos=118479|flags=K__|data_hash=CRC32:be692b5a +packet|codec_type=audio|stream_index=0|pts=103587840|pts_time=7.340408|dts=103587840|dts_time=7.340408|duration=368640|duration_time=0.026122|size=418|pos=118897|flags=K__|data_hash=CRC32:76b6814a +packet|codec_type=audio|stream_index=0|pts=103956480|pts_time=7.366531|dts=103956480|dts_time=7.366531|duration=368640|duration_time=0.026122|size=418|pos=119315|flags=K__|data_hash=CRC32:60ac1531 +packet|codec_type=audio|stream_index=0|pts=104325120|pts_time=7.392653|dts=104325120|dts_time=7.392653|duration=368640|duration_time=0.026122|size=418|pos=119733|flags=K__|data_hash=CRC32:d9ac3b87 +packet|codec_type=audio|stream_index=0|pts=104693760|pts_time=7.418776|dts=104693760|dts_time=7.418776|duration=368640|duration_time=0.026122|size=418|pos=120151|flags=K__|data_hash=CRC32:6187bef7 +packet|codec_type=audio|stream_index=0|pts=105062400|pts_time=7.444898|dts=105062400|dts_time=7.444898|duration=368640|duration_time=0.026122|size=418|pos=120569|flags=K__|data_hash=CRC32:abb11d4e +packet|codec_type=audio|stream_index=0|pts=105431040|pts_time=7.471020|dts=105431040|dts_time=7.471020|duration=368640|duration_time=0.026122|size=418|pos=120987|flags=K__|data_hash=CRC32:21ff16ed +packet|codec_type=audio|stream_index=0|pts=105799680|pts_time=7.497143|dts=105799680|dts_time=7.497143|duration=368640|duration_time=0.026122|size=418|pos=121405|flags=K__|data_hash=CRC32:8b9d33e3 +packet|codec_type=audio|stream_index=0|pts=106168320|pts_time=7.523265|dts=106168320|dts_time=7.523265|duration=368640|duration_time=0.026122|size=418|pos=121823|flags=K__|data_hash=CRC32:9fdfecc3 +packet|codec_type=audio|stream_index=0|pts=106536960|pts_time=7.549388|dts=106536960|dts_time=7.549388|duration=368640|duration_time=0.026122|size=418|pos=122241|flags=K__|data_hash=CRC32:09b2eb8c +packet|codec_type=audio|stream_index=0|pts=106905600|pts_time=7.575510|dts=106905600|dts_time=7.575510|duration=368640|duration_time=0.026122|size=418|pos=122659|flags=K__|data_hash=CRC32:1157b18a +packet|codec_type=audio|stream_index=0|pts=107274240|pts_time=7.601633|dts=107274240|dts_time=7.601633|duration=368640|duration_time=0.026122|size=418|pos=123077|flags=K__|data_hash=CRC32:16d63271 +packet|codec_type=audio|stream_index=0|pts=107642880|pts_time=7.627755|dts=107642880|dts_time=7.627755|duration=368640|duration_time=0.026122|size=418|pos=123495|flags=K__|data_hash=CRC32:ff8cd868 +packet|codec_type=audio|stream_index=0|pts=108011520|pts_time=7.653878|dts=108011520|dts_time=7.653878|duration=368640|duration_time=0.026122|size=418|pos=123913|flags=K__|data_hash=CRC32:dcd4b34b +packet|codec_type=audio|stream_index=0|pts=108380160|pts_time=7.680000|dts=108380160|dts_time=7.680000|duration=368640|duration_time=0.026122|size=417|pos=124331|flags=K__|data_hash=CRC32:511a97cc +packet|codec_type=audio|stream_index=0|pts=108748800|pts_time=7.706122|dts=108748800|dts_time=7.706122|duration=368640|duration_time=0.026122|size=418|pos=124748|flags=K__|data_hash=CRC32:12f0449c +packet|codec_type=audio|stream_index=0|pts=109117440|pts_time=7.732245|dts=109117440|dts_time=7.732245|duration=368640|duration_time=0.026122|size=418|pos=125166|flags=K__|data_hash=CRC32:5af6bfcc +packet|codec_type=audio|stream_index=0|pts=109486080|pts_time=7.758367|dts=109486080|dts_time=7.758367|duration=368640|duration_time=0.026122|size=418|pos=125584|flags=K__|data_hash=CRC32:1cfa7e91 +packet|codec_type=audio|stream_index=0|pts=109854720|pts_time=7.784490|dts=109854720|dts_time=7.784490|duration=368640|duration_time=0.026122|size=418|pos=126002|flags=K__|data_hash=CRC32:d87857f2 +packet|codec_type=audio|stream_index=0|pts=110223360|pts_time=7.810612|dts=110223360|dts_time=7.810612|duration=368640|duration_time=0.026122|size=418|pos=126420|flags=K__|data_hash=CRC32:37cd9f06 +packet|codec_type=audio|stream_index=0|pts=110592000|pts_time=7.836735|dts=110592000|dts_time=7.836735|duration=368640|duration_time=0.026122|size=418|pos=126838|flags=K__|data_hash=CRC32:a3df2bf0 +packet|codec_type=audio|stream_index=0|pts=110960640|pts_time=7.862857|dts=110960640|dts_time=7.862857|duration=368640|duration_time=0.026122|size=418|pos=127256|flags=K__|data_hash=CRC32:814fa056 +packet|codec_type=audio|stream_index=0|pts=111329280|pts_time=7.888980|dts=111329280|dts_time=7.888980|duration=368640|duration_time=0.026122|size=418|pos=127674|flags=K__|data_hash=CRC32:6c87eadd +packet|codec_type=audio|stream_index=0|pts=111697920|pts_time=7.915102|dts=111697920|dts_time=7.915102|duration=368640|duration_time=0.026122|size=418|pos=128092|flags=K__|data_hash=CRC32:3b1623b4 +packet|codec_type=audio|stream_index=0|pts=112066560|pts_time=7.941224|dts=112066560|dts_time=7.941224|duration=368640|duration_time=0.026122|size=418|pos=128510|flags=K__|data_hash=CRC32:2282971a +packet|codec_type=audio|stream_index=0|pts=112435200|pts_time=7.967347|dts=112435200|dts_time=7.967347|duration=368640|duration_time=0.026122|size=418|pos=128928|flags=K__|data_hash=CRC32:e4c2f907 +packet|codec_type=audio|stream_index=0|pts=112803840|pts_time=7.993469|dts=112803840|dts_time=7.993469|duration=368640|duration_time=0.026122|size=418|pos=129346|flags=K__|data_hash=CRC32:0d494e7c +packet|codec_type=audio|stream_index=0|pts=113172480|pts_time=8.019592|dts=113172480|dts_time=8.019592|duration=368640|duration_time=0.026122|size=418|pos=129764|flags=K__|data_hash=CRC32:73683d3b +packet|codec_type=audio|stream_index=0|pts=113541120|pts_time=8.045714|dts=113541120|dts_time=8.045714|duration=368640|duration_time=0.026122|size=418|pos=130182|flags=K__|data_hash=CRC32:6a80ad3a +packet|codec_type=audio|stream_index=0|pts=113909760|pts_time=8.071837|dts=113909760|dts_time=8.071837|duration=368640|duration_time=0.026122|size=418|pos=130600|flags=K__|data_hash=CRC32:6d1ad253 +packet|codec_type=audio|stream_index=0|pts=114278400|pts_time=8.097959|dts=114278400|dts_time=8.097959|duration=368640|duration_time=0.026122|size=418|pos=131018|flags=K__|data_hash=CRC32:08fbdf2b +packet|codec_type=audio|stream_index=0|pts=114647040|pts_time=8.124082|dts=114647040|dts_time=8.124082|duration=368640|duration_time=0.026122|size=418|pos=131436|flags=K__|data_hash=CRC32:53280306 +packet|codec_type=audio|stream_index=0|pts=115015680|pts_time=8.150204|dts=115015680|dts_time=8.150204|duration=368640|duration_time=0.026122|size=418|pos=131854|flags=K__|data_hash=CRC32:0c8ac4d8 +packet|codec_type=audio|stream_index=0|pts=115384320|pts_time=8.176327|dts=115384320|dts_time=8.176327|duration=368640|duration_time=0.026122|size=418|pos=132272|flags=K__|data_hash=CRC32:b1d42b95 +packet|codec_type=audio|stream_index=0|pts=115752960|pts_time=8.202449|dts=115752960|dts_time=8.202449|duration=368640|duration_time=0.026122|size=418|pos=132690|flags=K__|data_hash=CRC32:e79c13f3 +packet|codec_type=audio|stream_index=0|pts=116121600|pts_time=8.228571|dts=116121600|dts_time=8.228571|duration=368640|duration_time=0.026122|size=418|pos=133108|flags=K__|data_hash=CRC32:b7a6b904 +packet|codec_type=audio|stream_index=0|pts=116490240|pts_time=8.254694|dts=116490240|dts_time=8.254694|duration=368640|duration_time=0.026122|size=418|pos=133526|flags=K__|data_hash=CRC32:e7437fe1 +packet|codec_type=audio|stream_index=0|pts=116858880|pts_time=8.280816|dts=116858880|dts_time=8.280816|duration=368640|duration_time=0.026122|size=418|pos=133944|flags=K__|data_hash=CRC32:ec10c2f1 +packet|codec_type=audio|stream_index=0|pts=117227520|pts_time=8.306939|dts=117227520|dts_time=8.306939|duration=368640|duration_time=0.026122|size=418|pos=134362|flags=K__|data_hash=CRC32:c85afe11 +packet|codec_type=audio|stream_index=0|pts=117596160|pts_time=8.333061|dts=117596160|dts_time=8.333061|duration=368640|duration_time=0.026122|size=417|pos=134780|flags=K__|data_hash=CRC32:86d78485 +packet|codec_type=audio|stream_index=0|pts=117964800|pts_time=8.359184|dts=117964800|dts_time=8.359184|duration=368640|duration_time=0.026122|size=418|pos=135197|flags=K__|data_hash=CRC32:38a01640 +packet|codec_type=audio|stream_index=0|pts=118333440|pts_time=8.385306|dts=118333440|dts_time=8.385306|duration=368640|duration_time=0.026122|size=418|pos=135615|flags=K__|data_hash=CRC32:fa047a2a +packet|codec_type=audio|stream_index=0|pts=118702080|pts_time=8.411429|dts=118702080|dts_time=8.411429|duration=368640|duration_time=0.026122|size=418|pos=136033|flags=K__|data_hash=CRC32:be363336 +packet|codec_type=audio|stream_index=0|pts=119070720|pts_time=8.437551|dts=119070720|dts_time=8.437551|duration=368640|duration_time=0.026122|size=418|pos=136451|flags=K__|data_hash=CRC32:107b9a48 +packet|codec_type=audio|stream_index=0|pts=119439360|pts_time=8.463673|dts=119439360|dts_time=8.463673|duration=368640|duration_time=0.026122|size=418|pos=136869|flags=K__|data_hash=CRC32:ec2d29b4 +packet|codec_type=audio|stream_index=0|pts=119808000|pts_time=8.489796|dts=119808000|dts_time=8.489796|duration=368640|duration_time=0.026122|size=418|pos=137287|flags=K__|data_hash=CRC32:5b4e1cd2 +packet|codec_type=audio|stream_index=0|pts=120176640|pts_time=8.515918|dts=120176640|dts_time=8.515918|duration=368640|duration_time=0.026122|size=418|pos=137705|flags=K__|data_hash=CRC32:3fdd2053 +packet|codec_type=audio|stream_index=0|pts=120545280|pts_time=8.542041|dts=120545280|dts_time=8.542041|duration=368640|duration_time=0.026122|size=418|pos=138123|flags=K__|data_hash=CRC32:a6205b07 +packet|codec_type=audio|stream_index=0|pts=120913920|pts_time=8.568163|dts=120913920|dts_time=8.568163|duration=368640|duration_time=0.026122|size=418|pos=138541|flags=K__|data_hash=CRC32:25820a59 +packet|codec_type=audio|stream_index=0|pts=121282560|pts_time=8.594286|dts=121282560|dts_time=8.594286|duration=368640|duration_time=0.026122|size=418|pos=138959|flags=K__|data_hash=CRC32:d7e4d24a +packet|codec_type=audio|stream_index=0|pts=121651200|pts_time=8.620408|dts=121651200|dts_time=8.620408|duration=368640|duration_time=0.026122|size=418|pos=139377|flags=K__|data_hash=CRC32:372d6c45 +packet|codec_type=audio|stream_index=0|pts=122019840|pts_time=8.646531|dts=122019840|dts_time=8.646531|duration=368640|duration_time=0.026122|size=418|pos=139795|flags=K__|data_hash=CRC32:b3d2534b +packet|codec_type=audio|stream_index=0|pts=122388480|pts_time=8.672653|dts=122388480|dts_time=8.672653|duration=368640|duration_time=0.026122|size=418|pos=140213|flags=K__|data_hash=CRC32:ec06331a +packet|codec_type=audio|stream_index=0|pts=122757120|pts_time=8.698776|dts=122757120|dts_time=8.698776|duration=368640|duration_time=0.026122|size=418|pos=140631|flags=K__|data_hash=CRC32:c1d73495 +packet|codec_type=audio|stream_index=0|pts=123125760|pts_time=8.724898|dts=123125760|dts_time=8.724898|duration=368640|duration_time=0.026122|size=418|pos=141049|flags=K__|data_hash=CRC32:cd3b07b4 +packet|codec_type=audio|stream_index=0|pts=123494400|pts_time=8.751020|dts=123494400|dts_time=8.751020|duration=368640|duration_time=0.026122|size=418|pos=141467|flags=K__|data_hash=CRC32:89d52d58 +packet|codec_type=audio|stream_index=0|pts=123863040|pts_time=8.777143|dts=123863040|dts_time=8.777143|duration=368640|duration_time=0.026122|size=418|pos=141885|flags=K__|data_hash=CRC32:4f6f794b +packet|codec_type=audio|stream_index=0|pts=124231680|pts_time=8.803265|dts=124231680|dts_time=8.803265|duration=368640|duration_time=0.026122|size=418|pos=142303|flags=K__|data_hash=CRC32:fffede19 +packet|codec_type=audio|stream_index=0|pts=124600320|pts_time=8.829388|dts=124600320|dts_time=8.829388|duration=368640|duration_time=0.026122|size=418|pos=142721|flags=K__|data_hash=CRC32:2567e5ee +packet|codec_type=audio|stream_index=0|pts=124968960|pts_time=8.855510|dts=124968960|dts_time=8.855510|duration=368640|duration_time=0.026122|size=418|pos=143139|flags=K__|data_hash=CRC32:e5a1e8c9 +packet|codec_type=audio|stream_index=0|pts=125337600|pts_time=8.881633|dts=125337600|dts_time=8.881633|duration=368640|duration_time=0.026122|size=418|pos=143557|flags=K__|data_hash=CRC32:90a53524 +packet|codec_type=audio|stream_index=0|pts=125706240|pts_time=8.907755|dts=125706240|dts_time=8.907755|duration=368640|duration_time=0.026122|size=418|pos=143975|flags=K__|data_hash=CRC32:dab534ad +packet|codec_type=audio|stream_index=0|pts=126074880|pts_time=8.933878|dts=126074880|dts_time=8.933878|duration=368640|duration_time=0.026122|size=418|pos=144393|flags=K__|data_hash=CRC32:80e2d601 +packet|codec_type=audio|stream_index=0|pts=126443520|pts_time=8.960000|dts=126443520|dts_time=8.960000|duration=368640|duration_time=0.026122|size=417|pos=144811|flags=K__|data_hash=CRC32:9e58315a +packet|codec_type=audio|stream_index=0|pts=126812160|pts_time=8.986122|dts=126812160|dts_time=8.986122|duration=368640|duration_time=0.026122|size=418|pos=145228|flags=K__|data_hash=CRC32:caf2a992 +packet|codec_type=audio|stream_index=0|pts=127180800|pts_time=9.012245|dts=127180800|dts_time=9.012245|duration=368640|duration_time=0.026122|size=418|pos=145646|flags=K__|data_hash=CRC32:b4416c55 +packet|codec_type=audio|stream_index=0|pts=127549440|pts_time=9.038367|dts=127549440|dts_time=9.038367|duration=368640|duration_time=0.026122|size=418|pos=146064|flags=K__|data_hash=CRC32:cf540122 +packet|codec_type=audio|stream_index=0|pts=127918080|pts_time=9.064490|dts=127918080|dts_time=9.064490|duration=368640|duration_time=0.026122|size=418|pos=146482|flags=K__|data_hash=CRC32:d2271324 +packet|codec_type=audio|stream_index=0|pts=128286720|pts_time=9.090612|dts=128286720|dts_time=9.090612|duration=368640|duration_time=0.026122|size=418|pos=146900|flags=K__|data_hash=CRC32:8d46cedb +packet|codec_type=audio|stream_index=0|pts=128655360|pts_time=9.116735|dts=128655360|dts_time=9.116735|duration=368640|duration_time=0.026122|size=418|pos=147318|flags=K__|data_hash=CRC32:98360373 +packet|codec_type=audio|stream_index=0|pts=129024000|pts_time=9.142857|dts=129024000|dts_time=9.142857|duration=368640|duration_time=0.026122|size=418|pos=147736|flags=K__|data_hash=CRC32:16a4d10e +packet|codec_type=audio|stream_index=0|pts=129392640|pts_time=9.168980|dts=129392640|dts_time=9.168980|duration=368640|duration_time=0.026122|size=418|pos=148154|flags=K__|data_hash=CRC32:96039cf1 +packet|codec_type=audio|stream_index=0|pts=129761280|pts_time=9.195102|dts=129761280|dts_time=9.195102|duration=368640|duration_time=0.026122|size=418|pos=148572|flags=K__|data_hash=CRC32:810c60a7 +packet|codec_type=audio|stream_index=0|pts=130129920|pts_time=9.221224|dts=130129920|dts_time=9.221224|duration=368640|duration_time=0.026122|size=418|pos=148990|flags=K__|data_hash=CRC32:965ad421 +packet|codec_type=audio|stream_index=0|pts=130498560|pts_time=9.247347|dts=130498560|dts_time=9.247347|duration=368640|duration_time=0.026122|size=418|pos=149408|flags=K__|data_hash=CRC32:ee0de130 +packet|codec_type=audio|stream_index=0|pts=130867200|pts_time=9.273469|dts=130867200|dts_time=9.273469|duration=368640|duration_time=0.026122|size=418|pos=149826|flags=K__|data_hash=CRC32:0b2e2883 +packet|codec_type=audio|stream_index=0|pts=131235840|pts_time=9.299592|dts=131235840|dts_time=9.299592|duration=368640|duration_time=0.026122|size=418|pos=150244|flags=K__|data_hash=CRC32:3f610265 +packet|codec_type=audio|stream_index=0|pts=131604480|pts_time=9.325714|dts=131604480|dts_time=9.325714|duration=368640|duration_time=0.026122|size=418|pos=150662|flags=K__|data_hash=CRC32:26cf9721 +packet|codec_type=audio|stream_index=0|pts=131973120|pts_time=9.351837|dts=131973120|dts_time=9.351837|duration=368640|duration_time=0.026122|size=418|pos=151080|flags=K__|data_hash=CRC32:eab74fb9 +packet|codec_type=audio|stream_index=0|pts=132341760|pts_time=9.377959|dts=132341760|dts_time=9.377959|duration=368640|duration_time=0.026122|size=418|pos=151498|flags=K__|data_hash=CRC32:60dea12f +packet|codec_type=audio|stream_index=0|pts=132710400|pts_time=9.404082|dts=132710400|dts_time=9.404082|duration=368640|duration_time=0.026122|size=418|pos=151916|flags=K__|data_hash=CRC32:54d23243 +packet|codec_type=audio|stream_index=0|pts=133079040|pts_time=9.430204|dts=133079040|dts_time=9.430204|duration=368640|duration_time=0.026122|size=418|pos=152334|flags=K__|data_hash=CRC32:6d507594 +packet|codec_type=audio|stream_index=0|pts=133447680|pts_time=9.456327|dts=133447680|dts_time=9.456327|duration=368640|duration_time=0.026122|size=418|pos=152752|flags=K__|data_hash=CRC32:a31b92c2 +packet|codec_type=audio|stream_index=0|pts=133816320|pts_time=9.482449|dts=133816320|dts_time=9.482449|duration=368640|duration_time=0.026122|size=418|pos=153170|flags=K__|data_hash=CRC32:04f064bd +packet|codec_type=audio|stream_index=0|pts=134184960|pts_time=9.508571|dts=134184960|dts_time=9.508571|duration=368640|duration_time=0.026122|size=418|pos=153588|flags=K__|data_hash=CRC32:234c71a8 +packet|codec_type=audio|stream_index=0|pts=134553600|pts_time=9.534694|dts=134553600|dts_time=9.534694|duration=368640|duration_time=0.026122|size=418|pos=154006|flags=K__|data_hash=CRC32:18fabbb7 +packet|codec_type=audio|stream_index=0|pts=134922240|pts_time=9.560816|dts=134922240|dts_time=9.560816|duration=368640|duration_time=0.026122|size=418|pos=154424|flags=K__|data_hash=CRC32:e372f113 +packet|codec_type=audio|stream_index=0|pts=135290880|pts_time=9.586939|dts=135290880|dts_time=9.586939|duration=368640|duration_time=0.026122|size=418|pos=154842|flags=K__|data_hash=CRC32:10352242 +packet|codec_type=audio|stream_index=0|pts=135659520|pts_time=9.613061|dts=135659520|dts_time=9.613061|duration=368640|duration_time=0.026122|size=417|pos=155260|flags=K__|data_hash=CRC32:571e601d +packet|codec_type=audio|stream_index=0|pts=136028160|pts_time=9.639184|dts=136028160|dts_time=9.639184|duration=368640|duration_time=0.026122|size=418|pos=155677|flags=K__|data_hash=CRC32:974376f0 +packet|codec_type=audio|stream_index=0|pts=136396800|pts_time=9.665306|dts=136396800|dts_time=9.665306|duration=368640|duration_time=0.026122|size=418|pos=156095|flags=K__|data_hash=CRC32:9893202f +packet|codec_type=audio|stream_index=0|pts=136765440|pts_time=9.691429|dts=136765440|dts_time=9.691429|duration=368640|duration_time=0.026122|size=418|pos=156513|flags=K__|data_hash=CRC32:57c930c0 +packet|codec_type=audio|stream_index=0|pts=137134080|pts_time=9.717551|dts=137134080|dts_time=9.717551|duration=368640|duration_time=0.026122|size=418|pos=156931|flags=K__|data_hash=CRC32:a8fc9e47 +packet|codec_type=audio|stream_index=0|pts=137502720|pts_time=9.743673|dts=137502720|dts_time=9.743673|duration=368640|duration_time=0.026122|size=418|pos=157349|flags=K__|data_hash=CRC32:a06f74d4 +packet|codec_type=audio|stream_index=0|pts=137871360|pts_time=9.769796|dts=137871360|dts_time=9.769796|duration=368640|duration_time=0.026122|size=418|pos=157767|flags=K__|data_hash=CRC32:adf88905 +packet|codec_type=audio|stream_index=0|pts=138240000|pts_time=9.795918|dts=138240000|dts_time=9.795918|duration=368640|duration_time=0.026122|size=418|pos=158185|flags=K__|data_hash=CRC32:8d415d99 +packet|codec_type=audio|stream_index=0|pts=138608640|pts_time=9.822041|dts=138608640|dts_time=9.822041|duration=368640|duration_time=0.026122|size=418|pos=158603|flags=K__|data_hash=CRC32:5df4c659 +packet|codec_type=audio|stream_index=0|pts=138977280|pts_time=9.848163|dts=138977280|dts_time=9.848163|duration=368640|duration_time=0.026122|size=418|pos=159021|flags=K__|data_hash=CRC32:c0aba593 +packet|codec_type=audio|stream_index=0|pts=139345920|pts_time=9.874286|dts=139345920|dts_time=9.874286|duration=368640|duration_time=0.026122|size=418|pos=159439|flags=K__|data_hash=CRC32:3d5f2342 +packet|codec_type=audio|stream_index=0|pts=139714560|pts_time=9.900408|dts=139714560|dts_time=9.900408|duration=368640|duration_time=0.026122|size=418|pos=159857|flags=K__|data_hash=CRC32:6835ff9d +packet|codec_type=audio|stream_index=0|pts=140083200|pts_time=9.926531|dts=140083200|dts_time=9.926531|duration=368640|duration_time=0.026122|size=418|pos=160275|flags=K__|data_hash=CRC32:de3061f3 +packet|codec_type=audio|stream_index=0|pts=140451840|pts_time=9.952653|dts=140451840|dts_time=9.952653|duration=368640|duration_time=0.026122|size=418|pos=160693|flags=K__|data_hash=CRC32:e28378d6 +packet|codec_type=audio|stream_index=0|pts=140820480|pts_time=9.978776|dts=140820480|dts_time=9.978776|duration=368640|duration_time=0.026122|size=418|pos=161111|flags=K__|data_hash=CRC32:1eabe555 +packet|codec_type=audio|stream_index=0|pts=141189120|pts_time=10.004898|dts=141189120|dts_time=10.004898|duration=368640|duration_time=0.026122|size=418|pos=161529|flags=K__|data_hash=CRC32:2bad508d +packet|codec_type=audio|stream_index=0|pts=141557760|pts_time=10.031020|dts=141557760|dts_time=10.031020|duration=368640|duration_time=0.026122|size=418|pos=161947|flags=K__|data_hash=CRC32:37fba9de +packet|codec_type=audio|stream_index=0|pts=141926400|pts_time=10.057143|dts=141926400|dts_time=10.057143|duration=368640|duration_time=0.026122|size=418|pos=162365|flags=K__|data_hash=CRC32:3244ecea +packet|codec_type=audio|stream_index=0|pts=142295040|pts_time=10.083265|dts=142295040|dts_time=10.083265|duration=368640|duration_time=0.026122|size=418|pos=162783|flags=K__|data_hash=CRC32:685781af +packet|codec_type=audio|stream_index=0|pts=142663680|pts_time=10.109388|dts=142663680|dts_time=10.109388|duration=368640|duration_time=0.026122|size=418|pos=163201|flags=K__|data_hash=CRC32:12d9eb56 +packet|codec_type=audio|stream_index=0|pts=143032320|pts_time=10.135510|dts=143032320|dts_time=10.135510|duration=368640|duration_time=0.026122|size=418|pos=163619|flags=K__|data_hash=CRC32:40f01793 +packet|codec_type=audio|stream_index=0|pts=143400960|pts_time=10.161633|dts=143400960|dts_time=10.161633|duration=368640|duration_time=0.026122|size=418|pos=164037|flags=K__|data_hash=CRC32:46a6b913 +packet|codec_type=audio|stream_index=0|pts=143769600|pts_time=10.187755|dts=143769600|dts_time=10.187755|duration=368640|duration_time=0.026122|size=418|pos=164455|flags=K__|data_hash=CRC32:a0923bf5 +packet|codec_type=audio|stream_index=0|pts=144138240|pts_time=10.213878|dts=144138240|dts_time=10.213878|duration=368640|duration_time=0.026122|size=418|pos=164873|flags=K__|data_hash=CRC32:85b32138 +packet|codec_type=audio|stream_index=0|pts=144506880|pts_time=10.240000|dts=144506880|dts_time=10.240000|duration=368640|duration_time=0.026122|size=417|pos=165291|flags=K__|data_hash=CRC32:6b70633a +packet|codec_type=audio|stream_index=0|pts=144875520|pts_time=10.266122|dts=144875520|dts_time=10.266122|duration=368640|duration_time=0.026122|size=418|pos=165708|flags=K__|data_hash=CRC32:bb86f9a2 +packet|codec_type=audio|stream_index=0|pts=145244160|pts_time=10.292245|dts=145244160|dts_time=10.292245|duration=368640|duration_time=0.026122|size=418|pos=166126|flags=K__|data_hash=CRC32:cae5a723 +packet|codec_type=audio|stream_index=0|pts=145612800|pts_time=10.318367|dts=145612800|dts_time=10.318367|duration=368640|duration_time=0.026122|size=418|pos=166544|flags=K__|data_hash=CRC32:86376f16 +packet|codec_type=audio|stream_index=0|pts=145981440|pts_time=10.344490|dts=145981440|dts_time=10.344490|duration=368640|duration_time=0.026122|size=418|pos=166962|flags=K__|data_hash=CRC32:02a40485 +packet|codec_type=audio|stream_index=0|pts=146350080|pts_time=10.370612|dts=146350080|dts_time=10.370612|duration=368640|duration_time=0.026122|size=418|pos=167380|flags=K__|data_hash=CRC32:36b3012d +packet|codec_type=audio|stream_index=0|pts=146718720|pts_time=10.396735|dts=146718720|dts_time=10.396735|duration=368640|duration_time=0.026122|size=418|pos=167798|flags=K__|data_hash=CRC32:5ee19ccd +packet|codec_type=audio|stream_index=0|pts=147087360|pts_time=10.422857|dts=147087360|dts_time=10.422857|duration=368640|duration_time=0.026122|size=418|pos=168216|flags=K__|data_hash=CRC32:c0152565 +packet|codec_type=audio|stream_index=0|pts=147456000|pts_time=10.448980|dts=147456000|dts_time=10.448980|duration=368640|duration_time=0.026122|size=418|pos=168634|flags=K__|data_hash=CRC32:19e503a0 +packet|codec_type=audio|stream_index=0|pts=147824640|pts_time=10.475102|dts=147824640|dts_time=10.475102|duration=368640|duration_time=0.026122|size=418|pos=169052|flags=K__|data_hash=CRC32:61cec178 +packet|codec_type=audio|stream_index=0|pts=148193280|pts_time=10.501224|dts=148193280|dts_time=10.501224|duration=368640|duration_time=0.026122|size=418|pos=169470|flags=K__|data_hash=CRC32:14781bf1 +packet|codec_type=audio|stream_index=0|pts=148561920|pts_time=10.527347|dts=148561920|dts_time=10.527347|duration=368640|duration_time=0.026122|size=418|pos=169888|flags=K__|data_hash=CRC32:a981e92c +packet|codec_type=audio|stream_index=0|pts=148930560|pts_time=10.553469|dts=148930560|dts_time=10.553469|duration=368640|duration_time=0.026122|size=418|pos=170306|flags=K__|data_hash=CRC32:771754a1 +packet|codec_type=audio|stream_index=0|pts=149299200|pts_time=10.579592|dts=149299200|dts_time=10.579592|duration=368640|duration_time=0.026122|size=418|pos=170724|flags=K__|data_hash=CRC32:d553fa66 +packet|codec_type=audio|stream_index=0|pts=149667840|pts_time=10.605714|dts=149667840|dts_time=10.605714|duration=368640|duration_time=0.026122|size=418|pos=171142|flags=K__|data_hash=CRC32:92289185 +packet|codec_type=audio|stream_index=0|pts=150036480|pts_time=10.631837|dts=150036480|dts_time=10.631837|duration=368640|duration_time=0.026122|size=418|pos=171560|flags=K__|data_hash=CRC32:f9c61381 +packet|codec_type=audio|stream_index=0|pts=150405120|pts_time=10.657959|dts=150405120|dts_time=10.657959|duration=368640|duration_time=0.026122|size=418|pos=171978|flags=K__|data_hash=CRC32:d68bf882 +packet|codec_type=audio|stream_index=0|pts=150773760|pts_time=10.684082|dts=150773760|dts_time=10.684082|duration=368640|duration_time=0.026122|size=418|pos=172396|flags=K__|data_hash=CRC32:a5155dee +packet|codec_type=audio|stream_index=0|pts=151142400|pts_time=10.710204|dts=151142400|dts_time=10.710204|duration=368640|duration_time=0.026122|size=418|pos=172814|flags=K__|data_hash=CRC32:98527928 +packet|codec_type=audio|stream_index=0|pts=151511040|pts_time=10.736327|dts=151511040|dts_time=10.736327|duration=368640|duration_time=0.026122|size=418|pos=173232|flags=K__|data_hash=CRC32:b4540586 +packet|codec_type=audio|stream_index=0|pts=151879680|pts_time=10.762449|dts=151879680|dts_time=10.762449|duration=368640|duration_time=0.026122|size=418|pos=173650|flags=K__|data_hash=CRC32:8ca5872b +packet|codec_type=audio|stream_index=0|pts=152248320|pts_time=10.788571|dts=152248320|dts_time=10.788571|duration=368640|duration_time=0.026122|size=418|pos=174068|flags=K__|data_hash=CRC32:b48241ad +packet|codec_type=audio|stream_index=0|pts=152616960|pts_time=10.814694|dts=152616960|dts_time=10.814694|duration=368640|duration_time=0.026122|size=418|pos=174486|flags=K__|data_hash=CRC32:87b45640 +packet|codec_type=audio|stream_index=0|pts=152985600|pts_time=10.840816|dts=152985600|dts_time=10.840816|duration=368640|duration_time=0.026122|size=418|pos=174904|flags=K__|data_hash=CRC32:7e4a7a0c +packet|codec_type=audio|stream_index=0|pts=153354240|pts_time=10.866939|dts=153354240|dts_time=10.866939|duration=368640|duration_time=0.026122|size=418|pos=175322|flags=K__|data_hash=CRC32:6027ce87 +packet|codec_type=audio|stream_index=0|pts=153722880|pts_time=10.893061|dts=153722880|dts_time=10.893061|duration=368640|duration_time=0.026122|size=417|pos=175740|flags=K__|data_hash=CRC32:0d68984f +packet|codec_type=audio|stream_index=0|pts=154091520|pts_time=10.919184|dts=154091520|dts_time=10.919184|duration=368640|duration_time=0.026122|size=418|pos=176157|flags=K__|data_hash=CRC32:614d8028 +packet|codec_type=audio|stream_index=0|pts=154460160|pts_time=10.945306|dts=154460160|dts_time=10.945306|duration=368640|duration_time=0.026122|size=418|pos=176575|flags=K__|data_hash=CRC32:14d0b66c +packet|codec_type=audio|stream_index=0|pts=154828800|pts_time=10.971429|dts=154828800|dts_time=10.971429|duration=368640|duration_time=0.026122|size=418|pos=176993|flags=K__|data_hash=CRC32:6a25430d +packet|codec_type=audio|stream_index=0|pts=155197440|pts_time=10.997551|dts=155197440|dts_time=10.997551|duration=368640|duration_time=0.026122|size=418|pos=177411|flags=K__|data_hash=CRC32:cb4a5803 +packet|codec_type=audio|stream_index=0|pts=155566080|pts_time=11.023673|dts=155566080|dts_time=11.023673|duration=368640|duration_time=0.026122|size=418|pos=177829|flags=K__|data_hash=CRC32:04d55594 +packet|codec_type=audio|stream_index=0|pts=155934720|pts_time=11.049796|dts=155934720|dts_time=11.049796|duration=368640|duration_time=0.026122|size=418|pos=178247|flags=K__|data_hash=CRC32:8c6be356 +packet|codec_type=audio|stream_index=0|pts=156303360|pts_time=11.075918|dts=156303360|dts_time=11.075918|duration=368640|duration_time=0.026122|size=418|pos=178665|flags=K__|data_hash=CRC32:cb291119 +packet|codec_type=audio|stream_index=0|pts=156672000|pts_time=11.102041|dts=156672000|dts_time=11.102041|duration=368640|duration_time=0.026122|size=418|pos=179083|flags=K__|data_hash=CRC32:eb228350 +packet|codec_type=audio|stream_index=0|pts=157040640|pts_time=11.128163|dts=157040640|dts_time=11.128163|duration=368640|duration_time=0.026122|size=418|pos=179501|flags=K__|data_hash=CRC32:c5337a0b +packet|codec_type=audio|stream_index=0|pts=157409280|pts_time=11.154286|dts=157409280|dts_time=11.154286|duration=368640|duration_time=0.026122|size=418|pos=179919|flags=K__|data_hash=CRC32:4cba189e +packet|codec_type=audio|stream_index=0|pts=157777920|pts_time=11.180408|dts=157777920|dts_time=11.180408|duration=368640|duration_time=0.026122|size=418|pos=180337|flags=K__|data_hash=CRC32:0418a931 +packet|codec_type=audio|stream_index=0|pts=158146560|pts_time=11.206531|dts=158146560|dts_time=11.206531|duration=368640|duration_time=0.026122|size=418|pos=180755|flags=K__|data_hash=CRC32:3d44908c +packet|codec_type=audio|stream_index=0|pts=158515200|pts_time=11.232653|dts=158515200|dts_time=11.232653|duration=368640|duration_time=0.026122|size=418|pos=181173|flags=K__|data_hash=CRC32:ed6d7efb +packet|codec_type=audio|stream_index=0|pts=158883840|pts_time=11.258776|dts=158883840|dts_time=11.258776|duration=368640|duration_time=0.026122|size=418|pos=181591|flags=K__|data_hash=CRC32:18ca7c0c +packet|codec_type=audio|stream_index=0|pts=159252480|pts_time=11.284898|dts=159252480|dts_time=11.284898|duration=368640|duration_time=0.026122|size=418|pos=182009|flags=K__|data_hash=CRC32:af52b87e +packet|codec_type=audio|stream_index=0|pts=159621120|pts_time=11.311020|dts=159621120|dts_time=11.311020|duration=368640|duration_time=0.026122|size=418|pos=182427|flags=K__|data_hash=CRC32:bc425aed +packet|codec_type=audio|stream_index=0|pts=159989760|pts_time=11.337143|dts=159989760|dts_time=11.337143|duration=368640|duration_time=0.026122|size=418|pos=182845|flags=K__|data_hash=CRC32:c3d28318 +packet|codec_type=audio|stream_index=0|pts=160358400|pts_time=11.363265|dts=160358400|dts_time=11.363265|duration=368640|duration_time=0.026122|size=418|pos=183263|flags=K__|data_hash=CRC32:e58a6767 +packet|codec_type=audio|stream_index=0|pts=160727040|pts_time=11.389388|dts=160727040|dts_time=11.389388|duration=368640|duration_time=0.026122|size=418|pos=183681|flags=K__|data_hash=CRC32:1ec96cd7 +packet|codec_type=audio|stream_index=0|pts=161095680|pts_time=11.415510|dts=161095680|dts_time=11.415510|duration=368640|duration_time=0.026122|size=418|pos=184099|flags=K__|data_hash=CRC32:f06e5745 +packet|codec_type=audio|stream_index=0|pts=161464320|pts_time=11.441633|dts=161464320|dts_time=11.441633|duration=368640|duration_time=0.026122|size=418|pos=184517|flags=K__|data_hash=CRC32:64601c5b +packet|codec_type=audio|stream_index=0|pts=161832960|pts_time=11.467755|dts=161832960|dts_time=11.467755|duration=368640|duration_time=0.026122|size=418|pos=184935|flags=K__|data_hash=CRC32:d9c27a78 +packet|codec_type=audio|stream_index=0|pts=162201600|pts_time=11.493878|dts=162201600|dts_time=11.493878|duration=368640|duration_time=0.026122|size=418|pos=185353|flags=K__|data_hash=CRC32:dbbff040 +packet|codec_type=audio|stream_index=0|pts=162570240|pts_time=11.520000|dts=162570240|dts_time=11.520000|duration=368640|duration_time=0.026122|size=417|pos=185771|flags=K__|data_hash=CRC32:c9f6c5a9 +packet|codec_type=audio|stream_index=0|pts=162938880|pts_time=11.546122|dts=162938880|dts_time=11.546122|duration=368640|duration_time=0.026122|size=418|pos=186188|flags=K__|data_hash=CRC32:ca280dd5 +packet|codec_type=audio|stream_index=0|pts=163307520|pts_time=11.572245|dts=163307520|dts_time=11.572245|duration=368640|duration_time=0.026122|size=418|pos=186606|flags=K__|data_hash=CRC32:3388d5a6 +packet|codec_type=audio|stream_index=0|pts=163676160|pts_time=11.598367|dts=163676160|dts_time=11.598367|duration=368640|duration_time=0.026122|size=418|pos=187024|flags=K__|data_hash=CRC32:3605bd56 +packet|codec_type=audio|stream_index=0|pts=164044800|pts_time=11.624490|dts=164044800|dts_time=11.624490|duration=368640|duration_time=0.026122|size=418|pos=187442|flags=K__|data_hash=CRC32:4a62eb9d +packet|codec_type=audio|stream_index=0|pts=164413440|pts_time=11.650612|dts=164413440|dts_time=11.650612|duration=368640|duration_time=0.026122|size=418|pos=187860|flags=K__|data_hash=CRC32:17d2c66e +packet|codec_type=audio|stream_index=0|pts=164782080|pts_time=11.676735|dts=164782080|dts_time=11.676735|duration=368640|duration_time=0.026122|size=418|pos=188278|flags=K__|data_hash=CRC32:ef7e72b5 +packet|codec_type=audio|stream_index=0|pts=165150720|pts_time=11.702857|dts=165150720|dts_time=11.702857|duration=368640|duration_time=0.026122|size=418|pos=188696|flags=K__|data_hash=CRC32:f7422408 +packet|codec_type=audio|stream_index=0|pts=165519360|pts_time=11.728980|dts=165519360|dts_time=11.728980|duration=368640|duration_time=0.026122|size=418|pos=189114|flags=K__|data_hash=CRC32:01512d42 +packet|codec_type=audio|stream_index=0|pts=165888000|pts_time=11.755102|dts=165888000|dts_time=11.755102|duration=368640|duration_time=0.026122|size=418|pos=189532|flags=K__|data_hash=CRC32:ec4ae9e0 +packet|codec_type=audio|stream_index=0|pts=166256640|pts_time=11.781224|dts=166256640|dts_time=11.781224|duration=368640|duration_time=0.026122|size=418|pos=189950|flags=K__|data_hash=CRC32:7f2ce39f +packet|codec_type=audio|stream_index=0|pts=166625280|pts_time=11.807347|dts=166625280|dts_time=11.807347|duration=368640|duration_time=0.026122|size=418|pos=190368|flags=K__|data_hash=CRC32:3abb4dc0 +packet|codec_type=audio|stream_index=0|pts=166993920|pts_time=11.833469|dts=166993920|dts_time=11.833469|duration=368640|duration_time=0.026122|size=418|pos=190786|flags=K__|data_hash=CRC32:06fdee7a +packet|codec_type=audio|stream_index=0|pts=167362560|pts_time=11.859592|dts=167362560|dts_time=11.859592|duration=368640|duration_time=0.026122|size=418|pos=191204|flags=K__|data_hash=CRC32:bfaed869 +packet|codec_type=audio|stream_index=0|pts=167731200|pts_time=11.885714|dts=167731200|dts_time=11.885714|duration=368640|duration_time=0.026122|size=418|pos=191622|flags=K__|data_hash=CRC32:a6762b1a +packet|codec_type=audio|stream_index=0|pts=168099840|pts_time=11.911837|dts=168099840|dts_time=11.911837|duration=368640|duration_time=0.026122|size=418|pos=192040|flags=K__|data_hash=CRC32:156bf7e4 +packet|codec_type=audio|stream_index=0|pts=168468480|pts_time=11.937959|dts=168468480|dts_time=11.937959|duration=368640|duration_time=0.026122|size=418|pos=192458|flags=K__|data_hash=CRC32:4cfaf03d +packet|codec_type=audio|stream_index=0|pts=168837120|pts_time=11.964082|dts=168837120|dts_time=11.964082|duration=368640|duration_time=0.026122|size=418|pos=192876|flags=K__|data_hash=CRC32:24cadb2b +packet|codec_type=audio|stream_index=0|pts=169205760|pts_time=11.990204|dts=169205760|dts_time=11.990204|duration=368640|duration_time=0.026122|size=418|pos=193294|flags=K__|data_hash=CRC32:9bba25cb +packet|codec_type=audio|stream_index=0|pts=169574400|pts_time=12.016327|dts=169574400|dts_time=12.016327|duration=368640|duration_time=0.026122|size=418|pos=193712|flags=K__|data_hash=CRC32:a6192bb5 +packet|codec_type=audio|stream_index=0|pts=169943040|pts_time=12.042449|dts=169943040|dts_time=12.042449|duration=368640|duration_time=0.026122|size=418|pos=194130|flags=K__|data_hash=CRC32:c06a11b2 +packet|codec_type=audio|stream_index=0|pts=170311680|pts_time=12.068571|dts=170311680|dts_time=12.068571|duration=368640|duration_time=0.026122|size=418|pos=194548|flags=K__|data_hash=CRC32:cd083930 +packet|codec_type=audio|stream_index=0|pts=170680320|pts_time=12.094694|dts=170680320|dts_time=12.094694|duration=368640|duration_time=0.026122|size=418|pos=194966|flags=K__|data_hash=CRC32:02e92b19 +packet|codec_type=audio|stream_index=0|pts=171048960|pts_time=12.120816|dts=171048960|dts_time=12.120816|duration=368640|duration_time=0.026122|size=418|pos=195384|flags=K__|data_hash=CRC32:4c63b84e +packet|codec_type=audio|stream_index=0|pts=171417600|pts_time=12.146939|dts=171417600|dts_time=12.146939|duration=368640|duration_time=0.026122|size=418|pos=195802|flags=K__|data_hash=CRC32:8e93e537 +packet|codec_type=audio|stream_index=0|pts=171786240|pts_time=12.173061|dts=171786240|dts_time=12.173061|duration=368640|duration_time=0.026122|size=417|pos=196220|flags=K__|data_hash=CRC32:9a9da365 +packet|codec_type=audio|stream_index=0|pts=172154880|pts_time=12.199184|dts=172154880|dts_time=12.199184|duration=368640|duration_time=0.026122|size=418|pos=196637|flags=K__|data_hash=CRC32:3d6cfb68 +packet|codec_type=audio|stream_index=0|pts=172523520|pts_time=12.225306|dts=172523520|dts_time=12.225306|duration=368640|duration_time=0.026122|size=418|pos=197055|flags=K__|data_hash=CRC32:82a3d445 +packet|codec_type=audio|stream_index=0|pts=172892160|pts_time=12.251429|dts=172892160|dts_time=12.251429|duration=368640|duration_time=0.026122|size=418|pos=197473|flags=K__|data_hash=CRC32:186d2c93 +packet|codec_type=audio|stream_index=0|pts=173260800|pts_time=12.277551|dts=173260800|dts_time=12.277551|duration=368640|duration_time=0.026122|size=418|pos=197891|flags=K__|data_hash=CRC32:d7836980 +packet|codec_type=audio|stream_index=0|pts=173629440|pts_time=12.303673|dts=173629440|dts_time=12.303673|duration=368640|duration_time=0.026122|size=418|pos=198309|flags=K__|data_hash=CRC32:7660396f +packet|codec_type=audio|stream_index=0|pts=173998080|pts_time=12.329796|dts=173998080|dts_time=12.329796|duration=368640|duration_time=0.026122|size=418|pos=198727|flags=K__|data_hash=CRC32:382b6366 +packet|codec_type=audio|stream_index=0|pts=174366720|pts_time=12.355918|dts=174366720|dts_time=12.355918|duration=368640|duration_time=0.026122|size=418|pos=199145|flags=K__|data_hash=CRC32:e85af773 +packet|codec_type=audio|stream_index=0|pts=174735360|pts_time=12.382041|dts=174735360|dts_time=12.382041|duration=368640|duration_time=0.026122|size=418|pos=199563|flags=K__|data_hash=CRC32:90dce600 +packet|codec_type=audio|stream_index=0|pts=175104000|pts_time=12.408163|dts=175104000|dts_time=12.408163|duration=368640|duration_time=0.026122|size=418|pos=199981|flags=K__|data_hash=CRC32:51048306 +packet|codec_type=audio|stream_index=0|pts=175472640|pts_time=12.434286|dts=175472640|dts_time=12.434286|duration=368640|duration_time=0.026122|size=418|pos=200399|flags=K__|data_hash=CRC32:8fc72574 +packet|codec_type=audio|stream_index=0|pts=175841280|pts_time=12.460408|dts=175841280|dts_time=12.460408|duration=368640|duration_time=0.026122|size=418|pos=200817|flags=K__|data_hash=CRC32:0c2fdbc9 +packet|codec_type=audio|stream_index=0|pts=176209920|pts_time=12.486531|dts=176209920|dts_time=12.486531|duration=368640|duration_time=0.026122|size=418|pos=201235|flags=K__|data_hash=CRC32:c624821f +packet|codec_type=audio|stream_index=0|pts=176578560|pts_time=12.512653|dts=176578560|dts_time=12.512653|duration=368640|duration_time=0.026122|size=418|pos=201653|flags=K__|data_hash=CRC32:122a97b1 +packet|codec_type=audio|stream_index=0|pts=176947200|pts_time=12.538776|dts=176947200|dts_time=12.538776|duration=368640|duration_time=0.026122|size=418|pos=202071|flags=K__|data_hash=CRC32:70034867 +packet|codec_type=audio|stream_index=0|pts=177315840|pts_time=12.564898|dts=177315840|dts_time=12.564898|duration=368640|duration_time=0.026122|size=418|pos=202489|flags=K__|data_hash=CRC32:23f7ff55 +packet|codec_type=audio|stream_index=0|pts=177684480|pts_time=12.591020|dts=177684480|dts_time=12.591020|duration=368640|duration_time=0.026122|size=418|pos=202907|flags=K__|data_hash=CRC32:30502042 +packet|codec_type=audio|stream_index=0|pts=178053120|pts_time=12.617143|dts=178053120|dts_time=12.617143|duration=368640|duration_time=0.026122|size=418|pos=203325|flags=K__|data_hash=CRC32:c4fc3556 +packet|codec_type=audio|stream_index=0|pts=178421760|pts_time=12.643265|dts=178421760|dts_time=12.643265|duration=368640|duration_time=0.026122|size=418|pos=203743|flags=K__|data_hash=CRC32:93e85444 +packet|codec_type=audio|stream_index=0|pts=178790400|pts_time=12.669388|dts=178790400|dts_time=12.669388|duration=368640|duration_time=0.026122|size=418|pos=204161|flags=K__|data_hash=CRC32:7cd8422c +packet|codec_type=audio|stream_index=0|pts=179159040|pts_time=12.695510|dts=179159040|dts_time=12.695510|duration=368640|duration_time=0.026122|size=418|pos=204579|flags=K__|data_hash=CRC32:b4f0ac22 +packet|codec_type=audio|stream_index=0|pts=179527680|pts_time=12.721633|dts=179527680|dts_time=12.721633|duration=368640|duration_time=0.026122|size=418|pos=204997|flags=K__|data_hash=CRC32:767c9538 +packet|codec_type=audio|stream_index=0|pts=179896320|pts_time=12.747755|dts=179896320|dts_time=12.747755|duration=368640|duration_time=0.026122|size=418|pos=205415|flags=K__|data_hash=CRC32:dc526929 +packet|codec_type=audio|stream_index=0|pts=180264960|pts_time=12.773878|dts=180264960|dts_time=12.773878|duration=368640|duration_time=0.026122|size=418|pos=205833|flags=K__|data_hash=CRC32:8b581282 +packet|codec_type=audio|stream_index=0|pts=180633600|pts_time=12.800000|dts=180633600|dts_time=12.800000|duration=368640|duration_time=0.026122|size=417|pos=206251|flags=K__|data_hash=CRC32:3c289703 +packet|codec_type=audio|stream_index=0|pts=181002240|pts_time=12.826122|dts=181002240|dts_time=12.826122|duration=368640|duration_time=0.026122|size=418|pos=206668|flags=K__|data_hash=CRC32:97ad0eb3 +packet|codec_type=audio|stream_index=0|pts=181370880|pts_time=12.852245|dts=181370880|dts_time=12.852245|duration=368640|duration_time=0.026122|size=418|pos=207086|flags=K__|data_hash=CRC32:faf9c1b5 +packet|codec_type=audio|stream_index=0|pts=181739520|pts_time=12.878367|dts=181739520|dts_time=12.878367|duration=368640|duration_time=0.026122|size=418|pos=207504|flags=K__|data_hash=CRC32:8f7c216a +packet|codec_type=audio|stream_index=0|pts=182108160|pts_time=12.904490|dts=182108160|dts_time=12.904490|duration=368640|duration_time=0.026122|size=418|pos=207922|flags=K__|data_hash=CRC32:2cb8f508 +packet|codec_type=audio|stream_index=0|pts=182476800|pts_time=12.930612|dts=182476800|dts_time=12.930612|duration=368640|duration_time=0.026122|size=418|pos=208340|flags=K__|data_hash=CRC32:0e9ca434 +packet|codec_type=audio|stream_index=0|pts=182845440|pts_time=12.956735|dts=182845440|dts_time=12.956735|duration=368640|duration_time=0.026122|size=418|pos=208758|flags=K__|data_hash=CRC32:ce807881 +packet|codec_type=audio|stream_index=0|pts=183214080|pts_time=12.982857|dts=183214080|dts_time=12.982857|duration=368640|duration_time=0.026122|size=418|pos=209176|flags=K__|data_hash=CRC32:0f2d056d +packet|codec_type=audio|stream_index=0|pts=183582720|pts_time=13.008980|dts=183582720|dts_time=13.008980|duration=368640|duration_time=0.026122|size=418|pos=209594|flags=K__|data_hash=CRC32:34f82e70 +packet|codec_type=audio|stream_index=0|pts=183951360|pts_time=13.035102|dts=183951360|dts_time=13.035102|duration=368640|duration_time=0.026122|size=418|pos=210012|flags=K__|data_hash=CRC32:93986f39 +packet|codec_type=audio|stream_index=0|pts=184320000|pts_time=13.061224|dts=184320000|dts_time=13.061224|duration=368640|duration_time=0.026122|size=418|pos=210430|flags=K__|data_hash=CRC32:057d018c +packet|codec_type=audio|stream_index=0|pts=184688640|pts_time=13.087347|dts=184688640|dts_time=13.087347|duration=368640|duration_time=0.026122|size=418|pos=210848|flags=K__|data_hash=CRC32:20288d86 +packet|codec_type=audio|stream_index=0|pts=185057280|pts_time=13.113469|dts=185057280|dts_time=13.113469|duration=368640|duration_time=0.026122|size=418|pos=211266|flags=K__|data_hash=CRC32:2054d963 +packet|codec_type=audio|stream_index=0|pts=185425920|pts_time=13.139592|dts=185425920|dts_time=13.139592|duration=368640|duration_time=0.026122|size=418|pos=211684|flags=K__|data_hash=CRC32:51451bd5 +packet|codec_type=audio|stream_index=0|pts=185794560|pts_time=13.165714|dts=185794560|dts_time=13.165714|duration=368640|duration_time=0.026122|size=418|pos=212102|flags=K__|data_hash=CRC32:40180197 +packet|codec_type=audio|stream_index=0|pts=186163200|pts_time=13.191837|dts=186163200|dts_time=13.191837|duration=368640|duration_time=0.026122|size=418|pos=212520|flags=K__|data_hash=CRC32:66cdd080 +packet|codec_type=audio|stream_index=0|pts=186531840|pts_time=13.217959|dts=186531840|dts_time=13.217959|duration=368640|duration_time=0.026122|size=418|pos=212938|flags=K__|data_hash=CRC32:03eb571f +packet|codec_type=audio|stream_index=0|pts=186900480|pts_time=13.244082|dts=186900480|dts_time=13.244082|duration=368640|duration_time=0.026122|size=418|pos=213356|flags=K__|data_hash=CRC32:88515140 +packet|codec_type=audio|stream_index=0|pts=187269120|pts_time=13.270204|dts=187269120|dts_time=13.270204|duration=368640|duration_time=0.026122|size=418|pos=213774|flags=K__|data_hash=CRC32:b82428b6 +packet|codec_type=audio|stream_index=0|pts=187637760|pts_time=13.296327|dts=187637760|dts_time=13.296327|duration=368640|duration_time=0.026122|size=418|pos=214192|flags=K__|data_hash=CRC32:43d07d2b +packet|codec_type=audio|stream_index=0|pts=188006400|pts_time=13.322449|dts=188006400|dts_time=13.322449|duration=368640|duration_time=0.026122|size=418|pos=214610|flags=K__|data_hash=CRC32:458c2504 +packet|codec_type=audio|stream_index=0|pts=188375040|pts_time=13.348571|dts=188375040|dts_time=13.348571|duration=368640|duration_time=0.026122|size=418|pos=215028|flags=K__|data_hash=CRC32:efa75088 +packet|codec_type=audio|stream_index=0|pts=188743680|pts_time=13.374694|dts=188743680|dts_time=13.374694|duration=368640|duration_time=0.026122|size=418|pos=215446|flags=K__|data_hash=CRC32:781209a4 +packet|codec_type=audio|stream_index=0|pts=189112320|pts_time=13.400816|dts=189112320|dts_time=13.400816|duration=368640|duration_time=0.026122|size=418|pos=215864|flags=K__|data_hash=CRC32:c09324be +packet|codec_type=audio|stream_index=0|pts=189480960|pts_time=13.426939|dts=189480960|dts_time=13.426939|duration=368640|duration_time=0.026122|size=418|pos=216282|flags=K__|data_hash=CRC32:b4b9932d +packet|codec_type=audio|stream_index=0|pts=189849600|pts_time=13.453061|dts=189849600|dts_time=13.453061|duration=368640|duration_time=0.026122|size=417|pos=216700|flags=K__|data_hash=CRC32:da830315 +packet|codec_type=audio|stream_index=0|pts=190218240|pts_time=13.479184|dts=190218240|dts_time=13.479184|duration=368640|duration_time=0.026122|size=418|pos=217117|flags=K__|data_hash=CRC32:66202e4f +packet|codec_type=audio|stream_index=0|pts=190586880|pts_time=13.505306|dts=190586880|dts_time=13.505306|duration=368640|duration_time=0.026122|size=418|pos=217535|flags=K__|data_hash=CRC32:2e237c5c +packet|codec_type=audio|stream_index=0|pts=190955520|pts_time=13.531429|dts=190955520|dts_time=13.531429|duration=368640|duration_time=0.026122|size=418|pos=217953|flags=K__|data_hash=CRC32:5764d408 +packet|codec_type=audio|stream_index=0|pts=191324160|pts_time=13.557551|dts=191324160|dts_time=13.557551|duration=368640|duration_time=0.026122|size=418|pos=218371|flags=K__|data_hash=CRC32:35c3a585 +packet|codec_type=audio|stream_index=0|pts=191692800|pts_time=13.583673|dts=191692800|dts_time=13.583673|duration=368640|duration_time=0.026122|size=418|pos=218789|flags=K__|data_hash=CRC32:78fe7986 +packet|codec_type=audio|stream_index=0|pts=192061440|pts_time=13.609796|dts=192061440|dts_time=13.609796|duration=368640|duration_time=0.026122|size=418|pos=219207|flags=K__|data_hash=CRC32:9f375cbe +packet|codec_type=audio|stream_index=0|pts=192430080|pts_time=13.635918|dts=192430080|dts_time=13.635918|duration=368640|duration_time=0.026122|size=418|pos=219625|flags=K__|data_hash=CRC32:491852fd +packet|codec_type=audio|stream_index=0|pts=192798720|pts_time=13.662041|dts=192798720|dts_time=13.662041|duration=368640|duration_time=0.026122|size=418|pos=220043|flags=K__|data_hash=CRC32:4f831db2 +packet|codec_type=audio|stream_index=0|pts=193167360|pts_time=13.688163|dts=193167360|dts_time=13.688163|duration=368640|duration_time=0.026122|size=418|pos=220461|flags=K__|data_hash=CRC32:030e4b07 +packet|codec_type=audio|stream_index=0|pts=193536000|pts_time=13.714286|dts=193536000|dts_time=13.714286|duration=368640|duration_time=0.026122|size=418|pos=220879|flags=K__|data_hash=CRC32:098ea741 +packet|codec_type=audio|stream_index=0|pts=193904640|pts_time=13.740408|dts=193904640|dts_time=13.740408|duration=368640|duration_time=0.026122|size=418|pos=221297|flags=K__|data_hash=CRC32:7ad88654 +packet|codec_type=audio|stream_index=0|pts=194273280|pts_time=13.766531|dts=194273280|dts_time=13.766531|duration=368640|duration_time=0.026122|size=418|pos=221715|flags=K__|data_hash=CRC32:d88ccfac +packet|codec_type=audio|stream_index=0|pts=194641920|pts_time=13.792653|dts=194641920|dts_time=13.792653|duration=368640|duration_time=0.026122|size=418|pos=222133|flags=K__|data_hash=CRC32:f22666d1 +packet|codec_type=audio|stream_index=0|pts=195010560|pts_time=13.818776|dts=195010560|dts_time=13.818776|duration=368640|duration_time=0.026122|size=418|pos=222551|flags=K__|data_hash=CRC32:d249bf1c +packet|codec_type=audio|stream_index=0|pts=195379200|pts_time=13.844898|dts=195379200|dts_time=13.844898|duration=368640|duration_time=0.026122|size=418|pos=222969|flags=K__|data_hash=CRC32:98e88198 +packet|codec_type=audio|stream_index=0|pts=195747840|pts_time=13.871020|dts=195747840|dts_time=13.871020|duration=368640|duration_time=0.026122|size=418|pos=223387|flags=K__|data_hash=CRC32:8a9fc4b4 +packet|codec_type=audio|stream_index=0|pts=196116480|pts_time=13.897143|dts=196116480|dts_time=13.897143|duration=368640|duration_time=0.026122|size=418|pos=223805|flags=K__|data_hash=CRC32:e0835e74 +packet|codec_type=audio|stream_index=0|pts=196485120|pts_time=13.923265|dts=196485120|dts_time=13.923265|duration=368640|duration_time=0.026122|size=418|pos=224223|flags=K__|data_hash=CRC32:08c1071f +packet|codec_type=audio|stream_index=0|pts=196853760|pts_time=13.949388|dts=196853760|dts_time=13.949388|duration=368640|duration_time=0.026122|size=418|pos=224641|flags=K__|data_hash=CRC32:ca5a3aaa +packet|codec_type=audio|stream_index=0|pts=197222400|pts_time=13.975510|dts=197222400|dts_time=13.975510|duration=368640|duration_time=0.026122|size=418|pos=225059|flags=K__|data_hash=CRC32:f789d2b3 +packet|codec_type=audio|stream_index=0|pts=197591040|pts_time=14.001633|dts=197591040|dts_time=14.001633|duration=368640|duration_time=0.026122|size=418|pos=225477|flags=K__|data_hash=CRC32:7bc285ed +packet|codec_type=audio|stream_index=0|pts=197959680|pts_time=14.027755|dts=197959680|dts_time=14.027755|duration=368640|duration_time=0.026122|size=418|pos=225895|flags=K__|data_hash=CRC32:6061a821 +packet|codec_type=audio|stream_index=0|pts=198328320|pts_time=14.053878|dts=198328320|dts_time=14.053878|duration=368640|duration_time=0.026122|size=418|pos=226313|flags=K__|data_hash=CRC32:14367df4 +packet|codec_type=audio|stream_index=0|pts=198696960|pts_time=14.080000|dts=198696960|dts_time=14.080000|duration=368640|duration_time=0.026122|size=417|pos=226731|flags=K__|data_hash=CRC32:f3140a6b +packet|codec_type=audio|stream_index=0|pts=199065600|pts_time=14.106122|dts=199065600|dts_time=14.106122|duration=368640|duration_time=0.026122|size=418|pos=227148|flags=K__|data_hash=CRC32:ebf07925 +packet|codec_type=audio|stream_index=0|pts=199434240|pts_time=14.132245|dts=199434240|dts_time=14.132245|duration=368640|duration_time=0.026122|size=418|pos=227566|flags=K__|data_hash=CRC32:4f8cde59 +packet|codec_type=audio|stream_index=0|pts=199802880|pts_time=14.158367|dts=199802880|dts_time=14.158367|duration=368640|duration_time=0.026122|size=418|pos=227984|flags=K__|data_hash=CRC32:4467b601 +packet|codec_type=audio|stream_index=0|pts=200171520|pts_time=14.184490|dts=200171520|dts_time=14.184490|duration=368640|duration_time=0.026122|size=418|pos=228402|flags=K__|data_hash=CRC32:f6ae7ed4 +packet|codec_type=audio|stream_index=0|pts=200540160|pts_time=14.210612|dts=200540160|dts_time=14.210612|duration=368640|duration_time=0.026122|size=418|pos=228820|flags=K__|data_hash=CRC32:5cb30836 +packet|codec_type=audio|stream_index=0|pts=200908800|pts_time=14.236735|dts=200908800|dts_time=14.236735|duration=368640|duration_time=0.026122|size=418|pos=229238|flags=K__|data_hash=CRC32:21b70421 +packet|codec_type=audio|stream_index=0|pts=201277440|pts_time=14.262857|dts=201277440|dts_time=14.262857|duration=368640|duration_time=0.026122|size=418|pos=229656|flags=K__|data_hash=CRC32:3bcafdd7 +packet|codec_type=audio|stream_index=0|pts=201646080|pts_time=14.288980|dts=201646080|dts_time=14.288980|duration=368640|duration_time=0.026122|size=418|pos=230074|flags=K__|data_hash=CRC32:76edd678 +packet|codec_type=audio|stream_index=0|pts=202014720|pts_time=14.315102|dts=202014720|dts_time=14.315102|duration=368640|duration_time=0.026122|size=418|pos=230492|flags=K__|data_hash=CRC32:0999fa0b +packet|codec_type=audio|stream_index=0|pts=202383360|pts_time=14.341224|dts=202383360|dts_time=14.341224|duration=368640|duration_time=0.026122|size=418|pos=230910|flags=K__|data_hash=CRC32:227a3da5 +packet|codec_type=audio|stream_index=0|pts=202752000|pts_time=14.367347|dts=202752000|dts_time=14.367347|duration=368640|duration_time=0.026122|size=418|pos=231328|flags=K__|data_hash=CRC32:0068cd57 +packet|codec_type=audio|stream_index=0|pts=203120640|pts_time=14.393469|dts=203120640|dts_time=14.393469|duration=368640|duration_time=0.026122|size=418|pos=231746|flags=K__|data_hash=CRC32:70f8a1dc +packet|codec_type=audio|stream_index=0|pts=203489280|pts_time=14.419592|dts=203489280|dts_time=14.419592|duration=368640|duration_time=0.026122|size=418|pos=232164|flags=K__|data_hash=CRC32:c19072eb +packet|codec_type=audio|stream_index=0|pts=203857920|pts_time=14.445714|dts=203857920|dts_time=14.445714|duration=368640|duration_time=0.026122|size=418|pos=232582|flags=K__|data_hash=CRC32:f0461d09 +packet|codec_type=audio|stream_index=0|pts=204226560|pts_time=14.471837|dts=204226560|dts_time=14.471837|duration=368640|duration_time=0.026122|size=418|pos=233000|flags=K__|data_hash=CRC32:c8fa8555 +packet|codec_type=audio|stream_index=0|pts=204595200|pts_time=14.497959|dts=204595200|dts_time=14.497959|duration=368640|duration_time=0.026122|size=418|pos=233418|flags=K__|data_hash=CRC32:901f5bfb +packet|codec_type=audio|stream_index=0|pts=204963840|pts_time=14.524082|dts=204963840|dts_time=14.524082|duration=368640|duration_time=0.026122|size=418|pos=233836|flags=K__|data_hash=CRC32:91d0ab8c +packet|codec_type=audio|stream_index=0|pts=205332480|pts_time=14.550204|dts=205332480|dts_time=14.550204|duration=368640|duration_time=0.026122|size=418|pos=234254|flags=K__|data_hash=CRC32:3516c575 +packet|codec_type=audio|stream_index=0|pts=205701120|pts_time=14.576327|dts=205701120|dts_time=14.576327|duration=368640|duration_time=0.026122|size=418|pos=234672|flags=K__|data_hash=CRC32:b32cd4ed +packet|codec_type=audio|stream_index=0|pts=206069760|pts_time=14.602449|dts=206069760|dts_time=14.602449|duration=368640|duration_time=0.026122|size=418|pos=235090|flags=K__|data_hash=CRC32:bcd22861 +packet|codec_type=audio|stream_index=0|pts=206438400|pts_time=14.628571|dts=206438400|dts_time=14.628571|duration=368640|duration_time=0.026122|size=418|pos=235508|flags=K__|data_hash=CRC32:a7d0b124 +packet|codec_type=audio|stream_index=0|pts=206807040|pts_time=14.654694|dts=206807040|dts_time=14.654694|duration=368640|duration_time=0.026122|size=418|pos=235926|flags=K__|data_hash=CRC32:3fed01ec +packet|codec_type=audio|stream_index=0|pts=207175680|pts_time=14.680816|dts=207175680|dts_time=14.680816|duration=368640|duration_time=0.026122|size=418|pos=236344|flags=K__|data_hash=CRC32:ff85606f +packet|codec_type=audio|stream_index=0|pts=207544320|pts_time=14.706939|dts=207544320|dts_time=14.706939|duration=368640|duration_time=0.026122|size=418|pos=236762|flags=K__|data_hash=CRC32:a62312cb +packet|codec_type=audio|stream_index=0|pts=207912960|pts_time=14.733061|dts=207912960|dts_time=14.733061|duration=368640|duration_time=0.026122|size=417|pos=237180|flags=K__|data_hash=CRC32:4b910380 +packet|codec_type=audio|stream_index=0|pts=208281600|pts_time=14.759184|dts=208281600|dts_time=14.759184|duration=368640|duration_time=0.026122|size=418|pos=237597|flags=K__|data_hash=CRC32:4f97177f +packet|codec_type=audio|stream_index=0|pts=208650240|pts_time=14.785306|dts=208650240|dts_time=14.785306|duration=368640|duration_time=0.026122|size=418|pos=238015|flags=K__|data_hash=CRC32:f919570c +packet|codec_type=audio|stream_index=0|pts=209018880|pts_time=14.811429|dts=209018880|dts_time=14.811429|duration=368640|duration_time=0.026122|size=418|pos=238433|flags=K__|data_hash=CRC32:74ca87ce +packet|codec_type=audio|stream_index=0|pts=209387520|pts_time=14.837551|dts=209387520|dts_time=14.837551|duration=368640|duration_time=0.026122|size=418|pos=238851|flags=K__|data_hash=CRC32:5fb510e2 +packet|codec_type=audio|stream_index=0|pts=209756160|pts_time=14.863673|dts=209756160|dts_time=14.863673|duration=368640|duration_time=0.026122|size=418|pos=239269|flags=K__|data_hash=CRC32:c01c76b9 +packet|codec_type=audio|stream_index=0|pts=210124800|pts_time=14.889796|dts=210124800|dts_time=14.889796|duration=368640|duration_time=0.026122|size=418|pos=239687|flags=K__|data_hash=CRC32:fb39fca0 +packet|codec_type=audio|stream_index=0|pts=210493440|pts_time=14.915918|dts=210493440|dts_time=14.915918|duration=368640|duration_time=0.026122|size=418|pos=240105|flags=K__|data_hash=CRC32:9b334424 +packet|codec_type=audio|stream_index=0|pts=210862080|pts_time=14.942041|dts=210862080|dts_time=14.942041|duration=368640|duration_time=0.026122|size=418|pos=240523|flags=K__|data_hash=CRC32:8b9fd924 +packet|codec_type=audio|stream_index=0|pts=211230720|pts_time=14.968163|dts=211230720|dts_time=14.968163|duration=368640|duration_time=0.026122|size=418|pos=240941|flags=K__|data_hash=CRC32:e81832b1 +packet|codec_type=audio|stream_index=0|pts=211599360|pts_time=14.994286|dts=211599360|dts_time=14.994286|duration=368640|duration_time=0.026122|size=418|pos=241359|flags=K__|data_hash=CRC32:cef4dc50 +packet|codec_type=audio|stream_index=0|pts=211968000|pts_time=15.020408|dts=211968000|dts_time=15.020408|duration=368640|duration_time=0.026122|size=418|pos=241777|flags=K__|data_hash=CRC32:4948aebf +packet|codec_type=audio|stream_index=0|pts=212336640|pts_time=15.046531|dts=212336640|dts_time=15.046531|duration=368640|duration_time=0.026122|size=418|pos=242195|flags=K__|data_hash=CRC32:eb2c924e +packet|codec_type=audio|stream_index=0|pts=212705280|pts_time=15.072653|dts=212705280|dts_time=15.072653|duration=368640|duration_time=0.026122|size=418|pos=242613|flags=K__|data_hash=CRC32:851f8690 +packet|codec_type=audio|stream_index=0|pts=213073920|pts_time=15.098776|dts=213073920|dts_time=15.098776|duration=368640|duration_time=0.026122|size=418|pos=243031|flags=K__|data_hash=CRC32:4c0e608d +packet|codec_type=audio|stream_index=0|pts=213442560|pts_time=15.124898|dts=213442560|dts_time=15.124898|duration=368640|duration_time=0.026122|size=418|pos=243449|flags=K__|data_hash=CRC32:37f43818 +packet|codec_type=audio|stream_index=0|pts=213811200|pts_time=15.151020|dts=213811200|dts_time=15.151020|duration=368640|duration_time=0.026122|size=418|pos=243867|flags=K__|data_hash=CRC32:8f88252e +packet|codec_type=audio|stream_index=0|pts=214179840|pts_time=15.177143|dts=214179840|dts_time=15.177143|duration=368640|duration_time=0.026122|size=418|pos=244285|flags=K__|data_hash=CRC32:95f6b13d +packet|codec_type=audio|stream_index=0|pts=214548480|pts_time=15.203265|dts=214548480|dts_time=15.203265|duration=368640|duration_time=0.026122|size=418|pos=244703|flags=K__|data_hash=CRC32:32dde92f +packet|codec_type=audio|stream_index=0|pts=214917120|pts_time=15.229388|dts=214917120|dts_time=15.229388|duration=368640|duration_time=0.026122|size=418|pos=245121|flags=K__|data_hash=CRC32:0d034c77 +packet|codec_type=audio|stream_index=0|pts=215285760|pts_time=15.255510|dts=215285760|dts_time=15.255510|duration=368640|duration_time=0.026122|size=418|pos=245539|flags=K__|data_hash=CRC32:4cbf0548 +packet|codec_type=audio|stream_index=0|pts=215654400|pts_time=15.281633|dts=215654400|dts_time=15.281633|duration=368640|duration_time=0.026122|size=418|pos=245957|flags=K__|data_hash=CRC32:599d8f8f +packet|codec_type=audio|stream_index=0|pts=216023040|pts_time=15.307755|dts=216023040|dts_time=15.307755|duration=368640|duration_time=0.026122|size=418|pos=246375|flags=K__|data_hash=CRC32:da07f929 +packet|codec_type=audio|stream_index=0|pts=216391680|pts_time=15.333878|dts=216391680|dts_time=15.333878|duration=368640|duration_time=0.026122|size=418|pos=246793|flags=K__|data_hash=CRC32:294af00d +packet|codec_type=audio|stream_index=0|pts=216760320|pts_time=15.360000|dts=216760320|dts_time=15.360000|duration=368640|duration_time=0.026122|size=417|pos=247211|flags=K__|data_hash=CRC32:14a8bd71 +packet|codec_type=audio|stream_index=0|pts=217128960|pts_time=15.386122|dts=217128960|dts_time=15.386122|duration=368640|duration_time=0.026122|size=418|pos=247628|flags=K__|data_hash=CRC32:10afdcd0 +packet|codec_type=audio|stream_index=0|pts=217497600|pts_time=15.412245|dts=217497600|dts_time=15.412245|duration=368640|duration_time=0.026122|size=418|pos=248046|flags=K__|data_hash=CRC32:dc78174d +packet|codec_type=audio|stream_index=0|pts=217866240|pts_time=15.438367|dts=217866240|dts_time=15.438367|duration=368640|duration_time=0.026122|size=418|pos=248464|flags=K__|data_hash=CRC32:0b948a05 +packet|codec_type=audio|stream_index=0|pts=218234880|pts_time=15.464490|dts=218234880|dts_time=15.464490|duration=368640|duration_time=0.026122|size=418|pos=248882|flags=K__|data_hash=CRC32:fbc83c3c +packet|codec_type=audio|stream_index=0|pts=218603520|pts_time=15.490612|dts=218603520|dts_time=15.490612|duration=368640|duration_time=0.026122|size=418|pos=249300|flags=K__|data_hash=CRC32:d5fb5f9c|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=303|skip_reason=0|discard_reason=0 + +packet|codec_type=audio|stream_index=0|pts=218972160|pts_time=15.516735|dts=218972160|dts_time=15.516735|duration=368640|duration_time=0.026122|size=418|pos=249718|flags=K__|data_hash=CRC32:3789f3cf|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=1152|skip_reason=0|discard_reason=0 + +stream|index=0|codec_name=mp3|profile=unknown|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=44100|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/14112000|start_pts=353600|start_time=0.025057|duration_ts=219340800|duration=15.542857|bit_rate=128000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=595|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:encoder=LAME3.93 format|filename=gapless.mp3|nb_streams=1|nb_programs=0|format_name=mp3|start_time=0.025057|duration=15.542857|size=250264|bit_rate=128812|probe_score=51|tag:title=test diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264-dts_5frames mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264-dts_5frames --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264-dts_5frames 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264-dts_5frames 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=166 pkt_duration_time=0.166000 +duration=166 +duration_time=0.166000 pkt_pos=651 pkt_size=14428 width=512 @@ -40,6 +42,8 @@ best_effort_timestamp_time=0.167000 pkt_duration=166 pkt_duration_time=0.166000 +duration=166 +duration_time=0.166000 pkt_pos=15085 pkt_size=11 width=512 @@ -70,6 +74,8 @@ best_effort_timestamp_time=0.333000 pkt_duration=166 pkt_duration_time=0.166000 +duration=166 +duration_time=0.166000 pkt_pos=15102 pkt_size=11 width=512 @@ -100,6 +106,8 @@ best_effort_timestamp_time=0.500000 pkt_duration=166 pkt_duration_time=0.166000 +duration=166 +duration_time=0.166000 pkt_pos=15119 pkt_size=11 width=512 @@ -130,6 +138,8 @@ best_effort_timestamp_time=0.667000 pkt_duration=166 pkt_duration_time=0.166000 +duration=166 +duration_time=0.166000 pkt_pos=15136 pkt_size=11 width=512 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-annexb mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-annexb --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-annexb 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-annexb 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,307 @@ +ce0890bd80342f8a3f6703f83b1c4959 *tests/data/fate/h264_redundant_pps-annexb.h264 +163967 tests/data/fate/h264_redundant_pps-annexb.h264 +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 176x144 +#sar 0: 0/1 +0, 0, 0, 1, 38016, 0x72723ce4 +0, 1, 1, 1, 38016, 0x347219d7 +0, 2, 2, 1, 38016, 0x813ff182 +0, 3, 3, 1, 38016, 0x4e69d41a +0, 4, 4, 1, 38016, 0x5e56acb6 +0, 5, 5, 1, 38016, 0xe72197e5 +0, 6, 6, 1, 38016, 0xd035807a +0, 7, 7, 1, 38016, 0x9ee57559 +0, 8, 8, 1, 38016, 0xd0f56f28 +0, 9, 9, 1, 38016, 0xa5097788 +0, 10, 10, 1, 38016, 0xf108978d +0, 11, 11, 1, 38016, 0xf76cb475 +0, 12, 12, 1, 38016, 0x0184cc3a +0, 13, 13, 1, 38016, 0xa4b5dc15 +0, 14, 14, 1, 38016, 0x209cdc42 +0, 15, 15, 1, 38016, 0xd9e69a8c +0, 16, 16, 1, 38016, 0xa2c3a9ba +0, 17, 17, 1, 38016, 0xdf84a52e +0, 18, 18, 1, 38016, 0xfe48a7f0 +0, 19, 19, 1, 38016, 0xb0279a19 +0, 20, 20, 1, 38016, 0xf3b48652 +0, 21, 21, 1, 38016, 0xc12b61b5 +0, 22, 22, 1, 38016, 0x13065a22 +0, 23, 23, 1, 38016, 0x804853d4 +0, 24, 24, 1, 38016, 0x40935736 +0, 25, 25, 1, 38016, 0x1a135ecb +0, 26, 26, 1, 38016, 0x125f6116 +0, 27, 27, 1, 38016, 0x53286da3 +0, 28, 28, 1, 38016, 0xd49287ac +0, 29, 29, 1, 38016, 0xc70a9c2c +0, 30, 30, 1, 38016, 0x0c0c6998 +0, 31, 31, 1, 38016, 0xf37d9141 +0, 32, 32, 1, 38016, 0xd36eafa2 +0, 33, 33, 1, 38016, 0x0d1fc298 +0, 34, 34, 1, 38016, 0xf84ad5d9 +0, 35, 35, 1, 38016, 0xc1e8d93d +0, 36, 36, 1, 38016, 0xe190dabd +0, 37, 37, 1, 38016, 0x9542db28 +0, 38, 38, 1, 38016, 0xa67edc7f +0, 39, 39, 1, 38016, 0x65efdfa7 +0, 40, 40, 1, 38016, 0x7039e6c6 +0, 41, 41, 1, 38016, 0x8307ee87 +0, 42, 42, 1, 38016, 0x1f83ec00 +0, 43, 43, 1, 38016, 0x9e33ea6e +0, 44, 44, 1, 38016, 0xb53ef238 +0, 45, 45, 1, 38016, 0x6d04930c +0, 46, 46, 1, 38016, 0xed90a50e +0, 47, 47, 1, 38016, 0xd98cb4a6 +0, 48, 48, 1, 38016, 0xa7f5bd5e +0, 49, 49, 1, 38016, 0x4df9ca95 +0, 50, 50, 1, 38016, 0xc8e7cb40 +0, 51, 51, 1, 38016, 0x93d9d23c +0, 52, 52, 1, 38016, 0xc07fd34f +0, 53, 53, 1, 38016, 0xf7c5d645 +0, 54, 54, 1, 38016, 0x3c1ddf53 +0, 55, 55, 1, 38016, 0x0bafe394 +0, 56, 56, 1, 38016, 0x9179ec6f +0, 57, 57, 1, 38016, 0x3483efc3 +0, 58, 58, 1, 38016, 0xf7ccf70d +0, 59, 59, 1, 38016, 0x289ef13b +0, 60, 60, 1, 38016, 0xb00c99dc +0, 61, 61, 1, 38016, 0x59409b34 +0, 62, 62, 1, 38016, 0x3fc079a2 +0, 63, 63, 1, 38016, 0x90ad49d9 +0, 64, 64, 1, 38016, 0x8e7751e2 +0, 65, 65, 1, 38016, 0xed20743d +0, 66, 66, 1, 38016, 0x66a1a470 +0, 67, 67, 1, 38016, 0x7a77e252 +0, 68, 68, 1, 38016, 0x6bb427fe +0, 69, 69, 1, 38016, 0x87126360 +0, 70, 70, 1, 38016, 0x330789d0 +0, 71, 71, 1, 38016, 0xc298b987 +0, 72, 72, 1, 38016, 0x4959f143 +0, 73, 73, 1, 38016, 0xa66e3082 +0, 74, 74, 1, 38016, 0xb9f67824 +0, 75, 75, 1, 38016, 0x27fe46a2 +0, 76, 76, 1, 38016, 0xc50c87ed +0, 77, 77, 1, 38016, 0x9523a9f6 +0, 78, 78, 1, 38016, 0xbe28d1d7 +0, 79, 79, 1, 38016, 0x3c0ee964 +0, 80, 80, 1, 38016, 0x65c7f36c +0, 81, 81, 1, 38016, 0xe5030946 +0, 82, 82, 1, 38016, 0x4bbb11fa +0, 83, 83, 1, 38016, 0xeaf209ed +0, 84, 84, 1, 38016, 0x96c80987 +0, 85, 85, 1, 38016, 0x69820c58 +0, 86, 86, 1, 38016, 0x5f951aa7 +0, 87, 87, 1, 38016, 0xfe6122d9 +0, 88, 88, 1, 38016, 0xa202301a +0, 89, 89, 1, 38016, 0xdd2628fb +0, 90, 90, 1, 38016, 0xe081a5ff +0, 91, 91, 1, 38016, 0x5b858e9e +0, 92, 92, 1, 38016, 0x7a368229 +0, 93, 93, 1, 38016, 0x3791829a +0, 94, 94, 1, 38016, 0x9c68723d +0, 95, 95, 1, 38016, 0xef26778e +0, 96, 96, 1, 38016, 0x39a491cf +0, 97, 97, 1, 38016, 0x776ea867 +0, 98, 98, 1, 38016, 0xda9ac03b +0, 99, 99, 1, 38016, 0x653bc9a3 +0, 100, 100, 1, 38016, 0x79e1da19 +0, 101, 101, 1, 38016, 0x3b98c6eb +0, 102, 102, 1, 38016, 0x42cdb846 +0, 103, 103, 1, 38016, 0x7872ada1 +0, 104, 104, 1, 38016, 0xb2f6d2ef +0, 105, 105, 1, 38016, 0x9468b16a +0, 106, 106, 1, 38016, 0xe793c91a +0, 107, 107, 1, 38016, 0x80bde366 +0, 108, 108, 1, 38016, 0xa7250446 +0, 109, 109, 1, 38016, 0x7039280b +0, 110, 110, 1, 38016, 0x1665350c +0, 111, 111, 1, 38016, 0xb5c93f1f +0, 112, 112, 1, 38016, 0xf77a4c44 +0, 113, 113, 1, 38016, 0x3a093143 +0, 114, 114, 1, 38016, 0x1d6b1005 +0, 115, 115, 1, 38016, 0xe1a10c01 +0, 116, 116, 1, 38016, 0x2d4d1d54 +0, 117, 117, 1, 38016, 0x902f2b14 +0, 118, 118, 1, 38016, 0xb26e3e73 +0, 119, 119, 1, 38016, 0xed7a469e +0, 120, 120, 1, 38016, 0xbc663d2a +0, 121, 121, 1, 38016, 0x60a5488e +0, 122, 122, 1, 38016, 0x451b31ca +0, 123, 123, 1, 38016, 0x54311166 +0, 124, 124, 1, 38016, 0x57d9f31e +0, 125, 125, 1, 38016, 0x567dd693 +0, 126, 126, 1, 38016, 0x0e58d88c +0, 127, 127, 1, 38016, 0xa555e124 +0, 128, 128, 1, 38016, 0x94e2f835 +0, 129, 129, 1, 38016, 0xe49e0ec0 +0, 130, 130, 1, 38016, 0x585d188e +0, 131, 131, 1, 38016, 0x696e1a0d +0, 132, 132, 1, 38016, 0xac9014b1 +0, 133, 133, 1, 38016, 0x915413c6 +0, 134, 134, 1, 38016, 0x5fa30be7 +0, 135, 135, 1, 38016, 0x8fbfb69c +0, 136, 136, 1, 38016, 0xcaeabfab +0, 137, 137, 1, 38016, 0xe494bf5c +0, 138, 138, 1, 38016, 0xae03be55 +0, 139, 139, 1, 38016, 0xb734b4d3 +0, 140, 140, 1, 38016, 0xdc6fb56f +0, 141, 141, 1, 38016, 0xfea0a853 +0, 142, 142, 1, 38016, 0xb4919381 +0, 143, 143, 1, 38016, 0x13a792fe +0, 144, 144, 1, 38016, 0xc8829fd8 +0, 145, 145, 1, 38016, 0x2113a62b +0, 146, 146, 1, 38016, 0x171f98d2 +0, 147, 147, 1, 38016, 0x1a6d6d17 +0, 148, 148, 1, 38016, 0xd4ab41c3 +0, 149, 149, 1, 38016, 0xd2df1c80 +0, 150, 150, 1, 38016, 0x14cdbb35 +0, 151, 151, 1, 38016, 0x2b74b829 +0, 152, 152, 1, 38016, 0x6433bd55 +0, 153, 153, 1, 38016, 0xd11dbc28 +0, 154, 154, 1, 38016, 0x4981ad33 +0, 155, 155, 1, 38016, 0xc38bbbad +0, 156, 156, 1, 38016, 0x048de367 +0, 157, 157, 1, 38016, 0x6c9a0c5a +0, 158, 158, 1, 38016, 0x384c4255 +0, 159, 159, 1, 38016, 0x3e9873ba +0, 160, 160, 1, 38016, 0xe4988671 +0, 161, 161, 1, 38016, 0x05b4843c +0, 162, 162, 1, 38016, 0xed0a7e13 +0, 163, 163, 1, 38016, 0x750c6f90 +0, 164, 164, 1, 38016, 0x9d296035 +0, 165, 165, 1, 38016, 0xbaa006bd +0, 166, 166, 1, 38016, 0x8289f8ae +0, 167, 167, 1, 38016, 0x3f3de147 +0, 168, 168, 1, 38016, 0xc5debc49 +0, 169, 169, 1, 38016, 0x1fe9bbfc +0, 170, 170, 1, 38016, 0x006cd4a9 +0, 171, 171, 1, 38016, 0xe551f2b3 +0, 172, 172, 1, 38016, 0xb370140e +0, 173, 173, 1, 38016, 0xc9441c24 +0, 174, 174, 1, 38016, 0x7f5c01c5 +0, 175, 175, 1, 38016, 0x352ad9f6 +0, 176, 176, 1, 38016, 0xe0909a17 +0, 177, 177, 1, 38016, 0x49bf5ea8 +0, 178, 178, 1, 38016, 0x7f1d387b +0, 179, 179, 1, 38016, 0x30812233 +0, 180, 180, 1, 38016, 0xb0bdf16f +0, 181, 181, 1, 38016, 0x5372d0e9 +0, 182, 182, 1, 38016, 0xbf1bc91c +0, 183, 183, 1, 38016, 0xaef5d647 +0, 184, 184, 1, 38016, 0xf007e86c +0, 185, 185, 1, 38016, 0x683bf72b +0, 186, 186, 1, 38016, 0xbb722114 +0, 187, 187, 1, 38016, 0xc5864b63 +0, 188, 188, 1, 38016, 0xfefd5cf4 +0, 189, 189, 1, 38016, 0xa0f263d5 +0, 190, 190, 1, 38016, 0x18401a02 +0, 191, 191, 1, 38016, 0x55cdd97b +0, 192, 192, 1, 38016, 0x5a4ee22d +0, 193, 193, 1, 38016, 0xa60706b3 +0, 194, 194, 1, 38016, 0x644422bb +0, 195, 195, 1, 38016, 0xc22421c9 +0, 196, 196, 1, 38016, 0x1d6b54e4 +0, 197, 197, 1, 38016, 0xc7627820 +0, 198, 198, 1, 38016, 0x0a6ea609 +0, 199, 199, 1, 38016, 0x4315c087 +0, 200, 200, 1, 38016, 0x3164d978 +0, 201, 201, 1, 38016, 0x08e3e7eb +0, 202, 202, 1, 38016, 0x4f04eaed +0, 203, 203, 1, 38016, 0x9f83eb5a +0, 204, 204, 1, 38016, 0xfbbcf0b2 +0, 205, 205, 1, 38016, 0xee1efb8a +0, 206, 206, 1, 38016, 0x87710ba0 +0, 207, 207, 1, 38016, 0xb96b05c1 +0, 208, 208, 1, 38016, 0xd5a4fc50 +0, 209, 209, 1, 38016, 0xad85ea19 +0, 210, 210, 1, 38016, 0x5f606058 +0, 211, 211, 1, 38016, 0xdaf55ad0 +0, 212, 212, 1, 38016, 0xee8564d6 +0, 213, 213, 1, 38016, 0xa1846cad +0, 214, 214, 1, 38016, 0xcd316a62 +0, 215, 215, 1, 38016, 0xdcf5638f +0, 216, 216, 1, 38016, 0xc5e36d1d +0, 217, 217, 1, 38016, 0x958369a6 +0, 218, 218, 1, 38016, 0x05826bf0 +0, 219, 219, 1, 38016, 0x22146914 +0, 220, 220, 1, 38016, 0xf5086111 +0, 221, 221, 1, 38016, 0x88f35468 +0, 222, 222, 1, 38016, 0x3ae94126 +0, 223, 223, 1, 38016, 0xf4473aa8 +0, 224, 224, 1, 38016, 0x430c3da2 +0, 225, 225, 1, 38016, 0xaf95113e +0, 226, 226, 1, 38016, 0xa8a216d6 +0, 227, 227, 1, 38016, 0xad2f328c +0, 228, 228, 1, 38016, 0xea724415 +0, 229, 229, 1, 38016, 0x34016af4 +0, 230, 230, 1, 38016, 0x4829a4cb +0, 231, 231, 1, 38016, 0x4b24bc67 +0, 232, 232, 1, 38016, 0xb523f023 +0, 233, 233, 1, 38016, 0x5c6d2305 +0, 234, 234, 1, 38016, 0x39e63adc +0, 235, 235, 1, 38016, 0xf7c64a7c +0, 236, 236, 1, 38016, 0xd601680a +0, 237, 237, 1, 38016, 0xbbad6a12 +0, 238, 238, 1, 38016, 0xddc1500f +0, 239, 239, 1, 38016, 0x1f1726e6 +0, 240, 240, 1, 38016, 0x48aee68f +0, 241, 241, 1, 38016, 0xc1fbd4f0 +0, 242, 242, 1, 38016, 0x4a89dc83 +0, 243, 243, 1, 38016, 0xa7cd2b02 +0, 244, 244, 1, 38016, 0xf52aa0b8 +0, 245, 245, 1, 38016, 0x1f260626 +0, 246, 246, 1, 38016, 0x80561eac +0, 247, 247, 1, 38016, 0x6687f8ef +0, 248, 248, 1, 38016, 0x986ab08f +0, 249, 249, 1, 38016, 0xb4923773 +0, 250, 250, 1, 38016, 0x5cc2d603 +0, 251, 251, 1, 38016, 0x9e8d93db +0, 252, 252, 1, 38016, 0x33fd8981 +0, 253, 253, 1, 38016, 0xaf45e630 +0, 254, 254, 1, 38016, 0x1227448e +0, 255, 255, 1, 38016, 0x424cccf0 +0, 256, 256, 1, 38016, 0x03b0cb3e +0, 257, 257, 1, 38016, 0x7aad547d +0, 258, 258, 1, 38016, 0xbf8544b2 +0, 259, 259, 1, 38016, 0x54a843ca +0, 260, 260, 1, 38016, 0x759d4dd0 +0, 261, 261, 1, 38016, 0x000162da +0, 262, 262, 1, 38016, 0x87ec74b0 +0, 263, 263, 1, 38016, 0xefee8259 +0, 264, 264, 1, 38016, 0x7b547eea +0, 265, 265, 1, 38016, 0xcae96b73 +0, 266, 266, 1, 38016, 0x730f59c3 +0, 267, 267, 1, 38016, 0x7d9b3e82 +0, 268, 268, 1, 38016, 0x3bb11ef0 +0, 269, 269, 1, 38016, 0x7581fa6b +0, 270, 270, 1, 38016, 0xe594a982 +0, 271, 271, 1, 38016, 0xde3888d6 +0, 272, 272, 1, 38016, 0x0e096d6b +0, 273, 273, 1, 38016, 0x297c20dc +0, 274, 274, 1, 38016, 0x51f7ce7f +0, 275, 275, 1, 38016, 0x23d2c247 +0, 276, 276, 1, 38016, 0x0bdcd0d0 +0, 277, 277, 1, 38016, 0x63cfd4f3 +0, 278, 278, 1, 38016, 0x6d4b01f8 +0, 279, 279, 1, 38016, 0xa50d72f0 +0, 280, 280, 1, 38016, 0xccad0d72 +0, 281, 281, 1, 38016, 0x10c9e33e +0, 282, 282, 1, 38016, 0xba6daf97 +0, 283, 283, 1, 38016, 0xd65074e0 +0, 284, 284, 1, 38016, 0xd36954aa +0, 285, 285, 1, 38016, 0xd9a2a642 +0, 286, 286, 1, 38016, 0xce755f9f +0, 287, 287, 1, 38016, 0x81d29c44 +0, 288, 288, 1, 38016, 0x23b0aef5 +0, 289, 289, 1, 38016, 0xb0ef9efa +0, 290, 290, 1, 38016, 0xf20d4a7a +0, 291, 291, 1, 38016, 0xa0c86899 +0, 292, 292, 1, 38016, 0x1ae4f865 +0, 293, 293, 1, 38016, 0x3a5731c8 +0, 294, 294, 1, 38016, 0x75f17ec5 +0, 295, 295, 1, 38016, 0x8f447aa9 +0, 296, 296, 1, 38016, 0x71615441 +0, 297, 297, 1, 38016, 0x90c13e26 +0, 298, 298, 1, 38016, 0x08d04aaf +0, 299, 299, 1, 38016, 0x14fd7b04 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-mov mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-mov --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-mov 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-mov 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,115 @@ +ac2e8f528dae4e4d610fa3517d2c94fb *tests/data/fate/h264_redundant_pps-mov.h264 +187284 tests/data/fate/h264_redundant_pps-mov.h264 +#tb 0: 1/24 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 640x360 +#sar 0: 1/1 +0, 0, 0, 1, 345600, 0xc40ffa02 +0, 1, 1, 1, 345600, 0x346acaba +0, 2, 2, 1, 345600, 0x26f3de5d +0, 3, 3, 1, 345600, 0xacf384e1 +0, 4, 4, 1, 345600, 0xd7dc8e0b +0, 5, 5, 1, 345600, 0xd7dc8e0b +0, 6, 6, 1, 345600, 0x47f99430 +0, 7, 7, 1, 345600, 0x00259c5a +0, 8, 8, 1, 345600, 0xec659aa2 +0, 9, 9, 1, 345600, 0xec659aa2 +0, 10, 10, 1, 345600, 0x84fef765 +0, 11, 11, 1, 345600, 0xcbeecbe4 +0, 12, 12, 1, 345600, 0x9386982e +0, 13, 13, 1, 345600, 0x682ccf66 +0, 14, 14, 1, 345600, 0x89d10278 +0, 15, 15, 1, 345600, 0x407272a3 +0, 16, 16, 1, 345600, 0x32e0b287 +0, 17, 17, 1, 345600, 0x709ccfe5 +0, 18, 18, 1, 345600, 0x00dcbebc +0, 19, 19, 1, 345600, 0x61b7aa83 +0, 20, 20, 1, 345600, 0x03c7c404 +0, 21, 21, 1, 345600, 0x9b794d4c +0, 22, 22, 1, 345600, 0xb090b3f0 +0, 23, 23, 1, 345600, 0xdb596340 +0, 24, 24, 1, 345600, 0x031f4ba8 +0, 25, 25, 1, 345600, 0xef484d42 +0, 26, 26, 1, 345600, 0xa2814cec +0, 27, 27, 1, 345600, 0x5432765c +0, 28, 28, 1, 345600, 0xef5fd507 +0, 29, 29, 1, 345600, 0x13b2138d +0, 30, 30, 1, 345600, 0x29f24795 +0, 31, 31, 1, 345600, 0x6dce96e1 +0, 32, 32, 1, 345600, 0xb0cdf793 +0, 33, 33, 1, 345600, 0x1b921fb6 +0, 34, 34, 1, 345600, 0xcc446384 +0, 35, 35, 1, 345600, 0x784689e7 +0, 36, 36, 1, 345600, 0xfaf5ac7e +0, 37, 37, 1, 345600, 0x6ce2c6b5 +0, 38, 38, 1, 345600, 0xcb9408ad +0, 39, 39, 1, 345600, 0x4f40082d +0, 40, 40, 1, 345600, 0x9c039eb7 +0, 41, 41, 1, 345600, 0xb271ec7d +0, 42, 42, 1, 345600, 0x31d2af2c +0, 43, 43, 1, 345600, 0xe187adc4 +0, 44, 44, 1, 345600, 0xec28b3cc +0, 45, 45, 1, 345600, 0x5596b34c +0, 46, 46, 1, 345600, 0xb75f475c +0, 47, 47, 1, 345600, 0x888f311c +0, 48, 48, 1, 345600, 0xedab720f +0, 49, 49, 1, 345600, 0xbf75fa40 +0, 50, 50, 1, 345600, 0x13bb37d7 +0, 51, 51, 1, 345600, 0xbc6aeded +0, 52, 52, 1, 345600, 0xf6a6478a +0, 53, 53, 1, 345600, 0x46d4e723 +0, 54, 54, 1, 345600, 0x1263e5e3 +0, 55, 55, 1, 345600, 0x6d3fc449 +0, 56, 56, 1, 345600, 0xc218c2c9 +0, 57, 57, 1, 345600, 0x12ef8744 +0, 58, 58, 1, 345600, 0xc073486e +0, 59, 59, 1, 345600, 0xa3403147 +0, 60, 60, 1, 345600, 0x720a8c5b +0, 61, 61, 1, 345600, 0x7a268f12 +0, 62, 62, 1, 345600, 0xf311d147 +0, 63, 63, 1, 345600, 0x5cc12e78 +0, 64, 64, 1, 345600, 0xf09ecd59 +0, 65, 65, 1, 345600, 0x0e3b46c3 +0, 66, 66, 1, 345600, 0x80786a01 +0, 67, 67, 1, 345600, 0x3edd6931 +0, 68, 68, 1, 345600, 0x14e27291 +0, 69, 69, 1, 345600, 0x12776fd1 +0, 70, 70, 1, 345600, 0xa68cf46d +0, 71, 71, 1, 345600, 0x04f99d27 +0, 72, 72, 1, 345600, 0x76618a97 +0, 73, 73, 1, 345600, 0x7559dcae +0, 74, 74, 1, 345600, 0xc9f4d77f +0, 75, 75, 1, 345600, 0xe76fbad7 +0, 76, 76, 1, 345600, 0x6efca571 +0, 77, 77, 1, 345600, 0x0619a437 +0, 78, 78, 1, 345600, 0x0b48a563 +0, 79, 79, 1, 345600, 0x6ec1bae9 +0, 80, 80, 1, 345600, 0xcce588aa +0, 81, 81, 1, 345600, 0xa003e269 +0, 82, 82, 1, 345600, 0x6507ec83 +0, 83, 83, 1, 345600, 0xa697ec03 +0, 84, 84, 1, 345600, 0xb18a0ddd +0, 85, 85, 1, 345600, 0x96b74d36 +0, 86, 86, 1, 345600, 0x6b6d5ebb +0, 87, 87, 1, 345600, 0x86a082c4 +0, 88, 88, 1, 345600, 0x463ac3e6 +0, 89, 89, 1, 345600, 0xac54e07e +0, 90, 90, 1, 345600, 0xdd32e5ce +0, 91, 91, 1, 345600, 0xc27b9140 +0, 92, 92, 1, 345600, 0x70855f0b +0, 93, 93, 1, 345600, 0xad849d48 +0, 94, 94, 1, 345600, 0x26f6bbba +0, 95, 95, 1, 345600, 0x4c01cc6c +0, 96, 96, 1, 345600, 0x2f6fdac5 +0, 97, 97, 1, 345600, 0xb4d8f6d6 +0, 98, 98, 1, 345600, 0x53aafc9f +0, 99, 99, 1, 345600, 0x53aafc9f +0, 100, 100, 1, 345600, 0xa016f90b +0, 101, 101, 1, 345600, 0x7a68ea8b +0, 102, 102, 1, 345600, 0x74cee980 +0, 103, 103, 1, 345600, 0x16621888 +0, 104, 104, 1, 345600, 0x16621888 +0, 105, 105, 1, 345600, 0x4f6c5227 +0, 106, 106, 1, 345600, 0x5d8343c2 +0, 107, 107, 1, 345600, 0x4ea83d1a diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,21 @@ +a35cca13c3f91d1a279bf576b8264d05 *tests/data/fate/h264_redundant_pps-side_data.nut +596153 tests/data/fate/h264_redundant_pps-side_data.nut +#extradata 0: 34, 0x851f08e4 +#tb 0: 1/48000 +#media_type 0: video +#codec_id 0: h264 +#dimensions 0: 1920x1080 +#sar 0: 0/1 +0, -2002, 0, 2002, 247959, 0xdb721881, S=1, 34 +0, 0, 4004, 2002, 43356, 0xa366eb79, F=0x0 +0, 2002, 2002, 2002, 11423, 0x9c0a86fa, F=0x0 +0, 4004, 8008, 2002, 50801, 0xfbfe860d, F=0x0 +0, 6006, 6006, 2002, 12567, 0x650a5321, F=0x0 +0, 8008, 12012, 2002, 52447, 0x19e106c1, F=0x0 +0, 10010, 10010, 2002, 12575, 0x83c94868, F=0x0 +0, 12012, 16016, 2002, 54028, 0xa8460c03, F=0x0 +0, 14014, 14014, 2002, 13539, 0x0bc96c74, F=0x0 +0, 16016, 20020, 2002, 54489, 0x319c9032, F=0x0 +0, 18018, 18018, 2002, 13705, 0x38a02805, F=0x0 +0, 20020, 22022, 2002, 22313, 0xec81a420, F=0x0 +0, 22022, 24024, 2002, 6335, 0xa524214d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data2 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/h264_redundant_pps-side_data2 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,11 @@ +dd953f8d95d2927703ce9593a07fe2e7 *tests/data/fate/h264_redundant_pps-side_data2.nut +5162 tests/data/fate/h264_redundant_pps-side_data2.nut +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 256x128 +#sar 0: 1/1 +0, 0, 0, 1, 49152, 0x08745db9 +0, 1, 1, 1, 49152, 0x96bf5e58 +0, 2, 2, 1, 49152, 0x8fe31b6d +0, 3, 3, 1, 49152, 0x0b621cc3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov 2023-03-03 13:29:59.000000000 +0000 @@ -9,7 +9,7 @@ duration_time=0.040000 size=4612 pos=36 -flags=K_ +flags=K__ data_hash=adler32:ed83c166 [/PACKET] [STREAM] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov 2023-03-03 13:29:59.000000000 +0000 @@ -9,7 +9,7 @@ duration_time=0.040000 size=9220 pos=36 -flags=K_ +flags=K__ data_hash=adler32:b3ccc147 [/PACKET] [STREAM] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-afd-tc-sei mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-afd-tc-sei --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-afd-tc-sei 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-afd-tc-sei 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,204 @@ +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] +[FRAME] +[SIDE_DATA] +side_data_type=Active format description +active_format=8 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=SMPTE 12-1 timecode +[TIMECODE] +value=00:00:00:00 +[/TIMECODE] +[/SIDE_DATA] +[/FRAME] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-conformance-WPP_HIGH_TP_444_8BIT_RExt_Apple_2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-conformance-WPP_HIGH_TP_444_8BIT_RExt_Apple_2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-conformance-WPP_HIGH_TP_444_8BIT_RExt_Apple_2 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-conformance-WPP_HIGH_TP_444_8BIT_RExt_Apple_2 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,8 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 1024x768 +#sar 0: 0/1 +0, 0, 0, 1, 1179648, 0x78e55a69 +0, 1, 1, 1, 1179648, 0x5babb3cb +0, 2, 2, 1, 1179648, 0x65935648 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-dv-rpu mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-dv-rpu --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-dv-rpu 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/hevc-dv-rpu 2023-03-03 13:29:59.000000000 +0000 @@ -3,6 +3,12 @@ side_data_type=H.26[45] User Data Unregistered SEI message [/SIDE_DATA] [SIDE_DATA] +side_data_type=Ambient viewing environment +ambient_illuminance=3140000/10000 +ambient_light_x=15635/50000 +ambient_light_y=16450/50000 +[/SIDE_DATA] +[SIDE_DATA] side_data_type=Dolby Vision RPU Data [/SIDE_DATA] [SIDE_DATA] @@ -120,6 +126,12 @@ [/FRAME] [FRAME] [SIDE_DATA] +side_data_type=Ambient viewing environment +ambient_illuminance=3140000/10000 +ambient_light_x=15635/50000 +ambient_light_y=16450/50000 +[/SIDE_DATA] +[SIDE_DATA] side_data_type=Dolby Vision RPU Data [/SIDE_DATA] [SIDE_DATA] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/id3v2-utf16-bom mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/id3v2-utf16-bom --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/id3v2-utf16-bom 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/id3v2-utf16-bom 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,42 @@ +9b8bfdf87a8d3d089819ef9f6f264ec4 *tests/data/fate/id3v2-utf16-bom.aiff +885482 tests/data/fate/id3v2-utf16-bom.aiff +#tb 0: 1/90000 +#media_type 0: video +#codec_id 0: mjpeg +#dimensions 0: 350x350 +#sar 0: 1/1 +#tb 1: 1/48000 +#media_type 1: audio +#codec_id 1: pcm_s24be +#sample_rate 1: 48000 +#channel_layout_name 1: hexagonal +0, 0, 0, 0, 19650, 0xd5662610 +1, 0, 0, 227, 4086, 0x00000000 +1, 227, 227, 227, 4086, 0x00000000 +1, 454, 454, 227, 4086, 0x00000000 +1, 681, 681, 227, 4086, 0x667b2643 +1, 908, 908, 227, 4086, 0x9a09957d +1, 1135, 1135, 227, 4086, 0x763e27c5 +1, 1362, 1362, 227, 4086, 0x2a47f536 +1, 1589, 1589, 227, 4086, 0xed32e5f2 +1, 1816, 1816, 227, 4086, 0x2e96c720 +1, 2043, 2043, 227, 4086, 0x84c5b5f0 +1, 2270, 2270, 227, 4086, 0xe3dfeefc +[STREAM] +channel_layout=hexagonal +[/STREAM] +[STREAM] +TAG:title=Дороги +TAG:comment=Other +[/STREAM] +[FORMAT] +TAG:artist=Мельница +TAG:RATING=0 +TAG:album=Ангелофрения +TAG:title=Дороги +TAG:tracktotal=11 +TAG:totaltracks=11 +TAG:genre=Folk +TAG:track=2 +TAG:date=2012 +[/FORMAT] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf 2023-03-03 13:29:59.000000000 +0000 @@ -1,6 +1,7 @@ FFMPEG sample content urn:uuid:8713c020-2489-45f5-a9f7-87be539e20b5 24000 1001 +02:10:01:23 Marker resource count: 2 Marker resource 0 Marker 0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf-cpl-with-audio mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf-cpl-with-audio --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf-cpl-with-audio 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imf-cpl-with-audio 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,207 @@ +#tb 0: 1/24 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 640x360 +#sar 0: 0/1 +#tb 1: 1/48000 +#media_type 1: audio +#codec_id 1: pcm_s24le +#sample_rate 1: 48000 +#channel_layout_name 1: stereo +0, 0, 0, 1, 1382400, 0x6a2c410c +1, 0, 0, 1920, 11520, 0x974f4bab +1, 1920, 1920, 1920, 11520, 0xdf793f69 +0, 1, 1, 1, 1382400, 0x5f0c67d2 +1, 3840, 3840, 1920, 11520, 0xfd69559a +0, 2, 2, 1, 1382400, 0x408e1262 +1, 5760, 5760, 1920, 11520, 0x28fa469b +0, 3, 3, 1, 1382400, 0x3567d455 +1, 7680, 7680, 1920, 11520, 0xe49161cf +0, 4, 4, 1, 1382400, 0x2312e68b +1, 9600, 9600, 1920, 11520, 0xb92c49ae +0, 5, 5, 1, 1382400, 0xe3d84ec2 +1, 11520, 11520, 1920, 11520, 0xd2b75d46 +0, 6, 6, 1, 1382400, 0xdbb3ab8c +1, 13440, 13440, 1920, 11520, 0xa13b5a9b +0, 7, 7, 1, 1382400, 0xeb250513 +1, 15360, 15360, 1920, 11520, 0xfe804299 +0, 8, 8, 1, 1382400, 0x26c3c8c0 +1, 17280, 17280, 1920, 11520, 0x7a8654d4 +0, 9, 9, 1, 1382400, 0xbc41a23e +1, 19200, 19200, 1920, 11520, 0x1a2e48a4 +0, 10, 10, 1, 1382400, 0x49d6a8de +1, 21120, 21120, 1920, 11520, 0x20504669 +0, 11, 11, 1, 1382400, 0x5e05cfa4 +1, 23040, 23040, 960, 5760, 0x74bf38f6 +0, 12, 12, 1, 1382400, 0x01327a34 +1, 24000, 24000, 1920, 11520, 0x974f4bab +1, 25920, 25920, 1920, 11520, 0xdf793f69 +0, 13, 13, 1, 1382400, 0x06ce3c36 +1, 27840, 27840, 1920, 11520, 0xfd69559a +0, 14, 14, 1, 1382400, 0x6aa24e6c +1, 29760, 29760, 1920, 11520, 0x28fa469b +0, 15, 15, 1, 1382400, 0x55d8b694 +1, 31680, 31680, 1920, 11520, 0xe49161cf +0, 16, 16, 1, 1382400, 0xcc6f136d +1, 33600, 33600, 1920, 11520, 0xb92c49ae +0, 17, 17, 1, 1382400, 0xe92b6ce5 +1, 35520, 35520, 1920, 11520, 0xd2b75d46 +0, 18, 18, 1, 1382400, 0x664d30a1 +1, 37440, 37440, 1920, 11520, 0xa13b5a9b +0, 19, 19, 1, 1382400, 0x09d80a1f +1, 39360, 39360, 1920, 11520, 0xfe804299 +0, 20, 20, 1, 1382400, 0x2b58536e +1, 41280, 41280, 1920, 11520, 0x7a8654d4 +0, 21, 21, 1, 1382400, 0xf24b7a34 +1, 43200, 43200, 1920, 11520, 0x1a2e48a4 +0, 22, 22, 1, 1382400, 0xe2a524c4 +1, 45120, 45120, 1920, 11520, 0x20504669 +0, 23, 23, 1, 1382400, 0xe841e6b7 +1, 47040, 47040, 1920, 11520, 0x7ad44ba6 +0, 24, 24, 1, 1382400, 0x6a2c410c +1, 48960, 48960, 1920, 11520, 0xc8934994 +0, 25, 25, 1, 1382400, 0x5f0c67d2 +1, 50880, 50880, 1920, 11520, 0x07ad70bb +0, 26, 26, 1, 1382400, 0x408e1262 +1, 52800, 52800, 1920, 11520, 0x1ba75d9a +0, 27, 27, 1, 1382400, 0x3567d455 +1, 54720, 54720, 1920, 11520, 0x0d4a435f +0, 28, 28, 1, 1382400, 0x2312e68b +1, 56640, 56640, 1920, 11520, 0x288b6c85 +0, 29, 29, 1, 1382400, 0xe3d84ec2 +1, 58560, 58560, 1920, 11520, 0x85da5f6e +0, 30, 30, 1, 1382400, 0xdbb3ab8c +1, 60480, 60480, 1920, 11520, 0x317a6ac0 +0, 31, 31, 1, 1382400, 0xeb250513 +1, 62400, 62400, 1920, 11520, 0xeea55aa3 +0, 32, 32, 1, 1382400, 0x26c3c8c0 +1, 64320, 64320, 1920, 11520, 0x598b604c +0, 33, 33, 1, 1382400, 0xbc41a23e +1, 66240, 66240, 1920, 11520, 0xbf6f4b95 +0, 34, 34, 1, 1382400, 0x49d6a8de +1, 68160, 68160, 1920, 11520, 0x52e66e81 +0, 35, 35, 1, 1382400, 0x5e05cfa4 +1, 70080, 70080, 1920, 11520, 0xca9b57c9 +0, 36, 36, 1, 1382400, 0x01327a34 +1, 72000, 72000, 1920, 11520, 0x974f4bab +1, 73920, 73920, 1920, 11520, 0xdf793f69 +0, 37, 37, 1, 1382400, 0x06ce3c36 +1, 75840, 75840, 1920, 11520, 0xfd69559a +0, 38, 38, 1, 1382400, 0x6aa24e6c +1, 77760, 77760, 1920, 11520, 0x28fa469b +0, 39, 39, 1, 1382400, 0x55d8b694 +1, 79680, 79680, 1920, 11520, 0xe49161cf +0, 40, 40, 1, 1382400, 0xcc6f136d +1, 81600, 81600, 1920, 11520, 0xb92c49ae +0, 41, 41, 1, 1382400, 0xe92b6ce5 +1, 83520, 83520, 1920, 11520, 0xd2b75d46 +0, 42, 42, 1, 1382400, 0x664d30a1 +1, 85440, 85440, 1920, 11520, 0xa13b5a9b +0, 43, 43, 1, 1382400, 0x09d80a1f +1, 87360, 87360, 1920, 11520, 0xfe804299 +0, 44, 44, 1, 1382400, 0x2b58536e +1, 89280, 89280, 1920, 11520, 0x7a8654d4 +0, 45, 45, 1, 1382400, 0xf24b7a34 +1, 91200, 91200, 1920, 11520, 0x1a2e48a4 +0, 46, 46, 1, 1382400, 0xe2a524c4 +1, 93120, 93120, 1920, 11520, 0x20504669 +0, 47, 47, 1, 1382400, 0xe841e6b7 +1, 95040, 95040, 1920, 11520, 0x7ad44ba6 +0, 48, 48, 1, 1382400, 0x6a2c410c +1, 96960, 96960, 1920, 11520, 0xc8934994 +0, 49, 49, 1, 1382400, 0x5f0c67d2 +1, 98880, 98880, 1920, 11520, 0x07ad70bb +0, 50, 50, 1, 1382400, 0x408e1262 +1, 100800, 100800, 1920, 11520, 0x1ba75d9a +0, 51, 51, 1, 1382400, 0x3567d455 +1, 102720, 102720, 1920, 11520, 0x0d4a435f +0, 52, 52, 1, 1382400, 0x2312e68b +1, 104640, 104640, 1920, 11520, 0x288b6c85 +0, 53, 53, 1, 1382400, 0xe3d84ec2 +1, 106560, 106560, 1920, 11520, 0x85da5f6e +0, 54, 54, 1, 1382400, 0xdbb3ab8c +1, 108480, 108480, 1920, 11520, 0x317a6ac0 +0, 55, 55, 1, 1382400, 0xeb250513 +1, 110400, 110400, 1920, 11520, 0xeea55aa3 +0, 56, 56, 1, 1382400, 0x26c3c8c0 +1, 112320, 112320, 1920, 11520, 0x598b604c +0, 57, 57, 1, 1382400, 0xbc41a23e +1, 114240, 114240, 1770, 10620, 0xabdba053 +0, 58, 58, 1, 1382400, 0x49d6a8de +1, 116010, 116010, 1920, 11520, 0x38de5240 +1, 117930, 117930, 1920, 11520, 0x05c23c05 +0, 59, 59, 1, 1382400, 0x5e05cfa4 +1, 119850, 119850, 1920, 11520, 0x70d7621a +0, 60, 60, 1, 1382400, 0x01327a34 +1, 121770, 121770, 1920, 11520, 0x2fef4788 +0, 61, 61, 1, 1382400, 0x06ce3c36 +1, 123690, 123690, 1920, 11520, 0x95b0542b +0, 62, 62, 1, 1382400, 0x6aa24e6c +1, 125610, 125610, 1920, 11520, 0x38654d48 +0, 63, 63, 1, 1382400, 0x55d8b694 +1, 127530, 127530, 1920, 11520, 0x06ec57ec +0, 64, 64, 1, 1382400, 0xcc6f136d +1, 129450, 129450, 1920, 11520, 0xd0a76908 +0, 65, 65, 1, 1382400, 0xe92b6ce5 +1, 131370, 131370, 1920, 11520, 0xbd7c4296 +0, 66, 66, 1, 1382400, 0x664d30a1 +1, 133290, 133290, 1920, 11520, 0x7fa54533 +0, 67, 67, 1, 1382400, 0x09d80a1f +1, 135210, 135210, 1920, 11520, 0x7e324f34 +0, 68, 68, 1, 1382400, 0x2b58536e +1, 137130, 137130, 1920, 11520, 0x2400410a +0, 69, 69, 1, 1382400, 0xf24b7a34 +1, 139050, 139050, 1920, 11520, 0x52c85b21 +0, 70, 70, 1, 1382400, 0xe2a524c4 +1, 140970, 140970, 1920, 11520, 0xa384487e +0, 71, 71, 1, 1382400, 0xe841e6b7 +1, 142890, 142890, 1920, 11520, 0xddf76717 +0, 72, 72, 1, 1382400, 0x6a2c410c +1, 144810, 144810, 1920, 11520, 0x78165e3a +0, 73, 73, 1, 1382400, 0x5f0c67d2 +1, 146730, 146730, 1920, 11520, 0x037b3e07 +0, 74, 74, 1, 1382400, 0x408e1262 +1, 148650, 148650, 1920, 11520, 0x03d87afa +0, 75, 75, 1, 1382400, 0x3567d455 +1, 150570, 150570, 1920, 11520, 0x17445f5a +0, 76, 76, 1, 1382400, 0x2312e68b +1, 152490, 152490, 1920, 11520, 0xbf48611b +0, 77, 77, 1, 1382400, 0xe3d84ec2 +1, 154410, 154410, 1920, 11520, 0xe5215b3c +0, 78, 78, 1, 1382400, 0xdbb3ab8c +1, 156330, 156330, 1920, 11520, 0x9d345af5 +0, 79, 79, 1, 1382400, 0xeb250513 +1, 158250, 158250, 1920, 11520, 0x3de75a0f +0, 80, 80, 1, 1382400, 0x26c3c8c0 +1, 160170, 160170, 1920, 11520, 0xe3ed6e63 +0, 81, 81, 1, 1382400, 0xbc41a23e +1, 162090, 162090, 1910, 11460, 0x5af73417 +0, 82, 82, 1, 1382400, 0x49d6a8de +1, 164000, 164000, 1920, 11520, 0xee0035c1 +1, 165920, 165920, 1920, 11520, 0x31424265 +0, 83, 83, 1, 1382400, 0x5e05cfa4 +1, 167840, 167840, 1920, 11520, 0x035d4a8d +0, 84, 84, 1, 1382400, 0x01327a34 +1, 169760, 169760, 1920, 11520, 0xa8375593 +0, 85, 85, 1, 1382400, 0x06ce3c36 +1, 171680, 171680, 1920, 11520, 0xbc3e65d3 +0, 86, 86, 1, 1382400, 0x6aa24e6c +1, 173600, 173600, 1920, 11520, 0xa2083bae +0, 87, 87, 1, 1382400, 0x55d8b694 +1, 175520, 175520, 1920, 11520, 0xa220604f +0, 88, 88, 1, 1382400, 0xcc6f136d +1, 177440, 177440, 1920, 11520, 0xd5d3598c +0, 89, 89, 1, 1382400, 0xe92b6ce5 +1, 179360, 179360, 1920, 11520, 0x0e376085 +0, 90, 90, 1, 1382400, 0x664d30a1 +1, 181280, 181280, 1920, 11520, 0x40d973bf +0, 91, 91, 1, 1382400, 0x09d80a1f +1, 183200, 183200, 1920, 11520, 0x05d74496 +0, 92, 92, 1, 1382400, 0x2b58536e +1, 185120, 185120, 1920, 11520, 0xec735e54 +0, 93, 93, 1, 1382400, 0xf24b7a34 +1, 187040, 187040, 1920, 11520, 0x485c5a96 +0, 94, 94, 1, 1382400, 0xe2a524c4 +1, 188960, 188960, 1920, 11520, 0x0ec2705d +0, 95, 95, 1, 1382400, 0xe841e6b7 +1, 190880, 190880, 1120, 6720, 0x81991480 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imgutils mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imgutils --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imgutils 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/imgutils 2023-03-03 13:29:59.000000000 +0000 @@ -246,3 +246,19 @@ p216le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288 p416be planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432 p416le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432 +vuya planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +rgbaf16be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +rgbaf16le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +vuyx planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +p012le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 3072 0 0, plane_offsets: 6144 0 0, total_size: 9216 +p012be planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 3072 0 0, plane_offsets: 6144 0 0, total_size: 9216 +y212be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +y212le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +xv30be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +xv30le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288 +xv36be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +xv36le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576 +rgbf32be planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 0 0, plane_offsets: 0 0 0, total_size: 36864 +rgbf32le planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 0 0, plane_offsets: 0 0 0, total_size: 36864 +rgbaf32be planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152 +rgbaf32le planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/jpg-icc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/jpg-icc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/jpg-icc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/jpg-icc 2023-03-03 13:29:59.000000000 +0000 @@ -18,6 +18,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=0 pkt_size=11010 width=128 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-encoding-delay mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-encoding-delay --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-encoding-delay 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-encoding-delay 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,98 @@ +b933b7b94de55ae029369312d48d8649 *tests/data/fate/matroska-encoding-delay.matroska +961221 tests/data/fate/matroska-encoding-delay.matroska +#extradata 0: 22, 0x32ea0490 +#tb 0: 1/1000 +#media_type 0: video +#codec_id 0: mpeg2video +#dimensions 0: 720x608 +#sar 0: 152/135 +#tb 1: 1/1000 +#media_type 1: audio +#codec_id 1: mp2 +#sample_rate 1: 48000 +#channel_layout_name 1: stereo +1, -10, -10, 24, 1152, 0x724077b8 +0, 0, 0, 40, 237628, 0xeff25579, S=1, 40 +1, 14, 14, 24, 1152, 0x80625572 +1, 38, 38, 24, 1152, 0x7d7f4dce +0, 40, 40, 40, 238066, 0xb2265f41 +1, 62, 62, 24, 1152, 0xa6725739 +0, 80, 80, 40, 237723, 0x00d7cd24 +1, 86, 86, 24, 1152, 0xc9e85398 +1, 110, 110, 24, 1152, 0xda1287d3 +0, 120, 120, 40, 238290, 0xbe18b18f +1, 134, 134, 24, 1152, 0x1c9a6102 +[PACKET] +codec_type=audio +stream_index=1 +pts=-10 +pts_time=-0.010000 +dts=-10 +dts_time=-0.010000 +duration=24 +duration_time=0.024000 +size=1152 +pos=1238 +flags=K__ +[/PACKET] +[PACKET] +codec_type=video +stream_index=0 +pts=0 +pts_time=0.000000 +dts=0 +dts_time=0.000000 +duration=40 +duration_time=0.040000 +size=237628 +pos=2398 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=1 +pts=14 +pts_time=0.014000 +dts=14 +dts_time=0.014000 +duration=24 +duration_time=0.024000 +size=1152 +pos=240033 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=1 +pts=38 +pts_time=0.038000 +dts=38 +dts_time=0.038000 +duration=24 +duration_time=0.024000 +size=1152 +pos=241208 +flags=K__ +[/PACKET] +[PACKET] +codec_type=video +stream_index=0 +pts=40 +pts_time=0.040000 +dts=40 +dts_time=0.040000 +duration=40 +duration_time=0.040000 +size=238066 +pos=242368 +flags=K__ +[/PACKET] +[STREAM] +codec_name=mpeg2video +[SIDE_DATA] +[/SIDE_DATA] +[/STREAM] +[STREAM] +codec_name=mp2 +initial_padding=481 +[/STREAM] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-flac-extradata-update mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-flac-extradata-update --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-flac-extradata-update 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-flac-extradata-update 2023-03-03 13:29:59.000000000 +0000 @@ -1,8 +1,8 @@ -732446e97bae29037ff0cd9963d4ac08 *tests/data/fate/matroska-flac-extradata-update.matroska -1987 tests/data/fate/matroska-flac-extradata-update.matroska -#extradata 0: 34, 0x7acb09e7 -#extradata 1: 34, 0x7acb09e7 -#extradata 2: 34, 0x443402dd +28bc0ded5dc520d955caf29db80d35da *tests/data/fate/matroska-flac-extradata-update.matroska +1795 tests/data/fate/matroska-flac-extradata-update.matroska +#extradata 0: 34, 0x93650c81 +#extradata 1: 34, 0x93650c81 +#extradata 2: 34, 0x93650c81 #tb 0: 1/1000 #media_type 0: audio #codec_id 0: flac @@ -42,9 +42,3 @@ 0, 672, 672, 96, 26, 0x50dd042e 1, 672, 672, 96, 26, 0x50dd042e 2, 672, 672, 96, 26, 0x50dd042e -0, 768, 768, 96, 26, 0x53de0499 -1, 768, 768, 96, 26, 0x53de0499 -0, 864, 864, 96, 26, 0x53df04b4 -1, 864, 864, 96, 26, 0x53df04b4 -0, 960, 960, 42, 26, 0x5740044b -1, 960, 960, 42, 26, 0x5740044b diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-ogg-opus-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-ogg-opus-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-ogg-opus-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-ogg-opus-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,92 @@ +a3f98769fe55bc5234cf75fb1949749a *tests/data/fate/matroska-ogg-opus-remux.matroska +10200 tests/data/fate/matroska-ogg-opus-remux.matroska +#extradata 0: 19, 0x399c0471 +#tb 0: 1/1000 +#media_type 0: audio +#codec_id 0: opus +#sample_rate 0: 48000 +#channel_layout_name 0: stereo +0, -7, -7, 20, 402, 0x89b1c40f +0, 13, 13, 20, 216, 0x7bf97146 +0, 33, 33, 20, 215, 0x6cb86d8b +0, 53, 53, 20, 218, 0x9cfd691c +0, 73, 73, 20, 218, 0xd7fe6a94 +0, 93, 93, 20, 194, 0x35735de6 +0, 113, 113, 20, 216, 0x3ee6705a +0, 133, 133, 20, 218, 0x67eb6cb1 +0, 153, 153, 20, 218, 0x32d0700d +0, 173, 173, 20, 219, 0xcb7f6c60 +0, 193, 193, 20, 218, 0x9c866b33 +0, 213, 213, 20, 217, 0xfe3e6a53 +0, 233, 233, 20, 218, 0x13586833 +0, 253, 253, 20, 222, 0xbcb2669e +0, 273, 273, 20, 218, 0x8dfc6e33 +0, 293, 293, 20, 217, 0xf5957051 +0, 313, 313, 20, 210, 0xed126e6b +0, 333, 333, 20, 216, 0xbf947249 +0, 353, 353, 20, 203, 0x6c7e680a +0, 373, 373, 20, 209, 0xf78f6af4 +0, 393, 393, 20, 217, 0xd60c684d +0, 413, 413, 20, 218, 0x89056a7a +0, 433, 433, 20, 219, 0x0bc674ad +0, 453, 453, 20, 217, 0xb1d86d1a +0, 473, 473, 20, 220, 0x433d685a +0, 493, 493, 20, 364, 0x0c88be84 +0, 513, 513, 20, 221, 0x804a733d +0, 533, 533, 20, 215, 0x6e9d6e9b +0, 553, 553, 20, 215, 0x63016a83 +0, 573, 573, 20, 218, 0xf9a46fbe +0, 593, 593, 20, 216, 0xa0d66c08 +0, 613, 613, 20, 216, 0xa2ca6d0a +0, 633, 633, 20, 216, 0xf50e6f1d +0, 653, 653, 20, 215, 0x6aaa70b6 +0, 673, 673, 20, 219, 0x7ceb6ba0 +0, 693, 693, 20, 220, 0x398d6ca9 +0, 713, 713, 20, 218, 0x7bd06ed5 +0, 733, 733, 20, 219, 0xe2906c62 +0, 753, 753, 20, 217, 0xcf316ba1 +0, 773, 773, 20, 217, 0x470b6eea +0, 793, 793, 20, 359, 0x36c2a18a, S=1, 10 +[PACKET] +codec_type=audio +stream_index=0 +pts=-7 +pts_time=-0.007000 +dts=-7 +dts_time=-0.007000 +duration=20 +duration_time=0.020000 +size=402 +pos=540 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=0 +pts=13 +pts_time=0.013000 +dts=13 +dts_time=0.013000 +duration=20 +duration_time=0.020000 +size=216 +pos=949 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=0 +pts=33 +pts_time=0.033000 +dts=33 +dts_time=0.033000 +duration=20 +duration_time=0.020000 +size=215 +pos=1172 +flags=K__ +[/PACKET] +[STREAM] +codec_name=opus +initial_padding=356 +[/STREAM] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-opus-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-opus-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-opus-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/matroska-opus-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,103 @@ +551e45142f0989b281e837a3a86f0218 *tests/data/fate/matroska-opus-remux.matroska +9355 tests/data/fate/matroska-opus-remux.matroska +#extradata 0: 19, 0x3a04048f +#tb 0: 1/1000 +#media_type 0: audio +#codec_id 0: opus +#sample_rate 0: 48000 +#channel_layout_name 0: mono +0, -7, -7, 20, 320, 0x58b9a88d +0, 14, 14, 20, 159, 0x6c9c4b4c +0, 34, 34, 20, 148, 0x0caf4b5d +0, 54, 54, 20, 139, 0xc5624226 +0, 74, 74, 20, 146, 0x633c4937 +0, 94, 94, 20, 153, 0x3d0b4f93 +0, 114, 114, 20, 158, 0xe5c55641 +0, 134, 134, 20, 156, 0xf2fd50ef +0, 154, 154, 20, 158, 0x93b15410 +0, 174, 174, 20, 157, 0xb6f74f5f +0, 194, 194, 20, 159, 0x9aff4957 +0, 214, 214, 20, 153, 0xfc5f4aba +0, 234, 234, 20, 158, 0x01e44f70 +0, 254, 254, 20, 153, 0x227149cf +0, 274, 274, 20, 155, 0x312f4cf6 +0, 294, 294, 20, 155, 0xafc54bae +0, 314, 314, 20, 151, 0x7b4252b3 +0, 334, 334, 20, 155, 0x29074a75 +0, 354, 354, 20, 149, 0x82c44bcd +0, 374, 374, 20, 150, 0x55c24eb5 +0, 394, 394, 20, 156, 0xf71d4f33 +0, 414, 414, 20, 153, 0x9b6c4ae5 +0, 434, 434, 20, 156, 0x75954e51 +0, 454, 454, 20, 155, 0x28ff4ff3 +0, 474, 474, 20, 153, 0xc4424969 +0, 494, 494, 20, 154, 0xfbf94cc8 +0, 514, 514, 20, 155, 0x52c549af +0, 534, 534, 20, 150, 0x6f1e4b7a +0, 554, 554, 20, 158, 0xabb45566 +0, 574, 574, 20, 157, 0xe61d4a99 +0, 594, 594, 20, 159, 0xf45d4fac +0, 614, 614, 20, 159, 0xcd0553a5 +0, 634, 634, 20, 156, 0xdb244e63 +0, 654, 654, 20, 154, 0x78654c52 +0, 674, 674, 20, 154, 0x9f804cc8 +0, 694, 694, 20, 150, 0x1fdf4c80 +0, 714, 714, 20, 155, 0x1adc4f89 +0, 734, 734, 20, 155, 0x4b53511c +0, 754, 754, 20, 151, 0x8ff2546d +0, 774, 774, 20, 158, 0xb7e34f1b +0, 794, 794, 20, 154, 0x4d98474b +0, 814, 814, 20, 154, 0x14924ea8 +0, 834, 834, 20, 153, 0x8d4752bf +0, 854, 854, 20, 149, 0x74785066 +0, 874, 874, 20, 151, 0x36c94a4c +0, 894, 894, 20, 155, 0x82904f3b +0, 914, 914, 20, 154, 0xd76b4a45 +0, 934, 934, 20, 159, 0x9fec548d +0, 954, 954, 20, 154, 0x9a084dcd +0, 974, 974, 20, 155, 0x90a54ac8 +0, 994, 994, 20, 324, 0x8e34a2f5 +0, 1014, 1014, 20, 268, 0x10f37203, S=1, 10 +[PACKET] +codec_type=audio +stream_index=0 +pts=-7 +pts_time=-0.007000 +dts=-7 +dts_time=-0.007000 +duration=20 +duration_time=0.020000 +size=320 +pos=496 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=0 +pts=14 +pts_time=0.014000 +dts=14 +dts_time=0.014000 +duration=20 +duration_time=0.020000 +size=159 +pos=823 +flags=K__ +[/PACKET] +[PACKET] +codec_type=audio +stream_index=0 +pts=34 +pts_time=0.034000 +dts=34 +dts_time=0.034000 +duration=20 +duration_time=0.020000 +size=148 +pos=989 +flags=K__ +[/PACKET] +[STREAM] +codec_name=opus +initial_padding=312 +[/STREAM] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mkv-1242 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mkv-1242 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mkv-1242 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mkv-1242 2023-03-03 13:29:59.000000000 +0000 @@ -42,6 +42,3 @@ 1, 383, 383, 21, 325, 0xcd7a9fd6 1, 404, 404, 22, 359, 0x6edeb91c 1, 426, 426, 21, 333, 0xb8999fb7 -1, 447, 447, 21, 317, 0xf2589e1a -1, 468, 468, 21, 319, 0x82ed9572 -1, 489, 489, 22, 473, 0xea54e696 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-aac-2048-priming mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-aac-2048-priming --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-aac-2048-priming 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-aac-2048-priming 2023-03-03 13:29:59.000000000 +0000 @@ -1,218 +1,218 @@ -packet|codec_type=audio|stream_index=0|pts=-2048|pts_time=-0.046440|dts=-2048|dts_time=-0.046440|duration=1024|duration_time=0.023220|size=258|pos=36|flags=KD|side_data|side_data_type=Skip Samples|skip_samples=2048|discard_padding=0|skip_reason=0|discard_reason=0 +packet|codec_type=audio|stream_index=0|pts=-2048|pts_time=-0.046440|dts=-2048|dts_time=-0.046440|duration=1024|duration_time=0.023220|size=258|pos=36|flags=KD_|side_data|side_data_type=Skip Samples|skip_samples=2048|discard_padding=0|skip_reason=0|discard_reason=0 -packet|codec_type=audio|stream_index=0|pts=-1024|pts_time=-0.023220|dts=-1024|dts_time=-0.023220|duration=1024|duration_time=0.023220|size=258|pos=294|flags=KD -packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|size=146|pos=552|flags=K_ -packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|size=186|pos=698|flags=K_ -packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|size=222|pos=884|flags=K_ -packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|size=186|pos=1106|flags=K_ -packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|size=206|pos=1292|flags=K_ -packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=1024|duration_time=0.023220|size=199|pos=1498|flags=K_ -packet|codec_type=audio|stream_index=0|pts=6144|pts_time=0.139320|dts=6144|dts_time=0.139320|duration=1024|duration_time=0.023220|size=236|pos=1697|flags=K_ -packet|codec_type=audio|stream_index=0|pts=7168|pts_time=0.162540|dts=7168|dts_time=0.162540|duration=1024|duration_time=0.023220|size=208|pos=1933|flags=K_ -packet|codec_type=audio|stream_index=0|pts=8192|pts_time=0.185760|dts=8192|dts_time=0.185760|duration=1024|duration_time=0.023220|size=238|pos=2141|flags=K_ -packet|codec_type=audio|stream_index=0|pts=9216|pts_time=0.208980|dts=9216|dts_time=0.208980|duration=1024|duration_time=0.023220|size=222|pos=2379|flags=K_ -packet|codec_type=audio|stream_index=0|pts=10240|pts_time=0.232200|dts=10240|dts_time=0.232200|duration=1024|duration_time=0.023220|size=211|pos=2601|flags=K_ -packet|codec_type=audio|stream_index=0|pts=11264|pts_time=0.255420|dts=11264|dts_time=0.255420|duration=1024|duration_time=0.023220|size=153|pos=2812|flags=K_ -packet|codec_type=audio|stream_index=0|pts=12288|pts_time=0.278639|dts=12288|dts_time=0.278639|duration=1024|duration_time=0.023220|size=191|pos=2965|flags=K_ -packet|codec_type=audio|stream_index=0|pts=13312|pts_time=0.301859|dts=13312|dts_time=0.301859|duration=1024|duration_time=0.023220|size=208|pos=3156|flags=K_ -packet|codec_type=audio|stream_index=0|pts=14336|pts_time=0.325079|dts=14336|dts_time=0.325079|duration=1024|duration_time=0.023220|size=188|pos=3364|flags=K_ -packet|codec_type=audio|stream_index=0|pts=15360|pts_time=0.348299|dts=15360|dts_time=0.348299|duration=1024|duration_time=0.023220|size=170|pos=3552|flags=K_ -packet|codec_type=audio|stream_index=0|pts=16384|pts_time=0.371519|dts=16384|dts_time=0.371519|duration=1024|duration_time=0.023220|size=221|pos=3722|flags=K_ -packet|codec_type=audio|stream_index=0|pts=17408|pts_time=0.394739|dts=17408|dts_time=0.394739|duration=1024|duration_time=0.023220|size=247|pos=3943|flags=K_ -packet|codec_type=audio|stream_index=0|pts=18432|pts_time=0.417959|dts=18432|dts_time=0.417959|duration=1024|duration_time=0.023220|size=202|pos=4190|flags=K_ -packet|codec_type=audio|stream_index=0|pts=19456|pts_time=0.441179|dts=19456|dts_time=0.441179|duration=1024|duration_time=0.023220|size=186|pos=4392|flags=K_ -packet|codec_type=audio|stream_index=0|pts=20480|pts_time=0.464399|dts=20480|dts_time=0.464399|duration=1024|duration_time=0.023220|size=196|pos=4578|flags=K_ -packet|codec_type=audio|stream_index=0|pts=21504|pts_time=0.487619|dts=21504|dts_time=0.487619|duration=1024|duration_time=0.023220|size=200|pos=4774|flags=K_ -packet|codec_type=audio|stream_index=0|pts=22528|pts_time=0.510839|dts=22528|dts_time=0.510839|duration=1024|duration_time=0.023220|size=170|pos=4974|flags=K_ -packet|codec_type=audio|stream_index=0|pts=23552|pts_time=0.534059|dts=23552|dts_time=0.534059|duration=1024|duration_time=0.023220|size=172|pos=5144|flags=K_ -packet|codec_type=audio|stream_index=0|pts=24576|pts_time=0.557279|dts=24576|dts_time=0.557279|duration=1024|duration_time=0.023220|size=206|pos=5316|flags=K_ -packet|codec_type=audio|stream_index=0|pts=25600|pts_time=0.580499|dts=25600|dts_time=0.580499|duration=1024|duration_time=0.023220|size=208|pos=5522|flags=K_ -packet|codec_type=audio|stream_index=0|pts=26624|pts_time=0.603719|dts=26624|dts_time=0.603719|duration=1024|duration_time=0.023220|size=217|pos=5730|flags=K_ -packet|codec_type=audio|stream_index=0|pts=27648|pts_time=0.626939|dts=27648|dts_time=0.626939|duration=1024|duration_time=0.023220|size=252|pos=5947|flags=K_ -packet|codec_type=audio|stream_index=0|pts=28672|pts_time=0.650159|dts=28672|dts_time=0.650159|duration=1024|duration_time=0.023220|size=171|pos=6199|flags=K_ -packet|codec_type=audio|stream_index=0|pts=29696|pts_time=0.673379|dts=29696|dts_time=0.673379|duration=1024|duration_time=0.023220|size=206|pos=6370|flags=K_ -packet|codec_type=audio|stream_index=0|pts=30720|pts_time=0.696599|dts=30720|dts_time=0.696599|duration=1024|duration_time=0.023220|size=237|pos=6576|flags=K_ -packet|codec_type=audio|stream_index=0|pts=31744|pts_time=0.719819|dts=31744|dts_time=0.719819|duration=1024|duration_time=0.023220|size=210|pos=6813|flags=K_ -packet|codec_type=audio|stream_index=0|pts=32768|pts_time=0.743039|dts=32768|dts_time=0.743039|duration=1024|duration_time=0.023220|size=166|pos=7023|flags=K_ -packet|codec_type=audio|stream_index=0|pts=33792|pts_time=0.766259|dts=33792|dts_time=0.766259|duration=1024|duration_time=0.023220|size=166|pos=7189|flags=K_ -packet|codec_type=audio|stream_index=0|pts=34816|pts_time=0.789478|dts=34816|dts_time=0.789478|duration=1024|duration_time=0.023220|size=177|pos=7355|flags=K_ -packet|codec_type=audio|stream_index=0|pts=35840|pts_time=0.812698|dts=35840|dts_time=0.812698|duration=1024|duration_time=0.023220|size=188|pos=7532|flags=K_ -packet|codec_type=audio|stream_index=0|pts=36864|pts_time=0.835918|dts=36864|dts_time=0.835918|duration=1024|duration_time=0.023220|size=193|pos=7720|flags=K_ -packet|codec_type=audio|stream_index=0|pts=37888|pts_time=0.859138|dts=37888|dts_time=0.859138|duration=1024|duration_time=0.023220|size=195|pos=7913|flags=K_ -packet|codec_type=audio|stream_index=0|pts=38912|pts_time=0.882358|dts=38912|dts_time=0.882358|duration=1024|duration_time=0.023220|size=211|pos=8108|flags=K_ -packet|codec_type=audio|stream_index=0|pts=39936|pts_time=0.905578|dts=39936|dts_time=0.905578|duration=1024|duration_time=0.023220|size=249|pos=8319|flags=K_ -packet|codec_type=audio|stream_index=0|pts=40960|pts_time=0.928798|dts=40960|dts_time=0.928798|duration=1024|duration_time=0.023220|size=223|pos=8568|flags=K_ -packet|codec_type=audio|stream_index=0|pts=41984|pts_time=0.952018|dts=41984|dts_time=0.952018|duration=1024|duration_time=0.023220|size=230|pos=8791|flags=K_ -packet|codec_type=audio|stream_index=0|pts=43008|pts_time=0.975238|dts=43008|dts_time=0.975238|duration=1024|duration_time=0.023220|size=203|pos=9021|flags=K_ -packet|codec_type=audio|stream_index=0|pts=44032|pts_time=0.998458|dts=44032|dts_time=0.998458|duration=1024|duration_time=0.023220|size=180|pos=9224|flags=K_ -packet|codec_type=audio|stream_index=0|pts=45056|pts_time=1.021678|dts=45056|dts_time=1.021678|duration=1024|duration_time=0.023220|size=172|pos=9404|flags=K_ -packet|codec_type=audio|stream_index=0|pts=46080|pts_time=1.044898|dts=46080|dts_time=1.044898|duration=1024|duration_time=0.023220|size=240|pos=9576|flags=K_ -packet|codec_type=audio|stream_index=0|pts=47104|pts_time=1.068118|dts=47104|dts_time=1.068118|duration=1024|duration_time=0.023220|size=179|pos=9816|flags=K_ -packet|codec_type=audio|stream_index=0|pts=48128|pts_time=1.091338|dts=48128|dts_time=1.091338|duration=1024|duration_time=0.023220|size=191|pos=9995|flags=K_ -packet|codec_type=audio|stream_index=0|pts=49152|pts_time=1.114558|dts=49152|dts_time=1.114558|duration=1024|duration_time=0.023220|size=184|pos=10186|flags=K_ -packet|codec_type=audio|stream_index=0|pts=50176|pts_time=1.137778|dts=50176|dts_time=1.137778|duration=1024|duration_time=0.023220|size=214|pos=10370|flags=K_ -packet|codec_type=audio|stream_index=0|pts=51200|pts_time=1.160998|dts=51200|dts_time=1.160998|duration=1024|duration_time=0.023220|size=194|pos=10584|flags=K_ -packet|codec_type=audio|stream_index=0|pts=52224|pts_time=1.184218|dts=52224|dts_time=1.184218|duration=1024|duration_time=0.023220|size=235|pos=10778|flags=K_ -packet|codec_type=audio|stream_index=0|pts=53248|pts_time=1.207438|dts=53248|dts_time=1.207438|duration=1024|duration_time=0.023220|size=195|pos=11013|flags=K_ -packet|codec_type=audio|stream_index=0|pts=54272|pts_time=1.230658|dts=54272|dts_time=1.230658|duration=1024|duration_time=0.023220|size=220|pos=11208|flags=K_ -packet|codec_type=audio|stream_index=0|pts=55296|pts_time=1.253878|dts=55296|dts_time=1.253878|duration=1024|duration_time=0.023220|size=187|pos=11428|flags=K_ -packet|codec_type=audio|stream_index=0|pts=56320|pts_time=1.277098|dts=56320|dts_time=1.277098|duration=1024|duration_time=0.023220|size=238|pos=11615|flags=K_ -packet|codec_type=audio|stream_index=0|pts=57344|pts_time=1.300317|dts=57344|dts_time=1.300317|duration=1024|duration_time=0.023220|size=175|pos=11853|flags=K_ -packet|codec_type=audio|stream_index=0|pts=58368|pts_time=1.323537|dts=58368|dts_time=1.323537|duration=1024|duration_time=0.023220|size=178|pos=12028|flags=K_ -packet|codec_type=audio|stream_index=0|pts=59392|pts_time=1.346757|dts=59392|dts_time=1.346757|duration=1024|duration_time=0.023220|size=219|pos=12206|flags=K_ -packet|codec_type=audio|stream_index=0|pts=60416|pts_time=1.369977|dts=60416|dts_time=1.369977|duration=1024|duration_time=0.023220|size=179|pos=12425|flags=K_ -packet|codec_type=audio|stream_index=0|pts=61440|pts_time=1.393197|dts=61440|dts_time=1.393197|duration=1024|duration_time=0.023220|size=193|pos=12604|flags=K_ -packet|codec_type=audio|stream_index=0|pts=62464|pts_time=1.416417|dts=62464|dts_time=1.416417|duration=1024|duration_time=0.023220|size=200|pos=12797|flags=K_ -packet|codec_type=audio|stream_index=0|pts=63488|pts_time=1.439637|dts=63488|dts_time=1.439637|duration=1024|duration_time=0.023220|size=218|pos=12997|flags=K_ -packet|codec_type=audio|stream_index=0|pts=64512|pts_time=1.462857|dts=64512|dts_time=1.462857|duration=1024|duration_time=0.023220|size=215|pos=13215|flags=K_ -packet|codec_type=audio|stream_index=0|pts=65536|pts_time=1.486077|dts=65536|dts_time=1.486077|duration=1024|duration_time=0.023220|size=209|pos=13430|flags=K_ -packet|codec_type=audio|stream_index=0|pts=66560|pts_time=1.509297|dts=66560|dts_time=1.509297|duration=1024|duration_time=0.023220|size=171|pos=13639|flags=K_ -packet|codec_type=audio|stream_index=0|pts=67584|pts_time=1.532517|dts=67584|dts_time=1.532517|duration=1024|duration_time=0.023220|size=179|pos=13810|flags=K_ -packet|codec_type=audio|stream_index=0|pts=68608|pts_time=1.555737|dts=68608|dts_time=1.555737|duration=1024|duration_time=0.023220|size=185|pos=13989|flags=K_ -packet|codec_type=audio|stream_index=0|pts=69632|pts_time=1.578957|dts=69632|dts_time=1.578957|duration=1024|duration_time=0.023220|size=225|pos=14174|flags=K_ -packet|codec_type=audio|stream_index=0|pts=70656|pts_time=1.602177|dts=70656|dts_time=1.602177|duration=1024|duration_time=0.023220|size=221|pos=14399|flags=K_ -packet|codec_type=audio|stream_index=0|pts=71680|pts_time=1.625397|dts=71680|dts_time=1.625397|duration=1024|duration_time=0.023220|size=201|pos=14620|flags=K_ -packet|codec_type=audio|stream_index=0|pts=72704|pts_time=1.648617|dts=72704|dts_time=1.648617|duration=1024|duration_time=0.023220|size=206|pos=14821|flags=K_ -packet|codec_type=audio|stream_index=0|pts=73728|pts_time=1.671837|dts=73728|dts_time=1.671837|duration=1024|duration_time=0.023220|size=182|pos=15027|flags=K_ -packet|codec_type=audio|stream_index=0|pts=74752|pts_time=1.695057|dts=74752|dts_time=1.695057|duration=1024|duration_time=0.023220|size=176|pos=15209|flags=K_ -packet|codec_type=audio|stream_index=0|pts=75776|pts_time=1.718277|dts=75776|dts_time=1.718277|duration=1024|duration_time=0.023220|size=233|pos=15385|flags=K_ -packet|codec_type=audio|stream_index=0|pts=76800|pts_time=1.741497|dts=76800|dts_time=1.741497|duration=1024|duration_time=0.023220|size=199|pos=15618|flags=K_ -packet|codec_type=audio|stream_index=0|pts=77824|pts_time=1.764717|dts=77824|dts_time=1.764717|duration=1024|duration_time=0.023220|size=220|pos=15817|flags=K_ -packet|codec_type=audio|stream_index=0|pts=78848|pts_time=1.787937|dts=78848|dts_time=1.787937|duration=1024|duration_time=0.023220|size=190|pos=16037|flags=K_ -packet|codec_type=audio|stream_index=0|pts=79872|pts_time=1.811156|dts=79872|dts_time=1.811156|duration=1024|duration_time=0.023220|size=210|pos=16227|flags=K_ -packet|codec_type=audio|stream_index=0|pts=80896|pts_time=1.834376|dts=80896|dts_time=1.834376|duration=1024|duration_time=0.023220|size=204|pos=16437|flags=K_ -packet|codec_type=audio|stream_index=0|pts=81920|pts_time=1.857596|dts=81920|dts_time=1.857596|duration=1024|duration_time=0.023220|size=171|pos=16641|flags=K_ -packet|codec_type=audio|stream_index=0|pts=82944|pts_time=1.880816|dts=82944|dts_time=1.880816|duration=1024|duration_time=0.023220|size=167|pos=16812|flags=K_ -packet|codec_type=audio|stream_index=0|pts=83968|pts_time=1.904036|dts=83968|dts_time=1.904036|duration=1024|duration_time=0.023220|size=200|pos=16979|flags=K_ -packet|codec_type=audio|stream_index=0|pts=84992|pts_time=1.927256|dts=84992|dts_time=1.927256|duration=1024|duration_time=0.023220|size=254|pos=17179|flags=K_ -packet|codec_type=audio|stream_index=0|pts=86016|pts_time=1.950476|dts=86016|dts_time=1.950476|duration=1024|duration_time=0.023220|size=205|pos=17433|flags=K_ -packet|codec_type=audio|stream_index=0|pts=87040|pts_time=1.973696|dts=87040|dts_time=1.973696|duration=1024|duration_time=0.023220|size=196|pos=17638|flags=K_ -packet|codec_type=audio|stream_index=0|pts=88064|pts_time=1.996916|dts=88064|dts_time=1.996916|duration=1024|duration_time=0.023220|size=190|pos=17834|flags=K_ -packet|codec_type=audio|stream_index=0|pts=89088|pts_time=2.020136|dts=89088|dts_time=2.020136|duration=1024|duration_time=0.023220|size=197|pos=18024|flags=K_ -packet|codec_type=audio|stream_index=0|pts=90112|pts_time=2.043356|dts=90112|dts_time=2.043356|duration=1024|duration_time=0.023220|size=186|pos=18221|flags=K_ -packet|codec_type=audio|stream_index=0|pts=91136|pts_time=2.066576|dts=91136|dts_time=2.066576|duration=1024|duration_time=0.023220|size=194|pos=18407|flags=K_ -packet|codec_type=audio|stream_index=0|pts=92160|pts_time=2.089796|dts=92160|dts_time=2.089796|duration=1024|duration_time=0.023220|size=227|pos=18601|flags=K_ -packet|codec_type=audio|stream_index=0|pts=93184|pts_time=2.113016|dts=93184|dts_time=2.113016|duration=1024|duration_time=0.023220|size=195|pos=18828|flags=K_ -packet|codec_type=audio|stream_index=0|pts=94208|pts_time=2.136236|dts=94208|dts_time=2.136236|duration=1024|duration_time=0.023220|size=228|pos=19023|flags=K_ -packet|codec_type=audio|stream_index=0|pts=95232|pts_time=2.159456|dts=95232|dts_time=2.159456|duration=1024|duration_time=0.023220|size=196|pos=19251|flags=K_ -packet|codec_type=audio|stream_index=0|pts=96256|pts_time=2.182676|dts=96256|dts_time=2.182676|duration=1024|duration_time=0.023220|size=197|pos=19447|flags=K_ -packet|codec_type=audio|stream_index=0|pts=97280|pts_time=2.205896|dts=97280|dts_time=2.205896|duration=1024|duration_time=0.023220|size=186|pos=19644|flags=K_ -packet|codec_type=audio|stream_index=0|pts=98304|pts_time=2.229116|dts=98304|dts_time=2.229116|duration=1024|duration_time=0.023220|size=191|pos=19830|flags=K_ -packet|codec_type=audio|stream_index=0|pts=99328|pts_time=2.252336|dts=99328|dts_time=2.252336|duration=1024|duration_time=0.023220|size=215|pos=20021|flags=K_ -packet|codec_type=audio|stream_index=0|pts=100352|pts_time=2.275556|dts=100352|dts_time=2.275556|duration=1024|duration_time=0.023220|size=203|pos=20236|flags=K_ -packet|codec_type=audio|stream_index=0|pts=101376|pts_time=2.298776|dts=101376|dts_time=2.298776|duration=1024|duration_time=0.023220|size=205|pos=20439|flags=K_ -packet|codec_type=audio|stream_index=0|pts=102400|pts_time=2.321995|dts=102400|dts_time=2.321995|duration=1024|duration_time=0.023220|size=205|pos=20644|flags=K_ -packet|codec_type=audio|stream_index=0|pts=103424|pts_time=2.345215|dts=103424|dts_time=2.345215|duration=1024|duration_time=0.023220|size=213|pos=20849|flags=K_ -packet|codec_type=audio|stream_index=0|pts=104448|pts_time=2.368435|dts=104448|dts_time=2.368435|duration=1024|duration_time=0.023220|size=198|pos=21062|flags=K_ -packet|codec_type=audio|stream_index=0|pts=105472|pts_time=2.391655|dts=105472|dts_time=2.391655|duration=1024|duration_time=0.023220|size=178|pos=21260|flags=K_ -packet|codec_type=audio|stream_index=0|pts=106496|pts_time=2.414875|dts=106496|dts_time=2.414875|duration=1024|duration_time=0.023220|size=195|pos=21438|flags=K_ -packet|codec_type=audio|stream_index=0|pts=107520|pts_time=2.438095|dts=107520|dts_time=2.438095|duration=1024|duration_time=0.023220|size=227|pos=21633|flags=K_ -packet|codec_type=audio|stream_index=0|pts=108544|pts_time=2.461315|dts=108544|dts_time=2.461315|duration=1024|duration_time=0.023220|size=185|pos=21860|flags=K_ -packet|codec_type=audio|stream_index=0|pts=109568|pts_time=2.484535|dts=109568|dts_time=2.484535|duration=1024|duration_time=0.023220|size=206|pos=22045|flags=K_ -packet|codec_type=audio|stream_index=0|pts=110592|pts_time=2.507755|dts=110592|dts_time=2.507755|duration=1024|duration_time=0.023220|size=183|pos=22251|flags=K_ -packet|codec_type=audio|stream_index=0|pts=111616|pts_time=2.530975|dts=111616|dts_time=2.530975|duration=1024|duration_time=0.023220|size=208|pos=22434|flags=K_ -packet|codec_type=audio|stream_index=0|pts=112640|pts_time=2.554195|dts=112640|dts_time=2.554195|duration=1024|duration_time=0.023220|size=204|pos=22642|flags=K_ -packet|codec_type=audio|stream_index=0|pts=113664|pts_time=2.577415|dts=113664|dts_time=2.577415|duration=1024|duration_time=0.023220|size=192|pos=22846|flags=K_ -packet|codec_type=audio|stream_index=0|pts=114688|pts_time=2.600635|dts=114688|dts_time=2.600635|duration=1024|duration_time=0.023220|size=190|pos=23038|flags=K_ -packet|codec_type=audio|stream_index=0|pts=115712|pts_time=2.623855|dts=115712|dts_time=2.623855|duration=1024|duration_time=0.023220|size=199|pos=23228|flags=K_ -packet|codec_type=audio|stream_index=0|pts=116736|pts_time=2.647075|dts=116736|dts_time=2.647075|duration=1024|duration_time=0.023220|size=229|pos=23427|flags=K_ -packet|codec_type=audio|stream_index=0|pts=117760|pts_time=2.670295|dts=117760|dts_time=2.670295|duration=1024|duration_time=0.023220|size=208|pos=23656|flags=K_ -packet|codec_type=audio|stream_index=0|pts=118784|pts_time=2.693515|dts=118784|dts_time=2.693515|duration=1024|duration_time=0.023220|size=195|pos=23864|flags=K_ -packet|codec_type=audio|stream_index=0|pts=119808|pts_time=2.716735|dts=119808|dts_time=2.716735|duration=1024|duration_time=0.023220|size=190|pos=24059|flags=K_ -packet|codec_type=audio|stream_index=0|pts=120832|pts_time=2.739955|dts=120832|dts_time=2.739955|duration=1024|duration_time=0.023220|size=190|pos=24249|flags=K_ -packet|codec_type=audio|stream_index=0|pts=121856|pts_time=2.763175|dts=121856|dts_time=2.763175|duration=1024|duration_time=0.023220|size=192|pos=24439|flags=K_ -packet|codec_type=audio|stream_index=0|pts=122880|pts_time=2.786395|dts=122880|dts_time=2.786395|duration=1024|duration_time=0.023220|size=226|pos=24631|flags=K_ -packet|codec_type=audio|stream_index=0|pts=123904|pts_time=2.809615|dts=123904|dts_time=2.809615|duration=1024|duration_time=0.023220|size=195|pos=24857|flags=K_ -packet|codec_type=audio|stream_index=0|pts=124928|pts_time=2.832834|dts=124928|dts_time=2.832834|duration=1024|duration_time=0.023220|size=230|pos=25052|flags=K_ -packet|codec_type=audio|stream_index=0|pts=125952|pts_time=2.856054|dts=125952|dts_time=2.856054|duration=1024|duration_time=0.023220|size=198|pos=25282|flags=K_ -packet|codec_type=audio|stream_index=0|pts=126976|pts_time=2.879274|dts=126976|dts_time=2.879274|duration=1024|duration_time=0.023220|size=183|pos=25480|flags=K_ -packet|codec_type=audio|stream_index=0|pts=128000|pts_time=2.902494|dts=128000|dts_time=2.902494|duration=1024|duration_time=0.023220|size=199|pos=25663|flags=K_ -packet|codec_type=audio|stream_index=0|pts=129024|pts_time=2.925714|dts=129024|dts_time=2.925714|duration=1024|duration_time=0.023220|size=196|pos=25862|flags=K_ -packet|codec_type=audio|stream_index=0|pts=130048|pts_time=2.948934|dts=130048|dts_time=2.948934|duration=1024|duration_time=0.023220|size=186|pos=26058|flags=K_ -packet|codec_type=audio|stream_index=0|pts=131072|pts_time=2.972154|dts=131072|dts_time=2.972154|duration=1024|duration_time=0.023220|size=200|pos=26244|flags=K_ -packet|codec_type=audio|stream_index=0|pts=132096|pts_time=2.995374|dts=132096|dts_time=2.995374|duration=1024|duration_time=0.023220|size=210|pos=26444|flags=K_ -packet|codec_type=audio|stream_index=0|pts=133120|pts_time=3.018594|dts=133120|dts_time=3.018594|duration=1024|duration_time=0.023220|size=196|pos=26654|flags=K_ -packet|codec_type=audio|stream_index=0|pts=134144|pts_time=3.041814|dts=134144|dts_time=3.041814|duration=1024|duration_time=0.023220|size=214|pos=26850|flags=K_ -packet|codec_type=audio|stream_index=0|pts=135168|pts_time=3.065034|dts=135168|dts_time=3.065034|duration=1024|duration_time=0.023220|size=185|pos=27064|flags=K_ -packet|codec_type=audio|stream_index=0|pts=136192|pts_time=3.088254|dts=136192|dts_time=3.088254|duration=1024|duration_time=0.023220|size=198|pos=27249|flags=K_ -packet|codec_type=audio|stream_index=0|pts=137216|pts_time=3.111474|dts=137216|dts_time=3.111474|duration=1024|duration_time=0.023220|size=200|pos=27447|flags=K_ -packet|codec_type=audio|stream_index=0|pts=138240|pts_time=3.134694|dts=138240|dts_time=3.134694|duration=1024|duration_time=0.023220|size=208|pos=27647|flags=K_ -packet|codec_type=audio|stream_index=0|pts=139264|pts_time=3.157914|dts=139264|dts_time=3.157914|duration=1024|duration_time=0.023220|size=212|pos=27855|flags=K_ -packet|codec_type=audio|stream_index=0|pts=140288|pts_time=3.181134|dts=140288|dts_time=3.181134|duration=1024|duration_time=0.023220|size=208|pos=28067|flags=K_ -packet|codec_type=audio|stream_index=0|pts=141312|pts_time=3.204354|dts=141312|dts_time=3.204354|duration=1024|duration_time=0.023220|size=192|pos=28275|flags=K_ -packet|codec_type=audio|stream_index=0|pts=142336|pts_time=3.227574|dts=142336|dts_time=3.227574|duration=1024|duration_time=0.023220|size=192|pos=28467|flags=K_ -packet|codec_type=audio|stream_index=0|pts=143360|pts_time=3.250794|dts=143360|dts_time=3.250794|duration=1024|duration_time=0.023220|size=211|pos=28659|flags=K_ -packet|codec_type=audio|stream_index=0|pts=144384|pts_time=3.274014|dts=144384|dts_time=3.274014|duration=1024|duration_time=0.023220|size=195|pos=28870|flags=K_ -packet|codec_type=audio|stream_index=0|pts=145408|pts_time=3.297234|dts=145408|dts_time=3.297234|duration=1024|duration_time=0.023220|size=208|pos=29065|flags=K_ -packet|codec_type=audio|stream_index=0|pts=146432|pts_time=3.320454|dts=146432|dts_time=3.320454|duration=1024|duration_time=0.023220|size=195|pos=29273|flags=K_ -packet|codec_type=audio|stream_index=0|pts=147456|pts_time=3.343673|dts=147456|dts_time=3.343673|duration=1024|duration_time=0.023220|size=204|pos=29468|flags=K_ -packet|codec_type=audio|stream_index=0|pts=148480|pts_time=3.366893|dts=148480|dts_time=3.366893|duration=1024|duration_time=0.023220|size=209|pos=29672|flags=K_ -packet|codec_type=audio|stream_index=0|pts=149504|pts_time=3.390113|dts=149504|dts_time=3.390113|duration=1024|duration_time=0.023220|size=195|pos=29881|flags=K_ -packet|codec_type=audio|stream_index=0|pts=150528|pts_time=3.413333|dts=150528|dts_time=3.413333|duration=1024|duration_time=0.023220|size=191|pos=30076|flags=K_ -packet|codec_type=audio|stream_index=0|pts=151552|pts_time=3.436553|dts=151552|dts_time=3.436553|duration=1024|duration_time=0.023220|size=210|pos=30267|flags=K_ -packet|codec_type=audio|stream_index=0|pts=152576|pts_time=3.459773|dts=152576|dts_time=3.459773|duration=1024|duration_time=0.023220|size=209|pos=30477|flags=K_ -packet|codec_type=audio|stream_index=0|pts=153600|pts_time=3.482993|dts=153600|dts_time=3.482993|duration=1024|duration_time=0.023220|size=175|pos=30686|flags=K_ -packet|codec_type=audio|stream_index=0|pts=154624|pts_time=3.506213|dts=154624|dts_time=3.506213|duration=1024|duration_time=0.023220|size=244|pos=30861|flags=K_ -packet|codec_type=audio|stream_index=0|pts=155648|pts_time=3.529433|dts=155648|dts_time=3.529433|duration=1024|duration_time=0.023220|size=177|pos=31105|flags=K_ -packet|codec_type=audio|stream_index=0|pts=156672|pts_time=3.552653|dts=156672|dts_time=3.552653|duration=1024|duration_time=0.023220|size=217|pos=31282|flags=K_ -packet|codec_type=audio|stream_index=0|pts=157696|pts_time=3.575873|dts=157696|dts_time=3.575873|duration=1024|duration_time=0.023220|size=182|pos=31499|flags=K_ -packet|codec_type=audio|stream_index=0|pts=158720|pts_time=3.599093|dts=158720|dts_time=3.599093|duration=1024|duration_time=0.023220|size=181|pos=31681|flags=K_ -packet|codec_type=audio|stream_index=0|pts=159744|pts_time=3.622313|dts=159744|dts_time=3.622313|duration=1024|duration_time=0.023220|size=203|pos=31862|flags=K_ -packet|codec_type=audio|stream_index=0|pts=160768|pts_time=3.645533|dts=160768|dts_time=3.645533|duration=1024|duration_time=0.023220|size=198|pos=32065|flags=K_ -packet|codec_type=audio|stream_index=0|pts=161792|pts_time=3.668753|dts=161792|dts_time=3.668753|duration=1024|duration_time=0.023220|size=217|pos=32263|flags=K_ -packet|codec_type=audio|stream_index=0|pts=162816|pts_time=3.691973|dts=162816|dts_time=3.691973|duration=1024|duration_time=0.023220|size=195|pos=32480|flags=K_ -packet|codec_type=audio|stream_index=0|pts=163840|pts_time=3.715193|dts=163840|dts_time=3.715193|duration=1024|duration_time=0.023220|size=198|pos=32675|flags=K_ -packet|codec_type=audio|stream_index=0|pts=164864|pts_time=3.738413|dts=164864|dts_time=3.738413|duration=1024|duration_time=0.023220|size=202|pos=32873|flags=K_ -packet|codec_type=audio|stream_index=0|pts=165888|pts_time=3.761633|dts=165888|dts_time=3.761633|duration=1024|duration_time=0.023220|size=185|pos=33075|flags=K_ -packet|codec_type=audio|stream_index=0|pts=166912|pts_time=3.784853|dts=166912|dts_time=3.784853|duration=1024|duration_time=0.023220|size=196|pos=33260|flags=K_ -packet|codec_type=audio|stream_index=0|pts=167936|pts_time=3.808073|dts=167936|dts_time=3.808073|duration=1024|duration_time=0.023220|size=226|pos=33456|flags=K_ -packet|codec_type=audio|stream_index=0|pts=168960|pts_time=3.831293|dts=168960|dts_time=3.831293|duration=1024|duration_time=0.023220|size=187|pos=33682|flags=K_ -packet|codec_type=audio|stream_index=0|pts=169984|pts_time=3.854512|dts=169984|dts_time=3.854512|duration=1024|duration_time=0.023220|size=193|pos=33869|flags=K_ -packet|codec_type=audio|stream_index=0|pts=171008|pts_time=3.877732|dts=171008|dts_time=3.877732|duration=1024|duration_time=0.023220|size=218|pos=34062|flags=K_ -packet|codec_type=audio|stream_index=0|pts=172032|pts_time=3.900952|dts=172032|dts_time=3.900952|duration=1024|duration_time=0.023220|size=200|pos=34280|flags=K_ -packet|codec_type=audio|stream_index=0|pts=173056|pts_time=3.924172|dts=173056|dts_time=3.924172|duration=1024|duration_time=0.023220|size=200|pos=34480|flags=K_ -packet|codec_type=audio|stream_index=0|pts=174080|pts_time=3.947392|dts=174080|dts_time=3.947392|duration=1024|duration_time=0.023220|size=198|pos=34680|flags=K_ -packet|codec_type=audio|stream_index=0|pts=175104|pts_time=3.970612|dts=175104|dts_time=3.970612|duration=1024|duration_time=0.023220|size=200|pos=34878|flags=K_ -packet|codec_type=audio|stream_index=0|pts=176128|pts_time=3.993832|dts=176128|dts_time=3.993832|duration=1024|duration_time=0.023220|size=197|pos=35078|flags=K_ -packet|codec_type=audio|stream_index=0|pts=177152|pts_time=4.017052|dts=177152|dts_time=4.017052|duration=1024|duration_time=0.023220|size=209|pos=35275|flags=K_ -packet|codec_type=audio|stream_index=0|pts=178176|pts_time=4.040272|dts=178176|dts_time=4.040272|duration=1024|duration_time=0.023220|size=205|pos=35484|flags=K_ -packet|codec_type=audio|stream_index=0|pts=179200|pts_time=4.063492|dts=179200|dts_time=4.063492|duration=1024|duration_time=0.023220|size=199|pos=35689|flags=K_ -packet|codec_type=audio|stream_index=0|pts=180224|pts_time=4.086712|dts=180224|dts_time=4.086712|duration=1024|duration_time=0.023220|size=192|pos=35888|flags=K_ -packet|codec_type=audio|stream_index=0|pts=181248|pts_time=4.109932|dts=181248|dts_time=4.109932|duration=1024|duration_time=0.023220|size=201|pos=36080|flags=K_ -packet|codec_type=audio|stream_index=0|pts=182272|pts_time=4.133152|dts=182272|dts_time=4.133152|duration=1024|duration_time=0.023220|size=200|pos=36281|flags=K_ -packet|codec_type=audio|stream_index=0|pts=183296|pts_time=4.156372|dts=183296|dts_time=4.156372|duration=1024|duration_time=0.023220|size=202|pos=36481|flags=K_ -packet|codec_type=audio|stream_index=0|pts=184320|pts_time=4.179592|dts=184320|dts_time=4.179592|duration=1024|duration_time=0.023220|size=196|pos=36683|flags=K_ -packet|codec_type=audio|stream_index=0|pts=185344|pts_time=4.202812|dts=185344|dts_time=4.202812|duration=1024|duration_time=0.023220|size=200|pos=36879|flags=K_ -packet|codec_type=audio|stream_index=0|pts=186368|pts_time=4.226032|dts=186368|dts_time=4.226032|duration=1024|duration_time=0.023220|size=209|pos=37079|flags=K_ -packet|codec_type=audio|stream_index=0|pts=187392|pts_time=4.249252|dts=187392|dts_time=4.249252|duration=1024|duration_time=0.023220|size=201|pos=37288|flags=K_ -packet|codec_type=audio|stream_index=0|pts=188416|pts_time=4.272472|dts=188416|dts_time=4.272472|duration=1024|duration_time=0.023220|size=201|pos=37489|flags=K_ -packet|codec_type=audio|stream_index=0|pts=189440|pts_time=4.295692|dts=189440|dts_time=4.295692|duration=1024|duration_time=0.023220|size=201|pos=37690|flags=K_ -packet|codec_type=audio|stream_index=0|pts=190464|pts_time=4.318912|dts=190464|dts_time=4.318912|duration=1024|duration_time=0.023220|size=199|pos=37891|flags=K_ -packet|codec_type=audio|stream_index=0|pts=191488|pts_time=4.342132|dts=191488|dts_time=4.342132|duration=1024|duration_time=0.023220|size=198|pos=38090|flags=K_ -packet|codec_type=audio|stream_index=0|pts=192512|pts_time=4.365351|dts=192512|dts_time=4.365351|duration=1024|duration_time=0.023220|size=205|pos=38288|flags=K_ -packet|codec_type=audio|stream_index=0|pts=193536|pts_time=4.388571|dts=193536|dts_time=4.388571|duration=1024|duration_time=0.023220|size=190|pos=38493|flags=K_ -packet|codec_type=audio|stream_index=0|pts=194560|pts_time=4.411791|dts=194560|dts_time=4.411791|duration=1024|duration_time=0.023220|size=207|pos=38683|flags=K_ -packet|codec_type=audio|stream_index=0|pts=195584|pts_time=4.435011|dts=195584|dts_time=4.435011|duration=1024|duration_time=0.023220|size=204|pos=38890|flags=K_ -packet|codec_type=audio|stream_index=0|pts=196608|pts_time=4.458231|dts=196608|dts_time=4.458231|duration=1024|duration_time=0.023220|size=192|pos=39094|flags=K_ -packet|codec_type=audio|stream_index=0|pts=197632|pts_time=4.481451|dts=197632|dts_time=4.481451|duration=1024|duration_time=0.023220|size=211|pos=39286|flags=K_ -packet|codec_type=audio|stream_index=0|pts=198656|pts_time=4.504671|dts=198656|dts_time=4.504671|duration=1024|duration_time=0.023220|size=195|pos=39497|flags=K_ -packet|codec_type=audio|stream_index=0|pts=199680|pts_time=4.527891|dts=199680|dts_time=4.527891|duration=1024|duration_time=0.023220|size=214|pos=39692|flags=K_ -packet|codec_type=audio|stream_index=0|pts=200704|pts_time=4.551111|dts=200704|dts_time=4.551111|duration=1024|duration_time=0.023220|size=195|pos=39906|flags=K_ -packet|codec_type=audio|stream_index=0|pts=201728|pts_time=4.574331|dts=201728|dts_time=4.574331|duration=1024|duration_time=0.023220|size=199|pos=40101|flags=K_ -packet|codec_type=audio|stream_index=0|pts=202752|pts_time=4.597551|dts=202752|dts_time=4.597551|duration=1024|duration_time=0.023220|size=183|pos=40300|flags=K_ -packet|codec_type=audio|stream_index=0|pts=203776|pts_time=4.620771|dts=203776|dts_time=4.620771|duration=1024|duration_time=0.023220|size=211|pos=40483|flags=K_ -packet|codec_type=audio|stream_index=0|pts=204800|pts_time=4.643991|dts=204800|dts_time=4.643991|duration=1024|duration_time=0.023220|size=200|pos=40694|flags=K_ -packet|codec_type=audio|stream_index=0|pts=205824|pts_time=4.667211|dts=205824|dts_time=4.667211|duration=1024|duration_time=0.023220|size=199|pos=40894|flags=K_ -packet|codec_type=audio|stream_index=0|pts=206848|pts_time=4.690431|dts=206848|dts_time=4.690431|duration=1024|duration_time=0.023220|size=213|pos=41093|flags=K_ -packet|codec_type=audio|stream_index=0|pts=207872|pts_time=4.713651|dts=207872|dts_time=4.713651|duration=1024|duration_time=0.023220|size=191|pos=41306|flags=K_ -packet|codec_type=audio|stream_index=0|pts=208896|pts_time=4.736871|dts=208896|dts_time=4.736871|duration=1024|duration_time=0.023220|size=211|pos=41497|flags=K_ -packet|codec_type=audio|stream_index=0|pts=209920|pts_time=4.760091|dts=209920|dts_time=4.760091|duration=1024|duration_time=0.023220|size=198|pos=41708|flags=K_ -packet|codec_type=audio|stream_index=0|pts=210944|pts_time=4.783311|dts=210944|dts_time=4.783311|duration=1024|duration_time=0.023220|size=203|pos=41906|flags=K_ -packet|codec_type=audio|stream_index=0|pts=211968|pts_time=4.806531|dts=211968|dts_time=4.806531|duration=1024|duration_time=0.023220|size=196|pos=42109|flags=K_ -packet|codec_type=audio|stream_index=0|pts=212992|pts_time=4.829751|dts=212992|dts_time=4.829751|duration=1024|duration_time=0.023220|size=197|pos=42305|flags=K_ -packet|codec_type=audio|stream_index=0|pts=214016|pts_time=4.852971|dts=214016|dts_time=4.852971|duration=1024|duration_time=0.023220|size=190|pos=42502|flags=K_ -packet|codec_type=audio|stream_index=0|pts=215040|pts_time=4.876190|dts=215040|dts_time=4.876190|duration=1024|duration_time=0.023220|size=208|pos=42692|flags=K_ -packet|codec_type=audio|stream_index=0|pts=216064|pts_time=4.899410|dts=216064|dts_time=4.899410|duration=1024|duration_time=0.023220|size=203|pos=42900|flags=K_ -packet|codec_type=audio|stream_index=0|pts=217088|pts_time=4.922630|dts=217088|dts_time=4.922630|duration=1024|duration_time=0.023220|size=198|pos=43103|flags=K_ -packet|codec_type=audio|stream_index=0|pts=218112|pts_time=4.945850|dts=218112|dts_time=4.945850|duration=1024|duration_time=0.023220|size=284|pos=43301|flags=K_ -packet|codec_type=audio|stream_index=0|pts=219136|pts_time=4.969070|dts=219136|dts_time=4.969070|duration=1364|duration_time=0.030930|size=5|pos=43585|flags=K_ +packet|codec_type=audio|stream_index=0|pts=-1024|pts_time=-0.023220|dts=-1024|dts_time=-0.023220|duration=1024|duration_time=0.023220|size=258|pos=294|flags=KD_ +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|size=146|pos=552|flags=K__ +packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|size=186|pos=698|flags=K__ +packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|size=222|pos=884|flags=K__ +packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|size=186|pos=1106|flags=K__ +packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|size=206|pos=1292|flags=K__ +packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=1024|duration_time=0.023220|size=199|pos=1498|flags=K__ +packet|codec_type=audio|stream_index=0|pts=6144|pts_time=0.139320|dts=6144|dts_time=0.139320|duration=1024|duration_time=0.023220|size=236|pos=1697|flags=K__ +packet|codec_type=audio|stream_index=0|pts=7168|pts_time=0.162540|dts=7168|dts_time=0.162540|duration=1024|duration_time=0.023220|size=208|pos=1933|flags=K__ +packet|codec_type=audio|stream_index=0|pts=8192|pts_time=0.185760|dts=8192|dts_time=0.185760|duration=1024|duration_time=0.023220|size=238|pos=2141|flags=K__ +packet|codec_type=audio|stream_index=0|pts=9216|pts_time=0.208980|dts=9216|dts_time=0.208980|duration=1024|duration_time=0.023220|size=222|pos=2379|flags=K__ +packet|codec_type=audio|stream_index=0|pts=10240|pts_time=0.232200|dts=10240|dts_time=0.232200|duration=1024|duration_time=0.023220|size=211|pos=2601|flags=K__ +packet|codec_type=audio|stream_index=0|pts=11264|pts_time=0.255420|dts=11264|dts_time=0.255420|duration=1024|duration_time=0.023220|size=153|pos=2812|flags=K__ +packet|codec_type=audio|stream_index=0|pts=12288|pts_time=0.278639|dts=12288|dts_time=0.278639|duration=1024|duration_time=0.023220|size=191|pos=2965|flags=K__ +packet|codec_type=audio|stream_index=0|pts=13312|pts_time=0.301859|dts=13312|dts_time=0.301859|duration=1024|duration_time=0.023220|size=208|pos=3156|flags=K__ +packet|codec_type=audio|stream_index=0|pts=14336|pts_time=0.325079|dts=14336|dts_time=0.325079|duration=1024|duration_time=0.023220|size=188|pos=3364|flags=K__ +packet|codec_type=audio|stream_index=0|pts=15360|pts_time=0.348299|dts=15360|dts_time=0.348299|duration=1024|duration_time=0.023220|size=170|pos=3552|flags=K__ +packet|codec_type=audio|stream_index=0|pts=16384|pts_time=0.371519|dts=16384|dts_time=0.371519|duration=1024|duration_time=0.023220|size=221|pos=3722|flags=K__ +packet|codec_type=audio|stream_index=0|pts=17408|pts_time=0.394739|dts=17408|dts_time=0.394739|duration=1024|duration_time=0.023220|size=247|pos=3943|flags=K__ +packet|codec_type=audio|stream_index=0|pts=18432|pts_time=0.417959|dts=18432|dts_time=0.417959|duration=1024|duration_time=0.023220|size=202|pos=4190|flags=K__ +packet|codec_type=audio|stream_index=0|pts=19456|pts_time=0.441179|dts=19456|dts_time=0.441179|duration=1024|duration_time=0.023220|size=186|pos=4392|flags=K__ +packet|codec_type=audio|stream_index=0|pts=20480|pts_time=0.464399|dts=20480|dts_time=0.464399|duration=1024|duration_time=0.023220|size=196|pos=4578|flags=K__ +packet|codec_type=audio|stream_index=0|pts=21504|pts_time=0.487619|dts=21504|dts_time=0.487619|duration=1024|duration_time=0.023220|size=200|pos=4774|flags=K__ +packet|codec_type=audio|stream_index=0|pts=22528|pts_time=0.510839|dts=22528|dts_time=0.510839|duration=1024|duration_time=0.023220|size=170|pos=4974|flags=K__ +packet|codec_type=audio|stream_index=0|pts=23552|pts_time=0.534059|dts=23552|dts_time=0.534059|duration=1024|duration_time=0.023220|size=172|pos=5144|flags=K__ +packet|codec_type=audio|stream_index=0|pts=24576|pts_time=0.557279|dts=24576|dts_time=0.557279|duration=1024|duration_time=0.023220|size=206|pos=5316|flags=K__ +packet|codec_type=audio|stream_index=0|pts=25600|pts_time=0.580499|dts=25600|dts_time=0.580499|duration=1024|duration_time=0.023220|size=208|pos=5522|flags=K__ +packet|codec_type=audio|stream_index=0|pts=26624|pts_time=0.603719|dts=26624|dts_time=0.603719|duration=1024|duration_time=0.023220|size=217|pos=5730|flags=K__ +packet|codec_type=audio|stream_index=0|pts=27648|pts_time=0.626939|dts=27648|dts_time=0.626939|duration=1024|duration_time=0.023220|size=252|pos=5947|flags=K__ +packet|codec_type=audio|stream_index=0|pts=28672|pts_time=0.650159|dts=28672|dts_time=0.650159|duration=1024|duration_time=0.023220|size=171|pos=6199|flags=K__ +packet|codec_type=audio|stream_index=0|pts=29696|pts_time=0.673379|dts=29696|dts_time=0.673379|duration=1024|duration_time=0.023220|size=206|pos=6370|flags=K__ +packet|codec_type=audio|stream_index=0|pts=30720|pts_time=0.696599|dts=30720|dts_time=0.696599|duration=1024|duration_time=0.023220|size=237|pos=6576|flags=K__ +packet|codec_type=audio|stream_index=0|pts=31744|pts_time=0.719819|dts=31744|dts_time=0.719819|duration=1024|duration_time=0.023220|size=210|pos=6813|flags=K__ +packet|codec_type=audio|stream_index=0|pts=32768|pts_time=0.743039|dts=32768|dts_time=0.743039|duration=1024|duration_time=0.023220|size=166|pos=7023|flags=K__ +packet|codec_type=audio|stream_index=0|pts=33792|pts_time=0.766259|dts=33792|dts_time=0.766259|duration=1024|duration_time=0.023220|size=166|pos=7189|flags=K__ +packet|codec_type=audio|stream_index=0|pts=34816|pts_time=0.789478|dts=34816|dts_time=0.789478|duration=1024|duration_time=0.023220|size=177|pos=7355|flags=K__ +packet|codec_type=audio|stream_index=0|pts=35840|pts_time=0.812698|dts=35840|dts_time=0.812698|duration=1024|duration_time=0.023220|size=188|pos=7532|flags=K__ +packet|codec_type=audio|stream_index=0|pts=36864|pts_time=0.835918|dts=36864|dts_time=0.835918|duration=1024|duration_time=0.023220|size=193|pos=7720|flags=K__ +packet|codec_type=audio|stream_index=0|pts=37888|pts_time=0.859138|dts=37888|dts_time=0.859138|duration=1024|duration_time=0.023220|size=195|pos=7913|flags=K__ +packet|codec_type=audio|stream_index=0|pts=38912|pts_time=0.882358|dts=38912|dts_time=0.882358|duration=1024|duration_time=0.023220|size=211|pos=8108|flags=K__ +packet|codec_type=audio|stream_index=0|pts=39936|pts_time=0.905578|dts=39936|dts_time=0.905578|duration=1024|duration_time=0.023220|size=249|pos=8319|flags=K__ +packet|codec_type=audio|stream_index=0|pts=40960|pts_time=0.928798|dts=40960|dts_time=0.928798|duration=1024|duration_time=0.023220|size=223|pos=8568|flags=K__ +packet|codec_type=audio|stream_index=0|pts=41984|pts_time=0.952018|dts=41984|dts_time=0.952018|duration=1024|duration_time=0.023220|size=230|pos=8791|flags=K__ +packet|codec_type=audio|stream_index=0|pts=43008|pts_time=0.975238|dts=43008|dts_time=0.975238|duration=1024|duration_time=0.023220|size=203|pos=9021|flags=K__ +packet|codec_type=audio|stream_index=0|pts=44032|pts_time=0.998458|dts=44032|dts_time=0.998458|duration=1024|duration_time=0.023220|size=180|pos=9224|flags=K__ +packet|codec_type=audio|stream_index=0|pts=45056|pts_time=1.021678|dts=45056|dts_time=1.021678|duration=1024|duration_time=0.023220|size=172|pos=9404|flags=K__ +packet|codec_type=audio|stream_index=0|pts=46080|pts_time=1.044898|dts=46080|dts_time=1.044898|duration=1024|duration_time=0.023220|size=240|pos=9576|flags=K__ +packet|codec_type=audio|stream_index=0|pts=47104|pts_time=1.068118|dts=47104|dts_time=1.068118|duration=1024|duration_time=0.023220|size=179|pos=9816|flags=K__ +packet|codec_type=audio|stream_index=0|pts=48128|pts_time=1.091338|dts=48128|dts_time=1.091338|duration=1024|duration_time=0.023220|size=191|pos=9995|flags=K__ +packet|codec_type=audio|stream_index=0|pts=49152|pts_time=1.114558|dts=49152|dts_time=1.114558|duration=1024|duration_time=0.023220|size=184|pos=10186|flags=K__ +packet|codec_type=audio|stream_index=0|pts=50176|pts_time=1.137778|dts=50176|dts_time=1.137778|duration=1024|duration_time=0.023220|size=214|pos=10370|flags=K__ +packet|codec_type=audio|stream_index=0|pts=51200|pts_time=1.160998|dts=51200|dts_time=1.160998|duration=1024|duration_time=0.023220|size=194|pos=10584|flags=K__ +packet|codec_type=audio|stream_index=0|pts=52224|pts_time=1.184218|dts=52224|dts_time=1.184218|duration=1024|duration_time=0.023220|size=235|pos=10778|flags=K__ +packet|codec_type=audio|stream_index=0|pts=53248|pts_time=1.207438|dts=53248|dts_time=1.207438|duration=1024|duration_time=0.023220|size=195|pos=11013|flags=K__ +packet|codec_type=audio|stream_index=0|pts=54272|pts_time=1.230658|dts=54272|dts_time=1.230658|duration=1024|duration_time=0.023220|size=220|pos=11208|flags=K__ +packet|codec_type=audio|stream_index=0|pts=55296|pts_time=1.253878|dts=55296|dts_time=1.253878|duration=1024|duration_time=0.023220|size=187|pos=11428|flags=K__ +packet|codec_type=audio|stream_index=0|pts=56320|pts_time=1.277098|dts=56320|dts_time=1.277098|duration=1024|duration_time=0.023220|size=238|pos=11615|flags=K__ +packet|codec_type=audio|stream_index=0|pts=57344|pts_time=1.300317|dts=57344|dts_time=1.300317|duration=1024|duration_time=0.023220|size=175|pos=11853|flags=K__ +packet|codec_type=audio|stream_index=0|pts=58368|pts_time=1.323537|dts=58368|dts_time=1.323537|duration=1024|duration_time=0.023220|size=178|pos=12028|flags=K__ +packet|codec_type=audio|stream_index=0|pts=59392|pts_time=1.346757|dts=59392|dts_time=1.346757|duration=1024|duration_time=0.023220|size=219|pos=12206|flags=K__ +packet|codec_type=audio|stream_index=0|pts=60416|pts_time=1.369977|dts=60416|dts_time=1.369977|duration=1024|duration_time=0.023220|size=179|pos=12425|flags=K__ +packet|codec_type=audio|stream_index=0|pts=61440|pts_time=1.393197|dts=61440|dts_time=1.393197|duration=1024|duration_time=0.023220|size=193|pos=12604|flags=K__ +packet|codec_type=audio|stream_index=0|pts=62464|pts_time=1.416417|dts=62464|dts_time=1.416417|duration=1024|duration_time=0.023220|size=200|pos=12797|flags=K__ +packet|codec_type=audio|stream_index=0|pts=63488|pts_time=1.439637|dts=63488|dts_time=1.439637|duration=1024|duration_time=0.023220|size=218|pos=12997|flags=K__ +packet|codec_type=audio|stream_index=0|pts=64512|pts_time=1.462857|dts=64512|dts_time=1.462857|duration=1024|duration_time=0.023220|size=215|pos=13215|flags=K__ +packet|codec_type=audio|stream_index=0|pts=65536|pts_time=1.486077|dts=65536|dts_time=1.486077|duration=1024|duration_time=0.023220|size=209|pos=13430|flags=K__ +packet|codec_type=audio|stream_index=0|pts=66560|pts_time=1.509297|dts=66560|dts_time=1.509297|duration=1024|duration_time=0.023220|size=171|pos=13639|flags=K__ +packet|codec_type=audio|stream_index=0|pts=67584|pts_time=1.532517|dts=67584|dts_time=1.532517|duration=1024|duration_time=0.023220|size=179|pos=13810|flags=K__ +packet|codec_type=audio|stream_index=0|pts=68608|pts_time=1.555737|dts=68608|dts_time=1.555737|duration=1024|duration_time=0.023220|size=185|pos=13989|flags=K__ +packet|codec_type=audio|stream_index=0|pts=69632|pts_time=1.578957|dts=69632|dts_time=1.578957|duration=1024|duration_time=0.023220|size=225|pos=14174|flags=K__ +packet|codec_type=audio|stream_index=0|pts=70656|pts_time=1.602177|dts=70656|dts_time=1.602177|duration=1024|duration_time=0.023220|size=221|pos=14399|flags=K__ +packet|codec_type=audio|stream_index=0|pts=71680|pts_time=1.625397|dts=71680|dts_time=1.625397|duration=1024|duration_time=0.023220|size=201|pos=14620|flags=K__ +packet|codec_type=audio|stream_index=0|pts=72704|pts_time=1.648617|dts=72704|dts_time=1.648617|duration=1024|duration_time=0.023220|size=206|pos=14821|flags=K__ +packet|codec_type=audio|stream_index=0|pts=73728|pts_time=1.671837|dts=73728|dts_time=1.671837|duration=1024|duration_time=0.023220|size=182|pos=15027|flags=K__ +packet|codec_type=audio|stream_index=0|pts=74752|pts_time=1.695057|dts=74752|dts_time=1.695057|duration=1024|duration_time=0.023220|size=176|pos=15209|flags=K__ +packet|codec_type=audio|stream_index=0|pts=75776|pts_time=1.718277|dts=75776|dts_time=1.718277|duration=1024|duration_time=0.023220|size=233|pos=15385|flags=K__ +packet|codec_type=audio|stream_index=0|pts=76800|pts_time=1.741497|dts=76800|dts_time=1.741497|duration=1024|duration_time=0.023220|size=199|pos=15618|flags=K__ +packet|codec_type=audio|stream_index=0|pts=77824|pts_time=1.764717|dts=77824|dts_time=1.764717|duration=1024|duration_time=0.023220|size=220|pos=15817|flags=K__ +packet|codec_type=audio|stream_index=0|pts=78848|pts_time=1.787937|dts=78848|dts_time=1.787937|duration=1024|duration_time=0.023220|size=190|pos=16037|flags=K__ +packet|codec_type=audio|stream_index=0|pts=79872|pts_time=1.811156|dts=79872|dts_time=1.811156|duration=1024|duration_time=0.023220|size=210|pos=16227|flags=K__ +packet|codec_type=audio|stream_index=0|pts=80896|pts_time=1.834376|dts=80896|dts_time=1.834376|duration=1024|duration_time=0.023220|size=204|pos=16437|flags=K__ +packet|codec_type=audio|stream_index=0|pts=81920|pts_time=1.857596|dts=81920|dts_time=1.857596|duration=1024|duration_time=0.023220|size=171|pos=16641|flags=K__ +packet|codec_type=audio|stream_index=0|pts=82944|pts_time=1.880816|dts=82944|dts_time=1.880816|duration=1024|duration_time=0.023220|size=167|pos=16812|flags=K__ +packet|codec_type=audio|stream_index=0|pts=83968|pts_time=1.904036|dts=83968|dts_time=1.904036|duration=1024|duration_time=0.023220|size=200|pos=16979|flags=K__ +packet|codec_type=audio|stream_index=0|pts=84992|pts_time=1.927256|dts=84992|dts_time=1.927256|duration=1024|duration_time=0.023220|size=254|pos=17179|flags=K__ +packet|codec_type=audio|stream_index=0|pts=86016|pts_time=1.950476|dts=86016|dts_time=1.950476|duration=1024|duration_time=0.023220|size=205|pos=17433|flags=K__ +packet|codec_type=audio|stream_index=0|pts=87040|pts_time=1.973696|dts=87040|dts_time=1.973696|duration=1024|duration_time=0.023220|size=196|pos=17638|flags=K__ +packet|codec_type=audio|stream_index=0|pts=88064|pts_time=1.996916|dts=88064|dts_time=1.996916|duration=1024|duration_time=0.023220|size=190|pos=17834|flags=K__ +packet|codec_type=audio|stream_index=0|pts=89088|pts_time=2.020136|dts=89088|dts_time=2.020136|duration=1024|duration_time=0.023220|size=197|pos=18024|flags=K__ +packet|codec_type=audio|stream_index=0|pts=90112|pts_time=2.043356|dts=90112|dts_time=2.043356|duration=1024|duration_time=0.023220|size=186|pos=18221|flags=K__ +packet|codec_type=audio|stream_index=0|pts=91136|pts_time=2.066576|dts=91136|dts_time=2.066576|duration=1024|duration_time=0.023220|size=194|pos=18407|flags=K__ +packet|codec_type=audio|stream_index=0|pts=92160|pts_time=2.089796|dts=92160|dts_time=2.089796|duration=1024|duration_time=0.023220|size=227|pos=18601|flags=K__ +packet|codec_type=audio|stream_index=0|pts=93184|pts_time=2.113016|dts=93184|dts_time=2.113016|duration=1024|duration_time=0.023220|size=195|pos=18828|flags=K__ +packet|codec_type=audio|stream_index=0|pts=94208|pts_time=2.136236|dts=94208|dts_time=2.136236|duration=1024|duration_time=0.023220|size=228|pos=19023|flags=K__ +packet|codec_type=audio|stream_index=0|pts=95232|pts_time=2.159456|dts=95232|dts_time=2.159456|duration=1024|duration_time=0.023220|size=196|pos=19251|flags=K__ +packet|codec_type=audio|stream_index=0|pts=96256|pts_time=2.182676|dts=96256|dts_time=2.182676|duration=1024|duration_time=0.023220|size=197|pos=19447|flags=K__ +packet|codec_type=audio|stream_index=0|pts=97280|pts_time=2.205896|dts=97280|dts_time=2.205896|duration=1024|duration_time=0.023220|size=186|pos=19644|flags=K__ +packet|codec_type=audio|stream_index=0|pts=98304|pts_time=2.229116|dts=98304|dts_time=2.229116|duration=1024|duration_time=0.023220|size=191|pos=19830|flags=K__ +packet|codec_type=audio|stream_index=0|pts=99328|pts_time=2.252336|dts=99328|dts_time=2.252336|duration=1024|duration_time=0.023220|size=215|pos=20021|flags=K__ +packet|codec_type=audio|stream_index=0|pts=100352|pts_time=2.275556|dts=100352|dts_time=2.275556|duration=1024|duration_time=0.023220|size=203|pos=20236|flags=K__ +packet|codec_type=audio|stream_index=0|pts=101376|pts_time=2.298776|dts=101376|dts_time=2.298776|duration=1024|duration_time=0.023220|size=205|pos=20439|flags=K__ +packet|codec_type=audio|stream_index=0|pts=102400|pts_time=2.321995|dts=102400|dts_time=2.321995|duration=1024|duration_time=0.023220|size=205|pos=20644|flags=K__ +packet|codec_type=audio|stream_index=0|pts=103424|pts_time=2.345215|dts=103424|dts_time=2.345215|duration=1024|duration_time=0.023220|size=213|pos=20849|flags=K__ +packet|codec_type=audio|stream_index=0|pts=104448|pts_time=2.368435|dts=104448|dts_time=2.368435|duration=1024|duration_time=0.023220|size=198|pos=21062|flags=K__ +packet|codec_type=audio|stream_index=0|pts=105472|pts_time=2.391655|dts=105472|dts_time=2.391655|duration=1024|duration_time=0.023220|size=178|pos=21260|flags=K__ +packet|codec_type=audio|stream_index=0|pts=106496|pts_time=2.414875|dts=106496|dts_time=2.414875|duration=1024|duration_time=0.023220|size=195|pos=21438|flags=K__ +packet|codec_type=audio|stream_index=0|pts=107520|pts_time=2.438095|dts=107520|dts_time=2.438095|duration=1024|duration_time=0.023220|size=227|pos=21633|flags=K__ +packet|codec_type=audio|stream_index=0|pts=108544|pts_time=2.461315|dts=108544|dts_time=2.461315|duration=1024|duration_time=0.023220|size=185|pos=21860|flags=K__ +packet|codec_type=audio|stream_index=0|pts=109568|pts_time=2.484535|dts=109568|dts_time=2.484535|duration=1024|duration_time=0.023220|size=206|pos=22045|flags=K__ +packet|codec_type=audio|stream_index=0|pts=110592|pts_time=2.507755|dts=110592|dts_time=2.507755|duration=1024|duration_time=0.023220|size=183|pos=22251|flags=K__ +packet|codec_type=audio|stream_index=0|pts=111616|pts_time=2.530975|dts=111616|dts_time=2.530975|duration=1024|duration_time=0.023220|size=208|pos=22434|flags=K__ +packet|codec_type=audio|stream_index=0|pts=112640|pts_time=2.554195|dts=112640|dts_time=2.554195|duration=1024|duration_time=0.023220|size=204|pos=22642|flags=K__ +packet|codec_type=audio|stream_index=0|pts=113664|pts_time=2.577415|dts=113664|dts_time=2.577415|duration=1024|duration_time=0.023220|size=192|pos=22846|flags=K__ +packet|codec_type=audio|stream_index=0|pts=114688|pts_time=2.600635|dts=114688|dts_time=2.600635|duration=1024|duration_time=0.023220|size=190|pos=23038|flags=K__ +packet|codec_type=audio|stream_index=0|pts=115712|pts_time=2.623855|dts=115712|dts_time=2.623855|duration=1024|duration_time=0.023220|size=199|pos=23228|flags=K__ +packet|codec_type=audio|stream_index=0|pts=116736|pts_time=2.647075|dts=116736|dts_time=2.647075|duration=1024|duration_time=0.023220|size=229|pos=23427|flags=K__ +packet|codec_type=audio|stream_index=0|pts=117760|pts_time=2.670295|dts=117760|dts_time=2.670295|duration=1024|duration_time=0.023220|size=208|pos=23656|flags=K__ +packet|codec_type=audio|stream_index=0|pts=118784|pts_time=2.693515|dts=118784|dts_time=2.693515|duration=1024|duration_time=0.023220|size=195|pos=23864|flags=K__ +packet|codec_type=audio|stream_index=0|pts=119808|pts_time=2.716735|dts=119808|dts_time=2.716735|duration=1024|duration_time=0.023220|size=190|pos=24059|flags=K__ +packet|codec_type=audio|stream_index=0|pts=120832|pts_time=2.739955|dts=120832|dts_time=2.739955|duration=1024|duration_time=0.023220|size=190|pos=24249|flags=K__ +packet|codec_type=audio|stream_index=0|pts=121856|pts_time=2.763175|dts=121856|dts_time=2.763175|duration=1024|duration_time=0.023220|size=192|pos=24439|flags=K__ +packet|codec_type=audio|stream_index=0|pts=122880|pts_time=2.786395|dts=122880|dts_time=2.786395|duration=1024|duration_time=0.023220|size=226|pos=24631|flags=K__ +packet|codec_type=audio|stream_index=0|pts=123904|pts_time=2.809615|dts=123904|dts_time=2.809615|duration=1024|duration_time=0.023220|size=195|pos=24857|flags=K__ +packet|codec_type=audio|stream_index=0|pts=124928|pts_time=2.832834|dts=124928|dts_time=2.832834|duration=1024|duration_time=0.023220|size=230|pos=25052|flags=K__ +packet|codec_type=audio|stream_index=0|pts=125952|pts_time=2.856054|dts=125952|dts_time=2.856054|duration=1024|duration_time=0.023220|size=198|pos=25282|flags=K__ +packet|codec_type=audio|stream_index=0|pts=126976|pts_time=2.879274|dts=126976|dts_time=2.879274|duration=1024|duration_time=0.023220|size=183|pos=25480|flags=K__ +packet|codec_type=audio|stream_index=0|pts=128000|pts_time=2.902494|dts=128000|dts_time=2.902494|duration=1024|duration_time=0.023220|size=199|pos=25663|flags=K__ +packet|codec_type=audio|stream_index=0|pts=129024|pts_time=2.925714|dts=129024|dts_time=2.925714|duration=1024|duration_time=0.023220|size=196|pos=25862|flags=K__ +packet|codec_type=audio|stream_index=0|pts=130048|pts_time=2.948934|dts=130048|dts_time=2.948934|duration=1024|duration_time=0.023220|size=186|pos=26058|flags=K__ +packet|codec_type=audio|stream_index=0|pts=131072|pts_time=2.972154|dts=131072|dts_time=2.972154|duration=1024|duration_time=0.023220|size=200|pos=26244|flags=K__ +packet|codec_type=audio|stream_index=0|pts=132096|pts_time=2.995374|dts=132096|dts_time=2.995374|duration=1024|duration_time=0.023220|size=210|pos=26444|flags=K__ +packet|codec_type=audio|stream_index=0|pts=133120|pts_time=3.018594|dts=133120|dts_time=3.018594|duration=1024|duration_time=0.023220|size=196|pos=26654|flags=K__ +packet|codec_type=audio|stream_index=0|pts=134144|pts_time=3.041814|dts=134144|dts_time=3.041814|duration=1024|duration_time=0.023220|size=214|pos=26850|flags=K__ +packet|codec_type=audio|stream_index=0|pts=135168|pts_time=3.065034|dts=135168|dts_time=3.065034|duration=1024|duration_time=0.023220|size=185|pos=27064|flags=K__ +packet|codec_type=audio|stream_index=0|pts=136192|pts_time=3.088254|dts=136192|dts_time=3.088254|duration=1024|duration_time=0.023220|size=198|pos=27249|flags=K__ +packet|codec_type=audio|stream_index=0|pts=137216|pts_time=3.111474|dts=137216|dts_time=3.111474|duration=1024|duration_time=0.023220|size=200|pos=27447|flags=K__ +packet|codec_type=audio|stream_index=0|pts=138240|pts_time=3.134694|dts=138240|dts_time=3.134694|duration=1024|duration_time=0.023220|size=208|pos=27647|flags=K__ +packet|codec_type=audio|stream_index=0|pts=139264|pts_time=3.157914|dts=139264|dts_time=3.157914|duration=1024|duration_time=0.023220|size=212|pos=27855|flags=K__ +packet|codec_type=audio|stream_index=0|pts=140288|pts_time=3.181134|dts=140288|dts_time=3.181134|duration=1024|duration_time=0.023220|size=208|pos=28067|flags=K__ +packet|codec_type=audio|stream_index=0|pts=141312|pts_time=3.204354|dts=141312|dts_time=3.204354|duration=1024|duration_time=0.023220|size=192|pos=28275|flags=K__ +packet|codec_type=audio|stream_index=0|pts=142336|pts_time=3.227574|dts=142336|dts_time=3.227574|duration=1024|duration_time=0.023220|size=192|pos=28467|flags=K__ +packet|codec_type=audio|stream_index=0|pts=143360|pts_time=3.250794|dts=143360|dts_time=3.250794|duration=1024|duration_time=0.023220|size=211|pos=28659|flags=K__ +packet|codec_type=audio|stream_index=0|pts=144384|pts_time=3.274014|dts=144384|dts_time=3.274014|duration=1024|duration_time=0.023220|size=195|pos=28870|flags=K__ +packet|codec_type=audio|stream_index=0|pts=145408|pts_time=3.297234|dts=145408|dts_time=3.297234|duration=1024|duration_time=0.023220|size=208|pos=29065|flags=K__ +packet|codec_type=audio|stream_index=0|pts=146432|pts_time=3.320454|dts=146432|dts_time=3.320454|duration=1024|duration_time=0.023220|size=195|pos=29273|flags=K__ +packet|codec_type=audio|stream_index=0|pts=147456|pts_time=3.343673|dts=147456|dts_time=3.343673|duration=1024|duration_time=0.023220|size=204|pos=29468|flags=K__ +packet|codec_type=audio|stream_index=0|pts=148480|pts_time=3.366893|dts=148480|dts_time=3.366893|duration=1024|duration_time=0.023220|size=209|pos=29672|flags=K__ +packet|codec_type=audio|stream_index=0|pts=149504|pts_time=3.390113|dts=149504|dts_time=3.390113|duration=1024|duration_time=0.023220|size=195|pos=29881|flags=K__ +packet|codec_type=audio|stream_index=0|pts=150528|pts_time=3.413333|dts=150528|dts_time=3.413333|duration=1024|duration_time=0.023220|size=191|pos=30076|flags=K__ +packet|codec_type=audio|stream_index=0|pts=151552|pts_time=3.436553|dts=151552|dts_time=3.436553|duration=1024|duration_time=0.023220|size=210|pos=30267|flags=K__ +packet|codec_type=audio|stream_index=0|pts=152576|pts_time=3.459773|dts=152576|dts_time=3.459773|duration=1024|duration_time=0.023220|size=209|pos=30477|flags=K__ +packet|codec_type=audio|stream_index=0|pts=153600|pts_time=3.482993|dts=153600|dts_time=3.482993|duration=1024|duration_time=0.023220|size=175|pos=30686|flags=K__ +packet|codec_type=audio|stream_index=0|pts=154624|pts_time=3.506213|dts=154624|dts_time=3.506213|duration=1024|duration_time=0.023220|size=244|pos=30861|flags=K__ +packet|codec_type=audio|stream_index=0|pts=155648|pts_time=3.529433|dts=155648|dts_time=3.529433|duration=1024|duration_time=0.023220|size=177|pos=31105|flags=K__ +packet|codec_type=audio|stream_index=0|pts=156672|pts_time=3.552653|dts=156672|dts_time=3.552653|duration=1024|duration_time=0.023220|size=217|pos=31282|flags=K__ +packet|codec_type=audio|stream_index=0|pts=157696|pts_time=3.575873|dts=157696|dts_time=3.575873|duration=1024|duration_time=0.023220|size=182|pos=31499|flags=K__ +packet|codec_type=audio|stream_index=0|pts=158720|pts_time=3.599093|dts=158720|dts_time=3.599093|duration=1024|duration_time=0.023220|size=181|pos=31681|flags=K__ +packet|codec_type=audio|stream_index=0|pts=159744|pts_time=3.622313|dts=159744|dts_time=3.622313|duration=1024|duration_time=0.023220|size=203|pos=31862|flags=K__ +packet|codec_type=audio|stream_index=0|pts=160768|pts_time=3.645533|dts=160768|dts_time=3.645533|duration=1024|duration_time=0.023220|size=198|pos=32065|flags=K__ +packet|codec_type=audio|stream_index=0|pts=161792|pts_time=3.668753|dts=161792|dts_time=3.668753|duration=1024|duration_time=0.023220|size=217|pos=32263|flags=K__ +packet|codec_type=audio|stream_index=0|pts=162816|pts_time=3.691973|dts=162816|dts_time=3.691973|duration=1024|duration_time=0.023220|size=195|pos=32480|flags=K__ +packet|codec_type=audio|stream_index=0|pts=163840|pts_time=3.715193|dts=163840|dts_time=3.715193|duration=1024|duration_time=0.023220|size=198|pos=32675|flags=K__ +packet|codec_type=audio|stream_index=0|pts=164864|pts_time=3.738413|dts=164864|dts_time=3.738413|duration=1024|duration_time=0.023220|size=202|pos=32873|flags=K__ +packet|codec_type=audio|stream_index=0|pts=165888|pts_time=3.761633|dts=165888|dts_time=3.761633|duration=1024|duration_time=0.023220|size=185|pos=33075|flags=K__ +packet|codec_type=audio|stream_index=0|pts=166912|pts_time=3.784853|dts=166912|dts_time=3.784853|duration=1024|duration_time=0.023220|size=196|pos=33260|flags=K__ +packet|codec_type=audio|stream_index=0|pts=167936|pts_time=3.808073|dts=167936|dts_time=3.808073|duration=1024|duration_time=0.023220|size=226|pos=33456|flags=K__ +packet|codec_type=audio|stream_index=0|pts=168960|pts_time=3.831293|dts=168960|dts_time=3.831293|duration=1024|duration_time=0.023220|size=187|pos=33682|flags=K__ +packet|codec_type=audio|stream_index=0|pts=169984|pts_time=3.854512|dts=169984|dts_time=3.854512|duration=1024|duration_time=0.023220|size=193|pos=33869|flags=K__ +packet|codec_type=audio|stream_index=0|pts=171008|pts_time=3.877732|dts=171008|dts_time=3.877732|duration=1024|duration_time=0.023220|size=218|pos=34062|flags=K__ +packet|codec_type=audio|stream_index=0|pts=172032|pts_time=3.900952|dts=172032|dts_time=3.900952|duration=1024|duration_time=0.023220|size=200|pos=34280|flags=K__ +packet|codec_type=audio|stream_index=0|pts=173056|pts_time=3.924172|dts=173056|dts_time=3.924172|duration=1024|duration_time=0.023220|size=200|pos=34480|flags=K__ +packet|codec_type=audio|stream_index=0|pts=174080|pts_time=3.947392|dts=174080|dts_time=3.947392|duration=1024|duration_time=0.023220|size=198|pos=34680|flags=K__ +packet|codec_type=audio|stream_index=0|pts=175104|pts_time=3.970612|dts=175104|dts_time=3.970612|duration=1024|duration_time=0.023220|size=200|pos=34878|flags=K__ +packet|codec_type=audio|stream_index=0|pts=176128|pts_time=3.993832|dts=176128|dts_time=3.993832|duration=1024|duration_time=0.023220|size=197|pos=35078|flags=K__ +packet|codec_type=audio|stream_index=0|pts=177152|pts_time=4.017052|dts=177152|dts_time=4.017052|duration=1024|duration_time=0.023220|size=209|pos=35275|flags=K__ +packet|codec_type=audio|stream_index=0|pts=178176|pts_time=4.040272|dts=178176|dts_time=4.040272|duration=1024|duration_time=0.023220|size=205|pos=35484|flags=K__ +packet|codec_type=audio|stream_index=0|pts=179200|pts_time=4.063492|dts=179200|dts_time=4.063492|duration=1024|duration_time=0.023220|size=199|pos=35689|flags=K__ +packet|codec_type=audio|stream_index=0|pts=180224|pts_time=4.086712|dts=180224|dts_time=4.086712|duration=1024|duration_time=0.023220|size=192|pos=35888|flags=K__ +packet|codec_type=audio|stream_index=0|pts=181248|pts_time=4.109932|dts=181248|dts_time=4.109932|duration=1024|duration_time=0.023220|size=201|pos=36080|flags=K__ +packet|codec_type=audio|stream_index=0|pts=182272|pts_time=4.133152|dts=182272|dts_time=4.133152|duration=1024|duration_time=0.023220|size=200|pos=36281|flags=K__ +packet|codec_type=audio|stream_index=0|pts=183296|pts_time=4.156372|dts=183296|dts_time=4.156372|duration=1024|duration_time=0.023220|size=202|pos=36481|flags=K__ +packet|codec_type=audio|stream_index=0|pts=184320|pts_time=4.179592|dts=184320|dts_time=4.179592|duration=1024|duration_time=0.023220|size=196|pos=36683|flags=K__ +packet|codec_type=audio|stream_index=0|pts=185344|pts_time=4.202812|dts=185344|dts_time=4.202812|duration=1024|duration_time=0.023220|size=200|pos=36879|flags=K__ +packet|codec_type=audio|stream_index=0|pts=186368|pts_time=4.226032|dts=186368|dts_time=4.226032|duration=1024|duration_time=0.023220|size=209|pos=37079|flags=K__ +packet|codec_type=audio|stream_index=0|pts=187392|pts_time=4.249252|dts=187392|dts_time=4.249252|duration=1024|duration_time=0.023220|size=201|pos=37288|flags=K__ +packet|codec_type=audio|stream_index=0|pts=188416|pts_time=4.272472|dts=188416|dts_time=4.272472|duration=1024|duration_time=0.023220|size=201|pos=37489|flags=K__ +packet|codec_type=audio|stream_index=0|pts=189440|pts_time=4.295692|dts=189440|dts_time=4.295692|duration=1024|duration_time=0.023220|size=201|pos=37690|flags=K__ +packet|codec_type=audio|stream_index=0|pts=190464|pts_time=4.318912|dts=190464|dts_time=4.318912|duration=1024|duration_time=0.023220|size=199|pos=37891|flags=K__ +packet|codec_type=audio|stream_index=0|pts=191488|pts_time=4.342132|dts=191488|dts_time=4.342132|duration=1024|duration_time=0.023220|size=198|pos=38090|flags=K__ +packet|codec_type=audio|stream_index=0|pts=192512|pts_time=4.365351|dts=192512|dts_time=4.365351|duration=1024|duration_time=0.023220|size=205|pos=38288|flags=K__ +packet|codec_type=audio|stream_index=0|pts=193536|pts_time=4.388571|dts=193536|dts_time=4.388571|duration=1024|duration_time=0.023220|size=190|pos=38493|flags=K__ +packet|codec_type=audio|stream_index=0|pts=194560|pts_time=4.411791|dts=194560|dts_time=4.411791|duration=1024|duration_time=0.023220|size=207|pos=38683|flags=K__ +packet|codec_type=audio|stream_index=0|pts=195584|pts_time=4.435011|dts=195584|dts_time=4.435011|duration=1024|duration_time=0.023220|size=204|pos=38890|flags=K__ +packet|codec_type=audio|stream_index=0|pts=196608|pts_time=4.458231|dts=196608|dts_time=4.458231|duration=1024|duration_time=0.023220|size=192|pos=39094|flags=K__ +packet|codec_type=audio|stream_index=0|pts=197632|pts_time=4.481451|dts=197632|dts_time=4.481451|duration=1024|duration_time=0.023220|size=211|pos=39286|flags=K__ +packet|codec_type=audio|stream_index=0|pts=198656|pts_time=4.504671|dts=198656|dts_time=4.504671|duration=1024|duration_time=0.023220|size=195|pos=39497|flags=K__ +packet|codec_type=audio|stream_index=0|pts=199680|pts_time=4.527891|dts=199680|dts_time=4.527891|duration=1024|duration_time=0.023220|size=214|pos=39692|flags=K__ +packet|codec_type=audio|stream_index=0|pts=200704|pts_time=4.551111|dts=200704|dts_time=4.551111|duration=1024|duration_time=0.023220|size=195|pos=39906|flags=K__ +packet|codec_type=audio|stream_index=0|pts=201728|pts_time=4.574331|dts=201728|dts_time=4.574331|duration=1024|duration_time=0.023220|size=199|pos=40101|flags=K__ +packet|codec_type=audio|stream_index=0|pts=202752|pts_time=4.597551|dts=202752|dts_time=4.597551|duration=1024|duration_time=0.023220|size=183|pos=40300|flags=K__ +packet|codec_type=audio|stream_index=0|pts=203776|pts_time=4.620771|dts=203776|dts_time=4.620771|duration=1024|duration_time=0.023220|size=211|pos=40483|flags=K__ +packet|codec_type=audio|stream_index=0|pts=204800|pts_time=4.643991|dts=204800|dts_time=4.643991|duration=1024|duration_time=0.023220|size=200|pos=40694|flags=K__ +packet|codec_type=audio|stream_index=0|pts=205824|pts_time=4.667211|dts=205824|dts_time=4.667211|duration=1024|duration_time=0.023220|size=199|pos=40894|flags=K__ +packet|codec_type=audio|stream_index=0|pts=206848|pts_time=4.690431|dts=206848|dts_time=4.690431|duration=1024|duration_time=0.023220|size=213|pos=41093|flags=K__ +packet|codec_type=audio|stream_index=0|pts=207872|pts_time=4.713651|dts=207872|dts_time=4.713651|duration=1024|duration_time=0.023220|size=191|pos=41306|flags=K__ +packet|codec_type=audio|stream_index=0|pts=208896|pts_time=4.736871|dts=208896|dts_time=4.736871|duration=1024|duration_time=0.023220|size=211|pos=41497|flags=K__ +packet|codec_type=audio|stream_index=0|pts=209920|pts_time=4.760091|dts=209920|dts_time=4.760091|duration=1024|duration_time=0.023220|size=198|pos=41708|flags=K__ +packet|codec_type=audio|stream_index=0|pts=210944|pts_time=4.783311|dts=210944|dts_time=4.783311|duration=1024|duration_time=0.023220|size=203|pos=41906|flags=K__ +packet|codec_type=audio|stream_index=0|pts=211968|pts_time=4.806531|dts=211968|dts_time=4.806531|duration=1024|duration_time=0.023220|size=196|pos=42109|flags=K__ +packet|codec_type=audio|stream_index=0|pts=212992|pts_time=4.829751|dts=212992|dts_time=4.829751|duration=1024|duration_time=0.023220|size=197|pos=42305|flags=K__ +packet|codec_type=audio|stream_index=0|pts=214016|pts_time=4.852971|dts=214016|dts_time=4.852971|duration=1024|duration_time=0.023220|size=190|pos=42502|flags=K__ +packet|codec_type=audio|stream_index=0|pts=215040|pts_time=4.876190|dts=215040|dts_time=4.876190|duration=1024|duration_time=0.023220|size=208|pos=42692|flags=K__ +packet|codec_type=audio|stream_index=0|pts=216064|pts_time=4.899410|dts=216064|dts_time=4.899410|duration=1024|duration_time=0.023220|size=203|pos=42900|flags=K__ +packet|codec_type=audio|stream_index=0|pts=217088|pts_time=4.922630|dts=217088|dts_time=4.922630|duration=1024|duration_time=0.023220|size=198|pos=43103|flags=K__ +packet|codec_type=audio|stream_index=0|pts=218112|pts_time=4.945850|dts=218112|dts_time=4.945850|duration=1024|duration_time=0.023220|size=284|pos=43301|flags=K__ +packet|codec_type=audio|stream_index=0|pts=219136|pts_time=4.969070|dts=219136|dts_time=4.969070|duration=1364|duration_time=0.030930|size=5|pos=43585|flags=K__ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-init-nonkeyframe mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-init-nonkeyframe --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-init-nonkeyframe 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-init-nonkeyframe 2023-03-03 13:29:59.000000000 +0000 @@ -1,120 +1,120 @@ -packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1001|duration_time=0.033367|size=599|pos=48|flags=__ -packet|codec_type=video|stream_index=0|pts=2002|pts_time=0.066733|dts=1001|dts_time=0.033367|duration=1001|duration_time=0.033367|size=2944|pos=1674|flags=__ -packet|codec_type=video|stream_index=0|pts=7007|pts_time=0.233567|dts=2002|dts_time=0.066733|duration=1001|duration_time=0.033367|size=21987|pos=5335|flags=__ -packet|codec_type=video|stream_index=0|pts=5005|pts_time=0.166833|dts=3003|dts_time=0.100100|duration=1001|duration_time=0.033367|size=4145|pos=28605|flags=__ -packet|codec_type=video|stream_index=0|pts=4004|pts_time=0.133467|dts=4004|dts_time=0.133467|duration=1001|duration_time=0.033367|size=3093|pos=33425|flags=__ -packet|codec_type=video|stream_index=0|pts=6006|pts_time=0.200200|dts=5005|dts_time=0.166833|duration=1001|duration_time=0.033367|size=572|pos=37769|flags=__ -packet|codec_type=video|stream_index=0|pts=11011|pts_time=0.367033|dts=6006|dts_time=0.200200|duration=1001|duration_time=0.033367|size=21599|pos=38999|flags=__ -packet|codec_type=video|stream_index=0|pts=9009|pts_time=0.300300|dts=7007|dts_time=0.233567|duration=1001|duration_time=0.033367|size=6287|pos=61922|flags=__ -packet|codec_type=video|stream_index=0|pts=8008|pts_time=0.266933|dts=8008|dts_time=0.266933|duration=1001|duration_time=0.033367|size=2720|pos=68909|flags=__ -packet|codec_type=video|stream_index=0|pts=10010|pts_time=0.333667|dts=9009|dts_time=0.300300|duration=1001|duration_time=0.033367|size=2715|pos=72301|flags=__ -packet|codec_type=video|stream_index=0|pts=15015|pts_time=0.500500|dts=10010|dts_time=0.333667|duration=1001|duration_time=0.033367|size=20221|pos=76433|flags=__ -packet|codec_type=video|stream_index=0|pts=13013|pts_time=0.433767|dts=11011|dts_time=0.367033|duration=1001|duration_time=0.033367|size=9505|pos=97381|flags=__ -packet|codec_type=video|stream_index=0|pts=12012|pts_time=0.400400|dts=12012|dts_time=0.400400|duration=1001|duration_time=0.033367|size=522|pos=108391|flags=__ -packet|codec_type=video|stream_index=0|pts=14014|pts_time=0.467133|dts=13013|dts_time=0.433767|duration=1001|duration_time=0.033367|size=2360|pos=109683|flags=__ -packet|codec_type=video|stream_index=0|pts=17017|pts_time=0.567233|dts=14014|dts_time=0.467133|duration=1001|duration_time=0.033367|size=22156|pos=113572|flags=__ -packet|codec_type=video|stream_index=0|pts=16016|pts_time=0.533867|dts=15015|dts_time=0.500500|duration=1001|duration_time=0.033367|size=1801|pos=136496|flags=__ -packet|codec_type=video|stream_index=0|pts=21021|pts_time=0.700700|dts=16016|dts_time=0.533867|duration=1001|duration_time=0.033367|size=20181|pos=139074|flags=__ -packet|codec_type=video|stream_index=0|pts=19019|pts_time=0.633967|dts=17017|dts_time=0.567233|duration=1001|duration_time=0.033367|size=3608|pos=160959|flags=__ -packet|codec_type=video|stream_index=0|pts=18018|pts_time=0.600600|dts=18018|dts_time=0.600600|duration=1001|duration_time=0.033367|size=368|pos=165305|flags=__ -packet|codec_type=video|stream_index=0|pts=20020|pts_time=0.667333|dts=19019|dts_time=0.633967|duration=1001|duration_time=0.033367|size=2989|pos=167054|flags=__ -packet|codec_type=video|stream_index=0|pts=25025|pts_time=0.834167|dts=20020|dts_time=0.667333|duration=1001|duration_time=0.033367|size=24475|pos=170801|flags=__ -packet|codec_type=video|stream_index=0|pts=23023|pts_time=0.767433|dts=21021|dts_time=0.700700|duration=1001|duration_time=0.033367|size=10682|pos=196732|flags=__ -packet|codec_type=video|stream_index=0|pts=22022|pts_time=0.734067|dts=22022|dts_time=0.734067|duration=1001|duration_time=0.033367|size=3198|pos=208151|flags=__ -packet|codec_type=video|stream_index=0|pts=24024|pts_time=0.800800|dts=23023|dts_time=0.767433|duration=1001|duration_time=0.033367|size=479|pos=212958|flags=__ -packet|codec_type=video|stream_index=0|pts=29029|pts_time=0.967633|dts=24024|dts_time=0.800800|duration=1001|duration_time=0.033367|size=21240|pos=214384|flags=__ -packet|codec_type=video|stream_index=0|pts=27027|pts_time=0.900900|dts=25025|dts_time=0.834167|duration=1001|duration_time=0.033367|size=4409|pos=236946|flags=__ -packet|codec_type=video|stream_index=0|pts=26026|pts_time=0.867533|dts=26026|dts_time=0.867533|duration=1001|duration_time=0.033367|size=3106|pos=242647|flags=__ -packet|codec_type=video|stream_index=0|pts=28028|pts_time=0.934267|dts=27027|dts_time=0.900900|duration=1001|duration_time=0.033367|size=453|pos=246428|flags=__ -packet|codec_type=video|stream_index=0|pts=33033|pts_time=1.101100|dts=28028|dts_time=0.934267|duration=1001|duration_time=0.033367|size=20668|pos=248308|flags=__ -packet|codec_type=video|stream_index=0|pts=31031|pts_time=1.034367|dts=29029|dts_time=0.967633|duration=1001|duration_time=0.033367|size=6668|pos=269708|flags=__ -packet|codec_type=video|stream_index=0|pts=30030|pts_time=1.001000|dts=30030|dts_time=1.001000|duration=1001|duration_time=0.033367|size=3027|pos=277789|flags=__ -packet|codec_type=video|stream_index=0|pts=32032|pts_time=1.067733|dts=31031|dts_time=1.034367|duration=1001|duration_time=0.033367|size=2884|pos=281613|flags=__ -packet|codec_type=video|stream_index=0|pts=37037|pts_time=1.234567|dts=32032|dts_time=1.067733|duration=1001|duration_time=0.033367|size=21313|pos=285261|flags=__ -packet|codec_type=video|stream_index=0|pts=35035|pts_time=1.167833|dts=33033|dts_time=1.101100|duration=1001|duration_time=0.033367|size=9890|pos=308303|flags=__ -packet|codec_type=video|stream_index=0|pts=34034|pts_time=1.134467|dts=34034|dts_time=1.134467|duration=1001|duration_time=0.033367|size=501|pos=318919|flags=__ -packet|codec_type=video|stream_index=0|pts=36036|pts_time=1.201200|dts=35035|dts_time=1.167833|duration=1001|duration_time=0.033367|size=3123|pos=320824|flags=__ -packet|codec_type=video|stream_index=0|pts=39039|pts_time=1.301300|dts=36036|dts_time=1.201200|duration=1001|duration_time=0.033367|size=21768|pos=324664|flags=__ -packet|codec_type=video|stream_index=0|pts=38038|pts_time=1.267933|dts=37037|dts_time=1.234567|duration=1001|duration_time=0.033367|size=2664|pos=347922|flags=__ -packet|codec_type=video|stream_index=0|pts=43043|pts_time=1.434767|dts=38038|dts_time=1.267933|duration=1001|duration_time=0.033367|size=19144|pos=351354|flags=__ -packet|codec_type=video|stream_index=0|pts=41041|pts_time=1.368033|dts=39039|dts_time=1.301300|duration=1001|duration_time=0.033367|size=4118|pos=371991|flags=__ -packet|codec_type=video|stream_index=0|pts=40040|pts_time=1.334667|dts=40040|dts_time=1.334667|duration=1001|duration_time=0.033367|size=423|pos=376899|flags=__ -packet|codec_type=video|stream_index=0|pts=42042|pts_time=1.401400|dts=41041|dts_time=1.368033|duration=1001|duration_time=0.033367|size=2785|pos=378037|flags=__ -packet|codec_type=video|stream_index=0|pts=45045|pts_time=1.501500|dts=42042|dts_time=1.401400|duration=1001|duration_time=0.033367|size=24489|pos=382144|flags=__ -packet|codec_type=video|stream_index=0|pts=44044|pts_time=1.468133|dts=43043|dts_time=1.434767|duration=1001|duration_time=0.033367|size=2984|pos=407344|flags=__ -packet|codec_type=video|stream_index=0|pts=49049|pts_time=1.634967|dts=44044|dts_time=1.468133|duration=1001|duration_time=0.033367|size=19174|pos=411791|flags=__ -packet|codec_type=video|stream_index=0|pts=47047|pts_time=1.568233|dts=45045|dts_time=1.501500|duration=1001|duration_time=0.033367|size=4905|pos=431740|flags=__ -packet|codec_type=video|stream_index=0|pts=46046|pts_time=1.534867|dts=46046|dts_time=1.534867|duration=1001|duration_time=0.033367|size=412|pos=438183|flags=__ -packet|codec_type=video|stream_index=0|pts=48048|pts_time=1.601600|dts=47047|dts_time=1.568233|duration=1001|duration_time=0.033367|size=3215|pos=439373|flags=__ -packet|codec_type=video|stream_index=0|pts=51051|pts_time=1.701700|dts=48048|dts_time=1.601600|duration=1001|duration_time=0.033367|size=21572|pos=443371|flags=__ -packet|codec_type=video|stream_index=0|pts=50050|pts_time=1.668333|dts=49049|dts_time=1.634967|duration=1001|duration_time=0.033367|size=2644|pos=466486|flags=__ -packet|codec_type=video|stream_index=0|pts=55055|pts_time=1.835167|dts=50050|dts_time=1.668333|duration=1001|duration_time=0.033367|size=19417|pos=470462|flags=__ -packet|codec_type=video|stream_index=0|pts=53053|pts_time=1.768433|dts=51051|dts_time=1.701700|duration=1001|duration_time=0.033367|size=3685|pos=491335|flags=__ -packet|codec_type=video|stream_index=0|pts=52052|pts_time=1.735067|dts=52052|dts_time=1.735067|duration=1001|duration_time=0.033367|size=355|pos=495771|flags=__ -packet|codec_type=video|stream_index=0|pts=54054|pts_time=1.801800|dts=53053|dts_time=1.768433|duration=1001|duration_time=0.033367|size=3021|pos=497714|flags=__ -packet|codec_type=video|stream_index=0|pts=59059|pts_time=1.968633|dts=54054|dts_time=1.801800|duration=1001|duration_time=0.033367|size=21464|pos=501431|flags=__ -packet|codec_type=video|stream_index=0|pts=57057|pts_time=1.901900|dts=55055|dts_time=1.835167|duration=1001|duration_time=0.033367|size=9340|pos=524392|flags=__ -packet|codec_type=video|stream_index=0|pts=56056|pts_time=1.868533|dts=56056|dts_time=1.868533|duration=1001|duration_time=0.033367|size=406|pos=534504|flags=__ -packet|codec_type=video|stream_index=0|pts=58058|pts_time=1.935267|dts=57057|dts_time=1.901900|duration=1001|duration_time=0.033367|size=3277|pos=535694|flags=__ -packet|codec_type=video|stream_index=0|pts=63063|pts_time=2.102100|dts=58058|dts_time=1.935267|duration=1001|duration_time=0.033367|size=21388|pos=541090|flags=__ -packet|codec_type=video|stream_index=0|pts=61061|pts_time=2.035367|dts=59059|dts_time=1.968633|duration=1001|duration_time=0.033367|size=4466|pos=563132|flags=__ -packet|codec_type=video|stream_index=0|pts=60060|pts_time=2.002000|dts=60060|dts_time=2.002000|duration=1001|duration_time=0.033367|size=3467|pos=569245|flags=__ -packet|codec_type=video|stream_index=0|pts=62062|pts_time=2.068733|dts=61061|dts_time=2.035367|duration=1001|duration_time=0.033367|size=499|pos=573478|flags=__ -packet|codec_type=video|stream_index=0|pts=67067|pts_time=2.235567|dts=62062|dts_time=2.068733|duration=1001|duration_time=0.033367|size=25972|pos=575469|flags=__ -packet|codec_type=video|stream_index=0|pts=65065|pts_time=2.168833|dts=63063|dts_time=2.102100|duration=1001|duration_time=0.033367|size=6643|pos=602163|flags=__ -packet|codec_type=video|stream_index=0|pts=64064|pts_time=2.135467|dts=64064|dts_time=2.135467|duration=1001|duration_time=0.033367|size=3069|pos=609558|flags=__ -packet|codec_type=video|stream_index=0|pts=66066|pts_time=2.202200|dts=65065|dts_time=2.168833|duration=1001|duration_time=0.033367|size=3049|pos=614133|flags=__ -packet|codec_type=video|stream_index=0|pts=68068|pts_time=2.268933|dts=66066|dts_time=2.202200|duration=1001|duration_time=0.033367|size=4559|pos=618551|flags=__ -packet|codec_type=video|stream_index=0|pts=72072|pts_time=2.402400|dts=67067|dts_time=2.235567|duration=1001|duration_time=0.033367|size=21251|pos=624621|flags=__ -packet|codec_type=video|stream_index=0|pts=70070|pts_time=2.335667|dts=68068|dts_time=2.268933|duration=1001|duration_time=0.033367|size=7108|pos=646657|flags=__ -packet|codec_type=video|stream_index=0|pts=69069|pts_time=2.302300|dts=69069|dts_time=2.302300|duration=1001|duration_time=0.033367|size=3250|pos=655299|flags=__ -packet|codec_type=video|stream_index=0|pts=71071|pts_time=2.369033|dts=70070|dts_time=2.335667|duration=1001|duration_time=0.033367|size=3365|pos=659310|flags=__ -packet|codec_type=video|stream_index=0|pts=73073|pts_time=2.435767|dts=71071|dts_time=2.369033|duration=1001|duration_time=0.033367|size=24803|pos=664201|flags=__ -packet|codec_type=video|stream_index=0|pts=77077|pts_time=2.569233|dts=72072|dts_time=2.402400|duration=1001|duration_time=0.033367|size=22185|pos=689763|flags=__ -packet|codec_type=video|stream_index=0|pts=75075|pts_time=2.502500|dts=73073|dts_time=2.435767|duration=1001|duration_time=0.033367|size=5088|pos=712679|flags=__ -packet|codec_type=video|stream_index=0|pts=74074|pts_time=2.469133|dts=74074|dts_time=2.469133|duration=1001|duration_time=0.033367|size=537|pos=719128|flags=__ -packet|codec_type=video|stream_index=0|pts=76076|pts_time=2.535867|dts=75075|dts_time=2.502500|duration=1001|duration_time=0.033367|size=3765|pos=720413|flags=__ -packet|codec_type=video|stream_index=0|pts=81081|pts_time=2.702700|dts=76076|dts_time=2.535867|duration=1001|duration_time=0.033367|size=20654|pos=725583|flags=__ -packet|codec_type=video|stream_index=0|pts=79079|pts_time=2.635967|dts=77077|dts_time=2.569233|duration=1001|duration_time=0.033367|size=10202|pos=746999|flags=__ -packet|codec_type=video|stream_index=0|pts=78078|pts_time=2.602600|dts=78078|dts_time=2.602600|duration=1001|duration_time=0.033367|size=3970|pos=758705|flags=__ -packet|codec_type=video|stream_index=0|pts=80080|pts_time=2.669333|dts=79079|dts_time=2.635967|duration=1001|duration_time=0.033367|size=421|pos=763442|flags=__ -packet|codec_type=video|stream_index=0|pts=84084|pts_time=2.802800|dts=80080|dts_time=2.669333|duration=1001|duration_time=0.033367|size=25685|pos=764653|flags=__ -packet|codec_type=video|stream_index=0|pts=82082|pts_time=2.736067|dts=81081|dts_time=2.702700|duration=1001|duration_time=0.033367|size=4077|pos=791911|flags=__ -packet|codec_type=video|stream_index=0|pts=83083|pts_time=2.769433|dts=82082|dts_time=2.736067|duration=1001|duration_time=0.033367|size=3049|pos=796780|flags=__ -packet|codec_type=video|stream_index=0|pts=88088|pts_time=2.936267|dts=83083|dts_time=2.769433|duration=1001|duration_time=0.033367|size=8924|pos=801473|flags=__ -packet|codec_type=video|stream_index=0|pts=86086|pts_time=2.869533|dts=84084|dts_time=2.802800|duration=1001|duration_time=0.033367|size=2512|pos=811078|flags=__ -packet|codec_type=video|stream_index=0|pts=85085|pts_time=2.836167|dts=85085|dts_time=2.836167|duration=1001|duration_time=0.033367|size=163|pos=815033|flags=__ -packet|codec_type=video|stream_index=0|pts=87087|pts_time=2.902900|dts=86086|dts_time=2.869533|duration=1001|duration_time=0.033367|size=1734|pos=815934|flags=__ -packet|codec_type=video|stream_index=0|pts=90090|pts_time=3.003000|dts=87087|dts_time=2.902900|duration=1001|duration_time=0.033367|size=11505|pos=819088|flags=__ -packet|codec_type=video|stream_index=0|pts=89089|pts_time=2.969633|dts=88088|dts_time=2.936267|duration=1001|duration_time=0.033367|size=1431|pos=831367|flags=__ -packet|codec_type=video|stream_index=0|pts=92092|pts_time=3.069733|dts=89089|dts_time=2.969633|duration=1001|duration_time=0.033367|size=5269|pos=833580|flags=__ -packet|codec_type=video|stream_index=0|pts=91091|pts_time=3.036367|dts=90090|dts_time=3.003000|duration=1001|duration_time=0.033367|size=199|pos=840352|flags=__ -packet|codec_type=video|stream_index=0|pts=93093|pts_time=3.103100|dts=91091|dts_time=3.036367|duration=1001|duration_time=0.033367|size=85650|pos=841722|flags=K_ -packet|codec_type=video|stream_index=0|pts=95095|pts_time=3.169833|dts=92092|dts_time=3.069733|duration=1001|duration_time=0.033367|size=13261|pos=928747|flags=__ -packet|codec_type=video|stream_index=0|pts=94094|pts_time=3.136467|dts=93093|dts_time=3.103100|duration=1001|duration_time=0.033367|size=1667|pos=942741|flags=__ -packet|codec_type=video|stream_index=0|pts=99099|pts_time=3.303300|dts=94094|dts_time=3.136467|duration=1001|duration_time=0.033367|size=20143|pos=945841|flags=__ -packet|codec_type=video|stream_index=0|pts=97097|pts_time=3.236567|dts=95095|dts_time=3.169833|duration=1001|duration_time=0.033367|size=2484|pos=966681|flags=__ -packet|codec_type=video|stream_index=0|pts=96096|pts_time=3.203200|dts=96096|dts_time=3.203200|duration=1001|duration_time=0.033367|size=278|pos=969887|flags=__ -packet|codec_type=video|stream_index=0|pts=98098|pts_time=3.269933|dts=97097|dts_time=3.236567|duration=1001|duration_time=0.033367|size=1539|pos=971696|flags=__ -packet|codec_type=video|stream_index=0|pts=101101|pts_time=3.370033|dts=98098|dts_time=3.269933|duration=1001|duration_time=0.033367|size=20270|pos=974088|flags=__ -packet|codec_type=video|stream_index=0|pts=100100|pts_time=3.336667|dts=99099|dts_time=3.303300|duration=1001|duration_time=0.033367|size=1754|pos=995975|flags=__ -packet|codec_type=video|stream_index=0|pts=105105|pts_time=3.503500|dts=100100|dts_time=3.336667|duration=1001|duration_time=0.033367|size=19154|pos=998420|flags=__ -packet|codec_type=video|stream_index=0|pts=103103|pts_time=3.436767|dts=101101|dts_time=3.370033|duration=1001|duration_time=0.033367|size=3359|pos=1019010|flags=__ -packet|codec_type=video|stream_index=0|pts=102102|pts_time=3.403400|dts=102102|dts_time=3.403400|duration=1001|duration_time=0.033367|size=287|pos=1023138|flags=__ -packet|codec_type=video|stream_index=0|pts=104104|pts_time=3.470133|dts=103103|dts_time=3.436767|duration=1001|duration_time=0.033367|size=2111|pos=1024928|flags=__ -packet|codec_type=video|stream_index=0|pts=109109|pts_time=3.636967|dts=104104|dts_time=3.470133|duration=1001|duration_time=0.033367|size=17178|pos=1027833|flags=__ -packet|codec_type=video|stream_index=0|pts=107107|pts_time=3.570233|dts=105105|dts_time=3.503500|duration=1001|duration_time=0.033367|size=7205|pos=1045716|flags=__ -packet|codec_type=video|stream_index=0|pts=106106|pts_time=3.536867|dts=106106|dts_time=3.536867|duration=1001|duration_time=0.033367|size=2209|pos=1054354|flags=__ -packet|codec_type=video|stream_index=0|pts=108108|pts_time=3.603600|dts=107107|dts_time=3.570233|duration=1001|duration_time=0.033367|size=359|pos=1057226|flags=__ -packet|codec_type=video|stream_index=0|pts=113113|pts_time=3.770433|dts=108108|dts_time=3.603600|duration=1001|duration_time=0.033367|size=18469|pos=1059024|flags=__ -packet|codec_type=video|stream_index=0|pts=111111|pts_time=3.703700|dts=109109|dts_time=3.636967|duration=1001|duration_time=0.033367|size=3314|pos=1078213|flags=__ -packet|codec_type=video|stream_index=0|pts=110110|pts_time=3.670333|dts=110110|dts_time=3.670333|duration=1001|duration_time=0.033367|size=2556|pos=1083059|flags=__ -packet|codec_type=video|stream_index=0|pts=112112|pts_time=3.737067|dts=111111|dts_time=3.703700|duration=1001|duration_time=0.033367|size=437|pos=1086388|flags=__ -packet|codec_type=video|stream_index=0|pts=117117|pts_time=3.903900|dts=112112|dts_time=3.737067|duration=1001|duration_time=0.033367|size=19707|pos=1087610|flags=__ -packet|codec_type=video|stream_index=0|pts=115115|pts_time=3.837167|dts=113113|dts_time=3.770433|duration=1001|duration_time=0.033367|size=5917|pos=1108845|flags=__ -packet|codec_type=video|stream_index=0|pts=114114|pts_time=3.803800|dts=114114|dts_time=3.803800|duration=1001|duration_time=0.033367|size=2613|pos=1115495|flags=__ -packet|codec_type=video|stream_index=0|pts=116116|pts_time=3.870533|dts=115115|dts_time=3.837167|duration=1001|duration_time=0.033367|size=2672|pos=1119530|flags=__ -packet|codec_type=video|stream_index=0|pts=121121|pts_time=4.037367|dts=116116|dts_time=3.870533|duration=1001|duration_time=0.033367|size=19091|pos=1122970|flags=_D -packet|codec_type=video|stream_index=0|pts=119119|pts_time=3.970633|dts=117117|dts_time=3.903900|duration=1001|duration_time=0.033367|size=9244|pos=1143585|flags=__ -packet|codec_type=video|stream_index=0|pts=118118|pts_time=3.937267|dts=118118|dts_time=3.937267|duration=1001|duration_time=0.033367|size=284|pos=1153587|flags=__ -packet|codec_type=video|stream_index=0|pts=120120|pts_time=4.004000|dts=119119|dts_time=3.970633|duration=1001|duration_time=0.033367|size=2381|pos=1155393|flags=_D +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1001|duration_time=0.033367|size=599|pos=48|flags=___ +packet|codec_type=video|stream_index=0|pts=2002|pts_time=0.066733|dts=1001|dts_time=0.033367|duration=1001|duration_time=0.033367|size=2944|pos=1674|flags=___ +packet|codec_type=video|stream_index=0|pts=7007|pts_time=0.233567|dts=2002|dts_time=0.066733|duration=1001|duration_time=0.033367|size=21987|pos=5335|flags=___ +packet|codec_type=video|stream_index=0|pts=5005|pts_time=0.166833|dts=3003|dts_time=0.100100|duration=1001|duration_time=0.033367|size=4145|pos=28605|flags=___ +packet|codec_type=video|stream_index=0|pts=4004|pts_time=0.133467|dts=4004|dts_time=0.133467|duration=1001|duration_time=0.033367|size=3093|pos=33425|flags=___ +packet|codec_type=video|stream_index=0|pts=6006|pts_time=0.200200|dts=5005|dts_time=0.166833|duration=1001|duration_time=0.033367|size=572|pos=37769|flags=___ +packet|codec_type=video|stream_index=0|pts=11011|pts_time=0.367033|dts=6006|dts_time=0.200200|duration=1001|duration_time=0.033367|size=21599|pos=38999|flags=___ +packet|codec_type=video|stream_index=0|pts=9009|pts_time=0.300300|dts=7007|dts_time=0.233567|duration=1001|duration_time=0.033367|size=6287|pos=61922|flags=___ +packet|codec_type=video|stream_index=0|pts=8008|pts_time=0.266933|dts=8008|dts_time=0.266933|duration=1001|duration_time=0.033367|size=2720|pos=68909|flags=___ +packet|codec_type=video|stream_index=0|pts=10010|pts_time=0.333667|dts=9009|dts_time=0.300300|duration=1001|duration_time=0.033367|size=2715|pos=72301|flags=___ +packet|codec_type=video|stream_index=0|pts=15015|pts_time=0.500500|dts=10010|dts_time=0.333667|duration=1001|duration_time=0.033367|size=20221|pos=76433|flags=___ +packet|codec_type=video|stream_index=0|pts=13013|pts_time=0.433767|dts=11011|dts_time=0.367033|duration=1001|duration_time=0.033367|size=9505|pos=97381|flags=___ +packet|codec_type=video|stream_index=0|pts=12012|pts_time=0.400400|dts=12012|dts_time=0.400400|duration=1001|duration_time=0.033367|size=522|pos=108391|flags=___ +packet|codec_type=video|stream_index=0|pts=14014|pts_time=0.467133|dts=13013|dts_time=0.433767|duration=1001|duration_time=0.033367|size=2360|pos=109683|flags=___ +packet|codec_type=video|stream_index=0|pts=17017|pts_time=0.567233|dts=14014|dts_time=0.467133|duration=1001|duration_time=0.033367|size=22156|pos=113572|flags=___ +packet|codec_type=video|stream_index=0|pts=16016|pts_time=0.533867|dts=15015|dts_time=0.500500|duration=1001|duration_time=0.033367|size=1801|pos=136496|flags=___ +packet|codec_type=video|stream_index=0|pts=21021|pts_time=0.700700|dts=16016|dts_time=0.533867|duration=1001|duration_time=0.033367|size=20181|pos=139074|flags=___ +packet|codec_type=video|stream_index=0|pts=19019|pts_time=0.633967|dts=17017|dts_time=0.567233|duration=1001|duration_time=0.033367|size=3608|pos=160959|flags=___ +packet|codec_type=video|stream_index=0|pts=18018|pts_time=0.600600|dts=18018|dts_time=0.600600|duration=1001|duration_time=0.033367|size=368|pos=165305|flags=___ +packet|codec_type=video|stream_index=0|pts=20020|pts_time=0.667333|dts=19019|dts_time=0.633967|duration=1001|duration_time=0.033367|size=2989|pos=167054|flags=___ +packet|codec_type=video|stream_index=0|pts=25025|pts_time=0.834167|dts=20020|dts_time=0.667333|duration=1001|duration_time=0.033367|size=24475|pos=170801|flags=___ +packet|codec_type=video|stream_index=0|pts=23023|pts_time=0.767433|dts=21021|dts_time=0.700700|duration=1001|duration_time=0.033367|size=10682|pos=196732|flags=___ +packet|codec_type=video|stream_index=0|pts=22022|pts_time=0.734067|dts=22022|dts_time=0.734067|duration=1001|duration_time=0.033367|size=3198|pos=208151|flags=___ +packet|codec_type=video|stream_index=0|pts=24024|pts_time=0.800800|dts=23023|dts_time=0.767433|duration=1001|duration_time=0.033367|size=479|pos=212958|flags=___ +packet|codec_type=video|stream_index=0|pts=29029|pts_time=0.967633|dts=24024|dts_time=0.800800|duration=1001|duration_time=0.033367|size=21240|pos=214384|flags=___ +packet|codec_type=video|stream_index=0|pts=27027|pts_time=0.900900|dts=25025|dts_time=0.834167|duration=1001|duration_time=0.033367|size=4409|pos=236946|flags=___ +packet|codec_type=video|stream_index=0|pts=26026|pts_time=0.867533|dts=26026|dts_time=0.867533|duration=1001|duration_time=0.033367|size=3106|pos=242647|flags=___ +packet|codec_type=video|stream_index=0|pts=28028|pts_time=0.934267|dts=27027|dts_time=0.900900|duration=1001|duration_time=0.033367|size=453|pos=246428|flags=___ +packet|codec_type=video|stream_index=0|pts=33033|pts_time=1.101100|dts=28028|dts_time=0.934267|duration=1001|duration_time=0.033367|size=20668|pos=248308|flags=___ +packet|codec_type=video|stream_index=0|pts=31031|pts_time=1.034367|dts=29029|dts_time=0.967633|duration=1001|duration_time=0.033367|size=6668|pos=269708|flags=___ +packet|codec_type=video|stream_index=0|pts=30030|pts_time=1.001000|dts=30030|dts_time=1.001000|duration=1001|duration_time=0.033367|size=3027|pos=277789|flags=___ +packet|codec_type=video|stream_index=0|pts=32032|pts_time=1.067733|dts=31031|dts_time=1.034367|duration=1001|duration_time=0.033367|size=2884|pos=281613|flags=___ +packet|codec_type=video|stream_index=0|pts=37037|pts_time=1.234567|dts=32032|dts_time=1.067733|duration=1001|duration_time=0.033367|size=21313|pos=285261|flags=___ +packet|codec_type=video|stream_index=0|pts=35035|pts_time=1.167833|dts=33033|dts_time=1.101100|duration=1001|duration_time=0.033367|size=9890|pos=308303|flags=___ +packet|codec_type=video|stream_index=0|pts=34034|pts_time=1.134467|dts=34034|dts_time=1.134467|duration=1001|duration_time=0.033367|size=501|pos=318919|flags=___ +packet|codec_type=video|stream_index=0|pts=36036|pts_time=1.201200|dts=35035|dts_time=1.167833|duration=1001|duration_time=0.033367|size=3123|pos=320824|flags=___ +packet|codec_type=video|stream_index=0|pts=39039|pts_time=1.301300|dts=36036|dts_time=1.201200|duration=1001|duration_time=0.033367|size=21768|pos=324664|flags=___ +packet|codec_type=video|stream_index=0|pts=38038|pts_time=1.267933|dts=37037|dts_time=1.234567|duration=1001|duration_time=0.033367|size=2664|pos=347922|flags=___ +packet|codec_type=video|stream_index=0|pts=43043|pts_time=1.434767|dts=38038|dts_time=1.267933|duration=1001|duration_time=0.033367|size=19144|pos=351354|flags=___ +packet|codec_type=video|stream_index=0|pts=41041|pts_time=1.368033|dts=39039|dts_time=1.301300|duration=1001|duration_time=0.033367|size=4118|pos=371991|flags=___ +packet|codec_type=video|stream_index=0|pts=40040|pts_time=1.334667|dts=40040|dts_time=1.334667|duration=1001|duration_time=0.033367|size=423|pos=376899|flags=___ +packet|codec_type=video|stream_index=0|pts=42042|pts_time=1.401400|dts=41041|dts_time=1.368033|duration=1001|duration_time=0.033367|size=2785|pos=378037|flags=___ +packet|codec_type=video|stream_index=0|pts=45045|pts_time=1.501500|dts=42042|dts_time=1.401400|duration=1001|duration_time=0.033367|size=24489|pos=382144|flags=___ +packet|codec_type=video|stream_index=0|pts=44044|pts_time=1.468133|dts=43043|dts_time=1.434767|duration=1001|duration_time=0.033367|size=2984|pos=407344|flags=___ +packet|codec_type=video|stream_index=0|pts=49049|pts_time=1.634967|dts=44044|dts_time=1.468133|duration=1001|duration_time=0.033367|size=19174|pos=411791|flags=___ +packet|codec_type=video|stream_index=0|pts=47047|pts_time=1.568233|dts=45045|dts_time=1.501500|duration=1001|duration_time=0.033367|size=4905|pos=431740|flags=___ +packet|codec_type=video|stream_index=0|pts=46046|pts_time=1.534867|dts=46046|dts_time=1.534867|duration=1001|duration_time=0.033367|size=412|pos=438183|flags=___ +packet|codec_type=video|stream_index=0|pts=48048|pts_time=1.601600|dts=47047|dts_time=1.568233|duration=1001|duration_time=0.033367|size=3215|pos=439373|flags=___ +packet|codec_type=video|stream_index=0|pts=51051|pts_time=1.701700|dts=48048|dts_time=1.601600|duration=1001|duration_time=0.033367|size=21572|pos=443371|flags=___ +packet|codec_type=video|stream_index=0|pts=50050|pts_time=1.668333|dts=49049|dts_time=1.634967|duration=1001|duration_time=0.033367|size=2644|pos=466486|flags=___ +packet|codec_type=video|stream_index=0|pts=55055|pts_time=1.835167|dts=50050|dts_time=1.668333|duration=1001|duration_time=0.033367|size=19417|pos=470462|flags=___ +packet|codec_type=video|stream_index=0|pts=53053|pts_time=1.768433|dts=51051|dts_time=1.701700|duration=1001|duration_time=0.033367|size=3685|pos=491335|flags=___ +packet|codec_type=video|stream_index=0|pts=52052|pts_time=1.735067|dts=52052|dts_time=1.735067|duration=1001|duration_time=0.033367|size=355|pos=495771|flags=___ +packet|codec_type=video|stream_index=0|pts=54054|pts_time=1.801800|dts=53053|dts_time=1.768433|duration=1001|duration_time=0.033367|size=3021|pos=497714|flags=___ +packet|codec_type=video|stream_index=0|pts=59059|pts_time=1.968633|dts=54054|dts_time=1.801800|duration=1001|duration_time=0.033367|size=21464|pos=501431|flags=___ +packet|codec_type=video|stream_index=0|pts=57057|pts_time=1.901900|dts=55055|dts_time=1.835167|duration=1001|duration_time=0.033367|size=9340|pos=524392|flags=___ +packet|codec_type=video|stream_index=0|pts=56056|pts_time=1.868533|dts=56056|dts_time=1.868533|duration=1001|duration_time=0.033367|size=406|pos=534504|flags=___ +packet|codec_type=video|stream_index=0|pts=58058|pts_time=1.935267|dts=57057|dts_time=1.901900|duration=1001|duration_time=0.033367|size=3277|pos=535694|flags=___ +packet|codec_type=video|stream_index=0|pts=63063|pts_time=2.102100|dts=58058|dts_time=1.935267|duration=1001|duration_time=0.033367|size=21388|pos=541090|flags=___ +packet|codec_type=video|stream_index=0|pts=61061|pts_time=2.035367|dts=59059|dts_time=1.968633|duration=1001|duration_time=0.033367|size=4466|pos=563132|flags=___ +packet|codec_type=video|stream_index=0|pts=60060|pts_time=2.002000|dts=60060|dts_time=2.002000|duration=1001|duration_time=0.033367|size=3467|pos=569245|flags=___ +packet|codec_type=video|stream_index=0|pts=62062|pts_time=2.068733|dts=61061|dts_time=2.035367|duration=1001|duration_time=0.033367|size=499|pos=573478|flags=___ +packet|codec_type=video|stream_index=0|pts=67067|pts_time=2.235567|dts=62062|dts_time=2.068733|duration=1001|duration_time=0.033367|size=25972|pos=575469|flags=___ +packet|codec_type=video|stream_index=0|pts=65065|pts_time=2.168833|dts=63063|dts_time=2.102100|duration=1001|duration_time=0.033367|size=6643|pos=602163|flags=___ +packet|codec_type=video|stream_index=0|pts=64064|pts_time=2.135467|dts=64064|dts_time=2.135467|duration=1001|duration_time=0.033367|size=3069|pos=609558|flags=___ +packet|codec_type=video|stream_index=0|pts=66066|pts_time=2.202200|dts=65065|dts_time=2.168833|duration=1001|duration_time=0.033367|size=3049|pos=614133|flags=___ +packet|codec_type=video|stream_index=0|pts=68068|pts_time=2.268933|dts=66066|dts_time=2.202200|duration=1001|duration_time=0.033367|size=4559|pos=618551|flags=___ +packet|codec_type=video|stream_index=0|pts=72072|pts_time=2.402400|dts=67067|dts_time=2.235567|duration=1001|duration_time=0.033367|size=21251|pos=624621|flags=___ +packet|codec_type=video|stream_index=0|pts=70070|pts_time=2.335667|dts=68068|dts_time=2.268933|duration=1001|duration_time=0.033367|size=7108|pos=646657|flags=___ +packet|codec_type=video|stream_index=0|pts=69069|pts_time=2.302300|dts=69069|dts_time=2.302300|duration=1001|duration_time=0.033367|size=3250|pos=655299|flags=___ +packet|codec_type=video|stream_index=0|pts=71071|pts_time=2.369033|dts=70070|dts_time=2.335667|duration=1001|duration_time=0.033367|size=3365|pos=659310|flags=___ +packet|codec_type=video|stream_index=0|pts=73073|pts_time=2.435767|dts=71071|dts_time=2.369033|duration=1001|duration_time=0.033367|size=24803|pos=664201|flags=___ +packet|codec_type=video|stream_index=0|pts=77077|pts_time=2.569233|dts=72072|dts_time=2.402400|duration=1001|duration_time=0.033367|size=22185|pos=689763|flags=___ +packet|codec_type=video|stream_index=0|pts=75075|pts_time=2.502500|dts=73073|dts_time=2.435767|duration=1001|duration_time=0.033367|size=5088|pos=712679|flags=___ +packet|codec_type=video|stream_index=0|pts=74074|pts_time=2.469133|dts=74074|dts_time=2.469133|duration=1001|duration_time=0.033367|size=537|pos=719128|flags=___ +packet|codec_type=video|stream_index=0|pts=76076|pts_time=2.535867|dts=75075|dts_time=2.502500|duration=1001|duration_time=0.033367|size=3765|pos=720413|flags=___ +packet|codec_type=video|stream_index=0|pts=81081|pts_time=2.702700|dts=76076|dts_time=2.535867|duration=1001|duration_time=0.033367|size=20654|pos=725583|flags=___ +packet|codec_type=video|stream_index=0|pts=79079|pts_time=2.635967|dts=77077|dts_time=2.569233|duration=1001|duration_time=0.033367|size=10202|pos=746999|flags=___ +packet|codec_type=video|stream_index=0|pts=78078|pts_time=2.602600|dts=78078|dts_time=2.602600|duration=1001|duration_time=0.033367|size=3970|pos=758705|flags=___ +packet|codec_type=video|stream_index=0|pts=80080|pts_time=2.669333|dts=79079|dts_time=2.635967|duration=1001|duration_time=0.033367|size=421|pos=763442|flags=___ +packet|codec_type=video|stream_index=0|pts=84084|pts_time=2.802800|dts=80080|dts_time=2.669333|duration=1001|duration_time=0.033367|size=25685|pos=764653|flags=___ +packet|codec_type=video|stream_index=0|pts=82082|pts_time=2.736067|dts=81081|dts_time=2.702700|duration=1001|duration_time=0.033367|size=4077|pos=791911|flags=___ +packet|codec_type=video|stream_index=0|pts=83083|pts_time=2.769433|dts=82082|dts_time=2.736067|duration=1001|duration_time=0.033367|size=3049|pos=796780|flags=___ +packet|codec_type=video|stream_index=0|pts=88088|pts_time=2.936267|dts=83083|dts_time=2.769433|duration=1001|duration_time=0.033367|size=8924|pos=801473|flags=___ +packet|codec_type=video|stream_index=0|pts=86086|pts_time=2.869533|dts=84084|dts_time=2.802800|duration=1001|duration_time=0.033367|size=2512|pos=811078|flags=___ +packet|codec_type=video|stream_index=0|pts=85085|pts_time=2.836167|dts=85085|dts_time=2.836167|duration=1001|duration_time=0.033367|size=163|pos=815033|flags=___ +packet|codec_type=video|stream_index=0|pts=87087|pts_time=2.902900|dts=86086|dts_time=2.869533|duration=1001|duration_time=0.033367|size=1734|pos=815934|flags=___ +packet|codec_type=video|stream_index=0|pts=90090|pts_time=3.003000|dts=87087|dts_time=2.902900|duration=1001|duration_time=0.033367|size=11505|pos=819088|flags=___ +packet|codec_type=video|stream_index=0|pts=89089|pts_time=2.969633|dts=88088|dts_time=2.936267|duration=1001|duration_time=0.033367|size=1431|pos=831367|flags=___ +packet|codec_type=video|stream_index=0|pts=92092|pts_time=3.069733|dts=89089|dts_time=2.969633|duration=1001|duration_time=0.033367|size=5269|pos=833580|flags=___ +packet|codec_type=video|stream_index=0|pts=91091|pts_time=3.036367|dts=90090|dts_time=3.003000|duration=1001|duration_time=0.033367|size=199|pos=840352|flags=___ +packet|codec_type=video|stream_index=0|pts=93093|pts_time=3.103100|dts=91091|dts_time=3.036367|duration=1001|duration_time=0.033367|size=85650|pos=841722|flags=K__ +packet|codec_type=video|stream_index=0|pts=95095|pts_time=3.169833|dts=92092|dts_time=3.069733|duration=1001|duration_time=0.033367|size=13261|pos=928747|flags=___ +packet|codec_type=video|stream_index=0|pts=94094|pts_time=3.136467|dts=93093|dts_time=3.103100|duration=1001|duration_time=0.033367|size=1667|pos=942741|flags=___ +packet|codec_type=video|stream_index=0|pts=99099|pts_time=3.303300|dts=94094|dts_time=3.136467|duration=1001|duration_time=0.033367|size=20143|pos=945841|flags=___ +packet|codec_type=video|stream_index=0|pts=97097|pts_time=3.236567|dts=95095|dts_time=3.169833|duration=1001|duration_time=0.033367|size=2484|pos=966681|flags=___ +packet|codec_type=video|stream_index=0|pts=96096|pts_time=3.203200|dts=96096|dts_time=3.203200|duration=1001|duration_time=0.033367|size=278|pos=969887|flags=___ +packet|codec_type=video|stream_index=0|pts=98098|pts_time=3.269933|dts=97097|dts_time=3.236567|duration=1001|duration_time=0.033367|size=1539|pos=971696|flags=___ +packet|codec_type=video|stream_index=0|pts=101101|pts_time=3.370033|dts=98098|dts_time=3.269933|duration=1001|duration_time=0.033367|size=20270|pos=974088|flags=___ +packet|codec_type=video|stream_index=0|pts=100100|pts_time=3.336667|dts=99099|dts_time=3.303300|duration=1001|duration_time=0.033367|size=1754|pos=995975|flags=___ +packet|codec_type=video|stream_index=0|pts=105105|pts_time=3.503500|dts=100100|dts_time=3.336667|duration=1001|duration_time=0.033367|size=19154|pos=998420|flags=___ +packet|codec_type=video|stream_index=0|pts=103103|pts_time=3.436767|dts=101101|dts_time=3.370033|duration=1001|duration_time=0.033367|size=3359|pos=1019010|flags=___ +packet|codec_type=video|stream_index=0|pts=102102|pts_time=3.403400|dts=102102|dts_time=3.403400|duration=1001|duration_time=0.033367|size=287|pos=1023138|flags=___ +packet|codec_type=video|stream_index=0|pts=104104|pts_time=3.470133|dts=103103|dts_time=3.436767|duration=1001|duration_time=0.033367|size=2111|pos=1024928|flags=___ +packet|codec_type=video|stream_index=0|pts=109109|pts_time=3.636967|dts=104104|dts_time=3.470133|duration=1001|duration_time=0.033367|size=17178|pos=1027833|flags=___ +packet|codec_type=video|stream_index=0|pts=107107|pts_time=3.570233|dts=105105|dts_time=3.503500|duration=1001|duration_time=0.033367|size=7205|pos=1045716|flags=___ +packet|codec_type=video|stream_index=0|pts=106106|pts_time=3.536867|dts=106106|dts_time=3.536867|duration=1001|duration_time=0.033367|size=2209|pos=1054354|flags=___ +packet|codec_type=video|stream_index=0|pts=108108|pts_time=3.603600|dts=107107|dts_time=3.570233|duration=1001|duration_time=0.033367|size=359|pos=1057226|flags=___ +packet|codec_type=video|stream_index=0|pts=113113|pts_time=3.770433|dts=108108|dts_time=3.603600|duration=1001|duration_time=0.033367|size=18469|pos=1059024|flags=___ +packet|codec_type=video|stream_index=0|pts=111111|pts_time=3.703700|dts=109109|dts_time=3.636967|duration=1001|duration_time=0.033367|size=3314|pos=1078213|flags=___ +packet|codec_type=video|stream_index=0|pts=110110|pts_time=3.670333|dts=110110|dts_time=3.670333|duration=1001|duration_time=0.033367|size=2556|pos=1083059|flags=___ +packet|codec_type=video|stream_index=0|pts=112112|pts_time=3.737067|dts=111111|dts_time=3.703700|duration=1001|duration_time=0.033367|size=437|pos=1086388|flags=___ +packet|codec_type=video|stream_index=0|pts=117117|pts_time=3.903900|dts=112112|dts_time=3.737067|duration=1001|duration_time=0.033367|size=19707|pos=1087610|flags=___ +packet|codec_type=video|stream_index=0|pts=115115|pts_time=3.837167|dts=113113|dts_time=3.770433|duration=1001|duration_time=0.033367|size=5917|pos=1108845|flags=___ +packet|codec_type=video|stream_index=0|pts=114114|pts_time=3.803800|dts=114114|dts_time=3.803800|duration=1001|duration_time=0.033367|size=2613|pos=1115495|flags=___ +packet|codec_type=video|stream_index=0|pts=116116|pts_time=3.870533|dts=115115|dts_time=3.837167|duration=1001|duration_time=0.033367|size=2672|pos=1119530|flags=___ +packet|codec_type=video|stream_index=0|pts=121121|pts_time=4.037367|dts=116116|dts_time=3.870533|duration=1001|duration_time=0.033367|size=19091|pos=1122970|flags=_D_ +packet|codec_type=video|stream_index=0|pts=119119|pts_time=3.970633|dts=117117|dts_time=3.903900|duration=1001|duration_time=0.033367|size=9244|pos=1143585|flags=___ +packet|codec_type=video|stream_index=0|pts=118118|pts_time=3.937267|dts=118118|dts_time=3.937267|duration=1001|duration_time=0.033367|size=284|pos=1153587|flags=___ +packet|codec_type=video|stream_index=0|pts=120120|pts_time=4.004000|dts=119119|dts_time=3.970633|duration=1001|duration_time=0.033367|size=2381|pos=1155393|flags=_D_ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-chapters mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-chapters --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-chapters 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-chapters 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -1fd844c2f5bf77c3344e88e30ad994e1 *tests/data/fate/mov-mp4-chapters.mp4 +7b6aaa99c86fa1f5abfc9f242abcfffa *tests/data/fate/mov-mp4-chapters.mp4 111248 tests/data/fate/mov-mp4-chapters.mp4 #extradata 0: 3469, 0xc6769ddc #tb 0: 1/44100 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-extended-atom mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-extended-atom --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-extended-atom 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-extended-atom 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1001|duration_time=0.033367|size=14798|pos=16|flags=K_ +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1001|duration_time=0.033367|size=14798|pos=16|flags=K__ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-dfxp mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-dfxp --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-dfxp 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-dfxp 2023-03-03 13:29:59.000000000 +0000 @@ -17,7 +17,7 @@ "duration_time": "68.500000", "size": "7866", "pos": "44", - "flags": "K_" + "flags": "K__" } ], "programs": [ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-stpp mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-stpp --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-stpp 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-mp4-ttml-stpp 2023-03-03 13:29:59.000000000 +0000 @@ -17,7 +17,7 @@ "duration_time": "68.500000", "size": "7866", "pos": "44", - "flags": "K_" + "flags": "K__" } ], "programs": [ diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-zombie mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-zombie --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-zombie 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mov-zombie 2023-03-03 13:29:59.000000000 +0000 @@ -1,197 +1,197 @@ -packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-3004|dts_time=-0.033378|duration=3003|duration_time=0.033367|size=4133|pos=11309|flags=K_ -packet|codec_type=video|stream_index=0|pts=5440|pts_time=0.060444|dts=-567|dts_time=-0.006300|duration=3003|duration_time=0.033367|size=1077|pos=15442|flags=__ -frame|media_type=video|stream_index=0|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=-567|pkt_dts_time=-0.006300|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=11309|pkt_size=4133|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=-3004|dts_time=-0.033378|duration=3003|duration_time=0.033367|size=4133|pos=11309|flags=K__ +packet|codec_type=video|stream_index=0|pts=5440|pts_time=0.060444|dts=-567|dts_time=-0.006300|duration=3003|duration_time=0.033367|size=1077|pos=15442|flags=___ +frame|media_type=video|stream_index=0|key_frame=1|pts=0|pts_time=0.000000|pkt_dts=-567|pkt_dts_time=-0.006300|best_effort_timestamp=0|best_effort_timestamp_time=0.000000|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=11309|pkt_size=4133|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=2437|pts_time=0.027078|dts=2436|dts_time=0.027067|duration=3003|duration_time=0.033367|size=355|pos=16519|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=2437|pts_time=0.027078|pkt_dts=2436|pkt_dts_time=0.027067|best_effort_timestamp=2437|best_effort_timestamp_time=0.027078|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=16519|pkt_size=355|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=2|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=2437|pts_time=0.027078|dts=2436|dts_time=0.027067|duration=3003|duration_time=0.033367|size=355|pos=16519|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=2437|pts_time=0.027078|pkt_dts=2436|pkt_dts_time=0.027067|best_effort_timestamp=2437|best_effort_timestamp_time=0.027078|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=16519|pkt_size=355|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=2|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=11446|pts_time=0.127178|dts=5439|dts_time=0.060433|duration=3003|duration_time=0.033367|size=1110|pos=16874|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=5440|pts_time=0.060444|pkt_dts=5439|pkt_dts_time=0.060433|best_effort_timestamp=5440|best_effort_timestamp_time=0.060444|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=15442|pkt_size=1077|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=1|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=11446|pts_time=0.127178|dts=5439|dts_time=0.060433|duration=3003|duration_time=0.033367|size=1110|pos=16874|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=5440|pts_time=0.060444|pkt_dts=5439|pkt_dts_time=0.060433|best_effort_timestamp=5440|best_effort_timestamp_time=0.060444|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=15442|pkt_size=1077|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=1|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=8443|pts_time=0.093811|dts=8442|dts_time=0.093800|duration=3003|duration_time=0.033367|size=430|pos=17984|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=8443|pts_time=0.093811|pkt_dts=8442|pkt_dts_time=0.093800|best_effort_timestamp=8443|best_effort_timestamp_time=0.093811|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=17984|pkt_size=430|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=4|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=8443|pts_time=0.093811|dts=8442|dts_time=0.093800|duration=3003|duration_time=0.033367|size=430|pos=17984|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=8443|pts_time=0.093811|pkt_dts=8442|pkt_dts_time=0.093800|best_effort_timestamp=8443|best_effort_timestamp_time=0.093811|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=17984|pkt_size=430|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=4|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=17452|pts_time=0.193911|dts=11445|dts_time=0.127167|duration=3003|duration_time=0.033367|size=1485|pos=18414|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=11446|pts_time=0.127178|pkt_dts=11445|pkt_dts_time=0.127167|best_effort_timestamp=11446|best_effort_timestamp_time=0.127178|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=16874|pkt_size=1110|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=3|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=17452|pts_time=0.193911|dts=11445|dts_time=0.127167|duration=3003|duration_time=0.033367|size=1485|pos=18414|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=11446|pts_time=0.127178|pkt_dts=11445|pkt_dts_time=0.127167|best_effort_timestamp=11446|best_effort_timestamp_time=0.127178|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=16874|pkt_size=1110|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=3|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=14449|pts_time=0.160544|dts=14448|dts_time=0.160533|duration=3003|duration_time=0.033367|size=1005|pos=19899|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=14449|pts_time=0.160544|pkt_dts=14448|pkt_dts_time=0.160533|best_effort_timestamp=14449|best_effort_timestamp_time=0.160544|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=19899|pkt_size=1005|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=6|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=14449|pts_time=0.160544|dts=14448|dts_time=0.160533|duration=3003|duration_time=0.033367|size=1005|pos=19899|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=14449|pts_time=0.160544|pkt_dts=14448|pkt_dts_time=0.160533|best_effort_timestamp=14449|best_effort_timestamp_time=0.160544|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=19899|pkt_size=1005|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=6|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=23458|pts_time=0.260644|dts=17451|dts_time=0.193900|duration=3003|duration_time=0.033367|size=1976|pos=20904|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=17452|pts_time=0.193911|pkt_dts=17451|pkt_dts_time=0.193900|best_effort_timestamp=17452|best_effort_timestamp_time=0.193911|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=18414|pkt_size=1485|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=5|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=23458|pts_time=0.260644|dts=17451|dts_time=0.193900|duration=3003|duration_time=0.033367|size=1976|pos=20904|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=17452|pts_time=0.193911|pkt_dts=17451|pkt_dts_time=0.193900|best_effort_timestamp=17452|best_effort_timestamp_time=0.193911|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=18414|pkt_size=1485|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=5|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=20455|pts_time=0.227278|dts=20454|dts_time=0.227267|duration=3003|duration_time=0.033367|size=904|pos=22880|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=20455|pts_time=0.227278|pkt_dts=20454|pkt_dts_time=0.227267|best_effort_timestamp=20455|best_effort_timestamp_time=0.227278|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=22880|pkt_size=904|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=8|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=20455|pts_time=0.227278|dts=20454|dts_time=0.227267|duration=3003|duration_time=0.033367|size=904|pos=22880|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=20455|pts_time=0.227278|pkt_dts=20454|pkt_dts_time=0.227267|best_effort_timestamp=20455|best_effort_timestamp_time=0.227278|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=22880|pkt_size=904|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=8|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=29464|pts_time=0.327378|dts=23457|dts_time=0.260633|duration=3003|duration_time=0.033367|size=1254|pos=23784|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=23458|pts_time=0.260644|pkt_dts=23457|pkt_dts_time=0.260633|best_effort_timestamp=23458|best_effort_timestamp_time=0.260644|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=20904|pkt_size=1976|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=7|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=29464|pts_time=0.327378|dts=23457|dts_time=0.260633|duration=3003|duration_time=0.033367|size=1254|pos=23784|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=23458|pts_time=0.260644|pkt_dts=23457|pkt_dts_time=0.260633|best_effort_timestamp=23458|best_effort_timestamp_time=0.260644|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=20904|pkt_size=1976|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=7|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=26461|pts_time=0.294011|dts=26460|dts_time=0.294000|duration=3003|duration_time=0.033367|size=700|pos=25038|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=26461|pts_time=0.294011|pkt_dts=26460|pkt_dts_time=0.294000|best_effort_timestamp=26461|best_effort_timestamp_time=0.294011|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=25038|pkt_size=700|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=10|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=26461|pts_time=0.294011|dts=26460|dts_time=0.294000|duration=3003|duration_time=0.033367|size=700|pos=25038|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=26461|pts_time=0.294011|pkt_dts=26460|pkt_dts_time=0.294000|best_effort_timestamp=26461|best_effort_timestamp_time=0.294011|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=25038|pkt_size=700|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=10|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=35470|pts_time=0.394111|dts=29463|dts_time=0.327367|duration=3003|duration_time=0.033367|size=1311|pos=25738|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=29464|pts_time=0.327378|pkt_dts=29463|pkt_dts_time=0.327367|best_effort_timestamp=29464|best_effort_timestamp_time=0.327378|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=23784|pkt_size=1254|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=9|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=35470|pts_time=0.394111|dts=29463|dts_time=0.327367|duration=3003|duration_time=0.033367|size=1311|pos=25738|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=29464|pts_time=0.327378|pkt_dts=29463|pkt_dts_time=0.327367|best_effort_timestamp=29464|best_effort_timestamp_time=0.327378|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=23784|pkt_size=1254|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=9|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=32467|pts_time=0.360744|dts=32466|dts_time=0.360733|duration=3003|duration_time=0.033367|size=631|pos=27049|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=32467|pts_time=0.360744|pkt_dts=32466|pkt_dts_time=0.360733|best_effort_timestamp=32467|best_effort_timestamp_time=0.360744|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=27049|pkt_size=631|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=12|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=32467|pts_time=0.360744|dts=32466|dts_time=0.360733|duration=3003|duration_time=0.033367|size=631|pos=27049|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=32467|pts_time=0.360744|pkt_dts=32466|pkt_dts_time=0.360733|best_effort_timestamp=32467|best_effort_timestamp_time=0.360744|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=27049|pkt_size=631|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=12|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=41476|pts_time=0.460844|dts=35469|dts_time=0.394100|duration=3003|duration_time=0.033367|size=1296|pos=27680|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=35470|pts_time=0.394111|pkt_dts=35469|pkt_dts_time=0.394100|best_effort_timestamp=35470|best_effort_timestamp_time=0.394111|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=25738|pkt_size=1311|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=11|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=41476|pts_time=0.460844|dts=35469|dts_time=0.394100|duration=3003|duration_time=0.033367|size=1296|pos=27680|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=35470|pts_time=0.394111|pkt_dts=35469|pkt_dts_time=0.394100|best_effort_timestamp=35470|best_effort_timestamp_time=0.394111|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=25738|pkt_size=1311|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=11|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=38473|pts_time=0.427478|dts=38472|dts_time=0.427467|duration=3003|duration_time=0.033367|size=466|pos=28976|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=38473|pts_time=0.427478|pkt_dts=38472|pkt_dts_time=0.427467|best_effort_timestamp=38473|best_effort_timestamp_time=0.427478|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=28976|pkt_size=466|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=14|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=38473|pts_time=0.427478|dts=38472|dts_time=0.427467|duration=3003|duration_time=0.033367|size=466|pos=28976|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=38473|pts_time=0.427478|pkt_dts=38472|pkt_dts_time=0.427467|best_effort_timestamp=38473|best_effort_timestamp_time=0.427478|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=28976|pkt_size=466|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=14|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=47482|pts_time=0.527578|dts=41475|dts_time=0.460833|duration=3003|duration_time=0.033367|size=1638|pos=29442|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=41476|pts_time=0.460844|pkt_dts=41475|pkt_dts_time=0.460833|best_effort_timestamp=41476|best_effort_timestamp_time=0.460844|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=27680|pkt_size=1296|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=13|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=47482|pts_time=0.527578|dts=41475|dts_time=0.460833|duration=3003|duration_time=0.033367|size=1638|pos=29442|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=41476|pts_time=0.460844|pkt_dts=41475|pkt_dts_time=0.460833|best_effort_timestamp=41476|best_effort_timestamp_time=0.460844|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=27680|pkt_size=1296|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=13|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=44479|pts_time=0.494211|dts=44478|dts_time=0.494200|duration=3003|duration_time=0.033367|size=907|pos=31080|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=44479|pts_time=0.494211|pkt_dts=44478|pkt_dts_time=0.494200|best_effort_timestamp=44479|best_effort_timestamp_time=0.494211|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=31080|pkt_size=907|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=16|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=44479|pts_time=0.494211|dts=44478|dts_time=0.494200|duration=3003|duration_time=0.033367|size=907|pos=31080|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=44479|pts_time=0.494211|pkt_dts=44478|pkt_dts_time=0.494200|best_effort_timestamp=44479|best_effort_timestamp_time=0.494211|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=31080|pkt_size=907|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=16|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=53488|pts_time=0.594311|dts=47481|dts_time=0.527567|duration=3003|duration_time=0.033367|size=1362|pos=31987|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=47482|pts_time=0.527578|pkt_dts=47481|pkt_dts_time=0.527567|best_effort_timestamp=47482|best_effort_timestamp_time=0.527578|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=29442|pkt_size=1638|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=15|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=53488|pts_time=0.594311|dts=47481|dts_time=0.527567|duration=3003|duration_time=0.033367|size=1362|pos=31987|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=47482|pts_time=0.527578|pkt_dts=47481|pkt_dts_time=0.527567|best_effort_timestamp=47482|best_effort_timestamp_time=0.527578|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=29442|pkt_size=1638|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=15|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=50485|pts_time=0.560944|dts=50484|dts_time=0.560933|duration=3003|duration_time=0.033367|size=682|pos=33349|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=50485|pts_time=0.560944|pkt_dts=50484|pkt_dts_time=0.560933|best_effort_timestamp=50485|best_effort_timestamp_time=0.560944|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=33349|pkt_size=682|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=18|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=50485|pts_time=0.560944|dts=50484|dts_time=0.560933|duration=3003|duration_time=0.033367|size=682|pos=33349|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=50485|pts_time=0.560944|pkt_dts=50484|pkt_dts_time=0.560933|best_effort_timestamp=50485|best_effort_timestamp_time=0.560944|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=33349|pkt_size=682|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=18|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=59494|pts_time=0.661044|dts=53487|dts_time=0.594300|duration=3003|duration_time=0.033367|size=2917|pos=34031|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=53488|pts_time=0.594311|pkt_dts=53487|pkt_dts_time=0.594300|best_effort_timestamp=53488|best_effort_timestamp_time=0.594311|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=31987|pkt_size=1362|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=17|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=59494|pts_time=0.661044|dts=53487|dts_time=0.594300|duration=3003|duration_time=0.033367|size=2917|pos=34031|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=53488|pts_time=0.594311|pkt_dts=53487|pkt_dts_time=0.594300|best_effort_timestamp=53488|best_effort_timestamp_time=0.594311|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=31987|pkt_size=1362|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=17|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=56491|pts_time=0.627678|dts=56490|dts_time=0.627667|duration=3003|duration_time=0.033367|size=1174|pos=36948|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=56491|pts_time=0.627678|pkt_dts=56490|pkt_dts_time=0.627667|best_effort_timestamp=56491|best_effort_timestamp_time=0.627678|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=36948|pkt_size=1174|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=20|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=56491|pts_time=0.627678|dts=56490|dts_time=0.627667|duration=3003|duration_time=0.033367|size=1174|pos=36948|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=56491|pts_time=0.627678|pkt_dts=56490|pkt_dts_time=0.627667|best_effort_timestamp=56491|best_effort_timestamp_time=0.627678|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=36948|pkt_size=1174|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=20|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=65500|pts_time=0.727778|dts=59493|dts_time=0.661033|duration=3003|duration_time=0.033367|size=1748|pos=38122|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=59494|pts_time=0.661044|pkt_dts=59493|pkt_dts_time=0.661033|best_effort_timestamp=59494|best_effort_timestamp_time=0.661044|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=34031|pkt_size=2917|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=19|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=65500|pts_time=0.727778|dts=59493|dts_time=0.661033|duration=3003|duration_time=0.033367|size=1748|pos=38122|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=59494|pts_time=0.661044|pkt_dts=59493|pkt_dts_time=0.661033|best_effort_timestamp=59494|best_effort_timestamp_time=0.661044|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=34031|pkt_size=2917|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=19|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=62497|pts_time=0.694411|dts=62496|dts_time=0.694400|duration=3003|duration_time=0.033367|size=926|pos=39870|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=62497|pts_time=0.694411|pkt_dts=62496|pkt_dts_time=0.694400|best_effort_timestamp=62497|best_effort_timestamp_time=0.694411|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=39870|pkt_size=926|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=22|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=62497|pts_time=0.694411|dts=62496|dts_time=0.694400|duration=3003|duration_time=0.033367|size=926|pos=39870|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=62497|pts_time=0.694411|pkt_dts=62496|pkt_dts_time=0.694400|best_effort_timestamp=62497|best_effort_timestamp_time=0.694411|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=39870|pkt_size=926|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=22|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=68503|pts_time=0.761144|dts=65499|dts_time=0.727767|duration=3003|duration_time=0.033367|size=918|pos=40796|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=65500|pts_time=0.727778|pkt_dts=65499|pkt_dts_time=0.727767|best_effort_timestamp=65500|best_effort_timestamp_time=0.727778|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=38122|pkt_size=1748|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=21|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=68503|pts_time=0.761144|dts=65499|dts_time=0.727767|duration=3003|duration_time=0.033367|size=918|pos=40796|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=65500|pts_time=0.727778|pkt_dts=65499|pkt_dts_time=0.727767|best_effort_timestamp=65500|best_effort_timestamp_time=0.727778|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=38122|pkt_size=1748|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=21|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=71506|pts_time=0.794511|dts=68502|dts_time=0.761133|duration=3003|duration_time=0.033367|size=3846|pos=41714|flags=K_ -frame|media_type=video|stream_index=0|key_frame=0|pts=68503|pts_time=0.761144|pkt_dts=68502|pkt_dts_time=0.761133|best_effort_timestamp=68503|best_effort_timestamp_time=0.761144|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=40796|pkt_size=918|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=23|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=71506|pts_time=0.794511|dts=68502|dts_time=0.761133|duration=3003|duration_time=0.033367|size=3846|pos=41714|flags=K__ +frame|media_type=video|stream_index=0|key_frame=0|pts=68503|pts_time=0.761144|pkt_dts=68502|pkt_dts_time=0.761133|best_effort_timestamp=68503|best_effort_timestamp_time=0.761144|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=40796|pkt_size=918|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=23|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=77512|pts_time=0.861244|dts=71505|dts_time=0.794500|duration=3003|duration_time=0.033367|size=1932|pos=45560|flags=__ -frame|media_type=video|stream_index=0|key_frame=1|pts=71506|pts_time=0.794511|pkt_dts=71505|pkt_dts_time=0.794500|best_effort_timestamp=71506|best_effort_timestamp_time=0.794511|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=41714|pkt_size=3846|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=24|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=77512|pts_time=0.861244|dts=71505|dts_time=0.794500|duration=3003|duration_time=0.033367|size=1932|pos=45560|flags=___ +frame|media_type=video|stream_index=0|key_frame=1|pts=71506|pts_time=0.794511|pkt_dts=71505|pkt_dts_time=0.794500|best_effort_timestamp=71506|best_effort_timestamp_time=0.794511|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=41714|pkt_size=3846|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=24|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=74509|pts_time=0.827878|dts=74508|dts_time=0.827867|duration=3003|duration_time=0.033367|size=1159|pos=47492|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=74509|pts_time=0.827878|pkt_dts=74508|pkt_dts_time=0.827867|best_effort_timestamp=74509|best_effort_timestamp_time=0.827878|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=47492|pkt_size=1159|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=26|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=74509|pts_time=0.827878|dts=74508|dts_time=0.827867|duration=3003|duration_time=0.033367|size=1159|pos=47492|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=74509|pts_time=0.827878|pkt_dts=74508|pkt_dts_time=0.827867|best_effort_timestamp=74509|best_effort_timestamp_time=0.827878|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=47492|pkt_size=1159|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=26|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=83518|pts_time=0.927978|dts=77511|dts_time=0.861233|duration=3003|duration_time=0.033367|size=1522|pos=48651|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=77512|pts_time=0.861244|pkt_dts=77511|pkt_dts_time=0.861233|best_effort_timestamp=77512|best_effort_timestamp_time=0.861244|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=45560|pkt_size=1932|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=25|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=83518|pts_time=0.927978|dts=77511|dts_time=0.861233|duration=3003|duration_time=0.033367|size=1522|pos=48651|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=77512|pts_time=0.861244|pkt_dts=77511|pkt_dts_time=0.861233|best_effort_timestamp=77512|best_effort_timestamp_time=0.861244|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=45560|pkt_size=1932|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=25|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=80515|pts_time=0.894611|dts=80514|dts_time=0.894600|duration=3003|duration_time=0.033367|size=719|pos=50173|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=80515|pts_time=0.894611|pkt_dts=80514|pkt_dts_time=0.894600|best_effort_timestamp=80515|best_effort_timestamp_time=0.894611|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=50173|pkt_size=719|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=28|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=80515|pts_time=0.894611|dts=80514|dts_time=0.894600|duration=3003|duration_time=0.033367|size=719|pos=50173|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=80515|pts_time=0.894611|pkt_dts=80514|pkt_dts_time=0.894600|best_effort_timestamp=80515|best_effort_timestamp_time=0.894611|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=50173|pkt_size=719|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=28|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=89524|pts_time=0.994711|dts=83517|dts_time=0.927967|duration=3003|duration_time=0.033367|size=1700|pos=50892|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=83518|pts_time=0.927978|pkt_dts=83517|pkt_dts_time=0.927967|best_effort_timestamp=83518|best_effort_timestamp_time=0.927978|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=48651|pkt_size=1522|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=27|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=89524|pts_time=0.994711|dts=83517|dts_time=0.927967|duration=3003|duration_time=0.033367|size=1700|pos=50892|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=83518|pts_time=0.927978|pkt_dts=83517|pkt_dts_time=0.927967|best_effort_timestamp=83518|best_effort_timestamp_time=0.927978|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=48651|pkt_size=1522|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=27|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=86521|pts_time=0.961344|dts=86520|dts_time=0.961333|duration=3003|duration_time=0.033367|size=1099|pos=52592|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=86521|pts_time=0.961344|pkt_dts=86520|pkt_dts_time=0.961333|best_effort_timestamp=86521|best_effort_timestamp_time=0.961344|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=52592|pkt_size=1099|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=30|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=86521|pts_time=0.961344|dts=86520|dts_time=0.961333|duration=3003|duration_time=0.033367|size=1099|pos=52592|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=86521|pts_time=0.961344|pkt_dts=86520|pkt_dts_time=0.961333|best_effort_timestamp=86521|best_effort_timestamp_time=0.961344|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=52592|pkt_size=1099|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=30|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=95530|pts_time=1.061444|dts=89523|dts_time=0.994700|duration=3003|duration_time=0.033367|size=2558|pos=53691|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=89524|pts_time=0.994711|pkt_dts=89523|pkt_dts_time=0.994700|best_effort_timestamp=89524|best_effort_timestamp_time=0.994711|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=50892|pkt_size=1700|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=29|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=95530|pts_time=1.061444|dts=89523|dts_time=0.994700|duration=3003|duration_time=0.033367|size=2558|pos=53691|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=89524|pts_time=0.994711|pkt_dts=89523|pkt_dts_time=0.994700|best_effort_timestamp=89524|best_effort_timestamp_time=0.994711|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=50892|pkt_size=1700|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=29|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=92527|pts_time=1.028078|dts=92526|dts_time=1.028067|duration=3003|duration_time=0.033367|size=1008|pos=56249|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=92527|pts_time=1.028078|pkt_dts=92526|pkt_dts_time=1.028067|best_effort_timestamp=92527|best_effort_timestamp_time=1.028078|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=56249|pkt_size=1008|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=32|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=92527|pts_time=1.028078|dts=92526|dts_time=1.028067|duration=3003|duration_time=0.033367|size=1008|pos=56249|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=92527|pts_time=1.028078|pkt_dts=92526|pkt_dts_time=1.028067|best_effort_timestamp=92527|best_effort_timestamp_time=1.028078|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=56249|pkt_size=1008|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=32|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=101536|pts_time=1.128178|dts=95529|dts_time=1.061433|duration=3003|duration_time=0.033367|size=1236|pos=57257|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=95530|pts_time=1.061444|pkt_dts=95529|pkt_dts_time=1.061433|best_effort_timestamp=95530|best_effort_timestamp_time=1.061444|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=53691|pkt_size=2558|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=31|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=101536|pts_time=1.128178|dts=95529|dts_time=1.061433|duration=3003|duration_time=0.033367|size=1236|pos=57257|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=95530|pts_time=1.061444|pkt_dts=95529|pkt_dts_time=1.061433|best_effort_timestamp=95530|best_effort_timestamp_time=1.061444|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=53691|pkt_size=2558|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=31|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=98533|pts_time=1.094811|dts=98532|dts_time=1.094800|duration=3003|duration_time=0.033367|size=607|pos=58493|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=98533|pts_time=1.094811|pkt_dts=98532|pkt_dts_time=1.094800|best_effort_timestamp=98533|best_effort_timestamp_time=1.094811|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=58493|pkt_size=607|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=34|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=98533|pts_time=1.094811|dts=98532|dts_time=1.094800|duration=3003|duration_time=0.033367|size=607|pos=58493|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=98533|pts_time=1.094811|pkt_dts=98532|pkt_dts_time=1.094800|best_effort_timestamp=98533|best_effort_timestamp_time=1.094811|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=58493|pkt_size=607|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=34|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=107542|pts_time=1.194911|dts=101535|dts_time=1.128167|duration=3003|duration_time=0.033367|size=1883|pos=59100|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=101536|pts_time=1.128178|pkt_dts=101535|pkt_dts_time=1.128167|best_effort_timestamp=101536|best_effort_timestamp_time=1.128178|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=57257|pkt_size=1236|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=33|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=107542|pts_time=1.194911|dts=101535|dts_time=1.128167|duration=3003|duration_time=0.033367|size=1883|pos=59100|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=101536|pts_time=1.128178|pkt_dts=101535|pkt_dts_time=1.128167|best_effort_timestamp=101536|best_effort_timestamp_time=1.128178|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=57257|pkt_size=1236|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=33|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=104539|pts_time=1.161544|dts=104538|dts_time=1.161533|duration=3003|duration_time=0.033367|size=893|pos=60983|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=104539|pts_time=1.161544|pkt_dts=104538|pkt_dts_time=1.161533|best_effort_timestamp=104539|best_effort_timestamp_time=1.161544|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=60983|pkt_size=893|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=36|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=104539|pts_time=1.161544|dts=104538|dts_time=1.161533|duration=3003|duration_time=0.033367|size=893|pos=60983|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=104539|pts_time=1.161544|pkt_dts=104538|pkt_dts_time=1.161533|best_effort_timestamp=104539|best_effort_timestamp_time=1.161544|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=60983|pkt_size=893|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=36|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=113548|pts_time=1.261644|dts=107541|dts_time=1.194900|duration=3003|duration_time=0.033367|size=1305|pos=61876|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=107542|pts_time=1.194911|pkt_dts=107541|pkt_dts_time=1.194900|best_effort_timestamp=107542|best_effort_timestamp_time=1.194911|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=59100|pkt_size=1883|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=35|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=113548|pts_time=1.261644|dts=107541|dts_time=1.194900|duration=3003|duration_time=0.033367|size=1305|pos=61876|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=107542|pts_time=1.194911|pkt_dts=107541|pkt_dts_time=1.194900|best_effort_timestamp=107542|best_effort_timestamp_time=1.194911|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=59100|pkt_size=1883|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=35|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=110545|pts_time=1.228278|dts=110544|dts_time=1.228267|duration=3003|duration_time=0.033367|size=472|pos=63181|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=110545|pts_time=1.228278|pkt_dts=110544|pkt_dts_time=1.228267|best_effort_timestamp=110545|best_effort_timestamp_time=1.228278|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=63181|pkt_size=472|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=38|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=110545|pts_time=1.228278|dts=110544|dts_time=1.228267|duration=3003|duration_time=0.033367|size=472|pos=63181|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=110545|pts_time=1.228278|pkt_dts=110544|pkt_dts_time=1.228267|best_effort_timestamp=110545|best_effort_timestamp_time=1.228278|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=63181|pkt_size=472|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=38|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=119554|pts_time=1.328378|dts=113547|dts_time=1.261633|duration=3003|duration_time=0.033367|size=1411|pos=63653|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=113548|pts_time=1.261644|pkt_dts=113547|pkt_dts_time=1.261633|best_effort_timestamp=113548|best_effort_timestamp_time=1.261644|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=61876|pkt_size=1305|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=37|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=119554|pts_time=1.328378|dts=113547|dts_time=1.261633|duration=3003|duration_time=0.033367|size=1411|pos=63653|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=113548|pts_time=1.261644|pkt_dts=113547|pkt_dts_time=1.261633|best_effort_timestamp=113548|best_effort_timestamp_time=1.261644|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=61876|pkt_size=1305|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=37|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=116551|pts_time=1.295011|dts=116550|dts_time=1.295000|duration=3003|duration_time=0.033367|size=616|pos=65064|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=116551|pts_time=1.295011|pkt_dts=116550|pkt_dts_time=1.295000|best_effort_timestamp=116551|best_effort_timestamp_time=1.295011|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=65064|pkt_size=616|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=40|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=116551|pts_time=1.295011|dts=116550|dts_time=1.295000|duration=3003|duration_time=0.033367|size=616|pos=65064|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=116551|pts_time=1.295011|pkt_dts=116550|pkt_dts_time=1.295000|best_effort_timestamp=116551|best_effort_timestamp_time=1.295011|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=65064|pkt_size=616|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=40|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=125560|pts_time=1.395111|dts=119553|dts_time=1.328367|duration=3003|duration_time=0.033367|size=1291|pos=65680|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=119554|pts_time=1.328378|pkt_dts=119553|pkt_dts_time=1.328367|best_effort_timestamp=119554|best_effort_timestamp_time=1.328378|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=63653|pkt_size=1411|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=39|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=125560|pts_time=1.395111|dts=119553|dts_time=1.328367|duration=3003|duration_time=0.033367|size=1291|pos=65680|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=119554|pts_time=1.328378|pkt_dts=119553|pkt_dts_time=1.328367|best_effort_timestamp=119554|best_effort_timestamp_time=1.328378|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=63653|pkt_size=1411|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=39|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=122557|pts_time=1.361744|dts=122556|dts_time=1.361733|duration=3003|duration_time=0.033367|size=470|pos=66971|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=122557|pts_time=1.361744|pkt_dts=122556|pkt_dts_time=1.361733|best_effort_timestamp=122557|best_effort_timestamp_time=1.361744|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=66971|pkt_size=470|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=42|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=122557|pts_time=1.361744|dts=122556|dts_time=1.361733|duration=3003|duration_time=0.033367|size=470|pos=66971|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=122557|pts_time=1.361744|pkt_dts=122556|pkt_dts_time=1.361733|best_effort_timestamp=122557|best_effort_timestamp_time=1.361744|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=66971|pkt_size=470|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=42|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=131566|pts_time=1.461844|dts=125559|dts_time=1.395100|duration=3003|duration_time=0.033367|size=1977|pos=67441|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=125560|pts_time=1.395111|pkt_dts=125559|pkt_dts_time=1.395100|best_effort_timestamp=125560|best_effort_timestamp_time=1.395111|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=65680|pkt_size=1291|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=41|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=131566|pts_time=1.461844|dts=125559|dts_time=1.395100|duration=3003|duration_time=0.033367|size=1977|pos=67441|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=125560|pts_time=1.395111|pkt_dts=125559|pkt_dts_time=1.395100|best_effort_timestamp=125560|best_effort_timestamp_time=1.395111|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=65680|pkt_size=1291|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=41|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=128563|pts_time=1.428478|dts=128562|dts_time=1.428467|duration=3003|duration_time=0.033367|size=436|pos=69418|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=128563|pts_time=1.428478|pkt_dts=128562|pkt_dts_time=1.428467|best_effort_timestamp=128563|best_effort_timestamp_time=1.428478|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=69418|pkt_size=436|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=44|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=128563|pts_time=1.428478|dts=128562|dts_time=1.428467|duration=3003|duration_time=0.033367|size=436|pos=69418|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=128563|pts_time=1.428478|pkt_dts=128562|pkt_dts_time=1.428467|best_effort_timestamp=128563|best_effort_timestamp_time=1.428478|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=69418|pkt_size=436|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=44|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=137572|pts_time=1.528578|dts=131565|dts_time=1.461833|duration=3003|duration_time=0.033367|size=2566|pos=69854|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=131566|pts_time=1.461844|pkt_dts=131565|pkt_dts_time=1.461833|best_effort_timestamp=131566|best_effort_timestamp_time=1.461844|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=67441|pkt_size=1977|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=43|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=137572|pts_time=1.528578|dts=131565|dts_time=1.461833|duration=3003|duration_time=0.033367|size=2566|pos=69854|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=131566|pts_time=1.461844|pkt_dts=131565|pkt_dts_time=1.461833|best_effort_timestamp=131566|best_effort_timestamp_time=1.461844|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=67441|pkt_size=1977|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=43|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=134569|pts_time=1.495211|dts=134568|dts_time=1.495200|duration=3003|duration_time=0.033367|size=886|pos=72420|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=134569|pts_time=1.495211|pkt_dts=134568|pkt_dts_time=1.495200|best_effort_timestamp=134569|best_effort_timestamp_time=1.495211|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=72420|pkt_size=886|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=46|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=134569|pts_time=1.495211|dts=134568|dts_time=1.495200|duration=3003|duration_time=0.033367|size=886|pos=72420|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=134569|pts_time=1.495211|pkt_dts=134568|pkt_dts_time=1.495200|best_effort_timestamp=134569|best_effort_timestamp_time=1.495211|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=72420|pkt_size=886|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=46|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=140575|pts_time=1.561944|dts=137571|dts_time=1.528567|duration=3003|duration_time=0.033367|size=1330|pos=73306|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=137572|pts_time=1.528578|pkt_dts=137571|pkt_dts_time=1.528567|best_effort_timestamp=137572|best_effort_timestamp_time=1.528578|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=69854|pkt_size=2566|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=45|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=140575|pts_time=1.561944|dts=137571|dts_time=1.528567|duration=3003|duration_time=0.033367|size=1330|pos=73306|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=137572|pts_time=1.528578|pkt_dts=137571|pkt_dts_time=1.528567|best_effort_timestamp=137572|best_effort_timestamp_time=1.528578|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=69854|pkt_size=2566|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=45|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=143578|pts_time=1.595311|dts=140574|dts_time=1.561933|duration=3003|duration_time=0.033367|size=2227|pos=74636|flags=K_ -frame|media_type=video|stream_index=0|key_frame=0|pts=140575|pts_time=1.561944|pkt_dts=140574|pkt_dts_time=1.561933|best_effort_timestamp=140575|best_effort_timestamp_time=1.561944|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=73306|pkt_size=1330|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=47|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=143578|pts_time=1.595311|dts=140574|dts_time=1.561933|duration=3003|duration_time=0.033367|size=2227|pos=74636|flags=K__ +frame|media_type=video|stream_index=0|key_frame=0|pts=140575|pts_time=1.561944|pkt_dts=140574|pkt_dts_time=1.561933|best_effort_timestamp=140575|best_effort_timestamp_time=1.561944|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=73306|pkt_size=1330|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=47|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=149584|pts_time=1.662044|dts=143577|dts_time=1.595300|duration=3003|duration_time=0.033367|size=2210|pos=76863|flags=__ -frame|media_type=video|stream_index=0|key_frame=1|pts=143578|pts_time=1.595311|pkt_dts=143577|pkt_dts_time=1.595300|best_effort_timestamp=143578|best_effort_timestamp_time=1.595311|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=74636|pkt_size=2227|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=48|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=149584|pts_time=1.662044|dts=143577|dts_time=1.595300|duration=3003|duration_time=0.033367|size=2210|pos=76863|flags=___ +frame|media_type=video|stream_index=0|key_frame=1|pts=143578|pts_time=1.595311|pkt_dts=143577|pkt_dts_time=1.595300|best_effort_timestamp=143578|best_effort_timestamp_time=1.595311|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=74636|pkt_size=2227|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=48|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=146581|pts_time=1.628678|dts=146580|dts_time=1.628667|duration=3003|duration_time=0.033367|size=1498|pos=79073|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=146581|pts_time=1.628678|pkt_dts=146580|pkt_dts_time=1.628667|best_effort_timestamp=146581|best_effort_timestamp_time=1.628678|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=79073|pkt_size=1498|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=50|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=146581|pts_time=1.628678|dts=146580|dts_time=1.628667|duration=3003|duration_time=0.033367|size=1498|pos=79073|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=146581|pts_time=1.628678|pkt_dts=146580|pkt_dts_time=1.628667|best_effort_timestamp=146581|best_effort_timestamp_time=1.628678|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=79073|pkt_size=1498|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=50|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=155590|pts_time=1.728778|dts=149583|dts_time=1.662033|duration=3003|duration_time=0.033367|size=1721|pos=80571|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=149584|pts_time=1.662044|pkt_dts=149583|pkt_dts_time=1.662033|best_effort_timestamp=149584|best_effort_timestamp_time=1.662044|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=76863|pkt_size=2210|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=49|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=155590|pts_time=1.728778|dts=149583|dts_time=1.662033|duration=3003|duration_time=0.033367|size=1721|pos=80571|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=149584|pts_time=1.662044|pkt_dts=149583|pkt_dts_time=1.662033|best_effort_timestamp=149584|best_effort_timestamp_time=1.662044|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=76863|pkt_size=2210|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=49|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=152587|pts_time=1.695411|dts=152586|dts_time=1.695400|duration=3003|duration_time=0.033367|size=1238|pos=82292|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=152587|pts_time=1.695411|pkt_dts=152586|pkt_dts_time=1.695400|best_effort_timestamp=152587|best_effort_timestamp_time=1.695411|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=82292|pkt_size=1238|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=52|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=152587|pts_time=1.695411|dts=152586|dts_time=1.695400|duration=3003|duration_time=0.033367|size=1238|pos=82292|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=152587|pts_time=1.695411|pkt_dts=152586|pkt_dts_time=1.695400|best_effort_timestamp=152587|best_effort_timestamp_time=1.695411|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=82292|pkt_size=1238|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=52|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=161596|pts_time=1.795511|dts=155589|dts_time=1.728767|duration=3003|duration_time=0.033367|size=1753|pos=83530|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=155590|pts_time=1.728778|pkt_dts=155589|pkt_dts_time=1.728767|best_effort_timestamp=155590|best_effort_timestamp_time=1.728778|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=80571|pkt_size=1721|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=51|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=161596|pts_time=1.795511|dts=155589|dts_time=1.728767|duration=3003|duration_time=0.033367|size=1753|pos=83530|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=155590|pts_time=1.728778|pkt_dts=155589|pkt_dts_time=1.728767|best_effort_timestamp=155590|best_effort_timestamp_time=1.728778|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=80571|pkt_size=1721|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=51|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=158593|pts_time=1.762144|dts=158592|dts_time=1.762133|duration=3003|duration_time=0.033367|size=1014|pos=85283|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=158593|pts_time=1.762144|pkt_dts=158592|pkt_dts_time=1.762133|best_effort_timestamp=158593|best_effort_timestamp_time=1.762144|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=85283|pkt_size=1014|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=54|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=158593|pts_time=1.762144|dts=158592|dts_time=1.762133|duration=3003|duration_time=0.033367|size=1014|pos=85283|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=158593|pts_time=1.762144|pkt_dts=158592|pkt_dts_time=1.762133|best_effort_timestamp=158593|best_effort_timestamp_time=1.762144|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=85283|pkt_size=1014|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=54|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=167602|pts_time=1.862244|dts=161595|dts_time=1.795500|duration=3003|duration_time=0.033367|size=2408|pos=86297|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=161596|pts_time=1.795511|pkt_dts=161595|pkt_dts_time=1.795500|best_effort_timestamp=161596|best_effort_timestamp_time=1.795511|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=83530|pkt_size=1753|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=53|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=167602|pts_time=1.862244|dts=161595|dts_time=1.795500|duration=3003|duration_time=0.033367|size=2408|pos=86297|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=161596|pts_time=1.795511|pkt_dts=161595|pkt_dts_time=1.795500|best_effort_timestamp=161596|best_effort_timestamp_time=1.795511|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=83530|pkt_size=1753|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=53|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=164599|pts_time=1.828878|dts=164598|dts_time=1.828867|duration=3003|duration_time=0.033367|size=1727|pos=88705|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=164599|pts_time=1.828878|pkt_dts=164598|pkt_dts_time=1.828867|best_effort_timestamp=164599|best_effort_timestamp_time=1.828878|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=88705|pkt_size=1727|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=56|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=164599|pts_time=1.828878|dts=164598|dts_time=1.828867|duration=3003|duration_time=0.033367|size=1727|pos=88705|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=164599|pts_time=1.828878|pkt_dts=164598|pkt_dts_time=1.828867|best_effort_timestamp=164599|best_effort_timestamp_time=1.828878|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=88705|pkt_size=1727|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=56|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=173608|pts_time=1.928978|dts=167601|dts_time=1.862233|duration=3003|duration_time=0.033367|size=1504|pos=90432|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=167602|pts_time=1.862244|pkt_dts=167601|pkt_dts_time=1.862233|best_effort_timestamp=167602|best_effort_timestamp_time=1.862244|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=86297|pkt_size=2408|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=55|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=173608|pts_time=1.928978|dts=167601|dts_time=1.862233|duration=3003|duration_time=0.033367|size=1504|pos=90432|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=167602|pts_time=1.862244|pkt_dts=167601|pkt_dts_time=1.862233|best_effort_timestamp=167602|best_effort_timestamp_time=1.862244|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=86297|pkt_size=2408|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=55|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=170605|pts_time=1.895611|dts=170604|dts_time=1.895600|duration=3003|duration_time=0.033367|size=957|pos=91936|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=170605|pts_time=1.895611|pkt_dts=170604|pkt_dts_time=1.895600|best_effort_timestamp=170605|best_effort_timestamp_time=1.895611|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=91936|pkt_size=957|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=58|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=170605|pts_time=1.895611|dts=170604|dts_time=1.895600|duration=3003|duration_time=0.033367|size=957|pos=91936|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=170605|pts_time=1.895611|pkt_dts=170604|pkt_dts_time=1.895600|best_effort_timestamp=170605|best_effort_timestamp_time=1.895611|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=91936|pkt_size=957|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=58|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=179614|pts_time=1.995711|dts=173607|dts_time=1.928967|duration=3003|duration_time=0.033367|size=1890|pos=92893|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=173608|pts_time=1.928978|pkt_dts=173607|pkt_dts_time=1.928967|best_effort_timestamp=173608|best_effort_timestamp_time=1.928978|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=90432|pkt_size=1504|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=57|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=179614|pts_time=1.995711|dts=173607|dts_time=1.928967|duration=3003|duration_time=0.033367|size=1890|pos=92893|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=173608|pts_time=1.928978|pkt_dts=173607|pkt_dts_time=1.928967|best_effort_timestamp=173608|best_effort_timestamp_time=1.928978|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=90432|pkt_size=1504|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=57|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=176611|pts_time=1.962344|dts=176610|dts_time=1.962333|duration=3003|duration_time=0.033367|size=1239|pos=94783|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=176611|pts_time=1.962344|pkt_dts=176610|pkt_dts_time=1.962333|best_effort_timestamp=176611|best_effort_timestamp_time=1.962344|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=94783|pkt_size=1239|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=60|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=176611|pts_time=1.962344|dts=176610|dts_time=1.962333|duration=3003|duration_time=0.033367|size=1239|pos=94783|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=176611|pts_time=1.962344|pkt_dts=176610|pkt_dts_time=1.962333|best_effort_timestamp=176611|best_effort_timestamp_time=1.962344|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=94783|pkt_size=1239|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=60|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=185620|pts_time=2.062444|dts=179613|dts_time=1.995700|duration=3003|duration_time=0.033367|size=1856|pos=96022|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=179614|pts_time=1.995711|pkt_dts=179613|pkt_dts_time=1.995700|best_effort_timestamp=179614|best_effort_timestamp_time=1.995711|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=92893|pkt_size=1890|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=59|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=185620|pts_time=2.062444|dts=179613|dts_time=1.995700|duration=3003|duration_time=0.033367|size=1856|pos=96022|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=179614|pts_time=1.995711|pkt_dts=179613|pkt_dts_time=1.995700|best_effort_timestamp=179614|best_effort_timestamp_time=1.995711|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=92893|pkt_size=1890|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=59|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=182617|pts_time=2.029078|dts=182616|dts_time=2.029067|duration=3003|duration_time=0.033367|size=1302|pos=97878|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=182617|pts_time=2.029078|pkt_dts=182616|pkt_dts_time=2.029067|best_effort_timestamp=182617|best_effort_timestamp_time=2.029078|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=97878|pkt_size=1302|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=62|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=182617|pts_time=2.029078|dts=182616|dts_time=2.029067|duration=3003|duration_time=0.033367|size=1302|pos=97878|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=182617|pts_time=2.029078|pkt_dts=182616|pkt_dts_time=2.029067|best_effort_timestamp=182617|best_effort_timestamp_time=2.029078|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=97878|pkt_size=1302|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=62|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=191626|pts_time=2.129178|dts=185619|dts_time=2.062433|duration=3003|duration_time=0.033367|size=1666|pos=99180|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=185620|pts_time=2.062444|pkt_dts=185619|pkt_dts_time=2.062433|best_effort_timestamp=185620|best_effort_timestamp_time=2.062444|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=96022|pkt_size=1856|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=61|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=191626|pts_time=2.129178|dts=185619|dts_time=2.062433|duration=3003|duration_time=0.033367|size=1666|pos=99180|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=185620|pts_time=2.062444|pkt_dts=185619|pkt_dts_time=2.062433|best_effort_timestamp=185620|best_effort_timestamp_time=2.062444|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=96022|pkt_size=1856|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=61|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=188623|pts_time=2.095811|dts=188622|dts_time=2.095800|duration=3003|duration_time=0.033367|size=974|pos=100846|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=188623|pts_time=2.095811|pkt_dts=188622|pkt_dts_time=2.095800|best_effort_timestamp=188623|best_effort_timestamp_time=2.095811|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=100846|pkt_size=974|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=64|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=188623|pts_time=2.095811|dts=188622|dts_time=2.095800|duration=3003|duration_time=0.033367|size=974|pos=100846|flags=___ +frame|media_type=video|stream_index=0|key_frame=0|pts=188623|pts_time=2.095811|pkt_dts=188622|pkt_dts_time=2.095800|best_effort_timestamp=188623|best_effort_timestamp_time=2.095811|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=100846|pkt_size=974|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=B|coded_picture_number=64|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message -packet|codec_type=video|stream_index=0|pts=197632|pts_time=2.195911|dts=191625|dts_time=2.129167|duration=3003|duration_time=0.033367|size=580|pos=101820|flags=__ -frame|media_type=video|stream_index=0|key_frame=0|pts=191626|pts_time=2.129178|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=191626|best_effort_timestamp_time=2.129178|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=99180|pkt_size=1666|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=63|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message +packet|codec_type=video|stream_index=0|pts=197632|pts_time=2.195911|dts=191625|dts_time=2.129167|duration=3003|duration_time=0.033367|size=580|pos=101820|flags=__C +frame|media_type=video|stream_index=0|key_frame=0|pts=191626|pts_time=2.129178|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=191626|best_effort_timestamp_time=2.129178|pkt_duration=3003|pkt_duration_time=0.033367|duration=3003|duration_time=0.033367|pkt_pos=99180|pkt_size=1666|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=63|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft|side_data|side_data_type=H.26[45] User Data Unregistered SEI message stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=160|height=240|coded_width=160|coded_height=240|closed_captions=0|film_grain=0|has_b_frames=1|sample_aspect_ratio=2:1|display_aspect_ratio=4:3|pix_fmt=yuv420p|level=12|color_range=tv|color_space=smpte170m|color_transfer=bt709|color_primaries=smpte170m|chroma_location=topleft|field_order=progressive|refs=2|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=30000/1001|avg_frame_rate=6372000/212521|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=2125200|duration=23.613333|bit_rate=333874|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=708|nb_read_frames=65|nb_read_packets=66|extradata_size=34|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:creation_time=2008-05-12T20:59:27.000000Z|tag:language=eng|tag:handler_name=Apple Video Media Handler|tag:vendor_id=appl|tag:encoder=H.264|side_data|side_data_type=Display Matrix|displaymatrix=\n00000000: 131072 0 0\n00000001: 0 65536 0\n00000002: 0 0 1073741824\n|rotation=0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mss2-region mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mss2-region --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mss2-region 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mss2-region 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,7 @@ +#tb 0: 1/1000 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 160x120 +#sar 0: 0/1 +0, 0, 0, 1, 57600, 0x51bc82a3 +0, 3000, 3000, 1, 57600, 0x51bc82a3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-applehdr10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-applehdr10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-applehdr10 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-applehdr10 2023-03-03 13:29:59.000000000 +0000 @@ -86,6 +86,7 @@ channels=1 channel_layout=unknown bits_per_sample=24 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 @@ -131,6 +132,7 @@ channels=1 channel_layout=unknown bits_per_sample=24 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-d10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-d10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-d10 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-d10 2023-03-03 13:29:59.000000000 +0000 @@ -77,6 +77,7 @@ channels=8 channel_layout=unknown bits_per_sample=16 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-dv25 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-dv25 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-dv25 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-dv25 2023-03-03 13:29:59.000000000 +0000 @@ -68,6 +68,7 @@ channels=1 channel_layout=unknown bits_per_sample=16 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 @@ -113,6 +114,7 @@ channels=1 channel_layout=unknown bits_per_sample=16 +initial_padding=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-j2k mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-j2k --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-j2k 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-probe-j2k 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,78 @@ +[STREAM] +index=0 +codec_name=jpeg2000 +profile=1798 +codec_type=video +codec_tag_string=[0][0][0][0] +codec_tag=0x0000 +width=640 +height=360 +coded_width=640 +coded_height=360 +closed_captions=0 +film_grain=0 +has_b_frames=0 +sample_aspect_ratio=1:1 +display_aspect_ratio=16:9 +pix_fmt=rgb48le +level=-99 +color_range=unknown +color_space=unknown +color_transfer=bt709 +color_primaries=bt709 +chroma_location=unspecified +field_order=progressive +refs=1 +id=N/A +r_frame_rate=24/1 +avg_frame_rate=24/1 +time_base=1/24 +start_pts=0 +start_time=0.000000 +duration_ts=24 +duration=1.000000 +bit_rate=N/A +max_bit_rate=N/A +bits_per_raw_sample=16 +nb_frames=N/A +nb_read_frames=N/A +nb_read_packets=N/A +DISPOSITION:default=0 +DISPOSITION:dub=0 +DISPOSITION:original=0 +DISPOSITION:comment=0 +DISPOSITION:lyrics=0 +DISPOSITION:karaoke=0 +DISPOSITION:forced=0 +DISPOSITION:hearing_impaired=0 +DISPOSITION:visual_impaired=0 +DISPOSITION:clean_effects=0 +DISPOSITION:attached_pic=0 +DISPOSITION:timed_thumbnails=0 +DISPOSITION:captions=0 +DISPOSITION:descriptions=0 +DISPOSITION:metadata=0 +DISPOSITION:dependent=0 +DISPOSITION:still_image=0 +TAG:file_package_umid=0x060A2B340101010501010F201300000035E05073878E4B2FB69D2369F25ADFC9 +TAG:file_package_name=File Package: SMPTE ST 422 / ST 2067-5 frame wrapping of JPEG 2000 codestreams +TAG:track_name=Image Track +[/STREAM] +[FORMAT] +format_name=mxf +duration=1.000000 +bit_rate=577792 +TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010100 +TAG:uid=f1994e51-a844-49e4-9459-1ddd622eb65d +TAG:generation_uid=1be151ac-cc95-4314-b09f-7420eda9932b +TAG:company_name=Sandflow Consulting LLC +TAG:product_name=dcdm2imf +TAG:product_version_num=0.0.0.0.0 +TAG:product_version=1.0-beta1 +TAG:product_uid=927fc4d1-89a3-4f88-88bb-d363ed33084a +TAG:modification_date=2022-01-07T22:05:01.000000Z +TAG:toolkit_version_num=2.10.38.27240.1 +TAG:application_platform=win32 +TAG:material_package_umid=0x060A2B340101010501010F201300000072BAF0557DA749308C14738BCD4FA116 +TAG:material_package_name=Material Package +[/FORMAT] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-remux-applehdr10 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-remux-applehdr10 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-remux-applehdr10 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/mxf-remux-applehdr10 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,67 @@ +5e03bad42adeb396b6614890f30aefba *tests/data/fate/mxf-remux-applehdr10.mxf +323641 tests/data/fate/mxf-remux-applehdr10.mxf +#tb 0: 1001/60000 +#media_type 0: video +#codec_id 0: prores +#dimensions 0: 1280x720 +#sar 0: 1/1 +#tb 1: 1/48000 +#media_type 1: audio +#codec_id 1: pcm_s24le +#sample_rate 1: 48000 +#channel_layout_name 1: mono +0, 0, 0, 1, 57008, 0x43416399, S=1, 88 +1, 0, 0, 801, 2403, 0x00000000 +0, 1, 1, 1, 57248, 0xa06cd7b5 +1, 801, 801, 801, 2403, 0x00000000 +0, 2, 2, 1, 57200, 0x5623da10 +1, 1602, 1602, 800, 2400, 0x00000000 +1, 2402, 2402, 801, 2403, 0x00000000 +0, 3, 3, 1, 57152, 0x52d89d3f +1, 3203, 3203, 801, 2403, 0x00000000 +0, 4, 4, 1, 56960, 0x431d5189 +[STREAM] +index=0 +codec_name=prores +codec_tag=0x6f637061 +TAG:file_package_umid=0x060A2B340101010501010D001300000000000000000000000000000000000001 +[SIDE_DATA] +side_data_type=Mastering display metadata +red_x=34000/50000 +red_y=16000/50000 +green_x=13250/50000 +green_y=34500/50000 +blue_x=7500/50000 +blue_y=3000/50000 +white_point_x=15635/50000 +white_point_y=16450/50000 +min_luminance=0/10000 +max_luminance=10000000/10000 +[/SIDE_DATA] +[/STREAM] +[STREAM] +index=1 +codec_name=pcm_s24le +codec_tag=0x0000 +TAG:file_package_umid=0x060A2B340101010501010D001300000000000000000000000000000000000001 +[/STREAM] +[STREAM] +index=2 +codec_name=pcm_s24le +codec_tag=0x0000 +TAG:file_package_umid=0x060A2B340101010501010D001300000000000000000000000000000000000001 +[/STREAM] +[FORMAT] +TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900 +TAG:uid=adab4424-2f25-4dc7-92ff-000c00000000 +TAG:generation_uid=adab4424-2f25-4dc7-92ff-000c00000001 +TAG:company_name=FFmpeg +TAG:product_name=OP1a Muxer +TAG:product_version_num=0.0.0.0.0 +TAG:product_version=0.0.0 +TAG:application_platform=Lavf +TAG:product_uid=adab4424-2f25-4dc7-92ff-29bd000c0002 +TAG:toolkit_version_num=0.0.0.0.0 +TAG:material_package_umid=0x060A2B340101010501010D001300000000000000000000000000000000000000 +TAG:timecode=00:01:15;26 +[/FORMAT] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/nuv-rtjpeg mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/nuv-rtjpeg --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/nuv-rtjpeg 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/nuv-rtjpeg 2023-03-03 13:29:59.000000000 +0000 @@ -3,11 +3,11 @@ #codec_id 0: rawvideo #dimensions 0: 640x480 #sar 0: 1/1 -0, 118, 118, 1, 460800, 0x54aedafe -0, 152, 152, 1, 460800, 0xb7aa8b56 -0, 177, 177, 1, 460800, 0x283ea3b5 -0, 202, 202, 1, 460800, 0x283ea3b5 -0, 235, 235, 1, 460800, 0x10e577de -0, 269, 269, 1, 460800, 0x4e091ee2 -0, 302, 302, 1, 460800, 0x2ea88828 -0, 335, 335, 1, 460800, 0x4b7f4df0 +0, 118, 118, 33, 460800, 0x54aedafe +0, 152, 152, 33, 460800, 0xb7aa8b56 +0, 177, 177, 33, 460800, 0x283ea3b5 +0, 202, 202, 33, 460800, 0x283ea3b5 +0, 235, 235, 33, 460800, 0x10e577de +0, 269, 269, 33, 460800, 0x4e091ee2 +0, 302, 302, 33, 460800, 0x2ea88828 +0, 335, 335, 33, 460800, 0x4b7f4df0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/oggopus-demux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/oggopus-demux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/oggopus-demux 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/oggopus-demux 2023-03-03 13:29:59.000000000 +0000 @@ -1,45 +1,45 @@ -packet|codec_type=audio|stream_index=0|pts=-356|pts_time=-0.007417|dts=-356|dts_time=-0.007417|duration=960|duration_time=0.020000|size=402|pos=841|flags=K_|side_data|side_data_type=Skip Samples|skip_samples=356|discard_padding=0|skip_reason=0|discard_reason=0 -|data_hash=CRC32:052ff811 -packet|codec_type=audio|stream_index=0|pts=604|pts_time=0.012583|dts=604|dts_time=0.012583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:77f232d3 -packet|codec_type=audio|stream_index=0|pts=1564|pts_time=0.032583|dts=1564|dts_time=0.032583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K_|data_hash=CRC32:3746e223 -packet|codec_type=audio|stream_index=0|pts=2524|pts_time=0.052583|dts=2524|dts_time=0.052583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:3326bc9f -packet|codec_type=audio|stream_index=0|pts=3484|pts_time=0.072583|dts=3484|dts_time=0.072583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:e341a3da -packet|codec_type=audio|stream_index=0|pts=4444|pts_time=0.092583|dts=4444|dts_time=0.092583|duration=960|duration_time=0.020000|size=194|pos=841|flags=K_|data_hash=CRC32:59dcb3fb -packet|codec_type=audio|stream_index=0|pts=5404|pts_time=0.112583|dts=5404|dts_time=0.112583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:7b5566f5 -packet|codec_type=audio|stream_index=0|pts=6364|pts_time=0.132583|dts=6364|dts_time=0.132583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:e95e91d1 -packet|codec_type=audio|stream_index=0|pts=7324|pts_time=0.152583|dts=7324|dts_time=0.152583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:4e2a2dcd -packet|codec_type=audio|stream_index=0|pts=8284|pts_time=0.172583|dts=8284|dts_time=0.172583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K_|data_hash=CRC32:8d3e1e9c -packet|codec_type=audio|stream_index=0|pts=9244|pts_time=0.192583|dts=9244|dts_time=0.192583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:0cf422f3 -packet|codec_type=audio|stream_index=0|pts=10204|pts_time=0.212583|dts=10204|dts_time=0.212583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:e683509f -packet|codec_type=audio|stream_index=0|pts=11164|pts_time=0.232583|dts=11164|dts_time=0.232583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:53c28210 -packet|codec_type=audio|stream_index=0|pts=12124|pts_time=0.252583|dts=12124|dts_time=0.252583|duration=960|duration_time=0.020000|size=222|pos=841|flags=K_|data_hash=CRC32:1e7778cb -packet|codec_type=audio|stream_index=0|pts=13084|pts_time=0.272583|dts=13084|dts_time=0.272583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:ea403207 -packet|codec_type=audio|stream_index=0|pts=14044|pts_time=0.292583|dts=14044|dts_time=0.292583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:9a8e4930 -packet|codec_type=audio|stream_index=0|pts=15004|pts_time=0.312583|dts=15004|dts_time=0.312583|duration=960|duration_time=0.020000|size=210|pos=841|flags=K_|data_hash=CRC32:afbec644 -packet|codec_type=audio|stream_index=0|pts=15964|pts_time=0.332583|dts=15964|dts_time=0.332583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:0f8f7901 -packet|codec_type=audio|stream_index=0|pts=16924|pts_time=0.352583|dts=16924|dts_time=0.352583|duration=960|duration_time=0.020000|size=203|pos=841|flags=K_|data_hash=CRC32:e8c6eb24 -packet|codec_type=audio|stream_index=0|pts=17884|pts_time=0.372583|dts=17884|dts_time=0.372583|duration=960|duration_time=0.020000|size=209|pos=841|flags=K_|data_hash=CRC32:5fdfb02e -packet|codec_type=audio|stream_index=0|pts=18844|pts_time=0.392583|dts=18844|dts_time=0.392583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:a72182be -packet|codec_type=audio|stream_index=0|pts=19804|pts_time=0.412583|dts=19804|dts_time=0.412583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:ede6d275 -packet|codec_type=audio|stream_index=0|pts=20764|pts_time=0.432583|dts=20764|dts_time=0.432583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K_|data_hash=CRC32:b9d28f17 -packet|codec_type=audio|stream_index=0|pts=21724|pts_time=0.452583|dts=21724|dts_time=0.452583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:e0307b65 -packet|codec_type=audio|stream_index=0|pts=22684|pts_time=0.472583|dts=22684|dts_time=0.472583|duration=960|duration_time=0.020000|size=220|pos=841|flags=K_|data_hash=CRC32:dca81c5d -packet|codec_type=audio|stream_index=0|pts=23644|pts_time=0.492583|dts=23644|dts_time=0.492583|duration=960|duration_time=0.020000|size=364|pos=841|flags=K_|data_hash=CRC32:46844268 -packet|codec_type=audio|stream_index=0|pts=24604|pts_time=0.512583|dts=24604|dts_time=0.512583|duration=960|duration_time=0.020000|size=221|pos=841|flags=K_|data_hash=CRC32:bcac731f -packet|codec_type=audio|stream_index=0|pts=25564|pts_time=0.532583|dts=25564|dts_time=0.532583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K_|data_hash=CRC32:cf6f9041 -packet|codec_type=audio|stream_index=0|pts=26524|pts_time=0.552583|dts=26524|dts_time=0.552583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K_|data_hash=CRC32:903fc52d -packet|codec_type=audio|stream_index=0|pts=27484|pts_time=0.572583|dts=27484|dts_time=0.572583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:2d204bcc -packet|codec_type=audio|stream_index=0|pts=28444|pts_time=0.592583|dts=28444|dts_time=0.592583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:8fa7b453 -packet|codec_type=audio|stream_index=0|pts=29404|pts_time=0.612583|dts=29404|dts_time=0.612583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:8fefaa27 -packet|codec_type=audio|stream_index=0|pts=30364|pts_time=0.632583|dts=30364|dts_time=0.632583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K_|data_hash=CRC32:dc96ebe2 -packet|codec_type=audio|stream_index=0|pts=31324|pts_time=0.652583|dts=31324|dts_time=0.652583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K_|data_hash=CRC32:47e4da62 -packet|codec_type=audio|stream_index=0|pts=32284|pts_time=0.672583|dts=32284|dts_time=0.672583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K_|data_hash=CRC32:b822d69d -packet|codec_type=audio|stream_index=0|pts=33244|pts_time=0.692583|dts=33244|dts_time=0.692583|duration=960|duration_time=0.020000|size=220|pos=841|flags=K_|data_hash=CRC32:c7f5cf20 -packet|codec_type=audio|stream_index=0|pts=34204|pts_time=0.712583|dts=34204|dts_time=0.712583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K_|data_hash=CRC32:f9fed5d8 -packet|codec_type=audio|stream_index=0|pts=35164|pts_time=0.732583|dts=35164|dts_time=0.732583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K_|data_hash=CRC32:aba60587 -packet|codec_type=audio|stream_index=0|pts=36124|pts_time=0.752583|dts=36124|dts_time=0.752583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:b04fe85a -packet|codec_type=audio|stream_index=0|pts=37084|pts_time=0.772583|dts=37084|dts_time=0.772583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K_|data_hash=CRC32:06797ece -packet|codec_type=audio|stream_index=0|pts=38044|pts_time=0.792583|dts=38044|dts_time=0.792583|duration=356|duration_time=0.007417|size=359|pos=841|flags=K_|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=604|skip_reason=0|discard_reason=0 -|data_hash=CRC32:01ca3f8f -stream|index=0|codec_name=opus|profile=unknown|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/48000|start_pts=0|start_time=0.000000|duration_ts=38756|duration=0.807417|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=41|extradata_size=19|extradata_hash=CRC32:58ba5ff3|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:ENCODER=opusenc from opus-tools 0.1.9|tag:ENCODER_OPTIONS=--discard-comments +packet|codec_type=audio|stream_index=0|pts=-356|pts_time=-0.007417|dts=-356|dts_time=-0.007417|duration=960|duration_time=0.020000|size=402|pos=841|flags=K__|data_hash=CRC32:052ff811|side_data|side_data_type=Skip Samples|skip_samples=356|discard_padding=0|skip_reason=0|discard_reason=0 + +packet|codec_type=audio|stream_index=0|pts=604|pts_time=0.012583|dts=604|dts_time=0.012583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:77f232d3 +packet|codec_type=audio|stream_index=0|pts=1564|pts_time=0.032583|dts=1564|dts_time=0.032583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K__|data_hash=CRC32:3746e223 +packet|codec_type=audio|stream_index=0|pts=2524|pts_time=0.052583|dts=2524|dts_time=0.052583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:3326bc9f +packet|codec_type=audio|stream_index=0|pts=3484|pts_time=0.072583|dts=3484|dts_time=0.072583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:e341a3da +packet|codec_type=audio|stream_index=0|pts=4444|pts_time=0.092583|dts=4444|dts_time=0.092583|duration=960|duration_time=0.020000|size=194|pos=841|flags=K__|data_hash=CRC32:59dcb3fb +packet|codec_type=audio|stream_index=0|pts=5404|pts_time=0.112583|dts=5404|dts_time=0.112583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:7b5566f5 +packet|codec_type=audio|stream_index=0|pts=6364|pts_time=0.132583|dts=6364|dts_time=0.132583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:e95e91d1 +packet|codec_type=audio|stream_index=0|pts=7324|pts_time=0.152583|dts=7324|dts_time=0.152583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:4e2a2dcd +packet|codec_type=audio|stream_index=0|pts=8284|pts_time=0.172583|dts=8284|dts_time=0.172583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K__|data_hash=CRC32:8d3e1e9c +packet|codec_type=audio|stream_index=0|pts=9244|pts_time=0.192583|dts=9244|dts_time=0.192583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:0cf422f3 +packet|codec_type=audio|stream_index=0|pts=10204|pts_time=0.212583|dts=10204|dts_time=0.212583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:e683509f +packet|codec_type=audio|stream_index=0|pts=11164|pts_time=0.232583|dts=11164|dts_time=0.232583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:53c28210 +packet|codec_type=audio|stream_index=0|pts=12124|pts_time=0.252583|dts=12124|dts_time=0.252583|duration=960|duration_time=0.020000|size=222|pos=841|flags=K__|data_hash=CRC32:1e7778cb +packet|codec_type=audio|stream_index=0|pts=13084|pts_time=0.272583|dts=13084|dts_time=0.272583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:ea403207 +packet|codec_type=audio|stream_index=0|pts=14044|pts_time=0.292583|dts=14044|dts_time=0.292583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:9a8e4930 +packet|codec_type=audio|stream_index=0|pts=15004|pts_time=0.312583|dts=15004|dts_time=0.312583|duration=960|duration_time=0.020000|size=210|pos=841|flags=K__|data_hash=CRC32:afbec644 +packet|codec_type=audio|stream_index=0|pts=15964|pts_time=0.332583|dts=15964|dts_time=0.332583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:0f8f7901 +packet|codec_type=audio|stream_index=0|pts=16924|pts_time=0.352583|dts=16924|dts_time=0.352583|duration=960|duration_time=0.020000|size=203|pos=841|flags=K__|data_hash=CRC32:e8c6eb24 +packet|codec_type=audio|stream_index=0|pts=17884|pts_time=0.372583|dts=17884|dts_time=0.372583|duration=960|duration_time=0.020000|size=209|pos=841|flags=K__|data_hash=CRC32:5fdfb02e +packet|codec_type=audio|stream_index=0|pts=18844|pts_time=0.392583|dts=18844|dts_time=0.392583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:a72182be +packet|codec_type=audio|stream_index=0|pts=19804|pts_time=0.412583|dts=19804|dts_time=0.412583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:ede6d275 +packet|codec_type=audio|stream_index=0|pts=20764|pts_time=0.432583|dts=20764|dts_time=0.432583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K__|data_hash=CRC32:b9d28f17 +packet|codec_type=audio|stream_index=0|pts=21724|pts_time=0.452583|dts=21724|dts_time=0.452583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:e0307b65 +packet|codec_type=audio|stream_index=0|pts=22684|pts_time=0.472583|dts=22684|dts_time=0.472583|duration=960|duration_time=0.020000|size=220|pos=841|flags=K__|data_hash=CRC32:dca81c5d +packet|codec_type=audio|stream_index=0|pts=23644|pts_time=0.492583|dts=23644|dts_time=0.492583|duration=960|duration_time=0.020000|size=364|pos=841|flags=K__|data_hash=CRC32:46844268 +packet|codec_type=audio|stream_index=0|pts=24604|pts_time=0.512583|dts=24604|dts_time=0.512583|duration=960|duration_time=0.020000|size=221|pos=841|flags=K__|data_hash=CRC32:bcac731f +packet|codec_type=audio|stream_index=0|pts=25564|pts_time=0.532583|dts=25564|dts_time=0.532583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K__|data_hash=CRC32:cf6f9041 +packet|codec_type=audio|stream_index=0|pts=26524|pts_time=0.552583|dts=26524|dts_time=0.552583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K__|data_hash=CRC32:903fc52d +packet|codec_type=audio|stream_index=0|pts=27484|pts_time=0.572583|dts=27484|dts_time=0.572583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:2d204bcc +packet|codec_type=audio|stream_index=0|pts=28444|pts_time=0.592583|dts=28444|dts_time=0.592583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:8fa7b453 +packet|codec_type=audio|stream_index=0|pts=29404|pts_time=0.612583|dts=29404|dts_time=0.612583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:8fefaa27 +packet|codec_type=audio|stream_index=0|pts=30364|pts_time=0.632583|dts=30364|dts_time=0.632583|duration=960|duration_time=0.020000|size=216|pos=841|flags=K__|data_hash=CRC32:dc96ebe2 +packet|codec_type=audio|stream_index=0|pts=31324|pts_time=0.652583|dts=31324|dts_time=0.652583|duration=960|duration_time=0.020000|size=215|pos=841|flags=K__|data_hash=CRC32:47e4da62 +packet|codec_type=audio|stream_index=0|pts=32284|pts_time=0.672583|dts=32284|dts_time=0.672583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K__|data_hash=CRC32:b822d69d +packet|codec_type=audio|stream_index=0|pts=33244|pts_time=0.692583|dts=33244|dts_time=0.692583|duration=960|duration_time=0.020000|size=220|pos=841|flags=K__|data_hash=CRC32:c7f5cf20 +packet|codec_type=audio|stream_index=0|pts=34204|pts_time=0.712583|dts=34204|dts_time=0.712583|duration=960|duration_time=0.020000|size=218|pos=841|flags=K__|data_hash=CRC32:f9fed5d8 +packet|codec_type=audio|stream_index=0|pts=35164|pts_time=0.732583|dts=35164|dts_time=0.732583|duration=960|duration_time=0.020000|size=219|pos=841|flags=K__|data_hash=CRC32:aba60587 +packet|codec_type=audio|stream_index=0|pts=36124|pts_time=0.752583|dts=36124|dts_time=0.752583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:b04fe85a +packet|codec_type=audio|stream_index=0|pts=37084|pts_time=0.772583|dts=37084|dts_time=0.772583|duration=960|duration_time=0.020000|size=217|pos=841|flags=K__|data_hash=CRC32:06797ece +packet|codec_type=audio|stream_index=0|pts=38044|pts_time=0.792583|dts=38044|dts_time=0.792583|duration=356|duration_time=0.007417|size=359|pos=841|flags=K__|data_hash=CRC32:01ca3f8f|side_data|side_data_type=Skip Samples|skip_samples=0|discard_padding=604|skip_reason=0|discard_reason=0 + +stream|index=0|codec_name=opus|profile=unknown|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=356|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/48000|start_pts=0|start_time=0.000000|duration_ts=38756|duration=0.807417|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=41|extradata_size=19|extradata_hash=CRC32:58ba5ff3|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:ENCODER=opusenc from opus-tools 0.1.9|tag:ENCODER_OPTIONS=--discard-comments format|filename=intro-partial.opus|nb_streams=1|nb_programs=0|format_name=ogg|start_time=0.000000|duration=0.807417|size=10250|bit_rate=101558|probe_score=100 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/pixfmt_best mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/pixfmt_best --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/pixfmt_best 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/pixfmt_best 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -73 tests passed, 0 tests failed. +106 tests passed, 0 tests failed. diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc 2023-03-03 13:29:59.000000000 +0000 @@ -18,6 +18,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=0 pkt_size=49397 width=128 @@ -31,7 +33,7 @@ top_field_first=0 repeat_pict=0 color_range=pc -color_space=unknown +color_space=gbr color_primaries=unknown color_transfer=unknown chroma_location=unspecified diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc-parse mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc-parse --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc-parse 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-icc-parse 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,48 @@ +[FRAME] +media_type=video +stream_index=0 +key_frame=1 +pts=0 +pts_time=0.000000 +pkt_dts=0 +pkt_dts_time=0.000000 +best_effort_timestamp=0 +best_effort_timestamp_time=0.000000 +pkt_duration=1 +pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 +pkt_pos=0 +pkt_size=40194 +width=128 +height=128 +pix_fmt=rgb24 +sample_aspect_ratio=1:1 +pict_type=I +coded_picture_number=0 +display_picture_number=0 +interlaced_frame=1 +top_field_first=0 +repeat_pict=0 +color_range=pc +color_space=unknown +color_primaries=bt709 +color_transfer=iec61966-2-1 +chroma_location=unspecified +[SIDE_DATA] +side_data_type=ICC profile +name=Photoshop ICC profile +size=3144 +[/SIDE_DATA] +[SIDE_DATA] +side_data_type=Mastering display metadata +red_x=63999/100000 +red_y=33001/100000 +green_x=30000/100000 +green_y=60000/100000 +blue_x=15000/100000 +blue_y=5999/100000 +white_point_x=31269/100000 +white_point_y=32899/100000 +[/SIDE_DATA] +[/FRAME] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-side-data mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-side-data --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-side-data 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/png-side-data 2023-03-03 13:29:59.000000000 +0000 @@ -10,6 +10,8 @@ best_effort_timestamp_time=0.000000 pkt_duration=1 pkt_duration_time=0.040000 +duration=1 +duration_time=0.040000 pkt_pos=0 pkt_size=40194 width=128 @@ -23,7 +25,7 @@ top_field_first=0 repeat_pict=0 color_range=pc -color_space=unknown +color_space=gbr color_primaries=unknown color_transfer=unknown chroma_location=unspecified @@ -32,15 +34,4 @@ name=Photoshop ICC profile size=3144 [/SIDE_DATA] -[SIDE_DATA] -side_data_type=Mastering display metadata -red_x=63999/100000 -red_y=33001/100000 -green_x=30000/100000 -green_y=60000/100000 -blue_x=15000/100000 -blue_y=5999/100000 -white_point_x=31269/100000 -white_point_y=32899/100000 -[/SIDE_DATA] [/FRAME] diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/prores-gray mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/prores-gray --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/prores-gray 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/prores-gray 2023-03-03 13:29:59.000000000 +0000 @@ -9,7 +9,7 @@ #sample_rate 1: 48000 #channel_layout_name 1: stereo 0, 0, 0, 1, 1658880, 0x43d9c9e2 -1, 0, 0, 1024, 4096, 0x6c8a9a18 -1, 1024, 1024, 1024, 4096, 0x960dadcf +1, 0, 0, 1024, 4096, 0x543c9a17 +1, 1024, 1024, 1024, 4096, 0x9aedadd1 0, 1, 1, 1, 1658880, 0xa2a72f9b -1, 2048, 2048, 1024, 4096, 0xa913cd55 +1, 2048, 2048, 1024, 4096, 0xa0c9cd55 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/rl2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/rl2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/rl2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/rl2 2023-03-03 13:29:59.000000000 +0000 @@ -3,111 +3,111 @@ #codec_id 0: rawvideo #dimensions 0: 320x200 #sar 0: 0/1 -0, 0, 0, 1, 192000, 0x7112a667 -0, 1, 1, 1, 192000, 0x6936abf3 -0, 2, 2, 1, 192000, 0xb1f08981 -0, 3, 3, 1, 192000, 0x4ce7fece -0, 4, 4, 1, 192000, 0xf04decde -0, 5, 5, 1, 192000, 0x47fef74b -0, 6, 6, 1, 192000, 0x99b42ac2 -0, 7, 7, 1, 192000, 0x3c4c419d -0, 8, 8, 1, 192000, 0x66bf5588 -0, 9, 9, 1, 192000, 0xe1de4725 -0, 10, 10, 1, 192000, 0x348b2af9 -0, 11, 11, 1, 192000, 0x1ce73e83 -0, 12, 12, 1, 192000, 0xcdaa6e02 -0, 13, 13, 1, 192000, 0x370dc2ce -0, 14, 14, 1, 192000, 0x1e1e40fe -0, 15, 15, 1, 192000, 0x491470a4 -0, 16, 16, 1, 192000, 0x88c43e9a -0, 17, 17, 1, 192000, 0x036f3f44 -0, 18, 18, 1, 192000, 0xc8be7e25 -0, 19, 19, 1, 192000, 0xbedb397d -0, 20, 20, 1, 192000, 0x97c410f4 -0, 21, 21, 1, 192000, 0xc2c8225d -0, 22, 22, 1, 192000, 0xe396bccb -0, 23, 23, 1, 192000, 0x7e89c24c -0, 24, 24, 1, 192000, 0xb044954c -0, 25, 25, 1, 192000, 0x335890dd -0, 26, 26, 1, 192000, 0x58a457c0 -0, 27, 27, 1, 192000, 0xeb0f4798 -0, 28, 28, 1, 192000, 0x0bfc39a1 -0, 29, 29, 1, 192000, 0x06a6905a -0, 30, 30, 1, 192000, 0x5300c99b -0, 31, 31, 1, 192000, 0x38f3f845 -0, 32, 32, 1, 192000, 0x6afa3543 -0, 33, 33, 1, 192000, 0x5106a8e0 -0, 34, 34, 1, 192000, 0xc76f0dab -0, 35, 35, 1, 192000, 0x8efa6939 -0, 36, 36, 1, 192000, 0x64ea23d7 -0, 37, 37, 1, 192000, 0x421a2817 -0, 38, 38, 1, 192000, 0xc854fa18 -0, 39, 39, 1, 192000, 0x4a10d59c -0, 40, 40, 1, 192000, 0x72637829 -0, 41, 41, 1, 192000, 0xdbbe2796 -0, 42, 42, 1, 192000, 0xff742e6b -0, 43, 43, 1, 192000, 0xf94b9346 -0, 44, 44, 1, 192000, 0xc90ea53c -0, 45, 45, 1, 192000, 0x177483bb -0, 46, 46, 1, 192000, 0x3510369c -0, 47, 47, 1, 192000, 0x501034bf -0, 48, 48, 1, 192000, 0x315c744b -0, 49, 49, 1, 192000, 0xdb5048ae -0, 50, 50, 1, 192000, 0x09a86221 -0, 51, 51, 1, 192000, 0xb9c9568a -0, 52, 52, 1, 192000, 0x5eee665b -0, 53, 53, 1, 192000, 0xdef85517 -0, 54, 54, 1, 192000, 0x7896b5ad -0, 55, 55, 1, 192000, 0x19fbad39 -0, 56, 56, 1, 192000, 0x63358748 -0, 57, 57, 1, 192000, 0xca0196a3 -0, 58, 58, 1, 192000, 0x0b321da3 -0, 59, 59, 1, 192000, 0xa07af07e -0, 60, 60, 1, 192000, 0x21f9310c -0, 61, 61, 1, 192000, 0x62d59874 -0, 62, 62, 1, 192000, 0x021227b4 -0, 63, 63, 1, 192000, 0x01dac0c2 -0, 64, 64, 1, 192000, 0xf3c33a74 -0, 65, 65, 1, 192000, 0xeebe83b7 -0, 66, 66, 1, 192000, 0x9ec77f97 -0, 67, 67, 1, 192000, 0xc91c2e37 -0, 68, 68, 1, 192000, 0x7b58751d -0, 69, 69, 1, 192000, 0xb178dfbb -0, 70, 70, 1, 192000, 0x2a63b5be -0, 71, 71, 1, 192000, 0x44a407ac -0, 72, 72, 1, 192000, 0x9a8e17dd -0, 73, 73, 1, 192000, 0x5546f4c8 -0, 74, 74, 1, 192000, 0xeda94586 -0, 75, 75, 1, 192000, 0x941dfa6b -0, 76, 76, 1, 192000, 0x9772301d -0, 77, 77, 1, 192000, 0x8be16b16 -0, 78, 78, 1, 192000, 0x26dd4496 -0, 79, 79, 1, 192000, 0x27823797 -0, 80, 80, 1, 192000, 0xacc914f7 -0, 81, 81, 1, 192000, 0xcbb72c9b -0, 82, 82, 1, 192000, 0x4bd3391c -0, 83, 83, 1, 192000, 0x4e6adbfe -0, 84, 84, 1, 192000, 0x7a791c75 -0, 85, 85, 1, 192000, 0xc4f59c94 -0, 86, 86, 1, 192000, 0xc4f59c94 -0, 87, 87, 1, 192000, 0x984a4a0b -0, 88, 88, 1, 192000, 0x3353f31f -0, 89, 89, 1, 192000, 0xa9d4dc5a -0, 90, 90, 1, 192000, 0xb33425d0 -0, 91, 91, 1, 192000, 0x546d768a -0, 92, 92, 1, 192000, 0xfefbe5c9 -0, 93, 93, 1, 192000, 0xbd6be61d -0, 94, 94, 1, 192000, 0xf5792731 -0, 95, 95, 1, 192000, 0xccde0582 -0, 96, 96, 1, 192000, 0x857d58ee -0, 97, 97, 1, 192000, 0xe914ce48 -0, 98, 98, 1, 192000, 0x1f736298 -0, 99, 99, 1, 192000, 0xec0b4846 -0, 100, 100, 1, 192000, 0xe1422624 -0, 101, 101, 1, 192000, 0x56e2b0e0 -0, 102, 102, 1, 192000, 0xc4190640 -0, 103, 103, 1, 192000, 0x7c461977 -0, 104, 104, 1, 192000, 0x34b1d5e8 -0, 105, 105, 1, 192000, 0xbdc70f7a -0, 106, 106, 1, 192000, 0xb466cd8d -0, 107, 107, 1, 192000, 0x0e86a04c +0, 0, 0, 1, 192000, 0x7324a772 +0, 1, 1, 1, 192000, 0x6b48acfe +0, 2, 2, 1, 192000, 0xb4028a8c +0, 3, 3, 1, 192000, 0x4ef9ffd9 +0, 4, 4, 1, 192000, 0xf25fede9 +0, 5, 5, 1, 192000, 0x4a10f856 +0, 6, 6, 1, 192000, 0x9bc62bcd +0, 7, 7, 1, 192000, 0x3e5e42a8 +0, 8, 8, 1, 192000, 0x68d15693 +0, 9, 9, 1, 192000, 0xe3f04830 +0, 10, 10, 1, 192000, 0x369d2c04 +0, 11, 11, 1, 192000, 0x1ef93f8e +0, 12, 12, 1, 192000, 0xcfbc6f0d +0, 13, 13, 1, 192000, 0x391fc3d9 +0, 14, 14, 1, 192000, 0x20304209 +0, 15, 15, 1, 192000, 0x4b2671af +0, 16, 16, 1, 192000, 0x8ad63fa5 +0, 17, 17, 1, 192000, 0x0581404f +0, 18, 18, 1, 192000, 0xcad07f30 +0, 19, 19, 1, 192000, 0xc0ed3a88 +0, 20, 20, 1, 192000, 0x99d611ff +0, 21, 21, 1, 192000, 0xc4da2368 +0, 22, 22, 1, 192000, 0xe5a8bdd6 +0, 23, 23, 1, 192000, 0x809bc357 +0, 24, 24, 1, 192000, 0xb2569657 +0, 25, 25, 1, 192000, 0x356a91e8 +0, 26, 26, 1, 192000, 0x5ab658cb +0, 27, 27, 1, 192000, 0xed2148a3 +0, 28, 28, 1, 192000, 0x0e0e3aac +0, 29, 29, 1, 192000, 0x08b89165 +0, 30, 30, 1, 192000, 0x5512caa6 +0, 31, 31, 1, 192000, 0x3b05f950 +0, 32, 32, 1, 192000, 0x6d0c364e +0, 33, 33, 1, 192000, 0x5318a9eb +0, 34, 34, 1, 192000, 0xc9810eb6 +0, 35, 35, 1, 192000, 0x910c6a44 +0, 36, 36, 1, 192000, 0x66fc24e2 +0, 37, 37, 1, 192000, 0x442c2922 +0, 38, 38, 1, 192000, 0xca66fb23 +0, 39, 39, 1, 192000, 0x4c22d6a7 +0, 40, 40, 1, 192000, 0x74757934 +0, 41, 41, 1, 192000, 0xddd028a1 +0, 42, 42, 1, 192000, 0x01952f76 +0, 43, 43, 1, 192000, 0xfb5d9451 +0, 44, 44, 1, 192000, 0xcb20a647 +0, 45, 45, 1, 192000, 0x198684c6 +0, 46, 46, 1, 192000, 0x372237a7 +0, 47, 47, 1, 192000, 0x522235ca +0, 48, 48, 1, 192000, 0x336e7556 +0, 49, 49, 1, 192000, 0xdd6249b9 +0, 50, 50, 1, 192000, 0x0bba632c +0, 51, 51, 1, 192000, 0xbbdb5795 +0, 52, 52, 1, 192000, 0x61006766 +0, 53, 53, 1, 192000, 0xe10a5622 +0, 54, 54, 1, 192000, 0x7aa8b6b8 +0, 55, 55, 1, 192000, 0x1c0dae44 +0, 56, 56, 1, 192000, 0x65478853 +0, 57, 57, 1, 192000, 0xcc1397ae +0, 58, 58, 1, 192000, 0x0d441eae +0, 59, 59, 1, 192000, 0xa28cf189 +0, 60, 60, 1, 192000, 0x240b3217 +0, 61, 61, 1, 192000, 0x64e7997f +0, 62, 62, 1, 192000, 0x042428bf +0, 63, 63, 1, 192000, 0x03ecc1cd +0, 64, 64, 1, 192000, 0xf5d53b7f +0, 65, 65, 1, 192000, 0xf0d084c2 +0, 66, 66, 1, 192000, 0xa0d980a2 +0, 67, 67, 1, 192000, 0xcb2e2f42 +0, 68, 68, 1, 192000, 0x7d6a7628 +0, 69, 69, 1, 192000, 0xb38ae0c6 +0, 70, 70, 1, 192000, 0x2c75b6c9 +0, 71, 71, 1, 192000, 0x46b608b7 +0, 72, 72, 1, 192000, 0x9ca018e8 +0, 73, 73, 1, 192000, 0x5758f5d3 +0, 74, 74, 1, 192000, 0xefbb4691 +0, 75, 75, 1, 192000, 0x962ffb76 +0, 76, 76, 1, 192000, 0x99843128 +0, 77, 77, 1, 192000, 0x8df36c21 +0, 78, 78, 1, 192000, 0x28ef45a1 +0, 79, 79, 1, 192000, 0x299438a2 +0, 80, 80, 1, 192000, 0xaedb1602 +0, 81, 81, 1, 192000, 0xcdc92da6 +0, 82, 82, 1, 192000, 0x4de53a27 +0, 83, 83, 1, 192000, 0x507cdd09 +0, 84, 84, 1, 192000, 0x7c8b1d80 +0, 85, 85, 1, 192000, 0xc7079d9f +0, 86, 86, 1, 192000, 0xc7079d9f +0, 87, 87, 1, 192000, 0x9a5c4b16 +0, 88, 88, 1, 192000, 0x3565f42a +0, 89, 89, 1, 192000, 0xabe6dd65 +0, 90, 90, 1, 192000, 0xb54626db +0, 91, 91, 1, 192000, 0x567f7795 +0, 92, 92, 1, 192000, 0x011ce6d4 +0, 93, 93, 1, 192000, 0xbf7de728 +0, 94, 94, 1, 192000, 0xf78b283c +0, 95, 95, 1, 192000, 0xcef0068d +0, 96, 96, 1, 192000, 0x878f59f9 +0, 97, 97, 1, 192000, 0xeb26cf53 +0, 98, 98, 1, 192000, 0x218563a3 +0, 99, 99, 1, 192000, 0xee1d4951 +0, 100, 100, 1, 192000, 0xe354272f +0, 101, 101, 1, 192000, 0x58f4b1eb +0, 102, 102, 1, 192000, 0xc62b074b +0, 103, 103, 1, 192000, 0x7e581a82 +0, 104, 104, 1, 192000, 0x36c3d6f3 +0, 105, 105, 1, 192000, 0xbfd91085 +0, 106, 106, 1, 192000, 0xb678ce98 +0, 107, 107, 1, 192000, 0x1098a157 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-adx-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-adx-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-adx-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-adx-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1055 @@ +1195dfa231831759746d5f4f765fbd05 *tests/data/fate/segafilm-adx-remux.film_cpk +101888 tests/data/fate/segafilm-adx-remux.film_cpk +#tb 0: 1/6000 +#media_type 0: video +#codec_id 0: cinepak +#dimensions 0: 296x216 +#sar 0: 0/1 +#tb 1: 1/44100 +#media_type 1: audio +#codec_id 1: adpcm_adx +#sample_rate 1: 44100 +#channel_layout_name 1: stereo +0, 0, 0, 250, 19240, 0x11e74615 +1, 0, 0, 32, 72, 0xc0d20edc +1, 64, 64, 32, 36, 0xe2f40ced +1, 96, 96, 32, 36, 0x1baa10a8 +1, 128, 128, 32, 36, 0xdee70c72 +1, 160, 160, 32, 36, 0x00990d50 +1, 192, 192, 32, 36, 0x3bea0f01 +1, 224, 224, 32, 36, 0x00320e59 +1, 256, 256, 32, 36, 0xdb720df9 +1, 288, 288, 32, 36, 0x01e00f7b +1, 320, 320, 32, 36, 0x9f790ad3 +1, 352, 352, 32, 36, 0xdee80c66 +1, 384, 384, 32, 36, 0xbc6e0a89 +1, 416, 416, 32, 36, 0x270e11da +1, 448, 448, 32, 36, 0xb5ae0985 +1, 480, 480, 32, 36, 0x3dff131c +1, 512, 512, 32, 36, 0x0d1a0cbb +1, 544, 544, 32, 36, 0x32df0fd0 +1, 576, 576, 32, 36, 0x9ae909ee +1, 608, 608, 32, 36, 0xd38e0c8a +1, 640, 640, 32, 36, 0x96d01703 +1, 672, 672, 32, 36, 0xf5ff0d6a +1, 704, 704, 32, 36, 0xf46d0dbb +1, 736, 736, 32, 36, 0x03460e89 +1, 768, 768, 32, 36, 0xd4ce0e77 +1, 800, 800, 32, 36, 0xd6090b2d +1, 832, 832, 32, 36, 0x1c7911b8 +1, 864, 864, 32, 36, 0x377113fb +1, 896, 896, 32, 36, 0x0bf50e23 +1, 928, 928, 32, 36, 0xc1420d33 +1, 960, 960, 32, 36, 0x0a660fe4 +1, 992, 992, 32, 36, 0x3192125c +1, 1024, 1024, 32, 36, 0x3c9712cc +1, 1056, 1056, 32, 36, 0x6351126a +1, 1088, 1088, 32, 36, 0xca7b0b7f +1, 1120, 1120, 32, 36, 0xe5650cda +1, 1152, 1152, 32, 36, 0x242a1146 +1, 1184, 1184, 32, 36, 0x9c680974 +1, 1216, 1216, 32, 36, 0x1bd80e5f +1, 1248, 1248, 32, 36, 0x07bc0ef2 +1, 1280, 1280, 32, 36, 0x16f51030 +1, 1312, 1312, 32, 36, 0x49901397 +1, 1344, 1344, 32, 36, 0xe7db0c6e +1, 1376, 1376, 32, 36, 0xef990cf3 +1, 1408, 1408, 32, 36, 0xf73e0e1f +1, 1440, 1440, 32, 36, 0x2c5a10f0 +1, 1472, 1472, 32, 36, 0x7e3b06ea +1, 1504, 1504, 32, 36, 0xd7050df4 +1, 1536, 1536, 32, 36, 0x5db8130b +1, 1568, 1568, 32, 36, 0x206e102c +1, 1600, 1600, 32, 36, 0xf60c0db0 +1, 1632, 1632, 32, 36, 0x17fc0ff4 +1, 1664, 1664, 32, 36, 0x00731026 +1, 1696, 1696, 32, 36, 0xf23d0e80 +1, 1728, 1728, 32, 36, 0x74871484 +1, 1760, 1760, 32, 36, 0x09d60fb2 +1, 1792, 1792, 32, 36, 0xe57d0e39 +1, 1824, 1824, 32, 36, 0xf7c20ea8 +0, 250, 250, 250, 692, 0x19670524, F=0x0 +1, 1856, 1856, 32, 36, 0xe05d0c77 +1, 1888, 1888, 32, 36, 0xe6510db4 +1, 1920, 1920, 32, 36, 0x55f1155b +1, 1952, 1952, 32, 36, 0xac5c0901 +1, 1984, 1984, 32, 36, 0xed0a0d2b +1, 2016, 2016, 32, 36, 0x9abb1864 +1, 2048, 2048, 32, 36, 0x140e0e5d +1, 2080, 2080, 32, 36, 0xab560a68 +1, 2112, 2112, 32, 36, 0x4642127e +1, 2144, 2144, 32, 36, 0xdf410da1 +1, 2176, 2176, 32, 36, 0x58541481 +1, 2208, 2208, 32, 36, 0x967a09bb +1, 2240, 2240, 32, 36, 0x020f0ef2 +1, 2272, 2272, 32, 36, 0x2fda10fd +1, 2304, 2304, 32, 36, 0x12400ed7 +1, 2336, 2336, 32, 36, 0x3205111f +1, 2368, 2368, 32, 36, 0xe89d0d14 +1, 2400, 2400, 32, 36, 0x095b0d69 +1, 2432, 2432, 32, 36, 0xb622098b +1, 2464, 2464, 32, 36, 0x627414b9 +1, 2496, 2496, 32, 36, 0xfe901071 +1, 2528, 2528, 32, 36, 0x5c061409 +1, 2560, 2560, 32, 36, 0xd7cc0ba1 +1, 2592, 2592, 32, 36, 0x3837137e +1, 2624, 2624, 32, 36, 0x9bd308f2 +1, 2656, 2656, 32, 36, 0xb4e20abc +1, 2688, 2688, 32, 36, 0x5b1913f8 +1, 2720, 2720, 32, 36, 0xa66b16ff +1, 2752, 2752, 32, 36, 0xecba0a93 +1, 2784, 2784, 32, 36, 0x6e46061c +1, 2816, 2816, 32, 36, 0x55541297 +1, 2848, 2848, 32, 36, 0x190311b4 +1, 2880, 2880, 32, 36, 0xbe401a3d +1, 2912, 2912, 32, 36, 0x16460e0f +1, 2944, 2944, 32, 36, 0xcd320c60 +1, 2976, 2976, 32, 36, 0x375c1154 +1, 3008, 3008, 32, 36, 0xd7170c60 +1, 3040, 3040, 32, 36, 0x660513b0 +1, 3072, 3072, 32, 36, 0x1247107b +1, 3104, 3104, 32, 36, 0x71171598 +1, 3136, 3136, 32, 36, 0xcb7a0d45 +1, 3168, 3168, 32, 36, 0xf59e0c7f +1, 3200, 3200, 32, 36, 0xc64e09c6 +1, 3232, 3232, 32, 36, 0x5ce91503 +1, 3264, 3264, 32, 36, 0x0bbf0e62 +1, 3296, 3296, 32, 36, 0x46c9124f +1, 3328, 3328, 32, 36, 0xfa9a0f26 +1, 3360, 3360, 32, 36, 0x26661106 +1, 3392, 3392, 32, 36, 0x58a311f5 +1, 3424, 3424, 32, 36, 0x07720f5d +1, 3456, 3456, 32, 36, 0x5af11158 +1, 3488, 3488, 32, 36, 0x2d341243 +1, 3520, 3520, 32, 36, 0x28851163 +1, 3552, 3552, 32, 36, 0x8803096e +1, 3584, 3584, 32, 36, 0xdfe60da7 +1, 3616, 3616, 32, 36, 0x6a911484 +1, 3648, 3648, 32, 36, 0x06990f6e +0, 500, 500, 250, 692, 0x19670524, F=0x0 +1, 3680, 3680, 32, 36, 0xb52309fb +1, 3712, 3712, 32, 36, 0x22751176 +1, 3744, 3744, 32, 36, 0xe6160d90 +1, 3776, 3776, 32, 36, 0x256910b3 +1, 3808, 3808, 32, 36, 0x2a771244 +1, 3840, 3840, 32, 36, 0x9ad50922 +1, 3872, 3872, 32, 36, 0x49701347 +1, 3904, 3904, 32, 36, 0x49c61186 +1, 3936, 3936, 32, 36, 0x91bd0793 +1, 3968, 3968, 32, 36, 0xa68409ce +1, 4000, 4000, 32, 36, 0x7483142d +1, 4032, 4032, 32, 36, 0x7a951701 +1, 4064, 4064, 32, 36, 0xd6380b6c +1, 4096, 4096, 32, 36, 0xe5d00c8f +1, 4128, 4128, 32, 36, 0x031b0fda +1, 4160, 4160, 32, 36, 0x04820ed5 +1, 4192, 4192, 32, 36, 0x6dca1417 +1, 4224, 4224, 32, 36, 0xc7190c5b +1, 4256, 4256, 32, 36, 0xc5750ac6 +1, 4288, 4288, 32, 36, 0xfdcd0f1e +1, 4320, 4320, 32, 36, 0xab06177d +1, 4352, 4352, 32, 36, 0x187e127c +1, 4384, 4384, 32, 36, 0x48760496 +1, 4416, 4416, 32, 36, 0xd62e0abc +1, 4448, 4448, 32, 36, 0x40041158 +1, 4480, 4480, 32, 36, 0xc0f10bfa +1, 4512, 4512, 32, 36, 0x29d00ffc +1, 4544, 4544, 32, 36, 0x2cf111d9 +1, 4576, 4576, 32, 36, 0x116a1053 +1, 4608, 4608, 32, 36, 0x9c2e0829 +1, 4640, 4640, 32, 36, 0xd1de0cd9 +1, 4672, 4672, 32, 36, 0x9f1517e7 +1, 4704, 4704, 32, 36, 0x31630f78 +1, 4736, 4736, 32, 36, 0xece00d79 +1, 4768, 4768, 32, 36, 0xe3570f37 +1, 4800, 4800, 32, 36, 0x822f1655 +1, 4832, 4832, 32, 36, 0x0112116d +1, 4864, 4864, 32, 36, 0x1bc80f3e +1, 4896, 4896, 32, 36, 0x958e08a3 +1, 4928, 4928, 32, 36, 0xc58a0c49 +1, 4960, 4960, 32, 36, 0x08671029 +1, 4992, 4992, 32, 36, 0x74d414e0 +1, 5024, 5024, 32, 36, 0x52691356 +1, 5056, 5056, 32, 36, 0xf97a0fce +1, 5088, 5088, 32, 36, 0x2da610cc +1, 5120, 5120, 32, 36, 0x22bc0fc2 +1, 5152, 5152, 32, 36, 0x743906b8 +1, 5184, 5184, 32, 36, 0x356910bd +1, 5216, 5216, 32, 36, 0x331611bb +1, 5248, 5248, 32, 36, 0x20a6115d +1, 5280, 5280, 32, 36, 0xd01c0d22 +1, 5312, 5312, 32, 36, 0xd6740ab4 +1, 5344, 5344, 32, 36, 0xa28309e9 +1, 5376, 5376, 32, 36, 0x2e6d1160 +1, 5408, 5408, 32, 36, 0x2dcb0ec1 +1, 5440, 5440, 32, 36, 0x3f7c10d7 +1, 5472, 5472, 32, 36, 0xe14e0ec0 +1, 5504, 5504, 32, 36, 0x459b1173 +0, 750, 750, 250, 692, 0x19670524, F=0x0 +1, 5536, 5536, 32, 36, 0xfe950eb3 +1, 5568, 5568, 32, 36, 0x7665075a +1, 5600, 5600, 32, 36, 0x7ca1084c +1, 5632, 5632, 32, 36, 0x29b910ce +1, 5664, 5664, 32, 36, 0xec180e15 +1, 5696, 5696, 32, 36, 0x2bd810c5 +1, 5728, 5728, 32, 36, 0xd2bd0c06 +1, 5760, 5760, 32, 36, 0xd6a30a4d +1, 5792, 5792, 32, 36, 0x1cbe118b +1, 5824, 5824, 32, 36, 0x2505108d +1, 5856, 5856, 32, 36, 0xfb220cfc +1, 5888, 5888, 32, 36, 0x14741035 +1, 5920, 5920, 32, 36, 0x89ca080a +1, 5952, 5952, 32, 36, 0xfcb80fdb +1, 5984, 5984, 32, 36, 0x30e310b3 +1, 6016, 6016, 32, 36, 0x635e1387 +1, 6048, 6048, 32, 36, 0x1bb71086 +1, 6080, 6080, 32, 36, 0xb4760bb3 +1, 6112, 6112, 32, 36, 0x5e901511 +1, 6144, 6144, 32, 36, 0xa2450813 +1, 6176, 6176, 32, 36, 0xf3580e70 +1, 6208, 6208, 32, 36, 0x0ed90f35 +1, 6240, 6240, 32, 36, 0x3343105c +1, 6272, 6272, 32, 36, 0x046c0f67 +1, 6304, 6304, 32, 36, 0x08770f71 +1, 6336, 6336, 32, 36, 0xb7c30c45 +1, 6368, 6368, 32, 36, 0xeb340bf0 +1, 6400, 6400, 32, 36, 0x514f12ff +1, 6432, 6432, 32, 36, 0x3b41135c +1, 6464, 6464, 32, 36, 0x22581023 +1, 6496, 6496, 32, 36, 0xebe20d46 +1, 6528, 6528, 32, 36, 0xf8af0d6b +1, 6560, 6560, 32, 36, 0xa5c51790 +1, 6592, 6592, 32, 36, 0xeb2b0df6 +1, 6624, 6624, 32, 36, 0xcfec0b92 +1, 6656, 6656, 32, 36, 0xe33b0c4a +1, 6688, 6688, 32, 36, 0xc9590be3 +1, 6720, 6720, 32, 36, 0xf4120d34 +1, 6752, 6752, 32, 36, 0x0a240d49 +1, 6784, 6784, 32, 36, 0x50c712fe +1, 6816, 6816, 32, 36, 0xf4020e27 +1, 6848, 6848, 32, 36, 0x01620f8f +1, 6880, 6880, 32, 36, 0x2cef11de +1, 6912, 6912, 32, 36, 0x09210ffa +1, 6944, 6944, 32, 36, 0xa81108f5 +1, 6976, 6976, 32, 36, 0x222f112c +1, 7008, 7008, 32, 36, 0xfb890ed4 +1, 7040, 7040, 32, 36, 0xe4400c34 +1, 7072, 7072, 32, 36, 0xae0708ea +1, 7104, 7104, 32, 36, 0xb55a086e +1, 7136, 7136, 32, 36, 0xa40b0a96 +1, 7168, 7168, 32, 36, 0x3d981253 +1, 7200, 7200, 32, 36, 0x21b61068 +1, 7232, 7232, 32, 36, 0x63361522 +1, 7264, 7264, 32, 36, 0xc86b0a27 +1, 7296, 7296, 32, 36, 0x109d0ee7 +1, 7328, 7328, 32, 36, 0x28bf0f53 +0, 1000, 1000, 250, 692, 0x19670524, F=0x0 +1, 7360, 7360, 32, 36, 0x236410f9 +1, 7392, 7392, 32, 36, 0xfdd20ee7 +1, 7424, 7424, 32, 36, 0x1eef0f2f +1, 7456, 7456, 32, 36, 0x03b40f8a +1, 7488, 7488, 32, 36, 0xe5830e04 +1, 7520, 7520, 32, 36, 0x29070fb1 +1, 7552, 7552, 32, 36, 0x6fa8150e +1, 7584, 7584, 32, 36, 0xbe0a0b5b +1, 7616, 7616, 32, 36, 0xd80c0bb9 +1, 7648, 7648, 32, 36, 0xed7f0d8b +1, 7680, 7680, 32, 36, 0xa9e90974 +1, 7712, 7712, 32, 36, 0x2728117c +1, 7744, 7744, 32, 36, 0x4834143d +1, 7776, 7776, 32, 36, 0x665413e9 +1, 7808, 7808, 32, 36, 0xdc480c88 +1, 7840, 7840, 32, 36, 0xf45a0d62 +1, 7872, 7872, 32, 36, 0x968e0928 +1, 7904, 7904, 32, 36, 0xf26d0d20 +1, 7936, 7936, 32, 36, 0x65b01343 +1, 7968, 7968, 32, 36, 0x73441438 +1, 8000, 8000, 32, 36, 0x314310f8 +1, 8032, 8032, 32, 36, 0xe3890c44 +1, 8064, 8064, 32, 36, 0xf1630d6f +1, 8096, 8096, 32, 36, 0x0f100fc1 +1, 8128, 8128, 32, 36, 0x5c5914ca +1, 8160, 8160, 32, 36, 0xdc000c55 +1, 8192, 8192, 32, 36, 0xdeab0d10 +1, 8224, 8224, 32, 36, 0x12661035 +1, 8256, 8256, 32, 36, 0x17b5105e +1, 8288, 8288, 32, 36, 0x39f71177 +1, 8320, 8320, 32, 36, 0xd1200b9e +1, 8352, 8352, 32, 36, 0xdc3d0d57 +1, 8384, 8384, 32, 36, 0x027c0f35 +1, 8416, 8416, 32, 36, 0x3f3d10eb +1, 8448, 8448, 32, 36, 0x493111d6 +1, 8480, 8480, 32, 36, 0x22a5106a +1, 8512, 8512, 32, 36, 0xfc7b0dbf +1, 8544, 8544, 32, 36, 0x6ea71312 +1, 8576, 8576, 32, 36, 0xd1a30b94 +1, 8608, 8608, 32, 36, 0x45f71213 +1, 8640, 8640, 32, 36, 0xd0c50d1a +1, 8672, 8672, 32, 36, 0x1e79102a +1, 8704, 8704, 32, 36, 0x35cf107c +1, 8736, 8736, 32, 36, 0x5f6706d0 +1, 8768, 8768, 32, 36, 0x1c4c1022 +1, 8800, 8800, 32, 36, 0xf7a10db0 +1, 8832, 8832, 32, 36, 0x14d00fa0 +1, 8864, 8864, 32, 36, 0x92241780 +1, 8896, 8896, 32, 36, 0x0bc80d9a +1, 8928, 8928, 32, 36, 0xcbb20a97 +1, 8960, 8960, 32, 36, 0xe1d00d8b +1, 8992, 8992, 32, 36, 0x09e10e8e +1, 9024, 9024, 32, 36, 0x16cd0d21 +1, 9056, 9056, 32, 36, 0xf67b0f57 +1, 9088, 9088, 32, 36, 0x862116fc +1, 9120, 9120, 32, 36, 0xb1010934 +1, 9152, 9152, 32, 36, 0x12020f82 +1, 9184, 9184, 32, 36, 0x46451261 +0, 1250, 1250, 250, 692, 0x19670524, F=0x0 +1, 9216, 9216, 32, 36, 0x59ed135e +1, 9248, 9248, 32, 36, 0x1bcd0fe6 +1, 9280, 9280, 32, 36, 0xc4c80b83 +1, 9312, 9312, 32, 36, 0x4799118b +1, 9344, 9344, 32, 36, 0x32e31191 +1, 9376, 9376, 32, 36, 0x829e0787 +1, 9408, 9408, 32, 36, 0x06a50f11 +1, 9440, 9440, 32, 36, 0x0ccd0e9a +1, 9472, 9472, 32, 36, 0x022f0d58 +1, 9504, 9504, 32, 36, 0x0bf91078 +1, 9536, 9536, 32, 36, 0x002b0e8c +1, 9568, 9568, 32, 36, 0x075f0de8 +1, 9600, 9600, 32, 36, 0x16ba0e9c +1, 9632, 9632, 32, 36, 0x479b1218 +1, 9664, 9664, 32, 36, 0xf6fd0ecd +1, 9696, 9696, 32, 36, 0x2e3e104a +1, 9728, 9728, 32, 36, 0xe12f0dab +1, 9760, 9760, 32, 36, 0xeaad0c5c +1, 9792, 9792, 32, 36, 0x05650e27 +1, 9824, 9824, 32, 36, 0x0f6f0f58 +1, 9856, 9856, 32, 36, 0x564213ae +1, 9888, 9888, 32, 36, 0x07810d71 +1, 9920, 9920, 32, 36, 0x2ad30f8a +1, 9952, 9952, 32, 36, 0x2da30ffd +1, 9984, 9984, 32, 36, 0x136b0f0e +1, 10016, 10016, 32, 36, 0x1f710eb7 +1, 10048, 10048, 32, 36, 0xf4850fb3 +1, 10080, 10080, 32, 36, 0xcdc40a85 +1, 10112, 10112, 32, 36, 0x0c400d07 +1, 10144, 10144, 32, 36, 0x38001061 +1, 10176, 10176, 32, 36, 0xa5400993 +1, 10208, 10208, 32, 36, 0x0d000eea +1, 10240, 10240, 32, 36, 0x4a68140b +1, 10272, 10272, 32, 36, 0x3e221193 +1, 10304, 10304, 32, 36, 0xdca00c8d +1, 10336, 10336, 32, 36, 0x0faf0e66 +1, 10368, 10368, 32, 36, 0xfc100f37 +1, 10400, 10400, 32, 36, 0x31d1111b +1, 10432, 10432, 32, 36, 0x9fcd082c +1, 10464, 10464, 32, 36, 0xd6c10a20 +1, 10496, 10496, 32, 36, 0xcbd30c77 +1, 10528, 10528, 32, 36, 0x3c7711ab +1, 10560, 10560, 32, 36, 0x3b651155 +1, 10592, 10592, 32, 36, 0xec1b0d84 +1, 10624, 10624, 32, 36, 0xa02308e4 +1, 10656, 10656, 32, 36, 0xd6310b90 +1, 10688, 10688, 32, 36, 0x31d4106e +1, 10720, 10720, 32, 36, 0x1fa70fd3 +1, 10752, 10752, 32, 36, 0x432f10f5 +1, 10784, 10784, 32, 36, 0xf5110f2f +1, 10816, 10816, 32, 36, 0x18a80fb8 +1, 10848, 10848, 32, 36, 0xf4e30c7b +1, 10880, 10880, 32, 36, 0xba900bd4 +1, 10912, 10912, 32, 36, 0xf79f0ead +1, 10944, 10944, 32, 36, 0x3c81123a +1, 10976, 10976, 32, 36, 0xeb4b0cb6 +1, 11008, 11008, 32, 36, 0x722713ee +0, 1500, 1500, 250, 4132, 0x17980a95 +1, 11040, 11040, 32, 36, 0x3cfa1162 +1, 11072, 11072, 32, 36, 0xe4500df7 +1, 11104, 11104, 32, 36, 0x1d800f9b +1, 11136, 11136, 32, 36, 0xe2e80c61 +1, 11168, 11168, 32, 36, 0x20e6115f +1, 11200, 11200, 32, 36, 0x00090f1f +1, 11232, 11232, 32, 36, 0x1cf10ef8 +1, 11264, 11264, 32, 36, 0xccd40cd1 +1, 11296, 11296, 32, 36, 0x4b5312b5 +1, 11328, 11328, 32, 36, 0xd52c0d69 +1, 11360, 11360, 32, 36, 0xf3270b75 +1, 11392, 11392, 32, 36, 0xef5b0cff +1, 11424, 11424, 32, 36, 0xe1810d5d +1, 11456, 11456, 32, 36, 0x5498137d +1, 11488, 11488, 32, 36, 0xcf880e2f +1, 11520, 11520, 32, 36, 0x1f9410ef +1, 11552, 11552, 32, 36, 0xfb350f29 +1, 11584, 11584, 32, 36, 0x0d2b0f8c +1, 11616, 11616, 32, 36, 0xd1220b45 +1, 11648, 11648, 32, 36, 0xe0470bfc +1, 11680, 11680, 32, 36, 0x4402115a +1, 11712, 11712, 32, 36, 0xf6420f2d +1, 11744, 11744, 32, 36, 0x00551064 +1, 11776, 11776, 32, 36, 0xf4680f2d +1, 11808, 11808, 32, 36, 0x234f111a +1, 11840, 11840, 32, 36, 0x3a6711ee +1, 11872, 11872, 32, 36, 0x4bab129b +1, 11904, 11904, 32, 36, 0x953308fb +1, 11936, 11936, 32, 36, 0x88a10832 +1, 11968, 11968, 32, 36, 0xd1640ba7 +1, 12000, 12000, 32, 36, 0xf6b80dfa +1, 12032, 12032, 32, 36, 0x345e0fd0 +1, 12064, 12064, 32, 36, 0x7b7b169f +1, 12096, 12096, 32, 36, 0x610e1512 +1, 12128, 12128, 32, 36, 0x6d5e1574 +1, 12160, 12160, 32, 36, 0x64931474 +1, 12192, 12192, 32, 36, 0x59151209 +1, 12224, 12224, 32, 36, 0xfc370d3f +1, 12256, 12256, 32, 36, 0xc747099f +1, 12288, 12288, 32, 36, 0xb6440913 +1, 12320, 12320, 32, 36, 0xba8f09ce +1, 12352, 12352, 32, 36, 0x053e0ebd +1, 12384, 12384, 32, 36, 0x11a20f40 +1, 12416, 12416, 32, 36, 0x24711378 +1, 12448, 12448, 32, 36, 0x78bf162c +1, 12480, 12480, 32, 36, 0xd3291a80 +1, 12512, 12512, 32, 36, 0x861a17aa +1, 12544, 12544, 32, 36, 0x440b132b +1, 12576, 12576, 32, 36, 0x16521134 +1, 12608, 12608, 32, 36, 0x0bf90ef5 +1, 12640, 12640, 32, 36, 0xa5a80a32 +1, 12672, 12672, 32, 36, 0xf89d0d25 +1, 12704, 12704, 32, 36, 0x9941081e +1, 12736, 12736, 32, 36, 0xaf8c0958 +1, 12768, 12768, 32, 36, 0x7f2c06f1 +1, 12800, 12800, 32, 36, 0xa49c0908 +1, 12832, 12832, 32, 36, 0xd2140b31 +0, 1750, 1750, 250, 15856, 0xa8544433, F=0x0 +1, 12864, 12864, 32, 36, 0x2ce911fe +1, 12896, 12896, 32, 36, 0x8b1f173e +1, 12928, 12928, 32, 36, 0x7cfa1735 +1, 12960, 12960, 32, 36, 0x7aa016b3 +1, 12992, 12992, 32, 36, 0x623216ea +1, 13024, 13024, 32, 36, 0x8acb1769 +1, 13056, 13056, 32, 36, 0x1837110a +1, 13088, 13088, 32, 36, 0x2403109e +1, 13120, 13120, 32, 36, 0x42bf11ce +1, 13152, 13152, 32, 36, 0xf6120d7f +1, 13184, 13184, 32, 36, 0x24f50e9a +1, 13216, 13216, 32, 36, 0xd0a20a2a +1, 13248, 13248, 32, 36, 0xc2630944 +1, 13280, 13280, 32, 36, 0xf6470af5 +1, 13312, 13312, 32, 36, 0xc2dd09f5 +1, 13344, 13344, 32, 36, 0x821d06fa +1, 13376, 13376, 32, 36, 0xde0b0b39 +1, 13408, 13408, 32, 36, 0x1d601056 +1, 13440, 13440, 32, 36, 0xd0560daa +1, 13472, 13472, 32, 36, 0x23df114a +1, 13504, 13504, 32, 36, 0x4571106a +1, 13536, 13536, 32, 36, 0xd7dc0bac +1, 13568, 13568, 32, 36, 0x685b13ca +1, 13600, 13600, 32, 36, 0xf42c0f4c +1, 13632, 13632, 32, 36, 0x3c341108 +1, 13664, 13664, 32, 36, 0x216c0fad +1, 13696, 13696, 32, 36, 0x0d57103d +1, 13728, 13728, 32, 36, 0x12450f28 +1, 13760, 13760, 32, 36, 0x50951099 +1, 13792, 13792, 32, 36, 0x471c125e +1, 13824, 13824, 32, 36, 0x44da1227 +1, 13856, 13856, 32, 36, 0xe99e0e50 +1, 13888, 13888, 32, 36, 0x120a1194 +1, 13920, 13920, 32, 36, 0x378d1085 +1, 13952, 13952, 32, 36, 0xb7c009c2 +1, 13984, 13984, 32, 36, 0x3a9c0e78 +1, 14016, 14016, 32, 36, 0x27f20f6c +1, 14048, 14048, 32, 36, 0xd2020d12 +1, 14080, 14080, 32, 36, 0x49fb0ed4 +1, 14112, 14112, 32, 36, 0x30731031 +1, 14144, 14144, 32, 36, 0xb2950d01 +1, 14176, 14176, 32, 36, 0xd4a40cdb +1, 14208, 14208, 32, 36, 0xf59c0bd8 +1, 14240, 14240, 32, 36, 0xcd020a0e +1, 14272, 14272, 32, 36, 0xdab80b5d +1, 14304, 14304, 32, 36, 0xf50d0bdf +1, 14336, 14336, 32, 36, 0x36c210b2 +1, 14368, 14368, 32, 36, 0x5eee137a +1, 14400, 14400, 32, 36, 0x49e413b8 +1, 14432, 14432, 32, 36, 0xfc130e85 +1, 14464, 14464, 32, 36, 0x1bfc0ef6 +1, 14496, 14496, 32, 36, 0x4f2c1360 +1, 14528, 14528, 32, 36, 0x97570b31 +1, 14560, 14560, 32, 36, 0xccda0cb9 +1, 14592, 14592, 32, 36, 0xb03909bf +1, 14624, 14624, 32, 36, 0xadb708ed +1, 14656, 14656, 32, 36, 0xd3250b3b +1, 14688, 14688, 32, 36, 0xdd8f0acc +0, 2000, 2000, 250, 5188, 0xa62b9e22, F=0x0 +1, 14720, 14720, 32, 36, 0x3e9c11a6 +1, 14752, 14752, 32, 36, 0x225d1011 +1, 14784, 14784, 32, 36, 0x42040ebb +1, 14816, 14816, 32, 36, 0x0dbf0f33 +1, 14848, 14848, 32, 36, 0x91d81647 +1, 14880, 14880, 32, 36, 0x09d20ff1 +1, 14912, 14912, 32, 36, 0xfce60ef2 +1, 14944, 14944, 32, 36, 0x1aa30f99 +1, 14976, 14976, 32, 36, 0x7d861571 +1, 15008, 15008, 32, 36, 0x6ff6130c +1, 15040, 15040, 32, 36, 0x4d18131e +1, 15072, 15072, 32, 36, 0x22aa0fe4 +1, 15104, 15104, 32, 36, 0x05310ec6 +1, 15136, 15136, 32, 36, 0x15a00f13 +1, 15168, 15168, 32, 36, 0xd88f0db6 +1, 15200, 15200, 32, 36, 0xa24e0aa8 +1, 15232, 15232, 32, 36, 0xde2c0b32 +1, 15264, 15264, 32, 36, 0xf3fb0dba +1, 15296, 15296, 32, 36, 0x01390d97 +1, 15328, 15328, 32, 36, 0xb4e20cfa +1, 15360, 15360, 32, 36, 0xb4cb0a40 +1, 15392, 15392, 32, 36, 0x16060ec7 +1, 15424, 15424, 32, 36, 0xba880d81 +1, 15456, 15456, 32, 36, 0x28b41135 +1, 15488, 15488, 32, 36, 0xf6da0dab +1, 15520, 15520, 32, 36, 0xfb810e94 +1, 15552, 15552, 32, 36, 0x321c0f95 +1, 15584, 15584, 32, 36, 0x31250ffe +1, 15616, 15616, 32, 36, 0x2db9124e +1, 15648, 15648, 32, 36, 0x6495131b +1, 15680, 15680, 32, 36, 0x7b2c15c4 +1, 15712, 15712, 32, 36, 0x3d59110a +1, 15744, 15744, 32, 36, 0x7b261531 +1, 15776, 15776, 32, 36, 0x2312100f +1, 15808, 15808, 32, 36, 0x10c20f3d +1, 15840, 15840, 32, 36, 0x40fa1186 +1, 15872, 15872, 32, 36, 0xf7000e57 +1, 15904, 15904, 32, 36, 0xf3e10ee3 +1, 15936, 15936, 32, 36, 0x176c0ece +1, 15968, 15968, 32, 36, 0x1c720f69 +1, 16000, 16000, 32, 36, 0xee220e1d +1, 16032, 16032, 32, 36, 0xea8e0cf7 +1, 16064, 16064, 32, 36, 0xd4c20bf1 +1, 16096, 16096, 32, 36, 0xc6570db0 +1, 16128, 16128, 32, 36, 0xde310f99 +1, 16160, 16160, 32, 36, 0x0a191004 +1, 16192, 16192, 32, 36, 0x2e2d1314 +1, 16224, 16224, 32, 36, 0x09a21155 +1, 16256, 16256, 32, 36, 0x4b920fba +1, 16288, 16288, 32, 36, 0x669410d4 +1, 16320, 16320, 32, 36, 0x0e9f0d80 +1, 16352, 16352, 32, 36, 0x3c800fe6 +1, 16384, 16384, 32, 36, 0x499a0ff4 +1, 16416, 16416, 32, 36, 0x49541083 +1, 16448, 16448, 32, 36, 0x6d891200 +1, 16480, 16480, 32, 36, 0x8f0215d9 +1, 16512, 16512, 32, 36, 0x4b2e114a +1, 16544, 16544, 32, 36, 0x3c2612aa +1, 16576, 16576, 32, 36, 0xfa91105e +1, 16608, 16608, 32, 36, 0x28e412db +1, 16640, 16640, 32, 36, 0xe82f0f43 +1, 16672, 16672, 32, 36, 0xd8010dc9 +1, 16704, 16704, 32, 36, 0xf06f0e2e +1, 16736, 16736, 32, 36, 0x11000fd2 +1, 16768, 16768, 32, 36, 0xb5540d40 +1, 16800, 16800, 32, 36, 0xd3570d74 +1, 16832, 16832, 32, 36, 0x38411083 +1, 16864, 16864, 32, 36, 0x034a0dfb +1, 16896, 16896, 32, 36, 0x15d20f0b +1, 16928, 16928, 32, 36, 0xd1e40c30 +1, 16960, 16960, 32, 36, 0x9d5c164c +1, 16992, 16992, 32, 36, 0x56231320 +1, 17024, 17024, 32, 36, 0x02740e7e +1, 17056, 17056, 32, 36, 0x455a11f6 +1, 17088, 17088, 32, 36, 0x01290e6b +1, 17120, 17120, 32, 36, 0xea900e9f +1, 17152, 17152, 32, 36, 0x93180932 +1, 17184, 17184, 32, 36, 0xe9680dee +1, 17216, 17216, 32, 36, 0xf33a0d07 +1, 17248, 17248, 32, 36, 0xeaef0d65 +1, 17280, 17280, 32, 36, 0xf6a80e5d +1, 17312, 17312, 32, 36, 0x24d21239 +1, 17344, 17344, 32, 36, 0x6c9a1618 +1, 17376, 17376, 32, 36, 0x20be0fb2 +1, 17408, 17408, 32, 36, 0xec0a0d7d +1, 17440, 17440, 32, 36, 0xf1da0d29 +1, 17472, 17472, 32, 36, 0xef790c6c +1, 17504, 17504, 32, 36, 0x072b0c5e +1, 17536, 17536, 32, 36, 0xf7690cfb +1, 17568, 17568, 32, 36, 0x182d0e73 +1, 17600, 17600, 32, 36, 0x0f9a0dc9 +1, 17632, 17632, 32, 36, 0x66de13dc +1, 17664, 17664, 32, 36, 0x00f00f99 +1, 17696, 17696, 32, 36, 0xe4ef0edd +1, 17728, 17728, 32, 36, 0x55b211e1 +1, 17760, 17760, 32, 36, 0x0aee1017 +1, 17792, 17792, 32, 36, 0xd1cc0d16 +1, 17824, 17824, 32, 36, 0xcd600bf3 +1, 17856, 17856, 32, 36, 0x1bc20f4f +1, 17888, 17888, 32, 36, 0x91000860 +1, 17920, 17920, 32, 36, 0xbc920b07 +1, 17952, 17952, 32, 36, 0xe22e0d3c +1, 17984, 17984, 32, 36, 0xeac30c80 +1, 18016, 18016, 32, 36, 0x07f10eb0 +1, 18048, 18048, 32, 36, 0xe5ec0d04 +1, 18080, 18080, 32, 36, 0xea870eab +1, 18112, 18112, 32, 36, 0x213f1033 +1, 18144, 18144, 32, 36, 0x3bf911b1 +1, 18176, 18176, 32, 36, 0xe5890ee7 +1, 18208, 18208, 32, 36, 0x6ae0141f +1, 18240, 18240, 32, 36, 0x465c130a +1, 18272, 18272, 32, 36, 0x1aa50fca +1, 18304, 18304, 32, 36, 0xf2150d3c +1, 18336, 18336, 32, 36, 0x1deb0e27 +1, 18368, 18368, 32, 36, 0x29740ff8 +1, 18400, 18400, 32, 36, 0x080c0e6c +1, 18432, 18432, 32, 36, 0x0bd10ee8 +1, 18464, 18464, 32, 36, 0x0f141063 +1, 18496, 18496, 32, 36, 0x34901083 +1, 18528, 18528, 32, 36, 0xd5c00bb2 +1, 18560, 18560, 32, 36, 0x10ff0e3a +1, 18592, 18592, 32, 36, 0x46ff1150 +1, 18624, 18624, 32, 36, 0x4f4e12ca +1, 18656, 18656, 32, 36, 0x90bf15aa +1, 18688, 18688, 32, 36, 0x74ed13f9 +1, 18720, 18720, 32, 36, 0x0e220f0d +1, 18752, 18752, 32, 36, 0x04ee10b1 +1, 18784, 18784, 32, 36, 0xf1021000 +1, 18816, 18816, 32, 36, 0x31121108 +1, 18848, 18848, 32, 36, 0x35d1125f +1, 18880, 18880, 32, 36, 0x04131073 +1, 18912, 18912, 32, 36, 0xdef90d1a +1, 18944, 18944, 32, 36, 0xdcaa0c95 +1, 18976, 18976, 32, 36, 0x27d0107e +1, 19008, 19008, 32, 36, 0xeb7d0e4e +1, 19040, 19040, 32, 36, 0xbb990b11 +1, 19072, 19072, 32, 36, 0xdac50c08 +1, 19104, 19104, 32, 36, 0xf8620e32 +1, 19136, 19136, 32, 36, 0x33b7113a +1, 19168, 19168, 32, 36, 0x09b71170 +1, 19200, 19200, 32, 36, 0x0bc70f13 +1, 19232, 19232, 32, 36, 0x14191199 +1, 19264, 19264, 32, 36, 0xbc950aa2 +1, 19296, 19296, 32, 36, 0xecde0def +1, 19328, 19328, 32, 36, 0xf69b0e79 +1, 19360, 19360, 32, 36, 0x46b60f9a +1, 19392, 19392, 32, 36, 0x164b0ff6 +1, 19424, 19424, 32, 36, 0x17da1062 +1, 19456, 19456, 32, 36, 0x237e1073 +1, 19488, 19488, 32, 36, 0xe3de0efa +1, 19520, 19520, 32, 36, 0xf10c0e27 +1, 19552, 19552, 32, 36, 0xfed6102c +1, 19584, 19584, 32, 36, 0x3c711105 +1, 19616, 19616, 32, 36, 0x5611120d +1, 19648, 19648, 32, 36, 0x0ce50e43 +1, 19680, 19680, 32, 36, 0x17430eef +1, 19712, 19712, 32, 36, 0x1e091083 +1, 19744, 19744, 32, 36, 0x356a1129 +1, 19776, 19776, 32, 36, 0x41bb10dd +1, 19808, 19808, 32, 36, 0x2b3d10ac +1, 19840, 19840, 32, 36, 0x00d60c94 +1, 19872, 19872, 32, 36, 0x232c0f44 +1, 19904, 19904, 32, 36, 0xdb240b6f +1, 19936, 19936, 32, 36, 0xfcfd0e5e +1, 19968, 19968, 32, 36, 0x89eb07a0 +1, 20000, 20000, 32, 36, 0x28ac0fc7 +1, 20032, 20032, 32, 36, 0x0c640e8c +1, 20064, 20064, 32, 36, 0x29031046 +1, 20096, 20096, 32, 36, 0x0d781021 +1, 20128, 20128, 32, 36, 0x4fa114db +1, 20160, 20160, 32, 36, 0x37be11ff +1, 20192, 20192, 32, 36, 0x568612f3 +1, 20224, 20224, 32, 36, 0x0b380def +1, 20256, 20256, 32, 36, 0x349f1224 +1, 20288, 20288, 32, 36, 0x65f6128a +1, 20320, 20320, 32, 36, 0x1e030ec1 +1, 20352, 20352, 32, 36, 0x1db60ea9 +1, 20384, 20384, 32, 36, 0xeb020e1a +1, 20416, 20416, 32, 36, 0xc9e90b24 +1, 20448, 20448, 32, 36, 0x189e1138 +1, 20480, 20480, 32, 36, 0xd3540a81 +1, 20512, 20512, 32, 36, 0x33601087 +1, 20544, 20544, 32, 36, 0xe8ff0d9d +1, 20576, 20576, 32, 36, 0xca8a0ae5 +1, 20608, 20608, 32, 36, 0x38e7132c +1, 20640, 20640, 32, 36, 0x03650ebd +1, 20672, 20672, 32, 36, 0x5f7012f3 +1, 20704, 20704, 32, 36, 0x18d110dc +1, 20736, 20736, 32, 36, 0xf7450e08 +1, 20768, 20768, 32, 36, 0x11b00e6f +1, 20800, 20800, 32, 36, 0xc0670af1 +1, 20832, 20832, 32, 36, 0x49371251 +1, 20864, 20864, 32, 36, 0x3cf712a9 +1, 20896, 20896, 32, 36, 0x524712d1 +1, 20928, 20928, 32, 36, 0x387110db +1, 20960, 20960, 32, 36, 0x601912fd +1, 20992, 20992, 32, 36, 0x0c5b0eee +1, 21024, 21024, 32, 36, 0x12670ec3 +1, 21056, 21056, 32, 36, 0xf7100deb +1, 21088, 21088, 32, 36, 0x38b710f3 +1, 21120, 21120, 32, 36, 0x2ca31130 +1, 21152, 21152, 32, 36, 0x3532107a +1, 21184, 21184, 32, 36, 0x39aa113c +1, 21216, 21216, 32, 36, 0x023c0f36 +1, 21248, 21248, 32, 36, 0x1a9c1098 +1, 21280, 21280, 32, 36, 0x303c1058 +1, 21312, 21312, 32, 36, 0x24e910fc +1, 21344, 21344, 32, 36, 0x2df11162 +1, 21376, 21376, 32, 36, 0xef520d7c +1, 21408, 21408, 32, 36, 0x0a000f30 +1, 21440, 21440, 32, 36, 0x09b30e47 +1, 21472, 21472, 32, 36, 0xf1e90d08 +1, 21504, 21504, 32, 36, 0x576c128a +1, 21536, 21536, 32, 36, 0x1f640f97 +1, 21568, 21568, 32, 36, 0x195b0eac +1, 21600, 21600, 32, 36, 0xe47e0d05 +1, 21632, 21632, 32, 36, 0xda1c0caa +1, 21664, 21664, 32, 36, 0x20da0ef5 +1, 21696, 21696, 32, 36, 0xd1ef0d80 +1, 21728, 21728, 32, 36, 0x85271574 +1, 21760, 21760, 32, 36, 0xef860df7 +1, 21792, 21792, 32, 36, 0x394f1112 +1, 21824, 21824, 32, 36, 0x33ea1140 +1, 21856, 21856, 32, 36, 0x238f10e1 +1, 21888, 21888, 32, 36, 0x26d3105a +1, 21920, 21920, 32, 36, 0x3e3a114a +1, 21952, 21952, 32, 36, 0x0a890ff3 +1, 21984, 21984, 32, 36, 0xc5190bfc +1, 22016, 22016, 32, 36, 0x6d1413a7 +1, 22048, 22048, 32, 36, 0xfadb0deb +1, 22080, 22080, 32, 36, 0x3a80139f +1, 22112, 22112, 32, 36, 0x18b110ae +1, 22144, 22144, 32, 36, 0x12141063 +1, 22176, 22176, 32, 36, 0x2dc61085 +1, 22208, 22208, 32, 36, 0xd3b50c13 +1, 22240, 22240, 32, 36, 0x2d931174 +1, 22272, 22272, 32, 36, 0x28f810bf +1, 22304, 22304, 32, 36, 0x0c010fb3 +1, 22336, 22336, 32, 36, 0xfe300e3e +1, 22368, 22368, 32, 36, 0xd1220b81 +1, 22400, 22400, 32, 36, 0x021f0f3b +1, 22432, 22432, 32, 36, 0x3a0910a9 +1, 22464, 22464, 32, 36, 0x4e8912ec +1, 22496, 22496, 32, 36, 0x645b13e4 +1, 22528, 22528, 32, 36, 0x6fc414d6 +1, 22560, 22560, 32, 36, 0x374c1027 +1, 22592, 22592, 32, 36, 0x376b122f +1, 22624, 22624, 32, 36, 0x4a2111b8 +1, 22656, 22656, 32, 36, 0x2def108e +1, 22688, 22688, 32, 36, 0xcbc50b71 +1, 22720, 22720, 32, 36, 0x106f0f82 +1, 22752, 22752, 32, 36, 0xed0b0d09 +1, 22784, 22784, 32, 36, 0x25b81060 +1, 22816, 22816, 32, 36, 0xfef90e5a +1, 22848, 22848, 32, 36, 0x9aeb0bad +1, 22880, 22880, 32, 36, 0x11250eeb +1, 22912, 22912, 32, 36, 0xfb350cc7 +1, 22944, 22944, 32, 36, 0x001e0d8f +1, 22976, 22976, 32, 36, 0x38a10ff0 +1, 23008, 23008, 32, 36, 0x09cd0de7 +1, 23040, 23040, 32, 36, 0x1810102d +1, 23072, 23072, 32, 36, 0xc3760bcd +1, 23104, 23104, 32, 36, 0x13220ff9 +1, 23136, 23136, 32, 36, 0x03400c60 +1, 23168, 23168, 32, 36, 0x17710efe +1, 23200, 23200, 32, 36, 0x4df8115d +1, 23232, 23232, 32, 36, 0x13260fd9 +1, 23264, 23264, 32, 36, 0x21c2105f +1, 23296, 23296, 32, 36, 0xd0370c8f +1, 23328, 23328, 32, 36, 0x5640131a +1, 23360, 23360, 32, 36, 0x434c1129 +1, 23392, 23392, 32, 36, 0x8e4516e7 +1, 23424, 23424, 32, 36, 0x2fd11270 +1, 23456, 23456, 32, 36, 0x79b9134a +1, 23488, 23488, 32, 36, 0x00350d66 +1, 23520, 23520, 32, 36, 0x60c812b2 +1, 23552, 23552, 32, 36, 0xd6ed0cac +1, 23584, 23584, 32, 36, 0xdd370b85 +1, 23616, 23616, 32, 36, 0x9ffe09d7 +1, 23648, 23648, 32, 36, 0x0b6a0f6c +1, 23680, 23680, 32, 36, 0xf4a20dc5 +1, 23712, 23712, 32, 36, 0x30191180 +1, 23744, 23744, 32, 36, 0x66a11363 +1, 23776, 23776, 32, 36, 0x3b9210a7 +1, 23808, 23808, 32, 36, 0x7796153b +1, 23840, 23840, 32, 36, 0x1cd01031 +1, 23872, 23872, 32, 36, 0x0dbb0eac +1, 23904, 23904, 32, 36, 0x1d0e101a +1, 23936, 23936, 32, 36, 0x2cf61125 +1, 23968, 23968, 32, 36, 0xeccc0d17 +1, 24000, 24000, 32, 36, 0x38e911fc +1, 24032, 24032, 32, 36, 0xdb390c0a +1, 24064, 24064, 32, 36, 0xd7c50c26 +1, 24096, 24096, 32, 36, 0x22f910c0 +1, 24128, 24128, 32, 36, 0xec740e58 +1, 24160, 24160, 32, 36, 0x26ac120c +1, 24192, 24192, 32, 36, 0x0d970fe5 +1, 24224, 24224, 32, 36, 0xe3f10e27 +1, 24256, 24256, 32, 36, 0x357212c1 +1, 24288, 24288, 32, 36, 0x203110c8 +1, 24320, 24320, 32, 36, 0xe35e0d9c +1, 24352, 24352, 32, 36, 0xfac00d57 +1, 24384, 24384, 32, 36, 0x3f5510a0 +1, 24416, 24416, 32, 36, 0x26cc0fa7 +1, 24448, 24448, 32, 36, 0x891914a1 +1, 24480, 24480, 32, 36, 0x147b0e72 +1, 24512, 24512, 32, 36, 0x580313fd +1, 24544, 24544, 32, 36, 0x28ee1091 +1, 24576, 24576, 32, 36, 0x5f541255 +1, 24608, 24608, 32, 36, 0xcdcc0b68 +1, 24640, 24640, 32, 36, 0x167e1147 +1, 24672, 24672, 32, 36, 0x3d5d10e5 +1, 24704, 24704, 32, 36, 0xdc3f0b04 +1, 24736, 24736, 32, 36, 0x00d10db8 +1, 24768, 24768, 32, 36, 0x0f6410da +1, 24800, 24800, 32, 36, 0xd7570cd9 +1, 24832, 24832, 32, 36, 0x40f31110 +1, 24864, 24864, 32, 36, 0x0ad60ff0 +1, 24896, 24896, 32, 36, 0x3389117f +1, 24928, 24928, 32, 36, 0xec5b0dfd +1, 24960, 24960, 32, 36, 0x122b0f70 +1, 24992, 24992, 32, 36, 0x32fb1147 +1, 25024, 25024, 32, 36, 0x405f11f1 +1, 25056, 25056, 32, 36, 0xe3040c2a +1, 25088, 25088, 32, 36, 0xe1a90c7e +1, 25120, 25120, 32, 36, 0x4483125c +1, 25152, 25152, 32, 36, 0x1456103d +1, 25184, 25184, 32, 36, 0x1d4d100d +1, 25216, 25216, 32, 36, 0x5f011259 +1, 25248, 25248, 32, 36, 0x426c1260 +1, 25280, 25280, 32, 36, 0x14d90ebf +1, 25312, 25312, 32, 36, 0x15a00f9d +1, 25344, 25344, 32, 36, 0x14a00ee3 +1, 25376, 25376, 32, 36, 0x01130fb8 +1, 25408, 25408, 32, 36, 0x00c90ecc +1, 25440, 25440, 32, 36, 0xe5ec0d47 +1, 25472, 25472, 32, 36, 0xa81e085b +1, 25504, 25504, 32, 36, 0xf3720d0d +1, 25536, 25536, 32, 36, 0x253e0e75 +1, 25568, 25568, 32, 36, 0xf87c0ef2 +1, 25600, 25600, 32, 36, 0xf8820e8e +1, 25632, 25632, 32, 36, 0x14d60f49 +1, 25664, 25664, 32, 36, 0x52191295 +1, 25696, 25696, 32, 36, 0x2e851128 +1, 25728, 25728, 32, 36, 0x31a81068 +1, 25760, 25760, 32, 36, 0x3b0d0f7a +1, 25792, 25792, 32, 36, 0x1f9c1143 +1, 25824, 25824, 32, 36, 0x3a6c0ebc +1, 25856, 25856, 32, 36, 0x1f530ebf +1, 25888, 25888, 32, 36, 0x1be90feb +1, 25920, 25920, 32, 36, 0xceea0dfc +1, 25952, 25952, 32, 36, 0xe7f70d9b +1, 25984, 25984, 32, 36, 0x06ca0ef7 +1, 26016, 26016, 32, 36, 0x4305109a +1, 26048, 26048, 32, 36, 0x2f6b0fd1 +1, 26080, 26080, 32, 36, 0x335b11b7 +1, 26112, 26112, 32, 36, 0x438d139a +1, 26144, 26144, 32, 36, 0x38f110e4 +1, 26176, 26176, 32, 36, 0x06750f86 +1, 26208, 26208, 32, 36, 0x59b212be +1, 26240, 26240, 32, 36, 0x08730da2 +1, 26272, 26272, 32, 36, 0xd34b0cdc +1, 26304, 26304, 32, 36, 0x19b21045 +1, 26336, 26336, 32, 36, 0x1b84103c +1, 26368, 26368, 32, 36, 0x0e760e8c +1, 26400, 26400, 32, 36, 0xf9da0ca1 +1, 26432, 26432, 32, 36, 0x1aec0f89 +1, 26464, 26464, 32, 36, 0xcfd30cd3 +1, 26496, 26496, 32, 36, 0x966a0ae4 +1, 26528, 26528, 32, 36, 0x582b1279 +1, 26560, 26560, 32, 36, 0x072b0ec5 +1, 26592, 26592, 32, 36, 0x3a6e1254 +1, 26624, 26624, 32, 36, 0xd0b40d2f +1, 26656, 26656, 32, 36, 0xbc210b58 +1, 26688, 26688, 32, 36, 0xcc470b9e +1, 26720, 26720, 32, 36, 0x04d10e1c +1, 26752, 26752, 32, 36, 0x0c550e89 +1, 26784, 26784, 32, 36, 0xf4400d7c +1, 26816, 26816, 32, 36, 0x00490d42 +1, 26848, 26848, 32, 36, 0x44ab11a4 +1, 26880, 26880, 32, 36, 0x88dc16ab +1, 26912, 26912, 32, 36, 0x8a351656 +1, 26944, 26944, 32, 36, 0x13fc0fa2 +1, 26976, 26976, 32, 36, 0x03b2114c +1, 27008, 27008, 32, 36, 0x1ea30f37 +1, 27040, 27040, 32, 36, 0x248e1131 +1, 27072, 27072, 32, 36, 0xf36f0fc8 +1, 27104, 27104, 32, 36, 0x22fb0ed5 +1, 27136, 27136, 32, 36, 0x2465121a +1, 27168, 27168, 32, 36, 0x2fe8109b +1, 27200, 27200, 32, 36, 0x3a84101e +1, 27232, 27232, 32, 36, 0x00270ea4 +1, 27264, 27264, 32, 36, 0x002e0d36 +1, 27296, 27296, 32, 36, 0x2a9010ac +1, 27328, 27328, 32, 36, 0xf25d0d38 +1, 27360, 27360, 32, 36, 0x6e3812fd +1, 27392, 27392, 32, 36, 0xcec20c58 +1, 27424, 27424, 32, 36, 0xe6ea0d7d +1, 27456, 27456, 32, 36, 0x0f490f49 +1, 27488, 27488, 32, 36, 0xe04c0f0f +1, 27520, 27520, 32, 36, 0x12880f2d +1, 27552, 27552, 32, 36, 0xf2e40e3d +1, 27584, 27584, 32, 36, 0x14021021 +1, 27616, 27616, 32, 36, 0x2b421024 +1, 27648, 27648, 32, 36, 0x1a521125 +1, 27680, 27680, 32, 36, 0x26a110db +1, 27712, 27712, 32, 36, 0x213d0f31 +1, 27744, 27744, 32, 36, 0x34c40fe8 +1, 27776, 27776, 32, 36, 0x3ed4123d +1, 27808, 27808, 32, 36, 0x01ca0e66 +1, 27840, 27840, 32, 36, 0x01a50e71 +1, 27872, 27872, 32, 36, 0x35e10fce +1, 27904, 27904, 32, 36, 0xe19a0d1a +1, 27936, 27936, 32, 36, 0x3b551396 +1, 27968, 27968, 32, 36, 0xe1b30db8 +1, 28000, 28000, 32, 36, 0x09e20e40 +1, 28032, 28032, 32, 36, 0xfb3c0db0 +1, 28064, 28064, 32, 36, 0xf6d90d85 +1, 28096, 28096, 32, 36, 0x476c122c +1, 28128, 28128, 32, 36, 0x3fbb11af +1, 28160, 28160, 32, 36, 0x457012eb +1, 28192, 28192, 32, 36, 0x0fa80e34 +1, 28224, 28224, 32, 36, 0x4de710da +1, 28256, 28256, 32, 36, 0x5f741202 +1, 28288, 28288, 32, 36, 0x41161405 +1, 28320, 28320, 32, 36, 0x5b6a1308 +1, 28352, 28352, 32, 36, 0xf42f0e6a +1, 28384, 28384, 32, 36, 0x34021184 +1, 28416, 28416, 32, 36, 0xfdbb0daa +1, 28448, 28448, 32, 36, 0xd9750d88 +1, 28480, 28480, 32, 36, 0x1fd1102e +1, 28512, 28512, 32, 36, 0x3dc01141 +1, 28544, 28544, 32, 36, 0x0a540f5a +1, 28576, 28576, 32, 36, 0xfc5a0d8f +1, 28608, 28608, 32, 36, 0xfae80dd9 +1, 28640, 28640, 32, 36, 0xf54b0dd2 +1, 28672, 28672, 32, 36, 0x16da0fa8 +1, 28704, 28704, 32, 36, 0x496e1205 +1, 28736, 28736, 32, 36, 0x375e11a0 +1, 28768, 28768, 32, 36, 0x4e911358 +1, 28800, 28800, 32, 36, 0x04840f60 +1, 28832, 28832, 32, 36, 0x2ff8107f +1, 28864, 28864, 32, 36, 0xf5fe0e9a +1, 28896, 28896, 32, 36, 0xe99a0e44 +1, 28928, 28928, 32, 36, 0x3ea411b8 +1, 28960, 28960, 32, 36, 0xf5ef0f01 +1, 28992, 28992, 32, 36, 0x18311074 +1, 29024, 29024, 32, 36, 0x16a30f28 +1, 29056, 29056, 32, 36, 0x1ced0dc1 +1, 29088, 29088, 32, 36, 0xdb570b00 +1, 29120, 29120, 32, 36, 0x1bb20ebf +1, 29152, 29152, 32, 36, 0x0bca0fcd +1, 29184, 29184, 32, 36, 0x064c104a +1, 29216, 29216, 32, 36, 0x30f6105c +1, 29248, 29248, 32, 36, 0x30f40fee +1, 29280, 29280, 32, 36, 0x0c1010c0 +1, 29312, 29312, 32, 36, 0x709514a5 +1, 29344, 29344, 32, 36, 0x24ac1187 +1, 29376, 29376, 32, 36, 0x2431106f +1, 29408, 29408, 32, 36, 0x1e5e1094 +1, 29440, 29440, 32, 36, 0x03a30cf8 +1, 29472, 29472, 32, 36, 0xf2fc0db6 +1, 29504, 29504, 32, 36, 0xdeba0b80 +1, 29536, 29536, 32, 36, 0x13db0fd8 +1, 29568, 29568, 32, 36, 0x400511dc +1, 29600, 29600, 32, 36, 0x00910fc0 +1, 29632, 29632, 32, 36, 0x245010f8 +1, 29664, 29664, 32, 36, 0x31db1356 +1, 29696, 29696, 32, 36, 0x78bb14d1 +1, 29728, 29728, 32, 36, 0x75151509 +1, 29760, 29760, 32, 36, 0xfb060c50 +1, 29792, 29792, 32, 36, 0xbb52096b +1, 29824, 29824, 32, 36, 0xe2780ba4 +1, 29856, 29856, 32, 36, 0xd8000c05 +1, 29888, 29888, 32, 36, 0xe3ea0cad +1, 29920, 29920, 32, 36, 0xd80d0c08 +1, 29952, 29952, 32, 36, 0x2032108a +1, 29984, 29984, 32, 36, 0xe4460d02 +1, 30016, 30016, 32, 36, 0x26771220 +1, 30048, 30048, 32, 36, 0x4e641311 +1, 30080, 30080, 32, 36, 0x16371141 +1, 30112, 30112, 32, 36, 0x2e481227 +1, 30144, 30144, 32, 36, 0xfb9b0e44 +1, 30176, 30176, 32, 36, 0x48131233 +1, 30208, 30208, 32, 36, 0x0ee50f68 +1, 30240, 30240, 32, 36, 0xff3f0ce0 +1, 30272, 30272, 32, 36, 0xfdcb0dfe +1, 30304, 30304, 32, 36, 0xbb080b5d +1, 30336, 30336, 32, 36, 0x15020dab +1, 30368, 30368, 32, 36, 0xfdc50e31 +1, 30400, 30400, 32, 36, 0x022f0efd +1, 30432, 30432, 32, 36, 0x0a9b0eea +1, 30464, 30464, 32, 36, 0x108110ca +1, 30496, 30496, 32, 36, 0xf9160f2a +1, 30528, 30528, 32, 36, 0x6246134f +1, 30560, 30560, 32, 36, 0x11630fc9 +1, 30592, 30592, 32, 36, 0x08b21010 +1, 30624, 30624, 32, 36, 0xd3d20e1e +1, 30656, 30656, 32, 36, 0x41711301 +1, 30688, 30688, 32, 36, 0x34031105 +1, 30720, 30720, 32, 36, 0xba0c0a3b +1, 30752, 30752, 32, 36, 0x23cd0f29 +1, 30784, 30784, 32, 36, 0x11f90d34 +1, 30816, 30816, 32, 36, 0x00e80da0 +1, 30848, 30848, 32, 36, 0xe5620c64 +1, 30880, 30880, 32, 36, 0x13340eab +1, 30912, 30912, 32, 36, 0x04510f06 +1, 30944, 30944, 32, 36, 0x086a0de5 +1, 30976, 30976, 32, 36, 0x13c31039 +1, 31008, 31008, 32, 36, 0x17e310ee +1, 31040, 31040, 32, 36, 0x9797149c +1, 31072, 31072, 32, 36, 0x50c01394 +1, 31104, 31104, 32, 36, 0x40bf10a5 +1, 31136, 31136, 32, 36, 0x558212b4 +1, 31168, 31168, 32, 36, 0x055a0eff +1, 31200, 31200, 32, 36, 0xff290ff9 +1, 31232, 31232, 32, 36, 0x105b0e8b +1, 31264, 31264, 32, 36, 0xfcae0f2a +1, 31296, 31296, 32, 36, 0xfe930cb8 +1, 31328, 31328, 32, 36, 0xe7d60b9c +1, 31360, 31360, 32, 36, 0xd6d20bbe +1, 31392, 31392, 32, 36, 0xfd1d0e4b +1, 31424, 31424, 32, 36, 0xdbe10ddb +1, 31456, 31456, 32, 36, 0xdb4f0d1b +1, 31488, 31488, 32, 36, 0x55a013bf +1, 31520, 31520, 32, 36, 0x04a21087 +1, 31552, 31552, 32, 36, 0x50e913c2 +1, 31584, 31584, 32, 36, 0x153610a6 +1, 31616, 31616, 32, 36, 0x1a981068 +1, 31648, 31648, 32, 36, 0x24c010fe +1, 31680, 31680, 32, 36, 0x17b40dde +1, 31712, 31712, 32, 36, 0x445d116d +1, 31744, 31744, 32, 36, 0x2cd01015 +1, 31776, 31776, 32, 36, 0x3db0114d +1, 31808, 31808, 32, 36, 0xeb0a0c43 +1, 31840, 31840, 32, 36, 0xc01b0c19 +1, 31872, 31872, 32, 36, 0xca500bd8 +1, 31904, 31904, 32, 36, 0x06180e6c +1, 31936, 31936, 32, 36, 0x3e0110da +1, 31968, 31968, 32, 36, 0xedf00d6d +1, 32000, 32000, 32, 36, 0x4d1d1193 +1, 32032, 32032, 32, 36, 0x84a5137b +1, 32064, 32064, 32, 36, 0x41c711e1 +1, 32096, 32096, 32, 36, 0x1ee21042 +1, 32128, 32128, 32, 36, 0x497d1171 +1, 32160, 32160, 32, 36, 0x77561569 +1, 32192, 32192, 32, 36, 0x4e1111ab +1, 32224, 32224, 32, 36, 0x608012e5 +1, 32256, 32256, 32, 36, 0x1e1a10de +1, 32288, 32288, 32, 36, 0x5a7b131c +1, 32320, 32320, 32, 36, 0x60be1388 +1, 32352, 32352, 32, 36, 0xf8940ee9 +1, 32384, 32384, 32, 36, 0x3afd12de +1, 32416, 32416, 32, 36, 0x0ae80ef0 +1, 32448, 32448, 32, 36, 0xe1af0d5d +1, 32480, 32480, 32, 36, 0xf6440f3a +1, 32512, 32512, 32, 36, 0x02ce0f51 +1, 32544, 32544, 32, 36, 0x1d790f61 +1, 32576, 32576, 32, 36, 0xe7960e64 +1, 32608, 32608, 32, 36, 0xcc1e0ae6 +1, 32640, 32640, 32, 36, 0xf9df0dab +1, 32672, 32672, 32, 36, 0x26d10fb1 +1, 32704, 32704, 32, 36, 0xfea60fd9 +1, 32736, 32736, 32, 36, 0x39c710e4 +1, 32768, 32768, 32, 36, 0x21a91079 +1, 32800, 32800, 32, 36, 0x1a940f44 +1, 32832, 32832, 32, 36, 0x14910fca +1, 32864, 32864, 32, 36, 0xd75f0cac +1, 32896, 32896, 32, 36, 0xe68e0fc0 +1, 32928, 32928, 32, 36, 0x597f1181 +1, 32960, 32960, 32, 36, 0x34a51046 +1, 32992, 32992, 32, 36, 0x2dac0e5e +1, 33024, 33024, 32, 36, 0x41da1224 +1, 33056, 33056, 32, 36, 0x3b1c0f81 +1, 33088, 33088, 32, 36, 0x10740eba diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-cinepak-mux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-cinepak-mux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-cinepak-mux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-cinepak-mux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,159 @@ +1316f0df8a8afb34b15218149bb29252 *tests/data/fate/segafilm-cinepak-mux.film_cpk +173220 tests/data/fate/segafilm-cinepak-mux.film_cpk +#tb 0: 1/5 +#media_type 0: video +#codec_id 0: cinepak +#dimensions 0: 100x75 +#sar 0: 0/1 +0, 0, 0, 1, 1222, 0x71c12b5f +0, 1, 1, 1, 1126, 0x758fabe5, F=0x0 +0, 2, 2, 1, 1138, 0xf28daaf9, F=0x0 +0, 3, 3, 1, 1130, 0x08d1fd4e, F=0x0 +0, 4, 4, 1, 1118, 0x33351228, F=0x0 +0, 5, 5, 1, 1130, 0x6e101ed2, F=0x0 +0, 6, 6, 1, 1122, 0x39d225ac, F=0x0 +0, 7, 7, 1, 1126, 0x32ae4cb6, F=0x0 +0, 8, 8, 1, 1126, 0xa3ac5a10, F=0x0 +0, 9, 9, 1, 1126, 0x66185561, F=0x0 +0, 10, 10, 1, 1134, 0x2bf85f4e, F=0x0 +0, 11, 11, 1, 1134, 0xe4db7b64, F=0x0 +0, 12, 12, 1, 1130, 0x87e9793e, F=0x0 +0, 13, 13, 1, 1118, 0x8d346c2e, F=0x0 +0, 14, 14, 1, 1126, 0x447d6abb, F=0x0 +0, 15, 15, 1, 1130, 0x090c763a, F=0x0 +0, 16, 16, 1, 1134, 0x11ef80f1, F=0x0 +0, 17, 17, 1, 1126, 0xe9b68fc3, F=0x0 +0, 18, 18, 1, 1126, 0x89c696da, F=0x0 +0, 19, 19, 1, 1114, 0xe6d1a98e, F=0x0 +0, 20, 20, 1, 1126, 0xd35daee7, F=0x0 +0, 21, 21, 1, 1114, 0x25b1a557, F=0x0 +0, 22, 22, 1, 1130, 0x17e69d3e, F=0x0 +0, 23, 23, 1, 1126, 0x8dc88007, F=0x0 +0, 24, 24, 1, 1130, 0x577b7137, F=0x0 +0, 25, 25, 1, 1130, 0x4b887d7e, F=0x0 +0, 26, 26, 1, 1134, 0x144a85b3, F=0x0 +0, 27, 27, 1, 1126, 0xb556722e, F=0x0 +0, 28, 28, 1, 1130, 0xe3db9173, F=0x0 +0, 29, 29, 1, 1138, 0x6e127c53, F=0x0 +0, 30, 30, 1, 1126, 0x0cbf77ad, F=0x0 +0, 31, 31, 1, 1134, 0x110c8f29, F=0x0 +0, 32, 32, 1, 1134, 0xd9e38471, F=0x0 +0, 33, 33, 1, 1138, 0xb177947e, F=0x0 +0, 34, 34, 1, 1130, 0x9a9da5f9, F=0x0 +0, 35, 35, 1, 1102, 0x65e5d1b2, F=0x0 +0, 36, 36, 1, 1098, 0x9d020bdb, F=0x0 +0, 37, 37, 1, 1098, 0xbbcb2c90, F=0x0 +0, 38, 38, 1, 1122, 0x0b6eb28a, F=0x0 +0, 39, 39, 1, 1130, 0x86dec1ac, F=0x0 +0, 40, 40, 1, 1126, 0x2926b05c, F=0x0 +0, 41, 41, 1, 1126, 0x37daa041, F=0x0 +0, 42, 42, 1, 1130, 0xb2859897, F=0x0 +0, 43, 43, 1, 1130, 0xdfdaa4a7, F=0x0 +0, 44, 44, 1, 1126, 0xd83fa84e, F=0x0 +0, 45, 45, 1, 1126, 0x6738a41d, F=0x0 +0, 46, 46, 1, 1122, 0xbff7b2ff, F=0x0 +0, 47, 47, 1, 1126, 0x0bccc0a3, F=0x0 +0, 48, 48, 1, 1126, 0x4083cc7a, F=0x0 +0, 49, 49, 1, 1126, 0x7d5bd199, F=0x0 +0, 50, 50, 1, 1126, 0xf1a6d890, F=0x0 +0, 51, 51, 1, 1118, 0xad19b80a, F=0x0 +0, 52, 52, 1, 1126, 0x8a61d10e, F=0x0 +0, 53, 53, 1, 1118, 0xdafdd4f3, F=0x0 +0, 54, 54, 1, 1122, 0xd171d3b4, F=0x0 +0, 55, 55, 1, 1118, 0xf78adab4, F=0x0 +0, 56, 56, 1, 1122, 0x9e2ad511, F=0x0 +0, 57, 57, 1, 1126, 0x065a94b0, F=0x0 +0, 58, 58, 1, 1130, 0x2c31a378, F=0x0 +0, 59, 59, 1, 1122, 0xe0248cbc, F=0x0 +0, 60, 60, 1, 1370, 0x731b081a, F=0x0 +0, 61, 61, 1, 1126, 0x71f4e747, F=0x0 +0, 62, 62, 1, 1126, 0x5597ec42, F=0x0 +0, 63, 63, 1, 1126, 0xdf25e98a, F=0x0 +0, 64, 64, 1, 1126, 0x70b20e6d, F=0x0 +0, 65, 65, 1, 1130, 0x80291c49 +0, 66, 66, 1, 1130, 0x36312605 +0, 67, 67, 1, 1130, 0x340c32f8, F=0x0 +0, 68, 68, 1, 1138, 0xe39d4da6, F=0x0 +0, 69, 69, 1, 1162, 0x926055c2, F=0x0 +0, 70, 70, 1, 1150, 0x23636430, F=0x0 +0, 71, 71, 1, 1162, 0xa9585bf0, F=0x0 +0, 72, 72, 1, 1182, 0x31aa69f1, F=0x0 +0, 73, 73, 1, 1138, 0x01fe67d0, F=0x0 +0, 74, 74, 1, 1186, 0x19e27b72, F=0x0 +0, 75, 75, 1, 1166, 0xc6308226, F=0x0 +0, 76, 76, 1, 1158, 0xef1d92de, F=0x0 +0, 77, 77, 1, 1178, 0xf330cc25, F=0x0 +0, 78, 78, 1, 1182, 0xa0aed70e, F=0x0 +0, 79, 79, 1, 1126, 0xb572d975, F=0x0 +0, 80, 80, 1, 1162, 0x824bdf60, F=0x0 +0, 81, 81, 1, 1110, 0x0f4be7ec, F=0x0 +0, 82, 82, 1, 1118, 0x87fcd9bf, F=0x0 +0, 83, 83, 1, 1118, 0x33c0d913, F=0x0 +0, 84, 84, 1, 1106, 0x6bf1d24a, F=0x0 +0, 85, 85, 1, 1130, 0xf9d8d39b, F=0x0 +0, 86, 86, 1, 1130, 0x2c98d6c7, F=0x0 +0, 87, 87, 1, 1126, 0xd6dbc72e, F=0x0 +0, 88, 88, 1, 1126, 0xb28cc81b, F=0x0 +0, 89, 89, 1, 1122, 0x6d6dba62, F=0x0 +0, 90, 90, 1, 1126, 0x0e15bf6c, F=0x0 +0, 91, 91, 1, 1118, 0x3bf8b739, F=0x0 +0, 92, 92, 1, 1130, 0xa85ad726, F=0x0 +0, 93, 93, 1, 1126, 0x167fd993, F=0x0 +0, 94, 94, 1, 1118, 0x0f6ad267, F=0x0 +0, 95, 95, 1, 1114, 0x9ad0dfda, F=0x0 +0, 96, 96, 1, 1122, 0x2f7dde25, F=0x0 +0, 97, 97, 1, 1122, 0xb4e2e1bf, F=0x0 +0, 98, 98, 1, 1126, 0x6443e4dd, F=0x0 +0, 99, 99, 1, 1122, 0x7de1dceb, F=0x0 +0, 100, 100, 1, 1094, 0x0422f641, F=0x0 +0, 101, 101, 1, 1126, 0x2bf8e36e, F=0x0 +0, 102, 102, 1, 1126, 0x6215cc8d, F=0x0 +0, 103, 103, 1, 1122, 0xbdd8e81e, F=0x0 +0, 104, 104, 1, 1126, 0x5fa4e361, F=0x0 +0, 105, 105, 1, 1114, 0x02dedc5a, F=0x0 +0, 106, 106, 1, 1122, 0x4807e5ef, F=0x0 +0, 107, 107, 1, 1126, 0x9165d802, F=0x0 +0, 108, 108, 1, 1114, 0xb389d4a2, F=0x0 +0, 109, 109, 1, 1126, 0xbbb4d58e, F=0x0 +0, 110, 110, 1, 1106, 0x0f44e337, F=0x0 +0, 111, 111, 1, 1106, 0x57bae452, F=0x0 +0, 112, 112, 1, 1382, 0x4ef2281a, F=0x0 +0, 113, 113, 1, 1126, 0x79dedd9e, F=0x0 +0, 114, 114, 1, 1114, 0xfa8bf80f, F=0x0 +0, 115, 115, 1, 1110, 0x5f9e122e, F=0x0 +0, 116, 116, 1, 1114, 0x85aa480c, F=0x0 +0, 117, 117, 1, 1122, 0xf7c87737, F=0x0 +0, 118, 118, 1, 1122, 0x2ff57bc7, F=0x0 +0, 119, 119, 1, 1134, 0x1723b925, F=0x0 +0, 120, 120, 1, 1154, 0x1768acf5 +0, 121, 121, 1, 1206, 0xe2f2e7e7, F=0x0 +0, 122, 122, 1, 1130, 0x30a0deb4, F=0x0 +0, 123, 123, 1, 1130, 0x9d8fdff7, F=0x0 +0, 124, 124, 1, 1126, 0xefcbd959, F=0x0 +0, 125, 125, 1, 1130, 0xac08d48b, F=0x0 +0, 126, 126, 1, 1130, 0xd0c0c1e4, F=0x0 +0, 127, 127, 1, 1130, 0x0ecbab42, F=0x0 +0, 128, 128, 1, 1130, 0x85ddb0e9, F=0x0 +0, 129, 129, 1, 1126, 0xb6c29be4, F=0x0 +0, 130, 130, 1, 1130, 0x21e196e0, F=0x0 +0, 131, 131, 1, 1130, 0xd4f7a15e, F=0x0 +0, 132, 132, 1, 1118, 0x35dbacf7, F=0x0 +0, 133, 133, 1, 1126, 0x31a5b4fe, F=0x0 +0, 134, 134, 1, 1122, 0x699cbc4b, F=0x0 +0, 135, 135, 1, 1114, 0x3446b299, F=0x0 +0, 136, 136, 1, 1122, 0xd228ad0a, F=0x0 +0, 137, 137, 1, 1118, 0x9161dd42, F=0x0 +0, 138, 138, 1, 1122, 0x9055ce23, F=0x0 +0, 139, 139, 1, 1114, 0x0d41ddef, F=0x0 +0, 140, 140, 1, 1110, 0x9a6ee6d9, F=0x0 +0, 141, 141, 1, 1110, 0x88b4fbed, F=0x0 +0, 142, 142, 1, 1118, 0x6b4ff2e0, F=0x0 +0, 143, 143, 1, 1118, 0x58cae506, F=0x0 +0, 144, 144, 1, 1114, 0x2e08fbf8, F=0x0 +0, 145, 145, 1, 1110, 0x2329f247, F=0x0 +0, 146, 146, 1, 1114, 0x7c56f7bb, F=0x0 +0, 147, 147, 1, 1118, 0x10b9f719, F=0x0 +0, 148, 148, 1, 1126, 0xda626ba7, F=0x0 +0, 149, 149, 1, 1382, 0x33b21846, F=0x0 +0, 150, 150, 1, 586, 0x12808f58, F=0x0 +0, 151, 151, 1, 190, 0xa9f408c3, F=0x0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-rawvideo-mux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-rawvideo-mux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-rawvideo-mux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-rawvideo-mux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,98 @@ +c4b24005b314b70783ebb007f50b6c6c *tests/data/fate/segafilm-rawvideo-mux.film_cpk +17841040 tests/data/fate/segafilm-rawvideo-mux.film_cpk +#tb 0: 1/12 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 400x187 +#sar 0: 0/1 +#tb 1: 1/8000 +#media_type 1: audio +#codec_id 1: pcm_s16be_planar +#sample_rate 1: 8000 +#channel_layout_name 1: mono +0, 0, 0, 1, 224400, 0xd8f2f310 +1, 0, 0, 8000, 16000, 0x7ec2d894 +0, 1, 1, 1, 224400, 0xe38676c2 +0, 2, 2, 1, 224400, 0x7163b6ad +0, 3, 3, 1, 224400, 0xa514b0f7 +0, 4, 4, 1, 224400, 0xeed48b96 +0, 5, 5, 1, 224400, 0x5e9f02b2 +0, 6, 6, 1, 224400, 0x70822c53 +0, 7, 7, 1, 224400, 0x93101067 +0, 8, 8, 1, 224400, 0x0710e900 +0, 9, 9, 1, 224400, 0x0e8add6a +0, 10, 10, 1, 224400, 0x53fb2c5a +0, 11, 11, 1, 224400, 0xa58cc02f +0, 12, 12, 1, 224400, 0x0a5cc76b +1, 8000, 8000, 8000, 16000, 0x1fb8d7fa +0, 13, 13, 1, 224400, 0xfa551631 +0, 14, 14, 1, 224400, 0xde9f99bf +0, 15, 15, 1, 224400, 0xe66a8690 +0, 16, 16, 1, 224400, 0xd9e6f3d1 +0, 17, 17, 1, 224400, 0xa479a5c6 +0, 18, 18, 1, 224400, 0xdaa3531f +0, 19, 19, 1, 224400, 0xde3e6843 +0, 20, 20, 1, 224400, 0x181adafd +0, 21, 21, 1, 224400, 0x784b6429 +0, 22, 22, 1, 224400, 0x91cdc30e +0, 23, 23, 1, 224400, 0x6e78be49 +0, 24, 24, 1, 224400, 0x7515644c +1, 16000, 16000, 8000, 16000, 0xb1d7d062 +0, 25, 25, 1, 224400, 0xcc32a91b +0, 26, 26, 1, 224400, 0xc63e3831 +0, 27, 27, 1, 224400, 0xfb53b651 +0, 28, 28, 1, 224400, 0x12ec8a01 +0, 29, 29, 1, 224400, 0x136fcb2c +0, 30, 30, 1, 224400, 0x827fa546 +0, 31, 31, 1, 224400, 0x1773b7f5 +0, 32, 32, 1, 224400, 0x732defc1 +0, 33, 33, 1, 224400, 0x84292372 +0, 34, 34, 1, 224400, 0x20f22365 +0, 35, 35, 1, 224400, 0xb39a0700 +0, 36, 36, 1, 224400, 0xf245706c +1, 24000, 24000, 8000, 16000, 0x831174ae +0, 37, 37, 1, 224400, 0xdb702ae7 +0, 38, 38, 1, 224400, 0xadfefe5b +0, 39, 39, 1, 224400, 0xa667adcb +0, 40, 40, 1, 224400, 0x4d645191 +0, 41, 41, 1, 224400, 0x33802f58 +0, 42, 42, 1, 224400, 0x24eff4b8 +0, 43, 43, 1, 224400, 0x4dc817a6 +0, 44, 44, 1, 224400, 0x9a891d35 +0, 45, 45, 1, 224400, 0x2d0bb83b +0, 46, 46, 1, 224400, 0xd13469c1 +0, 47, 47, 1, 224400, 0xd2e6302a +0, 48, 48, 1, 224400, 0xc7594ee1 +1, 32000, 32000, 8000, 16000, 0x88c62b9f +0, 49, 49, 1, 224400, 0xc6da714c +0, 50, 50, 1, 224400, 0xf675e838 +0, 51, 51, 1, 224400, 0xdc047c76 +0, 52, 52, 1, 224400, 0xe5727de5 +0, 53, 53, 1, 224400, 0x153b0f62 +0, 54, 54, 1, 224400, 0x65922f68 +0, 55, 55, 1, 224400, 0x04e04bfb +0, 56, 56, 1, 224400, 0x1dde6c88 +0, 57, 57, 1, 224400, 0xed3905f2 +0, 58, 58, 1, 224400, 0x211a5996 +0, 59, 59, 1, 224400, 0xd010baaf +0, 60, 60, 1, 224400, 0xcbc9f272 +1, 40000, 40000, 8000, 16000, 0x48c7c649 +0, 61, 61, 1, 224400, 0x7380d6f0 +0, 62, 62, 1, 224400, 0xfd0bf084 +0, 63, 63, 1, 224400, 0xc4d671d9 +0, 64, 64, 1, 224400, 0x84236aa5 +0, 65, 65, 1, 224400, 0x9c584ede +0, 66, 66, 1, 224400, 0xdb0c6029 +0, 67, 67, 1, 224400, 0x775ae560 +0, 68, 68, 1, 224400, 0xe3800916 +0, 69, 69, 1, 224400, 0x9313a8e8 +0, 70, 70, 1, 224400, 0x3a5d07cc +0, 71, 71, 1, 224400, 0x4651a10b +0, 72, 72, 1, 224400, 0xc2d72183 +1, 48000, 48000, 8000, 16000, 0x2e7a742a +0, 73, 73, 1, 224400, 0xcd971625 +0, 74, 74, 1, 224400, 0x9fb0f3c2 +0, 75, 75, 1, 224400, 0x920ee561 +0, 76, 76, 1, 224400, 0x8a2c1bbf +0, 77, 77, 1, 224400, 0x6150c072 +0, 78, 78, 1, 224400, 0x499dc869 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-s8-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-s8-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-s8-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segafilm-s8-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,151 @@ +3b5854365d74f6194d3b09e040507370 *tests/data/fate/segafilm-s8-remux.film_cpk +1955240 tests/data/fate/segafilm-s8-remux.film_cpk +#tb 0: 1/30 +#media_type 0: video +#codec_id 0: cinepak +#dimensions 0: 320x224 +#sar 0: 0/1 +#tb 1: 1/44100 +#media_type 1: audio +#codec_id 1: pcm_s8_planar +#sample_rate 1: 44100 +#channel_layout_name 1: stereo +0, 0, 0, 2, 21612, 0x12f0b3c8 +1, 0, 0, 22048, 44096, 0xafd250ae +0, 2, 2, 2, 11080, 0xac3a462b, F=0x0 +0, 4, 4, 2, 11300, 0xd8ee7f3e, F=0x0 +0, 6, 6, 2, 21612, 0x73c3a3f9 +0, 8, 8, 2, 21628, 0x00a5b4b9 +0, 10, 10, 2, 14772, 0x1332b44f, F=0x0 +0, 12, 12, 2, 14744, 0x5ce5d59b, F=0x0 +0, 14, 14, 2, 14736, 0xd5ac2877, F=0x0 +1, 22048, 22048, 11028, 22056, 0xe08a0f01 +0, 16, 16, 2, 16908, 0x90fb4402 +0, 18, 18, 2, 21636, 0x30f36b66 +0, 20, 20, 2, 21648, 0x3ba6ea31 +0, 22, 22, 2, 14744, 0x5c35b960, F=0x0 +1, 33076, 33076, 11024, 22048, 0x4798f7aa +0, 24, 24, 2, 14164, 0xe7c63eaa, F=0x0 +0, 26, 26, 2, 14644, 0x158c7e80, F=0x0 +0, 28, 28, 2, 14760, 0x423e575d, F=0x0 +0, 30, 30, 2, 14784, 0xe56277f8, F=0x0 +1, 44100, 44100, 11028, 22056, 0x8cefd048 +0, 32, 32, 2, 14788, 0x451e0bae, F=0x0 +0, 34, 34, 2, 14784, 0x1a05cb5a, F=0x0 +0, 36, 36, 2, 14784, 0x9898d518, F=0x0 +1, 55128, 55128, 11028, 22056, 0xda5e35ef +0, 38, 38, 2, 14768, 0x7de83ded, F=0x0 +0, 40, 40, 2, 14760, 0x4fbe044b, F=0x0 +0, 42, 42, 2, 14772, 0x246488b7, F=0x0 +0, 44, 44, 2, 14784, 0x4a8e927d, F=0x0 +1, 66156, 66156, 11028, 22056, 0xecb354d5 +0, 46, 46, 2, 14768, 0x0a78d401, F=0x0 +0, 48, 48, 2, 14724, 0x99b092fc, F=0x0 +0, 50, 50, 2, 17424, 0xed3215f7 +0, 52, 52, 2, 14760, 0x936b54f2, F=0x0 +1, 77184, 77184, 11016, 22032, 0x4f023ee7 +0, 54, 54, 2, 14788, 0x512f061b, F=0x0 +0, 56, 56, 2, 14752, 0x8697f416, F=0x0 +0, 58, 58, 2, 14752, 0xf113edc3, F=0x0 +0, 60, 60, 2, 14792, 0xc79a8eff, F=0x0 +1, 88200, 88200, 11028, 22056, 0x00959d91 +0, 62, 62, 2, 14748, 0x9906aeb0, F=0x0 +0, 64, 64, 2, 14752, 0x5d0035fb, F=0x0 +0, 66, 66, 2, 14756, 0x1a18611b, F=0x0 +1, 99228, 99228, 11028, 22056, 0xef42522d +0, 68, 68, 2, 14792, 0x03ecb407, F=0x0 +0, 70, 70, 2, 14792, 0x0b3f8a55, F=0x0 +0, 72, 72, 2, 14788, 0x4db424ef, F=0x0 +0, 74, 74, 2, 14784, 0xe86937be, F=0x0 +1, 110256, 110256, 11028, 22056, 0x344eb013 +0, 76, 76, 2, 14756, 0xdf30850f, F=0x0 +0, 78, 78, 2, 14764, 0x8ba301b0, F=0x0 +0, 80, 80, 2, 16816, 0x019829a4 +0, 82, 82, 2, 14704, 0x28451122, F=0x0 +1, 121284, 121284, 11016, 22032, 0xaad8d420 +0, 84, 84, 2, 14540, 0x4767a033, F=0x0 +0, 86, 86, 2, 14144, 0xa7cff806, F=0x0 +0, 88, 88, 2, 14372, 0x66da8c46, F=0x0 +0, 90, 90, 2, 14296, 0xc98a2efd, F=0x0 +1, 132300, 132300, 11028, 22056, 0xfc76c3d9 +0, 92, 92, 2, 16396, 0xd6235b32 +0, 94, 94, 2, 12464, 0x519c57c9, F=0x0 +0, 96, 96, 2, 12628, 0xf3d3e179, F=0x0 +1, 143328, 143328, 11028, 22056, 0x44073824 +0, 98, 98, 2, 10604, 0x93c6a3d1, F=0x0 +0, 100, 100, 2, 8936, 0xcb92de8c, F=0x0 +0, 102, 102, 2, 8340, 0x7698372b, F=0x0 +0, 104, 104, 2, 7324, 0x782ebf51, F=0x0 +1, 154356, 154356, 11028, 22056, 0x3d7d1aef +0, 106, 106, 2, 6332, 0x23291828, F=0x0 +0, 108, 108, 2, 5448, 0x2426feae, F=0x0 +0, 110, 110, 2, 624, 0x3f9c04b2, F=0x0 +0, 112, 112, 2, 624, 0x3f9c04b2, F=0x0 +1, 165384, 165384, 11016, 22032, 0x91257dfb +0, 114, 114, 2, 624, 0x3f9c04b2, F=0x0 +0, 116, 116, 2, 624, 0x3f9c04b2, F=0x0 +0, 118, 118, 2, 624, 0x3f9c04b2, F=0x0 +0, 120, 120, 2, 624, 0x3f9c04b2, F=0x0 +1, 176400, 176400, 11028, 22056, 0x254d5274 +0, 122, 122, 2, 21540, 0x6a391e7e +0, 124, 124, 2, 6832, 0x4023eaac, F=0x0 +0, 126, 126, 2, 7540, 0xbfc4e26e, F=0x0 +1, 187428, 187428, 11028, 22056, 0x85bf05d4 +0, 128, 128, 2, 7444, 0x37976e60, F=0x0 +0, 130, 130, 2, 7440, 0x5995e2b0, F=0x0 +0, 132, 132, 2, 7620, 0x96c3f568, F=0x0 +0, 134, 134, 2, 7544, 0x185643e7, F=0x0 +1, 198456, 198456, 11028, 22056, 0xe9b89025 +0, 136, 136, 2, 7440, 0x7c67dd22, F=0x0 +0, 138, 138, 2, 9864, 0xd66c84e6 +0, 140, 140, 2, 8344, 0xba857ad0, F=0x0 +0, 142, 142, 2, 7720, 0x31111984, F=0x0 +1, 209484, 209484, 11016, 22032, 0xcf4f1087 +0, 144, 144, 2, 7608, 0xc6539493, F=0x0 +0, 146, 146, 2, 7640, 0x5b3c8a04, F=0x0 +0, 148, 148, 2, 7624, 0x3eb7731a, F=0x0 +0, 150, 150, 2, 7712, 0x3cf7eb6b, F=0x0 +1, 220500, 220500, 11028, 22056, 0x6c016e48 +0, 152, 152, 2, 7700, 0x98833ab2, F=0x0 +0, 154, 154, 2, 9836, 0x9facaa3d +0, 156, 156, 2, 8280, 0x4c16fc91, F=0x0 +1, 231528, 231528, 11028, 22056, 0x76a2c75c +0, 158, 158, 2, 7708, 0x6464873b, F=0x0 +0, 160, 160, 2, 7608, 0xbe0ff68b, F=0x0 +0, 162, 162, 2, 7500, 0x283a0810, F=0x0 +0, 164, 164, 2, 624, 0xb9b505ed, F=0x0 +1, 242556, 242556, 11028, 22056, 0xa882dcb0 +0, 166, 166, 2, 624, 0xb9b505ed, F=0x0 +0, 168, 168, 2, 624, 0xb9b505ed, F=0x0 +0, 170, 170, 2, 624, 0xb9b505ed, F=0x0 +0, 172, 172, 2, 624, 0xb9b505ed, F=0x0 +1, 253584, 253584, 11016, 22032, 0x3797e11a +0, 174, 174, 2, 624, 0xb9b505ed, F=0x0 +0, 176, 176, 2, 624, 0xb9b505ed, F=0x0 +0, 178, 178, 2, 624, 0xb9b505ed, F=0x0 +0, 180, 180, 2, 624, 0xb9b505ed, F=0x0 +1, 264600, 264600, 11028, 22056, 0xec57619f +0, 182, 182, 2, 624, 0xb9b505ed, F=0x0 +0, 184, 184, 2, 21588, 0xa373a2b0 +0, 186, 186, 2, 624, 0x26350647, F=0x0 +1, 275628, 275628, 11028, 22056, 0x14f9a65c +0, 188, 188, 2, 624, 0x26350647, F=0x0 +0, 190, 190, 2, 624, 0x26350647, F=0x0 +0, 192, 192, 2, 21600, 0x8a2d6cf3 +0, 194, 194, 2, 21600, 0x02580c99 +1, 286656, 286656, 11028, 22056, 0x840a0ff0 +0, 196, 196, 2, 21580, 0x9a904a10 +0, 198, 198, 2, 21564, 0xa392b1b8 +0, 200, 200, 2, 21540, 0x70d29597 +0, 202, 202, 2, 21564, 0x41af0d55 +1, 297684, 297684, 11016, 22032, 0x00000000 +0, 204, 204, 2, 21552, 0x4a79481d +0, 206, 206, 2, 21568, 0xe2d9f71f +0, 208, 208, 2, 21504, 0xa23387f4 +0, 210, 210, 2, 21468, 0x7fa401ba +1, 308700, 308700, 11028, 22056, 0x00000000 +0, 212, 212, 2, 21388, 0xca992a77 +0, 214, 214, 2, 21288, 0xb10f1e06 +0, 216, 216, 2, 21096, 0xc421acd3 +1, 319728, 319728, 2200, 4400, 0x00000000 +0, 218, 218, 1, 18548, 0x640b3376 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segment-mp4-to-ts mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segment-mp4-to-ts --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segment-mp4-to-ts 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/segment-mp4-to-ts 2023-03-03 13:29:59.000000000 +0000 @@ -23,7 +23,7 @@ 0, 50400, 54000, 3600, 607, 0xc53c2339, F=0x0, S=1, 1 0, 54000, 72000, 3600, 4755, 0x2f642b58, F=0x0, S=1, 1 0, 57600, 64800, 3600, 1182, 0xbe1a4847, F=0x0, S=1, 1 -0, 61200, 61200, 3600, 809, 0x8d948a4e, F=0x2, S=1, 1 +0, 61200, 61200, 3600, 809, 0x8d948a4e, F=0x0, S=1, 1 0, 64800, 68400, 3600, 656, 0x4fa03c2b, F=0x0, S=1, 1 0, 68400, 86400, 3600, 26555, 0x5629b584, S=1, 1 0, 72000, 79200, 3600, 1141, 0x761b31e8, F=0x0, S=1, 1 @@ -71,7 +71,7 @@ 0, 223200, 226800, 3600, 809, 0x84e37fee, F=0x0, S=1, 1 0, 226800, 244800, 3600, 4541, 0xd4e5c0de, F=0x0, S=1, 1 0, 230400, 237600, 3600, 1545, 0x0099fc98, F=0x0, S=1, 1 -0, 234000, 234000, 3600, 929, 0xfd72d049, F=0x0, S=1, 1 +0, 234000, 234000, 3600, 929, 0xfd72d049, F=0x2, S=1, 1 0, 237600, 241200, 3600, 829, 0xcfda9e96, F=0x0, S=1, 1 0, 241200, 259200, 3600, 24220, 0x5ca21d71, S=1, 1 0, 244800, 252000, 3600, 1422, 0xcde6cc34, F=0x0, S=1, 1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 393216, 0xa9b28fd9 +0, 0, 0, 1, 393216, 0xc8478fd9 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24-rle mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24-rle --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24-rle 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb24-rle 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 393216, 0xe96e1de2 +0, 0, 0, 1, 393216, 0x7e231de2 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 786432, 0xee4aa667 +0, 0, 0, 1, 786432, 0xf9a2a667 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48-rle mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48-rle --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48-rle 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgb48-rle 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 786432, 0xbc743bc4 +0, 0, 0, 1, 786432, 0xec343bc4 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 524288, 0x4ee5adbb +0, 0, 0, 1, 524288, 0x7401adbb diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 1048576, 0xc657e22b +0, 0, 0, 1, 1048576, 0x1b61e22b diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64-rle mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64-rle --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64-rle 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba64-rle 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 1048576, 0xb619d0f1 +0, 0, 0, 1, 1048576, 0x6122d0f1 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba-rle mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba-rle --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba-rle 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sgi-rgba-rle 2023-03-03 13:29:59.000000000 +0000 @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 512x256 #sar 0: 0/1 -0, 0, 0, 1, 524288, 0x4ee5adbb +0, 0, 0, 1, 524288, 0x7401adbb diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest 2023-03-03 13:29:59.000000000 +0000 @@ -8,7 +8,7 @@ #codec_id 1: ac3 #sample_rate 1: 44100 #channel_layout_name 1: mono -1, -256, -256, 1536, 416, 0xef8ccbe3 +1, -256, -256, 1536, 416, 0x69efcbcc 0, 0, 0, 1, 8749, 0x57039d10, S=1, 8 1, 1280, 1280, 1536, 418, 0xa0ccc09d 0, 1, 1, 1, 975, 0x2fcf0617, F=0x0, S=1, 8 @@ -27,20 +27,20 @@ 0, 7, 7, 1, 1474, 0x1025b9b0, F=0x0, S=1, 8 1, 13568, 13568, 1536, 418, 0xa200b8f0 0, 8, 8, 1, 1467, 0xf3c0c714, F=0x0, S=1, 8 -1, 15104, 15104, 1536, 418, 0xbbf9cd36 +1, 15104, 15104, 1536, 418, 0x009dccf6 0, 9, 9, 1, 1469, 0x1b9faf72, F=0x0, S=1, 8 1, 16640, 16640, 1536, 418, 0x585ec129 0, 10, 10, 1, 1506, 0x18a9c359, F=0x0, S=1, 8 1, 18176, 18176, 1536, 418, 0xda1acf75 0, 11, 11, 1, 1520, 0x0ec1d39a, F=0x0, S=1, 8 -1, 19712, 19712, 1536, 418, 0x9bb2cfeb +1, 19712, 19712, 1536, 418, 0xd326d279 0, 12, 12, 1, 8554, 0xfab776e0, S=1, 8 -1, 21248, 21248, 1536, 418, 0x83f2bf72 -1, 22784, 22784, 1536, 418, 0xdb4dcbe8 +1, 21248, 21248, 1536, 418, 0x1b54bf76 +1, 22784, 22784, 1536, 418, 0xdb39cbd1 0, 13, 13, 1, 1079, 0x13e40cb3, F=0x0, S=1, 8 1, 24320, 24320, 1536, 418, 0x6813cefa 0, 14, 14, 1, 1343, 0xf0058d2e, F=0x0, S=1, 8 -1, 25856, 25856, 1536, 418, 0x3573d3c5 +1, 25856, 25856, 1536, 418, 0xb402d2ec 0, 15, 15, 1, 1486, 0x1da1c64e, F=0x0, S=1, 8 1, 27392, 27392, 1536, 418, 0x80c4c8d2 0, 16, 16, 1, 1491, 0x872dd43d, F=0x0, S=1, 8 @@ -50,8 +50,8 @@ 0, 18, 18, 1, 1481, 0xde66ba0a, F=0x0, S=1, 8 1, 32000, 32000, 1536, 418, 0x3f37c65b 0, 19, 19, 1, 1521, 0xf46dcef9, F=0x0, S=1, 8 -1, 33536, 33536, 1536, 418, 0xd8e3d1f3 -1, 35072, 35072, 1536, 418, 0x34bdcb46 +1, 33536, 33536, 1536, 418, 0xf9a2cf98 +1, 35072, 35072, 1536, 418, 0xc951cbb5 0, 20, 20, 1, 1514, 0x001ed7b1, F=0x0, S=1, 8 1, 36608, 36608, 1536, 418, 0x4e92be94 0, 21, 21, 1, 1562, 0x3974e095, F=0x0, S=1, 8 @@ -70,18 +70,18 @@ 0, 27, 27, 1, 1641, 0x46aafde5, F=0x0, S=1, 8 1, 48896, 48896, 1536, 418, 0x98cfc032 0, 28, 28, 1, 1735, 0xa9363e9b, F=0x0, S=1, 8 -1, 50432, 50432, 1536, 418, 0x42d6c12e +1, 50432, 50432, 1536, 418, 0x8045c0a7 0, 29, 29, 1, 1760, 0x99b82cbc, F=0x0, S=1, 8 1, 51968, 51968, 1536, 418, 0x2180c196 0, 30, 30, 1, 1798, 0xc0ba5286, F=0x0, S=1, 8 1, 53504, 53504, 1536, 418, 0x35f2b4d1 0, 31, 31, 1, 1830, 0x4e8b4b80, F=0x0, S=1, 8 -1, 55040, 55040, 1536, 418, 0x7b5fc73a +1, 55040, 55040, 1536, 418, 0x876ec74d 0, 32, 32, 1, 1835, 0x218a69cb, F=0x0, S=1, 8 1, 56576, 56576, 1536, 418, 0xbccebddd 1, 58112, 58112, 1536, 418, 0x40a1bcc7 0, 33, 33, 1, 1902, 0x8f2b67d2, F=0x0, S=1, 8 -1, 59648, 59648, 1536, 418, 0xbcafbf6e +1, 59648, 59648, 1536, 418, 0xbd10bf09 0, 34, 34, 1, 1886, 0xf4087481, F=0x0, S=1, 8 1, 61184, 61184, 1536, 418, 0xb8e4b630 0, 35, 35, 1, 1949, 0x142c8ac1, F=0x0, S=1, 8 @@ -98,20 +98,20 @@ 0, 40, 40, 1, 1989, 0x0274904a, F=0x0, S=1, 8 1, 71936, 71936, 1536, 418, 0x0ad9c88a 0, 41, 41, 1, 1949, 0x66fa8de9, F=0x0, S=1, 8 -1, 73472, 73472, 1536, 418, 0x57accd5f +1, 73472, 73472, 1536, 418, 0x9aa3d0a7 0, 42, 42, 1, 1956, 0x4e2e831d, F=0x0, S=1, 8 1, 75008, 75008, 1536, 416, 0x99f5b2b6 0, 43, 43, 1, 2012, 0x1d75ac7a, F=0x0, S=1, 8 -1, 76544, 76544, 1536, 418, 0xe60fc1af +1, 76544, 76544, 1536, 418, 0xfb7dc20d 0, 44, 44, 1, 1995, 0xdc478fec, F=0x0, S=1, 8 1, 78080, 78080, 1536, 418, 0xebc8c568 0, 45, 45, 1, 2078, 0x416aaf11, F=0x0, S=1, 8 1, 79616, 79616, 1536, 418, 0x7361c949 0, 46, 46, 1, 2116, 0x1416cc81, F=0x0, S=1, 8 -1, 81152, 81152, 1536, 418, 0xebb4bde9 +1, 81152, 81152, 1536, 418, 0x85d8bbd0 1, 82688, 82688, 1536, 418, 0x72e8bad1 0, 47, 47, 1, 2024, 0xf1c1ad7d, F=0x0, S=1, 8 -1, 84224, 84224, 1536, 418, 0xb479b641 +1, 84224, 84224, 1536, 418, 0x4febb56f 0, 48, 48, 1, 11212, 0xc61a3f0a, S=1, 8 1, 85760, 85760, 1536, 418, 0xae06ca91 0, 49, 49, 1, 1423, 0x45fba9e4, F=0x0, S=1, 8 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest-sub mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest-sub --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest-sub 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/shortest-sub 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,417 @@ +145b9b48d56f9c966bf41657f7569954 *tests/data/fate/shortest-sub.matroska +139232 tests/data/fate/shortest-sub.matroska +#extradata 1: 167, 0xf7272d5f +#tb 0: 1/1000 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 1x1 +#sar 0: 1/1 +#tb 1: 1/1000 +#media_type 1: subtitle +#codec_id 1: dvd_subtitle +0, 0, 0, 1000, 3, 0x00000000 +0, 1000, 1000, 1000, 3, 0x00000000 +0, 2000, 2000, 1000, 3, 0x00000000 +0, 3000, 3000, 1000, 3, 0x00000000 +0, 4000, 4000, 1000, 3, 0x00000000 +0, 5000, 5000, 1000, 3, 0x00000000 +0, 6000, 6000, 1000, 3, 0x00000000 +0, 7000, 7000, 1000, 3, 0x00000000 +0, 8000, 8000, 1000, 3, 0x00000000 +0, 9000, 9000, 1000, 3, 0x00000000 +0, 10000, 10000, 1000, 3, 0x00000000 +0, 11000, 11000, 1000, 3, 0x00000000 +0, 12000, 12000, 1000, 3, 0x00000000 +0, 13000, 13000, 1000, 3, 0x00000000 +0, 14000, 14000, 1000, 3, 0x00000000 +0, 15000, 15000, 1000, 3, 0x00000000 +0, 16000, 16000, 1000, 3, 0x00000000 +0, 17000, 17000, 1000, 3, 0x00000000 +0, 18000, 18000, 1000, 3, 0x00000000 +0, 19000, 19000, 1000, 3, 0x00000000 +0, 20000, 20000, 1000, 3, 0x00000000 +0, 21000, 21000, 1000, 3, 0x00000000 +0, 22000, 22000, 1000, 3, 0x00000000 +0, 23000, 23000, 1000, 3, 0x00000000 +0, 24000, 24000, 1000, 3, 0x00000000 +0, 25000, 25000, 1000, 3, 0x00000000 +0, 26000, 26000, 1000, 3, 0x00000000 +0, 27000, 27000, 1000, 3, 0x00000000 +0, 28000, 28000, 1000, 3, 0x00000000 +0, 29000, 29000, 1000, 3, 0x00000000 +0, 30000, 30000, 1000, 3, 0x00000000 +0, 31000, 31000, 1000, 3, 0x00000000 +0, 32000, 32000, 1000, 3, 0x00000000 +0, 33000, 33000, 1000, 3, 0x00000000 +0, 34000, 34000, 1000, 3, 0x00000000 +0, 35000, 35000, 1000, 3, 0x00000000 +0, 36000, 36000, 1000, 3, 0x00000000 +0, 37000, 37000, 1000, 3, 0x00000000 +0, 38000, 38000, 1000, 3, 0x00000000 +0, 39000, 39000, 1000, 3, 0x00000000 +0, 40000, 40000, 1000, 3, 0x00000000 +0, 41000, 41000, 1000, 3, 0x00000000 +0, 42000, 42000, 1000, 3, 0x00000000 +0, 43000, 43000, 1000, 3, 0x00000000 +0, 44000, 44000, 1000, 3, 0x00000000 +0, 45000, 45000, 1000, 3, 0x00000000 +0, 46000, 46000, 1000, 3, 0x00000000 +0, 47000, 47000, 1000, 3, 0x00000000 +0, 48000, 48000, 1000, 3, 0x00000000 +0, 49000, 49000, 1000, 3, 0x00000000 +0, 50000, 50000, 1000, 3, 0x00000000 +0, 51000, 51000, 1000, 3, 0x00000000 +0, 52000, 52000, 1000, 3, 0x00000000 +0, 53000, 53000, 1000, 3, 0x00000000 +0, 54000, 54000, 1000, 3, 0x00000000 +0, 55000, 55000, 1000, 3, 0x00000000 +0, 56000, 56000, 1000, 3, 0x00000000 +0, 57000, 57000, 1000, 3, 0x00000000 +0, 58000, 58000, 1000, 3, 0x00000000 +0, 59000, 59000, 1000, 3, 0x00000000 +0, 60000, 60000, 1000, 3, 0x00000000 +0, 61000, 61000, 1000, 3, 0x00000000 +0, 62000, 62000, 1000, 3, 0x00000000 +0, 63000, 63000, 1000, 3, 0x00000000 +0, 64000, 64000, 1000, 3, 0x00000000 +0, 65000, 65000, 1000, 3, 0x00000000 +0, 66000, 66000, 1000, 3, 0x00000000 +0, 67000, 67000, 1000, 3, 0x00000000 +0, 68000, 68000, 1000, 3, 0x00000000 +0, 69000, 69000, 1000, 3, 0x00000000 +0, 70000, 70000, 1000, 3, 0x00000000 +0, 71000, 71000, 1000, 3, 0x00000000 +0, 72000, 72000, 1000, 3, 0x00000000 +0, 73000, 73000, 1000, 3, 0x00000000 +0, 74000, 74000, 1000, 3, 0x00000000 +0, 75000, 75000, 1000, 3, 0x00000000 +0, 76000, 76000, 1000, 3, 0x00000000 +0, 77000, 77000, 1000, 3, 0x00000000 +0, 78000, 78000, 1000, 3, 0x00000000 +0, 79000, 79000, 1000, 3, 0x00000000 +0, 80000, 80000, 1000, 3, 0x00000000 +0, 81000, 81000, 1000, 3, 0x00000000 +0, 82000, 82000, 1000, 3, 0x00000000 +0, 83000, 83000, 1000, 3, 0x00000000 +0, 84000, 84000, 1000, 3, 0x00000000 +0, 85000, 85000, 1000, 3, 0x00000000 +0, 86000, 86000, 1000, 3, 0x00000000 +0, 87000, 87000, 1000, 3, 0x00000000 +0, 88000, 88000, 1000, 3, 0x00000000 +0, 89000, 89000, 1000, 3, 0x00000000 +0, 90000, 90000, 1000, 3, 0x00000000 +0, 91000, 91000, 1000, 3, 0x00000000 +0, 92000, 92000, 1000, 3, 0x00000000 +0, 93000, 93000, 1000, 3, 0x00000000 +0, 94000, 94000, 1000, 3, 0x00000000 +0, 95000, 95000, 1000, 3, 0x00000000 +0, 96000, 96000, 1000, 3, 0x00000000 +0, 97000, 97000, 1000, 3, 0x00000000 +0, 98000, 98000, 1000, 3, 0x00000000 +0, 99000, 99000, 1000, 3, 0x00000000 +0, 100000, 100000, 1000, 3, 0x00000000 +0, 101000, 101000, 1000, 3, 0x00000000 +0, 102000, 102000, 1000, 3, 0x00000000 +0, 103000, 103000, 1000, 3, 0x00000000 +0, 104000, 104000, 1000, 3, 0x00000000 +0, 105000, 105000, 1000, 3, 0x00000000 +0, 106000, 106000, 1000, 3, 0x00000000 +0, 107000, 107000, 1000, 3, 0x00000000 +0, 108000, 108000, 1000, 3, 0x00000000 +0, 109000, 109000, 1000, 3, 0x00000000 +0, 110000, 110000, 1000, 3, 0x00000000 +0, 111000, 111000, 1000, 3, 0x00000000 +0, 112000, 112000, 1000, 3, 0x00000000 +0, 113000, 113000, 1000, 3, 0x00000000 +0, 114000, 114000, 1000, 3, 0x00000000 +0, 115000, 115000, 1000, 3, 0x00000000 +0, 116000, 116000, 1000, 3, 0x00000000 +0, 117000, 117000, 1000, 3, 0x00000000 +0, 118000, 118000, 1000, 3, 0x00000000 +0, 119000, 119000, 1000, 3, 0x00000000 +0, 120000, 120000, 1000, 3, 0x00000000 +0, 121000, 121000, 1000, 3, 0x00000000 +0, 122000, 122000, 1000, 3, 0x00000000 +0, 123000, 123000, 1000, 3, 0x00000000 +0, 124000, 124000, 1000, 3, 0x00000000 +0, 125000, 125000, 1000, 3, 0x00000000 +0, 126000, 126000, 1000, 3, 0x00000000 +0, 127000, 127000, 1000, 3, 0x00000000 +0, 128000, 128000, 1000, 3, 0x00000000 +0, 129000, 129000, 1000, 3, 0x00000000 +0, 130000, 130000, 1000, 3, 0x00000000 +0, 131000, 131000, 1000, 3, 0x00000000 +0, 132000, 132000, 1000, 3, 0x00000000 +1, 132499, 132499, 0, 2238, 0xf8f81348 +0, 133000, 133000, 1000, 3, 0x00000000 +0, 134000, 134000, 1000, 3, 0x00000000 +0, 135000, 135000, 1000, 3, 0x00000000 +0, 136000, 136000, 1000, 3, 0x00000000 +0, 137000, 137000, 1000, 3, 0x00000000 +0, 138000, 138000, 1000, 3, 0x00000000 +0, 139000, 139000, 1000, 3, 0x00000000 +0, 140000, 140000, 1000, 3, 0x00000000 +0, 141000, 141000, 1000, 3, 0x00000000 +0, 142000, 142000, 1000, 3, 0x00000000 +0, 143000, 143000, 1000, 3, 0x00000000 +0, 144000, 144000, 1000, 3, 0x00000000 +0, 145000, 145000, 1000, 3, 0x00000000 +0, 146000, 146000, 1000, 3, 0x00000000 +0, 147000, 147000, 1000, 3, 0x00000000 +1, 147355, 147355, 0, 3320, 0x7091f477 +0, 148000, 148000, 1000, 3, 0x00000000 +0, 149000, 149000, 1000, 3, 0x00000000 +0, 150000, 150000, 1000, 3, 0x00000000 +0, 151000, 151000, 1000, 3, 0x00000000 +0, 152000, 152000, 1000, 3, 0x00000000 +0, 153000, 153000, 1000, 3, 0x00000000 +0, 154000, 154000, 1000, 3, 0x00000000 +0, 155000, 155000, 1000, 3, 0x00000000 +0, 156000, 156000, 1000, 3, 0x00000000 +0, 157000, 157000, 1000, 3, 0x00000000 +0, 158000, 158000, 1000, 3, 0x00000000 +0, 159000, 159000, 1000, 3, 0x00000000 +0, 160000, 160000, 1000, 3, 0x00000000 +0, 161000, 161000, 1000, 3, 0x00000000 +0, 162000, 162000, 1000, 3, 0x00000000 +0, 163000, 163000, 1000, 3, 0x00000000 +0, 164000, 164000, 1000, 3, 0x00000000 +0, 165000, 165000, 1000, 3, 0x00000000 +0, 166000, 166000, 1000, 3, 0x00000000 +0, 167000, 167000, 1000, 3, 0x00000000 +0, 168000, 168000, 1000, 3, 0x00000000 +0, 169000, 169000, 1000, 3, 0x00000000 +0, 170000, 170000, 1000, 3, 0x00000000 +0, 171000, 171000, 1000, 3, 0x00000000 +0, 172000, 172000, 1000, 3, 0x00000000 +0, 173000, 173000, 1000, 3, 0x00000000 +0, 174000, 174000, 1000, 3, 0x00000000 +0, 175000, 175000, 1000, 3, 0x00000000 +0, 176000, 176000, 1000, 3, 0x00000000 +0, 177000, 177000, 1000, 3, 0x00000000 +0, 178000, 178000, 1000, 3, 0x00000000 +0, 179000, 179000, 1000, 3, 0x00000000 +0, 180000, 180000, 1000, 3, 0x00000000 +1, 180797, 180797, 0, 3626, 0xe4ff6eab +0, 181000, 181000, 1000, 3, 0x00000000 +0, 182000, 182000, 1000, 3, 0x00000000 +0, 183000, 183000, 1000, 3, 0x00000000 +1, 183433, 183433, 0, 4156, 0xc73645fe +0, 184000, 184000, 1000, 3, 0x00000000 +0, 185000, 185000, 1000, 3, 0x00000000 +1, 185919, 185919, 0, 2019, 0xe9a5f34f +1, 185919, 185919, 0, 1213, 0x8a62d853 +0, 186000, 186000, 1000, 3, 0x00000000 +0, 187000, 187000, 1000, 3, 0x00000000 +0, 188000, 188000, 1000, 3, 0x00000000 +1, 188663, 188663, 0, 2184, 0xfdcd0323 +0, 189000, 189000, 1000, 3, 0x00000000 +0, 190000, 190000, 1000, 3, 0x00000000 +1, 190014, 190014, 0, 2172, 0xb479f0a1 +0, 191000, 191000, 1000, 3, 0x00000000 +0, 192000, 192000, 1000, 3, 0x00000000 +0, 193000, 193000, 1000, 3, 0x00000000 +0, 194000, 194000, 1000, 3, 0x00000000 +0, 195000, 195000, 1000, 3, 0x00000000 +0, 196000, 196000, 1000, 3, 0x00000000 +0, 197000, 197000, 1000, 3, 0x00000000 +0, 198000, 198000, 1000, 3, 0x00000000 +0, 199000, 199000, 1000, 3, 0x00000000 +1, 199724, 199724, 0, 2080, 0xe8e7c3a2 +0, 200000, 200000, 1000, 3, 0x00000000 +0, 201000, 201000, 1000, 3, 0x00000000 +1, 201175, 201175, 0, 1972, 0xd2c87cd0 +0, 202000, 202000, 1000, 3, 0x00000000 +1, 202819, 202819, 0, 2856, 0xc9a42a11 +0, 203000, 203000, 1000, 3, 0x00000000 +0, 204000, 204000, 1000, 3, 0x00000000 +1, 204762, 204762, 0, 3570, 0x02035220 +0, 205000, 205000, 1000, 3, 0x00000000 +0, 206000, 206000, 1000, 3, 0x00000000 +1, 206806, 206806, 0, 3270, 0x9a39c179 +0, 207000, 207000, 1000, 3, 0x00000000 +0, 208000, 208000, 1000, 3, 0x00000000 +1, 208716, 208716, 0, 2968, 0x6c0b46de +0, 209000, 209000, 1000, 3, 0x00000000 +0, 210000, 210000, 1000, 3, 0x00000000 +1, 210051, 210051, 0, 2142, 0x9e64e867 +0, 211000, 211000, 1000, 3, 0x00000000 +1, 211644, 211644, 0, 4060, 0x274516cc +0, 212000, 212000, 1000, 3, 0x00000000 +0, 213000, 213000, 1000, 3, 0x00000000 +0, 214000, 214000, 1000, 3, 0x00000000 +1, 214380, 214380, 0, 4214, 0xa6a068cb +0, 215000, 215000, 1000, 3, 0x00000000 +0, 216000, 216000, 1000, 3, 0x00000000 +0, 217000, 217000, 1000, 3, 0x00000000 +1, 217225, 217225, 0, 3770, 0x3d3aaf6c +0, 218000, 218000, 1000, 3, 0x00000000 +0, 219000, 219000, 1000, 3, 0x00000000 +1, 219652, 219652, 0, 1862, 0xaa9a5a30 +0, 220000, 220000, 1000, 3, 0x00000000 +0, 221000, 221000, 1000, 3, 0x00000000 +0, 222000, 222000, 1000, 3, 0x00000000 +0, 223000, 223000, 1000, 3, 0x00000000 +1, 223531, 223531, 0, 3222, 0x390690fb +0, 224000, 224000, 1000, 3, 0x00000000 +0, 225000, 225000, 1000, 3, 0x00000000 +0, 226000, 226000, 1000, 3, 0x00000000 +0, 227000, 227000, 1000, 3, 0x00000000 +1, 227510, 227510, 0, 4064, 0x13e132a4 +0, 228000, 228000, 1000, 3, 0x00000000 +0, 229000, 229000, 1000, 3, 0x00000000 +0, 230000, 230000, 1000, 3, 0x00000000 +1, 230872, 230872, 0, 3010, 0xc4a07cbd +0, 231000, 231000, 1000, 3, 0x00000000 +0, 232000, 232000, 1000, 3, 0x00000000 +0, 233000, 233000, 1000, 3, 0x00000000 +1, 233124, 233124, 0, 4950, 0xd30b9b64 +0, 234000, 234000, 1000, 3, 0x00000000 +0, 235000, 235000, 1000, 3, 0x00000000 +0, 236000, 236000, 1000, 3, 0x00000000 +0, 237000, 237000, 1000, 3, 0x00000000 +1, 237303, 237303, 0, 4184, 0x5115659c +0, 238000, 238000, 1000, 3, 0x00000000 +0, 239000, 239000, 1000, 3, 0x00000000 +0, 240000, 240000, 1000, 3, 0x00000000 +1, 240106, 240106, 0, 3554, 0x14804a6c +0, 241000, 241000, 1000, 3, 0x00000000 +0, 242000, 242000, 1000, 3, 0x00000000 +0, 243000, 243000, 1000, 3, 0x00000000 +0, 244000, 244000, 1000, 3, 0x00000000 +0, 245000, 245000, 1000, 3, 0x00000000 +0, 246000, 246000, 1000, 3, 0x00000000 +0, 247000, 247000, 1000, 3, 0x00000000 +0, 248000, 248000, 1000, 3, 0x00000000 +0, 249000, 249000, 1000, 3, 0x00000000 +0, 250000, 250000, 1000, 3, 0x00000000 +0, 251000, 251000, 1000, 3, 0x00000000 +0, 252000, 252000, 1000, 3, 0x00000000 +0, 253000, 253000, 1000, 3, 0x00000000 +0, 254000, 254000, 1000, 3, 0x00000000 +0, 255000, 255000, 1000, 3, 0x00000000 +0, 256000, 256000, 1000, 3, 0x00000000 +0, 257000, 257000, 1000, 3, 0x00000000 +0, 258000, 258000, 1000, 3, 0x00000000 +0, 259000, 259000, 1000, 3, 0x00000000 +0, 260000, 260000, 1000, 3, 0x00000000 +0, 261000, 261000, 1000, 3, 0x00000000 +0, 262000, 262000, 1000, 3, 0x00000000 +0, 263000, 263000, 1000, 3, 0x00000000 +0, 264000, 264000, 1000, 3, 0x00000000 +0, 265000, 265000, 1000, 3, 0x00000000 +0, 266000, 266000, 1000, 3, 0x00000000 +0, 267000, 267000, 1000, 3, 0x00000000 +0, 268000, 268000, 1000, 3, 0x00000000 +0, 269000, 269000, 1000, 3, 0x00000000 +0, 270000, 270000, 1000, 3, 0x00000000 +0, 271000, 271000, 1000, 3, 0x00000000 +0, 272000, 272000, 1000, 3, 0x00000000 +0, 273000, 273000, 1000, 3, 0x00000000 +1, 273556, 273556, 0, 2300, 0x53d23a41 +0, 274000, 274000, 1000, 3, 0x00000000 +0, 275000, 275000, 1000, 3, 0x00000000 +0, 276000, 276000, 1000, 3, 0x00000000 +0, 277000, 277000, 1000, 3, 0x00000000 +0, 278000, 278000, 1000, 3, 0x00000000 +0, 279000, 279000, 1000, 3, 0x00000000 +0, 280000, 280000, 1000, 3, 0x00000000 +0, 281000, 281000, 1000, 3, 0x00000000 +0, 282000, 282000, 1000, 3, 0x00000000 +0, 283000, 283000, 1000, 3, 0x00000000 +0, 284000, 284000, 1000, 3, 0x00000000 +0, 285000, 285000, 1000, 3, 0x00000000 +0, 286000, 286000, 1000, 3, 0x00000000 +0, 287000, 287000, 1000, 3, 0x00000000 +0, 288000, 288000, 1000, 3, 0x00000000 +0, 289000, 289000, 1000, 3, 0x00000000 +0, 290000, 290000, 1000, 3, 0x00000000 +0, 291000, 291000, 1000, 3, 0x00000000 +0, 292000, 292000, 1000, 3, 0x00000000 +0, 293000, 293000, 1000, 3, 0x00000000 +0, 294000, 294000, 1000, 3, 0x00000000 +0, 295000, 295000, 1000, 3, 0x00000000 +1, 295445, 295445, 0, 1544, 0x4e4ed1a0 +0, 296000, 296000, 1000, 3, 0x00000000 +0, 297000, 297000, 1000, 3, 0x00000000 +0, 298000, 298000, 1000, 3, 0x00000000 +0, 299000, 299000, 1000, 3, 0x00000000 +0, 300000, 300000, 1000, 3, 0x00000000 +1, 300049, 300049, 0, 2478, 0x6e3e7b4d +0, 301000, 301000, 1000, 3, 0x00000000 +0, 302000, 302000, 1000, 3, 0x00000000 +1, 302018, 302018, 0, 2019, 0x5eb7c3d9 +1, 302035, 302035, 0, 405, 0x98a58922 +0, 303000, 303000, 1000, 3, 0x00000000 +0, 304000, 304000, 1000, 3, 0x00000000 +1, 304203, 304203, 0, 2998, 0xee7c6a15 +0, 305000, 305000, 1000, 3, 0x00000000 +1, 305947, 305947, 0, 2640, 0xf426b974 +0, 306000, 306000, 1000, 3, 0x00000000 +0, 307000, 307000, 1000, 3, 0x00000000 +1, 307957, 307957, 0, 2174, 0x40340514 +0, 308000, 308000, 1000, 3, 0x00000000 +0, 309000, 309000, 1000, 3, 0x00000000 +0, 310000, 310000, 1000, 3, 0x00000000 +0, 311000, 311000, 1000, 3, 0x00000000 +0, 312000, 312000, 1000, 3, 0x00000000 +0, 313000, 313000, 1000, 3, 0x00000000 +0, 314000, 314000, 1000, 3, 0x00000000 +0, 315000, 315000, 1000, 3, 0x00000000 +0, 316000, 316000, 1000, 3, 0x00000000 +0, 317000, 317000, 1000, 3, 0x00000000 +0, 318000, 318000, 1000, 3, 0x00000000 +0, 319000, 319000, 1000, 3, 0x00000000 +0, 320000, 320000, 1000, 3, 0x00000000 +0, 321000, 321000, 1000, 3, 0x00000000 +1, 321295, 321295, 0, 2760, 0x4ae1e9ad +0, 322000, 322000, 1000, 3, 0x00000000 +0, 323000, 323000, 1000, 3, 0x00000000 +1, 323356, 323356, 0, 2688, 0xdec1c1d6 +0, 324000, 324000, 1000, 3, 0x00000000 +1, 324640, 324640, 0, 3694, 0x3b5d80de +0, 325000, 325000, 1000, 3, 0x00000000 +0, 326000, 326000, 1000, 3, 0x00000000 +0, 327000, 327000, 1000, 3, 0x00000000 +1, 327193, 327193, 0, 2276, 0x0dae2c53 +0, 328000, 328000, 1000, 3, 0x00000000 +1, 328369, 328369, 0, 2019, 0x4d9cd2f2 +1, 328369, 328369, 0, 847, 0x1d3f4a3d +0, 329000, 329000, 1000, 3, 0x00000000 +1, 329946, 329946, 0, 1974, 0xb63e71b1 +0, 330000, 330000, 1000, 3, 0x00000000 +0, 331000, 331000, 1000, 3, 0x00000000 +1, 331230, 331230, 0, 3004, 0x69a86a37 +0, 332000, 332000, 1000, 3, 0x00000000 +1, 332924, 332924, 0, 2124, 0xf5c6dc9a +0, 333000, 333000, 1000, 3, 0x00000000 +0, 334000, 334000, 1000, 3, 0x00000000 +0, 335000, 335000, 1000, 3, 0x00000000 +0, 336000, 336000, 1000, 3, 0x00000000 +0, 337000, 337000, 1000, 3, 0x00000000 +0, 338000, 338000, 1000, 3, 0x00000000 +0, 339000, 339000, 1000, 3, 0x00000000 +0, 340000, 340000, 1000, 3, 0x00000000 +0, 341000, 341000, 1000, 3, 0x00000000 +0, 342000, 342000, 1000, 3, 0x00000000 +1, 342600, 342600, 0, 1876, 0x3ed26066 +0, 343000, 343000, 1000, 3, 0x00000000 +0, 344000, 344000, 1000, 3, 0x00000000 +0, 345000, 345000, 1000, 3, 0x00000000 +0, 346000, 346000, 1000, 3, 0x00000000 +1, 346771, 346771, 0, 2426, 0xccae6c39 +0, 347000, 347000, 1000, 3, 0x00000000 +0, 348000, 348000, 1000, 3, 0x00000000 +0, 349000, 349000, 1000, 3, 0x00000000 +0, 350000, 350000, 1000, 3, 0x00000000 +0, 351000, 351000, 1000, 3, 0x00000000 +0, 352000, 352000, 1000, 3, 0x00000000 +0, 353000, 353000, 1000, 3, 0x00000000 +0, 354000, 354000, 1000, 3, 0x00000000 +0, 355000, 355000, 1000, 3, 0x00000000 +0, 356000, 356000, 1000, 3, 0x00000000 +0, 357000, 357000, 1000, 3, 0x00000000 +1, 357640, 357640, 0, 3240, 0x90cb9fd1 +0, 358000, 358000, 1000, 3, 0x00000000 +0, 359000, 359000, 1000, 3, 0x00000000 +1, 359834, 359834, 0, 2482, 0xc68e6a8a diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/source mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/source --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/source 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/source 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,7 @@ compat/djgpp/math.h compat/float/float.h compat/float/limits.h +libavcodec/bitstream_template.h tools/decode_simple.h Use of av_clip() where av_clip_uintp2() could be used: Use of av_clip() where av_clip_intp2() could be used: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-aac-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-aac-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-aac-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-aac-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,93 @@ +1a324961354902555e25d30f67300f51 *tests/data/fate/spdif-aac-remux.spdif +352256 tests/data/fate/spdif-aac-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: aac +#sample_rate 0: 44100 +#channel_layout_name 0: stereo +0, 0, 0, 2089, 378, 0x5ebf1e99 +0, 2089, 2089, 2089, 410, 0x9a9cc8b5 +0, 4179, 4179, 2089, 410, 0xf2ffc522 +0, 6268, 6268, 2089, 404, 0x4a1dc5a1 +0, 8358, 8358, 2089, 412, 0x38c5cd55 +0, 10448, 10448, 2089, 440, 0x363fdb80 +0, 12538, 12538, 2089, 376, 0x269ec08b +0, 14628, 14628, 2089, 378, 0xd627be91 +0, 16717, 16717, 2089, 434, 0x7f68d7ba +0, 18807, 18807, 2089, 354, 0x52b5b11f +0, 20897, 20897, 2089, 368, 0x4458a8c2 +0, 22987, 22987, 2089, 378, 0x789ab43a +0, 25077, 25077, 2089, 378, 0x476ec1f4 +0, 27166, 27166, 2089, 366, 0xe13fb37a +0, 29256, 29256, 2089, 370, 0x3772b685 +0, 31346, 31346, 2089, 366, 0x54bbb52b +0, 33436, 33436, 2089, 380, 0x28a9bc19 +0, 35526, 35526, 2089, 496, 0x761efc09 +0, 37615, 37615, 2089, 354, 0xb524bb1f +0, 39705, 39705, 2089, 348, 0xcef9b075 +0, 41795, 41795, 2089, 360, 0x5a50bc48 +0, 43885, 43885, 2089, 362, 0xb454b67c +0, 45975, 45975, 2089, 362, 0x2502aab4 +0, 48064, 48064, 2089, 378, 0x9336b10f +0, 50154, 50154, 2089, 376, 0x2dcbb1e6 +0, 52244, 52244, 2089, 370, 0x8064ac7f +0, 54334, 54334, 2089, 368, 0x300ebac3 +0, 56424, 56424, 2089, 372, 0x88ccba7c +0, 58513, 58513, 2089, 370, 0x1ad6b67b +0, 60603, 60603, 2089, 374, 0x1969bafe +0, 62693, 62693, 2089, 378, 0x1d55b287 +0, 64783, 64783, 2089, 370, 0xffc7b1e0 +0, 66873, 66873, 2089, 392, 0x1ab2c1af +0, 68962, 68962, 2089, 382, 0xc98bbd75 +0, 71052, 71052, 2089, 394, 0xbf2ac43b +0, 73142, 73142, 2089, 370, 0xcd31bbef +0, 75232, 75232, 2089, 394, 0x579eca77 +0, 77322, 77322, 2089, 386, 0xdeebc55a +0, 79411, 79411, 2089, 384, 0xc125c2b8 +0, 81501, 81501, 2089, 366, 0x0ce6bf87 +0, 83591, 83591, 2089, 380, 0x202fbd37 +0, 85681, 85681, 2089, 454, 0x6997e64d +0, 87771, 87771, 2089, 356, 0x41f9b837 +0, 89860, 89860, 2089, 362, 0x3f9bb026 +0, 91950, 91950, 2089, 368, 0xe511af25 +0, 94040, 94040, 2089, 418, 0x42f7d1d5 +0, 96130, 96130, 2089, 410, 0x657dd072 +0, 98220, 98220, 2089, 490, 0x1476f7f6 +0, 100309, 100309, 2089, 350, 0x44fbb45f +0, 102399, 102399, 2089, 350, 0xfd52aef1 +0, 104489, 104489, 2089, 350, 0xd354aa2f +0, 106579, 106579, 2089, 352, 0xbaaaad58 +0, 108668, 108668, 2089, 354, 0x591baa8c +0, 110758, 110758, 2089, 362, 0xf053b0e1 +0, 112848, 112848, 2089, 376, 0x8fafbbf8 +0, 114938, 114938, 2089, 444, 0xde95eef0 +0, 117028, 117028, 2089, 342, 0x5869a95e +0, 119117, 119117, 2089, 402, 0x6d2eca68 +0, 121207, 121207, 2089, 380, 0xe1c1b4ee +0, 123297, 123297, 2089, 358, 0x3807ad6f +0, 125387, 125387, 2089, 350, 0xaa47aa0f +0, 127477, 127477, 2089, 358, 0xf8dbabbf +0, 129566, 129566, 2089, 368, 0x701fae8c +0, 131656, 131656, 2089, 368, 0x60c1b34e +0, 133746, 133746, 2089, 392, 0x749ac181 +0, 135836, 135836, 2089, 478, 0xce58f5ab +0, 137926, 137926, 2089, 346, 0x5767a88b +0, 140015, 140015, 2089, 362, 0x7998b479 +0, 142105, 142105, 2089, 356, 0x300bb3eb +0, 144195, 144195, 2089, 362, 0xa783b13f +0, 146285, 146285, 2089, 356, 0x8ce5b0bd +0, 148375, 148375, 2089, 402, 0x684fc5d8 +0, 150464, 150464, 2089, 434, 0x83d8e111 +0, 152554, 152554, 2089, 352, 0x5e3ab34f +0, 154644, 154644, 2089, 364, 0xa2a5ab60 +0, 156734, 156734, 2089, 380, 0x0c90bbfd +0, 158824, 158824, 2089, 378, 0x1ee7bf81 +0, 160913, 160913, 2089, 378, 0xb3d1b08e +0, 163003, 163003, 2089, 372, 0x7480b657 +0, 165093, 165093, 2089, 376, 0x9e31bfd0 +0, 167183, 167183, 2089, 424, 0x963bdd40 +0, 169273, 169273, 2089, 468, 0x6016f010 +0, 171362, 171362, 2089, 472, 0x69c4e4c5 +0, 173452, 173452, 2089, 334, 0x2354ab0b +0, 175542, 175542, 2089, 346, 0xe85bab65 +0, 177632, 177632, 2089, 266, 0x93bb7efa diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-ac3-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-ac3-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-ac3-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-ac3-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,63 @@ +d2c51a1156406cd8895122998efa66ec *tests/data/fate/spdif-ac3-remux.spdif +344064 tests/data/fate/spdif-ac3-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: ac3 +#sample_rate 0: 48000 +#channel_layout_name 0: 5.1(side) +0, 0, 0, 2880, 1792, 0xc6250823 +0, 2880, 2880, 2880, 1792, 0xb76a1098 +0, 5760, 5760, 2880, 1792, 0xfe6e1038 +0, 8640, 8640, 2880, 1792, 0x102f060a +0, 11520, 11520, 2880, 1792, 0xfd881629 +0, 14400, 14400, 2880, 1792, 0x950505f6 +0, 17280, 17280, 2880, 1792, 0x3d9a143f +0, 20160, 20160, 2880, 1792, 0xa2261142 +0, 23040, 23040, 2880, 1792, 0x9cc9053d +0, 25920, 25920, 2880, 1792, 0xaaeb109b +0, 28800, 28800, 2880, 1792, 0xd36308f6 +0, 31680, 31680, 2880, 1792, 0xb08a125d +0, 34560, 34560, 2880, 1792, 0xd8d31026 +0, 37440, 37440, 2880, 1792, 0x9b87a34d +0, 40320, 40320, 2880, 1792, 0x51ed77f6 +0, 43200, 43200, 2880, 1792, 0x29c16ed2 +0, 46080, 46080, 2880, 1792, 0x8c9662d6 +0, 48960, 48960, 2880, 1792, 0x32c85025 +0, 51840, 51840, 2880, 1792, 0x32914d88 +0, 54720, 54720, 2880, 1792, 0x84b9382b +0, 57600, 57600, 2880, 1792, 0x003e4890 +0, 60480, 60480, 2880, 1792, 0x70325b4e +0, 63360, 63360, 2880, 1792, 0x80e04a58 +0, 66240, 66240, 2880, 1792, 0x2c46323a +0, 69120, 69120, 2880, 1792, 0x7be152a5 +0, 72000, 72000, 2880, 1792, 0x08615466 +0, 74880, 74880, 2880, 1792, 0x55364eaf +0, 77760, 77760, 2880, 1792, 0x46595d56 +0, 80640, 80640, 2880, 1792, 0xdf476ace +0, 83520, 83520, 2880, 1792, 0x9ff767dc +0, 86400, 86400, 2880, 1792, 0xb4d450a7 +0, 89280, 89280, 2880, 1792, 0x032c7506 +0, 92160, 92160, 2880, 1792, 0x50e35426 +0, 95040, 95040, 2880, 1792, 0xe5575597 +0, 97920, 97920, 2880, 1792, 0x86565611 +0, 100800, 100800, 2880, 1792, 0xed6f54aa +0, 103680, 103680, 2880, 1792, 0x4cee4aab +0, 106560, 106560, 2880, 1792, 0x8aa33ac7 +0, 109440, 109440, 2880, 1792, 0xb665442c +0, 112320, 112320, 2880, 1792, 0x9a4b647d +0, 115200, 115200, 2880, 1792, 0xf40d582d +0, 118080, 118080, 2880, 1792, 0xf22e5d98 +0, 120960, 120960, 2880, 1792, 0x2f7745be +0, 123840, 123840, 2880, 1792, 0xa918561a +0, 126720, 126720, 2880, 1792, 0x59cc56fb +0, 129600, 129600, 2880, 1792, 0xaefe5dca +0, 132480, 132480, 2880, 1792, 0x80ba657d +0, 135360, 135360, 2880, 1792, 0x09137032 +0, 138240, 138240, 2880, 1792, 0xf51b5d34 +0, 141120, 141120, 2880, 1792, 0x1d695fb1 +0, 144000, 144000, 2880, 1792, 0xf6f56509 +0, 146880, 146880, 2880, 1792, 0xd1f658d5 +0, 149760, 149760, 2880, 1792, 0xb8614f64 +0, 152640, 152640, 2880, 1792, 0x8dd55743 +0, 155520, 155520, 2880, 1792, 0xcb1f50df +0, 158400, 158400, 2880, 1440, 0xa129aa95 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-bswap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-bswap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-bswap 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-bswap 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +45ff602f64887babf37f4ee14e5d5072 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-core-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,14 @@ +a4e739ebe07c75dd569156d5038696a9 *tests/data/fate/spdif-dca-core-remux.spdif +14336 tests/data/fate/spdif-dca-core-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: dts +#sample_rate 0: 48000 +#channel_layout_name 0: 5.1(side) +0, 0, 0, 0, 1024, 0x07b79d2a +0, 0, 0, 0, 1024, 0x7eaaba77 +0, 0, 0, 0, 1024, 0xbed65c1d +0, 0, 0, 0, 1024, 0x10bc6792 +0, 0, 0, 0, 1024, 0xf8436f6e +0, 0, 0, 0, 1024, 0x4454a681 +0, 0, 0, 0, 1024, 0xda3ba189 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +00d1ec506aa862a0c17c197c3773a82b diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +43fc10a0a8360931f946f80b9941c9c5 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-dca-master-core-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,1179 @@ +c4f3f3c6ca73fcb7beac137105dadab4 *tests/data/fate/spdif-dca-master-core-remux.spdif +2400256 tests/data/fate/spdif-dca-master-core-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: dts +#sample_rate 0: 48000 +#channel_layout_name 0: 5.1(side) +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xbe7b9e5e +0, 0, 0, 0, 2012, 0x671dc73a +0, 0, 0, 0, 2012, 0x7fd5b1d2 +0, 0, 0, 0, 2012, 0xa9259df1 +0, 0, 0, 0, 2012, 0x3e8c2b92 +0, 0, 0, 0, 2012, 0x4876a9ff +0, 0, 0, 0, 2012, 0x7e469182 +0, 0, 0, 0, 2012, 0x10eba401 +0, 0, 0, 0, 2012, 0x51c68ed3 +0, 0, 0, 0, 2012, 0x3f52901b +0, 0, 0, 0, 2012, 0x7bebacce +0, 0, 0, 0, 2012, 0xcb94898d +0, 0, 0, 0, 2012, 0x14e3ae70 +0, 0, 0, 0, 2012, 0x016893cb +0, 0, 0, 0, 2012, 0x00739f0a +0, 0, 0, 0, 2012, 0x834aba41 +0, 0, 0, 0, 2012, 0x6a92ac08 +0, 0, 0, 0, 2012, 0x09eda257 +0, 0, 0, 0, 2012, 0x81449e3f +0, 0, 0, 0, 2012, 0xe6eb91d4 +0, 0, 0, 0, 2012, 0x51158c0e +0, 0, 0, 0, 2012, 0x84e4a013 +0, 0, 0, 0, 2012, 0x4c48a0e6 +0, 0, 0, 0, 2012, 0xf54c9811 +0, 0, 0, 0, 2012, 0x62778edb +0, 0, 0, 0, 2012, 0x7226a51b +0, 0, 0, 0, 2012, 0x44b9aad8 +0, 0, 0, 0, 2012, 0x8aa6b380 +0, 0, 0, 0, 2012, 0xc88c99e6 +0, 0, 0, 0, 2012, 0xed5e93e2 +0, 0, 0, 0, 2012, 0xeb0b9755 +0, 0, 0, 0, 2012, 0xe5ba8ca9 +0, 0, 0, 0, 2012, 0x2fef9bcf +0, 0, 0, 0, 2012, 0xf19c8749 +0, 0, 0, 0, 2012, 0x0feb94d0 +0, 0, 0, 0, 2012, 0x1f9194d1 +0, 0, 0, 0, 2012, 0x0cad9822 +0, 0, 0, 0, 2012, 0xe6f79152 +0, 0, 0, 0, 2012, 0x69e78955 +0, 0, 0, 0, 2012, 0x91dd8a1b +0, 0, 0, 0, 2012, 0x63fe8eea +0, 0, 0, 0, 2012, 0x8f6d90a2 +0, 0, 0, 0, 2012, 0xe3bf8626 +0, 0, 0, 0, 2012, 0xd08599db +0, 0, 0, 0, 2012, 0xf556a282 +0, 0, 0, 0, 2012, 0x7f8c8f90 +0, 0, 0, 0, 2012, 0xa04493b9 +0, 0, 0, 0, 2012, 0x21a19b3a +0, 0, 0, 0, 2012, 0x6ead9244 +0, 0, 0, 0, 2012, 0xe65290d7 +0, 0, 0, 0, 2012, 0x8ff58a8e +0, 0, 0, 0, 2012, 0x24ada603 +0, 0, 0, 0, 2012, 0x79cb85c7 +0, 0, 0, 0, 2012, 0x63c0ac54 +0, 0, 0, 0, 2012, 0x7f719f83 +0, 0, 0, 0, 2012, 0x2eb69654 +0, 0, 0, 0, 2012, 0xf5149bc0 +0, 0, 0, 0, 2012, 0xd0d6a414 +0, 0, 0, 0, 2012, 0x4f4a8ed3 +0, 0, 0, 0, 2012, 0x20888cb5 +0, 0, 0, 0, 2012, 0x13439c86 +0, 0, 0, 0, 2012, 0xc8fc98e1 +0, 0, 0, 0, 2012, 0x14689766 +0, 0, 0, 0, 2012, 0x830293e4 +0, 0, 0, 0, 2012, 0xdd5bb8ce +0, 0, 0, 0, 2012, 0x005ea280 +0, 0, 0, 0, 2012, 0x9b0581e2 +0, 0, 0, 0, 2012, 0x210f89b8 +0, 0, 0, 0, 2012, 0xb7c180bd +0, 0, 0, 0, 2012, 0xe53c85e4 +0, 0, 0, 0, 2012, 0x1f689207 +0, 0, 0, 0, 2012, 0x5653813b +0, 0, 0, 0, 2012, 0x1d278d66 +0, 0, 0, 0, 2012, 0xd94c9a83 +0, 0, 0, 0, 2012, 0x7af48548 +0, 0, 0, 0, 2012, 0x86209c99 +0, 0, 0, 0, 2012, 0x6e3b7fc9 +0, 0, 0, 0, 2012, 0x41c289e7 +0, 0, 0, 0, 2012, 0x8bea85db +0, 0, 0, 0, 2012, 0x45c98c39 +0, 0, 0, 0, 2012, 0xee098755 +0, 0, 0, 0, 2012, 0x485d9ec1 +0, 0, 0, 0, 2012, 0x78819023 +0, 0, 0, 0, 2012, 0xf43377bd +0, 0, 0, 0, 2012, 0x43fc9439 +0, 0, 0, 0, 2012, 0x045e9bf3 +0, 0, 0, 0, 2012, 0x0fc09f0c +0, 0, 0, 0, 2012, 0x7ba69bf5 +0, 0, 0, 0, 2012, 0x4aa7aaf0 +0, 0, 0, 0, 2012, 0x620c85bf +0, 0, 0, 0, 2012, 0xa6bb8a30 +0, 0, 0, 0, 2012, 0xfd10883c +0, 0, 0, 0, 2012, 0x32037e17 +0, 0, 0, 0, 2012, 0xb18c9e01 +0, 0, 0, 0, 2012, 0xd8206ee5 +0, 0, 0, 0, 2012, 0xdbc49136 +0, 0, 0, 0, 2012, 0x650a785d +0, 0, 0, 0, 2012, 0x9e107d61 +0, 0, 0, 0, 2012, 0xbf4eac50 +0, 0, 0, 0, 2012, 0x9d8f79b2 +0, 0, 0, 0, 2012, 0x252d8e8a +0, 0, 0, 0, 2012, 0x00af8fd6 +0, 0, 0, 0, 2012, 0x9e388d3b +0, 0, 0, 0, 2012, 0x75de7f56 +0, 0, 0, 0, 2012, 0xd502839c +0, 0, 0, 0, 2012, 0x66709e03 +0, 0, 0, 0, 2012, 0x3e0a96ba +0, 0, 0, 0, 2012, 0x0813ad4e +0, 0, 0, 0, 2012, 0x799c90c5 +0, 0, 0, 0, 2012, 0x98a18bed +0, 0, 0, 0, 2012, 0x8cd197d7 +0, 0, 0, 0, 2012, 0xf9ea8b22 +0, 0, 0, 0, 2012, 0x674f7cd2 +0, 0, 0, 0, 2012, 0xa5c39136 +0, 0, 0, 0, 2012, 0xe064ac30 +0, 0, 0, 0, 2012, 0x2af78c75 +0, 0, 0, 0, 2012, 0x43df9b19 +0, 0, 0, 0, 2012, 0x8d1a87d5 +0, 0, 0, 0, 2012, 0xd5be8d29 +0, 0, 0, 0, 2012, 0x43448bd4 +0, 0, 0, 0, 2012, 0xa128a30b +0, 0, 0, 0, 2012, 0x6fc29902 +0, 0, 0, 0, 2012, 0x5854a24b +0, 0, 0, 0, 2012, 0xb222958a +0, 0, 0, 0, 2012, 0xfca39cce +0, 0, 0, 0, 2012, 0xee0087f0 +0, 0, 0, 0, 2012, 0xd2d69b8c +0, 0, 0, 0, 2012, 0xe2308f8d +0, 0, 0, 0, 2012, 0x8dc4b09a +0, 0, 0, 0, 2012, 0x14489aef +0, 0, 0, 0, 2012, 0x900f9835 +0, 0, 0, 0, 2012, 0x0092a95f +0, 0, 0, 0, 2012, 0xfd90b1bf +0, 0, 0, 0, 2012, 0xb11ab5d5 +0, 0, 0, 0, 2012, 0xc802b908 +0, 0, 0, 0, 2012, 0xb12aa91e +0, 0, 0, 0, 2012, 0xd173c2a9 +0, 0, 0, 0, 2012, 0xaeafb887 +0, 0, 0, 0, 2012, 0xeb7eb0d7 +0, 0, 0, 0, 2012, 0x9afbc56a +0, 0, 0, 0, 2012, 0x2d78bc34 +0, 0, 0, 0, 2012, 0x6550aed1 +0, 0, 0, 0, 2012, 0xd514a55d +0, 0, 0, 0, 2012, 0x9058c263 +0, 0, 0, 0, 2012, 0xf819b66a +0, 0, 0, 0, 2012, 0x16a5c902 +0, 0, 0, 0, 2012, 0x602fc11b +0, 0, 0, 0, 2012, 0xe3c6b177 +0, 0, 0, 0, 2012, 0xacc4cd06 +0, 0, 0, 0, 2012, 0xeb96addb +0, 0, 0, 0, 2012, 0x1195cad3 +0, 0, 0, 0, 2012, 0x8e96ad7f +0, 0, 0, 0, 2012, 0x31e592b7 +0, 0, 0, 0, 2012, 0xa0c5ccf0 +0, 0, 0, 0, 2012, 0x6e77c92b +0, 0, 0, 0, 2012, 0xe87fa928 +0, 0, 0, 0, 2012, 0x4923bcdb +0, 0, 0, 0, 2012, 0x3260b452 +0, 0, 0, 0, 2012, 0x62beafa0 +0, 0, 0, 0, 2012, 0x5a6fc18a +0, 0, 0, 0, 2012, 0x9d05ae87 +0, 0, 0, 0, 2012, 0xb577a54e +0, 0, 0, 0, 2012, 0xd66bc5ef +0, 0, 0, 0, 2012, 0x40bec7bb +0, 0, 0, 0, 2012, 0xedd3a1b9 +0, 0, 0, 0, 2012, 0xf6f49f83 +0, 0, 0, 0, 2012, 0x316fb06d +0, 0, 0, 0, 2012, 0xc3f3a874 +0, 0, 0, 0, 2012, 0x3a96b3bd +0, 0, 0, 0, 2012, 0x825aba30 +0, 0, 0, 0, 2012, 0x5b58ce66 +0, 0, 0, 0, 2012, 0x412dc092 +0, 0, 0, 0, 2012, 0xcb47bfa3 +0, 0, 0, 0, 2012, 0xe025bb79 +0, 0, 0, 0, 2012, 0x0042ba53 +0, 0, 0, 0, 2012, 0x7e9bba1d +0, 0, 0, 0, 2012, 0x0058c99d +0, 0, 0, 0, 2012, 0x47d2b590 +0, 0, 0, 0, 2012, 0xdf4ba9c6 +0, 0, 0, 0, 2012, 0xe671987c +0, 0, 0, 0, 2012, 0x90dccc89 +0, 0, 0, 0, 2012, 0x012ccae9 +0, 0, 0, 0, 2012, 0x2eb5b83e +0, 0, 0, 0, 2012, 0x3fecb7f4 +0, 0, 0, 0, 2012, 0x7955a464 +0, 0, 0, 0, 2012, 0xfe9eb3c3 +0, 0, 0, 0, 2012, 0x7457c904 +0, 0, 0, 0, 2012, 0xd23ea69d +0, 0, 0, 0, 2012, 0xc497bf82 +0, 0, 0, 0, 2012, 0x15e5c241 +0, 0, 0, 0, 2012, 0x3dfea71f +0, 0, 0, 0, 2012, 0x1e59c9c0 +0, 0, 0, 0, 2012, 0x1a34b927 +0, 0, 0, 0, 2012, 0xbf42b430 +0, 0, 0, 0, 2012, 0xf084c29f +0, 0, 0, 0, 2012, 0x6443c44a +0, 0, 0, 0, 2012, 0x7985a4a5 +0, 0, 0, 0, 2012, 0x27add059 +0, 0, 0, 0, 2012, 0x7f1faea4 +0, 0, 0, 0, 2012, 0x8d9dc732 +0, 0, 0, 0, 2012, 0xf272c32e +0, 0, 0, 0, 2012, 0x4fa3ab11 +0, 0, 0, 0, 2012, 0x512e9887 +0, 0, 0, 0, 2012, 0xd478d55b +0, 0, 0, 0, 2012, 0xa94a9d93 +0, 0, 0, 0, 2012, 0xff73d812 +0, 0, 0, 0, 2012, 0xd3a6b9ef +0, 0, 0, 0, 2012, 0x7b4ebc1e +0, 0, 0, 0, 2012, 0xcc7bba1a +0, 0, 0, 0, 2012, 0x1aa7cd1a +0, 0, 0, 0, 2012, 0xd707c202 +0, 0, 0, 0, 2012, 0xcb6ac18b +0, 0, 0, 0, 2012, 0x1ccdcbd6 +0, 0, 0, 0, 2012, 0x700cb51e +0, 0, 0, 0, 2012, 0x27b6a3e7 +0, 0, 0, 0, 2012, 0x8570b8cd +0, 0, 0, 0, 2012, 0x22f2b2ed +0, 0, 0, 0, 2012, 0x75edb63e +0, 0, 0, 0, 2012, 0x8145b53f +0, 0, 0, 0, 2012, 0x15efb8bc +0, 0, 0, 0, 2012, 0x200bb5e6 +0, 0, 0, 0, 2012, 0xfa79b178 +0, 0, 0, 0, 2012, 0xbd39cdf4 +0, 0, 0, 0, 2012, 0x0970b0b2 +0, 0, 0, 0, 2012, 0x1acebe72 +0, 0, 0, 0, 2012, 0x1a26aa71 +0, 0, 0, 0, 2012, 0x8f71aa54 +0, 0, 0, 0, 2012, 0x0265c523 +0, 0, 0, 0, 2012, 0x2df0a53b +0, 0, 0, 0, 2012, 0x59a7a37a +0, 0, 0, 0, 2012, 0x9ad9acda +0, 0, 0, 0, 2012, 0x738cbc6f +0, 0, 0, 0, 2012, 0xc646a7ad +0, 0, 0, 0, 2012, 0x7f25c19b +0, 0, 0, 0, 2012, 0x1439bdb0 +0, 0, 0, 0, 2012, 0xa40cbef0 +0, 0, 0, 0, 2012, 0x9b09b99a +0, 0, 0, 0, 2012, 0x5ff0bbde +0, 0, 0, 0, 2012, 0x3981c2d6 +0, 0, 0, 0, 2012, 0xfa89b40d +0, 0, 0, 0, 2012, 0x12e9a7b9 +0, 0, 0, 0, 2012, 0xc5faaac3 +0, 0, 0, 0, 2012, 0xe12bc3a9 +0, 0, 0, 0, 2012, 0x9c57b8f3 +0, 0, 0, 0, 2012, 0x4fd4b6c0 +0, 0, 0, 0, 2012, 0xb72cca50 +0, 0, 0, 0, 2012, 0xb4d4cbbb +0, 0, 0, 0, 2012, 0x9399bfa1 +0, 0, 0, 0, 2012, 0x0abfb708 +0, 0, 0, 0, 2012, 0xd1d9acc0 +0, 0, 0, 0, 2012, 0x079ab5b2 +0, 0, 0, 0, 2012, 0x05a0be32 +0, 0, 0, 0, 2012, 0x445cc8db +0, 0, 0, 0, 2012, 0xf9a3aa71 +0, 0, 0, 0, 2012, 0xd2e29eac +0, 0, 0, 0, 2012, 0x391a9f20 +0, 0, 0, 0, 2012, 0x571eab4e +0, 0, 0, 0, 2012, 0x6962bc96 +0, 0, 0, 0, 2012, 0x2f04b495 +0, 0, 0, 0, 2012, 0x7b66bab7 +0, 0, 0, 0, 2012, 0xa718b8c9 +0, 0, 0, 0, 2012, 0xb069a54e +0, 0, 0, 0, 2012, 0xc052a1d2 +0, 0, 0, 0, 2012, 0x661ac62e +0, 0, 0, 0, 2012, 0xc4ebb529 +0, 0, 0, 0, 2012, 0xf998b251 +0, 0, 0, 0, 2012, 0x0ee8bffa +0, 0, 0, 0, 2012, 0x6e3fd984 +0, 0, 0, 0, 2012, 0x5825b63f +0, 0, 0, 0, 2012, 0x9c79c561 +0, 0, 0, 0, 2012, 0x3470beb7 +0, 0, 0, 0, 2012, 0x9135bd9d +0, 0, 0, 0, 2012, 0xd8e8bb7f +0, 0, 0, 0, 2012, 0x322ea448 +0, 0, 0, 0, 2012, 0xe974b3ab +0, 0, 0, 0, 2012, 0x4151c32d +0, 0, 0, 0, 2012, 0x2b05bf7d +0, 0, 0, 0, 2012, 0x4111c0d8 +0, 0, 0, 0, 2012, 0xff9ad574 +0, 0, 0, 0, 2012, 0xa55dced2 +0, 0, 0, 0, 2012, 0x11e6c0cb +0, 0, 0, 0, 2012, 0x2478b998 +0, 0, 0, 0, 2012, 0xdc8abb54 +0, 0, 0, 0, 2012, 0xe16da510 +0, 0, 0, 0, 2012, 0xfc18b3db +0, 0, 0, 0, 2012, 0x1426cd42 +0, 0, 0, 0, 2012, 0xb560a661 +0, 0, 0, 0, 2012, 0xc200aa4b +0, 0, 0, 0, 2012, 0xea00af2a +0, 0, 0, 0, 2012, 0x32bcbf84 +0, 0, 0, 0, 2012, 0x4c29cb2a +0, 0, 0, 0, 2012, 0xe8a2aabc +0, 0, 0, 0, 2012, 0x64bdb6cd +0, 0, 0, 0, 2012, 0x3a80adbc +0, 0, 0, 0, 2012, 0xa012b2c4 +0, 0, 0, 0, 2012, 0xac3ebce7 +0, 0, 0, 0, 2012, 0xfae1b2a7 +0, 0, 0, 0, 2012, 0x37b4ddae +0, 0, 0, 0, 2012, 0x8ff9bd55 +0, 0, 0, 0, 2012, 0x16f6abeb +0, 0, 0, 0, 2012, 0x5820badf +0, 0, 0, 0, 2012, 0x7183b45e +0, 0, 0, 0, 2012, 0xc0a6c826 +0, 0, 0, 0, 2012, 0x4c36bb02 +0, 0, 0, 0, 2012, 0xda46b854 +0, 0, 0, 0, 2012, 0xcc8accb6 +0, 0, 0, 0, 2012, 0xa6b2c3a2 +0, 0, 0, 0, 2012, 0x1c91cc00 +0, 0, 0, 0, 2012, 0xf33cd721 +0, 0, 0, 0, 2012, 0x7f86d2ed +0, 0, 0, 0, 2012, 0x9fdabb1d +0, 0, 0, 0, 2012, 0x33ebbbc4 +0, 0, 0, 0, 2012, 0x2741ba4f +0, 0, 0, 0, 2012, 0x0d0dd107 +0, 0, 0, 0, 2012, 0xf1d5b551 +0, 0, 0, 0, 2012, 0xf47dbebc +0, 0, 0, 0, 2012, 0xa955cea3 +0, 0, 0, 0, 2012, 0x51d6b407 +0, 0, 0, 0, 2012, 0xb7d3c2c0 +0, 0, 0, 0, 2012, 0xce3cc6ae +0, 0, 0, 0, 2012, 0x782cc184 +0, 0, 0, 0, 2012, 0xf4cec2af +0, 0, 0, 0, 2012, 0xa43eb295 +0, 0, 0, 0, 2012, 0xc74aa62d +0, 0, 0, 0, 2012, 0xf9dfc11f +0, 0, 0, 0, 2012, 0x3da1a319 +0, 0, 0, 0, 2012, 0xf613bd75 +0, 0, 0, 0, 2012, 0x10d9cda4 +0, 0, 0, 0, 2012, 0x08c9bcb3 +0, 0, 0, 0, 2012, 0x43b9d170 +0, 0, 0, 0, 2012, 0x1f0db940 +0, 0, 0, 0, 2012, 0x3c4ec614 +0, 0, 0, 0, 2012, 0xa94abaaa +0, 0, 0, 0, 2012, 0x2557a922 +0, 0, 0, 0, 2012, 0x4245c4b4 +0, 0, 0, 0, 2012, 0x0cb1b06f +0, 0, 0, 0, 2012, 0x778bbeab +0, 0, 0, 0, 2012, 0x5ce4ca3b +0, 0, 0, 0, 2012, 0xe70e9fd3 +0, 0, 0, 0, 2012, 0x28afbcbf +0, 0, 0, 0, 2012, 0xc41fb9b2 +0, 0, 0, 0, 2012, 0xd60cbfae +0, 0, 0, 0, 2012, 0x1087cb26 +0, 0, 0, 0, 2012, 0xc9face3b +0, 0, 0, 0, 2012, 0x7403b314 +0, 0, 0, 0, 2012, 0xe034ba97 +0, 0, 0, 0, 2012, 0x15dcbc67 +0, 0, 0, 0, 2012, 0x20d3bcff +0, 0, 0, 0, 2012, 0xc136a2ce +0, 0, 0, 0, 2012, 0x038bb025 +0, 0, 0, 0, 2012, 0xd655cf84 +0, 0, 0, 0, 2012, 0xcf54c656 +0, 0, 0, 0, 2012, 0x3c77bb0d +0, 0, 0, 0, 2012, 0xd765d7a7 +0, 0, 0, 0, 2012, 0x1a60b020 +0, 0, 0, 0, 2012, 0x83c8c2e9 +0, 0, 0, 0, 2012, 0x9b97c6e7 +0, 0, 0, 0, 2012, 0x3870ad63 +0, 0, 0, 0, 2012, 0x0e3ac67d +0, 0, 0, 0, 2012, 0xeb53c935 +0, 0, 0, 0, 2012, 0xeeb0c3e1 +0, 0, 0, 0, 2012, 0x9cb5bdb9 +0, 0, 0, 0, 2012, 0x64b1afec +0, 0, 0, 0, 2012, 0x57dcadbc +0, 0, 0, 0, 2012, 0xed76c5fd +0, 0, 0, 0, 2012, 0x0cb4cac5 +0, 0, 0, 0, 2012, 0xd30bbd06 +0, 0, 0, 0, 2012, 0xaee9c6c3 +0, 0, 0, 0, 2012, 0xe845c9b3 +0, 0, 0, 0, 2012, 0xc09cc7fc +0, 0, 0, 0, 2012, 0xfdebaacb +0, 0, 0, 0, 2012, 0x6f2db89f +0, 0, 0, 0, 2012, 0x7d89bee7 +0, 0, 0, 0, 2012, 0x8699b8be +0, 0, 0, 0, 2012, 0x57d6cc8a +0, 0, 0, 0, 2012, 0xcdbcd246 +0, 0, 0, 0, 2012, 0x9057b285 +0, 0, 0, 0, 2012, 0x2ac9cc87 +0, 0, 0, 0, 2012, 0xeb20c421 +0, 0, 0, 0, 2012, 0x4789d11f +0, 0, 0, 0, 2012, 0x55e7c9fe +0, 0, 0, 0, 2012, 0xd81cb4c6 +0, 0, 0, 0, 2012, 0x2af0a88e +0, 0, 0, 0, 2012, 0x7d96a4ee +0, 0, 0, 0, 2012, 0xff7cc3ea +0, 0, 0, 0, 2012, 0x2514d2a8 +0, 0, 0, 0, 2012, 0x7d2cccc3 +0, 0, 0, 0, 2012, 0x98dccbbf +0, 0, 0, 0, 2012, 0x55f2bd3e +0, 0, 0, 0, 2012, 0x0e58bbd7 +0, 0, 0, 0, 2012, 0x1520c45d +0, 0, 0, 0, 2012, 0x3c60cede +0, 0, 0, 0, 2012, 0xbfb2be6b +0, 0, 0, 0, 2012, 0xa839c2d5 +0, 0, 0, 0, 2012, 0x7713bdba +0, 0, 0, 0, 2012, 0xf16c9e95 +0, 0, 0, 0, 2012, 0x8e94caf1 +0, 0, 0, 0, 2012, 0x3915c673 +0, 0, 0, 0, 2012, 0x69afc76f +0, 0, 0, 0, 2012, 0x3ebec514 +0, 0, 0, 0, 2012, 0x70c5dd9b +0, 0, 0, 0, 2012, 0x6868b7d9 +0, 0, 0, 0, 2012, 0x9a31c801 +0, 0, 0, 0, 2012, 0x93c4b6ac +0, 0, 0, 0, 2012, 0xb1aaca39 +0, 0, 0, 0, 2012, 0x8f67b9ed +0, 0, 0, 0, 2012, 0x09adcf1f +0, 0, 0, 0, 2012, 0xe172cb3c +0, 0, 0, 0, 2012, 0x044bbdc5 +0, 0, 0, 0, 2012, 0x391cb3d9 +0, 0, 0, 0, 2012, 0x3bd1bc29 +0, 0, 0, 0, 2012, 0x8a78c5d2 +0, 0, 0, 0, 2012, 0xa46fce11 +0, 0, 0, 0, 2012, 0x4c13d9bc +0, 0, 0, 0, 2012, 0x7f47ce4f +0, 0, 0, 0, 2012, 0xa03ebcae +0, 0, 0, 0, 2012, 0xf6f2b2c8 +0, 0, 0, 0, 2012, 0x7995be2a +0, 0, 0, 0, 2012, 0x22d7b94a +0, 0, 0, 0, 2012, 0x07bcc06a +0, 0, 0, 0, 2012, 0x04adcb6d +0, 0, 0, 0, 2012, 0x4aecc135 +0, 0, 0, 0, 2012, 0x8442dc6a +0, 0, 0, 0, 2012, 0x9e67b826 +0, 0, 0, 0, 2012, 0xb1c4b235 +0, 0, 0, 0, 2012, 0x565ecaae +0, 0, 0, 0, 2012, 0x34a2c877 +0, 0, 0, 0, 2012, 0x815eb148 +0, 0, 0, 0, 2012, 0x354eb4ce +0, 0, 0, 0, 2012, 0xf74db8b1 +0, 0, 0, 0, 2012, 0x56f3b430 +0, 0, 0, 0, 2012, 0x39f9c72f +0, 0, 0, 0, 2012, 0x83d1bfde +0, 0, 0, 0, 2012, 0x2da1bf57 +0, 0, 0, 0, 2012, 0xd97fc933 +0, 0, 0, 0, 2012, 0x4b3edbfe +0, 0, 0, 0, 2012, 0xb975d346 +0, 0, 0, 0, 2012, 0x856ac304 +0, 0, 0, 0, 2012, 0xb38dba2e +0, 0, 0, 0, 2012, 0xbe14c822 +0, 0, 0, 0, 2012, 0xb848c927 +0, 0, 0, 0, 2012, 0x0a89c0e6 +0, 0, 0, 0, 2012, 0x44a3c3d5 +0, 0, 0, 0, 2012, 0x7af1c30c +0, 0, 0, 0, 2012, 0xe928b619 +0, 0, 0, 0, 2012, 0xc9aeb012 +0, 0, 0, 0, 2012, 0xae02cfde +0, 0, 0, 0, 2012, 0x0b42c3d9 +0, 0, 0, 0, 2012, 0xa5b7c1ed +0, 0, 0, 0, 2012, 0xd2dcbcdc +0, 0, 0, 0, 2012, 0x18cfbf55 +0, 0, 0, 0, 2012, 0x34f0c800 +0, 0, 0, 0, 2012, 0x2a80bdba +0, 0, 0, 0, 2012, 0x5ef2b3a7 +0, 0, 0, 0, 2012, 0x35a6ba33 +0, 0, 0, 0, 2012, 0x1088bbf5 +0, 0, 0, 0, 2012, 0xaec0bedf +0, 0, 0, 0, 2012, 0x769fb535 +0, 0, 0, 0, 2012, 0xfe11b979 +0, 0, 0, 0, 2012, 0xe856b37e +0, 0, 0, 0, 2012, 0x36c3cffd +0, 0, 0, 0, 2012, 0x4771db58 +0, 0, 0, 0, 2012, 0x5467d13e +0, 0, 0, 0, 2012, 0xb405c1b5 +0, 0, 0, 0, 2012, 0x3cbdc145 +0, 0, 0, 0, 2012, 0xbb9ccdd7 +0, 0, 0, 0, 2012, 0xac25ce9e +0, 0, 0, 0, 2012, 0x6d2ac82a +0, 0, 0, 0, 2012, 0x1661ba50 +0, 0, 0, 0, 2012, 0xbc7ac82a +0, 0, 0, 0, 2012, 0x020bb4de +0, 0, 0, 0, 2012, 0x4e10cb93 +0, 0, 0, 0, 2012, 0x3dabc15f +0, 0, 0, 0, 2012, 0x12acc64b +0, 0, 0, 0, 2012, 0x9cecb51a +0, 0, 0, 0, 2012, 0x959acb39 +0, 0, 0, 0, 2012, 0x3ee7c0e8 +0, 0, 0, 0, 2012, 0xde18c1df +0, 0, 0, 0, 2012, 0x3c72c3cd +0, 0, 0, 0, 2012, 0x1ac4bb5d +0, 0, 0, 0, 2012, 0xb155c741 +0, 0, 0, 0, 2012, 0x5069c8aa +0, 0, 0, 0, 2012, 0x610db0bc +0, 0, 0, 0, 2012, 0xb82bc329 +0, 0, 0, 0, 2012, 0x8bd4c522 +0, 0, 0, 0, 2012, 0xd44bb865 +0, 0, 0, 0, 2012, 0xb51ac7dc +0, 0, 0, 0, 2012, 0xfe2bc799 +0, 0, 0, 0, 2012, 0x8cd1bb53 +0, 0, 0, 0, 2012, 0xba13ca97 +0, 0, 0, 0, 2012, 0xf107bd51 +0, 0, 0, 0, 2012, 0xa04ece95 +0, 0, 0, 0, 2012, 0x4f4faa54 +0, 0, 0, 0, 2012, 0x5a74bfe1 +0, 0, 0, 0, 2012, 0xdafade5b +0, 0, 0, 0, 2012, 0x738fba51 +0, 0, 0, 0, 2012, 0xe7b2b78e +0, 0, 0, 0, 2012, 0x7685b6ce +0, 0, 0, 0, 2012, 0xae45bd8a +0, 0, 0, 0, 2012, 0xd52cc84e +0, 0, 0, 0, 2012, 0x04abd773 +0, 0, 0, 0, 2012, 0x2badb0ff +0, 0, 0, 0, 2012, 0x0eaec6b2 +0, 0, 0, 0, 2012, 0x7c1ec33f +0, 0, 0, 0, 2012, 0x8773b925 +0, 0, 0, 0, 2012, 0x40bbc36d +0, 0, 0, 0, 2012, 0x330bc288 +0, 0, 0, 0, 2012, 0x1659b6f5 +0, 0, 0, 0, 2012, 0x66eac162 +0, 0, 0, 0, 2012, 0xf3acdb3d +0, 0, 0, 0, 2012, 0x465abb87 +0, 0, 0, 0, 2012, 0xe8e9bc16 +0, 0, 0, 0, 2012, 0x71eebbd9 +0, 0, 0, 0, 2012, 0x1f59cb2a +0, 0, 0, 0, 2012, 0x53e3c9e7 +0, 0, 0, 0, 2012, 0xf410b939 +0, 0, 0, 0, 2012, 0xdb13d1b3 +0, 0, 0, 0, 2012, 0xcd26bf27 +0, 0, 0, 0, 2012, 0x707ecc9c +0, 0, 0, 0, 2012, 0x3483b6bf +0, 0, 0, 0, 2012, 0x4184d451 +0, 0, 0, 0, 2012, 0xcf6abfae +0, 0, 0, 0, 2012, 0x5c9eb4ca +0, 0, 0, 0, 2012, 0xf396be01 +0, 0, 0, 0, 2012, 0x06bfda38 +0, 0, 0, 0, 2012, 0x0e92bcf4 +0, 0, 0, 0, 2012, 0xaaa2b99d +0, 0, 0, 0, 2012, 0xf112a9a9 +0, 0, 0, 0, 2012, 0x2844bdf1 +0, 0, 0, 0, 2012, 0xb96baf39 +0, 0, 0, 0, 2012, 0xd4f2d157 +0, 0, 0, 0, 2012, 0x7c74b149 +0, 0, 0, 0, 2012, 0xbd43d5f2 +0, 0, 0, 0, 2012, 0xaa10b2ba +0, 0, 0, 0, 2012, 0x66e9b95f +0, 0, 0, 0, 2012, 0x6f01abef +0, 0, 0, 0, 2012, 0x1cb5c664 +0, 0, 0, 0, 2012, 0x5ee2afc5 +0, 0, 0, 0, 2012, 0xeb39d213 +0, 0, 0, 0, 2012, 0x1ffeaafc +0, 0, 0, 0, 2012, 0x6bb4d548 +0, 0, 0, 0, 2012, 0xa045b23a +0, 0, 0, 0, 2012, 0x17c3aa49 +0, 0, 0, 0, 2012, 0x2d47db7c +0, 0, 0, 0, 2012, 0x07ddc9ac +0, 0, 0, 0, 2012, 0xa386c99e +0, 0, 0, 0, 2012, 0x0e0bae8a +0, 0, 0, 0, 2012, 0x7d6fc419 +0, 0, 0, 0, 2012, 0x34a3c5a2 +0, 0, 0, 0, 2012, 0xda81c8e9 +0, 0, 0, 0, 2012, 0xde53bcd8 +0, 0, 0, 0, 2012, 0x372ac065 +0, 0, 0, 0, 2012, 0x6d07a95c +0, 0, 0, 0, 2012, 0x296eb47f +0, 0, 0, 0, 2012, 0x0f47be2a +0, 0, 0, 0, 2012, 0x389ebaf6 +0, 0, 0, 0, 2012, 0x9746ba3b +0, 0, 0, 0, 2012, 0x070e9aed +0, 0, 0, 0, 2012, 0xa4abc798 +0, 0, 0, 0, 2012, 0xe55cac7b +0, 0, 0, 0, 2012, 0x0c71ba45 +0, 0, 0, 0, 2012, 0x70fbb3c5 +0, 0, 0, 0, 2012, 0xa35ec30a +0, 0, 0, 0, 2012, 0xf30ab935 +0, 0, 0, 0, 2012, 0x2cbb9b99 +0, 0, 0, 0, 2012, 0x6606c1bf +0, 0, 0, 0, 2012, 0x41ccad5c +0, 0, 0, 0, 2012, 0x352fc002 +0, 0, 0, 0, 2012, 0x1763bd10 +0, 0, 0, 0, 2012, 0xb54bcae6 +0, 0, 0, 0, 2012, 0x7374ab92 +0, 0, 0, 0, 2012, 0x2895a99a +0, 0, 0, 0, 2012, 0x9f68b02f +0, 0, 0, 0, 2012, 0xdfabbb76 +0, 0, 0, 0, 2012, 0x764ea6c5 +0, 0, 0, 0, 2012, 0x4e83c5a5 +0, 0, 0, 0, 2012, 0xf0e8c76a +0, 0, 0, 0, 2012, 0xdc80b4ea +0, 0, 0, 0, 2012, 0xcc53b0a5 +0, 0, 0, 0, 2012, 0x7893bc7f +0, 0, 0, 0, 2012, 0x6965b355 +0, 0, 0, 0, 2012, 0x7f8fac00 +0, 0, 0, 0, 2012, 0x6c71c7b8 +0, 0, 0, 0, 2012, 0xa00ec367 +0, 0, 0, 0, 2012, 0x5f0fc50e +0, 0, 0, 0, 2012, 0x1bd2ad87 +0, 0, 0, 0, 2012, 0xd054ba2d +0, 0, 0, 0, 2012, 0xaf80a0d5 +0, 0, 0, 0, 2012, 0x2acac873 +0, 0, 0, 0, 2012, 0x260ca584 +0, 0, 0, 0, 2012, 0x4f98aa7c +0, 0, 0, 0, 2012, 0x0254aa36 +0, 0, 0, 0, 2012, 0xe3c7c33a +0, 0, 0, 0, 2012, 0x3b9ea70f +0, 0, 0, 0, 2012, 0xe829b7e6 +0, 0, 0, 0, 2012, 0x9317a8d1 +0, 0, 0, 0, 2012, 0x88b3a98f +0, 0, 0, 0, 2012, 0xa4a8c3bc +0, 0, 0, 0, 2012, 0x95c9a869 +0, 0, 0, 0, 2012, 0x7f889fed +0, 0, 0, 0, 2012, 0x5438c408 +0, 0, 0, 0, 2012, 0x3455a366 +0, 0, 0, 0, 2012, 0x5319b33d +0, 0, 0, 0, 2012, 0xb19dc4f0 +0, 0, 0, 0, 2012, 0xf080b109 +0, 0, 0, 0, 2012, 0xef83d8e7 +0, 0, 0, 0, 2012, 0x237ac69c +0, 0, 0, 0, 2012, 0xbb30b714 +0, 0, 0, 0, 2012, 0x8745ba54 +0, 0, 0, 0, 2012, 0x8588bd6c +0, 0, 0, 0, 2012, 0xc580bdde +0, 0, 0, 0, 2012, 0xb062baf1 +0, 0, 0, 0, 2012, 0xe014b082 +0, 0, 0, 0, 2012, 0x148bcb87 +0, 0, 0, 0, 2012, 0x554bc13d +0, 0, 0, 0, 2012, 0xc410c270 +0, 0, 0, 0, 2012, 0xb2c8b65b +0, 0, 0, 0, 2012, 0xa412b3f4 +0, 0, 0, 0, 2012, 0xbb52aa9a +0, 0, 0, 0, 2012, 0x4005b527 +0, 0, 0, 0, 2012, 0x8c5eb055 +0, 0, 0, 0, 2012, 0x8622c142 +0, 0, 0, 0, 2012, 0x05a3b861 +0, 0, 0, 0, 2012, 0x9f6dbb4d +0, 0, 0, 0, 2012, 0x033fb867 +0, 0, 0, 0, 2012, 0x243babd5 +0, 0, 0, 0, 2012, 0x8d6db83c +0, 0, 0, 0, 2012, 0x3923b829 +0, 0, 0, 0, 2012, 0x69b6b587 +0, 0, 0, 0, 2012, 0xdda8d018 +0, 0, 0, 0, 2012, 0x54b1b2a4 +0, 0, 0, 0, 2012, 0x380eb1af +0, 0, 0, 0, 2012, 0xec3cbdb4 +0, 0, 0, 0, 2012, 0x7ce9b4cf +0, 0, 0, 0, 2012, 0xcf6cb99b +0, 0, 0, 0, 2012, 0x7383ab97 +0, 0, 0, 0, 2012, 0xaa4cc068 +0, 0, 0, 0, 2012, 0x96d4c3db +0, 0, 0, 0, 2012, 0xab8cb84f +0, 0, 0, 0, 2012, 0x73dcacf9 +0, 0, 0, 0, 2012, 0xf61ca122 +0, 0, 0, 0, 2012, 0x9f1cbd5b +0, 0, 0, 0, 2012, 0x1f84aa3f +0, 0, 0, 0, 2012, 0xa003ad43 +0, 0, 0, 0, 2012, 0x6cffa4ef +0, 0, 0, 0, 2012, 0x29559e1e +0, 0, 0, 0, 2012, 0x7a79b059 +0, 0, 0, 0, 2012, 0xa1929c42 +0, 0, 0, 0, 2012, 0x52dead1c +0, 0, 0, 0, 2012, 0x8f31b9f5 +0, 0, 0, 0, 2012, 0xb8a899ec +0, 0, 0, 0, 2012, 0x7ca4b02d +0, 0, 0, 0, 2012, 0x2c92ae1b +0, 0, 0, 0, 2012, 0xe683a92f +0, 0, 0, 0, 2012, 0xe9d5abcf +0, 0, 0, 0, 2012, 0x757db377 +0, 0, 0, 0, 2012, 0xd4a8bbae +0, 0, 0, 0, 2012, 0xeea5c4ee +0, 0, 0, 0, 2012, 0xc37ca9a9 +0, 0, 0, 0, 2012, 0x8871bb51 +0, 0, 0, 0, 2012, 0x5dd8b3a2 +0, 0, 0, 0, 2012, 0xef0fae7f +0, 0, 0, 0, 2012, 0xe7ecb23e +0, 0, 0, 0, 2012, 0xc4f6d437 +0, 0, 0, 0, 2012, 0x0c74b81d +0, 0, 0, 0, 2012, 0xee68b1ee +0, 0, 0, 0, 2012, 0x46b4b4a8 +0, 0, 0, 0, 2012, 0x0526abca +0, 0, 0, 0, 2012, 0x7695ba55 +0, 0, 0, 0, 2012, 0xc7f5ad90 +0, 0, 0, 0, 2012, 0x0522b9bc +0, 0, 0, 0, 2012, 0x0eefc6ad +0, 0, 0, 0, 2012, 0x340dae16 +0, 0, 0, 0, 2012, 0xea42bdc0 +0, 0, 0, 0, 2012, 0xe047abb6 +0, 0, 0, 0, 2012, 0x6da5c14f +0, 0, 0, 0, 2012, 0x46d8c11d +0, 0, 0, 0, 2012, 0x8f4d9f2f +0, 0, 0, 0, 2012, 0x6d00d26c +0, 0, 0, 0, 2012, 0x87fc9d1b +0, 0, 0, 0, 2012, 0xbba5b763 +0, 0, 0, 0, 2012, 0xab58b853 +0, 0, 0, 0, 2012, 0x8180b863 +0, 0, 0, 0, 2012, 0x3684b3ba +0, 0, 0, 0, 2012, 0xf1a4a806 +0, 0, 0, 0, 2012, 0x2826b48c +0, 0, 0, 0, 2012, 0x1883af7f +0, 0, 0, 0, 2012, 0x44c5c37a +0, 0, 0, 0, 2012, 0xec33c3f1 +0, 0, 0, 0, 2012, 0xd67fb767 +0, 0, 0, 0, 2012, 0x03c2c219 +0, 0, 0, 0, 2012, 0x75a9b389 +0, 0, 0, 0, 2012, 0xe041ad88 +0, 0, 0, 0, 2012, 0x6bccb005 +0, 0, 0, 0, 2012, 0xd881c24a +0, 0, 0, 0, 2012, 0x7dd0c302 +0, 0, 0, 0, 2012, 0x2ba8a649 +0, 0, 0, 0, 2012, 0x63e19eab +0, 0, 0, 0, 2012, 0x1c0dafce +0, 0, 0, 0, 2012, 0xf266bf47 +0, 0, 0, 0, 2012, 0x11beb4b1 +0, 0, 0, 0, 2012, 0xc6f6b2b5 +0, 0, 0, 0, 2012, 0x15d4b4d0 +0, 0, 0, 0, 2012, 0x08bfa1e7 +0, 0, 0, 0, 2012, 0x18dbb7b5 +0, 0, 0, 0, 2012, 0xc279cc67 +0, 0, 0, 0, 2012, 0xd236bf28 +0, 0, 0, 0, 2012, 0xc9d1b196 +0, 0, 0, 0, 2012, 0xb605983e +0, 0, 0, 0, 2012, 0x8132c566 +0, 0, 0, 0, 2012, 0x6be4cd39 +0, 0, 0, 0, 2012, 0xce53c1f9 +0, 0, 0, 0, 2012, 0xe1efac0f +0, 0, 0, 0, 2012, 0x3d60a57a +0, 0, 0, 0, 2012, 0x1beda4b7 +0, 0, 0, 0, 2012, 0x34a4ac81 +0, 0, 0, 0, 2012, 0x30b0be4b +0, 0, 0, 0, 2012, 0xc7ceaf45 +0, 0, 0, 0, 2012, 0xade0b6ec +0, 0, 0, 0, 2012, 0xe00daf06 +0, 0, 0, 0, 2012, 0x04f79fe4 +0, 0, 0, 0, 2012, 0x8c59b7d9 +0, 0, 0, 0, 2012, 0x6f66b92a +0, 0, 0, 0, 2012, 0x9b08b2c0 +0, 0, 0, 0, 2012, 0xa8c1b5c1 +0, 0, 0, 0, 2012, 0xe3aac0b0 +0, 0, 0, 0, 2012, 0x1622bdaf +0, 0, 0, 0, 2012, 0x25e1a9ff +0, 0, 0, 0, 2012, 0x5577ad82 +0, 0, 0, 0, 2012, 0xfe16a49b +0, 0, 0, 0, 2012, 0xef7fc32a +0, 0, 0, 0, 2012, 0xfe30c35d +0, 0, 0, 0, 2012, 0x3adc9610 +0, 0, 0, 0, 2012, 0x36eeabdc +0, 0, 0, 0, 2012, 0xde3fb56c +0, 0, 0, 0, 2012, 0x5629bd82 +0, 0, 0, 0, 2012, 0xb099a61d +0, 0, 0, 0, 2012, 0x3013b106 +0, 0, 0, 0, 2012, 0xc359aef3 +0, 0, 0, 0, 2012, 0xec01b3e1 +0, 0, 0, 0, 2012, 0x6e8ac0b1 +0, 0, 0, 0, 2012, 0x41e8b82d +0, 0, 0, 0, 2012, 0x3a2fb38b +0, 0, 0, 0, 2012, 0x7025aac9 +0, 0, 0, 0, 2012, 0xbb0eb094 +0, 0, 0, 0, 2012, 0xdc06c156 +0, 0, 0, 0, 2012, 0x4007cea4 +0, 0, 0, 0, 2012, 0x102ebe03 +0, 0, 0, 0, 2012, 0x6e8faae7 +0, 0, 0, 0, 2012, 0xa357aa0c +0, 0, 0, 0, 2012, 0x07d2bf4d +0, 0, 0, 0, 2012, 0xfb71b338 +0, 0, 0, 0, 2012, 0xd5f1be84 +0, 0, 0, 0, 2012, 0x2a7cb554 +0, 0, 0, 0, 2012, 0xfb03b8c3 +0, 0, 0, 0, 2012, 0x2ff1ca87 +0, 0, 0, 0, 2012, 0xeef2b7f3 +0, 0, 0, 0, 2012, 0x9377b15f +0, 0, 0, 0, 2012, 0x370cb0c2 +0, 0, 0, 0, 2012, 0x5f78b118 +0, 0, 0, 0, 2012, 0x19afa87a +0, 0, 0, 0, 2012, 0xc717ab0d +0, 0, 0, 0, 2012, 0x3ca499f4 +0, 0, 0, 0, 2012, 0x9612b8e4 +0, 0, 0, 0, 2012, 0x32c0bb29 +0, 0, 0, 0, 2012, 0x7727beba +0, 0, 0, 0, 2012, 0x8b60a4cb +0, 0, 0, 0, 2012, 0xe899a9c8 +0, 0, 0, 0, 2012, 0x60f4b7fe +0, 0, 0, 0, 2012, 0x544f9ecb +0, 0, 0, 0, 2012, 0x34afcd71 +0, 0, 0, 0, 2012, 0x470eab55 +0, 0, 0, 0, 2012, 0xe4959f93 +0, 0, 0, 0, 2012, 0x69eeaf97 +0, 0, 0, 0, 2012, 0x0ec9aca3 +0, 0, 0, 0, 2012, 0x51e4b7f6 +0, 0, 0, 0, 2012, 0xf6c0a837 +0, 0, 0, 0, 2012, 0x3bdca59b +0, 0, 0, 0, 2012, 0x14c59dfc +0, 0, 0, 0, 2012, 0xa50ab23a +0, 0, 0, 0, 2012, 0x8832b6e2 +0, 0, 0, 0, 2012, 0x3d699d1b +0, 0, 0, 0, 2012, 0x751aa4b8 +0, 0, 0, 0, 2012, 0x59a9b98c +0, 0, 0, 0, 2012, 0xb67c98cb +0, 0, 0, 0, 2012, 0x0fd39ccd +0, 0, 0, 0, 2012, 0x9980d1e1 +0, 0, 0, 0, 2012, 0xffd9a716 +0, 0, 0, 0, 2012, 0x7d2fbed1 +0, 0, 0, 0, 2012, 0x76e6b042 +0, 0, 0, 0, 2012, 0xe027a232 +0, 0, 0, 0, 2012, 0x7c6ca5ce +0, 0, 0, 0, 2012, 0x5cf6bda4 +0, 0, 0, 0, 2012, 0x6075bd0d +0, 0, 0, 0, 2012, 0xedc4abe9 +0, 0, 0, 0, 2012, 0xb8f7cc26 +0, 0, 0, 0, 2012, 0x2cbbb500 +0, 0, 0, 0, 2012, 0x1c34b04d +0, 0, 0, 0, 2012, 0x5f18bea2 +0, 0, 0, 0, 2012, 0x94d0bb2b +0, 0, 0, 0, 2012, 0x6899b78e +0, 0, 0, 0, 2012, 0xc9aaa7a2 +0, 0, 0, 0, 2012, 0x298cbafa +0, 0, 0, 0, 2012, 0x89d9ac80 +0, 0, 0, 0, 2012, 0xc6ffa7e6 +0, 0, 0, 0, 2012, 0xdcf7caf9 +0, 0, 0, 0, 2012, 0x26cfb4ee +0, 0, 0, 0, 2012, 0xec70b09d +0, 0, 0, 0, 2012, 0x65dca50f +0, 0, 0, 0, 2012, 0xcdebc0b6 +0, 0, 0, 0, 2012, 0x9393a262 +0, 0, 0, 0, 2012, 0x34aab06d +0, 0, 0, 0, 2012, 0x4800a550 +0, 0, 0, 0, 2012, 0x4d9aadec +0, 0, 0, 0, 2012, 0x2cddabb6 +0, 0, 0, 0, 2012, 0x91a0c5b2 +0, 0, 0, 0, 2012, 0xd326bee1 +0, 0, 0, 0, 2012, 0xf76ab2d5 +0, 0, 0, 0, 2012, 0xcef99ade +0, 0, 0, 0, 2012, 0x950dc76f +0, 0, 0, 0, 2012, 0xb6aca7ad +0, 0, 0, 0, 2012, 0x1aacb71c +0, 0, 0, 0, 2012, 0x32389da0 +0, 0, 0, 0, 2012, 0x030cbcce +0, 0, 0, 0, 2012, 0x0ec4b0cb +0, 0, 0, 0, 2012, 0x6c0bb62e +0, 0, 0, 0, 2012, 0xfadbb20d +0, 0, 0, 0, 2012, 0x99c9c848 +0, 0, 0, 0, 2012, 0xe3e3b21a +0, 0, 0, 0, 2012, 0x88d9a50b +0, 0, 0, 0, 2012, 0xf4bbaf17 +0, 0, 0, 0, 2012, 0x49fea706 +0, 0, 0, 0, 2012, 0xafd0babf +0, 0, 0, 0, 2012, 0x8970a8f3 +0, 0, 0, 0, 2012, 0x9223a553 +0, 0, 0, 0, 2012, 0x6ec2b2f9 +0, 0, 0, 0, 2012, 0x7960b759 +0, 0, 0, 0, 2012, 0x852891bf +0, 0, 0, 0, 2012, 0x094ebbeb +0, 0, 0, 0, 2012, 0xf9bab418 +0, 0, 0, 0, 2012, 0x010eae8c +0, 0, 0, 0, 2012, 0x10baab3d +0, 0, 0, 0, 2012, 0x2564b13f +0, 0, 0, 0, 2012, 0xaec8ac22 +0, 0, 0, 0, 2012, 0xda0cbd4f +0, 0, 0, 0, 2012, 0x97e1c075 +0, 0, 0, 0, 2012, 0x6731aca5 +0, 0, 0, 0, 2012, 0x2c1db696 +0, 0, 0, 0, 2012, 0x8ff7abbf +0, 0, 0, 0, 2012, 0xf75ab3a2 +0, 0, 0, 0, 2012, 0x8683b824 +0, 0, 0, 0, 2012, 0x9668b354 +0, 0, 0, 0, 2012, 0x6e9aae04 +0, 0, 0, 0, 2012, 0xd8e9acd7 +0, 0, 0, 0, 2012, 0xa326c298 +0, 0, 0, 0, 2012, 0x6abcb409 +0, 0, 0, 0, 2012, 0x7eb3b549 +0, 0, 0, 0, 2012, 0xfc72ba6a +0, 0, 0, 0, 2012, 0xed73b2e6 +0, 0, 0, 0, 2012, 0x07a6b0a9 +0, 0, 0, 0, 2012, 0x10a4aec4 +0, 0, 0, 0, 2012, 0xaac9a650 +0, 0, 0, 0, 2012, 0x848b9869 +0, 0, 0, 0, 2012, 0x1ddaafd6 +0, 0, 0, 0, 2012, 0xe291aaec +0, 0, 0, 0, 2012, 0x8aa1aa4d +0, 0, 0, 0, 2012, 0x9b69b94c +0, 0, 0, 0, 2012, 0xe784bec0 +0, 0, 0, 0, 2012, 0x9305ba2d +0, 0, 0, 0, 2012, 0x5616bb81 +0, 0, 0, 0, 2012, 0xea0facca +0, 0, 0, 0, 2012, 0xe1b9991e +0, 0, 0, 0, 2012, 0xded8bd59 +0, 0, 0, 0, 2012, 0xe79fb0ee +0, 0, 0, 0, 2012, 0x1b8595a6 +0, 0, 0, 0, 2012, 0xb55ba336 +0, 0, 0, 0, 2012, 0xc552bc98 +0, 0, 0, 0, 2012, 0x2fe2c5ba +0, 0, 0, 0, 2012, 0xe18aa5a6 +0, 0, 0, 0, 2012, 0xaa9bae1c +0, 0, 0, 0, 2012, 0xd1ddb68d +0, 0, 0, 0, 2012, 0x95bfb203 +0, 0, 0, 0, 2012, 0xeacab8b9 +0, 0, 0, 0, 2012, 0x5bfcb117 +0, 0, 0, 0, 2012, 0x1a9fa91c +0, 0, 0, 0, 2012, 0xa285b180 +0, 0, 0, 0, 2012, 0xfd58a6e2 +0, 0, 0, 0, 2012, 0x394fc325 +0, 0, 0, 0, 2012, 0x0415a6aa +0, 0, 0, 0, 2012, 0xf75fa5e0 +0, 0, 0, 0, 2012, 0x115cd11b +0, 0, 0, 0, 2012, 0x6587b9e3 +0, 0, 0, 0, 2012, 0xce6bb7e6 +0, 0, 0, 0, 2012, 0xbaa2b409 +0, 0, 0, 0, 2012, 0x271bbb14 +0, 0, 0, 0, 2012, 0x4516c223 +0, 0, 0, 0, 2012, 0x4f6ab266 +0, 0, 0, 0, 2012, 0x244ba6fc +0, 0, 0, 0, 2012, 0x60e0ae4e +0, 0, 0, 0, 2012, 0xfc3cac80 +0, 0, 0, 0, 2012, 0x8465b287 +0, 0, 0, 0, 2012, 0xc683b070 +0, 0, 0, 0, 2012, 0x2901c8e7 +0, 0, 0, 0, 2012, 0x0622b1a1 +0, 0, 0, 0, 2012, 0xe002b34c +0, 0, 0, 0, 2012, 0xf4969e79 +0, 0, 0, 0, 2012, 0x871cc453 +0, 0, 0, 0, 2012, 0x9a7daaf3 +0, 0, 0, 0, 2012, 0xba92a60a +0, 0, 0, 0, 2012, 0xf464a0c4 +0, 0, 0, 0, 2012, 0x53bbb6cd +0, 0, 0, 0, 2012, 0xb58a9d2a +0, 0, 0, 0, 2012, 0x1e1fb830 +0, 0, 0, 0, 2012, 0xdc7eb93e +0, 0, 0, 0, 2012, 0xe6ceaaf9 +0, 0, 0, 0, 2012, 0x8c7ea35d +0, 0, 0, 0, 2012, 0x0b87ba04 +0, 0, 0, 0, 2012, 0xf516a700 +0, 0, 0, 0, 2012, 0xfaf19e13 +0, 0, 0, 0, 2012, 0x53cf9ed0 +0, 0, 0, 0, 2012, 0x2e25c2f9 +0, 0, 0, 0, 2012, 0x959aa1b8 +0, 0, 0, 0, 2012, 0x2a49a572 +0, 0, 0, 0, 2012, 0xf7a9b809 +0, 0, 0, 0, 2012, 0x44a9b879 +0, 0, 0, 0, 2012, 0xe428c0d4 +0, 0, 0, 0, 2012, 0xc258c2c6 +0, 0, 0, 0, 2012, 0xf7f3b794 +0, 0, 0, 0, 2012, 0xa8adbad9 +0, 0, 0, 0, 2012, 0xc2508e79 +0, 0, 0, 0, 2012, 0x1418ac76 +0, 0, 0, 0, 2012, 0xb28aadef +0, 0, 0, 0, 2012, 0xda17bd03 +0, 0, 0, 0, 2012, 0xa92ab852 +0, 0, 0, 0, 2012, 0xc3cbcfa4 +0, 0, 0, 0, 2012, 0xf716bb5e +0, 0, 0, 0, 2012, 0x6009a8af +0, 0, 0, 0, 2012, 0x9e69bc81 +0, 0, 0, 0, 2012, 0x3aafc8cf +0, 0, 0, 0, 2012, 0x03bccdab +0, 0, 0, 0, 2012, 0xfdceb2d9 +0, 0, 0, 0, 2012, 0x68f7afb8 +0, 0, 0, 0, 2012, 0xb7bab330 +0, 0, 0, 0, 2012, 0x4976b125 +0, 0, 0, 0, 2012, 0x7c86ae12 +0, 0, 0, 0, 2012, 0x4ce4ca54 +0, 0, 0, 0, 2012, 0xf1f7b892 +0, 0, 0, 0, 2012, 0xf958abb1 +0, 0, 0, 0, 2012, 0x047accd0 +0, 0, 0, 0, 2012, 0x34a1c49c +0, 0, 0, 0, 2012, 0x4b24a4ed +0, 0, 0, 0, 2012, 0xea31b1bc +0, 0, 0, 0, 2012, 0x8beaa3e3 +0, 0, 0, 0, 2012, 0x064caaf9 +0, 0, 0, 0, 2012, 0x56babf15 +0, 0, 0, 0, 2012, 0xd16fc6f4 +0, 0, 0, 0, 2012, 0x4ac2b78a +0, 0, 0, 0, 2012, 0xba3aa509 +0, 0, 0, 0, 2012, 0xc103b074 +0, 0, 0, 0, 2012, 0x464aba98 +0, 0, 0, 0, 2012, 0xaacac5a3 +0, 0, 0, 0, 2012, 0x9cecbcfa +0, 0, 0, 0, 2012, 0x8da0ab79 +0, 0, 0, 0, 2012, 0x85b2b023 +0, 0, 0, 0, 2012, 0x598abc91 +0, 0, 0, 0, 2012, 0x08c0a35c +0, 0, 0, 0, 2012, 0x30e4a7cf +0, 0, 0, 0, 2012, 0xf1e4a931 +0, 0, 0, 0, 2012, 0x8a4fb6c1 +0, 0, 0, 0, 2012, 0x126aac08 +0, 0, 0, 0, 2012, 0x537fa51b +0, 0, 0, 0, 2012, 0x1e54ac5a +0, 0, 0, 0, 2012, 0x7274bbd0 +0, 0, 0, 0, 2012, 0xd16bc2c2 +0, 0, 0, 0, 2012, 0x9236c1e3 +0, 0, 0, 0, 2012, 0x348aa7af +0, 0, 0, 0, 2012, 0xa020be5e +0, 0, 0, 0, 2012, 0x3cc5a4b8 +0, 0, 0, 0, 2012, 0x8b19b649 +0, 0, 0, 0, 2012, 0x554aa5ab +0, 0, 0, 0, 2012, 0x35d6ac35 +0, 0, 0, 0, 2012, 0x64dba435 +0, 0, 0, 0, 2012, 0x6001bae2 +0, 0, 0, 0, 2012, 0x9220b599 +0, 0, 0, 0, 2012, 0xa3fdb899 +0, 0, 0, 0, 2012, 0x19a5abf4 +0, 0, 0, 0, 2012, 0xd857b8cf +0, 0, 0, 0, 2012, 0x38d1b234 +0, 0, 0, 0, 2012, 0x69f4bfb8 +0, 0, 0, 0, 2012, 0xcc87a375 +0, 0, 0, 0, 2012, 0xc1cdd0c5 +0, 0, 0, 0, 2012, 0xba0ca3ee +0, 0, 0, 0, 2012, 0x4d20c397 +0, 0, 0, 0, 2012, 0x825c9636 +0, 0, 0, 0, 2012, 0x7aa4ae53 +0, 0, 0, 0, 2012, 0xe970ae78 +0, 0, 0, 0, 2012, 0x5fb2ba59 +0, 0, 0, 0, 2012, 0xcd90a953 +0, 0, 0, 0, 2012, 0xf573ac40 +0, 0, 0, 0, 2012, 0x324cbd77 +0, 0, 0, 0, 2012, 0xece0a73d +0, 0, 0, 0, 2012, 0x0dd1aefa +0, 0, 0, 0, 2012, 0xe338c866 +0, 0, 0, 0, 2012, 0xfe71bffc +0, 0, 0, 0, 2012, 0x61a5a810 +0, 0, 0, 0, 2012, 0x7c3ba074 +0, 0, 0, 0, 2012, 0x492f9d91 +0, 0, 0, 0, 2012, 0xa126a7b9 +0, 0, 0, 0, 2012, 0x7cf19a40 +0, 0, 0, 0, 2012, 0x1c2fbae6 +0, 0, 0, 0, 2012, 0x540accdf +0, 0, 0, 0, 2012, 0x5908a938 +0, 0, 0, 0, 2012, 0xe7f8b501 +0, 0, 0, 0, 2012, 0x03a8b53e +0, 0, 0, 0, 2012, 0xb4e3bdda +0, 0, 0, 0, 2012, 0x9e86abe1 +0, 0, 0, 0, 2012, 0x3234b98d +0, 0, 0, 0, 2012, 0x5caec781 +0, 0, 0, 0, 2012, 0x5c21a32e +0, 0, 0, 0, 2012, 0x8b72c112 +0, 0, 0, 0, 2012, 0x2ec2bac3 +0, 0, 0, 0, 2012, 0xd9c4adaa +0, 0, 0, 0, 2012, 0x2da1b496 +0, 0, 0, 0, 2012, 0x0a51b21e +0, 0, 0, 0, 2012, 0x6414ab0d +0, 0, 0, 0, 2012, 0x95c4b203 +0, 0, 0, 0, 2012, 0x98e0b4a2 +0, 0, 0, 0, 2012, 0x34369f5f +0, 0, 0, 0, 2012, 0x9dffa40c +0, 0, 0, 0, 2012, 0xf345b0e5 +0, 0, 0, 0, 2012, 0x6714bdbf +0, 0, 0, 0, 2012, 0xc276c3d1 +0, 0, 0, 0, 2012, 0xf199b475 +0, 0, 0, 0, 2012, 0x3395cf3b +0, 0, 0, 0, 2012, 0x4b52afb0 +0, 0, 0, 0, 2012, 0x3f74b217 +0, 0, 0, 0, 2012, 0xa25cad38 +0, 0, 0, 0, 2012, 0x3290a5b4 +0, 0, 0, 0, 2012, 0x2917b750 +0, 0, 0, 0, 2012, 0xeb3ec739 +0, 0, 0, 0, 2012, 0xbf9ea51d +0, 0, 0, 0, 2012, 0x98e2a0c1 +0, 0, 0, 0, 2012, 0xa39ba7f2 +0, 0, 0, 0, 2012, 0x6df7a05c +0, 0, 0, 0, 2012, 0x2c1bba28 +0, 0, 0, 0, 2012, 0x6099b1cd +0, 0, 0, 0, 2012, 0x9366b9f2 +0, 0, 0, 0, 2012, 0x95899570 +0, 0, 0, 0, 2012, 0x6234a0c8 +0, 0, 0, 0, 2012, 0xec2cbcfc +0, 0, 0, 0, 2012, 0x3ff7a9db +0, 0, 0, 0, 2012, 0x4e44bad7 +0, 0, 0, 0, 2012, 0x1dbbbc39 +0, 0, 0, 0, 2012, 0xf9df99be +0, 0, 0, 0, 2012, 0xa713b313 +0, 0, 0, 0, 2012, 0x8bbdbe51 +0, 0, 0, 0, 2012, 0x0d5bc786 +0, 0, 0, 0, 2012, 0x75d293f2 +0, 0, 0, 0, 2012, 0x4832b688 +0, 0, 0, 0, 2012, 0x71aba74c +0, 0, 0, 0, 2012, 0x04d5abf2 +0, 0, 0, 0, 2012, 0xaa8fbd98 +0, 0, 0, 0, 2012, 0xd93eb6d4 +0, 0, 0, 0, 2012, 0x8fb6b5a8 +0, 0, 0, 0, 2012, 0x779a92f5 +0, 0, 0, 0, 2012, 0x35c8ab3d +0, 0, 0, 0, 2012, 0x0017aaa5 +0, 0, 0, 0, 2012, 0xd6e7bafe +0, 0, 0, 0, 2012, 0xe358b423 +0, 0, 0, 0, 2012, 0x3f74bfba +0, 0, 0, 0, 2012, 0x0a5eb707 +0, 0, 0, 0, 2012, 0xedbfb0df +0, 0, 0, 0, 2012, 0x2e71a26f +0, 0, 0, 0, 2012, 0x214db1a8 +0, 0, 0, 0, 2012, 0xb632c275 +0, 0, 0, 0, 2012, 0xb597cf92 +0, 0, 0, 0, 2012, 0x18a8b508 +0, 0, 0, 0, 2012, 0x8267b4ff +0, 0, 0, 0, 2012, 0x5a9ab8d6 +0, 0, 0, 0, 2012, 0x2037a2b6 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +b881db03eb6370e057645396d1880260 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-eac3-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,659 @@ +b881db03eb6370e057645396d1880260 *tests/data/fate/spdif-eac3-remux.spdif +16023552 tests/data/fate/spdif-eac3-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: eac3 +#sample_rate 0: 48000 +#channel_layout_name 0: stereo +0, 0, 0, 2880, 352, 0x0ae5a595 +0, 2880, 2880, 2880, 512, 0x2beaf79f +0, 5760, 5760, 2880, 512, 0x29ddf9d6 +0, 8640, 8640, 2880, 512, 0xba0afa79 +0, 11520, 11520, 2880, 512, 0xe019f394 +0, 14400, 14400, 2880, 512, 0xf501f5ab +0, 17280, 17280, 2880, 512, 0x5ed3f35c +0, 20160, 20160, 2880, 512, 0xb2a5f67b +0, 23040, 23040, 2880, 512, 0xdab3f328 +0, 25920, 25920, 2880, 512, 0x490dfa2e +0, 28800, 28800, 2880, 512, 0x26dffa1d +0, 31680, 31680, 2880, 512, 0xa8daf5cd +0, 34560, 34560, 2880, 512, 0x823a01e1 +0, 37440, 37440, 2880, 512, 0xf2feee89 +0, 40320, 40320, 2880, 512, 0x58f5ebe2 +0, 43200, 43200, 2880, 512, 0x8618f679 +0, 46080, 46080, 2880, 512, 0xfbe3f0e9 +0, 48960, 48960, 2880, 512, 0xadc3f479 +0, 51840, 51840, 2880, 512, 0xe85ef861 +0, 54720, 54720, 2880, 512, 0x788cf985 +0, 57600, 57600, 2880, 512, 0x44cf00c1 +0, 60480, 60480, 2880, 512, 0x3398fbf8 +0, 63360, 63360, 2880, 512, 0xfbfafc32 +0, 66240, 66240, 2880, 512, 0x68fdf9db +0, 69120, 69120, 2880, 512, 0xb848f4fa +0, 72000, 72000, 2880, 512, 0x245af55e +0, 74880, 74880, 2880, 512, 0x5027f295 +0, 77760, 77760, 2880, 512, 0x7d74f988 +0, 80640, 80640, 2880, 512, 0x7179f92d +0, 83520, 83520, 2880, 512, 0xb2eff797 +0, 86400, 86400, 2880, 512, 0x1625f5fa +0, 89280, 89280, 2880, 512, 0x3682f8b4 +0, 92160, 92160, 2880, 512, 0xc9e3f9a6 +0, 95040, 95040, 2880, 512, 0x1fd50294 +0, 97920, 97920, 2880, 512, 0xacd0f967 +0, 100800, 100800, 2880, 512, 0xfce1f614 +0, 103680, 103680, 2880, 512, 0x8a96f555 +0, 106560, 106560, 2880, 512, 0xeb93e8eb +0, 109440, 109440, 2880, 512, 0x3d63f049 +0, 112320, 112320, 2880, 512, 0x92ffefa2 +0, 115200, 115200, 2880, 512, 0x634ced64 +0, 118080, 118080, 2880, 512, 0xf372f256 +0, 120960, 120960, 2880, 512, 0xef28ec45 +0, 123840, 123840, 2880, 512, 0x0973f647 +0, 126720, 126720, 2880, 512, 0x11e1f7d9 +0, 129600, 129600, 2880, 512, 0x63ccf4f7 +0, 132480, 132480, 2880, 512, 0xa0e4f3c8 +0, 135360, 135360, 2880, 512, 0x0ab3f11a +0, 138240, 138240, 2880, 512, 0xcbf8f8a2 +0, 141120, 141120, 2880, 512, 0xb102ff6f +0, 144000, 144000, 2880, 512, 0xbfa6ff2f +0, 146880, 146880, 2880, 512, 0xc88301c4 +0, 149760, 149760, 2880, 512, 0xab08f52a +0, 152640, 152640, 2880, 512, 0x9401f177 +0, 155520, 155520, 2880, 512, 0xd8faf12c +0, 158400, 158400, 2880, 512, 0x9f19f770 +0, 161280, 161280, 2880, 512, 0x27eaf637 +0, 164160, 164160, 2880, 512, 0xdaa4f256 +0, 167040, 167040, 2880, 512, 0x6170f6ef +0, 169920, 169920, 2880, 512, 0xeaf8fee4 +0, 172800, 172800, 2880, 512, 0xd438f881 +0, 175680, 175680, 2880, 512, 0x9970f701 +0, 178560, 178560, 2880, 512, 0x9d9af25c +0, 181440, 181440, 2880, 512, 0xa9ee049e +0, 184320, 184320, 2880, 512, 0xe87af4a7 +0, 187200, 187200, 2880, 512, 0x5776f68a +0, 190080, 190080, 2880, 512, 0xce3af291 +0, 192960, 192960, 2880, 512, 0x4994f1e9 +0, 195840, 195840, 2880, 512, 0x97d8f8e4 +0, 198720, 198720, 2880, 512, 0x1b03f2bb +0, 201600, 201600, 2880, 512, 0xa674ede4 +0, 204480, 204480, 2880, 512, 0x9607eede +0, 207360, 207360, 2880, 512, 0xf225ed64 +0, 210240, 210240, 2880, 512, 0xa59ff1af +0, 213120, 213120, 2880, 512, 0xa73cf082 +0, 216000, 216000, 2880, 512, 0xb504f86f +0, 218880, 218880, 2880, 512, 0x3e7cf849 +0, 221760, 221760, 2880, 512, 0x2625f150 +0, 224640, 224640, 2880, 512, 0x8dc7fa6c +0, 227520, 227520, 2880, 512, 0x4116f6fb +0, 230400, 230400, 2880, 512, 0xfb41f025 +0, 233280, 233280, 2880, 512, 0xf2ddf047 +0, 236160, 236160, 2880, 512, 0x3e3af43d +0, 239040, 239040, 2880, 512, 0xbd12031c +0, 241920, 241920, 2880, 512, 0x144bfa82 +0, 244800, 244800, 2880, 512, 0x4221f8b4 +0, 247680, 247680, 2880, 512, 0x95e1f375 +0, 250560, 250560, 2880, 512, 0x15a1e638 +0, 253440, 253440, 2880, 512, 0x3945f461 +0, 256320, 256320, 2880, 512, 0xa95ef996 +0, 259200, 259200, 2880, 512, 0x84caee4a +0, 262080, 262080, 2880, 512, 0x0339f13a +0, 264960, 264960, 2880, 512, 0x010c01b5 +0, 267840, 267840, 2880, 512, 0xb042eb63 +0, 270720, 270720, 2880, 512, 0x1d30f50b +0, 273600, 273600, 2880, 512, 0x8ef1f411 +0, 276480, 276480, 2880, 512, 0x1f68f161 +0, 279360, 279360, 2880, 512, 0xc2a002e2 +0, 282240, 282240, 2880, 512, 0x87bef3a3 +0, 285120, 285120, 2880, 512, 0xee24fc34 +0, 288000, 288000, 2880, 512, 0x0de2f86f +0, 290880, 290880, 2880, 512, 0xda6ef5c5 +0, 293760, 293760, 2880, 512, 0x538ef1b3 +0, 296640, 296640, 2880, 512, 0x059befac +0, 299520, 299520, 2880, 512, 0x0fedfa87 +0, 302400, 302400, 2880, 512, 0x8f04f38c +0, 305280, 305280, 2880, 512, 0x4195f4fa +0, 308160, 308160, 2880, 512, 0x36e5fa8a +0, 311040, 311040, 2880, 512, 0x27cdf74e +0, 313920, 313920, 2880, 512, 0x0a7dee39 +0, 316800, 316800, 2880, 512, 0xb143f9fe +0, 319680, 319680, 2880, 512, 0x57dff4eb +0, 322560, 322560, 2880, 512, 0xbf56ee82 +0, 325440, 325440, 2880, 512, 0x8752f6a5 +0, 328320, 328320, 2880, 512, 0xa647fd42 +0, 331200, 331200, 2880, 512, 0xe8f9eb59 +0, 334080, 334080, 2880, 512, 0xba0aeb49 +0, 336960, 336960, 2880, 512, 0xaa42f9f6 +0, 339840, 339840, 2880, 512, 0xc664ed11 +0, 342720, 342720, 2880, 512, 0xbcaaf855 +0, 345600, 345600, 2880, 512, 0x2631f9ed +0, 348480, 348480, 2880, 512, 0xc4f8f251 +0, 351360, 351360, 2880, 512, 0x1fc2f2af +0, 354240, 354240, 2880, 512, 0xdd2ff3c7 +0, 357120, 357120, 2880, 512, 0xb783f7f9 +0, 360000, 360000, 2880, 512, 0xf6acf1cb +0, 362880, 362880, 2880, 512, 0x1db2fb58 +0, 365760, 365760, 2880, 512, 0x2241e93d +0, 368640, 368640, 2880, 512, 0x619bf1bf +0, 371520, 371520, 2880, 512, 0xe3ddf0ce +0, 374400, 374400, 2880, 512, 0xd94af1be +0, 377280, 377280, 2880, 512, 0xc899f2ab +0, 380160, 380160, 2880, 512, 0xd044f1f7 +0, 383040, 383040, 2880, 512, 0xce7507a7 +0, 385920, 385920, 2880, 512, 0x2421e95b +0, 388800, 388800, 2880, 512, 0x2c52f48c +0, 391680, 391680, 2880, 512, 0xda31fc4e +0, 394560, 394560, 2880, 512, 0xb8dcfdda +0, 397440, 397440, 2880, 512, 0xccc6f055 +0, 400320, 400320, 2880, 512, 0x8c01f9d9 +0, 403200, 403200, 2880, 512, 0xcf36ec40 +0, 406080, 406080, 2880, 512, 0x5bcafa5c +0, 408960, 408960, 2880, 512, 0xb756f560 +0, 411840, 411840, 2880, 512, 0x1849f744 +0, 414720, 414720, 2880, 512, 0x9d9bf5ac +0, 417600, 417600, 2880, 512, 0xaea3f847 +0, 420480, 420480, 2880, 512, 0xfd84f817 +0, 423360, 423360, 2880, 512, 0x5ba0ed29 +0, 426240, 426240, 2880, 512, 0xd3b3f400 +0, 429120, 429120, 2880, 512, 0x6156f6d9 +0, 432000, 432000, 2880, 512, 0xdbc8f4b9 +0, 434880, 434880, 2880, 512, 0x4a48fbe3 +0, 437760, 437760, 2880, 512, 0x7c3cf3ed +0, 440640, 440640, 2880, 512, 0x078eefa2 +0, 443520, 443520, 2880, 512, 0x6b02ec30 +0, 446400, 446400, 2880, 512, 0xa0daf283 +0, 449280, 449280, 2880, 512, 0x6c33f746 +0, 452160, 452160, 2880, 512, 0x38cff4c4 +0, 455040, 455040, 2880, 512, 0xe84cf3fe +0, 457920, 457920, 2880, 512, 0x1a4cfda0 +0, 460800, 460800, 2880, 512, 0x5590f98b +0, 463680, 463680, 2880, 512, 0xbf90f59b +0, 466560, 466560, 2880, 512, 0x3f14f53c +0, 469440, 469440, 2880, 512, 0x12c2ef31 +0, 472320, 472320, 2880, 512, 0xd743f1b0 +0, 475200, 475200, 2880, 512, 0x0ee4f04e +0, 478080, 478080, 2880, 512, 0x0c26f820 +0, 480960, 480960, 2880, 512, 0x4049eb94 +0, 483840, 483840, 2880, 512, 0x89f5f9a2 +0, 486720, 486720, 2880, 512, 0x17d6f6b0 +0, 489600, 489600, 2880, 512, 0x4d2bf5ae +0, 492480, 492480, 2880, 512, 0x2c20f897 +0, 495360, 495360, 2880, 512, 0xe544f11f +0, 498240, 498240, 2880, 512, 0xcaa8f65c +0, 501120, 501120, 2880, 512, 0x1fe6f579 +0, 504000, 504000, 2880, 512, 0x0e85f278 +0, 506880, 506880, 2880, 512, 0x8eddf38c +0, 509760, 509760, 2880, 512, 0x1ea0f289 +0, 512640, 512640, 2880, 512, 0xd76b0034 +0, 515520, 515520, 2880, 512, 0xbe49f9d1 +0, 518400, 518400, 2880, 512, 0xdc3dfded +0, 521280, 521280, 2880, 512, 0x8143f179 +0, 524160, 524160, 2880, 512, 0x6af6f624 +0, 527040, 527040, 2880, 512, 0x638cf7c9 +0, 529920, 529920, 2880, 512, 0xe1e7f4f1 +0, 532800, 532800, 2880, 512, 0xcfbdefd2 +0, 535680, 535680, 2880, 512, 0xae49ecfe +0, 538560, 538560, 2880, 512, 0xdfc8ed5f +0, 541440, 541440, 2880, 512, 0xedd9f0b0 +0, 544320, 544320, 2880, 512, 0xc192f77b +0, 547200, 547200, 2880, 512, 0x88330350 +0, 550080, 550080, 2880, 512, 0x589cfdcc +0, 552960, 552960, 2880, 512, 0x722afae6 +0, 555840, 555840, 2880, 512, 0x5ab9f3cf +0, 558720, 558720, 2880, 512, 0x2dc20161 +0, 561600, 561600, 2880, 512, 0x5117f4e7 +0, 564480, 564480, 2880, 512, 0xaa010049 +0, 567360, 567360, 2880, 512, 0xb5fcf73e +0, 570240, 570240, 2880, 512, 0x66afe3ef +0, 573120, 573120, 2880, 512, 0x3d7bf815 +0, 576000, 576000, 2880, 512, 0x6895ea7c +0, 578880, 578880, 2880, 512, 0x26bbf14e +0, 581760, 581760, 2880, 512, 0x5856ed50 +0, 584640, 584640, 2880, 512, 0x86e4eb6d +0, 587520, 587520, 2880, 512, 0xf68dfbf7 +0, 590400, 590400, 2880, 512, 0x201ff70d +0, 593280, 593280, 2880, 512, 0xdd15e87a +0, 596160, 596160, 2880, 512, 0x50e8fa44 +0, 599040, 599040, 2880, 512, 0x1442f398 +0, 601920, 601920, 2880, 512, 0xe2e9f40b +0, 604800, 604800, 2880, 512, 0xcbfdf354 +0, 607680, 607680, 2880, 512, 0x631100f3 +0, 610560, 610560, 2880, 512, 0x3aa6f9ea +0, 613440, 613440, 2880, 512, 0xb6c5f5e6 +0, 616320, 616320, 2880, 512, 0xe98df623 +0, 619200, 619200, 2880, 512, 0x449dfb59 +0, 622080, 622080, 2880, 512, 0x4faefbb6 +0, 624960, 624960, 2880, 512, 0xcef1eb38 +0, 627840, 627840, 2880, 512, 0x94fcfcf5 +0, 630720, 630720, 2880, 512, 0x2bcaf97f +0, 633600, 633600, 2880, 512, 0xba8af49c +0, 636480, 636480, 2880, 512, 0xad64fc39 +0, 639360, 639360, 2880, 512, 0xb2a2f9fe +0, 642240, 642240, 2880, 512, 0xc96105a3 +0, 645120, 645120, 2880, 512, 0x20c2f7ca +0, 648000, 648000, 2880, 512, 0x5ccdfa46 +0, 650880, 650880, 2880, 512, 0x95eef21c +0, 653760, 653760, 2880, 512, 0xafa9fad1 +0, 656640, 656640, 2880, 512, 0x3134f5cd +0, 659520, 659520, 2880, 512, 0xbb08f702 +0, 662400, 662400, 2880, 512, 0x2829f1a0 +0, 665280, 665280, 2880, 512, 0x1a16fe88 +0, 668160, 668160, 2880, 512, 0x6d87f5cd +0, 671040, 671040, 2880, 512, 0x8170f89a +0, 673920, 673920, 2880, 512, 0xc99df656 +0, 676800, 676800, 2880, 512, 0x2015f2f0 +0, 679680, 679680, 2880, 512, 0x093df67d +0, 682560, 682560, 2880, 512, 0xaa35ee1a +0, 685440, 685440, 2880, 512, 0xc6caee7e +0, 688320, 688320, 2880, 512, 0xc97bf536 +0, 691200, 691200, 2880, 512, 0x7a37f73b +0, 694080, 694080, 2880, 512, 0xa2cdee4d +0, 696960, 696960, 2880, 512, 0xefd5016c +0, 699840, 699840, 2880, 512, 0x562ef6da +0, 702720, 702720, 2880, 512, 0x4203f1ed +0, 705600, 705600, 2880, 512, 0x5ec7f7f0 +0, 708480, 708480, 2880, 512, 0x156ff026 +0, 711360, 711360, 2880, 512, 0xcba8fc0a +0, 714240, 714240, 2880, 512, 0x420b03c3 +0, 717120, 717120, 2880, 512, 0x37f0f2be +0, 720000, 720000, 2880, 512, 0x35d0fc17 +0, 722880, 722880, 2880, 512, 0x1d30f537 +0, 725760, 725760, 2880, 512, 0x5a84e506 +0, 728640, 728640, 2880, 512, 0x2fd8eba5 +0, 731520, 731520, 2880, 512, 0x3271f624 +0, 734400, 734400, 2880, 512, 0xdcc4ea3b +0, 737280, 737280, 2880, 512, 0x0d76ee13 +0, 740160, 740160, 2880, 512, 0xba46f2a5 +0, 743040, 743040, 2880, 512, 0xb1540424 +0, 745920, 745920, 2880, 512, 0x0c88fae6 +0, 748800, 748800, 2880, 512, 0xe879f89b +0, 751680, 751680, 2880, 512, 0xae96f934 +0, 754560, 754560, 2880, 512, 0xc17405ec +0, 757440, 757440, 2880, 512, 0x95b8f486 +0, 760320, 760320, 2880, 512, 0x03bbf5a9 +0, 763200, 763200, 2880, 512, 0x63eaf8d6 +0, 766080, 766080, 2880, 512, 0x7a6bfa96 +0, 768960, 768960, 2880, 512, 0x2eabee80 +0, 771840, 771840, 2880, 512, 0x8693f3c1 +0, 774720, 774720, 2880, 512, 0xc8b6f42a +0, 777600, 777600, 2880, 512, 0x9b5bf344 +0, 780480, 780480, 2880, 512, 0xda81f513 +0, 783360, 783360, 2880, 512, 0x4789fa4d +0, 786240, 786240, 2880, 512, 0xe70aed30 +0, 789120, 789120, 2880, 512, 0x0e51f579 +0, 792000, 792000, 2880, 512, 0x171503c9 +0, 794880, 794880, 2880, 512, 0xc965f98c +0, 797760, 797760, 2880, 512, 0x816ef627 +0, 800640, 800640, 2880, 512, 0x441ceb6c +0, 803520, 803520, 2880, 512, 0xedbcf1e5 +0, 806400, 806400, 2880, 512, 0x1168fec7 +0, 809280, 809280, 2880, 512, 0x488afa1e +0, 812160, 812160, 2880, 512, 0x6d1dec39 +0, 815040, 815040, 2880, 512, 0x54c7f611 +0, 817920, 817920, 2880, 512, 0x0803eae6 +0, 820800, 820800, 2880, 512, 0xcd85eb6d +0, 823680, 823680, 2880, 512, 0x3f920034 +0, 826560, 826560, 2880, 512, 0x4b55ea47 +0, 829440, 829440, 2880, 512, 0xdfd7f681 +0, 832320, 832320, 2880, 512, 0x20ccef96 +0, 835200, 835200, 2880, 512, 0x122cf656 +0, 838080, 838080, 2880, 512, 0xe38fef19 +0, 840960, 840960, 2880, 512, 0xa11ff565 +0, 843840, 843840, 2880, 512, 0x931cf83e +0, 846720, 846720, 2880, 512, 0xb854010c +0, 849600, 849600, 2880, 512, 0xf607f233 +0, 852480, 852480, 2880, 512, 0xfd9de7e9 +0, 855360, 855360, 2880, 512, 0xe401fa53 +0, 858240, 858240, 2880, 512, 0x15aef9f2 +0, 861120, 861120, 2880, 512, 0x0071f50e +0, 864000, 864000, 2880, 512, 0xa3c7f029 +0, 866880, 866880, 2880, 512, 0x9b73ed64 +0, 869760, 869760, 2880, 512, 0x0087fbea +0, 872640, 872640, 2880, 512, 0x9871effb +0, 875520, 875520, 2880, 512, 0x0e36ebe3 +0, 878400, 878400, 2880, 512, 0x982e015e +0, 881280, 881280, 2880, 512, 0xca67f667 +0, 884160, 884160, 2880, 512, 0xc504fd51 +0, 887040, 887040, 2880, 512, 0xf5c7f167 +0, 889920, 889920, 2880, 512, 0x75aaece8 +0, 892800, 892800, 2880, 512, 0x288effcf +0, 895680, 895680, 2880, 512, 0xb640f057 +0, 898560, 898560, 2880, 512, 0xbb7cf4a9 +0, 901440, 901440, 2880, 512, 0xccf200d6 +0, 904320, 904320, 2880, 512, 0x1a00f229 +0, 907200, 907200, 2880, 512, 0xa95bf1be +0, 910080, 910080, 2880, 512, 0x3c1af28d +0, 912960, 912960, 2880, 512, 0x11d1ef54 +0, 915840, 915840, 2880, 512, 0xf9ae02aa +0, 918720, 918720, 2880, 512, 0x4476ee68 +0, 921600, 921600, 2880, 512, 0x7f43eb80 +0, 924480, 924480, 2880, 512, 0x245af906 +0, 927360, 927360, 2880, 512, 0xbb06f0a8 +0, 930240, 930240, 2880, 512, 0xe51bf461 +0, 933120, 933120, 2880, 512, 0xd767f7fd +0, 936000, 936000, 2880, 512, 0xd517f1ca +0, 938880, 938880, 2880, 512, 0x3311eb45 +0, 941760, 941760, 2880, 512, 0xee0ef61e +0, 944640, 944640, 2880, 512, 0x9e7cfe9b +0, 947520, 947520, 2880, 512, 0x353ef03a +0, 950400, 950400, 2880, 512, 0x92f6fcfa +0, 953280, 953280, 2880, 512, 0xe458f3d0 +0, 956160, 956160, 2880, 512, 0xebf3f8af +0, 959040, 959040, 2880, 512, 0xc0f6f981 +0, 961920, 961920, 2880, 512, 0x3e31fb6c +0, 964800, 964800, 2880, 512, 0xd679031b +0, 967680, 967680, 2880, 512, 0x6571f361 +0, 970560, 970560, 2880, 512, 0xf410f507 +0, 973440, 973440, 2880, 512, 0x2217f817 +0, 976320, 976320, 2880, 512, 0xaa53f6ee +0, 979200, 979200, 2880, 512, 0xa574fa14 +0, 982080, 982080, 2880, 512, 0xcd7ff09d +0, 984960, 984960, 2880, 512, 0xa650f7d6 +0, 987840, 987840, 2880, 512, 0x6b4ff467 +0, 990720, 990720, 2880, 512, 0x9355f3cb +0, 993600, 993600, 2880, 512, 0x7546eb8b +0, 996480, 996480, 2880, 512, 0x4ac6f4c8 +0, 999360, 999360, 2880, 512, 0xcf69f62c +0, 1002240, 1002240, 2880, 512, 0x93a0e35d +0, 1005120, 1005120, 2880, 512, 0x60c5f0f5 +0, 1008000, 1008000, 2880, 512, 0x75a4fb42 +0, 1010880, 1010880, 2880, 512, 0x2615ff1f +0, 1013760, 1013760, 2880, 512, 0xb95df9a2 +0, 1016640, 1016640, 2880, 512, 0xb8c5fafb +0, 1019520, 1019520, 2880, 512, 0x3465fd2b +0, 1022400, 1022400, 2880, 512, 0xa758f489 +0, 1025280, 1025280, 2880, 512, 0xe4bafd7f +0, 1028160, 1028160, 2880, 512, 0xfa45f603 +0, 1031040, 1031040, 2880, 512, 0x875b04f1 +0, 1033920, 1033920, 2880, 512, 0x171bf602 +0, 1036800, 1036800, 2880, 512, 0x557cf2fd +0, 1039680, 1039680, 2880, 512, 0x3a4303c0 +0, 1042560, 1042560, 2880, 512, 0xbd0feef3 +0, 1045440, 1045440, 2880, 512, 0x3ca3ed7f +0, 1048320, 1048320, 2880, 512, 0x4a4bf0b3 +0, 1051200, 1051200, 2880, 512, 0xdef5f4a3 +0, 1054080, 1054080, 2880, 512, 0x96a7f939 +0, 1056960, 1056960, 2880, 512, 0x3dc4f2fb +0, 1059840, 1059840, 2880, 512, 0xa323ec80 +0, 1062720, 1062720, 2880, 512, 0x8b49eebf +0, 1065600, 1065600, 2880, 512, 0xb4a3f983 +0, 1068480, 1068480, 2880, 512, 0x5a61ecf5 +0, 1071360, 1071360, 2880, 512, 0x10b0dbda +0, 1074240, 1074240, 2880, 512, 0x4836f474 +0, 1077120, 1077120, 2880, 512, 0xe6f1ee87 +0, 1080000, 1080000, 2880, 512, 0x1e1bf474 +0, 1082880, 1082880, 2880, 512, 0xe25bf263 +0, 1085760, 1085760, 2880, 512, 0x29a9f348 +0, 1088640, 1088640, 2880, 512, 0x8cf6f85d +0, 1091520, 1091520, 2880, 512, 0x3690f40a +0, 1094400, 1094400, 2880, 512, 0x072dfcb5 +0, 1097280, 1097280, 2880, 512, 0x9611f8c7 +0, 1100160, 1100160, 2880, 512, 0x3ee7f622 +0, 1103040, 1103040, 2880, 512, 0xdb37f787 +0, 1105920, 1105920, 2880, 512, 0xc09bf2e3 +0, 1108800, 1108800, 2880, 512, 0xae37f9ea +0, 1111680, 1111680, 2880, 512, 0x2764f6b0 +0, 1114560, 1114560, 2880, 512, 0x871be490 +0, 1117440, 1117440, 2880, 512, 0x2e7cefca +0, 1120320, 1120320, 2880, 512, 0x000dece5 +0, 1123200, 1123200, 2880, 512, 0xbe9bea16 +0, 1126080, 1126080, 2880, 512, 0x202cf37c +0, 1128960, 1128960, 2880, 512, 0xae02fa29 +0, 1131840, 1131840, 2880, 512, 0x5eb4efc9 +0, 1134720, 1134720, 2880, 512, 0x7a82ffce +0, 1137600, 1137600, 2880, 512, 0x4c0fefb2 +0, 1140480, 1140480, 2880, 512, 0x0d55fd52 +0, 1143360, 1143360, 2880, 512, 0x00c8f568 +0, 1146240, 1146240, 2880, 512, 0x9d9ef306 +0, 1149120, 1149120, 2880, 512, 0x53bbf79c +0, 1152000, 1152000, 2880, 512, 0xf1fbf3f4 +0, 1154880, 1154880, 2880, 512, 0x0ae0ed0b +0, 1157760, 1157760, 2880, 512, 0x3374ffc1 +0, 1160640, 1160640, 2880, 512, 0xbba1f546 +0, 1163520, 1163520, 2880, 512, 0xaffeee35 +0, 1166400, 1166400, 2880, 512, 0x81dff38d +0, 1169280, 1169280, 2880, 512, 0x29edeafb +0, 1172160, 1172160, 2880, 512, 0x406fecbe +0, 1175040, 1175040, 2880, 512, 0xee28f8dc +0, 1177920, 1177920, 2880, 512, 0x4b1af28a +0, 1180800, 1180800, 2880, 512, 0x83ab0058 +0, 1183680, 1183680, 2880, 512, 0x25d0f735 +0, 1186560, 1186560, 2880, 512, 0xec5ff319 +0, 1189440, 1189440, 2880, 512, 0x1723f121 +0, 1192320, 1192320, 2880, 512, 0x266cedd8 +0, 1195200, 1195200, 2880, 512, 0x15b1031a +0, 1198080, 1198080, 2880, 512, 0x4a83f6b6 +0, 1200960, 1200960, 2880, 512, 0x8cd1fb9f +0, 1203840, 1203840, 2880, 512, 0x76f4f696 +0, 1206720, 1206720, 2880, 512, 0x9c04fa16 +0, 1209600, 1209600, 2880, 512, 0x5d1600ce +0, 1212480, 1212480, 2880, 512, 0x40d9f905 +0, 1215360, 1215360, 2880, 512, 0xb9eef26c +0, 1218240, 1218240, 2880, 512, 0x5557ed03 +0, 1221120, 1221120, 2880, 512, 0xa3b0f348 +0, 1224000, 1224000, 2880, 512, 0xac9ffa65 +0, 1226880, 1226880, 2880, 512, 0xbb49fcf1 +0, 1229760, 1229760, 2880, 512, 0xc324f4da +0, 1232640, 1232640, 2880, 512, 0xe9d2e875 +0, 1235520, 1235520, 2880, 512, 0x822cef30 +0, 1238400, 1238400, 2880, 512, 0x56f6f7a8 +0, 1241280, 1241280, 2880, 512, 0xf82cf718 +0, 1244160, 1244160, 2880, 512, 0xb75bfaa1 +0, 1247040, 1247040, 2880, 512, 0xdd4dfed6 +0, 1249920, 1249920, 2880, 512, 0x4392f531 +0, 1252800, 1252800, 2880, 512, 0xf50cf9fa +0, 1255680, 1255680, 2880, 512, 0x1181ead9 +0, 1258560, 1258560, 2880, 512, 0x4925fb83 +0, 1261440, 1261440, 2880, 512, 0x53a7faf8 +0, 1264320, 1264320, 2880, 512, 0x0042f4f9 +0, 1267200, 1267200, 2880, 512, 0x0ed8fa2c +0, 1270080, 1270080, 2880, 512, 0x9a1ef892 +0, 1272960, 1272960, 2880, 512, 0x4b35ee26 +0, 1275840, 1275840, 2880, 512, 0x6596fc07 +0, 1278720, 1278720, 2880, 512, 0xd3fcf908 +0, 1281600, 1281600, 2880, 512, 0x4f3ce991 +0, 1284480, 1284480, 2880, 512, 0xd8f7fc2a +0, 1287360, 1287360, 2880, 512, 0x3dd4f26c +0, 1290240, 1290240, 2880, 512, 0x4f49fc77 +0, 1293120, 1293120, 2880, 512, 0x3e08e521 +0, 1296000, 1296000, 2880, 512, 0xd180f348 +0, 1298880, 1298880, 2880, 512, 0xebeaf520 +0, 1301760, 1301760, 2880, 512, 0xed06f763 +0, 1304640, 1304640, 2880, 512, 0x9766ef09 +0, 1307520, 1307520, 2880, 512, 0xc4a6fc00 +0, 1310400, 1310400, 2880, 512, 0x5547f0ae +0, 1313280, 1313280, 2880, 512, 0x300cf213 +0, 1316160, 1316160, 2880, 512, 0x35ba0678 +0, 1319040, 1319040, 2880, 512, 0xa8baf485 +0, 1321920, 1321920, 2880, 512, 0xc0cbe8e8 +0, 1324800, 1324800, 2880, 512, 0x081aeed1 +0, 1327680, 1327680, 2880, 512, 0x2017ec33 +0, 1330560, 1330560, 2880, 512, 0x8739f958 +0, 1333440, 1333440, 2880, 512, 0xb797f52e +0, 1336320, 1336320, 2880, 512, 0x818afdf2 +0, 1339200, 1339200, 2880, 512, 0xbbabf0fe +0, 1342080, 1342080, 2880, 512, 0x843600db +0, 1344960, 1344960, 2880, 512, 0x610b02c9 +0, 1347840, 1347840, 2880, 512, 0x0bf8edfe +0, 1350720, 1350720, 2880, 512, 0x9310edea +0, 1353600, 1353600, 2880, 512, 0x08c2f355 +0, 1356480, 1356480, 2880, 512, 0x1b23f44c +0, 1359360, 1359360, 2880, 512, 0x4be9f384 +0, 1362240, 1362240, 2880, 512, 0x5fbef21d +0, 1365120, 1365120, 2880, 512, 0x7412ef5e +0, 1368000, 1368000, 2880, 512, 0x9ae7f608 +0, 1370880, 1370880, 2880, 512, 0x0f41f270 +0, 1373760, 1373760, 2880, 512, 0x42c1f982 +0, 1376640, 1376640, 2880, 512, 0x4538f04b +0, 1379520, 1379520, 2880, 512, 0x09baf2e1 +0, 1382400, 1382400, 2880, 512, 0xed8ff3ba +0, 1385280, 1385280, 2880, 512, 0xb110f516 +0, 1388160, 1388160, 2880, 512, 0x3837f06a +0, 1391040, 1391040, 2880, 512, 0x54aef484 +0, 1393920, 1393920, 2880, 512, 0xb047f61d +0, 1396800, 1396800, 2880, 512, 0xdff4fb98 +0, 1399680, 1399680, 2880, 512, 0x9da60009 +0, 1402560, 1402560, 2880, 512, 0x7bb6f236 +0, 1405440, 1405440, 2880, 512, 0x9f96ea0e +0, 1408320, 1408320, 2880, 512, 0xc5adf19a +0, 1411200, 1411200, 2880, 512, 0x2e9cf6f8 +0, 1414080, 1414080, 2880, 512, 0xada8fadc +0, 1416960, 1416960, 2880, 512, 0x100a07fd +0, 1419840, 1419840, 2880, 512, 0xa26af433 +0, 1422720, 1422720, 2880, 512, 0xc82cf15e +0, 1425600, 1425600, 2880, 512, 0x7f88f10d +0, 1428480, 1428480, 2880, 512, 0x776df377 +0, 1431360, 1431360, 2880, 512, 0x30b0f60d +0, 1434240, 1434240, 2880, 512, 0xcecbf9a3 +0, 1437120, 1437120, 2880, 512, 0xffa8f5c2 +0, 1440000, 1440000, 2880, 512, 0x9052e7cb +0, 1442880, 1442880, 2880, 512, 0x0048f2cc +0, 1445760, 1445760, 2880, 512, 0xc8fff912 +0, 1448640, 1448640, 2880, 512, 0xf22debb8 +0, 1451520, 1451520, 2880, 512, 0x7b4beb82 +0, 1454400, 1454400, 2880, 512, 0x428ff33e +0, 1457280, 1457280, 2880, 512, 0xb3c1f426 +0, 1460160, 1460160, 2880, 512, 0xb08af561 +0, 1463040, 1463040, 2880, 512, 0xaf62ee68 +0, 1465920, 1465920, 2880, 512, 0xdb25f226 +0, 1468800, 1468800, 2880, 512, 0xa577f9d5 +0, 1471680, 1471680, 2880, 512, 0xd21af205 +0, 1474560, 1474560, 2880, 512, 0x8734f052 +0, 1477440, 1477440, 2880, 512, 0xcb0bf009 +0, 1480320, 1480320, 2880, 512, 0xde0bf8a7 +0, 1483200, 1483200, 2880, 512, 0x9fbefd0d +0, 1486080, 1486080, 2880, 512, 0xc329ee26 +0, 1488960, 1488960, 2880, 512, 0xfc6007a0 +0, 1491840, 1491840, 2880, 512, 0x6782004b +0, 1494720, 1494720, 2880, 512, 0x4adbf43c +0, 1497600, 1497600, 2880, 512, 0x5b85f198 +0, 1500480, 1500480, 2880, 512, 0x1576fbfe +0, 1503360, 1503360, 2880, 512, 0x62ebf217 +0, 1506240, 1506240, 2880, 512, 0xd8a9f5fe +0, 1509120, 1509120, 2880, 512, 0x3270f500 +0, 1512000, 1512000, 2880, 512, 0x99e9eca2 +0, 1514880, 1514880, 2880, 512, 0x0d3c02c9 +0, 1517760, 1517760, 2880, 512, 0x8769f484 +0, 1520640, 1520640, 2880, 512, 0xd6cef92a +0, 1523520, 1523520, 2880, 512, 0x9150f4b7 +0, 1526400, 1526400, 2880, 512, 0x760d00ce +0, 1529280, 1529280, 2880, 512, 0xc595f17d +0, 1532160, 1532160, 2880, 512, 0x3720fd55 +0, 1535040, 1535040, 2880, 512, 0x28e5f02b +0, 1537920, 1537920, 2880, 512, 0x9e87f7bd +0, 1540800, 1540800, 2880, 512, 0x4571fe9a +0, 1543680, 1543680, 2880, 512, 0xbf06f83f +0, 1546560, 1546560, 2880, 512, 0xb6bff67e +0, 1549440, 1549440, 2880, 512, 0x582cfa1b +0, 1552320, 1552320, 2880, 512, 0x9277f53b +0, 1555200, 1555200, 2880, 512, 0xd541fa0e +0, 1558080, 1558080, 2880, 512, 0xb9f7f791 +0, 1560960, 1560960, 2880, 512, 0xb5ccf6d3 +0, 1563840, 1563840, 2880, 512, 0xb03ef2a1 +0, 1566720, 1566720, 2880, 512, 0x6970fb11 +0, 1569600, 1569600, 2880, 512, 0x478df6bd +0, 1572480, 1572480, 2880, 512, 0x7ce4eff2 +0, 1575360, 1575360, 2880, 512, 0x5f8af8bb +0, 1578240, 1578240, 2880, 512, 0xa990f10c +0, 1581120, 1581120, 2880, 512, 0x0b5e0603 +0, 1584000, 1584000, 2880, 512, 0x5f5ff667 +0, 1586880, 1586880, 2880, 512, 0xf3f1f7e5 +0, 1589760, 1589760, 2880, 512, 0xb7b1f92c +0, 1592640, 1592640, 2880, 512, 0x5c5afc2d +0, 1595520, 1595520, 2880, 512, 0xc389ecc8 +0, 1598400, 1598400, 2880, 512, 0x86edf4a8 +0, 1601280, 1601280, 2880, 512, 0x31cfeba8 +0, 1604160, 1604160, 2880, 512, 0xea9cf360 +0, 1607040, 1607040, 2880, 512, 0xbc04f016 +0, 1609920, 1609920, 2880, 512, 0x6617ed55 +0, 1612800, 1612800, 2880, 512, 0xe20afad2 +0, 1615680, 1615680, 2880, 512, 0x4706f61a +0, 1618560, 1618560, 2880, 512, 0xa6a8fd93 +0, 1621440, 1621440, 2880, 512, 0x9655e7ae +0, 1624320, 1624320, 2880, 512, 0x0ac2f354 +0, 1627200, 1627200, 2880, 512, 0x62e2f89a +0, 1630080, 1630080, 2880, 512, 0x35baf1cb +0, 1632960, 1632960, 2880, 512, 0xc02ff90e +0, 1635840, 1635840, 2880, 512, 0xf3f8f24b +0, 1638720, 1638720, 2880, 512, 0x10b9ebd6 +0, 1641600, 1641600, 2880, 512, 0x0482084b +0, 1644480, 1644480, 2880, 512, 0xc14cee2e +0, 1647360, 1647360, 2880, 512, 0x21ddf5ea +0, 1650240, 1650240, 2880, 512, 0x8090f51f +0, 1653120, 1653120, 2880, 512, 0x6496ed68 +0, 1656000, 1656000, 2880, 512, 0x4bb3fa69 +0, 1658880, 1658880, 2880, 512, 0x1e18e8d7 +0, 1661760, 1661760, 2880, 512, 0xb758fa60 +0, 1664640, 1664640, 2880, 512, 0xa5c6f671 +0, 1667520, 1667520, 2880, 512, 0x6dbcf15e +0, 1670400, 1670400, 2880, 512, 0x56c4f227 +0, 1673280, 1673280, 2880, 512, 0x17280149 +0, 1676160, 1676160, 2880, 512, 0x8c57f584 +0, 1679040, 1679040, 2880, 512, 0x518ef2b4 +0, 1681920, 1681920, 2880, 512, 0x8a69ebe6 +0, 1684800, 1684800, 2880, 512, 0xf954e97c +0, 1687680, 1687680, 2880, 512, 0x62e1f8db +0, 1690560, 1690560, 2880, 512, 0x637af9fa +0, 1693440, 1693440, 2880, 512, 0xecbcf846 +0, 1696320, 1696320, 2880, 512, 0x2481ecac +0, 1699200, 1699200, 2880, 512, 0x7d3cf940 +0, 1702080, 1702080, 2880, 512, 0x4823efc4 +0, 1704960, 1704960, 2880, 512, 0x31d5f1ca +0, 1707840, 1707840, 2880, 512, 0x3024f40f +0, 1710720, 1710720, 2880, 512, 0xf172f644 +0, 1713600, 1713600, 2880, 512, 0x2502f1b9 +0, 1716480, 1716480, 2880, 512, 0x9ee8f50b +0, 1719360, 1719360, 2880, 512, 0x0605fcc0 +0, 1722240, 1722240, 2880, 512, 0xf202f11d +0, 1725120, 1725120, 2880, 512, 0x449df7a2 +0, 1728000, 1728000, 2880, 512, 0x16e8f468 +0, 1730880, 1730880, 2880, 512, 0xceeafba5 +0, 1733760, 1733760, 2880, 512, 0xc8410340 +0, 1736640, 1736640, 2880, 512, 0xc0e5fe5a +0, 1739520, 1739520, 2880, 512, 0x60cafeb7 +0, 1742400, 1742400, 2880, 512, 0x8277fb6a +0, 1745280, 1745280, 2880, 512, 0xa77dfac9 +0, 1748160, 1748160, 2880, 512, 0x7b2bf1d1 +0, 1751040, 1751040, 2880, 512, 0x63aafabd +0, 1753920, 1753920, 2880, 512, 0xf56cf575 +0, 1756800, 1756800, 2880, 512, 0x2048f966 +0, 1759680, 1759680, 2880, 512, 0x392b0c6a +0, 1762560, 1762560, 2880, 512, 0x7d87f244 +0, 1765440, 1765440, 2880, 512, 0xecbcfedc +0, 1768320, 1768320, 2880, 512, 0x4780f2ef +0, 1771200, 1771200, 2880, 512, 0x1a28f8ff +0, 1774080, 1774080, 2880, 512, 0xda51fcc5 +0, 1776960, 1776960, 2880, 512, 0x7009f7ff +0, 1779840, 1779840, 2880, 512, 0x1e5af6a2 +0, 1782720, 1782720, 2880, 512, 0xcb83e8c3 +0, 1785600, 1785600, 2880, 512, 0x2cbbe8ae +0, 1788480, 1788480, 2880, 512, 0x5cc0ebbd +0, 1791360, 1791360, 2880, 512, 0x5e13f33b +0, 1794240, 1794240, 2880, 512, 0x2ef1ef3d +0, 1797120, 1797120, 2880, 512, 0x4aaef05f +0, 1800000, 1800000, 2880, 512, 0xf6adf321 +0, 1802880, 1802880, 2880, 512, 0x0041e985 +0, 1805760, 1805760, 2880, 512, 0x4539eb83 +0, 1808640, 1808640, 2880, 512, 0xa642f144 +0, 1811520, 1811520, 2880, 512, 0xf58dfb44 +0, 1814400, 1814400, 2880, 512, 0xcdf2f3b2 +0, 1817280, 1817280, 2880, 512, 0xebd9f1d4 +0, 1820160, 1820160, 2880, 512, 0xf39afcca +0, 1823040, 1823040, 2880, 512, 0x4392fb8e +0, 1825920, 1825920, 2880, 512, 0xe23df8bb +0, 1828800, 1828800, 2880, 512, 0xdedaf23a +0, 1831680, 1831680, 2880, 512, 0x1c46f7bc +0, 1834560, 1834560, 2880, 512, 0x47e0f873 +0, 1837440, 1837440, 2880, 512, 0x5e55eb42 +0, 1840320, 1840320, 2880, 512, 0x5f08f8a0 +0, 1843200, 1843200, 2880, 512, 0xf391f9f8 +0, 1846080, 1846080, 2880, 512, 0x3d4afcd1 +0, 1848960, 1848960, 2880, 512, 0x07b8f3d4 +0, 1851840, 1851840, 2880, 512, 0xa7cdfea4 +0, 1854720, 1854720, 2880, 512, 0x4072ffda +0, 1857600, 1857600, 2880, 512, 0xe96df73f +0, 1860480, 1860480, 2880, 512, 0x6170f3a3 +0, 1863360, 1863360, 2880, 512, 0x743cf509 +0, 1866240, 1866240, 2880, 512, 0x3525fe8e +0, 1869120, 1869120, 2880, 512, 0xd345ed02 +0, 1872000, 1872000, 2880, 512, 0x3c15f37f +0, 1874880, 1874880, 2880, 512, 0x9df1facd diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mlp mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mlp --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mlp 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mlp 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +6deb20b45c83b0edce9b91a44a76137c diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp2-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp2-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp2-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp2-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,49 @@ +1ca2b4cb48fd0f14b8a53d9330152d33 *tests/data/fate/spdif-mp2-remux.spdif +193536 tests/data/fate/spdif-mp2-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: mp3 +#sample_rate 0: 48000 +#channel_layout_name 0: stereo +0, 0, 0, 2160, 1152, 0x6f926334 +0, 2160, 2160, 2160, 1152, 0xa1ca68b3 +0, 4320, 4320, 2160, 1152, 0xefa54d9e +0, 6480, 6480, 2160, 1152, 0xd224482c +0, 8640, 8640, 2160, 1152, 0xa1003b3d +0, 10800, 10800, 2160, 1152, 0x196d2d8d +0, 12960, 12960, 2160, 1152, 0x76616814 +0, 15120, 15120, 2160, 1152, 0x7de26bc5 +0, 17280, 17280, 2160, 1152, 0xaf093a77 +0, 19440, 19440, 2160, 1152, 0xa128456e +0, 21600, 21600, 2160, 1152, 0xb4152c91 +0, 23760, 23760, 2160, 1152, 0xe14e51c0 +0, 25920, 25920, 2160, 1152, 0x9ec060bb +0, 28080, 28080, 2160, 1152, 0x8fc34ee7 +0, 30240, 30240, 2160, 1152, 0xa6194f4e +0, 32400, 32400, 2160, 1152, 0x7612307a +0, 34560, 34560, 2160, 1152, 0x2ad2523f +0, 36720, 36720, 2160, 1152, 0xd7686d66 +0, 38880, 38880, 2160, 1152, 0x47af67e7 +0, 41040, 41040, 2160, 1152, 0x25a357d4 +0, 43200, 43200, 2160, 1152, 0x94a66533 +0, 45360, 45360, 2160, 1152, 0xcd646915 +0, 47520, 47520, 2160, 1152, 0xc3614dc2 +0, 49680, 49680, 2160, 1152, 0x17da5f3e +0, 51840, 51840, 2160, 1152, 0x11194069 +0, 54000, 54000, 2160, 1152, 0x29af3e5b +0, 56160, 56160, 2160, 1152, 0x37c83b1b +0, 58320, 58320, 2160, 1152, 0xaba73200 +0, 60480, 60480, 2160, 1152, 0x743a482d +0, 62640, 62640, 2160, 1152, 0xab435176 +0, 64800, 64800, 2160, 1152, 0x3f363c6a +0, 66960, 66960, 2160, 1152, 0xbbaf35ad +0, 69120, 69120, 2160, 1152, 0xc7783d29 +0, 71280, 71280, 2160, 1152, 0x28963a4e +0, 73440, 73440, 2160, 1152, 0xdda343dd +0, 75600, 75600, 2160, 1152, 0x1e4857e3 +0, 77760, 77760, 2160, 1152, 0x0bfd43bf +0, 79920, 79920, 2160, 1152, 0x1bee45f5 +0, 82080, 82080, 2160, 1152, 0xf816371b +0, 84240, 84240, 2160, 1152, 0x70eb4605 +0, 86400, 86400, 2160, 1152, 0x3dea4608 +0, 88560, 88560, 2160, 1152, 0x709d5317 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp3-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp3-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp3-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-mp3-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,47 @@ +a7c7fb1e53b1758096f11974ca93cdf7 *tests/data/fate/spdif-mp3-remux.spdif +184320 tests/data/fate/spdif-mp3-remux.spdif +#tb 0: 1/90000 +#media_type 0: audio +#codec_id 0: mp3 +#sample_rate 0: 44100 +#channel_layout_name 0: mono +0, 0, 0, 2351, 418, 0x64d1b620 +0, 2351, 2351, 2351, 418, 0x04edc6dd +0, 4702, 4702, 2351, 418, 0x2f1ac32b +0, 7053, 7053, 2351, 418, 0xa5ebce7b +0, 9404, 9404, 2351, 418, 0xa4e1d8b5 +0, 11755, 11755, 2351, 418, 0xf927d670 +0, 14106, 14106, 2351, 418, 0x4e8ccae5 +0, 16457, 16457, 2351, 418, 0x2b0ad5c2 +0, 18808, 18808, 2351, 418, 0x4a2fcc63 +0, 21159, 21159, 2351, 418, 0xe945dbc7 +0, 23510, 23510, 2351, 418, 0x601cd144 +0, 25861, 25861, 2351, 418, 0x052dc6a9 +0, 28212, 28212, 2351, 418, 0x348bd06b +0, 30563, 30563, 2351, 418, 0x2996d2bd +0, 32914, 32914, 2351, 418, 0xf658cc71 +0, 35265, 35265, 2351, 418, 0xeb19d2bf +0, 37616, 37616, 2351, 418, 0xd547d84e +0, 39967, 39967, 2351, 418, 0x4a59d73f +0, 42318, 42318, 2351, 418, 0xedbcd9bf +0, 44669, 44669, 2351, 418, 0x36c1d5fb +0, 47020, 47020, 2351, 418, 0x30ddcf11 +0, 49371, 49371, 2351, 418, 0xc1c6d2de +0, 51722, 51722, 2351, 418, 0xeed0cfc8 +0, 54073, 54073, 2351, 418, 0xe7bfde05 +0, 56424, 56424, 2351, 418, 0x3bbec91f +0, 58775, 58775, 2351, 418, 0x4f76cc86 +0, 61126, 61126, 2351, 418, 0x9819cdd2 +0, 63477, 63477, 2351, 418, 0x2cddd971 +0, 65828, 65828, 2351, 418, 0x2b84d6f8 +0, 68179, 68179, 2351, 418, 0xe483ce32 +0, 70530, 70530, 2351, 418, 0x68add0b0 +0, 72881, 72881, 2351, 418, 0xddd6d0bf +0, 75232, 75232, 2351, 418, 0x00c7d8aa +0, 77583, 77583, 2351, 418, 0x915fd36c +0, 79934, 79934, 2351, 418, 0x28d2d73c +0, 82285, 82285, 2351, 418, 0xaa7ad8b4 +0, 84636, 84636, 2351, 418, 0xe4e6d680 +0, 86987, 86987, 2351, 418, 0x4084d578 +0, 89338, 89338, 2351, 418, 0x3ab4b6e7 +0, 91689, 91689, 2351, 418, 0x951b66f9 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-truehd mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-truehd --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-truehd 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/spdif-truehd 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1 @@ +ed9617614478a05b3f94a74d3f1061d9 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-aqtitle mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-aqtitle --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-aqtitle 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-aqtitle 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,0 +Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-realtime mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-realtime --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-realtime 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-realtime 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,0 +Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-scte20 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-scte20 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-scte20 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-cc-scte20 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,0 +Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-charenc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-charenc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-charenc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-charenc 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-jacosub mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-jacosub --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-jacosub 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-jacosub 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-microdvd mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-microdvd --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-microdvd 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-microdvd 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Comic Sans MS,30,&H123456,&H123456,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Comic Sans MS,30,&H123456,&H123456,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-movtext mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-movtext --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-movtext 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-movtext 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Serif,18,&Hffffff,&Hffffff,&Hff000000,&Hff000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Serif,18,&Hffffff,&Hffffff,&Hff000000,&Hff000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpl2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpl2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpl2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpl2 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub-frames mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub-frames --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub-frames 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-mpsub-frames 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pgs-remux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pgs-remux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pgs-remux 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pgs-remux 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,15 @@ +cf306b7bc30122effc6429e35364f640 *tests/data/fate/sub-pgs-remux.sup +49382 tests/data/fate/sub-pgs-remux.sup +#tb 0: 1/90000 +#media_type 0: subtitle +#codec_id 0: hdmv_pgs_subtitle +0, 6072, 6072, 0, 30, 0x32b303ec +0, 6072, 6072, 0, 22, 0x27510416 +0, 6072, 6072, 0, 160, 0xe2024133 +0, 6072, 6072, 0, 22943, 0xc011fe0e +0, 6072, 6072, 0, 2969, 0x35604c6f +0, 6072, 6072, 0, 3, 0x01800080 +0, 35426, 36102, 0, 30, 0x2db303ac +0, 35426, 35862, 0, 22, 0x27510416 +0, 35426, 35426, 0, 160, 0xe2024133 +0, 35426, 35862, 0, 22943, 0xc011fe0e diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pjs mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pjs --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pjs 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-pjs 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-realtext mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-realtext --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-realtext 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-realtext 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-sami2 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-scc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-scc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-scc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-scc 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,0 +Style: Default,Monospace,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,3,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt-badsyntax mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt-badsyntax --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt-badsyntax 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-srt-badsyntax 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-stl mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-stl --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-stl 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-stl 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-subviewer1 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-vplayer mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-vplayer --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-vplayer 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-vplayer 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt2 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt2 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt2 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sub-webvtt2 2023-03-03 13:29:59.000000000 +0000 @@ -4,10 +4,11 @@ PlayResX: 384 PlayResY: 288 ScaledBorderAndShadow: yes +YCbCr Matrix: None [V4+ Styles] Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding -Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0 +Style: Default,Arial,16,&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1 [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/svq1 2023-03-03 13:29:59.000000000 +0000 @@ -24,19 +24,19 @@ 0, 18, 18, 1, 21600, 0x8d5b2ad0 0, 19, 19, 1, 21600, 0xe67128e6 0, 20, 20, 1, 21600, 0xb7bf613e -0, 21, 21, 1, 21600, 0xefd0f51b -0, 22, 22, 1, 21600, 0x31b7da59 +0, 21, 21, 1, 21600, 0xf697fa3e +0, 22, 22, 1, 21600, 0x5b6ede88 0, 23, 23, 1, 21600, 0x7a84a8f7 0, 24, 24, 1, 21600, 0x0351ad27 -0, 25, 25, 1, 21600, 0xed6f434d -0, 26, 26, 1, 21600, 0x0e771127 -0, 27, 27, 1, 21600, 0x37bf0b95 -0, 28, 28, 1, 21600, 0x30e10a77 -0, 29, 29, 1, 21600, 0x1a48288a -0, 30, 30, 1, 21600, 0xf43c6770 -0, 31, 31, 1, 21600, 0x3c43ae68 -0, 32, 32, 1, 21600, 0x04dc0949 -0, 33, 33, 1, 21600, 0x7920758d +0, 25, 25, 1, 21600, 0x57b547c2 +0, 26, 26, 1, 21600, 0xbb9e1558 +0, 27, 27, 1, 21600, 0xcb470f6b +0, 28, 28, 1, 21600, 0xeb100de0 +0, 29, 29, 1, 21600, 0x089c2bf0 +0, 30, 30, 1, 21600, 0xe27b6a42 +0, 31, 31, 1, 21600, 0xbfe2b11b +0, 32, 32, 1, 21600, 0xd9ca0bb5 +0, 33, 33, 1, 21600, 0x12fe783c 0, 34, 34, 1, 21600, 0x6c12bab5 0, 35, 35, 1, 21600, 0x1ac23706 0, 36, 36, 1, 21600, 0x7a95cb5f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sws-pixdesc-query mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sws-pixdesc-query --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sws-pixdesc-query 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/sws-pixdesc-query 2023-03-03 13:29:59.000000000 +0000 @@ -21,6 +21,8 @@ rgb48le rgba64be rgba64le + rgbaf16be + rgbaf16le ya16be ya16le yuv420p16be @@ -61,6 +63,8 @@ nv20le p010be p010le + p012be + p012le p210be p210le p410be @@ -69,10 +73,16 @@ x2bgr10le x2rgb10be x2rgb10le + xv30be + xv30le + xv36be + xv36le xyz12be xyz12le y210be y210le + y212be + y212le yuv420p10be yuv420p10le yuv420p12be @@ -147,6 +157,7 @@ grayf32be nv20be p010be + p012be p016be p210be p216be @@ -157,10 +168,16 @@ rgb555be rgb565be rgba64be + rgbaf16be + rgbaf32be + rgbf32be x2bgr10be x2rgb10be + xv30be + xv36be xyz12be y210be + y212be ya16be yuv420p10be yuv420p12be @@ -203,6 +220,8 @@ nv42 p010be p010le + p012be + p012le p016be p016le p210be @@ -215,10 +234,18 @@ p416le uyvy422 uyyvyy411 + vuya + vuyx + xv30be + xv30le + xv36be + xv36le xyz12be xyz12le y210be y210le + y212be + y212le ya16be ya16le ya8 @@ -305,6 +332,8 @@ nv42 p010be p010le + p012be + p012le p016be p016le p210be @@ -396,6 +425,8 @@ nv42 p010be p010le + p012be + p012le p016be p016le p210be @@ -478,6 +509,12 @@ rgb8 rgba64be rgba64le + rgbaf16be + rgbaf16le + rgbaf32be + rgbaf32le + rgbf32be + rgbf32le x2bgr10be x2bgr10le x2rgb10be @@ -628,6 +665,12 @@ rgb8 rgba64be rgba64le + rgbaf16be + rgbaf16le + rgbaf32be + rgbaf32le + rgbf32be + rgbf32le x2bgr10be x2bgr10le x2rgb10be @@ -654,6 +697,11 @@ rgb32_1 rgba64be rgba64le + rgbaf16be + rgbaf16le + rgbaf32be + rgbaf32le + vuya ya16be ya16le ya8 @@ -737,16 +785,30 @@ rgb8 rgba64be rgba64le + rgbaf16be + rgbaf16le + rgbaf32be + rgbaf32le + rgbf32be + rgbf32le uyvy422 uyyvyy411 + vuya + vuyx x2bgr10be x2bgr10le x2rgb10be x2rgb10le + xv30be + xv30le + xv36be + xv36le xyz12be xyz12le y210be y210le + y212be + y212le ya16be ya16le ya8 @@ -785,6 +847,8 @@ nv42 p010be p010le + p012be + p012le p016be p016le p210be @@ -915,6 +979,12 @@ rgb8 rgba64be rgba64le + rgbaf16be + rgbaf16le + rgbaf32be + rgbaf32le + rgbf32be + rgbf32le x2bgr10be x2bgr10le x2rgb10be @@ -955,17 +1025,25 @@ DataInHighBits: p010be p010le + p012be + p012le p210be p210le p410be p410le + xv36be + xv36le xyz12be xyz12le y210be y210le + y212be + y212le SwappedChroma: nv21 nv42 + vuya + vuyx yvyu422 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbaf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbaf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbaf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbaf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 1024, 0x877e1d5f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-lzw-rgbf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 768, 0xad26ed90 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbaf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbaf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbaf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbaf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 1024, 0x877e1d5f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-uncompressed-rgbf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 768, 0xad26ed90 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbaf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbaf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbaf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbaf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 1024, 0x877e1d5f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbf32le mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbf32le --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbf32le 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/tiff-zip-rgbf32le 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0, 1, 768, 0xad26ed90 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-demux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-demux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-demux 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-demux 2023-03-03 13:29:59.000000000 +0000 @@ -1,47 +1,47 @@ -packet|codec_type=video|stream_index=0|pts=3912669846|pts_time=43474.109400|dts=3912665342|dts_time=43474.059356|duration=1501|duration_time=0.016678|size=114336|pos=376|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:9bc8b561 -packet|codec_type=video|stream_index=0|pts=3912666843|pts_time=43474.076033|dts=3912666843|dts_time=43474.076033|duration=1501|duration_time=0.016678|size=12560|pos=122012|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:4f8c97dd -packet|codec_type=video|stream_index=0|pts=3912668345|pts_time=43474.092722|dts=3912668345|dts_time=43474.092722|duration=1501|duration_time=0.016678|size=12704|pos=135548|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:27f259db -packet|codec_type=video|stream_index=0|pts=3912674351|pts_time=43474.159456|dts=3912669846|dts_time=43474.109400|duration=1501|duration_time=0.016678|size=51976|pos=149084|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:a6588b80 -packet|codec_type=video|stream_index=0|pts=3912671348|pts_time=43474.126089|dts=3912671348|dts_time=43474.126089|duration=1501|duration_time=0.016678|size=13096|pos=204356|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:33547f9f -packet|codec_type=video|stream_index=0|pts=3912672849|pts_time=43474.142767|dts=3912672849|dts_time=43474.142767|duration=1501|duration_time=0.016678|size=13744|pos=218456|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:547f3d4e -packet|codec_type=video|stream_index=0|pts=3912678855|pts_time=43474.209500|dts=3912674351|dts_time=43474.159456|duration=1501|duration_time=0.016678|size=56568|pos=232932|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:fb5f4b9e -packet|codec_type=video|stream_index=0|pts=3912675852|pts_time=43474.176133|dts=3912675852|dts_time=43474.176133|duration=1501|duration_time=0.016678|size=14720|pos=293092|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:1fb84db4 -packet|codec_type=video|stream_index=0|pts=3912677354|pts_time=43474.192822|dts=3912677354|dts_time=43474.192822|duration=1501|duration_time=0.016678|size=15216|pos=309072|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:77516f2c -packet|codec_type=video|stream_index=0|pts=3912683360|pts_time=43474.259556|dts=3912678855|dts_time=43474.209500|duration=1501|duration_time=0.016678|size=61720|pos=325240|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:7e6594e5 -packet|codec_type=video|stream_index=0|pts=3912680357|pts_time=43474.226189|dts=3912680357|dts_time=43474.226189|duration=1501|duration_time=0.016678|size=17416|pos=390852|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:31c8b89d -packet|codec_type=audio|stream_index=1|pts=3912633305|pts_time=43473.703389|dts=3912633305|dts_time=43473.703389|duration=2880|duration_time=0.032000|size=1536|pos=218080|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:25b60d38 -packet|codec_type=audio|stream_index=1|pts=3912636185|pts_time=43473.735389|dts=3912636185|dts_time=43473.735389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K_|data_hash=CRC32:d4e30aaf -packet|codec_type=audio|stream_index=1|pts=3912639065|pts_time=43473.767389|dts=3912639065|dts_time=43473.767389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K_|data_hash=CRC32:32d6d14d -packet|codec_type=audio|stream_index=2|pts=3912634060|pts_time=43473.711778|dts=3912634060|dts_time=43473.711778|duration=2880|duration_time=0.032000|size=768|pos=235564|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:34b350c9 -packet|codec_type=audio|stream_index=2|pts=3912636940|pts_time=43473.743778|dts=3912636940|dts_time=43473.743778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K_|data_hash=CRC32:457881f8 -packet|codec_type=audio|stream_index=2|pts=3912639820|pts_time=43473.775778|dts=3912639820|dts_time=43473.775778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K_|data_hash=CRC32:1abb0d9a -packet|codec_type=video|stream_index=0|pts=3912681858|pts_time=43474.242867|dts=3912681858|dts_time=43474.242867|duration=1501|duration_time=0.016678|size=18144|pos=409464|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:826f8e8e -packet|codec_type=video|stream_index=0|pts=3912687864|pts_time=43474.309600|dts=3912683360|dts_time=43474.259556|duration=1501|duration_time=0.016678|size=56848|pos=428640|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:6b15be8c -packet|codec_type=video|stream_index=0|pts=3912684861|pts_time=43474.276233|dts=3912684861|dts_time=43474.276233|duration=1501|duration_time=0.016678|size=16296|pos=489176|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:911b1649 -packet|codec_type=audio|stream_index=1|pts=3912641945|pts_time=43473.799389|dts=3912641945|dts_time=43473.799389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d2f2012f -packet|codec_type=audio|stream_index=2|pts=3912642700|pts_time=43473.807778|dts=3912642700|dts_time=43473.807778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3dad674a -packet|codec_type=video|stream_index=0|pts=3912686363|pts_time=43474.292922|dts=3912686363|dts_time=43474.292922|duration=1501|duration_time=0.016678|size=4944|pos=506660|flags=__|data_hash=CRC32:54a86cbb -packet|codec_type=audio|stream_index=1|pts=3912644825|pts_time=43473.831389|dts=3912644825|dts_time=43473.831389|duration=2880|duration_time=0.032000|size=906|pos=474888|flags=K_|data_hash=CRC32:0893d398 -packet|codec_type=audio|stream_index=2|pts=3912645580|pts_time=43473.839778|dts=3912645580|dts_time=43473.839778|duration=2880|duration_time=0.032000|size=354|pos=491808|flags=K_|data_hash=CRC32:f5963fa6 +packet|codec_type=video|stream_index=0|pts=3912669846|pts_time=43474.109400|dts=3912665342|dts_time=43474.059356|duration=1501|duration_time=0.016678|size=114336|pos=376|flags=K__|data_hash=CRC32:9bc8b561|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912666843|pts_time=43474.076033|dts=3912666843|dts_time=43474.076033|duration=1501|duration_time=0.016678|size=12560|pos=122012|flags=___|data_hash=CRC32:4f8c97dd|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912668345|pts_time=43474.092722|dts=3912668345|dts_time=43474.092722|duration=1501|duration_time=0.016678|size=12704|pos=135548|flags=___|data_hash=CRC32:27f259db|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912674351|pts_time=43474.159456|dts=3912669846|dts_time=43474.109400|duration=1501|duration_time=0.016678|size=51976|pos=149084|flags=___|data_hash=CRC32:a6588b80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912671348|pts_time=43474.126089|dts=3912671348|dts_time=43474.126089|duration=1501|duration_time=0.016678|size=13096|pos=204356|flags=___|data_hash=CRC32:33547f9f|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912672849|pts_time=43474.142767|dts=3912672849|dts_time=43474.142767|duration=1501|duration_time=0.016678|size=13744|pos=218456|flags=___|data_hash=CRC32:547f3d4e|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912678855|pts_time=43474.209500|dts=3912674351|dts_time=43474.159456|duration=1501|duration_time=0.016678|size=56568|pos=232932|flags=___|data_hash=CRC32:fb5f4b9e|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912675852|pts_time=43474.176133|dts=3912675852|dts_time=43474.176133|duration=1501|duration_time=0.016678|size=14720|pos=293092|flags=___|data_hash=CRC32:1fb84db4|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912677354|pts_time=43474.192822|dts=3912677354|dts_time=43474.192822|duration=1501|duration_time=0.016678|size=15216|pos=309072|flags=___|data_hash=CRC32:77516f2c|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912683360|pts_time=43474.259556|dts=3912678855|dts_time=43474.209500|duration=1501|duration_time=0.016678|size=61720|pos=325240|flags=___|data_hash=CRC32:7e6594e5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912680357|pts_time=43474.226189|dts=3912680357|dts_time=43474.226189|duration=1501|duration_time=0.016678|size=17416|pos=390852|flags=___|data_hash=CRC32:31c8b89d|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=audio|stream_index=1|pts=3912633305|pts_time=43473.703389|dts=3912633305|dts_time=43473.703389|duration=2880|duration_time=0.032000|size=1536|pos=218080|flags=K__|data_hash=CRC32:25b60d38|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=1|pts=3912636185|pts_time=43473.735389|dts=3912636185|dts_time=43473.735389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:d4e30aaf +packet|codec_type=audio|stream_index=1|pts=3912639065|pts_time=43473.767389|dts=3912639065|dts_time=43473.767389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:32d6d14d +packet|codec_type=audio|stream_index=2|pts=3912634060|pts_time=43473.711778|dts=3912634060|dts_time=43473.711778|duration=2880|duration_time=0.032000|size=768|pos=235564|flags=K__|data_hash=CRC32:34b350c9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=2|pts=3912636940|pts_time=43473.743778|dts=3912636940|dts_time=43473.743778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:457881f8 +packet|codec_type=audio|stream_index=2|pts=3912639820|pts_time=43473.775778|dts=3912639820|dts_time=43473.775778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:1abb0d9a +packet|codec_type=video|stream_index=0|pts=3912681858|pts_time=43474.242867|dts=3912681858|dts_time=43474.242867|duration=1501|duration_time=0.016678|size=18144|pos=409464|flags=___|data_hash=CRC32:826f8e8e|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912687864|pts_time=43474.309600|dts=3912683360|dts_time=43474.259556|duration=1501|duration_time=0.016678|size=56848|pos=428640|flags=___|data_hash=CRC32:6b15be8c|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=3912684861|pts_time=43474.276233|dts=3912684861|dts_time=43474.276233|duration=1501|duration_time=0.016678|size=16296|pos=489176|flags=___|data_hash=CRC32:911b1649|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=audio|stream_index=1|pts=3912641945|pts_time=43473.799389|dts=3912641945|dts_time=43473.799389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K_C|data_hash=CRC32:d2f2012f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=2|pts=3912642700|pts_time=43473.807778|dts=3912642700|dts_time=43473.807778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K_C|data_hash=CRC32:3dad674a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=video|stream_index=0|pts=3912686363|pts_time=43474.292922|dts=3912686363|dts_time=43474.292922|duration=1501|duration_time=0.016678|size=4944|pos=506660|flags=___|data_hash=CRC32:54a86cbb +packet|codec_type=audio|stream_index=1|pts=3912644825|pts_time=43473.831389|dts=3912644825|dts_time=43473.831389|duration=2880|duration_time=0.032000|size=906|pos=474888|flags=K__|data_hash=CRC32:0893d398 +packet|codec_type=audio|stream_index=2|pts=3912645580|pts_time=43473.839778|dts=3912645580|dts_time=43473.839778|duration=2880|duration_time=0.032000|size=354|pos=491808|flags=K__|data_hash=CRC32:f5963fa6 stream|index=0|codec_name=mpeg2video|profile=4|codec_type=video|codec_tag_string=[2][0][0][0]|codec_tag=0x0002|width=1280|height=720|coded_width=0|coded_height=0|closed_captions=0|film_grain=0|has_b_frames=1|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=4|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|id=0x31|r_frame_rate=60000/1001|avg_frame_rate=60000/1001|time_base=1/90000|start_pts=3912669846|start_time=43474.109400|duration_ts=19519|duration=0.216878|bit_rate=15000000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=15|extradata_size=150|extradata_hash=CRC32:53134fa8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|side_data|side_data_type=CPB properties|max_bitrate=15000000|min_bitrate=0|avg_bitrate=0|buffer_size=9781248|vbv_delay=-1 -stream|index=1|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=6|channel_layout=5.1(side)|bits_per_sample=0|id=0x34|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912633305|start_time=43473.703389|duration_ts=14400|duration=0.160000|bit_rate=384000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=eng -stream|index=2|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|id=0x35|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912634060|start_time=43473.711778|duration_ts=14400|duration=0.160000|bit_rate=192000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=es +stream|index=1|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=6|channel_layout=5.1(side)|bits_per_sample=0|initial_padding=0|id=0x34|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912633305|start_time=43473.703389|duration_ts=14400|duration=0.160000|bit_rate=384000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=eng +stream|index=2|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|id=0x35|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=3912634060|start_time=43473.711778|duration_ts=14400|duration=0.160000|bit_rate=192000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:language=es format|filename=mp3ac325-4864-small.ts|nb_streams=3|nb_programs=1|format_name=mpegts|start_time=43473.703389|duration=0.622889|size=512000|bit_rate=6575810|probe_score=50 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-opus-demux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-opus-demux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-opus-demux 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-opus-demux 2023-03-03 13:29:59.000000000 +0000 @@ -1,1026 +1,1026 @@ -packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1800|duration_time=0.020000|size=744|pos=376|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:eec8d060 -packet|codec_type=audio|stream_index=0|pts=1800|pts_time=0.020000|dts=1800|dts_time=0.020000|duration=1800|duration_time=0.020000|size=743|pos=1316|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c5307335 -packet|codec_type=audio|stream_index=0|pts=3600|pts_time=0.040000|dts=3600|dts_time=0.040000|duration=1800|duration_time=0.020000|size=747|pos=2256|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6f1c0bfa -packet|codec_type=audio|stream_index=0|pts=5400|pts_time=0.060000|dts=5400|dts_time=0.060000|duration=1800|duration_time=0.020000|size=742|pos=3196|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:765b2eab -packet|codec_type=audio|stream_index=0|pts=7200|pts_time=0.080000|dts=7200|dts_time=0.080000|duration=1800|duration_time=0.020000|size=752|pos=4136|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:490463dd -packet|codec_type=audio|stream_index=0|pts=9000|pts_time=0.100000|dts=9000|dts_time=0.100000|duration=1800|duration_time=0.020000|size=753|pos=5076|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:beef1221 -packet|codec_type=audio|stream_index=0|pts=10800|pts_time=0.120000|dts=10800|dts_time=0.120000|duration=1800|duration_time=0.020000|size=756|pos=6016|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7814e1fe -packet|codec_type=audio|stream_index=0|pts=12600|pts_time=0.140000|dts=12600|dts_time=0.140000|duration=1800|duration_time=0.020000|size=761|pos=6956|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1e28bf7d -packet|codec_type=audio|stream_index=0|pts=14400|pts_time=0.160000|dts=14400|dts_time=0.160000|duration=1800|duration_time=0.020000|size=755|pos=7896|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ac39390f -packet|codec_type=audio|stream_index=0|pts=16200|pts_time=0.180000|dts=16200|dts_time=0.180000|duration=1800|duration_time=0.020000|size=760|pos=8836|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:56129f6c -packet|codec_type=audio|stream_index=0|pts=18000|pts_time=0.200000|dts=18000|dts_time=0.200000|duration=1800|duration_time=0.020000|size=759|pos=10152|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:444cf0b3 -packet|codec_type=audio|stream_index=0|pts=19800|pts_time=0.220000|dts=19800|dts_time=0.220000|duration=1800|duration_time=0.020000|size=760|pos=11092|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b26188cc -packet|codec_type=audio|stream_index=0|pts=21600|pts_time=0.240000|dts=21600|dts_time=0.240000|duration=1800|duration_time=0.020000|size=762|pos=12032|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:550b5ea5 -packet|codec_type=audio|stream_index=0|pts=23400|pts_time=0.260000|dts=23400|dts_time=0.260000|duration=1800|duration_time=0.020000|size=761|pos=12972|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3b587071 -packet|codec_type=audio|stream_index=0|pts=25200|pts_time=0.280000|dts=25200|dts_time=0.280000|duration=1800|duration_time=0.020000|size=758|pos=13912|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c655d80f -packet|codec_type=audio|stream_index=0|pts=27000|pts_time=0.300000|dts=27000|dts_time=0.300000|duration=1800|duration_time=0.020000|size=756|pos=14852|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4734bf58 -packet|codec_type=audio|stream_index=0|pts=28800|pts_time=0.320000|dts=28800|dts_time=0.320000|duration=1800|duration_time=0.020000|size=762|pos=15792|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:58ddcd0e -packet|codec_type=audio|stream_index=0|pts=30600|pts_time=0.340000|dts=30600|dts_time=0.340000|duration=1800|duration_time=0.020000|size=763|pos=16732|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:50786001 -packet|codec_type=audio|stream_index=0|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=1800|duration_time=0.020000|size=765|pos=17672|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4c8c5dc8 -packet|codec_type=audio|stream_index=0|pts=34200|pts_time=0.380000|dts=34200|dts_time=0.380000|duration=1800|duration_time=0.020000|size=772|pos=18612|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ad3f1eda -packet|codec_type=audio|stream_index=0|pts=36000|pts_time=0.400000|dts=36000|dts_time=0.400000|duration=1800|duration_time=0.020000|size=817|pos=19928|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8b7c8437 -packet|codec_type=audio|stream_index=0|pts=37800|pts_time=0.420000|dts=37800|dts_time=0.420000|duration=1800|duration_time=0.020000|size=828|pos=20868|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c52621e3 -packet|codec_type=audio|stream_index=0|pts=39600|pts_time=0.440000|dts=39600|dts_time=0.440000|duration=1800|duration_time=0.020000|size=952|pos=21808|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4b34b632 -packet|codec_type=audio|stream_index=0|pts=41400|pts_time=0.460000|dts=41400|dts_time=0.460000|duration=1800|duration_time=0.020000|size=819|pos=22936|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:79f06d2c -packet|codec_type=audio|stream_index=0|pts=43200|pts_time=0.480000|dts=43200|dts_time=0.480000|duration=1800|duration_time=0.020000|size=816|pos=23876|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:31136ff8 -packet|codec_type=audio|stream_index=0|pts=45000|pts_time=0.500000|dts=45000|dts_time=0.500000|duration=1800|duration_time=0.020000|size=825|pos=24816|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d6cd17f2 -packet|codec_type=audio|stream_index=0|pts=46800|pts_time=0.520000|dts=46800|dts_time=0.520000|duration=1800|duration_time=0.020000|size=814|pos=25756|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bd4ada7b -packet|codec_type=audio|stream_index=0|pts=48600|pts_time=0.540000|dts=48600|dts_time=0.540000|duration=1800|duration_time=0.020000|size=824|pos=26696|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:59132b5d -packet|codec_type=audio|stream_index=0|pts=50400|pts_time=0.560000|dts=50400|dts_time=0.560000|duration=1800|duration_time=0.020000|size=815|pos=27636|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6d3ba392 -packet|codec_type=audio|stream_index=0|pts=52200|pts_time=0.580000|dts=52200|dts_time=0.580000|duration=1800|duration_time=0.020000|size=824|pos=28576|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b9341220 -packet|codec_type=audio|stream_index=0|pts=54000|pts_time=0.600000|dts=54000|dts_time=0.600000|duration=1800|duration_time=0.020000|size=822|pos=29892|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cd0b0be2 -packet|codec_type=audio|stream_index=0|pts=55800|pts_time=0.620000|dts=55800|dts_time=0.620000|duration=1800|duration_time=0.020000|size=819|pos=30832|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c0a97918 -packet|codec_type=audio|stream_index=0|pts=57600|pts_time=0.640000|dts=57600|dts_time=0.640000|duration=1800|duration_time=0.020000|size=817|pos=31772|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b4da2c7e -packet|codec_type=audio|stream_index=0|pts=59400|pts_time=0.660000|dts=59400|dts_time=0.660000|duration=1800|duration_time=0.020000|size=826|pos=32712|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:aaf0a9b2 -packet|codec_type=audio|stream_index=0|pts=61200|pts_time=0.680000|dts=61200|dts_time=0.680000|duration=1800|duration_time=0.020000|size=822|pos=33652|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a09994ed -packet|codec_type=audio|stream_index=0|pts=63000|pts_time=0.700000|dts=63000|dts_time=0.700000|duration=1800|duration_time=0.020000|size=815|pos=34592|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ded67e51 -packet|codec_type=audio|stream_index=0|pts=64800|pts_time=0.720000|dts=64800|dts_time=0.720000|duration=1800|duration_time=0.020000|size=820|pos=35532|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:17f0a2c0 -packet|codec_type=audio|stream_index=0|pts=66600|pts_time=0.740000|dts=66600|dts_time=0.740000|duration=1800|duration_time=0.020000|size=828|pos=36472|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:92d1d4ad -packet|codec_type=audio|stream_index=0|pts=68400|pts_time=0.760000|dts=68400|dts_time=0.760000|duration=1800|duration_time=0.020000|size=828|pos=37412|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3752c787 -packet|codec_type=audio|stream_index=0|pts=70200|pts_time=0.780000|dts=70200|dts_time=0.780000|duration=1800|duration_time=0.020000|size=942|pos=38352|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ab24f03b -packet|codec_type=audio|stream_index=0|pts=72000|pts_time=0.800000|dts=72000|dts_time=0.800000|duration=1800|duration_time=0.020000|size=809|pos=39856|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:920e19f5 -packet|codec_type=audio|stream_index=0|pts=73800|pts_time=0.820000|dts=73800|dts_time=0.820000|duration=1800|duration_time=0.020000|size=823|pos=40796|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:951b6d50 -packet|codec_type=audio|stream_index=0|pts=75600|pts_time=0.840000|dts=75600|dts_time=0.840000|duration=1800|duration_time=0.020000|size=827|pos=41736|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cfc9eb30 -packet|codec_type=audio|stream_index=0|pts=77400|pts_time=0.860000|dts=77400|dts_time=0.860000|duration=1800|duration_time=0.020000|size=823|pos=42676|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dd66bb72 -packet|codec_type=audio|stream_index=0|pts=79200|pts_time=0.880000|dts=79200|dts_time=0.880000|duration=1800|duration_time=0.020000|size=825|pos=43616|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:67b1c809 -packet|codec_type=audio|stream_index=0|pts=81000|pts_time=0.900000|dts=81000|dts_time=0.900000|duration=1800|duration_time=0.020000|size=828|pos=44556|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:94d441b0 -packet|codec_type=audio|stream_index=0|pts=82800|pts_time=0.920000|dts=82800|dts_time=0.920000|duration=1800|duration_time=0.020000|size=823|pos=45496|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:178471e0 -packet|codec_type=audio|stream_index=0|pts=84600|pts_time=0.940000|dts=84600|dts_time=0.940000|duration=1800|duration_time=0.020000|size=817|pos=46436|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:90e30fb2 -packet|codec_type=audio|stream_index=0|pts=86400|pts_time=0.960000|dts=86400|dts_time=0.960000|duration=1800|duration_time=0.020000|size=813|pos=47376|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dd4e1d03 -packet|codec_type=audio|stream_index=0|pts=88200|pts_time=0.980000|dts=88200|dts_time=0.980000|duration=1800|duration_time=0.020000|size=809|pos=48316|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0e059caf -packet|codec_type=audio|stream_index=0|pts=90000|pts_time=1.000000|dts=90000|dts_time=1.000000|duration=1800|duration_time=0.020000|size=813|pos=49632|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1981fa52 -packet|codec_type=audio|stream_index=0|pts=91800|pts_time=1.020000|dts=91800|dts_time=1.020000|duration=1800|duration_time=0.020000|size=820|pos=50572|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6af0ac25 -packet|codec_type=audio|stream_index=0|pts=93600|pts_time=1.040000|dts=93600|dts_time=1.040000|duration=1800|duration_time=0.020000|size=818|pos=51512|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4ed14497 -packet|codec_type=audio|stream_index=0|pts=95400|pts_time=1.060000|dts=95400|dts_time=1.060000|duration=1800|duration_time=0.020000|size=825|pos=52452|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b1712b61 -packet|codec_type=audio|stream_index=0|pts=97200|pts_time=1.080000|dts=97200|dts_time=1.080000|duration=1800|duration_time=0.020000|size=808|pos=53392|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:97469bbe -packet|codec_type=audio|stream_index=0|pts=99000|pts_time=1.100000|dts=99000|dts_time=1.100000|duration=1800|duration_time=0.020000|size=774|pos=54332|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f2f922fc -packet|codec_type=audio|stream_index=0|pts=100800|pts_time=1.120000|dts=100800|dts_time=1.120000|duration=1800|duration_time=0.020000|size=774|pos=55272|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:024f521d -packet|codec_type=audio|stream_index=0|pts=102600|pts_time=1.140000|dts=102600|dts_time=1.140000|duration=1800|duration_time=0.020000|size=777|pos=56212|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:674d82ba -packet|codec_type=audio|stream_index=0|pts=104400|pts_time=1.160000|dts=104400|dts_time=1.160000|duration=1800|duration_time=0.020000|size=776|pos=57152|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:79409537 -packet|codec_type=audio|stream_index=0|pts=106200|pts_time=1.180000|dts=106200|dts_time=1.180000|duration=1800|duration_time=0.020000|size=779|pos=58092|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:aad393ee -packet|codec_type=audio|stream_index=0|pts=108000|pts_time=1.200000|dts=108000|dts_time=1.200000|duration=1800|duration_time=0.020000|size=779|pos=59408|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9e2dee75 -packet|codec_type=audio|stream_index=0|pts=109800|pts_time=1.220000|dts=109800|dts_time=1.220000|duration=1800|duration_time=0.020000|size=774|pos=60348|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1d8953b4 -packet|codec_type=audio|stream_index=0|pts=111600|pts_time=1.240000|dts=111600|dts_time=1.240000|duration=1800|duration_time=0.020000|size=772|pos=61288|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3f191e37 -packet|codec_type=audio|stream_index=0|pts=113400|pts_time=1.260000|dts=113400|dts_time=1.260000|duration=1800|duration_time=0.020000|size=779|pos=62228|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8e05df12 -packet|codec_type=audio|stream_index=0|pts=115200|pts_time=1.280000|dts=115200|dts_time=1.280000|duration=1800|duration_time=0.020000|size=774|pos=63168|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d3d2e07c -packet|codec_type=audio|stream_index=0|pts=117000|pts_time=1.300000|dts=117000|dts_time=1.300000|duration=1800|duration_time=0.020000|size=772|pos=64108|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:22e0dee4 -packet|codec_type=audio|stream_index=0|pts=118800|pts_time=1.320000|dts=118800|dts_time=1.320000|duration=1800|duration_time=0.020000|size=771|pos=65048|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7e1fae18 -packet|codec_type=audio|stream_index=0|pts=120600|pts_time=1.340000|dts=120600|dts_time=1.340000|duration=1800|duration_time=0.020000|size=776|pos=65988|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:213724a0 -packet|codec_type=audio|stream_index=0|pts=122400|pts_time=1.360000|dts=122400|dts_time=1.360000|duration=1800|duration_time=0.020000|size=776|pos=66928|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f6018f97 -packet|codec_type=audio|stream_index=0|pts=124200|pts_time=1.380000|dts=124200|dts_time=1.380000|duration=1800|duration_time=0.020000|size=777|pos=67868|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d917e577 -packet|codec_type=audio|stream_index=0|pts=126000|pts_time=1.400000|dts=126000|dts_time=1.400000|duration=1800|duration_time=0.020000|size=779|pos=69184|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2860d19c -packet|codec_type=audio|stream_index=0|pts=127800|pts_time=1.420000|dts=127800|dts_time=1.420000|duration=1800|duration_time=0.020000|size=779|pos=70124|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:799e404b -packet|codec_type=audio|stream_index=0|pts=129600|pts_time=1.440000|dts=129600|dts_time=1.440000|duration=1800|duration_time=0.020000|size=774|pos=71064|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a4c43eaa -packet|codec_type=audio|stream_index=0|pts=131400|pts_time=1.460000|dts=131400|dts_time=1.460000|duration=1800|duration_time=0.020000|size=779|pos=72004|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4aa2d0c3 -packet|codec_type=audio|stream_index=0|pts=133200|pts_time=1.480000|dts=133200|dts_time=1.480000|duration=1800|duration_time=0.020000|size=782|pos=72944|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b5e19460 -packet|codec_type=audio|stream_index=0|pts=135000|pts_time=1.500000|dts=135000|dts_time=1.500000|duration=1800|duration_time=0.020000|size=776|pos=73884|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:32445f6b -packet|codec_type=audio|stream_index=0|pts=136800|pts_time=1.520000|dts=136800|dts_time=1.520000|duration=1800|duration_time=0.020000|size=778|pos=74824|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6f370fec -packet|codec_type=audio|stream_index=0|pts=138600|pts_time=1.540000|dts=138600|dts_time=1.540000|duration=1800|duration_time=0.020000|size=777|pos=75764|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:43e04e6d -packet|codec_type=audio|stream_index=0|pts=140400|pts_time=1.560000|dts=140400|dts_time=1.560000|duration=1800|duration_time=0.020000|size=785|pos=76704|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5ed32f7e -packet|codec_type=audio|stream_index=0|pts=142200|pts_time=1.580000|dts=142200|dts_time=1.580000|duration=1800|duration_time=0.020000|size=782|pos=77644|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ead85ef4 -packet|codec_type=audio|stream_index=0|pts=144000|pts_time=1.600000|dts=144000|dts_time=1.600000|duration=1800|duration_time=0.020000|size=782|pos=78960|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5f283747 -packet|codec_type=audio|stream_index=0|pts=145800|pts_time=1.620000|dts=145800|dts_time=1.620000|duration=1800|duration_time=0.020000|size=780|pos=79900|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f4aa30a5 -packet|codec_type=audio|stream_index=0|pts=147600|pts_time=1.640000|dts=147600|dts_time=1.640000|duration=1800|duration_time=0.020000|size=776|pos=80840|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ad09e32c -packet|codec_type=audio|stream_index=0|pts=149400|pts_time=1.660000|dts=149400|dts_time=1.660000|duration=1800|duration_time=0.020000|size=780|pos=81780|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:57f8004d -packet|codec_type=audio|stream_index=0|pts=151200|pts_time=1.680000|dts=151200|dts_time=1.680000|duration=1800|duration_time=0.020000|size=784|pos=82720|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d862a139 -packet|codec_type=audio|stream_index=0|pts=153000|pts_time=1.700000|dts=153000|dts_time=1.700000|duration=1800|duration_time=0.020000|size=776|pos=83660|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:29ebd249 -packet|codec_type=audio|stream_index=0|pts=154800|pts_time=1.720000|dts=154800|dts_time=1.720000|duration=1800|duration_time=0.020000|size=777|pos=84600|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5af83f3e -packet|codec_type=audio|stream_index=0|pts=156600|pts_time=1.740000|dts=156600|dts_time=1.740000|duration=1800|duration_time=0.020000|size=783|pos=85540|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:78784213 -packet|codec_type=audio|stream_index=0|pts=158400|pts_time=1.760000|dts=158400|dts_time=1.760000|duration=1800|duration_time=0.020000|size=780|pos=86480|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cccb4c08 -packet|codec_type=audio|stream_index=0|pts=160200|pts_time=1.780000|dts=160200|dts_time=1.780000|duration=1800|duration_time=0.020000|size=782|pos=87420|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:36520804 -packet|codec_type=audio|stream_index=0|pts=162000|pts_time=1.800000|dts=162000|dts_time=1.800000|duration=1800|duration_time=0.020000|size=848|pos=88736|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a9235baa -packet|codec_type=audio|stream_index=0|pts=163800|pts_time=1.820000|dts=163800|dts_time=1.820000|duration=1800|duration_time=0.020000|size=849|pos=89676|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:57ae2eef -packet|codec_type=audio|stream_index=0|pts=165600|pts_time=1.840000|dts=165600|dts_time=1.840000|duration=1800|duration_time=0.020000|size=783|pos=90616|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:474f3232 -packet|codec_type=audio|stream_index=0|pts=167400|pts_time=1.860000|dts=167400|dts_time=1.860000|duration=1800|duration_time=0.020000|size=784|pos=91556|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9a51d488 -packet|codec_type=audio|stream_index=0|pts=169200|pts_time=1.880000|dts=169200|dts_time=1.880000|duration=1800|duration_time=0.020000|size=785|pos=92496|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:919bc794 -packet|codec_type=audio|stream_index=0|pts=171000|pts_time=1.900000|dts=171000|dts_time=1.900000|duration=1800|duration_time=0.020000|size=783|pos=93436|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ed8214ad -packet|codec_type=audio|stream_index=0|pts=172800|pts_time=1.920000|dts=172800|dts_time=1.920000|duration=1800|duration_time=0.020000|size=876|pos=94376|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:72fcce4c -packet|codec_type=audio|stream_index=0|pts=174600|pts_time=1.940000|dts=174600|dts_time=1.940000|duration=1800|duration_time=0.020000|size=776|pos=95316|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2a0143f4 -packet|codec_type=audio|stream_index=0|pts=176400|pts_time=1.960000|dts=176400|dts_time=1.960000|duration=1800|duration_time=0.020000|size=787|pos=96256|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:94f1aae1 -packet|codec_type=audio|stream_index=0|pts=178200|pts_time=1.980000|dts=178200|dts_time=1.980000|duration=1800|duration_time=0.020000|size=781|pos=97196|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5565737b -packet|codec_type=audio|stream_index=0|pts=180000|pts_time=2.000000|dts=180000|dts_time=2.000000|duration=1800|duration_time=0.020000|size=852|pos=98512|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:daea61be -packet|codec_type=audio|stream_index=0|pts=181800|pts_time=2.020000|dts=181800|dts_time=2.020000|duration=1800|duration_time=0.020000|size=849|pos=99452|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ee704432 -packet|codec_type=audio|stream_index=0|pts=183600|pts_time=2.040000|dts=183600|dts_time=2.040000|duration=1800|duration_time=0.020000|size=873|pos=100392|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:472aa214 -packet|codec_type=audio|stream_index=0|pts=185400|pts_time=2.060000|dts=185400|dts_time=2.060000|duration=1800|duration_time=0.020000|size=843|pos=101332|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0b046703 -packet|codec_type=audio|stream_index=0|pts=187200|pts_time=2.080000|dts=187200|dts_time=2.080000|duration=1800|duration_time=0.020000|size=841|pos=102272|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:59bf9bd5 -packet|codec_type=audio|stream_index=0|pts=189000|pts_time=2.100000|dts=189000|dts_time=2.100000|duration=1800|duration_time=0.020000|size=777|pos=103212|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:808ee658 -packet|codec_type=audio|stream_index=0|pts=190800|pts_time=2.120000|dts=190800|dts_time=2.120000|duration=1800|duration_time=0.020000|size=846|pos=104152|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:db581c04 -packet|codec_type=audio|stream_index=0|pts=192600|pts_time=2.140000|dts=192600|dts_time=2.140000|duration=1800|duration_time=0.020000|size=782|pos=105092|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:768d8d82 -packet|codec_type=audio|stream_index=0|pts=194400|pts_time=2.160000|dts=194400|dts_time=2.160000|duration=1800|duration_time=0.020000|size=869|pos=106032|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:263c4a83 -packet|codec_type=audio|stream_index=0|pts=196200|pts_time=2.180000|dts=196200|dts_time=2.180000|duration=1800|duration_time=0.020000|size=778|pos=106972|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4017dc55 -packet|codec_type=audio|stream_index=0|pts=198000|pts_time=2.200000|dts=198000|dts_time=2.200000|duration=1800|duration_time=0.020000|size=777|pos=108288|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e6b3c398 -packet|codec_type=audio|stream_index=0|pts=199800|pts_time=2.220000|dts=199800|dts_time=2.220000|duration=1800|duration_time=0.020000|size=870|pos=109228|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:37eda28b -packet|codec_type=audio|stream_index=0|pts=201600|pts_time=2.240000|dts=201600|dts_time=2.240000|duration=1800|duration_time=0.020000|size=782|pos=110168|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:aa3b5d94 -packet|codec_type=audio|stream_index=0|pts=203400|pts_time=2.260000|dts=203400|dts_time=2.260000|duration=1800|duration_time=0.020000|size=777|pos=111108|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:fc87dbf0 -packet|codec_type=audio|stream_index=0|pts=205200|pts_time=2.280000|dts=205200|dts_time=2.280000|duration=1800|duration_time=0.020000|size=869|pos=112048|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:75795b7e -packet|codec_type=audio|stream_index=0|pts=207000|pts_time=2.300000|dts=207000|dts_time=2.300000|duration=1800|duration_time=0.020000|size=772|pos=112988|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a8a34bb9 -packet|codec_type=audio|stream_index=0|pts=208800|pts_time=2.320000|dts=208800|dts_time=2.320000|duration=1800|duration_time=0.020000|size=775|pos=113928|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2ebc4e7b -packet|codec_type=audio|stream_index=0|pts=210600|pts_time=2.340000|dts=210600|dts_time=2.340000|duration=1800|duration_time=0.020000|size=771|pos=114868|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:53744d32 -packet|codec_type=audio|stream_index=0|pts=212400|pts_time=2.360000|dts=212400|dts_time=2.360000|duration=1800|duration_time=0.020000|size=778|pos=115808|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d32f77ce -packet|codec_type=audio|stream_index=0|pts=214200|pts_time=2.380000|dts=214200|dts_time=2.380000|duration=1800|duration_time=0.020000|size=867|pos=116748|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f582287c -packet|codec_type=audio|stream_index=0|pts=216000|pts_time=2.400000|dts=216000|dts_time=2.400000|duration=1800|duration_time=0.020000|size=778|pos=118064|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:144b9c4b -packet|codec_type=audio|stream_index=0|pts=217800|pts_time=2.420000|dts=217800|dts_time=2.420000|duration=1800|duration_time=0.020000|size=774|pos=119004|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0cca881f -packet|codec_type=audio|stream_index=0|pts=219600|pts_time=2.440000|dts=219600|dts_time=2.440000|duration=1800|duration_time=0.020000|size=775|pos=119944|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cddb1237 -packet|codec_type=audio|stream_index=0|pts=221400|pts_time=2.460000|dts=221400|dts_time=2.460000|duration=1800|duration_time=0.020000|size=774|pos=120884|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:10310b68 -packet|codec_type=audio|stream_index=0|pts=223200|pts_time=2.480000|dts=223200|dts_time=2.480000|duration=1800|duration_time=0.020000|size=774|pos=121824|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dea871f8 -packet|codec_type=audio|stream_index=0|pts=225000|pts_time=2.500000|dts=225000|dts_time=2.500000|duration=1800|duration_time=0.020000|size=772|pos=122764|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d27e8c99 -packet|codec_type=audio|stream_index=0|pts=226800|pts_time=2.520000|dts=226800|dts_time=2.520000|duration=1800|duration_time=0.020000|size=774|pos=123704|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3143b0e0 -packet|codec_type=audio|stream_index=0|pts=228600|pts_time=2.540000|dts=228600|dts_time=2.540000|duration=1800|duration_time=0.020000|size=775|pos=124644|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ebc2c2e6 -packet|codec_type=audio|stream_index=0|pts=230400|pts_time=2.560000|dts=230400|dts_time=2.560000|duration=1800|duration_time=0.020000|size=773|pos=125584|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dc63972d -packet|codec_type=audio|stream_index=0|pts=232200|pts_time=2.580000|dts=232200|dts_time=2.580000|duration=1800|duration_time=0.020000|size=773|pos=126524|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6b141c19 -packet|codec_type=audio|stream_index=0|pts=234000|pts_time=2.600000|dts=234000|dts_time=2.600000|duration=1800|duration_time=0.020000|size=769|pos=127840|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:752ada1e -packet|codec_type=audio|stream_index=0|pts=235800|pts_time=2.620000|dts=235800|dts_time=2.620000|duration=1800|duration_time=0.020000|size=774|pos=128780|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:36d20d37 -packet|codec_type=audio|stream_index=0|pts=237600|pts_time=2.640000|dts=237600|dts_time=2.640000|duration=1800|duration_time=0.020000|size=779|pos=129720|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1455dc2e -packet|codec_type=audio|stream_index=0|pts=239400|pts_time=2.660000|dts=239400|dts_time=2.660000|duration=1800|duration_time=0.020000|size=782|pos=130660|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c6ffd5fe -packet|codec_type=audio|stream_index=0|pts=241200|pts_time=2.680000|dts=241200|dts_time=2.680000|duration=1800|duration_time=0.020000|size=779|pos=131600|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e4c83b97 -packet|codec_type=audio|stream_index=0|pts=243000|pts_time=2.700000|dts=243000|dts_time=2.700000|duration=1800|duration_time=0.020000|size=778|pos=132540|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ee3f9b5a -packet|codec_type=audio|stream_index=0|pts=244800|pts_time=2.720000|dts=244800|dts_time=2.720000|duration=1800|duration_time=0.020000|size=771|pos=133480|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7d0ee8b4 -packet|codec_type=audio|stream_index=0|pts=246600|pts_time=2.740000|dts=246600|dts_time=2.740000|duration=1800|duration_time=0.020000|size=775|pos=134420|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:685b64d8 -packet|codec_type=audio|stream_index=0|pts=248400|pts_time=2.760000|dts=248400|dts_time=2.760000|duration=1800|duration_time=0.020000|size=777|pos=135360|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ab680b3f -packet|codec_type=audio|stream_index=0|pts=250200|pts_time=2.780000|dts=250200|dts_time=2.780000|duration=1800|duration_time=0.020000|size=773|pos=136300|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8485bf04 -packet|codec_type=audio|stream_index=0|pts=252000|pts_time=2.800000|dts=252000|dts_time=2.800000|duration=1800|duration_time=0.020000|size=777|pos=137616|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:60e3ab3b -packet|codec_type=audio|stream_index=0|pts=253800|pts_time=2.820000|dts=253800|dts_time=2.820000|duration=1800|duration_time=0.020000|size=777|pos=138556|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cbacc337 -packet|codec_type=audio|stream_index=0|pts=255600|pts_time=2.840000|dts=255600|dts_time=2.840000|duration=1800|duration_time=0.020000|size=908|pos=139496|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:852be5a3 -packet|codec_type=audio|stream_index=0|pts=257400|pts_time=2.860000|dts=257400|dts_time=2.860000|duration=1800|duration_time=0.020000|size=777|pos=140624|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:743f04a8 -packet|codec_type=audio|stream_index=0|pts=259200|pts_time=2.880000|dts=259200|dts_time=2.880000|duration=1800|duration_time=0.020000|size=772|pos=141564|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0ed88196 -packet|codec_type=audio|stream_index=0|pts=261000|pts_time=2.900000|dts=261000|dts_time=2.900000|duration=1800|duration_time=0.020000|size=778|pos=142504|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bf13126e -packet|codec_type=audio|stream_index=0|pts=262800|pts_time=2.920000|dts=262800|dts_time=2.920000|duration=1800|duration_time=0.020000|size=776|pos=143444|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dd160d29 -packet|codec_type=audio|stream_index=0|pts=264600|pts_time=2.940000|dts=264600|dts_time=2.940000|duration=1800|duration_time=0.020000|size=775|pos=144384|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:65833aa7 -packet|codec_type=audio|stream_index=0|pts=266400|pts_time=2.960000|dts=266400|dts_time=2.960000|duration=1800|duration_time=0.020000|size=772|pos=145324|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9343d3d2 -packet|codec_type=audio|stream_index=0|pts=268200|pts_time=2.980000|dts=268200|dts_time=2.980000|duration=1800|duration_time=0.020000|size=778|pos=146264|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7da0cd8d -packet|codec_type=audio|stream_index=0|pts=270000|pts_time=3.000000|dts=270000|dts_time=3.000000|duration=1800|duration_time=0.020000|size=808|pos=147580|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8a3298b7 -packet|codec_type=audio|stream_index=0|pts=271800|pts_time=3.020000|dts=271800|dts_time=3.020000|duration=1800|duration_time=0.020000|size=836|pos=148520|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:604d40c4 -packet|codec_type=audio|stream_index=0|pts=273600|pts_time=3.040000|dts=273600|dts_time=3.040000|duration=1800|duration_time=0.020000|size=913|pos=149460|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ecd7b491 -packet|codec_type=audio|stream_index=0|pts=275400|pts_time=3.060000|dts=275400|dts_time=3.060000|duration=1800|duration_time=0.020000|size=837|pos=150588|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f8907616 -packet|codec_type=audio|stream_index=0|pts=277200|pts_time=3.080000|dts=277200|dts_time=3.080000|duration=1800|duration_time=0.020000|size=834|pos=151528|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c6701edc -packet|codec_type=audio|stream_index=0|pts=279000|pts_time=3.100000|dts=279000|dts_time=3.100000|duration=1800|duration_time=0.020000|size=836|pos=152468|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ed85bdee -packet|codec_type=audio|stream_index=0|pts=280800|pts_time=3.120000|dts=280800|dts_time=3.120000|duration=1800|duration_time=0.020000|size=832|pos=153408|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d9ea8517 -packet|codec_type=audio|stream_index=0|pts=282600|pts_time=3.140000|dts=282600|dts_time=3.140000|duration=1800|duration_time=0.020000|size=826|pos=154348|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e396092f -packet|codec_type=audio|stream_index=0|pts=284400|pts_time=3.160000|dts=284400|dts_time=3.160000|duration=1800|duration_time=0.020000|size=817|pos=155288|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1c628f31 -packet|codec_type=audio|stream_index=0|pts=286200|pts_time=3.180000|dts=286200|dts_time=3.180000|duration=1800|duration_time=0.020000|size=825|pos=156228|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:52183b8f -packet|codec_type=audio|stream_index=0|pts=288000|pts_time=3.200000|dts=288000|dts_time=3.200000|duration=1800|duration_time=0.020000|size=824|pos=157544|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bbae2882 -packet|codec_type=audio|stream_index=0|pts=289800|pts_time=3.220000|dts=289800|dts_time=3.220000|duration=1800|duration_time=0.020000|size=828|pos=158484|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bb5a7486 -packet|codec_type=audio|stream_index=0|pts=291600|pts_time=3.240000|dts=291600|dts_time=3.240000|duration=1800|duration_time=0.020000|size=833|pos=159424|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ead8306a -packet|codec_type=audio|stream_index=0|pts=293400|pts_time=3.260000|dts=293400|dts_time=3.260000|duration=1800|duration_time=0.020000|size=832|pos=160364|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:82db1098 -packet|codec_type=audio|stream_index=0|pts=295200|pts_time=3.280000|dts=295200|dts_time=3.280000|duration=1800|duration_time=0.020000|size=896|pos=161304|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:688f5cb6 -packet|codec_type=audio|stream_index=0|pts=297000|pts_time=3.300000|dts=297000|dts_time=3.300000|duration=1800|duration_time=0.020000|size=824|pos=162244|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:fdf34c0b -packet|codec_type=audio|stream_index=0|pts=298800|pts_time=3.320000|dts=298800|dts_time=3.320000|duration=1800|duration_time=0.020000|size=812|pos=163184|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:802e95d1 -packet|codec_type=audio|stream_index=0|pts=300600|pts_time=3.340000|dts=300600|dts_time=3.340000|duration=1800|duration_time=0.020000|size=821|pos=164124|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:141404b8 -packet|codec_type=audio|stream_index=0|pts=302400|pts_time=3.360000|dts=302400|dts_time=3.360000|duration=1800|duration_time=0.020000|size=883|pos=165064|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3e39e373 -packet|codec_type=audio|stream_index=0|pts=304200|pts_time=3.380000|dts=304200|dts_time=3.380000|duration=1800|duration_time=0.020000|size=820|pos=166004|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ce8d8234 -packet|codec_type=audio|stream_index=0|pts=306000|pts_time=3.400000|dts=306000|dts_time=3.400000|duration=1800|duration_time=0.020000|size=835|pos=167320|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0f3c194d -packet|codec_type=audio|stream_index=0|pts=307800|pts_time=3.420000|dts=307800|dts_time=3.420000|duration=1800|duration_time=0.020000|size=833|pos=168260|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3d5d60c4 -packet|codec_type=audio|stream_index=0|pts=309600|pts_time=3.440000|dts=309600|dts_time=3.440000|duration=1800|duration_time=0.020000|size=830|pos=169200|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f66b2c9f -packet|codec_type=audio|stream_index=0|pts=311400|pts_time=3.460000|dts=311400|dts_time=3.460000|duration=1800|duration_time=0.020000|size=820|pos=170140|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:44eb2398 -packet|codec_type=audio|stream_index=0|pts=313200|pts_time=3.480000|dts=313200|dts_time=3.480000|duration=1800|duration_time=0.020000|size=815|pos=171080|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cec1f69c -packet|codec_type=audio|stream_index=0|pts=315000|pts_time=3.500000|dts=315000|dts_time=3.500000|duration=1800|duration_time=0.020000|size=827|pos=172020|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:57096eb1 -packet|codec_type=audio|stream_index=0|pts=316800|pts_time=3.520000|dts=316800|dts_time=3.520000|duration=1800|duration_time=0.020000|size=819|pos=172960|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:66999a29 -packet|codec_type=audio|stream_index=0|pts=318600|pts_time=3.540000|dts=318600|dts_time=3.540000|duration=1800|duration_time=0.020000|size=828|pos=173900|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0e598023 -packet|codec_type=audio|stream_index=0|pts=320400|pts_time=3.560000|dts=320400|dts_time=3.560000|duration=1800|duration_time=0.020000|size=830|pos=174840|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8e728d2b -packet|codec_type=audio|stream_index=0|pts=322200|pts_time=3.580000|dts=322200|dts_time=3.580000|duration=1800|duration_time=0.020000|size=828|pos=175780|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7e7549e3 -packet|codec_type=audio|stream_index=0|pts=324000|pts_time=3.600000|dts=324000|dts_time=3.600000|duration=1800|duration_time=0.020000|size=829|pos=177096|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:62f96c18 -packet|codec_type=audio|stream_index=0|pts=325800|pts_time=3.620000|dts=325800|dts_time=3.620000|duration=1800|duration_time=0.020000|size=820|pos=178036|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:48d04b8a -packet|codec_type=audio|stream_index=0|pts=327600|pts_time=3.640000|dts=327600|dts_time=3.640000|duration=1800|duration_time=0.020000|size=823|pos=178976|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7937563e -packet|codec_type=audio|stream_index=0|pts=329400|pts_time=3.660000|dts=329400|dts_time=3.660000|duration=1800|duration_time=0.020000|size=798|pos=179916|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8e573ad0 -packet|codec_type=audio|stream_index=0|pts=331200|pts_time=3.680000|dts=331200|dts_time=3.680000|duration=1800|duration_time=0.020000|size=772|pos=180856|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ece4d7e7 -packet|codec_type=audio|stream_index=0|pts=333000|pts_time=3.700000|dts=333000|dts_time=3.700000|duration=1800|duration_time=0.020000|size=779|pos=181796|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4ca26e7d -packet|codec_type=audio|stream_index=0|pts=334800|pts_time=3.720000|dts=334800|dts_time=3.720000|duration=1800|duration_time=0.020000|size=774|pos=182736|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8c347b2d -packet|codec_type=audio|stream_index=0|pts=336600|pts_time=3.740000|dts=336600|dts_time=3.740000|duration=1800|duration_time=0.020000|size=907|pos=183676|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b50e55b8 -packet|codec_type=audio|stream_index=0|pts=338400|pts_time=3.760000|dts=338400|dts_time=3.760000|duration=1800|duration_time=0.020000|size=772|pos=184804|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e2ff539f -packet|codec_type=audio|stream_index=0|pts=340200|pts_time=3.780000|dts=340200|dts_time=3.780000|duration=1800|duration_time=0.020000|size=777|pos=185744|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f86e1c5a -packet|codec_type=audio|stream_index=0|pts=342000|pts_time=3.800000|dts=342000|dts_time=3.800000|duration=1800|duration_time=0.020000|size=777|pos=187060|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ff858811 -packet|codec_type=audio|stream_index=0|pts=343800|pts_time=3.820000|dts=343800|dts_time=3.820000|duration=1800|duration_time=0.020000|size=777|pos=188000|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4b0da83e -packet|codec_type=audio|stream_index=0|pts=345600|pts_time=3.840000|dts=345600|dts_time=3.840000|duration=1800|duration_time=0.020000|size=775|pos=188940|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:605a41a9 -packet|codec_type=audio|stream_index=0|pts=347400|pts_time=3.860000|dts=347400|dts_time=3.860000|duration=1800|duration_time=0.020000|size=773|pos=189880|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d32c5756 -packet|codec_type=audio|stream_index=0|pts=349200|pts_time=3.880000|dts=349200|dts_time=3.880000|duration=1800|duration_time=0.020000|size=777|pos=190820|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:92c557ef -packet|codec_type=audio|stream_index=0|pts=351000|pts_time=3.900000|dts=351000|dts_time=3.900000|duration=1800|duration_time=0.020000|size=777|pos=191760|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c16056ca -packet|codec_type=audio|stream_index=0|pts=352800|pts_time=3.920000|dts=352800|dts_time=3.920000|duration=1800|duration_time=0.020000|size=776|pos=192700|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c84a2e99 -packet|codec_type=audio|stream_index=0|pts=354600|pts_time=3.940000|dts=354600|dts_time=3.940000|duration=1800|duration_time=0.020000|size=780|pos=193640|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d59309d0 -packet|codec_type=audio|stream_index=0|pts=356400|pts_time=3.960000|dts=356400|dts_time=3.960000|duration=1800|duration_time=0.020000|size=776|pos=194580|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8312e1ba -packet|codec_type=audio|stream_index=0|pts=358200|pts_time=3.980000|dts=358200|dts_time=3.980000|duration=1800|duration_time=0.020000|size=778|pos=195520|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:12d77a3e -packet|codec_type=audio|stream_index=0|pts=360000|pts_time=4.000000|dts=360000|dts_time=4.000000|duration=1800|duration_time=0.020000|size=774|pos=196836|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:86b417d4 -packet|codec_type=audio|stream_index=0|pts=361800|pts_time=4.020000|dts=361800|dts_time=4.020000|duration=1800|duration_time=0.020000|size=778|pos=197776|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a66ed4cf -packet|codec_type=audio|stream_index=0|pts=363600|pts_time=4.040000|dts=363600|dts_time=4.040000|duration=1800|duration_time=0.020000|size=777|pos=198716|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b686a5ca -packet|codec_type=audio|stream_index=0|pts=365400|pts_time=4.060000|dts=365400|dts_time=4.060000|duration=1800|duration_time=0.020000|size=773|pos=199656|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:261ce45b -packet|codec_type=audio|stream_index=0|pts=367200|pts_time=4.080000|dts=367200|dts_time=4.080000|duration=1800|duration_time=0.020000|size=782|pos=200596|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cbfbd1bf -packet|codec_type=audio|stream_index=0|pts=369000|pts_time=4.100000|dts=369000|dts_time=4.100000|duration=1800|duration_time=0.020000|size=780|pos=201536|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:20b5484f -packet|codec_type=audio|stream_index=0|pts=370800|pts_time=4.120000|dts=370800|dts_time=4.120000|duration=1800|duration_time=0.020000|size=777|pos=202476|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c4d54099 -packet|codec_type=audio|stream_index=0|pts=372600|pts_time=4.140000|dts=372600|dts_time=4.140000|duration=1800|duration_time=0.020000|size=775|pos=203416|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cb665fdf -packet|codec_type=audio|stream_index=0|pts=374400|pts_time=4.160000|dts=374400|dts_time=4.160000|duration=1800|duration_time=0.020000|size=777|pos=204356|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0271ab1f -packet|codec_type=audio|stream_index=0|pts=376200|pts_time=4.180000|dts=376200|dts_time=4.180000|duration=1800|duration_time=0.020000|size=776|pos=205296|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a82f4ab4 -packet|codec_type=audio|stream_index=0|pts=378000|pts_time=4.200000|dts=378000|dts_time=4.200000|duration=1800|duration_time=0.020000|size=778|pos=206612|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a1e09e3b -packet|codec_type=audio|stream_index=0|pts=379800|pts_time=4.220000|dts=379800|dts_time=4.220000|duration=1800|duration_time=0.020000|size=775|pos=207552|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7b297a73 -packet|codec_type=audio|stream_index=0|pts=381600|pts_time=4.240000|dts=381600|dts_time=4.240000|duration=1800|duration_time=0.020000|size=775|pos=208492|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2165ebef -packet|codec_type=audio|stream_index=0|pts=383400|pts_time=4.260000|dts=383400|dts_time=4.260000|duration=1800|duration_time=0.020000|size=779|pos=209432|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b802ae36 -packet|codec_type=audio|stream_index=0|pts=385200|pts_time=4.280000|dts=385200|dts_time=4.280000|duration=1800|duration_time=0.020000|size=779|pos=210372|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:36ca4657 -packet|codec_type=audio|stream_index=0|pts=387000|pts_time=4.300000|dts=387000|dts_time=4.300000|duration=1800|duration_time=0.020000|size=778|pos=211312|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2fe8a70c -packet|codec_type=audio|stream_index=0|pts=388800|pts_time=4.320000|dts=388800|dts_time=4.320000|duration=1800|duration_time=0.020000|size=780|pos=212252|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:19c3bc8c -packet|codec_type=audio|stream_index=0|pts=390600|pts_time=4.340000|dts=390600|dts_time=4.340000|duration=1800|duration_time=0.020000|size=778|pos=213192|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3b6c08d8 -packet|codec_type=audio|stream_index=0|pts=392400|pts_time=4.360000|dts=392400|dts_time=4.360000|duration=1800|duration_time=0.020000|size=776|pos=214132|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:851471f3 -packet|codec_type=audio|stream_index=0|pts=394200|pts_time=4.380000|dts=394200|dts_time=4.380000|duration=1800|duration_time=0.020000|size=777|pos=215072|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5d33a166 -packet|codec_type=audio|stream_index=0|pts=396000|pts_time=4.400000|dts=396000|dts_time=4.400000|duration=1800|duration_time=0.020000|size=841|pos=216388|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d0d1a21b -packet|codec_type=audio|stream_index=0|pts=397800|pts_time=4.420000|dts=397800|dts_time=4.420000|duration=1800|duration_time=0.020000|size=777|pos=217328|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c21a3376 -packet|codec_type=audio|stream_index=0|pts=399600|pts_time=4.440000|dts=399600|dts_time=4.440000|duration=1800|duration_time=0.020000|size=780|pos=218268|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0daaead6 -packet|codec_type=audio|stream_index=0|pts=401400|pts_time=4.460000|dts=401400|dts_time=4.460000|duration=1800|duration_time=0.020000|size=777|pos=219208|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:01c07956 -packet|codec_type=audio|stream_index=0|pts=403200|pts_time=4.480000|dts=403200|dts_time=4.480000|duration=1800|duration_time=0.020000|size=777|pos=220148|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f5b429c1 -packet|codec_type=audio|stream_index=0|pts=405000|pts_time=4.500000|dts=405000|dts_time=4.500000|duration=1800|duration_time=0.020000|size=778|pos=221088|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a46831d9 -packet|codec_type=audio|stream_index=0|pts=406800|pts_time=4.520000|dts=406800|dts_time=4.520000|duration=1800|duration_time=0.020000|size=778|pos=222028|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:555d2cb1 -packet|codec_type=audio|stream_index=0|pts=408600|pts_time=4.540000|dts=408600|dts_time=4.540000|duration=1800|duration_time=0.020000|size=779|pos=222968|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7670785c -packet|codec_type=audio|stream_index=0|pts=410400|pts_time=4.560000|dts=410400|dts_time=4.560000|duration=1800|duration_time=0.020000|size=776|pos=223908|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:52a244cd -packet|codec_type=audio|stream_index=0|pts=412200|pts_time=4.580000|dts=412200|dts_time=4.580000|duration=1800|duration_time=0.020000|size=784|pos=224848|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7ad67c41 -packet|codec_type=audio|stream_index=0|pts=414000|pts_time=4.600000|dts=414000|dts_time=4.600000|duration=1800|duration_time=0.020000|size=776|pos=226164|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ddc7990b -packet|codec_type=audio|stream_index=0|pts=415800|pts_time=4.620000|dts=415800|dts_time=4.620000|duration=1800|duration_time=0.020000|size=778|pos=227104|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8a49bff6 -packet|codec_type=audio|stream_index=0|pts=417600|pts_time=4.640000|dts=417600|dts_time=4.640000|duration=1800|duration_time=0.020000|size=775|pos=228044|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:258dc60a -packet|codec_type=audio|stream_index=0|pts=419400|pts_time=4.660000|dts=419400|dts_time=4.660000|duration=1800|duration_time=0.020000|size=781|pos=228984|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2dd6d159 -packet|codec_type=audio|stream_index=0|pts=421200|pts_time=4.680000|dts=421200|dts_time=4.680000|duration=1800|duration_time=0.020000|size=779|pos=229924|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:359ba790 -packet|codec_type=audio|stream_index=0|pts=423000|pts_time=4.700000|dts=423000|dts_time=4.700000|duration=1800|duration_time=0.020000|size=846|pos=230864|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:68cbef69 -packet|codec_type=audio|stream_index=0|pts=424800|pts_time=4.720000|dts=424800|dts_time=4.720000|duration=1800|duration_time=0.020000|size=776|pos=231804|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cbce1c41 -packet|codec_type=audio|stream_index=0|pts=426600|pts_time=4.740000|dts=426600|dts_time=4.740000|duration=1800|duration_time=0.020000|size=781|pos=232744|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a9a19b23 -packet|codec_type=audio|stream_index=0|pts=428400|pts_time=4.760000|dts=428400|dts_time=4.760000|duration=1800|duration_time=0.020000|size=783|pos=233684|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f31b8def -packet|codec_type=audio|stream_index=0|pts=430200|pts_time=4.780000|dts=430200|dts_time=4.780000|duration=1800|duration_time=0.020000|size=971|pos=234624|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4dd92879 -packet|codec_type=audio|stream_index=0|pts=432000|pts_time=4.800000|dts=432000|dts_time=4.800000|duration=1800|duration_time=0.020000|size=970|pos=236128|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7020e4a7 -packet|codec_type=audio|stream_index=0|pts=433800|pts_time=4.820000|dts=433800|dts_time=4.820000|duration=1800|duration_time=0.020000|size=967|pos=237256|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5f56efad -packet|codec_type=audio|stream_index=0|pts=435600|pts_time=4.840000|dts=435600|dts_time=4.840000|duration=1800|duration_time=0.020000|size=776|pos=238384|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4ae7101d -packet|codec_type=audio|stream_index=0|pts=437400|pts_time=4.860000|dts=437400|dts_time=4.860000|duration=1800|duration_time=0.020000|size=971|pos=239324|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:386c5965 -packet|codec_type=audio|stream_index=0|pts=439200|pts_time=4.880000|dts=439200|dts_time=4.880000|duration=1800|duration_time=0.020000|size=962|pos=240452|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f2701022 -packet|codec_type=audio|stream_index=0|pts=441000|pts_time=4.900000|dts=441000|dts_time=4.900000|duration=1800|duration_time=0.020000|size=964|pos=241580|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:386bfd07 -packet|codec_type=audio|stream_index=0|pts=442800|pts_time=4.920000|dts=442800|dts_time=4.920000|duration=1800|duration_time=0.020000|size=773|pos=242708|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:080e4345 -packet|codec_type=audio|stream_index=0|pts=444600|pts_time=4.940000|dts=444600|dts_time=4.940000|duration=1800|duration_time=0.020000|size=770|pos=243648|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4fbaa6b9 -packet|codec_type=audio|stream_index=0|pts=446400|pts_time=4.960000|dts=446400|dts_time=4.960000|duration=1800|duration_time=0.020000|size=964|pos=244588|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5c879539 -packet|codec_type=audio|stream_index=0|pts=448200|pts_time=4.980000|dts=448200|dts_time=4.980000|duration=1800|duration_time=0.020000|size=958|pos=245716|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dac40562 -packet|codec_type=audio|stream_index=0|pts=450000|pts_time=5.000000|dts=450000|dts_time=5.000000|duration=1800|duration_time=0.020000|size=775|pos=247220|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:31f989e0 -packet|codec_type=audio|stream_index=0|pts=451800|pts_time=5.020000|dts=451800|dts_time=5.020000|duration=1800|duration_time=0.020000|size=775|pos=248160|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0149cc11 -packet|codec_type=audio|stream_index=0|pts=453600|pts_time=5.040000|dts=453600|dts_time=5.040000|duration=1800|duration_time=0.020000|size=966|pos=249100|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1c226514 -packet|codec_type=audio|stream_index=0|pts=455400|pts_time=5.060000|dts=455400|dts_time=5.060000|duration=1800|duration_time=0.020000|size=843|pos=250228|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:991ab49b -packet|codec_type=audio|stream_index=0|pts=457200|pts_time=5.080000|dts=457200|dts_time=5.080000|duration=1800|duration_time=0.020000|size=846|pos=251168|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2803c379 -packet|codec_type=audio|stream_index=0|pts=459000|pts_time=5.100000|dts=459000|dts_time=5.100000|duration=1800|duration_time=0.020000|size=775|pos=252108|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2d95b53b -packet|codec_type=audio|stream_index=0|pts=460800|pts_time=5.120000|dts=460800|dts_time=5.120000|duration=1800|duration_time=0.020000|size=901|pos=253048|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2a40955c -packet|codec_type=audio|stream_index=0|pts=462600|pts_time=5.140000|dts=462600|dts_time=5.140000|duration=1800|duration_time=0.020000|size=958|pos=254176|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b46687d4 -packet|codec_type=audio|stream_index=0|pts=464400|pts_time=5.160000|dts=464400|dts_time=5.160000|duration=1800|duration_time=0.020000|size=770|pos=255304|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c4ec89eb -packet|codec_type=audio|stream_index=0|pts=466200|pts_time=5.180000|dts=466200|dts_time=5.180000|duration=1800|duration_time=0.020000|size=773|pos=256244|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d53fcf9c -packet|codec_type=audio|stream_index=0|pts=468000|pts_time=5.200000|dts=468000|dts_time=5.200000|duration=1800|duration_time=0.020000|size=768|pos=257560|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:eb9bfc19 -packet|codec_type=audio|stream_index=0|pts=469800|pts_time=5.220000|dts=469800|dts_time=5.220000|duration=1800|duration_time=0.020000|size=776|pos=258500|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:71e70489 -packet|codec_type=audio|stream_index=0|pts=471600|pts_time=5.240000|dts=471600|dts_time=5.240000|duration=1800|duration_time=0.020000|size=771|pos=259440|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:60a96aca -packet|codec_type=audio|stream_index=0|pts=473400|pts_time=5.260000|dts=473400|dts_time=5.260000|duration=1800|duration_time=0.020000|size=772|pos=260380|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ceca878e -packet|codec_type=audio|stream_index=0|pts=475200|pts_time=5.280000|dts=475200|dts_time=5.280000|duration=1800|duration_time=0.020000|size=958|pos=261320|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ab40ffe7 -packet|codec_type=audio|stream_index=0|pts=477000|pts_time=5.300000|dts=477000|dts_time=5.300000|duration=1800|duration_time=0.020000|size=771|pos=262448|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0f8c3162 -packet|codec_type=audio|stream_index=0|pts=478800|pts_time=5.320000|dts=478800|dts_time=5.320000|duration=1800|duration_time=0.020000|size=770|pos=263388|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:af837825 -packet|codec_type=audio|stream_index=0|pts=480600|pts_time=5.340000|dts=480600|dts_time=5.340000|duration=1800|duration_time=0.020000|size=959|pos=264328|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:93a1bea9 -packet|codec_type=audio|stream_index=0|pts=482400|pts_time=5.360000|dts=482400|dts_time=5.360000|duration=1800|duration_time=0.020000|size=769|pos=265456|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e7289ab0 -packet|codec_type=audio|stream_index=0|pts=484200|pts_time=5.380000|dts=484200|dts_time=5.380000|duration=1800|duration_time=0.020000|size=840|pos=266396|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4b39626e -packet|codec_type=audio|stream_index=0|pts=486000|pts_time=5.400000|dts=486000|dts_time=5.400000|duration=1800|duration_time=0.020000|size=769|pos=267712|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f4bc91d6 -packet|codec_type=audio|stream_index=0|pts=487800|pts_time=5.420000|dts=487800|dts_time=5.420000|duration=1800|duration_time=0.020000|size=767|pos=268652|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:68dd482f -packet|codec_type=audio|stream_index=0|pts=489600|pts_time=5.440000|dts=489600|dts_time=5.440000|duration=1800|duration_time=0.020000|size=951|pos=269592|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:61ab6014 -packet|codec_type=audio|stream_index=0|pts=491400|pts_time=5.460000|dts=491400|dts_time=5.460000|duration=1800|duration_time=0.020000|size=769|pos=270720|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:232f6af8 -packet|codec_type=audio|stream_index=0|pts=493200|pts_time=5.480000|dts=493200|dts_time=5.480000|duration=1800|duration_time=0.020000|size=958|pos=271660|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9a4372e9 -packet|codec_type=audio|stream_index=0|pts=495000|pts_time=5.500000|dts=495000|dts_time=5.500000|duration=1800|duration_time=0.020000|size=773|pos=272788|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f7044435 -packet|codec_type=audio|stream_index=0|pts=496800|pts_time=5.520000|dts=496800|dts_time=5.520000|duration=1800|duration_time=0.020000|size=771|pos=273728|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2d36f75f -packet|codec_type=audio|stream_index=0|pts=498600|pts_time=5.540000|dts=498600|dts_time=5.540000|duration=1800|duration_time=0.020000|size=768|pos=274668|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:11858457 -packet|codec_type=audio|stream_index=0|pts=500400|pts_time=5.560000|dts=500400|dts_time=5.560000|duration=1800|duration_time=0.020000|size=765|pos=275608|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:104cc3b1 -packet|codec_type=audio|stream_index=0|pts=502200|pts_time=5.580000|dts=502200|dts_time=5.580000|duration=1800|duration_time=0.020000|size=774|pos=276548|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8ed3cf9c -packet|codec_type=audio|stream_index=0|pts=504000|pts_time=5.600000|dts=504000|dts_time=5.600000|duration=1800|duration_time=0.020000|size=837|pos=277864|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:16b50427 -packet|codec_type=audio|stream_index=0|pts=505800|pts_time=5.620000|dts=505800|dts_time=5.620000|duration=1800|duration_time=0.020000|size=773|pos=278804|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c5c042c3 -packet|codec_type=audio|stream_index=0|pts=507600|pts_time=5.640000|dts=507600|dts_time=5.640000|duration=1800|duration_time=0.020000|size=773|pos=279744|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:722e401f -packet|codec_type=audio|stream_index=0|pts=509400|pts_time=5.660000|dts=509400|dts_time=5.660000|duration=1800|duration_time=0.020000|size=770|pos=280684|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:831f3604 -packet|codec_type=audio|stream_index=0|pts=511200|pts_time=5.680000|dts=511200|dts_time=5.680000|duration=1800|duration_time=0.020000|size=770|pos=281624|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7718e73e -packet|codec_type=audio|stream_index=0|pts=513000|pts_time=5.700000|dts=513000|dts_time=5.700000|duration=1800|duration_time=0.020000|size=774|pos=282564|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:170731a0 -packet|codec_type=audio|stream_index=0|pts=514800|pts_time=5.720000|dts=514800|dts_time=5.720000|duration=1800|duration_time=0.020000|size=767|pos=283504|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d73c42a8 -packet|codec_type=audio|stream_index=0|pts=516600|pts_time=5.740000|dts=516600|dts_time=5.740000|duration=1800|duration_time=0.020000|size=774|pos=284444|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:854f9a2e -packet|codec_type=audio|stream_index=0|pts=518400|pts_time=5.760000|dts=518400|dts_time=5.760000|duration=1800|duration_time=0.020000|size=833|pos=285384|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7d64106d -packet|codec_type=audio|stream_index=0|pts=520200|pts_time=5.780000|dts=520200|dts_time=5.780000|duration=1800|duration_time=0.020000|size=774|pos=286324|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:02e139fa -packet|codec_type=audio|stream_index=0|pts=522000|pts_time=5.800000|dts=522000|dts_time=5.800000|duration=1800|duration_time=0.020000|size=768|pos=287640|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8b5d5f3b -packet|codec_type=audio|stream_index=0|pts=523800|pts_time=5.820000|dts=523800|dts_time=5.820000|duration=1800|duration_time=0.020000|size=773|pos=288580|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:fa25f507 -packet|codec_type=audio|stream_index=0|pts=525600|pts_time=5.840000|dts=525600|dts_time=5.840000|duration=1800|duration_time=0.020000|size=768|pos=289520|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ccbf6593 -packet|codec_type=audio|stream_index=0|pts=527400|pts_time=5.860000|dts=527400|dts_time=5.860000|duration=1800|duration_time=0.020000|size=769|pos=290460|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cea23a52 -packet|codec_type=audio|stream_index=0|pts=529200|pts_time=5.880000|dts=529200|dts_time=5.880000|duration=1800|duration_time=0.020000|size=767|pos=291400|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3ff8eced -packet|codec_type=audio|stream_index=0|pts=531000|pts_time=5.900000|dts=531000|dts_time=5.900000|duration=1800|duration_time=0.020000|size=773|pos=292340|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a5d92bfd -packet|codec_type=audio|stream_index=0|pts=532800|pts_time=5.920000|dts=532800|dts_time=5.920000|duration=1800|duration_time=0.020000|size=774|pos=293280|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:582c9c2e -packet|codec_type=audio|stream_index=0|pts=534600|pts_time=5.940000|dts=534600|dts_time=5.940000|duration=1800|duration_time=0.020000|size=769|pos=294220|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cc23f8d9 -packet|codec_type=audio|stream_index=0|pts=536400|pts_time=5.960000|dts=536400|dts_time=5.960000|duration=1800|duration_time=0.020000|size=833|pos=295160|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5b9a2c15 -packet|codec_type=audio|stream_index=0|pts=538200|pts_time=5.980000|dts=538200|dts_time=5.980000|duration=1800|duration_time=0.020000|size=768|pos=296100|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8c48e7c5 -packet|codec_type=audio|stream_index=0|pts=540000|pts_time=6.000000|dts=540000|dts_time=6.000000|duration=1800|duration_time=0.020000|size=772|pos=297416|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c431b153 -packet|codec_type=audio|stream_index=0|pts=541800|pts_time=6.020000|dts=541800|dts_time=6.020000|duration=1800|duration_time=0.020000|size=839|pos=298356|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9cfe17d0 -packet|codec_type=audio|stream_index=0|pts=543600|pts_time=6.040000|dts=543600|dts_time=6.040000|duration=1800|duration_time=0.020000|size=769|pos=299296|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:72510fbb -packet|codec_type=audio|stream_index=0|pts=545400|pts_time=6.060000|dts=545400|dts_time=6.060000|duration=1800|duration_time=0.020000|size=769|pos=300236|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:81830ddd -packet|codec_type=audio|stream_index=0|pts=547200|pts_time=6.080000|dts=547200|dts_time=6.080000|duration=1800|duration_time=0.020000|size=771|pos=301176|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:43102486 -packet|codec_type=audio|stream_index=0|pts=549000|pts_time=6.100000|dts=549000|dts_time=6.100000|duration=1800|duration_time=0.020000|size=770|pos=302116|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:49018a2e -packet|codec_type=audio|stream_index=0|pts=550800|pts_time=6.120000|dts=550800|dts_time=6.120000|duration=1800|duration_time=0.020000|size=771|pos=303056|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3a01967a -packet|codec_type=audio|stream_index=0|pts=552600|pts_time=6.140000|dts=552600|dts_time=6.140000|duration=1800|duration_time=0.020000|size=767|pos=303996|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:028a7ab9 -packet|codec_type=audio|stream_index=0|pts=554400|pts_time=6.160000|dts=554400|dts_time=6.160000|duration=1800|duration_time=0.020000|size=899|pos=304936|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:012e3f77 -packet|codec_type=audio|stream_index=0|pts=556200|pts_time=6.180000|dts=556200|dts_time=6.180000|duration=1800|duration_time=0.020000|size=953|pos=305876|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:60935688 -packet|codec_type=audio|stream_index=0|pts=558000|pts_time=6.200000|dts=558000|dts_time=6.200000|duration=1800|duration_time=0.020000|size=770|pos=307380|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1f54722f -packet|codec_type=audio|stream_index=0|pts=559800|pts_time=6.220000|dts=559800|dts_time=6.220000|duration=1800|duration_time=0.020000|size=770|pos=308320|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7786349b -packet|codec_type=audio|stream_index=0|pts=561600|pts_time=6.240000|dts=561600|dts_time=6.240000|duration=1800|duration_time=0.020000|size=771|pos=309260|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1be2464d -packet|codec_type=audio|stream_index=0|pts=563400|pts_time=6.260000|dts=563400|dts_time=6.260000|duration=1800|duration_time=0.020000|size=770|pos=310200|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cf6b28b9 -packet|codec_type=audio|stream_index=0|pts=565200|pts_time=6.280000|dts=565200|dts_time=6.280000|duration=1800|duration_time=0.020000|size=769|pos=311140|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:63fa4ab0 -packet|codec_type=audio|stream_index=0|pts=567000|pts_time=6.300000|dts=567000|dts_time=6.300000|duration=1800|duration_time=0.020000|size=896|pos=312080|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:06a8e324 -packet|codec_type=audio|stream_index=0|pts=568800|pts_time=6.320000|dts=568800|dts_time=6.320000|duration=1800|duration_time=0.020000|size=957|pos=313020|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c37f55e9 -packet|codec_type=audio|stream_index=0|pts=570600|pts_time=6.340000|dts=570600|dts_time=6.340000|duration=1800|duration_time=0.020000|size=773|pos=314148|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:82f8ac84 -packet|codec_type=audio|stream_index=0|pts=572400|pts_time=6.360000|dts=572400|dts_time=6.360000|duration=1800|duration_time=0.020000|size=774|pos=315088|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3ed82724 -packet|codec_type=audio|stream_index=0|pts=574200|pts_time=6.380000|dts=574200|dts_time=6.380000|duration=1800|duration_time=0.020000|size=956|pos=316028|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ed21dfec -packet|codec_type=audio|stream_index=0|pts=576000|pts_time=6.400000|dts=576000|dts_time=6.400000|duration=1800|duration_time=0.020000|size=768|pos=317532|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ef20c09c -packet|codec_type=audio|stream_index=0|pts=577800|pts_time=6.420000|dts=577800|dts_time=6.420000|duration=1800|duration_time=0.020000|size=770|pos=318472|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5f72438e -packet|codec_type=audio|stream_index=0|pts=579600|pts_time=6.440000|dts=579600|dts_time=6.440000|duration=1800|duration_time=0.020000|size=771|pos=319412|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:831f56d5 -packet|codec_type=audio|stream_index=0|pts=581400|pts_time=6.460000|dts=581400|dts_time=6.460000|duration=1800|duration_time=0.020000|size=955|pos=320352|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a3fb153b -packet|codec_type=audio|stream_index=0|pts=583200|pts_time=6.480000|dts=583200|dts_time=6.480000|duration=1800|duration_time=0.020000|size=953|pos=321480|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:109825ac -packet|codec_type=audio|stream_index=0|pts=585000|pts_time=6.500000|dts=585000|dts_time=6.500000|duration=1800|duration_time=0.020000|size=767|pos=322608|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5cb97953 -packet|codec_type=audio|stream_index=0|pts=586800|pts_time=6.520000|dts=586800|dts_time=6.520000|duration=1800|duration_time=0.020000|size=768|pos=323548|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:9aa43658 -packet|codec_type=audio|stream_index=0|pts=588600|pts_time=6.540000|dts=588600|dts_time=6.540000|duration=1800|duration_time=0.020000|size=774|pos=324488|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0ccad3c6 -packet|codec_type=audio|stream_index=0|pts=590400|pts_time=6.560000|dts=590400|dts_time=6.560000|duration=1800|duration_time=0.020000|size=835|pos=325428|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ee1e951f -packet|codec_type=audio|stream_index=0|pts=592200|pts_time=6.580000|dts=592200|dts_time=6.580000|duration=1800|duration_time=0.020000|size=768|pos=326368|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7e964664 -packet|codec_type=audio|stream_index=0|pts=594000|pts_time=6.600000|dts=594000|dts_time=6.600000|duration=1800|duration_time=0.020000|size=769|pos=327684|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:46489e72 -packet|codec_type=audio|stream_index=0|pts=595800|pts_time=6.620000|dts=595800|dts_time=6.620000|duration=1800|duration_time=0.020000|size=771|pos=328624|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:528f881d -packet|codec_type=audio|stream_index=0|pts=597600|pts_time=6.640000|dts=597600|dts_time=6.640000|duration=1800|duration_time=0.020000|size=771|pos=329564|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e776ddf8 -packet|codec_type=audio|stream_index=0|pts=599400|pts_time=6.660000|dts=599400|dts_time=6.660000|duration=1800|duration_time=0.020000|size=770|pos=330504|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f4d9468d -packet|codec_type=audio|stream_index=0|pts=601200|pts_time=6.680000|dts=601200|dts_time=6.680000|duration=1800|duration_time=0.020000|size=768|pos=331444|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0b5bc3e0 -packet|codec_type=audio|stream_index=0|pts=603000|pts_time=6.700000|dts=603000|dts_time=6.700000|duration=1800|duration_time=0.020000|size=951|pos=332384|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4c6d023d -packet|codec_type=audio|stream_index=0|pts=604800|pts_time=6.720000|dts=604800|dts_time=6.720000|duration=1800|duration_time=0.020000|size=950|pos=333512|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:29588833 -packet|codec_type=audio|stream_index=0|pts=606600|pts_time=6.740000|dts=606600|dts_time=6.740000|duration=1800|duration_time=0.020000|size=947|pos=334640|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:12f446a5 -packet|codec_type=audio|stream_index=0|pts=608400|pts_time=6.760000|dts=608400|dts_time=6.760000|duration=1800|duration_time=0.020000|size=956|pos=335768|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:39a765b6 -packet|codec_type=audio|stream_index=0|pts=610200|pts_time=6.780000|dts=610200|dts_time=6.780000|duration=1800|duration_time=0.020000|size=951|pos=336896|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:79ab4162 -packet|codec_type=audio|stream_index=0|pts=612000|pts_time=6.800000|dts=612000|dts_time=6.800000|duration=1800|duration_time=0.020000|size=943|pos=338400|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1c20d61c -packet|codec_type=audio|stream_index=0|pts=613800|pts_time=6.820000|dts=613800|dts_time=6.820000|duration=1800|duration_time=0.020000|size=766|pos=339528|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0e5d1ee5 -packet|codec_type=audio|stream_index=0|pts=615600|pts_time=6.840000|dts=615600|dts_time=6.840000|duration=1800|duration_time=0.020000|size=890|pos=340468|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:27c19b26 -packet|codec_type=audio|stream_index=0|pts=617400|pts_time=6.860000|dts=617400|dts_time=6.860000|duration=1800|duration_time=0.020000|size=952|pos=341408|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8ba8ff4c -packet|codec_type=audio|stream_index=0|pts=619200|pts_time=6.880000|dts=619200|dts_time=6.880000|duration=1800|duration_time=0.020000|size=766|pos=342536|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:61b51e53 -packet|codec_type=audio|stream_index=0|pts=621000|pts_time=6.900000|dts=621000|dts_time=6.900000|duration=1800|duration_time=0.020000|size=767|pos=343476|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:223fd4b8 -packet|codec_type=audio|stream_index=0|pts=622800|pts_time=6.920000|dts=622800|dts_time=6.920000|duration=1800|duration_time=0.020000|size=760|pos=344416|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:221e6f8a -packet|codec_type=audio|stream_index=0|pts=624600|pts_time=6.940000|dts=624600|dts_time=6.940000|duration=1800|duration_time=0.020000|size=946|pos=345356|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:623d901e -packet|codec_type=audio|stream_index=0|pts=626400|pts_time=6.960000|dts=626400|dts_time=6.960000|duration=1800|duration_time=0.020000|size=769|pos=346484|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:584cd53d -packet|codec_type=audio|stream_index=0|pts=628200|pts_time=6.980000|dts=628200|dts_time=6.980000|duration=1800|duration_time=0.020000|size=760|pos=347424|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:179b3137 -packet|codec_type=audio|stream_index=0|pts=630000|pts_time=7.000000|dts=630000|dts_time=7.000000|duration=1800|duration_time=0.020000|size=762|pos=348740|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e0e617f2 -packet|codec_type=audio|stream_index=0|pts=631800|pts_time=7.020000|dts=631800|dts_time=7.020000|duration=1800|duration_time=0.020000|size=767|pos=349680|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:560639a0 -packet|codec_type=audio|stream_index=0|pts=633600|pts_time=7.040000|dts=633600|dts_time=7.040000|duration=1800|duration_time=0.020000|size=767|pos=350620|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a88ea02f -packet|codec_type=audio|stream_index=0|pts=635400|pts_time=7.060000|dts=635400|dts_time=7.060000|duration=1800|duration_time=0.020000|size=763|pos=351560|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6a9f391f -packet|codec_type=audio|stream_index=0|pts=637200|pts_time=7.080000|dts=637200|dts_time=7.080000|duration=1800|duration_time=0.020000|size=760|pos=352500|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:217730ab -packet|codec_type=audio|stream_index=0|pts=639000|pts_time=7.100000|dts=639000|dts_time=7.100000|duration=1800|duration_time=0.020000|size=763|pos=353440|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ffa59273 -packet|codec_type=audio|stream_index=0|pts=640800|pts_time=7.120000|dts=640800|dts_time=7.120000|duration=1800|duration_time=0.020000|size=764|pos=354380|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:05a70a45 -packet|codec_type=audio|stream_index=0|pts=642600|pts_time=7.140000|dts=642600|dts_time=7.140000|duration=1800|duration_time=0.020000|size=764|pos=355320|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1e2e4d40 -packet|codec_type=audio|stream_index=0|pts=644400|pts_time=7.160000|dts=644400|dts_time=7.160000|duration=1800|duration_time=0.020000|size=763|pos=356260|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:695b9d24 -packet|codec_type=audio|stream_index=0|pts=646200|pts_time=7.180000|dts=646200|dts_time=7.180000|duration=1800|duration_time=0.020000|size=763|pos=357200|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:007b90ce -packet|codec_type=audio|stream_index=0|pts=648000|pts_time=7.200000|dts=648000|dts_time=7.200000|duration=1800|duration_time=0.020000|size=764|pos=358516|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:188da6de -packet|codec_type=audio|stream_index=0|pts=649800|pts_time=7.220000|dts=649800|dts_time=7.220000|duration=1800|duration_time=0.020000|size=766|pos=359456|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1046d54c -packet|codec_type=audio|stream_index=0|pts=651600|pts_time=7.240000|dts=651600|dts_time=7.240000|duration=1800|duration_time=0.020000|size=767|pos=360396|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:aa450d3d -packet|codec_type=audio|stream_index=0|pts=653400|pts_time=7.260000|dts=653400|dts_time=7.260000|duration=1800|duration_time=0.020000|size=765|pos=361336|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:80bb936b -packet|codec_type=audio|stream_index=0|pts=655200|pts_time=7.280000|dts=655200|dts_time=7.280000|duration=1800|duration_time=0.020000|size=767|pos=362276|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:47bc2556 -packet|codec_type=audio|stream_index=0|pts=657000|pts_time=7.300000|dts=657000|dts_time=7.300000|duration=1800|duration_time=0.020000|size=763|pos=363216|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:97d4c99c -packet|codec_type=audio|stream_index=0|pts=658800|pts_time=7.320000|dts=658800|dts_time=7.320000|duration=1800|duration_time=0.020000|size=767|pos=364156|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:37252d43 -packet|codec_type=audio|stream_index=0|pts=660600|pts_time=7.340000|dts=660600|dts_time=7.340000|duration=1800|duration_time=0.020000|size=768|pos=365096|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:76918244 -packet|codec_type=audio|stream_index=0|pts=662400|pts_time=7.360000|dts=662400|dts_time=7.360000|duration=1800|duration_time=0.020000|size=764|pos=366036|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5ba0d5d3 -packet|codec_type=audio|stream_index=0|pts=664200|pts_time=7.380000|dts=664200|dts_time=7.380000|duration=1800|duration_time=0.020000|size=765|pos=366976|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5b2b81f0 -packet|codec_type=audio|stream_index=0|pts=666000|pts_time=7.400000|dts=666000|dts_time=7.400000|duration=1800|duration_time=0.020000|size=764|pos=368292|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:161f0b38 -packet|codec_type=audio|stream_index=0|pts=667800|pts_time=7.420000|dts=667800|dts_time=7.420000|duration=1800|duration_time=0.020000|size=769|pos=369232|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:78b4530b -packet|codec_type=audio|stream_index=0|pts=669600|pts_time=7.440000|dts=669600|dts_time=7.440000|duration=1800|duration_time=0.020000|size=766|pos=370172|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c0844a4f -packet|codec_type=audio|stream_index=0|pts=671400|pts_time=7.460000|dts=671400|dts_time=7.460000|duration=1800|duration_time=0.020000|size=766|pos=371112|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:09ef7940 -packet|codec_type=audio|stream_index=0|pts=673200|pts_time=7.480000|dts=673200|dts_time=7.480000|duration=1800|duration_time=0.020000|size=829|pos=372052|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:053ff4c6 -packet|codec_type=audio|stream_index=0|pts=675000|pts_time=7.500000|dts=675000|dts_time=7.500000|duration=1800|duration_time=0.020000|size=765|pos=372992|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:dffb6a19 -packet|codec_type=audio|stream_index=0|pts=676800|pts_time=7.520000|dts=676800|dts_time=7.520000|duration=1800|duration_time=0.020000|size=766|pos=373932|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:95240406 -packet|codec_type=audio|stream_index=0|pts=678600|pts_time=7.540000|dts=678600|dts_time=7.540000|duration=1800|duration_time=0.020000|size=766|pos=374872|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e2e8f563 -packet|codec_type=audio|stream_index=0|pts=680400|pts_time=7.560000|dts=680400|dts_time=7.560000|duration=1800|duration_time=0.020000|size=898|pos=375812|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c1c53334 -packet|codec_type=audio|stream_index=0|pts=682200|pts_time=7.580000|dts=682200|dts_time=7.580000|duration=1800|duration_time=0.020000|size=767|pos=376940|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f122e957 -packet|codec_type=audio|stream_index=0|pts=684000|pts_time=7.600000|dts=684000|dts_time=7.600000|duration=1800|duration_time=0.020000|size=896|pos=378256|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cd022652 -packet|codec_type=audio|stream_index=0|pts=685800|pts_time=7.620000|dts=685800|dts_time=7.620000|duration=1800|duration_time=0.020000|size=764|pos=379196|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:909c400c -packet|codec_type=audio|stream_index=0|pts=687600|pts_time=7.640000|dts=687600|dts_time=7.640000|duration=1800|duration_time=0.020000|size=762|pos=380136|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7340fb8d -packet|codec_type=audio|stream_index=0|pts=689400|pts_time=7.660000|dts=689400|dts_time=7.660000|duration=1800|duration_time=0.020000|size=762|pos=381076|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:46b59223 -packet|codec_type=audio|stream_index=0|pts=691200|pts_time=7.680000|dts=691200|dts_time=7.680000|duration=1800|duration_time=0.020000|size=763|pos=382016|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2f1ebb7e -packet|codec_type=audio|stream_index=0|pts=693000|pts_time=7.700000|dts=693000|dts_time=7.700000|duration=1800|duration_time=0.020000|size=947|pos=382956|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b56bee4b -packet|codec_type=audio|stream_index=0|pts=694800|pts_time=7.720000|dts=694800|dts_time=7.720000|duration=1800|duration_time=0.020000|size=767|pos=384084|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:57c778a9 -packet|codec_type=audio|stream_index=0|pts=696600|pts_time=7.740000|dts=696600|dts_time=7.740000|duration=1800|duration_time=0.020000|size=957|pos=385024|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:599b6964 -packet|codec_type=audio|stream_index=0|pts=698400|pts_time=7.760000|dts=698400|dts_time=7.760000|duration=1800|duration_time=0.020000|size=955|pos=386152|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2351bfa3 -packet|codec_type=audio|stream_index=0|pts=700200|pts_time=7.780000|dts=700200|dts_time=7.780000|duration=1800|duration_time=0.020000|size=767|pos=387280|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f31f5d14 -packet|codec_type=audio|stream_index=0|pts=702000|pts_time=7.800000|dts=702000|dts_time=7.800000|duration=1800|duration_time=0.020000|size=767|pos=388596|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c0f7f4b5 -packet|codec_type=audio|stream_index=0|pts=703800|pts_time=7.820000|dts=703800|dts_time=7.820000|duration=1800|duration_time=0.020000|size=764|pos=389536|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f321de8a -packet|codec_type=audio|stream_index=0|pts=705600|pts_time=7.840000|dts=705600|dts_time=7.840000|duration=1800|duration_time=0.020000|size=763|pos=390476|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:64e7e790 -packet|codec_type=audio|stream_index=0|pts=707400|pts_time=7.860000|dts=707400|dts_time=7.860000|duration=1800|duration_time=0.020000|size=769|pos=391416|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d9bef93e -packet|codec_type=audio|stream_index=0|pts=709200|pts_time=7.880000|dts=709200|dts_time=7.880000|duration=1800|duration_time=0.020000|size=766|pos=392356|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b08e677b -packet|codec_type=audio|stream_index=0|pts=711000|pts_time=7.900000|dts=711000|dts_time=7.900000|duration=1800|duration_time=0.020000|size=762|pos=393296|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cc2d57f3 -packet|codec_type=audio|stream_index=0|pts=712800|pts_time=7.920000|dts=712800|dts_time=7.920000|duration=1800|duration_time=0.020000|size=766|pos=394236|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:920b310d -packet|codec_type=audio|stream_index=0|pts=714600|pts_time=7.940000|dts=714600|dts_time=7.940000|duration=1800|duration_time=0.020000|size=768|pos=395176|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7547a71e -packet|codec_type=audio|stream_index=0|pts=716400|pts_time=7.960000|dts=716400|dts_time=7.960000|duration=1800|duration_time=0.020000|size=765|pos=396116|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6d0f72a9 -packet|codec_type=audio|stream_index=0|pts=718200|pts_time=7.980000|dts=718200|dts_time=7.980000|duration=1800|duration_time=0.020000|size=953|pos=397056|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6daae92b -packet|codec_type=audio|stream_index=0|pts=720000|pts_time=8.000000|dts=720000|dts_time=8.000000|duration=1800|duration_time=0.020000|size=769|pos=398560|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8bd8704e -packet|codec_type=audio|stream_index=0|pts=721800|pts_time=8.020000|dts=721800|dts_time=8.020000|duration=1800|duration_time=0.020000|size=955|pos=399500|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:111f49de -packet|codec_type=audio|stream_index=0|pts=723600|pts_time=8.040000|dts=723600|dts_time=8.040000|duration=1800|duration_time=0.020000|size=952|pos=400628|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c6e266d5 -packet|codec_type=audio|stream_index=0|pts=725400|pts_time=8.060000|dts=725400|dts_time=8.060000|duration=1800|duration_time=0.020000|size=951|pos=401756|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b0f5283f -packet|codec_type=audio|stream_index=0|pts=727200|pts_time=8.080000|dts=727200|dts_time=8.080000|duration=1800|duration_time=0.020000|size=954|pos=402884|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f70d4475 -packet|codec_type=audio|stream_index=0|pts=729000|pts_time=8.100000|dts=729000|dts_time=8.100000|duration=1800|duration_time=0.020000|size=948|pos=404012|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:371078df -packet|codec_type=audio|stream_index=0|pts=730800|pts_time=8.120000|dts=730800|dts_time=8.120000|duration=1800|duration_time=0.020000|size=761|pos=405140|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c2aa814b -packet|codec_type=audio|stream_index=0|pts=732600|pts_time=8.140000|dts=732600|dts_time=8.140000|duration=1800|duration_time=0.020000|size=763|pos=406080|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:188194bc -packet|codec_type=audio|stream_index=0|pts=734400|pts_time=8.160000|dts=734400|dts_time=8.160000|duration=1800|duration_time=0.020000|size=760|pos=407020|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:982ba78c -packet|codec_type=audio|stream_index=0|pts=736200|pts_time=8.180000|dts=736200|dts_time=8.180000|duration=1800|duration_time=0.020000|size=764|pos=407960|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bf244c73 -packet|codec_type=audio|stream_index=0|pts=738000|pts_time=8.200000|dts=738000|dts_time=8.200000|duration=1800|duration_time=0.020000|size=764|pos=409276|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8bdf82ed -packet|codec_type=audio|stream_index=0|pts=739800|pts_time=8.220000|dts=739800|dts_time=8.220000|duration=1800|duration_time=0.020000|size=946|pos=410216|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:acb2d4f3 -packet|codec_type=audio|stream_index=0|pts=741600|pts_time=8.240000|dts=741600|dts_time=8.240000|duration=1800|duration_time=0.020000|size=758|pos=411344|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1cefab3c -packet|codec_type=audio|stream_index=0|pts=743400|pts_time=8.260000|dts=743400|dts_time=8.260000|duration=1800|duration_time=0.020000|size=950|pos=412284|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0bd02594 -packet|codec_type=audio|stream_index=0|pts=745200|pts_time=8.280000|dts=745200|dts_time=8.280000|duration=1800|duration_time=0.020000|size=769|pos=413412|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cc6fff1d -packet|codec_type=audio|stream_index=0|pts=747000|pts_time=8.300000|dts=747000|dts_time=8.300000|duration=1800|duration_time=0.020000|size=764|pos=414352|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cb2fc3d9 -packet|codec_type=audio|stream_index=0|pts=748800|pts_time=8.320000|dts=748800|dts_time=8.320000|duration=1800|duration_time=0.020000|size=757|pos=415292|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:860da403 -packet|codec_type=audio|stream_index=0|pts=750600|pts_time=8.340000|dts=750600|dts_time=8.340000|duration=1800|duration_time=0.020000|size=761|pos=416232|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:14aca2c6 -packet|codec_type=audio|stream_index=0|pts=752400|pts_time=8.360000|dts=752400|dts_time=8.360000|duration=1800|duration_time=0.020000|size=761|pos=417172|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c5d24ee7 -packet|codec_type=audio|stream_index=0|pts=754200|pts_time=8.380000|dts=754200|dts_time=8.380000|duration=1800|duration_time=0.020000|size=759|pos=418112|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:91680f09 -packet|codec_type=audio|stream_index=0|pts=756000|pts_time=8.400000|dts=756000|dts_time=8.400000|duration=1800|duration_time=0.020000|size=758|pos=419428|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c6b2948d -packet|codec_type=audio|stream_index=0|pts=757800|pts_time=8.420000|dts=757800|dts_time=8.420000|duration=1800|duration_time=0.020000|size=767|pos=420368|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:20ff251c -packet|codec_type=audio|stream_index=0|pts=759600|pts_time=8.440000|dts=759600|dts_time=8.440000|duration=1800|duration_time=0.020000|size=761|pos=421308|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d9fa6569 -packet|codec_type=audio|stream_index=0|pts=761400|pts_time=8.460000|dts=761400|dts_time=8.460000|duration=1800|duration_time=0.020000|size=828|pos=422248|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:871a83c7 -packet|codec_type=audio|stream_index=0|pts=763200|pts_time=8.480000|dts=763200|dts_time=8.480000|duration=1800|duration_time=0.020000|size=759|pos=423188|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ad2423ee -packet|codec_type=audio|stream_index=0|pts=765000|pts_time=8.500000|dts=765000|dts_time=8.500000|duration=1800|duration_time=0.020000|size=761|pos=424128|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4e9b7b6e -packet|codec_type=audio|stream_index=0|pts=766800|pts_time=8.520000|dts=766800|dts_time=8.520000|duration=1800|duration_time=0.020000|size=762|pos=425068|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:4aa3582f -packet|codec_type=audio|stream_index=0|pts=768600|pts_time=8.540000|dts=768600|dts_time=8.540000|duration=1800|duration_time=0.020000|size=761|pos=426008|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:15952f9f -packet|codec_type=audio|stream_index=0|pts=770400|pts_time=8.560000|dts=770400|dts_time=8.560000|duration=1800|duration_time=0.020000|size=757|pos=426948|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:55db10c7 -packet|codec_type=audio|stream_index=0|pts=772200|pts_time=8.580000|dts=772200|dts_time=8.580000|duration=1800|duration_time=0.020000|size=759|pos=427888|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1cfff77c -packet|codec_type=audio|stream_index=0|pts=774000|pts_time=8.600000|dts=774000|dts_time=8.600000|duration=1800|duration_time=0.020000|size=759|pos=429204|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:93bf7a2e -packet|codec_type=audio|stream_index=0|pts=775800|pts_time=8.620000|dts=775800|dts_time=8.620000|duration=1800|duration_time=0.020000|size=761|pos=430144|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:75577b1c -packet|codec_type=audio|stream_index=0|pts=777600|pts_time=8.640000|dts=777600|dts_time=8.640000|duration=1800|duration_time=0.020000|size=756|pos=431084|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:fe81112c -packet|codec_type=audio|stream_index=0|pts=779400|pts_time=8.660000|dts=779400|dts_time=8.660000|duration=1800|duration_time=0.020000|size=765|pos=432024|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0ddc28c1 -packet|codec_type=audio|stream_index=0|pts=781200|pts_time=8.680000|dts=781200|dts_time=8.680000|duration=1800|duration_time=0.020000|size=759|pos=432964|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a9dda185 -packet|codec_type=audio|stream_index=0|pts=783000|pts_time=8.700000|dts=783000|dts_time=8.700000|duration=1800|duration_time=0.020000|size=759|pos=433904|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e10197bd -packet|codec_type=audio|stream_index=0|pts=784800|pts_time=8.720000|dts=784800|dts_time=8.720000|duration=1800|duration_time=0.020000|size=761|pos=434844|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f1683c68 -packet|codec_type=audio|stream_index=0|pts=786600|pts_time=8.740000|dts=786600|dts_time=8.740000|duration=1800|duration_time=0.020000|size=762|pos=435784|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f6eee942 -packet|codec_type=audio|stream_index=0|pts=788400|pts_time=8.760000|dts=788400|dts_time=8.760000|duration=1800|duration_time=0.020000|size=771|pos=436724|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6ab1ef22 -packet|codec_type=audio|stream_index=0|pts=790200|pts_time=8.780000|dts=790200|dts_time=8.780000|duration=1800|duration_time=0.020000|size=758|pos=437664|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6920a9e6 -packet|codec_type=audio|stream_index=0|pts=792000|pts_time=8.800000|dts=792000|dts_time=8.800000|duration=1800|duration_time=0.020000|size=759|pos=438980|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b3ba03c7 -packet|codec_type=audio|stream_index=0|pts=793800|pts_time=8.820000|dts=793800|dts_time=8.820000|duration=1800|duration_time=0.020000|size=760|pos=439920|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:59f04151 -packet|codec_type=audio|stream_index=0|pts=795600|pts_time=8.840000|dts=795600|dts_time=8.840000|duration=1800|duration_time=0.020000|size=762|pos=440860|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a9300525 -packet|codec_type=audio|stream_index=0|pts=797400|pts_time=8.860000|dts=797400|dts_time=8.860000|duration=1800|duration_time=0.020000|size=760|pos=441800|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:06b28e48 -packet|codec_type=audio|stream_index=0|pts=799200|pts_time=8.880000|dts=799200|dts_time=8.880000|duration=1800|duration_time=0.020000|size=760|pos=442740|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:99640c9a -packet|codec_type=audio|stream_index=0|pts=801000|pts_time=8.900000|dts=801000|dts_time=8.900000|duration=1800|duration_time=0.020000|size=757|pos=443680|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:264f20e3 -packet|codec_type=audio|stream_index=0|pts=802800|pts_time=8.920000|dts=802800|dts_time=8.920000|duration=1800|duration_time=0.020000|size=762|pos=444620|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:87799aaa -packet|codec_type=audio|stream_index=0|pts=804600|pts_time=8.940000|dts=804600|dts_time=8.940000|duration=1800|duration_time=0.020000|size=763|pos=445560|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b2487f0b -packet|codec_type=audio|stream_index=0|pts=806400|pts_time=8.960000|dts=806400|dts_time=8.960000|duration=1800|duration_time=0.020000|size=835|pos=446500|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5ff97478 -packet|codec_type=audio|stream_index=0|pts=808200|pts_time=8.980000|dts=808200|dts_time=8.980000|duration=1800|duration_time=0.020000|size=758|pos=447440|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ee962000 -packet|codec_type=audio|stream_index=0|pts=810000|pts_time=9.000000|dts=810000|dts_time=9.000000|duration=1800|duration_time=0.020000|size=761|pos=448756|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:65a93707 -packet|codec_type=audio|stream_index=0|pts=811800|pts_time=9.020000|dts=811800|dts_time=9.020000|duration=1800|duration_time=0.020000|size=888|pos=449696|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f365394f -packet|codec_type=audio|stream_index=0|pts=813600|pts_time=9.040000|dts=813600|dts_time=9.040000|duration=1800|duration_time=0.020000|size=758|pos=450636|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:cc4aa3e5 -packet|codec_type=audio|stream_index=0|pts=815400|pts_time=9.060000|dts=815400|dts_time=9.060000|duration=1800|duration_time=0.020000|size=765|pos=451576|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a1fd5bac -packet|codec_type=audio|stream_index=0|pts=817200|pts_time=9.080000|dts=817200|dts_time=9.080000|duration=1800|duration_time=0.020000|size=761|pos=452516|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:1590afda -packet|codec_type=audio|stream_index=0|pts=819000|pts_time=9.100000|dts=819000|dts_time=9.100000|duration=1800|duration_time=0.020000|size=764|pos=453456|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3e34e250 -packet|codec_type=audio|stream_index=0|pts=820800|pts_time=9.120000|dts=820800|dts_time=9.120000|duration=1800|duration_time=0.020000|size=762|pos=454396|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:927657b5 -packet|codec_type=audio|stream_index=0|pts=822600|pts_time=9.140000|dts=822600|dts_time=9.140000|duration=1800|duration_time=0.020000|size=767|pos=455336|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5261b6ab -packet|codec_type=audio|stream_index=0|pts=824400|pts_time=9.160000|dts=824400|dts_time=9.160000|duration=1800|duration_time=0.020000|size=759|pos=456276|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:645fd792 -packet|codec_type=audio|stream_index=0|pts=826200|pts_time=9.180000|dts=826200|dts_time=9.180000|duration=1800|duration_time=0.020000|size=761|pos=457216|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:240a9cd8 -packet|codec_type=audio|stream_index=0|pts=828000|pts_time=9.200000|dts=828000|dts_time=9.200000|duration=1800|duration_time=0.020000|size=762|pos=458532|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:409c4ee6 -packet|codec_type=audio|stream_index=0|pts=829800|pts_time=9.220000|dts=829800|dts_time=9.220000|duration=1800|duration_time=0.020000|size=763|pos=459472|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:a1e4f6c8 -packet|codec_type=audio|stream_index=0|pts=831600|pts_time=9.240000|dts=831600|dts_time=9.240000|duration=1800|duration_time=0.020000|size=760|pos=460412|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e405b6d8 -packet|codec_type=audio|stream_index=0|pts=833400|pts_time=9.260000|dts=833400|dts_time=9.260000|duration=1800|duration_time=0.020000|size=832|pos=461352|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:28926870 -packet|codec_type=audio|stream_index=0|pts=835200|pts_time=9.280000|dts=835200|dts_time=9.280000|duration=1800|duration_time=0.020000|size=761|pos=462292|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:991eafa7 -packet|codec_type=audio|stream_index=0|pts=837000|pts_time=9.300000|dts=837000|dts_time=9.300000|duration=1800|duration_time=0.020000|size=887|pos=463232|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2f2180e4 -packet|codec_type=audio|stream_index=0|pts=838800|pts_time=9.320000|dts=838800|dts_time=9.320000|duration=1800|duration_time=0.020000|size=765|pos=464172|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c3b931ab -packet|codec_type=audio|stream_index=0|pts=840600|pts_time=9.340000|dts=840600|dts_time=9.340000|duration=1800|duration_time=0.020000|size=763|pos=465112|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:09c95d1c -packet|codec_type=audio|stream_index=0|pts=842400|pts_time=9.360000|dts=842400|dts_time=9.360000|duration=1800|duration_time=0.020000|size=763|pos=466052|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5a90f4d9 -packet|codec_type=audio|stream_index=0|pts=844200|pts_time=9.380000|dts=844200|dts_time=9.380000|duration=1800|duration_time=0.020000|size=952|pos=466992|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2e1338bd -packet|codec_type=audio|stream_index=0|pts=846000|pts_time=9.400000|dts=846000|dts_time=9.400000|duration=1800|duration_time=0.020000|size=953|pos=468496|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:db87e979 -packet|codec_type=audio|stream_index=0|pts=847800|pts_time=9.420000|dts=847800|dts_time=9.420000|duration=1800|duration_time=0.020000|size=945|pos=469624|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d55815d6 -packet|codec_type=audio|stream_index=0|pts=849600|pts_time=9.440000|dts=849600|dts_time=9.440000|duration=1800|duration_time=0.020000|size=948|pos=470752|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e31e5728 -packet|codec_type=audio|stream_index=0|pts=851400|pts_time=9.460000|dts=851400|dts_time=9.460000|duration=1800|duration_time=0.020000|size=951|pos=471880|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:49e86c3d -packet|codec_type=audio|stream_index=0|pts=853200|pts_time=9.480000|dts=853200|dts_time=9.480000|duration=1800|duration_time=0.020000|size=826|pos=473008|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:13cefb19 -packet|codec_type=audio|stream_index=0|pts=855000|pts_time=9.500000|dts=855000|dts_time=9.500000|duration=1800|duration_time=0.020000|size=763|pos=473948|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8d9b7d72 -packet|codec_type=audio|stream_index=0|pts=856800|pts_time=9.520000|dts=856800|dts_time=9.520000|duration=1800|duration_time=0.020000|size=763|pos=474888|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:d55b35fb -packet|codec_type=audio|stream_index=0|pts=858600|pts_time=9.540000|dts=858600|dts_time=9.540000|duration=1800|duration_time=0.020000|size=766|pos=475828|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3e10c46a -packet|codec_type=audio|stream_index=0|pts=860400|pts_time=9.560000|dts=860400|dts_time=9.560000|duration=1800|duration_time=0.020000|size=946|pos=476768|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:924e67eb -packet|codec_type=audio|stream_index=0|pts=862200|pts_time=9.580000|dts=862200|dts_time=9.580000|duration=1800|duration_time=0.020000|size=762|pos=477896|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:008c6ebb -packet|codec_type=audio|stream_index=0|pts=864000|pts_time=9.600000|dts=864000|dts_time=9.600000|duration=1800|duration_time=0.020000|size=765|pos=479212|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:96d72d3f -packet|codec_type=audio|stream_index=0|pts=865800|pts_time=9.620000|dts=865800|dts_time=9.620000|duration=1800|duration_time=0.020000|size=763|pos=480152|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6f40bb5a -packet|codec_type=audio|stream_index=0|pts=867600|pts_time=9.640000|dts=867600|dts_time=9.640000|duration=1800|duration_time=0.020000|size=761|pos=481092|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:f6ba1f01 -packet|codec_type=audio|stream_index=0|pts=869400|pts_time=9.660000|dts=869400|dts_time=9.660000|duration=1800|duration_time=0.020000|size=760|pos=482032|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b610a31e -packet|codec_type=audio|stream_index=0|pts=871200|pts_time=9.680000|dts=871200|dts_time=9.680000|duration=1800|duration_time=0.020000|size=757|pos=482972|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:64dde46b -packet|codec_type=audio|stream_index=0|pts=873000|pts_time=9.700000|dts=873000|dts_time=9.700000|duration=1800|duration_time=0.020000|size=757|pos=483912|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:8f794e6c -packet|codec_type=audio|stream_index=0|pts=874800|pts_time=9.720000|dts=874800|dts_time=9.720000|duration=1800|duration_time=0.020000|size=762|pos=484852|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:65c6284c -packet|codec_type=audio|stream_index=0|pts=876600|pts_time=9.740000|dts=876600|dts_time=9.740000|duration=1800|duration_time=0.020000|size=760|pos=485792|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7dead06c -packet|codec_type=audio|stream_index=0|pts=878400|pts_time=9.760000|dts=878400|dts_time=9.760000|duration=1800|duration_time=0.020000|size=763|pos=486732|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b0e145b1 -packet|codec_type=audio|stream_index=0|pts=880200|pts_time=9.780000|dts=880200|dts_time=9.780000|duration=1800|duration_time=0.020000|size=764|pos=487672|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:3d2553f6 -packet|codec_type=audio|stream_index=0|pts=882000|pts_time=9.800000|dts=882000|dts_time=9.800000|duration=1800|duration_time=0.020000|size=946|pos=488988|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e808f1d2 -packet|codec_type=audio|stream_index=0|pts=883800|pts_time=9.820000|dts=883800|dts_time=9.820000|duration=1800|duration_time=0.020000|size=946|pos=490116|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6b408528 -packet|codec_type=audio|stream_index=0|pts=885600|pts_time=9.840000|dts=885600|dts_time=9.840000|duration=1800|duration_time=0.020000|size=949|pos=491244|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e51d96e4 -packet|codec_type=audio|stream_index=0|pts=887400|pts_time=9.860000|dts=887400|dts_time=9.860000|duration=1800|duration_time=0.020000|size=946|pos=492372|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:c2df3280 -packet|codec_type=audio|stream_index=0|pts=889200|pts_time=9.880000|dts=889200|dts_time=9.880000|duration=1800|duration_time=0.020000|size=940|pos=493500|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7bb5a137 -packet|codec_type=audio|stream_index=0|pts=891000|pts_time=9.900000|dts=891000|dts_time=9.900000|duration=1800|duration_time=0.020000|size=762|pos=494628|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:12fcc651 -packet|codec_type=audio|stream_index=0|pts=892800|pts_time=9.920000|dts=892800|dts_time=9.920000|duration=1800|duration_time=0.020000|size=759|pos=495568|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:b402a4c8 -packet|codec_type=audio|stream_index=0|pts=894600|pts_time=9.940000|dts=894600|dts_time=9.940000|duration=1800|duration_time=0.020000|size=942|pos=496508|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:bfe52a16 -packet|codec_type=audio|stream_index=0|pts=896400|pts_time=9.960000|dts=896400|dts_time=9.960000|duration=1800|duration_time=0.020000|size=764|pos=497636|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:09372283 -packet|codec_type=audio|stream_index=0|pts=898200|pts_time=9.980000|dts=898200|dts_time=9.980000|duration=1800|duration_time=0.020000|size=759|pos=498576|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5a27db5c -packet|codec_type=audio|stream_index=0|pts=900000|pts_time=10.000000|dts=900000|dts_time=10.000000|duration=1800|duration_time=0.020000|size=760|pos=499892|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:0821b0cd -packet|codec_type=audio|stream_index=0|pts=901800|pts_time=10.020000|dts=901800|dts_time=10.020000|duration=1800|duration_time=0.020000|size=757|pos=500832|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:91af6b99 -packet|codec_type=audio|stream_index=0|pts=903600|pts_time=10.040000|dts=903600|dts_time=10.040000|duration=1800|duration_time=0.020000|size=941|pos=501772|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:5296a88a -packet|codec_type=audio|stream_index=0|pts=905400|pts_time=10.060000|dts=905400|dts_time=10.060000|duration=1800|duration_time=0.020000|size=943|pos=502900|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:e75e69d4 -packet|codec_type=audio|stream_index=0|pts=907200|pts_time=10.080000|dts=907200|dts_time=10.080000|duration=1800|duration_time=0.020000|size=759|pos=504028|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:6a5b92cd -packet|codec_type=audio|stream_index=0|pts=909000|pts_time=10.100000|dts=909000|dts_time=10.100000|duration=1800|duration_time=0.020000|size=759|pos=504968|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:ec30c088 -packet|codec_type=audio|stream_index=0|pts=910800|pts_time=10.120000|dts=910800|dts_time=10.120000|duration=1800|duration_time=0.020000|size=762|pos=505908|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:2c73f2ff -packet|codec_type=audio|stream_index=0|pts=912600|pts_time=10.140000|dts=912600|dts_time=10.140000|duration=1800|duration_time=0.020000|size=831|pos=506848|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:7f7cb041 -packet|codec_type=audio|stream_index=0|pts=914400|pts_time=10.160000|dts=914400|dts_time=10.160000|duration=1800|duration_time=0.020000|size=756|pos=507788|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:52ef1db9 -packet|codec_type=audio|stream_index=0|pts=916200|pts_time=10.180000|dts=916200|dts_time=10.180000|duration=1800|duration_time=0.020000|size=760|pos=508728|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:fdf0ce4a -packet|codec_type=audio|stream_index=0|pts=918000|pts_time=10.200000|dts=918000|dts_time=10.200000|duration=1800|duration_time=0.020000|size=761|pos=510044|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:75113c11 -packet|codec_type=audio|stream_index=0|pts=919800|pts_time=10.220000|dts=919800|dts_time=10.220000|duration=1800|duration_time=0.020000|size=759|pos=510984|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=189 -|data_hash=CRC32:59fc266f -stream|index=0|codec_name=opus|profile=unknown|codec_type=audio|codec_tag_string=Opus|codec_tag=0x7375704f|sample_fmt=fltp|sample_rate=48000|channels=8|channel_layout=7.1|bits_per_sample=0|id=0x44|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=919800|duration=10.220000|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=512|extradata_size=29|extradata_hash=CRC32:6d6089a7|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1800|duration_time=0.020000|size=744|pos=376|flags=K__|data_hash=CRC32:eec8d060|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=1800|pts_time=0.020000|dts=1800|dts_time=0.020000|duration=1800|duration_time=0.020000|size=743|pos=1316|flags=K__|data_hash=CRC32:c5307335|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=3600|pts_time=0.040000|dts=3600|dts_time=0.040000|duration=1800|duration_time=0.020000|size=747|pos=2256|flags=K__|data_hash=CRC32:6f1c0bfa|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=5400|pts_time=0.060000|dts=5400|dts_time=0.060000|duration=1800|duration_time=0.020000|size=742|pos=3196|flags=K__|data_hash=CRC32:765b2eab|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=7200|pts_time=0.080000|dts=7200|dts_time=0.080000|duration=1800|duration_time=0.020000|size=752|pos=4136|flags=K__|data_hash=CRC32:490463dd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=9000|pts_time=0.100000|dts=9000|dts_time=0.100000|duration=1800|duration_time=0.020000|size=753|pos=5076|flags=K__|data_hash=CRC32:beef1221|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=10800|pts_time=0.120000|dts=10800|dts_time=0.120000|duration=1800|duration_time=0.020000|size=756|pos=6016|flags=K__|data_hash=CRC32:7814e1fe|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=12600|pts_time=0.140000|dts=12600|dts_time=0.140000|duration=1800|duration_time=0.020000|size=761|pos=6956|flags=K__|data_hash=CRC32:1e28bf7d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=14400|pts_time=0.160000|dts=14400|dts_time=0.160000|duration=1800|duration_time=0.020000|size=755|pos=7896|flags=K__|data_hash=CRC32:ac39390f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=16200|pts_time=0.180000|dts=16200|dts_time=0.180000|duration=1800|duration_time=0.020000|size=760|pos=8836|flags=K__|data_hash=CRC32:56129f6c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=18000|pts_time=0.200000|dts=18000|dts_time=0.200000|duration=1800|duration_time=0.020000|size=759|pos=10152|flags=K__|data_hash=CRC32:444cf0b3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=19800|pts_time=0.220000|dts=19800|dts_time=0.220000|duration=1800|duration_time=0.020000|size=760|pos=11092|flags=K__|data_hash=CRC32:b26188cc|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=21600|pts_time=0.240000|dts=21600|dts_time=0.240000|duration=1800|duration_time=0.020000|size=762|pos=12032|flags=K__|data_hash=CRC32:550b5ea5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=23400|pts_time=0.260000|dts=23400|dts_time=0.260000|duration=1800|duration_time=0.020000|size=761|pos=12972|flags=K__|data_hash=CRC32:3b587071|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=25200|pts_time=0.280000|dts=25200|dts_time=0.280000|duration=1800|duration_time=0.020000|size=758|pos=13912|flags=K__|data_hash=CRC32:c655d80f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=27000|pts_time=0.300000|dts=27000|dts_time=0.300000|duration=1800|duration_time=0.020000|size=756|pos=14852|flags=K__|data_hash=CRC32:4734bf58|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=28800|pts_time=0.320000|dts=28800|dts_time=0.320000|duration=1800|duration_time=0.020000|size=762|pos=15792|flags=K__|data_hash=CRC32:58ddcd0e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=30600|pts_time=0.340000|dts=30600|dts_time=0.340000|duration=1800|duration_time=0.020000|size=763|pos=16732|flags=K__|data_hash=CRC32:50786001|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=32400|pts_time=0.360000|dts=32400|dts_time=0.360000|duration=1800|duration_time=0.020000|size=765|pos=17672|flags=K__|data_hash=CRC32:4c8c5dc8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=34200|pts_time=0.380000|dts=34200|dts_time=0.380000|duration=1800|duration_time=0.020000|size=772|pos=18612|flags=K__|data_hash=CRC32:ad3f1eda|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=36000|pts_time=0.400000|dts=36000|dts_time=0.400000|duration=1800|duration_time=0.020000|size=817|pos=19928|flags=K__|data_hash=CRC32:8b7c8437|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=37800|pts_time=0.420000|dts=37800|dts_time=0.420000|duration=1800|duration_time=0.020000|size=828|pos=20868|flags=K__|data_hash=CRC32:c52621e3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=39600|pts_time=0.440000|dts=39600|dts_time=0.440000|duration=1800|duration_time=0.020000|size=952|pos=21808|flags=K__|data_hash=CRC32:4b34b632|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=41400|pts_time=0.460000|dts=41400|dts_time=0.460000|duration=1800|duration_time=0.020000|size=819|pos=22936|flags=K__|data_hash=CRC32:79f06d2c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=43200|pts_time=0.480000|dts=43200|dts_time=0.480000|duration=1800|duration_time=0.020000|size=816|pos=23876|flags=K__|data_hash=CRC32:31136ff8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=45000|pts_time=0.500000|dts=45000|dts_time=0.500000|duration=1800|duration_time=0.020000|size=825|pos=24816|flags=K__|data_hash=CRC32:d6cd17f2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=46800|pts_time=0.520000|dts=46800|dts_time=0.520000|duration=1800|duration_time=0.020000|size=814|pos=25756|flags=K__|data_hash=CRC32:bd4ada7b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=48600|pts_time=0.540000|dts=48600|dts_time=0.540000|duration=1800|duration_time=0.020000|size=824|pos=26696|flags=K__|data_hash=CRC32:59132b5d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=50400|pts_time=0.560000|dts=50400|dts_time=0.560000|duration=1800|duration_time=0.020000|size=815|pos=27636|flags=K__|data_hash=CRC32:6d3ba392|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=52200|pts_time=0.580000|dts=52200|dts_time=0.580000|duration=1800|duration_time=0.020000|size=824|pos=28576|flags=K__|data_hash=CRC32:b9341220|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=54000|pts_time=0.600000|dts=54000|dts_time=0.600000|duration=1800|duration_time=0.020000|size=822|pos=29892|flags=K__|data_hash=CRC32:cd0b0be2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=55800|pts_time=0.620000|dts=55800|dts_time=0.620000|duration=1800|duration_time=0.020000|size=819|pos=30832|flags=K__|data_hash=CRC32:c0a97918|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=57600|pts_time=0.640000|dts=57600|dts_time=0.640000|duration=1800|duration_time=0.020000|size=817|pos=31772|flags=K__|data_hash=CRC32:b4da2c7e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=59400|pts_time=0.660000|dts=59400|dts_time=0.660000|duration=1800|duration_time=0.020000|size=826|pos=32712|flags=K__|data_hash=CRC32:aaf0a9b2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=61200|pts_time=0.680000|dts=61200|dts_time=0.680000|duration=1800|duration_time=0.020000|size=822|pos=33652|flags=K__|data_hash=CRC32:a09994ed|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=63000|pts_time=0.700000|dts=63000|dts_time=0.700000|duration=1800|duration_time=0.020000|size=815|pos=34592|flags=K__|data_hash=CRC32:ded67e51|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=64800|pts_time=0.720000|dts=64800|dts_time=0.720000|duration=1800|duration_time=0.020000|size=820|pos=35532|flags=K__|data_hash=CRC32:17f0a2c0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=66600|pts_time=0.740000|dts=66600|dts_time=0.740000|duration=1800|duration_time=0.020000|size=828|pos=36472|flags=K__|data_hash=CRC32:92d1d4ad|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=68400|pts_time=0.760000|dts=68400|dts_time=0.760000|duration=1800|duration_time=0.020000|size=828|pos=37412|flags=K__|data_hash=CRC32:3752c787|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=70200|pts_time=0.780000|dts=70200|dts_time=0.780000|duration=1800|duration_time=0.020000|size=942|pos=38352|flags=K__|data_hash=CRC32:ab24f03b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=72000|pts_time=0.800000|dts=72000|dts_time=0.800000|duration=1800|duration_time=0.020000|size=809|pos=39856|flags=K__|data_hash=CRC32:920e19f5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=73800|pts_time=0.820000|dts=73800|dts_time=0.820000|duration=1800|duration_time=0.020000|size=823|pos=40796|flags=K__|data_hash=CRC32:951b6d50|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=75600|pts_time=0.840000|dts=75600|dts_time=0.840000|duration=1800|duration_time=0.020000|size=827|pos=41736|flags=K__|data_hash=CRC32:cfc9eb30|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=77400|pts_time=0.860000|dts=77400|dts_time=0.860000|duration=1800|duration_time=0.020000|size=823|pos=42676|flags=K__|data_hash=CRC32:dd66bb72|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=79200|pts_time=0.880000|dts=79200|dts_time=0.880000|duration=1800|duration_time=0.020000|size=825|pos=43616|flags=K__|data_hash=CRC32:67b1c809|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=81000|pts_time=0.900000|dts=81000|dts_time=0.900000|duration=1800|duration_time=0.020000|size=828|pos=44556|flags=K__|data_hash=CRC32:94d441b0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=82800|pts_time=0.920000|dts=82800|dts_time=0.920000|duration=1800|duration_time=0.020000|size=823|pos=45496|flags=K__|data_hash=CRC32:178471e0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=84600|pts_time=0.940000|dts=84600|dts_time=0.940000|duration=1800|duration_time=0.020000|size=817|pos=46436|flags=K__|data_hash=CRC32:90e30fb2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=86400|pts_time=0.960000|dts=86400|dts_time=0.960000|duration=1800|duration_time=0.020000|size=813|pos=47376|flags=K__|data_hash=CRC32:dd4e1d03|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=88200|pts_time=0.980000|dts=88200|dts_time=0.980000|duration=1800|duration_time=0.020000|size=809|pos=48316|flags=K__|data_hash=CRC32:0e059caf|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=90000|pts_time=1.000000|dts=90000|dts_time=1.000000|duration=1800|duration_time=0.020000|size=813|pos=49632|flags=K__|data_hash=CRC32:1981fa52|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=91800|pts_time=1.020000|dts=91800|dts_time=1.020000|duration=1800|duration_time=0.020000|size=820|pos=50572|flags=K__|data_hash=CRC32:6af0ac25|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=93600|pts_time=1.040000|dts=93600|dts_time=1.040000|duration=1800|duration_time=0.020000|size=818|pos=51512|flags=K__|data_hash=CRC32:4ed14497|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=95400|pts_time=1.060000|dts=95400|dts_time=1.060000|duration=1800|duration_time=0.020000|size=825|pos=52452|flags=K__|data_hash=CRC32:b1712b61|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=97200|pts_time=1.080000|dts=97200|dts_time=1.080000|duration=1800|duration_time=0.020000|size=808|pos=53392|flags=K__|data_hash=CRC32:97469bbe|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=99000|pts_time=1.100000|dts=99000|dts_time=1.100000|duration=1800|duration_time=0.020000|size=774|pos=54332|flags=K__|data_hash=CRC32:f2f922fc|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=100800|pts_time=1.120000|dts=100800|dts_time=1.120000|duration=1800|duration_time=0.020000|size=774|pos=55272|flags=K__|data_hash=CRC32:024f521d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=102600|pts_time=1.140000|dts=102600|dts_time=1.140000|duration=1800|duration_time=0.020000|size=777|pos=56212|flags=K__|data_hash=CRC32:674d82ba|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=104400|pts_time=1.160000|dts=104400|dts_time=1.160000|duration=1800|duration_time=0.020000|size=776|pos=57152|flags=K__|data_hash=CRC32:79409537|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=106200|pts_time=1.180000|dts=106200|dts_time=1.180000|duration=1800|duration_time=0.020000|size=779|pos=58092|flags=K__|data_hash=CRC32:aad393ee|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=108000|pts_time=1.200000|dts=108000|dts_time=1.200000|duration=1800|duration_time=0.020000|size=779|pos=59408|flags=K__|data_hash=CRC32:9e2dee75|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=109800|pts_time=1.220000|dts=109800|dts_time=1.220000|duration=1800|duration_time=0.020000|size=774|pos=60348|flags=K__|data_hash=CRC32:1d8953b4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=111600|pts_time=1.240000|dts=111600|dts_time=1.240000|duration=1800|duration_time=0.020000|size=772|pos=61288|flags=K__|data_hash=CRC32:3f191e37|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=113400|pts_time=1.260000|dts=113400|dts_time=1.260000|duration=1800|duration_time=0.020000|size=779|pos=62228|flags=K__|data_hash=CRC32:8e05df12|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=115200|pts_time=1.280000|dts=115200|dts_time=1.280000|duration=1800|duration_time=0.020000|size=774|pos=63168|flags=K__|data_hash=CRC32:d3d2e07c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=117000|pts_time=1.300000|dts=117000|dts_time=1.300000|duration=1800|duration_time=0.020000|size=772|pos=64108|flags=K__|data_hash=CRC32:22e0dee4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=118800|pts_time=1.320000|dts=118800|dts_time=1.320000|duration=1800|duration_time=0.020000|size=771|pos=65048|flags=K__|data_hash=CRC32:7e1fae18|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=120600|pts_time=1.340000|dts=120600|dts_time=1.340000|duration=1800|duration_time=0.020000|size=776|pos=65988|flags=K__|data_hash=CRC32:213724a0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=122400|pts_time=1.360000|dts=122400|dts_time=1.360000|duration=1800|duration_time=0.020000|size=776|pos=66928|flags=K__|data_hash=CRC32:f6018f97|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=124200|pts_time=1.380000|dts=124200|dts_time=1.380000|duration=1800|duration_time=0.020000|size=777|pos=67868|flags=K__|data_hash=CRC32:d917e577|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=126000|pts_time=1.400000|dts=126000|dts_time=1.400000|duration=1800|duration_time=0.020000|size=779|pos=69184|flags=K__|data_hash=CRC32:2860d19c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=127800|pts_time=1.420000|dts=127800|dts_time=1.420000|duration=1800|duration_time=0.020000|size=779|pos=70124|flags=K__|data_hash=CRC32:799e404b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=129600|pts_time=1.440000|dts=129600|dts_time=1.440000|duration=1800|duration_time=0.020000|size=774|pos=71064|flags=K__|data_hash=CRC32:a4c43eaa|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=131400|pts_time=1.460000|dts=131400|dts_time=1.460000|duration=1800|duration_time=0.020000|size=779|pos=72004|flags=K__|data_hash=CRC32:4aa2d0c3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=133200|pts_time=1.480000|dts=133200|dts_time=1.480000|duration=1800|duration_time=0.020000|size=782|pos=72944|flags=K__|data_hash=CRC32:b5e19460|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=135000|pts_time=1.500000|dts=135000|dts_time=1.500000|duration=1800|duration_time=0.020000|size=776|pos=73884|flags=K__|data_hash=CRC32:32445f6b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=136800|pts_time=1.520000|dts=136800|dts_time=1.520000|duration=1800|duration_time=0.020000|size=778|pos=74824|flags=K__|data_hash=CRC32:6f370fec|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=138600|pts_time=1.540000|dts=138600|dts_time=1.540000|duration=1800|duration_time=0.020000|size=777|pos=75764|flags=K__|data_hash=CRC32:43e04e6d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=140400|pts_time=1.560000|dts=140400|dts_time=1.560000|duration=1800|duration_time=0.020000|size=785|pos=76704|flags=K__|data_hash=CRC32:5ed32f7e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=142200|pts_time=1.580000|dts=142200|dts_time=1.580000|duration=1800|duration_time=0.020000|size=782|pos=77644|flags=K__|data_hash=CRC32:ead85ef4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=144000|pts_time=1.600000|dts=144000|dts_time=1.600000|duration=1800|duration_time=0.020000|size=782|pos=78960|flags=K__|data_hash=CRC32:5f283747|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=145800|pts_time=1.620000|dts=145800|dts_time=1.620000|duration=1800|duration_time=0.020000|size=780|pos=79900|flags=K__|data_hash=CRC32:f4aa30a5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=147600|pts_time=1.640000|dts=147600|dts_time=1.640000|duration=1800|duration_time=0.020000|size=776|pos=80840|flags=K__|data_hash=CRC32:ad09e32c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=149400|pts_time=1.660000|dts=149400|dts_time=1.660000|duration=1800|duration_time=0.020000|size=780|pos=81780|flags=K__|data_hash=CRC32:57f8004d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=151200|pts_time=1.680000|dts=151200|dts_time=1.680000|duration=1800|duration_time=0.020000|size=784|pos=82720|flags=K__|data_hash=CRC32:d862a139|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=153000|pts_time=1.700000|dts=153000|dts_time=1.700000|duration=1800|duration_time=0.020000|size=776|pos=83660|flags=K__|data_hash=CRC32:29ebd249|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=154800|pts_time=1.720000|dts=154800|dts_time=1.720000|duration=1800|duration_time=0.020000|size=777|pos=84600|flags=K__|data_hash=CRC32:5af83f3e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=156600|pts_time=1.740000|dts=156600|dts_time=1.740000|duration=1800|duration_time=0.020000|size=783|pos=85540|flags=K__|data_hash=CRC32:78784213|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=158400|pts_time=1.760000|dts=158400|dts_time=1.760000|duration=1800|duration_time=0.020000|size=780|pos=86480|flags=K__|data_hash=CRC32:cccb4c08|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=160200|pts_time=1.780000|dts=160200|dts_time=1.780000|duration=1800|duration_time=0.020000|size=782|pos=87420|flags=K__|data_hash=CRC32:36520804|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=162000|pts_time=1.800000|dts=162000|dts_time=1.800000|duration=1800|duration_time=0.020000|size=848|pos=88736|flags=K__|data_hash=CRC32:a9235baa|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=163800|pts_time=1.820000|dts=163800|dts_time=1.820000|duration=1800|duration_time=0.020000|size=849|pos=89676|flags=K__|data_hash=CRC32:57ae2eef|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=165600|pts_time=1.840000|dts=165600|dts_time=1.840000|duration=1800|duration_time=0.020000|size=783|pos=90616|flags=K__|data_hash=CRC32:474f3232|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=167400|pts_time=1.860000|dts=167400|dts_time=1.860000|duration=1800|duration_time=0.020000|size=784|pos=91556|flags=K__|data_hash=CRC32:9a51d488|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=169200|pts_time=1.880000|dts=169200|dts_time=1.880000|duration=1800|duration_time=0.020000|size=785|pos=92496|flags=K__|data_hash=CRC32:919bc794|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=171000|pts_time=1.900000|dts=171000|dts_time=1.900000|duration=1800|duration_time=0.020000|size=783|pos=93436|flags=K__|data_hash=CRC32:ed8214ad|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=172800|pts_time=1.920000|dts=172800|dts_time=1.920000|duration=1800|duration_time=0.020000|size=876|pos=94376|flags=K__|data_hash=CRC32:72fcce4c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=174600|pts_time=1.940000|dts=174600|dts_time=1.940000|duration=1800|duration_time=0.020000|size=776|pos=95316|flags=K__|data_hash=CRC32:2a0143f4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=176400|pts_time=1.960000|dts=176400|dts_time=1.960000|duration=1800|duration_time=0.020000|size=787|pos=96256|flags=K__|data_hash=CRC32:94f1aae1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=178200|pts_time=1.980000|dts=178200|dts_time=1.980000|duration=1800|duration_time=0.020000|size=781|pos=97196|flags=K__|data_hash=CRC32:5565737b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=180000|pts_time=2.000000|dts=180000|dts_time=2.000000|duration=1800|duration_time=0.020000|size=852|pos=98512|flags=K__|data_hash=CRC32:daea61be|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=181800|pts_time=2.020000|dts=181800|dts_time=2.020000|duration=1800|duration_time=0.020000|size=849|pos=99452|flags=K__|data_hash=CRC32:ee704432|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=183600|pts_time=2.040000|dts=183600|dts_time=2.040000|duration=1800|duration_time=0.020000|size=873|pos=100392|flags=K__|data_hash=CRC32:472aa214|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=185400|pts_time=2.060000|dts=185400|dts_time=2.060000|duration=1800|duration_time=0.020000|size=843|pos=101332|flags=K__|data_hash=CRC32:0b046703|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=187200|pts_time=2.080000|dts=187200|dts_time=2.080000|duration=1800|duration_time=0.020000|size=841|pos=102272|flags=K__|data_hash=CRC32:59bf9bd5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=189000|pts_time=2.100000|dts=189000|dts_time=2.100000|duration=1800|duration_time=0.020000|size=777|pos=103212|flags=K__|data_hash=CRC32:808ee658|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=190800|pts_time=2.120000|dts=190800|dts_time=2.120000|duration=1800|duration_time=0.020000|size=846|pos=104152|flags=K__|data_hash=CRC32:db581c04|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=192600|pts_time=2.140000|dts=192600|dts_time=2.140000|duration=1800|duration_time=0.020000|size=782|pos=105092|flags=K__|data_hash=CRC32:768d8d82|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=194400|pts_time=2.160000|dts=194400|dts_time=2.160000|duration=1800|duration_time=0.020000|size=869|pos=106032|flags=K__|data_hash=CRC32:263c4a83|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=196200|pts_time=2.180000|dts=196200|dts_time=2.180000|duration=1800|duration_time=0.020000|size=778|pos=106972|flags=K__|data_hash=CRC32:4017dc55|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=198000|pts_time=2.200000|dts=198000|dts_time=2.200000|duration=1800|duration_time=0.020000|size=777|pos=108288|flags=K__|data_hash=CRC32:e6b3c398|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=199800|pts_time=2.220000|dts=199800|dts_time=2.220000|duration=1800|duration_time=0.020000|size=870|pos=109228|flags=K__|data_hash=CRC32:37eda28b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=201600|pts_time=2.240000|dts=201600|dts_time=2.240000|duration=1800|duration_time=0.020000|size=782|pos=110168|flags=K__|data_hash=CRC32:aa3b5d94|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=203400|pts_time=2.260000|dts=203400|dts_time=2.260000|duration=1800|duration_time=0.020000|size=777|pos=111108|flags=K__|data_hash=CRC32:fc87dbf0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=205200|pts_time=2.280000|dts=205200|dts_time=2.280000|duration=1800|duration_time=0.020000|size=869|pos=112048|flags=K__|data_hash=CRC32:75795b7e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=207000|pts_time=2.300000|dts=207000|dts_time=2.300000|duration=1800|duration_time=0.020000|size=772|pos=112988|flags=K__|data_hash=CRC32:a8a34bb9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=208800|pts_time=2.320000|dts=208800|dts_time=2.320000|duration=1800|duration_time=0.020000|size=775|pos=113928|flags=K__|data_hash=CRC32:2ebc4e7b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=210600|pts_time=2.340000|dts=210600|dts_time=2.340000|duration=1800|duration_time=0.020000|size=771|pos=114868|flags=K__|data_hash=CRC32:53744d32|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=212400|pts_time=2.360000|dts=212400|dts_time=2.360000|duration=1800|duration_time=0.020000|size=778|pos=115808|flags=K__|data_hash=CRC32:d32f77ce|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=214200|pts_time=2.380000|dts=214200|dts_time=2.380000|duration=1800|duration_time=0.020000|size=867|pos=116748|flags=K__|data_hash=CRC32:f582287c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=216000|pts_time=2.400000|dts=216000|dts_time=2.400000|duration=1800|duration_time=0.020000|size=778|pos=118064|flags=K__|data_hash=CRC32:144b9c4b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=217800|pts_time=2.420000|dts=217800|dts_time=2.420000|duration=1800|duration_time=0.020000|size=774|pos=119004|flags=K__|data_hash=CRC32:0cca881f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=219600|pts_time=2.440000|dts=219600|dts_time=2.440000|duration=1800|duration_time=0.020000|size=775|pos=119944|flags=K__|data_hash=CRC32:cddb1237|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=221400|pts_time=2.460000|dts=221400|dts_time=2.460000|duration=1800|duration_time=0.020000|size=774|pos=120884|flags=K__|data_hash=CRC32:10310b68|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=223200|pts_time=2.480000|dts=223200|dts_time=2.480000|duration=1800|duration_time=0.020000|size=774|pos=121824|flags=K__|data_hash=CRC32:dea871f8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=225000|pts_time=2.500000|dts=225000|dts_time=2.500000|duration=1800|duration_time=0.020000|size=772|pos=122764|flags=K__|data_hash=CRC32:d27e8c99|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=226800|pts_time=2.520000|dts=226800|dts_time=2.520000|duration=1800|duration_time=0.020000|size=774|pos=123704|flags=K__|data_hash=CRC32:3143b0e0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=228600|pts_time=2.540000|dts=228600|dts_time=2.540000|duration=1800|duration_time=0.020000|size=775|pos=124644|flags=K__|data_hash=CRC32:ebc2c2e6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=230400|pts_time=2.560000|dts=230400|dts_time=2.560000|duration=1800|duration_time=0.020000|size=773|pos=125584|flags=K__|data_hash=CRC32:dc63972d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=232200|pts_time=2.580000|dts=232200|dts_time=2.580000|duration=1800|duration_time=0.020000|size=773|pos=126524|flags=K__|data_hash=CRC32:6b141c19|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=234000|pts_time=2.600000|dts=234000|dts_time=2.600000|duration=1800|duration_time=0.020000|size=769|pos=127840|flags=K__|data_hash=CRC32:752ada1e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=235800|pts_time=2.620000|dts=235800|dts_time=2.620000|duration=1800|duration_time=0.020000|size=774|pos=128780|flags=K__|data_hash=CRC32:36d20d37|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=237600|pts_time=2.640000|dts=237600|dts_time=2.640000|duration=1800|duration_time=0.020000|size=779|pos=129720|flags=K__|data_hash=CRC32:1455dc2e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=239400|pts_time=2.660000|dts=239400|dts_time=2.660000|duration=1800|duration_time=0.020000|size=782|pos=130660|flags=K__|data_hash=CRC32:c6ffd5fe|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=241200|pts_time=2.680000|dts=241200|dts_time=2.680000|duration=1800|duration_time=0.020000|size=779|pos=131600|flags=K__|data_hash=CRC32:e4c83b97|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=243000|pts_time=2.700000|dts=243000|dts_time=2.700000|duration=1800|duration_time=0.020000|size=778|pos=132540|flags=K__|data_hash=CRC32:ee3f9b5a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=244800|pts_time=2.720000|dts=244800|dts_time=2.720000|duration=1800|duration_time=0.020000|size=771|pos=133480|flags=K__|data_hash=CRC32:7d0ee8b4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=246600|pts_time=2.740000|dts=246600|dts_time=2.740000|duration=1800|duration_time=0.020000|size=775|pos=134420|flags=K__|data_hash=CRC32:685b64d8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=248400|pts_time=2.760000|dts=248400|dts_time=2.760000|duration=1800|duration_time=0.020000|size=777|pos=135360|flags=K__|data_hash=CRC32:ab680b3f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=250200|pts_time=2.780000|dts=250200|dts_time=2.780000|duration=1800|duration_time=0.020000|size=773|pos=136300|flags=K__|data_hash=CRC32:8485bf04|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=252000|pts_time=2.800000|dts=252000|dts_time=2.800000|duration=1800|duration_time=0.020000|size=777|pos=137616|flags=K__|data_hash=CRC32:60e3ab3b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=253800|pts_time=2.820000|dts=253800|dts_time=2.820000|duration=1800|duration_time=0.020000|size=777|pos=138556|flags=K__|data_hash=CRC32:cbacc337|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=255600|pts_time=2.840000|dts=255600|dts_time=2.840000|duration=1800|duration_time=0.020000|size=908|pos=139496|flags=K__|data_hash=CRC32:852be5a3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=257400|pts_time=2.860000|dts=257400|dts_time=2.860000|duration=1800|duration_time=0.020000|size=777|pos=140624|flags=K__|data_hash=CRC32:743f04a8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=259200|pts_time=2.880000|dts=259200|dts_time=2.880000|duration=1800|duration_time=0.020000|size=772|pos=141564|flags=K__|data_hash=CRC32:0ed88196|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=261000|pts_time=2.900000|dts=261000|dts_time=2.900000|duration=1800|duration_time=0.020000|size=778|pos=142504|flags=K__|data_hash=CRC32:bf13126e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=262800|pts_time=2.920000|dts=262800|dts_time=2.920000|duration=1800|duration_time=0.020000|size=776|pos=143444|flags=K__|data_hash=CRC32:dd160d29|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=264600|pts_time=2.940000|dts=264600|dts_time=2.940000|duration=1800|duration_time=0.020000|size=775|pos=144384|flags=K__|data_hash=CRC32:65833aa7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=266400|pts_time=2.960000|dts=266400|dts_time=2.960000|duration=1800|duration_time=0.020000|size=772|pos=145324|flags=K__|data_hash=CRC32:9343d3d2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=268200|pts_time=2.980000|dts=268200|dts_time=2.980000|duration=1800|duration_time=0.020000|size=778|pos=146264|flags=K__|data_hash=CRC32:7da0cd8d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=270000|pts_time=3.000000|dts=270000|dts_time=3.000000|duration=1800|duration_time=0.020000|size=808|pos=147580|flags=K__|data_hash=CRC32:8a3298b7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=271800|pts_time=3.020000|dts=271800|dts_time=3.020000|duration=1800|duration_time=0.020000|size=836|pos=148520|flags=K__|data_hash=CRC32:604d40c4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=273600|pts_time=3.040000|dts=273600|dts_time=3.040000|duration=1800|duration_time=0.020000|size=913|pos=149460|flags=K__|data_hash=CRC32:ecd7b491|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=275400|pts_time=3.060000|dts=275400|dts_time=3.060000|duration=1800|duration_time=0.020000|size=837|pos=150588|flags=K__|data_hash=CRC32:f8907616|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=277200|pts_time=3.080000|dts=277200|dts_time=3.080000|duration=1800|duration_time=0.020000|size=834|pos=151528|flags=K__|data_hash=CRC32:c6701edc|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=279000|pts_time=3.100000|dts=279000|dts_time=3.100000|duration=1800|duration_time=0.020000|size=836|pos=152468|flags=K__|data_hash=CRC32:ed85bdee|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=280800|pts_time=3.120000|dts=280800|dts_time=3.120000|duration=1800|duration_time=0.020000|size=832|pos=153408|flags=K__|data_hash=CRC32:d9ea8517|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=282600|pts_time=3.140000|dts=282600|dts_time=3.140000|duration=1800|duration_time=0.020000|size=826|pos=154348|flags=K__|data_hash=CRC32:e396092f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=284400|pts_time=3.160000|dts=284400|dts_time=3.160000|duration=1800|duration_time=0.020000|size=817|pos=155288|flags=K__|data_hash=CRC32:1c628f31|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=286200|pts_time=3.180000|dts=286200|dts_time=3.180000|duration=1800|duration_time=0.020000|size=825|pos=156228|flags=K__|data_hash=CRC32:52183b8f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=288000|pts_time=3.200000|dts=288000|dts_time=3.200000|duration=1800|duration_time=0.020000|size=824|pos=157544|flags=K__|data_hash=CRC32:bbae2882|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=289800|pts_time=3.220000|dts=289800|dts_time=3.220000|duration=1800|duration_time=0.020000|size=828|pos=158484|flags=K__|data_hash=CRC32:bb5a7486|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=291600|pts_time=3.240000|dts=291600|dts_time=3.240000|duration=1800|duration_time=0.020000|size=833|pos=159424|flags=K__|data_hash=CRC32:ead8306a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=293400|pts_time=3.260000|dts=293400|dts_time=3.260000|duration=1800|duration_time=0.020000|size=832|pos=160364|flags=K__|data_hash=CRC32:82db1098|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=295200|pts_time=3.280000|dts=295200|dts_time=3.280000|duration=1800|duration_time=0.020000|size=896|pos=161304|flags=K__|data_hash=CRC32:688f5cb6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=297000|pts_time=3.300000|dts=297000|dts_time=3.300000|duration=1800|duration_time=0.020000|size=824|pos=162244|flags=K__|data_hash=CRC32:fdf34c0b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=298800|pts_time=3.320000|dts=298800|dts_time=3.320000|duration=1800|duration_time=0.020000|size=812|pos=163184|flags=K__|data_hash=CRC32:802e95d1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=300600|pts_time=3.340000|dts=300600|dts_time=3.340000|duration=1800|duration_time=0.020000|size=821|pos=164124|flags=K__|data_hash=CRC32:141404b8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=302400|pts_time=3.360000|dts=302400|dts_time=3.360000|duration=1800|duration_time=0.020000|size=883|pos=165064|flags=K__|data_hash=CRC32:3e39e373|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=304200|pts_time=3.380000|dts=304200|dts_time=3.380000|duration=1800|duration_time=0.020000|size=820|pos=166004|flags=K__|data_hash=CRC32:ce8d8234|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=306000|pts_time=3.400000|dts=306000|dts_time=3.400000|duration=1800|duration_time=0.020000|size=835|pos=167320|flags=K__|data_hash=CRC32:0f3c194d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=307800|pts_time=3.420000|dts=307800|dts_time=3.420000|duration=1800|duration_time=0.020000|size=833|pos=168260|flags=K__|data_hash=CRC32:3d5d60c4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=309600|pts_time=3.440000|dts=309600|dts_time=3.440000|duration=1800|duration_time=0.020000|size=830|pos=169200|flags=K__|data_hash=CRC32:f66b2c9f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=311400|pts_time=3.460000|dts=311400|dts_time=3.460000|duration=1800|duration_time=0.020000|size=820|pos=170140|flags=K__|data_hash=CRC32:44eb2398|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=313200|pts_time=3.480000|dts=313200|dts_time=3.480000|duration=1800|duration_time=0.020000|size=815|pos=171080|flags=K__|data_hash=CRC32:cec1f69c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=315000|pts_time=3.500000|dts=315000|dts_time=3.500000|duration=1800|duration_time=0.020000|size=827|pos=172020|flags=K__|data_hash=CRC32:57096eb1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=316800|pts_time=3.520000|dts=316800|dts_time=3.520000|duration=1800|duration_time=0.020000|size=819|pos=172960|flags=K__|data_hash=CRC32:66999a29|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=318600|pts_time=3.540000|dts=318600|dts_time=3.540000|duration=1800|duration_time=0.020000|size=828|pos=173900|flags=K__|data_hash=CRC32:0e598023|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=320400|pts_time=3.560000|dts=320400|dts_time=3.560000|duration=1800|duration_time=0.020000|size=830|pos=174840|flags=K__|data_hash=CRC32:8e728d2b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=322200|pts_time=3.580000|dts=322200|dts_time=3.580000|duration=1800|duration_time=0.020000|size=828|pos=175780|flags=K__|data_hash=CRC32:7e7549e3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=324000|pts_time=3.600000|dts=324000|dts_time=3.600000|duration=1800|duration_time=0.020000|size=829|pos=177096|flags=K__|data_hash=CRC32:62f96c18|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=325800|pts_time=3.620000|dts=325800|dts_time=3.620000|duration=1800|duration_time=0.020000|size=820|pos=178036|flags=K__|data_hash=CRC32:48d04b8a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=327600|pts_time=3.640000|dts=327600|dts_time=3.640000|duration=1800|duration_time=0.020000|size=823|pos=178976|flags=K__|data_hash=CRC32:7937563e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=329400|pts_time=3.660000|dts=329400|dts_time=3.660000|duration=1800|duration_time=0.020000|size=798|pos=179916|flags=K__|data_hash=CRC32:8e573ad0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=331200|pts_time=3.680000|dts=331200|dts_time=3.680000|duration=1800|duration_time=0.020000|size=772|pos=180856|flags=K__|data_hash=CRC32:ece4d7e7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=333000|pts_time=3.700000|dts=333000|dts_time=3.700000|duration=1800|duration_time=0.020000|size=779|pos=181796|flags=K__|data_hash=CRC32:4ca26e7d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=334800|pts_time=3.720000|dts=334800|dts_time=3.720000|duration=1800|duration_time=0.020000|size=774|pos=182736|flags=K__|data_hash=CRC32:8c347b2d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=336600|pts_time=3.740000|dts=336600|dts_time=3.740000|duration=1800|duration_time=0.020000|size=907|pos=183676|flags=K__|data_hash=CRC32:b50e55b8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=338400|pts_time=3.760000|dts=338400|dts_time=3.760000|duration=1800|duration_time=0.020000|size=772|pos=184804|flags=K__|data_hash=CRC32:e2ff539f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=340200|pts_time=3.780000|dts=340200|dts_time=3.780000|duration=1800|duration_time=0.020000|size=777|pos=185744|flags=K__|data_hash=CRC32:f86e1c5a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=342000|pts_time=3.800000|dts=342000|dts_time=3.800000|duration=1800|duration_time=0.020000|size=777|pos=187060|flags=K__|data_hash=CRC32:ff858811|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=343800|pts_time=3.820000|dts=343800|dts_time=3.820000|duration=1800|duration_time=0.020000|size=777|pos=188000|flags=K__|data_hash=CRC32:4b0da83e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=345600|pts_time=3.840000|dts=345600|dts_time=3.840000|duration=1800|duration_time=0.020000|size=775|pos=188940|flags=K__|data_hash=CRC32:605a41a9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=347400|pts_time=3.860000|dts=347400|dts_time=3.860000|duration=1800|duration_time=0.020000|size=773|pos=189880|flags=K__|data_hash=CRC32:d32c5756|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=349200|pts_time=3.880000|dts=349200|dts_time=3.880000|duration=1800|duration_time=0.020000|size=777|pos=190820|flags=K__|data_hash=CRC32:92c557ef|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=351000|pts_time=3.900000|dts=351000|dts_time=3.900000|duration=1800|duration_time=0.020000|size=777|pos=191760|flags=K__|data_hash=CRC32:c16056ca|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=352800|pts_time=3.920000|dts=352800|dts_time=3.920000|duration=1800|duration_time=0.020000|size=776|pos=192700|flags=K__|data_hash=CRC32:c84a2e99|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=354600|pts_time=3.940000|dts=354600|dts_time=3.940000|duration=1800|duration_time=0.020000|size=780|pos=193640|flags=K__|data_hash=CRC32:d59309d0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=356400|pts_time=3.960000|dts=356400|dts_time=3.960000|duration=1800|duration_time=0.020000|size=776|pos=194580|flags=K__|data_hash=CRC32:8312e1ba|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=358200|pts_time=3.980000|dts=358200|dts_time=3.980000|duration=1800|duration_time=0.020000|size=778|pos=195520|flags=K__|data_hash=CRC32:12d77a3e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=360000|pts_time=4.000000|dts=360000|dts_time=4.000000|duration=1800|duration_time=0.020000|size=774|pos=196836|flags=K__|data_hash=CRC32:86b417d4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=361800|pts_time=4.020000|dts=361800|dts_time=4.020000|duration=1800|duration_time=0.020000|size=778|pos=197776|flags=K__|data_hash=CRC32:a66ed4cf|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=363600|pts_time=4.040000|dts=363600|dts_time=4.040000|duration=1800|duration_time=0.020000|size=777|pos=198716|flags=K__|data_hash=CRC32:b686a5ca|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=365400|pts_time=4.060000|dts=365400|dts_time=4.060000|duration=1800|duration_time=0.020000|size=773|pos=199656|flags=K__|data_hash=CRC32:261ce45b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=367200|pts_time=4.080000|dts=367200|dts_time=4.080000|duration=1800|duration_time=0.020000|size=782|pos=200596|flags=K__|data_hash=CRC32:cbfbd1bf|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=369000|pts_time=4.100000|dts=369000|dts_time=4.100000|duration=1800|duration_time=0.020000|size=780|pos=201536|flags=K__|data_hash=CRC32:20b5484f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=370800|pts_time=4.120000|dts=370800|dts_time=4.120000|duration=1800|duration_time=0.020000|size=777|pos=202476|flags=K__|data_hash=CRC32:c4d54099|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=372600|pts_time=4.140000|dts=372600|dts_time=4.140000|duration=1800|duration_time=0.020000|size=775|pos=203416|flags=K__|data_hash=CRC32:cb665fdf|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=374400|pts_time=4.160000|dts=374400|dts_time=4.160000|duration=1800|duration_time=0.020000|size=777|pos=204356|flags=K__|data_hash=CRC32:0271ab1f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=376200|pts_time=4.180000|dts=376200|dts_time=4.180000|duration=1800|duration_time=0.020000|size=776|pos=205296|flags=K__|data_hash=CRC32:a82f4ab4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=378000|pts_time=4.200000|dts=378000|dts_time=4.200000|duration=1800|duration_time=0.020000|size=778|pos=206612|flags=K__|data_hash=CRC32:a1e09e3b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=379800|pts_time=4.220000|dts=379800|dts_time=4.220000|duration=1800|duration_time=0.020000|size=775|pos=207552|flags=K__|data_hash=CRC32:7b297a73|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=381600|pts_time=4.240000|dts=381600|dts_time=4.240000|duration=1800|duration_time=0.020000|size=775|pos=208492|flags=K__|data_hash=CRC32:2165ebef|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=383400|pts_time=4.260000|dts=383400|dts_time=4.260000|duration=1800|duration_time=0.020000|size=779|pos=209432|flags=K__|data_hash=CRC32:b802ae36|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=385200|pts_time=4.280000|dts=385200|dts_time=4.280000|duration=1800|duration_time=0.020000|size=779|pos=210372|flags=K__|data_hash=CRC32:36ca4657|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=387000|pts_time=4.300000|dts=387000|dts_time=4.300000|duration=1800|duration_time=0.020000|size=778|pos=211312|flags=K__|data_hash=CRC32:2fe8a70c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=388800|pts_time=4.320000|dts=388800|dts_time=4.320000|duration=1800|duration_time=0.020000|size=780|pos=212252|flags=K__|data_hash=CRC32:19c3bc8c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=390600|pts_time=4.340000|dts=390600|dts_time=4.340000|duration=1800|duration_time=0.020000|size=778|pos=213192|flags=K__|data_hash=CRC32:3b6c08d8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=392400|pts_time=4.360000|dts=392400|dts_time=4.360000|duration=1800|duration_time=0.020000|size=776|pos=214132|flags=K__|data_hash=CRC32:851471f3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=394200|pts_time=4.380000|dts=394200|dts_time=4.380000|duration=1800|duration_time=0.020000|size=777|pos=215072|flags=K__|data_hash=CRC32:5d33a166|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=396000|pts_time=4.400000|dts=396000|dts_time=4.400000|duration=1800|duration_time=0.020000|size=841|pos=216388|flags=K__|data_hash=CRC32:d0d1a21b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=397800|pts_time=4.420000|dts=397800|dts_time=4.420000|duration=1800|duration_time=0.020000|size=777|pos=217328|flags=K__|data_hash=CRC32:c21a3376|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=399600|pts_time=4.440000|dts=399600|dts_time=4.440000|duration=1800|duration_time=0.020000|size=780|pos=218268|flags=K__|data_hash=CRC32:0daaead6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=401400|pts_time=4.460000|dts=401400|dts_time=4.460000|duration=1800|duration_time=0.020000|size=777|pos=219208|flags=K__|data_hash=CRC32:01c07956|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=403200|pts_time=4.480000|dts=403200|dts_time=4.480000|duration=1800|duration_time=0.020000|size=777|pos=220148|flags=K__|data_hash=CRC32:f5b429c1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=405000|pts_time=4.500000|dts=405000|dts_time=4.500000|duration=1800|duration_time=0.020000|size=778|pos=221088|flags=K__|data_hash=CRC32:a46831d9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=406800|pts_time=4.520000|dts=406800|dts_time=4.520000|duration=1800|duration_time=0.020000|size=778|pos=222028|flags=K__|data_hash=CRC32:555d2cb1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=408600|pts_time=4.540000|dts=408600|dts_time=4.540000|duration=1800|duration_time=0.020000|size=779|pos=222968|flags=K__|data_hash=CRC32:7670785c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=410400|pts_time=4.560000|dts=410400|dts_time=4.560000|duration=1800|duration_time=0.020000|size=776|pos=223908|flags=K__|data_hash=CRC32:52a244cd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=412200|pts_time=4.580000|dts=412200|dts_time=4.580000|duration=1800|duration_time=0.020000|size=784|pos=224848|flags=K__|data_hash=CRC32:7ad67c41|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=414000|pts_time=4.600000|dts=414000|dts_time=4.600000|duration=1800|duration_time=0.020000|size=776|pos=226164|flags=K__|data_hash=CRC32:ddc7990b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=415800|pts_time=4.620000|dts=415800|dts_time=4.620000|duration=1800|duration_time=0.020000|size=778|pos=227104|flags=K__|data_hash=CRC32:8a49bff6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=417600|pts_time=4.640000|dts=417600|dts_time=4.640000|duration=1800|duration_time=0.020000|size=775|pos=228044|flags=K__|data_hash=CRC32:258dc60a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=419400|pts_time=4.660000|dts=419400|dts_time=4.660000|duration=1800|duration_time=0.020000|size=781|pos=228984|flags=K__|data_hash=CRC32:2dd6d159|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=421200|pts_time=4.680000|dts=421200|dts_time=4.680000|duration=1800|duration_time=0.020000|size=779|pos=229924|flags=K__|data_hash=CRC32:359ba790|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=423000|pts_time=4.700000|dts=423000|dts_time=4.700000|duration=1800|duration_time=0.020000|size=846|pos=230864|flags=K__|data_hash=CRC32:68cbef69|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=424800|pts_time=4.720000|dts=424800|dts_time=4.720000|duration=1800|duration_time=0.020000|size=776|pos=231804|flags=K__|data_hash=CRC32:cbce1c41|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=426600|pts_time=4.740000|dts=426600|dts_time=4.740000|duration=1800|duration_time=0.020000|size=781|pos=232744|flags=K__|data_hash=CRC32:a9a19b23|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=428400|pts_time=4.760000|dts=428400|dts_time=4.760000|duration=1800|duration_time=0.020000|size=783|pos=233684|flags=K__|data_hash=CRC32:f31b8def|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=430200|pts_time=4.780000|dts=430200|dts_time=4.780000|duration=1800|duration_time=0.020000|size=971|pos=234624|flags=K__|data_hash=CRC32:4dd92879|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=432000|pts_time=4.800000|dts=432000|dts_time=4.800000|duration=1800|duration_time=0.020000|size=970|pos=236128|flags=K__|data_hash=CRC32:7020e4a7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=433800|pts_time=4.820000|dts=433800|dts_time=4.820000|duration=1800|duration_time=0.020000|size=967|pos=237256|flags=K__|data_hash=CRC32:5f56efad|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=435600|pts_time=4.840000|dts=435600|dts_time=4.840000|duration=1800|duration_time=0.020000|size=776|pos=238384|flags=K__|data_hash=CRC32:4ae7101d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=437400|pts_time=4.860000|dts=437400|dts_time=4.860000|duration=1800|duration_time=0.020000|size=971|pos=239324|flags=K__|data_hash=CRC32:386c5965|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=439200|pts_time=4.880000|dts=439200|dts_time=4.880000|duration=1800|duration_time=0.020000|size=962|pos=240452|flags=K__|data_hash=CRC32:f2701022|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=441000|pts_time=4.900000|dts=441000|dts_time=4.900000|duration=1800|duration_time=0.020000|size=964|pos=241580|flags=K__|data_hash=CRC32:386bfd07|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=442800|pts_time=4.920000|dts=442800|dts_time=4.920000|duration=1800|duration_time=0.020000|size=773|pos=242708|flags=K__|data_hash=CRC32:080e4345|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=444600|pts_time=4.940000|dts=444600|dts_time=4.940000|duration=1800|duration_time=0.020000|size=770|pos=243648|flags=K__|data_hash=CRC32:4fbaa6b9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=446400|pts_time=4.960000|dts=446400|dts_time=4.960000|duration=1800|duration_time=0.020000|size=964|pos=244588|flags=K__|data_hash=CRC32:5c879539|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=448200|pts_time=4.980000|dts=448200|dts_time=4.980000|duration=1800|duration_time=0.020000|size=958|pos=245716|flags=K__|data_hash=CRC32:dac40562|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=450000|pts_time=5.000000|dts=450000|dts_time=5.000000|duration=1800|duration_time=0.020000|size=775|pos=247220|flags=K__|data_hash=CRC32:31f989e0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=451800|pts_time=5.020000|dts=451800|dts_time=5.020000|duration=1800|duration_time=0.020000|size=775|pos=248160|flags=K__|data_hash=CRC32:0149cc11|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=453600|pts_time=5.040000|dts=453600|dts_time=5.040000|duration=1800|duration_time=0.020000|size=966|pos=249100|flags=K__|data_hash=CRC32:1c226514|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=455400|pts_time=5.060000|dts=455400|dts_time=5.060000|duration=1800|duration_time=0.020000|size=843|pos=250228|flags=K__|data_hash=CRC32:991ab49b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=457200|pts_time=5.080000|dts=457200|dts_time=5.080000|duration=1800|duration_time=0.020000|size=846|pos=251168|flags=K__|data_hash=CRC32:2803c379|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=459000|pts_time=5.100000|dts=459000|dts_time=5.100000|duration=1800|duration_time=0.020000|size=775|pos=252108|flags=K__|data_hash=CRC32:2d95b53b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=460800|pts_time=5.120000|dts=460800|dts_time=5.120000|duration=1800|duration_time=0.020000|size=901|pos=253048|flags=K__|data_hash=CRC32:2a40955c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=462600|pts_time=5.140000|dts=462600|dts_time=5.140000|duration=1800|duration_time=0.020000|size=958|pos=254176|flags=K__|data_hash=CRC32:b46687d4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=464400|pts_time=5.160000|dts=464400|dts_time=5.160000|duration=1800|duration_time=0.020000|size=770|pos=255304|flags=K__|data_hash=CRC32:c4ec89eb|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=466200|pts_time=5.180000|dts=466200|dts_time=5.180000|duration=1800|duration_time=0.020000|size=773|pos=256244|flags=K__|data_hash=CRC32:d53fcf9c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=468000|pts_time=5.200000|dts=468000|dts_time=5.200000|duration=1800|duration_time=0.020000|size=768|pos=257560|flags=K__|data_hash=CRC32:eb9bfc19|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=469800|pts_time=5.220000|dts=469800|dts_time=5.220000|duration=1800|duration_time=0.020000|size=776|pos=258500|flags=K__|data_hash=CRC32:71e70489|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=471600|pts_time=5.240000|dts=471600|dts_time=5.240000|duration=1800|duration_time=0.020000|size=771|pos=259440|flags=K__|data_hash=CRC32:60a96aca|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=473400|pts_time=5.260000|dts=473400|dts_time=5.260000|duration=1800|duration_time=0.020000|size=772|pos=260380|flags=K__|data_hash=CRC32:ceca878e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=475200|pts_time=5.280000|dts=475200|dts_time=5.280000|duration=1800|duration_time=0.020000|size=958|pos=261320|flags=K__|data_hash=CRC32:ab40ffe7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=477000|pts_time=5.300000|dts=477000|dts_time=5.300000|duration=1800|duration_time=0.020000|size=771|pos=262448|flags=K__|data_hash=CRC32:0f8c3162|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=478800|pts_time=5.320000|dts=478800|dts_time=5.320000|duration=1800|duration_time=0.020000|size=770|pos=263388|flags=K__|data_hash=CRC32:af837825|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=480600|pts_time=5.340000|dts=480600|dts_time=5.340000|duration=1800|duration_time=0.020000|size=959|pos=264328|flags=K__|data_hash=CRC32:93a1bea9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=482400|pts_time=5.360000|dts=482400|dts_time=5.360000|duration=1800|duration_time=0.020000|size=769|pos=265456|flags=K__|data_hash=CRC32:e7289ab0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=484200|pts_time=5.380000|dts=484200|dts_time=5.380000|duration=1800|duration_time=0.020000|size=840|pos=266396|flags=K__|data_hash=CRC32:4b39626e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=486000|pts_time=5.400000|dts=486000|dts_time=5.400000|duration=1800|duration_time=0.020000|size=769|pos=267712|flags=K__|data_hash=CRC32:f4bc91d6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=487800|pts_time=5.420000|dts=487800|dts_time=5.420000|duration=1800|duration_time=0.020000|size=767|pos=268652|flags=K__|data_hash=CRC32:68dd482f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=489600|pts_time=5.440000|dts=489600|dts_time=5.440000|duration=1800|duration_time=0.020000|size=951|pos=269592|flags=K__|data_hash=CRC32:61ab6014|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=491400|pts_time=5.460000|dts=491400|dts_time=5.460000|duration=1800|duration_time=0.020000|size=769|pos=270720|flags=K__|data_hash=CRC32:232f6af8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=493200|pts_time=5.480000|dts=493200|dts_time=5.480000|duration=1800|duration_time=0.020000|size=958|pos=271660|flags=K__|data_hash=CRC32:9a4372e9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=495000|pts_time=5.500000|dts=495000|dts_time=5.500000|duration=1800|duration_time=0.020000|size=773|pos=272788|flags=K__|data_hash=CRC32:f7044435|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=496800|pts_time=5.520000|dts=496800|dts_time=5.520000|duration=1800|duration_time=0.020000|size=771|pos=273728|flags=K__|data_hash=CRC32:2d36f75f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=498600|pts_time=5.540000|dts=498600|dts_time=5.540000|duration=1800|duration_time=0.020000|size=768|pos=274668|flags=K__|data_hash=CRC32:11858457|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=500400|pts_time=5.560000|dts=500400|dts_time=5.560000|duration=1800|duration_time=0.020000|size=765|pos=275608|flags=K__|data_hash=CRC32:104cc3b1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=502200|pts_time=5.580000|dts=502200|dts_time=5.580000|duration=1800|duration_time=0.020000|size=774|pos=276548|flags=K__|data_hash=CRC32:8ed3cf9c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=504000|pts_time=5.600000|dts=504000|dts_time=5.600000|duration=1800|duration_time=0.020000|size=837|pos=277864|flags=K__|data_hash=CRC32:16b50427|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=505800|pts_time=5.620000|dts=505800|dts_time=5.620000|duration=1800|duration_time=0.020000|size=773|pos=278804|flags=K__|data_hash=CRC32:c5c042c3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=507600|pts_time=5.640000|dts=507600|dts_time=5.640000|duration=1800|duration_time=0.020000|size=773|pos=279744|flags=K__|data_hash=CRC32:722e401f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=509400|pts_time=5.660000|dts=509400|dts_time=5.660000|duration=1800|duration_time=0.020000|size=770|pos=280684|flags=K__|data_hash=CRC32:831f3604|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=511200|pts_time=5.680000|dts=511200|dts_time=5.680000|duration=1800|duration_time=0.020000|size=770|pos=281624|flags=K__|data_hash=CRC32:7718e73e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=513000|pts_time=5.700000|dts=513000|dts_time=5.700000|duration=1800|duration_time=0.020000|size=774|pos=282564|flags=K__|data_hash=CRC32:170731a0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=514800|pts_time=5.720000|dts=514800|dts_time=5.720000|duration=1800|duration_time=0.020000|size=767|pos=283504|flags=K__|data_hash=CRC32:d73c42a8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=516600|pts_time=5.740000|dts=516600|dts_time=5.740000|duration=1800|duration_time=0.020000|size=774|pos=284444|flags=K__|data_hash=CRC32:854f9a2e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=518400|pts_time=5.760000|dts=518400|dts_time=5.760000|duration=1800|duration_time=0.020000|size=833|pos=285384|flags=K__|data_hash=CRC32:7d64106d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=520200|pts_time=5.780000|dts=520200|dts_time=5.780000|duration=1800|duration_time=0.020000|size=774|pos=286324|flags=K__|data_hash=CRC32:02e139fa|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=522000|pts_time=5.800000|dts=522000|dts_time=5.800000|duration=1800|duration_time=0.020000|size=768|pos=287640|flags=K__|data_hash=CRC32:8b5d5f3b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=523800|pts_time=5.820000|dts=523800|dts_time=5.820000|duration=1800|duration_time=0.020000|size=773|pos=288580|flags=K__|data_hash=CRC32:fa25f507|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=525600|pts_time=5.840000|dts=525600|dts_time=5.840000|duration=1800|duration_time=0.020000|size=768|pos=289520|flags=K__|data_hash=CRC32:ccbf6593|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=527400|pts_time=5.860000|dts=527400|dts_time=5.860000|duration=1800|duration_time=0.020000|size=769|pos=290460|flags=K__|data_hash=CRC32:cea23a52|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=529200|pts_time=5.880000|dts=529200|dts_time=5.880000|duration=1800|duration_time=0.020000|size=767|pos=291400|flags=K__|data_hash=CRC32:3ff8eced|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=531000|pts_time=5.900000|dts=531000|dts_time=5.900000|duration=1800|duration_time=0.020000|size=773|pos=292340|flags=K__|data_hash=CRC32:a5d92bfd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=532800|pts_time=5.920000|dts=532800|dts_time=5.920000|duration=1800|duration_time=0.020000|size=774|pos=293280|flags=K__|data_hash=CRC32:582c9c2e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=534600|pts_time=5.940000|dts=534600|dts_time=5.940000|duration=1800|duration_time=0.020000|size=769|pos=294220|flags=K__|data_hash=CRC32:cc23f8d9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=536400|pts_time=5.960000|dts=536400|dts_time=5.960000|duration=1800|duration_time=0.020000|size=833|pos=295160|flags=K__|data_hash=CRC32:5b9a2c15|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=538200|pts_time=5.980000|dts=538200|dts_time=5.980000|duration=1800|duration_time=0.020000|size=768|pos=296100|flags=K__|data_hash=CRC32:8c48e7c5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=540000|pts_time=6.000000|dts=540000|dts_time=6.000000|duration=1800|duration_time=0.020000|size=772|pos=297416|flags=K__|data_hash=CRC32:c431b153|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=541800|pts_time=6.020000|dts=541800|dts_time=6.020000|duration=1800|duration_time=0.020000|size=839|pos=298356|flags=K__|data_hash=CRC32:9cfe17d0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=543600|pts_time=6.040000|dts=543600|dts_time=6.040000|duration=1800|duration_time=0.020000|size=769|pos=299296|flags=K__|data_hash=CRC32:72510fbb|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=545400|pts_time=6.060000|dts=545400|dts_time=6.060000|duration=1800|duration_time=0.020000|size=769|pos=300236|flags=K__|data_hash=CRC32:81830ddd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=547200|pts_time=6.080000|dts=547200|dts_time=6.080000|duration=1800|duration_time=0.020000|size=771|pos=301176|flags=K__|data_hash=CRC32:43102486|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=549000|pts_time=6.100000|dts=549000|dts_time=6.100000|duration=1800|duration_time=0.020000|size=770|pos=302116|flags=K__|data_hash=CRC32:49018a2e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=550800|pts_time=6.120000|dts=550800|dts_time=6.120000|duration=1800|duration_time=0.020000|size=771|pos=303056|flags=K__|data_hash=CRC32:3a01967a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=552600|pts_time=6.140000|dts=552600|dts_time=6.140000|duration=1800|duration_time=0.020000|size=767|pos=303996|flags=K__|data_hash=CRC32:028a7ab9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=554400|pts_time=6.160000|dts=554400|dts_time=6.160000|duration=1800|duration_time=0.020000|size=899|pos=304936|flags=K__|data_hash=CRC32:012e3f77|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=556200|pts_time=6.180000|dts=556200|dts_time=6.180000|duration=1800|duration_time=0.020000|size=953|pos=305876|flags=K__|data_hash=CRC32:60935688|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=558000|pts_time=6.200000|dts=558000|dts_time=6.200000|duration=1800|duration_time=0.020000|size=770|pos=307380|flags=K__|data_hash=CRC32:1f54722f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=559800|pts_time=6.220000|dts=559800|dts_time=6.220000|duration=1800|duration_time=0.020000|size=770|pos=308320|flags=K__|data_hash=CRC32:7786349b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=561600|pts_time=6.240000|dts=561600|dts_time=6.240000|duration=1800|duration_time=0.020000|size=771|pos=309260|flags=K__|data_hash=CRC32:1be2464d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=563400|pts_time=6.260000|dts=563400|dts_time=6.260000|duration=1800|duration_time=0.020000|size=770|pos=310200|flags=K__|data_hash=CRC32:cf6b28b9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=565200|pts_time=6.280000|dts=565200|dts_time=6.280000|duration=1800|duration_time=0.020000|size=769|pos=311140|flags=K__|data_hash=CRC32:63fa4ab0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=567000|pts_time=6.300000|dts=567000|dts_time=6.300000|duration=1800|duration_time=0.020000|size=896|pos=312080|flags=K__|data_hash=CRC32:06a8e324|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=568800|pts_time=6.320000|dts=568800|dts_time=6.320000|duration=1800|duration_time=0.020000|size=957|pos=313020|flags=K__|data_hash=CRC32:c37f55e9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=570600|pts_time=6.340000|dts=570600|dts_time=6.340000|duration=1800|duration_time=0.020000|size=773|pos=314148|flags=K__|data_hash=CRC32:82f8ac84|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=572400|pts_time=6.360000|dts=572400|dts_time=6.360000|duration=1800|duration_time=0.020000|size=774|pos=315088|flags=K__|data_hash=CRC32:3ed82724|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=574200|pts_time=6.380000|dts=574200|dts_time=6.380000|duration=1800|duration_time=0.020000|size=956|pos=316028|flags=K__|data_hash=CRC32:ed21dfec|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=576000|pts_time=6.400000|dts=576000|dts_time=6.400000|duration=1800|duration_time=0.020000|size=768|pos=317532|flags=K__|data_hash=CRC32:ef20c09c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=577800|pts_time=6.420000|dts=577800|dts_time=6.420000|duration=1800|duration_time=0.020000|size=770|pos=318472|flags=K__|data_hash=CRC32:5f72438e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=579600|pts_time=6.440000|dts=579600|dts_time=6.440000|duration=1800|duration_time=0.020000|size=771|pos=319412|flags=K__|data_hash=CRC32:831f56d5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=581400|pts_time=6.460000|dts=581400|dts_time=6.460000|duration=1800|duration_time=0.020000|size=955|pos=320352|flags=K__|data_hash=CRC32:a3fb153b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=583200|pts_time=6.480000|dts=583200|dts_time=6.480000|duration=1800|duration_time=0.020000|size=953|pos=321480|flags=K__|data_hash=CRC32:109825ac|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=585000|pts_time=6.500000|dts=585000|dts_time=6.500000|duration=1800|duration_time=0.020000|size=767|pos=322608|flags=K__|data_hash=CRC32:5cb97953|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=586800|pts_time=6.520000|dts=586800|dts_time=6.520000|duration=1800|duration_time=0.020000|size=768|pos=323548|flags=K__|data_hash=CRC32:9aa43658|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=588600|pts_time=6.540000|dts=588600|dts_time=6.540000|duration=1800|duration_time=0.020000|size=774|pos=324488|flags=K__|data_hash=CRC32:0ccad3c6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=590400|pts_time=6.560000|dts=590400|dts_time=6.560000|duration=1800|duration_time=0.020000|size=835|pos=325428|flags=K__|data_hash=CRC32:ee1e951f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=592200|pts_time=6.580000|dts=592200|dts_time=6.580000|duration=1800|duration_time=0.020000|size=768|pos=326368|flags=K__|data_hash=CRC32:7e964664|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=594000|pts_time=6.600000|dts=594000|dts_time=6.600000|duration=1800|duration_time=0.020000|size=769|pos=327684|flags=K__|data_hash=CRC32:46489e72|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=595800|pts_time=6.620000|dts=595800|dts_time=6.620000|duration=1800|duration_time=0.020000|size=771|pos=328624|flags=K__|data_hash=CRC32:528f881d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=597600|pts_time=6.640000|dts=597600|dts_time=6.640000|duration=1800|duration_time=0.020000|size=771|pos=329564|flags=K__|data_hash=CRC32:e776ddf8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=599400|pts_time=6.660000|dts=599400|dts_time=6.660000|duration=1800|duration_time=0.020000|size=770|pos=330504|flags=K__|data_hash=CRC32:f4d9468d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=601200|pts_time=6.680000|dts=601200|dts_time=6.680000|duration=1800|duration_time=0.020000|size=768|pos=331444|flags=K__|data_hash=CRC32:0b5bc3e0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=603000|pts_time=6.700000|dts=603000|dts_time=6.700000|duration=1800|duration_time=0.020000|size=951|pos=332384|flags=K__|data_hash=CRC32:4c6d023d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=604800|pts_time=6.720000|dts=604800|dts_time=6.720000|duration=1800|duration_time=0.020000|size=950|pos=333512|flags=K__|data_hash=CRC32:29588833|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=606600|pts_time=6.740000|dts=606600|dts_time=6.740000|duration=1800|duration_time=0.020000|size=947|pos=334640|flags=K__|data_hash=CRC32:12f446a5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=608400|pts_time=6.760000|dts=608400|dts_time=6.760000|duration=1800|duration_time=0.020000|size=956|pos=335768|flags=K__|data_hash=CRC32:39a765b6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=610200|pts_time=6.780000|dts=610200|dts_time=6.780000|duration=1800|duration_time=0.020000|size=951|pos=336896|flags=K__|data_hash=CRC32:79ab4162|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=612000|pts_time=6.800000|dts=612000|dts_time=6.800000|duration=1800|duration_time=0.020000|size=943|pos=338400|flags=K__|data_hash=CRC32:1c20d61c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=613800|pts_time=6.820000|dts=613800|dts_time=6.820000|duration=1800|duration_time=0.020000|size=766|pos=339528|flags=K__|data_hash=CRC32:0e5d1ee5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=615600|pts_time=6.840000|dts=615600|dts_time=6.840000|duration=1800|duration_time=0.020000|size=890|pos=340468|flags=K__|data_hash=CRC32:27c19b26|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=617400|pts_time=6.860000|dts=617400|dts_time=6.860000|duration=1800|duration_time=0.020000|size=952|pos=341408|flags=K__|data_hash=CRC32:8ba8ff4c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=619200|pts_time=6.880000|dts=619200|dts_time=6.880000|duration=1800|duration_time=0.020000|size=766|pos=342536|flags=K__|data_hash=CRC32:61b51e53|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=621000|pts_time=6.900000|dts=621000|dts_time=6.900000|duration=1800|duration_time=0.020000|size=767|pos=343476|flags=K__|data_hash=CRC32:223fd4b8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=622800|pts_time=6.920000|dts=622800|dts_time=6.920000|duration=1800|duration_time=0.020000|size=760|pos=344416|flags=K__|data_hash=CRC32:221e6f8a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=624600|pts_time=6.940000|dts=624600|dts_time=6.940000|duration=1800|duration_time=0.020000|size=946|pos=345356|flags=K__|data_hash=CRC32:623d901e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=626400|pts_time=6.960000|dts=626400|dts_time=6.960000|duration=1800|duration_time=0.020000|size=769|pos=346484|flags=K__|data_hash=CRC32:584cd53d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=628200|pts_time=6.980000|dts=628200|dts_time=6.980000|duration=1800|duration_time=0.020000|size=760|pos=347424|flags=K__|data_hash=CRC32:179b3137|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=630000|pts_time=7.000000|dts=630000|dts_time=7.000000|duration=1800|duration_time=0.020000|size=762|pos=348740|flags=K__|data_hash=CRC32:e0e617f2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=631800|pts_time=7.020000|dts=631800|dts_time=7.020000|duration=1800|duration_time=0.020000|size=767|pos=349680|flags=K__|data_hash=CRC32:560639a0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=633600|pts_time=7.040000|dts=633600|dts_time=7.040000|duration=1800|duration_time=0.020000|size=767|pos=350620|flags=K__|data_hash=CRC32:a88ea02f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=635400|pts_time=7.060000|dts=635400|dts_time=7.060000|duration=1800|duration_time=0.020000|size=763|pos=351560|flags=K__|data_hash=CRC32:6a9f391f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=637200|pts_time=7.080000|dts=637200|dts_time=7.080000|duration=1800|duration_time=0.020000|size=760|pos=352500|flags=K__|data_hash=CRC32:217730ab|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=639000|pts_time=7.100000|dts=639000|dts_time=7.100000|duration=1800|duration_time=0.020000|size=763|pos=353440|flags=K__|data_hash=CRC32:ffa59273|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=640800|pts_time=7.120000|dts=640800|dts_time=7.120000|duration=1800|duration_time=0.020000|size=764|pos=354380|flags=K__|data_hash=CRC32:05a70a45|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=642600|pts_time=7.140000|dts=642600|dts_time=7.140000|duration=1800|duration_time=0.020000|size=764|pos=355320|flags=K__|data_hash=CRC32:1e2e4d40|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=644400|pts_time=7.160000|dts=644400|dts_time=7.160000|duration=1800|duration_time=0.020000|size=763|pos=356260|flags=K__|data_hash=CRC32:695b9d24|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=646200|pts_time=7.180000|dts=646200|dts_time=7.180000|duration=1800|duration_time=0.020000|size=763|pos=357200|flags=K__|data_hash=CRC32:007b90ce|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=648000|pts_time=7.200000|dts=648000|dts_time=7.200000|duration=1800|duration_time=0.020000|size=764|pos=358516|flags=K__|data_hash=CRC32:188da6de|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=649800|pts_time=7.220000|dts=649800|dts_time=7.220000|duration=1800|duration_time=0.020000|size=766|pos=359456|flags=K__|data_hash=CRC32:1046d54c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=651600|pts_time=7.240000|dts=651600|dts_time=7.240000|duration=1800|duration_time=0.020000|size=767|pos=360396|flags=K__|data_hash=CRC32:aa450d3d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=653400|pts_time=7.260000|dts=653400|dts_time=7.260000|duration=1800|duration_time=0.020000|size=765|pos=361336|flags=K__|data_hash=CRC32:80bb936b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=655200|pts_time=7.280000|dts=655200|dts_time=7.280000|duration=1800|duration_time=0.020000|size=767|pos=362276|flags=K__|data_hash=CRC32:47bc2556|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=657000|pts_time=7.300000|dts=657000|dts_time=7.300000|duration=1800|duration_time=0.020000|size=763|pos=363216|flags=K__|data_hash=CRC32:97d4c99c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=658800|pts_time=7.320000|dts=658800|dts_time=7.320000|duration=1800|duration_time=0.020000|size=767|pos=364156|flags=K__|data_hash=CRC32:37252d43|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=660600|pts_time=7.340000|dts=660600|dts_time=7.340000|duration=1800|duration_time=0.020000|size=768|pos=365096|flags=K__|data_hash=CRC32:76918244|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=662400|pts_time=7.360000|dts=662400|dts_time=7.360000|duration=1800|duration_time=0.020000|size=764|pos=366036|flags=K__|data_hash=CRC32:5ba0d5d3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=664200|pts_time=7.380000|dts=664200|dts_time=7.380000|duration=1800|duration_time=0.020000|size=765|pos=366976|flags=K__|data_hash=CRC32:5b2b81f0|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=666000|pts_time=7.400000|dts=666000|dts_time=7.400000|duration=1800|duration_time=0.020000|size=764|pos=368292|flags=K__|data_hash=CRC32:161f0b38|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=667800|pts_time=7.420000|dts=667800|dts_time=7.420000|duration=1800|duration_time=0.020000|size=769|pos=369232|flags=K__|data_hash=CRC32:78b4530b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=669600|pts_time=7.440000|dts=669600|dts_time=7.440000|duration=1800|duration_time=0.020000|size=766|pos=370172|flags=K__|data_hash=CRC32:c0844a4f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=671400|pts_time=7.460000|dts=671400|dts_time=7.460000|duration=1800|duration_time=0.020000|size=766|pos=371112|flags=K__|data_hash=CRC32:09ef7940|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=673200|pts_time=7.480000|dts=673200|dts_time=7.480000|duration=1800|duration_time=0.020000|size=829|pos=372052|flags=K__|data_hash=CRC32:053ff4c6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=675000|pts_time=7.500000|dts=675000|dts_time=7.500000|duration=1800|duration_time=0.020000|size=765|pos=372992|flags=K__|data_hash=CRC32:dffb6a19|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=676800|pts_time=7.520000|dts=676800|dts_time=7.520000|duration=1800|duration_time=0.020000|size=766|pos=373932|flags=K__|data_hash=CRC32:95240406|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=678600|pts_time=7.540000|dts=678600|dts_time=7.540000|duration=1800|duration_time=0.020000|size=766|pos=374872|flags=K__|data_hash=CRC32:e2e8f563|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=680400|pts_time=7.560000|dts=680400|dts_time=7.560000|duration=1800|duration_time=0.020000|size=898|pos=375812|flags=K__|data_hash=CRC32:c1c53334|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=682200|pts_time=7.580000|dts=682200|dts_time=7.580000|duration=1800|duration_time=0.020000|size=767|pos=376940|flags=K__|data_hash=CRC32:f122e957|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=684000|pts_time=7.600000|dts=684000|dts_time=7.600000|duration=1800|duration_time=0.020000|size=896|pos=378256|flags=K__|data_hash=CRC32:cd022652|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=685800|pts_time=7.620000|dts=685800|dts_time=7.620000|duration=1800|duration_time=0.020000|size=764|pos=379196|flags=K__|data_hash=CRC32:909c400c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=687600|pts_time=7.640000|dts=687600|dts_time=7.640000|duration=1800|duration_time=0.020000|size=762|pos=380136|flags=K__|data_hash=CRC32:7340fb8d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=689400|pts_time=7.660000|dts=689400|dts_time=7.660000|duration=1800|duration_time=0.020000|size=762|pos=381076|flags=K__|data_hash=CRC32:46b59223|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=691200|pts_time=7.680000|dts=691200|dts_time=7.680000|duration=1800|duration_time=0.020000|size=763|pos=382016|flags=K__|data_hash=CRC32:2f1ebb7e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=693000|pts_time=7.700000|dts=693000|dts_time=7.700000|duration=1800|duration_time=0.020000|size=947|pos=382956|flags=K__|data_hash=CRC32:b56bee4b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=694800|pts_time=7.720000|dts=694800|dts_time=7.720000|duration=1800|duration_time=0.020000|size=767|pos=384084|flags=K__|data_hash=CRC32:57c778a9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=696600|pts_time=7.740000|dts=696600|dts_time=7.740000|duration=1800|duration_time=0.020000|size=957|pos=385024|flags=K__|data_hash=CRC32:599b6964|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=698400|pts_time=7.760000|dts=698400|dts_time=7.760000|duration=1800|duration_time=0.020000|size=955|pos=386152|flags=K__|data_hash=CRC32:2351bfa3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=700200|pts_time=7.780000|dts=700200|dts_time=7.780000|duration=1800|duration_time=0.020000|size=767|pos=387280|flags=K__|data_hash=CRC32:f31f5d14|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=702000|pts_time=7.800000|dts=702000|dts_time=7.800000|duration=1800|duration_time=0.020000|size=767|pos=388596|flags=K__|data_hash=CRC32:c0f7f4b5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=703800|pts_time=7.820000|dts=703800|dts_time=7.820000|duration=1800|duration_time=0.020000|size=764|pos=389536|flags=K__|data_hash=CRC32:f321de8a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=705600|pts_time=7.840000|dts=705600|dts_time=7.840000|duration=1800|duration_time=0.020000|size=763|pos=390476|flags=K__|data_hash=CRC32:64e7e790|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=707400|pts_time=7.860000|dts=707400|dts_time=7.860000|duration=1800|duration_time=0.020000|size=769|pos=391416|flags=K__|data_hash=CRC32:d9bef93e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=709200|pts_time=7.880000|dts=709200|dts_time=7.880000|duration=1800|duration_time=0.020000|size=766|pos=392356|flags=K__|data_hash=CRC32:b08e677b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=711000|pts_time=7.900000|dts=711000|dts_time=7.900000|duration=1800|duration_time=0.020000|size=762|pos=393296|flags=K__|data_hash=CRC32:cc2d57f3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=712800|pts_time=7.920000|dts=712800|dts_time=7.920000|duration=1800|duration_time=0.020000|size=766|pos=394236|flags=K__|data_hash=CRC32:920b310d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=714600|pts_time=7.940000|dts=714600|dts_time=7.940000|duration=1800|duration_time=0.020000|size=768|pos=395176|flags=K__|data_hash=CRC32:7547a71e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=716400|pts_time=7.960000|dts=716400|dts_time=7.960000|duration=1800|duration_time=0.020000|size=765|pos=396116|flags=K__|data_hash=CRC32:6d0f72a9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=718200|pts_time=7.980000|dts=718200|dts_time=7.980000|duration=1800|duration_time=0.020000|size=953|pos=397056|flags=K__|data_hash=CRC32:6daae92b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=720000|pts_time=8.000000|dts=720000|dts_time=8.000000|duration=1800|duration_time=0.020000|size=769|pos=398560|flags=K__|data_hash=CRC32:8bd8704e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=721800|pts_time=8.020000|dts=721800|dts_time=8.020000|duration=1800|duration_time=0.020000|size=955|pos=399500|flags=K__|data_hash=CRC32:111f49de|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=723600|pts_time=8.040000|dts=723600|dts_time=8.040000|duration=1800|duration_time=0.020000|size=952|pos=400628|flags=K__|data_hash=CRC32:c6e266d5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=725400|pts_time=8.060000|dts=725400|dts_time=8.060000|duration=1800|duration_time=0.020000|size=951|pos=401756|flags=K__|data_hash=CRC32:b0f5283f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=727200|pts_time=8.080000|dts=727200|dts_time=8.080000|duration=1800|duration_time=0.020000|size=954|pos=402884|flags=K__|data_hash=CRC32:f70d4475|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=729000|pts_time=8.100000|dts=729000|dts_time=8.100000|duration=1800|duration_time=0.020000|size=948|pos=404012|flags=K__|data_hash=CRC32:371078df|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=730800|pts_time=8.120000|dts=730800|dts_time=8.120000|duration=1800|duration_time=0.020000|size=761|pos=405140|flags=K__|data_hash=CRC32:c2aa814b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=732600|pts_time=8.140000|dts=732600|dts_time=8.140000|duration=1800|duration_time=0.020000|size=763|pos=406080|flags=K__|data_hash=CRC32:188194bc|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=734400|pts_time=8.160000|dts=734400|dts_time=8.160000|duration=1800|duration_time=0.020000|size=760|pos=407020|flags=K__|data_hash=CRC32:982ba78c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=736200|pts_time=8.180000|dts=736200|dts_time=8.180000|duration=1800|duration_time=0.020000|size=764|pos=407960|flags=K__|data_hash=CRC32:bf244c73|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=738000|pts_time=8.200000|dts=738000|dts_time=8.200000|duration=1800|duration_time=0.020000|size=764|pos=409276|flags=K__|data_hash=CRC32:8bdf82ed|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=739800|pts_time=8.220000|dts=739800|dts_time=8.220000|duration=1800|duration_time=0.020000|size=946|pos=410216|flags=K__|data_hash=CRC32:acb2d4f3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=741600|pts_time=8.240000|dts=741600|dts_time=8.240000|duration=1800|duration_time=0.020000|size=758|pos=411344|flags=K__|data_hash=CRC32:1cefab3c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=743400|pts_time=8.260000|dts=743400|dts_time=8.260000|duration=1800|duration_time=0.020000|size=950|pos=412284|flags=K__|data_hash=CRC32:0bd02594|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=745200|pts_time=8.280000|dts=745200|dts_time=8.280000|duration=1800|duration_time=0.020000|size=769|pos=413412|flags=K__|data_hash=CRC32:cc6fff1d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=747000|pts_time=8.300000|dts=747000|dts_time=8.300000|duration=1800|duration_time=0.020000|size=764|pos=414352|flags=K__|data_hash=CRC32:cb2fc3d9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=748800|pts_time=8.320000|dts=748800|dts_time=8.320000|duration=1800|duration_time=0.020000|size=757|pos=415292|flags=K__|data_hash=CRC32:860da403|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=750600|pts_time=8.340000|dts=750600|dts_time=8.340000|duration=1800|duration_time=0.020000|size=761|pos=416232|flags=K__|data_hash=CRC32:14aca2c6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=752400|pts_time=8.360000|dts=752400|dts_time=8.360000|duration=1800|duration_time=0.020000|size=761|pos=417172|flags=K__|data_hash=CRC32:c5d24ee7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=754200|pts_time=8.380000|dts=754200|dts_time=8.380000|duration=1800|duration_time=0.020000|size=759|pos=418112|flags=K__|data_hash=CRC32:91680f09|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=756000|pts_time=8.400000|dts=756000|dts_time=8.400000|duration=1800|duration_time=0.020000|size=758|pos=419428|flags=K__|data_hash=CRC32:c6b2948d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=757800|pts_time=8.420000|dts=757800|dts_time=8.420000|duration=1800|duration_time=0.020000|size=767|pos=420368|flags=K__|data_hash=CRC32:20ff251c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=759600|pts_time=8.440000|dts=759600|dts_time=8.440000|duration=1800|duration_time=0.020000|size=761|pos=421308|flags=K__|data_hash=CRC32:d9fa6569|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=761400|pts_time=8.460000|dts=761400|dts_time=8.460000|duration=1800|duration_time=0.020000|size=828|pos=422248|flags=K__|data_hash=CRC32:871a83c7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=763200|pts_time=8.480000|dts=763200|dts_time=8.480000|duration=1800|duration_time=0.020000|size=759|pos=423188|flags=K__|data_hash=CRC32:ad2423ee|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=765000|pts_time=8.500000|dts=765000|dts_time=8.500000|duration=1800|duration_time=0.020000|size=761|pos=424128|flags=K__|data_hash=CRC32:4e9b7b6e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=766800|pts_time=8.520000|dts=766800|dts_time=8.520000|duration=1800|duration_time=0.020000|size=762|pos=425068|flags=K__|data_hash=CRC32:4aa3582f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=768600|pts_time=8.540000|dts=768600|dts_time=8.540000|duration=1800|duration_time=0.020000|size=761|pos=426008|flags=K__|data_hash=CRC32:15952f9f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=770400|pts_time=8.560000|dts=770400|dts_time=8.560000|duration=1800|duration_time=0.020000|size=757|pos=426948|flags=K__|data_hash=CRC32:55db10c7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=772200|pts_time=8.580000|dts=772200|dts_time=8.580000|duration=1800|duration_time=0.020000|size=759|pos=427888|flags=K__|data_hash=CRC32:1cfff77c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=774000|pts_time=8.600000|dts=774000|dts_time=8.600000|duration=1800|duration_time=0.020000|size=759|pos=429204|flags=K__|data_hash=CRC32:93bf7a2e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=775800|pts_time=8.620000|dts=775800|dts_time=8.620000|duration=1800|duration_time=0.020000|size=761|pos=430144|flags=K__|data_hash=CRC32:75577b1c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=777600|pts_time=8.640000|dts=777600|dts_time=8.640000|duration=1800|duration_time=0.020000|size=756|pos=431084|flags=K__|data_hash=CRC32:fe81112c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=779400|pts_time=8.660000|dts=779400|dts_time=8.660000|duration=1800|duration_time=0.020000|size=765|pos=432024|flags=K__|data_hash=CRC32:0ddc28c1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=781200|pts_time=8.680000|dts=781200|dts_time=8.680000|duration=1800|duration_time=0.020000|size=759|pos=432964|flags=K__|data_hash=CRC32:a9dda185|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=783000|pts_time=8.700000|dts=783000|dts_time=8.700000|duration=1800|duration_time=0.020000|size=759|pos=433904|flags=K__|data_hash=CRC32:e10197bd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=784800|pts_time=8.720000|dts=784800|dts_time=8.720000|duration=1800|duration_time=0.020000|size=761|pos=434844|flags=K__|data_hash=CRC32:f1683c68|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=786600|pts_time=8.740000|dts=786600|dts_time=8.740000|duration=1800|duration_time=0.020000|size=762|pos=435784|flags=K__|data_hash=CRC32:f6eee942|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=788400|pts_time=8.760000|dts=788400|dts_time=8.760000|duration=1800|duration_time=0.020000|size=771|pos=436724|flags=K__|data_hash=CRC32:6ab1ef22|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=790200|pts_time=8.780000|dts=790200|dts_time=8.780000|duration=1800|duration_time=0.020000|size=758|pos=437664|flags=K__|data_hash=CRC32:6920a9e6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=792000|pts_time=8.800000|dts=792000|dts_time=8.800000|duration=1800|duration_time=0.020000|size=759|pos=438980|flags=K__|data_hash=CRC32:b3ba03c7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=793800|pts_time=8.820000|dts=793800|dts_time=8.820000|duration=1800|duration_time=0.020000|size=760|pos=439920|flags=K__|data_hash=CRC32:59f04151|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=795600|pts_time=8.840000|dts=795600|dts_time=8.840000|duration=1800|duration_time=0.020000|size=762|pos=440860|flags=K__|data_hash=CRC32:a9300525|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=797400|pts_time=8.860000|dts=797400|dts_time=8.860000|duration=1800|duration_time=0.020000|size=760|pos=441800|flags=K__|data_hash=CRC32:06b28e48|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=799200|pts_time=8.880000|dts=799200|dts_time=8.880000|duration=1800|duration_time=0.020000|size=760|pos=442740|flags=K__|data_hash=CRC32:99640c9a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=801000|pts_time=8.900000|dts=801000|dts_time=8.900000|duration=1800|duration_time=0.020000|size=757|pos=443680|flags=K__|data_hash=CRC32:264f20e3|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=802800|pts_time=8.920000|dts=802800|dts_time=8.920000|duration=1800|duration_time=0.020000|size=762|pos=444620|flags=K__|data_hash=CRC32:87799aaa|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=804600|pts_time=8.940000|dts=804600|dts_time=8.940000|duration=1800|duration_time=0.020000|size=763|pos=445560|flags=K__|data_hash=CRC32:b2487f0b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=806400|pts_time=8.960000|dts=806400|dts_time=8.960000|duration=1800|duration_time=0.020000|size=835|pos=446500|flags=K__|data_hash=CRC32:5ff97478|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=808200|pts_time=8.980000|dts=808200|dts_time=8.980000|duration=1800|duration_time=0.020000|size=758|pos=447440|flags=K__|data_hash=CRC32:ee962000|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=810000|pts_time=9.000000|dts=810000|dts_time=9.000000|duration=1800|duration_time=0.020000|size=761|pos=448756|flags=K__|data_hash=CRC32:65a93707|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=811800|pts_time=9.020000|dts=811800|dts_time=9.020000|duration=1800|duration_time=0.020000|size=888|pos=449696|flags=K__|data_hash=CRC32:f365394f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=813600|pts_time=9.040000|dts=813600|dts_time=9.040000|duration=1800|duration_time=0.020000|size=758|pos=450636|flags=K__|data_hash=CRC32:cc4aa3e5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=815400|pts_time=9.060000|dts=815400|dts_time=9.060000|duration=1800|duration_time=0.020000|size=765|pos=451576|flags=K__|data_hash=CRC32:a1fd5bac|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=817200|pts_time=9.080000|dts=817200|dts_time=9.080000|duration=1800|duration_time=0.020000|size=761|pos=452516|flags=K__|data_hash=CRC32:1590afda|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=819000|pts_time=9.100000|dts=819000|dts_time=9.100000|duration=1800|duration_time=0.020000|size=764|pos=453456|flags=K__|data_hash=CRC32:3e34e250|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=820800|pts_time=9.120000|dts=820800|dts_time=9.120000|duration=1800|duration_time=0.020000|size=762|pos=454396|flags=K__|data_hash=CRC32:927657b5|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=822600|pts_time=9.140000|dts=822600|dts_time=9.140000|duration=1800|duration_time=0.020000|size=767|pos=455336|flags=K__|data_hash=CRC32:5261b6ab|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=824400|pts_time=9.160000|dts=824400|dts_time=9.160000|duration=1800|duration_time=0.020000|size=759|pos=456276|flags=K__|data_hash=CRC32:645fd792|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=826200|pts_time=9.180000|dts=826200|dts_time=9.180000|duration=1800|duration_time=0.020000|size=761|pos=457216|flags=K__|data_hash=CRC32:240a9cd8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=828000|pts_time=9.200000|dts=828000|dts_time=9.200000|duration=1800|duration_time=0.020000|size=762|pos=458532|flags=K__|data_hash=CRC32:409c4ee6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=829800|pts_time=9.220000|dts=829800|dts_time=9.220000|duration=1800|duration_time=0.020000|size=763|pos=459472|flags=K__|data_hash=CRC32:a1e4f6c8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=831600|pts_time=9.240000|dts=831600|dts_time=9.240000|duration=1800|duration_time=0.020000|size=760|pos=460412|flags=K__|data_hash=CRC32:e405b6d8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=833400|pts_time=9.260000|dts=833400|dts_time=9.260000|duration=1800|duration_time=0.020000|size=832|pos=461352|flags=K__|data_hash=CRC32:28926870|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=835200|pts_time=9.280000|dts=835200|dts_time=9.280000|duration=1800|duration_time=0.020000|size=761|pos=462292|flags=K__|data_hash=CRC32:991eafa7|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=837000|pts_time=9.300000|dts=837000|dts_time=9.300000|duration=1800|duration_time=0.020000|size=887|pos=463232|flags=K__|data_hash=CRC32:2f2180e4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=838800|pts_time=9.320000|dts=838800|dts_time=9.320000|duration=1800|duration_time=0.020000|size=765|pos=464172|flags=K__|data_hash=CRC32:c3b931ab|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=840600|pts_time=9.340000|dts=840600|dts_time=9.340000|duration=1800|duration_time=0.020000|size=763|pos=465112|flags=K__|data_hash=CRC32:09c95d1c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=842400|pts_time=9.360000|dts=842400|dts_time=9.360000|duration=1800|duration_time=0.020000|size=763|pos=466052|flags=K__|data_hash=CRC32:5a90f4d9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=844200|pts_time=9.380000|dts=844200|dts_time=9.380000|duration=1800|duration_time=0.020000|size=952|pos=466992|flags=K__|data_hash=CRC32:2e1338bd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=846000|pts_time=9.400000|dts=846000|dts_time=9.400000|duration=1800|duration_time=0.020000|size=953|pos=468496|flags=K__|data_hash=CRC32:db87e979|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=847800|pts_time=9.420000|dts=847800|dts_time=9.420000|duration=1800|duration_time=0.020000|size=945|pos=469624|flags=K__|data_hash=CRC32:d55815d6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=849600|pts_time=9.440000|dts=849600|dts_time=9.440000|duration=1800|duration_time=0.020000|size=948|pos=470752|flags=K__|data_hash=CRC32:e31e5728|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=851400|pts_time=9.460000|dts=851400|dts_time=9.460000|duration=1800|duration_time=0.020000|size=951|pos=471880|flags=K__|data_hash=CRC32:49e86c3d|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=853200|pts_time=9.480000|dts=853200|dts_time=9.480000|duration=1800|duration_time=0.020000|size=826|pos=473008|flags=K__|data_hash=CRC32:13cefb19|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=855000|pts_time=9.500000|dts=855000|dts_time=9.500000|duration=1800|duration_time=0.020000|size=763|pos=473948|flags=K__|data_hash=CRC32:8d9b7d72|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=856800|pts_time=9.520000|dts=856800|dts_time=9.520000|duration=1800|duration_time=0.020000|size=763|pos=474888|flags=K__|data_hash=CRC32:d55b35fb|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=858600|pts_time=9.540000|dts=858600|dts_time=9.540000|duration=1800|duration_time=0.020000|size=766|pos=475828|flags=K__|data_hash=CRC32:3e10c46a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=860400|pts_time=9.560000|dts=860400|dts_time=9.560000|duration=1800|duration_time=0.020000|size=946|pos=476768|flags=K__|data_hash=CRC32:924e67eb|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=862200|pts_time=9.580000|dts=862200|dts_time=9.580000|duration=1800|duration_time=0.020000|size=762|pos=477896|flags=K__|data_hash=CRC32:008c6ebb|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=864000|pts_time=9.600000|dts=864000|dts_time=9.600000|duration=1800|duration_time=0.020000|size=765|pos=479212|flags=K__|data_hash=CRC32:96d72d3f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=865800|pts_time=9.620000|dts=865800|dts_time=9.620000|duration=1800|duration_time=0.020000|size=763|pos=480152|flags=K__|data_hash=CRC32:6f40bb5a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=867600|pts_time=9.640000|dts=867600|dts_time=9.640000|duration=1800|duration_time=0.020000|size=761|pos=481092|flags=K__|data_hash=CRC32:f6ba1f01|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=869400|pts_time=9.660000|dts=869400|dts_time=9.660000|duration=1800|duration_time=0.020000|size=760|pos=482032|flags=K__|data_hash=CRC32:b610a31e|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=871200|pts_time=9.680000|dts=871200|dts_time=9.680000|duration=1800|duration_time=0.020000|size=757|pos=482972|flags=K__|data_hash=CRC32:64dde46b|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=873000|pts_time=9.700000|dts=873000|dts_time=9.700000|duration=1800|duration_time=0.020000|size=757|pos=483912|flags=K__|data_hash=CRC32:8f794e6c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=874800|pts_time=9.720000|dts=874800|dts_time=9.720000|duration=1800|duration_time=0.020000|size=762|pos=484852|flags=K__|data_hash=CRC32:65c6284c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=876600|pts_time=9.740000|dts=876600|dts_time=9.740000|duration=1800|duration_time=0.020000|size=760|pos=485792|flags=K__|data_hash=CRC32:7dead06c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=878400|pts_time=9.760000|dts=878400|dts_time=9.760000|duration=1800|duration_time=0.020000|size=763|pos=486732|flags=K__|data_hash=CRC32:b0e145b1|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=880200|pts_time=9.780000|dts=880200|dts_time=9.780000|duration=1800|duration_time=0.020000|size=764|pos=487672|flags=K__|data_hash=CRC32:3d2553f6|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=882000|pts_time=9.800000|dts=882000|dts_time=9.800000|duration=1800|duration_time=0.020000|size=946|pos=488988|flags=K__|data_hash=CRC32:e808f1d2|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=883800|pts_time=9.820000|dts=883800|dts_time=9.820000|duration=1800|duration_time=0.020000|size=946|pos=490116|flags=K__|data_hash=CRC32:6b408528|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=885600|pts_time=9.840000|dts=885600|dts_time=9.840000|duration=1800|duration_time=0.020000|size=949|pos=491244|flags=K__|data_hash=CRC32:e51d96e4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=887400|pts_time=9.860000|dts=887400|dts_time=9.860000|duration=1800|duration_time=0.020000|size=946|pos=492372|flags=K__|data_hash=CRC32:c2df3280|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=889200|pts_time=9.880000|dts=889200|dts_time=9.880000|duration=1800|duration_time=0.020000|size=940|pos=493500|flags=K__|data_hash=CRC32:7bb5a137|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=891000|pts_time=9.900000|dts=891000|dts_time=9.900000|duration=1800|duration_time=0.020000|size=762|pos=494628|flags=K__|data_hash=CRC32:12fcc651|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=892800|pts_time=9.920000|dts=892800|dts_time=9.920000|duration=1800|duration_time=0.020000|size=759|pos=495568|flags=K__|data_hash=CRC32:b402a4c8|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=894600|pts_time=9.940000|dts=894600|dts_time=9.940000|duration=1800|duration_time=0.020000|size=942|pos=496508|flags=K__|data_hash=CRC32:bfe52a16|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=896400|pts_time=9.960000|dts=896400|dts_time=9.960000|duration=1800|duration_time=0.020000|size=764|pos=497636|flags=K__|data_hash=CRC32:09372283|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=898200|pts_time=9.980000|dts=898200|dts_time=9.980000|duration=1800|duration_time=0.020000|size=759|pos=498576|flags=K__|data_hash=CRC32:5a27db5c|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=900000|pts_time=10.000000|dts=900000|dts_time=10.000000|duration=1800|duration_time=0.020000|size=760|pos=499892|flags=K__|data_hash=CRC32:0821b0cd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=901800|pts_time=10.020000|dts=901800|dts_time=10.020000|duration=1800|duration_time=0.020000|size=757|pos=500832|flags=K__|data_hash=CRC32:91af6b99|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=903600|pts_time=10.040000|dts=903600|dts_time=10.040000|duration=1800|duration_time=0.020000|size=941|pos=501772|flags=K__|data_hash=CRC32:5296a88a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=905400|pts_time=10.060000|dts=905400|dts_time=10.060000|duration=1800|duration_time=0.020000|size=943|pos=502900|flags=K__|data_hash=CRC32:e75e69d4|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=907200|pts_time=10.080000|dts=907200|dts_time=10.080000|duration=1800|duration_time=0.020000|size=759|pos=504028|flags=K__|data_hash=CRC32:6a5b92cd|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=909000|pts_time=10.100000|dts=909000|dts_time=10.100000|duration=1800|duration_time=0.020000|size=759|pos=504968|flags=K__|data_hash=CRC32:ec30c088|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=910800|pts_time=10.120000|dts=910800|dts_time=10.120000|duration=1800|duration_time=0.020000|size=762|pos=505908|flags=K__|data_hash=CRC32:2c73f2ff|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=912600|pts_time=10.140000|dts=912600|dts_time=10.140000|duration=1800|duration_time=0.020000|size=831|pos=506848|flags=K__|data_hash=CRC32:7f7cb041|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=914400|pts_time=10.160000|dts=914400|dts_time=10.160000|duration=1800|duration_time=0.020000|size=756|pos=507788|flags=K__|data_hash=CRC32:52ef1db9|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=916200|pts_time=10.180000|dts=916200|dts_time=10.180000|duration=1800|duration_time=0.020000|size=760|pos=508728|flags=K__|data_hash=CRC32:fdf0ce4a|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=918000|pts_time=10.200000|dts=918000|dts_time=10.200000|duration=1800|duration_time=0.020000|size=761|pos=510044|flags=K__|data_hash=CRC32:75113c11|side_data|side_data_type=MPEGTS Stream ID|id=189 + +packet|codec_type=audio|stream_index=0|pts=919800|pts_time=10.220000|dts=919800|dts_time=10.220000|duration=1800|duration_time=0.020000|size=759|pos=510984|flags=K__|data_hash=CRC32:59fc266f|side_data|side_data_type=MPEGTS Stream ID|id=189 + +stream|index=0|codec_name=opus|profile=unknown|codec_type=audio|codec_tag_string=Opus|codec_tag=0x7375704f|sample_fmt=fltp|sample_rate=48000|channels=8|channel_layout=7.1|bits_per_sample=0|initial_padding=0|id=0x44|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/90000|start_pts=0|start_time=0.000000|duration_ts=919800|duration=10.220000|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=512|extradata_size=29|extradata_hash=CRC32:6d6089a7|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 format|filename=test-8-7.1.opus-small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=0.000000|duration=10.220000|size=512000|bit_rate=400782|probe_score=50 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-small-demux mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-small-demux --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-small-demux 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/ts-small-demux 2023-03-03 13:29:59.000000000 +0000 @@ -1,149 +1,149 @@ -packet|codec_type=video|stream_index=0|pts=126000|pts_time=1.400000|dts=126000|dts_time=1.400000|duration=6000|duration_time=0.066667|size=1290|pos=564|flags=K_|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:9c4b744e -packet|codec_type=video|stream_index=0|pts=132000|pts_time=1.466667|dts=132000|dts_time=1.466667|duration=6000|duration_time=0.066667|size=21|pos=2068|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:f5490de8 -packet|codec_type=video|stream_index=0|pts=138000|pts_time=1.533333|dts=138000|dts_time=1.533333|duration=6000|duration_time=0.066667|size=15|pos=2256|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:d82fbcc0 -packet|codec_type=video|stream_index=0|pts=144000|pts_time=1.600000|dts=144000|dts_time=1.600000|duration=6000|duration_time=0.066667|size=15|pos=2444|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:e062fa20 -packet|codec_type=video|stream_index=0|pts=150000|pts_time=1.666667|dts=150000|dts_time=1.666667|duration=6000|duration_time=0.066667|size=15|pos=2632|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:49802a80 -packet|codec_type=video|stream_index=0|pts=156000|pts_time=1.733333|dts=156000|dts_time=1.733333|duration=6000|duration_time=0.066667|size=15|pos=2820|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:71cd6c60 -packet|codec_type=video|stream_index=0|pts=162000|pts_time=1.800000|dts=162000|dts_time=1.800000|duration=6000|duration_time=0.066667|size=15|pos=3008|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:391aa740 -packet|codec_type=video|stream_index=0|pts=168000|pts_time=1.866667|dts=168000|dts_time=1.866667|duration=6000|duration_time=0.066667|size=15|pos=3196|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:0157e1a0 -packet|codec_type=video|stream_index=0|pts=174000|pts_time=1.933333|dts=174000|dts_time=1.933333|duration=6000|duration_time=0.066667|size=15|pos=3384|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:10095665 -packet|codec_type=video|stream_index=0|pts=180000|pts_time=2.000000|dts=180000|dts_time=2.000000|duration=6000|duration_time=0.066667|size=15|pos=3572|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:28441085 -packet|codec_type=video|stream_index=0|pts=186000|pts_time=2.066667|dts=186000|dts_time=2.066667|duration=6000|duration_time=0.066667|size=15|pos=3760|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:6093dba5 -packet|codec_type=video|stream_index=0|pts=192000|pts_time=2.133333|dts=192000|dts_time=2.133333|duration=6000|duration_time=0.066667|size=15|pos=3948|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:58de9d45 -packet|codec_type=video|stream_index=0|pts=198000|pts_time=2.200000|dts=198000|dts_time=2.200000|duration=6000|duration_time=0.066667|size=15|pos=4136|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:f13c4de5 -packet|codec_type=video|stream_index=0|pts=204000|pts_time=2.266667|dts=204000|dts_time=2.266667|duration=6000|duration_time=0.066667|size=15|pos=4324|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:c9710b05 -packet|codec_type=video|stream_index=0|pts=210000|pts_time=2.333333|dts=210000|dts_time=2.333333|duration=6000|duration_time=0.066667|size=15|pos=4512|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:81a6c025 -packet|codec_type=video|stream_index=0|pts=216000|pts_time=2.400000|dts=216000|dts_time=2.400000|duration=6000|duration_time=0.066667|size=15|pos=4700|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:b9eb86c5 -packet|codec_type=video|stream_index=0|pts=222000|pts_time=2.466667|dts=222000|dts_time=2.466667|duration=6000|duration_time=0.066667|size=15|pos=4888|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:a8b53100 -packet|codec_type=video|stream_index=0|pts=228000|pts_time=2.533333|dts=228000|dts_time=2.533333|duration=6000|duration_time=0.066667|size=15|pos=5076|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:90f877e0 -packet|codec_type=video|stream_index=0|pts=234000|pts_time=2.600000|dts=234000|dts_time=2.600000|duration=6000|duration_time=0.066667|size=15|pos=5264|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:d82fbcc0 -packet|codec_type=video|stream_index=0|pts=240000|pts_time=2.666667|dts=240000|dts_time=2.666667|duration=6000|duration_time=0.066667|size=15|pos=5452|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:e062fa20 -packet|codec_type=video|stream_index=0|pts=246000|pts_time=2.733333|dts=246000|dts_time=2.733333|duration=6000|duration_time=0.066667|size=15|pos=5640|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:49802a80 -packet|codec_type=video|stream_index=0|pts=252000|pts_time=2.800000|dts=252000|dts_time=2.800000|duration=6000|duration_time=0.066667|size=15|pos=5828|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:71cd6c60 -packet|codec_type=video|stream_index=0|pts=258000|pts_time=2.866667|dts=258000|dts_time=2.866667|duration=6000|duration_time=0.066667|size=15|pos=6016|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:391aa740 -packet|codec_type=video|stream_index=0|pts=264000|pts_time=2.933333|dts=264000|dts_time=2.933333|duration=6000|duration_time=0.066667|size=15|pos=6204|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:0157e1a0 -packet|codec_type=video|stream_index=0|pts=270000|pts_time=3.000000|dts=270000|dts_time=3.000000|duration=6000|duration_time=0.066667|size=15|pos=6392|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:10095665 -packet|codec_type=video|stream_index=0|pts=276000|pts_time=3.066667|dts=276000|dts_time=3.066667|duration=6000|duration_time=0.066667|size=15|pos=6580|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:28441085 -packet|codec_type=video|stream_index=0|pts=282000|pts_time=3.133333|dts=282000|dts_time=3.133333|duration=6000|duration_time=0.066667|size=15|pos=6768|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:6093dba5 -packet|codec_type=video|stream_index=0|pts=288000|pts_time=3.200000|dts=288000|dts_time=3.200000|duration=6000|duration_time=0.066667|size=15|pos=6956|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:58de9d45 -packet|codec_type=video|stream_index=0|pts=294000|pts_time=3.266667|dts=294000|dts_time=3.266667|duration=6000|duration_time=0.066667|size=15|pos=7144|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:f13c4de5 -packet|codec_type=video|stream_index=0|pts=300000|pts_time=3.333333|dts=300000|dts_time=3.333333|duration=6000|duration_time=0.066667|size=15|pos=7332|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:c9710b05 -packet|codec_type=video|stream_index=0|pts=306000|pts_time=3.400000|dts=306000|dts_time=3.400000|duration=6000|duration_time=0.066667|size=15|pos=7520|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:81a6c025 -packet|codec_type=video|stream_index=0|pts=312000|pts_time=3.466667|dts=312000|dts_time=3.466667|duration=6000|duration_time=0.066667|size=15|pos=7708|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:b9eb86c5 -packet|codec_type=video|stream_index=0|pts=318000|pts_time=3.533333|dts=318000|dts_time=3.533333|duration=6000|duration_time=0.066667|size=15|pos=7896|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:a8b53100 -packet|codec_type=video|stream_index=0|pts=324000|pts_time=3.600000|dts=324000|dts_time=3.600000|duration=6000|duration_time=0.066667|size=15|pos=8460|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:90f877e0 -packet|codec_type=video|stream_index=0|pts=330000|pts_time=3.666667|dts=330000|dts_time=3.666667|duration=6000|duration_time=0.066667|size=15|pos=8648|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:d82fbcc0 -packet|codec_type=video|stream_index=0|pts=336000|pts_time=3.733333|dts=336000|dts_time=3.733333|duration=6000|duration_time=0.066667|size=15|pos=8836|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:e062fa20 -packet|codec_type=video|stream_index=0|pts=342000|pts_time=3.800000|dts=342000|dts_time=3.800000|duration=6000|duration_time=0.066667|size=15|pos=9024|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:49802a80 -packet|codec_type=video|stream_index=0|pts=348000|pts_time=3.866667|dts=348000|dts_time=3.866667|duration=6000|duration_time=0.066667|size=15|pos=9212|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:71cd6c60 -packet|codec_type=video|stream_index=0|pts=354000|pts_time=3.933333|dts=354000|dts_time=3.933333|duration=6000|duration_time=0.066667|size=15|pos=9400|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:391aa740 -packet|codec_type=video|stream_index=0|pts=360000|pts_time=4.000000|dts=360000|dts_time=4.000000|duration=6000|duration_time=0.066667|size=15|pos=9588|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:0157e1a0 -packet|codec_type=video|stream_index=0|pts=366000|pts_time=4.066667|dts=366000|dts_time=4.066667|duration=6000|duration_time=0.066667|size=15|pos=9776|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:10095665 -packet|codec_type=video|stream_index=0|pts=372000|pts_time=4.133333|dts=372000|dts_time=4.133333|duration=6000|duration_time=0.066667|size=15|pos=9964|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:28441085 -packet|codec_type=video|stream_index=0|pts=378000|pts_time=4.200000|dts=378000|dts_time=4.200000|duration=6000|duration_time=0.066667|size=15|pos=10152|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:6093dba5 -packet|codec_type=video|stream_index=0|pts=384000|pts_time=4.266667|dts=384000|dts_time=4.266667|duration=6000|duration_time=0.066667|size=15|pos=10340|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:58de9d45 -packet|codec_type=video|stream_index=0|pts=390000|pts_time=4.333333|dts=390000|dts_time=4.333333|duration=6000|duration_time=0.066667|size=15|pos=10528|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:f13c4de5 -packet|codec_type=video|stream_index=0|pts=396000|pts_time=4.400000|dts=396000|dts_time=4.400000|duration=6000|duration_time=0.066667|size=15|pos=10716|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:c9710b05 -packet|codec_type=video|stream_index=0|pts=402000|pts_time=4.466667|dts=402000|dts_time=4.466667|duration=6000|duration_time=0.066667|size=15|pos=10904|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:81a6c025 -packet|codec_type=video|stream_index=0|pts=408000|pts_time=4.533333|dts=408000|dts_time=4.533333|duration=6000|duration_time=0.066667|size=15|pos=11092|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:b9eb86c5 -packet|codec_type=video|stream_index=0|pts=414000|pts_time=4.600000|dts=414000|dts_time=4.600000|duration=6000|duration_time=0.066667|size=15|pos=11280|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:a8b53100 -packet|codec_type=video|stream_index=0|pts=420000|pts_time=4.666667|dts=420000|dts_time=4.666667|duration=6000|duration_time=0.066667|size=15|pos=11468|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:90f877e0 -packet|codec_type=video|stream_index=0|pts=426000|pts_time=4.733333|dts=426000|dts_time=4.733333|duration=6000|duration_time=0.066667|size=15|pos=11656|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:d82fbcc0 -packet|codec_type=video|stream_index=0|pts=432000|pts_time=4.800000|dts=432000|dts_time=4.800000|duration=6000|duration_time=0.066667|size=15|pos=11844|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:e062fa20 -packet|codec_type=video|stream_index=0|pts=438000|pts_time=4.866667|dts=438000|dts_time=4.866667|duration=6000|duration_time=0.066667|size=15|pos=12032|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:49802a80 -packet|codec_type=video|stream_index=0|pts=444000|pts_time=4.933333|dts=444000|dts_time=4.933333|duration=6000|duration_time=0.066667|size=15|pos=12220|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:71cd6c60 -packet|codec_type=video|stream_index=0|pts=450000|pts_time=5.000000|dts=450000|dts_time=5.000000|duration=6000|duration_time=0.066667|size=15|pos=12408|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:391aa740 -packet|codec_type=video|stream_index=0|pts=456000|pts_time=5.066667|dts=456000|dts_time=5.066667|duration=6000|duration_time=0.066667|size=15|pos=12596|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:0157e1a0 -packet|codec_type=video|stream_index=0|pts=462000|pts_time=5.133333|dts=462000|dts_time=5.133333|duration=6000|duration_time=0.066667|size=15|pos=12784|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:10095665 -packet|codec_type=video|stream_index=0|pts=468000|pts_time=5.200000|dts=468000|dts_time=5.200000|duration=6000|duration_time=0.066667|size=15|pos=12972|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:28441085 -packet|codec_type=video|stream_index=0|pts=474000|pts_time=5.266667|dts=474000|dts_time=5.266667|duration=6000|duration_time=0.066667|size=15|pos=13160|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:6093dba5 -packet|codec_type=video|stream_index=0|pts=480000|pts_time=5.333333|dts=480000|dts_time=5.333333|duration=6000|duration_time=0.066667|size=15|pos=13348|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:58de9d45 -packet|codec_type=video|stream_index=0|pts=486000|pts_time=5.400000|dts=486000|dts_time=5.400000|duration=6000|duration_time=0.066667|size=15|pos=13536|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:f13c4de5 -packet|codec_type=video|stream_index=0|pts=492000|pts_time=5.466667|dts=492000|dts_time=5.466667|duration=6000|duration_time=0.066667|size=15|pos=13724|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:c9710b05 -packet|codec_type=video|stream_index=0|pts=498000|pts_time=5.533333|dts=498000|dts_time=5.533333|duration=6000|duration_time=0.066667|size=15|pos=13912|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:81a6c025 -packet|codec_type=video|stream_index=0|pts=504000|pts_time=5.600000|dts=504000|dts_time=5.600000|duration=6000|duration_time=0.066667|size=15|pos=14100|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:b9eb86c5 -packet|codec_type=video|stream_index=0|pts=510000|pts_time=5.666667|dts=510000|dts_time=5.666667|duration=6000|duration_time=0.066667|size=15|pos=14288|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:a8b53100 -packet|codec_type=video|stream_index=0|pts=516000|pts_time=5.733333|dts=516000|dts_time=5.733333|duration=6000|duration_time=0.066667|size=15|pos=14476|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:90f877e0 -packet|codec_type=video|stream_index=0|pts=522000|pts_time=5.800000|dts=522000|dts_time=5.800000|duration=6000|duration_time=0.066667|size=15|pos=14664|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:d82fbcc0 -packet|codec_type=video|stream_index=0|pts=528000|pts_time=5.866667|dts=528000|dts_time=5.866667|duration=6000|duration_time=0.066667|size=15|pos=14852|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:e062fa20 -packet|codec_type=video|stream_index=0|pts=534000|pts_time=5.933333|dts=534000|dts_time=5.933333|duration=6000|duration_time=0.066667|size=15|pos=15040|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:49802a80 -packet|codec_type=video|stream_index=0|pts=540000|pts_time=6.000000|dts=540000|dts_time=6.000000|duration=6000|duration_time=0.066667|size=15|pos=15228|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:71cd6c60 -packet|codec_type=video|stream_index=0|pts=546000|pts_time=6.066667|dts=546000|dts_time=6.066667|duration=6000|duration_time=0.066667|size=15|pos=15416|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:391aa740 -packet|codec_type=video|stream_index=0|pts=552000|pts_time=6.133333|dts=552000|dts_time=6.133333|duration=6000|duration_time=0.066667|size=16|pos=15604|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:cca62b67 -packet|codec_type=video|stream_index=0|pts=558000|pts_time=6.200000|dts=558000|dts_time=6.200000|duration=6000|duration_time=0.066667|size=16|pos=15792|flags=__|side_data|side_data_type=MPEGTS Stream ID|id=224 -|data_hash=CRC32:27b943ef -packet|codec_type=video|stream_index=0|pts=564000|pts_time=6.266667|dts=564000|dts_time=6.266667|duration=6000|duration_time=0.066667|size=16|pos=16356|flags=__|data_hash=CRC32:f7116111 +packet|codec_type=video|stream_index=0|pts=126000|pts_time=1.400000|dts=126000|dts_time=1.400000|duration=6000|duration_time=0.066667|size=1290|pos=564|flags=K__|data_hash=CRC32:9c4b744e|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=132000|pts_time=1.466667|dts=132000|dts_time=1.466667|duration=6000|duration_time=0.066667|size=21|pos=2068|flags=___|data_hash=CRC32:f5490de8|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=138000|pts_time=1.533333|dts=138000|dts_time=1.533333|duration=6000|duration_time=0.066667|size=15|pos=2256|flags=___|data_hash=CRC32:d82fbcc0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=144000|pts_time=1.600000|dts=144000|dts_time=1.600000|duration=6000|duration_time=0.066667|size=15|pos=2444|flags=___|data_hash=CRC32:e062fa20|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=150000|pts_time=1.666667|dts=150000|dts_time=1.666667|duration=6000|duration_time=0.066667|size=15|pos=2632|flags=___|data_hash=CRC32:49802a80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=156000|pts_time=1.733333|dts=156000|dts_time=1.733333|duration=6000|duration_time=0.066667|size=15|pos=2820|flags=___|data_hash=CRC32:71cd6c60|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=162000|pts_time=1.800000|dts=162000|dts_time=1.800000|duration=6000|duration_time=0.066667|size=15|pos=3008|flags=___|data_hash=CRC32:391aa740|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=168000|pts_time=1.866667|dts=168000|dts_time=1.866667|duration=6000|duration_time=0.066667|size=15|pos=3196|flags=___|data_hash=CRC32:0157e1a0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=174000|pts_time=1.933333|dts=174000|dts_time=1.933333|duration=6000|duration_time=0.066667|size=15|pos=3384|flags=___|data_hash=CRC32:10095665|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=180000|pts_time=2.000000|dts=180000|dts_time=2.000000|duration=6000|duration_time=0.066667|size=15|pos=3572|flags=___|data_hash=CRC32:28441085|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=186000|pts_time=2.066667|dts=186000|dts_time=2.066667|duration=6000|duration_time=0.066667|size=15|pos=3760|flags=___|data_hash=CRC32:6093dba5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=192000|pts_time=2.133333|dts=192000|dts_time=2.133333|duration=6000|duration_time=0.066667|size=15|pos=3948|flags=___|data_hash=CRC32:58de9d45|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=198000|pts_time=2.200000|dts=198000|dts_time=2.200000|duration=6000|duration_time=0.066667|size=15|pos=4136|flags=___|data_hash=CRC32:f13c4de5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=204000|pts_time=2.266667|dts=204000|dts_time=2.266667|duration=6000|duration_time=0.066667|size=15|pos=4324|flags=___|data_hash=CRC32:c9710b05|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=210000|pts_time=2.333333|dts=210000|dts_time=2.333333|duration=6000|duration_time=0.066667|size=15|pos=4512|flags=___|data_hash=CRC32:81a6c025|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=216000|pts_time=2.400000|dts=216000|dts_time=2.400000|duration=6000|duration_time=0.066667|size=15|pos=4700|flags=___|data_hash=CRC32:b9eb86c5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=222000|pts_time=2.466667|dts=222000|dts_time=2.466667|duration=6000|duration_time=0.066667|size=15|pos=4888|flags=___|data_hash=CRC32:a8b53100|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=228000|pts_time=2.533333|dts=228000|dts_time=2.533333|duration=6000|duration_time=0.066667|size=15|pos=5076|flags=___|data_hash=CRC32:90f877e0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=234000|pts_time=2.600000|dts=234000|dts_time=2.600000|duration=6000|duration_time=0.066667|size=15|pos=5264|flags=___|data_hash=CRC32:d82fbcc0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=240000|pts_time=2.666667|dts=240000|dts_time=2.666667|duration=6000|duration_time=0.066667|size=15|pos=5452|flags=___|data_hash=CRC32:e062fa20|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=246000|pts_time=2.733333|dts=246000|dts_time=2.733333|duration=6000|duration_time=0.066667|size=15|pos=5640|flags=___|data_hash=CRC32:49802a80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=252000|pts_time=2.800000|dts=252000|dts_time=2.800000|duration=6000|duration_time=0.066667|size=15|pos=5828|flags=___|data_hash=CRC32:71cd6c60|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=258000|pts_time=2.866667|dts=258000|dts_time=2.866667|duration=6000|duration_time=0.066667|size=15|pos=6016|flags=___|data_hash=CRC32:391aa740|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=264000|pts_time=2.933333|dts=264000|dts_time=2.933333|duration=6000|duration_time=0.066667|size=15|pos=6204|flags=___|data_hash=CRC32:0157e1a0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=270000|pts_time=3.000000|dts=270000|dts_time=3.000000|duration=6000|duration_time=0.066667|size=15|pos=6392|flags=___|data_hash=CRC32:10095665|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=276000|pts_time=3.066667|dts=276000|dts_time=3.066667|duration=6000|duration_time=0.066667|size=15|pos=6580|flags=___|data_hash=CRC32:28441085|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=282000|pts_time=3.133333|dts=282000|dts_time=3.133333|duration=6000|duration_time=0.066667|size=15|pos=6768|flags=___|data_hash=CRC32:6093dba5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=288000|pts_time=3.200000|dts=288000|dts_time=3.200000|duration=6000|duration_time=0.066667|size=15|pos=6956|flags=___|data_hash=CRC32:58de9d45|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=294000|pts_time=3.266667|dts=294000|dts_time=3.266667|duration=6000|duration_time=0.066667|size=15|pos=7144|flags=___|data_hash=CRC32:f13c4de5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=300000|pts_time=3.333333|dts=300000|dts_time=3.333333|duration=6000|duration_time=0.066667|size=15|pos=7332|flags=___|data_hash=CRC32:c9710b05|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=306000|pts_time=3.400000|dts=306000|dts_time=3.400000|duration=6000|duration_time=0.066667|size=15|pos=7520|flags=___|data_hash=CRC32:81a6c025|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=312000|pts_time=3.466667|dts=312000|dts_time=3.466667|duration=6000|duration_time=0.066667|size=15|pos=7708|flags=___|data_hash=CRC32:b9eb86c5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=318000|pts_time=3.533333|dts=318000|dts_time=3.533333|duration=6000|duration_time=0.066667|size=15|pos=7896|flags=___|data_hash=CRC32:a8b53100|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=324000|pts_time=3.600000|dts=324000|dts_time=3.600000|duration=6000|duration_time=0.066667|size=15|pos=8460|flags=___|data_hash=CRC32:90f877e0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=330000|pts_time=3.666667|dts=330000|dts_time=3.666667|duration=6000|duration_time=0.066667|size=15|pos=8648|flags=___|data_hash=CRC32:d82fbcc0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=336000|pts_time=3.733333|dts=336000|dts_time=3.733333|duration=6000|duration_time=0.066667|size=15|pos=8836|flags=___|data_hash=CRC32:e062fa20|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=342000|pts_time=3.800000|dts=342000|dts_time=3.800000|duration=6000|duration_time=0.066667|size=15|pos=9024|flags=___|data_hash=CRC32:49802a80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=348000|pts_time=3.866667|dts=348000|dts_time=3.866667|duration=6000|duration_time=0.066667|size=15|pos=9212|flags=___|data_hash=CRC32:71cd6c60|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=354000|pts_time=3.933333|dts=354000|dts_time=3.933333|duration=6000|duration_time=0.066667|size=15|pos=9400|flags=___|data_hash=CRC32:391aa740|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=360000|pts_time=4.000000|dts=360000|dts_time=4.000000|duration=6000|duration_time=0.066667|size=15|pos=9588|flags=___|data_hash=CRC32:0157e1a0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=366000|pts_time=4.066667|dts=366000|dts_time=4.066667|duration=6000|duration_time=0.066667|size=15|pos=9776|flags=___|data_hash=CRC32:10095665|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=372000|pts_time=4.133333|dts=372000|dts_time=4.133333|duration=6000|duration_time=0.066667|size=15|pos=9964|flags=___|data_hash=CRC32:28441085|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=378000|pts_time=4.200000|dts=378000|dts_time=4.200000|duration=6000|duration_time=0.066667|size=15|pos=10152|flags=___|data_hash=CRC32:6093dba5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=384000|pts_time=4.266667|dts=384000|dts_time=4.266667|duration=6000|duration_time=0.066667|size=15|pos=10340|flags=___|data_hash=CRC32:58de9d45|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=390000|pts_time=4.333333|dts=390000|dts_time=4.333333|duration=6000|duration_time=0.066667|size=15|pos=10528|flags=___|data_hash=CRC32:f13c4de5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=396000|pts_time=4.400000|dts=396000|dts_time=4.400000|duration=6000|duration_time=0.066667|size=15|pos=10716|flags=___|data_hash=CRC32:c9710b05|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=402000|pts_time=4.466667|dts=402000|dts_time=4.466667|duration=6000|duration_time=0.066667|size=15|pos=10904|flags=___|data_hash=CRC32:81a6c025|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=408000|pts_time=4.533333|dts=408000|dts_time=4.533333|duration=6000|duration_time=0.066667|size=15|pos=11092|flags=___|data_hash=CRC32:b9eb86c5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=414000|pts_time=4.600000|dts=414000|dts_time=4.600000|duration=6000|duration_time=0.066667|size=15|pos=11280|flags=___|data_hash=CRC32:a8b53100|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=420000|pts_time=4.666667|dts=420000|dts_time=4.666667|duration=6000|duration_time=0.066667|size=15|pos=11468|flags=___|data_hash=CRC32:90f877e0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=426000|pts_time=4.733333|dts=426000|dts_time=4.733333|duration=6000|duration_time=0.066667|size=15|pos=11656|flags=___|data_hash=CRC32:d82fbcc0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=432000|pts_time=4.800000|dts=432000|dts_time=4.800000|duration=6000|duration_time=0.066667|size=15|pos=11844|flags=___|data_hash=CRC32:e062fa20|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=438000|pts_time=4.866667|dts=438000|dts_time=4.866667|duration=6000|duration_time=0.066667|size=15|pos=12032|flags=___|data_hash=CRC32:49802a80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=444000|pts_time=4.933333|dts=444000|dts_time=4.933333|duration=6000|duration_time=0.066667|size=15|pos=12220|flags=___|data_hash=CRC32:71cd6c60|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=450000|pts_time=5.000000|dts=450000|dts_time=5.000000|duration=6000|duration_time=0.066667|size=15|pos=12408|flags=___|data_hash=CRC32:391aa740|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=456000|pts_time=5.066667|dts=456000|dts_time=5.066667|duration=6000|duration_time=0.066667|size=15|pos=12596|flags=___|data_hash=CRC32:0157e1a0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=462000|pts_time=5.133333|dts=462000|dts_time=5.133333|duration=6000|duration_time=0.066667|size=15|pos=12784|flags=___|data_hash=CRC32:10095665|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=468000|pts_time=5.200000|dts=468000|dts_time=5.200000|duration=6000|duration_time=0.066667|size=15|pos=12972|flags=___|data_hash=CRC32:28441085|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=474000|pts_time=5.266667|dts=474000|dts_time=5.266667|duration=6000|duration_time=0.066667|size=15|pos=13160|flags=___|data_hash=CRC32:6093dba5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=480000|pts_time=5.333333|dts=480000|dts_time=5.333333|duration=6000|duration_time=0.066667|size=15|pos=13348|flags=___|data_hash=CRC32:58de9d45|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=486000|pts_time=5.400000|dts=486000|dts_time=5.400000|duration=6000|duration_time=0.066667|size=15|pos=13536|flags=___|data_hash=CRC32:f13c4de5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=492000|pts_time=5.466667|dts=492000|dts_time=5.466667|duration=6000|duration_time=0.066667|size=15|pos=13724|flags=___|data_hash=CRC32:c9710b05|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=498000|pts_time=5.533333|dts=498000|dts_time=5.533333|duration=6000|duration_time=0.066667|size=15|pos=13912|flags=___|data_hash=CRC32:81a6c025|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=504000|pts_time=5.600000|dts=504000|dts_time=5.600000|duration=6000|duration_time=0.066667|size=15|pos=14100|flags=___|data_hash=CRC32:b9eb86c5|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=510000|pts_time=5.666667|dts=510000|dts_time=5.666667|duration=6000|duration_time=0.066667|size=15|pos=14288|flags=___|data_hash=CRC32:a8b53100|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=516000|pts_time=5.733333|dts=516000|dts_time=5.733333|duration=6000|duration_time=0.066667|size=15|pos=14476|flags=___|data_hash=CRC32:90f877e0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=522000|pts_time=5.800000|dts=522000|dts_time=5.800000|duration=6000|duration_time=0.066667|size=15|pos=14664|flags=___|data_hash=CRC32:d82fbcc0|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=528000|pts_time=5.866667|dts=528000|dts_time=5.866667|duration=6000|duration_time=0.066667|size=15|pos=14852|flags=___|data_hash=CRC32:e062fa20|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=534000|pts_time=5.933333|dts=534000|dts_time=5.933333|duration=6000|duration_time=0.066667|size=15|pos=15040|flags=___|data_hash=CRC32:49802a80|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=540000|pts_time=6.000000|dts=540000|dts_time=6.000000|duration=6000|duration_time=0.066667|size=15|pos=15228|flags=___|data_hash=CRC32:71cd6c60|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=546000|pts_time=6.066667|dts=546000|dts_time=6.066667|duration=6000|duration_time=0.066667|size=15|pos=15416|flags=___|data_hash=CRC32:391aa740|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=552000|pts_time=6.133333|dts=552000|dts_time=6.133333|duration=6000|duration_time=0.066667|size=16|pos=15604|flags=___|data_hash=CRC32:cca62b67|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=558000|pts_time=6.200000|dts=558000|dts_time=6.200000|duration=6000|duration_time=0.066667|size=16|pos=15792|flags=___|data_hash=CRC32:27b943ef|side_data|side_data_type=MPEGTS Stream ID|id=224 + +packet|codec_type=video|stream_index=0|pts=564000|pts_time=6.266667|dts=564000|dts_time=6.266667|duration=6000|duration_time=0.066667|size=16|pos=16356|flags=___|data_hash=CRC32:f7116111 stream|index=0|codec_name=h264|profile=578|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|width=82|height=144|coded_width=82|coded_height=144|closed_captions=0|film_grain=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|level=10|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=false|nal_length_size=0|id=0x100|r_frame_rate=15/1|avg_frame_rate=15/1|time_base=1/90000|start_pts=126000|start_time=1.400000|duration_ts=444000|duration=4.933333|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=74|extradata_size=35|extradata_hash=CRC32:e62cae27|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 format|filename=h264small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=1.400000|duration=4.933333|size=16544|bit_rate=26828|probe_score=50 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/unknown_layout-ac3 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/unknown_layout-ac3 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/unknown_layout-ac3 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/unknown_layout-ac3 2023-03-03 13:29:59.000000000 +0000 @@ -1 +1 @@ -febdb165cfd6cba375aa086195e61213 +ff7e25844b3cb6abb571ef7e226cbafa diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/vqc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/vqc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/vqc 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/vqc 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,6 @@ +#tb 0: 845/25333 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 320x240 +#sar 0: 0/1 +0, 0, 0, 1, 115200, 0xb32bba4f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/webm-av1-extradata-update mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/webm-av1-extradata-update --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/webm-av1-extradata-update 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/webm-av1-extradata-update 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,32 @@ +fbf3091fdf05b2856c578e7c948d68c3 *tests/data/fate/webm-av1-extradata-update.webm +23048 tests/data/fate/webm-av1-extradata-update.webm +#extradata 0: 35, 0x527207cd +#tb 0: 1/1000 +#media_type 0: video +#codec_id 0: av1 +#dimensions 0: 240x100 +#sar 0: 3/1 +0, 0, 0, 41, 8168, 0x1851ab62 +0, 42, 42, 41, 7040, 0x967788f9, F=0x0 +0, 83, 83, 41, 4, 0x01f400e2, F=0x0 +0, 125, 125, 41, 48, 0x49ad107e, F=0x0 +0, 167, 167, 41, 4, 0x021c00fa, F=0x0 +0, 208, 208, 41, 279, 0x69728439, F=0x0 +0, 250, 250, 41, 4, 0x01c400d2, F=0x0 +0, 292, 292, 41, 63, 0x9bbf1836, F=0x0 +0, 333, 333, 41, 4, 0x026c012a, F=0x0 +0, 375, 375, 41, 1065, 0xce2003ac, F=0x0 +0, 417, 417, 41, 4, 0x019400c2, F=0x0 +0, 458, 458, 41, 52, 0x7a0112f1, F=0x0 +0, 500, 500, 41, 4, 0x021c010a, F=0x0 +0, 542, 542, 41, 689, 0x1e8b49e7, F=0x0 +0, 583, 583, 41, 4, 0x01e400f2, F=0x0 +0, 625, 625, 41, 209, 0x124c6790, F=0x0 +0, 667, 667, 41, 42, 0xea690e31, F=0x0 +0, 708, 708, 41, 3521, 0xd76ee284, F=0x0 +0, 750, 750, 41, 63, 0x4572188f, F=0x0 +0, 792, 792, 41, 386, 0xb078c259, F=0x0 +0, 833, 833, 41, 178, 0x1ebb5121, F=0x0 +0, 875, 875, 41, 60, 0x729317f7, F=0x0 +0, 917, 917, 41, 40, 0xad970a66, F=0x0 +0, 958, 958, 41, 61, 0xcc0d1a20, F=0x0 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/wmv8-x8intra mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/wmv8-x8intra --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/wmv8-x8intra 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/fate/wmv8-x8intra 2023-03-03 13:29:59.000000000 +0000 @@ -7,21 +7,21 @@ 0, 3, 3, 1, 115200, 0x8911d86f 0, 4, 4, 1, 115200, 0x7c5dd82e 0, 5, 5, 1, 115200, 0x7c5ed82e -0, 30, 30, 1, 115200, 0xd323d838 -0, 31, 31, 1, 115200, 0x6e7479ab -0, 32, 32, 1, 115200, 0x14674bf6 -0, 33, 33, 1, 115200, 0x074c2e3d -0, 34, 34, 1, 115200, 0x9b3025ef -0, 35, 35, 1, 115200, 0x76882dae -0, 36, 36, 1, 115200, 0xedf3421b -0, 37, 37, 1, 115200, 0xb5378486 -0, 38, 38, 1, 115200, 0xc4a53420 -0, 39, 39, 1, 115200, 0x559cb60f -0, 40, 40, 1, 115200, 0xcc034ddd -0, 41, 41, 1, 115200, 0xb77b7779 -0, 42, 42, 1, 115200, 0x0ad9c3e6 -0, 43, 43, 1, 115200, 0x4e673027 -0, 44, 44, 1, 115200, 0x54717979 +0, 30, 30, 1, 115200, 0x03fbd838 +0, 31, 31, 1, 115200, 0x37c879b2 +0, 32, 32, 1, 115200, 0xd5994bfc +0, 33, 33, 1, 115200, 0x4b662e3e +0, 34, 34, 1, 115200, 0x2f1925ea +0, 35, 35, 1, 115200, 0xc5912db0 +0, 36, 36, 1, 115200, 0x76c4421f +0, 37, 37, 1, 115200, 0x5cc8848b +0, 38, 38, 1, 115200, 0x75e63425 +0, 39, 39, 1, 115200, 0x1a29b620 +0, 40, 40, 1, 115200, 0x60c64de9 +0, 41, 41, 1, 115200, 0xc7ac7783 +0, 42, 42, 1, 115200, 0xb056c3ee +0, 43, 43, 1, 115200, 0xa57d3030 +0, 44, 44, 1, 115200, 0x2864797c 0, 45, 45, 1, 115200, 0xf9e557c9 0, 46, 46, 1, 115200, 0xbdcf6358 0, 47, 47, 1, 115200, 0xd55c7bb7 @@ -82,156 +82,156 @@ 0, 102, 102, 1, 115200, 0x78bb8f95 0, 103, 103, 1, 115200, 0x9c71d03f 0, 104, 104, 1, 115200, 0xbe5db887 -0, 105, 105, 1, 115200, 0xa88e00d0 -0, 106, 106, 1, 115200, 0xc7b50827 -0, 107, 107, 1, 115200, 0xf9155ed3 -0, 108, 108, 1, 115200, 0x8dd72d44 -0, 109, 109, 1, 115200, 0xee38183a -0, 110, 110, 1, 115200, 0xea2b6329 -0, 111, 111, 1, 115200, 0xf556c2b3 -0, 112, 112, 1, 115200, 0x90edebf9 -0, 113, 113, 1, 115200, 0x4f440fdf -0, 114, 114, 1, 115200, 0xfdec7a9d -0, 115, 115, 1, 115200, 0xc7927952 -0, 116, 116, 1, 115200, 0xdd475704 -0, 117, 117, 1, 115200, 0x974a61a5 -0, 118, 118, 1, 115200, 0xbf2b785e -0, 119, 119, 1, 115200, 0x5de451fa -0, 120, 120, 1, 115200, 0x3fac503e -0, 121, 121, 1, 115200, 0xc6785643 -0, 122, 122, 1, 115200, 0xe6666254 -0, 123, 123, 1, 115200, 0x1a05130c -0, 124, 124, 1, 115200, 0x082cea5d -0, 125, 125, 1, 115200, 0x473ef142 -0, 126, 126, 1, 115200, 0x9769a776 -0, 127, 127, 1, 115200, 0xe6e841af -0, 128, 128, 1, 115200, 0xa44c8d1e -0, 129, 129, 1, 115200, 0xd03d641b -0, 130, 130, 1, 115200, 0x3aea3c9e -0, 131, 131, 1, 115200, 0x09efcf21 -0, 132, 132, 1, 115200, 0xeeb6ff64 -0, 133, 133, 1, 115200, 0xa310af6f -0, 134, 134, 1, 115200, 0x2488519e -0, 135, 135, 1, 115200, 0x48e1febf -0, 136, 136, 1, 115200, 0x76d00513 -0, 137, 137, 1, 115200, 0xa28eda81 -0, 138, 138, 1, 115200, 0xc2cbdcae -0, 139, 139, 1, 115200, 0xd976c9b2 -0, 140, 140, 1, 115200, 0xb0abebab -0, 141, 141, 1, 115200, 0x32be4765 -0, 142, 142, 1, 115200, 0xc0a36b11 -0, 143, 143, 1, 115200, 0xb6d1d47f -0, 144, 144, 1, 115200, 0xab7954a6 -0, 145, 145, 1, 115200, 0xc485789c -0, 146, 146, 1, 115200, 0xa07101b6 -0, 147, 147, 1, 115200, 0x6297780a -0, 148, 148, 1, 115200, 0xf550ba94 -0, 149, 149, 1, 115200, 0x9b77f994 -0, 150, 150, 1, 115200, 0xb0e870ad -0, 151, 151, 1, 115200, 0x2dd89b0b -0, 152, 152, 1, 115200, 0x36dcfe2f -0, 153, 153, 1, 115200, 0x3e5e1a8f -0, 154, 154, 1, 115200, 0xb8394740 -0, 155, 155, 1, 115200, 0xbfc852fc -0, 156, 156, 1, 115200, 0x5b3f8aa2 -0, 157, 157, 1, 115200, 0xc29d8e3a -0, 158, 158, 1, 115200, 0x7300abd8 -0, 159, 159, 1, 115200, 0xd1dd7a3b -0, 160, 160, 1, 115200, 0xe5978f39 -0, 161, 161, 1, 115200, 0x235c6b8d -0, 162, 162, 1, 115200, 0xec1b5805 -0, 163, 163, 1, 115200, 0x16d23946 -0, 164, 164, 1, 115200, 0xa8de1cf4 -0, 165, 165, 1, 115200, 0x5e730512 -0, 166, 166, 1, 115200, 0x1250feed -0, 167, 167, 1, 115200, 0x0928c190 -0, 168, 168, 1, 115200, 0xa25d9e5c -0, 169, 169, 1, 115200, 0x921068ea -0, 170, 170, 1, 115200, 0x2c974ddb -0, 171, 171, 1, 115200, 0x35ae4d75 -0, 172, 172, 1, 115200, 0xec0c6469 -0, 173, 173, 1, 115200, 0x22704fad -0, 174, 174, 1, 115200, 0x0a9a5aed -0, 175, 175, 1, 115200, 0x45192f2f -0, 176, 176, 1, 115200, 0xc07b39f4 -0, 177, 177, 1, 115200, 0x32c60215 -0, 178, 178, 1, 115200, 0xda65035e -0, 179, 179, 1, 115200, 0x99d0cd81 -0, 180, 180, 1, 115200, 0xd08ca5e3 -0, 181, 181, 1, 115200, 0x82cdad17 -0, 182, 182, 1, 115200, 0x2587a420 -0, 183, 183, 1, 115200, 0x85cba73d -0, 184, 184, 1, 115200, 0x4677bf89 -0, 185, 185, 1, 115200, 0x84c2e034 -0, 186, 186, 1, 115200, 0xd343066c -0, 187, 187, 1, 115200, 0xdec716a1 -0, 188, 188, 1, 115200, 0x93c04f5d -0, 189, 189, 1, 115200, 0xce126ac4 -0, 190, 190, 1, 115200, 0xa20098c5 -0, 191, 191, 1, 115200, 0x9a4ca711 -0, 192, 192, 1, 115200, 0xfae9c154 -0, 193, 193, 1, 115200, 0xb34cc431 -0, 194, 194, 1, 115200, 0x923cdec2 -0, 195, 195, 1, 115200, 0x60ffdfe8 -0, 196, 196, 1, 115200, 0xa3e6f9f2 -0, 197, 197, 1, 115200, 0x374f0a47 -0, 198, 198, 1, 115200, 0x8fb228f1 -0, 199, 199, 1, 115200, 0x4c1a24bf -0, 200, 200, 1, 115200, 0x768a52d1 -0, 201, 201, 1, 115200, 0x5bf77025 -0, 202, 202, 1, 115200, 0x6ca67c2a -0, 203, 203, 1, 115200, 0x107ca3e9 -0, 204, 204, 1, 115200, 0x4abeda93 -0, 205, 205, 1, 115200, 0x750be9ff -0, 206, 206, 1, 115200, 0x28c5eee3 -0, 207, 207, 1, 115200, 0xa1b0e4b2 -0, 208, 208, 1, 115200, 0x2ae7f33d -0, 209, 209, 1, 115200, 0xf29cdae0 -0, 210, 210, 1, 115200, 0xd470f9ed -0, 211, 211, 1, 115200, 0x2d22f832 -0, 212, 212, 1, 115200, 0xc5b91780 -0, 213, 213, 1, 115200, 0x3d8e4151 -0, 214, 214, 1, 115200, 0x459f58e0 -0, 215, 215, 1, 115200, 0x8dc198fe -0, 216, 216, 1, 115200, 0x2479f579 -0, 217, 217, 1, 115200, 0xc2040c21 -0, 218, 218, 1, 115200, 0x39ad60d5 -0, 219, 219, 1, 115200, 0x9329dd37 -0, 220, 220, 1, 115200, 0xa08807da -0, 221, 221, 1, 115200, 0xbf514cd1 -0, 222, 222, 1, 115200, 0x8b66a779 -0, 223, 223, 1, 115200, 0x865ebff5 -0, 224, 224, 1, 115200, 0x5967074c -0, 225, 225, 1, 115200, 0xd5521f60 -0, 226, 226, 1, 115200, 0x462c329c -0, 227, 227, 1, 115200, 0xbefd36fb -0, 228, 228, 1, 115200, 0x6f58403b -0, 229, 229, 1, 115200, 0xe4af2fac -0, 230, 230, 1, 115200, 0x46453662 -0, 231, 231, 1, 115200, 0x72cc59e8 -0, 232, 232, 1, 115200, 0xd6c67f8e -0, 233, 233, 1, 115200, 0xd35674a7 -0, 234, 234, 1, 115200, 0x65785ddb -0, 235, 235, 1, 115200, 0xfd7958aa -0, 236, 236, 1, 115200, 0x93e45607 -0, 237, 237, 1, 115200, 0x196a4fa5 -0, 238, 238, 1, 115200, 0xe33a5dac -0, 239, 239, 1, 115200, 0x4e66904a -0, 240, 240, 1, 115200, 0xc1e3a50a -0, 241, 241, 1, 115200, 0xa685b351 -0, 242, 242, 1, 115200, 0xee2fdeb7 -0, 243, 243, 1, 115200, 0x189cefdd -0, 244, 244, 1, 115200, 0xbdf90506 -0, 245, 245, 1, 115200, 0xe72c23d2 -0, 246, 246, 1, 115200, 0xa3f65e7b -0, 247, 247, 1, 115200, 0x8bc67eee -0, 248, 248, 1, 115200, 0xd305d09b -0, 249, 249, 1, 115200, 0xc521eba5 -0, 250, 250, 1, 115200, 0x16cf161f -0, 251, 251, 1, 115200, 0x2ce322b5 -0, 252, 252, 1, 115200, 0x57ce82b4 -0, 253, 253, 1, 115200, 0x8da896b9 -0, 254, 254, 1, 115200, 0xc16ad590 +0, 105, 105, 1, 115200, 0x125900d0 +0, 106, 106, 1, 115200, 0x916408eb +0, 107, 107, 1, 115200, 0xe45b5f5a +0, 108, 108, 1, 115200, 0x94222dc4 +0, 109, 109, 1, 115200, 0xba6018b4 +0, 110, 110, 1, 115200, 0xe64b63f7 +0, 111, 111, 1, 115200, 0x2a6ac35c +0, 112, 112, 1, 115200, 0xb899ed0d +0, 113, 113, 1, 115200, 0xefcc1111 +0, 114, 114, 1, 115200, 0x67a57bbe +0, 115, 115, 1, 115200, 0x48877a83 +0, 116, 116, 1, 115200, 0xf83d57ca +0, 117, 117, 1, 115200, 0x80a6625f +0, 118, 118, 1, 115200, 0x984f78e4 +0, 119, 119, 1, 115200, 0xd0c7524d +0, 120, 120, 1, 115200, 0x60475044 +0, 121, 121, 1, 115200, 0xce495653 +0, 122, 122, 1, 115200, 0x05956238 +0, 123, 123, 1, 115200, 0x1ede12ce +0, 124, 124, 1, 115200, 0x5ecfea25 +0, 125, 125, 1, 115200, 0x533ff0cc +0, 126, 126, 1, 115200, 0x0900a711 +0, 127, 127, 1, 115200, 0x0ff44124 +0, 128, 128, 1, 115200, 0x96298cc0 +0, 129, 129, 1, 115200, 0xd2a063ab +0, 130, 130, 1, 115200, 0xe9c63c2f +0, 131, 131, 1, 115200, 0x0991ceda +0, 132, 132, 1, 115200, 0x089aff4e +0, 133, 133, 1, 115200, 0xabe4af7e +0, 134, 134, 1, 115200, 0xd7ba5162 +0, 135, 135, 1, 115200, 0xb3adfe6d +0, 136, 136, 1, 115200, 0xb04604c9 +0, 137, 137, 1, 115200, 0xdef1da1b +0, 138, 138, 1, 115200, 0x25ffdc48 +0, 139, 139, 1, 115200, 0x8b7ac975 +0, 140, 140, 1, 115200, 0xaa21eb49 +0, 141, 141, 1, 115200, 0x5ffc46cc +0, 142, 142, 1, 115200, 0x73616a99 +0, 143, 143, 1, 115200, 0xabfad3f5 +0, 144, 144, 1, 115200, 0x11d45466 +0, 145, 145, 1, 115200, 0xc123788b +0, 146, 146, 1, 115200, 0xa58d01e0 +0, 147, 147, 1, 115200, 0x72137847 +0, 148, 148, 1, 115200, 0x25b9baa9 +0, 149, 149, 1, 115200, 0x1d5bf9d6 +0, 150, 150, 1, 115200, 0x6bab7161 +0, 151, 151, 1, 115200, 0x59789be2 +0, 152, 152, 1, 115200, 0x2784ff18 +0, 153, 153, 1, 115200, 0x05901bec +0, 154, 154, 1, 115200, 0x5a8648be +0, 155, 155, 1, 115200, 0x048854c1 +0, 156, 156, 1, 115200, 0x5d2b8c69 +0, 157, 157, 1, 115200, 0x951d8fe6 +0, 158, 158, 1, 115200, 0x5118ad8c +0, 159, 159, 1, 115200, 0x6d417bdd +0, 160, 160, 1, 115200, 0x59c590d3 +0, 161, 161, 1, 115200, 0x7c826d1a +0, 162, 162, 1, 115200, 0xa87659cd +0, 163, 163, 1, 115200, 0xe0893b19 +0, 164, 164, 1, 115200, 0x73531ead +0, 165, 165, 1, 115200, 0x7bdf0697 +0, 166, 166, 1, 115200, 0xd3de0067 +0, 167, 167, 1, 115200, 0xcf29c29b +0, 168, 168, 1, 115200, 0xda299edb +0, 169, 169, 1, 115200, 0x0e766935 +0, 170, 170, 1, 115200, 0x29f34e91 +0, 171, 171, 1, 115200, 0x85524e53 +0, 172, 172, 1, 115200, 0x13796542 +0, 173, 173, 1, 115200, 0x78bc5073 +0, 174, 174, 1, 115200, 0xf4b05c51 +0, 175, 175, 1, 115200, 0x12ac3079 +0, 176, 176, 1, 115200, 0xf5bf3b45 +0, 177, 177, 1, 115200, 0x1a9103a7 +0, 178, 178, 1, 115200, 0x3b5904aa +0, 179, 179, 1, 115200, 0x5d4fce7c +0, 180, 180, 1, 115200, 0x3239a6fa +0, 181, 181, 1, 115200, 0xd7ffae3a +0, 182, 182, 1, 115200, 0xc687a51d +0, 183, 183, 1, 115200, 0xc5a5a871 +0, 184, 184, 1, 115200, 0x40a4c09a +0, 185, 185, 1, 115200, 0xd905e0c1 +0, 186, 186, 1, 115200, 0x0cea06c3 +0, 187, 187, 1, 115200, 0x87961734 +0, 188, 188, 1, 115200, 0x79bb502e +0, 189, 189, 1, 115200, 0x3a606c03 +0, 190, 190, 1, 115200, 0x7eea99f7 +0, 191, 191, 1, 115200, 0x8a13a800 +0, 192, 192, 1, 115200, 0x4793c238 +0, 193, 193, 1, 115200, 0xa305c503 +0, 194, 194, 1, 115200, 0x5e4bdf82 +0, 195, 195, 1, 115200, 0x0165e148 +0, 196, 196, 1, 115200, 0x175afb1f +0, 197, 197, 1, 115200, 0xfb710b4e +0, 198, 198, 1, 115200, 0x8074299f +0, 199, 199, 1, 115200, 0xb9bd2576 +0, 200, 200, 1, 115200, 0x0d135337 +0, 201, 201, 1, 115200, 0xe53e706a +0, 202, 202, 1, 115200, 0x57627bd2 +0, 203, 203, 1, 115200, 0xfa13a336 +0, 204, 204, 1, 115200, 0x1c47d9c4 +0, 205, 205, 1, 115200, 0x9f44e929 +0, 206, 206, 1, 115200, 0xfd15ee4d +0, 207, 207, 1, 115200, 0x0a43e426 +0, 208, 208, 1, 115200, 0x1413f2d1 +0, 209, 209, 1, 115200, 0x89eadaa0 +0, 210, 210, 1, 115200, 0x01b4f9c7 +0, 211, 211, 1, 115200, 0x0883f7f9 +0, 212, 212, 1, 115200, 0xd5f81739 +0, 213, 213, 1, 115200, 0x637d40c8 +0, 214, 214, 1, 115200, 0x211d5850 +0, 215, 215, 1, 115200, 0xb0319873 +0, 216, 216, 1, 115200, 0x90e9f518 +0, 217, 217, 1, 115200, 0x70f40bd3 +0, 218, 218, 1, 115200, 0x8f646061 +0, 219, 219, 1, 115200, 0x1f50dc9d +0, 220, 220, 1, 115200, 0x3c810751 +0, 221, 221, 1, 115200, 0x79e44c66 +0, 222, 222, 1, 115200, 0x6c9fa6b6 +0, 223, 223, 1, 115200, 0x9211bf3f +0, 224, 224, 1, 115200, 0xfbe70678 +0, 225, 225, 1, 115200, 0xab9d1e8f +0, 226, 226, 1, 115200, 0xf54f31dc +0, 227, 227, 1, 115200, 0xe6963636 +0, 228, 228, 1, 115200, 0x58ac3f43 +0, 229, 229, 1, 115200, 0x4d382f03 +0, 230, 230, 1, 115200, 0xaa663672 +0, 231, 231, 1, 115200, 0xbbf559c8 +0, 232, 232, 1, 115200, 0x6c567f1e +0, 233, 233, 1, 115200, 0x59817491 +0, 234, 234, 1, 115200, 0xba715dc2 +0, 235, 235, 1, 115200, 0x299f5882 +0, 236, 236, 1, 115200, 0x139455d5 +0, 237, 237, 1, 115200, 0x37e74fb1 +0, 238, 238, 1, 115200, 0x4f005ddc +0, 239, 239, 1, 115200, 0xc90e8fcb +0, 240, 240, 1, 115200, 0x22e4a47a +0, 241, 241, 1, 115200, 0xa974b2d2 +0, 242, 242, 1, 115200, 0xfab7de51 +0, 243, 243, 1, 115200, 0xa9a7ef13 +0, 244, 244, 1, 115200, 0x8ddd0464 +0, 245, 245, 1, 115200, 0xd314232a +0, 246, 246, 1, 115200, 0x1fba5db0 +0, 247, 247, 1, 115200, 0x52387e64 +0, 248, 248, 1, 115200, 0xc58ed032 +0, 249, 249, 1, 115200, 0xefabeb35 +0, 250, 250, 1, 115200, 0x002315c1 +0, 251, 251, 1, 115200, 0x124721f7 +0, 252, 252, 1, 115200, 0xc24981e9 +0, 253, 253, 1, 115200, 0xa1f795f0 +0, 254, 254, 1, 115200, 0xc01fd535 0, 255, 255, 1, 115200, 0x8cdbe729 0, 256, 256, 1, 115200, 0x69eafd96 0, 257, 257, 1, 115200, 0xd9e40a03 @@ -320,160 +320,160 @@ 0, 340, 340, 1, 115200, 0x82179a82 0, 341, 341, 1, 115200, 0xf8865f3d 0, 342, 342, 1, 115200, 0xa5fb7b80 -0, 343, 343, 1, 115200, 0x9aebc04d -0, 344, 344, 1, 115200, 0x44c705fc -0, 345, 345, 1, 115200, 0xd322add3 -0, 346, 346, 1, 115200, 0xf4230b76 -0, 347, 347, 1, 115200, 0xaa915069 -0, 348, 348, 1, 115200, 0x518d53d8 -0, 349, 349, 1, 115200, 0xefa7d909 -0, 350, 350, 1, 115200, 0x803c3c0e -0, 351, 351, 1, 115200, 0x5650bc0a -0, 352, 352, 1, 115200, 0x8b34ecab -0, 353, 353, 1, 115200, 0x975c4976 -0, 354, 354, 1, 115200, 0x700e3cb4 -0, 355, 355, 1, 115200, 0xef27a4ec -0, 356, 356, 1, 115200, 0x2b953936 -0, 357, 357, 1, 115200, 0xcf9b4956 -0, 358, 358, 1, 115200, 0xae4a8eba -0, 359, 359, 1, 115200, 0xf8821144 -0, 360, 360, 1, 115200, 0x97c2402c -0, 361, 361, 1, 115200, 0x209b7bb3 -0, 362, 362, 1, 115200, 0xd22fff2c -0, 363, 363, 1, 115200, 0xe85b4f16 -0, 364, 364, 1, 115200, 0x0659f318 -0, 365, 365, 1, 115200, 0x6e2bff98 -0, 366, 366, 1, 115200, 0xc6626f2f -0, 367, 367, 1, 115200, 0x123138e2 -0, 368, 368, 1, 115200, 0x69e680ab -0, 369, 369, 1, 115200, 0xe4d7cd1d -0, 370, 370, 1, 115200, 0x4ca10d47 -0, 371, 371, 1, 115200, 0x633a4c39 -0, 372, 372, 1, 115200, 0x64ded292 -0, 373, 373, 1, 115200, 0x88d2df42 -0, 374, 374, 1, 115200, 0x998f4c63 -0, 375, 375, 1, 115200, 0x753c76f9 -0, 376, 376, 1, 115200, 0x9d7ba0a6 -0, 377, 377, 1, 115200, 0x68798da5 -0, 378, 378, 1, 115200, 0xb5b18bc3 -0, 379, 379, 1, 115200, 0x20245e49 -0, 380, 380, 1, 115200, 0xf15d4b8f -0, 381, 381, 1, 115200, 0x17f83b69 -0, 382, 382, 1, 115200, 0xcc545783 -0, 383, 383, 1, 115200, 0x3dad530e -0, 384, 384, 1, 115200, 0x6b465c94 -0, 385, 385, 1, 115200, 0xbc5f3831 -0, 386, 386, 1, 115200, 0x1b2f042d -0, 387, 387, 1, 115200, 0xaec391ac -0, 388, 388, 1, 115200, 0x99fa8b2a -0, 389, 389, 1, 115200, 0xf78d3524 -0, 390, 390, 1, 115200, 0xe6255a24 -0, 391, 391, 1, 115200, 0x253542c6 -0, 392, 392, 1, 115200, 0xfab05365 -0, 393, 393, 1, 115200, 0x406a3749 -0, 394, 394, 1, 115200, 0xaf0f3935 -0, 395, 395, 1, 115200, 0x0d9ff780 -0, 396, 396, 1, 115200, 0xfadcfc15 -0, 397, 397, 1, 115200, 0x8267d5ad -0, 398, 398, 1, 115200, 0xd705d250 -0, 399, 399, 1, 115200, 0x18f9d1f2 -0, 400, 400, 1, 115200, 0xd92bc045 -0, 401, 401, 1, 115200, 0x439b9ca0 -0, 402, 402, 1, 115200, 0xcb80a14c -0, 403, 403, 1, 115200, 0xee887f49 -0, 404, 404, 1, 115200, 0xfba297eb -0, 405, 405, 1, 115200, 0x0e2f744b -0, 406, 406, 1, 115200, 0xaa227aa7 -0, 407, 407, 1, 115200, 0xd7bc6fff -0, 408, 408, 1, 115200, 0x295c91cf -0, 409, 409, 1, 115200, 0xc5678733 -0, 410, 410, 1, 115200, 0xc8d49120 -0, 411, 411, 1, 115200, 0xb14e90b9 -0, 412, 412, 1, 115200, 0x6a09acab -0, 413, 413, 1, 115200, 0xb9aec358 -0, 414, 414, 1, 115200, 0xeb3695b2 -0, 415, 415, 1, 115200, 0xc5bebd62 -0, 416, 416, 1, 115200, 0x2d6b1a3f -0, 417, 417, 1, 115200, 0x92986f49 -0, 418, 418, 1, 115200, 0x00c37cf9 -0, 419, 419, 1, 115200, 0x5a4d87a6 -0, 420, 420, 1, 115200, 0xe87888a2 -0, 421, 421, 1, 115200, 0x4ab18d6d -0, 422, 422, 1, 115200, 0xcb84880b -0, 423, 423, 1, 115200, 0x82458848 -0, 424, 424, 1, 115200, 0x11b477dc -0, 425, 425, 1, 115200, 0x56d876d3 -0, 426, 426, 1, 115200, 0xf5297ceb -0, 427, 427, 1, 115200, 0x47357713 -0, 428, 428, 1, 115200, 0xede562df -0, 429, 429, 1, 115200, 0xabf42d38 -0, 430, 430, 1, 115200, 0xea9225c8 -0, 431, 431, 1, 115200, 0x79ce1cb4 -0, 432, 432, 1, 115200, 0x0cd418b4 -0, 433, 433, 1, 115200, 0x6f7c118e -0, 434, 434, 1, 115200, 0xbbbc0fa4 -0, 435, 435, 1, 115200, 0x890514e6 -0, 436, 436, 1, 115200, 0x9c4d0e7d -0, 437, 437, 1, 115200, 0x56260e76 -0, 438, 438, 1, 115200, 0x7dc80258 -0, 439, 439, 1, 115200, 0xa990f5a3 -0, 440, 440, 1, 115200, 0x2174e913 -0, 441, 441, 1, 115200, 0x8296e674 -0, 442, 442, 1, 115200, 0x9e28e3b4 -0, 443, 443, 1, 115200, 0x404ce72b -0, 444, 444, 1, 115200, 0xc7cbf4ec -0, 445, 445, 1, 115200, 0x5ce0f5a1 -0, 446, 446, 1, 115200, 0x88dbf7c7 -0, 447, 447, 1, 115200, 0x26daf35a -0, 448, 448, 1, 115200, 0x5cfdfe63 -0, 449, 449, 1, 115200, 0xdd40fb9b -0, 450, 450, 1, 115200, 0x5b8df20f -0, 451, 451, 1, 115200, 0x4f2ce5ac -0, 452, 452, 1, 115200, 0xc9d0e0c2 -0, 453, 453, 1, 115200, 0x51c7e2a6 -0, 454, 454, 1, 115200, 0xb3bae109 -0, 455, 455, 1, 115200, 0xbd85e5b2 -0, 456, 456, 1, 115200, 0x1fbbdfd1 -0, 457, 457, 1, 115200, 0x3665dfd0 -0, 458, 458, 1, 115200, 0xcd29d50c -0, 459, 459, 1, 115200, 0xedd1c6bc -0, 460, 460, 1, 115200, 0xebc2d072 -0, 461, 461, 1, 115200, 0xe2e5fbbd -0, 462, 462, 1, 115200, 0x616a13dc -0, 463, 463, 1, 115200, 0xf64f1efc -0, 464, 464, 1, 115200, 0x5356235f -0, 465, 465, 1, 115200, 0xafc032d5 -0, 466, 466, 1, 115200, 0xaa034420 -0, 467, 467, 1, 115200, 0x007e0afa -0, 468, 468, 1, 115200, 0x077ad5c8 -0, 469, 469, 1, 115200, 0x8fc815b8 -0, 470, 470, 1, 115200, 0x95b85990 -0, 471, 471, 1, 115200, 0x46f5899f -0, 472, 472, 1, 115200, 0x1e37cd82 -0, 473, 473, 1, 115200, 0x3ce90bfd -0, 474, 474, 1, 115200, 0xbb95bd1d -0, 475, 475, 1, 115200, 0xd4aa9ba8 -0, 476, 476, 1, 115200, 0x0e761649 -0, 477, 477, 1, 115200, 0x49ad7886 -0, 478, 478, 1, 115200, 0x2f4184df -0, 479, 479, 1, 115200, 0x80b906ee -0, 480, 480, 1, 115200, 0x62405100 -0, 481, 481, 1, 115200, 0x3ece13b5 -0, 482, 482, 1, 115200, 0x3abd4cfc -0, 483, 483, 1, 115200, 0x91b418e3 -0, 484, 484, 1, 115200, 0xde1ce68e -0, 485, 485, 1, 115200, 0xfc47f912 -0, 486, 486, 1, 115200, 0x5b380a6f -0, 487, 487, 1, 115200, 0x8f35c3c0 -0, 488, 488, 1, 115200, 0xb26dc220 -0, 489, 489, 1, 115200, 0x3d5bbfce -0, 490, 490, 1, 115200, 0xa1f9bee6 -0, 491, 491, 1, 115200, 0xa87dcd24 -0, 492, 492, 1, 115200, 0x9374cb71 -0, 493, 493, 1, 115200, 0x0c7ccbd0 -0, 494, 494, 1, 115200, 0x9a16cc49 -0, 495, 495, 1, 115200, 0x4df0c28b -0, 496, 496, 1, 115200, 0xb5b8b866 -0, 497, 497, 1, 115200, 0xafcc1019 -0, 510, 510, 1, 115200, 0x623b0ff3 -0, 512, 512, 1, 115200, 0x1d6f10b5 +0, 343, 343, 1, 115200, 0xf2a9c04d +0, 344, 344, 1, 115200, 0x2b4005ea +0, 345, 345, 1, 115200, 0xcec6ad14 +0, 346, 346, 1, 115200, 0x1c040afc +0, 347, 347, 1, 115200, 0x164c4fd5 +0, 348, 348, 1, 115200, 0x5bcc5385 +0, 349, 349, 1, 115200, 0x7f7ed8d3 +0, 350, 350, 1, 115200, 0x48ab3c54 +0, 351, 351, 1, 115200, 0xd5debbfb +0, 352, 352, 1, 115200, 0x720ded36 +0, 353, 353, 1, 115200, 0x3ae44a00 +0, 354, 354, 1, 115200, 0xfa893d68 +0, 355, 355, 1, 115200, 0xc833a619 +0, 356, 356, 1, 115200, 0xa3583b05 +0, 357, 357, 1, 115200, 0xffed4aed +0, 358, 358, 1, 115200, 0x3757904a +0, 359, 359, 1, 115200, 0x2f09122d +0, 360, 360, 1, 115200, 0xcc9f40d6 +0, 361, 361, 1, 115200, 0xb8287bfb +0, 362, 362, 1, 115200, 0x5f62ff06 +0, 363, 363, 1, 115200, 0x76b04f67 +0, 364, 364, 1, 115200, 0xa9e6f352 +0, 365, 365, 1, 115200, 0xc0e6001f +0, 366, 366, 1, 115200, 0x19bc6f22 +0, 367, 367, 1, 115200, 0x0dbe3871 +0, 368, 368, 1, 115200, 0x413c8035 +0, 369, 369, 1, 115200, 0x8c28cc8d +0, 370, 370, 1, 115200, 0xdd7f0cda +0, 371, 371, 1, 115200, 0xf6f14c0c +0, 372, 372, 1, 115200, 0x23bbd27b +0, 373, 373, 1, 115200, 0xa8b8df03 +0, 374, 374, 1, 115200, 0xadb14c5a +0, 375, 375, 1, 115200, 0xb5ca76f0 +0, 376, 376, 1, 115200, 0xea38a095 +0, 377, 377, 1, 115200, 0x60218deb +0, 378, 378, 1, 115200, 0x947e8c0f +0, 379, 379, 1, 115200, 0x6afe5ed1 +0, 380, 380, 1, 115200, 0x139f4c22 +0, 381, 381, 1, 115200, 0x5e4c3c2d +0, 382, 382, 1, 115200, 0x86df5833 +0, 383, 383, 1, 115200, 0x824e538a +0, 384, 384, 1, 115200, 0xebf25d19 +0, 385, 385, 1, 115200, 0x229438ae +0, 386, 386, 1, 115200, 0xde5e0494 +0, 387, 387, 1, 115200, 0x63399194 +0, 388, 388, 1, 115200, 0x1f048b80 +0, 389, 389, 1, 115200, 0x0774357a +0, 390, 390, 1, 115200, 0xddd75a69 +0, 391, 391, 1, 115200, 0x6d054339 +0, 392, 392, 1, 115200, 0xd0995428 +0, 393, 393, 1, 115200, 0x607a37eb +0, 394, 394, 1, 115200, 0xa704399c +0, 395, 395, 1, 115200, 0x0d7ff8b8 +0, 396, 396, 1, 115200, 0x5b20fd4e +0, 397, 397, 1, 115200, 0x7cbad667 +0, 398, 398, 1, 115200, 0xe217d35f +0, 399, 399, 1, 115200, 0x3ff6d303 +0, 400, 400, 1, 115200, 0x5aa4c0e4 +0, 401, 401, 1, 115200, 0x2d779d91 +0, 402, 402, 1, 115200, 0x7097a25d +0, 403, 403, 1, 115200, 0x57c5809d +0, 404, 404, 1, 115200, 0x0fe0997e +0, 405, 405, 1, 115200, 0xd81d75a9 +0, 406, 406, 1, 115200, 0x30a87cc0 +0, 407, 407, 1, 115200, 0x22a971b6 +0, 408, 408, 1, 115200, 0x9f849351 +0, 409, 409, 1, 115200, 0xa1218894 +0, 410, 410, 1, 115200, 0xefdd92a8 +0, 411, 411, 1, 115200, 0xe0559201 +0, 412, 412, 1, 115200, 0x07ebade6 +0, 413, 413, 1, 115200, 0xe0c2c425 +0, 414, 414, 1, 115200, 0x92159752 +0, 415, 415, 1, 115200, 0x048fbe24 +0, 416, 416, 1, 115200, 0x8a051ae9 +0, 417, 417, 1, 115200, 0xed466ff3 +0, 418, 418, 1, 115200, 0x11157da7 +0, 419, 419, 1, 115200, 0x1f958850 +0, 420, 420, 1, 115200, 0x1e488948 +0, 421, 421, 1, 115200, 0x8c538e13 +0, 422, 422, 1, 115200, 0x26d188b1 +0, 423, 423, 1, 115200, 0x903b88e8 +0, 424, 424, 1, 115200, 0x04ed7882 +0, 425, 425, 1, 115200, 0x58d17772 +0, 426, 426, 1, 115200, 0x37c67d8c +0, 427, 427, 1, 115200, 0x6c2677b4 +0, 428, 428, 1, 115200, 0xc0a763ba +0, 429, 429, 1, 115200, 0xce242e3c +0, 430, 430, 1, 115200, 0xcd0c26d9 +0, 431, 431, 1, 115200, 0x4cf81d8a +0, 432, 432, 1, 115200, 0xb5a61995 +0, 433, 433, 1, 115200, 0xb4bb1276 +0, 434, 434, 1, 115200, 0x085210a6 +0, 435, 435, 1, 115200, 0x4cf215b4 +0, 436, 436, 1, 115200, 0xe78d0f4b +0, 437, 437, 1, 115200, 0x52bc0f3c +0, 438, 438, 1, 115200, 0x8c50033d +0, 439, 439, 1, 115200, 0x0147f6b5 +0, 440, 440, 1, 115200, 0x5da1e9f2 +0, 441, 441, 1, 115200, 0xf5fce75b +0, 442, 442, 1, 115200, 0x90aee4e5 +0, 443, 443, 1, 115200, 0xd73ae879 +0, 444, 444, 1, 115200, 0xb578f62a +0, 445, 445, 1, 115200, 0x9ebcf6dd +0, 446, 446, 1, 115200, 0x7a3cf909 +0, 447, 447, 1, 115200, 0x7240f4b6 +0, 448, 448, 1, 115200, 0x55a9ffcd +0, 449, 449, 1, 115200, 0x95c7fd1b +0, 450, 450, 1, 115200, 0x40e3f3c4 +0, 451, 451, 1, 115200, 0x2059e762 +0, 452, 452, 1, 115200, 0xa0bee25d +0, 453, 453, 1, 115200, 0xedf9e470 +0, 454, 454, 1, 115200, 0x83a9e2b0 +0, 455, 455, 1, 115200, 0xf420e78e +0, 456, 456, 1, 115200, 0x5512e1ad +0, 457, 457, 1, 115200, 0xca18e192 +0, 458, 458, 1, 115200, 0x46d5d6cb +0, 459, 459, 1, 115200, 0x40c7c6bc +0, 460, 460, 1, 115200, 0x45e4d06b +0, 461, 461, 1, 115200, 0xeefffb82 +0, 462, 462, 1, 115200, 0x6f9a1394 +0, 463, 463, 1, 115200, 0xec521ebc +0, 464, 464, 1, 115200, 0x8b632329 +0, 465, 465, 1, 115200, 0x858732ba +0, 466, 466, 1, 115200, 0x1f364406 +0, 467, 467, 1, 115200, 0xf6870af0 +0, 468, 468, 1, 115200, 0x8738d586 +0, 469, 469, 1, 115200, 0x52761588 +0, 470, 470, 1, 115200, 0xc1c8593d +0, 471, 471, 1, 115200, 0x88a88938 +0, 472, 472, 1, 115200, 0x4a01ccf5 +0, 473, 473, 1, 115200, 0x2d990bde +0, 474, 474, 1, 115200, 0x2dc9bd2b +0, 475, 475, 1, 115200, 0xc1599b9b +0, 476, 476, 1, 115200, 0xce621632 +0, 477, 477, 1, 115200, 0xbe027871 +0, 478, 478, 1, 115200, 0xf48f84a8 +0, 479, 479, 1, 115200, 0x6a240689 +0, 480, 480, 1, 115200, 0xfb90504d +0, 481, 481, 1, 115200, 0x1a5512ec +0, 482, 482, 1, 115200, 0x5f124c22 +0, 483, 483, 1, 115200, 0x2ea3180e +0, 484, 484, 1, 115200, 0x2519e60e +0, 485, 485, 1, 115200, 0xe240f88d +0, 486, 486, 1, 115200, 0xac9209d8 +0, 487, 487, 1, 115200, 0x926fc3b8 +0, 488, 488, 1, 115200, 0xa5cdc217 +0, 489, 489, 1, 115200, 0x4d52bfcc +0, 490, 490, 1, 115200, 0x2ce6bedf +0, 491, 491, 1, 115200, 0x19e4cd0d +0, 492, 492, 1, 115200, 0x1cc7cb5c +0, 493, 493, 1, 115200, 0x74facbbc +0, 494, 494, 1, 115200, 0xb771cc31 +0, 495, 495, 1, 115200, 0x6aabc273 +0, 496, 496, 1, 115200, 0x0308b854 +0, 497, 497, 1, 115200, 0xa70a1019 +0, 510, 510, 1, 115200, 0x59790ff3 +0, 512, 512, 1, 115200, 0x0e7110b5 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/dfpwm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/dfpwm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/dfpwm 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/dfpwm 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,3 @@ +c216a2b5576f3e7f31516854bbb41eb8 *tests/data/lavf/lavf.dfpwm +5513 tests/data/lavf/lavf.dfpwm +tests/data/lavf/lavf.dfpwm CRC=0x226be6b3 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32be.pfm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32be.pfm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32be.pfm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32be.pfm 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -6d470f8d6018b95b45afafc14b7d161a *tests/data/images/gbrpf32be.pfm/02.gbrpf32be.pfm +4ac5ecc53ff2ca0c9360031ea4c13236 *tests/data/images/gbrpf32be.pfm/02.gbrpf32be.pfm 1216532 tests/data/images/gbrpf32be.pfm/02.gbrpf32be.pfm tests/data/images/gbrpf32be.pfm/%02d.gbrpf32be.pfm CRC=0x4b73053f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32le.pfm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32le.pfm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32le.pfm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/gbrpf32le.pfm 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -892c5a05e1cbb3d2f7761d51e18b9c4c *tests/data/images/gbrpf32le.pfm/02.gbrpf32le.pfm +887bd04126ce36509578c51e692f3d62 *tests/data/images/gbrpf32le.pfm/02.gbrpf32le.pfm 1216533 tests/data/images/gbrpf32le.pfm/02.gbrpf32le.pfm tests/data/images/gbrpf32le.pfm/%02d.gbrpf32le.pfm CRC=0x95e1053f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32be.pfm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32be.pfm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32be.pfm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32be.pfm 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -0f6df0d68d7dd30e67386b1255f443c9 *tests/data/images/grayf32be.pfm/02.grayf32be.pfm +d2c3a37f7bf52be25f3f56239b5fdd92 *tests/data/images/grayf32be.pfm/02.grayf32be.pfm 405524 tests/data/images/grayf32be.pfm/02.grayf32be.pfm tests/data/images/grayf32be.pfm/%02d.grayf32be.pfm CRC=0xe3fda443 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32le.pfm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32le.pfm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32le.pfm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/grayf32le.pfm 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -145715872a894b1fde0105d8a0106191 *tests/data/images/grayf32le.pfm/02.grayf32le.pfm +ea7aad8650d06c7cc8c80cc57cbac672 *tests/data/images/grayf32le.pfm/02.grayf32le.pfm 405525 tests/data/images/grayf32le.pfm/02.grayf32le.pfm tests/data/images/grayf32le.pfm/%02d.grayf32le.pfm CRC=0x5443a443 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -17e637fc06015fea86428840418ffea2 *tests/data/lavf/lavf.mkv -320403 tests/data/lavf/lavf.mkv +0934e35639b6735c1e26595e8f47ba70 *tests/data/lavf/lavf.mkv +320409 tests/data/lavf/lavf.mkv tests/data/lavf/lavf.mkv CRC=0xec6c3c68 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv_attachment mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv_attachment --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv_attachment 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mkv_attachment 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -3855fb336711517b32b0ec41e8505b4d *tests/data/lavf/lavf.mkv_attachment -472553 tests/data/lavf/lavf.mkv_attachment +d2708709bdd6817d9cb2b475fdfa903f *tests/data/lavf/lavf.mkv_attachment +472559 tests/data/lavf/lavf.mkv_attachment tests/data/lavf/lavf.mkv_attachment CRC=0xec6c3c68 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mxf_dv25 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mxf_dv25 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mxf_dv25 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/mxf_dv25 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ -3339def72599c79ad5860c6860cc3123 *tests/data/lavf/lavf.mxf_dv25 +59d632e097e6f45c28445b2ab862ffe8 *tests/data/lavf/lavf.mxf_dv25 3834413 tests/data/lavf/lavf.mxf_dv25 tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/qoipipe mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/qoipipe --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/qoipipe 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/qoipipe 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,3 @@ +3ce74fde1220ae2501fdfab48035efd8 *tests/data/lavf/qoipipe.qoi +7681407 tests/data/lavf/qoipipe.qoi +tests/data/lavf/qoipipe.qoi CRC=0x87b3c15f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/rm mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/rm --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/rm 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/rm 2023-03-03 13:29:59.000000000 +0000 @@ -1,2 +1,2 @@ -8dfb8d4556d61d3615e0d0012ffe540c *tests/data/lavf/lavf.rm +a7b0ac6e5131bbf662a07ccc82ab8618 *tests/data/lavf/lavf.rm 346424 tests/data/lavf/lavf.rm diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/sgi mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/sgi --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/sgi 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/sgi 2023-03-03 13:29:59.000000000 +0000 @@ -1,3 +1,3 @@ d446e540a7c18da5fd3cc0e9942cd46f *tests/data/images/sgi/02.sgi 307287 tests/data/images/sgi/02.sgi -tests/data/images/sgi/%02d.sgi CRC=0x6da01946 +tests/data/images/sgi/%02d.sgi CRC=0x36e71946 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/wbmp mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/wbmp --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/wbmp 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/wbmp 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,3 @@ +ebe2a887bd3098ac50502063257b4275 *tests/data/images/wbmp/02.wbmp +12678 tests/data/images/wbmp/02.wbmp +tests/data/images/wbmp/%02d.wbmp CRC=0xab19200d diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xbmpipe mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xbmpipe --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xbmpipe 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xbmpipe 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,3 @@ +ea7e2d589d25ddd0ad3d78ac0e82e351 *tests/data/lavf/xbmpipe.xbm +1910250 tests/data/lavf/xbmpipe.xbm +tests/data/lavf/xbmpipe.xbm CRC=0xfc010c66 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xwdpipe mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xwdpipe --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xwdpipe 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/lavf/xwdpipe 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,3 @@ +e5237d831790a02cf9b7d939557613ed *tests/data/lavf/xwdpipe.xwd +7605975 tests/data/lavf/xwdpipe.xwd +tests/data/lavf/xwdpipe.xwd CRC=0x87b3c15f diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/lavf-mkv mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/lavf-mkv --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/lavf-mkv 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/lavf-mkv 2023-03-03 13:29:59.000000000 +0000 @@ -1,48 +1,48 @@ -ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 651 size: 208 +ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 657 size: 208 ret: 0 st:-1 flags:0 ts:-1.000000 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret: 0 st:-1 flags:1 ts: 1.894167 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret: 0 st: 0 flags:0 ts: 0.788000 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret: 0 st: 0 flags:1 ts:-0.317000 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret:-1 st: 1 flags:0 ts: 2.577000 ret: 0 st: 1 flags:1 ts: 1.471000 -ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320124 size: 209 +ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320130 size: 209 ret: 0 st:-1 flags:0 ts: 0.365002 -ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146835 size: 27925 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146841 size: 27925 ret: 0 st:-1 flags:1 ts:-0.740831 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret:-1 st: 0 flags:0 ts: 2.153000 ret: 0 st: 0 flags:1 ts: 1.048000 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret: 0 st: 1 flags:0 ts:-0.058000 -ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 651 size: 208 +ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 657 size: 208 ret: 0 st: 1 flags:1 ts: 2.836000 -ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320124 size: 209 +ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320130 size: 209 ret:-1 st:-1 flags:0 ts: 1.730004 ret: 0 st:-1 flags:1 ts: 0.624171 -ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146835 size: 27925 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146841 size: 27925 ret: 0 st: 0 flags:0 ts:-0.482000 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret: 0 st: 0 flags:1 ts: 2.413000 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret:-1 st: 1 flags:0 ts: 1.307000 ret: 0 st: 1 flags:1 ts: 0.201000 -ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos: 651 size: 208 +ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 657 size: 208 ret: 0 st:-1 flags:0 ts:-0.904994 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret: 0 st:-1 flags:1 ts: 1.989173 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret: 0 st: 0 flags:0 ts: 0.883000 -ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292283 size: 27834 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 292289 size: 27834 ret: 0 st: 0 flags:1 ts:-0.222000 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 ret:-1 st: 1 flags:0 ts: 2.672000 ret: 0 st: 1 flags:1 ts: 1.566000 -ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320124 size: 209 +ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 320130 size: 209 ret: 0 st:-1 flags:0 ts: 0.460008 -ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146835 size: 27925 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 146841 size: 27925 ret: 0 st:-1 flags:1 ts:-0.645825 -ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos: 867 size: 27837 +ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 873 size: 27837 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-mpeg4-adap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-mpeg4-adap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-mpeg4-adap 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-mpeg4-adap 2023-03-03 13:29:59.000000000 +0000 @@ -2,45 +2,45 @@ ret: 0 st:-1 flags:0 ts:-1.000000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855 ret: 0 st:-1 flags:1 ts: 1.894167 -ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176 ret: 0 st: 0 flags:0 ts: 0.800000 -ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178 ret:-1 st: 0 flags:1 ts:-0.320000 ret:-1 st:-1 flags:0 ts: 2.576668 ret: 0 st:-1 flags:1 ts: 1.470835 -ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018 ret: 0 st: 0 flags:0 ts: 0.360000 -ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59446 size: 17261 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 35800 size: 17261 ret:-1 st: 0 flags:1 ts:-0.760000 ret:-1 st:-1 flags:0 ts: 2.153336 ret: 0 st:-1 flags:1 ts: 1.047503 -ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178 ret: 0 st: 0 flags:0 ts:-0.040000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855 ret: 0 st: 0 flags:1 ts: 2.840000 -ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176 ret: 0 st:-1 flags:0 ts: 1.730004 -ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176 ret: 0 st:-1 flags:1 ts: 0.624171 -ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59446 size: 17261 +ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 35800 size: 17261 ret: 0 st: 0 flags:0 ts:-0.480000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855 ret: 0 st: 0 flags:1 ts: 2.400000 -ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176 ret: 0 st:-1 flags:0 ts: 1.306672 -ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018 ret: 0 st:-1 flags:1 ts: 0.200839 ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855 ret: 0 st: 0 flags:0 ts:-0.920000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855 ret: 0 st: 0 flags:1 ts: 2.000000 -ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883 +ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176 ret: 0 st:-1 flags:0 ts: 0.883340 -ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178 ret:-1 st:-1 flags:1 ts:-0.222493 ret:-1 st: 0 flags:0 ts: 2.680000 ret: 0 st: 0 flags:1 ts: 1.560000 -ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525 +ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018 ret: 0 st:-1 flags:0 ts: 0.460008 -ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063 +ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178 ret:-1 st:-1 flags:1 ts:-0.645825 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/seek/vsynth_lena-svq1 2023-03-03 13:29:59.000000000 +0000 @@ -2,49 +2,49 @@ ret: 0 st:-1 flags:0 ts:-1.000000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret: 0 st:-1 flags:1 ts: 1.894167 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517672 size: 25636 ret: 0 st: 0 flags:0 ts: 0.788359 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326616 size: 23552 ret: 0 st: 0 flags:1 ts:-0.317500 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret:-1 st:-1 flags:0 ts: 2.576668 ret: 0 st:-1 flags:1 ts: 1.470835 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517672 size: 25636 ret: 0 st: 0 flags:0 ts: 0.365000 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157232 size: 21896 ret: 0 st: 0 flags:1 ts:-0.740859 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret:-1 st:-1 flags:0 ts: 2.153336 ret: 0 st:-1 flags:1 ts: 1.047503 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326616 size: 23552 ret: 0 st: 0 flags:0 ts:-0.058359 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret: 0 st: 0 flags:1 ts: 2.835859 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722884 size: 25888 ret: 0 st:-1 flags:0 ts: 1.730004 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722884 size: 25888 ret: 0 st:-1 flags:1 ts: 0.624171 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157232 size: 21896 ret: 0 st: 0 flags:0 ts:-0.481641 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret: 0 st: 0 flags:1 ts: 2.412500 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722884 size: 25888 ret: 0 st:-1 flags:0 ts: 1.306672 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517672 size: 25636 ret: 0 st:-1 flags:1 ts: 0.200839 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret: 0 st: 0 flags:0 ts:-0.905000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret: 0 st: 0 flags:1 ts: 1.989141 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722804 size: 25888 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 722884 size: 25888 ret: 0 st:-1 flags:0 ts: 0.883340 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326556 size: 23552 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 326616 size: 23552 ret: 0 st:-1 flags:1 ts:-0.222493 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 ret:-1 st: 0 flags:0 ts: 2.671641 ret: 0 st: 0 flags:1 ts: 1.565859 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517568 size: 25636 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 517672 size: 25636 ret: 0 st:-1 flags:0 ts: 0.460008 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157040 size: 21896 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 157232 size: 21896 ret: 0 st:-1 flags:1 ts:-0.645825 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 36 size: 22300 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-h263-obmc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-h263-obmc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-h263-obmc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-h263-obmc 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ 7dec64380f375e5118b66f3baaaa1e24 *tests/data/fate/vsynth1-h263-obmc.avi 657320 tests/data/fate/vsynth1-h263-obmc.avi -844f7ee27fa122e199fe20987b41a15c *tests/data/fate/vsynth1-h263-obmc.out.rawvideo -stddev: 8.16 PSNR: 29.89 MAXDIFF: 113 bytes: 7603200/ 7603200 +2a69f6b37378aa34418dfd04ec98c1c8 *tests/data/fate/vsynth1-h263-obmc.out.rawvideo +stddev: 8.38 PSNR: 29.66 MAXDIFF: 116 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-mpeg4-adap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-mpeg4-adap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-mpeg4-adap 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-mpeg4-adap 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -f120f0bf976bb510c5b5305fe7d8159a *tests/data/fate/vsynth1-mpeg4-adap.avi -403436 tests/data/fate/vsynth1-mpeg4-adap.avi -fad0b9dc08fe4a95b297af1a7411c1e9 *tests/data/fate/vsynth1-mpeg4-adap.out.rawvideo -stddev: 14.05 PSNR: 25.17 MAXDIFF: 184 bytes: 7603200/ 7603200 +0f1cbbdc3f9b91f2d9ac3d1fc2cf7d4e *tests/data/fate/vsynth1-mpeg4-adap.avi +325518 tests/data/fate/vsynth1-mpeg4-adap.avi +1e6c596f9f491fbf15920ef1bace7fb8 *tests/data/fate/vsynth1-mpeg4-adap.out.rawvideo +stddev: 14.12 PSNR: 25.13 MAXDIFF: 184 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-420p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-420p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-420p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-420p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +f905e05eabc8be20438d416722c34ed7 *tests/data/fate/vsynth1-speedhq-420p.avi +919156 tests/data/fate/vsynth1-speedhq-420p.avi +31e9b07d5e8ce0c8b7749e53fba05b1c *tests/data/fate/vsynth1-speedhq-420p.out.rawvideo +stddev: 14.06 PSNR: 25.17 MAXDIFF: 145 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-422p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-422p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-422p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-422p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +8f094b75b93b641c214bfaf743e584ad *tests/data/fate/vsynth1-speedhq-422p.avi +1028244 tests/data/fate/vsynth1-speedhq-422p.avi +967315914486c7ea979e4ce9ada04a6c *tests/data/fate/vsynth1-speedhq-422p.out.rawvideo +stddev: 13.86 PSNR: 25.29 MAXDIFF: 148 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-444p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-444p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-444p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-speedhq-444p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +5008149f0dd3d05d05f8f0f9100d39ec *tests/data/fate/vsynth1-speedhq-444p.avi +1347864 tests/data/fate/vsynth1-speedhq-444p.avi +23c5db6ca2bdbc52e402cd72ad2fff27 *tests/data/fate/vsynth1-speedhq-444p.out.rawvideo +stddev: 12.84 PSNR: 25.95 MAXDIFF: 145 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth1-svq1 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -39ec74da265e3ef27756618108641181 *tests/data/fate/vsynth1-svq1.mov -1334233 tests/data/fate/vsynth1-svq1.mov -9cc35c54b2c77d36bd7e308b393c1f81 *tests/data/fate/vsynth1-svq1.out.rawvideo -stddev: 9.58 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200 +89b1ec4d7bbee1ed2710c8cc8c1e269d *tests/data/fate/vsynth1-svq1.mov +1333561 tests/data/fate/vsynth1-svq1.mov +0b9ee47ee4bf735fe3697daad64fc409 *tests/data/fate/vsynth1-svq1.out.rawvideo +stddev: 9.57 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-h263-obmc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-h263-obmc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-h263-obmc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-h263-obmc 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ 2d8a58b295e03f94e6a41468b2d3909e *tests/data/fate/vsynth2-h263-obmc.avi 208522 tests/data/fate/vsynth2-h263-obmc.avi -4a939ef99fc759293f2e609bfcacd2a4 *tests/data/fate/vsynth2-h263-obmc.out.rawvideo -stddev: 6.10 PSNR: 32.41 MAXDIFF: 90 bytes: 7603200/ 7603200 +3500b4227c1e6309ca5213414599266f *tests/data/fate/vsynth2-h263-obmc.out.rawvideo +stddev: 6.19 PSNR: 32.29 MAXDIFF: 111 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-mpeg4-adap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-mpeg4-adap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-mpeg4-adap 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-mpeg4-adap 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -4bff98da2342836476da817428594403 *tests/data/fate/vsynth2-mpeg4-adap.avi -213508 tests/data/fate/vsynth2-mpeg4-adap.avi -0c709f2b81f4593eaa29490332c2cb39 *tests/data/fate/vsynth2-mpeg4-adap.out.rawvideo -stddev: 4.87 PSNR: 34.36 MAXDIFF: 86 bytes: 7603200/ 7603200 +06a397fe43dab7b6cf56870410fbbbaf *tests/data/fate/vsynth2-mpeg4-adap.avi +203000 tests/data/fate/vsynth2-mpeg4-adap.avi +686565d42d8ba5aea790824b04fa0a18 *tests/data/fate/vsynth2-mpeg4-adap.out.rawvideo +stddev: 4.55 PSNR: 34.95 MAXDIFF: 84 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-420p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-420p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-420p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-420p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +41795a070c6a13727cd1de7c65abd121 *tests/data/fate/vsynth2-speedhq-420p.avi +570618 tests/data/fate/vsynth2-speedhq-420p.avi +9f76f7f523a1b1efa99e55ebc874b58d *tests/data/fate/vsynth2-speedhq-420p.out.rawvideo +stddev: 8.67 PSNR: 29.37 MAXDIFF: 142 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-422p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-422p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-422p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-422p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +36bfdfdaecbf2938358137a598841377 *tests/data/fate/vsynth2-speedhq-422p.avi +622790 tests/data/fate/vsynth2-speedhq-422p.avi +3858c3c1524385150b2cff31cdb72e09 *tests/data/fate/vsynth2-speedhq-422p.out.rawvideo +stddev: 8.62 PSNR: 29.42 MAXDIFF: 142 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-444p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-444p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-444p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-speedhq-444p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +62e4caac219e2d79d0c7a8b34b66d4ae *tests/data/fate/vsynth2-speedhq-444p.avi +813586 tests/data/fate/vsynth2-speedhq-444p.avi +c3fe2a70c17979dbf08100aba9c05934 *tests/data/fate/vsynth2-speedhq-444p.out.rawvideo +stddev: 8.35 PSNR: 29.69 MAXDIFF: 142 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth2-svq1 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -1c12440c323bc8ace5464587b5369c4a *tests/data/fate/vsynth2-svq1.mov -940289 tests/data/fate/vsynth2-svq1.mov -a8cd3b833cd7f570ddbf1e6b3eb125b6 *tests/data/fate/vsynth2-svq1.out.rawvideo +14f355a06d475dcf6a90ac6ab3ae2970 *tests/data/fate/vsynth2-svq1.mov +940357 tests/data/fate/vsynth2-svq1.mov +ba8f6b721a8e19fe8a6ef92a8cff7479 *tests/data/fate/vsynth2-svq1.out.rawvideo stddev: 3.71 PSNR: 36.72 MAXDIFF: 210 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-mpeg4-adap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-mpeg4-adap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-mpeg4-adap 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-mpeg4-adap 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -c16e5c2436ca9953517eadba562768e9 *tests/data/fate/vsynth3-mpeg4-adap.avi -43706 tests/data/fate/vsynth3-mpeg4-adap.avi -b42b614e19e7c4859fca1af6d4e36eae *tests/data/fate/vsynth3-mpeg4-adap.out.rawvideo -stddev: 5.48 PSNR: 33.34 MAXDIFF: 53 bytes: 86700/ 86700 +6b2f641f2e68b11b992fd6ba1ed66a21 *tests/data/fate/vsynth3-mpeg4-adap.avi +41012 tests/data/fate/vsynth3-mpeg4-adap.avi +3483a2032cb02c3a37f5e43b128e59ed *tests/data/fate/vsynth3-mpeg4-adap.out.rawvideo +stddev: 5.79 PSNR: 32.87 MAXDIFF: 49 bytes: 86700/ 86700 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth3-svq1 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -1972e0df8be667443992e405cceec291 *tests/data/fate/vsynth3-svq1.mov -40773 tests/data/fate/vsynth3-svq1.mov -a1e5334cf67649bf8c7d95dc4d1bf148 *tests/data/fate/vsynth3-svq1.out.rawvideo +969dcdd69774b9c42dcf81e8dd393364 *tests/data/fate/vsynth3-svq1.mov +40777 tests/data/fate/vsynth3-svq1.mov +a99efde992a2e3efcc085ecc6920a1e3 *tests/data/fate/vsynth3-svq1.out.rawvideo stddev: 14.49 PSNR: 24.91 MAXDIFF: 183 bytes: 86700/ 86700 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-h263-obmc mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-h263-obmc --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-h263-obmc 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-h263-obmc 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ 3c6946f808412ac320be9e0c36051ea2 *tests/data/fate/vsynth_lena-h263-obmc.avi 154730 tests/data/fate/vsynth_lena-h263-obmc.avi -588d992d9d8096da8bdc5027268da914 *tests/data/fate/vsynth_lena-h263-obmc.out.rawvideo -stddev: 5.39 PSNR: 33.49 MAXDIFF: 82 bytes: 7603200/ 7603200 +737af7fb166e2260ba049ae6bc30673d *tests/data/fate/vsynth_lena-h263-obmc.out.rawvideo +stddev: 5.42 PSNR: 33.44 MAXDIFF: 77 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-mpeg4-adap mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-mpeg4-adap --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-mpeg4-adap 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-mpeg4-adap 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -c6108621b1202d32dac68b1944c5b8c2 *tests/data/fate/vsynth_lena-mpeg4-adap.avi -198500 tests/data/fate/vsynth_lena-mpeg4-adap.avi -87b6dbe98d276137fceaae2fa672eced *tests/data/fate/vsynth_lena-mpeg4-adap.out.rawvideo -stddev: 3.75 PSNR: 36.65 MAXDIFF: 71 bytes: 7603200/ 7603200 +633da125f46391eef33bb031cd728f4b *tests/data/fate/vsynth_lena-mpeg4-adap.avi +187598 tests/data/fate/vsynth_lena-mpeg4-adap.avi +21312bfcb28c40299fb27a5b03477f8c *tests/data/fate/vsynth_lena-mpeg4-adap.out.rawvideo +stddev: 3.63 PSNR: 36.92 MAXDIFF: 71 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-420p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-420p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-420p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-420p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +0669a27deca78e92b998aa5b616f87f2 *tests/data/fate/vsynth_lena-speedhq-420p.avi +487888 tests/data/fate/vsynth_lena-speedhq-420p.avi +4dc98e7ffb7c1ade85cf6bed75ee9a68 *tests/data/fate/vsynth_lena-speedhq-420p.out.rawvideo +stddev: 7.48 PSNR: 30.64 MAXDIFF: 125 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-422p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-422p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-422p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-422p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +40a9b249daf3cf5ab3fc99a874907c20 *tests/data/fate/vsynth_lena-speedhq-422p.avi +536206 tests/data/fate/vsynth_lena-speedhq-422p.avi +d48a61d173005609e5e06b0027c98a0e *tests/data/fate/vsynth_lena-speedhq-422p.out.rawvideo +stddev: 7.48 PSNR: 30.65 MAXDIFF: 138 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-444p mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-444p --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-444p 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-speedhq-444p 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,4 @@ +ce099dfae05cd224ef94c89476176a1c *tests/data/fate/vsynth_lena-speedhq-444p.avi +702980 tests/data/fate/vsynth_lena-speedhq-444p.avi +e2661cb41d9f59cd1a62b49b3a058e74 *tests/data/fate/vsynth_lena-speedhq-444p.out.rawvideo +stddev: 7.23 PSNR: 30.94 MAXDIFF: 125 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-svq1 mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-svq1 --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-svq1 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tests/ref/vsynth/vsynth_lena-svq1 2023-03-03 13:29:59.000000000 +0000 @@ -1,4 +1,4 @@ -a6398d8fd306cfe96dc41060335e67e8 *tests/data/fate/vsynth_lena-svq1.mov -766701 tests/data/fate/vsynth_lena-svq1.mov -aa03471dac3f49455a33a2b19fda1098 *tests/data/fate/vsynth_lena-svq1.out.rawvideo +8890d9ca13934391b6891ac5f67897c6 *tests/data/fate/vsynth_lena-svq1.mov +766837 tests/data/fate/vsynth_lena-svq1.mov +85261558fa744ef468fe77dbe4d91d8d *tests/data/fate/vsynth_lena-svq1.out.rawvideo stddev: 3.23 PSNR: 37.93 MAXDIFF: 61 bytes: 7603200/ 7603200 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/decode_simple.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/decode_simple.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/decode_simple.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/decode_simple.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ int ret = 0; while (ret >= 0 && - (dc->max_frames == 0 || dc->decoder->frame_number < dc->max_frames)) { + (dc->max_frames == 0 || dc->decoder->frame_num < dc->max_frames)) { ret = avcodec_receive_frame(dc->decoder, dc->frame); if (ret < 0) { if (ret == AVERROR_EOF) { @@ -55,11 +55,11 @@ if (ret < 0) return ret; - if (dc->max_frames && dc->decoder->frame_number == dc->max_frames) + if (dc->max_frames && dc->decoder->frame_num == dc->max_frames) return 1; } - return (dc->max_frames == 0 || dc->decoder->frame_number < dc->max_frames) ? 0 : 1; + return (dc->max_frames == 0 || dc->decoder->frame_num < dc->max_frames) ? 0 : 1; } int ds_run(DecodeContext *dc) diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/general_assembly.pl mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/general_assembly.pl --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/general_assembly.pl 1970-01-01 00:00:00.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/general_assembly.pl 2023-03-03 13:29:59.000000000 +0000 @@ -0,0 +1,40 @@ +#!/usr/bin/env perl + +use warnings; +use strict; + +use POSIX qw(strftime); +use Encode qw(decode); +use Data::Dumper; + +sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; + +my @shortlog = split /\n/, decode('UTF-8', `git log --pretty=format:"%aN <%aE>" --since="last 36 months" | sort | uniq -c | sort -r`, Encode::FB_CROAK); +my %assembly = (); + +foreach my $line (@shortlog) { + my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/; + if ($count < 20) { + next; + } + + $name = trim $name; + if ($count < 50) { + my $true = 0; + my @commits = split /(^|\n)commit [a-z0-9]{40}(\n|$)/, decode('UTF-8', `git log --name-only --use-mailmap --author="$email" --since="last 36 months"`, Encode::FB_CROAK); + foreach my $commit (@commits) { + $true++; # if ($commit =~ /\n[\w\/]+\.(c|h|S|asm|texi)/); + } + + if ($true < 20) { + next; + } + } + + $assembly{$name} = $email; +} + +printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK)); +foreach my $email (sort values %assembly) { + printf("%s\n", $email); +} diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/Makefile mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/Makefile --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/Makefile 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/Makefile 2023-03-03 13:29:59.000000000 +0000 @@ -20,6 +20,8 @@ tools/venc_data_dump$(EXESUF): tools/decode_simple.o tools/scale_slice_test$(EXESUF): tools/decode_simple.o +tools/decode_simple.o: | tools + OUTDIRS += tools clean:: diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/scale_slice_test.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/scale_slice_test.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/scale_slice_test.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/scale_slice_test.c 2023-03-03 13:29:59.000000000 +0000 @@ -100,8 +100,8 @@ if (memcmp(pd->frame_ref->data[i], pd->frame_dst->data[i], pd->frame_ref->linesize[i] * (pd->frame_ref->height >> shift))) { - fprintf(stderr, "mismatch frame %d seed %u\n", - dc->decoder->frame_number - 1, pd->random_seed); + fprintf(stderr, "mismatch frame %"PRId64" seed %u\n", + dc->decoder->frame_num - 1, pd->random_seed); return AVERROR(EINVAL); } } diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/target_dec_fuzzer.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/target_dec_fuzzer.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/target_dec_fuzzer.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/target_dec_fuzzer.c 2023-03-03 13:29:59.000000000 +0000 @@ -81,8 +81,8 @@ return ffcodec(res); } -static int subtitle_handler(AVCodecContext *avctx, void *frame, - int *got_sub_ptr, AVPacket *avpkt) +static int subtitle_handler(AVCodecContext *avctx, AVFrame *unused, + int *got_sub_ptr, const AVPacket *avpkt) { AVSubtitle sub; int ret = avcodec_decode_subtitle2(avctx, &sub, got_sub_ptr, avpkt); @@ -213,7 +213,9 @@ case AV_CODEC_ID_ANM: maxpixels /= 1024; break; case AV_CODEC_ID_ARBC: maxpixels /= 1024; break; case AV_CODEC_ID_ARGO: maxpixels /= 1024; break; + case AV_CODEC_ID_BETHSOFTVID: maxpixels /= 8192; break; case AV_CODEC_ID_BINKVIDEO: maxpixels /= 32; break; + case AV_CODEC_ID_BONK: maxsamples /= 1<<20; break; case AV_CODEC_ID_CDTOONS: maxpixels /= 1024; break; case AV_CODEC_ID_CFHD: maxpixels /= 16384; break; case AV_CODEC_ID_CINEPAK: maxpixels /= 128; break; @@ -225,6 +227,7 @@ case AV_CODEC_ID_DVB_SUBTITLE: av_dict_set_int(&opts, "compute_clut", -2, 0); break; case AV_CODEC_ID_DXA: maxpixels /= 32; break; case AV_CODEC_ID_DXV: maxpixels /= 32; break; + case AV_CODEC_ID_FFV1: maxpixels /= 32; break; case AV_CODEC_ID_FFWAVESYNTH: maxsamples /= 16384; break; case AV_CODEC_ID_FLAC: maxsamples /= 1024; break; case AV_CODEC_ID_FLIC: maxpixels /= 1024; break; @@ -241,7 +244,7 @@ case AV_CODEC_ID_IFF_ILBM: maxpixels /= 128; break; case AV_CODEC_ID_INDEO4: maxpixels /= 128; break; case AV_CODEC_ID_INTERPLAY_ACM: maxsamples /= 16384; break; - case AV_CODEC_ID_JPEG2000: maxpixels /= 16; break; + case AV_CODEC_ID_JPEG2000: maxpixels /= 4096; break; case AV_CODEC_ID_LAGARITH: maxpixels /= 1024; break; case AV_CODEC_ID_LOCO: maxpixels /= 1024; break; case AV_CODEC_ID_VORBIS: maxsamples /= 1024; break; @@ -253,14 +256,19 @@ case AV_CODEC_ID_MSRLE: maxpixels /= 16; break; case AV_CODEC_ID_MSS2: maxpixels /= 16384; break; case AV_CODEC_ID_MSZH: maxpixels /= 128; break; + case AV_CODEC_ID_MTS2: maxpixels /= 4096; break; case AV_CODEC_ID_MVC2: maxpixels /= 128; break; + case AV_CODEC_ID_MVDV: maxpixels /= 1024; break; + case AV_CODEC_ID_MWSC: maxpixels /= 256; break; case AV_CODEC_ID_MXPEG: maxpixels /= 128; break; + case AV_CODEC_ID_NUV: maxpixels /= 128; break; case AV_CODEC_ID_OPUS: maxsamples /= 16384; break; case AV_CODEC_ID_PNG: maxpixels /= 128; break; case AV_CODEC_ID_APNG: maxpixels /= 128; break; case AV_CODEC_ID_QTRLE: maxpixels /= 16; break; case AV_CODEC_ID_PAF_VIDEO: maxpixels /= 16; break; case AV_CODEC_ID_PRORES: maxpixels /= 256; break; + case AV_CODEC_ID_RSCC: maxpixels /= 256; break; case AV_CODEC_ID_RASC: maxpixels /= 16; break; case AV_CODEC_ID_SANM: maxpixels /= 16; break; case AV_CODEC_ID_SCPR: maxpixels /= 32; break; @@ -276,9 +284,12 @@ case AV_CODEC_ID_TQI: maxpixels /= 1024; break; case AV_CODEC_ID_TRUEMOTION2: maxpixels /= 1024; break; case AV_CODEC_ID_TSCC: maxpixels /= 1024; break; + case AV_CODEC_ID_UTVIDEO: maxpixels /= 1024; break; + case AV_CODEC_ID_VB: maxpixels /= 1024; break; case AV_CODEC_ID_VC1: maxpixels /= 8192; break; case AV_CODEC_ID_VC1IMAGE: maxpixels /= 8192; break; case AV_CODEC_ID_VMNC: maxpixels /= 8192; break; + case AV_CODEC_ID_VMDVIDEO: maxpixels /= 1024; break; case AV_CODEC_ID_VP3: maxpixels /= 4096; break; case AV_CODEC_ID_VP4: maxpixels /= 4096; break; case AV_CODEC_ID_VP5: maxpixels /= 256; break; @@ -294,6 +305,7 @@ case AV_CODEC_ID_WMALOSSLESS: maxsamples /= 1024; break; case AV_CODEC_ID_YLC: maxpixels /= 1024; break; case AV_CODEC_ID_ZEROCODEC: maxpixels /= 128; break; + case AV_CODEC_ID_ZLIB: maxpixels /= 4096; break; } maxsamples_per_frame = FFMIN(maxsamples_per_frame, maxsamples); @@ -337,7 +349,7 @@ if ((flags & 0x10) && c->p.id != AV_CODEC_ID_H264) ctx->flags2 |= AV_CODEC_FLAG2_FAST; if (flags & 0x80) - ctx->flags2 |= AV_CODEC_FLAG2_EXPORT_MVS; + ctx->export_side_data |= AV_CODEC_EXPORT_DATA_MVS; if (flags & 0x40) av_force_cpu_flags(0); @@ -405,6 +417,12 @@ ctx->debug |= FF_DEBUG_QP; if (flags64 &4) ctx->debug |= FF_DEBUG_MB_TYPE; + if (flags64 & 8) + ctx->export_side_data |= AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS; + if (flags64 & 0x10) + ctx->err_recognition |= AV_EF_CRCCHECK; + + ctx->workaround_bugs = bytestream2_get_le32(&gbc); if (extradata_size < size) { ctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/venc_data_dump.c mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/venc_data_dump.c --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/build_deps/ffmpeg/tools/venc_data_dump.c 2023-01-29 05:16:38.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/build_deps/ffmpeg/tools/venc_data_dump.c 2023-03-03 13:29:59.000000000 +0000 @@ -38,7 +38,7 @@ if (!frame) return 0; - fprintf(stdout, "frame %d\n", dc->decoder->frame_number - 1); + fprintf(stdout, "frame %"PRId64"\n", dc->decoder->frame_num - 1); sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS); if (sd) { diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/changelog mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/changelog --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/changelog 2023-01-29 05:17:23.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/changelog 2023-03-03 13:31:58.000000000 +0000 @@ -1,12 +1,12 @@ -mpv (0.35.1+ffmpeg5.1.2~ubuntu20.04.1) focal; urgency=low +mpv (0.35.1+ffmpeg6.0~ubuntu20.04.1) focal; urgency=low * Auto build. - -- Pavel Sun, 29 Jan 2023 05:17:23 +0000 + -- Pavel Fri, 03 Mar 2023 13:31:58 +0000 -mpv (0.35.1+ffmpeg5.1.2) UNRELEASED; urgency=medium +mpv (0.35.1+ffmpeg6.0) UNRELEASED; urgency=medium * mpv 0.35.1 - * ffmpeg 5.1.2 + * ffmpeg 6.0 -- No name Sat, 19 Sep 2020 18:32:25 +0500 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/control mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/control --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/control 2023-01-29 05:17:23.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/control 2023-03-03 13:31:58.000000000 +0000 @@ -93,7 +93,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: xdg-utils, youtube-dl (>= 2014.11.26) +Recommends: xdg-utils, yt-dlp +Suggests: libcuda1 [amd64 arm64 i386] Multi-Arch: foreign Description: video player based on MPlayer/mplayer2 mpv is a movie player based on MPlayer and mplayer2. It supports a wide diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/git-build-recipe.manifest mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/git-build-recipe.manifest --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/debian/git-build-recipe.manifest 2023-01-29 05:17:23.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/debian/git-build-recipe.manifest 2023-03-03 13:31:58.000000000 +0000 @@ -1,5 +1,5 @@ # git-build-recipe format 0.4 deb-version {debupstream} lp:mpv git-commit:140ec21c89d671d392877a7f3b91d67e7d7b9239 nest ffnvcodec lp:~mpv-team/mpv/+git/nv-codec-headers build_deps/nv-codec-headers git-commit:f39aa208fb9f1c9ed4461a781e7bd3d423f8d1ba -nest ffmpeg lp:~mpv-team/mpv/+git/ffmpeg build_deps/ffmpeg git-commit:30d432f205538f6ef6c86ed0a90e27cdd735cd2b -merge debian lp:~spvkgn/+git/mpv-ffmpeg-pkg git-commit:7bee3aae48147b1f87476ca1567270fbb8db13a7 +nest ffmpeg lp:~mpv-team/mpv/+git/ffmpeg build_deps/ffmpeg git-commit:46970dd1555b3e50eee48ec95c893ee9a52f7fab +merge debian lp:~spvkgn/+git/mpv-ffmpeg-pkg git-commit:9932748f753a45ae865c33768390e0282af60c92 diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/.pc/.quilt_patches mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/.pc/.quilt_patches --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/.pc/.quilt_patches 2023-01-29 05:17:23.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/.pc/.quilt_patches 2023-03-03 13:31:58.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-3486435/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches +/home/buildd/build-RECIPEBRANCHBUILD-3504014/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches diff -Nru mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/.pc/.quilt_series mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/.pc/.quilt_series --- mpv-0.35.1+ffmpeg5.1.2~ubuntu20.04.1/.pc/.quilt_series 2023-01-29 05:17:23.000000000 +0000 +++ mpv-0.35.1+ffmpeg6.0~ubuntu20.04.1/.pc/.quilt_series 2023-03-03 13:31:58.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-3486435/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series +/home/buildd/build-RECIPEBRANCHBUILD-3504014/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series